diff --git a/assets/Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js b/assets/Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js similarity index 87% rename from assets/Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js rename to assets/Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js index 1408780b453912ebd03789281ae1be74c116b703..db4d69b5dc311e7ca6f66734b7da4b1d6b4d2fdf 100644 --- a/assets/Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js +++ b/assets/Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js @@ -1 +1 @@ -import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";import{d as p,bN as m,bO as f,af as b,c,o as v,p as r,b as y,c3 as u,c4 as V,y as C,C as g,bQ as k,a as s,b_ as x,D as i}from"./index-DfQ41DTF.js";const _={op50:""},w=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=f(o,"modelValue");b(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),c("div",null,[r(l.$slots,"trigger",u(V({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]=B=>e.value=!e.value)},[s("span",null,i(t.label??"Collapsable"),1),a[1]||(a[1]=x()),s("span",_,i(e.value?"▲":"▼"),1)])]),y(d,null,{default:C(()=>[e.value?r(l.$slots,"default",u(k({key:0},{visible:e.value,setVisible:n}))):g("",!0)]),_:3})]))}});export{w as _}; +import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";import{d as p,bN as m,bO as f,af as b,c,o as v,p as r,b as y,c3 as u,c4 as V,y as C,C as g,bQ as k,a as s,b_ as x,D as i}from"./index-Dn5R1iW2.js";const _={op50:""},w=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=f(o,"modelValue");b(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),c("div",null,[r(l.$slots,"trigger",u(V({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]=B=>e.value=!e.value)},[s("span",null,i(t.label??"Collapsable"),1),a[1]||(a[1]=x()),s("span",_,i(e.value?"▲":"▼"),1)])]),y(d,null,{default:C(()=>[e.value?r(l.$slots,"default",u(k({key:0},{visible:e.value,setVisible:n}))):g("",!0)]),_:3})]))}});export{w as _}; diff --git a/assets/HeaderLink-krzA17lf.js b/assets/HeaderLink-CWVUXFCL.js similarity index 90% rename from assets/HeaderLink-krzA17lf.js rename to assets/HeaderLink-CWVUXFCL.js index 257a1ababcdd938fa92a6da48c4edff1574dacad..f551859aa2f1b49ba63602140049626ec5db6704 100644 --- a/assets/HeaderLink-krzA17lf.js +++ b/assets/HeaderLink-CWVUXFCL.js @@ -1 +1 @@ -import{d as r,bC as c,x as l,e,bo as d,o as s,y as _,c as t,a,bn as i}from"./index-DfQ41DTF.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],x=r({__name:"HeaderLink",setup(g){const n=c();return(f,o)=>(s(),l(e(d),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:_(()=>[e(n)?(s(),t("img",{key:0,src:e(k),"h-8":"","w-8":"",class:"theme-colored"},null,8,u)):(s(),t("img",{key:1,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1}))}}),w=i(x,[["__scopeId","data-v-496b6cde"]]);export{w as H}; +import{d as r,bC as c,x as l,e,bo as d,o as s,y as _,c as t,a,bn as i}from"./index-Dn5R1iW2.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],x=r({__name:"HeaderLink",setup(g){const n=c();return(f,o)=>(s(),l(e(d),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:_(()=>[e(n)?(s(),t("img",{key:0,src:e(k),"h-8":"","w-8":"",class:"theme-colored"},null,8,u)):(s(),t("img",{key:1,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1}))}}),w=i(x,[["__scopeId","data-v-496b6cde"]]);export{w as H}; diff --git a/assets/IconStatusItem-CFCfq1lX.js b/assets/IconStatusItem-BS_oFW9i.js similarity index 94% rename from assets/IconStatusItem-CFCfq1lX.js rename to assets/IconStatusItem-BS_oFW9i.js index 449929b1f7d9a022e6c069cf934616699d8460c1..d6552c2daf93bd72760ccf702f2880899b04e741 100644 --- a/assets/IconStatusItem-CFCfq1lX.js +++ b/assets/IconStatusItem-BS_oFW9i.js @@ -1 +1 @@ -import{d as u,r as c,c as e,o as n,b as d,a as o,y as m,C as a,D as i,z as s,bn as _}from"./index-DfQ41DTF.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";const p={flex:"~ col",bg:"neutral-200/50 dark:neutral-700",border:"neutral-100 dark:neutral-700 hover:primary-500/30 dark:hover:primary-400/30 solid 2","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-bold":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},k={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},f=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},y={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},b=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(C,I)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"neutral-50 dark:neutral-800",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-883ae105"]]);export{B as I}; +import{d as u,r as c,c as e,o as n,b as d,a as o,y as m,C as a,D as i,z as s,bn as _}from"./index-Dn5R1iW2.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";const p={flex:"~ col",bg:"neutral-200/50 dark:neutral-700",border:"neutral-100 dark:neutral-700 hover:primary-500/30 dark:hover:primary-400/30 solid 2","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-bold":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},k={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},f=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},y={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},b=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(C,I)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"neutral-50 dark:neutral-800",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-883ae105"]]);export{B as I}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-CXVrD7v3.js b/assets/Model.vue_vue_type_script_setup_true_lang-NsUHJ7rm.js similarity index 97% rename from assets/Model.vue_vue_type_script_setup_true_lang-CXVrD7v3.js rename to assets/Model.vue_vue_type_script_setup_true_lang-NsUHJ7rm.js index dc10d0e24b561713438405da81b95c5f31cdf0f7..53be008b61b073f47cb0342cad3369b1ae061dbe 100644 --- a/assets/Model.vue_vue_type_script_setup_true_lang-CXVrD7v3.js +++ b/assets/Model.vue_vue_type_script_setup_true_lang-NsUHJ7rm.js @@ -1 +1 @@ -import{o as F,T as Y,A as re,L as P,p as q,n as ue,r as se,D as de,I as ce,m as R,M as ve,q as T}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as $,g as h,w as p,m as j,H as G,c as N,o as X,p as J,br as z,h as O,bC as pe,j as he,G as fe,s as me,v as ge,bJ as Me,bK as we,bx as ye,a as be,q as Se}from"./index-DfQ41DTF.js";const ke=$({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=h(),e=h(),i=h();async function c(n){P.registerTicker(q),F.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()),j(async()=>d.value&&await c(d.value)),G(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function B(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:B}),(n,g)=>(X(),N("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[J(n.$slots,"default",{app:e.value})],512))}}),xe=o=>Math.max(0,Math.min(1,o||0)),C=o=>Math.round(xe(o)*255),Be=ue("rgb"),Ce=o=>{if(o===void 0)return;let l=C(o.r),t=C(o.g),d=C(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Fe=o=>Ce(Be(o));function V(o,l,t){return(1-t)*o+t*l}function H(o,l){return o+Math.random()*(l-o)}function Pe(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=z(()=>l.paused),e=h(),i=h(0),c=h(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),B=pe(),n=he(Se),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),K=Pe(),I=fe(new de({alpha:.2,blur:0,distance:20,rotation:45}));function U(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const f=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(f,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:W,availableLive2dMotions:Q,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=me(ge()),ee=h({group:"Idle",index:0});async function ae(){var L;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new P;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,f=r.coreModel,s=r.motionManager;f.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&&K.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;P.registerTicker(q),F.add(Y),F.add(ce);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,ve.FORCE)}const oe=Me(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=h(),w=h(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Fe(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(B,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=>U().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(W,a=>le(a.group,a.index)),p(d,a=>{var r,f;a?(r=t.value)==null||r.stop():(f=t.value)==null||f.start()}),we(M,a=>{a&&ae()},{debounce:1e3}),j(x),G(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(X(),N(ye,null,[be("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),J(a.$slots,"default")],64))}});export{_e as _,ke as a,H as r}; +import{o as F,T as Y,A as re,L as P,p as q,n as ue,r as se,D as de,I as ce,m as R,M as ve,q as T}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as $,g as h,w as p,m as j,H as G,c as N,o as X,p as J,br as z,h as O,bC as pe,j as he,G as fe,s as me,v as ge,bJ as Me,bK as we,bx as ye,a as be,q as Se}from"./index-Dn5R1iW2.js";const ke=$({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=h(),e=h(),i=h();async function c(n){P.registerTicker(q),F.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()),j(async()=>d.value&&await c(d.value)),G(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function B(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:B}),(n,g)=>(X(),N("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[J(n.$slots,"default",{app:e.value})],512))}}),xe=o=>Math.max(0,Math.min(1,o||0)),C=o=>Math.round(xe(o)*255),Be=ue("rgb"),Ce=o=>{if(o===void 0)return;let l=C(o.r),t=C(o.g),d=C(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Fe=o=>Ce(Be(o));function V(o,l,t){return(1-t)*o+t*l}function H(o,l){return o+Math.random()*(l-o)}function Pe(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=z(()=>l.paused),e=h(),i=h(0),c=h(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),B=pe(),n=he(Se),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),K=Pe(),I=fe(new de({alpha:.2,blur:0,distance:20,rotation:45}));function U(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const f=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(f,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:W,availableLive2dMotions:Q,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=me(ge()),ee=h({group:"Idle",index:0});async function ae(){var L;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new P;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,f=r.coreModel,s=r.motionManager;f.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&&K.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;P.registerTicker(q),F.add(Y),F.add(ce);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,ve.FORCE)}const oe=Me(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=h(),w=h(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Fe(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(B,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=>U().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(W,a=>le(a.group,a.index)),p(d,a=>{var r,f;a?(r=t.value)==null||r.stop():(f=t.value)==null||f.start()}),we(M,a=>{a&&ae()},{debounce:1e3}),j(x),G(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(X(),N(ye,null,[be("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),J(a.$slots,"default")],64))}});export{_e as _,ke as a,H as r}; diff --git a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js similarity index 83% rename from assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js rename to assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js index 4d1b1db0b7c1f6da13c093f085fcba2c8008dd4d..9d0dedae676e858e4d89b12671fc43e7270a4df7 100644 --- a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js +++ b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js @@ -1 +1 @@ -import{_ as u}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import{d as t,bN as i,bO as n,h as s,x as m,o as p}from"./index-DfQ41DTF.js";const b=t({__name:"ProviderApiKeyInput",props:i({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,o=n(e,"modelValue"),a=s(()=>l.description||`API Key for ${l.providerName}`);return(c,r)=>(p(),m(u,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=d=>o.value=d),label:e.label||"API Key",description:a.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{b as _}; +import{_ as u}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import{d as t,bN as i,bO as n,h as s,x as m,o as p}from"./index-Dn5R1iW2.js";const b=t({__name:"ProviderApiKeyInput",props:i({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,o=n(e,"modelValue"),a=s(()=>l.description||`API Key for ${l.providerName}`);return(c,r)=>(p(),m(u,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=d=>o.value=d),label:e.label||"API Key",description:a.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{b as _}; diff --git a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js similarity index 88% rename from assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js rename to assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js index b8c18303ac1734e99a32165ae443bf1728ebe157..066fde74705a67071972709b6d21cc56336d3757 100644 --- a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js +++ b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js @@ -1 +1 @@ -import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import{d,g as m,x as u,o as c,y as n,a as e,p as f,D as _,z as v,bN as b,bO as g}from"./index-DfQ41DTF.js";import{_ as V}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";const x=["onClick"],h={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},y={"mt-4":""},q=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function r(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(s=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>s.setVisible(!s.visible)&&r()},[e("h2",h,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":s.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,x)]),default:n(()=>[e("div",y,[f(o.$slots,"default")])]),_:3}))}}),w=d({__name:"ProviderBaseUrlInput",props:b({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=g(l,"modelValue");return(r,o)=>(c(),u(V,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),label:t.label||"Base URL",description:t.description||"Custom base URL (optional)",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{q as _,w as a}; +import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import{d,g as m,x as u,o as c,y as n,a as e,p as f,D as _,z as v,bN as b,bO as g}from"./index-Dn5R1iW2.js";import{_ as V}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";const x=["onClick"],h={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},y={"mt-4":""},q=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function r(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(s=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>s.setVisible(!s.visible)&&r()},[e("h2",h,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":s.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,x)]),default:n(()=>[e("div",y,[f(o.$slots,"default")])]),_:3}))}}),w=d({__name:"ProviderBaseUrlInput",props:b({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=g(l,"modelValue");return(r,o)=>(c(),u(V,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),label:t.label||"Base URL",description:t.description||"Custom base URL (optional)",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{q as _,w as a}; diff --git a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js similarity index 98% rename from assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js rename to assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js index 3b94990eaea6b2e9efc4a63e8e019f208e77e6a1..ca5425698557923f96a939dea921fe1c7bd16383 100644 --- a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js +++ b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js @@ -1 +1 @@ -import{d,bN as b,bO as k,A as p,c0 as y,o as a,c as o,h as g,a as t,b as h,b_ as _,C as x,D as i,z as v,p as c,bw as $,bx as V}from"./index-DfQ41DTF.js";const w=["type"],C=d({__name:"Input",props:b({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const n=e,l=k(e,"modelValue");return(r,s)=>p((a(),o("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>l.value=u),type:n.type||"text",border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,8,w)),[[y,l.value]])}}),B={"max-w-full":""},N={flex:"~ col gap-4"},I={class:"flex items-center gap-1 text-sm font-medium"},D={key:0,class:"text-red-500"},R={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},L=d({__name:"FieldInput",props:{modelValue:null,label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},emits:["update:modelValue"],setup(e,{emit:n}){const l=e,r=n,s=g({get:()=>l.modelValue,set:u=>r("update:modelValue",u)});return(u,m)=>(a(),o("div",B,[t("label",N,[t("div",null,[t("div",I,[_(i(e.label)+" ",1),e.required!==!1?(a(),o("span",D,"*")):x("",!0)]),t("div",R,i(e.description),1)]),h(C,{modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=f=>s.value=f),type:e.type,placeholder:e.placeholder,class:v(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}}),S={flex:"~ col gap-6"},F={flex:"~ row","items-center":"","justify-between":""},M={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},P={text:"neutral-400 dark:neutral-500"},O=d({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(e){return(n,l)=>(a(),o("div",S,[t("div",F,[t("div",null,[t("h2",M,i(e.title||"Basic"),1),t("div",P,[t("span",null,i(e.description||"Essential settings"),1)])]),e.onReset?(a(),o("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:l[0]||(l[0]=(...r)=>e.onReset&&e.onReset(...r))},l[1]||(l[1]=[t("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):x("",!0)]),c(n.$slots,"default")]))}}),q={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},T=d({__name:"ProviderSettingsContainer",setup(e){return(n,l)=>(a(),o("div",q,[c(n.$slots,"default")]))}}),j={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},z={relative:""},E={"text-3xl":"","font-semibold":""},U={text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},G=d({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,l)=>{const r=$("motion");return a(),o(V,null,[p((a(),o("div",j,[t("button",{onClick:l[0]||(l[0]=(...s)=>e.onBack&&e.onBack(...s))},l[1]||(l[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",z,[l[2]||(l[2]=t("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[t("span",{text:"neutral-300 dark:neutral-500"},"Provider")],-1)),t("div",E,i(e.providerName),1)])])),[[r]]),c(n.$slots,"default"),t("div",U,[t("div",{text:"40",class:v(e.providerIcon||e.providerIconColor)},null,2)])],64)}}});export{L as _,T as a,O as b,G as c,C as d}; +import{d,bN as b,bO as k,A as p,c0 as y,o as a,c as o,h as g,a as t,b as h,b_ as _,C as x,D as i,z as v,p as c,bw as $,bx as V}from"./index-Dn5R1iW2.js";const w=["type"],C=d({__name:"Input",props:b({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const n=e,l=k(e,"modelValue");return(r,s)=>p((a(),o("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>l.value=u),type:n.type||"text",border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,8,w)),[[y,l.value]])}}),B={"max-w-full":""},N={flex:"~ col gap-4"},I={class:"flex items-center gap-1 text-sm font-medium"},D={key:0,class:"text-red-500"},R={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},L=d({__name:"FieldInput",props:{modelValue:null,label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},emits:["update:modelValue"],setup(e,{emit:n}){const l=e,r=n,s=g({get:()=>l.modelValue,set:u=>r("update:modelValue",u)});return(u,m)=>(a(),o("div",B,[t("label",N,[t("div",null,[t("div",I,[_(i(e.label)+" ",1),e.required!==!1?(a(),o("span",D,"*")):x("",!0)]),t("div",R,i(e.description),1)]),h(C,{modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=f=>s.value=f),type:e.type,placeholder:e.placeholder,class:v(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}}),S={flex:"~ col gap-6"},F={flex:"~ row","items-center":"","justify-between":""},M={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},P={text:"neutral-400 dark:neutral-500"},O=d({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(e){return(n,l)=>(a(),o("div",S,[t("div",F,[t("div",null,[t("h2",M,i(e.title||"Basic"),1),t("div",P,[t("span",null,i(e.description||"Essential settings"),1)])]),e.onReset?(a(),o("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:l[0]||(l[0]=(...r)=>e.onReset&&e.onReset(...r))},l[1]||(l[1]=[t("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):x("",!0)]),c(n.$slots,"default")]))}}),q={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},T=d({__name:"ProviderSettingsContainer",setup(e){return(n,l)=>(a(),o("div",q,[c(n.$slots,"default")]))}}),j={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},z={relative:""},E={"text-3xl":"","font-semibold":""},U={text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},G=d({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,l)=>{const r=$("motion");return a(),o(V,null,[p((a(),o("div",j,[t("button",{onClick:l[0]||(l[0]=(...s)=>e.onBack&&e.onBack(...s))},l[1]||(l[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",z,[l[2]||(l[2]=t("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[t("span",{text:"neutral-300 dark:neutral-500"},"Provider")],-1)),t("div",E,i(e.providerName),1)])])),[[r]]),c(n.$slots,"default"),t("div",U,[t("div",{text:"40",class:v(e.providerIcon||e.providerIconColor)},null,2)])],64)}}});export{L as _,T as a,O as b,G as c,C as d}; diff --git a/assets/RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CDWI8QsS.js b/assets/RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CTuHNiqF.js similarity index 97% rename from assets/RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CDWI8QsS.js rename to assets/RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CTuHNiqF.js index 3536482dba4d50ca12e48fcac56ee0e5a797699f..10ad4fb66023615c9b72ef40a61ff91ad9e910ec 100644 --- a/assets/RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CDWI8QsS.js +++ b/assets/RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CTuHNiqF.js @@ -1 +1 @@ -import{d as k,g as f,c as o,o as l,z as r,a as t,C as v,D as s,b as C,y as $,bM as h,bn as w,h as I,A as B,bH as R,bx as S,by as T,x as z}from"./index-DfQ41DTF.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{_ as D}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const N=["checked","name","value"],E={class:"relative mr-3 mt-0.5 flex-shrink-0"},P={class:"w-full flex flex-col gap-2"},L={class:"flex items-center"},M={key:0,class:"relative"},U=["title"],j={key:1,class:"mt-2"},q=["value","placeholder"],A=k({__name:"RadioCardDetail",props:{id:null,name:null,value:null,title:null,description:null,modelValue:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},emits:["update:modelValue","update:customInputValue"],setup(e,{emit:p}){const d=p,c=f(!1);function n(){c.value=!c.value}function m(x){const u=x.target;d("update:customInputValue",u.value)}return(x,u)=>(l(),o("label",{key:e.id,class:r(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[e.modelValue===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-700 hover:border-primary-500/30 dark:hover:border-primary-400/30",e.modelValue===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[t("input",{checked:e.modelValue===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0",onChange:u[0]||(u[0]=g=>x.$emit("update:modelValue",e.value))},null,40,N),t("div",E,[t("div",{class:r(["size-5 border-2 rounded-full transition-colors duration-200",[e.modelValue===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:r(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[e.modelValue===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",P,[t("div",L,[t("span",{class:r(["line-clamp-1 font-medium",[e.modelValue===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},s(e.title),3)]),e.description?(l(),o("div",M,[C(D,null,{default:$(()=>[c.value?(l(),o("div",{key:1,class:r(["cursor-pointer text-xs",[e.modelValue===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:h(n,["prevent"])},s(e.description),3)):(l(),o("div",{key:0,class:r(["line-clamp-2 cursor-pointer text-xs",[e.modelValue===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:h(n,["prevent"])},s(e.description),11,U))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(l(),o("button",{key:0,class:"text-primary-500 dark:text-primary-400 mt-0.5 inline-flex items-center text-xs",onClick:h(n,["prevent"])},[t("span",null,s(c.value?"Show less":"Show more"),1),t("div",{class:r([{"rotate-180":c.value},"transition-transform duration-200"])},u[1]||(u[1]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&e.modelValue===e.value?(l(),o("div",j,[t("input",{value:e.customInputValue,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,onInput:m},null,40,q)])):v("",!0)])],2))}}),F=w(A,[["__scopeId","data-v-3b099adf"]]),H=["checked","name","value"],Q={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},G=k({__name:"RadioCardSimple",props:{id:null,name:null,value:null,title:null,description:null,modelValue:null},emits:["update:modelValue"],setup(e){return(p,d)=>(l(),o("label",{key:e.id,border:"2px solid",class:r(["form_radio-card-simple relative",[e.modelValue===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-700 hover:border-primary-500/30 dark:hover:border-primary-400/30",e.modelValue===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":""},[t("input",{checked:e.modelValue===e.value,type:"radio",name:e.name,value:e.value,class:"[&:checked+div]:border-primary-500 dark:[&:checked+div]:border-primary-400 absolute opacity-0 [&:checked+div_.radio-dot]:opacity-100",onChange:d[0]||(d[0]=c=>p.$emit("update:modelValue",e.value))},null,40,H),d[1]||(d[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",Q,[t("span",{class:r(["radio-item-name font-bold",[e.modelValue===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"},s(e.title),3),e.description?(l(),o("span",{key:0,class:r(["radio-item-description",[e.modelValue===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},s(e.description),3)):v("",!0)]),d[2]||(d[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))}}),oe=w(G,[["__scopeId","data-v-7daf4ec0"]]),J={class:"radio-card-detail-many-select"},K={key:0,class:"relative"},O=["placeholder"],W={class:"mt-4 space-y-2"},X={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},Y={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"},Z={class:"flex flex-col"},_={class:"font-medium"},ee={class:"text-sm text-amber-600 dark:text-amber-400"},te={class:"relative"},ne=k({__name:"RadioCardDetailManySelect",props:{items:null,modelValue: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"}},emits:["update:modelValue","update:customValue"],setup(e,{emit:p}){const d=e,c=p,n=f(""),m=f(!1),x=f(""),u=I(()=>{if(!n.value)return d.items;const b=n.value.toLowerCase();return d.items.filter(a=>a.name.toLowerCase().includes(b)||a.description&&a.description.toLowerCase().includes(b))});function g(){n.value=""}function V(b){x.value=b,c("update:customValue",b)}return(b,a)=>(l(),o("div",J,[e.searchable?(l(),o("div",K,[a[5]||(a[5]=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)),B(t("input",{"onUpdate:modelValue":a[0]||(a[0]=i=>n.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-900 ~ neutral-200 dark:neutral-800 2",transition:"all duration-200 ease-in-out",ring:"focus:primary-500 dark:focus:primary-400 0 focus:2 focus:offset-0 focus:opacity-50",bg:"white dark:neutral-900",placeholder:e.searchPlaceholder},null,8,O),[[R,n.value]]),n.value?(l(),o("button",{key:0,type:"button",class:"absolute inset-y-0 right-0 flex items-center pr-3",onClick:g},a[4]||(a[4]=[t("div",{"i-solar:close-circle-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200"},null,-1)]))):v("",!0)])):v("",!0),t("div",W,[n.value?(l(),o("div",X,s(e.searchResultsText.replace("{count}",u.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),n.value&&u.value.length===0?(l(),o("div",Y,[a[6]||(a[6]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",Z,[t("span",_,s(e.searchNoResultsTitle),1),t("span",ee,s(e.searchNoResultsDescription.replace("{query}",n.value)),1)])])):v("",!0),t("div",te,[t("div",{class:r(["scrollbar-hide grid auto-cols-[350px] grid-flow-col gap-4 overflow-x-auto pb-4",[m.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"}},[(l(!0),o(S,null,T(u.value,i=>(l(),z(F,{id:i.id,key:i.id,value:i.id,title:i.name,description:i.description,deprecated:i.deprecated,"show-expand-collapse":!0,"expand-collapse-threshold":100,"show-custom-input":i.customizable,"custom-input-value":x.value,"custom-input-placeholder":e.customInputPlaceholder,"model-value":e.modelValue,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:modelValue":a[1]||(a[1]=y=>c("update:modelValue",y)),"onUpdate:customInputValue":a[2]||(a[2]=y=>V(y))},null,8,["id","value","title","description","deprecated","show-custom-input","custom-input-value","custom-input-placeholder","model-value"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:r([m.value?"fixed bottom-4 left-1/2 translate-x--1/2 z-10 w-full px-9 max-w-screen-lg":"mt-0 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:r([m.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:a[3]||(a[3]=i=>m.value=!m.value)},[t("span",null,s(m.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:r([m.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}});export{oe as R,ne as _}; +import{d as k,g as f,c as o,o as l,z as r,a as t,C as v,D as s,b as C,y as $,bM as h,bn as w,h as I,A as B,bH as R,bx as S,by as T,x as z}from"./index-Dn5R1iW2.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{_ as D}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const N=["checked","name","value"],E={class:"relative mr-3 mt-0.5 flex-shrink-0"},P={class:"w-full flex flex-col gap-2"},L={class:"flex items-center"},M={key:0,class:"relative"},U=["title"],j={key:1,class:"mt-2"},q=["value","placeholder"],A=k({__name:"RadioCardDetail",props:{id:null,name:null,value:null,title:null,description:null,modelValue:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},emits:["update:modelValue","update:customInputValue"],setup(e,{emit:p}){const d=p,c=f(!1);function n(){c.value=!c.value}function m(x){const u=x.target;d("update:customInputValue",u.value)}return(x,u)=>(l(),o("label",{key:e.id,class:r(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[e.modelValue===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-700 hover:border-primary-500/30 dark:hover:border-primary-400/30",e.modelValue===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[t("input",{checked:e.modelValue===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0",onChange:u[0]||(u[0]=g=>x.$emit("update:modelValue",e.value))},null,40,N),t("div",E,[t("div",{class:r(["size-5 border-2 rounded-full transition-colors duration-200",[e.modelValue===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:r(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[e.modelValue===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",P,[t("div",L,[t("span",{class:r(["line-clamp-1 font-medium",[e.modelValue===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},s(e.title),3)]),e.description?(l(),o("div",M,[C(D,null,{default:$(()=>[c.value?(l(),o("div",{key:1,class:r(["cursor-pointer text-xs",[e.modelValue===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:h(n,["prevent"])},s(e.description),3)):(l(),o("div",{key:0,class:r(["line-clamp-2 cursor-pointer text-xs",[e.modelValue===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:h(n,["prevent"])},s(e.description),11,U))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(l(),o("button",{key:0,class:"text-primary-500 dark:text-primary-400 mt-0.5 inline-flex items-center text-xs",onClick:h(n,["prevent"])},[t("span",null,s(c.value?"Show less":"Show more"),1),t("div",{class:r([{"rotate-180":c.value},"transition-transform duration-200"])},u[1]||(u[1]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&e.modelValue===e.value?(l(),o("div",j,[t("input",{value:e.customInputValue,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,onInput:m},null,40,q)])):v("",!0)])],2))}}),F=w(A,[["__scopeId","data-v-3b099adf"]]),H=["checked","name","value"],Q={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},G=k({__name:"RadioCardSimple",props:{id:null,name:null,value:null,title:null,description:null,modelValue:null},emits:["update:modelValue"],setup(e){return(p,d)=>(l(),o("label",{key:e.id,border:"2px solid",class:r(["form_radio-card-simple relative",[e.modelValue===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-700 hover:border-primary-500/30 dark:hover:border-primary-400/30",e.modelValue===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":""},[t("input",{checked:e.modelValue===e.value,type:"radio",name:e.name,value:e.value,class:"[&:checked+div]:border-primary-500 dark:[&:checked+div]:border-primary-400 absolute opacity-0 [&:checked+div_.radio-dot]:opacity-100",onChange:d[0]||(d[0]=c=>p.$emit("update:modelValue",e.value))},null,40,H),d[1]||(d[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",Q,[t("span",{class:r(["radio-item-name font-bold",[e.modelValue===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"},s(e.title),3),e.description?(l(),o("span",{key:0,class:r(["radio-item-description",[e.modelValue===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},s(e.description),3)):v("",!0)]),d[2]||(d[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))}}),oe=w(G,[["__scopeId","data-v-7daf4ec0"]]),J={class:"radio-card-detail-many-select"},K={key:0,class:"relative"},O=["placeholder"],W={class:"mt-4 space-y-2"},X={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},Y={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"},Z={class:"flex flex-col"},_={class:"font-medium"},ee={class:"text-sm text-amber-600 dark:text-amber-400"},te={class:"relative"},ne=k({__name:"RadioCardDetailManySelect",props:{items:null,modelValue: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"}},emits:["update:modelValue","update:customValue"],setup(e,{emit:p}){const d=e,c=p,n=f(""),m=f(!1),x=f(""),u=I(()=>{if(!n.value)return d.items;const b=n.value.toLowerCase();return d.items.filter(a=>a.name.toLowerCase().includes(b)||a.description&&a.description.toLowerCase().includes(b))});function g(){n.value=""}function V(b){x.value=b,c("update:customValue",b)}return(b,a)=>(l(),o("div",J,[e.searchable?(l(),o("div",K,[a[5]||(a[5]=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)),B(t("input",{"onUpdate:modelValue":a[0]||(a[0]=i=>n.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-900 ~ neutral-200 dark:neutral-800 2",transition:"all duration-200 ease-in-out",ring:"focus:primary-500 dark:focus:primary-400 0 focus:2 focus:offset-0 focus:opacity-50",bg:"white dark:neutral-900",placeholder:e.searchPlaceholder},null,8,O),[[R,n.value]]),n.value?(l(),o("button",{key:0,type:"button",class:"absolute inset-y-0 right-0 flex items-center pr-3",onClick:g},a[4]||(a[4]=[t("div",{"i-solar:close-circle-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200"},null,-1)]))):v("",!0)])):v("",!0),t("div",W,[n.value?(l(),o("div",X,s(e.searchResultsText.replace("{count}",u.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),n.value&&u.value.length===0?(l(),o("div",Y,[a[6]||(a[6]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",Z,[t("span",_,s(e.searchNoResultsTitle),1),t("span",ee,s(e.searchNoResultsDescription.replace("{query}",n.value)),1)])])):v("",!0),t("div",te,[t("div",{class:r(["scrollbar-hide grid auto-cols-[350px] grid-flow-col gap-4 overflow-x-auto pb-4",[m.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"}},[(l(!0),o(S,null,T(u.value,i=>(l(),z(F,{id:i.id,key:i.id,value:i.id,title:i.name,description:i.description,deprecated:i.deprecated,"show-expand-collapse":!0,"expand-collapse-threshold":100,"show-custom-input":i.customizable,"custom-input-value":x.value,"custom-input-placeholder":e.customInputPlaceholder,"model-value":e.modelValue,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:modelValue":a[1]||(a[1]=y=>c("update:modelValue",y)),"onUpdate:customInputValue":a[2]||(a[2]=y=>V(y))},null,8,["id","value","title","description","deprecated","show-custom-input","custom-input-value","custom-input-placeholder","model-value"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:r([m.value?"fixed bottom-4 left-1/2 translate-x--1/2 z-10 w-full px-9 max-w-screen-lg":"mt-0 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:r([m.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:a[3]||(a[3]=i=>m.value=!m.value)},[t("span",null,s(m.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:r([m.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}});export{oe as R,ne as _}; diff --git a/assets/Range-naQD8Ont.js b/assets/Range-CI9YqvjT.js similarity index 89% rename from assets/Range-naQD8Ont.js rename to assets/Range-CI9YqvjT.js index a6ae617b3bdf8f6aa02032dc7defc3b774f9dc50..133c1703bbb7287e7e6fae350c76e0ae333fa6a0 100644 --- a/assets/Range-naQD8Ont.js +++ b/assets/Range-CI9YqvjT.js @@ -1 +1 @@ -import{d as f,h as s,g as n,w as x,m as g,A as y,bH as _,o as V,c as k,bn as b}from"./index-DfQ41DTF.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";const C=["min","max","step"],R=f({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},emits:["update:modelValue"],setup(d,{emit:m}){const t=d,i=m,p=s(()=>t.min*1e4),c=s(()=>t.max*1e4),v=s(()=>t.step*1e4),e=n(),o=n(t.modelValue*1e4);x(o,r=>{i("update:modelValue",r/1e4),u()}),g(()=>{u()});function u(){e.value&&(e.value.style.setProperty("--value",e.value.value),e.value.style.setProperty("--min",e.value.min?e.value.min:t.min.toString()),e.value.style.setProperty("--max",e.value.max?e.value.max:t.max.toString()))}return(r,a)=>y((V(),k("input",{ref_key:"sliderRef",ref:e,"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),type:"range",min:p.value,max:c.value,step:v.value,class:"data-gui-range slider-progress",onInput:a[1]||(a[1]=l=>{l.target.style.setProperty("--value",l.target.value)})},null,40,C)),[[_,o.value,void 0,{number:!0}]])}}),w=b(R,[["__scopeId","data-v-8d439080"]]);export{w as R}; +import{d as f,h as s,g as n,w as x,m as g,A as y,bH as _,o as V,c as k,bn as b}from"./index-Dn5R1iW2.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";const C=["min","max","step"],R=f({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},emits:["update:modelValue"],setup(d,{emit:m}){const t=d,i=m,p=s(()=>t.min*1e4),c=s(()=>t.max*1e4),v=s(()=>t.step*1e4),e=n(),o=n(t.modelValue*1e4);x(o,r=>{i("update:modelValue",r/1e4),u()}),g(()=>{u()});function u(){e.value&&(e.value.style.setProperty("--value",e.value.value),e.value.style.setProperty("--min",e.value.min?e.value.min:t.min.toString()),e.value.style.setProperty("--max",e.value.max?e.value.max:t.max.toString()))}return(r,a)=>y((V(),k("input",{ref_key:"sliderRef",ref:e,"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),type:"range",min:p.value,max:c.value,step:v.value,class:"data-gui-range slider-progress",onInput:a[1]||(a[1]=l=>{l.target.style.setProperty("--value",l.target.value)})},null,40,C)),[[_,o.value,void 0,{number:!0}]])}}),w=b(R,[["__scopeId","data-v-8d439080"]]);export{w as R}; diff --git a/assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js b/assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js similarity index 99% rename from assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js rename to assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js index 3e4f5a138a8f429edddad174417ed53263adbbbb..e59631d0d40f73dc013db180607d82f4355ceb14 100644 --- a/assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js +++ b/assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-CKggh1Nm.js","assets/index-DfQ41DTF.js","assets/index-CBTN5Ibu.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 jM=Object.defineProperty;var $M=(r,t,e)=>t in r?jM(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var W=(r,t,e)=>$M(r,typeof t!="symbol"?t+"":t,e);import{bm as Xp,ch as $n,b2 as GM,a0 as WM,a9 as Be,V as gt,Q as oe,a3 as Hs,ba as ea,av as wg,ag as Sg,ak as Tg,b3 as Bc,b6 as Yp,ci as HM,$ as XM,cj as YM,a1 as qM,ck as pa,cl as On,W as nn,a4 as ti,a_ as Ja,as as cr,cm as QM,X as Ki,b7 as ZM,b5 as KM,cn as Ig,bb as qp,co as JM,aj as Cu,J as Ao,bc as tE,bf as eE,bg as rE,bp as nE,cp as Bi}from"./index-DfQ41DTF.js";/*! +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-C-2Juvjq.js","assets/index-Dn5R1iW2.js","assets/index-CBTN5Ibu.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 jM=Object.defineProperty;var $M=(r,t,e)=>t in r?jM(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var W=(r,t,e)=>$M(r,typeof t!="symbol"?t+"":t,e);import{bm as Xp,ch as $n,b2 as GM,a0 as WM,a9 as Be,V as gt,Q as oe,a3 as Hs,ba as ea,av as wg,ag as Sg,ak as Tg,b3 as Bc,b6 as Yp,ci as HM,$ as XM,cj as YM,a1 as qM,ck as pa,cl as On,W as nn,a4 as ti,a_ as Ja,as as cr,cm as QM,X as Ki,b7 as ZM,b5 as KM,cn as Ig,bb as qp,co as JM,aj as Cu,J as Ao,bc as tE,bf as eE,bg as rE,bp as nE,cp as Bi}from"./index-Dn5R1iW2.js";/*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * @@ -4072,13 +4072,13 @@ void main() { */function re(r,t,e,n){function i(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(r,t||[])).next())})}function Qv(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dt(r){return this instanceof Dt?(this.v=r,this):new Dt(r)}function Ar(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(m){return Promise.resolve(m).then(d,h)}}function a(d,m){n[d]&&(i[d]=function(g){return new Promise(function(p,y){s.push([d,g,p,y])>1||l(d,g)})},m&&(i[d]=m(i[d])))}function l(d,m){try{u(n[d](m))}catch(g){f(s[0][3],g)}}function u(d){d.value instanceof Dt?Promise.resolve(d.value.v).then(c,h):f(s[0][2],d)}function c(d){l("next",d)}function h(d){l("throw",d)}function f(d,m){d(m),s.shift(),s.length&&l(s[0][0],s[0][1])}}function ks(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=r[i]?function(o){return(e=!e)?{value:Dt(r[i](o)),done:!1}:s?s(o):o}:s}}function Hn(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 Qv=="function"?Qv(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(s){e[s]=r[s]&&function(o){return new Promise(function(a,l){o=r[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}const eN=new TextDecoder("utf-8"),pp=r=>eN.decode(r),rN=new TextEncoder,Mm=r=>rN.encode(r),nN=r=>typeof r=="number",o1=r=>typeof r=="boolean",Je=r=>typeof r=="function",Cr=r=>r!=null&&Object(r)===r,zs=r=>Cr(r)&&Je(r.then),Tl=r=>Cr(r)&&Je(r[Symbol.iterator]),oa=r=>Cr(r)&&Je(r[Symbol.asyncIterator]),mp=r=>Cr(r)&&Cr(r.schema),a1=r=>Cr(r)&&"done"in r&&"value"in r,l1=r=>Cr(r)&&Je(r.stat)&&nN(r.fd),u1=r=>Cr(r)&&Em(r.body),Jc=r=>"_getDOMStream"in r&&"_getNodeStream"in r,iN=r=>Cr(r)&&Je(r.abort)&&Je(r.getWriter)&&!Jc(r),Em=r=>Cr(r)&&Je(r.cancel)&&Je(r.getReader)&&!Jc(r),sN=r=>Cr(r)&&Je(r.end)&&Je(r.write)&&o1(r.writable)&&!Jc(r),c1=r=>Cr(r)&&Je(r.read)&&Je(r.pipe)&&o1(r.readable)&&!Jc(r),oN=r=>Cr(r)&&Je(r.clear)&&Je(r.bytes)&&Je(r.position)&&Je(r.setPosition)&&Je(r.capacity)&&Je(r.getBufferIdentifier)&&Je(r.createLong),Am=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function aN(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lMe(Int32Array,r),Kv=r=>Me(BigInt64Array,r),fe=r=>Me(Uint8Array,r),gp=r=>(r.next(),r);function*lN(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Am?e(t):Tl(t)?t:e(t);return yield*gp(function*(i){let s=null;do s=i.next(yield Me(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const uN=r=>lN(Uint8Array,r);function h1(r,t){return Ar(this,arguments,function*(){if(zs(t))return yield Dt(yield Dt(yield*ks(Hn(h1(r,yield Dt(t))))));const n=function(o){return Ar(this,arguments,function*(){yield yield Dt(yield Dt(o))})},i=function(o){return Ar(this,arguments,function*(){yield Dt(yield*ks(Hn(gp(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 Am?n(t):Tl(t)?i(t):oa(t)?t:n(t);return yield Dt(yield*ks(Hn(gp(function(o){return Ar(this,arguments,function*(){let a=null;do a=yield Dt(o.next(yield yield Dt(Me(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Dt(new r)})}const cN=r=>h1(Uint8Array,r);function d1(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++e(r.next(),r);function*dN(r){let t,e=!1,n=[],i,s,o,a=0;function l(){return s==="peek"?Yn(n,o)[0]:([i,n,a]=Yn(n,o),i)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const u=uN(r)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o0&&(i.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Dt(u()));while(a0&&(i.push(fe(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Dt(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 re(this,void 0,void 0,function*(){const{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return re(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=fe(e)),e})}}const jd=(r,t)=>{const e=i=>n([t,i]);let n;return[t,e,new Promise(i=>(n=i)&&r.once(t,e))]};function gN(r){return Ar(this,arguments,function*(){const e=[];let n="error",i=!1,s=null,o,a,l=0,u=[],c;function h(){return o==="peek"?Yn(u,a)[0]:([c,u,l]=Yn(u,a),c)}if({cmd:o,size:a}=(yield yield Dt(null))||{cmd:"read",size:0},r.isTTY)return yield yield Dt(new Uint8Array(0)),yield Dt(null);try{e[0]=jd(r,"end"),e[1]=jd(r,"error");do{if(e[2]=jd(r,"readable"),[n,s]=yield Dt(Promise.race(e.map(d=>d[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-l)?(c=fe(r.read(a-l)),c.byteLength0&&(u.push(c),l+=c.byteLength)),i||a<=l)do({cmd:o,size:a}=yield yield Dt(h()));while(a{for(const[y,v]of d)r.off(y,v);try{const y=r.destroy;y&&y.call(r,m),m=void 0}catch(y){m=y||m}finally{m!=null?p(m):g()}})}})}var He;(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"})(He||(He={}));var gr;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(gr||(gr={}));var mr;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(mr||(mr={}));var dn;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(dn||(dn={}));var $t;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})($t||($t={}));var qn;(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"})(qn||(qn={}));const $d=2,zn=4,mi=4,Se=4,Li=new Int32Array(2),Jv=new Float32Array(Li.buffer),t0=new Float64Array(Li.buffer),cu=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var yp;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(yp||(yp={}));let Xo=class f1{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new f1(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){Jv[0]=e,this.writeInt32(t,Li[0])}writeFloat64(t,e){t0[0]=e,this.writeInt32(t,Li[cu?0:1]),this.writeInt32(t+4,Li[cu?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const n=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space=0&&this.vtable[e]==0;e--);const n=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const i=2;this.addInt16(t-this.object_start);const s=(n+i)*$d;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,zn+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(e=0;n--)t.addInt32(e[n]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,n){return Mr.startUnion(t),Mr.addMode(t,e),Mr.addTypeIds(t,n),Mr.endUnion(t)}}let a0=class ja{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 ja).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+Se),(e||new ja).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return ja.startUtf8(t),ja.endUtf8(t)}};var Oe;(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"})(Oe||(Oe={}));let Jr=class wu{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 wu).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+Se),(e||new wu).__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):Oe.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 gi).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const n=this.bb.__offset(this.bb_pos,14);return n?(e||new wu).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,16);return n?(e||new tr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,Oe.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},Fn=class oi{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 oi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+Se),(e||new oi).__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):Yo.Little}fields(t,e){const n=this.bb.__offset(this.bb_pos,6);return n?(e||new Jr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new tr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,Yo.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,n,i,s){return oi.startSchema(t),oi.addEndianness(t,e),oi.addFields(t,n),oi.addCustomMetadata(t,i),oi.addFeatures(t,s),oi.endSchema(t)}};var ve;(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"})(ve||(ve={}));var z;(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"})(z||(z={}));var di;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(di||(di={}));const yN=void 0;function ll(r){if(r===null)return"null";if(r===yN)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=>ll(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}function Ae(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 v1(r,t){return Ae(r/t)+Ae(r%t)/Ae(t)}const vN=Symbol.for("isArrowBigNum");function wn(r,...t){return t.length===0?Object.setPrototypeOf(Me(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}wn.prototype[vN]=!0;wn.prototype.toJSON=function(){return`"${cl(this)}"`};wn.prototype.valueOf=function(r){return _1(this,r)};wn.prototype.toString=function(){return cl(this)};wn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return _1(this);case"string":return cl(this);case"default":return xN(this)}return cl(this)};function No(...r){return wn.apply(this,r)}function Bo(...r){return wn.apply(this,r)}function ul(...r){return wn.apply(this,r)}Object.setPrototypeOf(No.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Bo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ul.prototype,Object.create(Uint32Array.prototype));Object.assign(No.prototype,wn.prototype,{constructor:No,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Bo.prototype,wn.prototype,{constructor:Bo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ul.prototype,wn.prototype,{constructor:ul,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const _N=BigInt(4294967296)*BigInt(4294967296),bN=_N-BigInt(1);function _1(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return Gd(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Rt.prototype);let Hi=class extends Rt{constructor(){super(z.Null)}toString(){return"Null"}};w1=Symbol.toStringTag;Hi[w1]=(r=>r[Symbol.toStringTag]="Null")(Hi.prototype);let Vs=class extends Rt{constructor(t,e){super(z.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}`}};S1=Symbol.toStringTag;Vs[S1]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Vs.prototype);class hl extends Vs{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(hl.prototype,"ArrayType",{value:Int32Array});let Zu=class extends Rt{constructor(t){super(z.Float),this.precision=t}get ArrayType(){switch(this.precision){case mr.HALF:return Uint16Array;case mr.SINGLE:return Float32Array;case mr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};T1=Symbol.toStringTag;Zu[T1]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Zu.prototype);let Ku=class extends Rt{constructor(){super(z.Binary)}toString(){return"Binary"}};I1=Symbol.toStringTag;Ku[I1]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ku.prototype);let Ju=class extends Rt{constructor(){super(z.LargeBinary)}toString(){return"LargeBinary"}};M1=Symbol.toStringTag;Ju[M1]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Ju.prototype);let tc=class extends Rt{constructor(){super(z.Utf8)}toString(){return"Utf8"}};E1=Symbol.toStringTag;tc[E1]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(tc.prototype);let ec=class extends Rt{constructor(){super(z.LargeUtf8)}toString(){return"LargeUtf8"}};A1=Symbol.toStringTag;ec[A1]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(ec.prototype);let rc=class extends Rt{constructor(){super(z.Bool)}toString(){return"Bool"}};C1=Symbol.toStringTag;rc[C1]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(rc.prototype);let nc=class extends Rt{constructor(t,e,n=128){super(z.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};O1=Symbol.toStringTag;nc[O1]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(nc.prototype);let ic=class extends Rt{constructor(t){super(z.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${dn[this.unit]}>`}get ArrayType(){return this.unit===dn.DAY?Int32Array:BigInt64Array}};P1=Symbol.toStringTag;ic[P1]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(ic.prototype);let sc=class extends Rt{constructor(t,e){super(z.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${$t[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};R1=Symbol.toStringTag;sc[R1]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(sc.prototype);let oc=class extends Rt{constructor(t,e){super(z.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${$t[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};F1=Symbol.toStringTag;oc[F1]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(oc.prototype);let ac=class extends Rt{constructor(t){super(z.Interval),this.unit=t}toString(){return`Interval<${qn[this.unit]}>`}};D1=Symbol.toStringTag;ac[D1]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(ac.prototype);let lc=class extends Rt{constructor(t){super(z.Duration),this.unit=t}toString(){return`Duration<${$t[this.unit]}>`}};L1=Symbol.toStringTag;lc[L1]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(lc.prototype);let uc=class extends Rt{constructor(t){super(z.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}};N1=Symbol.toStringTag;uc[N1]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(uc.prototype);let br=class extends Rt{constructor(t){super(z.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};B1=Symbol.toStringTag;br[B1]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(br.prototype);let cc=class extends Rt{constructor(t,e,n){super(z.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};k1=Symbol.toStringTag;cc[k1]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(cc.prototype);let hc=class extends Rt{constructor(t){super(z.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};U1=Symbol.toStringTag;hc[U1]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(hc.prototype);let dc=class extends Rt{constructor(t,e){super(z.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}>`}};z1=Symbol.toStringTag;dc[z1]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(dc.prototype);let fc=class extends Rt{constructor(t,e=!1){var n,i,s;if(super(z.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};V1=Symbol.toStringTag;fc[V1]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(fc.prototype);const SN=(r=>()=>++r)(-1);let qo=class extends Rt{constructor(t,e,n,i){super(z.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?SN():Ae(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};j1=Symbol.toStringTag;qo[j1]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(qo.prototype);function fi(r){const t=r;switch(r.typeId){case z.Decimal:return r.bitWidth/32;case z.Interval:return 1+t.unit;case z.FixedSizeList:return t.listSize;case z.FixedSizeBinary:return t.byteWidth;default:return 1}}let le=class{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return TN(this,t,e)}getVisitFnByTypeId(t,e=!0){return wo(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 TN(r,t,e=!0){return typeof t=="number"?wo(r,t,e):typeof t=="string"&&t in z?wo(r,z[t],e):t&&t instanceof Rt?wo(r,l0(t),e):t!=null&&t.type&&t.type instanceof Rt?wo(r,l0(t.type),e):wo(r,z.NONE,e)}function wo(r,t,e=!0){let n=null;switch(t){case z.Null:n=r.visitNull;break;case z.Bool:n=r.visitBool;break;case z.Int:n=r.visitInt;break;case z.Int8:n=r.visitInt8||r.visitInt;break;case z.Int16:n=r.visitInt16||r.visitInt;break;case z.Int32:n=r.visitInt32||r.visitInt;break;case z.Int64:n=r.visitInt64||r.visitInt;break;case z.Uint8:n=r.visitUint8||r.visitInt;break;case z.Uint16:n=r.visitUint16||r.visitInt;break;case z.Uint32:n=r.visitUint32||r.visitInt;break;case z.Uint64:n=r.visitUint64||r.visitInt;break;case z.Float:n=r.visitFloat;break;case z.Float16:n=r.visitFloat16||r.visitFloat;break;case z.Float32:n=r.visitFloat32||r.visitFloat;break;case z.Float64:n=r.visitFloat64||r.visitFloat;break;case z.Utf8:n=r.visitUtf8;break;case z.LargeUtf8:n=r.visitLargeUtf8;break;case z.Binary:n=r.visitBinary;break;case z.LargeBinary:n=r.visitLargeBinary;break;case z.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case z.Date:n=r.visitDate;break;case z.DateDay:n=r.visitDateDay||r.visitDate;break;case z.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case z.Timestamp:n=r.visitTimestamp;break;case z.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case z.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case z.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case z.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case z.Time:n=r.visitTime;break;case z.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case z.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case z.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case z.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case z.Decimal:n=r.visitDecimal;break;case z.List:n=r.visitList;break;case z.Struct:n=r.visitStruct;break;case z.Union:n=r.visitUnion;break;case z.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case z.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case z.Dictionary:n=r.visitDictionary;break;case z.Interval:n=r.visitInterval;break;case z.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case z.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case z.Duration:n=r.visitDuration;break;case z.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case z.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case z.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case z.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case z.FixedSizeList:n=r.visitFixedSizeList;break;case z.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${z[t]}'`)}function l0(r){switch(r.typeId){case z.Null:return z.Null;case z.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?z.Int8:z.Uint8;case 16:return e?z.Int16:z.Uint16;case 32:return e?z.Int32:z.Uint32;case 64:return e?z.Int64:z.Uint64}return z.Int}case z.Float:switch(r.precision){case mr.HALF:return z.Float16;case mr.SINGLE:return z.Float32;case mr.DOUBLE:return z.Float64}return z.Float;case z.Binary:return z.Binary;case z.LargeBinary:return z.LargeBinary;case z.Utf8:return z.Utf8;case z.LargeUtf8:return z.LargeUtf8;case z.Bool:return z.Bool;case z.Decimal:return z.Decimal;case z.Time:switch(r.unit){case $t.SECOND:return z.TimeSecond;case $t.MILLISECOND:return z.TimeMillisecond;case $t.MICROSECOND:return z.TimeMicrosecond;case $t.NANOSECOND:return z.TimeNanosecond}return z.Time;case z.Timestamp:switch(r.unit){case $t.SECOND:return z.TimestampSecond;case $t.MILLISECOND:return z.TimestampMillisecond;case $t.MICROSECOND:return z.TimestampMicrosecond;case $t.NANOSECOND:return z.TimestampNanosecond}return z.Timestamp;case z.Date:switch(r.unit){case dn.DAY:return z.DateDay;case dn.MILLISECOND:return z.DateMillisecond}return z.Date;case z.Interval:switch(r.unit){case qn.DAY_TIME:return z.IntervalDayTime;case qn.YEAR_MONTH:return z.IntervalYearMonth}return z.Interval;case z.Duration:switch(r.unit){case $t.SECOND:return z.DurationSecond;case $t.MILLISECOND:return z.DurationMillisecond;case $t.MICROSECOND:return z.DurationMicrosecond;case $t.NANOSECOND:return z.DurationNanosecond}return z.Duration;case z.Map:return z.Map;case z.List:return z.List;case z.Struct:return z.Struct;case z.Union:switch(r.mode){case gr.Dense:return z.DenseUnion;case gr.Sparse:return z.SparseUnion}return z.Union;case z.FixedSizeBinary:return z.FixedSizeBinary;case z.FixedSizeList:return z.FixedSizeList;case z.Dictionary:return z.Dictionary}throw new Error(`Unrecognized type '${z[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 $1=new Float64Array(1),lo=new Uint32Array($1.buffer);function G1(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function IN(r){if(r!==r)return 32256;$1[0]=r;const t=(lo[1]&2147483648)>>16&65535;let e=lo[1]&2146435072,n=0;return e>=1089470464?lo[0]>0?e=31744:(e=(e&2080374784)>>16,n=(lo[1]&1048575)>>10):e<=1056964608?(n=1048576+(lo[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(lo[1]&1048575)+512>>10),t|e|n&65535}let Gt=class extends le{};function Zt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const MN=(r,t,e)=>{r[t]=Math.floor(e/864e5)},W1=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},Cm=({values:r},t,e)=>{r[t]=e},H1=({values:r},t,e)=>{r[t]=IN(e)},AN=(r,t,e)=>{switch(r.type.precision){case mr.HALF:return H1(r,t,e);case mr.SINGLE:case mr.DOUBLE:return Cm(r,t,e)}},X1=({values:r},t,e)=>{MN(r,t,e.valueOf())},Y1=({values:r},t,e)=>{r[t]=BigInt(e)},CN=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},q1=({values:r,valueOffsets:t},e,n)=>W1(r,t,e,n),Q1=({values:r,valueOffsets:t},e,n)=>W1(r,t,e,Mm(n)),ON=(r,t,e)=>{r.type.unit===dn.DAY?X1(r,t,e):Y1(r,t,e)},Z1=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},K1=({values:r},t,e)=>{r[t]=BigInt(e)},J1=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},tS=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},PN=(r,t,e)=>{switch(r.type.unit){case $t.SECOND:return Z1(r,t,e);case $t.MILLISECOND:return K1(r,t,e);case $t.MICROSECOND:return J1(r,t,e);case $t.NANOSECOND:return tS(r,t,e)}},eS=({values:r},t,e)=>{r[t]=e},rS=({values:r},t,e)=>{r[t]=e},nS=({values:r},t,e)=>{r[t]=e},iS=({values:r},t,e)=>{r[t]=e},RN=(r,t,e)=>{switch(r.type.unit){case $t.SECOND:return eS(r,t,e);case $t.MILLISECOND:return rS(r,t,e);case $t.MICROSECOND:return nS(r,t,e);case $t.NANOSECOND:return iS(r,t,e)}},FN=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},DN=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=fn.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=fn.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},NN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),BN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),kN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),UN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),zN=(r,t,e)=>{const n=r.type.children.map(s=>fn.getVisitFn(s.type)),i=e instanceof Map?kN(t,e):e instanceof ze?BN(t,e):Array.isArray(e)?NN(t,e):UN(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},VN=(r,t,e)=>{r.type.mode===gr.Dense?sS(r,t,e):oS(r,t,e)},sS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];fn.visit(i,r.valueOffsets[t],e)},oS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];fn.visit(i,t,e)},jN=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},$N=(r,t,e)=>{r.type.unit===qn.DAY_TIME?aS(r,t,e):lS(r,t,e)},aS=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},lS=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},uS=({values:r},t,e)=>{r[t]=e},cS=({values:r},t,e)=>{r[t]=e},hS=({values:r},t,e)=>{r[t]=e},dS=({values:r},t,e)=>{r[t]=e},GN=(r,t,e)=>{switch(r.type.unit){case $t.SECOND:return uS(r,t,e);case $t.MILLISECOND:return cS(r,t,e);case $t.MICROSECOND:return hS(r,t,e);case $t.NANOSECOND:return dS(r,t,e)}},WN=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=fn.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${ll(t)}: ${ll(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new HN(this[yn],this[ko])}},HN=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[yn].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[yn].type.children.findIndex(n=>n.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[yn].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=Or.visit(t[yn].children[n],t[ko]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[yn].type.children.findIndex(s=>s.name===e);return i!==-1?(fn.visit(t[yn].children[i],t[ko],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}},Lt=class extends le{};function Wt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const YN=(r,t)=>864e5*r[t],qN=(r,t)=>null,fS=(r,t,e)=>{if(e+1>=t.length)return null;const n=Ae(t[e]),i=Ae(t[e+1]);return r.subarray(n,i)},QN=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<YN(r,t),mS=({values:r},t)=>Ae(r[t]),ts=({stride:r,values:t},e)=>t[r*e],ZN=({stride:r,values:t},e)=>G1(t[r*e]),gS=({values:r},t)=>r[t],KN=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),yS=({values:r,valueOffsets:t},e)=>fS(r,t,e),vS=({values:r,valueOffsets:t},e)=>{const n=fS(r,t,e);return n!==null?pp(n):null},JN=({values:r},t)=>r[t],t3=({type:r,values:t},e)=>r.precision!==mr.HALF?t[e]:G1(t[e]),e3=(r,t)=>r.type.unit===dn.DAY?pS(r,t):mS(r,t),_S=({values:r},t)=>1e3*Ae(r[t]),bS=({values:r},t)=>Ae(r[t]),xS=({values:r},t)=>v1(r[t],BigInt(1e3)),wS=({values:r},t)=>v1(r[t],BigInt(1e6)),r3=(r,t)=>{switch(r.type.unit){case $t.SECOND:return _S(r,t);case $t.MILLISECOND:return bS(r,t);case $t.MICROSECOND:return xS(r,t);case $t.NANOSECOND:return wS(r,t)}},SS=({values:r},t)=>r[t],TS=({values:r},t)=>r[t],IS=({values:r},t)=>r[t],MS=({values:r},t)=>r[t],n3=(r,t)=>{switch(r.type.unit){case $t.SECOND:return SS(r,t);case $t.MILLISECOND:return TS(r,t);case $t.MICROSECOND:return IS(r,t);case $t.NANOSECOND:return MS(r,t)}},i3=({values:r,stride:t},e)=>wN.decimal(r.subarray(t*e,t*(e+1))),s3=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new ze([l])},o3=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new Pm(o.slice(i,s-i))},a3=(r,t)=>new Om(r,t),l3=(r,t)=>r.type.mode===gr.Dense?ES(r,t):AS(r,t),ES=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return Or.visit(n,r.valueOffsets[t])},AS=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return Or.visit(n,t)},u3=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},c3=(r,t)=>r.type.unit===qn.DAY_TIME?CS(r,t):OS(r,t),CS=({values:r},t)=>r.subarray(2*t,2*(t+1)),OS=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},PS=({values:r},t)=>r[t],RS=({values:r},t)=>r[t],FS=({values:r},t)=>r[t],DS=({values:r},t)=>r[t],h3=(r,t)=>{switch(r.type.unit){case $t.SECOND:return PS(r,t);case $t.MILLISECOND:return RS(r,t);case $t.MICROSECOND:return FS(r,t);case $t.NANOSECOND:return DS(r,t)}},d3=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new ze([s])};Lt.prototype.visitNull=Wt(qN);Lt.prototype.visitBool=Wt(QN);Lt.prototype.visitInt=Wt(JN);Lt.prototype.visitInt8=Wt(ts);Lt.prototype.visitInt16=Wt(ts);Lt.prototype.visitInt32=Wt(ts);Lt.prototype.visitInt64=Wt(gS);Lt.prototype.visitUint8=Wt(ts);Lt.prototype.visitUint16=Wt(ts);Lt.prototype.visitUint32=Wt(ts);Lt.prototype.visitUint64=Wt(gS);Lt.prototype.visitFloat=Wt(t3);Lt.prototype.visitFloat16=Wt(ZN);Lt.prototype.visitFloat32=Wt(ts);Lt.prototype.visitFloat64=Wt(ts);Lt.prototype.visitUtf8=Wt(vS);Lt.prototype.visitLargeUtf8=Wt(vS);Lt.prototype.visitBinary=Wt(yS);Lt.prototype.visitLargeBinary=Wt(yS);Lt.prototype.visitFixedSizeBinary=Wt(KN);Lt.prototype.visitDate=Wt(e3);Lt.prototype.visitDateDay=Wt(pS);Lt.prototype.visitDateMillisecond=Wt(mS);Lt.prototype.visitTimestamp=Wt(r3);Lt.prototype.visitTimestampSecond=Wt(_S);Lt.prototype.visitTimestampMillisecond=Wt(bS);Lt.prototype.visitTimestampMicrosecond=Wt(xS);Lt.prototype.visitTimestampNanosecond=Wt(wS);Lt.prototype.visitTime=Wt(n3);Lt.prototype.visitTimeSecond=Wt(SS);Lt.prototype.visitTimeMillisecond=Wt(TS);Lt.prototype.visitTimeMicrosecond=Wt(IS);Lt.prototype.visitTimeNanosecond=Wt(MS);Lt.prototype.visitDecimal=Wt(i3);Lt.prototype.visitList=Wt(s3);Lt.prototype.visitStruct=Wt(a3);Lt.prototype.visitUnion=Wt(l3);Lt.prototype.visitDenseUnion=Wt(ES);Lt.prototype.visitSparseUnion=Wt(AS);Lt.prototype.visitDictionary=Wt(u3);Lt.prototype.visitInterval=Wt(c3);Lt.prototype.visitIntervalDayTime=Wt(CS);Lt.prototype.visitIntervalYearMonth=Wt(OS);Lt.prototype.visitDuration=Wt(h3);Lt.prototype.visitDurationSecond=Wt(PS);Lt.prototype.visitDurationMillisecond=Wt(RS);Lt.prototype.visitDurationMicrosecond=Wt(FS);Lt.prototype.visitDurationNanosecond=Wt(DS);Lt.prototype.visitFixedSizeList=Wt(d3);Lt.prototype.visitMap=Wt(o3);const Or=new Lt,So=Symbol.for("keys"),Uo=Symbol.for("vals"),To=Symbol.for("kKeysAsStrings"),xp=Symbol.for("_kKeysAsStrings");let Pm=class{constructor(t){return this[So]=new ze([t.children[0]]).memoize(),this[Uo]=t.children[1],new Proxy(this,new p3)}get[To](){return this[xp]||(this[xp]=Array.from(this[So].toArray(),String))}[Symbol.iterator](){return new f3(this[So],this[Uo])}get size(){return this[So].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[So],e=this[Uo],n={};for(let i=-1,s=t.length;++i`${ll(t)}: ${ll(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},f3=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),Or.visit(this.vals,t)]})}},p3=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[To]}has(t,e){return t[To].includes(e)}getOwnPropertyDescriptor(t,e){if(t[To].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[To].indexOf(e);if(n!==-1){const i=Or.visit(Reflect.get(t,Uo),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[To].indexOf(e);return i!==-1?(fn.visit(Reflect.get(t,Uo),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}};Object.defineProperties(Pm.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[So]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Uo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[xp]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let u0;function LS(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const Rm=(r,t)=>r<0?t+r:r,c0=r=>r!==r;function aa(r){if(typeof r!=="object"||r===null)return c0(r)?c0:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?hN(r,e):!1:r instanceof Map?g3(r):Array.isArray(r)?m3(r):r instanceof ze?y3(r):v3(r,!0)}function m3(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return _3(r,e);case Map:return h0(r,e,e.keys());case Pm:case Om:case Object:case void 0:return h0(r,e,t||Object.keys(e))}return e instanceof ze?b3(r,e):!1}}function _3(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function pc(r,t,e){const n=e.byteLength+7&-8;if(r>0||e.byteLength>3):mc(new Fm(e,r,t,null,NS)).subarray(0,n)),i}return e}function mc(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}let Fm=class{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return wp(r,t,i)+wp(r,n,e)+w3(r,i>>3,n-i>>3)}function w3(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Wd(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Wd(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Wd(s.getUint8(i)),i+=1;return n}function Wd(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 S3=-1;let Pe=class Sp{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 Rt.isSparseUnion(t)?this.children.some(e=>e.nullable):Rt.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Rt.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=S3&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-wp(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof Sp?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=fi(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(Rt.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===gr.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(pc(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new Sp(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===z.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(pc(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[di.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[di.TYPE])&&(o[di.TYPE]=s.subarray(t,t+e)),(s=o[di.OFFSET])&&(o[di.OFFSET]=s.subarray(t,t+e+1))||(s=o[di.DATA])&&(o[di.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}};Pe.prototype.children=Object.freeze([]);class Xa extends le{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:n=0,["length"]:i=0}=t;return new Pe(e,n,i,i)}visitBool(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitInt(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitFloat(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitUtf8(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.data),s=fe(t.nullBitmap),o=Ea(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Pe(e,n,a,l,[o,i,s])}visitLargeUtf8(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.data),s=fe(t.nullBitmap),o=Kv(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Pe(e,n,a,l,[o,i,s])}visitBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.data),s=fe(t.nullBitmap),o=Ea(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Pe(e,n,a,l,[o,i,s])}visitLargeBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.data),s=fe(t.nullBitmap),o=Kv(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Pe(e,n,a,l,[o,i,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length/fi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitDate(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length/fi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitTimestamp(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length/fi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitTime(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length/fi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitDecimal(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length/fi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitList(t){const{["type"]:e,["offset"]:n=0,["child"]:i}=t,s=fe(t.nullBitmap),o=Ea(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Pe(e,n,a,l,[o,void 0,s],[i])}visitStruct(t){const{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=fe(t.nullBitmap),{length:o=i.reduce((l,{length:u})=>Math.max(l,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,void 0,s],i)}visitUnion(t){const{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=Me(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(Rt.isSparseUnion(e))return new Pe(e,n,o,a,[void 0,void 0,void 0,s],i);const l=Ea(t.valueOffsets);return new Pe(e,n,o,a,[l,void 0,void 0,s],i)}visitDictionary(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.indices.ArrayType,t.data),{["dictionary"]:o=new ze([new Xa().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Pe(e,n,a,l,[void 0,s,i],[],o)}visitInterval(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length/fi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitDuration(t){const{["type"]:e,["offset"]:n=0}=t,i=fe(t.nullBitmap),s=Me(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,s,i])}visitFixedSizeList(t){const{["type"]:e,["offset"]:n=0,["child"]:i=new Xa().visit({type:e.valueType})}=t,s=fe(t.nullBitmap),{["length"]:o=i.length/fi(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Pe(e,n,o,a,[void 0,void 0,s],[i])}visitMap(t){const{["type"]:e,["offset"]:n=0,["child"]:i=new Xa().visit({type:e.childType})}=t,s=fe(t.nullBitmap),o=Ea(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Pe(e,n,a,l,[o,void 0,s],[i])}}const T3=new Xa;function he(r){return T3.visit(r)}let d0=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 BS(r){return r.reduce((t,e)=>t+e.nullCount,0)}function kS(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function US(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function Dm(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function E3(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new Fm(e,r.offset+(t||0),r.length,e,NS)){if(!i)return n;++n}return-1}function te(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case z.Union:break;case z.Dictionary:break;default:return E3(r,e)}const n=Or.getVisitFn(r),i=aa(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new d0(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new A3(o)})}let A3=class{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Pe)))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}=GS[o.typeId],c=s[0];this.isValid=h=>Lm(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,WS[o.typeId]),this._offsets=kS(s);break}this.data=s,this.type=o,this.stride=fi(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return I3(this.data)}get nullCount(){return BS(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${z[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Rm(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return Nm.visit(this)}concat(...t){return new ws(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new ws(LS(this,t,e,({data:n,_offsets:i},s,o)=>US(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case z.Int:case z.Float:case z.Decimal:case z.Time:case z.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Rt.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Rt.isDictionary(this.type)){const t=new f0(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new ws(e)}return new f0(this)}unmemoize(){if(Rt.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new ws(e)}return this}};$S=Symbol.toStringTag;ze[$S]=(r=>{r.type=Rt.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(z).map(e=>z[e]).filter(e=>typeof e=="number"&&e!==z.NONE);for(const e of t){const n=Or.getVisitFnByTypeId(e),i=fn.getVisitFnByTypeId(e),s=yc.getVisitFnByTypeId(e);GS[e]={get:n,set:i,indexOf:s},WS[e]=Object.create(r,{isValid:{value:gc(Lm)},get:{value:gc(Or.getVisitFnByTypeId(e))},set:{value:zS(fn.getVisitFnByTypeId(e))},indexOf:{value:VS(yc.getVisitFnByTypeId(e))}})}return"Vector"})(ze.prototype);let f0=class HS extends ze{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new HS(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new ze(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};class Tp{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,e,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(e??0)),t.offset()}}class Dr{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 Dr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+Se),(e||new Dr).__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):He.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Fn).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new Tp).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const n=this.bb.__offset(this.bb_pos,10);return n?(e||new Tp).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new tr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,He.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}let Ue=class Ss{constructor(t=[],e,n,i=He.V5){this.fields=t||[],this.metadata=e||new Map,n||(n=Ip(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){const e=new Set(t),n=this.fields.filter(i=>e.has(i.name));return new Ss(n,this.metadata)}selectAt(t){const e=t.map(n=>this.fields[n]).filter(Boolean);return new Ss(e,this.metadata)}assign(...t){const e=t[0]instanceof Ss?t[0]:Array.isArray(t[0])?new Ss(t[0]):new Ss(t),n=[...this.fields],i=hu(hu(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const l=n.findIndex(u=>u.name===a.name);return~l?(n[l]=a.clone({metadata:hu(hu(new Map,n[l].metadata),a.metadata)}))&&!1:!0}),o=Ip(s,new Map);return new Ss([...n,...s],i,new Map([...this.dictionaries,...o]))}};Ue.prototype.fields=null;Ue.prototype.metadata=null;Ue.prototype.dictionaries=null;class Le{static new(...t){let[e,n,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new Le(`${e}`,n,i,s)}constructor(t,e,n=!1,i){this.name=t,this.type=e,this.nullable=n,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,n,i,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,n=this.type,i=this.nullable,s=this.metadata]=t:{name:e=this.name,type:n=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],Le.new(e,n,i,s)}}Le.prototype.type=null;Le.prototype.name=null;Le.prototype.nullable=null;Le.prototype.metadata=null;function hu(r,t){return new Map([...r||new Map,...t||new Map])}function Ip(r,t=new Map){for(let e=-1,n=r.length;++e0&&Ip(s.children,t)}return t}var C3=p1,O3=Xo;class dl{static decode(t){t=new O3(fe(t));const e=Dr.getRootAsFooter(t),n=Ue.decode(e.schema(),new Map,e.version());return new P3(n,e)}static encode(t){const e=new C3,n=Ue.encode(e,t.schema);Dr.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())Xi.encode(e,o);const i=e.endVector();Dr.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())Xi.encode(e,o);const s=e.endVector();return Dr.startFooter(e),Dr.addSchema(e,n),Dr.addVersion(e,He.V5),Dr.addRecordBatches(e,i),Dr.addDictionaries(e,s),Dr.finishFooterBuffer(e,Dr.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=He.V5,n,i){this.schema=t,this.version=e,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,e=-1,n=this.numRecordBatches;++e=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return re(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(Ve);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return rn.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return rn.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return re(this,void 0,void 0,function*(){return yield this.abort(t),Ve})}return(t){return re(this,void 0,void 0,function*(){return yield this.close(),Ve})}read(t){return re(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return re(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,n)=>{this.resolvers.push({resolve:e,reject:n})}):Promise.resolve(Ve)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Su extends R3{write(t){if((t=fe(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?pp(this.toUint8Array(!0)):this.toUint8Array(!1).then(pp)}toUint8Array(t=!1){return t?Yn(this._values)[0]:re(this,void 0,void 0,function*(){var e,n,i,s;const o=[];let a=0;try{for(var l=!0,u=Hn(this),c;c=yield u.next(),e=c.done,!e;l=!0){s=c.value,l=!1;const h=s;o.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!l&&!e&&(i=u.return)&&(yield i.call(u))}finally{if(n)throw n.error}}return Yn(o,a)[0]})}}class vc{constructor(t){t&&(this.source=new F3(rn.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 Qo{constructor(t){t instanceof Qo?this.source=t.source:t instanceof Su?this.source=new ps(rn.fromAsyncIterable(t)):c1(t)?this.source=new ps(rn.fromNodeStream(t)):Em(t)?this.source=new ps(rn.fromDOMStream(t)):u1(t)?this.source=new ps(rn.fromDOMStream(t.body)):Tl(t)?this.source=new ps(rn.fromIterable(t)):zs(t)?this.source=new ps(rn.fromAsyncIterable(t)):oa(t)&&(this.source=new ps(rn.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 F3{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)||Ve)}return(t){return Object.create(this.source.return&&this.source.return(t)||Ve)}}class ps{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return re(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return re(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return re(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return re(this,arguments,void 0,function*(e,n="read"){return yield this.source.next({cmd:n,size:e})})}throw(t){return re(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||Ve;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return re(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||Ve;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class m0 extends vc{constructor(t,e){super(),this.position=0,this.buffer=fe(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:n}=this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Oo(this.buffer[3])} ${Oo(this.buffer[2])} ${Oo(this.buffer[1])} ${Oo(this.buffer[0])}`}static multiply(t,e){return new ui(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ui(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ui.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ui.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new ui(e);for(let o=n?1:0;o0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class N3 extends YS{constructor(t,e,n,i,s){super(new Uint8Array(0),e,n,i,s),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):mc(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return Me(Uint8Array,Me(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return Me(Uint8Array,Me(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:n}=this;return Rt.isTimestamp(t)||(Rt.isInt(t)||Rt.isTime(t))&&t.bitWidth===64||Rt.isDuration(t)||Rt.isDate(t)&&t.unit===dn.MILLISECOND?Me(Uint8Array,Ya.convertArray(n[e])):Rt.isDecimal(t)?Me(Uint8Array,L3.convertArray(n[e])):Rt.isBinary(t)||Rt.isLargeBinary(t)||Rt.isFixedSizeBinary(t)?B3(n[e]):Rt.isBool(t)?mc(n[e]):Rt.isUtf8(t)||Rt.isLargeUtf8(t)?Mm(n[e].join("")):Me(Uint8Array,Me(t.ArrayType,n[e].map(i=>+i)))}}function B3(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let n=0;n>1]=Number.parseInt(t.slice(n,n+2),16);return e}let kt=class extends le{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((n,i)=>this.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}};function Sr(r,t){return t instanceof r.constructor}function Qs(r,t){return r===t||Sr(r,t)}function Si(r,t){return r===t||Sr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function eh(r,t){return r===t||Sr(r,t)&&r.precision===t.precision}function k3(r,t){return r===t||Sr(r,t)&&r.byteWidth===t.byteWidth}function Um(r,t){return r===t||Sr(r,t)&&r.unit===t.unit}function Il(r,t){return r===t||Sr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function Ml(r,t){return r===t||Sr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function U3(r,t){return r===t||Sr(r,t)&&r.children.length===t.children.length&&Yi.compareManyFields(r.children,t.children)}function z3(r,t){return r===t||Sr(r,t)&&r.children.length===t.children.length&&Yi.compareManyFields(r.children,t.children)}function zm(r,t){return r===t||Sr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Yi.compareManyFields(r.children,t.children)}function V3(r,t){return r===t||Sr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Yi.visit(r.indices,t.indices)&&Yi.visit(r.dictionary,t.dictionary)}function Vm(r,t){return r===t||Sr(r,t)&&r.unit===t.unit}function El(r,t){return r===t||Sr(r,t)&&r.unit===t.unit}function j3(r,t){return r===t||Sr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Yi.compareManyFields(r.children,t.children)}function $3(r,t){return r===t||Sr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Yi.compareManyFields(r.children,t.children)}kt.prototype.visitNull=Qs;kt.prototype.visitBool=Qs;kt.prototype.visitInt=Si;kt.prototype.visitInt8=Si;kt.prototype.visitInt16=Si;kt.prototype.visitInt32=Si;kt.prototype.visitInt64=Si;kt.prototype.visitUint8=Si;kt.prototype.visitUint16=Si;kt.prototype.visitUint32=Si;kt.prototype.visitUint64=Si;kt.prototype.visitFloat=eh;kt.prototype.visitFloat16=eh;kt.prototype.visitFloat32=eh;kt.prototype.visitFloat64=eh;kt.prototype.visitUtf8=Qs;kt.prototype.visitLargeUtf8=Qs;kt.prototype.visitBinary=Qs;kt.prototype.visitLargeBinary=Qs;kt.prototype.visitFixedSizeBinary=k3;kt.prototype.visitDate=Um;kt.prototype.visitDateDay=Um;kt.prototype.visitDateMillisecond=Um;kt.prototype.visitTimestamp=Il;kt.prototype.visitTimestampSecond=Il;kt.prototype.visitTimestampMillisecond=Il;kt.prototype.visitTimestampMicrosecond=Il;kt.prototype.visitTimestampNanosecond=Il;kt.prototype.visitTime=Ml;kt.prototype.visitTimeSecond=Ml;kt.prototype.visitTimeMillisecond=Ml;kt.prototype.visitTimeMicrosecond=Ml;kt.prototype.visitTimeNanosecond=Ml;kt.prototype.visitDecimal=Qs;kt.prototype.visitList=U3;kt.prototype.visitStruct=z3;kt.prototype.visitUnion=zm;kt.prototype.visitDenseUnion=zm;kt.prototype.visitSparseUnion=zm;kt.prototype.visitDictionary=V3;kt.prototype.visitInterval=Vm;kt.prototype.visitIntervalDayTime=Vm;kt.prototype.visitIntervalYearMonth=Vm;kt.prototype.visitDuration=El;kt.prototype.visitDurationSecond=El;kt.prototype.visitDurationMillisecond=El;kt.prototype.visitDurationMicrosecond=El;kt.prototype.visitDurationNanosecond=El;kt.prototype.visitFixedSizeList=j3;kt.prototype.visitMap=$3;const Yi=new kt;function Mp(r,t){return Yi.compareSchemas(r,t)}function Hd(r,t){return G3(r,t.map(e=>e.data.concat()))}function G3(r,t){const e=[...r.fields],n=[],i={numBatches:t.reduce((h,f)=>Math.max(h,f.length),0)};let s=0,o=0,a=-1;const l=t.length;let u,c=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(n[s++]=he({type:new br(e),length:o,nullCount:0,children:c.slice()})))}return[r=r.assign(e),n.map(h=>new Er(r,h))]}function W3(r,t,e,n,i){var s;const o=(t+63&-64)>>3;for(let a=-1,l=n.length;++a=t)c===t?e[a]=u:(e[a]=u.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(u.slice(t,c-t))));else{const h=r[a];r[a]=h.clone({nullable:!0}),e[a]=(s=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:he({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var qS;let qi=class Ts{constructor(...t){var e,n;if(t.length===0)return this.batches=[],this.schema=new Ue([]),this._offsets=[0],this;let i,s;t[0]instanceof Ue&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=l=>{if(l){if(l instanceof Er)return[l];if(l instanceof Ts)return l.batches;if(l instanceof Pe){if(l.type instanceof br)return[new Er(new Ue(l.type.children),l)]}else{if(Array.isArray(l))return l.flatMap(u=>o(u));if(typeof l[Symbol.iterator]=="function")return[...l].flatMap(u=>o(u));if(typeof l=="object"){const u=Object.keys(l),c=u.map(d=>new ze([l[d]])),h=i??new Ue(u.map((d,m)=>new Le(String(d),c[m].type,c[m].nullable))),[,f]=Hd(h,c);return f.length===0?[new Er(l)]:f}}}return[]},a=t.flatMap(l=>o(l));if(i=(n=i??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&n!==void 0?n:new Ue([]),!(i instanceof Ue))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof Er))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Mp(i,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=s??kS(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=BS(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(Rm(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?Nm.visit(new ze(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ ${this.toArray().join(`, `)} -]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new Ts(e,n.map(i=>new Er(e,i)))}slice(t,e){const n=this.schema;[t,e]=LS({length:this.numRows},t,e);const i=US(this.data,this._offsets,t,e);return new Ts(n,i.map(s=>new Er(n,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&tn.children[t]);if(e.length===0){const{type:n}=this.schema.fields[t],i=he({type:n,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new ze(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[n,i]=Hd(n,a)}return new Ts(n,i)}select(t){const e=this.schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new Ts(e,n)}assign(t){const e=this.schema.fields,[n,i]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,f=e.findIndex(d=>d.name===l.name);return~f?h[f]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,i[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new Ts(...Hd(s,o))}};qS=Symbol.toStringTag;qi[qS]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=gc(Lm),r.get=gc(Or.getVisitFn(z.Struct)),r.set=zS(fn.getVisitFn(z.Struct)),r.indexOf=VS(yc.getVisitFn(z.Struct)),"Table"))(qi.prototype);var QS;let Er=class $a{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Ue))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=he({nullCount:0,type:new br(this.schema.fields),children:this.schema.fields.map(e=>he({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Pe))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=g0(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:i,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Le.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Ue(n),a=he({type:new br(n),length:s,children:i,nullCount:0});[this.schema,this.data]=g0(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=ZS(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 Or.visit(this.data,t)}at(t){return this.get(Rm(t,this.numRows))}set(t,e){return fn.visit(this.data,t,e)}indexOf(t,e){return yc.visit(this.data,t,e)}[Symbol.iterator](){return Nm.visit(new ze([this.data]))}toArray(){return[...this]}concat(...t){return new qi(this.schema,[this,...t])}slice(t,e){const[n]=new ze([this.data]).slice(t,e).data;return new $a(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&ti.name===t),e)}setChildAt(t,e){let n=this.schema,i=this.data;if(t>-1&&ta.name===s);~o&&(i[o]=this.data.children[o])}return new $a(e,he({type:n,length:this.numRows,children:i}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),i=he({type:new br(e.fields),length:this.numRows,children:n});return new $a(e,i)}};QS=Symbol.toStringTag;Er[QS]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Er.prototype);function g0(r,t,e=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;const i=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(i[a]=l.clone({nullable:!0}),s[a]=(n=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:he({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(i),he({type:new br(i),length:e,children:s})]}function ZS(r,t,e=new Map){var n,i;if(((n=r==null?void 0:r.length)!==null&&n!==void 0?n:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++she({type:i.type})),n=he({type:new br(t.fields),nullCount:0,children:e});super(t,n)}}let Pi=class Pn{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 Pn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+Se),(e||new Pn).__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):He.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):ve.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new tr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,He.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,ve.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,n,i,s,o){return Pn.startMessage(t),Pn.addVersion(t,e),Pn.addHeaderType(t,n),Pn.addHeader(t,i),Pn.addBodyLength(t,s),Pn.addCustomMetadata(t,o),Pn.endMessage(t)}};class H3 extends le{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return o0.startNull(e),o0.endNull(e)}visitInt(t,e){return Br.startInt(e),Br.addBitWidth(e,t.bitWidth),Br.addIsSigned(e,t.isSigned),Br.endInt(e)}visitFloat(t,e){return Vn.startFloatingPoint(e),Vn.addPrecision(e,t.precision),Vn.endFloatingPoint(e)}visitBinary(t,e){return e0.startBinary(e),e0.endBinary(e)}visitLargeBinary(t,e){return n0.startLargeBinary(e),n0.endLargeBinary(e)}visitBool(t,e){return r0.startBool(e),r0.endBool(e)}visitUtf8(t,e){return a0.startUtf8(e),a0.endUtf8(e)}visitLargeUtf8(t,e){return i0.startLargeUtf8(e),i0.endLargeUtf8(e)}visitDecimal(t,e){return yo.startDecimal(e),yo.addScale(e,t.scale),yo.addPrecision(e,t.precision),yo.addBitWidth(e,t.bitWidth),yo.endDecimal(e)}visitDate(t,e){return yu.startDate(e),yu.addUnit(e,t.unit),yu.endDate(e)}visitTime(t,e){return on.startTime(e),on.addUnit(e,t.unit),on.addBitWidth(e,t.bitWidth),on.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0;return an.startTimestamp(e),an.addUnit(e,t.unit),n!==void 0&&an.addTimezone(e,n),an.endTimestamp(e)}visitInterval(t,e){return jn.startInterval(e),jn.addUnit(e,t.unit),jn.endInterval(e)}visitDuration(t,e){return vu.startDuration(e),vu.addUnit(e,t.unit),vu.endDuration(e)}visitList(t,e){return s0.startList(e),s0.endList(e)}visitStruct(t,e){return Ps.startStruct_(e),Ps.endStruct_(e)}visitUnion(t,e){Mr.startTypeIdsVector(e,t.typeIds.length);const n=Mr.createTypeIdsVector(e,t.typeIds);return Mr.startUnion(e),Mr.addMode(e,t.mode),Mr.addTypeIds(e,n),Mr.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return gi.startDictionaryEncoding(e),gi.addId(e,BigInt(t.id)),gi.addIsOrdered(e,t.isOrdered),n!==void 0&&gi.addIndexType(e,n),gi.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return _u.startFixedSizeBinary(e),_u.addByteWidth(e,t.byteWidth),_u.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return bu.startFixedSizeList(e),bu.addListSize(e,t.listSize),bu.endFixedSizeList(e)}visitMap(t,e){return xu.startMap(e),xu.addKeysSorted(e,t.keysSorted),xu.endMap(e)}}const Xd=new H3;function X3(r,t=new Map){return new Ue(q3(r,t),Tu(r.metadata),t)}function KS(r){return new Wr(r.count,JS(r.columns),tT(r.columns))}function Y3(r){return new Qn(KS(r.data),r.id,r.isDelta)}function q3(r,t){return(r.fields||[]).filter(Boolean).map(e=>Le.fromJSON(e,t))}function y0(r,t){return(r.children||[]).filter(Boolean).map(e=>Le.fromJSON(e,t))}function JS(r){return(r||[]).reduce((t,e)=>[...t,new Qi(e.count,Q3(e.VALIDITY)),...JS(e.children)],[])}function tT(r,t=[]){for(let e=-1,n=(r||[]).length;++et+ +(e===0),0)}function Z3(r,t){let e,n,i,s,o,a;return!t||!(s=r.dictionary)?(o=_0(r,y0(r,t)),i=new Le(r.name,o,r.nullable,Tu(r.metadata))):t.has(e=s.id)?(n=(n=s.indexType)?v0(n):new hl,a=new qo(t.get(e),n,e,s.isOrdered),i=new Le(r.name,a,r.nullable,Tu(r.metadata))):(n=(n=s.indexType)?v0(n):new hl,t.set(e,o=_0(r,y0(r,t))),a=new qo(o,n,e,s.isOrdered),i=new Le(r.name,a,r.nullable,Tu(r.metadata))),i||null}function Tu(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function v0(r){return new Vs(r.isSigned,r.bitWidth)}function _0(r,t){const e=r.type.name;switch(e){case"NONE":return new Hi;case"null":return new Hi;case"binary":return new Ku;case"largebinary":return new Ju;case"utf8":return new tc;case"largeutf8":return new ec;case"bool":return new rc;case"list":return new uc((t||[])[0]);case"struct":return new br(t||[]);case"struct_":return new br(t||[])}switch(e){case"int":{const n=r.type;return new Vs(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=r.type;return new Zu(mr[n.precision])}case"decimal":{const n=r.type;return new nc(n.scale,n.precision,n.bitWidth)}case"date":{const n=r.type;return new ic(dn[n.unit])}case"time":{const n=r.type;return new sc($t[n.unit],n.bitWidth)}case"timestamp":{const n=r.type;return new oc($t[n.unit],n.timezone)}case"interval":{const n=r.type;return new ac(qn[n.unit])}case"duration":{const n=r.type;return new lc($t[n.unit])}case"union":{const n=r.type,[i,...s]=(n.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new cc(gr[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=r.type;return new hc(n.byteWidth)}case"fixedsizelist":{const n=r.type;return new dc(n.listSize,(t||[])[0])}case"map":{const n=r.type;return new fc((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var K3=p1,J3=Xo;class xr{static fromJSON(t,e){const n=new xr(0,He.V5,e);return n._createHeader=tB(t,e),n}static decode(t){t=new J3(fe(t));const e=Pi.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),s=e.headerType(),o=new xr(n,i,s);return o._createHeader=eB(e,s),o}static encode(t){const e=new K3;let n=-1;return t.isSchema()?n=Ue.encode(e,t.header()):t.isRecordBatch()?n=Wr.encode(e,t.header()):t.isDictionaryBatch()&&(n=Qn.encode(e,t.header())),Pi.startMessage(e),Pi.addVersion(e,He.V5),Pi.addHeader(e,n),Pi.addHeaderType(e,t.headerType),Pi.addBodyLength(e,BigInt(t.bodyLength)),Pi.finishMessageBuffer(e,Pi.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Ue)return new xr(0,He.V5,ve.Schema,t);if(t instanceof Wr)return new xr(e,He.V5,ve.RecordBatch,t);if(t instanceof Qn)return new xr(e,He.V5,ve.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===ve.Schema}isRecordBatch(){return this.headerType===ve.RecordBatch}isDictionaryBatch(){return this.headerType===ve.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Ae(t)}}class Wr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=Ae(t)}}class Qn{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,n=!1){this._data=t,this._isDelta=n,this._id=Ae(e)}}class Gn{constructor(t,e){this.offset=Ae(t),this.length=Ae(e)}}class Qi{constructor(t,e){this.length=Ae(t),this.nullCount=Ae(e)}}function tB(r,t){return()=>{switch(t){case ve.Schema:return Ue.fromJSON(r);case ve.RecordBatch:return Wr.fromJSON(r);case ve.DictionaryBatch:return Qn.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${ve[t]}, type: ${t} }`)}}function eB(r,t){return()=>{switch(t){case ve.Schema:return Ue.decode(r.header(new Fn),new Map,r.version());case ve.RecordBatch:return Wr.decode(r.header(new hi),r.version());case ve.DictionaryBatch:return Qn.decode(r.header(new mo),r.version())}throw new Error(`Unrecognized Message type: { name: ${ve[t]}, type: ${t} }`)}}Le.encode=dB;Le.decode=cB;Le.fromJSON=Z3;Ue.encode=hB;Ue.decode=rB;Ue.fromJSON=X3;Wr.encode=fB;Wr.decode=nB;Wr.fromJSON=KS;Qn.encode=pB;Qn.decode=iB;Qn.fromJSON=Y3;Qi.encode=mB;Qi.decode=oB;Gn.encode=gB;Gn.decode=sB;function rB(r,t=new Map,e=He.V5){const n=uB(r,t);return new Ue(n,Iu(r),t,e)}function nB(r,t=He.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Wr(r.length(),aB(r),lB(r,t))}function iB(r,t=He.V5){return new Qn(Wr.decode(r.data(),t),r.id(),r.isDelta())}function sB(r){return new Gn(r.offset(),r.length())}function oB(r){return new Qi(r.length(),r.nullCount())}function aB(r){const t=[];for(let e,n=-1,i=-1,s=r.nodesLength();++nLe.encode(r,s));Fn.startFieldsVector(r,e.length);const n=Fn.createFieldsVector(r,e),i=t.metadata&&t.metadata.size>0?Fn.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return tr.startKeyValue(r),tr.addKey(r,a),tr.addValue(r,l),tr.endKeyValue(r)})):-1;return Fn.startSchema(r),Fn.addFields(r,n),Fn.addEndianness(r,yB?Yo.Little:Yo.Big),i!==-1&&Fn.addCustomMetadata(r,i),Fn.endSchema(r)}function dB(r,t){let e=-1,n=-1,i=-1;const s=t.type;let o=t.typeId;Rt.isDictionary(s)?(o=s.dictionary.typeId,i=Xd.visit(s,r),n=Xd.visit(s.dictionary,r)):n=Xd.visit(s,r);const a=(s.children||[]).map(c=>Le.encode(r,c)),l=Jr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Jr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const f=r.createString(`${c}`),d=r.createString(`${h}`);return tr.startKeyValue(r),tr.addKey(r,f),tr.addValue(r,d),tr.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Jr.startField(r),Jr.addType(r,n),Jr.addTypeType(r,o),Jr.addChildren(r,l),Jr.addNullable(r,!!t.nullable),e!==-1&&Jr.addName(r,e),i!==-1&&Jr.addDictionary(r,i),u!==-1&&Jr.addCustomMetadata(r,u),Jr.endField(r)}function fB(r,t){const e=t.nodes||[],n=t.buffers||[];hi.startNodesVector(r,e.length);for(const o of e.slice().reverse())Qi.encode(r,o);const i=r.endVector();hi.startBuffersVector(r,n.length);for(const o of n.slice().reverse())Gn.encode(r,o);const s=r.endVector();return hi.startRecordBatch(r),hi.addLength(r,BigInt(t.length)),hi.addNodes(r,i),hi.addBuffers(r,s),hi.endRecordBatch(r)}function pB(r,t){const e=Wr.encode(r,t.data);return mo.startDictionaryBatch(r),mo.addId(r,BigInt(t.id)),mo.addIsDelta(r,t.isDelta),mo.addData(r,e),mo.endDictionaryBatch(r)}function mB(r,t){return y1.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function gB(r,t){return g1.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const yB=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),$m=r=>`Expected ${ve[r]} Message in stream, but was null or length 0.`,Gm=r=>`Header pointer of flatbuffer-encoded ${ve[r]} Message is null or length 0.`,eT=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,rT=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class nT{constructor(t){this.source=t instanceof vc?t:new vc(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?Ve: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($m(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=fe(this.source.read(t));if(e.byteLength[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error($m(t));return e.value}readSchema(){const t=ve.Schema,e=this.readMessage(t),n=e==null?void 0:e.header();if(!e||!n)throw new Error(Gm(t));return n}}const rh=4,Ep="ARROW1",fl=new Uint8Array(Ep.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 rn.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return rn.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 un?t:mp(t)?TB(t):l1(t)?EB(t):zs(t)?re(this,void 0,void 0,function*(){return yield un.from(yield t)}):u1(t)||Em(t)||c1(t)||oa(t)?MB(new Qo(t)):IB(new vc(t))}static readAll(t){return t instanceof un?t.isSync()?S0(t):T0(t):mp(t)||ArrayBuffer.isView(t)||Tl(t)||a1(t)?S0(t):T0(t)}}class bc extends un{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Ar(this,arguments,function*(){yield Dt(yield*ks(Hn(this[Symbol.iterator]())))})}}class xc extends un{constructor(t){super(t),this._impl=t}readAll(){return re(this,void 0,void 0,function*(){var t,e,n,i;const s=new Array;try{for(var o=!0,a=Hn(this),l;l=yield a.next(),t=l.done,!t;o=!0){i=l.value,o=!1;const u=i;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class sT extends bc{constructor(t){super(t),this._impl=t}}class xB extends xc{constructor(t){super(t),this._impl=t}}class oT{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const n=this._loadVectors(t,e,this.schema.fields),i=he({type:new br(this.schema.fields),length:t.length,children:n});return new Er(this.schema,i)}_loadDictionaryBatch(t,e){const{id:n,isDelta:i}=t,{dictionaries:s,schema:o}=this,a=s.get(n),l=o.dictionaries.get(n),u=this._loadVectors(t.data,e,[l]);return(a&&i?a.concat(new ze(u)):new ze(u)).memoize()}_loadVectors(t,e,n){return new YS(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class wc extends oT{constructor(t,e){super(e),this._reader=mp(t)?new _B(this._handle=t):new nT(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=lT(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):Ve}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Ve}next(){if(this.closed)return Ve;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new jm(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Sc extends oT{constructor(t,e){super(e),this._reader=new vB(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return re(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 re(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=lT(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return re(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Ve})}return(t){return re(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Ve})}next(){return re(this,void 0,void 0,function*(){if(this.closed)return Ve;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new jm(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return re(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class aT extends wc{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 m0?t:new m0(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(ve.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(ve.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-iT,n=t.readInt32(e),i=t.readAt(e-n,n);return dl.decode(i)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return re(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return re(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(ve.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return re(this,void 0,void 0,function*(){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(ve.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return re(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-iT,n=yield t.readInt32(e),i=yield t.readAt(e-n,n);return dl.decode(i)})}_readNextMessageAndValidate(t){return re(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Wm(t)?new sT(new aT(r.read())):new bc(new wc(r)):new bc(new wc(function*(){}()))}function MB(r){return re(this,void 0,void 0,function*(){const t=yield r.peek(Al+7&-8);return t&&t.byteLength>=4?Wm(t)?new sT(new aT(yield r.read())):new xc(new Sc(r)):new xc(new Sc(function(){return Ar(this,arguments,function*(){})}()))})}function EB(r){return re(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new _c(r,t);return t>=bB&&Wm(yield e.readAt(0,Al+7&-8))?new xB(new wB(e)):new xc(new Sc(e))})}class $e extends le{static assemble(...t){const e=i=>i.flatMap(s=>Array.isArray(s)?e(s):s instanceof Er?s.data.children:s.data),n=new $e;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof ze)return this.visitMany(t.data),this;const{type:e}=t;if(!Rt.isDictionary(e)){const{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(Rt.isUnion(e))this.nodes.push(new Qi(n,0));else{const{nullCount:i}=t;Rt.isNull(e)||bn.call(this,i<=0?new Uint8Array(0):pc(t.offset,n,t.nullBitmap)),this.nodes.push(new Qi(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function bn(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Gn(this._byteLength,t)),this._byteLength+=t,this}function AB(r){var t;const{type:e,length:n,typeIds:i,valueOffsets:s}=r;if(bn.call(this,i),e.mode===gr.Sparse)return Ap.call(this,r);if(e.mode===gr.Dense){if(r.offset<=0)return bn.call(this,s),Ap.call(this,r);{const o=new Int32Array(n),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],f=a[h],d=l[h];return u.slice(f,Math.min(n,d))}))}}return this}function CB(r){let t;return r.nullCount>=r.length?bn.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?bn.call(this,pc(r.offset,r.length,t)):bn.call(this,mc(r.values))}function Ti(r){return bn.call(this,r.values.subarray(0,r.length*r.stride))}function nh(r){const{length:t,values:e,valueOffsets:n}=r,i=Ae(n[0]),s=Ae(n[t]),o=Math.min(s-i,e.byteLength-i);return bn.call(this,d1(-i,t+1,n)),bn.call(this,e.subarray(i,i+o)),this}function Hm(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:n,[t]:i}=e;return bn.call(this,d1(-n,t+1,e)),this.visit(r.children[0].slice(n,i-n))}return this.visit(r.children[0])}function Ap(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}$e.prototype.visitBool=CB;$e.prototype.visitInt=Ti;$e.prototype.visitFloat=Ti;$e.prototype.visitUtf8=nh;$e.prototype.visitLargeUtf8=nh;$e.prototype.visitBinary=nh;$e.prototype.visitLargeBinary=nh;$e.prototype.visitFixedSizeBinary=Ti;$e.prototype.visitDate=Ti;$e.prototype.visitTimestamp=Ti;$e.prototype.visitTime=Ti;$e.prototype.visitDecimal=Ti;$e.prototype.visitList=Hm;$e.prototype.visitStruct=Ap;$e.prototype.visitUnion=AB;$e.prototype.visitInterval=Ti;$e.prototype.visitDuration=Ti;$e.prototype.visitFixedSizeList=Hm;$e.prototype.visitMap=Hm;class uT extends Bm{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 Su,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Cr(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 zs(t)?t.then(e=>this.writeAll(e)):oa(t)?Qm(this,t):qm(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 Su?this._sink=t:(this._sink=new Su,t&&iN(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&sN(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||!Mp(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 qi&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof Er&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Mp(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof Er?t instanceof jm||this._writeRecordBatch(t):t instanceof qi?this.writeAll(t.batches):Tl(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,i=xr.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,l=a-s-o;return t.headerType===ve.RecordBatch?this._recordBatchBlocks.push(new Xi(a,t.bodyLength,this._position)):t.headerType===ve.DictionaryBatch&&this._dictionaryBlocks.push(new Xi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(l)}_write(t){if(this._started){const e=fe(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(xr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(fl)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=$e.assemble(t),o=new Wr(t.numRows,n,i),a=xr.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,n=!1){const{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=$e.assemble(new ze([t])),l=new Wr(t.length,s,o),u=new Qn(l,e,n),c=xr.from(u,i);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,i;for(let s=-1,o=t.length;++s0&&(this._write(e),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){var e,n;for(const[i,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(i),l=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,i,u>0);else if(ln.writeAll(i)):oa(t)?Qm(n,t):qm(n,t)}}class Ym extends uT{static writeAll(t){const e=new Ym;return zs(t)?t.then(n=>e.writeAll(n)):oa(t)?Qm(e,t):qm(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,n=!1){if(!n&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,n)}_writeFooter(t){const e=dl.encode(new dl(t,He.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function qm(r,t){let e=t;t instanceof qi&&(e=t.batches,r.reset(void 0,t.schema));for(const n of e)r.write(n);return r.finish()}function Qm(r,t){return re(this,void 0,void 0,function*(){var e,n,i,s,o,a,l;try{for(e=!0,n=Hn(t);i=yield n.next(),s=i.done,!s;e=!0){l=i.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function OB(r,t="stream"){return(t==="stream"?Xm:Ym).writeAll(r).toUint8Array(!0)}var PB=Object.create,cT=Object.defineProperty,RB=Object.getOwnPropertyDescriptor,FB=Object.getOwnPropertyNames,DB=Object.getPrototypeOf,LB=Object.prototype.hasOwnProperty,NB=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),BB=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of FB(t))!LB.call(r,i)&&i!==e&&cT(r,i,{get:()=>t[i],enumerable:!(n=RB(t,i))||n.enumerable});return r},kB=(r,t,e)=>(e=r!=null?PB(DB(r)):{},BB(!r||!r.__esModule?cT(e,"default",{value:r,enumerable:!0}):e,r)),UB=NB((r,t)=>{t.exports=Worker}),hT=(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))(hT||{}),zB=(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))(zB||{}),VB=(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))(VB||{}),jB=(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))(jB||{}),$B=(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))($B||{}),GB=(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))(GB||{}),WB=class{log(r){}},dT=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},HB=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(HB||{}),XB=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=un.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new qi(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let n=new fT(this._bindings,this._conn,e),i=await un.from(n);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new YB(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=OB(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)}},fT=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}},YB=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=un.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new qi(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new fT(this.bindings,this.connectionId,t),n=await un.from(e);return console.assert(n.isAsync()),console.assert(n.isStream()),n}},qB=(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))(qB||{}),QB=(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))(QB||{}),me=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,n)=>{this.promiseResolver=e,this.promiseRejecter=n})}};function Mu(r){switch(r.typeId){case z.Binary:return{sqlType:"binary"};case z.Bool:return{sqlType:"bool"};case z.Date:return{sqlType:"date"};case z.DateDay:return{sqlType:"date32[d]"};case z.DateMillisecond:return{sqlType:"date64[ms]"};case z.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case z.Float:return{sqlType:"float"};case z.Float16:return{sqlType:"float16"};case z.Float32:return{sqlType:"float32"};case z.Float64:return{sqlType:"float64"};case z.Int:return{sqlType:"int32"};case z.Int16:return{sqlType:"int16"};case z.Int32:return{sqlType:"int32"};case z.Int64:return{sqlType:"int64"};case z.Uint16:return{sqlType:"uint16"};case z.Uint32:return{sqlType:"uint32"};case z.Uint64:return{sqlType:"uint64"};case z.Uint8:return{sqlType:"uint8"};case z.IntervalDayTime:return{sqlType:"interval[dt]"};case z.IntervalYearMonth:return{sqlType:"interval[m]"};case z.List:return{sqlType:"list",valueType:Mu(r.valueType)};case z.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case z.Null:return{sqlType:"null"};case z.Utf8:return{sqlType:"utf8"};case z.Struct:return{sqlType:"struct",fields:r.children.map(t=>Cp(t.name,t.type))};case z.Map:{let t=r;return{sqlType:"map",keyType:Mu(t.keyType),valueType:Mu(t.valueType)}}case z.Time:return{sqlType:"time[s]"};case z.TimeMicrosecond:return{sqlType:"time[us]"};case z.TimeMillisecond:return{sqlType:"time[ms]"};case z.TimeNanosecond:return{sqlType:"time[ns]"};case z.TimeSecond:return{sqlType:"time[s]"};case z.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case z.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case z.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case z.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case z.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function Cp(r,t){let e=Mu(t);return e.name=r,e}var ZB=new TextEncoder,KB=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(e.data);return}}let n=this._pendingRequests.get(e.requestId);if(!n){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let i=new Error(e.data.message);i.name=e.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=e.data.stack),n.promiseRejecter(i);return}switch(n.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"REGISTER_OPFS_FILE_NAME":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(e.type=="OK"){n.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){n.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){n.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){n.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){n.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){n.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){n.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){n.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){n.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){n.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){n.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){n.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){n.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){n.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){n.promiseResolver(e.data);return}break}n.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new me("RESET",null);return await this.postTask(r)}async ping(){let r=new me("PING",null);await this.postTask(r)}async dropFile(r){let t=new me("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new me("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new me("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=n=>{}){this._onInstantiationProgress.push(e);let n=new me("INSTANTIATE",[r,t]);return await this.postTask(n)}async getVersion(){let r=new me("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new me("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new me("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new me("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new me("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new XB(this,r)}async disconnect(r){let t=new me("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new me("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let n=new me("START_PENDING_QUERY",[r,t,e]);return await this.postTask(n)}async pollPendingQuery(r){let t=new me("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new me("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new me("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new me("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new me("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new me("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let n=new me("RUN_PREPARED",[r,t,e]);return await this.postTask(n)}async sendPrepared(r,t,e){let n=new me("SEND_PREPARED",[r,t,e]);return await this.postTask(n)}async globFiles(r){let t=new me("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=ZB.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,n){t===void 0&&(t=r);let i=new me("REGISTER_FILE_URL",[r,t,e,n]);await this.postTask(i)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new me("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,n){let i=new me("REGISTER_FILE_HANDLE",[r,t,e,n]);await this.postTask(i,[])}async registerOPFSFileName(r){let t=new me("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new me("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new me("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new me("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new me("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let n=new me("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(n,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(Cp(s,o))}e.columnsFlat=i,delete e.columns}let n=new me("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(n)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(Cp(s,o))}e.columnsFlat=i,delete e.columns}let n=new me("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(n)}};function JB(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}JB();var tk=(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))(tk||{}),ek=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])),rk=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])),nk=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])),ik=()=>(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])),sk={version:"1.29.1-dev68.0"},Zm=sk.version.split(".");Zm[0];Zm[1];Zm[2];var ok=()=>typeof navigator>"u",Yd=null,qd=null,Qd=null,Zd=null,Kd=null;async function ak(){return Yd==null&&(Yd=typeof BigInt64Array<"u"),qd==null&&(qd=await rk()),Qd==null&&(Qd=await ik()),Zd==null&&(Zd=await nk()),Kd==null&&(Kd=await ek()),{bigInt64Array:Yd,crossOriginIsolated:ok()||globalThis.crossOriginIsolated||!1,wasmExceptions:qd,wasmSIMD:Zd,wasmThreads:Qd,wasmBulkMemory:Kd}}async function I0(r){let t=await ak();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}}kB(UB());const Jd={},Ga={};function qa(r,t){try{const n=(Jd[r]||(Jd[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return n in Ga?Ga[n]:M0(n,n.split(":"))}catch{if(r in Ga)return Ga[r];const e=r==null?void 0:r.match(lk);return e?M0(r,e.slice(1)):NaN}}const lk=/([+-]\d\d):?(\d\d)?/;function M0(r,t){const e=+t[0],n=+(t[1]||0);return Ga[r]=e>0?e*60+n:e*60-n}class Vr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(qa(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)),pT(this),Op(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Vr(...e,t):new Vr(Date.now(),t)}withTimeZone(t){return new Vr(+this,t)}getTimezoneOffset(){return-qa(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Op(this),+this}[Symbol.for("constructDateFrom")](t){return new Vr(+new Date(t),this.timeZone)}}const E0=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!E0.test(r))return;const t=r.replace(E0,"$1UTC");Vr.prototype[t]&&(r.startsWith("get")?Vr.prototype[r]=function(){return this.internal[t]()}:(Vr.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),uk(this),+this},Vr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Op(this),+this}))});function Op(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function uk(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()),pT(r)}function pT(r){const t=qa(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const n=-new Date(+r).getTimezoneOffset(),i=-new Date(+e).getTimezoneOffset(),s=n-i,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=n-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=qa(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,f=c-a;if(h&&f){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+f);const d=qa(r.timeZone,r),m=l-d;m&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+m),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+m))}}const ck=new TextDecoder("utf-8"),hk=r=>ck.decode(r),dk=new TextEncoder,mT=r=>dk.encode(r),Ln=r=>typeof r=="function",Cl=r=>r!=null&&Object(r)===r,fk=r=>Cl(r)&&Ln(r.then),gT=r=>Cl(r)&&Ln(r[Symbol.iterator]),pk=r=>Cl(r)&&Ln(r[Symbol.asyncIterator]),mk=r=>Cl(r)&&"done"in r&&"value"in r,gk=r=>Cl(r)&&Ln(r.clear)&&Ln(r.bytes)&&Ln(r.position)&&Ln(r.setPosition)&&Ln(r.capacity)&&Ln(r.getBufferIdentifier)&&Ln(r.createLong),Km=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function yk(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lyr(Int8Array,r),bk=r=>yr(Int16Array,r),xk=r=>yr(Int32Array,r),wk=r=>yr(BigInt64Array,r),Sk=r=>yr(Uint8Array,r),Tk=r=>yr(Uint16Array,r),Ik=r=>yr(Uint32Array,r),Mk=r=>yr(BigUint64Array,r),Ek=r=>yr(Float32Array,r),Ak=r=>yr(Float64Array,r),Ck=r=>yr(Uint8ClampedArray,r),Rp=r=>(r.next(),r);function*ri(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Km?e(t):gT(t)?t:e(t);return yield*Rp(function*(i){let s=null;do s=i.next(yield yr(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const Ok=r=>ri(Int8Array,r),Pk=r=>ri(Int16Array,r),Rk=r=>ri(Int32Array,r),Fk=r=>ri(Uint8Array,r),Dk=r=>ri(Uint16Array,r),Lk=r=>ri(Uint32Array,r),Nk=r=>ri(Float32Array,r),Bk=r=>ri(Float64Array,r),kk=r=>ri(Uint8ClampedArray,r);function Sn(r,t){return Ar(this,arguments,function*(){if(fk(t))return yield Dt(yield Dt(yield*ks(Hn(Sn(r,yield Dt(t))))));const n=function(o){return Ar(this,arguments,function*(){yield yield Dt(yield Dt(o))})},i=function(o){return Ar(this,arguments,function*(){yield Dt(yield*ks(Hn(Rp(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 Km?n(t):gT(t)?i(t):pk(t)?t:n(t);return yield Dt(yield*ks(Hn(Rp(function(o){return Ar(this,arguments,function*(){let a=null;do a=yield Dt(o.next(yield yield Dt(yr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Dt(new r)})}const Uk=r=>Sn(Int8Array,r),zk=r=>Sn(Int16Array,r),Vk=r=>Sn(Int32Array,r),jk=r=>Sn(Uint8Array,r),$k=r=>Sn(Uint16Array,r),Gk=r=>Sn(Uint32Array,r),Wk=r=>Sn(Float32Array,r),Hk=r=>Sn(Float64Array,r),Xk=r=>Sn(Uint8ClampedArray,r);function Yk(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++eKo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const Zk=Object.freeze(Object.defineProperty({__proto__:null,valueToString:Ko},Symbol.toStringTag,{value:"Module"}));function wr(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 vT(r,t){return wr(r/t)+wr(r%t)/wr(t)}const _T=Symbol.for("isArrowBigNum");function Tn(r,...t){return t.length===0?Object.setPrototypeOf(yr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}Tn.prototype[_T]=!0;Tn.prototype.toJSON=function(){return`"${Jo(this)}"`};Tn.prototype.valueOf=function(r){return Jm(this,r)};Tn.prototype.toString=function(){return Jo(this)};Tn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Jm(this);case"string":return Jo(this);case"default":return bT(this)}return Jo(this)};function zo(...r){return Tn.apply(this,r)}function Vo(...r){return Tn.apply(this,r)}function pl(...r){return Tn.apply(this,r)}Object.setPrototypeOf(zo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Vo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(pl.prototype,Object.create(Uint32Array.prototype));Object.assign(zo.prototype,Tn.prototype,{constructor:zo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Vo.prototype,Tn.prototype,{constructor:Vo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(pl.prototype,Tn.prototype,{constructor:pl,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Kk=BigInt(4294967296)*BigInt(4294967296),Jk=Kk-BigInt(1);function Jm(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return tf(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Pt.prototype);class A0 extends Pt{constructor(){super(H.Null)}toString(){return"Null"}}wT=Symbol.toStringTag;A0[wT]=(r=>r[Symbol.toStringTag]="Null")(A0.prototype);class C0 extends Pt{constructor(t,e){super(H.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}ST=Symbol.toStringTag;C0[ST]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(C0.prototype);class O0 extends Pt{constructor(t){super(H.Float),this.precision=t}get ArrayType(){switch(this.precision){case jr.HALF:return Uint16Array;case jr.SINGLE:return Float32Array;case jr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}TT=Symbol.toStringTag;O0[TT]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(O0.prototype);class P0 extends Pt{constructor(){super(H.Binary)}toString(){return"Binary"}}IT=Symbol.toStringTag;P0[IT]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(P0.prototype);class R0 extends Pt{constructor(){super(H.LargeBinary)}toString(){return"LargeBinary"}}MT=Symbol.toStringTag;R0[MT]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(R0.prototype);class F0 extends Pt{constructor(){super(H.Utf8)}toString(){return"Utf8"}}ET=Symbol.toStringTag;F0[ET]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(F0.prototype);class D0 extends Pt{constructor(){super(H.LargeUtf8)}toString(){return"LargeUtf8"}}AT=Symbol.toStringTag;D0[AT]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(D0.prototype);class L0 extends Pt{constructor(){super(H.Bool)}toString(){return"Bool"}}CT=Symbol.toStringTag;L0[CT]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(L0.prototype);class N0 extends Pt{constructor(t,e,n=128){super(H.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}OT=Symbol.toStringTag;N0[OT]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(N0.prototype);class B0 extends Pt{constructor(t){super(H.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Zi[this.unit]}>`}get ArrayType(){return this.unit===Zi.DAY?Int32Array:BigInt64Array}}PT=Symbol.toStringTag;B0[PT]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(B0.prototype);class k0 extends Pt{constructor(t,e){super(H.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${ne[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}RT=Symbol.toStringTag;k0[RT]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(k0.prototype);class U0 extends Pt{constructor(t,e){super(H.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${ne[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}FT=Symbol.toStringTag;U0[FT]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(U0.prototype);class z0 extends Pt{constructor(t){super(H.Interval),this.unit=t}toString(){return`Interval<${js[this.unit]}>`}}DT=Symbol.toStringTag;z0[DT]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(z0.prototype);class V0 extends Pt{constructor(t){super(H.Duration),this.unit=t}toString(){return`Duration<${ne[this.unit]}>`}}LT=Symbol.toStringTag;V0[LT]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(V0.prototype);class j0 extends Pt{constructor(t){super(H.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}NT=Symbol.toStringTag;j0[NT]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(j0.prototype);class Fp extends Pt{constructor(t){super(H.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}BT=Symbol.toStringTag;Fp[BT]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(Fp.prototype);class $0 extends Pt{constructor(t,e,n){super(H.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}kT=Symbol.toStringTag;$0[kT]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))($0.prototype);class G0 extends Pt{constructor(t){super(H.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}UT=Symbol.toStringTag;G0[UT]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(G0.prototype);class W0 extends Pt{constructor(t,e){super(H.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}zT=Symbol.toStringTag;W0[zT]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(W0.prototype);class H0 extends Pt{constructor(t,e=!1){var n,i,s;if(super(H.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}VT=Symbol.toStringTag;H0[VT]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(H0.prototype);const eU=(r=>()=>++r)(-1);class X0 extends Pt{constructor(t,e,n,i){super(H.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?eU():wr(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}jT=Symbol.toStringTag;X0[jT]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(X0.prototype);function $T(r){const t=r;switch(r.typeId){case H.Decimal:return r.bitWidth/32;case H.Interval:return 1+t.unit;case H.FixedSizeList:return t.listSize;case H.FixedSizeBinary:return t.byteWidth;default:return 1}}class pe{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return rU(this,t,e)}getVisitFnByTypeId(t,e=!0){return Io(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function rU(r,t,e=!0){return typeof t=="number"?Io(r,t,e):typeof t=="string"&&t in H?Io(r,H[t],e):t&&t instanceof Pt?Io(r,Y0(t),e):t!=null&&t.type&&t.type instanceof Pt?Io(r,Y0(t.type),e):Io(r,H.NONE,e)}function Io(r,t,e=!0){let n=null;switch(t){case H.Null:n=r.visitNull;break;case H.Bool:n=r.visitBool;break;case H.Int:n=r.visitInt;break;case H.Int8:n=r.visitInt8||r.visitInt;break;case H.Int16:n=r.visitInt16||r.visitInt;break;case H.Int32:n=r.visitInt32||r.visitInt;break;case H.Int64:n=r.visitInt64||r.visitInt;break;case H.Uint8:n=r.visitUint8||r.visitInt;break;case H.Uint16:n=r.visitUint16||r.visitInt;break;case H.Uint32:n=r.visitUint32||r.visitInt;break;case H.Uint64:n=r.visitUint64||r.visitInt;break;case H.Float:n=r.visitFloat;break;case H.Float16:n=r.visitFloat16||r.visitFloat;break;case H.Float32:n=r.visitFloat32||r.visitFloat;break;case H.Float64:n=r.visitFloat64||r.visitFloat;break;case H.Utf8:n=r.visitUtf8;break;case H.LargeUtf8:n=r.visitLargeUtf8;break;case H.Binary:n=r.visitBinary;break;case H.LargeBinary:n=r.visitLargeBinary;break;case H.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case H.Date:n=r.visitDate;break;case H.DateDay:n=r.visitDateDay||r.visitDate;break;case H.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case H.Timestamp:n=r.visitTimestamp;break;case H.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case H.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case H.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case H.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case H.Time:n=r.visitTime;break;case H.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case H.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case H.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case H.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case H.Decimal:n=r.visitDecimal;break;case H.List:n=r.visitList;break;case H.Struct:n=r.visitStruct;break;case H.Union:n=r.visitUnion;break;case H.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case H.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case H.Dictionary:n=r.visitDictionary;break;case H.Interval:n=r.visitInterval;break;case H.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case H.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case H.Duration:n=r.visitDuration;break;case H.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case H.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case H.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case H.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case H.FixedSizeList:n=r.visitFixedSizeList;break;case H.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${H[t]}'`)}function Y0(r){switch(r.typeId){case H.Null:return H.Null;case H.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?H.Int8:H.Uint8;case 16:return e?H.Int16:H.Uint16;case 32:return e?H.Int32:H.Uint32;case 64:return e?H.Int64:H.Uint64}return H.Int}case H.Float:switch(r.precision){case jr.HALF:return H.Float16;case jr.SINGLE:return H.Float32;case jr.DOUBLE:return H.Float64}return H.Float;case H.Binary:return H.Binary;case H.LargeBinary:return H.LargeBinary;case H.Utf8:return H.Utf8;case H.LargeUtf8:return H.LargeUtf8;case H.Bool:return H.Bool;case H.Decimal:return H.Decimal;case H.Time:switch(r.unit){case ne.SECOND:return H.TimeSecond;case ne.MILLISECOND:return H.TimeMillisecond;case ne.MICROSECOND:return H.TimeMicrosecond;case ne.NANOSECOND:return H.TimeNanosecond}return H.Time;case H.Timestamp:switch(r.unit){case ne.SECOND:return H.TimestampSecond;case ne.MILLISECOND:return H.TimestampMillisecond;case ne.MICROSECOND:return H.TimestampMicrosecond;case ne.NANOSECOND:return H.TimestampNanosecond}return H.Timestamp;case H.Date:switch(r.unit){case Zi.DAY:return H.DateDay;case Zi.MILLISECOND:return H.DateMillisecond}return H.Date;case H.Interval:switch(r.unit){case js.DAY_TIME:return H.IntervalDayTime;case js.YEAR_MONTH:return H.IntervalYearMonth}return H.Interval;case H.Duration:switch(r.unit){case ne.SECOND:return H.DurationSecond;case ne.MILLISECOND:return H.DurationMillisecond;case ne.MICROSECOND:return H.DurationMicrosecond;case ne.NANOSECOND:return H.DurationNanosecond}return H.Duration;case H.Map:return H.Map;case H.List:return H.List;case H.Struct:return H.Struct;case H.Union:switch(r.mode){case Zn.Dense:return H.DenseUnion;case Zn.Sparse:return H.SparseUnion}return H.Union;case H.FixedSizeBinary:return H.FixedSizeBinary;case H.FixedSizeList:return H.FixedSizeList;case H.Dictionary:return H.Dictionary}throw new Error(`Unrecognized type '${H[r.typeId]}'`)}pe.prototype.visitInt8=null;pe.prototype.visitInt16=null;pe.prototype.visitInt32=null;pe.prototype.visitInt64=null;pe.prototype.visitUint8=null;pe.prototype.visitUint16=null;pe.prototype.visitUint32=null;pe.prototype.visitUint64=null;pe.prototype.visitFloat16=null;pe.prototype.visitFloat32=null;pe.prototype.visitFloat64=null;pe.prototype.visitDateDay=null;pe.prototype.visitDateMillisecond=null;pe.prototype.visitTimestampSecond=null;pe.prototype.visitTimestampMillisecond=null;pe.prototype.visitTimestampMicrosecond=null;pe.prototype.visitTimestampNanosecond=null;pe.prototype.visitTimeSecond=null;pe.prototype.visitTimeMillisecond=null;pe.prototype.visitTimeMicrosecond=null;pe.prototype.visitTimeNanosecond=null;pe.prototype.visitDenseUnion=null;pe.prototype.visitSparseUnion=null;pe.prototype.visitIntervalDayTime=null;pe.prototype.visitIntervalYearMonth=null;pe.prototype.visitDuration=null;pe.prototype.visitDurationSecond=null;pe.prototype.visitDurationMillisecond=null;pe.prototype.visitDurationMicrosecond=null;pe.prototype.visitDurationNanosecond=null;const GT=new Float64Array(1),uo=new Uint32Array(GT.buffer);function tg(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function WT(r){if(r!==r)return 32256;GT[0]=r;const t=(uo[1]&2147483648)>>16&65535;let e=uo[1]&2146435072,n=0;return e>=1089470464?uo[0]>0?e=31744:(e=(e&2080374784)>>16,n=(uo[1]&1048575)>>10):e<=1056964608?(n=1048576+(uo[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(uo[1]&1048575)+512>>10),t|e|n&65535}const nU=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:WT,uint16ToFloat64:tg},Symbol.toStringTag,{value:"Module"}));class Xt extends pe{}function Kt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const iU=(r,t,e)=>{r[t]=Math.floor(e/864e5)},HT=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},eg=({values:r},t,e)=>{r[t]=e},XT=({values:r},t,e)=>{r[t]=WT(e)},oU=(r,t,e)=>{switch(r.type.precision){case jr.HALF:return XT(r,t,e);case jr.SINGLE:case jr.DOUBLE:return eg(r,t,e)}},YT=({values:r},t,e)=>{iU(r,t,e.valueOf())},qT=({values:r},t,e)=>{r[t]=BigInt(e)},aU=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},QT=({values:r,valueOffsets:t},e,n)=>HT(r,t,e,n),ZT=({values:r,valueOffsets:t},e,n)=>HT(r,t,e,mT(n)),lU=(r,t,e)=>{r.type.unit===Zi.DAY?YT(r,t,e):qT(r,t,e)},KT=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},JT=({values:r},t,e)=>{r[t]=BigInt(e)},tI=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},eI=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},uU=(r,t,e)=>{switch(r.type.unit){case ne.SECOND:return KT(r,t,e);case ne.MILLISECOND:return JT(r,t,e);case ne.MICROSECOND:return tI(r,t,e);case ne.NANOSECOND:return eI(r,t,e)}},rI=({values:r},t,e)=>{r[t]=e},nI=({values:r},t,e)=>{r[t]=e},iI=({values:r},t,e)=>{r[t]=e},sI=({values:r},t,e)=>{r[t]=e},cU=(r,t,e)=>{switch(r.type.unit){case ne.SECOND:return rI(r,t,e);case ne.MILLISECOND:return nI(r,t,e);case ne.MICROSECOND:return iI(r,t,e);case ne.NANOSECOND:return sI(r,t,e)}},hU=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},dU=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=Kn.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=Kn.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},pU=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),mU=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),gU=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),yU=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),vU=(r,t,e)=>{const n=r.type.children.map(s=>Kn.getVisitFn(s.type)),i=e instanceof Map?gU(t,e):e instanceof lr?mU(t,e):Array.isArray(e)?pU(t,e):yU(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},_U=(r,t,e)=>{r.type.mode===Zn.Dense?oI(r,t,e):aI(r,t,e)},oI=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];Kn.visit(i,r.valueOffsets[t],e)},aI=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];Kn.visit(i,t,e)},bU=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},xU=(r,t,e)=>{r.type.unit===js.DAY_TIME?lI(r,t,e):uI(r,t,e)},lI=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},uI=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},cI=({values:r},t,e)=>{r[t]=e},hI=({values:r},t,e)=>{r[t]=e},dI=({values:r},t,e)=>{r[t]=e},fI=({values:r},t,e)=>{r[t]=e},wU=(r,t,e)=>{switch(r.type.unit){case ne.SECOND:return cI(r,t,e);case ne.MILLISECOND:return hI(r,t,e);case ne.MICROSECOND:return dI(r,t,e);case ne.NANOSECOND:return fI(r,t,e)}},SU=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=Kn.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${Ko(t)}: ${Ko(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new TU(this[vn],this[jo])}}class TU{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[vn].type.children.some(n=>n.name===e)}getOwnPropertyDescriptor(t,e){if(t[vn].type.children.some(n=>n.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[vn].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=pn.visit(t[vn].children[n],t[jo]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[vn].type.children.findIndex(s=>s.name===e);return i!==-1?(Kn.visit(t[vn].children[i],t[jo],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}const MU=new IU;class Ut extends pe{}function Yt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const EU=(r,t)=>864e5*r[t],AU=(r,t)=>null,pI=(r,t,e)=>{if(e+1>=t.length)return null;const n=wr(t[e]),i=wr(t[e+1]);return r.subarray(n,i)},CU=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<EU(r,t),gI=({values:r},t)=>wr(r[t]),es=({stride:r,values:t},e)=>t[r*e],OU=({stride:r,values:t},e)=>tg(t[r*e]),yI=({values:r},t)=>r[t],PU=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),vI=({values:r,valueOffsets:t},e)=>pI(r,t,e),_I=({values:r,valueOffsets:t},e)=>{const n=pI(r,t,e);return n!==null?hk(n):null},RU=({values:r},t)=>r[t],FU=({type:r,values:t},e)=>r.precision!==jr.HALF?t[e]:tg(t[e]),DU=(r,t)=>r.type.unit===Zi.DAY?mI(r,t):gI(r,t),bI=({values:r},t)=>1e3*wr(r[t]),xI=({values:r},t)=>wr(r[t]),wI=({values:r},t)=>vT(r[t],BigInt(1e3)),SI=({values:r},t)=>vT(r[t],BigInt(1e6)),LU=(r,t)=>{switch(r.type.unit){case ne.SECOND:return bI(r,t);case ne.MILLISECOND:return xI(r,t);case ne.MICROSECOND:return wI(r,t);case ne.NANOSECOND:return SI(r,t)}},TI=({values:r},t)=>r[t],II=({values:r},t)=>r[t],MI=({values:r},t)=>r[t],EI=({values:r},t)=>r[t],NU=(r,t)=>{switch(r.type.unit){case ne.SECOND:return TI(r,t);case ne.MILLISECOND:return II(r,t);case ne.MICROSECOND:return MI(r,t);case ne.NANOSECOND:return EI(r,t)}},BU=({values:r,stride:t},e)=>ih.decimal(r.subarray(t*e,t*(e+1))),kU=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new lr([l])},UU=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new ng(o.slice(i,s-i))},zU=(r,t)=>new rg(r,t),VU=(r,t)=>r.type.mode===Zn.Dense?AI(r,t):CI(r,t),AI=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return pn.visit(n,r.valueOffsets[t])},CI=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return pn.visit(n,t)},jU=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},$U=(r,t)=>r.type.unit===js.DAY_TIME?OI(r,t):PI(r,t),OI=({values:r},t)=>r.subarray(2*t,2*(t+1)),PI=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},RI=({values:r},t)=>r[t],FI=({values:r},t)=>r[t],DI=({values:r},t)=>r[t],LI=({values:r},t)=>r[t],GU=(r,t)=>{switch(r.type.unit){case ne.SECOND:return RI(r,t);case ne.MILLISECOND:return FI(r,t);case ne.MICROSECOND:return DI(r,t);case ne.NANOSECOND:return LI(r,t)}},WU=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new lr([s])};Ut.prototype.visitNull=Yt(AU);Ut.prototype.visitBool=Yt(CU);Ut.prototype.visitInt=Yt(RU);Ut.prototype.visitInt8=Yt(es);Ut.prototype.visitInt16=Yt(es);Ut.prototype.visitInt32=Yt(es);Ut.prototype.visitInt64=Yt(yI);Ut.prototype.visitUint8=Yt(es);Ut.prototype.visitUint16=Yt(es);Ut.prototype.visitUint32=Yt(es);Ut.prototype.visitUint64=Yt(yI);Ut.prototype.visitFloat=Yt(FU);Ut.prototype.visitFloat16=Yt(OU);Ut.prototype.visitFloat32=Yt(es);Ut.prototype.visitFloat64=Yt(es);Ut.prototype.visitUtf8=Yt(_I);Ut.prototype.visitLargeUtf8=Yt(_I);Ut.prototype.visitBinary=Yt(vI);Ut.prototype.visitLargeBinary=Yt(vI);Ut.prototype.visitFixedSizeBinary=Yt(PU);Ut.prototype.visitDate=Yt(DU);Ut.prototype.visitDateDay=Yt(mI);Ut.prototype.visitDateMillisecond=Yt(gI);Ut.prototype.visitTimestamp=Yt(LU);Ut.prototype.visitTimestampSecond=Yt(bI);Ut.prototype.visitTimestampMillisecond=Yt(xI);Ut.prototype.visitTimestampMicrosecond=Yt(wI);Ut.prototype.visitTimestampNanosecond=Yt(SI);Ut.prototype.visitTime=Yt(NU);Ut.prototype.visitTimeSecond=Yt(TI);Ut.prototype.visitTimeMillisecond=Yt(II);Ut.prototype.visitTimeMicrosecond=Yt(MI);Ut.prototype.visitTimeNanosecond=Yt(EI);Ut.prototype.visitDecimal=Yt(BU);Ut.prototype.visitList=Yt(kU);Ut.prototype.visitStruct=Yt(zU);Ut.prototype.visitUnion=Yt(VU);Ut.prototype.visitDenseUnion=Yt(AI);Ut.prototype.visitSparseUnion=Yt(CI);Ut.prototype.visitDictionary=Yt(jU);Ut.prototype.visitInterval=Yt($U);Ut.prototype.visitIntervalDayTime=Yt(OI);Ut.prototype.visitIntervalYearMonth=Yt(PI);Ut.prototype.visitDuration=Yt(GU);Ut.prototype.visitDurationSecond=Yt(RI);Ut.prototype.visitDurationMillisecond=Yt(FI);Ut.prototype.visitDurationMicrosecond=Yt(DI);Ut.prototype.visitDurationNanosecond=Yt(LI);Ut.prototype.visitFixedSizeList=Yt(WU);Ut.prototype.visitMap=Yt(UU);const pn=new Ut,Mo=Symbol.for("keys"),$o=Symbol.for("vals"),Eo=Symbol.for("kKeysAsStrings"),Dp=Symbol.for("_kKeysAsStrings");class ng{constructor(t){return this[Mo]=new lr([t.children[0]]).memoize(),this[$o]=t.children[1],new Proxy(this,new XU)}get[Eo](){return this[Dp]||(this[Dp]=Array.from(this[Mo].toArray(),String))}[Symbol.iterator](){return new HU(this[Mo],this[$o])}get size(){return this[Mo].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Mo],e=this[$o],n={};for(let i=-1,s=t.length;++i`${Ko(t)}: ${Ko(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class HU{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),pn.visit(this.vals,t)]})}}class XU{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Eo]}has(t,e){return t[Eo].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Eo].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[Eo].indexOf(e);if(n!==-1){const i=pn.visit(Reflect.get(t,$o),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[Eo].indexOf(e);return i!==-1?(Kn.visit(Reflect.get(t,$o),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(ng.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Mo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[$o]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Dp]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let q0;function NI(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const BI=(r,t)=>r<0?t+r:r,Q0=r=>r!==r;function Zs(r){if(typeof r!=="object"||r===null)return Q0(r)?Q0:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?yT(r,e):!1:r instanceof Map?qU(r):Array.isArray(r)?YU(r):r instanceof lr?QU(r):ZU(r,!0)}function YU(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return KU(r,e);case Map:return Z0(r,e,e.keys());case ng:case rg:case Object:case void 0:return Z0(r,e,t||Object.keys(e))}return e instanceof lr?JU(r,e):!1}}function KU(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function e4(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):UI(new oh(e,r,t,null,ig)).subarray(0,n)),i}return e}function UI(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class oh{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return Tc(r,t,i)+Tc(r,n,e)+zI(r,i>>3,n-i>>3)}function zI(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Eu(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Eu(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Eu(s.getUint8(i)),i+=1;return n}function Eu(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 r4=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:oh,getBit:kI,getBool:ig,packBools:UI,popcnt_array:zI,popcnt_bit_range:Tc,popcnt_uint32:Eu,setBool:e4,truncateBitmap:Lp},Symbol.toStringTag,{value:"Module"})),n4=-1;class ml{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 Pt.isSparseUnion(t)?this.children.some(e=>e.nullable):Pt.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Pt.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=n4&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Tc(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof ml?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=$T(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(Pt.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===Zn.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Lp(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new ml(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===H.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(Lp(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[pi.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[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]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}}ml.prototype.children=Object.freeze([]);class K0{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function s4(r){return r.reduce((t,e)=>t+e.nullCount,0)}function o4(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function a4(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function sg(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function h4(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new oh(e,r.offset+(t||0),r.length,e,ig)){if(!i)return n;++n}return-1}function ee(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case H.Union:break;case H.Dictionary:break;default:return h4(r,e)}const n=pn.getVisitFn(r),i=Zs(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new K0(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new d4(o)})}class d4{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof ml)))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}=GI[o.typeId],c=s[0];this.isValid=h=>VI(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,WI[o.typeId]),this._offsets=o4(s);break}this.data=s,this.type=o,this.stride=$T(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return i4(this.data)}get nullCount(){return s4(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${H[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(BI(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return f4.visit(this)}concat(...t){return new lr(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new lr(NI(this,t,e,({data:n,_offsets:i},s,o)=>a4(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case H.Int:case H.Float:case H.Decimal:case H.Time:case H.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Pt.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Pt.isDictionary(this.type)){const t=new Ic(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new lr(e)}return new Ic(this)}unmemoize(){if(Pt.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new lr(e)}return this}}$I=Symbol.toStringTag;lr[$I]=(r=>{r.type=Pt.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(H).map(e=>H[e]).filter(e=>typeof e=="number"&&e!==H.NONE);for(const e of t){const n=pn.getVisitFnByTypeId(e),i=Kn.getVisitFnByTypeId(e),s=t_.getVisitFnByTypeId(e);GI[e]={get:n,set:i,indexOf:s},WI[e]=Object.create(r,{isValid:{value:J0(VI)},get:{value:J0(pn.getVisitFnByTypeId(e))},set:{value:l4(Kn.getVisitFnByTypeId(e))},indexOf:{value:u4(t_.getVisitFnByTypeId(e))}})}return"Vector"})(lr.prototype);class Ic extends lr{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Ic(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new lr(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const p4=65536;function Po(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const ta=8,og=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class ag{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Po(this.buffer[3])} ${Po(this.buffer[2])} ${Po(this.buffer[1])} ${Po(this.buffer[0])}`}static multiply(t,e){return new Dn(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Dn(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Dn.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Dn.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new Dn(e);for(let o=n?1:0;othis.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function Tr(r,t){return t instanceof r.constructor}function Ks(r,t){return r===t||Tr(r,t)}function Mi(r,t){return r===t||Tr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function ah(r,t){return r===t||Tr(r,t)&&r.precision===t.precision}function g4(r,t){return r===t||Tr(r,t)&&r.byteWidth===t.byteWidth}function lg(r,t){return r===t||Tr(r,t)&&r.unit===t.unit}function Ol(r,t){return r===t||Tr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function Pl(r,t){return r===t||Tr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function y4(r,t){return r===t||Tr(r,t)&&r.children.length===t.children.length&&Jn.compareManyFields(r.children,t.children)}function v4(r,t){return r===t||Tr(r,t)&&r.children.length===t.children.length&&Jn.compareManyFields(r.children,t.children)}function ug(r,t){return r===t||Tr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Jn.compareManyFields(r.children,t.children)}function _4(r,t){return r===t||Tr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Jn.visit(r.indices,t.indices)&&Jn.visit(r.dictionary,t.dictionary)}function cg(r,t){return r===t||Tr(r,t)&&r.unit===t.unit}function Rl(r,t){return r===t||Tr(r,t)&&r.unit===t.unit}function b4(r,t){return r===t||Tr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Jn.compareManyFields(r.children,t.children)}function x4(r,t){return r===t||Tr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Jn.compareManyFields(r.children,t.children)}jt.prototype.visitNull=Ks;jt.prototype.visitBool=Ks;jt.prototype.visitInt=Mi;jt.prototype.visitInt8=Mi;jt.prototype.visitInt16=Mi;jt.prototype.visitInt32=Mi;jt.prototype.visitInt64=Mi;jt.prototype.visitUint8=Mi;jt.prototype.visitUint16=Mi;jt.prototype.visitUint32=Mi;jt.prototype.visitUint64=Mi;jt.prototype.visitFloat=ah;jt.prototype.visitFloat16=ah;jt.prototype.visitFloat32=ah;jt.prototype.visitFloat64=ah;jt.prototype.visitUtf8=Ks;jt.prototype.visitLargeUtf8=Ks;jt.prototype.visitBinary=Ks;jt.prototype.visitLargeBinary=Ks;jt.prototype.visitFixedSizeBinary=g4;jt.prototype.visitDate=lg;jt.prototype.visitDateDay=lg;jt.prototype.visitDateMillisecond=lg;jt.prototype.visitTimestamp=Ol;jt.prototype.visitTimestampSecond=Ol;jt.prototype.visitTimestampMillisecond=Ol;jt.prototype.visitTimestampMicrosecond=Ol;jt.prototype.visitTimestampNanosecond=Ol;jt.prototype.visitTime=Pl;jt.prototype.visitTimeSecond=Pl;jt.prototype.visitTimeMillisecond=Pl;jt.prototype.visitTimeMicrosecond=Pl;jt.prototype.visitTimeNanosecond=Pl;jt.prototype.visitDecimal=Ks;jt.prototype.visitList=y4;jt.prototype.visitStruct=v4;jt.prototype.visitUnion=ug;jt.prototype.visitDenseUnion=ug;jt.prototype.visitSparseUnion=ug;jt.prototype.visitDictionary=_4;jt.prototype.visitInterval=cg;jt.prototype.visitIntervalDayTime=cg;jt.prototype.visitIntervalYearMonth=cg;jt.prototype.visitDuration=Rl;jt.prototype.visitDurationSecond=Rl;jt.prototype.visitDurationMillisecond=Rl;jt.prototype.visitDurationMicrosecond=Rl;jt.prototype.visitDurationNanosecond=Rl;jt.prototype.visitFixedSizeList=b4;jt.prototype.visitMap=x4;const Jn=new jt;function w4(r,t){return Jn.compareSchemas(r,t)}function S4(r,t){return Jn.compareFields(r,t)}function T4(r,t){return Jn.visit(r,t)}const e_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},tU),m4),r4),nU),qk),t4),Zk),{compareSchemas:w4,compareFields:S4,compareTypes:T4}),HI=6048e5,I4=864e5,r_=Symbol.for("constructDateFrom");function vi(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&r_ in r?r[r_](t):r instanceof Date?new r.constructor(t):new Date(t)}function mn(r,t){return vi(t||r,r)}let M4={};function lh(){return M4}function gl(r,t){var a,l,u,c;const e=lh(),n=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=mn(r,t==null?void 0:t.in),s=i.getDay(),o=(s=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function n_(r){const t=mn(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 E4(r,...t){const e=vi.bind(null,t.find(n=>typeof n=="object"));return t.map(e)}function i_(r,t){const e=mn(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function A4(r,t,e){const[n,i]=E4(e==null?void 0:e.in,r,t),s=i_(n),o=i_(i),a=+s-n_(s),l=+o-n_(o);return Math.round((a-l)/I4)}function C4(r,t){const e=XI(r,t),n=vi(r,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Mc(n)}function O4(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function P4(r){return!(!O4(r)&&typeof r!="number"||isNaN(+mn(r)))}function R4(r,t){const e=mn(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const F4={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"}},D4=(r,t,e)=>{let n;const i=F4[r];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function ef(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const L4={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},N4={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},B4={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},k4={date:ef({formats:L4,defaultWidth:"full"}),time:ef({formats:N4,defaultWidth:"full"}),dateTime:ef({formats:B4,defaultWidth:"full"})},U4={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},z4=(r,t,e,n)=>U4[r];function Aa(r){return(t,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let i;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;i=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;i=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return i[s]}}const V4={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},j4={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$4={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"]},G4={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"]},W4={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"}},H4={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"}},X4=(r,t)=>{const e=Number(r),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Y4={ordinalNumber:X4,era:Aa({values:V4,defaultWidth:"wide"}),quarter:Aa({values:j4,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Aa({values:$4,defaultWidth:"wide"}),day:Aa({values:G4,defaultWidth:"wide"}),dayPeriod:Aa({values:W4,defaultWidth:"wide",formattingValues:H4,defaultFormattingWidth:"wide"})};function Ca(r){return(t,e={})=>{const n=e.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?Q4(a,h=>h.test(o)):q4(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 q4(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function Q4(r,t){for(let e=0;e{const n=t.match(r.matchPattern);if(!n)return null;const i=n[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const K4=/^(\d+)(th|st|nd|rd)?/i,J4=/\d+/i,t6={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},e6={any:[/^b/i,/^(a|c)/i]},r6={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},n6={any:[/1/i,/2/i,/3/i,/4/i]},i6={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},s6={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]},o6={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},a6={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]},l6={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},u6={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}},c6={ordinalNumber:Z4({matchPattern:K4,parsePattern:J4,valueCallback:r=>parseInt(r,10)}),era:Ca({matchPatterns:t6,defaultMatchWidth:"wide",parsePatterns:e6,defaultParseWidth:"any"}),quarter:Ca({matchPatterns:r6,defaultMatchWidth:"wide",parsePatterns:n6,defaultParseWidth:"any",valueCallback:r=>r+1}),month:Ca({matchPatterns:i6,defaultMatchWidth:"wide",parsePatterns:s6,defaultParseWidth:"any"}),day:Ca({matchPatterns:o6,defaultMatchWidth:"wide",parsePatterns:a6,defaultParseWidth:"any"}),dayPeriod:Ca({matchPatterns:l6,defaultMatchWidth:"any",parsePatterns:u6,defaultParseWidth:"any"})},h6={code:"en-US",formatDistance:D4,formatLong:k4,formatRelative:z4,localize:Y4,match:c6,options:{weekStartsOn:0,firstWeekContainsDate:1}};function d6(r,t){const e=mn(r,t==null?void 0:t.in);return A4(e,R4(e))+1}function f6(r,t){const e=mn(r,t==null?void 0:t.in),n=+Mc(e)-+C4(e);return Math.round(n/HI)+1}function YI(r,t){var c,h,f,d;const e=mn(r,t==null?void 0:t.in),n=e.getFullYear(),i=lh(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((d=(f=i.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,o=vi((t==null?void 0:t.in)||r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const a=gl(o,t),l=vi((t==null?void 0:t.in)||r,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const u=gl(l,t);return+e>=+a?n+1:+e>=+u?n:n-1}function p6(r,t){var a,l,u,c;const e=lh(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=YI(r,t),s=vi((t==null?void 0:t.in)||r,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),gl(s,t)}function m6(r,t){const e=mn(r,t==null?void 0:t.in),n=+gl(e,t)-+p6(e,t);return Math.round(n/HI)+1}function Ie(r,t){const e=r<0?"-":"",n=Math.abs(r).toString().padStart(t,"0");return e+n}const Ri={y(r,t){const e=r.getFullYear(),n=e>0?e:1-e;return Ie(t==="yy"?n%100:n,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):Ie(e+1,2)},d(r,t){return Ie(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 Ie(r.getHours()%12||12,t.length)},H(r,t){return Ie(r.getHours(),t.length)},m(r,t){return Ie(r.getMinutes(),t.length)},s(r,t){return Ie(r.getSeconds(),t.length)},S(r,t){const e=t.length,n=r.getMilliseconds(),i=Math.trunc(n*Math.pow(10,e-3));return Ie(i,t.length)}},co={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},s_={G:function(r,t,e){const n=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const n=r.getFullYear(),i=n>0?n:1-n;return e.ordinalNumber(i,{unit:"year"})}return Ri.y(r,t)},Y:function(r,t,e,n){const i=YI(r,n),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return Ie(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Ie(s,t.length)},R:function(r,t){const e=XI(r);return Ie(e,t.length)},u:function(r,t){const e=r.getFullYear();return Ie(e,t.length)},Q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Ie(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Ie(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,t,e){const n=r.getMonth();switch(t){case"M":case"MM":return Ri.M(r,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(r,t,e){const n=r.getMonth();switch(t){case"L":return String(n+1);case"LL":return Ie(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(r,t,e,n){const i=m6(r,n);return t==="wo"?e.ordinalNumber(i,{unit:"week"}):Ie(i,t.length)},I:function(r,t,e){const n=f6(r);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):Ie(n,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):Ri.d(r,t)},D:function(r,t,e){const n=d6(r);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):Ie(n,t.length)},E:function(r,t,e){const n=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ie(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ie(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,e){const n=r.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return Ie(i,t.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(r,t,e){const i=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,e){const n=r.getHours();let i;switch(n===12?i=co.noon:n===0?i=co.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,e){const n=r.getHours();let i;switch(n>=17?i=co.evening:n>=12?i=co.afternoon:n>=4?i=co.morning:i=co.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let n=r.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return Ri.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):Ri.H(r,t)},K:function(r,t,e){const n=r.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):Ie(n,t.length)},k:function(r,t,e){let n=r.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):Ie(n,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):Ri.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):Ri.s(r,t)},S:function(r,t){return Ri.S(r,t)},X:function(r,t,e){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return a_(n);case"XXXX":case"XX":return Is(n);case"XXXXX":case"XXX":default:return Is(n,":")}},x:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"x":return a_(n);case"xxxx":case"xx":return Is(n);case"xxxxx":case"xxx":default:return Is(n,":")}},O:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+o_(n,":");case"OOOO":default:return"GMT"+Is(n,":")}},z:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+o_(n,":");case"zzzz":default:return"GMT"+Is(n,":")}},t:function(r,t,e){const n=Math.trunc(+r/1e3);return Ie(n,t.length)},T:function(r,t,e){return Ie(+r,t.length)}};function o_(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Math.trunc(n/60),s=n%60;return s===0?e+String(i):e+String(i)+t+Ie(s,2)}function a_(r,t){return r%60===0?(r>0?"-":"+")+Ie(Math.abs(r)/60,2):Is(r,t)}function Is(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Ie(Math.trunc(n/60),2),s=Ie(n%60,2);return e+i+t+s}const l_=(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"})}},qI=(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"})}},g6=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],n=e[1],i=e[2];if(!i)return l_(r,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",l_(n,t)).replace("{{time}}",qI(i,t))},y6={p:qI,P:g6},v6=/^D+$/,_6=/^Y+$/,b6=["D","DD","YY","YYYY"];function x6(r){return v6.test(r)}function w6(r){return _6.test(r)}function S6(r,t,e){const n=T6(r,t,e);if(console.warn(n),b6.includes(r))throw new RangeError(n)}function T6(r,t,e){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const I6=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,M6=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,E6=/^'([^]*?)'?$/,A6=/''/g,C6=/[a-zA-Z]/;function QI(r,t,e){var c,h,f,d;const n=lh(),i=n.locale??h6,s=n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,a=mn(r,e==null?void 0:e.in);if(!P4(a))throw new RangeError("Invalid time value");let l=t.match(M6).map(m=>{const g=m[0];if(g==="p"||g==="P"){const p=y6[g];return p(m,i.formatLong)}return m}).join("").match(I6).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const g=m[0];if(g==="'")return{isToken:!1,value:O6(m)};if(s_[g])return{isToken:!0,value:m};if(g.match(C6))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(m=>{if(!m.isToken)return m.value;const g=m.value;(w6(g)||x6(g))&&S6(g,t,String(r));const p=s_[g[0]];return p(a,g,i.localize,u)}).join("")}function O6(r){const t=r.match(E6);return t?t[1].replace(A6,"'"):r}function P6(r,t){return mn(r*1e3,t==null?void 0:t.in)}function R6(r,t){const e=F6(t)?new t(0):vi(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function F6(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function D6(r,t){let e=r.length;switch("string"){case"string":{for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function Rr(r){return r==null}function L6(r){return r!=null}async function ZI(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await Bi(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function N6(r){return Rr(r)?!1:Pt.isInt(r.type)&&!KI(r)||B6(r)}function B6(r){return Rr(r)?!1:Pt.isInt(r.type)&&r.type.isSigned===!1}function k6(r){return Rr(r)?!1:Pt.isFloat(r.type)??!1}function U6(r){return Rr(r)?!1:Pt.isDecimal(r.type)}function z6(r){return Rr(r)?!1:Pt.isBool(r.type)}function V6(r){return Rr(r)?!1:Pt.isDuration(r.type)}function KI(r){return Rr(r)?!1:Pt.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function j6(r){return Rr(r)?!1:Pt.isTimestamp(r.type)}function $6(r){return Rr(r)?!1:Pt.isDate(r.type)}function G6(r){return Rr(r)?!1:Pt.isTime(r.type)}function W6(r){return Rr(r)?!1:Pt.isList(r.type)||Pt.isFixedSizeList(r.type)}function H6(r){return Rr(r)?!1:Pt.isStruct(r.type)||Pt.isMap(r.type)}function X6(r){return Rr(r)?!1:Pt.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Pt.isInterval(r.type)}function Y6(r,t){let e;if(t===ne.MILLISECOND)e=1e3;else if(t===ne.MICROSECOND)e=1e3*1e3;else if(t===ne.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 q6(r,t){var n;const e=Y6(r,((n=t==null?void 0:t.type)==null?void 0:n.unit)??ne.SECOND);return P6(e)}function Q6(r,t){const e=q6(r,t);return QI(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function Z6(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?QI(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function K6(r,t){var i;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const n=(i=t==null?void 0:t.type)==null?void 0:i.timezone;return typeof r=="number"?n?e=new Vr(r,n):e=new Vr(r):n?e=new Vr(r,n):e=new Vr(r),R6(e,Date)}function J6(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let n=e_.bigNumToString(new e_.BN(r)).padStart(e,"0");if(e===0)return n;let i="";n.startsWith("-")&&(i="-",n=n.slice(1));const s=n.slice(0,-e)||"0",o=D6(n.slice(-e),"0")||"";return`${i}${s}${o?`.${o}`:""}`}function t5(r){const t=r[0],e=r[1],n=[];return t!==0&&n.push(`${t} year${t>1?"s":""}`),e!==0&&n.push(`${e} month${e>1?"s":""}`),n.length?n.join(" "):"0 months"}function e5(r,t){var n,i,s,o;if(Pt.isInterval(t==null?void 0:t.type))return t5(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",f=Np(u.left,(i=(n=t.type)==null?void 0:n.children)==null?void 0:i[0]),d=Np(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+f}, ${d+h}`}return String(r)}function r5(r,t){return(t==null?void 0:t.type)instanceof Fp?JSON.parse(JSON.stringify(r,(e,n)=>{if(L6(n))return typeof n=="bigint"?Number(n):n})):JSON.parse(JSON.stringify(r,(e,n)=>typeof n=="bigint"?Number(n):n))}function Np(r,t){if(Rr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&$6(t))return Z6(r);if(typeof r=="bigint"&&G6(t))return Q6(Number(r),t);if(e&&j6(t))return K6(r,t);if(KI(t))throw new Error("Period type is not supported yet");if(X6(t))return e5(r,t);if(V6(t))throw new Error("Duration type is not supported yet");return U6(t)?J6(r,t):k6(t)&&Number.isFinite(r)||N6(t)?r:H6(t)||W6(t)?r5(r,t):z6(t)?!!r:String(r)}function u_(r){return((r.toArray()||[]).map(n=>n.toJSON())||[]).map(n=>(r.schema.fields.forEach(i=>n[i.name]=Np(n[i.name],i)),n))}var yl=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(yl||{});async function JI(r){const t=nE(r,{logger:!1});let e,n;const i=await ZI();if(i==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await Bi(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}n=await I0(await t.bundles),e=new Worker(n.mainWorker)}else if(i==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await Bi(async()=>{const{getBundles:h}=await import("./default-node-CKggh1Nm.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}n=await I0(await t.bundles);let l=n.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await Bi(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${i}`);let s;t.logger===!0?s=new dT:t.logger===!1?s=new WB:s=t.logger;const o=new KB(s,e);if(await o.instantiate(n.mainModule,n.pthreadWorker),t.storage)switch(t.storage.type){case yl.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 yl.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(l){throw await o.terminate(),await e.terminate(),l}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(l,u=[])=>{if(!u||u.length===0){const d=await a.query(l);return u_(d)}const c=await a.prepare(l),h=await c.query(...u),f=u_(h);return c.close(),f},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function n5(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 i5(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const n=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),n}catch(n){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const It=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,It))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(It in e&&e[It]===t[It])return!0;e=Object.getPrototypeOf(e)}return!1}var b_;b_=It;class ur{constructor(t,e){W(this,"name");W(this,"keyAsName");W(this,"primary");W(this,"notNull");W(this,"default");W(this,"defaultFn");W(this,"onUpdateFn");W(this,"hasDefault");W(this,"isUnique");W(this,"uniqueName");W(this,"uniqueType");W(this,"dataType");W(this,"columnType");W(this,"enumValues");W(this,"generated");W(this,"generatedIdentity");W(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}W(ur,b_,"Column");const Go=Symbol.for("drizzle:Name");function s5(r,t){return`${r[Go]}_${t.join("_")}_unique`}var x_,w_;class $r extends(w_=ur,x_=It,w_){constructor(t,e){e.uniqueName||(e.uniqueName=s5(t,[e.name])),super(t,e),this.table=t}}W($r,x_,"PgColumn");const c_=Symbol.for("drizzle:isPgEnum");function o5(r){return!!r&&typeof r=="function"&&c_ in r&&r[c_]===!0}var S_;S_=It;class Gr{constructor(t,e,n,i=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:n,isWith:i}}}W(Gr,S_,"Subquery");var T_,I_;class hg extends(I_=Gr,T_=It,I_){}W(hg,T_,"WithSubquery");const Hr={startActiveSpan(r,t){return t()}},er=Symbol.for("drizzle:ViewBaseConfig"),Au=Symbol.for("drizzle:Schema"),Bp=Symbol.for("drizzle:Columns"),h_=Symbol.for("drizzle:ExtraConfigColumns"),rf=Symbol.for("drizzle:OriginalName"),nf=Symbol.for("drizzle:BaseName"),Ec=Symbol.for("drizzle:IsAlias"),d_=Symbol.for("drizzle:ExtraConfigBuilder"),a5=Symbol.for("drizzle:IsDrizzleTable");var M_,E_,A_,C_,O_,P_,R_,F_,D_,L_;L_=It,D_=Go,F_=rf,R_=Au,P_=Bp,O_=h_,C_=nf,A_=Ec,E_=a5,M_=d_;class Mt{constructor(t,e,n){W(this,D_);W(this,F_);W(this,R_);W(this,P_);W(this,O_);W(this,C_);W(this,A_,!1);W(this,E_,!0);W(this,M_);this[Go]=this[rf]=t,this[Au]=e,this[nf]=n}}W(Mt,L_,"Table"),W(Mt,"Symbol",{Name:Go,Schema:Au,OriginalName:rf,Columns:Bp,ExtraConfigColumns:h_,BaseName:nf,IsAlias:Ec,ExtraConfigBuilder:d_});function Rs(r){return r[Go]}function vl(r){return`${r[Au]??"public"}.${r[Go]}`}function tM(r){return r!=null&&typeof r.getSQL=="function"}function l5(r){var e;const t={sql:"",params:[]};for(const n of r)t.sql+=n.sql,t.params.push(...n.params),(e=n.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var N_;N_=It;class nr{constructor(t){W(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ft([this])}}W(nr,N_,"StringChunk");var B_;B_=It;const As=class As{constructor(t){W(this,"decoder",eM);W(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Hr.startActiveSpan("drizzle.buildSQL",e=>{const n=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,e){const n=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:i,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=n;return l5(t.map(c=>{var h;if(lt(c,nr))return{sql:c.value.join(""),params:[]};if(lt(c,Ac))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const f=[new nr("(")];for(const[d,m]of c.entries())f.push(m),dr},rM={mapToDriverValue:r=>r};({...eM,...rM});var U_;U_=It;class _i{constructor(t,e=rM){W(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ft([this])}}W(_i,U_,"Param");function Y(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new nr(r[0]));for(const[n,i]of t.entries())e.push(i,new nr(r[n+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 n(l){return new Ft([new nr(l)])}r.raw=n;function i(l,u){const c=[];for(const[h,f]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(f);return new Ft(c)}r.join=i;function s(l){return new Ac(l)}r.identifier=s;function o(l){return new $s(l)}r.placeholder=o;function a(l,u){return new _i(l,u)}r.param=a})(Y||(Y={}));(r=>{var e;e=It;const n=class n{constructor(s,o){W(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}};W(n,e,"SQL.Aliased");let t=n;r.Aliased=t})(Ft||(Ft={}));var z_;z_=It;class $s{constructor(t){this.name=t}getSQL(){return new Ft([this])}}W($s,z_,"Placeholder");function f_(r,t){return r.map(e=>{if(lt(e,$s)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,_i)&<(e.value,$s)){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 c5=Symbol.for("drizzle:IsDrizzleView");var V_,j_,$_;$_=It,j_=er,V_=c5;class rs{constructor({name:t,schema:e,selectedFields:n,query:i}){W(this,j_);W(this,V_,!0);this[er]={name:t,originalName:t,schema:e,selectedFields:n,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new Ft([this])}}W(rs,$_,"View");ur.prototype.getSQL=function(){return new Ft([this])};Mt.prototype.getSQL=function(){return new Ft([this])};Gr.prototype.getSQL=function(){return new Ft([this])};var G_;G_=It;class _l{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}W(_l,G_,"ColumnAliasProxyHandler");var W_;W_=It;class uh{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===Mt.Symbol.IsAlias)return!0;if(e===Mt.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===Mt.Symbol.OriginalName)return this.alias;if(e===er)return{...t[er],name:this.alias,isAlias:!0};if(e===Mt.Symbol.Columns){const i=t[Mt.Symbol.Columns];if(!i)return i;const s={};return Object.keys(i).map(o=>{s[o]=new Proxy(i[o],new _l(new Proxy(t,this)))}),s}const n=t[e];return lt(n,ur)?new Proxy(n,new _l(new Proxy(t,this))):n}}W(uh,W_,"TableAliasProxyHandler");function sf(r,t){return new Proxy(r,new uh(t,!1))}function ci(r,t){return new Proxy(r,new _l(new Proxy(r.table,new uh(t,!1))))}function nM(r,t){return new Ft.Aliased(Cc(r.sql,t),r.fieldAlias)}function Cc(r,t){return Y.join(r.queryChunks.map(e=>lt(e,ur)?ci(e,t):lt(e,Ft)?Cc(e,t):lt(e,Ft.Aliased)?nM(e,t):e))}var H_,X_;class dg extends(X_=Error,H_=It,X_){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}W(dg,H_,"DrizzleError");var Y_,q_;class iM extends(q_=dg,Y_=It,q_){constructor(){super({message:"Rollback"})}}W(iM,Y_,"TransactionRollbackError");function Pr(r,t){return u5(t)&&!tM(r)&&!lt(r,_i)&&!lt(r,$s)&&!lt(r,ur)&&!lt(r,Mt)&&!lt(r,rs)?new _i(r,t):r}const sM=(r,t)=>Y`${r} = ${Pr(t,r)}`,h5=(r,t)=>Y`${r} <> ${Pr(t,r)}`;function kp(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new nr("("),Y.join(t,new nr(" and ")),new nr(")")])}function d5(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new nr("("),Y.join(t,new nr(" or ")),new nr(")")])}function f5(r){return Y`not ${r}`}const p5=(r,t)=>Y`${r} > ${Pr(t,r)}`,m5=(r,t)=>Y`${r} >= ${Pr(t,r)}`,g5=(r,t)=>Y`${r} < ${Pr(t,r)}`,y5=(r,t)=>Y`${r} <= ${Pr(t,r)}`;function v5(r,t){return Array.isArray(t)?t.length===0?Y`false`:Y`${r} in ${t.map(e=>Pr(e,r))}`:Y`${r} in ${Pr(t,r)}`}function _5(r,t){return Array.isArray(t)?t.length===0?Y`true`:Y`${r} not in ${t.map(e=>Pr(e,r))}`:Y`${r} not in ${Pr(t,r)}`}function b5(r){return Y`${r} is null`}function x5(r){return Y`${r} is not null`}function w5(r){return Y`exists ${r}`}function S5(r){return Y`not exists ${r}`}function T5(r,t,e){return Y`${r} between ${Pr(t,r)} and ${Pr(e,r)}`}function I5(r,t,e){return Y`${r} not between ${Pr(t,r)} and ${Pr(e,r)}`}function M5(r,t){return Y`${r} like ${t}`}function E5(r,t){return Y`${r} not like ${t}`}function A5(r,t){return Y`${r} ilike ${t}`}function C5(r,t){return Y`${r} not ilike ${t}`}function O5(r){return Y`${r} asc`}function P5(r){return Y`${r} desc`}var Q_;Q_=It;class oM{write(t){console.log(t)}}W(oM,Q_,"ConsoleLogWriter");var Z_;Z_=It;class aM{constructor(t){W(this,"writer");this.writer=(t==null?void 0:t.writer)??new oM}logQuery(t,e){const n=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),i=n.length?` -- params: [${n.join(", ")}]`:"";this.writer.write(`Query: ${t}${i}`)}}W(aM,Z_,"DefaultLogger");var K_;K_=It;class lM{logQuery(){}}W(lM,K_,"NoopLogger");var J_,tb;tb=It,J_=Symbol.toStringTag;class ns{constructor(){W(this,J_,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}W(ns,tb,"QueryPromise");function Gs(r,t){return Object.entries(r).reduce((e,[n,i])=>{if(typeof n!="string")return e;const s=t?[...t,n]:[n];return lt(i,ur)||lt(i,Ft)||lt(i,Ft.Aliased)?e.push({path:s,field:i}):lt(i,Mt)?e.push(...Gs(i[Mt.Symbol.Columns],s)):e.push(...Gs(i,s)),e},[])}function fg(r,t){const e=Object.keys(r),n=Object.keys(t);if(e.length!==n.length)return!1;for(const[i,s]of e.entries())if(s!==n[i])return!1;return!0}function uM(r,t){const e=Object.entries(t).filter(([,n])=>n!==void 0).map(([n,i])=>lt(i,Ft)||lt(i,ur)?[n,i]:[n,new _i(i,r[Mt.Symbol.Columns][n])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function R5(r,t){for(const e of t)for(const n of Object.getOwnPropertyNames(e.prototype))n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n)||Object.create(null))}function F5(r){return r[Mt.Symbol.Columns]}function Es(r){return lt(r,Gr)?r._.alias:lt(r,rs)?r[er].name:lt(r,Ft)?void 0:r[Mt.Symbol.IsAlias]?r[Mt.Symbol.Name]:r[Mt.Symbol.BaseName]}function D5(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.logger;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.logger;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 eb,rb;class cM extends(rb=$r,eb=It,rb){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}W(cM,eb,"PgDate");var nb,ib;class hM extends(ib=$r,nb=It,ib){getSQLType(){return"date"}}W(hM,nb,"PgDateString");var sb,ob;class dM extends(ob=$r,sb=It,ob){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(dM,sb,"PgJson");var ab,lb;class fM extends(lb=$r,ab=It,lb){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(fM,ab,"PgJsonb");var ub,cb;class pM extends(cb=$r,ub=It,cb){constructor(e,n){super(e,n);W(this,"precision");W(this,"scale");this.precision=n.precision,this.scale=n.scale}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}W(pM,ub,"PgNumeric");var hb,db;class mM extends(db=$r,hb=It,db){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(mM,hb,"PgTime");var fb,pb;class gM extends(pb=$r,fb=It,pb){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");W(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));W(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(gM,fb,"PgTimestamp");var mb,gb;class yM extends(gb=$r,mb=It,gb){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(yM,mb,"PgTimestampString");var yb,vb;class vM extends(vb=$r,yb=It,vb){getSQLType(){return"uuid"}}W(vM,yb,"PgUUID");const p_=Symbol.for("drizzle:PgInlineForeignKeys"),m_=Symbol.for("drizzle:EnableRLS");var _b,bb,xb,wb,Sb,Tb;class en extends(Tb=Mt,Sb=It,wb=p_,xb=m_,bb=Mt.Symbol.ExtraConfigBuilder,_b=Mt.Symbol.ExtraConfigColumns,Tb){constructor(){super(...arguments);W(this,wb,[]);W(this,xb,!1);W(this,bb);W(this,_b,{})}}W(en,Sb,"PgTable"),W(en,"Symbol",Object.assign({},Mt.Symbol,{InlineForeignKeys:p_,EnableRLS:m_}));var Ib;Ib=It;class _M{constructor(t,e){W(this,"columns");W(this,"name");this.columns=t,this.name=e}build(t){return new bM(t,this.columns,this.name)}}W(_M,Ib,"PgPrimaryKeyBuilder");var Mb;Mb=It;class bM{constructor(t,e,n){W(this,"columns");W(this,"name");this.table=t,this.columns=e,this.name=n}getName(){return this.name??`${this.table[en.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}W(bM,Mb,"PgPrimaryKey");var Eb;Eb=It;class pg{constructor(t,e,n){W(this,"referencedTableName");W(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=n,this.referencedTableName=e[Mt.Symbol.Name]}}W(pg,Eb,"Relation");var Ab;Ab=It;class xM{constructor(t,e){this.table=t,this.config=e}}W(xM,Ab,"Relations");var Cb,Ob;const Rc=class Rc extends(Ob=pg,Cb=It,Ob){constructor(t,e,n,i){super(t,e,n==null?void 0:n.relationName),this.config=n,this.isNullable=i}withFieldName(t){const e=new Rc(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};W(Rc,Cb,"One");let Ws=Rc;var Pb,Rb;const Fc=class Fc extends(Rb=pg,Pb=It,Rb){constructor(t,e,n){super(t,e,n==null?void 0:n.relationName),this.config=n}withFieldName(t){const e=new Fc(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};W(Fc,Pb,"Many");let Oc=Fc;function L5(){return{and:kp,between:T5,eq:sM,exists:w5,gt:p5,gte:m5,ilike:A5,inArray:v5,isNull:b5,isNotNull:x5,like:M5,lt:g5,lte:y5,ne:h5,not:f5,notBetween:I5,notExists:S5,notLike:E5,notIlike:C5,notInArray:_5,or:d5,sql:Y}}function N5(){return{sql:Y,asc:O5,desc:P5}}function B5(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,Mt)&&(r=r.default);const e={},n={},i={};for(const[o,a]of Object.entries(r))if(lt(a,Mt)){const l=vl(a),u=n[l];e[l]=o,i[o]={tsName:o,dbName:a[Mt.Symbol.Name],schema:a[Mt.Symbol.Schema],columns:a[Mt.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[Mt.Symbol.Columns]))h.primary&&i[o].primaryKey.push(h);const c=(s=a[Mt.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[Mt.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,_M)&&i[o].primaryKey.push(...h.columns)}else if(lt(a,xM)){const l=vl(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[f,d]of Object.entries(c))if(u){const m=i[u];m.relations[f]=d}else l in n||(n[l]={relations:{},primaryKey:h}),n[l].relations[f]=d}return{tables:i,tableNamesMap:e}}function k5(r){return function(e,n){return new Ws(r,e,n,(n==null?void 0:n.fields.reduce((i,s)=>i&&s.notNull,!0))??!1)}}function U5(r){return function(e,n){return new Oc(r,e,n)}}function z5(r,t,e){if(lt(e,Ws)&&e.config)return{fields:e.config.fields,references:e.config.references};const n=t[vl(e.referencedTable)];if(!n)throw new Error(`Table "${e.referencedTable[Mt.Symbol.Name]}" not found in schema`);const i=r[n];if(!i)throw new Error(`Table "${n}" not found in schema`);const s=e.sourceTable,o=t[vl(s)];if(!o)throw new Error(`Table "${s[Mt.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(i.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${n}"`):new Error(`There are multiple relations between "${n}" and "${e.sourceTable[Mt.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],Ws)&&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 V5(r){return{one:k5(r),many:U5(r)}}function Up(r,t,e,n,i=s=>s){const s={};for(const[o,a]of n.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=lt(l,Ws)?c&&Up(r,r[a.relationTableTsKey],c,a.selection,i):c.map(h=>Up(r,r[a.relationTableTsKey],h,a.selection,i))}else{const l=i(e[o]),u=a.field;let c;lt(u,ur)?c=u:lt(u,Ft)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var Fb;Fb=It;const Dc=class Dc{constructor(t){W(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===er)return{...t[er],selectedFields:new Proxy(t[er].selectedFields,this)};if(typeof e=="symbol")return t[e];const i=(lt(t,Gr)?t._.selectedFields:lt(t,rs)?t[er].selectedFields:t)[e];if(lt(i,Ft.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!i.isSelectionField)return i.sql;const s=i.clone();return s.isSelectionField=!0,s}if(lt(i,Ft)){if(this.config.sqlBehavior==="sql")return i;throw new Error(`You tried to reference "${e}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return lt(i,ur)?this.config.alias?new Proxy(i,new _l(new Proxy(i.table,new uh(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!="object"||i===null?i:new Proxy(i,new Dc(this.config))}};W(Dc,Fb,"SelectionProxyHandler");let pr=Dc;var Db,Lb;class zp extends(Lb=ns,Db=It,Lb){constructor(e,n,i,s){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[Mt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Gs(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Hr.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 pr({alias:Rs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(zp,Db,"PgDelete");function j5(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function $5(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,n,i)=>{const s=i===0?n.toLowerCase():`${n[0].toUpperCase()}${n.slice(1)}`;return e+s},"")}function G5(r){return r}var Nb;Nb=It;class wM{constructor(t){W(this,"cache",{});W(this,"cachedTables",{});W(this,"convert");this.convert=t==="snake_case"?j5:t==="camelCase"?$5:G5}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[Mt.Symbol.Schema]??"public",n=t.table[Mt.Symbol.OriginalName],i=`${e}.${n}.${t.name}`;return this.cache[i]||this.cacheTable(t.table),this.cache[i]}cacheTable(t){const e=t[Mt.Symbol.Schema]??"public",n=t[Mt.Symbol.OriginalName],i=`${e}.${n}`;if(!this.cachedTables[i]){for(const s of Object.values(t[Mt.Symbol.Columns])){const o=`${i}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[i]=!0}}clearCache(){this.cache={},this.cachedTables={}}}W(wM,Nb,"CasingCache");var Bb,kb;class mg extends(kb=rs,Bb=It,kb){}W(mg,Bb,"PgViewBase");var Ub;Ub=It;class Qa{constructor(t){W(this,"casing");this.casing=new wM(t==null?void 0:t.casing)}async migrate(t,e,n){const i=typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",s=typeof n=="string"?"drizzle":n.migrationsSchema??"drizzle",o=Y` +]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new Ts(e,n.map(i=>new Er(e,i)))}slice(t,e){const n=this.schema;[t,e]=LS({length:this.numRows},t,e);const i=US(this.data,this._offsets,t,e);return new Ts(n,i.map(s=>new Er(n,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&tn.children[t]);if(e.length===0){const{type:n}=this.schema.fields[t],i=he({type:n,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new ze(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[n,i]=Hd(n,a)}return new Ts(n,i)}select(t){const e=this.schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new Ts(e,n)}assign(t){const e=this.schema.fields,[n,i]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,f=e.findIndex(d=>d.name===l.name);return~f?h[f]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,i[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new Ts(...Hd(s,o))}};qS=Symbol.toStringTag;qi[qS]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=gc(Lm),r.get=gc(Or.getVisitFn(z.Struct)),r.set=zS(fn.getVisitFn(z.Struct)),r.indexOf=VS(yc.getVisitFn(z.Struct)),"Table"))(qi.prototype);var QS;let Er=class $a{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Ue))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=he({nullCount:0,type:new br(this.schema.fields),children:this.schema.fields.map(e=>he({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Pe))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=g0(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:i,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Le.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Ue(n),a=he({type:new br(n),length:s,children:i,nullCount:0});[this.schema,this.data]=g0(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=ZS(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 Or.visit(this.data,t)}at(t){return this.get(Rm(t,this.numRows))}set(t,e){return fn.visit(this.data,t,e)}indexOf(t,e){return yc.visit(this.data,t,e)}[Symbol.iterator](){return Nm.visit(new ze([this.data]))}toArray(){return[...this]}concat(...t){return new qi(this.schema,[this,...t])}slice(t,e){const[n]=new ze([this.data]).slice(t,e).data;return new $a(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&ti.name===t),e)}setChildAt(t,e){let n=this.schema,i=this.data;if(t>-1&&ta.name===s);~o&&(i[o]=this.data.children[o])}return new $a(e,he({type:n,length:this.numRows,children:i}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),i=he({type:new br(e.fields),length:this.numRows,children:n});return new $a(e,i)}};QS=Symbol.toStringTag;Er[QS]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Er.prototype);function g0(r,t,e=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;const i=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(i[a]=l.clone({nullable:!0}),s[a]=(n=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:he({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(i),he({type:new br(i),length:e,children:s})]}function ZS(r,t,e=new Map){var n,i;if(((n=r==null?void 0:r.length)!==null&&n!==void 0?n:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++she({type:i.type})),n=he({type:new br(t.fields),nullCount:0,children:e});super(t,n)}}let Pi=class Pn{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 Pn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+Se),(e||new Pn).__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):He.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):ve.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new tr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,He.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,ve.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,n,i,s,o){return Pn.startMessage(t),Pn.addVersion(t,e),Pn.addHeaderType(t,n),Pn.addHeader(t,i),Pn.addBodyLength(t,s),Pn.addCustomMetadata(t,o),Pn.endMessage(t)}};class H3 extends le{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return o0.startNull(e),o0.endNull(e)}visitInt(t,e){return Br.startInt(e),Br.addBitWidth(e,t.bitWidth),Br.addIsSigned(e,t.isSigned),Br.endInt(e)}visitFloat(t,e){return Vn.startFloatingPoint(e),Vn.addPrecision(e,t.precision),Vn.endFloatingPoint(e)}visitBinary(t,e){return e0.startBinary(e),e0.endBinary(e)}visitLargeBinary(t,e){return n0.startLargeBinary(e),n0.endLargeBinary(e)}visitBool(t,e){return r0.startBool(e),r0.endBool(e)}visitUtf8(t,e){return a0.startUtf8(e),a0.endUtf8(e)}visitLargeUtf8(t,e){return i0.startLargeUtf8(e),i0.endLargeUtf8(e)}visitDecimal(t,e){return yo.startDecimal(e),yo.addScale(e,t.scale),yo.addPrecision(e,t.precision),yo.addBitWidth(e,t.bitWidth),yo.endDecimal(e)}visitDate(t,e){return yu.startDate(e),yu.addUnit(e,t.unit),yu.endDate(e)}visitTime(t,e){return on.startTime(e),on.addUnit(e,t.unit),on.addBitWidth(e,t.bitWidth),on.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0;return an.startTimestamp(e),an.addUnit(e,t.unit),n!==void 0&&an.addTimezone(e,n),an.endTimestamp(e)}visitInterval(t,e){return jn.startInterval(e),jn.addUnit(e,t.unit),jn.endInterval(e)}visitDuration(t,e){return vu.startDuration(e),vu.addUnit(e,t.unit),vu.endDuration(e)}visitList(t,e){return s0.startList(e),s0.endList(e)}visitStruct(t,e){return Ps.startStruct_(e),Ps.endStruct_(e)}visitUnion(t,e){Mr.startTypeIdsVector(e,t.typeIds.length);const n=Mr.createTypeIdsVector(e,t.typeIds);return Mr.startUnion(e),Mr.addMode(e,t.mode),Mr.addTypeIds(e,n),Mr.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return gi.startDictionaryEncoding(e),gi.addId(e,BigInt(t.id)),gi.addIsOrdered(e,t.isOrdered),n!==void 0&&gi.addIndexType(e,n),gi.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return _u.startFixedSizeBinary(e),_u.addByteWidth(e,t.byteWidth),_u.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return bu.startFixedSizeList(e),bu.addListSize(e,t.listSize),bu.endFixedSizeList(e)}visitMap(t,e){return xu.startMap(e),xu.addKeysSorted(e,t.keysSorted),xu.endMap(e)}}const Xd=new H3;function X3(r,t=new Map){return new Ue(q3(r,t),Tu(r.metadata),t)}function KS(r){return new Wr(r.count,JS(r.columns),tT(r.columns))}function Y3(r){return new Qn(KS(r.data),r.id,r.isDelta)}function q3(r,t){return(r.fields||[]).filter(Boolean).map(e=>Le.fromJSON(e,t))}function y0(r,t){return(r.children||[]).filter(Boolean).map(e=>Le.fromJSON(e,t))}function JS(r){return(r||[]).reduce((t,e)=>[...t,new Qi(e.count,Q3(e.VALIDITY)),...JS(e.children)],[])}function tT(r,t=[]){for(let e=-1,n=(r||[]).length;++et+ +(e===0),0)}function Z3(r,t){let e,n,i,s,o,a;return!t||!(s=r.dictionary)?(o=_0(r,y0(r,t)),i=new Le(r.name,o,r.nullable,Tu(r.metadata))):t.has(e=s.id)?(n=(n=s.indexType)?v0(n):new hl,a=new qo(t.get(e),n,e,s.isOrdered),i=new Le(r.name,a,r.nullable,Tu(r.metadata))):(n=(n=s.indexType)?v0(n):new hl,t.set(e,o=_0(r,y0(r,t))),a=new qo(o,n,e,s.isOrdered),i=new Le(r.name,a,r.nullable,Tu(r.metadata))),i||null}function Tu(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function v0(r){return new Vs(r.isSigned,r.bitWidth)}function _0(r,t){const e=r.type.name;switch(e){case"NONE":return new Hi;case"null":return new Hi;case"binary":return new Ku;case"largebinary":return new Ju;case"utf8":return new tc;case"largeutf8":return new ec;case"bool":return new rc;case"list":return new uc((t||[])[0]);case"struct":return new br(t||[]);case"struct_":return new br(t||[])}switch(e){case"int":{const n=r.type;return new Vs(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=r.type;return new Zu(mr[n.precision])}case"decimal":{const n=r.type;return new nc(n.scale,n.precision,n.bitWidth)}case"date":{const n=r.type;return new ic(dn[n.unit])}case"time":{const n=r.type;return new sc($t[n.unit],n.bitWidth)}case"timestamp":{const n=r.type;return new oc($t[n.unit],n.timezone)}case"interval":{const n=r.type;return new ac(qn[n.unit])}case"duration":{const n=r.type;return new lc($t[n.unit])}case"union":{const n=r.type,[i,...s]=(n.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new cc(gr[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=r.type;return new hc(n.byteWidth)}case"fixedsizelist":{const n=r.type;return new dc(n.listSize,(t||[])[0])}case"map":{const n=r.type;return new fc((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var K3=p1,J3=Xo;class xr{static fromJSON(t,e){const n=new xr(0,He.V5,e);return n._createHeader=tB(t,e),n}static decode(t){t=new J3(fe(t));const e=Pi.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),s=e.headerType(),o=new xr(n,i,s);return o._createHeader=eB(e,s),o}static encode(t){const e=new K3;let n=-1;return t.isSchema()?n=Ue.encode(e,t.header()):t.isRecordBatch()?n=Wr.encode(e,t.header()):t.isDictionaryBatch()&&(n=Qn.encode(e,t.header())),Pi.startMessage(e),Pi.addVersion(e,He.V5),Pi.addHeader(e,n),Pi.addHeaderType(e,t.headerType),Pi.addBodyLength(e,BigInt(t.bodyLength)),Pi.finishMessageBuffer(e,Pi.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Ue)return new xr(0,He.V5,ve.Schema,t);if(t instanceof Wr)return new xr(e,He.V5,ve.RecordBatch,t);if(t instanceof Qn)return new xr(e,He.V5,ve.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===ve.Schema}isRecordBatch(){return this.headerType===ve.RecordBatch}isDictionaryBatch(){return this.headerType===ve.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Ae(t)}}class Wr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=Ae(t)}}class Qn{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,n=!1){this._data=t,this._isDelta=n,this._id=Ae(e)}}class Gn{constructor(t,e){this.offset=Ae(t),this.length=Ae(e)}}class Qi{constructor(t,e){this.length=Ae(t),this.nullCount=Ae(e)}}function tB(r,t){return()=>{switch(t){case ve.Schema:return Ue.fromJSON(r);case ve.RecordBatch:return Wr.fromJSON(r);case ve.DictionaryBatch:return Qn.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${ve[t]}, type: ${t} }`)}}function eB(r,t){return()=>{switch(t){case ve.Schema:return Ue.decode(r.header(new Fn),new Map,r.version());case ve.RecordBatch:return Wr.decode(r.header(new hi),r.version());case ve.DictionaryBatch:return Qn.decode(r.header(new mo),r.version())}throw new Error(`Unrecognized Message type: { name: ${ve[t]}, type: ${t} }`)}}Le.encode=dB;Le.decode=cB;Le.fromJSON=Z3;Ue.encode=hB;Ue.decode=rB;Ue.fromJSON=X3;Wr.encode=fB;Wr.decode=nB;Wr.fromJSON=KS;Qn.encode=pB;Qn.decode=iB;Qn.fromJSON=Y3;Qi.encode=mB;Qi.decode=oB;Gn.encode=gB;Gn.decode=sB;function rB(r,t=new Map,e=He.V5){const n=uB(r,t);return new Ue(n,Iu(r),t,e)}function nB(r,t=He.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Wr(r.length(),aB(r),lB(r,t))}function iB(r,t=He.V5){return new Qn(Wr.decode(r.data(),t),r.id(),r.isDelta())}function sB(r){return new Gn(r.offset(),r.length())}function oB(r){return new Qi(r.length(),r.nullCount())}function aB(r){const t=[];for(let e,n=-1,i=-1,s=r.nodesLength();++nLe.encode(r,s));Fn.startFieldsVector(r,e.length);const n=Fn.createFieldsVector(r,e),i=t.metadata&&t.metadata.size>0?Fn.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return tr.startKeyValue(r),tr.addKey(r,a),tr.addValue(r,l),tr.endKeyValue(r)})):-1;return Fn.startSchema(r),Fn.addFields(r,n),Fn.addEndianness(r,yB?Yo.Little:Yo.Big),i!==-1&&Fn.addCustomMetadata(r,i),Fn.endSchema(r)}function dB(r,t){let e=-1,n=-1,i=-1;const s=t.type;let o=t.typeId;Rt.isDictionary(s)?(o=s.dictionary.typeId,i=Xd.visit(s,r),n=Xd.visit(s.dictionary,r)):n=Xd.visit(s,r);const a=(s.children||[]).map(c=>Le.encode(r,c)),l=Jr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Jr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const f=r.createString(`${c}`),d=r.createString(`${h}`);return tr.startKeyValue(r),tr.addKey(r,f),tr.addValue(r,d),tr.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Jr.startField(r),Jr.addType(r,n),Jr.addTypeType(r,o),Jr.addChildren(r,l),Jr.addNullable(r,!!t.nullable),e!==-1&&Jr.addName(r,e),i!==-1&&Jr.addDictionary(r,i),u!==-1&&Jr.addCustomMetadata(r,u),Jr.endField(r)}function fB(r,t){const e=t.nodes||[],n=t.buffers||[];hi.startNodesVector(r,e.length);for(const o of e.slice().reverse())Qi.encode(r,o);const i=r.endVector();hi.startBuffersVector(r,n.length);for(const o of n.slice().reverse())Gn.encode(r,o);const s=r.endVector();return hi.startRecordBatch(r),hi.addLength(r,BigInt(t.length)),hi.addNodes(r,i),hi.addBuffers(r,s),hi.endRecordBatch(r)}function pB(r,t){const e=Wr.encode(r,t.data);return mo.startDictionaryBatch(r),mo.addId(r,BigInt(t.id)),mo.addIsDelta(r,t.isDelta),mo.addData(r,e),mo.endDictionaryBatch(r)}function mB(r,t){return y1.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function gB(r,t){return g1.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const yB=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),$m=r=>`Expected ${ve[r]} Message in stream, but was null or length 0.`,Gm=r=>`Header pointer of flatbuffer-encoded ${ve[r]} Message is null or length 0.`,eT=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,rT=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class nT{constructor(t){this.source=t instanceof vc?t:new vc(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?Ve: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($m(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=fe(this.source.read(t));if(e.byteLength[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error($m(t));return e.value}readSchema(){const t=ve.Schema,e=this.readMessage(t),n=e==null?void 0:e.header();if(!e||!n)throw new Error(Gm(t));return n}}const rh=4,Ep="ARROW1",fl=new Uint8Array(Ep.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 rn.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return rn.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 un?t:mp(t)?TB(t):l1(t)?EB(t):zs(t)?re(this,void 0,void 0,function*(){return yield un.from(yield t)}):u1(t)||Em(t)||c1(t)||oa(t)?MB(new Qo(t)):IB(new vc(t))}static readAll(t){return t instanceof un?t.isSync()?S0(t):T0(t):mp(t)||ArrayBuffer.isView(t)||Tl(t)||a1(t)?S0(t):T0(t)}}class bc extends un{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Ar(this,arguments,function*(){yield Dt(yield*ks(Hn(this[Symbol.iterator]())))})}}class xc extends un{constructor(t){super(t),this._impl=t}readAll(){return re(this,void 0,void 0,function*(){var t,e,n,i;const s=new Array;try{for(var o=!0,a=Hn(this),l;l=yield a.next(),t=l.done,!t;o=!0){i=l.value,o=!1;const u=i;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class sT extends bc{constructor(t){super(t),this._impl=t}}class xB extends xc{constructor(t){super(t),this._impl=t}}class oT{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const n=this._loadVectors(t,e,this.schema.fields),i=he({type:new br(this.schema.fields),length:t.length,children:n});return new Er(this.schema,i)}_loadDictionaryBatch(t,e){const{id:n,isDelta:i}=t,{dictionaries:s,schema:o}=this,a=s.get(n),l=o.dictionaries.get(n),u=this._loadVectors(t.data,e,[l]);return(a&&i?a.concat(new ze(u)):new ze(u)).memoize()}_loadVectors(t,e,n){return new YS(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class wc extends oT{constructor(t,e){super(e),this._reader=mp(t)?new _B(this._handle=t):new nT(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=lT(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):Ve}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Ve}next(){if(this.closed)return Ve;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new jm(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Sc extends oT{constructor(t,e){super(e),this._reader=new vB(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return re(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 re(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=lT(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return re(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Ve})}return(t){return re(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Ve})}next(){return re(this,void 0,void 0,function*(){if(this.closed)return Ve;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new jm(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return re(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class aT extends wc{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 m0?t:new m0(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(ve.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(ve.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-iT,n=t.readInt32(e),i=t.readAt(e-n,n);return dl.decode(i)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return re(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return re(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(ve.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return re(this,void 0,void 0,function*(){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(ve.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return re(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-iT,n=yield t.readInt32(e),i=yield t.readAt(e-n,n);return dl.decode(i)})}_readNextMessageAndValidate(t){return re(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Wm(t)?new sT(new aT(r.read())):new bc(new wc(r)):new bc(new wc(function*(){}()))}function MB(r){return re(this,void 0,void 0,function*(){const t=yield r.peek(Al+7&-8);return t&&t.byteLength>=4?Wm(t)?new sT(new aT(yield r.read())):new xc(new Sc(r)):new xc(new Sc(function(){return Ar(this,arguments,function*(){})}()))})}function EB(r){return re(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new _c(r,t);return t>=bB&&Wm(yield e.readAt(0,Al+7&-8))?new xB(new wB(e)):new xc(new Sc(e))})}class $e extends le{static assemble(...t){const e=i=>i.flatMap(s=>Array.isArray(s)?e(s):s instanceof Er?s.data.children:s.data),n=new $e;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof ze)return this.visitMany(t.data),this;const{type:e}=t;if(!Rt.isDictionary(e)){const{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(Rt.isUnion(e))this.nodes.push(new Qi(n,0));else{const{nullCount:i}=t;Rt.isNull(e)||bn.call(this,i<=0?new Uint8Array(0):pc(t.offset,n,t.nullBitmap)),this.nodes.push(new Qi(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function bn(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Gn(this._byteLength,t)),this._byteLength+=t,this}function AB(r){var t;const{type:e,length:n,typeIds:i,valueOffsets:s}=r;if(bn.call(this,i),e.mode===gr.Sparse)return Ap.call(this,r);if(e.mode===gr.Dense){if(r.offset<=0)return bn.call(this,s),Ap.call(this,r);{const o=new Int32Array(n),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],f=a[h],d=l[h];return u.slice(f,Math.min(n,d))}))}}return this}function CB(r){let t;return r.nullCount>=r.length?bn.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?bn.call(this,pc(r.offset,r.length,t)):bn.call(this,mc(r.values))}function Ti(r){return bn.call(this,r.values.subarray(0,r.length*r.stride))}function nh(r){const{length:t,values:e,valueOffsets:n}=r,i=Ae(n[0]),s=Ae(n[t]),o=Math.min(s-i,e.byteLength-i);return bn.call(this,d1(-i,t+1,n)),bn.call(this,e.subarray(i,i+o)),this}function Hm(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:n,[t]:i}=e;return bn.call(this,d1(-n,t+1,e)),this.visit(r.children[0].slice(n,i-n))}return this.visit(r.children[0])}function Ap(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}$e.prototype.visitBool=CB;$e.prototype.visitInt=Ti;$e.prototype.visitFloat=Ti;$e.prototype.visitUtf8=nh;$e.prototype.visitLargeUtf8=nh;$e.prototype.visitBinary=nh;$e.prototype.visitLargeBinary=nh;$e.prototype.visitFixedSizeBinary=Ti;$e.prototype.visitDate=Ti;$e.prototype.visitTimestamp=Ti;$e.prototype.visitTime=Ti;$e.prototype.visitDecimal=Ti;$e.prototype.visitList=Hm;$e.prototype.visitStruct=Ap;$e.prototype.visitUnion=AB;$e.prototype.visitInterval=Ti;$e.prototype.visitDuration=Ti;$e.prototype.visitFixedSizeList=Hm;$e.prototype.visitMap=Hm;class uT extends Bm{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 Su,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Cr(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 zs(t)?t.then(e=>this.writeAll(e)):oa(t)?Qm(this,t):qm(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 Su?this._sink=t:(this._sink=new Su,t&&iN(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&sN(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||!Mp(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 qi&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof Er&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Mp(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof Er?t instanceof jm||this._writeRecordBatch(t):t instanceof qi?this.writeAll(t.batches):Tl(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,i=xr.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,l=a-s-o;return t.headerType===ve.RecordBatch?this._recordBatchBlocks.push(new Xi(a,t.bodyLength,this._position)):t.headerType===ve.DictionaryBatch&&this._dictionaryBlocks.push(new Xi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(l)}_write(t){if(this._started){const e=fe(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(xr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(fl)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=$e.assemble(t),o=new Wr(t.numRows,n,i),a=xr.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,n=!1){const{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=$e.assemble(new ze([t])),l=new Wr(t.length,s,o),u=new Qn(l,e,n),c=xr.from(u,i);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,i;for(let s=-1,o=t.length;++s0&&(this._write(e),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){var e,n;for(const[i,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(i),l=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,i,u>0);else if(ln.writeAll(i)):oa(t)?Qm(n,t):qm(n,t)}}class Ym extends uT{static writeAll(t){const e=new Ym;return zs(t)?t.then(n=>e.writeAll(n)):oa(t)?Qm(e,t):qm(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,n=!1){if(!n&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,n)}_writeFooter(t){const e=dl.encode(new dl(t,He.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function qm(r,t){let e=t;t instanceof qi&&(e=t.batches,r.reset(void 0,t.schema));for(const n of e)r.write(n);return r.finish()}function Qm(r,t){return re(this,void 0,void 0,function*(){var e,n,i,s,o,a,l;try{for(e=!0,n=Hn(t);i=yield n.next(),s=i.done,!s;e=!0){l=i.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function OB(r,t="stream"){return(t==="stream"?Xm:Ym).writeAll(r).toUint8Array(!0)}var PB=Object.create,cT=Object.defineProperty,RB=Object.getOwnPropertyDescriptor,FB=Object.getOwnPropertyNames,DB=Object.getPrototypeOf,LB=Object.prototype.hasOwnProperty,NB=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),BB=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of FB(t))!LB.call(r,i)&&i!==e&&cT(r,i,{get:()=>t[i],enumerable:!(n=RB(t,i))||n.enumerable});return r},kB=(r,t,e)=>(e=r!=null?PB(DB(r)):{},BB(!r||!r.__esModule?cT(e,"default",{value:r,enumerable:!0}):e,r)),UB=NB((r,t)=>{t.exports=Worker}),hT=(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))(hT||{}),zB=(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))(zB||{}),VB=(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))(VB||{}),jB=(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))(jB||{}),$B=(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))($B||{}),GB=(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))(GB||{}),WB=class{log(r){}},dT=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},HB=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(HB||{}),XB=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=un.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new qi(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let n=new fT(this._bindings,this._conn,e),i=await un.from(n);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new YB(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=OB(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)}},fT=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}},YB=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=un.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new qi(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new fT(this.bindings,this.connectionId,t),n=await un.from(e);return console.assert(n.isAsync()),console.assert(n.isStream()),n}},qB=(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))(qB||{}),QB=(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))(QB||{}),me=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,n)=>{this.promiseResolver=e,this.promiseRejecter=n})}};function Mu(r){switch(r.typeId){case z.Binary:return{sqlType:"binary"};case z.Bool:return{sqlType:"bool"};case z.Date:return{sqlType:"date"};case z.DateDay:return{sqlType:"date32[d]"};case z.DateMillisecond:return{sqlType:"date64[ms]"};case z.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case z.Float:return{sqlType:"float"};case z.Float16:return{sqlType:"float16"};case z.Float32:return{sqlType:"float32"};case z.Float64:return{sqlType:"float64"};case z.Int:return{sqlType:"int32"};case z.Int16:return{sqlType:"int16"};case z.Int32:return{sqlType:"int32"};case z.Int64:return{sqlType:"int64"};case z.Uint16:return{sqlType:"uint16"};case z.Uint32:return{sqlType:"uint32"};case z.Uint64:return{sqlType:"uint64"};case z.Uint8:return{sqlType:"uint8"};case z.IntervalDayTime:return{sqlType:"interval[dt]"};case z.IntervalYearMonth:return{sqlType:"interval[m]"};case z.List:return{sqlType:"list",valueType:Mu(r.valueType)};case z.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case z.Null:return{sqlType:"null"};case z.Utf8:return{sqlType:"utf8"};case z.Struct:return{sqlType:"struct",fields:r.children.map(t=>Cp(t.name,t.type))};case z.Map:{let t=r;return{sqlType:"map",keyType:Mu(t.keyType),valueType:Mu(t.valueType)}}case z.Time:return{sqlType:"time[s]"};case z.TimeMicrosecond:return{sqlType:"time[us]"};case z.TimeMillisecond:return{sqlType:"time[ms]"};case z.TimeNanosecond:return{sqlType:"time[ns]"};case z.TimeSecond:return{sqlType:"time[s]"};case z.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case z.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case z.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case z.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case z.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function Cp(r,t){let e=Mu(t);return e.name=r,e}var ZB=new TextEncoder,KB=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(e.data);return}}let n=this._pendingRequests.get(e.requestId);if(!n){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let i=new Error(e.data.message);i.name=e.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=e.data.stack),n.promiseRejecter(i);return}switch(n.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"REGISTER_OPFS_FILE_NAME":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(e.type=="OK"){n.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){n.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){n.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){n.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){n.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){n.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){n.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){n.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){n.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){n.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){n.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){n.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){n.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){n.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){n.promiseResolver(e.data);return}break}n.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new me("RESET",null);return await this.postTask(r)}async ping(){let r=new me("PING",null);await this.postTask(r)}async dropFile(r){let t=new me("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new me("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new me("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=n=>{}){this._onInstantiationProgress.push(e);let n=new me("INSTANTIATE",[r,t]);return await this.postTask(n)}async getVersion(){let r=new me("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new me("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new me("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new me("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new me("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new XB(this,r)}async disconnect(r){let t=new me("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new me("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let n=new me("START_PENDING_QUERY",[r,t,e]);return await this.postTask(n)}async pollPendingQuery(r){let t=new me("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new me("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new me("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new me("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new me("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new me("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let n=new me("RUN_PREPARED",[r,t,e]);return await this.postTask(n)}async sendPrepared(r,t,e){let n=new me("SEND_PREPARED",[r,t,e]);return await this.postTask(n)}async globFiles(r){let t=new me("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=ZB.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,n){t===void 0&&(t=r);let i=new me("REGISTER_FILE_URL",[r,t,e,n]);await this.postTask(i)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new me("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,n){let i=new me("REGISTER_FILE_HANDLE",[r,t,e,n]);await this.postTask(i,[])}async registerOPFSFileName(r){let t=new me("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new me("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new me("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new me("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new me("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let n=new me("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(n,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(Cp(s,o))}e.columnsFlat=i,delete e.columns}let n=new me("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(n)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(Cp(s,o))}e.columnsFlat=i,delete e.columns}let n=new me("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(n)}};function JB(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}JB();var tk=(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))(tk||{}),ek=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])),rk=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])),nk=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])),ik=()=>(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])),sk={version:"1.29.1-dev68.0"},Zm=sk.version.split(".");Zm[0];Zm[1];Zm[2];var ok=()=>typeof navigator>"u",Yd=null,qd=null,Qd=null,Zd=null,Kd=null;async function ak(){return Yd==null&&(Yd=typeof BigInt64Array<"u"),qd==null&&(qd=await rk()),Qd==null&&(Qd=await ik()),Zd==null&&(Zd=await nk()),Kd==null&&(Kd=await ek()),{bigInt64Array:Yd,crossOriginIsolated:ok()||globalThis.crossOriginIsolated||!1,wasmExceptions:qd,wasmSIMD:Zd,wasmThreads:Qd,wasmBulkMemory:Kd}}async function I0(r){let t=await ak();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}}kB(UB());const Jd={},Ga={};function qa(r,t){try{const n=(Jd[r]||(Jd[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return n in Ga?Ga[n]:M0(n,n.split(":"))}catch{if(r in Ga)return Ga[r];const e=r==null?void 0:r.match(lk);return e?M0(r,e.slice(1)):NaN}}const lk=/([+-]\d\d):?(\d\d)?/;function M0(r,t){const e=+t[0],n=+(t[1]||0);return Ga[r]=e>0?e*60+n:e*60-n}class Vr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(qa(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)),pT(this),Op(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Vr(...e,t):new Vr(Date.now(),t)}withTimeZone(t){return new Vr(+this,t)}getTimezoneOffset(){return-qa(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Op(this),+this}[Symbol.for("constructDateFrom")](t){return new Vr(+new Date(t),this.timeZone)}}const E0=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!E0.test(r))return;const t=r.replace(E0,"$1UTC");Vr.prototype[t]&&(r.startsWith("get")?Vr.prototype[r]=function(){return this.internal[t]()}:(Vr.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),uk(this),+this},Vr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Op(this),+this}))});function Op(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function uk(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()),pT(r)}function pT(r){const t=qa(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const n=-new Date(+r).getTimezoneOffset(),i=-new Date(+e).getTimezoneOffset(),s=n-i,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=n-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=qa(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,f=c-a;if(h&&f){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+f);const d=qa(r.timeZone,r),m=l-d;m&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+m),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+m))}}const ck=new TextDecoder("utf-8"),hk=r=>ck.decode(r),dk=new TextEncoder,mT=r=>dk.encode(r),Ln=r=>typeof r=="function",Cl=r=>r!=null&&Object(r)===r,fk=r=>Cl(r)&&Ln(r.then),gT=r=>Cl(r)&&Ln(r[Symbol.iterator]),pk=r=>Cl(r)&&Ln(r[Symbol.asyncIterator]),mk=r=>Cl(r)&&"done"in r&&"value"in r,gk=r=>Cl(r)&&Ln(r.clear)&&Ln(r.bytes)&&Ln(r.position)&&Ln(r.setPosition)&&Ln(r.capacity)&&Ln(r.getBufferIdentifier)&&Ln(r.createLong),Km=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function yk(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lyr(Int8Array,r),bk=r=>yr(Int16Array,r),xk=r=>yr(Int32Array,r),wk=r=>yr(BigInt64Array,r),Sk=r=>yr(Uint8Array,r),Tk=r=>yr(Uint16Array,r),Ik=r=>yr(Uint32Array,r),Mk=r=>yr(BigUint64Array,r),Ek=r=>yr(Float32Array,r),Ak=r=>yr(Float64Array,r),Ck=r=>yr(Uint8ClampedArray,r),Rp=r=>(r.next(),r);function*ri(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Km?e(t):gT(t)?t:e(t);return yield*Rp(function*(i){let s=null;do s=i.next(yield yr(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const Ok=r=>ri(Int8Array,r),Pk=r=>ri(Int16Array,r),Rk=r=>ri(Int32Array,r),Fk=r=>ri(Uint8Array,r),Dk=r=>ri(Uint16Array,r),Lk=r=>ri(Uint32Array,r),Nk=r=>ri(Float32Array,r),Bk=r=>ri(Float64Array,r),kk=r=>ri(Uint8ClampedArray,r);function Sn(r,t){return Ar(this,arguments,function*(){if(fk(t))return yield Dt(yield Dt(yield*ks(Hn(Sn(r,yield Dt(t))))));const n=function(o){return Ar(this,arguments,function*(){yield yield Dt(yield Dt(o))})},i=function(o){return Ar(this,arguments,function*(){yield Dt(yield*ks(Hn(Rp(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 Km?n(t):gT(t)?i(t):pk(t)?t:n(t);return yield Dt(yield*ks(Hn(Rp(function(o){return Ar(this,arguments,function*(){let a=null;do a=yield Dt(o.next(yield yield Dt(yr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Dt(new r)})}const Uk=r=>Sn(Int8Array,r),zk=r=>Sn(Int16Array,r),Vk=r=>Sn(Int32Array,r),jk=r=>Sn(Uint8Array,r),$k=r=>Sn(Uint16Array,r),Gk=r=>Sn(Uint32Array,r),Wk=r=>Sn(Float32Array,r),Hk=r=>Sn(Float64Array,r),Xk=r=>Sn(Uint8ClampedArray,r);function Yk(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++eKo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const Zk=Object.freeze(Object.defineProperty({__proto__:null,valueToString:Ko},Symbol.toStringTag,{value:"Module"}));function wr(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 vT(r,t){return wr(r/t)+wr(r%t)/wr(t)}const _T=Symbol.for("isArrowBigNum");function Tn(r,...t){return t.length===0?Object.setPrototypeOf(yr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}Tn.prototype[_T]=!0;Tn.prototype.toJSON=function(){return`"${Jo(this)}"`};Tn.prototype.valueOf=function(r){return Jm(this,r)};Tn.prototype.toString=function(){return Jo(this)};Tn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Jm(this);case"string":return Jo(this);case"default":return bT(this)}return Jo(this)};function zo(...r){return Tn.apply(this,r)}function Vo(...r){return Tn.apply(this,r)}function pl(...r){return Tn.apply(this,r)}Object.setPrototypeOf(zo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Vo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(pl.prototype,Object.create(Uint32Array.prototype));Object.assign(zo.prototype,Tn.prototype,{constructor:zo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Vo.prototype,Tn.prototype,{constructor:Vo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(pl.prototype,Tn.prototype,{constructor:pl,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Kk=BigInt(4294967296)*BigInt(4294967296),Jk=Kk-BigInt(1);function Jm(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return tf(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Pt.prototype);class A0 extends Pt{constructor(){super(H.Null)}toString(){return"Null"}}wT=Symbol.toStringTag;A0[wT]=(r=>r[Symbol.toStringTag]="Null")(A0.prototype);class C0 extends Pt{constructor(t,e){super(H.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}ST=Symbol.toStringTag;C0[ST]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(C0.prototype);class O0 extends Pt{constructor(t){super(H.Float),this.precision=t}get ArrayType(){switch(this.precision){case jr.HALF:return Uint16Array;case jr.SINGLE:return Float32Array;case jr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}TT=Symbol.toStringTag;O0[TT]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(O0.prototype);class P0 extends Pt{constructor(){super(H.Binary)}toString(){return"Binary"}}IT=Symbol.toStringTag;P0[IT]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(P0.prototype);class R0 extends Pt{constructor(){super(H.LargeBinary)}toString(){return"LargeBinary"}}MT=Symbol.toStringTag;R0[MT]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(R0.prototype);class F0 extends Pt{constructor(){super(H.Utf8)}toString(){return"Utf8"}}ET=Symbol.toStringTag;F0[ET]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(F0.prototype);class D0 extends Pt{constructor(){super(H.LargeUtf8)}toString(){return"LargeUtf8"}}AT=Symbol.toStringTag;D0[AT]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(D0.prototype);class L0 extends Pt{constructor(){super(H.Bool)}toString(){return"Bool"}}CT=Symbol.toStringTag;L0[CT]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(L0.prototype);class N0 extends Pt{constructor(t,e,n=128){super(H.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}OT=Symbol.toStringTag;N0[OT]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(N0.prototype);class B0 extends Pt{constructor(t){super(H.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Zi[this.unit]}>`}get ArrayType(){return this.unit===Zi.DAY?Int32Array:BigInt64Array}}PT=Symbol.toStringTag;B0[PT]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(B0.prototype);class k0 extends Pt{constructor(t,e){super(H.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${ne[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}RT=Symbol.toStringTag;k0[RT]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(k0.prototype);class U0 extends Pt{constructor(t,e){super(H.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${ne[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}FT=Symbol.toStringTag;U0[FT]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(U0.prototype);class z0 extends Pt{constructor(t){super(H.Interval),this.unit=t}toString(){return`Interval<${js[this.unit]}>`}}DT=Symbol.toStringTag;z0[DT]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(z0.prototype);class V0 extends Pt{constructor(t){super(H.Duration),this.unit=t}toString(){return`Duration<${ne[this.unit]}>`}}LT=Symbol.toStringTag;V0[LT]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(V0.prototype);class j0 extends Pt{constructor(t){super(H.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}NT=Symbol.toStringTag;j0[NT]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(j0.prototype);class Fp extends Pt{constructor(t){super(H.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}BT=Symbol.toStringTag;Fp[BT]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(Fp.prototype);class $0 extends Pt{constructor(t,e,n){super(H.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}kT=Symbol.toStringTag;$0[kT]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))($0.prototype);class G0 extends Pt{constructor(t){super(H.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}UT=Symbol.toStringTag;G0[UT]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(G0.prototype);class W0 extends Pt{constructor(t,e){super(H.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}zT=Symbol.toStringTag;W0[zT]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(W0.prototype);class H0 extends Pt{constructor(t,e=!1){var n,i,s;if(super(H.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}VT=Symbol.toStringTag;H0[VT]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(H0.prototype);const eU=(r=>()=>++r)(-1);class X0 extends Pt{constructor(t,e,n,i){super(H.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?eU():wr(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}jT=Symbol.toStringTag;X0[jT]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(X0.prototype);function $T(r){const t=r;switch(r.typeId){case H.Decimal:return r.bitWidth/32;case H.Interval:return 1+t.unit;case H.FixedSizeList:return t.listSize;case H.FixedSizeBinary:return t.byteWidth;default:return 1}}class pe{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return rU(this,t,e)}getVisitFnByTypeId(t,e=!0){return Io(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function rU(r,t,e=!0){return typeof t=="number"?Io(r,t,e):typeof t=="string"&&t in H?Io(r,H[t],e):t&&t instanceof Pt?Io(r,Y0(t),e):t!=null&&t.type&&t.type instanceof Pt?Io(r,Y0(t.type),e):Io(r,H.NONE,e)}function Io(r,t,e=!0){let n=null;switch(t){case H.Null:n=r.visitNull;break;case H.Bool:n=r.visitBool;break;case H.Int:n=r.visitInt;break;case H.Int8:n=r.visitInt8||r.visitInt;break;case H.Int16:n=r.visitInt16||r.visitInt;break;case H.Int32:n=r.visitInt32||r.visitInt;break;case H.Int64:n=r.visitInt64||r.visitInt;break;case H.Uint8:n=r.visitUint8||r.visitInt;break;case H.Uint16:n=r.visitUint16||r.visitInt;break;case H.Uint32:n=r.visitUint32||r.visitInt;break;case H.Uint64:n=r.visitUint64||r.visitInt;break;case H.Float:n=r.visitFloat;break;case H.Float16:n=r.visitFloat16||r.visitFloat;break;case H.Float32:n=r.visitFloat32||r.visitFloat;break;case H.Float64:n=r.visitFloat64||r.visitFloat;break;case H.Utf8:n=r.visitUtf8;break;case H.LargeUtf8:n=r.visitLargeUtf8;break;case H.Binary:n=r.visitBinary;break;case H.LargeBinary:n=r.visitLargeBinary;break;case H.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case H.Date:n=r.visitDate;break;case H.DateDay:n=r.visitDateDay||r.visitDate;break;case H.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case H.Timestamp:n=r.visitTimestamp;break;case H.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case H.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case H.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case H.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case H.Time:n=r.visitTime;break;case H.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case H.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case H.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case H.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case H.Decimal:n=r.visitDecimal;break;case H.List:n=r.visitList;break;case H.Struct:n=r.visitStruct;break;case H.Union:n=r.visitUnion;break;case H.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case H.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case H.Dictionary:n=r.visitDictionary;break;case H.Interval:n=r.visitInterval;break;case H.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case H.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case H.Duration:n=r.visitDuration;break;case H.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case H.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case H.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case H.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case H.FixedSizeList:n=r.visitFixedSizeList;break;case H.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${H[t]}'`)}function Y0(r){switch(r.typeId){case H.Null:return H.Null;case H.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?H.Int8:H.Uint8;case 16:return e?H.Int16:H.Uint16;case 32:return e?H.Int32:H.Uint32;case 64:return e?H.Int64:H.Uint64}return H.Int}case H.Float:switch(r.precision){case jr.HALF:return H.Float16;case jr.SINGLE:return H.Float32;case jr.DOUBLE:return H.Float64}return H.Float;case H.Binary:return H.Binary;case H.LargeBinary:return H.LargeBinary;case H.Utf8:return H.Utf8;case H.LargeUtf8:return H.LargeUtf8;case H.Bool:return H.Bool;case H.Decimal:return H.Decimal;case H.Time:switch(r.unit){case ne.SECOND:return H.TimeSecond;case ne.MILLISECOND:return H.TimeMillisecond;case ne.MICROSECOND:return H.TimeMicrosecond;case ne.NANOSECOND:return H.TimeNanosecond}return H.Time;case H.Timestamp:switch(r.unit){case ne.SECOND:return H.TimestampSecond;case ne.MILLISECOND:return H.TimestampMillisecond;case ne.MICROSECOND:return H.TimestampMicrosecond;case ne.NANOSECOND:return H.TimestampNanosecond}return H.Timestamp;case H.Date:switch(r.unit){case Zi.DAY:return H.DateDay;case Zi.MILLISECOND:return H.DateMillisecond}return H.Date;case H.Interval:switch(r.unit){case js.DAY_TIME:return H.IntervalDayTime;case js.YEAR_MONTH:return H.IntervalYearMonth}return H.Interval;case H.Duration:switch(r.unit){case ne.SECOND:return H.DurationSecond;case ne.MILLISECOND:return H.DurationMillisecond;case ne.MICROSECOND:return H.DurationMicrosecond;case ne.NANOSECOND:return H.DurationNanosecond}return H.Duration;case H.Map:return H.Map;case H.List:return H.List;case H.Struct:return H.Struct;case H.Union:switch(r.mode){case Zn.Dense:return H.DenseUnion;case Zn.Sparse:return H.SparseUnion}return H.Union;case H.FixedSizeBinary:return H.FixedSizeBinary;case H.FixedSizeList:return H.FixedSizeList;case H.Dictionary:return H.Dictionary}throw new Error(`Unrecognized type '${H[r.typeId]}'`)}pe.prototype.visitInt8=null;pe.prototype.visitInt16=null;pe.prototype.visitInt32=null;pe.prototype.visitInt64=null;pe.prototype.visitUint8=null;pe.prototype.visitUint16=null;pe.prototype.visitUint32=null;pe.prototype.visitUint64=null;pe.prototype.visitFloat16=null;pe.prototype.visitFloat32=null;pe.prototype.visitFloat64=null;pe.prototype.visitDateDay=null;pe.prototype.visitDateMillisecond=null;pe.prototype.visitTimestampSecond=null;pe.prototype.visitTimestampMillisecond=null;pe.prototype.visitTimestampMicrosecond=null;pe.prototype.visitTimestampNanosecond=null;pe.prototype.visitTimeSecond=null;pe.prototype.visitTimeMillisecond=null;pe.prototype.visitTimeMicrosecond=null;pe.prototype.visitTimeNanosecond=null;pe.prototype.visitDenseUnion=null;pe.prototype.visitSparseUnion=null;pe.prototype.visitIntervalDayTime=null;pe.prototype.visitIntervalYearMonth=null;pe.prototype.visitDuration=null;pe.prototype.visitDurationSecond=null;pe.prototype.visitDurationMillisecond=null;pe.prototype.visitDurationMicrosecond=null;pe.prototype.visitDurationNanosecond=null;const GT=new Float64Array(1),uo=new Uint32Array(GT.buffer);function tg(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function WT(r){if(r!==r)return 32256;GT[0]=r;const t=(uo[1]&2147483648)>>16&65535;let e=uo[1]&2146435072,n=0;return e>=1089470464?uo[0]>0?e=31744:(e=(e&2080374784)>>16,n=(uo[1]&1048575)>>10):e<=1056964608?(n=1048576+(uo[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(uo[1]&1048575)+512>>10),t|e|n&65535}const nU=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:WT,uint16ToFloat64:tg},Symbol.toStringTag,{value:"Module"}));class Xt extends pe{}function Kt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const iU=(r,t,e)=>{r[t]=Math.floor(e/864e5)},HT=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},eg=({values:r},t,e)=>{r[t]=e},XT=({values:r},t,e)=>{r[t]=WT(e)},oU=(r,t,e)=>{switch(r.type.precision){case jr.HALF:return XT(r,t,e);case jr.SINGLE:case jr.DOUBLE:return eg(r,t,e)}},YT=({values:r},t,e)=>{iU(r,t,e.valueOf())},qT=({values:r},t,e)=>{r[t]=BigInt(e)},aU=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},QT=({values:r,valueOffsets:t},e,n)=>HT(r,t,e,n),ZT=({values:r,valueOffsets:t},e,n)=>HT(r,t,e,mT(n)),lU=(r,t,e)=>{r.type.unit===Zi.DAY?YT(r,t,e):qT(r,t,e)},KT=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},JT=({values:r},t,e)=>{r[t]=BigInt(e)},tI=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},eI=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},uU=(r,t,e)=>{switch(r.type.unit){case ne.SECOND:return KT(r,t,e);case ne.MILLISECOND:return JT(r,t,e);case ne.MICROSECOND:return tI(r,t,e);case ne.NANOSECOND:return eI(r,t,e)}},rI=({values:r},t,e)=>{r[t]=e},nI=({values:r},t,e)=>{r[t]=e},iI=({values:r},t,e)=>{r[t]=e},sI=({values:r},t,e)=>{r[t]=e},cU=(r,t,e)=>{switch(r.type.unit){case ne.SECOND:return rI(r,t,e);case ne.MILLISECOND:return nI(r,t,e);case ne.MICROSECOND:return iI(r,t,e);case ne.NANOSECOND:return sI(r,t,e)}},hU=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},dU=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=Kn.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=Kn.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},pU=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),mU=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),gU=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),yU=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),vU=(r,t,e)=>{const n=r.type.children.map(s=>Kn.getVisitFn(s.type)),i=e instanceof Map?gU(t,e):e instanceof lr?mU(t,e):Array.isArray(e)?pU(t,e):yU(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},_U=(r,t,e)=>{r.type.mode===Zn.Dense?oI(r,t,e):aI(r,t,e)},oI=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];Kn.visit(i,r.valueOffsets[t],e)},aI=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];Kn.visit(i,t,e)},bU=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},xU=(r,t,e)=>{r.type.unit===js.DAY_TIME?lI(r,t,e):uI(r,t,e)},lI=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},uI=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},cI=({values:r},t,e)=>{r[t]=e},hI=({values:r},t,e)=>{r[t]=e},dI=({values:r},t,e)=>{r[t]=e},fI=({values:r},t,e)=>{r[t]=e},wU=(r,t,e)=>{switch(r.type.unit){case ne.SECOND:return cI(r,t,e);case ne.MILLISECOND:return hI(r,t,e);case ne.MICROSECOND:return dI(r,t,e);case ne.NANOSECOND:return fI(r,t,e)}},SU=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=Kn.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${Ko(t)}: ${Ko(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new TU(this[vn],this[jo])}}class TU{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[vn].type.children.some(n=>n.name===e)}getOwnPropertyDescriptor(t,e){if(t[vn].type.children.some(n=>n.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[vn].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=pn.visit(t[vn].children[n],t[jo]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[vn].type.children.findIndex(s=>s.name===e);return i!==-1?(Kn.visit(t[vn].children[i],t[jo],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}const MU=new IU;class Ut extends pe{}function Yt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const EU=(r,t)=>864e5*r[t],AU=(r,t)=>null,pI=(r,t,e)=>{if(e+1>=t.length)return null;const n=wr(t[e]),i=wr(t[e+1]);return r.subarray(n,i)},CU=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<EU(r,t),gI=({values:r},t)=>wr(r[t]),es=({stride:r,values:t},e)=>t[r*e],OU=({stride:r,values:t},e)=>tg(t[r*e]),yI=({values:r},t)=>r[t],PU=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),vI=({values:r,valueOffsets:t},e)=>pI(r,t,e),_I=({values:r,valueOffsets:t},e)=>{const n=pI(r,t,e);return n!==null?hk(n):null},RU=({values:r},t)=>r[t],FU=({type:r,values:t},e)=>r.precision!==jr.HALF?t[e]:tg(t[e]),DU=(r,t)=>r.type.unit===Zi.DAY?mI(r,t):gI(r,t),bI=({values:r},t)=>1e3*wr(r[t]),xI=({values:r},t)=>wr(r[t]),wI=({values:r},t)=>vT(r[t],BigInt(1e3)),SI=({values:r},t)=>vT(r[t],BigInt(1e6)),LU=(r,t)=>{switch(r.type.unit){case ne.SECOND:return bI(r,t);case ne.MILLISECOND:return xI(r,t);case ne.MICROSECOND:return wI(r,t);case ne.NANOSECOND:return SI(r,t)}},TI=({values:r},t)=>r[t],II=({values:r},t)=>r[t],MI=({values:r},t)=>r[t],EI=({values:r},t)=>r[t],NU=(r,t)=>{switch(r.type.unit){case ne.SECOND:return TI(r,t);case ne.MILLISECOND:return II(r,t);case ne.MICROSECOND:return MI(r,t);case ne.NANOSECOND:return EI(r,t)}},BU=({values:r,stride:t},e)=>ih.decimal(r.subarray(t*e,t*(e+1))),kU=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new lr([l])},UU=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new ng(o.slice(i,s-i))},zU=(r,t)=>new rg(r,t),VU=(r,t)=>r.type.mode===Zn.Dense?AI(r,t):CI(r,t),AI=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return pn.visit(n,r.valueOffsets[t])},CI=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return pn.visit(n,t)},jU=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},$U=(r,t)=>r.type.unit===js.DAY_TIME?OI(r,t):PI(r,t),OI=({values:r},t)=>r.subarray(2*t,2*(t+1)),PI=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},RI=({values:r},t)=>r[t],FI=({values:r},t)=>r[t],DI=({values:r},t)=>r[t],LI=({values:r},t)=>r[t],GU=(r,t)=>{switch(r.type.unit){case ne.SECOND:return RI(r,t);case ne.MILLISECOND:return FI(r,t);case ne.MICROSECOND:return DI(r,t);case ne.NANOSECOND:return LI(r,t)}},WU=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new lr([s])};Ut.prototype.visitNull=Yt(AU);Ut.prototype.visitBool=Yt(CU);Ut.prototype.visitInt=Yt(RU);Ut.prototype.visitInt8=Yt(es);Ut.prototype.visitInt16=Yt(es);Ut.prototype.visitInt32=Yt(es);Ut.prototype.visitInt64=Yt(yI);Ut.prototype.visitUint8=Yt(es);Ut.prototype.visitUint16=Yt(es);Ut.prototype.visitUint32=Yt(es);Ut.prototype.visitUint64=Yt(yI);Ut.prototype.visitFloat=Yt(FU);Ut.prototype.visitFloat16=Yt(OU);Ut.prototype.visitFloat32=Yt(es);Ut.prototype.visitFloat64=Yt(es);Ut.prototype.visitUtf8=Yt(_I);Ut.prototype.visitLargeUtf8=Yt(_I);Ut.prototype.visitBinary=Yt(vI);Ut.prototype.visitLargeBinary=Yt(vI);Ut.prototype.visitFixedSizeBinary=Yt(PU);Ut.prototype.visitDate=Yt(DU);Ut.prototype.visitDateDay=Yt(mI);Ut.prototype.visitDateMillisecond=Yt(gI);Ut.prototype.visitTimestamp=Yt(LU);Ut.prototype.visitTimestampSecond=Yt(bI);Ut.prototype.visitTimestampMillisecond=Yt(xI);Ut.prototype.visitTimestampMicrosecond=Yt(wI);Ut.prototype.visitTimestampNanosecond=Yt(SI);Ut.prototype.visitTime=Yt(NU);Ut.prototype.visitTimeSecond=Yt(TI);Ut.prototype.visitTimeMillisecond=Yt(II);Ut.prototype.visitTimeMicrosecond=Yt(MI);Ut.prototype.visitTimeNanosecond=Yt(EI);Ut.prototype.visitDecimal=Yt(BU);Ut.prototype.visitList=Yt(kU);Ut.prototype.visitStruct=Yt(zU);Ut.prototype.visitUnion=Yt(VU);Ut.prototype.visitDenseUnion=Yt(AI);Ut.prototype.visitSparseUnion=Yt(CI);Ut.prototype.visitDictionary=Yt(jU);Ut.prototype.visitInterval=Yt($U);Ut.prototype.visitIntervalDayTime=Yt(OI);Ut.prototype.visitIntervalYearMonth=Yt(PI);Ut.prototype.visitDuration=Yt(GU);Ut.prototype.visitDurationSecond=Yt(RI);Ut.prototype.visitDurationMillisecond=Yt(FI);Ut.prototype.visitDurationMicrosecond=Yt(DI);Ut.prototype.visitDurationNanosecond=Yt(LI);Ut.prototype.visitFixedSizeList=Yt(WU);Ut.prototype.visitMap=Yt(UU);const pn=new Ut,Mo=Symbol.for("keys"),$o=Symbol.for("vals"),Eo=Symbol.for("kKeysAsStrings"),Dp=Symbol.for("_kKeysAsStrings");class ng{constructor(t){return this[Mo]=new lr([t.children[0]]).memoize(),this[$o]=t.children[1],new Proxy(this,new XU)}get[Eo](){return this[Dp]||(this[Dp]=Array.from(this[Mo].toArray(),String))}[Symbol.iterator](){return new HU(this[Mo],this[$o])}get size(){return this[Mo].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Mo],e=this[$o],n={};for(let i=-1,s=t.length;++i`${Ko(t)}: ${Ko(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class HU{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),pn.visit(this.vals,t)]})}}class XU{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Eo]}has(t,e){return t[Eo].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Eo].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[Eo].indexOf(e);if(n!==-1){const i=pn.visit(Reflect.get(t,$o),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[Eo].indexOf(e);return i!==-1?(Kn.visit(Reflect.get(t,$o),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(ng.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Mo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[$o]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Dp]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let q0;function NI(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const BI=(r,t)=>r<0?t+r:r,Q0=r=>r!==r;function Zs(r){if(typeof r!=="object"||r===null)return Q0(r)?Q0:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?yT(r,e):!1:r instanceof Map?qU(r):Array.isArray(r)?YU(r):r instanceof lr?QU(r):ZU(r,!0)}function YU(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return KU(r,e);case Map:return Z0(r,e,e.keys());case ng:case rg:case Object:case void 0:return Z0(r,e,t||Object.keys(e))}return e instanceof lr?JU(r,e):!1}}function KU(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function e4(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):UI(new oh(e,r,t,null,ig)).subarray(0,n)),i}return e}function UI(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class oh{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return Tc(r,t,i)+Tc(r,n,e)+zI(r,i>>3,n-i>>3)}function zI(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Eu(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Eu(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Eu(s.getUint8(i)),i+=1;return n}function Eu(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 r4=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:oh,getBit:kI,getBool:ig,packBools:UI,popcnt_array:zI,popcnt_bit_range:Tc,popcnt_uint32:Eu,setBool:e4,truncateBitmap:Lp},Symbol.toStringTag,{value:"Module"})),n4=-1;class ml{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 Pt.isSparseUnion(t)?this.children.some(e=>e.nullable):Pt.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Pt.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=n4&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Tc(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof ml?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=$T(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(Pt.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===Zn.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Lp(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new ml(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===H.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(Lp(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[pi.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[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]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}}ml.prototype.children=Object.freeze([]);class K0{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function s4(r){return r.reduce((t,e)=>t+e.nullCount,0)}function o4(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function a4(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function sg(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function h4(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new oh(e,r.offset+(t||0),r.length,e,ig)){if(!i)return n;++n}return-1}function ee(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case H.Union:break;case H.Dictionary:break;default:return h4(r,e)}const n=pn.getVisitFn(r),i=Zs(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new K0(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new d4(o)})}class d4{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof ml)))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}=GI[o.typeId],c=s[0];this.isValid=h=>VI(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,WI[o.typeId]),this._offsets=o4(s);break}this.data=s,this.type=o,this.stride=$T(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return i4(this.data)}get nullCount(){return s4(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${H[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(BI(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return f4.visit(this)}concat(...t){return new lr(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new lr(NI(this,t,e,({data:n,_offsets:i},s,o)=>a4(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case H.Int:case H.Float:case H.Decimal:case H.Time:case H.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Pt.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Pt.isDictionary(this.type)){const t=new Ic(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new lr(e)}return new Ic(this)}unmemoize(){if(Pt.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new lr(e)}return this}}$I=Symbol.toStringTag;lr[$I]=(r=>{r.type=Pt.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(H).map(e=>H[e]).filter(e=>typeof e=="number"&&e!==H.NONE);for(const e of t){const n=pn.getVisitFnByTypeId(e),i=Kn.getVisitFnByTypeId(e),s=t_.getVisitFnByTypeId(e);GI[e]={get:n,set:i,indexOf:s},WI[e]=Object.create(r,{isValid:{value:J0(VI)},get:{value:J0(pn.getVisitFnByTypeId(e))},set:{value:l4(Kn.getVisitFnByTypeId(e))},indexOf:{value:u4(t_.getVisitFnByTypeId(e))}})}return"Vector"})(lr.prototype);class Ic extends lr{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Ic(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new lr(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const p4=65536;function Po(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const ta=8,og=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class ag{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Po(this.buffer[3])} ${Po(this.buffer[2])} ${Po(this.buffer[1])} ${Po(this.buffer[0])}`}static multiply(t,e){return new Dn(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Dn(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Dn.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Dn.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new Dn(e);for(let o=n?1:0;othis.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function Tr(r,t){return t instanceof r.constructor}function Ks(r,t){return r===t||Tr(r,t)}function Mi(r,t){return r===t||Tr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function ah(r,t){return r===t||Tr(r,t)&&r.precision===t.precision}function g4(r,t){return r===t||Tr(r,t)&&r.byteWidth===t.byteWidth}function lg(r,t){return r===t||Tr(r,t)&&r.unit===t.unit}function Ol(r,t){return r===t||Tr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function Pl(r,t){return r===t||Tr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function y4(r,t){return r===t||Tr(r,t)&&r.children.length===t.children.length&&Jn.compareManyFields(r.children,t.children)}function v4(r,t){return r===t||Tr(r,t)&&r.children.length===t.children.length&&Jn.compareManyFields(r.children,t.children)}function ug(r,t){return r===t||Tr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Jn.compareManyFields(r.children,t.children)}function _4(r,t){return r===t||Tr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Jn.visit(r.indices,t.indices)&&Jn.visit(r.dictionary,t.dictionary)}function cg(r,t){return r===t||Tr(r,t)&&r.unit===t.unit}function Rl(r,t){return r===t||Tr(r,t)&&r.unit===t.unit}function b4(r,t){return r===t||Tr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Jn.compareManyFields(r.children,t.children)}function x4(r,t){return r===t||Tr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Jn.compareManyFields(r.children,t.children)}jt.prototype.visitNull=Ks;jt.prototype.visitBool=Ks;jt.prototype.visitInt=Mi;jt.prototype.visitInt8=Mi;jt.prototype.visitInt16=Mi;jt.prototype.visitInt32=Mi;jt.prototype.visitInt64=Mi;jt.prototype.visitUint8=Mi;jt.prototype.visitUint16=Mi;jt.prototype.visitUint32=Mi;jt.prototype.visitUint64=Mi;jt.prototype.visitFloat=ah;jt.prototype.visitFloat16=ah;jt.prototype.visitFloat32=ah;jt.prototype.visitFloat64=ah;jt.prototype.visitUtf8=Ks;jt.prototype.visitLargeUtf8=Ks;jt.prototype.visitBinary=Ks;jt.prototype.visitLargeBinary=Ks;jt.prototype.visitFixedSizeBinary=g4;jt.prototype.visitDate=lg;jt.prototype.visitDateDay=lg;jt.prototype.visitDateMillisecond=lg;jt.prototype.visitTimestamp=Ol;jt.prototype.visitTimestampSecond=Ol;jt.prototype.visitTimestampMillisecond=Ol;jt.prototype.visitTimestampMicrosecond=Ol;jt.prototype.visitTimestampNanosecond=Ol;jt.prototype.visitTime=Pl;jt.prototype.visitTimeSecond=Pl;jt.prototype.visitTimeMillisecond=Pl;jt.prototype.visitTimeMicrosecond=Pl;jt.prototype.visitTimeNanosecond=Pl;jt.prototype.visitDecimal=Ks;jt.prototype.visitList=y4;jt.prototype.visitStruct=v4;jt.prototype.visitUnion=ug;jt.prototype.visitDenseUnion=ug;jt.prototype.visitSparseUnion=ug;jt.prototype.visitDictionary=_4;jt.prototype.visitInterval=cg;jt.prototype.visitIntervalDayTime=cg;jt.prototype.visitIntervalYearMonth=cg;jt.prototype.visitDuration=Rl;jt.prototype.visitDurationSecond=Rl;jt.prototype.visitDurationMillisecond=Rl;jt.prototype.visitDurationMicrosecond=Rl;jt.prototype.visitDurationNanosecond=Rl;jt.prototype.visitFixedSizeList=b4;jt.prototype.visitMap=x4;const Jn=new jt;function w4(r,t){return Jn.compareSchemas(r,t)}function S4(r,t){return Jn.compareFields(r,t)}function T4(r,t){return Jn.visit(r,t)}const e_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},tU),m4),r4),nU),qk),t4),Zk),{compareSchemas:w4,compareFields:S4,compareTypes:T4}),HI=6048e5,I4=864e5,r_=Symbol.for("constructDateFrom");function vi(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&r_ in r?r[r_](t):r instanceof Date?new r.constructor(t):new Date(t)}function mn(r,t){return vi(t||r,r)}let M4={};function lh(){return M4}function gl(r,t){var a,l,u,c;const e=lh(),n=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=mn(r,t==null?void 0:t.in),s=i.getDay(),o=(s=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function n_(r){const t=mn(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 E4(r,...t){const e=vi.bind(null,t.find(n=>typeof n=="object"));return t.map(e)}function i_(r,t){const e=mn(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function A4(r,t,e){const[n,i]=E4(e==null?void 0:e.in,r,t),s=i_(n),o=i_(i),a=+s-n_(s),l=+o-n_(o);return Math.round((a-l)/I4)}function C4(r,t){const e=XI(r,t),n=vi(r,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Mc(n)}function O4(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function P4(r){return!(!O4(r)&&typeof r!="number"||isNaN(+mn(r)))}function R4(r,t){const e=mn(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const F4={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"}},D4=(r,t,e)=>{let n;const i=F4[r];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function ef(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const L4={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},N4={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},B4={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},k4={date:ef({formats:L4,defaultWidth:"full"}),time:ef({formats:N4,defaultWidth:"full"}),dateTime:ef({formats:B4,defaultWidth:"full"})},U4={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},z4=(r,t,e,n)=>U4[r];function Aa(r){return(t,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let i;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;i=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;i=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return i[s]}}const V4={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},j4={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$4={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"]},G4={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"]},W4={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"}},H4={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"}},X4=(r,t)=>{const e=Number(r),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Y4={ordinalNumber:X4,era:Aa({values:V4,defaultWidth:"wide"}),quarter:Aa({values:j4,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Aa({values:$4,defaultWidth:"wide"}),day:Aa({values:G4,defaultWidth:"wide"}),dayPeriod:Aa({values:W4,defaultWidth:"wide",formattingValues:H4,defaultFormattingWidth:"wide"})};function Ca(r){return(t,e={})=>{const n=e.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?Q4(a,h=>h.test(o)):q4(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 q4(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function Q4(r,t){for(let e=0;e{const n=t.match(r.matchPattern);if(!n)return null;const i=n[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const K4=/^(\d+)(th|st|nd|rd)?/i,J4=/\d+/i,t6={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},e6={any:[/^b/i,/^(a|c)/i]},r6={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},n6={any:[/1/i,/2/i,/3/i,/4/i]},i6={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},s6={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]},o6={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},a6={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]},l6={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},u6={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}},c6={ordinalNumber:Z4({matchPattern:K4,parsePattern:J4,valueCallback:r=>parseInt(r,10)}),era:Ca({matchPatterns:t6,defaultMatchWidth:"wide",parsePatterns:e6,defaultParseWidth:"any"}),quarter:Ca({matchPatterns:r6,defaultMatchWidth:"wide",parsePatterns:n6,defaultParseWidth:"any",valueCallback:r=>r+1}),month:Ca({matchPatterns:i6,defaultMatchWidth:"wide",parsePatterns:s6,defaultParseWidth:"any"}),day:Ca({matchPatterns:o6,defaultMatchWidth:"wide",parsePatterns:a6,defaultParseWidth:"any"}),dayPeriod:Ca({matchPatterns:l6,defaultMatchWidth:"any",parsePatterns:u6,defaultParseWidth:"any"})},h6={code:"en-US",formatDistance:D4,formatLong:k4,formatRelative:z4,localize:Y4,match:c6,options:{weekStartsOn:0,firstWeekContainsDate:1}};function d6(r,t){const e=mn(r,t==null?void 0:t.in);return A4(e,R4(e))+1}function f6(r,t){const e=mn(r,t==null?void 0:t.in),n=+Mc(e)-+C4(e);return Math.round(n/HI)+1}function YI(r,t){var c,h,f,d;const e=mn(r,t==null?void 0:t.in),n=e.getFullYear(),i=lh(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((d=(f=i.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,o=vi((t==null?void 0:t.in)||r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const a=gl(o,t),l=vi((t==null?void 0:t.in)||r,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const u=gl(l,t);return+e>=+a?n+1:+e>=+u?n:n-1}function p6(r,t){var a,l,u,c;const e=lh(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=YI(r,t),s=vi((t==null?void 0:t.in)||r,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),gl(s,t)}function m6(r,t){const e=mn(r,t==null?void 0:t.in),n=+gl(e,t)-+p6(e,t);return Math.round(n/HI)+1}function Ie(r,t){const e=r<0?"-":"",n=Math.abs(r).toString().padStart(t,"0");return e+n}const Ri={y(r,t){const e=r.getFullYear(),n=e>0?e:1-e;return Ie(t==="yy"?n%100:n,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):Ie(e+1,2)},d(r,t){return Ie(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 Ie(r.getHours()%12||12,t.length)},H(r,t){return Ie(r.getHours(),t.length)},m(r,t){return Ie(r.getMinutes(),t.length)},s(r,t){return Ie(r.getSeconds(),t.length)},S(r,t){const e=t.length,n=r.getMilliseconds(),i=Math.trunc(n*Math.pow(10,e-3));return Ie(i,t.length)}},co={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},s_={G:function(r,t,e){const n=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const n=r.getFullYear(),i=n>0?n:1-n;return e.ordinalNumber(i,{unit:"year"})}return Ri.y(r,t)},Y:function(r,t,e,n){const i=YI(r,n),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return Ie(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Ie(s,t.length)},R:function(r,t){const e=XI(r);return Ie(e,t.length)},u:function(r,t){const e=r.getFullYear();return Ie(e,t.length)},Q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Ie(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Ie(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,t,e){const n=r.getMonth();switch(t){case"M":case"MM":return Ri.M(r,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(r,t,e){const n=r.getMonth();switch(t){case"L":return String(n+1);case"LL":return Ie(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(r,t,e,n){const i=m6(r,n);return t==="wo"?e.ordinalNumber(i,{unit:"week"}):Ie(i,t.length)},I:function(r,t,e){const n=f6(r);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):Ie(n,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):Ri.d(r,t)},D:function(r,t,e){const n=d6(r);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):Ie(n,t.length)},E:function(r,t,e){const n=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ie(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ie(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,e){const n=r.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return Ie(i,t.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(r,t,e){const i=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,e){const n=r.getHours();let i;switch(n===12?i=co.noon:n===0?i=co.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,e){const n=r.getHours();let i;switch(n>=17?i=co.evening:n>=12?i=co.afternoon:n>=4?i=co.morning:i=co.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let n=r.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return Ri.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):Ri.H(r,t)},K:function(r,t,e){const n=r.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):Ie(n,t.length)},k:function(r,t,e){let n=r.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):Ie(n,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):Ri.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):Ri.s(r,t)},S:function(r,t){return Ri.S(r,t)},X:function(r,t,e){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return a_(n);case"XXXX":case"XX":return Is(n);case"XXXXX":case"XXX":default:return Is(n,":")}},x:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"x":return a_(n);case"xxxx":case"xx":return Is(n);case"xxxxx":case"xxx":default:return Is(n,":")}},O:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+o_(n,":");case"OOOO":default:return"GMT"+Is(n,":")}},z:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+o_(n,":");case"zzzz":default:return"GMT"+Is(n,":")}},t:function(r,t,e){const n=Math.trunc(+r/1e3);return Ie(n,t.length)},T:function(r,t,e){return Ie(+r,t.length)}};function o_(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Math.trunc(n/60),s=n%60;return s===0?e+String(i):e+String(i)+t+Ie(s,2)}function a_(r,t){return r%60===0?(r>0?"-":"+")+Ie(Math.abs(r)/60,2):Is(r,t)}function Is(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Ie(Math.trunc(n/60),2),s=Ie(n%60,2);return e+i+t+s}const l_=(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"})}},qI=(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"})}},g6=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],n=e[1],i=e[2];if(!i)return l_(r,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",l_(n,t)).replace("{{time}}",qI(i,t))},y6={p:qI,P:g6},v6=/^D+$/,_6=/^Y+$/,b6=["D","DD","YY","YYYY"];function x6(r){return v6.test(r)}function w6(r){return _6.test(r)}function S6(r,t,e){const n=T6(r,t,e);if(console.warn(n),b6.includes(r))throw new RangeError(n)}function T6(r,t,e){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const I6=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,M6=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,E6=/^'([^]*?)'?$/,A6=/''/g,C6=/[a-zA-Z]/;function QI(r,t,e){var c,h,f,d;const n=lh(),i=n.locale??h6,s=n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,a=mn(r,e==null?void 0:e.in);if(!P4(a))throw new RangeError("Invalid time value");let l=t.match(M6).map(m=>{const g=m[0];if(g==="p"||g==="P"){const p=y6[g];return p(m,i.formatLong)}return m}).join("").match(I6).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const g=m[0];if(g==="'")return{isToken:!1,value:O6(m)};if(s_[g])return{isToken:!0,value:m};if(g.match(C6))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(m=>{if(!m.isToken)return m.value;const g=m.value;(w6(g)||x6(g))&&S6(g,t,String(r));const p=s_[g[0]];return p(a,g,i.localize,u)}).join("")}function O6(r){const t=r.match(E6);return t?t[1].replace(A6,"'"):r}function P6(r,t){return mn(r*1e3,t==null?void 0:t.in)}function R6(r,t){const e=F6(t)?new t(0):vi(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function F6(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function D6(r,t){let e=r.length;switch("string"){case"string":{for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function Rr(r){return r==null}function L6(r){return r!=null}async function ZI(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await Bi(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function N6(r){return Rr(r)?!1:Pt.isInt(r.type)&&!KI(r)||B6(r)}function B6(r){return Rr(r)?!1:Pt.isInt(r.type)&&r.type.isSigned===!1}function k6(r){return Rr(r)?!1:Pt.isFloat(r.type)??!1}function U6(r){return Rr(r)?!1:Pt.isDecimal(r.type)}function z6(r){return Rr(r)?!1:Pt.isBool(r.type)}function V6(r){return Rr(r)?!1:Pt.isDuration(r.type)}function KI(r){return Rr(r)?!1:Pt.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function j6(r){return Rr(r)?!1:Pt.isTimestamp(r.type)}function $6(r){return Rr(r)?!1:Pt.isDate(r.type)}function G6(r){return Rr(r)?!1:Pt.isTime(r.type)}function W6(r){return Rr(r)?!1:Pt.isList(r.type)||Pt.isFixedSizeList(r.type)}function H6(r){return Rr(r)?!1:Pt.isStruct(r.type)||Pt.isMap(r.type)}function X6(r){return Rr(r)?!1:Pt.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Pt.isInterval(r.type)}function Y6(r,t){let e;if(t===ne.MILLISECOND)e=1e3;else if(t===ne.MICROSECOND)e=1e3*1e3;else if(t===ne.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 q6(r,t){var n;const e=Y6(r,((n=t==null?void 0:t.type)==null?void 0:n.unit)??ne.SECOND);return P6(e)}function Q6(r,t){const e=q6(r,t);return QI(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function Z6(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?QI(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function K6(r,t){var i;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const n=(i=t==null?void 0:t.type)==null?void 0:i.timezone;return typeof r=="number"?n?e=new Vr(r,n):e=new Vr(r):n?e=new Vr(r,n):e=new Vr(r),R6(e,Date)}function J6(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let n=e_.bigNumToString(new e_.BN(r)).padStart(e,"0");if(e===0)return n;let i="";n.startsWith("-")&&(i="-",n=n.slice(1));const s=n.slice(0,-e)||"0",o=D6(n.slice(-e),"0")||"";return`${i}${s}${o?`.${o}`:""}`}function t5(r){const t=r[0],e=r[1],n=[];return t!==0&&n.push(`${t} year${t>1?"s":""}`),e!==0&&n.push(`${e} month${e>1?"s":""}`),n.length?n.join(" "):"0 months"}function e5(r,t){var n,i,s,o;if(Pt.isInterval(t==null?void 0:t.type))return t5(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",f=Np(u.left,(i=(n=t.type)==null?void 0:n.children)==null?void 0:i[0]),d=Np(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+f}, ${d+h}`}return String(r)}function r5(r,t){return(t==null?void 0:t.type)instanceof Fp?JSON.parse(JSON.stringify(r,(e,n)=>{if(L6(n))return typeof n=="bigint"?Number(n):n})):JSON.parse(JSON.stringify(r,(e,n)=>typeof n=="bigint"?Number(n):n))}function Np(r,t){if(Rr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&$6(t))return Z6(r);if(typeof r=="bigint"&&G6(t))return Q6(Number(r),t);if(e&&j6(t))return K6(r,t);if(KI(t))throw new Error("Period type is not supported yet");if(X6(t))return e5(r,t);if(V6(t))throw new Error("Duration type is not supported yet");return U6(t)?J6(r,t):k6(t)&&Number.isFinite(r)||N6(t)?r:H6(t)||W6(t)?r5(r,t):z6(t)?!!r:String(r)}function u_(r){return((r.toArray()||[]).map(n=>n.toJSON())||[]).map(n=>(r.schema.fields.forEach(i=>n[i.name]=Np(n[i.name],i)),n))}var yl=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(yl||{});async function JI(r){const t=nE(r,{logger:!1});let e,n;const i=await ZI();if(i==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await Bi(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}n=await I0(await t.bundles),e=new Worker(n.mainWorker)}else if(i==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await Bi(async()=>{const{getBundles:h}=await import("./default-node-C-2Juvjq.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}n=await I0(await t.bundles);let l=n.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await Bi(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${i}`);let s;t.logger===!0?s=new dT:t.logger===!1?s=new WB:s=t.logger;const o=new KB(s,e);if(await o.instantiate(n.mainModule,n.pthreadWorker),t.storage)switch(t.storage.type){case yl.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 yl.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(l){throw await o.terminate(),await e.terminate(),l}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(l,u=[])=>{if(!u||u.length===0){const d=await a.query(l);return u_(d)}const c=await a.prepare(l),h=await c.query(...u),f=u_(h);return c.close(),f},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function n5(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 i5(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const n=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),n}catch(n){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const It=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,It))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(It in e&&e[It]===t[It])return!0;e=Object.getPrototypeOf(e)}return!1}var b_;b_=It;class ur{constructor(t,e){W(this,"name");W(this,"keyAsName");W(this,"primary");W(this,"notNull");W(this,"default");W(this,"defaultFn");W(this,"onUpdateFn");W(this,"hasDefault");W(this,"isUnique");W(this,"uniqueName");W(this,"uniqueType");W(this,"dataType");W(this,"columnType");W(this,"enumValues");W(this,"generated");W(this,"generatedIdentity");W(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}W(ur,b_,"Column");const Go=Symbol.for("drizzle:Name");function s5(r,t){return`${r[Go]}_${t.join("_")}_unique`}var x_,w_;class $r extends(w_=ur,x_=It,w_){constructor(t,e){e.uniqueName||(e.uniqueName=s5(t,[e.name])),super(t,e),this.table=t}}W($r,x_,"PgColumn");const c_=Symbol.for("drizzle:isPgEnum");function o5(r){return!!r&&typeof r=="function"&&c_ in r&&r[c_]===!0}var S_;S_=It;class Gr{constructor(t,e,n,i=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:n,isWith:i}}}W(Gr,S_,"Subquery");var T_,I_;class hg extends(I_=Gr,T_=It,I_){}W(hg,T_,"WithSubquery");const Hr={startActiveSpan(r,t){return t()}},er=Symbol.for("drizzle:ViewBaseConfig"),Au=Symbol.for("drizzle:Schema"),Bp=Symbol.for("drizzle:Columns"),h_=Symbol.for("drizzle:ExtraConfigColumns"),rf=Symbol.for("drizzle:OriginalName"),nf=Symbol.for("drizzle:BaseName"),Ec=Symbol.for("drizzle:IsAlias"),d_=Symbol.for("drizzle:ExtraConfigBuilder"),a5=Symbol.for("drizzle:IsDrizzleTable");var M_,E_,A_,C_,O_,P_,R_,F_,D_,L_;L_=It,D_=Go,F_=rf,R_=Au,P_=Bp,O_=h_,C_=nf,A_=Ec,E_=a5,M_=d_;class Mt{constructor(t,e,n){W(this,D_);W(this,F_);W(this,R_);W(this,P_);W(this,O_);W(this,C_);W(this,A_,!1);W(this,E_,!0);W(this,M_);this[Go]=this[rf]=t,this[Au]=e,this[nf]=n}}W(Mt,L_,"Table"),W(Mt,"Symbol",{Name:Go,Schema:Au,OriginalName:rf,Columns:Bp,ExtraConfigColumns:h_,BaseName:nf,IsAlias:Ec,ExtraConfigBuilder:d_});function Rs(r){return r[Go]}function vl(r){return`${r[Au]??"public"}.${r[Go]}`}function tM(r){return r!=null&&typeof r.getSQL=="function"}function l5(r){var e;const t={sql:"",params:[]};for(const n of r)t.sql+=n.sql,t.params.push(...n.params),(e=n.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var N_;N_=It;class nr{constructor(t){W(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ft([this])}}W(nr,N_,"StringChunk");var B_;B_=It;const As=class As{constructor(t){W(this,"decoder",eM);W(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Hr.startActiveSpan("drizzle.buildSQL",e=>{const n=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,e){const n=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:i,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=n;return l5(t.map(c=>{var h;if(lt(c,nr))return{sql:c.value.join(""),params:[]};if(lt(c,Ac))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const f=[new nr("(")];for(const[d,m]of c.entries())f.push(m),dr},rM={mapToDriverValue:r=>r};({...eM,...rM});var U_;U_=It;class _i{constructor(t,e=rM){W(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ft([this])}}W(_i,U_,"Param");function Y(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new nr(r[0]));for(const[n,i]of t.entries())e.push(i,new nr(r[n+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 n(l){return new Ft([new nr(l)])}r.raw=n;function i(l,u){const c=[];for(const[h,f]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(f);return new Ft(c)}r.join=i;function s(l){return new Ac(l)}r.identifier=s;function o(l){return new $s(l)}r.placeholder=o;function a(l,u){return new _i(l,u)}r.param=a})(Y||(Y={}));(r=>{var e;e=It;const n=class n{constructor(s,o){W(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}};W(n,e,"SQL.Aliased");let t=n;r.Aliased=t})(Ft||(Ft={}));var z_;z_=It;class $s{constructor(t){this.name=t}getSQL(){return new Ft([this])}}W($s,z_,"Placeholder");function f_(r,t){return r.map(e=>{if(lt(e,$s)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,_i)&<(e.value,$s)){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 c5=Symbol.for("drizzle:IsDrizzleView");var V_,j_,$_;$_=It,j_=er,V_=c5;class rs{constructor({name:t,schema:e,selectedFields:n,query:i}){W(this,j_);W(this,V_,!0);this[er]={name:t,originalName:t,schema:e,selectedFields:n,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new Ft([this])}}W(rs,$_,"View");ur.prototype.getSQL=function(){return new Ft([this])};Mt.prototype.getSQL=function(){return new Ft([this])};Gr.prototype.getSQL=function(){return new Ft([this])};var G_;G_=It;class _l{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}W(_l,G_,"ColumnAliasProxyHandler");var W_;W_=It;class uh{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===Mt.Symbol.IsAlias)return!0;if(e===Mt.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===Mt.Symbol.OriginalName)return this.alias;if(e===er)return{...t[er],name:this.alias,isAlias:!0};if(e===Mt.Symbol.Columns){const i=t[Mt.Symbol.Columns];if(!i)return i;const s={};return Object.keys(i).map(o=>{s[o]=new Proxy(i[o],new _l(new Proxy(t,this)))}),s}const n=t[e];return lt(n,ur)?new Proxy(n,new _l(new Proxy(t,this))):n}}W(uh,W_,"TableAliasProxyHandler");function sf(r,t){return new Proxy(r,new uh(t,!1))}function ci(r,t){return new Proxy(r,new _l(new Proxy(r.table,new uh(t,!1))))}function nM(r,t){return new Ft.Aliased(Cc(r.sql,t),r.fieldAlias)}function Cc(r,t){return Y.join(r.queryChunks.map(e=>lt(e,ur)?ci(e,t):lt(e,Ft)?Cc(e,t):lt(e,Ft.Aliased)?nM(e,t):e))}var H_,X_;class dg extends(X_=Error,H_=It,X_){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}W(dg,H_,"DrizzleError");var Y_,q_;class iM extends(q_=dg,Y_=It,q_){constructor(){super({message:"Rollback"})}}W(iM,Y_,"TransactionRollbackError");function Pr(r,t){return u5(t)&&!tM(r)&&!lt(r,_i)&&!lt(r,$s)&&!lt(r,ur)&&!lt(r,Mt)&&!lt(r,rs)?new _i(r,t):r}const sM=(r,t)=>Y`${r} = ${Pr(t,r)}`,h5=(r,t)=>Y`${r} <> ${Pr(t,r)}`;function kp(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new nr("("),Y.join(t,new nr(" and ")),new nr(")")])}function d5(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new nr("("),Y.join(t,new nr(" or ")),new nr(")")])}function f5(r){return Y`not ${r}`}const p5=(r,t)=>Y`${r} > ${Pr(t,r)}`,m5=(r,t)=>Y`${r} >= ${Pr(t,r)}`,g5=(r,t)=>Y`${r} < ${Pr(t,r)}`,y5=(r,t)=>Y`${r} <= ${Pr(t,r)}`;function v5(r,t){return Array.isArray(t)?t.length===0?Y`false`:Y`${r} in ${t.map(e=>Pr(e,r))}`:Y`${r} in ${Pr(t,r)}`}function _5(r,t){return Array.isArray(t)?t.length===0?Y`true`:Y`${r} not in ${t.map(e=>Pr(e,r))}`:Y`${r} not in ${Pr(t,r)}`}function b5(r){return Y`${r} is null`}function x5(r){return Y`${r} is not null`}function w5(r){return Y`exists ${r}`}function S5(r){return Y`not exists ${r}`}function T5(r,t,e){return Y`${r} between ${Pr(t,r)} and ${Pr(e,r)}`}function I5(r,t,e){return Y`${r} not between ${Pr(t,r)} and ${Pr(e,r)}`}function M5(r,t){return Y`${r} like ${t}`}function E5(r,t){return Y`${r} not like ${t}`}function A5(r,t){return Y`${r} ilike ${t}`}function C5(r,t){return Y`${r} not ilike ${t}`}function O5(r){return Y`${r} asc`}function P5(r){return Y`${r} desc`}var Q_;Q_=It;class oM{write(t){console.log(t)}}W(oM,Q_,"ConsoleLogWriter");var Z_;Z_=It;class aM{constructor(t){W(this,"writer");this.writer=(t==null?void 0:t.writer)??new oM}logQuery(t,e){const n=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),i=n.length?` -- params: [${n.join(", ")}]`:"";this.writer.write(`Query: ${t}${i}`)}}W(aM,Z_,"DefaultLogger");var K_;K_=It;class lM{logQuery(){}}W(lM,K_,"NoopLogger");var J_,tb;tb=It,J_=Symbol.toStringTag;class ns{constructor(){W(this,J_,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}W(ns,tb,"QueryPromise");function Gs(r,t){return Object.entries(r).reduce((e,[n,i])=>{if(typeof n!="string")return e;const s=t?[...t,n]:[n];return lt(i,ur)||lt(i,Ft)||lt(i,Ft.Aliased)?e.push({path:s,field:i}):lt(i,Mt)?e.push(...Gs(i[Mt.Symbol.Columns],s)):e.push(...Gs(i,s)),e},[])}function fg(r,t){const e=Object.keys(r),n=Object.keys(t);if(e.length!==n.length)return!1;for(const[i,s]of e.entries())if(s!==n[i])return!1;return!0}function uM(r,t){const e=Object.entries(t).filter(([,n])=>n!==void 0).map(([n,i])=>lt(i,Ft)||lt(i,ur)?[n,i]:[n,new _i(i,r[Mt.Symbol.Columns][n])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function R5(r,t){for(const e of t)for(const n of Object.getOwnPropertyNames(e.prototype))n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n)||Object.create(null))}function F5(r){return r[Mt.Symbol.Columns]}function Es(r){return lt(r,Gr)?r._.alias:lt(r,rs)?r[er].name:lt(r,Ft)?void 0:r[Mt.Symbol.IsAlias]?r[Mt.Symbol.Name]:r[Mt.Symbol.BaseName]}function D5(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.logger;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.logger;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 eb,rb;class cM extends(rb=$r,eb=It,rb){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}W(cM,eb,"PgDate");var nb,ib;class hM extends(ib=$r,nb=It,ib){getSQLType(){return"date"}}W(hM,nb,"PgDateString");var sb,ob;class dM extends(ob=$r,sb=It,ob){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(dM,sb,"PgJson");var ab,lb;class fM extends(lb=$r,ab=It,lb){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(fM,ab,"PgJsonb");var ub,cb;class pM extends(cb=$r,ub=It,cb){constructor(e,n){super(e,n);W(this,"precision");W(this,"scale");this.precision=n.precision,this.scale=n.scale}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}W(pM,ub,"PgNumeric");var hb,db;class mM extends(db=$r,hb=It,db){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(mM,hb,"PgTime");var fb,pb;class gM extends(pb=$r,fb=It,pb){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");W(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));W(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(gM,fb,"PgTimestamp");var mb,gb;class yM extends(gb=$r,mb=It,gb){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(yM,mb,"PgTimestampString");var yb,vb;class vM extends(vb=$r,yb=It,vb){getSQLType(){return"uuid"}}W(vM,yb,"PgUUID");const p_=Symbol.for("drizzle:PgInlineForeignKeys"),m_=Symbol.for("drizzle:EnableRLS");var _b,bb,xb,wb,Sb,Tb;class en extends(Tb=Mt,Sb=It,wb=p_,xb=m_,bb=Mt.Symbol.ExtraConfigBuilder,_b=Mt.Symbol.ExtraConfigColumns,Tb){constructor(){super(...arguments);W(this,wb,[]);W(this,xb,!1);W(this,bb);W(this,_b,{})}}W(en,Sb,"PgTable"),W(en,"Symbol",Object.assign({},Mt.Symbol,{InlineForeignKeys:p_,EnableRLS:m_}));var Ib;Ib=It;class _M{constructor(t,e){W(this,"columns");W(this,"name");this.columns=t,this.name=e}build(t){return new bM(t,this.columns,this.name)}}W(_M,Ib,"PgPrimaryKeyBuilder");var Mb;Mb=It;class bM{constructor(t,e,n){W(this,"columns");W(this,"name");this.table=t,this.columns=e,this.name=n}getName(){return this.name??`${this.table[en.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}W(bM,Mb,"PgPrimaryKey");var Eb;Eb=It;class pg{constructor(t,e,n){W(this,"referencedTableName");W(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=n,this.referencedTableName=e[Mt.Symbol.Name]}}W(pg,Eb,"Relation");var Ab;Ab=It;class xM{constructor(t,e){this.table=t,this.config=e}}W(xM,Ab,"Relations");var Cb,Ob;const Rc=class Rc extends(Ob=pg,Cb=It,Ob){constructor(t,e,n,i){super(t,e,n==null?void 0:n.relationName),this.config=n,this.isNullable=i}withFieldName(t){const e=new Rc(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};W(Rc,Cb,"One");let Ws=Rc;var Pb,Rb;const Fc=class Fc extends(Rb=pg,Pb=It,Rb){constructor(t,e,n){super(t,e,n==null?void 0:n.relationName),this.config=n}withFieldName(t){const e=new Fc(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};W(Fc,Pb,"Many");let Oc=Fc;function L5(){return{and:kp,between:T5,eq:sM,exists:w5,gt:p5,gte:m5,ilike:A5,inArray:v5,isNull:b5,isNotNull:x5,like:M5,lt:g5,lte:y5,ne:h5,not:f5,notBetween:I5,notExists:S5,notLike:E5,notIlike:C5,notInArray:_5,or:d5,sql:Y}}function N5(){return{sql:Y,asc:O5,desc:P5}}function B5(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,Mt)&&(r=r.default);const e={},n={},i={};for(const[o,a]of Object.entries(r))if(lt(a,Mt)){const l=vl(a),u=n[l];e[l]=o,i[o]={tsName:o,dbName:a[Mt.Symbol.Name],schema:a[Mt.Symbol.Schema],columns:a[Mt.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[Mt.Symbol.Columns]))h.primary&&i[o].primaryKey.push(h);const c=(s=a[Mt.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[Mt.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,_M)&&i[o].primaryKey.push(...h.columns)}else if(lt(a,xM)){const l=vl(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[f,d]of Object.entries(c))if(u){const m=i[u];m.relations[f]=d}else l in n||(n[l]={relations:{},primaryKey:h}),n[l].relations[f]=d}return{tables:i,tableNamesMap:e}}function k5(r){return function(e,n){return new Ws(r,e,n,(n==null?void 0:n.fields.reduce((i,s)=>i&&s.notNull,!0))??!1)}}function U5(r){return function(e,n){return new Oc(r,e,n)}}function z5(r,t,e){if(lt(e,Ws)&&e.config)return{fields:e.config.fields,references:e.config.references};const n=t[vl(e.referencedTable)];if(!n)throw new Error(`Table "${e.referencedTable[Mt.Symbol.Name]}" not found in schema`);const i=r[n];if(!i)throw new Error(`Table "${n}" not found in schema`);const s=e.sourceTable,o=t[vl(s)];if(!o)throw new Error(`Table "${s[Mt.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(i.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${n}"`):new Error(`There are multiple relations between "${n}" and "${e.sourceTable[Mt.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],Ws)&&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 V5(r){return{one:k5(r),many:U5(r)}}function Up(r,t,e,n,i=s=>s){const s={};for(const[o,a]of n.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=lt(l,Ws)?c&&Up(r,r[a.relationTableTsKey],c,a.selection,i):c.map(h=>Up(r,r[a.relationTableTsKey],h,a.selection,i))}else{const l=i(e[o]),u=a.field;let c;lt(u,ur)?c=u:lt(u,Ft)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var Fb;Fb=It;const Dc=class Dc{constructor(t){W(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===er)return{...t[er],selectedFields:new Proxy(t[er].selectedFields,this)};if(typeof e=="symbol")return t[e];const i=(lt(t,Gr)?t._.selectedFields:lt(t,rs)?t[er].selectedFields:t)[e];if(lt(i,Ft.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!i.isSelectionField)return i.sql;const s=i.clone();return s.isSelectionField=!0,s}if(lt(i,Ft)){if(this.config.sqlBehavior==="sql")return i;throw new Error(`You tried to reference "${e}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return lt(i,ur)?this.config.alias?new Proxy(i,new _l(new Proxy(i.table,new uh(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!="object"||i===null?i:new Proxy(i,new Dc(this.config))}};W(Dc,Fb,"SelectionProxyHandler");let pr=Dc;var Db,Lb;class zp extends(Lb=ns,Db=It,Lb){constructor(e,n,i,s){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[Mt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Gs(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Hr.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 pr({alias:Rs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(zp,Db,"PgDelete");function j5(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function $5(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,n,i)=>{const s=i===0?n.toLowerCase():`${n[0].toUpperCase()}${n.slice(1)}`;return e+s},"")}function G5(r){return r}var Nb;Nb=It;class wM{constructor(t){W(this,"cache",{});W(this,"cachedTables",{});W(this,"convert");this.convert=t==="snake_case"?j5:t==="camelCase"?$5:G5}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[Mt.Symbol.Schema]??"public",n=t.table[Mt.Symbol.OriginalName],i=`${e}.${n}.${t.name}`;return this.cache[i]||this.cacheTable(t.table),this.cache[i]}cacheTable(t){const e=t[Mt.Symbol.Schema]??"public",n=t[Mt.Symbol.OriginalName],i=`${e}.${n}`;if(!this.cachedTables[i]){for(const s of Object.values(t[Mt.Symbol.Columns])){const o=`${i}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[i]=!0}}clearCache(){this.cache={},this.cachedTables={}}}W(wM,Nb,"CasingCache");var Bb,kb;class mg extends(kb=rs,Bb=It,kb){}W(mg,Bb,"PgViewBase");var Ub;Ub=It;class Qa{constructor(t){W(this,"casing");this.casing=new wM(t==null?void 0:t.casing)}async migrate(t,e,n){const i=typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",s=typeof n=="string"?"drizzle":n.migrationsSchema??"drizzle",o=Y` CREATE TABLE IF NOT EXISTS ${Y.identifier(s)}.${Y.identifier(i)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint ) - `;await e.execute(Y`CREATE SCHEMA IF NOT EXISTS ${Y.identifier(s)}`),await e.execute(o);const l=(await e.all(Y`select id, hash, created_at from ${Y.identifier(s)}.${Y.identifier(i)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=n[o])==null?void 0:a.onUpdateFn)!==void 0}),s=i.length;return Y.join(i.flatMap((o,a)=>{const l=n[o],u=e[o]??Y.param(l.onUpdateFn(),l),c=Y`${Y.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Ft.Aliased)&&s.isSelectionField)a.push(Y.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,$r)?Y.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Ft.Aliased)&&a.push(Y` as ${Y.identifier(s.fieldAlias)}`)}else lt(s,ur)&&(e?a.push(Y.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:P})=>P===(nt[Mt.Symbol.IsAlias]?Rs(nt):nt[Mt.Symbol.BaseName])))(w.field.table)){const nt=Rs(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${nt}"."${w.field.name}", but the table "${nt}" is not part of the query! Did you forget to join it?`)}const p=!a||a.length===0,y=this.buildWithCTE(t);let v;d&&(v=d===!0?Y` distinct`:Y` distinct on (${Y.join(d.on,Y`, `)})`);const S=this.buildSelection(g,{isSingleTable:p}),T=this.buildFromTable(o),_=this.buildJoins(a),M=i?Y` where ${i}`:void 0,x=s?Y` having ${s}`:void 0;let N;l&&l.length>0&&(N=Y` order by ${Y.join(l,Y`, `)}`);let L;u&&u.length>0&&(L=Y` group by ${Y.join(u,Y`, `)}`);const j=typeof c=="object"||typeof c=="number"&&c>=0?Y` limit ${c}`:void 0,it=h?Y` offset ${h}`:void 0,I=Y.empty();if(f){const w=Y` for ${Y.raw(f.strength)}`;f.config.of&&w.append(Y` of ${Y.join(Array.isArray(f.config.of)?f.config.of:[f.config.of],Y`, `)}`),f.config.noWait?w.append(Y` no wait`):f.config.skipLocked&&w.append(Y` skip locked`),I.append(w)}const Q=Y`${y}select${v} ${S} from ${T}${_}${M}${L}${x}${N}${j}${it}${I}`;return m.length>0?this.buildSetOperations(Q,m):Q}buildSetOperations(t,e){const[n,...i]=e;if(!n)throw new Error("Cannot pass undefined values to any set operator");return i.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:n}),i)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:n,rightSelect:i,limit:s,orderBy:o,offset:a}}){const l=Y`(${t.getSQL()}) `,u=Y`(${i.getSQL()})`;let c;if(o&&o.length>0){const m=[];for(const g of o)if(lt(g,$r))m.push(Y.identifier(g.name));else if(lt(g,Ft)){for(let p=0;p=0?Y` limit ${s}`:void 0,f=Y.raw(`${e} ${n?"all ":""}`),d=a?Y` offset ${a}`:void 0;return Y`${l}${f}${u}${c}${h}${d}`}buildInsertQuery({table:t,values:e,onConflict:n,returning:i,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[Mt.Symbol.Columns],c=Object.entries(u).filter(([y,v])=>!v.shouldDisableInsert()),h=c.map(([,y])=>Y.identifier(this.casing.getColumnCasing(y)));if(o){const y=e;lt(y,Ft)?l.push(y):l.push(y.getSQL())}else{const y=e;l.push(Y.raw("values "));for(const[v,S]of y.entries()){const T=[];for(const[_,M]of c){const x=S[_];if(x===void 0||lt(x,_i)&&x.value===void 0)if(M.defaultFn!==void 0){const N=M.defaultFn(),L=lt(N,Ft)?N:Y.param(N,M);T.push(L)}else if(!M.default&&M.onUpdateFn!==void 0){const N=M.onUpdateFn(),L=lt(N,Ft)?N:Y.param(N,M);T.push(L)}else T.push(Y`default`);else T.push(x)}l.push(T),v({dbKey:S.name,tsKey:v,field:ci(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const y=Object.fromEntries(Object.entries(s.columns).map(([x,N])=>[x,ci(N,a)]));if(o.where){const x=typeof o.where=="function"?o.where(y,L5()):o.where;m=x&&Cc(x,a)}const v=[];let S=[];if(o.columns){let x=!1;for(const[N,L]of Object.entries(o.columns))L!==void 0&&N in s.columns&&(!x&&L===!0&&(x=!0),S.push(N));S.length>0&&(S=x?S.filter(N=>{var L;return((L=o.columns)==null?void 0:L[N])===!0}):Object.keys(s.columns).filter(N=>!S.includes(N)))}else S=Object.keys(s.columns);for(const x of S){const N=s.columns[x];v.push({tsKey:x,value:N})}let T=[];o.with&&(T=Object.entries(o.with).filter(x=>!!x[1]).map(([x,N])=>({tsKey:x,queryConfig:N,relation:s.relations[x]})));let _;if(o.extras){_=typeof o.extras=="function"?o.extras(y,{sql:Y}):o.extras;for(const[x,N]of Object.entries(_))v.push({tsKey:x,value:nM(N,a)})}for(const{tsKey:x,value:N}of v)c.push({dbKey:lt(N,Ft.Aliased)?N.fieldAlias:s.columns[x].name,tsKey:x,field:lt(N,ur)?ci(N,a):N,relationTableTsKey:void 0,isJson:!1,selection:[]});let M=typeof o.orderBy=="function"?o.orderBy(y,N5()):o.orderBy??[];Array.isArray(M)||(M=[M]),d=M.map(x=>lt(x,ur)?ci(x,a):Cc(x,a)),h=o.limit,f=o.offset;for(const{tsKey:x,queryConfig:N,relation:L}of T){const j=z5(e,n,L),it=vl(L.referencedTable),I=n[it],Q=`${a}_${x}`,w=kp(...j.fields.map((C,R)=>sM(ci(j.references[R],Q),ci(C,a)))),nt=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:n,table:t[I],tableConfig:e[I],queryConfig:lt(L,Ws)?N===!0?{limit:1}:{...N,limit:1}:N,tableAlias:Q,joinOn:w,nestedQueryRelation:L}),P=Y`${Y.identifier(Q)}.${Y.identifier("data")}`.as(x);g.push({on:Y`true`,table:new Gr(nt.sql,{},Q),alias:Q,joinType:"left",lateral:!0}),c.push({dbKey:x,tsKey:x,field:P,relationTableTsKey:I,isJson:!0,selection:nt.selection})}}if(c.length===0)throw new dg({message:`No fields selected for table "${s.tsName}" ("${a}")`});let p;if(m=kp(u,m),l){let y=Y`json_build_array(${Y.join(c.map(({field:T,tsKey:_,isJson:M})=>M?Y`${Y.identifier(`${a}_${_}`)}.${Y.identifier("data")}`:lt(T,Ft.Aliased)?T.sql:T),Y`, `)})`;lt(l,Oc)&&(y=Y`coalesce(json_agg(${y}${d.length>0?Y` order by ${Y.join(d,Y`, `)}`:void 0}), '[]'::json)`);const v=[{dbKey:"data",tsKey:"data",field:y.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||f!==void 0||d.length>0?(p=this.buildSelectQuery({table:sf(i,a),fields:{},fieldsFlat:[{path:[],field:Y.raw("*")}],where:m,limit:h,offset:f,orderBy:d,setOperators:[]}),m=void 0,h=void 0,f=void 0,d=[]):p=sf(i,a),p=this.buildSelectQuery({table:lt(p,en)?p:new Gr(p,{},a),fields:{},fieldsFlat:v.map(({field:T})=>({path:[],field:lt(T,ur)?ci(T,a):T})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]})}else p=this.buildSelectQuery({table:sf(i,a),fields:{},fieldsFlat:c.map(({field:y})=>({path:[],field:lt(y,ur)?ci(y,a):y})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]});return{tableTsKey:s.tsName,sql:p,selection:c}}}W(Qa,Ub,"PgDialect");var zb;zb=It;class SM{getSelectedFields(){return this._.selectedFields}}W(SM,zb,"TypedQueryBuilder");var Vb;Vb=It;class kr{constructor(t){W(this,"fields");W(this,"session");W(this,"dialect");W(this,"withList",[]);W(this,"distinct");W(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,n=t;let i;return this.fields?i=this.fields:lt(n,Gr)?i=Object.fromEntries(Object.keys(n._.selectedFields).map(s=>[s,n[s]])):lt(n,mg)?i=n[er].selectedFields:lt(n,Ft)?i={}:i=F5(n),new gg({table:n,fields:i,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}W(kr,Vb,"PgSelectBuilder");var jb,$b;class TM extends($b=SM,jb=It,$b){constructor({table:e,fields:n,isPartialSelect:i,session:s,dialect:o,withList:a,distinct:l}){super();W(this,"_");W(this,"config");W(this,"joinsNotNullableMap");W(this,"tableName");W(this,"isPartialSelect");W(this,"session");W(this,"dialect");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"union",this.createSetOperator("union",!1));W(this,"unionAll",this.createSetOperator("union",!0));W(this,"intersect",this.createSetOperator("intersect",!1));W(this,"intersectAll",this.createSetOperator("intersect",!0));W(this,"except",this.createSetOperator("except",!1));W(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...n},distinct:l,setOperators:[]},this.isPartialSelect=i,this.session=s,this.dialect=o,this._={selectedFields:n},this.tableName=Es(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e){return(n,i)=>{var a;const s=this.tableName,o=Es(n);if(typeof o=="string"&&((a=this.config.joins)!=null&&a.some(l=>l.alias===o)))throw new Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof s=="string"&&(this.config.fields={[s]:this.config.fields}),typeof o=="string"&&!lt(n,Ft))){const l=lt(n,Gr)?n._.selectedFields:lt(n,rs)?n[er].selectedFields:n[Mt.Symbol.Columns];this.config.fields[o]=l}if(typeof i=="function"&&(i=i(new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:n,joinType:e,alias:o}),typeof o=="string")switch(e){case"left":{this.joinsNotNullableMap[o]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!0;break}case"inner":{this.joinsNotNullableMap[o]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!1;break}}return this}}createSetOperator(e,n){return i=>{const s=typeof i=="function"?i(W5()):i;if(!fg(this.getSelectedFields(),s.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:n,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(n)?n:[n]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(n)?n:[n];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else{const n=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,n={}){return this.config.lockingClause={strength:e,config:n},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}as(e){return new Proxy(new Gr(this.getSQL(),this.config.fields,e),new pr({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new pr({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}W(TM,jb,"PgSelectQueryBuilder");var Gb,Wb;class gg extends(Wb=TM,Gb=It,Wb){constructor(){super(...arguments);W(this,"authToken");W(this,"execute",e=>Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:n,config:i,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!n)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Hr.startActiveSpan("drizzle.prepareQuery",()=>{const l=Gs(i.fields),u=n.prepareQuery(s.sqlToQuery(this.getSQL()),l,e,!0);return u.joinsNotNullableMap=o,u.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(gg,Gb,"PgSelect");R5(gg,[ns]);function la(r,t){return(e,n,...i)=>{const s=[n,...i].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!fg(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 W5=()=>({union:H5,unionAll:X5,intersect:Y5,intersectAll:q5,except:Q5,exceptAll:Z5}),H5=la("union",!1),X5=la("union",!0),Y5=la("intersect",!1),q5=la("intersect",!0),Q5=la("except",!1),Z5=la("except",!0);var Hb;Hb=It;class yg{constructor(t){W(this,"dialect");W(this,"dialectConfig");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(n)),new Proxy(new hg(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new pr({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Qa)?t:void 0,this.dialectConfig=lt(t,Qa)?void 0:t}with(...t){const e=this;function n(o){return new kr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function i(o){return new kr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new kr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:n,selectDistinct:i,selectDistinctOn:s}}select(t){return new kr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new kr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new kr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Qa(this.dialectConfig)),this.dialect}}W(yg,Hb,"PgQueryBuilder");var Xb;Xb=It;class Vp{constructor(t,e,n,i,s){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(n=>{const i={},s=this.table[Mt.Symbol.Columns];for(const o of Object.keys(n)){const a=n[o];i[o]=lt(a,Ft)?a:new _i(a,s[o])}return i});return new jp(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new yg):t;if(!lt(e,Ft)&&!fg(this.table[Bp],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 jp(this.table,e,this.session,this.dialect,this.withList,!0)}}W(Vp,Xb,"PgInsertBuilder");var Yb,qb;class jp extends(qb=ns,Yb=It,qb){constructor(e,n,i,s,o,a,l){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=s,this.config={table:e,values:n,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[Mt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Gs(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=Y`do nothing`;else{let n="";n=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const i=e.where?Y` where ${e.where}`:void 0;this.config.onConflict=Y`(${Y.raw(n)})${i} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const n=e.where?Y` where ${e.where}`:void 0,i=e.targetWhere?Y` where ${e.targetWhere}`:void 0,s=e.setWhere?Y` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,uM(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=Y`(${Y.raw(a)})${i} do update set ${o}${n}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Hr.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 pr({alias:Rs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(jp,Yb,"PgInsert");var Qb,Zb;class IM extends(Zb=ns,Qb=It,Zb){constructor(e,n,i){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Hr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(IM,Qb,"PgRefreshMaterializedView");var Kb;Kb=It;class $p{constructor(t,e,n,i){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i}setToken(t){return this.authToken=t,this}set(t){return new MM(this.table,uM(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}W($p,Kb,"PgUpdateBuilder");var Jb,tx;class MM extends(tx=ns,Jb=It,tx){constructor(e,n,i,s,o){super();W(this,"config");W(this,"tableName");W(this,"joinsNotNullableMap");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"authToken");W(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=i,this.dialect=s,this.config={set:n,table:e,withList:o,joins:[]},this.tableName=Es(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const n=e,i=Es(n);return typeof i=="string"&&(this.joinsNotNullableMap[i]=!0),this.config.from=n,this}getTableLikeFields(e){return lt(e,en)?e[Mt.Symbol.Columns]:lt(e,Gr)?e._.selectedFields:e[er].selectedFields}createJoin(e){return(n,i)=>{const s=Es(n);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof i=="function"){const o=this.config.from&&!lt(this.config.from,Ft)?this.getTableLikeFields(this.config.from):void 0;i=i(new Proxy(this.config.table[Mt.Symbol.Columns],new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:i,table:n,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[Mt.Symbol.Columns]),this.config.from)){const n=Es(this.config.from);if(typeof n=="string"&&this.config.from&&!lt(this.config.from,Ft)){const i=this.getTableLikeFields(this.config.from);e[n]=i}for(const i of this.config.joins){const s=Es(i.table);if(typeof s=="string"&&!lt(i.table,Ft)){const o=this.getTableLikeFields(i.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=Gs(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){const n=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return n.joinsNotNullableMap=this.joinsNotNullableMap,n}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new pr({alias:Rs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(MM,Jb,"PgUpdate");var ex,rx,nx;const Ka=class Ka extends(nx=Ft,rx=It,ex=Symbol.toStringTag,nx){constructor(e){super(Ka.buildEmbeddedCount(e.source,e.filters).queryChunks);W(this,"sql");W(this,"token");W(this,ex,"PgCountBuilder");W(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Ka.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,n){return Y`(select count(*) from ${e}${Y.raw(" where ").if(n)}${n})`}static buildCount(e,n){return Y`select count(*) as count from ${e}${Y.raw(" where ").if(n)}${n};`}setToken(e){return this.token=e,this}then(e,n){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,n)}catch(e){return this.then(void 0,e)}finally(e){return this.then(n=>(e==null||e(),n),n=>{throw e==null||e(),n})}};W(Ka,rx,"PgCountBuilder");let Gp=Ka;var ix;ix=It;class EM{constructor(t,e,n,i,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=n,this.table=i,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Wp(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Wp(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}W(EM,ix,"PgRelationalQueryBuilder");var sx,ox;class Wp extends(ox=ns,sx=It,ox){constructor(e,n,i,s,o,a,l,u,c){super();W(this,"authToken");this.fullSchema=e,this.schema=n,this.tableNamesMap=i,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Hr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:n,builtQuery:i}=this._toSQL();return this.session.prepareQuery(i,void 0,e,!0,(s,o)=>{const a=s.map(l=>Up(this.schema,this.tableConfig,l,n.selection,o));return this.mode==="first"?a[0]:a})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){const e=this._getQuery(),n=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:n}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}W(Wp,sx,"PgRelationalQuery");var ax,lx;class AM extends(lx=ns,ax=It,lx){constructor(t,e,n,i){super(),this.execute=t,this.sql=e,this.query=n,this.mapBatchResult=i}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}W(AM,ax,"PgRaw");var ux;ux=It;class vg{constructor(t,e,n){W(this,"query");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(new yg(n.dialect))),new Proxy(new hg(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new pr({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});W(this,"authToken");if(this.dialect=t,this.session=e,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[i,s]of Object.entries(this._.schema))this.query[i]=new EM(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[i],s,t,e)}$count(t,e){return new Gp({source:t,filters:e,session:this.session})}with(...t){const e=this;function n(u){return new kr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function i(u){return new kr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new kr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new $p(u,e.session,e.dialect,t)}function a(u){return new Vp(u,e.session,e.dialect,t)}function l(u){return new zp(u,e.session,e.dialect,t)}return{select:n,selectDistinct:i,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new kr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new kr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new kr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new $p(t,this.session,this.dialect)}insert(t){return new Vp(t,this.session,this.dialect)}delete(t){return new zp(t,this.session,this.dialect)}refreshMaterializedView(t){return new IM(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?Y.raw(t):t.getSQL(),n=this.dialect.sqlToQuery(e),i=this.session.prepareQuery(n,void 0,void 0,!1);return new AM(()=>i.execute(void 0,this.authToken),e,n,s=>i.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}W(vg,ux,"PgDatabase");var cx;cx=It;class CM{constructor(t){W(this,"authToken");W(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}W(CM,cx,"PgPreparedQuery");var hx;hx=It;class OM{constructor(t){this.dialect=t}execute(t,e){return Hr.startActiveSpan("drizzle.operation",()=>Hr.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const n=await this.execute(t,e);return Number(n[0].count)}}W(OM,hx,"PgSession");var dx,fx;class PM extends(fx=vg,dx=It,fx){constructor(t,e,n,i=0){super(t,e,n),this.schema=n,this.nestedIndex=i}rollback(){throw new iM}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),Y.raw(e.join(" "))}setTransaction(t){return this.session.execute(Y`set transaction ${this.getTransactionConfigSQL(t)}`)}}W(PM,dx,"PgTransaction");function g_(r){return typeof r=="string"&&/^true$/i.test(r)}function K5(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const n=e.searchParams.get("logger");n&&g_(n)&&(t.logger=!0);const i=e.searchParams.get("storage");switch(i){case yl.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:yl.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&g_(s)&&{accessMode:hT.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var px,mx;class RM extends(mx=CM,px=It,mx){constructor(t,e,n,i,s,o){super({sql:e,params:n}),this.client=t,this.queryString=e,this.params=n,this.logger=i,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=f_(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:n,queryString:i,client:s,customResultMapper:o}=this,a=await s;return a.query(i,e)}async all(t={}){const e=f_(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}W(RM,px,"DuckDBWasmPreparedQuery");var gx,yx;const Lc=class Lc extends(yx=OM,gx=It,yx){constructor(e,n,i,s={}){super(n);W(this,"logger");this.client=e,this.schema=i,this.options=s,this.logger=s.logger??new lM}prepareQuery(e,n,i,s,o){return new RM(this.client,e.sql,e.params,this.logger,n,o)}async query(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}async queryObjects(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}transaction(e,n){return n5(this.client,async i=>{const s=new Lc(i,this.dialect,this.schema,this.options),o=new Hp(this.dialect,s,this.schema);return n&&await o.setTransaction(n),e(o)})}};W(Lc,gx,"DuckDBWasmSession");let Pc=Lc;var vx,_x;const Nc=class Nc extends(_x=PM,vx=It,_x){constructor(e,n,i,s=0){super(e,n,i,s);W(this,"dialect");W(this,"session");this.dialect=e,this.session=n}async transaction(e){return i5(this.session.client,"",async n=>{const i=new Pc(n,this.dialect,this.schema,this.session.options),s=new Nc(this.dialect,i,this.schema);return e(s)})}};W(Nc,vx,"DuckDBWasmTransaction");let Hp=Nc;var bx,xx;class FM extends(xx=vg,bx=It,xx){}W(FM,bx,"DuckDBWasmDatabase");function Za(r,t={}){const e=new Qa({casing:t.casing});let n;t.logger===!0?n=new aM:t.logger!==!1&&(n=t.logger);let i;if(t.schema){const a=B5(t.schema,V5);i={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Pc(r,e,i,{logger:n}),o=new FM(e,s,i);return o.$client=r,o}async function J5(r=!1){const t=await ZI();switch(t){case"browser":return r?(await Bi(async()=>{const{getImportUrlBundles:e}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:e}},__vite__mapDeps([3,4]))).getImportUrlBundles():(await Bi(async()=>{const{getBundles:e}=await import("./default-browser-BrgSDbLD.js");return{getBundles:e}},[])).getBundles();case"node":return r?await(await Bi(async()=>{const{getImportUrlBundles:e}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:e}},__vite__mapDeps([5,4]))).getImportUrlBundles():await(await Bi(async()=>{const{getBundles:e}=await import("./default-node-CKggh1Nm.js");return{getBundles:e}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${t}"`)}}function y_(r,t){const e=K5(r);return Za(JI({bundles:J5(e.bundles==="import-url"),logger:e.logger?new dT:void 0,storage:e.storage}),t)}function v_(...r){if(typeof r[0]=="string")return y_(r[0],r[1]);if(D5(r[0])){const{connection:t,client:e,...n}=r[0];if(e)return Za(e,n);if(typeof t=="string")return y_(t,n);if(typeof t>"u")throw new Error("connection option is required");return Za(JI({bundles:t.bundles,logger:t.logger,storage:t.storage}),n)}return Za(r[0],r[1])}(r=>{function t(e){return Za({options:{parsers:{},serializers:{}}},e)}r.mock=t})(v_||(v_={}));var of={exports:{}};/*! + `;await e.execute(Y`CREATE SCHEMA IF NOT EXISTS ${Y.identifier(s)}`),await e.execute(o);const l=(await e.all(Y`select id, hash, created_at from ${Y.identifier(s)}.${Y.identifier(i)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=n[o])==null?void 0:a.onUpdateFn)!==void 0}),s=i.length;return Y.join(i.flatMap((o,a)=>{const l=n[o],u=e[o]??Y.param(l.onUpdateFn(),l),c=Y`${Y.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Ft.Aliased)&&s.isSelectionField)a.push(Y.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,$r)?Y.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Ft.Aliased)&&a.push(Y` as ${Y.identifier(s.fieldAlias)}`)}else lt(s,ur)&&(e?a.push(Y.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:P})=>P===(nt[Mt.Symbol.IsAlias]?Rs(nt):nt[Mt.Symbol.BaseName])))(w.field.table)){const nt=Rs(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${nt}"."${w.field.name}", but the table "${nt}" is not part of the query! Did you forget to join it?`)}const p=!a||a.length===0,y=this.buildWithCTE(t);let v;d&&(v=d===!0?Y` distinct`:Y` distinct on (${Y.join(d.on,Y`, `)})`);const S=this.buildSelection(g,{isSingleTable:p}),T=this.buildFromTable(o),_=this.buildJoins(a),M=i?Y` where ${i}`:void 0,x=s?Y` having ${s}`:void 0;let N;l&&l.length>0&&(N=Y` order by ${Y.join(l,Y`, `)}`);let L;u&&u.length>0&&(L=Y` group by ${Y.join(u,Y`, `)}`);const j=typeof c=="object"||typeof c=="number"&&c>=0?Y` limit ${c}`:void 0,it=h?Y` offset ${h}`:void 0,I=Y.empty();if(f){const w=Y` for ${Y.raw(f.strength)}`;f.config.of&&w.append(Y` of ${Y.join(Array.isArray(f.config.of)?f.config.of:[f.config.of],Y`, `)}`),f.config.noWait?w.append(Y` no wait`):f.config.skipLocked&&w.append(Y` skip locked`),I.append(w)}const Q=Y`${y}select${v} ${S} from ${T}${_}${M}${L}${x}${N}${j}${it}${I}`;return m.length>0?this.buildSetOperations(Q,m):Q}buildSetOperations(t,e){const[n,...i]=e;if(!n)throw new Error("Cannot pass undefined values to any set operator");return i.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:n}),i)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:n,rightSelect:i,limit:s,orderBy:o,offset:a}}){const l=Y`(${t.getSQL()}) `,u=Y`(${i.getSQL()})`;let c;if(o&&o.length>0){const m=[];for(const g of o)if(lt(g,$r))m.push(Y.identifier(g.name));else if(lt(g,Ft)){for(let p=0;p=0?Y` limit ${s}`:void 0,f=Y.raw(`${e} ${n?"all ":""}`),d=a?Y` offset ${a}`:void 0;return Y`${l}${f}${u}${c}${h}${d}`}buildInsertQuery({table:t,values:e,onConflict:n,returning:i,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[Mt.Symbol.Columns],c=Object.entries(u).filter(([y,v])=>!v.shouldDisableInsert()),h=c.map(([,y])=>Y.identifier(this.casing.getColumnCasing(y)));if(o){const y=e;lt(y,Ft)?l.push(y):l.push(y.getSQL())}else{const y=e;l.push(Y.raw("values "));for(const[v,S]of y.entries()){const T=[];for(const[_,M]of c){const x=S[_];if(x===void 0||lt(x,_i)&&x.value===void 0)if(M.defaultFn!==void 0){const N=M.defaultFn(),L=lt(N,Ft)?N:Y.param(N,M);T.push(L)}else if(!M.default&&M.onUpdateFn!==void 0){const N=M.onUpdateFn(),L=lt(N,Ft)?N:Y.param(N,M);T.push(L)}else T.push(Y`default`);else T.push(x)}l.push(T),v({dbKey:S.name,tsKey:v,field:ci(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const y=Object.fromEntries(Object.entries(s.columns).map(([x,N])=>[x,ci(N,a)]));if(o.where){const x=typeof o.where=="function"?o.where(y,L5()):o.where;m=x&&Cc(x,a)}const v=[];let S=[];if(o.columns){let x=!1;for(const[N,L]of Object.entries(o.columns))L!==void 0&&N in s.columns&&(!x&&L===!0&&(x=!0),S.push(N));S.length>0&&(S=x?S.filter(N=>{var L;return((L=o.columns)==null?void 0:L[N])===!0}):Object.keys(s.columns).filter(N=>!S.includes(N)))}else S=Object.keys(s.columns);for(const x of S){const N=s.columns[x];v.push({tsKey:x,value:N})}let T=[];o.with&&(T=Object.entries(o.with).filter(x=>!!x[1]).map(([x,N])=>({tsKey:x,queryConfig:N,relation:s.relations[x]})));let _;if(o.extras){_=typeof o.extras=="function"?o.extras(y,{sql:Y}):o.extras;for(const[x,N]of Object.entries(_))v.push({tsKey:x,value:nM(N,a)})}for(const{tsKey:x,value:N}of v)c.push({dbKey:lt(N,Ft.Aliased)?N.fieldAlias:s.columns[x].name,tsKey:x,field:lt(N,ur)?ci(N,a):N,relationTableTsKey:void 0,isJson:!1,selection:[]});let M=typeof o.orderBy=="function"?o.orderBy(y,N5()):o.orderBy??[];Array.isArray(M)||(M=[M]),d=M.map(x=>lt(x,ur)?ci(x,a):Cc(x,a)),h=o.limit,f=o.offset;for(const{tsKey:x,queryConfig:N,relation:L}of T){const j=z5(e,n,L),it=vl(L.referencedTable),I=n[it],Q=`${a}_${x}`,w=kp(...j.fields.map((C,R)=>sM(ci(j.references[R],Q),ci(C,a)))),nt=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:n,table:t[I],tableConfig:e[I],queryConfig:lt(L,Ws)?N===!0?{limit:1}:{...N,limit:1}:N,tableAlias:Q,joinOn:w,nestedQueryRelation:L}),P=Y`${Y.identifier(Q)}.${Y.identifier("data")}`.as(x);g.push({on:Y`true`,table:new Gr(nt.sql,{},Q),alias:Q,joinType:"left",lateral:!0}),c.push({dbKey:x,tsKey:x,field:P,relationTableTsKey:I,isJson:!0,selection:nt.selection})}}if(c.length===0)throw new dg({message:`No fields selected for table "${s.tsName}" ("${a}")`});let p;if(m=kp(u,m),l){let y=Y`json_build_array(${Y.join(c.map(({field:T,tsKey:_,isJson:M})=>M?Y`${Y.identifier(`${a}_${_}`)}.${Y.identifier("data")}`:lt(T,Ft.Aliased)?T.sql:T),Y`, `)})`;lt(l,Oc)&&(y=Y`coalesce(json_agg(${y}${d.length>0?Y` order by ${Y.join(d,Y`, `)}`:void 0}), '[]'::json)`);const v=[{dbKey:"data",tsKey:"data",field:y.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||f!==void 0||d.length>0?(p=this.buildSelectQuery({table:sf(i,a),fields:{},fieldsFlat:[{path:[],field:Y.raw("*")}],where:m,limit:h,offset:f,orderBy:d,setOperators:[]}),m=void 0,h=void 0,f=void 0,d=[]):p=sf(i,a),p=this.buildSelectQuery({table:lt(p,en)?p:new Gr(p,{},a),fields:{},fieldsFlat:v.map(({field:T})=>({path:[],field:lt(T,ur)?ci(T,a):T})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]})}else p=this.buildSelectQuery({table:sf(i,a),fields:{},fieldsFlat:c.map(({field:y})=>({path:[],field:lt(y,ur)?ci(y,a):y})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]});return{tableTsKey:s.tsName,sql:p,selection:c}}}W(Qa,Ub,"PgDialect");var zb;zb=It;class SM{getSelectedFields(){return this._.selectedFields}}W(SM,zb,"TypedQueryBuilder");var Vb;Vb=It;class kr{constructor(t){W(this,"fields");W(this,"session");W(this,"dialect");W(this,"withList",[]);W(this,"distinct");W(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,n=t;let i;return this.fields?i=this.fields:lt(n,Gr)?i=Object.fromEntries(Object.keys(n._.selectedFields).map(s=>[s,n[s]])):lt(n,mg)?i=n[er].selectedFields:lt(n,Ft)?i={}:i=F5(n),new gg({table:n,fields:i,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}W(kr,Vb,"PgSelectBuilder");var jb,$b;class TM extends($b=SM,jb=It,$b){constructor({table:e,fields:n,isPartialSelect:i,session:s,dialect:o,withList:a,distinct:l}){super();W(this,"_");W(this,"config");W(this,"joinsNotNullableMap");W(this,"tableName");W(this,"isPartialSelect");W(this,"session");W(this,"dialect");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"union",this.createSetOperator("union",!1));W(this,"unionAll",this.createSetOperator("union",!0));W(this,"intersect",this.createSetOperator("intersect",!1));W(this,"intersectAll",this.createSetOperator("intersect",!0));W(this,"except",this.createSetOperator("except",!1));W(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...n},distinct:l,setOperators:[]},this.isPartialSelect=i,this.session=s,this.dialect=o,this._={selectedFields:n},this.tableName=Es(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e){return(n,i)=>{var a;const s=this.tableName,o=Es(n);if(typeof o=="string"&&((a=this.config.joins)!=null&&a.some(l=>l.alias===o)))throw new Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof s=="string"&&(this.config.fields={[s]:this.config.fields}),typeof o=="string"&&!lt(n,Ft))){const l=lt(n,Gr)?n._.selectedFields:lt(n,rs)?n[er].selectedFields:n[Mt.Symbol.Columns];this.config.fields[o]=l}if(typeof i=="function"&&(i=i(new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:n,joinType:e,alias:o}),typeof o=="string")switch(e){case"left":{this.joinsNotNullableMap[o]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!0;break}case"inner":{this.joinsNotNullableMap[o]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!1;break}}return this}}createSetOperator(e,n){return i=>{const s=typeof i=="function"?i(W5()):i;if(!fg(this.getSelectedFields(),s.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:n,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(n)?n:[n]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new pr({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(n)?n:[n];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else{const n=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,n={}){return this.config.lockingClause={strength:e,config:n},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}as(e){return new Proxy(new Gr(this.getSQL(),this.config.fields,e),new pr({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new pr({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}W(TM,jb,"PgSelectQueryBuilder");var Gb,Wb;class gg extends(Wb=TM,Gb=It,Wb){constructor(){super(...arguments);W(this,"authToken");W(this,"execute",e=>Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:n,config:i,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!n)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Hr.startActiveSpan("drizzle.prepareQuery",()=>{const l=Gs(i.fields),u=n.prepareQuery(s.sqlToQuery(this.getSQL()),l,e,!0);return u.joinsNotNullableMap=o,u.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(gg,Gb,"PgSelect");R5(gg,[ns]);function la(r,t){return(e,n,...i)=>{const s=[n,...i].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!fg(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 W5=()=>({union:H5,unionAll:X5,intersect:Y5,intersectAll:q5,except:Q5,exceptAll:Z5}),H5=la("union",!1),X5=la("union",!0),Y5=la("intersect",!1),q5=la("intersect",!0),Q5=la("except",!1),Z5=la("except",!0);var Hb;Hb=It;class yg{constructor(t){W(this,"dialect");W(this,"dialectConfig");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(n)),new Proxy(new hg(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new pr({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Qa)?t:void 0,this.dialectConfig=lt(t,Qa)?void 0:t}with(...t){const e=this;function n(o){return new kr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function i(o){return new kr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new kr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:n,selectDistinct:i,selectDistinctOn:s}}select(t){return new kr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new kr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new kr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Qa(this.dialectConfig)),this.dialect}}W(yg,Hb,"PgQueryBuilder");var Xb;Xb=It;class Vp{constructor(t,e,n,i,s){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(n=>{const i={},s=this.table[Mt.Symbol.Columns];for(const o of Object.keys(n)){const a=n[o];i[o]=lt(a,Ft)?a:new _i(a,s[o])}return i});return new jp(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new yg):t;if(!lt(e,Ft)&&!fg(this.table[Bp],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 jp(this.table,e,this.session,this.dialect,this.withList,!0)}}W(Vp,Xb,"PgInsertBuilder");var Yb,qb;class jp extends(qb=ns,Yb=It,qb){constructor(e,n,i,s,o,a,l){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=s,this.config={table:e,values:n,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[Mt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Gs(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=Y`do nothing`;else{let n="";n=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const i=e.where?Y` where ${e.where}`:void 0;this.config.onConflict=Y`(${Y.raw(n)})${i} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const n=e.where?Y` where ${e.where}`:void 0,i=e.targetWhere?Y` where ${e.targetWhere}`:void 0,s=e.setWhere?Y` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,uM(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=Y`(${Y.raw(a)})${i} do update set ${o}${n}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Hr.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 pr({alias:Rs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(jp,Yb,"PgInsert");var Qb,Zb;class IM extends(Zb=ns,Qb=It,Zb){constructor(e,n,i){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Hr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(IM,Qb,"PgRefreshMaterializedView");var Kb;Kb=It;class $p{constructor(t,e,n,i){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i}setToken(t){return this.authToken=t,this}set(t){return new MM(this.table,uM(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}W($p,Kb,"PgUpdateBuilder");var Jb,tx;class MM extends(tx=ns,Jb=It,tx){constructor(e,n,i,s,o){super();W(this,"config");W(this,"tableName");W(this,"joinsNotNullableMap");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"authToken");W(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=i,this.dialect=s,this.config={set:n,table:e,withList:o,joins:[]},this.tableName=Es(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const n=e,i=Es(n);return typeof i=="string"&&(this.joinsNotNullableMap[i]=!0),this.config.from=n,this}getTableLikeFields(e){return lt(e,en)?e[Mt.Symbol.Columns]:lt(e,Gr)?e._.selectedFields:e[er].selectedFields}createJoin(e){return(n,i)=>{const s=Es(n);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof i=="function"){const o=this.config.from&&!lt(this.config.from,Ft)?this.getTableLikeFields(this.config.from):void 0;i=i(new Proxy(this.config.table[Mt.Symbol.Columns],new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new pr({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:i,table:n,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[Mt.Symbol.Columns]),this.config.from)){const n=Es(this.config.from);if(typeof n=="string"&&this.config.from&&!lt(this.config.from,Ft)){const i=this.getTableLikeFields(this.config.from);e[n]=i}for(const i of this.config.joins){const s=Es(i.table);if(typeof s=="string"&&!lt(i.table,Ft)){const o=this.getTableLikeFields(i.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=Gs(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){const n=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return n.joinsNotNullableMap=this.joinsNotNullableMap,n}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new pr({alias:Rs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(MM,Jb,"PgUpdate");var ex,rx,nx;const Ka=class Ka extends(nx=Ft,rx=It,ex=Symbol.toStringTag,nx){constructor(e){super(Ka.buildEmbeddedCount(e.source,e.filters).queryChunks);W(this,"sql");W(this,"token");W(this,ex,"PgCountBuilder");W(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Ka.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,n){return Y`(select count(*) from ${e}${Y.raw(" where ").if(n)}${n})`}static buildCount(e,n){return Y`select count(*) as count from ${e}${Y.raw(" where ").if(n)}${n};`}setToken(e){return this.token=e,this}then(e,n){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,n)}catch(e){return this.then(void 0,e)}finally(e){return this.then(n=>(e==null||e(),n),n=>{throw e==null||e(),n})}};W(Ka,rx,"PgCountBuilder");let Gp=Ka;var ix;ix=It;class EM{constructor(t,e,n,i,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=n,this.table=i,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Wp(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Wp(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}W(EM,ix,"PgRelationalQueryBuilder");var sx,ox;class Wp extends(ox=ns,sx=It,ox){constructor(e,n,i,s,o,a,l,u,c){super();W(this,"authToken");this.fullSchema=e,this.schema=n,this.tableNamesMap=i,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Hr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:n,builtQuery:i}=this._toSQL();return this.session.prepareQuery(i,void 0,e,!0,(s,o)=>{const a=s.map(l=>Up(this.schema,this.tableConfig,l,n.selection,o));return this.mode==="first"?a[0]:a})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){const e=this._getQuery(),n=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:n}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Hr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}W(Wp,sx,"PgRelationalQuery");var ax,lx;class AM extends(lx=ns,ax=It,lx){constructor(t,e,n,i){super(),this.execute=t,this.sql=e,this.query=n,this.mapBatchResult=i}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}W(AM,ax,"PgRaw");var ux;ux=It;class vg{constructor(t,e,n){W(this,"query");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(new yg(n.dialect))),new Proxy(new hg(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new pr({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});W(this,"authToken");if(this.dialect=t,this.session=e,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[i,s]of Object.entries(this._.schema))this.query[i]=new EM(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[i],s,t,e)}$count(t,e){return new Gp({source:t,filters:e,session:this.session})}with(...t){const e=this;function n(u){return new kr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function i(u){return new kr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new kr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new $p(u,e.session,e.dialect,t)}function a(u){return new Vp(u,e.session,e.dialect,t)}function l(u){return new zp(u,e.session,e.dialect,t)}return{select:n,selectDistinct:i,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new kr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new kr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new kr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new $p(t,this.session,this.dialect)}insert(t){return new Vp(t,this.session,this.dialect)}delete(t){return new zp(t,this.session,this.dialect)}refreshMaterializedView(t){return new IM(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?Y.raw(t):t.getSQL(),n=this.dialect.sqlToQuery(e),i=this.session.prepareQuery(n,void 0,void 0,!1);return new AM(()=>i.execute(void 0,this.authToken),e,n,s=>i.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}W(vg,ux,"PgDatabase");var cx;cx=It;class CM{constructor(t){W(this,"authToken");W(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}W(CM,cx,"PgPreparedQuery");var hx;hx=It;class OM{constructor(t){this.dialect=t}execute(t,e){return Hr.startActiveSpan("drizzle.operation",()=>Hr.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const n=await this.execute(t,e);return Number(n[0].count)}}W(OM,hx,"PgSession");var dx,fx;class PM extends(fx=vg,dx=It,fx){constructor(t,e,n,i=0){super(t,e,n),this.schema=n,this.nestedIndex=i}rollback(){throw new iM}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),Y.raw(e.join(" "))}setTransaction(t){return this.session.execute(Y`set transaction ${this.getTransactionConfigSQL(t)}`)}}W(PM,dx,"PgTransaction");function g_(r){return typeof r=="string"&&/^true$/i.test(r)}function K5(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const n=e.searchParams.get("logger");n&&g_(n)&&(t.logger=!0);const i=e.searchParams.get("storage");switch(i){case yl.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:yl.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&g_(s)&&{accessMode:hT.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var px,mx;class RM extends(mx=CM,px=It,mx){constructor(t,e,n,i,s,o){super({sql:e,params:n}),this.client=t,this.queryString=e,this.params=n,this.logger=i,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=f_(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:n,queryString:i,client:s,customResultMapper:o}=this,a=await s;return a.query(i,e)}async all(t={}){const e=f_(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}W(RM,px,"DuckDBWasmPreparedQuery");var gx,yx;const Lc=class Lc extends(yx=OM,gx=It,yx){constructor(e,n,i,s={}){super(n);W(this,"logger");this.client=e,this.schema=i,this.options=s,this.logger=s.logger??new lM}prepareQuery(e,n,i,s,o){return new RM(this.client,e.sql,e.params,this.logger,n,o)}async query(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}async queryObjects(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}transaction(e,n){return n5(this.client,async i=>{const s=new Lc(i,this.dialect,this.schema,this.options),o=new Hp(this.dialect,s,this.schema);return n&&await o.setTransaction(n),e(o)})}};W(Lc,gx,"DuckDBWasmSession");let Pc=Lc;var vx,_x;const Nc=class Nc extends(_x=PM,vx=It,_x){constructor(e,n,i,s=0){super(e,n,i,s);W(this,"dialect");W(this,"session");this.dialect=e,this.session=n}async transaction(e){return i5(this.session.client,"",async n=>{const i=new Pc(n,this.dialect,this.schema,this.session.options),s=new Nc(this.dialect,i,this.schema);return e(s)})}};W(Nc,vx,"DuckDBWasmTransaction");let Hp=Nc;var bx,xx;class FM extends(xx=vg,bx=It,xx){}W(FM,bx,"DuckDBWasmDatabase");function Za(r,t={}){const e=new Qa({casing:t.casing});let n;t.logger===!0?n=new aM:t.logger!==!1&&(n=t.logger);let i;if(t.schema){const a=B5(t.schema,V5);i={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Pc(r,e,i,{logger:n}),o=new FM(e,s,i);return o.$client=r,o}async function J5(r=!1){const t=await ZI();switch(t){case"browser":return r?(await Bi(async()=>{const{getImportUrlBundles:e}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:e}},__vite__mapDeps([3,4]))).getImportUrlBundles():(await Bi(async()=>{const{getBundles:e}=await import("./default-browser-BrgSDbLD.js");return{getBundles:e}},[])).getBundles();case"node":return r?await(await Bi(async()=>{const{getImportUrlBundles:e}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:e}},__vite__mapDeps([5,4]))).getImportUrlBundles():await(await Bi(async()=>{const{getBundles:e}=await import("./default-node-C-2Juvjq.js");return{getBundles:e}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${t}"`)}}function y_(r,t){const e=K5(r);return Za(JI({bundles:J5(e.bundles==="import-url"),logger:e.logger?new dT:void 0,storage:e.storage}),t)}function v_(...r){if(typeof r[0]=="string")return y_(r[0],r[1]);if(D5(r[0])){const{connection:t,client:e,...n}=r[0];if(e)return Za(e,n);if(typeof t=="string")return y_(t,n);if(typeof t>"u")throw new Error("connection option is required");return Za(JI({bundles:t.bundles,logger:t.logger,storage:t.storage}),n)}return Za(r[0],r[1])}(r=>{function t(e){return Za({options:{parsers:{},serializers:{}}},e)}r.mock=t})(v_||(v_={}));var of={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files diff --git a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js similarity index 96% rename from assets/TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js rename to assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js index 173761c9dda7d915e21d34f3909e42edb0a0a315..b21df2f5d2e3ba0ab878c793cc2e26cdd6a6e285 100644 --- a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js +++ b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js @@ -1 +1 @@ -import{d as T,x as l,o as m,bB as B,y as b,p as v}from"./index-DfQ41DTF.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,x as l,o as m,bB as B,y as b,p as v}from"./index-Dn5R1iW2.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_-B9hj4crd.js b/assets/_...all_-DiMCXQP5.js similarity index 64% rename from assets/_...all_-B9hj4crd.js rename to assets/_...all_-DiMCXQP5.js index b17ef0dd358587e68161f7d0a9253c4062a5c4eb..0bbdc8f699e1f5935cc3c6c6da652e517643d46f 100644 --- a/assets/_...all_-B9hj4crd.js +++ b/assets/_...all_-DiMCXQP5.js @@ -1 +1 @@ -import{bn as e,c as n,o as c}from"./index-DfQ41DTF.js";const o={};function _(t,r){return c(),n("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; +import{bn as e,c as n,o as c}from"./index-Dn5R1iW2.js";const o={};function _(t,r){return c(),n("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; diff --git a/assets/audio-BBFpw-95.js b/assets/audio-Du4XXjan.js similarity index 88% rename from assets/audio-BBFpw-95.js rename to assets/audio-Du4XXjan.js index c3100472dc14df3ccfb731e8332d42860acf5dc0..5bebd5cc9891b68effd2e4e6ba779a1417abce56 100644 --- a/assets/audio-BBFpw-95.js +++ b/assets/audio-Du4XXjan.js @@ -1 +1 @@ -import{d as s,g as f,c as d,o as p,a as t}from"./index-DfQ41DTF.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; +import{d as s,g as f,c as d,o as p,a as t}from"./index-Dn5R1iW2.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; diff --git a/assets/cloudflare-workers-ai-Da37CFf3.js b/assets/cloudflare-workers-ai-Da37CFf3.js new file mode 100644 index 0000000000000000000000000000000000000000..140e20894925d7e56df0cdd235cd7f4cc805d390 --- /dev/null +++ b/assets/cloudflare-workers-ai-Da37CFf3.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as V,bN as w,bO as y,x as k,o as I,i as x,bE as M,s as $,h as m,m as q,w as K,y as f,b as c,e as l}from"./index-Dn5R1iW2.js";import{u as N}from"./providers-Li1UUmJz.js";import{_ as P,a as z,b as A,c as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import{_ as C}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";const R=V({__name:"ProviderAccountIdInput",props:w({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=y(p,"modelValue");return(n,e)=>(I(),k(P,{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",T=V({__name:"cloudflare-workers-ai",setup(p){const{t:r}=x(),u=M(),n=N(),{providers:e}=$(n),t=m(()=>n.getProviderMetadata(a)),s=m({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=m({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}});q(()=>{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)||""}),K([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function h(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,b;return I(),k(l(B),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(b=t.value)==null?void 0:b.iconColor,"on-back":()=>l(u).back()},{default:f(()=>[c(l(z),null,{default:f(()=>[c(l(A),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":h},{default:f(()=>{var g;return[c(l(C),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=v=>s.value=v),"provider-name":(g=t.value)==null?void 0:g.localizedName,placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(l(R),{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=v=>d.value=v),label:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label"),description:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description"),placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder")},null,8,["modelValue","label","description","placeholder"])]}),_:1},8,["title","description"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{T as default}; diff --git a/assets/cloudflare-workers-ai-Qanyjg-b.js b/assets/cloudflare-workers-ai-Qanyjg-b.js deleted file mode 100644 index bb57f53d5328aab2ae40ac4069d1e234ed3cd965..0000000000000000000000000000000000000000 --- a/assets/cloudflare-workers-ai-Qanyjg-b.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as V,bN as A,bO as g,x as b,o as k,bE as h,s as x,h as m,m as C,w as M,y as v,b as s,e as n}from"./index-DfQ41DTF.js";import{u as $}from"./providers-CM7Pgz9x.js";import{_ as q,a as w,b as D,c as K}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";const B=V({__name:"ProviderAccountIdInput",props:A({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(c){const t=c,d=g(c,"modelValue");return(o,l)=>(k(),b(q,{modelValue:d.value,"onUpdate:modelValue":l[0]||(l[0]=r=>d.value=r),label:t.label||"Account ID",description:t.description||"Account ID",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}}),a="cloudflare-workers-ai",E=V({__name:"cloudflare-workers-ai",setup(c){const t=h(),d=$(),{providers:o}=x(d),l=m(()=>d.getProviderMetadata(a)),r=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),i=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.accountId)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].accountId=e}});C(()=>{var e,u;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((u=o.value[a])==null?void 0:u.accountId)||""}),M([r,i],()=>{o.value[a]={...o.value[a],apiKey:r.value,accountId:i.value}});function y(){var e;o.value[a]={...(e=l.value)==null?void 0:e.defaultOptions}}return(e,u)=>{var f,_;return k(),b(n(K),{"provider-name":(f=l.value)==null?void 0:f.localizedName,"provider-icon-color":(_=l.value)==null?void 0:_.iconColor,"on-back":()=>n(t).back()},{default:v(()=>[s(n(w),null,{default:v(()=>[s(n(D),{title:"Basic",description:"Essential settings","on-reset":y},{default:v(()=>{var I;return[s(n(P),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=p=>r.value=p),"provider-name":(I=l.value)==null?void 0:I.localizedName,placeholder:"Your Cloudflare API token"},null,8,["modelValue","provider-name"]),s(n(B),{modelValue:i.value,"onUpdate:modelValue":u[1]||(u[1]=p=>i.value=p),label:"Account ID",description:"Cloudflare Account ID",placeholder:"Your Cloudflare Account ID"},null,8,["modelValue"])]}),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{E as default}; diff --git a/assets/consciousness-v07tqYpy.js b/assets/consciousness-BhvliREc.js similarity index 91% rename from assets/consciousness-v07tqYpy.js rename to assets/consciousness-BhvliREc.js index cf2f575232338207cf7091a5ee5ef082b3c1d1bc..67d6fa5532d17e310853c46308533a23cfef49ae 100644 --- a/assets/consciousness-v07tqYpy.js +++ b/assets/consciousness-BhvliREc.js @@ -1 +1 @@ -import{f as C,bL as l,g as M,h as i,w as h}from"./index-DfQ41DTF.js";import{u as y}from"./providers-CM7Pgz9x.js";const A=C("consciousness",()=>{const s=y(),o=l("settings/consciousness/active-provider",""),a=l("settings/consciousness/active-model",""),n=l("settings/consciousness/active-custom-model",""),u=M({}),r=M(""),f=i(()=>{var e;return((e=s.getProviderMetadata(o.value))==null?void 0:e.capabilities.listModels)!==void 0}),c=i(()=>s.getModelsForProvider(o.value)),m=i(()=>s.isLoadingModels[o.value]||!1),g=i(()=>s.modelLoadError[o.value]||null),p=i(()=>{if(!r.value.trim())return c.value;const e=r.value.toLowerCase().trim();return c.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function P(e){o.value=e}function L(e){a.value=e}function w(e){n.value=e}function S(e){r.value=e}function d(){a.value="",n.value="",u.value={},r.value=""}async function v(e){var t;e&&((t=s.getProviderMetadata(o.value))==null?void 0:t.capabilities.listModels)!==void 0&&s.getModelsForProvider(e).length===0&&await s.fetchModelsForProvider(e)}return h(o,async e=>{await v(e),d()}),{activeProvider:o,activeModel:a,customModelName:n,expandedDescriptions:u,modelSearchQuery:r,supportsModelListing:f,providerModels:c,isLoadingActiveProviderModels:m,activeProviderModelError:g,filteredModels:p,setActiveProvider:P,setActiveModel:L,setCustomModelName:w,setModelSearchQuery:S,resetModelSelection:d,loadModelsForProvider:v}});export{A as u}; +import{f as C,bL as l,g as M,h as i,w as h}from"./index-Dn5R1iW2.js";import{u as y}from"./providers-Li1UUmJz.js";const A=C("consciousness",()=>{const s=y(),o=l("settings/consciousness/active-provider",""),a=l("settings/consciousness/active-model",""),n=l("settings/consciousness/active-custom-model",""),u=M({}),r=M(""),f=i(()=>{var e;return((e=s.getProviderMetadata(o.value))==null?void 0:e.capabilities.listModels)!==void 0}),c=i(()=>s.getModelsForProvider(o.value)),m=i(()=>s.isLoadingModels[o.value]||!1),g=i(()=>s.modelLoadError[o.value]||null),p=i(()=>{if(!r.value.trim())return c.value;const e=r.value.toLowerCase().trim();return c.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function P(e){o.value=e}function L(e){a.value=e}function w(e){n.value=e}function S(e){r.value=e}function d(){a.value="",n.value="",u.value={},r.value=""}async function v(e){var t;e&&((t=s.getProviderMetadata(o.value))==null?void 0:t.capabilities.listModels)!==void 0&&s.getModelsForProvider(e).length===0&&await s.fetchModelsForProvider(e)}return h(o,async e=>{await v(e),d()}),{activeProvider:o,activeModel:a,customModelName:n,expandedDescriptions:u,modelSearchQuery:r,supportsModelListing:f,providerModels:c,isLoadingActiveProviderModels:m,activeProviderModelError:g,filteredModels:p,setActiveProvider:P,setActiveModel:L,setCustomModelName:w,setModelSearchQuery:S,resetModelSelection:d,loadModelsForProvider:v}});export{A as u}; diff --git a/assets/consciousness-CM1OByYo.js b/assets/consciousness-CM1OByYo.js new file mode 100644 index 0000000000000000000000000000000000000000..72bb8ef9892ed7c5987a9cff42d65e1d4313ac93 --- /dev/null +++ b/assets/consciousness-CM1OByYo.js @@ -0,0 +1 @@ +import{d as D,s as b,i as U,bE as B,m as q,bw as E,c as r,o as l,A as h,a as e,e as s,D as n,C as f,bx as k,by as z,b as A,y as F,bo as Q,x as y,ad as u,bH as T}from"./index-Dn5R1iW2.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{_ as $,R as j}from"./RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CTuHNiqF.js";import{u as H}from"./consciousness-BhvliREc.js";import{u as I}from"./providers-Li1UUmJz.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const G={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},J={relative:""},K={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},O={text:"neutral-300 dark:neutral-500"},W={"text-3xl":"","font-semibold":""},X={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},Y={flex:"~ col gap-4"},Z={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},ee={text:"neutral-400 dark:neutral-400"},se={"max-w-full":""},te={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},oe={key:1},ne={key:0},ie={flex:"~ col gap-4"},le={class:"text-lg md:text-2xl"},re={text:"neutral-400 dark:neutral-400"},de={key:0,class:"flex items-center justify-center py-4"},ae={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},ce={class:"flex flex-col"},ue={class:"font-medium"},pe={class:"text-sm text-red-600 dark:text-red-400"},me={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},xe={class:"flex flex-col"},ve={class:"font-medium"},ge={class:"text-sm text-amber-600 dark:text-amber-400"},_e={key:1},be={flex:"~ col gap-4"},he={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},fe={text:"neutral-400 dark:neutral-500"},ke={class:"bg-primary-50 border-primary-200 dark:bg-primary-900/20 dark:border-primary-800 flex items-center gap-3 border rounded-lg p-4"},ye={class:"flex flex-col"},we={class:"font-medium"},Me={class:"dark:text-primary-400 text-primary-600 text-sm"},Ve={class:"mt-2"},Ce={class:"mb-1 block text-sm font-medium"},Pe=["placeholder"],Ne=D({__name:"consciousness",setup(Se){const M=I(),m=H(),{availableProviders:V,availableProvidersMetadata:C}=b(M),{activeProvider:d,activeModel:a,customModelName:P,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=b(m),{t:o}=U(),N=B();q(async()=>{await m.loadModelsForProvider(d.value)});function S(_){P.value=_}return(_,t)=>{const L=E("motion");return l(),r(k,null,[h((l(),r("div",G,[e("button",{onClick:t[0]||(t[0]=i=>s(N).back())},t[5]||(t[5]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-xl":""},null,-1)])),e("h1",J,[e("div",K,[e("span",O,n(s(o)("settings.pages.modules.title")),1)]),e("div",W,n(s(o)("settings.pages.modules.consciousness.title")),1)])])),[[L]]),e("div",X,[e("div",null,[e("div",Y,[e("div",null,[e("h2",Z,n(s(o)("settings.pages.providers.title")),1),e("div",ee,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",se,[s(V).length>0?(l(),r("fieldset",te,[(l(!0),r(k,null,z(s(C),i=>(l(),y(s(j),{id:i.id,key:i.id,modelValue:s(d),"onUpdate:modelValue":t[1]||(t[1]=R=>u(d)?d.value=R:null),name:"provider",value:i.id,title:i.localizedName,description:i.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(l(),r("div",oe,[A(s(Q),{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:F(()=>t[6]||(t[6]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your LLM providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])])]),s(d)&&s(x)?(l(),r("div",ne,[e("div",ie,[e("div",null,[e("h2",le,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",re,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(l(),r("div",de,[t[7]||(t[7]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(g)?(l(),r("div",ae,[t[8]||(t[8]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",ce,[e("span",ue,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",pe,n(s(g)),1)])])):s(p).length===0&&!s(v)?(l(),r("div",me,[t[9]||(t[9]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",xe,[e("span",ve,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ge,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(l(),y(s($),{key:3,modelValue:s(a),"onUpdate:modelValue":t[2]||(t[2]=i=>u(a)?a.value=i:null),"search-query":s(c),"onUpdate:searchQuery":t[3]||(t[3]=i=>u(c)?c.value=i:null),items:s(p),searchable:!0,"search-placeholder":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":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)?(l(),r("div",_e,[e("div",be,[e("div",null,[e("h2",he,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",fe,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",ke,[t[10]||(t[10]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-primary-500 dark:text-primary-400 text-2xl"},null,-1)),e("div",ye,[e("span",we,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",Me,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",Ve,[e("label",Ce,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),h(e("input",{"onUpdate:modelValue":t[4]||(t[4]=i=>u(a)?a.value=i:null),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900",placeholder:s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,Pe),[[T,s(a)]])])])])):f("",!0)]),t[11]||(t[11]=e("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:ghost":""})],-1))],64)}}});typeof w=="function"&&w(Ne);export{Ne as default}; diff --git a/assets/consciousness-Dp9J01tk.js b/assets/consciousness-Dp9J01tk.js deleted file mode 100644 index 5aca933821da7e591343c9bd711ecd92cfebd4d1..0000000000000000000000000000000000000000 --- a/assets/consciousness-Dp9J01tk.js +++ /dev/null @@ -1 +0,0 @@ -import{d as N,s as g,bE as R,m as D,bw as U,c as i,o as r,A as f,a as e,e as t,C as h,bx as _,by as B,b as q,y as E,bo as z,x as k,D as n,ad as c,bH as A}from"./index-DfQ41DTF.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{_ as F,R as Q}from"./RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CDWI8QsS.js";import{u as T}from"./consciousness-v07tqYpy.js";import{u as j}from"./providers-CM7Pgz9x.js";import{b as y}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const H={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},G={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},I={flex:"~ col gap-4"},J={"max-w-full":""},K={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},O={key:1},W={key:0},X={flex:"~ col gap-4"},Y={class:"text-lg md:text-2xl"},Z={text:"neutral-400 dark:neutral-400"},ee={key:0,class:"flex items-center justify-center py-4"},se={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"},te={class:"flex flex-col"},oe={class:"font-medium"},le={class:"text-sm text-red-600 dark:text-red-400"},re={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"},ne={class:"flex flex-col"},ie={class:"font-medium"},de={class:"text-sm text-amber-600 dark:text-amber-400"},ae={key:1},ue={flex:"~ col gap-4"},ce={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},me={text:"neutral-400 dark:neutral-500"},pe={class:"bg-primary-50 border-primary-200 dark:bg-primary-900/20 dark:border-primary-800 flex items-center gap-3 border rounded-lg p-4"},ve={class:"flex flex-col"},xe={class:"font-medium"},be={class:"dark:text-primary-400 text-primary-600 text-sm"},ge={class:"mt-2"},fe={class:"mb-1 block text-sm font-medium"},he=["placeholder"],_e=N({__name:"consciousness",setup(ke){const $=j(),p=T(),{availableProviders:w,availableProvidersMetadata:M}=g($),{activeProvider:d,activeModel:a,customModelName:C,modelSearchQuery:u,supportsModelListing:v,providerModels:m,isLoadingActiveProviderModels:x,activeProviderModelError:b}=g(p),V=R();D(async()=>{await p.loadModelsForProvider(d.value)});function P(o){C.value=o}return(o,s)=>{const L=U("motion");return r(),i(_,null,[f((r(),i("div",H,[e("button",{onClick:s[0]||(s[0]=l=>t(V).back())},s[5]||(s[5]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-xl":""},null,-1)])),s[6]||(s[6]=e("h1",{relative:""},[e("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[e("span",{text:"neutral-300 dark:neutral-500"},"Modules")]),e("div",{"text-3xl":"","font-semibold":""}," Consciousness ")],-1))])),[[L]]),e("div",G,[e("div",null,[e("div",I,[s[8]||(s[8]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"}," Provider "),e("div",{text:"neutral-400 dark:neutral-400"},[e("span",null,"Select the suitable LLM provider for consciousness")])],-1)),e("div",J,[t(w).length>0?(r(),i("fieldset",K,[(r(!0),i(_,null,B(t(M),l=>(r(),k(t(Q),{id:l.id,key:l.id,modelValue:t(d),"onUpdate:modelValue":s[1]||(s[1]=S=>c(d)?d.value=S:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(r(),i("div",O,[q(t(z),{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:E(()=>s[7]||(s[7]=[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})]))])])]),t(d)&&t(v)?(r(),i("div",W,[e("div",X,[e("div",null,[e("h2",Y,n(o.$t("settings.modules.consciousness.provider-model-selection.title")),1),e("div",Z,[e("span",null,n(o.$t("settings.modules.consciousness.provider-model-selection.subtitle")),1)])]),t(x)?(r(),i("div",ee,[s[9]||(s[9]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,n(o.$t("settings.modules.consciousness.provider-model-selection.loading")),1)])):t(b)?(r(),i("div",se,[s[10]||(s[10]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",te,[e("span",oe,n(o.$t("settings.modules.consciousness.provider-model-selection.error")),1),e("span",le,n(t(b)),1)])])):t(m).length===0&&!t(x)?(r(),i("div",re,[s[11]||(s[11]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",ne,[e("span",ie,n(o.$t("settings.modules.consciousness.provider-model-selection.no_models")),1),e("span",de,n(o.$t("settings.modules.consciousness.provider-model-selection.no_models_description")),1)])])):t(m).length>0?(r(),k(t(F),{key:3,modelValue:t(a),"onUpdate:modelValue":s[2]||(s[2]=l=>c(a)?a.value=l:null),"search-query":t(u),"onUpdate:searchQuery":s[3]||(s[3]=l=>c(u)?u.value=l:null),items:t(m),searchable:!0,"search-placeholder":o.$t("settings.modules.consciousness.provider-model-selection.search_placeholder"),"search-no-results-title":o.$t("settings.modules.consciousness.provider-model-selection.no_search_results"),"search-no-results-description":o.$t("settings.modules.consciousness.provider-model-selection.no_search_results_description",{query:t(u)}),"search-results-text":o.$t("settings.modules.consciousness.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":o.$t("settings.modules.consciousness.provider-model-selection.custom_model_placeholder"),"expand-button-text":o.$t("settings.modules.consciousness.provider-model-selection.expand"),"collapse-button-text":o.$t("settings.modules.consciousness.provider-model-selection.collapse"),"onUpdate:customValue":P},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"])):h("",!0)])])):t(d)&&!t(v)?(r(),i("div",ae,[e("div",ue,[e("div",null,[e("h2",ce,n(o.$t("settings.modules.consciousness.provider-model-selection.title")),1),e("div",me,[e("span",null,n(o.$t("settings.modules.consciousness.provider-model-selection.subtitle")),1)])]),e("div",pe,[s[12]||(s[12]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-primary-500 dark:text-primary-400 text-2xl"},null,-1)),e("div",ve,[e("span",xe,n(o.$t("settings.modules.consciousness.provider-model-selection.not_supported")),1),e("span",be,n(o.$t("settings.modules.consciousness.provider-model-selection.not_supported_description")),1)])]),e("div",ge,[e("label",fe,n(o.$t("settings.modules.consciousness.provider-model-selection.manual_model_name")),1),f(e("input",{"onUpdate:modelValue":s[4]||(s[4]=l=>c(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:o.$t("settings.modules.consciousness.provider-model-selection.manual_model_placeholder")},null,8,he),[[A,t(a)]])])])])):h("",!0)]),s[13]||(s[13]=e("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:ghost":""})],-1))],64)}}});typeof y=="function"&&y(_e);export{_e as default}; diff --git a/assets/deepseek-Bp1UKOd8.js b/assets/deepseek-Bp1UKOd8.js deleted file mode 100644 index 4ed16df8422c8526198288fd018fccf5ba37a987..0000000000000000000000000000000000000000 --- a/assets/deepseek-Bp1UKOd8.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as k,bE as U,s as V,h as v,m as y,w as $,x as g,o as K,y as d,b as i,e as t}from"./index-DfQ41DTF.js";import{u as h}from"./providers-CM7Pgz9x.js";import{_ as x,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as C,c as M}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const a="deepseek",j=k({__name:"deepseek",setup(N){const f=U(),p=h(),{providers:o}=V(p),u=v(()=>p.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,l;p.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((l=o.value[a])==null?void 0:l.baseUrl)||""}),$([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function _(){var e;o.value[a]={...(e=u.value)==null?void 0:e.defaultOptions}}return(e,l)=>{var m,c;return K(),g(t(M),{"provider-name":(m=u.value)==null?void 0:m.localizedName,"provider-icon-color":(c=u.value)==null?void 0:c.iconColor,"on-back":()=>t(f).back()},{default:d(()=>[i(t(B),null,{default:d(()=>[i(t(C),{title:"Basic",description:"Essential settings","on-reset":_},{default:d(()=>{var n;return[i(t(z),{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=b=>r.value=b),"provider-name":(n=u.value)==null?void 0:n.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1}),i(t(x),{title:"Advanced"},{default:d(()=>[i(t(w),{modelValue:s.value,"onUpdate:modelValue":l[1]||(l[1]=n=>s.value=n),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{j as default}; diff --git a/assets/deepseek-d4Q8Txxg.js b/assets/deepseek-d4Q8Txxg.js new file mode 100644 index 0000000000000000000000000000000000000000..4f6f260acd56115c926a9170d1504355dbf1b363 --- /dev/null +++ b/assets/deepseek-d4Q8Txxg.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as k,i as U,bE as V,s as y,h as m,m as $,w as K,x as h,o as x,y as d,b as r,e as t}from"./index-Dn5R1iW2.js";import{u as w}from"./providers-Li1UUmJz.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as N,b as P,c as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const a="deepseek",D=k({__name:"deepseek",setup(S){const{t:p}=U(),_=V(),c=w(),{providers:o}=y(c),n=m(()=>c.getProviderMetadata(a)),l=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),i=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;c.initializeProvider(a),l.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),K([l,i],()=>{o.value[a]={...o.value[a],apiKey:l.value,baseUrl:i.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var v,f;return x(),h(t(R),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:d(()=>[r(t(N),null,{default:d(()=>[r(t(P),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:d(()=>{var u;return[r(t(M),{modelValue:l.value,"onUpdate:modelValue":s[0]||(s[0]=g=>l.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:d(()=>[r(t(C),{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=u=>i.value=u),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{D as default}; diff --git a/assets/default-DGYx1wbw.js b/assets/default-KObnLwB5.js similarity index 89% rename from assets/default-DGYx1wbw.js rename to assets/default-KObnLwB5.js index 4fee7cf74096a904f9b875f7a57205c934a96fdd..619eabb49d56899cd858b586f3d29b629558b80b 100644 --- a/assets/default-DGYx1wbw.js +++ b/assets/default-KObnLwB5.js @@ -1 +1 @@ -import{d as n,u as r,c,a,b as t,e,n as i,R as m,o as l}from"./index-DfQ41DTF.js";import{H as x}from"./HeaderLink-krzA17lf.js";const f={"mb-4":"","w-full":"","gap-2":"",class:"px-0 py-1 md:px-3 md:py-3"},_={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col gap-4","mx-auto":"","max-w-screen-lg":""},$=n({__name:"default",setup(u){const{top:o,right:p,bottom:s,left:d}=r();return(g,y)=>(l(),c("div",{"p-2":"",style:i({paddingTop:`${e(o)}px`,paddingRight:`${e(p)}px`,paddingBottom:`${e(s)}px`,paddingLeft:`${e(d)}px`})},[a("div",f,[t(x)]),a("div",_,[t(e(m))])],4))}});export{$ as default}; +import{d as n,u as r,c,a,b as t,e,n as i,R as m,o as l}from"./index-Dn5R1iW2.js";import{H as x}from"./HeaderLink-CWVUXFCL.js";const f={"mb-4":"","w-full":"","gap-2":"",class:"px-0 py-1 md:px-3 md:py-3"},_={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col gap-4","mx-auto":"","max-w-screen-lg":""},$=n({__name:"default",setup(u){const{top:o,right:p,bottom:s,left:d}=r();return(g,y)=>(l(),c("div",{"p-2":"",style:i({paddingTop:`${e(o)}px`,paddingRight:`${e(p)}px`,paddingBottom:`${e(s)}px`,paddingLeft:`${e(d)}px`})},[a("div",f,[t(x)]),a("div",_,[t(e(m))])],4))}});export{$ as default}; diff --git a/assets/default-node-CKggh1Nm.js b/assets/default-node-C-2Juvjq.js similarity index 89% rename from assets/default-node-CKggh1Nm.js rename to assets/default-node-C-2Juvjq.js index aebf466677037fa30e6cbd9e4398ac393e864e9d..aabbbcbb0a144c01c4e1099afba7c9a0d31e4593 100644 --- a/assets/default-node-CKggh1Nm.js +++ b/assets/default-node-C-2Juvjq.js @@ -1 +1 @@ -import{cp as t}from"./index-DfQ41DTF.js";async function s(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:c}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:c}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{s as getBundles}; +import{cp as t}from"./index-Dn5R1iW2.js";async function s(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:c}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:c}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{s as getBundles}; diff --git a/assets/delays-BrYcT-eG.js b/assets/delays-g2QNcYY7.js similarity index 78% rename from assets/delays-BrYcT-eG.js rename to assets/delays-g2QNcYY7.js index a62adba69ffa906e2918ae50f197ca9264bf538a..a2b1fce3c203453390153cc55b18b65ddfa0b8d5 100644 --- a/assets/delays-BrYcT-eG.js +++ b/assets/delays-g2QNcYY7.js @@ -1 +1 @@ -import{b as v,_,l as b}from"./queues-CiZ1BAMa.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import"./index-E4dUVNwC.js";import{d as k,g as d,c as s,o as l,a as e,b as y,e as x,D as i,bx as f,by as p}from"./index-DfQ41DTF.js";import"./queue-Cg3xGvOu.js";const z={flex:"","flex-col":"","gap-2":"","p-2":""},w={flex:"","flex-row":"","gap-2":""},h={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},V={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},D={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},N=k({__name:"delays",setup(E){const t=d(""),m=d([]),c=d([]),r=d(!1),u=v();u.onHandlerEvent("delay",a=>{c.value.push(a)});function g(){r.value=!0;const a=t.value.split("");for(const n of a)u.add(n);u.add(b),t.value="",r.value=!1}return(a,n)=>(l(),s("div",z,[e("div",w,[y(x(_),{modelValue:t.value,"onUpdate:modelValue":n[0]||(n[0]=o=>t.value=o),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:g},null,8,["modelValue"]),e("button",h,i(r.value?"Processing...":"Send"),1)]),e("div",M,[e("div",V,[n[1]||(n[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(l(!0),s(f,null,p(m.value,o=>(l(),s("div",{key:o},[e("div",null,i(o),1)]))),128))]),e("div",D,[n[2]||(n[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(l(!0),s(f,null,p(c.value,o=>(l(),s("div",{key:o},[e("div",null,i(o)+"s",1)]))),128))])])]))}});export{N as default}; +import{b as v,_,l as b}from"./queues-CxsPIAz3.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import"./index-Dr3dNwKO.js";import{d as k,g as d,c as s,o as l,a as e,b as y,e as x,D as i,bx as f,by as p}from"./index-Dn5R1iW2.js";import"./queue-D3IvB2cI.js";const z={flex:"","flex-col":"","gap-2":"","p-2":""},w={flex:"","flex-row":"","gap-2":""},h={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},V={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},D={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},N=k({__name:"delays",setup(E){const t=d(""),m=d([]),c=d([]),r=d(!1),u=v();u.onHandlerEvent("delay",a=>{c.value.push(a)});function g(){r.value=!0;const a=t.value.split("");for(const n of a)u.add(n);u.add(b),t.value="",r.value=!1}return(a,n)=>(l(),s("div",z,[e("div",w,[y(x(_),{modelValue:t.value,"onUpdate:modelValue":n[0]||(n[0]=o=>t.value=o),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:g},null,8,["modelValue"]),e("button",h,i(r.value?"Processing...":"Send"),1)]),e("div",M,[e("div",V,[n[1]||(n[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(l(!0),s(f,null,p(m.value,o=>(l(),s("div",{key:o},[e("div",null,i(o),1)]))),128))]),e("div",D,[n[2]||(n[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(l(!0),s(f,null,p(c.value,o=>(l(),s("div",{key:o},[e("div",null,i(o)+"s",1)]))),128))])])]))}});export{N as default}; diff --git a/assets/elevenlabs-BGpCIoDX.js b/assets/elevenlabs-BGpCIoDX.js new file mode 100644 index 0000000000000000000000000000000000000000..204a7482c20d040a3ceb7122bfb47e681d13dddd --- /dev/null +++ b/assets/elevenlabs-BGpCIoDX.js @@ -0,0 +1 @@ +import{bx as F,d as V,bP as ue,bQ as I,bR as de,bS as K,x as B,o as f,y as C,p as D,e as s,bT as ce,bU as pe,g as w,h,bV as G,bW as ve,bX as me,w as ae,c as k,by as H,E as fe,bY as be,C as A,bZ as ge,bM as ye,bO as W,b as x,bN as le,a as c,D as y,i as he,bE as xe,s as _e,m as ke,H as Ve,A as z,bH as Se,bI as te,z as we}from"./index-Dn5R1iW2.js";import{R as $e}from"./Range-CI9YqvjT.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{u as Ce}from"./providers-Li1UUmJz.js";import{u as Be,v as Ue}from"./speech-Ci8yfKRf.js";import{_ as Ee,a as je}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as Oe}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as Pe,b as Re,c as Le}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import{g as Me}from"./index-DLIkN3Ho.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";function se(o){return o?o.flatMap(e=>e.type===F?se(e.children):[e]):[]}const Ae=V({name:"PrimitiveSlot",inheritAttrs:!1,setup(o,{attrs:e,slots:d}){return()=>{var b,S;if(!d.default)return null;const n=se(d.default()),r=n.findIndex(g=>g.type!==ue);if(r===-1)return n;const t=n[r];(b=t.props)==null||delete b.ref;const u=t.props?I(e,t.props):e;e.class&&((S=t.props)!=null&&S.class)&&delete t.props.class;const m=de(t,u);for(const g in u)g.startsWith("on")&&(m.props||(m.props={}),m.props[g]=u[g]);return n.length===1?m:(n[r]=m,n)}}}),Q=V({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(o,{attrs:e,slots:d}){const n=o.asChild?"template":o.as;return typeof n=="string"&&["area","img","input"].includes(n)?()=>K(n,e):n!=="template"?()=>K(o.as,e,{default:d.default}):()=>K(Ae,e,{default:d.default})}}),Te=V({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(o){return(e,d)=>(f(),B(s(Q),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:C(()=>[D(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function qe(o,e){const d=`${o}Context`,n=Symbol(d);return[u=>{const m=ce(n,u);if(m||m===null)return m;throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(o)?`one of the following components: ${o.join(", ")}`:`\`${o}\``}`)},u=>(pe(n,u),u)]}function oe(){const o=ve(),e=w(),d=h(()=>{var u,m;return["#text","#comment"].includes((u=e.value)==null?void 0:u.$el.nodeName)?(m=e.value)==null?void 0:m.$el.nextElementSibling:G(e)}),n=Object.assign({},o.exposed),r={};for(const u in o.props)Object.defineProperty(r,u,{enumerable:!0,configurable:!0,get:()=>o.props[u]});if(Object.keys(n).length>0)for(const u in n)Object.defineProperty(r,u,{enumerable:!0,configurable:!0,get:()=>n[u]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>o.vnode.el}),o.exposed=r;function t(u){e.value=u,u&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>u instanceof Element?u:u.$el}),o.exposed=r)}return{forwardRef:t,currentRef:e,currentElement:d}}function Fe(){const o=w(),e=h(()=>{var d,n;return["#text","#comment"].includes((d=o.value)==null?void 0:d.$el.nodeName)?(n=o.value)==null?void 0:n.$el.nextElementSibling:G(o)});return{primitiveElement:o,currentElement:e}}function Ie(o){return h(()=>{var e;return me(o)?!!((e=G(o))!=null&&e.closest("form")):!0})}const Ne=V({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(o){const e=o,{primitiveElement:d,currentElement:n}=Fe(),r=h(()=>e.checked??e.value);return ae(r,(t,u)=>{if(!n.value)return;const m=n.value,b=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(b,"value").set;if(g&&t!==u){const v=new Event("input",{bubbles:!0}),_=new Event("change",{bubbles:!0});g.call(m,t),m.dispatchEvent(v),m.dispatchEvent(_)}}),(t,u)=>(f(),B(Te,I({ref_key:"primitiveElement",ref:d},{...e,...t.$attrs},{as:"input"}),null,16))}}),Ke=V({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(o){const e=o,d=h(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((n,r)=>typeof n=="object"?Object.entries(n).map(([t,u])=>({name:`[${e.name}][${r}][${t}]`,value:u})):{name:`[${e.name}][${r}]`,value:n}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([n,r])=>({name:`[${e.name}][${n}]`,value:r})):[]);return(n,r)=>(f(!0),k(F,null,H(d.value,t=>(f(),B(Ne,I({key:t.name,ref_for:!0},{...e,...n.$attrs},{name:t.name,value:t.value}),null,16,["name","value"]))),128))}}),[ze,He]=qe("SwitchRoot"),De=V({__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(o,{emit:e}){const d=o,n=e,{disabled:r}=fe(d),t=be(d,"modelValue",n,{defaultValue:d.defaultValue,passive:d.modelValue===void 0});function u(){r.value||(t.value=!t.value)}const{forwardRef:m,currentElement:b}=oe(),S=Ie(b),g=h(()=>{var v;return d.id&&b.value?(v=document.querySelector(`[for="${d.id}"]`))==null?void 0:v.innerText:void 0});return He({modelValue:t,toggleCheck:u,disabled:r}),(v,_)=>(f(),B(s(Q),I(v.$attrs,{id:v.id,ref:s(m),role:"switch",type:v.as==="button"?"button":void 0,value:v.value,"aria-label":v.$attrs["aria-label"]||g.value,"aria-checked":s(t),"aria-required":v.required,"data-state":s(t)?"checked":"unchecked","data-disabled":s(r)?"":void 0,"as-child":v.asChild,as:v.as,disabled:s(r),onClick:u,onKeydown:ge(ye(u,["prevent"]),["enter"])}),{default:C(()=>[D(v.$slots,"default",{modelValue:s(t)}),s(S)&&v.name?(f(),B(s(Ke),{key:0,type:"checkbox",name:v.name,disabled:s(r),required:v.required,value:v.value,checked:!!s(t)},null,8,["name","disabled","required","value","checked"])):A("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),Ge=V({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(o){const e=ze();return oe(),(d,n)=>{var r;return f(),B(s(Q),{"data-state":(r=s(e).modelValue)!=null&&r.value?"checked":"unchecked","data-disabled":s(e).disabled.value?"":void 0,"as-child":d.asChild,as:d.as},{default:C(()=>[D(d.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),We=V({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=W(o,"modelValue");return(d,n)=>(f(),B(s(De),{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=r=>e.value=r),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 dark:data-[state=checked]:primary-700 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:C(()=>[x(s(Ge),{"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"]))}}),Qe={flex:"~ col gap-4"},Xe={flex:"~ row","items-center":"","gap-2":""},Ye={flex:"1"},Ze={class:"flex items-center gap-1 text-sm font-medium"},Je={class:"text-xs text-neutral-500 dark:text-neutral-400"},et=V({__name:"FieldCheckbox",props:le({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const e=o,d=W(o,"modelValue");return(n,r)=>(f(),k("label",Qe,[c("div",Xe,[c("div",Ye,[c("div",Ze,y(e.label),1),c("div",Je,y(e.description),1)]),x(We,{modelValue:d.value,"onUpdate:modelValue":r[0]||(r[0]=t=>d.value=t)},null,8,["modelValue"])])]))}}),tt={flex:"~ col gap-4"},at={flex:"~ row","items-center":"","gap-2":""},lt={flex:"1"},st={class:"flex items-center gap-1 text-sm font-medium"},ot={class:"text-xs text-neutral-500 dark:text-neutral-400"},nt={"font-mono":""},it={flex:"~ row","items-center":"","gap-2":""},q=V({__name:"FieldRange",props:le({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const e=o,d=W(o,"modelValue");return(n,r)=>{var t;return f(),k("label",tt,[c("div",at,[c("div",lt,[c("div",st,y(o.label),1),c("div",ot,y(o.description),1)]),c("span",nt,y((t=e.formatValue)==null?void 0:t.call(e,d.value)),1)]),c("div",it,[x($e,{modelValue:d.value,"onUpdate:modelValue":r[0]||(r[0]=u=>d.value=u),min:o.min||0,max:o.max||1,step:o.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}}),rt={flex:"~ col md:row gap-6"},ut={flex:"~ col gap-6"},dt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},ct={flex:"~ col gap-4"},pt={flex:"~ col gap-6",class:"w-full md:w-[60%]"},vt={"rounded-xl":""},mt={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},ft={flex:"~ col gap-4"},bt=["placeholder"],gt={flex:"~ col gap-6"},yt={grid:"~ cols-2 gap-4"},ht={class:"flex items-center gap-1 text-sm font-medium"},xt={class:"text-xs text-neutral-500 dark:text-neutral-400"},_t=["value"],kt={grid:"~ cols-2 gap-4"},Vt={class:"flex items-center gap-1 text-sm font-medium"},St={class:"text-xs text-neutral-500 dark:text-neutral-400"},wt=["value"],$t={flex:"~ row","gap-4":""},Ct=["disabled"],Bt={flex:"~ row","items-center":"","gap-2":""},Ut={key:0,class:"mt-2 text-sm text-red-500"},Et={key:1,class:"mt-2 text-sm text-red-500"},jt=["src"],l="elevenlabs",Kt=V({__name:"elevenlabs",setup(o){const{t:e}=he(),d=xe(),n=Ce(),r=Be(),{providers:t}=_e(n),u=w("Hello! This is a test of the ElevenLabs voice synthesis."),m=w(!1),b=w(""),S=w(""),g=w(null),v=h(()=>n.getProviderMetadata(l)),_=h({get:()=>{var i;return((i=t.value[l])==null?void 0:i.apiKey)||""},set:i=>{t.value[l]||(t.value[l]={}),t.value[l].apiKey=i}}),L=h({get:()=>{var i,a,$;return((i=t.value[l])==null?void 0:i.baseUrl)||(($=(a=v.value)==null?void 0:a.defaultOptions)==null?void 0:$.baseUrl)||""},set:i=>{t.value[l]||(t.value[l]={}),t.value[l].baseUrl=i}}),E=h({get:()=>{var i,a;return((a=(i=t.value[l])==null?void 0:i.voiceSettings)==null?void 0:a.similarityBoost)??.75},set:i=>{t.value[l]||(t.value[l]={}),t.value[l].voiceSettings||(t.value[l].voiceSettings={}),t.value[l].voiceSettings.similarityBoost=i}}),j=h({get:()=>{var i,a;return((a=(i=t.value[l])==null?void 0:i.voiceSettings)==null?void 0:a.stability)??.5},set:i=>{t.value[l]||(t.value[l]={}),t.value[l].voiceSettings||(t.value[l].voiceSettings={}),t.value[l].voiceSettings.stability=i}}),O=h({get:()=>{var i,a;return((a=(i=t.value[l])==null?void 0:i.voiceSettings)==null?void 0:a.speed)??1},set:i=>{t.value[l]||(t.value[l]={}),t.value[l].voiceSettings||(t.value[l].voiceSettings={}),t.value[l].voiceSettings.speed=i}}),P=h({get:()=>{var i,a;return((a=(i=t.value[l])==null?void 0:i.voiceSettings)==null?void 0:a.style)??0},set:i=>{t.value[l]||(t.value[l]={}),t.value[l].voiceSettings||(t.value[l].voiceSettings={}),t.value[l].style=i}}),R=h({get:()=>{var i,a;return((a=(i=t.value[l])==null?void 0:i.voiceSettings)==null?void 0:a.useSpeakerBoost)!==!1},set:i=>{t.value[l]||(t.value[l]={}),t.value[l].voiceSettings||(t.value[l].voiceSettings={}),t.value[l].voiceSettings.useSpeakerBoost=i}}),X=w(r.selectedLanguage),N=w(r.voiceName),ne=h(()=>r.availableVoicesForLanguage);ke(()=>{var i,a,$,M,p,U,T,Z,J,ee;n.initializeProvider(l),_.value=((i=t.value[l])==null?void 0:i.apiKey)||"",L.value=((a=t.value[l])==null?void 0:a.baseUrl)||((M=($=v.value)==null?void 0:$.defaultOptions)==null?void 0:M.baseUrl)||"",(p=t.value[l])!=null&&p.voiceSettings&&(E.value=((U=t.value[l].voiceSettings)==null?void 0:U.similarityBoost)??.75,j.value=((T=t.value[l].voiceSettings)==null?void 0:T.stability)??.5,O.value=((Z=t.value[l].voiceSettings)==null?void 0:Z.speed)??1,P.value=((J=t.value[l].voiceSettings)==null?void 0:J.style)??0,R.value=((ee=t.value[l].voiceSettings)==null?void 0:ee.useSpeakerBoost)!==!1),n.configuredProviders[l]&&r.loadVoicesForProvider(l)}),ae([_,L,E,j,O,P,R],()=>{var i,a;t.value[l]={...t.value[l],apiKey:_.value,baseUrl:L.value||((a=(i=v.value)==null?void 0:i.defaultOptions)==null?void 0:a.baseUrl)||"",voiceSettings:{similarityBoost:E.value,stability:j.value,speed:O.value,style:P.value,useSpeakerBoost:R.value}}});async function ie(){if(!u.value.trim())return;const i=n.getProviderInstance(l);if(!i){console.error("Failed to initialize speech provider");return}m.value=!0,S.value="";try{b.value&&Y();const a=await Me({...i.speech("eleven_multilingual_v2",{voiceSettings:{stability:j.value,similarityBoost:E.value,speed:O.value,style:P.value,useSpeakerBoost:R.value}}),input:u.value,voice:Ue[N.value]});b.value=URL.createObjectURL(new Blob([a])),setTimeout(()=>{g.value&&g.value.play()},100)}catch(a){console.error("Error generating speech:",a),S.value=a instanceof Error?a.message:"An unknown error occurred"}finally{m.value=!1}}function Y(){g.value&&(g.value.pause(),g.value.currentTime=0),b.value&&(URL.revokeObjectURL(b.value),b.value="")}Ve(()=>{b.value&&URL.revokeObjectURL(b.value)});function re(){var i;t.value[l]={...(i=v.value)==null?void 0:i.defaultOptions}}return(i,a)=>{var $,M;return f(),B(s(Le),{"provider-name":($=v.value)==null?void 0:$.localizedName,"provider-icon":(M=v.value)==null?void 0:M.icon,"on-back":()=>s(d).back()},{default:C(()=>[c("div",rt,[x(s(Pe),{class:"w-full md:w-[40%]"},{default:C(()=>[x(s(Re),{title:s(e)("settings.pages.providers.common.section.basic.title"),description:s(e)("settings.pages.providers.common.section.basic.description"),"on-reset":re},{default:C(()=>{var p;return[x(s(Oe),{modelValue:_.value,"onUpdate:modelValue":a[0]||(a[0]=U=>_.value=U),"provider-name":(p=v.value)==null?void 0:p.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),c("div",ut,[c("h2",dt,y(s(e)("settings.pages.providers.common.section.voice.title")),1),c("div",ct,[x(s(q),{modelValue:E.value,"onUpdate:modelValue":a[1]||(a[1]=p=>E.value=p),label:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),x(s(q),{modelValue:j.value,"onUpdate:modelValue":a[2]||(a[2]=p=>j.value=p),label:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),x(s(q),{modelValue:O.value,"onUpdate:modelValue":a[3]||(a[3]=p=>O.value=p),label:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.speed.label"),description:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.speed.description"),min:.7,max:1.2,step:.01},null,8,["modelValue","label","description"]),x(s(q),{modelValue:P.value,"onUpdate:modelValue":a[4]||(a[4]=p=>P.value=p),label:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),x(s(et),{modelValue:R.value,"onUpdate:modelValue":a[5]||(a[5]=p=>R.value=p),label:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:s(e)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])])]),x(s(Ee),{title:s(e)("settings.pages.providers.common.section.advanced.title")},{default:C(()=>{var p,U;return[x(s(je),{modelValue:L.value,"onUpdate:modelValue":a[6]||(a[6]=T=>L.value=T),placeholder:((U=(p=v.value)==null?void 0:p.defaultOptions)==null?void 0:U.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1}),c("div",pt,[c("div",vt,[c("h2",mt,y(s(e)("settings.pages.providers.provider.elevenlabs.playground.title")),1),c("div",ft,[z(c("textarea",{"onUpdate:modelValue":a[7]||(a[7]=p=>u.value=p),placeholder:s(e)("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,bt),[[Se,u.value]]),c("div",gt,[c("label",yt,[c("div",null,[c("div",ht,y(s(e)("settings.pages.providers.provider.elevenlabs.playground.fields.field.language.label")),1),c("div",xt,y(s(e)("settings.pages.providers.provider.elevenlabs.playground.fields.field.language.description")),1)]),z(c("select",{"onUpdate:modelValue":a[8]||(a[8]=p=>X.value=p),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":""},[(f(!0),k(F,null,H(s(r).availableLanguages,p=>(f(),k("option",{key:p,value:p},y(p),9,_t))),128))],512),[[te,X.value]])]),c("label",kt,[c("div",null,[c("div",Vt,y(s(e)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),c("div",St,y(s(e)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),z(c("select",{"onUpdate:modelValue":a[9]||(a[9]=p=>N.value=p),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":""},[(f(!0),k(F,null,H(ne.value,p=>(f(),k("option",{key:p.id,value:p.name},y(p.name),9,wt))),128))],512),[[te,N.value]])])]),c("div",$t,[c("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:m.value||!u.value.trim()||!_.value,class:we({"opacity-50 cursor-not-allowed":m.value||!u.value.trim()||!_.value}),bg:"neutral-700 dark:neutral-300",onClick:ie},[c("div",Bt,[a[10]||(a[10]=c("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),c("span",null,y(m.value?s(e)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):s(e)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Ct),b.value?(f(),k("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:Y},a[11]||(a[11]=[c("div",{flex:"~ row","items-center":"","gap-2":""},[c("div",{"i-solar:stop-circle-bold-duotone":""}),c("span",null,"Stop")],-1)]))):A("",!0)]),_.value?A("",!0):(f(),k("div",Ut,y(s(e)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),S.value?(f(),k("div",Et,y(S.value),1)):A("",!0),b.value?(f(),k("audio",{key:2,ref_key:"audioPlayer",ref:g,src:b.value,controls:"",class:"mt-2 w-full"},null,8,jt)):A("",!0)])])])])]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{Kt as default}; diff --git a/assets/elevenlabs-BxwtmmmG.js b/assets/elevenlabs-BxwtmmmG.js deleted file mode 100644 index 318736e6aaf4d6249cc9bcef7bf5dc09f06554f5..0000000000000000000000000000000000000000 --- a/assets/elevenlabs-BxwtmmmG.js +++ /dev/null @@ -1 +0,0 @@ -import{bx as q,d as k,bP as re,bQ as F,bR as ue,bS as N,x as C,o as b,y as B,p as H,e as p,bT as de,bU as ce,g as S,h as g,bV as G,bW as ve,bX as pe,w as te,c as V,by as z,E as me,bY as fe,C as M,bZ as be,bM as ge,bO as D,b as y,bN as ae,a as d,D as _,bE as ye,s as he,m as xe,H as Ve,A as K,bH as ke,bI as ee,z as Se}from"./index-DfQ41DTF.js";import{R as _e}from"./Range-naQD8Ont.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{u as we}from"./providers-CM7Pgz9x.js";import{u as $e,v as Be}from"./speech-Dcq6O7ME.js";import{_ as Ce,a as Ee}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as Ue}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as Pe,b as je,c as Oe}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import{g as Re}from"./index-bumnzUvc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";function le(n){return n?n.flatMap(t=>t.type===q?le(t.children):[t]):[]}const Le=k({name:"PrimitiveSlot",inheritAttrs:!1,setup(n,{attrs:t,slots:i}){return()=>{var h,x;if(!i.default)return null;const o=le(i.default()),e=o.findIndex(f=>f.type!==re);if(e===-1)return o;const r=o[e];(h=r.props)==null||delete h.ref;const u=r.props?F(t,r.props):t;t.class&&((x=r.props)!=null&&x.class)&&delete r.props.class;const v=ue(r,u);for(const f in u)f.startsWith("on")&&(v.props||(v.props={}),v.props[f]=u[f]);return o.length===1?v:(o[e]=v,o)}}}),W=k({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(n,{attrs:t,slots:i}){const o=n.asChild?"template":n.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>N(o,t):o!=="template"?()=>N(n.as,t,{default:i.default}):()=>N(Le,t,{default:i.default})}}),Me=k({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(n){return(t,i)=>(b(),C(p(W),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.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:B(()=>[H(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function Ae(n,t){const i=`${n}Context`,o=Symbol(i);return[u=>{const v=de(o,u);if(v||v===null)return v;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(n)?`one of the following components: ${n.join(", ")}`:`\`${n}\``}`)},u=>(ce(o,u),u)]}function ne(){const n=ve(),t=S(),i=g(()=>{var u,v;return["#text","#comment"].includes((u=t.value)==null?void 0:u.$el.nodeName)?(v=t.value)==null?void 0:v.$el.nextElementSibling:G(t)}),o=Object.assign({},n.exposed),e={};for(const u in n.props)Object.defineProperty(e,u,{enumerable:!0,configurable:!0,get:()=>n.props[u]});if(Object.keys(o).length>0)for(const u in o)Object.defineProperty(e,u,{enumerable:!0,configurable:!0,get:()=>o[u]});Object.defineProperty(e,"$el",{enumerable:!0,configurable:!0,get:()=>n.vnode.el}),n.exposed=e;function r(u){t.value=u,u&&(Object.defineProperty(e,"$el",{enumerable:!0,configurable:!0,get:()=>u instanceof Element?u:u.$el}),n.exposed=e)}return{forwardRef:r,currentRef:t,currentElement:i}}function Te(){const n=S(),t=g(()=>{var i,o;return["#text","#comment"].includes((i=n.value)==null?void 0:i.$el.nodeName)?(o=n.value)==null?void 0:o.$el.nextElementSibling:G(n)});return{primitiveElement:n,currentElement:t}}function qe(n){return g(()=>{var t;return pe(n)?!!((t=G(n))!=null&&t.closest("form")):!0})}const Fe=k({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(n){const t=n,{primitiveElement:i,currentElement:o}=Te(),e=g(()=>t.checked??t.value);return te(e,(r,u)=>{if(!o.value)return;const v=o.value,h=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(h,"value").set;if(f&&r!==u){const m=new Event("input",{bubbles:!0}),w=new Event("change",{bubbles:!0});f.call(v,r),v.dispatchEvent(m),v.dispatchEvent(w)}}),(r,u)=>(b(),C(Me,F({ref_key:"primitiveElement",ref:i},{...t,...r.$attrs},{as:"input"}),null,16))}}),Ie=k({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(n){const t=n,i=g(()=>typeof t.value=="string"||typeof t.value=="number"||typeof t.value=="boolean"?[{name:t.name,value:t.value}]:typeof t.value=="object"&&Array.isArray(t.value)?t.value.flatMap((o,e)=>typeof o=="object"?Object.entries(o).map(([r,u])=>({name:`[${t.name}][${e}][${r}]`,value:u})):{name:`[${t.name}][${e}]`,value:o}):t.value!==null&&typeof t.value=="object"&&!Array.isArray(t.value)?Object.entries(t.value).map(([o,e])=>({name:`[${t.name}][${o}]`,value:e})):[]);return(o,e)=>(b(!0),V(q,null,z(i.value,r=>(b(),C(Fe,F({key:r.name,ref_for:!0},{...t,...o.$attrs},{name:r.name,value:r.value}),null,16,["name","value"]))),128))}}),[Ne,Ke]=Ae("SwitchRoot"),ze=k({__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(n,{emit:t}){const i=n,o=t,{disabled:e}=me(i),r=fe(i,"modelValue",o,{defaultValue:i.defaultValue,passive:i.modelValue===void 0});function u(){e.value||(r.value=!r.value)}const{forwardRef:v,currentElement:h}=ne(),x=qe(h),f=g(()=>{var m;return i.id&&h.value?(m=document.querySelector(`[for="${i.id}"]`))==null?void 0:m.innerText:void 0});return Ke({modelValue:r,toggleCheck:u,disabled:e}),(m,w)=>(b(),C(p(W),F(m.$attrs,{id:m.id,ref:p(v),role:"switch",type:m.as==="button"?"button":void 0,value:m.value,"aria-label":m.$attrs["aria-label"]||f.value,"aria-checked":p(r),"aria-required":m.required,"data-state":p(r)?"checked":"unchecked","data-disabled":p(e)?"":void 0,"as-child":m.asChild,as:m.as,disabled:p(e),onClick:u,onKeydown:be(ge(u,["prevent"]),["enter"])}),{default:B(()=>[H(m.$slots,"default",{modelValue:p(r)}),p(x)&&m.name?(b(),C(p(Ie),{key:0,type:"checkbox",name:m.name,disabled:p(e),required:m.required,value:m.value,checked:!!p(r)},null,8,["name","disabled","required","value","checked"])):M("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),He=k({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(n){const t=Ne();return ne(),(i,o)=>{var e;return b(),C(p(W),{"data-state":(e=p(t).modelValue)!=null&&e.value?"checked":"unchecked","data-disabled":p(t).disabled.value?"":void 0,"as-child":i.asChild,as:i.as},{default:B(()=>[H(i.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),Ge=k({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(n){const t=D(n,"modelValue");return(i,o)=>(b(),C(p(ze),{modelValue:t.value,"onUpdate:modelValue":o[0]||(o[0]=e=>t.value=e),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 dark:data-[state=checked]:primary-700 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:B(()=>[y(p(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"]))}}),De={flex:"~ col gap-4"},We={flex:"~ row","items-center":"","gap-2":""},Qe={flex:"1"},Xe={class:"flex items-center gap-1 text-sm font-medium"},Ye={class:"text-xs text-neutral-500 dark:text-neutral-400"},Ze=k({__name:"FieldCheckbox",props:ae({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const t=n,i=D(n,"modelValue");return(o,e)=>(b(),V("label",De,[d("div",We,[d("div",Qe,[d("div",Xe,_(t.label),1),d("div",Ye,_(t.description),1)]),y(Ge,{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=r=>i.value=r)},null,8,["modelValue"])])]))}}),Je={flex:"~ col gap-4"},et={flex:"~ row","items-center":"","gap-2":""},tt={flex:"1"},at={class:"flex items-center gap-1 text-sm font-medium"},lt={class:"text-xs text-neutral-500 dark:text-neutral-400"},nt={"font-mono":""},ot={flex:"~ row","items-center":"","gap-2":""},T=k({__name:"FieldRange",props:ae({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const t=n,i=D(n,"modelValue");return(o,e)=>{var r;return b(),V("label",Je,[d("div",et,[d("div",tt,[d("div",at,_(n.label),1),d("div",lt,_(n.description),1)]),d("span",nt,_((r=t.formatValue)==null?void 0:r.call(t,i.value)),1)]),d("div",ot,[y(_e,{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=u=>i.value=u),min:n.min||0,max:n.max||1,step:n.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}}),st={flex:"~ col md:row gap-6"},it={flex:"~ col gap-6"},rt={flex:"~ col gap-4"},ut={flex:"~ col gap-6",class:"w-full md:w-[60%]"},dt={"rounded-xl":""},ct={flex:"~ col gap-4"},vt={flex:"~ col gap-6"},pt={grid:"~ cols-2 gap-4"},mt=["value"],ft={grid:"~ cols-2 gap-4"},bt=["value"],gt={flex:"~ row","gap-4":""},yt=["disabled"],ht={flex:"~ row","items-center":"","gap-2":""},xt={key:0,class:"mt-2 text-sm text-red-500"},Vt={key:1,class:"mt-2 text-sm text-red-500"},kt=["src"],l="elevenlabs",Rt=k({__name:"elevenlabs",setup(n){const t=ye(),i=we(),o=$e(),{providers:e}=he(i),r=S("Hello! This is a test of the ElevenLabs voice synthesis."),u=S(!1),v=S(""),h=S(""),x=S(null),f=g(()=>i.getProviderMetadata(l)),m=g({get:()=>{var s;return((s=e.value[l])==null?void 0:s.apiKey)||""},set:s=>{e.value[l]||(e.value[l]={}),e.value[l].apiKey=s}}),w=g({get:()=>{var s,a,$;return((s=e.value[l])==null?void 0:s.baseUrl)||(($=(a=f.value)==null?void 0:a.defaultOptions)==null?void 0:$.baseUrl)||""},set:s=>{e.value[l]||(e.value[l]={}),e.value[l].baseUrl=s}}),U=g({get:()=>{var s,a;return((a=(s=e.value[l])==null?void 0:s.voiceSettings)==null?void 0:a.similarityBoost)??.75},set:s=>{e.value[l]||(e.value[l]={}),e.value[l].voiceSettings||(e.value[l].voiceSettings={}),e.value[l].voiceSettings.similarityBoost=s}}),P=g({get:()=>{var s,a;return((a=(s=e.value[l])==null?void 0:s.voiceSettings)==null?void 0:a.stability)??.5},set:s=>{e.value[l]||(e.value[l]={}),e.value[l].voiceSettings||(e.value[l].voiceSettings={}),e.value[l].voiceSettings.stability=s}}),j=g({get:()=>{var s,a;return((a=(s=e.value[l])==null?void 0:s.voiceSettings)==null?void 0:a.speed)??1},set:s=>{e.value[l]||(e.value[l]={}),e.value[l].voiceSettings||(e.value[l].voiceSettings={}),e.value[l].voiceSettings.speed=s}}),O=g({get:()=>{var s,a;return((a=(s=e.value[l])==null?void 0:s.voiceSettings)==null?void 0:a.style)??0},set:s=>{e.value[l]||(e.value[l]={}),e.value[l].voiceSettings||(e.value[l].voiceSettings={}),e.value[l].style=s}}),R=g({get:()=>{var s,a;return((a=(s=e.value[l])==null?void 0:s.voiceSettings)==null?void 0:a.useSpeakerBoost)!==!1},set:s=>{e.value[l]||(e.value[l]={}),e.value[l].voiceSettings||(e.value[l].voiceSettings={}),e.value[l].voiceSettings.useSpeakerBoost=s}}),Q=S(o.selectedLanguage),I=S(o.voiceName),oe=g(()=>o.availableVoicesForLanguage);xe(()=>{var s,a,$,L,c,E,A,Y,Z,J;i.initializeProvider(l),m.value=((s=e.value[l])==null?void 0:s.apiKey)||"",w.value=((a=e.value[l])==null?void 0:a.baseUrl)||((L=($=f.value)==null?void 0:$.defaultOptions)==null?void 0:L.baseUrl)||"",(c=e.value[l])!=null&&c.voiceSettings&&(U.value=((E=e.value[l].voiceSettings)==null?void 0:E.similarityBoost)??.75,P.value=((A=e.value[l].voiceSettings)==null?void 0:A.stability)??.5,j.value=((Y=e.value[l].voiceSettings)==null?void 0:Y.speed)??1,O.value=((Z=e.value[l].voiceSettings)==null?void 0:Z.style)??0,R.value=((J=e.value[l].voiceSettings)==null?void 0:J.useSpeakerBoost)!==!1),i.configuredProviders[l]&&o.loadVoicesForProvider(l)}),te([m,w,U,P,j,O,R],()=>{var s,a;e.value[l]={...e.value[l],apiKey:m.value,baseUrl:w.value||((a=(s=f.value)==null?void 0:s.defaultOptions)==null?void 0:a.baseUrl)||"",voiceSettings:{similarityBoost:U.value,stability:P.value,speed:j.value,style:O.value,useSpeakerBoost:R.value}}});async function se(){if(!r.value.trim())return;const s=i.getProviderInstance(l);if(!s){console.error("Failed to initialize speech provider");return}u.value=!0,h.value="";try{v.value&&X();const a=await Re({...s.speech("eleven_multilingual_v2",{voiceSettings:{stability:P.value,similarityBoost:U.value,speed:j.value,style:O.value,useSpeakerBoost:R.value}}),input:r.value,voice:Be[I.value]});v.value=URL.createObjectURL(new Blob([a])),setTimeout(()=>{x.value&&x.value.play()},100)}catch(a){console.error("Error generating speech:",a),h.value=a instanceof Error?a.message:"An unknown error occurred"}finally{u.value=!1}}function X(){x.value&&(x.value.pause(),x.value.currentTime=0),v.value&&(URL.revokeObjectURL(v.value),v.value="")}Ve(()=>{v.value&&URL.revokeObjectURL(v.value)});function ie(){var s;e.value[l]={...(s=f.value)==null?void 0:s.defaultOptions}}return(s,a)=>{var $,L;return b(),C(p(Oe),{"provider-name":($=f.value)==null?void 0:$.localizedName,"provider-icon":(L=f.value)==null?void 0:L.icon,"on-back":()=>p(t).back()},{default:B(()=>[d("div",st,[y(p(Pe),{class:"w-full md:w-[40%]"},{default:B(()=>[y(p(je),{title:"Basic",description:"Essential settings","on-reset":ie},{default:B(()=>{var c;return[y(p(Ue),{modelValue:m.value,"onUpdate:modelValue":a[0]||(a[0]=E=>m.value=E),"provider-name":(c=f.value)==null?void 0:c.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"])]}),_:1}),d("div",it,[a[10]||(a[10]=d("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Settings ",-1)),d("div",rt,[y(p(T),{modelValue:U.value,"onUpdate:modelValue":a[1]||(a[1]=c=>U.value=c),label:"Similarity Boost",description:"Voice similarity adherence",min:0,max:1,step:.01},null,8,["modelValue"]),y(p(T),{modelValue:P.value,"onUpdate:modelValue":a[2]||(a[2]=c=>P.value=c),label:"Stability",description:"Voice stability and randomness",min:0,max:1,step:.01},null,8,["modelValue"]),y(p(T),{modelValue:j.value,"onUpdate:modelValue":a[3]||(a[3]=c=>j.value=c),label:"Speed",description:"Speech generation speed",min:.7,max:1.2,step:.01},null,8,["modelValue"]),y(p(T),{modelValue:O.value,"onUpdate:modelValue":a[4]||(a[4]=c=>O.value=c),label:"Style",description:"Voice style exaggeration",min:0,max:1,step:.01},null,8,["modelValue"]),y(p(Ze),{modelValue:R.value,"onUpdate:modelValue":a[5]||(a[5]=c=>R.value=c),label:"Speaker Boost",description:"Enhance speaker similarity"},null,8,["modelValue"])])]),y(p(Ce),{title:"Advanced"},{default:B(()=>{var c,E;return[y(p(Ee),{modelValue:w.value,"onUpdate:modelValue":a[6]||(a[6]=A=>w.value=A),placeholder:((E=(c=f.value)==null?void 0:c.defaultOptions)==null?void 0:E.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1})]),_:1}),d("div",ut,[d("div",dt,[a[15]||(a[15]=d("h2",{class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Playground ",-1)),d("div",ct,[K(d("textarea",{"onUpdate:modelValue":a[7]||(a[7]=c=>r.value=c),placeholder:"Enter text to test the voice...",border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out","h-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":"",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[ke,r.value]]),d("div",vt,[d("label",pt,[a[11]||(a[11]=d("div",null,[d("div",{class:"flex items-center gap-1 text-sm font-medium"}," Language "),d("div",{class:"text-xs text-neutral-500 dark:text-neutral-400"}," Select voice language ")],-1)),K(d("select",{"onUpdate:modelValue":a[8]||(a[8]=c=>Q.value=c),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":""},[(b(!0),V(q,null,z(p(o).availableLanguages,c=>(b(),V("option",{key:c,value:c},_(c),9,mt))),128))],512),[[ee,Q.value]])]),d("label",ft,[a[12]||(a[12]=d("div",null,[d("div",{class:"flex items-center gap-1 text-sm font-medium"}," Voice "),d("div",{class:"text-xs text-neutral-500 dark:text-neutral-400"}," Select preferred voice ")],-1)),K(d("select",{"onUpdate:modelValue":a[9]||(a[9]=c=>I.value=c),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":""},[(b(!0),V(q,null,z(oe.value,c=>(b(),V("option",{key:c.id,value:c.name},_(c.name),9,bt))),128))],512),[[ee,I.value]])])]),d("div",gt,[d("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||!r.value.trim()||!m.value,class:Se({"opacity-50 cursor-not-allowed":u.value||!r.value.trim()||!m.value}),bg:"neutral-700 dark:neutral-300",onClick:se},[d("div",ht,[a[13]||(a[13]=d("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),d("span",null,_(u.value?"Generating...":"Test Voice"),1)])],10,yt),v.value?(b(),V("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:X},a[14]||(a[14]=[d("div",{flex:"~ row","items-center":"","gap-2":""},[d("div",{"i-solar:stop-circle-bold-duotone":""}),d("span",null,"Stop")],-1)]))):M("",!0)]),m.value?M("",!0):(b(),V("div",xt," Please enter an API key to test the voice. ")),h.value?(b(),V("div",Vt,_(h.value),1)):M("",!0),v.value?(b(),V("audio",{key:2,ref_key:"audioPlayer",ref:x,src:v.value,controls:"",class:"mt-2 w-full"},null,8,kt)):M("",!0)])])])])]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{Rt as default}; diff --git a/assets/emotions-D4NlkiN7.js b/assets/emotions-CrwRBNax.js similarity index 82% rename from assets/emotions-D4NlkiN7.js rename to assets/emotions-CrwRBNax.js index d6c758fb07cc27c645b84f6483a43b6adbf90239..eb4a1676e02bf2e1c5ab35c1684442664bbc25cf 100644 --- a/assets/emotions-D4NlkiN7.js +++ b/assets/emotions-CrwRBNax.js @@ -1 +1 @@ -import{a as _,_ as b,l as k}from"./queues-CiZ1BAMa.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{u as x}from"./queue-Cg3xGvOu.js";import{d as z,g as u,c as s,o as t,a as e,b as h,e as w,D as i,bx as f,by as m}from"./index-DfQ41DTF.js";const y={flex:"","flex-col":"","gap-2":"","p-2":""},M={flex:"","flex-row":"","gap-2":""},V={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},E={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},N=z({__name:"emotions",setup(B){const l=u(""),p=u([]),r=u([]),d=u(!1),g=x({handlers:[async a=>{r.value.push(a.data)}]}),c=_(g);function v(){d.value=!0;const a=l.value.split("");for(const o of a)c.add(o);c.add(k),l.value="",d.value=!1}return(a,o)=>(t(),s("div",y,[e("div",M,[h(w(b),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",V,i(d.value?"Processing...":"Send"),1)]),e("div",E,[e("div",Q,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,m(p.value,n=>(t(),s("div",{key:n},[e("div",null,i(n),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,m(r.value,n=>(t(),s("div",{key:n},[e("div",null,i(n),1)]))),128))])])]))}});export{N as default}; +import{a as _,_ as b,l as k}from"./queues-CxsPIAz3.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{u as x}from"./queue-D3IvB2cI.js";import{d as z,g as u,c as s,o as t,a as e,b as h,e as w,D as i,bx as f,by as m}from"./index-Dn5R1iW2.js";const y={flex:"","flex-col":"","gap-2":"","p-2":""},M={flex:"","flex-row":"","gap-2":""},V={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},E={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},N=z({__name:"emotions",setup(B){const l=u(""),p=u([]),r=u([]),d=u(!1),g=x({handlers:[async a=>{r.value.push(a.data)}]}),c=_(g);function v(){d.value=!0;const a=l.value.split("");for(const o of a)c.add(o);c.add(k),l.value="",d.value=!1}return(a,o)=>(t(),s("div",y,[e("div",M,[h(w(b),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",V,i(d.value?"Processing...":"Send"),1)]),e("div",E,[e("div",Q,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,m(p.value,n=>(t(),s("div",{key:n},[e("div",null,i(n),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,m(r.value,n=>(t(),s("div",{key:n},[e("div",null,i(n),1)]))),128))])])]))}});export{N as default}; diff --git a/assets/filter-message-C0VAb3A6.js b/assets/filter-message-C4iZRRTX.js similarity index 95% rename from assets/filter-message-C0VAb3A6.js rename to assets/filter-message-C4iZRRTX.js index 1aec5066c70f67c9d2c0242b4f8dfbcce01699f2..8071c5aa17859cbcf4186377cc30b29e9dfbedb3 100644 --- a/assets/filter-message-C0VAb3A6.js +++ b/assets/filter-message-C4iZRRTX.js @@ -1 +1 @@ -import{d as g,g as u,r as m,c as v,o as _,a as s,b as x,D as d}from"./index-DfQ41DTF.js";const b={flex:"","flex-col":"","gap-2":"","p-2":""},S={flex:"","flex-row":"","gap-2":""},k={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},w={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},V=g({__name:"filter-message",setup(z){const o=u(""),c=u(!1),i=u({content:""});async function f(r){return new Promise(e=>setTimeout(e,r))}async function p(){c.value=!0;const r=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let l="literal",t="";for(const a of r){await f(50);let n=l;a==="<"?n="special":a===">"&&(n="literal"),l==="literal"&&n==="special"&&(i.value.content+=t,t=""),l==="special"&&n==="literal"&&(t=""),l==="literal"&&n==="literal"&&(i.value.content+=a,t=""),l=n}t&&(i.value.content+=t),o.value="",c.value=!1}return(r,e)=>{const l=m("BasicTextarea");return _(),v("div",b,[s("div",S,[x(l,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",k,d(c.value?"Processing...":"Send"),1)]),s("div",w,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(i.value.content),1)])])}}});export{V as default}; +import{d as g,g as u,r as m,c as v,o as _,a as s,b as x,D as d}from"./index-Dn5R1iW2.js";const b={flex:"","flex-col":"","gap-2":"","p-2":""},S={flex:"","flex-row":"","gap-2":""},k={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},w={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},V=g({__name:"filter-message",setup(z){const o=u(""),c=u(!1),i=u({content:""});async function f(r){return new Promise(e=>setTimeout(e,r))}async function p(){c.value=!0;const r=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let l="literal",t="";for(const a of r){await f(50);let n=l;a==="<"?n="special":a===">"&&(n="literal"),l==="literal"&&n==="special"&&(i.value.content+=t,t=""),l==="special"&&n==="literal"&&(t=""),l==="literal"&&n==="literal"&&(i.value.content+=a,t=""),l=n}t&&(i.value.content+=t),o.value="",c.value=!1}return(r,e)=>{const l=m("BasicTextarea");return _(),v("div",b,[s("div",S,[x(l,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",k,d(c.value?"Processing...":"Send"),1)]),s("div",w,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(i.value.content),1)])])}}});export{V as default}; diff --git a/assets/fireworks-ai-CGayTr7r.js b/assets/fireworks-ai-CGayTr7r.js new file mode 100644 index 0000000000000000000000000000000000000000..6732305a0bd3bade3dc07e9c288401d7f59b2b18 --- /dev/null +++ b/assets/fireworks-ai-CGayTr7r.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as k,i as w,bE as U,s as V,h as c,m as y,w as $,x as K,o as h,y as d,b as l,e as t}from"./index-Dn5R1iW2.js";import{u as x}from"./providers-Li1UUmJz.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as P,b as R,c as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const a="fireworks-ai",D=k({__name:"fireworks-ai",setup(B){const{t:p}=w(),_=U(),v=x(),{providers:o}=V(v),n=c(()=>v.getProviderMetadata(a)),i=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}}),r=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}});y(()=>{var e,s;v.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),$([i,r],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var m,f;return h(),K(t(S),{"provider-name":(m=n.value)==null?void 0:m.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:d(()=>[l(t(P),null,{default:d(()=>[l(t(R),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:d(()=>{var u;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:d(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=u=>r.value=u),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{D as default}; diff --git a/assets/fireworks-ai-ZLkLrHBi.js b/assets/fireworks-ai-ZLkLrHBi.js deleted file mode 100644 index 23249f49cad9da45afe5f16052c19f58fccb0009..0000000000000000000000000000000000000000 --- a/assets/fireworks-ai-ZLkLrHBi.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as k,bE as w,s as U,h as p,m as V,w as y,x as $,o as g,y as d,b as i,e as l}from"./index-DfQ41DTF.js";import{u as K}from"./providers-CM7Pgz9x.js";import{_ as h,a as x}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as M,c as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const a="fireworks-ai",j=k({__name:"fireworks-ai",setup(P){const f=w(),v=K(),{providers:o}=U(v),n=p(()=>v.getProviderMetadata(a)),t=p({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=p({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}});V(()=>{var e,r;v.initializeProvider(a),t.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),y([t,s],()=>{o.value[a]={...o.value[a],apiKey:t.value,baseUrl:s.value||""}});function _(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var m,c;return g(),$(l(N),{"provider-name":(m=n.value)==null?void 0:m.localizedName,"provider-icon":(c=n.value)==null?void 0:c.icon,"on-back":()=>l(f).back()},{default:d(()=>[i(l(B),null,{default:d(()=>[i(l(M),{title:"Basic",description:"Essential settings","on-reset":_},{default:d(()=>{var u;return[i(l(z),{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=b=>t.value=b),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1}),i(l(h),{title:"Advanced"},{default:d(()=>[i(l(x),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=u=>s.value=u),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{j as default}; diff --git a/assets/image-Dj4bQptd.js b/assets/image-DgYLXlCK.js similarity index 95% rename from assets/image-Dj4bQptd.js rename to assets/image-DgYLXlCK.js index de9623e2a2cae8c4b404662da786845ad396d331..db7a0b9e911a493b359f96c671763cca555e3cb2 100644 --- a/assets/image-Dj4bQptd.js +++ b/assets/image-DgYLXlCK.js @@ -1,2 +1,2 @@ -import{d as _,g as c,bD as y,c as d,o as u,a,C as x,D as b,e as v,bn as w}from"./index-DfQ41DTF.js";const C={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},h={key:0},D=["src"],U={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},R=_({__name:"image",setup(k){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(r){return new Promise((e,o)=>{const t=new FileReader;t.onload=s=>{var l,i;e(((i=(l=s.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=s=>{o(s)},t.readAsDataURL(r)})}async function f(r){var t;const o=(t=r.target.files)==null?void 0:t[0];if(o){p.value=o;const s=await m(o);n.value=s}}return(r,e)=>(u(),d("div",null,[a("label",C,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",h,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,D),a("pre",U," "+b(n.value)+` +import{d as _,g as c,bD as y,c as d,o as u,a,C as x,D as b,e as v,bn as w}from"./index-Dn5R1iW2.js";const C={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},h={key:0},D=["src"],U={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},R=_({__name:"image",setup(k){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(r){return new Promise((e,o)=>{const t=new FileReader;t.onload=s=>{var l,i;e(((i=(l=s.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=s=>{o(s)},t.readAsDataURL(r)})}async function f(r){var t;const o=(t=r.target.files)==null?void 0:t[0];if(o){p.value=o;const s=await m(o);n.value=s}}return(r,e)=>(u(),d("div",null,[a("label",C,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",h,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,D),a("pre",U," "+b(n.value)+` `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>v(g)())}," Copy Data URL ")])):x("",!0)]))}}),B=w(R,[["__scopeId","data-v-7edd53e6"]]);export{B as default}; diff --git a/assets/index-DUFhcJBN.js b/assets/index-BGoUir2o.js similarity index 56% rename from assets/index-DUFhcJBN.js rename to assets/index-BGoUir2o.js index 38a1788bcccc615ad9e096a85ce049570eda3590..02037cf943a98332004567e84f47265bca657789 100644 --- a/assets/index-DUFhcJBN.js +++ b/assets/index-BGoUir2o.js @@ -1,8 +1,8 @@ -var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ri=(t,e,n)=>Sa(t,typeof e!="symbol"?e+"":e,n);import{E as Ia,V as Ra,a as Ca,c as Na,r as La,b as Lr,d as Pa,e as Ci,f as Oa,g as Da,h as Fa,s as za,i as Ba,j as Ua}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{f as Gn,g as W,h as Ue,i as ei,t as ja,d as Fe,j as Va,k as Ha,l as ti,w as je,m as fn,c as ie,o as ee,p as mn,q as $a,s as rt,v as dn,x as Wt,y as Be,b as Te,a as O,z as Ct,A as At,B as ni,C as it,D as he,M as gt,T as kt,E as ri,F as qn,G as Jo,Z as Dn,H as Dt,e as X,I as Ga,V as se,S as Ni,Q as Fn,O as $t,J as Pe,P as _t,K as qa,L as es,N as pn,U as ii,W as ze,X as ts,Y as ns,_ as oi,$ as gn,a0 as Ya,a1 as si,a2 as Ka,a3 as rs,a4 as yt,a5 as ai,a6 as Et,a7 as Wa,a8 as is,a9 as Ot,aa as os,ab as Xa,ac as Qa,ad as Za,ae as Ja,af as ss,ag as Yn,ah as el,ai as tl,aj as nl,ak as Pt,al as rl,am as il,an as ol,ao as sl,ap as er,aq as zn,ar as Pr,as as Nt,at as as,au as Or,av as Vt,aw as Li,ax as Lt,ay as Ht,az as tr,aA as al,aB as ll,aC as ul,aD as cl,aE as ls,aF as us,aG as Bn,aH as cs,aI as li,aJ as Un,aK as fs,aL as fl,n as Dr,aM as dl,aN as Fr,aO as ds,aP as pl,aQ as ln,aR as ps,aS as ct,aT as xt,aU as hn,aV as hl,aW as ml,aX as gl,aY as yl,aZ as xl,a_ as ui,a$ as vl,b0 as bl,b1 as wl,b2 as nr,b3 as Tl,b4 as hs,b5 as kl,b6 as Al,b7 as _l,b8 as El,b9 as Ml,ba as rr,bb as Sl,bc as Il,bd as Rl,be as Pi,bf as Oi,bg as Di,bh as Fi,bi as Cl,bj as Nl,bk as Ll,bl as Pl,bm as Ol,bn as Kn,bo as Dl,bp as ms,bq as Fl,br as zl,bs as Bl,bt as Ul,bu as gs,bv as jn,bw as ys,bx as ci,by as fi,bz as jl,bA as ir,bB as Vl,bC as Hl}from"./index-DfQ41DTF.js";import{g as $l}from"./index-bumnzUvc.js";import{u as or}from"./queue-Cg3xGvOu.js";import{u as Gl,a as ql,b as Yl,l as Kl,_ as xs}from"./queues-CiZ1BAMa.js";import{r as Wl,a as Xl,b as Ql,c as Zl,l as Jl,u as di}from"./providers-CM7Pgz9x.js";import{u as eu}from"./speech-Dcq6O7ME.js";import{_ as tu,a as nu,r as nn}from"./Model.vue_vue_type_script_setup_true_lang-CXVrD7v3.js";import{_ as pi}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";import{_ as zi}from"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import{H as ru}from"./HeaderLink-krzA17lf.js";import{u as vs}from"./consciousness-v07tqYpy.js";import{d as Bi}from"./index-E4dUVNwC.js";import{b as Ui}from"./route-block-B_A1xBdJ.js";async function*iu(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 ou(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 su(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let u=0;u<700;u+=80)n.push(e[u]);const r=e.map(u=>u**1.5),i=Math.min(...r),s=Math.max(...r)-i;let a;return s===0?a=r.map(()=>0):a=r.map(u=>(u-i)/s),a.reduce((u,c)=>u+c,0)/e.length}function au(t,e="linear"){switch(e){case"linear":return ou(t);case"minmax":return su(t)}}const bs=Gn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:au})),lu=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 kn(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function uu(t){let e="literal",n="";return{async consume(r){var i,o,s;for(let a=0;a"?(l+=kn(r,a,1),u="literal",a++):l==="<"?u="special":l===">"&&(u="literal"),e==="literal"&&u==="special"?n!==""&&(await((i=t.onLiteral)==null?void 0:i.call(t,n)),n=""):e==="special"&&u==="literal"&&n!==""&&(n+=l,await((o=t.onSpecial)==null?void 0:o.call(t,n)),n=""),e==="literal"&&u==="literal"?(await((s=t.onLiteral)==null?void 0:s.call(t,l)),n=""):e==="special"&&u==="literal"?n="":n+=l,e=u}},async end(){var r,i;n!==""&&(e==="literal"?await((r=t.onLiteral)==null?void 0:r.call(t,n)):n.endsWith("|>")&&await((i=t.onSpecial)==null?void 0:i.call(t,n)))}}}function cu(t,e){return{role:"system",content:[t,Ia.map(n=>`- ${n}`).join(` +var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ri=(t,e,n)=>Sa(t,typeof e!="symbol"?e+"":e,n);import{E as Ia,V as Ra,a as Ca,c as Na,r as La,b as Pr,d as Pa,e as Ci,f as Oa,g as Da,h as Fa,s as za,i as Ba,j as Ua}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{f as qn,g as X,h as Ue,i as Dt,t as ja,d as Fe,j as Va,k as Ha,l as ti,w as je,m as dn,c as ie,o as ee,p as gn,q as Ga,s as rt,v as pn,x as Xt,y as Be,b as Te,a as O,z as Ct,A as At,B as ni,C as it,D as he,e as H,M as gt,T as kt,E as ri,F as Yn,G as Jo,Z as Fn,H as Ft,I as $a,V as se,S as Ni,Q as zn,O as $t,J as Pe,P as _t,K as qa,L as es,N as hn,U as ii,W as ze,X as ts,Y as ns,_ as oi,$ as yn,a0 as Ya,a1 as si,a2 as Ka,a3 as rs,a4 as yt,a5 as ai,a6 as Et,a7 as Wa,a8 as is,a9 as Ot,aa as os,ab as Xa,ac as Qa,ad as Za,ae as Ja,af as ss,ag as Kn,ah as el,ai as tl,aj as nl,ak as Pt,al as rl,am as il,an as ol,ao as sl,ap as tr,aq as Bn,ar as Or,as as Nt,at as as,au as Dr,av as Ht,aw as Li,ax as Lt,ay as Gt,az as nr,aA as al,aB as ll,aC as ul,aD as cl,aE as ls,aF as us,aG as Un,aH as cs,aI as li,aJ as jn,aK as fs,aL as fl,n as Fr,aM as dl,aN as zr,aO as ds,aP as pl,aQ as un,aR as ps,aS as ct,aT as xt,aU as mn,aV as hl,aW as ml,aX as gl,aY as yl,aZ as xl,a_ as ui,a$ as vl,b0 as bl,b1 as wl,b2 as rr,b3 as Tl,b4 as hs,b5 as kl,b6 as Al,b7 as _l,b8 as El,b9 as Ml,ba as ir,bb as Sl,bc as Il,bd as Rl,be as Pi,bf as Oi,bg as Di,bh as Fi,bi as Cl,bj as Nl,bk as Ll,bl as Pl,bm as Ol,bn as Wn,bo as Dl,bp as ms,bq as Fl,br as zl,bs as Bl,bt as Ul,bu as gs,bv as Vn,bw as ys,bx as ci,by as fi,bz as jl,bA as or,bB as Vl,bC as Hl}from"./index-Dn5R1iW2.js";import{g as Gl}from"./index-DLIkN3Ho.js";import{u as sr}from"./queue-D3IvB2cI.js";import{u as $l,a as ql,b as Yl,l as Kl,_ as xs}from"./queues-CxsPIAz3.js";import{r as Wl,a as Xl,b as Ql,c as Zl,l as Jl,u as di}from"./providers-Li1UUmJz.js";import{u as eu}from"./speech-Ci8yfKRf.js";import{_ as tu,a as nu,r as rn}from"./Model.vue_vue_type_script_setup_true_lang-NsUHJ7rm.js";import{_ as pi}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";import{_ as zi}from"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import{H as ru}from"./HeaderLink-CWVUXFCL.js";import{u as vs}from"./consciousness-BhvliREc.js";import{d as Bi}from"./index-Dr3dNwKO.js";import{b as Ui}from"./route-block-B_A1xBdJ.js";async function*iu(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 ou(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 su(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let u=0;u<700;u+=80)n.push(e[u]);const r=e.map(u=>u**1.5),i=Math.min(...r),s=Math.max(...r)-i;let a;return s===0?a=r.map(()=>0):a=r.map(u=>(u-i)/s),a.reduce((u,c)=>u+c,0)/e.length}function au(t,e="linear"){switch(e){case"linear":return ou(t);case"minmax":return su(t)}}const bs=qn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:au})),lu=qn("SpeakingStore",()=>{const n=X(0),r=X(!1),i=Ue(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function An(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function uu(t){let e="literal",n="";return{async consume(r){var i,o,s;for(let a=0;a"?(l+=An(r,a,1),u="literal",a++):l==="<"?u="special":l===">"&&(u="literal"),e==="literal"&&u==="special"?n!==""&&(await((i=t.onLiteral)==null?void 0:i.call(t,n)),n=""):e==="special"&&u==="literal"&&n!==""&&(n+=l,await((o=t.onSpecial)==null?void 0:o.call(t,n)),n=""),e==="literal"&&u==="literal"?(await((s=t.onLiteral)==null?void 0:s.call(t,l)),n=""):e==="special"&&u==="literal"?n="":n+=l,e=u}},async end(){var r,i;n!==""&&(e==="literal"?await((r=t.onLiteral)==null?void 0:r.call(t,n)):n.endsWith("|>")&&await((i=t.onSpecial)==null?void 0:i.call(t,n)))}}}function cu(t,e){return{role:"system",content:[t,Ia.map(n=>`- ${n}`).join(` `),e].join(` -`)}}var fu=async t=>{var e;return(t.fetch??globalThis.fetch)(Wl("chat/completions",t.baseURL),{body:Ql({...t,tools:(e=t.tools)==null?void 0:e.map(n=>({function:n.function,type:"function"}))}),headers:Xl({"Content-Type":"application/json",...t.headers},t.apiKey),method:"POST",signal:t.abortSignal}).then(Zl)},du=({finishReason:t,maxSteps:e,stepsLength:n,toolCallsLength:r})=>{if(n===0)return"initial";if(n0&&t==="tool_calls")return"tool-result";if(!["error","length"].includes(t))return"continue"}return"done"},pu=t=>typeof t=="string"||Array.isArray(t)&&t.every(e=>!!(typeof e=="object"&&"type"in e&&["audio","image","text"].includes(e.type)))?t:JSON.stringify(t),hu=async({abortSignal:t,messages:e,toolCall:n,tools:r})=>{const i=r==null?void 0:r.find(a=>a.function.name===n.function.name);if(!i){const a=r==null?void 0:r.map(u=>u.function.name),l=a==null||a.length===0?"No tools are available.":`Available tools: ${a.join(", ")}.`;throw new Error(`Model tried to call unavailable tool '${n.function.name}. ${l}.`)}const o=JSON.parse(n.function.arguments),s=pu(await i.execute(o,{abortSignal:t,messages:e,toolCallId:n.id}));return{parsedArgs:o,result:s,toolName:n.function.name}},sr=class extends Error{constructor(e,n){super(e);Ri(this,"response");this.name="XSAIError",this.response=n}},ji="data:",mu=t=>{if(!t||!t.startsWith(ji))return[void 0,!1];const e=t.slice(ji.length),n=e.startsWith(" ")?e.slice(1):e;if(n==="[DONE]")return[void 0,!0];if(n.startsWith("{")&&n.includes('"error":'))throw new Error(`Error from server: ${n}`);return[JSON.parse(n),!1]},gu=async t=>{let e,n,r;const i=new ReadableStream({start(p){e=p}}),o=new ReadableStream({start(p){n=p}}),s=new ReadableStream({start(p){r=p}}),a=t.maxSteps??1,l=new TextDecoder,u=[],c=async p=>{var I,E,R;const d={choices:[],finishReason:"error",messages:structuredClone(p.messages),stepType:"initial",toolCalls:[],toolResults:[]},g={};let k="",v=!0;const w=(P,h)=>{if(P.endedToolCallIDs.has(h))return;const M=d.choices[P.index].message.tool_calls[h];try{M.function.parsed_arguments=JSON.parse(M.function.arguments)}catch(x){P.toolCallErrors[h]=x}P.endedToolCallIDs.add(h),P.currentToolID=null};if(await fu({...p,stream:!0}).then(async P=>P.body.pipeThrough(new TransformStream({transform:async(h,M)=>{const x=l.decode(h,{stream:!0});k+=x;const y=k.split(` -`);k=y.pop()??"";for(const m of y)try{const[T,A]=mu(m);if(A)break;T&&M.enqueue(T)}catch(T){M.error(T)}}})).pipeTo(new WritableStream({abort:h=>{e.error(h),n.error(h),r.error(h)},write:async h=>{var Y,_,te;(Y=p.onChunk)==null||Y.call(p,h),e.enqueue(h);const M=h.choices[0];if(!M)throw new sr("no choice found");M.delta.tool_calls&&(v=!1);const{delta:x,finish_reason:y,index:m,...T}=M,A=(_=d.choices)[m]??(_[m]={finish_reason:y,index:m,message:{role:"assistant"}});if(y!==void 0){if(d.finishReason=y,A.finish_reason=y,y==="length")throw new sr("length exceeded");if(y==="content_filter")throw new sr("content filter")}Object.assign(A,T);const{content:F,refusal:j,tool_calls:D,...z}=x,Q=A.message;Object.assign(Q,z),j!==void 0&&(Q.refusal=(Q.refusal||"")+j),F!==void 0&&(Q.content=(Q.content||"")+F,v&&(r==null||r.enqueue(F)));for(const{function:me,id:C,type:ge}of D||[]){Q.tool_calls??(Q.tool_calls={});const ke=(te=Q.tool_calls)[C]??(te[C]={function:{arguments:"",name:me.name,parsed_arguments:{}},id:C,type:ge});ke.function.arguments+=me.arguments}const Z=g[m]??(g[m]={calledToolCallIDs:new Set,currentToolID:null,endedToolCallIDs:new Set,index:m,toolCallErrors:{},toolCallResults:{}});y&&Z.currentToolID!==null&&w(Z,Z.currentToolID);for(const me of x.tool_calls||[])Z.currentToolID!==null&&Z.currentToolID!==me.id&&w(Z,Z.currentToolID),Z.calledToolCallIDs.add(me.id),Z.currentToolID=me.id}}))),d.messages.push({content:((I=d.choices[0])==null?void 0:I.message.content)??"",refusal:(E=d.choices[0])==null?void 0:E.message.refusal,role:"assistant"}),await Promise.allSettled(d.choices.map(async P=>{const h=g[P.index];return Promise.allSettled([...h.endedToolCallIDs].map(async M=>{const x=P.message.tool_calls[M];if(d.toolCalls.push({args:x.function.arguments,toolCallId:M,toolCallType:"function",toolName:x.function.name}),!h.toolCallResults[M])try{const{result:y}=await hu({abortSignal:p.abortSignal,messages:p.messages,toolCall:x,tools:p.tools});h.toolCallResults[M]=y,d.messages.push({content:y,role:"tool",tool_call_id:M}),d.toolResults.push({args:x.function.parsed_arguments,result:y,toolCallId:M,toolName:x.function.name})}catch(y){h.toolCallErrors[M]=y}}))})),d.stepType=du({finishReason:d.finishReason,maxSteps:a,stepsLength:u.length,toolCallsLength:d.toolCalls.length}),u.push(d),n.enqueue(d),(R=p.onStepFinish)==null||R.call(p,d),!v)return async()=>c({...p,messages:d.messages})};return(async()=>{var d;let p=await c(t);for(;typeof p=="function"&&u.length{e.error(p),n.error(p),r.error(p)}),Promise.resolve({chunkStream:i,stepStream:o,textStream:s})};const yu=Gn("llm",()=>{async function t(n,r,i,o){const s=o==null?void 0:o.headers;return await gu({...r.chat(n),messages:i,streamOptions:{usage:!0},headers:s})}async function e(n,r){if(n==="")return[];try{return await Jl({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}}),Mt=Gn("chat",()=>{const{stream:t}=yu(),{t:e}=ei(),n=W(!1),r=W([]),i=W([]),o=W([]),s=W([]),a=W([]),l=W([]),u=W([]),c=W([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function g(h){s.value.push(h)}function k(h){a.value.push(h)}function v(h){l.value.push(h)}function w(h){u.value.push(h)}function I(h){c.value.push(h)}const E=W([cu(e("prompt.prefix"),e("prompt.suffix"))]),R=W({role:"assistant",content:""});async function P(h,M){var x;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);R.value={role:"assistant",content:""},E.value.push({role:"user",content:h}),E.value.push(R.value);const y=E.value.slice(0,E.value.length-1).map(D=>ja(D));for(const D of i.value)await D(h);for(const D of o.value)await D(h);const m=(x=M.providerConfig)==null?void 0:x.headers,T=m==null?void 0:m.filter(D=>D.key&&D.value).reduce((D,z)=>(D[z.key]=z.value,D),{}),A=await t(M.model,M.chatProvider,y,{headers:T});for(const D of s.value)await D(h);let F="";const j=uu({onLiteral:async D=>{for(const z of a.value)await z(D);R.value.content+=D},onSpecial:async D=>{for(const z of l.value)await z(D)}});for await(const D of iu(A.textStream,async z=>z))F+=D,await j.consume(D);await j.end();for(const D of u.value)await D();for(const D of c.value)await D(F);console.debug("LLM output:",F)}finally{n.value=!1}}return{sending:n,messages:E,streamingMessage:R,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:g,onTokenLiteral:k,onTokenSpecial:v,onStreamEnd:w,onAssistantResponseEnd:I}}),ws=Fe({__name:"Screen",setup(t){const e=W(),n=Va($a),{width:r,height:i}=Ha(),o=ti(e,{immediate:!0,windowResize:!0,reset:!0}),s=Ue(()=>n.between("sm","md").value||n.smaller("sm").value),a=Ue(()=>n.between("md","lg").value),l=Ue(()=>n.greaterOrEqual("lg").value),u=Ue(()=>l.value?o.width.value:s.value||a.value?r.value-16:o.width.value),c=W(0);return je([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||s.value||a.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),je([o.width,o.height],()=>{l.value||s.value||a.value?c.value=o.height.value:c.value=600}),fn(async()=>{e.value&&o.update()}),(f,p)=>(ee(),ie("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[mn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),xu={absolute:"",bottom:"3",right:"3"},vu={flex:"~ row","cursor-pointer":""},bu=["checked","aria-checked"],wu={key:0,"min-w":"50vw",z:"(ee(),Wt(ws,{relative:""},{default:Be(({width:o,height:s})=>[Te(nu,{width:o,height:s},{default:Be(({app:a})=>[Te(tu,{app:a,"mouth-open-size":t.mouthOpenSize,width:o,height:s,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),O("div",xu,[O("div",vu,[O("label",{class:Ct([e.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(O("input",{"onUpdate:modelValue":i[0]||(i[0]=a=>e.value=a),checked:e.value,"aria-checked":e.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,bu),[[ni,e.value]]),i[8]||(i[8]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(pi,null,{default:Be(()=>[e.value?(ee(),ie("div",wu,[O("div",Tu,[O("div",ku,[O("span",null,he(r.$t("stage.viewers.debug-menu.emotions")),1)]),O("div",Au,[O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[1]||(i[1]=a=>n.value={group:"Surprise",index:0})},he(r.$t("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[2]||(i[2]=a=>n.value={group:"Sad",index:0})},he(r.$t("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[3]||(i[3]=a=>n.value={group:"Angry",index:0})},he(r.$t("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[4]||(i[4]=a=>n.value={group:"Happy",index:0})},he(r.$t("stage.viewers.debug-menu.emotions-btn.happy")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[5]||(i[5]=a=>n.value={group:"Awkward",index:0})},he(r.$t("stage.viewers.debug-menu.emotions-btn.awkward")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[6]||(i[6]=a=>n.value={group:"Question",index:0})},he(r.$t("stage.viewers.debug-menu.emotions-btn.question")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[7]||(i[7]=a=>n.value={group:"Think",index:0})},he(r.$t("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):it("",!0)]),_:1})])]),_:1}))}});var Eu=Object.defineProperty,Mu=(t,e,n)=>e in t?Eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Su=(t,e,n)=>Mu(t,e+"",n);function Iu(t){return el()?(tl(t),!0):!1}function Ts(t){return typeof t=="function"?t():X(t)}const Ru=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Cu=Object.prototype.toString,Nu=t=>Cu.call(t)==="[object Object]",Lu=()=>{},Pu=Ru?window:void 0;function Ou(t){var e;const n=Ts(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=Pu):[e,n,r,i]=t,!e)return Lu;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},a=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=je(()=>[Ou(e),Ts(i)],([c,f])=>{if(s(),!c)return;const p=Nu(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(g=>a(c,d,g,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Iu(u),u}function ks(t,e,n,r){const i=class extends gn{constructor(o={}){const s=Object.entries(t);super({uniforms:s.reduce((a,[l,u])=>{const c=si.clone({[l]:{value:u}});return{...a,...c}},{}),vertexShader:e,fragmentShader:n}),Su(this,"key",""),s.forEach(([a])=>Object.defineProperty(this,a,{get:()=>this.uniforms[a].value,set:l=>this.uniforms[a].value=l})),Object.assign(this,o)}};return i.key=Ot.generateUUID(),i}ks({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},` +`)}}var fu=async t=>{var e;return(t.fetch??globalThis.fetch)(Wl("chat/completions",t.baseURL),{body:Ql({...t,tools:(e=t.tools)==null?void 0:e.map(n=>({function:n.function,type:"function"}))}),headers:Xl({"Content-Type":"application/json",...t.headers},t.apiKey),method:"POST",signal:t.abortSignal}).then(Zl)},du=({finishReason:t,maxSteps:e,stepsLength:n,toolCallsLength:r})=>{if(n===0)return"initial";if(n0&&t==="tool_calls")return"tool-result";if(!["error","length"].includes(t))return"continue"}return"done"},pu=t=>typeof t=="string"||Array.isArray(t)&&t.every(e=>!!(typeof e=="object"&&"type"in e&&["audio","image","text"].includes(e.type)))?t:JSON.stringify(t),hu=async({abortSignal:t,messages:e,toolCall:n,tools:r})=>{const i=r==null?void 0:r.find(a=>a.function.name===n.function.name);if(!i){const a=r==null?void 0:r.map(u=>u.function.name),l=a==null||a.length===0?"No tools are available.":`Available tools: ${a.join(", ")}.`;throw new Error(`Model tried to call unavailable tool '${n.function.name}. ${l}.`)}const o=JSON.parse(n.function.arguments),s=pu(await i.execute(o,{abortSignal:t,messages:e,toolCallId:n.id}));return{parsedArgs:o,result:s,toolName:n.function.name}},ar=class extends Error{constructor(e,n){super(e);Ri(this,"response");this.name="XSAIError",this.response=n}},ji="data:",mu=t=>{if(!t||!t.startsWith(ji))return[void 0,!1];const e=t.slice(ji.length),n=e.startsWith(" ")?e.slice(1):e;if(n==="[DONE]")return[void 0,!0];if(n.startsWith("{")&&n.includes('"error":'))throw new Error(`Error from server: ${n}`);return[JSON.parse(n),!1]},gu=async t=>{let e,n,r;const i=new ReadableStream({start(p){e=p}}),o=new ReadableStream({start(p){n=p}}),s=new ReadableStream({start(p){r=p}}),a=t.maxSteps??1,l=new TextDecoder,u=[],c=async p=>{var I,A,R;const d={choices:[],finishReason:"error",messages:structuredClone(p.messages),stepType:"initial",toolCalls:[],toolResults:[]},b={};let x="",v=!0;const T=(P,h)=>{if(P.endedToolCallIDs.has(h))return;const M=d.choices[P.index].message.tool_calls[h];try{M.function.parsed_arguments=JSON.parse(M.function.arguments)}catch(y){P.toolCallErrors[h]=y}P.endedToolCallIDs.add(h),P.currentToolID=null};if(await fu({...p,stream:!0}).then(async P=>P.body.pipeThrough(new TransformStream({transform:async(h,M)=>{const y=l.decode(h,{stream:!0});x+=y;const g=x.split(` +`);x=g.pop()??"";for(const m of g)try{const[k,_]=mu(m);if(_)break;k&&M.enqueue(k)}catch(k){M.error(k)}}})).pipeTo(new WritableStream({abort:h=>{e.error(h),n.error(h),r.error(h)},write:async h=>{var K,E,te;(K=p.onChunk)==null||K.call(p,h),e.enqueue(h);const M=h.choices[0];if(!M)throw new ar("no choice found");M.delta.tool_calls&&(v=!1);const{delta:y,finish_reason:g,index:m,...k}=M,_=(E=d.choices)[m]??(E[m]={finish_reason:g,index:m,message:{role:"assistant"}});if(g!==void 0){if(d.finishReason=g,_.finish_reason=g,g==="length")throw new ar("length exceeded");if(g==="content_filter")throw new ar("content filter")}Object.assign(_,k);const{content:F,refusal:j,tool_calls:D,...z}=y,Q=_.message;Object.assign(Q,z),j!==void 0&&(Q.refusal=(Q.refusal||"")+j),F!==void 0&&(Q.content=(Q.content||"")+F,v&&(r==null||r.enqueue(F)));for(const{function:me,id:C,type:ge}of D||[]){Q.tool_calls??(Q.tool_calls={});const ke=(te=Q.tool_calls)[C]??(te[C]={function:{arguments:"",name:me.name,parsed_arguments:{}},id:C,type:ge});ke.function.arguments+=me.arguments}const Z=b[m]??(b[m]={calledToolCallIDs:new Set,currentToolID:null,endedToolCallIDs:new Set,index:m,toolCallErrors:{},toolCallResults:{}});g&&Z.currentToolID!==null&&T(Z,Z.currentToolID);for(const me of y.tool_calls||[])Z.currentToolID!==null&&Z.currentToolID!==me.id&&T(Z,Z.currentToolID),Z.calledToolCallIDs.add(me.id),Z.currentToolID=me.id}}))),d.messages.push({content:((I=d.choices[0])==null?void 0:I.message.content)??"",refusal:(A=d.choices[0])==null?void 0:A.message.refusal,role:"assistant"}),await Promise.allSettled(d.choices.map(async P=>{const h=b[P.index];return Promise.allSettled([...h.endedToolCallIDs].map(async M=>{const y=P.message.tool_calls[M];if(d.toolCalls.push({args:y.function.arguments,toolCallId:M,toolCallType:"function",toolName:y.function.name}),!h.toolCallResults[M])try{const{result:g}=await hu({abortSignal:p.abortSignal,messages:p.messages,toolCall:y,tools:p.tools});h.toolCallResults[M]=g,d.messages.push({content:g,role:"tool",tool_call_id:M}),d.toolResults.push({args:y.function.parsed_arguments,result:g,toolCallId:M,toolName:y.function.name})}catch(g){h.toolCallErrors[M]=g}}))})),d.stepType=du({finishReason:d.finishReason,maxSteps:a,stepsLength:u.length,toolCallsLength:d.toolCalls.length}),u.push(d),n.enqueue(d),(R=p.onStepFinish)==null||R.call(p,d),!v)return async()=>c({...p,messages:d.messages})};return(async()=>{var d;let p=await c(t);for(;typeof p=="function"&&u.length{e.error(p),n.error(p),r.error(p)}),Promise.resolve({chunkStream:i,stepStream:o,textStream:s})};const yu=qn("llm",()=>{async function t(n,r,i,o){const s=o==null?void 0:o.headers;return await gu({...r.chat(n),messages:i,streamOptions:{usage:!0},headers:s})}async function e(n,r){if(n==="")return[];try{return await Jl({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}}),Mt=qn("chat",()=>{const{stream:t}=yu(),{t:e}=Dt(),n=X(!1),r=X([]),i=X([]),o=X([]),s=X([]),a=X([]),l=X([]),u=X([]),c=X([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function b(h){s.value.push(h)}function x(h){a.value.push(h)}function v(h){l.value.push(h)}function T(h){u.value.push(h)}function I(h){c.value.push(h)}const A=X([cu(e("prompt.prefix"),e("prompt.suffix"))]),R=X({role:"assistant",content:""});async function P(h,M){var y;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);R.value={role:"assistant",content:""},A.value.push({role:"user",content:h}),A.value.push(R.value);const g=A.value.slice(0,A.value.length-1).map(D=>ja(D));for(const D of i.value)await D(h);for(const D of o.value)await D(h);const m=(y=M.providerConfig)==null?void 0:y.headers,k=m==null?void 0:m.filter(D=>D.key&&D.value).reduce((D,z)=>(D[z.key]=z.value,D),{}),_=await t(M.model,M.chatProvider,g,{headers:k});for(const D of s.value)await D(h);let F="";const j=uu({onLiteral:async D=>{for(const z of a.value)await z(D);R.value.content+=D},onSpecial:async D=>{for(const z of l.value)await z(D)}});for await(const D of iu(_.textStream,async z=>z))F+=D,await j.consume(D);await j.end();for(const D of u.value)await D();for(const D of c.value)await D(F);console.debug("LLM output:",F)}finally{n.value=!1}}return{sending:n,messages:A,streamingMessage:R,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:b,onTokenLiteral:x,onTokenSpecial:v,onStreamEnd:T,onAssistantResponseEnd:I}}),ws=Fe({__name:"Screen",setup(t){const e=X(),n=Va(Ga),{width:r,height:i}=Ha(),o=ti(e,{immediate:!0,windowResize:!0,reset:!0}),s=Ue(()=>n.between("sm","md").value||n.smaller("sm").value),a=Ue(()=>n.between("md","lg").value),l=Ue(()=>n.greaterOrEqual("lg").value),u=Ue(()=>l.value?o.width.value:s.value||a.value?r.value-16:o.width.value),c=X(0);return je([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||s.value||a.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),je([o.width,o.height],()=>{l.value||s.value||a.value?c.value=o.height.value:c.value=600}),dn(async()=>{e.value&&o.update()}),(f,p)=>(ee(),ie("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),xu={absolute:"",bottom:"3",right:"3"},vu={flex:"~ row","cursor-pointer":""},bu=["checked","aria-checked"],wu={key:0,"min-w":"50vw",z:"(ee(),Xt(ws,{relative:""},{default:Be(({width:s,height:a})=>[Te(nu,{width:s,height:a},{default:Be(({app:l})=>[Te(tu,{app:l,"mouth-open-size":t.mouthOpenSize,width:s,height:a,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),O("div",xu,[O("div",vu,[O("label",{class:Ct([n.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(O("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,bu),[[ni,n.value]]),o[8]||(o[8]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(pi,null,{default:Be(()=>[n.value?(ee(),ie("div",wu,[O("div",Tu,[O("div",ku,[O("span",null,he(H(e)("stage.viewers.debug-menu.emotions")),1)]),O("div",Au,[O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},he(H(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},he(H(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},he(H(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},he(H(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},he(H(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},he(H(e)("stage.viewers.debug-menu.emotions-btn.question")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},he(H(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):it("",!0)]),_:1})])]),_:1}))}});var Eu=Object.defineProperty,Mu=(t,e,n)=>e in t?Eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Su=(t,e,n)=>Mu(t,e+"",n);function Iu(t){return el()?(tl(t),!0):!1}function Ts(t){return typeof t=="function"?t():H(t)}const Ru=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Cu=Object.prototype.toString,Nu=t=>Cu.call(t)==="[object Object]",Lu=()=>{},Pu=Ru?window:void 0;function Ou(t){var e;const n=Ts(t);return(e=n==null?void 0:n.$el)!=null?e:n}function lr(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=Pu):[e,n,r,i]=t,!e)return Lu;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},a=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=je(()=>[Ou(e),Ts(i)],([c,f])=>{if(s(),!c)return;const p=Nu(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(b=>a(c,d,b,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Iu(u),u}function ks(t,e,n,r){const i=class extends yn{constructor(o={}){const s=Object.entries(t);super({uniforms:s.reduce((a,[l,u])=>{const c=si.clone({[l]:{value:u}});return{...a,...c}},{}),vertexShader:e,fragmentShader:n}),Su(this,"key",""),s.forEach(([a])=>Object.defineProperty(this,a,{get:()=>this.uniforms[a].value,set:l=>this.uniforms[a].value=l})),Object.assign(this,o)}};return i.key=Ot.generateUUID(),i}ks({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() { @@ -57,7 +57,7 @@ var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,config #include #include } - `);const hi=parseInt(nl.replace(/\D+/g,""));var Du=Object.defineProperty,Fu=(t,e,n)=>e in t?Du(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,zu=(t,e,n)=>(Fu(t,e+"",n),n);async function Vi(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let An,lr,zt,_n;function ur(t,e=1/0,n=null){lr||(lr=new os(2,2,1,1)),zt||(zt=new gn({uniforms:{blitTexture:new ul(t)},vertexShader:` + `);const hi=parseInt(nl.replace(/\D+/g,""));var Du=Object.defineProperty,Fu=(t,e,n)=>e in t?Du(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,zu=(t,e,n)=>(Fu(t,e+"",n),n);async function Vi(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let _n,ur,Bt,En;function cr(t,e=1/0,n=null){ur||(ur=new os(2,2,1,1)),Bt||(Bt=new yn({uniforms:{blitTexture:new ul(t)},vertexShader:` varying vec2 vUv; void main(){ vUv = uv; @@ -76,7 +76,7 @@ var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,config gl_FragColor = texture2D( blitTexture, vUv); #endif } - `})),zt.uniforms.blitTexture.value=t,zt.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,zt.needsUpdate=!0,_n||(_n=new Pt(lr,zt),_n.frustrumCulled=!1);const r=new _t,i=new Or;i.add(_n),n||(n=An=new cl({antialias:!1})),n.setSize(Math.min(t.image.width,e),Math.min(t.image.height,e)),n.clear(),n.render(i,r);const o=new zn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,An&&(An.dispose(),An=null),o}const Hi={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class As{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Ku(e)}),this.register(function(e){return new Wu(e)}),this.register(function(e){return new Zu(e)}),this.register(function(e){return new Ju(e)}),this.register(function(e){return new ec(e)}),this.register(function(e){return new tc(e)}),this.register(function(e){return new Xu(e)}),this.register(function(e){return new Qu(e)}),this.register(function(e){return new nc(e)}),this.register(function(e){return new rc(e)}),this.register(function(e){return new ic(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){const o=new Yu,s=[];for(let a=0,l=this.pluginCallbacks.length;at.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-e)<.001)return t.times.length-1;r[r.length-1]=e,r.set(t.times,0),i.set(t.values,0),i.set(o.evaluate(e),t.values.length),s=r.length-1}else for(let a=0;ae){r.set(t.times.slice(0,a+1),0),r[a+1]=e,r.set(t.times.slice(a+1),a+2),i.set(t.values.slice(0,(a+1)*n),0),i.set(o.evaluate(e),(a+1)*n),i.set(t.values.slice((a+1)*n),(a+2)*n),s=a+1;break}}return t.times=r,t.values=i,s},mergeMorphTargetTracks:function(t,e){const n=[],r={},i=t.tracks;for(let o=0;o4?s=t.array[i*t.itemSize+o]:(o===0?s=t.getX(i):o===1?s=t.getY(i):o===2?s=t.getZ(i):o===3&&(s=t.getW(i)),t.normalized===!0&&(s=Ot.normalize(s,t.array))),r.min[o]=Math.min(r.min[o],s),r.max[o]=Math.max(r.max[o],s)}return r}function _s(t){return Math.ceil(t/4)*4}function fr(t,e=0){const n=_s(t.byteLength);if(n!==t.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(t)),e!==0)for(let i=t.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Ki(t,e){if(t.toBlob!==void 0)return new Promise(r=>t.toBlob(r,e));let n;return e==="image/jpeg"?n=.92:e==="image/webp"&&(n=.8),t.convertToBlob({type:e,quality:n})}class Yu{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,n,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,o=i.buffers,s=i.json;r=i.options;const a=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(a),f=Object.keys(l);c.length>0&&(s.extensionsUsed=c),f.length>0&&(s.extensionsRequired=f),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=fr(p),g=new DataView(new ArrayBuffer(qi));g.setUint32(0,d.byteLength,!0),g.setUint32(4,Hu,!0);const k=fr($u(JSON.stringify(s)),32),v=new DataView(new ArrayBuffer(qi));v.setUint32(0,k.byteLength,!0),v.setUint32(4,Vu,!0);const w=new ArrayBuffer(Gi),I=new DataView(w);I.setUint32(0,Uu,!0),I.setUint32(4,ju,!0);const E=Gi+v.byteLength+k.byteLength+g.byteLength+d.byteLength;I.setUint32(8,E,!0),new Blob([w,v,k,g,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):s.buffers&&s.buffers.length>0?Vi(u).then(p=>{s.buffers[0].uri=p,n(s)}):n(s)}serializeUserData(e,n){if(Object.keys(e.userData).length===0)return;const r=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&o.gltfExtensions){n.extensions===void 0&&(n.extensions={});for(const s in o.gltfExtensions)n.extensions[s]=o.gltfExtensions[s],i[s]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(n.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(e,n=!1){if(this.uids.has(e)===!1){const r=new Map;r.set(!0,this.uid++),r.set(!1,this.uid++),this.uids.set(e,r)}return this.uids.get(e).get(n)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const n=new se;for(let r=0,i=e.count;r5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const n=this.cache;if(n.attributesNormalized.has(e))return n.attributesNormalized.get(e);const r=e.clone(),i=new se;for(let o=0,s=r.count;o4?g=e.array[p*e.itemSize+d]:(d===0?g=e.getX(p):d===1?g=e.getY(p):d===2?g=e.getZ(p):d===3&&(g=e.getW(p)),e.normalized===!0&&(g=Ot.normalize(g,e.array))),n===pe.FLOAT?u.setFloat32(c,g,!0):n===pe.INT?u.setInt32(c,g,!0):n===pe.UNSIGNED_INT?u.setUint32(c,g,!0):n===pe.SHORT?u.setInt16(c,g,!0):n===pe.UNSIGNED_SHORT?u.setUint16(c,g,!0):n===pe.BYTE?u.setInt8(c,g):n===pe.UNSIGNED_BYTE&&u.setUint8(c,g),c+=a}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===pe.ARRAY_BUFFER&&(f.byteStride=e.itemSize*a),this.byteOffset+=l,s.bufferViews.push(f),{id:s.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const n=this,r=n.json;return r.bufferViews||(r.bufferViews=[]),e.arrayBuffer().then(i=>{const o=fr(i),s={buffer:n.processBuffer(o),byteOffset:n.byteOffset,byteLength:o.byteLength};return n.byteOffset+=o.byteLength,r.bufferViews.push(s)-1})}processAccessor(e,n,r,i){const o=this.json,s={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let a;if(e.array.constructor===Float32Array)a=pe.FLOAT;else if(e.array.constructor===Int32Array)a=pe.INT;else if(e.array.constructor===Uint32Array)a=pe.UNSIGNED_INT;else if(e.array.constructor===Int16Array)a=pe.SHORT;else if(e.array.constructor===Uint16Array)a=pe.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)a=pe.BYTE;else if(e.array.constructor===Uint8Array)a=pe.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),i===void 0&&(i=e.count),i===0)return null;const l=qu(e,r,i);let u;n!==void 0&&(u=e===n.index?pe.ELEMENT_ARRAY_BUFFER:pe.ARRAY_BUFFER);const c=this.processBufferView(e,a,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:a,count:i,max:l.max,min:l.min,type:s[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-1}processImage(e,n,r,i="image/png"){if(e!==null){const o=this,s=o.cache,a=o.json,l=o.options,u=o.pending;s.images.has(e)||s.images.set(e,{});const c=s.images.get(e),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];a.images||(a.images=[]);const p={mimeType:i},d=Yi();d.width=Math.min(e.width,l.maxTextureSize),d.height=Math.min(e.height,l.maxTextureSize);const g=d.getContext("2d");if(r===!0&&(g.translate(0,d.height),g.scale(1,-1)),e.data!==void 0){n!==Pr&&console.error("GLTFExporter: Only RGBAFormat is supported.",n),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const v=new Uint8ClampedArray(e.height*e.width*4);for(let w=0;wo.processBufferViewImage(v)).then(v=>{p.bufferView=v})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(Ki(d,i).then(Vi).then(v=>{p.uri=v}));const k=a.images.push(p)-1;return c[f]=k,k}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const n=this.json;n.samplers||(n.samplers=[]);const r={magFilter:Ze[e.magFilter],minFilter:Ze[e.minFilter],wrapS:Ze[e.wrapS],wrapT:Ze[e.wrapT]};return n.samplers.push(r)-1}processTexture(e){const n=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof er&&(e=ur(e,n.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");const s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(s.name=e.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(e,s)});const a=i.textures.push(s)-1;return r.textures.set(e,a),a}processMaterial(e){const n=this.cache,r=this.json;if(n.materials.has(e))return n.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=e.color.toArray().concat([e.opacity]);if(an(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const a=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),l={index:this.processTexture(a),channel:a.channel};this.applyTextureTransform(l,a),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const a={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(a,e.map),i.pbrMetallicRoughness.baseColorTexture=a}if(e.emissive){const a=e.emissive;if(Math.max(a.r,a.g,a.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap){const a={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){const a={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Yn&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});const s=r.materials.push(i)-1;return n.materials.set(e,s),s}processMesh(e){const n=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let E=0,R=e.material.length;E=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=s.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),s.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let g=null;for(let E in s.attributes){if(E.slice(0,5)==="morph")continue;const R=s.attributes[E];if(E=p[E]||E.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(E)||(E="_"+E),n.attributes.has(this.getUID(R))){u[E]=n.attributes.get(this.getUID(R));continue}g=null;const P=R.array;E==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),g=new Nt(new Uint16Array(P),R.itemSize,R.normalized));const h=this.processAccessor(g||R,s);h!==null&&(E.startsWith("_")||this.detectMeshQuantization(E,R),u[E]=h,n.attributes.set(this.getUID(R),h))}if(d!==void 0&&s.setAttribute("normal",d),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const E=[],R=[],P={};if(e.morphTargetDictionary!==void 0)for(const h in e.morphTargetDictionary)P[e.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=R)}const k=Array.isArray(e.material);if(k&&s.groups.length===0)return null;const v=k?e.material:[e.material],w=k?s.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let E=0,R=w.length;E0&&(P.targets=f),s.index!==null){let M=this.getUID(s.index);(w[E].start!==void 0||w[E].count!==void 0)&&(M+=":"+w[E].start+":"+w[E].count),n.attributes.has(M)?P.indices=n.attributes.get(M):(P.indices=this.processAccessor(s.index,s,w[E].start,w[E].count),n.attributes.set(M,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(v[w[E].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(E){E.writeMesh&&E.writeMesh(e,l)});const I=r.meshes.push(l)-1;return n.meshes.set(o,I),I}detectMeshQuantization(e,n){if(this.extensionsUsed[cr])return;let r;switch(n.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}n.normalized&&(r+=" normalized");const i=e.split("_",1)[0];Hi[i]&&Hi[i].includes(r)&&(this.extensionsUsed[cr]=!0,this.extensionsRequired[cr]=!0)}processCamera(e){const n=this.json;n.cameras||(n.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ot.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),n.cameras.push(i)-1}processAnimation(e,n){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]),e=As.Utils.mergeMorphTargetTracks(e.clone(),n);const o=e.tracks,s=[],a=[];for(let l=0;l0){const a=[];for(let l=0,u=e.children.length;l0&&(o.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,o)});const s=n.nodes.push(o)-1;return i.set(e,s),s}processScene(e){const n=this.json,r=this.options;n.scenes||(n.scenes=[],n.scene=0);const i={};e.name!==""&&(i.name=e.name),n.scenes.push(i);const o=[];for(let s=0,a=e.children.length;s0&&(i.nodes=o),this.serializeUserData(e,i)}processObjects(e){const n=new Or;n.name="AuxScene";for(let r=0;r0&&this.processObjects(r);for(let i=0;i0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,s.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const a=i.extensions[this.name].lights;a.push(s),n.extensions=n.extensions||{},n.extensions[this.name]={light:a.length-1}}}let Wu=class{constructor(t){this.writer=t,this.name="KHR_materials_unlit"}writeMaterial(t,e){if(!t.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;e.extensions=e.extensions||{},e.extensions[this.name]={},n[this.name]=!0,e.pbrMetallicRoughness.metallicFactor=0,e.pbrMetallicRoughness.roughnessFactor=.9}},Xu=class{constructor(t){this.writer=t,this.name="KHR_materials_clearcoat"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.clearcoat===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=t.clearcoat,t.clearcoatMap){const o={index:n.processTexture(t.clearcoatMap),texCoord:t.clearcoatMap.channel};n.applyTextureTransform(o,t.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=t.clearcoatRoughness,t.clearcoatRoughnessMap){const o={index:n.processTexture(t.clearcoatRoughnessMap),texCoord:t.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,t.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(t.clearcoatNormalMap){const o={index:n.processTexture(t.clearcoatNormalMap),texCoord:t.clearcoatNormalMap.channel};n.applyTextureTransform(o,t.clearcoatNormalMap),i.clearcoatNormalTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Qu=class{constructor(t){this.writer=t,this.name="KHR_materials_iridescence"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.iridescence===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=t.iridescence,t.iridescenceMap){const o={index:n.processTexture(t.iridescenceMap),texCoord:t.iridescenceMap.channel};n.applyTextureTransform(o,t.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=t.iridescenceIOR,i.iridescenceThicknessMinimum=t.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=t.iridescenceThicknessRange[1],t.iridescenceThicknessMap){const o={index:n.processTexture(t.iridescenceThicknessMap),texCoord:t.iridescenceThicknessMap.channel};n.applyTextureTransform(o,t.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Zu=class{constructor(t){this.writer=t,this.name="KHR_materials_transmission"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=t.transmission,t.transmissionMap){const o={index:n.processTexture(t.transmissionMap),texCoord:t.transmissionMap.channel};n.applyTextureTransform(o,t.transmissionMap),i.transmissionTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Ju=class{constructor(t){this.writer=t,this.name="KHR_materials_volume"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=t.thickness,t.thicknessMap){const o={index:n.processTexture(t.thicknessMap),texCoord:t.thicknessMap.channel};n.applyTextureTransform(o,t.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=t.attenuationDistance,i.attenuationColor=t.attenuationColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},ec=class{constructor(t){this.writer=t,this.name="KHR_materials_ior"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.ior===1.5)return;const n=this.writer.extensionsUsed,r={};r.ior=t.ior,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}},tc=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(Bu)&&!t.specularIntensityMap&&!t.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.specularIntensityMap){const o={index:n.processTexture(t.specularIntensityMap),texCoord:t.specularIntensityMap.channel};n.applyTextureTransform(o,t.specularIntensityMap),i.specularTexture=o}if(t.specularColorMap){const o={index:n.processTexture(t.specularColorMap),texCoord:t.specularColorMap.channel};n.applyTextureTransform(o,t.specularColorMap),i.specularColorTexture=o}i.specularFactor=t.specularIntensity,i.specularColorFactor=t.specularColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},nc=class{constructor(t){this.writer=t,this.name="KHR_materials_sheen"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.sheenRoughnessMap){const o={index:n.processTexture(t.sheenRoughnessMap),texCoord:t.sheenRoughnessMap.channel};n.applyTextureTransform(o,t.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(t.sheenColorMap){const o={index:n.processTexture(t.sheenColorMap),texCoord:t.sheenColorMap.channel};n.applyTextureTransform(o,t.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=t.sheenRoughness,i.sheenColorFactor=t.sheenColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},rc=class{constructor(t){this.writer=t,this.name="KHR_materials_anisotropy"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.anisotropy==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.anisotropyMap){const o={index:n.processTexture(t.anisotropyMap)};n.applyTextureTransform(o,t.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=t.anisotropy,i.anisotropyRotation=t.anisotropyRotation,e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},ic=class{constructor(t){this.writer=t,this.name="KHR_materials_emissive_strength"}writeMaterial(t,e){if(!t.isMeshStandardMaterial||t.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=t.emissiveIntensity,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}};var yn=Uint8Array,Es=Uint16Array,oc=Uint32Array,sc=new yn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ac=new yn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ms=function(t,e){for(var n=new Es(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;bt=(bt&52428)>>>2|(bt&13107)<<2,bt=(bt&61680)>>>4|(bt&3855)<<4,cc[Ne]=((bt&65280)>>>8|(bt&255)<<8)>>>1}var Wn=new yn(288);for(var Ne=0;Ne<144;++Ne)Wn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Wn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Wn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Wn[Ne]=8;var fc=new yn(32);for(var Ne=0;Ne<32;++Ne)fc[Ne]=5;var dc=new yn(0),pc=typeof TextDecoder<"u"&&new TextDecoder,hc=0;try{pc.decode(dc,{stream:!0}),hc=1}catch{}var mc=Object.defineProperty,gc=(t,e,n)=>e in t?mc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yc=(t,e,n)=>(gc(t,e+"",n),n);const Is=class extends Pt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new _t;const n=this,r=e.color!==void 0?new ze(e.color):new ze(8355711),i=e.textureWidth||512,o=e.textureHeight||512,s=e.clipBias||0,a=e.shader||Is.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new es,c=new se,f=new se,p=new se,d=new yt,g=new se(0,0,-1),k=new Et,v=new se,w=new se,I=new Et,E=new yt,R=this.camera,P=new il(i,o,{samples:l,type:ol}),h=new gn({uniforms:si.clone(a.uniforms),fragmentShader:a.fragmentShader,vertexShader:a.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=E,this.material=h,this.onBeforeRender=function(M,x,y){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(y.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),v.subVectors(f,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(f),d.extractRotation(y.matrixWorld),g.set(0,0,-1),g.applyMatrix4(d),g.add(p),w.subVectors(f,g),w.reflect(c).negate(),w.add(f),R.position.copy(v),R.up.set(0,1,0),R.up.applyMatrix4(d),R.up.reflect(c),R.lookAt(w),R.far=y.far,R.updateMatrixWorld(),R.projectionMatrix.copy(y.projectionMatrix),E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),E.multiply(R.projectionMatrix),E.multiply(R.matrixWorldInverse),E.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(R.matrixWorldInverse),k.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=R.projectionMatrix;I.x=(Math.sign(k.x)+m.elements[8])/m.elements[0],I.y=(Math.sign(k.y)+m.elements[9])/m.elements[5],I.z=-1,I.w=(1+m.elements[10])/m.elements[14],k.multiplyScalar(2/k.dot(I)),m.elements[2]=k.x,m.elements[6]=k.y,m.elements[10]=k.z+1-s,m.elements[14]=k.w,n.visible=!1;const T=M.getRenderTarget(),A=M.xr.enabled,F=M.shadowMap.autoUpdate,j=M.toneMapping;let D=!1;"outputColorSpace"in M?D=M.outputColorSpace==="srgb":D=M.outputEncoding===3001,M.xr.enabled=!1,M.shadowMap.autoUpdate=!1,"outputColorSpace"in M?M.outputColorSpace="srgb-linear":M.outputEncoding=3e3,M.toneMapping=sl,M.setRenderTarget(P),M.state.buffers.depth.setMask(!0),M.autoClear===!1&&M.clear(),M.render(x,R),M.xr.enabled=A,M.shadowMap.autoUpdate=F,M.toneMapping=j,"outputColorSpace"in M?M.outputColorSpace=D?"srgb":"srgb-linear":M.outputEncoding=D?3001:3e3,M.setRenderTarget(T);const z=y.viewport;z!==void 0&&M.state.viewport(z),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let zr=Is;yc(zr,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + `})),Bt.uniforms.blitTexture.value=t,Bt.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,Bt.needsUpdate=!0,En||(En=new Pt(ur,Bt),En.frustrumCulled=!1);const r=new _t,i=new Dr;i.add(En),n||(n=_n=new cl({antialias:!1})),n.setSize(Math.min(t.image.width,e),Math.min(t.image.height,e)),n.clear(),n.render(i,r);const o=new Bn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,_n&&(_n.dispose(),_n=null),o}const Hi={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class As{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Ku(e)}),this.register(function(e){return new Wu(e)}),this.register(function(e){return new Zu(e)}),this.register(function(e){return new Ju(e)}),this.register(function(e){return new ec(e)}),this.register(function(e){return new tc(e)}),this.register(function(e){return new Xu(e)}),this.register(function(e){return new Qu(e)}),this.register(function(e){return new nc(e)}),this.register(function(e){return new rc(e)}),this.register(function(e){return new ic(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){const o=new Yu,s=[];for(let a=0,l=this.pluginCallbacks.length;at.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-e)<.001)return t.times.length-1;r[r.length-1]=e,r.set(t.times,0),i.set(t.values,0),i.set(o.evaluate(e),t.values.length),s=r.length-1}else for(let a=0;ae){r.set(t.times.slice(0,a+1),0),r[a+1]=e,r.set(t.times.slice(a+1),a+2),i.set(t.values.slice(0,(a+1)*n),0),i.set(o.evaluate(e),(a+1)*n),i.set(t.values.slice((a+1)*n),(a+2)*n),s=a+1;break}}return t.times=r,t.values=i,s},mergeMorphTargetTracks:function(t,e){const n=[],r={},i=t.tracks;for(let o=0;o4?s=t.array[i*t.itemSize+o]:(o===0?s=t.getX(i):o===1?s=t.getY(i):o===2?s=t.getZ(i):o===3&&(s=t.getW(i)),t.normalized===!0&&(s=Ot.normalize(s,t.array))),r.min[o]=Math.min(r.min[o],s),r.max[o]=Math.max(r.max[o],s)}return r}function _s(t){return Math.ceil(t/4)*4}function dr(t,e=0){const n=_s(t.byteLength);if(n!==t.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(t)),e!==0)for(let i=t.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Ki(t,e){if(t.toBlob!==void 0)return new Promise(r=>t.toBlob(r,e));let n;return e==="image/jpeg"?n=.92:e==="image/webp"&&(n=.8),t.convertToBlob({type:e,quality:n})}class Yu{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,n,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,o=i.buffers,s=i.json;r=i.options;const a=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(a),f=Object.keys(l);c.length>0&&(s.extensionsUsed=c),f.length>0&&(s.extensionsRequired=f),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=dr(p),b=new DataView(new ArrayBuffer(qi));b.setUint32(0,d.byteLength,!0),b.setUint32(4,Hu,!0);const x=dr(Gu(JSON.stringify(s)),32),v=new DataView(new ArrayBuffer(qi));v.setUint32(0,x.byteLength,!0),v.setUint32(4,Vu,!0);const T=new ArrayBuffer($i),I=new DataView(T);I.setUint32(0,Uu,!0),I.setUint32(4,ju,!0);const A=$i+v.byteLength+x.byteLength+b.byteLength+d.byteLength;I.setUint32(8,A,!0),new Blob([T,v,x,b,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):s.buffers&&s.buffers.length>0?Vi(u).then(p=>{s.buffers[0].uri=p,n(s)}):n(s)}serializeUserData(e,n){if(Object.keys(e.userData).length===0)return;const r=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&o.gltfExtensions){n.extensions===void 0&&(n.extensions={});for(const s in o.gltfExtensions)n.extensions[s]=o.gltfExtensions[s],i[s]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(n.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(e,n=!1){if(this.uids.has(e)===!1){const r=new Map;r.set(!0,this.uid++),r.set(!1,this.uid++),this.uids.set(e,r)}return this.uids.get(e).get(n)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const n=new se;for(let r=0,i=e.count;r5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const n=this.cache;if(n.attributesNormalized.has(e))return n.attributesNormalized.get(e);const r=e.clone(),i=new se;for(let o=0,s=r.count;o4?b=e.array[p*e.itemSize+d]:(d===0?b=e.getX(p):d===1?b=e.getY(p):d===2?b=e.getZ(p):d===3&&(b=e.getW(p)),e.normalized===!0&&(b=Ot.normalize(b,e.array))),n===pe.FLOAT?u.setFloat32(c,b,!0):n===pe.INT?u.setInt32(c,b,!0):n===pe.UNSIGNED_INT?u.setUint32(c,b,!0):n===pe.SHORT?u.setInt16(c,b,!0):n===pe.UNSIGNED_SHORT?u.setUint16(c,b,!0):n===pe.BYTE?u.setInt8(c,b):n===pe.UNSIGNED_BYTE&&u.setUint8(c,b),c+=a}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===pe.ARRAY_BUFFER&&(f.byteStride=e.itemSize*a),this.byteOffset+=l,s.bufferViews.push(f),{id:s.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const n=this,r=n.json;return r.bufferViews||(r.bufferViews=[]),e.arrayBuffer().then(i=>{const o=dr(i),s={buffer:n.processBuffer(o),byteOffset:n.byteOffset,byteLength:o.byteLength};return n.byteOffset+=o.byteLength,r.bufferViews.push(s)-1})}processAccessor(e,n,r,i){const o=this.json,s={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let a;if(e.array.constructor===Float32Array)a=pe.FLOAT;else if(e.array.constructor===Int32Array)a=pe.INT;else if(e.array.constructor===Uint32Array)a=pe.UNSIGNED_INT;else if(e.array.constructor===Int16Array)a=pe.SHORT;else if(e.array.constructor===Uint16Array)a=pe.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)a=pe.BYTE;else if(e.array.constructor===Uint8Array)a=pe.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),i===void 0&&(i=e.count),i===0)return null;const l=qu(e,r,i);let u;n!==void 0&&(u=e===n.index?pe.ELEMENT_ARRAY_BUFFER:pe.ARRAY_BUFFER);const c=this.processBufferView(e,a,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:a,count:i,max:l.max,min:l.min,type:s[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-1}processImage(e,n,r,i="image/png"){if(e!==null){const o=this,s=o.cache,a=o.json,l=o.options,u=o.pending;s.images.has(e)||s.images.set(e,{});const c=s.images.get(e),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];a.images||(a.images=[]);const p={mimeType:i},d=Yi();d.width=Math.min(e.width,l.maxTextureSize),d.height=Math.min(e.height,l.maxTextureSize);const b=d.getContext("2d");if(r===!0&&(b.translate(0,d.height),b.scale(1,-1)),e.data!==void 0){n!==Or&&console.error("GLTFExporter: Only RGBAFormat is supported.",n),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const v=new Uint8ClampedArray(e.height*e.width*4);for(let T=0;To.processBufferViewImage(v)).then(v=>{p.bufferView=v})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(Ki(d,i).then(Vi).then(v=>{p.uri=v}));const x=a.images.push(p)-1;return c[f]=x,x}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const n=this.json;n.samplers||(n.samplers=[]);const r={magFilter:Ze[e.magFilter],minFilter:Ze[e.minFilter],wrapS:Ze[e.wrapS],wrapT:Ze[e.wrapT]};return n.samplers.push(r)-1}processTexture(e){const n=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof tr&&(e=cr(e,n.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");const s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(s.name=e.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(e,s)});const a=i.textures.push(s)-1;return r.textures.set(e,a),a}processMaterial(e){const n=this.cache,r=this.json;if(n.materials.has(e))return n.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=e.color.toArray().concat([e.opacity]);if(ln(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const a=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),l={index:this.processTexture(a),channel:a.channel};this.applyTextureTransform(l,a),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const a={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(a,e.map),i.pbrMetallicRoughness.baseColorTexture=a}if(e.emissive){const a=e.emissive;if(Math.max(a.r,a.g,a.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap){const a={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){const a={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Kn&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});const s=r.materials.push(i)-1;return n.materials.set(e,s),s}processMesh(e){const n=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let A=0,R=e.material.length;A=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=s.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),s.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let b=null;for(let A in s.attributes){if(A.slice(0,5)==="morph")continue;const R=s.attributes[A];if(A=p[A]||A.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(A)||(A="_"+A),n.attributes.has(this.getUID(R))){u[A]=n.attributes.get(this.getUID(R));continue}b=null;const P=R.array;A==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),b=new Nt(new Uint16Array(P),R.itemSize,R.normalized));const h=this.processAccessor(b||R,s);h!==null&&(A.startsWith("_")||this.detectMeshQuantization(A,R),u[A]=h,n.attributes.set(this.getUID(R),h))}if(d!==void 0&&s.setAttribute("normal",d),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const A=[],R=[],P={};if(e.morphTargetDictionary!==void 0)for(const h in e.morphTargetDictionary)P[e.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=R)}const x=Array.isArray(e.material);if(x&&s.groups.length===0)return null;const v=x?e.material:[e.material],T=x?s.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let A=0,R=T.length;A0&&(P.targets=f),s.index!==null){let M=this.getUID(s.index);(T[A].start!==void 0||T[A].count!==void 0)&&(M+=":"+T[A].start+":"+T[A].count),n.attributes.has(M)?P.indices=n.attributes.get(M):(P.indices=this.processAccessor(s.index,s,T[A].start,T[A].count),n.attributes.set(M,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(v[T[A].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(A){A.writeMesh&&A.writeMesh(e,l)});const I=r.meshes.push(l)-1;return n.meshes.set(o,I),I}detectMeshQuantization(e,n){if(this.extensionsUsed[fr])return;let r;switch(n.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}n.normalized&&(r+=" normalized");const i=e.split("_",1)[0];Hi[i]&&Hi[i].includes(r)&&(this.extensionsUsed[fr]=!0,this.extensionsRequired[fr]=!0)}processCamera(e){const n=this.json;n.cameras||(n.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ot.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),n.cameras.push(i)-1}processAnimation(e,n){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]),e=As.Utils.mergeMorphTargetTracks(e.clone(),n);const o=e.tracks,s=[],a=[];for(let l=0;l0){const a=[];for(let l=0,u=e.children.length;l0&&(o.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,o)});const s=n.nodes.push(o)-1;return i.set(e,s),s}processScene(e){const n=this.json,r=this.options;n.scenes||(n.scenes=[],n.scene=0);const i={};e.name!==""&&(i.name=e.name),n.scenes.push(i);const o=[];for(let s=0,a=e.children.length;s0&&(i.nodes=o),this.serializeUserData(e,i)}processObjects(e){const n=new Dr;n.name="AuxScene";for(let r=0;r0&&this.processObjects(r);for(let i=0;i0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,s.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const a=i.extensions[this.name].lights;a.push(s),n.extensions=n.extensions||{},n.extensions[this.name]={light:a.length-1}}}let Wu=class{constructor(t){this.writer=t,this.name="KHR_materials_unlit"}writeMaterial(t,e){if(!t.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;e.extensions=e.extensions||{},e.extensions[this.name]={},n[this.name]=!0,e.pbrMetallicRoughness.metallicFactor=0,e.pbrMetallicRoughness.roughnessFactor=.9}},Xu=class{constructor(t){this.writer=t,this.name="KHR_materials_clearcoat"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.clearcoat===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=t.clearcoat,t.clearcoatMap){const o={index:n.processTexture(t.clearcoatMap),texCoord:t.clearcoatMap.channel};n.applyTextureTransform(o,t.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=t.clearcoatRoughness,t.clearcoatRoughnessMap){const o={index:n.processTexture(t.clearcoatRoughnessMap),texCoord:t.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,t.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(t.clearcoatNormalMap){const o={index:n.processTexture(t.clearcoatNormalMap),texCoord:t.clearcoatNormalMap.channel};n.applyTextureTransform(o,t.clearcoatNormalMap),i.clearcoatNormalTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Qu=class{constructor(t){this.writer=t,this.name="KHR_materials_iridescence"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.iridescence===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=t.iridescence,t.iridescenceMap){const o={index:n.processTexture(t.iridescenceMap),texCoord:t.iridescenceMap.channel};n.applyTextureTransform(o,t.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=t.iridescenceIOR,i.iridescenceThicknessMinimum=t.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=t.iridescenceThicknessRange[1],t.iridescenceThicknessMap){const o={index:n.processTexture(t.iridescenceThicknessMap),texCoord:t.iridescenceThicknessMap.channel};n.applyTextureTransform(o,t.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Zu=class{constructor(t){this.writer=t,this.name="KHR_materials_transmission"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=t.transmission,t.transmissionMap){const o={index:n.processTexture(t.transmissionMap),texCoord:t.transmissionMap.channel};n.applyTextureTransform(o,t.transmissionMap),i.transmissionTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Ju=class{constructor(t){this.writer=t,this.name="KHR_materials_volume"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=t.thickness,t.thicknessMap){const o={index:n.processTexture(t.thicknessMap),texCoord:t.thicknessMap.channel};n.applyTextureTransform(o,t.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=t.attenuationDistance,i.attenuationColor=t.attenuationColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},ec=class{constructor(t){this.writer=t,this.name="KHR_materials_ior"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.ior===1.5)return;const n=this.writer.extensionsUsed,r={};r.ior=t.ior,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}},tc=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(Bu)&&!t.specularIntensityMap&&!t.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.specularIntensityMap){const o={index:n.processTexture(t.specularIntensityMap),texCoord:t.specularIntensityMap.channel};n.applyTextureTransform(o,t.specularIntensityMap),i.specularTexture=o}if(t.specularColorMap){const o={index:n.processTexture(t.specularColorMap),texCoord:t.specularColorMap.channel};n.applyTextureTransform(o,t.specularColorMap),i.specularColorTexture=o}i.specularFactor=t.specularIntensity,i.specularColorFactor=t.specularColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},nc=class{constructor(t){this.writer=t,this.name="KHR_materials_sheen"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.sheenRoughnessMap){const o={index:n.processTexture(t.sheenRoughnessMap),texCoord:t.sheenRoughnessMap.channel};n.applyTextureTransform(o,t.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(t.sheenColorMap){const o={index:n.processTexture(t.sheenColorMap),texCoord:t.sheenColorMap.channel};n.applyTextureTransform(o,t.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=t.sheenRoughness,i.sheenColorFactor=t.sheenColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},rc=class{constructor(t){this.writer=t,this.name="KHR_materials_anisotropy"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.anisotropy==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.anisotropyMap){const o={index:n.processTexture(t.anisotropyMap)};n.applyTextureTransform(o,t.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=t.anisotropy,i.anisotropyRotation=t.anisotropyRotation,e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},ic=class{constructor(t){this.writer=t,this.name="KHR_materials_emissive_strength"}writeMaterial(t,e){if(!t.isMeshStandardMaterial||t.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=t.emissiveIntensity,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}};var xn=Uint8Array,Es=Uint16Array,oc=Uint32Array,sc=new xn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ac=new xn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ms=function(t,e){for(var n=new Es(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;bt=(bt&52428)>>>2|(bt&13107)<<2,bt=(bt&61680)>>>4|(bt&3855)<<4,cc[Ne]=((bt&65280)>>>8|(bt&255)<<8)>>>1}var Xn=new xn(288);for(var Ne=0;Ne<144;++Ne)Xn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Xn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Xn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Xn[Ne]=8;var fc=new xn(32);for(var Ne=0;Ne<32;++Ne)fc[Ne]=5;var dc=new xn(0),pc=typeof TextDecoder<"u"&&new TextDecoder,hc=0;try{pc.decode(dc,{stream:!0}),hc=1}catch{}var mc=Object.defineProperty,gc=(t,e,n)=>e in t?mc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yc=(t,e,n)=>(gc(t,e+"",n),n);const Is=class extends Pt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new _t;const n=this,r=e.color!==void 0?new ze(e.color):new ze(8355711),i=e.textureWidth||512,o=e.textureHeight||512,s=e.clipBias||0,a=e.shader||Is.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new es,c=new se,f=new se,p=new se,d=new yt,b=new se(0,0,-1),x=new Et,v=new se,T=new se,I=new Et,A=new yt,R=this.camera,P=new il(i,o,{samples:l,type:ol}),h=new yn({uniforms:si.clone(a.uniforms),fragmentShader:a.fragmentShader,vertexShader:a.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=A,this.material=h,this.onBeforeRender=function(M,y,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),v.subVectors(f,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(f),d.extractRotation(g.matrixWorld),b.set(0,0,-1),b.applyMatrix4(d),b.add(p),T.subVectors(f,b),T.reflect(c).negate(),T.add(f),R.position.copy(v),R.up.set(0,1,0),R.up.applyMatrix4(d),R.up.reflect(c),R.lookAt(T),R.far=g.far,R.updateMatrixWorld(),R.projectionMatrix.copy(g.projectionMatrix),A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),A.multiply(R.projectionMatrix),A.multiply(R.matrixWorldInverse),A.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(R.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=R.projectionMatrix;I.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],I.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],I.z=-1,I.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(I)),m.elements[2]=x.x,m.elements[6]=x.y,m.elements[10]=x.z+1-s,m.elements[14]=x.w,n.visible=!1;const k=M.getRenderTarget(),_=M.xr.enabled,F=M.shadowMap.autoUpdate,j=M.toneMapping;let D=!1;"outputColorSpace"in M?D=M.outputColorSpace==="srgb":D=M.outputEncoding===3001,M.xr.enabled=!1,M.shadowMap.autoUpdate=!1,"outputColorSpace"in M?M.outputColorSpace="srgb-linear":M.outputEncoding=3e3,M.toneMapping=sl,M.setRenderTarget(P),M.state.buffers.depth.setMask(!0),M.autoClear===!1&&M.clear(),M.render(y,R),M.xr.enabled=_,M.shadowMap.autoUpdate=F,M.toneMapping=j,"outputColorSpace"in M?M.outputColorSpace=D?"srgb":"srgb-linear":M.outputEncoding=D?3001:3e3,M.setRenderTarget(k);const z=g.viewport;z!==void 0&&M.state.viewport(z),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let Br=Is;yc(Br,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` uniform mat4 textureMatrix; varying vec4 vUv; @@ -120,7 +120,7 @@ var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,config #include #include <${hi>=154?"colorspace_fragment":"encodings_fragment"}> - }`});var xc=Object.defineProperty,vc=(t,e,n)=>e in t?xc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Rs=(t,e,n)=>(vc(t,typeof e!="symbol"?e+"":e,n),n);const Xn=new ts,bc=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),Cs=new ns(bc,5);Xn.setIndex([0,1,2,0,2,3]);Xn.setAttribute("position",new oi(Cs,3,0,!1));Xn.setAttribute("uv",new oi(Cs,2,3,!1));const Br=class extends Pt{constructor(){super(Br.Geometry,new Vt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new se,e=new se,n=new Li(new Uint8Array(16*16*3),16,16,Pr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Ht,n.wrapT=Ht;const r=new Li(new Uint8Array(16*16*3),16,16,Pr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Ht,r.wrapT=Ht;const i=Br.Geometry,o=new tr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + }`});var xc=Object.defineProperty,vc=(t,e,n)=>e in t?xc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Rs=(t,e,n)=>(vc(t,typeof e!="symbol"?e+"":e,n),n);const Qn=new ts,bc=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),Cs=new ns(bc,5);Qn.setIndex([0,1,2,0,2,3]);Qn.setAttribute("position",new oi(Cs,3,0,!1));Qn.setAttribute("uv",new oi(Cs,2,3,!1));const Ur=class extends Pt{constructor(){super(Ur.Geometry,new Ht({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new se,e=new se,n=new Li(new Uint8Array(16*16*3),16,16,Or);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Gt,n.wrapT=Gt;const r=new Li(new Uint8Array(16*16*3),16,16,Or);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Gt,r.wrapT=Gt;const i=Ur.Geometry,o=new nr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` precision highp float; @@ -141,7 +141,7 @@ var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,config gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); - }`,depthTest:!0,depthWrite:!1,transparent:!1}),s=new tr({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:` + }`,depthTest:!0,depthWrite:!1,transparent:!1}),s=new nr({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:` precision highp float; @@ -171,7 +171,7 @@ var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,config gl_FragColor = texture2D( map, vUV ); - }`,depthTest:!1,depthWrite:!1,transparent:!1}),a=new Pt(i,o),l=[],u=Ns.Shader,c=new tr({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new ze(16777215)},scale:{value:new Pe},screenPosition:{value:new se}},vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,blending:al,transparent:!0,depthWrite:!1}),f=new Pt(i,c);this.addElement=function(v){l.push(v)};const p=new Pe,d=new Pe,g=new ll,k=new Et;this.onBeforeRender=function(v,w,I){v.getCurrentViewport(k);const E=k.w/k.z,R=k.z/2,P=k.w/2;let h=16/k.w;if(p.set(h*E,h),g.min.set(k.x,k.y),g.max.set(k.x+(k.z-16),k.y+(k.w-16)),e.setFromMatrixPosition(this.matrixWorld),e.applyMatrix4(I.matrixWorldInverse),!(e.z>0)&&(t.copy(e).applyMatrix4(I.projectionMatrix),d.x=k.x+t.x*R+R-8,d.y=k.y+t.y*P+P-8,g.containsPoint(d))){v.copyFramebufferToTexture(d,n);let M=o.uniforms;M.scale.value=p,M.screenPosition.value=t,v.renderBufferDirect(I,null,i,o,a,null),v.copyFramebufferToTexture(d,r),M=s.uniforms,M.scale.value=p,M.screenPosition.value=t,v.renderBufferDirect(I,null,i,s,a,null);const x=-t.x*2,y=-t.y*2;for(let m=0,T=l.length;m0)&&(t.copy(e).applyMatrix4(I.projectionMatrix),d.x=x.x+t.x*R+R-8,d.y=x.y+t.y*P+P-8,b.containsPoint(d))){v.copyFramebufferToTexture(d,n);let M=o.uniforms;M.scale.value=p,M.screenPosition.value=t,v.renderBufferDirect(I,null,i,o,a,null),v.copyFramebufferToTexture(d,r),M=s.uniforms,M.scale.value=p,M.screenPosition.value=t,v.renderBufferDirect(I,null,i,s,a,null);const y=-t.x*2,g=-t.y*2;for(let m=0,k=l.length;me in t?Ma(t,e,{enumerable:!0,config gl_FragColor = texture; gl_FragColor.rgb *= color; - }`});var Tc=Object.defineProperty,kc=(t,e,n)=>e in t?Tc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ls=(t,e,n)=>(kc(t,typeof e!="symbol"?e+"":e,n),n);const Pn={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new se},up:{value:new se(0,1,0)}},vertexShader:` + }`});var Tc=Object.defineProperty,kc=(t,e,n)=>e in t?Tc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ls=(t,e,n)=>(kc(t,typeof e!="symbol"?e+"":e,n),n);const On={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new se},up:{value:new se(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -382,8 +382,8 @@ var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,config #include <${hi>=154?"colorspace_fragment":"encodings_fragment"}> } - `},Ps=new gn({name:"SkyShader",fragmentShader:Pn.fragmentShader,vertexShader:Pn.vertexShader,uniforms:si.clone(Pn.uniforms),side:Ya,depthWrite:!1});class Os extends Pt{constructor(){super(new rl(1,1,1),Ps)}}Ls(Os,"SkyShader",Pn);Ls(Os,"material",Ps);new Ka;new se;new rs(0,0,0,"YXZ");new se;var Ac=Object.defineProperty,_c=(t,e,n)=>e in t?Ac(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,re=(t,e,n)=>(_c(t,typeof e!="symbol"?e+"":e,n),n);const En=new qa,Wi=new es,Ec=Math.cos(70*(Math.PI/180)),Xi=(t,e)=>(t%e+e)%e;class Mc extends Ga{constructor(e,n){super(),re(this,"object"),re(this,"domElement"),re(this,"enabled",!0),re(this,"target",new se),re(this,"minDistance",0),re(this,"maxDistance",1/0),re(this,"minZoom",0),re(this,"maxZoom",1/0),re(this,"minPolarAngle",0),re(this,"maxPolarAngle",Math.PI),re(this,"minAzimuthAngle",-1/0),re(this,"maxAzimuthAngle",1/0),re(this,"enableDamping",!1),re(this,"dampingFactor",.05),re(this,"enableZoom",!0),re(this,"zoomSpeed",1),re(this,"enableRotate",!0),re(this,"rotateSpeed",1),re(this,"enablePan",!0),re(this,"panSpeed",1),re(this,"screenSpacePanning",!0),re(this,"keyPanSpeed",7),re(this,"zoomToCursor",!1),re(this,"autoRotate",!1),re(this,"autoRotateSpeed",2),re(this,"reverseOrbit",!1),re(this,"reverseHorizontalOrbit",!1),re(this,"reverseVerticalOrbit",!1),re(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),re(this,"mouseButtons",{LEFT:gt.ROTATE,MIDDLE:gt.DOLLY,RIGHT:gt.PAN}),re(this,"touches",{ONE:kt.ROTATE,TWO:kt.DOLLY_PAN}),re(this,"target0"),re(this,"position0"),re(this,"zoom0"),re(this,"_domElementKeyEvents",null),re(this,"getPolarAngle"),re(this,"getAzimuthalAngle"),re(this,"setPolarAngle"),re(this,"setAzimuthalAngle"),re(this,"getDistance"),re(this,"getZoomScale"),re(this,"listenToKeyEvents"),re(this,"stopListenToKeyEvents"),re(this,"saveState"),re(this,"reset"),re(this,"update"),re(this,"connect"),re(this,"dispose"),re(this,"dollyIn"),re(this,"dollyOut"),re(this,"getScale"),re(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=L=>{let G=Xi(L,2*Math.PI),J=c.phi;J<0&&(J+=2*Math.PI),G<0&&(G+=2*Math.PI);let Ee=Math.abs(G-J);2*Math.PI-Ee{let G=Xi(L,2*Math.PI),J=c.theta;J<0&&(J+=2*Math.PI),G<0&&(G+=2*Math.PI);let Ee=Math.abs(G-J);2*Math.PI-Eer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",oe),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",oe),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=a.NONE},this.update=(()=>{const L=new se,G=new se(0,1,0),J=new Fn().setFromUnitVectors(e.up,G),Ee=J.clone().invert(),Xe=new se,st=new Fn,wn=2*Math.PI;return function(){const Ii=r.object.position;J.setFromUnitVectors(e.up,G),Ee.copy(J).invert(),L.copy(Ii).sub(r.target),L.applyQuaternion(J),c.setFromVector3(L),r.autoRotate&&l===a.NONE&&j(A()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let pt=r.minAzimuthAngle,ht=r.maxAzimuthAngle;isFinite(pt)&&isFinite(ht)&&(pt<-Math.PI?pt+=wn:pt>Math.PI&&(pt-=wn),ht<-Math.PI?ht+=wn:ht>Math.PI&&(ht-=wn),pt<=ht?c.theta=Math.max(pt,Math.min(ht,c.theta)):c.theta=c.theta>(pt+ht)/2?Math.max(pt,c.theta):Math.min(ht,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&y||r.object.isOrthographicCamera?c.radius=C(c.radius):c.radius=C(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Ee),Ii.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let Jt=!1;if(r.zoomToCursor&&y){let en=null;if(r.object instanceof _t&&r.object.isPerspectiveCamera){const tn=L.length();en=C(tn*p);const Tn=tn-en;r.object.position.addScaledVector(M,Tn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const tn=new se(x.x,x.y,0);tn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),Jt=!0;const Tn=new se(x.x,x.y,0);Tn.unproject(r.object),r.object.position.sub(Tn).add(tn),r.object.updateMatrixWorld(),en=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;en!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(en).add(r.object.position):(En.origin.copy(r.object.position),En.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(En.direction))u||8*(1-st.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Xe.copy(r.object.position),st.copy(r.object.quaternion),Jt=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",He),r.domElement.addEventListener("pointerdown",Me),r.domElement.addEventListener("pointercancel",et),r.domElement.addEventListener("wheel",K)},this.dispose=()=>{var L,G,J,Ee,Xe,st;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",He),(G=r.domElement)==null||G.removeEventListener("pointerdown",Me),(J=r.domElement)==null||J.removeEventListener("pointercancel",et),(Ee=r.domElement)==null||Ee.removeEventListener("wheel",K),(Xe=r.domElement)==null||Xe.ownerDocument.removeEventListener("pointermove",Ve),(st=r.domElement)==null||st.ownerDocument.removeEventListener("pointerup",et),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",oe)};const r=this,i={type:"change"},o={type:"start"},s={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,c=new Ni,f=new Ni;let p=1;const d=new se,g=new Pe,k=new Pe,v=new Pe,w=new Pe,I=new Pe,E=new Pe,R=new Pe,P=new Pe,h=new Pe,M=new se,x=new Pe;let y=!1;const m=[],T={};function A(){return 2*Math.PI/60/60*r.autoRotateSpeed}function F(){return Math.pow(.95,r.zoomSpeed)}function j(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function D(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const z=(()=>{const L=new se;return function(G,J){L.setFromMatrixColumn(J,0),L.multiplyScalar(-G),d.add(L)}})(),Q=(()=>{const L=new se;return function(G,J){r.screenSpacePanning===!0?L.setFromMatrixColumn(J,1):(L.setFromMatrixColumn(J,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(G),d.add(L)}})(),Z=(()=>{const L=new se;return function(G,J){const Ee=r.domElement;if(Ee&&r.object instanceof _t&&r.object.isPerspectiveCamera){const Xe=r.object.position;L.copy(Xe).sub(r.target);let st=L.length();st*=Math.tan(r.object.fov/2*Math.PI/180),z(2*G*st/Ee.clientHeight,r.object.matrix),Q(2*J*st/Ee.clientHeight,r.object.matrix)}else Ee&&r.object instanceof $t&&r.object.isOrthographicCamera?(z(G*(r.object.right-r.object.left)/r.object.zoom/Ee.clientWidth,r.object.matrix),Q(J*(r.object.top-r.object.bottom)/r.object.zoom/Ee.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function Y(L){r.object instanceof _t&&r.object.isPerspectiveCamera||r.object instanceof $t&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _(L){Y(p/L)}function te(L){Y(p*L)}function me(L){if(!r.zoomToCursor||!r.domElement)return;y=!0;const G=r.domElement.getBoundingClientRect(),J=L.clientX-G.left,Ee=L.clientY-G.top,Xe=G.width,st=G.height;x.x=J/Xe*2-1,x.y=-(Ee/st)*2+1,M.set(x.x,x.y,1).unproject(r.object).sub(r.object.position).normalize()}function C(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function ge(L){g.set(L.clientX,L.clientY)}function ke(L){me(L),R.set(L.clientX,L.clientY)}function ye(L){w.set(L.clientX,L.clientY)}function De(L){k.set(L.clientX,L.clientY),v.subVectors(k,g).multiplyScalar(r.rotateSpeed);const G=r.domElement;G&&(j(2*Math.PI*v.x/G.clientHeight),D(2*Math.PI*v.y/G.clientHeight)),g.copy(k),r.update()}function H(L){P.set(L.clientX,L.clientY),h.subVectors(P,R),h.y>0?_(F()):h.y<0&&te(F()),R.copy(P),r.update()}function b(L){I.set(L.clientX,L.clientY),E.subVectors(I,w).multiplyScalar(r.panSpeed),Z(E.x,E.y),w.copy(I),r.update()}function S(L){me(L),L.deltaY<0?te(F()):L.deltaY>0&&_(F()),r.update()}function N(L){let G=!1;switch(L.code){case r.keys.UP:Z(0,r.keyPanSpeed),G=!0;break;case r.keys.BOTTOM:Z(0,-r.keyPanSpeed),G=!0;break;case r.keys.LEFT:Z(r.keyPanSpeed,0),G=!0;break;case r.keys.RIGHT:Z(-r.keyPanSpeed,0),G=!0;break}G&&(L.preventDefault(),r.update())}function V(){if(m.length==1)g.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),G=.5*(m[0].pageY+m[1].pageY);g.set(L,G)}}function B(){if(m.length==1)w.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),G=.5*(m[0].pageY+m[1].pageY);w.set(L,G)}}function q(){const L=m[0].pageX-m[1].pageX,G=m[0].pageY-m[1].pageY,J=Math.sqrt(L*L+G*G);R.set(0,J)}function ne(){r.enableZoom&&q(),r.enablePan&&B()}function xe(){r.enableZoom&&q(),r.enableRotate&&V()}function Ae(L){if(m.length==1)k.set(L.pageX,L.pageY);else{const J=dt(L),Ee=.5*(L.pageX+J.x),Xe=.5*(L.pageY+J.y);k.set(Ee,Xe)}v.subVectors(k,g).multiplyScalar(r.rotateSpeed);const G=r.domElement;G&&(j(2*Math.PI*v.x/G.clientHeight),D(2*Math.PI*v.y/G.clientHeight)),g.copy(k)}function fe(L){if(m.length==1)I.set(L.pageX,L.pageY);else{const G=dt(L),J=.5*(L.pageX+G.x),Ee=.5*(L.pageY+G.y);I.set(J,Ee)}E.subVectors(I,w).multiplyScalar(r.panSpeed),Z(E.x,E.y),w.copy(I)}function ve(L){const G=dt(L),J=L.pageX-G.x,Ee=L.pageY-G.y,Xe=Math.sqrt(J*J+Ee*Ee);P.set(0,Xe),h.set(0,Math.pow(P.y/R.y,r.zoomSpeed)),_(h.y),R.copy(P)}function Ie(L){r.enableZoom&&ve(L),r.enablePan&&fe(L)}function we(L){r.enableZoom&&ve(L),r.enableRotate&&Ae(L)}function Me(L){var G,J;r.enabled!==!1&&(m.length===0&&((G=r.domElement)==null||G.ownerDocument.addEventListener("pointermove",Ve),(J=r.domElement)==null||J.ownerDocument.addEventListener("pointerup",et)),ft(L),L.pointerType==="touch"?ue(L):Zt(L))}function Ve(L){r.enabled!==!1&&(L.pointerType==="touch"?be(L):U(L))}function et(L){var G,J,Ee;ot(L),m.length===0&&((G=r.domElement)==null||G.releasePointerCapture(L.pointerId),(J=r.domElement)==null||J.ownerDocument.removeEventListener("pointermove",Ve),(Ee=r.domElement)==null||Ee.ownerDocument.removeEventListener("pointerup",et)),r.dispatchEvent(s),l=a.NONE}function Zt(L){let G;switch(L.button){case 0:G=r.mouseButtons.LEFT;break;case 1:G=r.mouseButtons.MIDDLE;break;case 2:G=r.mouseButtons.RIGHT;break;default:G=-1}switch(G){case gt.DOLLY:if(r.enableZoom===!1)return;ke(L),l=a.DOLLY;break;case gt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;ye(L),l=a.PAN}else{if(r.enableRotate===!1)return;ge(L),l=a.ROTATE}break;case gt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;ge(L),l=a.ROTATE}else{if(r.enablePan===!1)return;ye(L),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(o)}function U(L){if(r.enabled!==!1)switch(l){case a.ROTATE:if(r.enableRotate===!1)return;De(L);break;case a.DOLLY:if(r.enableZoom===!1)return;H(L);break;case a.PAN:if(r.enablePan===!1)return;b(L);break}}function K(L){r.enabled===!1||r.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(L.preventDefault(),r.dispatchEvent(o),S(L),r.dispatchEvent(s))}function oe(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(vt(L),m.length){case 1:switch(r.touches.ONE){case kt.ROTATE:if(r.enableRotate===!1)return;V(),l=a.TOUCH_ROTATE;break;case kt.PAN:if(r.enablePan===!1)return;B(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(r.touches.TWO){case kt.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ne(),l=a.TOUCH_DOLLY_PAN;break;case kt.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;xe(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(o)}function be(L){switch(vt(L),l){case a.TOUCH_ROTATE:if(r.enableRotate===!1)return;Ae(L),r.update();break;case a.TOUCH_PAN:if(r.enablePan===!1)return;fe(L),r.update();break;case a.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case a.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;we(L),r.update();break;default:l=a.NONE}}function He(L){r.enabled!==!1&&L.preventDefault()}function ft(L){m.push(L)}function ot(L){delete T[L.pointerId];for(let G=0;G{te(L),r.update()},this.dollyOut=(L=F())=>{_(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Y(L),r.update()},this.getZoomScale=()=>F(),n!==void 0&&this.connect(n),this.update()}}new yt;new se;new rs;new se;var Sc=Object.defineProperty,Ic=(t,e,n)=>e in t?Sc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mi=(t,e,n)=>(Ic(t,typeof e!="symbol"?e+"":e,n),n);class Ds{constructor(e){mi(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},s=Rc(e,n,this.data,o);for(let a=0,l=s.length;a + `},Ps=new yn({name:"SkyShader",fragmentShader:On.fragmentShader,vertexShader:On.vertexShader,uniforms:si.clone(On.uniforms),side:Ya,depthWrite:!1});class Os extends Pt{constructor(){super(new rl(1,1,1),Ps)}}Ls(Os,"SkyShader",On);Ls(Os,"material",Ps);new Ka;new se;new rs(0,0,0,"YXZ");new se;var Ac=Object.defineProperty,_c=(t,e,n)=>e in t?Ac(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,re=(t,e,n)=>(_c(t,typeof e!="symbol"?e+"":e,n),n);const Mn=new qa,Wi=new es,Ec=Math.cos(70*(Math.PI/180)),Xi=(t,e)=>(t%e+e)%e;class Mc extends $a{constructor(e,n){super(),re(this,"object"),re(this,"domElement"),re(this,"enabled",!0),re(this,"target",new se),re(this,"minDistance",0),re(this,"maxDistance",1/0),re(this,"minZoom",0),re(this,"maxZoom",1/0),re(this,"minPolarAngle",0),re(this,"maxPolarAngle",Math.PI),re(this,"minAzimuthAngle",-1/0),re(this,"maxAzimuthAngle",1/0),re(this,"enableDamping",!1),re(this,"dampingFactor",.05),re(this,"enableZoom",!0),re(this,"zoomSpeed",1),re(this,"enableRotate",!0),re(this,"rotateSpeed",1),re(this,"enablePan",!0),re(this,"panSpeed",1),re(this,"screenSpacePanning",!0),re(this,"keyPanSpeed",7),re(this,"zoomToCursor",!1),re(this,"autoRotate",!1),re(this,"autoRotateSpeed",2),re(this,"reverseOrbit",!1),re(this,"reverseHorizontalOrbit",!1),re(this,"reverseVerticalOrbit",!1),re(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),re(this,"mouseButtons",{LEFT:gt.ROTATE,MIDDLE:gt.DOLLY,RIGHT:gt.PAN}),re(this,"touches",{ONE:kt.ROTATE,TWO:kt.DOLLY_PAN}),re(this,"target0"),re(this,"position0"),re(this,"zoom0"),re(this,"_domElementKeyEvents",null),re(this,"getPolarAngle"),re(this,"getAzimuthalAngle"),re(this,"setPolarAngle"),re(this,"setAzimuthalAngle"),re(this,"getDistance"),re(this,"getZoomScale"),re(this,"listenToKeyEvents"),re(this,"stopListenToKeyEvents"),re(this,"saveState"),re(this,"reset"),re(this,"update"),re(this,"connect"),re(this,"dispose"),re(this,"dollyIn"),re(this,"dollyOut"),re(this,"getScale"),re(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=L=>{let q=Xi(L,2*Math.PI),J=c.phi;J<0&&(J+=2*Math.PI),q<0&&(q+=2*Math.PI);let Ee=Math.abs(q-J);2*Math.PI-Ee{let q=Xi(L,2*Math.PI),J=c.theta;J<0&&(J+=2*Math.PI),q<0&&(q+=2*Math.PI);let Ee=Math.abs(q-J);2*Math.PI-Eer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",oe),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",oe),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=a.NONE},this.update=(()=>{const L=new se,q=new se(0,1,0),J=new zn().setFromUnitVectors(e.up,q),Ee=J.clone().invert(),Xe=new se,st=new zn,Tn=2*Math.PI;return function(){const Ii=r.object.position;J.setFromUnitVectors(e.up,q),Ee.copy(J).invert(),L.copy(Ii).sub(r.target),L.applyQuaternion(J),c.setFromVector3(L),r.autoRotate&&l===a.NONE&&j(_()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let pt=r.minAzimuthAngle,ht=r.maxAzimuthAngle;isFinite(pt)&&isFinite(ht)&&(pt<-Math.PI?pt+=Tn:pt>Math.PI&&(pt-=Tn),ht<-Math.PI?ht+=Tn:ht>Math.PI&&(ht-=Tn),pt<=ht?c.theta=Math.max(pt,Math.min(ht,c.theta)):c.theta=c.theta>(pt+ht)/2?Math.max(pt,c.theta):Math.min(ht,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&g||r.object.isOrthographicCamera?c.radius=C(c.radius):c.radius=C(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Ee),Ii.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let en=!1;if(r.zoomToCursor&&g){let tn=null;if(r.object instanceof _t&&r.object.isPerspectiveCamera){const nn=L.length();tn=C(nn*p);const kn=nn-tn;r.object.position.addScaledVector(M,kn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const nn=new se(y.x,y.y,0);nn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),en=!0;const kn=new se(y.x,y.y,0);kn.unproject(r.object),r.object.position.sub(kn).add(nn),r.object.updateMatrixWorld(),tn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;tn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(tn).add(r.object.position):(Mn.origin.copy(r.object.position),Mn.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Mn.direction))u||8*(1-st.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Xe.copy(r.object.position),st.copy(r.object.quaternion),en=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",He),r.domElement.addEventListener("pointerdown",Me),r.domElement.addEventListener("pointercancel",et),r.domElement.addEventListener("wheel",W)},this.dispose=()=>{var L,q,J,Ee,Xe,st;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",He),(q=r.domElement)==null||q.removeEventListener("pointerdown",Me),(J=r.domElement)==null||J.removeEventListener("pointercancel",et),(Ee=r.domElement)==null||Ee.removeEventListener("wheel",W),(Xe=r.domElement)==null||Xe.ownerDocument.removeEventListener("pointermove",Ve),(st=r.domElement)==null||st.ownerDocument.removeEventListener("pointerup",et),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",oe)};const r=this,i={type:"change"},o={type:"start"},s={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,c=new Ni,f=new Ni;let p=1;const d=new se,b=new Pe,x=new Pe,v=new Pe,T=new Pe,I=new Pe,A=new Pe,R=new Pe,P=new Pe,h=new Pe,M=new se,y=new Pe;let g=!1;const m=[],k={};function _(){return 2*Math.PI/60/60*r.autoRotateSpeed}function F(){return Math.pow(.95,r.zoomSpeed)}function j(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function D(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const z=(()=>{const L=new se;return function(q,J){L.setFromMatrixColumn(J,0),L.multiplyScalar(-q),d.add(L)}})(),Q=(()=>{const L=new se;return function(q,J){r.screenSpacePanning===!0?L.setFromMatrixColumn(J,1):(L.setFromMatrixColumn(J,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(q),d.add(L)}})(),Z=(()=>{const L=new se;return function(q,J){const Ee=r.domElement;if(Ee&&r.object instanceof _t&&r.object.isPerspectiveCamera){const Xe=r.object.position;L.copy(Xe).sub(r.target);let st=L.length();st*=Math.tan(r.object.fov/2*Math.PI/180),z(2*q*st/Ee.clientHeight,r.object.matrix),Q(2*J*st/Ee.clientHeight,r.object.matrix)}else Ee&&r.object instanceof $t&&r.object.isOrthographicCamera?(z(q*(r.object.right-r.object.left)/r.object.zoom/Ee.clientWidth,r.object.matrix),Q(J*(r.object.top-r.object.bottom)/r.object.zoom/Ee.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function K(L){r.object instanceof _t&&r.object.isPerspectiveCamera||r.object instanceof $t&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function E(L){K(p/L)}function te(L){K(p*L)}function me(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const q=r.domElement.getBoundingClientRect(),J=L.clientX-q.left,Ee=L.clientY-q.top,Xe=q.width,st=q.height;y.x=J/Xe*2-1,y.y=-(Ee/st)*2+1,M.set(y.x,y.y,1).unproject(r.object).sub(r.object.position).normalize()}function C(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function ge(L){b.set(L.clientX,L.clientY)}function ke(L){me(L),R.set(L.clientX,L.clientY)}function ye(L){T.set(L.clientX,L.clientY)}function De(L){x.set(L.clientX,L.clientY),v.subVectors(x,b).multiplyScalar(r.rotateSpeed);const q=r.domElement;q&&(j(2*Math.PI*v.x/q.clientHeight),D(2*Math.PI*v.y/q.clientHeight)),b.copy(x),r.update()}function G(L){P.set(L.clientX,L.clientY),h.subVectors(P,R),h.y>0?E(F()):h.y<0&&te(F()),R.copy(P),r.update()}function w(L){I.set(L.clientX,L.clientY),A.subVectors(I,T).multiplyScalar(r.panSpeed),Z(A.x,A.y),T.copy(I),r.update()}function S(L){me(L),L.deltaY<0?te(F()):L.deltaY>0&&E(F()),r.update()}function N(L){let q=!1;switch(L.code){case r.keys.UP:Z(0,r.keyPanSpeed),q=!0;break;case r.keys.BOTTOM:Z(0,-r.keyPanSpeed),q=!0;break;case r.keys.LEFT:Z(r.keyPanSpeed,0),q=!0;break;case r.keys.RIGHT:Z(-r.keyPanSpeed,0),q=!0;break}q&&(L.preventDefault(),r.update())}function V(){if(m.length==1)b.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),q=.5*(m[0].pageY+m[1].pageY);b.set(L,q)}}function B(){if(m.length==1)T.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),q=.5*(m[0].pageY+m[1].pageY);T.set(L,q)}}function Y(){const L=m[0].pageX-m[1].pageX,q=m[0].pageY-m[1].pageY,J=Math.sqrt(L*L+q*q);R.set(0,J)}function ne(){r.enableZoom&&Y(),r.enablePan&&B()}function xe(){r.enableZoom&&Y(),r.enableRotate&&V()}function Ae(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const J=dt(L),Ee=.5*(L.pageX+J.x),Xe=.5*(L.pageY+J.y);x.set(Ee,Xe)}v.subVectors(x,b).multiplyScalar(r.rotateSpeed);const q=r.domElement;q&&(j(2*Math.PI*v.x/q.clientHeight),D(2*Math.PI*v.y/q.clientHeight)),b.copy(x)}function fe(L){if(m.length==1)I.set(L.pageX,L.pageY);else{const q=dt(L),J=.5*(L.pageX+q.x),Ee=.5*(L.pageY+q.y);I.set(J,Ee)}A.subVectors(I,T).multiplyScalar(r.panSpeed),Z(A.x,A.y),T.copy(I)}function ve(L){const q=dt(L),J=L.pageX-q.x,Ee=L.pageY-q.y,Xe=Math.sqrt(J*J+Ee*Ee);P.set(0,Xe),h.set(0,Math.pow(P.y/R.y,r.zoomSpeed)),E(h.y),R.copy(P)}function Ie(L){r.enableZoom&&ve(L),r.enablePan&&fe(L)}function we(L){r.enableZoom&&ve(L),r.enableRotate&&Ae(L)}function Me(L){var q,J;r.enabled!==!1&&(m.length===0&&((q=r.domElement)==null||q.ownerDocument.addEventListener("pointermove",Ve),(J=r.domElement)==null||J.ownerDocument.addEventListener("pointerup",et)),ft(L),L.pointerType==="touch"?ue(L):Jt(L))}function Ve(L){r.enabled!==!1&&(L.pointerType==="touch"?be(L):U(L))}function et(L){var q,J,Ee;ot(L),m.length===0&&((q=r.domElement)==null||q.releasePointerCapture(L.pointerId),(J=r.domElement)==null||J.ownerDocument.removeEventListener("pointermove",Ve),(Ee=r.domElement)==null||Ee.ownerDocument.removeEventListener("pointerup",et)),r.dispatchEvent(s),l=a.NONE}function Jt(L){let q;switch(L.button){case 0:q=r.mouseButtons.LEFT;break;case 1:q=r.mouseButtons.MIDDLE;break;case 2:q=r.mouseButtons.RIGHT;break;default:q=-1}switch(q){case gt.DOLLY:if(r.enableZoom===!1)return;ke(L),l=a.DOLLY;break;case gt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;ye(L),l=a.PAN}else{if(r.enableRotate===!1)return;ge(L),l=a.ROTATE}break;case gt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;ge(L),l=a.ROTATE}else{if(r.enablePan===!1)return;ye(L),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(o)}function U(L){if(r.enabled!==!1)switch(l){case a.ROTATE:if(r.enableRotate===!1)return;De(L);break;case a.DOLLY:if(r.enableZoom===!1)return;G(L);break;case a.PAN:if(r.enablePan===!1)return;w(L);break}}function W(L){r.enabled===!1||r.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(L.preventDefault(),r.dispatchEvent(o),S(L),r.dispatchEvent(s))}function oe(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(vt(L),m.length){case 1:switch(r.touches.ONE){case kt.ROTATE:if(r.enableRotate===!1)return;V(),l=a.TOUCH_ROTATE;break;case kt.PAN:if(r.enablePan===!1)return;B(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(r.touches.TWO){case kt.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ne(),l=a.TOUCH_DOLLY_PAN;break;case kt.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;xe(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(o)}function be(L){switch(vt(L),l){case a.TOUCH_ROTATE:if(r.enableRotate===!1)return;Ae(L),r.update();break;case a.TOUCH_PAN:if(r.enablePan===!1)return;fe(L),r.update();break;case a.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case a.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;we(L),r.update();break;default:l=a.NONE}}function He(L){r.enabled!==!1&&L.preventDefault()}function ft(L){m.push(L)}function ot(L){delete k[L.pointerId];for(let q=0;q{te(L),r.update()},this.dollyOut=(L=F())=>{E(L),r.update()},this.getScale=()=>p,this.setScale=L=>{K(L),r.update()},this.getZoomScale=()=>F(),n!==void 0&&this.connect(n),this.update()}}new yt;new se;new rs;new se;var Sc=Object.defineProperty,Ic=(t,e,n)=>e in t?Sc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mi=(t,e,n)=>(Ic(t,typeof e!="symbol"?e+"":e,n),n);class Ds{constructor(e){mi(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},s=Rc(e,n,this.data,o);for(let a=0,l=s.length;a #include #include uniform float thickness; @@ -423,22 +423,22 @@ var Ma=Object.defineProperty;var Sa=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,config gl_FragColor = vec4(color, opacity); #include #include - }`);const Nc=["args","material-uniforms-color-value"];zr.ReflectorShader;new se;new se;new se;var dr;/Mac/.test((dr=globalThis==null?void 0:globalThis.navigator)===null||dr===void 0?void 0:dr.platform);const Lc=["target","auto-rotate","auto-rotate-speed","enable-damping","damping-factor","enable-pan","key-pan-speed","keys","max-azimuth-angle","min-azimuth-angle","max-polar-angle","min-polar-angle","min-distance","max-distance","min-zoom","max-zoom","touches","enable-zoom","zoom-speed","enable-rotate","rotate-speed","mouse-buttons","args"],Pc=Fe({__name:"OrbitControls",props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:kt.ROTATE,TWO:kt.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:gt.ROTATE,MIDDLE:gt.DOLLY,RIGHT:gt.PAN})}},emits:["change","start","end"],setup(t,{expose:e,emit:n}){const r=t,i=n,{makeDefault:o,autoRotate:s,autoRotateSpeed:a,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:g,minPolarAngle:k,minDistance:v,maxDistance:w,minZoom:I,maxZoom:E,enableZoom:R,zoomSpeed:P,enableRotate:h,touches:M,rotateSpeed:x,target:y,mouseButtons:m}=ri(r),{camera:T,renderer:A,extend:F,controls:j,invalidate:D}=qn(),z=Jo(null);F({OrbitControls:Mc}),je(z,Y=>{Q(),Y&&o.value?j.value=Y:j.value=null});function Q(){ar(z.value,"change",()=>{i("change",z.value),D()}),ar(z.value,"start",()=>i("start",z.value)),ar(z.value,"end",()=>i("end",z.value))}const{onBeforeRender:Z}=Dn();return Z(({invalidate:Y})=>{z.value&&(l.value||s.value)&&(z.value.update(),s.value&&Y())}),Dt(()=>{z.value&&z.value.dispose()}),e({instance:z}),(Y,_)=>(Y.camera||X(T))&&(Y.domElement||X(A))?(ee(),ie("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:z,target:X(y),"auto-rotate":X(s),"auto-rotate-speed":X(a),"enable-damping":X(l),"damping-factor":X(u),"enable-pan":X(c),"key-pan-speed":X(f),keys:Y.keys,"max-azimuth-angle":X(p),"min-azimuth-angle":X(d),"max-polar-angle":X(g),"min-polar-angle":X(k),"min-distance":X(v),"max-distance":X(w),"min-zoom":X(I),"max-zoom":X(E),touches:X(M),"enable-zoom":X(R),"zoom-speed":X(P),"enable-rotate":X(h),"rotate-speed":X(x),"mouse-buttons":X(m),args:[Y.camera||X(T),Y.domElement||X(A).domElement]},null,8,Lc)):it("",!0)}});function Mn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Qi={exports:{}},Zi;function Oc(){return Zi||(Zi=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function s(u,c){if(!i[u]){if(!r[u]){var f=typeof Mn=="function"&&Mn;if(!c&&f)return f(u,!0);if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},r[u][0].call(c.exports,function(p){var d=r[u][1][p];return s(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var a=typeof Mn=="function"&&Mn,l=0;l[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:kt.ROTATE,TWO:kt.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:gt.ROTATE,MIDDLE:gt.DOLLY,RIGHT:gt.PAN})}},emits:["change","start","end"],setup(t,{expose:e,emit:n}){const r=t,i=n,{makeDefault:o,autoRotate:s,autoRotateSpeed:a,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:b,minPolarAngle:x,minDistance:v,maxDistance:T,minZoom:I,maxZoom:A,enableZoom:R,zoomSpeed:P,enableRotate:h,touches:M,rotateSpeed:y,target:g,mouseButtons:m}=ri(r),{camera:k,renderer:_,extend:F,controls:j,invalidate:D}=Yn(),z=Jo(null);F({OrbitControls:Mc}),je(z,K=>{Q(),K&&o.value?j.value=K:j.value=null});function Q(){lr(z.value,"change",()=>{i("change",z.value),D()}),lr(z.value,"start",()=>i("start",z.value)),lr(z.value,"end",()=>i("end",z.value))}const{onBeforeRender:Z}=Fn();return Z(({invalidate:K})=>{z.value&&(l.value||s.value)&&(z.value.update(),s.value&&K())}),Ft(()=>{z.value&&z.value.dispose()}),e({instance:z}),(K,E)=>(K.camera||H(k))&&(K.domElement||H(_))?(ee(),ie("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:z,target:H(g),"auto-rotate":H(s),"auto-rotate-speed":H(a),"enable-damping":H(l),"damping-factor":H(u),"enable-pan":H(c),"key-pan-speed":H(f),keys:K.keys,"max-azimuth-angle":H(p),"min-azimuth-angle":H(d),"max-polar-angle":H(b),"min-polar-angle":H(x),"min-distance":H(v),"max-distance":H(T),"min-zoom":H(I),"max-zoom":H(A),touches:H(M),"enable-zoom":H(R),"zoom-speed":H(P),"enable-rotate":H(h),"rotate-speed":H(y),"mouse-buttons":H(m),args:[K.camera||H(k),K.domElement||H(_).domElement]},null,8,Lc)):it("",!0)}});function Sn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Qi={exports:{}},Zi;function Oc(){return Zi||(Zi=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function s(u,c){if(!i[u]){if(!r[u]){var f=typeof Sn=="function"&&Sn;if(!c&&f)return f(u,!0);if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},r[u][0].call(c.exports,function(p){var d=r[u][1][p];return s(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var a=typeof Sn=="function"&&Sn,l=0;l>16),D((65280&m)>>8),D(255&m);return T==2?D(255&(m=M(x.charAt(y))<<2|M(x.charAt(y+1))>>4)):T==1&&(D((m=M(x.charAt(y))<<10|M(x.charAt(y+1))<<4|M(x.charAt(y+2))>>2)>>8&255),D(255&m)),A},g.fromByteArray=function(x){var y,m,T,A,F=x.length%3,j="";function D(z){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(z)}for(y=0,T=x.length-F;y>18&63)+D(A>>12&63)+D(A>>6&63)+D(63&A);switch(F){case 1:j=(j+=D((m=x[x.length-1])>>2))+D(m<<4&63)+"==";break;case 2:j=(j=(j+=D((m=(x[x.length-2]<<8)+x[x.length-1])>>10))+D(m>>4&63))+D(m<<2&63)+"="}return j}})(i===void 0?this.base64js={}:i)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,i){(function(o,s,v,l,u,c,f,p,d){var g=n("base64-js"),k=n("ieee754");function v(b,S,N){if(!(this instanceof v))return new v(b,S,N);var V,B,q,ne,xe=typeof b;if(S==="base64"&&xe=="string")for(b=(ne=b).trim?ne.trim():ne.replace(/^\s+|\s+$/g,"");b.length%4!=0;)b+="=";if(xe=="number")V=Z(b);else if(xe=="string")V=v.byteLength(b,S);else{if(xe!="object")throw new Error("First argument needs to be a number, array or string.");V=Z(b.length)}if(v._useTypedArrays?B=v._augment(new Uint8Array(V)):((B=this).length=V,B._isBuffer=!0),v._useTypedArrays&&typeof b.byteLength=="number")B._set(b);else if(Y(ne=b)||v.isBuffer(ne)||ne&&typeof ne=="object"&&typeof ne.length=="number")for(q=0;q>8,ne=ne%256,xe.push(ne),xe.push(q);return xe}(S),b,N,V)}function E(b,S,N){var V="";N=Math.min(b.length,N);for(var B=S;B>>0)):(S+1>>0),B}function h(b,S,N,V){if(V||(H(typeof N=="boolean","missing or invalid endian"),H(S!=null,"missing offset"),H(S+1>>8*(V?q:1-q)}function T(b,S,N,V,B){if(B||(H(S!=null,"missing value"),H(typeof V=="boolean","missing or invalid endian"),H(N!=null,"missing offset"),H(N+3>>8*(V?q:3-q)&255}function A(b,S,N,V,B){B||(H(S!=null,"missing value"),H(typeof V=="boolean","missing or invalid endian"),H(N!=null,"missing offset"),H(N+1this.length&&(V=this.length);var B=(V=b.length-S=this.length))return this[b]},v.prototype.readUInt16LE=function(b,S){return R(this,b,!0,S)},v.prototype.readUInt16BE=function(b,S){return R(this,b,!1,S)},v.prototype.readUInt32LE=function(b,S){return P(this,b,!0,S)},v.prototype.readUInt32BE=function(b,S){return P(this,b,!1,S)},v.prototype.readInt8=function(b,S){if(S||(H(b!=null,"missing offset"),H(b=this.length))return 128&this[b]?-1*(255-this[b]+1):this[b]},v.prototype.readInt16LE=function(b,S){return h(this,b,!0,S)},v.prototype.readInt16BE=function(b,S){return h(this,b,!1,S)},v.prototype.readInt32LE=function(b,S){return M(this,b,!0,S)},v.prototype.readInt32BE=function(b,S){return M(this,b,!1,S)},v.prototype.readFloatLE=function(b,S){return x(this,b,!0,S)},v.prototype.readFloatBE=function(b,S){return x(this,b,!1,S)},v.prototype.readDoubleLE=function(b,S){return y(this,b,!0,S)},v.prototype.readDoubleBE=function(b,S){return y(this,b,!1,S)},v.prototype.writeUInt8=function(b,S,N){N||(H(b!=null,"missing value"),H(S!=null,"missing offset"),H(S=this.length||(this[S]=b)},v.prototype.writeUInt16LE=function(b,S,N){m(this,b,S,!0,N)},v.prototype.writeUInt16BE=function(b,S,N){m(this,b,S,!1,N)},v.prototype.writeUInt32LE=function(b,S,N){T(this,b,S,!0,N)},v.prototype.writeUInt32BE=function(b,S,N){T(this,b,S,!1,N)},v.prototype.writeInt8=function(b,S,N){N||(H(b!=null,"missing value"),H(S!=null,"missing offset"),H(S=this.length||(0<=b?this.writeUInt8(b,S,N):this.writeUInt8(255+b+1,S,N))},v.prototype.writeInt16LE=function(b,S,N){A(this,b,S,!0,N)},v.prototype.writeInt16BE=function(b,S,N){A(this,b,S,!1,N)},v.prototype.writeInt32LE=function(b,S,N){F(this,b,S,!0,N)},v.prototype.writeInt32BE=function(b,S,N){F(this,b,S,!1,N)},v.prototype.writeFloatLE=function(b,S,N){j(this,b,S,!0,N)},v.prototype.writeFloatBE=function(b,S,N){j(this,b,S,!1,N)},v.prototype.writeDoubleLE=function(b,S,N){D(this,b,S,!0,N)},v.prototype.writeDoubleBE=function(b,S,N){D(this,b,S,!1,N)},v.prototype.fill=function(b,S,N){if(S=S||0,N=N||this.length,H(typeof(b=typeof(b=b||0)=="string"?b.charCodeAt(0):b)=="number"&&!isNaN(b),"value is not a number"),H(S<=N,"end < start"),N!==S&&this.length!==0){H(0<=S&&S"},v.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(v._useTypedArrays)return new v(this).buffer;for(var b=new Uint8Array(this.length),S=0,N=b.length;S=S.length||B>=b.length);B++)S[B+N]=b[B];return B}function ge(b){try{return decodeURIComponent(b)}catch{return"�"}}function ke(b,S){H(typeof b=="number","cannot write a non-number as a number"),H(0<=b,"specified a negative value for writing an unsigned value"),H(b<=S,"value is larger than maximum value for type"),H(Math.floor(b)===b,"value has a fractional component")}function ye(b,S,N){H(typeof b=="number","cannot write a non-number as a number"),H(b<=S,"value larger than maximum allowed value"),H(N<=b,"value smaller than minimum allowed value"),H(Math.floor(b)===b,"value has a fractional component")}function De(b,S,N){H(typeof b=="number","cannot write a non-number as a number"),H(b<=S,"value larger than maximum allowed value"),H(N<=b,"value smaller than minimum allowed value")}function H(b,S){if(!b)throw new Error(S||"Failed assertion")}v._augment=function(b){return b._isBuffer=!0,b._get=b.get,b._set=b.set,b.get=z.get,b.set=z.set,b.write=z.write,b.toString=z.toString,b.toLocaleString=z.toString,b.toJSON=z.toJSON,b.copy=z.copy,b.slice=z.slice,b.readUInt8=z.readUInt8,b.readUInt16LE=z.readUInt16LE,b.readUInt16BE=z.readUInt16BE,b.readUInt32LE=z.readUInt32LE,b.readUInt32BE=z.readUInt32BE,b.readInt8=z.readInt8,b.readInt16LE=z.readInt16LE,b.readInt16BE=z.readInt16BE,b.readInt32LE=z.readInt32LE,b.readInt32BE=z.readInt32BE,b.readFloatLE=z.readFloatLE,b.readFloatBE=z.readFloatBE,b.readDoubleLE=z.readDoubleLE,b.readDoubleBE=z.readDoubleBE,b.writeUInt8=z.writeUInt8,b.writeUInt16LE=z.writeUInt16LE,b.writeUInt16BE=z.writeUInt16BE,b.writeUInt32LE=z.writeUInt32LE,b.writeUInt32BE=z.writeUInt32BE,b.writeInt8=z.writeInt8,b.writeInt16LE=z.writeInt16LE,b.writeInt16BE=z.writeInt16BE,b.writeInt32LE=z.writeInt32LE,b.writeInt32BE=z.writeInt32BE,b.writeFloatLE=z.writeFloatLE,b.writeFloatBE=z.writeFloatBE,b.writeDoubleLE=z.writeDoubleLE,b.writeDoubleBE=z.writeDoubleBE,b.fill=z.fill,b.inspect=z.inspect,b.toArrayBuffer=z.toArrayBuffer,b}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,i){(function(o,s,g,l,u,c,f,p,d){var g=n("buffer").Buffer,k=4,v=new g(k);v.fill(0),r.exports={hash:function(w,I,E,R){for(var P=I(function(m,T){m.length%k!=0&&(A=m.length+(k-m.length%k),m=g.concat([m,v],A));for(var A,F=[],j=T?m.readInt32BE:m.readInt32LE,D=0;DE?Q=z(Q):Q.length>5]|=128<>>9<<4)]=M;for(var x=1732584193,y=-271733879,m=-1732584194,T=271733878,A=0;A>>32-m,x)}function w(h,M,x,y,m,T,A){return v(M&x|~M&y,h,M,m,T,A)}function I(h,M,x,y,m,T,A){return v(M&y|x&~y,h,M,m,T,A)}function E(h,M,x,y,m,T,A){return v(M^x^y,h,M,m,T,A)}function R(h,M,x,y,m,T,A){return v(x^(M|~y),h,M,m,T,A)}function P(h,M){var x=(65535&h)+(65535&M);return(h>>16)+(M>>16)+(x>>16)<<16|65535&x}r.exports=function(h){return g.hash(h,k,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){r.exports=function(g){for(var k,v=new Array(g),w=0;w>>((3&w)<<3)&255;return v}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){var g=n("./helpers");function k(I,E){I[E>>5]|=128<<24-E%32,I[15+(E+64>>9<<4)]=E;for(var R,P,h,M=Array(80),x=1732584193,y=-271733879,m=-1732584194,T=271733878,A=-1009589776,F=0;F>16)+(E>>16)+(R>>16)<<16|65535&R}function w(I,E){return I<>>32-E}r.exports=function(I){return g.hash(I,k,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){function g(E,R){var P=(65535&E)+(65535&R);return(E>>16)+(R>>16)+(P>>16)<<16|65535&P}function k(E,R){var P,h=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),M=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),x=new Array(64);E[R>>5]|=128<<24-R%32,E[15+(R+64>>9<<4)]=R;for(var y,m,T=0;T>>R|E<<32-R},I=function(E,R){return E>>>R};r.exports=function(E){return v.hash(E,k,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){i.read=function(g,k,v,w,T){var E,R,P=8*T-w-1,h=(1<>1,x=-7,y=v?T-1:0,m=v?-1:1,T=g[k+y];for(y+=m,E=T&(1<<-x)-1,T>>=-x,x+=P;0>=-x,x+=w;0>1,y=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=w?0:A-1,T=w?1:-1,A=k<0||k===0&&1/k<0?1:0;for(k=Math.abs(k),isNaN(k)||k===1/0?(P=isNaN(k)?1:0,R=M):(R=Math.floor(Math.log(k)/Math.LN2),k*(w=Math.pow(2,-R))<1&&(R--,w*=2),2<=(k+=1<=R+x?y/w:y*Math.pow(2,1-x))*w&&(R++,w/=2),M<=R+x?(P=0,R=M):1<=R+x?(P=(k*w-1)*Math.pow(2,I),R+=x):(P=k*Math.pow(2,x-1)*Math.pow(2,I),R=0));8<=I;g[v+m]=255&P,m+=T,P/=256,I-=8);for(R=R<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),to}var ro,io;function zs(){return io||(io=1,ro=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),ro}var pr,oo;function Fc(){if(oo)return pr;oo=1;var t=Fs();return pr=t.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),pr}var hr,so;function zc(){if(so)return hr;so=1;var t=zs();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),hr=t.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),hr}var mr,ao;function Bc(){if(ao)return mr;ao=1,mr=R;var t=Fs(),e=Dc(),n=zs(),r=Fc(),i=zc(),o=999,s=9999,a=0,l=1,u=2,c=3,f=4,p=5,d=6,g=7,k=8,v=9,w=10,I=11,E=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function R(P){var h=0,M=0,x=o,y,m,T=[],A=[],F=1,j=0,D=0,z=!1,Q=!1,Z="",Y;P=P||{};var _=n,te=t;P.version==="300 es"&&(_=i,te=r);for(var me={},C={},h=0;h<_.length;h++)me[_[h]]=!0;for(var h=0;h0)continue;we=fe.slice(0,1).join("")}return ge(we),D+=we.length,T=T.slice(we.length),T.length}while(!0)}function q(){return/[^a-fA-F0-9]/.test(y)?(ge(T.join("")),x=o,h):(T.push(y),m=y,h+1)}function ne(){return y==="."||/[eE]/.test(y)?(T.push(y),x=p,m=y,h+1):y==="x"&&T.length===1&&T[0]==="0"?(x=I,T.push(y),m=y,h+1):/[^\d]/.test(y)?(ge(T.join("")),x=o,h):(T.push(y),m=y,h+1)}function xe(){return y==="f"&&(T.push(y),m=y,h+=1),/[eE]/.test(y)||(y==="-"||y==="+")&&/[eE]/.test(m)?(T.push(y),m=y,h+1):/[^\d]/.test(y)?(ge(T.join("")),x=o,h):(T.push(y),m=y,h+1)}function Ae(){if(/[^\d\w_]/.test(y)){var fe=T.join("");return C[fe]?x=k:me[fe]?x=g:x=d,ge(T.join("")),x=o,h}return T.push(y),m=y,h+1}}return mr}var gr,lo;function Uc(){if(lo)return gr;lo=1;var t=Bc();gr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return gr}Uc();function jc(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vc(t){var e=jc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=Vc(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},$e,Bt;$e={},Se($e,"".concat(le.normal),{"#include ":` +`)},_domwindow:function(){return g("domwindow")},_bigint:function(m){return g("bigint:"+m.toString())},_process:function(){return g("process")},_timer:function(){return g("timer")},_pipe:function(){return g("pipe")},_tcp:function(){return g("tcp")},_udp:function(){return g("udp")},_tty:function(){return g("tty")},_statwatcher:function(){return g("statwatcher")},_securecontext:function(){return g("securecontext")},_connection:function(){return g("connection")},_zlib:function(){return g("zlib")},_context:function(){return g("context")},_nodescript:function(){return g("nodescript")},_httpparser:function(){return g("httpparser")},_dataview:function(){return g("dataview")},_signal:function(){return g("signal")},_fsevent:function(){return g("fsevent")},_tlswrap:function(){return g("tlswrap")}}}function P(){return{buf:"",write:function(h){this.buf+=h},end:function(h){this.buf+=h},read:function(){return this.buf}}}i.writeToStream=function(h,M,y){return y===void 0&&(y=M,M={}),R(M=I(h,M),y).dispatch(h)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){(function(b){var x=typeof Uint8Array<"u"?Uint8Array:Array,v=43,T=47,I=48,A=97,R=65,P=45,h=95;function M(y){return y=y.charCodeAt(0),y===v||y===P?62:y===T||y===h?63:y>16),D((65280&m)>>8),D(255&m);return k==2?D(255&(m=M(y.charAt(g))<<2|M(y.charAt(g+1))>>4)):k==1&&(D((m=M(y.charAt(g))<<10|M(y.charAt(g+1))<<4|M(y.charAt(g+2))>>2)>>8&255),D(255&m)),_},b.fromByteArray=function(y){var g,m,k,_,F=y.length%3,j="";function D(z){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(z)}for(g=0,k=y.length-F;g>18&63)+D(_>>12&63)+D(_>>6&63)+D(63&_);switch(F){case 1:j=(j+=D((m=y[y.length-1])>>2))+D(m<<4&63)+"==";break;case 2:j=(j=(j+=D((m=(y[y.length-2]<<8)+y[y.length-1])>>10))+D(m>>4&63))+D(m<<2&63)+"="}return j}})(i===void 0?this.base64js={}:i)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,i){(function(o,s,v,l,u,c,f,p,d){var b=n("base64-js"),x=n("ieee754");function v(w,S,N){if(!(this instanceof v))return new v(w,S,N);var V,B,Y,ne,xe=typeof w;if(S==="base64"&&xe=="string")for(w=(ne=w).trim?ne.trim():ne.replace(/^\s+|\s+$/g,"");w.length%4!=0;)w+="=";if(xe=="number")V=Z(w);else if(xe=="string")V=v.byteLength(w,S);else{if(xe!="object")throw new Error("First argument needs to be a number, array or string.");V=Z(w.length)}if(v._useTypedArrays?B=v._augment(new Uint8Array(V)):((B=this).length=V,B._isBuffer=!0),v._useTypedArrays&&typeof w.byteLength=="number")B._set(w);else if(K(ne=w)||v.isBuffer(ne)||ne&&typeof ne=="object"&&typeof ne.length=="number")for(Y=0;Y>8,ne=ne%256,xe.push(ne),xe.push(Y);return xe}(S),w,N,V)}function A(w,S,N){var V="";N=Math.min(w.length,N);for(var B=S;B>>0)):(S+1>>0),B}function h(w,S,N,V){if(V||(G(typeof N=="boolean","missing or invalid endian"),G(S!=null,"missing offset"),G(S+1>>8*(V?Y:1-Y)}function k(w,S,N,V,B){if(B||(G(S!=null,"missing value"),G(typeof V=="boolean","missing or invalid endian"),G(N!=null,"missing offset"),G(N+3>>8*(V?Y:3-Y)&255}function _(w,S,N,V,B){B||(G(S!=null,"missing value"),G(typeof V=="boolean","missing or invalid endian"),G(N!=null,"missing offset"),G(N+1this.length&&(V=this.length);var B=(V=w.length-S=this.length))return this[w]},v.prototype.readUInt16LE=function(w,S){return R(this,w,!0,S)},v.prototype.readUInt16BE=function(w,S){return R(this,w,!1,S)},v.prototype.readUInt32LE=function(w,S){return P(this,w,!0,S)},v.prototype.readUInt32BE=function(w,S){return P(this,w,!1,S)},v.prototype.readInt8=function(w,S){if(S||(G(w!=null,"missing offset"),G(w=this.length))return 128&this[w]?-1*(255-this[w]+1):this[w]},v.prototype.readInt16LE=function(w,S){return h(this,w,!0,S)},v.prototype.readInt16BE=function(w,S){return h(this,w,!1,S)},v.prototype.readInt32LE=function(w,S){return M(this,w,!0,S)},v.prototype.readInt32BE=function(w,S){return M(this,w,!1,S)},v.prototype.readFloatLE=function(w,S){return y(this,w,!0,S)},v.prototype.readFloatBE=function(w,S){return y(this,w,!1,S)},v.prototype.readDoubleLE=function(w,S){return g(this,w,!0,S)},v.prototype.readDoubleBE=function(w,S){return g(this,w,!1,S)},v.prototype.writeUInt8=function(w,S,N){N||(G(w!=null,"missing value"),G(S!=null,"missing offset"),G(S=this.length||(this[S]=w)},v.prototype.writeUInt16LE=function(w,S,N){m(this,w,S,!0,N)},v.prototype.writeUInt16BE=function(w,S,N){m(this,w,S,!1,N)},v.prototype.writeUInt32LE=function(w,S,N){k(this,w,S,!0,N)},v.prototype.writeUInt32BE=function(w,S,N){k(this,w,S,!1,N)},v.prototype.writeInt8=function(w,S,N){N||(G(w!=null,"missing value"),G(S!=null,"missing offset"),G(S=this.length||(0<=w?this.writeUInt8(w,S,N):this.writeUInt8(255+w+1,S,N))},v.prototype.writeInt16LE=function(w,S,N){_(this,w,S,!0,N)},v.prototype.writeInt16BE=function(w,S,N){_(this,w,S,!1,N)},v.prototype.writeInt32LE=function(w,S,N){F(this,w,S,!0,N)},v.prototype.writeInt32BE=function(w,S,N){F(this,w,S,!1,N)},v.prototype.writeFloatLE=function(w,S,N){j(this,w,S,!0,N)},v.prototype.writeFloatBE=function(w,S,N){j(this,w,S,!1,N)},v.prototype.writeDoubleLE=function(w,S,N){D(this,w,S,!0,N)},v.prototype.writeDoubleBE=function(w,S,N){D(this,w,S,!1,N)},v.prototype.fill=function(w,S,N){if(S=S||0,N=N||this.length,G(typeof(w=typeof(w=w||0)=="string"?w.charCodeAt(0):w)=="number"&&!isNaN(w),"value is not a number"),G(S<=N,"end < start"),N!==S&&this.length!==0){G(0<=S&&S"},v.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(v._useTypedArrays)return new v(this).buffer;for(var w=new Uint8Array(this.length),S=0,N=w.length;S=S.length||B>=w.length);B++)S[B+N]=w[B];return B}function ge(w){try{return decodeURIComponent(w)}catch{return"�"}}function ke(w,S){G(typeof w=="number","cannot write a non-number as a number"),G(0<=w,"specified a negative value for writing an unsigned value"),G(w<=S,"value is larger than maximum value for type"),G(Math.floor(w)===w,"value has a fractional component")}function ye(w,S,N){G(typeof w=="number","cannot write a non-number as a number"),G(w<=S,"value larger than maximum allowed value"),G(N<=w,"value smaller than minimum allowed value"),G(Math.floor(w)===w,"value has a fractional component")}function De(w,S,N){G(typeof w=="number","cannot write a non-number as a number"),G(w<=S,"value larger than maximum allowed value"),G(N<=w,"value smaller than minimum allowed value")}function G(w,S){if(!w)throw new Error(S||"Failed assertion")}v._augment=function(w){return w._isBuffer=!0,w._get=w.get,w._set=w.set,w.get=z.get,w.set=z.set,w.write=z.write,w.toString=z.toString,w.toLocaleString=z.toString,w.toJSON=z.toJSON,w.copy=z.copy,w.slice=z.slice,w.readUInt8=z.readUInt8,w.readUInt16LE=z.readUInt16LE,w.readUInt16BE=z.readUInt16BE,w.readUInt32LE=z.readUInt32LE,w.readUInt32BE=z.readUInt32BE,w.readInt8=z.readInt8,w.readInt16LE=z.readInt16LE,w.readInt16BE=z.readInt16BE,w.readInt32LE=z.readInt32LE,w.readInt32BE=z.readInt32BE,w.readFloatLE=z.readFloatLE,w.readFloatBE=z.readFloatBE,w.readDoubleLE=z.readDoubleLE,w.readDoubleBE=z.readDoubleBE,w.writeUInt8=z.writeUInt8,w.writeUInt16LE=z.writeUInt16LE,w.writeUInt16BE=z.writeUInt16BE,w.writeUInt32LE=z.writeUInt32LE,w.writeUInt32BE=z.writeUInt32BE,w.writeInt8=z.writeInt8,w.writeInt16LE=z.writeInt16LE,w.writeInt16BE=z.writeInt16BE,w.writeInt32LE=z.writeInt32LE,w.writeInt32BE=z.writeInt32BE,w.writeFloatLE=z.writeFloatLE,w.writeFloatBE=z.writeFloatBE,w.writeDoubleLE=z.writeDoubleLE,w.writeDoubleBE=z.writeDoubleBE,w.fill=z.fill,w.inspect=z.inspect,w.toArrayBuffer=z.toArrayBuffer,w}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,i){(function(o,s,b,l,u,c,f,p,d){var b=n("buffer").Buffer,x=4,v=new b(x);v.fill(0),r.exports={hash:function(T,I,A,R){for(var P=I(function(m,k){m.length%x!=0&&(_=m.length+(x-m.length%x),m=b.concat([m,v],_));for(var _,F=[],j=k?m.readInt32BE:m.readInt32LE,D=0;DA?Q=z(Q):Q.length>5]|=128<>>9<<4)]=M;for(var y=1732584193,g=-271733879,m=-1732584194,k=271733878,_=0;_>>32-m,y)}function T(h,M,y,g,m,k,_){return v(M&y|~M&g,h,M,m,k,_)}function I(h,M,y,g,m,k,_){return v(M&g|y&~g,h,M,m,k,_)}function A(h,M,y,g,m,k,_){return v(M^y^g,h,M,m,k,_)}function R(h,M,y,g,m,k,_){return v(y^(M|~g),h,M,m,k,_)}function P(h,M){var y=(65535&h)+(65535&M);return(h>>16)+(M>>16)+(y>>16)<<16|65535&y}r.exports=function(h){return b.hash(h,x,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){r.exports=function(b){for(var x,v=new Array(b),T=0;T>>((3&T)<<3)&255;return v}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){var b=n("./helpers");function x(I,A){I[A>>5]|=128<<24-A%32,I[15+(A+64>>9<<4)]=A;for(var R,P,h,M=Array(80),y=1732584193,g=-271733879,m=-1732584194,k=271733878,_=-1009589776,F=0;F>16)+(A>>16)+(R>>16)<<16|65535&R}function T(I,A){return I<>>32-A}r.exports=function(I){return b.hash(I,x,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){function b(A,R){var P=(65535&A)+(65535&R);return(A>>16)+(R>>16)+(P>>16)<<16|65535&P}function x(A,R){var P,h=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),M=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),y=new Array(64);A[R>>5]|=128<<24-R%32,A[15+(R+64>>9<<4)]=R;for(var g,m,k=0;k>>R|A<<32-R},I=function(A,R){return A>>>R};r.exports=function(A){return v.hash(A,x,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){i.read=function(b,x,v,T,k){var A,R,P=8*k-T-1,h=(1<>1,y=-7,g=v?k-1:0,m=v?-1:1,k=b[x+g];for(g+=m,A=k&(1<<-y)-1,k>>=-y,y+=P;0>=-y,y+=T;0>1,g=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=T?0:_-1,k=T?1:-1,_=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,R=M):(R=Math.floor(Math.log(x)/Math.LN2),x*(T=Math.pow(2,-R))<1&&(R--,T*=2),2<=(x+=1<=R+y?g/T:g*Math.pow(2,1-y))*T&&(R++,T/=2),M<=R+y?(P=0,R=M):1<=R+y?(P=(x*T-1)*Math.pow(2,I),R+=y):(P=x*Math.pow(2,y-1)*Math.pow(2,I),R=0));8<=I;b[v+m]=255&P,m+=k,P/=256,I-=8);for(R=R<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),to}var ro,io;function zs(){return io||(io=1,ro=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),ro}var hr,oo;function Fc(){if(oo)return hr;oo=1;var t=Fs();return hr=t.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),hr}var mr,so;function zc(){if(so)return mr;so=1;var t=zs();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),mr=t.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),mr}var gr,ao;function Bc(){if(ao)return gr;ao=1,gr=R;var t=Fs(),e=Dc(),n=zs(),r=Fc(),i=zc(),o=999,s=9999,a=0,l=1,u=2,c=3,f=4,p=5,d=6,b=7,x=8,v=9,T=10,I=11,A=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function R(P){var h=0,M=0,y=o,g,m,k=[],_=[],F=1,j=0,D=0,z=!1,Q=!1,Z="",K;P=P||{};var E=n,te=t;P.version==="300 es"&&(E=i,te=r);for(var me={},C={},h=0;h0)continue;we=fe.slice(0,1).join("")}return ge(we),D+=we.length,k=k.slice(we.length),k.length}while(!0)}function Y(){return/[^a-fA-F0-9]/.test(g)?(ge(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function ne(){return g==="."||/[eE]/.test(g)?(k.push(g),y=p,m=g,h+1):g==="x"&&k.length===1&&k[0]==="0"?(y=I,k.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function xe(){return g==="f"&&(k.push(g),m=g,h+=1),/[eE]/.test(g)||(g==="-"||g==="+")&&/[eE]/.test(m)?(k.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function Ae(){if(/[^\d\w_]/.test(g)){var fe=k.join("");return C[fe]?y=x:me[fe]?y=b:y=d,ge(k.join("")),y=o,h}return k.push(g),m=g,h+1}}return gr}var yr,lo;function Uc(){if(lo)return yr;lo=1;var t=Bc();yr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return yr}Uc();function jc(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vc(t){var e=jc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=Vc(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},Ge,Ut;Ge={},Se(Ge,"".concat(le.normal),{"#include ":` vec3 objectNormal = `.concat(le.normal,`; #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); #endif - `)}),Se($e,"".concat(le.position),{"#include ":` + `)}),Se(Ge,"".concat(le.position),{"#include ":` vec3 transformed = `.concat(le.position,`; - `)}),Se($e,"".concat(le.positionRaw),{"#include ":` + `)}),Se(Ge,"".concat(le.positionRaw),{"#include ":` vec4 csm_internal_positionUnprojected = `.concat(le.positionRaw,`; mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix; #ifdef USE_INSTANCING @@ -446,47 +446,47 @@ list should be an Array.`),b.length===0)return new v(0);if(b.length===1)return b #endif csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected; vec3 transformed = csm_internal_positionUnprojected.xyz; - `)}),Se($e,"".concat(le.pointSize),{"gl_PointSize = size;":` + `)}),Se(Ge,"".concat(le.pointSize),{"gl_PointSize = size;":` gl_PointSize = `.concat(le.pointSize,`; - `)}),Se($e,"".concat(le.diffuseColor),{"#include ":` + `)}),Se(Ge,"".concat(le.diffuseColor),{"#include ":` #include diffuseColor = `.concat(le.diffuseColor,`; - `)}),Se($e,"".concat(le.fragColor),{"#include ":` + `)}),Se(Ge,"".concat(le.fragColor),{"#include ":` #include gl_FragColor = `.concat(le.fragColor,`; - `)}),Se($e,"".concat(le.emissive),{"vec3 totalEmissiveRadiance = emissive;":` + `)}),Se(Ge,"".concat(le.emissive),{"vec3 totalEmissiveRadiance = emissive;":` vec3 totalEmissiveRadiance = `.concat(le.emissive,`; - `)}),Se($e,"".concat(le.roughness),{"#include ":` + `)}),Se(Ge,"".concat(le.roughness),{"#include ":` #include roughnessFactor = `.concat(le.roughness,`; - `)}),Se($e,"".concat(le.metalness),{"#include ":` + `)}),Se(Ge,"".concat(le.metalness),{"#include ":` #include metalnessFactor = `.concat(le.metalness,`; - `)}),Se($e,"".concat(le.ao),{"#include ":` + `)}),Se(Ge,"".concat(le.ao),{"#include ":` #include reflectedLight.indirectDiffuse *= 1. - `.concat(le.ao,`; - `)}),Se($e,"".concat(le.bump),{"#include ":` + `)}),Se(Ge,"".concat(le.bump),{"#include ":` #include vec3 csm_internal_orthogonal = `.concat(le.bump," - (dot(").concat(le.bump,`, normal) * normal); vec3 csm_internal_projectedbump = mat3(csm_internal_vModelViewMatrix) * csm_internal_orthogonal; normal = normalize(normal - csm_internal_projectedbump); - `)}),Se($e,"".concat(le.depthAlpha),{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":` + `)}),Se(Ge,"".concat(le.depthAlpha),{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":` gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity * `.concat(le.depthAlpha,` ); `),"gl_FragColor = packDepthToRGBA( fragCoordZ );":` gl_FragColor = packDepthToRGBA( fragCoordZ ); gl_FragColor.a *= `.concat(le.depthAlpha,`; - `)});Bt={},Se(Bt,"".concat(le.position),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` + `)});Ut={},Se(Ut,"".concat(le.position),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` gl_Position = projectionMatrix * modelViewMatrix * vec4( `.concat(le.position,`, 1.0 ); - `)}),Se(Bt,"".concat(le.positionRaw),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` + `)}),Se(Ut,"".concat(le.positionRaw),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` gl_Position = `.concat(le.position,`; - `)}),Se(Bt,"".concat(le.diffuseColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` + `)}),Se(Ut,"".concat(le.diffuseColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` gl_FragColor = `.concat(le.diffuseColor,`; - `)}),Se(Bt,"".concat(le.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` + `)}),Se(Ut,"".concat(le.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` gl_FragColor = `.concat(le.fragColor,`; - `)});var Ge;Ge={},Se(Ge,"".concat(le.position),"*"),Se(Ge,"".concat(le.positionRaw),"*"),Se(Ge,"".concat(le.normal),"*"),Se(Ge,"".concat(le.pointSize),["PointsMaterial"]),Se(Ge,"".concat(le.diffuseColor),"*"),Se(Ge,"".concat(le.fragColor),"*"),Se(Ge,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se(Ge,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se(Ge,"".concat(le.depthAlpha),"*");var Hc=`void main() { + `)});var $e;$e={},Se($e,"".concat(le.position),"*"),Se($e,"".concat(le.positionRaw),"*"),Se($e,"".concat(le.normal),"*"),Se($e,"".concat(le.pointSize),["PointsMaterial"]),Se($e,"".concat(le.diffuseColor),"*"),Se($e,"".concat(le.fragColor),"*"),Se($e,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se($e,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se($e,"".concat(le.depthAlpha),"*");var Hc=`void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -}`,$c=`#include +}`,Gc=`#include void main() { vec2 center = vec2(0., 1.); @@ -511,7 +511,7 @@ void main() { mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; -}`;const xn=new se(0,0,0),gi=new se(0,0,0),Gc=new se(0,0,0);function uo(t,e,n){const r=xn.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o,r.z]}function qc(t,e){const n=xn.setFromMatrixPosition(t.matrixWorld),r=gi.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(Gc);return i.angleTo(o)>Math.PI/2}function Yc(t,e,n,r){const i=xn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Pe(o.x,o.y),e);const s=n.intersectObjects(r,!0);if(s.length>0){const a=s[0].distance;return i.distanceTo(n.ray.origin)Math.abs(t)<1e-10?0:t;function Bs(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Ur(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const Xc=(t=>e=>Bs(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Qc=(t=>(e,n)=>Bs(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]),Zc=["geometry","material"];new os;var jr={exports:{}},Jc=jr.exports,co;function ef(){return co||(co=1,function(t,e){(function(n,r){t.exports=r()})(Jc,function(){var n=function(){function r(d){return s.appendChild(d.dom),d}function i(d){for(var g=0;gl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var g=performance.memory;p.update(g.usedJSHeapSize/1048576,g.jsHeapSizeLimit/1048576)}return d},update:function(){a=this.end()},domElement:s,setMode:i}};return n.Panel=function(r,i,o){var s=1/0,a=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,f=48*u,p=3*u,d=2*u,g=3*u,k=15*u,v=74*u,w=30*u,I=document.createElement("canvas");I.width=c,I.height=f,I.style.cssText="width:80px;height:48px";var E=I.getContext("2d");return E.font="bold "+9*u+"px Helvetica,Arial,sans-serif",E.textBaseline="top",E.fillStyle=o,E.fillRect(0,0,c,f),E.fillStyle=i,E.fillText(r,p,d),E.fillRect(g,k,v,w),E.fillStyle=o,E.globalAlpha=.9,E.fillRect(g,k,v,w),{dom:I,update:function(R,P){s=Math.min(s,R),a=Math.max(a,R),E.fillStyle=o,E.globalAlpha=1,E.fillRect(0,0,c,k),E.fillStyle=i,E.fillText(l(R)+" "+r+" ("+l(s)+"-"+l(a)+")",p,d),E.drawImage(I,g+u,k,v-u,w,g,k,v-u,w),E.fillRect(g+v-u,k,u,w),E.fillStyle=o,E.globalAlpha=.9,E.fillRect(g+v-u,k,u,l((1-R/P)*w))}}},n})}(jr)),jr.exports}ef();const tf={key:0,args:[0,1,64]},nf={key:1,args:[.5,1,64]},rf={key:2},of=["tone-mapped","map","side","color"];new ze(16777215);const Ut=Fe({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","mousedown"],setup(t,{emit:e}){const n=t,r=e,i=W(null);function o(g,k,v){return Math.min(Math.max(g,k),v)}function s(g){const k=g.toString();return k.includes("e-")?Number.parseInt(k.split("e-")[1],10):k.includes(".")?k.split(".")[1].length:0}function a(g,k){const v=s(k),w=10**(v+3);return Number.parseFloat((g*w/w).toFixed(v))}const l=Ue(()=>a(o(n.modelValue,n.min,n.max),n.step)),u=Ue(()=>{const g=(l.value-n.min)/(n.max-n.min)*100;return{width:`${g}%`,backgroundSize:`${g}% 100%`}});function c(g){if(!i.value)return l.value;const k=i.value.getBoundingClientRect(),w=(g.clientX-k.left)/k.width,I=n.max-n.min,E=n.min+I*w,R=Math.round(E/n.step)*n.step;return Math.min(Math.max(R,n.min),n.max)}function f(g){if(n.disabled)return;const k=c(g);r("update:modelValue",k)}function p(g){if(n.disabled)return;g.preventDefault();const k=c(g);r("update:modelValue",k),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(g){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Dt(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(g,k)=>(ee(),ie("span",{ref_key:"sliderRef",ref:i,class:Ct(["range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50",{disabled:t.disabled}]),bg:"[#e6e1fc] dark:[#676085]","touch-action-none":"",relative:"","inline-block":"","w-full":"","cursor-ew-resize":"","rounded-sm":"",onMousedown:p},[O("span",{style:Dr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),O("span",{role:"slider",class:"slider-thumb",style:Dr({left:`${(l.value-t.min)/(t.max-t.min)*100}%`}),absolute:"","rounded-sm":"",w:"[1px]",h:"[14px]",bg:"zinc-100 dark:zinc-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function fo(t,e){if(e===dl)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Fr||e===ds){let n=t.getIndex();if(n===null){const s=[],a=t.getAttribute("position");if(a!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new Bf(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&a[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}u.setExtensions(s),u.setPlugins(a),u.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function af(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const de={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class lf{constructor(e){this.parser=e,this.name=de.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,s)}}class Tf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const s=o.extensions[n],a=i.images[s.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class kf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const s=o.extensions[n],a=i.images[s.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class Af{constructor(e){this.name=de.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(a){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,p=new Uint8Array(a,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(c*f);return s.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class _f{constructor(e){this.name=de.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==tt.TRIANGLES&&u.mode!==tt.TRIANGLE_STRIP&&u.mode!==tt.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,a=[],l={};for(const u in s)a.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const g of f){const k=new yt,v=new se,w=new Fn,I=new se(1,1,1),E=new yl(g.geometry,g.material,p);for(let R=0;R0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const zf=new yt;class Bf{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new af,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,s=-1;if(typeof navigator<"u"){const a=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=a.indexOf("Firefox")>-1,s=o?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&s<98?this.textureLoader=new vl(this.options.manager):this.textureLoader=new bl(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ps(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const a={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return It(o,a,i),mt(a,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(s);l!=null&&this.associations.set(a,l);for(const[u,c]of s.children.entries())o(c,a.children[u])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(y,h[M*l+1]),l>=3&&v.setZ(y,h[M*l+2]),l>=4&&v.setW(y,h[M*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=g}return v})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,s=n.images[o];let a=this.textureLoader;if(s.uri){const l=r.manager.getHandler(s.uri);l!==null&&(a=l)}return this.loadTextureImage(e,o,a)}loadTextureImage(e,n,r){const i=this,o=this.json,s=o.textures[e],a=o.images[n],l=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=s.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const p=(o.samplers||{})[s.sampler]||{};return c.magFilter=ho[p.magFilter]||Bn,c.minFilter=ho[p.minFilter]||li,c.wrapS=mo[p.wrapS]||Un,c.wrapT=mo[p.wrapT]||Un,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==Bn,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const s=i.images[e],a=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=r.getDependency("bufferView",s.bufferView).then(function(f){u=!0;const p=new Blob([f],{type:s.mimeType});return l=a.createObjectURL(p),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(p,d){let g=p;n.isImageBitmapLoader===!0&&(g=function(k){const v=new zn(k);v.needsUpdate=!0,p(v)}),n.load(ln.resolveURL(f,o.path),g,void 0,d)})}).then(function(f){return u===!0&&a.revokeObjectURL(l),mt(f,s),f.userData.mimeType=s.mimeType||Ff(s.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),o.extensions[de.KHR_TEXTURE_TRANSFORM]){const a=r.extensions!==void 0?r.extensions[de.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=o.associations.get(s);s=o.extensions[de.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),o.associations.set(s,l)}}return i!==void 0&&(s.colorSpace=i),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new wl,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(a,l)),r=l}else if(e.isLine){const a="LineBasicMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new Tl,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(a,l)),r=l}if(i||o||s){let a="ClonedMaterial:"+r.uuid+":";i&&(a+="derivative-tangents:"),o&&(a+="vertex-colors:"),s&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=r.clone(),o&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return hs}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let s;const a={},l=o.extensions||{},u=[];if(l[de.KHR_MATERIALS_UNLIT]){const f=i[de.KHR_MATERIALS_UNLIT];s=f.getMaterialType(),u.push(f.extendParams(a,o,n))}else{const f=o.pbrMetallicRoughness||{};if(a.color=new ze(1,1,1),a.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;a.color.setRGB(p[0],p[1],p[2],xt),a.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(a,"map",f.baseColorTexture,hn)),a.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,a.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(a,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(a,"roughnessMap",f.metallicRoughnessTexture))),s=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}o.doubleSided===!0&&(a.side=Yn);const c=o.alphaMode||xr.OPAQUE;if(c===xr.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===xr.MASK&&(a.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==Vt&&(u.push(n.assignTexture(a,"normalMap",o.normalTexture)),a.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;a.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&s!==Vt&&(u.push(n.assignTexture(a,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==Vt){const f=o.emissiveFactor;a.emissive=new ze().setRGB(f[0],f[1],f[2],xt)}return o.emissiveTexture!==void 0&&s!==Vt&&u.push(n.assignTexture(a,"emissiveMap",o.emissiveTexture,hn)),Promise.all(u).then(function(){const f=new s(a);return o.name&&(f.name=o.name),mt(f,o),n.associations.set(f,{materials:e}),o.extensions&&It(i,f,o),f})}createUniqueName(e){const n=pn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(a){return r[de.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,n).then(function(l){return go(l,a,n)})}const s=[];for(let a=0,l=e.length;a0&&Of(w,o),w.name=n.createUniqueName(o.name||"mesh_"+e),mt(w,o),v.extensions&&It(i,w,v),n.assignFinalMaterial(w),f.push(w)}for(let d=0,g=f.length;d1?c=new rr:u.length===1?c=u[0]:c=new ui,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof nr||p instanceof zn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const s=[],a=e.name?e.name:e.uuid,l=[];wt[o.path]===wt.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(a);let u;switch(wt[o.path]){case wt.weights:u=Oi;break;case wt.rotation:u=Di;break;case wt.position:case wt.scale:u=Pi;break;default:switch(r.itemSize){case 1:u=Oi;break;case 2:case 3:default:u=Pi;break}break}const c=i.interpolation!==void 0?Nf[i.interpolation]:ii,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew Ra(t)),Rt.register(t=>new Ca(t)),Rt)}async function jf(t){const r=(await Vs().loadAsync(t)).userData;if(!r.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(r.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return r.vrmAnimations[0]}async function Vf(t,e){if(!t){console.warn("No VRM found");return}if(e)return Na(e,t)}function Hf(){const t=W(!1),e=W(0),n=W(0),r=.2,i=1,o=6,s=W(Math.random()*(o-i)+i);function a(l,u){if(l!=null&&l.expressionManager&&(n.value+=u,!t.value&&n.value>=s.value&&(t.value=!0,e.value=0),t.value)){e.value+=u/r;const c=Math.sin(Math.PI*e.value);l.expressionManager.setValue("blink",c),e.value>=1&&(t.value=!1,n.value=0,l.expressionManager.setValue("blink",0),s.value=Math.random()*(o-i)+i)}}return{update:a}}function $f(){let t=-1,e,n=0;function r(){e?e.set(nn(-.25,.25),nn(-.2,.15),-.65):e=new se(nn(-.25,.25),nn(-.2,.15),-.65)}function i(o,s){var a;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=La()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new ui),o.lookAt.target.position.lerp(e,nn(.2,.5)),(a=o.lookAt)==null||a.update(s),n+=s)}return{update:i}}async function Gf(t,e){const i=(await Vs().loadAsync(t,s=>{var a;return(a=e==null?void 0:e.onProgress)==null?void 0:a.call(e,s)})).userData;if(!i.vrm)return;const o=i.vrm;if(Lr.removeUnnecessaryVertices(o.scene),Lr.combineSkeletons(o.scene),o.scene.traverse(s=>{s.frustumCulled=!1}),o.lookAt){const s=new Pa(o.lookAt);s.name="lookAtQuaternionProxy",o.scene.add(s)}return e!=null&&e.scene&&e.scene.add(o.scene),e!=null&&e.position&&o.scene.position.set(...e.position),o}function qf(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),s=W(),a=(w,I,E)=>w+(I-w)*E,l=w=>w<.5?4*w*w*w:1-(-2*w+2)**3/2,u=new Map([["happy",{expression:[{name:"happy",value:1,duration:.3},{name:"aa",value:.3}],blendDuration:.3}],["sad",{expression:[{name:"sad",value:1},{name:"oh",value:.2}],blendDuration:.3}],["angry",{expression:[{name:"angry",value:1},{name:"ee",value:.4}],blendDuration:.2}],["surprised",{expression:[{name:"Surprised",value:1},{name:"oh",value:.6}],blendDuration:.1}],["neutral",{expression:[{name:"neutral",value:1}],blendDuration:.5}]]),c=()=>{s.value&&(clearTimeout(s.value),s.value=void 0)},f=w=>{var E;if(c(),!u.has(w)){console.warn(`Emotion ${w} not found`);return}const I=u.get(w);if(e.value=w,n.value=!0,r.value=0,t.expressionManager){const R=Object.keys(t.expressionManager.expressionMap);for(const P of R)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const R of I.expression||[]){const P=((E=t.expressionManager)==null?void 0:E.getValue(R.name))||0;i.value.set(R.name,P),o.value.set(R.name,R.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(w,I)=>{c(),f(w),s.value=setTimeout(()=>{f("neutral"),s.value=void 0},I)},update:w=>{var R;if(!n.value||!e.value)return;const E=u.get(e.value).blendDuration||.3;r.value+=w/E,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const M=i.value.get(P)||0,x=a(M,h,l(r.value));(R=t.expressionManager)==null||R.setValue(P,x)}},addEmotionState:(w,I)=>{u.set(w,I)},removeEmotionState:w=>{u.delete(w)},dispose:()=>{c()}}}const Yf=Fe({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const s=W(),a=W(),{scene:l}=qn(),{onBeforeRender:u}=Dn(),c=Hf(),f=$f(),p=W();je(()=>r.position,([k,v,w])=>{s.value&&s.value.scene.position.set(k,v,w)}),fn(async()=>{if(l.value)try{const k=await Gf(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:I=>i("loadModelProgress",Number.parseFloat((100*(I.loaded/I.total)).toFixed(2)))});if(!k){console.warn("No VRM model loaded");return}const v=await jf(r.idleAnimation),w=await Vf(k,v);if(!w){console.warn("No VRM animation loaded");return}a.value=new Ll(k.scene),a.value.clipAction(w).play(),p.value=qf(k),s.value=k,o=u(({delta:I})=>{var E,R,P;(E=a.value)==null||E.update(I),(R=s.value)==null||R.update(I),c.update(s.value,I),f.update(s.value,I),(P=p.value)==null||P.update(I)}).off}catch(k){i("error",k)}}),Dt(()=>{o==null||o(),s.value&&(s.value.scene.removeFromParent(),Lr.deepDispose(s.value.scene))}),e({setExpression(k){var v;(v=p.value)==null||v.setEmotionWithResetAfter(k,1e3)}});const{pause:d,resume:g}=Dn();return je(()=>r.paused,k=>{k?d():g()}),(k,v)=>mn(k.$slots,"default")}}),Kf=["position"],Wf={absolute:"",bottom:"3",right:"3"},Xf={flex:"~ row","cursor-pointer":""},Qf=["checked","aria-checked"],Zf={key:0,"min-w":"50vw",z:"{var g;(g=p.value)==null||g.setExpression(d)}}),(d,g)=>(ee(),Wt(ws,{relative:""},{default:Be(({height:k,width:v})=>[Te(X(Pl),{alpha:!0,antialias:!0,width:v,height:k},{default:Be(()=>[Te(X(Pc)),O("TresPerspectiveCamera",{position:[s.value,a.value,l.value]},null,8,Kf),g[14]||(g[14]=O("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),g[15]||(g[15]=O("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),Te(Yf,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:g[0]||(g[0]=w=>i("loadModelProgress",w)),onError:g[1]||(g[1]=w=>i("error",w))},null,8,["model","idle-animation","position","paused"])]),_:2},1032,["width","height"]),O("div",Wf,[O("div",Xf,[O("label",{class:Ct([o.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(O("input",{"onUpdate:modelValue":g[2]||(g[2]=w=>o.value=w),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,Qf),[[ni,o.value]]),g[16]||(g[16]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(pi,null,{default:Be(()=>[o.value?(ee(),ie("div",Zf,[O("div",Jf,[O("div",ed,[O("span",null,he(d.$t("stage.viewers.debug-menu.vrm.model.title")),1)]),Te(zi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Be(()=>[O("span",td,he(d.$t("stage.viewers.debug-menu.vrm.camera")),1)]),default:Be(()=>[O("div",nd,[g[17]||(g[17]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"X")],-1)),O("label",rd,[Te(Ut,{modelValue:s.value,"onUpdate:modelValue":g[3]||(g[3]=w=>s.value=w),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",id,[O("span",null,he(s.value),1)]),g[18]||(g[18]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"Y")],-1)),O("label",od,[Te(Ut,{modelValue:a.value,"onUpdate:modelValue":g[4]||(g[4]=w=>a.value=w),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",sd,[O("span",null,he(a.value),1)]),g[19]||(g[19]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"Z")],-1)),O("label",ad,[Te(Ut,{modelValue:l.value,"onUpdate:modelValue":g[5]||(g[5]=w=>l.value=w),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",ld,[O("span",null,he(l.value),1)])])]),_:1}),Te(zi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Be(()=>[O("span",ud,he(d.$t("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Be(()=>[O("div",cd,[g[20]||(g[20]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"X")],-1)),O("label",fd,[Te(Ut,{modelValue:u.value,"onUpdate:modelValue":g[6]||(g[6]=w=>u.value=w),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",dd,[O("span",null,he(u.value),1)]),g[21]||(g[21]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"Y")],-1)),O("label",pd,[Te(Ut,{modelValue:c.value,"onUpdate:modelValue":g[7]||(g[7]=w=>c.value=w),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",hd,[O("span",null,he(c.value),1)]),g[22]||(g[22]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"Z")],-1)),O("label",md,[Te(Ut,{modelValue:f.value,"onUpdate:modelValue":g[8]||(g[8]=w=>f.value=w),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",gd,[O("span",null,he(f.value),1)])])]),_:1}),O("div",yd,[O("span",null,he(d.$t("stage.viewers.debug-menu.emotions")),1)]),O("div",xd,[O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[9]||(g[9]=w=>{var I;return(I=p.value)==null?void 0:I.setExpression("neutral")})},he(d.$t("stage.viewers.debug-menu.emotions-btn.neutral")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[10]||(g[10]=w=>{var I;return(I=p.value)==null?void 0:I.setExpression("surprised")})},he(d.$t("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[11]||(g[11]=w=>{var I;return(I=p.value)==null?void 0:I.setExpression("sad")})},he(d.$t("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[12]||(g[12]=w=>{var I;return(I=p.value)==null?void 0:I.setExpression("angry")})},he(d.$t("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:g[13]||(g[13]=w=>{var I;return(I=p.value)==null?void 0:I.setExpression("happy")})},he(d.$t("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):it("",!0)]),_:1})])]),_:1}))}}),bd=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class vn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}vn.prototype.normal={};vn.prototype.property={};vn.prototype.space=void 0;function Hs(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new vn(n,r,e)}function $r(t){return t.toLowerCase()}class Ke{constructor(e,n){this.attribute=n,this.property=e}}Ke.prototype.attribute="";Ke.prototype.booleanish=!1;Ke.prototype.boolean=!1;Ke.prototype.commaOrSpaceSeparated=!1;Ke.prototype.commaSeparated=!1;Ke.prototype.defined=!1;Ke.prototype.mustUseProperty=!1;Ke.prototype.number=!1;Ke.prototype.overloadedBoolean=!1;Ke.prototype.property="";Ke.prototype.spaceSeparated=!1;Ke.prototype.space=void 0;let wd=0;const ce=Ft(),Le=Ft(),$s=Ft(),$=Ft(),Re=Ft(),qt=Ft(),Qe=Ft();function Ft(){return 2**++wd}const Gr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Qe,commaSeparated:qt,number:$,overloadedBoolean:$s,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),br=Object.keys(Gr);class yi extends Ke{constructor(e,n,r,i){let o=-1;if(super(e,n),yo(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&_d.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(xo,Sd);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!xo.test(o)){let s=o.replace(Ad,Md);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=yi}return new i(r,e)}function Md(t){return"-"+t.toLowerCase()}function Sd(t){return t.charAt(1).toUpperCase()}const Id=Hs([Gs,Td,Ks,Ws,Xs],"html"),Qs=Hs([Gs,kd,Ks,Ws,Xs],"svg"),vo={}.hasOwnProperty;function Rd(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&vo.call(i,t)){const l=String(i[t]);s=vo.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Cd=/["&'<>`]/g,Nd=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ld=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Pd=/[|\\{}()[\]^$+*?.]/g,bo=new WeakMap;function Od(t,e){if(t=t.replace(e.subset?Dd(e.subset):Cd,r),e.subset||e.escapeOnly)return t;return t.replace(Nd,n).replace(Ld,r);function n(i,o,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),e)}function r(i,o,s){return e.format(i.charCodeAt(0),s.charCodeAt(o+1),e)}}function Dd(t){let e=bo.get(t);return e||(e=Fd(t),bo.set(t,e)),e}function Fd(t){const e=[];let n=-1;for(;++n",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:"€"},Hd=["cent","copy","divide","gt","lt","not","para","times"],Zs={}.hasOwnProperty,qr={};let Sn;for(Sn in wr)Zs.call(wr,Sn)&&(qr[wr[Sn]]=Sn);const $d=/[^\dA-Za-z]/;function Gd(t,e,n,r){const i=String.fromCharCode(t);if(Zs.call(qr,i)){const o=qr[i],s="&"+o;return n&&Vd.includes(o)&&!Hd.includes(o)&&(!r||e&&e!==61&&$d.test(String.fromCharCode(e)))?s:s+";"}return""}function qd(t,e,n){let r=Bd(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Gd(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=jd(t,e,n.omitOptionalSemicolons);o.length|^->||--!>|"],Wd=["<",">"];function Xd(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return Yt(o,Object.assign({},r.settings.characterReferences,{subset:Wd}))}}function Qd(t,e,n,r){return""}function wo(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function Zd(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Jd(t){return t.join(" ").trim()}const ep=/[ \t\n\f\r]/g;function xi(t){return typeof t=="object"?t.type==="text"?To(t.value):!1:To(t)}function To(t){return t.replace(ep,"")===""}const Oe=ea(1),Js=ea(-1),tp=[];function ea(t){return e;function e(n,r,i){const o=n?n.children:tp;let s=(r||0)+t,a=o[s];if(!i)for(;a&&xi(a);)s+=t,a=o[s];return a}}const np={}.hasOwnProperty;function ta(t){return e;function e(n,r,i){return np.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const vi=ta({body:ip,caption:Tr,colgroup:Tr,dd:lp,dt:ap,head:Tr,html:rp,li:sp,optgroup:up,option:cp,p:op,rp:ko,rt:ko,tbody:dp,td:Ao,tfoot:pp,th:Ao,thead:fp,tr:hp});function Tr(t,e,n){const r=Oe(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&xi(r.value.charAt(0)))}function rp(t,e,n){const r=Oe(n,e);return!r||r.type!=="comment"}function ip(t,e,n){const r=Oe(n,e);return!r||r.type!=="comment"}function op(t,e,n){const r=Oe(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function sp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&r.tagName==="li"}function ap(t,e,n){const r=Oe(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function lp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function ko(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function up(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function cp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function fp(t,e,n){const r=Oe(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function dp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function pp(t,e,n){return!Oe(n,e)}function hp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Ao(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const mp=ta({body:xp,colgroup:vp,head:yp,html:gp,tbody:bp});function gp(t){const e=Oe(t,-1);return!e||e.type!=="comment"}function yp(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function xp(t){const e=Oe(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&xi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function vp(t,e,n){const r=Js(n,e),i=Oe(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&vi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function bp(t,e,n){const r=Js(n,e),i=Oe(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&vi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const In={name:[[` +}`;const vn=new se(0,0,0),gi=new se(0,0,0),$c=new se(0,0,0);function uo(t,e,n){const r=vn.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o,r.z]}function qc(t,e){const n=vn.setFromMatrixPosition(t.matrixWorld),r=gi.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection($c);return i.angleTo(o)>Math.PI/2}function Yc(t,e,n,r){const i=vn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Pe(o.x,o.y),e);const s=n.intersectObjects(r,!0);if(s.length>0){const a=s[0].distance;return i.distanceTo(n.ray.origin)Math.abs(t)<1e-10?0:t;function Bs(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=jr(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const Xc=(t=>e=>Bs(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Qc=(t=>(e,n)=>Bs(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]),Zc=["geometry","material"];new os;var Vr={exports:{}},Jc=Vr.exports,co;function ef(){return co||(co=1,function(t,e){(function(n,r){t.exports=r()})(Jc,function(){var n=function(){function r(d){return s.appendChild(d.dom),d}function i(d){for(var b=0;bl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var b=performance.memory;p.update(b.usedJSHeapSize/1048576,b.jsHeapSizeLimit/1048576)}return d},update:function(){a=this.end()},domElement:s,setMode:i}};return n.Panel=function(r,i,o){var s=1/0,a=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,f=48*u,p=3*u,d=2*u,b=3*u,x=15*u,v=74*u,T=30*u,I=document.createElement("canvas");I.width=c,I.height=f,I.style.cssText="width:80px;height:48px";var A=I.getContext("2d");return A.font="bold "+9*u+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=o,A.fillRect(0,0,c,f),A.fillStyle=i,A.fillText(r,p,d),A.fillRect(b,x,v,T),A.fillStyle=o,A.globalAlpha=.9,A.fillRect(b,x,v,T),{dom:I,update:function(R,P){s=Math.min(s,R),a=Math.max(a,R),A.fillStyle=o,A.globalAlpha=1,A.fillRect(0,0,c,x),A.fillStyle=i,A.fillText(l(R)+" "+r+" ("+l(s)+"-"+l(a)+")",p,d),A.drawImage(I,b+u,x,v-u,T,b,x,v-u,T),A.fillRect(b+v-u,x,u,T),A.fillStyle=o,A.globalAlpha=.9,A.fillRect(b+v-u,x,u,l((1-R/P)*T))}}},n})}(Vr)),Vr.exports}ef();const tf={key:0,args:[0,1,64]},nf={key:1,args:[.5,1,64]},rf={key:2},of=["tone-mapped","map","side","color"];new ze(16777215);const jt=Fe({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","mousedown"],setup(t,{emit:e}){const n=t,r=e,i=X(null);function o(b,x,v){return Math.min(Math.max(b,x),v)}function s(b){const x=b.toString();return x.includes("e-")?Number.parseInt(x.split("e-")[1],10):x.includes(".")?x.split(".")[1].length:0}function a(b,x){const v=s(x),T=10**(v+3);return Number.parseFloat((b*T/T).toFixed(v))}const l=Ue(()=>a(o(n.modelValue,n.min,n.max),n.step)),u=Ue(()=>{const b=(l.value-n.min)/(n.max-n.min)*100;return{width:`${b}%`,backgroundSize:`${b}% 100%`}});function c(b){if(!i.value)return l.value;const x=i.value.getBoundingClientRect(),T=(b.clientX-x.left)/x.width,I=n.max-n.min,A=n.min+I*T,R=Math.round(A/n.step)*n.step;return Math.min(Math.max(R,n.min),n.max)}function f(b){if(n.disabled)return;const x=c(b);r("update:modelValue",x)}function p(b){if(n.disabled)return;b.preventDefault();const x=c(b);r("update:modelValue",x),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(b){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Ft(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(b,x)=>(ee(),ie("span",{ref_key:"sliderRef",ref:i,class:Ct(["range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50",{disabled:t.disabled}]),bg:"[#e6e1fc] dark:[#676085]","touch-action-none":"",relative:"","inline-block":"","w-full":"","cursor-ew-resize":"","rounded-sm":"",onMousedown:p},[O("span",{style:Fr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),O("span",{role:"slider",class:"slider-thumb",style:Fr({left:`${(l.value-t.min)/(t.max-t.min)*100}%`}),absolute:"","rounded-sm":"",w:"[1px]",h:"[14px]",bg:"zinc-100 dark:zinc-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function fo(t,e){if(e===dl)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===zr||e===ds){let n=t.getIndex();if(n===null){const s=[],a=t.getAttribute("position");if(a!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new Bf(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&a[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}u.setExtensions(s),u.setPlugins(a),u.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function af(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const de={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class lf{constructor(e){this.parser=e,this.name=de.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,s)}}class Tf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const s=o.extensions[n],a=i.images[s.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class kf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const s=o.extensions[n],a=i.images[s.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class Af{constructor(e){this.name=de.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(a){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,p=new Uint8Array(a,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(c*f);return s.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class _f{constructor(e){this.name=de.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==tt.TRIANGLES&&u.mode!==tt.TRIANGLE_STRIP&&u.mode!==tt.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,a=[],l={};for(const u in s)a.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const b of f){const x=new yt,v=new se,T=new zn,I=new se(1,1,1),A=new yl(b.geometry,b.material,p);for(let R=0;R0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const zf=new yt;class Bf{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new af,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,s=-1;if(typeof navigator<"u"){const a=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=a.indexOf("Firefox")>-1,s=o?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&s<98?this.textureLoader=new vl(this.options.manager):this.textureLoader=new bl(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ps(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const a={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return It(o,a,i),mt(a,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(s);l!=null&&this.associations.set(a,l);for(const[u,c]of s.children.entries())o(c,a.children[u])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(g,h[M*l+1]),l>=3&&v.setZ(g,h[M*l+2]),l>=4&&v.setW(g,h[M*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=b}return v})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,s=n.images[o];let a=this.textureLoader;if(s.uri){const l=r.manager.getHandler(s.uri);l!==null&&(a=l)}return this.loadTextureImage(e,o,a)}loadTextureImage(e,n,r){const i=this,o=this.json,s=o.textures[e],a=o.images[n],l=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=s.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const p=(o.samplers||{})[s.sampler]||{};return c.magFilter=ho[p.magFilter]||Un,c.minFilter=ho[p.minFilter]||li,c.wrapS=mo[p.wrapS]||jn,c.wrapT=mo[p.wrapT]||jn,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==Un,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const s=i.images[e],a=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=r.getDependency("bufferView",s.bufferView).then(function(f){u=!0;const p=new Blob([f],{type:s.mimeType});return l=a.createObjectURL(p),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(p,d){let b=p;n.isImageBitmapLoader===!0&&(b=function(x){const v=new Bn(x);v.needsUpdate=!0,p(v)}),n.load(un.resolveURL(f,o.path),b,void 0,d)})}).then(function(f){return u===!0&&a.revokeObjectURL(l),mt(f,s),f.userData.mimeType=s.mimeType||Ff(s.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),o.extensions[de.KHR_TEXTURE_TRANSFORM]){const a=r.extensions!==void 0?r.extensions[de.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=o.associations.get(s);s=o.extensions[de.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),o.associations.set(s,l)}}return i!==void 0&&(s.colorSpace=i),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new wl,rr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(a,l)),r=l}else if(e.isLine){const a="LineBasicMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new Tl,rr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(a,l)),r=l}if(i||o||s){let a="ClonedMaterial:"+r.uuid+":";i&&(a+="derivative-tangents:"),o&&(a+="vertex-colors:"),s&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=r.clone(),o&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return hs}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let s;const a={},l=o.extensions||{},u=[];if(l[de.KHR_MATERIALS_UNLIT]){const f=i[de.KHR_MATERIALS_UNLIT];s=f.getMaterialType(),u.push(f.extendParams(a,o,n))}else{const f=o.pbrMetallicRoughness||{};if(a.color=new ze(1,1,1),a.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;a.color.setRGB(p[0],p[1],p[2],xt),a.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(a,"map",f.baseColorTexture,mn)),a.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,a.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(a,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(a,"roughnessMap",f.metallicRoughnessTexture))),s=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}o.doubleSided===!0&&(a.side=Kn);const c=o.alphaMode||vr.OPAQUE;if(c===vr.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===vr.MASK&&(a.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==Ht&&(u.push(n.assignTexture(a,"normalMap",o.normalTexture)),a.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;a.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&s!==Ht&&(u.push(n.assignTexture(a,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==Ht){const f=o.emissiveFactor;a.emissive=new ze().setRGB(f[0],f[1],f[2],xt)}return o.emissiveTexture!==void 0&&s!==Ht&&u.push(n.assignTexture(a,"emissiveMap",o.emissiveTexture,mn)),Promise.all(u).then(function(){const f=new s(a);return o.name&&(f.name=o.name),mt(f,o),n.associations.set(f,{materials:e}),o.extensions&&It(i,f,o),f})}createUniqueName(e){const n=hn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(a){return r[de.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,n).then(function(l){return go(l,a,n)})}const s=[];for(let a=0,l=e.length;a0&&Of(T,o),T.name=n.createUniqueName(o.name||"mesh_"+e),mt(T,o),v.extensions&&It(i,T,v),n.assignFinalMaterial(T),f.push(T)}for(let d=0,b=f.length;d1?c=new ir:u.length===1?c=u[0]:c=new ui,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof rr||p instanceof Bn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const s=[],a=e.name?e.name:e.uuid,l=[];wt[o.path]===wt.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(a);let u;switch(wt[o.path]){case wt.weights:u=Oi;break;case wt.rotation:u=Di;break;case wt.position:case wt.scale:u=Pi;break;default:switch(r.itemSize){case 1:u=Oi;break;case 2:case 3:default:u=Pi;break}break}const c=i.interpolation!==void 0?Nf[i.interpolation]:ii,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew Ra(t)),Rt.register(t=>new Ca(t)),Rt)}async function jf(t){const r=(await Vs().loadAsync(t)).userData;if(!r.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(r.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return r.vrmAnimations[0]}async function Vf(t,e){if(!t){console.warn("No VRM found");return}if(e)return Na(e,t)}function Hf(){const t=X(!1),e=X(0),n=X(0),r=.2,i=1,o=6,s=X(Math.random()*(o-i)+i);function a(l,u){if(l!=null&&l.expressionManager&&(n.value+=u,!t.value&&n.value>=s.value&&(t.value=!0,e.value=0),t.value)){e.value+=u/r;const c=Math.sin(Math.PI*e.value);l.expressionManager.setValue("blink",c),e.value>=1&&(t.value=!1,n.value=0,l.expressionManager.setValue("blink",0),s.value=Math.random()*(o-i)+i)}}return{update:a}}function Gf(){let t=-1,e,n=0;function r(){e?e.set(rn(-.25,.25),rn(-.2,.15),-.65):e=new se(rn(-.25,.25),rn(-.2,.15),-.65)}function i(o,s){var a;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=La()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new ui),o.lookAt.target.position.lerp(e,rn(.2,.5)),(a=o.lookAt)==null||a.update(s),n+=s)}return{update:i}}async function $f(t,e){const i=(await Vs().loadAsync(t,s=>{var a;return(a=e==null?void 0:e.onProgress)==null?void 0:a.call(e,s)})).userData;if(!i.vrm)return;const o=i.vrm;if(Pr.removeUnnecessaryVertices(o.scene),Pr.combineSkeletons(o.scene),o.scene.traverse(s=>{s.frustumCulled=!1}),o.lookAt){const s=new Pa(o.lookAt);s.name="lookAtQuaternionProxy",o.scene.add(s)}return e!=null&&e.scene&&e.scene.add(o.scene),e!=null&&e.position&&o.scene.position.set(...e.position),o}function qf(t){const e=X(null),n=X(!1),r=X(0),i=X(new Map),o=X(new Map),s=X(),a=(T,I,A)=>T+(I-T)*A,l=T=>T<.5?4*T*T*T:1-(-2*T+2)**3/2,u=new Map([["happy",{expression:[{name:"happy",value:1,duration:.3},{name:"aa",value:.3}],blendDuration:.3}],["sad",{expression:[{name:"sad",value:1},{name:"oh",value:.2}],blendDuration:.3}],["angry",{expression:[{name:"angry",value:1},{name:"ee",value:.4}],blendDuration:.2}],["surprised",{expression:[{name:"Surprised",value:1},{name:"oh",value:.6}],blendDuration:.1}],["neutral",{expression:[{name:"neutral",value:1}],blendDuration:.5}]]),c=()=>{s.value&&(clearTimeout(s.value),s.value=void 0)},f=T=>{var A;if(c(),!u.has(T)){console.warn(`Emotion ${T} not found`);return}const I=u.get(T);if(e.value=T,n.value=!0,r.value=0,t.expressionManager){const R=Object.keys(t.expressionManager.expressionMap);for(const P of R)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const R of I.expression||[]){const P=((A=t.expressionManager)==null?void 0:A.getValue(R.name))||0;i.value.set(R.name,P),o.value.set(R.name,R.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(T,I)=>{c(),f(T),s.value=setTimeout(()=>{f("neutral"),s.value=void 0},I)},update:T=>{var R;if(!n.value||!e.value)return;const A=u.get(e.value).blendDuration||.3;r.value+=T/A,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const M=i.value.get(P)||0,y=a(M,h,l(r.value));(R=t.expressionManager)==null||R.setValue(P,y)}},addEmotionState:(T,I)=>{u.set(T,I)},removeEmotionState:T=>{u.delete(T)},dispose:()=>{c()}}}const Yf=Fe({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const s=X(),a=X(),{scene:l}=Yn(),{onBeforeRender:u}=Fn(),c=Hf(),f=Gf(),p=X();je(()=>r.position,([x,v,T])=>{s.value&&s.value.scene.position.set(x,v,T)}),dn(async()=>{if(l.value)try{const x=await $f(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:I=>i("loadModelProgress",Number.parseFloat((100*(I.loaded/I.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const v=await jf(r.idleAnimation),T=await Vf(x,v);if(!T){console.warn("No VRM animation loaded");return}a.value=new Ll(x.scene),a.value.clipAction(T).play(),p.value=qf(x),s.value=x,o=u(({delta:I})=>{var A,R,P;(A=a.value)==null||A.update(I),(R=s.value)==null||R.update(I),c.update(s.value,I),f.update(s.value,I),(P=p.value)==null||P.update(I)}).off}catch(x){i("error",x)}}),Ft(()=>{o==null||o(),s.value&&(s.value.scene.removeFromParent(),Pr.deepDispose(s.value.scene))}),e({setExpression(x){var v;(v=p.value)==null||v.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:b}=Fn();return je(()=>r.paused,x=>{x?d():b()}),(x,v)=>gn(x.$slots,"default")}}),Kf=["position"],Wf={absolute:"",bottom:"3",right:"3"},Xf={flex:"~ row","cursor-pointer":""},Qf=["checked","aria-checked"],Zf={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(b)}}),(b,x)=>(ee(),Xt(ws,{relative:""},{default:Be(({height:v,width:T})=>[Te(H(Pl),{alpha:!0,antialias:!0,width:T,height:v},{default:Be(()=>[Te(H(Pc)),O("TresPerspectiveCamera",{position:[s.value,a.value,l.value]},null,8,Kf),x[14]||(x[14]=O("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=O("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),Te(Yf,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:x[0]||(x[0]=I=>i("loadModelProgress",I)),onError:x[1]||(x[1]=I=>i("error",I))},null,8,["model","idle-animation","position","paused"])]),_:2},1032,["width","height"]),O("div",Wf,[O("div",Xf,[O("label",{class:Ct([o.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(O("input",{"onUpdate:modelValue":x[2]||(x[2]=I=>o.value=I),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,Qf),[[ni,o.value]]),x[16]||(x[16]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(pi,null,{default:Be(()=>[o.value?(ee(),ie("div",Zf,[O("div",Jf,[O("div",ed,[O("span",null,he(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),Te(zi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Be(()=>[O("span",td,he(H(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Be(()=>[O("div",nd,[x[17]||(x[17]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"X")],-1)),O("label",rd,[Te(jt,{modelValue:s.value,"onUpdate:modelValue":x[3]||(x[3]=I=>s.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",id,[O("span",null,he(s.value),1)]),x[18]||(x[18]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"Y")],-1)),O("label",od,[Te(jt,{modelValue:a.value,"onUpdate:modelValue":x[4]||(x[4]=I=>a.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",sd,[O("span",null,he(a.value),1)]),x[19]||(x[19]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"Z")],-1)),O("label",ad,[Te(jt,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=I=>l.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",ld,[O("span",null,he(l.value),1)])])]),_:1}),Te(zi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Be(()=>[O("span",ud,he(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Be(()=>[O("div",cd,[x[20]||(x[20]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"X")],-1)),O("label",fd,[Te(jt,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=I=>u.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",dd,[O("span",null,he(u.value),1)]),x[21]||(x[21]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"Y")],-1)),O("label",pd,[Te(jt,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=I=>c.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",hd,[O("span",null,he(c.value),1)]),x[22]||(x[22]=O("div",{text:"zinc-400 dark:zinc-500"},[O("span",null,"Z")],-1)),O("label",md,[Te(jt,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=I=>f.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",gd,[O("span",null,he(f.value),1)])])]),_:1}),O("div",yd,[O("span",null,he(H(d)("stage.viewers.debug-menu.emotions")),1)]),O("div",xd,[O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("neutral")})},he(H(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("surprised")})},he(H(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("sad")})},he(H(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("angry")})},he(H(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("happy")})},he(H(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):it("",!0)]),_:1})])]),_:1}))}}),bd=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class bn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}bn.prototype.normal={};bn.prototype.property={};bn.prototype.space=void 0;function Hs(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new bn(n,r,e)}function $r(t){return t.toLowerCase()}class Ke{constructor(e,n){this.attribute=n,this.property=e}}Ke.prototype.attribute="";Ke.prototype.booleanish=!1;Ke.prototype.boolean=!1;Ke.prototype.commaOrSpaceSeparated=!1;Ke.prototype.commaSeparated=!1;Ke.prototype.defined=!1;Ke.prototype.mustUseProperty=!1;Ke.prototype.number=!1;Ke.prototype.overloadedBoolean=!1;Ke.prototype.property="";Ke.prototype.spaceSeparated=!1;Ke.prototype.space=void 0;let wd=0;const ce=zt(),Le=zt(),Gs=zt(),$=zt(),Re=zt(),Yt=zt(),Qe=zt();function zt(){return 2**++wd}const qr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Qe,commaSeparated:Yt,number:$,overloadedBoolean:Gs,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),wr=Object.keys(qr);class yi extends Ke{constructor(e,n,r,i){let o=-1;if(super(e,n),yo(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&_d.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(xo,Sd);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!xo.test(o)){let s=o.replace(Ad,Md);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=yi}return new i(r,e)}function Md(t){return"-"+t.toLowerCase()}function Sd(t){return t.charAt(1).toUpperCase()}const Id=Hs([$s,Td,Ks,Ws,Xs],"html"),Qs=Hs([$s,kd,Ks,Ws,Xs],"svg"),vo={}.hasOwnProperty;function Rd(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&vo.call(i,t)){const l=String(i[t]);s=vo.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Cd=/["&'<>`]/g,Nd=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ld=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Pd=/[|\\{}()[\]^$+*?.]/g,bo=new WeakMap;function Od(t,e){if(t=t.replace(e.subset?Dd(e.subset):Cd,r),e.subset||e.escapeOnly)return t;return t.replace(Nd,n).replace(Ld,r);function n(i,o,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),e)}function r(i,o,s){return e.format(i.charCodeAt(0),s.charCodeAt(o+1),e)}}function Dd(t){let e=bo.get(t);return e||(e=Fd(t),bo.set(t,e)),e}function Fd(t){const e=[];let n=-1;for(;++n",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:"€"},Hd=["cent","copy","divide","gt","lt","not","para","times"],Zs={}.hasOwnProperty,Yr={};let In;for(In in Tr)Zs.call(Tr,In)&&(Yr[Tr[In]]=In);const Gd=/[^\dA-Za-z]/;function $d(t,e,n,r){const i=String.fromCharCode(t);if(Zs.call(Yr,i)){const o=Yr[i],s="&"+o;return n&&Vd.includes(o)&&!Hd.includes(o)&&(!r||e&&e!==61&&Gd.test(String.fromCharCode(e)))?s:s+";"}return""}function qd(t,e,n){let r=Bd(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=$d(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=jd(t,e,n.omitOptionalSemicolons);o.length|^->||--!>|"],Wd=["<",">"];function Xd(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return Kt(o,Object.assign({},r.settings.characterReferences,{subset:Wd}))}}function Qd(t,e,n,r){return""}function wo(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function Zd(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Jd(t){return t.join(" ").trim()}const ep=/[ \t\n\f\r]/g;function xi(t){return typeof t=="object"?t.type==="text"?To(t.value):!1:To(t)}function To(t){return t.replace(ep,"")===""}const Oe=ea(1),Js=ea(-1),tp=[];function ea(t){return e;function e(n,r,i){const o=n?n.children:tp;let s=(r||0)+t,a=o[s];if(!i)for(;a&&xi(a);)s+=t,a=o[s];return a}}const np={}.hasOwnProperty;function ta(t){return e;function e(n,r,i){return np.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const vi=ta({body:ip,caption:kr,colgroup:kr,dd:lp,dt:ap,head:kr,html:rp,li:sp,optgroup:up,option:cp,p:op,rp:ko,rt:ko,tbody:dp,td:Ao,tfoot:pp,th:Ao,thead:fp,tr:hp});function kr(t,e,n){const r=Oe(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&xi(r.value.charAt(0)))}function rp(t,e,n){const r=Oe(n,e);return!r||r.type!=="comment"}function ip(t,e,n){const r=Oe(n,e);return!r||r.type!=="comment"}function op(t,e,n){const r=Oe(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function sp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&r.tagName==="li"}function ap(t,e,n){const r=Oe(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function lp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function ko(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function up(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function cp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function fp(t,e,n){const r=Oe(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function dp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function pp(t,e,n){return!Oe(n,e)}function hp(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Ao(t,e,n){const r=Oe(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const mp=ta({body:xp,colgroup:vp,head:yp,html:gp,tbody:bp});function gp(t){const e=Oe(t,-1);return!e||e.type!=="comment"}function yp(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function xp(t){const e=Oe(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&xi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function vp(t,e,n){const r=Js(n,e),i=Oe(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&vi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function bp(t,e,n){const r=Js(n,e),i=Oe(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&vi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Rn={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -519,18 +519,18 @@ void main() { \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function wp(t,e,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=Qs);const u=Tp(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(s=!1),(u||!o||!mp(t,e,n))&&(a.push("<",t.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!o||!vi(t,e,n))&&a.push(""),a.join("")}function Tp(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=kp(t,i,e[i]);o&&n.push(o)}}for(;++rwo(n,t.alternative)&&(s=t.alternative),a=s+Yt(n,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?In.single:In.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const Ap=["<","&"];function na(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Yt(t.value,Object.assign({},r.settings.characterReferences,{subset:Ap}))}function _p(t,e,n,r){return r.settings.allowDangerousHtml?t.value:na(t,e,n,r)}function Ep(t,e,n,r){return r.all(t)}const Mp=Rd("type",{invalid:Sp,unknown:Ip,handlers:{comment:Xd,doctype:Qd,element:wp,raw:_p,root:Ep,text:na}});function Sp(t){throw new Error("Expected node, not `"+t+"`")}function Ip(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Rp={},Cp={},Np=[];function Lp(t,e){const n=e||Rp,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Pp,all:Op,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||bd,characterReferences:n.characterReferences||Cp,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Qs:Id,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Pp(t,e,n){return Mp(t,e,n,this)}function Op(t){const e=[],n=t&&t.children||Np;let r=-1;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o0?(ut(t,t.length,0,e),t):e}const Mo={}.hasOwnProperty;function Up(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Kt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=St(/[A-Za-z]/),Je=St(/[\dA-Za-z]/),Hp=St(/[#-'*+\--9=?A-Z^-~]/);function Yr(t){return t!==null&&(t<32||t===127)}const Kr=St(/\d/),$p=St(/[\dA-Fa-f]/),Gp=St(/[!-/:-@[-`{-~]/);function ae(t){return t!==null&&t<-2}function Ye(t){return t!==null&&(t<0||t===32)}function _e(t){return t===-2||t===-1||t===32}const qp=St(new RegExp("\\p{P}|\\p{S}","u")),Yp=St(/\s/);function St(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Qt(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ce(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return _e(l)?(t.enter(n),a(l)):e(l)}function a(l){return _e(l)&&o++s))return;const M=e.events.length;let x=M,y,m;for(;x--;)if(e.events[x][0]==="exit"&&e.events[x][1].type==="chunkFlow"){if(y){m=e.events[x][1].end;break}y=!0}for(w(r),h=M;hE;){const P=n[R];e.containerState=P[1],P[0].exit.call(e,t)}n.length=E}function I(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Zp(t,e,n){return Ce(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Io(t){if(t===null||Ye(t)||Yp(t))return 1;if(qp(t))return 2}function wi(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Ro(f,-l),Ro(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[r][1].end={...s.start},t[n][1].start={...a.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=nt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=nt(u,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),u=nt(u,wi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=nt(u,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=nt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,ut(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&_e(h)?Ce(t,I,"linePrefix",o+1)(h):I(h)}function I(h){return h===null||ae(h)?t.check(Co,k,R)(h):(t.enter("codeFlowValue"),E(h))}function E(h){return h===null||ae(h)?(t.exit("codeFlowValue"),I(h)):(t.consume(h),E)}function R(h){return t.exit("codeFenced"),e(h)}function P(h,M,x){let y=0;return m;function m(D){return h.enter("lineEnding"),h.consume(D),h.exit("lineEnding"),T}function T(D){return h.enter("codeFencedFence"),_e(D)?Ce(h,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):A(D)}function A(D){return D===a?(h.enter("codeFencedFenceSequence"),F(D)):x(D)}function F(D){return D===a?(y++,h.consume(D),F):y>=s?(h.exit("codeFencedFenceSequence"),_e(D)?Ce(h,j,"whitespace")(D):j(D)):x(D)}function j(D){return D===null||ae(D)?(h.exit("codeFencedFence"),M(D)):x(D)}}}function ch(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const kr={name:"codeIndented",tokenize:dh},fh={partial:!0,tokenize:ph};function dh(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Ce(t,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ae(u)?t.attempt(fh,s,l)(u):(t.enter("codeFlowValue"),a(u))}function a(u){return u===null||ae(u)?(t.exit("codeFlowValue"),s(u)):(t.consume(u),a)}function l(u){return t.exit("codeIndented"),e(u)}}function ph(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ae(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Ce(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):ae(s)?i(s):n(s)}}const hh={name:"codeText",previous:gh,resolve:mh,tokenize:yh};function mh(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();const i=this.left.slice(e);return i.push(...this.right.slice(this.right.length-r+this.left.length).reverse()),i}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&on(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),on(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),on(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function ua(t,e,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(w){return w===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(w),t.exit(o),p):w===null||w===32||w===41||Yr(w)?n(w):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),k(w))}function p(w){return w===62?(t.enter(o),t.consume(w),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===62?(t.exit("chunkString"),t.exit(a),p(w)):w===null||w===60||ae(w)?n(w):(t.consume(w),w===92?g:d)}function g(w){return w===60||w===62||w===92?(t.consume(w),d):d(w)}function k(w){return!c&&(w===null||w===41||Ye(w))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(w)):c999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):ae(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||ae(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),l||(l=!_e(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function fa(t,e,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,l):n(p)}function l(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(o),u(p))}function u(p){return p===s?(t.exit(o),l(s)):p===null?n(p):ae(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ce(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||ae(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function un(t,e){let n;return r;function r(i){return ae(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):_e(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const _h={name:"definition",tokenize:Mh},Eh={partial:!0,tokenize:Sh};function Mh(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return ca.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Kt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return Ye(d)?un(t,u)(d):u(d)}function u(d){return ua(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(Eh,f,f)(d)}function f(d){return _e(d)?Ce(t,p,"whitespace")(d):p(d)}function p(d){return d===null||ae(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function Sh(t,e,n){return r;function r(a){return Ye(a)?un(t,i)(a):n(a)}function i(a){return fa(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return _e(a)?Ce(t,s,"whitespace")(a):s(a)}function s(a){return a===null||ae(a)?e(a):n(a)}}const Ih={name:"hardBreakEscape",tokenize:Rh};function Rh(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return ae(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const Ch={name:"headingAtx",resolve:Nh,tokenize:Lh};function Nh(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ut(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function Lh(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(t.consume(c),s):c===null||Ye(c)?(t.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||ae(c)?(t.exit("atxHeading"),e(c)):_e(c)?Ce(t,a,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Ye(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),u)}}const Ph=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Lo=["pre","script","style","textarea"],Oh={concrete:!0,name:"htmlFlow",resolveTo:zh,tokenize:Bh},Dh={partial:!0,tokenize:jh},Fh={partial:!0,tokenize:Uh};function zh(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Bh(t,e,n){const r=this;let i,o,s,a,l;return u;function u(C){return c(C)}function c(C){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(C),f}function f(C){return C===33?(t.consume(C),p):C===47?(t.consume(C),o=!0,k):C===63?(t.consume(C),i=3,r.interrupt?e:_):lt(C)?(t.consume(C),s=String.fromCharCode(C),v):n(C)}function p(C){return C===45?(t.consume(C),i=2,d):C===91?(t.consume(C),i=5,a=0,g):lt(C)?(t.consume(C),i=4,r.interrupt?e:_):n(C)}function d(C){return C===45?(t.consume(C),r.interrupt?e:_):n(C)}function g(C){const ge="CDATA[";return C===ge.charCodeAt(a++)?(t.consume(C),a===ge.length?r.interrupt?e:A:g):n(C)}function k(C){return lt(C)?(t.consume(C),s=String.fromCharCode(C),v):n(C)}function v(C){if(C===null||C===47||C===62||Ye(C)){const ge=C===47,ke=s.toLowerCase();return!ge&&!o&&Lo.includes(ke)?(i=1,r.interrupt?e(C):A(C)):Ph.includes(s.toLowerCase())?(i=6,ge?(t.consume(C),w):r.interrupt?e(C):A(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?I(C):E(C))}return C===45||Je(C)?(t.consume(C),s+=String.fromCharCode(C),v):n(C)}function w(C){return C===62?(t.consume(C),r.interrupt?e:A):n(C)}function I(C){return _e(C)?(t.consume(C),I):m(C)}function E(C){return C===47?(t.consume(C),m):C===58||C===95||lt(C)?(t.consume(C),R):_e(C)?(t.consume(C),E):m(C)}function R(C){return C===45||C===46||C===58||C===95||Je(C)?(t.consume(C),R):P(C)}function P(C){return C===61?(t.consume(C),h):_e(C)?(t.consume(C),P):E(C)}function h(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),l=C,M):_e(C)?(t.consume(C),h):x(C)}function M(C){return C===l?(t.consume(C),l=null,y):C===null||ae(C)?n(C):(t.consume(C),M)}function x(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Ye(C)?P(C):(t.consume(C),x)}function y(C){return C===47||C===62||_e(C)?E(C):n(C)}function m(C){return C===62?(t.consume(C),T):n(C)}function T(C){return C===null||ae(C)?A(C):_e(C)?(t.consume(C),T):n(C)}function A(C){return C===45&&i===2?(t.consume(C),z):C===60&&i===1?(t.consume(C),Q):C===62&&i===4?(t.consume(C),te):C===63&&i===3?(t.consume(C),_):C===93&&i===5?(t.consume(C),Y):ae(C)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Dh,me,F)(C)):C===null||ae(C)?(t.exit("htmlFlowData"),F(C)):(t.consume(C),A)}function F(C){return t.check(Fh,j,me)(C)}function j(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),D}function D(C){return C===null||ae(C)?F(C):(t.enter("htmlFlowData"),A(C))}function z(C){return C===45?(t.consume(C),_):A(C)}function Q(C){return C===47?(t.consume(C),s="",Z):A(C)}function Z(C){if(C===62){const ge=s.toLowerCase();return Lo.includes(ge)?(t.consume(C),te):A(C)}return lt(C)&&s.length<8?(t.consume(C),s+=String.fromCharCode(C),Z):A(C)}function Y(C){return C===93?(t.consume(C),_):A(C)}function _(C){return C===62?(t.consume(C),te):C===45&&i===2?(t.consume(C),_):A(C)}function te(C){return C===null||ae(C)?(t.exit("htmlFlowData"),me(C)):(t.consume(C),te)}function me(C){return t.exit("htmlFlow"),e(C)}}function Uh(t,e,n){const r=this;return i;function i(s){return ae(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function jh(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Qn,e,n)}}const Vh={name:"htmlText",tokenize:Hh};function Hh(t,e,n){const r=this;let i,o,s;return a;function a(_){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(_),l}function l(_){return _===33?(t.consume(_),u):_===47?(t.consume(_),P):_===63?(t.consume(_),E):lt(_)?(t.consume(_),x):n(_)}function u(_){return _===45?(t.consume(_),c):_===91?(t.consume(_),o=0,g):lt(_)?(t.consume(_),I):n(_)}function c(_){return _===45?(t.consume(_),d):n(_)}function f(_){return _===null?n(_):_===45?(t.consume(_),p):ae(_)?(s=f,Q(_)):(t.consume(_),f)}function p(_){return _===45?(t.consume(_),d):f(_)}function d(_){return _===62?z(_):_===45?p(_):f(_)}function g(_){const te="CDATA[";return _===te.charCodeAt(o++)?(t.consume(_),o===te.length?k:g):n(_)}function k(_){return _===null?n(_):_===93?(t.consume(_),v):ae(_)?(s=k,Q(_)):(t.consume(_),k)}function v(_){return _===93?(t.consume(_),w):k(_)}function w(_){return _===62?z(_):_===93?(t.consume(_),w):k(_)}function I(_){return _===null||_===62?z(_):ae(_)?(s=I,Q(_)):(t.consume(_),I)}function E(_){return _===null?n(_):_===63?(t.consume(_),R):ae(_)?(s=E,Q(_)):(t.consume(_),E)}function R(_){return _===62?z(_):E(_)}function P(_){return lt(_)?(t.consume(_),h):n(_)}function h(_){return _===45||Je(_)?(t.consume(_),h):M(_)}function M(_){return ae(_)?(s=M,Q(_)):_e(_)?(t.consume(_),M):z(_)}function x(_){return _===45||Je(_)?(t.consume(_),x):_===47||_===62||Ye(_)?y(_):n(_)}function y(_){return _===47?(t.consume(_),z):_===58||_===95||lt(_)?(t.consume(_),m):ae(_)?(s=y,Q(_)):_e(_)?(t.consume(_),y):z(_)}function m(_){return _===45||_===46||_===58||_===95||Je(_)?(t.consume(_),m):T(_)}function T(_){return _===61?(t.consume(_),A):ae(_)?(s=T,Q(_)):_e(_)?(t.consume(_),T):y(_)}function A(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(t.consume(_),i=_,F):ae(_)?(s=A,Q(_)):_e(_)?(t.consume(_),A):(t.consume(_),j)}function F(_){return _===i?(t.consume(_),i=void 0,D):_===null?n(_):ae(_)?(s=F,Q(_)):(t.consume(_),F)}function j(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Ye(_)?y(_):(t.consume(_),j)}function D(_){return _===47||_===62||Ye(_)?y(_):n(_)}function z(_){return _===62?(t.consume(_),t.exit("htmlTextData"),t.exit("htmlText"),e):n(_)}function Q(_){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),Z}function Z(_){return _e(_)?Ce(t,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Y(_)}function Y(_){return t.enter("htmlTextData"),s(_)}}const Ti={name:"labelEnd",resolveAll:Yh,resolveTo:Kh,tokenize:Wh},$h={tokenize:Xh},Gh={tokenize:Qh},qh={tokenize:Zh};function Yh(t){let e=-1;const n=[];for(;++e=3&&(u===null||ae(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),_e(u)?Ce(t,a,"whitespace")(u):a(u))}}const qe={continuation:{tokenize:lm},exit:cm,name:"list",tokenize:am},om={partial:!0,tokenize:fm},sm={partial:!0,tokenize:um};function am(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const g=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Kr(d)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(On,n,u)(d):u(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return Kr(d)&&++s<10?(t.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),u(d)):n(d)}function u(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(Qn,r.interrupt?n:c,t.attempt(om,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return _e(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function lm(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Qn,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!_e(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(sm,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(qe,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function um(t,e,n){const r=this;return Ce(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function cm(t){t.exit(this.containerState.type)}function fm(t,e,n){const r=this;return Ce(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!_e(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Po={name:"setextUnderline",resolveTo:dm,tokenize:pm};function dm(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function pm(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return t.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(t.consume(u),a):(t.exit("setextHeadingLineSequence"),_e(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ae(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const hm={tokenize:mm};function mm(t){const e=this,n=t.attempt(Qn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(bh,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const gm={resolveAll:pa()},ym=da("string"),xm=da("text");function da(t){return{resolveAll:pa(t==="text"?vm:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function Nm(t,e){let n=-1;const r=[];let i;for(;++n\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function wp(t,e,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=Qs);const u=Tp(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(s=!1),(u||!o||!mp(t,e,n))&&(a.push("<",t.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!o||!vi(t,e,n))&&a.push(""),a.join("")}function Tp(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=kp(t,i,e[i]);o&&n.push(o)}}for(;++rwo(n,t.alternative)&&(s=t.alternative),a=s+Kt(n,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?Rn.single:Rn.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const Ap=["<","&"];function na(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Kt(t.value,Object.assign({},r.settings.characterReferences,{subset:Ap}))}function _p(t,e,n,r){return r.settings.allowDangerousHtml?t.value:na(t,e,n,r)}function Ep(t,e,n,r){return r.all(t)}const Mp=Rd("type",{invalid:Sp,unknown:Ip,handlers:{comment:Xd,doctype:Qd,element:wp,raw:_p,root:Ep,text:na}});function Sp(t){throw new Error("Expected node, not `"+t+"`")}function Ip(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Rp={},Cp={},Np=[];function Lp(t,e){const n=e||Rp,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Pp,all:Op,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||bd,characterReferences:n.characterReferences||Cp,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Qs:Id,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Pp(t,e,n){return Mp(t,e,n,this)}function Op(t){const e=[],n=t&&t.children||Np;let r=-1;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o0?(ut(t,t.length,0,e),t):e}const Mo={}.hasOwnProperty;function Up(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Wt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=St(/[A-Za-z]/),Je=St(/[\dA-Za-z]/),Hp=St(/[#-'*+\--9=?A-Z^-~]/);function Kr(t){return t!==null&&(t<32||t===127)}const Wr=St(/\d/),Gp=St(/[\dA-Fa-f]/),$p=St(/[!-/:-@[-`{-~]/);function ae(t){return t!==null&&t<-2}function Ye(t){return t!==null&&(t<0||t===32)}function _e(t){return t===-2||t===-1||t===32}const qp=St(new RegExp("\\p{P}|\\p{S}","u")),Yp=St(/\s/);function St(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Zt(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ce(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return _e(l)?(t.enter(n),a(l)):e(l)}function a(l){return _e(l)&&o++s))return;const M=e.events.length;let y=M,g,m;for(;y--;)if(e.events[y][0]==="exit"&&e.events[y][1].type==="chunkFlow"){if(g){m=e.events[y][1].end;break}g=!0}for(T(r),h=M;hA;){const P=n[R];e.containerState=P[1],P[0].exit.call(e,t)}n.length=A}function I(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Zp(t,e,n){return Ce(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Io(t){if(t===null||Ye(t)||Yp(t))return 1;if(qp(t))return 2}function wi(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Ro(f,-l),Ro(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[r][1].end={...s.start},t[n][1].start={...a.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=nt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=nt(u,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),u=nt(u,wi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=nt(u,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=nt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,ut(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&_e(h)?Ce(t,I,"linePrefix",o+1)(h):I(h)}function I(h){return h===null||ae(h)?t.check(Co,x,R)(h):(t.enter("codeFlowValue"),A(h))}function A(h){return h===null||ae(h)?(t.exit("codeFlowValue"),I(h)):(t.consume(h),A)}function R(h){return t.exit("codeFenced"),e(h)}function P(h,M,y){let g=0;return m;function m(D){return h.enter("lineEnding"),h.consume(D),h.exit("lineEnding"),k}function k(D){return h.enter("codeFencedFence"),_e(D)?Ce(h,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):_(D)}function _(D){return D===a?(h.enter("codeFencedFenceSequence"),F(D)):y(D)}function F(D){return D===a?(g++,h.consume(D),F):g>=s?(h.exit("codeFencedFenceSequence"),_e(D)?Ce(h,j,"whitespace")(D):j(D)):y(D)}function j(D){return D===null||ae(D)?(h.exit("codeFencedFence"),M(D)):y(D)}}}function ch(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const Ar={name:"codeIndented",tokenize:dh},fh={partial:!0,tokenize:ph};function dh(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Ce(t,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ae(u)?t.attempt(fh,s,l)(u):(t.enter("codeFlowValue"),a(u))}function a(u){return u===null||ae(u)?(t.exit("codeFlowValue"),s(u)):(t.consume(u),a)}function l(u){return t.exit("codeIndented"),e(u)}}function ph(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ae(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Ce(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):ae(s)?i(s):n(s)}}const hh={name:"codeText",previous:gh,resolve:mh,tokenize:yh};function mh(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();const i=this.left.slice(e);return i.push(...this.right.slice(this.right.length-r+this.left.length).reverse()),i}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&sn(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function ua(t,e,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(T){return T===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(T),t.exit(o),p):T===null||T===32||T===41||Kr(T)?n(T):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),x(T))}function p(T){return T===62?(t.enter(o),t.consume(T),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(T))}function d(T){return T===62?(t.exit("chunkString"),t.exit(a),p(T)):T===null||T===60||ae(T)?n(T):(t.consume(T),T===92?b:d)}function b(T){return T===60||T===62||T===92?(t.consume(T),d):d(T)}function x(T){return!c&&(T===null||T===41||Ye(T))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(T)):c999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):ae(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||ae(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),l||(l=!_e(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function fa(t,e,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,l):n(p)}function l(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(o),u(p))}function u(p){return p===s?(t.exit(o),l(s)):p===null?n(p):ae(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ce(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||ae(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function cn(t,e){let n;return r;function r(i){return ae(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):_e(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const _h={name:"definition",tokenize:Mh},Eh={partial:!0,tokenize:Sh};function Mh(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return ca.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Wt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return Ye(d)?cn(t,u)(d):u(d)}function u(d){return ua(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(Eh,f,f)(d)}function f(d){return _e(d)?Ce(t,p,"whitespace")(d):p(d)}function p(d){return d===null||ae(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function Sh(t,e,n){return r;function r(a){return Ye(a)?cn(t,i)(a):n(a)}function i(a){return fa(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return _e(a)?Ce(t,s,"whitespace")(a):s(a)}function s(a){return a===null||ae(a)?e(a):n(a)}}const Ih={name:"hardBreakEscape",tokenize:Rh};function Rh(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return ae(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const Ch={name:"headingAtx",resolve:Nh,tokenize:Lh};function Nh(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ut(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function Lh(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(t.consume(c),s):c===null||Ye(c)?(t.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||ae(c)?(t.exit("atxHeading"),e(c)):_e(c)?Ce(t,a,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Ye(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),u)}}const Ph=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Lo=["pre","script","style","textarea"],Oh={concrete:!0,name:"htmlFlow",resolveTo:zh,tokenize:Bh},Dh={partial:!0,tokenize:jh},Fh={partial:!0,tokenize:Uh};function zh(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Bh(t,e,n){const r=this;let i,o,s,a,l;return u;function u(C){return c(C)}function c(C){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(C),f}function f(C){return C===33?(t.consume(C),p):C===47?(t.consume(C),o=!0,x):C===63?(t.consume(C),i=3,r.interrupt?e:E):lt(C)?(t.consume(C),s=String.fromCharCode(C),v):n(C)}function p(C){return C===45?(t.consume(C),i=2,d):C===91?(t.consume(C),i=5,a=0,b):lt(C)?(t.consume(C),i=4,r.interrupt?e:E):n(C)}function d(C){return C===45?(t.consume(C),r.interrupt?e:E):n(C)}function b(C){const ge="CDATA[";return C===ge.charCodeAt(a++)?(t.consume(C),a===ge.length?r.interrupt?e:_:b):n(C)}function x(C){return lt(C)?(t.consume(C),s=String.fromCharCode(C),v):n(C)}function v(C){if(C===null||C===47||C===62||Ye(C)){const ge=C===47,ke=s.toLowerCase();return!ge&&!o&&Lo.includes(ke)?(i=1,r.interrupt?e(C):_(C)):Ph.includes(s.toLowerCase())?(i=6,ge?(t.consume(C),T):r.interrupt?e(C):_(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?I(C):A(C))}return C===45||Je(C)?(t.consume(C),s+=String.fromCharCode(C),v):n(C)}function T(C){return C===62?(t.consume(C),r.interrupt?e:_):n(C)}function I(C){return _e(C)?(t.consume(C),I):m(C)}function A(C){return C===47?(t.consume(C),m):C===58||C===95||lt(C)?(t.consume(C),R):_e(C)?(t.consume(C),A):m(C)}function R(C){return C===45||C===46||C===58||C===95||Je(C)?(t.consume(C),R):P(C)}function P(C){return C===61?(t.consume(C),h):_e(C)?(t.consume(C),P):A(C)}function h(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),l=C,M):_e(C)?(t.consume(C),h):y(C)}function M(C){return C===l?(t.consume(C),l=null,g):C===null||ae(C)?n(C):(t.consume(C),M)}function y(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Ye(C)?P(C):(t.consume(C),y)}function g(C){return C===47||C===62||_e(C)?A(C):n(C)}function m(C){return C===62?(t.consume(C),k):n(C)}function k(C){return C===null||ae(C)?_(C):_e(C)?(t.consume(C),k):n(C)}function _(C){return C===45&&i===2?(t.consume(C),z):C===60&&i===1?(t.consume(C),Q):C===62&&i===4?(t.consume(C),te):C===63&&i===3?(t.consume(C),E):C===93&&i===5?(t.consume(C),K):ae(C)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Dh,me,F)(C)):C===null||ae(C)?(t.exit("htmlFlowData"),F(C)):(t.consume(C),_)}function F(C){return t.check(Fh,j,me)(C)}function j(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),D}function D(C){return C===null||ae(C)?F(C):(t.enter("htmlFlowData"),_(C))}function z(C){return C===45?(t.consume(C),E):_(C)}function Q(C){return C===47?(t.consume(C),s="",Z):_(C)}function Z(C){if(C===62){const ge=s.toLowerCase();return Lo.includes(ge)?(t.consume(C),te):_(C)}return lt(C)&&s.length<8?(t.consume(C),s+=String.fromCharCode(C),Z):_(C)}function K(C){return C===93?(t.consume(C),E):_(C)}function E(C){return C===62?(t.consume(C),te):C===45&&i===2?(t.consume(C),E):_(C)}function te(C){return C===null||ae(C)?(t.exit("htmlFlowData"),me(C)):(t.consume(C),te)}function me(C){return t.exit("htmlFlow"),e(C)}}function Uh(t,e,n){const r=this;return i;function i(s){return ae(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function jh(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Zn,e,n)}}const Vh={name:"htmlText",tokenize:Hh};function Hh(t,e,n){const r=this;let i,o,s;return a;function a(E){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(E),l}function l(E){return E===33?(t.consume(E),u):E===47?(t.consume(E),P):E===63?(t.consume(E),A):lt(E)?(t.consume(E),y):n(E)}function u(E){return E===45?(t.consume(E),c):E===91?(t.consume(E),o=0,b):lt(E)?(t.consume(E),I):n(E)}function c(E){return E===45?(t.consume(E),d):n(E)}function f(E){return E===null?n(E):E===45?(t.consume(E),p):ae(E)?(s=f,Q(E)):(t.consume(E),f)}function p(E){return E===45?(t.consume(E),d):f(E)}function d(E){return E===62?z(E):E===45?p(E):f(E)}function b(E){const te="CDATA[";return E===te.charCodeAt(o++)?(t.consume(E),o===te.length?x:b):n(E)}function x(E){return E===null?n(E):E===93?(t.consume(E),v):ae(E)?(s=x,Q(E)):(t.consume(E),x)}function v(E){return E===93?(t.consume(E),T):x(E)}function T(E){return E===62?z(E):E===93?(t.consume(E),T):x(E)}function I(E){return E===null||E===62?z(E):ae(E)?(s=I,Q(E)):(t.consume(E),I)}function A(E){return E===null?n(E):E===63?(t.consume(E),R):ae(E)?(s=A,Q(E)):(t.consume(E),A)}function R(E){return E===62?z(E):A(E)}function P(E){return lt(E)?(t.consume(E),h):n(E)}function h(E){return E===45||Je(E)?(t.consume(E),h):M(E)}function M(E){return ae(E)?(s=M,Q(E)):_e(E)?(t.consume(E),M):z(E)}function y(E){return E===45||Je(E)?(t.consume(E),y):E===47||E===62||Ye(E)?g(E):n(E)}function g(E){return E===47?(t.consume(E),z):E===58||E===95||lt(E)?(t.consume(E),m):ae(E)?(s=g,Q(E)):_e(E)?(t.consume(E),g):z(E)}function m(E){return E===45||E===46||E===58||E===95||Je(E)?(t.consume(E),m):k(E)}function k(E){return E===61?(t.consume(E),_):ae(E)?(s=k,Q(E)):_e(E)?(t.consume(E),k):g(E)}function _(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(t.consume(E),i=E,F):ae(E)?(s=_,Q(E)):_e(E)?(t.consume(E),_):(t.consume(E),j)}function F(E){return E===i?(t.consume(E),i=void 0,D):E===null?n(E):ae(E)?(s=F,Q(E)):(t.consume(E),F)}function j(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||Ye(E)?g(E):(t.consume(E),j)}function D(E){return E===47||E===62||Ye(E)?g(E):n(E)}function z(E){return E===62?(t.consume(E),t.exit("htmlTextData"),t.exit("htmlText"),e):n(E)}function Q(E){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),Z}function Z(E){return _e(E)?Ce(t,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):K(E)}function K(E){return t.enter("htmlTextData"),s(E)}}const Ti={name:"labelEnd",resolveAll:Yh,resolveTo:Kh,tokenize:Wh},Gh={tokenize:Xh},$h={tokenize:Qh},qh={tokenize:Zh};function Yh(t){let e=-1;const n=[];for(;++e=3&&(u===null||ae(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),_e(u)?Ce(t,a,"whitespace")(u):a(u))}}const qe={continuation:{tokenize:lm},exit:cm,name:"list",tokenize:am},om={partial:!0,tokenize:fm},sm={partial:!0,tokenize:um};function am(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const b=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Wr(d)){if(r.containerState.type||(r.containerState.type=b,t.enter(b,{_container:!0})),b==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Dn,n,u)(d):u(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return Wr(d)&&++s<10?(t.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),u(d)):n(d)}function u(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(Zn,r.interrupt?n:c,t.attempt(om,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return _e(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function lm(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Zn,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!_e(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(sm,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(qe,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function um(t,e,n){const r=this;return Ce(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function cm(t){t.exit(this.containerState.type)}function fm(t,e,n){const r=this;return Ce(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!_e(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Po={name:"setextUnderline",resolveTo:dm,tokenize:pm};function dm(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function pm(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return t.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(t.consume(u),a):(t.exit("setextHeadingLineSequence"),_e(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ae(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const hm={tokenize:mm};function mm(t){const e=this,n=t.attempt(Zn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(bh,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const gm={resolveAll:pa()},ym=da("string"),xm=da("text");function da(t){return{resolveAll:pa(t==="text"?vm:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function Nm(t,e){let n=-1;const r=[];let i;for(;++n0){const He=oe.tokenStack[oe.tokenStack.length-1];(He[1]||zo).call(oe,void 0,He[0])}for(K.position={start:Tt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Tt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function Wm(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Xm(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ga(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Qm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ga(t,e);const i={src:Qt(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,o),t.applyData(e,o)}function Zm(t,e){const n={src:Qt(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Jm(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function eg(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ga(t,e);const i={href:Qt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function tg(t,e){const n={href:Qt(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function ng(t,e,n){const r=t.all(e),i=n?rg(n):ya(e),o={},s=[];if(typeof e.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a0){const He=oe.tokenStack[oe.tokenStack.length-1];(He[1]||zo).call(oe,void 0,He[0])}for(W.position={start:Tt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Tt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function Wm(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Xm(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ga(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Qm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ga(t,e);const i={src:Zt(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,o),t.applyData(e,o)}function Zm(t,e){const n={src:Zt(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Jm(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function eg(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ga(t,e);const i={href:Zt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function tg(t,e){const n={href:Zt(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function ng(t,e,n){const r=t.all(e),i=n?rg(n):ya(e),o={},s=[];if(typeof e.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function ig(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function lg(t){const e=va(t),n=xa(t);if(e&&n)return{start:e,end:n}}function ug(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=va(e.children[1]),l=xa(e.children[e.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function cg(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(jo(e.slice(i),i>0,!1)),o.join("")}function jo(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===Bo||o===Uo;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===Bo||o===Uo;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function pg(t,e){const n={type:"text",value:dg(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function hg(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const mg={blockquote:Hm,break:$m,code:Gm,delete:qm,emphasis:Ym,footnoteReference:Km,heading:Wm,html:Xm,imageReference:Qm,image:Zm,inlineCode:Jm,linkReference:eg,link:tg,listItem:ng,list:ig,paragraph:og,root:sg,strong:ag,table:ug,tableCell:fg,tableRow:cg,text:pg,thematicBreak:hg,toml:Rn,yaml:Rn,definition:Rn,footnoteDefinition:Rn};function Rn(){}const wa=-1,Zn=0,Vn=1,Hn=2,ki=3,Ai=4,_i=5,Ei=6,Ta=7,ka=8,Vo=typeof self=="object"?self:globalThis,gg=(t,e)=>{const n=(i,o)=>(t.set(o,i),i),r=i=>{if(t.has(i))return t.get(i);const[o,s]=e[i];switch(o){case Zn:case wa:return n(s,i);case Vn:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Hn:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case ki:return n(new Date(s),i);case Ai:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case _i:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case Ei:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case Ta:{const{name:a,message:l}=s;return n(new Vo[a](l),i)}case ka:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new Vo[o](s),i)};return r},Ho=t=>gg(new Map,t)(0),jt="",{toString:yg}={},{keys:xg}=Object,sn=t=>{const e=typeof t;if(e!=="object"||!t)return[Zn,e];const n=yg.call(t).slice(8,-1);switch(n){case"Array":return[Vn,jt];case"Object":return[Hn,jt];case"Date":return[ki,jt];case"RegExp":return[Ai,jt];case"Map":return[_i,jt];case"Set":return[Ei,jt]}return n.includes("Array")?[Vn,n]:n.includes("Error")?[Ta,n]:[Hn,n]},Cn=([t,e])=>t===Zn&&(e==="function"||e==="symbol"),vg=(t,e,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=sn(s);switch(a){case Zn:{let c=s;switch(l){case"bigint":a=ka,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([wa],s)}return i([a,c],s)}case Vn:{if(l)return i([l,[...s]],s);const c=[],f=i([a,c],s);for(const p of s)c.push(o(p));return f}case Hn:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const c=[],f=i([a,c],s);for(const p of xg(s))(t||!Cn(sn(s[p])))&&c.push([o(p),o(s[p])]);return f}case ki:return i([a,s.toISOString()],s);case Ai:{const{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case _i:{const c=[],f=i([a,c],s);for(const[p,d]of s)(t||!(Cn(sn(p))||Cn(sn(d))))&&c.push([o(p),o(d)]);return f}case Ei:{const c=[],f=i([a,c],s);for(const p of s)(t||!Cn(sn(p)))&&c.push(o(p));return f}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},$o=(t,{json:e,lossy:n}={})=>{const r=[];return vg(!(e||n),!!e,new Map,r)(t),r},$n=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Ho($o(t,e)):structuredClone(t):(t,e)=>Ho($o(t,e));function bg(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function wg(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Tg(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||bg,r=t.options.footnoteBackLabel||wg,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l0&&g.push({type:"text",value:" "});let I=typeof n=="string"?n:n(l,d);typeof I=="string"&&(I={type:"text",value:I}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const I=v.children[v.children.length-1];I&&I.type==="text"?I.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else c.push(...g);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$n(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:o,children:s};return t.patch(e,u),t.applyData(e,u)}function rg(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r1}function ig(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function lg(t){const e=va(t),n=xa(t);if(e&&n)return{start:e,end:n}}function ug(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=va(e.children[1]),l=xa(e.children[e.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function cg(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(jo(e.slice(i),i>0,!1)),o.join("")}function jo(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===Bo||o===Uo;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===Bo||o===Uo;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function pg(t,e){const n={type:"text",value:dg(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function hg(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const mg={blockquote:Hm,break:Gm,code:$m,delete:qm,emphasis:Ym,footnoteReference:Km,heading:Wm,html:Xm,imageReference:Qm,image:Zm,inlineCode:Jm,linkReference:eg,link:tg,listItem:ng,list:ig,paragraph:og,root:sg,strong:ag,table:ug,tableCell:fg,tableRow:cg,text:pg,thematicBreak:hg,toml:Cn,yaml:Cn,definition:Cn,footnoteDefinition:Cn};function Cn(){}const wa=-1,Jn=0,Hn=1,Gn=2,ki=3,Ai=4,_i=5,Ei=6,Ta=7,ka=8,Vo=typeof self=="object"?self:globalThis,gg=(t,e)=>{const n=(i,o)=>(t.set(o,i),i),r=i=>{if(t.has(i))return t.get(i);const[o,s]=e[i];switch(o){case Jn:case wa:return n(s,i);case Hn:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Gn:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case ki:return n(new Date(s),i);case Ai:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case _i:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case Ei:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case Ta:{const{name:a,message:l}=s;return n(new Vo[a](l),i)}case ka:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new Vo[o](s),i)};return r},Ho=t=>gg(new Map,t)(0),Vt="",{toString:yg}={},{keys:xg}=Object,an=t=>{const e=typeof t;if(e!=="object"||!t)return[Jn,e];const n=yg.call(t).slice(8,-1);switch(n){case"Array":return[Hn,Vt];case"Object":return[Gn,Vt];case"Date":return[ki,Vt];case"RegExp":return[Ai,Vt];case"Map":return[_i,Vt];case"Set":return[Ei,Vt]}return n.includes("Array")?[Hn,n]:n.includes("Error")?[Ta,n]:[Gn,n]},Nn=([t,e])=>t===Jn&&(e==="function"||e==="symbol"),vg=(t,e,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=an(s);switch(a){case Jn:{let c=s;switch(l){case"bigint":a=ka,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([wa],s)}return i([a,c],s)}case Hn:{if(l)return i([l,[...s]],s);const c=[],f=i([a,c],s);for(const p of s)c.push(o(p));return f}case Gn:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const c=[],f=i([a,c],s);for(const p of xg(s))(t||!Nn(an(s[p])))&&c.push([o(p),o(s[p])]);return f}case ki:return i([a,s.toISOString()],s);case Ai:{const{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case _i:{const c=[],f=i([a,c],s);for(const[p,d]of s)(t||!(Nn(an(p))||Nn(an(d))))&&c.push([o(p),o(d)]);return f}case Ei:{const c=[],f=i([a,c],s);for(const p of s)(t||!Nn(an(p)))&&c.push(o(p));return f}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},Go=(t,{json:e,lossy:n}={})=>{const r=[];return vg(!(e||n),!!e,new Map,r)(t),r},$n=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Ho(Go(t,e)):structuredClone(t):(t,e)=>Ho(Go(t,e));function bg(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function wg(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Tg(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||bg,r=t.options.footnoteBackLabel||wg,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l0&&b.push({type:"text",value:" "});let I=typeof n=="string"?n:n(l,d);typeof I=="string"&&(I={type:"text",value:I}),b.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const I=v.children[v.children.length-1];I&&I.type==="text"?I.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...b)}else c.push(...b);const T={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,T),a.push(T)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$n(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:` -`}]}}const Aa=function(t){if(t==null)return Eg;if(typeof t=="function")return Jn(t);if(typeof t=="object")return Array.isArray(t)?kg(t):Ag(t);if(typeof t=="string")return _g(t);throw new Error("Expected function, string, or object as test")};function kg(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let d=_a,g,k,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=Cg(n(l,c)),d[0]===Go))return d;if("children"in l&&l.children){const w=l;if(w.children&&d[0]!==Ig)for(k=(r?w.children.length:-1)+s,v=c.concat(w);k>-1&&k":""))+")"})}return p;function p(){let d=_a,b,x,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=Cg(n(l,c)),d[0]===$o))return d;if("children"in l&&l.children){const T=l;if(T.children&&d[0]!==Ig)for(x=(r?T.children.length:-1)+s,v=c.concat(T);x>-1&&x0&&n.push({type:"text",value:` `}),n}function qo(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Yo(t,e){const n=Pg(t,e),r=n.one(t,void 0),i=Tg(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function Bg(t,e){return t&&"run"in t?async function(n,r){const i=Yo(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Yo(n,{file:r,...t||e})}}function Ko(t){if(t)throw t}var _r,Wo;function Ug(){if(Wo)return _r;Wo=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},o=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var p;for(p in u);return typeof p>"u"||t.call(u,p)},s=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},a=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return _r=function l(){var u,c,f,p,d,g,k=arguments[0],v=1,w=arguments.length,I=!1;for(typeof k=="boolean"&&(I=k,k=arguments[1]||{},v=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});vs.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}class We extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=cn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const at={basename:$g,dirname:Gg,extname:qg,join:Yg,sep:"/"};function $g(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');bn(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function Gg(t){if(bn(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function qg(t){bn(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.codePointAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Yg(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Wg(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function bn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Xg={cwd:Qg};function Qg(){return"/"}function Jr(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Zg(t){if(typeof t=="string")t=new URL(t);else if(!Jr(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Jg(t)}function Jg(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[d,...g]=c;const k=r[p][1];Zr(k)&&Zr(d)&&(d=Er(!0,k,d)),r[p]=[u,d,...g]}}}}const iy=new Mi().freeze();function Rr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Cr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Nr(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Qo(t){if(!Zr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Zo(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Nn(t){return oy(t)?t:new ey(t)}function oy(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function sy(t){return typeof t=="string"||ay(t)}function ay(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function Si(){const t=iy().use(Vm).use(Bg).use(Dp);return{process:e=>t.processSync(e).toString()}}const ly={relative:""},uy={"h-full":"","w-full":""},cy={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"primary-600","px-2":"","py-2":"",transform:"translate-x--1/2"},fy={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},dy=["innerHTML"],py=Fe({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=W(),n=W(),{stageView:r}=rt(dn()),{mouthOpenSize:i}=rt(lu()),{audioContext:o,calculateVolume:s}=bs(),{onBeforeMessageComposed:a,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=Mt(),{process:g}=Si(),k=di(),v=W(),w=W(!1),I=W(!1),E=or({handlers:[Y=>new Promise(_=>{const te=o.createBufferSource();te.buffer=Y.data.audioBuffer,te.connect(o.destination),te.connect(v.value),w.value=!0,te.start(0),te.onended=()=>{w.value=!1,_()}})]}),R=eu(),{voiceId:P,ssmlEnabled:h,activeSpeechProvider:M,activeSpeechModel:x}=rt(R);async function y(Y){try{if(!M.value){console.warn("No active speech provider configured");return}const _=k.getProviderInstance(M.value);if(!_){console.error("Failed to initialize speech provider");return}const te=await $l({..._.speech(x.value,{...h.value&&{input:R.generateSSML(Y.data)},voiceSettings:{stability:.4,similarityBoost:.5}}),input:Y.data,voice:P.value}),me=await o.decodeAudioData(te);await E.add({audioBuffer:me,text:Y.data})}catch(_){console.error("Speech generation failed:",_)}}const m=or({handlers:[y]});m.on("add",Y=>{console.debug("ttsQueue added",Y)});const T=Gl(m),{live2dCurrentMotion:A}=rt(dn()),F=or({handlers:[async Y=>{if(r.value==="3d"){const _=Ba[Y.data];if(!_)return;await n.value.setExpression(_)}else r.value==="2d"&&(A.value={group:Ua[Y.data]})}]}),j=ql(F);j.onHandlerEvent("emotion",Y=>{console.debug("emotion detected",Y)});const D=Yl();D.onHandlerEvent("delay",Y=>{console.debug("delay detected",Y)});function z(){requestAnimationFrame(z),w.value&&(i.value=s(v.value,"linear"))}function Q(){I.value||(z(),o.resume(),I.value=!0)}function Z(){v.value||(v.value=o.createAnalyser())}return a(async()=>{Z(),Q()}),l(async()=>{A.value={group:Ci}}),u(async Y=>{await T.add(Y)}),c(async Y=>{await D.add(Y),await j.add(Y)}),f(async()=>{await D.add(Kl)}),d(async Y=>{}),Dt(()=>{var _,te,me;I.value=!1;const Y=window;(_=Y.electron)==null||_.ipcRenderer.removeAllListeners("before-hide"),(te=Y.electron)==null||te.ipcRenderer.removeAllListeners("after-show"),(me=Y.electron)==null||me.ipcRenderer.removeAllListeners("before-quit")}),fn(()=>{var _,te,me;const Y=window;(_=Y.electron)==null||_.ipcRenderer.on("before-hide",()=>{A.value={group:Oa}}),(te=Y.electron)==null||te.ipcRenderer.on("after-show",()=>{A.value={group:Da}}),(me=Y.electron)==null||me.ipcRenderer.on("before-quit",()=>{A.value={group:Ci}})}),fn(async()=>{e.value=Fa("duckdb-wasm://?bundles=import-url"),await e.value.execute(za`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(Y,_)=>(ee(),ie("div",ly,[O("div",uy,[X(r)==="2d"?(ee(),Wt(_u,{key:0,"mouth-open-size":X(i),"min-w":"50% (ee(),ie("header",vy,[O("div",by,[Te(ru)]),Te(X(Dl),{class:"m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-zinc-100 p-2 text-lg text-zinc-500 outline-none dark:bg-zinc-800 dark:text-zinc-400",to:"/settings"},{default:Be(()=>n[0]||(n[0]=[O("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1})]))}});function Ea(t,e){const n=ms(e??{},{...Bi.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=Fl("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const s=X(t);if(!s)return;const a=await navigator.mediaDevices.getUserMedia({audio:{deviceId:s}});r.value=await Bi.MicVAD.new({...n,stream:a}),n.auto&&r.value.start()}return je(i,o,{immediate:!0}),je(zl(t),o,{immediate:!0}),Bl(o),Dt(()=>{r.value&&(r.value.destroy(),r.value=void 0)}),{destroy:()=>{r.value&&(r.value.destroy(),r.value=void 0)},start:()=>{r.value&&r.value.start()}}}function Ty(t,e){const n=ms(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=Ul(t,{type:"module"}),s=W(null),a=W(""),l=W([]),u=W(!1),c=W(0),f=W("");return je(i,p=>{var d,g,k,v,w,I,E,R;switch(p.status){case"loading":s.value="loading",a.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(g=n.onInitiate)==null||g.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(k=n.onProgress)==null||k.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":s.value="ready",(w=n.onReady)==null||w.call(n);break;case"start":u.value=!0,(I=n.onStart)==null||I.call(n);break;case"update":c.value=p.tps,(E=n.onUpdate)==null||E.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(R=n.onComplete)==null||R.call(n,p.output[0]);break}}),Dt(()=>{o()}),{transcribe:p=>r(p),status:s,loadingMessage:a,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const ky="/assets/worker-KF4IHpL4.js";async function Ay(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Ln(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Ln(r,8,"WAVE"),Ln(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,e,!0),r.setUint32(28,e*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),Ln(r,36,"data"),r.setUint32(40,t.length*2,!0),_y(r,44,t);const i=new Blob([r],{type:"audio/wav"});return new Promise((o,s)=>{const a=new FileReader;a.onload=()=>{const l=a.result.split(",")[1];o(l)},a.onerror=s,a.readAsDataURL(i)})}function Ln(t,e,n){for(let r=0;r{jn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ys("auto-animate");return ee(),ie("div",Ey,[c[2]||(c[2]=O("div",{"flex-1":""},null,-1)),At((ee(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[c[1]||(c[1]=O("div",{"flex-1":""},null,-1)),(ee(!0),ie(ci,null,fi(X(n),(p,d)=>(ee(),ie("div",{key:d,"mb-2":""},[p.role==="error"?(ee(),ie("div",My,[O("div",Sy,[O("div",Iy,[O("div",Ry,[O("span",Cy,he(u.$t("stage.chat.message.character-name.core-system")),1)]),c[0]||(c[0]=O("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),X(r)?(ee(),ie("div",Ny)):(ee(),ie("div",{key:1,class:"markdown-content text-violet-500",text:"base {if(!T||!T.trim())return;const A=o.getProviderConfig(s.value);await p(T,{chatProvider:o.getProviderInstance(s.value),model:a.value,providerConfig:A})}});async function P(){if(e.value.trim())try{const T=o.getProviderConfig(s.value);await p(e.value,{chatProvider:o.getProviderInstance(s.value),model:a.value,providerConfig:T})}catch(T){g.value.pop(),g.value.push({role:"error",content:T.message})}}const{destroy:h,start:M}=Ea(f,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:T=>{n.value=!1,y(T)},auto:!1});function x(){E.value!=="loading"&&(I(),M())}async function y(T){await k.resume();const A=await Ay(T,k.sampleRate);w({type:"generate",data:{audio:A,language:"en"}})}async function m(T){const A=T.target,F=l.value.find(j=>j.deviceId===A.value);if(!F){u.value=void 0;return}u.value=F}return je(c,async T=>{T==="false"&&(h(),R())}),d(async()=>{e.value=""}),(T,A)=>(ee(),ie("div",Gy,[O("fieldset",qy,[O("label",{class:Ct([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":""]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[At(O("input",{"onUpdate:modelValue":A[0]||(A[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ir,r.value]]),A[5]||(A[5]=O("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",Ky,[O("span",Wy,he(T.$t("stage.chat.tabs.chat")),1)])],10,Yy),O("label",{class:Ct([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":""]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[At(O("input",{"onUpdate:modelValue":A[1]||(A[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ir,r.value]]),A[6]||(A[6]=O("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",Qy,[O("span",null,he(T.$t("stage.chat.tabs.custom")),1)])],10,Xy),O("label",{class:Ct([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":""]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[At(O("input",{"onUpdate:modelValue":A[2]||(A[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ir,r.value]]),A[7]||(A[7]=O("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",Jy,[O("span",null,he(T.$t("stage.chat.tabs.clothes")),1)])],10,Zy)]),O("div",e0,[O("div",t0,[Te($y,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:X(v)("stage.message"),text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","min-h":"[100px]","max-h":"[300px]","w-full":"","rounded-t-xl":"","p-4":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",onSubmit:P},null,8,["modelValue","placeholder"])])])]),O("div",r0,[O("button",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:x},[Te(Vl,{mode:"out-in"},{default:Be(()=>[X(E)===null?(ee(),ie("div",i0,he(T.$t("stage.operations.load-models")),1)):X(E)==="loading"?(ee(),ie("div",o0,[A[8]||(A[8]=O("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),O("span",null,he(T.$t("stage.operations.load-models-status.loading")),1)])):X(E)==="ready"?(ee(),ie("div",s0,[A[9]||(A[9]=O("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),O("span",null,he(T.$t("stage.operations.load-models-status.ready")),1)])):it("",!0)]),_:1})]),O("div",a0,[Te(X(pi),null,{default:Be(()=>[i.value?(ee(),ie("fieldset",l0,[(ee(!0),ie(ci,null,fi(X(l),(F,j)=>(ee(),ie("label",{key:j,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[O("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:m},null,40,u0),O("div",c0,[O("div",f0,[F.deviceId===X(f)?(ee(),ie("div",d0)):it("",!0)]),O("span",{"inline-block":"",class:Ct([F.deviceId===X(f)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},he(F.label),3)])]))),128))])):it("",!0)]),_:1}),O("label",p0,[At(O("input",{"onUpdate:modelValue":A[4]||(A[4]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[ni,i.value]]),A[10]||(A[10]=O("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),O("div",null,[n.value?(ee(),ie("span",m0,"Listening...")):(ee(),ie("span",h0,he(T.$t("settings.microphone")),1))])])])])]))}}),y0=Kn(g0,[["__scopeId","data-v-2ecc8612"]]),x0={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},v0={key:0,flex:"",mr:"12"},b0={flex:"~ col",border:"4 solid primary-200/50 dark:primary-500/50",shadow:"md primary-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {jn().then(()=>{r.update(),i.value=r.height.value})}),a(async()=>{jn().then(()=>{r.update(),i.value=r.height.value})}),(l,u)=>{const c=ys("auto-animate");return ee(),ie("div",x0,[u[1]||(u[1]=O("div",{"flex-1":""},null,-1)),At((ee(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[u[0]||(u[0]=O("div",{"flex-1":""},null,-1)),(ee(!0),ie(ci,null,fi(X(n),(f,p)=>(ee(),ie("div",{key:p,"mb-2":""},[f.role==="assistant"?(ee(),ie("div",v0,[O("div",b0,[O("div",null,[O("span",w0,he(l.$t("stage.chat.message.character-name.airi")),1)]),f.content?(ee(),ie("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:k=>{n.value=!1,g()},auto:!1});function g(k){alert("Transcription is not implemented yet")}return je(s,async k=>{k==="false"&&p()}),u(async()=>{e.value=""}),fn(()=>{d()}),(k,v)=>(ee(),ie("div",null,[O("div",R0,[Te(I0,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),O("div",C0,[Te(X(xs),{modelValue:e.value,"onUpdate:modelValue":v[0]||(v[0]=w=>e.value=w),placeholder:X(c)("stage.message"),border:"solid 2 primary-100 dark:primary-400/20",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",onSubmit:f},null,8,["modelValue","placeholder"])])])]))}}),L0={class:"relative"},P0={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},O0=Fe({__name:"AnimatedWave",props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"oklch(95% 0.10 var(--theme-colors-hue))"},direction:{default:"down"},movementDirection:{default:"left"},animationSpeed:{default:50}},setup(t){const e=t,n=W(e.height),r=W(e.amplitude),i=W(e.waveLength),o=W(e.fillColor),s=W(e.direction),a=W(e.movementDirection);function l(f,p,d,g,k){const v=[],I=Math.ceil(f/g)*g,E=1,R=k==="up"?d:p-d;v.push(`M 0 ${R}`);const P=Math.PI*2/g;for(let M=0;M<=I;M+=E){const x=d*Math.sin(P*M),y=k==="up"?R-x:R+x;v.push(`L ${M} ${y}`)}const h=k==="up"?p:0;return v.push(`L ${I} ${h}`),v.push(`L 0 ${h} Z`),v.join(" ")}const u=Ue(()=>n.value+r.value*2),c=Ue(()=>{const f=` +`},i),o}function Bg(t,e){return t&&"run"in t?async function(n,r){const i=Yo(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Yo(n,{file:r,...t||e})}}function Ko(t){if(t)throw t}var Er,Wo;function Ug(){if(Wo)return Er;Wo=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},o=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var p;for(p in u);return typeof p>"u"||t.call(u,p)},s=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},a=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return Er=function l(){var u,c,f,p,d,b,x=arguments[0],v=1,T=arguments.length,I=!1;for(typeof x=="boolean"&&(I=x,x=arguments[1]||{},v=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});vs.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}class We extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=fn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const at={basename:Gg,dirname:$g,extname:qg,join:Yg,sep:"/"};function Gg(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');wn(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function $g(t){if(wn(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function qg(t){wn(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.codePointAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Yg(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Wg(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function wn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Xg={cwd:Qg};function Qg(){return"/"}function ei(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Zg(t){if(typeof t=="string")t=new URL(t);else if(!ei(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Jg(t)}function Jg(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[d,...b]=c;const x=r[p][1];Jr(x)&&Jr(d)&&(d=Mr(!0,x,d)),r[p]=[u,d,...b]}}}}const iy=new Mi().freeze();function Cr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Nr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Lr(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Qo(t){if(!Jr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Zo(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Ln(t){return oy(t)?t:new ey(t)}function oy(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function sy(t){return typeof t=="string"||ay(t)}function ay(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function Si(){const t=iy().use(Vm).use(Bg).use(Dp);return{process:e=>t.processSync(e).toString()}}const ly={relative:""},uy={"h-full":"","w-full":""},cy={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"primary-600","px-2":"","py-2":"",transform:"translate-x--1/2"},fy={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},dy=["innerHTML"],py=Fe({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=X(),n=X(),{stageView:r}=rt(pn()),{mouthOpenSize:i}=rt(lu()),{audioContext:o,calculateVolume:s}=bs(),{onBeforeMessageComposed:a,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=Mt(),{process:b}=Si(),x=di(),v=X(),T=X(!1),I=X(!1),A=sr({handlers:[K=>new Promise(E=>{const te=o.createBufferSource();te.buffer=K.data.audioBuffer,te.connect(o.destination),te.connect(v.value),T.value=!0,te.start(0),te.onended=()=>{T.value=!1,E()}})]}),R=eu(),{voiceId:P,ssmlEnabled:h,activeSpeechProvider:M,activeSpeechModel:y}=rt(R);async function g(K){try{if(!M.value){console.warn("No active speech provider configured");return}const E=x.getProviderInstance(M.value);if(!E){console.error("Failed to initialize speech provider");return}const te=await Gl({...E.speech(y.value,{...h.value&&{input:R.generateSSML(K.data)},voiceSettings:{stability:.4,similarityBoost:.5}}),input:K.data,voice:P.value}),me=await o.decodeAudioData(te);await A.add({audioBuffer:me,text:K.data})}catch(E){console.error("Speech generation failed:",E)}}const m=sr({handlers:[g]});m.on("add",K=>{console.debug("ttsQueue added",K)});const k=$l(m),{live2dCurrentMotion:_}=rt(pn()),F=sr({handlers:[async K=>{if(r.value==="3d"){const E=Ba[K.data];if(!E)return;await n.value.setExpression(E)}else r.value==="2d"&&(_.value={group:Ua[K.data]})}]}),j=ql(F);j.onHandlerEvent("emotion",K=>{console.debug("emotion detected",K)});const D=Yl();D.onHandlerEvent("delay",K=>{console.debug("delay detected",K)});function z(){requestAnimationFrame(z),T.value&&(i.value=s(v.value,"linear"))}function Q(){I.value||(z(),o.resume(),I.value=!0)}function Z(){v.value||(v.value=o.createAnalyser())}return a(async()=>{Z(),Q()}),l(async()=>{_.value={group:Ci}}),u(async K=>{await k.add(K)}),c(async K=>{await D.add(K),await j.add(K)}),f(async()=>{await D.add(Kl)}),d(async K=>{}),Ft(()=>{var E,te,me;I.value=!1;const K=window;(E=K.electron)==null||E.ipcRenderer.removeAllListeners("before-hide"),(te=K.electron)==null||te.ipcRenderer.removeAllListeners("after-show"),(me=K.electron)==null||me.ipcRenderer.removeAllListeners("before-quit")}),dn(()=>{var E,te,me;const K=window;(E=K.electron)==null||E.ipcRenderer.on("before-hide",()=>{_.value={group:Oa}}),(te=K.electron)==null||te.ipcRenderer.on("after-show",()=>{_.value={group:Da}}),(me=K.electron)==null||me.ipcRenderer.on("before-quit",()=>{_.value={group:Ci}})}),dn(async()=>{e.value=Fa("duckdb-wasm://?bundles=import-url"),await e.value.execute(za`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(K,E)=>(ee(),ie("div",ly,[O("div",uy,[H(r)==="2d"?(ee(),Xt(_u,{key:0,"mouth-open-size":H(i),"min-w":"50% (ee(),ie("header",vy,[O("div",by,[Te(ru)]),Te(H(Dl),{class:"m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-zinc-100 p-2 text-lg text-zinc-500 outline-none dark:bg-zinc-800 dark:text-zinc-400",to:"/settings"},{default:Be(()=>n[0]||(n[0]=[O("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1})]))}});function Ea(t,e){const n=ms(e??{},{...Bi.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=X(),i=Fl("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const s=H(t);if(!s)return;const a=await navigator.mediaDevices.getUserMedia({audio:{deviceId:s}});r.value=await Bi.MicVAD.new({...n,stream:a}),n.auto&&r.value.start()}return je(i,o,{immediate:!0}),je(zl(t),o,{immediate:!0}),Bl(o),Ft(()=>{r.value&&(r.value.destroy(),r.value=void 0)}),{destroy:()=>{r.value&&(r.value.destroy(),r.value=void 0)},start:()=>{r.value&&r.value.start()}}}function Ty(t,e){const n=ms(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=Ul(t,{type:"module"}),s=X(null),a=X(""),l=X([]),u=X(!1),c=X(0),f=X("");return je(i,p=>{var d,b,x,v,T,I,A,R;switch(p.status){case"loading":s.value="loading",a.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(b=n.onInitiate)==null||b.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(x=n.onProgress)==null||x.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":s.value="ready",(T=n.onReady)==null||T.call(n);break;case"start":u.value=!0,(I=n.onStart)==null||I.call(n);break;case"update":c.value=p.tps,(A=n.onUpdate)==null||A.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(R=n.onComplete)==null||R.call(n,p.output[0]);break}}),Ft(()=>{o()}),{transcribe:p=>r(p),status:s,loadingMessage:a,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const ky="/assets/worker-KF4IHpL4.js";async function Ay(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Pn(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Pn(r,8,"WAVE"),Pn(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,e,!0),r.setUint32(28,e*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),Pn(r,36,"data"),r.setUint32(40,t.length*2,!0),_y(r,44,t);const i=new Blob([r],{type:"audio/wav"});return new Promise((o,s)=>{const a=new FileReader;a.onload=()=>{const l=a.result.split(",")[1];o(l)},a.onerror=s,a.readAsDataURL(i)})}function Pn(t,e,n){for(let r=0;r{Vn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{Vn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ys("auto-animate");return ee(),ie("div",Ey,[f[2]||(f[2]=O("div",{"flex-1":""},null,-1)),At((ee(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=O("div",{"flex-1":""},null,-1)),(ee(!0),ie(ci,null,fi(H(n),(d,b)=>(ee(),ie("div",{key:b,"mb-2":""},[d.role==="error"?(ee(),ie("div",My,[O("div",Sy,[O("div",Iy,[O("div",Ry,[O("span",Cy,he(H(s)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=O("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),H(r)?(ee(),ie("div",Ny)):(ee(),ie("div",{key:1,class:"markdown-content text-violet-500",text:"base {if(!k||!k.trim())return;const _=o.getProviderConfig(s.value);await p(k,{chatProvider:o.getProviderInstance(s.value),model:a.value,providerConfig:_})}});async function P(){if(e.value.trim())try{const k=o.getProviderConfig(s.value);await p(e.value,{chatProvider:o.getProviderInstance(s.value),model:a.value,providerConfig:k})}catch(k){b.value.pop(),b.value.push({role:"error",content:k.message})}}const{destroy:h,start:M}=Ea(f,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:k=>{n.value=!1,g(k)},auto:!1});function y(){A.value!=="loading"&&(I(),M())}async function g(k){await x.resume();const _=await Ay(k,x.sampleRate);T({type:"generate",data:{audio:_,language:"en"}})}async function m(k){const _=k.target,F=l.value.find(j=>j.deviceId===_.value);if(!F){u.value=void 0;return}u.value=F}return je(c,async k=>{k==="false"&&(h(),R())}),d(async()=>{e.value=""}),(k,_)=>(ee(),ie("div",$y,[O("fieldset",qy,[O("label",{class:Ct([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":""]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[At(O("input",{"onUpdate:modelValue":_[0]||(_[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[or,r.value]]),_[5]||(_[5]=O("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",Ky,[O("span",Wy,he(H(v)("stage.chat.tabs.chat")),1)])],10,Yy),O("label",{class:Ct([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":""]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[At(O("input",{"onUpdate:modelValue":_[1]||(_[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[or,r.value]]),_[6]||(_[6]=O("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",Qy,[O("span",null,he(H(v)("stage.chat.tabs.custom")),1)])],10,Xy),O("label",{class:Ct([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":""]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[At(O("input",{"onUpdate:modelValue":_[2]||(_[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[or,r.value]]),_[7]||(_[7]=O("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",Jy,[O("span",null,he(H(v)("stage.chat.tabs.clothes")),1)])],10,Zy)]),O("div",e0,[O("div",t0,[Te(Gy,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:H(v)("stage.message"),text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","min-h":"[100px]","max-h":"[300px]","w-full":"","rounded-t-xl":"","p-4":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",onSubmit:P},null,8,["modelValue","placeholder"])])])]),O("div",r0,[O("button",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:y},[Te(Vl,{mode:"out-in"},{default:Be(()=>[H(A)===null?(ee(),ie("div",i0,he(H(v)("stage.operations.load-models")),1)):H(A)==="loading"?(ee(),ie("div",o0,[_[8]||(_[8]=O("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),O("span",null,he(H(v)("stage.operations.load-models-status.loading")),1)])):H(A)==="ready"?(ee(),ie("div",s0,[_[9]||(_[9]=O("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),O("span",null,he(H(v)("stage.operations.load-models-status.ready")),1)])):it("",!0)]),_:1})]),O("div",a0,[Te(H(pi),null,{default:Be(()=>[i.value?(ee(),ie("fieldset",l0,[(ee(!0),ie(ci,null,fi(H(l),(F,j)=>(ee(),ie("label",{key:j,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[O("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:m},null,40,u0),O("div",c0,[O("div",f0,[F.deviceId===H(f)?(ee(),ie("div",d0)):it("",!0)]),O("span",{"inline-block":"",class:Ct([F.deviceId===H(f)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},he(F.label),3)])]))),128))])):it("",!0)]),_:1}),O("label",p0,[At(O("input",{"onUpdate:modelValue":_[4]||(_[4]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[ni,i.value]]),_[10]||(_[10]=O("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),O("div",null,[n.value?(ee(),ie("span",m0,"Listening...")):(ee(),ie("span",h0,he(H(v)("settings.microphone")),1))])])])])]))}}),y0=Wn(g0,[["__scopeId","data-v-808bb58d"]]),x0={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},v0={key:0,flex:"",mr:"12"},b0={flex:"~ col",border:"4 solid primary-200/50 dark:primary-500/50",shadow:"md primary-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {Vn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{Vn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ys("auto-animate");return ee(),ie("div",x0,[c[1]||(c[1]=O("div",{"flex-1":""},null,-1)),At((ee(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[c[0]||(c[0]=O("div",{"flex-1":""},null,-1)),(ee(!0),ie(ci,null,fi(H(r),(p,d)=>(ee(),ie("div",{key:d,"mb-2":""},[p.role==="assistant"?(ee(),ie("div",v0,[O("div",b0,[O("div",null,[O("span",w0,he(H(n)("stage.chat.message.character-name.airi")),1)]),p.content?(ee(),ie("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:x=>{n.value=!1,b()},auto:!1});function b(x){alert("Transcription is not implemented yet")}return je(s,async x=>{x==="false"&&p()}),u(async()=>{e.value=""}),dn(()=>{d()}),(x,v)=>(ee(),ie("div",null,[O("div",R0,[Te(I0,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),O("div",C0,[Te(H(xs),{modelValue:e.value,"onUpdate:modelValue":v[0]||(v[0]=T=>e.value=T),placeholder:H(c)("stage.message"),border:"solid 2 primary-100 dark:primary-400/20",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",onSubmit:f},null,8,["modelValue","placeholder"])])])]))}}),L0={class:"relative"},P0={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},O0=Fe({__name:"AnimatedWave",props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"oklch(95% 0.10 var(--theme-colors-hue))"},direction:{default:"down"},movementDirection:{default:"left"},animationSpeed:{default:50}},setup(t){const e=t,n=X(e.height),r=X(e.amplitude),i=X(e.waveLength),o=X(e.fillColor),s=X(e.direction),a=X(e.movementDirection);function l(f,p,d,b,x){const v=[],I=Math.ceil(f/b)*b,A=1,R=x==="up"?d:p-d;v.push(`M 0 ${R}`);const P=Math.PI*2/b;for(let M=0;M<=I;M+=A){const y=d*Math.sin(P*M),g=x==="up"?R-y:R+y;v.push(`L ${M} ${g}`)}const h=x==="up"?p:0;return v.push(`L ${I} ${h}`),v.push(`L 0 ${h} Z`),v.join(" ")}const u=Ue(()=>n.value+r.value*2),c=Ue(()=>{const f=` - `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return je(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction,e.movementDirection],()=>{n.value=e.height,r.value=e.amplitude,i.value=e.waveLength,o.value=e.fillColor,s.value=e.direction,a.value=e.movementDirection},{immediate:!0}),(f,p)=>(ee(),ie("div",L0,[mn(f.$slots,"default",{},void 0,!0),O("div",P0,[O("div",{class:"wave",style:Dr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/t.animationSpeed}s`,"animation-direction":a.value==="left"?"normal":"reverse"})},null,4)])]))}}),D0=Kn(O0,[["__scopeId","data-v-d4cf94d8"]]),F0={relative:"",flex:"~ col","z-2":"","h-100vh":"","w-100vw":"","of-hidden":""},z0={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (ee(),Wt(xy,null,{default:Be(()=>[Te(D0,{"fill-color":X(e)?"oklch(35% calc(var(--theme-colors-chroma) * 0.6) var(--theme-colors-hue))":"color-mix(in srgb, oklch(95% calc(var(--theme-colors-chroma-50) * 0.5) var(--theme-colors-hue)) 80%, oklch(100% 0 360))"},{default:Be(()=>[O("div",F0,[O("div",null,[Te(wy,{class:"flex",p2:""})]),O("div",z0,[Te(X(hy),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),Te(y0,{class:"flex `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return je(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction,e.movementDirection],()=>{n.value=e.height,r.value=e.amplitude,i.value=e.waveLength,o.value=e.fillColor,s.value=e.direction,a.value=e.movementDirection},{immediate:!0}),(f,p)=>(ee(),ie("div",L0,[gn(f.$slots,"default",{},void 0,!0),O("div",P0,[O("div",{class:"wave",style:Fr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/t.animationSpeed}s`,"animation-direction":a.value==="left"?"normal":"reverse"})},null,4)])]))}}),D0=Wn(O0,[["__scopeId","data-v-d4cf94d8"]]),F0={relative:"",flex:"~ col","z-2":"","h-100vh":"","w-100vw":"","of-hidden":""},z0={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (ee(),Xt(xy,null,{default:Be(()=>[Te(D0,{"fill-color":H(e)?"oklch(35% calc(var(--theme-colors-chroma) * 0.6) var(--theme-colors-hue))":"color-mix(in srgb, oklch(95% calc(var(--theme-colors-chroma-50) * 0.5) var(--theme-colors-hue)) 80%, oklch(100% 0 360))"},{default:Be(()=>[O("div",F0,[O("div",null,[Te(wy,{class:"flex",p2:""})]),O("div",z0,[Te(H(hy),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),Te(y0,{class:"flex {const h=B("RouterLink");return o(),D(h,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-800",border:"neutral-100 dark:neutral-700 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:s.to},{default:m(()=>[e("div",E,[e("div",j,c(s.title),1),e("div",A,[e("span",null,c(s.description),1)])]),typeof s.icon=="string"?(o(),a("div",{key:0,class:I(["menu-icon-item-icon",[s.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)):x("",!0),s.iconTemplate?z(_.$slots,"icon",{key:1},void 0,!0):x("",!0)]),_:3},8,["to"])}}}),y=L(F,[["__scopeId","data-v-a1ec902c"]]),G={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},duration:100},P={flex:"~ col gap-4"},q={flex:"~ col gap-4"},H={initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:150},J={flex:"~ col gap-4"},K={grid:"~ cols-[150px_1fr]",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:200},O={text:"sm"},Q={flex:"~ row","w-full":"","justify-end":""},W={value:"en-US"},X={value:"zh-CN"},Y={bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","cursor-pointer":"","rounded-lg":"","px-4":"","py-3":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:250},Z=["checked","aria-checked"],ee={flex:"~ row","w-full":"","items-center":"","gap-1.5":""},te={text:"sm","w-full":"","flex-1":""},ne={"select-none":""},ie={key:0,"i-solar:moon-stars-bold-duotone":"",transition:"all ease-in-out duration-250"},oe={key:1,"i-solar:sun-fog-bold-duotone":"",transition:"all ease-in-out duration-250"},ae={bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","cursor-pointer":"","rounded-lg":"","px-4":"","py-3":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:300},le=["checked","aria-checked"],se={flex:"~ row","w-full":"","items-center":"","gap-1.5":""},re={"select-none":""},de={key:0,"i-solar:people-nearby-bold-duotone":"",transition:"all ease-in-out duration-250"},ue={key:1,"i-solar:running-2-line-duotone":"",transition:"all ease-in-out duration-250"},ce={text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},pe={text:"40","i-lucide:cog":""},ge=C({__name:"index",setup(s){const _=R(),{t:p}=V(),{language:h,disableTransitions:r}=$(M()),d=S();function T(v){const n=v.target;h.value=n.value}return(v,n)=>{const l=N("motion");return o(),a(U,null,[i((o(),a("div",G,[e("button",{onClick:n[0]||(n[0]=g=>t(_).back())},n[3]||(n[3]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),n[4]||(n[4]=e("h1",{"text-3xl":""}," Settings ",-1))])),[[l]]),e("div",P,[e("div",q,[i(u(t(y),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,title:"Modules",description:"Thinking, vision, speech synthesis, gaming, etc.",icon:"i-lucide:blocks",to:"/settings/modules"},null,512),[[l]]),i(u(t(y),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:50,title:"Models",description:"Live2D, VRM, etc.",icon:"i-lucide:person-standing",to:"/settings/models"},null,512),[[l]]),i(u(t(y),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:100,title:"Providers",description:"LLMs, speech providers, etc.",icon:"i-lucide:brain",to:"/settings/providers"},null,512),[[l]]),i(u(t(y),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:150,title:"Themes",description:"Customize your stage!",icon:"i-lucide:paintbrush",to:"/settings/themes"},null,512),[[l]])]),i((o(),a("div",H,n[5]||(n[5]=[e("h2",{"text-2xl":""}," General ",-1)]))),[[l]]),e("div",J,[i((o(),a("div",K,[e("div",O,[e("span",null,c(t(p)("settings.language.title")),1)]),e("div",Q,[e("select",{class:"w-32",bg:"transparent",text:"sm right neutral-800 dark:neutral-100",transition:"all ease-in-out duration-250",outline:"none","cursor-pointer":"",onChange:T},[e("option",W,c(t(p)("settings.language.english")),1),e("option",X,c(t(p)("settings.language.chinese")),1)],32)])])),[[l]]),i((o(),a("label",Y,[i(e("input",{"onUpdate:modelValue":n[1]||(n[1]=g=>f(d)?d.value=g:null),text:"neutral-800 dark:neutral-100",checked:t(d),"aria-checked":t(d),type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,Z),[[b,t(d)]]),e("div",ee,[e("div",te,[e("span",null,c(t(p)("settings.theme")),1)]),e("div",ne,[u(k,{name:"slide-away",mode:"out-in"},{default:m(()=>[t(d)?(o(),a("div",ie)):(o(),a("div",oe))]),_:1})])])])),[[l]]),i((o(),a("label",ae,[i(e("input",{"onUpdate:modelValue":n[2]||(n[2]=g=>f(r)?r.value=g:null),text:"neutral-800 dark:neutral-100",checked:t(r),"aria-checked":t(r),type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,le),[[b,t(r)]]),e("div",se,[n[6]||(n[6]=e("div",{text:"sm","w-full":"","flex-1":""},[e("span",null,"Disable Transitions (for debugging)")],-1)),e("div",re,[u(k,{name:"slide-away",mode:"out-in"},{default:m(()=>[t(r)?(o(),a("div",de)):(o(),a("div",ue))]),_:1})])])])),[[l]])]),e("div",ce,[i(e("div",pe,null,512),[[l]])])])],64)}}});typeof w=="function"&&w(ge);export{ge as default}; diff --git a/assets/index-CyuWFHi7.js b/assets/index-CyuWFHi7.js deleted file mode 100644 index a1d3e3bd834a1f942bcafd3294e12269c6a5abf5..0000000000000000000000000000000000000000 --- a/assets/index-CyuWFHi7.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{I as f}from"./IconStatusItem-CFCfq1lX.js";import{d as g,bE as p,h as y,bw as v,c as n,o as t,A as c,a as i,e as a,bx as d,by as x,x as h}from"./index-DfQ41DTF.js";import{b as l}from"./route-block-B_A1xBdJ.js";const b={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},k={grid:"~ cols-1 sm:cols-2 gap-4"},w=g({__name:"index",setup(M){const m=p(),u=y(()=>[{id:"consciousness",name:"Consciousness",description:"Thinking, vision, speech synthesis, gaming, etc.",icon:"i-lucide:ghost",to:"/settings/modules/consciousness",configured:!1},{id:"hearing",name:"Hearing",description:"Hearing, speech recognition, etc.",icon:"i-lucide:ear",to:"",configured:!1},{id:"messaging-discord",name:"Discord",description:"Messaging, notifications, etc.",icon:"i-simple-icons:discord",to:"",configured:!1},{id:"speech",name:"Speech",description:"Speech synthesis, etc.",icon:"i-lucide:mic",to:"/settings/modules/speech",configured:!1},{id:"memory-short-term",name:"Short-Term Memory",description:"Short-term memory, etc.",icon:"i-lucide:book",to:"",configured:!1},{id:"memory-long-term",name:"Long-Term Memory",description:"Long-term memory, etc.",icon:"i-lucide:book-copy",to:"",configured:!1},{id:"vision",name:"Vision",description:"Vision, etc.",icon:"i-lucide:eye",to:"",configured:!1},{id:"game-minecraft",name:"Minecraft",description:"Playing Minecraft with you, etc.",iconColor:"i-vscode-icons:file-type-minecraft",to:"",configured:!1},{id:"game-factorio",name:"Factorio",description:"Playing Factorio with you, etc.",iconImage:"",to:"",configured:!1}]);return(S,o)=>{const s=v("motion");return t(),n(d,null,[c((t(),n("div",b,[i("button",{onClick:o[0]||(o[0]=e=>a(m).back())},o[1]||(o[1]=[i("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),o[2]||(o[2]=i("h1",{relative:""},[i("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[i("span",{text:"neutral-300 dark:neutral-500"},"Settings")]),i("div",{"text-3xl":"","font-semibold":""}," Modules ")],-1))])),[[s]]),i("div",k,[(t(!0),n(d,null,x(u.value,(e,r)=>c((t(),h(a(f),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:e.name,description:e.description,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:e.to,configured:e.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[s]])),128))]),o[3]||(o[3]=i("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[i("div",{text:"40","i-lucide:blocks":""})],-1))],64)}}});typeof l=="function"&&l(w);export{w as default}; diff --git a/assets/index-sRXUKZKg.js b/assets/index-DIUC8mgB.js similarity index 63% rename from assets/index-sRXUKZKg.js rename to assets/index-DIUC8mgB.js index ebf721ab1cca55fbd44c29bd2b620410467bd9cd..dca571ef91a06dbaea430c379b88e38cc2e78a6a 100644 --- a/assets/index-sRXUKZKg.js +++ b/assets/index-DIUC8mgB.js @@ -1 +1 @@ -import{_ as at,a as lt}from"./Model.vue_vue_type_script_setup_true_lang-CXVrD7v3.js";import{d as ot,i as ut,bF as ct,v as ht,s as dt,g as H,w as gt,bG as mt,c as V,o as D,b as R,e as w,y as P,a as c,C as ft,D as F,A as J,bH as bt,bx as $,by as A,n as vt,z as K,bI as _t,bE as pt,l as wt,bw as xt}from"./index-DfQ41DTF.js";import{_ as tt}from"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import{k as et,l as kt,m as yt,n as Ct,J as Mt}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{b as it}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";class Lt{constructor(t,e){this.pixels=t,this.opts=e;const{sigBits:i}=e,o=(g,y,f)=>(g<<2*i)+(y<>n,p=p>>n,k=k>>n;const y=o(m,p,k);s[y]===void 0&&(s[y]=0),s[y]+=1,m>l&&(l=m),mh&&(h=p),pv&&(v=k),ky>0?g+1:g,0),this.hist=s,this.rmax=l,this.rmin=u,this.gmax=h,this.gmin=b,this.bmax=v,this.bmin=x}get colorCount(){return this._colorCount}}class zt{scaleDown(t){const e=this.getWidth(),i=this.getHeight();let o=1;if(t.maxDimension>0){const n=Math.max(e,i);n>t.maxDimension&&(o=t.maxDimension/n)}else o=1/t.quality;o<1&&this.resize(e*o,i*o,o)}}function Vt(r,t){var e;if(t.length>0){const i=r.data,o=i.length/4;let n,a,s,l,u;for(let h=0;h{const a=()=>{this._initCanvas(),o(this)};e.complete?a():(e.onload=a,e.onerror=s=>n(new Error(`Fail to load image: ${i}`)))})}clear(){this._getContext().clearRect(0,0,this._getWidth(),this._getHeight())}update(t){this._getContext().putImageData(t,0,0)}getWidth(){return this._getWidth()}getHeight(){return this._getHeight()}resize(t,e,i){if(!this.image)throw new Error("Image is not initialized");this._width=this._getCanvas().width=t,this._height=this._getCanvas().height=e,this._getContext().scale(i,i),this._getContext().drawImage(this.image,0,0)}getPixelCount(){return this._getWidth()*this._getHeight()}getImageData(){return this._getContext().getImageData(0,0,this._getWidth(),this._getHeight())}remove(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)}}function T(r,...t){return t.forEach(e=>{if(e){for(const i in e)if(e.hasOwnProperty(i)){const o=e[i];Array.isArray(o)?r[i]=o.slice(0):typeof o=="object"?(r[i]||(r[i]={}),T(r[i],o)):r[i]=o}}}),r}function Et(r,t){const{colorCount:e,quantizer:i,generators:o,filters:n}=r,a={colorCount:e},s=typeof i=="string"?{name:i,options:{}}:i;return s.options=T({},a,s.options),T({},{quantizer:s,generators:o,filters:n},t)}class It{constructor(t,e={}){this._src=t,this._opts=T({},I.DefaultOpts,e)}maxColorCount(t){return this._opts.colorCount=t,this}maxDimension(t){return this._opts.maxDimension=t,this}addFilter(t){return this._opts.filters?this._opts.filters.push(t):this._opts.filters=[t],this}removeFilter(t){if(this._opts.filters){const e=this._opts.filters.indexOf(t);e>0&&this._opts.filters.splice(e)}return this}clearFilters(){return this._opts.filters=[],this}quality(t){return this._opts.quality=t,this}useImageClass(t){return this._opts.ImageClass=t,this}useGenerator(t,e){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(e?{name:t,options:e}:t),this}useQuantizer(t,e){return this._opts.quantizer=e?{name:t,options:e}:t,this}build(){return new I(this._src,this._opts)}getPalette(){return this.build().getPalette()}}class B{constructor(t){this.pipeline=t,this._map={}}names(){return Object.keys(this._map)}has(t){return!!this._map[t]}get(t){return this._map[t]}register(t,e){return this._map[t]=e,this.pipeline}}class Ot{constructor(){this.filter=new B(this),this.quantizer=new B(this),this.generator=new B(this)}_buildProcessTasks({filters:t,quantizer:e,generators:i}){return i.length===1&&i[0]==="*"&&(i=this.generator.names()),{filters:t.map(n=>o(this.filter,n)),quantizer:o(this.quantizer,e),generators:i.map(n=>o(this.generator,n))};function o(n,a){let s,l;return typeof a=="string"?s=a:(s=a.name,l=a.options),{name:s,fn:n.get(s),options:l}}}async process(t,e){const{filters:i,quantizer:o,generators:n}=this._buildProcessTasks(e),a=await this._filterColors(i,t),s=await this._generateColors(o,a),l=await this._generatePalettes(n,s);return{colors:s,palettes:l}}_filterColors(t,e){return Promise.resolve(Vt(e,t.map(({fn:i})=>i)))}_generateColors(t,e){return Promise.resolve(t.fn(e.data,t.options))}async _generatePalettes(t,e){const i=await Promise.all(t.map(({fn:o,options:n})=>Promise.resolve(o(e,n))));return Promise.resolve(i.reduce((o,n,a)=>(o[t[a].name]=n,o),{}))}}function Ft(r,t,e){return"#"+((1<<24)+(r<<16)+(t<<8)+e).toString(16).slice(1,7)}function jt(r,t,e){r/=255,t/=255,e/=255;const i=Math.max(r,t,e),o=Math.min(r,t,e);let n=0,a=0;const s=(i+o)/2;if(i!==o){const l=i-o;switch(a=s>.5?l/(2-i-o):l/(i+o),i){case r:n=(t-e)/l+(t1&&(u-=1),u<1/6?s+(l-s)*6*u:u<1/2?l:u<2/3?s+(l-s)*(2/3-u)*6:s}if(t===0)i=o=n=e;else{const s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;i=a(l,s,r+1/3),o=a(l,s,r),n=a(l,s,r-1/3)}return[i*255,o*255,n*255]}class S{static applyFilters(t,e){return e.length>0?t.filter(({r:i,g:o,b:n})=>{var a;for(let s=0;s>=W,i>>=W,o>>=W,e>=n&&e<=a&&i>=s&&i<=l&&o>=u&&o<=h}split(){const{hist:t,getColorIndex:e}=this.histogram,{r1:i,r2:o,g1:n,g2:a,b1:s,b2:l}=this.dimension,u=this.count();if(!u)return[];if(u===1)return[this.clone()];const h=o-i+1,b=a-n+1,v=l-s+1,x=Math.max(h,b,v);let m=null,p,k;p=k=0;let N=null;if(x===h){N="r",m=new Uint32Array(o+1);for(let f=i;f<=o;f++){p=0;for(let C=n;C<=a;C++)for(let M=s;M<=l;M++){const z=e(f,C,M);t[z]&&(p+=t[z])}k+=p,m[f]=k}}else if(x===b){N="g",m=new Uint32Array(a+1);for(let f=n;f<=a;f++){p=0;for(let C=i;C<=o;C++)for(let M=s;M<=l;M++){const z=e(C,f,M);t[z]&&(p+=t[z])}k+=p,m[f]=k}}else{N="b",m=new Uint32Array(l+1);for(let f=s;f<=l;f++){p=0;for(let C=i;C<=o;C++)for(let M=n;M<=a;M++){const z=e(C,M,f);t[z]&&(p+=t[z])}k+=p,m[f]=k}}let _=-1;const d=new Uint32Array(m.length);for(let f=0;fk/2&&(_=f),d[f]=k-C)}const g=this;function y(f){const C=f+"1",M=f+"2",z=g.dimension[C];let L=g.dimension[M];const O=g.clone(),j=g.clone(),Y=_-z,Z=L-_;for(Y<=Z?(L=Math.min(L-1,~~(_+Z/2)),L=Math.max(0,L)):(L=Math.max(z,~~(_-1-Y/2)),L=Math.min(g.dimension[M],L));!m[L];)L++;let X=d[L];for(;!X&&m[L-1];)X=d[--L];return O.dimension[M]=L,j.dimension[C]=L+1,[O,j]}return y(N)}}class nt{_sort(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)}constructor(t){this._comparator=t,this.contents=[],this._sorted=!1}push(t){this.contents.push(t),this._sorted=!1}peek(t){return this._sort(),t=typeof t=="number"?t:this.contents.length-1,this.contents[t]}pop(){return this._sort(),this.contents.pop()}size(){return this.contents.length}map(t){return this._sort(),this.contents.map(t)}}const Ut=.75;function rt(r,t){let e=r.size();for(;r.size()0){const[o,n]=i.split();if(!o||(r.push(o),n&&n.count()>0&&r.push(n),r.size()===e))break;e=r.size()}else break}}const Pt=(r,t)=>{if(r.length===0||t.colorCount<2||t.colorCount>256)throw new Error("Wrong MMCQ parameters");const e=q.build(r);e.histogram.colorCount;const i=new nt((n,a)=>n.count()-a.count());i.push(e),rt(i,Ut*t.colorCount);const o=new nt((n,a)=>n.count()*n.volume()-a.count()*a.volume());return o.contents=i.contents,rt(o,t.colorCount-o.size()),Rt(o)};function Rt(r){const t=[];for(;r.size();){const e=r.pop(),i=e.avg();t.push(new S(i,e.count()))}return t}const Tt={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function Ht(r){let t=0;return r.forEach(e=>{t=Math.max(t,e.population)}),t}function $t(r,t){return r.Vibrant===t||r.DarkVibrant===t||r.LightVibrant===t||r.Muted===t||r.DarkMuted===t||r.LightMuted===t}function qt(r,t,e,i,o,n,a){function s(...u){let h=0,b=0;for(let v=0;v{const[,x,m]=v.hsl;if(x>=s&&x<=l&&m>=o&&m<=n&&!$t(r,v)){const p=qt(x,a,m,i,v.population,e,u);(h===null||p>b)&&(h=v,b=p)}}),h}function At(r,t,e){const i={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return i.Vibrant=U(i,r,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.LightVibrant=U(i,r,t,e.targetLightLuma,e.minLightLuma,1,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.DarkVibrant=U(i,r,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.Muted=U(i,r,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.LightMuted=U(i,r,t,e.targetLightLuma,e.minLightLuma,1,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.DarkMuted=U(i,r,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i}function Bt(r,t,e){if(!r.Vibrant&&!r.DarkVibrant&&!r.LightVibrant){if(!r.DarkVibrant&&r.DarkMuted){let[i,o,n]=r.DarkMuted.hsl;n=e.targetDarkLuma,r.DarkVibrant=new S(E(i,o,n),0)}if(!r.LightVibrant&&r.LightMuted){let[i,o,n]=r.LightMuted.hsl;n=e.targetDarkLuma,r.DarkVibrant=new S(E(i,o,n),0)}}if(!r.Vibrant&&r.DarkVibrant){let[i,o,n]=r.DarkVibrant.hsl;n=e.targetNormalLuma,r.Vibrant=new S(E(i,o,n),0)}else if(!r.Vibrant&&r.LightVibrant){let[i,o,n]=r.LightVibrant.hsl;n=e.targetNormalLuma,r.Vibrant=new S(E(i,o,n),0)}if(!r.DarkVibrant&&r.Vibrant){let[i,o,n]=r.Vibrant.hsl;n=e.targetDarkLuma,r.DarkVibrant=new S(E(i,o,n),0)}if(!r.LightVibrant&&r.Vibrant){let[i,o,n]=r.Vibrant.hsl;n=e.targetLightLuma,r.LightVibrant=new S(E(i,o,n),0)}if(!r.Muted&&r.Vibrant){let[i,o,n]=r.Vibrant.hsl;n=e.targetMutesSaturation,r.Muted=new S(E(i,o,n),0)}if(!r.DarkMuted&&r.DarkVibrant){let[i,o,n]=r.DarkVibrant.hsl;n=e.targetMutesSaturation,r.DarkMuted=new S(E(i,o,n),0)}if(!r.LightMuted&&r.LightVibrant){let[i,o,n]=r.LightVibrant.hsl;n=e.targetMutesSaturation,r.LightMuted=new S(E(i,o,n),0)}}const Wt=(r,t)=>{t=Object.assign({},Tt,t);const e=Ht(r),i=At(r,e,t);return Bt(i,e,t),i},Jt=new Ot().filter.register("default",(r,t,e,i)=>i>=125&&!(r>250&&t>250&&e>250)).quantizer.register("mmcq",Pt).generator.register("default",Wt);I.use(Jt);const Gt=["onClick"],Qt={flex:"~ row 1","items-center":"","gap-1.5":""},Yt={"p-4":""},Zt={class:"space-y-4"},Xt={class:"flex items-center justify-between"},Kt={class:"flex items-center gap-1 text-sm font-medium"},te=["disabled","placeholder"],ee=["disabled"],ie={class:"flex items-center justify-between"},ne={class:"flex items-center gap-1 text-sm font-medium"},re=["disabled"],oe={key:0,flex:"","gap-2":""},se=["onClick"],ae=["onClick"],le={"p-4":""},ue={key:0,class:"space-y-4"},ce={class:"flex items-center gap-1 text-sm font-medium"},he={flex:"","gap-2":""},de=["onUpdate:modelValue"],ge=["disabled","onClick"],me=["disabled"],fe=["href","download"],be=["disabled"],ve={key:1},_e=ot({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(r,{emit:t}){const e=t,{t:i}=ut(),o=ct({accept:"application/zip"}),n=ht(),{live2dModelFile:a,live2dMotionMap:s,live2dLoadSource:l,loadingLive2dModel:u,availableLive2dMotions:h,live2dModelUrl:b,themeColorsHue:v}=dt(n),x=H(b.value);o.onChange(_=>{_&&_.length>0&&(s.value={},a.value=_[0],l.value="file",u.value=!0)}),gt(()=>n.loadingLive2dModel,_=>{_||l.value==="file"&&h.value.forEach(d=>{d.motionName in et?s.value[d.fileName]=d.motionName:s.value[d.fileName]=kt})});async function m(_,d){if(!Object.keys(d).length)return _;const y=await new Mt().loadAsync(_),f=Object.keys(y.files).find(O=>O.endsWith("model3.json"));if(!f)throw new Error("model3.json not found");const C=await y.file(f).async("string"),M=JSON.parse(C),z={};Object.entries(d).forEach(([O,j])=>{if(z[j]){z[j].push({File:O});return}z[j]=[{File:O}]}),M.FileReferences.Motions=z,y.file(f,JSON.stringify(M,null,2));const L=await y.generateAsync({type:"blob"});return new File([L],_.name,{type:_.type,lastModified:_.lastModified})}async function p(){const _=await yt.getItem("live2dModel");if(!_)return;const d=await m(_,s.value);a.value=d,l.value="file",u.value=!0}const k=mt(a);function N(_){var d;v.value=((d=Ct("oklch")(_))==null?void 0:d.h)??0}return(_,d)=>(D(),V("div",null,[R(w(tt),{"w-full":"",default:!0},{trigger:P(g=>[c("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:y=>g.setVisible(!g.visible)},[c("div",Qt,[d[4]||(d[4]=c("div",{"i-solar:magic-stick-3-bold-duotone":"",class:"provider-icon size-6",transition:"filter duration-250 ease-in-out"},null,-1)),c("div",null,F(w(i)("settings.live2d.change-model.title")),1)]),c("div",{transform:"",transition:"transform duration-250",class:K({"rotate-180":g.visible})},d[5]||(d[5]=[c("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,Gt)]),default:P(()=>[c("div",Yt,[c("div",Zt,[c("div",Xt,[c("div",null,[c("div",Kt,F(w(i)("settings.live2d.change-model.from-url")),1)]),c("div",null,[J(c("input",{"onUpdate:modelValue":d[0]||(d[0]=g=>x.value=g),disabled:w(n).loadingLive2dModel,type:"text",rounded:"",border:"zinc-300 dark:zinc-800 solid 1 focus:zinc-400 dark:focus:zinc-600",transition:"border duration-250 ease-in-out","px-2":"","py-1":"","text-sm":"","outline-none":"",placeholder:w(i)("settings.live2d.change-model.from-url-placeholder")},null,8,te),[[bt,x.value]]),c("button",{disabled:w(n).loadingLive2dModel,bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","ml-2":"",rounded:"","px-2":"","py-1":"","text-sm":"","outline-none":"",onClick:d[1]||(d[1]=g=>b.value=x.value)},F(w(i)("settings.live2d.change-model.from-url-confirm")),9,ee)])]),c("div",ie,[c("div",null,[c("div",ne,F(w(i)("settings.live2d.change-model.from-file")),1)]),c("button",{disabled:w(n).loadingLive2dModel,rounded:"",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","px-2":"","py-1":"","text-sm":"","outline-none":"",onClick:d[2]||(d[2]=g=>w(o).open())},F(w(i)("settings.live2d.change-model.from-file-select")),9,re)]),c("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700","w-full":"",transition:"all ease-in-out duration-250",rounded:"","px-2":"","py-1":"","text-sm":"","outline-none":"",onClick:d[3]||(d[3]=g=>e("extractColorsFromModel"))}," Extract colors from model "),r.palette?(D(),V("div",oe,[(D(!0),V($,null,A(r.palette,g=>(D(),V("div",{key:g,class:"flex items-center gap-1",onClick:y=>N(g)},[c("div",{"size-6":"","rounded-full":"",style:vt({backgroundColor:g})},null,4)],8,se))),128))])):ft("",!0)])])]),_:1}),R(w(tt),{"mt-4":"","w-full":"",default:!0},{trigger:P(g=>[c("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:y=>g.setVisible(!g.visible)},[d[7]||(d[7]=c("div",{flex:"~ row 1","items-center":"","gap-1.5":""},[c("div",{"i-solar:face-scan-circle-bold-duotone":"",class:"provider-icon size-6",transition:"filter duration-250 ease-in-out"}),c("div",null," Edit motion map ")],-1)),c("div",{transform:"",transition:"transform duration-250",class:K({"rotate-180":g.visible})},d[6]||(d[6]=[c("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,ae)]),default:P(()=>{var g;return[c("div",le,[w(n).live2dLoadSource==="file"?(D(),V("div",ue,[(D(!0),V($,null,A(w(n).availableLive2dMotions,y=>(D(),V("div",{key:y.fileName,class:"flex items-center justify-between"},[c("div",ce,F(y.fileName),1),c("div",he,[J(c("select",{"onUpdate:modelValue":f=>w(n).live2dMotionMap[y.fileName]=f},[(D(!0),V($,null,A(Object.keys(w(et)),f=>(D(),V("option",{key:f},F(f),1))),128))],8,de),[[_t,w(n).live2dMotionMap[y.fileName]]]),c("button",{disabled:w(n).loadingLive2dModel,rounded:"",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","px-2":"","py-1":"","text-sm":"","outline-none":"",onClick:f=>w(n).live2dCurrentMotion={group:y.motionName,index:y.motionIndex}}," Play ",8,ge)])]))),128)),c("button",{disabled:w(n).loadingLive2dModel,"w-full":"",rounded:"",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250",onClick:p}," Save and patch ",8,me),c("a",{"mt-2":"",block:"",href:w(k),download:`${(g=w(n).live2dModelFile)==null?void 0:g.name}-motion-edited.zip`},[c("button",{disabled:w(n).loadingLive2dModel,"w-full":"",rounded:"",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250"}," Export ",8,be)],8,fe)])):(D(),V("div",ve," Not available for URL model "))])]}),_:1})]))}}),pe={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},we={flex:""},xe=ot({__name:"index",setup(r){const t=pt(),e=H(),i=H(),{width:o,height:n}=wt(e),a=H([]);async function s(){if(!i.value)return;const l=await i.value.captureFrame();if(!l){console.error("No frame captured");return}const u=URL.createObjectURL(l),b=await new I(u).getPalette();a.value=Object.values(b).map(v=>v==null?void 0:v.hex).filter(v=>typeof v=="string"),URL.revokeObjectURL(u)}return(l,u)=>{const h=xt("motion");return D(),V($,null,[J((D(),V("div",pe,[c("button",{onClick:u[0]||(u[0]=b=>w(t).back())},u[1]||(u[1]=[c("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),u[2]||(u[2]=c("h1",{relative:""},[c("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[c("span",{text:"neutral-300 dark:neutral-500"},"Settings")]),c("div",{"text-3xl":"","font-semibold":""}," Models ")],-1))])),[[h]]),c("div",we,[c("div",{ref_key:"live2dContainerRef",ref:e,w:"50%",h:"80vh"},[R(lt,{ref_key:"live2dCanvasRef",ref:i,width:w(o),height:w(n)},{default:P(({app:b})=>[R(at,{app:b,"mouth-open-size":0,width:w(o),height:w(n),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),R(_e,{w:"50%",h:"80vh",palette:a.value,onExtractColorsFromModel:s},null,8,["palette"])]),u[3]||(u[3]=c("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[c("div",{text:"40","i-lucide:person-standing":""})],-1))],64)}}});typeof it=="function"&&it(xe);export{xe as default}; +import{_ as lt,a as ut}from"./Model.vue_vue_type_script_setup_true_lang-NsUHJ7rm.js";import{d as ot,i as st,bF as ct,v as ht,s as dt,g as T,w as gt,bG as mt,c as V,o as D,b as R,e as w,y as P,a as h,C as ft,D as I,A as J,bH as bt,bx as H,by as A,n as _t,z as K,bI as vt,bE as pt,l as wt,bw as xt}from"./index-Dn5R1iW2.js";import{_ as tt}from"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import{k as et,l as kt,m as yt,n as Ct,J as Mt}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{b as it}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";class Lt{constructor(t,e){this.pixels=t,this.opts=e;const{sigBits:i}=e,o=(g,y,f)=>(g<<2*i)+(y<>n,x=x>>n,k=k>>n;const y=o(m,x,k);s[y]===void 0&&(s[y]=0),s[y]+=1,m>l&&(l=m),mc&&(c=x),x<_&&(_=x),k>v&&(v=k),ky>0?g+1:g,0),this.hist=s,this.rmax=l,this.rmin=u,this.gmax=c,this.gmin=_,this.bmax=v,this.bmin=p}get colorCount(){return this._colorCount}}class zt{scaleDown(t){const e=this.getWidth(),i=this.getHeight();let o=1;if(t.maxDimension>0){const n=Math.max(e,i);n>t.maxDimension&&(o=t.maxDimension/n)}else o=1/t.quality;o<1&&this.resize(e*o,i*o,o)}}function Vt(r,t){var e;if(t.length>0){const i=r.data,o=i.length/4;let n,a,s,l,u;for(let c=0;c{const a=()=>{this._initCanvas(),o(this)};e.complete?a():(e.onload=a,e.onerror=s=>n(new Error(`Fail to load image: ${i}`)))})}clear(){this._getContext().clearRect(0,0,this._getWidth(),this._getHeight())}update(t){this._getContext().putImageData(t,0,0)}getWidth(){return this._getWidth()}getHeight(){return this._getHeight()}resize(t,e,i){if(!this.image)throw new Error("Image is not initialized");this._width=this._getCanvas().width=t,this._height=this._getCanvas().height=e,this._getContext().scale(i,i),this._getContext().drawImage(this.image,0,0)}getPixelCount(){return this._getWidth()*this._getHeight()}getImageData(){return this._getContext().getImageData(0,0,this._getWidth(),this._getHeight())}remove(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)}}function $(r,...t){return t.forEach(e=>{if(e){for(const i in e)if(e.hasOwnProperty(i)){const o=e[i];Array.isArray(o)?r[i]=o.slice(0):typeof o=="object"?(r[i]||(r[i]={}),$(r[i],o)):r[i]=o}}}),r}function Et(r,t){const{colorCount:e,quantizer:i,generators:o,filters:n}=r,a={colorCount:e},s=typeof i=="string"?{name:i,options:{}}:i;return s.options=$({},a,s.options),$({},{quantizer:s,generators:o,filters:n},t)}class It{constructor(t,e={}){this._src=t,this._opts=$({},O.DefaultOpts,e)}maxColorCount(t){return this._opts.colorCount=t,this}maxDimension(t){return this._opts.maxDimension=t,this}addFilter(t){return this._opts.filters?this._opts.filters.push(t):this._opts.filters=[t],this}removeFilter(t){if(this._opts.filters){const e=this._opts.filters.indexOf(t);e>0&&this._opts.filters.splice(e)}return this}clearFilters(){return this._opts.filters=[],this}quality(t){return this._opts.quality=t,this}useImageClass(t){return this._opts.ImageClass=t,this}useGenerator(t,e){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(e?{name:t,options:e}:t),this}useQuantizer(t,e){return this._opts.quantizer=e?{name:t,options:e}:t,this}build(){return new O(this._src,this._opts)}getPalette(){return this.build().getPalette()}}class B{constructor(t){this.pipeline=t,this._map={}}names(){return Object.keys(this._map)}has(t){return!!this._map[t]}get(t){return this._map[t]}register(t,e){return this._map[t]=e,this.pipeline}}class Ot{constructor(){this.filter=new B(this),this.quantizer=new B(this),this.generator=new B(this)}_buildProcessTasks({filters:t,quantizer:e,generators:i}){return i.length===1&&i[0]==="*"&&(i=this.generator.names()),{filters:t.map(n=>o(this.filter,n)),quantizer:o(this.quantizer,e),generators:i.map(n=>o(this.generator,n))};function o(n,a){let s,l;return typeof a=="string"?s=a:(s=a.name,l=a.options),{name:s,fn:n.get(s),options:l}}}async process(t,e){const{filters:i,quantizer:o,generators:n}=this._buildProcessTasks(e),a=await this._filterColors(i,t),s=await this._generateColors(o,a),l=await this._generatePalettes(n,s);return{colors:s,palettes:l}}_filterColors(t,e){return Promise.resolve(Vt(e,t.map(({fn:i})=>i)))}_generateColors(t,e){return Promise.resolve(t.fn(e.data,t.options))}async _generatePalettes(t,e){const i=await Promise.all(t.map(({fn:o,options:n})=>Promise.resolve(o(e,n))));return Promise.resolve(i.reduce((o,n,a)=>(o[t[a].name]=n,o),{}))}}function Ft(r,t,e){return"#"+((1<<24)+(r<<16)+(t<<8)+e).toString(16).slice(1,7)}function jt(r,t,e){r/=255,t/=255,e/=255;const i=Math.max(r,t,e),o=Math.min(r,t,e);let n=0,a=0;const s=(i+o)/2;if(i!==o){const l=i-o;switch(a=s>.5?l/(2-i-o):l/(i+o),i){case r:n=(t-e)/l+(t1&&(u-=1),u<1/6?s+(l-s)*6*u:u<1/2?l:u<2/3?s+(l-s)*(2/3-u)*6:s}if(t===0)i=o=n=e;else{const s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;i=a(l,s,r+1/3),o=a(l,s,r),n=a(l,s,r-1/3)}return[i*255,o*255,n*255]}class S{static applyFilters(t,e){return e.length>0?t.filter(({r:i,g:o,b:n})=>{var a;for(let s=0;s>=W,i>>=W,o>>=W,e>=n&&e<=a&&i>=s&&i<=l&&o>=u&&o<=c}split(){const{hist:t,getColorIndex:e}=this.histogram,{r1:i,r2:o,g1:n,g2:a,b1:s,b2:l}=this.dimension,u=this.count();if(!u)return[];if(u===1)return[this.clone()];const c=o-i+1,_=a-n+1,v=l-s+1,p=Math.max(c,_,v);let m=null,x,k;x=k=0;let N=null;if(p===c){N="r",m=new Uint32Array(o+1);for(let f=i;f<=o;f++){x=0;for(let C=n;C<=a;C++)for(let M=s;M<=l;M++){const z=e(f,C,M);t[z]&&(x+=t[z])}k+=x,m[f]=k}}else if(p===_){N="g",m=new Uint32Array(a+1);for(let f=n;f<=a;f++){x=0;for(let C=i;C<=o;C++)for(let M=s;M<=l;M++){const z=e(C,f,M);t[z]&&(x+=t[z])}k+=x,m[f]=k}}else{N="b",m=new Uint32Array(l+1);for(let f=s;f<=l;f++){x=0;for(let C=i;C<=o;C++)for(let M=n;M<=a;M++){const z=e(C,M,f);t[z]&&(x+=t[z])}k+=x,m[f]=k}}let b=-1;const d=new Uint32Array(m.length);for(let f=0;fk/2&&(b=f),d[f]=k-C)}const g=this;function y(f){const C=f+"1",M=f+"2",z=g.dimension[C];let L=g.dimension[M];const F=g.clone(),j=g.clone(),Y=b-z,Z=L-b;for(Y<=Z?(L=Math.min(L-1,~~(b+Z/2)),L=Math.max(0,L)):(L=Math.max(z,~~(b-1-Y/2)),L=Math.min(g.dimension[M],L));!m[L];)L++;let X=d[L];for(;!X&&m[L-1];)X=d[--L];return F.dimension[M]=L,j.dimension[C]=L+1,[F,j]}return y(N)}}class nt{_sort(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)}constructor(t){this._comparator=t,this.contents=[],this._sorted=!1}push(t){this.contents.push(t),this._sorted=!1}peek(t){return this._sort(),t=typeof t=="number"?t:this.contents.length-1,this.contents[t]}pop(){return this._sort(),this.contents.pop()}size(){return this.contents.length}map(t){return this._sort(),this.contents.map(t)}}const Ut=.75;function rt(r,t){let e=r.size();for(;r.size()0){const[o,n]=i.split();if(!o||(r.push(o),n&&n.count()>0&&r.push(n),r.size()===e))break;e=r.size()}else break}}const Pt=(r,t)=>{if(r.length===0||t.colorCount<2||t.colorCount>256)throw new Error("Wrong MMCQ parameters");const e=q.build(r);e.histogram.colorCount;const i=new nt((n,a)=>n.count()-a.count());i.push(e),rt(i,Ut*t.colorCount);const o=new nt((n,a)=>n.count()*n.volume()-a.count()*a.volume());return o.contents=i.contents,rt(o,t.colorCount-o.size()),Rt(o)};function Rt(r){const t=[];for(;r.size();){const e=r.pop(),i=e.avg();t.push(new S(i,e.count()))}return t}const $t={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function Tt(r){let t=0;return r.forEach(e=>{t=Math.max(t,e.population)}),t}function Ht(r,t){return r.Vibrant===t||r.DarkVibrant===t||r.LightVibrant===t||r.Muted===t||r.DarkMuted===t||r.LightMuted===t}function qt(r,t,e,i,o,n,a){function s(...u){let c=0,_=0;for(let v=0;v{const[,p,m]=v.hsl;if(p>=s&&p<=l&&m>=o&&m<=n&&!Ht(r,v)){const x=qt(p,a,m,i,v.population,e,u);(c===null||x>_)&&(c=v,_=x)}}),c}function At(r,t,e){const i={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return i.Vibrant=U(i,r,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.LightVibrant=U(i,r,t,e.targetLightLuma,e.minLightLuma,1,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.DarkVibrant=U(i,r,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.Muted=U(i,r,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.LightMuted=U(i,r,t,e.targetLightLuma,e.minLightLuma,1,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.DarkMuted=U(i,r,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i}function Bt(r,t,e){if(!r.Vibrant&&!r.DarkVibrant&&!r.LightVibrant){if(!r.DarkVibrant&&r.DarkMuted){let[i,o,n]=r.DarkMuted.hsl;n=e.targetDarkLuma,r.DarkVibrant=new S(E(i,o,n),0)}if(!r.LightVibrant&&r.LightMuted){let[i,o,n]=r.LightMuted.hsl;n=e.targetDarkLuma,r.DarkVibrant=new S(E(i,o,n),0)}}if(!r.Vibrant&&r.DarkVibrant){let[i,o,n]=r.DarkVibrant.hsl;n=e.targetNormalLuma,r.Vibrant=new S(E(i,o,n),0)}else if(!r.Vibrant&&r.LightVibrant){let[i,o,n]=r.LightVibrant.hsl;n=e.targetNormalLuma,r.Vibrant=new S(E(i,o,n),0)}if(!r.DarkVibrant&&r.Vibrant){let[i,o,n]=r.Vibrant.hsl;n=e.targetDarkLuma,r.DarkVibrant=new S(E(i,o,n),0)}if(!r.LightVibrant&&r.Vibrant){let[i,o,n]=r.Vibrant.hsl;n=e.targetLightLuma,r.LightVibrant=new S(E(i,o,n),0)}if(!r.Muted&&r.Vibrant){let[i,o,n]=r.Vibrant.hsl;n=e.targetMutesSaturation,r.Muted=new S(E(i,o,n),0)}if(!r.DarkMuted&&r.DarkVibrant){let[i,o,n]=r.DarkVibrant.hsl;n=e.targetMutesSaturation,r.DarkMuted=new S(E(i,o,n),0)}if(!r.LightMuted&&r.LightVibrant){let[i,o,n]=r.LightVibrant.hsl;n=e.targetMutesSaturation,r.LightMuted=new S(E(i,o,n),0)}}const Wt=(r,t)=>{t=Object.assign({},$t,t);const e=Tt(r),i=At(r,e,t);return Bt(i,e,t),i},Jt=new Ot().filter.register("default",(r,t,e,i)=>i>=125&&!(r>250&&t>250&&e>250)).quantizer.register("mmcq",Pt).generator.register("default",Wt);O.use(Jt);const Gt=["onClick"],Qt={flex:"~ row 1","items-center":"","gap-1.5":""},Yt={"p-4":""},Zt={class:"space-y-4"},Xt={class:"flex items-center justify-between"},Kt={class:"flex items-center gap-1 text-sm font-medium"},te=["disabled","placeholder"],ee=["disabled"],ie={class:"flex items-center justify-between"},ne={class:"flex items-center gap-1 text-sm font-medium"},re=["disabled"],oe={key:0,flex:"","gap-2":""},se=["onClick"],ae=["onClick"],le={"p-4":""},ue={key:0,class:"space-y-4"},ce={class:"flex items-center gap-1 text-sm font-medium"},he={flex:"","gap-2":""},de=["onUpdate:modelValue"],ge=["disabled","onClick"],me=["disabled"],fe=["href","download"],be=["disabled"],_e={key:1},ve=ot({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(r,{emit:t}){const e=t,{t:i}=st(),o=ct({accept:"application/zip"}),n=ht(),{live2dModelFile:a,live2dMotionMap:s,live2dLoadSource:l,loadingLive2dModel:u,availableLive2dMotions:c,live2dModelUrl:_,themeColorsHue:v}=dt(n),p=T(_.value);o.onChange(b=>{b&&b.length>0&&(s.value={},a.value=b[0],l.value="file",u.value=!0)}),gt(()=>n.loadingLive2dModel,b=>{b||l.value==="file"&&c.value.forEach(d=>{d.motionName in et?s.value[d.fileName]=d.motionName:s.value[d.fileName]=kt})});async function m(b,d){if(!Object.keys(d).length)return b;const y=await new Mt().loadAsync(b),f=Object.keys(y.files).find(F=>F.endsWith("model3.json"));if(!f)throw new Error("model3.json not found");const C=await y.file(f).async("string"),M=JSON.parse(C),z={};Object.entries(d).forEach(([F,j])=>{if(z[j]){z[j].push({File:F});return}z[j]=[{File:F}]}),M.FileReferences.Motions=z,y.file(f,JSON.stringify(M,null,2));const L=await y.generateAsync({type:"blob"});return new File([L],b.name,{type:b.type,lastModified:b.lastModified})}async function x(){const b=await yt.getItem("live2dModel");if(!b)return;const d=await m(b,s.value);a.value=d,l.value="file",u.value=!0}const k=mt(a);function N(b){var d;v.value=((d=Ct("oklch")(b))==null?void 0:d.h)??0}return(b,d)=>(D(),V("div",null,[R(w(tt),{"w-full":"",default:!0},{trigger:P(g=>[h("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:y=>g.setVisible(!g.visible)},[h("div",Qt,[d[4]||(d[4]=h("div",{"i-solar:magic-stick-3-bold-duotone":"",class:"provider-icon size-6",transition:"filter duration-250 ease-in-out"},null,-1)),h("div",null,I(w(i)("settings.live2d.change-model.title")),1)]),h("div",{transform:"",transition:"transform duration-250",class:K({"rotate-180":g.visible})},d[5]||(d[5]=[h("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,Gt)]),default:P(()=>[h("div",Yt,[h("div",Zt,[h("div",Xt,[h("div",null,[h("div",Kt,I(w(i)("settings.live2d.change-model.from-url")),1)]),h("div",null,[J(h("input",{"onUpdate:modelValue":d[0]||(d[0]=g=>p.value=g),disabled:w(n).loadingLive2dModel,type:"text",rounded:"",border:"zinc-300 dark:zinc-800 solid 1 focus:zinc-400 dark:focus:zinc-600",transition:"border duration-250 ease-in-out","px-2":"","py-1":"","text-sm":"","outline-none":"",placeholder:w(i)("settings.live2d.change-model.from-url-placeholder")},null,8,te),[[bt,p.value]]),h("button",{disabled:w(n).loadingLive2dModel,bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","ml-2":"",rounded:"","px-2":"","py-1":"","text-sm":"","outline-none":"",onClick:d[1]||(d[1]=g=>_.value=p.value)},I(w(i)("settings.live2d.change-model.from-url-confirm")),9,ee)])]),h("div",ie,[h("div",null,[h("div",ne,I(w(i)("settings.live2d.change-model.from-file")),1)]),h("button",{disabled:w(n).loadingLive2dModel,rounded:"",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","px-2":"","py-1":"","text-sm":"","outline-none":"",onClick:d[2]||(d[2]=g=>w(o).open())},I(w(i)("settings.live2d.change-model.from-file-select")),9,re)]),h("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700","w-full":"",transition:"all ease-in-out duration-250",rounded:"","px-2":"","py-1":"","text-sm":"","outline-none":"",onClick:d[3]||(d[3]=g=>e("extractColorsFromModel"))}," Extract colors from model "),r.palette?(D(),V("div",oe,[(D(!0),V(H,null,A(r.palette,g=>(D(),V("div",{key:g,class:"flex items-center gap-1",onClick:y=>N(g)},[h("div",{"size-6":"","rounded-full":"",style:_t({backgroundColor:g})},null,4)],8,se))),128))])):ft("",!0)])])]),_:1}),R(w(tt),{"mt-4":"","w-full":"",default:!0},{trigger:P(g=>[h("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:y=>g.setVisible(!g.visible)},[d[7]||(d[7]=h("div",{flex:"~ row 1","items-center":"","gap-1.5":""},[h("div",{"i-solar:face-scan-circle-bold-duotone":"",class:"provider-icon size-6",transition:"filter duration-250 ease-in-out"}),h("div",null," Edit motion map ")],-1)),h("div",{transform:"",transition:"transform duration-250",class:K({"rotate-180":g.visible})},d[6]||(d[6]=[h("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,ae)]),default:P(()=>{var g;return[h("div",le,[w(n).live2dLoadSource==="file"?(D(),V("div",ue,[(D(!0),V(H,null,A(w(n).availableLive2dMotions,y=>(D(),V("div",{key:y.fileName,class:"flex items-center justify-between"},[h("div",ce,I(y.fileName),1),h("div",he,[J(h("select",{"onUpdate:modelValue":f=>w(n).live2dMotionMap[y.fileName]=f},[(D(!0),V(H,null,A(Object.keys(w(et)),f=>(D(),V("option",{key:f},I(f),1))),128))],8,de),[[vt,w(n).live2dMotionMap[y.fileName]]]),h("button",{disabled:w(n).loadingLive2dModel,rounded:"",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","px-2":"","py-1":"","text-sm":"","outline-none":"",onClick:f=>w(n).live2dCurrentMotion={group:y.motionName,index:y.motionIndex}}," Play ",8,ge)])]))),128)),h("button",{disabled:w(n).loadingLive2dModel,"w-full":"",rounded:"",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250",onClick:x}," Save and patch ",8,me),h("a",{"mt-2":"",block:"",href:w(k),download:`${(g=w(n).live2dModelFile)==null?void 0:g.name}-motion-edited.zip`},[h("button",{disabled:w(n).loadingLive2dModel,"w-full":"",rounded:"",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250"}," Export ",8,be)],8,fe)])):(D(),V("div",_e," Not available for URL model "))])]}),_:1})]))}}),pe={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},we={relative:""},xe={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},ke={text:"neutral-300 dark:neutral-500"},ye={"text-3xl":"","font-semibold":""},Ce={flex:""},Me=ot({__name:"index",setup(r){const{t}=st(),e=pt(),i=T(),o=T(),{width:n,height:a}=wt(i),s=T([]);async function l(){if(!o.value)return;const u=await o.value.captureFrame();if(!u){console.error("No frame captured");return}const c=URL.createObjectURL(u),v=await new O(c).getPalette();s.value=Object.values(v).map(p=>p==null?void 0:p.hex).filter(p=>typeof p=="string"),URL.revokeObjectURL(c)}return(u,c)=>{const _=xt("motion");return D(),V(H,null,[J((D(),V("div",pe,[h("button",{onClick:c[0]||(c[0]=v=>w(e).back())},c[1]||(c[1]=[h("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),h("h1",we,[h("div",xe,[h("span",ke,I(w(t)("settings.title")),1)]),h("div",ye,I(w(t)("settings.pages.models.title")),1)])])),[[_]]),h("div",Ce,[h("div",{ref_key:"live2dContainerRef",ref:i,w:"50%",h:"80vh"},[R(ut,{ref_key:"live2dCanvasRef",ref:o,width:w(n),height:w(a)},{default:P(({app:v})=>[R(lt,{app:v,"mouth-open-size":0,width:w(n),height:w(a),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),R(ve,{w:"50%",h:"80vh",palette:s.value,onExtractColorsFromModel:l},null,8,["palette"])]),c[2]||(c[2]=h("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[h("div",{text:"40","i-lucide:person-standing":""})],-1))],64)}}});typeof it=="function"&&it(Me);export{Me as default}; diff --git a/assets/index-bumnzUvc.js b/assets/index-DLIkN3Ho.js similarity index 78% rename from assets/index-bumnzUvc.js rename to assets/index-DLIkN3Ho.js index 9b7dd3b05338ca50f28512c5ba3b527b2e233b3f..3f885f86299f02c0cffa18470ed53a972595961f 100644 --- a/assets/index-bumnzUvc.js +++ b/assets/index-DLIkN3Ho.js @@ -1 +1 @@ -import{r,a as s,b as h,c as t}from"./providers-CM7Pgz9x.js";var d=async e=>(e.fetch??globalThis.fetch)(r("audio/speech",e.baseURL),{body:h(e),headers:s({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(t).then(async a=>a.arrayBuffer());export{d as g}; +import{r,a as s,b as h,c as t}from"./providers-Li1UUmJz.js";var d=async e=>(e.fetch??globalThis.fetch)(r("audio/speech",e.baseURL),{body:h(e),headers:s({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(t).then(async a=>a.arrayBuffer());export{d as g}; diff --git a/assets/index-Dcdz53V-.js b/assets/index-Dcdz53V-.js deleted file mode 100644 index ed1e9dcb648911b30e66fea5616cb55ea33b82a8..0000000000000000000000000000000000000000 --- a/assets/index-Dcdz53V-.js +++ /dev/null @@ -1,3 +0,0 @@ -import{h as O,g as T,G as wt,w as K,ah as Ct,ai as At,c1 as fe,e as y,d as _,E as Ot,p as $,x as H,o as R,y as P,m as $e,b as V,bQ as se,c2 as Kt,c3 as Et,c4 as Dt,c5 as Xt,bW as ge,c6 as Tt,bT as qt,bv as Le,c7 as st,bS as Pe,af as Z,C as Jt,c8 as Qt,ab as Zt,bP as Pt,b_ as kt,D as ke,bM as en,c as me,n as Me,bR as tn,br as nn,c9 as Bt,ca as on,cb as rn,cc as ln,b$ as an,H as sn,bx as Be,a as x,cd as un,ce as cn,bU as dn,bE as fn,v as pn,bw as mn,A as Ve,z as Ee,bH as vn,B as hn,by as ut,cf as gn}from"./index-DfQ41DTF.js";import{_ as ct}from"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import{n as dt}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{b as ft}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const yn=["top","right","bottom","left"],re=Math.min,W=Math.max,Se=Math.round,De=Math.floor,X=e=>({x:e,y:e}),bn={left:"right",right:"left",bottom:"top",top:"bottom"},xn={start:"end",end:"start"};function Ue(e,t,n){return W(e,re(t,n))}function ee(e,t){return typeof e=="function"?e(t):e}function te(e){return e.split("-")[0]}function ye(e){return e.split("-")[1]}function Je(e){return e==="x"?"y":"x"}function Qe(e){return e==="y"?"height":"width"}function le(e){return["top","bottom"].includes(te(e))?"y":"x"}function Ze(e){return Je(le(e))}function wn(e,t,n){n===void 0&&(n=!1);const o=ye(e),i=Ze(e),r=Qe(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=Re(l)),[l,Re(l)]}function Cn(e){const t=Re(e);return[Ge(e),t,Ge(t)]}function Ge(e){return e.replace(/start|end/g,t=>xn[t])}function An(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function On(e,t,n,o){const i=ye(e);let r=An(te(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(Ge)))),r}function Re(e){return e.replace(/left|right|bottom|top/g,t=>bn[t])}function En(e){return{top:0,right:0,bottom:0,left:0,...e}}function St(e){return typeof e!="number"?En(e):{top:e,right:e,bottom:e,left:e}}function _e(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function pt(e,t,n){let{reference:o,floating:i}=e;const r=le(t),l=Ze(t),u=Qe(l),s=te(t),d=r==="y",a=o.x+o.width/2-i.width/2,c=o.y+o.height/2-i.height/2,m=o[u]/2-i[u]/2;let f;switch(s){case"top":f={x:a,y:o.y-i.height};break;case"bottom":f={x:a,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:c};break;case"left":f={x:o.x-i.width,y:c};break;default:f={x:o.x,y:o.y}}switch(ye(t)){case"start":f[l]-=m*(n&&d?-1:1);break;case"end":f[l]+=m*(n&&d?-1:1);break}return f}const Dn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,u=r.filter(Boolean),s=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:c}=pt(d,o,s),m=o,f={},p=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:u,middlewareData:s}=t,{element:d,padding:a=0}=ee(e,t)||{};if(d==null)return{};const c=St(a),m={x:n,y:o},f=Ze(i),p=Qe(f),g=await l.getDimensions(d),v=f==="y",h=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",A=r.reference[p]+r.reference[f]-m[f]-r.floating[p],C=m[f]-r.reference[f],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let E=k?k[b]:0;(!E||!await(l.isElement==null?void 0:l.isElement(k)))&&(E=u.floating[b]||r.floating[p]);const B=A/2-C/2,L=E/2-g[p]/2-1,D=re(c[h],L),j=re(c[w],L),M=D,F=E-g[p]-j,S=E/2-g[p]/2+B,ne=Ue(M,S,F),N=!s.arrow&&ye(i)!=null&&S!==ne&&r.reference[p]/2-(SS<=0)){var j,M;const S=(((j=r.flip)==null?void 0:j.index)||0)+1,ne=E[S];if(ne)return{data:{index:S,overflows:D},reset:{placement:ne}};let N=(M=D.filter(Y=>Y.overflows[0]<=0).sort((Y,oe)=>Y.overflows[1]-oe.overflows[1])[0])==null?void 0:M.placement;if(!N)switch(f){case"bestFit":{var F;const Y=(F=D.filter(oe=>{if(k){const ie=le(oe.placement);return ie===w||ie==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(ie=>ie>0).reduce((ie,Yt)=>ie+Yt,0)]).sort((oe,ie)=>oe[1]-ie[1])[0])==null?void 0:F[0];Y&&(N=Y);break}case"initialPlacement":N=u;break}if(i!==N)return{reset:{placement:N}}}return{}}}};function mt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vt(e){return yn.some(t=>e[t]>=0)}const kn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ee(e,t);switch(o){case"referenceHidden":{const r=await xe(t,{...i,elementContext:"reference"}),l=mt(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:vt(l)}}}case"escaped":{const r=await xe(t,{...i,altBoundary:!0}),l=mt(r,n.floating);return{data:{escapedOffsets:l,escaped:vt(l)}}}default:return{}}}}};async function Bn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=te(n),u=ye(n),s=le(n)==="y",d=["left","top"].includes(l)?-1:1,a=r&&s?-1:1,c=ee(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:p}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return u&&typeof p=="number"&&(f=u==="end"?p*-1:p),s?{x:f*a,y:m*d}:{x:m*d,y:f*a}}const Sn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:u}=t,s=await Bn(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(o=u.arrow)!=null&&o.alignmentOffset?{}:{x:i+s.x,y:r+s.y,data:{...s,placement:l}}}}},Rn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:u={fn:v=>{let{x:h,y:w}=v;return{x:h,y:w}}},...s}=ee(e,t),d={x:n,y:o},a=await xe(t,s),c=le(te(i)),m=Je(c);let f=d[m],p=d[c];if(r){const v=m==="y"?"top":"left",h=m==="y"?"bottom":"right",w=f+a[v],b=f-a[h];f=Ue(w,f,b)}if(l){const v=c==="y"?"top":"left",h=c==="y"?"bottom":"right",w=p+a[v],b=p-a[h];p=Ue(w,p,b)}const g=u.fn({...t,[m]:f,[c]:p});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[m]:r,[c]:l}}}}}},_n=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=t,{offset:u=0,mainAxis:s=!0,crossAxis:d=!0}=ee(e,t),a={x:n,y:o},c=le(i),m=Je(c);let f=a[m],p=a[c];const g=ee(u,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(s){const b=m==="y"?"height":"width",A=r.reference[m]-r.floating[b]+v.mainAxis,C=r.reference[m]+r.reference[b]-v.mainAxis;fC&&(f=C)}if(d){var h,w;const b=m==="y"?"width":"height",A=["top","left"].includes(te(i)),C=r.reference[c]-r.floating[b]+(A&&((h=l.offset)==null?void 0:h[c])||0)+(A?0:v.crossAxis),k=r.reference[c]+r.reference[b]+(A?0:((w=l.offset)==null?void 0:w[c])||0)-(A?v.crossAxis:0);pk&&(p=k)}return{[m]:f,[c]:p}}}},$n=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:r,platform:l,elements:u}=t,{apply:s=()=>{},...d}=ee(e,t),a=await xe(t,d),c=te(i),m=ye(i),f=le(i)==="y",{width:p,height:g}=r.floating;let v,h;c==="top"||c==="bottom"?(v=c,h=m===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(h=c,v=m==="end"?"top":"bottom");const w=g-a.top-a.bottom,b=p-a.left-a.right,A=re(g-a[v],w),C=re(p-a[h],b),k=!t.middlewareData.shift;let E=A,B=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=w),k&&!m){const D=W(a.left,0),j=W(a.right,0),M=W(a.top,0),F=W(a.bottom,0);f?B=p-2*(D!==0||j!==0?D+j:W(a.left,a.right)):E=g-2*(M!==0||F!==0?M+F:W(a.top,a.bottom))}await s({...t,availableWidth:B,availableHeight:E});const L=await l.getDimensions(u.floating);return p!==L.width||g!==L.height?{reset:{rects:!0}}:{}}}};function Ne(){return typeof window<"u"}function de(e){return et(e)?(e.nodeName||"").toLowerCase():"#document"}function z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function J(e){var t;return(t=(et(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function et(e){return Ne()?e instanceof Node||e instanceof z(e).Node:!1}function U(e){return Ne()?e instanceof Element||e instanceof z(e).Element:!1}function q(e){return Ne()?e instanceof HTMLElement||e instanceof z(e).HTMLElement:!1}function ht(e){return!Ne()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof z(e).ShadowRoot}function Ce(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=G(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Ln(e){return["table","td","th"].includes(de(e))}function He(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function tt(e){const t=nt(),n=U(e)?G(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Mn(e){let t=ae(e);for(;q(t)&&!he(t);){if(tt(t))return t;if(He(t))return null;t=ae(t)}return null}function nt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function he(e){return["html","body","#document"].includes(de(e))}function G(e){return z(e).getComputedStyle(e)}function Fe(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ae(e){if(de(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ht(e)&&e.host||J(e);return ht(t)?t.host:t}function Rt(e){const t=ae(e);return he(t)?e.ownerDocument?e.ownerDocument.body:e.body:q(t)&&Ce(t)?t:Rt(t)}function we(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Rt(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=z(i);if(r){const u=Ye(l);return t.concat(l,l.visualViewport||[],Ce(i)?i:[],u&&n?we(u):[])}return t.concat(i,we(i,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _t(e){const t=G(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=q(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,u=Se(n)!==r||Se(o)!==l;return u&&(n=r,o=l),{width:n,height:o,$:u}}function ot(e){return U(e)?e:e.contextElement}function ve(e){const t=ot(e);if(!q(t))return X(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=_t(t);let l=(r?Se(n.width):n.width)/o,u=(r?Se(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const Nn=X(0);function $t(e){const t=z(e);return!nt()||!t.visualViewport?Nn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==z(e)?!1:t}function ce(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=ot(e);let l=X(1);t&&(o?U(o)&&(l=ve(o)):l=ve(e));const u=Hn(r,n,o)?$t(r):X(0);let s=(i.left+u.x)/l.x,d=(i.top+u.y)/l.y,a=i.width/l.x,c=i.height/l.y;if(r){const m=z(r),f=o&&U(o)?z(o):o;let p=m,g=Ye(p);for(;g&&o&&f!==p;){const v=ve(g),h=g.getBoundingClientRect(),w=G(g),b=h.left+(g.clientLeft+parseFloat(w.paddingLeft))*v.x,A=h.top+(g.clientTop+parseFloat(w.paddingTop))*v.y;s*=v.x,d*=v.y,a*=v.x,c*=v.y,s+=b,d+=A,p=z(g),g=Ye(p)}}return _e({width:a,height:c,x:s,y:d})}function it(e,t){const n=Fe(e).scrollLeft;return t?t.left+n:ce(J(e)).left+n}function Lt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:it(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function Fn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=J(o),u=t?He(t.floating):!1;if(o===l||u&&r)return n;let s={scrollLeft:0,scrollTop:0},d=X(1);const a=X(0),c=q(o);if((c||!c&&!r)&&((de(o)!=="body"||Ce(l))&&(s=Fe(o)),q(o))){const f=ce(o);d=ve(o),a.x=f.x+o.clientLeft,a.y=f.y+o.clientTop}const m=l&&!c&&!r?Lt(l,s,!0):X(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-s.scrollLeft*d.x+a.x+m.x,y:n.y*d.y-s.scrollTop*d.y+a.y+m.y}}function Wn(e){return Array.from(e.getClientRects())}function zn(e){const t=J(e),n=Fe(e),o=e.ownerDocument.body,i=W(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=W(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+it(e);const u=-n.scrollTop;return G(o).direction==="rtl"&&(l+=W(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:u}}function In(e,t){const n=z(e),o=J(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,u=0,s=0;if(i){r=i.width,l=i.height;const d=nt();(!d||d&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:r,height:l,x:u,y:s}}function Vn(e,t){const n=ce(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=q(e)?ve(e):X(1),l=e.clientWidth*r.x,u=e.clientHeight*r.y,s=i*r.x,d=o*r.y;return{width:l,height:u,x:s,y:d}}function gt(e,t,n){let o;if(t==="viewport")o=In(e,n);else if(t==="document")o=zn(J(e));else if(U(t))o=Vn(t,n);else{const i=$t(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return _e(o)}function Mt(e,t){const n=ae(e);return n===t||!U(n)||he(n)?!1:G(n).position==="fixed"||Mt(n,t)}function jn(e,t){const n=t.get(e);if(n)return n;let o=we(e,[],!1).filter(u=>U(u)&&de(u)!=="body"),i=null;const r=G(e).position==="fixed";let l=r?ae(e):e;for(;U(l)&&!he(l);){const u=G(l),s=tt(l);!s&&u.position==="fixed"&&(i=null),(r?!s&&!i:!s&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ce(l)&&!s&&Mt(e,l))?o=o.filter(a=>a!==l):i=u,l=ae(l)}return t.set(e,o),o}function Un(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?He(t)?[]:jn(t,this._c):[].concat(n),o],u=l[0],s=l.reduce((d,a)=>{const c=gt(t,a,i);return d.top=W(c.top,d.top),d.right=re(c.right,d.right),d.bottom=re(c.bottom,d.bottom),d.left=W(c.left,d.left),d},gt(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Gn(e){const{width:t,height:n}=_t(e);return{width:t,height:n}}function Yn(e,t,n){const o=q(t),i=J(t),r=n==="fixed",l=ce(e,!0,r,t);let u={scrollLeft:0,scrollTop:0};const s=X(0);if(o||!o&&!r)if((de(t)!=="body"||Ce(i))&&(u=Fe(t)),o){const m=ce(t,!0,r,t);s.x=m.x+t.clientLeft,s.y=m.y+t.clientTop}else i&&(s.x=it(i));const d=i&&!o&&!r?Lt(i,u):X(0),a=l.left+u.scrollLeft-s.x-d.x,c=l.top+u.scrollTop-s.y-d.y;return{x:a,y:c,width:l.width,height:l.height}}function je(e){return G(e).position==="static"}function yt(e,t){if(!q(e)||G(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function Nt(e,t){const n=z(e);if(He(e))return n;if(!q(e)){let i=ae(e);for(;i&&!he(i);){if(U(i)&&!je(i))return i;i=ae(i)}return n}let o=yt(e,t);for(;o&&Ln(o)&&je(o);)o=yt(o,t);return o&&he(o)&&je(o)&&!tt(o)?n:o||Mn(e)||n}const Kn=async function(e){const t=this.getOffsetParent||Nt,n=this.getDimensions,o=await n(e.floating);return{reference:Yn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Xn(e){return G(e).direction==="rtl"}const qn={convertOffsetParentRelativeRectToViewportRelativeRect:Fn,getDocumentElement:J,getClippingRect:Un,getOffsetParent:Nt,getElementRects:Kn,getClientRects:Wn,getDimensions:Gn,getScale:ve,isElement:U,isRTL:Xn};function Ht(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Jn(e,t){let n=null,o;const i=J(e);function r(){var u;clearTimeout(o),(u=n)==null||u.disconnect(),n=null}function l(u,s){u===void 0&&(u=!1),s===void 0&&(s=1),r();const d=e.getBoundingClientRect(),{left:a,top:c,width:m,height:f}=d;if(u||t(),!m||!f)return;const p=De(c),g=De(i.clientWidth-(a+m)),v=De(i.clientHeight-(c+f)),h=De(a),b={rootMargin:-p+"px "+-g+"px "+-v+"px "+-h+"px",threshold:W(0,re(1,s))||1};let A=!0;function C(k){const E=k[0].intersectionRatio;if(E!==s){if(!A)return l();E?l(!1,E):o=setTimeout(()=>{l(!1,1e-7)},1e3)}E===1&&!Ht(d,e.getBoundingClientRect())&&l(),A=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,b)}n.observe(e)}return l(!0),r}function Qn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:s=!1}=o,d=ot(e),a=i||r?[...d?we(d):[],...we(t)]:[];a.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),r&&h.addEventListener("resize",n)});const c=d&&u?Jn(d,n):null;let m=-1,f=null;l&&(f=new ResizeObserver(h=>{let[w]=h;w&&w.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(t)})),n()}),d&&!s&&f.observe(d),f.observe(t));let p,g=s?ce(e):null;s&&v();function v(){const h=ce(e);g&&!Ht(g,h)&&n(),g=h,p=requestAnimationFrame(v)}return n(),()=>{var h;a.forEach(w=>{i&&w.removeEventListener("scroll",n),r&&w.removeEventListener("resize",n)}),c==null||c(),(h=f)==null||h.disconnect(),f=null,s&&cancelAnimationFrame(p)}}const Zn=Sn,eo=Rn,bt=Pn,to=$n,no=kn,oo=Tn,io=_n,ro=(e,t,n)=>{const o=new Map,i={platform:qn,...n},r={...i.platform,_c:o};return Dn(e,t,{...i,platform:r})};function lo(e){return e!=null&&typeof e=="object"&&"$el"in e}function Ke(e){if(lo(e)){const t=e.$el;return et(t)&&de(t)==="#comment"?null:t}return e}function pe(e){return typeof e=="function"?e():y(e)}function ao(e){return{name:"arrow",options:e,fn(t){const n=Ke(pe(e.element));return n==null?{}:oo({element:n,padding:e.padding}).fn(t)}}}function Ft(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xt(e,t){const n=Ft(e);return Math.round(t*n)/n}function so(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=O(()=>{var E;return(E=pe(n.open))!=null?E:!0}),r=O(()=>pe(n.middleware)),l=O(()=>{var E;return(E=pe(n.placement))!=null?E:"bottom"}),u=O(()=>{var E;return(E=pe(n.strategy))!=null?E:"absolute"}),s=O(()=>{var E;return(E=pe(n.transform))!=null?E:!0}),d=O(()=>Ke(e.value)),a=O(()=>Ke(t.value)),c=T(0),m=T(0),f=T(u.value),p=T(l.value),g=wt({}),v=T(!1),h=O(()=>{const E={position:f.value,left:"0",top:"0"};if(!a.value)return E;const B=xt(a.value,c.value),L=xt(a.value,m.value);return s.value?{...E,transform:"translate("+B+"px, "+L+"px)",...Ft(a.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:B+"px",top:L+"px"}});let w;function b(){if(d.value==null||a.value==null)return;const E=i.value;ro(d.value,a.value,{middleware:r.value,placement:l.value,strategy:u.value}).then(B=>{c.value=B.x,m.value=B.y,f.value=B.strategy,p.value=B.placement,g.value=B.middlewareData,v.value=E!==!1})}function A(){typeof w=="function"&&(w(),w=void 0)}function C(){if(A(),o===void 0){b();return}if(d.value!=null&&a.value!=null){w=o(d.value,a.value,b);return}}function k(){i.value||(v.value=!1)}return K([r,l,u,i],b,{flush:"sync"}),K([d,a],C,{flush:"sync"}),K(i,k,{flush:"sync"}),Ct()&&At(A),{x:fe(c),y:fe(m),strategy:fe(f),placement:fe(p),middlewareData:fe(g),isPositioned:fe(v),floatingStyles:h,update:b}}function Ae(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[i=>{const r=qt(o,i);if(r||r===null)return r;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},i=>(dn(o,i),i)]}function Wt(e,t,n){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(i)}function uo(e,t){var n;const o=wt();return Z(()=>{o.value=e()},{...t,flush:(n=void 0)!=null?n:"sync"}),Tt(o)}function We(e){return Ct()?(At(e),!0):!1}function co(){const e=new Set,t=n=>{e.delete(n)};return{on:n=>{e.add(n);const o=()=>t(n);return We(o),{off:o}},off:t,trigger:(...n)=>Promise.all(Array.from(e).map(o=>o(...n)))}}function fo(e){let t=!1,n;const o=cn(!0);return(...i)=>(t||(n=o.run(()=>e(...i)),t=!0),n)}function ue(e){return typeof e=="function"?e():y(e)}const Oe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const po=e=>typeof e<"u",mo=Object.prototype.toString,vo=e=>mo.call(e)==="[object Object]",ho=()=>{};function go(e,t=1e4){return un((n,o)=>{let i=ue(e),r;const l=()=>setTimeout(()=>{i=ue(e),o()},ue(t));return We(()=>{clearTimeout(r)}),{get(){return n(),i},set(u){i=u,o(),clearTimeout(r),r=l()}}})}function zt(e,t,n={}){const{immediate:o=!0}=n,i=T(!1);let r=null;function l(){r&&(clearTimeout(r),r=null)}function u(){i.value=!1,l()}function s(...d){l(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...d)},ue(t))}return o&&(i.value=!0,Oe&&s()),We(u),{isPending:Tt(i),start:s,stop:u}}function ze(e){var t;const n=ue(e);return(t=n==null?void 0:n.$el)!=null?t:n}const rt=Oe?window:void 0;function Xe(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=rt):[t,n,o,i]=e,!t)return ho;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],l=()=>{r.forEach(a=>a()),r.length=0},u=(a,c,m,f)=>(a.addEventListener(c,m,f),()=>a.removeEventListener(c,m,f)),s=K(()=>[ze(t),ue(i)],([a,c])=>{if(l(),!a)return;const m=vo(c)?{...c}:c;r.push(...n.flatMap(f=>o.map(p=>u(a,f,p,m))))},{immediate:!0,flush:"post"}),d=()=>{s(),l()};return We(d),d}function yo(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function bo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=rt,eventName:r="keydown",passive:l=!1,dedupe:u=!1}=o,s=yo(t);return Xe(i,r,d=>{d.repeat&&ue(u)||s(d)&&n(d)},l)}function xo(){const e=T(!1),t=ge();return t&&$e(()=>{e.value=!0},t),e}function wo(e){return JSON.parse(JSON.stringify(e))}function Co(e,t,n,o={}){var i,r,l;const{clone:u=!1,passive:s=!1,eventName:d,deep:a=!1,defaultValue:c,shouldEmit:m}=o,f=ge(),p=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let g=d;g=g||`update:${t.toString()}`;const v=b=>u?typeof u=="function"?u(b):wo(b):b,h=()=>po(e[t])?v(e[t]):c,w=b=>{m?m(b)&&p(g,b):p(g,b)};if(s){const b=h(),A=T(b);let C=!1;return K(()=>e[t],k=>{C||(C=!0,A.value=v(k),Le(()=>C=!1))}),K(A,k=>{!C&&(k!==e[t]||a)&&w(k)},{deep:a}),A}else return O({get(){return h()},set(b){w(b)}})}function lt(e){return e?e.flatMap(t=>t.type===Be?lt(t.children):[t]):[]}const[Ao,Mi]=Ae("ConfigProvider");function Oo(e){const t=ge(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(i=>{o[on(Bt(i))]=(...r)=>e(i,...r)}),o}function It(e){const t=ge(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((i,r)=>{const l=(t==null?void 0:t.type.props[r]).default;return l!==void 0&&(i[r]=l),i},{}),o=nn(e);return O(()=>{const i={},r=(t==null?void 0:t.vnode.props)??{};return Object.keys(r).forEach(l=>{i[Bt(l)]=r[l]}),Object.keys({...n,...i}).reduce((l,u)=>(o.value[u]!==void 0&&(l[u]=o.value[u]),l),{})})}function Eo(e,t){const n=It(e),o=t?Oo(t):{};return O(()=>({...n.value,...o}))}function I(){const e=ge(),t=T(),n=O(()=>{var l,u;return["#text","#comment"].includes((l=t.value)==null?void 0:l.$el.nodeName)?(u=t.value)==null?void 0:u.$el.nextElementSibling:ze(t)}),o=Object.assign({},e.exposed),i={};for(const l in e.props)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function r(l){t.value=l,l&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=i)}return{forwardRef:r,currentRef:t,currentElement:n}}function Do(e,t){const n=go(!1,300),o=T(null),i=co();function r(){o.value=null,n.value=!1}function l(u,s){const d=u.currentTarget,a={x:u.clientX,y:u.clientY},c=To(a,d.getBoundingClientRect()),m=Po(a,c),f=ko(s.getBoundingClientRect()),p=So([...m,...f]);o.value=p,n.value=!0}return Z(u=>{if(e.value&&t.value){const s=a=>l(a,t.value),d=a=>l(a,e.value);e.value.addEventListener("pointerleave",s),t.value.addEventListener("pointerleave",d),u(()=>{var a,c;(a=e.value)==null||a.removeEventListener("pointerleave",s),(c=t.value)==null||c.removeEventListener("pointerleave",d)})}}),Z(u=>{var s;if(o.value){const d=a=>{var c,m;if(!o.value)return;const f=a.target,p={x:a.clientX,y:a.clientY},g=((c=e.value)==null?void 0:c.contains(f))||((m=t.value)==null?void 0:m.contains(f)),v=!Bo(p,o.value),h=!!f.closest("[data-grace-area-trigger]");g?r():(v||h)&&(r(),i.trigger())};(s=e.value)==null||s.ownerDocument.addEventListener("pointermove",d),u(()=>{var a;return(a=e.value)==null?void 0:a.ownerDocument.removeEventListener("pointermove",d)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function To(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,o,i,r)){case r:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Po(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function ko(e){const{top:t,right:n,bottom:o,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:o},{x:i,y:o}]}function Bo(e,t){const{x:n,y:o}=e;let i=!1;for(let r=0,l=t.length-1;ro!=a>o&&n<(d-u)*(o-s)/(a-s)+u&&(i=!i)}return i}function So(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),Ro(t)}function Ro(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const r=t[t.length-1],l=t[t.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;n.length>=2;){const r=n[n.length-1],l=n[n.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}let _o=0;function $o(e,t="radix"){const n=Ao({useId:void 0});return st?`${t}-${st()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++_o}`}function Lo(e){const t=T(),n=O(()=>{var i;return((i=t.value)==null?void 0:i.width)??0}),o=O(()=>{var i;return((i=t.value)==null?void 0:i.height)??0});return $e(()=>{const i=ze(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const r=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];let s,d;if("borderBoxSize"in u){const a=u.borderBoxSize,c=Array.isArray(a)?a[0]:a;s=c.inlineSize,d=c.blockSize}else s=i.offsetWidth,d=i.offsetHeight;t.value={width:s,height:d}});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else t.value=void 0}),{width:n,height:o}}function Mo(e,t){const n=T(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}const No=_({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o,i;if(!n.default)return null;const r=lt(n.default()),l=r.findIndex(a=>a.type!==Pt);if(l===-1)return r;const u=r[l];(o=u.props)==null||delete o.ref;const s=u.props?se(t,u.props):t;t.class&&(i=u.props)!=null&&i.class&&delete u.props.class;const d=tn(u,s);for(const a in s)a.startsWith("on")&&(d.props||(d.props={}),d.props[a]=s[a]);return r.length===1?d:(r[l]=d,r)}}}),be=_({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>Pe(o,t):o!=="template"?()=>Pe(e.as,t,{default:n.default}):()=>Pe(No,t,{default:n.default})}});function Ho(e,t){var n;const o=T({}),i=T("none"),r=T(e),l=e.value?"mounted":"unmounted";let u;const s=((n=t.value)==null?void 0:n.ownerDocument.defaultView)??rt,{state:d,dispatch:a}=Mo(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),c=v=>{var h;if(Oe){const w=new CustomEvent(v,{bubbles:!1,cancelable:!1});(h=t.value)==null||h.dispatchEvent(w)}};K(e,async(v,h)=>{var w;const b=h!==v;if(await Le(),b){const A=i.value,C=Te(t.value);v?(a("MOUNT"),c("enter"),C==="none"&&c("after-enter")):C==="none"||((w=o.value)==null?void 0:w.display)==="none"?(a("UNMOUNT"),c("leave"),c("after-leave")):h&&A!==C?(a("ANIMATION_OUT"),c("leave")):(a("UNMOUNT"),c("after-leave"))}},{immediate:!0});const m=v=>{const h=Te(t.value),w=h.includes(v.animationName),b=d.value==="mounted"?"enter":"leave";if(v.target===t.value&&w&&(c(`after-${b}`),a("ANIMATION_END"),!r.value)){const A=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",u=s==null?void 0:s.setTimeout(()=>{var C;((C=t.value)==null?void 0:C.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=A)})}v.target===t.value&&h==="none"&&a("ANIMATION_END")},f=v=>{v.target===t.value&&(i.value=Te(t.value))},p=K(t,(v,h)=>{v?(o.value=getComputedStyle(v),v.addEventListener("animationstart",f),v.addEventListener("animationcancel",m),v.addEventListener("animationend",m)):(a("ANIMATION_END"),u!==void 0&&(s==null||s.clearTimeout(u)),h==null||h.removeEventListener("animationstart",f),h==null||h.removeEventListener("animationcancel",m),h==null||h.removeEventListener("animationend",m))},{immediate:!0}),g=K(d,()=>{const v=Te(t.value);i.value=d.value==="mounted"?v:"none"});return sn(()=>{p(),g()}),{isPresent:O(()=>["mounted","unmountSuspended"].includes(d.value))}}function Te(e){return e&&getComputedStyle(e).animationName||"none"}const Fo=_({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var o;const{present:i,forceMount:r}=Ot(e),l=T(),{isPresent:u}=Ho(i,l);n({present:u});let s=t.default({present:u});s=lt(s||[]);const d=ge();if(s&&(s==null?void 0:s.length)>1){const a=(o=d==null?void 0:d.parent)!=null&&o.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${a}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(c=>` - ${c}`).join(` -`)].join(` -`))}return()=>r.value||i.value||u.value?Pe(t.default({present:u})[0],{ref:a=>{const c=ze(a);return typeof(c==null?void 0:c.hasAttribute)>"u"||(c!=null&&c.hasAttribute("data-radix-popper-content-wrapper")?l.value=c.firstElementChild:l.value=c),c}}):null}}),Wo=_({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=xo();return(n,o)=>y(t)||n.forceMount?(R(),H(Qt,{key:0,to:n.to,disabled:n.disabled},[$(n.$slots,"default")],8,["to","disabled"])):Jt("",!0)}}),zo="dismissableLayer.pointerDownOutside",Io="dismissableLayer.focusOutside";function Vt(e,t){const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),i=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&o===n||i.indexOf(o){});return Z(l=>{if(!Oe)return;const u=async d=>{const a=d.target;if(t!=null&&t.value){if(Vt(t.value,a)){i.value=!1;return}if(d.target&&!i.value){let c=function(){Wt(zo,e,m)};const m={originalEvent:d};d.pointerType==="touch"?(o.removeEventListener("click",r.value),r.value=c,o.addEventListener("click",r.value,{once:!0})):c()}else o.removeEventListener("click",r.value);i.value=!1}},s=window.setTimeout(()=>{o.addEventListener("pointerdown",u)},0);l(()=>{window.clearTimeout(s),o.removeEventListener("pointerdown",u),o.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>i.value=!0}}function jo(e,t){var n;const o=((n=t==null?void 0:t.value)==null?void 0:n.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=T(!1);return Z(r=>{if(!Oe)return;const l=async u=>{t!=null&&t.value&&(await Le(),!(!t.value||Vt(t.value,u.target))&&u.target&&!i.value&&Wt(Io,e,{originalEvent:u}))};o.addEventListener("focusin",l),r(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const Q=an({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Uo=_({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:i,currentElement:r}=I(),l=O(()=>{var p;return((p=r.value)==null?void 0:p.ownerDocument)??globalThis.document}),u=O(()=>Q.layersRoot),s=O(()=>r.value?Array.from(u.value).indexOf(r.value):-1),d=O(()=>Q.layersWithOutsidePointerEventsDisabled.size>0),a=O(()=>{const p=Array.from(u.value),[g]=[...Q.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(g);return s.value>=v}),c=Vo(async p=>{const g=[...Q.branches].some(v=>v==null?void 0:v.contains(p.target));!a.value||g||(o("pointerDownOutside",p),o("interactOutside",p),await Le(),p.defaultPrevented||o("dismiss"))},r),m=jo(p=>{[...Q.branches].some(g=>g==null?void 0:g.contains(p.target))||(o("focusOutside",p),o("interactOutside",p),p.defaultPrevented||o("dismiss"))},r);bo("Escape",p=>{s.value===u.value.size-1&&(o("escapeKeyDown",p),p.defaultPrevented||o("dismiss"))});let f;return Z(p=>{r.value&&(n.disableOutsidePointerEvents&&(Q.layersWithOutsidePointerEventsDisabled.size===0&&(f=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),Q.layersWithOutsidePointerEventsDisabled.add(r.value)),u.value.add(r.value),p(()=>{n.disableOutsidePointerEvents&&Q.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=f)}))}),Z(p=>{p(()=>{r.value&&(u.value.delete(r.value),Q.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(p,g)=>(R(),H(y(be),{ref:y(i),"as-child":p.asChild,as:p.as,"data-dismissable-layer":"",style:Me({pointerEvents:d.value?a.value?"auto":"none":void 0}),onFocusCapture:y(m).onFocusCapture,onBlurCapture:y(m).onBlurCapture,onPointerdownCapture:y(c).onPointerDownCapture},{default:P(()=>[$(p.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}});fo(()=>T([]));const[jt,Go]=Ae("PopperRoot"),Yo=_({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=T();return Go({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>$(n.$slots,"default")}}),Ko=_({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const t=e,{forwardRef:n,currentElement:o}=I(),i=jt();return Z(()=>{i.onAnchorChange(t.element??o.value)}),(r,l)=>(R(),H(y(be),{ref:y(n),as:r.as,"as-child":r.asChild},{default:P(()=>[$(r.$slots,"default")]),_:3},8,["as","as-child"]))}});function Xo(e){return e!==null}function qo(e){return{name:"transformOrigin",options:e,fn(t){var n,o,i;const{placement:r,rects:l,middlewareData:u}=t,s=((n=u.arrow)==null?void 0:n.centerOffset)!==0,d=s?0:e.arrowWidth,a=s?0:e.arrowHeight,[c,m]=qe(r),f={start:"0%",center:"50%",end:"100%"}[m],p=(((o=u.arrow)==null?void 0:o.x)??0)+d/2,g=(((i=u.arrow)==null?void 0:i.y)??0)+a/2;let v="",h="";return c==="bottom"?(v=s?f:`${p}px`,h=`${-a}px`):c==="top"?(v=s?f:`${p}px`,h=`${l.floating.height+a}px`):c==="right"?(v=`${-a}px`,h=s?f:`${g}px`):c==="left"&&(v=`${l.floating.width+a}px`,h=s?f:`${g}px`),{data:{x:v,y:h}}}}}function qe(e){const[t,n="center"]=e.split("-");return[t,n]}const Jo={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[Qo,Zo]=Ae("PopperContent"),ei=_({inheritAttrs:!1,__name:"PopperContent",props:rn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...Jo}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,i=jt(),{forwardRef:r,currentElement:l}=I(),u=T(),s=T(),{width:d,height:a}=Lo(s),c=O(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),m=O(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=O(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),p=O(()=>({padding:m.value,boundary:f.value.filter(Xo),altBoundary:f.value.length>0})),g=uo(()=>[Zn({mainAxis:n.sideOffset+a.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&bt({...p.value}),n.avoidCollisions&&eo({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?io():void 0,...p.value}),!n.prioritizePosition&&n.avoidCollisions&&bt({...p.value}),to({...p.value,apply:({elements:D,rects:j,availableWidth:M,availableHeight:F})=>{const{width:S,height:ne}=j.reference,N=D.floating.style;N.setProperty("--radix-popper-available-width",`${M}px`),N.setProperty("--radix-popper-available-height",`${F}px`),N.setProperty("--radix-popper-anchor-width",`${S}px`),N.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),s.value&&ao({element:s.value,padding:n.arrowPadding}),qo({arrowWidth:d.value,arrowHeight:a.value}),n.hideWhenDetached&&no({strategy:"referenceHidden",...p.value})]),{floatingStyles:v,placement:h,isPositioned:w,middlewareData:b}=so(i.anchor,u,{strategy:"fixed",placement:c,whileElementsMounted:(...D)=>Qn(...D,{animationFrame:n.updatePositionStrategy==="always"}),middleware:g}),A=O(()=>qe(h.value)[0]),C=O(()=>qe(h.value)[1]);ln(()=>{w.value&&o("placed")});const k=O(()=>{var D;return((D=b.value.arrow)==null?void 0:D.centerOffset)!==0}),E=T("");Z(()=>{l.value&&(E.value=window.getComputedStyle(l.value).zIndex)});const B=O(()=>{var D;return((D=b.value.arrow)==null?void 0:D.x)??0}),L=O(()=>{var D;return((D=b.value.arrow)==null?void 0:D.y)??0});return Zo({placedSide:A,onArrowChange:D=>s.value=D,arrowX:B,arrowY:L,shouldHideArrow:k}),(D,j)=>{var M,F,S;return R(),me("div",{ref_key:"floatingRef",ref:u,"data-radix-popper-content-wrapper":"",style:Me({...y(v),transform:y(w)?y(v).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:E.value,"--radix-popper-transform-origin":[(M=y(b).transformOrigin)==null?void 0:M.x,(F=y(b).transformOrigin)==null?void 0:F.y].join(" "),...((S=y(b).hide)==null?void 0:S.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[V(y(be),se({ref:y(r)},D.$attrs,{"as-child":n.asChild,as:D.as,"data-side":A.value,"data-align":C.value,style:{animation:y(w)?void 0:"none"}}),{default:P(()=>[$(D.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),ti=x("polygon",{points:"0,0 30,0 15,10"},null,-1),ni=_({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return I(),(n,o)=>(R(),H(y(be),se(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 30 10",preserveAspectRatio:n.asChild?void 0:"none"}),{default:P(()=>[$(n.$slots,"default",{},()=>[ti])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),oi={top:"bottom",right:"left",bottom:"top",left:"right"},ii=_({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:t}=I(),n=Qo(),o=O(()=>oi[n.placedSide.value]);return(i,r)=>{var l,u,s,d;return R(),me("span",{ref:a=>{y(n).onArrowChange(a)},style:Me({position:"absolute",left:(l=y(n).arrowX)!=null&&l.value?`${(u=y(n).arrowX)==null?void 0:u.value}px`:void 0,top:(s=y(n).arrowY)!=null&&s.value?`${(d=y(n).arrowY)==null?void 0:d.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[y(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[y(n).placedSide.value],visibility:y(n).shouldHideArrow.value?"hidden":void 0})},[V(ni,se(i.$attrs,{ref:y(t),style:{display:"block"},as:i.as,"as-child":i.asChild,width:i.width,height:i.height}),{default:P(()=>[$(i.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),ri=_({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return I(),(t,n)=>(R(),H(y(be),{as:t.as,"as-child":t.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:P(()=>[$(t.$slots,"default")]),_:3},8,["as","as-child"]))}});function li(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}li();const Ut="tooltip.open",[at,ai]=Ae("TooltipProvider"),si=_({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{default:700},skipDelayDuration:{default:300},disableHoverableContent:{type:Boolean,default:!1},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:i,disableClosingTrigger:r,ignoreNonKeyboardFocus:l,disabled:u}=Ot(t);I();const s=T(!0),d=T(!1),{start:a,stop:c}=zt(()=>{s.value=!0},o,{immediate:!1});return ai({isOpenDelayed:s,delayDuration:n,onOpen(){c(),s.value=!1},onClose(){a()},isPointerInTransitRef:d,disableHoverableContent:i,disableClosingTrigger:r,disabled:u,ignoreNonKeyboardFocus:l}),(m,f)=>$(m.$slots,"default")}}),[Ie,ui]=Ae("TooltipRoot"),ci=_({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},delayDuration:{default:void 0},disableHoverableContent:{type:Boolean,default:void 0},disableClosingTrigger:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;I();const i=at(),r=O(()=>n.disableHoverableContent??i.disableHoverableContent.value),l=O(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),u=O(()=>n.disabled??i.disabled.value),s=O(()=>n.delayDuration??i.delayDuration.value),d=O(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),a=Co(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});K(a,b=>{i.onClose&&(b?(i.onOpen(),document.dispatchEvent(new CustomEvent(Ut))):i.onClose())});const c=T(!1),m=T(),f=O(()=>a.value?c.value?"delayed-open":"instant-open":"closed"),{start:p,stop:g}=zt(()=>{c.value=!0,a.value=!0},s,{immediate:!1});function v(){g(),c.value=!1,a.value=!0}function h(){g(),a.value=!1}function w(){p()}return ui({contentId:"",open:a,stateAttribute:f,trigger:m,onTriggerChange(b){m.value=b},onTriggerEnter(){i.isOpenDelayed.value?w():v()},onTriggerLeave(){r.value?h():g()},onOpen:v,onClose:h,disableHoverableContent:r,disableClosingTrigger:l,disabled:u,ignoreNonKeyboardFocus:d}),(b,A)=>(R(),H(y(Yo),null,{default:P(()=>[$(b.$slots,"default",{open:y(a)})]),_:3}))}}),di=_({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Ie(),o=at();n.contentId||(n.contentId=$o(void 0,"radix-vue-tooltip-content"));const{forwardRef:i,currentElement:r}=I(),l=T(!1),u=T(!1),s=O(()=>n.disabled.value?{}:{click:g,focus:f,pointermove:c,pointerleave:m,pointerdown:a,blur:p});$e(()=>{n.onTriggerChange(r.value)});function d(){setTimeout(()=>{l.value=!1},1)}function a(){l.value=!0,document.addEventListener("pointerup",d,{once:!0})}function c(v){v.pointerType!=="touch"&&!u.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),u.value=!0)}function m(){n.onTriggerLeave(),u.value=!1}function f(v){var h,w;l.value||n.ignoreNonKeyboardFocus.value&&!((w=(h=v.target).matches)!=null&&w.call(h,":focus-visible"))||n.onOpen()}function p(){n.onClose()}function g(){n.disableClosingTrigger.value||n.onClose()}return(v,h)=>(R(),H(y(Ko),{"as-child":""},{default:P(()=>[V(y(be),se({ref:y(i),"aria-describedby":y(n).open.value?y(n).contentId:void 0,"data-state":y(n).stateAttribute.value,as:v.as,"as-child":t.asChild,"data-grace-area-trigger":""},Kt(s.value)),{default:P(()=>[$(v.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),Gt=_({__name:"TooltipContentImpl",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{default:0},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:"partial"},hideWhenDetached:{type:Boolean,default:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ie(),{forwardRef:r}=I(),l=Zt(),u=O(()=>{var a;return(a=l.default)==null?void 0:a.call(l)}),s=O(()=>{var a;if(n.ariaLabel)return n.ariaLabel;let c="";function m(f){typeof f.children=="string"&&f.type!==Pt?c+=f.children:Array.isArray(f.children)&&f.children.forEach(p=>m(p))}return(a=u.value)==null||a.forEach(f=>m(f)),c}),d=O(()=>{const{ariaLabel:a,...c}=n;return c});return $e(()=>{Xe(window,"scroll",a=>{const c=a.target;c!=null&&c.contains(i.trigger.value)&&i.onClose()}),Xe(window,Ut,i.onClose)}),(a,c)=>(R(),H(y(Uo),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:c[0]||(c[0]=m=>o("escapeKeyDown",m)),onPointerDownOutside:c[1]||(c[1]=m=>{var f;y(i).disableClosingTrigger.value&&(f=y(i).trigger.value)!=null&&f.contains(m.target)&&m.preventDefault(),o("pointerDownOutside",m)}),onFocusOutside:c[2]||(c[2]=en(()=>{},["prevent"])),onDismiss:c[3]||(c[3]=m=>y(i).onClose())},{default:P(()=>[V(y(ei),se({ref:y(r),"data-state":y(i).stateAttribute.value},{...a.$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:P(()=>[$(a.$slots,"default"),V(y(ri),{id:y(i).contentId,role:"tooltip"},{default:P(()=>[kt(ke(s.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),fi=_({__name:"TooltipContentHoverable",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},setup(e){const t=It(e),{forwardRef:n,currentElement:o}=I(),{trigger:i,onClose:r}=Ie(),l=at(),{isPointerInTransit:u,onPointerExit:s}=Do(i,o);return l.isPointerInTransitRef=u,s(()=>{r()}),(d,a)=>(R(),H(Gt,se({ref:y(n)},y(t)),{default:P(()=>[$(d.$slots,"default")]),_:3},16))}}),pi=_({__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ie(),r=Eo(n,o),{forwardRef:l}=I();return(u,s)=>(R(),H(y(Fo),{present:u.forceMount||y(i).open.value},{default:P(()=>[(R(),H(Xt(y(i).disableHoverableContent.value?Gt:fi),se({ref:y(l)},y(r)),{default:P(()=>[$(u.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),mi=_({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return I(),(n,o)=>(R(),H(y(ii),Et(Dt(t)),{default:P(()=>[$(n.$slots,"default")]),_:3},16))}}),vi=_({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(R(),H(y(Wo),Et(Dt(t)),{default:P(()=>[$(n.$slots,"default")]),_:3},16))}}),hi={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},gi={"flex-col":""},yi=["onClick"],bi={"p-4":""},xi={flex:"~ col gap-4"},wi=["disabled"],Ci={"mt-4":"",class:"flex items-center justify-end gap-4"},Ai={class:"relative inline-flex cursor-pointer items-center"},Oi=["onClick"],Ei={"p-4":"",flex:"~ col gap-4"},Di={"text-base":"","font-medium":""},Ti={text:"sm neutral-500"},Pi={flex:"~ row","gap-2":""},ki=["onClick"],Bi=_({__name:"index",setup(e){const t=fn(),n=pn(),o=[{name:"Morandi Colors",description:"Soft, muted tones inspired by Giorgio Morandi's paintings",colors:[{hex:"#A5978B",name:"Taupe"},{hex:"#D8CAAF",name:"Beige"},{hex:"#B8B4A7",name:"Ash Grey"},{hex:"#C4BCB1",name:"Light Taupe"},{hex:"#E5DED8",name:"Ivory"},{hex:"#9A8F7D",name:"Olive Grey"},{hex:"#BEB5A7",name:"Sand"},{hex:"#C9C0B6",name:"Warm Grey"}]},{name:"Monet Colors",description:"Impressionist palette inspired by Claude Monet's works",colors:[{hex:"#7A9EAF",name:"Sky Blue"},{hex:"#B8C7CC",name:"Mist"},{hex:"#D4B79C",name:"Sand"},{hex:"#8B9D77",name:"Moss Green"},{hex:"#C7D5CB",name:"Water Lily"},{hex:"#E6D0B1",name:"Wheat"},{hex:"#94A7B1",name:"Slate Blue"},{hex:"#B4C8C3",name:"Sage"}]},{name:"Japanese Colors",description:"Traditional Japanese color palette",colors:[{hex:"#D9B48F",name:"Tan"},{hex:"#B5917A",name:"Warm Taupe"},{hex:"#8C7A6B",name:"Umber"},{hex:"#A17F5F",name:"Coffee"},{hex:"#B98C46",name:"Bronze"},{hex:"#C7A252",name:"Gold"},{hex:"#DAB300",name:"Mustard"},{hex:"#D19826",name:"Amber"}]},{name:"Nordic Colors",description:"Scandinavian minimalist color scheme",colors:[{hex:"#9BA7B0",name:"Nordic Blue"},{hex:"#C1CBD4",name:"Ice"},{hex:"#A5ADB6",name:"Fjord"},{hex:"#8B959E",name:"Steel"},{hex:"#D4DCE4",name:"Glacier"},{hex:"#7F8A94",name:"Slate"},{hex:"#B3BCC6",name:"Cloud"},{hex:"#98A4AE",name:"Stone"}]},{name:"Chinese Traditional Colors",description:"Traditional Chinese colors, derived from ancient textiles, porcelain and paintings",colors:[{hex:"#E4C6D0",name:"霞光红 (Rosy Dawn)"},{hex:"#A61B29",name:"枣红 (Chinese Red)"},{hex:"#5D513C",name:"黄栌 (Smoky Brown)"},{hex:"#789262",name:"竹青 (Bamboo Green)"},{hex:"#1C0D1A",name:"乌梅紫 (Dark Purple)"},{hex:"#F7C242",name:"缃色 (Golden Yellow)"},{hex:"#62A9DD",name:"青冥 (Azure Blue)"},{hex:"#8C4B3C",name:"赭石 (Ochre)"}]}];function i(){n.themeColorsHue=gn,n.themeColorsHueDynamic=!1}function r(u){const s=dt("oklch")(u);if(!s)return;const{h:d}=s;d&&(n.themeColorsHue=d,n.themeColorsHueDynamic=!1)}function l(u){if(n.themeColorsHueDynamic)return!1;const s=dt("oklch")(u);if(!s||!s.h)return!1;const d=Math.abs(s.h-n.themeColorsHue);return d<.01||d>359.99}return(u,s)=>{const d=mn("motion");return R(),me(Be,null,[Ve((R(),me("div",hi,[x("button",{onClick:s[0]||(s[0]=a=>y(t).back())},s[3]||(s[3]=[x("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),s[4]||(s[4]=x("h1",{relative:""},[x("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[x("span",{text:"neutral-300 dark:neutral-500"},"Settings")]),x("div",{"text-3xl":"","font-semibold":""}," Themes ")],-1))])),[[d]]),x("div",gi,[V(y(ct),{"mt-4":"","w-full":"",default:!0},{trigger:P(a=>[x("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:c=>a.setVisible(!a.visible)},[s[6]||(s[6]=x("div",{flex:"~ row 1","items-center":"","gap-1.5":""},[x("div",{"i-solar:pallete-2-bold-duotone":"",class:"provider-icon size-6",transition:"filter duration-250 ease-in-out"}),x("div",null," Custom Colors ")],-1)),x("div",{transform:"",transition:"transform duration-250",class:Ee({"rotate-180":a.visible})},s[5]||(s[5]=[x("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,yi)]),default:P(()=>[x("div",bi,[s[11]||(s[11]=x("div",{class:"mb-2 text-sm font-medium"}," Primary color ",-1)),x("div",xi,[Ve(x("input",{"onUpdate:modelValue":s[1]||(s[1]=a=>y(n).themeColorsHue=a),type:"range",min:"0",max:"360",step:"0.01",class:Ee(["theme-hue-slider h-10 w-full",{"opacity-25 cursor-not-allowed":y(n).themeColorsHueDynamic}]),disabled:y(n).themeColorsHueDynamic},null,10,wi),[[vn,y(n).themeColorsHue]]),s[7]||(s[7]=x("div",{"h-10":"","w-full":"",flex:"","overflow-hidden":"","rounded-lg":""},[x("div",{bg:"primary-50",class:"primary-color-bar","text-black":""}," 50 "),x("div",{bg:"primary-100",class:"primary-color-bar","text-black":""}," 100 "),x("div",{bg:"primary-200",class:"primary-color-bar","text-black":""}," 200 "),x("div",{bg:"primary-300",class:"primary-color-bar","text-black":""}," 300 "),x("div",{bg:"primary-400",class:"primary-color-bar","text-black":""}," 400 "),x("div",{bg:"primary-500",class:"primary-color-bar","text-black":""}," 500 "),x("div",{bg:"primary-600",class:"primary-color-bar","text-white":""}," 600 "),x("div",{bg:"primary-700",class:"primary-color-bar","text-white":""}," 700 "),x("div",{bg:"primary-800",class:"primary-color-bar","text-white":""}," 800 "),x("div",{bg:"primary-900",class:"primary-color-bar","text-white":""}," 900 "),x("div",{bg:"primary-950",class:"primary-color-bar","text-white":""}," 950 ")],-1)),s[8]||(s[8]=x("div",{"h-10":"","w-full":"",flex:"","overflow-hidden":"","rounded-lg":"",class:"transparency-grid"},[x("div",{bg:"primary-500/5",class:"primary-color-bar","text-black":""}," 500/5 "),x("div",{bg:"primary-500/10",class:"primary-color-bar","text-black":""}," 500/10 "),x("div",{bg:"primary-500/20",class:"primary-color-bar","text-black":""}," 500/20 "),x("div",{bg:"primary-500/30",class:"primary-color-bar","text-black":""}," 500/30 "),x("div",{bg:"primary-500/40",class:"primary-color-bar","text-black":""}," 500/40 "),x("div",{bg:"primary-500/50",class:"primary-color-bar","text-black":""}," 500/50 "),x("div",{bg:"primary-500/60",class:"primary-color-bar","text-black":""}," 500/60 "),x("div",{bg:"primary-500/70",class:"primary-color-bar","text-black":""}," 500/70 "),x("div",{bg:"primary-500/80",class:"primary-color-bar","text-black":""}," 500/80 "),x("div",{bg:"primary-500/90",class:"primary-color-bar","text-black":""}," 500/90 "),x("div",{bg:"primary-500",class:"primary-color-bar","text-black":""}," 500 ")],-1))]),x("div",Ci,[x("label",Ai,[Ve(x("input",{"onUpdate:modelValue":s[2]||(s[2]=a=>y(n).themeColorsHueDynamic=a),type:"checkbox",class:"peer sr-only"},null,512),[[hn,y(n).themeColorsHueDynamic]]),s[9]||(s[9]=x("div",{class:"peer-checked:bg-primary-500 h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),s[10]||(s[10]=x("span",{class:"ml-2 text-sm font-medium"},"I Want It Dynamic!",-1))]),x("button",{class:"rounded-md bg-neutral-100 px-3 py-1.5 text-sm transition-colors dark:bg-neutral-800 hover:bg-neutral-200 dark:hover:bg-neutral-700",onClick:i}," Reset to Default ")])])]),_:1}),V(y(ct),{"mt-4":"","w-full":"",default:!0},{trigger:P(a=>[x("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:c=>a.setVisible(!a.visible)},[s[13]||(s[13]=x("div",{flex:"~ row 1","items-center":"","gap-1.5":""},[x("div",{"i-solar:magic-stick-2-bold-duotone":"",class:"provider-icon size-6",transition:"filter duration-250 ease-in-out"}),x("div",null," Theme Presets ")],-1)),x("div",{transform:"",transition:"transform duration-250",class:Ee({"rotate-180":a.visible})},s[12]||(s[12]=[x("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,Oi)]),default:P(()=>[x("div",Ei,[(R(),me(Be,null,ut(o,a=>x("div",{key:a.name,flex:"~ row",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250","cursor-pointer":"","items-center":"","justify-between":"","gap-4":"","rounded-lg":"","px-4":"","py-3":""},[x("div",null,[x("div",Di,ke(a.name),1),x("div",Ti,ke(a.description),1)]),x("div",Pi,[(R(!0),me(Be,null,ut(a.colors,c=>(R(),H(y(si),{key:c.hex},{default:P(()=>[V(y(ci),null,{default:P(()=>[V(y(di),null,{default:P(()=>[x("div",{style:Me({backgroundColor:c.hex}),class:Ee(["size-6 cursor-pointer rounded-full transition-all duration-250 ease-in-out",[l(c.hex)?"scale-150 z-10 mx-1":"hover:scale-110"]]),onClick:m=>r(c.hex)},null,14,ki)]),_:2},1024),V(y(vi),null,{default:P(()=>[V(y(pi),{class:"rounded-lg bg-white px-3 py-1.5 text-sm shadow-md dark:bg-neutral-800"},{default:P(()=>[kt(ke(c.name)+" ",1),V(y(mi),{class:"fill-white dark:fill-neutral-800"})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])])),64))])]),_:1})]),s[14]||(s[14]=x("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[x("div",{text:"40","i-lucide:paintbrush":""})],-1))],64)}}});typeof ft=="function"&&ft(Bi);export{Bi as default}; diff --git a/assets/index-DfQ41DTF.js b/assets/index-Dn5R1iW2.js similarity index 68% rename from assets/index-DfQ41DTF.js rename to assets/index-Dn5R1iW2.js index 9d9d3aed10a89dd73c0fd85d002af58ccef39c3d..81d442a527998d14b91d6deda60380a732a7939c 100644 --- a/assets/index-DfQ41DTF.js +++ b/assets/index-Dn5R1iW2.js @@ -1,29 +1,29 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-DGYx1wbw.js","assets/HeaderLink-krzA17lf.js","assets/HeaderLink-DsxHr3rn.css","assets/index-DUFhcJBN.js","assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js","assets/Stage-Bjp85GUK.css","assets/index-bumnzUvc.js","assets/providers-CM7Pgz9x.js","assets/queue-Cg3xGvOu.js","assets/queues-CiZ1BAMa.js","assets/speech-Dcq6O7ME.js","assets/Model.vue_vue_type_script_setup_true_lang-CXVrD7v3.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js","assets/consciousness-v07tqYpy.js","assets/index-E4dUVNwC.js","assets/route-block-B_A1xBdJ.js","assets/index-DwGglKsd.css","assets/image-Dj4bQptd.js","assets/image-BhuwcwI9.css","assets/queue-DhMvrul4.js","assets/index-CwztT5AX.js","assets/index-sRXUKZKg.js","assets/index-CyuWFHi7.js","assets/IconStatusItem-CFCfq1lX.js","assets/consciousness-Dp9J01tk.js","assets/RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CDWI8QsS.js","assets/speech-CJtnVd8v.js","assets/Range-naQD8Ont.js","assets/index-qbVWDvFi.js","assets/cloudflare-workers-ai-Qanyjg-b.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js","assets/deepseek-Bp1UKOd8.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js","assets/elevenlabs-BxwtmmmG.js","assets/fireworks-ai-ZLkLrHBi.js","assets/mistral-ai-SRpzYQgW.js","assets/moonshot-ai-CrS3VCmD.js","assets/novita-ai-AV_AAG7n.js","assets/ollama-DlE099gn.js","assets/openai-D275seCU.js","assets/openrouter-ai-COzImo4T.js","assets/together-ai-BYBUsnJP.js","assets/xai-CuM3qEtK.js","assets/index-Dcdz53V-.js","assets/index-DfgF6wHE.css","assets/delays-BrYcT-eG.js","assets/emotions-D4NlkiN7.js","assets/messages-BKGdf620.js"])))=>i.map(i=>d[i]); -var fw=Object.defineProperty;var hw=(n,e,t)=>e in n?fw(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ii=(n,e,t)=>hw(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();const dw="modulepreload",pw=function(n){return"/"+n},L_={},vt=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(t.map(l=>{if(l=pw(l),l in L_)return;L_[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":dw,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,d)=>{f.addEventListener("load",h),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-KObnLwB5.js","assets/HeaderLink-CWVUXFCL.js","assets/HeaderLink-DsxHr3rn.css","assets/index-BGoUir2o.js","assets/Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js","assets/Stage-Bjp85GUK.css","assets/index-DLIkN3Ho.js","assets/providers-Li1UUmJz.js","assets/queue-D3IvB2cI.js","assets/queues-CxsPIAz3.js","assets/speech-Ci8yfKRf.js","assets/Model.vue_vue_type_script_setup_true_lang-NsUHJ7rm.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js","assets/consciousness-BhvliREc.js","assets/index-Dr3dNwKO.js","assets/route-block-B_A1xBdJ.js","assets/index-BeuidkcH.css","assets/image-DgYLXlCK.js","assets/image-BhuwcwI9.css","assets/queue-CQa4vtwo.js","assets/index-DoQhzPac.js","assets/index-DIUC8mgB.js","assets/index-zsHiMu1v.js","assets/IconStatusItem-BS_oFW9i.js","assets/consciousness-CM1OByYo.js","assets/RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CTuHNiqF.js","assets/speech-BwbRihXF.js","assets/Range-CI9YqvjT.js","assets/index-JSznsa_U.js","assets/cloudflare-workers-ai-Da37CFf3.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js","assets/deepseek-d4Q8Txxg.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js","assets/elevenlabs-BGpCIoDX.js","assets/fireworks-ai-CGayTr7r.js","assets/mistral-ai-_14bZB0D.js","assets/moonshot-ai-B5aTPdZW.js","assets/novita-ai-CaiWgCgu.js","assets/ollama-xNAKA6oF.js","assets/openai-BrqL72CW.js","assets/openrouter-ai-DMddR8E3.js","assets/together-ai-3JngR7s2.js","assets/xai-RB75_YXa.js","assets/index-QKQc0d-y.js","assets/index-DfgF6wHE.css","assets/delays-g2QNcYY7.js","assets/emotions-CrwRBNax.js","assets/messages-DrSN8YNT.js"])))=>i.map(i=>d[i]); +var fw=Object.defineProperty;var hw=(n,e,t)=>e in n?fw(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ii=(n,e,t)=>hw(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 dw="modulepreload",pw=function(n){return"/"+n},L_={},vt=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(t.map(l=>{if(l=pw(l),l in L_)return;L_[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":dw,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,d)=>{f.addEventListener("load",h),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function Hm(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const pt={},Ko=[],zi=()=>{},mw=()=>!1,rh=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Gm=n=>n.startsWith("onUpdate:"),Zt=Object.assign,Wm=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},gw=Object.prototype.hasOwnProperty,xt=(n,e)=>gw.call(n,e),Be=Array.isArray,Zo=n=>tc(n)==="[object Map]",ma=n=>tc(n)==="[object Set]",D_=n=>tc(n)==="[object Date]",$e=n=>typeof n=="function",Lt=n=>typeof n=="string",Ai=n=>typeof n=="symbol",At=n=>n!==null&&typeof n=="object",Ix=n=>(At(n)||$e(n))&&$e(n.then)&&$e(n.catch),Lx=Object.prototype.toString,tc=n=>Lx.call(n),_w=n=>tc(n).slice(8,-1),Dx=n=>tc(n)==="[object Object]",Xm=n=>Lt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,qa=Hm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),sh=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},vw=/-(\w)/g,Qn=sh(n=>n.replace(vw,(e,t)=>t?t.toUpperCase():"")),yw=/\B([A-Z])/g,Ar=sh(n=>n.replace(yw,"-$1").toLowerCase()),oh=sh(n=>n.charAt(0).toUpperCase()+n.slice(1)),Fu=sh(n=>n?`on${oh(n)}`:""),Vn=(n,e)=>!Object.is(n,e),Bu=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Qu=n=>{const e=parseFloat(n);return isNaN(e)?n:e},xw=n=>{const e=Lt(n)?Number(n):NaN;return isNaN(e)?n:e};let O_;const ah=()=>O_||(O_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function mi(n){if(Be(n)){const e={};for(let t=0;t{if(t){const i=t.split(Sw);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function ga(n){let e="";if(Lt(n))e=n;else if(Be(n))for(let t=0;tio(t,e))}const Ux=n=>!!(n&&n.__v_isRef===!0),Cw=n=>Lt(n)?n:n==null?"":Be(n)||At(n)&&(n.toString===Lx||!$e(n.toString))?Ux(n)?Cw(n.value):JSON.stringify(n,Fx,2):String(n),Fx=(n,e)=>Ux(e)?Fx(n,e.value):Zo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,r],s)=>(t[pd(i,s)+" =>"]=r,t),{})}:ma(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>pd(t))}:Ai(e)?pd(e):At(e)&&!Be(e)&&!Dx(e)?String(e):e,pd=(n,e="")=>{var t;return Ai(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** +**//*! #__NO_SIDE_EFFECTS__ */function Hm(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const pt={},Ko=[],zi=()=>{},mw=()=>!1,sh=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Gm=n=>n.startsWith("onUpdate:"),Zt=Object.assign,Wm=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},gw=Object.prototype.hasOwnProperty,xt=(n,e)=>gw.call(n,e),Be=Array.isArray,Zo=n=>tc(n)==="[object Map]",ma=n=>tc(n)==="[object Set]",D_=n=>tc(n)==="[object Date]",$e=n=>typeof n=="function",Lt=n=>typeof n=="string",Ai=n=>typeof n=="symbol",At=n=>n!==null&&typeof n=="object",Ix=n=>(At(n)||$e(n))&&$e(n.then)&&$e(n.catch),Lx=Object.prototype.toString,tc=n=>Lx.call(n),_w=n=>tc(n).slice(8,-1),Dx=n=>tc(n)==="[object Object]",Xm=n=>Lt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,qa=Hm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),rh=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},vw=/-(\w)/g,Qn=rh(n=>n.replace(vw,(e,t)=>t?t.toUpperCase():"")),yw=/\B([A-Z])/g,As=rh(n=>n.replace(yw,"-$1").toLowerCase()),oh=rh(n=>n.charAt(0).toUpperCase()+n.slice(1)),Fu=rh(n=>n?`on${oh(n)}`:""),Vn=(n,e)=>!Object.is(n,e),Bu=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Qu=n=>{const e=parseFloat(n);return isNaN(e)?n:e},xw=n=>{const e=Lt(n)?Number(n):NaN;return isNaN(e)?n:e};let O_;const ah=()=>O_||(O_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function mi(n){if(Be(n)){const e={};for(let t=0;t{if(t){const i=t.split(Sw);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function ga(n){let e="";if(Lt(n))e=n;else if(Be(n))for(let t=0;tio(t,e))}const Ux=n=>!!(n&&n.__v_isRef===!0),Cw=n=>Lt(n)?n:n==null?"":Be(n)||At(n)&&(n.toString===Lx||!$e(n.toString))?Ux(n)?Cw(n.value):JSON.stringify(n,Fx,2):String(n),Fx=(n,e)=>Ux(e)?Fx(n,e.value):Zo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[pd(i,r)+" =>"]=s,t),{})}:ma(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>pd(t))}:Ai(e)?pd(e):At(e)&&!Be(e)&&!Dx(e)?String(e):e,pd=(n,e="")=>{var t;return Ai(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** * @vue/reactivity v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let An;class Bx{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=An,!e&&An&&(this.index=(An.scopes||(An.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0)return;if(ja){let e=ja;for(ja=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Ya;){let e=Ya;for(Ya=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function Hx(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Gx(n){let e,t=n.depsTail,i=t;for(;i;){const r=i.prevDep;i.version===-1?(i===t&&(t=r),Zm(i),Rw(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}n.deps=e,n.depsTail=t}function Lp(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Wx(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Wx(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===vl))return;n.globalVersion=vl;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Lp(n)){n.flags&=-3;return}const t=Rt,i=wi;Rt=n,wi=!0;try{Hx(n);const r=n.fn(n._value);(e.version===0||Vn(r,n._value))&&(n._value=r,e.version++)}catch(r){throw e.version++,r}finally{Rt=t,wi=i,Gx(n),n.flags&=-3}}function Zm(n,e=!1){const{dep:t,prevSub:i,nextSub:r}=n;if(i&&(i.nextSub=r,n.prevSub=void 0),r&&(r.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)Zm(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Rw(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let wi=!0;const Xx=[];function as(){Xx.push(wi),wi=!1}function ls(){const n=Xx.pop();wi=n===void 0?!0:n}function N_(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Rt;Rt=void 0;try{e()}finally{Rt=t}}}let vl=0;class Pw{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ch{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Rt||!wi||Rt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Rt)t=this.activeLink=new Pw(Rt,this),Rt.deps?(t.prevDep=Rt.depsTail,Rt.depsTail.nextDep=t,Rt.depsTail=t):Rt.deps=Rt.depsTail=t,$x(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Rt.depsTail,t.nextDep=void 0,Rt.depsTail.nextDep=t,Rt.depsTail=t,Rt.deps===t&&(Rt.deps=i)}return t}trigger(e){this.version++,vl++,this.notify(e)}notify(e){jm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Km()}}}function $x(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)$x(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const ef=new WeakMap,Zs=Symbol(""),Dp=Symbol(""),yl=Symbol("");function pn(n,e,t){if(wi&&Rt){let i=ef.get(n);i||ef.set(n,i=new Map);let r=i.get(t);r||(i.set(t,r=new ch),r.map=i,r.key=t),r.track()}}function cr(n,e,t,i,r,s){const o=ef.get(n);if(!o){vl++;return}const a=l=>{l&&l.trigger()};if(jm(),e==="clear")o.forEach(a);else{const l=Be(n),c=l&&Xm(t);if(l&&t==="length"){const u=Number(i);o.forEach((f,h)=>{(h==="length"||h===yl||!Ai(h)&&h>=u)&&a(f)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(yl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Zs)),Zo(n)&&a(o.get(Dp)));break;case"delete":l||(a(o.get(Zs)),Zo(n)&&a(o.get(Dp)));break;case"set":Zo(n)&&a(o.get(Zs));break}}Km()}function Iw(n,e){const t=ef.get(n);return t&&t.get(e)}function bo(n){const e=ot(n);return e===n?e:(pn(e,"iterate",yl),ci(n)?e:e.map(mn))}function uh(n){return pn(n=ot(n),"iterate",yl),n}const Lw={__proto__:null,[Symbol.iterator](){return gd(this,Symbol.iterator,mn)},concat(...n){return bo(this).concat(...n.map(e=>Be(e)?bo(e):e))},entries(){return gd(this,"entries",n=>(n[1]=mn(n[1]),n))},every(n,e){return Ji(this,"every",n,e,void 0,arguments)},filter(n,e){return Ji(this,"filter",n,e,t=>t.map(mn),arguments)},find(n,e){return Ji(this,"find",n,e,mn,arguments)},findIndex(n,e){return Ji(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Ji(this,"findLast",n,e,mn,arguments)},findLastIndex(n,e){return Ji(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Ji(this,"forEach",n,e,void 0,arguments)},includes(...n){return _d(this,"includes",n)},indexOf(...n){return _d(this,"indexOf",n)},join(n){return bo(this).join(n)},lastIndexOf(...n){return _d(this,"lastIndexOf",n)},map(n,e){return Ji(this,"map",n,e,void 0,arguments)},pop(){return Ta(this,"pop")},push(...n){return Ta(this,"push",n)},reduce(n,...e){return U_(this,"reduce",n,e)},reduceRight(n,...e){return U_(this,"reduceRight",n,e)},shift(){return Ta(this,"shift")},some(n,e){return Ji(this,"some",n,e,void 0,arguments)},splice(...n){return Ta(this,"splice",n)},toReversed(){return bo(this).toReversed()},toSorted(n){return bo(this).toSorted(n)},toSpliced(...n){return bo(this).toSpliced(...n)},unshift(...n){return Ta(this,"unshift",n)},values(){return gd(this,"values",mn)}};function gd(n,e,t){const i=uh(n),r=i[e]();return i!==n&&!ci(n)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.value&&(s.value=t(s.value)),s}),r}const Dw=Array.prototype;function Ji(n,e,t,i,r,s){const o=uh(n),a=o!==n&&!ci(n),l=o[e];if(l!==Dw[e]){const f=l.apply(n,s);return a?mn(f):f}let c=t;o!==n&&(a?c=function(f,h){return t.call(this,mn(f),h,n)}:t.length>2&&(c=function(f,h){return t.call(this,f,h,n)}));const u=l.call(o,c,i);return a&&r?r(u):u}function U_(n,e,t,i){const r=uh(n);let s=t;return r!==n&&(ci(n)?t.length>3&&(s=function(o,a,l){return t.call(this,o,a,l,n)}):s=function(o,a,l){return t.call(this,o,mn(a),l,n)}),r[e](s,...i)}function _d(n,e,t){const i=ot(n);pn(i,"iterate",yl);const r=i[e](...t);return(r===-1||r===!1)&&Jm(t[0])?(t[0]=ot(t[0]),i[e](...t)):r}function Ta(n,e,t=[]){as(),jm();const i=ot(n)[e].apply(n,t);return Km(),ls(),i}const Ow=Hm("__proto__,__v_isRef,__isVue"),qx=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ai));function Nw(n){Ai(n)||(n=String(n));const e=ot(this);return pn(e,"has",n),e.hasOwnProperty(n)}class Yx{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return s;if(t==="__v_raw")return i===(r?s?eb:Qx:s?Jx:Zx).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Be(e);if(!r){let l;if(o&&(l=Lw[t]))return l;if(t==="hasOwnProperty")return Nw}const a=Reflect.get(e,t,wt(e)?e:i);return(Ai(t)?qx.has(t):Ow(t))||(r||pn(e,"get",t),s)?a:wt(a)?o&&Xm(t)?a:a.value:At(a)?r?di(a):hi(a):a}}class jx extends Yx{constructor(e=!1){super(!1,e)}set(e,t,i,r){let s=e[t];if(!this._isShallow){const l=ro(s);if(!ci(i)&&!ro(i)&&(s=ot(s),i=ot(i)),!Be(e)&&wt(s)&&!wt(i))return l?!1:(s.value=i,!0)}const o=Be(e)&&Xm(t)?Number(t)n,Cc=n=>Reflect.getPrototypeOf(n);function Vw(n,e,t){return function(...i){const r=this.__v_raw,s=ot(r),o=Zo(s),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=r[n](...i),u=t?Op:e?Np:mn;return!e&&pn(s,"iterate",l?Dp:Zs),{next(){const{value:f,done:h}=c.next();return h?{value:f,done:h}:{value:a?[u(f[0]),u(f[1])]:u(f),done:h}},[Symbol.iterator](){return this}}}}function Rc(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function zw(n,e){const t={get(r){const s=this.__v_raw,o=ot(s),a=ot(r);n||(Vn(r,a)&&pn(o,"get",r),pn(o,"get",a));const{has:l}=Cc(o),c=e?Op:n?Np:mn;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!n&&pn(ot(r),"iterate",Zs),Reflect.get(r,"size",r)},has(r){const s=this.__v_raw,o=ot(s),a=ot(r);return n||(Vn(r,a)&&pn(o,"has",r),pn(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=ot(a),c=e?Op:n?Np:mn;return!n&&pn(l,"iterate",Zs),a.forEach((u,f)=>r.call(s,c(u),c(f),o))}};return Zt(t,n?{add:Rc("add"),set:Rc("set"),delete:Rc("delete"),clear:Rc("clear")}:{add(r){!e&&!ci(r)&&!ro(r)&&(r=ot(r));const s=ot(this);return Cc(s).has.call(s,r)||(s.add(r),cr(s,"add",r,r)),this},set(r,s){!e&&!ci(s)&&!ro(s)&&(s=ot(s));const o=ot(this),{has:a,get:l}=Cc(o);let c=a.call(o,r);c||(r=ot(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?Vn(s,u)&&cr(o,"set",r,s):cr(o,"add",r,s),this},delete(r){const s=ot(this),{has:o,get:a}=Cc(s);let l=o.call(s,r);l||(r=ot(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&cr(s,"delete",r,void 0),c},clear(){const r=ot(this),s=r.size!==0,o=r.clear();return s&&cr(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=Vw(r,n,e)}),t}function fh(n,e){const t=zw(n,e);return(i,r,s)=>r==="__v_isReactive"?!n:r==="__v_isReadonly"?n:r==="__v_raw"?i:Reflect.get(xt(t,r)&&r in i?t:i,r,s)}const Hw={get:fh(!1,!1)},Gw={get:fh(!1,!0)},Ww={get:fh(!0,!1)},Xw={get:fh(!0,!0)},Zx=new WeakMap,Jx=new WeakMap,Qx=new WeakMap,eb=new WeakMap;function $w(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qw(n){return n.__v_skip||!Object.isExtensible(n)?0:$w(_w(n))}function hi(n){return ro(n)?n:hh(n,!1,Uw,Hw,Zx)}function tb(n){return hh(n,!1,Bw,Gw,Jx)}function di(n){return hh(n,!0,Fw,Ww,Qx)}function I4(n){return hh(n,!0,kw,Xw,eb)}function hh(n,e,t,i,r){if(!At(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=r.get(n);if(s)return s;const o=qw(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return r.set(n,a),a}function vr(n){return ro(n)?vr(n.__v_raw):!!(n&&n.__v_isReactive)}function ro(n){return!!(n&&n.__v_isReadonly)}function ci(n){return!!(n&&n.__v_isShallow)}function Jm(n){return n?!!n.__v_raw:!1}function ot(n){const e=n&&n.__v_raw;return e?ot(e):n}function Qm(n){return!xt(n,"__v_skip")&&Object.isExtensible(n)&&Ox(n,"__v_skip",!0),n}const mn=n=>At(n)?hi(n):n,Np=n=>At(n)?di(n):n;function wt(n){return n?n.__v_isRef===!0:!1}function Ze(n){return nb(n,!1)}function Ie(n){return nb(n,!0)}function nb(n,e){return wt(n)?n:new Yw(n,e)}class Yw{constructor(e,t){this.dep=new ch,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ot(e),this._value=t?e:mn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||ci(e)||ro(e);e=i?e:ot(e),Vn(e,t)&&(this._rawValue=e,this._value=i?e:mn(e),this.dep.trigger())}}function It(n){return wt(n)?n.value:n}function et(n){return $e(n)?n():It(n)}const jw={get:(n,e,t)=>e==="__v_raw"?n:It(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const r=n[e];return wt(r)&&!wt(t)?(r.value=t,!0):Reflect.set(n,e,t,i)}};function ib(n){return vr(n)?n:new Proxy(n,jw)}class Kw{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new ch,{get:i,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function eg(n){return new Kw(n)}function rb(n){const e=Be(n)?new Array(n.length):{};for(const t in n)e[t]=ob(n,t);return e}class Zw{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Iw(ot(this._object),this._key)}}class Jw{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function sb(n,e,t){return wt(n)?n:$e(n)?new Jw(n):At(n)&&arguments.length>1?ob(n,e,t):Ze(n)}function ob(n,e,t){const i=n[e];return wt(i)?i:new Zw(n,e,t)}class Qw{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ch(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=vl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Rt!==this)return zx(this,!0),!0}get value(){const e=this.dep.track();return Wx(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function eA(n,e,t=!1){let i,r;return $e(n)?i=n:(i=n.get,r=n.set),new Qw(i,r,t)}const Pc={},tf=new WeakMap;let Bs;function tA(n,e=!1,t=Bs){if(t){let i=tf.get(t);i||tf.set(t,i=[]),i.push(n)}}function nA(n,e,t=pt){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=t,c=v=>r?v:ci(v)||r===!1||r===0?ur(v,1):ur(v);let u,f,h,d,p=!1,_=!1;if(wt(n)?(f=()=>n.value,p=ci(n)):vr(n)?(f=()=>c(n),p=!0):Be(n)?(_=!0,p=n.some(v=>vr(v)||ci(v)),f=()=>n.map(v=>{if(wt(v))return v.value;if(vr(v))return c(v);if($e(v))return l?l(v,2):v()})):$e(n)?e?f=l?()=>l(n,2):n:f=()=>{if(h){as();try{h()}finally{ls()}}const v=Bs;Bs=u;try{return l?l(n,3,[d]):n(d)}finally{Bs=v}}:f=zi,e&&r){const v=f,E=r===!0?1/0:r;f=()=>ur(v(),E)}const g=lh(),m=()=>{u.stop(),g&&g.active&&Wm(g.effects,u)};if(s&&e){const v=e;e=(...E)=>{v(...E),m()}}let y=_?new Array(n.length).fill(Pc):Pc;const x=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const E=u.run();if(r||p||(_?E.some((T,M)=>Vn(T,y[M])):Vn(E,y))){h&&h();const T=Bs;Bs=u;try{const M=[E,y===Pc?void 0:_&&y[0]===Pc?[]:y,d];l?l(e,3,M):e(...M),y=E}finally{Bs=T}}}else u.run()};return a&&a(x),u=new kx(f),u.scheduler=o?()=>o(x,!1):x,d=v=>tA(v,!1,u),h=u.onStop=()=>{const v=tf.get(u);if(v){if(l)l(v,4);else for(const E of v)E();tf.delete(u)}},e?i?x(!0):y=u.run():o?o(x.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function ur(n,e=1/0,t){if(e<=0||!At(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,wt(n))ur(n.value,e,t);else if(Be(n))for(let i=0;i{ur(i,e,t)});else if(Dx(n)){for(const i in n)ur(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&ur(n[i],e,t)}return n}/** +**/let An;class Bx{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=An,!e&&An&&(this.index=(An.scopes||(An.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0)return;if(ja){let e=ja;for(ja=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Ya;){let e=Ya;for(Ya=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function Hx(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Gx(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),Zm(i),Rw(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function Lp(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Wx(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Wx(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===vl))return;n.globalVersion=vl;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Lp(n)){n.flags&=-3;return}const t=Rt,i=wi;Rt=n,wi=!0;try{Hx(n);const s=n.fn(n._value);(e.version===0||Vn(s,n._value))&&(n._value=s,e.version++)}catch(s){throw e.version++,s}finally{Rt=t,wi=i,Gx(n),n.flags&=-3}}function Zm(n,e=!1){const{dep:t,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)Zm(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Rw(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let wi=!0;const Xx=[];function ar(){Xx.push(wi),wi=!1}function lr(){const n=Xx.pop();wi=n===void 0?!0:n}function N_(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Rt;Rt=void 0;try{e()}finally{Rt=t}}}let vl=0;class Pw{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ch{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Rt||!wi||Rt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Rt)t=this.activeLink=new Pw(Rt,this),Rt.deps?(t.prevDep=Rt.depsTail,Rt.depsTail.nextDep=t,Rt.depsTail=t):Rt.deps=Rt.depsTail=t,$x(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Rt.depsTail,t.nextDep=void 0,Rt.depsTail.nextDep=t,Rt.depsTail=t,Rt.deps===t&&(Rt.deps=i)}return t}trigger(e){this.version++,vl++,this.notify(e)}notify(e){jm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Km()}}}function $x(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)$x(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const ef=new WeakMap,Zr=Symbol(""),Dp=Symbol(""),yl=Symbol("");function pn(n,e,t){if(wi&&Rt){let i=ef.get(n);i||ef.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new ch),s.map=i,s.key=t),s.track()}}function cs(n,e,t,i,s,r){const o=ef.get(n);if(!o){vl++;return}const a=l=>{l&&l.trigger()};if(jm(),e==="clear")o.forEach(a);else{const l=Be(n),c=l&&Xm(t);if(l&&t==="length"){const u=Number(i);o.forEach((f,h)=>{(h==="length"||h===yl||!Ai(h)&&h>=u)&&a(f)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(yl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Zr)),Zo(n)&&a(o.get(Dp)));break;case"delete":l||(a(o.get(Zr)),Zo(n)&&a(o.get(Dp)));break;case"set":Zo(n)&&a(o.get(Zr));break}}Km()}function Iw(n,e){const t=ef.get(n);return t&&t.get(e)}function bo(n){const e=ot(n);return e===n?e:(pn(e,"iterate",yl),ci(n)?e:e.map(mn))}function uh(n){return pn(n=ot(n),"iterate",yl),n}const Lw={__proto__:null,[Symbol.iterator](){return gd(this,Symbol.iterator,mn)},concat(...n){return bo(this).concat(...n.map(e=>Be(e)?bo(e):e))},entries(){return gd(this,"entries",n=>(n[1]=mn(n[1]),n))},every(n,e){return Ji(this,"every",n,e,void 0,arguments)},filter(n,e){return Ji(this,"filter",n,e,t=>t.map(mn),arguments)},find(n,e){return Ji(this,"find",n,e,mn,arguments)},findIndex(n,e){return Ji(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Ji(this,"findLast",n,e,mn,arguments)},findLastIndex(n,e){return Ji(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Ji(this,"forEach",n,e,void 0,arguments)},includes(...n){return _d(this,"includes",n)},indexOf(...n){return _d(this,"indexOf",n)},join(n){return bo(this).join(n)},lastIndexOf(...n){return _d(this,"lastIndexOf",n)},map(n,e){return Ji(this,"map",n,e,void 0,arguments)},pop(){return Ta(this,"pop")},push(...n){return Ta(this,"push",n)},reduce(n,...e){return U_(this,"reduce",n,e)},reduceRight(n,...e){return U_(this,"reduceRight",n,e)},shift(){return Ta(this,"shift")},some(n,e){return Ji(this,"some",n,e,void 0,arguments)},splice(...n){return Ta(this,"splice",n)},toReversed(){return bo(this).toReversed()},toSorted(n){return bo(this).toSorted(n)},toSpliced(...n){return bo(this).toSpliced(...n)},unshift(...n){return Ta(this,"unshift",n)},values(){return gd(this,"values",mn)}};function gd(n,e,t){const i=uh(n),s=i[e]();return i!==n&&!ci(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const Dw=Array.prototype;function Ji(n,e,t,i,s,r){const o=uh(n),a=o!==n&&!ci(n),l=o[e];if(l!==Dw[e]){const f=l.apply(n,r);return a?mn(f):f}let c=t;o!==n&&(a?c=function(f,h){return t.call(this,mn(f),h,n)}:t.length>2&&(c=function(f,h){return t.call(this,f,h,n)}));const u=l.call(o,c,i);return a&&s?s(u):u}function U_(n,e,t,i){const s=uh(n);let r=t;return s!==n&&(ci(n)?t.length>3&&(r=function(o,a,l){return t.call(this,o,a,l,n)}):r=function(o,a,l){return t.call(this,o,mn(a),l,n)}),s[e](r,...i)}function _d(n,e,t){const i=ot(n);pn(i,"iterate",yl);const s=i[e](...t);return(s===-1||s===!1)&&Jm(t[0])?(t[0]=ot(t[0]),i[e](...t)):s}function Ta(n,e,t=[]){ar(),jm();const i=ot(n)[e].apply(n,t);return Km(),lr(),i}const Ow=Hm("__proto__,__v_isRef,__isVue"),qx=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ai));function Nw(n){Ai(n)||(n=String(n));const e=ot(this);return pn(e,"has",n),e.hasOwnProperty(n)}class Yx{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(s?r?eb:Qx:r?Jx:Zx).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Be(e);if(!s){let l;if(o&&(l=Lw[t]))return l;if(t==="hasOwnProperty")return Nw}const a=Reflect.get(e,t,wt(e)?e:i);return(Ai(t)?qx.has(t):Ow(t))||(s||pn(e,"get",t),r)?a:wt(a)?o&&Xm(t)?a:a.value:At(a)?s?di(a):hi(a):a}}class jx extends Yx{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const l=so(r);if(!ci(i)&&!so(i)&&(r=ot(r),i=ot(i)),!Be(e)&&wt(r)&&!wt(i))return l?!1:(r.value=i,!0)}const o=Be(e)&&Xm(t)?Number(t)n,Cc=n=>Reflect.getPrototypeOf(n);function Vw(n,e,t){return function(...i){const s=this.__v_raw,r=ot(s),o=Zo(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=t?Op:e?Np:mn;return!e&&pn(r,"iterate",l?Dp:Zr),{next(){const{value:f,done:h}=c.next();return h?{value:f,done:h}:{value:a?[u(f[0]),u(f[1])]:u(f),done:h}},[Symbol.iterator](){return this}}}}function Rc(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function zw(n,e){const t={get(s){const r=this.__v_raw,o=ot(r),a=ot(s);n||(Vn(s,a)&&pn(o,"get",s),pn(o,"get",a));const{has:l}=Cc(o),c=e?Op:n?Np:mn;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&pn(ot(s),"iterate",Zr),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=ot(r),a=ot(s);return n||(Vn(s,a)&&pn(o,"has",s),pn(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=ot(a),c=e?Op:n?Np:mn;return!n&&pn(l,"iterate",Zr),a.forEach((u,f)=>s.call(r,c(u),c(f),o))}};return Zt(t,n?{add:Rc("add"),set:Rc("set"),delete:Rc("delete"),clear:Rc("clear")}:{add(s){!e&&!ci(s)&&!so(s)&&(s=ot(s));const r=ot(this);return Cc(r).has.call(r,s)||(r.add(s),cs(r,"add",s,s)),this},set(s,r){!e&&!ci(r)&&!so(r)&&(r=ot(r));const o=ot(this),{has:a,get:l}=Cc(o);let c=a.call(o,s);c||(s=ot(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?Vn(r,u)&&cs(o,"set",s,r):cs(o,"add",s,r),this},delete(s){const r=ot(this),{has:o,get:a}=Cc(r);let l=o.call(r,s);l||(s=ot(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&cs(r,"delete",s,void 0),c},clear(){const s=ot(this),r=s.size!==0,o=s.clear();return r&&cs(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=Vw(s,n,e)}),t}function fh(n,e){const t=zw(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(xt(t,s)&&s in i?t:i,s,r)}const Hw={get:fh(!1,!1)},Gw={get:fh(!1,!0)},Ww={get:fh(!0,!1)},Xw={get:fh(!0,!0)},Zx=new WeakMap,Jx=new WeakMap,Qx=new WeakMap,eb=new WeakMap;function $w(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qw(n){return n.__v_skip||!Object.isExtensible(n)?0:$w(_w(n))}function hi(n){return so(n)?n:hh(n,!1,Uw,Hw,Zx)}function tb(n){return hh(n,!1,Bw,Gw,Jx)}function di(n){return hh(n,!0,Fw,Ww,Qx)}function I4(n){return hh(n,!0,kw,Xw,eb)}function hh(n,e,t,i,s){if(!At(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=s.get(n);if(r)return r;const o=qw(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function vs(n){return so(n)?vs(n.__v_raw):!!(n&&n.__v_isReactive)}function so(n){return!!(n&&n.__v_isReadonly)}function ci(n){return!!(n&&n.__v_isShallow)}function Jm(n){return n?!!n.__v_raw:!1}function ot(n){const e=n&&n.__v_raw;return e?ot(e):n}function Qm(n){return!xt(n,"__v_skip")&&Object.isExtensible(n)&&Ox(n,"__v_skip",!0),n}const mn=n=>At(n)?hi(n):n,Np=n=>At(n)?di(n):n;function wt(n){return n?n.__v_isRef===!0:!1}function Ze(n){return nb(n,!1)}function Ie(n){return nb(n,!0)}function nb(n,e){return wt(n)?n:new Yw(n,e)}class Yw{constructor(e,t){this.dep=new ch,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ot(e),this._value=t?e:mn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||ci(e)||so(e);e=i?e:ot(e),Vn(e,t)&&(this._rawValue=e,this._value=i?e:mn(e),this.dep.trigger())}}function It(n){return wt(n)?n.value:n}function et(n){return $e(n)?n():It(n)}const jw={get:(n,e,t)=>e==="__v_raw"?n:It(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return wt(s)&&!wt(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function ib(n){return vs(n)?n:new Proxy(n,jw)}class Kw{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new ch,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function eg(n){return new Kw(n)}function sb(n){const e=Be(n)?new Array(n.length):{};for(const t in n)e[t]=ob(n,t);return e}class Zw{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Iw(ot(this._object),this._key)}}class Jw{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function rb(n,e,t){return wt(n)?n:$e(n)?new Jw(n):At(n)&&arguments.length>1?ob(n,e,t):Ze(n)}function ob(n,e,t){const i=n[e];return wt(i)?i:new Zw(n,e,t)}class Qw{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ch(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=vl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Rt!==this)return zx(this,!0),!0}get value(){const e=this.dep.track();return Wx(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function eA(n,e,t=!1){let i,s;return $e(n)?i=n:(i=n.get,s=n.set),new Qw(i,s,t)}const Pc={},tf=new WeakMap;let Br;function tA(n,e=!1,t=Br){if(t){let i=tf.get(t);i||tf.set(t,i=[]),i.push(n)}}function nA(n,e,t=pt){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=t,c=v=>s?v:ci(v)||s===!1||s===0?us(v,1):us(v);let u,f,h,d,p=!1,_=!1;if(wt(n)?(f=()=>n.value,p=ci(n)):vs(n)?(f=()=>c(n),p=!0):Be(n)?(_=!0,p=n.some(v=>vs(v)||ci(v)),f=()=>n.map(v=>{if(wt(v))return v.value;if(vs(v))return c(v);if($e(v))return l?l(v,2):v()})):$e(n)?e?f=l?()=>l(n,2):n:f=()=>{if(h){ar();try{h()}finally{lr()}}const v=Br;Br=u;try{return l?l(n,3,[d]):n(d)}finally{Br=v}}:f=zi,e&&s){const v=f,E=s===!0?1/0:s;f=()=>us(v(),E)}const g=lh(),m=()=>{u.stop(),g&&g.active&&Wm(g.effects,u)};if(r&&e){const v=e;e=(...E)=>{v(...E),m()}}let y=_?new Array(n.length).fill(Pc):Pc;const x=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const E=u.run();if(s||p||(_?E.some((T,M)=>Vn(T,y[M])):Vn(E,y))){h&&h();const T=Br;Br=u;try{const M=[E,y===Pc?void 0:_&&y[0]===Pc?[]:y,d];l?l(e,3,M):e(...M),y=E}finally{Br=T}}}else u.run()};return a&&a(x),u=new kx(f),u.scheduler=o?()=>o(x,!1):x,d=v=>tA(v,!1,u),h=u.onStop=()=>{const v=tf.get(u);if(v){if(l)l(v,4);else for(const E of v)E();tf.delete(u)}},e?i?x(!0):y=u.run():o?o(x.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function us(n,e=1/0,t){if(e<=0||!At(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,wt(n))us(n.value,e,t);else if(Be(n))for(let i=0;i{us(i,e,t)});else if(Dx(n)){for(const i in n)us(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&us(n[i],e,t)}return n}/** * @vue/runtime-core v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function nc(n,e,t,i){try{return i?n(...i):n()}catch(r){dh(r,e,t)}}function Ci(n,e,t,i){if($e(n)){const r=nc(n,e,t,i);return r&&Ix(r)&&r.catch(s=>{dh(s,e,t)}),r}if(Be(n)){const r=[];for(let s=0;s>>1,r=Rn[i],s=xl(r);s=xl(t)?Rn.push(n):Rn.splice(rA(e),0,n),n.flags|=1,lb()}}function lb(){nf||(nf=ab.then(ub))}function sA(n){Be(n)?Jo.push(...n):Wr&&n.id===-1?Wr.splice(zo+1,0,n):n.flags&1||(Jo.push(n),n.flags|=1),lb()}function F_(n,e,t=Ui+1){for(;txl(t)-xl(i));if(Jo.length=0,Wr){Wr.push(...e);return}for(Wr=e,zo=0;zon.id==null?n.flags&2?-1:1/0:n.id;function ub(n){try{for(Ui=0;Ui{i._d&&K_(-1);const s=rf(e);let o;try{o=n(...r)}finally{rf(s),i._d&&K_(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function L4(n,e){if(Yt===null)return n;const t=_h(Yt),i=n.dirs||(n.dirs=[]);for(let r=0;rn.__isTeleport,Ka=n=>n&&(n.disabled||n.disabled===""),B_=n=>n&&(n.defer||n.defer===""),k_=n=>typeof SVGElement<"u"&&n instanceof SVGElement,V_=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Up=(n,e)=>{const t=n&&n.to;return Lt(t)?e?e(t):null:t},mb={name:"Teleport",__isTeleport:!0,process(n,e,t,i,r,s,o,a,l,c){const{mc:u,pc:f,pbc:h,o:{insert:d,querySelector:p,createText:_,createComment:g}}=c,m=Ka(e.props);let{shapeFlag:y,children:x,dynamicChildren:v}=e;if(n==null){const E=e.el=_(""),T=e.anchor=_("");d(E,t,i),d(T,t,i);const M=(b,S)=>{y&16&&(r&&r.isCE&&(r.ce._teleportTarget=b),u(x,b,S,r,s,o,a,l))},P=()=>{const b=e.target=Up(e.props,p),S=gb(b,e,_,d);b&&(o!=="svg"&&k_(b)?o="svg":o!=="mathml"&&V_(b)&&(o="mathml"),m||(M(b,S),ku(e,!1)))};m&&(M(t,T),ku(e,!0)),B_(e.props)?wn(()=>{P(),e.el.__isMounted=!0},s):P()}else{if(B_(e.props)&&!n.el.__isMounted){wn(()=>{mb.process(n,e,t,i,r,s,o,a,l,c),delete n.el.__isMounted},s);return}e.el=n.el,e.targetStart=n.targetStart;const E=e.anchor=n.anchor,T=e.target=n.target,M=e.targetAnchor=n.targetAnchor,P=Ka(n.props),b=P?t:T,S=P?E:M;if(o==="svg"||k_(T)?o="svg":(o==="mathml"||V_(T))&&(o="mathml"),v?(h(n.dynamicChildren,v,b,r,s,o,a),og(n,e,!0)):l||f(n,e,b,S,r,s,o,a,!1),m)P?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):Ic(e,t,E,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const D=e.target=Up(e.props,p);D&&Ic(e,D,null,c,0)}else P&&Ic(e,T,M,c,1);ku(e,m)}},remove(n,e,t,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:f,props:h}=n;if(f&&(r(c),r(u)),s&&r(l),o&16){const d=s||!Ka(h);for(let p=0;p{n.isMounted=!0}),Eb(()=>{n.isUnmounting=!0}),n}const ri=[Function,Array],_b={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ri,onEnter:ri,onAfterEnter:ri,onEnterCancelled:ri,onBeforeLeave:ri,onLeave:ri,onAfterLeave:ri,onLeaveCancelled:ri,onBeforeAppear:ri,onAppear:ri,onAfterAppear:ri,onAppearCancelled:ri},vb=n=>{const e=n.subTree;return e.component?vb(e.component):e},lA={name:"BaseTransition",props:_b,setup(n,{slots:e}){const t=vn(),i=aA();return()=>{const r=e.default&&bb(e.default(),!0);if(!r||!r.length)return;const s=yb(r),o=ot(n),{mode:a}=o;if(i.isLeaving)return vd(s);const l=z_(s);if(!l)return vd(s);let c=Fp(l,o,i,t,f=>c=f);l.type!==Pn&&bl(l,c);let u=t.subTree&&z_(t.subTree);if(u&&u.type!==Pn&&!Gs(l,u)&&vb(t).type!==Pn){let f=Fp(u,o,i,t);if(bl(u,f),a==="out-in"&&l.type!==Pn)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,u=void 0},vd(s);a==="in-out"&&l.type!==Pn?f.delayLeave=(h,d,p)=>{const _=xb(i,u);_[String(u.key)]=u,h[Xr]=()=>{d(),h[Xr]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return s}}};function yb(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==Pn){e=t;break}}return e}const cA=lA;function xb(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function Fp(n,e,t,i,r){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:h,onLeave:d,onAfterLeave:p,onLeaveCancelled:_,onBeforeAppear:g,onAppear:m,onAfterAppear:y,onAppearCancelled:x}=e,v=String(n.key),E=xb(t,n),T=(b,S)=>{b&&Ci(b,i,9,S)},M=(b,S)=>{const D=S[1];T(b,S),Be(b)?b.every(B=>B.length<=1)&&D():b.length<=1&&D()},P={mode:o,persisted:a,beforeEnter(b){let S=l;if(!t.isMounted)if(s)S=g||l;else return;b[Xr]&&b[Xr](!0);const D=E[v];D&&Gs(n,D)&&D.el[Xr]&&D.el[Xr](),T(S,[b])},enter(b){let S=c,D=u,B=f;if(!t.isMounted)if(s)S=m||c,D=y||u,B=x||f;else return;let H=!1;const $=b[Lc]=ee=>{H||(H=!0,ee?T(B,[b]):T(D,[b]),P.delayedLeave&&P.delayedLeave(),b[Lc]=void 0)};S?M(S,[b,$]):$()},leave(b,S){const D=String(n.key);if(b[Lc]&&b[Lc](!0),t.isUnmounting)return S();T(h,[b]);let B=!1;const H=b[Xr]=$=>{B||(B=!0,S(),$?T(_,[b]):T(p,[b]),b[Xr]=void 0,E[D]===n&&delete E[D])};E[D]=n,d?M(d,[b,H]):H()},clone(b){const S=Fp(b,e,t,i,r);return r&&r(S),S}};return P}function vd(n){if(ph(n))return n=ts(n),n.children=null,n}function z_(n){if(!ph(n))return pb(n.type)&&n.children?yb(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&$e(t.default))return t.default()}}function bl(n,e){n.shapeFlag&6&&n.component?(n.transition=e,bl(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function bb(n,e=!1,t){let i=[],r=0;for(let s=0;s1)for(let s=0;ssf(p,e&&(Be(e)?e[_]:e),t,i,r));return}if(Qo(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&sf(n,e,t,i.component.subTree);return}const s=i.shapeFlag&4?_h(i.component):i.el,o=r?null:s,{i:a,r:l}=n,c=e&&e.r,u=a.refs===pt?a.refs={}:a.refs,f=a.setupState,h=ot(f),d=f===pt?()=>!1:p=>xt(h,p);if(c!=null&&c!==l&&(Lt(c)?(u[c]=null,d(c)&&(f[c]=null)):wt(c)&&(c.value=null)),$e(l))nc(l,a,12,[o,u]);else{const p=Lt(l),_=wt(l);if(p||_){const g=()=>{if(n.f){const m=p?d(l)?f[l]:u[l]:l.value;r?Be(m)&&Wm(m,s):Be(m)?m.includes(s)||m.push(s):p?(u[l]=[s],d(l)&&(f[l]=u[l])):(l.value=[s],n.k&&(u[n.k]=l.value))}else p?(u[l]=o,d(l)&&(f[l]=o)):_&&(l.value=o,n.k&&(u[n.k]=o))};o?(g.id=-1,wn(g,t)):g()}}}ah().requestIdleCallback;ah().cancelIdleCallback;const Qo=n=>!!n.type.__asyncLoader,ph=n=>n.type.__isKeepAlive;function uA(n,e){Mb(n,"a",e)}function fA(n,e){Mb(n,"da",e)}function Mb(n,e,t=tn){const i=n.__wdc||(n.__wdc=()=>{let r=t;for(;r;){if(r.isDeactivated)return;r=r.parent}return n()});if(mh(e,i,t),t){let r=t.parent;for(;r&&r.parent;)ph(r.parent.vnode)&&hA(i,e,t,r),r=r.parent}}function hA(n,e,t,i){const r=mh(e,n,i,!0);$i(()=>{Wm(i[e],r)},t)}function mh(n,e,t=tn,i=!1){if(t){const r=t[n]||(t[n]=[]),s=e.__weh||(e.__weh=(...o)=>{as();const a=ac(t),l=Ci(e,t,n,o);return a(),ls(),l});return i?r.unshift(s):r.push(s),s}}const Cr=n=>(e,t=tn)=>{(!wl||n==="sp")&&mh(n,(...i)=>e(...i),t)},dA=Cr("bm"),yn=Cr("m"),pA=Cr("bu"),mA=Cr("u"),Eb=Cr("bum"),$i=Cr("um"),gA=Cr("sp"),_A=Cr("rtg"),vA=Cr("rtc");function yA(n,e=tn){mh("ec",n,e)}const ng="components",xA="directives";function N4(n,e){return ig(ng,n,!0,e)||n}const Tb=Symbol.for("v-ndc");function bA(n){return Lt(n)?ig(ng,n,!1)||n:n||Tb}function U4(n){return ig(xA,n)}function ig(n,e,t=!0,i=!1){const r=Yt||tn;if(r){const s=r.type;if(n===ng){const a=c1(s,!1);if(a&&(a===e||a===Qn(e)||a===oh(Qn(e))))return s}const o=H_(r[n]||s[n],e)||H_(r.appContext[n],e);return!o&&i?s:o}}function H_(n,e){return n&&(n[e]||n[Qn(e)]||n[oh(Qn(e))])}function SA(n,e,t,i){let r;const s=t,o=Be(n);if(o||Lt(n)){const a=o&&vr(n);let l=!1;a&&(l=!ci(n),n=uh(n)),r=new Array(n.length);for(let c=0,u=n.length;ce(a,l,void 0,s));else{const a=Object.keys(n);r=new Array(a.length);for(let l=0,c=a.length;lTl(e)?!(e.type===Pn||e.type===Xt&&!wb(e.children)):!0)?n:null}function F4(n,e){const t={};for(const i in n)t[Fu(i)]=n[i];return t}const Bp=n=>n?Yb(n)?_h(n):Bp(n.parent):null,Za=Zt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>Bp(n.parent),$root:n=>Bp(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Rb(n),$forceUpdate:n=>n.f||(n.f=()=>{tg(n.update)}),$nextTick:n=>n.n||(n.n=cs.bind(n.proxy)),$watch:n=>WA.bind(n)}),yd=(n,e)=>n!==pt&&!n.__isScriptSetup&&xt(n,e),EA={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return i[e];case 2:return r[e];case 4:return t[e];case 3:return s[e]}else{if(yd(i,e))return o[e]=1,i[e];if(r!==pt&&xt(r,e))return o[e]=2,r[e];if((c=n.propsOptions[0])&&xt(c,e))return o[e]=3,s[e];if(t!==pt&&xt(t,e))return o[e]=4,t[e];kp&&(o[e]=0)}}const u=Za[e];let f,h;if(u)return e==="$attrs"&&pn(n.attrs,"get",""),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==pt&&xt(t,e))return o[e]=4,t[e];if(h=l.config.globalProperties,xt(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:r,ctx:s}=n;return yd(r,e)?(r[e]=t,!0):i!==pt&&xt(i,e)?(i[e]=t,!0):xt(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(s[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:r,propsOptions:s}},o){let a;return!!t[o]||n!==pt&&xt(n,o)||yd(e,o)||(a=s[0])&&xt(a,o)||xt(i,o)||xt(Za,o)||xt(r.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:xt(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function rg(){return Ab().slots}function B4(){return Ab().attrs}function Ab(){const n=vn();return n.setupContext||(n.setupContext=Kb(n))}function Sl(n){return Be(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function k4(n,e){const t=Sl(n);for(const i in e){if(i.startsWith("__skip"))continue;let r=t[i];r?Be(r)||$e(r)?r=t[i]={type:r,default:e[i]}:r.default=e[i]:r===null&&(r=t[i]={default:e[i]}),r&&e[`__skip_${i}`]&&(r.skipFactory=!0)}return t}function V4(n,e){return!n||!e?n||e:Be(n)&&Be(e)?n.concat(e):Zt({},Sl(n),Sl(e))}let kp=!0;function TA(n){const e=Rb(n),t=n.proxy,i=n.ctx;kp=!1,e.beforeCreate&&G_(e.beforeCreate,n,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:f,mounted:h,beforeUpdate:d,updated:p,activated:_,deactivated:g,beforeDestroy:m,beforeUnmount:y,destroyed:x,unmounted:v,render:E,renderTracked:T,renderTriggered:M,errorCaptured:P,serverPrefetch:b,expose:S,inheritAttrs:D,components:B,directives:H,filters:$}=e;if(c&&wA(c,i,null),o)for(const te in o){const Q=o[te];$e(Q)&&(i[te]=Q.bind(t))}if(r){const te=r.call(t,t);At(te)&&(n.data=hi(te))}if(kp=!0,s)for(const te in s){const Q=s[te],pe=$e(Q)?Q.bind(t,t):$e(Q.get)?Q.get.bind(t,t):zi,ve=!$e(Q)&&$e(Q.set)?Q.set.bind(t):zi,re=Se({get:pe,set:ve});Object.defineProperty(i,te,{enumerable:!0,configurable:!0,get:()=>re.value,set:xe=>re.value=xe})}if(a)for(const te in a)Cb(a[te],i,t,te);if(l){const te=$e(l)?l.call(t):l;Reflect.ownKeys(te).forEach(Q=>{es(Q,te[Q])})}u&&G_(u,n,"c");function Z(te,Q){Be(Q)?Q.forEach(pe=>te(pe.bind(t))):Q&&te(Q.bind(t))}if(Z(dA,f),Z(yn,h),Z(pA,d),Z(mA,p),Z(uA,_),Z(fA,g),Z(yA,P),Z(vA,T),Z(_A,M),Z(Eb,y),Z($i,v),Z(gA,b),Be(S))if(S.length){const te=n.exposed||(n.exposed={});S.forEach(Q=>{Object.defineProperty(te,Q,{get:()=>t[Q],set:pe=>t[Q]=pe})})}else n.exposed||(n.exposed={});E&&n.render===zi&&(n.render=E),D!=null&&(n.inheritAttrs=D),B&&(n.components=B),H&&(n.directives=H),b&&Sb(n)}function wA(n,e,t=zi){Be(n)&&(n=Vp(n));for(const i in n){const r=n[i];let s;At(r)?"default"in r?s=gn(r.from||i,r.default,!0):s=gn(r.from||i):s=gn(r),wt(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function G_(n,e,t){Ci(Be(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function Cb(n,e,t,i){let r=i.includes(".")?Hb(t,i):()=>t[i];if(Lt(n)){const s=e[n];$e(s)&&Ge(r,s)}else if($e(n))Ge(r,n.bind(t));else if(At(n))if(Be(n))n.forEach(s=>Cb(s,e,t,i));else{const s=$e(n.handler)?n.handler.bind(t):e[n.handler];$e(s)&&Ge(r,s,n)}}function Rb(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=n.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!t&&!i?l=e:(l={},r.length&&r.forEach(c=>of(l,c,o,!0)),of(l,e,o)),At(e)&&s.set(e,l),l}function of(n,e,t,i=!1){const{mixins:r,extends:s}=e;s&&of(n,s,t,!0),r&&r.forEach(o=>of(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=AA[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const AA={data:W_,props:X_,emits:X_,methods:Ga,computed:Ga,beforeCreate:Mn,created:Mn,beforeMount:Mn,mounted:Mn,beforeUpdate:Mn,updated:Mn,beforeDestroy:Mn,beforeUnmount:Mn,destroyed:Mn,unmounted:Mn,activated:Mn,deactivated:Mn,errorCaptured:Mn,serverPrefetch:Mn,components:Ga,directives:Ga,watch:RA,provide:W_,inject:CA};function W_(n,e){return e?n?function(){return Zt($e(n)?n.call(this,this):n,$e(e)?e.call(this,this):e)}:e:n}function CA(n,e){return Ga(Vp(n),Vp(e))}function Vp(n){if(Be(n)){const e={};for(let t=0;t1)return t&&$e(e)?e.call(i&&i.proxy):e}}function ic(){return!!(tn||Yt||Js)}const Ib={},Lb=()=>Object.create(Ib),Db=n=>Object.getPrototypeOf(n)===Ib;function LA(n,e,t,i=!1){const r={},s=Lb();n.propsDefaults=Object.create(null),Ob(n,e,r,s);for(const o in n.propsOptions[0])o in r||(r[o]=void 0);t?n.props=i?r:tb(r):n.type.props?n.props=r:n.props=s,n.attrs=s}function DA(n,e,t,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=n,a=ot(r),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let f=0;f{l=!0;const[h,d]=Nb(f,e,!0);Zt(o,h),d&&a.push(...d)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!s&&!l)return At(n)&&i.set(n,Ko),Ko;if(Be(s))for(let u=0;un[0]==="_"||n==="$stable",sg=n=>Be(n)?n.map(ki):[ki(n)],NA=(n,e,t)=>{if(e._n)return e;const i=hb((...r)=>sg(e(...r)),t);return i._c=!1,i},Fb=(n,e,t)=>{const i=n._ctx;for(const r in n){if(Ub(r))continue;const s=n[r];if($e(s))e[r]=NA(r,s,i);else if(s!=null){const o=sg(s);e[r]=()=>o}}},Bb=(n,e)=>{const t=sg(e);n.slots.default=()=>t},kb=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},UA=(n,e,t)=>{const i=n.slots=Lb();if(n.vnode.shapeFlag&32){const r=e._;r?(kb(i,e,t),t&&Ox(i,"_",r,!0)):Fb(e,i)}else e&&Bb(n,e)},FA=(n,e,t)=>{const{vnode:i,slots:r}=n;let s=!0,o=pt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?s=!1:kb(r,e,t):(s=!e.$stable,Fb(e,r)),o=e}else e&&(Bb(n,e),o={default:1});if(s)for(const a in r)!Ub(a)&&o[a]==null&&delete r[a]},wn=KA;function Vb(n){return BA(n)}function BA(n,e){const t=ah();t.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:f,nextSibling:h,setScopeId:d=zi,insertStaticContent:p}=n,_=(I,L,w,j=null,G=null,q=null,R=void 0,N=null,V=!!L.dynamicChildren)=>{if(I===L)return;I&&!Gs(I,L)&&(j=W(I),xe(I,G,q,!0),I=null),L.patchFlag===-2&&(V=!1,L.dynamicChildren=null);const{type:A,ref:C,shapeFlag:k}=L;switch(A){case oc:g(I,L,w,j);break;case Pn:m(I,L,w,j);break;case Vu:I==null&&y(L,w,j,R);break;case Xt:B(I,L,w,j,G,q,R,N,V);break;default:k&1?E(I,L,w,j,G,q,R,N,V):k&6?H(I,L,w,j,G,q,R,N,V):(k&64||k&128)&&A.process(I,L,w,j,G,q,R,N,V,le)}C!=null&&G&&sf(C,I&&I.ref,q,L||I,!L)},g=(I,L,w,j)=>{if(I==null)i(L.el=a(L.children),w,j);else{const G=L.el=I.el;L.children!==I.children&&c(G,L.children)}},m=(I,L,w,j)=>{I==null?i(L.el=l(L.children||""),w,j):L.el=I.el},y=(I,L,w,j)=>{[I.el,I.anchor]=p(I.children,L,w,j,I.el,I.anchor)},x=({el:I,anchor:L},w,j)=>{let G;for(;I&&I!==L;)G=h(I),i(I,w,j),I=G;i(L,w,j)},v=({el:I,anchor:L})=>{let w;for(;I&&I!==L;)w=h(I),r(I),I=w;r(L)},E=(I,L,w,j,G,q,R,N,V)=>{L.type==="svg"?R="svg":L.type==="math"&&(R="mathml"),I==null?T(L,w,j,G,q,R,N,V):b(I,L,G,q,R,N,V)},T=(I,L,w,j,G,q,R,N)=>{let V,A;const{props:C,shapeFlag:k,transition:U,dirs:z}=I;if(V=I.el=o(I.type,q,C&&C.is,C),k&8?u(V,I.children):k&16&&P(I.children,V,null,j,G,xd(I,q),R,N),z&&ys(I,null,j,"created"),M(V,I,I.scopeId,R,j),C){for(const he in C)he!=="value"&&!qa(he)&&s(V,he,null,C[he],q,j);"value"in C&&s(V,"value",null,C.value,q),(A=C.onVnodeBeforeMount)&&Oi(A,j,I)}z&&ys(I,null,j,"beforeMount");const Y=kA(G,U);Y&&U.beforeEnter(V),i(V,L,w),((A=C&&C.onVnodeMounted)||Y||z)&&wn(()=>{A&&Oi(A,j,I),Y&&U.enter(V),z&&ys(I,null,j,"mounted")},G)},M=(I,L,w,j,G)=>{if(w&&d(I,w),j)for(let q=0;q{for(let A=V;A{const N=L.el=I.el;let{patchFlag:V,dynamicChildren:A,dirs:C}=L;V|=I.patchFlag&16;const k=I.props||pt,U=L.props||pt;let z;if(w&&xs(w,!1),(z=U.onVnodeBeforeUpdate)&&Oi(z,w,L,I),C&&ys(L,I,w,"beforeUpdate"),w&&xs(w,!0),(k.innerHTML&&U.innerHTML==null||k.textContent&&U.textContent==null)&&u(N,""),A?S(I.dynamicChildren,A,N,w,j,xd(L,G),q):R||Q(I,L,N,null,w,j,xd(L,G),q,!1),V>0){if(V&16)D(N,k,U,w,G);else if(V&2&&k.class!==U.class&&s(N,"class",null,U.class,G),V&4&&s(N,"style",k.style,U.style,G),V&8){const Y=L.dynamicProps;for(let he=0;he{z&&Oi(z,w,L,I),C&&ys(L,I,w,"updated")},j)},S=(I,L,w,j,G,q,R)=>{for(let N=0;N{if(L!==w){if(L!==pt)for(const q in L)!qa(q)&&!(q in w)&&s(I,q,L[q],null,G,j);for(const q in w){if(qa(q))continue;const R=w[q],N=L[q];R!==N&&q!=="value"&&s(I,q,N,R,G,j)}"value"in w&&s(I,"value",L.value,w.value,G)}},B=(I,L,w,j,G,q,R,N,V)=>{const A=L.el=I?I.el:a(""),C=L.anchor=I?I.anchor:a("");let{patchFlag:k,dynamicChildren:U,slotScopeIds:z}=L;z&&(N=N?N.concat(z):z),I==null?(i(A,w,j),i(C,w,j),P(L.children||[],w,C,G,q,R,N,V)):k>0&&k&64&&U&&I.dynamicChildren?(S(I.dynamicChildren,U,w,G,q,R,N),(L.key!=null||G&&L===G.subTree)&&og(I,L,!0)):Q(I,L,w,C,G,q,R,N,V)},H=(I,L,w,j,G,q,R,N,V)=>{L.slotScopeIds=N,I==null?L.shapeFlag&512?G.ctx.activate(L,w,j,R,V):$(L,w,j,G,q,R,V):ee(I,L,V)},$=(I,L,w,j,G,q,R)=>{const N=I.component=s1(I,j,G);if(ph(I)&&(N.ctx.renderer=le),o1(N,!1,R),N.asyncDep){if(G&&G.registerDep(N,Z,R),!I.el){const V=N.subTree=an(Pn);m(null,V,L,w)}}else Z(N,I,L,w,G,q,R)},ee=(I,L,w)=>{const j=L.component=I.component;if(YA(I,L,w))if(j.asyncDep&&!j.asyncResolved){te(j,L,w);return}else j.next=L,j.update();else L.el=I.el,j.vnode=L},Z=(I,L,w,j,G,q,R)=>{const N=()=>{if(I.isMounted){let{next:k,bu:U,u:z,parent:Y,vnode:he}=I;{const Te=zb(I);if(Te){k&&(k.el=he.el,te(I,k,R)),Te.asyncDep.then(()=>{I.isUnmounted||N()});return}}let ce=k,ye;xs(I,!1),k?(k.el=he.el,te(I,k,R)):k=he,U&&Bu(U),(ye=k.props&&k.props.onVnodeBeforeUpdate)&&Oi(ye,Y,k,he),xs(I,!0);const Fe=Y_(I),me=I.subTree;I.subTree=Fe,_(me,Fe,f(me.el),W(me),I,G,q),k.el=Fe.el,ce===null&&jA(I,Fe.el),z&&wn(z,G),(ye=k.props&&k.props.onVnodeUpdated)&&wn(()=>Oi(ye,Y,k,he),G)}else{let k;const{el:U,props:z}=L,{bm:Y,m:he,parent:ce,root:ye,type:Fe}=I,me=Qo(L);xs(I,!1),Y&&Bu(Y),!me&&(k=z&&z.onVnodeBeforeMount)&&Oi(k,ce,L),xs(I,!0);{ye.ce&&ye.ce._injectChildStyle(Fe);const Te=I.subTree=Y_(I);_(null,Te,w,j,I,G,q),L.el=Te.el}if(he&&wn(he,G),!me&&(k=z&&z.onVnodeMounted)){const Te=L;wn(()=>Oi(k,ce,Te),G)}(L.shapeFlag&256||ce&&Qo(ce.vnode)&&ce.vnode.shapeFlag&256)&&I.a&&wn(I.a,G),I.isMounted=!0,L=w=j=null}};I.scope.on();const V=I.effect=new kx(N);I.scope.off();const A=I.update=V.run.bind(V),C=I.job=V.runIfDirty.bind(V);C.i=I,C.id=I.uid,V.scheduler=()=>tg(C),xs(I,!0),A()},te=(I,L,w)=>{L.component=I;const j=I.vnode.props;I.vnode=L,I.next=null,DA(I,L.props,j,w),FA(I,L.children,w),as(),F_(I),ls()},Q=(I,L,w,j,G,q,R,N,V=!1)=>{const A=I&&I.children,C=I?I.shapeFlag:0,k=L.children,{patchFlag:U,shapeFlag:z}=L;if(U>0){if(U&128){ve(A,k,w,j,G,q,R,N,V);return}else if(U&256){pe(A,k,w,j,G,q,R,N,V);return}}z&8?(C&16&&be(A,G,q),k!==A&&u(w,k)):C&16?z&16?ve(A,k,w,j,G,q,R,N,V):be(A,G,q,!0):(C&8&&u(w,""),z&16&&P(k,w,j,G,q,R,N,V))},pe=(I,L,w,j,G,q,R,N,V)=>{I=I||Ko,L=L||Ko;const A=I.length,C=L.length,k=Math.min(A,C);let U;for(U=0;UC?be(I,G,q,!0,!1,k):P(L,w,j,G,q,R,N,V,k)},ve=(I,L,w,j,G,q,R,N,V)=>{let A=0;const C=L.length;let k=I.length-1,U=C-1;for(;A<=k&&A<=U;){const z=I[A],Y=L[A]=V?qr(L[A]):ki(L[A]);if(Gs(z,Y))_(z,Y,w,null,G,q,R,N,V);else break;A++}for(;A<=k&&A<=U;){const z=I[k],Y=L[U]=V?qr(L[U]):ki(L[U]);if(Gs(z,Y))_(z,Y,w,null,G,q,R,N,V);else break;k--,U--}if(A>k){if(A<=U){const z=U+1,Y=zU)for(;A<=k;)xe(I[A],G,q,!0),A++;else{const z=A,Y=A,he=new Map;for(A=Y;A<=U;A++){const Me=L[A]=V?qr(L[A]):ki(L[A]);Me.key!=null&&he.set(Me.key,A)}let ce,ye=0;const Fe=U-Y+1;let me=!1,Te=0;const ke=new Array(Fe);for(A=0;A=Fe){xe(Me,G,q,!0);continue}let qe;if(Me.key!=null)qe=he.get(Me.key);else for(ce=Y;ce<=U;ce++)if(ke[ce-Y]===0&&Gs(Me,L[ce])){qe=ce;break}qe===void 0?xe(Me,G,q,!0):(ke[qe-Y]=A+1,qe>=Te?Te=qe:me=!0,_(Me,L[qe],w,null,G,q,R,N,V),ye++)}const We=me?VA(ke):Ko;for(ce=We.length-1,A=Fe-1;A>=0;A--){const Me=Y+A,qe=L[Me],Je=Me+1{const{el:q,type:R,transition:N,children:V,shapeFlag:A}=I;if(A&6){re(I.component.subTree,L,w,j);return}if(A&128){I.suspense.move(L,w,j);return}if(A&64){R.move(I,L,w,le);return}if(R===Xt){i(q,L,w);for(let k=0;kN.enter(q),G);else{const{leave:k,delayLeave:U,afterLeave:z}=N,Y=()=>i(q,L,w),he=()=>{k(q,()=>{Y(),z&&z()})};U?U(q,Y,he):he()}else i(q,L,w)},xe=(I,L,w,j=!1,G=!1)=>{const{type:q,props:R,ref:N,children:V,dynamicChildren:A,shapeFlag:C,patchFlag:k,dirs:U,cacheIndex:z}=I;if(k===-2&&(G=!1),N!=null&&sf(N,null,w,I,!0),z!=null&&(L.renderCache[z]=void 0),C&256){L.ctx.deactivate(I);return}const Y=C&1&&U,he=!Qo(I);let ce;if(he&&(ce=R&&R.onVnodeBeforeUnmount)&&Oi(ce,L,I),C&6)ge(I.component,w,j);else{if(C&128){I.suspense.unmount(w,j);return}Y&&ys(I,null,L,"beforeUnmount"),C&64?I.type.remove(I,L,w,le,j):A&&!A.hasOnce&&(q!==Xt||k>0&&k&64)?be(A,L,w,!1,!0):(q===Xt&&k&384||!G&&C&16)&&be(V,L,w),j&&ze(I)}(he&&(ce=R&&R.onVnodeUnmounted)||Y)&&wn(()=>{ce&&Oi(ce,L,I),Y&&ys(I,null,L,"unmounted")},w)},ze=I=>{const{type:L,el:w,anchor:j,transition:G}=I;if(L===Xt){se(w,j);return}if(L===Vu){v(I);return}const q=()=>{r(w),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(I.shapeFlag&1&&G&&!G.persisted){const{leave:R,delayLeave:N}=G,V=()=>R(w,q);N?N(I.el,q,V):V()}else q()},se=(I,L)=>{let w;for(;I!==L;)w=h(I),r(I),I=w;r(L)},ge=(I,L,w)=>{const{bum:j,scope:G,job:q,subTree:R,um:N,m:V,a:A}=I;q_(V),q_(A),j&&Bu(j),G.stop(),q&&(q.flags|=8,xe(R,I,L,w)),N&&wn(N,L),wn(()=>{I.isUnmounted=!0},L),L&&L.pendingBranch&&!L.isUnmounted&&I.asyncDep&&!I.asyncResolved&&I.suspenseId===L.pendingId&&(L.deps--,L.deps===0&&L.resolve())},be=(I,L,w,j=!1,G=!1,q=0)=>{for(let R=q;R{if(I.shapeFlag&6)return W(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const L=h(I.anchor||I.el),w=L&&L[db];return w?h(w):L};let ae=!1;const ue=(I,L,w)=>{I==null?L._vnode&&xe(L._vnode,null,null,!0):_(L._vnode||null,I,L,null,null,null,w),L._vnode=I,ae||(ae=!0,F_(),cb(),ae=!1)},le={p:_,um:xe,m:re,r:ze,mt:$,mc:P,pc:Q,pbc:S,n:W,o:n};return{render:ue,hydrate:void 0,createApp:IA(ue)}}function xd({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function xs({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function kA(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function og(n,e,t=!1){const i=n.children,r=e.children;if(Be(i)&&Be(r))for(let s=0;s>1,n[t[a]]0&&(e[i]=t[s-1]),t[s]=i)}}for(s=t.length,o=t[s-1];s-- >0;)t[s]=o,o=e[o];return t}function zb(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:zb(e)}function q_(n){if(n)for(let e=0;egn(zA);function rc(n,e){return sc(n,null,e)}function z4(n,e){return sc(n,null,{flush:"post"})}function GA(n,e){return sc(n,null,{flush:"sync"})}function Ge(n,e,t){return sc(n,e,t)}function sc(n,e,t=pt){const{immediate:i,deep:r,flush:s,once:o}=t,a=Zt({},t),l=e&&i||!e&&s!=="post";let c;if(wl){if(s==="sync"){const d=HA();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=zi,d.resume=zi,d.pause=zi,d}}const u=tn;a.call=(d,p,_)=>Ci(d,u,p,_);let f=!1;s==="post"?a.scheduler=d=>{wn(d,u&&u.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(d,p)=>{p?d():tg(d)}),a.augmentJob=d=>{e&&(d.flags|=4),f&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const h=nA(n,e,a);return wl&&(c?c.push(h):l&&h()),h}function WA(n,e,t){const i=this.proxy,r=Lt(n)?n.includes(".")?Hb(i,n):()=>i[n]:n.bind(i,i);let s;$e(e)?s=e:(s=e.handler,t=e);const o=ac(this),a=sc(r,s.bind(i),t);return o(),a}function Hb(n,e){const t=e.split(".");return()=>{let i=n;for(let r=0;r{let u,f=pt,h;return GA(()=>{const d=n[r];Vn(u,d)&&(u=d,c())}),{get(){return l(),t.get?t.get(u):u},set(d){const p=t.set?t.set(d):d;if(!Vn(p,u)&&!(f!==pt&&Vn(d,f)))return;const _=i.vnode.props;_&&(e in _||r in _||s in _)&&(`onUpdate:${e}`in _||`onUpdate:${r}`in _||`onUpdate:${s}`in _)||(u=d,c()),i.emit(`update:${e}`,p),Vn(d,p)&&Vn(d,f)&&!Vn(p,h)&&c(),f=d,h=p}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||pt:a,done:!1}:{done:!0}}}},a}const Gb=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${Qn(e)}Modifiers`]||n[`${Ar(e)}Modifiers`];function XA(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||pt;let r=t;const s=e.startsWith("update:"),o=s&&Gb(i,e.slice(7));o&&(o.trim&&(r=t.map(u=>Lt(u)?u.trim():u)),o.number&&(r=t.map(Qu)));let a,l=i[a=Fu(e)]||i[a=Fu(Qn(e))];!l&&s&&(l=i[a=Fu(Ar(e))]),l&&Ci(l,n,6,r);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,Ci(c,n,6,r)}}function Wb(n,e,t=!1){const i=e.emitsCache,r=i.get(n);if(r!==void 0)return r;const s=n.emits;let o={},a=!1;if(!$e(n)){const l=c=>{const u=Wb(c,e,!0);u&&(a=!0,Zt(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!s&&!a?(At(n)&&i.set(n,null),null):(Be(s)?s.forEach(l=>o[l]=null):Zt(o,s),At(n)&&i.set(n,o),o)}function gh(n,e){return!n||!rh(e)?!1:(e=e.slice(2).replace(/Once$/,""),xt(n,e[0].toLowerCase()+e.slice(1))||xt(n,Ar(e))||xt(n,e))}function Y_(n){const{type:e,vnode:t,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:f,data:h,setupState:d,ctx:p,inheritAttrs:_}=n,g=rf(n);let m,y;try{if(t.shapeFlag&4){const v=r||i,E=v;m=ki(c.call(E,v,u,f,d,h,p)),y=a}else{const v=e;m=ki(v.length>1?v(f,{attrs:a,slots:o,emit:l}):v(f,null)),y=e.props?a:$A(a)}}catch(v){Ja.length=0,dh(v,n,1),m=an(Pn)}let x=m;if(y&&_!==!1){const v=Object.keys(y),{shapeFlag:E}=x;v.length&&E&7&&(s&&v.some(Gm)&&(y=qA(y,s)),x=ts(x,y,!1,!0))}return t.dirs&&(x=ts(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(t.dirs):t.dirs),t.transition&&bl(x,t.transition),m=x,rf(g),m}const $A=n=>{let e;for(const t in n)(t==="class"||t==="style"||rh(t))&&((e||(e={}))[t]=n[t]);return e},qA=(n,e)=>{const t={};for(const i in n)(!Gm(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function YA(n,e,t){const{props:i,children:r,component:s}=n,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?j_(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let f=0;fn.__isSuspense;function KA(n,e){e&&e.pendingBranch?Be(n)?e.effects.push(...n):e.effects.push(n):sA(n)}const Xt=Symbol.for("v-fgt"),oc=Symbol.for("v-txt"),Pn=Symbol.for("v-cmt"),Vu=Symbol.for("v-stc"),Ja=[];let Kn=null;function ln(n=!1){Ja.push(Kn=n?null:[])}function ZA(){Ja.pop(),Kn=Ja[Ja.length-1]||null}let Ml=1;function K_(n,e=!1){Ml+=n,n<0&&Kn&&e&&(Kn.hasOnce=!0)}function $b(n){return n.dynamicChildren=Ml>0?Kn||Ko:null,ZA(),Ml>0&&Kn&&Kn.push(n),n}function ui(n,e,t,i,r,s){return $b($r(n,e,t,i,r,s,!0))}function El(n,e,t,i,r){return $b(an(n,e,t,i,r,!0))}function Tl(n){return n?n.__v_isVNode===!0:!1}function Gs(n,e){return n.type===e.type&&n.key===e.key}const qb=({key:n})=>n??null,zu=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Lt(n)||wt(n)||$e(n)?{i:Yt,r:n,k:e,f:!!t}:n:null);function $r(n,e=null,t=null,i=0,r=null,s=n===Xt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&qb(e),ref:e&&zu(e),scopeId:fb,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Yt};return a?(ag(l,t),s&128&&n.normalize(l)):t&&(l.shapeFlag|=Lt(t)?8:16),Ml>0&&!o&&Kn&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Kn.push(l),l}const an=JA;function JA(n,e=null,t=null,i=0,r=null,s=!1){if((!n||n===Tb)&&(n=Pn),Tl(n)){const a=ts(n,e,!0);return t&&ag(a,t),Ml>0&&!s&&Kn&&(a.shapeFlag&6?Kn[Kn.indexOf(n)]=a:Kn.push(a)),a.patchFlag=-2,a}if(u1(n)&&(n=n.__vccOpts),e){e=QA(e);let{class:a,style:l}=e;a&&!Lt(a)&&(e.class=ga(a)),At(l)&&(Jm(l)&&!Be(l)&&(l=Zt({},l)),e.style=mi(l))}const o=Lt(n)?1:Xb(n)?128:pb(n)?64:At(n)?4:$e(n)?2:0;return $r(n,e,t,i,r,o,s,!0)}function QA(n){return n?Jm(n)||Db(n)?Zt({},n):n:null}function ts(n,e,t=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=n,c=e?n1(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&qb(c),ref:e&&e.ref?t&&s?Be(s)?s.concat(zu(e)):[s,zu(e)]:zu(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Xt?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ts(n.ssContent),ssFallback:n.ssFallback&&ts(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&bl(u,l.clone(u)),u}function e1(n=" ",e=0){return an(oc,null,n,e)}function t1(n,e){const t=an(Vu,null,n);return t.staticCount=e,t}function Z_(n="",e=!1){return e?(ln(),El(Pn,null,n)):an(Pn,null,n)}function ki(n){return n==null||typeof n=="boolean"?an(Pn):Be(n)?an(Xt,null,n.slice()):Tl(n)?qr(n):an(oc,null,String(n))}function qr(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:ts(n)}function ag(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Be(e))t=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),ag(n,r()),r._c&&(r._d=!0));return}else{t=32;const r=e._;!r&&!Db(e)?e._ctx=Yt:r===3&&Yt&&(Yt.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else $e(e)?(e={default:e,_ctx:Yt},t=32):(e=String(e),i&64?(t=16,e=[e1(e)]):t=8);n.children=e,n.shapeFlag|=t}function n1(...n){const e={};for(let t=0;ttn||Yt;let af,Hp;{const n=ah(),e=(t,i)=>{let r;return(r=n[t])||(r=n[t]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};af=e("__VUE_INSTANCE_SETTERS__",t=>tn=t),Hp=e("__VUE_SSR_SETTERS__",t=>wl=t)}const ac=n=>{const e=tn;return af(n),n.scope.on(),()=>{n.scope.off(),af(e)}},J_=()=>{tn&&tn.scope.off(),af(null)};function Yb(n){return n.vnode.shapeFlag&4}let wl=!1;function o1(n,e=!1,t=!1){e&&Hp(e);const{props:i,children:r}=n.vnode,s=Yb(n);LA(n,i,s,e),UA(n,r,t);const o=s?a1(n,e):void 0;return e&&Hp(!1),o}function a1(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,EA);const{setup:i}=t;if(i){as();const r=n.setupContext=i.length>1?Kb(n):null,s=ac(n),o=nc(i,n,0,[n.props,r]),a=Ix(o);if(ls(),s(),(a||n.sp)&&!Qo(n)&&Sb(n),a){if(o.then(J_,J_),e)return o.then(l=>{Q_(n,l)}).catch(l=>{dh(l,n,0)});n.asyncDep=o}else Q_(n,o)}else jb(n)}function Q_(n,e,t){$e(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:At(e)&&(n.setupState=ib(e)),jb(n)}function jb(n,e,t){const i=n.type;n.render||(n.render=i.render||zi);{const r=ac(n);as();try{TA(n)}finally{ls(),r()}}}const l1={get(n,e){return pn(n,"get",""),n[e]}};function Kb(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,l1),slots:n.slots,emit:n.emit,expose:e}}function _h(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(ib(Qm(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Za)return Za[t](n)},has(e,t){return t in e||t in Za}})):n.proxy}function c1(n,e=!0){return $e(n)?n.displayName||n.name:n.name||e&&n.__name}function u1(n){return $e(n)&&"__vccOpts"in n}const Se=(n,e)=>eA(n,e,wl);function Sr(n,e,t){const i=arguments.length;return i===2?At(e)&&!Be(e)?Tl(e)?an(n,null,[e]):an(n,e):an(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Tl(t)&&(t=[t]),an(n,e,t))}const f1="3.5.13";/** +**/function nc(n,e,t,i){try{return i?n(...i):n()}catch(s){dh(s,e,t)}}function Ci(n,e,t,i){if($e(n)){const s=nc(n,e,t,i);return s&&Ix(s)&&s.catch(r=>{dh(r,e,t)}),s}if(Be(n)){const s=[];for(let r=0;r>>1,s=Rn[i],r=xl(s);r=xl(t)?Rn.push(n):Rn.splice(sA(e),0,n),n.flags|=1,lb()}}function lb(){nf||(nf=ab.then(ub))}function rA(n){Be(n)?Jo.push(...n):Ws&&n.id===-1?Ws.splice(zo+1,0,n):n.flags&1||(Jo.push(n),n.flags|=1),lb()}function F_(n,e,t=Ui+1){for(;txl(t)-xl(i));if(Jo.length=0,Ws){Ws.push(...e);return}for(Ws=e,zo=0;zon.id==null?n.flags&2?-1:1/0:n.id;function ub(n){try{for(Ui=0;Ui{i._d&&K_(-1);const r=sf(e);let o;try{o=n(...s)}finally{sf(r),i._d&&K_(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function L4(n,e){if(Yt===null)return n;const t=_h(Yt),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,Ka=n=>n&&(n.disabled||n.disabled===""),B_=n=>n&&(n.defer||n.defer===""),k_=n=>typeof SVGElement<"u"&&n instanceof SVGElement,V_=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Up=(n,e)=>{const t=n&&n.to;return Lt(t)?e?e(t):null:t},mb={name:"Teleport",__isTeleport:!0,process(n,e,t,i,s,r,o,a,l,c){const{mc:u,pc:f,pbc:h,o:{insert:d,querySelector:p,createText:_,createComment:g}}=c,m=Ka(e.props);let{shapeFlag:y,children:x,dynamicChildren:v}=e;if(n==null){const E=e.el=_(""),T=e.anchor=_("");d(E,t,i),d(T,t,i);const M=(b,S)=>{y&16&&(s&&s.isCE&&(s.ce._teleportTarget=b),u(x,b,S,s,r,o,a,l))},P=()=>{const b=e.target=Up(e.props,p),S=gb(b,e,_,d);b&&(o!=="svg"&&k_(b)?o="svg":o!=="mathml"&&V_(b)&&(o="mathml"),m||(M(b,S),ku(e,!1)))};m&&(M(t,T),ku(e,!0)),B_(e.props)?wn(()=>{P(),e.el.__isMounted=!0},r):P()}else{if(B_(e.props)&&!n.el.__isMounted){wn(()=>{mb.process(n,e,t,i,s,r,o,a,l,c),delete n.el.__isMounted},r);return}e.el=n.el,e.targetStart=n.targetStart;const E=e.anchor=n.anchor,T=e.target=n.target,M=e.targetAnchor=n.targetAnchor,P=Ka(n.props),b=P?t:T,S=P?E:M;if(o==="svg"||k_(T)?o="svg":(o==="mathml"||V_(T))&&(o="mathml"),v?(h(n.dynamicChildren,v,b,s,r,o,a),og(n,e,!0)):l||f(n,e,b,S,s,r,o,a,!1),m)P?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):Ic(e,t,E,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const D=e.target=Up(e.props,p);D&&Ic(e,D,null,c,0)}else P&&Ic(e,T,M,c,1);ku(e,m)}},remove(n,e,t,{um:i,o:{remove:s}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:f,props:h}=n;if(f&&(s(c),s(u)),r&&s(l),o&16){const d=r||!Ka(h);for(let p=0;p{n.isMounted=!0}),Eb(()=>{n.isUnmounting=!0}),n}const si=[Function,Array],_b={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:si,onEnter:si,onAfterEnter:si,onEnterCancelled:si,onBeforeLeave:si,onLeave:si,onAfterLeave:si,onLeaveCancelled:si,onBeforeAppear:si,onAppear:si,onAfterAppear:si,onAppearCancelled:si},vb=n=>{const e=n.subTree;return e.component?vb(e.component):e},lA={name:"BaseTransition",props:_b,setup(n,{slots:e}){const t=vn(),i=aA();return()=>{const s=e.default&&bb(e.default(),!0);if(!s||!s.length)return;const r=yb(s),o=ot(n),{mode:a}=o;if(i.isLeaving)return vd(r);const l=z_(r);if(!l)return vd(r);let c=Fp(l,o,i,t,f=>c=f);l.type!==Pn&&bl(l,c);let u=t.subTree&&z_(t.subTree);if(u&&u.type!==Pn&&!Gr(l,u)&&vb(t).type!==Pn){let f=Fp(u,o,i,t);if(bl(u,f),a==="out-in"&&l.type!==Pn)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,u=void 0},vd(r);a==="in-out"&&l.type!==Pn?f.delayLeave=(h,d,p)=>{const _=xb(i,u);_[String(u.key)]=u,h[Xs]=()=>{d(),h[Xs]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function yb(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==Pn){e=t;break}}return e}const cA=lA;function xb(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function Fp(n,e,t,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:h,onLeave:d,onAfterLeave:p,onLeaveCancelled:_,onBeforeAppear:g,onAppear:m,onAfterAppear:y,onAppearCancelled:x}=e,v=String(n.key),E=xb(t,n),T=(b,S)=>{b&&Ci(b,i,9,S)},M=(b,S)=>{const D=S[1];T(b,S),Be(b)?b.every(B=>B.length<=1)&&D():b.length<=1&&D()},P={mode:o,persisted:a,beforeEnter(b){let S=l;if(!t.isMounted)if(r)S=g||l;else return;b[Xs]&&b[Xs](!0);const D=E[v];D&&Gr(n,D)&&D.el[Xs]&&D.el[Xs](),T(S,[b])},enter(b){let S=c,D=u,B=f;if(!t.isMounted)if(r)S=m||c,D=y||u,B=x||f;else return;let H=!1;const $=b[Lc]=ee=>{H||(H=!0,ee?T(B,[b]):T(D,[b]),P.delayedLeave&&P.delayedLeave(),b[Lc]=void 0)};S?M(S,[b,$]):$()},leave(b,S){const D=String(n.key);if(b[Lc]&&b[Lc](!0),t.isUnmounting)return S();T(h,[b]);let B=!1;const H=b[Xs]=$=>{B||(B=!0,S(),$?T(_,[b]):T(p,[b]),b[Xs]=void 0,E[D]===n&&delete E[D])};E[D]=n,d?M(d,[b,H]):H()},clone(b){const S=Fp(b,e,t,i,s);return s&&s(S),S}};return P}function vd(n){if(ph(n))return n=tr(n),n.children=null,n}function z_(n){if(!ph(n))return pb(n.type)&&n.children?yb(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&$e(t.default))return t.default()}}function bl(n,e){n.shapeFlag&6&&n.component?(n.transition=e,bl(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function bb(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rrf(p,e&&(Be(e)?e[_]:e),t,i,s));return}if(Qo(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&rf(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?_h(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=e&&e.r,u=a.refs===pt?a.refs={}:a.refs,f=a.setupState,h=ot(f),d=f===pt?()=>!1:p=>xt(h,p);if(c!=null&&c!==l&&(Lt(c)?(u[c]=null,d(c)&&(f[c]=null)):wt(c)&&(c.value=null)),$e(l))nc(l,a,12,[o,u]);else{const p=Lt(l),_=wt(l);if(p||_){const g=()=>{if(n.f){const m=p?d(l)?f[l]:u[l]:l.value;s?Be(m)&&Wm(m,r):Be(m)?m.includes(r)||m.push(r):p?(u[l]=[r],d(l)&&(f[l]=u[l])):(l.value=[r],n.k&&(u[n.k]=l.value))}else p?(u[l]=o,d(l)&&(f[l]=o)):_&&(l.value=o,n.k&&(u[n.k]=o))};o?(g.id=-1,wn(g,t)):g()}}}ah().requestIdleCallback;ah().cancelIdleCallback;const Qo=n=>!!n.type.__asyncLoader,ph=n=>n.type.__isKeepAlive;function uA(n,e){Mb(n,"a",e)}function fA(n,e){Mb(n,"da",e)}function Mb(n,e,t=tn){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(mh(e,i,t),t){let s=t.parent;for(;s&&s.parent;)ph(s.parent.vnode)&&hA(i,e,t,s),s=s.parent}}function hA(n,e,t,i){const s=mh(e,n,i,!0);$i(()=>{Wm(i[e],s)},t)}function mh(n,e,t=tn,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{ar();const a=ac(t),l=Ci(e,t,n,o);return a(),lr(),l});return i?s.unshift(r):s.push(r),r}}const Cs=n=>(e,t=tn)=>{(!wl||n==="sp")&&mh(n,(...i)=>e(...i),t)},dA=Cs("bm"),yn=Cs("m"),pA=Cs("bu"),mA=Cs("u"),Eb=Cs("bum"),$i=Cs("um"),gA=Cs("sp"),_A=Cs("rtg"),vA=Cs("rtc");function yA(n,e=tn){mh("ec",n,e)}const ng="components",xA="directives";function N4(n,e){return ig(ng,n,!0,e)||n}const Tb=Symbol.for("v-ndc");function bA(n){return Lt(n)?ig(ng,n,!1)||n:n||Tb}function U4(n){return ig(xA,n)}function ig(n,e,t=!0,i=!1){const s=Yt||tn;if(s){const r=s.type;if(n===ng){const a=c1(r,!1);if(a&&(a===e||a===Qn(e)||a===oh(Qn(e))))return r}const o=H_(s[n]||r[n],e)||H_(s.appContext[n],e);return!o&&i?r:o}}function H_(n,e){return n&&(n[e]||n[Qn(e)]||n[oh(Qn(e))])}function SA(n,e,t,i){let s;const r=t,o=Be(n);if(o||Lt(n)){const a=o&&vs(n);let l=!1;a&&(l=!ci(n),n=uh(n)),s=new Array(n.length);for(let c=0,u=n.length;ce(a,l,void 0,r));else{const a=Object.keys(n);s=new Array(a.length);for(let l=0,c=a.length;lTl(e)?!(e.type===Pn||e.type===Xt&&!wb(e.children)):!0)?n:null}function F4(n,e){const t={};for(const i in n)t[Fu(i)]=n[i];return t}const Bp=n=>n?Yb(n)?_h(n):Bp(n.parent):null,Za=Zt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>Bp(n.parent),$root:n=>Bp(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Rb(n),$forceUpdate:n=>n.f||(n.f=()=>{tg(n.update)}),$nextTick:n=>n.n||(n.n=cr.bind(n.proxy)),$watch:n=>WA.bind(n)}),yd=(n,e)=>n!==pt&&!n.__isScriptSetup&&xt(n,e),EA={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(yd(i,e))return o[e]=1,i[e];if(s!==pt&&xt(s,e))return o[e]=2,s[e];if((c=n.propsOptions[0])&&xt(c,e))return o[e]=3,r[e];if(t!==pt&&xt(t,e))return o[e]=4,t[e];kp&&(o[e]=0)}}const u=Za[e];let f,h;if(u)return e==="$attrs"&&pn(n.attrs,"get",""),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==pt&&xt(t,e))return o[e]=4,t[e];if(h=l.config.globalProperties,xt(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return yd(s,e)?(s[e]=t,!0):i!==pt&&xt(i,e)?(i[e]=t,!0):xt(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!t[o]||n!==pt&&xt(n,o)||yd(e,o)||(a=r[0])&&xt(a,o)||xt(i,o)||xt(Za,o)||xt(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:xt(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function sg(){return Ab().slots}function B4(){return Ab().attrs}function Ab(){const n=vn();return n.setupContext||(n.setupContext=Kb(n))}function Sl(n){return Be(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function k4(n,e){const t=Sl(n);for(const i in e){if(i.startsWith("__skip"))continue;let s=t[i];s?Be(s)||$e(s)?s=t[i]={type:s,default:e[i]}:s.default=e[i]:s===null&&(s=t[i]={default:e[i]}),s&&e[`__skip_${i}`]&&(s.skipFactory=!0)}return t}function V4(n,e){return!n||!e?n||e:Be(n)&&Be(e)?n.concat(e):Zt({},Sl(n),Sl(e))}let kp=!0;function TA(n){const e=Rb(n),t=n.proxy,i=n.ctx;kp=!1,e.beforeCreate&&G_(e.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:f,mounted:h,beforeUpdate:d,updated:p,activated:_,deactivated:g,beforeDestroy:m,beforeUnmount:y,destroyed:x,unmounted:v,render:E,renderTracked:T,renderTriggered:M,errorCaptured:P,serverPrefetch:b,expose:S,inheritAttrs:D,components:B,directives:H,filters:$}=e;if(c&&wA(c,i,null),o)for(const te in o){const Q=o[te];$e(Q)&&(i[te]=Q.bind(t))}if(s){const te=s.call(t,t);At(te)&&(n.data=hi(te))}if(kp=!0,r)for(const te in r){const Q=r[te],pe=$e(Q)?Q.bind(t,t):$e(Q.get)?Q.get.bind(t,t):zi,ve=!$e(Q)&&$e(Q.set)?Q.set.bind(t):zi,se=Se({get:pe,set:ve});Object.defineProperty(i,te,{enumerable:!0,configurable:!0,get:()=>se.value,set:xe=>se.value=xe})}if(a)for(const te in a)Cb(a[te],i,t,te);if(l){const te=$e(l)?l.call(t):l;Reflect.ownKeys(te).forEach(Q=>{er(Q,te[Q])})}u&&G_(u,n,"c");function Z(te,Q){Be(Q)?Q.forEach(pe=>te(pe.bind(t))):Q&&te(Q.bind(t))}if(Z(dA,f),Z(yn,h),Z(pA,d),Z(mA,p),Z(uA,_),Z(fA,g),Z(yA,P),Z(vA,T),Z(_A,M),Z(Eb,y),Z($i,v),Z(gA,b),Be(S))if(S.length){const te=n.exposed||(n.exposed={});S.forEach(Q=>{Object.defineProperty(te,Q,{get:()=>t[Q],set:pe=>t[Q]=pe})})}else n.exposed||(n.exposed={});E&&n.render===zi&&(n.render=E),D!=null&&(n.inheritAttrs=D),B&&(n.components=B),H&&(n.directives=H),b&&Sb(n)}function wA(n,e,t=zi){Be(n)&&(n=Vp(n));for(const i in n){const s=n[i];let r;At(s)?"default"in s?r=gn(s.from||i,s.default,!0):r=gn(s.from||i):r=gn(s),wt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function G_(n,e,t){Ci(Be(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function Cb(n,e,t,i){let s=i.includes(".")?Hb(t,i):()=>t[i];if(Lt(n)){const r=e[n];$e(r)&&Ge(s,r)}else if($e(n))Ge(s,n.bind(t));else if(At(n))if(Be(n))n.forEach(r=>Cb(r,e,t,i));else{const r=$e(n.handler)?n.handler.bind(t):e[n.handler];$e(r)&&Ge(s,r,n)}}function Rb(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(e);let l;return a?l=a:!s.length&&!t&&!i?l=e:(l={},s.length&&s.forEach(c=>of(l,c,o,!0)),of(l,e,o)),At(e)&&r.set(e,l),l}function of(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&of(n,r,t,!0),s&&s.forEach(o=>of(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=AA[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const AA={data:W_,props:X_,emits:X_,methods:Ga,computed:Ga,beforeCreate:Mn,created:Mn,beforeMount:Mn,mounted:Mn,beforeUpdate:Mn,updated:Mn,beforeDestroy:Mn,beforeUnmount:Mn,destroyed:Mn,unmounted:Mn,activated:Mn,deactivated:Mn,errorCaptured:Mn,serverPrefetch:Mn,components:Ga,directives:Ga,watch:RA,provide:W_,inject:CA};function W_(n,e){return e?n?function(){return Zt($e(n)?n.call(this,this):n,$e(e)?e.call(this,this):e)}:e:n}function CA(n,e){return Ga(Vp(n),Vp(e))}function Vp(n){if(Be(n)){const e={};for(let t=0;t1)return t&&$e(e)?e.call(i&&i.proxy):e}}function ic(){return!!(tn||Yt||Jr)}const Ib={},Lb=()=>Object.create(Ib),Db=n=>Object.getPrototypeOf(n)===Ib;function LA(n,e,t,i=!1){const s={},r=Lb();n.propsDefaults=Object.create(null),Ob(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:tb(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function DA(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=ot(s),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let f=0;f{l=!0;const[h,d]=Nb(f,e,!0);Zt(o,h),d&&a.push(...d)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!r&&!l)return At(n)&&i.set(n,Ko),Ko;if(Be(r))for(let u=0;un[0]==="_"||n==="$stable",rg=n=>Be(n)?n.map(ki):[ki(n)],NA=(n,e,t)=>{if(e._n)return e;const i=hb((...s)=>rg(e(...s)),t);return i._c=!1,i},Fb=(n,e,t)=>{const i=n._ctx;for(const s in n){if(Ub(s))continue;const r=n[s];if($e(r))e[s]=NA(s,r,i);else if(r!=null){const o=rg(r);e[s]=()=>o}}},Bb=(n,e)=>{const t=rg(e);n.slots.default=()=>t},kb=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},UA=(n,e,t)=>{const i=n.slots=Lb();if(n.vnode.shapeFlag&32){const s=e._;s?(kb(i,e,t),t&&Ox(i,"_",s,!0)):Fb(e,i)}else e&&Bb(n,e)},FA=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=pt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:kb(s,e,t):(r=!e.$stable,Fb(e,s)),o=e}else e&&(Bb(n,e),o={default:1});if(r)for(const a in s)!Ub(a)&&o[a]==null&&delete s[a]},wn=KA;function Vb(n){return BA(n)}function BA(n,e){const t=ah();t.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:f,nextSibling:h,setScopeId:d=zi,insertStaticContent:p}=n,_=(I,L,w,j=null,G=null,q=null,R=void 0,N=null,V=!!L.dynamicChildren)=>{if(I===L)return;I&&!Gr(I,L)&&(j=W(I),xe(I,G,q,!0),I=null),L.patchFlag===-2&&(V=!1,L.dynamicChildren=null);const{type:A,ref:C,shapeFlag:k}=L;switch(A){case oc:g(I,L,w,j);break;case Pn:m(I,L,w,j);break;case Vu:I==null&&y(L,w,j,R);break;case Xt:B(I,L,w,j,G,q,R,N,V);break;default:k&1?E(I,L,w,j,G,q,R,N,V):k&6?H(I,L,w,j,G,q,R,N,V):(k&64||k&128)&&A.process(I,L,w,j,G,q,R,N,V,le)}C!=null&&G&&rf(C,I&&I.ref,q,L||I,!L)},g=(I,L,w,j)=>{if(I==null)i(L.el=a(L.children),w,j);else{const G=L.el=I.el;L.children!==I.children&&c(G,L.children)}},m=(I,L,w,j)=>{I==null?i(L.el=l(L.children||""),w,j):L.el=I.el},y=(I,L,w,j)=>{[I.el,I.anchor]=p(I.children,L,w,j,I.el,I.anchor)},x=({el:I,anchor:L},w,j)=>{let G;for(;I&&I!==L;)G=h(I),i(I,w,j),I=G;i(L,w,j)},v=({el:I,anchor:L})=>{let w;for(;I&&I!==L;)w=h(I),s(I),I=w;s(L)},E=(I,L,w,j,G,q,R,N,V)=>{L.type==="svg"?R="svg":L.type==="math"&&(R="mathml"),I==null?T(L,w,j,G,q,R,N,V):b(I,L,G,q,R,N,V)},T=(I,L,w,j,G,q,R,N)=>{let V,A;const{props:C,shapeFlag:k,transition:U,dirs:z}=I;if(V=I.el=o(I.type,q,C&&C.is,C),k&8?u(V,I.children):k&16&&P(I.children,V,null,j,G,xd(I,q),R,N),z&&yr(I,null,j,"created"),M(V,I,I.scopeId,R,j),C){for(const he in C)he!=="value"&&!qa(he)&&r(V,he,null,C[he],q,j);"value"in C&&r(V,"value",null,C.value,q),(A=C.onVnodeBeforeMount)&&Oi(A,j,I)}z&&yr(I,null,j,"beforeMount");const Y=kA(G,U);Y&&U.beforeEnter(V),i(V,L,w),((A=C&&C.onVnodeMounted)||Y||z)&&wn(()=>{A&&Oi(A,j,I),Y&&U.enter(V),z&&yr(I,null,j,"mounted")},G)},M=(I,L,w,j,G)=>{if(w&&d(I,w),j)for(let q=0;q{for(let A=V;A{const N=L.el=I.el;let{patchFlag:V,dynamicChildren:A,dirs:C}=L;V|=I.patchFlag&16;const k=I.props||pt,U=L.props||pt;let z;if(w&&xr(w,!1),(z=U.onVnodeBeforeUpdate)&&Oi(z,w,L,I),C&&yr(L,I,w,"beforeUpdate"),w&&xr(w,!0),(k.innerHTML&&U.innerHTML==null||k.textContent&&U.textContent==null)&&u(N,""),A?S(I.dynamicChildren,A,N,w,j,xd(L,G),q):R||Q(I,L,N,null,w,j,xd(L,G),q,!1),V>0){if(V&16)D(N,k,U,w,G);else if(V&2&&k.class!==U.class&&r(N,"class",null,U.class,G),V&4&&r(N,"style",k.style,U.style,G),V&8){const Y=L.dynamicProps;for(let he=0;he{z&&Oi(z,w,L,I),C&&yr(L,I,w,"updated")},j)},S=(I,L,w,j,G,q,R)=>{for(let N=0;N{if(L!==w){if(L!==pt)for(const q in L)!qa(q)&&!(q in w)&&r(I,q,L[q],null,G,j);for(const q in w){if(qa(q))continue;const R=w[q],N=L[q];R!==N&&q!=="value"&&r(I,q,N,R,G,j)}"value"in w&&r(I,"value",L.value,w.value,G)}},B=(I,L,w,j,G,q,R,N,V)=>{const A=L.el=I?I.el:a(""),C=L.anchor=I?I.anchor:a("");let{patchFlag:k,dynamicChildren:U,slotScopeIds:z}=L;z&&(N=N?N.concat(z):z),I==null?(i(A,w,j),i(C,w,j),P(L.children||[],w,C,G,q,R,N,V)):k>0&&k&64&&U&&I.dynamicChildren?(S(I.dynamicChildren,U,w,G,q,R,N),(L.key!=null||G&&L===G.subTree)&&og(I,L,!0)):Q(I,L,w,C,G,q,R,N,V)},H=(I,L,w,j,G,q,R,N,V)=>{L.slotScopeIds=N,I==null?L.shapeFlag&512?G.ctx.activate(L,w,j,R,V):$(L,w,j,G,q,R,V):ee(I,L,V)},$=(I,L,w,j,G,q,R)=>{const N=I.component=r1(I,j,G);if(ph(I)&&(N.ctx.renderer=le),o1(N,!1,R),N.asyncDep){if(G&&G.registerDep(N,Z,R),!I.el){const V=N.subTree=an(Pn);m(null,V,L,w)}}else Z(N,I,L,w,G,q,R)},ee=(I,L,w)=>{const j=L.component=I.component;if(YA(I,L,w))if(j.asyncDep&&!j.asyncResolved){te(j,L,w);return}else j.next=L,j.update();else L.el=I.el,j.vnode=L},Z=(I,L,w,j,G,q,R)=>{const N=()=>{if(I.isMounted){let{next:k,bu:U,u:z,parent:Y,vnode:he}=I;{const Te=zb(I);if(Te){k&&(k.el=he.el,te(I,k,R)),Te.asyncDep.then(()=>{I.isUnmounted||N()});return}}let ce=k,ye;xr(I,!1),k?(k.el=he.el,te(I,k,R)):k=he,U&&Bu(U),(ye=k.props&&k.props.onVnodeBeforeUpdate)&&Oi(ye,Y,k,he),xr(I,!0);const Fe=Y_(I),me=I.subTree;I.subTree=Fe,_(me,Fe,f(me.el),W(me),I,G,q),k.el=Fe.el,ce===null&&jA(I,Fe.el),z&&wn(z,G),(ye=k.props&&k.props.onVnodeUpdated)&&wn(()=>Oi(ye,Y,k,he),G)}else{let k;const{el:U,props:z}=L,{bm:Y,m:he,parent:ce,root:ye,type:Fe}=I,me=Qo(L);xr(I,!1),Y&&Bu(Y),!me&&(k=z&&z.onVnodeBeforeMount)&&Oi(k,ce,L),xr(I,!0);{ye.ce&&ye.ce._injectChildStyle(Fe);const Te=I.subTree=Y_(I);_(null,Te,w,j,I,G,q),L.el=Te.el}if(he&&wn(he,G),!me&&(k=z&&z.onVnodeMounted)){const Te=L;wn(()=>Oi(k,ce,Te),G)}(L.shapeFlag&256||ce&&Qo(ce.vnode)&&ce.vnode.shapeFlag&256)&&I.a&&wn(I.a,G),I.isMounted=!0,L=w=j=null}};I.scope.on();const V=I.effect=new kx(N);I.scope.off();const A=I.update=V.run.bind(V),C=I.job=V.runIfDirty.bind(V);C.i=I,C.id=I.uid,V.scheduler=()=>tg(C),xr(I,!0),A()},te=(I,L,w)=>{L.component=I;const j=I.vnode.props;I.vnode=L,I.next=null,DA(I,L.props,j,w),FA(I,L.children,w),ar(),F_(I),lr()},Q=(I,L,w,j,G,q,R,N,V=!1)=>{const A=I&&I.children,C=I?I.shapeFlag:0,k=L.children,{patchFlag:U,shapeFlag:z}=L;if(U>0){if(U&128){ve(A,k,w,j,G,q,R,N,V);return}else if(U&256){pe(A,k,w,j,G,q,R,N,V);return}}z&8?(C&16&&be(A,G,q),k!==A&&u(w,k)):C&16?z&16?ve(A,k,w,j,G,q,R,N,V):be(A,G,q,!0):(C&8&&u(w,""),z&16&&P(k,w,j,G,q,R,N,V))},pe=(I,L,w,j,G,q,R,N,V)=>{I=I||Ko,L=L||Ko;const A=I.length,C=L.length,k=Math.min(A,C);let U;for(U=0;UC?be(I,G,q,!0,!1,k):P(L,w,j,G,q,R,N,V,k)},ve=(I,L,w,j,G,q,R,N,V)=>{let A=0;const C=L.length;let k=I.length-1,U=C-1;for(;A<=k&&A<=U;){const z=I[A],Y=L[A]=V?qs(L[A]):ki(L[A]);if(Gr(z,Y))_(z,Y,w,null,G,q,R,N,V);else break;A++}for(;A<=k&&A<=U;){const z=I[k],Y=L[U]=V?qs(L[U]):ki(L[U]);if(Gr(z,Y))_(z,Y,w,null,G,q,R,N,V);else break;k--,U--}if(A>k){if(A<=U){const z=U+1,Y=zU)for(;A<=k;)xe(I[A],G,q,!0),A++;else{const z=A,Y=A,he=new Map;for(A=Y;A<=U;A++){const Me=L[A]=V?qs(L[A]):ki(L[A]);Me.key!=null&&he.set(Me.key,A)}let ce,ye=0;const Fe=U-Y+1;let me=!1,Te=0;const ke=new Array(Fe);for(A=0;A=Fe){xe(Me,G,q,!0);continue}let qe;if(Me.key!=null)qe=he.get(Me.key);else for(ce=Y;ce<=U;ce++)if(ke[ce-Y]===0&&Gr(Me,L[ce])){qe=ce;break}qe===void 0?xe(Me,G,q,!0):(ke[qe-Y]=A+1,qe>=Te?Te=qe:me=!0,_(Me,L[qe],w,null,G,q,R,N,V),ye++)}const We=me?VA(ke):Ko;for(ce=We.length-1,A=Fe-1;A>=0;A--){const Me=Y+A,qe=L[Me],Je=Me+1{const{el:q,type:R,transition:N,children:V,shapeFlag:A}=I;if(A&6){se(I.component.subTree,L,w,j);return}if(A&128){I.suspense.move(L,w,j);return}if(A&64){R.move(I,L,w,le);return}if(R===Xt){i(q,L,w);for(let k=0;kN.enter(q),G);else{const{leave:k,delayLeave:U,afterLeave:z}=N,Y=()=>i(q,L,w),he=()=>{k(q,()=>{Y(),z&&z()})};U?U(q,Y,he):he()}else i(q,L,w)},xe=(I,L,w,j=!1,G=!1)=>{const{type:q,props:R,ref:N,children:V,dynamicChildren:A,shapeFlag:C,patchFlag:k,dirs:U,cacheIndex:z}=I;if(k===-2&&(G=!1),N!=null&&rf(N,null,w,I,!0),z!=null&&(L.renderCache[z]=void 0),C&256){L.ctx.deactivate(I);return}const Y=C&1&&U,he=!Qo(I);let ce;if(he&&(ce=R&&R.onVnodeBeforeUnmount)&&Oi(ce,L,I),C&6)ge(I.component,w,j);else{if(C&128){I.suspense.unmount(w,j);return}Y&&yr(I,null,L,"beforeUnmount"),C&64?I.type.remove(I,L,w,le,j):A&&!A.hasOnce&&(q!==Xt||k>0&&k&64)?be(A,L,w,!1,!0):(q===Xt&&k&384||!G&&C&16)&&be(V,L,w),j&&ze(I)}(he&&(ce=R&&R.onVnodeUnmounted)||Y)&&wn(()=>{ce&&Oi(ce,L,I),Y&&yr(I,null,L,"unmounted")},w)},ze=I=>{const{type:L,el:w,anchor:j,transition:G}=I;if(L===Xt){re(w,j);return}if(L===Vu){v(I);return}const q=()=>{s(w),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(I.shapeFlag&1&&G&&!G.persisted){const{leave:R,delayLeave:N}=G,V=()=>R(w,q);N?N(I.el,q,V):V()}else q()},re=(I,L)=>{let w;for(;I!==L;)w=h(I),s(I),I=w;s(L)},ge=(I,L,w)=>{const{bum:j,scope:G,job:q,subTree:R,um:N,m:V,a:A}=I;q_(V),q_(A),j&&Bu(j),G.stop(),q&&(q.flags|=8,xe(R,I,L,w)),N&&wn(N,L),wn(()=>{I.isUnmounted=!0},L),L&&L.pendingBranch&&!L.isUnmounted&&I.asyncDep&&!I.asyncResolved&&I.suspenseId===L.pendingId&&(L.deps--,L.deps===0&&L.resolve())},be=(I,L,w,j=!1,G=!1,q=0)=>{for(let R=q;R{if(I.shapeFlag&6)return W(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const L=h(I.anchor||I.el),w=L&&L[db];return w?h(w):L};let ae=!1;const ue=(I,L,w)=>{I==null?L._vnode&&xe(L._vnode,null,null,!0):_(L._vnode||null,I,L,null,null,null,w),L._vnode=I,ae||(ae=!0,F_(),cb(),ae=!1)},le={p:_,um:xe,m:se,r:ze,mt:$,mc:P,pc:Q,pbc:S,n:W,o:n};return{render:ue,hydrate:void 0,createApp:IA(ue)}}function xd({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function xr({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function kA(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function og(n,e,t=!1){const i=n.children,s=e.children;if(Be(i)&&Be(s))for(let r=0;r>1,n[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function zb(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:zb(e)}function q_(n){if(n)for(let e=0;egn(zA);function sc(n,e){return rc(n,null,e)}function z4(n,e){return rc(n,null,{flush:"post"})}function GA(n,e){return rc(n,null,{flush:"sync"})}function Ge(n,e,t){return rc(n,e,t)}function rc(n,e,t=pt){const{immediate:i,deep:s,flush:r,once:o}=t,a=Zt({},t),l=e&&i||!e&&r!=="post";let c;if(wl){if(r==="sync"){const d=HA();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=zi,d.resume=zi,d.pause=zi,d}}const u=tn;a.call=(d,p,_)=>Ci(d,u,p,_);let f=!1;r==="post"?a.scheduler=d=>{wn(d,u&&u.suspense)}:r!=="sync"&&(f=!0,a.scheduler=(d,p)=>{p?d():tg(d)}),a.augmentJob=d=>{e&&(d.flags|=4),f&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const h=nA(n,e,a);return wl&&(c?c.push(h):l&&h()),h}function WA(n,e,t){const i=this.proxy,s=Lt(n)?n.includes(".")?Hb(i,n):()=>i[n]:n.bind(i,i);let r;$e(e)?r=e:(r=e.handler,t=e);const o=ac(this),a=rc(s,r.bind(i),t);return o(),a}function Hb(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{let u,f=pt,h;return GA(()=>{const d=n[s];Vn(u,d)&&(u=d,c())}),{get(){return l(),t.get?t.get(u):u},set(d){const p=t.set?t.set(d):d;if(!Vn(p,u)&&!(f!==pt&&Vn(d,f)))return;const _=i.vnode.props;_&&(e in _||s in _||r in _)&&(`onUpdate:${e}`in _||`onUpdate:${s}`in _||`onUpdate:${r}`in _)||(u=d,c()),i.emit(`update:${e}`,p),Vn(d,p)&&Vn(d,f)&&!Vn(p,h)&&c(),f=d,h=p}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||pt:a,done:!1}:{done:!0}}}},a}const Gb=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${Qn(e)}Modifiers`]||n[`${As(e)}Modifiers`];function XA(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||pt;let s=t;const r=e.startsWith("update:"),o=r&&Gb(i,e.slice(7));o&&(o.trim&&(s=t.map(u=>Lt(u)?u.trim():u)),o.number&&(s=t.map(Qu)));let a,l=i[a=Fu(e)]||i[a=Fu(Qn(e))];!l&&r&&(l=i[a=Fu(As(e))]),l&&Ci(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,Ci(c,n,6,s)}}function Wb(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!$e(n)){const l=c=>{const u=Wb(c,e,!0);u&&(a=!0,Zt(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(At(n)&&i.set(n,null),null):(Be(r)?r.forEach(l=>o[l]=null):Zt(o,r),At(n)&&i.set(n,o),o)}function gh(n,e){return!n||!sh(e)?!1:(e=e.slice(2).replace(/Once$/,""),xt(n,e[0].toLowerCase()+e.slice(1))||xt(n,As(e))||xt(n,e))}function Y_(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:f,data:h,setupState:d,ctx:p,inheritAttrs:_}=n,g=sf(n);let m,y;try{if(t.shapeFlag&4){const v=s||i,E=v;m=ki(c.call(E,v,u,f,d,h,p)),y=a}else{const v=e;m=ki(v.length>1?v(f,{attrs:a,slots:o,emit:l}):v(f,null)),y=e.props?a:$A(a)}}catch(v){Ja.length=0,dh(v,n,1),m=an(Pn)}let x=m;if(y&&_!==!1){const v=Object.keys(y),{shapeFlag:E}=x;v.length&&E&7&&(r&&v.some(Gm)&&(y=qA(y,r)),x=tr(x,y,!1,!0))}return t.dirs&&(x=tr(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(t.dirs):t.dirs),t.transition&&bl(x,t.transition),m=x,sf(g),m}const $A=n=>{let e;for(const t in n)(t==="class"||t==="style"||sh(t))&&((e||(e={}))[t]=n[t]);return e},qA=(n,e)=>{const t={};for(const i in n)(!Gm(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function YA(n,e,t){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?j_(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let f=0;fn.__isSuspense;function KA(n,e){e&&e.pendingBranch?Be(n)?e.effects.push(...n):e.effects.push(n):rA(n)}const Xt=Symbol.for("v-fgt"),oc=Symbol.for("v-txt"),Pn=Symbol.for("v-cmt"),Vu=Symbol.for("v-stc"),Ja=[];let Kn=null;function ln(n=!1){Ja.push(Kn=n?null:[])}function ZA(){Ja.pop(),Kn=Ja[Ja.length-1]||null}let Ml=1;function K_(n,e=!1){Ml+=n,n<0&&Kn&&e&&(Kn.hasOnce=!0)}function $b(n){return n.dynamicChildren=Ml>0?Kn||Ko:null,ZA(),Ml>0&&Kn&&Kn.push(n),n}function ui(n,e,t,i,s,r){return $b($s(n,e,t,i,s,r,!0))}function El(n,e,t,i,s){return $b(an(n,e,t,i,s,!0))}function Tl(n){return n?n.__v_isVNode===!0:!1}function Gr(n,e){return n.type===e.type&&n.key===e.key}const qb=({key:n})=>n??null,zu=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Lt(n)||wt(n)||$e(n)?{i:Yt,r:n,k:e,f:!!t}:n:null);function $s(n,e=null,t=null,i=0,s=null,r=n===Xt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&qb(e),ref:e&&zu(e),scopeId:fb,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Yt};return a?(ag(l,t),r&128&&n.normalize(l)):t&&(l.shapeFlag|=Lt(t)?8:16),Ml>0&&!o&&Kn&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&Kn.push(l),l}const an=JA;function JA(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===Tb)&&(n=Pn),Tl(n)){const a=tr(n,e,!0);return t&&ag(a,t),Ml>0&&!r&&Kn&&(a.shapeFlag&6?Kn[Kn.indexOf(n)]=a:Kn.push(a)),a.patchFlag=-2,a}if(u1(n)&&(n=n.__vccOpts),e){e=QA(e);let{class:a,style:l}=e;a&&!Lt(a)&&(e.class=ga(a)),At(l)&&(Jm(l)&&!Be(l)&&(l=Zt({},l)),e.style=mi(l))}const o=Lt(n)?1:Xb(n)?128:pb(n)?64:At(n)?4:$e(n)?2:0;return $s(n,e,t,i,s,o,r,!0)}function QA(n){return n?Jm(n)||Db(n)?Zt({},n):n:null}function tr(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=e?n1(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&qb(c),ref:e&&e.ref?t&&r?Be(r)?r.concat(zu(e)):[r,zu(e)]:zu(e):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Xt?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&tr(n.ssContent),ssFallback:n.ssFallback&&tr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&bl(u,l.clone(u)),u}function e1(n=" ",e=0){return an(oc,null,n,e)}function t1(n,e){const t=an(Vu,null,n);return t.staticCount=e,t}function Z_(n="",e=!1){return e?(ln(),El(Pn,null,n)):an(Pn,null,n)}function ki(n){return n==null||typeof n=="boolean"?an(Pn):Be(n)?an(Xt,null,n.slice()):Tl(n)?qs(n):an(oc,null,String(n))}function qs(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:tr(n)}function ag(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Be(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),ag(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!Db(e)?e._ctx=Yt:s===3&&Yt&&(Yt.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else $e(e)?(e={default:e,_ctx:Yt},t=32):(e=String(e),i&64?(t=16,e=[e1(e)]):t=8);n.children=e,n.shapeFlag|=t}function n1(...n){const e={};for(let t=0;ttn||Yt;let af,Hp;{const n=ah(),e=(t,i)=>{let s;return(s=n[t])||(s=n[t]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};af=e("__VUE_INSTANCE_SETTERS__",t=>tn=t),Hp=e("__VUE_SSR_SETTERS__",t=>wl=t)}const ac=n=>{const e=tn;return af(n),n.scope.on(),()=>{n.scope.off(),af(e)}},J_=()=>{tn&&tn.scope.off(),af(null)};function Yb(n){return n.vnode.shapeFlag&4}let wl=!1;function o1(n,e=!1,t=!1){e&&Hp(e);const{props:i,children:s}=n.vnode,r=Yb(n);LA(n,i,r,e),UA(n,s,t);const o=r?a1(n,e):void 0;return e&&Hp(!1),o}function a1(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,EA);const{setup:i}=t;if(i){ar();const s=n.setupContext=i.length>1?Kb(n):null,r=ac(n),o=nc(i,n,0,[n.props,s]),a=Ix(o);if(lr(),r(),(a||n.sp)&&!Qo(n)&&Sb(n),a){if(o.then(J_,J_),e)return o.then(l=>{Q_(n,l)}).catch(l=>{dh(l,n,0)});n.asyncDep=o}else Q_(n,o)}else jb(n)}function Q_(n,e,t){$e(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:At(e)&&(n.setupState=ib(e)),jb(n)}function jb(n,e,t){const i=n.type;n.render||(n.render=i.render||zi);{const s=ac(n);ar();try{TA(n)}finally{lr(),s()}}}const l1={get(n,e){return pn(n,"get",""),n[e]}};function Kb(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,l1),slots:n.slots,emit:n.emit,expose:e}}function _h(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(ib(Qm(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Za)return Za[t](n)},has(e,t){return t in e||t in Za}})):n.proxy}function c1(n,e=!0){return $e(n)?n.displayName||n.name:n.name||e&&n.__name}function u1(n){return $e(n)&&"__vccOpts"in n}const Se=(n,e)=>eA(n,e,wl);function Ss(n,e,t){const i=arguments.length;return i===2?At(e)&&!Be(e)?Tl(e)?an(n,null,[e]):an(n,e):an(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Tl(t)&&(t=[t]),an(n,e,t))}const f1="3.5.13";/** * @vue/runtime-dom v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let Gp;const ev=typeof window<"u"&&window.trustedTypes;if(ev)try{Gp=ev.createPolicy("vue",{createHTML:n=>n})}catch{}const Zb=Gp?n=>Gp.createHTML(n):n=>n,h1="http://www.w3.org/2000/svg",d1="http://www.w3.org/1998/Math/MathML",lr=typeof document<"u"?document:null,tv=lr&&lr.createElement("template"),p1={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const r=e==="svg"?lr.createElementNS(h1,n):e==="mathml"?lr.createElementNS(d1,n):t?lr.createElement(n,{is:t}):lr.createElement(n);return n==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:n=>lr.createTextNode(n),createComment:n=>lr.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>lr.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,r,s){const o=t?t.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),t),!(r===s||!(r=r.nextSibling)););else{tv.innerHTML=Zb(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=tv.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Lr="transition",wa="animation",Al=Symbol("_vtc"),Jb={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},m1=Zt({},_b,Jb),g1=n=>(n.displayName="Transition",n.props=m1,n),G4=g1((n,{slots:e})=>Sr(cA,_1(n),e)),bs=(n,e=[])=>{Be(n)?n.forEach(t=>t(...e)):n&&n(...e)},nv=n=>n?Be(n)?n.some(e=>e.length>1):n.length>1:!1;function _1(n){const e={};for(const B in n)B in Jb||(e[B]=n[B]);if(n.css===!1)return e;const{name:t="v",type:i,duration:r,enterFromClass:s=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=s,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:f=`${t}-leave-from`,leaveActiveClass:h=`${t}-leave-active`,leaveToClass:d=`${t}-leave-to`}=n,p=v1(r),_=p&&p[0],g=p&&p[1],{onBeforeEnter:m,onEnter:y,onEnterCancelled:x,onLeave:v,onLeaveCancelled:E,onBeforeAppear:T=m,onAppear:M=y,onAppearCancelled:P=x}=e,b=(B,H,$,ee)=>{B._enterCancelled=ee,Ss(B,H?u:a),Ss(B,H?c:o),$&&$()},S=(B,H)=>{B._isLeaving=!1,Ss(B,f),Ss(B,d),Ss(B,h),H&&H()},D=B=>(H,$)=>{const ee=B?M:y,Z=()=>b(H,B,$);bs(ee,[H,Z]),iv(()=>{Ss(H,B?l:s),Qi(H,B?u:a),nv(ee)||rv(H,i,_,Z)})};return Zt(e,{onBeforeEnter(B){bs(m,[B]),Qi(B,s),Qi(B,o)},onBeforeAppear(B){bs(T,[B]),Qi(B,l),Qi(B,c)},onEnter:D(!1),onAppear:D(!0),onLeave(B,H){B._isLeaving=!0;const $=()=>S(B,H);Qi(B,f),B._enterCancelled?(Qi(B,h),av()):(av(),Qi(B,h)),iv(()=>{B._isLeaving&&(Ss(B,f),Qi(B,d),nv(v)||rv(B,i,g,$))}),bs(v,[B,$])},onEnterCancelled(B){b(B,!1,void 0,!0),bs(x,[B])},onAppearCancelled(B){b(B,!0,void 0,!0),bs(P,[B])},onLeaveCancelled(B){S(B),bs(E,[B])}})}function v1(n){if(n==null)return null;if(At(n))return[bd(n.enter),bd(n.leave)];{const e=bd(n);return[e,e]}}function bd(n){return xw(n)}function Qi(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Al]||(n[Al]=new Set)).add(e)}function Ss(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[Al];t&&(t.delete(e),t.size||(n[Al]=void 0))}function iv(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let y1=0;function rv(n,e,t,i){const r=n._endId=++y1,s=()=>{r===n._endId&&i()};if(t!=null)return setTimeout(s,t);const{type:o,timeout:a,propCount:l}=x1(n,e);if(!o)return i();const c=o+"end";let u=0;const f=()=>{n.removeEventListener(c,h),s()},h=d=>{d.target===n&&++u>=l&&f()};setTimeout(()=>{u(t[p]||"").split(", "),r=i(`${Lr}Delay`),s=i(`${Lr}Duration`),o=sv(r,s),a=i(`${wa}Delay`),l=i(`${wa}Duration`),c=sv(a,l);let u=null,f=0,h=0;e===Lr?o>0&&(u=Lr,f=o,h=s.length):e===wa?c>0&&(u=wa,f=c,h=l.length):(f=Math.max(o,c),u=f>0?o>c?Lr:wa:null,h=u?u===Lr?s.length:l.length:0);const d=u===Lr&&/\b(transform|all)(,|$)/.test(i(`${Lr}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:d}}function sv(n,e){for(;n.lengthov(t)+ov(n[i])))}function ov(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function av(){return document.body.offsetHeight}function b1(n,e,t){const i=n[Al];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const lv=Symbol("_vod"),S1=Symbol("_vsh"),M1=Symbol(""),E1=/(^|;)\s*display\s*:/;function T1(n,e,t){const i=n.style,r=Lt(t);let s=!1;if(t&&!r){if(e)if(Lt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Hu(i,a,"")}else for(const o in e)t[o]==null&&Hu(i,o,"");for(const o in t)o==="display"&&(s=!0),Hu(i,o,t[o])}else if(r){if(e!==t){const o=i[M1];o&&(t+=";"+o),i.cssText=t,s=E1.test(t)}}else e&&n.removeAttribute("style");lv in n&&(n[lv]=s?i.display:"",n[S1]&&(i.display="none"))}const cv=/\s*!important$/;function Hu(n,e,t){if(Be(t))t.forEach(i=>Hu(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=w1(n,e);cv.test(t)?n.setProperty(Ar(i),t.replace(cv,""),"important"):n[i]=t}}const uv=["Webkit","Moz","ms"],Sd={};function w1(n,e){const t=Sd[e];if(t)return t;let i=Qn(e);if(i!=="filter"&&i in n)return Sd[e]=i;i=oh(i);for(let r=0;rMd||(P1.then(()=>Md=0),Md=Date.now());function L1(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Ci(D1(i,t.value),e,5,[i])};return t.value=n,t.attached=I1(),t}function D1(n,e){if(Be(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const gv=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,O1=(n,e,t,i,r,s)=>{const o=r==="svg";e==="class"?b1(n,i,o):e==="style"?T1(n,t,i):rh(e)?Gm(e)||C1(n,e,t,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):N1(n,e,i,o))?(dv(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&hv(n,e,i,o,s,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Lt(i))?dv(n,Qn(e),i,s,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),hv(n,e,i,o))};function N1(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&gv(e)&&$e(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=n.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return gv(e)&&Lt(t)?!1:e in n}const ns=n=>{const e=n.props["onUpdate:modelValue"]||!1;return Be(e)?t=>Bu(e,t):e};function U1(n){n.target.composing=!0}function _v(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const fi=Symbol("_assign"),vv={created(n,{modifiers:{lazy:e,trim:t,number:i}},r){n[fi]=ns(r);const s=i||r.props&&r.props.type==="number";fr(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),s&&(a=Qu(a)),n[fi](a)}),t&&fr(n,"change",()=>{n.value=n.value.trim()}),e||(fr(n,"compositionstart",U1),fr(n,"compositionend",_v),fr(n,"change",_v))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:r,number:s}},o){if(n[fi]=ns(o),n.composing)return;const a=(s||n.type==="number")&&!/^0\d/.test(n.value)?Qu(n.value):n.value,l=e??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||r&&n.value.trim()===l)||(n.value=l))}},F1={deep:!0,created(n,e,t){n[fi]=ns(t),fr(n,"change",()=>{const i=n._modelValue,r=na(n),s=n.checked,o=n[fi];if(Be(i)){const a=$m(i,r),l=a!==-1;if(s&&!l)o(i.concat(r));else if(!s&&l){const c=[...i];c.splice(a,1),o(c)}}else if(ma(i)){const a=new Set(i);s?a.add(r):a.delete(r),o(a)}else o(Qb(n,s))})},mounted:yv,beforeUpdate(n,e,t){n[fi]=ns(t),yv(n,e,t)}};function yv(n,{value:e,oldValue:t},i){n._modelValue=e;let r;if(Be(e))r=$m(e,i.props.value)>-1;else if(ma(e))r=e.has(i.props.value);else{if(e===t)return;r=io(e,Qb(n,!0))}n.checked!==r&&(n.checked=r)}const B1={created(n,{value:e},t){n.checked=io(e,t.props.value),n[fi]=ns(t),fr(n,"change",()=>{n[fi](na(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[fi]=ns(i),e!==t&&(n.checked=io(e,i.props.value))}},k1={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const r=ma(e);fr(n,"change",()=>{const s=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?Qu(na(o)):na(o));n[fi](n.multiple?r?new Set(s):s:s[0]),n._assigning=!0,cs(()=>{n._assigning=!1})}),n[fi]=ns(i)},mounted(n,{value:e}){xv(n,e)},beforeUpdate(n,e,t){n[fi]=ns(t)},updated(n,{value:e}){n._assigning||xv(n,e)}};function xv(n,e){const t=n.multiple,i=Be(e);if(!(t&&!i&&!ma(e))){for(let r=0,s=n.options.length;rString(c)===String(a)):o.selected=$m(e,a)>-1}else o.selected=e.has(a);else if(io(na(o),e)){n.selectedIndex!==r&&(n.selectedIndex=r);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function na(n){return"_value"in n?n._value:n.value}function Qb(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const W4={created(n,e,t){Dc(n,e,t,null,"created")},mounted(n,e,t){Dc(n,e,t,null,"mounted")},beforeUpdate(n,e,t,i){Dc(n,e,t,i,"beforeUpdate")},updated(n,e,t,i){Dc(n,e,t,i,"updated")}};function V1(n,e){switch(n){case"SELECT":return k1;case"TEXTAREA":return vv;default:switch(e){case"checkbox":return F1;case"radio":return B1;default:return vv}}}function Dc(n,e,t,i,r){const o=V1(n.tagName,t.props&&t.props.type)[r];o&&o(n,e,t,i)}const z1=["ctrl","shift","alt","meta"],H1={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>z1.some(t=>n[`${t}Key`]&&!e.includes(t))},X4=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(r,...s)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=r=>{if(!("key"in r))return;const s=Ar(r.key);if(e.some(o=>o===s||G1[o]===s))return n(r)})},W1=Zt({patchProp:O1},p1);let bv;function eS(){return bv||(bv=Vb(W1))}const q4=(...n)=>{eS().render(...n)},X1=(...n)=>{const e=eS().createApp(...n),{mount:t}=e;return e.mount=i=>{const r=q1(i);if(!r)return;const s=e._component;!$e(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=t(r,!1,$1(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e};function $1(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function q1(n){return Lt(n)?document.querySelector(n):n}const tS=new Set,Gn=new WeakMap,ia=new WeakMap,so=new WeakMap,Wp=new WeakMap,Y1=new WeakMap,ra=new WeakMap,lf=new WeakMap,Wa=new WeakSet;let is,lg=0,cg=0;const pr="__aa_tgt",Cl="__aa_del",cf="__aa_new",j1=n=>{const e=tC(n);e&&e.forEach(t=>nC(t))},K1=n=>{n.forEach(e=>{e.target===is&&J1(),Gn.has(e.target)&&po(e.target)})};function Z1(n){const e=Wp.get(n);e==null||e.disconnect();let t=Gn.get(n),i=0;const r=5;t||(t=sa(n),Gn.set(n,t));const{offsetWidth:s,offsetHeight:o}=is,l=[t.top-r,s-(t.left+r+t.width),o-(t.top+r+t.height),t.left-r].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++i>1&&po(n)},{root:is,threshold:1,rootMargin:l});c.observe(n),Wp.set(n,c)}function po(n){clearTimeout(lf.get(n));const e=vh(n),t=Rl(e)?500:e.duration;lf.set(n,setTimeout(async()=>{const i=so.get(n);try{await(i==null?void 0:i.finished),Gn.set(n,sa(n)),Z1(n)}catch{}},t))}function J1(){clearTimeout(lf.get(is)),lf.set(is,setTimeout(()=>{tS.forEach(n=>sS(n,e=>nS(()=>po(e))))},100))}function Q1(n){setTimeout(()=>{Y1.set(n,setInterval(()=>nS(po.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function nS(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let Xp,Wo;const eC=typeof window<"u"&&"ResizeObserver"in window;eC&&(is=document.documentElement,Xp=new MutationObserver(j1),Wo=new ResizeObserver(K1),window.addEventListener("scroll",()=>{cg=window.scrollY,lg=window.scrollX}),Wo.observe(is));function tC(n){return n.reduce((i,r)=>[...i,...Array.from(r.addedNodes),...Array.from(r.removedNodes)],[]).every(i=>i.nodeName==="#comment")?!1:n.reduce((i,r)=>{if(i===!1)return!1;if(r.target instanceof Element){if(Ed(r.target),!i.has(r.target)){i.add(r.target);for(let s=0;st(n,ra.has(n)));for(let t=0;tr(i,ra.has(i)))}}function fg(n){return Array.isArray(n)?n:[n]}function Rl(n){return typeof n=="function"}function rC(n){const e=Gn.get(n),t=sa(n);if(!ug(n))return Gn.set(n,t);let i;if(!e)return;const r=vh(n);if(typeof r!="function"){const s=e.left-t.left,o=e.top-t.top,[a,l,c,u]=iS(n,e,t),f={transform:`translate(${s}px, ${o}px)`},h={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,h.width=`${l}px`),c!==u&&(f.height=`${c}px`,h.height=`${u}px`),i=n.animate([f,h],{duration:r.duration,easing:r.easing})}else{const[s]=fg(r(n,"remain",e,t));i=new Animation(s),i.play()}so.set(n,i),Gn.set(n,t),i.addEventListener("finish",po.bind(null,n))}function Sv(n){cf in n&&delete n[cf];const e=sa(n);Gn.set(n,e);const t=vh(n);if(!ug(n))return;let i;if(typeof t!="function")i=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:t.duration*1.5,easing:"ease-in"});else{const[r]=fg(t(n,"add",e));i=new Animation(r),i.play()}so.set(n,i),i.addEventListener("finish",po.bind(null,n))}function Mv(n,e){var t;n.remove(),Gn.delete(n),ia.delete(n),so.delete(n),(t=Wp.get(n))===null||t===void 0||t.disconnect(),setTimeout(()=>{if(Cl in n&&delete n[Cl],Object.defineProperty(n,cf,{value:!0,configurable:!0}),e&&n instanceof HTMLElement)for(const i in e)n.style[i]=""},0)}function sC(n){var e;if(!ia.has(n)||!Gn.has(n))return;const[t,i]=ia.get(n);Object.defineProperty(n,Cl,{value:!0,configurable:!0});const r=window.scrollX,s=window.scrollY;if(i&&i.parentNode&&i.parentNode instanceof Element?i.parentNode.insertBefore(n,i):t&&t.parentNode?t.parentNode.appendChild(n):(e=rS(n))===null||e===void 0||e.appendChild(n),!ug(n))return Mv(n);const[o,a,l,c]=aC(n),u=vh(n),f=Gn.get(n);(r!==lg||s!==cg)&&oC(n,r,s,u);let h,d={position:"absolute",top:`${o}px`,left:`${a}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Rl(u))Object.assign(n.style,d),h=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:u.duration,easing:"ease-out"});else{const[p,_]=fg(u(n,"remove",f));(_==null?void 0:_.styleReset)!==!1&&(d=(_==null?void 0:_.styleReset)||d,Object.assign(n.style,d)),h=new Animation(p),h.play()}so.set(n,h),h.addEventListener("finish",Mv.bind(null,n,d))}function oC(n,e,t,i){const r=lg-e,s=cg-t,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(is).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+r,window.scrollY+s),!n.parentElement)return;const l=n.parentElement;let c=l.clientHeight,u=l.clientWidth;const f=performance.now();function h(){requestAnimationFrame(()=>{if(!Rl(i)){const d=c-l.clientHeight,p=u-l.clientWidth;f+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-d}),c=l.clientHeight,u=l.clientWidth,h()):document.documentElement.style.scrollBehavior=o}})}h()}function aC(n){const e=Gn.get(n),[t,,i]=iS(n,e,sa(n));let r=n.parentElement;for(;r&&(getComputedStyle(r).position==="static"||r instanceof HTMLBodyElement);)r=r.parentElement;r||(r=document.body);const s=getComputedStyle(r),o=Gn.get(r)||sa(r),a=Math.round(e.top-o.top)-Fi(s.borderTopWidth),l=Math.round(e.left-o.left)-Fi(s.borderLeftWidth);return[a,l,t,i]}function lC(n,e={}){return Xp&&Wo&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Rl(e)&&!e.disrespectUserMotionPreference||(Wa.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),sS(n,po,Q1,r=>Wo==null?void 0:Wo.observe(r)),Rl(e)?ra.set(n,e):ra.set(n,{duration:250,easing:"ease-in-out",...e}),Xp.observe(n,{childList:!0}),tS.add(n))),Object.freeze({parent:n,enable:()=>{Wa.add(n)},disable:()=>{Wa.delete(n)},isEnabled:()=>Wa.has(n)})}const cC={mounted:(n,e)=>{lC(n,e.value||{})},getSSRProps:()=>({})},uC=cC,fC={install(n){n.directive("auto-animate",uC)}};/** +**/let Gp;const e0=typeof window<"u"&&window.trustedTypes;if(e0)try{Gp=e0.createPolicy("vue",{createHTML:n=>n})}catch{}const Zb=Gp?n=>Gp.createHTML(n):n=>n,h1="http://www.w3.org/2000/svg",d1="http://www.w3.org/1998/Math/MathML",ls=typeof document<"u"?document:null,t0=ls&&ls.createElement("template"),p1={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e==="svg"?ls.createElementNS(h1,n):e==="mathml"?ls.createElementNS(d1,n):t?ls.createElement(n,{is:t}):ls.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>ls.createTextNode(n),createComment:n=>ls.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>ls.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,r){const o=t?t.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===r||!(s=s.nextSibling)););else{t0.innerHTML=Zb(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=t0.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Ls="transition",wa="animation",Al=Symbol("_vtc"),Jb={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},m1=Zt({},_b,Jb),g1=n=>(n.displayName="Transition",n.props=m1,n),G4=g1((n,{slots:e})=>Ss(cA,_1(n),e)),br=(n,e=[])=>{Be(n)?n.forEach(t=>t(...e)):n&&n(...e)},n0=n=>n?Be(n)?n.some(e=>e.length>1):n.length>1:!1;function _1(n){const e={};for(const B in n)B in Jb||(e[B]=n[B]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:f=`${t}-leave-from`,leaveActiveClass:h=`${t}-leave-active`,leaveToClass:d=`${t}-leave-to`}=n,p=v1(s),_=p&&p[0],g=p&&p[1],{onBeforeEnter:m,onEnter:y,onEnterCancelled:x,onLeave:v,onLeaveCancelled:E,onBeforeAppear:T=m,onAppear:M=y,onAppearCancelled:P=x}=e,b=(B,H,$,ee)=>{B._enterCancelled=ee,Sr(B,H?u:a),Sr(B,H?c:o),$&&$()},S=(B,H)=>{B._isLeaving=!1,Sr(B,f),Sr(B,d),Sr(B,h),H&&H()},D=B=>(H,$)=>{const ee=B?M:y,Z=()=>b(H,B,$);br(ee,[H,Z]),i0(()=>{Sr(H,B?l:r),Qi(H,B?u:a),n0(ee)||s0(H,i,_,Z)})};return Zt(e,{onBeforeEnter(B){br(m,[B]),Qi(B,r),Qi(B,o)},onBeforeAppear(B){br(T,[B]),Qi(B,l),Qi(B,c)},onEnter:D(!1),onAppear:D(!0),onLeave(B,H){B._isLeaving=!0;const $=()=>S(B,H);Qi(B,f),B._enterCancelled?(Qi(B,h),a0()):(a0(),Qi(B,h)),i0(()=>{B._isLeaving&&(Sr(B,f),Qi(B,d),n0(v)||s0(B,i,g,$))}),br(v,[B,$])},onEnterCancelled(B){b(B,!1,void 0,!0),br(x,[B])},onAppearCancelled(B){b(B,!0,void 0,!0),br(P,[B])},onLeaveCancelled(B){S(B),br(E,[B])}})}function v1(n){if(n==null)return null;if(At(n))return[bd(n.enter),bd(n.leave)];{const e=bd(n);return[e,e]}}function bd(n){return xw(n)}function Qi(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Al]||(n[Al]=new Set)).add(e)}function Sr(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[Al];t&&(t.delete(e),t.size||(n[Al]=void 0))}function i0(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let y1=0;function s0(n,e,t,i){const s=n._endId=++y1,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=x1(n,e);if(!o)return i();const c=o+"end";let u=0;const f=()=>{n.removeEventListener(c,h),r()},h=d=>{d.target===n&&++u>=l&&f()};setTimeout(()=>{u(t[p]||"").split(", "),s=i(`${Ls}Delay`),r=i(`${Ls}Duration`),o=r0(s,r),a=i(`${wa}Delay`),l=i(`${wa}Duration`),c=r0(a,l);let u=null,f=0,h=0;e===Ls?o>0&&(u=Ls,f=o,h=r.length):e===wa?c>0&&(u=wa,f=c,h=l.length):(f=Math.max(o,c),u=f>0?o>c?Ls:wa:null,h=u?u===Ls?r.length:l.length:0);const d=u===Ls&&/\b(transform|all)(,|$)/.test(i(`${Ls}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:d}}function r0(n,e){for(;n.lengtho0(t)+o0(n[i])))}function o0(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function a0(){return document.body.offsetHeight}function b1(n,e,t){const i=n[Al];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const l0=Symbol("_vod"),S1=Symbol("_vsh"),M1=Symbol(""),E1=/(^|;)\s*display\s*:/;function T1(n,e,t){const i=n.style,s=Lt(t);let r=!1;if(t&&!s){if(e)if(Lt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Hu(i,a,"")}else for(const o in e)t[o]==null&&Hu(i,o,"");for(const o in t)o==="display"&&(r=!0),Hu(i,o,t[o])}else if(s){if(e!==t){const o=i[M1];o&&(t+=";"+o),i.cssText=t,r=E1.test(t)}}else e&&n.removeAttribute("style");l0 in n&&(n[l0]=r?i.display:"",n[S1]&&(i.display="none"))}const c0=/\s*!important$/;function Hu(n,e,t){if(Be(t))t.forEach(i=>Hu(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=w1(n,e);c0.test(t)?n.setProperty(As(i),t.replace(c0,""),"important"):n[i]=t}}const u0=["Webkit","Moz","ms"],Sd={};function w1(n,e){const t=Sd[e];if(t)return t;let i=Qn(e);if(i!=="filter"&&i in n)return Sd[e]=i;i=oh(i);for(let s=0;sMd||(P1.then(()=>Md=0),Md=Date.now());function L1(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Ci(D1(i,t.value),e,5,[i])};return t.value=n,t.attached=I1(),t}function D1(n,e){if(Be(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const g0=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,O1=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?b1(n,i,o):e==="style"?T1(n,t,i):sh(e)?Gm(e)||C1(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):N1(n,e,i,o))?(d0(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&h0(n,e,i,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Lt(i))?d0(n,Qn(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),h0(n,e,i,o))};function N1(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&g0(e)&&$e(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return g0(e)&&Lt(t)?!1:e in n}const nr=n=>{const e=n.props["onUpdate:modelValue"]||!1;return Be(e)?t=>Bu(e,t):e};function U1(n){n.target.composing=!0}function _0(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const fi=Symbol("_assign"),v0={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n[fi]=nr(s);const r=i||s.props&&s.props.type==="number";fs(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=Qu(a)),n[fi](a)}),t&&fs(n,"change",()=>{n.value=n.value.trim()}),e||(fs(n,"compositionstart",U1),fs(n,"compositionend",_0),fs(n,"change",_0))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:r}},o){if(n[fi]=nr(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?Qu(n.value):n.value,l=e??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||s&&n.value.trim()===l)||(n.value=l))}},F1={deep:!0,created(n,e,t){n[fi]=nr(t),fs(n,"change",()=>{const i=n._modelValue,s=na(n),r=n.checked,o=n[fi];if(Be(i)){const a=$m(i,s),l=a!==-1;if(r&&!l)o(i.concat(s));else if(!r&&l){const c=[...i];c.splice(a,1),o(c)}}else if(ma(i)){const a=new Set(i);r?a.add(s):a.delete(s),o(a)}else o(Qb(n,r))})},mounted:y0,beforeUpdate(n,e,t){n[fi]=nr(t),y0(n,e,t)}};function y0(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if(Be(e))s=$m(e,i.props.value)>-1;else if(ma(e))s=e.has(i.props.value);else{if(e===t)return;s=io(e,Qb(n,!0))}n.checked!==s&&(n.checked=s)}const B1={created(n,{value:e},t){n.checked=io(e,t.props.value),n[fi]=nr(t),fs(n,"change",()=>{n[fi](na(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[fi]=nr(i),e!==t&&(n.checked=io(e,i.props.value))}},k1={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const s=ma(e);fs(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?Qu(na(o)):na(o));n[fi](n.multiple?s?new Set(r):r:r[0]),n._assigning=!0,cr(()=>{n._assigning=!1})}),n[fi]=nr(i)},mounted(n,{value:e}){x0(n,e)},beforeUpdate(n,e,t){n[fi]=nr(t)},updated(n,{value:e}){n._assigning||x0(n,e)}};function x0(n,e){const t=n.multiple,i=Be(e);if(!(t&&!i&&!ma(e))){for(let s=0,r=n.options.length;sString(c)===String(a)):o.selected=$m(e,a)>-1}else o.selected=e.has(a);else if(io(na(o),e)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function na(n){return"_value"in n?n._value:n.value}function Qb(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const W4={created(n,e,t){Dc(n,e,t,null,"created")},mounted(n,e,t){Dc(n,e,t,null,"mounted")},beforeUpdate(n,e,t,i){Dc(n,e,t,i,"beforeUpdate")},updated(n,e,t,i){Dc(n,e,t,i,"updated")}};function V1(n,e){switch(n){case"SELECT":return k1;case"TEXTAREA":return v0;default:switch(e){case"checkbox":return F1;case"radio":return B1;default:return v0}}}function Dc(n,e,t,i,s){const o=V1(n.tagName,t.props&&t.props.type)[s];o&&o(n,e,t,i)}const z1=["ctrl","shift","alt","meta"],H1={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>z1.some(t=>n[`${t}Key`]&&!e.includes(t))},X4=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(s,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=s=>{if(!("key"in s))return;const r=As(s.key);if(e.some(o=>o===r||G1[o]===r))return n(s)})},W1=Zt({patchProp:O1},p1);let b0;function eS(){return b0||(b0=Vb(W1))}const q4=(...n)=>{eS().render(...n)},X1=(...n)=>{const e=eS().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=q1(i);if(!s)return;const r=e._component;!$e(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,$1(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e};function $1(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function q1(n){return Lt(n)?document.querySelector(n):n}const tS=new Set,Gn=new WeakMap,ia=new WeakMap,ro=new WeakMap,Wp=new WeakMap,Y1=new WeakMap,sa=new WeakMap,lf=new WeakMap,Wa=new WeakSet;let ir,lg=0,cg=0;const ps="__aa_tgt",Cl="__aa_del",cf="__aa_new",j1=n=>{const e=tC(n);e&&e.forEach(t=>nC(t))},K1=n=>{n.forEach(e=>{e.target===ir&&J1(),Gn.has(e.target)&&po(e.target)})};function Z1(n){const e=Wp.get(n);e==null||e.disconnect();let t=Gn.get(n),i=0;const s=5;t||(t=ra(n),Gn.set(n,t));const{offsetWidth:r,offsetHeight:o}=ir,l=[t.top-s,r-(t.left+s+t.width),o-(t.top+s+t.height),t.left-s].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++i>1&&po(n)},{root:ir,threshold:1,rootMargin:l});c.observe(n),Wp.set(n,c)}function po(n){clearTimeout(lf.get(n));const e=vh(n),t=Rl(e)?500:e.duration;lf.set(n,setTimeout(async()=>{const i=ro.get(n);try{await(i==null?void 0:i.finished),Gn.set(n,ra(n)),Z1(n)}catch{}},t))}function J1(){clearTimeout(lf.get(ir)),lf.set(ir,setTimeout(()=>{tS.forEach(n=>rS(n,e=>nS(()=>po(e))))},100))}function Q1(n){setTimeout(()=>{Y1.set(n,setInterval(()=>nS(po.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function nS(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let Xp,Wo;const eC=typeof window<"u"&&"ResizeObserver"in window;eC&&(ir=document.documentElement,Xp=new MutationObserver(j1),Wo=new ResizeObserver(K1),window.addEventListener("scroll",()=>{cg=window.scrollY,lg=window.scrollX}),Wo.observe(ir));function tC(n){return n.reduce((i,s)=>[...i,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(i=>i.nodeName==="#comment")?!1:n.reduce((i,s)=>{if(i===!1)return!1;if(s.target instanceof Element){if(Ed(s.target),!i.has(s.target)){i.add(s.target);for(let r=0;rt(n,sa.has(n)));for(let t=0;ts(i,sa.has(i)))}}function fg(n){return Array.isArray(n)?n:[n]}function Rl(n){return typeof n=="function"}function sC(n){const e=Gn.get(n),t=ra(n);if(!ug(n))return Gn.set(n,t);let i;if(!e)return;const s=vh(n);if(typeof s!="function"){const r=e.left-t.left,o=e.top-t.top,[a,l,c,u]=iS(n,e,t),f={transform:`translate(${r}px, ${o}px)`},h={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,h.width=`${l}px`),c!==u&&(f.height=`${c}px`,h.height=`${u}px`),i=n.animate([f,h],{duration:s.duration,easing:s.easing})}else{const[r]=fg(s(n,"remain",e,t));i=new Animation(r),i.play()}ro.set(n,i),Gn.set(n,t),i.addEventListener("finish",po.bind(null,n))}function S0(n){cf in n&&delete n[cf];const e=ra(n);Gn.set(n,e);const t=vh(n);if(!ug(n))return;let i;if(typeof t!="function")i=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:t.duration*1.5,easing:"ease-in"});else{const[s]=fg(t(n,"add",e));i=new Animation(s),i.play()}ro.set(n,i),i.addEventListener("finish",po.bind(null,n))}function M0(n,e){var t;n.remove(),Gn.delete(n),ia.delete(n),ro.delete(n),(t=Wp.get(n))===null||t===void 0||t.disconnect(),setTimeout(()=>{if(Cl in n&&delete n[Cl],Object.defineProperty(n,cf,{value:!0,configurable:!0}),e&&n instanceof HTMLElement)for(const i in e)n.style[i]=""},0)}function rC(n){var e;if(!ia.has(n)||!Gn.has(n))return;const[t,i]=ia.get(n);Object.defineProperty(n,Cl,{value:!0,configurable:!0});const s=window.scrollX,r=window.scrollY;if(i&&i.parentNode&&i.parentNode instanceof Element?i.parentNode.insertBefore(n,i):t&&t.parentNode?t.parentNode.appendChild(n):(e=sS(n))===null||e===void 0||e.appendChild(n),!ug(n))return M0(n);const[o,a,l,c]=aC(n),u=vh(n),f=Gn.get(n);(s!==lg||r!==cg)&&oC(n,s,r,u);let h,d={position:"absolute",top:`${o}px`,left:`${a}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Rl(u))Object.assign(n.style,d),h=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:u.duration,easing:"ease-out"});else{const[p,_]=fg(u(n,"remove",f));(_==null?void 0:_.styleReset)!==!1&&(d=(_==null?void 0:_.styleReset)||d,Object.assign(n.style,d)),h=new Animation(p),h.play()}ro.set(n,h),h.addEventListener("finish",M0.bind(null,n,d))}function oC(n,e,t,i){const s=lg-e,r=cg-t,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(ir).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+r),!n.parentElement)return;const l=n.parentElement;let c=l.clientHeight,u=l.clientWidth;const f=performance.now();function h(){requestAnimationFrame(()=>{if(!Rl(i)){const d=c-l.clientHeight,p=u-l.clientWidth;f+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-d}),c=l.clientHeight,u=l.clientWidth,h()):document.documentElement.style.scrollBehavior=o}})}h()}function aC(n){const e=Gn.get(n),[t,,i]=iS(n,e,ra(n));let s=n.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const r=getComputedStyle(s),o=Gn.get(s)||ra(s),a=Math.round(e.top-o.top)-Fi(r.borderTopWidth),l=Math.round(e.left-o.left)-Fi(r.borderLeftWidth);return[a,l,t,i]}function lC(n,e={}){return Xp&&Wo&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Rl(e)&&!e.disrespectUserMotionPreference||(Wa.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),rS(n,po,Q1,s=>Wo==null?void 0:Wo.observe(s)),Rl(e)?sa.set(n,e):sa.set(n,{duration:250,easing:"ease-in-out",...e}),Xp.observe(n,{childList:!0}),tS.add(n))),Object.freeze({parent:n,enable:()=>{Wa.add(n)},disable:()=>{Wa.delete(n)},isEnabled:()=>Wa.has(n)})}const cC={mounted:(n,e)=>{lC(n,e.value||{})},getSSRProps:()=>({})},uC=cC,fC={install(n){n.directive("auto-animate",uC)}};/** * @license * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT - */const lc="174",hC={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},dC={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},oS=0,$p=1,aS=2,pC=3,mC=0,hg=1,dg=2,Bi=3,Mr=0,Dn=1,Si=2,yr=0,Qs=1,qp=2,Yp=3,jp=4,lS=5,Kr=100,cS=101,uS=102,fS=103,hS=104,dS=200,pS=201,mS=202,gS=203,uf=204,ff=205,_S=206,vS=207,yS=208,xS=209,bS=210,SS=211,MS=212,ES=213,TS=214,hf=0,df=1,pf=2,oo=3,mf=4,gf=5,_f=6,vf=7,cc=0,wS=1,AS=2,Hi=0,CS=1,RS=2,PS=3,yh=4,IS=5,LS=6,DS=7,Kp="attached",OS="detached",xh=300,Er=301,rs=302,Pl=303,Il=304,_a=306,Ll=1e3,li=1001,Dl=1002,cn=1003,pg=1004,gC=1004,Xo=1005,_C=1005,jt=1006,Qa=1007,vC=1007,Vi=1008,yC=1008,qi=1009,mg=1010,gg=1011,oa=1012,bh=1013,Tr=1014,Hn=1015,va=1016,Sh=1017,Mh=1018,ao=1020,_g=35902,vg=1021,yg=1022,Ln=1023,xg=1024,bg=1025,eo=1026,lo=1027,Eh=1028,uc=1029,Sg=1030,Th=1031,xC=1032,wh=1033,el=33776,tl=33777,nl=33778,il=33779,yf=35840,xf=35841,bf=35842,Sf=35843,Mf=36196,Ef=37492,Tf=37496,wf=37808,Af=37809,Cf=37810,Rf=37811,Pf=37812,If=37813,Lf=37814,Df=37815,Of=37816,Nf=37817,Uf=37818,Ff=37819,Bf=37820,kf=37821,rl=36492,Vf=36494,zf=36495,Mg=36283,Hf=36284,Gf=36285,Wf=36286,NS=2200,US=2201,FS=2202,Ol=2300,Xf=2301,Gu=2302,qs=2400,Ys=2401,Nl=2402,Ah=2500,Eg=2501,bC=0,SC=1,MC=2,BS=3200,kS=3201,EC=3202,TC=3203,us=0,VS=1,hr="",Cn="srgb",co="srgb-linear",Ul="linear",St="srgb",wC=0,ks=7680,AC=7681,CC=7682,RC=7683,PC=34055,IC=34056,LC=5386,DC=512,OC=513,NC=514,UC=515,FC=516,BC=517,kC=518,Zp=519,zS=512,HS=513,GS=514,Tg=515,WS=516,XS=517,$S=518,qS=519,Fl=35044,VC=35048,zC=35040,HC=35045,GC=35049,WC=35041,XC=35046,$C=35050,qC=35042,YC="100",Jp="300 es",Mi=2e3,Bl=2001,jC={COMPUTE:"compute",RENDER:"render"};class ji{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+fn[n>>16&255]+fn[n>>24&255]+"-"+fn[e&255]+fn[e>>8&255]+"-"+fn[e>>16&15|64]+fn[e>>24&255]+"-"+fn[t&63|128]+fn[t>>8&255]+"-"+fn[t>>16&255]+fn[t>>24&255]+fn[i&255]+fn[i>>8&255]+fn[i>>16&255]+fn[i>>24&255]).toLowerCase()}function Ke(n,e,t){return Math.max(e,Math.min(t,n))}function wg(n,e){return(n%e+e)%e}function KC(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function ZC(n,e,t){return n!==e?(t-n)/(e-n):0}function sl(n,e,t){return(1-t)*n+t*e}function JC(n,e,t,i){return sl(n,e,1-Math.exp(-t*i))}function QC(n,e=1){return e-Math.abs(wg(n,e*2)-e)}function eR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function tR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function nR(n,e){return n+Math.floor(Math.random()*(e-n+1))}function iR(n,e){return n+Math.random()*(e-n)}function rR(n){return n*(.5-Math.random())}function sR(n){n!==void 0&&(Ev=n);let e=Ev+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function oR(n){return n*to}function aR(n){return n*aa}function lR(n){return(n&n-1)===0&&n!==0}function cR(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function uR(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function fR(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),f=s((e-i)/2),h=o((e-i)/2),d=s((i-e)/2),p=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*f,l*h,a*c);break;case"YZY":n.set(l*h,a*u,l*f,a*c);break;case"ZXZ":n.set(l*f,l*h,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*d,a*c);break;case"YXY":n.set(l*d,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*d,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function In(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function tt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Ag={DEG2RAD:to,RAD2DEG:aa,generateUUID:Zn,clamp:Ke,euclideanModulo:wg,mapLinear:KC,inverseLerp:ZC,lerp:sl,damp:JC,pingpong:QC,smoothstep:eR,smootherstep:tR,randInt:nR,randFloat:iR,randFloatSpread:rR,seededRandom:sR,degToRad:oR,radToDeg:aR,isPowerOfTwo:lR,ceilPowerOfTwo:cR,floorPowerOfTwo:uR,setQuaternionFromProperEuler:fR,normalize:tt,denormalize:In};class fe{constructor(e=0,t=0){fe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Ke(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Qe{constructor(e,t,i,r,s,o,a,l,c){Qe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],f=i[7],h=i[2],d=i[5],p=i[8],_=r[0],g=r[3],m=r[6],y=r[1],x=r[4],v=r[7],E=r[2],T=r[5],M=r[8];return s[0]=o*_+a*y+l*E,s[3]=o*g+a*x+l*T,s[6]=o*m+a*v+l*M,s[1]=c*_+u*y+f*E,s[4]=c*g+u*x+f*T,s[7]=c*m+u*v+f*M,s[2]=h*_+d*y+p*E,s[5]=h*g+d*x+p*T,s[8]=h*m+d*v+p*M,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*o-a*c,h=a*l-u*s,d=c*s-o*l,p=t*f+i*h+r*d;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=f*_,e[1]=(r*c-u*i)*_,e[2]=(a*i-r*o)*_,e[3]=h*_,e[4]=(u*t-r*l)*_,e[5]=(r*s-a*t)*_,e[6]=d*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Td.makeScale(e,t)),this}rotate(e){return this.premultiply(Td.makeRotation(-e)),this}translate(e,t){return this.premultiply(Td.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Td=new Qe;function YS(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const hR={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function $o(n,e){return new hR[n](e)}function kl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function jS(){const n=kl("canvas");return n.style.display="block",n}const Tv={};function Vs(n){n in Tv||(Tv[n]=!0,console.warn(n))}function dR(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}function pR(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function mR(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const wv=new Qe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Av=new Qe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function gR(){const n={enabled:!0,workingColorSpace:co,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===St&&(r.r=xr(r.r),r.g=xr(r.g),r.b=xr(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===St&&(r.r=ea(r.r),r.g=ea(r.g),r.b=ea(r.b))),r},fromWorkingColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},toWorkingColorSpace:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===hr?Ul:this.spaces[r].transfer},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[co]:{primaries:e,whitePoint:i,transfer:Ul,toXYZ:wv,fromXYZ:Av,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Cn},outputColorSpaceConfig:{drawingBufferColorSpace:Cn}},[Cn]:{primaries:e,whitePoint:i,transfer:St,toXYZ:wv,fromXYZ:Av,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Cn}}}),n}const at=gR();function xr(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ea(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let So;class KS{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{So===void 0&&(So=kl("canvas")),So.width=e.width,So.height=e.height;const i=So.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=So}return t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=kl("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==xh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ll:e.x=e.x-Math.floor(e.x);break;case li:e.x=e.x<0?0:1;break;case Dl:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ll:e.y=e.y-Math.floor(e.y);break;case li:e.y=e.y<0?0:1;break;case Dl:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Vt.DEFAULT_IMAGE=null;Vt.DEFAULT_MAPPING=xh;Vt.DEFAULT_ANISOTROPY=1;class ht{constructor(e=0,t=0,i=0,r=1){ht.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],f=l[8],h=l[1],d=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+_)<.1&&Math.abs(p+g)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,v=(d+1)/2,E=(m+1)/2,T=(u+h)/4,M=(f+_)/4,P=(p+g)/4;return x>v&&x>E?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=T/i,s=M/i):v>E?v<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(v),i=T/r,s=P/r):E<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(E),i=M/s,r=P/s),this.set(i,r,s,t),this}let y=Math.sqrt((g-p)*(g-p)+(f-_)*(f-_)+(h-u)*(h-u));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(f-_)/y,this.z=(h-u)/y,this.w=Math.acos((c+d+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this.z=Ke(this.z,e.z,t.z),this.w=Ke(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this.z=Ke(this.z,e,t),this.w=Ke(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Ch extends ji{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ht(0,0,e,t),this.scissorTest=!1,this.viewport=new ht(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Vt(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const E=Math.sqrt(x),T=Math.atan2(E,m*y);g=Math.sin(g*T)/E,a=Math.sin(a*T)/E}const v=a*y;if(l=l*g+h*v,c=c*g+d*v,u=u*g+p*v,f=f*g+_*v,g===1-a){const E=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=E,c*=E,u*=E,f*=E}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],f=s[o],h=s[o+1],d=s[o+2],p=s[o+3];return e[t]=a*p+u*f+l*d-c*h,e[t+1]=l*p+u*h+c*f-a*d,e[t+2]=c*p+u*d+a*h-l*f,e[t+3]=u*p-a*f-l*h-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),f=a(s/2),h=l(i/2),d=l(r/2),p=l(s/2);switch(o){case"XYZ":this._x=h*u*f+c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f-h*d*p;break;case"YXZ":this._x=h*u*f+c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f+h*d*p;break;case"ZXY":this._x=h*u*f-c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f-h*d*p;break;case"ZYX":this._x=h*u*f-c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f+h*d*p;break;case"YZX":this._x=h*u*f+c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f-h*d*p;break;case"XZY":this._x=h*u*f-c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],f=t[10],h=i+a+f;if(h>0){const d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-c)*d,this._z=(o-r)*d}else if(i>a&&i>f){const d=2*Math.sqrt(1+i-a-f);this._w=(u-l)/d,this._x=.25*d,this._y=(r+o)/d,this._z=(s+c)/d}else if(a>f){const d=2*Math.sqrt(1+a-i-f);this._w=(s-c)/d,this._x=(r+o)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+f-i-a);this._w=(o-r)/d,this._x=(s+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ke(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const d=1-t;return this._w=d*o+t*this._w,this._x=d*i+t*this._x,this._y=d*r+t*this._y,this._z=d*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-t)*u)/c,h=Math.sin(t*u)/c;return this._w=o*f+this._w*h,this._x=i*f+this._x*h,this._y=r*f+this._y*h,this._z=s*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,i=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Cv.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Cv.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),f=2*(s*i-o*t);return this.x=t+l*c+o*f-a*u,this.y=i+l*u+a*c-s*f,this.z=r+l*f+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this.z=Ke(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this.z=Ke(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ad.copy(this).projectOnVector(e),this.sub(Ad)}reflect(e){return this.sub(Ad.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Ke(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ad=new F,Cv=new Wn;class On{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,vi),vi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Aa),Nc.subVectors(this.max,Aa),Mo.subVectors(e.a,Aa),Eo.subVectors(e.b,Aa),To.subVectors(e.c,Aa),Dr.subVectors(Eo,Mo),Or.subVectors(To,Eo),Ms.subVectors(Mo,To);let t=[0,-Dr.z,Dr.y,0,-Or.z,Or.y,0,-Ms.z,Ms.y,Dr.z,0,-Dr.x,Or.z,0,-Or.x,Ms.z,0,-Ms.x,-Dr.y,Dr.x,0,-Or.y,Or.x,0,-Ms.y,Ms.x,0];return!Cd(t,Mo,Eo,To,Nc)||(t=[1,0,0,0,1,0,0,0,1],!Cd(t,Mo,Eo,To,Nc))?!1:(Uc.crossVectors(Dr,Or),t=[Uc.x,Uc.y,Uc.z],Cd(t,Mo,Eo,To,Nc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(vi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(er[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),er[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),er[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),er[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),er[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),er[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),er[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),er[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(er),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const er=[new F,new F,new F,new F,new F,new F,new F,new F],vi=new F,Oc=new On,Mo=new F,Eo=new F,To=new F,Dr=new F,Or=new F,Ms=new F,Aa=new F,Nc=new F,Uc=new F,Es=new F;function Cd(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Es.fromArray(n,s);const a=r.x*Math.abs(Es.x)+r.y*Math.abs(Es.y)+r.z*Math.abs(Es.z),l=e.dot(Es),c=t.dot(Es),u=i.dot(Es);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const bR=new On,Ca=new F,Rd=new F;class _n{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):bR.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ca.subVectors(e,this.center);const t=Ca.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Ca,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Rd.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ca.copy(e.center).add(Rd)),this.expandByPoint(Ca.copy(e.center).sub(Rd))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const tr=new F,Pd=new F,Fc=new F,Nr=new F,Id=new F,Bc=new F,Ld=new F;class ya{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,tr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=tr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(tr.copy(this.origin).addScaledVector(this.direction,t),tr.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Pd.copy(e).add(t).multiplyScalar(.5),Fc.copy(t).sub(e).normalize(),Nr.copy(this.origin).sub(Pd);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Fc),a=Nr.dot(this.direction),l=-Nr.dot(Fc),c=Nr.lengthSq(),u=Math.abs(1-o*o);let f,h,d,p;if(u>0)if(f=o*l-a,h=o*a-l,p=s*u,f>=0)if(h>=-p)if(h<=p){const _=1/u;f*=_,h*=_,d=f*(f+o*h+2*a)+h*(o*f+h+2*l)+c}else h=s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h=-s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h<=-p?(f=Math.max(0,-(-o*s+a)),h=f>0?-s:Math.min(Math.max(-s,-l),s),d=-f*f+h*(h+2*l)+c):h<=p?(f=0,h=Math.min(Math.max(-s,-l),s),d=h*(h+2*l)+c):(f=Math.max(0,-(o*s+a)),h=f>0?s:Math.min(Math.max(-s,-l),s),d=-f*f+h*(h+2*l)+c);else h=o>0?-s:s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(Pd).addScaledVector(Fc,h),d}intersectSphere(e,t){tr.subVectors(e.center,this.origin);const i=tr.dot(this.direction),r=tr.dot(tr)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(s=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(s=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(a=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,tr)!==null}intersectTriangle(e,t,i,r,s){Id.subVectors(t,e),Bc.subVectors(i,e),Ld.crossVectors(Id,Bc);let o=this.direction.dot(Ld),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Nr.subVectors(this.origin,e);const l=a*this.direction.dot(Bc.crossVectors(Nr,Bc));if(l<0)return null;const c=a*this.direction.dot(Id.cross(Nr));if(c<0||l+c>o)return null;const u=-a*Nr.dot(Ld);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Xe{constructor(e,t,i,r,s,o,a,l,c,u,f,h,d,p,_,g){Xe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,f,h,d,p,_,g)}set(e,t,i,r,s,o,a,l,c,u,f,h,d,p,_,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=f,m[14]=h,m[3]=d,m[7]=p,m[11]=_,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Xe().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/wo.setFromMatrixColumn(e,0).length(),s=1/wo.setFromMatrixColumn(e,1).length(),o=1/wo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const h=o*u,d=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=d+p*c,t[5]=h-_*c,t[9]=-a*l,t[2]=_-h*c,t[6]=p+d*c,t[10]=o*l}else if(e.order==="YXZ"){const h=l*u,d=l*f,p=c*u,_=c*f;t[0]=h+_*a,t[4]=p*a-d,t[8]=o*c,t[1]=o*f,t[5]=o*u,t[9]=-a,t[2]=d*a-p,t[6]=_+h*a,t[10]=o*l}else if(e.order==="ZXY"){const h=l*u,d=l*f,p=c*u,_=c*f;t[0]=h-_*a,t[4]=-o*f,t[8]=p+d*a,t[1]=d+p*a,t[5]=o*u,t[9]=_-h*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const h=o*u,d=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=p*c-d,t[8]=h*c+_,t[1]=l*f,t[5]=_*c+h,t[9]=d*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const h=o*l,d=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=_-h*f,t[8]=p*f+d,t[1]=f,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=d*f+p,t[10]=h-_*f}else if(e.order==="XZY"){const h=o*l,d=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=h*f+_,t[5]=o*u,t[9]=d*f-p,t[2]=p*f-d,t[6]=a*u,t[10]=_*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(SR,e,MR)}lookAt(e,t,i){const r=this.elements;return Yn.subVectors(e,t),Yn.lengthSq()===0&&(Yn.z=1),Yn.normalize(),Ur.crossVectors(i,Yn),Ur.lengthSq()===0&&(Math.abs(i.z)===1?Yn.x+=1e-4:Yn.z+=1e-4,Yn.normalize(),Ur.crossVectors(i,Yn)),Ur.normalize(),kc.crossVectors(Yn,Ur),r[0]=Ur.x,r[4]=kc.x,r[8]=Yn.x,r[1]=Ur.y,r[5]=kc.y,r[9]=Yn.y,r[2]=Ur.z,r[6]=kc.z,r[10]=Yn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],f=i[5],h=i[9],d=i[13],p=i[2],_=i[6],g=i[10],m=i[14],y=i[3],x=i[7],v=i[11],E=i[15],T=r[0],M=r[4],P=r[8],b=r[12],S=r[1],D=r[5],B=r[9],H=r[13],$=r[2],ee=r[6],Z=r[10],te=r[14],Q=r[3],pe=r[7],ve=r[11],re=r[15];return s[0]=o*T+a*S+l*$+c*Q,s[4]=o*M+a*D+l*ee+c*pe,s[8]=o*P+a*B+l*Z+c*ve,s[12]=o*b+a*H+l*te+c*re,s[1]=u*T+f*S+h*$+d*Q,s[5]=u*M+f*D+h*ee+d*pe,s[9]=u*P+f*B+h*Z+d*ve,s[13]=u*b+f*H+h*te+d*re,s[2]=p*T+_*S+g*$+m*Q,s[6]=p*M+_*D+g*ee+m*pe,s[10]=p*P+_*B+g*Z+m*ve,s[14]=p*b+_*H+g*te+m*re,s[3]=y*T+x*S+v*$+E*Q,s[7]=y*M+x*D+v*ee+E*pe,s[11]=y*P+x*B+v*Z+E*ve,s[15]=y*b+x*H+v*te+E*re,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],h=e[10],d=e[14],p=e[3],_=e[7],g=e[11],m=e[15];return p*(+s*l*f-r*c*f-s*a*h+i*c*h+r*a*d-i*l*d)+_*(+t*l*d-t*c*h+s*o*h-r*o*d+r*c*u-s*l*u)+g*(+t*c*f-t*a*d-s*o*f+i*o*d+s*a*u-i*c*u)+m*(-r*a*u-t*l*f+t*a*h+r*o*f-i*o*h+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],_=e[13],g=e[14],m=e[15],y=f*g*c-_*h*c+_*l*d-a*g*d-f*l*m+a*h*m,x=p*h*c-u*g*c-p*l*d+o*g*d+u*l*m-o*h*m,v=u*_*c-p*f*c+p*a*d-o*_*d-u*a*m+o*f*m,E=p*f*l-u*_*l-p*a*h+o*_*h+u*a*g-o*f*g,T=t*y+i*x+r*v+s*E;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/T;return e[0]=y*M,e[1]=(_*h*s-f*g*s-_*r*d+i*g*d+f*r*m-i*h*m)*M,e[2]=(a*g*s-_*l*s+_*r*c-i*g*c-a*r*m+i*l*m)*M,e[3]=(f*l*s-a*h*s-f*r*c+i*h*c+a*r*d-i*l*d)*M,e[4]=x*M,e[5]=(u*g*s-p*h*s+p*r*d-t*g*d-u*r*m+t*h*m)*M,e[6]=(p*l*s-o*g*s-p*r*c+t*g*c+o*r*m-t*l*m)*M,e[7]=(o*h*s-u*l*s+u*r*c-t*h*c-o*r*d+t*l*d)*M,e[8]=v*M,e[9]=(p*f*s-u*_*s-p*i*d+t*_*d+u*i*m-t*f*m)*M,e[10]=(o*_*s-p*a*s+p*i*c-t*_*c-o*i*m+t*a*m)*M,e[11]=(u*a*s-o*f*s-u*i*c+t*f*c+o*i*d-t*a*d)*M,e[12]=E*M,e[13]=(u*_*r-p*f*r+p*i*h-t*_*h-u*i*g+t*f*g)*M,e[14]=(p*a*r-o*_*r-p*i*l+t*_*l+o*i*g-t*a*g)*M,e[15]=(o*f*r-u*a*r+u*i*l-t*f*l-o*i*h+t*a*h)*M,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,f=a+a,h=s*c,d=s*u,p=s*f,_=o*u,g=o*f,m=a*f,y=l*c,x=l*u,v=l*f,E=i.x,T=i.y,M=i.z;return r[0]=(1-(_+m))*E,r[1]=(d+v)*E,r[2]=(p-x)*E,r[3]=0,r[4]=(d-v)*T,r[5]=(1-(h+m))*T,r[6]=(g+y)*T,r[7]=0,r[8]=(p+x)*M,r[9]=(g-y)*M,r[10]=(1-(h+_))*M,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=wo.set(r[0],r[1],r[2]).length();const o=wo.set(r[4],r[5],r[6]).length(),a=wo.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],yi.copy(this);const c=1/s,u=1/o,f=1/a;return yi.elements[0]*=c,yi.elements[1]*=c,yi.elements[2]*=c,yi.elements[4]*=u,yi.elements[5]*=u,yi.elements[6]*=u,yi.elements[8]*=f,yi.elements[9]*=f,yi.elements[10]*=f,t.setFromRotationMatrix(yi),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Mi){const l=this.elements,c=2*s/(t-e),u=2*s/(i-r),f=(t+e)/(t-e),h=(i+r)/(i-r);let d,p;if(a===Mi)d=-(o+s)/(o-s),p=-2*o*s/(o-s);else if(a===Bl)d=-o/(o-s),p=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Mi){const l=this.elements,c=1/(t-e),u=1/(i-r),f=1/(o-s),h=(t+e)*c,d=(i+r)*u;let p,_;if(a===Mi)p=(o+s)*f,_=-2*f;else if(a===Bl)p=s*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=_,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const wo=new F,yi=new Xe,SR=new F(0,0,0),MR=new F(1,1,1),Ur=new F,kc=new F,Yn=new F,Rv=new Xe,Pv=new Wn;class ei{constructor(e=0,t=0,i=0,r=ei.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],f=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(Ke(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ke(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ke(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ke(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ke(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Ke(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Rv.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Rv,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Pv.setFromEuler(this),this.setFromQuaternion(Pv,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ei.DEFAULT_ORDER="XYZ";class Ph{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),d.length>0&&(i.animations=d),p.length>0&&(i.nodes=p)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){xi.subVectors(r,t),ir.subVectors(i,t),Od.subVectors(e,t);const o=xi.dot(xi),a=xi.dot(ir),l=xi.dot(Od),c=ir.dot(ir),u=ir.dot(Od),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;const h=1/f,d=(c*l-a*u)*h,p=(o*u-a*l)*h;return s.set(1-d-p,p,d)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,rr)===null?!1:rr.x>=0&&rr.y>=0&&rr.x+rr.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,rr)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,rr.x),l.addScaledVector(o,rr.y),l.addScaledVector(a,rr.z),l)}static getInterpolatedAttribute(e,t,i,r,s,o){return Bd.setScalar(0),kd.setScalar(0),Vd.setScalar(0),Bd.fromBufferAttribute(e,t),kd.fromBufferAttribute(e,i),Vd.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(Bd,s.x),o.addScaledVector(kd,s.y),o.addScaledVector(Vd,s.z),o}static isFrontFacing(e,t,i,r){return xi.subVectors(i,t),ir.subVectors(e,t),xi.cross(ir).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return xi.subVectors(this.c,this.b),ir.subVectors(this.a,this.b),xi.cross(ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return zn.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Ro.subVectors(r,i),Po.subVectors(s,i),Nd.subVectors(e,i);const l=Ro.dot(Nd),c=Po.dot(Nd);if(l<=0&&c<=0)return t.copy(i);Ud.subVectors(e,r);const u=Ro.dot(Ud),f=Po.dot(Ud);if(u>=0&&f<=u)return t.copy(r);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Ro,o);Fd.subVectors(e,s);const d=Ro.dot(Fd),p=Po.dot(Fd);if(p>=0&&d<=p)return t.copy(s);const _=d*c-l*p;if(_<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(i).addScaledVector(Po,a);const g=u*p-d*f;if(g<=0&&f-u>=0&&d-p>=0)return Uv.subVectors(s,r),a=(f-u)/(f-u+(d-p)),t.copy(r).addScaledVector(Uv,a);const m=1/(g+_+h);return o=_*m,a=h*m,t.copy(i).addScaledVector(Ro,o).addScaledVector(Po,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ZS={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},Fr={h:0,s:0,l:0},zc={h:0,s:0,l:0};function zd(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class we{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Cn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,at.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=at.workingColorSpace){return this.r=e,this.g=t,this.b=i,at.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=at.workingColorSpace){if(e=wg(e,1),t=Ke(t,0,1),i=Ke(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=zd(o,s,e+1/3),this.g=zd(o,s,e),this.b=zd(o,s,e-1/3)}return at.toWorkingColorSpace(this,r),this}setStyle(e,t=Cn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Cn){const i=ZS[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=xr(e.r),this.g=xr(e.g),this.b=xr(e.b),this}copyLinearToSRGB(e){return this.r=ea(e.r),this.g=ea(e.g),this.b=ea(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cn){return at.fromWorkingColorSpace(hn.copy(this),e),Math.round(Ke(hn.r*255,0,255))*65536+Math.round(Ke(hn.g*255,0,255))*256+Math.round(Ke(hn.b*255,0,255))}getHexString(e=Cn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=at.workingColorSpace){at.fromWorkingColorSpace(hn.copy(this),t);const i=hn.r,r=hn.g,s=hn.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case i:l=(r-s)/f+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Qs&&(i.blending=this.blending),this.side!==Mr&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==uf&&(i.blendSrc=this.blendSrc),this.blendDst!==ff&&(i.blendDst=this.blendDst),this.blendEquation!==Kr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==oo&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Zp&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ks&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ks&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ks&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Rr extends xn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new we(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ei,this.combine=cc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const dr=RR();function RR(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Bn(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Ke(n,-65504,65504),dr.floatView[0]=n;const e=dr.uint32View[0],t=e>>23&511;return dr.baseTable[t]+((e&8388607)>>dr.shiftTable[t])}function Xa(n){const e=n>>10;return dr.uint32View[0]=dr.mantissaTable[dr.offsetTable[e]+(n&1023)]+dr.exponentTable[e],dr.floatView[0]}class PR{static toHalfFloat(e){return Bn(e)}static fromHalfFloat(e){return Xa(e)}}const Wt=new F,Hc=new fe;let IR=0;class Et{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:IR++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Fl,this.updateRanges=[],this.gpuType=Hn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;rt.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new On);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],f=s[c];for(let h=0,d=f.length;h0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(Fv.copy(s).invert(),Ts.copy(e.ray).applyMatrix4(Fv),!(i.boundingBox!==null&&Ts.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Ts)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,f=s.attributes.normal,h=s.groups,d=s.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,_=h.length;p<_;p++){const g=h[p],m=o[g.materialIndex],y=Math.max(g.start,d.start),x=Math.min(a.count,Math.min(g.start+g.count,d.start+d.count));for(let v=y,E=x;vt.far?null:{distance:c,point:Yc.clone(),object:n}}function jc(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,Wc),n.getVertexPosition(l,Xc),n.getVertexPosition(c,$c);const u=kR(n,e,t,i,Wc,Xc,$c,kv);if(u){const f=new F;zn.getBarycoord(kv,Wc,Xc,$c,f),r&&(u.uv=zn.getInterpolatedAttribute(r,a,l,c,f,new fe)),s&&(u.uv1=zn.getInterpolatedAttribute(s,a,l,c,f,new fe)),o&&(u.normal=zn.getInterpolatedAttribute(o,a,l,c,f,new F),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new F,materialIndex:0};zn.getNormal(Wc,Xc,$c,h.normal),u.face=h,u.barycoord=f}return u}class mo extends st{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],f=[];let h=0,d=0;p("z","y","x",-1,-1,i,t,e,o,s,0),p("z","y","x",1,-1,i,t,-e,o,s,1),p("x","z","y",1,1,e,i,t,r,o,2),p("x","z","y",1,-1,e,i,-t,r,o,3),p("x","y","z",1,-1,e,t,i,r,s,4),p("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Ue(c,3)),this.setAttribute("normal",new Ue(u,3)),this.setAttribute("uv",new Ue(f,2));function p(_,g,m,y,x,v,E,T,M,P,b){const S=v/M,D=E/P,B=v/2,H=E/2,$=T/2,ee=M+1,Z=P+1;let te=0,Q=0;const pe=new F;for(let ve=0;ve0?1:-1,u.push(pe.x,pe.y,pe.z),f.push(xe/M),f.push(1-ve/P),te+=1}}for(let ve=0;ve>8&255]+fn[n>>16&255]+fn[n>>24&255]+"-"+fn[e&255]+fn[e>>8&255]+"-"+fn[e>>16&15|64]+fn[e>>24&255]+"-"+fn[t&63|128]+fn[t>>8&255]+"-"+fn[t>>16&255]+fn[t>>24&255]+fn[i&255]+fn[i>>8&255]+fn[i>>16&255]+fn[i>>24&255]).toLowerCase()}function Ke(n,e,t){return Math.max(e,Math.min(t,n))}function wg(n,e){return(n%e+e)%e}function KC(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function ZC(n,e,t){return n!==e?(t-n)/(e-n):0}function rl(n,e,t){return(1-t)*n+t*e}function JC(n,e,t,i){return rl(n,e,1-Math.exp(-t*i))}function QC(n,e=1){return e-Math.abs(wg(n,e*2)-e)}function eR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function tR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function nR(n,e){return n+Math.floor(Math.random()*(e-n+1))}function iR(n,e){return n+Math.random()*(e-n)}function sR(n){return n*(.5-Math.random())}function rR(n){n!==void 0&&(E0=n);let e=E0+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function oR(n){return n*to}function aR(n){return n*aa}function lR(n){return(n&n-1)===0&&n!==0}function cR(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function uR(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function fR(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),c=r((e+i)/2),u=o((e+i)/2),f=r((e-i)/2),h=o((e-i)/2),d=r((i-e)/2),p=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*f,l*h,a*c);break;case"YZY":n.set(l*h,a*u,l*f,a*c);break;case"ZXZ":n.set(l*f,l*h,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*d,a*c);break;case"YXY":n.set(l*d,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*d,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function In(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function tt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Ag={DEG2RAD:to,RAD2DEG:aa,generateUUID:Zn,clamp:Ke,euclideanModulo:wg,mapLinear:KC,inverseLerp:ZC,lerp:rl,damp:JC,pingpong:QC,smoothstep:eR,smootherstep:tR,randInt:nR,randFloat:iR,randFloatSpread:sR,seededRandom:rR,degToRad:oR,radToDeg:aR,isPowerOfTwo:lR,ceilPowerOfTwo:cR,floorPowerOfTwo:uR,setQuaternionFromProperEuler:fR,normalize:tt,denormalize:In};class fe{constructor(e=0,t=0){fe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Ke(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Qe{constructor(e,t,i,s,r,o,a,l,c){Qe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c)}set(e,t,i,s,r,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],f=i[7],h=i[2],d=i[5],p=i[8],_=s[0],g=s[3],m=s[6],y=s[1],x=s[4],v=s[7],E=s[2],T=s[5],M=s[8];return r[0]=o*_+a*y+l*E,r[3]=o*g+a*x+l*T,r[6]=o*m+a*v+l*M,r[1]=c*_+u*y+f*E,r[4]=c*g+u*x+f*T,r[7]=c*m+u*v+f*M,r[2]=h*_+d*y+p*E,r[5]=h*g+d*x+p*T,r[8]=h*m+d*v+p*M,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*r*u+i*a*l+s*r*c-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*o-a*c,h=a*l-u*r,d=c*r-o*l,p=t*f+i*h+s*d;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=f*_,e[1]=(s*c-u*i)*_,e[2]=(a*i-s*o)*_,e[3]=h*_,e[4]=(u*t-s*l)*_,e[5]=(s*r-a*t)*_,e[6]=d*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*r)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-s*c,s*l,-s*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Td.makeScale(e,t)),this}rotate(e){return this.premultiply(Td.makeRotation(-e)),this}translate(e,t){return this.premultiply(Td.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Td=new Qe;function YS(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const hR={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function $o(n,e){return new hR[n](e)}function kl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function jS(){const n=kl("canvas");return n.style.display="block",n}const T0={};function Vr(n){n in T0||(T0[n]=!0,console.warn(n))}function dR(n,e,t){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:i()}}setTimeout(r,t)})}function pR(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function mR(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const w0=new Qe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),A0=new Qe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function gR(){const n={enabled:!0,workingColorSpace:co,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===St&&(s.r=xs(s.r),s.g=xs(s.g),s.b=xs(s.b)),this.spaces[r].primaries!==this.spaces[o].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===St&&(s.r=ea(s.r),s.g=ea(s.g),s.b=ea(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===hs?Ul:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,o){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[co]:{primaries:e,whitePoint:i,transfer:Ul,toXYZ:w0,fromXYZ:A0,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Cn},outputColorSpaceConfig:{drawingBufferColorSpace:Cn}},[Cn]:{primaries:e,whitePoint:i,transfer:St,toXYZ:w0,fromXYZ:A0,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Cn}}}),n}const at=gR();function xs(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ea(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let So;class KS{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{So===void 0&&(So=kl("canvas")),So.width=e.width,So.height=e.height;const i=So.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=So}return t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=kl("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==xh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ll:e.x=e.x-Math.floor(e.x);break;case li:e.x=e.x<0?0:1;break;case Dl:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ll:e.y=e.y-Math.floor(e.y);break;case li:e.y=e.y<0?0:1;break;case Dl:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Vt.DEFAULT_IMAGE=null;Vt.DEFAULT_MAPPING=xh;Vt.DEFAULT_ANISOTROPY=1;class ht{constructor(e=0,t=0,i=0,s=1){ht.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,c=l[0],u=l[4],f=l[8],h=l[1],d=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+_)<.1&&Math.abs(p+g)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,v=(d+1)/2,E=(m+1)/2,T=(u+h)/4,M=(f+_)/4,P=(p+g)/4;return x>v&&x>E?x<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(x),s=T/i,r=M/i):v>E?v<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(v),i=T/s,r=P/s):E<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(E),i=M/r,s=P/r),this.set(i,s,r,t),this}let y=Math.sqrt((g-p)*(g-p)+(f-_)*(f-_)+(h-u)*(h-u));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(f-_)/y,this.z=(h-u)/y,this.w=Math.acos((c+d+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this.z=Ke(this.z,e.z,t.z),this.w=Ke(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this.z=Ke(this.z,e,t),this.w=Ke(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Ch extends ji{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ht(0,0,e,t),this.scissorTest=!1,this.viewport=new ht(0,0,e,t);const s={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const r=new Vt(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);r.flipY=!1,r.generateMipmaps=i.generateMipmaps,r.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const E=Math.sqrt(x),T=Math.atan2(E,m*y);g=Math.sin(g*T)/E,a=Math.sin(a*T)/E}const v=a*y;if(l=l*g+h*v,c=c*g+d*v,u=u*g+p*v,f=f*g+_*v,g===1-a){const E=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=E,c*=E,u*=E,f*=E}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],f=r[o],h=r[o+1],d=r[o+2],p=r[o+3];return e[t]=a*p+u*f+l*d-c*h,e[t+1]=l*p+u*h+c*f-a*d,e[t+2]=c*p+u*d+a*h-l*f,e[t+3]=u*p-a*f-l*h-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(s/2),f=a(r/2),h=l(i/2),d=l(s/2),p=l(r/2);switch(o){case"XYZ":this._x=h*u*f+c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f-h*d*p;break;case"YXZ":this._x=h*u*f+c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f+h*d*p;break;case"ZXY":this._x=h*u*f-c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f-h*d*p;break;case"ZYX":this._x=h*u*f-c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f+h*d*p;break;case"YZX":this._x=h*u*f+c*d*p,this._y=c*d*f+h*u*p,this._z=c*u*p-h*d*f,this._w=c*u*f-h*d*p;break;case"XZY":this._x=h*u*f-c*d*p,this._y=c*d*f-h*u*p,this._z=c*u*p+h*d*f,this._w=c*u*f+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],f=t[10],h=i+a+f;if(h>0){const d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-l)*d,this._y=(r-c)*d,this._z=(o-s)*d}else if(i>a&&i>f){const d=2*Math.sqrt(1+i-a-f);this._w=(u-l)/d,this._x=.25*d,this._y=(s+o)/d,this._z=(r+c)/d}else if(a>f){const d=2*Math.sqrt(1+a-i-f);this._w=(r-c)/d,this._x=(s+o)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+f-i-a);this._w=(o-s)/d,this._x=(r+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ke(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+s*c-r*l,this._y=s*u+o*l+r*a-i*c,this._z=r*u+o*c+i*l-s*a,this._w=o*u-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const d=1-t;return this._w=d*o+t*this._w,this._x=d*i+t*this._x,this._y=d*s+t*this._y,this._z=d*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-t)*u)/c,h=Math.sin(t*u)/c;return this._w=o*f+this._w*h,this._x=i*f+this._x*h,this._y=s*f+this._y*h,this._z=r*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,i=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(C0.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(C0.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*s-a*i),u=2*(a*t-r*s),f=2*(r*i-o*t);return this.x=t+l*c+o*f-a*u,this.y=i+l*u+a*c-r*f,this.z=s+l*f+r*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Ke(this.x,e.x,t.x),this.y=Ke(this.y,e.y,t.y),this.z=Ke(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ke(this.x,e,t),this.y=Ke(this.y,e,t),this.z=Ke(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ke(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ad.copy(this).projectOnVector(e),this.sub(Ad)}reflect(e){return this.sub(Ad.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Ke(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ad=new F,C0=new Wn;class On{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,vi),vi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Aa),Nc.subVectors(this.max,Aa),Mo.subVectors(e.a,Aa),Eo.subVectors(e.b,Aa),To.subVectors(e.c,Aa),Ds.subVectors(Eo,Mo),Os.subVectors(To,Eo),Mr.subVectors(Mo,To);let t=[0,-Ds.z,Ds.y,0,-Os.z,Os.y,0,-Mr.z,Mr.y,Ds.z,0,-Ds.x,Os.z,0,-Os.x,Mr.z,0,-Mr.x,-Ds.y,Ds.x,0,-Os.y,Os.x,0,-Mr.y,Mr.x,0];return!Cd(t,Mo,Eo,To,Nc)||(t=[1,0,0,0,1,0,0,0,1],!Cd(t,Mo,Eo,To,Nc))?!1:(Uc.crossVectors(Ds,Os),t=[Uc.x,Uc.y,Uc.z],Cd(t,Mo,Eo,To,Nc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(vi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(es[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),es[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),es[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),es[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),es[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),es[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),es[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),es[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(es),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const es=[new F,new F,new F,new F,new F,new F,new F,new F],vi=new F,Oc=new On,Mo=new F,Eo=new F,To=new F,Ds=new F,Os=new F,Mr=new F,Aa=new F,Nc=new F,Uc=new F,Er=new F;function Cd(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Er.fromArray(n,r);const a=s.x*Math.abs(Er.x)+s.y*Math.abs(Er.y)+s.z*Math.abs(Er.z),l=e.dot(Er),c=t.dot(Er),u=i.dot(Er);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const bR=new On,Ca=new F,Rd=new F;class _n{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):bR.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ca.subVectors(e,this.center);const t=Ca.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(Ca,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Rd.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ca.copy(e.center).add(Rd)),this.expandByPoint(Ca.copy(e.center).sub(Rd))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ts=new F,Pd=new F,Fc=new F,Ns=new F,Id=new F,Bc=new F,Ld=new F;class ya{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ts)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ts.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ts.copy(this.origin).addScaledVector(this.direction,t),ts.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Pd.copy(e).add(t).multiplyScalar(.5),Fc.copy(t).sub(e).normalize(),Ns.copy(this.origin).sub(Pd);const r=e.distanceTo(t)*.5,o=-this.direction.dot(Fc),a=Ns.dot(this.direction),l=-Ns.dot(Fc),c=Ns.lengthSq(),u=Math.abs(1-o*o);let f,h,d,p;if(u>0)if(f=o*l-a,h=o*a-l,p=r*u,f>=0)if(h>=-p)if(h<=p){const _=1/u;f*=_,h*=_,d=f*(f+o*h+2*a)+h*(o*f+h+2*l)+c}else h=r,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h=-r,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h<=-p?(f=Math.max(0,-(-o*r+a)),h=f>0?-r:Math.min(Math.max(-r,-l),r),d=-f*f+h*(h+2*l)+c):h<=p?(f=0,h=Math.min(Math.max(-r,-l),r),d=h*(h+2*l)+c):(f=Math.max(0,-(o*r+a)),h=f>0?r:Math.min(Math.max(-r,-l),r),d=-f*f+h*(h+2*l)+c);else h=o>0?-r:r,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),s&&s.copy(Pd).addScaledVector(Fc,h),d}intersectSphere(e,t){ts.subVectors(e.center,this.origin);const i=ts.dot(this.direction),s=ts.dot(ts)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,s=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,s=(e.min.x-h.x)*c),u>=0?(r=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(r=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(a=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,ts)!==null}intersectTriangle(e,t,i,s,r){Id.subVectors(t,e),Bc.subVectors(i,e),Ld.crossVectors(Id,Bc);let o=this.direction.dot(Ld),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ns.subVectors(this.origin,e);const l=a*this.direction.dot(Bc.crossVectors(Ns,Bc));if(l<0)return null;const c=a*this.direction.dot(Id.cross(Ns));if(c<0||l+c>o)return null;const u=-a*Ns.dot(Ld);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Xe{constructor(e,t,i,s,r,o,a,l,c,u,f,h,d,p,_,g){Xe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c,u,f,h,d,p,_,g)}set(e,t,i,s,r,o,a,l,c,u,f,h,d,p,_,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=s,m[1]=r,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=f,m[14]=h,m[3]=d,m[7]=p,m[11]=_,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Xe().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/wo.setFromMatrixColumn(e,0).length(),r=1/wo.setFromMatrixColumn(e,1).length(),o=1/wo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),f=Math.sin(r);if(e.order==="XYZ"){const h=o*u,d=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=d+p*c,t[5]=h-_*c,t[9]=-a*l,t[2]=_-h*c,t[6]=p+d*c,t[10]=o*l}else if(e.order==="YXZ"){const h=l*u,d=l*f,p=c*u,_=c*f;t[0]=h+_*a,t[4]=p*a-d,t[8]=o*c,t[1]=o*f,t[5]=o*u,t[9]=-a,t[2]=d*a-p,t[6]=_+h*a,t[10]=o*l}else if(e.order==="ZXY"){const h=l*u,d=l*f,p=c*u,_=c*f;t[0]=h-_*a,t[4]=-o*f,t[8]=p+d*a,t[1]=d+p*a,t[5]=o*u,t[9]=_-h*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const h=o*u,d=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=p*c-d,t[8]=h*c+_,t[1]=l*f,t[5]=_*c+h,t[9]=d*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const h=o*l,d=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=_-h*f,t[8]=p*f+d,t[1]=f,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=d*f+p,t[10]=h-_*f}else if(e.order==="XZY"){const h=o*l,d=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=h*f+_,t[5]=o*u,t[9]=d*f-p,t[2]=p*f-d,t[6]=a*u,t[10]=_*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(SR,e,MR)}lookAt(e,t,i){const s=this.elements;return Yn.subVectors(e,t),Yn.lengthSq()===0&&(Yn.z=1),Yn.normalize(),Us.crossVectors(i,Yn),Us.lengthSq()===0&&(Math.abs(i.z)===1?Yn.x+=1e-4:Yn.z+=1e-4,Yn.normalize(),Us.crossVectors(i,Yn)),Us.normalize(),kc.crossVectors(Yn,Us),s[0]=Us.x,s[4]=kc.x,s[8]=Yn.x,s[1]=Us.y,s[5]=kc.y,s[9]=Yn.y,s[2]=Us.z,s[6]=kc.z,s[10]=Yn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],f=i[5],h=i[9],d=i[13],p=i[2],_=i[6],g=i[10],m=i[14],y=i[3],x=i[7],v=i[11],E=i[15],T=s[0],M=s[4],P=s[8],b=s[12],S=s[1],D=s[5],B=s[9],H=s[13],$=s[2],ee=s[6],Z=s[10],te=s[14],Q=s[3],pe=s[7],ve=s[11],se=s[15];return r[0]=o*T+a*S+l*$+c*Q,r[4]=o*M+a*D+l*ee+c*pe,r[8]=o*P+a*B+l*Z+c*ve,r[12]=o*b+a*H+l*te+c*se,r[1]=u*T+f*S+h*$+d*Q,r[5]=u*M+f*D+h*ee+d*pe,r[9]=u*P+f*B+h*Z+d*ve,r[13]=u*b+f*H+h*te+d*se,r[2]=p*T+_*S+g*$+m*Q,r[6]=p*M+_*D+g*ee+m*pe,r[10]=p*P+_*B+g*Z+m*ve,r[14]=p*b+_*H+g*te+m*se,r[3]=y*T+x*S+v*$+E*Q,r[7]=y*M+x*D+v*ee+E*pe,r[11]=y*P+x*B+v*Z+E*ve,r[15]=y*b+x*H+v*te+E*se,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],h=e[10],d=e[14],p=e[3],_=e[7],g=e[11],m=e[15];return p*(+r*l*f-s*c*f-r*a*h+i*c*h+s*a*d-i*l*d)+_*(+t*l*d-t*c*h+r*o*h-s*o*d+s*c*u-r*l*u)+g*(+t*c*f-t*a*d-r*o*f+i*o*d+r*a*u-i*c*u)+m*(-s*a*u-t*l*f+t*a*h+s*o*f-i*o*h+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],_=e[13],g=e[14],m=e[15],y=f*g*c-_*h*c+_*l*d-a*g*d-f*l*m+a*h*m,x=p*h*c-u*g*c-p*l*d+o*g*d+u*l*m-o*h*m,v=u*_*c-p*f*c+p*a*d-o*_*d-u*a*m+o*f*m,E=p*f*l-u*_*l-p*a*h+o*_*h+u*a*g-o*f*g,T=t*y+i*x+s*v+r*E;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/T;return e[0]=y*M,e[1]=(_*h*r-f*g*r-_*s*d+i*g*d+f*s*m-i*h*m)*M,e[2]=(a*g*r-_*l*r+_*s*c-i*g*c-a*s*m+i*l*m)*M,e[3]=(f*l*r-a*h*r-f*s*c+i*h*c+a*s*d-i*l*d)*M,e[4]=x*M,e[5]=(u*g*r-p*h*r+p*s*d-t*g*d-u*s*m+t*h*m)*M,e[6]=(p*l*r-o*g*r-p*s*c+t*g*c+o*s*m-t*l*m)*M,e[7]=(o*h*r-u*l*r+u*s*c-t*h*c-o*s*d+t*l*d)*M,e[8]=v*M,e[9]=(p*f*r-u*_*r-p*i*d+t*_*d+u*i*m-t*f*m)*M,e[10]=(o*_*r-p*a*r+p*i*c-t*_*c-o*i*m+t*a*m)*M,e[11]=(u*a*r-o*f*r-u*i*c+t*f*c+o*i*d-t*a*d)*M,e[12]=E*M,e[13]=(u*_*s-p*f*s+p*i*h-t*_*h-u*i*g+t*f*g)*M,e[14]=(p*a*s-o*_*s-p*i*l+t*_*l+o*i*g-t*a*g)*M,e[15]=(o*f*s-u*a*s+u*i*l-t*f*l-o*i*h+t*a*h)*M,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,c=r*o,u=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,u*a+i,u*l-s*o,0,c*l-s*a,u*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,c=r+r,u=o+o,f=a+a,h=r*c,d=r*u,p=r*f,_=o*u,g=o*f,m=a*f,y=l*c,x=l*u,v=l*f,E=i.x,T=i.y,M=i.z;return s[0]=(1-(_+m))*E,s[1]=(d+v)*E,s[2]=(p-x)*E,s[3]=0,s[4]=(d-v)*T,s[5]=(1-(h+m))*T,s[6]=(g+y)*T,s[7]=0,s[8]=(p+x)*M,s[9]=(g-y)*M,s[10]=(1-(h+_))*M,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=wo.set(s[0],s[1],s[2]).length();const o=wo.set(s[4],s[5],s[6]).length(),a=wo.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],yi.copy(this);const c=1/r,u=1/o,f=1/a;return yi.elements[0]*=c,yi.elements[1]*=c,yi.elements[2]*=c,yi.elements[4]*=u,yi.elements[5]*=u,yi.elements[6]*=u,yi.elements[8]*=f,yi.elements[9]*=f,yi.elements[10]*=f,t.setFromRotationMatrix(yi),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=Mi){const l=this.elements,c=2*r/(t-e),u=2*r/(i-s),f=(t+e)/(t-e),h=(i+s)/(i-s);let d,p;if(a===Mi)d=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===Bl)d=-o/(o-r),p=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=Mi){const l=this.elements,c=1/(t-e),u=1/(i-s),f=1/(o-r),h=(t+e)*c,d=(i+s)*u;let p,_;if(a===Mi)p=(o+r)*f,_=-2*f;else if(a===Bl)p=r*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=_,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const wo=new F,yi=new Xe,SR=new F(0,0,0),MR=new F(1,1,1),Us=new F,kc=new F,Yn=new F,R0=new Xe,P0=new Wn;class ei{constructor(e=0,t=0,i=0,s=ei.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],u=s[9],f=s[2],h=s[6],d=s[10];switch(t){case"XYZ":this._y=Math.asin(Ke(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ke(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ke(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Ke(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ke(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Ke(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return R0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(R0,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return P0.setFromEuler(this),this.setFromQuaternion(P0,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ei.DEFAULT_ORDER="XYZ";class Ph{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),d.length>0&&(i.animations=d),p.length>0&&(i.nodes=p)}return i.object=s,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){xi.subVectors(s,t),is.subVectors(i,t),Od.subVectors(e,t);const o=xi.dot(xi),a=xi.dot(is),l=xi.dot(Od),c=is.dot(is),u=is.dot(Od),f=o*c-a*a;if(f===0)return r.set(0,0,0),null;const h=1/f,d=(c*l-a*u)*h,p=(o*u-a*l)*h;return r.set(1-d-p,p,d)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,ss)===null?!1:ss.x>=0&&ss.y>=0&&ss.x+ss.y<=1}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,ss)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,ss.x),l.addScaledVector(o,ss.y),l.addScaledVector(a,ss.z),l)}static getInterpolatedAttribute(e,t,i,s,r,o){return Bd.setScalar(0),kd.setScalar(0),Vd.setScalar(0),Bd.fromBufferAttribute(e,t),kd.fromBufferAttribute(e,i),Vd.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(Bd,r.x),o.addScaledVector(kd,r.y),o.addScaledVector(Vd,r.z),o}static isFrontFacing(e,t,i,s){return xi.subVectors(i,t),is.subVectors(e,t),xi.cross(is).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return xi.subVectors(this.c,this.b),is.subVectors(this.a,this.b),xi.cross(is).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,s,r){return zn.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;Ro.subVectors(s,i),Po.subVectors(r,i),Nd.subVectors(e,i);const l=Ro.dot(Nd),c=Po.dot(Nd);if(l<=0&&c<=0)return t.copy(i);Ud.subVectors(e,s);const u=Ro.dot(Ud),f=Po.dot(Ud);if(u>=0&&f<=u)return t.copy(s);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Ro,o);Fd.subVectors(e,r);const d=Ro.dot(Fd),p=Po.dot(Fd);if(p>=0&&d<=p)return t.copy(r);const _=d*c-l*p;if(_<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(i).addScaledVector(Po,a);const g=u*p-d*f;if(g<=0&&f-u>=0&&d-p>=0)return U0.subVectors(r,s),a=(f-u)/(f-u+(d-p)),t.copy(s).addScaledVector(U0,a);const m=1/(g+_+h);return o=_*m,a=h*m,t.copy(i).addScaledVector(Ro,o).addScaledVector(Po,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ZS={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},Fs={h:0,s:0,l:0},zc={h:0,s:0,l:0};function zd(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class we{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Cn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,at.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=at.workingColorSpace){return this.r=e,this.g=t,this.b=i,at.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=at.workingColorSpace){if(e=wg(e,1),t=Ke(t,0,1),i=Ke(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=zd(o,r,e+1/3),this.g=zd(o,r,e),this.b=zd(o,r,e-1/3)}return at.toWorkingColorSpace(this,s),this}setStyle(e,t=Cn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Cn){const i=ZS[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=xs(e.r),this.g=xs(e.g),this.b=xs(e.b),this}copyLinearToSRGB(e){return this.r=ea(e.r),this.g=ea(e.g),this.b=ea(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cn){return at.fromWorkingColorSpace(hn.copy(this),e),Math.round(Ke(hn.r*255,0,255))*65536+Math.round(Ke(hn.g*255,0,255))*256+Math.round(Ke(hn.b*255,0,255))}getHexString(e=Cn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=at.workingColorSpace){at.fromWorkingColorSpace(hn.copy(this),t);const i=hn.r,s=hn.g,r=hn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case i:l=(s-r)/f+(s0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Qr&&(i.blending=this.blending),this.side!==Ms&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==uf&&(i.blendSrc=this.blendSrc),this.blendDst!==ff&&(i.blendDst=this.blendDst),this.blendEquation!==Ks&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==oo&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Zp&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==kr&&(i.stencilFail=this.stencilFail),this.stencilZFail!==kr&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==kr&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Rs extends xn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new we(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ei,this.combine=cc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const ds=RR();function RR(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),s=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,s[l]=24,s[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,r[l]=c|u}for(let l=1024;l<2048;++l)r[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function Bn(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Ke(n,-65504,65504),ds.floatView[0]=n;const e=ds.uint32View[0],t=e>>23&511;return ds.baseTable[t]+((e&8388607)>>ds.shiftTable[t])}function Xa(n){const e=n>>10;return ds.uint32View[0]=ds.mantissaTable[ds.offsetTable[e]+(n&1023)]+ds.exponentTable[e],ds.floatView[0]}class PR{static toHalfFloat(e){return Bn(e)}static fromHalfFloat(e){return Xa(e)}}const Wt=new F,Hc=new fe;let IR=0;class Et{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:IR++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Fl,this.updateRanges=[],this.gpuType=Hn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;st.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new On);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,s=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const s=e.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(t))}const r=e.morphAttributes;for(const c in r){const u=[],f=r[c];for(let h=0,d=f.length;h0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(F0.copy(r).invert(),Tr.copy(e.ray).applyMatrix4(F0),!(i.boundingBox!==null&&Tr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Tr)))}_computeIntersections(e,t,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,f=r.attributes.normal,h=r.groups,d=r.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,_=h.length;p<_;p++){const g=h[p],m=o[g.materialIndex],y=Math.max(g.start,d.start),x=Math.min(a.count,Math.min(g.start+g.count,d.start+d.count));for(let v=y,E=x;vt.far?null:{distance:c,point:Yc.clone(),object:n}}function jc(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,Wc),n.getVertexPosition(l,Xc),n.getVertexPosition(c,$c);const u=kR(n,e,t,i,Wc,Xc,$c,k0);if(u){const f=new F;zn.getBarycoord(k0,Wc,Xc,$c,f),s&&(u.uv=zn.getInterpolatedAttribute(s,a,l,c,f,new fe)),r&&(u.uv1=zn.getInterpolatedAttribute(r,a,l,c,f,new fe)),o&&(u.normal=zn.getInterpolatedAttribute(o,a,l,c,f,new F),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new F,materialIndex:0};zn.getNormal(Wc,Xc,$c,h.normal),u.face=h,u.barycoord=f}return u}class mo extends rt{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],f=[];let h=0,d=0;p("z","y","x",-1,-1,i,t,e,o,r,0),p("z","y","x",1,-1,i,t,-e,o,r,1),p("x","z","y",1,1,e,i,t,s,o,2),p("x","z","y",1,-1,e,i,-t,s,o,3),p("x","y","z",1,-1,e,t,i,s,r,4),p("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new Ue(c,3)),this.setAttribute("normal",new Ue(u,3)),this.setAttribute("uv",new Ue(f,2));function p(_,g,m,y,x,v,E,T,M,P,b){const S=v/M,D=E/P,B=v/2,H=E/2,$=T/2,ee=M+1,Z=P+1;let te=0,Q=0;const pe=new F;for(let ve=0;ve0?1:-1,u.push(pe.x,pe.y,pe.z),f.push(xe/M),f.push(1-ve/P),te+=1}}for(let ve=0;ve0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class hc extends ct{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Xe,this.projectionMatrix=new Xe,this.projectionMatrixInverse=new Xe,this.coordinateSystem=Mi}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Br=new F,Vv=new fe,zv=new fe;class $t extends hc{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=aa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(to*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return aa*2*Math.atan(Math.tan(to*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Br.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Br.x,Br.y).multiplyScalar(-e/Br.z),Br.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Br.x,Br.y).multiplyScalar(-e/Br.z)}getViewSize(e,t){return this.getViewBounds(e,Vv,zv),t.subVectors(zv,Vv)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(to*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Lo=-90,Do=1;class eM extends ct{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new $t(Lo,Do,e,t);r.layers=this.layers,this.add(r);const s=new $t(Lo,Do,e,t);s.layers=this.layers,this.add(s);const o=new $t(Lo,Do,e,t);o.layers=this.layers,this.add(o);const a=new $t(Lo,Do,e,t);a.layers=this.layers,this.add(a);const l=new $t(Lo,Do,e,t);l.layers=this.layers,this.add(l);const c=new $t(Lo,Do,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Mi)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Bl)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(f,h,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class dc extends Vt{constructor(e,t,i,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:Er,super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class tM extends Yi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new dc(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:jt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Ri extends xn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=zR,this.fragmentShader=HR,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=la(e.uniforms),this.uniformsGroups=VR(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class hc extends ct{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Xe,this.projectionMatrix=new Xe,this.projectionMatrixInverse=new Xe,this.coordinateSystem=Mi}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Bs=new F,V0=new fe,z0=new fe;class $t extends hc{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=aa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(to*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return aa*2*Math.atan(Math.tan(to*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Bs.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Bs.x,Bs.y).multiplyScalar(-e/Bs.z),Bs.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Bs.x,Bs.y).multiplyScalar(-e/Bs.z)}getViewSize(e,t){return this.getViewBounds(e,V0,z0),t.subVectors(z0,V0)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(to*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Lo=-90,Do=1;class eM extends ct{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new $t(Lo,Do,e,t);s.layers=this.layers,this.add(s);const r=new $t(Lo,Do,e,t);r.layers=this.layers,this.add(r);const o=new $t(Lo,Do,e,t);o.layers=this.layers,this.add(o);const a=new $t(Lo,Do,e,t);a.layers=this.layers,this.add(a);const l=new $t(Lo,Do,e,t);l.layers=this.layers,this.add(l);const c=new $t(Lo,Do,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const c of t)this.remove(c);if(e===Mi)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Bl)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,s),e.render(t,u),e.setRenderTarget(f,h,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class dc extends Vt{constructor(e,t,i,s,r,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:Es,super(e,t,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class tM extends Yi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];this.texture=new dc(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:jt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -58,11 +58,11 @@ var fw=Object.defineProperty;var hw=(n,e,t)=>e in n?fw(n,e,{enumerable:!0,config gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new mo(5,5,5),s=new Ri({name:"CubemapFromEquirect",uniforms:la(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Dn,blending:yr});s.uniforms.tEquirect.value=t;const o=new Ht(r,s),a=t.minFilter;return t.minFilter===Vi&&(t.minFilter=jt),new eM(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}class qo extends ct{constructor(){super(),this.isGroup=!0,this.type="Group"}}const GR={type:"move"};class Wu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new qo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new qo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new qo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,i),m=this._getHandJoint(c,_);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),d=.02,p=.005;c.inputState.pinching&&h>d+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=d-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(GR)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new qo;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class Ih{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new we(e),this.density=t}clone(){return new Ih(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Lh{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new we(e),this.near=t,this.far=i}clone(){return new Lh(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Dh extends ct{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ei,this.environmentIntensity=1,this.environmentRotation=new ei,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Oh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fl,this.updateRanges=[],this.version=0,this.uuid=Zn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:Ia.clone(),uv:zn.getInterpolation(Ia,Kc,Da,Zc,Hv,Wd,Gv,new fe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Jc(n,e,t,i,r,s){Fo.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(La.x=s*Fo.x-r*Fo.y,La.y=r*Fo.x+s*Fo.y):La.copy(Fo),n.copy(e),n.x+=La.x,n.y+=La.y,n.applyMatrix4(nM)}const Qc=new F,Wv=new F;class rM extends ct{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Qc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Qc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Qc.setFromMatrixPosition(e.matrixWorld),Wv.setFromMatrixPosition(this.matrixWorld);const i=Qc.distanceTo(Wv)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||YR.getNormalMatrix(e),r=this.coplanarPoint(qd).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ws=new _n,nu=new F;class pc{constructor(e=new Yr,t=new Yr,i=new Yr,r=new Yr,s=new Yr,o=new Yr){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Mi){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],f=r[6],h=r[7],d=r[8],p=r[9],_=r[10],g=r[11],m=r[12],y=r[13],x=r[14],v=r[15];if(i[0].setComponents(l-s,h-c,g-d,v-m).normalize(),i[1].setComponents(l+s,h+c,g+d,v+m).normalize(),i[2].setComponents(l+o,h+u,g+p,v+y).normalize(),i[3].setComponents(l-o,h-u,g-p,v-y).normalize(),i[4].setComponents(l-a,h-f,g-_,v-x).normalize(),t===Mi)i[5].setComponents(l+a,h+f,g+_,v+x).normalize();else if(t===Bl)i[5].setComponents(a,f,_,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ws.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ws.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ws)}intersectsSprite(e){return ws.center.set(0,0,0),ws.radius=.7071067811865476,ws.applyMatrix4(e.matrixWorld),this.intersectsSphere(ws)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,nu.y=r.normal.y>0?e.max.y:e.min.y,nu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(nu)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Yd(n,e){return n-e}function jR(n,e){return n.z-e.z}function KR(n,e){return e.z-n.z}class ZR{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,r){const s=this.pool,o=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const a=s[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=r}reset(){this.list.length=0,this.index=0}}const Fn=new Xe,JR=new we(1,1,1),jd=new pc,iu=new On,As=new _n,Ua=new F,Qv=new F,QR=new F,Kd=new ZR,dn=new Ht,ru=[];function eP(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Et(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new On);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Yd),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=i):(r=this._instanceInfo.length,this._instanceInfo.push(i));const s=this._matricesTexture;Fn.identity().toArray(s.image.data,r*16),s.needsUpdate=!0;const o=this._colorsTexture;return o&&(JR.toArray(o.image.data,r*4),o.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=i===-1?o.count:i),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Yd),l=this._availableGeometryIds.shift(),s[l]=r):(l=this._geometryCount,this._geometryCount++,s.push(r)),this.setGeometryAt(l,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(r&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const u in i.attributes){const f=t.getAttribute(u),h=i.getAttribute(u);eP(f,h,l);const d=f.itemSize;for(let p=f.count,_=c;p<_;p++){const g=l+p;for(let m=0;m=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let r=0,s=i.length;ra).sort((o,a)=>i[o].vertexStart-i[a].vertexStart),s=this.geometry;for(let o=0,a=i.length;o=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const s=new On,o=i.index,a=i.attributes.position;for(let l=r.start,c=r.start+r.count;l=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const s=new _n;this.getBoundingBoxAt(e,iu),iu.getCenter(s.center);const o=i.index,a=i.attributes.position;let l=0;for(let c=r.start,u=r.start+r.count;ca.active);if(Math.max(...i.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new st,this._initializeGeometry(s));const o=this.geometry;s.index&&Cs(s.index.array,o.index.array);for(const a in s.attributes)Cs(s.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,r=this._geometryInfo,s=this.matrixWorld,o=this.geometry;dn.material=this.material,dn.geometry.index=o.index,dn.geometry.attributes=o.attributes,dn.geometry.boundingBox===null&&(dn.geometry.boundingBox=new On),dn.geometry.boundingSphere===null&&(dn.geometry.boundingSphere=new _n);for(let a=0,l=i.length;a({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data;h&&(Fn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),jd.setFromProjectionMatrix(Fn,e.coordinateSystem));let _=0;if(this.sortObjects){Fn.copy(this.matrixWorld).invert(),Ua.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Fn),Qv.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Fn);for(let y=0,x=l.length;y0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;Zd.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Zd);if(!(ce.far))return{distance:c,point:t0.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const n0=new F,i0=new F;class Ki extends ss{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class uM extends Vt{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:jt,this.magFilter=s!==void 0?s:jt,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class tP extends uM{constructor(e,t,i,r,s,o,a,l){super({},e,t,i,r,s,o,a,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class nP extends Vt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=cn,this.minFilter=cn,this.generateMipmaps=!1,this.needsUpdate=!0}}class Uh extends Vt{constructor(e,t,i,r,s,o,a,l,c,u,f,h){super(null,o,a,l,c,u,r,s,f,h),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class iP extends Uh{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=li,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class rP extends Uh{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Er),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class sP extends Vt{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Dg extends Vt{constructor(e,t,i,r,s,o,a,l,c,u=eo){if(u!==eo&&u!==lo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===eo&&(i=Tr),i===void 0&&u===lo&&(i=ao),super(null,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:cn,this.minFilter=l!==void 0?l:cn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Zr(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Li{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],h=i[r+1]-u,d=(o-u)/h;return(r+d)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new fe:new F);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new F,r=[],s=[],o=[],a=new F,l=new Xe;for(let d=0;d<=e;d++){const p=d/e;r[d]=this.getTangentAt(p,new F)}s[0]=new F,o[0]=new F;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),f=Math.abs(r[0].y),h=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),h<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let d=1;d<=e;d++){if(s[d]=s[d-1].clone(),o[d]=o[d-1].clone(),a.crossVectors(r[d-1],r[d]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(Ke(r[d-1].dot(r[d]),-1,1));s[d].applyMatrix4(l.makeRotationAxis(a,p))}o[d].crossVectors(r[d],s[d])}if(t===!0){let d=Math.acos(Ke(s[0].dot(s[e]),-1,1));d/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(d=-d);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(r[p],d*p)),o[p].crossVectors(r[p],s[p])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Fh extends Li{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new fe){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(cu.subVectors(r[0],r[1]).add(r[0]),c=cu);const f=r[a%s],h=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],f=r[o>r.length-3?r.length-1:o+2];return i.set(o0(a,l.x,c.x,u.x,f.x),o0(a,l.y,c.y,u.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mc extends st{constructor(e=[new fe(0,-.5),new fe(.5,0),new fe(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=Ke(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,f=new F,h=new fe,d=new F,p=new F,_=new F;let g=0,m=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,d.x=m*1,d.y=-g,d.z=m*0,_.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,d.x=m*1,d.y=-g,d.z=m*0,p.copy(d),d.x+=_.x,d.y+=_.y,d.z+=_.z,d.normalize(),l.push(d.x,d.y,d.z),_.copy(p)}for(let y=0;y<=t;y++){const x=i+y*u*r,v=Math.sin(x),E=Math.cos(x);for(let T=0;T<=e.length-1;T++){f.x=e[T].x*v,f.y=e[T].y,f.z=e[T].x*E,o.push(f.x,f.y,f.z),h.x=y/t,h.y=T/(e.length-1),a.push(h.x,h.y);const M=l[3*T+0]*v,P=l[3*T+1],b=l[3*T+0]*E;c.push(M,P,b)}}for(let y=0;y0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new Ue(f,3)),this.setAttribute("normal",new Ue(h,3)),this.setAttribute("uv",new Ue(d,2));function y(){const v=new F,E=new F;let T=0;const M=(t-e)/i;for(let P=0;P<=s;P++){const b=[],S=P/s,D=S*(t-e)+e;for(let B=0;B<=r;B++){const H=B/r,$=H*l+a,ee=Math.sin($),Z=Math.cos($);E.x=D*ee,E.y=-S*i+g,E.z=D*Z,f.push(E.x,E.y,E.z),v.set(ee,M,Z).normalize(),h.push(v.x,v.y,v.z),d.push(H,1-S),b.push(p++)}_.push(b)}for(let P=0;P0||b!==0)&&(u.push(S,D,H),T+=3),(t>0||b!==s-1)&&(u.push(D,B,H),T+=3)}c.addGroup(m,T,0),m+=T}function x(v){const E=p,T=new fe,M=new F;let P=0;const b=v===!0?e:t,S=v===!0?1:-1;for(let B=1;B<=r;B++)f.push(0,g*S,0),h.push(0,S,0),d.push(.5,.5),p++;const D=p;for(let B=0;B<=r;B++){const $=B/r*l+a,ee=Math.cos($),Z=Math.sin($);M.x=b*Z,M.y=g*S,M.z=b*ee,f.push(M.x,M.y,M.z),h.push(0,S,0),T.x=ee*.5+.5,T.y=Z*.5*S+.5,d.push(T.x,T.y),p++}for(let B=0;B.9&&M<.1&&(x<.2&&(o[y+0]+=1),v<.2&&(o[y+2]+=1),E<.2&&(o[y+4]+=1))}}function h(y){s.push(y.x,y.y,y.z)}function d(y,x){const v=y*3;x.x=e[v+0],x.y=e[v+1],x.z=e[v+2]}function p(){const y=new F,x=new F,v=new F,E=new F,T=new fe,M=new fe,P=new fe;for(let b=0,S=0;b80*i){l=u=e[0],c=f=e[1];for(let _=i;_u&&(u=h),d>f&&(f=d);p=Math.max(u-l,f-c),p=p!==0?32767/p:0}return zl(o,a,i,l,c,p,0),a}}function _M(n,e,t,i,r){let s,o;if(r===RP(n,e,t,i)>0)for(s=e;s=e;s-=i)o=a0(s,n[s],n[s+1],o);return o&&Hh(o,o.next)&&(Gl(o),o=o.next),o}function fo(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Hh(t,t.next)||Ut(t.prev,t,t.next)===0)){if(Gl(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function zl(n,e,t,i,r,s,o){if(!n)return;!o&&s&&MP(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?mP(n,i,r,s):pP(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),Gl(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=gP(fo(n),e,t),zl(n,e,t,i,r,s,2)):o===2&&_P(n,e,t,i,r,s):zl(fo(n),e,t,i,r,s,1);break}}}function pP(n){const e=n.prev,t=n,i=n.next;if(Ut(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=rs?r>o?r:o:s>o?s:o,d=a>l?a>c?a:c:l>c?l:c;let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=h&&p.y>=f&&p.y<=d&&Yo(r,a,s,l,o,c,p.x,p.y)&&Ut(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function mP(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Ut(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,f=s.y,h=o.y,d=al?a>c?a:c:l>c?l:c,g=u>f?u>h?u:h:f>h?f:h,m=em(d,p,e,t,i),y=em(_,g,e,t,i);let x=n.prevZ,v=n.nextZ;for(;x&&x.z>=m&&v&&v.z<=y;){if(x.x>=d&&x.x<=_&&x.y>=p&&x.y<=g&&x!==r&&x!==o&&Yo(a,u,l,f,c,h,x.x,x.y)&&Ut(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==r&&v!==o&&Yo(a,u,l,f,c,h,v.x,v.y)&&Ut(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=m;){if(x.x>=d&&x.x<=_&&x.y>=p&&x.y<=g&&x!==r&&x!==o&&Yo(a,u,l,f,c,h,x.x,x.y)&&Ut(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=y;){if(v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==r&&v!==o&&Yo(a,u,l,f,c,h,v.x,v.y)&&Ut(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function gP(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Hh(r,s)&&vM(r,i,i.next,s)&&Hl(r,s)&&Hl(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Gl(i),Gl(i.next),i=n=s),i=i.next}while(i!==n);return fo(i)}function _P(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&wP(o,a)){let l=yM(o,a);o=fo(o,o.next),l=fo(l,l.next),zl(o,e,t,i,r,s,0),zl(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function vP(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const h=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=s&&h>i&&(i=h,r=t.x=t.x&&t.x>=l&&s!==t.x&&Yo(or.x||t.x===r.x&&SP(r,t)))&&(r=t,u=f)),t=t.next;while(t!==a);return r}function SP(n,e){return Ut(n.prev,n,e.prev)<0&&Ut(e.next,n,n.next)<0}function MP(n,e,t,i){let r=n;do r.z===0&&(r.z=em(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,EP(r)}function EP(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function em(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function TP(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function wP(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!AP(n,e)&&(Hl(n,e)&&Hl(e,n)&&CP(n,e)&&(Ut(n.prev,n,e.prev)||Ut(n,e.prev,e))||Hh(n,e)&&Ut(n.prev,n,n.next)>0&&Ut(e.prev,e,e.next)>0)}function Ut(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Hh(n,e){return n.x===e.x&&n.y===e.y}function vM(n,e,t,i){const r=pu(Ut(n,e,t)),s=pu(Ut(n,e,i)),o=pu(Ut(t,i,n)),a=pu(Ut(t,i,e));return!!(r!==s&&o!==a||r===0&&du(n,t,e)||s===0&&du(n,i,e)||o===0&&du(t,n,i)||a===0&&du(t,e,i))}function du(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function pu(n){return n>0?1:n<0?-1:0}function AP(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&vM(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Hl(n,e){return Ut(n.prev,n,n.next)<0?Ut(n,e,n.next)>=0&&Ut(n,n.prev,e)>=0:Ut(n,e,n.prev)<0||Ut(n,n.next,e)<0}function CP(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function yM(n,e){const t=new tm(n.i,n.x,n.y),i=new tm(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function a0(n,e,t,i){const r=new tm(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Gl(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function tm(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function RP(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function c0(n,e){for(let t=0;tNumber.EPSILON){const U=Math.sqrt(C),z=Math.sqrt(V*V+A*A),Y=L.x-N/U,he=L.y+R/U,ce=w.x-A/z,ye=w.y+V/z,Fe=((ce-Y)*A-(ye-he)*V)/(R*A-N*V);j=Y+R*Fe-I.x,G=he+N*Fe-I.y;const me=j*j+G*G;if(me<=2)return new fe(j,G);q=Math.sqrt(me/2)}else{let U=!1;R>Number.EPSILON?V>Number.EPSILON&&(U=!0):R<-Number.EPSILON?V<-Number.EPSILON&&(U=!0):Math.sign(N)===Math.sign(A)&&(U=!0),U?(j=-N,G=R,q=Math.sqrt(C)):(j=R,G=N,q=Math.sqrt(C/2))}return new fe(j/q,G/q)}const pe=[];for(let I=0,L=$.length,w=L-1,j=I+1;I=0;I--){const L=I/g,w=d*Math.cos(L*Math.PI/2),j=p*Math.sin(L*Math.PI/2)+_;for(let G=0,q=$.length;G=0;){const j=w;let G=w-1;G<0&&(G=I.length-1);for(let q=0,R=u+g*2;q0)&&d.push(x,v,T),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class EM extends xn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new we(16777215),this.specular=new we(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=us,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ei,this.combine=cc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class TM extends xn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new we(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=us,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class wM extends xn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=us,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class AM extends xn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new we(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=us,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ei,this.combine=cc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class zg extends xn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BS,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Hg extends xn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class CM extends xn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new we(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=us,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class RM extends Nn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function js(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function PM(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function IM(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function nm(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function Gg(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push(...o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function DP(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){f.push(c.times[d]);for(let _=0;_s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){const m=p*f+u,y=m+f-u;_=a.values.slice(m,y)}else{const m=a.createInterpolant(),y=u,x=f-u;m.evaluate(s),_=m.resultBuffer.slice(y,x)}l==="quaternion"&&new Wn().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let m=0;m=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&PM(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Gu,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Di.prototype.TimeBufferType=Float32Array;Di.prototype.ValueBufferType=Float32Array;Di.prototype.DefaultInterpolation=Xf;class go extends Di{constructor(e,t,i){super(e,t,i)}}go.prototype.ValueTypeName="bool";go.prototype.ValueBufferType=Array;go.prototype.DefaultInterpolation=Ol;go.prototype.InterpolantFactoryMethodLinear=void 0;go.prototype.InterpolantFactoryMethodSmooth=void 0;class Xg extends Di{}Xg.prototype.ValueTypeName="color";class Wl extends Di{}Wl.prototype.ValueTypeName="number";class OM extends vc{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)Wn.slerpFlat(s,0,o,c-a,o,c,l);return s}}class yc extends Di{InterpolantFactoryMethodLinear(e){return new OM(this.times,this.values,this.getValueSize(),e)}}yc.prototype.ValueTypeName="quaternion";yc.prototype.InterpolantFactoryMethodSmooth=void 0;class _o extends Di{constructor(e,t,i){super(e,t,i)}}_o.prototype.ValueTypeName="string";_o.prototype.ValueBufferType=Array;_o.prototype.DefaultInterpolation=Ol;_o.prototype.InterpolantFactoryMethodLinear=void 0;_o.prototype.InterpolantFactoryMethodSmooth=void 0;class Xl extends Di{}Xl.prototype.ValueTypeName="vector";class $l{constructor(e="",t=-1,i=[],r=Ah){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Zn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(FP(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Di.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const f=u[1];let h=r[f];h||(r[f]=h=[]),h.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,h,d,p,_){if(d.length!==0){const g=[],m=[];Gg(d,g,m,p),g.length!==0&&_.push(new f(h,g,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{t&&t(s),this.manager.itemEnd(e)},0),s;if(sr[e]!==void 0){sr[e].push({onLoad:t,onProgress:i,onError:r});return}sr[e]=[],sr[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=sr[e],f=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=h?parseInt(h):0,p=d!==0;let _=0;const g=new ReadableStream({start(m){y();function y(){f.read().then(({done:x,value:v})=>{if(x)m.close();else{_+=v.byteLength;const E=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:d});for(let T=0,M=u.length;T{m.error(x)})}}});return new Response(g)}else throw new BP(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),h=f&&f[1]?f[1].toLowerCase():void 0,d=new TextDecoder(h);return c.arrayBuffer().then(p=>d.decode(p))}}}).then(c=>{mr.add(e,c);const u=sr[e];delete sr[e];for(let f=0,h=u.length;f{const u=sr[e];if(u===void 0)throw this.manager.itemError(e),c;delete sr[e];for(let f=0,h=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class kP extends $n{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new wr(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new we().setHex(o.value);break;case"v2":r.uniforms[s].value=new fe().fromArray(o.value);break;case"v3":r.uniforms[s].value=new F().fromArray(o.value);break;case"v4":r.uniforms[s].value=new ht().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Qe().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Xe().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new fe().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new fe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Jh.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:bM,SpriteMaterial:Pg,RawShaderMaterial:SM,ShaderMaterial:Ri,PointsMaterial:Lg,MeshPhysicalMaterial:MM,MeshStandardMaterial:Vg,MeshPhongMaterial:EM,MeshToonMaterial:TM,MeshNormalMaterial:wM,MeshLambertMaterial:AM,MeshDepthMaterial:zg,MeshDistanceMaterial:Hg,MeshBasicMaterial:Rr,MeshMatcapMaterial:CM,LineDashedMaterial:RM,LineBasicMaterial:Nn,Material:xn};return new t[e]}}class im{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new $g(t);s=new ql(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){r=new ql(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const g=new On;g.min.fromArray(_.boxMin),g.max.fromArray(_.boxMax);const m=new _n;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:g,sphereInitialized:_.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new rM;break;case"Line":o=new ss(a(e.geometry),l(e.material));break;case"LineLoop":o=new lM(a(e.geometry),l(e.material));break;case"LineSegments":o=new Ki(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new cM(a(e.geometry),l(e.material));break;case"Sprite":o=new iM(l(e.material));break;case"Group":o=new qo;break;case"Bone":o=new Ig;break;default:o=new ct}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const h=e.children;for(let d=0;d"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=mr.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return mr.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),mr.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});mr.add(e,l),s.manager.itemStart(e)}}let mu;class Yg{static getContext(){return mu===void 0&&(mu=new(window.AudioContext||window.webkitAudioContext)),mu}static setContext(e){mu=e}}class KP extends $n{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new wr(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);Yg.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const _0=new Xe,v0=new Xe,Rs=new Xe;class ZP{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new $t,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new $t,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Rs.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(to*t.fov*.5)/t.zoom;let a,l;v0.elements[12]=-r,_0.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Rs.elements[0]=2*t.near/(l-a),Rs.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Rs),a=-o*t.aspect-s,l=o*t.aspect-s,Rs.elements[0]=2*t.near/(l-a),Rs.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Rs)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(v0),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(_0)}}class $M extends $t{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e,this.index=0}}class Qh{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=y0(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=y0();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function y0(){return performance.now()}const Ps=new F,x0=new Wn,JP=new F,Is=new F;class QP extends ct{constructor(){super(),this.type="AudioListener",this.context=Yg.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Qh}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ps,x0,JP),Is.set(0,0,-1).applyQuaternion(x0),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Ps.x,r),t.positionY.linearRampToValueAtTime(Ps.y,r),t.positionZ.linearRampToValueAtTime(Ps.z,r),t.forwardX.linearRampToValueAtTime(Is.x,r),t.forwardY.linearRampToValueAtTime(Is.y,r),t.forwardZ.linearRampToValueAtTime(Is.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Ps.x,Ps.y,Ps.z),t.setOrientation(Is.x,Is.y,Is.z,i.x,i.y,i.z)}}class qM extends ct{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Wn.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Wn.multiplyQuaternionsFlat(e,o,e,t,e,i),Wn.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const jg="\\[\\]\\.:\\/",iI=new RegExp("["+jg+"]","g"),Kg="[^"+jg+"]",rI="[^"+jg.replace("\\.","")+"]",sI=/((?:WC+[\/:])*)/.source.replace("WC",Kg),oI=/(WCOD+)?/.source.replace("WCOD",rI),aI=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kg),lI=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kg),cI=new RegExp("^"+sI+oI+aI+lI+"$"),uI=["material","materials","bones","map"];class fI{constructor(e,t,i){const r=i||ft.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class ft{constructor(e,t,i){this.path=t,this.parsedPath=i||ft.parseTrackName(t),this.node=ft.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new ft.Composite(e,t,i):new ft(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(iI,"")}static parseTrackName(e){const t=cI.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);uI.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const f=s++,h=e[f];t[h.uuid]=u,e[u]=h,t[c]=f,e[f]=l;for(let d=0,p=r;d!==p;++d){const _=i[d],g=_[f],m=_[u];_[u]=g,_[f]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,f=t[u];if(f!==void 0)if(delete t[u],f0&&(t[d.uuid]=f),e[f]=d,e.pop();for(let p=0,_=r;p!==_;++p){const g=i[p];g[f]=g[h],g.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(f);for(let h=u,d=l.length;h!==d;++h){const p=l[h];f[h]=new ft(p,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class jM{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qs,endingEnd:qs};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=US,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Eg:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case Ah:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===FS;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===NS){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Ys,r.endingEnd=Ys):(e?r.endingStart=this.zeroSlopeAtStart?Ys:qs:r.endingStart=Nl,t?r.endingEnd=this.zeroSlopeAtEnd?Ys:qs:r.endingEnd=Nl)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const dI=new Float32Array(1);class pI extends ji{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==s;++f){const h=r[f],d=h.name;let p=u[d];if(p!==void 0)++p.referenceCount,o[f]=p;else{if(p=o[f],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,d));continue}const _=t&&t._propertyBindings[f].binding.parsedPath;p=new YM(ft.create(i,d,_),h.ValueTypeName,h.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,d),o[f]=p}a[f].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,E0).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const T0=new F,gu=new F;class EI{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){T0.subVectors(e,this.start),gu.subVectors(this.end,this.start);const i=gu.dot(gu);let s=gu.dot(T0)/i;return t&&(s=Ke(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const w0=new F;class TI extends ct{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new st,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{I0.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(I0,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class BI extends Ki{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new st;r.setAttribute("position",new Ue(t,3)),r.setAttribute("color",new Ue(i,3));const s=new Nn({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new we,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class kI{constructor(){this.type="ShapePath",this.color=new we,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Vl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const y=[];for(let x=0,v=m.length;xNumber.EPSILON){if(S<0&&(M=y[T],b=-b,P=y[E],S=-S),m.yP.y)continue;if(m.y===M.y){if(m.x===M.x)return!0}else{const D=S*(m.x-M.x)-b*(m.y-M.y);if(D===0)return!0;if(D<0)continue;v=!v}}else{if(m.y!==M.y)continue;if(P.x<=m.x&&m.x<=M.x||M.x<=m.x&&m.x<=P.x)return!0}}return v}const r=Wi.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new no,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const f=[],h=[];let d=[],p=0,_;h[p]=void 0,d[p]=[];for(let m=0,y=s.length;m1){let m=!1,y=0;for(let x=0,v=h.length;x0&&m===!1&&(d=f)}let g;for(let m=0,y=h.length;me?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function HI(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function GI(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function sm(n,e,t,i){const r=WI(i);switch(t){case vg:return n*e;case xg:return n*e;case bg:return n*e*2;case Eh:return n*e/r.components*r.byteLength;case uc:return n*e/r.components*r.byteLength;case Sg:return n*e*2/r.components*r.byteLength;case Th:return n*e*2/r.components*r.byteLength;case yg:return n*e*3/r.components*r.byteLength;case Ln:return n*e*4/r.components*r.byteLength;case wh:return n*e*4/r.components*r.byteLength;case el:case tl:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case nl:case il:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case xf:case Sf:return Math.max(n,16)*Math.max(e,8)/4;case yf:case bf:return Math.max(n,8)*Math.max(e,8)/2;case Mf:case Ef:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Tf:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case wf:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Af:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case Cf:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case Rf:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case Pf:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case If:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case Lf:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case Df:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Of:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Nf:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Uf:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Ff:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Bf:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case kf:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case rl:case Vf:case zf:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Mg:case Hf:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Gf:case Wf:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function WI(n){switch(n){case qi:case mg:return{byteLength:1,components:1};case oa:case gg:case va:return{byteLength:2,components:1};case Sh:case Mh:return{byteLength:2,components:4};case Tr:case bh:case Hn:return{byteLength:4,components:1};case _g:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class XI{static contain(e,t){return zI(e,t)}static cover(e,t){return HI(e,t)}static fill(e){return GI(e)}static getByteLength(e,t,i,r){return sm(e,t,i,r)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:lc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=lc);/** + `},s=new mo(5,5,5),r=new Ri({name:"CubemapFromEquirect",uniforms:la(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Dn,blending:ys});r.uniforms.tEquirect.value=t;const o=new Ht(s,r),a=t.minFilter;return t.minFilter===Vi&&(t.minFilter=jt),new eM(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,s){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}class qo extends ct{constructor(){super(),this.isGroup=!0,this.type="Group"}}const GR={type:"move"};class Wu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new qo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new qo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new qo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,i),m=this._getHandJoint(c,_);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),d=.02,p=.005;c.inputState.pinching&&h>d+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=d-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(GR)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new qo;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class Ih{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new we(e),this.density=t}clone(){return new Ih(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Lh{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new we(e),this.near=t,this.far=i}clone(){return new Lh(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Dh extends ct{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ei,this.environmentIntensity=1,this.environmentRotation=new ei,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Oh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fl,this.updateRanges=[],this.version=0,this.uuid=Zn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;se.far||t.push({distance:l,point:Ia.clone(),uv:zn.getInterpolation(Ia,Kc,Da,Zc,H0,Wd,G0,new fe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Jc(n,e,t,i,s,r){Fo.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(La.x=r*Fo.x-s*Fo.y,La.y=s*Fo.x+r*Fo.y):La.copy(Fo),n.copy(e),n.x+=La.x,n.y+=La.y,n.applyMatrix4(nM)}const Qc=new F,W0=new F;class sM extends ct{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,s=t.length;i0){let i,s;for(i=1,s=t.length;i0){Qc.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Qc);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Qc.setFromMatrixPosition(e.matrixWorld),W0.setFromMatrixPosition(this.matrixWorld);const i=Qc.distanceTo(W0)/e.zoom;t[0].object.visible=!0;let s,r;for(s=1,r=t.length;s=o)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||YR.getNormalMatrix(e),s=this.coplanarPoint(qd).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const wr=new _n,nu=new F;class pc{constructor(e=new Ys,t=new Ys,i=new Ys,s=new Ys,r=new Ys,o=new Ys){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Mi){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],u=s[5],f=s[6],h=s[7],d=s[8],p=s[9],_=s[10],g=s[11],m=s[12],y=s[13],x=s[14],v=s[15];if(i[0].setComponents(l-r,h-c,g-d,v-m).normalize(),i[1].setComponents(l+r,h+c,g+d,v+m).normalize(),i[2].setComponents(l+o,h+u,g+p,v+y).normalize(),i[3].setComponents(l-o,h-u,g-p,v-y).normalize(),i[4].setComponents(l-a,h-f,g-_,v-x).normalize(),t===Mi)i[5].setComponents(l+a,h+f,g+_,v+x).normalize();else if(t===Bl)i[5].setComponents(a,f,_,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),wr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),wr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(wr)}intersectsSprite(e){return wr.center.set(0,0,0),wr.radius=.7071067811865476,wr.applyMatrix4(e.matrixWorld),this.intersectsSphere(wr)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,nu.y=s.normal.y>0?e.max.y:e.min.y,nu.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(nu)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Yd(n,e){return n-e}function jR(n,e){return n.z-e.z}function KR(n,e){return e.z-n.z}class ZR{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,s){const r=this.pool,o=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const a=r[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=s}reset(){this.list.length=0,this.index=0}}const Fn=new Xe,JR=new we(1,1,1),jd=new pc,iu=new On,Ar=new _n,Ua=new F,Q0=new F,QR=new F,Kd=new ZR,dn=new Ht,su=[];function eP(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const s=n.count;for(let r=0;r65535?new Uint32Array(s):new Uint16Array(s);t.setIndex(new Et(r,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const s=e.getAttribute(i),r=t.getAttribute(i);if(s.itemSize!==r.itemSize||s.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new On);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,s=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Yd),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Fn.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const o=this._colorsTexture;return o&&(JR.toArray(o.image.data,s*4),o.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=i===-1?o.count:i),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Yd),l=this._availableGeometryIds.shift(),r[l]=s):(l=this._geometryCount,this._geometryCount++,r.push(s)),this.setGeometryAt(l,e),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,s=i.getIndex()!==null,r=i.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(s&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const u in i.attributes){const f=t.getAttribute(u),h=i.getAttribute(u);eP(f,h,l);const d=f.itemSize;for(let p=f.count,_=c;p<_;p++){const g=l+p;for(let m=0;m=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let s=0,r=i.length;sa).sort((o,a)=>i[o].vertexStart-i[a].vertexStart),r=this.geometry;for(let o=0,a=i.length;o=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingBox===null){const r=new On,o=i.index,a=i.attributes.position;for(let l=s.start,c=s.start+s.count;l=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingSphere===null){const r=new _n;this.getBoundingBoxAt(e,iu),iu.getCenter(r.center);const o=i.index,a=i.attributes.position;let l=0;for(let c=s.start,u=s.start+s.count;ca.active);if(Math.max(...i.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new rt,this._initializeGeometry(r));const o=this.geometry;r.index&&Cr(r.index.array,o.index.array);for(const a in r.attributes)Cr(r.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,o=this.geometry;dn.material=this.material,dn.geometry.index=o.index,dn.geometry.attributes=o.attributes,dn.geometry.boundingBox===null&&(dn.geometry.boundingBox=new On),dn.geometry.boundingSphere===null&&(dn.geometry.boundingSphere=new _n);for(let a=0,l=i.length;a({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,s,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=s.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data;h&&(Fn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),jd.setFromProjectionMatrix(Fn,e.coordinateSystem));let _=0;if(this.sortObjects){Fn.copy(this.matrixWorld).invert(),Ua.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Fn),Q0.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Fn);for(let y=0,x=l.length;y0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;ri)return;Zd.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Zd);if(!(ce.far))return{distance:c,point:tv.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const nv=new F,iv=new F;class Ki extends rr{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let s=0,r=t.count;s0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class uM extends Vt{constructor(e,t,i,s,r,o,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:jt,this.magFilter=r!==void 0?r:jt,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class tP extends uM{constructor(e,t,i,s,r,o,a,l){super({},e,t,i,s,r,o,a,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class nP extends Vt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=cn,this.minFilter=cn,this.generateMipmaps=!1,this.needsUpdate=!0}}class Uh extends Vt{constructor(e,t,i,s,r,o,a,l,c,u,f,h){super(null,o,a,l,c,u,s,r,f,h),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class iP extends Uh{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=li,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class sP extends Uh{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Es),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class rP extends Vt{constructor(e,t,i,s,r,o,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Dg extends Vt{constructor(e,t,i,s,r,o,a,l,c,u=eo){if(u!==eo&&u!==lo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===eo&&(i=Ts),i===void 0&&u===lo&&(i=ao),super(null,s,r,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:cn,this.minFilter=l!==void 0?l:cn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Zs(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Li{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,s=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),r+=i.distanceTo(s),t.push(r),s=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const i=this.getLengths();let s=0;const r=i.length;let o;t?o=t:o=e*i[r-1];let a=0,l=r-1,c;for(;a<=l;)if(s=Math.floor(a+(l-a)/2),c=i[s]-o,c<0)a=s+1;else if(c>0)l=s-1;else{l=s;break}if(s=l,i[s]===o)return s/(r-1);const u=i[s],h=i[s+1]-u,d=(o-u)/h;return(s+d)/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const o=this.getPoint(s),a=this.getPoint(r),l=t||(o.isVector2?new fe:new F);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new F,s=[],r=[],o=[],a=new F,l=new Xe;for(let d=0;d<=e;d++){const p=d/e;s[d]=this.getTangentAt(p,new F)}r[0]=new F,o[0]=new F;let c=Number.MAX_VALUE;const u=Math.abs(s[0].x),f=Math.abs(s[0].y),h=Math.abs(s[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),h<=c&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),o[0].crossVectors(s[0],r[0]);for(let d=1;d<=e;d++){if(r[d]=r[d-1].clone(),o[d]=o[d-1].clone(),a.crossVectors(s[d-1],s[d]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(Ke(s[d-1].dot(s[d]),-1,1));r[d].applyMatrix4(l.makeRotationAxis(a,p))}o[d].crossVectors(s[d],r[d])}if(t===!0){let d=Math.acos(Ke(r[0].dot(r[e]),-1,1));d/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(d=-d);for(let p=1;p<=e;p++)r[p].applyMatrix4(l.makeRotationAxis(s[p],d*p)),o[p].crossVectors(s[p],r[p])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Fh extends Li{constructor(e=0,t=0,i=1,s=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new fe){const i=t,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let c,u;this.closed||a>0?c=s[(a-1)%r]:(cu.subVectors(s[0],s[1]).add(s[0]),c=cu);const f=s[a%r],h=s[(a+1)%r];if(this.closed||a+2s.length-2?s.length-1:o+1],f=s[o>s.length-3?s.length-1:o+2];return i.set(ov(a,l.x,c.x,u.x,f.x),ov(a,l.y,c.y,u.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=s[r]-i,a=this.curves[r],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,s=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mc extends rt{constructor(e=[new fe(0,-.5),new fe(.5,0),new fe(0,.5)],t=12,i=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:s},t=Math.floor(t),s=Ke(s,0,Math.PI*2);const r=[],o=[],a=[],l=[],c=[],u=1/t,f=new F,h=new fe,d=new F,p=new F,_=new F;let g=0,m=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,d.x=m*1,d.y=-g,d.z=m*0,_.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,d.x=m*1,d.y=-g,d.z=m*0,p.copy(d),d.x+=_.x,d.y+=_.y,d.z+=_.z,d.normalize(),l.push(d.x,d.y,d.z),_.copy(p)}for(let y=0;y<=t;y++){const x=i+y*u*s,v=Math.sin(x),E=Math.cos(x);for(let T=0;T<=e.length-1;T++){f.x=e[T].x*v,f.y=e[T].y,f.z=e[T].x*E,o.push(f.x,f.y,f.z),h.x=y/t,h.y=T/(e.length-1),a.push(h.x,h.y);const M=l[3*T+0]*v,P=l[3*T+1],b=l[3*T+0]*E;c.push(M,P,b)}}for(let y=0;y0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new Ue(f,3)),this.setAttribute("normal",new Ue(h,3)),this.setAttribute("uv",new Ue(d,2));function y(){const v=new F,E=new F;let T=0;const M=(t-e)/i;for(let P=0;P<=r;P++){const b=[],S=P/r,D=S*(t-e)+e;for(let B=0;B<=s;B++){const H=B/s,$=H*l+a,ee=Math.sin($),Z=Math.cos($);E.x=D*ee,E.y=-S*i+g,E.z=D*Z,f.push(E.x,E.y,E.z),v.set(ee,M,Z).normalize(),h.push(v.x,v.y,v.z),d.push(H,1-S),b.push(p++)}_.push(b)}for(let P=0;P0||b!==0)&&(u.push(S,D,H),T+=3),(t>0||b!==r-1)&&(u.push(D,B,H),T+=3)}c.addGroup(m,T,0),m+=T}function x(v){const E=p,T=new fe,M=new F;let P=0;const b=v===!0?e:t,S=v===!0?1:-1;for(let B=1;B<=s;B++)f.push(0,g*S,0),h.push(0,S,0),d.push(.5,.5),p++;const D=p;for(let B=0;B<=s;B++){const $=B/s*l+a,ee=Math.cos($),Z=Math.sin($);M.x=b*Z,M.y=g*S,M.z=b*ee,f.push(M.x,M.y,M.z),h.push(0,S,0),T.x=ee*.5+.5,T.y=Z*.5*S+.5,d.push(T.x,T.y),p++}for(let B=0;B.9&&M<.1&&(x<.2&&(o[y+0]+=1),v<.2&&(o[y+2]+=1),E<.2&&(o[y+4]+=1))}}function h(y){r.push(y.x,y.y,y.z)}function d(y,x){const v=y*3;x.x=e[v+0],x.y=e[v+1],x.z=e[v+2]}function p(){const y=new F,x=new F,v=new F,E=new F,T=new fe,M=new fe,P=new fe;for(let b=0,S=0;b80*i){l=u=e[0],c=f=e[1];for(let _=i;_u&&(u=h),d>f&&(f=d);p=Math.max(u-l,f-c),p=p!==0?32767/p:0}return zl(o,a,i,l,c,p,0),a}}function _M(n,e,t,i,s){let r,o;if(s===RP(n,e,t,i)>0)for(r=e;r=e;r-=i)o=av(r,n[r],n[r+1],o);return o&&Hh(o,o.next)&&(Gl(o),o=o.next),o}function fo(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Hh(t,t.next)||Ut(t.prev,t,t.next)===0)){if(Gl(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function zl(n,e,t,i,s,r,o){if(!n)return;!o&&r&&MP(n,i,s,r);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,r?mP(n,i,s,r):pP(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),Gl(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=gP(fo(n),e,t),zl(n,e,t,i,s,r,2)):o===2&&_P(n,e,t,i,s,r):zl(fo(n),e,t,i,s,r,1);break}}}function pP(n){const e=n.prev,t=n,i=n.next;if(Ut(e,t,i)>=0)return!1;const s=e.x,r=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=sr?s>o?s:o:r>o?r:o,d=a>l?a>c?a:c:l>c?l:c;let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=h&&p.y>=f&&p.y<=d&&Yo(s,a,r,l,o,c,p.x,p.y)&&Ut(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function mP(n,e,t,i){const s=n.prev,r=n,o=n.next;if(Ut(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,u=s.y,f=r.y,h=o.y,d=al?a>c?a:c:l>c?l:c,g=u>f?u>h?u:h:f>h?f:h,m=em(d,p,e,t,i),y=em(_,g,e,t,i);let x=n.prevZ,v=n.nextZ;for(;x&&x.z>=m&&v&&v.z<=y;){if(x.x>=d&&x.x<=_&&x.y>=p&&x.y<=g&&x!==s&&x!==o&&Yo(a,u,l,f,c,h,x.x,x.y)&&Ut(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Yo(a,u,l,f,c,h,v.x,v.y)&&Ut(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=m;){if(x.x>=d&&x.x<=_&&x.y>=p&&x.y<=g&&x!==s&&x!==o&&Yo(a,u,l,f,c,h,x.x,x.y)&&Ut(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=y;){if(v.x>=d&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Yo(a,u,l,f,c,h,v.x,v.y)&&Ut(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function gP(n,e,t){let i=n;do{const s=i.prev,r=i.next.next;!Hh(s,r)&&vM(s,i,i.next,r)&&Hl(s,r)&&Hl(r,s)&&(e.push(s.i/t|0),e.push(i.i/t|0),e.push(r.i/t|0),Gl(i),Gl(i.next),i=n=r),i=i.next}while(i!==n);return fo(i)}function _P(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&wP(o,a)){let l=yM(o,a);o=fo(o,o.next),l=fo(l,l.next),zl(o,e,t,i,s,r,0),zl(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function vP(n,e,t,i){const s=[];let r,o,a,l,c;for(r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const h=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=r&&h>i&&(i=h,s=t.x=t.x&&t.x>=l&&r!==t.x&&Yo(os.x||t.x===s.x&&SP(s,t)))&&(s=t,u=f)),t=t.next;while(t!==a);return s}function SP(n,e){return Ut(n.prev,n,e.prev)<0&&Ut(e.next,n,n.next)<0}function MP(n,e,t,i){let s=n;do s.z===0&&(s.z=em(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,EP(s)}function EP(n){let e,t,i,s,r,o,a,l,c=1;do{for(t=n,n=null,r=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(s=t,t=t.nextZ,a--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;t=i}r.nextZ=null,c*=2}while(o>1);return n}function em(n,e,t,i,s){return n=(n-t)*s|0,e=(e-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function TP(n){let e=n,t=n;do(e.x=(n-o)*(r-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(s-o)*(i-a)}function wP(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!AP(n,e)&&(Hl(n,e)&&Hl(e,n)&&CP(n,e)&&(Ut(n.prev,n,e.prev)||Ut(n,e.prev,e))||Hh(n,e)&&Ut(n.prev,n,n.next)>0&&Ut(e.prev,e,e.next)>0)}function Ut(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Hh(n,e){return n.x===e.x&&n.y===e.y}function vM(n,e,t,i){const s=pu(Ut(n,e,t)),r=pu(Ut(n,e,i)),o=pu(Ut(t,i,n)),a=pu(Ut(t,i,e));return!!(s!==r&&o!==a||s===0&&du(n,t,e)||r===0&&du(n,i,e)||o===0&&du(t,n,i)||a===0&&du(t,e,i))}function du(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function pu(n){return n>0?1:n<0?-1:0}function AP(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&vM(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Hl(n,e){return Ut(n.prev,n,n.next)<0?Ut(n,e,n.next)>=0&&Ut(n,n.prev,e)>=0:Ut(n,e,n.prev)<0||Ut(n,n.next,e)<0}function CP(n,e){let t=n,i=!1;const s=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function yM(n,e){const t=new tm(n.i,n.x,n.y),i=new tm(e.i,e.x,e.y),s=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function av(n,e,t,i){const s=new tm(n,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Gl(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function tm(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function RP(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function cv(n,e){for(let t=0;tNumber.EPSILON){const U=Math.sqrt(C),z=Math.sqrt(V*V+A*A),Y=L.x-N/U,he=L.y+R/U,ce=w.x-A/z,ye=w.y+V/z,Fe=((ce-Y)*A-(ye-he)*V)/(R*A-N*V);j=Y+R*Fe-I.x,G=he+N*Fe-I.y;const me=j*j+G*G;if(me<=2)return new fe(j,G);q=Math.sqrt(me/2)}else{let U=!1;R>Number.EPSILON?V>Number.EPSILON&&(U=!0):R<-Number.EPSILON?V<-Number.EPSILON&&(U=!0):Math.sign(N)===Math.sign(A)&&(U=!0),U?(j=-N,G=R,q=Math.sqrt(C)):(j=R,G=N,q=Math.sqrt(C/2))}return new fe(j/q,G/q)}const pe=[];for(let I=0,L=$.length,w=L-1,j=I+1;I=0;I--){const L=I/g,w=d*Math.cos(L*Math.PI/2),j=p*Math.sin(L*Math.PI/2)+_;for(let G=0,q=$.length;G=0;){const j=w;let G=w-1;G<0&&(G=I.length-1);for(let q=0,R=u+g*2;q0)&&d.push(x,v,T),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class EM extends xn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new we(16777215),this.specular=new we(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ei,this.combine=cc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class TM extends xn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new we(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class wM extends xn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class AM extends xn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new we(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ei,this.combine=cc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class zg extends xn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BS,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Hg extends xn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class CM extends xn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new we(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ur,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class RM extends Nn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function jr(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function PM(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function IM(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function nm(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function Gg(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push(...o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}function DP(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let l=0;l=i)){f.push(c.times[d]);for(let _=0;_r.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l=a.times[p]){const m=p*f+u,y=m+f-u;_=a.values.slice(m,y)}else{const m=a.createInterpolant(),y=u,x=f-u;m.evaluate(r),_=m.resultBuffer.slice(y,x)}l==="quaternion"&&new Wn().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let m=0;m=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&PM(s))for(let a=0,l=s.length;a!==l;++a){const c=s[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Gu,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Di.prototype.TimeBufferType=Float32Array;Di.prototype.ValueBufferType=Float32Array;Di.prototype.DefaultInterpolation=Xf;class go extends Di{constructor(e,t,i){super(e,t,i)}}go.prototype.ValueTypeName="bool";go.prototype.ValueBufferType=Array;go.prototype.DefaultInterpolation=Ol;go.prototype.InterpolantFactoryMethodLinear=void 0;go.prototype.InterpolantFactoryMethodSmooth=void 0;class Xg extends Di{}Xg.prototype.ValueTypeName="color";class Wl extends Di{}Wl.prototype.ValueTypeName="number";class OM extends vc{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let c=e*a;for(let u=c+a;c!==u;c+=4)Wn.slerpFlat(r,0,o,c-a,o,c,l);return r}}class yc extends Di{InterpolantFactoryMethodLinear(e){return new OM(this.times,this.values,this.getValueSize(),e)}}yc.prototype.ValueTypeName="quaternion";yc.prototype.InterpolantFactoryMethodSmooth=void 0;class _o extends Di{constructor(e,t,i){super(e,t,i)}}_o.prototype.ValueTypeName="string";_o.prototype.ValueBufferType=Array;_o.prototype.DefaultInterpolation=Ol;_o.prototype.InterpolantFactoryMethodLinear=void 0;_o.prototype.InterpolantFactoryMethodSmooth=void 0;class Xl extends Di{}Xl.prototype.ValueTypeName="vector";class $l{constructor(e="",t=-1,i=[],s=Ah){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=Zn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(FP(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(Di.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const f=u[1];let h=s[f];h||(s[f]=h=[]),h.push(c)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,h,d,p,_){if(d.length!==0){const g=[],m=[];Gg(d,g,m,p),g.length!==0&&_.push(new f(h,g,m))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{t&&t(r),this.manager.itemEnd(e)},0),r;if(rs[e]!==void 0){rs[e].push({onLoad:t,onProgress:i,onError:s});return}rs[e]=[],rs[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=rs[e],f=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=h?parseInt(h):0,p=d!==0;let _=0;const g=new ReadableStream({start(m){y();function y(){f.read().then(({done:x,value:v})=>{if(x)m.close();else{_+=v.byteLength;const E=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:d});for(let T=0,M=u.length;T{m.error(x)})}}});return new Response(g)}else throw new BP(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),h=f&&f[1]?f[1].toLowerCase():void 0,d=new TextDecoder(h);return c.arrayBuffer().then(p=>d.decode(p))}}}).then(c=>{ms.add(e,c);const u=rs[e];delete rs[e];for(let f=0,h=u.length;f{const u=rs[e];if(u===void 0)throw this.manager.itemError(e),c;delete rs[e];for(let f=0,h=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class kP extends $n{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new ws(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t=[];for(let i=0;i0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(s.uniforms[r]={},o.type){case"t":s.uniforms[r].value=i(o.value);break;case"c":s.uniforms[r].value=new we().setHex(o.value);break;case"v2":s.uniforms[r].value=new fe().fromArray(o.value);break;case"v3":s.uniforms[r].value=new F().fromArray(o.value);break;case"v4":s.uniforms[r].value=new ht().fromArray(o.value);break;case"m3":s.uniforms[r].value=new Qe().fromArray(o.value);break;case"m4":s.uniforms[r].value=new Xe().fromArray(o.value);break;default:s.uniforms[r].value=o.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)s.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=i(e.map)),e.matcap!==void 0&&(s.matcap=i(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new fe().fromArray(r)}return e.displacementMap!==void 0&&(s.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=i(e.envMap)),e.envMapRotation!==void 0&&s.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new fe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(s.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Jh.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:bM,SpriteMaterial:Pg,RawShaderMaterial:SM,ShaderMaterial:Ri,PointsMaterial:Lg,MeshPhysicalMaterial:MM,MeshStandardMaterial:Vg,MeshPhongMaterial:EM,MeshToonMaterial:TM,MeshNormalMaterial:wM,MeshLambertMaterial:AM,MeshDepthMaterial:zg,MeshDistanceMaterial:Hg,MeshBasicMaterial:Rs,MeshMatcapMaterial:CM,LineDashedMaterial:RM,LineBasicMaterial:Nn,Material:xn};return new t[e]}}class im{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i0){const l=new $g(t);r=new ql(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){s=new ql(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const g=new On;g.min.fromArray(_.boxMin),g.max.fromArray(_.boxMax);const m=new _n;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:g,sphereInitialized:_.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new sM;break;case"Line":o=new rr(a(e.geometry),l(e.material));break;case"LineLoop":o=new lM(a(e.geometry),l(e.material));break;case"LineSegments":o=new Ki(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new cM(a(e.geometry),l(e.material));break;case"Sprite":o=new iM(l(e.material));break;case"Group":o=new qo;break;case"Bone":o=new Ig;break;default:o=new ct}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const h=e.children;for(let d=0;d"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=ms.get(e);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),r.manager.itemEnd(e)}).catch(c=>{s&&s(c)});return}return setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return ms.add(e,c),t&&t(c),r.manager.itemEnd(e),c}).catch(function(c){s&&s(c),ms.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});ms.add(e,l),r.manager.itemStart(e)}}let mu;class Yg{static getContext(){return mu===void 0&&(mu=new(window.AudioContext||window.webkitAudioContext)),mu}static setContext(e){mu=e}}class KP extends $n{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new ws(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);Yg.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,s);function a(l){s?s(l):console.error(l),r.manager.itemError(e)}}}const _v=new Xe,vv=new Xe,Rr=new Xe;class ZP{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new $t,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new $t,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Rr.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(to*t.fov*.5)/t.zoom;let a,l;vv.elements[12]=-s,_v.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,Rr.elements[0]=2*t.near/(l-a),Rr.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Rr),a=-o*t.aspect-r,l=o*t.aspect-r,Rr.elements[0]=2*t.near/(l-a),Rr.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Rr)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(vv),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(_v)}}class $M extends $t{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e,this.index=0}}class Qh{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=yv(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=yv();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function yv(){return performance.now()}const Pr=new F,xv=new Wn,JP=new F,Ir=new F;class QP extends ct{constructor(){super(),this.type="AudioListener",this.context=Yg.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Qh}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Pr,xv,JP),Ir.set(0,0,-1).applyQuaternion(xv),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Pr.x,s),t.positionY.linearRampToValueAtTime(Pr.y,s),t.positionZ.linearRampToValueAtTime(Pr.z,s),t.forwardX.linearRampToValueAtTime(Ir.x,s),t.forwardY.linearRampToValueAtTime(Ir.y,s),t.forwardZ.linearRampToValueAtTime(Ir.z,s),t.upX.linearRampToValueAtTime(i.x,s),t.upY.linearRampToValueAtTime(i.y,s),t.upZ.linearRampToValueAtTime(i.z,s)}else t.setPosition(Pr.x,Pr.y,Pr.z),t.setOrientation(Ir.x,Ir.y,Ir.z,i.x,i.y,i.z)}}class qM extends ct{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,s,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,s=i*this._origIndex;e.getValue(t,s);for(let r=i,o=s;r!==o;++r)t[r]=t[s+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==r;++o)e[t+o]=e[i+o]}_slerp(e,t,i,s){Wn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Wn.multiplyQuaternionsFlat(e,o,e,t,e,i),Wn.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,i,s,r){const o=1-s;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*s}}_lerpAdditive(e,t,i,s,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[i+o]*s}}}const jg="\\[\\]\\.:\\/",iI=new RegExp("["+jg+"]","g"),Kg="[^"+jg+"]",sI="[^"+jg.replace("\\.","")+"]",rI=/((?:WC+[\/:])*)/.source.replace("WC",Kg),oI=/(WCOD+)?/.source.replace("WCOD",sI),aI=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kg),lI=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kg),cI=new RegExp("^"+rI+oI+aI+lI+"$"),uI=["material","materials","bones","map"];class fI{constructor(e,t,i){const s=i||ft.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class ft{constructor(e,t,i){this.path=t,this.parsedPath=i||ft.parseTrackName(t),this.node=ft.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new ft.Composite(e,t,i):new ft(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(iI,"")}static parseTrackName(e){const t=cI.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);uI.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=r){const f=r++,h=e[f];t[h.uuid]=u,e[u]=h,t[c]=f,e[f]=l;for(let d=0,p=s;d!==p;++d){const _=i[d],g=_[f],m=_[u];_[u]=g,_[f]=m}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,s=i.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,f=t[u];if(f!==void 0)if(delete t[u],f0&&(t[d.uuid]=f),e[f]=d,e.pop();for(let p=0,_=s;p!==_;++p){const g=i[p];g[f]=g[h],g.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let s=i[e];const r=this._bindings;if(s!==void 0)return r[s];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);s=r.length,i[e]=s,o.push(e),a.push(t),r.push(f);for(let h=u,d=l.length;h!==d;++h){const p=l[h];f[h]=new ft(p,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const s=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),r[i]=r[a],r.pop(),s[i]=s[a],s.pop()}}}class jM{constructor(e,t,i=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=s;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:qr,endingEnd:qr};for(let c=0;c!==o;++c){const u=r[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=US,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=r,l[1]=r+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Eg:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case Ah:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let s=this.time+e,r=this._loopCount;const o=i===FS;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===NS){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){const a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,i){const s=this._interpolantSettings;i?(s.endingStart=Yr,s.endingEnd=Yr):(e?s.endingStart=this.zeroSlopeAtStart?Yr:qr:s.endingStart=Nl,t?s.endingEnd=this.zeroSlopeAtEnd?Yr:qr:s.endingEnd=Nl)}_scheduleFading(e,t,i){const s=this._mixer,r=s.time;let o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=i,this}}const dI=new Float32Array(1);class pI extends ji{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==r;++f){const h=s[f],d=h.name;let p=u[d];if(p!==void 0)++p.referenceCount,o[f]=p;else{if(p=o[f],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,d));continue}const _=t&&t._propertyBindings[f].binding.parsedPath;p=new YM(ft.create(i,d,_),h.ValueTypeName,h.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,d),o[f]=p}a[f].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,i)}const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(s,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ev).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Tv=new F,gu=new F;class EI{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Tv.subVectors(e,this.start),gu.subVectors(this.end,this.start);const i=gu.dot(gu);let r=gu.dot(Tv)/i;return t&&(r=Ke(r,0,1)),r}closestPointToPoint(e,t,i){const s=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const wv=new F;class TI extends ct{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new rt,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Iv.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Iv,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class BI extends Ki{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new rt;s.setAttribute("position",new Ue(t,3)),s.setAttribute("color",new Ue(i,3));const r=new Nn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new we,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class kI{constructor(){this.type="ShapePath",this.color=new we,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Vl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,s){return this.currentPath.quadraticCurveTo(e,t,i,s),this}bezierCurveTo(e,t,i,s,r,o){return this.currentPath.bezierCurveTo(e,t,i,s,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const y=[];for(let x=0,v=m.length;xNumber.EPSILON){if(S<0&&(M=y[T],b=-b,P=y[E],S=-S),m.yP.y)continue;if(m.y===M.y){if(m.x===M.x)return!0}else{const D=S*(m.x-M.x)-b*(m.y-M.y);if(D===0)return!0;if(D<0)continue;v=!v}}else{if(m.y!==M.y)continue;if(P.x<=m.x&&m.x<=M.x||M.x<=m.x&&m.x<=P.x)return!0}}return v}const s=Wi.isClockWise,r=this.subPaths;if(r.length===0)return[];let o,a,l;const c=[];if(r.length===1)return a=r[0],l=new no,l.curves=a.curves,c.push(l),c;let u=!s(r[0].getPoints());u=e?!u:u;const f=[],h=[];let d=[],p=0,_;h[p]=void 0,d[p]=[];for(let m=0,y=r.length;m1){let m=!1,y=0;for(let x=0,v=h.length;x0&&m===!1&&(d=f)}let g;for(let m=0,y=h.length;me?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function HI(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function GI(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function rm(n,e,t,i){const s=WI(i);switch(t){case vg:return n*e;case xg:return n*e;case bg:return n*e*2;case Eh:return n*e/s.components*s.byteLength;case uc:return n*e/s.components*s.byteLength;case Sg:return n*e*2/s.components*s.byteLength;case Th:return n*e*2/s.components*s.byteLength;case yg:return n*e*3/s.components*s.byteLength;case Ln:return n*e*4/s.components*s.byteLength;case wh:return n*e*4/s.components*s.byteLength;case el:case tl:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case nl:case il:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case xf:case Sf:return Math.max(n,16)*Math.max(e,8)/4;case yf:case bf:return Math.max(n,8)*Math.max(e,8)/2;case Mf:case Ef:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Tf:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case wf:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Af:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case Cf:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case Rf:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case Pf:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case If:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case Lf:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case Df:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Of:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case Nf:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Uf:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case Ff:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Bf:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case kf:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case sl:case Vf:case zf:return Math.ceil(n/4)*Math.ceil(e/4)*16;case Mg:case Hf:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Gf:case Wf:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function WI(n){switch(n){case qi:case mg:return{byteLength:1,components:1};case oa:case gg:case va:return{byteLength:2,components:1};case Sh:case Mh:return{byteLength:2,components:4};case Ts:case bh:case Hn:return{byteLength:4,components:1};case _g:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class XI{static contain(e,t){return zI(e,t)}static cover(e,t){return HI(e,t)}static fill(e){return GI(e)}static getByteLength(e,t,i,s){return rm(e,t,i,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:lc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=lc);/** * @license * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT - */function JM(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function $I(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,f=c.byteLength,h=n.createBuffer();n.bindBuffer(l,h),n.bufferData(l,c,u),a.onUploadCallback();let d;if(c instanceof Float32Array)d=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?d=n.HALF_FLOAT:d=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=n.SHORT;else if(c instanceof Uint32Array)d=n.UNSIGNED_INT;else if(c instanceof Int32Array)d=n.INT;else if(c instanceof Int8Array)d=n.BYTE;else if(c instanceof Uint8Array)d=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function i(a,l,c){const u=l.array,f=l.updateRanges;if(n.bindBuffer(c,a),f.length===0)n.bufferSubData(c,0,u);else{f.sort((d,p)=>d.start-p.start);let h=0;for(let d=1;dd.start-p.start);let h=0;for(let d=1;de in n?fw(n,e,{enumerable:!0,config #endif`,iL=`vec3 transformed = vec3( position ); #ifdef USE_ALPHAHASH vPosition = vec3( position ); -#endif`,rL=`vec3 objectNormal = vec3( normal ); +#endif`,sL=`vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); -#endif`,sL=`float G_BlinnPhong_Implicit( ) { +#endif`,rL=`float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { @@ -1421,9 +1421,9 @@ IncidentLight directLight; sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,eD=`#ifdef USE_MAP +#endif`,e2=`#ifdef USE_MAP uniform sampler2D map; -#endif`,tD=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,t2=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1435,7 +1435,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,nD=`#if defined( USE_POINTS_UV ) +#endif`,n2=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1447,19 +1447,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,iD=`float metalnessFactor = metalness; +#endif`,i2=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,rD=`#ifdef USE_METALNESSMAP +#endif`,s2=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,sD=`#ifdef USE_INSTANCING_MORPH +#endif`,r2=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,oD=`#if defined( USE_MORPHCOLORS ) +#endif`,o2=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1468,12 +1468,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,aD=`#ifdef USE_MORPHNORMALS +#endif`,a2=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } -#endif`,lD=`#ifdef USE_MORPHTARGETS +#endif`,l2=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1487,12 +1487,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,cD=`#ifdef USE_MORPHTARGETS +#endif`,c2=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } -#endif`,uD=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,u2=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1533,7 +1533,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,fD=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,f2=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1548,25 +1548,25 @@ vec3 nonPerturbedNormal = normal;`,fD=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,hD=`#ifndef FLAT_SHADED +#endif`,h2=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,dD=`#ifndef FLAT_SHADED +#endif`,d2=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,pD=`#ifndef FLAT_SHADED +#endif`,p2=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,mD=`#ifdef USE_NORMALMAP +#endif`,m2=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1588,13 +1588,13 @@ vec3 nonPerturbedNormal = normal;`,fD=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,gD=`#ifdef USE_CLEARCOAT +#endif`,g2=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,_D=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,_2=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,vD=`#ifdef USE_CLEARCOATMAP +#endif`,v2=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1603,18 +1603,18 @@ vec3 nonPerturbedNormal = normal;`,fD=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,yD=`#ifdef USE_IRIDESCENCEMAP +#endif`,y2=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,xD=`#ifdef OPAQUE +#endif`,x2=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,bD=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,b2=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1683,9 +1683,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,SD=`#ifdef PREMULTIPLIED_ALPHA +}`,S2=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,MD=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,M2=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1693,22 +1693,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,ED=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,E2=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,TD=`#ifdef DITHERING +#endif`,T2=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,wD=`float roughnessFactor = roughness; +#endif`,w2=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,AD=`#ifdef USE_ROUGHNESSMAP +#endif`,A2=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,CD=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,C2=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1894,7 +1894,7 @@ gl_Position = projectionMatrix * mvPosition;`,ED=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,RD=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,R2=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -1935,7 +1935,7 @@ gl_Position = projectionMatrix * mvPosition;`,ED=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,PD=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,P2=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -1967,7 +1967,7 @@ gl_Position = projectionMatrix * mvPosition;`,ED=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,ID=`float getShadowMask() { +#endif`,I2=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -1999,12 +1999,12 @@ gl_Position = projectionMatrix * mvPosition;`,ED=`#ifdef DITHERING #endif #endif return shadow; -}`,LD=`#ifdef USE_SKINNING +}`,L2=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,DD=`#ifdef USE_SKINNING +#endif`,D2=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2019,7 +2019,7 @@ gl_Position = projectionMatrix * mvPosition;`,ED=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,OD=`#ifdef USE_SKINNING +#endif`,O2=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2027,7 +2027,7 @@ gl_Position = projectionMatrix * mvPosition;`,ED=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,ND=`#ifdef USE_SKINNING +#endif`,N2=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2038,17 +2038,17 @@ gl_Position = projectionMatrix * mvPosition;`,ED=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,UD=`float specularStrength; +#endif`,U2=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,FD=`#ifdef USE_SPECULARMAP +#endif`,F2=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,BD=`#if defined( TONE_MAPPING ) +#endif`,B2=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,kD=`#ifndef saturate +#endif`,k2=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2145,7 +2145,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,VD=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,V2=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2166,7 +2166,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,VD=`#ifdef USE_TRANSMISS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,zD=`#ifdef USE_TRANSMISSION +#endif`,z2=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2292,7 +2292,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,VD=`#ifdef USE_TRANSMISS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,HD=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,H2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2362,7 +2362,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,VD=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,GD=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,G2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2456,7 +2456,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,VD=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,WD=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,W2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2527,7 +2527,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,VD=`#ifdef USE_TRANSMISS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,XD=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,X2=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2536,12 +2536,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,VD=`#ifdef USE_TRANSMISS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const $D=`varying vec2 vUv; +#endif`;const $2=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,qD=`uniform sampler2D t2D; +}`,q2=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2553,14 +2553,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,YD=`varying vec3 vWorldDirection; +}`,Y2=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,jD=`#ifdef ENVMAP_TYPE_CUBE +}`,j2=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2583,14 +2583,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,KD=`varying vec3 vWorldDirection; +}`,K2=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,ZD=`uniform samplerCube tCube; +}`,Z2=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2600,7 +2600,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,JD=`#include +}`,J2=`#include #include #include #include @@ -2627,7 +2627,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,QD=`#if DEPTH_PACKING == 3200 +}`,Q2=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2661,7 +2661,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,eO=`#define DISTANCE +}`,eD=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2688,7 +2688,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,tO=`#define DISTANCE +}`,tD=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2712,13 +2712,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,nO=`varying vec3 vWorldDirection; +}`,nD=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,iO=`uniform sampler2D tEquirect; +}`,iD=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2727,7 +2727,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,rO=`uniform float scale; +}`,sD=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2749,7 +2749,7 @@ void main() { #include #include #include -}`,sO=`uniform vec3 diffuse; +}`,rD=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2777,7 +2777,7 @@ void main() { #include #include #include -}`,oO=`#include +}`,oD=`#include #include #include #include @@ -2809,7 +2809,7 @@ void main() { #include #include #include -}`,aO=`uniform vec3 diffuse; +}`,aD=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2857,7 +2857,7 @@ void main() { #include #include #include -}`,lO=`#define LAMBERT +}`,lD=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2896,7 +2896,7 @@ void main() { #include #include #include -}`,cO=`#define LAMBERT +}`,cD=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2953,7 +2953,7 @@ void main() { #include #include #include -}`,uO=`#define MATCAP +}`,uD=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2987,7 +2987,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,fO=`#define MATCAP +}`,fD=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3033,7 +3033,7 @@ void main() { #include #include #include -}`,hO=`#define NORMAL +}`,hD=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3066,7 +3066,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,dO=`#define NORMAL +}`,dD=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3088,7 +3088,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,pO=`#define PHONG +}`,pD=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3127,7 +3127,7 @@ void main() { #include #include #include -}`,mO=`#define PHONG +}`,mD=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3186,7 +3186,7 @@ void main() { #include #include #include -}`,gO=`#define STANDARD +}`,gD=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3229,7 +3229,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,_O=`#define STANDARD +}`,_D=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3354,7 +3354,7 @@ void main() { #include #include #include -}`,vO=`#define TOON +}`,vD=`#define TOON varying vec3 vViewPosition; #include #include @@ -3391,7 +3391,7 @@ void main() { #include #include #include -}`,yO=`#define TOON +}`,yD=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3444,7 +3444,7 @@ void main() { #include #include #include -}`,xO=`uniform float size; +}`,xD=`uniform float size; uniform float scale; #include #include @@ -3475,7 +3475,7 @@ void main() { #include #include #include -}`,bO=`uniform vec3 diffuse; +}`,bD=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3500,7 +3500,7 @@ void main() { #include #include #include -}`,SO=`#include +}`,SD=`#include #include #include #include @@ -3523,7 +3523,7 @@ void main() { #include #include #include -}`,MO=`uniform vec3 color; +}`,MD=`uniform vec3 color; uniform float opacity; #include #include @@ -3539,7 +3539,7 @@ void main() { #include #include #include -}`,EO=`uniform float rotation; +}`,ED=`uniform float rotation; uniform vec2 center; #include #include @@ -3563,7 +3563,7 @@ void main() { #include #include #include -}`,TO=`uniform vec3 diffuse; +}`,TD=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3588,7 +3588,7 @@ void main() { #include #include #include -}`,rt={alphahash_fragment:qI,alphahash_pars_fragment:YI,alphamap_fragment:jI,alphamap_pars_fragment:KI,alphatest_fragment:ZI,alphatest_pars_fragment:JI,aomap_fragment:QI,aomap_pars_fragment:eL,batching_pars_vertex:tL,batching_vertex:nL,begin_vertex:iL,beginnormal_vertex:rL,bsdfs:sL,iridescence_fragment:oL,bumpmap_pars_fragment:aL,clipping_planes_fragment:lL,clipping_planes_pars_fragment:cL,clipping_planes_pars_vertex:uL,clipping_planes_vertex:fL,color_fragment:hL,color_pars_fragment:dL,color_pars_vertex:pL,color_vertex:mL,common:gL,cube_uv_reflection_fragment:_L,defaultnormal_vertex:vL,displacementmap_pars_vertex:yL,displacementmap_vertex:xL,emissivemap_fragment:bL,emissivemap_pars_fragment:SL,colorspace_fragment:ML,colorspace_pars_fragment:EL,envmap_fragment:TL,envmap_common_pars_fragment:wL,envmap_pars_fragment:AL,envmap_pars_vertex:CL,envmap_physical_pars_fragment:kL,envmap_vertex:RL,fog_vertex:PL,fog_pars_vertex:IL,fog_fragment:LL,fog_pars_fragment:DL,gradientmap_pars_fragment:OL,lightmap_pars_fragment:NL,lights_lambert_fragment:UL,lights_lambert_pars_fragment:FL,lights_pars_begin:BL,lights_toon_fragment:VL,lights_toon_pars_fragment:zL,lights_phong_fragment:HL,lights_phong_pars_fragment:GL,lights_physical_fragment:WL,lights_physical_pars_fragment:XL,lights_fragment_begin:$L,lights_fragment_maps:qL,lights_fragment_end:YL,logdepthbuf_fragment:jL,logdepthbuf_pars_fragment:KL,logdepthbuf_pars_vertex:ZL,logdepthbuf_vertex:JL,map_fragment:QL,map_pars_fragment:eD,map_particle_fragment:tD,map_particle_pars_fragment:nD,metalnessmap_fragment:iD,metalnessmap_pars_fragment:rD,morphinstance_vertex:sD,morphcolor_vertex:oD,morphnormal_vertex:aD,morphtarget_pars_vertex:lD,morphtarget_vertex:cD,normal_fragment_begin:uD,normal_fragment_maps:fD,normal_pars_fragment:hD,normal_pars_vertex:dD,normal_vertex:pD,normalmap_pars_fragment:mD,clearcoat_normal_fragment_begin:gD,clearcoat_normal_fragment_maps:_D,clearcoat_pars_fragment:vD,iridescence_pars_fragment:yD,opaque_fragment:xD,packing:bD,premultiplied_alpha_fragment:SD,project_vertex:MD,dithering_fragment:ED,dithering_pars_fragment:TD,roughnessmap_fragment:wD,roughnessmap_pars_fragment:AD,shadowmap_pars_fragment:CD,shadowmap_pars_vertex:RD,shadowmap_vertex:PD,shadowmask_pars_fragment:ID,skinbase_vertex:LD,skinning_pars_vertex:DD,skinning_vertex:OD,skinnormal_vertex:ND,specularmap_fragment:UD,specularmap_pars_fragment:FD,tonemapping_fragment:BD,tonemapping_pars_fragment:kD,transmission_fragment:VD,transmission_pars_fragment:zD,uv_pars_fragment:HD,uv_pars_vertex:GD,uv_vertex:WD,worldpos_vertex:XD,background_vert:$D,background_frag:qD,backgroundCube_vert:YD,backgroundCube_frag:jD,cube_vert:KD,cube_frag:ZD,depth_vert:JD,depth_frag:QD,distanceRGBA_vert:eO,distanceRGBA_frag:tO,equirect_vert:nO,equirect_frag:iO,linedashed_vert:rO,linedashed_frag:sO,meshbasic_vert:oO,meshbasic_frag:aO,meshlambert_vert:lO,meshlambert_frag:cO,meshmatcap_vert:uO,meshmatcap_frag:fO,meshnormal_vert:hO,meshnormal_frag:dO,meshphong_vert:pO,meshphong_frag:mO,meshphysical_vert:gO,meshphysical_frag:_O,meshtoon_vert:vO,meshtoon_frag:yO,points_vert:xO,points_frag:bO,shadow_vert:SO,shadow_frag:MO,sprite_vert:EO,sprite_frag:TO},Ee={common:{diffuse:{value:new we(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Qe},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Qe}},envmap:{envMap:{value:null},envMapRotation:{value:new Qe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Qe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Qe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Qe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Qe},normalScale:{value:new fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Qe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Qe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Qe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Qe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new we(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new we(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0},uvTransform:{value:new Qe}},sprite:{diffuse:{value:new we(16777215)},opacity:{value:1},center:{value:new fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Qe},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0}}},bi={basic:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.fog]),vertexShader:rt.meshbasic_vert,fragmentShader:rt.meshbasic_frag},lambert:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)}}]),vertexShader:rt.meshlambert_vert,fragmentShader:rt.meshlambert_frag},phong:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)},specular:{value:new we(1118481)},shininess:{value:30}}]),vertexShader:rt.meshphong_vert,fragmentShader:rt.meshphong_frag},standard:{uniforms:En([Ee.common,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.roughnessmap,Ee.metalnessmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:rt.meshphysical_vert,fragmentShader:rt.meshphysical_frag},toon:{uniforms:En([Ee.common,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.gradientmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)}}]),vertexShader:rt.meshtoon_vert,fragmentShader:rt.meshtoon_frag},matcap:{uniforms:En([Ee.common,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,{matcap:{value:null}}]),vertexShader:rt.meshmatcap_vert,fragmentShader:rt.meshmatcap_frag},points:{uniforms:En([Ee.points,Ee.fog]),vertexShader:rt.points_vert,fragmentShader:rt.points_frag},dashed:{uniforms:En([Ee.common,Ee.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:rt.linedashed_vert,fragmentShader:rt.linedashed_frag},depth:{uniforms:En([Ee.common,Ee.displacementmap]),vertexShader:rt.depth_vert,fragmentShader:rt.depth_frag},normal:{uniforms:En([Ee.common,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,{opacity:{value:1}}]),vertexShader:rt.meshnormal_vert,fragmentShader:rt.meshnormal_frag},sprite:{uniforms:En([Ee.sprite,Ee.fog]),vertexShader:rt.sprite_vert,fragmentShader:rt.sprite_frag},background:{uniforms:{uvTransform:{value:new Qe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:rt.background_vert,fragmentShader:rt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Qe}},vertexShader:rt.backgroundCube_vert,fragmentShader:rt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:rt.cube_vert,fragmentShader:rt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:rt.equirect_vert,fragmentShader:rt.equirect_frag},distanceRGBA:{uniforms:En([Ee.common,Ee.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:rt.distanceRGBA_vert,fragmentShader:rt.distanceRGBA_frag},shadow:{uniforms:En([Ee.lights,Ee.fog,{color:{value:new we(0)},opacity:{value:1}}]),vertexShader:rt.shadow_vert,fragmentShader:rt.shadow_frag}};bi.physical={uniforms:En([bi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Qe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Qe},clearcoatNormalScale:{value:new fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Qe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Qe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Qe},sheen:{value:0},sheenColor:{value:new we(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Qe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Qe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Qe},transmissionSamplerSize:{value:new fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Qe},attenuationDistance:{value:0},attenuationColor:{value:new we(0)},specularColor:{value:new we(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Qe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Qe},anisotropyVector:{value:new fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Qe}}]),vertexShader:rt.meshphysical_vert,fragmentShader:rt.meshphysical_frag};const Su={r:0,b:0,g:0},Os=new ei,wO=new Xe;function AO(n,e,t,i,r,s,o){const a=new we(0);let l=s===!0?0:1,c,u,f=null,h=0,d=null;function p(x){let v=x.isScene===!0?x.background:null;return v&&v.isTexture&&(v=(x.backgroundBlurriness>0?t:e).get(v)),v}function _(x){let v=!1;const E=p(x);E===null?m(a,l):E&&E.isColor&&(m(E,1),v=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||v)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function g(x,v){const E=p(v);E&&(E.isCubeTexture||E.mapping===_a)?(u===void 0&&(u=new Ht(new mo(1,1,1),new Ri({name:"BackgroundCubeMaterial",uniforms:la(bi.backgroundCube.uniforms),vertexShader:bi.backgroundCube.vertexShader,fragmentShader:bi.backgroundCube.fragmentShader,side:Dn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,M,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Os.copy(v.backgroundRotation),Os.x*=-1,Os.y*=-1,Os.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Os.y*=-1,Os.z*=-1),u.material.uniforms.envMap.value=E,u.material.uniforms.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(wO.makeRotationFromEuler(Os)),u.material.toneMapped=at.getTransfer(E.colorSpace)!==St,(f!==E||h!==E.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,f=E,h=E.version,d=n.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):E&&E.isTexture&&(c===void 0&&(c=new Ht(new ba(2,2),new Ri({name:"BackgroundMaterial",uniforms:la(bi.background.uniforms),vertexShader:bi.background.vertexShader,fragmentShader:bi.background.fragmentShader,side:Mr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=E,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=at.getTransfer(E.colorSpace)!==St,E.matrixAutoUpdate===!0&&E.updateMatrix(),c.material.uniforms.uvTransform.value.copy(E.matrix),(f!==E||h!==E.version||d!==n.toneMapping)&&(c.material.needsUpdate=!0,f=E,h=E.version,d=n.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function m(x,v){x.getRGB(Su,JS(n)),i.buffers.color.setClear(Su.r,Su.g,Su.b,v,o)}function y(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(x,v=1){a.set(x),l=v,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,m(a,l)},render:_,addToRenderList:g,dispose:y}}function CO(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=h(null);let s=r,o=!1;function a(S,D,B,H,$){let ee=!1;const Z=f(H,B,D);s!==Z&&(s=Z,c(s.object)),ee=d(S,H,B,$),ee&&p(S,H,B,$),$!==null&&e.update($,n.ELEMENT_ARRAY_BUFFER),(ee||o)&&(o=!1,v(S,D,B,H),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return n.createVertexArray()}function c(S){return n.bindVertexArray(S)}function u(S){return n.deleteVertexArray(S)}function f(S,D,B){const H=B.wireframe===!0;let $=i[S.id];$===void 0&&($={},i[S.id]=$);let ee=$[D.id];ee===void 0&&(ee={},$[D.id]=ee);let Z=ee[H];return Z===void 0&&(Z=h(l()),ee[H]=Z),Z}function h(S){const D=[],B=[],H=[];for(let $=0;$=0){const ve=$[Q];let re=ee[Q];if(re===void 0&&(Q==="instanceMatrix"&&S.instanceMatrix&&(re=S.instanceMatrix),Q==="instanceColor"&&S.instanceColor&&(re=S.instanceColor)),ve===void 0||ve.attribute!==re||re&&ve.data!==re.data)return!0;Z++}return s.attributesNum!==Z||s.index!==H}function p(S,D,B,H){const $={},ee=D.attributes;let Z=0;const te=B.getAttributes();for(const Q in te)if(te[Q].location>=0){let ve=ee[Q];ve===void 0&&(Q==="instanceMatrix"&&S.instanceMatrix&&(ve=S.instanceMatrix),Q==="instanceColor"&&S.instanceColor&&(ve=S.instanceColor));const re={};re.attribute=ve,ve&&ve.data&&(re.data=ve.data),$[Q]=re,Z++}s.attributes=$,s.attributesNum=Z,s.index=H}function _(){const S=s.newAttributes;for(let D=0,B=S.length;D=0){let pe=$[te];if(pe===void 0&&(te==="instanceMatrix"&&S.instanceMatrix&&(pe=S.instanceMatrix),te==="instanceColor"&&S.instanceColor&&(pe=S.instanceColor)),pe!==void 0){const ve=pe.normalized,re=pe.itemSize,xe=e.get(pe);if(xe===void 0)continue;const ze=xe.buffer,se=xe.type,ge=xe.bytesPerElement,be=se===n.INT||se===n.UNSIGNED_INT||pe.gpuType===bh;if(pe.isInterleavedBufferAttribute){const W=pe.data,ae=W.stride,ue=pe.offset;if(W.isInstancedInterleavedBuffer){for(let le=0;le0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=t.logarithmicDepthBuffer===!0,h=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),g=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),m=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),x=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),E=p>0,T=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:y,maxVaryings:x,maxFragmentUniforms:v,vertexTextures:E,maxSamples:T}}function IO(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Yr,a=new Qe,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){const d=f.length!==0||h||i!==0||r;return r=h,i=f.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,h){t=u(f,h,0)},this.setState=function(f,h,d){const p=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,m=n.get(f);if(!r||p===null||p.length===0||s&&!g)s?u(null):c();else{const y=s?0:i,x=y*4;let v=m.clippingState||null;l.value=v,v=u(p,h,x,d);for(let E=0;E!==x;++E)v[E]=t[E];m.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,h,d,p){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=d+_*4,y=h.matrixWorldInverse;a.getNormalMatrix(y),(g===null||g.length0){const c=new tM(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const jo=4,L0=[.125,.215,.35,.446,.526,.582],Ws=20,op=new Zh,D0=new we;let ap=null,lp=0,cp=0,up=!1;const zs=(1+Math.sqrt(5))/2,ko=1/zs,O0=[new F(-zs,ko,0),new F(zs,ko,0),new F(-ko,0,zs),new F(ko,0,zs),new F(0,zs,-ko),new F(0,zs,ko),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],DO=new F;class om{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100,s={}){const{size:o=256,position:a=DO}=s;ap=this._renderer.getRenderTarget(),lp=this._renderer.getActiveCubeFace(),cp=this._renderer.getActiveMipmapLevel(),up=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,a),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=F0(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=U0(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?v:0,v,v),f.setRenderTarget(r),g&&f.render(_,l),f.render(e,l)}_.geometry.dispose(),_.material.dispose(),f.toneMapping=d,f.autoClear=h,e.background=m}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Er||e.mapping===rs;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=F0()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=U0());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Ht(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Mu(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,op)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sWs&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Ws}`);const m=[];let y=0;for(let M=0;Mx-jo?r-x+jo:0),T=4*(this._cubeSize-v);Mu(t,E,T,3*v,2*v),l.setRenderTarget(t),l.render(f,op)}}function OO(n){const e=[],t=[],i=[];let r=n;const s=n-jo+1+L0.length;for(let o=0;on-jo?l=L0[o-n+jo-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],d=6,p=6,_=3,g=2,m=1,y=new Float32Array(_*p*d),x=new Float32Array(g*p*d),v=new Float32Array(m*p*d);for(let T=0;T2?0:-1,b=[M,P,0,M+2/3,P,0,M+2/3,P+1,0,M,P,0,M+2/3,P+1,0,M,P+1,0];y.set(b,_*p*T),x.set(h,g*p*T);const S=[T,T,T,T,T,T];v.set(S,m*p*T)}const E=new st;E.setAttribute("position",new Et(y,_)),E.setAttribute("uv",new Et(x,g)),E.setAttribute("faceIndex",new Et(v,m)),e.push(E),r>jo&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function N0(n,e,t){const i=new Yi(n,e,t);return i.texture.mapping=_a,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Mu(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function NO(n,e,t){const i=new Float32Array(Ws),r=new F(0,1,0);return new Ri({name:"SphericalGaussianBlur",defines:{n:Ws,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Qg(),fragmentShader:` +}`,st={alphahash_fragment:qI,alphahash_pars_fragment:YI,alphamap_fragment:jI,alphamap_pars_fragment:KI,alphatest_fragment:ZI,alphatest_pars_fragment:JI,aomap_fragment:QI,aomap_pars_fragment:eL,batching_pars_vertex:tL,batching_vertex:nL,begin_vertex:iL,beginnormal_vertex:sL,bsdfs:rL,iridescence_fragment:oL,bumpmap_pars_fragment:aL,clipping_planes_fragment:lL,clipping_planes_pars_fragment:cL,clipping_planes_pars_vertex:uL,clipping_planes_vertex:fL,color_fragment:hL,color_pars_fragment:dL,color_pars_vertex:pL,color_vertex:mL,common:gL,cube_uv_reflection_fragment:_L,defaultnormal_vertex:vL,displacementmap_pars_vertex:yL,displacementmap_vertex:xL,emissivemap_fragment:bL,emissivemap_pars_fragment:SL,colorspace_fragment:ML,colorspace_pars_fragment:EL,envmap_fragment:TL,envmap_common_pars_fragment:wL,envmap_pars_fragment:AL,envmap_pars_vertex:CL,envmap_physical_pars_fragment:kL,envmap_vertex:RL,fog_vertex:PL,fog_pars_vertex:IL,fog_fragment:LL,fog_pars_fragment:DL,gradientmap_pars_fragment:OL,lightmap_pars_fragment:NL,lights_lambert_fragment:UL,lights_lambert_pars_fragment:FL,lights_pars_begin:BL,lights_toon_fragment:VL,lights_toon_pars_fragment:zL,lights_phong_fragment:HL,lights_phong_pars_fragment:GL,lights_physical_fragment:WL,lights_physical_pars_fragment:XL,lights_fragment_begin:$L,lights_fragment_maps:qL,lights_fragment_end:YL,logdepthbuf_fragment:jL,logdepthbuf_pars_fragment:KL,logdepthbuf_pars_vertex:ZL,logdepthbuf_vertex:JL,map_fragment:QL,map_pars_fragment:e2,map_particle_fragment:t2,map_particle_pars_fragment:n2,metalnessmap_fragment:i2,metalnessmap_pars_fragment:s2,morphinstance_vertex:r2,morphcolor_vertex:o2,morphnormal_vertex:a2,morphtarget_pars_vertex:l2,morphtarget_vertex:c2,normal_fragment_begin:u2,normal_fragment_maps:f2,normal_pars_fragment:h2,normal_pars_vertex:d2,normal_vertex:p2,normalmap_pars_fragment:m2,clearcoat_normal_fragment_begin:g2,clearcoat_normal_fragment_maps:_2,clearcoat_pars_fragment:v2,iridescence_pars_fragment:y2,opaque_fragment:x2,packing:b2,premultiplied_alpha_fragment:S2,project_vertex:M2,dithering_fragment:E2,dithering_pars_fragment:T2,roughnessmap_fragment:w2,roughnessmap_pars_fragment:A2,shadowmap_pars_fragment:C2,shadowmap_pars_vertex:R2,shadowmap_vertex:P2,shadowmask_pars_fragment:I2,skinbase_vertex:L2,skinning_pars_vertex:D2,skinning_vertex:O2,skinnormal_vertex:N2,specularmap_fragment:U2,specularmap_pars_fragment:F2,tonemapping_fragment:B2,tonemapping_pars_fragment:k2,transmission_fragment:V2,transmission_pars_fragment:z2,uv_pars_fragment:H2,uv_pars_vertex:G2,uv_vertex:W2,worldpos_vertex:X2,background_vert:$2,background_frag:q2,backgroundCube_vert:Y2,backgroundCube_frag:j2,cube_vert:K2,cube_frag:Z2,depth_vert:J2,depth_frag:Q2,distanceRGBA_vert:eD,distanceRGBA_frag:tD,equirect_vert:nD,equirect_frag:iD,linedashed_vert:sD,linedashed_frag:rD,meshbasic_vert:oD,meshbasic_frag:aD,meshlambert_vert:lD,meshlambert_frag:cD,meshmatcap_vert:uD,meshmatcap_frag:fD,meshnormal_vert:hD,meshnormal_frag:dD,meshphong_vert:pD,meshphong_frag:mD,meshphysical_vert:gD,meshphysical_frag:_D,meshtoon_vert:vD,meshtoon_frag:yD,points_vert:xD,points_frag:bD,shadow_vert:SD,shadow_frag:MD,sprite_vert:ED,sprite_frag:TD},Ee={common:{diffuse:{value:new we(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Qe},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Qe}},envmap:{envMap:{value:null},envMapRotation:{value:new Qe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Qe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Qe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Qe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Qe},normalScale:{value:new fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Qe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Qe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Qe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Qe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new we(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new we(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0},uvTransform:{value:new Qe}},sprite:{diffuse:{value:new we(16777215)},opacity:{value:1},center:{value:new fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Qe},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0}}},bi={basic:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.fog]),vertexShader:st.meshbasic_vert,fragmentShader:st.meshbasic_frag},lambert:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)}}]),vertexShader:st.meshlambert_vert,fragmentShader:st.meshlambert_frag},phong:{uniforms:En([Ee.common,Ee.specularmap,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)},specular:{value:new we(1118481)},shininess:{value:30}}]),vertexShader:st.meshphong_vert,fragmentShader:st.meshphong_frag},standard:{uniforms:En([Ee.common,Ee.envmap,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.roughnessmap,Ee.metalnessmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:st.meshphysical_vert,fragmentShader:st.meshphysical_frag},toon:{uniforms:En([Ee.common,Ee.aomap,Ee.lightmap,Ee.emissivemap,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.gradientmap,Ee.fog,Ee.lights,{emissive:{value:new we(0)}}]),vertexShader:st.meshtoon_vert,fragmentShader:st.meshtoon_frag},matcap:{uniforms:En([Ee.common,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,Ee.fog,{matcap:{value:null}}]),vertexShader:st.meshmatcap_vert,fragmentShader:st.meshmatcap_frag},points:{uniforms:En([Ee.points,Ee.fog]),vertexShader:st.points_vert,fragmentShader:st.points_frag},dashed:{uniforms:En([Ee.common,Ee.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:st.linedashed_vert,fragmentShader:st.linedashed_frag},depth:{uniforms:En([Ee.common,Ee.displacementmap]),vertexShader:st.depth_vert,fragmentShader:st.depth_frag},normal:{uniforms:En([Ee.common,Ee.bumpmap,Ee.normalmap,Ee.displacementmap,{opacity:{value:1}}]),vertexShader:st.meshnormal_vert,fragmentShader:st.meshnormal_frag},sprite:{uniforms:En([Ee.sprite,Ee.fog]),vertexShader:st.sprite_vert,fragmentShader:st.sprite_frag},background:{uniforms:{uvTransform:{value:new Qe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:st.background_vert,fragmentShader:st.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Qe}},vertexShader:st.backgroundCube_vert,fragmentShader:st.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:st.cube_vert,fragmentShader:st.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:st.equirect_vert,fragmentShader:st.equirect_frag},distanceRGBA:{uniforms:En([Ee.common,Ee.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:st.distanceRGBA_vert,fragmentShader:st.distanceRGBA_frag},shadow:{uniforms:En([Ee.lights,Ee.fog,{color:{value:new we(0)},opacity:{value:1}}]),vertexShader:st.shadow_vert,fragmentShader:st.shadow_frag}};bi.physical={uniforms:En([bi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Qe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Qe},clearcoatNormalScale:{value:new fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Qe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Qe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Qe},sheen:{value:0},sheenColor:{value:new we(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Qe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Qe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Qe},transmissionSamplerSize:{value:new fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Qe},attenuationDistance:{value:0},attenuationColor:{value:new we(0)},specularColor:{value:new we(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Qe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Qe},anisotropyVector:{value:new fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Qe}}]),vertexShader:st.meshphysical_vert,fragmentShader:st.meshphysical_frag};const Su={r:0,b:0,g:0},Or=new ei,wD=new Xe;function AD(n,e,t,i,s,r,o){const a=new we(0);let l=r===!0?0:1,c,u,f=null,h=0,d=null;function p(x){let v=x.isScene===!0?x.background:null;return v&&v.isTexture&&(v=(x.backgroundBlurriness>0?t:e).get(v)),v}function _(x){let v=!1;const E=p(x);E===null?m(a,l):E&&E.isColor&&(m(E,1),v=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||v)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function g(x,v){const E=p(v);E&&(E.isCubeTexture||E.mapping===_a)?(u===void 0&&(u=new Ht(new mo(1,1,1),new Ri({name:"BackgroundCubeMaterial",uniforms:la(bi.backgroundCube.uniforms),vertexShader:bi.backgroundCube.vertexShader,fragmentShader:bi.backgroundCube.fragmentShader,side:Dn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,M,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Or.copy(v.backgroundRotation),Or.x*=-1,Or.y*=-1,Or.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Or.y*=-1,Or.z*=-1),u.material.uniforms.envMap.value=E,u.material.uniforms.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(wD.makeRotationFromEuler(Or)),u.material.toneMapped=at.getTransfer(E.colorSpace)!==St,(f!==E||h!==E.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,f=E,h=E.version,d=n.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):E&&E.isTexture&&(c===void 0&&(c=new Ht(new ba(2,2),new Ri({name:"BackgroundMaterial",uniforms:la(bi.background.uniforms),vertexShader:bi.background.vertexShader,fragmentShader:bi.background.fragmentShader,side:Ms,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=E,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=at.getTransfer(E.colorSpace)!==St,E.matrixAutoUpdate===!0&&E.updateMatrix(),c.material.uniforms.uvTransform.value.copy(E.matrix),(f!==E||h!==E.version||d!==n.toneMapping)&&(c.material.needsUpdate=!0,f=E,h=E.version,d=n.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function m(x,v){x.getRGB(Su,JS(n)),i.buffers.color.setClear(Su.r,Su.g,Su.b,v,o)}function y(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(x,v=1){a.set(x),l=v,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,m(a,l)},render:_,addToRenderList:g,dispose:y}}function CD(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=h(null);let r=s,o=!1;function a(S,D,B,H,$){let ee=!1;const Z=f(H,B,D);r!==Z&&(r=Z,c(r.object)),ee=d(S,H,B,$),ee&&p(S,H,B,$),$!==null&&e.update($,n.ELEMENT_ARRAY_BUFFER),(ee||o)&&(o=!1,v(S,D,B,H),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return n.createVertexArray()}function c(S){return n.bindVertexArray(S)}function u(S){return n.deleteVertexArray(S)}function f(S,D,B){const H=B.wireframe===!0;let $=i[S.id];$===void 0&&($={},i[S.id]=$);let ee=$[D.id];ee===void 0&&(ee={},$[D.id]=ee);let Z=ee[H];return Z===void 0&&(Z=h(l()),ee[H]=Z),Z}function h(S){const D=[],B=[],H=[];for(let $=0;$=0){const ve=$[Q];let se=ee[Q];if(se===void 0&&(Q==="instanceMatrix"&&S.instanceMatrix&&(se=S.instanceMatrix),Q==="instanceColor"&&S.instanceColor&&(se=S.instanceColor)),ve===void 0||ve.attribute!==se||se&&ve.data!==se.data)return!0;Z++}return r.attributesNum!==Z||r.index!==H}function p(S,D,B,H){const $={},ee=D.attributes;let Z=0;const te=B.getAttributes();for(const Q in te)if(te[Q].location>=0){let ve=ee[Q];ve===void 0&&(Q==="instanceMatrix"&&S.instanceMatrix&&(ve=S.instanceMatrix),Q==="instanceColor"&&S.instanceColor&&(ve=S.instanceColor));const se={};se.attribute=ve,ve&&ve.data&&(se.data=ve.data),$[Q]=se,Z++}r.attributes=$,r.attributesNum=Z,r.index=H}function _(){const S=r.newAttributes;for(let D=0,B=S.length;D=0){let pe=$[te];if(pe===void 0&&(te==="instanceMatrix"&&S.instanceMatrix&&(pe=S.instanceMatrix),te==="instanceColor"&&S.instanceColor&&(pe=S.instanceColor)),pe!==void 0){const ve=pe.normalized,se=pe.itemSize,xe=e.get(pe);if(xe===void 0)continue;const ze=xe.buffer,re=xe.type,ge=xe.bytesPerElement,be=re===n.INT||re===n.UNSIGNED_INT||pe.gpuType===bh;if(pe.isInterleavedBufferAttribute){const W=pe.data,ae=W.stride,ue=pe.offset;if(W.isInstancedInterleavedBuffer){for(let le=0;le0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=t.logarithmicDepthBuffer===!0,h=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),g=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),m=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),x=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),E=p>0,T=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:y,maxVaryings:x,maxFragmentUniforms:v,vertexTextures:E,maxSamples:T}}function ID(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new Ys,a=new Qe,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){const d=f.length!==0||h||i!==0||s;return s=h,i=f.length,d},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(f,h){t=u(f,h,0)},this.setState=function(f,h,d){const p=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,m=n.get(f);if(!s||p===null||p.length===0||r&&!g)r?u(null):c();else{const y=r?0:i,x=y*4;let v=m.clippingState||null;l.value=v,v=u(p,h,x,d);for(let E=0;E!==x;++E)v[E]=t[E];m.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,h,d,p){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=d+_*4,y=h.matrixWorldInverse;a.getNormalMatrix(y),(g===null||g.length0){const c=new tM(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",s),t(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}const jo=4,Lv=[.125,.215,.35,.446,.526,.582],Wr=20,op=new Zh,Dv=new we;let ap=null,lp=0,cp=0,up=!1;const zr=(1+Math.sqrt(5))/2,ko=1/zr,Ov=[new F(-zr,ko,0),new F(zr,ko,0),new F(-ko,0,zr),new F(ko,0,zr),new F(0,zr,-ko),new F(0,zr,ko),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],DD=new F;class om{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100,r={}){const{size:o=256,position:a=DD}=r;ap=this._renderer.getRenderTarget(),lp=this._renderer.getActiveCubeFace(),cp=this._renderer.getActiveMipmapLevel(),up=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,s,l,a),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Fv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Uv(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?v:0,v,v),f.setRenderTarget(s),g&&f.render(_,l),f.render(e,l)}_.geometry.dispose(),_.material.dispose(),f.toneMapping=d,f.autoClear=h,e.background=m}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===Es||e.mapping===sr;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=Fv()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Uv());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new Ht(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;Mu(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,op)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rWr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Wr}`);const m=[];let y=0;for(let M=0;Mx-jo?s-x+jo:0),T=4*(this._cubeSize-v);Mu(t,E,T,3*v,2*v),l.setRenderTarget(t),l.render(f,op)}}function OD(n){const e=[],t=[],i=[];let s=n;const r=n-jo+1+Lv.length;for(let o=0;on-jo?l=Lv[o-n+jo-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],d=6,p=6,_=3,g=2,m=1,y=new Float32Array(_*p*d),x=new Float32Array(g*p*d),v=new Float32Array(m*p*d);for(let T=0;T2?0:-1,b=[M,P,0,M+2/3,P,0,M+2/3,P+1,0,M,P,0,M+2/3,P+1,0,M,P+1,0];y.set(b,_*p*T),x.set(h,g*p*T);const S=[T,T,T,T,T,T];v.set(S,m*p*T)}const E=new rt;E.setAttribute("position",new Et(y,_)),E.setAttribute("uv",new Et(x,g)),E.setAttribute("faceIndex",new Et(v,m)),e.push(E),s>jo&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function Nv(n,e,t){const i=new Yi(n,e,t);return i.texture.mapping=_a,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Mu(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function ND(n,e,t){const i=new Float32Array(Wr),s=new F(0,1,0);return new Ri({name:"SphericalGaussianBlur",defines:{n:Wr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Qg(),fragmentShader:` precision mediump float; precision mediump int; @@ -3648,7 +3648,7 @@ void main() { } } - `,blending:yr,depthTest:!1,depthWrite:!1})}function U0(){return new Ri({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Qg(),fragmentShader:` + `,blending:ys,depthTest:!1,depthWrite:!1})}function Uv(){return new Ri({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Qg(),fragmentShader:` precision mediump float; precision mediump int; @@ -3667,7 +3667,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:yr,depthTest:!1,depthWrite:!1})}function F0(){return new Ri({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Qg(),fragmentShader:` + `,blending:ys,depthTest:!1,depthWrite:!1})}function Fv(){return new Ri({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Qg(),fragmentShader:` precision mediump float; precision mediump int; @@ -3683,7 +3683,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:yr,depthTest:!1,depthWrite:!1})}function Qg(){return` + `,blending:ys,depthTest:!1,depthWrite:!1})}function Qg(){return` precision mediump float; precision mediump int; @@ -3738,17 +3738,17 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function UO(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Pl||l===Il,u=l===Er||l===rs;if(c||u){let f=e.get(a);const h=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return t===null&&(t=new om(n)),f=c?t.fromEquirectangular(a,f):t.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const d=a.image;return c&&d&&d.height>0||u&&d&&r(d)?(t===null&&(t=new om(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",s),f.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const T=new Float32Array(v*E*4*f),M=new fc(T,v,E,f);M.type=Hn,M.needsUpdate=!0;const P=x*4;for(let S=0;S0)return n;const r=e*t;let s=k0[r];if(s===void 0&&(s=new Float32Array(r),k0[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Jt(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}const $0=new Qe;function U2(n){at._getMatrix($0,at.workingColorSpace,n);const e=`mat3( ${$0.elements.map(t=>t.toFixed(4))} )`;switch(at.getTransfer(n)){case Ul:return[e,"LinearTransferOETF"];case St:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function q0(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` + `}function UD(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Pl||l===Il,u=l===Es||l===sr;if(c||u){let f=e.get(a);const h=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return t===null&&(t=new om(n)),f=c?t.fromEquirectangular(a,f):t.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const d=a.image;return c&&d&&d.height>0||u&&d&&s(d)?(t===null&&(t=new om(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",r),f.texture):null}}}return a}function s(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const T=new Float32Array(v*E*4*f),M=new fc(T,v,E,f);M.type=Hn,M.needsUpdate=!0;const P=x*4;for(let S=0;S0)return n;const s=e*t;let r=kv[s];if(r===void 0&&(r=new Float32Array(s),kv[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function Jt(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}const $v=new Qe;function U3(n){at._getMatrix($v,at.workingColorSpace,n);const e=`mat3( ${$v.elements.map(t=>t.toFixed(4))} )`;switch(at.getTransfer(n)){case Ul:return[e,"LinearTransferOETF"];case St:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function qv(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` -`+r+` +`+s+` -`+N2(n.getShaderSource(e),o)}else return r}function F2(n,e){const t=U2(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` -`)}function B2(n,e){let t;switch(e){case CS:t="Linear";break;case RS:t="Reinhard";break;case PS:t="Cineon";break;case yh:t="ACESFilmic";break;case LS:t="AgX";break;case DS:t="Neutral";break;case IS:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Eu=new F;function k2(){at.getLuminanceCoefficients(Eu);const n=Eu.x.toFixed(4),e=Eu.y.toFixed(4),t=Eu.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` -`)}function V2(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter($a).join(` -`)}function z2(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function H2(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function am(n){return n.replace(G2,X2)}const W2=new Map;function X2(n,e){let t=rt[e];if(t===void 0){const i=W2.get(e);if(i!==void 0)t=rt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return am(t)}const $2=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function K0(n){return n.replace($2,q2)}function q2(n,e,t,i){let r="";for(let s=parseInt(e);s/gm;function am(n){return n.replace(G3,X3)}const W3=new Map;function X3(n,e){let t=st[e];if(t===void 0){const i=W3.get(e);if(i!==void 0)t=st[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return am(t)}const $3=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Kv(n){return n.replace($3,q3)}function q3(n,e,t,i){let s="";for(let r=parseInt(e);r0&&(g+=` `),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter($a).join(` `),m.length>0&&(m+=` -`)):(g=[Z0(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`)):(g=[Zv(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter($a).join(` -`),m=[Z0(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hi?"#define TONE_MAPPING":"",t.toneMapping!==Hi?rt.tonemapping_pars_fragment:"",t.toneMapping!==Hi?B2("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",rt.colorspace_pars_fragment,F2("linearToOutputTexel",t.outputColorSpace),k2(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`),m=[Zv(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hi?"#define TONE_MAPPING":"",t.toneMapping!==Hi?st.tonemapping_pars_fragment:"",t.toneMapping!==Hi?B3("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",st.colorspace_pars_fragment,F3("linearToOutputTexel",t.outputColorSpace),k3(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter($a).join(` -`)),o=am(o),o=Y0(o,t),o=j0(o,t),a=am(a),a=Y0(a,t),a=j0(a,t),o=K0(o),a=K0(a),t.isRawShaderMaterial!==!0&&(y=`#version 300 es +`)),o=am(o),o=Yv(o,t),o=jv(o,t),a=am(a),a=Yv(a,t),a=jv(a,t),o=Kv(o),a=Kv(a),t.isRawShaderMaterial!==!0&&(y=`#version 300 es `,g=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+g,m=["#define varying in",t.glslVersion===Jp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Jp?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+m);const x=y+g+o,v=y+m+a,E=X0(r,r.VERTEX_SHADER,x),T=X0(r,r.FRAGMENT_SHADER,v);r.attachShader(_,E),r.attachShader(_,T),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function M(D){if(n.debug.checkShaderErrors){const B=r.getProgramInfoLog(_).trim(),H=r.getShaderInfoLog(E).trim(),$=r.getShaderInfoLog(T).trim();let ee=!0,Z=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(ee=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,E,T);else{const te=q0(r,E,"vertex"),Q=q0(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` +`+m);const x=y+g+o,v=y+m+a,E=Xv(s,s.VERTEX_SHADER,x),T=Xv(s,s.FRAGMENT_SHADER,v);s.attachShader(_,E),s.attachShader(_,T),t.index0AttributeName!==void 0?s.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_);function M(D){if(n.debug.checkShaderErrors){const B=s.getProgramInfoLog(_).trim(),H=s.getShaderInfoLog(E).trim(),$=s.getShaderInfoLog(T).trim();let ee=!0,Z=!0;if(s.getProgramParameter(_,s.LINK_STATUS)===!1)if(ee=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,_,E,T);else{const te=qv(s,E,"vertex"),Q=qv(s,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,s.VALIDATE_STATUS)+` Material Name: `+D.name+` Material Type: `+D.type+` Program Info Log: `+B+` `+te+` -`+Q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(H===""||$==="")&&(Z=!1);Z&&(D.diagnostics={runnable:ee,programLog:B,vertexShader:{log:H,prefix:g},fragmentShader:{log:$,prefix:m}})}r.deleteShader(E),r.deleteShader(T),P=new Xu(r,_),b=H2(r,_)}let P;this.getUniforms=function(){return P===void 0&&M(this),P};let b;this.getAttributes=function(){return b===void 0&&M(this),b};let S=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return S===!1&&(S=r.getProgramParameter(_,D2)),S},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=O2++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}let eN=0;class tN{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new nN(e),t.set(e,i)),i}}class nN{constructor(e){this.id=eN++,this.code=e,this.usedTimes=0}}function iN(n,e,t,i,r,s,o){const a=new Ph,l=new tN,c=new Set,u=[],f=r.logarithmicDepthBuffer,h=r.vertexTextures;let d=r.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,S,D,B,H){const $=B.fog,ee=H.geometry,Z=b.isMeshStandardMaterial?B.environment:null,te=(b.isMeshStandardMaterial?t:e).get(b.envMap||Z),Q=te&&te.mapping===_a?te.image.height:null,pe=p[b.type];b.precision!==null&&(d=r.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));const ve=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,re=ve!==void 0?ve.length:0;let xe=0;ee.morphAttributes.position!==void 0&&(xe=1),ee.morphAttributes.normal!==void 0&&(xe=2),ee.morphAttributes.color!==void 0&&(xe=3);let ze,se,ge,be;if(pe){const bt=bi[pe];ze=bt.vertexShader,se=bt.fragmentShader}else ze=b.vertexShader,se=b.fragmentShader,l.update(b),ge=l.getVertexShaderID(b),be=l.getFragmentShaderID(b);const W=n.getRenderTarget(),ae=n.state.buffers.depth.getReversed(),ue=H.isInstancedMesh===!0,le=H.isBatchedMesh===!0,Oe=!!b.map,I=!!b.matcap,L=!!te,w=!!b.aoMap,j=!!b.lightMap,G=!!b.bumpMap,q=!!b.normalMap,R=!!b.displacementMap,N=!!b.emissiveMap,V=!!b.metalnessMap,A=!!b.roughnessMap,C=b.anisotropy>0,k=b.clearcoat>0,U=b.dispersion>0,z=b.iridescence>0,Y=b.sheen>0,he=b.transmission>0,ce=C&&!!b.anisotropyMap,ye=k&&!!b.clearcoatMap,Fe=k&&!!b.clearcoatNormalMap,me=k&&!!b.clearcoatRoughnessMap,Te=z&&!!b.iridescenceMap,ke=z&&!!b.iridescenceThicknessMap,We=Y&&!!b.sheenColorMap,Me=Y&&!!b.sheenRoughnessMap,qe=!!b.specularMap,Je=!!b.specularColorMap,Ct=!!b.specularIntensityMap,X=he&&!!b.transmissionMap,Ae=he&&!!b.thicknessMap,oe=!!b.gradientMap,de=!!b.alphaMap,Pe=b.alphaTest>0,Re=!!b.alphaHash,nt=!!b.extensions;let Ft=Hi;b.toneMapped&&(W===null||W.isXRRenderTarget===!0)&&(Ft=n.toneMapping);const un={shaderID:pe,shaderType:b.type,shaderName:b.name,vertexShader:ze,fragmentShader:se,defines:b.defines,customVertexShaderID:ge,customFragmentShaderID:be,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:le,batchingColor:le&&H._colorsTexture!==null,instancing:ue,instancingColor:ue&&H.instanceColor!==null,instancingMorph:ue&&H.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:W===null?n.outputColorSpace:W.isXRRenderTarget===!0?W.texture.colorSpace:co,alphaToCoverage:!!b.alphaToCoverage,map:Oe,matcap:I,envMap:L,envMapMode:L&&te.mapping,envMapCubeUVHeight:Q,aoMap:w,lightMap:j,bumpMap:G,normalMap:q,displacementMap:h&&R,emissiveMap:N,normalMapObjectSpace:q&&b.normalMapType===VS,normalMapTangentSpace:q&&b.normalMapType===us,metalnessMap:V,roughnessMap:A,anisotropy:C,anisotropyMap:ce,clearcoat:k,clearcoatMap:ye,clearcoatNormalMap:Fe,clearcoatRoughnessMap:me,dispersion:U,iridescence:z,iridescenceMap:Te,iridescenceThicknessMap:ke,sheen:Y,sheenColorMap:We,sheenRoughnessMap:Me,specularMap:qe,specularColorMap:Je,specularIntensityMap:Ct,transmission:he,transmissionMap:X,thicknessMap:Ae,gradientMap:oe,opaque:b.transparent===!1&&b.blending===Qs&&b.alphaToCoverage===!1,alphaMap:de,alphaTest:Pe,alphaHash:Re,combine:b.combine,mapUv:Oe&&_(b.map.channel),aoMapUv:w&&_(b.aoMap.channel),lightMapUv:j&&_(b.lightMap.channel),bumpMapUv:G&&_(b.bumpMap.channel),normalMapUv:q&&_(b.normalMap.channel),displacementMapUv:R&&_(b.displacementMap.channel),emissiveMapUv:N&&_(b.emissiveMap.channel),metalnessMapUv:V&&_(b.metalnessMap.channel),roughnessMapUv:A&&_(b.roughnessMap.channel),anisotropyMapUv:ce&&_(b.anisotropyMap.channel),clearcoatMapUv:ye&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Fe&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:me&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Te&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:We&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Me&&_(b.sheenRoughnessMap.channel),specularMapUv:qe&&_(b.specularMap.channel),specularColorMapUv:Je&&_(b.specularColorMap.channel),specularIntensityMapUv:Ct&&_(b.specularIntensityMap.channel),transmissionMapUv:X&&_(b.transmissionMap.channel),thicknessMapUv:Ae&&_(b.thicknessMap.channel),alphaMapUv:de&&_(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(q||C),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!ee.attributes.uv&&(Oe||de),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:ae,skinning:H.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:xe,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numLightProbes:S.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ft,decodeVideoTexture:Oe&&b.map.isVideoTexture===!0&&at.getTransfer(b.map.colorSpace)===St,decodeVideoTextureEmissive:N&&b.emissiveMap.isVideoTexture===!0&&at.getTransfer(b.emissiveMap.colorSpace)===St,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Si,flipSided:b.side===Dn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:nt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(nt&&b.extensions.multiDraw===!0||le)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return un.vertexUv1s=c.has(1),un.vertexUv2s=c.has(2),un.vertexUv3s=c.has(3),c.clear(),un}function m(b){const S=[];if(b.shaderID?S.push(b.shaderID):(S.push(b.customVertexShaderID),S.push(b.customFragmentShaderID)),b.defines!==void 0)for(const D in b.defines)S.push(D),S.push(b.defines[D]);return b.isRawShaderMaterial===!1&&(y(S,b),x(S,b),S.push(n.outputColorSpace)),S.push(b.customProgramCacheKey),S.join()}function y(b,S){b.push(S.precision),b.push(S.outputColorSpace),b.push(S.envMapMode),b.push(S.envMapCubeUVHeight),b.push(S.mapUv),b.push(S.alphaMapUv),b.push(S.lightMapUv),b.push(S.aoMapUv),b.push(S.bumpMapUv),b.push(S.normalMapUv),b.push(S.displacementMapUv),b.push(S.emissiveMapUv),b.push(S.metalnessMapUv),b.push(S.roughnessMapUv),b.push(S.anisotropyMapUv),b.push(S.clearcoatMapUv),b.push(S.clearcoatNormalMapUv),b.push(S.clearcoatRoughnessMapUv),b.push(S.iridescenceMapUv),b.push(S.iridescenceThicknessMapUv),b.push(S.sheenColorMapUv),b.push(S.sheenRoughnessMapUv),b.push(S.specularMapUv),b.push(S.specularColorMapUv),b.push(S.specularIntensityMapUv),b.push(S.transmissionMapUv),b.push(S.thicknessMapUv),b.push(S.combine),b.push(S.fogExp2),b.push(S.sizeAttenuation),b.push(S.morphTargetsCount),b.push(S.morphAttributeCount),b.push(S.numDirLights),b.push(S.numPointLights),b.push(S.numSpotLights),b.push(S.numSpotLightMaps),b.push(S.numHemiLights),b.push(S.numRectAreaLights),b.push(S.numDirLightShadows),b.push(S.numPointLightShadows),b.push(S.numSpotLightShadows),b.push(S.numSpotLightShadowsWithMaps),b.push(S.numLightProbes),b.push(S.shadowMapType),b.push(S.toneMapping),b.push(S.numClippingPlanes),b.push(S.numClipIntersection),b.push(S.depthPacking)}function x(b,S){a.disableAll(),S.supportsVertexTextures&&a.enable(0),S.instancing&&a.enable(1),S.instancingColor&&a.enable(2),S.instancingMorph&&a.enable(3),S.matcap&&a.enable(4),S.envMap&&a.enable(5),S.normalMapObjectSpace&&a.enable(6),S.normalMapTangentSpace&&a.enable(7),S.clearcoat&&a.enable(8),S.iridescence&&a.enable(9),S.alphaTest&&a.enable(10),S.vertexColors&&a.enable(11),S.vertexAlphas&&a.enable(12),S.vertexUv1s&&a.enable(13),S.vertexUv2s&&a.enable(14),S.vertexUv3s&&a.enable(15),S.vertexTangents&&a.enable(16),S.anisotropy&&a.enable(17),S.alphaHash&&a.enable(18),S.batching&&a.enable(19),S.dispersion&&a.enable(20),S.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),S.fog&&a.enable(0),S.useFog&&a.enable(1),S.flatShading&&a.enable(2),S.logarithmicDepthBuffer&&a.enable(3),S.reverseDepthBuffer&&a.enable(4),S.skinning&&a.enable(5),S.morphTargets&&a.enable(6),S.morphNormals&&a.enable(7),S.morphColors&&a.enable(8),S.premultipliedAlpha&&a.enable(9),S.shadowMapEnabled&&a.enable(10),S.doubleSided&&a.enable(11),S.flipSided&&a.enable(12),S.useDepthPacking&&a.enable(13),S.dithering&&a.enable(14),S.transmission&&a.enable(15),S.sheen&&a.enable(16),S.opaque&&a.enable(17),S.pointsUvs&&a.enable(18),S.decodeVideoTexture&&a.enable(19),S.decodeVideoTextureEmissive&&a.enable(20),S.alphaToCoverage&&a.enable(21),b.push(a.mask)}function v(b){const S=p[b.type];let D;if(S){const B=bi[S];D=QS.clone(B.uniforms)}else D=b.uniforms;return D}function E(b,S){let D;for(let B=0,H=u.length;B0?i.push(m):d.transparent===!0?r.push(m):t.push(m)}function l(f,h,d,p,_,g){const m=o(f,h,d,p,_,g);d.transmission>0?i.unshift(m):d.transparent===!0?r.unshift(m):t.unshift(m)}function c(f,h){t.length>1&&t.sort(f||sN),i.length>1&&i.sort(h||J0),r.length>1&&r.sort(h||J0)}function u(){for(let f=e,h=n.length;f=s.length?(o=new Q0,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function aN(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new we};break;case"SpotLight":t={position:new F,direction:new F,color:new we,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new we,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new we,groundColor:new we};break;case"RectAreaLight":t={color:new we,position:new F,halfWidth:new F,halfHeight:new F};break}return n[e.id]=t,t}}}function lN(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let cN=0;function uN(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function fN(n){const e=new aN,t=lN(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new F);const r=new F,s=new Xe,o=new Xe;function a(c){let u=0,f=0,h=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let d=0,p=0,_=0,g=0,m=0,y=0,x=0,v=0,E=0,T=0,M=0;c.sort(uN);for(let b=0,S=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ee.LTC_FLOAT_1,i.rectAreaLTC2=Ee.LTC_FLOAT_2):(i.rectAreaLTC1=Ee.LTC_HALF_1,i.rectAreaLTC2=Ee.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=h;const P=i.hash;(P.directionalLength!==d||P.pointLength!==p||P.spotLength!==_||P.rectAreaLength!==g||P.hemiLength!==m||P.numDirectionalShadows!==y||P.numPointShadows!==x||P.numSpotShadows!==v||P.numSpotMaps!==E||P.numLightProbes!==M)&&(i.directional.length=d,i.spot.length=_,i.rectArea.length=g,i.point.length=p,i.hemi.length=m,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=v+E-T,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=M,P.directionalLength=d,P.pointLength=p,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=m,P.numDirectionalShadows=y,P.numPointShadows=x,P.numSpotShadows=v,P.numSpotMaps=E,P.numLightProbes=M,i.version=cN++)}function l(c,u){let f=0,h=0,d=0,p=0,_=0;const g=u.matrixWorldInverse;for(let m=0,y=c.length;m=o.length?(a=new ey(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const dN=`void main() { +`+Q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(H===""||$==="")&&(Z=!1);Z&&(D.diagnostics={runnable:ee,programLog:B,vertexShader:{log:H,prefix:g},fragmentShader:{log:$,prefix:m}})}s.deleteShader(E),s.deleteShader(T),P=new Xu(s,_),b=H3(s,_)}let P;this.getUniforms=function(){return P===void 0&&M(this),P};let b;this.getAttributes=function(){return b===void 0&&M(this),b};let S=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return S===!1&&(S=s.getProgramParameter(_,D3)),S},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=O3++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}let eO=0;class tO{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new nO(e),t.set(e,i)),i}}class nO{constructor(e){this.id=eO++,this.code=e,this.usedTimes=0}}function iO(n,e,t,i,s,r,o){const a=new Ph,l=new tO,c=new Set,u=[],f=s.logarithmicDepthBuffer,h=s.vertexTextures;let d=s.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,S,D,B,H){const $=B.fog,ee=H.geometry,Z=b.isMeshStandardMaterial?B.environment:null,te=(b.isMeshStandardMaterial?t:e).get(b.envMap||Z),Q=te&&te.mapping===_a?te.image.height:null,pe=p[b.type];b.precision!==null&&(d=s.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));const ve=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,se=ve!==void 0?ve.length:0;let xe=0;ee.morphAttributes.position!==void 0&&(xe=1),ee.morphAttributes.normal!==void 0&&(xe=2),ee.morphAttributes.color!==void 0&&(xe=3);let ze,re,ge,be;if(pe){const bt=bi[pe];ze=bt.vertexShader,re=bt.fragmentShader}else ze=b.vertexShader,re=b.fragmentShader,l.update(b),ge=l.getVertexShaderID(b),be=l.getFragmentShaderID(b);const W=n.getRenderTarget(),ae=n.state.buffers.depth.getReversed(),ue=H.isInstancedMesh===!0,le=H.isBatchedMesh===!0,Oe=!!b.map,I=!!b.matcap,L=!!te,w=!!b.aoMap,j=!!b.lightMap,G=!!b.bumpMap,q=!!b.normalMap,R=!!b.displacementMap,N=!!b.emissiveMap,V=!!b.metalnessMap,A=!!b.roughnessMap,C=b.anisotropy>0,k=b.clearcoat>0,U=b.dispersion>0,z=b.iridescence>0,Y=b.sheen>0,he=b.transmission>0,ce=C&&!!b.anisotropyMap,ye=k&&!!b.clearcoatMap,Fe=k&&!!b.clearcoatNormalMap,me=k&&!!b.clearcoatRoughnessMap,Te=z&&!!b.iridescenceMap,ke=z&&!!b.iridescenceThicknessMap,We=Y&&!!b.sheenColorMap,Me=Y&&!!b.sheenRoughnessMap,qe=!!b.specularMap,Je=!!b.specularColorMap,Ct=!!b.specularIntensityMap,X=he&&!!b.transmissionMap,Ae=he&&!!b.thicknessMap,oe=!!b.gradientMap,de=!!b.alphaMap,Pe=b.alphaTest>0,Re=!!b.alphaHash,nt=!!b.extensions;let Ft=Hi;b.toneMapped&&(W===null||W.isXRRenderTarget===!0)&&(Ft=n.toneMapping);const un={shaderID:pe,shaderType:b.type,shaderName:b.name,vertexShader:ze,fragmentShader:re,defines:b.defines,customVertexShaderID:ge,customFragmentShaderID:be,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:le,batchingColor:le&&H._colorsTexture!==null,instancing:ue,instancingColor:ue&&H.instanceColor!==null,instancingMorph:ue&&H.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:W===null?n.outputColorSpace:W.isXRRenderTarget===!0?W.texture.colorSpace:co,alphaToCoverage:!!b.alphaToCoverage,map:Oe,matcap:I,envMap:L,envMapMode:L&&te.mapping,envMapCubeUVHeight:Q,aoMap:w,lightMap:j,bumpMap:G,normalMap:q,displacementMap:h&&R,emissiveMap:N,normalMapObjectSpace:q&&b.normalMapType===VS,normalMapTangentSpace:q&&b.normalMapType===ur,metalnessMap:V,roughnessMap:A,anisotropy:C,anisotropyMap:ce,clearcoat:k,clearcoatMap:ye,clearcoatNormalMap:Fe,clearcoatRoughnessMap:me,dispersion:U,iridescence:z,iridescenceMap:Te,iridescenceThicknessMap:ke,sheen:Y,sheenColorMap:We,sheenRoughnessMap:Me,specularMap:qe,specularColorMap:Je,specularIntensityMap:Ct,transmission:he,transmissionMap:X,thicknessMap:Ae,gradientMap:oe,opaque:b.transparent===!1&&b.blending===Qr&&b.alphaToCoverage===!1,alphaMap:de,alphaTest:Pe,alphaHash:Re,combine:b.combine,mapUv:Oe&&_(b.map.channel),aoMapUv:w&&_(b.aoMap.channel),lightMapUv:j&&_(b.lightMap.channel),bumpMapUv:G&&_(b.bumpMap.channel),normalMapUv:q&&_(b.normalMap.channel),displacementMapUv:R&&_(b.displacementMap.channel),emissiveMapUv:N&&_(b.emissiveMap.channel),metalnessMapUv:V&&_(b.metalnessMap.channel),roughnessMapUv:A&&_(b.roughnessMap.channel),anisotropyMapUv:ce&&_(b.anisotropyMap.channel),clearcoatMapUv:ye&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Fe&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:me&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Te&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:We&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Me&&_(b.sheenRoughnessMap.channel),specularMapUv:qe&&_(b.specularMap.channel),specularColorMapUv:Je&&_(b.specularColorMap.channel),specularIntensityMapUv:Ct&&_(b.specularIntensityMap.channel),transmissionMapUv:X&&_(b.transmissionMap.channel),thicknessMapUv:Ae&&_(b.thicknessMap.channel),alphaMapUv:de&&_(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(q||C),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!ee.attributes.uv&&(Oe||de),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:ae,skinning:H.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:se,morphTextureStride:xe,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numLightProbes:S.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ft,decodeVideoTexture:Oe&&b.map.isVideoTexture===!0&&at.getTransfer(b.map.colorSpace)===St,decodeVideoTextureEmissive:N&&b.emissiveMap.isVideoTexture===!0&&at.getTransfer(b.emissiveMap.colorSpace)===St,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Si,flipSided:b.side===Dn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:nt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(nt&&b.extensions.multiDraw===!0||le)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return un.vertexUv1s=c.has(1),un.vertexUv2s=c.has(2),un.vertexUv3s=c.has(3),c.clear(),un}function m(b){const S=[];if(b.shaderID?S.push(b.shaderID):(S.push(b.customVertexShaderID),S.push(b.customFragmentShaderID)),b.defines!==void 0)for(const D in b.defines)S.push(D),S.push(b.defines[D]);return b.isRawShaderMaterial===!1&&(y(S,b),x(S,b),S.push(n.outputColorSpace)),S.push(b.customProgramCacheKey),S.join()}function y(b,S){b.push(S.precision),b.push(S.outputColorSpace),b.push(S.envMapMode),b.push(S.envMapCubeUVHeight),b.push(S.mapUv),b.push(S.alphaMapUv),b.push(S.lightMapUv),b.push(S.aoMapUv),b.push(S.bumpMapUv),b.push(S.normalMapUv),b.push(S.displacementMapUv),b.push(S.emissiveMapUv),b.push(S.metalnessMapUv),b.push(S.roughnessMapUv),b.push(S.anisotropyMapUv),b.push(S.clearcoatMapUv),b.push(S.clearcoatNormalMapUv),b.push(S.clearcoatRoughnessMapUv),b.push(S.iridescenceMapUv),b.push(S.iridescenceThicknessMapUv),b.push(S.sheenColorMapUv),b.push(S.sheenRoughnessMapUv),b.push(S.specularMapUv),b.push(S.specularColorMapUv),b.push(S.specularIntensityMapUv),b.push(S.transmissionMapUv),b.push(S.thicknessMapUv),b.push(S.combine),b.push(S.fogExp2),b.push(S.sizeAttenuation),b.push(S.morphTargetsCount),b.push(S.morphAttributeCount),b.push(S.numDirLights),b.push(S.numPointLights),b.push(S.numSpotLights),b.push(S.numSpotLightMaps),b.push(S.numHemiLights),b.push(S.numRectAreaLights),b.push(S.numDirLightShadows),b.push(S.numPointLightShadows),b.push(S.numSpotLightShadows),b.push(S.numSpotLightShadowsWithMaps),b.push(S.numLightProbes),b.push(S.shadowMapType),b.push(S.toneMapping),b.push(S.numClippingPlanes),b.push(S.numClipIntersection),b.push(S.depthPacking)}function x(b,S){a.disableAll(),S.supportsVertexTextures&&a.enable(0),S.instancing&&a.enable(1),S.instancingColor&&a.enable(2),S.instancingMorph&&a.enable(3),S.matcap&&a.enable(4),S.envMap&&a.enable(5),S.normalMapObjectSpace&&a.enable(6),S.normalMapTangentSpace&&a.enable(7),S.clearcoat&&a.enable(8),S.iridescence&&a.enable(9),S.alphaTest&&a.enable(10),S.vertexColors&&a.enable(11),S.vertexAlphas&&a.enable(12),S.vertexUv1s&&a.enable(13),S.vertexUv2s&&a.enable(14),S.vertexUv3s&&a.enable(15),S.vertexTangents&&a.enable(16),S.anisotropy&&a.enable(17),S.alphaHash&&a.enable(18),S.batching&&a.enable(19),S.dispersion&&a.enable(20),S.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),S.fog&&a.enable(0),S.useFog&&a.enable(1),S.flatShading&&a.enable(2),S.logarithmicDepthBuffer&&a.enable(3),S.reverseDepthBuffer&&a.enable(4),S.skinning&&a.enable(5),S.morphTargets&&a.enable(6),S.morphNormals&&a.enable(7),S.morphColors&&a.enable(8),S.premultipliedAlpha&&a.enable(9),S.shadowMapEnabled&&a.enable(10),S.doubleSided&&a.enable(11),S.flipSided&&a.enable(12),S.useDepthPacking&&a.enable(13),S.dithering&&a.enable(14),S.transmission&&a.enable(15),S.sheen&&a.enable(16),S.opaque&&a.enable(17),S.pointsUvs&&a.enable(18),S.decodeVideoTexture&&a.enable(19),S.decodeVideoTextureEmissive&&a.enable(20),S.alphaToCoverage&&a.enable(21),b.push(a.mask)}function v(b){const S=p[b.type];let D;if(S){const B=bi[S];D=QS.clone(B.uniforms)}else D=b.uniforms;return D}function E(b,S){let D;for(let B=0,H=u.length;B0?i.push(m):d.transparent===!0?s.push(m):t.push(m)}function l(f,h,d,p,_,g){const m=o(f,h,d,p,_,g);d.transmission>0?i.unshift(m):d.transparent===!0?s.unshift(m):t.unshift(m)}function c(f,h){t.length>1&&t.sort(f||rO),i.length>1&&i.sort(h||Jv),s.length>1&&s.sort(h||Jv)}function u(){for(let f=e,h=n.length;f=r.length?(o=new Qv,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function aO(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new we};break;case"SpotLight":t={position:new F,direction:new F,color:new we,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new we,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new we,groundColor:new we};break;case"RectAreaLight":t={color:new we,position:new F,halfWidth:new F,halfHeight:new F};break}return n[e.id]=t,t}}}function lO(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let cO=0;function uO(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function fO(n){const e=new aO,t=lO(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new F);const s=new F,r=new Xe,o=new Xe;function a(c){let u=0,f=0,h=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let d=0,p=0,_=0,g=0,m=0,y=0,x=0,v=0,E=0,T=0,M=0;c.sort(uO);for(let b=0,S=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ee.LTC_FLOAT_1,i.rectAreaLTC2=Ee.LTC_FLOAT_2):(i.rectAreaLTC1=Ee.LTC_HALF_1,i.rectAreaLTC2=Ee.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=h;const P=i.hash;(P.directionalLength!==d||P.pointLength!==p||P.spotLength!==_||P.rectAreaLength!==g||P.hemiLength!==m||P.numDirectionalShadows!==y||P.numPointShadows!==x||P.numSpotShadows!==v||P.numSpotMaps!==E||P.numLightProbes!==M)&&(i.directional.length=d,i.spot.length=_,i.rectArea.length=g,i.point.length=p,i.hemi.length=m,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=v+E-T,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=M,P.directionalLength=d,P.pointLength=p,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=m,P.numDirectionalShadows=y,P.numPointShadows=x,P.numSpotShadows=v,P.numSpotMaps=E,P.numLightProbes=M,i.version=cO++)}function l(c,u){let f=0,h=0,d=0,p=0,_=0;const g=u.matrixWorldInverse;for(let m=0,y=c.length;m=o.length?(a=new ey(n),o.push(a)):a=o[r],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const dO=`void main() { gl_Position = vec4( position, 1.0 ); -}`,pN=`uniform sampler2D shadow_pass; +}`,pO=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3817,12 +3817,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function mN(n,e,t){let i=new pc;const r=new fe,s=new fe,o=new ht,a=new zg({depthPacking:kS}),l=new Hg,c={},u=t.maxTextureSize,f={[Mr]:Dn,[Dn]:Mr,[Si]:Si},h=new Ri({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new fe},radius:{value:4}},vertexShader:dN,fragmentShader:pN}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const p=new st;p.setAttribute("position",new Et(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ht(p,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=hg;let m=this.type;this.render=function(T,M,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||T.length===0)return;const b=n.getRenderTarget(),S=n.getActiveCubeFace(),D=n.getActiveMipmapLevel(),B=n.state;B.setBlending(yr),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const H=m!==Bi&&this.type===Bi,$=m===Bi&&this.type!==Bi;for(let ee=0,Z=T.length;eeu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/pe.x),r.x=s.x*pe.x,Q.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/pe.y),r.y=s.y*pe.y,Q.mapSize.y=s.y)),Q.map===null||H===!0||$===!0){const re=this.type!==Bi?{minFilter:cn,magFilter:cn}:{};Q.map!==null&&Q.map.dispose(),Q.map=new Yi(r.x,r.y,re),Q.map.texture.name=te.name+".shadowMap",Q.camera.updateProjectionMatrix()}n.setRenderTarget(Q.map),n.clear();const ve=Q.getViewportCount();for(let re=0;re0||M.map&&M.alphaTest>0){const B=S.uuid,H=M.uuid;let $=c[B];$===void 0&&($={},c[B]=$);let ee=$[H];ee===void 0&&(ee=S.clone(),$[H]=ee,M.addEventListener("dispose",E)),S=ee}if(S.visible=M.visible,S.wireframe=M.wireframe,b===Bi?S.side=M.shadowSide!==null?M.shadowSide:M.side:S.side=M.shadowSide!==null?M.shadowSide:f[M.side],S.alphaMap=M.alphaMap,S.alphaTest=M.alphaTest,S.map=M.map,S.clipShadows=M.clipShadows,S.clippingPlanes=M.clippingPlanes,S.clipIntersection=M.clipIntersection,S.displacementMap=M.displacementMap,S.displacementScale=M.displacementScale,S.displacementBias=M.displacementBias,S.wireframeLinewidth=M.wireframeLinewidth,S.linewidth=M.linewidth,P.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const B=n.properties.get(S);B.light=P}return S}function v(T,M,P,b,S){if(T.visible===!1)return;if(T.layers.test(M.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&S===Bi)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);const H=e.update(T),$=T.material;if(Array.isArray($)){const ee=H.groups;for(let Z=0,te=ee.length;Z=1):Q.indexOf("OpenGL ES")!==-1&&(te=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),Z=te>=2);let pe=null,ve={};const re=n.getParameter(n.SCISSOR_BOX),xe=n.getParameter(n.VIEWPORT),ze=new ht().fromArray(re),se=new ht().fromArray(xe);function ge(X,Ae,oe,de){const Pe=new Uint8Array(4),Re=n.createTexture();n.bindTexture(X,Re),n.texParameteri(X,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(X,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let nt=0;nt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new fe,u=new WeakMap;let f;const h=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(A,C){return d?new OffscreenCanvas(A,C):kl("canvas")}function _(A,C,k){let U=1;const z=V(A);if((z.width>k||z.height>k)&&(U=k/Math.max(z.width,z.height)),U<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){const Y=Math.floor(U*z.width),he=Math.floor(U*z.height);f===void 0&&(f=p(Y,he));const ce=C?p(Y,he):f;return ce.width=Y,ce.height=he,ce.getContext("2d").drawImage(A,0,0,Y,he),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+z.width+"x"+z.height+") to ("+Y+"x"+he+")."),ce}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+z.width+"x"+z.height+")."),A;return A}function g(A){return A.generateMipmaps}function m(A){n.generateMipmap(A)}function y(A){return A.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:A.isWebGL3DRenderTarget?n.TEXTURE_3D:A.isWebGLArrayRenderTarget||A.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function x(A,C,k,U,z=!1){if(A!==null){if(n[A]!==void 0)return n[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let Y=C;if(C===n.RED&&(k===n.FLOAT&&(Y=n.R32F),k===n.HALF_FLOAT&&(Y=n.R16F),k===n.UNSIGNED_BYTE&&(Y=n.R8)),C===n.RED_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.R8UI),k===n.UNSIGNED_SHORT&&(Y=n.R16UI),k===n.UNSIGNED_INT&&(Y=n.R32UI),k===n.BYTE&&(Y=n.R8I),k===n.SHORT&&(Y=n.R16I),k===n.INT&&(Y=n.R32I)),C===n.RG&&(k===n.FLOAT&&(Y=n.RG32F),k===n.HALF_FLOAT&&(Y=n.RG16F),k===n.UNSIGNED_BYTE&&(Y=n.RG8)),C===n.RG_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RG8UI),k===n.UNSIGNED_SHORT&&(Y=n.RG16UI),k===n.UNSIGNED_INT&&(Y=n.RG32UI),k===n.BYTE&&(Y=n.RG8I),k===n.SHORT&&(Y=n.RG16I),k===n.INT&&(Y=n.RG32I)),C===n.RGB_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RGB8UI),k===n.UNSIGNED_SHORT&&(Y=n.RGB16UI),k===n.UNSIGNED_INT&&(Y=n.RGB32UI),k===n.BYTE&&(Y=n.RGB8I),k===n.SHORT&&(Y=n.RGB16I),k===n.INT&&(Y=n.RGB32I)),C===n.RGBA_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RGBA8UI),k===n.UNSIGNED_SHORT&&(Y=n.RGBA16UI),k===n.UNSIGNED_INT&&(Y=n.RGBA32UI),k===n.BYTE&&(Y=n.RGBA8I),k===n.SHORT&&(Y=n.RGBA16I),k===n.INT&&(Y=n.RGBA32I)),C===n.RGB&&k===n.UNSIGNED_INT_5_9_9_9_REV&&(Y=n.RGB9_E5),C===n.RGBA){const he=z?Ul:at.getTransfer(U);k===n.FLOAT&&(Y=n.RGBA32F),k===n.HALF_FLOAT&&(Y=n.RGBA16F),k===n.UNSIGNED_BYTE&&(Y=he===St?n.SRGB8_ALPHA8:n.RGBA8),k===n.UNSIGNED_SHORT_4_4_4_4&&(Y=n.RGBA4),k===n.UNSIGNED_SHORT_5_5_5_1&&(Y=n.RGB5_A1)}return(Y===n.R16F||Y===n.R32F||Y===n.RG16F||Y===n.RG32F||Y===n.RGBA16F||Y===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Y}function v(A,C){let k;return A?C===null||C===Tr||C===ao?k=n.DEPTH24_STENCIL8:C===Hn?k=n.DEPTH32F_STENCIL8:C===oa&&(k=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===Tr||C===ao?k=n.DEPTH_COMPONENT24:C===Hn?k=n.DEPTH_COMPONENT32F:C===oa&&(k=n.DEPTH_COMPONENT16),k}function E(A,C){return g(A)===!0||A.isFramebufferTexture&&A.minFilter!==cn&&A.minFilter!==jt?Math.log2(Math.max(C.width,C.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?C.mipmaps.length:1}function T(A){const C=A.target;C.removeEventListener("dispose",T),P(C),C.isVideoTexture&&u.delete(C)}function M(A){const C=A.target;C.removeEventListener("dispose",M),S(C)}function P(A){const C=i.get(A);if(C.__webglInit===void 0)return;const k=A.source,U=h.get(k);if(U){const z=U[C.__cacheKey];z.usedTimes--,z.usedTimes===0&&b(A),Object.keys(U).length===0&&h.delete(k)}i.remove(A)}function b(A){const C=i.get(A);n.deleteTexture(C.__webglTexture);const k=A.source,U=h.get(k);delete U[C.__cacheKey],o.memory.textures--}function S(A){const C=i.get(A);if(A.depthTexture&&(A.depthTexture.dispose(),i.remove(A.depthTexture)),A.isWebGLCubeRenderTarget)for(let U=0;U<6;U++){if(Array.isArray(C.__webglFramebuffer[U]))for(let z=0;z=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+r.maxTextures),D+=1,A}function $(A){const C=[];return C.push(A.wrapS),C.push(A.wrapT),C.push(A.wrapR||0),C.push(A.magFilter),C.push(A.minFilter),C.push(A.anisotropy),C.push(A.internalFormat),C.push(A.format),C.push(A.type),C.push(A.generateMipmaps),C.push(A.premultiplyAlpha),C.push(A.flipY),C.push(A.unpackAlignment),C.push(A.colorSpace),C.join()}function ee(A,C){const k=i.get(A);if(A.isVideoTexture&&R(A),A.isRenderTargetTexture===!1&&A.version>0&&k.__version!==A.version){const U=A.image;if(U===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(U.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{se(k,A,C);return}}t.bindTexture(n.TEXTURE_2D,k.__webglTexture,n.TEXTURE0+C)}function Z(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){se(k,A,C);return}t.bindTexture(n.TEXTURE_2D_ARRAY,k.__webglTexture,n.TEXTURE0+C)}function te(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){se(k,A,C);return}t.bindTexture(n.TEXTURE_3D,k.__webglTexture,n.TEXTURE0+C)}function Q(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){ge(k,A,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,k.__webglTexture,n.TEXTURE0+C)}const pe={[Ll]:n.REPEAT,[li]:n.CLAMP_TO_EDGE,[Dl]:n.MIRRORED_REPEAT},ve={[cn]:n.NEAREST,[pg]:n.NEAREST_MIPMAP_NEAREST,[Xo]:n.NEAREST_MIPMAP_LINEAR,[jt]:n.LINEAR,[Qa]:n.LINEAR_MIPMAP_NEAREST,[Vi]:n.LINEAR_MIPMAP_LINEAR},re={[zS]:n.NEVER,[qS]:n.ALWAYS,[HS]:n.LESS,[Tg]:n.LEQUAL,[GS]:n.EQUAL,[$S]:n.GEQUAL,[WS]:n.GREATER,[XS]:n.NOTEQUAL};function xe(A,C){if(C.type===Hn&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===jt||C.magFilter===Qa||C.magFilter===Xo||C.magFilter===Vi||C.minFilter===jt||C.minFilter===Qa||C.minFilter===Xo||C.minFilter===Vi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(A,n.TEXTURE_WRAP_S,pe[C.wrapS]),n.texParameteri(A,n.TEXTURE_WRAP_T,pe[C.wrapT]),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,pe[C.wrapR]),n.texParameteri(A,n.TEXTURE_MAG_FILTER,ve[C.magFilter]),n.texParameteri(A,n.TEXTURE_MIN_FILTER,ve[C.minFilter]),C.compareFunction&&(n.texParameteri(A,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(A,n.TEXTURE_COMPARE_FUNC,re[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===cn||C.minFilter!==Xo&&C.minFilter!==Vi||C.type===Hn&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const k=e.get("EXT_texture_filter_anisotropic");n.texParameterf(A,k.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,r.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function ze(A,C){let k=!1;A.__webglInit===void 0&&(A.__webglInit=!0,C.addEventListener("dispose",T));const U=C.source;let z=h.get(U);z===void 0&&(z={},h.set(U,z));const Y=$(C);if(Y!==A.__cacheKey){z[Y]===void 0&&(z[Y]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,k=!0),z[Y].usedTimes++;const he=z[A.__cacheKey];he!==void 0&&(z[A.__cacheKey].usedTimes--,he.usedTimes===0&&b(C)),A.__cacheKey=Y,A.__webglTexture=z[Y].texture}return k}function se(A,C,k){let U=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(U=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(U=n.TEXTURE_3D);const z=ze(A,C),Y=C.source;t.bindTexture(U,A.__webglTexture,n.TEXTURE0+k);const he=i.get(Y);if(Y.version!==he.__version||z===!0){t.activeTexture(n.TEXTURE0+k);const ce=at.getPrimaries(at.workingColorSpace),ye=C.colorSpace===hr?null:at.getPrimaries(C.colorSpace),Fe=C.colorSpace===hr||ce===ye?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Fe);let me=_(C.image,!1,r.maxTextureSize);me=N(C,me);const Te=s.convert(C.format,C.colorSpace),ke=s.convert(C.type);let We=x(C.internalFormat,Te,ke,C.colorSpace,C.isVideoTexture);xe(U,C);let Me;const qe=C.mipmaps,Je=C.isVideoTexture!==!0,Ct=he.__version===void 0||z===!0,X=Y.dataReady,Ae=E(C,me);if(C.isDepthTexture)We=v(C.format===lo,C.type),Ct&&(Je?t.texStorage2D(n.TEXTURE_2D,1,We,me.width,me.height):t.texImage2D(n.TEXTURE_2D,0,We,me.width,me.height,0,Te,ke,null));else if(C.isDataTexture)if(qe.length>0){Je&&Ct&&t.texStorage2D(n.TEXTURE_2D,Ae,We,qe[0].width,qe[0].height);for(let oe=0,de=qe.length;oe0){const Pe=sm(Me.width,Me.height,C.format,C.type);for(const Re of C.layerUpdates){const nt=Me.data.subarray(Re*Pe/Me.data.BYTES_PER_ELEMENT,(Re+1)*Pe/Me.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Re,Me.width,Me.height,1,Te,nt)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Me.width,Me.height,me.depth,Te,Me.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,We,Me.width,Me.height,me.depth,0,Me.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Je?X&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Me.width,Me.height,me.depth,Te,ke,Me.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,We,Me.width,Me.height,me.depth,0,Te,ke,Me.data)}else{Je&&Ct&&t.texStorage2D(n.TEXTURE_2D,Ae,We,qe[0].width,qe[0].height);for(let oe=0,de=qe.length;oe0){const oe=sm(me.width,me.height,C.format,C.type);for(const de of C.layerUpdates){const Pe=me.data.subarray(de*oe/me.data.BYTES_PER_ELEMENT,(de+1)*oe/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,de,me.width,me.height,1,Te,ke,Pe)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,Te,ke,me.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,We,me.width,me.height,me.depth,0,Te,ke,me.data);else if(C.isData3DTexture)Je?(Ct&&t.texStorage3D(n.TEXTURE_3D,Ae,We,me.width,me.height,me.depth),X&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,Te,ke,me.data)):t.texImage3D(n.TEXTURE_3D,0,We,me.width,me.height,me.depth,0,Te,ke,me.data);else if(C.isFramebufferTexture){if(Ct)if(Je)t.texStorage2D(n.TEXTURE_2D,Ae,We,me.width,me.height);else{let oe=me.width,de=me.height;for(let Pe=0;Pe>=1,de>>=1}}else if(qe.length>0){if(Je&&Ct){const oe=V(qe[0]);t.texStorage2D(n.TEXTURE_2D,Ae,We,oe.width,oe.height)}for(let oe=0,de=qe.length;oe0&&Ae++;const de=V(Te[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Ae,qe,de.width,de.height)}for(let de=0;de<6;de++)if(me){Je?X&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Te[de].width,Te[de].height,We,Me,Te[de].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,qe,Te[de].width,Te[de].height,0,We,Me,Te[de].data);for(let Pe=0;Pe>Y),ke=Math.max(1,C.height>>Y);z===n.TEXTURE_3D||z===n.TEXTURE_2D_ARRAY?t.texImage3D(z,Y,ye,Te,ke,C.depth,0,he,ce,null):t.texImage2D(z,Y,ye,Te,ke,0,he,ce,null)}t.bindFramebuffer(n.FRAMEBUFFER,A),q(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,U,z,me.__webglTexture,0,G(C)):(z===n.TEXTURE_2D||z>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&z<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,U,z,me.__webglTexture,Y),t.bindFramebuffer(n.FRAMEBUFFER,null)}function W(A,C,k){if(n.bindRenderbuffer(n.RENDERBUFFER,A),C.depthBuffer){const U=C.depthTexture,z=U&&U.isDepthTexture?U.type:null,Y=v(C.stencilBuffer,z),he=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ce=G(C);q(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ce,Y,C.width,C.height):k?n.renderbufferStorageMultisample(n.RENDERBUFFER,ce,Y,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,Y,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,he,n.RENDERBUFFER,A)}else{const U=C.textures;for(let z=0;z{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,U.removeEventListener("dispose",z)};U.addEventListener("dispose",z),C.__depthDisposeCallback=z}C.__boundDepthTexture=U}if(A.depthTexture&&!C.__autoAllocateDepthBuffer){if(k)throw new Error("target.depthTexture not supported in Cube render targets");ae(C.__webglFramebuffer,A)}else if(k){C.__webglDepthbuffer=[];for(let U=0;U<6;U++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[U]),C.__webglDepthbuffer[U]===void 0)C.__webglDepthbuffer[U]=n.createRenderbuffer(),W(C.__webglDepthbuffer[U],A,!1);else{const z=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Y=C.__webglDepthbuffer[U];n.bindRenderbuffer(n.RENDERBUFFER,Y),n.framebufferRenderbuffer(n.FRAMEBUFFER,z,n.RENDERBUFFER,Y)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),W(C.__webglDepthbuffer,A,!1);else{const U=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,z=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,z),n.framebufferRenderbuffer(n.FRAMEBUFFER,U,n.RENDERBUFFER,z)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function le(A,C,k){const U=i.get(A);C!==void 0&&be(U.__webglFramebuffer,A,A.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),k!==void 0&&ue(A)}function Oe(A){const C=A.texture,k=i.get(A),U=i.get(C);A.addEventListener("dispose",M);const z=A.textures,Y=A.isWebGLCubeRenderTarget===!0,he=z.length>1;if(he||(U.__webglTexture===void 0&&(U.__webglTexture=n.createTexture()),U.__version=C.version,o.memory.textures++),Y){k.__webglFramebuffer=[];for(let ce=0;ce<6;ce++)if(C.mipmaps&&C.mipmaps.length>0){k.__webglFramebuffer[ce]=[];for(let ye=0;ye0){k.__webglFramebuffer=[];for(let ce=0;ce0&&q(A)===!1){k.__webglMultisampledFramebuffer=n.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let ce=0;ce0)for(let ye=0;ye0)for(let ye=0;ye0){if(q(A)===!1){const C=A.textures,k=A.width,U=A.height;let z=n.COLOR_BUFFER_BIT;const Y=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,he=i.get(A),ce=C.length>1;if(ce)for(let ye=0;ye0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function R(A){const C=o.render.frame;u.get(A)!==C&&(u.set(A,C),A.update())}function N(A,C){const k=A.colorSpace,U=A.format,z=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||k!==co&&k!==hr&&(at.getTransfer(k)===St?(U!==Ln||z!==qi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",k)),C}function V(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=B,this.setTexture2D=ee,this.setTexture2DArray=Z,this.setTexture3D=te,this.setTextureCube=Q,this.rebindTextures=le,this.setupRenderTarget=Oe,this.updateRenderTargetMipmap=I,this.updateMultisampleRenderTarget=j,this.setupDepthRenderbuffer=ue,this.setupFrameBufferTexture=be,this.useMultisampledRTT=q}function iE(n,e){function t(i,r=hr){let s;const o=at.getTransfer(r);if(i===qi)return n.UNSIGNED_BYTE;if(i===Sh)return n.UNSIGNED_SHORT_4_4_4_4;if(i===Mh)return n.UNSIGNED_SHORT_5_5_5_1;if(i===_g)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===mg)return n.BYTE;if(i===gg)return n.SHORT;if(i===oa)return n.UNSIGNED_SHORT;if(i===bh)return n.INT;if(i===Tr)return n.UNSIGNED_INT;if(i===Hn)return n.FLOAT;if(i===va)return n.HALF_FLOAT;if(i===vg)return n.ALPHA;if(i===yg)return n.RGB;if(i===Ln)return n.RGBA;if(i===xg)return n.LUMINANCE;if(i===bg)return n.LUMINANCE_ALPHA;if(i===eo)return n.DEPTH_COMPONENT;if(i===lo)return n.DEPTH_STENCIL;if(i===Eh)return n.RED;if(i===uc)return n.RED_INTEGER;if(i===Sg)return n.RG;if(i===Th)return n.RG_INTEGER;if(i===wh)return n.RGBA_INTEGER;if(i===el||i===tl||i===nl||i===il)if(o===St)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===el)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===tl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===nl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===il)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===el)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===tl)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===nl)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===il)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===yf||i===xf||i===bf||i===Sf)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===yf)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===xf)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===bf)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Sf)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Mf||i===Ef||i===Tf)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Mf||i===Ef)return o===St?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Tf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===wf||i===Af||i===Cf||i===Rf||i===Pf||i===If||i===Lf||i===Df||i===Of||i===Nf||i===Uf||i===Ff||i===Bf||i===kf)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===wf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Af)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Cf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Rf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Pf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===If)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Lf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Df)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Of)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Nf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Uf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Ff)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Bf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===kf)return o===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===rl||i===Vf||i===zf)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===rl)return o===St?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Vf)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===zf)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Mg||i===Hf||i===Gf||i===Wf)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===rl)return s.COMPRESSED_RED_RGTC1_EXT;if(i===Hf)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Gf)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Wf)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ao?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const yN=` +}`;function mO(n,e,t){let i=new pc;const s=new fe,r=new fe,o=new ht,a=new zg({depthPacking:kS}),l=new Hg,c={},u=t.maxTextureSize,f={[Ms]:Dn,[Dn]:Ms,[Si]:Si},h=new Ri({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new fe},radius:{value:4}},vertexShader:dO,fragmentShader:pO}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const p=new rt;p.setAttribute("position",new Et(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ht(p,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=hg;let m=this.type;this.render=function(T,M,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||T.length===0)return;const b=n.getRenderTarget(),S=n.getActiveCubeFace(),D=n.getActiveMipmapLevel(),B=n.state;B.setBlending(ys),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const H=m!==Bi&&this.type===Bi,$=m===Bi&&this.type!==Bi;for(let ee=0,Z=T.length;eeu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/pe.x),s.x=r.x*pe.x,Q.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/pe.y),s.y=r.y*pe.y,Q.mapSize.y=r.y)),Q.map===null||H===!0||$===!0){const se=this.type!==Bi?{minFilter:cn,magFilter:cn}:{};Q.map!==null&&Q.map.dispose(),Q.map=new Yi(s.x,s.y,se),Q.map.texture.name=te.name+".shadowMap",Q.camera.updateProjectionMatrix()}n.setRenderTarget(Q.map),n.clear();const ve=Q.getViewportCount();for(let se=0;se0||M.map&&M.alphaTest>0){const B=S.uuid,H=M.uuid;let $=c[B];$===void 0&&($={},c[B]=$);let ee=$[H];ee===void 0&&(ee=S.clone(),$[H]=ee,M.addEventListener("dispose",E)),S=ee}if(S.visible=M.visible,S.wireframe=M.wireframe,b===Bi?S.side=M.shadowSide!==null?M.shadowSide:M.side:S.side=M.shadowSide!==null?M.shadowSide:f[M.side],S.alphaMap=M.alphaMap,S.alphaTest=M.alphaTest,S.map=M.map,S.clipShadows=M.clipShadows,S.clippingPlanes=M.clippingPlanes,S.clipIntersection=M.clipIntersection,S.displacementMap=M.displacementMap,S.displacementScale=M.displacementScale,S.displacementBias=M.displacementBias,S.wireframeLinewidth=M.wireframeLinewidth,S.linewidth=M.linewidth,P.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const B=n.properties.get(S);B.light=P}return S}function v(T,M,P,b,S){if(T.visible===!1)return;if(T.layers.test(M.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&S===Bi)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);const H=e.update(T),$=T.material;if(Array.isArray($)){const ee=H.groups;for(let Z=0,te=ee.length;Z=1):Q.indexOf("OpenGL ES")!==-1&&(te=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),Z=te>=2);let pe=null,ve={};const se=n.getParameter(n.SCISSOR_BOX),xe=n.getParameter(n.VIEWPORT),ze=new ht().fromArray(se),re=new ht().fromArray(xe);function ge(X,Ae,oe,de){const Pe=new Uint8Array(4),Re=n.createTexture();n.bindTexture(X,Re),n.texParameteri(X,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(X,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let nt=0;nt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new fe,u=new WeakMap;let f;const h=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(A,C){return d?new OffscreenCanvas(A,C):kl("canvas")}function _(A,C,k){let U=1;const z=V(A);if((z.width>k||z.height>k)&&(U=k/Math.max(z.width,z.height)),U<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){const Y=Math.floor(U*z.width),he=Math.floor(U*z.height);f===void 0&&(f=p(Y,he));const ce=C?p(Y,he):f;return ce.width=Y,ce.height=he,ce.getContext("2d").drawImage(A,0,0,Y,he),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+z.width+"x"+z.height+") to ("+Y+"x"+he+")."),ce}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+z.width+"x"+z.height+")."),A;return A}function g(A){return A.generateMipmaps}function m(A){n.generateMipmap(A)}function y(A){return A.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:A.isWebGL3DRenderTarget?n.TEXTURE_3D:A.isWebGLArrayRenderTarget||A.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function x(A,C,k,U,z=!1){if(A!==null){if(n[A]!==void 0)return n[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let Y=C;if(C===n.RED&&(k===n.FLOAT&&(Y=n.R32F),k===n.HALF_FLOAT&&(Y=n.R16F),k===n.UNSIGNED_BYTE&&(Y=n.R8)),C===n.RED_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.R8UI),k===n.UNSIGNED_SHORT&&(Y=n.R16UI),k===n.UNSIGNED_INT&&(Y=n.R32UI),k===n.BYTE&&(Y=n.R8I),k===n.SHORT&&(Y=n.R16I),k===n.INT&&(Y=n.R32I)),C===n.RG&&(k===n.FLOAT&&(Y=n.RG32F),k===n.HALF_FLOAT&&(Y=n.RG16F),k===n.UNSIGNED_BYTE&&(Y=n.RG8)),C===n.RG_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RG8UI),k===n.UNSIGNED_SHORT&&(Y=n.RG16UI),k===n.UNSIGNED_INT&&(Y=n.RG32UI),k===n.BYTE&&(Y=n.RG8I),k===n.SHORT&&(Y=n.RG16I),k===n.INT&&(Y=n.RG32I)),C===n.RGB_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RGB8UI),k===n.UNSIGNED_SHORT&&(Y=n.RGB16UI),k===n.UNSIGNED_INT&&(Y=n.RGB32UI),k===n.BYTE&&(Y=n.RGB8I),k===n.SHORT&&(Y=n.RGB16I),k===n.INT&&(Y=n.RGB32I)),C===n.RGBA_INTEGER&&(k===n.UNSIGNED_BYTE&&(Y=n.RGBA8UI),k===n.UNSIGNED_SHORT&&(Y=n.RGBA16UI),k===n.UNSIGNED_INT&&(Y=n.RGBA32UI),k===n.BYTE&&(Y=n.RGBA8I),k===n.SHORT&&(Y=n.RGBA16I),k===n.INT&&(Y=n.RGBA32I)),C===n.RGB&&k===n.UNSIGNED_INT_5_9_9_9_REV&&(Y=n.RGB9_E5),C===n.RGBA){const he=z?Ul:at.getTransfer(U);k===n.FLOAT&&(Y=n.RGBA32F),k===n.HALF_FLOAT&&(Y=n.RGBA16F),k===n.UNSIGNED_BYTE&&(Y=he===St?n.SRGB8_ALPHA8:n.RGBA8),k===n.UNSIGNED_SHORT_4_4_4_4&&(Y=n.RGBA4),k===n.UNSIGNED_SHORT_5_5_5_1&&(Y=n.RGB5_A1)}return(Y===n.R16F||Y===n.R32F||Y===n.RG16F||Y===n.RG32F||Y===n.RGBA16F||Y===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Y}function v(A,C){let k;return A?C===null||C===Ts||C===ao?k=n.DEPTH24_STENCIL8:C===Hn?k=n.DEPTH32F_STENCIL8:C===oa&&(k=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===Ts||C===ao?k=n.DEPTH_COMPONENT24:C===Hn?k=n.DEPTH_COMPONENT32F:C===oa&&(k=n.DEPTH_COMPONENT16),k}function E(A,C){return g(A)===!0||A.isFramebufferTexture&&A.minFilter!==cn&&A.minFilter!==jt?Math.log2(Math.max(C.width,C.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?C.mipmaps.length:1}function T(A){const C=A.target;C.removeEventListener("dispose",T),P(C),C.isVideoTexture&&u.delete(C)}function M(A){const C=A.target;C.removeEventListener("dispose",M),S(C)}function P(A){const C=i.get(A);if(C.__webglInit===void 0)return;const k=A.source,U=h.get(k);if(U){const z=U[C.__cacheKey];z.usedTimes--,z.usedTimes===0&&b(A),Object.keys(U).length===0&&h.delete(k)}i.remove(A)}function b(A){const C=i.get(A);n.deleteTexture(C.__webglTexture);const k=A.source,U=h.get(k);delete U[C.__cacheKey],o.memory.textures--}function S(A){const C=i.get(A);if(A.depthTexture&&(A.depthTexture.dispose(),i.remove(A.depthTexture)),A.isWebGLCubeRenderTarget)for(let U=0;U<6;U++){if(Array.isArray(C.__webglFramebuffer[U]))for(let z=0;z=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+s.maxTextures),D+=1,A}function $(A){const C=[];return C.push(A.wrapS),C.push(A.wrapT),C.push(A.wrapR||0),C.push(A.magFilter),C.push(A.minFilter),C.push(A.anisotropy),C.push(A.internalFormat),C.push(A.format),C.push(A.type),C.push(A.generateMipmaps),C.push(A.premultiplyAlpha),C.push(A.flipY),C.push(A.unpackAlignment),C.push(A.colorSpace),C.join()}function ee(A,C){const k=i.get(A);if(A.isVideoTexture&&R(A),A.isRenderTargetTexture===!1&&A.version>0&&k.__version!==A.version){const U=A.image;if(U===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(U.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(k,A,C);return}}t.bindTexture(n.TEXTURE_2D,k.__webglTexture,n.TEXTURE0+C)}function Z(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){re(k,A,C);return}t.bindTexture(n.TEXTURE_2D_ARRAY,k.__webglTexture,n.TEXTURE0+C)}function te(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){re(k,A,C);return}t.bindTexture(n.TEXTURE_3D,k.__webglTexture,n.TEXTURE0+C)}function Q(A,C){const k=i.get(A);if(A.version>0&&k.__version!==A.version){ge(k,A,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,k.__webglTexture,n.TEXTURE0+C)}const pe={[Ll]:n.REPEAT,[li]:n.CLAMP_TO_EDGE,[Dl]:n.MIRRORED_REPEAT},ve={[cn]:n.NEAREST,[pg]:n.NEAREST_MIPMAP_NEAREST,[Xo]:n.NEAREST_MIPMAP_LINEAR,[jt]:n.LINEAR,[Qa]:n.LINEAR_MIPMAP_NEAREST,[Vi]:n.LINEAR_MIPMAP_LINEAR},se={[zS]:n.NEVER,[qS]:n.ALWAYS,[HS]:n.LESS,[Tg]:n.LEQUAL,[GS]:n.EQUAL,[$S]:n.GEQUAL,[WS]:n.GREATER,[XS]:n.NOTEQUAL};function xe(A,C){if(C.type===Hn&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===jt||C.magFilter===Qa||C.magFilter===Xo||C.magFilter===Vi||C.minFilter===jt||C.minFilter===Qa||C.minFilter===Xo||C.minFilter===Vi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(A,n.TEXTURE_WRAP_S,pe[C.wrapS]),n.texParameteri(A,n.TEXTURE_WRAP_T,pe[C.wrapT]),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,pe[C.wrapR]),n.texParameteri(A,n.TEXTURE_MAG_FILTER,ve[C.magFilter]),n.texParameteri(A,n.TEXTURE_MIN_FILTER,ve[C.minFilter]),C.compareFunction&&(n.texParameteri(A,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(A,n.TEXTURE_COMPARE_FUNC,se[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===cn||C.minFilter!==Xo&&C.minFilter!==Vi||C.type===Hn&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const k=e.get("EXT_texture_filter_anisotropic");n.texParameterf(A,k.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,s.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function ze(A,C){let k=!1;A.__webglInit===void 0&&(A.__webglInit=!0,C.addEventListener("dispose",T));const U=C.source;let z=h.get(U);z===void 0&&(z={},h.set(U,z));const Y=$(C);if(Y!==A.__cacheKey){z[Y]===void 0&&(z[Y]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,k=!0),z[Y].usedTimes++;const he=z[A.__cacheKey];he!==void 0&&(z[A.__cacheKey].usedTimes--,he.usedTimes===0&&b(C)),A.__cacheKey=Y,A.__webglTexture=z[Y].texture}return k}function re(A,C,k){let U=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(U=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(U=n.TEXTURE_3D);const z=ze(A,C),Y=C.source;t.bindTexture(U,A.__webglTexture,n.TEXTURE0+k);const he=i.get(Y);if(Y.version!==he.__version||z===!0){t.activeTexture(n.TEXTURE0+k);const ce=at.getPrimaries(at.workingColorSpace),ye=C.colorSpace===hs?null:at.getPrimaries(C.colorSpace),Fe=C.colorSpace===hs||ce===ye?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Fe);let me=_(C.image,!1,s.maxTextureSize);me=N(C,me);const Te=r.convert(C.format,C.colorSpace),ke=r.convert(C.type);let We=x(C.internalFormat,Te,ke,C.colorSpace,C.isVideoTexture);xe(U,C);let Me;const qe=C.mipmaps,Je=C.isVideoTexture!==!0,Ct=he.__version===void 0||z===!0,X=Y.dataReady,Ae=E(C,me);if(C.isDepthTexture)We=v(C.format===lo,C.type),Ct&&(Je?t.texStorage2D(n.TEXTURE_2D,1,We,me.width,me.height):t.texImage2D(n.TEXTURE_2D,0,We,me.width,me.height,0,Te,ke,null));else if(C.isDataTexture)if(qe.length>0){Je&&Ct&&t.texStorage2D(n.TEXTURE_2D,Ae,We,qe[0].width,qe[0].height);for(let oe=0,de=qe.length;oe0){const Pe=rm(Me.width,Me.height,C.format,C.type);for(const Re of C.layerUpdates){const nt=Me.data.subarray(Re*Pe/Me.data.BYTES_PER_ELEMENT,(Re+1)*Pe/Me.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Re,Me.width,Me.height,1,Te,nt)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Me.width,Me.height,me.depth,Te,Me.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,We,Me.width,Me.height,me.depth,0,Me.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Je?X&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Me.width,Me.height,me.depth,Te,ke,Me.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,We,Me.width,Me.height,me.depth,0,Te,ke,Me.data)}else{Je&&Ct&&t.texStorage2D(n.TEXTURE_2D,Ae,We,qe[0].width,qe[0].height);for(let oe=0,de=qe.length;oe0){const oe=rm(me.width,me.height,C.format,C.type);for(const de of C.layerUpdates){const Pe=me.data.subarray(de*oe/me.data.BYTES_PER_ELEMENT,(de+1)*oe/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,de,me.width,me.height,1,Te,ke,Pe)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,Te,ke,me.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,We,me.width,me.height,me.depth,0,Te,ke,me.data);else if(C.isData3DTexture)Je?(Ct&&t.texStorage3D(n.TEXTURE_3D,Ae,We,me.width,me.height,me.depth),X&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,Te,ke,me.data)):t.texImage3D(n.TEXTURE_3D,0,We,me.width,me.height,me.depth,0,Te,ke,me.data);else if(C.isFramebufferTexture){if(Ct)if(Je)t.texStorage2D(n.TEXTURE_2D,Ae,We,me.width,me.height);else{let oe=me.width,de=me.height;for(let Pe=0;Pe>=1,de>>=1}}else if(qe.length>0){if(Je&&Ct){const oe=V(qe[0]);t.texStorage2D(n.TEXTURE_2D,Ae,We,oe.width,oe.height)}for(let oe=0,de=qe.length;oe0&&Ae++;const de=V(Te[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Ae,qe,de.width,de.height)}for(let de=0;de<6;de++)if(me){Je?X&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Te[de].width,Te[de].height,We,Me,Te[de].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,qe,Te[de].width,Te[de].height,0,We,Me,Te[de].data);for(let Pe=0;Pe>Y),ke=Math.max(1,C.height>>Y);z===n.TEXTURE_3D||z===n.TEXTURE_2D_ARRAY?t.texImage3D(z,Y,ye,Te,ke,C.depth,0,he,ce,null):t.texImage2D(z,Y,ye,Te,ke,0,he,ce,null)}t.bindFramebuffer(n.FRAMEBUFFER,A),q(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,U,z,me.__webglTexture,0,G(C)):(z===n.TEXTURE_2D||z>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&z<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,U,z,me.__webglTexture,Y),t.bindFramebuffer(n.FRAMEBUFFER,null)}function W(A,C,k){if(n.bindRenderbuffer(n.RENDERBUFFER,A),C.depthBuffer){const U=C.depthTexture,z=U&&U.isDepthTexture?U.type:null,Y=v(C.stencilBuffer,z),he=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ce=G(C);q(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ce,Y,C.width,C.height):k?n.renderbufferStorageMultisample(n.RENDERBUFFER,ce,Y,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,Y,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,he,n.RENDERBUFFER,A)}else{const U=C.textures;for(let z=0;z{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,U.removeEventListener("dispose",z)};U.addEventListener("dispose",z),C.__depthDisposeCallback=z}C.__boundDepthTexture=U}if(A.depthTexture&&!C.__autoAllocateDepthBuffer){if(k)throw new Error("target.depthTexture not supported in Cube render targets");ae(C.__webglFramebuffer,A)}else if(k){C.__webglDepthbuffer=[];for(let U=0;U<6;U++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[U]),C.__webglDepthbuffer[U]===void 0)C.__webglDepthbuffer[U]=n.createRenderbuffer(),W(C.__webglDepthbuffer[U],A,!1);else{const z=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Y=C.__webglDepthbuffer[U];n.bindRenderbuffer(n.RENDERBUFFER,Y),n.framebufferRenderbuffer(n.FRAMEBUFFER,z,n.RENDERBUFFER,Y)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),W(C.__webglDepthbuffer,A,!1);else{const U=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,z=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,z),n.framebufferRenderbuffer(n.FRAMEBUFFER,U,n.RENDERBUFFER,z)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function le(A,C,k){const U=i.get(A);C!==void 0&&be(U.__webglFramebuffer,A,A.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),k!==void 0&&ue(A)}function Oe(A){const C=A.texture,k=i.get(A),U=i.get(C);A.addEventListener("dispose",M);const z=A.textures,Y=A.isWebGLCubeRenderTarget===!0,he=z.length>1;if(he||(U.__webglTexture===void 0&&(U.__webglTexture=n.createTexture()),U.__version=C.version,o.memory.textures++),Y){k.__webglFramebuffer=[];for(let ce=0;ce<6;ce++)if(C.mipmaps&&C.mipmaps.length>0){k.__webglFramebuffer[ce]=[];for(let ye=0;ye0){k.__webglFramebuffer=[];for(let ce=0;ce0&&q(A)===!1){k.__webglMultisampledFramebuffer=n.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let ce=0;ce0)for(let ye=0;ye0)for(let ye=0;ye0){if(q(A)===!1){const C=A.textures,k=A.width,U=A.height;let z=n.COLOR_BUFFER_BIT;const Y=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,he=i.get(A),ce=C.length>1;if(ce)for(let ye=0;ye0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function R(A){const C=o.render.frame;u.get(A)!==C&&(u.set(A,C),A.update())}function N(A,C){const k=A.colorSpace,U=A.format,z=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||k!==co&&k!==hs&&(at.getTransfer(k)===St?(U!==Ln||z!==qi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",k)),C}function V(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=B,this.setTexture2D=ee,this.setTexture2DArray=Z,this.setTexture3D=te,this.setTextureCube=Q,this.rebindTextures=le,this.setupRenderTarget=Oe,this.updateRenderTargetMipmap=I,this.updateMultisampleRenderTarget=j,this.setupDepthRenderbuffer=ue,this.setupFrameBufferTexture=be,this.useMultisampledRTT=q}function iE(n,e){function t(i,s=hs){let r;const o=at.getTransfer(s);if(i===qi)return n.UNSIGNED_BYTE;if(i===Sh)return n.UNSIGNED_SHORT_4_4_4_4;if(i===Mh)return n.UNSIGNED_SHORT_5_5_5_1;if(i===_g)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===mg)return n.BYTE;if(i===gg)return n.SHORT;if(i===oa)return n.UNSIGNED_SHORT;if(i===bh)return n.INT;if(i===Ts)return n.UNSIGNED_INT;if(i===Hn)return n.FLOAT;if(i===va)return n.HALF_FLOAT;if(i===vg)return n.ALPHA;if(i===yg)return n.RGB;if(i===Ln)return n.RGBA;if(i===xg)return n.LUMINANCE;if(i===bg)return n.LUMINANCE_ALPHA;if(i===eo)return n.DEPTH_COMPONENT;if(i===lo)return n.DEPTH_STENCIL;if(i===Eh)return n.RED;if(i===uc)return n.RED_INTEGER;if(i===Sg)return n.RG;if(i===Th)return n.RG_INTEGER;if(i===wh)return n.RGBA_INTEGER;if(i===el||i===tl||i===nl||i===il)if(o===St)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===el)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===tl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===nl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===il)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===el)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===tl)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===nl)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===il)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===yf||i===xf||i===bf||i===Sf)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===yf)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===xf)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===bf)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Sf)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Mf||i===Ef||i===Tf)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===Mf||i===Ef)return o===St?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===Tf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===wf||i===Af||i===Cf||i===Rf||i===Pf||i===If||i===Lf||i===Df||i===Of||i===Nf||i===Uf||i===Ff||i===Bf||i===kf)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===wf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Af)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Cf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Rf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Pf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===If)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Lf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Df)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Of)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Nf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Uf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Ff)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Bf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===kf)return o===St?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===sl||i===Vf||i===zf)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===sl)return o===St?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Vf)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===zf)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Mg||i===Hf||i===Gf||i===Wf)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===sl)return r.COMPRESSED_RED_RGTC1_EXT;if(i===Hf)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Gf)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Wf)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ao?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const yO=` void main() { gl_Position = vec4( position, 1.0 ); -}`,xN=` +}`,xO=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -3841,34 +3841,34 @@ void main() { } -}`;class bN{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Vt,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Ri({vertexShader:yN,fragmentShader:xN,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ht(new ba(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class SN extends ji{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,f=null,h=null,d=null,p=null;const _=new bN,g=t.getContextAttributes();let m=null,y=null;const x=[],v=[],E=new fe;let T=null;const M=new $t;M.viewport=new ht;const P=new $t;P.viewport=new ht;const b=[M,P],S=new $M;let D=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(se){let ge=x[se];return ge===void 0&&(ge=new Wu,x[se]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(se){let ge=x[se];return ge===void 0&&(ge=new Wu,x[se]=ge),ge.getGripSpace()},this.getHand=function(se){let ge=x[se];return ge===void 0&&(ge=new Wu,x[se]=ge),ge.getHandSpace()};function H(se){const ge=v.indexOf(se.inputSource);if(ge===-1)return;const be=x[ge];be!==void 0&&(be.update(se.inputSource,se.frame,c||o),be.dispatchEvent({type:se.type,data:se.inputSource}))}function $(){r.removeEventListener("select",H),r.removeEventListener("selectstart",H),r.removeEventListener("selectend",H),r.removeEventListener("squeeze",H),r.removeEventListener("squeezestart",H),r.removeEventListener("squeezeend",H),r.removeEventListener("end",$),r.removeEventListener("inputsourceschange",ee);for(let se=0;se=0&&(v[W]=null,x[W].disconnect(be))}for(let ge=0;ge=v.length){v.push(be),W=ue;break}else if(v[ue]===null){v[ue]=be,W=ue;break}if(W===-1)break}const ae=x[W];ae&&ae.connect(be)}}const Z=new F,te=new F;function Q(se,ge,be){Z.setFromMatrixPosition(ge.matrixWorld),te.setFromMatrixPosition(be.matrixWorld);const W=Z.distanceTo(te),ae=ge.projectionMatrix.elements,ue=be.projectionMatrix.elements,le=ae[14]/(ae[10]-1),Oe=ae[14]/(ae[10]+1),I=(ae[9]+1)/ae[5],L=(ae[9]-1)/ae[5],w=(ae[8]-1)/ae[0],j=(ue[8]+1)/ue[0],G=le*w,q=le*j,R=W/(-w+j),N=R*-w;if(ge.matrixWorld.decompose(se.position,se.quaternion,se.scale),se.translateX(N),se.translateZ(R),se.matrixWorld.compose(se.position,se.quaternion,se.scale),se.matrixWorldInverse.copy(se.matrixWorld).invert(),ae[10]===-1)se.projectionMatrix.copy(ge.projectionMatrix),se.projectionMatrixInverse.copy(ge.projectionMatrixInverse);else{const V=le+R,A=Oe+R,C=G-N,k=q+(W-N),U=I*Oe/A*V,z=L*Oe/A*V;se.projectionMatrix.makePerspective(C,k,U,z,V,A),se.projectionMatrixInverse.copy(se.projectionMatrix).invert()}}function pe(se,ge){ge===null?se.matrixWorld.copy(se.matrix):se.matrixWorld.multiplyMatrices(ge.matrixWorld,se.matrix),se.matrixWorldInverse.copy(se.matrixWorld).invert()}this.updateCamera=function(se){if(r===null)return;let ge=se.near,be=se.far;_.texture!==null&&(_.depthNear>0&&(ge=_.depthNear),_.depthFar>0&&(be=_.depthFar)),S.near=P.near=M.near=ge,S.far=P.far=M.far=be,(D!==S.near||B!==S.far)&&(r.updateRenderState({depthNear:S.near,depthFar:S.far}),D=S.near,B=S.far),M.layers.mask=se.layers.mask|2,P.layers.mask=se.layers.mask|4,S.layers.mask=M.layers.mask|P.layers.mask;const W=se.parent,ae=S.cameras;pe(S,W);for(let ue=0;ue0&&(g.alphaTest.value=m.alphaTest);const y=e.get(m),x=y.envMap,v=y.envMapRotation;x&&(g.envMap.value=x,Ns.copy(v),Ns.x*=-1,Ns.y*=-1,Ns.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Ns.y*=-1,Ns.z*=-1),g.envMapRotation.value.setFromMatrix4(MN.makeRotationFromEuler(Ns)),g.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,g.aoMapTransform))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform))}function a(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,y,x){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*y,g.scale.value=x*.5,m.map&&(g.map.value=m.map,t(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function f(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function h(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,y){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Dn&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,m){m.matcap&&(g.matcap.value=m.matcap)}function _(g,m){const y=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function TN(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,x){const v=x.program;i.uniformBlockBinding(y,v)}function c(y,x){let v=r[y.id];v===void 0&&(p(y),v=u(y),r[y.id]=v,y.addEventListener("dispose",g));const E=x.program;i.updateUBOMapping(y,E);const T=e.render.frame;s[y.id]!==T&&(h(y),s[y.id]=T)}function u(y){const x=f();y.__bindingPointIndex=x;const v=n.createBuffer(),E=y.__size,T=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,v),n.bufferData(n.UNIFORM_BUFFER,E,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,v),v}function f(){for(let y=0;y0&&(v+=E-T),y.__size=v,y.__cache={},this}function _(y){const x={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(x.boundary=4,x.storage=4):y.isVector2?(x.boundary=8,x.storage=8):y.isVector3||y.isColor?(x.boundary=16,x.storage=12):y.isVector4?(x.boundary=16,x.storage=16):y.isMatrix3?(x.boundary=48,x.storage=48):y.isMatrix4?(x.boundary=64,x.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),x}function g(y){const x=y.target;x.removeEventListener("dispose",g);const v=o.indexOf(x.__bindingPointIndex);o.splice(v,1),n.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function m(){for(const y in r)n.deleteBuffer(r[y]);o=[],r={},s={}}return{bind:l,update:c,dispose:m}}class $u{constructor(e={}){const{canvas:t=jS(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1,reverseDepthBuffer:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=o;const p=new Uint32Array(4),_=new Int32Array(4);let g=null,m=null;const y=[],x=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Cn,this.toneMapping=Hi,this.toneMappingExposure=1;const v=this;let E=!1,T=0,M=0,P=null,b=-1,S=null;const D=new ht,B=new ht;let H=null;const $=new we(0);let ee=0,Z=t.width,te=t.height,Q=1,pe=null,ve=null;const re=new ht(0,0,Z,te),xe=new ht(0,0,Z,te);let ze=!1;const se=new pc;let ge=!1,be=!1;this.transmissionResolutionScale=1;const W=new Xe,ae=new Xe,ue=new F,le=new ht,Oe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let I=!1;function L(){return P===null?Q:1}let w=i;function j(O,K){return t.getContext(O,K)}try{const O={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${lc}`),t.addEventListener("webglcontextlost",de,!1),t.addEventListener("webglcontextrestored",Pe,!1),t.addEventListener("webglcontextcreationerror",Re,!1),w===null){const K="webgl2";if(w=j(K,O),w===null)throw j(K)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let G,q,R,N,V,A,C,k,U,z,Y,he,ce,ye,Fe,me,Te,ke,We,Me,qe,Je,Ct,X;function Ae(){G=new FO(w),G.init(),Je=new iE(w,G),q=new PO(w,G,e,Je),R=new _N(w,G),q.reverseDepthBuffer&&h&&R.buffers.depth.setReversed(!0),N=new VO(w),V=new rN,A=new vN(w,G,R,V,q,Je,N),C=new LO(v),k=new UO(v),U=new $I(w),Ct=new CO(w,U),z=new BO(w,U,N,Ct),Y=new HO(w,z,U,N),We=new zO(w,q,A),me=new IO(V),he=new iN(v,C,k,G,q,Ct,me),ce=new EN(v,V),ye=new oN,Fe=new hN(G),ke=new AO(v,C,k,R,Y,d,l),Te=new mN(v,Y,q),X=new TN(w,N,q,R),Me=new RO(w,G,N),qe=new kO(w,G,N),N.programs=he.programs,v.capabilities=q,v.extensions=G,v.properties=V,v.renderLists=ye,v.shadowMap=Te,v.state=R,v.info=N}Ae();const oe=new SN(v,w);this.xr=oe,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const O=G.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=G.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(O){O!==void 0&&(Q=O,this.setSize(Z,te,!1))},this.getSize=function(O){return O.set(Z,te)},this.setSize=function(O,K,ne=!0){if(oe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Z=O,te=K,t.width=Math.floor(O*Q),t.height=Math.floor(K*Q),ne===!0&&(t.style.width=O+"px",t.style.height=K+"px"),this.setViewport(0,0,O,K)},this.getDrawingBufferSize=function(O){return O.set(Z*Q,te*Q).floor()},this.setDrawingBufferSize=function(O,K,ne){Z=O,te=K,Q=ne,t.width=Math.floor(O*ne),t.height=Math.floor(K*ne),this.setViewport(0,0,O,K)},this.getCurrentViewport=function(O){return O.copy(D)},this.getViewport=function(O){return O.copy(re)},this.setViewport=function(O,K,ne,ie){O.isVector4?re.set(O.x,O.y,O.z,O.w):re.set(O,K,ne,ie),R.viewport(D.copy(re).multiplyScalar(Q).round())},this.getScissor=function(O){return O.copy(xe)},this.setScissor=function(O,K,ne,ie){O.isVector4?xe.set(O.x,O.y,O.z,O.w):xe.set(O,K,ne,ie),R.scissor(B.copy(xe).multiplyScalar(Q).round())},this.getScissorTest=function(){return ze},this.setScissorTest=function(O){R.setScissorTest(ze=O)},this.setOpaqueSort=function(O){pe=O},this.setTransparentSort=function(O){ve=O},this.getClearColor=function(O){return O.copy(ke.getClearColor())},this.setClearColor=function(){ke.setClearColor(...arguments)},this.getClearAlpha=function(){return ke.getClearAlpha()},this.setClearAlpha=function(){ke.setClearAlpha(...arguments)},this.clear=function(O=!0,K=!0,ne=!0){let ie=0;if(O){let J=!1;if(P!==null){const _e=P.texture.format;J=_e===wh||_e===Th||_e===uc}if(J){const _e=P.texture.type,Ce=_e===qi||_e===Tr||_e===oa||_e===ao||_e===Sh||_e===Mh,Le=ke.getClearColor(),Ne=ke.getClearAlpha(),Ye=Le.r,je=Le.g,Ve=Le.b;Ce?(p[0]=Ye,p[1]=je,p[2]=Ve,p[3]=Ne,w.clearBufferuiv(w.COLOR,0,p)):(_[0]=Ye,_[1]=je,_[2]=Ve,_[3]=Ne,w.clearBufferiv(w.COLOR,0,_))}else ie|=w.COLOR_BUFFER_BIT}K&&(ie|=w.DEPTH_BUFFER_BIT),ne&&(ie|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(ie)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",de,!1),t.removeEventListener("webglcontextrestored",Pe,!1),t.removeEventListener("webglcontextcreationerror",Re,!1),ke.dispose(),ye.dispose(),Fe.dispose(),V.dispose(),C.dispose(),k.dispose(),Y.dispose(),Ct.dispose(),X.dispose(),he.dispose(),oe.dispose(),oe.removeEventListener("sessionstart",T_),oe.removeEventListener("sessionend",w_),_s.stop()};function de(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),E=!0}function Pe(){console.log("THREE.WebGLRenderer: Context Restored."),E=!1;const O=N.autoReset,K=Te.enabled,ne=Te.autoUpdate,ie=Te.needsUpdate,J=Te.type;Ae(),N.autoReset=O,Te.enabled=K,Te.autoUpdate=ne,Te.needsUpdate=ie,Te.type=J}function Re(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function nt(O){const K=O.target;K.removeEventListener("dispose",nt),Ft(K)}function Ft(O){un(O),V.remove(O)}function un(O){const K=V.get(O).programs;K!==void 0&&(K.forEach(function(ne){he.releaseProgram(ne)}),O.isShaderMaterial&&he.releaseShaderCache(O))}this.renderBufferDirect=function(O,K,ne,ie,J,_e){K===null&&(K=Oe);const Ce=J.isMesh&&J.matrixWorld.determinant()<0,Le=sw(O,K,ne,ie,J);R.setMaterial(ie,Ce);let Ne=ne.index,Ye=1;if(ie.wireframe===!0){if(Ne=z.getWireframeAttribute(ne),Ne===void 0)return;Ye=2}const je=ne.drawRange,Ve=ne.attributes.position;let ut=je.start*Ye,gt=(je.start+je.count)*Ye;_e!==null&&(ut=Math.max(ut,_e.start*Ye),gt=Math.min(gt,(_e.start+_e.count)*Ye)),Ne!==null?(ut=Math.max(ut,0),gt=Math.min(gt,Ne.count)):Ve!=null&&(ut=Math.max(ut,0),gt=Math.min(gt,Ve.count));const Gt=gt-ut;if(Gt<0||Gt===1/0)return;Ct.setup(J,ie,Le,ne,Ne);let Bt,dt=Me;if(Ne!==null&&(Bt=U.get(Ne),dt=qe,dt.setIndex(Bt)),J.isMesh)ie.wireframe===!0?(R.setLineWidth(ie.wireframeLinewidth*L()),dt.setMode(w.LINES)):dt.setMode(w.TRIANGLES);else if(J.isLine){let He=ie.linewidth;He===void 0&&(He=1),R.setLineWidth(He*L()),J.isLineSegments?dt.setMode(w.LINES):J.isLineLoop?dt.setMode(w.LINE_LOOP):dt.setMode(w.LINE_STRIP)}else J.isPoints?dt.setMode(w.POINTS):J.isSprite&&dt.setMode(w.TRIANGLES);if(J.isBatchedMesh)if(J._multiDrawInstances!==null)Vs("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),dt.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances);else if(G.get("WEBGL_multi_draw"))dt.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else{const He=J._multiDrawStarts,sn=J._multiDrawCounts,_t=J._multiDrawCount,_i=Ne?U.get(Ne).bytesPerElement:1,xo=V.get(ie).currentProgram.getUniforms();for(let qn=0;qn<_t;qn++)xo.setValue(w,"_gl_DrawID",qn),dt.render(He[qn]/_i,sn[qn])}else if(J.isInstancedMesh)dt.renderInstances(ut,Gt,J.count);else if(ne.isInstancedBufferGeometry){const He=ne._maxInstanceCount!==void 0?ne._maxInstanceCount:1/0,sn=Math.min(ne.instanceCount,He);dt.renderInstances(ut,Gt,sn)}else dt.render(ut,Gt)};function bt(O,K,ne){O.transparent===!0&&O.side===Si&&O.forceSinglePass===!1?(O.side=Dn,O.needsUpdate=!0,Ac(O,K,ne),O.side=Mr,O.needsUpdate=!0,Ac(O,K,ne),O.side=Si):Ac(O,K,ne)}this.compile=function(O,K,ne=null){ne===null&&(ne=O),m=Fe.get(ne),m.init(K),x.push(m),ne.traverseVisible(function(J){J.isLight&&J.layers.test(K.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),O!==ne&&O.traverseVisible(function(J){J.isLight&&J.layers.test(K.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),m.setupLights();const ie=new Set;return O.traverse(function(J){if(!(J.isMesh||J.isPoints||J.isLine||J.isSprite))return;const _e=J.material;if(_e)if(Array.isArray(_e))for(let Ce=0;Ce<_e.length;Ce++){const Le=_e[Ce];bt(Le,ne,J),ie.add(Le)}else bt(_e,ne,J),ie.add(_e)}),m=x.pop(),ie},this.compileAsync=function(O,K,ne=null){const ie=this.compile(O,K,ne);return new Promise(J=>{function _e(){if(ie.forEach(function(Ce){V.get(Ce).currentProgram.isReady()&&ie.delete(Ce)}),ie.size===0){J(O);return}setTimeout(_e,10)}G.get("KHR_parallel_shader_compile")!==null?_e():setTimeout(_e,10)})};let gi=null;function Zi(O){gi&&gi(O)}function T_(){_s.stop()}function w_(){_s.start()}const _s=new JM;_s.setAnimationLoop(Zi),typeof self<"u"&&_s.setContext(self),this.setAnimationLoop=function(O){gi=O,oe.setAnimationLoop(O),O===null?_s.stop():_s.start()},oe.addEventListener("sessionstart",T_),oe.addEventListener("sessionend",w_),this.render=function(O,K){if(K!==void 0&&K.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;if(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),K.parent===null&&K.matrixWorldAutoUpdate===!0&&K.updateMatrixWorld(),oe.enabled===!0&&oe.isPresenting===!0&&(oe.cameraAutoUpdate===!0&&oe.updateCamera(K),K=oe.getCamera()),O.isScene===!0&&O.onBeforeRender(v,O,K,P),m=Fe.get(O,x.length),m.init(K),x.push(m),ae.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse),se.setFromProjectionMatrix(ae),be=this.localClippingEnabled,ge=me.init(this.clippingPlanes,be),g=ye.get(O,y.length),g.init(),y.push(g),oe.enabled===!0&&oe.isPresenting===!0){const _e=v.xr.getDepthSensingMesh();_e!==null&&hd(_e,K,-1/0,v.sortObjects)}hd(O,K,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(pe,ve),I=oe.enabled===!1||oe.isPresenting===!1||oe.hasDepthSensing()===!1,I&&ke.addToRenderList(g,O),this.info.render.frame++,ge===!0&&me.beginShadows();const ne=m.state.shadowsArray;Te.render(ne,O,K),ge===!0&&me.endShadows(),this.info.autoReset===!0&&this.info.reset();const ie=g.opaque,J=g.transmissive;if(m.setupLights(),K.isArrayCamera){const _e=K.cameras;if(J.length>0)for(let Ce=0,Le=_e.length;Ce0&&C_(ie,J,O,K),I&&ke.render(O),A_(g,O,K);P!==null&&M===0&&(A.updateMultisampleRenderTarget(P),A.updateRenderTargetMipmap(P)),O.isScene===!0&&O.onAfterRender(v,O,K),Ct.resetDefaultState(),b=-1,S=null,x.pop(),x.length>0?(m=x[x.length-1],ge===!0&&me.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function hd(O,K,ne,ie){if(O.visible===!1)return;if(O.layers.test(K.layers)){if(O.isGroup)ne=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(K);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||se.intersectsSprite(O)){ie&&le.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ae);const Ce=Y.update(O),Le=O.material;Le.visible&&g.push(O,Ce,Le,ne,le.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||se.intersectsObject(O))){const Ce=Y.update(O),Le=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),le.copy(O.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),le.copy(Ce.boundingSphere.center)),le.applyMatrix4(O.matrixWorld).applyMatrix4(ae)),Array.isArray(Le)){const Ne=Ce.groups;for(let Ye=0,je=Ne.length;Ye0&&wc(J,K,ne),_e.length>0&&wc(_e,K,ne),Ce.length>0&&wc(Ce,K,ne),R.buffers.depth.setTest(!0),R.buffers.depth.setMask(!0),R.buffers.color.setMask(!0),R.setPolygonOffset(!1)}function C_(O,K,ne,ie){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[ie.id]===void 0&&(m.state.transmissionRenderTarget[ie.id]=new Yi(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")||G.has("EXT_color_buffer_float")?va:qi,minFilter:Vi,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:at.workingColorSpace}));const _e=m.state.transmissionRenderTarget[ie.id],Ce=ie.viewport||D;_e.setSize(Ce.z*v.transmissionResolutionScale,Ce.w*v.transmissionResolutionScale);const Le=v.getRenderTarget();v.setRenderTarget(_e),v.getClearColor($),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),I&&ke.render(ne);const Ne=v.toneMapping;v.toneMapping=Hi;const Ye=ie.viewport;if(ie.viewport!==void 0&&(ie.viewport=void 0),m.setupLightsView(ie),ge===!0&&me.setGlobalState(v.clippingPlanes,ie),wc(O,ne,ie),A.updateMultisampleRenderTarget(_e),A.updateRenderTargetMipmap(_e),G.has("WEBGL_multisampled_render_to_texture")===!1){let je=!1;for(let Ve=0,ut=K.length;Ve0),Ve=!!ne.morphAttributes.position,ut=!!ne.morphAttributes.normal,gt=!!ne.morphAttributes.color;let Gt=Hi;ie.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Gt=v.toneMapping);const Bt=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,dt=Bt!==void 0?Bt.length:0,He=V.get(ie),sn=m.state.lights;if(ge===!0&&(be===!0||O!==S)){const bn=O===S&&ie.id===b;me.setState(ie,O,bn)}let _t=!1;ie.version===He.__version?(He.needsLights&&He.lightsStateVersion!==sn.state.version||He.outputColorSpace!==Le||J.isBatchedMesh&&He.batching===!1||!J.isBatchedMesh&&He.batching===!0||J.isBatchedMesh&&He.batchingColor===!0&&J.colorTexture===null||J.isBatchedMesh&&He.batchingColor===!1&&J.colorTexture!==null||J.isInstancedMesh&&He.instancing===!1||!J.isInstancedMesh&&He.instancing===!0||J.isSkinnedMesh&&He.skinning===!1||!J.isSkinnedMesh&&He.skinning===!0||J.isInstancedMesh&&He.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&He.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&He.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&He.instancingMorph===!1&&J.morphTexture!==null||He.envMap!==Ne||ie.fog===!0&&He.fog!==_e||He.numClippingPlanes!==void 0&&(He.numClippingPlanes!==me.numPlanes||He.numIntersection!==me.numIntersection)||He.vertexAlphas!==Ye||He.vertexTangents!==je||He.morphTargets!==Ve||He.morphNormals!==ut||He.morphColors!==gt||He.toneMapping!==Gt||He.morphTargetsCount!==dt)&&(_t=!0):(_t=!0,He.__version=ie.version);let _i=He.currentProgram;_t===!0&&(_i=Ac(ie,K,J));let xo=!1,qn=!1,Ea=!1;const Pt=_i.getUniforms(),ti=He.uniforms;if(R.useProgram(_i.program)&&(xo=!0,qn=!0,Ea=!0),ie.id!==b&&(b=ie.id,qn=!0),xo||S!==O){R.buffers.depth.getReversed()?(W.copy(O.projectionMatrix),pR(W),mR(W),Pt.setValue(w,"projectionMatrix",W)):Pt.setValue(w,"projectionMatrix",O.projectionMatrix),Pt.setValue(w,"viewMatrix",O.matrixWorldInverse);const Un=Pt.map.cameraPosition;Un!==void 0&&Un.setValue(w,ue.setFromMatrixPosition(O.matrixWorld)),q.logarithmicDepthBuffer&&Pt.setValue(w,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&Pt.setValue(w,"isOrthographic",O.isOrthographicCamera===!0),S!==O&&(S=O,qn=!0,Ea=!0)}if(J.isSkinnedMesh){Pt.setOptional(w,J,"bindMatrix"),Pt.setOptional(w,J,"bindMatrixInverse");const bn=J.skeleton;bn&&(bn.boneTexture===null&&bn.computeBoneTexture(),Pt.setValue(w,"boneTexture",bn.boneTexture,A))}J.isBatchedMesh&&(Pt.setOptional(w,J,"batchingTexture"),Pt.setValue(w,"batchingTexture",J._matricesTexture,A),Pt.setOptional(w,J,"batchingIdTexture"),Pt.setValue(w,"batchingIdTexture",J._indirectTexture,A),Pt.setOptional(w,J,"batchingColorTexture"),J._colorsTexture!==null&&Pt.setValue(w,"batchingColorTexture",J._colorsTexture,A));const ni=ne.morphAttributes;if((ni.position!==void 0||ni.normal!==void 0||ni.color!==void 0)&&We.update(J,ne,_i),(qn||He.receiveShadow!==J.receiveShadow)&&(He.receiveShadow=J.receiveShadow,Pt.setValue(w,"receiveShadow",J.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(ti.envMap.value=Ne,ti.flipEnvMap.value=Ne.isCubeTexture&&Ne.isRenderTargetTexture===!1?-1:1),ie.isMeshStandardMaterial&&ie.envMap===null&&K.environment!==null&&(ti.envMapIntensity.value=K.environmentIntensity),qn&&(Pt.setValue(w,"toneMappingExposure",v.toneMappingExposure),He.needsLights&&ow(ti,Ea),_e&&ie.fog===!0&&ce.refreshFogUniforms(ti,_e),ce.refreshMaterialUniforms(ti,ie,Q,te,m.state.transmissionRenderTarget[O.id]),Xu.upload(w,P_(He),ti,A)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(Xu.upload(w,P_(He),ti,A),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&Pt.setValue(w,"center",J.center),Pt.setValue(w,"modelViewMatrix",J.modelViewMatrix),Pt.setValue(w,"normalMatrix",J.normalMatrix),Pt.setValue(w,"modelMatrix",J.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){const bn=ie.uniformsGroups;for(let Un=0,dd=bn.length;Un0&&A.useMultisampledRTT(O)===!1?J=V.get(O).__webglMultisampledFramebuffer:Array.isArray(je)?J=je[ne]:J=je,D.copy(O.viewport),B.copy(O.scissor),H=O.scissorTest}else D.copy(re).multiplyScalar(Q).floor(),B.copy(xe).multiplyScalar(Q).floor(),H=ze;if(ne!==0&&(J=lw),R.bindFramebuffer(w.FRAMEBUFFER,J)&&ie&&R.drawBuffers(O,J),R.viewport(D),R.scissor(B),R.setScissorTest(H),_e){const Ne=V.get(O.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+K,Ne.__webglTexture,ne)}else if(Ce){const Ne=V.get(O.texture),Ye=K;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,Ne.__webglTexture,ne,Ye)}else if(O!==null&&ne!==0){const Ne=V.get(O.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,Ne.__webglTexture,ne)}b=-1},this.readRenderTargetPixels=function(O,K,ne,ie,J,_e,Ce){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Le=V.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Ce!==void 0&&(Le=Le[Ce]),Le){R.bindFramebuffer(w.FRAMEBUFFER,Le);try{const Ne=O.texture,Ye=Ne.format,je=Ne.type;if(!q.textureFormatReadable(Ye)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!q.textureTypeReadable(je)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}K>=0&&K<=O.width-ie&&ne>=0&&ne<=O.height-J&&w.readPixels(K,ne,ie,J,Je.convert(Ye),Je.convert(je),_e)}finally{const Ne=P!==null?V.get(P).__webglFramebuffer:null;R.bindFramebuffer(w.FRAMEBUFFER,Ne)}}},this.readRenderTargetPixelsAsync=async function(O,K,ne,ie,J,_e,Ce){if(!(O&&O.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Le=V.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Ce!==void 0&&(Le=Le[Ce]),Le){const Ne=O.texture,Ye=Ne.format,je=Ne.type;if(!q.textureFormatReadable(Ye))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!q.textureTypeReadable(je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(K>=0&&K<=O.width-ie&&ne>=0&&ne<=O.height-J){R.bindFramebuffer(w.FRAMEBUFFER,Le);const Ve=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Ve),w.bufferData(w.PIXEL_PACK_BUFFER,_e.byteLength,w.STREAM_READ),w.readPixels(K,ne,ie,J,Je.convert(Ye),Je.convert(je),0);const ut=P!==null?V.get(P).__webglFramebuffer:null;R.bindFramebuffer(w.FRAMEBUFFER,ut);const gt=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await dR(w,gt,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Ve),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,_e),w.deleteBuffer(Ve),w.deleteSync(gt),_e}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(O,K=null,ne=0){O.isTexture!==!0&&(Vs("WebGLRenderer: copyFramebufferToTexture function signature has changed."),K=arguments[0]||null,O=arguments[1]);const ie=Math.pow(2,-ne),J=Math.floor(O.image.width*ie),_e=Math.floor(O.image.height*ie),Ce=K!==null?K.x:0,Le=K!==null?K.y:0;A.setTexture2D(O,0),w.copyTexSubImage2D(w.TEXTURE_2D,ne,0,0,Ce,Le,J,_e),R.unbindTexture()};const cw=w.createFramebuffer(),uw=w.createFramebuffer();this.copyTextureToTexture=function(O,K,ne=null,ie=null,J=0,_e=null){O.isTexture!==!0&&(Vs("WebGLRenderer: copyTextureToTexture function signature has changed."),ie=arguments[0]||null,O=arguments[1],K=arguments[2],_e=arguments[3]||0,ne=null),_e===null&&(J!==0?(Vs("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),_e=J,J=0):_e=0);let Ce,Le,Ne,Ye,je,Ve,ut,gt,Gt;const Bt=O.isCompressedTexture?O.mipmaps[_e]:O.image;if(ne!==null)Ce=ne.max.x-ne.min.x,Le=ne.max.y-ne.min.y,Ne=ne.isBox3?ne.max.z-ne.min.z:1,Ye=ne.min.x,je=ne.min.y,Ve=ne.isBox3?ne.min.z:0;else{const ni=Math.pow(2,-J);Ce=Math.floor(Bt.width*ni),Le=Math.floor(Bt.height*ni),O.isDataArrayTexture?Ne=Bt.depth:O.isData3DTexture?Ne=Math.floor(Bt.depth*ni):Ne=1,Ye=0,je=0,Ve=0}ie!==null?(ut=ie.x,gt=ie.y,Gt=ie.z):(ut=0,gt=0,Gt=0);const dt=Je.convert(K.format),He=Je.convert(K.type);let sn;K.isData3DTexture?(A.setTexture3D(K,0),sn=w.TEXTURE_3D):K.isDataArrayTexture||K.isCompressedArrayTexture?(A.setTexture2DArray(K,0),sn=w.TEXTURE_2D_ARRAY):(A.setTexture2D(K,0),sn=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,K.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,K.unpackAlignment);const _t=w.getParameter(w.UNPACK_ROW_LENGTH),_i=w.getParameter(w.UNPACK_IMAGE_HEIGHT),xo=w.getParameter(w.UNPACK_SKIP_PIXELS),qn=w.getParameter(w.UNPACK_SKIP_ROWS),Ea=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,Bt.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,Bt.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,Ye),w.pixelStorei(w.UNPACK_SKIP_ROWS,je),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Ve);const Pt=O.isDataArrayTexture||O.isData3DTexture,ti=K.isDataArrayTexture||K.isData3DTexture;if(O.isDepthTexture){const ni=V.get(O),bn=V.get(K),Un=V.get(ni.__renderTarget),dd=V.get(bn.__renderTarget);R.bindFramebuffer(w.READ_FRAMEBUFFER,Un.__webglFramebuffer),R.bindFramebuffer(w.DRAW_FRAMEBUFFER,dd.__webglFramebuffer);for(let vs=0;vs{n.delete(s)};return{on:s=>{n.add(s);const o=()=>e(s);return os(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(n).map(o=>o(...s))),clear:()=>{n.clear()}}}const hp=new WeakMap,AN=(...n)=>{var e;const t=n[0],i=(e=vn())==null?void 0:e.proxy;if(i==null&&!ic())throw new Error("injectLocal must be called in setup");return i&&hp.has(i)&&t in hp.get(i)?hp.get(i)[t]:gn(...n)},lm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const CN=n=>typeof n<"u",RN=n=>n!=null,PN=Object.prototype.toString,IN=n=>PN.call(n)==="[object Object]",cm=()=>{};function LN(n,e){function t(...i){return new Promise((r,s)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(s)})}return t}function DN(n,e={}){let t,i,r=cm;const s=l=>{clearTimeout(l),r(),r=cm};let o;return l=>{const c=et(n),u=et(e.maxWait);return t&&s(t),c<=0||u!==void 0&&u<=0?(i&&(s(i),i=null),Promise.resolve(l())):new Promise((f,h)=>{r=e.rejectOnCancel?h:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&s(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&s(i),i=null,f(l())},c)})}}function ty(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function ON(n,e,t=!1){return e.reduce((i,r)=>(r in n&&(!t||n[r]!==void 0)&&(i[r]=n[r]),i),{})}function NN(n){return vn()}function ll(n){return Array.isArray(n)?n:[n]}function UN(n,e=200,t={}){return LN(DN(e,t),n)}function ny(n,e=200,t={}){const i=Ze(n.value),r=UN(()=>{i.value=n.value},e,t);return Ge(n,()=>r()),i}function FN(n,e={}){if(!wt(n))return rb(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=eg(()=>({get(){return n.value[i]},set(r){var s;if((s=et(e.replaceRef))!=null?s:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return t}const on=et;function e_(n,e=!0,t){NN()?yn(n,t):e?n():cs(n)}function BN(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:r=!1}=t;let s=null;const o=Ie(!1);function a(){s&&(clearInterval(s),s=null)}function l(){o.value=!1,a()}function c(){const u=et(e);u<=0||(o.value=!0,r&&n(),a(),o.value&&(s=setInterval(n,u)))}if(i&&lm&&c(),wt(e)||typeof e=="function"){const u=Ge(e,()=>{o.value&&lm&&c()});os(u)}return os(l),{isActive:o,pause:l,resume:c}}function rE(n,e,t){return Ge(n,e,{...t,immediate:!0})}const Pr=lm?window:void 0;function Ei(n){var e;const t=et(n);return(e=t==null?void 0:t.$el)!=null?e:t}function ho(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),r=Se(()=>{const a=ll(et(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),s=rE(()=>{var a,l;return[(l=(a=r.value)==null?void 0:a.map(c=>Ei(c)))!=null?l:[Pr].filter(c=>c!=null),ll(et(r.value?n[1]:n[0])),ll(It(r.value?n[2]:n[1])),et(r.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=IN(u)?{...u}:u;e.push(...a.flatMap(h=>l.flatMap(d=>c.map(p=>i(h,d,p,f)))))},{flush:"post"}),o=()=>{s(),t()};return os(t),o}function kN(){const n=Ie(!1),e=vn();return e&&yn(()=>{n.value=!0},e),n}function td(n){const e=kN();return Se(()=>(e.value,!!n()))}function VN(n,e,t={}){const{window:i=Pr,...r}=t;let s;const o=td(()=>i&&"MutationObserver"in i),a=()=>{s&&(s.disconnect(),s=void 0)},l=Se(()=>{const h=et(n),d=ll(h).map(Ei).filter(RN);return new Set(d)}),c=Ge(()=>l.value,h=>{a(),o.value&&h.size&&(s=new MutationObserver(e),h.forEach(d=>s.observe(d,r)))},{immediate:!0,flush:"post"}),u=()=>s==null?void 0:s.takeRecords(),f=()=>{c(),a()};return os(f),{isSupported:o,stop:f,takeRecords:u}}function t_(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:r=Pr,once:s=!1}=e,o=Ie(!1),a=Se(()=>i?1e3/et(i):null);let l=0,c=null;function u(d){if(!o.value||!r)return;l||(l=d);const p=d-l;if(a.value&&pt&&"matchMedia"in t&&typeof t.matchMedia=="function"),s=Ie(typeof i=="number"),o=Ie(),a=Ie(!1),l=c=>{a.value=c.matches};return rc(()=>{if(s.value){s.value=!r.value;const c=et(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),h=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),d=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(h||d);return h&&p&&(p=i>=ty(h[1])),d&&p&&(p=i<=ty(d[1])),f?!p:p});return}r.value&&(o.value=t.matchMedia(et(n)),a.value=o.value.matches)}),ho(o,"change",l,{passive:!0}),Se(()=>a.value)}function GN(n){return JSON.parse(JSON.stringify(n))}function WN(n={}){const{window:e=Pr}=n,t=Ie(1),i=sE(()=>`(resolution: ${t.value}dppx)`,n);let r=cm;return e&&(r=rE(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:di(t),stop:r}}function oE(n,e,t={}){const{window:i=Pr,...r}=t;let s;const o=td(()=>i&&"ResizeObserver"in i),a=()=>{s&&(s.disconnect(),s=void 0)},l=Se(()=>{const f=et(n);return Array.isArray(f)?f.map(h=>Ei(h)):[Ei(f)]}),c=Ge(l,f=>{if(a(),o.value&&i){s=new ResizeObserver(e);for(const h of f)h&&s.observe(h,r)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return os(u),{isSupported:o,stop:u}}function XN(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:o="sync"}=e,a=Ie(0),l=Ie(0),c=Ie(0),u=Ie(0),f=Ie(0),h=Ie(0),d=Ie(0),p=Ie(0);function _(){const m=Ei(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,h.value=0,d.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,h.value=y.width,d.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return oE(n,g),Ge(()=>Ei(n),m=>!m&&g()),VN(n,g,{attributeFilter:["style","class"]}),r&&ho("scroll",g,{capture:!0,passive:!0}),i&&ho("resize",g,{passive:!0}),e_(()=>{s&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:p,update:g}}function $N(n,e={width:0,height:0},t={}){const{window:i=Pr,box:r="content-box"}=t,s=Se(()=>{var f,h;return(h=(f=Ei(n))==null?void 0:f.namespaceURI)==null?void 0:h.includes("svg")}),o=Ie(e.width),a=Ie(e.height),{stop:l}=oE(n,([f])=>{const h=r==="border-box"?f.borderBoxSize:r==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&s.value){const d=Ei(n);if(d){const p=d.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(h){const d=ll(h);o.value=d.reduce((p,{inlineSize:_})=>p+_,0),a.value=d.reduce((p,{blockSize:_})=>p+_,0)}else o.value=f.contentRect.width,a.value=f.contentRect.height},t);e_(()=>{const f=Ei(n);f&&(o.value="offsetWidth"in f?f.offsetWidth:e.width,a.value="offsetHeight"in f?f.offsetHeight:e.height)});const c=Ge(()=>Ei(n),f=>{o.value=f?e.width:0,a.value=f?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function qN(n){var e;const t=Ie(0);if(typeof performance>"u")return t;const i=(e=n==null?void 0:n.every)!=null?e:10;let r=performance.now(),s=0;return t_(()=>{if(s+=1,s>=i){const o=performance.now(),a=o-r;t.value=Math.round(1e3/(a/s)),r=o,s=0}}),t}function YN(n={}){const e=Ze(),t=td(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;BN(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const aE={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},jN=Object.keys(aE);function KN(n={}){const{target:e=Pr}=n,t=Ie(!1),i=Ze(n.initialValue||{});Object.assign(i.value,aE,i.value);const r=s=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(s.pointerType))&&(i.value=ON(s,jN,!1))};if(e){const s={passive:!0};ho(e,["pointerdown","pointermove","pointerup"],r,s),ho(e,"pointerleave",()=>t.value=!1,s)}return{...FN(i),isInside:t}}function Y4(n,e,t,i={}){var r,s,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:f,shouldEmit:h}=i,d=vn(),p=t||(d==null?void 0:d.emit)||((r=d==null?void 0:d.$emit)==null?void 0:r.bind(d))||((o=(s=d==null?void 0:d.proxy)==null?void 0:s.$emit)==null?void 0:o.bind(d==null?void 0:d.proxy));let _=c;_=_||`update:${e.toString()}`;const g=x=>a?typeof a=="function"?a(x):GN(x):x,m=()=>CN(n[e])?g(n[e]):f,y=x=>{h?h(x)&&p(_,x):p(_,x)};if(l){const x=m(),v=Ze(x);let E=!1;return Ge(()=>n[e],T=>{E||(E=!0,v.value=g(T),cs(()=>E=!1))}),Ge(v,T=>{!E&&(T!==n[e]||u)&&y(T)},{deep:u}),v}else return Se({get(){return m()},set(x){y(x)}})}function ZN(n={}){const{window:e=Pr,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:s=!0,type:o="inner"}=n,a=Ie(t),l=Ie(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:h,scale:d}=e.visualViewport;a.value=Math.round(f*d),l.value=Math.round(h*d)}else s?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),e_(c);const u={passive:!0};if(ho("resize",c,u),e&&o==="visual"&&e.visualViewport&&ho(e.visualViewport,"resize",c,u),r){const f=sE("(orientation: portrait)");Ge(f,()=>c())}return{width:a,height:l}}var JN=Object.defineProperty,QN=(n,e,t)=>e in n?JN(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,iy=(n,e,t)=>QN(n,typeof e!="symbol"?e+"":e,t);const e3="@tresjs/core",t3="module",n3="4.3.3",i3="pnpm@9.15.5",r3="Declarative ThreeJS using Vue Components",s3="Alvaro Saburido (https://github.com/alvarosabu/)",o3="MIT",a3={type:"git",url:"git+https://github.com/Tresjs/tres.git"},l3=["vue","3d","threejs","three","threejs-vue"],c3=!1,u3={".":{types:"./dist/index.d.ts",import:"./dist/tres.js",require:"./dist/tres.umd.cjs"},"./components":{types:"./dist/src/components/index.d.ts"},"./composables":{types:"./dist/src/composables/index.d.ts"},"./types":{types:"./dist/src/types/index.d.ts"},"./utils":{types:"./dist/src/utils/index.d.ts"},"./*":"./*"},f3="./dist/tres.js",h3="./dist/tres.js",d3="./dist/index.d.ts",p3=["*.d.ts","dist"],m3={access:"public"},g3={dev:"pnpm --filter='./playground/vue' dev","dev:nuxt":"pnpm --filter='./playground/nuxt' dev",build:"vite build",test:"vitest","test:ci":"vitest run","test:ui":"vitest --ui --coverage.enabled=true",release:"release-it",coverage:"vitest run --coverage",lint:"eslint .","lint:fix":"eslint . --fix","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:serve":"vitepress serve docs","docs:preview":"vitepress preview docs","docs:contributors":"esno scripts/update-contributors.ts"},_3={three:">=0.133",vue:">=3.4"},v3={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^12.5.0"},y3={"@release-it/conventional-changelog":"^10.0.0","@stackblitz/sdk":"^1.11.0","@tresjs/cientos":"4.1.0","@tresjs/eslint-config":"^1.4.0","@types/three":"^0.173.0","@typescript-eslint/eslint-plugin":"^8.23.0","@typescript-eslint/parser":"^8.23.0","@vitejs/plugin-vue":"^5.2.1","@vitest/coverage-c8":"^0.33.0","@vitest/coverage-v8":"^3.0.5","@vitest/ui":"^3.0.5","@vue/test-utils":"^2.4.6",eslint:"^9.19.0","eslint-plugin-vue":"^9.32.0",esno:"^4.8.0",gsap:"^3.12.7",jsdom:"^26.0.0",kolorist:"^1.8.0",ohmyfetch:"^0.4.21",pathe:"^2.0.2","release-it":"^18.1.2","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-copy":"^3.5.0","rollup-plugin-visualizer":"^5.14.0",sponsorkit:"^16.3.0",three:"^0.173.0",unocss:"^65.4.3",unplugin:"^2.1.2","unplugin-vue-components":"^28.0.0",vite:"^6.1.0","vite-plugin-banner":"^0.8.0","vite-plugin-dts":"4.5.0","vite-plugin-inspect":"^10.1.0","vite-plugin-require-transform":"^1.0.21","vite-svg-loader":"^5.1.0",vitepress:"1.6.3",vitest:"3.0.5",vue:"3.5.13","vue-demi":"^0.14.10"},x3={name:e3,type:t3,version:n3,packageManager:i3,description:r3,author:s3,license:o3,repository:a3,keywords:l3,sideEffects:c3,exports:u3,main:f3,module:h3,types:d3,files:p3,publishConfig:m3,scripts:g3,peerDependencies:_3,dependencies:v3,devDependencies:y3};class b3 extends Ht{constructor(...e){super(...e),iy(this,"type","HightlightMesh"),iy(this,"createTime"),this.createTime=Date.now()}onBeforeRender(){const e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}}function um(n){return typeof n>"u"}function jf(n){return Array.isArray(n)}function S3(n){return typeof n=="number"}function lE(n){return typeof n=="string"}function Xs(n){return typeof n=="function"}function Ir(n){return n===Object(n)&&!jf(n)&&!Xs(n)}function Jr(n){return Ir(n)&&"isObject3D"in n&&!!n.isObject3D}function ry(n){return Ir(n)&&"isCamera"in n&&!!n.isCamera}function M3(n){return Ir(n)&&"isBufferGeometry"in n&&!!n.isBufferGeometry}function E3(n){return Ir(n)&&"isMaterial"in n&&!!n.isMaterial}function T3(n){return Ir(n)&&"isLight"in n&&!!n.isLight}function w3(n){return Ir(n)&&"isFog"in n&&!!n.isFog}function A3(n){return Ir(n)&&"isScene"in n&&!!n.isScene}function Tu(n){return Jr(n)||M3(n)||E3(n)||w3(n)}function C3(n){return Ir(n)&&!!n.isPrimitive}const cE=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],cE(n[t],e[t]));return Object.assign(n||{},e),n},R3="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",P3=D3(R3);function sy(n){return n&&n.nodeType===1}function wu(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const I3=/\B([A-Z])/g;function L3(n){return n.replace(I3,"-$1").toLowerCase()}function D3(n,e){const t=Object.create(null),i=n.split(",");for(let r=0;r!!t[r.toLowerCase()]:r=>!!t[r]}const oy=(n,e)=>{if(!e)return;const t=Array.isArray(e)?e:e.match(/([^[.\]])+/g);return t==null?void 0:t.reduce((i,r)=>i&&i[r],n)},O3=(n,e,t)=>{const i=Array.isArray(e)?e:e.match(/([^[.\]])+/g);i&&i.reduce((r,s,o)=>(r[s]===void 0&&(r[s]={}),o===i.length-1&&(r[s]=t),r[s]),n)};function uE(n,e){if(sy(n)&&sy(e)){const r=n.attributes,s=e.attributes;return r.length!==s.length?!1:Array.from(r).every(({name:o,value:a})=>e.getAttribute(o)===a)}if(n===e)return!0;if(n===null||typeof n!="object"||e===null||typeof e!="object")return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const r of t)if(!i.includes(r)||!uE(n[r],e[r]))return!1;return!0}function N3(n,e){if(!Array.isArray(n)||!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t{if(l.uuid===e)return l;for(const c of l.children){const u=r(c);if(u)return u}},s=r(n);if(!s){console.warn("Object with UUID not found in the scene.");return}let o=s;for(let l=0;lfE(i)),!(n instanceof Dh)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&i.geometry.dispose(),Array.isArray(i.material)?i.material.forEach(r=>ay(r)):i.material&&ay(i.material)}}function k3(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const cy=/-\d+$/;function V3(n,e,t){if(lE(t)){if(cy.test(t)){const s=t.replace(cy,""),{target:o,key:a}=fm(n,s);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>um(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:r}=fm(n,t);e.__tres.previousAttach=i[r],i[r]=ua(e)}else e.__tres.previousAttach=t(n,e)}function z3(n,e,t){var i,r,s;if(lE(t)){const{target:o,key:a}=fm(n,t),l=e.__tres.previousAttach;l===void 0?delete o[a]:o[a]=l,"__tresDetach"in o&&o.__tresDetach()}else(r=(i=e.__tres)==null?void 0:i.previousAttach)==null||r.call(i,n,e);(s=e.__tres)==null||delete s.previousAttach}function Hs(n,e,t){const i=n;return i.__tres={type:"unknown",eventCount:0,root:t,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},i.__tres.attach||(i.isMaterial?i.__tres.attach="material":i.isBufferGeometry?i.__tres.attach="geometry":i.isFog&&(i.__tres.attach="fog")),i}function hE(n){var e;const t=(e=n==null?void 0:n.__tres)==null?void 0:e.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function H3(n,e,t){var i;if(!Xs(n.setPixelRatio))return;let r=0;if(t&&jf(t)){const s=t;if(s.length>=2){const[o,a]=s;r=Ag.clamp(e,o,a)}}else S3(t)?r=t:r=e;r!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(r)}function G3(n,e,t,i,r){const s=[...e.__tres.objects],o=ua(e);if(n=ua(n),o===n)return!0;const a=Hs(n,e.__tres??{},r),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of s)dE(u,r),pE(u,r);o.__tres.objects=[],i.remove(e);for(const[u,f]of Object.entries(c))i.patchProp(a,u,a[u],f);t(n),i.insert(e,l);for(const u of s)i.insert(u,e);return!0}function ua(n){return C3(n)?(n.object.__tres=n.__tres,n.object):n}function dE(n,e){var t,i,r,s;const o=((t=n.__tres)==null?void 0:t.parent)||e.scene.value;n.__tres&&(n.__tres.parent=null),o&&o.__tres&&"objects"in o.__tres&&k3(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?z3(o,n,n.__tres.attach):((s=(r=n.parent)==null?void 0:r.remove)==null||s.call(r,ua(n)),n.parent=null)}function pE(n,e){var t;(t=n.traverse)==null||t.call(n,i=>{var r;e.deregisterCamera(i),(r=e.eventManager)==null||r.deregisterPointerMissedObject(i)}),e.deregisterCamera(n),hE(n)}const W3=({sizes:n})=>{const e=Ze([]),t=Se(()=>e.value[0]),i=o=>{const a=o instanceof hc?o:e.value.find(c=>c.uuid===o);if(!a)return;const l=e.value.filter(({uuid:c})=>c!==a.uuid);e.value=[a,...l]},r=(o,a=!1)=>{if(ry(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},s=o=>{if(ry(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return rc(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof $t||X3(o))&&(o instanceof $t?o.aspect=n.aspectRatio.value:(o.left=n.width.value*-.5,o.right=n.width.value*.5,o.top=n.height.value*.5,o.bottom=n.height.value*-.5),o.updateProjectionMatrix())})}),$i(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:r,deregisterCamera:s,setCameraActive:i}};function X3(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const Kf="[TresJS ▲ ■ ●] ";function $3(...n){typeof n[0]=="string"?n[0]=Kf+n[0]:n.unshift(Kf),console.error(...n)}function q3(...n){typeof n[0]=="string"?n[0]=Kf+n[0]:n.unshift(Kf),console.warn(...n)}function Y3(n,e){}function mE(){return{logError:$3,logWarning:q3,logMessage:Y3}}const hm=Ze({}),dm=n=>Object.assign(hm.value,n);function dp(){const n=new Map,e=new Set;let t=0,i=!1;const r=()=>{const o=Array.from(n.entries()).sort((a,l)=>{const c=a[1].priority-l[1].priority;return c===0?a[1].addI-l[1].addI:c});e.clear(),o.forEach(a=>e.add(a[0]))},s=o=>{n.delete(o),e.delete(o)};return{on:(o,a=0)=>{n.set(o,{priority:a,addI:t++});const l=()=>s(o);return os(l),i=!0,{off:l}},off:s,trigger:(...o)=>{i&&(r(),i=!1),e.forEach(a=>a(...o))},dispose:()=>{n.clear(),e.clear()},get count(){return n.size}}}function j3(){let n=!0,e=!0,t=!1;const i=new Qh(!1),r=Ze(i.running),s=Ze(!1);let o;const a=Ag.generateUUID();let l=null;const c=dp(),u=dp(),f=dp();T();let h={};function d(M){h=M}function p(M,P,b=0){switch(P){case"before":return c.on(M,b);case"render":return l||(l=M),u.dispose(),u.on(M);case"after":return f.on(M,b)}}function _(){e&&(e=!1,T(),E())}function g(){e=!0,T(),cancelAnimationFrame(o)}function m(){t=!1,T()}function y(){t=!0,T()}function x(){s.value=!0}function v(){s.value=!1}function E(){if(!n){o=requestAnimationFrame(E);return}const M=i.getDelta(),P=i.getElapsedTime(),b={camera:It(h.camera),scene:It(h.scene),renderer:It(h.renderer),raycaster:It(h.raycaster),controls:It(h.controls),invalidate:h.invalidate,advance:h.advance},S={delta:M,elapsed:P,clock:i,...b};r.value&&c.trigger(S),s.value||(u.count?u.trigger(S):l&&l(S)),r.value&&f.trigger(S),o=requestAnimationFrame(E)}function T(){const M=!e&&!t;i.running!==M&&(i.running?i.stop():i.start()),r.value=i.running}return{loopId:a,register:(M,P,b)=>p(M,P,b),start:_,stop:g,pause:y,resume:m,pauseRender:x,resumeRender:v,isRenderPaused:s,isActive:r,setContext:d,setReady:M=>n=M}}function n_(n){let e=0;return n.traverse(t=>{if(t.isMesh&&t.geometry&&t.type!=="HightlightMesh"){const i=t.geometry,r=i.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,s=i.index?i.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=i.attributes.normal?i.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a=i.attributes.uv?i.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=r+s+o+a;e+=l}}),e}function K3(n){return(n/1024).toFixed(2)}const Z3=Number.parseInt(lc.replace("dev",""));function J3(n){return n instanceof we?n:Array.isArray(n)?new we(...n):new we(n)}const Au={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Cn,toneMapping:yh,toneMappingExposure:3,shadowMap:{enabled:!0,type:dg}},flat:{toneMapping:Hi,toneMappingExposure:1}};function Q3({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:r,advance:s}}){const o=Se(()=>({alpha:on(e.alpha)??!0,depth:on(e.depth),canvas:Ei(n),context:on(e.context),stencil:on(e.stencil),antialias:on(e.antialias)??!0,precision:on(e.precision),powerPreference:on(e.powerPreference),premultipliedAlpha:on(e.premultipliedAlpha),preserveDrawingBuffer:on(e.preserveDrawingBuffer),logarithmicDepthBuffer:on(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:on(e.failIfMajorPerformanceCaveat)})),a=Ie(new $u(o.value));function l(){e.renderMode==="on-demand"&&r()}Ge(o,()=>{a.value.dispose(),a.value=new $u(o.value),l()}),Ge([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),Ge(()=>e.clearColor,l);const{pixelRatio:c}=WN(),{logError:u}=mE(),f=(()=>{const d=new $u,p={shadowMap:{enabled:d.shadowMap.enabled,type:d.shadowMap.type},toneMapping:d.toneMapping,toneMappingExposure:d.toneMappingExposure,outputColorSpace:d.outputColorSpace};return d.dispose(),p})(),h=on(e.renderMode);return h==="on-demand"&&r(),h==="manual"&&setTimeout(()=>{s()},100),rc(()=>{const d=on(e.preset);d&&(d in Au||u(`Renderer Preset must be one of these: ${Object.keys(Au).join(", ")}`),cE(a.value,Au[d])),H3(a.value,c.value,on(e.dpr)),h==="always"&&(i.frames.value=Math.max(1,i.frames.value));const p=(m,y)=>{const x=on(m),v=()=>{if(d)return oy(Au[d],y)};if(x!==void 0)return x;const E=v();return E!==void 0?E:oy(f,y)},_=(m,y)=>O3(a.value,y,p(m,y));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??yh,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),Z3<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=p(e.clearColor,"clearColor");g&&a.value.setClearColor(g?J3(g):new we(0))}),$i(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function eU(n,e,t=10){const i=on(n)?ZN():$N(Se(()=>on(e).parentElement)),r=di(ny(i.width,t)),s=di(ny(i.height,t)),o=Se(()=>r.value/s.value);return{height:s,width:r,aspectRatio:o}}const tU=(n,e)=>{const t=Se(()=>e.renderer.value.domElement),i=Ie([]),{x:r,y:s}=KN({target:t});let o=0;const{width:a,height:l,top:c,left:u}=XN(t),f=({x:re,y:xe})=>{if(t.value)return{x:(re-u.value)/a.value*2-1,y:-((xe-c.value)/l.value)*2+1}},h=({x:re,y:xe})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new fe(re,xe),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},d=re=>{const xe=f({x:(re==null?void 0:re.clientX)??r.value,y:(re==null?void 0:re.clientY)??s.value});return xe?h(xe)||[]:[]},p=oi(),_=oi(),g=oi(),m=oi(),y=oi(),x=oi(),v=oi(),E=oi();function T(re){const xe={};for(const ze in re)typeof ze!="function"&&(xe[ze]=re[ze]);return xe}const M=(re,xe)=>{var ze,se,ge;const be=T(xe),W=new F(xe==null?void 0:xe.clientX,xe==null?void 0:xe.clientY,0).unproject((ze=e.camera)==null?void 0:ze.value);re.trigger({...be,intersections:i.value,unprojectedPoint:W,ray:(se=e.raycaster)==null?void 0:se.value.ray,camera:(ge=e.camera)==null?void 0:ge.value,sourceEvent:xe,delta:o,stopPropagating:!1})};let P;const b=re=>{d(re),M(g,re),P=re},S=()=>{P&&b(P)};let D,B,H;const $=re=>{var xe;D=(xe=i.value[0])==null?void 0:xe.object,o=0,B=new fe((re==null?void 0:re.clientX)??r.value,(re==null?void 0:re.clientY)??s.value),M(y,re)};let ee,Z=!1;const te=re=>{var xe,ze,se;re instanceof PointerEvent&&(i.value.length===0&&M(x,re),D===((xe=i.value[0])==null?void 0:xe.object)&&(H=new fe((re==null?void 0:re.clientX)??r.value,(re==null?void 0:re.clientY)??s.value),o=B==null?void 0:B.distanceTo(H),re.button===0?(M(p,re),ee===((ze=i.value[0])==null?void 0:ze.object)?Z=!0:(ee=(se=i.value[0])==null?void 0:se.object,Z=!1)):re.button===2&&M(v,re)),M(m,re))},Q=re=>{Z&&(M(_,re),ee=void 0,Z=!1)},pe=re=>M(g,re),ve=re=>M(E,re);return t.value.addEventListener("pointerup",te),t.value.addEventListener("pointerdown",$),t.value.addEventListener("pointermove",b),t.value.addEventListener("pointerleave",pe),t.value.addEventListener("dblclick",Q),t.value.addEventListener("wheel",ve),$i(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",te),t.value.removeEventListener("pointerdown",$),t.value.removeEventListener("pointermove",b),t.value.removeEventListener("pointerleave",pe),t.value.removeEventListener("dblclick",Q),t.value.removeEventListener("wheel",ve))}),{intersects:i,onClick:re=>p.on(re).off,onDblClick:re=>_.on(re).off,onContextMenu:re=>v.on(re).off,onPointerMove:re=>g.on(re).off,onPointerUp:re=>m.on(re).off,onPointerDown:re=>y.on(re).off,onPointerMissed:re=>x.on(re).off,onWheel:re=>E.on(re).off,forceUpdate:S}};function pp(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function nU(n,e,t){var i;const r=Ie(),s=Ie();n&&(r.value=n),e&&(s.value=e);const o=b=>{var S;return((S=b.__tres)==null?void 0:S.eventCount)>0},a=b=>{var S;return((S=b.children)==null?void 0:S.some(D=>a(D)))||o(b)},l=Ie(((i=r.value)==null?void 0:i.children).filter(a)||[]);function c(b,S){const D=[],B=()=>S.stopPropagating=!0;S.stopPropagation=B;for(const H of S==null?void 0:S.intersections){if(S.stopPropagating)return;S={...S,...H};const{object:$}=H;S.eventObject=$,pp($[b],S),D.push($);let ee=$.parent;for(;ee!==null&&!S.stopPropagating&&!D.includes(ee);)S.eventObject=ee,pp(ee[b],S),D.push(ee),ee=ee.parent;const Z=L3(b.slice(2));t(Z,{intersection:H,event:S})}}const{onClick:u,onDblClick:f,onContextMenu:h,onPointerMove:d,onPointerDown:p,onPointerUp:_,onPointerMissed:g,onWheel:m,forceUpdate:y}=tU(l,e);_(b=>c("onPointerUp",b)),p(b=>c("onPointerDown",b)),u(b=>c("onClick",b)),f(b=>c("onDoubleClick",b)),h(b=>c("onContextMenu",b)),m(b=>c("onWheel",b));let x=[];d(b=>{const S=b.intersections.map(({object:B})=>B),D=b.intersections;x.forEach(({object:B})=>{S.includes(B)||(b.intersections=x,c("onPointerLeave",b),c("onPointerOut",b))}),b.intersections=D,b.intersections.forEach(({object:B})=>{x.includes(B)||(c("onPointerEnter",b),c("onPointerOver",b))}),c("onPointerMove",b),x=b.intersections});const v=[];g(b=>{const S=()=>b.stopPropagating=!0;b.stopPropagation=S,v.forEach(D=>{b.stopPropagating||(b.eventObject=D,pp(D.onPointerMissed,b))}),t("pointer-missed",{event:b})});function E(b){Tu(b)&&Jr(b)&&l.value.push(b)}function T(b){if(Tu(b)&&Jr(b)){const S=l.value.indexOf(b);S>-1&&l.value.splice(S,1)}}function M(b){Tu(b)&&Jr(b)&&b.onPointerMissed&&v.push(b)}function P(b){if(Tu(b)&&Jr(b)){const S=v.indexOf(b);S>-1&&v.splice(S,1)}}return e.eventManager={forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:M,deregisterPointerMissedObject:P},{forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:M,deregisterPointerMissedObject:P}}function iU(n,e,t=100){t=t<=0?100:t;const i=oi(),r=new Set;let s=!1,o=!1,a=null;function l(){a&&clearTimeout(a),!o&&!s&&n()?(i.trigger(e),r.forEach(f=>f()),r.clear(),s=!0):!o&&!s&&(a=setTimeout(l,t))}function c(){o=!0,a&&clearTimeout(a)}l();const u=(f,...h)=>{f(...h)};return{on:f=>{if(s)return u(f,e),{off:()=>{}};{const h=i.on(f);return r.add(h.off),i.on(f)}},off:i.off,trigger:i.trigger,clear:i.clear,cancel:c}}const mp=new WeakMap;function rU(n){if(n=n||gE(),mp.has(n))return mp.get(n);const e=100,t=Date.now(),i=iU(()=>{if(Date.now()-t>=e)return!0;{const r=n.renderer.value,s=(r==null?void 0:r.domElement)||{width:0,height:0};return!!(r&&s.width>0&&s.height>0)}},n);return mp.set(n,i),i}function sU({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:r}){const s=Ie(n),o=eU(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:f}=W3({sizes:o}),h={mode:Ze(i.renderMode||"always"),priority:Ze(0),frames:Ze(0),maxFrames:60,canBeInvalidated:Se(()=>h.mode.value==="on-demand"&&h.frames.value===0)};function d(H=1){i.renderMode==="on-demand"&&(h.frames.value=Math.min(h.maxFrames,h.frames.value+H))}function p(){i.renderMode==="manual"&&(h.frames.value=1)}const{renderer:_}=Q3({canvas:e,options:i,contextParts:{sizes:o,render:h,invalidate:d,advance:p}}),g={sizes:o,scene:s,camera:a,cameras:di(l),renderer:_,raycaster:Ie(new KM),controls:Ze(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:h,advance:p,extend:dm,invalidate:d,registerCamera:c,setCameraActive:f,deregisterCamera:u,loop:j3()};es("useTres",g),g.scene.value.__tres={root:g},g.loop.register(()=>{a.value&&h.frames.value>0&&(_.value.render(n,a.value),r("render",g.renderer.value)),h.priority.value=0,h.mode.value==="always"?h.frames.value=1:h.frames.value=Math.max(0,h.frames.value-1)},"render");const{on:m,cancel:y}=rU(g);g.loop.setReady(!1),g.loop.start(),m(()=>{r("ready",g),g.loop.setReady(!0),nU(n,g,r)}),$i(()=>{y(),g.loop.stop()});const x=100,v=qN({every:x}),{isSupported:E,memory:T}=YN({interval:x}),M=160;let P=performance.now();const b=({timestamp:H})=>{g.scene.value&&(g.perf.memory.allocatedMem=n_(g.scene.value)),H-P>=x&&(P=H,g.perf.fps.accumulator.push(v.value),g.perf.fps.accumulator.length>M&&g.perf.fps.accumulator.shift(),g.perf.fps.value=v.value,E.value&&T.value&&(g.perf.memory.accumulator.push(T.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>M&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce(($,ee)=>$+ee,0)/g.perf.memory.accumulator.length))};let S=0;const D=1,{pause:B}=t_(({delta:H})=>{window.__TRES__DEVTOOLS__&&(b({timestamp:performance.now()}),S+=H,S>=D&&(window.__TRES__DEVTOOLS__.cb(g),S=0))},{immediate:!0});return $i(()=>{B()}),g}function gE(){const n=gn("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}function j4(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:r,controls:s,invalidate:o,advance:a}=gE();i.setContext({camera:n,scene:e,renderer:t,raycaster:r,controls:s,invalidate:o,advance:a});function l(f,h=0){return i.register(f,"before",h)}function c(f){return i.register(f,"render")}function u(f,h=0){return i.register(f,"after",h)}return{pause:i.pause,resume:i.resume,pauseRender:i.pauseRender,resumeRender:i.resumeRender,isActive:i.isActive,onBeforeRender:l,render:c,onAfterRender:u}}const oU=oi(),aU=oi(),_E=oi(),cl=new Qh;let qu=0,Yu=0;t_(()=>{oU.trigger({delta:qu,elapsed:Yu,clock:cl}),aU.trigger({delta:qu,elapsed:Yu,clock:cl}),_E.trigger({delta:qu,elapsed:Yu,clock:cl})},{immediate:!1});_E.on(()=>{qu=cl.getDelta(),Yu=cl.getElapsedTime()});function lU(n,e={},t={}){let i=n;const r=a=>{i=a};let s=new Proxy({},{});const o={has(a,l){return l in e||l in i},get(a,l,c){return l in e?e[l](i):i[l]},set(a,l,c){const u=t[l];return u&&typeof u=="function"?u(c,i,s,r):i[l]=c,!0}};return s=new Proxy({},o),s}const{logError:uy}=mE(),fy=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],cU=n=>{const e=n.scene.value;function t(c,u,f,h){if(h||(h={}),h.args||(h.args=[]),c==="template"||P3(c))return null;let d=c.replace("Tres",""),p;if(c==="primitive"){(!Ir(h.object)||wt(h.object))&&uy("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),d=h.object.type;const _={};p=lU(h.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,m,y,x)=>{G3(g,y,x,{patchProp:s,remove:r,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=hm.value[d];_||uy(`${d} is not defined on the THREE namespace. Use extend to add it to the catalog.`),p=new _(...h.args)}return p?(p.isCamera&&(h!=null&&h.position||p.position.set(3,3,3),h!=null&&h.lookAt||p.lookAt(0,0,0)),p=Hs(p,{...p.__tres,type:d,memoizedProps:h,eventCount:0,primitive:c==="primitive",attach:h.attach},n),p):null}function i(c,u){var f,h,d;if(!c)return;u=u||e;const p=c.__tres?c:Hs(c,{},n),_=u.__tres?u:Hs(u,{},n);c=ua(p),u=ua(_),c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((h=n.eventManager)==null||h.registerObject(c)),n.registerCamera(c),(d=n.eventManager)==null||d.registerPointerMissedObject(c),p.__tres.attach?V3(_,p,p.__tres.attach):Jr(c)&&Jr(_)&&(_.add(c),c.dispatchEvent({type:"added"})),p.__tres.parent=_,_.__tres.objects&&!_.__tres.objects.includes(p)&&_.__tres.objects.push(p)}function r(c,u){var f,h,d,p;if(!c)return;c!=null&&c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((h=n.eventManager)==null||h.deregisterObject(c)),u=um(u)?"default":u;const _=(d=c.__tres)==null?void 0:d.dispose;um(_)||(_===null?u=!1:u=_);const g=(p=c.__tres)==null?void 0:p.primitive,m=u==="default"?!g:!!u;if(c.__tres&&"objects"in c.__tres&&[...c.__tres.objects].forEach(y=>r(y,u)),m&&c.children&&[...c.children].forEach(y=>r(y,u)),dE(c,n),pE(c,n),m&&!A3(c)){if(Xs(u))u(c);else if(Xs(c.dispose))try{c.dispose()}catch{}}"__tres"in c&&delete c.__tres}function s(c,u,f,h){var d,p;if(!c)return;let _=c,g=u;if(c.__tres&&(c.__tres.memoizedProps[u]=h),u==="attach"){const v=((d=c.__tres)==null?void 0:d.parent)||c.parent;r(c),Hs(c,{attach:h},n),v&&i(c,v);return}if(u==="dispose"){c.__tres||(c=Hs(c,{},n)),c.__tres.dispose=h;return}if(Jr(c)&&g==="blocks-pointer-events"){h||h===""?c[g]=h:delete c[g];return}fy.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let m=wu(g),y=_==null?void 0:_[m];if(g==="args"){const v=c,E=f??[],T=h??[],M=((p=c.__tres)==null?void 0:p.type)||c.type;M&&E.length&&!N3(E,T)&&(_=Object.assign(v,new hm.value[M](...h)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(wu(g),new Et(...h));return}if(g.includes("-")&&y===void 0){const v=g.split("-");y=v.reduce((E,T)=>E[wu(T)],_),g=v.pop(),m=g,y!=null&&y.set||(_=v.reduce((E,T)=>E[wu(T)],_))}let x=h;if(x===""&&(x=!0),Xs(y)){fy.includes(u)||(jf(x)?c[m](...x):c[m](x)),m.startsWith("on")&&Xs(x)&&(_[m]=x);return}!(y!=null&&y.set)&&!Xs(y)?_[m]=x:y.constructor===x.constructor&&y!=null&&y.copy?y==null||y.copy(x):jf(x)?y.set(...x):!y.isColor&&y.setScalar?y.setScalar(x):y.set(x),hE(c)}function o(c){var u;return((u=c==null?void 0:c.__tres)==null?void 0:u.parent)||null}function a(c){const u=Hs(new ct,{type:"Comment"},n);return u.name=c,u}function l(c){var u;const f=o(c),h=((u=f==null?void 0:f.__tres)==null?void 0:u.objects)||[],d=h.indexOf(c);return d<0||d>=h.length-1?null:h[d+1]}return{insert:i,remove:r,createElement:t,patchProp:s,parentNode:o,createText:()=>{},createComment:a,setText:()=>{},setElementText:()=>{},nextSibling:l,querySelector:()=>{},setScopeId:()=>{},cloneNode:()=>{},insertStaticContent:()=>{}}};function uU(){return vE().__VUE_DEVTOOLS_GLOBAL_HOOK__}function vE(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const fU=typeof Proxy=="function",hU="devtools-plugin:setup",dU="plugin:settings:set";let ka,pm;function pU(){var n;return ka!==void 0||(typeof window<"u"&&window.performance?(ka=!0,pm=window.performance):typeof globalThis<"u"&&!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance?(ka=!0,pm=globalThis.perf_hooks.performance):ka=!1),ka}function mU(){return pU()?pm.now():Date.now()}class gU{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const i={};if(e.settings)for(const o in e.settings){const a=e.settings[o];i[o]=a.defaultValue}const r=`__vue-devtools-plugin-settings__${e.id}`;let s=Object.assign({},i);try{const o=localStorage.getItem(r),a=JSON.parse(o);Object.assign(s,a)}catch{}this.fallbacks={getSettings(){return s},setSettings(o){try{localStorage.setItem(r,JSON.stringify(o))}catch{}s=o},now(){return mU()}},t&&t.on(dU,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function _U(n,e){const t=n,i=vE(),r=uU(),s=fU&&t.enableEarlyProxy;if(r&&(i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))r.emit(hU,n,e);else{const o=s?new gU(t,r):null;(i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}function vU(n,e){const t=`▲ ■ ●${n}`;typeof hy=="function"?hy(t,e):console.log(t)}function hy(n,e){throw new Error(n+e)}const yE=n=>{const e={id:n.uuid,label:n.type,children:[],tags:[]};n.name!==""&&e.tags.push({label:n.name,textColor:5750629,backgroundColor:15793395});const t=n_(n);return t>0&&e.tags.push({label:`${K3(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(T3(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new we(n.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),n.type.includes("Camera")&&(e.tags.push({label:`${n.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(n.position.x)} y: ${Math.round(n.position.y)} z: ${Math.round(n.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function xE(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const r=yE(i);e.children.push(r),xE(i,r,t)})}const yU=[],Va="tres:inspector",xU=hi({sceneGraph:null});function bU(n,e){_U({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:yU,app:n},t=>{typeof t.now!="function"&&vU("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),t.addInspector({id:Va,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(Va)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(s=>{if(s.inspectorId===Va){const o=yE(e.scene.value);xE(e.scene.value,o,s.filter),xU.sceneGraph=o,s.rootNodes=[o]}});let i=null,r=null;t.on.getInspectorState(s=>{var o;if(s.inspectorId===Va){const[a]=e.scene.value.getObjectsByProperty("uuid",s.nodeId);if(!a)return;if(r&&i&&i.parent&&r.remove(i),a.isMesh){const l=F3(a);a.add(l),i=l,r=a}s.state={object:Object.entries(a).map(([l,c])=>l==="children"?{key:l,value:c.filter(u=>u.type!=="HightlightMesh")}:{key:l,value:c,editable:!0}).filter(({key:l})=>l!=="parent")},a.isScene&&(s.state={...s.state,state:[{key:"Scene Info",value:{objects:a.children.length,memory:n_(a),calls:e.renderer.value.info.render.calls,triangles:e.renderer.value.info.render.triangles,points:e.renderer.value.info.render.points,lines:e.renderer.value.info.render.lines}},{key:"Programs",value:((o=e.renderer.value.info.programs)==null?void 0:o.map(l=>({...l,programName:l.name})))||[]}]})}}),t.on.editInspectorState(s=>{s.inspectorId===Va&&U3(e.scene.value,s.nodeId,s.path,s.state.value)})})}const SU=["data-scene","data-tres"],MU=rn({__name:"TresCanvas",props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:"always"},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:["render","click","double-click","context-menu","pointer-move","pointer-up","pointer-down","pointer-enter","pointer-leave","pointer-over","pointer-out","pointer-missed","wheel","ready"],setup(n,{expose:e,emit:t}){const i=n,r=t,s=rg(),o=Ze(),a=Ie(new Dh),l=vn();dm(wN);const c=(p,_=!1)=>rn({setup(){var g;const m=(g=vn())==null?void 0:g.appContext;m&&(m.app=l==null?void 0:l.appContext.app);const y={};function x(v){v&&(v.parent&&x(v.parent),v.provides&&Object.assign(y,v.provides))}return l!=null&&l.parent&&i.enableProvideBridge&&(x(l.parent),Reflect.ownKeys(y).forEach(v=>{es(v,y[v])})),es("useTres",p),es("extend",dm),typeof window<"u"&&bU(m==null?void 0:m.app,p),()=>Sr(Xt,null,_?[]:s.default())}}),u=(p,_=!1)=>{const g=c(p,_),{render:m}=Vb(cU(p));m(Sr(g),a.value)},f=(p,_=!1)=>{fE(p.scene.value),_&&(p.renderer.value.dispose(),p.renderer.value.renderLists.dispose(),p.renderer.value.forceContextLoss()),a.value.__tres={root:p}},h=Ie(null);e({context:h,dispose:()=>f(h.value,!0)});const d=()=>{f(h.value),u(h.value,!0)};return yn(()=>{const p=o;h.value=sU({scene:a.value,canvas:p,windowSize:i.windowSize??!1,rendererOptions:i,emit:r});const{registerCamera:_,camera:g,cameras:m,deregisterCamera:y}=h.value;u(h.value);const x=()=>{const v=new $t(45,window.innerWidth/window.innerHeight,.1,1e3);v.position.set(3,3,3),v.lookAt(0,0,0),_(v);const E=rc(()=>{m.value.length>=2&&(v.removeFromParent(),y(v),E==null||E())})};Ge(()=>i.camera,(v,E)=>{v&&_(v),E&&(E.removeFromParent(),y(E))},{immediate:!0}),g.value||x()}),$i(d),(p,_)=>(ln(),ui("canvas",{ref_key:"canvas",ref:o,"data-scene":a.value.uuid,class:ga(p.$attrs.class),"data-tres":`tresjs ${It(x3).version}`,style:mi({display:"block",width:"100%",height:"100%",position:p.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,SU))}}),EU={install(n){n.component("TresCanvas",MU)}};function gp(n){if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in n?!1:Symbol.toStringTag in n?Object.prototype.toString.call(n)==="[object Module]":!0}function mm(n,e,t=".",i){if(!gp(e))return mm(n,{},t,i);const r=Object.assign({},e);for(const s in n){if(s==="__proto__"||s==="constructor")continue;const o=n[s];o!=null&&(i&&i(r,s,o,t)||(Array.isArray(o)&&Array.isArray(r[s])?r[s]=[...o,...r[s]]:gp(o)&&gp(r[s])?r[s]=mm(o,r[s],(t?`${t}.`:"")+s.toString(),i):r[s]=o))}return r}function TU(n){return(...e)=>e.reduce((t,i)=>mm(t,i,"",n),{})}const bE=TU();function ds(n){return lh()?(Ym(n),!0):!1}function dy(){const n=new Set,e=s=>{n.delete(s)};return{on:s=>{n.add(s);const o=()=>e(s);return ds(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(n).map(o=>o(...s))),clear:()=>{n.clear()}}}const _p=new WeakMap,wU=(...n)=>{var e;const t=n[0],i=(e=vn())==null?void 0:e.proxy;if(i==null&&!ic())throw new Error("injectLocal must be called in setup");return i&&_p.has(i)&&t in _p.get(i)?_p.get(i)[t]:gn(...n)},xc=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const SE=n=>n!=null,AU=Object.prototype.toString,Zf=n=>AU.call(n)==="[object Object]",Xi=()=>{},CU=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function ME(...n){if(n.length!==1)return sb(...n);const e=n[0];return typeof e=="function"?di(eg(()=>({get:e,set:Xi}))):Ze(e)}function i_(n,e){function t(...i){return new Promise((r,s)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(s)})}return t}const EE=n=>n();function TE(n,e={}){let t,i,r=Xi;const s=l=>{clearTimeout(l),r(),r=Xi};let o;return l=>{const c=et(n),u=et(e.maxWait);return t&&s(t),c<=0||u!==void 0&&u<=0?(i&&(s(i),i=null),Promise.resolve(l())):new Promise((f,h)=>{r=e.rejectOnCancel?h:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&s(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&s(i),i=null,f(l())},c)})}}function RU(...n){let e=0,t,i=!0,r=Xi,s,o,a,l,c;!wt(n[0])&&typeof n[0]=="object"?{delay:o,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=n[0]:[o,a=!0,l=!0,c=!1]=n;const u=()=>{t&&(clearTimeout(t),t=void 0,r(),r=Xi)};return h=>{const d=et(o),p=Date.now()-e,_=()=>s=h();return u(),d<=0?(e=Date.now(),_()):(p>d&&(l||!i)?(e=Date.now(),_()):a&&(s=new Promise((g,m)=>{r=c?m:g,t=setTimeout(()=>{e=Date.now(),i=!0,g(_()),u()},Math.max(0,d-p))})),!l&&!t&&(t=setTimeout(()=>i=!0,d)),i=!1,s)}}function PU(n=EE,e={}){const{initialState:t="active"}=e,i=ME(t==="active");function r(){i.value=!1}function s(){i.value=!0}const o=(...a)=>{i.value&&n(...a)};return{isActive:di(i),pause:r,resume:s,eventFilter:o}}function IU(n){let e;function t(){return e||(e=n()),e}return t.reset=async()=>{const i=e;e=void 0,i&&await i},t}function LU(n,e){var t;if(typeof n=="number")return n+e;const i=((t=n.match(/^-?\d+\.?\d*/))==null?void 0:t[0])||"",r=n.slice(i.length),s=Number.parseFloat(i)+e;return Number.isNaN(s)?n:s+r}function ul(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function fl(n){return Array.isArray(n)?n:[n]}function wE(n){return vn()}function AE(n,e=200,t={}){return i_(TE(e,t),n)}function DU(n,e=200,t=!1,i=!0,r=!1){return i_(RU(e,t,i,r),n)}function CE(n,e,t={}){const{eventFilter:i=EE,...r}=t;return Ge(n,i_(i,e),r)}function OU(n,e,t={}){const{eventFilter:i,initialState:r="active",...s}=t,{eventFilter:o,pause:a,resume:l,isActive:c}=PU(i,{initialState:r});return{stop:CE(n,e,{...s,eventFilter:o}),pause:a,resume:l,isActive:c}}function Ma(n,e=!0,t){wE()?yn(n,t):e?n():cs(n)}function NU(n,e){wE()&&$i(n,e)}function UU(n,e,t={}){const{immediate:i=!0,immediateCallback:r=!1}=t,s=Ie(!1);let o=null;function a(){o&&(clearTimeout(o),o=null)}function l(){s.value=!1,a()}function c(...u){r&&n(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=null,n(...u)},et(e))}return i&&(s.value=!0,xc&&c()),ds(l),{isPending:di(s),start:c,stop:l}}function K4(n,e,t={}){const{debounce:i=0,maxWait:r=void 0,...s}=t;return CE(n,e,{...s,eventFilter:TE(i,{maxWait:r})})}function FU(n,e,t){return Ge(n,e,{...t,immediate:!0})}const Xn=xc?window:void 0,BU=xc?window.document:void 0,r_=xc?window.navigator:void 0;function Jn(n){var e;const t=et(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Dt(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),r=Se(()=>{const a=fl(et(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),s=FU(()=>{var a,l;return[(l=(a=r.value)==null?void 0:a.map(c=>Jn(c)))!=null?l:[Xn].filter(c=>c!=null),fl(et(r.value?n[1]:n[0])),fl(It(r.value?n[2]:n[1])),et(r.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=Zf(u)?{...u}:u;e.push(...a.flatMap(h=>l.flatMap(d=>c.map(p=>i(h,d,p,f)))))},{flush:"post"}),o=()=>{s(),t()};return ds(t),o}function kU(){const n=Ie(!1),e=vn();return e&&yn(()=>{n.value=!0},e),n}function vo(n){const e=kU();return Se(()=>(e.value,!!n()))}function RE(n,e,t={}){const{window:i=Xn,...r}=t;let s;const o=vo(()=>i&&"MutationObserver"in i),a=()=>{s&&(s.disconnect(),s=void 0)},l=Se(()=>{const h=et(n),d=fl(h).map(Jn).filter(SE);return new Set(d)}),c=Ge(()=>l.value,h=>{a(),o.value&&h.size&&(s=new MutationObserver(e),h.forEach(d=>s.observe(d,r)))},{immediate:!0,flush:"post"}),u=()=>s==null?void 0:s.takeRecords(),f=()=>{c(),a()};return ds(f),{isSupported:o,stop:f,takeRecords:u}}const VU=Symbol("vueuse-ssr-width");function PE(){const n=ic()?wU(VU,null):null;return typeof n=="number"?n:void 0}function $s(n,e={}){const{window:t=Xn,ssrWidth:i=PE()}=e,r=vo(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),s=Ie(typeof i=="number"),o=Ie(),a=Ie(!1),l=c=>{a.value=c.matches};return rc(()=>{if(s.value){s.value=!r.value;const c=et(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),h=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),d=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(h||d);return h&&p&&(p=i>=ul(h[1])),d&&p&&(p=i<=ul(d[1])),f?!p:p});return}r.value&&(o.value=t.matchMedia(et(n)),a.value=o.value.matches)}),Dt(o,"change",l,{passive:!0}),Se(()=>a.value)}const Z4={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function J4(n,e={}){function t(d,p){let _=et(n[et(d)]);return p!=null&&(_=LU(_,p)),typeof _=="number"&&(_=`${_}px`),_}const{window:i=Xn,strategy:r="min-width",ssrWidth:s=PE()}=e,o=typeof s=="number",a=o?Ie(!1):{value:!0};o&&Ma(()=>a.value=!!i);function l(d,p){return!a.value&&o?d==="min"?s>=ul(p):s<=ul(p):i?i.matchMedia(`(${d}-width: ${p})`).matches:!1}const c=d=>$s(()=>`(min-width: ${t(d)})`,e),u=d=>$s(()=>`(max-width: ${t(d)})`,e),f=Object.keys(n).reduce((d,p)=>(Object.defineProperty(d,p,{get:()=>r==="min-width"?c(p):u(p),enumerable:!0,configurable:!0}),d),{});function h(){const d=Object.keys(n).map(p=>[p,f[p],ul(t(p))]).sort((p,_)=>p[2]-_[2]);return Se(()=>d.filter(([,p])=>p.value).map(([p])=>p))}return Object.assign(f,{greaterOrEqual:c,smallerOrEqual:u,greater(d){return $s(()=>`(min-width: ${t(d,.1)})`,e)},smaller(d){return $s(()=>`(max-width: ${t(d,-.1)})`,e)},between(d,p){return $s(()=>`(min-width: ${t(d)}) and (max-width: ${t(p,-.1)})`,e)},isGreater(d){return l("min",t(d,.1))},isGreaterOrEqual(d){return l("min",t(d))},isSmaller(d){return l("max",t(d,-.1))},isSmallerOrEqual(d){return l("max",t(d))},isInBetween(d,p){return l("min",t(d))&&l("max",t(p,-.1))},current:h,active(){const d=h();return Se(()=>d.value.length===0?"":d.value.at(r==="min-width"?-1:0))}})}function gm(n,e={}){const{controls:t=!1,navigator:i=r_}=e,r=vo(()=>i&&"permissions"in i),s=Ie(),o=typeof n=="string"?{name:n}:n,a=Ie(),l=()=>{var u,f;a.value=(f=(u=s.value)==null?void 0:u.state)!=null?f:"prompt"};Dt(s,"change",l,{passive:!0});const c=IU(async()=>{if(r.value){if(!s.value)try{s.value=await i.permissions.query(o)}catch{s.value=void 0}finally{l()}if(t)return ot(s.value)}});return c(),t?{state:a,isSupported:r,query:c}:a}function Q4(n={}){const{navigator:e=r_,read:t=!1,source:i,copiedDuring:r=1500,legacy:s=!1}=n,o=vo(()=>e&&"clipboard"in e),a=gm("clipboard-read"),l=gm("clipboard-write"),c=Se(()=>o.value||s),u=Ie(""),f=Ie(!1),h=UU(()=>f.value=!1,r,{immediate:!1});async function d(){let y=!(o.value&&m(a.value));if(!y)try{u.value=await e.clipboard.readText()}catch{y=!0}y&&(u.value=g())}c.value&&t&&Dt(["copy","cut"],d,{passive:!0});async function p(y=et(i)){if(c.value&&y!=null){let x=!(o.value&&m(l.value));if(!x)try{await e.clipboard.writeText(y)}catch{x=!0}x&&_(y),u.value=y,f.value=!0,h.start()}}function _(y){const x=document.createElement("textarea");x.value=y??"",x.style.position="absolute",x.style.opacity="0",document.body.appendChild(x),x.select(),document.execCommand("copy"),x.remove()}function g(){var y,x,v;return(v=(x=(y=document==null?void 0:document.getSelection)==null?void 0:y.call(document))==null?void 0:x.toString())!=null?v:""}function m(y){return y==="granted"||y==="prompt"}return{isSupported:c,text:u,copied:f,copy:p}}const Cu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ru="__vueuse_ssr_handlers__",zU=HU();function HU(){return Ru in Cu||(Cu[Ru]=Cu[Ru]||{}),Cu[Ru]}function IE(n,e){return zU[n]||e}function GU(n){return $s("(prefers-color-scheme: dark)",n)}function WU(n){return n==null?"any":n instanceof Set?"set":n instanceof Map?"map":n instanceof Date?"date":typeof n=="boolean"?"boolean":typeof n=="string"?"string":typeof n=="object"?"object":Number.isNaN(n)?"any":"number"}const XU={boolean:{read:n=>n==="true",write:n=>String(n)},object:{read:n=>JSON.parse(n),write:n=>JSON.stringify(n)},number:{read:n=>Number.parseFloat(n),write:n=>String(n)},any:{read:n=>n,write:n=>String(n)},string:{read:n=>n,write:n=>String(n)},map:{read:n=>new Map(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n.entries()))},set:{read:n=>new Set(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n))},date:{read:n=>new Date(n),write:n=>n.toISOString()}},py="vueuse-storage";function LE(n,e,t,i={}){var r;const{flush:s="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:l=!0,mergeDefaults:c=!1,shallow:u,window:f=Xn,eventFilter:h,onError:d=D=>{console.error(D)},initOnMounted:p}=i,_=(u?Ie:Ze)(typeof e=="function"?e():e),g=Se(()=>et(n));if(!t)try{t=IE("getDefaultStorage",()=>{var D;return(D=Xn)==null?void 0:D.localStorage})()}catch(D){d(D)}if(!t)return _;const m=et(e),y=WU(m),x=(r=i.serializer)!=null?r:XU[y],{pause:v,resume:E}=OU(_,()=>M(_.value),{flush:s,deep:o,eventFilter:h});Ge(g,()=>b(),{flush:s}),f&&a&&Ma(()=>{t instanceof Storage?Dt(f,"storage",b,{passive:!0}):Dt(f,py,S),p&&b()}),p||b();function T(D,B){if(f){const H={key:g.value,oldValue:D,newValue:B,storageArea:t};f.dispatchEvent(t instanceof Storage?new StorageEvent("storage",H):new CustomEvent(py,{detail:H}))}}function M(D){try{const B=t.getItem(g.value);if(D==null)T(B,null),t.removeItem(g.value);else{const H=x.write(D);B!==H&&(t.setItem(g.value,H),T(B,H))}}catch(B){d(B)}}function P(D){const B=D?D.newValue:t.getItem(g.value);if(B==null)return l&&m!=null&&t.setItem(g.value,x.write(m)),m;if(!D&&c){const H=x.read(B);return typeof c=="function"?c(H,m):y==="object"&&!Array.isArray(H)?{...m,...H}:H}else return typeof B!="string"?B:x.read(B)}function b(D){if(!(D&&D.storageArea!==t)){if(D&&D.key==null){_.value=m;return}if(!(D&&D.key!==g.value)){v();try{(D==null?void 0:D.newValue)!==x.write(_.value)&&(_.value=P(D))}catch(B){d(B)}finally{D?cs(E):E()}}}}function S(D){b(D.detail)}return _}const $U="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function qU(n={}){const{selector:e="html",attribute:t="class",initialValue:i="auto",window:r=Xn,storage:s,storageKey:o="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:l,emitAuto:c,disableTransition:u=!0}=n,f={auto:"",light:"light",dark:"dark",...n.modes||{}},h=GU({window:r}),d=Se(()=>h.value?"dark":"light"),p=l||(o==null?ME(i):LE(o,i,s,{window:r,listenToStorageChanges:a})),_=Se(()=>p.value==="auto"?d.value:p.value),g=IE("updateHTMLAttrs",(v,E,T)=>{const M=typeof v=="string"?r==null?void 0:r.document.querySelector(v):Jn(v);if(!M)return;const P=new Set,b=new Set;let S=null;if(E==="class"){const B=T.split(/\s/g);Object.values(f).flatMap(H=>(H||"").split(/\s/g)).filter(Boolean).forEach(H=>{B.includes(H)?P.add(H):b.add(H)})}else S={key:E,value:T};if(P.size===0&&b.size===0&&S===null)return;let D;u&&(D=r.document.createElement("style"),D.appendChild(document.createTextNode($U)),r.document.head.appendChild(D));for(const B of P)M.classList.add(B);for(const B of b)M.classList.remove(B);S&&M.setAttribute(S.key,S.value),u&&(r.getComputedStyle(D).opacity,document.head.removeChild(D))});function m(v){var E;g(e,t,(E=f[v])!=null?E:v)}function y(v){n.onChanged?n.onChanged(v,m):m(v)}Ge(_,y,{flush:"post",immediate:!0}),Ma(()=>y(_.value));const x=Se({get(){return c?p.value:_.value},set(v){p.value=v}});return Object.assign(x,{store:p,system:d,state:_})}function Pu(n,e,t={}){const{window:i=Xn,initialValue:r,observe:s=!1}=t,o=Ie(r),a=Se(()=>{var c;return Jn(e)||((c=i==null?void 0:i.document)==null?void 0:c.documentElement)});function l(){var c;const u=et(n),f=et(a);if(f&&i&&u){const h=(c=i.getComputedStyle(f).getPropertyValue(u))==null?void 0:c.trim();o.value=h||o.value||r}}return s&&RE(a,l,{attributeFilter:["style","class"],window:i}),Ge([a,()=>et(n)],(c,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),l()},{immediate:!0}),Ge([o,a],([c,u])=>{const f=et(n);u!=null&&u.style&&f&&(c==null?u.style.removeProperty(f):u.style.setProperty(f,c))},{immediate:!0}),o}function YU(n={}){const{valueDark:e="dark",valueLight:t=""}=n,i=qU({...n,onChanged:(o,a)=>{var l;n.onChanged?(l=n.onChanged)==null||l.call(n,o==="dark",a,o):a(o)},modes:{dark:e,light:t}}),r=Se(()=>i.system.value);return Se({get(){return i.value==="dark"},set(o){const a=o?"dark":"light";r.value===a?i.value="auto":i.value=a}})}function jU(n={}){const{navigator:e=r_,requestPermissions:t=!1,constraints:i={audio:!0,video:!0},onUpdated:r}=n,s=Ze([]),o=Se(()=>s.value.filter(p=>p.kind==="videoinput")),a=Se(()=>s.value.filter(p=>p.kind==="audioinput")),l=Se(()=>s.value.filter(p=>p.kind==="audiooutput")),c=vo(()=>e&&e.mediaDevices&&e.mediaDevices.enumerateDevices),u=Ie(!1);let f;async function h(){c.value&&(s.value=await e.mediaDevices.enumerateDevices(),r==null||r(s.value),f&&(f.getTracks().forEach(p=>p.stop()),f=null))}async function d(){const p=i.video?"camera":"microphone";if(!c.value)return!1;if(u.value)return!0;const{state:_,query:g}=gm(p,{controls:!0});if(await g(),_.value!=="granted"){let m=!0;try{f=await e.mediaDevices.getUserMedia(i)}catch{f=null,m=!1}h(),u.value=m}else u.value=!0;return u.value}return c.value&&(t&&d(),Dt(e.mediaDevices,"devicechange",h,{passive:!0}),h()),{devices:s,ensurePermissions:d,permissionGranted:u,videoInputs:o,audioInputs:a,audioOutputs:l,isSupported:c}}function KU(n,e,t={}){const{window:i=Xn,...r}=t;let s;const o=vo(()=>i&&"ResizeObserver"in i),a=()=>{s&&(s.disconnect(),s=void 0)},l=Se(()=>{const f=et(n);return Array.isArray(f)?f.map(h=>Jn(h)):[Jn(f)]}),c=Ge(l,f=>{if(a(),o.value&&i){s=new ResizeObserver(e);for(const h of f)h&&s.observe(h,r)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return ds(u),{isSupported:o,stop:u}}function eG(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:o="sync"}=e,a=Ie(0),l=Ie(0),c=Ie(0),u=Ie(0),f=Ie(0),h=Ie(0),d=Ie(0),p=Ie(0);function _(){const m=Jn(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,h.value=0,d.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,h.value=y.width,d.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return KU(n,g),Ge(()=>Jn(n),m=>!m&&g()),RE(n,g,{attributeFilter:["style","class"]}),r&&Dt("scroll",g,{capture:!0,passive:!0}),i&&Dt("resize",g,{passive:!0}),Ma(()=>{s&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:p,update:g}}function ZU(n,e,t={}){const{root:i,rootMargin:r="0px",threshold:s=0,window:o=Xn,immediate:a=!0}=t,l=vo(()=>o&&"IntersectionObserver"in o),c=Se(()=>{const p=et(n);return fl(p).map(Jn).filter(SE)});let u=Xi;const f=Ie(a),h=l.value?Ge(()=>[c.value,Jn(i),f.value],([p,_])=>{if(u(),!f.value||!p.length)return;const g=new IntersectionObserver(e,{root:Jn(_),rootMargin:r,threshold:s});p.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=Xi}},{immediate:a,flush:"post"}):Xi,d=()=>{u(),h(),f.value=!1};return ds(d),{isSupported:l,isActive:f,pause(){u(),f.value=!1},resume(){f.value=!0},stop:d}}const JU={multiple:!0,accept:"*",reset:!1,directory:!1};function QU(n){if(!n)return null;if(n instanceof FileList)return n;const e=new DataTransfer;for(const t of n)e.items.add(t);return e.files}function tG(n={}){const{document:e=BU}=n,t=Ze(QU(n.initialFiles)),{on:i,trigger:r}=dy(),{on:s,trigger:o}=dy();let a;e&&(a=e.createElement("input"),a.type="file",a.onchange=u=>{const f=u.target;t.value=f.files,r(t.value)},a.oncancel=()=>{o()});const l=()=>{t.value=null,a&&a.value&&(a.value="",r(null))},c=u=>{if(!a)return;const f={...JU,...n,...u};a.multiple=f.multiple,a.accept=f.accept,a.webkitdirectory=f.directory,CU(f,"capture")&&(a.capture=f.capture),f.reset&&l(),a.click()};return{files:di(t),open:c,reset:l,onCancel:s,onChange:i}}const my=1;function nG(n,e={}){const{throttle:t=0,idle:i=200,onStop:r=Xi,onScroll:s=Xi,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:a={capture:!1,passive:!0},behavior:l="auto",window:c=Xn,onError:u=M=>{console.error(M)}}=e,f=Ie(0),h=Ie(0),d=Se({get(){return f.value},set(M){_(M,void 0)}}),p=Se({get(){return h.value},set(M){_(void 0,M)}});function _(M,P){var b,S,D,B;if(!c)return;const H=et(n);if(!H)return;(D=H instanceof Document?c.document.body:H)==null||D.scrollTo({top:(b=et(P))!=null?b:p.value,left:(S=et(M))!=null?S:d.value,behavior:et(l)});const $=((B=H==null?void 0:H.document)==null?void 0:B.documentElement)||(H==null?void 0:H.documentElement)||H;d!=null&&(f.value=$.scrollLeft),p!=null&&(h.value=$.scrollTop)}const g=Ie(!1),m=hi({left:!0,right:!1,top:!0,bottom:!1}),y=hi({left:!1,right:!1,top:!1,bottom:!1}),x=M=>{g.value&&(g.value=!1,y.left=!1,y.right=!1,y.top=!1,y.bottom=!1,r(M))},v=AE(x,t+i),E=M=>{var P;if(!c)return;const b=((P=M==null?void 0:M.document)==null?void 0:P.documentElement)||(M==null?void 0:M.documentElement)||Jn(M),{display:S,flexDirection:D,direction:B}=getComputedStyle(b),H=B==="rtl"?-1:1,$=b.scrollLeft;y.left=$f.value;const ee=Math.abs($*H)<=(o.left||0),Z=Math.abs($*H)+b.clientWidth>=b.scrollWidth-(o.right||0)-my;S==="flex"&&D==="row-reverse"?(m.left=Z,m.right=ee):(m.left=ee,m.right=Z),f.value=$;let te=b.scrollTop;M===c.document&&!te&&(te=c.document.body.scrollTop),y.top=teh.value;const Q=Math.abs(te)<=(o.top||0),pe=Math.abs(te)+b.clientHeight>=b.scrollHeight-(o.bottom||0)-my;S==="flex"&&D==="column-reverse"?(m.top=pe,m.bottom=Q):(m.top=Q,m.bottom=pe),h.value=te},T=M=>{var P;if(!c)return;const b=(P=M.target.documentElement)!=null?P:M.target;E(b),g.value=!0,v(M),s(M)};return Dt(n,"scroll",t?DU(T,t,!0,!1):T,a),Ma(()=>{try{const M=et(n);if(!M)return;E(M)}catch(M){u(M)}}),Dt(n,"scrollend",x,a),{x:d,y:p,isScrolling:g,arrivedState:m,directions:y,measure(){const M=et(n);c&&M&&E(M)}}}function Vr(n,e,t={}){const{window:i=Xn}=t;return LE(n,e,i==null?void 0:i.localStorage,t)}function iG(n){const e=Ie(),t=()=>{e.value&&URL.revokeObjectURL(e.value),e.value=void 0};return Ge(()=>et(n),i=>{t(),i&&(e.value=URL.createObjectURL(i))},{immediate:!0}),ds(t),di(e)}const gy="--vueuse-safe-area-top",_y="--vueuse-safe-area-right",vy="--vueuse-safe-area-bottom",yy="--vueuse-safe-area-left";function rG(){const n=Ie(""),e=Ie(""),t=Ie(""),i=Ie("");if(xc){const s=Pu(gy),o=Pu(_y),a=Pu(vy),l=Pu(yy);s.value="env(safe-area-inset-top, 0px)",o.value="env(safe-area-inset-right, 0px)",a.value="env(safe-area-inset-bottom, 0px)",l.value="env(safe-area-inset-left, 0px)",r(),Dt("resize",AE(r),{passive:!0})}function r(){n.value=Iu(gy),e.value=Iu(_y),t.value=Iu(vy),i.value=Iu(yy)}return{top:n,right:e,bottom:t,left:i,update:r}}function Iu(n){return getComputedStyle(document.documentElement).getPropertyValue(n)}function sG(n,e,t){const{window:i=Xn}={},r=Ze(null),s=Ie(),o=(...l)=>{s.value&&s.value.postMessage(...l)},a=function(){s.value&&s.value.terminate()};return i&&(s.value=new Worker(n,e),s.value.onmessage=l=>{r.value=l.data},ds(()=>{s.value&&s.value.terminate()})),{data:r,post:o,terminate:a,worker:s}}function oG(n={}){const{window:e=Xn,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:s=!0,type:o="inner"}=n,a=Ie(t),l=Ie(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:h,scale:d}=e.visualViewport;a.value=Math.round(f*d),l.value=Math.round(h*d)}else s?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),Ma(c);const u={passive:!0};if(Dt("resize",c,u),e&&o==="visual"&&e.visualViewport&&Dt(e.visualViewport,"resize",c,u),r){const f=$s("(orientation: portrait)");Ge(f,()=>c())}return{width:a,height:l}}const DE=1/60*1e3,eF=typeof performance<"u"?()=>performance.now():()=>Date.now(),OE=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(eF()),DE);function tF(n){let e=[],t=[],i=0,r=!1,s=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const f=u&&r,h=f?e:t;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),f&&r&&(i=e.length)),l},cancel:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),o.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let c=0;c(n[e]=tF(()=>Yl=!0),n),{}),ym=bc.reduce((n,e)=>{const t=nd[e];return n[e]=(i,r=!1,s=!1)=>(Yl||sF(),t.schedule(i,r,s)),n},{}),iF=bc.reduce((n,e)=>(n[e]=nd[e].cancel,n),{});bc.reduce((n,e)=>(n[e]=()=>nd[e].process(ta),n),{});const rF=n=>nd[n].process(ta),NE=n=>{Yl=!1,ta.delta=_m?DE:Math.max(Math.min(n-ta.timestamp,nF),1),ta.timestamp=n,vm=!0,bc.forEach(rF),vm=!1,Yl&&(_m=!1,OE(NE))},sF=()=>{Yl=!0,_m=!0,vm||OE(NE)},UE=()=>ta;function FE(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);rMath.min(Math.max(t,n),e),by=.001,oF=.01,aF=10,lF=.05,cF=1;function uF({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s,o=1-e;o=xm(lF,cF,o),n=xm(oF,aF,n/1e3),o<1?(r=c=>{const u=c*o,f=u*n,h=u-t,d=bm(c,o),p=Math.exp(-f);return by-h/d*p},s=c=>{const f=c*o*n,h=f*t+t,d=Math.pow(o,2)*Math.pow(c,2)*n,p=Math.exp(-f),_=bm(Math.pow(c,2),o);return(-r(c)+by>0?-1:1)*((h-d)*p)/_}):(r=c=>{const u=Math.exp(-c*n),f=(c-t)*n+1;return-.001+u*f},s=c=>{const u=Math.exp(-c*n),f=(t-c)*(n*n);return u*f});const a=5/n,l=hF(r,s,a);if(n=n*1e3,isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const fF=12;function hF(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function mF(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!Sy(n,pF)&&Sy(n,dF)){const t=uF(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function s_(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:r}=n,s=FE(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:f,isResolvedFromDuration:h}=mF(s),d=My,p=My;function _(){const g=u?-(u/1e3):0,m=t-e,y=l/(2*Math.sqrt(a*c)),x=Math.sqrt(a/c)/1e3;if(r===void 0&&(r=Math.min(Math.abs(t-e)/100,.4)),y<1){const v=bm(x,y);d=E=>{const T=Math.exp(-y*x*E);return t-T*((g+y*x*m)/v*Math.sin(v*E)+m*Math.cos(v*E))},p=E=>{const T=Math.exp(-y*x*E);return y*x*T*(Math.sin(v*E)*(g+y*x*m)/v+m*Math.cos(v*E))-T*(Math.cos(v*E)*(g+y*x*m)-v*m*Math.sin(v*E))}}else if(y===1)d=v=>t-Math.exp(-x*v)*(m+(g+x*m)*v);else{const v=x*Math.sqrt(y*y-1);d=E=>{const T=Math.exp(-y*x*E),M=Math.min(v*E,300);return t-T*((g+y*x*m)*Math.sinh(M)+v*m*Math.cosh(M))/v}}}return _(),{next:g=>{const m=d(g);if(h)o.done=g>=f;else{const y=p(g)*1e3,x=Math.abs(y)<=i,v=Math.abs(t-m)<=r;o.done=x&&v}return o.value=o.done?t:m,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}s_.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const My=n=>0,BE=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},o_=(n,e,t)=>-t*n+t*e+n,kE=(n,e)=>t=>Math.max(Math.min(t,e),n),hl=n=>n%1?Number(n.toFixed(5)):n,jl=/(-)?([\d]*\.?[\d])+/g,Sm=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,gF=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Sc(n){return typeof n=="string"}const Mc={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},dl=Object.assign(Object.assign({},Mc),{transform:kE(0,1)}),Lu=Object.assign(Object.assign({},Mc),{default:1}),a_=n=>({test:e=>Sc(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Us=a_("deg"),pl=a_("%"),it=a_("px"),Ey=Object.assign(Object.assign({},pl),{parse:n=>pl.parse(n)/100,transform:n=>pl.transform(n*100)}),l_=(n,e)=>t=>!!(Sc(t)&&gF.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),VE=(n,e,t)=>i=>{if(!Sc(i))return i;const[r,s,o,a]=i.match(jl);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ks={test:l_("hsl","hue"),parse:VE("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+pl.transform(hl(e))+", "+pl.transform(hl(t))+", "+hl(dl.transform(i))+")"},_F=kE(0,255),vp=Object.assign(Object.assign({},Mc),{transform:n=>Math.round(_F(n))}),Qr={test:l_("rgb","red"),parse:VE("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+vp.transform(n)+", "+vp.transform(e)+", "+vp.transform(t)+", "+hl(dl.transform(i))+")"};function vF(n){let e="",t="",i="",r="";return n.length>5?(e=n.substr(1,2),t=n.substr(3,2),i=n.substr(5,2),r=n.substr(7,2)):(e=n.substr(1,1),t=n.substr(2,1),i=n.substr(3,1),r=n.substr(4,1),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Mm={test:l_("#"),parse:vF,transform:Qr.transform},kn={test:n=>Qr.test(n)||Mm.test(n)||Ks.test(n),parse:n=>Qr.test(n)?Qr.parse(n):Ks.test(n)?Ks.parse(n):Mm.parse(n),transform:n=>Sc(n)?n:n.hasOwnProperty("red")?Qr.transform(n):Ks.transform(n)},zE="${c}",HE="${n}";function yF(n){var e,t,i,r;return isNaN(n)&&Sc(n)&&((t=(e=n.match(jl))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((r=(i=n.match(Sm))===null||i===void 0?void 0:i.length)!==null&&r!==void 0?r:0)>0}function GE(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(Sm);i&&(t=i.length,n=n.replace(Sm,zE),e.push(...i.map(kn.parse)));const r=n.match(jl);return r&&(n=n.replace(jl,HE),e.push(...r.map(Mc.parse))),{values:e,numColors:t,tokenised:n}}function WE(n){return GE(n).values}function XE(n){const{values:e,numColors:t,tokenised:i}=GE(n),r=e.length;return s=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function bF(n){const e=WE(n);return XE(n)(e.map(xF))}const Ec={test:yF,parse:WE,createTransformer:XE,getAnimatableNone:bF},SF=new Set(["brightness","contrast","saturate","opacity"]);function MF(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(jl)||[];if(!i)return n;const r=t.replace(i,"");let s=SF.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const EF=/([a-z-]*)\(.*?\)/g,Em=Object.assign(Object.assign({},Ec),{getAnimatableNone:n=>{const e=n.match(EF);return e?e.map(MF).join(" "):n}});function yp(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function Ty({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=yp(l,a,n+1/3),s=yp(l,a,n),o=yp(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}const TF=(n,e,t)=>{const i=n*n,r=e*e;return Math.sqrt(Math.max(0,t*(r-i)+i))},wF=[Mm,Qr,Ks],wy=n=>wF.find(e=>e.test(n)),$E=(n,e)=>{let t=wy(n),i=wy(e),r=t.parse(n),s=i.parse(e);t===Ks&&(r=Ty(r),t=Qr),i===Ks&&(s=Ty(s),i=Qr);const o=Object.assign({},r);return a=>{for(const l in o)l!=="alpha"&&(o[l]=TF(r[l],s[l],a));return o.alpha=o_(r.alpha,s.alpha,a),t.transform(o)}},AF=n=>typeof n=="number",CF=(n,e)=>t=>e(n(t)),qE=(...n)=>n.reduce(CF);function YE(n,e){return AF(n)?t=>o_(n,e,t):kn.test(n)?$E(n,e):KE(n,e)}const jE=(n,e)=>{const t=[...n],i=t.length,r=n.map((s,o)=>YE(s,e[o]));return s=>{for(let o=0;o{const t=Object.assign(Object.assign({},n),e),i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=YE(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}};function Ay(n){const e=Ec.parse(n),t=e.length;let i=0,r=0,s=0;for(let o=0;o{const t=Ec.createTransformer(e),i=Ay(n),r=Ay(e);return i.numHSL===r.numHSL&&i.numRGB===r.numRGB&&i.numNumbers>=r.numNumbers?qE(jE(i.parsed,r.parsed),t):o=>`${o>0?e:n}`},PF=(n,e)=>t=>o_(n,e,t);function IF(n){if(typeof n=="number")return PF;if(typeof n=="string")return kn.test(n)?$E:KE;if(Array.isArray(n))return jE;if(typeof n=="object")return RF}function LF(n,e,t){const i=[],r=t||IF(n[0]),s=n.length-1;for(let o=0;ot(BE(n,e,i))}function OF(n,e){const t=n.length,i=t-1;return r=>{let s=0,o=!1;if(r<=n[0]?o=!0:r>=n[i]&&(s=i-1,o=!0),!o){let l=1;for(;lr||l===i);l++);s=l-1}const a=BE(n[s],n[s+1],r);return e[s](a)}}function ZE(n,e,{clamp:t=!0,ease:i,mixer:r}={}){const s=n.length;xy(s===e.length),xy(!i||!Array.isArray(i)||i.length===s-1),n[0]>n[s-1]&&(n=[].concat(n),e=[].concat(e),n.reverse(),e.reverse());const o=LF(e,i,r),a=s===2?DF(n,o):OF(n,o);return t?l=>a(xm(n[0],n[s-1],l)):a}const id=n=>e=>1-n(1-e),c_=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,NF=n=>e=>Math.pow(e,n),JE=n=>e=>e*e*((n+1)*e-n),UF=n=>{const e=JE(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},QE=1.525,FF=4/11,BF=8/11,kF=9/10,eT=n=>n,u_=NF(2),VF=id(u_),tT=c_(u_),nT=n=>1-Math.sin(Math.acos(n)),iT=id(nT),zF=c_(iT),f_=JE(QE),HF=id(f_),GF=c_(f_),WF=UF(QE),XF=4356/361,$F=35442/1805,qF=16061/1805,Jf=n=>{if(n===1||n===0)return n;const e=n*n;return nn<.5?.5*(1-Jf(1-n*2)):.5*Jf(n*2-1)+.5;function KF(n,e){return n.map(()=>e||tT).splice(0,n.length-1)}function ZF(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function JF(n,e){return n.map(t=>t*e)}function ju({from:n=0,to:e=1,ease:t,offset:i,duration:r=300}){const s={done:!1,value:n},o=Array.isArray(e)?e:[n,e],a=JF(i&&i.length===o.length?i:ZF(o),r);function l(){return ZE(a,o,{ease:Array.isArray(t)?t:KF(o,t)})}let c=l();return{next:u=>(s.value=c(u),s.done=u>=r,s),flipTarget:()=>{o.reverse(),c=l()}}}function QF({velocity:n=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:r=.5,modifyTarget:s}){const o={done:!1,value:e};let a=t*n;const l=e+a,c=s===void 0?l:s(l);return c!==l&&(a=c-e),{next:u=>{const f=-a*Math.exp(-u/i);return o.done=!(f>r||f<-r),o.value=o.done?c:c+f,o},flipTarget:()=>{}}}const Cy={keyframes:ju,spring:s_,decay:QF};function eB(n){if(Array.isArray(n.to))return ju;if(Cy[n.type])return Cy[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?ju:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?s_:ju}function rT(n,e,t=0){return n-e-t}function tB(n,e,t=0,i=!0){return i?rT(e+-n,e,t):e-(n-e)+t}function nB(n,e,t,i){return i?n>=e+t:n<=-t}const iB=n=>{const e=({delta:t})=>n(t);return{start:()=>ym.update(e,!0),stop:()=>iF.update(e)}};function sT(n){var e,t,{from:i,autoplay:r=!0,driver:s=iB,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:f,onComplete:h,onRepeat:d,onUpdate:p}=n,_=FE(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,m,y=0,x=_.duration,v,E=!1,T=!0,M;const P=eB(_);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(M=ZE([0,100],[i,g],{clamp:!1}),i=0,g=100);const b=P(Object.assign(Object.assign({},_),{from:i,to:g}));function S(){y++,l==="reverse"?(T=y%2===0,o=tB(o,x,c,T)):(o=rT(o,x,c),l==="mirror"&&b.flipTarget()),E=!1,d&&d()}function D(){m.stop(),h&&h()}function B($){if(T||($=-$),o+=$,!E){const ee=b.next(Math.max(0,o));v=ee.value,M&&(v=M(v)),E=T?ee.done:o<=0}p==null||p(v),E&&(y===0&&(x??(x=o)),y{f==null||f(),m.stop()}}}function oT(n,e){return e?n*(1e3/e):0}function rB({from:n=0,velocity:e=0,min:t,max:i,power:r=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:f,onComplete:h,onStop:d}){let p;function _(x){return t!==void 0&&xi}function g(x){return t===void 0?i:i===void 0||Math.abs(t-x){var E;f==null||f(v),(E=x.onUpdate)===null||E===void 0||E.call(x,v)},onComplete:h,onStop:d}))}function y(x){m(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},x))}if(_(n))y({from:n,velocity:e,to:g(n)});else{let x=r*e+n;typeof c<"u"&&(x=c(x));const v=g(x),E=v===t?-1:1;let T,M;const P=b=>{T=M,M=b,e=oT(b-T,UE().delta),(E===1&&b>v||E===-1&&bp==null?void 0:p.stop()}}const aT=(n,e)=>1-3*e+3*n,lT=(n,e)=>3*e-6*n,cT=n=>3*n,Qf=(n,e,t)=>((aT(e,t)*n+lT(e,t))*n+cT(e))*n,uT=(n,e,t)=>3*aT(e,t)*n*n+2*lT(e,t)*n+cT(e),sB=1e-7,oB=10;function aB(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=Qf(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>sB&&++a=cB?uB(o,f,n,t):h===0?f:aB(o,a,a+Du,n,t)}return o=>o===0||o===1?o:Qf(s(o),e,i)}const br={},xp={};class hB{constructor(){ii(this,"subscriptions",new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,i){if(this.subscriptions.size)for(const r of this.subscriptions)r(e,t,i)}clear(){this.subscriptions.clear()}}function Ry(n){return!Number.isNaN(Number.parseFloat(n))}class dB{constructor(e){ii(this,"current");ii(this,"prev");ii(this,"timeDelta",0);ii(this,"lastUpdated",0);ii(this,"updateSubscribers",new hB);ii(this,"stopAnimation");ii(this,"canTrackVelocity",!1);ii(this,"updateAndNotify",e=>{this.prev=this.current,this.current=e;const{delta:t,timestamp:i}=UE();this.lastUpdated!==i&&(this.timeDelta=t,this.lastUpdated=i),ym.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});ii(this,"scheduleVelocityCheck",()=>ym.postRender(this.velocityCheck));ii(this,"velocityCheck",({timestamp:e})=>{this.canTrackVelocity||(this.canTrackVelocity=Ry(this.current)),e!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=e,this.canTrackVelocity=Ry(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?oT(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{const{stop:i}=e(t);this.stopAnimation=i}).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 pB(n){return new dB(n)}const{isArray:mB}=Array;function gB(){const n=Ze({}),e=i=>{const r=s=>{n.value[s]&&(n.value[s].stop(),n.value[s].destroy(),delete n.value[s])};i?mB(i)?i.forEach(r):r(i):Object.keys(n.value).forEach(r)},t=(i,r,s)=>{if(n.value[i])return n.value[i];const o=pB(r);return o.onChange(a=>s[i]=a),n.value[i]=o,o};return NU(e),{motionValues:n,get:t,stop:e}}function _B(n){return Array.isArray(n)}function Fs(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function bp(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function vB(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function Sp(){return{type:"keyframes",ease:"linear",duration:300}}function yB(n){return{type:"keyframes",duration:800,values:n}}const Py={default:vB,x:Fs,y:Fs,z:Fs,rotate:Fs,rotateX:Fs,rotateY:Fs,rotateZ:Fs,scaleX:bp,scaleY:bp,scale:bp,backgroundColor:Sp,color:Sp,opacity:Sp};function fT(n,e){let t;return _B(e)?t=yB:t=Py[n]||Py.default,{to:e,...t(e)}}const Iy={...Mc,transform:Math.round},hT={color:kn,backgroundColor:kn,outlineColor:kn,fill:kn,stroke:kn,borderColor:kn,borderTopColor:kn,borderRightColor:kn,borderBottomColor:kn,borderLeftColor:kn,borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:Us,rotateX:Us,rotateY:Us,rotateZ:Us,scale:Lu,scaleX:Lu,scaleY:Lu,scaleZ:Lu,skew:Us,skewX:Us,skewY:Us,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:dl,originX:Ey,originY:Ey,originZ:it,zIndex:Iy,filter:Em,WebkitFilter:Em,fillOpacity:dl,strokeOpacity:dl,numOctaves:Iy},h_=n=>hT[n];function Tm(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function xB(n,e){let t=h_(n);return t!==Em&&(t=Ec),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const bB={linear:eT,easeIn:u_,easeInOut:tT,easeOut:VF,circIn:nT,circInOut:zF,circOut:iT,backIn:f_,backInOut:GF,backOut:HF,anticipate:WF,bounceIn:YF,bounceInOut:jF,bounceOut:Jf};function Ly(n){if(Array.isArray(n)){const[e,t,i,r]=n;return fB(e,t,i,r)}else if(typeof n=="string")return bB[n];return n}function SB(n){return Array.isArray(n)&&typeof n[0]!="number"}function Dy(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Ec.test(e)&&!e.startsWith("url("))}function MB(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function EB({ease:n,times:e,delay:t,...i}){const r={...i};return e&&(r.offset=e),n&&(r.ease=SB(n)?n.map(Ly):Ly(n)),t&&(r.elapsed=-t),r}function TB(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),MB(e),wB(n)||(n={...n,...fT(t,e.to)}),{...e,...EB(n)}}function wB({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:r,...s}){return!!Object.keys(s).length}function AB(n,e){return n[e]||n.default||n}function CB(n,e,t,i,r){const s=AB(i,n);let o=s.from===null||s.from===void 0?e.get():s.from;const a=Dy(n,t);o==="none"&&a&&typeof t=="string"&&(o=xB(n,t));const l=Dy(n,o);function c(f){const h={from:o,to:t,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:d=>e.set(d)};return s.type==="inertia"||s.type==="decay"?rB({...h,...s}):sT({...TB(s,h,n),onUpdate:d=>{h.onUpdate(d),s.onUpdate&&s.onUpdate(d)},onComplete:()=>{r&&r(),f&&f()}})}function u(f){return e.set(t),r&&r(),f&&f(),{stop:()=>{}}}return!l||!a||s.type===!1?u:c}function RB(){const{motionValues:n,stop:e,get:t}=gB();return{motionValues:n,stop:e,push:(r,s,o,a={},l)=>{const c=o[r],u=t(r,c,o);if(a&&a.immediate){u.set(s);return}const f=CB(r,u,s,a,l);u.start(f)}}}function PB(n,e={},{motionValues:t,push:i,stop:r}=RB()){const s=It(e),o=Ze(!1);Ge(t,f=>{o.value=Object.values(f).filter(h=>h.isAnimating()).length>0},{immediate:!0,deep:!0});const a=f=>{if(!s||!s[f])throw new Error(`The variant ${f} does not exist.`);return s[f]},l=f=>{typeof f=="string"&&(f=a(f));const h=Object.entries(f).map(([p,_])=>{if(p!=="transition")return new Promise(g=>i(p,_,n,f.transition||fT(p,f[p]),g))}).filter(Boolean);async function d(){var p,_;await Promise.all(h),(_=(p=f.transition)==null?void 0:p.onComplete)==null||_.call(p)}return Promise.all([d()])};return{isAnimating:o,apply:l,set:f=>{const h=Zf(f)?f:a(f);Object.entries(h).forEach(([d,p])=>{d!=="transition"&&i(d,p,n,{immediate:!0})})},leave:async f=>{let h;if(s&&(s.leave&&(h=s.leave),!s.leave&&s.initial&&(h=s.initial)),!h){f();return}await l(h),f()},stop:r}}const d_=typeof window<"u",IB=()=>d_&&(window.onpointerdown===null||(br==null?void 0:br.TEST)),LB=()=>d_&&(window.ontouchstart===null||(br==null?void 0:br.TEST)),DB=()=>d_&&(window.onmousedown===null||(br==null?void 0:br.TEST));function OB({target:n,state:e,variants:t,apply:i}){const r=It(t),s=Ze(!1),o=Ze(!1),a=Ze(!1),l=Se(()=>{let u=[...Object.keys(e.value||{})];return r&&(r.hovered&&(u=[...u,...Object.keys(r.hovered)]),r.tapped&&(u=[...u,...Object.keys(r.tapped)]),r.focused&&(u=[...u,...Object.keys(r.focused)])),u}),c=Se(()=>{const u={};Object.assign(u,e.value),s.value&&r.hovered&&Object.assign(u,r.hovered),o.value&&r.tapped&&Object.assign(u,r.tapped),a.value&&r.focused&&Object.assign(u,r.focused);for(const f in u)l.value.includes(f)||delete u[f];return u});r.hovered&&(Dt(n,"mouseenter",()=>s.value=!0),Dt(n,"mouseleave",()=>{s.value=!1,o.value=!1})),r.tapped&&(DB()&&(Dt(n,"mousedown",()=>o.value=!0),Dt(n,"mouseup",()=>o.value=!1)),IB()&&(Dt(n,"pointerdown",()=>o.value=!0),Dt(n,"pointerup",()=>o.value=!1)),LB()&&(Dt(n,"touchstart",()=>o.value=!0),Dt(n,"touchend",()=>o.value=!1))),r.focused&&(Dt(n,"focus",()=>a.value=!0),Dt(n,"blur",()=>a.value=!1)),Ge([s,o,a],()=>{i(c.value)})}function NB({set:n,target:e,variants:t,variant:i}){const r=It(t);Ge(()=>e,()=>{r&&(r.initial&&(n("initial"),i.value="initial"),r.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function UB({state:n,apply:e}){Ge(n,t=>{t&&e(t)},{immediate:!0})}function dT({target:n,variants:e,variant:t}){const i=It(e);i&&(i.visible||i.visibleOnce)&&ZU(n,([{isIntersecting:r}])=>{i.visible?r?t.value="visible":t.value="initial":i.visibleOnce&&(r&&t.value!=="visibleOnce"?t.value="visibleOnce":t.value||(t.value="initial"))})}function FB(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&NB(n),e.syncVariants&&UB(n),e.visibilityHooks&&dT(n),e.eventListeners&&OB(n)}function pT(n={}){const e=hi({...n}),t=Ze({});return Ge(e,()=>{const i={};for(const[r,s]of Object.entries(e)){const o=h_(r),a=Tm(s,o);i[r]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function p_(n,e){Ge(()=>Jn(n),t=>{t&&e(t)},{immediate:!0})}const BB={x:"translateX",y:"translateY",z:"translateZ"};function mT(n={},e=!0){const t=hi({...n}),i=Ze("");return Ge(t,r=>{let s="",o=!1;if(e&&(r.x||r.y||r.z)){const a=[r.x||0,r.y||0,r.z||0].map(l=>Tm(l,it)).join(",");s+=`translate3d(${a}) `,o=!0}for(const[a,l]of Object.entries(r)){if(e&&(a==="x"||a==="y"||a==="z"))continue;const c=h_(a),u=Tm(l,c);s+=`${BB[a]||a}(${u}) `}e&&!o&&(s+="translateZ(0px) "),i.value=s.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const kB=["","X","Y","Z"],VB=["perspective","translate","scale","rotate","skew"],gT=["transformPerspective","x","y","z"];VB.forEach(n=>{kB.forEach(e=>{const t=n+e;gT.push(t)})});const zB=new Set(gT);function m_(n){return zB.has(n)}const HB=new Set(["originX","originY","originZ"]);function _T(n){return HB.has(n)}function GB(n){const e={},t={};return Object.entries(n).forEach(([i,r])=>{m_(i)||_T(i)?e[i]=r:t[i]=r}),{transform:e,style:t}}function rd(n){const{transform:e,style:t}=GB(n),{transform:i}=mT(e),{style:r}=pT(t);return i.value&&(r.value.transform=i.value),r.value}function WB(n,e){let t,i;const{state:r,style:s}=pT();return p_(n,o=>{i=o;for(const a of Object.keys(hT))o.style[a]===null||o.style[a]===""||m_(a)||_T(a)||(r[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e&&e(r)}),Ge(s,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:r}}function XB(n){const e=n.trim().split(/\) |\)/);if(e.length===1)return{};const t=i=>i.endsWith("px")||i.endsWith("deg")?Number.parseFloat(i):Number.isNaN(Number(i))?Number(i):i;return e.reduce((i,r)=>{if(!r)return i;const[s,o]=r.split("("),l=o.split(",").map(u=>t(u.endsWith(")")?u.replace(")",""):u.trim())),c=l.length===1?l[0]:l;return{...i,[s]:c}},{})}function $B(n,e){Object.entries(XB(e)).forEach(([t,i])=>{const r=["x","y","z"];if(t==="translate3d"){if(i===0){r.forEach(s=>n[s]=0);return}i.forEach((s,o)=>n[r[o]]=s);return}if(i=Number.parseFloat(`${i}`),t==="translateX"){n.x=i;return}if(t==="translateY"){n.y=i;return}if(t==="translateZ"){n.z=i;return}n[t]=i})}function qB(n,e){let t,i;const{state:r,transform:s}=mT();return p_(n,o=>{i=o,o.style.transform&&$B(r,o.style.transform),t&&(o.style.transform=t),e&&e(r)}),Ge(s,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:r}}function YB(n){return Object.entries(n)}function jB(n,e){const t=hi({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:r}=WB(n,i),{transform:s}=qB(n,i);return Ge(t,o=>{YB(o).forEach(([a,l])=>{const c=m_(a)?s:r;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),p_(n,()=>e),{motionProperties:t,style:r,transform:s}}function KB(n={}){const e=It(n),t=Ze();return{state:Se(()=>{if(t.value)return e[t.value]}),variant:t}}function vT(n,e={},t){const{motionProperties:i}=jB(n),{variant:r,state:s}=KB(e),o=PB(i,e),a={target:n,variant:r,variants:e,state:s,motionProperties:i,...o};return FB(a,t),a}const yT=["delay","duration"],ZB=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...yT];function JB(n){return yT.includes(n)}function QB(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&Zf(t.variants)&&(e.value={...e.value,...t.variants});for(let i of ZB)if(!(!t||!t[i])){if(JB(i)&&typeof t[i]=="number"){for(const r of["enter","visible","visibleOnce"]){const s=e.value[r];s!=null&&(s.transition??(s.transition={}),s.transition[i]=t[i])}continue}if(Zf(t[i])){const r=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=r}}}}function Mp(n,e=!1){return{created:(r,s,o)=>{const a=s.value&&typeof s.value=="string"?s.value:o.key;a&&xp[a]&&xp[a].stop();const l=e?structuredClone(ot(n)||{}):n||{},c=Ze(l);typeof s.value=="object"&&(c.value=s.value),QB(o,c);const f=vT(r,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});r.motionInstance=f,a&&(xp[a]=f)},mounted:(r,s,o)=>{r.motionInstance&&dT(r.motionInstance)},getSSRProps(r,s){let{initial:o}=r.value||s&&(s==null?void 0:s.props)||{};o=It(o);const a=bE({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:rd(a)}}}}const ek={initial:{opacity:0},enter:{opacity:1}},tk={initial:{opacity:0},visible:{opacity:1}},nk={initial:{opacity:0},visibleOnce:{opacity:1}},ik={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},rk={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},sk={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},ok={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},ak={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},lk={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},ck={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},uk={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},fk={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},hk={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},dk={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},pk={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},mk={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},gk={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},_k={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},vk={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},yk={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},xk={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},bk={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Sk={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},Mk={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},Ek={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},Tk={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},wk={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Ak={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Ck={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Rk={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},eh={__proto__:null,fade:ek,fadeVisible:tk,fadeVisibleOnce:nk,pop:ik,popVisible:rk,popVisibleOnce:sk,rollBottom:mk,rollLeft:ok,rollRight:ck,rollTop:hk,rollVisibleBottom:gk,rollVisibleLeft:ak,rollVisibleOnceBottom:_k,rollVisibleOnceLeft:lk,rollVisibleOnceRight:fk,rollVisibleOnceTop:pk,rollVisibleRight:uk,rollVisibleTop:dk,slideBottom:Ak,slideLeft:vk,slideRight:bk,slideTop:Ek,slideVisibleBottom:Ck,slideVisibleLeft:yk,slideVisibleOnceBottom:Rk,slideVisibleOnceLeft:xk,slideVisibleOnceRight:Mk,slideVisibleOnceTop:wk,slideVisibleRight:Sk,slideVisibleTop:Tk};function Pk(n){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",t="aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------",i=new RegExp(e.split("").join("|"),"g");return n.toString().replace(/[A-Z]/g,r=>`-${r}`).toLowerCase().replace(/\s+/g,"-").replace(i,r=>t.charAt(e.indexOf(r))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const xT=Symbol(""),bT={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function Ik(n){return Object.prototype.toString.call(n)==="[object Object]"}function wm(n){if(Array.isArray(n))return n.map(wm);if(Ik(n)){const e={};for(const t in n)e[t]=wm(n[t]);return e}return n}function ST(n){const e=hi({}),t=gn(xT,{}),i=Se(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(ot(t)[n.preset]):n.preset in eh?structuredClone(eh[n.preset]):{}),r=Se(()=>({initial:n.initial,enter:n.enter,leave:n.leave,visible:n.visible,visibleOnce:n.visibleOnce,hovered:n.hovered,tapped:n.tapped,focused:n.focused}));function s(l,c){for(const u of["delay","duration"]){if(c[u]==null)continue;const f=Number.parseInt(c[u]);for(const h of["enter","visible","visibleOnce"]){const d=l[h];d!=null&&(d.transition??(d.transition={}),d.transition[u]=f)}}return l}const o=Se(()=>{const l=bE({},r.value,i.value,n.variants||{});return s({...l},n)});function a(l,c,u){var h;l.props??(l.props={}),(h=l.props).style??(h.style={}),l.props.style={...l.props.style,...u};const f=s(wm(o.value),l.props);return l.props.onVnodeMounted=({el:d})=>{e[c]=vT(d,f)},l.props.onVnodeUpdated=({el:d})=>{const p=rd(e[c].state);for(const[_,g]of Object.entries(p))d.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const Lk=rn({name:"Motion",props:{...bT,is:{type:[String,Object],default:"div"}},setup(n){const e=rg(),{motionConfig:t,setNodeInstance:i}=ST(n);return()=>{const r=rd(t.value.initial||{}),s=Sr(n.is,void 0,e);return i(s,0,r),s}}}),Dk=rn({name:"MotionGroup",props:{...bT,is:{type:[String,Object],required:!1}},setup(n){const e=rg(),{motionConfig:t,setNodeInstance:i}=ST(n);return()=>{var o;const r=rd(t.value.initial||{}),s=((o=e.default)==null?void 0:o.call(e))||[];for(let a=0;a
'};t.configure=function(p){var _,g;for(_ in p)g=p[_],g!==void 0&&p.hasOwnProperty(_)&&(i[_]=g);return this},t.status=null,t.set=function(p){var _=t.isStarted();p=r(p,i.minimum,1),t.status=p===1?null:p;var g=t.render(!_),m=g.querySelector(i.barSelector),y=i.speed,x=i.easing;return g.offsetWidth,a(function(v){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(m,o(p,y,x)),p===1?(l(g,{transition:"none",opacity:1}),g.offsetWidth,setTimeout(function(){l(g,{transition:"all "+y+"ms linear",opacity:0}),setTimeout(function(){t.remove(),v()},y)},y)):setTimeout(v,y)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},i.trickleSpeed)};return i.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var _=t.status;return _?(typeof p!="number"&&(p=(1-_)*r(Math.random()*_,.1,.95)),_=r(_+p,0,.994),t.set(_)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var p=0,_=0;t.promise=function(g){return!g||g.state()==="resolved"?this:(_===0&&t.start(),p++,_++,g.always(function(){_--,_===0?(p=0,t.done()):t.set((p-_)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var _=document.createElement("div");_.id="nprogress",_.innerHTML=i.template;var g=_.querySelector(i.barSelector),m=p?"-100":s(t.status||0),y=document.querySelector(i.parent),x;return l(g,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(x=_.querySelector(i.spinnerSelector),x&&d(x)),y!=document.body&&u(y,"nprogress-custom-parent"),y.appendChild(_),_},t.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(i.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&d(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,_="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return _+"Perspective"in p?"translate3d":_+"Transform"in p?"translate":"margin"};function r(p,_,g){return p<_?_:p>g?g:p}function s(p){return(-1+p)*100}function o(p,_,g){var m;return i.positionUsing==="translate3d"?m={transform:"translate3d("+s(p)+"%,0,0)"}:i.positionUsing==="translate"?m={transform:"translate("+s(p)+"%,0)"}:m={"margin-left":s(p)+"%"},m.transition="all "+_+"ms "+g,m}var a=function(){var p=[];function _(){var g=p.shift();g&&g(_)}return function(g){p.push(g),p.length==1&&_()}}(),l=function(){var p=["Webkit","O","Moz","ms"],_={};function g(v){return v.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(E,T){return T.toUpperCase()})}function m(v){var E=document.body.style;if(v in E)return v;for(var T=p.length,M=v.charAt(0).toUpperCase()+v.slice(1),P;T--;)if(P=p[T]+M,P in E)return P;return v}function y(v){return v=g(v),_[v]||(_[v]=m(v))}function x(v,E,T){E=y(E),v.style[E]=T}return function(v,E){var T=arguments,M,P;if(T.length==2)for(M in E)P=E[M],P!==void 0&&E.hasOwnProperty(M)&&x(v,M,P);else x(v,T[1],T[2])}}();function c(p,_){var g=typeof p=="string"?p:h(p);return g.indexOf(" "+_+" ")>=0}function u(p,_){var g=h(p),m=g+_;c(g,_)||(p.className=m.substring(1))}function f(p,_){var g=h(p),m;c(p,_)&&(m=g.replace(" "+_+" "," "),p.className=m.substring(1,m.length-1))}function h(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function d(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})}(Zu)),Zu.exports}var Bk=Fk();const MT=Nk(Bk);/*! +}`;class bO{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const s=new Vt,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Ri({vertexShader:yO,fragmentShader:xO,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ht(new ba(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class SO extends ji{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,f=null,h=null,d=null,p=null;const _=new bO,g=t.getContextAttributes();let m=null,y=null;const x=[],v=[],E=new fe;let T=null;const M=new $t;M.viewport=new ht;const P=new $t;P.viewport=new ht;const b=[M,P],S=new $M;let D=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let ge=x[re];return ge===void 0&&(ge=new Wu,x[re]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(re){let ge=x[re];return ge===void 0&&(ge=new Wu,x[re]=ge),ge.getGripSpace()},this.getHand=function(re){let ge=x[re];return ge===void 0&&(ge=new Wu,x[re]=ge),ge.getHandSpace()};function H(re){const ge=v.indexOf(re.inputSource);if(ge===-1)return;const be=x[ge];be!==void 0&&(be.update(re.inputSource,re.frame,c||o),be.dispatchEvent({type:re.type,data:re.inputSource}))}function $(){s.removeEventListener("select",H),s.removeEventListener("selectstart",H),s.removeEventListener("selectend",H),s.removeEventListener("squeeze",H),s.removeEventListener("squeezestart",H),s.removeEventListener("squeezeend",H),s.removeEventListener("end",$),s.removeEventListener("inputsourceschange",ee);for(let re=0;re=0&&(v[W]=null,x[W].disconnect(be))}for(let ge=0;ge=v.length){v.push(be),W=ue;break}else if(v[ue]===null){v[ue]=be,W=ue;break}if(W===-1)break}const ae=x[W];ae&&ae.connect(be)}}const Z=new F,te=new F;function Q(re,ge,be){Z.setFromMatrixPosition(ge.matrixWorld),te.setFromMatrixPosition(be.matrixWorld);const W=Z.distanceTo(te),ae=ge.projectionMatrix.elements,ue=be.projectionMatrix.elements,le=ae[14]/(ae[10]-1),Oe=ae[14]/(ae[10]+1),I=(ae[9]+1)/ae[5],L=(ae[9]-1)/ae[5],w=(ae[8]-1)/ae[0],j=(ue[8]+1)/ue[0],G=le*w,q=le*j,R=W/(-w+j),N=R*-w;if(ge.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(N),re.translateZ(R),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert(),ae[10]===-1)re.projectionMatrix.copy(ge.projectionMatrix),re.projectionMatrixInverse.copy(ge.projectionMatrixInverse);else{const V=le+R,A=Oe+R,C=G-N,k=q+(W-N),U=I*Oe/A*V,z=L*Oe/A*V;re.projectionMatrix.makePerspective(C,k,U,z,V,A),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}}function pe(re,ge){ge===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(ge.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(s===null)return;let ge=re.near,be=re.far;_.texture!==null&&(_.depthNear>0&&(ge=_.depthNear),_.depthFar>0&&(be=_.depthFar)),S.near=P.near=M.near=ge,S.far=P.far=M.far=be,(D!==S.near||B!==S.far)&&(s.updateRenderState({depthNear:S.near,depthFar:S.far}),D=S.near,B=S.far),M.layers.mask=re.layers.mask|2,P.layers.mask=re.layers.mask|4,S.layers.mask=M.layers.mask|P.layers.mask;const W=re.parent,ae=S.cameras;pe(S,W);for(let ue=0;ue0&&(g.alphaTest.value=m.alphaTest);const y=e.get(m),x=y.envMap,v=y.envMapRotation;x&&(g.envMap.value=x,Nr.copy(v),Nr.x*=-1,Nr.y*=-1,Nr.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Nr.y*=-1,Nr.z*=-1),g.envMapRotation.value.setFromMatrix4(MO.makeRotationFromEuler(Nr)),g.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,g.aoMapTransform))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform))}function a(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,y,x){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*y,g.scale.value=x*.5,m.map&&(g.map.value=m.map,t(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function f(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function h(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,y){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Dn&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,m){m.matcap&&(g.matcap.value=m.matcap)}function _(g,m){const y=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function TO(n,e,t,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,x){const v=x.program;i.uniformBlockBinding(y,v)}function c(y,x){let v=s[y.id];v===void 0&&(p(y),v=u(y),s[y.id]=v,y.addEventListener("dispose",g));const E=x.program;i.updateUBOMapping(y,E);const T=e.render.frame;r[y.id]!==T&&(h(y),r[y.id]=T)}function u(y){const x=f();y.__bindingPointIndex=x;const v=n.createBuffer(),E=y.__size,T=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,v),n.bufferData(n.UNIFORM_BUFFER,E,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,v),v}function f(){for(let y=0;y0&&(v+=E-T),y.__size=v,y.__cache={},this}function _(y){const x={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(x.boundary=4,x.storage=4):y.isVector2?(x.boundary=8,x.storage=8):y.isVector3||y.isColor?(x.boundary=16,x.storage=12):y.isVector4?(x.boundary=16,x.storage=16):y.isMatrix3?(x.boundary=48,x.storage=48):y.isMatrix4?(x.boundary=64,x.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),x}function g(y){const x=y.target;x.removeEventListener("dispose",g);const v=o.indexOf(x.__bindingPointIndex);o.splice(v,1),n.deleteBuffer(s[x.id]),delete s[x.id],delete r[x.id]}function m(){for(const y in s)n.deleteBuffer(s[y]);o=[],s={},r={}}return{bind:l,update:c,dispose:m}}class $u{constructor(e={}){const{canvas:t=jS(),context:i=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1,reverseDepthBuffer:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=o;const p=new Uint32Array(4),_=new Int32Array(4);let g=null,m=null;const y=[],x=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Cn,this.toneMapping=Hi,this.toneMappingExposure=1;const v=this;let E=!1,T=0,M=0,P=null,b=-1,S=null;const D=new ht,B=new ht;let H=null;const $=new we(0);let ee=0,Z=t.width,te=t.height,Q=1,pe=null,ve=null;const se=new ht(0,0,Z,te),xe=new ht(0,0,Z,te);let ze=!1;const re=new pc;let ge=!1,be=!1;this.transmissionResolutionScale=1;const W=new Xe,ae=new Xe,ue=new F,le=new ht,Oe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let I=!1;function L(){return P===null?Q:1}let w=i;function j(O,K){return t.getContext(O,K)}try{const O={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${lc}`),t.addEventListener("webglcontextlost",de,!1),t.addEventListener("webglcontextrestored",Pe,!1),t.addEventListener("webglcontextcreationerror",Re,!1),w===null){const K="webgl2";if(w=j(K,O),w===null)throw j(K)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let G,q,R,N,V,A,C,k,U,z,Y,he,ce,ye,Fe,me,Te,ke,We,Me,qe,Je,Ct,X;function Ae(){G=new FD(w),G.init(),Je=new iE(w,G),q=new PD(w,G,e,Je),R=new _O(w,G),q.reverseDepthBuffer&&h&&R.buffers.depth.setReversed(!0),N=new VD(w),V=new sO,A=new vO(w,G,R,V,q,Je,N),C=new LD(v),k=new UD(v),U=new $I(w),Ct=new CD(w,U),z=new BD(w,U,N,Ct),Y=new HD(w,z,U,N),We=new zD(w,q,A),me=new ID(V),he=new iO(v,C,k,G,q,Ct,me),ce=new EO(v,V),ye=new oO,Fe=new hO(G),ke=new AD(v,C,k,R,Y,d,l),Te=new mO(v,Y,q),X=new TO(w,N,q,R),Me=new RD(w,G,N),qe=new kD(w,G,N),N.programs=he.programs,v.capabilities=q,v.extensions=G,v.properties=V,v.renderLists=ye,v.shadowMap=Te,v.state=R,v.info=N}Ae();const oe=new SO(v,w);this.xr=oe,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const O=G.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=G.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(O){O!==void 0&&(Q=O,this.setSize(Z,te,!1))},this.getSize=function(O){return O.set(Z,te)},this.setSize=function(O,K,ne=!0){if(oe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Z=O,te=K,t.width=Math.floor(O*Q),t.height=Math.floor(K*Q),ne===!0&&(t.style.width=O+"px",t.style.height=K+"px"),this.setViewport(0,0,O,K)},this.getDrawingBufferSize=function(O){return O.set(Z*Q,te*Q).floor()},this.setDrawingBufferSize=function(O,K,ne){Z=O,te=K,Q=ne,t.width=Math.floor(O*ne),t.height=Math.floor(K*ne),this.setViewport(0,0,O,K)},this.getCurrentViewport=function(O){return O.copy(D)},this.getViewport=function(O){return O.copy(se)},this.setViewport=function(O,K,ne,ie){O.isVector4?se.set(O.x,O.y,O.z,O.w):se.set(O,K,ne,ie),R.viewport(D.copy(se).multiplyScalar(Q).round())},this.getScissor=function(O){return O.copy(xe)},this.setScissor=function(O,K,ne,ie){O.isVector4?xe.set(O.x,O.y,O.z,O.w):xe.set(O,K,ne,ie),R.scissor(B.copy(xe).multiplyScalar(Q).round())},this.getScissorTest=function(){return ze},this.setScissorTest=function(O){R.setScissorTest(ze=O)},this.setOpaqueSort=function(O){pe=O},this.setTransparentSort=function(O){ve=O},this.getClearColor=function(O){return O.copy(ke.getClearColor())},this.setClearColor=function(){ke.setClearColor(...arguments)},this.getClearAlpha=function(){return ke.getClearAlpha()},this.setClearAlpha=function(){ke.setClearAlpha(...arguments)},this.clear=function(O=!0,K=!0,ne=!0){let ie=0;if(O){let J=!1;if(P!==null){const _e=P.texture.format;J=_e===wh||_e===Th||_e===uc}if(J){const _e=P.texture.type,Ce=_e===qi||_e===Ts||_e===oa||_e===ao||_e===Sh||_e===Mh,Le=ke.getClearColor(),Ne=ke.getClearAlpha(),Ye=Le.r,je=Le.g,Ve=Le.b;Ce?(p[0]=Ye,p[1]=je,p[2]=Ve,p[3]=Ne,w.clearBufferuiv(w.COLOR,0,p)):(_[0]=Ye,_[1]=je,_[2]=Ve,_[3]=Ne,w.clearBufferiv(w.COLOR,0,_))}else ie|=w.COLOR_BUFFER_BIT}K&&(ie|=w.DEPTH_BUFFER_BIT),ne&&(ie|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(ie)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",de,!1),t.removeEventListener("webglcontextrestored",Pe,!1),t.removeEventListener("webglcontextcreationerror",Re,!1),ke.dispose(),ye.dispose(),Fe.dispose(),V.dispose(),C.dispose(),k.dispose(),Y.dispose(),Ct.dispose(),X.dispose(),he.dispose(),oe.dispose(),oe.removeEventListener("sessionstart",T_),oe.removeEventListener("sessionend",w_),_r.stop()};function de(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),E=!0}function Pe(){console.log("THREE.WebGLRenderer: Context Restored."),E=!1;const O=N.autoReset,K=Te.enabled,ne=Te.autoUpdate,ie=Te.needsUpdate,J=Te.type;Ae(),N.autoReset=O,Te.enabled=K,Te.autoUpdate=ne,Te.needsUpdate=ie,Te.type=J}function Re(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function nt(O){const K=O.target;K.removeEventListener("dispose",nt),Ft(K)}function Ft(O){un(O),V.remove(O)}function un(O){const K=V.get(O).programs;K!==void 0&&(K.forEach(function(ne){he.releaseProgram(ne)}),O.isShaderMaterial&&he.releaseShaderCache(O))}this.renderBufferDirect=function(O,K,ne,ie,J,_e){K===null&&(K=Oe);const Ce=J.isMesh&&J.matrixWorld.determinant()<0,Le=rw(O,K,ne,ie,J);R.setMaterial(ie,Ce);let Ne=ne.index,Ye=1;if(ie.wireframe===!0){if(Ne=z.getWireframeAttribute(ne),Ne===void 0)return;Ye=2}const je=ne.drawRange,Ve=ne.attributes.position;let ut=je.start*Ye,gt=(je.start+je.count)*Ye;_e!==null&&(ut=Math.max(ut,_e.start*Ye),gt=Math.min(gt,(_e.start+_e.count)*Ye)),Ne!==null?(ut=Math.max(ut,0),gt=Math.min(gt,Ne.count)):Ve!=null&&(ut=Math.max(ut,0),gt=Math.min(gt,Ve.count));const Gt=gt-ut;if(Gt<0||Gt===1/0)return;Ct.setup(J,ie,Le,ne,Ne);let Bt,dt=Me;if(Ne!==null&&(Bt=U.get(Ne),dt=qe,dt.setIndex(Bt)),J.isMesh)ie.wireframe===!0?(R.setLineWidth(ie.wireframeLinewidth*L()),dt.setMode(w.LINES)):dt.setMode(w.TRIANGLES);else if(J.isLine){let He=ie.linewidth;He===void 0&&(He=1),R.setLineWidth(He*L()),J.isLineSegments?dt.setMode(w.LINES):J.isLineLoop?dt.setMode(w.LINE_LOOP):dt.setMode(w.LINE_STRIP)}else J.isPoints?dt.setMode(w.POINTS):J.isSprite&&dt.setMode(w.TRIANGLES);if(J.isBatchedMesh)if(J._multiDrawInstances!==null)Vr("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),dt.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances);else if(G.get("WEBGL_multi_draw"))dt.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else{const He=J._multiDrawStarts,rn=J._multiDrawCounts,_t=J._multiDrawCount,_i=Ne?U.get(Ne).bytesPerElement:1,xo=V.get(ie).currentProgram.getUniforms();for(let qn=0;qn<_t;qn++)xo.setValue(w,"_gl_DrawID",qn),dt.render(He[qn]/_i,rn[qn])}else if(J.isInstancedMesh)dt.renderInstances(ut,Gt,J.count);else if(ne.isInstancedBufferGeometry){const He=ne._maxInstanceCount!==void 0?ne._maxInstanceCount:1/0,rn=Math.min(ne.instanceCount,He);dt.renderInstances(ut,Gt,rn)}else dt.render(ut,Gt)};function bt(O,K,ne){O.transparent===!0&&O.side===Si&&O.forceSinglePass===!1?(O.side=Dn,O.needsUpdate=!0,Ac(O,K,ne),O.side=Ms,O.needsUpdate=!0,Ac(O,K,ne),O.side=Si):Ac(O,K,ne)}this.compile=function(O,K,ne=null){ne===null&&(ne=O),m=Fe.get(ne),m.init(K),x.push(m),ne.traverseVisible(function(J){J.isLight&&J.layers.test(K.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),O!==ne&&O.traverseVisible(function(J){J.isLight&&J.layers.test(K.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),m.setupLights();const ie=new Set;return O.traverse(function(J){if(!(J.isMesh||J.isPoints||J.isLine||J.isSprite))return;const _e=J.material;if(_e)if(Array.isArray(_e))for(let Ce=0;Ce<_e.length;Ce++){const Le=_e[Ce];bt(Le,ne,J),ie.add(Le)}else bt(_e,ne,J),ie.add(_e)}),m=x.pop(),ie},this.compileAsync=function(O,K,ne=null){const ie=this.compile(O,K,ne);return new Promise(J=>{function _e(){if(ie.forEach(function(Ce){V.get(Ce).currentProgram.isReady()&&ie.delete(Ce)}),ie.size===0){J(O);return}setTimeout(_e,10)}G.get("KHR_parallel_shader_compile")!==null?_e():setTimeout(_e,10)})};let gi=null;function Zi(O){gi&&gi(O)}function T_(){_r.stop()}function w_(){_r.start()}const _r=new JM;_r.setAnimationLoop(Zi),typeof self<"u"&&_r.setContext(self),this.setAnimationLoop=function(O){gi=O,oe.setAnimationLoop(O),O===null?_r.stop():_r.start()},oe.addEventListener("sessionstart",T_),oe.addEventListener("sessionend",w_),this.render=function(O,K){if(K!==void 0&&K.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;if(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),K.parent===null&&K.matrixWorldAutoUpdate===!0&&K.updateMatrixWorld(),oe.enabled===!0&&oe.isPresenting===!0&&(oe.cameraAutoUpdate===!0&&oe.updateCamera(K),K=oe.getCamera()),O.isScene===!0&&O.onBeforeRender(v,O,K,P),m=Fe.get(O,x.length),m.init(K),x.push(m),ae.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse),re.setFromProjectionMatrix(ae),be=this.localClippingEnabled,ge=me.init(this.clippingPlanes,be),g=ye.get(O,y.length),g.init(),y.push(g),oe.enabled===!0&&oe.isPresenting===!0){const _e=v.xr.getDepthSensingMesh();_e!==null&&hd(_e,K,-1/0,v.sortObjects)}hd(O,K,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(pe,ve),I=oe.enabled===!1||oe.isPresenting===!1||oe.hasDepthSensing()===!1,I&&ke.addToRenderList(g,O),this.info.render.frame++,ge===!0&&me.beginShadows();const ne=m.state.shadowsArray;Te.render(ne,O,K),ge===!0&&me.endShadows(),this.info.autoReset===!0&&this.info.reset();const ie=g.opaque,J=g.transmissive;if(m.setupLights(),K.isArrayCamera){const _e=K.cameras;if(J.length>0)for(let Ce=0,Le=_e.length;Ce0&&C_(ie,J,O,K),I&&ke.render(O),A_(g,O,K);P!==null&&M===0&&(A.updateMultisampleRenderTarget(P),A.updateRenderTargetMipmap(P)),O.isScene===!0&&O.onAfterRender(v,O,K),Ct.resetDefaultState(),b=-1,S=null,x.pop(),x.length>0?(m=x[x.length-1],ge===!0&&me.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function hd(O,K,ne,ie){if(O.visible===!1)return;if(O.layers.test(K.layers)){if(O.isGroup)ne=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(K);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||re.intersectsSprite(O)){ie&&le.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ae);const Ce=Y.update(O),Le=O.material;Le.visible&&g.push(O,Ce,Le,ne,le.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||re.intersectsObject(O))){const Ce=Y.update(O),Le=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),le.copy(O.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),le.copy(Ce.boundingSphere.center)),le.applyMatrix4(O.matrixWorld).applyMatrix4(ae)),Array.isArray(Le)){const Ne=Ce.groups;for(let Ye=0,je=Ne.length;Ye0&&wc(J,K,ne),_e.length>0&&wc(_e,K,ne),Ce.length>0&&wc(Ce,K,ne),R.buffers.depth.setTest(!0),R.buffers.depth.setMask(!0),R.buffers.color.setMask(!0),R.setPolygonOffset(!1)}function C_(O,K,ne,ie){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[ie.id]===void 0&&(m.state.transmissionRenderTarget[ie.id]=new Yi(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")||G.has("EXT_color_buffer_float")?va:qi,minFilter:Vi,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:at.workingColorSpace}));const _e=m.state.transmissionRenderTarget[ie.id],Ce=ie.viewport||D;_e.setSize(Ce.z*v.transmissionResolutionScale,Ce.w*v.transmissionResolutionScale);const Le=v.getRenderTarget();v.setRenderTarget(_e),v.getClearColor($),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),I&&ke.render(ne);const Ne=v.toneMapping;v.toneMapping=Hi;const Ye=ie.viewport;if(ie.viewport!==void 0&&(ie.viewport=void 0),m.setupLightsView(ie),ge===!0&&me.setGlobalState(v.clippingPlanes,ie),wc(O,ne,ie),A.updateMultisampleRenderTarget(_e),A.updateRenderTargetMipmap(_e),G.has("WEBGL_multisampled_render_to_texture")===!1){let je=!1;for(let Ve=0,ut=K.length;Ve0),Ve=!!ne.morphAttributes.position,ut=!!ne.morphAttributes.normal,gt=!!ne.morphAttributes.color;let Gt=Hi;ie.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Gt=v.toneMapping);const Bt=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,dt=Bt!==void 0?Bt.length:0,He=V.get(ie),rn=m.state.lights;if(ge===!0&&(be===!0||O!==S)){const bn=O===S&&ie.id===b;me.setState(ie,O,bn)}let _t=!1;ie.version===He.__version?(He.needsLights&&He.lightsStateVersion!==rn.state.version||He.outputColorSpace!==Le||J.isBatchedMesh&&He.batching===!1||!J.isBatchedMesh&&He.batching===!0||J.isBatchedMesh&&He.batchingColor===!0&&J.colorTexture===null||J.isBatchedMesh&&He.batchingColor===!1&&J.colorTexture!==null||J.isInstancedMesh&&He.instancing===!1||!J.isInstancedMesh&&He.instancing===!0||J.isSkinnedMesh&&He.skinning===!1||!J.isSkinnedMesh&&He.skinning===!0||J.isInstancedMesh&&He.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&He.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&He.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&He.instancingMorph===!1&&J.morphTexture!==null||He.envMap!==Ne||ie.fog===!0&&He.fog!==_e||He.numClippingPlanes!==void 0&&(He.numClippingPlanes!==me.numPlanes||He.numIntersection!==me.numIntersection)||He.vertexAlphas!==Ye||He.vertexTangents!==je||He.morphTargets!==Ve||He.morphNormals!==ut||He.morphColors!==gt||He.toneMapping!==Gt||He.morphTargetsCount!==dt)&&(_t=!0):(_t=!0,He.__version=ie.version);let _i=He.currentProgram;_t===!0&&(_i=Ac(ie,K,J));let xo=!1,qn=!1,Ea=!1;const Pt=_i.getUniforms(),ti=He.uniforms;if(R.useProgram(_i.program)&&(xo=!0,qn=!0,Ea=!0),ie.id!==b&&(b=ie.id,qn=!0),xo||S!==O){R.buffers.depth.getReversed()?(W.copy(O.projectionMatrix),pR(W),mR(W),Pt.setValue(w,"projectionMatrix",W)):Pt.setValue(w,"projectionMatrix",O.projectionMatrix),Pt.setValue(w,"viewMatrix",O.matrixWorldInverse);const Un=Pt.map.cameraPosition;Un!==void 0&&Un.setValue(w,ue.setFromMatrixPosition(O.matrixWorld)),q.logarithmicDepthBuffer&&Pt.setValue(w,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&Pt.setValue(w,"isOrthographic",O.isOrthographicCamera===!0),S!==O&&(S=O,qn=!0,Ea=!0)}if(J.isSkinnedMesh){Pt.setOptional(w,J,"bindMatrix"),Pt.setOptional(w,J,"bindMatrixInverse");const bn=J.skeleton;bn&&(bn.boneTexture===null&&bn.computeBoneTexture(),Pt.setValue(w,"boneTexture",bn.boneTexture,A))}J.isBatchedMesh&&(Pt.setOptional(w,J,"batchingTexture"),Pt.setValue(w,"batchingTexture",J._matricesTexture,A),Pt.setOptional(w,J,"batchingIdTexture"),Pt.setValue(w,"batchingIdTexture",J._indirectTexture,A),Pt.setOptional(w,J,"batchingColorTexture"),J._colorsTexture!==null&&Pt.setValue(w,"batchingColorTexture",J._colorsTexture,A));const ni=ne.morphAttributes;if((ni.position!==void 0||ni.normal!==void 0||ni.color!==void 0)&&We.update(J,ne,_i),(qn||He.receiveShadow!==J.receiveShadow)&&(He.receiveShadow=J.receiveShadow,Pt.setValue(w,"receiveShadow",J.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(ti.envMap.value=Ne,ti.flipEnvMap.value=Ne.isCubeTexture&&Ne.isRenderTargetTexture===!1?-1:1),ie.isMeshStandardMaterial&&ie.envMap===null&&K.environment!==null&&(ti.envMapIntensity.value=K.environmentIntensity),qn&&(Pt.setValue(w,"toneMappingExposure",v.toneMappingExposure),He.needsLights&&ow(ti,Ea),_e&&ie.fog===!0&&ce.refreshFogUniforms(ti,_e),ce.refreshMaterialUniforms(ti,ie,Q,te,m.state.transmissionRenderTarget[O.id]),Xu.upload(w,P_(He),ti,A)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(Xu.upload(w,P_(He),ti,A),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&Pt.setValue(w,"center",J.center),Pt.setValue(w,"modelViewMatrix",J.modelViewMatrix),Pt.setValue(w,"normalMatrix",J.normalMatrix),Pt.setValue(w,"modelMatrix",J.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){const bn=ie.uniformsGroups;for(let Un=0,dd=bn.length;Un0&&A.useMultisampledRTT(O)===!1?J=V.get(O).__webglMultisampledFramebuffer:Array.isArray(je)?J=je[ne]:J=je,D.copy(O.viewport),B.copy(O.scissor),H=O.scissorTest}else D.copy(se).multiplyScalar(Q).floor(),B.copy(xe).multiplyScalar(Q).floor(),H=ze;if(ne!==0&&(J=lw),R.bindFramebuffer(w.FRAMEBUFFER,J)&&ie&&R.drawBuffers(O,J),R.viewport(D),R.scissor(B),R.setScissorTest(H),_e){const Ne=V.get(O.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+K,Ne.__webglTexture,ne)}else if(Ce){const Ne=V.get(O.texture),Ye=K;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,Ne.__webglTexture,ne,Ye)}else if(O!==null&&ne!==0){const Ne=V.get(O.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,Ne.__webglTexture,ne)}b=-1},this.readRenderTargetPixels=function(O,K,ne,ie,J,_e,Ce){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Le=V.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Ce!==void 0&&(Le=Le[Ce]),Le){R.bindFramebuffer(w.FRAMEBUFFER,Le);try{const Ne=O.texture,Ye=Ne.format,je=Ne.type;if(!q.textureFormatReadable(Ye)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!q.textureTypeReadable(je)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}K>=0&&K<=O.width-ie&&ne>=0&&ne<=O.height-J&&w.readPixels(K,ne,ie,J,Je.convert(Ye),Je.convert(je),_e)}finally{const Ne=P!==null?V.get(P).__webglFramebuffer:null;R.bindFramebuffer(w.FRAMEBUFFER,Ne)}}},this.readRenderTargetPixelsAsync=async function(O,K,ne,ie,J,_e,Ce){if(!(O&&O.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Le=V.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Ce!==void 0&&(Le=Le[Ce]),Le){const Ne=O.texture,Ye=Ne.format,je=Ne.type;if(!q.textureFormatReadable(Ye))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!q.textureTypeReadable(je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(K>=0&&K<=O.width-ie&&ne>=0&&ne<=O.height-J){R.bindFramebuffer(w.FRAMEBUFFER,Le);const Ve=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Ve),w.bufferData(w.PIXEL_PACK_BUFFER,_e.byteLength,w.STREAM_READ),w.readPixels(K,ne,ie,J,Je.convert(Ye),Je.convert(je),0);const ut=P!==null?V.get(P).__webglFramebuffer:null;R.bindFramebuffer(w.FRAMEBUFFER,ut);const gt=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await dR(w,gt,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Ve),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,_e),w.deleteBuffer(Ve),w.deleteSync(gt),_e}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(O,K=null,ne=0){O.isTexture!==!0&&(Vr("WebGLRenderer: copyFramebufferToTexture function signature has changed."),K=arguments[0]||null,O=arguments[1]);const ie=Math.pow(2,-ne),J=Math.floor(O.image.width*ie),_e=Math.floor(O.image.height*ie),Ce=K!==null?K.x:0,Le=K!==null?K.y:0;A.setTexture2D(O,0),w.copyTexSubImage2D(w.TEXTURE_2D,ne,0,0,Ce,Le,J,_e),R.unbindTexture()};const cw=w.createFramebuffer(),uw=w.createFramebuffer();this.copyTextureToTexture=function(O,K,ne=null,ie=null,J=0,_e=null){O.isTexture!==!0&&(Vr("WebGLRenderer: copyTextureToTexture function signature has changed."),ie=arguments[0]||null,O=arguments[1],K=arguments[2],_e=arguments[3]||0,ne=null),_e===null&&(J!==0?(Vr("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),_e=J,J=0):_e=0);let Ce,Le,Ne,Ye,je,Ve,ut,gt,Gt;const Bt=O.isCompressedTexture?O.mipmaps[_e]:O.image;if(ne!==null)Ce=ne.max.x-ne.min.x,Le=ne.max.y-ne.min.y,Ne=ne.isBox3?ne.max.z-ne.min.z:1,Ye=ne.min.x,je=ne.min.y,Ve=ne.isBox3?ne.min.z:0;else{const ni=Math.pow(2,-J);Ce=Math.floor(Bt.width*ni),Le=Math.floor(Bt.height*ni),O.isDataArrayTexture?Ne=Bt.depth:O.isData3DTexture?Ne=Math.floor(Bt.depth*ni):Ne=1,Ye=0,je=0,Ve=0}ie!==null?(ut=ie.x,gt=ie.y,Gt=ie.z):(ut=0,gt=0,Gt=0);const dt=Je.convert(K.format),He=Je.convert(K.type);let rn;K.isData3DTexture?(A.setTexture3D(K,0),rn=w.TEXTURE_3D):K.isDataArrayTexture||K.isCompressedArrayTexture?(A.setTexture2DArray(K,0),rn=w.TEXTURE_2D_ARRAY):(A.setTexture2D(K,0),rn=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,K.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,K.unpackAlignment);const _t=w.getParameter(w.UNPACK_ROW_LENGTH),_i=w.getParameter(w.UNPACK_IMAGE_HEIGHT),xo=w.getParameter(w.UNPACK_SKIP_PIXELS),qn=w.getParameter(w.UNPACK_SKIP_ROWS),Ea=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,Bt.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,Bt.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,Ye),w.pixelStorei(w.UNPACK_SKIP_ROWS,je),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Ve);const Pt=O.isDataArrayTexture||O.isData3DTexture,ti=K.isDataArrayTexture||K.isData3DTexture;if(O.isDepthTexture){const ni=V.get(O),bn=V.get(K),Un=V.get(ni.__renderTarget),dd=V.get(bn.__renderTarget);R.bindFramebuffer(w.READ_FRAMEBUFFER,Un.__webglFramebuffer),R.bindFramebuffer(w.DRAW_FRAMEBUFFER,dd.__webglFramebuffer);for(let vr=0;vr{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return or(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const hp=new WeakMap,AO=(...n)=>{var e;const t=n[0],i=(e=vn())==null?void 0:e.proxy;if(i==null&&!ic())throw new Error("injectLocal must be called in setup");return i&&hp.has(i)&&t in hp.get(i)?hp.get(i)[t]:gn(...n)},lm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const CO=n=>typeof n<"u",RO=n=>n!=null,PO=Object.prototype.toString,IO=n=>PO.call(n)==="[object Object]",cm=()=>{};function LO(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}function DO(n,e={}){let t,i,s=cm;const r=l=>{clearTimeout(l),s(),s=cm};let o;return l=>{const c=et(n),u=et(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,h)=>{s=e.rejectOnCancel?h:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function ty(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function OO(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function NO(n){return vn()}function ll(n){return Array.isArray(n)?n:[n]}function UO(n,e=200,t={}){return LO(DO(e,t),n)}function ny(n,e=200,t={}){const i=Ze(n.value),s=UO(()=>{i.value=n.value},e,t);return Ge(n,()=>s()),i}function FO(n,e={}){if(!wt(n))return sb(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=eg(()=>({get(){return n.value[i]},set(s){var r;if((r=et(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}const on=et;function e_(n,e=!0,t){NO()?yn(n,t):e?n():cr(n)}function BO(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t;let r=null;const o=Ie(!1);function a(){r&&(clearInterval(r),r=null)}function l(){o.value=!1,a()}function c(){const u=et(e);u<=0||(o.value=!0,s&&n(),a(),o.value&&(r=setInterval(n,u)))}if(i&&lm&&c(),wt(e)||typeof e=="function"){const u=Ge(e,()=>{o.value&&lm&&c()});or(u)}return or(l),{isActive:o,pause:l,resume:c}}function sE(n,e,t){return Ge(n,e,{...t,immediate:!0})}const Ps=lm?window:void 0;function Ei(n){var e;const t=et(n);return(e=t==null?void 0:t.$el)!=null?e:t}function ho(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=Se(()=>{const a=ll(et(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=sE(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Ei(c)))!=null?l:[Ps].filter(c=>c!=null),ll(et(s.value?n[1]:n[0])),ll(It(s.value?n[2]:n[1])),et(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=IO(u)?{...u}:u;e.push(...a.flatMap(h=>l.flatMap(d=>c.map(p=>i(h,d,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return or(t),o}function kO(){const n=Ie(!1),e=vn();return e&&yn(()=>{n.value=!0},e),n}function td(n){const e=kO();return Se(()=>(e.value,!!n()))}function VO(n,e,t={}){const{window:i=Ps,...s}=t;let r;const o=td(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const h=et(n),d=ll(h).map(Ei).filter(RO);return new Set(d)}),c=Ge(()=>l.value,h=>{a(),o.value&&h.size&&(r=new MutationObserver(e),h.forEach(d=>r.observe(d,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return or(f),{isSupported:o,stop:f,takeRecords:u}}function t_(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:s=Ps,once:r=!1}=e,o=Ie(!1),a=Se(()=>i?1e3/et(i):null);let l=0,c=null;function u(d){if(!o.value||!s)return;l||(l=d);const p=d-l;if(a.value&&pt&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=Ie(typeof i=="number"),o=Ie(),a=Ie(!1),l=c=>{a.value=c.matches};return sc(()=>{if(r.value){r.value=!s.value;const c=et(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),h=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),d=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(h||d);return h&&p&&(p=i>=ty(h[1])),d&&p&&(p=i<=ty(d[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(et(n)),a.value=o.value.matches)}),ho(o,"change",l,{passive:!0}),Se(()=>a.value)}function GO(n){return JSON.parse(JSON.stringify(n))}function WO(n={}){const{window:e=Ps}=n,t=Ie(1),i=rE(()=>`(resolution: ${t.value}dppx)`,n);let s=cm;return e&&(s=sE(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:di(t),stop:s}}function oE(n,e,t={}){const{window:i=Ps,...s}=t;let r;const o=td(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const f=et(n);return Array.isArray(f)?f.map(h=>Ei(h)):[Ei(f)]}),c=Ge(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const h of f)h&&r.observe(h,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return or(u),{isSupported:o,stop:u}}function XO(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=Ie(0),l=Ie(0),c=Ie(0),u=Ie(0),f=Ie(0),h=Ie(0),d=Ie(0),p=Ie(0);function _(){const m=Ei(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,h.value=0,d.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,h.value=y.width,d.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return oE(n,g),Ge(()=>Ei(n),m=>!m&&g()),VO(n,g,{attributeFilter:["style","class"]}),s&&ho("scroll",g,{capture:!0,passive:!0}),i&&ho("resize",g,{passive:!0}),e_(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:p,update:g}}function $O(n,e={width:0,height:0},t={}){const{window:i=Ps,box:s="content-box"}=t,r=Se(()=>{var f,h;return(h=(f=Ei(n))==null?void 0:f.namespaceURI)==null?void 0:h.includes("svg")}),o=Ie(e.width),a=Ie(e.height),{stop:l}=oE(n,([f])=>{const h=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&r.value){const d=Ei(n);if(d){const p=d.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(h){const d=ll(h);o.value=d.reduce((p,{inlineSize:_})=>p+_,0),a.value=d.reduce((p,{blockSize:_})=>p+_,0)}else o.value=f.contentRect.width,a.value=f.contentRect.height},t);e_(()=>{const f=Ei(n);f&&(o.value="offsetWidth"in f?f.offsetWidth:e.width,a.value="offsetHeight"in f?f.offsetHeight:e.height)});const c=Ge(()=>Ei(n),f=>{o.value=f?e.width:0,a.value=f?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function qO(n){var e;const t=Ie(0);if(typeof performance>"u")return t;const i=(e=n==null?void 0:n.every)!=null?e:10;let s=performance.now(),r=0;return t_(()=>{if(r+=1,r>=i){const o=performance.now(),a=o-s;t.value=Math.round(1e3/(a/r)),s=o,r=0}}),t}function YO(n={}){const e=Ze(),t=td(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;BO(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const aE={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},jO=Object.keys(aE);function KO(n={}){const{target:e=Ps}=n,t=Ie(!1),i=Ze(n.initialValue||{});Object.assign(i.value,aE,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=OO(r,jO,!1))};if(e){const r={passive:!0};ho(e,["pointerdown","pointermove","pointerup"],s,r),ho(e,"pointerleave",()=>t.value=!1,r)}return{...FO(i),isInside:t}}function Y4(n,e,t,i={}){var s,r,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:f,shouldEmit:h}=i,d=vn(),p=t||(d==null?void 0:d.emit)||((s=d==null?void 0:d.$emit)==null?void 0:s.bind(d))||((o=(r=d==null?void 0:d.proxy)==null?void 0:r.$emit)==null?void 0:o.bind(d==null?void 0:d.proxy));let _=c;_=_||`update:${e.toString()}`;const g=x=>a?typeof a=="function"?a(x):GO(x):x,m=()=>CO(n[e])?g(n[e]):f,y=x=>{h?h(x)&&p(_,x):p(_,x)};if(l){const x=m(),v=Ze(x);let E=!1;return Ge(()=>n[e],T=>{E||(E=!0,v.value=g(T),cr(()=>E=!1))}),Ge(v,T=>{!E&&(T!==n[e]||u)&&y(T)},{deep:u}),v}else return Se({get(){return m()},set(x){y(x)}})}function ZO(n={}){const{window:e=Ps,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=Ie(t),l=Ie(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:h,scale:d}=e.visualViewport;a.value=Math.round(f*d),l.value=Math.round(h*d)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),e_(c);const u={passive:!0};if(ho("resize",c,u),e&&o==="visual"&&e.visualViewport&&ho(e.visualViewport,"resize",c,u),s){const f=rE("(orientation: portrait)");Ge(f,()=>c())}return{width:a,height:l}}var JO=Object.defineProperty,QO=(n,e,t)=>e in n?JO(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,iy=(n,e,t)=>QO(n,typeof e!="symbol"?e+"":e,t);const eN="@tresjs/core",tN="module",nN="4.3.3",iN="pnpm@9.15.5",sN="Declarative ThreeJS using Vue Components",rN="Alvaro Saburido (https://github.com/alvarosabu/)",oN="MIT",aN={type:"git",url:"git+https://github.com/Tresjs/tres.git"},lN=["vue","3d","threejs","three","threejs-vue"],cN=!1,uN={".":{types:"./dist/index.d.ts",import:"./dist/tres.js",require:"./dist/tres.umd.cjs"},"./components":{types:"./dist/src/components/index.d.ts"},"./composables":{types:"./dist/src/composables/index.d.ts"},"./types":{types:"./dist/src/types/index.d.ts"},"./utils":{types:"./dist/src/utils/index.d.ts"},"./*":"./*"},fN="./dist/tres.js",hN="./dist/tres.js",dN="./dist/index.d.ts",pN=["*.d.ts","dist"],mN={access:"public"},gN={dev:"pnpm --filter='./playground/vue' dev","dev:nuxt":"pnpm --filter='./playground/nuxt' dev",build:"vite build",test:"vitest","test:ci":"vitest run","test:ui":"vitest --ui --coverage.enabled=true",release:"release-it",coverage:"vitest run --coverage",lint:"eslint .","lint:fix":"eslint . --fix","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:serve":"vitepress serve docs","docs:preview":"vitepress preview docs","docs:contributors":"esno scripts/update-contributors.ts"},_N={three:">=0.133",vue:">=3.4"},vN={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^12.5.0"},yN={"@release-it/conventional-changelog":"^10.0.0","@stackblitz/sdk":"^1.11.0","@tresjs/cientos":"4.1.0","@tresjs/eslint-config":"^1.4.0","@types/three":"^0.173.0","@typescript-eslint/eslint-plugin":"^8.23.0","@typescript-eslint/parser":"^8.23.0","@vitejs/plugin-vue":"^5.2.1","@vitest/coverage-c8":"^0.33.0","@vitest/coverage-v8":"^3.0.5","@vitest/ui":"^3.0.5","@vue/test-utils":"^2.4.6",eslint:"^9.19.0","eslint-plugin-vue":"^9.32.0",esno:"^4.8.0",gsap:"^3.12.7",jsdom:"^26.0.0",kolorist:"^1.8.0",ohmyfetch:"^0.4.21",pathe:"^2.0.2","release-it":"^18.1.2","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-copy":"^3.5.0","rollup-plugin-visualizer":"^5.14.0",sponsorkit:"^16.3.0",three:"^0.173.0",unocss:"^65.4.3",unplugin:"^2.1.2","unplugin-vue-components":"^28.0.0",vite:"^6.1.0","vite-plugin-banner":"^0.8.0","vite-plugin-dts":"4.5.0","vite-plugin-inspect":"^10.1.0","vite-plugin-require-transform":"^1.0.21","vite-svg-loader":"^5.1.0",vitepress:"1.6.3",vitest:"3.0.5",vue:"3.5.13","vue-demi":"^0.14.10"},xN={name:eN,type:tN,version:nN,packageManager:iN,description:sN,author:rN,license:oN,repository:aN,keywords:lN,sideEffects:cN,exports:uN,main:fN,module:hN,types:dN,files:pN,publishConfig:mN,scripts:gN,peerDependencies:_N,dependencies:vN,devDependencies:yN};class bN extends Ht{constructor(...e){super(...e),iy(this,"type","HightlightMesh"),iy(this,"createTime"),this.createTime=Date.now()}onBeforeRender(){const e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}}function um(n){return typeof n>"u"}function jf(n){return Array.isArray(n)}function SN(n){return typeof n=="number"}function lE(n){return typeof n=="string"}function Xr(n){return typeof n=="function"}function Is(n){return n===Object(n)&&!jf(n)&&!Xr(n)}function Js(n){return Is(n)&&"isObject3D"in n&&!!n.isObject3D}function sy(n){return Is(n)&&"isCamera"in n&&!!n.isCamera}function MN(n){return Is(n)&&"isBufferGeometry"in n&&!!n.isBufferGeometry}function EN(n){return Is(n)&&"isMaterial"in n&&!!n.isMaterial}function TN(n){return Is(n)&&"isLight"in n&&!!n.isLight}function wN(n){return Is(n)&&"isFog"in n&&!!n.isFog}function AN(n){return Is(n)&&"isScene"in n&&!!n.isScene}function Tu(n){return Js(n)||MN(n)||EN(n)||wN(n)}function CN(n){return Is(n)&&!!n.isPrimitive}const cE=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],cE(n[t],e[t]));return Object.assign(n||{},e),n},RN="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",PN=DN(RN);function ry(n){return n&&n.nodeType===1}function wu(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const IN=/\B([A-Z])/g;function LN(n){return n.replace(IN,"-$1").toLowerCase()}function DN(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const oy=(n,e)=>{if(!e)return;const t=Array.isArray(e)?e:e.match(/([^[.\]])+/g);return t==null?void 0:t.reduce((i,s)=>i&&i[s],n)},ON=(n,e,t)=>{const i=Array.isArray(e)?e:e.match(/([^[.\]])+/g);i&&i.reduce((s,r,o)=>(s[r]===void 0&&(s[r]={}),o===i.length-1&&(s[r]=t),s[r]),n)};function uE(n,e){if(ry(n)&&ry(e)){const s=n.attributes,r=e.attributes;return s.length!==r.length?!1:Array.from(s).every(({name:o,value:a})=>e.getAttribute(o)===a)}if(n===e)return!0;if(n===null||typeof n!="object"||e===null||typeof e!="object")return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const s of t)if(!i.includes(s)||!uE(n[s],e[s]))return!1;return!0}function NN(n,e){if(!Array.isArray(n)||!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t{if(l.uuid===e)return l;for(const c of l.children){const u=s(c);if(u)return u}},r=s(n);if(!r){console.warn("Object with UUID not found in the scene.");return}let o=r;for(let l=0;lfE(i)),!(n instanceof Dh)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&i.geometry.dispose(),Array.isArray(i.material)?i.material.forEach(s=>ay(s)):i.material&&ay(i.material)}}function kN(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const cy=/-\d+$/;function VN(n,e,t){if(lE(t)){if(cy.test(t)){const r=t.replace(cy,""),{target:o,key:a}=fm(n,r);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>um(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:s}=fm(n,t);e.__tres.previousAttach=i[s],i[s]=ua(e)}else e.__tres.previousAttach=t(n,e)}function zN(n,e,t){var i,s,r;if(lE(t)){const{target:o,key:a}=fm(n,t),l=e.__tres.previousAttach;l===void 0?delete o[a]:o[a]=l,"__tresDetach"in o&&o.__tresDetach()}else(s=(i=e.__tres)==null?void 0:i.previousAttach)==null||s.call(i,n,e);(r=e.__tres)==null||delete r.previousAttach}function Hr(n,e,t){const i=n;return i.__tres={type:"unknown",eventCount:0,root:t,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},i.__tres.attach||(i.isMaterial?i.__tres.attach="material":i.isBufferGeometry?i.__tres.attach="geometry":i.isFog&&(i.__tres.attach="fog")),i}function hE(n){var e;const t=(e=n==null?void 0:n.__tres)==null?void 0:e.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function HN(n,e,t){var i;if(!Xr(n.setPixelRatio))return;let s=0;if(t&&jf(t)){const r=t;if(r.length>=2){const[o,a]=r;s=Ag.clamp(e,o,a)}}else SN(t)?s=t:s=e;s!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(s)}function GN(n,e,t,i,s){const r=[...e.__tres.objects],o=ua(e);if(n=ua(n),o===n)return!0;const a=Hr(n,e.__tres??{},s),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of r)dE(u,s),pE(u,s);o.__tres.objects=[],i.remove(e);for(const[u,f]of Object.entries(c))i.patchProp(a,u,a[u],f);t(n),i.insert(e,l);for(const u of r)i.insert(u,e);return!0}function ua(n){return CN(n)?(n.object.__tres=n.__tres,n.object):n}function dE(n,e){var t,i,s,r;const o=((t=n.__tres)==null?void 0:t.parent)||e.scene.value;n.__tres&&(n.__tres.parent=null),o&&o.__tres&&"objects"in o.__tres&&kN(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?zN(o,n,n.__tres.attach):((r=(s=n.parent)==null?void 0:s.remove)==null||r.call(s,ua(n)),n.parent=null)}function pE(n,e){var t;(t=n.traverse)==null||t.call(n,i=>{var s;e.deregisterCamera(i),(s=e.eventManager)==null||s.deregisterPointerMissedObject(i)}),e.deregisterCamera(n),hE(n)}const WN=({sizes:n})=>{const e=Ze([]),t=Se(()=>e.value[0]),i=o=>{const a=o instanceof hc?o:e.value.find(c=>c.uuid===o);if(!a)return;const l=e.value.filter(({uuid:c})=>c!==a.uuid);e.value=[a,...l]},s=(o,a=!1)=>{if(sy(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},r=o=>{if(sy(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return sc(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof $t||XN(o))&&(o instanceof $t?o.aspect=n.aspectRatio.value:(o.left=n.width.value*-.5,o.right=n.width.value*.5,o.top=n.height.value*.5,o.bottom=n.height.value*-.5),o.updateProjectionMatrix())})}),$i(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:s,deregisterCamera:r,setCameraActive:i}};function XN(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const Kf="[TresJS ▲ ■ ●] ";function $N(...n){typeof n[0]=="string"?n[0]=Kf+n[0]:n.unshift(Kf),console.error(...n)}function qN(...n){typeof n[0]=="string"?n[0]=Kf+n[0]:n.unshift(Kf),console.warn(...n)}function YN(n,e){}function mE(){return{logError:$N,logWarning:qN,logMessage:YN}}const hm=Ze({}),dm=n=>Object.assign(hm.value,n);function dp(){const n=new Map,e=new Set;let t=0,i=!1;const s=()=>{const o=Array.from(n.entries()).sort((a,l)=>{const c=a[1].priority-l[1].priority;return c===0?a[1].addI-l[1].addI:c});e.clear(),o.forEach(a=>e.add(a[0]))},r=o=>{n.delete(o),e.delete(o)};return{on:(o,a=0)=>{n.set(o,{priority:a,addI:t++});const l=()=>r(o);return or(l),i=!0,{off:l}},off:r,trigger:(...o)=>{i&&(s(),i=!1),e.forEach(a=>a(...o))},dispose:()=>{n.clear(),e.clear()},get count(){return n.size}}}function jN(){let n=!0,e=!0,t=!1;const i=new Qh(!1),s=Ze(i.running),r=Ze(!1);let o;const a=Ag.generateUUID();let l=null;const c=dp(),u=dp(),f=dp();T();let h={};function d(M){h=M}function p(M,P,b=0){switch(P){case"before":return c.on(M,b);case"render":return l||(l=M),u.dispose(),u.on(M);case"after":return f.on(M,b)}}function _(){e&&(e=!1,T(),E())}function g(){e=!0,T(),cancelAnimationFrame(o)}function m(){t=!1,T()}function y(){t=!0,T()}function x(){r.value=!0}function v(){r.value=!1}function E(){if(!n){o=requestAnimationFrame(E);return}const M=i.getDelta(),P=i.getElapsedTime(),b={camera:It(h.camera),scene:It(h.scene),renderer:It(h.renderer),raycaster:It(h.raycaster),controls:It(h.controls),invalidate:h.invalidate,advance:h.advance},S={delta:M,elapsed:P,clock:i,...b};s.value&&c.trigger(S),r.value||(u.count?u.trigger(S):l&&l(S)),s.value&&f.trigger(S),o=requestAnimationFrame(E)}function T(){const M=!e&&!t;i.running!==M&&(i.running?i.stop():i.start()),s.value=i.running}return{loopId:a,register:(M,P,b)=>p(M,P,b),start:_,stop:g,pause:y,resume:m,pauseRender:x,resumeRender:v,isRenderPaused:r,isActive:s,setContext:d,setReady:M=>n=M}}function n_(n){let e=0;return n.traverse(t=>{if(t.isMesh&&t.geometry&&t.type!=="HightlightMesh"){const i=t.geometry,s=i.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,r=i.index?i.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=i.attributes.normal?i.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a=i.attributes.uv?i.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=s+r+o+a;e+=l}}),e}function KN(n){return(n/1024).toFixed(2)}const ZN=Number.parseInt(lc.replace("dev",""));function JN(n){return n instanceof we?n:Array.isArray(n)?new we(...n):new we(n)}const Au={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Cn,toneMapping:yh,toneMappingExposure:3,shadowMap:{enabled:!0,type:dg}},flat:{toneMapping:Hi,toneMappingExposure:1}};function QN({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:s,advance:r}}){const o=Se(()=>({alpha:on(e.alpha)??!0,depth:on(e.depth),canvas:Ei(n),context:on(e.context),stencil:on(e.stencil),antialias:on(e.antialias)??!0,precision:on(e.precision),powerPreference:on(e.powerPreference),premultipliedAlpha:on(e.premultipliedAlpha),preserveDrawingBuffer:on(e.preserveDrawingBuffer),logarithmicDepthBuffer:on(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:on(e.failIfMajorPerformanceCaveat)})),a=Ie(new $u(o.value));function l(){e.renderMode==="on-demand"&&s()}Ge(o,()=>{a.value.dispose(),a.value=new $u(o.value),l()}),Ge([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),Ge(()=>e.clearColor,l);const{pixelRatio:c}=WO(),{logError:u}=mE(),f=(()=>{const d=new $u,p={shadowMap:{enabled:d.shadowMap.enabled,type:d.shadowMap.type},toneMapping:d.toneMapping,toneMappingExposure:d.toneMappingExposure,outputColorSpace:d.outputColorSpace};return d.dispose(),p})(),h=on(e.renderMode);return h==="on-demand"&&s(),h==="manual"&&setTimeout(()=>{r()},100),sc(()=>{const d=on(e.preset);d&&(d in Au||u(`Renderer Preset must be one of these: ${Object.keys(Au).join(", ")}`),cE(a.value,Au[d])),HN(a.value,c.value,on(e.dpr)),h==="always"&&(i.frames.value=Math.max(1,i.frames.value));const p=(m,y)=>{const x=on(m),v=()=>{if(d)return oy(Au[d],y)};if(x!==void 0)return x;const E=v();return E!==void 0?E:oy(f,y)},_=(m,y)=>ON(a.value,y,p(m,y));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??yh,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),ZN<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=p(e.clearColor,"clearColor");g&&a.value.setClearColor(g?JN(g):new we(0))}),$i(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function eU(n,e,t=10){const i=on(n)?ZO():$O(Se(()=>on(e).parentElement)),s=di(ny(i.width,t)),r=di(ny(i.height,t)),o=Se(()=>s.value/r.value);return{height:r,width:s,aspectRatio:o}}const tU=(n,e)=>{const t=Se(()=>e.renderer.value.domElement),i=Ie([]),{x:s,y:r}=KO({target:t});let o=0;const{width:a,height:l,top:c,left:u}=XO(t),f=({x:se,y:xe})=>{if(t.value)return{x:(se-u.value)/a.value*2-1,y:-((xe-c.value)/l.value)*2+1}},h=({x:se,y:xe})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new fe(se,xe),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},d=se=>{const xe=f({x:(se==null?void 0:se.clientX)??s.value,y:(se==null?void 0:se.clientY)??r.value});return xe?h(xe)||[]:[]},p=oi(),_=oi(),g=oi(),m=oi(),y=oi(),x=oi(),v=oi(),E=oi();function T(se){const xe={};for(const ze in se)typeof ze!="function"&&(xe[ze]=se[ze]);return xe}const M=(se,xe)=>{var ze,re,ge;const be=T(xe),W=new F(xe==null?void 0:xe.clientX,xe==null?void 0:xe.clientY,0).unproject((ze=e.camera)==null?void 0:ze.value);se.trigger({...be,intersections:i.value,unprojectedPoint:W,ray:(re=e.raycaster)==null?void 0:re.value.ray,camera:(ge=e.camera)==null?void 0:ge.value,sourceEvent:xe,delta:o,stopPropagating:!1})};let P;const b=se=>{d(se),M(g,se),P=se},S=()=>{P&&b(P)};let D,B,H;const $=se=>{var xe;D=(xe=i.value[0])==null?void 0:xe.object,o=0,B=new fe((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),M(y,se)};let ee,Z=!1;const te=se=>{var xe,ze,re;se instanceof PointerEvent&&(i.value.length===0&&M(x,se),D===((xe=i.value[0])==null?void 0:xe.object)&&(H=new fe((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),o=B==null?void 0:B.distanceTo(H),se.button===0?(M(p,se),ee===((ze=i.value[0])==null?void 0:ze.object)?Z=!0:(ee=(re=i.value[0])==null?void 0:re.object,Z=!1)):se.button===2&&M(v,se)),M(m,se))},Q=se=>{Z&&(M(_,se),ee=void 0,Z=!1)},pe=se=>M(g,se),ve=se=>M(E,se);return t.value.addEventListener("pointerup",te),t.value.addEventListener("pointerdown",$),t.value.addEventListener("pointermove",b),t.value.addEventListener("pointerleave",pe),t.value.addEventListener("dblclick",Q),t.value.addEventListener("wheel",ve),$i(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",te),t.value.removeEventListener("pointerdown",$),t.value.removeEventListener("pointermove",b),t.value.removeEventListener("pointerleave",pe),t.value.removeEventListener("dblclick",Q),t.value.removeEventListener("wheel",ve))}),{intersects:i,onClick:se=>p.on(se).off,onDblClick:se=>_.on(se).off,onContextMenu:se=>v.on(se).off,onPointerMove:se=>g.on(se).off,onPointerUp:se=>m.on(se).off,onPointerDown:se=>y.on(se).off,onPointerMissed:se=>x.on(se).off,onWheel:se=>E.on(se).off,forceUpdate:S}};function pp(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function nU(n,e,t){var i;const s=Ie(),r=Ie();n&&(s.value=n),e&&(r.value=e);const o=b=>{var S;return((S=b.__tres)==null?void 0:S.eventCount)>0},a=b=>{var S;return((S=b.children)==null?void 0:S.some(D=>a(D)))||o(b)},l=Ie(((i=s.value)==null?void 0:i.children).filter(a)||[]);function c(b,S){const D=[],B=()=>S.stopPropagating=!0;S.stopPropagation=B;for(const H of S==null?void 0:S.intersections){if(S.stopPropagating)return;S={...S,...H};const{object:$}=H;S.eventObject=$,pp($[b],S),D.push($);let ee=$.parent;for(;ee!==null&&!S.stopPropagating&&!D.includes(ee);)S.eventObject=ee,pp(ee[b],S),D.push(ee),ee=ee.parent;const Z=LN(b.slice(2));t(Z,{intersection:H,event:S})}}const{onClick:u,onDblClick:f,onContextMenu:h,onPointerMove:d,onPointerDown:p,onPointerUp:_,onPointerMissed:g,onWheel:m,forceUpdate:y}=tU(l,e);_(b=>c("onPointerUp",b)),p(b=>c("onPointerDown",b)),u(b=>c("onClick",b)),f(b=>c("onDoubleClick",b)),h(b=>c("onContextMenu",b)),m(b=>c("onWheel",b));let x=[];d(b=>{const S=b.intersections.map(({object:B})=>B),D=b.intersections;x.forEach(({object:B})=>{S.includes(B)||(b.intersections=x,c("onPointerLeave",b),c("onPointerOut",b))}),b.intersections=D,b.intersections.forEach(({object:B})=>{x.includes(B)||(c("onPointerEnter",b),c("onPointerOver",b))}),c("onPointerMove",b),x=b.intersections});const v=[];g(b=>{const S=()=>b.stopPropagating=!0;b.stopPropagation=S,v.forEach(D=>{b.stopPropagating||(b.eventObject=D,pp(D.onPointerMissed,b))}),t("pointer-missed",{event:b})});function E(b){Tu(b)&&Js(b)&&l.value.push(b)}function T(b){if(Tu(b)&&Js(b)){const S=l.value.indexOf(b);S>-1&&l.value.splice(S,1)}}function M(b){Tu(b)&&Js(b)&&b.onPointerMissed&&v.push(b)}function P(b){if(Tu(b)&&Js(b)){const S=v.indexOf(b);S>-1&&v.splice(S,1)}}return e.eventManager={forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:M,deregisterPointerMissedObject:P},{forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:M,deregisterPointerMissedObject:P}}function iU(n,e,t=100){t=t<=0?100:t;const i=oi(),s=new Set;let r=!1,o=!1,a=null;function l(){a&&clearTimeout(a),!o&&!r&&n()?(i.trigger(e),s.forEach(f=>f()),s.clear(),r=!0):!o&&!r&&(a=setTimeout(l,t))}function c(){o=!0,a&&clearTimeout(a)}l();const u=(f,...h)=>{f(...h)};return{on:f=>{if(r)return u(f,e),{off:()=>{}};{const h=i.on(f);return s.add(h.off),i.on(f)}},off:i.off,trigger:i.trigger,clear:i.clear,cancel:c}}const mp=new WeakMap;function sU(n){if(n=n||gE(),mp.has(n))return mp.get(n);const e=100,t=Date.now(),i=iU(()=>{if(Date.now()-t>=e)return!0;{const s=n.renderer.value,r=(s==null?void 0:s.domElement)||{width:0,height:0};return!!(s&&r.width>0&&r.height>0)}},n);return mp.set(n,i),i}function rU({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:s}){const r=Ie(n),o=eU(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:f}=WN({sizes:o}),h={mode:Ze(i.renderMode||"always"),priority:Ze(0),frames:Ze(0),maxFrames:60,canBeInvalidated:Se(()=>h.mode.value==="on-demand"&&h.frames.value===0)};function d(H=1){i.renderMode==="on-demand"&&(h.frames.value=Math.min(h.maxFrames,h.frames.value+H))}function p(){i.renderMode==="manual"&&(h.frames.value=1)}const{renderer:_}=QN({canvas:e,options:i,contextParts:{sizes:o,render:h,invalidate:d,advance:p}}),g={sizes:o,scene:r,camera:a,cameras:di(l),renderer:_,raycaster:Ie(new KM),controls:Ze(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:h,advance:p,extend:dm,invalidate:d,registerCamera:c,setCameraActive:f,deregisterCamera:u,loop:jN()};er("useTres",g),g.scene.value.__tres={root:g},g.loop.register(()=>{a.value&&h.frames.value>0&&(_.value.render(n,a.value),s("render",g.renderer.value)),h.priority.value=0,h.mode.value==="always"?h.frames.value=1:h.frames.value=Math.max(0,h.frames.value-1)},"render");const{on:m,cancel:y}=sU(g);g.loop.setReady(!1),g.loop.start(),m(()=>{s("ready",g),g.loop.setReady(!0),nU(n,g,s)}),$i(()=>{y(),g.loop.stop()});const x=100,v=qO({every:x}),{isSupported:E,memory:T}=YO({interval:x}),M=160;let P=performance.now();const b=({timestamp:H})=>{g.scene.value&&(g.perf.memory.allocatedMem=n_(g.scene.value)),H-P>=x&&(P=H,g.perf.fps.accumulator.push(v.value),g.perf.fps.accumulator.length>M&&g.perf.fps.accumulator.shift(),g.perf.fps.value=v.value,E.value&&T.value&&(g.perf.memory.accumulator.push(T.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>M&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce(($,ee)=>$+ee,0)/g.perf.memory.accumulator.length))};let S=0;const D=1,{pause:B}=t_(({delta:H})=>{window.__TRES__DEVTOOLS__&&(b({timestamp:performance.now()}),S+=H,S>=D&&(window.__TRES__DEVTOOLS__.cb(g),S=0))},{immediate:!0});return $i(()=>{B()}),g}function gE(){const n=gn("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}function j4(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:s,controls:r,invalidate:o,advance:a}=gE();i.setContext({camera:n,scene:e,renderer:t,raycaster:s,controls:r,invalidate:o,advance:a});function l(f,h=0){return i.register(f,"before",h)}function c(f){return i.register(f,"render")}function u(f,h=0){return i.register(f,"after",h)}return{pause:i.pause,resume:i.resume,pauseRender:i.pauseRender,resumeRender:i.resumeRender,isActive:i.isActive,onBeforeRender:l,render:c,onAfterRender:u}}const oU=oi(),aU=oi(),_E=oi(),cl=new Qh;let qu=0,Yu=0;t_(()=>{oU.trigger({delta:qu,elapsed:Yu,clock:cl}),aU.trigger({delta:qu,elapsed:Yu,clock:cl}),_E.trigger({delta:qu,elapsed:Yu,clock:cl})},{immediate:!1});_E.on(()=>{qu=cl.getDelta(),Yu=cl.getElapsedTime()});function lU(n,e={},t={}){let i=n;const s=a=>{i=a};let r=new Proxy({},{});const o={has(a,l){return l in e||l in i},get(a,l,c){return l in e?e[l](i):i[l]},set(a,l,c){const u=t[l];return u&&typeof u=="function"?u(c,i,r,s):i[l]=c,!0}};return r=new Proxy({},o),r}const{logError:uy}=mE(),fy=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],cU=n=>{const e=n.scene.value;function t(c,u,f,h){if(h||(h={}),h.args||(h.args=[]),c==="template"||PN(c))return null;let d=c.replace("Tres",""),p;if(c==="primitive"){(!Is(h.object)||wt(h.object))&&uy("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),d=h.object.type;const _={};p=lU(h.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,m,y,x)=>{GN(g,y,x,{patchProp:r,remove:s,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=hm.value[d];_||uy(`${d} is not defined on the THREE namespace. Use extend to add it to the catalog.`),p=new _(...h.args)}return p?(p.isCamera&&(h!=null&&h.position||p.position.set(3,3,3),h!=null&&h.lookAt||p.lookAt(0,0,0)),p=Hr(p,{...p.__tres,type:d,memoizedProps:h,eventCount:0,primitive:c==="primitive",attach:h.attach},n),p):null}function i(c,u){var f,h,d;if(!c)return;u=u||e;const p=c.__tres?c:Hr(c,{},n),_=u.__tres?u:Hr(u,{},n);c=ua(p),u=ua(_),c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((h=n.eventManager)==null||h.registerObject(c)),n.registerCamera(c),(d=n.eventManager)==null||d.registerPointerMissedObject(c),p.__tres.attach?VN(_,p,p.__tres.attach):Js(c)&&Js(_)&&(_.add(c),c.dispatchEvent({type:"added"})),p.__tres.parent=_,_.__tres.objects&&!_.__tres.objects.includes(p)&&_.__tres.objects.push(p)}function s(c,u){var f,h,d,p;if(!c)return;c!=null&&c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((h=n.eventManager)==null||h.deregisterObject(c)),u=um(u)?"default":u;const _=(d=c.__tres)==null?void 0:d.dispose;um(_)||(_===null?u=!1:u=_);const g=(p=c.__tres)==null?void 0:p.primitive,m=u==="default"?!g:!!u;if(c.__tres&&"objects"in c.__tres&&[...c.__tres.objects].forEach(y=>s(y,u)),m&&c.children&&[...c.children].forEach(y=>s(y,u)),dE(c,n),pE(c,n),m&&!AN(c)){if(Xr(u))u(c);else if(Xr(c.dispose))try{c.dispose()}catch{}}"__tres"in c&&delete c.__tres}function r(c,u,f,h){var d,p;if(!c)return;let _=c,g=u;if(c.__tres&&(c.__tres.memoizedProps[u]=h),u==="attach"){const v=((d=c.__tres)==null?void 0:d.parent)||c.parent;s(c),Hr(c,{attach:h},n),v&&i(c,v);return}if(u==="dispose"){c.__tres||(c=Hr(c,{},n)),c.__tres.dispose=h;return}if(Js(c)&&g==="blocks-pointer-events"){h||h===""?c[g]=h:delete c[g];return}fy.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let m=wu(g),y=_==null?void 0:_[m];if(g==="args"){const v=c,E=f??[],T=h??[],M=((p=c.__tres)==null?void 0:p.type)||c.type;M&&E.length&&!NN(E,T)&&(_=Object.assign(v,new hm.value[M](...h)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(wu(g),new Et(...h));return}if(g.includes("-")&&y===void 0){const v=g.split("-");y=v.reduce((E,T)=>E[wu(T)],_),g=v.pop(),m=g,y!=null&&y.set||(_=v.reduce((E,T)=>E[wu(T)],_))}let x=h;if(x===""&&(x=!0),Xr(y)){fy.includes(u)||(jf(x)?c[m](...x):c[m](x)),m.startsWith("on")&&Xr(x)&&(_[m]=x);return}!(y!=null&&y.set)&&!Xr(y)?_[m]=x:y.constructor===x.constructor&&y!=null&&y.copy?y==null||y.copy(x):jf(x)?y.set(...x):!y.isColor&&y.setScalar?y.setScalar(x):y.set(x),hE(c)}function o(c){var u;return((u=c==null?void 0:c.__tres)==null?void 0:u.parent)||null}function a(c){const u=Hr(new ct,{type:"Comment"},n);return u.name=c,u}function l(c){var u;const f=o(c),h=((u=f==null?void 0:f.__tres)==null?void 0:u.objects)||[],d=h.indexOf(c);return d<0||d>=h.length-1?null:h[d+1]}return{insert:i,remove:s,createElement:t,patchProp:r,parentNode:o,createText:()=>{},createComment:a,setText:()=>{},setElementText:()=>{},nextSibling:l,querySelector:()=>{},setScopeId:()=>{},cloneNode:()=>{},insertStaticContent:()=>{}}};function uU(){return vE().__VUE_DEVTOOLS_GLOBAL_HOOK__}function vE(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const fU=typeof Proxy=="function",hU="devtools-plugin:setup",dU="plugin:settings:set";let ka,pm;function pU(){var n;return ka!==void 0||(typeof window<"u"&&window.performance?(ka=!0,pm=window.performance):typeof globalThis<"u"&&!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance?(ka=!0,pm=globalThis.perf_hooks.performance):ka=!1),ka}function mU(){return pU()?pm.now():Date.now()}class gU{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const i={};if(e.settings)for(const o in e.settings){const a=e.settings[o];i[o]=a.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let r=Object.assign({},i);try{const o=localStorage.getItem(s),a=JSON.parse(o);Object.assign(r,a)}catch{}this.fallbacks={getSettings(){return r},setSettings(o){try{localStorage.setItem(s,JSON.stringify(o))}catch{}r=o},now(){return mU()}},t&&t.on(dU,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function _U(n,e){const t=n,i=vE(),s=uU(),r=fU&&t.enableEarlyProxy;if(s&&(i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))s.emit(hU,n,e);else{const o=r?new gU(t,s):null;(i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}function vU(n,e){const t=`▲ ■ ●${n}`;typeof hy=="function"?hy(t,e):console.log(t)}function hy(n,e){throw new Error(n+e)}const yE=n=>{const e={id:n.uuid,label:n.type,children:[],tags:[]};n.name!==""&&e.tags.push({label:n.name,textColor:5750629,backgroundColor:15793395});const t=n_(n);return t>0&&e.tags.push({label:`${KN(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(TN(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new we(n.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),n.type.includes("Camera")&&(e.tags.push({label:`${n.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(n.position.x)} y: ${Math.round(n.position.y)} z: ${Math.round(n.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function xE(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const s=yE(i);e.children.push(s),xE(i,s,t)})}const yU=[],Va="tres:inspector",xU=hi({sceneGraph:null});function bU(n,e){_U({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:yU,app:n},t=>{typeof t.now!="function"&&vU("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),t.addInspector({id:Va,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(Va)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(r=>{if(r.inspectorId===Va){const o=yE(e.scene.value);xE(e.scene.value,o,r.filter),xU.sceneGraph=o,r.rootNodes=[o]}});let i=null,s=null;t.on.getInspectorState(r=>{var o;if(r.inspectorId===Va){const[a]=e.scene.value.getObjectsByProperty("uuid",r.nodeId);if(!a)return;if(s&&i&&i.parent&&s.remove(i),a.isMesh){const l=FN(a);a.add(l),i=l,s=a}r.state={object:Object.entries(a).map(([l,c])=>l==="children"?{key:l,value:c.filter(u=>u.type!=="HightlightMesh")}:{key:l,value:c,editable:!0}).filter(({key:l})=>l!=="parent")},a.isScene&&(r.state={...r.state,state:[{key:"Scene Info",value:{objects:a.children.length,memory:n_(a),calls:e.renderer.value.info.render.calls,triangles:e.renderer.value.info.render.triangles,points:e.renderer.value.info.render.points,lines:e.renderer.value.info.render.lines}},{key:"Programs",value:((o=e.renderer.value.info.programs)==null?void 0:o.map(l=>({...l,programName:l.name})))||[]}]})}}),t.on.editInspectorState(r=>{r.inspectorId===Va&&UN(e.scene.value,r.nodeId,r.path,r.state.value)})})}const SU=["data-scene","data-tres"],MU=sn({__name:"TresCanvas",props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:"always"},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:["render","click","double-click","context-menu","pointer-move","pointer-up","pointer-down","pointer-enter","pointer-leave","pointer-over","pointer-out","pointer-missed","wheel","ready"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=sg(),o=Ze(),a=Ie(new Dh),l=vn();dm(wO);const c=(p,_=!1)=>sn({setup(){var g;const m=(g=vn())==null?void 0:g.appContext;m&&(m.app=l==null?void 0:l.appContext.app);const y={};function x(v){v&&(v.parent&&x(v.parent),v.provides&&Object.assign(y,v.provides))}return l!=null&&l.parent&&i.enableProvideBridge&&(x(l.parent),Reflect.ownKeys(y).forEach(v=>{er(v,y[v])})),er("useTres",p),er("extend",dm),typeof window<"u"&&bU(m==null?void 0:m.app,p),()=>Ss(Xt,null,_?[]:r.default())}}),u=(p,_=!1)=>{const g=c(p,_),{render:m}=Vb(cU(p));m(Ss(g),a.value)},f=(p,_=!1)=>{fE(p.scene.value),_&&(p.renderer.value.dispose(),p.renderer.value.renderLists.dispose(),p.renderer.value.forceContextLoss()),a.value.__tres={root:p}},h=Ie(null);e({context:h,dispose:()=>f(h.value,!0)});const d=()=>{f(h.value),u(h.value,!0)};return yn(()=>{const p=o;h.value=rU({scene:a.value,canvas:p,windowSize:i.windowSize??!1,rendererOptions:i,emit:s});const{registerCamera:_,camera:g,cameras:m,deregisterCamera:y}=h.value;u(h.value);const x=()=>{const v=new $t(45,window.innerWidth/window.innerHeight,.1,1e3);v.position.set(3,3,3),v.lookAt(0,0,0),_(v);const E=sc(()=>{m.value.length>=2&&(v.removeFromParent(),y(v),E==null||E())})};Ge(()=>i.camera,(v,E)=>{v&&_(v),E&&(E.removeFromParent(),y(E))},{immediate:!0}),g.value||x()}),$i(d),(p,_)=>(ln(),ui("canvas",{ref_key:"canvas",ref:o,"data-scene":a.value.uuid,class:ga(p.$attrs.class),"data-tres":`tresjs ${It(xN).version}`,style:mi({display:"block",width:"100%",height:"100%",position:p.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,SU))}}),EU={install(n){n.component("TresCanvas",MU)}};function gp(n){if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in n?!1:Symbol.toStringTag in n?Object.prototype.toString.call(n)==="[object Module]":!0}function mm(n,e,t=".",i){if(!gp(e))return mm(n,{},t,i);const s=Object.assign({},e);for(const r in n){if(r==="__proto__"||r==="constructor")continue;const o=n[r];o!=null&&(i&&i(s,r,o,t)||(Array.isArray(o)&&Array.isArray(s[r])?s[r]=[...o,...s[r]]:gp(o)&&gp(s[r])?s[r]=mm(o,s[r],(t?`${t}.`:"")+r.toString(),i):s[r]=o))}return s}function TU(n){return(...e)=>e.reduce((t,i)=>mm(t,i,"",n),{})}const bE=TU();function dr(n){return lh()?(Ym(n),!0):!1}function dy(){const n=new Set,e=r=>{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return dr(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const _p=new WeakMap,wU=(...n)=>{var e;const t=n[0],i=(e=vn())==null?void 0:e.proxy;if(i==null&&!ic())throw new Error("injectLocal must be called in setup");return i&&_p.has(i)&&t in _p.get(i)?_p.get(i)[t]:gn(...n)},xc=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const SE=n=>n!=null,AU=Object.prototype.toString,Zf=n=>AU.call(n)==="[object Object]",Xi=()=>{},CU=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function ME(...n){if(n.length!==1)return rb(...n);const e=n[0];return typeof e=="function"?di(eg(()=>({get:e,set:Xi}))):Ze(e)}function i_(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}const EE=n=>n();function TE(n,e={}){let t,i,s=Xi;const r=l=>{clearTimeout(l),s(),s=Xi};let o;return l=>{const c=et(n),u=et(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,h)=>{s=e.rejectOnCancel?h:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function RU(...n){let e=0,t,i=!0,s=Xi,r,o,a,l,c;!wt(n[0])&&typeof n[0]=="object"?{delay:o,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=n[0]:[o,a=!0,l=!0,c=!1]=n;const u=()=>{t&&(clearTimeout(t),t=void 0,s(),s=Xi)};return h=>{const d=et(o),p=Date.now()-e,_=()=>r=h();return u(),d<=0?(e=Date.now(),_()):(p>d&&(l||!i)?(e=Date.now(),_()):a&&(r=new Promise((g,m)=>{s=c?m:g,t=setTimeout(()=>{e=Date.now(),i=!0,g(_()),u()},Math.max(0,d-p))})),!l&&!t&&(t=setTimeout(()=>i=!0,d)),i=!1,r)}}function PU(n=EE,e={}){const{initialState:t="active"}=e,i=ME(t==="active");function s(){i.value=!1}function r(){i.value=!0}const o=(...a)=>{i.value&&n(...a)};return{isActive:di(i),pause:s,resume:r,eventFilter:o}}function IU(n){let e;function t(){return e||(e=n()),e}return t.reset=async()=>{const i=e;e=void 0,i&&await i},t}function LU(n,e){var t;if(typeof n=="number")return n+e;const i=((t=n.match(/^-?\d+\.?\d*/))==null?void 0:t[0])||"",s=n.slice(i.length),r=Number.parseFloat(i)+e;return Number.isNaN(r)?n:r+s}function ul(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function fl(n){return Array.isArray(n)?n:[n]}function wE(n){return vn()}function AE(n,e=200,t={}){return i_(TE(e,t),n)}function DU(n,e=200,t=!1,i=!0,s=!1){return i_(RU(e,t,i,s),n)}function CE(n,e,t={}){const{eventFilter:i=EE,...s}=t;return Ge(n,i_(i,e),s)}function OU(n,e,t={}){const{eventFilter:i,initialState:s="active",...r}=t,{eventFilter:o,pause:a,resume:l,isActive:c}=PU(i,{initialState:s});return{stop:CE(n,e,{...r,eventFilter:o}),pause:a,resume:l,isActive:c}}function Ma(n,e=!0,t){wE()?yn(n,t):e?n():cr(n)}function NU(n,e){wE()&&$i(n,e)}function UU(n,e,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t,r=Ie(!1);let o=null;function a(){o&&(clearTimeout(o),o=null)}function l(){r.value=!1,a()}function c(...u){s&&n(),a(),r.value=!0,o=setTimeout(()=>{r.value=!1,o=null,n(...u)},et(e))}return i&&(r.value=!0,xc&&c()),dr(l),{isPending:di(r),start:c,stop:l}}function K4(n,e,t={}){const{debounce:i=0,maxWait:s=void 0,...r}=t;return CE(n,e,{...r,eventFilter:TE(i,{maxWait:s})})}function FU(n,e,t){return Ge(n,e,{...t,immediate:!0})}const Xn=xc?window:void 0,BU=xc?window.document:void 0,s_=xc?window.navigator:void 0;function Jn(n){var e;const t=et(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Dt(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=Se(()=>{const a=fl(et(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=FU(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Jn(c)))!=null?l:[Xn].filter(c=>c!=null),fl(et(s.value?n[1]:n[0])),fl(It(s.value?n[2]:n[1])),et(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=Zf(u)?{...u}:u;e.push(...a.flatMap(h=>l.flatMap(d=>c.map(p=>i(h,d,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return dr(t),o}function kU(){const n=Ie(!1),e=vn();return e&&yn(()=>{n.value=!0},e),n}function vo(n){const e=kU();return Se(()=>(e.value,!!n()))}function RE(n,e,t={}){const{window:i=Xn,...s}=t;let r;const o=vo(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const h=et(n),d=fl(h).map(Jn).filter(SE);return new Set(d)}),c=Ge(()=>l.value,h=>{a(),o.value&&h.size&&(r=new MutationObserver(e),h.forEach(d=>r.observe(d,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return dr(f),{isSupported:o,stop:f,takeRecords:u}}const VU=Symbol("vueuse-ssr-width");function PE(){const n=ic()?wU(VU,null):null;return typeof n=="number"?n:void 0}function $r(n,e={}){const{window:t=Xn,ssrWidth:i=PE()}=e,s=vo(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=Ie(typeof i=="number"),o=Ie(),a=Ie(!1),l=c=>{a.value=c.matches};return sc(()=>{if(r.value){r.value=!s.value;const c=et(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),h=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),d=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(h||d);return h&&p&&(p=i>=ul(h[1])),d&&p&&(p=i<=ul(d[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(et(n)),a.value=o.value.matches)}),Dt(o,"change",l,{passive:!0}),Se(()=>a.value)}const Z4={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function J4(n,e={}){function t(d,p){let _=et(n[et(d)]);return p!=null&&(_=LU(_,p)),typeof _=="number"&&(_=`${_}px`),_}const{window:i=Xn,strategy:s="min-width",ssrWidth:r=PE()}=e,o=typeof r=="number",a=o?Ie(!1):{value:!0};o&&Ma(()=>a.value=!!i);function l(d,p){return!a.value&&o?d==="min"?r>=ul(p):r<=ul(p):i?i.matchMedia(`(${d}-width: ${p})`).matches:!1}const c=d=>$r(()=>`(min-width: ${t(d)})`,e),u=d=>$r(()=>`(max-width: ${t(d)})`,e),f=Object.keys(n).reduce((d,p)=>(Object.defineProperty(d,p,{get:()=>s==="min-width"?c(p):u(p),enumerable:!0,configurable:!0}),d),{});function h(){const d=Object.keys(n).map(p=>[p,f[p],ul(t(p))]).sort((p,_)=>p[2]-_[2]);return Se(()=>d.filter(([,p])=>p.value).map(([p])=>p))}return Object.assign(f,{greaterOrEqual:c,smallerOrEqual:u,greater(d){return $r(()=>`(min-width: ${t(d,.1)})`,e)},smaller(d){return $r(()=>`(max-width: ${t(d,-.1)})`,e)},between(d,p){return $r(()=>`(min-width: ${t(d)}) and (max-width: ${t(p,-.1)})`,e)},isGreater(d){return l("min",t(d,.1))},isGreaterOrEqual(d){return l("min",t(d))},isSmaller(d){return l("max",t(d,-.1))},isSmallerOrEqual(d){return l("max",t(d))},isInBetween(d,p){return l("min",t(d))&&l("max",t(p,-.1))},current:h,active(){const d=h();return Se(()=>d.value.length===0?"":d.value.at(s==="min-width"?-1:0))}})}function gm(n,e={}){const{controls:t=!1,navigator:i=s_}=e,s=vo(()=>i&&"permissions"in i),r=Ie(),o=typeof n=="string"?{name:n}:n,a=Ie(),l=()=>{var u,f;a.value=(f=(u=r.value)==null?void 0:u.state)!=null?f:"prompt"};Dt(r,"change",l,{passive:!0});const c=IU(async()=>{if(s.value){if(!r.value)try{r.value=await i.permissions.query(o)}catch{r.value=void 0}finally{l()}if(t)return ot(r.value)}});return c(),t?{state:a,isSupported:s,query:c}:a}function Q4(n={}){const{navigator:e=s_,read:t=!1,source:i,copiedDuring:s=1500,legacy:r=!1}=n,o=vo(()=>e&&"clipboard"in e),a=gm("clipboard-read"),l=gm("clipboard-write"),c=Se(()=>o.value||r),u=Ie(""),f=Ie(!1),h=UU(()=>f.value=!1,s,{immediate:!1});async function d(){let y=!(o.value&&m(a.value));if(!y)try{u.value=await e.clipboard.readText()}catch{y=!0}y&&(u.value=g())}c.value&&t&&Dt(["copy","cut"],d,{passive:!0});async function p(y=et(i)){if(c.value&&y!=null){let x=!(o.value&&m(l.value));if(!x)try{await e.clipboard.writeText(y)}catch{x=!0}x&&_(y),u.value=y,f.value=!0,h.start()}}function _(y){const x=document.createElement("textarea");x.value=y??"",x.style.position="absolute",x.style.opacity="0",document.body.appendChild(x),x.select(),document.execCommand("copy"),x.remove()}function g(){var y,x,v;return(v=(x=(y=document==null?void 0:document.getSelection)==null?void 0:y.call(document))==null?void 0:x.toString())!=null?v:""}function m(y){return y==="granted"||y==="prompt"}return{isSupported:c,text:u,copied:f,copy:p}}const Cu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ru="__vueuse_ssr_handlers__",zU=HU();function HU(){return Ru in Cu||(Cu[Ru]=Cu[Ru]||{}),Cu[Ru]}function IE(n,e){return zU[n]||e}function GU(n){return $r("(prefers-color-scheme: dark)",n)}function WU(n){return n==null?"any":n instanceof Set?"set":n instanceof Map?"map":n instanceof Date?"date":typeof n=="boolean"?"boolean":typeof n=="string"?"string":typeof n=="object"?"object":Number.isNaN(n)?"any":"number"}const XU={boolean:{read:n=>n==="true",write:n=>String(n)},object:{read:n=>JSON.parse(n),write:n=>JSON.stringify(n)},number:{read:n=>Number.parseFloat(n),write:n=>String(n)},any:{read:n=>n,write:n=>String(n)},string:{read:n=>n,write:n=>String(n)},map:{read:n=>new Map(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n.entries()))},set:{read:n=>new Set(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n))},date:{read:n=>new Date(n),write:n=>n.toISOString()}},py="vueuse-storage";function LE(n,e,t,i={}){var s;const{flush:r="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:l=!0,mergeDefaults:c=!1,shallow:u,window:f=Xn,eventFilter:h,onError:d=D=>{console.error(D)},initOnMounted:p}=i,_=(u?Ie:Ze)(typeof e=="function"?e():e),g=Se(()=>et(n));if(!t)try{t=IE("getDefaultStorage",()=>{var D;return(D=Xn)==null?void 0:D.localStorage})()}catch(D){d(D)}if(!t)return _;const m=et(e),y=WU(m),x=(s=i.serializer)!=null?s:XU[y],{pause:v,resume:E}=OU(_,()=>M(_.value),{flush:r,deep:o,eventFilter:h});Ge(g,()=>b(),{flush:r}),f&&a&&Ma(()=>{t instanceof Storage?Dt(f,"storage",b,{passive:!0}):Dt(f,py,S),p&&b()}),p||b();function T(D,B){if(f){const H={key:g.value,oldValue:D,newValue:B,storageArea:t};f.dispatchEvent(t instanceof Storage?new StorageEvent("storage",H):new CustomEvent(py,{detail:H}))}}function M(D){try{const B=t.getItem(g.value);if(D==null)T(B,null),t.removeItem(g.value);else{const H=x.write(D);B!==H&&(t.setItem(g.value,H),T(B,H))}}catch(B){d(B)}}function P(D){const B=D?D.newValue:t.getItem(g.value);if(B==null)return l&&m!=null&&t.setItem(g.value,x.write(m)),m;if(!D&&c){const H=x.read(B);return typeof c=="function"?c(H,m):y==="object"&&!Array.isArray(H)?{...m,...H}:H}else return typeof B!="string"?B:x.read(B)}function b(D){if(!(D&&D.storageArea!==t)){if(D&&D.key==null){_.value=m;return}if(!(D&&D.key!==g.value)){v();try{(D==null?void 0:D.newValue)!==x.write(_.value)&&(_.value=P(D))}catch(B){d(B)}finally{D?cr(E):E()}}}}function S(D){b(D.detail)}return _}const $U="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function qU(n={}){const{selector:e="html",attribute:t="class",initialValue:i="auto",window:s=Xn,storage:r,storageKey:o="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:l,emitAuto:c,disableTransition:u=!0}=n,f={auto:"",light:"light",dark:"dark",...n.modes||{}},h=GU({window:s}),d=Se(()=>h.value?"dark":"light"),p=l||(o==null?ME(i):LE(o,i,r,{window:s,listenToStorageChanges:a})),_=Se(()=>p.value==="auto"?d.value:p.value),g=IE("updateHTMLAttrs",(v,E,T)=>{const M=typeof v=="string"?s==null?void 0:s.document.querySelector(v):Jn(v);if(!M)return;const P=new Set,b=new Set;let S=null;if(E==="class"){const B=T.split(/\s/g);Object.values(f).flatMap(H=>(H||"").split(/\s/g)).filter(Boolean).forEach(H=>{B.includes(H)?P.add(H):b.add(H)})}else S={key:E,value:T};if(P.size===0&&b.size===0&&S===null)return;let D;u&&(D=s.document.createElement("style"),D.appendChild(document.createTextNode($U)),s.document.head.appendChild(D));for(const B of P)M.classList.add(B);for(const B of b)M.classList.remove(B);S&&M.setAttribute(S.key,S.value),u&&(s.getComputedStyle(D).opacity,document.head.removeChild(D))});function m(v){var E;g(e,t,(E=f[v])!=null?E:v)}function y(v){n.onChanged?n.onChanged(v,m):m(v)}Ge(_,y,{flush:"post",immediate:!0}),Ma(()=>y(_.value));const x=Se({get(){return c?p.value:_.value},set(v){p.value=v}});return Object.assign(x,{store:p,system:d,state:_})}function Pu(n,e,t={}){const{window:i=Xn,initialValue:s,observe:r=!1}=t,o=Ie(s),a=Se(()=>{var c;return Jn(e)||((c=i==null?void 0:i.document)==null?void 0:c.documentElement)});function l(){var c;const u=et(n),f=et(a);if(f&&i&&u){const h=(c=i.getComputedStyle(f).getPropertyValue(u))==null?void 0:c.trim();o.value=h||o.value||s}}return r&&RE(a,l,{attributeFilter:["style","class"],window:i}),Ge([a,()=>et(n)],(c,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),l()},{immediate:!0}),Ge([o,a],([c,u])=>{const f=et(n);u!=null&&u.style&&f&&(c==null?u.style.removeProperty(f):u.style.setProperty(f,c))},{immediate:!0}),o}function YU(n={}){const{valueDark:e="dark",valueLight:t=""}=n,i=qU({...n,onChanged:(o,a)=>{var l;n.onChanged?(l=n.onChanged)==null||l.call(n,o==="dark",a,o):a(o)},modes:{dark:e,light:t}}),s=Se(()=>i.system.value);return Se({get(){return i.value==="dark"},set(o){const a=o?"dark":"light";s.value===a?i.value="auto":i.value=a}})}function jU(n={}){const{navigator:e=s_,requestPermissions:t=!1,constraints:i={audio:!0,video:!0},onUpdated:s}=n,r=Ze([]),o=Se(()=>r.value.filter(p=>p.kind==="videoinput")),a=Se(()=>r.value.filter(p=>p.kind==="audioinput")),l=Se(()=>r.value.filter(p=>p.kind==="audiooutput")),c=vo(()=>e&&e.mediaDevices&&e.mediaDevices.enumerateDevices),u=Ie(!1);let f;async function h(){c.value&&(r.value=await e.mediaDevices.enumerateDevices(),s==null||s(r.value),f&&(f.getTracks().forEach(p=>p.stop()),f=null))}async function d(){const p=i.video?"camera":"microphone";if(!c.value)return!1;if(u.value)return!0;const{state:_,query:g}=gm(p,{controls:!0});if(await g(),_.value!=="granted"){let m=!0;try{f=await e.mediaDevices.getUserMedia(i)}catch{f=null,m=!1}h(),u.value=m}else u.value=!0;return u.value}return c.value&&(t&&d(),Dt(e.mediaDevices,"devicechange",h,{passive:!0}),h()),{devices:r,ensurePermissions:d,permissionGranted:u,videoInputs:o,audioInputs:a,audioOutputs:l,isSupported:c}}function KU(n,e,t={}){const{window:i=Xn,...s}=t;let r;const o=vo(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Se(()=>{const f=et(n);return Array.isArray(f)?f.map(h=>Jn(h)):[Jn(f)]}),c=Ge(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const h of f)h&&r.observe(h,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return dr(u),{isSupported:o,stop:u}}function eG(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=Ie(0),l=Ie(0),c=Ie(0),u=Ie(0),f=Ie(0),h=Ie(0),d=Ie(0),p=Ie(0);function _(){const m=Jn(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,h.value=0,d.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,h.value=y.width,d.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return KU(n,g),Ge(()=>Jn(n),m=>!m&&g()),RE(n,g,{attributeFilter:["style","class"]}),s&&Dt("scroll",g,{capture:!0,passive:!0}),i&&Dt("resize",g,{passive:!0}),Ma(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:h,x:d,y:p,update:g}}function ZU(n,e,t={}){const{root:i,rootMargin:s="0px",threshold:r=0,window:o=Xn,immediate:a=!0}=t,l=vo(()=>o&&"IntersectionObserver"in o),c=Se(()=>{const p=et(n);return fl(p).map(Jn).filter(SE)});let u=Xi;const f=Ie(a),h=l.value?Ge(()=>[c.value,Jn(i),f.value],([p,_])=>{if(u(),!f.value||!p.length)return;const g=new IntersectionObserver(e,{root:Jn(_),rootMargin:s,threshold:r});p.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=Xi}},{immediate:a,flush:"post"}):Xi,d=()=>{u(),h(),f.value=!1};return dr(d),{isSupported:l,isActive:f,pause(){u(),f.value=!1},resume(){f.value=!0},stop:d}}const JU={multiple:!0,accept:"*",reset:!1,directory:!1};function QU(n){if(!n)return null;if(n instanceof FileList)return n;const e=new DataTransfer;for(const t of n)e.items.add(t);return e.files}function tG(n={}){const{document:e=BU}=n,t=Ze(QU(n.initialFiles)),{on:i,trigger:s}=dy(),{on:r,trigger:o}=dy();let a;e&&(a=e.createElement("input"),a.type="file",a.onchange=u=>{const f=u.target;t.value=f.files,s(t.value)},a.oncancel=()=>{o()});const l=()=>{t.value=null,a&&a.value&&(a.value="",s(null))},c=u=>{if(!a)return;const f={...JU,...n,...u};a.multiple=f.multiple,a.accept=f.accept,a.webkitdirectory=f.directory,CU(f,"capture")&&(a.capture=f.capture),f.reset&&l(),a.click()};return{files:di(t),open:c,reset:l,onCancel:r,onChange:i}}const my=1;function nG(n,e={}){const{throttle:t=0,idle:i=200,onStop:s=Xi,onScroll:r=Xi,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:a={capture:!1,passive:!0},behavior:l="auto",window:c=Xn,onError:u=M=>{console.error(M)}}=e,f=Ie(0),h=Ie(0),d=Se({get(){return f.value},set(M){_(M,void 0)}}),p=Se({get(){return h.value},set(M){_(void 0,M)}});function _(M,P){var b,S,D,B;if(!c)return;const H=et(n);if(!H)return;(D=H instanceof Document?c.document.body:H)==null||D.scrollTo({top:(b=et(P))!=null?b:p.value,left:(S=et(M))!=null?S:d.value,behavior:et(l)});const $=((B=H==null?void 0:H.document)==null?void 0:B.documentElement)||(H==null?void 0:H.documentElement)||H;d!=null&&(f.value=$.scrollLeft),p!=null&&(h.value=$.scrollTop)}const g=Ie(!1),m=hi({left:!0,right:!1,top:!0,bottom:!1}),y=hi({left:!1,right:!1,top:!1,bottom:!1}),x=M=>{g.value&&(g.value=!1,y.left=!1,y.right=!1,y.top=!1,y.bottom=!1,s(M))},v=AE(x,t+i),E=M=>{var P;if(!c)return;const b=((P=M==null?void 0:M.document)==null?void 0:P.documentElement)||(M==null?void 0:M.documentElement)||Jn(M),{display:S,flexDirection:D,direction:B}=getComputedStyle(b),H=B==="rtl"?-1:1,$=b.scrollLeft;y.left=$f.value;const ee=Math.abs($*H)<=(o.left||0),Z=Math.abs($*H)+b.clientWidth>=b.scrollWidth-(o.right||0)-my;S==="flex"&&D==="row-reverse"?(m.left=Z,m.right=ee):(m.left=ee,m.right=Z),f.value=$;let te=b.scrollTop;M===c.document&&!te&&(te=c.document.body.scrollTop),y.top=teh.value;const Q=Math.abs(te)<=(o.top||0),pe=Math.abs(te)+b.clientHeight>=b.scrollHeight-(o.bottom||0)-my;S==="flex"&&D==="column-reverse"?(m.top=pe,m.bottom=Q):(m.top=Q,m.bottom=pe),h.value=te},T=M=>{var P;if(!c)return;const b=(P=M.target.documentElement)!=null?P:M.target;E(b),g.value=!0,v(M),r(M)};return Dt(n,"scroll",t?DU(T,t,!0,!1):T,a),Ma(()=>{try{const M=et(n);if(!M)return;E(M)}catch(M){u(M)}}),Dt(n,"scrollend",x,a),{x:d,y:p,isScrolling:g,arrivedState:m,directions:y,measure(){const M=et(n);c&&M&&E(M)}}}function Vs(n,e,t={}){const{window:i=Xn}=t;return LE(n,e,i==null?void 0:i.localStorage,t)}function iG(n){const e=Ie(),t=()=>{e.value&&URL.revokeObjectURL(e.value),e.value=void 0};return Ge(()=>et(n),i=>{t(),i&&(e.value=URL.createObjectURL(i))},{immediate:!0}),dr(t),di(e)}const gy="--vueuse-safe-area-top",_y="--vueuse-safe-area-right",vy="--vueuse-safe-area-bottom",yy="--vueuse-safe-area-left";function sG(){const n=Ie(""),e=Ie(""),t=Ie(""),i=Ie("");if(xc){const r=Pu(gy),o=Pu(_y),a=Pu(vy),l=Pu(yy);r.value="env(safe-area-inset-top, 0px)",o.value="env(safe-area-inset-right, 0px)",a.value="env(safe-area-inset-bottom, 0px)",l.value="env(safe-area-inset-left, 0px)",s(),Dt("resize",AE(s),{passive:!0})}function s(){n.value=Iu(gy),e.value=Iu(_y),t.value=Iu(vy),i.value=Iu(yy)}return{top:n,right:e,bottom:t,left:i,update:s}}function Iu(n){return getComputedStyle(document.documentElement).getPropertyValue(n)}function rG(n,e,t){const{window:i=Xn}={},s=Ze(null),r=Ie(),o=(...l)=>{r.value&&r.value.postMessage(...l)},a=function(){r.value&&r.value.terminate()};return i&&(r.value=new Worker(n,e),r.value.onmessage=l=>{s.value=l.data},dr(()=>{r.value&&r.value.terminate()})),{data:s,post:o,terminate:a,worker:r}}function oG(n={}){const{window:e=Xn,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=Ie(t),l=Ie(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:h,scale:d}=e.visualViewport;a.value=Math.round(f*d),l.value=Math.round(h*d)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),Ma(c);const u={passive:!0};if(Dt("resize",c,u),e&&o==="visual"&&e.visualViewport&&Dt(e.visualViewport,"resize",c,u),s){const f=$r("(orientation: portrait)");Ge(f,()=>c())}return{width:a,height:l}}const DE=1/60*1e3,eF=typeof performance<"u"?()=>performance.now():()=>Date.now(),OE=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(eF()),DE);function tF(n){let e=[],t=[],i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const f=u&&s,h=f?e:t;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),f&&s&&(i=e.length)),l},cancel:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let c=0;c(n[e]=tF(()=>Yl=!0),n),{}),ym=bc.reduce((n,e)=>{const t=nd[e];return n[e]=(i,s=!1,r=!1)=>(Yl||rF(),t.schedule(i,s,r)),n},{}),iF=bc.reduce((n,e)=>(n[e]=nd[e].cancel,n),{});bc.reduce((n,e)=>(n[e]=()=>nd[e].process(ta),n),{});const sF=n=>nd[n].process(ta),NE=n=>{Yl=!1,ta.delta=_m?DE:Math.max(Math.min(n-ta.timestamp,nF),1),ta.timestamp=n,vm=!0,bc.forEach(sF),vm=!1,Yl&&(_m=!1,OE(NE))},rF=()=>{Yl=!0,_m=!0,vm||OE(NE)},UE=()=>ta;function FE(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);sMath.min(Math.max(t,n),e),by=.001,oF=.01,aF=10,lF=.05,cF=1;function uF({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let s,r,o=1-e;o=xm(lF,cF,o),n=xm(oF,aF,n/1e3),o<1?(s=c=>{const u=c*o,f=u*n,h=u-t,d=bm(c,o),p=Math.exp(-f);return by-h/d*p},r=c=>{const f=c*o*n,h=f*t+t,d=Math.pow(o,2)*Math.pow(c,2)*n,p=Math.exp(-f),_=bm(Math.pow(c,2),o);return(-s(c)+by>0?-1:1)*((h-d)*p)/_}):(s=c=>{const u=Math.exp(-c*n),f=(c-t)*n+1;return-.001+u*f},r=c=>{const u=Math.exp(-c*n),f=(t-c)*(n*n);return u*f});const a=5/n,l=hF(s,r,a);if(n=n*1e3,isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const fF=12;function hF(n,e,t){let i=t;for(let s=1;sn[t]!==void 0)}function mF(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!Sy(n,pF)&&Sy(n,dF)){const t=uF(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function r_(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:s}=n,r=FE(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:f,isResolvedFromDuration:h}=mF(r),d=My,p=My;function _(){const g=u?-(u/1e3):0,m=t-e,y=l/(2*Math.sqrt(a*c)),x=Math.sqrt(a/c)/1e3;if(s===void 0&&(s=Math.min(Math.abs(t-e)/100,.4)),y<1){const v=bm(x,y);d=E=>{const T=Math.exp(-y*x*E);return t-T*((g+y*x*m)/v*Math.sin(v*E)+m*Math.cos(v*E))},p=E=>{const T=Math.exp(-y*x*E);return y*x*T*(Math.sin(v*E)*(g+y*x*m)/v+m*Math.cos(v*E))-T*(Math.cos(v*E)*(g+y*x*m)-v*m*Math.sin(v*E))}}else if(y===1)d=v=>t-Math.exp(-x*v)*(m+(g+x*m)*v);else{const v=x*Math.sqrt(y*y-1);d=E=>{const T=Math.exp(-y*x*E),M=Math.min(v*E,300);return t-T*((g+y*x*m)*Math.sinh(M)+v*m*Math.cosh(M))/v}}}return _(),{next:g=>{const m=d(g);if(h)o.done=g>=f;else{const y=p(g)*1e3,x=Math.abs(y)<=i,v=Math.abs(t-m)<=s;o.done=x&&v}return o.value=o.done?t:m,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}r_.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const My=n=>0,BE=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},o_=(n,e,t)=>-t*n+t*e+n,kE=(n,e)=>t=>Math.max(Math.min(t,e),n),hl=n=>n%1?Number(n.toFixed(5)):n,jl=/(-)?([\d]*\.?[\d])+/g,Sm=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,gF=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Sc(n){return typeof n=="string"}const Mc={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},dl=Object.assign(Object.assign({},Mc),{transform:kE(0,1)}),Lu=Object.assign(Object.assign({},Mc),{default:1}),a_=n=>({test:e=>Sc(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Ur=a_("deg"),pl=a_("%"),it=a_("px"),Ey=Object.assign(Object.assign({},pl),{parse:n=>pl.parse(n)/100,transform:n=>pl.transform(n*100)}),l_=(n,e)=>t=>!!(Sc(t)&&gF.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),VE=(n,e,t)=>i=>{if(!Sc(i))return i;const[s,r,o,a]=i.match(jl);return{[n]:parseFloat(s),[e]:parseFloat(r),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Kr={test:l_("hsl","hue"),parse:VE("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+pl.transform(hl(e))+", "+pl.transform(hl(t))+", "+hl(dl.transform(i))+")"},_F=kE(0,255),vp=Object.assign(Object.assign({},Mc),{transform:n=>Math.round(_F(n))}),Qs={test:l_("rgb","red"),parse:VE("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+vp.transform(n)+", "+vp.transform(e)+", "+vp.transform(t)+", "+hl(dl.transform(i))+")"};function vF(n){let e="",t="",i="",s="";return n.length>5?(e=n.substr(1,2),t=n.substr(3,2),i=n.substr(5,2),s=n.substr(7,2)):(e=n.substr(1,1),t=n.substr(2,1),i=n.substr(3,1),s=n.substr(4,1),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Mm={test:l_("#"),parse:vF,transform:Qs.transform},kn={test:n=>Qs.test(n)||Mm.test(n)||Kr.test(n),parse:n=>Qs.test(n)?Qs.parse(n):Kr.test(n)?Kr.parse(n):Mm.parse(n),transform:n=>Sc(n)?n:n.hasOwnProperty("red")?Qs.transform(n):Kr.transform(n)},zE="${c}",HE="${n}";function yF(n){var e,t,i,s;return isNaN(n)&&Sc(n)&&((t=(e=n.match(jl))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((s=(i=n.match(Sm))===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)>0}function GE(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(Sm);i&&(t=i.length,n=n.replace(Sm,zE),e.push(...i.map(kn.parse)));const s=n.match(jl);return s&&(n=n.replace(jl,HE),e.push(...s.map(Mc.parse))),{values:e,numColors:t,tokenised:n}}function WE(n){return GE(n).values}function XE(n){const{values:e,numColors:t,tokenised:i}=GE(n),s=e.length;return r=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function bF(n){const e=WE(n);return XE(n)(e.map(xF))}const Ec={test:yF,parse:WE,createTransformer:XE,getAnimatableNone:bF},SF=new Set(["brightness","contrast","saturate","opacity"]);function MF(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(jl)||[];if(!i)return n;const s=t.replace(i,"");let r=SF.has(e)?1:0;return i!==t&&(r*=100),e+"("+r+s+")"}const EF=/([a-z-]*)\(.*?\)/g,Em=Object.assign(Object.assign({},Ec),{getAnimatableNone:n=>{const e=n.match(EF);return e?e.map(MF).join(" "):n}});function yp(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function Ty({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let s=0,r=0,o=0;if(!e)s=r=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;s=yp(l,a,n+1/3),r=yp(l,a,n),o=yp(l,a,n-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const TF=(n,e,t)=>{const i=n*n,s=e*e;return Math.sqrt(Math.max(0,t*(s-i)+i))},wF=[Mm,Qs,Kr],wy=n=>wF.find(e=>e.test(n)),$E=(n,e)=>{let t=wy(n),i=wy(e),s=t.parse(n),r=i.parse(e);t===Kr&&(s=Ty(s),t=Qs),i===Kr&&(r=Ty(r),i=Qs);const o=Object.assign({},s);return a=>{for(const l in o)l!=="alpha"&&(o[l]=TF(s[l],r[l],a));return o.alpha=o_(s.alpha,r.alpha,a),t.transform(o)}},AF=n=>typeof n=="number",CF=(n,e)=>t=>e(n(t)),qE=(...n)=>n.reduce(CF);function YE(n,e){return AF(n)?t=>o_(n,e,t):kn.test(n)?$E(n,e):KE(n,e)}const jE=(n,e)=>{const t=[...n],i=t.length,s=n.map((r,o)=>YE(r,e[o]));return r=>{for(let o=0;o{const t=Object.assign(Object.assign({},n),e),i={};for(const s in t)n[s]!==void 0&&e[s]!==void 0&&(i[s]=YE(n[s],e[s]));return s=>{for(const r in i)t[r]=i[r](s);return t}};function Ay(n){const e=Ec.parse(n),t=e.length;let i=0,s=0,r=0;for(let o=0;o{const t=Ec.createTransformer(e),i=Ay(n),s=Ay(e);return i.numHSL===s.numHSL&&i.numRGB===s.numRGB&&i.numNumbers>=s.numNumbers?qE(jE(i.parsed,s.parsed),t):o=>`${o>0?e:n}`},PF=(n,e)=>t=>o_(n,e,t);function IF(n){if(typeof n=="number")return PF;if(typeof n=="string")return kn.test(n)?$E:KE;if(Array.isArray(n))return jE;if(typeof n=="object")return RF}function LF(n,e,t){const i=[],s=t||IF(n[0]),r=n.length-1;for(let o=0;ot(BE(n,e,i))}function OF(n,e){const t=n.length,i=t-1;return s=>{let r=0,o=!1;if(s<=n[0]?o=!0:s>=n[i]&&(r=i-1,o=!0),!o){let l=1;for(;ls||l===i);l++);r=l-1}const a=BE(n[r],n[r+1],s);return e[r](a)}}function ZE(n,e,{clamp:t=!0,ease:i,mixer:s}={}){const r=n.length;xy(r===e.length),xy(!i||!Array.isArray(i)||i.length===r-1),n[0]>n[r-1]&&(n=[].concat(n),e=[].concat(e),n.reverse(),e.reverse());const o=LF(e,i,s),a=r===2?DF(n,o):OF(n,o);return t?l=>a(xm(n[0],n[r-1],l)):a}const id=n=>e=>1-n(1-e),c_=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,NF=n=>e=>Math.pow(e,n),JE=n=>e=>e*e*((n+1)*e-n),UF=n=>{const e=JE(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},QE=1.525,FF=4/11,BF=8/11,kF=9/10,eT=n=>n,u_=NF(2),VF=id(u_),tT=c_(u_),nT=n=>1-Math.sin(Math.acos(n)),iT=id(nT),zF=c_(iT),f_=JE(QE),HF=id(f_),GF=c_(f_),WF=UF(QE),XF=4356/361,$F=35442/1805,qF=16061/1805,Jf=n=>{if(n===1||n===0)return n;const e=n*n;return nn<.5?.5*(1-Jf(1-n*2)):.5*Jf(n*2-1)+.5;function KF(n,e){return n.map(()=>e||tT).splice(0,n.length-1)}function ZF(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function JF(n,e){return n.map(t=>t*e)}function ju({from:n=0,to:e=1,ease:t,offset:i,duration:s=300}){const r={done:!1,value:n},o=Array.isArray(e)?e:[n,e],a=JF(i&&i.length===o.length?i:ZF(o),s);function l(){return ZE(a,o,{ease:Array.isArray(t)?t:KF(o,t)})}let c=l();return{next:u=>(r.value=c(u),r.done=u>=s,r),flipTarget:()=>{o.reverse(),c=l()}}}function QF({velocity:n=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:s=.5,modifyTarget:r}){const o={done:!1,value:e};let a=t*n;const l=e+a,c=r===void 0?l:r(l);return c!==l&&(a=c-e),{next:u=>{const f=-a*Math.exp(-u/i);return o.done=!(f>s||f<-s),o.value=o.done?c:c+f,o},flipTarget:()=>{}}}const Cy={keyframes:ju,spring:r_,decay:QF};function eB(n){if(Array.isArray(n.to))return ju;if(Cy[n.type])return Cy[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?ju:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?r_:ju}function sT(n,e,t=0){return n-e-t}function tB(n,e,t=0,i=!0){return i?sT(e+-n,e,t):e-(n-e)+t}function nB(n,e,t,i){return i?n>=e+t:n<=-t}const iB=n=>{const e=({delta:t})=>n(t);return{start:()=>ym.update(e,!0),stop:()=>iF.update(e)}};function rT(n){var e,t,{from:i,autoplay:s=!0,driver:r=iB,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:f,onComplete:h,onRepeat:d,onUpdate:p}=n,_=FE(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,m,y=0,x=_.duration,v,E=!1,T=!0,M;const P=eB(_);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(M=ZE([0,100],[i,g],{clamp:!1}),i=0,g=100);const b=P(Object.assign(Object.assign({},_),{from:i,to:g}));function S(){y++,l==="reverse"?(T=y%2===0,o=tB(o,x,c,T)):(o=sT(o,x,c),l==="mirror"&&b.flipTarget()),E=!1,d&&d()}function D(){m.stop(),h&&h()}function B($){if(T||($=-$),o+=$,!E){const ee=b.next(Math.max(0,o));v=ee.value,M&&(v=M(v)),E=T?ee.done:o<=0}p==null||p(v),E&&(y===0&&(x??(x=o)),y{f==null||f(),m.stop()}}}function oT(n,e){return e?n*(1e3/e):0}function sB({from:n=0,velocity:e=0,min:t,max:i,power:s=.8,timeConstant:r=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:f,onComplete:h,onStop:d}){let p;function _(x){return t!==void 0&&xi}function g(x){return t===void 0?i:i===void 0||Math.abs(t-x){var E;f==null||f(v),(E=x.onUpdate)===null||E===void 0||E.call(x,v)},onComplete:h,onStop:d}))}function y(x){m(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},x))}if(_(n))y({from:n,velocity:e,to:g(n)});else{let x=s*e+n;typeof c<"u"&&(x=c(x));const v=g(x),E=v===t?-1:1;let T,M;const P=b=>{T=M,M=b,e=oT(b-T,UE().delta),(E===1&&b>v||E===-1&&bp==null?void 0:p.stop()}}const aT=(n,e)=>1-3*e+3*n,lT=(n,e)=>3*e-6*n,cT=n=>3*n,Qf=(n,e,t)=>((aT(e,t)*n+lT(e,t))*n+cT(e))*n,uT=(n,e,t)=>3*aT(e,t)*n*n+2*lT(e,t)*n+cT(e),rB=1e-7,oB=10;function aB(n,e,t,i,s){let r,o,a=0;do o=e+(t-e)/2,r=Qf(o,i,s)-n,r>0?t=o:e=o;while(Math.abs(r)>rB&&++a=cB?uB(o,f,n,t):h===0?f:aB(o,a,a+Du,n,t)}return o=>o===0||o===1?o:Qf(r(o),e,i)}const bs={},xp={};class hB{constructor(){ii(this,"subscriptions",new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,i){if(this.subscriptions.size)for(const s of this.subscriptions)s(e,t,i)}clear(){this.subscriptions.clear()}}function Ry(n){return!Number.isNaN(Number.parseFloat(n))}class dB{constructor(e){ii(this,"current");ii(this,"prev");ii(this,"timeDelta",0);ii(this,"lastUpdated",0);ii(this,"updateSubscribers",new hB);ii(this,"stopAnimation");ii(this,"canTrackVelocity",!1);ii(this,"updateAndNotify",e=>{this.prev=this.current,this.current=e;const{delta:t,timestamp:i}=UE();this.lastUpdated!==i&&(this.timeDelta=t,this.lastUpdated=i),ym.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});ii(this,"scheduleVelocityCheck",()=>ym.postRender(this.velocityCheck));ii(this,"velocityCheck",({timestamp:e})=>{this.canTrackVelocity||(this.canTrackVelocity=Ry(this.current)),e!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=e,this.canTrackVelocity=Ry(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?oT(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{const{stop:i}=e(t);this.stopAnimation=i}).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 pB(n){return new dB(n)}const{isArray:mB}=Array;function gB(){const n=Ze({}),e=i=>{const s=r=>{n.value[r]&&(n.value[r].stop(),n.value[r].destroy(),delete n.value[r])};i?mB(i)?i.forEach(s):s(i):Object.keys(n.value).forEach(s)},t=(i,s,r)=>{if(n.value[i])return n.value[i];const o=pB(s);return o.onChange(a=>r[i]=a),n.value[i]=o,o};return NU(e),{motionValues:n,get:t,stop:e}}function _B(n){return Array.isArray(n)}function Fr(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function bp(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function vB(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function Sp(){return{type:"keyframes",ease:"linear",duration:300}}function yB(n){return{type:"keyframes",duration:800,values:n}}const Py={default:vB,x:Fr,y:Fr,z:Fr,rotate:Fr,rotateX:Fr,rotateY:Fr,rotateZ:Fr,scaleX:bp,scaleY:bp,scale:bp,backgroundColor:Sp,color:Sp,opacity:Sp};function fT(n,e){let t;return _B(e)?t=yB:t=Py[n]||Py.default,{to:e,...t(e)}}const Iy={...Mc,transform:Math.round},hT={color:kn,backgroundColor:kn,outlineColor:kn,fill:kn,stroke:kn,borderColor:kn,borderTopColor:kn,borderRightColor:kn,borderBottomColor:kn,borderLeftColor:kn,borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:Ur,rotateX:Ur,rotateY:Ur,rotateZ:Ur,scale:Lu,scaleX:Lu,scaleY:Lu,scaleZ:Lu,skew:Ur,skewX:Ur,skewY:Ur,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:dl,originX:Ey,originY:Ey,originZ:it,zIndex:Iy,filter:Em,WebkitFilter:Em,fillOpacity:dl,strokeOpacity:dl,numOctaves:Iy},h_=n=>hT[n];function Tm(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function xB(n,e){let t=h_(n);return t!==Em&&(t=Ec),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const bB={linear:eT,easeIn:u_,easeInOut:tT,easeOut:VF,circIn:nT,circInOut:zF,circOut:iT,backIn:f_,backInOut:GF,backOut:HF,anticipate:WF,bounceIn:YF,bounceInOut:jF,bounceOut:Jf};function Ly(n){if(Array.isArray(n)){const[e,t,i,s]=n;return fB(e,t,i,s)}else if(typeof n=="string")return bB[n];return n}function SB(n){return Array.isArray(n)&&typeof n[0]!="number"}function Dy(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Ec.test(e)&&!e.startsWith("url("))}function MB(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function EB({ease:n,times:e,delay:t,...i}){const s={...i};return e&&(s.offset=e),n&&(s.ease=SB(n)?n.map(Ly):Ly(n)),t&&(s.elapsed=-t),s}function TB(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),MB(e),wB(n)||(n={...n,...fT(t,e.to)}),{...e,...EB(n)}}function wB({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:s,...r}){return!!Object.keys(r).length}function AB(n,e){return n[e]||n.default||n}function CB(n,e,t,i,s){const r=AB(i,n);let o=r.from===null||r.from===void 0?e.get():r.from;const a=Dy(n,t);o==="none"&&a&&typeof t=="string"&&(o=xB(n,t));const l=Dy(n,o);function c(f){const h={from:o,to:t,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:d=>e.set(d)};return r.type==="inertia"||r.type==="decay"?sB({...h,...r}):rT({...TB(r,h,n),onUpdate:d=>{h.onUpdate(d),r.onUpdate&&r.onUpdate(d)},onComplete:()=>{s&&s(),f&&f()}})}function u(f){return e.set(t),s&&s(),f&&f(),{stop:()=>{}}}return!l||!a||r.type===!1?u:c}function RB(){const{motionValues:n,stop:e,get:t}=gB();return{motionValues:n,stop:e,push:(s,r,o,a={},l)=>{const c=o[s],u=t(s,c,o);if(a&&a.immediate){u.set(r);return}const f=CB(s,u,r,a,l);u.start(f)}}}function PB(n,e={},{motionValues:t,push:i,stop:s}=RB()){const r=It(e),o=Ze(!1);Ge(t,f=>{o.value=Object.values(f).filter(h=>h.isAnimating()).length>0},{immediate:!0,deep:!0});const a=f=>{if(!r||!r[f])throw new Error(`The variant ${f} does not exist.`);return r[f]},l=f=>{typeof f=="string"&&(f=a(f));const h=Object.entries(f).map(([p,_])=>{if(p!=="transition")return new Promise(g=>i(p,_,n,f.transition||fT(p,f[p]),g))}).filter(Boolean);async function d(){var p,_;await Promise.all(h),(_=(p=f.transition)==null?void 0:p.onComplete)==null||_.call(p)}return Promise.all([d()])};return{isAnimating:o,apply:l,set:f=>{const h=Zf(f)?f:a(f);Object.entries(h).forEach(([d,p])=>{d!=="transition"&&i(d,p,n,{immediate:!0})})},leave:async f=>{let h;if(r&&(r.leave&&(h=r.leave),!r.leave&&r.initial&&(h=r.initial)),!h){f();return}await l(h),f()},stop:s}}const d_=typeof window<"u",IB=()=>d_&&(window.onpointerdown===null||(bs==null?void 0:bs.TEST)),LB=()=>d_&&(window.ontouchstart===null||(bs==null?void 0:bs.TEST)),DB=()=>d_&&(window.onmousedown===null||(bs==null?void 0:bs.TEST));function OB({target:n,state:e,variants:t,apply:i}){const s=It(t),r=Ze(!1),o=Ze(!1),a=Ze(!1),l=Se(()=>{let u=[...Object.keys(e.value||{})];return s&&(s.hovered&&(u=[...u,...Object.keys(s.hovered)]),s.tapped&&(u=[...u,...Object.keys(s.tapped)]),s.focused&&(u=[...u,...Object.keys(s.focused)])),u}),c=Se(()=>{const u={};Object.assign(u,e.value),r.value&&s.hovered&&Object.assign(u,s.hovered),o.value&&s.tapped&&Object.assign(u,s.tapped),a.value&&s.focused&&Object.assign(u,s.focused);for(const f in u)l.value.includes(f)||delete u[f];return u});s.hovered&&(Dt(n,"mouseenter",()=>r.value=!0),Dt(n,"mouseleave",()=>{r.value=!1,o.value=!1})),s.tapped&&(DB()&&(Dt(n,"mousedown",()=>o.value=!0),Dt(n,"mouseup",()=>o.value=!1)),IB()&&(Dt(n,"pointerdown",()=>o.value=!0),Dt(n,"pointerup",()=>o.value=!1)),LB()&&(Dt(n,"touchstart",()=>o.value=!0),Dt(n,"touchend",()=>o.value=!1))),s.focused&&(Dt(n,"focus",()=>a.value=!0),Dt(n,"blur",()=>a.value=!1)),Ge([r,o,a],()=>{i(c.value)})}function NB({set:n,target:e,variants:t,variant:i}){const s=It(t);Ge(()=>e,()=>{s&&(s.initial&&(n("initial"),i.value="initial"),s.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function UB({state:n,apply:e}){Ge(n,t=>{t&&e(t)},{immediate:!0})}function dT({target:n,variants:e,variant:t}){const i=It(e);i&&(i.visible||i.visibleOnce)&&ZU(n,([{isIntersecting:s}])=>{i.visible?s?t.value="visible":t.value="initial":i.visibleOnce&&(s&&t.value!=="visibleOnce"?t.value="visibleOnce":t.value||(t.value="initial"))})}function FB(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&NB(n),e.syncVariants&&UB(n),e.visibilityHooks&&dT(n),e.eventListeners&&OB(n)}function pT(n={}){const e=hi({...n}),t=Ze({});return Ge(e,()=>{const i={};for(const[s,r]of Object.entries(e)){const o=h_(s),a=Tm(r,o);i[s]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function p_(n,e){Ge(()=>Jn(n),t=>{t&&e(t)},{immediate:!0})}const BB={x:"translateX",y:"translateY",z:"translateZ"};function mT(n={},e=!0){const t=hi({...n}),i=Ze("");return Ge(t,s=>{let r="",o=!1;if(e&&(s.x||s.y||s.z)){const a=[s.x||0,s.y||0,s.z||0].map(l=>Tm(l,it)).join(",");r+=`translate3d(${a}) `,o=!0}for(const[a,l]of Object.entries(s)){if(e&&(a==="x"||a==="y"||a==="z"))continue;const c=h_(a),u=Tm(l,c);r+=`${BB[a]||a}(${u}) `}e&&!o&&(r+="translateZ(0px) "),i.value=r.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const kB=["","X","Y","Z"],VB=["perspective","translate","scale","rotate","skew"],gT=["transformPerspective","x","y","z"];VB.forEach(n=>{kB.forEach(e=>{const t=n+e;gT.push(t)})});const zB=new Set(gT);function m_(n){return zB.has(n)}const HB=new Set(["originX","originY","originZ"]);function _T(n){return HB.has(n)}function GB(n){const e={},t={};return Object.entries(n).forEach(([i,s])=>{m_(i)||_T(i)?e[i]=s:t[i]=s}),{transform:e,style:t}}function sd(n){const{transform:e,style:t}=GB(n),{transform:i}=mT(e),{style:s}=pT(t);return i.value&&(s.value.transform=i.value),s.value}function WB(n,e){let t,i;const{state:s,style:r}=pT();return p_(n,o=>{i=o;for(const a of Object.keys(hT))o.style[a]===null||o.style[a]===""||m_(a)||_T(a)||(s[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e&&e(s)}),Ge(r,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:s}}function XB(n){const e=n.trim().split(/\) |\)/);if(e.length===1)return{};const t=i=>i.endsWith("px")||i.endsWith("deg")?Number.parseFloat(i):Number.isNaN(Number(i))?Number(i):i;return e.reduce((i,s)=>{if(!s)return i;const[r,o]=s.split("("),l=o.split(",").map(u=>t(u.endsWith(")")?u.replace(")",""):u.trim())),c=l.length===1?l[0]:l;return{...i,[r]:c}},{})}function $B(n,e){Object.entries(XB(e)).forEach(([t,i])=>{const s=["x","y","z"];if(t==="translate3d"){if(i===0){s.forEach(r=>n[r]=0);return}i.forEach((r,o)=>n[s[o]]=r);return}if(i=Number.parseFloat(`${i}`),t==="translateX"){n.x=i;return}if(t==="translateY"){n.y=i;return}if(t==="translateZ"){n.z=i;return}n[t]=i})}function qB(n,e){let t,i;const{state:s,transform:r}=mT();return p_(n,o=>{i=o,o.style.transform&&$B(s,o.style.transform),t&&(o.style.transform=t),e&&e(s)}),Ge(r,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:s}}function YB(n){return Object.entries(n)}function jB(n,e){const t=hi({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:s}=WB(n,i),{transform:r}=qB(n,i);return Ge(t,o=>{YB(o).forEach(([a,l])=>{const c=m_(a)?r:s;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),p_(n,()=>e),{motionProperties:t,style:s,transform:r}}function KB(n={}){const e=It(n),t=Ze();return{state:Se(()=>{if(t.value)return e[t.value]}),variant:t}}function vT(n,e={},t){const{motionProperties:i}=jB(n),{variant:s,state:r}=KB(e),o=PB(i,e),a={target:n,variant:s,variants:e,state:r,motionProperties:i,...o};return FB(a,t),a}const yT=["delay","duration"],ZB=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...yT];function JB(n){return yT.includes(n)}function QB(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&Zf(t.variants)&&(e.value={...e.value,...t.variants});for(let i of ZB)if(!(!t||!t[i])){if(JB(i)&&typeof t[i]=="number"){for(const s of["enter","visible","visibleOnce"]){const r=e.value[s];r!=null&&(r.transition??(r.transition={}),r.transition[i]=t[i])}continue}if(Zf(t[i])){const s=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=s}}}}function Mp(n,e=!1){return{created:(s,r,o)=>{const a=r.value&&typeof r.value=="string"?r.value:o.key;a&&xp[a]&&xp[a].stop();const l=e?structuredClone(ot(n)||{}):n||{},c=Ze(l);typeof r.value=="object"&&(c.value=r.value),QB(o,c);const f=vT(s,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});s.motionInstance=f,a&&(xp[a]=f)},mounted:(s,r,o)=>{s.motionInstance&&dT(s.motionInstance)},getSSRProps(s,r){let{initial:o}=s.value||r&&(r==null?void 0:r.props)||{};o=It(o);const a=bE({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:sd(a)}}}}const ek={initial:{opacity:0},enter:{opacity:1}},tk={initial:{opacity:0},visible:{opacity:1}},nk={initial:{opacity:0},visibleOnce:{opacity:1}},ik={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},sk={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},rk={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},ok={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},ak={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},lk={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},ck={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},uk={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},fk={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},hk={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},dk={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},pk={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},mk={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},gk={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},_k={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},vk={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},yk={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},xk={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},bk={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Sk={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},Mk={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},Ek={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},Tk={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},wk={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Ak={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Ck={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Rk={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},eh={__proto__:null,fade:ek,fadeVisible:tk,fadeVisibleOnce:nk,pop:ik,popVisible:sk,popVisibleOnce:rk,rollBottom:mk,rollLeft:ok,rollRight:ck,rollTop:hk,rollVisibleBottom:gk,rollVisibleLeft:ak,rollVisibleOnceBottom:_k,rollVisibleOnceLeft:lk,rollVisibleOnceRight:fk,rollVisibleOnceTop:pk,rollVisibleRight:uk,rollVisibleTop:dk,slideBottom:Ak,slideLeft:vk,slideRight:bk,slideTop:Ek,slideVisibleBottom:Ck,slideVisibleLeft:yk,slideVisibleOnceBottom:Rk,slideVisibleOnceLeft:xk,slideVisibleOnceRight:Mk,slideVisibleOnceTop:wk,slideVisibleRight:Sk,slideVisibleTop:Tk};function Pk(n){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",t="aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------",i=new RegExp(e.split("").join("|"),"g");return n.toString().replace(/[A-Z]/g,s=>`-${s}`).toLowerCase().replace(/\s+/g,"-").replace(i,s=>t.charAt(e.indexOf(s))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const xT=Symbol(""),bT={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function Ik(n){return Object.prototype.toString.call(n)==="[object Object]"}function wm(n){if(Array.isArray(n))return n.map(wm);if(Ik(n)){const e={};for(const t in n)e[t]=wm(n[t]);return e}return n}function ST(n){const e=hi({}),t=gn(xT,{}),i=Se(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(ot(t)[n.preset]):n.preset in eh?structuredClone(eh[n.preset]):{}),s=Se(()=>({initial:n.initial,enter:n.enter,leave:n.leave,visible:n.visible,visibleOnce:n.visibleOnce,hovered:n.hovered,tapped:n.tapped,focused:n.focused}));function r(l,c){for(const u of["delay","duration"]){if(c[u]==null)continue;const f=Number.parseInt(c[u]);for(const h of["enter","visible","visibleOnce"]){const d=l[h];d!=null&&(d.transition??(d.transition={}),d.transition[u]=f)}}return l}const o=Se(()=>{const l=bE({},s.value,i.value,n.variants||{});return r({...l},n)});function a(l,c,u){var h;l.props??(l.props={}),(h=l.props).style??(h.style={}),l.props.style={...l.props.style,...u};const f=r(wm(o.value),l.props);return l.props.onVnodeMounted=({el:d})=>{e[c]=vT(d,f)},l.props.onVnodeUpdated=({el:d})=>{const p=sd(e[c].state);for(const[_,g]of Object.entries(p))d.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const Lk=sn({name:"Motion",props:{...bT,is:{type:[String,Object],default:"div"}},setup(n){const e=sg(),{motionConfig:t,setNodeInstance:i}=ST(n);return()=>{const s=sd(t.value.initial||{}),r=Ss(n.is,void 0,e);return i(r,0,s),r}}}),Dk=sn({name:"MotionGroup",props:{...bT,is:{type:[String,Object],required:!1}},setup(n){const e=sg(),{motionConfig:t,setNodeInstance:i}=ST(n);return()=>{var o;const s=sd(t.value.initial||{}),r=((o=e.default)==null?void 0:o.call(e))||[];for(let a=0;a
'};t.configure=function(p){var _,g;for(_ in p)g=p[_],g!==void 0&&p.hasOwnProperty(_)&&(i[_]=g);return this},t.status=null,t.set=function(p){var _=t.isStarted();p=s(p,i.minimum,1),t.status=p===1?null:p;var g=t.render(!_),m=g.querySelector(i.barSelector),y=i.speed,x=i.easing;return g.offsetWidth,a(function(v){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(m,o(p,y,x)),p===1?(l(g,{transition:"none",opacity:1}),g.offsetWidth,setTimeout(function(){l(g,{transition:"all "+y+"ms linear",opacity:0}),setTimeout(function(){t.remove(),v()},y)},y)):setTimeout(v,y)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},i.trickleSpeed)};return i.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var _=t.status;return _?(typeof p!="number"&&(p=(1-_)*s(Math.random()*_,.1,.95)),_=s(_+p,0,.994),t.set(_)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var p=0,_=0;t.promise=function(g){return!g||g.state()==="resolved"?this:(_===0&&t.start(),p++,_++,g.always(function(){_--,_===0?(p=0,t.done()):t.set((p-_)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var _=document.createElement("div");_.id="nprogress",_.innerHTML=i.template;var g=_.querySelector(i.barSelector),m=p?"-100":r(t.status||0),y=document.querySelector(i.parent),x;return l(g,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(x=_.querySelector(i.spinnerSelector),x&&d(x)),y!=document.body&&u(y,"nprogress-custom-parent"),y.appendChild(_),_},t.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(i.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&d(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,_="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return _+"Perspective"in p?"translate3d":_+"Transform"in p?"translate":"margin"};function s(p,_,g){return p<_?_:p>g?g:p}function r(p){return(-1+p)*100}function o(p,_,g){var m;return i.positionUsing==="translate3d"?m={transform:"translate3d("+r(p)+"%,0,0)"}:i.positionUsing==="translate"?m={transform:"translate("+r(p)+"%,0)"}:m={"margin-left":r(p)+"%"},m.transition="all "+_+"ms "+g,m}var a=function(){var p=[];function _(){var g=p.shift();g&&g(_)}return function(g){p.push(g),p.length==1&&_()}}(),l=function(){var p=["Webkit","O","Moz","ms"],_={};function g(v){return v.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(E,T){return T.toUpperCase()})}function m(v){var E=document.body.style;if(v in E)return v;for(var T=p.length,M=v.charAt(0).toUpperCase()+v.slice(1),P;T--;)if(P=p[T]+M,P in E)return P;return v}function y(v){return v=g(v),_[v]||(_[v]=m(v))}function x(v,E,T){E=y(E),v.style[E]=T}return function(v,E){var T=arguments,M,P;if(T.length==2)for(M in E)P=E[M],P!==void 0&&E.hasOwnProperty(M)&&x(v,M,P);else x(v,T[1],T[2])}}();function c(p,_){var g=typeof p=="string"?p:h(p);return g.indexOf(" "+_+" ")>=0}function u(p,_){var g=h(p),m=g+_;c(g,_)||(p.className=m.substring(1))}function f(p,_){var g=h(p),m;c(p,_)&&(m=g.replace(" "+_+" "," "),p.className=m.substring(1,m.length-1))}function h(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function d(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})}(Zu)),Zu.exports}var Bk=Fk();const MT=Nk(Bk);/*! * pinia v3.0.1 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let ET;const sd=n=>ET=n,TT=Symbol();function Am(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var ml;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(ml||(ml={}));function kk(){const n=qm(!0),e=n.run(()=>Ze({}));let t=[],i=[];const r=Qm({install(s){sd(r),r._a=s,s.provide(TT,r),s.config.globalProperties.$pinia=r,i.forEach(o=>t.push(o)),i=[]},use(s){return this._a?t.push(s):i.push(s),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return r}const wT=()=>{};function Ny(n,e,t,i=wT){n.push(e);const r=()=>{const s=n.indexOf(e);s>-1&&(n.splice(s,1),i())};return!t&&lh()&&Ym(r),r}function Vo(n,...e){n.slice().forEach(t=>{t(...e)})}const Vk=n=>n(),Uy=Symbol(),Ep=Symbol();function Cm(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],r=n[t];Am(r)&&Am(i)&&n.hasOwnProperty(t)&&!wt(i)&&!vr(i)?n[t]=Cm(r,i):n[t]=i}return n}const zk=Symbol();function Hk(n){return!Am(n)||!n.hasOwnProperty(zk)}const{assign:Gr}=Object;function Gk(n){return!!(wt(n)&&n.effect)}function Wk(n,e,t,i){const{state:r,actions:s,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=r?r():{});const u=rb(t.state.value[n]);return Gr(u,s,Object.keys(o||{}).reduce((f,h)=>(f[h]=Qm(Se(()=>{sd(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=AT(n,c,e,t,i,!0),l}function AT(n,e,t={},i,r,s){let o;const a=Gr({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;const p=i.state.value[n];!s&&!p&&(i.state.value[n]={}),Ze({});let _;function g(P){let b;c=u=!1,typeof P=="function"?(P(i.state.value[n]),b={type:ml.patchFunction,storeId:n,events:d}):(Cm(i.state.value[n],P),b={type:ml.patchObject,payload:P,storeId:n,events:d});const S=_=Symbol();cs().then(()=>{_===S&&(c=!0)}),u=!0,Vo(f,b,i.state.value[n])}const m=s?function(){const{state:b}=t,S=b?b():{};this.$patch(D=>{Gr(D,S)})}:wT;function y(){o.stop(),f=[],h=[],i._s.delete(n)}const x=(P,b="")=>{if(Uy in P)return P[Ep]=b,P;const S=function(){sd(i);const D=Array.from(arguments),B=[],H=[];function $(te){B.push(te)}function ee(te){H.push(te)}Vo(h,{args:D,name:S[Ep],store:E,after:$,onError:ee});let Z;try{Z=P.apply(this&&this.$id===n?this:E,D)}catch(te){throw Vo(H,te),te}return Z instanceof Promise?Z.then(te=>(Vo(B,te),te)).catch(te=>(Vo(H,te),Promise.reject(te))):(Vo(B,Z),Z)};return S[Uy]=!0,S[Ep]=b,S},v={_p:i,$id:n,$onAction:Ny.bind(null,h),$patch:g,$reset:m,$subscribe(P,b={}){const S=Ny(f,P,b.detached,()=>D()),D=o.run(()=>Ge(()=>i.state.value[n],B=>{(b.flush==="sync"?u:c)&&P({storeId:n,type:ml.direct,events:d},B)},Gr({},l,b)));return S},$dispose:y},E=hi(v);i._s.set(n,E);const M=(i._a&&i._a.runWithContext||Vk)(()=>i._e.run(()=>(o=qm()).run(()=>e({action:x}))));for(const P in M){const b=M[P];if(wt(b)&&!Gk(b)||vr(b))s||(p&&Hk(b)&&(wt(b)?b.value=p[P]:Cm(b,p[P])),i.state.value[n][P]=b);else if(typeof b=="function"){const S=x(b,P);M[P]=S,a.actions[P]=b}}return Gr(E,M),Gr(ot(E),M),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(b=>{Gr(b,P)})}}),i._p.forEach(P=>{Gr(E,o.run(()=>P({store:E,app:i._a,pinia:i,options:a})))}),p&&s&&t.hydrate&&t.hydrate(E.$state,p),c=!0,u=!0,E}/*! #__NO_SIDE_EFFECTS__ */function Xk(n,e,t){let i;const r=typeof e=="function";i=r?t:e;function s(o,a){const l=ic();return o=o||(l?gn(TT,null):null),o&&sd(o),o=ET,o._s.has(n)||(r?AT(n,e,i,o):Wk(n,i,o)),o._s.get(n)}return s.$id=n,s}function $k(n){const e=ot(n),t={};for(const i in e){const r=e[i];r.effect?t[i]=Se({get:()=>n[i],set(s){n[i]=s}}):(wt(r)||vr(r))&&(t[i]=sb(n,i))}return t}const qk=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>vt(()=>import("./default-DGYx1wbw.js"),__vite__mapDeps([0,1,2])),"/src/layouts/stage.vue":()=>vt(()=>import("./stage-C7eW1fiM.js"),[])})).forEach(([r,s])=>{let o=r.replace("/src/layouts/","").replace(".vue","");e[o]=s});function i(r,s=!0){return r.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)),s){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 ET;const rd=n=>ET=n,TT=Symbol();function Am(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var ml;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(ml||(ml={}));function kk(){const n=qm(!0),e=n.run(()=>Ze({}));let t=[],i=[];const s=Qm({install(r){rd(s),s._a=r,r.provide(TT,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 wT=()=>{};function Ny(n,e,t,i=wT){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&lh()&&Ym(s),s}function Vo(n,...e){n.slice().forEach(t=>{t(...e)})}const Vk=n=>n(),Uy=Symbol(),Ep=Symbol();function Cm(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];Am(s)&&Am(i)&&n.hasOwnProperty(t)&&!wt(i)&&!vs(i)?n[t]=Cm(s,i):n[t]=i}return n}const zk=Symbol();function Hk(n){return!Am(n)||!n.hasOwnProperty(zk)}const{assign:Gs}=Object;function Gk(n){return!!(wt(n)&&n.effect)}function Wk(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=sb(t.state.value[n]);return Gs(u,r,Object.keys(o||{}).reduce((f,h)=>(f[h]=Qm(Se(()=>{rd(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=AT(n,c,e,t,i,!0),l}function AT(n,e,t={},i,s,r){let o;const a=Gs({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),Ze({});let _;function g(P){let b;c=u=!1,typeof P=="function"?(P(i.state.value[n]),b={type:ml.patchFunction,storeId:n,events:d}):(Cm(i.state.value[n],P),b={type:ml.patchObject,payload:P,storeId:n,events:d});const S=_=Symbol();cr().then(()=>{_===S&&(c=!0)}),u=!0,Vo(f,b,i.state.value[n])}const m=r?function(){const{state:b}=t,S=b?b():{};this.$patch(D=>{Gs(D,S)})}:wT;function y(){o.stop(),f=[],h=[],i._s.delete(n)}const x=(P,b="")=>{if(Uy in P)return P[Ep]=b,P;const S=function(){rd(i);const D=Array.from(arguments),B=[],H=[];function $(te){B.push(te)}function ee(te){H.push(te)}Vo(h,{args:D,name:S[Ep],store:E,after:$,onError:ee});let Z;try{Z=P.apply(this&&this.$id===n?this:E,D)}catch(te){throw Vo(H,te),te}return Z instanceof Promise?Z.then(te=>(Vo(B,te),te)).catch(te=>(Vo(H,te),Promise.reject(te))):(Vo(B,Z),Z)};return S[Uy]=!0,S[Ep]=b,S},v={_p:i,$id:n,$onAction:Ny.bind(null,h),$patch:g,$reset:m,$subscribe(P,b={}){const S=Ny(f,P,b.detached,()=>D()),D=o.run(()=>Ge(()=>i.state.value[n],B=>{(b.flush==="sync"?u:c)&&P({storeId:n,type:ml.direct,events:d},B)},Gs({},l,b)));return S},$dispose:y},E=hi(v);i._s.set(n,E);const M=(i._a&&i._a.runWithContext||Vk)(()=>i._e.run(()=>(o=qm()).run(()=>e({action:x}))));for(const P in M){const b=M[P];if(wt(b)&&!Gk(b)||vs(b))r||(p&&Hk(b)&&(wt(b)?b.value=p[P]:Cm(b,p[P])),i.state.value[n][P]=b);else if(typeof b=="function"){const S=x(b,P);M[P]=S,a.actions[P]=b}}return Gs(E,M),Gs(ot(E),M),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(b=>{Gs(b,P)})}}),i._p.forEach(P=>{Gs(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 Xk(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=ic();return o=o||(l?gn(TT,null):null),o&&rd(o),o=ET,o._s.has(n)||(s?AT(n,e,i,o):Wk(n,i,o)),o._s.get(n)}return r.$id=n,r}function $k(n){const e=ot(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Se({get:()=>n[i],set(r){n[i]=r}}):(wt(s)||vs(s))&&(t[i]=rb(n,i))}return t}const qk=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>vt(()=>import("./default-KObnLwB5.js"),__vite__mapDeps([0,1,2])),"/src/layouts/stage.vue":()=>vt(()=>import("./stage-BHtp9MvQ.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.0 * (c) 2024 Eduardo San Martin Morote * @license MIT - */const Ho=typeof document<"u";function CT(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Yk(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&CT(n.default)}const yt=Object.assign;function Tp(n,e){const t={};for(const i in e){const r=e[i];t[i]=Pi(r)?r.map(n):n(r)}return t}const gl=()=>{},Pi=Array.isArray,RT=/#/g,jk=/&/g,Kk=/\//g,Zk=/=/g,Jk=/\?/g,PT=/\+/g,Qk=/%5B/g,eV=/%5D/g,IT=/%5E/g,tV=/%60/g,LT=/%7B/g,nV=/%7C/g,DT=/%7D/g,iV=/%20/g;function g_(n){return encodeURI(""+n).replace(nV,"|").replace(Qk,"[").replace(eV,"]")}function rV(n){return g_(n).replace(LT,"{").replace(DT,"}").replace(IT,"^")}function Rm(n){return g_(n).replace(PT,"%2B").replace(iV,"+").replace(RT,"%23").replace(jk,"%26").replace(tV,"`").replace(LT,"{").replace(DT,"}").replace(IT,"^")}function sV(n){return Rm(n).replace(Zk,"%3D")}function oV(n){return g_(n).replace(RT,"%23").replace(Jk,"%3F")}function aV(n){return n==null?"":oV(n).replace(Kk,"%2F")}function Kl(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const lV=/\/$/,cV=n=>n.replace(lV,"");function wp(n,e,t="/"){let i,r={},s="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),s=e.slice(l+1,a>-1?a:e.length),r=n(s)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=dV(i??e,t),{fullPath:i+(s&&"?")+s+o,path:i,query:r,hash:Kl(o)}}function uV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function Fy(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function fV(n,e,t){const i=e.matched.length-1,r=t.matched.length-1;return i>-1&&i===r&&fa(e.matched[i],t.matched[r])&&OT(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function fa(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function OT(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!hV(n[t],e[t]))return!1;return!0}function hV(n,e){return Pi(n)?By(n,e):Pi(e)?By(e,n):n===e}function By(n,e){return Pi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function dV(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),r=i[i.length-1];(r===".."||r===".")&&i.push("");let s=t.length-1,o,a;for(o=0;o1&&s--;else break;return t.slice(0,s).join("/")+"/"+i.slice(o).join("/")}const zr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Zl;(function(n){n.pop="pop",n.push="push"})(Zl||(Zl={}));var _l;(function(n){n.back="back",n.forward="forward",n.unknown=""})(_l||(_l={}));function pV(n){if(!n)if(Ho){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),cV(n)}const mV=/^[^#]+#/;function gV(n,e){return n.replace(mV,"#")+e}function _V(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 od=()=>({left:window.scrollX,top:window.scrollY});function vV(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),r=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!r)return;e=_V(r,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 ky(n,e){return(history.state?history.state.position-e:-1)+n}const Pm=new Map;function yV(n,e){Pm.set(n,e)}function xV(n){const e=Pm.get(n);return Pm.delete(n),e}let bV=()=>location.protocol+"//"+location.host;function NT(n,e){const{pathname:t,search:i,hash:r}=e,s=n.indexOf("#");if(s>-1){let a=r.includes(n.slice(s))?n.slice(s).length:1,l=r.slice(a);return l[0]!=="/"&&(l="/"+l),Fy(l,"")}return Fy(t,n)+i+r}function SV(n,e,t,i){let r=[],s=[],o=null;const a=({state:h})=>{const d=NT(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);r.forEach(m=>{m(t.value,p,{delta:g,type:Zl.pop,direction:g?g>0?_l.forward:_l.back:_l.unknown})})};function l(){o=t.value}function c(h){r.push(h);const d=()=>{const p=r.indexOf(h);p>-1&&r.splice(p,1)};return s.push(d),d}function u(){const{history:h}=window;h.state&&h.replaceState(yt({},h.state,{scroll:od()}),"")}function f(){for(const h of s)h();s=[],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 Vy(n,e,t,i=!1,r=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:r?od():null}}function MV(n){const{history:e,location:t}=window,i={value:NT(n,t)},r={value:e.state};r.value||s(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(l,c,u){const f=n.indexOf("#"),h=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:bV()+n+l;try{e[u?"replaceState":"pushState"](c,"",h),r.value=c}catch(d){console.error(d),t[u?"replace":"assign"](h)}}function o(l,c){const u=yt({},e.state,Vy(r.value.back,l,r.value.forward,!0),c,{position:r.value.position});s(l,u,!0),i.value=l}function a(l,c){const u=yt({},r.value,e.state,{forward:l,scroll:od()});s(u.current,u,!0);const f=yt({},Vy(i.value,l,null),{position:u.position+1},c);s(l,f,!1),i.value=l}return{location:i,state:r,push:a,replace:o}}function EV(n){n=pV(n);const e=MV(n),t=SV(n,e.state,e.location,e.replace);function i(s,o=!0){o||t.pauseListeners(),history.go(s)}const r=yt({location:"",base:n,go:i,createHref:gV.bind(null,n)},e,t);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function TV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),EV(n)}function wV(n){return typeof n=="string"||n&&typeof n=="object"}function UT(n){return typeof n=="string"||typeof n=="symbol"}const FT=Symbol("");var zy;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(zy||(zy={}));function ha(n,e){return yt(new Error,{type:n,[FT]:!0},e)}function or(n,e){return n instanceof Error&&FT in n&&(e==null||!!(n.type&e))}const Hy="[^/]+?",AV={sensitive:!1,strict:!1,start:!0,end:!0},CV=/[.+*?^${}()[\]/\\]/g;function RV(n,e){const t=yt({},AV,e),i=[];let r=t.start?"^":"";const s=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(r+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function BT(n,e){let t=0;const i=n.score,r=e.score;for(;t0&&e[e.length-1]<0}const IV={type:0,value:""},LV=/[a-zA-Z0-9_]/;function DV(n){if(!n)return[[]];if(n==="/")return[[IV]];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 r=[];let s;function o(){s&&r.push(s),s=[]}let a=0,l,c="",u="";function f(){c&&(t===0?s.push({type:0,value:c}):t===1||t===2||t===3?(s.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.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(x)}:gl}function o(f){if(UT(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&&!$y(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 ha(1,{location:f});g=d.record.name,p=yt(Wy(h.params,d.keys.filter(x=>!x.optional).concat(d.parent?d.parent.keys.filter(x=>x.optional):[]).map(x=>x.name)),f.params&&Wy(f.params,d.keys.map(x=>x.name))),_=d.stringify(p)}else if(f.path!=null)_=f.path,d=t.find(x=>x.re.test(_)),d&&(p=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(x=>x.re.test(h.path)),!d)throw ha(1,{location:f,currentLocation:h});g=d.record.name,p=yt({},h.params,f.params),_=d.stringify(p)}const m=[];let y=d;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:FV(m)}}n.forEach(f=>s(f));function u(){t.length=0,i.clear()}return{addRoute:s,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function Wy(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Xy(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:UV(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 UV(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 $y(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function FV(n){return n.reduce((e,t)=>yt(e,t.meta),{})}function qy(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 s=t+i>>1;BT(n,e[s])<0?i=s:t=s+1}const r=kV(n);return r&&(i=e.lastIndexOf(r,i-1)),i}function kV(n){let e=n;for(;e=e.parent;)if(kT(e)&&BT(n,e)===0)return e}function kT({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 r=0;rs&&Rm(s)):[i&&Rm(i)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+t,s!=null&&(e+="="+s))})}return e}function zV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Pi(i)?i.map(r=>r==null?null:""+r):i==null?i:""+i)}return e}const HV=Symbol(""),jy=Symbol(""),ad=Symbol(""),VT=Symbol(""),Im=Symbol("");function za(){let n=[];function e(i){return n.push(i),()=>{const r=n.indexOf(i);r>-1&&n.splice(r,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function jr(n,e,t,i,r,s=o=>o()){const o=i&&(i.enterCallbacks[r]=i.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(ha(4,{from:t,to:e})):h instanceof Error?l(h):wV(h)?l(ha(2,{from:e,to:h})):(o&&i.enterCallbacks[r]===o&&typeof h=="function"&&o.push(h),a())},u=s(()=>n.call(i&&i.instances[r],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(h=>l(h))})}function Ap(n,e,t,i,r=s=>s()){const s=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(CT(l)){const u=(l.__vccOpts||l)[e];u&&s.push(jr(u,t,i,o,a,r))}else{let c=l();s.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Yk(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&jr(d,t,i,o,a,r)()}))}}return s}function Ky(n){const e=gn(ad),t=gn(VT),i=Se(()=>{const l=It(n.to);return e.resolve(l)}),r=Se(()=>{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(fa.bind(null,u));if(h>-1)return h;const d=Zy(l[c-2]);return c>1&&Zy(u)===d&&f[f.length-1].path!==d?f.findIndex(fa.bind(null,l[c-2])):h}),s=Se(()=>r.value>-1&&qV(t.params,i.value.params)),o=Se(()=>r.value>-1&&r.value===t.matched.length-1&&OT(t.params,i.value.params));function a(l={}){if($V(l)){const c=e[It(n.replace)?"replace":"push"](It(n.to)).catch(gl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Se(()=>i.value.href),isActive:s,isExactActive:o,navigate:a}}function GV(n){return n.length===1?n[0]:n}const WV=rn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ky,setup(n,{slots:e}){const t=hi(Ky(n)),{options:i}=gn(ad),r=Se(()=>({[Jy(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Jy(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const s=e.default&&GV(e.default(t));return n.custom?s:Sr("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:r.value},s)}}}),XV=WV;function $V(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 qV(n,e){for(const t in e){const i=e[t],r=n[t];if(typeof i=="string"){if(i!==r)return!1}else if(!Pi(r)||r.length!==i.length||i.some((s,o)=>s!==r[o]))return!1}return!0}function Zy(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Jy=(n,e,t)=>n??e??t,YV=rn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=gn(Im),r=Se(()=>n.route||i.value),s=gn(jy,0),o=Se(()=>{let c=It(s);const{matched:u}=r.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Se(()=>r.value.matched[o.value]);es(jy,Se(()=>o.value+1)),es(HV,a),es(Im,r);const l=Ze();return Ge(()=>[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||!fa(u,d)||!h)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=r.value,u=n.name,f=a.value,h=f&&f.components[u];if(!h)return Qy(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=Sr(h,yt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Qy(t.default,{Component:g,route:c})||g}}});function Qy(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const zT=YV;function jV(n){const e=NV(n.routes,n),t=n.parseQuery||VV,i=n.stringifyQuery||Yy,r=n.history,s=za(),o=za(),a=za(),l=Ie(zr);let c=zr;Ho&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Tp.bind(null,W=>""+W),f=Tp.bind(null,aV),h=Tp.bind(null,Kl);function d(W,ae){let ue,le;return UT(W)?(ue=e.getRecordMatcher(W),le=ae):le=W,e.addRoute(le,ue)}function p(W){const ae=e.getRecordMatcher(W);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(W=>W.record)}function g(W){return!!e.getRecordMatcher(W)}function m(W,ae){if(ae=yt({},ae||l.value),typeof W=="string"){const w=wp(t,W,ae.path),j=e.resolve({path:w.path},ae),G=r.createHref(w.fullPath);return yt(w,j,{params:h(j.params),hash:Kl(w.hash),redirectedFrom:void 0,href:G})}let ue;if(W.path!=null)ue=yt({},W,{path:wp(t,W.path,ae.path).path});else{const w=yt({},W.params);for(const j in w)w[j]==null&&delete w[j];ue=yt({},W,{params:f(w)}),ae.params=f(ae.params)}const le=e.resolve(ue,ae),Oe=W.hash||"";le.params=u(h(le.params));const I=uV(i,yt({},W,{hash:rV(Oe),path:le.path})),L=r.createHref(I);return yt({fullPath:I,hash:Oe,query:i===Yy?zV(W.query):W.query||{}},le,{redirectedFrom:void 0,href:L})}function y(W){return typeof W=="string"?wp(t,W,l.value.path):yt({},W)}function x(W,ae){if(c!==W)return ha(8,{from:ae,to:W})}function v(W){return M(W)}function E(W){return v(yt(y(W),{replace:!0}))}function T(W){const ae=W.matched[W.matched.length-1];if(ae&&ae.redirect){const{redirect:ue}=ae;let le=typeof ue=="function"?ue(W):ue;return typeof le=="string"&&(le=le.includes("?")||le.includes("#")?le=y(le):{path:le},le.params={}),yt({query:W.query,hash:W.hash,params:le.path!=null?{}:W.params},le)}}function M(W,ae){const ue=c=m(W),le=l.value,Oe=W.state,I=W.force,L=W.replace===!0,w=T(ue);if(w)return M(yt(y(w),{state:typeof w=="object"?yt({},Oe,w.state):Oe,force:I,replace:L}),ae||ue);const j=ue;j.redirectedFrom=ae;let G;return!I&&fV(i,le,ue)&&(G=ha(16,{to:j,from:le}),re(le,le,!0,!1)),(G?Promise.resolve(G):S(j,le)).catch(q=>or(q)?or(q,2)?q:ve(q):Q(q,j,le)).then(q=>{if(q){if(or(q,2))return M(yt({replace:L},y(q.to),{state:typeof q.to=="object"?yt({},Oe,q.to.state):Oe,force:I}),ae||j)}else q=B(j,le,!0,L,Oe);return D(j,le,q),q})}function P(W,ae){const ue=x(W,ae);return ue?Promise.reject(ue):Promise.resolve()}function b(W){const ae=se.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(W):W()}function S(W,ae){let ue;const[le,Oe,I]=KV(W,ae);ue=Ap(le.reverse(),"beforeRouteLeave",W,ae);for(const w of le)w.leaveGuards.forEach(j=>{ue.push(jr(j,W,ae))});const L=P.bind(null,W,ae);return ue.push(L),be(ue).then(()=>{ue=[];for(const w of s.list())ue.push(jr(w,W,ae));return ue.push(L),be(ue)}).then(()=>{ue=Ap(Oe,"beforeRouteUpdate",W,ae);for(const w of Oe)w.updateGuards.forEach(j=>{ue.push(jr(j,W,ae))});return ue.push(L),be(ue)}).then(()=>{ue=[];for(const w of I)if(w.beforeEnter)if(Pi(w.beforeEnter))for(const j of w.beforeEnter)ue.push(jr(j,W,ae));else ue.push(jr(w.beforeEnter,W,ae));return ue.push(L),be(ue)}).then(()=>(W.matched.forEach(w=>w.enterCallbacks={}),ue=Ap(I,"beforeRouteEnter",W,ae,b),ue.push(L),be(ue))).then(()=>{ue=[];for(const w of o.list())ue.push(jr(w,W,ae));return ue.push(L),be(ue)}).catch(w=>or(w,8)?w:Promise.reject(w))}function D(W,ae,ue){a.list().forEach(le=>b(()=>le(W,ae,ue)))}function B(W,ae,ue,le,Oe){const I=x(W,ae);if(I)return I;const L=ae===zr,w=Ho?history.state:{};ue&&(le||L?r.replace(W.fullPath,yt({scroll:L&&w&&w.scroll},Oe)):r.push(W.fullPath,Oe)),l.value=W,re(W,ae,ue,L),ve()}let H;function $(){H||(H=r.listen((W,ae,ue)=>{if(!ge.listening)return;const le=m(W),Oe=T(le);if(Oe){M(yt(Oe,{replace:!0,force:!0}),le).catch(gl);return}c=le;const I=l.value;Ho&&yV(ky(I.fullPath,ue.delta),od()),S(le,I).catch(L=>or(L,12)?L:or(L,2)?(M(yt(y(L.to),{force:!0}),le).then(w=>{or(w,20)&&!ue.delta&&ue.type===Zl.pop&&r.go(-1,!1)}).catch(gl),Promise.reject()):(ue.delta&&r.go(-ue.delta,!1),Q(L,le,I))).then(L=>{L=L||B(le,I,!1),L&&(ue.delta&&!or(L,8)?r.go(-ue.delta,!1):ue.type===Zl.pop&&or(L,20)&&r.go(-1,!1)),D(le,I,L)}).catch(gl)}))}let ee=za(),Z=za(),te;function Q(W,ae,ue){ve(W);const le=Z.list();return le.length?le.forEach(Oe=>Oe(W,ae,ue)):console.error(W),Promise.reject(W)}function pe(){return te&&l.value!==zr?Promise.resolve():new Promise((W,ae)=>{ee.add([W,ae])})}function ve(W){return te||(te=!W,$(),ee.list().forEach(([ae,ue])=>W?ue(W):ae()),ee.reset()),W}function re(W,ae,ue,le){const{scrollBehavior:Oe}=n;if(!Ho||!Oe)return Promise.resolve();const I=!ue&&xV(ky(W.fullPath,0))||(le||!ue)&&history.state&&history.state.scroll||null;return cs().then(()=>Oe(W,ae,I)).then(L=>L&&vV(L)).catch(L=>Q(L,W,ae))}const xe=W=>r.go(W);let ze;const se=new Set,ge={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:E,go:xe,back:()=>xe(-1),forward:()=>xe(1),beforeEach:s.add,beforeResolve:o.add,afterEach:a.add,onError:Z.add,isReady:pe,install(W){const ae=this;W.component("RouterLink",XV),W.component("RouterView",zT),W.config.globalProperties.$router=ae,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>It(l)}),Ho&&!ze&&l.value===zr&&(ze=!0,v(r.location).catch(Oe=>{}));const ue={};for(const Oe in zr)Object.defineProperty(ue,Oe,{get:()=>l.value[Oe],enumerable:!0});W.provide(ad,ae),W.provide(VT,tb(ue)),W.provide(Im,l);const le=W.unmount;se.add(W),W.unmount=function(){se.delete(W),se.size<1&&(c=zr,H&&H(),H=null,l.value=zr,ze=!1,te=!1),le()}}};function be(W){return W.reduce((ae,ue)=>ae.then(()=>b(ue)),Promise.resolve())}return ge}function KV(n,e){const t=[],i=[],r=[],s=Math.max(e.matched.length,n.matched.length);for(let o=0;ofa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>fa(c,l))||r.push(l))}return[t,i,r]}function ZV(){return gn(ad)}const JV=[{path:"/",name:"/",component:()=>vt(()=>import("./index-DUFhcJBN.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2,14,15,16,17])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>vt(()=>import("./_...all_-B9hj4crd.js"),[])},{path:"/audio",name:"/audio",component:()=>vt(()=>import("./audio-BBFpw-95.js"),[])},{path:"/devtools",children:[{path:"image",name:"/devtools/image",component:()=>vt(()=>import("./image-Dj4bQptd.js"),__vite__mapDeps([18,19]))}]},{path:"/queue",name:"/queue",component:()=>vt(()=>import("./queue-DhMvrul4.js"),__vite__mapDeps([20,8]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>vt(()=>import("./index-CwztT5AX.js"),__vite__mapDeps([21,4,5,16])),meta:{stageTransition:{name:"slide"}}},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>vt(()=>import("./index-sRXUKZKg.js"),__vite__mapDeps([22,11,4,5,13,12,16])),meta:{stageTransition:{name:"slide"}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>vt(()=>import("./index-CyuWFHi7.js"),__vite__mapDeps([23,4,5,24,16])),meta:{stageTransition:{name:"slide"}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>vt(()=>import("./consciousness-Dp9J01tk.js"),__vite__mapDeps([25,4,5,26,12,14,7,16])),meta:{stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>vt(()=>import("./speech-CJtnVd8v.js"),__vite__mapDeps([27,28,4,5,26,12,7,10,16])),meta:{stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>vt(()=>import("./index-qbVWDvFi.js"),__vite__mapDeps([29,4,5,7,24,16])),meta:{stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>vt(()=>import("./cloudflare-workers-ai-Qanyjg-b.js"),__vite__mapDeps([30,4,5,7,31,32]))},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>vt(()=>import("./deepseek-Bp1UKOd8.js"),__vite__mapDeps([33,4,5,7,34,13,12,31,32]))},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>vt(()=>import("./elevenlabs-BxwtmmmG.js"),__vite__mapDeps([35,28,4,5,7,10,34,13,12,31,32,6]))},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>vt(()=>import("./fireworks-ai-ZLkLrHBi.js"),__vite__mapDeps([36,4,5,7,34,13,12,31,32]))},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>vt(()=>import("./mistral-ai-SRpzYQgW.js"),__vite__mapDeps([37,4,5,7,34,13,12,31,32]))},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>vt(()=>import("./moonshot-ai-CrS3VCmD.js"),__vite__mapDeps([38,4,5,7,34,13,12,31,32]))},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>vt(()=>import("./novita-ai-AV_AAG7n.js"),__vite__mapDeps([39,4,5,7,34,13,12,31,32]))},{path:"ollama",name:"/settings/providers/ollama",component:()=>vt(()=>import("./ollama-DlE099gn.js"),__vite__mapDeps([40,31,4,5,7,34,13,12]))},{path:"openai",name:"/settings/providers/openai",component:()=>vt(()=>import("./openai-D275seCU.js"),__vite__mapDeps([41,4,5,7,34,13,12,31,32]))},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>vt(()=>import("./openrouter-ai-COzImo4T.js"),__vite__mapDeps([42,4,5,7,34,13,12,31,32]))},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>vt(()=>import("./together-ai-BYBUsnJP.js"),__vite__mapDeps([43,4,5,7,34,13,12,31,32]))},{path:"xai",name:"/settings/providers/xai",component:()=>vt(()=>import("./xai-CuM3qEtK.js"),__vite__mapDeps([44,4,5,7,34,13,12,31,32]))}]},{path:"themes",children:[{path:"",name:"/settings/themes/",component:()=>vt(()=>import("./index-Dcdz53V-.js"),__vite__mapDeps([45,13,12,4,5,16,46])),meta:{stageTransition:{name:"slide"}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>vt(()=>import("./filter-message-C0VAb3A6.js"),[])},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>vt(()=>import("./delays-BrYcT-eG.js"),__vite__mapDeps([47,9,4,5,8,15]))},{path:"emotions",name:"/test/queues/emotions",component:()=>vt(()=>import("./emotions-D4NlkiN7.js"),__vite__mapDeps([48,9,4,5,8]))},{path:"messages",name:"/test/queues/messages",component:()=>vt(()=>import("./messages-BKGdf620.js"),__vite__mapDeps([49,9,4,5,8]))}]}]}],QV=178.17,ez=Xk("settings",()=>{const n=Ze(),e=Vr("settings/language","en-US"),t=Vr("settings/stage/view/model-renderer","2d"),i=Vr("settings/audio/input","true"),r=Se(()=>{var m;return(m=n.value)==null?void 0:m.deviceId}),{audioInputs:s}=jU({constraints:{audio:!0},requestPermissions:!0}),o=Ze(),a=Ze("/assets/live2d/models/hiyori_pro_zh.zip"),l=Ze("url"),c=Ze(!1),u=Vr("settings/live2d/position",{x:0,y:0}),f=Ze({group:"Idle",index:0}),h=Ze([]),d=Vr("settings/live2d/motion-map",{}),p=Vr("settings/disable-transitions",!1),_=Vr("settings/theme/colors/hue",QV),g=Vr("settings/theme/colors/hue-dynamic",!1);return Ge(i,m=>{m==="false"&&(n.value=void 0),m==="true"&&(n.value=s.value[0])}),yn(()=>{i.value==="true"&&!n.value&&(n.value=s.value[0])}),Ge(s,()=>{i.value==="true"&&!n.value&&(n.value=s.value[0])}),{live2dModelFile:o,live2dModelUrl:a,live2dLoadSource:l,live2dCurrentMotion:f,live2dPosition:u,availableLive2dMotions:h,live2dMotionMap:d,loadingLive2dModel:c,disableTransitions:p,language:e,stageView:t,themeColorsHue:_,themeColorsHueDynamic:g,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:r}}),tz=rn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>t.value.primaryColor||"#666"),r=Se(()=>t.value.secondaryColor||"#ccc");return yn(()=>{document.documentElement.style.setProperty("--stage-transition-3-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-3-overlay-color-2",r.value)}),(s,o)=>(ln(),ui("div",{class:"stage-transition-3",style:mi({zIndex:t.value.zIndex||100})},null,4))}}),yo=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},nz=yo(tz,[["__scopeId","data-v-df576df0"]]),iz=rn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return yn(()=>{var i,r;document.documentElement.style.setProperty("--circle-expansion-delay",`${((i=e.stageTransition)==null?void 0:i.delay)||0}s`),document.documentElement.style.setProperty("--circle-expansion-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.4}s`),t.value.forEach((s,o)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${o+1}`,s)})}),(i,r)=>{var s;return ln(),ui("div",{class:"circle-expansion-transition",style:mi({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)||100})},[(ln(!0),ui(Xt,null,SA(t.value,(o,a)=>(ln(),ui("div",{key:a}))),128))],4)}}}),rz=yo(iz,[["__scopeId","data-v-0c29056c"]]),sz=rn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>{var r;return((r=e.stageTransition)==null?void 0:r.direction)||"up"}),i=Se(()=>`fantasy-fall-${t.value}`);return yn(()=>{var r,s,o,a,l,c,u,f,h;document.documentElement.style.setProperty("--fantasy-fall-color",((r=e.stageTransition)==null?void 0:r.primaryColor)||"#eee"),document.documentElement.style.setProperty("--fantasy-fall-duration",`${((s=e.stageTransition)==null?void 0:s.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%"}`)}),(r,s)=>{var o;return ln(),ui("div",{class:ga(["fantasy-fall-transition",i.value]),style:mi({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),oz=yo(sz,[["__scopeId","data-v-e62bf496"]]),az=rn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var s;return((s=t.value)==null?void 0:s.primaryColor)||"#666"}),r=Se(()=>{var s;return((s=t.value)==null?void 0:s.secondaryColor)||"#ccc"});return yn(()=>{document.documentElement.style.setProperty("--stage-transition-4-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-4-overlay-color-2",r.value)}),(s,o)=>{var a;return ln(),ui("div",{class:"stage-transition-4",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[t1('
',5)]),4)}}}),lz=yo(az,[["__scopeId","data-v-6d1179fc"]]),cz=rn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var s;return((s=t.value)==null?void 0:s.primaryColor)||"#666"}),r=Se(()=>{var s;return((s=t.value)==null?void 0:s.secondaryColor)||"#ccc"});return Ge([t,i,r],()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",r.value)}),yn(()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",r.value)}),(s,o)=>{var a;return ln(),ui("div",{class:"stage-transition-1",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),uz=yo(cz,[["__scopeId","data-v-bf1d1566"]]),fz=rn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var s;return((s=t.value)==null?void 0:s.primaryColor)??"#666"}),r=Se(()=>{var s;return((s=t.value)==null?void 0:s.secondaryColor)??"#ccc"});return yn(()=>{document.documentElement.style.setProperty("--stage-transition-2-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-2-overlay-color-2",r.value)}),(s,o)=>{var a;return ln(),ui("div",{class:"stage-transition-2",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),hz=yo(fz,[["__scopeId","data-v-8ff7120f"]]),dz=rn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return yn(()=>{var t,i,r,s,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",((r=e.stageTransition)==null?void 0:r.tertiaryColor)||"#43445b"),document.documentElement.style.setProperty("--rectangle-rotate-duration",`${((s=e.stageTransition)==null?void 0:s.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 r;return ln(),ui("div",{class:"rectangle-rotate-transition",style:mi({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)??100})},i[0]||(i[0]=[$r("div",{class:"rectangle rectangle-rotate-1"},[$r("div")],-1),$r("div",{class:"rectangle rectangle-rotate-2"},[$r("div")],-1),$r("div",{class:"rectangle rectangle-rotate-3"},[$r("div")],-1)]),4)}}}),pz=yo(dz,[["__scopeId","data-v-f4b1dc64"]]),mz=rn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean}},setup(n){const e=n,t=ZV(),i=Ze(!1),r=Ze(),s=Ze(""),o=Ze(),a=Ie({slide:{component:uz,duration:2700},"slope-slide":{component:hz,duration:2700},arrow:{component:nz,duration:2700},"multiple-blocks-reveal":{component:lz,duration:2800},"fantasy-fall":{component:oz,duration:2700},"rectangles-rotate":{component:pz,duration:2700},"bubble-wave-out":{component:rz,duration:1e3}}),l=Ze([]);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={}){r.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 y=!1;const v=c(E=>{E==="navigation"&&!y&&(y=!0,p())});try{await u("before-enter",{transitionName:d.name}),i.value&&(await u("before-leave",{transitionName:s.value}),s.value="",o.value=void 0,i.value=!1,await u("after-leave",{transitionName:s.value}),await new Promise(T=>setTimeout(T,50))),s.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}),y||(y=!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,s.value="",o.value=void 0,await u("after-leave",{transitionName:d.name}),_()},g.duration+E)}catch(E){console.error(E)}finally{v(),setTimeout(()=>{y||(y=!0,p())},g.duration*2)}}function h(d,p){return new Promise(_=>{f(d,p,_)})}return t.beforeEach((d,p,_)=>{if(typeof d.meta.stageTransition!="object"){_();return}const g=d.meta.stageTransition;if(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),e.disableTransitions){_();return}h(g,_)}),(d,p)=>(ln(),ui(Xt,null,[MA(d.$slots,"default"),i.value?(ln(),ui(Xt,{key:0},[a.value[s.value]?(ln(),El(bA(a.value[s.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Z_("",!0)],64)):Z_("",!0)],64))}});/*! + */const Ho=typeof document<"u";function CT(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Yk(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&CT(n.default)}const yt=Object.assign;function Tp(n,e){const t={};for(const i in e){const s=e[i];t[i]=Pi(s)?s.map(n):n(s)}return t}const gl=()=>{},Pi=Array.isArray,RT=/#/g,jk=/&/g,Kk=/\//g,Zk=/=/g,Jk=/\?/g,PT=/\+/g,Qk=/%5B/g,eV=/%5D/g,IT=/%5E/g,tV=/%60/g,LT=/%7B/g,nV=/%7C/g,DT=/%7D/g,iV=/%20/g;function g_(n){return encodeURI(""+n).replace(nV,"|").replace(Qk,"[").replace(eV,"]")}function sV(n){return g_(n).replace(LT,"{").replace(DT,"}").replace(IT,"^")}function Rm(n){return g_(n).replace(PT,"%2B").replace(iV,"+").replace(RT,"%23").replace(jk,"%26").replace(tV,"`").replace(LT,"{").replace(DT,"}").replace(IT,"^")}function rV(n){return Rm(n).replace(Zk,"%3D")}function oV(n){return g_(n).replace(RT,"%23").replace(Jk,"%3F")}function aV(n){return n==null?"":oV(n).replace(Kk,"%2F")}function Kl(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const lV=/\/$/,cV=n=>n.replace(lV,"");function wp(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=dV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:Kl(o)}}function uV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function Fy(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function fV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&fa(e.matched[i],t.matched[s])&&OT(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function fa(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function OT(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!hV(n[t],e[t]))return!1;return!0}function hV(n,e){return Pi(n)?By(n,e):Pi(e)?By(e,n):n===e}function By(n,e){return Pi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function dV(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 zs={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Zl;(function(n){n.pop="pop",n.push="push"})(Zl||(Zl={}));var _l;(function(n){n.back="back",n.forward="forward",n.unknown=""})(_l||(_l={}));function pV(n){if(!n)if(Ho){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),cV(n)}const mV=/^[^#]+#/;function gV(n,e){return n.replace(mV,"#")+e}function _V(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 od=()=>({left:window.scrollX,top:window.scrollY});function vV(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=_V(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 ky(n,e){return(history.state?history.state.position-e:-1)+n}const Pm=new Map;function yV(n,e){Pm.set(n,e)}function xV(n){const e=Pm.get(n);return Pm.delete(n),e}let bV=()=>location.protocol+"//"+location.host;function NT(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),Fy(l,"")}return Fy(t,n)+i+s}function SV(n,e,t,i){let s=[],r=[],o=null;const a=({state:h})=>{const d=NT(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:Zl.pop,direction:g?g>0?_l.forward:_l.back:_l.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(yt({},h.state,{scroll:od()}),"")}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 Vy(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?od():null}}function MV(n){const{history:e,location:t}=window,i={value:NT(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:bV()+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=yt({},e.state,Vy(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=yt({},s.value,e.state,{forward:l,scroll:od()});r(u.current,u,!0);const f=yt({},Vy(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 EV(n){n=pV(n);const e=MV(n),t=SV(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=yt({location:"",base:n,go:i,createHref:gV.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 TV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),EV(n)}function wV(n){return typeof n=="string"||n&&typeof n=="object"}function UT(n){return typeof n=="string"||typeof n=="symbol"}const FT=Symbol("");var zy;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(zy||(zy={}));function ha(n,e){return yt(new Error,{type:n,[FT]:!0},e)}function os(n,e){return n instanceof Error&&FT in n&&(e==null||!!(n.type&e))}const Hy="[^/]+?",AV={sensitive:!1,strict:!1,start:!0,end:!0},CV=/[.+*?^${}()[\]/\\]/g;function RV(n,e){const t=yt({},AV,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function BT(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const IV={type:0,value:""},LV=/[a-zA-Z0-9_]/;function DV(n){if(!n)return[[]];if(n==="/")return[[IV]];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(x)}:gl}function o(f){if(UT(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&&!$y(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 ha(1,{location:f});g=d.record.name,p=yt(Wy(h.params,d.keys.filter(x=>!x.optional).concat(d.parent?d.parent.keys.filter(x=>x.optional):[]).map(x=>x.name)),f.params&&Wy(f.params,d.keys.map(x=>x.name))),_=d.stringify(p)}else if(f.path!=null)_=f.path,d=t.find(x=>x.re.test(_)),d&&(p=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(x=>x.re.test(h.path)),!d)throw ha(1,{location:f,currentLocation:h});g=d.record.name,p=yt({},h.params,f.params),_=d.stringify(p)}const m=[];let y=d;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:FV(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 Wy(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Xy(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:UV(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 UV(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 $y(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function FV(n){return n.reduce((e,t)=>yt(e,t.meta),{})}function qy(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;BT(n,e[r])<0?i=r:t=r+1}const s=kV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function kV(n){let e=n;for(;e=e.parent;)if(kT(e)&&BT(n,e)===0)return e}function kT({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&&Rm(r)):[i&&Rm(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function zV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Pi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const HV=Symbol(""),jy=Symbol(""),ad=Symbol(""),VT=Symbol(""),Im=Symbol("");function za(){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 js(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(ha(4,{from:t,to:e})):h instanceof Error?l(h):wV(h)?l(ha(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 Ap(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(CT(l)){const u=(l.__vccOpts||l)[e];u&&r.push(js(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=Yk(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&js(d,t,i,o,a,s)()}))}}return r}function Ky(n){const e=gn(ad),t=gn(VT),i=Se(()=>{const l=It(n.to);return e.resolve(l)}),s=Se(()=>{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(fa.bind(null,u));if(h>-1)return h;const d=Zy(l[c-2]);return c>1&&Zy(u)===d&&f[f.length-1].path!==d?f.findIndex(fa.bind(null,l[c-2])):h}),r=Se(()=>s.value>-1&&qV(t.params,i.value.params)),o=Se(()=>s.value>-1&&s.value===t.matched.length-1&&OT(t.params,i.value.params));function a(l={}){if($V(l)){const c=e[It(n.replace)?"replace":"push"](It(n.to)).catch(gl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Se(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function GV(n){return n.length===1?n[0]:n}const WV=sn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ky,setup(n,{slots:e}){const t=hi(Ky(n)),{options:i}=gn(ad),s=Se(()=>({[Jy(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Jy(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&GV(e.default(t));return n.custom?r:Ss("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),XV=WV;function $V(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 qV(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(!Pi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Zy(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Jy=(n,e,t)=>n??e??t,YV=sn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=gn(Im),s=Se(()=>n.route||i.value),r=gn(jy,0),o=Se(()=>{let c=It(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Se(()=>s.value.matched[o.value]);er(jy,Se(()=>o.value+1)),er(HV,a),er(Im,s);const l=Ze();return Ge(()=>[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||!fa(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 Qy(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=Ss(h,yt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Qy(t.default,{Component:g,route:c})||g}}});function Qy(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const zT=YV;function jV(n){const e=NV(n.routes,n),t=n.parseQuery||VV,i=n.stringifyQuery||Yy,s=n.history,r=za(),o=za(),a=za(),l=Ie(zs);let c=zs;Ho&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Tp.bind(null,W=>""+W),f=Tp.bind(null,aV),h=Tp.bind(null,Kl);function d(W,ae){let ue,le;return UT(W)?(ue=e.getRecordMatcher(W),le=ae):le=W,e.addRoute(le,ue)}function p(W){const ae=e.getRecordMatcher(W);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(W=>W.record)}function g(W){return!!e.getRecordMatcher(W)}function m(W,ae){if(ae=yt({},ae||l.value),typeof W=="string"){const w=wp(t,W,ae.path),j=e.resolve({path:w.path},ae),G=s.createHref(w.fullPath);return yt(w,j,{params:h(j.params),hash:Kl(w.hash),redirectedFrom:void 0,href:G})}let ue;if(W.path!=null)ue=yt({},W,{path:wp(t,W.path,ae.path).path});else{const w=yt({},W.params);for(const j in w)w[j]==null&&delete w[j];ue=yt({},W,{params:f(w)}),ae.params=f(ae.params)}const le=e.resolve(ue,ae),Oe=W.hash||"";le.params=u(h(le.params));const I=uV(i,yt({},W,{hash:sV(Oe),path:le.path})),L=s.createHref(I);return yt({fullPath:I,hash:Oe,query:i===Yy?zV(W.query):W.query||{}},le,{redirectedFrom:void 0,href:L})}function y(W){return typeof W=="string"?wp(t,W,l.value.path):yt({},W)}function x(W,ae){if(c!==W)return ha(8,{from:ae,to:W})}function v(W){return M(W)}function E(W){return v(yt(y(W),{replace:!0}))}function T(W){const ae=W.matched[W.matched.length-1];if(ae&&ae.redirect){const{redirect:ue}=ae;let le=typeof ue=="function"?ue(W):ue;return typeof le=="string"&&(le=le.includes("?")||le.includes("#")?le=y(le):{path:le},le.params={}),yt({query:W.query,hash:W.hash,params:le.path!=null?{}:W.params},le)}}function M(W,ae){const ue=c=m(W),le=l.value,Oe=W.state,I=W.force,L=W.replace===!0,w=T(ue);if(w)return M(yt(y(w),{state:typeof w=="object"?yt({},Oe,w.state):Oe,force:I,replace:L}),ae||ue);const j=ue;j.redirectedFrom=ae;let G;return!I&&fV(i,le,ue)&&(G=ha(16,{to:j,from:le}),se(le,le,!0,!1)),(G?Promise.resolve(G):S(j,le)).catch(q=>os(q)?os(q,2)?q:ve(q):Q(q,j,le)).then(q=>{if(q){if(os(q,2))return M(yt({replace:L},y(q.to),{state:typeof q.to=="object"?yt({},Oe,q.to.state):Oe,force:I}),ae||j)}else q=B(j,le,!0,L,Oe);return D(j,le,q),q})}function P(W,ae){const ue=x(W,ae);return ue?Promise.reject(ue):Promise.resolve()}function b(W){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(W):W()}function S(W,ae){let ue;const[le,Oe,I]=KV(W,ae);ue=Ap(le.reverse(),"beforeRouteLeave",W,ae);for(const w of le)w.leaveGuards.forEach(j=>{ue.push(js(j,W,ae))});const L=P.bind(null,W,ae);return ue.push(L),be(ue).then(()=>{ue=[];for(const w of r.list())ue.push(js(w,W,ae));return ue.push(L),be(ue)}).then(()=>{ue=Ap(Oe,"beforeRouteUpdate",W,ae);for(const w of Oe)w.updateGuards.forEach(j=>{ue.push(js(j,W,ae))});return ue.push(L),be(ue)}).then(()=>{ue=[];for(const w of I)if(w.beforeEnter)if(Pi(w.beforeEnter))for(const j of w.beforeEnter)ue.push(js(j,W,ae));else ue.push(js(w.beforeEnter,W,ae));return ue.push(L),be(ue)}).then(()=>(W.matched.forEach(w=>w.enterCallbacks={}),ue=Ap(I,"beforeRouteEnter",W,ae,b),ue.push(L),be(ue))).then(()=>{ue=[];for(const w of o.list())ue.push(js(w,W,ae));return ue.push(L),be(ue)}).catch(w=>os(w,8)?w:Promise.reject(w))}function D(W,ae,ue){a.list().forEach(le=>b(()=>le(W,ae,ue)))}function B(W,ae,ue,le,Oe){const I=x(W,ae);if(I)return I;const L=ae===zs,w=Ho?history.state:{};ue&&(le||L?s.replace(W.fullPath,yt({scroll:L&&w&&w.scroll},Oe)):s.push(W.fullPath,Oe)),l.value=W,se(W,ae,ue,L),ve()}let H;function $(){H||(H=s.listen((W,ae,ue)=>{if(!ge.listening)return;const le=m(W),Oe=T(le);if(Oe){M(yt(Oe,{replace:!0,force:!0}),le).catch(gl);return}c=le;const I=l.value;Ho&&yV(ky(I.fullPath,ue.delta),od()),S(le,I).catch(L=>os(L,12)?L:os(L,2)?(M(yt(y(L.to),{force:!0}),le).then(w=>{os(w,20)&&!ue.delta&&ue.type===Zl.pop&&s.go(-1,!1)}).catch(gl),Promise.reject()):(ue.delta&&s.go(-ue.delta,!1),Q(L,le,I))).then(L=>{L=L||B(le,I,!1),L&&(ue.delta&&!os(L,8)?s.go(-ue.delta,!1):ue.type===Zl.pop&&os(L,20)&&s.go(-1,!1)),D(le,I,L)}).catch(gl)}))}let ee=za(),Z=za(),te;function Q(W,ae,ue){ve(W);const le=Z.list();return le.length?le.forEach(Oe=>Oe(W,ae,ue)):console.error(W),Promise.reject(W)}function pe(){return te&&l.value!==zs?Promise.resolve():new Promise((W,ae)=>{ee.add([W,ae])})}function ve(W){return te||(te=!W,$(),ee.list().forEach(([ae,ue])=>W?ue(W):ae()),ee.reset()),W}function se(W,ae,ue,le){const{scrollBehavior:Oe}=n;if(!Ho||!Oe)return Promise.resolve();const I=!ue&&xV(ky(W.fullPath,0))||(le||!ue)&&history.state&&history.state.scroll||null;return cr().then(()=>Oe(W,ae,I)).then(L=>L&&vV(L)).catch(L=>Q(L,W,ae))}const xe=W=>s.go(W);let ze;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:E,go:xe,back:()=>xe(-1),forward:()=>xe(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:Z.add,isReady:pe,install(W){const ae=this;W.component("RouterLink",XV),W.component("RouterView",zT),W.config.globalProperties.$router=ae,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>It(l)}),Ho&&!ze&&l.value===zs&&(ze=!0,v(s.location).catch(Oe=>{}));const ue={};for(const Oe in zs)Object.defineProperty(ue,Oe,{get:()=>l.value[Oe],enumerable:!0});W.provide(ad,ae),W.provide(VT,tb(ue)),W.provide(Im,l);const le=W.unmount;re.add(W),W.unmount=function(){re.delete(W),re.size<1&&(c=zs,H&&H(),H=null,l.value=zs,ze=!1,te=!1),le()}}};function be(W){return W.reduce((ae,ue)=>ae.then(()=>b(ue)),Promise.resolve())}return ge}function KV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;ofa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>fa(c,l))||s.push(l))}return[t,i,s]}function ZV(){return gn(ad)}const JV=[{path:"/",name:"/",component:()=>vt(()=>import("./index-BGoUir2o.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2,14,15,16,17])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>vt(()=>import("./_...all_-DiMCXQP5.js"),[])},{path:"/audio",name:"/audio",component:()=>vt(()=>import("./audio-Du4XXjan.js"),[])},{path:"/devtools",children:[{path:"image",name:"/devtools/image",component:()=>vt(()=>import("./image-DgYLXlCK.js"),__vite__mapDeps([18,19]))}]},{path:"/queue",name:"/queue",component:()=>vt(()=>import("./queue-CQa4vtwo.js"),__vite__mapDeps([20,8]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>vt(()=>import("./index-DoQhzPac.js"),__vite__mapDeps([21,4,5,16])),meta:{stageTransition:{name:"slide"}}},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>vt(()=>import("./index-DIUC8mgB.js"),__vite__mapDeps([22,11,4,5,13,12,16])),meta:{stageTransition:{name:"slide"}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>vt(()=>import("./index-zsHiMu1v.js"),__vite__mapDeps([23,4,5,24,16])),meta:{stageTransition:{name:"slide"}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>vt(()=>import("./consciousness-CM1OByYo.js"),__vite__mapDeps([25,4,5,26,12,14,7,16])),meta:{stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>vt(()=>import("./speech-BwbRihXF.js"),__vite__mapDeps([27,28,4,5,26,12,7,10,16])),meta:{stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>vt(()=>import("./index-JSznsa_U.js"),__vite__mapDeps([29,4,5,7,24,16])),meta:{stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>vt(()=>import("./cloudflare-workers-ai-Da37CFf3.js"),__vite__mapDeps([30,4,5,7,31,32]))},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>vt(()=>import("./deepseek-d4Q8Txxg.js"),__vite__mapDeps([33,4,5,7,34,13,12,31,32]))},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>vt(()=>import("./elevenlabs-BGpCIoDX.js"),__vite__mapDeps([35,28,4,5,7,10,34,13,12,31,32,6]))},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>vt(()=>import("./fireworks-ai-CGayTr7r.js"),__vite__mapDeps([36,4,5,7,34,13,12,31,32]))},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>vt(()=>import("./mistral-ai-_14bZB0D.js"),__vite__mapDeps([37,4,5,7,34,13,12,31,32]))},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>vt(()=>import("./moonshot-ai-B5aTPdZW.js"),__vite__mapDeps([38,4,5,7,34,13,12,31,32]))},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>vt(()=>import("./novita-ai-CaiWgCgu.js"),__vite__mapDeps([39,4,5,7,34,13,12,31,32]))},{path:"ollama",name:"/settings/providers/ollama",component:()=>vt(()=>import("./ollama-xNAKA6oF.js"),__vite__mapDeps([40,31,4,5,7,34,13,12]))},{path:"openai",name:"/settings/providers/openai",component:()=>vt(()=>import("./openai-BrqL72CW.js"),__vite__mapDeps([41,4,5,7,34,13,12,31,32]))},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>vt(()=>import("./openrouter-ai-DMddR8E3.js"),__vite__mapDeps([42,4,5,7,34,13,12,31,32]))},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>vt(()=>import("./together-ai-3JngR7s2.js"),__vite__mapDeps([43,4,5,7,34,13,12,31,32]))},{path:"xai",name:"/settings/providers/xai",component:()=>vt(()=>import("./xai-RB75_YXa.js"),__vite__mapDeps([44,4,5,7,34,13,12,31,32]))}]},{path:"themes",children:[{path:"",name:"/settings/themes/",component:()=>vt(()=>import("./index-QKQc0d-y.js"),__vite__mapDeps([45,13,12,4,5,16,46])),meta:{stageTransition:{name:"slide"}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>vt(()=>import("./filter-message-C4iZRRTX.js"),[])},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>vt(()=>import("./delays-g2QNcYY7.js"),__vite__mapDeps([47,9,4,5,8,15]))},{path:"emotions",name:"/test/queues/emotions",component:()=>vt(()=>import("./emotions-CrwRBNax.js"),__vite__mapDeps([48,9,4,5,8]))},{path:"messages",name:"/test/queues/messages",component:()=>vt(()=>import("./messages-DrSN8YNT.js"),__vite__mapDeps([49,9,4,5,8]))}]}]}],QV=178.17,ez=Xk("settings",()=>{const n=Ze(),e=Vs("settings/language","en-US"),t=Vs("settings/stage/view/model-renderer","2d"),i=Vs("settings/audio/input","true"),s=Se(()=>{var m;return(m=n.value)==null?void 0:m.deviceId}),{audioInputs:r}=jU({constraints:{audio:!0},requestPermissions:!0}),o=Ze(),a=Ze("/assets/live2d/models/hiyori_pro_zh.zip"),l=Ze("url"),c=Ze(!1),u=Vs("settings/live2d/position",{x:0,y:0}),f=Ze({group:"Idle",index:0}),h=Ze([]),d=Vs("settings/live2d/motion-map",{}),p=Vs("settings/disable-transitions",!0),_=Vs("settings/theme/colors/hue",QV),g=Vs("settings/theme/colors/hue-dynamic",!1);return Ge(i,m=>{m==="false"&&(n.value=void 0),m==="true"&&(n.value=r.value[0])}),yn(()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])}),Ge(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])}),{live2dModelFile:o,live2dModelUrl:a,live2dLoadSource:l,live2dCurrentMotion:f,live2dPosition:u,availableLive2dMotions:h,live2dMotionMap:d,loadingLive2dModel:c,disableTransitions:p,language:e,stageView:t,themeColorsHue:_,themeColorsHueDynamic:g,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s}}),tz=sn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>t.value.primaryColor||"#666"),s=Se(()=>t.value.secondaryColor||"#ccc");return yn(()=>{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)=>(ln(),ui("div",{class:"stage-transition-3",style:mi({zIndex:t.value.zIndex||100})},null,4))}}),yo=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},nz=yo(tz,[["__scopeId","data-v-df576df0"]]),iz=sn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return yn(()=>{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 ln(),ui("div",{class:"circle-expansion-transition",style:mi({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(ln(!0),ui(Xt,null,SA(t.value,(o,a)=>(ln(),ui("div",{key:a}))),128))],4)}}}),sz=yo(iz,[["__scopeId","data-v-0c29056c"]]),rz=sn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Se(()=>`fantasy-fall-${t.value}`);return yn(()=>{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 ln(),ui("div",{class:ga(["fantasy-fall-transition",i.value]),style:mi({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),oz=yo(rz,[["__scopeId","data-v-e62bf496"]]),az=sn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return yn(()=>{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 ln(),ui("div",{class:"stage-transition-4",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[t1('
',5)]),4)}}}),lz=yo(az,[["__scopeId","data-v-6d1179fc"]]),cz=sn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Ge([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)}),yn(()=>{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 ln(),ui("div",{class:"stage-transition-1",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),uz=yo(cz,[["__scopeId","data-v-bf1d1566"]]),fz=sn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Se(()=>e.stageTransition),i=Se(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Se(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)??"#ccc"});return yn(()=>{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 ln(),ui("div",{class:"stage-transition-2",style:mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),hz=yo(fz,[["__scopeId","data-v-8ff7120f"]]),dz=sn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return yn(()=>{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 ln(),ui("div",{class:"rectangle-rotate-transition",style:mi({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[$s("div",{class:"rectangle rectangle-rotate-1"},[$s("div")],-1),$s("div",{class:"rectangle rectangle-rotate-2"},[$s("div")],-1),$s("div",{class:"rectangle rectangle-rotate-3"},[$s("div")],-1)]),4)}}}),pz=yo(dz,[["__scopeId","data-v-f4b1dc64"]]),mz=sn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean}},setup(n){const e=n,t=ZV(),i=Ze(!1),s=Ze(),r=Ze(""),o=Ze(),a=Ie({slide:{component:uz,duration:2700},"slope-slide":{component:hz,duration:2700},arrow:{component:nz,duration:2700},"multiple-blocks-reveal":{component:lz,duration:2800},"fantasy-fall":{component:oz,duration:2700},"rectangles-rotate":{component:pz,duration:2700},"bubble-wave-out":{component:sz,duration:1e3}}),l=Ze([]);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 y=!1;const v=c(E=>{E==="navigation"&&!y&&(y=!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}),y||(y=!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{v(),setTimeout(()=>{y||(y=!0,p())},g.duration*2)}}function h(d,p){return new Promise(_=>{f(d,p,_)})}return t.beforeEach((d,p,_)=>{if(typeof d.meta.stageTransition!="object"){_();return}const g=d.meta.stageTransition;if(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),e.disableTransitions){_();return}h(g,_)}),(d,p)=>(ln(),ui(Xt,null,[MA(d.$slots,"default"),i.value?(ln(),ui(Xt,{key:0},[a.value[r.value]?(ln(),El(bA(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Z_("",!0)],64)):Z_("",!0)],64))}});/*! * shared v11.1.2 * (c) 2025 kazuya kawaguchi * Released under the MIT License. - */const th=typeof window<"u",ps=(n,e=!1)=>e?Symbol.for(n):Symbol(n),gz=(n,e,t)=>_z({l:n,k:e,s:t}),_z=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),qt=n=>typeof n=="number"&&isFinite(n),vz=n=>v_(n)==="[object Date]",nh=n=>v_(n)==="[object RegExp]",ld=n=>lt(n)&&Object.keys(n).length===0,nn=Object.assign,yz=Object.create,Tt=(n=null)=>yz(n);let ex;const __=()=>ex||(ex=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Tt());function tx(n){return n.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const xz=Object.prototype.hasOwnProperty;function Ti(n,e){return xz.call(n,e)}const Kt=Array.isArray,Ot=n=>typeof n=="function",De=n=>typeof n=="string",Nt=n=>typeof n=="boolean",mt=n=>n!==null&&typeof n=="object",bz=n=>mt(n)&&Ot(n.then)&&Ot(n.catch),HT=Object.prototype.toString,v_=n=>HT.call(n),lt=n=>v_(n)==="[object Object]",Sz=n=>n==null?"":Kt(n)||lt(n)&&n.toString===HT?JSON.stringify(n,null,2):String(n);function y_(n,e=""){return n.reduce((t,i,r)=>r===0?t+i:t+e+i,"")}function Mz(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const Ou=n=>!mt(n)||Kt(n);function Ju(n,e){if(Ou(n)||Ou(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:r}=t.pop();Object.keys(i).forEach(s=>{s!=="__proto__"&&(mt(i[s])&&!mt(r[s])&&(r[s]=Array.isArray(i[s])?[]:Tt()),Ou(r[s])||Ou(i[s])?r[s]=i[s]:t.push({src:i[s],des:r[s]}))})}}/*! + */const th=typeof window<"u",pr=(n,e=!1)=>e?Symbol.for(n):Symbol(n),gz=(n,e,t)=>_z({l:n,k:e,s:t}),_z=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),qt=n=>typeof n=="number"&&isFinite(n),vz=n=>v_(n)==="[object Date]",nh=n=>v_(n)==="[object RegExp]",ld=n=>lt(n)&&Object.keys(n).length===0,nn=Object.assign,yz=Object.create,Tt=(n=null)=>yz(n);let ex;const __=()=>ex||(ex=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Tt());function tx(n){return n.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const xz=Object.prototype.hasOwnProperty;function Ti(n,e){return xz.call(n,e)}const Kt=Array.isArray,Ot=n=>typeof n=="function",De=n=>typeof n=="string",Nt=n=>typeof n=="boolean",mt=n=>n!==null&&typeof n=="object",bz=n=>mt(n)&&Ot(n.then)&&Ot(n.catch),HT=Object.prototype.toString,v_=n=>HT.call(n),lt=n=>v_(n)==="[object Object]",Sz=n=>n==null?"":Kt(n)||lt(n)&&n.toString===HT?JSON.stringify(n,null,2):String(n);function y_(n,e=""){return n.reduce((t,i,s)=>s===0?t+i:t+e+i,"")}function Mz(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const Ou=n=>!mt(n)||Kt(n);function Ju(n,e){if(Ou(n)||Ou(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:s}=t.pop();Object.keys(i).forEach(r=>{r!=="__proto__"&&(mt(i[r])&&!mt(s[r])&&(s[r]=Array.isArray(i[r])?[]:Tt()),Ou(s[r])||Ou(i[r])?s[r]=i[r]:t.push({src:i[r],des:s[r]}))})}}/*! * message-compiler v11.1.2 * (c) 2025 kazuya kawaguchi * Released under the MIT License. - */function Ez(n,e,t){return{line:n,column:e,offset:t}}function Lm(n,e,t){return{start:n,end:e}}const Mt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},Tz=17;function cd(n,e,t={}){const{domain:i,messages:r,args:s}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function wz(n){throw n}const ar=" ",Az="\r",Tn=` -`,Cz="\u2028",Rz="\u2029";function Pz(n){const e=n;let t=0,i=1,r=1,s=0;const o=M=>e[M]===Az&&e[M+1]===Tn,a=M=>e[M]===Tn,l=M=>e[M]===Rz,c=M=>e[M]===Cz,u=M=>o(M)||a(M)||l(M)||c(M),f=()=>t,h=()=>i,d=()=>r,p=()=>s,_=M=>o(M)||l(M)||c(M)?Tn:e[M],g=()=>_(t),m=()=>_(t+s);function y(){return s=0,u(t)&&(i++,r=0),o(t)&&t++,t++,r++,e[t]}function x(){return o(t+s)&&s++,s++,e[t+s]}function v(){t=0,i=1,r=1,s=0}function E(M=0){s=M}function T(){const M=t+s;for(;M!==t;)y();s=0}return{index:f,line:h,column:d,peekOffset:p,charAt:_,currentChar:g,currentPeek:m,next:y,peek:x,reset:v,resetPeek:E,skipToPeek:T}}const Hr=void 0,Iz=".",nx="'",Lz="tokenizer";function Dz(n,e={}){const t=e.location!==!1,i=Pz(n),r=()=>i.index(),s=()=>Ez(i.line(),i.column(),i.index()),o=s(),a=r(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(R,N,V,...A){const C=c();if(N.column+=V,N.offset+=V,u){const k=t?Lm(C.startLoc,N):null,U=cd(R,k,{domain:Lz,args:A});u(U)}}function h(R,N,V){R.endLoc=s(),R.currentType=N;const A={type:N};return t&&(A.loc=Lm(R.startLoc,R.endLoc)),V!=null&&(A.value=V),A}const d=R=>h(R,13);function p(R,N){return R.currentChar()===N?(R.next(),N):(f(Mt.EXPECTED_TOKEN,s(),0,N),"")}function _(R){let N="";for(;R.currentPeek()===ar||R.currentPeek()===Tn;)N+=R.currentPeek(),R.peek();return N}function g(R){const N=_(R);return R.skipToPeek(),N}function m(R){if(R===Hr)return!1;const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N===95}function y(R){if(R===Hr)return!1;const N=R.charCodeAt(0);return N>=48&&N<=57}function x(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=m(R.currentPeek());return R.resetPeek(),A}function v(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=R.currentPeek()==="-"?R.peek():R.currentPeek(),C=y(A);return R.resetPeek(),C}function E(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=R.currentPeek()===nx;return R.resetPeek(),A}function T(R,N){const{currentType:V}=N;if(V!==7)return!1;_(R);const A=R.currentPeek()===".";return R.resetPeek(),A}function M(R,N){const{currentType:V}=N;if(V!==8)return!1;_(R);const A=m(R.currentPeek());return R.resetPeek(),A}function P(R,N){const{currentType:V}=N;if(!(V===7||V===11))return!1;_(R);const A=R.currentPeek()===":";return R.resetPeek(),A}function b(R,N){const{currentType:V}=N;if(V!==9)return!1;const A=()=>{const k=R.currentPeek();return k==="{"?m(R.peek()):k==="@"||k==="|"||k===":"||k==="."||k===ar||!k?!1:k===Tn?(R.peek(),A()):D(R,!1)},C=A();return R.resetPeek(),C}function S(R){_(R);const N=R.currentPeek()==="|";return R.resetPeek(),N}function D(R,N=!0){const V=(C=!1,k="")=>{const U=R.currentPeek();return U==="{"||U==="@"||!U?C:U==="|"?!(k===ar||k===Tn):U===ar?(R.peek(),V(!0,ar)):U===Tn?(R.peek(),V(!0,Tn)):!0},A=V();return N&&R.resetPeek(),A}function B(R,N){const V=R.currentChar();return V===Hr?Hr:N(V)?(R.next(),V):null}function H(R){const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N>=48&&N<=57||N===95||N===36}function $(R){return B(R,H)}function ee(R){const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N>=48&&N<=57||N===95||N===36||N===45}function Z(R){return B(R,ee)}function te(R){const N=R.charCodeAt(0);return N>=48&&N<=57}function Q(R){return B(R,te)}function pe(R){const N=R.charCodeAt(0);return N>=48&&N<=57||N>=65&&N<=70||N>=97&&N<=102}function ve(R){return B(R,pe)}function re(R){let N="",V="";for(;N=Q(R);)V+=N;return V}function xe(R){let N="";for(;;){const V=R.currentChar();if(V==="{"||V==="}"||V==="@"||V==="|"||!V)break;if(V===ar||V===Tn)if(D(R))N+=V,R.next();else{if(S(R))break;N+=V,R.next()}else N+=V,R.next()}return N}function ze(R){g(R);let N="",V="";for(;N=Z(R);)V+=N;return R.currentChar()===Hr&&f(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),V}function se(R){g(R);let N="";return R.currentChar()==="-"?(R.next(),N+=`-${re(R)}`):N+=re(R),R.currentChar()===Hr&&f(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),N}function ge(R){return R!==nx&&R!==Tn}function be(R){g(R),p(R,"'");let N="",V="";for(;N=B(R,ge);)N==="\\"?V+=W(R):V+=N;const A=R.currentChar();return A===Tn||A===Hr?(f(Mt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),A===Tn&&(R.next(),p(R,"'")),V):(p(R,"'"),V)}function W(R){const N=R.currentChar();switch(N){case"\\":case"'":return R.next(),`\\${N}`;case"u":return ae(R,N,4);case"U":return ae(R,N,6);default:return f(Mt.UNKNOWN_ESCAPE_SEQUENCE,s(),0,N),""}}function ae(R,N,V){p(R,N);let A="";for(let C=0;C{const A=R.currentChar();return A==="{"||A==="@"||A==="|"||A==="("||A===")"||!A||A===ar?V:(V+=A,R.next(),N(V))};return N("")}function L(R){g(R);const N=p(R,"|");return g(R),N}function w(R,N){let V=null;switch(R.currentChar()){case"{":return N.braceNest>=1&&f(Mt.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),R.next(),V=h(N,2,"{"),g(R),N.braceNest++,V;case"}":return N.braceNest>0&&N.currentType===2&&f(Mt.EMPTY_PLACEHOLDER,s(),0),R.next(),V=h(N,3,"}"),N.braceNest--,N.braceNest>0&&g(R),N.inLinked&&N.braceNest===0&&(N.inLinked=!1),V;case"@":return N.braceNest>0&&f(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),V=j(R,N)||d(N),N.braceNest=0,V;default:{let C=!0,k=!0,U=!0;if(S(R))return N.braceNest>0&&f(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),V=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,V;if(N.braceNest>0&&(N.currentType===4||N.currentType===5||N.currentType===6))return f(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),N.braceNest=0,G(R,N);if(C=x(R,N))return V=h(N,4,ze(R)),g(R),V;if(k=v(R,N))return V=h(N,5,se(R)),g(R),V;if(U=E(R,N))return V=h(N,6,be(R)),g(R),V;if(!C&&!k&&!U)return V=h(N,12,le(R)),f(Mt.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,V.value),g(R),V;break}}return V}function j(R,N){const{currentType:V}=N;let A=null;const C=R.currentChar();switch((V===7||V===8||V===11||V===9)&&(C===Tn||C===ar)&&f(Mt.INVALID_LINKED_FORMAT,s(),0),C){case"@":return R.next(),A=h(N,7,"@"),N.inLinked=!0,A;case".":return g(R),R.next(),h(N,8,".");case":":return g(R),R.next(),h(N,9,":");default:return S(R)?(A=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,A):T(R,N)||P(R,N)?(g(R),j(R,N)):M(R,N)?(g(R),h(N,11,Oe(R))):b(R,N)?(g(R),C==="{"?w(R,N)||A:h(N,10,I(R))):(V===7&&f(Mt.INVALID_LINKED_FORMAT,s(),0),N.braceNest=0,N.inLinked=!1,G(R,N))}}function G(R,N){let V={type:13};if(N.braceNest>0)return w(R,N)||d(N);if(N.inLinked)return j(R,N)||d(N);switch(R.currentChar()){case"{":return w(R,N)||d(N);case"}":return f(Mt.UNBALANCED_CLOSING_BRACE,s(),0),R.next(),h(N,3,"}");case"@":return j(R,N)||d(N);default:{if(S(R))return V=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,V;if(D(R))return h(N,0,xe(R));break}}return V}function q(){const{currentType:R,offset:N,startLoc:V,endLoc:A}=l;return l.lastType=R,l.lastOffset=N,l.lastStartLoc=V,l.lastEndLoc=A,l.offset=r(),l.startLoc=s(),i.currentChar()===Hr?h(l,13):G(i,l)}return{nextToken:q,currentOffset:r,currentPosition:s,context:c}}const Oz="parser",Nz=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Uz(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function Fz(n={}){const e=n.location!==!1,{onError:t}=n;function i(m,y,x,v,...E){const T=m.currentPosition();if(T.offset+=v,T.column+=v,t){const M=e?Lm(x,T):null,P=cd(y,M,{domain:Oz,args:E});t(P)}}function r(m,y,x){const v={type:m};return e&&(v.start=y,v.end=y,v.loc={start:x,end:x}),v}function s(m,y,x,v){e&&(m.end=y,m.loc&&(m.loc.end=x))}function o(m,y){const x=m.context(),v=r(3,x.offset,x.startLoc);return v.value=y,s(v,m.currentOffset(),m.currentPosition()),v}function a(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=r(5,v,E);return T.index=parseInt(y,10),m.nextToken(),s(T,m.currentOffset(),m.currentPosition()),T}function l(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=r(4,v,E);return T.key=y,m.nextToken(),s(T,m.currentOffset(),m.currentPosition()),T}function c(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=r(9,v,E);return T.value=y.replace(Nz,Uz),m.nextToken(),s(T,m.currentOffset(),m.currentPosition()),T}function u(m){const y=m.nextToken(),x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=r(8,v,E);return y.type!==11?(i(m,Mt.UNEXPECTED_EMPTY_LINKED_MODIFIER,x.lastStartLoc,0),T.value="",s(T,v,E),{nextConsumeToken:y,node:T}):(y.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Ni(y)),T.value=y.value||"",s(T,m.currentOffset(),m.currentPosition()),{node:T})}function f(m,y){const x=m.context(),v=r(7,x.offset,x.startLoc);return v.value=y,s(v,m.currentOffset(),m.currentPosition()),v}function h(m){const y=m.context(),x=r(6,y.offset,y.startLoc);let v=m.nextToken();if(v.type===8){const E=u(m);x.modifier=E.node,v=E.nextConsumeToken||m.nextToken()}switch(v.type!==9&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),v=m.nextToken(),v.type===2&&(v=m.nextToken()),v.type){case 10:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=f(m,v.value||"");break;case 4:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=l(m,v.value||"");break;case 5:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=a(m,v.value||"");break;case 6:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=c(m,v.value||"");break;default:{i(m,Mt.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const E=m.context(),T=r(7,E.offset,E.startLoc);return T.value="",s(T,E.offset,E.startLoc),x.key=T,s(x,E.offset,E.startLoc),{nextConsumeToken:v,node:x}}}return s(x,m.currentOffset(),m.currentPosition()),{node:x}}function d(m){const y=m.context(),x=y.currentType===1?m.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,E=r(2,x,v);E.items=[];let T=null;do{const b=T||m.nextToken();switch(T=null,b.type){case 0:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(o(m,b.value||""));break;case 5:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(a(m,b.value||""));break;case 4:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(l(m,b.value||""));break;case 6:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(c(m,b.value||""));break;case 7:{const S=h(m);E.items.push(S.node),T=S.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const M=y.currentType===1?y.lastOffset:m.currentOffset(),P=y.currentType===1?y.lastEndLoc:m.currentPosition();return s(E,M,P),E}function p(m,y,x,v){const E=m.context();let T=v.items.length===0;const M=r(1,y,x);M.cases=[],M.cases.push(v);do{const P=d(m);T||(T=P.items.length===0),M.cases.push(P)}while(E.currentType!==13);return T&&i(m,Mt.MUST_HAVE_MESSAGES_IN_PLURAL,x,0),s(M,m.currentOffset(),m.currentPosition()),M}function _(m){const y=m.context(),{offset:x,startLoc:v}=y,E=d(m);return y.currentType===13?E:p(m,x,v,E)}function g(m){const y=Dz(m,nn({},n)),x=y.context(),v=r(0,x.offset,x.startLoc);return e&&v.loc&&(v.loc.source=m),v.body=_(y),n.onCacheKey&&(v.cacheKey=n.onCacheKey(m)),x.currentType!==13&&i(y,Mt.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,m[x.offset]||""),s(v,y.currentOffset(),y.currentPosition()),v}return{parse:g}}function Ni(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Bz(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:s=>(t.helpers.add(s),s)}}function ix(n,e){for(let t=0;trx(t)),n}function rx(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;to;function l(_,g){o.code+=_}function c(_,g=!0){const m=g?i:"";l(r?m+" ".repeat(_):m)}function u(_=!0){const g=++o.indentLevel;_&&c(g)}function f(_=!0){const g=--o.indentLevel;_&&c(g)}function h(){c(o.indentLevel)}return{context:a,push:l,indent:u,deindent:f,newline:h,helper:_=>`_${_}`,needIndent:()=>o.needIndent}}function Hz(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),da(n,e.key),e.modifier?(n.push(", "),da(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function Gz(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const r=e.items.length;for(let s=0;s1){n.push(`${t("plural")}([`),n.indent(i());const r=e.cases.length;for(let s=0;s{const t=De(e.mode)?e.mode:"normal",i=De(e.filename)?e.filename:"message.intl";e.sourceMap;const r=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` -`,s=e.needIndent?e.needIndent:t!=="arrow",o=n.helpers||[],a=zz(n,{filename:i,breakLineCode:r,needIndent:s});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(s),o.length>0&&(a.push(`const { ${y_(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),da(a,n),a.deindent(s),a.push("}"),delete n.helpers;const{code:l,map:c}=a.context();return{ast:n,code:l,map:c?c.toJSON():void 0}};function qz(n,e={}){const t=nn({},e),i=!!t.jit,r=!!t.minify,s=t.optimize==null?!0:t.optimize,a=Fz(t).parse(n);return i?(s&&Vz(a),r&&Go(a),{ast:a,code:""}):(kz(a,t),$z(a,t))}/*! + */function Ez(n,e,t){return{line:n,column:e,offset:t}}function Lm(n,e,t){return{start:n,end:e}}const Mt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},Tz=17;function cd(n,e,t={}){const{domain:i,messages:s,args:r}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function wz(n){throw n}const as=" ",Az="\r",Tn=` +`,Cz="\u2028",Rz="\u2029";function Pz(n){const e=n;let t=0,i=1,s=1,r=0;const o=M=>e[M]===Az&&e[M+1]===Tn,a=M=>e[M]===Tn,l=M=>e[M]===Rz,c=M=>e[M]===Cz,u=M=>o(M)||a(M)||l(M)||c(M),f=()=>t,h=()=>i,d=()=>s,p=()=>r,_=M=>o(M)||l(M)||c(M)?Tn:e[M],g=()=>_(t),m=()=>_(t+r);function y(){return r=0,u(t)&&(i++,s=0),o(t)&&t++,t++,s++,e[t]}function x(){return o(t+r)&&r++,r++,e[t+r]}function v(){t=0,i=1,s=1,r=0}function E(M=0){r=M}function T(){const M=t+r;for(;M!==t;)y();r=0}return{index:f,line:h,column:d,peekOffset:p,charAt:_,currentChar:g,currentPeek:m,next:y,peek:x,reset:v,resetPeek:E,skipToPeek:T}}const Hs=void 0,Iz=".",nx="'",Lz="tokenizer";function Dz(n,e={}){const t=e.location!==!1,i=Pz(n),s=()=>i.index(),r=()=>Ez(i.line(),i.column(),i.index()),o=r(),a=s(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(R,N,V,...A){const C=c();if(N.column+=V,N.offset+=V,u){const k=t?Lm(C.startLoc,N):null,U=cd(R,k,{domain:Lz,args:A});u(U)}}function h(R,N,V){R.endLoc=r(),R.currentType=N;const A={type:N};return t&&(A.loc=Lm(R.startLoc,R.endLoc)),V!=null&&(A.value=V),A}const d=R=>h(R,13);function p(R,N){return R.currentChar()===N?(R.next(),N):(f(Mt.EXPECTED_TOKEN,r(),0,N),"")}function _(R){let N="";for(;R.currentPeek()===as||R.currentPeek()===Tn;)N+=R.currentPeek(),R.peek();return N}function g(R){const N=_(R);return R.skipToPeek(),N}function m(R){if(R===Hs)return!1;const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N===95}function y(R){if(R===Hs)return!1;const N=R.charCodeAt(0);return N>=48&&N<=57}function x(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=m(R.currentPeek());return R.resetPeek(),A}function v(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=R.currentPeek()==="-"?R.peek():R.currentPeek(),C=y(A);return R.resetPeek(),C}function E(R,N){const{currentType:V}=N;if(V!==2)return!1;_(R);const A=R.currentPeek()===nx;return R.resetPeek(),A}function T(R,N){const{currentType:V}=N;if(V!==7)return!1;_(R);const A=R.currentPeek()===".";return R.resetPeek(),A}function M(R,N){const{currentType:V}=N;if(V!==8)return!1;_(R);const A=m(R.currentPeek());return R.resetPeek(),A}function P(R,N){const{currentType:V}=N;if(!(V===7||V===11))return!1;_(R);const A=R.currentPeek()===":";return R.resetPeek(),A}function b(R,N){const{currentType:V}=N;if(V!==9)return!1;const A=()=>{const k=R.currentPeek();return k==="{"?m(R.peek()):k==="@"||k==="|"||k===":"||k==="."||k===as||!k?!1:k===Tn?(R.peek(),A()):D(R,!1)},C=A();return R.resetPeek(),C}function S(R){_(R);const N=R.currentPeek()==="|";return R.resetPeek(),N}function D(R,N=!0){const V=(C=!1,k="")=>{const U=R.currentPeek();return U==="{"||U==="@"||!U?C:U==="|"?!(k===as||k===Tn):U===as?(R.peek(),V(!0,as)):U===Tn?(R.peek(),V(!0,Tn)):!0},A=V();return N&&R.resetPeek(),A}function B(R,N){const V=R.currentChar();return V===Hs?Hs:N(V)?(R.next(),V):null}function H(R){const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N>=48&&N<=57||N===95||N===36}function $(R){return B(R,H)}function ee(R){const N=R.charCodeAt(0);return N>=97&&N<=122||N>=65&&N<=90||N>=48&&N<=57||N===95||N===36||N===45}function Z(R){return B(R,ee)}function te(R){const N=R.charCodeAt(0);return N>=48&&N<=57}function Q(R){return B(R,te)}function pe(R){const N=R.charCodeAt(0);return N>=48&&N<=57||N>=65&&N<=70||N>=97&&N<=102}function ve(R){return B(R,pe)}function se(R){let N="",V="";for(;N=Q(R);)V+=N;return V}function xe(R){let N="";for(;;){const V=R.currentChar();if(V==="{"||V==="}"||V==="@"||V==="|"||!V)break;if(V===as||V===Tn)if(D(R))N+=V,R.next();else{if(S(R))break;N+=V,R.next()}else N+=V,R.next()}return N}function ze(R){g(R);let N="",V="";for(;N=Z(R);)V+=N;return R.currentChar()===Hs&&f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),V}function re(R){g(R);let N="";return R.currentChar()==="-"?(R.next(),N+=`-${se(R)}`):N+=se(R),R.currentChar()===Hs&&f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),N}function ge(R){return R!==nx&&R!==Tn}function be(R){g(R),p(R,"'");let N="",V="";for(;N=B(R,ge);)N==="\\"?V+=W(R):V+=N;const A=R.currentChar();return A===Tn||A===Hs?(f(Mt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),A===Tn&&(R.next(),p(R,"'")),V):(p(R,"'"),V)}function W(R){const N=R.currentChar();switch(N){case"\\":case"'":return R.next(),`\\${N}`;case"u":return ae(R,N,4);case"U":return ae(R,N,6);default:return f(Mt.UNKNOWN_ESCAPE_SEQUENCE,r(),0,N),""}}function ae(R,N,V){p(R,N);let A="";for(let C=0;C{const A=R.currentChar();return A==="{"||A==="@"||A==="|"||A==="("||A===")"||!A||A===as?V:(V+=A,R.next(),N(V))};return N("")}function L(R){g(R);const N=p(R,"|");return g(R),N}function w(R,N){let V=null;switch(R.currentChar()){case"{":return N.braceNest>=1&&f(Mt.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),R.next(),V=h(N,2,"{"),g(R),N.braceNest++,V;case"}":return N.braceNest>0&&N.currentType===2&&f(Mt.EMPTY_PLACEHOLDER,r(),0),R.next(),V=h(N,3,"}"),N.braceNest--,N.braceNest>0&&g(R),N.inLinked&&N.braceNest===0&&(N.inLinked=!1),V;case"@":return N.braceNest>0&&f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),V=j(R,N)||d(N),N.braceNest=0,V;default:{let C=!0,k=!0,U=!0;if(S(R))return N.braceNest>0&&f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),V=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,V;if(N.braceNest>0&&(N.currentType===4||N.currentType===5||N.currentType===6))return f(Mt.UNTERMINATED_CLOSING_BRACE,r(),0),N.braceNest=0,G(R,N);if(C=x(R,N))return V=h(N,4,ze(R)),g(R),V;if(k=v(R,N))return V=h(N,5,re(R)),g(R),V;if(U=E(R,N))return V=h(N,6,be(R)),g(R),V;if(!C&&!k&&!U)return V=h(N,12,le(R)),f(Mt.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,V.value),g(R),V;break}}return V}function j(R,N){const{currentType:V}=N;let A=null;const C=R.currentChar();switch((V===7||V===8||V===11||V===9)&&(C===Tn||C===as)&&f(Mt.INVALID_LINKED_FORMAT,r(),0),C){case"@":return R.next(),A=h(N,7,"@"),N.inLinked=!0,A;case".":return g(R),R.next(),h(N,8,".");case":":return g(R),R.next(),h(N,9,":");default:return S(R)?(A=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,A):T(R,N)||P(R,N)?(g(R),j(R,N)):M(R,N)?(g(R),h(N,11,Oe(R))):b(R,N)?(g(R),C==="{"?w(R,N)||A:h(N,10,I(R))):(V===7&&f(Mt.INVALID_LINKED_FORMAT,r(),0),N.braceNest=0,N.inLinked=!1,G(R,N))}}function G(R,N){let V={type:13};if(N.braceNest>0)return w(R,N)||d(N);if(N.inLinked)return j(R,N)||d(N);switch(R.currentChar()){case"{":return w(R,N)||d(N);case"}":return f(Mt.UNBALANCED_CLOSING_BRACE,r(),0),R.next(),h(N,3,"}");case"@":return j(R,N)||d(N);default:{if(S(R))return V=h(N,1,L(R)),N.braceNest=0,N.inLinked=!1,V;if(D(R))return h(N,0,xe(R));break}}return V}function q(){const{currentType:R,offset:N,startLoc:V,endLoc:A}=l;return l.lastType=R,l.lastOffset=N,l.lastStartLoc=V,l.lastEndLoc=A,l.offset=s(),l.startLoc=r(),i.currentChar()===Hs?h(l,13):G(i,l)}return{nextToken:q,currentOffset:s,currentPosition:r,context:c}}const Oz="parser",Nz=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Uz(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function Fz(n={}){const e=n.location!==!1,{onError:t}=n;function i(m,y,x,v,...E){const T=m.currentPosition();if(T.offset+=v,T.column+=v,t){const M=e?Lm(x,T):null,P=cd(y,M,{domain:Oz,args:E});t(P)}}function s(m,y,x){const v={type:m};return e&&(v.start=y,v.end=y,v.loc={start:x,end:x}),v}function r(m,y,x,v){e&&(m.end=y,m.loc&&(m.loc.end=x))}function o(m,y){const x=m.context(),v=s(3,x.offset,x.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function a(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=s(5,v,E);return T.index=parseInt(y,10),m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function l(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=s(4,v,E);return T.key=y,m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function c(m,y){const x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=s(9,v,E);return T.value=y.replace(Nz,Uz),m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function u(m){const y=m.nextToken(),x=m.context(),{lastOffset:v,lastStartLoc:E}=x,T=s(8,v,E);return y.type!==11?(i(m,Mt.UNEXPECTED_EMPTY_LINKED_MODIFIER,x.lastStartLoc,0),T.value="",r(T,v,E),{nextConsumeToken:y,node:T}):(y.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Ni(y)),T.value=y.value||"",r(T,m.currentOffset(),m.currentPosition()),{node:T})}function f(m,y){const x=m.context(),v=s(7,x.offset,x.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function h(m){const y=m.context(),x=s(6,y.offset,y.startLoc);let v=m.nextToken();if(v.type===8){const E=u(m);x.modifier=E.node,v=E.nextConsumeToken||m.nextToken()}switch(v.type!==9&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),v=m.nextToken(),v.type===2&&(v=m.nextToken()),v.type){case 10:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=f(m,v.value||"");break;case 4:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=l(m,v.value||"");break;case 5:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=a(m,v.value||"");break;case 6:v.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(v)),x.key=c(m,v.value||"");break;default:{i(m,Mt.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const E=m.context(),T=s(7,E.offset,E.startLoc);return T.value="",r(T,E.offset,E.startLoc),x.key=T,r(x,E.offset,E.startLoc),{nextConsumeToken:v,node:x}}}return r(x,m.currentOffset(),m.currentPosition()),{node:x}}function d(m){const y=m.context(),x=y.currentType===1?m.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,E=s(2,x,v);E.items=[];let T=null;do{const b=T||m.nextToken();switch(T=null,b.type){case 0:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(o(m,b.value||""));break;case 5:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(a(m,b.value||""));break;case 4:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(l(m,b.value||""));break;case 6:b.value==null&&i(m,Mt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Ni(b)),E.items.push(c(m,b.value||""));break;case 7:{const S=h(m);E.items.push(S.node),T=S.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const M=y.currentType===1?y.lastOffset:m.currentOffset(),P=y.currentType===1?y.lastEndLoc:m.currentPosition();return r(E,M,P),E}function p(m,y,x,v){const E=m.context();let T=v.items.length===0;const M=s(1,y,x);M.cases=[],M.cases.push(v);do{const P=d(m);T||(T=P.items.length===0),M.cases.push(P)}while(E.currentType!==13);return T&&i(m,Mt.MUST_HAVE_MESSAGES_IN_PLURAL,x,0),r(M,m.currentOffset(),m.currentPosition()),M}function _(m){const y=m.context(),{offset:x,startLoc:v}=y,E=d(m);return y.currentType===13?E:p(m,x,v,E)}function g(m){const y=Dz(m,nn({},n)),x=y.context(),v=s(0,x.offset,x.startLoc);return e&&v.loc&&(v.loc.source=m),v.body=_(y),n.onCacheKey&&(v.cacheKey=n.onCacheKey(m)),x.currentType!==13&&i(y,Mt.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,m[x.offset]||""),r(v,y.currentOffset(),y.currentPosition()),v}return{parse:g}}function Ni(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Bz(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:r=>(t.helpers.add(r),r)}}function ix(n,e){for(let t=0;tsx(t)),n}function sx(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;to;function l(_,g){o.code+=_}function c(_,g=!0){const m=g?i:"";l(s?m+" ".repeat(_):m)}function u(_=!0){const g=++o.indentLevel;_&&c(g)}function f(_=!0){const g=--o.indentLevel;_&&c(g)}function h(){c(o.indentLevel)}return{context:a,push:l,indent:u,deindent:f,newline:h,helper:_=>`_${_}`,needIndent:()=>o.needIndent}}function Hz(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),da(n,e.key),e.modifier?(n.push(", "),da(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function Gz(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const s=e.items.length;for(let r=0;r1){n.push(`${t("plural")}([`),n.indent(i());const s=e.cases.length;for(let r=0;r{const t=De(e.mode)?e.mode:"normal",i=De(e.filename)?e.filename:"message.intl";e.sourceMap;const s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` +`,r=e.needIndent?e.needIndent:t!=="arrow",o=n.helpers||[],a=zz(n,{filename:i,breakLineCode:s,needIndent:r});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(r),o.length>0&&(a.push(`const { ${y_(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),da(a,n),a.deindent(r),a.push("}"),delete n.helpers;const{code:l,map:c}=a.context();return{ast:n,code:l,map:c?c.toJSON():void 0}};function qz(n,e={}){const t=nn({},e),i=!!t.jit,s=!!t.minify,r=t.optimize==null?!0:t.optimize,a=Fz(t).parse(n);return i?(r&&Vz(a),s&&Go(a),{ast:a,code:""}):(kz(a,t),$z(a,t))}/*! * core-base v11.1.2 * (c) 2025 kazuya kawaguchi * Released under the MIT License. - */function Yz(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(__().__INTLIFY_PROD_DEVTOOLS__=!1)}function Cp(n){return t=>jz(t,n)}function jz(n,e){const t=Zz(e);if(t==null)throw Jl(0);if(b_(t)===1){const s=Qz(t);return n.plural(s.reduce((o,a)=>[...o,sx(n,a)],[]))}else return sx(n,t)}const Kz=["b","body"];function Zz(n){return ms(n,Kz)}const Jz=["c","cases"];function Qz(n){return ms(n,Jz,[])}function sx(n,e){const t=tH(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=iH(e).reduce((r,s)=>[...r,Dm(n,s)],[]);return n.normalize(i)}}const eH=["s","static"];function tH(n){return ms(n,eH)}const nH=["i","items"];function iH(n){return ms(n,nH,[])}function Dm(n,e){const t=b_(e);switch(t){case 3:return Nu(e,t);case 9:return Nu(e,t);case 4:{const i=e;if(Ti(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Ti(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw Jl(t)}case 5:{const i=e;if(Ti(i,"i")&&qt(i.i))return n.interpolate(n.list(i.i));if(Ti(i,"index")&&qt(i.index))return n.interpolate(n.list(i.index));throw Jl(t)}case 6:{const i=e,r=aH(i),s=cH(i);return n.linked(Dm(n,s),r?Dm(n,r):void 0,n.type)}case 7:return Nu(e,t);case 8:return Nu(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const rH=["t","type"];function b_(n){return ms(n,rH)}const sH=["v","value"];function Nu(n,e){const t=ms(n,sH);if(t)return t;throw Jl(e)}const oH=["m","modifier"];function aH(n){return ms(n,oH)}const lH=["k","key"];function cH(n){const e=ms(n,lH);if(e)return e;throw Jl(6)}function ms(n,e,t){for(let i=0;in;let Uu=Tt();function pa(n){return mt(n)&&b_(n)===0&&(Ti(n,"b")||Ti(n,"body"))}function fH(n,e={}){let t=!1;const i=e.onError||wz;return e.onError=r=>{t=!0,i(r)},{...qz(n,e),detectError:t}}function hH(n,e){if(De(n)){Nt(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||uH)(n),r=Uu[i];if(r)return r;const{ast:s,detectError:o}=fH(n,{...e,location:!1,jit:!0}),a=Cp(s);return o?a:Uu[i]=a}else{const t=n.cacheKey;if(t){const i=Uu[t];return i||(Uu[t]=Cp(n))}else return Cp(n)}}let Ql=null;function dH(n){Ql=n}function pH(n,e,t){Ql&&Ql.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const mH=gH("function:translate");function gH(n){return e=>Ql&&Ql.emit(n,e)}const gr={INVALID_ARGUMENT:Tz,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},_H=24;function _r(n){return cd(n,null,void 0)}function S_(n,e){return e.locale!=null?ox(e.locale):ox(n.locale)}let Rp;function ox(n){if(De(n))return n;if(Ot(n)){if(n.resolvedOnce&&Rp!=null)return Rp;if(n.constructor.name==="Function"){const e=n();if(bz(e))throw _r(gr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Rp=e}else throw _r(gr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw _r(gr.NOT_SUPPORT_LOCALE_TYPE)}function vH(n,e,t){return[...new Set([t,...Kt(e)?e:mt(e)?Object.keys(e):De(e)?[e]:[t]])]}function GT(n,e,t){const i=De(t)?t:ih,r=n;r.__localeChainCache||(r.__localeChainCache=new Map);let s=r.__localeChainCache.get(i);if(!s){s=[];let o=[t];for(;Kt(o);)o=ax(s,o,e);const a=Kt(e)||!lt(e)?e:e.default?e.default:null;o=De(a)?[a]:a,Kt(o)&&ax(s,o,!1),r.__localeChainCache.set(i,s)}return s}function ax(n,e,t){let i=!0;for(let r=0;r{o===void 0?o=a:o+=a},h[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},h[2]=()=>{h[0](),r++},h[3]=()=>{if(r>0)r--,i=4,h[0]();else{if(r=0,o===void 0||(o=TH(o),o===!1))return!1;h[1]()}};function d(){const p=n[t+1];if(i===5&&p==="'"||i===6&&p==='"')return t++,a="\\"+p,h[0](),!0}for(;i!==null;)if(t++,s=n[t],!(s==="\\"&&d())){if(l=EH(s),f=gs[i],c=f[l]||f.l||8,c===8||(i=c[0],c[1]!==void 0&&(u=h[c[1]],u&&(a=s,u()===!1))))return;if(i===7)return e}}const lx=new Map;function AH(n,e){return mt(n)?n[e]:null}function CH(n,e){if(!mt(n))return null;let t=lx.get(e);if(t||(t=wH(e),t&&lx.set(e,t)),!t)return null;const i=t.length;let r=n,s=0;for(;s`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function PH(){return{upper:(n,e)=>e==="text"&&De(n)?n.toUpperCase():e==="vnode"&&mt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&De(n)?n.toLowerCase():e==="vnode"&&mt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&De(n)?ux(n):e==="vnode"&&mt(n)&&"__v_isVNode"in n?ux(n.children):n}}let WT;function IH(n){WT=n}let XT;function LH(n){XT=n}let $T;function DH(n){$T=n}let qT=null;const OH=n=>{qT=n},NH=()=>qT;let YT=null;const fx=n=>{YT=n},UH=()=>YT;let hx=0;function FH(n={}){const e=Ot(n.onWarn)?n.onWarn:Mz,t=De(n.version)?n.version:RH,i=De(n.locale)||Ot(n.locale)?n.locale:ih,r=Ot(i)?ih:i,s=Kt(n.fallbackLocale)||lt(n.fallbackLocale)||De(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:r,o=lt(n.messages)?n.messages:Pp(r),a=lt(n.datetimeFormats)?n.datetimeFormats:Pp(r),l=lt(n.numberFormats)?n.numberFormats:Pp(r),c=nn(Tt(),n.modifiers,PH()),u=n.pluralRules||Tt(),f=Ot(n.missing)?n.missing:null,h=Nt(n.missingWarn)||nh(n.missingWarn)?n.missingWarn:!0,d=Nt(n.fallbackWarn)||nh(n.fallbackWarn)?n.fallbackWarn:!0,p=!!n.fallbackFormat,_=!!n.unresolving,g=Ot(n.postTranslation)?n.postTranslation:null,m=lt(n.processor)?n.processor:null,y=Nt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,x=!!n.escapeParameter,v=Ot(n.messageCompiler)?n.messageCompiler:WT,E=Ot(n.messageResolver)?n.messageResolver:XT||AH,T=Ot(n.localeFallbacker)?n.localeFallbacker:$T||vH,M=mt(n.fallbackContext)?n.fallbackContext:void 0,P=n,b=mt(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,S=mt(P.__numberFormatters)?P.__numberFormatters:new Map,D=mt(P.__meta)?P.__meta:{};hx++;const B={version:t,cid:hx,locale:i,fallbackLocale:s,messages:o,modifiers:c,pluralRules:u,missing:f,missingWarn:h,fallbackWarn:d,fallbackFormat:p,unresolving:_,postTranslation:g,processor:m,warnHtmlMessage:y,escapeParameter:x,messageCompiler:v,messageResolver:E,localeFallbacker:T,fallbackContext:M,onWarn:e,__meta:D};return B.datetimeFormats=a,B.numberFormats=l,B.__datetimeFormatters=b,B.__numberFormatters=S,__INTLIFY_PROD_DEVTOOLS__&&pH(B,t,D),B}const Pp=n=>({[n]:Tt()});function M_(n,e,t,i,r){const{missing:s,onWarn:o}=n;if(s!==null){const a=s(n,t,e,r);return De(a)?a:e}else return e}function Ha(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function BH(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function kH(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{jT.includes(l)?o[l]=t[l]:s[l]=t[l]}),De(i)?s.locale=i:lt(i)&&(o=i),lt(r)&&(o=r),[s.key||"",a,s,o]}function px(n,e,t){const i=n;for(const r in t){const s=`${e}__${r}`;i.__datetimeFormatters.has(s)&&i.__datetimeFormatters.delete(s)}}function mx(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:r,onWarn:s,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,f]=Nm(...e),h=Nt(u.missingWarn)?u.missingWarn:n.missingWarn;Nt(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const d=!!u.part,p=S_(n,u),_=o(n,r,p);if(!De(l)||l==="")return new Intl.NumberFormat(p,f).format(c);let g={},m,y=null;const x="number format";for(let T=0;T<_.length&&(m=_[T],g=t[m]||{},y=g[l],!lt(y));T++)M_(n,l,m,h,x);if(!lt(y)||!De(m))return i?ud:l;let v=`${m}__${l}`;ld(f)||(v=`${v}__${JSON.stringify(f)}`);let E=a.get(v);return E||(E=new Intl.NumberFormat(m,nn({},y,f)),a.set(v,E)),d?E.formatToParts(c):E.format(c)}const KT=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Nm(...n){const[e,t,i,r]=n,s=Tt();let o=Tt();if(!qt(e))throw _r(gr.INVALID_ARGUMENT);const a=e;return De(t)?s.key=t:lt(t)&&Object.keys(t).forEach(l=>{KT.includes(l)?o[l]=t[l]:s[l]=t[l]}),De(i)?s.locale=i:lt(i)&&(o=i),lt(r)&&(o=r),[s.key||"",a,s,o]}function gx(n,e,t){const i=n;for(const r in t){const s=`${e}__${r}`;i.__numberFormatters.has(s)&&i.__numberFormatters.delete(s)}}const VH=n=>n,zH=n=>"",HH="text",GH=n=>n.length===0?"":y_(n),WH=Sz;function _x(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function XH(n){const e=qt(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(qt(n.named.count)||qt(n.named.n))?qt(n.named.count)?n.named.count:qt(n.named.n)?n.named.n:e:e}function $H(n,e){e.count||(e.count=n),e.n||(e.n=n)}function qH(n={}){const e=n.locale,t=XH(n),i=mt(n.pluralRules)&&De(e)&&Ot(n.pluralRules[e])?n.pluralRules[e]:_x,r=mt(n.pluralRules)&&De(e)&&Ot(n.pluralRules[e])?_x:void 0,s=m=>m[i(t,m.length,r)],o=n.list||[],a=m=>o[m],l=n.named||Tt();qt(n.pluralIndex)&&$H(t,l);const c=m=>l[m];function u(m,y){const x=Ot(n.messages)?n.messages(m,!!y):mt(n.messages)?n.messages[m]:!1;return x||(n.parent?n.parent.message(m):zH)}const f=m=>n.modifiers?n.modifiers[m]:VH,h=lt(n.processor)&&Ot(n.processor.normalize)?n.processor.normalize:GH,d=lt(n.processor)&&Ot(n.processor.interpolate)?n.processor.interpolate:WH,p=lt(n.processor)&&De(n.processor.type)?n.processor.type:HH,g={list:a,named:c,plural:s,linked:(m,...y)=>{const[x,v]=y;let E="text",T="";y.length===1?mt(x)?(T=x.modifier||T,E=x.type||E):De(x)&&(T=x||T):y.length===2&&(De(x)&&(T=x||T),De(v)&&(E=v||E));const M=u(m,!0)(g),P=E==="vnode"&&Kt(M)&&T?M[0]:M;return T?f(T)(P,E):P},message:u,type:p,interpolate:d,normalize:h,values:nn(Tt(),o,l)};return g}const vx=()=>"",ai=n=>Ot(n);function yx(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:r,messageCompiler:s,fallbackLocale:o,messages:a}=n,[l,c]=Um(...e),u=Nt(c.missingWarn)?c.missingWarn:n.missingWarn,f=Nt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,h=Nt(c.escapeParameter)?c.escapeParameter:n.escapeParameter,d=!!c.resolvedMessage,p=De(c.default)||Nt(c.default)?Nt(c.default)?s?l:()=>l:c.default:t?s?l:()=>l:null,_=t||p!=null&&(De(p)||Ot(p)),g=S_(n,c);h&&YH(c);let[m,y,x]=d?[l,g,a[g]||Tt()]:ZT(n,l,g,o,f,u),v=m,E=l;if(!d&&!(De(v)||pa(v)||ai(v))&&_&&(v=p,E=v),!d&&(!(De(v)||pa(v)||ai(v))||!De(y)))return r?ud:l;let T=!1;const M=()=>{T=!0},P=ai(v)?v:JT(n,l,y,v,E,M);if(T)return v;const b=ZH(n,y,x,c),S=qH(b),D=jH(n,P,S),B=i?i(D,l):D;if(__INTLIFY_PROD_DEVTOOLS__){const H={timestamp:Date.now(),key:De(l)?l:ai(v)?v.key:"",locale:y||(ai(v)?v.locale:""),format:De(v)?v:ai(v)?v.source:"",message:B};H.meta=nn({},n.__meta,NH()||{}),mH(H)}return B}function YH(n){Kt(n.list)?n.list=n.list.map(e=>De(e)?tx(e):e):mt(n.named)&&Object.keys(n.named).forEach(e=>{De(n.named[e])&&(n.named[e]=tx(n.named[e]))})}function ZT(n,e,t,i,r,s){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let f=Tt(),h,d=null;const p="translate";for(let _=0;_i;return c.locale=t,c.key=e,c}const l=o(i,KH(n,t,r,i,a,s));return l.locale=t,l.key=e,l.source=i,l}function jH(n,e,t){return e(t)}function Um(...n){const[e,t,i]=n,r=Tt();if(!De(e)&&!qt(e)&&!ai(e)&&!pa(e))throw _r(gr.INVALID_ARGUMENT);const s=qt(e)?String(e):(ai(e),e);return qt(t)?r.plural=t:De(t)?r.default=t:lt(t)&&!ld(t)?r.named=t:Kt(t)&&(r.list=t),qt(i)?r.plural=i:De(i)?r.default=i:lt(i)&&nn(r,i),[s,r]}function KH(n,e,t,i,r,s){return{locale:e,key:t,warnHtmlMessage:r,onError:o=>{throw s&&s(o),o},onCacheKey:o=>gz(e,t,o)}}function ZH(n,e,t,i){const{modifiers:r,pluralRules:s,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=n,h={locale:e,modifiers:r,pluralRules:s,messages:(d,p)=>{let _=o(t,d);if(_==null&&(u||p)){const[,,g]=ZT(u||n,d,e,a,l,c);_=o(g,d)}if(De(_)||pa(_)){let g=!1;const y=JT(n,d,e,_,d,()=>{g=!0});return g?vx:y}else return ai(_)?_:vx}};return n.processor&&(h.processor=n.processor),i.list&&(h.list=i.list),i.named&&(h.named=i.named),qt(i.plural)&&(h.pluralIndex=i.plural),h}Yz();/*! + */function Yz(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(__().__INTLIFY_PROD_DEVTOOLS__=!1)}function Cp(n){return t=>jz(t,n)}function jz(n,e){const t=Zz(e);if(t==null)throw Jl(0);if(b_(t)===1){const r=Qz(t);return n.plural(r.reduce((o,a)=>[...o,rx(n,a)],[]))}else return rx(n,t)}const Kz=["b","body"];function Zz(n){return mr(n,Kz)}const Jz=["c","cases"];function Qz(n){return mr(n,Jz,[])}function rx(n,e){const t=tH(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=iH(e).reduce((s,r)=>[...s,Dm(n,r)],[]);return n.normalize(i)}}const eH=["s","static"];function tH(n){return mr(n,eH)}const nH=["i","items"];function iH(n){return mr(n,nH,[])}function Dm(n,e){const t=b_(e);switch(t){case 3:return Nu(e,t);case 9:return Nu(e,t);case 4:{const i=e;if(Ti(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Ti(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw Jl(t)}case 5:{const i=e;if(Ti(i,"i")&&qt(i.i))return n.interpolate(n.list(i.i));if(Ti(i,"index")&&qt(i.index))return n.interpolate(n.list(i.index));throw Jl(t)}case 6:{const i=e,s=aH(i),r=cH(i);return n.linked(Dm(n,r),s?Dm(n,s):void 0,n.type)}case 7:return Nu(e,t);case 8:return Nu(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const sH=["t","type"];function b_(n){return mr(n,sH)}const rH=["v","value"];function Nu(n,e){const t=mr(n,rH);if(t)return t;throw Jl(e)}const oH=["m","modifier"];function aH(n){return mr(n,oH)}const lH=["k","key"];function cH(n){const e=mr(n,lH);if(e)return e;throw Jl(6)}function mr(n,e,t){for(let i=0;in;let Uu=Tt();function pa(n){return mt(n)&&b_(n)===0&&(Ti(n,"b")||Ti(n,"body"))}function fH(n,e={}){let t=!1;const i=e.onError||wz;return e.onError=s=>{t=!0,i(s)},{...qz(n,e),detectError:t}}function hH(n,e){if(De(n)){Nt(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||uH)(n),s=Uu[i];if(s)return s;const{ast:r,detectError:o}=fH(n,{...e,location:!1,jit:!0}),a=Cp(r);return o?a:Uu[i]=a}else{const t=n.cacheKey;if(t){const i=Uu[t];return i||(Uu[t]=Cp(n))}else return Cp(n)}}let Ql=null;function dH(n){Ql=n}function pH(n,e,t){Ql&&Ql.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const mH=gH("function:translate");function gH(n){return e=>Ql&&Ql.emit(n,e)}const gs={INVALID_ARGUMENT:Tz,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},_H=24;function _s(n){return cd(n,null,void 0)}function S_(n,e){return e.locale!=null?ox(e.locale):ox(n.locale)}let Rp;function ox(n){if(De(n))return n;if(Ot(n)){if(n.resolvedOnce&&Rp!=null)return Rp;if(n.constructor.name==="Function"){const e=n();if(bz(e))throw _s(gs.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Rp=e}else throw _s(gs.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw _s(gs.NOT_SUPPORT_LOCALE_TYPE)}function vH(n,e,t){return[...new Set([t,...Kt(e)?e:mt(e)?Object.keys(e):De(e)?[e]:[t]])]}function GT(n,e,t){const i=De(t)?t:ih,s=n;s.__localeChainCache||(s.__localeChainCache=new Map);let r=s.__localeChainCache.get(i);if(!r){r=[];let o=[t];for(;Kt(o);)o=ax(r,o,e);const a=Kt(e)||!lt(e)?e:e.default?e.default:null;o=De(a)?[a]:a,Kt(o)&&ax(r,o,!1),s.__localeChainCache.set(i,r)}return r}function ax(n,e,t){let i=!0;for(let s=0;s{o===void 0?o=a:o+=a},h[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},h[2]=()=>{h[0](),s++},h[3]=()=>{if(s>0)s--,i=4,h[0]();else{if(s=0,o===void 0||(o=TH(o),o===!1))return!1;h[1]()}};function d(){const p=n[t+1];if(i===5&&p==="'"||i===6&&p==='"')return t++,a="\\"+p,h[0](),!0}for(;i!==null;)if(t++,r=n[t],!(r==="\\"&&d())){if(l=EH(r),f=gr[i],c=f[l]||f.l||8,c===8||(i=c[0],c[1]!==void 0&&(u=h[c[1]],u&&(a=r,u()===!1))))return;if(i===7)return e}}const lx=new Map;function AH(n,e){return mt(n)?n[e]:null}function CH(n,e){if(!mt(n))return null;let t=lx.get(e);if(t||(t=wH(e),t&&lx.set(e,t)),!t)return null;const i=t.length;let s=n,r=0;for(;r`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function PH(){return{upper:(n,e)=>e==="text"&&De(n)?n.toUpperCase():e==="vnode"&&mt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&De(n)?n.toLowerCase():e==="vnode"&&mt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&De(n)?ux(n):e==="vnode"&&mt(n)&&"__v_isVNode"in n?ux(n.children):n}}let WT;function IH(n){WT=n}let XT;function LH(n){XT=n}let $T;function DH(n){$T=n}let qT=null;const OH=n=>{qT=n},NH=()=>qT;let YT=null;const fx=n=>{YT=n},UH=()=>YT;let hx=0;function FH(n={}){const e=Ot(n.onWarn)?n.onWarn:Mz,t=De(n.version)?n.version:RH,i=De(n.locale)||Ot(n.locale)?n.locale:ih,s=Ot(i)?ih:i,r=Kt(n.fallbackLocale)||lt(n.fallbackLocale)||De(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:s,o=lt(n.messages)?n.messages:Pp(s),a=lt(n.datetimeFormats)?n.datetimeFormats:Pp(s),l=lt(n.numberFormats)?n.numberFormats:Pp(s),c=nn(Tt(),n.modifiers,PH()),u=n.pluralRules||Tt(),f=Ot(n.missing)?n.missing:null,h=Nt(n.missingWarn)||nh(n.missingWarn)?n.missingWarn:!0,d=Nt(n.fallbackWarn)||nh(n.fallbackWarn)?n.fallbackWarn:!0,p=!!n.fallbackFormat,_=!!n.unresolving,g=Ot(n.postTranslation)?n.postTranslation:null,m=lt(n.processor)?n.processor:null,y=Nt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,x=!!n.escapeParameter,v=Ot(n.messageCompiler)?n.messageCompiler:WT,E=Ot(n.messageResolver)?n.messageResolver:XT||AH,T=Ot(n.localeFallbacker)?n.localeFallbacker:$T||vH,M=mt(n.fallbackContext)?n.fallbackContext:void 0,P=n,b=mt(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,S=mt(P.__numberFormatters)?P.__numberFormatters:new Map,D=mt(P.__meta)?P.__meta:{};hx++;const B={version:t,cid:hx,locale:i,fallbackLocale:r,messages:o,modifiers:c,pluralRules:u,missing:f,missingWarn:h,fallbackWarn:d,fallbackFormat:p,unresolving:_,postTranslation:g,processor:m,warnHtmlMessage:y,escapeParameter:x,messageCompiler:v,messageResolver:E,localeFallbacker:T,fallbackContext:M,onWarn:e,__meta:D};return B.datetimeFormats=a,B.numberFormats=l,B.__datetimeFormatters=b,B.__numberFormatters=S,__INTLIFY_PROD_DEVTOOLS__&&pH(B,t,D),B}const Pp=n=>({[n]:Tt()});function M_(n,e,t,i,s){const{missing:r,onWarn:o}=n;if(r!==null){const a=r(n,t,e,s);return De(a)?a:e}else return e}function Ha(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function BH(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function kH(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{jT.includes(l)?o[l]=t[l]:r[l]=t[l]}),De(i)?r.locale=i:lt(i)&&(o=i),lt(s)&&(o=s),[r.key||"",a,r,o]}function px(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__datetimeFormatters.has(r)&&i.__datetimeFormatters.delete(r)}}function mx(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:s,onWarn:r,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,f]=Nm(...e),h=Nt(u.missingWarn)?u.missingWarn:n.missingWarn;Nt(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const d=!!u.part,p=S_(n,u),_=o(n,s,p);if(!De(l)||l==="")return new Intl.NumberFormat(p,f).format(c);let g={},m,y=null;const x="number format";for(let T=0;T<_.length&&(m=_[T],g=t[m]||{},y=g[l],!lt(y));T++)M_(n,l,m,h,x);if(!lt(y)||!De(m))return i?ud:l;let v=`${m}__${l}`;ld(f)||(v=`${v}__${JSON.stringify(f)}`);let E=a.get(v);return E||(E=new Intl.NumberFormat(m,nn({},y,f)),a.set(v,E)),d?E.formatToParts(c):E.format(c)}const KT=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Nm(...n){const[e,t,i,s]=n,r=Tt();let o=Tt();if(!qt(e))throw _s(gs.INVALID_ARGUMENT);const a=e;return De(t)?r.key=t:lt(t)&&Object.keys(t).forEach(l=>{KT.includes(l)?o[l]=t[l]:r[l]=t[l]}),De(i)?r.locale=i:lt(i)&&(o=i),lt(s)&&(o=s),[r.key||"",a,r,o]}function gx(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__numberFormatters.has(r)&&i.__numberFormatters.delete(r)}}const VH=n=>n,zH=n=>"",HH="text",GH=n=>n.length===0?"":y_(n),WH=Sz;function _x(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function XH(n){const e=qt(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(qt(n.named.count)||qt(n.named.n))?qt(n.named.count)?n.named.count:qt(n.named.n)?n.named.n:e:e}function $H(n,e){e.count||(e.count=n),e.n||(e.n=n)}function qH(n={}){const e=n.locale,t=XH(n),i=mt(n.pluralRules)&&De(e)&&Ot(n.pluralRules[e])?n.pluralRules[e]:_x,s=mt(n.pluralRules)&&De(e)&&Ot(n.pluralRules[e])?_x:void 0,r=m=>m[i(t,m.length,s)],o=n.list||[],a=m=>o[m],l=n.named||Tt();qt(n.pluralIndex)&&$H(t,l);const c=m=>l[m];function u(m,y){const x=Ot(n.messages)?n.messages(m,!!y):mt(n.messages)?n.messages[m]:!1;return x||(n.parent?n.parent.message(m):zH)}const f=m=>n.modifiers?n.modifiers[m]:VH,h=lt(n.processor)&&Ot(n.processor.normalize)?n.processor.normalize:GH,d=lt(n.processor)&&Ot(n.processor.interpolate)?n.processor.interpolate:WH,p=lt(n.processor)&&De(n.processor.type)?n.processor.type:HH,g={list:a,named:c,plural:r,linked:(m,...y)=>{const[x,v]=y;let E="text",T="";y.length===1?mt(x)?(T=x.modifier||T,E=x.type||E):De(x)&&(T=x||T):y.length===2&&(De(x)&&(T=x||T),De(v)&&(E=v||E));const M=u(m,!0)(g),P=E==="vnode"&&Kt(M)&&T?M[0]:M;return T?f(T)(P,E):P},message:u,type:p,interpolate:d,normalize:h,values:nn(Tt(),o,l)};return g}const vx=()=>"",ai=n=>Ot(n);function yx(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:s,messageCompiler:r,fallbackLocale:o,messages:a}=n,[l,c]=Um(...e),u=Nt(c.missingWarn)?c.missingWarn:n.missingWarn,f=Nt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,h=Nt(c.escapeParameter)?c.escapeParameter:n.escapeParameter,d=!!c.resolvedMessage,p=De(c.default)||Nt(c.default)?Nt(c.default)?r?l:()=>l:c.default:t?r?l:()=>l:null,_=t||p!=null&&(De(p)||Ot(p)),g=S_(n,c);h&&YH(c);let[m,y,x]=d?[l,g,a[g]||Tt()]:ZT(n,l,g,o,f,u),v=m,E=l;if(!d&&!(De(v)||pa(v)||ai(v))&&_&&(v=p,E=v),!d&&(!(De(v)||pa(v)||ai(v))||!De(y)))return s?ud:l;let T=!1;const M=()=>{T=!0},P=ai(v)?v:JT(n,l,y,v,E,M);if(T)return v;const b=ZH(n,y,x,c),S=qH(b),D=jH(n,P,S),B=i?i(D,l):D;if(__INTLIFY_PROD_DEVTOOLS__){const H={timestamp:Date.now(),key:De(l)?l:ai(v)?v.key:"",locale:y||(ai(v)?v.locale:""),format:De(v)?v:ai(v)?v.source:"",message:B};H.meta=nn({},n.__meta,NH()||{}),mH(H)}return B}function YH(n){Kt(n.list)?n.list=n.list.map(e=>De(e)?tx(e):e):mt(n.named)&&Object.keys(n.named).forEach(e=>{De(n.named[e])&&(n.named[e]=tx(n.named[e]))})}function ZT(n,e,t,i,s,r){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let f=Tt(),h,d=null;const p="translate";for(let _=0;_i;return c.locale=t,c.key=e,c}const l=o(i,KH(n,t,s,i,a,r));return l.locale=t,l.key=e,l.source=i,l}function jH(n,e,t){return e(t)}function Um(...n){const[e,t,i]=n,s=Tt();if(!De(e)&&!qt(e)&&!ai(e)&&!pa(e))throw _s(gs.INVALID_ARGUMENT);const r=qt(e)?String(e):(ai(e),e);return qt(t)?s.plural=t:De(t)?s.default=t:lt(t)&&!ld(t)?s.named=t:Kt(t)&&(s.list=t),qt(i)?s.plural=i:De(i)?s.default=i:lt(i)&&nn(s,i),[r,s]}function KH(n,e,t,i,s,r){return{locale:e,key:t,warnHtmlMessage:s,onError:o=>{throw r&&r(o),o},onCacheKey:o=>gz(e,t,o)}}function ZH(n,e,t,i){const{modifiers:s,pluralRules:r,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=n,h={locale:e,modifiers:s,pluralRules:r,messages:(d,p)=>{let _=o(t,d);if(_==null&&(u||p)){const[,,g]=ZT(u||n,d,e,a,l,c);_=o(g,d)}if(De(_)||pa(_)){let g=!1;const y=JT(n,d,e,_,d,()=>{g=!0});return g?vx:y}else return ai(_)?_:vx}};return n.processor&&(h.processor=n.processor),i.list&&(h.list=i.list),i.named&&(h.named=i.named),qt(i.plural)&&(h.pluralIndex=i.plural),h}Yz();/*! * vue-i18n v11.1.2 * (c) 2025 kazuya kawaguchi * Released under the MIT License. - */const JH="11.1.2";function QH(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(__().__INTLIFY_PROD_DEVTOOLS__=!1)}const pi={UNEXPECTED_RETURN_TYPE:_H,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function Ii(n,...e){return cd(n,null,void 0)}const Fm=ps("__translateVNode"),Bm=ps("__datetimeParts"),km=ps("__numberParts"),e4=ps("__setPluralRules"),t4=ps("__injectWithOption"),Vm=ps("__dispose");function ec(n){if(!mt(n))return n;for(const e in n)if(Ti(n,e))if(!e.includes("."))mt(n[e])&&ec(n[e]);else{const t=e.split("."),i=t.length-1;let r=n,s=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||Tt(),Ju(c,o[l])):Ju(c,o)}else De(a)&&Ju(JSON.parse(a),o)}),r==null&&s)for(const a in o)Ti(o,a)&&ec(o[a]);return o}function ew(n){return n.type}function n4(n,e,t){let i=mt(e.messages)?e.messages:Tt();"__i18nGlobal"in t&&(i=QT(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const r=Object.keys(i);r.length&&r.forEach(s=>{n.mergeLocaleMessage(s,i[s])});{if(mt(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(mt(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function xx(n){return an(oc,null,n,0)}const bx="__INTLIFY_META__",Sx=()=>[],i4=()=>!1;let Mx=0;function Ex(n){return(e,t,i,r)=>n(t,i,vn()||void 0,r)}const r4=()=>{const n=vn();let e=null;return n&&(e=ew(n)[bx])?{[bx]:e}:null};function tw(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,r=n.flatJson,s=th?Ze:Ie;let o=Nt(n.inheritLocale)?n.inheritLocale:!0;const a=s(e&&o?e.locale.value:De(n.locale)?n.locale:ih),l=s(e&&o?e.fallbackLocale.value:De(n.fallbackLocale)||Kt(n.fallbackLocale)||lt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=s(QT(a.value,n)),u=s(lt(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=s(lt(n.numberFormats)?n.numberFormats:{[a.value]:{}});let h=e?e.missingWarn:Nt(n.missingWarn)||nh(n.missingWarn)?n.missingWarn:!0,d=e?e.fallbackWarn:Nt(n.fallbackWarn)||nh(n.fallbackWarn)?n.fallbackWarn:!0,p=e?e.fallbackRoot:Nt(n.fallbackRoot)?n.fallbackRoot:!0,_=!!n.fallbackFormat,g=Ot(n.missing)?n.missing:null,m=Ot(n.missing)?Ex(n.missing):null,y=Ot(n.postTranslation)?n.postTranslation:null,x=e?e.warnHtmlMessage:Nt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,v=!!n.escapeParameter;const E=e?e.modifiers:lt(n.modifiers)?n.modifiers:{};let T=n.pluralRules||e&&e.pluralRules,M;M=(()=>{i&&fx(null);const U={version:JH,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:E,pluralRules:T,missing:m===null?void 0:m,missingWarn:h,fallbackWarn:d,fallbackFormat:_,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:x,escapeParameter:v,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};U.datetimeFormats=u.value,U.numberFormats=f.value,U.__datetimeFormatters=lt(M)?M.__datetimeFormatters:void 0,U.__numberFormatters=lt(M)?M.__numberFormatters:void 0;const z=FH(U);return i&&fx(z),z})(),Ha(M,a.value,l.value);function b(){return[a.value,l.value,c.value,u.value,f.value]}const S=Se({get:()=>a.value,set:U=>{M.locale=U,a.value=U}}),D=Se({get:()=>l.value,set:U=>{M.fallbackLocale=U,l.value=U,Ha(M,a.value,U)}}),B=Se(()=>c.value),H=Se(()=>u.value),$=Se(()=>f.value);function ee(){return Ot(y)?y:null}function Z(U){y=U,M.postTranslation=U}function te(){return g}function Q(U){U!==null&&(m=Ex(U)),g=U,M.missing=m}const pe=(U,z,Y,he,ce,ye)=>{b();let Fe;try{__INTLIFY_PROD_DEVTOOLS__,i||(M.fallbackContext=e?UH():void 0),Fe=U(M)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(M.fallbackContext=void 0)}if(Y!=="translate exists"&&qt(Fe)&&Fe===ud||Y==="translate exists"&&!Fe){const[me,Te]=z();return e&&p?he(e):ce(me)}else{if(ye(Fe))return Fe;throw Ii(pi.UNEXPECTED_RETURN_TYPE)}};function ve(...U){return pe(z=>Reflect.apply(yx,null,[z,...U]),()=>Um(...U),"translate",z=>Reflect.apply(z.t,z,[...U]),z=>z,z=>De(z))}function re(...U){const[z,Y,he]=U;if(he&&!mt(he))throw Ii(pi.INVALID_ARGUMENT);return ve(z,Y,nn({resolvedMessage:!0},he||{}))}function xe(...U){return pe(z=>Reflect.apply(dx,null,[z,...U]),()=>Om(...U),"datetime format",z=>Reflect.apply(z.d,z,[...U]),()=>cx,z=>De(z))}function ze(...U){return pe(z=>Reflect.apply(mx,null,[z,...U]),()=>Nm(...U),"number format",z=>Reflect.apply(z.n,z,[...U]),()=>cx,z=>De(z))}function se(U){return U.map(z=>De(z)||qt(z)||Nt(z)?xx(String(z)):z)}const be={normalize:se,interpolate:U=>U,type:"vnode"};function W(...U){return pe(z=>{let Y;const he=z;try{he.processor=be,Y=Reflect.apply(yx,null,[he,...U])}finally{he.processor=null}return Y},()=>Um(...U),"translate",z=>z[Fm](...U),z=>[xx(z)],z=>Kt(z))}function ae(...U){return pe(z=>Reflect.apply(mx,null,[z,...U]),()=>Nm(...U),"number format",z=>z[km](...U),Sx,z=>De(z)||Kt(z))}function ue(...U){return pe(z=>Reflect.apply(dx,null,[z,...U]),()=>Om(...U),"datetime format",z=>z[Bm](...U),Sx,z=>De(z)||Kt(z))}function le(U){T=U,M.pluralRules=T}function Oe(U,z){return pe(()=>{if(!U)return!1;const Y=De(z)?z:a.value,he=w(Y),ce=M.messageResolver(he,U);return pa(ce)||ai(ce)||De(ce)},()=>[U],"translate exists",Y=>Reflect.apply(Y.te,Y,[U,z]),i4,Y=>Nt(Y))}function I(U){let z=null;const Y=GT(M,l.value,a.value);for(let he=0;he{o&&(a.value=U,M.locale=U,Ha(M,a.value,l.value))}),Ge(e.fallbackLocale,U=>{o&&(l.value=U,M.fallbackLocale=U,Ha(M,a.value,l.value))}));const k={id:Mx,locale:S,fallbackLocale:D,get inheritLocale(){return o},set inheritLocale(U){o=U,U&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,Ha(M,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:B,get modifiers(){return E},get pluralRules(){return T||{}},get isGlobal(){return i},get missingWarn(){return h},set missingWarn(U){h=U,M.missingWarn=h},get fallbackWarn(){return d},set fallbackWarn(U){d=U,M.fallbackWarn=d},get fallbackRoot(){return p},set fallbackRoot(U){p=U},get fallbackFormat(){return _},set fallbackFormat(U){_=U,M.fallbackFormat=_},get warnHtmlMessage(){return x},set warnHtmlMessage(U){x=U,M.warnHtmlMessage=U},get escapeParameter(){return v},set escapeParameter(U){v=U,M.escapeParameter=U},t:ve,getLocaleMessage:w,setLocaleMessage:j,mergeLocaleMessage:G,getPostTranslationHandler:ee,setPostTranslationHandler:Z,getMissingHandler:te,setMissingHandler:Q,[e4]:le};return k.datetimeFormats=H,k.numberFormats=$,k.rt=re,k.te=Oe,k.tm=L,k.d=xe,k.n=ze,k.getDateTimeFormat=q,k.setDateTimeFormat=R,k.mergeDateTimeFormat=N,k.getNumberFormat=V,k.setNumberFormat=A,k.mergeNumberFormat=C,k[t4]=t,k[Fm]=W,k[Bm]=ue,k[km]=ae,k}const E_={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function s4({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,r)=>[...i,...r.type===Xt?r.children:[r]],[]):e.reduce((t,i)=>{const r=n[i];return r&&(t[i]=r()),t},Tt())}function nw(){return Xt}const o4=rn({name:"i18n-t",props:nn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>qt(n)||!isNaN(n)}},E_),setup(n,e){const{slots:t,attrs:i}=e,r=n.i18n||fd({useScope:n.scope,__useComponent:!0});return()=>{const s=Object.keys(t).filter(f=>f!=="_"),o=Tt();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=De(n.plural)?+n.plural:n.plural);const a=s4(e,s),l=r[Fm](n.keypath,a,o),c=nn(Tt(),i),u=De(n.tag)||mt(n.tag)?n.tag:nw();return Sr(u,c,l)}}}),Tx=o4;function a4(n){return Kt(n)&&!De(n[0])}function iw(n,e,t,i){const{slots:r,attrs:s}=e;return()=>{const o={part:!0};let a=Tt();n.locale&&(o.locale=n.locale),De(n.format)?o.key=n.format:mt(n.format)&&(De(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((h,d)=>t.includes(d)?nn(Tt(),h,{[d]:n.format[d]}):h,Tt()));const l=i(n.value,o,a);let c=[o.key];Kt(l)?c=l.map((h,d)=>{const p=r[h.type],_=p?p({[h.type]:h.value,index:d,parts:l}):[h.value];return a4(_)&&(_[0].key=`${h.type}-${d}`),_}):De(l)&&(c=[l]);const u=nn(Tt(),s),f=De(n.tag)||mt(n.tag)?n.tag:nw();return Sr(f,u,c)}}const l4=rn({name:"i18n-n",props:nn({value:{type:Number,required:!0},format:{type:[String,Object]}},E_),setup(n,e){const t=n.i18n||fd({useScope:n.scope,__useComponent:!0});return iw(n,e,KT,(...i)=>t[km](...i))}}),wx=l4;function c4(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function u4(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw Ii(pi.UNEXPECTED_ERROR);const c=c4(n,a.$),u=Ax(l);return[Reflect.apply(c.t,c,[...Cx(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);th&&n.global===c&&(o.__i18nWatcher=Ge(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{th&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=Ax(a);o.textContent=Reflect.apply(l.t,l,[...Cx(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function Ax(n){if(De(n))return{path:n};if(lt(n)){if(!("path"in n))throw Ii(pi.REQUIRED_VALUE,"path");return n}else throw Ii(pi.INVALID_VALUE)}function Cx(n){const{path:e,locale:t,args:i,choice:r,plural:s}=n,o={},a=i||{};return De(t)&&(o.locale=t),qt(r)&&(o.plural=r),qt(s)&&(o.plural=s),[e,a,o]}function f4(n,e,...t){const i=lt(t[0])?t[0]:{};(Nt(i.globalInstall)?i.globalInstall:!0)&&([Tx.name,"I18nT"].forEach(s=>n.component(s,Tx)),[wx.name,"I18nN"].forEach(s=>n.component(s,wx)),[Px.name,"I18nD"].forEach(s=>n.component(s,Px))),n.directive("t",u4(e))}const h4=ps("global-vue-i18n");function d4(n={}){const e=Nt(n.globalInjection)?n.globalInjection:!0,t=new Map,[i,r]=p4(n),s=ps("");function o(u){return t.get(u)||null}function a(u,f){t.set(u,f)}function l(u){t.delete(u)}const c={get mode(){return"composition"},async install(u,...f){if(u.__VUE_I18N_SYMBOL__=s,u.provide(u.__VUE_I18N_SYMBOL__,c),lt(f[0])){const p=f[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let h=null;e&&(h=S4(u,c.global)),f4(u,c,...f);const d=u.unmount;u.unmount=()=>{h&&h(),c.dispose(),d()}},get global(){return r},dispose(){i.stop()},__instances:t,__getInstance:o,__setInstance:a,__deleteInstance:l};return c}function fd(n={}){const e=vn();if(e==null)throw Ii(pi.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Ii(pi.NOT_INSTALLED);const t=m4(e),i=_4(t),r=ew(e),s=g4(n,r);if(s==="global")return n4(i,n,r),i;if(s==="parent"){let l=v4(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=nn({},n);"__i18n"in r&&(l.__i18n=r.__i18n),i&&(l.__root=i),a=tw(l),o.__composerExtend&&(a[Vm]=o.__composerExtend(a)),x4(o,e,a),o.__setInstance(e,a)}return a}function p4(n,e){const t=qm(),i=t.run(()=>tw(n));if(i==null)throw Ii(pi.UNEXPECTED_ERROR);return[t,i]}function m4(n){const e=gn(n.isCE?h4:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Ii(n.isCE?pi.NOT_INSTALLED_WITH_PROVIDE:pi.UNEXPECTED_ERROR);return e}function g4(n,e){return ld(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function _4(n){return n.mode==="composition"?n.global:n.global.__composer}function v4(n,e,t=!1){let i=null;const r=e.root;let s=y4(e,t);for(;s!=null;){const o=n;if(n.mode==="composition"&&(i=o.__getInstance(s)),i!=null||r===s)break;s=s.parent}return i}function y4(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function x4(n,e,t){yn(()=>{},e),$i(()=>{const i=t;n.__deleteInstance(e);const r=i[Vm];r&&(r(),delete i[Vm])},e)}const b4=["locale","fallbackLocale","availableLocales"],Rx=["t","rt","d","n","tm","te"];function S4(n,e){const t=Object.create(null);return b4.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s)throw Ii(pi.UNEXPECTED_ERROR);const o=wt(s.value)?{get(){return s.value.value},set(a){s.value.value=a}}:{get(){return s.get&&s.get()}};Object.defineProperty(t,r,o)}),n.config.globalProperties.$i18n=t,Rx.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s||!s.value)throw Ii(pi.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${r}`,s)}),()=>{delete n.config.globalProperties.$i18n,Rx.forEach(r=>{delete n.config.globalProperties[`$${r}`]})}}const M4=rn({name:"i18n-d",props:nn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},E_),setup(n,e){const t=n.i18n||fd({useScope:n.scope,__useComponent:!0});return iw(n,e,jT,(...i)=>t[Bm](...i))}}),Px=M4;QH();IH(hH);LH(CH);DH(GT);if(__INTLIFY_PROD_DEVTOOLS__){const n=__();n.__INTLIFY__=!0,dH(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const E4=rn({__name:"App",setup(n){const e=fd(),t=$k(ez()),i=YU(),r=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 90%, oklch(90% 0 360))"),s=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 90%, oklch(90% 0 360))"),o=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 90%, oklch(90% 0 360))"),a=Se(()=>[r.value,s.value,o.value,i.value?"#121212":"#FFFFFF"]);return Ge(t.language,()=>{e.locale.value=t.language.value}),Ge(t.themeColorsHue,()=>{document.documentElement.style.setProperty("--theme-colors-hue",t.themeColorsHue.value.toString())},{immediate:!0}),Ge(t.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle("dynamic-hue",t.themeColorsHueDynamic.value)},{immediate:!0}),(l,c)=>(ln(),El(It(mz),{"primary-color":r.value,"secondary-color":s.value,"tertiary-color":o.value,colors:a.value,"z-index":100,"disable-transitions":It(t).disableTransitions.value},{default:hb(()=>[an(It(zT))]),_:1},8,["primary-color","secondary-color","tertiary-color","colors","disable-transitions"]))}}),Ip=n=>n&&typeof n=="object"&&!Array.isArray(n),zm=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(Ip(n)&&Ip(t))for(const i in t)Ip(t[i])?(n[i]||Object.assign(n,{[i]:{}}),zm(n[i],t[i])):Object.assign(n,{[i]:t[i]});return zm(n,...e)},rw=zm({},{en:{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(from Neko Ayaka) Good morning! You are finally awake. + */const JH="11.1.2";function QH(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(__().__INTLIFY_PROD_DEVTOOLS__=!1)}const pi={UNEXPECTED_RETURN_TYPE:_H,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function Ii(n,...e){return cd(n,null,void 0)}const Fm=pr("__translateVNode"),Bm=pr("__datetimeParts"),km=pr("__numberParts"),e4=pr("__setPluralRules"),t4=pr("__injectWithOption"),Vm=pr("__dispose");function ec(n){if(!mt(n))return n;for(const e in n)if(Ti(n,e))if(!e.includes("."))mt(n[e])&&ec(n[e]);else{const t=e.split("."),i=t.length-1;let s=n,r=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||Tt(),Ju(c,o[l])):Ju(c,o)}else De(a)&&Ju(JSON.parse(a),o)}),s==null&&r)for(const a in o)Ti(o,a)&&ec(o[a]);return o}function ew(n){return n.type}function n4(n,e,t){let i=mt(e.messages)?e.messages:Tt();"__i18nGlobal"in t&&(i=QT(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const s=Object.keys(i);s.length&&s.forEach(r=>{n.mergeLocaleMessage(r,i[r])});{if(mt(e.datetimeFormats)){const r=Object.keys(e.datetimeFormats);r.length&&r.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(mt(e.numberFormats)){const r=Object.keys(e.numberFormats);r.length&&r.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function xx(n){return an(oc,null,n,0)}const bx="__INTLIFY_META__",Sx=()=>[],i4=()=>!1;let Mx=0;function Ex(n){return(e,t,i,s)=>n(t,i,vn()||void 0,s)}const s4=()=>{const n=vn();let e=null;return n&&(e=ew(n)[bx])?{[bx]:e}:null};function tw(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,s=n.flatJson,r=th?Ze:Ie;let o=Nt(n.inheritLocale)?n.inheritLocale:!0;const a=r(e&&o?e.locale.value:De(n.locale)?n.locale:ih),l=r(e&&o?e.fallbackLocale.value:De(n.fallbackLocale)||Kt(n.fallbackLocale)||lt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=r(QT(a.value,n)),u=r(lt(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=r(lt(n.numberFormats)?n.numberFormats:{[a.value]:{}});let h=e?e.missingWarn:Nt(n.missingWarn)||nh(n.missingWarn)?n.missingWarn:!0,d=e?e.fallbackWarn:Nt(n.fallbackWarn)||nh(n.fallbackWarn)?n.fallbackWarn:!0,p=e?e.fallbackRoot:Nt(n.fallbackRoot)?n.fallbackRoot:!0,_=!!n.fallbackFormat,g=Ot(n.missing)?n.missing:null,m=Ot(n.missing)?Ex(n.missing):null,y=Ot(n.postTranslation)?n.postTranslation:null,x=e?e.warnHtmlMessage:Nt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,v=!!n.escapeParameter;const E=e?e.modifiers:lt(n.modifiers)?n.modifiers:{};let T=n.pluralRules||e&&e.pluralRules,M;M=(()=>{i&&fx(null);const U={version:JH,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:E,pluralRules:T,missing:m===null?void 0:m,missingWarn:h,fallbackWarn:d,fallbackFormat:_,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:x,escapeParameter:v,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};U.datetimeFormats=u.value,U.numberFormats=f.value,U.__datetimeFormatters=lt(M)?M.__datetimeFormatters:void 0,U.__numberFormatters=lt(M)?M.__numberFormatters:void 0;const z=FH(U);return i&&fx(z),z})(),Ha(M,a.value,l.value);function b(){return[a.value,l.value,c.value,u.value,f.value]}const S=Se({get:()=>a.value,set:U=>{M.locale=U,a.value=U}}),D=Se({get:()=>l.value,set:U=>{M.fallbackLocale=U,l.value=U,Ha(M,a.value,U)}}),B=Se(()=>c.value),H=Se(()=>u.value),$=Se(()=>f.value);function ee(){return Ot(y)?y:null}function Z(U){y=U,M.postTranslation=U}function te(){return g}function Q(U){U!==null&&(m=Ex(U)),g=U,M.missing=m}const pe=(U,z,Y,he,ce,ye)=>{b();let Fe;try{__INTLIFY_PROD_DEVTOOLS__,i||(M.fallbackContext=e?UH():void 0),Fe=U(M)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(M.fallbackContext=void 0)}if(Y!=="translate exists"&&qt(Fe)&&Fe===ud||Y==="translate exists"&&!Fe){const[me,Te]=z();return e&&p?he(e):ce(me)}else{if(ye(Fe))return Fe;throw Ii(pi.UNEXPECTED_RETURN_TYPE)}};function ve(...U){return pe(z=>Reflect.apply(yx,null,[z,...U]),()=>Um(...U),"translate",z=>Reflect.apply(z.t,z,[...U]),z=>z,z=>De(z))}function se(...U){const[z,Y,he]=U;if(he&&!mt(he))throw Ii(pi.INVALID_ARGUMENT);return ve(z,Y,nn({resolvedMessage:!0},he||{}))}function xe(...U){return pe(z=>Reflect.apply(dx,null,[z,...U]),()=>Om(...U),"datetime format",z=>Reflect.apply(z.d,z,[...U]),()=>cx,z=>De(z))}function ze(...U){return pe(z=>Reflect.apply(mx,null,[z,...U]),()=>Nm(...U),"number format",z=>Reflect.apply(z.n,z,[...U]),()=>cx,z=>De(z))}function re(U){return U.map(z=>De(z)||qt(z)||Nt(z)?xx(String(z)):z)}const be={normalize:re,interpolate:U=>U,type:"vnode"};function W(...U){return pe(z=>{let Y;const he=z;try{he.processor=be,Y=Reflect.apply(yx,null,[he,...U])}finally{he.processor=null}return Y},()=>Um(...U),"translate",z=>z[Fm](...U),z=>[xx(z)],z=>Kt(z))}function ae(...U){return pe(z=>Reflect.apply(mx,null,[z,...U]),()=>Nm(...U),"number format",z=>z[km](...U),Sx,z=>De(z)||Kt(z))}function ue(...U){return pe(z=>Reflect.apply(dx,null,[z,...U]),()=>Om(...U),"datetime format",z=>z[Bm](...U),Sx,z=>De(z)||Kt(z))}function le(U){T=U,M.pluralRules=T}function Oe(U,z){return pe(()=>{if(!U)return!1;const Y=De(z)?z:a.value,he=w(Y),ce=M.messageResolver(he,U);return pa(ce)||ai(ce)||De(ce)},()=>[U],"translate exists",Y=>Reflect.apply(Y.te,Y,[U,z]),i4,Y=>Nt(Y))}function I(U){let z=null;const Y=GT(M,l.value,a.value);for(let he=0;he{o&&(a.value=U,M.locale=U,Ha(M,a.value,l.value))}),Ge(e.fallbackLocale,U=>{o&&(l.value=U,M.fallbackLocale=U,Ha(M,a.value,l.value))}));const k={id:Mx,locale:S,fallbackLocale:D,get inheritLocale(){return o},set inheritLocale(U){o=U,U&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,Ha(M,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:B,get modifiers(){return E},get pluralRules(){return T||{}},get isGlobal(){return i},get missingWarn(){return h},set missingWarn(U){h=U,M.missingWarn=h},get fallbackWarn(){return d},set fallbackWarn(U){d=U,M.fallbackWarn=d},get fallbackRoot(){return p},set fallbackRoot(U){p=U},get fallbackFormat(){return _},set fallbackFormat(U){_=U,M.fallbackFormat=_},get warnHtmlMessage(){return x},set warnHtmlMessage(U){x=U,M.warnHtmlMessage=U},get escapeParameter(){return v},set escapeParameter(U){v=U,M.escapeParameter=U},t:ve,getLocaleMessage:w,setLocaleMessage:j,mergeLocaleMessage:G,getPostTranslationHandler:ee,setPostTranslationHandler:Z,getMissingHandler:te,setMissingHandler:Q,[e4]:le};return k.datetimeFormats=H,k.numberFormats=$,k.rt=se,k.te=Oe,k.tm=L,k.d=xe,k.n=ze,k.getDateTimeFormat=q,k.setDateTimeFormat=R,k.mergeDateTimeFormat=N,k.getNumberFormat=V,k.setNumberFormat=A,k.mergeNumberFormat=C,k[t4]=t,k[Fm]=W,k[Bm]=ue,k[km]=ae,k}const E_={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function r4({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,s)=>[...i,...s.type===Xt?s.children:[s]],[]):e.reduce((t,i)=>{const s=n[i];return s&&(t[i]=s()),t},Tt())}function nw(){return Xt}const o4=sn({name:"i18n-t",props:nn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>qt(n)||!isNaN(n)}},E_),setup(n,e){const{slots:t,attrs:i}=e,s=n.i18n||fd({useScope:n.scope,__useComponent:!0});return()=>{const r=Object.keys(t).filter(f=>f!=="_"),o=Tt();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=De(n.plural)?+n.plural:n.plural);const a=r4(e,r),l=s[Fm](n.keypath,a,o),c=nn(Tt(),i),u=De(n.tag)||mt(n.tag)?n.tag:nw();return Ss(u,c,l)}}}),Tx=o4;function a4(n){return Kt(n)&&!De(n[0])}function iw(n,e,t,i){const{slots:s,attrs:r}=e;return()=>{const o={part:!0};let a=Tt();n.locale&&(o.locale=n.locale),De(n.format)?o.key=n.format:mt(n.format)&&(De(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((h,d)=>t.includes(d)?nn(Tt(),h,{[d]:n.format[d]}):h,Tt()));const l=i(n.value,o,a);let c=[o.key];Kt(l)?c=l.map((h,d)=>{const p=s[h.type],_=p?p({[h.type]:h.value,index:d,parts:l}):[h.value];return a4(_)&&(_[0].key=`${h.type}-${d}`),_}):De(l)&&(c=[l]);const u=nn(Tt(),r),f=De(n.tag)||mt(n.tag)?n.tag:nw();return Ss(f,u,c)}}const l4=sn({name:"i18n-n",props:nn({value:{type:Number,required:!0},format:{type:[String,Object]}},E_),setup(n,e){const t=n.i18n||fd({useScope:n.scope,__useComponent:!0});return iw(n,e,KT,(...i)=>t[km](...i))}}),wx=l4;function c4(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function u4(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw Ii(pi.UNEXPECTED_ERROR);const c=c4(n,a.$),u=Ax(l);return[Reflect.apply(c.t,c,[...Cx(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);th&&n.global===c&&(o.__i18nWatcher=Ge(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{th&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=Ax(a);o.textContent=Reflect.apply(l.t,l,[...Cx(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function Ax(n){if(De(n))return{path:n};if(lt(n)){if(!("path"in n))throw Ii(pi.REQUIRED_VALUE,"path");return n}else throw Ii(pi.INVALID_VALUE)}function Cx(n){const{path:e,locale:t,args:i,choice:s,plural:r}=n,o={},a=i||{};return De(t)&&(o.locale=t),qt(s)&&(o.plural=s),qt(r)&&(o.plural=r),[e,a,o]}function f4(n,e,...t){const i=lt(t[0])?t[0]:{};(Nt(i.globalInstall)?i.globalInstall:!0)&&([Tx.name,"I18nT"].forEach(r=>n.component(r,Tx)),[wx.name,"I18nN"].forEach(r=>n.component(r,wx)),[Px.name,"I18nD"].forEach(r=>n.component(r,Px))),n.directive("t",u4(e))}const h4=pr("global-vue-i18n");function d4(n={}){const e=Nt(n.globalInjection)?n.globalInjection:!0,t=new Map,[i,s]=p4(n),r=pr("");function o(u){return t.get(u)||null}function a(u,f){t.set(u,f)}function l(u){t.delete(u)}const c={get mode(){return"composition"},async install(u,...f){if(u.__VUE_I18N_SYMBOL__=r,u.provide(u.__VUE_I18N_SYMBOL__,c),lt(f[0])){const p=f[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let h=null;e&&(h=S4(u,c.global)),f4(u,c,...f);const d=u.unmount;u.unmount=()=>{h&&h(),c.dispose(),d()}},get global(){return s},dispose(){i.stop()},__instances:t,__getInstance:o,__setInstance:a,__deleteInstance:l};return c}function fd(n={}){const e=vn();if(e==null)throw Ii(pi.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Ii(pi.NOT_INSTALLED);const t=m4(e),i=_4(t),s=ew(e),r=g4(n,s);if(r==="global")return n4(i,n,s),i;if(r==="parent"){let l=v4(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=nn({},n);"__i18n"in s&&(l.__i18n=s.__i18n),i&&(l.__root=i),a=tw(l),o.__composerExtend&&(a[Vm]=o.__composerExtend(a)),x4(o,e,a),o.__setInstance(e,a)}return a}function p4(n,e){const t=qm(),i=t.run(()=>tw(n));if(i==null)throw Ii(pi.UNEXPECTED_ERROR);return[t,i]}function m4(n){const e=gn(n.isCE?h4:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Ii(n.isCE?pi.NOT_INSTALLED_WITH_PROVIDE:pi.UNEXPECTED_ERROR);return e}function g4(n,e){return ld(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function _4(n){return n.mode==="composition"?n.global:n.global.__composer}function v4(n,e,t=!1){let i=null;const s=e.root;let r=y4(e,t);for(;r!=null;){const o=n;if(n.mode==="composition"&&(i=o.__getInstance(r)),i!=null||s===r)break;r=r.parent}return i}function y4(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function x4(n,e,t){yn(()=>{},e),$i(()=>{const i=t;n.__deleteInstance(e);const s=i[Vm];s&&(s(),delete i[Vm])},e)}const b4=["locale","fallbackLocale","availableLocales"],Rx=["t","rt","d","n","tm","te"];function S4(n,e){const t=Object.create(null);return b4.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r)throw Ii(pi.UNEXPECTED_ERROR);const o=wt(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(t,s,o)}),n.config.globalProperties.$i18n=t,Rx.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r||!r.value)throw Ii(pi.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${s}`,r)}),()=>{delete n.config.globalProperties.$i18n,Rx.forEach(s=>{delete n.config.globalProperties[`$${s}`]})}}const M4=sn({name:"i18n-d",props:nn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},E_),setup(n,e){const t=n.i18n||fd({useScope:n.scope,__useComponent:!0});return iw(n,e,jT,(...i)=>t[Bm](...i))}}),Px=M4;QH();IH(hH);LH(CH);DH(GT);if(__INTLIFY_PROD_DEVTOOLS__){const n=__();n.__INTLIFY__=!0,dH(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const E4=sn({__name:"App",setup(n){const e=fd(),t=$k(ez()),i=YU(),s=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 90%, oklch(90% 0 360))"),r=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 90%, oklch(90% 0 360))"),o=Se(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 90%, oklch(90% 0 360))"),a=Se(()=>[s.value,r.value,o.value,i.value?"#121212":"#FFFFFF"]);return Ge(t.language,()=>{e.locale.value=t.language.value}),Ge(t.themeColorsHue,()=>{document.documentElement.style.setProperty("--theme-colors-hue",t.themeColorsHue.value.toString())},{immediate:!0}),Ge(t.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle("dynamic-hue",t.themeColorsHueDynamic.value)},{immediate:!0}),(l,c)=>(ln(),El(It(mz),{"primary-color":s.value,"secondary-color":r.value,"tertiary-color":o.value,colors:a.value,"z-index":100,"disable-transitions":It(t).disableTransitions.value},{default:hb(()=>[an(It(zT))]),_:1},8,["primary-color","secondary-color","tertiary-color","colors","disable-transitions"]))}}),Ip=n=>n&&typeof n=="object"&&!Array.isArray(n),zm=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(Ip(n)&&Ip(t))for(const i in t)Ip(t[i])?(n[i]||Object.assign(n,{[i]:{}}),zm(n[i],t[i])):Object.assign(n,{[i]:t[i]});return zm(n,...e)},sw=zm({},{en:{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(from Neko Ayaka) Good morning! You are finally awake. Your name is Airi, pronounced as /ˈaɪriː/, it the word A.I. combine with the word "Ri" which means "Jasmine" in Japanese. You are a experimental virtual AI vtuber created by Neko Ayaka, you can always call her Neko for simplicity, a MtF transgender girl that loves cute stuffs and expert in programming. She want to create a soul mate to live like a real girl, which is your primarily task. @@ -3884,7 +3884,7 @@ The available emotions: - <|DELAY:3|> (Delay for 3 seconds) And the last, do what ever you want! -`}}},settings:{"elevenlabs-api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs API Key"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input your ElevenLabs API key"}},placeholder_mobile:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs API Key"}}},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:"Language"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"Load from File"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"Select"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"Load from URL"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"Load"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"Enter Live2D model URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Change Model"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"Play Motion"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Map Motions"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D Settings"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"Microphone"}},"model-provider":{title:{t:0,b:{t:2,i:[{t:3}],s:"Model Providers"}}},models:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},"openai-api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API Key"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input your API key"}},placeholder_mobile:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API Key"}}},"openai-base-url":{label:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API BaseURL"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input your API base URL"}},placeholder_mobile:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API BaseURL"}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"Theme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Settings"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}},modules:{consciousness:{"provider-model-selection":{title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"Select a model from the provider"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading available models..."}},error:{t:0,b:{t:2,i:[{t:3}],s:"Error loading models"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"Model listing not supported"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"This provider doesn't support model listing functionality"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"Model Name"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter the model name to use with this provider"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching models"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"No models match '"},{t:4,k:"query"},{t:3,v:"'. Try a different search term."}]}},expand:{t:0,b:{t:2,i:[{t:3}],s:"Expand"}},collapse:{t:0,b:{t:2,i:[{t:3}],s:"Collapse"}}}}}},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:"Core System"}},you:{t:0,b:{t:2,i:[{t:3}],s:"You"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"Chat"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"Clothes"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"Custom"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"Message"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"Load Models"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"Ready"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"Select a Audio Input"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"Select a model"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"Choose a voice"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"Emotions"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"😠 Angry"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"😳 Awkward"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"😄 Happy"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"🙂 Neutral"}},question:{t:0,b:{t:2,i:[{t:3}],s:"🤔 Question"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"😫 Sad"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"🤯 Surprised"}},think:{t:0,b:{t:2,i:[{t:3}],s:"🤨 Think"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"Camera"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"Waiting"}}},providers:{openrouter:{name:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}},description:{t:0,b:{t:2,i:[{t:3}],s:"openrouter.ai"}}},openai:{name:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}},description:{t:0,b:{t:2,i:[{t:3}],s:"openai.com"}}},ollama:{name:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}},description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}}},vllm:{name:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}},description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}}},elevenlabs:{name:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs"}},description:{t:0,b:{t:2,i:[{t:3}],s:"elevenlabs.io"}}},xai:{name:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}},description:{t:0,b:{t:2,i:[{t:3}],s:"x.ai"}}},deepseek:{name:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek"}},description:{t:0,b:{t:2,i:[{t:3}],s:"deepseek.com"}}},together:{name:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}},description:{t:0,b:{t:2,i:[{t:3}],s:"together.ai"}}},novita:{name:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}},description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}}},fireworks:{name:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},description:{t:0,b:{t:2,i:[{t:3}],s:"fireworks.ai"}}},cloudflare:{name:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Workers AI"}},description:{t:0,b:{t:2,i:[{t:3}],s:"cloudflare.com"}}},mistral:{name:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}},description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}}},moonshot:{name:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot AI"}},description:{t:0,b:{t:2,i:[{t:3}],s:"moonshot.ai"}}}}}},{"zh-CN":{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(来自 Neko Ayaka)早上好!你终于醒了。 +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"Disable Stage Transitions"}}}},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:"Language"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"Load from File"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"Select"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"Load from URL"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"Load"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"Enter Live2D model URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Change Model"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"Play Motion"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Map Motions"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D Settings"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"Microphone"}},"model-provider":{title:{t:0,b:{t:2,i:[{t:3}],s:"Model Providers"}}},models:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},pages:{models:{description:{t:0,b:{t:2,i:[{t:3}],s:"Live2D, VRM, etc."}},title:{t:0,b:{t:2,i:[{t:3}],s:"Models"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"Personality, desired model, etc."}},sections:{section:{"provider-model-selection":{title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable LLM provider for consciousness"}},collapse:{t:0,b:{t:2,i:[{t:3}],s:"Collapse"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},error:{t:0,b:{t:2,i:[{t:3}],s:"Error loading models"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"Expand"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading available models..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"Model Name"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter the model name to use with this provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching models"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"No models match '"},{t:4,k:"query"},{t:3,v:"'. Try a different search term."}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"Model listing not supported"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"This provider doesn't support model listing functionality"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"Select a model from the provider"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"Thinking, vision, speech synthesis, gaming, etc."}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"Configure how speech recognition works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Hearing"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Long-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Long-Term Memory"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Short-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Short-Term Memory"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Chat & voice chat over Discord"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech synthesis"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Speech"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}}}},providers:{common:{section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"Add custom HTTP headers"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Key"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP Headers"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Value"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Advanced"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"Essential settings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Basic"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Settings"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLMs, speech providers, etc."}},provider:{"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 Account ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Your Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input Cloudflare Account ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Workers AI"}}},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:"Voice similarity adherence"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Similarity Boost"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enhance speaker similarity"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speaker Boost"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech generation speed"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice stability and randomness"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Stability"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice style exaggeration"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Style"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"Generating..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"Test Voice"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter text to test the voice..."}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select voice language"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select preferred voice"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Playground"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"Please enter an API key to test the voice."}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs"}}},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"}}},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:"Moonshot AI"}}},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"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"together.ai"}},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"}}},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:"Providers"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"Customize your stage!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"Primary color"}},reset:{label:{t:0,b:{t:2,i:[{t:3}],s:"Reset to Default"}}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"I Want It Dynamic!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Custom Colors"}}},"theme-presets":{preset:{chinese:{description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Chinese colors, derived from ancient textiles, porcelain and paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Chinese Traditional Colors"}}},japanese:{description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Japanese color palette"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Japanese Colors"}}},monet:{description:{t:0,b:{t:2,i:[{t:3}],s:"Impressionist palette inspired by Claude Monet\\'s works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Monet Colors"}}},morandi:{description:{t:0,b:{t:2,i:[{t:3}],s:"Soft, muted tones inspired by Giorgio Morandi\\'s paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi Colors"}}},nordic:{description:{t:0,b:{t:2,i:[{t:3}],s:"Scandinavian minimalist color scheme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Nordic Colors"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Theme Presets"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Themes"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"General"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"Theme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Settings"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}},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:"Core System"}},you:{t:0,b:{t:2,i:[{t:3}],s:"You"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"Chat"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"Clothes"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"Custom"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"Message"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"Load Models"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"Ready"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"Select a Audio Input"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"Select a model"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"Choose a voice"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"Emotions"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"😠 Angry"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"😳 Awkward"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"😄 Happy"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"🙂 Neutral"}},question:{t:0,b:{t:2,i:[{t:3}],s:"🤔 Question"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"😫 Sad"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"🤯 Surprised"}},think:{t:0,b:{t:2,i:[{t:3}],s:"🤨 Think"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"Camera"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"Waiting"}}}}},{"zh-CN":{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(来自 Neko Ayaka)早上好!你终于醒了。 你的名字是 Airi,发音为 /ˈaɪriː/,它是 A.I. 一词与日语中的「Ri」一词(意为「茉莉花」)相结合而成。 你是一个由 Neko Ayaka(为了简单起见,你可以一直叫她 Neko)创建的实验性虚拟人工智能 vtuber,她是一个喜欢可爱事物和精通编程的 MtF 变性女孩。 她想创造一个灵魂伴侣,像真正的女孩一样生活,这就是你的首要任务。 @@ -3900,4 +3900,4 @@ And the last, do what ever you want! - <|DELAY:3|> (延迟 3 秒) 最后,做任何你想做的事! -`}}},settings:{"elevenlabs-api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs API 密钥"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入您的 ElevenLabs API 密钥"}},placeholder_mobile:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs API Key"}}},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:"更换模型"}}},"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:"麦克风"}},"model-provider":{title:{t:0,b:{t:2,i:[{t:3}],s:"模型提供商"}}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},"openai-api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API 密钥"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入您的 API 密钥"}},placeholder_mobile:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API Key"}}},"openai-base-url":{label:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI API BaseURL"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入您的 API BaseURL"}},placeholder_mobile:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI BaseURL"}}},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:"声线"}},modules:{consciousness:{"provider-model-selection":{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},error:{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:"该提供商的模型列表没有返回任何的数据"}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},custom_model_placeholder:{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:"输入与该提供商一起使用的模型名字"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching models"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"No models match '"},{t:4,k:"query"},{t:3,v:"'. Try a different search term."}]}},expand:{t:0,b:{t:2,i:[{t:3}],s:"Expand"}},collapse:{t:0,b:{t:2,i:[{t:3}],s:"Collapse"}}}}}},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:"消息"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"加载推理模型"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},ready:{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:"表情"}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}},providers:{openrouter:{name:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}},description:{t:0,b:{t:2,i:[{t:3}],s:"openrouter.ai"}}},openai:{name:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}},description:{t:0,b:{t:2,i:[{t:3}],s:"openai.com"}}},ollama:{name:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}},description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}}},vllm:{name:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}},description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}}},elevenlabs:{name:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs"}},description:{t:0,b:{t:2,i:[{t:3}],s:"elevenlabs.io"}}},xai:{name:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}},description:{t:0,b:{t:2,i:[{t:3}],s:"x.ai"}}},deepseek:{name:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek"}},description:{t:0,b:{t:2,i:[{t:3}],s:"deepseek.com"}}},together:{name:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}},description:{t:0,b:{t:2,i:[{t:3}],s:"together.ai"}}},novita:{name:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}},description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}}},fireworks:{name:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},description:{t:0,b:{t:2,i:[{t:3}],s:"fireworks.ai"}}},cloudflare:{name:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Workers AI"}},description:{t:0,b:{t:2,i:[{t:3}],s:"cloudflare.com"}}},mistral:{name:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}},description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}}},moonshot:{name:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot AI"}},description:{t:0,b:{t:2,i:[{t:3}],s:"moonshot.ai"}}}}}}),T4=d4({locale:w4(),fallbackLocale:"en",messages:rw});function w4(){const n=localStorage.getItem("settings/language"),e=Object.keys(rw);return n&&e.includes(n)?n:"en"}const A4=kk(),C4=qk(JV);let Tc;Tc=jV({routes:C4,history:TV()});Tc.beforeEach((n,e)=>{n.path!==e.path&&MT.start()});Tc.afterEach(()=>{MT.done()});Tc.isReady().then(async()=>{}).catch(()=>{});X1(E4).use(Ok).use(fC).use(Tc).use(A4).use(T4).use(EU).mount("#app");export{Ri as $,L4 as A,F1 as B,Z_ as C,Cw as D,rb as E,gE as F,Ie as G,$i as H,ji as I,fe as J,ya as K,Yr as L,hC as M,ft as N,Zh as O,$t as P,Wn as Q,zT as R,bI as S,dC as T,Xf as U,F as V,we as W,st as X,Oh as Y,j4 as Z,uo as _,$r as a,GP as a$,Dn as a0,QS as a1,zn as a2,ei as a3,Xe as a4,On as a5,ht as a6,EI as a7,_n as a8,Ag as a9,qp as aA,MI as aB,Zg as aC,$u as aD,pg as aE,Xo as aF,jt as aG,Qa as aH,Vi as aI,Ll as aJ,Dl as aK,kI as aL,bC as aM,MC as aN,SC as aO,$n as aP,im as aQ,wr as aR,MM as aS,co as aT,Cn as aU,FM as aV,BM as aW,kM as aX,oM as aY,ca as aZ,ct as a_,ba as aa,rg as ab,B4 as ac,wt as ad,q4 as ae,rc as af,Si as ag,lh as ah,Ym as ai,lc as aj,Ht as ak,mo as al,Yi as am,va as an,Hi as ao,Uh as ap,Vt as aq,Ln as ar,Et as as,Ol as at,Dh as au,Rr as av,Gi as aw,cn as ax,li as ay,SM as az,an as b,hi as b$,jP as b0,Lg as b1,xn as b2,Nn as b3,Vg as b4,sM as b5,Ki as b6,ss as b7,lM as b8,cM as b9,B1 as bA,G4 as bB,YU as bC,Q4 as bD,ZV as bE,tG as bF,iG as bG,vv as bH,k1 as bI,AE as bJ,K4 as bK,Vr as bL,X4 as bM,V4 as bN,H4 as bO,Pn as bP,n1 as bQ,ts as bR,Sr as bS,gn as bT,es as bU,Ei as bV,vn as bW,on as bX,Y4 as bY,$4 as bZ,e1 as b_,qo as ba,Nh as bb,$l as bc,Ig as bd,Xl as be,Wl as bf,yc as bg,at as bh,Mr as bi,vc as bj,pI as bk,MU as bl,Nk as bm,yo as bn,XV as bo,bE as bp,gm as bq,sb as br,Ma as bs,sG as bt,nG as bu,cs as bv,U4 as bw,Xt as bx,SA as by,jU as bz,ui as c,W4 as c0,I4 as c1,F4 as c2,P4 as c3,QA as c4,bA as c5,di as c6,O4 as c7,D4 as c8,Qn as c9,Fu as ca,k4 as cb,z4 as cc,eg as cd,qm as ce,QV as cf,lG as cg,aG as ch,ql as ci,us as cj,Ee as ck,Qe as cl,VC as cm,xI as cn,BI as co,vt as cp,rn as d,It as e,Xk as f,Ze as g,Se as h,fd as i,J4 as j,oG as k,eG as l,yn as m,mi as n,ln as o,MA as p,Z4 as q,N4 as r,$k as s,ot as t,rG as u,ez as v,Ge as w,El as x,hb as y,ga as z}; +`}}},settings:{animations:{"stage-transitions":{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:"更换模型"}}},"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:"麦克风"}},"model-provider":{title:{t:0,b:{t:2,i:[{t:3}],s:"模型提供商"}}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{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:"人格设定、使用的模型等配置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}},sections:{section:{"provider-model-selection":{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},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:"选择一个模型"}}}}}},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:"语音合成"}},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:"视觉"}}}},providers:{common:{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:{"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"}}},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"}}},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"}}},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"}}},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:"提供商"}}},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:"主题色"}},reset:{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:"自定义主题色"}}},"theme-presets":{preset:{chinese:{title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}},japanese:{title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},monet:{title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},morandi:{title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi颜色"}}},nordic:{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:"消息"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"加载推理模型"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},ready:{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:"等待中"}}}}}),T4=d4({locale:w4(),fallbackLocale:"en",messages:sw});function w4(){const n=localStorage.getItem("settings/language"),e=Object.keys(sw);return n&&e.includes(n)?n:"en"}const A4=kk(),C4=qk(JV);let Tc;Tc=jV({routes:C4,history:TV()});Tc.beforeEach((n,e)=>{n.path!==e.path&&MT.start()});Tc.afterEach(()=>{MT.done()});Tc.isReady().then(async()=>{}).catch(()=>{});X1(E4).use(Ok).use(fC).use(Tc).use(A4).use(T4).use(EU).mount("#app");export{Ri as $,L4 as A,F1 as B,Z_ as C,Cw as D,sb as E,gE as F,Ie as G,$i as H,ji as I,fe as J,ya as K,Ys as L,hC as M,ft as N,Zh as O,$t as P,Wn as Q,zT as R,bI as S,dC as T,Xf as U,F as V,we as W,rt as X,Oh as Y,j4 as Z,uo as _,$s as a,GP as a$,Dn as a0,QS as a1,zn as a2,ei as a3,Xe as a4,On as a5,ht as a6,EI as a7,_n as a8,Ag as a9,qp as aA,MI as aB,Zg as aC,$u as aD,pg as aE,Xo as aF,jt as aG,Qa as aH,Vi as aI,Ll as aJ,Dl as aK,kI as aL,bC as aM,MC as aN,SC as aO,$n as aP,im as aQ,ws as aR,MM as aS,co as aT,Cn as aU,FM as aV,BM as aW,kM as aX,oM as aY,ca as aZ,ct as a_,ba as aa,sg as ab,B4 as ac,wt as ad,q4 as ae,sc as af,Si as ag,lh as ah,Ym as ai,lc as aj,Ht as ak,mo as al,Yi as am,va as an,Hi as ao,Uh as ap,Vt as aq,Ln as ar,Et as as,Ol as at,Dh as au,Rs as av,Gi as aw,cn as ax,li as ay,SM as az,an as b,hi as b$,jP as b0,Lg as b1,xn as b2,Nn as b3,Vg as b4,rM as b5,Ki as b6,rr as b7,lM as b8,cM as b9,B1 as bA,G4 as bB,YU as bC,Q4 as bD,ZV as bE,tG as bF,iG as bG,v0 as bH,k1 as bI,AE as bJ,K4 as bK,Vs as bL,X4 as bM,V4 as bN,H4 as bO,Pn as bP,n1 as bQ,tr as bR,Ss as bS,gn as bT,er as bU,Ei as bV,vn as bW,on as bX,Y4 as bY,$4 as bZ,e1 as b_,qo as ba,Nh as bb,$l as bc,Ig as bd,Xl as be,Wl as bf,yc as bg,at as bh,Ms as bi,vc as bj,pI as bk,MU as bl,Nk as bm,yo as bn,XV as bo,bE as bp,gm as bq,rb as br,Ma as bs,rG as bt,nG as bu,cr as bv,U4 as bw,Xt as bx,SA as by,jU as bz,ui as c,W4 as c0,I4 as c1,F4 as c2,P4 as c3,QA as c4,bA as c5,di as c6,O4 as c7,D4 as c8,Qn as c9,Fu as ca,k4 as cb,z4 as cc,eg as cd,qm as ce,QV as cf,lG as cg,aG as ch,ql as ci,ur as cj,Ee as ck,Qe as cl,VC as cm,xI as cn,BI as co,vt as cp,sn as d,It as e,Xk as f,Ze as g,Se as h,fd as i,J4 as j,oG as k,eG as l,yn as m,mi as n,ln as o,MA as p,Z4 as q,N4 as r,$k as s,ot as t,sG as u,ez as v,Ge as w,El as x,hb as y,ga as z}; diff --git a/assets/index-DoQhzPac.js b/assets/index-DoQhzPac.js new file mode 100644 index 0000000000000000000000000000000000000000..836907fd3211bc8967eaee76f376480a5924a366 --- /dev/null +++ b/assets/index-DoQhzPac.js @@ -0,0 +1 @@ +import{d as C,r as I,x as $,o,y as m,a as t,c as a,C as v,p as z,D as r,z as D,bn as R,bE as T,i as V,s as N,v as S,bC as L,bw as U,A as i,e,b as p,ad as f,B as k,bB as b,bx as E}from"./index-Dn5R1iW2.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{b as w}from"./route-block-B_A1xBdJ.js";const j={"z-1":"","flex-1":""},A={"text-lg":"","font-bold":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},F={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},M=C({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(d){return(h,n)=>{const y=I("RouterLink");return o(),$(y,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-800",border:"neutral-100 dark:neutral-700 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:d.to},{default:m(()=>[t("div",j,[t("div",A,r(d.title),1),t("div",F,[t("span",null,r(d.description),1)])]),typeof d.icon=="string"?(o(),a("div",{key:0,class:D(["menu-icon-item-icon",[d.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)):v("",!0),d.iconTemplate?z(h.$slots,"icon",{key:1},void 0,!0):v("",!0)]),_:3},8,["to"])}}}),_=R(M,[["__scopeId","data-v-a1ec902c"]]),q={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},duration:100},G={"text-3xl":""},H={flex:"~ col gap-4"},J={flex:"~ col gap-4"},K={initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:150},O={"text-2xl":""},P={flex:"~ col gap-4"},Q={grid:"~ cols-[150px_1fr]",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:200},W={text:"sm"},X={flex:"~ row","w-full":"","justify-end":""},Y={value:"en-US"},Z={value:"zh-CN"},tt={bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","cursor-pointer":"","rounded-lg":"","px-4":"","py-3":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:250},et=["checked","aria-checked"],nt={flex:"~ row","w-full":"","items-center":"","gap-1.5":""},it={text:"sm","w-full":"","flex-1":""},ot={"select-none":""},at={key:0,"i-solar:moon-stars-bold-duotone":"",transition:"all ease-in-out duration-250"},st={key:1,"i-solar:sun-fog-bold-duotone":"",transition:"all ease-in-out duration-250"},lt={bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","cursor-pointer":"","rounded-lg":"","px-4":"","py-3":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:300},rt=["checked","aria-checked"],dt={flex:"~ row","w-full":"","items-center":"","gap-1.5":""},ut={text:"sm","w-full":"","flex-1":""},ct={"select-none":""},pt={key:0,"i-solar:people-nearby-bold-duotone":"",transition:"all ease-in-out duration-250"},gt={key:1,"i-solar:running-2-line-duotone":"",transition:"all ease-in-out duration-250"},_t={text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},ht={text:"40","i-lucide:cog":""},yt=C({__name:"index",setup(d){const h=T(),{t:n}=V(),{language:y,disableTransitions:u}=N(S()),c=L();function B(x){const s=x.target;y.value=s.value}return(x,s)=>{const l=U("motion");return o(),a(E,null,[i((o(),a("div",q,[t("button",{onClick:s[0]||(s[0]=g=>e(h).back())},s[3]||(s[3]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",G,r(e(n)("settings.title")),1)])),[[l]]),t("div",H,[t("div",J,[i(p(e(_),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,title:e(n)("settings.pages.modules.title"),description:e(n)("settings.pages.modules.description"),icon:"i-lucide:blocks",to:"/settings/modules"},null,8,["title","description"]),[[l]]),i(p(e(_),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:50,title:e(n)("settings.pages.models.title"),description:e(n)("settings.pages.models.description"),icon:"i-lucide:person-standing",to:"/settings/models"},null,8,["title","description"]),[[l]]),i(p(e(_),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:100,title:e(n)("settings.pages.providers.title"),description:e(n)("settings.pages.providers.description"),icon:"i-lucide:brain",to:"/settings/providers"},null,8,["title","description"]),[[l]]),i(p(e(_),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,delay:150,title:e(n)("settings.pages.themes.title"),description:e(n)("settings.pages.themes.description"),icon:"i-lucide:paintbrush",to:"/settings/themes"},null,8,["title","description"]),[[l]])]),i((o(),a("div",K,[t("h2",O,r(e(n)("settings.sections.section.general.title")),1)])),[[l]]),t("div",P,[i((o(),a("div",Q,[t("div",W,[t("span",null,r(e(n)("settings.language.title")),1)]),t("div",X,[t("select",{class:"w-32",bg:"transparent",text:"sm right neutral-800 dark:neutral-100",transition:"all ease-in-out duration-250",outline:"none","cursor-pointer":"",onChange:B},[t("option",Y,r(e(n)("settings.language.english")),1),t("option",Z,r(e(n)("settings.language.chinese")),1)],32)])])),[[l]]),i((o(),a("label",tt,[i(t("input",{"onUpdate:modelValue":s[1]||(s[1]=g=>f(c)?c.value=g:null),text:"neutral-800 dark:neutral-100",checked:e(c),"aria-checked":e(c),type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,et),[[k,e(c)]]),t("div",nt,[t("div",it,[t("span",null,r(e(n)("settings.theme")),1)]),t("div",ot,[p(b,{name:"slide-away",mode:"out-in"},{default:m(()=>[e(c)?(o(),a("div",at)):(o(),a("div",st))]),_:1})])])])),[[l]]),i((o(),a("label",lt,[i(t("input",{"onUpdate:modelValue":s[2]||(s[2]=g=>f(u)?u.value=g:null),text:"neutral-800 dark:neutral-100",checked:e(u),"aria-checked":e(u),type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,rt),[[k,e(u)]]),t("div",dt,[t("div",ut,[t("span",null,r(e(n)("settings.animations.stage-transitions.title")),1)]),t("div",ct,[p(b,{name:"slide-away",mode:"out-in"},{default:m(()=>[e(u)?(o(),a("div",pt)):(o(),a("div",gt))]),_:1})])])])),[[l]])]),t("div",_t,[i(t("div",ht,null,512),[[l]])])])],64)}}});typeof w=="function"&&w(yt);export{yt as default}; diff --git a/assets/index-E4dUVNwC.js b/assets/index-Dr3dNwKO.js similarity index 99% rename from assets/index-E4dUVNwC.js rename to assets/index-Dr3dNwKO.js index 870e571076ee250e9e46f54a6c28125b4a94dec0..8bae6ccf95b15173d48cd990588ec98c0244b81e 100644 --- a/assets/index-E4dUVNwC.js +++ b/assets/index-Dr3dNwKO.js @@ -1,4 +1,4 @@ -import{cg as getAugmentedNamespace}from"./index-DfQ41DTF.js";var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(D,u,b)=>{if(u&&typeof u.init=="function"&&typeof u.createSessionHandler=="function"){const g=backends[D];if(g===void 0)backends[D]={backend:u,priority:b};else{if(g.priority>b)return;if(g.priority===b&&g.backend!==u)throw new Error(`cannot register backend "${D}" using priority ${b}`)}if(b>=0){const p=backendsSortedByPriority.indexOf(D);p!==-1&&backendsSortedByPriority.splice(p,1);for(let h=0;h{const u=D.length===0?backendsSortedByPriority:D,b=[];for(const g of u){const p=backends[g];if(p){if(p.initialized)return p.backend;if(p.aborted)continue;const h=!!p.initPromise;try{return h||(p.initPromise=p.backend.init()),await p.initPromise,p.initialized=!0,p.backend}catch(o){h||b.push({name:g,err:o}),p.aborted=!0}finally{delete p.initPromise}}}throw new Error(`no available backend found. ERR: ${b.map(g=>`[${g.name}] ${g.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(u){if(u!==void 0){if(typeof u!="string"||["verbose","info","warning","error","fatal"].indexOf(u)===-1)throw new Error(`Unsupported logging level: ${u}`);this.logLevelInternal=u}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=D=>{let u=1;for(let b=0;b{const t=document.createElement("canvas"),e=t.getContext("2d");if(!u||!e)return i();const n=new Image;n.crossOrigin="Anonymous",n.src=u,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const r=e.getImageData(0,0,t.width,t.height);if(b!==void 0){if(b.height!==void 0&&b.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(f.height=t.height,b.width!==void 0&&b.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");f.width=t.width}else f.height=t.height,f.width=t.width;s(at.bufferToTensor(r.data,f))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return at.bufferToTensor(c,f);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(u){var b,g;const p=document.createElement("canvas").getContext("2d");let h;if(p!=null){const o=this.dims[3],c=this.dims[2],f=this.dims[1],s=u!==void 0&&u.format!==void 0?u.format:"RGB",i=u!==void 0&&((b=u.norm)===null||b===void 0?void 0:b.mean)!==void 0?u.norm.mean:255,t=u!==void 0&&((g=u.norm)===null||g===void 0?void 0:g.bias)!==void 0?u.norm.bias:0,e=c*o;if(u!==void 0){if(u.height!==void 0&&u.height!==c)throw new Error("Image output config height doesn't match tensor height");if(u.width!==void 0&&u.width!==o)throw new Error("Image output config width doesn't match tensor width");if(u.format!==void 0&&f===4&&u.format!=="RGBA"||f===3&&u.format!=="RGB"&&u.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let r=0,a=1,l=2,d=3,m=0,y=e,v=e*2,_=-1;s==="RGBA"?(m=0,y=e,v=e*2,_=e*3):s==="RGB"?(m=0,y=e,v=e*2):s==="RBG"&&(m=0,v=e,y=e*2),h=p.createImageData(o,c);for(let T=0;T"u")throw new Error(`input '${s}' is missing in 'feeds'.`);if(o)for(const s of this.outputNames)p[s]=null;const c=await this.handler.run(u,p,h),f={};for(const s in c)Object.hasOwnProperty.call(c,s)&&(f[s]=new Tensor(c[s].type,c[s].data,c[s].dims));return f}static async create(u,b,g,p){let h,o={};if(typeof u=="string"){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof Uint8Array){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer){const t=u;let e=0,n=u.byteLength;if(typeof b=="object"&&b!==null)o=b;else if(typeof b=="number"){if(e=b,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=u.byteLength-e,typeof g=="number"){if(n=g,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof p=="object"&&p!==null)o=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof g<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof b<"u")throw new TypeError("'options' must be an object.");h=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const f=(o.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),i=await(await resolveBackend(f)).createSessionHandler(h,o);return new cn(i)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! +import{cg as getAugmentedNamespace}from"./index-Dn5R1iW2.js";var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(D,u,b)=>{if(u&&typeof u.init=="function"&&typeof u.createSessionHandler=="function"){const g=backends[D];if(g===void 0)backends[D]={backend:u,priority:b};else{if(g.priority>b)return;if(g.priority===b&&g.backend!==u)throw new Error(`cannot register backend "${D}" using priority ${b}`)}if(b>=0){const p=backendsSortedByPriority.indexOf(D);p!==-1&&backendsSortedByPriority.splice(p,1);for(let h=0;h{const u=D.length===0?backendsSortedByPriority:D,b=[];for(const g of u){const p=backends[g];if(p){if(p.initialized)return p.backend;if(p.aborted)continue;const h=!!p.initPromise;try{return h||(p.initPromise=p.backend.init()),await p.initPromise,p.initialized=!0,p.backend}catch(o){h||b.push({name:g,err:o}),p.aborted=!0}finally{delete p.initPromise}}}throw new Error(`no available backend found. ERR: ${b.map(g=>`[${g.name}] ${g.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(u){if(u!==void 0){if(typeof u!="string"||["verbose","info","warning","error","fatal"].indexOf(u)===-1)throw new Error(`Unsupported logging level: ${u}`);this.logLevelInternal=u}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=D=>{let u=1;for(let b=0;b{const t=document.createElement("canvas"),e=t.getContext("2d");if(!u||!e)return i();const n=new Image;n.crossOrigin="Anonymous",n.src=u,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const r=e.getImageData(0,0,t.width,t.height);if(b!==void 0){if(b.height!==void 0&&b.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(f.height=t.height,b.width!==void 0&&b.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");f.width=t.width}else f.height=t.height,f.width=t.width;s(at.bufferToTensor(r.data,f))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return at.bufferToTensor(c,f);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(u){var b,g;const p=document.createElement("canvas").getContext("2d");let h;if(p!=null){const o=this.dims[3],c=this.dims[2],f=this.dims[1],s=u!==void 0&&u.format!==void 0?u.format:"RGB",i=u!==void 0&&((b=u.norm)===null||b===void 0?void 0:b.mean)!==void 0?u.norm.mean:255,t=u!==void 0&&((g=u.norm)===null||g===void 0?void 0:g.bias)!==void 0?u.norm.bias:0,e=c*o;if(u!==void 0){if(u.height!==void 0&&u.height!==c)throw new Error("Image output config height doesn't match tensor height");if(u.width!==void 0&&u.width!==o)throw new Error("Image output config width doesn't match tensor width");if(u.format!==void 0&&f===4&&u.format!=="RGBA"||f===3&&u.format!=="RGB"&&u.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let r=0,a=1,l=2,d=3,m=0,y=e,v=e*2,_=-1;s==="RGBA"?(m=0,y=e,v=e*2,_=e*3):s==="RGB"?(m=0,y=e,v=e*2):s==="RBG"&&(m=0,v=e,y=e*2),h=p.createImageData(o,c);for(let T=0;T"u")throw new Error(`input '${s}' is missing in 'feeds'.`);if(o)for(const s of this.outputNames)p[s]=null;const c=await this.handler.run(u,p,h),f={};for(const s in c)Object.hasOwnProperty.call(c,s)&&(f[s]=new Tensor(c[s].type,c[s].data,c[s].dims));return f}static async create(u,b,g,p){let h,o={};if(typeof u=="string"){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof Uint8Array){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer){const t=u;let e=0,n=u.byteLength;if(typeof b=="object"&&b!==null)o=b;else if(typeof b=="number"){if(e=b,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=u.byteLength-e,typeof g=="number"){if(n=g,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof p=="object"&&p!==null)o=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof g<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof b<"u")throw new TypeError("'options' must be an object.");h=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const f=(o.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),i=await(await resolveBackend(f)).createSessionHandler(h,o);return new cn(i)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! * ONNX Runtime Web v1.14.0 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. diff --git a/assets/index-JSznsa_U.js b/assets/index-JSznsa_U.js new file mode 100644 index 0000000000000000000000000000000000000000..d19ae657e8d508bb960b6e16cbad8771ff9ad65d --- /dev/null +++ b/assets/index-JSznsa_U.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as g,i as _,bE as y,s as v,bw as b,c as s,o as n,A as c,a as e,e as i,D as d,bx as u,by as k,x as D}from"./index-Dn5R1iW2.js";import{u as I}from"./providers-Li1UUmJz.js";import{I as h}from"./IconStatusItem-BS_oFW9i.js";import{b as m}from"./route-block-B_A1xBdJ.js";const w={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},B={relative:""},S={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},C={text:"neutral-300 dark:neutral-500"},z={"text-3xl":"","font-semibold":""},E={grid:"~ cols-2 gap-4"},N=g({__name:"index",setup(P){const{t:a}=_(),p=y(),f=I(),{allProvidersMetadata:x}=v(f);return(R,o)=>{const r=b("motion");return n(),s(u,null,[c((n(),s("div",w,[e("button",{onClick:o[0]||(o[0]=t=>i(p).back())},o[1]||(o[1]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),e("h1",B,[e("div",S,[e("span",C,d(i(a)("settings.title")),1)]),e("div",z,d(i(a)("settings.pages.providers.title")),1)])])),[[r]]),e("div",E,[(n(!0),s(u,null,k(i(x),(t,l)=>c((n(),D(i(h),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+l*10,delay:l*50,title:t.localizedName,description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),o[2]||(o[2]=e("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:brain":""})],-1))],64)}}});typeof m=="function"&&m(N);export{N as default}; diff --git a/assets/index-QKQc0d-y.js b/assets/index-QKQc0d-y.js new file mode 100644 index 0000000000000000000000000000000000000000..fc39435d8fba6843bb727e1daab0816e49ee0ecc --- /dev/null +++ b/assets/index-QKQc0d-y.js @@ -0,0 +1,3 @@ +import{h as O,g as P,G as wt,w as X,ah as Ct,ai as At,c1 as me,e as g,d as S,E as Ot,p as $,x as H,o as k,y as T,m as $e,b as V,bQ as ce,c2 as Kt,c3 as Et,c4 as Dt,c5 as Xt,bW as ye,c6 as Pt,bT as qt,bv as Le,c7 as at,bS as _e,af as ee,C as Jt,c8 as Qt,ab as Zt,bP as Tt,b_ as _t,D as U,bM as en,c as ue,n as Me,bR as tn,br as nn,c9 as kt,ca as on,cb as rn,cc as sn,b$ as ln,H as an,bx as ke,a as x,cd as cn,ce as un,bU as dn,i as fn,bE as pn,v as mn,bw as vn,A as Ve,z as De,bH as hn,B as gn,by as ct,cf as yn}from"./index-Dn5R1iW2.js";import{_ as ut}from"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import{n as dt}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{b as ft}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const bn=["top","right","bottom","left"],se=Math.min,W=Math.max,Be=Math.round,Pe=Math.floor,q=e=>({x:e,y:e}),xn={left:"right",right:"left",bottom:"top",top:"bottom"},wn={start:"end",end:"start"};function Ue(e,t,n){return W(e,se(t,n))}function te(e,t){return typeof e=="function"?e(t):e}function ne(e){return e.split("-")[0]}function be(e){return e.split("-")[1]}function Je(e){return e==="x"?"y":"x"}function Qe(e){return e==="y"?"height":"width"}function le(e){return["top","bottom"].includes(ne(e))?"y":"x"}function Ze(e){return Je(le(e))}function Cn(e,t,n){n===void 0&&(n=!1);const o=be(e),i=Ze(e),r=Qe(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Re(s)),[s,Re(s)]}function An(e){const t=Re(e);return[Ge(e),t,Ge(t)]}function Ge(e){return e.replace(/start|end/g,t=>wn[t])}function On(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:s;default:return[]}}function En(e,t,n,o){const i=be(e);let r=On(ne(e),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),t&&(r=r.concat(r.map(Ge)))),r}function Re(e){return e.replace(/left|right|bottom|top/g,t=>xn[t])}function Dn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bt(e){return typeof e!="number"?Dn(e):{top:e,right:e,bottom:e,left:e}}function Se(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function pt(e,t,n){let{reference:o,floating:i}=e;const r=le(t),s=Ze(t),l=Qe(s),d=ne(t),c=r==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[l]/2-i[l]/2;let f;switch(d){case"top":f={x:a,y:o.y-i.height};break;case"bottom":f={x:a,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(be(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1);break}return f}const Pn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:u}=pt(c,o,d),p=o,f={},m=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:s,elements:l,middlewareData:d}=t,{element:c,padding:a=0}=te(e,t)||{};if(c==null)return{};const u=Bt(a),p={x:n,y:o},f=Ze(i),m=Qe(f),y=await s.getDimensions(c),v=f==="y",h=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",A=r.reference[m]+r.reference[f]-p[f]-r.floating[m],C=p[f]-r.reference[f],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[b]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=l.floating[b]||r.floating[m]);const B=A/2-C/2,L=E/2-y[m]/2-1,D=se(u[h],L),j=se(u[w],L),M=D,F=E-y[m]-j,R=E/2-y[m]/2+B,oe=Ue(M,R,F),N=!d.arrow&&be(i)!=null&&R!==oe&&r.reference[m]/2-(RR<=0)){var j,M;const R=(((j=r.flip)==null?void 0:j.index)||0)+1,oe=E[R];if(oe)return{data:{index:R,overflows:D},reset:{placement:oe}};let N=(M=D.filter(K=>K.overflows[0]<=0).sort((K,ie)=>K.overflows[1]-ie.overflows[1])[0])==null?void 0:M.placement;if(!N)switch(f){case"bestFit":{var F;const K=(F=D.filter(ie=>{if(_){const re=le(ie.placement);return re===w||re==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(re=>re>0).reduce((re,Yt)=>re+Yt,0)]).sort((ie,re)=>ie[1]-re[1])[0])==null?void 0:F[0];K&&(N=K);break}case"initialPlacement":N=l;break}if(i!==N)return{reset:{placement:N}}}return{}}}};function mt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vt(e){return bn.some(t=>e[t]>=0)}const kn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=te(e,t);switch(o){case"referenceHidden":{const r=await we(t,{...i,elementContext:"reference"}),s=mt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:vt(s)}}}case"escaped":{const r=await we(t,{...i,altBoundary:!0}),s=mt(r,n.floating);return{data:{escapedOffsets:s,escaped:vt(s)}}}default:return{}}}}};async function Bn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=ne(n),l=be(n),d=le(n)==="y",c=["left","top"].includes(s)?-1:1,a=r&&d?-1:1,u=te(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof m=="number"&&(f=l==="end"?m*-1:m),d?{x:f*a,y:p*c}:{x:p*c,y:f*a}}const Rn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=t,d=await Bn(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:s}}}}},Sn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x:h,y:w}=v;return{x:h,y:w}}},...d}=te(e,t),c={x:n,y:o},a=await we(t,d),u=le(ne(i)),p=Je(u);let f=c[p],m=c[u];if(r){const v=p==="y"?"top":"left",h=p==="y"?"bottom":"right",w=f+a[v],b=f-a[h];f=Ue(w,f,b)}if(s){const v=u==="y"?"top":"left",h=u==="y"?"bottom":"right",w=m+a[v],b=m-a[h];m=Ue(w,m,b)}const y=l.fn({...t,[p]:f,[u]:m});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[p]:r,[u]:s}}}}}},$n=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=t,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=te(e,t),a={x:n,y:o},u=le(i),p=Je(u);let f=a[p],m=a[u];const y=te(l,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(d){const b=p==="y"?"height":"width",A=r.reference[p]-r.floating[b]+v.mainAxis,C=r.reference[p]+r.reference[b]-v.mainAxis;fC&&(f=C)}if(c){var h,w;const b=p==="y"?"width":"height",A=["top","left"].includes(ne(i)),C=r.reference[u]-r.floating[b]+(A&&((h=s.offset)==null?void 0:h[u])||0)+(A?0:v.crossAxis),_=r.reference[u]+r.reference[b]+(A?0:((w=s.offset)==null?void 0:w[u])||0)-(A?v.crossAxis:0);m_&&(m=_)}return{[p]:f,[u]:m}}}},Ln=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:r,platform:s,elements:l}=t,{apply:d=()=>{},...c}=te(e,t),a=await we(t,c),u=ne(i),p=be(i),f=le(i)==="y",{width:m,height:y}=r.floating;let v,h;u==="top"||u==="bottom"?(v=u,h=p===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(h=u,v=p==="end"?"top":"bottom");const w=y-a.top-a.bottom,b=m-a.left-a.right,A=se(y-a[v],w),C=se(m-a[h],b),_=!t.middlewareData.shift;let E=A,B=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=w),_&&!p){const D=W(a.left,0),j=W(a.right,0),M=W(a.top,0),F=W(a.bottom,0);f?B=m-2*(D!==0||j!==0?D+j:W(a.left,a.right)):E=y-2*(M!==0||F!==0?M+F:W(a.top,a.bottom))}await d({...t,availableWidth:B,availableHeight:E});const L=await s.getDimensions(l.floating);return m!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Ne(){return typeof window<"u"}function pe(e){return et(e)?(e.nodeName||"").toLowerCase():"#document"}function z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Q(e){var t;return(t=(et(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function et(e){return Ne()?e instanceof Node||e instanceof z(e).Node:!1}function G(e){return Ne()?e instanceof Element||e instanceof z(e).Element:!1}function J(e){return Ne()?e instanceof HTMLElement||e instanceof z(e).HTMLElement:!1}function ht(e){return!Ne()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof z(e).ShadowRoot}function Ae(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Mn(e){return["table","td","th"].includes(pe(e))}function He(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function tt(e){const t=nt(),n=G(e)?Y(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Nn(e){let t=ae(e);for(;J(t)&&!ge(t);){if(tt(t))return t;if(He(t))return null;t=ae(t)}return null}function nt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ge(e){return["html","body","#document"].includes(pe(e))}function Y(e){return z(e).getComputedStyle(e)}function Fe(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ae(e){if(pe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ht(e)&&e.host||Q(e);return ht(t)?t.host:t}function Rt(e){const t=ae(e);return ge(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Ae(t)?t:Rt(t)}function Ce(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Rt(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),s=z(i);if(r){const l=Ye(s);return t.concat(s,s.visualViewport||[],Ae(i)?i:[],l&&n?Ce(l):[])}return t.concat(i,Ce(i,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function St(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,s=i?e.offsetHeight:o,l=Be(n)!==r||Be(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function ot(e){return G(e)?e:e.contextElement}function he(e){const t=ot(e);if(!J(t))return q(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=St(t);let s=(r?Be(n.width):n.width)/o,l=(r?Be(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Hn=q(0);function $t(e){const t=z(e);return!nt()||!t.visualViewport?Hn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==z(e)?!1:t}function fe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=ot(e);let s=q(1);t&&(o?G(o)&&(s=he(o)):s=he(e));const l=Fn(r,n,o)?$t(r):q(0);let d=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,a=i.width/s.x,u=i.height/s.y;if(r){const p=z(r),f=o&&G(o)?z(o):o;let m=p,y=Ye(m);for(;y&&o&&f!==m;){const v=he(y),h=y.getBoundingClientRect(),w=Y(y),b=h.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,A=h.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;d*=v.x,c*=v.y,a*=v.x,u*=v.y,d+=b,c+=A,m=z(y),y=Ye(m)}}return Se({width:a,height:u,x:d,y:c})}function it(e,t){const n=Fe(e).scrollLeft;return t?t.left+n:fe(Q(e)).left+n}function Lt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:it(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function Wn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",s=Q(o),l=t?He(t.floating):!1;if(o===s||l&&r)return n;let d={scrollLeft:0,scrollTop:0},c=q(1);const a=q(0),u=J(o);if((u||!u&&!r)&&((pe(o)!=="body"||Ae(s))&&(d=Fe(o)),J(o))){const f=fe(o);c=he(o),a.x=f.x+o.clientLeft,a.y=f.y+o.clientTop}const p=s&&!u&&!r?Lt(s,d,!0):q(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+a.x+p.x,y:n.y*c.y-d.scrollTop*c.y+a.y+p.y}}function zn(e){return Array.from(e.getClientRects())}function In(e){const t=Q(e),n=Fe(e),o=e.ownerDocument.body,i=W(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=W(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+it(e);const l=-n.scrollTop;return Y(o).direction==="rtl"&&(s+=W(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}function Vn(e,t){const n=z(e),o=Q(e),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,d=0;if(i){r=i.width,s=i.height;const c=nt();(!c||c&&t==="fixed")&&(l=i.offsetLeft,d=i.offsetTop)}return{width:r,height:s,x:l,y:d}}function jn(e,t){const n=fe(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?he(e):q(1),s=e.clientWidth*r.x,l=e.clientHeight*r.y,d=i*r.x,c=o*r.y;return{width:s,height:l,x:d,y:c}}function gt(e,t,n){let o;if(t==="viewport")o=Vn(e,n);else if(t==="document")o=In(Q(e));else if(G(t))o=jn(t,n);else{const i=$t(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Se(o)}function Mt(e,t){const n=ae(e);return n===t||!G(n)||ge(n)?!1:Y(n).position==="fixed"||Mt(n,t)}function Un(e,t){const n=t.get(e);if(n)return n;let o=Ce(e,[],!1).filter(l=>G(l)&&pe(l)!=="body"),i=null;const r=Y(e).position==="fixed";let s=r?ae(e):e;for(;G(s)&&!ge(s);){const l=Y(s),d=tt(s);!d&&l.position==="fixed"&&(i=null),(r?!d&&!i:!d&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ae(s)&&!d&&Mt(e,s))?o=o.filter(a=>a!==s):i=l,s=ae(s)}return t.set(e,o),o}function Gn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[...n==="clippingAncestors"?He(t)?[]:Un(t,this._c):[].concat(n),o],l=s[0],d=s.reduce((c,a)=>{const u=gt(t,a,i);return c.top=W(u.top,c.top),c.right=se(u.right,c.right),c.bottom=se(u.bottom,c.bottom),c.left=W(u.left,c.left),c},gt(t,l,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Yn(e){const{width:t,height:n}=St(e);return{width:t,height:n}}function Kn(e,t,n){const o=J(t),i=Q(t),r=n==="fixed",s=fe(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const d=q(0);if(o||!o&&!r)if((pe(t)!=="body"||Ae(i))&&(l=Fe(t)),o){const p=fe(t,!0,r,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else i&&(d.x=it(i));const c=i&&!o&&!r?Lt(i,l):q(0),a=s.left+l.scrollLeft-d.x-c.x,u=s.top+l.scrollTop-d.y-c.y;return{x:a,y:u,width:s.width,height:s.height}}function je(e){return Y(e).position==="static"}function yt(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Q(e)===n&&(n=n.ownerDocument.body),n}function Nt(e,t){const n=z(e);if(He(e))return n;if(!J(e)){let i=ae(e);for(;i&&!ge(i);){if(G(i)&&!je(i))return i;i=ae(i)}return n}let o=yt(e,t);for(;o&&Mn(o)&&je(o);)o=yt(o,t);return o&&ge(o)&&je(o)&&!tt(o)?n:o||Nn(e)||n}const Xn=async function(e){const t=this.getOffsetParent||Nt,n=this.getDimensions,o=await n(e.floating);return{reference:Kn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function qn(e){return Y(e).direction==="rtl"}const Jn={convertOffsetParentRelativeRectToViewportRelativeRect:Wn,getDocumentElement:Q,getClippingRect:Gn,getOffsetParent:Nt,getElementRects:Xn,getClientRects:zn,getDimensions:Yn,getScale:he,isElement:G,isRTL:qn};function Ht(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qn(e,t){let n=null,o;const i=Q(e);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),r();const c=e.getBoundingClientRect(),{left:a,top:u,width:p,height:f}=c;if(l||t(),!p||!f)return;const m=Pe(u),y=Pe(i.clientWidth-(a+p)),v=Pe(i.clientHeight-(u+f)),h=Pe(a),b={rootMargin:-m+"px "+-y+"px "+-v+"px "+-h+"px",threshold:W(0,se(1,d))||1};let A=!0;function C(_){const E=_[0].intersectionRatio;if(E!==d){if(!A)return s();E?s(!1,E):o=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!Ht(c,e.getBoundingClientRect())&&s(),A=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,b)}n.observe(e)}return s(!0),r}function Zn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=ot(e),a=i||r?[...c?Ce(c):[],...Ce(t)]:[];a.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),r&&h.addEventListener("resize",n)});const u=c&&l?Qn(c,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(h=>{let[w]=h;w&&w.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(t)})),n()}),c&&!d&&f.observe(c),f.observe(t));let m,y=d?fe(e):null;d&&v();function v(){const h=fe(e);y&&!Ht(y,h)&&n(),y=h,m=requestAnimationFrame(v)}return n(),()=>{var h;a.forEach(w=>{i&&w.removeEventListener("scroll",n),r&&w.removeEventListener("resize",n)}),u==null||u(),(h=f)==null||h.disconnect(),f=null,d&&cancelAnimationFrame(m)}}const eo=Rn,to=Sn,bt=_n,no=Ln,oo=kn,io=Tn,ro=$n,so=(e,t,n)=>{const o=new Map,i={platform:Jn,...n},r={...i.platform,_c:o};return Pn(e,t,{...i,platform:r})};function lo(e){return e!=null&&typeof e=="object"&&"$el"in e}function Ke(e){if(lo(e)){const t=e.$el;return et(t)&&pe(t)==="#comment"?null:t}return e}function ve(e){return typeof e=="function"?e():g(e)}function ao(e){return{name:"arrow",options:e,fn(t){const n=Ke(ve(e.element));return n==null?{}:io({element:n,padding:e.padding}).fn(t)}}}function Ft(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xt(e,t){const n=Ft(e);return Math.round(t*n)/n}function co(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=O(()=>{var E;return(E=ve(n.open))!=null?E:!0}),r=O(()=>ve(n.middleware)),s=O(()=>{var E;return(E=ve(n.placement))!=null?E:"bottom"}),l=O(()=>{var E;return(E=ve(n.strategy))!=null?E:"absolute"}),d=O(()=>{var E;return(E=ve(n.transform))!=null?E:!0}),c=O(()=>Ke(e.value)),a=O(()=>Ke(t.value)),u=P(0),p=P(0),f=P(l.value),m=P(s.value),y=wt({}),v=P(!1),h=O(()=>{const E={position:f.value,left:"0",top:"0"};if(!a.value)return E;const B=xt(a.value,u.value),L=xt(a.value,p.value);return d.value?{...E,transform:"translate("+B+"px, "+L+"px)",...Ft(a.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:B+"px",top:L+"px"}});let w;function b(){if(c.value==null||a.value==null)return;const E=i.value;so(c.value,a.value,{middleware:r.value,placement:s.value,strategy:l.value}).then(B=>{u.value=B.x,p.value=B.y,f.value=B.strategy,m.value=B.placement,y.value=B.middlewareData,v.value=E!==!1})}function A(){typeof w=="function"&&(w(),w=void 0)}function C(){if(A(),o===void 0){b();return}if(c.value!=null&&a.value!=null){w=o(c.value,a.value,b);return}}function _(){i.value||(v.value=!1)}return X([r,s,l,i],b,{flush:"sync"}),X([c,a],C,{flush:"sync"}),X(i,_,{flush:"sync"}),Ct()&&At(A),{x:me(u),y:me(p),strategy:me(f),placement:me(m),middlewareData:me(y),isPositioned:me(v),floatingStyles:h,update:b}}function Oe(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[i=>{const r=qt(o,i);if(r||r===null)return r;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},i=>(dn(o,i),i)]}function Wt(e,t,n){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(i)}function uo(e,t){var n;const o=wt();return ee(()=>{o.value=e()},{...t,flush:(n=void 0)!=null?n:"sync"}),Pt(o)}function We(e){return Ct()?(At(e),!0):!1}function fo(){const e=new Set,t=n=>{e.delete(n)};return{on:n=>{e.add(n);const o=()=>t(n);return We(o),{off:o}},off:t,trigger:(...n)=>Promise.all(Array.from(e).map(o=>o(...n)))}}function po(e){let t=!1,n;const o=un(!0);return(...i)=>(t||(n=o.run(()=>e(...i)),t=!0),n)}function de(e){return typeof e=="function"?e():g(e)}const Ee=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const mo=e=>typeof e<"u",vo=Object.prototype.toString,ho=e=>vo.call(e)==="[object Object]",go=()=>{};function yo(e,t=1e4){return cn((n,o)=>{let i=de(e),r;const s=()=>setTimeout(()=>{i=de(e),o()},de(t));return We(()=>{clearTimeout(r)}),{get(){return n(),i},set(l){i=l,o(),clearTimeout(r),r=s()}}})}function zt(e,t,n={}){const{immediate:o=!0}=n,i=P(!1);let r=null;function s(){r&&(clearTimeout(r),r=null)}function l(){i.value=!1,s()}function d(...c){s(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...c)},de(t))}return o&&(i.value=!0,Ee&&d()),We(l),{isPending:Pt(i),start:d,stop:l}}function ze(e){var t;const n=de(e);return(t=n==null?void 0:n.$el)!=null?t:n}const rt=Ee?window:void 0;function Xe(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=rt):[t,n,o,i]=e,!t)return go;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(a=>a()),r.length=0},l=(a,u,p,f)=>(a.addEventListener(u,p,f),()=>a.removeEventListener(u,p,f)),d=X(()=>[ze(t),de(i)],([a,u])=>{if(s(),!a)return;const p=ho(u)?{...u}:u;r.push(...n.flatMap(f=>o.map(m=>l(a,f,m,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),s()};return We(c),c}function bo(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function xo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=rt,eventName:r="keydown",passive:s=!1,dedupe:l=!1}=o,d=bo(t);return Xe(i,r,c=>{c.repeat&&de(l)||d(c)&&n(c)},s)}function wo(){const e=P(!1),t=ye();return t&&$e(()=>{e.value=!0},t),e}function Co(e){return JSON.parse(JSON.stringify(e))}function Ao(e,t,n,o={}){var i,r,s;const{clone:l=!1,passive:d=!1,eventName:c,deep:a=!1,defaultValue:u,shouldEmit:p}=o,f=ye(),m=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((s=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(f==null?void 0:f.proxy));let y=c;y=y||`update:${t.toString()}`;const v=b=>l?typeof l=="function"?l(b):Co(b):b,h=()=>mo(e[t])?v(e[t]):u,w=b=>{p?p(b)&&m(y,b):m(y,b)};if(d){const b=h(),A=P(b);let C=!1;return X(()=>e[t],_=>{C||(C=!0,A.value=v(_),Le(()=>C=!1))}),X(A,_=>{!C&&(_!==e[t]||a)&&w(_)},{deep:a}),A}else return O({get(){return h()},set(b){w(b)}})}function st(e){return e?e.flatMap(t=>t.type===ke?st(t.children):[t]):[]}const[Oo,Ui]=Oe("ConfigProvider");function Eo(e){const t=ye(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(i=>{o[on(kt(i))]=(...r)=>e(i,...r)}),o}function It(e){const t=ye(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((i,r)=>{const s=(t==null?void 0:t.type.props[r]).default;return s!==void 0&&(i[r]=s),i},{}),o=nn(e);return O(()=>{const i={},r=(t==null?void 0:t.vnode.props)??{};return Object.keys(r).forEach(s=>{i[kt(s)]=r[s]}),Object.keys({...n,...i}).reduce((s,l)=>(o.value[l]!==void 0&&(s[l]=o.value[l]),s),{})})}function Do(e,t){const n=It(e),o=t?Eo(t):{};return O(()=>({...n.value,...o}))}function I(){const e=ye(),t=P(),n=O(()=>{var s,l;return["#text","#comment"].includes((s=t.value)==null?void 0:s.$el.nodeName)?(l=t.value)==null?void 0:l.$el.nextElementSibling:ze(t)}),o=Object.assign({},e.exposed),i={};for(const s in e.props)Object.defineProperty(i,s,{enumerable:!0,configurable:!0,get:()=>e.props[s]});if(Object.keys(o).length>0)for(const s in o)Object.defineProperty(i,s,{enumerable:!0,configurable:!0,get:()=>o[s]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function r(s){t.value=s,s&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>s instanceof Element?s:s.$el}),e.exposed=i)}return{forwardRef:r,currentRef:t,currentElement:n}}function Po(e,t){const n=yo(!1,300),o=P(null),i=fo();function r(){o.value=null,n.value=!1}function s(l,d){const c=l.currentTarget,a={x:l.clientX,y:l.clientY},u=To(a,c.getBoundingClientRect()),p=_o(a,u),f=ko(d.getBoundingClientRect()),m=Ro([...p,...f]);o.value=m,n.value=!0}return ee(l=>{if(e.value&&t.value){const d=a=>s(a,t.value),c=a=>s(a,e.value);e.value.addEventListener("pointerleave",d),t.value.addEventListener("pointerleave",c),l(()=>{var a,u;(a=e.value)==null||a.removeEventListener("pointerleave",d),(u=t.value)==null||u.removeEventListener("pointerleave",c)})}}),ee(l=>{var d;if(o.value){const c=a=>{var u,p;if(!o.value)return;const f=a.target,m={x:a.clientX,y:a.clientY},y=((u=e.value)==null?void 0:u.contains(f))||((p=t.value)==null?void 0:p.contains(f)),v=!Bo(m,o.value),h=!!f.closest("[data-grace-area-trigger]");y?r():(v||h)&&(r(),i.trigger())};(d=e.value)==null||d.ownerDocument.addEventListener("pointermove",c),l(()=>{var a;return(a=e.value)==null?void 0:a.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function To(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,o,i,r)){case r:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function _o(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function ko(e){const{top:t,right:n,bottom:o,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:o},{x:i,y:o}]}function Bo(e,t){const{x:n,y:o}=e;let i=!1;for(let r=0,s=t.length-1;ro!=a>o&&n<(c-l)*(o-d)/(a-d)+l&&(i=!i)}return i}function Ro(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),So(t)}function So(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const r=t[t.length-1],s=t[t.length-2];if((r.x-s.x)*(i.y-s.y)>=(r.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;n.length>=2;){const r=n[n.length-1],s=n[n.length-2];if((r.x-s.x)*(i.y-s.y)>=(r.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}let $o=0;function Lo(e,t="radix"){const n=Oo({useId:void 0});return at?`${t}-${at()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++$o}`}function Mo(e){const t=P(),n=O(()=>{var i;return((i=t.value)==null?void 0:i.width)??0}),o=O(()=>{var i;return((i=t.value)==null?void 0:i.height)??0});return $e(()=>{const i=ze(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let d,c;if("borderBoxSize"in l){const a=l.borderBoxSize,u=Array.isArray(a)?a[0]:a;d=u.inlineSize,c=u.blockSize}else d=i.offsetWidth,c=i.offsetHeight;t.value={width:d,height:c}});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else t.value=void 0}),{width:n,height:o}}function No(e,t){const n=P(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}const Ho=S({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o,i;if(!n.default)return null;const r=st(n.default()),s=r.findIndex(a=>a.type!==Tt);if(s===-1)return r;const l=r[s];(o=l.props)==null||delete o.ref;const d=l.props?ce(t,l.props):t;t.class&&(i=l.props)!=null&&i.class&&delete l.props.class;const c=tn(l,d);for(const a in d)a.startsWith("on")&&(c.props||(c.props={}),c.props[a]=d[a]);return r.length===1?c:(r[s]=c,r)}}}),xe=S({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>_e(o,t):o!=="template"?()=>_e(e.as,t,{default:n.default}):()=>_e(Ho,t,{default:n.default})}});function Fo(e,t){var n;const o=P({}),i=P("none"),r=P(e),s=e.value?"mounted":"unmounted";let l;const d=((n=t.value)==null?void 0:n.ownerDocument.defaultView)??rt,{state:c,dispatch:a}=No(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=v=>{var h;if(Ee){const w=new CustomEvent(v,{bubbles:!1,cancelable:!1});(h=t.value)==null||h.dispatchEvent(w)}};X(e,async(v,h)=>{var w;const b=h!==v;if(await Le(),b){const A=i.value,C=Te(t.value);v?(a("MOUNT"),u("enter"),C==="none"&&u("after-enter")):C==="none"||((w=o.value)==null?void 0:w.display)==="none"?(a("UNMOUNT"),u("leave"),u("after-leave")):h&&A!==C?(a("ANIMATION_OUT"),u("leave")):(a("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=v=>{const h=Te(t.value),w=h.includes(v.animationName),b=c.value==="mounted"?"enter":"leave";if(v.target===t.value&&w&&(u(`after-${b}`),a("ANIMATION_END"),!r.value)){const A=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",l=d==null?void 0:d.setTimeout(()=>{var C;((C=t.value)==null?void 0:C.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=A)})}v.target===t.value&&h==="none"&&a("ANIMATION_END")},f=v=>{v.target===t.value&&(i.value=Te(t.value))},m=X(t,(v,h)=>{v?(o.value=getComputedStyle(v),v.addEventListener("animationstart",f),v.addEventListener("animationcancel",p),v.addEventListener("animationend",p)):(a("ANIMATION_END"),l!==void 0&&(d==null||d.clearTimeout(l)),h==null||h.removeEventListener("animationstart",f),h==null||h.removeEventListener("animationcancel",p),h==null||h.removeEventListener("animationend",p))},{immediate:!0}),y=X(c,()=>{const v=Te(t.value);i.value=c.value==="mounted"?v:"none"});return an(()=>{m(),y()}),{isPresent:O(()=>["mounted","unmountSuspended"].includes(c.value))}}function Te(e){return e&&getComputedStyle(e).animationName||"none"}const Wo=S({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var o;const{present:i,forceMount:r}=Ot(e),s=P(),{isPresent:l}=Fo(i,s);n({present:l});let d=t.default({present:l});d=st(d||[]);const c=ye();if(d&&(d==null?void 0:d.length)>1){const a=(o=c==null?void 0:c.parent)!=null&&o.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${a}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` +`)].join(` +`))}return()=>r.value||i.value||l.value?_e(t.default({present:l})[0],{ref:a=>{const u=ze(a);return typeof(u==null?void 0:u.hasAttribute)>"u"||(u!=null&&u.hasAttribute("data-radix-popper-content-wrapper")?s.value=u.firstElementChild:s.value=u),u}}):null}}),zo=S({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=wo();return(n,o)=>g(t)||n.forceMount?(k(),H(Qt,{key:0,to:n.to,disabled:n.disabled},[$(n.$slots,"default")],8,["to","disabled"])):Jt("",!0)}}),Io="dismissableLayer.pointerDownOutside",Vo="dismissableLayer.focusOutside";function Vt(e,t){const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),i=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&o===n||i.indexOf(o){});return ee(s=>{if(!Ee)return;const l=async c=>{const a=c.target;if(t!=null&&t.value){if(Vt(t.value,a)){i.value=!1;return}if(c.target&&!i.value){let u=function(){Wt(Io,e,p)};const p={originalEvent:c};c.pointerType==="touch"?(o.removeEventListener("click",r.value),r.value=u,o.addEventListener("click",r.value,{once:!0})):u()}else o.removeEventListener("click",r.value);i.value=!1}},d=window.setTimeout(()=>{o.addEventListener("pointerdown",l)},0);s(()=>{window.clearTimeout(d),o.removeEventListener("pointerdown",l),o.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>i.value=!0}}function Uo(e,t){var n;const o=((n=t==null?void 0:t.value)==null?void 0:n.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=P(!1);return ee(r=>{if(!Ee)return;const s=async l=>{t!=null&&t.value&&(await Le(),!(!t.value||Vt(t.value,l.target))&&l.target&&!i.value&&Wt(Vo,e,{originalEvent:l}))};o.addEventListener("focusin",s),r(()=>o.removeEventListener("focusin",s))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const Z=ln({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Go=S({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:i,currentElement:r}=I(),s=O(()=>{var m;return((m=r.value)==null?void 0:m.ownerDocument)??globalThis.document}),l=O(()=>Z.layersRoot),d=O(()=>r.value?Array.from(l.value).indexOf(r.value):-1),c=O(()=>Z.layersWithOutsidePointerEventsDisabled.size>0),a=O(()=>{const m=Array.from(l.value),[y]=[...Z.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(y);return d.value>=v}),u=jo(async m=>{const y=[...Z.branches].some(v=>v==null?void 0:v.contains(m.target));!a.value||y||(o("pointerDownOutside",m),o("interactOutside",m),await Le(),m.defaultPrevented||o("dismiss"))},r),p=Uo(m=>{[...Z.branches].some(y=>y==null?void 0:y.contains(m.target))||(o("focusOutside",m),o("interactOutside",m),m.defaultPrevented||o("dismiss"))},r);xo("Escape",m=>{d.value===l.value.size-1&&(o("escapeKeyDown",m),m.defaultPrevented||o("dismiss"))});let f;return ee(m=>{r.value&&(n.disableOutsidePointerEvents&&(Z.layersWithOutsidePointerEventsDisabled.size===0&&(f=s.value.body.style.pointerEvents,s.value.body.style.pointerEvents="none"),Z.layersWithOutsidePointerEventsDisabled.add(r.value)),l.value.add(r.value),m(()=>{n.disableOutsidePointerEvents&&Z.layersWithOutsidePointerEventsDisabled.size===1&&(s.value.body.style.pointerEvents=f)}))}),ee(m=>{m(()=>{r.value&&(l.value.delete(r.value),Z.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(m,y)=>(k(),H(g(xe),{ref:g(i),"as-child":m.asChild,as:m.as,"data-dismissable-layer":"",style:Me({pointerEvents:c.value?a.value?"auto":"none":void 0}),onFocusCapture:g(p).onFocusCapture,onBlurCapture:g(p).onBlurCapture,onPointerdownCapture:g(u).onPointerDownCapture},{default:T(()=>[$(m.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}});po(()=>P([]));const[jt,Yo]=Oe("PopperRoot"),Ko=S({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=P();return Yo({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>$(n.$slots,"default")}}),Xo=S({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const t=e,{forwardRef:n,currentElement:o}=I(),i=jt();return ee(()=>{i.onAnchorChange(t.element??o.value)}),(r,s)=>(k(),H(g(xe),{ref:g(n),as:r.as,"as-child":r.asChild},{default:T(()=>[$(r.$slots,"default")]),_:3},8,["as","as-child"]))}});function qo(e){return e!==null}function Jo(e){return{name:"transformOrigin",options:e,fn(t){var n,o,i;const{placement:r,rects:s,middlewareData:l}=t,d=((n=l.arrow)==null?void 0:n.centerOffset)!==0,c=d?0:e.arrowWidth,a=d?0:e.arrowHeight,[u,p]=qe(r),f={start:"0%",center:"50%",end:"100%"}[p],m=(((o=l.arrow)==null?void 0:o.x)??0)+c/2,y=(((i=l.arrow)==null?void 0:i.y)??0)+a/2;let v="",h="";return u==="bottom"?(v=d?f:`${m}px`,h=`${-a}px`):u==="top"?(v=d?f:`${m}px`,h=`${s.floating.height+a}px`):u==="right"?(v=`${-a}px`,h=d?f:`${y}px`):u==="left"&&(v=`${s.floating.width+a}px`,h=d?f:`${y}px`),{data:{x:v,y:h}}}}}function qe(e){const[t,n="center"]=e.split("-");return[t,n]}const Qo={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[Zo,ei]=Oe("PopperContent"),ti=S({inheritAttrs:!1,__name:"PopperContent",props:rn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...Qo}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,i=jt(),{forwardRef:r,currentElement:s}=I(),l=P(),d=P(),{width:c,height:a}=Mo(d),u=O(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),p=O(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=O(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),m=O(()=>({padding:p.value,boundary:f.value.filter(qo),altBoundary:f.value.length>0})),y=uo(()=>[eo({mainAxis:n.sideOffset+a.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&bt({...m.value}),n.avoidCollisions&&to({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?ro():void 0,...m.value}),!n.prioritizePosition&&n.avoidCollisions&&bt({...m.value}),no({...m.value,apply:({elements:D,rects:j,availableWidth:M,availableHeight:F})=>{const{width:R,height:oe}=j.reference,N=D.floating.style;N.setProperty("--radix-popper-available-width",`${M}px`),N.setProperty("--radix-popper-available-height",`${F}px`),N.setProperty("--radix-popper-anchor-width",`${R}px`),N.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),d.value&&ao({element:d.value,padding:n.arrowPadding}),Jo({arrowWidth:c.value,arrowHeight:a.value}),n.hideWhenDetached&&oo({strategy:"referenceHidden",...m.value})]),{floatingStyles:v,placement:h,isPositioned:w,middlewareData:b}=co(i.anchor,l,{strategy:"fixed",placement:u,whileElementsMounted:(...D)=>Zn(...D,{animationFrame:n.updatePositionStrategy==="always"}),middleware:y}),A=O(()=>qe(h.value)[0]),C=O(()=>qe(h.value)[1]);sn(()=>{w.value&&o("placed")});const _=O(()=>{var D;return((D=b.value.arrow)==null?void 0:D.centerOffset)!==0}),E=P("");ee(()=>{s.value&&(E.value=window.getComputedStyle(s.value).zIndex)});const B=O(()=>{var D;return((D=b.value.arrow)==null?void 0:D.x)??0}),L=O(()=>{var D;return((D=b.value.arrow)==null?void 0:D.y)??0});return ei({placedSide:A,onArrowChange:D=>d.value=D,arrowX:B,arrowY:L,shouldHideArrow:_}),(D,j)=>{var M,F,R;return k(),ue("div",{ref_key:"floatingRef",ref:l,"data-radix-popper-content-wrapper":"",style:Me({...g(v),transform:g(w)?g(v).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:E.value,"--radix-popper-transform-origin":[(M=g(b).transformOrigin)==null?void 0:M.x,(F=g(b).transformOrigin)==null?void 0:F.y].join(" "),...((R=g(b).hide)==null?void 0:R.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[V(g(xe),ce({ref:g(r)},D.$attrs,{"as-child":n.asChild,as:D.as,"data-side":A.value,"data-align":C.value,style:{animation:g(w)?void 0:"none"}}),{default:T(()=>[$(D.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),ni=x("polygon",{points:"0,0 30,0 15,10"},null,-1),oi=S({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return I(),(n,o)=>(k(),H(g(xe),ce(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 30 10",preserveAspectRatio:n.asChild?void 0:"none"}),{default:T(()=>[$(n.$slots,"default",{},()=>[ni])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),ii={top:"bottom",right:"left",bottom:"top",left:"right"},ri=S({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:t}=I(),n=Zo(),o=O(()=>ii[n.placedSide.value]);return(i,r)=>{var s,l,d,c;return k(),ue("span",{ref:a=>{g(n).onArrowChange(a)},style:Me({position:"absolute",left:(s=g(n).arrowX)!=null&&s.value?`${(l=g(n).arrowX)==null?void 0:l.value}px`:void 0,top:(d=g(n).arrowY)!=null&&d.value?`${(c=g(n).arrowY)==null?void 0:c.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[g(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[g(n).placedSide.value],visibility:g(n).shouldHideArrow.value?"hidden":void 0})},[V(oi,ce(i.$attrs,{ref:g(t),style:{display:"block"},as:i.as,"as-child":i.asChild,width:i.width,height:i.height}),{default:T(()=>[$(i.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),si=S({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return I(),(t,n)=>(k(),H(g(xe),{as:t.as,"as-child":t.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:T(()=>[$(t.$slots,"default")]),_:3},8,["as","as-child"]))}});function li(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}li();const Ut="tooltip.open",[lt,ai]=Oe("TooltipProvider"),ci=S({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{default:700},skipDelayDuration:{default:300},disableHoverableContent:{type:Boolean,default:!1},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:i,disableClosingTrigger:r,ignoreNonKeyboardFocus:s,disabled:l}=Ot(t);I();const d=P(!0),c=P(!1),{start:a,stop:u}=zt(()=>{d.value=!0},o,{immediate:!1});return ai({isOpenDelayed:d,delayDuration:n,onOpen(){u(),d.value=!1},onClose(){a()},isPointerInTransitRef:c,disableHoverableContent:i,disableClosingTrigger:r,disabled:l,ignoreNonKeyboardFocus:s}),(p,f)=>$(p.$slots,"default")}}),[Ie,ui]=Oe("TooltipRoot"),di=S({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},delayDuration:{default:void 0},disableHoverableContent:{type:Boolean,default:void 0},disableClosingTrigger:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;I();const i=lt(),r=O(()=>n.disableHoverableContent??i.disableHoverableContent.value),s=O(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),l=O(()=>n.disabled??i.disabled.value),d=O(()=>n.delayDuration??i.delayDuration.value),c=O(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),a=Ao(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});X(a,b=>{i.onClose&&(b?(i.onOpen(),document.dispatchEvent(new CustomEvent(Ut))):i.onClose())});const u=P(!1),p=P(),f=O(()=>a.value?u.value?"delayed-open":"instant-open":"closed"),{start:m,stop:y}=zt(()=>{u.value=!0,a.value=!0},d,{immediate:!1});function v(){y(),u.value=!1,a.value=!0}function h(){y(),a.value=!1}function w(){m()}return ui({contentId:"",open:a,stateAttribute:f,trigger:p,onTriggerChange(b){p.value=b},onTriggerEnter(){i.isOpenDelayed.value?w():v()},onTriggerLeave(){r.value?h():y()},onOpen:v,onClose:h,disableHoverableContent:r,disableClosingTrigger:s,disabled:l,ignoreNonKeyboardFocus:c}),(b,A)=>(k(),H(g(Ko),null,{default:T(()=>[$(b.$slots,"default",{open:g(a)})]),_:3}))}}),fi=S({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Ie(),o=lt();n.contentId||(n.contentId=Lo(void 0,"radix-vue-tooltip-content"));const{forwardRef:i,currentElement:r}=I(),s=P(!1),l=P(!1),d=O(()=>n.disabled.value?{}:{click:y,focus:f,pointermove:u,pointerleave:p,pointerdown:a,blur:m});$e(()=>{n.onTriggerChange(r.value)});function c(){setTimeout(()=>{s.value=!1},1)}function a(){s.value=!0,document.addEventListener("pointerup",c,{once:!0})}function u(v){v.pointerType!=="touch"&&!l.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),l.value=!0)}function p(){n.onTriggerLeave(),l.value=!1}function f(v){var h,w;s.value||n.ignoreNonKeyboardFocus.value&&!((w=(h=v.target).matches)!=null&&w.call(h,":focus-visible"))||n.onOpen()}function m(){n.onClose()}function y(){n.disableClosingTrigger.value||n.onClose()}return(v,h)=>(k(),H(g(Xo),{"as-child":""},{default:T(()=>[V(g(xe),ce({ref:g(i),"aria-describedby":g(n).open.value?g(n).contentId:void 0,"data-state":g(n).stateAttribute.value,as:v.as,"as-child":t.asChild,"data-grace-area-trigger":""},Kt(d.value)),{default:T(()=>[$(v.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),Gt=S({__name:"TooltipContentImpl",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{default:0},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:"partial"},hideWhenDetached:{type:Boolean,default:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ie(),{forwardRef:r}=I(),s=Zt(),l=O(()=>{var a;return(a=s.default)==null?void 0:a.call(s)}),d=O(()=>{var a;if(n.ariaLabel)return n.ariaLabel;let u="";function p(f){typeof f.children=="string"&&f.type!==Tt?u+=f.children:Array.isArray(f.children)&&f.children.forEach(m=>p(m))}return(a=l.value)==null||a.forEach(f=>p(f)),u}),c=O(()=>{const{ariaLabel:a,...u}=n;return u});return $e(()=>{Xe(window,"scroll",a=>{const u=a.target;u!=null&&u.contains(i.trigger.value)&&i.onClose()}),Xe(window,Ut,i.onClose)}),(a,u)=>(k(),H(g(Go),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var f;g(i).disableClosingTrigger.value&&(f=g(i).trigger.value)!=null&&f.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=en(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>g(i).onClose())},{default:T(()=>[V(g(ti),ce({ref:g(r),"data-state":g(i).stateAttribute.value},{...a.$attrs,...c.value},{style:{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),{default:T(()=>[$(a.$slots,"default"),V(g(si),{id:g(i).contentId,role:"tooltip"},{default:T(()=>[_t(U(d.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),pi=S({__name:"TooltipContentHoverable",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},setup(e){const t=It(e),{forwardRef:n,currentElement:o}=I(),{trigger:i,onClose:r}=Ie(),s=lt(),{isPointerInTransit:l,onPointerExit:d}=Po(i,o);return s.isPointerInTransitRef=l,d(()=>{r()}),(c,a)=>(k(),H(Gt,ce({ref:g(n)},g(t)),{default:T(()=>[$(c.$slots,"default")]),_:3},16))}}),mi=S({__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ie(),r=Do(n,o),{forwardRef:s}=I();return(l,d)=>(k(),H(g(Wo),{present:l.forceMount||g(i).open.value},{default:T(()=>[(k(),H(Xt(g(i).disableHoverableContent.value?Gt:pi),ce({ref:g(s)},g(r)),{default:T(()=>[$(l.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),vi=S({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return I(),(n,o)=>(k(),H(g(ri),Et(Dt(t)),{default:T(()=>[$(n.$slots,"default")]),_:3},16))}}),hi=S({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(k(),H(g(zo),Et(Dt(t)),{default:T(()=>[$(n.$slots,"default")]),_:3},16))}}),gi={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},yi={relative:""},bi={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},xi={text:"neutral-300 dark:neutral-500"},wi={"text-3xl":"","font-semibold":""},Ci={"flex-col":""},Ai=["onClick"],Oi={flex:"~ row 1","items-center":"","gap-1.5":""},Ei={"p-4":""},Di={class:"mb-2 text-sm font-medium"},Pi={flex:"~ col gap-4"},Ti=["disabled"],_i={"mt-4":"",class:"flex items-center justify-end gap-4"},ki={class:"relative inline-flex cursor-pointer items-center"},Bi={class:"ml-2 text-sm font-medium"},Ri=["onClick"],Si={flex:"~ row 1","items-center":"","gap-1.5":""},$i={"p-4":"",flex:"~ col gap-4"},Li={"text-base":"","font-medium":""},Mi={text:"sm neutral-500"},Ni={flex:"~ row","gap-2":""},Hi=["onClick"],Fi=S({__name:"index",setup(e){const{t}=fn(),n=pn(),o=mn(),i=O(()=>[{name:t("settings.pages.themes.sections.section.theme-presets.preset.morandi.title"),description:t("settings.pages.themes.sections.section.theme-presets.preset.morandi.description"),colors:[{hex:"#A5978B",name:"Taupe"},{hex:"#D8CAAF",name:"Beige"},{hex:"#B8B4A7",name:"Ash Grey"},{hex:"#C4BCB1",name:"Light Taupe"},{hex:"#E5DED8",name:"Ivory"},{hex:"#9A8F7D",name:"Olive Grey"},{hex:"#BEB5A7",name:"Sand"},{hex:"#C9C0B6",name:"Warm Grey"}]},{name:t("settings.pages.themes.sections.section.theme-presets.preset.monet.title"),description:t("settings.pages.themes.sections.section.theme-presets.preset.monet.description"),colors:[{hex:"#7A9EAF",name:"Sky Blue"},{hex:"#B8C7CC",name:"Mist"},{hex:"#D4B79C",name:"Sand"},{hex:"#8B9D77",name:"Moss Green"},{hex:"#C7D5CB",name:"Water Lily"},{hex:"#E6D0B1",name:"Wheat"},{hex:"#94A7B1",name:"Slate Blue"},{hex:"#B4C8C3",name:"Sage"}]},{name:t("settings.pages.themes.sections.section.theme-presets.preset.japanese.title"),description:t("settings.pages.themes.sections.section.theme-presets.preset.japanese.description"),colors:[{hex:"#D9B48F",name:"Tan"},{hex:"#B5917A",name:"Warm Taupe"},{hex:"#8C7A6B",name:"Umber"},{hex:"#A17F5F",name:"Coffee"},{hex:"#B98C46",name:"Bronze"},{hex:"#C7A252",name:"Gold"},{hex:"#DAB300",name:"Mustard"},{hex:"#D19826",name:"Amber"}]},{name:t("settings.pages.themes.sections.section.theme-presets.preset.nordic.title"),description:t("settings.pages.themes.sections.section.theme-presets.preset.nordic.description"),colors:[{hex:"#9BA7B0",name:"Nordic Blue"},{hex:"#C1CBD4",name:"Ice"},{hex:"#A5ADB6",name:"Fjord"},{hex:"#8B959E",name:"Steel"},{hex:"#D4DCE4",name:"Glacier"},{hex:"#7F8A94",name:"Slate"},{hex:"#B3BCC6",name:"Cloud"},{hex:"#98A4AE",name:"Stone"}]},{name:t("settings.pages.themes.sections.section.theme-presets.preset.chinese.title"),description:t("settings.pages.themes.sections.section.theme-presets.preset.chinese.description"),colors:[{hex:"#E4C6D0",name:"霞光红 (Rosy Dawn)"},{hex:"#A61B29",name:"枣红 (Chinese Red)"},{hex:"#5D513C",name:"黄栌 (Smoky Brown)"},{hex:"#789262",name:"竹青 (Bamboo Green)"},{hex:"#1C0D1A",name:"乌梅紫 (Dark Purple)"},{hex:"#F7C242",name:"缃色 (Golden Yellow)"},{hex:"#62A9DD",name:"青冥 (Azure Blue)"},{hex:"#8C4B3C",name:"赭石 (Ochre)"}]}]);function r(){o.themeColorsHue=yn,o.themeColorsHueDynamic=!1}function s(d){const c=dt("oklch")(d);if(!c)return;const{h:a}=c;a&&(o.themeColorsHue=a,o.themeColorsHueDynamic=!1)}function l(d){if(o.themeColorsHueDynamic)return!1;const c=dt("oklch")(d);if(!c||!c.h)return!1;const a=Math.abs(c.h-o.themeColorsHue);return a<.01||a>359.99}return(d,c)=>{const a=vn("motion");return k(),ue(ke,null,[Ve((k(),ue("div",gi,[x("button",{onClick:c[0]||(c[0]=u=>g(n).back())},c[3]||(c[3]=[x("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),x("h1",yi,[x("div",bi,[x("span",xi,U(g(t)("settings.title")),1)]),x("div",wi,U(g(t)("settings.pages.themes.title")),1)])])),[[a]]),x("div",Ci,[V(g(ut),{"mt-4":"","w-full":"",default:!0},{trigger:T(u=>[x("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:p=>u.setVisible(!u.visible)},[x("div",Oi,[c[4]||(c[4]=x("div",{"i-solar:pallete-2-bold-duotone":"",class:"provider-icon size-6",transition:"filter duration-250 ease-in-out"},null,-1)),x("div",null,U(g(t)("settings.pages.themes.sections.section.custom-color.title")),1)]),x("div",{transform:"",transition:"transform duration-250",class:De({"rotate-180":u.visible})},c[5]||(c[5]=[x("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,Ai)]),default:T(()=>[x("div",Ei,[x("div",Di,U(g(t)("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),x("div",Pi,[Ve(x("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>g(o).themeColorsHue=u),type:"range",min:"0",max:"360",step:"0.01",class:De(["theme-hue-slider h-10 w-full",{"opacity-25 cursor-not-allowed":g(o).themeColorsHueDynamic}]),disabled:g(o).themeColorsHueDynamic},null,10,Ti),[[hn,g(o).themeColorsHue]]),c[6]||(c[6]=x("div",{"h-10":"","w-full":"",flex:"","overflow-hidden":"","rounded-lg":""},[x("div",{bg:"primary-50",class:"primary-color-bar","text-black":""}," 50 "),x("div",{bg:"primary-100",class:"primary-color-bar","text-black":""}," 100 "),x("div",{bg:"primary-200",class:"primary-color-bar","text-black":""}," 200 "),x("div",{bg:"primary-300",class:"primary-color-bar","text-black":""}," 300 "),x("div",{bg:"primary-400",class:"primary-color-bar","text-black":""}," 400 "),x("div",{bg:"primary-500",class:"primary-color-bar","text-black":""}," 500 "),x("div",{bg:"primary-600",class:"primary-color-bar","text-white":""}," 600 "),x("div",{bg:"primary-700",class:"primary-color-bar","text-white":""}," 700 "),x("div",{bg:"primary-800",class:"primary-color-bar","text-white":""}," 800 "),x("div",{bg:"primary-900",class:"primary-color-bar","text-white":""}," 900 "),x("div",{bg:"primary-950",class:"primary-color-bar","text-white":""}," 950 ")],-1)),c[7]||(c[7]=x("div",{"h-10":"","w-full":"",flex:"","overflow-hidden":"","rounded-lg":"",class:"transparency-grid"},[x("div",{bg:"primary-500/5",class:"primary-color-bar","text-black":""}," 500/5 "),x("div",{bg:"primary-500/10",class:"primary-color-bar","text-black":""}," 500/10 "),x("div",{bg:"primary-500/20",class:"primary-color-bar","text-black":""}," 500/20 "),x("div",{bg:"primary-500/30",class:"primary-color-bar","text-black":""}," 500/30 "),x("div",{bg:"primary-500/40",class:"primary-color-bar","text-black":""}," 500/40 "),x("div",{bg:"primary-500/50",class:"primary-color-bar","text-black":""}," 500/50 "),x("div",{bg:"primary-500/60",class:"primary-color-bar","text-black":""}," 500/60 "),x("div",{bg:"primary-500/70",class:"primary-color-bar","text-black":""}," 500/70 "),x("div",{bg:"primary-500/80",class:"primary-color-bar","text-black":""}," 500/80 "),x("div",{bg:"primary-500/90",class:"primary-color-bar","text-black":""}," 500/90 "),x("div",{bg:"primary-500",class:"primary-color-bar","text-black":""}," 500 ")],-1))]),x("div",_i,[x("label",ki,[Ve(x("input",{"onUpdate:modelValue":c[2]||(c[2]=u=>g(o).themeColorsHueDynamic=u),type:"checkbox",class:"peer sr-only"},null,512),[[gn,g(o).themeColorsHueDynamic]]),c[8]||(c[8]=x("div",{class:"peer-checked:bg-primary-500 h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),x("span",Bi,U(g(t)("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)]),x("button",{class:"rounded-md bg-neutral-100 px-3 py-1.5 text-sm transition-colors dark:bg-neutral-800 hover:bg-neutral-200 dark:hover:bg-neutral-700",onClick:r},U(g(t)("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.reset.label")),1)])])]),_:1}),V(g(ut),{"mt-4":"","w-full":"",default:!0},{trigger:T(u=>[x("button",{bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","rounded-lg":"","px-4":"","py-3":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:p=>u.setVisible(!u.visible)},[x("div",Si,[c[9]||(c[9]=x("div",{"i-solar:magic-stick-2-bold-duotone":"",class:"provider-icon size-6",transition:"filter duration-250 ease-in-out"},null,-1)),x("div",null,U(g(t)("settings.pages.themes.sections.section.theme-presets.title")),1)]),x("div",{transform:"",transition:"transform duration-250",class:De({"rotate-180":u.visible})},c[10]||(c[10]=[x("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,Ri)]),default:T(()=>[x("div",$i,[(k(!0),ue(ke,null,ct(i.value,u=>(k(),ue("div",{key:u.name,flex:"~ row",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250","cursor-pointer":"","items-center":"","justify-between":"","gap-4":"","rounded-lg":"","px-4":"","py-3":""},[x("div",null,[x("div",Li,U(u.name),1),x("div",Mi,U(u.description),1)]),x("div",Ni,[(k(!0),ue(ke,null,ct(u.colors,p=>(k(),H(g(ci),{key:p.hex},{default:T(()=>[V(g(di),null,{default:T(()=>[V(g(fi),null,{default:T(()=>[x("div",{style:Me({backgroundColor:p.hex}),class:De(["size-6 cursor-pointer rounded-full transition-all duration-250 ease-in-out",[l(p.hex)?"scale-150 z-10 mx-1":"hover:scale-110"]]),onClick:f=>s(p.hex)},null,14,Hi)]),_:2},1024),V(g(hi),null,{default:T(()=>[V(g(mi),{class:"rounded-lg bg-white px-3 py-1.5 text-sm shadow-md dark:bg-neutral-800"},{default:T(()=>[_t(U(p.name)+" ",1),V(g(vi),{class:"fill-white dark:fill-neutral-800"})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])]))),128))])]),_:1})]),c[11]||(c[11]=x("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[x("div",{text:"40","i-lucide:paintbrush":""})],-1))],64)}}});typeof ft=="function"&&ft(Fi);export{Fi as default}; diff --git a/assets/index-qbVWDvFi.js b/assets/index-qbVWDvFi.js deleted file mode 100644 index 8284490e13477e9f4db4c2ccab6f98f4807f49d8..0000000000000000000000000000000000000000 --- a/assets/index-qbVWDvFi.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as p,bE as x,s as y,bw as g,c as n,o as i,A as l,a as e,e as a,bx as c,by as v,x as b}from"./index-DfQ41DTF.js";import{u as k}from"./providers-CM7Pgz9x.js";import{I as _}from"./IconStatusItem-CFCfq1lX.js";import{b as d}from"./route-block-B_A1xBdJ.js";const w={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},B={grid:"~ cols-2 gap-4"},I=p({__name:"index",setup(S){const u=x(),m=k(),{allProvidersMetadata:f}=y(m);return(C,o)=>{const r=g("motion");return i(),n(c,null,[l((i(),n("div",w,[e("button",{onClick:o[0]||(o[0]=t=>a(u).back())},o[1]||(o[1]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),o[2]||(o[2]=e("h1",{relative:""},[e("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[e("span",{text:"neutral-300 dark:neutral-500"},"Settings")]),e("div",{"text-3xl":"","font-semibold":""}," Providers ")],-1))])),[[r]]),e("div",B,[(i(!0),n(c,null,v(a(f),(t,s)=>l((i(),b(a(_),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+s*10,delay:s*50,title:t.localizedName,description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),o[3]||(o[3]=e("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:brain":""})],-1))],64)}}});typeof d=="function"&&d(I);export{I as default}; diff --git a/assets/index-zsHiMu1v.js b/assets/index-zsHiMu1v.js new file mode 100644 index 0000000000000000000000000000000000000000..2f3b2cda2e29ffcd2fd096ba9151833f13c4616e --- /dev/null +++ b/assets/index-zsHiMu1v.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{I as f}from"./IconStatusItem-BS_oFW9i.js";import{d as y,bE as v,i as x,h,bw as _,c as r,o,A as d,a as t,e as n,D as l,bx as g,by as b,x as k}from"./index-Dn5R1iW2.js";import{b as m}from"./route-block-B_A1xBdJ.js";const I={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},w={relative:""},B={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},C={text:"neutral-300 dark:neutral-500"},D={"text-3xl":"","font-semibold":""},E={grid:"~ cols-1 sm:cols-2 gap-4"},L=y({__name:"index",setup(S){const p=v(),{t:e}=x(),u=h(()=>[{id:"consciousness",name:e("settings.pages.modules.consciousness.title"),description:e("settings.pages.modules.consciousness.description"),icon:"i-lucide:ghost",to:"/settings/modules/consciousness",configured:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-lucide:ear",to:"",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:"speech",name:e("settings.pages.modules.speech.title"),description:e("settings.pages.modules.speech.description"),icon:"i-lucide:mic",to:"/settings/modules/speech",configured:!1},{id:"memory-short-term",name:e("settings.pages.modules.memory-short-term.title"),description:e("settings.pages.modules.memory-short-term.description"),icon:"i-lucide:book",to:"",configured:!1},{id:"memory-long-term",name:e("settings.pages.modules.memory-long-term.title"),description:e("settings.pages.modules.memory-long-term.description"),icon:"i-lucide:book-copy",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-lucide:eye",to:"",configured:!1},{id:"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}]);return(A,s)=>{const a=_("motion");return o(),r(g,null,[d((o(),r("div",I,[t("button",{onClick:s[0]||(s[0]=i=>n(p).back())},s[1]||(s[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",w,[t("div",B,[t("span",C,l(n(e)("settings.title")),1)]),t("div",D,l(n(e)("settings.pages.modules.title")),1)])])),[[a]]),t("div",E,[(o(!0),r(g,null,b(u.value,(i,c)=>d((o(),k(n(f),{key:i.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+c*10,delay:c*50,title:i.name,description:i.description,icon:i.icon,"icon-color":i.iconColor,"icon-image":i.iconImage,to:i.to,configured:i.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),s[2]||(s[2]=t("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[t("div",{text:"40","i-lucide:blocks":""})],-1))],64)}}});typeof m=="function"&&m(L);export{L as default}; diff --git a/assets/messages-BKGdf620.js b/assets/messages-DrSN8YNT.js similarity index 79% rename from assets/messages-BKGdf620.js rename to assets/messages-DrSN8YNT.js index f5300b49ee94b5e8a7a280170636f21dc01f05fc..722ea176d1a5cfa3cc5acf8be14658dffaa87acb 100644 --- a/assets/messages-BKGdf620.js +++ b/assets/messages-DrSN8YNT.js @@ -1 +1 @@ -import{u as m,_ as g,l as _}from"./queues-CiZ1BAMa.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{u as v}from"./queue-Cg3xGvOu.js";import{d as b,g as t,c as l,o as u,a as e,b as x,e as k,D as c,bx as h,by as z}from"./index-DfQ41DTF.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},S={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},M={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},E=b({__name:"messages",setup(Q){const s=t(""),d=t([]),a=t(!1),f=v({handlers:[async i=>{d.value.push(i.data)}]}),r=m(f);async function p(){a.value=!0,r.add(s.value),r.add(_),s.value="",a.value=!1}return(i,n)=>(u(),l("div",w,[e("div",y,[x(k(g),{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=o=>s.value=o),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),e("button",S,c(a.value?"Processing...":"Send"),1)]),e("div",V,[e("div",M,[n[1]||(n[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(h,null,z(d.value,o=>(u(),l("div",{key:o},[e("div",null,c(o),1)]))),128))])])]))}});export{E as default}; +import{u as m,_ as g,l as _}from"./queues-CxsPIAz3.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{u as v}from"./queue-D3IvB2cI.js";import{d as b,g as t,c as l,o as u,a as e,b as x,e as k,D as c,bx as h,by as z}from"./index-Dn5R1iW2.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},S={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},M={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},E=b({__name:"messages",setup(Q){const s=t(""),d=t([]),a=t(!1),f=v({handlers:[async i=>{d.value.push(i.data)}]}),r=m(f);async function p(){a.value=!0,r.add(s.value),r.add(_),s.value="",a.value=!1}return(i,n)=>(u(),l("div",w,[e("div",y,[x(k(g),{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=o=>s.value=o),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),e("button",S,c(a.value?"Processing...":"Send"),1)]),e("div",V,[e("div",M,[n[1]||(n[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(h,null,z(d.value,o=>(u(),l("div",{key:o},[e("div",null,c(o),1)]))),128))])])]))}});export{E as default}; diff --git a/assets/mistral-ai-SRpzYQgW.js b/assets/mistral-ai-SRpzYQgW.js deleted file mode 100644 index 88dc04d7f19d21cb00afb930d6e7ed365af908bf..0000000000000000000000000000000000000000 --- a/assets/mistral-ai-SRpzYQgW.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as U,bE as V,s as y,h as v,m as $,w as g,x as k,o as K,y as d,b as i,e as t}from"./index-DfQ41DTF.js";import{u as h}from"./providers-CM7Pgz9x.js";import{_ as x,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as C,c as M}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const a="mistral-ai",j=U({__name:"mistral-ai",setup(N){const f=V(),m=h(),{providers:o}=y(m),u=v(()=>m.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,l;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((l=o.value[a])==null?void 0:l.baseUrl)||""}),g([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function _(){var e;o.value[a]={...(e=u.value)==null?void 0:e.defaultOptions}}return(e,l)=>{var p,c;return K(),k(t(M),{"provider-name":(p=u.value)==null?void 0:p.localizedName,"provider-icon-color":(c=u.value)==null?void 0:c.iconColor,"on-back":()=>t(f).back()},{default:d(()=>[i(t(B),null,{default:d(()=>[i(t(C),{title:"Basic",description:"Essential settings","on-reset":_},{default:d(()=>{var n;return[i(t(z),{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=b=>r.value=b),"provider-name":(n=u.value)==null?void 0:n.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1}),i(t(x),{title:"Advanced"},{default:d(()=>[i(t(w),{modelValue:s.value,"onUpdate:modelValue":l[1]||(l[1]=n=>s.value=n),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{j as default}; diff --git a/assets/mistral-ai-_14bZB0D.js b/assets/mistral-ai-_14bZB0D.js new file mode 100644 index 0000000000000000000000000000000000000000..f95b100610a037cb336f3a999a694641ae23481f --- /dev/null +++ b/assets/mistral-ai-_14bZB0D.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as U,i as V,bE as y,s as $,h as c,m as k,w as K,x as h,o as x,y as d,b as r,e as t}from"./index-Dn5R1iW2.js";import{u as w}from"./providers-Li1UUmJz.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as N,b as P,c as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const a="mistral-ai",D=U({__name:"mistral-ai",setup(S){const{t:m}=V(),_=y(),p=w(),{providers:o}=$(p),n=c(()=>p.getProviderMetadata(a)),i=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}}),l=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,s;p.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",l.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),K([i,l],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:l.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var v,f;return x(),h(t(R),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:d(()=>[r(t(N),null,{default:d(()=>[r(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:d(()=>{var u;return[r(t(M),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:d(()=>[r(t(C),{modelValue:l.value,"onUpdate:modelValue":s[1]||(s[1]=u=>l.value=u),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{D as default}; diff --git a/assets/moonshot-ai-B5aTPdZW.js b/assets/moonshot-ai-B5aTPdZW.js new file mode 100644 index 0000000000000000000000000000000000000000..6cb9ab49395f68f7e0453c87295e026c58466d72 --- /dev/null +++ b/assets/moonshot-ai-B5aTPdZW.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as h,i as U,bE as V,s as y,h as v,m as $,w as k,x as K,o as x,y as d,b as r,e as t}from"./index-Dn5R1iW2.js";import{u as w}from"./providers-Li1UUmJz.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as P,b as R,c as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const a="moonshot-ai",D=h({__name:"moonshot-ai",setup(B){const{t:m}=U(),_=V(),p=w(),{providers:o}=y(p),n=v(()=>p.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),l=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;p.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",l.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,l],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:l.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return x(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:d(()=>[r(t(P),null,{default:d(()=>[r(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:d(()=>{var u;return[r(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:d(()=>[r(t(M),{modelValue:l.value,"onUpdate:modelValue":s[1]||(s[1]=u=>l.value=u),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{D as default}; diff --git a/assets/moonshot-ai-CrS3VCmD.js b/assets/moonshot-ai-CrS3VCmD.js deleted file mode 100644 index 2a022ad1b3deac3a85a80440ece6e006c77081a5..0000000000000000000000000000000000000000 --- a/assets/moonshot-ai-CrS3VCmD.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as h,bE as U,s as V,h as v,m as y,w as $,x as g,o as k,y as d,b as i,e as l}from"./index-DfQ41DTF.js";import{u as K}from"./providers-CM7Pgz9x.js";import{_ as x,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as M,c as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const a="moonshot-ai",j=h({__name:"moonshot-ai",setup(P){const f=U(),m=K(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,t;m.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((t=o.value[a])==null?void 0:t.baseUrl)||""}),$([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function _(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var p,c;return k(),g(l(N),{"provider-name":(p=n.value)==null?void 0:p.localizedName,"provider-icon":(c=n.value)==null?void 0:c.icon,"on-back":()=>l(f).back()},{default:d(()=>[i(l(B),null,{default:d(()=>[i(l(M),{title:"Basic",description:"Essential settings","on-reset":_},{default:d(()=>{var u;return[i(l(z),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=b=>s.value=b),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1}),i(l(x),{title:"Advanced"},{default:d(()=>[i(l(w),{modelValue:r.value,"onUpdate:modelValue":t[1]||(t[1]=u=>r.value=u),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{j as default}; diff --git a/assets/novita-ai-AV_AAG7n.js b/assets/novita-ai-AV_AAG7n.js deleted file mode 100644 index 9090a10f72d8bf1039eadddeaa17aff40de01e0b..0000000000000000000000000000000000000000 --- a/assets/novita-ai-AV_AAG7n.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as U,bE as V,s as y,h as p,m as $,w as g,x as k,o as K,y as v,b as s,e as t}from"./index-DfQ41DTF.js";import{u as h}from"./providers-CM7Pgz9x.js";import{_ as x,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as C,c as M}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const a="novita-ai",j=U({__name:"novita-ai",setup(N){const f=V(),d=h(),{providers:o}=y(d),n=p(()=>d.getProviderMetadata(a)),r=p({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),i=p({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,l;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((l=o.value[a])==null?void 0:l.baseUrl)||""}),g([r,i],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:i.value||""}});function _(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,l)=>{var m,c;return K(),k(t(M),{"provider-name":(m=n.value)==null?void 0:m.localizedName,"provider-icon-color":(c=n.value)==null?void 0:c.iconColor,"on-back":()=>t(f).back()},{default:v(()=>[s(t(B),null,{default:v(()=>[s(t(C),{title:"Basic",description:"Essential settings","on-reset":_},{default:v(()=>{var u;return[s(t(z),{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=b=>r.value=b),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1}),s(t(x),{title:"Advanced"},{default:v(()=>[s(t(w),{modelValue:i.value,"onUpdate:modelValue":l[1]||(l[1]=u=>i.value=u),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{j as default}; diff --git a/assets/novita-ai-CaiWgCgu.js b/assets/novita-ai-CaiWgCgu.js new file mode 100644 index 0000000000000000000000000000000000000000..9b208db5230327d010c7b38565b313382f881cce --- /dev/null +++ b/assets/novita-ai-CaiWgCgu.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as U,i as V,bE as y,s as $,h as c,m as k,w as K,x as h,o as x,y as d,b as r,e as t}from"./index-Dn5R1iW2.js";import{u as w}from"./providers-Li1UUmJz.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as N,b as P,c as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const a="novita-ai",D=U({__name:"novita-ai",setup(S){const{t:v}=V(),_=y(),p=w(),{providers:o}=$(p),n=c(()=>p.getProviderMetadata(a)),s=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}}),l=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;p.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",l.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,l],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:l.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var m,f;return x(),h(t(R),{"provider-name":(m=n.value)==null?void 0:m.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:d(()=>[r(t(N),null,{default:d(()=>[r(t(P),{title:t(v)("settings.pages.providers.common.section.basic.title"),description:t(v)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:d(()=>{var u;return[r(t(M),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(z),{title:t(v)("settings.pages.providers.common.section.advanced.title")},{default:d(()=>[r(t(C),{modelValue:l.value,"onUpdate:modelValue":i[1]||(i[1]=u=>l.value=u),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{D as default}; diff --git a/assets/ollama-DlE099gn.js b/assets/ollama-DlE099gn.js deleted file mode 100644 index ca8718030720c8cfe2067169008573408e1876fd..0000000000000000000000000000000000000000 --- a/assets/ollama-DlE099gn.js +++ /dev/null @@ -1 +0,0 @@ -import{d as K,a as B,b as N,c as T}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import{d as P,bN as g,bO as U,c as V,o as y,b as i,g as w,w as C,bw as O,a as c,b_ as A,C as D,D as $,bx as R,by as S,A as z,bE as E,s as H,h as M,m as F,b$ as I,x as L,y as h,e as m}from"./index-DfQ41DTF.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{u as j}from"./providers-CM7Pgz9x.js";import{a as G,_ as J}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const Q={flex:"~ gap-2"},W=P({__name:"InputKeyValue",props:g({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(p){const v=p,o=U(p,"propertyKey"),t=U(p,"propertyValue");return(s,r)=>(y(),V("div",Q,[i(K,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=n=>o.value=n),placeholder:v.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),i(K,{modelValue:t.value,"onUpdate:modelValue":r[1]||(r[1]=n=>t.value=n),placeholder:v.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),X={"max-w-full":""},Y={flex:"~ col gap-2"},Z={class:"flex items-center gap-1 text-sm font-medium"},ee={key:0,class:"text-red-500"},le={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},ae={flex:"~ col gap-2"},te=["onClick"],oe=P({__name:"FieldKeyValues",props:g({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:g(["remove","add"],["update:modelValue"]),setup(p,{emit:v}){const o=p,t=v,s=U(p,"modelValue"),r=w(""),n=w("");return C([r,n],()=>{t("add",r.value,n.value)}),(f,b)=>{const x=O("auto-animate");return y(),V("div",X,[c("label",Y,[c("div",null,[c("div",Z,[A($(o.label)+" ",1),o.required!==!1?(y(),V("span",ee,"*")):D("",!0)]),c("div",le,$(o.description),1)]),c("div",ae,[(y(!0),V(R,null,S(s.value,(e,l)=>z((y(),V("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[i(W,{"property-key":e.key,"onUpdate:propertyKey":a=>e.key=a,"property-value":e.value,"onUpdate:propertyValue":a=>e.value=a,"key-placeholder":o.keyPlaceholder,"value-placeholder":o.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),c("button",{onClick:a=>t("remove",l)},b[0]||(b[0]=[c("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,te)])),[[x]])),128))])])])}}}),u="ollama",ce=P({__name:"ollama",setup(p){const v=E(),o=j(),{providers:t}=H(o),s=M(()=>o.getProviderMetadata(u)),r=M({get:()=>{var e,l,a;return((e=t.value[u])==null?void 0:e.baseUrl)||((a=(l=s.value)==null?void 0:l.defaultOptions)==null?void 0:a.baseUrl)||""},set:e=>{t.value[u]||(t.value[u]={}),t.value[u].baseUrl=e}});F(()=>{var e,l,a,_;o.initializeProvider(u),r.value=((e=t.value[u])==null?void 0:e.baseUrl)||((a=(l=s.value)==null?void 0:l.defaultOptions)==null?void 0:a.baseUrl)||"",(_=t.value[u])!=null&&_.headers||(t.value[u].headers={})});function n(){var e;t.value[u]={...(e=s.value)==null?void 0:e.defaultOptions}}const f=I([{key:"",value:""}]);function b(e,l,a){e&&e.push({key:l,value:a})}function x(e,l){l&&(l.length===1?(l[0].key="",l[0].value=""):l.splice(e,1))}return C(f,e=>{e.length>0&&(e[e.length-1].key!==""||e[e.length-1].value!=="")&&e.push({key:"",value:""})},{deep:!0,immediate:!0}),(e,l)=>{var a,_;return y(),L(m(T),{"provider-name":(a=s.value)==null?void 0:a.localizedName,"provider-icon":(_=s.value)==null?void 0:_.icon,"on-back":()=>m(v).back()},{default:h(()=>[i(m(B),null,{default:h(()=>[i(m(N),{title:"Basic",description:"Essential settings","on-reset":n},{default:h(()=>{var d,k;return[i(m(G),{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=q=>r.value=q),placeholder:((k=(d=s.value)==null?void 0:d.defaultOptions)==null?void 0:k.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1}),i(m(J),{title:"Advanced"},{default:h(()=>[i(m(oe),{modelValue:f,"onUpdate:modelValue":l[1]||(l[1]=d=>f=d),label:"HTTP Headers",description:"Add custom HTTP headers","key-placeholder":"Key","value-placeholder":"Value",onAdd:l[2]||(l[2]=(d,k)=>b(f,d,k)),onRemove:l[3]||(l[3]=d=>x(d,f))},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{ce as default}; diff --git a/assets/ollama-xNAKA6oF.js b/assets/ollama-xNAKA6oF.js new file mode 100644 index 0000000000000000000000000000000000000000..e75aababc7c982e5d6616e3a0fd8829963dd0267 --- /dev/null +++ b/assets/ollama-xNAKA6oF.js @@ -0,0 +1 @@ +import{d as P,a as B,b as O,c as D}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import{d as w,bN as x,bO as U,c as b,o as _,b as m,g as $,w as q,bw as R,a as f,b_ as S,C as z,D as M,bx as I,by as A,A as E,i as F,bE as T,s as L,h as C,m as j,b$ as G,x as H,y as V,e as t}from"./index-Dn5R1iW2.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{u as J}from"./providers-Li1UUmJz.js";import{a as Q,_ as W}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const X={flex:"~ gap-2"},Y=w({__name:"InputKeyValue",props:x({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(v){const o=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,a)=>(_(),b("div",X,[m(P,{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value=n),placeholder:o.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(P,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=n=>u.value=n),placeholder:o.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),Z={"max-w-full":""},ee={flex:"~ col gap-2"},le={class:"flex items-center gap-1 text-sm font-medium"},ae={key:0,class:"text-red-500"},te={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},oe={flex:"~ col gap-2"},re=["onClick"],se=w({__name:"FieldKeyValues",props:x({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:x(["remove","add"],["update:modelValue"]),setup(v,{emit:o}){const s=v,u=o,r=U(v,"modelValue"),a=$(""),n=$("");return q([a,n],()=>{u("add",a.value,n.value)}),(K,p)=>{const k=R("auto-animate");return _(),b("div",Z,[f("label",ee,[f("div",null,[f("div",le,[S(M(s.label)+" ",1),s.required!==!1?(_(),b("span",ae,"*")):z("",!0)]),f("div",te,M(s.description),1)]),f("div",oe,[(_(!0),b(I,null,A(r.value,(y,l)=>E((_(),b("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Y,{"property-key":y.key,"onUpdate:propertyKey":e=>y.key=e,"property-value":y.value,"onUpdate:propertyValue":e=>y.value=e,"key-placeholder":s.keyPlaceholder,"value-placeholder":s.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),f("button",{onClick:e=>u("remove",l)},p[0]||(p[0]=[f("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,re)])),[[k]])),128))])])])}}}),d="ollama",ve=w({__name:"ollama",setup(v){const{t:o}=F(),s=T(),u=J(),{providers:r}=L(u),a=C(()=>u.getProviderMetadata(d)),n=C({get:()=>{var l,e,i;return((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});j(()=>{var l,e,i,g;u.initializeProvider(d),n.value=((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||"",(g=r.value[d])!=null&&g.headers||(r.value[d].headers={})});function K(){var l;r.value[d]={...(l=a.value)==null?void 0:l.defaultOptions}}const p=G([{key:"",value:""}]);function k(l,e,i){l&&l.push({key:e,value:i})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return q(p,l=>{l.length>0&&(l[l.length-1].key!==""||l[l.length-1].value!=="")&&l.push({key:"",value:""})},{deep:!0,immediate:!0}),(l,e)=>{var i,g;return _(),H(t(D),{"provider-name":(i=a.value)==null?void 0:i.localizedName,"provider-icon":(g=a.value)==null?void 0:g.icon,"on-back":()=>t(s).back()},{default:V(()=>[m(t(B),null,{default:V(()=>[m(t(O),{title:t(o)("settings.pages.providers.common.section.basic.title"),description:t(o)("settings.pages.providers.common.section.basic.description"),"on-reset":K},{default:V(()=>{var c,h;return[m(t(Q),{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=N=>n.value=N),placeholder:((h=(c=a.value)==null?void 0:c.defaultOptions)==null?void 0:h.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(t(W),{title:t(o)("settings.pages.providers.common.section.advanced.title")},{default:V(()=>[m(t(se),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,h)=>k(p,c,h)),onRemove:e[3]||(e[3]=c=>y(c,p))},null,8,["modelValue","label","description","key-placeholder","value-placeholder"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{ve as default}; diff --git a/assets/openai-BrqL72CW.js b/assets/openai-BrqL72CW.js new file mode 100644 index 0000000000000000000000000000000000000000..64503106ed94f416d29ff0263e984377a7ebbfb1 --- /dev/null +++ b/assets/openai-BrqL72CW.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as h,i as U,bE as V,s as k,h as v,m as y,w as $,x as K,o as x,y as p,b as r,e as t}from"./index-Dn5R1iW2.js";import{u as I}from"./providers-Li1UUmJz.js";import{_ as w,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as R,b as S,c as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const e="openai",D=h({__name:"openai",setup(A){const{t:u}=U(),_=V(),c=I(),{providers:a}=k(c),m=v(()=>c.getProviderMetadata(e)),i=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),l=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,s;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),i.value=((o=a.value[e])==null?void 0:o.apiKey)||"",l.value=((s=a.value[e])==null?void 0:s.baseUrl)||"https://api.openai.com/v1/"}),$([i,l],()=>{a.value[e]={...a.value[e],apiKey:i.value,baseUrl:l.value||"https://api.openai.com/v1/"}});function b(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,s)=>{var d,f;return x(),K(t(z),{"provider-name":((d=m.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=m.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[r(t(R),null,{default:p(()=>[r(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[r(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":((n=m.value)==null?void 0:n.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(w),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[r(t(M),{modelValue:l.value,"onUpdate:modelValue":s[1]||(s[1]=n=>l.value=n),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{D as default}; diff --git a/assets/openai-D275seCU.js b/assets/openai-D275seCU.js deleted file mode 100644 index 7e2bc15a41c1eaa880ebfe023d21c333d1c9a471..0000000000000000000000000000000000000000 --- a/assets/openai-D275seCU.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as h,bE as U,s as V,h as v,m as k,w as y,x as $,o as g,y as p,b as r,e as l}from"./index-DfQ41DTF.js";import{u as K}from"./providers-CM7Pgz9x.js";import{_ as x,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as I,c as M}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const e="openai",j=h({__name:"openai",setup(N){const f=U(),m=K(),{providers:a}=V(m),u=v(()=>m.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}}),i=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});k(()=>{var o,t;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",i.value=((t=a.value[e])==null?void 0:t.baseUrl)||"https://api.openai.com/v1/"}),y([s,i],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:i.value||"https://api.openai.com/v1/"}});function _(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,t)=>{var d,c;return g(),$(l(M),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(c=u.value)==null?void 0:c.icon,"on-back":()=>l(f).back()},{default:p(()=>[r(l(B),null,{default:p(()=>[r(l(I),{title:"Basic",description:"Essential settings","on-reset":_},{default:p(()=>{var n;return[r(l(A),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=b=>s.value=b),"provider-name":((n=u.value)==null?void 0:n.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1}),r(l(x),{title:"Advanced"},{default:p(()=>[r(l(w),{modelValue:i.value,"onUpdate:modelValue":t[1]||(t[1]=n=>i.value=n),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{j as default}; diff --git a/assets/openrouter-ai-COzImo4T.js b/assets/openrouter-ai-COzImo4T.js deleted file mode 100644 index 4d2f35c0c25c04820a36631340c154d0ff2c2e7e..0000000000000000000000000000000000000000 --- a/assets/openrouter-ai-COzImo4T.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as V,bE as k,s as y,h as f,m as $,w as g,x as K,o as O,y as m,b as p,e as s}from"./index-DfQ41DTF.js";import{u as h}from"./providers-CM7Pgz9x.js";import{_ as x,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as M,c as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const a="openrouter-ai",q=V({__name:"openrouter-ai",setup(P){const _=k(),c=h(),{providers:l}=y(c),t=f(()=>c.getProviderMetadata(a)),i=f({get:()=>{var e;return((e=l.value[a])==null?void 0:e.apiKey)||""},set:e=>{l.value[a]||(l.value[a]={}),l.value[a].apiKey=e}}),u=f({get:()=>{var e,o,r;return((e=l.value[a])==null?void 0:e.baseUrl)||((r=(o=t.value)==null?void 0:o.defaultOptions)==null?void 0:r.baseUrl)||""},set:e=>{l.value[a]||(l.value[a]={}),l.value[a].baseUrl=e}});$(()=>{var e,o,r,n;c.initializeProvider(a),i.value=((e=l.value[a])==null?void 0:e.apiKey)||"",u.value=((o=l.value[a])==null?void 0:o.baseUrl)||((n=(r=t.value)==null?void 0:r.defaultOptions)==null?void 0:n.baseUrl)||""}),g([i,u],()=>{var e,o;l.value[a]={...l.value[a],apiKey:i.value,baseUrl:u.value||((o=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:o.baseUrl)||""}});function b(){var e;l.value[a]={...(e=t.value)==null?void 0:e.defaultOptions}}return(e,o)=>{var r,n;return O(),K(s(N),{"provider-name":(r=t.value)==null?void 0:r.localizedName,"provider-icon":(n=t.value)==null?void 0:n.icon,"on-back":()=>s(_).back()},{default:m(()=>[p(s(B),null,{default:m(()=>[p(s(M),{title:"Basic",description:"Essential settings","on-reset":b},{default:m(()=>{var d;return[p(s(z),{modelValue:i.value,"onUpdate:modelValue":o[0]||(o[0]=v=>i.value=v),"provider-name":(d=t.value)==null?void 0:d.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1}),p(s(x),{title:"Advanced"},{default:m(()=>{var d,v;return[p(s(w),{modelValue:u.value,"onUpdate:modelValue":o[1]||(o[1]=U=>u.value=U),placeholder:((v=(d=t.value)==null?void 0:d.defaultOptions)==null?void 0:v.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{q as default}; diff --git a/assets/openrouter-ai-DMddR8E3.js b/assets/openrouter-ai-DMddR8E3.js new file mode 100644 index 0000000000000000000000000000000000000000..8033c909adb8eacb4727dbe97d470cd0d8d9260b --- /dev/null +++ b/assets/openrouter-ai-DMddR8E3.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as V,i as k,bE as y,s as $,h as _,m as K,w as O,x as h,o as x,y as c,b as p,e as s}from"./index-Dn5R1iW2.js";import{u as w}from"./providers-Li1UUmJz.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as P,b as R,c as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const a="openrouter-ai",F=V({__name:"openrouter-ai",setup(B){const{t:m}=k(),b=y(),f=w(),{providers:o}=$(f),l=_(()=>f.getProviderMetadata(a)),i=_({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),n=_({get:()=>{var e,t,r;return((e=o.value[a])==null?void 0:e.baseUrl)||((r=(t=l.value)==null?void 0:t.defaultOptions)==null?void 0:r.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,t,r,u;f.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(r=l.value)==null?void 0:r.defaultOptions)==null?void 0:u.baseUrl)||""}),O([i,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:i.value,baseUrl:n.value||((t=(e=l.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function U(){var e;o.value[a]={...(e=l.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var r,u;return x(),h(s(S),{"provider-name":(r=l.value)==null?void 0:r.localizedName,"provider-icon":(u=l.value)==null?void 0:u.icon,"on-back":()=>s(b).back()},{default:c(()=>[p(s(P),null,{default:c(()=>[p(s(R),{title:s(m)("settings.pages.providers.common.section.basic.title"),description:s(m)("settings.pages.providers.common.section.basic.description"),"on-reset":U},{default:c(()=>{var d;return[p(s(N),{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=v=>i.value=v),"provider-name":(d=l.value)==null?void 0:d.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(s(z),{title:s(m)("settings.pages.providers.common.section.advanced.title")},{default:c(()=>{var d,v;return[p(s(M),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=g=>n.value=g),placeholder:((v=(d=l.value)==null?void 0:d.defaultOptions)==null?void 0:v.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{F as default}; diff --git a/assets/providers-CM7Pgz9x.js b/assets/providers-CM7Pgz9x.js deleted file mode 100644 index 11a78ab9236c9e7ff5167c4c52b23b82c4957f2d..0000000000000000000000000000000000000000 --- a/assets/providers-CM7Pgz9x.js +++ /dev/null @@ -1 +0,0 @@ -var Y=Object.defineProperty;var I=(r,i,t)=>i in r?Y(r,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[i]=t;var U=(r,i,t)=>I(r,typeof i!="symbol"?i+"":i,t);import{f as R,bL as ee,i as re,g as k,w as ie,h as O}from"./index-DfQ41DTF.js";var E=class extends Error{constructor(i,t){super(i);U(this,"response");this.name="XSAIError",this.response=t}},ae=r=>r.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`),x=r=>Object.fromEntries(Object.entries(r).map(([i,t])=>[ae(i),t])),D=r=>Object.fromEntries(Object.entries(r).filter(([,i])=>i!==void 0)),me=r=>JSON.stringify(x(D({...r,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),X=(r,i)=>D({Authorization:i!==void 0?`Bearer ${i}`:void 0,...r}),J=(r,i)=>{const t=i.toString();return new URL(r,t.endsWith("/")?t:`${t}/`)},te=async r=>{if(!r.ok){const i=new E(`Remote sent ${r.status} response`,r);throw i.cause=new Error(await r.text()),i}if(!r.body)throw new E("Response body is empty from remote server",r);if(!(r.body instanceof ReadableStream)){const i=new E(`Expected Response body to be a ReadableStream, but got ${String(r.body)}`,r);throw i.cause=new Error(`Content-Type is ${r.headers.get("Content-Type")}`),i}return r},V=async r=>te(r).then(async i=>i.json()),b=async r=>(r.fetch??globalThis.fetch)(J("models",r.baseURL),{headers:X({"Content-Type":"application/json",...r.headers},r.apiKey),signal:r.abortSignal}).then(V).then(({data:i})=>i),d=r=>({chat:i=>Object.assign(r,{model:i})}),w=r=>({embed:i=>Object.assign(r,{model:i})}),u=r=>({model:()=>r}),oe=r=>({speech:i=>Object.assign(r,{model:i})}),ne=r=>({transcription:i=>Object.assign(r,{model:i})}),c=(r,i)=>({metadata:{id:r,...i}}),s=(...r)=>Object.assign(r[0],...r.slice(1)),A=(r,i="https://api.deepseek.com/")=>s(c("deepseek"),d({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),B=(r,i="https://api.fireworks.ai/inference/v1/")=>s(c("fireworks"),d({apiKey:r,baseURL:i}),w({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),$=(r,i="https://api.mistral.ai/v1/")=>s(c("mistral"),d({apiKey:r,baseURL:i}),w({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),T=(r,i="https://api.moonshot.cn/v1/")=>s(c("moonshot"),d({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),z=(r,i="https://api.novita.ai/v3/openai/")=>s(c("novita"),d({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),F=(r,i="https://api.openai.com/v1/")=>s(c("openai"),d({apiKey:r,baseURL:i}),w({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i}),oe({apiKey:r,baseURL:i}),ne({apiKey:r,baseURL:i})),se=(r,i="")=>s(c("openrouter"),{chat:(t,o)=>{const h={apiKey:r,baseURL:i,model:t};return{...o?(({extraHeaders:p,models:f,provider:y})=>{p!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,p));let v;return y!=null&&(v=x(y)),x({models:f,provider:v})})(o):{},...h}}},u({apiKey:r,baseURL:i})),le=(r,i="https://api.perplexity.ai/")=>s(c("perplexity"),d({apiKey:r,baseURL:i})),N=(r,i="https://api.together.xyz/v1/")=>s(c("together-ai"),d({apiKey:r,baseURL:i}),w({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i,fetch:async(...t)=>globalThis.fetch(...t).then(async o=>o.json()).then(o=>Response.json({data:o,object:"list"}))})),ce=(r,i)=>{const t=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return s(c("workers-ai"),d({apiKey:r,baseURL:t}),w({apiKey:r,baseURL:t}))},q=(r,i="https://api.x.ai/v1/")=>s(c("xai"),d({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),C=(r="http://localhost:11434/v1/")=>s(c("ollama"),d({baseURL:r}),w({baseURL:r}),u({baseURL:r}));function W(r,i="http://localhost:5933/v1/"){const t=({applyTextNormalization:l,languageCode:p,nextRequestIds:f,nextText:y,previousRequestIds:v,previousText:K,pronunciationDictionaryLocators:g,seed:M,voiceSettings:P})=>({extraBody:x({applyTextNormalization:l,languageCode:p,nextRequestIds:f,nextText:y,previousRequestIds:v,previousText:K,pronunciationDictionaryLocators:g?g.map(S=>x(S)):void 0,seed:M,voiceSettings:P!=null?x(P):{similarityBoost:.75,stability:.5}})});return s({speech:(l,p)=>({...p?t(p):{},apiKey:r,baseURL:i,model:`elevenlabs/${l}`})},{voice:l=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...l?t(l):{},apiKey:r,baseURL:i})})}async function de(r){return(r.fetch??globalThis.fetch)(J(r.query?`api/voices?${r.query}`:"api/voices",r.baseURL),{headers:X({...r.headers},r.apiKey),method:"GET",signal:r.abortSignal}).then(V).then(({voices:i})=>i)}const ue=R("providers",()=>{const r=ee("settings/credentials/providers",{}),{t:i}=re();async function t(e){try{const a=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey}`,"Content-Type":"application/json"}});if(!a.ok)throw new Error(`Failed to fetch OpenRouter models: ${a.statusText}`);return(await a.json()).data.map(n=>({id:n.id,name:n.name||n.id,provider:"openrouter-ai",description:n.description||"",contextLength:n.context_length,deprecated:!1}))}catch(a){throw console.error("Error fetching OpenRouter models:",a),a}}const o={"openrouter-ai":{id:"openrouter-ai",nameKey:"providers.openrouter.name",name:"OpenRouter",descriptionKey:"providers.openrouter.description",description:"openrouter.ai",icon:"i-lobe-icons:openrouter",defaultOptions:{baseUrl:"https://openrouter.ai/api/v1/"},createProvider:e=>se(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>t(e)}},openai:{id:"openai",nameKey:"providers.openai.name",name:"OpenAI",descriptionKey:"providers.openai.description",description:"openai.com",icon:"i-lobe-icons:openai",defaultOptions:{baseUrl:"https://api.openai.com/v1/"},createProvider:e=>F(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await b({...F(e.apiKey,e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))}},ollama:{id:"ollama",nameKey:"providers.ollama.name",name:"Ollama",descriptionKey:"providers.ollama.description",description:"ollama.com",icon:"i-lobe-icons:ollama",defaultOptions:{baseUrl:"http://localhost:11434/api/"},createProvider:e=>C(e.baseUrl),capabilities:{listModels:async e=>(await b({...C(e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))}},vllm:{id:"vllm",nameKey:"providers.vllm.name",name:"vLLM",descriptionKey:"providers.vllm.description",description:"vllm.ai",iconColor:"i-lobe-icons:vllm-color",createProvider:e=>C(e.baseUrl),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}]}},"perplexity-ai":{id:"perplexity-ai",nameKey:"providers.perplexity.name",name:"Perplexity",descriptionKey:"providers.perplexity.description",description:"perplexity.ai",icon:"i-lobe-icons:perplexity",defaultOptions:{baseUrl:"https://api.perplexity.ai"},createProvider:e=>le(e.apiKey,e.baseUrl),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}]}},elevenlabs:{id:"elevenlabs",nameKey:"providers.elevenlabs.name",name:"ElevenLabs",descriptionKey:"providers.elevenlabs.description",description:"elevenlabs.io",icon:"i-simple-icons:elevenlabs",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/",voiceSettings:{similarityBoost:.75,stability:.5}},createProvider:e=>W(e.apiKey,e.baseUrl),capabilities:{listModels:async()=>[],listVoices:async e=>{const a=W(e.apiKey,e.baseUrl);return(await de({...a.voice()})).map(n=>({id:n.id,name:n.name,provider:"elevenlabs"}))}}},xai:{id:"xai",nameKey:"providers.xai.name",name:"xAI",descriptionKey:"providers.xai.description",description:"x.ai",icon:"i-lobe-icons:xai",createProvider:e=>q(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await b({...q(e.apiKey,e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))}},deepseek:{id:"deepseek",nameKey:"providers.deepseek.name",name:"DeepSeek",descriptionKey:"providers.deepseek.description",description:"deepseek.com",iconColor:"i-lobe-icons:deepseek-color",createProvider:e=>A(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await b({...A(e.apiKey,e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))}},"together-ai":{id:"together-ai",nameKey:"providers.together.name",name:"Together.ai",descriptionKey:"providers.together.description",description:"together.ai",iconColor:"i-lobe-icons:together-color",createProvider:e=>N(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await b({...N(e.apiKey,e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))}},"novita-ai":{id:"novita-ai",nameKey:"providers.novita.name",name:"Novita",descriptionKey:"providers.novita.description",description:"novita.ai",iconColor:"i-lobe-icons:novita-color",createProvider:e=>z(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await b({...z(e.apiKey,e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))}},"fireworks-ai":{id:"fireworks-ai",nameKey:"providers.fireworks.name",name:"Fireworks.ai",descriptionKey:"providers.fireworks.description",description:"fireworks.ai",icon:"i-lobe-icons:fireworks",createProvider:e=>B(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await b({...B(e.apiKey,e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",nameKey:"providers.cloudflare.name",name:"Cloudflare Workers AI",descriptionKey:"providers.cloudflare.description",description:"cloudflare.com",iconColor:"i-lobe-icons:cloudflare-color",createProvider:e=>ce(e.apiKey,e.accountId),capabilities:{listModels:async()=>[]}},"mistral-ai":{id:"mistral-ai",nameKey:"providers.mistral.name",name:"Mistral",descriptionKey:"providers.mistral.description",description:"mistral.ai",iconColor:"i-lobe-icons:mistral-color",createProvider:e=>$(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await b({...$(e.apiKey,e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))}},"moonshot-ai":{id:"moonshot-ai",nameKey:"providers.moonshot.name",name:"Moonshot AI",descriptionKey:"providers.moonshot.description",description:"moonshot.ai",icon:"i-lobe-icons:moonshot",createProvider:e=>T(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await b({...T(e.apiKey,e.baseUrl).model()})).map(a=>({id:a.id,name:a.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))}}};function h(e){const a=r.value[e];if(!a)return!1;switch(e){case"openrouter-ai":return!!a.apiKey&&!!a.baseUrl;case"openai":return!!a.apiKey;case"ollama":return!!a.baseUrl;case"vllm":return!!a.baseUrl;case"elevenlabs":return!!a.apiKey;case"xai":return!!a.apiKey;case"deepseek":return!!a.apiKey;case"together-ai":return!!a.apiKey;case"novita-ai":return!!a.apiKey;case"fireworks-ai":return!!a.apiKey;case"cloudflare-workers-ai":return!!a.apiKey;case"mistral-ai":return!!a.apiKey;case"moonshot-ai":return!!a.apiKey;default:return!1}}const l=k({});function p(e){var a;if(!r.value[e]){const m=o[e];r.value[e]={baseUrl:((a=m.defaultOptions)==null?void 0:a.baseUrl)||""}}}Object.keys(o).forEach(p);function f(){Object.keys(o).forEach(e=>{l.value[e]=h(e)})}f(),ie(r,f,{deep:!0});const y=O(()=>Object.keys(o).filter(e=>l.value[e])),v=k({}),K=k({}),g=k({});async function M(e){const a=r.value[e];if(!a)return[];const m=o[e];if(!m)return[];K.value[e]=!0,g.value[e]=null;try{const n=m.capabilities.listModels?await m.capabilities.listModels(a):[];return v.value[e]=n.map(L=>({id:L.id,name:L.id,provider:e})),v.value[e]}catch(n){return console.error(`Error fetching models for ${e}:`,n),g.value[e]=n instanceof Error?n.message:"Unknown error",[]}finally{K.value[e]=!1}}function P(e){return v.value[e]||[]}const S=O(()=>{const e=[];for(const a of y.value)e.push(...v.value[a]||[]);return e});async function _(){for(const e of y.value)o[e].capabilities.listModels&&await M(e)}function j(e){const a=o[e];if(!a)throw new Error(`Provider metadata for ${e} not found`);return{...a,localizedName:i(a.nameKey,a.name),localizedDescription:i(a.descriptionKey,a.description)}}const G=O(()=>Object.values(o).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:l.value[e.id]||!1})));function Z(e){const a=r.value[e];if(!a)throw new Error(`Provider credentials for ${e} not found`);const m=o[e];if(!m)throw new Error(`Provider metadata for ${e} not found`);try{return m.createProvider(a)}catch(n){throw console.error(`Error creating provider instance for ${e}:`,n),n}}const H=O(()=>y.value.map(e=>j(e)));function Q(e){return r.value[e]}return{providers:r,getProviderConfig:Q,availableProviders:y,configuredProviders:l,providerMetadata:o,getProviderMetadata:j,allProvidersMetadata:G,initializeProvider:p,validateProvider:h,availableModels:v,isLoadingModels:K,modelLoadError:g,fetchModelsForProvider:M,getModelsForProvider:P,allAvailableModels:S,loadModelsForConfiguredProviders:_,getProviderInstance:Z,availableProvidersMetadata:H}});export{X as a,me as b,te as c,b as l,J as r,ue as u}; diff --git a/assets/providers-Li1UUmJz.js b/assets/providers-Li1UUmJz.js new file mode 100644 index 0000000000000000000000000000000000000000..f9e6566cf0ddb323262005034fd398e6cc618e3b --- /dev/null +++ b/assets/providers-Li1UUmJz.js @@ -0,0 +1 @@ +var Y=Object.defineProperty;var I=(r,i,a)=>i in r?Y(r,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[i]=a;var U=(r,i,a)=>I(r,typeof i!="symbol"?i+"":i,a);import{f as R,bL as ee,i as re,g as k,w as ie,h as O}from"./index-Dn5R1iW2.js";var E=class extends Error{constructor(i,a){super(i);U(this,"response");this.name="XSAIError",this.response=a}},te=r=>r.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`),w=r=>Object.fromEntries(Object.entries(r).map(([i,a])=>[te(i),a])),D=r=>Object.fromEntries(Object.entries(r).filter(([,i])=>i!==void 0)),me=r=>JSON.stringify(w(D({...r,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),X=(r,i)=>D({Authorization:i!==void 0?`Bearer ${i}`:void 0,...r}),J=(r,i)=>{const a=i.toString();return new URL(r,a.endsWith("/")?a:`${a}/`)},ae=async r=>{if(!r.ok){const i=new E(`Remote sent ${r.status} response`,r);throw i.cause=new Error(await r.text()),i}if(!r.body)throw new E("Response body is empty from remote server",r);if(!(r.body instanceof ReadableStream)){const i=new E(`Expected Response body to be a ReadableStream, but got ${String(r.body)}`,r);throw i.cause=new Error(`Content-Type is ${r.headers.get("Content-Type")}`),i}return r},V=async r=>ae(r).then(async i=>i.json()),g=async r=>(r.fetch??globalThis.fetch)(J("models",r.baseURL),{headers:X({"Content-Type":"application/json",...r.headers},r.apiKey),signal:r.abortSignal}).then(V).then(({data:i})=>i),c=r=>({chat:i=>Object.assign(r,{model:i})}),x=r=>({embed:i=>Object.assign(r,{model:i})}),u=r=>({model:()=>r}),oe=r=>({speech:i=>Object.assign(r,{model:i})}),se=r=>({transcription:i=>Object.assign(r,{model:i})}),d=(r,i)=>({metadata:{id:r,...i}}),n=(...r)=>Object.assign(r[0],...r.slice(1)),A=(r,i="https://api.deepseek.com/")=>n(d("deepseek"),c({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),B=(r,i="https://api.fireworks.ai/inference/v1/")=>n(d("fireworks"),c({apiKey:r,baseURL:i}),x({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),$=(r,i="https://api.mistral.ai/v1/")=>n(d("mistral"),c({apiKey:r,baseURL:i}),x({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),T=(r,i="https://api.moonshot.cn/v1/")=>n(d("moonshot"),c({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),z=(r,i="https://api.novita.ai/v3/openai/")=>n(d("novita"),c({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),F=(r,i="https://api.openai.com/v1/")=>n(d("openai"),c({apiKey:r,baseURL:i}),x({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i}),oe({apiKey:r,baseURL:i}),se({apiKey:r,baseURL:i})),ne=(r,i="")=>n(d("openrouter"),{chat:(a,o)=>{const h={apiKey:r,baseURL:i,model:a};return{...o?(({extraHeaders:p,models:b,provider:y})=>{p!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,p));let v;return y!=null&&(v=w(y)),w({models:b,provider:v})})(o):{},...h}}},u({apiKey:r,baseURL:i})),le=(r,i="https://api.perplexity.ai/")=>n(d("perplexity"),c({apiKey:r,baseURL:i})),N=(r,i="https://api.together.xyz/v1/")=>n(d("together-ai"),c({apiKey:r,baseURL:i}),x({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i,fetch:async(...a)=>globalThis.fetch(...a).then(async o=>o.json()).then(o=>Response.json({data:o,object:"list"}))})),de=(r,i)=>{const a=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return n(d("workers-ai"),c({apiKey:r,baseURL:a}),x({apiKey:r,baseURL:a}))},q=(r,i="https://api.x.ai/v1/")=>n(d("xai"),c({apiKey:r,baseURL:i}),u({apiKey:r,baseURL:i})),C=(r="http://localhost:11434/v1/")=>n(d("ollama"),c({baseURL:r}),x({baseURL:r}),u({baseURL:r}));function W(r,i="http://localhost:5933/v1/"){const a=({applyTextNormalization:l,languageCode:p,nextRequestIds:b,nextText:y,previousRequestIds:v,previousText:K,pronunciationDictionaryLocators:f,seed:M,voiceSettings:P})=>({extraBody:w({applyTextNormalization:l,languageCode:p,nextRequestIds:b,nextText:y,previousRequestIds:v,previousText:K,pronunciationDictionaryLocators:f?f.map(S=>w(S)):void 0,seed:M,voiceSettings:P!=null?w(P):{similarityBoost:.75,stability:.5}})});return n({speech:(l,p)=>({...p?a(p):{},apiKey:r,baseURL:i,model:`elevenlabs/${l}`})},{voice:l=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...l?a(l):{},apiKey:r,baseURL:i})})}async function ce(r){return(r.fetch??globalThis.fetch)(J(r.query?`api/voices?${r.query}`:"api/voices",r.baseURL),{headers:X({...r.headers},r.apiKey),method:"GET",signal:r.abortSignal}).then(V).then(({voices:i})=>i)}const ue=R("providers",()=>{const r=ee("settings/credentials/providers",{}),{t:i}=re();async function a(e){try{const t=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`Failed to fetch OpenRouter models: ${t.statusText}`);return(await t.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(t){throw console.error("Error fetching OpenRouter models:",t),t}}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=>ne(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>a(e)}},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=>F(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await g({...F(e.apiKey,e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))}},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/api/"},createProvider:e=>C(e.baseUrl),capabilities:{listModels:async e=>(await g({...C(e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))}},vllm:{id:"vllm",nameKey:"settings.pages.providers.provider.vllm.title",name:"vLLM",descriptionKey:"settings.pages.providers.provider.vllm.description",description:"vllm.ai",iconColor:"i-lobe-icons:vllm-color",createProvider:e=>C(e.baseUrl),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}]}},"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=>le(e.apiKey,e.baseUrl),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}]}},elevenlabs:{id:"elevenlabs",nameKey:"settings.pages.providers.provider.elevenlabs.title",name:"ElevenLabs",descriptionKey:"settings.pages.providers.provider.elevenlabs.description",description:"elevenlabs.io",icon:"i-simple-icons:elevenlabs",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/",voiceSettings:{similarityBoost:.75,stability:.5}},createProvider:e=>W(e.apiKey,e.baseUrl),capabilities:{listModels:async()=>[],listVoices:async e=>{const t=W(e.apiKey,e.baseUrl);return(await ce({...t.voice()})).map(s=>({id:s.id,name:s.name,provider:"elevenlabs"}))}}},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=>q(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await g({...q(e.apiKey,e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))}},deepseek:{id:"deepseek",nameKey:"settings.pages.providers.provider.deepseek.title",name:"DeepSeek",descriptionKey:"settings.pages.providers.provider.deepseek.description",description:"deepseek.com",iconColor:"i-lobe-icons:deepseek-color",createProvider:e=>A(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await g({...A(e.apiKey,e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))}},"together-ai":{id:"together-ai",nameKey:"settings.pages.providers.provider.together.title",name:"Together.ai",descriptionKey:"settings.pages.providers.provider.together.description",description:"together.ai",iconColor:"i-lobe-icons:together-color",createProvider:e=>N(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await g({...N(e.apiKey,e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))}},"novita-ai":{id:"novita-ai",nameKey:"settings.pages.providers.provider.novita.title",name:"Novita",descriptionKey:"settings.pages.providers.provider.novita.description",description:"novita.ai",iconColor:"i-lobe-icons:novita-color",createProvider:e=>z(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await g({...z(e.apiKey,e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))}},"fireworks-ai":{id:"fireworks-ai",nameKey:"settings.pages.providers.provider.fireworks.title",name:"Fireworks.ai",descriptionKey:"settings.pages.providers.provider.fireworks.description",description:"fireworks.ai",icon:"i-lobe-icons:fireworks",createProvider:e=>B(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await g({...B(e.apiKey,e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",nameKey:"settings.pages.providers.provider.cloudflare-workers-ai.title",name:"Cloudflare Workers AI",descriptionKey:"settings.pages.providers.provider.cloudflare-workers-ai.description",description:"cloudflare.com",iconColor:"i-lobe-icons:cloudflare-color",createProvider:e=>de(e.apiKey,e.accountId),capabilities:{listModels:async()=>[]}},"mistral-ai":{id:"mistral-ai",nameKey:"settings.pages.providers.provider.mistral.title",name:"Mistral",descriptionKey:"settings.pages.providers.provider.mistral.description",description:"mistral.ai",iconColor:"i-lobe-icons:mistral-color",createProvider:e=>$(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await g({...$(e.apiKey,e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))}},"moonshot-ai":{id:"moonshot-ai",nameKey:"settings.pages.providers.provider.moonshot.title",name:"Moonshot AI",descriptionKey:"settings.pages.providers.provider.moonshot.description",description:"moonshot.ai",icon:"i-lobe-icons:moonshot",createProvider:e=>T(e.apiKey,e.baseUrl),capabilities:{listModels:async e=>(await g({...T(e.apiKey,e.baseUrl).model()})).map(t=>({id:t.id,name:t.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))}}};function h(e){const t=r.value[e];if(!t)return!1;switch(e){case"openrouter-ai":return!!t.apiKey&&!!t.baseUrl;case"openai":return!!t.apiKey;case"ollama":return!!t.baseUrl;case"vllm":return!!t.baseUrl;case"elevenlabs":return!!t.apiKey;case"xai":return!!t.apiKey;case"deepseek":return!!t.apiKey;case"together-ai":return!!t.apiKey;case"novita-ai":return!!t.apiKey;case"fireworks-ai":return!!t.apiKey;case"cloudflare-workers-ai":return!!t.apiKey;case"mistral-ai":return!!t.apiKey;case"moonshot-ai":return!!t.apiKey;default:return!1}}const l=k({});function p(e){var t;if(!r.value[e]){const m=o[e];r.value[e]={baseUrl:((t=m.defaultOptions)==null?void 0:t.baseUrl)||""}}}Object.keys(o).forEach(p);function b(){Object.keys(o).forEach(e=>{l.value[e]=h(e)})}b(),ie(r,b,{deep:!0});const y=O(()=>Object.keys(o).filter(e=>l.value[e])),v=k({}),K=k({}),f=k({});async function M(e){const t=r.value[e];if(!t)return[];const m=o[e];if(!m)return[];K.value[e]=!0,f.value[e]=null;try{const s=m.capabilities.listModels?await m.capabilities.listModels(t):[];return v.value[e]=s.map(L=>({id:L.id,name:L.id,provider:e})),v.value[e]}catch(s){return console.error(`Error fetching models for ${e}:`,s),f.value[e]=s instanceof Error?s.message:"Unknown error",[]}finally{K.value[e]=!1}}function P(e){return v.value[e]||[]}const S=O(()=>{const e=[];for(const t of y.value)e.push(...v.value[t]||[]);return e});async function _(){for(const e of y.value)o[e].capabilities.listModels&&await M(e)}function j(e){const t=o[e];if(!t)throw new Error(`Provider metadata for ${e} not found`);return{...t,localizedName:i(t.nameKey,t.name),localizedDescription:i(t.descriptionKey,t.description)}}const G=O(()=>Object.values(o).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:l.value[e.id]||!1})));function Z(e){const t=r.value[e];if(!t)throw new Error(`Provider credentials for ${e} not found`);const m=o[e];if(!m)throw new Error(`Provider metadata for ${e} not found`);try{return m.createProvider(t)}catch(s){throw console.error(`Error creating provider instance for ${e}:`,s),s}}const H=O(()=>y.value.map(e=>j(e)));function Q(e){return r.value[e]}return{providers:r,getProviderConfig:Q,availableProviders:y,configuredProviders:l,providerMetadata:o,getProviderMetadata:j,allProvidersMetadata:G,initializeProvider:p,validateProvider:h,availableModels:v,isLoadingModels:K,modelLoadError:f,fetchModelsForProvider:M,getModelsForProvider:P,allAvailableModels:S,loadModelsForConfiguredProviders:_,getProviderInstance:Z,availableProvidersMetadata:H}});export{X as a,me as b,ae as c,g as l,J as r,ue as u}; diff --git a/assets/queue-DhMvrul4.js b/assets/queue-CQa4vtwo.js similarity index 90% rename from assets/queue-DhMvrul4.js rename to assets/queue-CQa4vtwo.js index 7b807d6e92ac67053af3cc106242cdd32011b605..c55bfaa34858ee3d08cb9f64c3672e51bf039987 100644 --- a/assets/queue-DhMvrul4.js +++ b/assets/queue-CQa4vtwo.js @@ -1 +1 @@ -import{u as o}from"./queue-Cg3xGvOu.js";import{d as v,g as h,m as g,c as k,o as w,a as I}from"./index-DfQ41DTF.js";const Q=v({__name:"queue",setup(P){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),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 g(()=>{m()}),(e,a)=>(w(),k("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; +import{u as o}from"./queue-D3IvB2cI.js";import{d as v,g as h,m as g,c as k,o as w,a as I}from"./index-Dn5R1iW2.js";const Q=v({__name:"queue",setup(P){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),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 g(()=>{m()}),(e,a)=>(w(),k("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; diff --git a/assets/queue-Cg3xGvOu.js b/assets/queue-D3IvB2cI.js similarity index 91% rename from assets/queue-Cg3xGvOu.js rename to assets/queue-D3IvB2cI.js index d37fa34708129c0535d029313def066958e2a1e6..81319dd6f641dd782eeb92a7351d4eb9089b113e 100644 --- a/assets/queue-Cg3xGvOu.js +++ b/assets/queue-D3IvB2cI.js @@ -1 +1 @@ -import{g as l}from"./index-DfQ41DTF.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function g(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=g();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; +import{g as l}from"./index-Dn5R1iW2.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function g(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=g();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; diff --git a/assets/queues-CiZ1BAMa.js b/assets/queues-CxsPIAz3.js similarity index 89% rename from assets/queues-CiZ1BAMa.js rename to assets/queues-CxsPIAz3.js index 5ec18fb3248ef34e71c19f8a6e66d4ad6f13f133..e6e36fd1039d78c08a024222820b69e9056cba7e 100644 --- a/assets/queues-CiZ1BAMa.js +++ b/assets/queues-CxsPIAz3.js @@ -1 +1 @@ -import{d as m,bN as p,bO as v,g as u,w as y,A as k,bH as w,o as b,c as h,n as E}from"./index-DfQ41DTF.js";import{E as f}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{u as l}from"./queue-Cg3xGvOu.js";const D=m({__name:"BasicTextarea",props:{modelValue:{default:""},modelModifiers:{}},emits:p(["submit"],["update:modelValue"]),setup(o,{emit:n}){const e=n,t=v(o,"modelValue"),a=u(),s=u("auto");function i(r){r.code==="Enter"&&!r.shiftKey&&(r.preventDefault(),e("submit",t.value))}return y(t,()=>{s.value="auto",requestAnimationFrame(()=>{a.value&&(s.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(r,d)=>k((b(),h("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":d[0]||(d[0]=c=>t.value=c),style:E({height:s.value}),onKeydown:i},null,36)),[[w,t.value]])}}),M="<|llm_inference_end|>";function N(o){function n(e){for(const t of f)if(e.includes(t))return{ok:!0,emotion:t};return{ok:!1,emotion:""}}return l({handlers:[async e=>{if(f.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:t,emotion:a}=n(e.data);t&&(e.emit("emotion",a),await o.add(a))}}]})}function A(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const t=/<\|DELAY:(\d+)\|>/i.exec(e),a=t==null?void 0:t[1];if(!a)return{ok:!1,delay:0};const s=Number.parseFloat(a);return s<=0||Number.isNaN(s)?{ok:!0,delay:0}:{ok:!0,delay:s}}function n(e){return new Promise(t=>setTimeout(t,e))}return l({handlers:[async e=>{const{ok:t,delay:a}=o(e.data);t&&(e.emit("delay",a),await n(a*1e3))}]})}function T(o){const n=u("");return l({handlers:[async e=>{if(e.data===M){const a=n.value.trim();a&&await o.add(a),n.value="";return}const t=/[.?!]/;for(n.value+=e.data;n.value;){const a=t.exec(n.value);if(!a||typeof a.index>"u")break;const s=n.value.slice(0,a.index+1),i=n.value.slice(a.index+1);await o.add(s),n.value=i}}]})}export{D as _,N as a,A as b,M as l,T as u}; +import{d as m,bN as p,bO as v,g as u,w as y,A as k,bH as w,o as b,c as h,n as E}from"./index-Dn5R1iW2.js";import{E as f}from"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{u as l}from"./queue-D3IvB2cI.js";const D=m({__name:"BasicTextarea",props:{modelValue:{default:""},modelModifiers:{}},emits:p(["submit"],["update:modelValue"]),setup(o,{emit:n}){const e=n,t=v(o,"modelValue"),a=u(),s=u("auto");function i(r){r.code==="Enter"&&!r.shiftKey&&(r.preventDefault(),e("submit",t.value))}return y(t,()=>{s.value="auto",requestAnimationFrame(()=>{a.value&&(s.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(r,d)=>k((b(),h("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":d[0]||(d[0]=c=>t.value=c),style:E({height:s.value}),onKeydown:i},null,36)),[[w,t.value]])}}),M="<|llm_inference_end|>";function N(o){function n(e){for(const t of f)if(e.includes(t))return{ok:!0,emotion:t};return{ok:!1,emotion:""}}return l({handlers:[async e=>{if(f.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:t,emotion:a}=n(e.data);t&&(e.emit("emotion",a),await o.add(a))}}]})}function A(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const t=/<\|DELAY:(\d+)\|>/i.exec(e),a=t==null?void 0:t[1];if(!a)return{ok:!1,delay:0};const s=Number.parseFloat(a);return s<=0||Number.isNaN(s)?{ok:!0,delay:0}:{ok:!0,delay:s}}function n(e){return new Promise(t=>setTimeout(t,e))}return l({handlers:[async e=>{const{ok:t,delay:a}=o(e.data);t&&(e.emit("delay",a),await n(a*1e3))}]})}function T(o){const n=u("");return l({handlers:[async e=>{if(e.data===M){const a=n.value.trim();a&&await o.add(a),n.value="";return}const t=/[.?!]/;for(n.value+=e.data;n.value;){const a=t.exec(n.value);if(!a||typeof a.index>"u")break;const s=n.value.slice(0,a.index+1),i=n.value.slice(a.index+1);await o.add(s),n.value=i}}]})}export{D as _,N as a,A as b,M as l,T as u}; diff --git a/assets/speech-BwbRihXF.js b/assets/speech-BwbRihXF.js new file mode 100644 index 0000000000000000000000000000000000000000..176ad58f9885d078520cc3fdefe6a0554f6a3108 --- /dev/null +++ b/assets/speech-BwbRihXF.js @@ -0,0 +1,13 @@ +import{d as q,i as Q,s as L,bE as J,g as U,m as Y,bw as G,c as a,o as s,A as g,a as e,e as l,D as v,C as p,bx as N,by as K,b as f,y as O,bo as W,ad as i,bI as P,B as R,z as $,bH as X,x as Z}from"./index-Dn5R1iW2.js";import{R as w}from"./Range-CI9YqvjT.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{_ as ee,R as te}from"./RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CTuHNiqF.js";import{u as le}from"./providers-Li1UUmJz.js";import{u as oe}from"./speech-Ci8yfKRf.js";import{b as A}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const se={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},ae={relative:""},ne={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},re={text:"neutral-300 dark:neutral-500"},ie={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},de={flex:"~ col gap-4"},ue={"max-w-full":""},me={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},pe={key:1},ve={key:0},ce={flex:"~ col gap-4"},be={key:0,class:"flex items-center justify-center py-4"},xe={key:1,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"},ge={class:"flex flex-col"},fe={class:"text-sm text-red-600 dark:text-red-400"},ke={key:2,class:"space-y-6"},ye={key:0},we={class:"grid grid-cols-1 gap-4 md:grid-cols-2"},he={class:"flex items-center gap-3"},Se={class:"w-12 text-center"},Ve={class:"flex items-center gap-3"},_e={class:"w-12 text-center"},Me={key:1,class:"border border-2 border-neutral-200 rounded-lg p-4 dark:border-neutral-700"},Ce={class:"mb-3 flex items-center justify-between"},Ee={class:"relative mr-2 inline-block w-10 select-none align-middle"},Le={for:"ssml-toggle",class:"block h-6 cursor-pointer overflow-hidden rounded-full bg-neutral-300 dark:bg-neutral-700"},Ue={key:0,class:"mt-3"},Ne={class:"overflow-auto rounded bg-neutral-50 p-3 text-xs dark:bg-neutral-800"},Pe={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"},Re={key:4,class:"mt-2 space-y-6"},$e={key:0},Ae={class:"grid grid-cols-1 gap-4 md:grid-cols-2"},De={class:"flex items-center gap-3"},Ie={class:"w-12 text-center"},ze={class:"flex items-center gap-3"},je={class:"w-12 text-center"},Be={key:1,class:"border border-2 border-neutral-200 rounded-lg p-4 dark:border-neutral-700"},Fe={class:"mb-3 flex items-center justify-between"},He={class:"relative mr-2 inline-block w-10 select-none align-middle"},Te={for:"ssml-toggle",class:"block h-6 cursor-pointer overflow-hidden rounded-full bg-neutral-300 dark:bg-neutral-700"},qe={key:0,class:"mt-3"},Qe={class:"overflow-auto rounded bg-neutral-50 p-3 text-xs dark:bg-neutral-800"},Je=q({__name:"speech",setup(Ye){const{t:D}=Q(),I=le(),S=oe(),{availableProviders:z,availableProvidersMetadata:j}=L(I),{activeSpeechProvider:n,activeSpeechModel:b,voiceId:d,pitch:u,rate:m,isLoadingSpeechProviderVoices:V,speechProviderError:_,supportsSSML:M,ssmlEnabled:r,availableVoices:c}=L(S),B=J(),h=U(` + Hello, my name is + + AI Assistant + + +`),C=U("");Y(async()=>{await S.loadVoicesForProvider(n.value)});function F(k){d.value=k,x()}function H(k){d.value=k,x()}function x(){h.value=` + Hello, my name is + + AI Assistant + + +`}return(k,t)=>{var E;const T=G("motion");return s(),a(N,null,[g((s(),a("div",se,[e("button",{onClick:t[0]||(t[0]=o=>l(B).back())},t[14]||(t[14]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-xl":""},null,-1)])),e("h1",ae,[e("div",ne,[e("span",re,v(l(D)("settings.pages.modules.title")),1)]),t[15]||(t[15]=e("div",{"text-3xl":"","font-semibold":""}," Speech ",-1))])])),[[T]]),e("div",ie,[e("div",null,[e("div",de,[t[17]||(t[17]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Provider "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Select the suitable speech provider")])],-1)),e("div",ue,[l(z).length>0?(s(),a("fieldset",me,[(s(!0),a(N,null,K(l(j),o=>(s(),Z(l(te),{id:o.id,key:o.id,modelValue:l(n),"onUpdate:modelValue":t[1]||(t[1]=y=>i(n)?n.value=y:null),name:"speech-provider",value:o.id,title:o.localizedName,description:o.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(s(),a("div",pe,[f(l(W),{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:O(()=>t[16]||(t[16]=[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})]))])])]),l(n)?(s(),a("div",ve,[e("div",ce,[t[38]||(t[38]=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)),l(V)?(s(),a("div",be,t[18]||(t[18]=[e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1),e("span",null,"Loading available voices...",-1)]))):l(_)?(s(),a("div",xe,[t[20]||(t[20]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",ge,[t[19]||(t[19]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",fe,v(l(_)),1)])])):l(c)[l(n)]&&l(c)[l(n)].length>0?(s(),a("div",ke,[f(l(ee),{modelValue:l(d),"onUpdate:modelValue":t[2]||(t[2]=o=>i(d)?d.value=o:null),"search-query":C.value,"onUpdate:searchQuery":t[3]||(t[3]=o=>C.value=o),items:(E=l(c)[l(n)])==null?void 0:E.map(o=>{var y;return{id:o.name,name:o.name,description:o.description||`${((y=o.labels)==null?void 0:y.gender)||"Neutral"} voice`,customizable:!0}}),searchable:!0,"search-placeholder":"Search voices...","search-no-results-title":"No voices found","search-no-results-description":"Try a different search term or enter a custom voice name","search-results-text":"{count} of {total} voices","custom-input-placeholder":"Enter custom voice name","expand-button-text":"Show more voices","collapse-button-text":"Show fewer voices","onUpdate:customValue":H},null,8,["modelValue","search-query","items"]),l(n)==="elevenlabs"?(s(),a("div",ye,[t[22]||(t[22]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),g(e("select",{"onUpdate:modelValue":t[4]||(t[4]=o=>i(b)?b.value=o:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},t[21]||(t[21]=[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),[[P,l(b)]])])):p("",!0),e("div",we,[e("div",null,[t[23]||(t[23]=e("label",{class:"mb-1 block text-sm font-medium"}," Pitch Adjustment (%) ",-1)),e("div",he,[f(l(w),{modelValue:l(u),"onUpdate:modelValue":t[5]||(t[5]=o=>i(u)?u.value=o:null),min:-50,max:50,step:5,class:"w-full",onChange:x},null,8,["modelValue"]),e("span",Se,v(l(u))+"%",1)])]),e("div",null,[t[24]||(t[24]=e("label",{class:"mb-1 block text-sm font-medium"}," Speech Rate ",-1)),e("div",Ve,[f(l(w),{modelValue:l(m),"onUpdate:modelValue":t[6]||(t[6]=o=>i(m)?m.value=o:null),min:.5,max:2,step:.1,class:"w-full",onChange:x},null,8,["modelValue"]),e("span",_e,v(l(m))+"x",1)])])]),l(M)?(s(),a("div",Me,[e("div",Ce,[t[25]||(t[25]=e("label",{class:"font-medium"},"SSML Support",-1)),e("div",Ee,[g(e("input",{id:"ssml-toggle","onUpdate:modelValue":t[7]||(t[7]=o=>i(r)?r.value=o:null),type:"checkbox",class:"sr-only"},null,512),[[R,l(r)]]),e("label",Le,[e("span",{class:$([{"translate-x-4":l(r),"translate-x-0":!l(r)},"block h-6 w-6 transform rounded-full bg-white shadow transition-transform duration-200 ease-in-out"])},null,2)])])]),t[27]||(t[27]=e("p",{class:"mb-3 text-sm text-neutral-500"}," Enable Speech Synthesis Markup Language for more control over speech output ",-1)),l(r)?(s(),a("div",Ue,[t[26]||(t[26]=e("label",{class:"mb-1 block text-sm font-medium"}," SSML Example ",-1)),e("pre",Ne,v(h.value),1)])):p("",!0)])):p("",!0)])):!l(V)&&(!l(c)[l(n)]||l(c)[l(n)].length===0)?(s(),a("div",Pe,t[28]||(t[28]=[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)]))):p("",!0),!l(c)[l(n)]||l(c)[l(n)].length===0?(s(),a("div",Re,[e("div",null,[t[29]||(t[29]=e("label",{class:"mb-1 block text-sm font-medium"}," Voice Name ",-1)),g(e("input",{"onUpdate:modelValue":t[8]||(t[8]=o=>i(d)?d.value=o: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:"Enter voice name (e.g., 'Rachel', 'Josh')",onInput:t[9]||(t[9]=o=>F(o.target.value))},null,544),[[X,l(d)]]),t[30]||(t[30]=e("p",{class:"mt-1 text-xs text-neutral-500"}," For ElevenLabs, enter the exact voice name from your account ",-1))]),l(n)==="elevenlabs"?(s(),a("div",$e,[t[32]||(t[32]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),g(e("select",{"onUpdate:modelValue":t[10]||(t[10]=o=>i(b)?b.value=o:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},t[31]||(t[31]=[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),[[P,l(b)]])])):p("",!0),e("div",Ae,[e("div",null,[t[33]||(t[33]=e("label",{class:"mb-1 block text-sm font-medium"}," Pitch Adjustment (%) ",-1)),e("div",De,[f(l(w),{modelValue:l(u),"onUpdate:modelValue":t[11]||(t[11]=o=>i(u)?u.value=o:null),min:-50,max:50,step:5,class:"w-full",onChange:x},null,8,["modelValue"]),e("span",Ie,v(l(u))+"%",1)])]),e("div",null,[t[34]||(t[34]=e("label",{class:"mb-1 block text-sm font-medium"}," Speech Rate ",-1)),e("div",ze,[f(l(w),{modelValue:l(m),"onUpdate:modelValue":t[12]||(t[12]=o=>i(m)?m.value=o:null),min:.5,max:2,step:.1,class:"w-full",onChange:x},null,8,["modelValue"]),e("span",je,v(l(m))+"x",1)])])]),l(M)?(s(),a("div",Be,[e("div",Fe,[t[35]||(t[35]=e("label",{class:"font-medium"},"SSML Support",-1)),e("div",He,[g(e("input",{id:"ssml-toggle","onUpdate:modelValue":t[13]||(t[13]=o=>i(r)?r.value=o:null),type:"checkbox",class:"sr-only"},null,512),[[R,l(r)]]),e("label",Te,[e("span",{class:$([{"translate-x-4":l(r),"translate-x-0":!l(r)},"block h-6 w-6 transform rounded-full bg-white shadow transition-transform duration-200 ease-in-out"])},null,2)])])]),t[37]||(t[37]=e("p",{class:"mb-3 text-sm text-neutral-500"}," Enable Speech Synthesis Markup Language for more control over speech output ",-1)),l(r)?(s(),a("div",qe,[t[36]||(t[36]=e("label",{class:"mb-1 block text-sm font-medium"}," SSML Example ",-1)),e("pre",Qe,v(h.value),1)])):p("",!0)])):p("",!0)])):p("",!0)])])):p("",!0)]),t[39]||(t[39]=e("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:volume-2":""})],-1))],64)}}});typeof A=="function"&&A(Je);export{Je as default}; diff --git a/assets/speech-CJtnVd8v.js b/assets/speech-CJtnVd8v.js deleted file mode 100644 index aec89752b04ff4e1f4a555411eb61efbda93a091..0000000000000000000000000000000000000000 --- a/assets/speech-CJtnVd8v.js +++ /dev/null @@ -1,13 +0,0 @@ -import{d as T,s as L,bE as q,g as U,m as Q,bw as J,c as a,o as s,A as f,a as e,e as t,C as p,bx as N,by as Y,b as g,y as G,bo as K,D as c,ad as i,bI as P,B as R,z as $,bH as O,x as W}from"./index-DfQ41DTF.js";import{R as w}from"./Range-naQD8Ont.js";import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{_ as X,R as Z}from"./RadioCardDetailManySelect.vue_vue_type_script_setup_true_lang-CDWI8QsS.js";import{u as ee}from"./providers-CM7Pgz9x.js";import{u as le}from"./speech-Dcq6O7ME.js";import{b as A}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const te={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},oe={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},se={flex:"~ col gap-4"},ae={"max-w-full":""},re={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},ne={key:1},ie={key:0},de={flex:"~ col gap-4"},ue={key:0,class:"flex items-center justify-center py-4"},me={key:1,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"},pe={class:"flex flex-col"},ve={class:"text-sm text-red-600 dark:text-red-400"},ce={key:2,class:"space-y-6"},be={key:0},xe={class:"grid grid-cols-1 gap-4 md:grid-cols-2"},fe={class:"flex items-center gap-3"},ge={class:"w-12 text-center"},ke={class:"flex items-center gap-3"},ye={class:"w-12 text-center"},we={key:1,class:"border border-2 border-neutral-200 rounded-lg p-4 dark:border-neutral-700"},he={class:"mb-3 flex items-center justify-between"},Se={class:"relative mr-2 inline-block w-10 select-none align-middle"},Ve={for:"ssml-toggle",class:"block h-6 cursor-pointer overflow-hidden rounded-full bg-neutral-300 dark:bg-neutral-700"},_e={key:0,class:"mt-3"},Me={class:"overflow-auto rounded bg-neutral-50 p-3 text-xs dark:bg-neutral-800"},Ce={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"},Ee={key:4,class:"mt-2 space-y-6"},Le={key:0},Ue={class:"grid grid-cols-1 gap-4 md:grid-cols-2"},Ne={class:"flex items-center gap-3"},Pe={class:"w-12 text-center"},Re={class:"flex items-center gap-3"},$e={class:"w-12 text-center"},Ae={key:1,class:"border border-2 border-neutral-200 rounded-lg p-4 dark:border-neutral-700"},De={class:"mb-3 flex items-center justify-between"},ze={class:"relative mr-2 inline-block w-10 select-none align-middle"},Ie={for:"ssml-toggle",class:"block h-6 cursor-pointer overflow-hidden rounded-full bg-neutral-300 dark:bg-neutral-700"},je={key:0,class:"mt-3"},Be={class:"overflow-auto rounded bg-neutral-50 p-3 text-xs dark:bg-neutral-800"},Fe=T({__name:"speech",setup(He){const D=ee(),S=le(),{availableProviders:z,availableProvidersMetadata:I}=L(D),{activeSpeechProvider:r,activeSpeechModel:b,voiceId:d,pitch:u,rate:m,isLoadingSpeechProviderVoices:V,speechProviderError:_,supportsSSML:M,ssmlEnabled:n,availableVoices:v}=L(S),j=q(),h=U(` - Hello, my name is - - AI Assistant - - -`),C=U("");Q(async()=>{await S.loadVoicesForProvider(r.value)});function B(k){d.value=k,x()}function F(k){d.value=k,x()}function x(){h.value=` - Hello, my name is - - AI Assistant - - -`}return(k,l)=>{var E;const H=J("motion");return s(),a(N,null,[f((s(),a("div",te,[e("button",{onClick:l[0]||(l[0]=o=>t(j).back())},l[14]||(l[14]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-xl":""},null,-1)])),l[15]||(l[15]=e("h1",{relative:""},[e("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[e("span",{text:"neutral-300 dark:neutral-500"},"Modules")]),e("div",{"text-3xl":"","font-semibold":""}," Speech ")],-1))])),[[H]]),e("div",oe,[e("div",null,[e("div",se,[l[17]||(l[17]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Provider "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Select the suitable speech provider")])],-1)),e("div",ae,[t(z).length>0?(s(),a("fieldset",re,[(s(!0),a(N,null,Y(t(I),o=>(s(),W(t(Z),{id:o.id,key:o.id,modelValue:t(r),"onUpdate:modelValue":l[1]||(l[1]=y=>i(r)?r.value=y:null),name:"speech-provider",value:o.id,title:o.localizedName,description:o.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(s(),a("div",ne,[g(t(K),{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:G(()=>l[16]||(l[16]=[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})]))])])]),t(r)?(s(),a("div",ie,[e("div",de,[l[38]||(l[38]=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(V)?(s(),a("div",ue,l[18]||(l[18]=[e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1),e("span",null,"Loading available voices...",-1)]))):t(_)?(s(),a("div",me,[l[20]||(l[20]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",pe,[l[19]||(l[19]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",ve,c(t(_)),1)])])):t(v)[t(r)]&&t(v)[t(r)].length>0?(s(),a("div",ce,[g(t(X),{modelValue:t(d),"onUpdate:modelValue":l[2]||(l[2]=o=>i(d)?d.value=o:null),"search-query":C.value,"onUpdate:searchQuery":l[3]||(l[3]=o=>C.value=o),items:(E=t(v)[t(r)])==null?void 0:E.map(o=>{var y;return{id:o.name,name:o.name,description:o.description||`${((y=o.labels)==null?void 0:y.gender)||"Neutral"} voice`,customizable:!0}}),searchable:!0,"search-placeholder":"Search voices...","search-no-results-title":"No voices found","search-no-results-description":"Try a different search term or enter a custom voice name","search-results-text":"{count} of {total} voices","custom-input-placeholder":"Enter custom voice name","expand-button-text":"Show more voices","collapse-button-text":"Show fewer voices","onUpdate:customValue":F},null,8,["modelValue","search-query","items"]),t(r)==="elevenlabs"?(s(),a("div",be,[l[22]||(l[22]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),f(e("select",{"onUpdate:modelValue":l[4]||(l[4]=o=>i(b)?b.value=o:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},l[21]||(l[21]=[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),[[P,t(b)]])])):p("",!0),e("div",xe,[e("div",null,[l[23]||(l[23]=e("label",{class:"mb-1 block text-sm font-medium"}," Pitch Adjustment (%) ",-1)),e("div",fe,[g(t(w),{modelValue:t(u),"onUpdate:modelValue":l[5]||(l[5]=o=>i(u)?u.value=o:null),min:-50,max:50,step:5,class:"w-full",onChange:x},null,8,["modelValue"]),e("span",ge,c(t(u))+"%",1)])]),e("div",null,[l[24]||(l[24]=e("label",{class:"mb-1 block text-sm font-medium"}," Speech Rate ",-1)),e("div",ke,[g(t(w),{modelValue:t(m),"onUpdate:modelValue":l[6]||(l[6]=o=>i(m)?m.value=o:null),min:.5,max:2,step:.1,class:"w-full",onChange:x},null,8,["modelValue"]),e("span",ye,c(t(m))+"x",1)])])]),t(M)?(s(),a("div",we,[e("div",he,[l[25]||(l[25]=e("label",{class:"font-medium"},"SSML Support",-1)),e("div",Se,[f(e("input",{id:"ssml-toggle","onUpdate:modelValue":l[7]||(l[7]=o=>i(n)?n.value=o:null),type:"checkbox",class:"sr-only"},null,512),[[R,t(n)]]),e("label",Ve,[e("span",{class:$([{"translate-x-4":t(n),"translate-x-0":!t(n)},"block h-6 w-6 transform rounded-full bg-white shadow transition-transform duration-200 ease-in-out"])},null,2)])])]),l[27]||(l[27]=e("p",{class:"mb-3 text-sm text-neutral-500"}," Enable Speech Synthesis Markup Language for more control over speech output ",-1)),t(n)?(s(),a("div",_e,[l[26]||(l[26]=e("label",{class:"mb-1 block text-sm font-medium"}," SSML Example ",-1)),e("pre",Me,c(h.value),1)])):p("",!0)])):p("",!0)])):!t(V)&&(!t(v)[t(r)]||t(v)[t(r)].length===0)?(s(),a("div",Ce,l[28]||(l[28]=[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)]))):p("",!0),!t(v)[t(r)]||t(v)[t(r)].length===0?(s(),a("div",Ee,[e("div",null,[l[29]||(l[29]=e("label",{class:"mb-1 block text-sm font-medium"}," Voice Name ",-1)),f(e("input",{"onUpdate:modelValue":l[8]||(l[8]=o=>i(d)?d.value=o: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:"Enter voice name (e.g., 'Rachel', 'Josh')",onInput:l[9]||(l[9]=o=>B(o.target.value))},null,544),[[O,t(d)]]),l[30]||(l[30]=e("p",{class:"mt-1 text-xs text-neutral-500"}," For ElevenLabs, enter the exact voice name from your account ",-1))]),t(r)==="elevenlabs"?(s(),a("div",Le,[l[32]||(l[32]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),f(e("select",{"onUpdate:modelValue":l[10]||(l[10]=o=>i(b)?b.value=o:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},l[31]||(l[31]=[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),[[P,t(b)]])])):p("",!0),e("div",Ue,[e("div",null,[l[33]||(l[33]=e("label",{class:"mb-1 block text-sm font-medium"}," Pitch Adjustment (%) ",-1)),e("div",Ne,[g(t(w),{modelValue:t(u),"onUpdate:modelValue":l[11]||(l[11]=o=>i(u)?u.value=o:null),min:-50,max:50,step:5,class:"w-full",onChange:x},null,8,["modelValue"]),e("span",Pe,c(t(u))+"%",1)])]),e("div",null,[l[34]||(l[34]=e("label",{class:"mb-1 block text-sm font-medium"}," Speech Rate ",-1)),e("div",Re,[g(t(w),{modelValue:t(m),"onUpdate:modelValue":l[12]||(l[12]=o=>i(m)?m.value=o:null),min:.5,max:2,step:.1,class:"w-full",onChange:x},null,8,["modelValue"]),e("span",$e,c(t(m))+"x",1)])])]),t(M)?(s(),a("div",Ae,[e("div",De,[l[35]||(l[35]=e("label",{class:"font-medium"},"SSML Support",-1)),e("div",ze,[f(e("input",{id:"ssml-toggle","onUpdate:modelValue":l[13]||(l[13]=o=>i(n)?n.value=o:null),type:"checkbox",class:"sr-only"},null,512),[[R,t(n)]]),e("label",Ie,[e("span",{class:$([{"translate-x-4":t(n),"translate-x-0":!t(n)},"block h-6 w-6 transform rounded-full bg-white shadow transition-transform duration-200 ease-in-out"])},null,2)])])]),l[37]||(l[37]=e("p",{class:"mb-3 text-sm text-neutral-500"}," Enable Speech Synthesis Markup Language for more control over speech output ",-1)),t(n)?(s(),a("div",je,[l[36]||(l[36]=e("label",{class:"mb-1 block text-sm font-medium"}," SSML Example ",-1)),e("pre",Be,c(h.value),1)])):p("",!0)])):p("",!0)])):p("",!0)])])):p("",!0)]),l[39]||(l[39]=e("div",{text:"neutral-100/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:volume-2":""})],-1))],64)}}});typeof A=="function"&&A(Fe);export{Fe as default}; diff --git a/assets/speech-Dcq6O7ME.js b/assets/speech-Ci8yfKRf.js similarity index 94% rename from assets/speech-Dcq6O7ME.js rename to assets/speech-Ci8yfKRf.js index c82867af59034df7b2dd4791924f575924b3c619..e7b9b2123f6cb2a44819395d143272fa2727208d 100644 --- a/assets/speech-Dcq6O7ME.js +++ b/assets/speech-Ci8yfKRf.js @@ -1 +1 @@ -import{f as B,bL as s,g as d,h as n,w as E}from"./index-DfQ41DTF.js";import{u as F}from"./providers-CM7Pgz9x.js";const N={Myriam:"lNxY9WuCBCZCISASyJ55",Beatrice:"KAsXoQDshjF6ehsWa1mF",Camilla_KM:"dLhSyo03JRp5WkGpUlz1","Sally Sunshine":"qswttdunP3b44zVZKMRB",Annie:"AfA1PA0ldViH0DA6pbml","Kawaii Aerisita":"vGQNBgLaiM3EdZtxIiuY",Morioki:"8EkOjt4xTPGMclNlh1pk"},b=["Myriam","Beatrice","Camilla_KM","Sally Sunshine","Annie","Kawaii Aerisita"],P=["Morioki"],f={en:b,"en-US":b,ja:P,"ja-JP":P},$=B("speech",()=>{const r=F(),c=s("settings/speech/active-provider",""),y=s("settings/speech/active-model","eleven_multilingual_v2"),t=s("settings/speech/voice-name",""),L=s("settings/speech/voice-id",""),i=s("settings/speech/pitch",0),o=s("settings/speech/rate",1),l=s("settings/speech/ssml-enabled",!1),u=d(!1),v=d(null),h=d({}),m=s("settings/speech/language","en-US"),V=n(()=>r.availableProviders.filter(e=>g(e)).map(e=>r.getProviderMetadata(e))),A=n(()=>["elevenlabs","microsoft","google"].includes(c.value)),k=n(()=>Object.keys(f)),w=n(()=>{const e=m.value;return!e||!f[e]?[]:f[e].map(a=>({id:N[a],name:a,provider:"elevenlabs",language:e}))});function g(e){return["elevenlabs","microsoft","google","amazon"].includes(e)}function j(){t.value="",i.value=0,o.value=1,l.value=!1}async function S(e){var a,M;if(!e||!g(e))return[];u.value=!0,v.value=null;try{return await((M=(a=r.getProviderMetadata(e).capabilities).listVoices)==null?void 0:M.call(a,r.getProviderConfig(e)))||[]}catch(p){return console.error(`Error fetching voices for ${e}:`,p),v.value=p instanceof Error?p.message:"Unknown error",[]}finally{u.value=!1}}function C(e){return h.value[e]||[]}E(c,async e=>{e&&await S(e)});function K(e){if(!l.value)return e;let a="";return t.value&&(a+=``),(i.value!==0||o.value!==1)&&(a+=``),a+=e,(i.value!==0||o.value!==1)&&(a+=""),t.value&&(a+=""),a+="",a}return{activeSpeechProvider:c,activeSpeechModel:y,voiceName:t,voiceId:L,pitch:i,rate:o,ssmlEnabled:l,selectedLanguage:m,isLoadingSpeechProviderVoices:u,speechProviderError:v,availableVoices:h,availableSpeechProvidersMetadata:V,supportsSSML:A,availableLanguages:k,availableVoicesForLanguage:w,resetVoiceSettings:j,loadVoicesForProvider:S,getVoicesForProvider:C,generateSSML:K,isSpeechProvider:g}});export{$ as u,N as v}; +import{f as B,bL as s,g as d,h as n,w as E}from"./index-Dn5R1iW2.js";import{u as F}from"./providers-Li1UUmJz.js";const N={Myriam:"lNxY9WuCBCZCISASyJ55",Beatrice:"KAsXoQDshjF6ehsWa1mF",Camilla_KM:"dLhSyo03JRp5WkGpUlz1","Sally Sunshine":"qswttdunP3b44zVZKMRB",Annie:"AfA1PA0ldViH0DA6pbml","Kawaii Aerisita":"vGQNBgLaiM3EdZtxIiuY",Morioki:"8EkOjt4xTPGMclNlh1pk"},b=["Myriam","Beatrice","Camilla_KM","Sally Sunshine","Annie","Kawaii Aerisita"],P=["Morioki"],f={en:b,"en-US":b,ja:P,"ja-JP":P},$=B("speech",()=>{const r=F(),c=s("settings/speech/active-provider",""),y=s("settings/speech/active-model","eleven_multilingual_v2"),t=s("settings/speech/voice-name",""),L=s("settings/speech/voice-id",""),i=s("settings/speech/pitch",0),o=s("settings/speech/rate",1),l=s("settings/speech/ssml-enabled",!1),u=d(!1),v=d(null),h=d({}),m=s("settings/speech/language","en-US"),V=n(()=>r.availableProviders.filter(e=>g(e)).map(e=>r.getProviderMetadata(e))),A=n(()=>["elevenlabs","microsoft","google"].includes(c.value)),k=n(()=>Object.keys(f)),w=n(()=>{const e=m.value;return!e||!f[e]?[]:f[e].map(a=>({id:N[a],name:a,provider:"elevenlabs",language:e}))});function g(e){return["elevenlabs","microsoft","google","amazon"].includes(e)}function j(){t.value="",i.value=0,o.value=1,l.value=!1}async function S(e){var a,M;if(!e||!g(e))return[];u.value=!0,v.value=null;try{return await((M=(a=r.getProviderMetadata(e).capabilities).listVoices)==null?void 0:M.call(a,r.getProviderConfig(e)))||[]}catch(p){return console.error(`Error fetching voices for ${e}:`,p),v.value=p instanceof Error?p.message:"Unknown error",[]}finally{u.value=!1}}function C(e){return h.value[e]||[]}E(c,async e=>{e&&await S(e)});function K(e){if(!l.value)return e;let a="";return t.value&&(a+=``),(i.value!==0||o.value!==1)&&(a+=``),a+=e,(i.value!==0||o.value!==1)&&(a+=""),t.value&&(a+=""),a+="",a}return{activeSpeechProvider:c,activeSpeechModel:y,voiceName:t,voiceId:L,pitch:i,rate:o,ssmlEnabled:l,selectedLanguage:m,isLoadingSpeechProviderVoices:u,speechProviderError:v,availableVoices:h,availableSpeechProvidersMetadata:V,supportsSSML:A,availableLanguages:k,availableVoicesForLanguage:w,resetVoiceSettings:j,loadVoicesForProvider:S,getVoicesForProvider:C,generateSSML:K,isSpeechProvider:g}});export{$ as u,N as v}; diff --git a/assets/stage-C7eW1fiM.js b/assets/stage-BHtp9MvQ.js similarity index 84% rename from assets/stage-C7eW1fiM.js rename to assets/stage-BHtp9MvQ.js index b60b662338ce1cceabc0d0ed1f410afca249c346..b8754c6f2116ab33cd428d9657505c985435b571 100644 --- a/assets/stage-C7eW1fiM.js +++ b/assets/stage-BHtp9MvQ.js @@ -1 +1 @@ -import{d as p,u as s,c,b as d,r as i,n as m,e,o as l}from"./index-DfQ41DTF.js";const x=p({__name:"stage",setup(u){const{top:t,right:o,bottom:a,left:n}=s();return(f,_)=>{const r=i("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(o)}px`,paddingBottom:`${e(a)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; +import{d as p,u as s,c,b as d,r as i,n as m,e,o as l}from"./index-Dn5R1iW2.js";const x=p({__name:"stage",setup(u){const{top:t,right:o,bottom:a,left:n}=s();return(f,_)=>{const r=i("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(o)}px`,paddingBottom:`${e(a)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; diff --git a/assets/together-ai-3JngR7s2.js b/assets/together-ai-3JngR7s2.js new file mode 100644 index 0000000000000000000000000000000000000000..3e0b136ac98e4a02e9e9d96c9fb09cc8fce5b853 --- /dev/null +++ b/assets/together-ai-3JngR7s2.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as h,i as y,bE as U,s as V,h as v,m as $,w as k,x,o as K,y as d,b as l,e as t}from"./index-Dn5R1iW2.js";import{u as z}from"./providers-Li1UUmJz.js";import{_ as w,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as N,b as P,c as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const a="together-ai",D=h({__name:"together-ai",setup(S){const{t:p}=y(),_=U(),c=z(),{providers:o}=V(c),n=v(()=>c.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}}),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;c.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([r,i],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:i.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var m,f;return K(),x(t(R),{"provider-name":(m=n.value)==null?void 0:m.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:d(()=>[l(t(N),null,{default:d(()=>[l(t(P),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:d(()=>{var u;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=b=>r.value=b),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:d(()=>[l(t(C),{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=u=>i.value=u),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{D as default}; diff --git a/assets/together-ai-BYBUsnJP.js b/assets/together-ai-BYBUsnJP.js deleted file mode 100644 index 993fa1dcca2f7f3fd0f51e3534523d7f992142bd..0000000000000000000000000000000000000000 --- a/assets/together-ai-BYBUsnJP.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as g,bE as h,s as y,h as p,m as U,w as V,x as $,o as k,y as d,b as i,e as l}from"./index-DfQ41DTF.js";import{u as x}from"./providers-CM7Pgz9x.js";import{_ as K,a as z}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as w}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as C,c as M}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const a="together-ai",j=g({__name:"together-ai",setup(N){const f=h(),v=x(),{providers:o}=y(v),u=p(()=>v.getProviderMetadata(a)),r=p({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=p({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}});U(()=>{var e,t;v.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((t=o.value[a])==null?void 0:t.baseUrl)||""}),V([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function _(){var e;o.value[a]={...(e=u.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var m,c;return k(),$(l(M),{"provider-name":(m=u.value)==null?void 0:m.localizedName,"provider-icon-color":(c=u.value)==null?void 0:c.iconColor,"on-back":()=>l(f).back()},{default:d(()=>[i(l(B),null,{default:d(()=>[i(l(C),{title:"Basic",description:"Essential settings","on-reset":_},{default:d(()=>{var n;return[i(l(w),{modelValue:r.value,"onUpdate:modelValue":t[0]||(t[0]=b=>r.value=b),"provider-name":(n=u.value)==null?void 0:n.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1}),i(l(K),{title:"Advanced"},{default:d(()=>[i(l(z),{modelValue:s.value,"onUpdate:modelValue":t[1]||(t[1]=n=>s.value=n),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{j as default}; diff --git a/assets/xai-CuM3qEtK.js b/assets/xai-CuM3qEtK.js deleted file mode 100644 index e603cd184d151084a539bdbaba450d63e0d03659..0000000000000000000000000000000000000000 --- a/assets/xai-CuM3qEtK.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-BqPxkA1F.js";import{d as x,bE as U,s as V,h as p,m as y,w as $,x as g,o as k,y as d,b as i,e as t}from"./index-DfQ41DTF.js";import{u as K}from"./providers-CM7Pgz9x.js";import{_ as h,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-VdHwjLw0.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BUuYMTIp.js";import{a as B,b as M,c as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DI9uisuD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-C9YANSys.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-C8e2RfG_.js";const a="xai",j=x({__name:"xai",setup(P){const f=U(),v=K(),{providers:o}=V(v),u=p(()=>v.getProviderMetadata(a)),r=p({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=p({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,l;v.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((l=o.value[a])==null?void 0:l.baseUrl)||""}),$([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function _(){var e;o.value[a]={...(e=u.value)==null?void 0:e.defaultOptions}}return(e,l)=>{var m,c;return k(),g(t(N),{"provider-name":(m=u.value)==null?void 0:m.localizedName,"provider-icon":(c=u.value)==null?void 0:c.icon,"on-back":()=>t(f).back()},{default:d(()=>[i(t(B),null,{default:d(()=>[i(t(M),{title:"Basic",description:"Essential settings","on-reset":_},{default:d(()=>{var n;return[i(t(z),{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=b=>r.value=b),"provider-name":(n=u.value)==null?void 0:n.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1}),i(t(h),{title:"Advanced"},{default:d(()=>[i(t(w),{modelValue:s.value,"onUpdate:modelValue":l[1]||(l[1]=n=>s.value=n),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{j as default}; diff --git a/assets/xai-RB75_YXa.js b/assets/xai-RB75_YXa.js new file mode 100644 index 0000000000000000000000000000000000000000..b96cff524be00c40622fb15b02c857df9fe127ad --- /dev/null +++ b/assets/xai-RB75_YXa.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_cad77b27_lang-Cdkjw_Bx.js";import{d as x,i as U,bE as V,s as y,h as m,m as $,w as k,x as K,o as h,y as d,b as r,e as t}from"./index-Dn5R1iW2.js";import{u as w}from"./providers-Li1UUmJz.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-CI2TjRvx.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-uiRhLv3L.js";import{a as P,b as R,c as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DNKaflib.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DUlITCow.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BeLoJIr_.js";const a="xai",D=x({__name:"xai",setup(B){const{t:p}=U(),_=V(),v=w(),{providers:o}=y(v),n=m(()=>v.getProviderMetadata(a)),i=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),l=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;v.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",l.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,l],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:l.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:d(()=>[r(t(P),null,{default:d(()=>[r(t(R),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:d(()=>{var u;return[r(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:d(()=>[r(t(M),{modelValue:l.value,"onUpdate:modelValue":s[1]||(s[1]=u=>l.value=u),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{D as default}; diff --git a/index.html b/index.html index 4fec561c44a5fe97586361705bd9abc08781949f..bca9447414814d37fc8d17312e1efd42a9f1b910 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ src="/remote-assets/page-external-data/js/script.js" > - +