@tresjs/nuxt 5.1.1 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/{D_cbZWpb.js → BB7b1NhI.js} +1 -1
- package/dist/client/_nuxt/BTuK986F.js +32 -0
- package/dist/client/_nuxt/CWvgRfZY.js +1 -0
- package/dist/client/_nuxt/{BLrc_wby.js → D6b8SlgE.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/acbbde28-11a3-470d-a0e2-b7b346378706.json +1 -0
- package/dist/client/_nuxt/entry.BYQHhE7n.css +1 -0
- package/dist/client/_nuxt/error-404.BEa_NG2q.css +1 -0
- package/dist/client/_nuxt/error-500.CM2UB_dn.css +1 -0
- package/dist/client/_nuxt/{index.ClGUmvX1.css → index.BGwMPBVA.css} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -3
- package/dist/runtime/TresCanvas.client.d.vue.ts +5 -4
- package/dist/runtime/TresCanvas.client.vue.d.ts +5 -4
- package/dist/runtime/TresCanvas.server.d.vue.ts +2 -1
- package/dist/runtime/TresCanvas.server.vue.d.ts +2 -1
- package/package.json +2 -2
- package/dist/client/_nuxt/U1-jPdw9.js +0 -51
- package/dist/client/_nuxt/builds/meta/a43265c2-4221-4087-b3fb-0f23c24b40b0.json +0 -1
- package/dist/client/_nuxt/entry.COVkr4Sa.css +0 -1
- package/dist/client/_nuxt/error-404.DxIPCe2C.css +0 -1
- package/dist/client/_nuxt/error-500.B-AMcJca.css +0 -1
- package/dist/client/_nuxt/gW3Ze8bn.js +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as Yi,f as Ds,g as tl,h as k,j as sd,r as z,k as ra,l as _e,m as Hn,n as Er,p as ja,q as si,s as Ye,v as gt,x as ad,y as Nn,z as il,A as rl,B as Mi,C as nl,D as He,E as pt,F as O,G as Re,H as rt,I as vt,J as S,K as f,L as X,M as C,o as v,w as _,N as L,P as re,O as od,Q as na,R as ld,S as gi,T as is,U as ud,V as dd,W as rs,X as Wa,b as F,Y as Fr,Z as ar,$ as Lt,a0 as D,a1 as ae,a2 as le,a3 as Or,a4 as sa,a5 as zr,a6 as Ir,c as N,a7 as xe,a8 as Xe,a9 as ht,aa as fe,ab as or,ac as sl,ad as at,ae as cd,af as hd,ag as Oi,ah as al,ai as fd,aj as qt,ak as Vn,al as Zt,am as Ce,an as pd,ao as ol,ap as md,aq as ll,ar as gd,as as aa,at as yd,au as We,av as vd,d as ce,t as Z,aw as Tr,ax as oa,ay as bd,az as xd,aA as wd,aB as Mn,aC as Rt,aD as _d,aE as la,aF as Cd,aG as Ad,aH as ul,aI as Sd,aJ as Md,aK as Bi,aL as Te,aM as dl,aN as Me,aO as I,aP as lt,aQ as cl,aR as ue,aS as Ft,aT as lr,aU as je,a as T,aV as Bd,aW as qn,aX as ua,aY as qd,aZ as kd,a_ as hl,a$ as Ed,_ as fl,b0 as da,b1 as pl,b2 as ur,b3 as ca,b4 as ml,b5 as Fd,b6 as Od,b7 as zd,b8 as Tt,b9 as gl,ba as yl,bb as Id,bc as Td,bd as Pd,be as ns}from"#entry";function Rd(r,e=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY){return Math.min(t,Math.max(e,r))}function Jr(r,e){let t=r;const i=e.toString(),n=i.indexOf("."),s=n>=0?i.length-n:0;if(s>0){const a=10**s;t=Math.round(t*a)/a}return t}function Dd(r,e,t,i){e=Number(e),t=Number(t);const n=(r-(Number.isNaN(e)?0:e))%i;let s=Jr(Math.abs(n)*2>=i?r+Math.sign(n)*(i-Math.abs(n)):r-n,i);return Number.isNaN(e)?!Number.isNaN(t)&&s>t&&(s=Math.floor(Jr(t/i,i))*i):s<e?s=e:!Number.isNaN(t)&&s>t&&(s=e+Math.floor(Jr((t-e)/i,i))*i),s=Jr(s,i),s}function Ga(r,e){return Yi(r)?!1:Array.isArray(r)?r.some(t=>Ds(t,e)):Ds(r,e)}const $d=["INPUT","TEXTAREA"];function Ld(r,e,t,i={}){if(!e||i.enableIgnoredElement&&$d.includes(e.nodeName))return null;const{arrowKeyOptions:n="both",attributeName:s="[data-reka-collection-item]",itemsArray:a=[],loop:o=!0,dir:l="ltr",preventScroll:u=!0,focus:d=!1}=i,[c,h,p,m,g,y]=[r.key==="ArrowRight",r.key==="ArrowLeft",r.key==="ArrowUp",r.key==="ArrowDown",r.key==="Home",r.key==="End"],b=p||m,x=c||h;if(!g&&!y&&(!b&&!x||n==="vertical"&&x||n==="horizontal"&&b))return null;const w=t?Array.from(t.querySelectorAll(s)):a;if(!w.length)return null;u&&r.preventDefault();let A=null;return x||b?A=vl(w,e,{goForward:b?m:l==="ltr"?c:h,loop:o}):g?A=w.at(0)||null:y&&(A=w.at(-1)||null),d&&A?.focus(),A}function vl(r,e,t,i=r.length){if(--i===0)return null;const n=r.indexOf(e),s=t.goForward?n+1:n-1;if(!t.loop&&(s<0||s>=r.length))return null;const a=(s+r.length)%r.length,o=r[a];return o?o.hasAttribute("disabled")&&o.getAttribute("disabled")!=="false"?vl(r,o,t,i):o:null}const Hd=tl(()=>{const r=z(new Map),e=z(),t=k(()=>{for(const a of r.value.values())if(a)return!0;return!1}),i=ra({scrollBody:z(!0)});let n=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",ja&&n?.(),e.value=void 0};return _e(t,(a,o)=>{if(!Hn)return;if(!a){o&&s();return}e.value===void 0&&(e.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,u={padding:l,margin:0},d=i.scrollBody?.value?typeof i.scrollBody.value=="object"?Er({padding:i.scrollBody.value.padding===!0?l:i.scrollBody.value.padding,margin:i.scrollBody.value.margin===!0?l:i.scrollBody.value.margin},u):u:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof d.padding=="number"?`${d.padding}px`:String(d.padding),document.body.style.marginRight=typeof d.margin=="number"?`${d.margin}px`:String(d.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),ja&&(n=si(document,"touchmove",c=>Nd(c),{passive:!1})),Ye(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),r});function ha(r){const e=Math.random().toString(36).substring(2,7),t=Hd();t.value.set(e,r??!1);const i=k({get:()=>t.value.get(e)??!1,set:n=>t.value.set(e,n)});return sd(()=>{t.value.delete(e)}),i}function bl(r){const e=window.getComputedStyle(r);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&r.clientWidth<r.scrollWidth||e.overflowY==="auto"&&r.clientHeight<r.scrollHeight)return!0;{const t=r.parentNode;return!(t instanceof Element)||t.tagName==="BODY"?!1:bl(t)}}function Nd(r){const e=r||window.event,t=e.target;return t instanceof Element&&bl(t)?!1:e.touches.length>1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function Un(r){const e=ra({dir:z("ltr")});return k(()=>r?.value||e.dir?.value||"ltr")}let ss=0;function xl(){gt(r=>{if(!Hn)return;const e=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",e[0]??Ka()),document.body.insertAdjacentElement("beforeend",e[1]??Ka()),ss++,r(()=>{ss===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(t=>t.remove()),ss--})})}function Ka(){const r=document.createElement("span");return r.setAttribute("data-reka-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}function wl(r){return k(()=>ad(r)?!!Nn(r)?.closest("form"):!0)}function _l(r,e){const t=il(!1,300),i=z(null),n=rl();function s(){i.value=null,t.value=!1}function a(o,l){const u=o.currentTarget,d={x:o.clientX,y:o.clientY},c=Vd(d,u.getBoundingClientRect()),h=Ud(d,c),p=jd(l.getBoundingClientRect()),m=Gd([...h,...p]);i.value=m,t.value=!0}return gt(o=>{if(r.value&&e.value){const l=d=>a(d,e.value),u=d=>a(d,r.value);r.value.addEventListener("pointerleave",l),e.value.addEventListener("pointerleave",u),o(()=>{r.value?.removeEventListener("pointerleave",l),e.value?.removeEventListener("pointerleave",u)})}}),gt(o=>{if(i.value){const l=u=>{if(!i.value||!(u.target instanceof Element))return;const d=u.target,c={x:u.clientX,y:u.clientY},h=r.value?.contains(d)||e.value?.contains(d),p=!Wd(c,i.value),m=!!d.closest("[data-grace-area-trigger]");h?s():(p||m)&&(s(),n.trigger())};r.value?.ownerDocument.addEventListener("pointermove",l),o(()=>r.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:t,onPointerExit:n.on}}function Vd(r,e){const t=Math.abs(e.top-r.y),i=Math.abs(e.bottom-r.y),n=Math.abs(e.right-r.x),s=Math.abs(e.left-r.x);switch(Math.min(t,i,n,s)){case s:return"left";case n:return"right";case t:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function Ud(r,e,t=5){const i=[];switch(e){case"top":i.push({x:r.x-t,y:r.y+t},{x:r.x+t,y:r.y+t});break;case"bottom":i.push({x:r.x-t,y:r.y-t},{x:r.x+t,y:r.y-t});break;case"left":i.push({x:r.x+t,y:r.y-t},{x:r.x+t,y:r.y+t});break;case"right":i.push({x:r.x-t,y:r.y-t},{x:r.x-t,y:r.y+t});break}return i}function jd(r){const{top:e,right:t,bottom:i,left:n}=r;return[{x:n,y:e},{x:t,y:e},{x:t,y:i},{x:n,y:i}]}function Wd(r,e){const{x:t,y:i}=r;let n=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s].x,l=e[s].y,u=e[a].x,d=e[a].y;l>i!=d>i&&t<(u-o)*(i-l)/(d-l)+o&&(n=!n)}return n}function Gd(r){const e=r.slice();return e.sort((t,i)=>t.x<i.x?-1:t.x>i.x?1:t.y<i.y?-1:t.y>i.y?1:0),Kd(e)}function Kd(r){if(r.length<=1)return r.slice();const e=[];for(let i=0;i<r.length;i++){const n=r[i];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(n.y-a.y)>=(s.y-a.y)*(n.x-a.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let i=r.length-1;i>=0;i--){const n=r[i];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(n.y-a.y)>=(s.y-a.y)*(n.x-a.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Xd=function(r){if(typeof document>"u")return null;var e=Array.isArray(r)?r[0]:r;return e.ownerDocument.body},zi=new WeakMap,Zr=new WeakMap,Qr={},as=0,Cl=function(r){return r&&(r.host||Cl(r.parentNode))},Yd=function(r,e){return e.map(function(t){if(r.contains(t))return t;var i=Cl(t);return i&&r.contains(i)?i:(console.error("aria-hidden",t,"in not contained inside",r,". Doing nothing"),null)}).filter(function(t){return!!t})},Jd=function(r,e,t,i){var n=Yd(e,Array.isArray(r)?r:[r]);Qr[t]||(Qr[t]=new WeakMap);var s=Qr[t],a=[],o=new Set,l=new Set(n),u=function(c){!c||o.has(c)||(o.add(c),u(c.parentNode))};n.forEach(u);var d=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(h){if(o.has(h))d(h);else try{var p=h.getAttribute(i),m=p!==null&&p!=="false",g=(zi.get(h)||0)+1,y=(s.get(h)||0)+1;zi.set(h,g),s.set(h,y),a.push(h),g===1&&m&&Zr.set(h,!0),y===1&&h.setAttribute(t,"true"),m||h.setAttribute(i,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return d(e),o.clear(),as++,function(){a.forEach(function(c){var h=zi.get(c)-1,p=s.get(c)-1;zi.set(c,h),s.set(c,p),h||(Zr.has(c)||c.removeAttribute(i),Zr.delete(c)),p||c.removeAttribute(t)}),as--,as||(zi=new WeakMap,zi=new WeakMap,Zr=new WeakMap,Qr={})}},Zd=function(r,e,t){t===void 0&&(t="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),n=Xd(r);return n?(i.push.apply(i,Array.from(n.querySelectorAll("[aria-live], script"))),Jd(i,n,t,"aria-hidden")):function(){return null}};function fa(r){let e;_e(()=>Nn(r),t=>{t?e=Zd(t):e&&e()}),Mi(()=>{e&&e()})}function yt(r,e="reka"){return`${e}-${nl?.()}`}function Qd(r){const e=ra({locale:z("en")});return k(()=>r?.value||e.locale?.value||"en")}function ec(r){const e=z(),t=k(()=>e.value?.width??0),i=k(()=>e.value?.height??0);return He(()=>{const n=Nn(r);if(n){e.value={width:n.offsetWidth,height:n.offsetHeight};const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,c=Array.isArray(d)?d[0]:d;l=c.inlineSize,u=c.blockSize}else l=n.offsetWidth,u=n.offsetHeight;e.value={width:l,height:u}});return s.observe(n,{box:"border-box"}),()=>s.unobserve(n)}else e.value=void 0}),{width:t,height:i}}function tc(r){const e=il("",1e3);return{search:e,handleTypeaheadSearch:(n,s)=>{e.value=e.value+n;{const a=pt(),o=s.map(h=>({...h,textValue:h.value?.textValue??h.ref.textContent?.trim()??""})),l=o.find(h=>h.ref===a),u=o.map(h=>h.textValue),d=rc(u,e.value,l?.textValue),c=o.find(h=>h.textValue===d);return c&&c.ref.focus(),c?.ref}},resetTypeahead:()=>{e.value=""}}}function ic(r,e){return r.map((t,i)=>r[(e+i)%r.length])}function rc(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=t?r.indexOf(t):-1;let a=ic(r,Math.max(s,0));n.length===1&&(a=a.filter(u=>u!==t));const l=a.find(u=>u.toLowerCase().startsWith(n.toLowerCase()));return l!==t?l:void 0}const[Ht,nc]=Re("DialogRoot");var sc=O({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(r,{emit:e}){const t=r,n=rt(t,"open",e,{defaultValue:t.defaultOpen,passive:t.open===void 0}),s=z(),a=z(),{modal:o}=vt(t);return nc({open:n,modal:o,openModal:()=>{n.value=!0},onOpenChange:l=>{n.value=l},onOpenToggle:()=>{n.value=!n.value},contentId:"",titleId:"",descriptionId:"",triggerElement:s,contentElement:a}),(l,u)=>S(l.$slots,"default",{open:f(n),close:()=>n.value=!1})}}),pa=sc,ac=O({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r;X();const t=Ht();return(i,n)=>(v(),C(f(re),L(e,{type:i.as==="button"?"button":void 0,onClick:n[0]||(n[0]=s=>f(t).onOpenChange(!1))}),{default:_(()=>[S(i.$slots,"default")]),_:3},16,["type"]))}}),Al=ac;const oc=od(()=>z([]));function lc(){const r=oc();return{add(e){const t=r.value[0];e!==t&&t?.pause(),r.value=Xa(r.value,e),r.value.unshift(e)},remove(e){r.value=Xa(r.value,e),r.value[0]?.resume()}}}function Xa(r,e){const t=[...r],i=t.indexOf(e);return i!==-1&&t.splice(i,1),t}function uc(r){return r.filter(e=>e.tagName!=="A")}var dc=O({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(r,{emit:e}){const t=r,i=e,{currentRef:n,currentElement:s}=X(),a=z(null),o=lc(),l=na({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});gt(d=>{if(!Hn)return;const c=s.value;if(!t.trapped)return;function h(y){if(l.paused||!c)return;const b=y.target;c.contains(b)?a.value=b:gi(a.value,{select:!0})}function p(y){if(l.paused||!c)return;const b=y.relatedTarget;b!==null&&(c.contains(b)||gi(a.value,{select:!0}))}function m(y){c.contains(a.value)||gi(c)}document.addEventListener("focusin",h),document.addEventListener("focusout",p);const g=new MutationObserver(m);c&&g.observe(c,{childList:!0,subtree:!0}),d(()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",p),g.disconnect()})}),gt(async d=>{const c=s.value;if(await Ye(),!c)return;o.add(l);const h=pt();if(!c.contains(h)){const m=new CustomEvent(is,Wa);c.addEventListener(is,g=>i("mountAutoFocus",g)),c.dispatchEvent(m),m.defaultPrevented||(ud(uc(dd(c)),{select:!0}),pt()===h&&gi(c))}d(()=>{c.removeEventListener(is,y=>i("mountAutoFocus",y));const m=new CustomEvent(rs,Wa),g=y=>{i("unmountAutoFocus",y)};c.addEventListener(rs,g),c.dispatchEvent(m),setTimeout(()=>{m.defaultPrevented||gi(h??document.body,{select:!0}),c.removeEventListener(rs,g),o.remove(l)},0)})});function u(d){if(!t.loop&&!t.trapped||l.paused)return;const c=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,h=pt();if(c&&h){const p=d.currentTarget,[m,g]=ld(p);m&&g?!d.shiftKey&&h===g?(d.preventDefault(),t.loop&&gi(m,{select:!0})):d.shiftKey&&h===m&&(d.preventDefault(),t.loop&&gi(g,{select:!0})):h===p&&d.preventDefault()}}return(d,c)=>(v(),C(f(re),{ref_key:"currentRef",ref:n,tabindex:"-1","as-child":d.asChild,as:d.as,onKeydown:u},{default:_(()=>[S(d.$slots,"default")]),_:3},8,["as-child","as"]))}}),ma=dc;const cc="menu.itemSelect",$s=["Enter"," "],hc=["ArrowDown","PageUp","Home"],Sl=["ArrowUp","PageDown","End"],fc=[...hc,...Sl],pc={ltr:[...$s,"ArrowRight"],rtl:[...$s,"ArrowLeft"]},mc={ltr:["ArrowLeft"],rtl:["ArrowRight"]};function ga(r){return r?"open":"closed"}function kn(r){return r==="indeterminate"}function ya(r){return kn(r)?"indeterminate":r?"checked":"unchecked"}function gc(r){const e=pt();for(const t of r)if(t===e||(t.focus(),pt()!==e))return}function yc(r,e){const{x:t,y:i}=r;let n=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s].x,l=e[s].y,u=e[a].x,d=e[a].y;l>i!=d>i&&t<(u-o)*(i-l)/(d-l)+o&&(n=!n)}return n}function vc(r,e){if(!e)return!1;const t={x:r.clientX,y:r.clientY};return yc(t,e)}function Sr(r){return r.pointerType==="mouse"}var bc=O({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=Ht(),{forwardRef:s,currentElement:a}=X();return n.titleId||=yt(void 0,"reka-dialog-title"),n.descriptionId||=yt(void 0,"reka-dialog-description"),He(()=>{n.contentElement=a,pt()!==document.body&&(n.triggerElement.value=pt())}),(o,l)=>(v(),C(f(ma),{"as-child":"",loop:"",trapped:t.trapFocus,onMountAutoFocus:l[5]||(l[5]=u=>i("openAutoFocus",u)),onUnmountAutoFocus:l[6]||(l[6]=u=>i("closeAutoFocus",u))},{default:_(()=>[F(f(Fr),L({id:f(n).contentId,ref:f(s),as:o.as,"as-child":o.asChild,"disable-outside-pointer-events":o.disableOutsidePointerEvents,role:"dialog","aria-describedby":f(n).descriptionId,"aria-labelledby":f(n).titleId,"data-state":f(ga)(f(n).open.value)},o.$attrs,{onDismiss:l[0]||(l[0]=u=>f(n).onOpenChange(!1)),onEscapeKeyDown:l[1]||(l[1]=u=>i("escapeKeyDown",u)),onFocusOutside:l[2]||(l[2]=u=>i("focusOutside",u)),onInteractOutside:l[3]||(l[3]=u=>i("interactOutside",u)),onPointerDownOutside:l[4]||(l[4]=u=>i("pointerDownOutside",u))}),{default:_(()=>[S(o.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),Ml=bc,xc=O({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=Ht(),s=ar(i),{forwardRef:a,currentElement:o}=X();return fa(o),(l,u)=>(v(),C(Ml,L({...t,...f(s)},{ref:f(a),"trap-focus":f(n).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:u[0]||(u[0]=d=>{d.defaultPrevented||(d.preventDefault(),f(n).triggerElement.value?.focus())}),onPointerDownOutside:u[1]||(u[1]=d=>{const c=d.detail.originalEvent,h=c.button===0&&c.ctrlKey===!0;(c.button===2||h)&&d.preventDefault()}),onFocusOutside:u[2]||(u[2]=d=>{d.preventDefault()})}),{default:_(()=>[S(l.$slots,"default")]),_:3},16,["trap-focus"]))}}),wc=xc,_c=O({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,n=ar(e);X();const s=Ht(),a=z(!1),o=z(!1);return(l,u)=>(v(),C(Ml,L({...t,...f(n)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:u[0]||(u[0]=d=>{d.defaultPrevented||(a.value||f(s).triggerElement.value?.focus(),d.preventDefault()),a.value=!1,o.value=!1}),onInteractOutside:u[1]||(u[1]=d=>{d.defaultPrevented||(a.value=!0,d.detail.originalEvent.type==="pointerdown"&&(o.value=!0));const c=d.target;f(s).triggerElement.value?.contains(c)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&o.value&&d.preventDefault()})}),{default:_(()=>[S(l.$slots,"default")]),_:3},16))}}),Cc=_c,Ac=O({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=Ht(),s=ar(i),{forwardRef:a}=X();return(o,l)=>(v(),C(f(Lt),{present:o.forceMount||f(n).open.value},{default:_(()=>[f(n).modal.value?(v(),C(wc,L({key:0,ref:f(a)},{...t,...f(s),...o.$attrs}),{default:_(()=>[S(o.$slots,"default")]),_:3},16)):(v(),C(Cc,L({key:1,ref:f(a)},{...t,...f(s),...o.$attrs}),{default:_(()=>[S(o.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),va=Ac,Sc=O({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(r){const e=r;X();const t=Ht();return(i,n)=>(v(),C(f(re),L(e,{id:f(t).descriptionId}),{default:_(()=>[S(i.$slots,"default")]),_:3},16,["id"]))}}),ir=Sc,Mc=O({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=Ht();return ha(!0),X(),(t,i)=>(v(),C(f(re),{as:t.as,"as-child":t.asChild,"data-state":f(e).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:_(()=>[S(t.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Bc=Mc,qc=O({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=Ht(),{forwardRef:t}=X();return(i,n)=>f(e)?.modal.value?(v(),C(f(Lt),{key:0,present:i.forceMount||f(e).open.value},{default:_(()=>[F(Bc,L(i.$attrs,{ref:f(t),as:i.as,"as-child":i.asChild}),{default:_(()=>[S(i.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):D("v-if",!0)}}),En=qc,kc=O({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(Or),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),ba=kc,Ec=O({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(r){const e=r,t=Ht();return X(),(i,n)=>(v(),C(f(re),L(e,{id:f(t).titleId}),{default:_(()=>[S(i.$slots,"default")]),_:3},16,["id"]))}}),rr=Ec,Fc=O({__name:"DialogTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r,t=Ht(),{forwardRef:i,currentElement:n}=X();return t.contentId||=yt(void 0,"reka-dialog-content"),He(()=>{t.triggerElement.value=n.value}),(s,a)=>(v(),C(f(re),L(e,{ref:f(i),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":f(t).open.value||!1,"aria-controls":f(t).open.value?f(t).contentId:void 0,"data-state":f(t).open.value?"open":"closed",onClick:f(t).onOpenToggle}),{default:_(()=>[S(s.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","onClick"]))}}),xa=Fc;const Oc="rovingFocusGroup.onEntryFocus",zc={bubbles:!1,cancelable:!0},Ic={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Tc(r,e){return e!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function Pc(r,e,t){const i=Tc(r.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Ic[i]}function Bl(r,e=!1){const t=pt();for(const i of r)if(i===t||(i.focus({preventScroll:e}),pt()!==t))return}function Rc(r,e){return r.map((t,i)=>r[(e+i)%r.length])}const[Dc,$c]=Re("RovingFocusGroup");var Lc=O({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(r,{expose:e,emit:t}){const i=r,n=t,{loop:s,orientation:a,dir:o}=vt(i),l=Un(o),u=rt(i,"currentTabStopId",n,{defaultValue:i.defaultCurrentTabStopId,passive:i.currentTabStopId===void 0}),d=z(!1),c=z(!1),h=z(0),{getItems:p,CollectionSlot:m}=sa({isProvider:!0});function g(b){const x=!c.value;if(b.currentTarget&&b.target===b.currentTarget&&x&&!d.value){const w=new CustomEvent(Oc,zc);if(b.currentTarget.dispatchEvent(w),n("entryFocus",w),!w.defaultPrevented){const A=p().map(E=>E.ref).filter(E=>E.dataset.disabled!==""),q=A.find(E=>E.getAttribute("data-active")===""),M=A.find(E=>E.getAttribute("data-highlighted")===""),B=A.find(E=>E.id===u.value),H=[q,M,B,...A].filter(Boolean);Bl(H,i.preventScrollOnEntryFocus)}}c.value=!1}function y(){setTimeout(()=>{c.value=!1},1)}return e({getItems:p}),$c({loop:s,dir:l,orientation:a,currentTabStopId:u,onItemFocus:b=>{u.value=b},onItemShiftTab:()=>{d.value=!0},onFocusableItemAdd:()=>{h.value++},onFocusableItemRemove:()=>{h.value--}}),(b,x)=>(v(),C(f(m),null,{default:_(()=>[F(f(re),{tabindex:d.value||h.value===0?-1:0,"data-orientation":f(a),as:b.as,"as-child":b.asChild,dir:f(l),style:{outline:"none"},onMousedown:x[0]||(x[0]=w=>c.value=!0),onMouseup:y,onFocus:g,onBlur:x[1]||(x[1]=w=>d.value=!1)},{default:_(()=>[S(b.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),ql=Lc,Hc=O({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){const e=r,t=Dc(),i=yt(),n=k(()=>e.tabStopId||i),s=k(()=>t.currentTabStopId.value===n.value),{getItems:a,CollectionItem:o}=sa();He(()=>{e.focusable&&t.onFocusableItemAdd()}),Mi(()=>{e.focusable&&t.onFocusableItemRemove()});function l(u){if(u.key==="Tab"&&u.shiftKey){t.onItemShiftTab();return}if(u.target!==u.currentTarget)return;const d=Pc(u,t.orientation.value,t.dir.value);if(d!==void 0){if(u.metaKey||u.ctrlKey||u.altKey||!e.allowShiftKey&&u.shiftKey)return;u.preventDefault();let c=[...a().map(h=>h.ref).filter(h=>h.dataset.disabled!=="")];if(d==="last")c.reverse();else if(d==="prev"||d==="next"){d==="prev"&&c.reverse();const h=c.indexOf(u.currentTarget);c=t.loop.value?Rc(c,h+1):c.slice(h+1)}Ye(()=>Bl(c))}}return(u,d)=>(v(),C(f(o),null,{default:_(()=>[F(f(re),{tabindex:s.value?0:-1,"data-orientation":f(t).orientation.value,"data-active":u.active?"":void 0,"data-disabled":u.focusable?void 0:"",as:u.as,"as-child":u.asChild,onMousedown:d[0]||(d[0]=c=>{u.focusable?f(t).onItemFocus(n.value):c.preventDefault()}),onFocus:d[1]||(d[1]=c=>f(t).onItemFocus(n.value)),onKeydown:l},{default:_(()=>[S(u.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),kl=Hc,Nc=O({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(r){const e=r,{primitiveElement:t,currentElement:i}=zr(),n=k(()=>e.checked??e.value);return _e(n,(s,a)=>{if(!i.value)return;const o=i.value,l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(d&&s!==a){const c=new Event("input",{bubbles:!0}),h=new Event("change",{bubbles:!0});d.call(o,s),o.dispatchEvent(c),o.dispatchEvent(h)}}),(s,a)=>(v(),C(Ir,L({ref_key:"primitiveElement",ref:t},{...e,...s.$attrs},{as:"input"}),null,16))}}),Ya=Nc,Vc=O({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(r){const e=r,t=k(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),i=k(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((n,s)=>typeof n=="object"?Object.entries(n).map(([a,o])=>({name:`${e.name}[${s}][${a}]`,value:o})):{name:`${e.name}[${s}]`,value:n}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([n,s])=>({name:`${e.name}[${n}]`,value:s})):[]);return(n,s)=>(v(),N(xe,null,[D(" We render single input if it's required "),t.value?(v(),C(Ya,L({key:n.name},{...e,...n.$attrs},{name:n.name,value:n.value}),null,16,["name","value"])):(v(!0),N(xe,{key:1},Xe(i.value,a=>(v(),C(Ya,L({key:a.name},{ref_for:!0},{...e,...n.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))],2112))}}),El=Vc;const[Uc]=Re("CheckboxGroupRoot");function Fn(r){return r==="indeterminate"}function Fl(r){return Fn(r)?"indeterminate":r?"checked":"unchecked"}const[jc,Wc]=Re("CheckboxRoot");var Gc=O({inheritAttrs:!1,__name:"CheckboxRoot",props:{defaultValue:{type:[Boolean,String],required:!1},modelValue:{type:[Boolean,String,null],required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:"on"},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{forwardRef:n,currentElement:s}=X(),a=Uc(null),o=rt(t,"modelValue",i,{defaultValue:t.defaultValue,passive:t.modelValue===void 0}),l=k(()=>a?.disabled.value||t.disabled),u=k(()=>Yi(a?.modelValue.value)?o.value==="indeterminate"?"indeterminate":o.value:Ga(a.modelValue.value,t.value));function d(){if(Yi(a?.modelValue.value))o.value=Fn(o.value)?!0:!o.value;else{const p=[...a.modelValue.value||[]];if(Ga(p,t.value)){const m=p.findIndex(g=>Ds(g,t.value));p.splice(m,1)}else p.push(t.value);a.modelValue.value=p}}const c=wl(s),h=k(()=>t.id&&s.value?document.querySelector(`[for="${t.id}"]`)?.innerText:void 0);return Wc({disabled:l,state:u}),(p,m)=>(v(),C(or(f(a)?.rovingFocus.value?f(kl):f(re)),L(p.$attrs,{id:p.id,ref:f(n),role:"checkbox","as-child":p.asChild,as:p.as,type:p.as==="button"?"button":void 0,"aria-checked":f(Fn)(u.value)?"mixed":u.value,"aria-required":p.required,"aria-label":p.$attrs["aria-label"]||h.value,"data-state":f(Fl)(u.value),"data-disabled":l.value?"":void 0,disabled:l.value,focusable:f(a)?.rovingFocus.value?!l.value:void 0,onKeydown:ht(fe(()=>{},["prevent"]),["enter"]),onClick:d}),{default:_(()=>[S(p.$slots,"default",{modelValue:f(o),state:u.value}),f(c)&&p.name&&!f(a)?(v(),C(f(El),{key:0,type:"checkbox",checked:!!u.value,name:p.name,value:p.value,disabled:l.value,required:p.required},null,8,["checked","name","value","disabled","required"])):D("v-if",!0)]),_:3},16,["id","as-child","as","type","aria-checked","aria-required","aria-label","data-state","data-disabled","disabled","focusable","onKeydown"]))}}),Kc=Gc,Xc=O({__name:"CheckboxIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){const{forwardRef:e}=X(),t=jc();return(i,n)=>(v(),C(f(Lt),{present:i.forceMount||f(Fn)(f(t).state.value)||f(t).state.value===!0},{default:_(()=>[F(f(re),L({ref:f(e),"data-state":f(Fl)(f(t).state.value),"data-disabled":f(t).disabled.value?"":void 0,style:{pointerEvents:"none"},"as-child":i.asChild,as:i.as},i.$attrs),{default:_(()=>[S(i.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),Yc=Xc;const[Ol,Jc]=Re("PopperRoot");var Zc=O({inheritAttrs:!1,__name:"PopperRoot",setup(r){const e=z();return Jc({anchor:e,onAnchorChange:t=>e.value=t}),(t,i)=>S(t.$slots,"default")}}),Pr=Zc,Qc=O({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,{forwardRef:t,currentElement:i}=X(),n=Ol();return sl(()=>{n.onAnchorChange(e.reference??i.value)}),(s,a)=>(v(),C(f(re),{ref:f(t),as:s.as,"as-child":s.asChild},{default:_(()=>[S(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),Rr=Qc;const eh={key:0,d:"M0 0L6 6L12 0"},th={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var ih=O({__name:"Arrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(re),L(e,{width:t.width,height:t.height,viewBox:t.asChild?void 0:"0 0 12 6",preserveAspectRatio:t.asChild?void 0:"none"}),{default:_(()=>[S(t.$slots,"default",{},()=>[t.rounded?(v(),N("path",th)):(v(),N("path",eh))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),rh=ih;function nh(r){return r!==null}function sh(r){return{name:"transformOrigin",options:r,fn(e){const{placement:t,rects:i,middlewareData:n}=e,a=n.arrow?.centerOffset!==0,o=a?0:r.arrowWidth,l=a?0:r.arrowHeight,[u,d]=Ls(t),c={start:"0%",center:"50%",end:"100%"}[d],h=(n.arrow?.x??0)+o/2,p=(n.arrow?.y??0)+l/2;let m="",g="";return u==="bottom"?(m=a?c:`${h}px`,g=`${-l}px`):u==="top"?(m=a?c:`${h}px`,g=`${i.floating.height+l}px`):u==="right"?(m=`${-l}px`,g=a?c:`${p}px`):u==="left"&&(m=`${i.floating.width+l}px`,g=a?c:`${p}px`),{data:{x:m,y:g}}}}}function Ls(r){const[e,t="center"]=r.split("-");return[e,t]}const ah=["top","right","bottom","left"],oi=Math.min,ot=Math.max,On=Math.round,en=Math.floor,Dt=r=>({x:r,y:r}),oh={left:"right",right:"left",bottom:"top",top:"bottom"},lh={start:"end",end:"start"};function Hs(r,e,t){return ot(r,oi(e,t))}function Yt(r,e){return typeof r=="function"?r(e):r}function Jt(r){return r.split("-")[0]}function dr(r){return r.split("-")[1]}function wa(r){return r==="x"?"y":"x"}function _a(r){return r==="y"?"height":"width"}const uh=new Set(["top","bottom"]);function Pt(r){return uh.has(Jt(r))?"y":"x"}function Ca(r){return wa(Pt(r))}function dh(r,e,t){t===void 0&&(t=!1);const i=dr(r),n=Ca(r),s=_a(n);let a=n==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=zn(a)),[a,zn(a)]}function ch(r){const e=zn(r);return[Ns(r),e,Ns(e)]}function Ns(r){return r.replace(/start|end/g,e=>lh[e])}const Ja=["left","right"],Za=["right","left"],hh=["top","bottom"],fh=["bottom","top"];function ph(r,e,t){switch(r){case"top":case"bottom":return t?e?Za:Ja:e?Ja:Za;case"left":case"right":return e?hh:fh;default:return[]}}function mh(r,e,t,i){const n=dr(r);let s=ph(Jt(r),t==="start",i);return n&&(s=s.map(a=>a+"-"+n),e&&(s=s.concat(s.map(Ns)))),s}function zn(r){return r.replace(/left|right|bottom|top/g,e=>oh[e])}function gh(r){return{top:0,right:0,bottom:0,left:0,...r}}function zl(r){return typeof r!="number"?gh(r):{top:r,right:r,bottom:r,left:r}}function In(r){const{x:e,y:t,width:i,height:n}=r;return{width:i,height:n,top:t,left:e,right:e+i,bottom:t+n,x:e,y:t}}function Qa(r,e,t){let{reference:i,floating:n}=r;const s=Pt(e),a=Ca(e),o=_a(a),l=Jt(e),u=s==="y",d=i.x+i.width/2-n.width/2,c=i.y+i.height/2-n.height/2,h=i[o]/2-n[o]/2;let p;switch(l){case"top":p={x:d,y:i.y-n.height};break;case"bottom":p={x:d,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:c};break;case"left":p={x:i.x-n.width,y:c};break;default:p={x:i.x,y:i.y}}switch(dr(e)){case"start":p[a]-=h*(t&&u?-1:1);break;case"end":p[a]+=h*(t&&u?-1:1);break}return p}const yh=async(r,e,t)=>{const{placement:i="bottom",strategy:n="absolute",middleware:s=[],platform:a}=t,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:r,floating:e,strategy:n}),{x:d,y:c}=Qa(u,i,l),h=i,p={},m=0;for(let g=0;g<o.length;g++){const{name:y,fn:b}=o[g],{x,y:w,data:A,reset:q}=await b({x:d,y:c,initialPlacement:i,placement:h,strategy:n,middlewareData:p,rects:u,platform:a,elements:{reference:r,floating:e}});d=x??d,c=w??c,p={...p,[y]:{...p[y],...A}},q&&m<=50&&(m++,typeof q=="object"&&(q.placement&&(h=q.placement),q.rects&&(u=q.rects===!0?await a.getElementRects({reference:r,floating:e,strategy:n}):q.rects),{x:d,y:c}=Qa(u,h,l)),g=-1)}return{x:d,y:c,placement:h,strategy:n,middlewareData:p}};async function Mr(r,e){var t;e===void 0&&(e={});const{x:i,y:n,platform:s,rects:a,elements:o,strategy:l}=r,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:h=!1,padding:p=0}=Yt(e,r),m=zl(p),y=o[h?c==="floating"?"reference":"floating":c],b=In(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(y)))==null||t?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:l})),x=c==="floating"?{x:i,y:n,width:a.floating.width,height:a.floating.height}:a.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),A=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},q=In(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-q.top+m.top)/A.y,bottom:(q.bottom-b.bottom+m.bottom)/A.y,left:(b.left-q.left+m.left)/A.x,right:(q.right-b.right+m.right)/A.x}}const vh=r=>({name:"arrow",options:r,async fn(e){const{x:t,y:i,placement:n,rects:s,platform:a,elements:o,middlewareData:l}=e,{element:u,padding:d=0}=Yt(r,e)||{};if(u==null)return{};const c=zl(d),h={x:t,y:i},p=Ca(n),m=_a(p),g=await a.getDimensions(u),y=p==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",A=s.reference[m]+s.reference[p]-h[p]-s.floating[m],q=h[p]-s.reference[p],M=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let B=M?M[w]:0;(!B||!await(a.isElement==null?void 0:a.isElement(M)))&&(B=o.floating[w]||s.floating[m]);const H=A/2-q/2,E=B/2-g[m]/2-1,R=oi(c[b],E),U=oi(c[x],E),W=R,te=B-g[m]-U,Q=B/2-g[m]/2+H,oe=Hs(W,Q,te),J=!l.arrow&&dr(n)!=null&&Q!==oe&&s.reference[m]/2-(Q<W?R:U)-g[m]/2<0,ee=J?Q<W?Q-W:Q-te:0;return{[p]:h[p]+ee,data:{[p]:oe,centerOffset:Q-oe-ee,...J&&{alignmentOffset:ee}},reset:J}}}),bh=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(e){var t,i;const{placement:n,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Yt(r,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const b=Jt(n),x=Pt(o),w=Jt(o)===o,A=await(l.isRTL==null?void 0:l.isRTL(u.floating)),q=h||(w||!g?[zn(o)]:ch(o)),M=m!=="none";!h&&M&&q.push(...mh(o,g,m,A));const B=[o,...q],H=await Mr(e,y),E=[];let R=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&E.push(H[b]),c){const Q=dh(n,a,A);E.push(H[Q[0]],H[Q[1]])}if(R=[...R,{placement:n,overflows:E}],!E.every(Q=>Q<=0)){var U,W;const Q=(((U=s.flip)==null?void 0:U.index)||0)+1,oe=B[Q];if(oe&&(!(c==="alignment"?x!==Pt(oe):!1)||R.every(Y=>Pt(Y.placement)===x?Y.overflows[0]>0:!0)))return{data:{index:Q,overflows:R},reset:{placement:oe}};let J=(W=R.filter(ee=>ee.overflows[0]<=0).sort((ee,Y)=>ee.overflows[1]-Y.overflows[1])[0])==null?void 0:W.placement;if(!J)switch(p){case"bestFit":{var te;const ee=(te=R.filter(Y=>{if(M){const he=Pt(Y.placement);return he===x||he==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(he=>he>0).reduce((he,se)=>he+se,0)]).sort((Y,he)=>Y[1]-he[1])[0])==null?void 0:te[0];ee&&(J=ee);break}case"initialPlacement":J=o;break}if(n!==J)return{reset:{placement:J}}}return{}}}};function eo(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function to(r){return ah.some(e=>r[e]>=0)}const xh=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...n}=Yt(r,e);switch(i){case"referenceHidden":{const s=await Mr(e,{...n,elementContext:"reference"}),a=eo(s,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:to(a)}}}case"escaped":{const s=await Mr(e,{...n,altBoundary:!0}),a=eo(s,t.floating);return{data:{escapedOffsets:a,escaped:to(a)}}}default:return{}}}}},Il=new Set(["left","top"]);async function wh(r,e){const{placement:t,platform:i,elements:n}=r,s=await(i.isRTL==null?void 0:i.isRTL(n.floating)),a=Jt(t),o=dr(t),l=Pt(t)==="y",u=Il.has(a)?-1:1,d=s&&l?-1:1,c=Yt(e,r);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return o&&typeof m=="number"&&(p=o==="end"?m*-1:m),l?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const _h=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,i;const{x:n,y:s,placement:a,middlewareData:o}=e,l=await wh(e,r);return a===((t=o.offset)==null?void 0:t.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:n+l.x,y:s+l.y,data:{...l,placement:a}}}}},Ch=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:i,placement:n}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...l}=Yt(r,e),u={x:t,y:i},d=await Mr(e,l),c=Pt(Jt(n)),h=wa(c);let p=u[h],m=u[c];if(s){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[y],w=p-d[b];p=Hs(x,p,w)}if(a){const y=c==="y"?"top":"left",b=c==="y"?"bottom":"right",x=m+d[y],w=m-d[b];m=Hs(x,m,w)}const g=o.fn({...e,[h]:p,[c]:m});return{...g,data:{x:g.x-t,y:g.y-i,enabled:{[h]:s,[c]:a}}}}}},Ah=function(r){return r===void 0&&(r={}),{options:r,fn(e){const{x:t,y:i,placement:n,rects:s,middlewareData:a}=e,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=Yt(r,e),d={x:t,y:i},c=Pt(n),h=wa(c);let p=d[h],m=d[c];const g=Yt(o,e),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=h==="y"?"height":"width",A=s.reference[h]-s.floating[w]+y.mainAxis,q=s.reference[h]+s.reference[w]-y.mainAxis;p<A?p=A:p>q&&(p=q)}if(u){var b,x;const w=h==="y"?"width":"height",A=Il.has(Jt(n)),q=s.reference[c]-s.floating[w]+(A&&((b=a.offset)==null?void 0:b[c])||0)+(A?0:y.crossAxis),M=s.reference[c]+s.reference[w]+(A?0:((x=a.offset)==null?void 0:x[c])||0)-(A?y.crossAxis:0);m<q?m=q:m>M&&(m=M)}return{[h]:p,[c]:m}}}},Sh=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,i;const{placement:n,rects:s,platform:a,elements:o}=e,{apply:l=()=>{},...u}=Yt(r,e),d=await Mr(e,u),c=Jt(n),h=dr(n),p=Pt(n)==="y",{width:m,height:g}=s.floating;let y,b;c==="top"||c==="bottom"?(y=c,b=h===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(b=c,y=h==="end"?"top":"bottom");const x=g-d.top-d.bottom,w=m-d.left-d.right,A=oi(g-d[y],x),q=oi(m-d[b],w),M=!e.middlewareData.shift;let B=A,H=q;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(H=w),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(B=x),M&&!h){const R=ot(d.left,0),U=ot(d.right,0),W=ot(d.top,0),te=ot(d.bottom,0);p?H=m-2*(R!==0||U!==0?R+U:ot(d.left,d.right)):B=g-2*(W!==0||te!==0?W+te:ot(d.top,d.bottom))}await l({...e,availableWidth:H,availableHeight:B});const E=await a.getDimensions(o.floating);return m!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function jn(){return typeof window<"u"}function qi(r){return Aa(r)?(r.nodeName||"").toLowerCase():"#document"}function ut(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Nt(r){var e;return(e=(Aa(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function Aa(r){return jn()?r instanceof Node||r instanceof ut(r).Node:!1}function Ot(r){return jn()?r instanceof Element||r instanceof ut(r).Element:!1}function $t(r){return jn()?r instanceof HTMLElement||r instanceof ut(r).HTMLElement:!1}function io(r){return!jn()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof ut(r).ShadowRoot}const Mh=new Set(["inline","contents"]);function Dr(r){const{overflow:e,overflowX:t,overflowY:i,display:n}=zt(r);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!Mh.has(n)}const Bh=new Set(["table","td","th"]);function qh(r){return Bh.has(qi(r))}const kh=[":popover-open",":modal"];function Wn(r){return kh.some(e=>{try{return r.matches(e)}catch{return!1}})}const Eh=["transform","translate","scale","rotate","perspective"],Fh=["transform","translate","scale","rotate","perspective","filter"],Oh=["paint","layout","strict","content"];function Sa(r){const e=Ma(),t=Ot(r)?zt(r):r;return Eh.some(i=>t[i]?t[i]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||Fh.some(i=>(t.willChange||"").includes(i))||Oh.some(i=>(t.contain||"").includes(i))}function zh(r){let e=li(r);for(;$t(e)&&!nr(e);){if(Sa(e))return e;if(Wn(e))return null;e=li(e)}return null}function Ma(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ih=new Set(["html","body","#document"]);function nr(r){return Ih.has(qi(r))}function zt(r){return ut(r).getComputedStyle(r)}function Gn(r){return Ot(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function li(r){if(qi(r)==="html")return r;const e=r.assignedSlot||r.parentNode||io(r)&&r.host||Nt(r);return io(e)?e.host:e}function Tl(r){const e=li(r);return nr(e)?r.ownerDocument?r.ownerDocument.body:r.body:$t(e)&&Dr(e)?e:Tl(e)}function Br(r,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=Tl(r),s=n===((i=r.ownerDocument)==null?void 0:i.body),a=ut(n);if(s){const o=Vs(a);return e.concat(a,a.visualViewport||[],Dr(n)?n:[],o&&t?Br(o):[])}return e.concat(n,Br(n,[],t))}function Vs(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function Pl(r){const e=zt(r);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const n=$t(r),s=n?r.offsetWidth:t,a=n?r.offsetHeight:i,o=On(t)!==s||On(i)!==a;return o&&(t=s,i=a),{width:t,height:i,$:o}}function Ba(r){return Ot(r)?r:r.contextElement}function Ji(r){const e=Ba(r);if(!$t(e))return Dt(1);const t=e.getBoundingClientRect(),{width:i,height:n,$:s}=Pl(e);let a=(s?On(t.width):t.width)/i,o=(s?On(t.height):t.height)/n;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const Th=Dt(0);function Rl(r){const e=ut(r);return!Ma()||!e.visualViewport?Th:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ph(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==ut(r)?!1:e}function Ai(r,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const n=r.getBoundingClientRect(),s=Ba(r);let a=Dt(1);e&&(i?Ot(i)&&(a=Ji(i)):a=Ji(r));const o=Ph(s,t,i)?Rl(s):Dt(0);let l=(n.left+o.x)/a.x,u=(n.top+o.y)/a.y,d=n.width/a.x,c=n.height/a.y;if(s){const h=ut(s),p=i&&Ot(i)?ut(i):i;let m=h,g=Vs(m);for(;g&&i&&p!==m;){const y=Ji(g),b=g.getBoundingClientRect(),x=zt(g),w=b.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,A=b.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,c*=y.y,l+=w,u+=A,m=ut(g),g=Vs(m)}}return In({width:d,height:c,x:l,y:u})}function Kn(r,e){const t=Gn(r).scrollLeft;return e?e.left+t:Ai(Nt(r)).left+t}function Dl(r,e){const t=r.getBoundingClientRect(),i=t.left+e.scrollLeft-Kn(r,t),n=t.top+e.scrollTop;return{x:i,y:n}}function Rh(r){let{elements:e,rect:t,offsetParent:i,strategy:n}=r;const s=n==="fixed",a=Nt(i),o=e?Wn(e.floating):!1;if(i===a||o&&s)return t;let l={scrollLeft:0,scrollTop:0},u=Dt(1);const d=Dt(0),c=$t(i);if((c||!c&&!s)&&((qi(i)!=="body"||Dr(a))&&(l=Gn(i)),$t(i))){const p=Ai(i);u=Ji(i),d.x=p.x+i.clientLeft,d.y=p.y+i.clientTop}const h=a&&!c&&!s?Dl(a,l):Dt(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:t.y*u.y-l.scrollTop*u.y+d.y+h.y}}function Dh(r){return Array.from(r.getClientRects())}function $h(r){const e=Nt(r),t=Gn(r),i=r.ownerDocument.body,n=ot(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=ot(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-t.scrollLeft+Kn(r);const o=-t.scrollTop;return zt(i).direction==="rtl"&&(a+=ot(e.clientWidth,i.clientWidth)-n),{width:n,height:s,x:a,y:o}}const ro=25;function Lh(r,e){const t=ut(r),i=Nt(r),n=t.visualViewport;let s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(n){s=n.width,a=n.height;const d=Ma();(!d||d&&e==="fixed")&&(o=n.offsetLeft,l=n.offsetTop)}const u=Kn(i);if(u<=0){const d=i.ownerDocument,c=d.body,h=getComputedStyle(c),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(i.clientWidth-c.clientWidth-p);m<=ro&&(s-=m)}else u<=ro&&(s+=u);return{width:s,height:a,x:o,y:l}}const Hh=new Set(["absolute","fixed"]);function Nh(r,e){const t=Ai(r,!0,e==="fixed"),i=t.top+r.clientTop,n=t.left+r.clientLeft,s=$t(r)?Ji(r):Dt(1),a=r.clientWidth*s.x,o=r.clientHeight*s.y,l=n*s.x,u=i*s.y;return{width:a,height:o,x:l,y:u}}function no(r,e,t){let i;if(e==="viewport")i=Lh(r,t);else if(e==="document")i=$h(Nt(r));else if(Ot(e))i=Nh(e,t);else{const n=Rl(r);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return In(i)}function $l(r,e){const t=li(r);return t===e||!Ot(t)||nr(t)?!1:zt(t).position==="fixed"||$l(t,e)}function Vh(r,e){const t=e.get(r);if(t)return t;let i=Br(r,[],!1).filter(o=>Ot(o)&&qi(o)!=="body"),n=null;const s=zt(r).position==="fixed";let a=s?li(r):r;for(;Ot(a)&&!nr(a);){const o=zt(a),l=Sa(a);!l&&o.position==="fixed"&&(n=null),(s?!l&&!n:!l&&o.position==="static"&&!!n&&Hh.has(n.position)||Dr(a)&&!l&&$l(r,a))?i=i.filter(d=>d!==a):n=o,a=li(a)}return e.set(r,i),i}function Uh(r){let{element:e,boundary:t,rootBoundary:i,strategy:n}=r;const a=[...t==="clippingAncestors"?Wn(e)?[]:Vh(e,this._c):[].concat(t),i],o=a[0],l=a.reduce((u,d)=>{const c=no(e,d,n);return u.top=ot(c.top,u.top),u.right=oi(c.right,u.right),u.bottom=oi(c.bottom,u.bottom),u.left=ot(c.left,u.left),u},no(e,o,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function jh(r){const{width:e,height:t}=Pl(r);return{width:e,height:t}}function Wh(r,e,t){const i=$t(e),n=Nt(e),s=t==="fixed",a=Ai(r,!0,s,e);let o={scrollLeft:0,scrollTop:0};const l=Dt(0);function u(){l.x=Kn(n)}if(i||!i&&!s)if((qi(e)!=="body"||Dr(n))&&(o=Gn(e)),i){const p=Ai(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else n&&u();s&&!i&&n&&u();const d=n&&!i&&!s?Dl(n,o):Dt(0),c=a.left+o.scrollLeft-l.x-d.x,h=a.top+o.scrollTop-l.y-d.y;return{x:c,y:h,width:a.width,height:a.height}}function os(r){return zt(r).position==="static"}function so(r,e){if(!$t(r)||zt(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return Nt(r)===t&&(t=t.ownerDocument.body),t}function Ll(r,e){const t=ut(r);if(Wn(r))return t;if(!$t(r)){let n=li(r);for(;n&&!nr(n);){if(Ot(n)&&!os(n))return n;n=li(n)}return t}let i=so(r,e);for(;i&&qh(i)&&os(i);)i=so(i,e);return i&&nr(i)&&os(i)&&!Sa(i)?t:i||zh(r)||t}const Gh=async function(r){const e=this.getOffsetParent||Ll,t=this.getDimensions,i=await t(r.floating);return{reference:Wh(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Kh(r){return zt(r).direction==="rtl"}const Xh={convertOffsetParentRelativeRectToViewportRelativeRect:Rh,getDocumentElement:Nt,getClippingRect:Uh,getOffsetParent:Ll,getElementRects:Gh,getClientRects:Dh,getDimensions:jh,getScale:Ji,isElement:Ot,isRTL:Kh};function Hl(r,e){return r.x===e.x&&r.y===e.y&&r.width===e.width&&r.height===e.height}function Yh(r,e){let t=null,i;const n=Nt(r);function s(){var o;clearTimeout(i),(o=t)==null||o.disconnect(),t=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const u=r.getBoundingClientRect(),{left:d,top:c,width:h,height:p}=u;if(o||e(),!h||!p)return;const m=en(c),g=en(n.clientWidth-(d+h)),y=en(n.clientHeight-(c+p)),b=en(d),w={rootMargin:-m+"px "+-g+"px "+-y+"px "+-b+"px",threshold:ot(0,oi(1,l))||1};let A=!0;function q(M){const B=M[0].intersectionRatio;if(B!==l){if(!A)return a();B?a(!1,B):i=setTimeout(()=>{a(!1,1e-7)},1e3)}B===1&&!Hl(u,r.getBoundingClientRect())&&a(),A=!1}try{t=new IntersectionObserver(q,{...w,root:n.ownerDocument})}catch{t=new IntersectionObserver(q,w)}t.observe(r)}return a(!0),s}function Jh(r,e,t,i){i===void 0&&(i={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=Ba(r),d=n||s?[...u?Br(u):[],...Br(e)]:[];d.forEach(b=>{n&&b.addEventListener("scroll",t,{passive:!0}),s&&b.addEventListener("resize",t)});const c=u&&o?Yh(u,t):null;let h=-1,p=null;a&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(e)})),t()}),u&&!l&&p.observe(u),p.observe(e));let m,g=l?Ai(r):null;l&&y();function y(){const b=Ai(r);g&&!Hl(g,b)&&t(),g=b,m=requestAnimationFrame(y)}return t(),()=>{var b;d.forEach(x=>{n&&x.removeEventListener("scroll",t),s&&x.removeEventListener("resize",t)}),c?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Zh=_h,Qh=Ch,ao=bh,ef=Sh,tf=xh,rf=vh,nf=Ah,sf=(r,e,t)=>{const i=new Map,n={platform:Xh,...t},s={...n.platform,_c:i};return yh(r,e,{...n,platform:s})};function af(r){return r!=null&&typeof r=="object"&&"$el"in r}function Us(r){if(af(r)){const e=r.$el;return Aa(e)&&qi(e)==="#comment"?null:e}return r}function Gi(r){return typeof r=="function"?r():f(r)}function of(r){return{name:"arrow",options:r,fn(e){const t=Us(Gi(r.element));return t==null?{}:rf({element:t,padding:r.padding}).fn(e)}}}function Nl(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function oo(r,e){const t=Nl(r);return Math.round(e*t)/t}function lf(r,e,t){t===void 0&&(t={});const i=t.whileElementsMounted,n=k(()=>{var B;return(B=Gi(t.open))!=null?B:!0}),s=k(()=>Gi(t.middleware)),a=k(()=>{var B;return(B=Gi(t.placement))!=null?B:"bottom"}),o=k(()=>{var B;return(B=Gi(t.strategy))!=null?B:"absolute"}),l=k(()=>{var B;return(B=Gi(t.transform))!=null?B:!0}),u=k(()=>Us(r.value)),d=k(()=>Us(e.value)),c=z(0),h=z(0),p=z(o.value),m=z(a.value),g=at({}),y=z(!1),b=k(()=>{const B={position:p.value,left:"0",top:"0"};if(!d.value)return B;const H=oo(d.value,c.value),E=oo(d.value,h.value);return l.value?{...B,transform:"translate("+H+"px, "+E+"px)",...Nl(d.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:H+"px",top:E+"px"}});let x;function w(){if(u.value==null||d.value==null)return;const B=n.value;sf(u.value,d.value,{middleware:s.value,placement:a.value,strategy:o.value}).then(H=>{c.value=H.x,h.value=H.y,p.value=H.strategy,m.value=H.placement,g.value=H.middlewareData,y.value=B!==!1})}function A(){typeof x=="function"&&(x(),x=void 0)}function q(){if(A(),i===void 0){w();return}if(u.value!=null&&d.value!=null){x=i(u.value,d.value,w);return}}function M(){n.value||(y.value=!1)}return _e([s,a,o,n],w,{flush:"sync"}),_e([u,d],q,{flush:"sync"}),_e(n,M,{flush:"sync"}),cd()&&hd(A),{x:Oi(c),y:Oi(h),strategy:Oi(p),placement:Oi(m),middlewareData:Oi(g),isPositioned:Oi(y),floatingStyles:b,update:w}}const Vl={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[uf,df]=Re("PopperContent");var cf=O({inheritAttrs:!1,__name:"PopperContent",props:al({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Vl}),emits:["placed"],setup(r,{emit:e}){const t=r,i=e,n=Ol(),{forwardRef:s,currentElement:a}=X(),o=z(),l=z(),{width:u,height:d}=ec(l),c=k(()=>t.side+(t.align!=="center"?`-${t.align}`:"")),h=k(()=>typeof t.collisionPadding=="number"?t.collisionPadding:{top:0,right:0,bottom:0,left:0,...t.collisionPadding}),p=k(()=>Array.isArray(t.collisionBoundary)?t.collisionBoundary:[t.collisionBoundary]),m=k(()=>({padding:h.value,boundary:p.value.filter(nh),altBoundary:p.value.length>0})),g=k(()=>({mainAxis:t.sideFlip,crossAxis:t.alignFlip})),y=fd(()=>[Zh({mainAxis:t.sideOffset+d.value,alignmentAxis:t.alignOffset}),t.prioritizePosition&&t.avoidCollisions&&ao({...m.value,...g.value}),t.avoidCollisions&&Qh({mainAxis:!0,crossAxis:!!t.prioritizePosition,limiter:t.sticky==="partial"?nf():void 0,...m.value}),!t.prioritizePosition&&t.avoidCollisions&&ao({...m.value,...g.value}),ef({...m.value,apply:({elements:W,rects:te,availableWidth:Q,availableHeight:oe})=>{const{width:J,height:ee}=te.reference,Y=W.floating.style;Y.setProperty("--reka-popper-available-width",`${Q}px`),Y.setProperty("--reka-popper-available-height",`${oe}px`),Y.setProperty("--reka-popper-anchor-width",`${J}px`),Y.setProperty("--reka-popper-anchor-height",`${ee}px`)}}),l.value&&of({element:l.value,padding:t.arrowPadding}),sh({arrowWidth:u.value,arrowHeight:d.value}),t.hideWhenDetached&&tf({strategy:"referenceHidden",...m.value})]),b=k(()=>t.reference??n.anchor.value),{floatingStyles:x,placement:w,isPositioned:A,middlewareData:q}=lf(b,o,{strategy:t.positionStrategy,placement:c,whileElementsMounted:(...W)=>Jh(...W,{layoutShift:!t.disableUpdateOnLayoutShift,animationFrame:t.updatePositionStrategy==="always"}),middleware:y}),M=k(()=>Ls(w.value)[0]),B=k(()=>Ls(w.value)[1]);sl(()=>{A.value&&i("placed")});const H=k(()=>q.value.arrow?.centerOffset!==0),E=z("");gt(()=>{a.value&&(E.value=window.getComputedStyle(a.value).zIndex)});const R=k(()=>q.value.arrow?.x??0),U=k(()=>q.value.arrow?.y??0);return df({placedSide:M,onArrowChange:W=>l.value=W,arrowX:R,arrowY:U,shouldHideArrow:H}),(W,te)=>(v(),N("div",{ref_key:"floatingRef",ref:o,"data-reka-popper-content-wrapper":"",style:qt({...f(x),transform:f(A)?f(x).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:E.value,"--reka-popper-transform-origin":[f(q).transformOrigin?.x,f(q).transformOrigin?.y].join(" "),...f(q).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[F(f(re),L({ref:f(s)},W.$attrs,{"as-child":t.asChild,as:W.as,"data-side":M.value,"data-align":B.value,style:{animation:f(A)?void 0:"none"}}),{default:_(()=>[S(W.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Xn=cf;const hf={top:"bottom",right:"left",bottom:"top",left:"right"};var ff=O({inheritAttrs:!1,__name:"PopperArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const{forwardRef:e}=X(),t=uf(),i=k(()=>hf[t.placedSide.value]);return(n,s)=>(v(),N("span",{ref:a=>{f(t).onArrowChange(a)},style:qt({position:"absolute",left:f(t).arrowX?.value?`${f(t).arrowX?.value}px`:void 0,top:f(t).arrowY?.value?`${f(t).arrowY?.value}px`:void 0,[i.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f(t).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f(t).placedSide.value],visibility:f(t).shouldHideArrow.value?"hidden":void 0})},[F(rh,L(n.$attrs,{ref:f(e),style:{display:"block"},as:n.as,"as-child":n.asChild,rounded:n.rounded,width:n.width,height:n.height}),{default:_(()=>[S(n.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),Yn=ff,pf=O({__name:"MenuAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(Rr),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Ul=pf,mf=O({__name:"MenuArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(Yn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),gf=mf;function yf(){const r=z(!1);return He(()=>{si("keydown",()=>{r.value=!0},{capture:!0,passive:!0}),si(["pointerdown","pointermove"],()=>{r.value=!1},{capture:!0,passive:!0})}),r}const vf=tl(yf),[ki,jl]=Re(["MenuRoot","MenuSub"],"MenuContext"),[$r,bf]=Re("MenuRoot");var xf=O({__name:"MenuRoot",props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=e,{modal:n,dir:s}=vt(t),a=Un(s),o=rt(t,"open",i),l=z(),u=vf();return jl({open:o,onOpenChange:d=>{o.value=d},content:l,onContentChange:d=>{l.value=d}}),bf({onClose:()=>{o.value=!1},isUsingKeyboardRef:u,dir:a,modal:n}),(d,c)=>(v(),C(f(Pr),null,{default:_(()=>[S(d.$slots,"default")]),_:3}))}}),wf=xf;const[qa,_f]=Re("MenuContent");var Cf=O({__name:"MenuContentImpl",props:al({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Vl}),emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus","dismiss"],setup(r,{emit:e}){const t=r,i=e,n=ki(),s=$r(),{trapFocus:a,disableOutsidePointerEvents:o,loop:l}=vt(t);xl(),ha(o.value);const u=z(""),d=z(0),c=z(0),h=z(null),p=z("right"),m=z(0),g=z(null),y=z(),{forwardRef:b,currentElement:x}=X(),{handleTypeaheadSearch:w}=tc();_e(x,E=>{n.onContentChange(E)}),Mi(()=>{window.clearTimeout(d.value)});function A(E){return p.value===h.value?.side&&vc(E,h.value?.area)}async function q(E){i("openAutoFocus",E),!E.defaultPrevented&&(E.preventDefault(),x.value?.focus({preventScroll:!0}))}function M(E){if(E.defaultPrevented)return;const U=E.target.closest("[data-reka-menu-content]")===E.currentTarget,W=E.ctrlKey||E.altKey||E.metaKey,te=E.key.length===1,Q=Ld(E,pt(),x.value,{loop:l.value,arrowKeyOptions:"vertical",dir:s?.dir.value,focus:!0,attributeName:"[data-reka-collection-item]:not([data-disabled])"});if(Q)return Q?.focus();if(E.code==="Space")return;const oe=y.value?.getItems()??[];if(U&&(E.key==="Tab"&&E.preventDefault(),!W&&te&&w(E.key,oe)),E.target!==x.value||!fc.includes(E.key))return;E.preventDefault();const J=[...oe.map(ee=>ee.ref)];Sl.includes(E.key)&&J.reverse(),gc(J)}function B(E){E?.currentTarget?.contains?.(E.target)||(window.clearTimeout(d.value),u.value="")}function H(E){if(!Sr(E))return;const R=E.target,U=m.value!==E.clientX;if(E?.currentTarget?.contains(R)&&U){const W=E.clientX>m.value?"right":"left";p.value=W,m.value=E.clientX}}return _f({onItemEnter:E=>!!A(E),onItemLeave:E=>{A(E)||(x.value?.focus(),g.value=null)},onTriggerLeave:E=>!!A(E),searchRef:u,pointerGraceTimerRef:c,onPointerGraceIntentChange:E=>{h.value=E}}),(E,R)=>(v(),C(f(ma),{"as-child":"",trapped:f(a),onMountAutoFocus:q,onUnmountAutoFocus:R[7]||(R[7]=U=>i("closeAutoFocus",U))},{default:_(()=>[F(f(Fr),{"as-child":"","disable-outside-pointer-events":f(o),onEscapeKeyDown:R[2]||(R[2]=U=>i("escapeKeyDown",U)),onPointerDownOutside:R[3]||(R[3]=U=>i("pointerDownOutside",U)),onFocusOutside:R[4]||(R[4]=U=>i("focusOutside",U)),onInteractOutside:R[5]||(R[5]=U=>i("interactOutside",U)),onDismiss:R[6]||(R[6]=U=>i("dismiss"))},{default:_(()=>[F(f(ql),{ref_key:"rovingFocusGroupRef",ref:y,"current-tab-stop-id":g.value,"onUpdate:currentTabStopId":R[0]||(R[0]=U=>g.value=U),"as-child":"",orientation:"vertical",dir:f(s).dir.value,loop:f(l),onEntryFocus:R[1]||(R[1]=U=>{i("entryFocus",U),f(s).isUsingKeyboardRef.value||U.preventDefault()})},{default:_(()=>[F(f(Xn),{ref:f(b),role:"menu",as:E.as,"as-child":E.asChild,"aria-orientation":"vertical","data-reka-menu-content":"","data-state":f(ga)(f(n).open.value),dir:f(s).dir.value,side:E.side,"side-offset":E.sideOffset,align:E.align,"align-offset":E.alignOffset,"avoid-collisions":E.avoidCollisions,"collision-boundary":E.collisionBoundary,"collision-padding":E.collisionPadding,"arrow-padding":E.arrowPadding,"prioritize-position":E.prioritizePosition,"position-strategy":E.positionStrategy,"update-position-strategy":E.updatePositionStrategy,sticky:E.sticky,"hide-when-detached":E.hideWhenDetached,reference:E.reference,onKeydown:M,onBlur:B,onPointermove:H},{default:_(()=>[S(E.$slots,"default")]),_:3},8,["as","as-child","data-state","dir","side","side-offset","align","align-offset","avoid-collisions","collision-boundary","collision-padding","arrow-padding","prioritize-position","position-strategy","update-position-strategy","sticky","hide-when-detached","reference"])]),_:3},8,["current-tab-stop-id","dir","loop"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),ka=Cf,Af=O({inheritAttrs:!1,__name:"MenuItemImpl",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,t=qa(),{forwardRef:i}=X(),{CollectionItem:n}=sa(),s=z(!1);async function a(l){l.defaultPrevented||Sr(l)&&(e.disabled?t.onItemLeave(l):t.onItemEnter(l)||l.currentTarget?.focus({preventScroll:!0}))}async function o(l){await Ye(),!l.defaultPrevented&&Sr(l)&&t.onItemLeave(l)}return(l,u)=>(v(),C(f(n),{value:{textValue:l.textValue}},{default:_(()=>[F(f(re),L({ref:f(i),role:"menuitem",tabindex:"-1"},l.$attrs,{as:l.as,"as-child":l.asChild,"aria-disabled":l.disabled||void 0,"data-disabled":l.disabled?"":void 0,"data-highlighted":s.value?"":void 0,onPointermove:a,onPointerleave:o,onFocus:u[0]||(u[0]=async d=>{await Ye(),!(d.defaultPrevented||l.disabled)&&(s.value=!0)}),onBlur:u[1]||(u[1]=async d=>{await Ye(),!d.defaultPrevented&&(s.value=!1)})}),{default:_(()=>[S(l.$slots,"default")]),_:3},16,["as","as-child","aria-disabled","data-disabled","data-highlighted"])]),_:3},8,["value"]))}}),Wl=Af,Sf=O({__name:"MenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(r,{emit:e}){const t=r,i=e,{forwardRef:n,currentElement:s}=X(),a=$r(),o=qa(),l=z(!1);async function u(){const d=s.value;if(!t.disabled&&d){const c=new CustomEvent(cc,{bubbles:!0,cancelable:!0});i("select",c),await Ye(),c.defaultPrevented?l.value=!1:a.onClose()}}return(d,c)=>(v(),C(Wl,L(t,{ref:f(n),onClick:u,onPointerdown:c[0]||(c[0]=()=>{l.value=!0}),onPointerup:c[1]||(c[1]=async h=>{await Ye(),!h.defaultPrevented&&(l.value||h.currentTarget?.click())}),onKeydown:c[2]||(c[2]=async h=>{const p=f(o).searchRef.value!=="";d.disabled||p&&h.key===" "||f($s).includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}),{default:_(()=>[S(d.$slots,"default")]),_:3},16))}}),Ea=Sf;const[Mf,Gl]=Re(["MenuCheckboxItem","MenuRadioItem"],"MenuItemIndicatorContext");var Bf=O({__name:"MenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){const e=Mf({modelValue:z(!1)});return(t,i)=>(v(),C(f(Lt),{present:t.forceMount||f(kn)(f(e).modelValue.value)||f(e).modelValue.value===!0},{default:_(()=>[F(f(re),{as:t.as,"as-child":t.asChild,"data-state":f(ya)(f(e).modelValue.value)},{default:_(()=>[S(t.$slots,"default")]),_:3},8,["as","as-child","data-state"])]),_:3},8,["present"]))}}),qf=Bf,kf=O({__name:"MenuCheckboxItem",props:{modelValue:{type:[Boolean,String],required:!1,default:!1},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select","update:modelValue"],setup(r,{emit:e}){const t=r,i=e,n=Vn(t,["modelValue"]),s=Zt(n),a=rt(t,"modelValue",i);return Gl({modelValue:a}),(o,l)=>(v(),C(Ea,L({role:"menuitemcheckbox"},f(s),{"aria-checked":f(kn)(f(a))?"mixed":f(a),"data-state":f(ya)(f(a)),onSelect:l[0]||(l[0]=async u=>{i("select",u),f(kn)(f(a))?a.value=!0:a.value=!f(a)})}),{default:_(()=>[S(o.$slots,"default",{modelValue:f(a)})]),_:3},16,["aria-checked","data-state"]))}}),Ef=kf,Ff=O({__name:"MenuRootContentModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=Ce(t,i),s=ki(),{forwardRef:a,currentElement:o}=X();return fa(o),(l,u)=>(v(),C(ka,L(f(n),{ref:f(a),"trap-focus":f(s).open.value,"disable-outside-pointer-events":f(s).open.value,"disable-outside-scroll":!0,onDismiss:u[0]||(u[0]=d=>f(s).onOpenChange(!1)),onFocusOutside:u[1]||(u[1]=fe(d=>i("focusOutside",d),["prevent"]))}),{default:_(()=>[S(l.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),Of=Ff,zf=O({__name:"MenuRootContentNonModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const n=Ce(r,e),s=ki();return(a,o)=>(v(),C(ka,L(f(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:o[0]||(o[0]=l=>f(s).onOpenChange(!1))}),{default:_(()=>[S(a.$slots,"default")]),_:3},16))}}),If=zf,Tf=O({__name:"MenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const n=Ce(r,e),s=ki(),a=$r();return(o,l)=>(v(),C(f(Lt),{present:o.forceMount||f(s).open.value},{default:_(()=>[f(a).modal.value?(v(),C(Of,ae(L({key:0},{...o.$attrs,...f(n)})),{default:_(()=>[S(o.$slots,"default")]),_:3},16)):(v(),C(If,ae(L({key:1},{...o.$attrs,...f(n)})),{default:_(()=>[S(o.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Pf=Tf,Rf=O({__name:"MenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(re),L({role:"group"},e),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Kl=Rf,Df=O({__name:"MenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(r){const e=r;return(t,i)=>(v(),C(f(re),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),$f=Df,Lf=O({__name:"MenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(Or),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Hf=Lf;const[Nf,Vf]=Re("MenuRadioGroup");var Uf=O({__name:"MenuRadioGroup",props:{modelValue:{type:String,required:!1,default:""},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,i=e,n=Vn(t,["modelValue"]),s=Zt(n),a=rt(t,"modelValue",i);return Vf({modelValue:a,onValueChange:o=>{a.value=o}}),(o,l)=>(v(),C(Kl,ae(le(f(s))),{default:_(()=>[S(o.$slots,"default",{modelValue:f(a)})]),_:3},16))}}),jf=Uf,Wf=O({__name:"MenuRadioItem",props:{value:{type:String,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(r,{emit:e}){const t=r,i=e,n=Vn(t,["value"]),s=Zt(n),{value:a}=vt(t),o=Nf(),l=k(()=>o.modelValue.value===a?.value);return Gl({modelValue:l}),(u,d)=>(v(),C(Ea,L({role:"menuitemradio"},f(s),{"aria-checked":l.value,"data-state":f(ya)(l.value),onSelect:d[0]||(d[0]=async c=>{i("select",c),f(o).onValueChange(f(a))})}),{default:_(()=>[S(u.$slots,"default")]),_:3},16,["aria-checked","data-state"]))}}),Gf=Wf,Kf=O({__name:"MenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(re),L(e,{role:"separator","aria-orientation":"horizontal"}),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Xf=Kf;const[Xl,Yf]=Re("MenuSub");var Jf=O({__name:"MenuSub",props:{open:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(r,{emit:e}){const t=r,n=rt(t,"open",e,{defaultValue:!1,passive:t.open===void 0}),s=ki(),a=z(),o=z();return gt(l=>{s?.open.value===!1&&(n.value=!1),l(()=>n.value=!1)}),jl({open:n,onOpenChange:l=>{n.value=l},content:o,onContentChange:l=>{o.value=l}}),Yf({triggerId:"",contentId:"",trigger:a,onTriggerChange:l=>{a.value=l}}),(l,u)=>(v(),C(f(Pr),null,{default:_(()=>[S(l.$slots,"default")]),_:3}))}}),Zf=Jf,Qf=O({__name:"MenuSubContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1,default:!0},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const n=Ce(r,e),s=ki(),a=$r(),o=Xl(),{forwardRef:l,currentElement:u}=X();return o.contentId||=yt(void 0,"reka-menu-sub-content"),(d,c)=>(v(),C(f(Lt),{present:d.forceMount||f(s).open.value},{default:_(()=>[F(ka,L(f(n),{id:f(o).contentId,ref:f(l),"aria-labelledby":f(o).triggerId,align:"start",side:f(a).dir.value==="rtl"?"left":"right","disable-outside-pointer-events":!1,"disable-outside-scroll":!1,"trap-focus":!1,onOpenAutoFocus:c[0]||(c[0]=fe(h=>{f(a).isUsingKeyboardRef.value&&f(u)?.focus()},["prevent"])),onCloseAutoFocus:c[1]||(c[1]=fe(()=>{},["prevent"])),onFocusOutside:c[2]||(c[2]=h=>{h.defaultPrevented||h.target!==f(o).trigger.value&&f(s).onOpenChange(!1)}),onEscapeKeyDown:c[3]||(c[3]=h=>{f(a).onClose(),h.preventDefault()}),onKeydown:c[4]||(c[4]=h=>{const p=h.currentTarget?.contains(h.target),m=f(mc)[f(a).dir.value].includes(h.key);p&&m&&(f(s).onOpenChange(!1),f(o).trigger.value?.focus(),h.preventDefault())})}),{default:_(()=>[S(d.$slots,"default")]),_:3},16,["id","aria-labelledby","side"])]),_:3},8,["present"]))}}),ep=Qf,tp=O({__name:"MenuSubTrigger",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,t=ki(),i=$r(),n=Xl(),s=qa(),a=z(null);n.triggerId||=yt(void 0,"reka-menu-sub-trigger");function o(){a.value&&window.clearTimeout(a.value),a.value=null}Mi(()=>{o()});function l(c){!Sr(c)||s.onItemEnter(c)||!e.disabled&&!t.open.value&&!a.value&&(s.onPointerGraceIntentChange(null),a.value=window.setTimeout(()=>{t.onOpenChange(!0),o()},100))}async function u(c){if(!Sr(c))return;o();const h=t.content.value?.getBoundingClientRect();if(h?.width){const p=t.content.value?.dataset.side,m=p==="right",g=m?-5:5,y=h[m?"left":"right"],b=h[m?"right":"left"];s.onPointerGraceIntentChange({area:[{x:c.clientX+g,y:c.clientY},{x:y,y:h.top},{x:b,y:h.top},{x:b,y:h.bottom},{x:y,y:h.bottom}],side:p}),window.clearTimeout(s.pointerGraceTimerRef.value),s.pointerGraceTimerRef.value=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(c))return;s.onPointerGraceIntentChange(null)}}async function d(c){const h=s.searchRef.value!=="";e.disabled||h&&c.key===" "||pc[i.dir.value].includes(c.key)&&(t.onOpenChange(!0),await Ye(),t.content.value?.focus(),c.preventDefault())}return(c,h)=>(v(),C(Ul,{"as-child":""},{default:_(()=>[F(Wl,L(e,{id:f(n).triggerId,ref:p=>{f(n)?.onTriggerChange(p?.$el)},"aria-haspopup":"menu","aria-expanded":f(t).open.value,"aria-controls":f(n).contentId,"data-state":f(ga)(f(t).open.value),onClick:h[0]||(h[0]=async p=>{e.disabled||p.defaultPrevented||(p.currentTarget.focus(),f(t).open.value||f(t).onOpenChange(!0))}),onPointermove:l,onPointerleave:u,onKeydown:d}),{default:_(()=>[S(c.$slots,"default")]),_:3},16,["id","aria-expanded","aria-controls","data-state"])]),_:3}))}}),ip=tp;const[Ei,rp]=Re("PopoverRoot");var np=O({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=e,{modal:n}=vt(t),s=rt(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0}),a=z(),o=z(!1);return rp({contentId:"",triggerId:"",modal:n,open:s,onOpenChange:l=>{s.value=l},onOpenToggle:()=>{s.value=!s.value},triggerElement:a,hasCustomAnchor:o}),(l,u)=>(v(),C(f(Pr),null,{default:_(()=>[S(l.$slots,"default",{open:f(s),close:()=>s.value=!1})]),_:3}))}}),sp=np,ap=O({__name:"PopoverAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;X();const t=Ei();return pd(()=>{t.hasCustomAnchor.value=!0}),Mi(()=>{t.hasCustomAnchor.value=!1}),(i,n)=>(v(),C(f(Rr),ae(le(e)),{default:_(()=>[S(i.$slots,"default")]),_:3},16))}}),op=ap,lp=O({__name:"PopoverArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(Yn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),up=lp,dp=O({__name:"PopoverClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r;X();const t=Ei();return(i,n)=>(v(),C(f(re),{type:i.as==="button"?"button":void 0,as:i.as,"as-child":e.asChild,onClick:n[0]||(n[0]=s=>f(t).onOpenChange(!1))},{default:_(()=>[S(i.$slots,"default")]),_:3},8,["type","as","as-child"]))}}),cp=dp,hp=O({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=Zt(Vn(t,"trapFocus","disableOutsidePointerEvents")),{forwardRef:s}=X(),a=Ei();return xl(),(o,l)=>(v(),C(f(ma),{"as-child":"",loop:"",trapped:o.trapFocus,onMountAutoFocus:l[5]||(l[5]=u=>i("openAutoFocus",u)),onUnmountAutoFocus:l[6]||(l[6]=u=>i("closeAutoFocus",u))},{default:_(()=>[F(f(Fr),{"as-child":"","disable-outside-pointer-events":o.disableOutsidePointerEvents,onPointerDownOutside:l[0]||(l[0]=u=>i("pointerDownOutside",u)),onInteractOutside:l[1]||(l[1]=u=>i("interactOutside",u)),onEscapeKeyDown:l[2]||(l[2]=u=>i("escapeKeyDown",u)),onFocusOutside:l[3]||(l[3]=u=>i("focusOutside",u)),onDismiss:l[4]||(l[4]=u=>f(a).onOpenChange(!1))},{default:_(()=>[F(f(Xn),L(f(n),{id:f(a).contentId,ref:f(s),"data-state":f(a).open.value?"open":"closed","aria-labelledby":f(a).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:_(()=>[S(o.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),Yl=hp,fp=O({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=Ei(),s=z(!1);ha(!0);const a=Ce(t,i),{forwardRef:o,currentElement:l}=X();return fa(l),(u,d)=>(v(),C(Yl,L(f(a),{ref:f(o),"trap-focus":f(n).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:d[0]||(d[0]=fe(c=>{i("closeAutoFocus",c),s.value||f(n).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:d[1]||(d[1]=c=>{i("pointerDownOutside",c);const h=c.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,m=h.button===2||p;s.value=m}),onFocusOutside:d[2]||(d[2]=fe(()=>{},["prevent"]))}),{default:_(()=>[S(u.$slots,"default")]),_:3},16,["trap-focus"]))}}),pp=fp,mp=O({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=Ei(),s=z(!1),a=z(!1),o=Ce(t,i);return(l,u)=>(v(),C(Yl,L(f(o),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:u[0]||(u[0]=d=>{i("closeAutoFocus",d),d.defaultPrevented||(s.value||f(n).triggerElement.value?.focus(),d.preventDefault()),s.value=!1,a.value=!1}),onInteractOutside:u[1]||(u[1]=async d=>{i("interactOutside",d),d.defaultPrevented||(s.value=!0,d.detail.originalEvent.type==="pointerdown"&&(a.value=!0));const c=d.target;f(n).triggerElement.value?.contains(c)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&a.value&&d.preventDefault()})}),{default:_(()=>[S(l.$slots,"default")]),_:3},16))}}),gp=mp,yp=O({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=Ei(),s=Ce(t,i),{forwardRef:a}=X();return n.contentId||=yt(void 0,"reka-popover-content"),(o,l)=>(v(),C(f(Lt),{present:o.forceMount||f(n).open.value},{default:_(()=>[f(n).modal.value?(v(),C(pp,L({key:0},f(s),{ref:f(a)}),{default:_(()=>[S(o.$slots,"default")]),_:3},16)):(v(),C(gp,L({key:1},f(s),{ref:f(a)}),{default:_(()=>[S(o.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),vp=yp,bp=O({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(Or),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),xp=bp,wp=O({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r,t=Ei(),{forwardRef:i,currentElement:n}=X();return t.triggerId||=yt(void 0,"reka-popover-trigger"),He(()=>{t.triggerElement.value=n.value}),(s,a)=>(v(),C(or(f(t).hasCustomAnchor.value?f(re):f(Rr)),{"as-child":""},{default:_(()=>[F(f(re),{id:f(t).triggerId,ref:f(i),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":f(t).open.value,"aria-controls":f(t).contentId,"data-state":f(t).open.value?"open":"closed",as:s.as,"as-child":e.asChild,onClick:f(t).onOpenToggle},{default:_(()=>[S(s.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),_p=wp,Cp=O({__name:"DropdownMenuArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(gf),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Jl=Cp,Ap=O({__name:"DropdownMenuCheckboxItem",props:{modelValue:{type:[Boolean,String],required:!1},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select","update:modelValue"],setup(r,{emit:e}){const t=r,n=ar(e);return X(),(s,a)=>(v(),C(f(Ef),ae(le({...t,...f(n)})),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),Sp=Ap;const[Zl,Mp]=Re("DropdownMenuRoot");var Bp=O({__name:"DropdownMenuRoot",props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=e;X();const n=rt(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0}),s=z(),{modal:a,dir:o}=vt(t),l=Un(o);return Mp({open:n,onOpenChange:u=>{n.value=u},onOpenToggle:()=>{n.value=!n.value},triggerId:"",triggerElement:s,contentId:"",modal:a,dir:l}),(u,d)=>(v(),C(f(wf),{open:f(n),"onUpdate:open":d[0]||(d[0]=c=>ol(n)?n.value=c:null),dir:f(l),modal:f(a)},{default:_(()=>[S(u.$slots,"default",{open:f(n)})]),_:3},8,["open","dir","modal"]))}}),Ql=Bp,qp=O({__name:"DropdownMenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(r,{emit:e}){const n=Ce(r,e);X();const s=Zl(),a=z(!1);function o(l){l.defaultPrevented||(a.value||setTimeout(()=>{s.triggerElement.value?.focus()},0),a.value=!1,l.preventDefault())}return s.contentId||=yt(void 0,"reka-dropdown-menu-content"),(l,u)=>(v(),C(f(Pf),L(f(n),{id:f(s).contentId,"aria-labelledby":f(s)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-dropdown-menu-content-available-width":"var(--reka-popper-available-width)","--reka-dropdown-menu-content-available-height":"var(--reka-popper-available-height)","--reka-dropdown-menu-trigger-width":"var(--reka-popper-anchor-width)","--reka-dropdown-menu-trigger-height":"var(--reka-popper-anchor-height)"},onCloseAutoFocus:o,onInteractOutside:u[0]||(u[0]=d=>{if(d.defaultPrevented)return;const c=d.detail.originalEvent,h=c.button===0&&c.ctrlKey===!0,p=c.button===2||h;(!f(s).modal.value||p)&&(a.value=!0),f(s).triggerElement.value?.contains(d.target)&&d.preventDefault()})}),{default:_(()=>[S(l.$slots,"default")]),_:3},16,["id","aria-labelledby"]))}}),kp=qp,Ep=O({__name:"DropdownMenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(Kl),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Fp=Ep,Op=O({__name:"DropdownMenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(r,{emit:e}){const t=r,n=ar(e);return X(),(s,a)=>(v(),C(f(Ea),ae(le({...t,...f(n)})),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),zp=Op,Ip=O({__name:"DropdownMenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(qf),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Tp=Ip,Pp=O({__name:"DropdownMenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f($f),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Rp=Pp,Dp=O({__name:"DropdownMenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(Hf),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),$p=Dp,Lp=O({__name:"DropdownMenuRadioGroup",props:{modelValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=ar(e);return X(),(s,a)=>(v(),C(f(jf),ae(le({...t,...f(n)})),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),Hp=Lp,Np=O({__name:"DropdownMenuRadioItem",props:{value:{type:String,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(r,{emit:e}){const n=Ce(r,e);return X(),(s,a)=>(v(),C(f(Gf),ae(le(f(n))),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),Vp=Np,Up=O({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(Xf),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),jp=Up,Wp=O({__name:"DropdownMenuSub",props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(r,{emit:e}){const t=r,n=rt(t,"open",e,{passive:t.open===void 0,defaultValue:t.defaultOpen??!1});return X(),(s,a)=>(v(),C(f(Zf),{open:f(n),"onUpdate:open":a[0]||(a[0]=o=>ol(n)?n.value=o:null)},{default:_(()=>[S(s.$slots,"default",{open:f(n)})]),_:3},8,["open"]))}}),Gp=Wp,Kp=O({__name:"DropdownMenuSubContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const n=Ce(r,e);return X(),(s,a)=>(v(),C(f(ep),L(f(n),{style:{"--reka-dropdown-menu-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-dropdown-menu-content-available-width":"var(--reka-popper-available-width)","--reka-dropdown-menu-content-available-height":"var(--reka-popper-available-height)","--reka-dropdown-menu-trigger-width":"var(--reka-popper-anchor-width)","--reka-dropdown-menu-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),Xp=Kp,Yp=O({__name:"DropdownMenuSubTrigger",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(ip),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Jp=Yp,Zp=O({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r,t=Zl(),{forwardRef:i,currentElement:n}=X();return He(()=>{t.triggerElement=n}),t.triggerId||=yt(void 0,"reka-dropdown-menu-trigger"),(s,a)=>(v(),C(f(Ul),{"as-child":""},{default:_(()=>[F(f(re),{id:f(t).triggerId,ref:f(i),type:s.as==="button"?"button":void 0,"as-child":e.asChild,as:s.as,"aria-haspopup":"menu","aria-expanded":f(t).open.value,"aria-controls":f(t).open.value?f(t).contentId:void 0,"data-disabled":s.disabled?"":void 0,disabled:s.disabled,"data-state":f(t).open.value?"open":"closed",onClick:a[0]||(a[0]=async o=>{!s.disabled&&o.button===0&&o.ctrlKey===!1&&(f(t)?.onOpenToggle(),await Ye(),f(t).open.value&&o.preventDefault())}),onKeydown:a[1]||(a[1]=ht(o=>{s.disabled||(["Enter"," "].includes(o.key)&&f(t).onOpenToggle(),o.key==="ArrowDown"&&f(t).onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())},["enter","space","arrow-down"]))},{default:_(()=>[S(s.$slots,"default")]),_:3},8,["id","type","as-child","as","aria-expanded","aria-controls","data-disabled","disabled","data-state"])]),_:3}))}}),eu=Zp,Qp=O({__name:"HoverCardArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(Yn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),em=Qp;const[Fa,tm]=Re("HoverCardRoot");var im=O({__name:"HoverCardRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},openDelay:{type:Number,required:!1,default:700},closeDelay:{type:Number,required:!1,default:300}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=e,{openDelay:n,closeDelay:s}=vt(t);X();const a=rt(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0}),o=z(0),l=z(0),u=z(!1),d=z(!1),c=z(!1),h=z();function p(){clearTimeout(l.value),o.value=window.setTimeout(()=>a.value=!0,n.value)}function m(){clearTimeout(o.value),!u.value&&!d.value&&(l.value=window.setTimeout(()=>a.value=!1,s.value))}function g(){a.value=!1}return tm({open:a,onOpenChange(y){a.value=y},onOpen:p,onClose:m,onDismiss:g,hasSelectionRef:u,isPointerDownOnContentRef:d,isPointerInTransitRef:c,triggerElement:h}),(y,b)=>(v(),C(f(Pr),null,{default:_(()=>[S(y.$slots,"default",{open:f(a)})]),_:3}))}}),rm=im;function js(r){return e=>e.pointerType==="touch"?void 0:r()}function nm(r){const e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();)e.push(t.currentNode);return e}var sm=O({__name:"HoverCardContentImpl",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(r,{emit:e}){const t=r,i=e,n=Zt(t),{forwardRef:s,currentElement:a}=X(),o=Fa(),{isPointerInTransit:l,onPointerExit:u}=_l(o.triggerElement,a);md(o.isPointerInTransitRef,l,{direction:"rtl"}),u(()=>{o.onClose()});const d=z(!1);let c;gt(p=>{if(d.value){const m=document.body;c=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",p(()=>{m.style.userSelect=c,m.style.webkitUserSelect=c})}});function h(){d.value=!1,o.isPointerDownOnContentRef.value=!1,Ye(()=>{document.getSelection()?.toString()!==""&&(o.hasSelectionRef.value=!0)})}return He(()=>{a.value&&(document.addEventListener("pointerup",h),nm(a.value).forEach(m=>m.setAttribute("tabindex","-1")))}),Mi(()=>{document.removeEventListener("pointerup",h),o.hasSelectionRef.value=!1,o.isPointerDownOnContentRef.value=!1}),(p,m)=>(v(),C(f(Fr),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:m[1]||(m[1]=g=>i("escapeKeyDown",g)),onPointerDownOutside:m[2]||(m[2]=g=>i("pointerDownOutside",g)),onFocusOutside:m[3]||(m[3]=fe(g=>i("focusOutside",g),["prevent"])),onDismiss:f(o).onDismiss},{default:_(()=>[F(f(Xn),L({...f(n),...p.$attrs},{ref:f(s),"data-state":f(o).open.value?"open":"closed",style:{userSelect:d.value?"text":void 0,WebkitUserSelect:d.value?"text":void 0,"--reka-hover-card-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-hover-card-content-available-width":"var(--reka-popper-available-width)","--reka-hover-card-content-available-height":"var(--reka-popper-available-height)","--reka-hover-card-trigger-width":"var(--reka-popper-anchor-width)","--reka-hover-card-trigger-height":"var(--reka-popper-anchor-height)"},onPointerdown:m[0]||(m[0]=g=>{g.currentTarget.contains(g.target)&&(d.value=!0),f(o).hasSelectionRef.value=!1,f(o).isPointerDownOnContentRef.value=!0})}),{default:_(()=>[S(p.$slots,"default")]),_:3},16,["data-state","style"])]),_:3},8,["onDismiss"]))}}),am=sm,om=O({__name:"HoverCardContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(r,{emit:e}){const n=Ce(r,e),{forwardRef:s}=X(),a=Fa();return(o,l)=>(v(),C(f(Lt),{present:o.forceMount||f(a).open.value},{default:_(()=>[F(am,L(f(n),{ref:f(s),onPointerenter:l[0]||(l[0]=u=>f(js)(f(a).onOpen)(u))}),{default:_(()=>[S(o.$slots,"default")]),_:3},16)]),_:3},8,["present"]))}}),lm=om,um=O({__name:"HoverCardPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(Or),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),dm=um,cm=O({__name:"HoverCardTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"a"}},setup(r){const{forwardRef:e,currentElement:t}=X(),i=Fa();i.triggerElement=t;function n(){setTimeout(()=>{!i.isPointerInTransitRef.value&&!i.open.value&&i.onClose()},0)}return(s,a)=>(v(),C(f(Rr),{"as-child":"",reference:s.reference},{default:_(()=>[F(f(re),{ref:f(e),"as-child":s.asChild,as:s.as,"data-state":f(i).open.value?"open":"closed","data-grace-area-trigger":"",onPointerenter:a[0]||(a[0]=o=>f(js)(f(i).onOpen)(o)),onPointerleave:a[1]||(a[1]=o=>f(js)(n)(o)),onFocus:a[2]||(a[2]=o=>f(i).onOpen()),onBlur:a[3]||(a[3]=o=>f(i).onClose())},{default:_(()=>[S(s.$slots,"default")]),_:3},8,["as-child","as","data-state"])]),_:3},8,["reference"]))}}),hm=cm,fm=O({__name:"Label",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"label"}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(re),L(e,{onMousedown:i[0]||(i[0]=n=>{!n.defaultPrevented&&n.detail>1&&n.preventDefault()})}),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),lo=fm;let ls=new Map,Ws=!1;try{Ws=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let Tn=!1;try{Tn=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const tu={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class iu{format(e){let t="";if(!Ws&&this.options.signDisplay!=null?t=mm(this.numberFormatter,this.options.signDisplay,e):t=this.numberFormatter.format(e),this.options.style==="unit"&&!Tn){var i;let{unit:n,unitDisplay:s="short",locale:a}=this.resolvedOptions();if(!n)return t;let o=(i=tu[n])===null||i===void 0?void 0:i[s];t+=o[a]||o.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,t);if(t<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} – ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw new RangeError("End date must be >= start date");let i=this.numberFormatter.formatToParts(e),n=this.numberFormatter.formatToParts(t);return[...i.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...n.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Ws&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!Tn&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=pm(e,t),this.options=t}}function pm(r,e={}){let{numberingSystem:t}=e;if(t&&r.includes("-nu-")&&(r.includes("-u-")||(r+="-u-"),r+=`-nu-${t}`),e.style==="unit"&&!Tn){var i;let{unit:a,unitDisplay:o="short"}=e;if(!a)throw new Error('unit option must be provided with style: "unit"');if(!(!((i=tu[a])===null||i===void 0)&&i[o]))throw new Error(`Unsupported unit ${a} with unitDisplay = ${o}`);e={...e,style:"decimal"}}let n=r+(e?Object.entries(e).sort((a,o)=>a[0]<o[0]?-1:1).join():"");if(ls.has(n))return ls.get(n);let s=new Intl.NumberFormat(r,e);return ls.set(n,s),s}function mm(r,e,t){if(e==="auto")return r.format(t);if(e==="never")return r.format(Math.abs(t));{let i=!1;if(e==="always"?i=t>0||Object.is(t,0):e==="exceptZero"&&(Object.is(t,-0)||Object.is(t,0)?t=Math.abs(t):i=t>0),i){let n=r.format(-t),s=r.format(t),a=n.replace(s,"").replace(/\u200e|\u061C/,"");return[...a].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),n.replace(s,"!!!").replace(a,"+").replace("!!!",s)}else return r.format(t)}}const gm=new RegExp("^.*\\(.*\\).*$"),ym=["latn","arab","hanidec","deva","beng","fullwide"];class ru{parse(e){return us(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,i){return us(this.locale,this.options,e).isValidPartialNumber(e,t,i)}getNumberingSystem(e){return us(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}}const uo=new Map;function us(r,e,t){let i=co(r,e);if(!r.includes("-nu-")&&!i.isValidPartialNumber(t)){for(let n of ym)if(n!==i.options.numberingSystem){let s=co(r+(r.includes("-u-")?"-nu-":"-u-nu-")+n,e);if(s.isValidPartialNumber(t))return s}}return i}function co(r,e){let t=r+(e?Object.entries(e).sort((n,s)=>n[0]<s[0]?-1:1).join():""),i=uo.get(t);return i||(i=new vm(r,e),uo.set(t,i)),i}class vm{parse(e){let t=this.sanitize(e);if(this.symbols.group&&(t=Ii(t,this.symbols.group,"")),this.symbols.decimal&&(t=t.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(t=t.replace(this.symbols.minusSign,"-")),t=t.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let a=t.indexOf("-");t=t.replace("-",""),t=t.replace("+","");let o=t.indexOf(".");o===-1&&(o=t.length),t=t.replace(".",""),o-2===0?t=`0.${t}`:o-2===-1?t=`0.0${t}`:o-2===-2?t="0.00":t=`${t.slice(0,o-2)}.${t.slice(o-2)}`,a>-1&&(t=`-${t}`)}let i=t?+t:NaN;if(isNaN(i))return NaN;if(this.options.style==="percent"){var n,s;let a={...this.options,style:"decimal",minimumFractionDigits:Math.min(((n=this.options.minimumFractionDigits)!==null&&n!==void 0?n:0)+2,20),maximumFractionDigits:Math.min(((s=this.options.maximumFractionDigits)!==null&&s!==void 0?s:0)+2,20)};return new ru(this.locale,a).parse(new iu(this.locale,a).format(i))}return this.options.currencySign==="accounting"&&gm.test(e)&&(i=-1*i),i}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=Ii(e,".",this.symbols.group))),this.symbols.group==="’"&&e.includes("'")&&(e=Ii(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=Ii(e," ",this.symbols.group),e=Ii(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,t=-1/0,i=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&i>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=Ii(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,t={}){this.locale=e,t.roundingIncrement!==1&&t.roundingIncrement!=null&&(t.maximumFractionDigits==null&&t.minimumFractionDigits==null?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):t.maximumFractionDigits==null?t.maximumFractionDigits=t.minimumFractionDigits:t.minimumFractionDigits==null&&(t.minimumFractionDigits=t.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=xm(e,this.formatter,this.options,t);var i,n;this.options.style==="percent"&&(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)>18||((n=this.options.maximumFractionDigits)!==null&&n!==void 0?n:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const ho=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),bm=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function xm(r,e,t,i){var n,s,a,o;let l=new Intl.NumberFormat(r,{...t,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),u=l.formatToParts(-10000.111),d=l.formatToParts(10000.111),c=bm.map(R=>l.formatToParts(R));var h;let p=(h=(n=u.find(R=>R.type==="minusSign"))===null||n===void 0?void 0:n.value)!==null&&h!==void 0?h:"-",m=(s=d.find(R=>R.type==="plusSign"))===null||s===void 0?void 0:s.value;!m&&(i?.signDisplay==="exceptZero"||i?.signDisplay==="always")&&(m="+");let y=(a=new Intl.NumberFormat(r,{...t,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(R=>R.type==="decimal"))===null||a===void 0?void 0:a.value,b=(o=u.find(R=>R.type==="group"))===null||o===void 0?void 0:o.value,x=u.filter(R=>!ho.has(R.type)).map(R=>fo(R.value)),w=c.flatMap(R=>R.filter(U=>!ho.has(U.type)).map(U=>fo(U.value))),A=[...new Set([...x,...w])].sort((R,U)=>U.length-R.length),q=A.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${A.join("|")}|[\\p{White_Space}]`,"gu"),M=[...new Intl.NumberFormat(t.locale,{useGrouping:!1}).format(9876543210)].reverse(),B=new Map(M.map((R,U)=>[R,U])),H=new RegExp(`[${M.join("")}]`,"g");return{minusSign:p,plusSign:m,decimal:y,group:b,literals:q,numeral:H,index:R=>String(B.get(R))}}function Ii(r,e,t){return r.replaceAll?r.replaceAll(e,t):r.split(e).join(t)}function fo(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nu(r){const{disabled:e}=r,t=z(),i=rl(),n=()=>window.clearTimeout(t.value),s=h=>{n(),!e.value&&(i.trigger(),t.value=window.setTimeout(()=>{s(60)},h))},a=()=>{s(400)},o=()=>{n()},l=z(!1),u=k(()=>Nn(r.target)),d=h=>{h.button!==0||l.value||(h.preventDefault(),l.value=!0,a())},c=()=>{l.value=!1,o()};return Hn&&(si(u||window,"pointerdown",d),si(window,"pointerup",c),si(window,"pointercancel",c)),{isPressed:l,onTrigger:i.on}}function po(r,e=z({})){return ll(()=>new iu(r.value,e.value))}function wm(r,e=z({})){return ll(()=>new ru(r.value,e.value))}function mo(r,e,t){let i=r==="+"?e+t:e-t;if(e%1!==0||t%1!==0){const n=e.toString().split("."),s=t.toString().split("."),a=n[1]&&n[1].length||0,o=s[1]&&s[1].length||0,l=10**Math.max(a,o);e=Math.round(e*l),t=Math.round(t*l),i=r==="+"?e+t:e-t,i/=l}return i}const[Oa,_m]=Re("NumberFieldRoot");var Cm=O({inheritAttrs:!1,__name:"NumberFieldRoot",props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{disabled:n,readonly:s,disableWheelChange:a,invertWheelChange:o,min:l,max:u,step:d,stepSnapping:c,formatOptions:h,id:p,locale:m}=vt(t),g=rt(t,"modelValue",i,{defaultValue:t.defaultValue,passive:t.modelValue===void 0}),{primitiveElement:y,currentElement:b}=zr(),x=Qd(m),w=wl(b),A=z(),q=k(()=>!Yi(g.value)&&(Y(g.value)===l.value||l.value&&!isNaN(g.value)?mo("-",g.value,d.value)<l.value:!1)),M=k(()=>!Yi(g.value)&&(Y(g.value)===u.value||u.value&&!isNaN(g.value)?mo("+",g.value,d.value)>u.value:!1));function B(se,ye=1){if(A.value?.focus(),t.disabled||t.readonly)return;const fr=W.parse(A.value?.value??"");isNaN(fr)?g.value=l.value??0:se==="increase"?g.value=Y(fr+(d.value??1)*ye):g.value=Y(fr-(d.value??1)*ye)}function H(se=1){B("increase",se)}function E(se=1){B("decrease",se)}function R(se){se==="min"&&l.value!==void 0?g.value=Y(l.value):se==="max"&&u.value!==void 0&&(g.value=Y(u.value))}const U=po(x,h),W=wm(x,h),te=k(()=>U.resolvedOptions().maximumFractionDigits>0?"decimal":"numeric"),Q=po(x,h),oe=k(()=>Yi(g.value)||isNaN(g.value)?"":Q.format(g.value));function J(se){return W.isValidPartialNumber(se,l.value,u.value)}function ee(se){A.value&&(A.value.value=se)}function Y(se){let ye;return d.value===void 0||isNaN(d.value)||!c.value?ye=Rd(se,l.value,u.value):ye=Dd(se,l.value,u.value,d.value),ye=W.parse(U.format(ye)),ye}function he(se){const ye=W.parse(se);return g.value=isNaN(ye)?void 0:Y(ye),se.length?(isNaN(ye),ee(oe.value)):ee(se)}return _m({modelValue:g,handleDecrease:E,handleIncrease:H,handleMinMaxValue:R,inputMode:te,inputEl:A,onInputElement:se=>A.value=se,textValue:oe,validate:J,applyInputValue:he,disabled:n,readonly:s,disableWheelChange:a,invertWheelChange:o,max:u,min:l,isDecreaseDisabled:q,isIncreaseDisabled:M,id:p}),(se,ye)=>(v(),C(f(re),L(se.$attrs,{ref_key:"primitiveElement",ref:y,role:"group",as:se.as,"as-child":se.asChild,"data-disabled":f(n)?"":void 0,"data-readonly":f(s)?"":void 0}),{default:_(()=>[S(se.$slots,"default",{modelValue:f(g),textValue:oe.value}),f(w)&&se.name?(v(),C(f(El),{key:0,type:"text",value:f(g),name:se.name,disabled:f(n),readonly:f(s),required:se.required},null,8,["value","name","disabled","readonly","required"])):D("v-if",!0)]),_:3},16,["as","as-child","data-disabled","data-readonly"]))}}),Am=Cm,Sm=O({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r,t=Oa(),i=k(()=>t.disabled?.value||t.readonly.value||e.disabled||t.isDecreaseDisabled.value),{primitiveElement:n,currentElement:s}=zr(),{isPressed:a,onTrigger:o}=nu({target:s,disabled:i});return o(()=>{t.handleDecrease()}),(l,u)=>(v(),C(f(re),L(e,{ref_key:"primitiveElement",ref:n,tabindex:"-1","aria-label":"Decrease",type:l.as==="button"?"button":void 0,style:{userSelect:f(a)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":f(a)?"true":void 0,onContextmenu:u[0]||(u[0]=fe(()=>{},["prevent"]))}),{default:_(()=>[S(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),Mm=Sm,Bm=O({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r,t=Oa(),i=k(()=>t.disabled?.value||t.readonly.value||e.disabled||t.isIncreaseDisabled.value),{primitiveElement:n,currentElement:s}=zr(),{isPressed:a,onTrigger:o}=nu({target:s,disabled:i});return o(()=>{t.handleIncrease()}),(l,u)=>(v(),C(f(re),L(e,{ref_key:"primitiveElement",ref:n,tabindex:"-1","aria-label":"Increase",type:l.as==="button"?"button":void 0,style:{userSelect:f(a)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":f(a)?"true":void 0,onContextmenu:u[0]||(u[0]=fe(()=>{},["prevent"]))}),{default:_(()=>[S(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),qm=Bm,km=O({__name:"NumberFieldInput",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},setup(r){const e=r,{primitiveElement:t,currentElement:i}=zr(),n=Oa();function s(l){n.disableWheelChange.value||l.target===pt()&&(Math.abs(l.deltaY)<=Math.abs(l.deltaX)||(l.preventDefault(),l.deltaY>0?n.invertWheelChange.value?n.handleDecrease():n.handleIncrease():l.deltaY<0&&(n.invertWheelChange.value?n.handleIncrease():n.handleDecrease())))}He(()=>{n.onInputElement(i.value)});const a=z(n.textValue.value);_e(()=>n.textValue.value,()=>{a.value=n.textValue.value},{immediate:!0,deep:!0});function o(){requestAnimationFrame(()=>{a.value=n.textValue.value})}return(l,u)=>(v(),C(f(re),L(e,{id:f(n).id.value,ref_key:"primitiveElement",ref:t,value:a.value,role:"spinbutton",type:"text",tabindex:"0",inputmode:f(n).inputMode.value,disabled:f(n).disabled.value?"":void 0,"data-disabled":f(n).disabled.value?"":void 0,readonly:f(n).readonly.value?"":void 0,"data-readonly":f(n).readonly.value?"":void 0,autocomplete:"off",autocorrect:"off",spellcheck:"false","aria-roledescription":"Number field","aria-valuenow":f(n).modelValue.value,"aria-valuemin":f(n).min.value,"aria-valuemax":f(n).max.value,onKeydown:[u[0]||(u[0]=ht(fe(d=>f(n).handleIncrease(),["prevent"]),["up"])),u[1]||(u[1]=ht(fe(d=>f(n).handleDecrease(),["prevent"]),["down"])),u[2]||(u[2]=ht(fe(d=>f(n).handleIncrease(10),["prevent"]),["page-up"])),u[3]||(u[3]=ht(fe(d=>f(n).handleDecrease(10),["prevent"]),["page-down"])),u[4]||(u[4]=ht(fe(d=>f(n).handleMinMaxValue("min"),["prevent"]),["home"])),u[5]||(u[5]=ht(fe(d=>f(n).handleMinMaxValue("max"),["prevent"]),["end"])),u[8]||(u[8]=ht(d=>f(n).applyInputValue(d.target?.value),["enter"]))],onWheel:s,onBeforeinput:u[6]||(u[6]=d=>{const c=d.target;let h=c.value.slice(0,c.selectionStart??void 0)+(d.data??"")+c.value.slice(c.selectionEnd??void 0);f(n).validate(h)||d.preventDefault()}),onInput:u[7]||(u[7]=d=>{const c=d.target;a.value=c.value}),onChange:o,onBlur:u[9]||(u[9]=d=>f(n).applyInputValue(d.target?.value))}),{default:_(()=>[S(l.$slots,"default")]),_:3},16,["id","value","inputmode","disabled","data-disabled","readonly","data-readonly","aria-valuenow","aria-valuemin","aria-valuemax"]))}}),Em=km,Fm=O({__name:"BaseSeparator",props:{orientation:{type:String,required:!1,default:"horizontal"},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,t=["horizontal","vertical"];function i(o){return t.includes(o)}const n=k(()=>i(e.orientation)?e.orientation:"horizontal"),s=k(()=>n.value==="vertical"?e.orientation:void 0),a=k(()=>e.decorative?{role:"none"}:{"aria-orientation":s.value,role:"separator"});return(o,l)=>(v(),C(f(re),L({as:o.as,"as-child":o.asChild,"data-orientation":n.value},a.value),{default:_(()=>[S(o.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),Om=Fm,zm=O({__name:"Separator",props:{orientation:{type:String,required:!1,default:"horizontal"},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(Om,ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Im=zm;const[Jn,Tm]=Re("TabsRoot");var Pm=O({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{orientation:n,unmountOnHide:s,dir:a}=vt(t),o=Un(a);X();const l=rt(t,"modelValue",i,{defaultValue:t.defaultValue,passive:t.modelValue===void 0}),u=z();return Tm({modelValue:l,changeModelValue:d=>{l.value=d},orientation:n,dir:o,unmountOnHide:s,activationMode:t.activationMode,baseId:yt(void 0,"reka-tabs"),tabsList:u}),(d,c)=>(v(),C(f(re),{dir:f(o),"data-orientation":f(n),"as-child":d.asChild,as:d.as},{default:_(()=>[S(d.$slots,"default",{modelValue:f(l)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),Rm=Pm;function su(r,e){return`${r}-trigger-${e}`}function au(r,e){return`${r}-content-${e}`}var Dm=O({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,{forwardRef:t}=X(),i=Jn(),n=k(()=>su(i.baseId,e.value)),s=k(()=>au(i.baseId,e.value)),a=k(()=>e.value===i.modelValue.value),o=z(a.value);return He(()=>{requestAnimationFrame(()=>{o.value=!1})}),(l,u)=>(v(),C(f(Lt),{present:l.forceMount||a.value,"force-mount":""},{default:_(({present:d})=>[F(f(re),{id:s.value,ref:f(t),"as-child":l.asChild,as:l.as,role:"tabpanel","data-state":a.value?"active":"inactive","data-orientation":f(i).orientation.value,"aria-labelledby":n.value,hidden:!d,tabindex:"0",style:qt({animationDuration:o.value?"0s":void 0})},{default:_(()=>[!f(i).unmountOnHide.value||d?S(l.$slots,"default",{key:0}):D("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),$m=Dm,Lm=O({__name:"TabsIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,t=Jn();X();const i=z(),n=z({size:null,position:null});_e(()=>[t.modelValue.value,t?.dir.value],async()=>{await Ye(),s()},{immediate:!0}),gd([t.tabsList,i],s);function s(){i.value=t.tabsList.value?.querySelector('[role="tab"][data-state="active"]'),i.value&&(t.orientation.value==="horizontal"?n.value={size:i.value.offsetWidth,position:i.value.offsetLeft}:n.value={size:i.value.offsetHeight,position:i.value.offsetTop})}return(a,o)=>typeof n.value.size=="number"?(v(),C(f(re),L({key:0},e,{style:{"--reka-tabs-indicator-size":`${n.value.size}px`,"--reka-tabs-indicator-position":`${n.value.position}px`}}),{default:_(()=>[S(a.$slots,"default")]),_:3},16,["style"])):D("v-if",!0)}}),Hm=Lm,Nm=O({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,{loop:t}=vt(e),{forwardRef:i,currentElement:n}=X(),s=Jn();return s.tabsList=n,(a,o)=>(v(),C(f(ql),{"as-child":"",orientation:f(s).orientation.value,dir:f(s).dir.value,loop:f(t)},{default:_(()=>[F(f(re),{ref:f(i),role:"tablist","as-child":a.asChild,as:a.as,"aria-orientation":f(s).orientation.value},{default:_(()=>[S(a.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),Vm=Nm,Um=O({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r,{forwardRef:t}=X(),i=Jn(),n=k(()=>su(i.baseId,e.value)),s=k(()=>au(i.baseId,e.value)),a=k(()=>e.value===i.modelValue.value);return(o,l)=>(v(),C(f(kl),{"as-child":"",focusable:!o.disabled,active:a.value},{default:_(()=>[F(f(re),{id:n.value,ref:f(t),role:"tab",type:o.as==="button"?"button":void 0,as:o.as,"as-child":o.asChild,"aria-selected":a.value?"true":"false","aria-controls":s.value,"data-state":a.value?"active":"inactive",disabled:o.disabled,"data-disabled":o.disabled?"":void 0,"data-orientation":f(i).orientation.value,onMousedown:l[0]||(l[0]=fe(u=>{!o.disabled&&u.ctrlKey===!1?f(i).changeModelValue(o.value):u.preventDefault()},["left"])),onKeydown:l[1]||(l[1]=ht(u=>f(i).changeModelValue(o.value),["enter","space"])),onFocus:l[2]||(l[2]=()=>{const u=f(i).activationMode!=="manual";!a.value&&!o.disabled&&u&&f(i).changeModelValue(o.value)})},{default:_(()=>[S(o.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),jm=Um,Wm=O({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const e=r;return X(),(t,i)=>(v(),C(f(Yn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Gm=Wm;const ou="tooltip.open",[Zn,Km]=Re("TooltipRoot");var Xm=O({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=e;X();const n=aa(),s=k(()=>t.disableHoverableContent??n.disableHoverableContent.value),a=k(()=>t.disableClosingTrigger??n.disableClosingTrigger.value),o=k(()=>t.disabled??n.disabled.value),l=k(()=>t.delayDuration??n.delayDuration.value),u=k(()=>t.ignoreNonKeyboardFocus??n.ignoreNonKeyboardFocus.value),d=rt(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0});_e(d,w=>{n.onClose&&(w?(n.onOpen(),document.dispatchEvent(new CustomEvent(ou))):n.onClose())});const c=z(!1),h=z(),p=k(()=>d.value?c.value?"delayed-open":"instant-open":"closed"),{start:m,stop:g}=yd(()=>{c.value=!0,d.value=!0},l,{immediate:!1});function y(){g(),c.value=!1,d.value=!0}function b(){g(),d.value=!1}function x(){m()}return Km({contentId:"",open:d,stateAttribute:p,trigger:h,onTriggerChange(w){h.value=w},onTriggerEnter(){n.isOpenDelayed.value?x():y()},onTriggerLeave(){s.value?b():g()},onOpen:y,onClose:b,disableHoverableContent:s,disableClosingTrigger:a,disabled:o,ignoreNonKeyboardFocus:u}),(w,A)=>(v(),C(f(Pr),null,{default:_(()=>[S(w.$slots,"default",{open:f(d)})]),_:3}))}}),Ym=Xm,Jm=O({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(r,{emit:e}){const t=r,i=e,n=Zn(),{forwardRef:s}=X(),a=We(),o=k(()=>a.default?.({})),l=k(()=>{if(t.ariaLabel)return t.ariaLabel;let d="";function c(h){typeof h.children=="string"&&h.type!==vd?d+=h.children:Array.isArray(h.children)&&h.children.forEach(p=>c(p))}return o.value?.forEach(h=>c(h)),d}),u=k(()=>{const{ariaLabel:d,...c}=t;return c});return He(()=>{si(window,"scroll",d=>{d.target?.contains(n.trigger.value)&&n.onClose()}),si(window,ou,n.onClose)}),(d,c)=>(v(),C(f(Fr),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:c[0]||(c[0]=h=>i("escapeKeyDown",h)),onPointerDownOutside:c[1]||(c[1]=h=>{f(n).disableClosingTrigger.value&&f(n).trigger.value?.contains(h.target)&&h.preventDefault(),i("pointerDownOutside",h)}),onFocusOutside:c[2]||(c[2]=fe(()=>{},["prevent"])),onDismiss:c[3]||(c[3]=h=>f(n).onClose())},{default:_(()=>[F(f(Xn),L({ref:f(s),"data-state":f(n).stateAttribute.value},{...d.$attrs,...u.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:_(()=>[S(d.$slots,"default"),F(f(Ir),{id:f(n).contentId,role:"tooltip"},{default:_(()=>[ce(Z(l.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),lu=Jm,Zm=O({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(r){const t=Zt(r),{forwardRef:i,currentElement:n}=X(),{trigger:s,onClose:a}=Zn(),o=aa(),{isPointerInTransit:l,onPointerExit:u}=_l(s,n);return o.isPointerInTransitRef=l,u(()=>{a()}),(d,c)=>(v(),C(lu,L({ref:f(i)},f(t)),{default:_(()=>[S(d.$slots,"default")]),_:3},16))}}),Qm=Zm,eg=O({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(r,{emit:e}){const t=r,i=e,n=Zn(),s=Ce(t,i),{forwardRef:a}=X();return(o,l)=>(v(),C(f(Lt),{present:o.forceMount||f(n).open.value},{default:_(()=>[(v(),C(or(f(n).disableHoverableContent.value?lu:Qm),L({ref:f(a)},f(s)),{default:_(()=>[S(o.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),tg=eg,ig=O({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=r;return(t,i)=>(v(),C(f(Or),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),rg=ig,ng=O({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r,t=Zn(),i=aa();t.contentId||=yt(void 0,"reka-tooltip-content");const{forwardRef:n,currentElement:s}=X(),a=z(!1),o=z(!1),l=k(()=>t.disabled.value?{}:{click:g,focus:p,pointermove:c,pointerleave:h,pointerdown:d,blur:m});He(()=>{t.onTriggerChange(s.value)});function u(){setTimeout(()=>{a.value=!1},1)}function d(){t.open&&!t.disableClosingTrigger.value&&t.onClose(),a.value=!0,document.addEventListener("pointerup",u,{once:!0})}function c(y){y.pointerType!=="touch"&&!o.value&&!i.isPointerInTransitRef.value&&(t.onTriggerEnter(),o.value=!0)}function h(){t.onTriggerLeave(),o.value=!1}function p(y){a.value||t.ignoreNonKeyboardFocus.value&&!y.target.matches?.(":focus-visible")||t.onOpen()}function m(){t.onClose()}function g(){t.disableClosingTrigger.value||t.onClose()}return(y,b)=>(v(),C(f(Rr),{"as-child":"",reference:y.reference},{default:_(()=>[F(f(re),L({ref:f(n),"aria-describedby":f(t).open.value?f(t).contentId:void 0,"data-state":f(t).stateAttribute.value,as:y.as,"as-child":e.asChild,"data-grace-area-trigger":""},Tr(l.value)),{default:_(()=>[S(y.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),sg=ng;function _r(r={}){const{inheritAttrs:e=!0}=r,t=at(),i=O({setup(s,{slots:a}){return()=>{t.value=a.default}}}),n=O({inheritAttrs:e,props:r.props,setup(s,{attrs:a,slots:o}){return()=>{var l;t.value;const u=(l=t.value)==null?void 0:l.call(t,{...r.props==null?ag(a):s,$slots:o});return e&&u?.length===1?u[0]:u}}});return bd({define:i,reuse:n},[i,n])}function ag(r){const e={};for(const t in r)e[Cd(t)]=r[t];return e}const za=ul?window:void 0;function sr(r){var e;const t=Rt(r);return(e=t?.$el)!=null?e:t}function Cr(...r){const e=[],t=()=>{e.forEach(o=>o()),e.length=0},i=(o,l,u,d)=>(o.addEventListener(l,u,d),()=>o.removeEventListener(l,u,d)),n=k(()=>{const o=Mn(Rt(r[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),s=_d(()=>{var o,l;return[(l=(o=n.value)==null?void 0:o.map(u=>sr(u)))!=null?l:[za].filter(u=>u!=null),Mn(Rt(n.value?r[1]:r[0])),Mn(f(n.value?r[2]:r[1])),Rt(n.value?r[3]:r[2])]},([o,l,u,d])=>{if(t(),!o?.length||!l?.length||!u?.length)return;const c=Sd(d)?{...d}:d;e.push(...o.flatMap(h=>l.flatMap(p=>u.map(m=>i(h,p,m,c)))))},{flush:"post"}),a=()=>{s(),t()};return la(t),a}function og(){const r=at(!1),e=oa();return e&&He(()=>{r.value=!0},e),r}function uu(r){const e=og();return k(()=>(e.value,!!r()))}function lg(r,e,t={}){const{window:i=za,...n}=t;let s;const a=uu(()=>i&&"MutationObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},l=k(()=>{const h=Rt(r),p=Mn(h).map(sr).filter(Ad);return new Set(p)}),u=_e(l,h=>{o(),a.value&&h.size&&(s=new MutationObserver(e),h.forEach(p=>s.observe(p,n)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),c=()=>{u(),o()};return la(c),{isSupported:a,stop:c,takeRecords:d}}function ug(r){return JSON.parse(JSON.stringify(r))}function dg(r,e,t={}){const{window:i=za,...n}=t;let s;const a=uu(()=>i&&"ResizeObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},l=k(()=>{const c=Rt(r);return Array.isArray(c)?c.map(h=>sr(h)):[sr(c)]}),u=_e(l,c=>{if(o(),a.value&&i){s=new ResizeObserver(e);for(const h of c)h&&s.observe(h,n)}},{immediate:!0,flush:"post"}),d=()=>{o(),u()};return la(d),{isSupported:a,stop:d}}function go(r,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:n=!0,immediate:s=!0,updateTiming:a="sync"}=e,o=at(0),l=at(0),u=at(0),d=at(0),c=at(0),h=at(0),p=at(0),m=at(0);function g(){const b=sr(r);if(!b){t&&(o.value=0,l.value=0,u.value=0,d.value=0,c.value=0,h.value=0,p.value=0,m.value=0);return}const x=b.getBoundingClientRect();o.value=x.height,l.value=x.bottom,u.value=x.left,d.value=x.right,c.value=x.top,h.value=x.width,p.value=x.x,m.value=x.y}function y(){a==="sync"?g():a==="next-frame"&&requestAnimationFrame(()=>g())}return dg(r,y),_e(()=>sr(r),b=>!b&&y()),lg(r,y,{attributeFilter:["style","class"]}),n&&Cr("scroll",y,{capture:!0,passive:!0}),i&&Cr("resize",y,{passive:!0}),wd(()=>{s&&y()}),{height:o,bottom:l,left:u,right:d,top:c,width:h,x:p,y:m,update:y}}function du(r,e,t,i={}){var n,s,a;const{clone:o=!1,passive:l=!1,eventName:u,deep:d=!1,defaultValue:c,shouldEmit:h}=i,p=oa(),m=t||p?.emit||((n=p?.$emit)==null?void 0:n.bind(p))||((a=(s=p?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(p?.proxy));let g=u;g=g||`update:${e.toString()}`;const y=w=>o?typeof o=="function"?o(w):ug(w):w,b=()=>xd(r[e])?y(r[e]):c,x=w=>{h?h(w)&&m(g,w):m(g,w)};if(l){const w=b(),A=z(w);let q=!1;return _e(()=>r[e],M=>{q||(q=!0,A.value=y(M),Ye(()=>q=!1))}),_e(A,M=>{!q&&(M!==r[e]||d)&&x(M)},{deep:d}),A}else return k({get(){return b()},set(w){x(w)}})}const cg=()=>Md("color-mode").value,hg=Object.assign({inheritAttrs:!1},{__name:"UColorModeButton",props:{color:{type:null,required:!1,default:"neutral"},variant:{type:null,required:!1,default:"ghost"},label:{type:String,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},active:{type:Boolean,required:!1},exact:{type:Boolean,required:!1},exactQuery:{type:[Boolean,String],required:!1},exactHash:{type:Boolean,required:!1},inactiveClass:{type:String,required:!1},to:{type:null,required:!1},href:{type:null,required:!1},external:{type:Boolean,required:!1},target:{type:[String,Object,null],required:!1},rel:{type:[String,Object,null],required:!1},noRel:{type:Boolean,required:!1},prefetchedClass:{type:String,required:!1},prefetch:{type:Boolean,required:!1},prefetchOn:{type:[String,Object],required:!1},noPrefetch:{type:Boolean,required:!1},trailingSlash:{type:String,required:!1},activeClass:{type:String,required:!1},exactActiveClass:{type:String,required:!1},ariaCurrentValue:{type:String,required:!1},viewTransition:{type:Boolean,required:!1},replace:{type:Boolean,required:!1}},setup(r){const e=r,{t}=Bi(),i=cg(),n=Te(),s=Zt(dl(e,"icon")),a=k({get(){return i.value==="dark"},set(o){i.preference=o?"dark":"light"}});return(o,l)=>(v(),C(lt,L({...f(s),"aria-label":a.value?f(t)("colorMode.switchToLight"):f(t)("colorMode.switchToDark"),...o.$attrs},{onClick:l[0]||(l[0]=u=>a.value=!a.value)}),{leading:_(({ui:u})=>[F(Me,{class:I([u.leadingIcon({class:e.ui?.leadingIcon}),"hidden dark:inline"]),name:f(n).ui.icons.dark},null,8,["class","name"]),F(Me,{class:I([u.leadingIcon({class:e.ui?.leadingIcon}),"inline dark:hidden"]),name:f(n).ui.icons.light},null,8,["class","name"])]),_:1},16))}}),tn={meta:"",ctrl:"",alt:"",win:"⊞",command:"⌘",shift:"⇧",control:"⌃",option:"⌥",enter:"↵",delete:"⌦",backspace:"⌫",escape:"Esc",tab:"⇥",capslock:"⇪",arrowup:"↑",arrowright:"→",arrowdown:"↓",arrowleft:"←",pageup:"⇞",pagedown:"⇟",home:"↖",end:"↘"},fg=()=>{const r=k(()=>navigator&&navigator.userAgent&&navigator.userAgent.match(/Macintosh;/)),e=na({meta:" ",alt:" ",ctrl:" "});He(()=>{e.meta=r.value?tn.command:"Ctrl",e.ctrl=r.value?tn.control:"Ctrl",e.alt=r.value?tn.option:"Alt"});function t(i){if(i)return["meta","alt","ctrl"].includes(i)?e[i]:tn[i]||i}return{macOS:r,getKbdKey:t}},pg=cl(fg),mg={base:"inline-flex items-center justify-center px-1 rounded-sm font-medium font-sans uppercase",variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{sm:"h-4 min-w-[16px] text-[10px]",md:"h-5 min-w-[20px] text-[11px]",lg:"h-6 min-w-[24px] text-[12px]"}},compoundVariants:[{color:"primary",variant:"solid",class:"text-inverted bg-primary"},{color:"secondary",variant:"solid",class:"text-inverted bg-secondary"},{color:"success",variant:"solid",class:"text-inverted bg-success"},{color:"info",variant:"solid",class:"text-inverted bg-info"},{color:"warning",variant:"solid",class:"text-inverted bg-warning"},{color:"error",variant:"solid",class:"text-inverted bg-error"},{color:"primary",variant:"outline",class:"ring ring-inset ring-primary/50 text-primary"},{color:"secondary",variant:"outline",class:"ring ring-inset ring-secondary/50 text-secondary"},{color:"success",variant:"outline",class:"ring ring-inset ring-success/50 text-success"},{color:"info",variant:"outline",class:"ring ring-inset ring-info/50 text-info"},{color:"warning",variant:"outline",class:"ring ring-inset ring-warning/50 text-warning"},{color:"error",variant:"outline",class:"ring ring-inset ring-error/50 text-error"},{color:"primary",variant:"soft",class:"text-primary bg-primary/10"},{color:"secondary",variant:"soft",class:"text-secondary bg-secondary/10"},{color:"success",variant:"soft",class:"text-success bg-success/10"},{color:"info",variant:"soft",class:"text-info bg-info/10"},{color:"warning",variant:"soft",class:"text-warning bg-warning/10"},{color:"error",variant:"soft",class:"text-error bg-error/10"},{color:"primary",variant:"subtle",class:"text-primary ring ring-inset ring-primary/25 bg-primary/10"},{color:"secondary",variant:"subtle",class:"text-secondary ring ring-inset ring-secondary/25 bg-secondary/10"},{color:"success",variant:"subtle",class:"text-success ring ring-inset ring-success/25 bg-success/10"},{color:"info",variant:"subtle",class:"text-info ring ring-inset ring-info/25 bg-info/10"},{color:"warning",variant:"subtle",class:"text-warning ring ring-inset ring-warning/25 bg-warning/10"},{color:"error",variant:"subtle",class:"text-error ring ring-inset ring-error/25 bg-error/10"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"}],defaultVariants:{variant:"outline",color:"neutral",size:"md"}},cu={__name:"UKbd",props:{as:{type:null,required:!1,default:"kbd"},value:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},class:{type:null,required:!1}},setup(r){const e=r,{getKbdKey:t}=pg(),i=Te(),n=k(()=>ue({extend:ue(mg),...i.ui?.kbd||{}}));return(s,a)=>(v(),C(f(re),{as:r.as,class:I(n.value({class:e.class,color:e.color,variant:e.variant,size:e.size}))},{default:_(()=>[S(s.$slots,"default",{},()=>[ce(Z(f(t)(r.value)),1)])]),_:3},8,["as","class"]))}},gg={slots:{content:"flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto",arrow:"fill-default",text:"truncate",kbds:"hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5",kbdsSize:"sm"}},yg={__name:"UTooltip",props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=e,n=We(),s=Te(),a=Ce(Ft(t,"defaultOpen","open","delayDuration","disableHoverableContent","disableClosingTrigger","ignoreNonKeyboardFocus"),i),o=lr(je(()=>t.portal)),l=je(()=>Er(t.content,{side:"bottom",sideOffset:8,collisionPadding:8})),u=je(()=>t.arrow),d=k(()=>ue({extend:ue(gg),...s.ui?.tooltip||{}})({side:l.value.side}));return(c,h)=>(v(),C(f(Ym),L(f(a),{disabled:!(r.text||r.kbds?.length||n.content)||t.disabled}),{default:_(({open:p})=>[n.default||r.reference?(v(),C(f(sg),L({key:0},c.$attrs,{"as-child":"",reference:r.reference,class:t.class}),{default:_(()=>[S(c.$slots,"default",{open:p})]),_:2},1040,["reference","class"])):D("",!0),F(f(rg),ae(le(f(o))),{default:_(()=>[F(f(tg),L(l.value,{"data-slot":"content",class:d.value.content({class:[!n.default&&t.class,t.ui?.content]})}),{default:_(()=>[S(c.$slots,"content",{ui:d.value},()=>[r.text?(v(),N("span",{key:0,"data-slot":"text",class:I(d.value.text({class:t.ui?.text}))},Z(r.text),3)):D("",!0),r.kbds?.length?(v(),N("span",{key:1,"data-slot":"kbds",class:I(d.value.kbds({class:t.ui?.kbds}))},[(v(!0),N(xe,null,Xe(r.kbds,(m,g)=>(v(),C(cu,L({key:g,size:t.ui?.kbdsSize||d.value.kbdsSize()},{ref_for:!0},typeof m=="string"?{value:m}:m),null,16,["size"]))),128))],2)):D("",!0)]),r.arrow?(v(),C(f(Gm),L({key:0},u.value,{"data-slot":"arrow",class:d.value.arrow({class:t.ui?.arrow})}),null,16,["class"])):D("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["disabled"]))}},vg={base:"w-full max-w-(--ui-container) mx-auto px-4 sm:px-6 lg:px-8"},bg={__name:"UContainer",props:{as:{type:null,required:!1},class:{type:null,required:!1}},setup(r){const e=r,t=Te(),i=k(()=>ue({extend:ue(vg),...t.ui?.container||{}}));return(n,s)=>(v(),C(f(re),{as:r.as,class:I(i.value({class:e.class}))},{default:_(()=>[S(n.$slots,"default")]),_:3},8,["as","class"]))}},xg={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none",header:"flex items-center gap-1.5 p-4 sm:px-6 min-h-16",wrapper:"",body:"flex-1 overflow-y-auto p-4 sm:p-6",footer:"flex items-center gap-1.5 p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",close:"absolute top-4 end-4"},variants:{side:{top:{content:"inset-x-0 top-0 max-h-full"},right:{content:"right-0 inset-y-0 w-full max-w-md"},bottom:{content:"inset-x-0 bottom-0 max-h-full"},left:{content:"left-0 inset-y-0 w-full max-w-md"}},transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"}}},compoundVariants:[{transition:!0,side:"top",class:{content:"data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"}},{transition:!0,side:"right",class:{content:"data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"}},{transition:!0,side:"bottom",class:{content:"data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"}},{transition:!0,side:"left",class:{content:"data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"}}]},wg={__name:"USlideover",props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:"right"},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["after:leave","after:enter","close:prevent","update:open"],setup(r,{emit:e}){const t=r,i=e,n=We(),{t:s}=Bi(),a=Te(),o=Ce(Ft(t,"open","defaultOpen","modal"),i),l=lr(je(()=>t.portal)),u=je(()=>t.content),d=k(()=>t.dismissible?{}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((p,m)=>(p[m]=g=>{g.preventDefault(),i("close:prevent")},p),{})),c=k(()=>ue({extend:ue(xg),...a.ui?.slideover||{}})({transition:t.transition,side:t.side}));return(h,p)=>(v(),C(f(pa),ae(le(f(o))),{default:_(({open:m,close:g})=>[n.default?(v(),C(f(xa),{key:0,"as-child":"",class:I(t.class)},{default:_(()=>[S(h.$slots,"default",{open:m})]),_:2},1032,["class"])):D("",!0),F(f(ba),ae(le(f(l))),{default:_(()=>[r.overlay?(v(),C(f(En),{key:0,"data-slot":"overlay",class:I(c.value.overlay({class:t.ui?.overlay}))},null,8,["class"])):D("",!0),F(f(va),L({"data-side":r.side,"data-slot":"content",class:c.value.content({class:[!n.default&&t.class,t.ui?.content]})},u.value,{onAfterEnter:p[0]||(p[0]=y=>i("after:enter")),onAfterLeave:p[1]||(p[1]=y=>i("after:leave"))},Tr(d.value)),{default:_(()=>[n.content&&(r.title||n.title||r.description||n.description)?(v(),C(f(Ir),{key:0},{default:_(()=>[r.title||n.title?(v(),C(f(rr),{key:0},{default:_(()=>[S(h.$slots,"title",{},()=>[ce(Z(r.title),1)])]),_:3})):D("",!0),r.description||n.description?(v(),C(f(ir),{key:1},{default:_(()=>[S(h.$slots,"description",{},()=>[ce(Z(r.description),1)])]),_:3})):D("",!0)]),_:3})):D("",!0),S(h.$slots,"content",{close:g},()=>[n.header||r.title||n.title||r.description||n.description||t.close||n.close?(v(),N("div",{key:0,"data-slot":"header",class:I(c.value.header({class:t.ui?.header}))},[S(h.$slots,"header",{close:g},()=>[T("div",{"data-slot":"wrapper",class:I(c.value.wrapper({class:t.ui?.wrapper}))},[r.title||n.title?(v(),C(f(rr),{key:0,"data-slot":"title",class:I(c.value.title({class:t.ui?.title}))},{default:_(()=>[S(h.$slots,"title",{},()=>[ce(Z(r.title),1)])]),_:3},8,["class"])):D("",!0),r.description||n.description?(v(),C(f(ir),{key:1,"data-slot":"description",class:I(c.value.description({class:t.ui?.description}))},{default:_(()=>[S(h.$slots,"description",{},()=>[ce(Z(r.description),1)])]),_:3},8,["class"])):D("",!0)],2),S(h.$slots,"actions"),t.close||n.close?(v(),C(f(Al),{key:0,"as-child":""},{default:_(()=>[S(h.$slots,"close",{ui:c.value},()=>[t.close?(v(),C(lt,L({key:0,icon:r.closeIcon||f(a).ui.icons.close,color:"neutral",variant:"ghost","aria-label":f(s)("slideover.close")},typeof t.close=="object"?t.close:{},{"data-slot":"close",class:c.value.close({class:t.ui?.close})}),null,16,["icon","aria-label","class"])):D("",!0)])]),_:2},1024)):D("",!0)])],2)):D("",!0),T("div",{"data-slot":"body",class:I(c.value.body({class:t.ui?.body}))},[S(h.$slots,"body",{close:g})],2),n.footer?(v(),N("div",{key:1,"data-slot":"footer",class:I(c.value.footer({class:t.ui?.footer}))},[S(h.$slots,"footer",{close:g})],2)):D("",!0)])]),_:2},1040,["data-side","class"])]),_:2},1040)]),_:3},16))}},_g={slots:{overlay:"fixed inset-0",content:"bg-default divide-y divide-default flex flex-col focus:outline-none",header:"flex items-center gap-1.5 p-4 sm:px-6 min-h-16",wrapper:"",body:"flex-1 p-4 sm:p-6",footer:"flex items-center gap-1.5 p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",close:"absolute top-4 end-4"},variants:{transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]",content:"data-[state=open]:animate-[scale-in_200ms_ease-out] data-[state=closed]:animate-[scale-out_200ms_ease-in]"}},fullscreen:{true:{content:"inset-0"},false:{content:"w-[calc(100vw-2rem)] max-w-lg rounded-lg shadow-lg ring ring-default"}},overlay:{true:{overlay:"bg-elevated/75"}},scrollable:{true:{overlay:"overflow-y-auto",content:"relative"},false:{content:"fixed",body:"overflow-y-auto"}}},compoundVariants:[{scrollable:!0,fullscreen:!1,class:{overlay:"grid place-items-center p-4 sm:py-8"}},{scrollable:!1,fullscreen:!1,class:{content:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)] overflow-hidden"}}]},Cg={__name:"UModal",props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},scrollable:{type:Boolean,required:!1},transition:{type:Boolean,required:!1,default:!0},fullscreen:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["after:leave","after:enter","close:prevent","update:open"],setup(r,{emit:e}){const t=r,i=e,n=We(),{t:s}=Bi(),a=Te(),o=Ce(Ft(t,"open","defaultOpen","modal"),i),l=lr(je(()=>t.portal)),u=je(()=>t.content),d=k(()=>t.dismissible?t.scrollable?{pointerDownOutside:m=>{const g=m.detail.originalEvent,y=g.target;(g.offsetX>y.clientWidth||g.offsetY>y.clientHeight)&&m.preventDefault()}}:{}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((g,y)=>(g[y]=b=>{b.preventDefault(),i("close:prevent")},g),{})),[c,h]=_r(),p=k(()=>ue({extend:ue(_g),...a.ui?.modal||{}})({transition:t.transition,fullscreen:t.fullscreen,overlay:t.overlay,scrollable:t.scrollable}));return(m,g)=>(v(),C(f(pa),ae(le(f(o))),{default:_(({open:y,close:b})=>[F(f(c),null,{default:_(()=>[F(f(va),L({"data-slot":"content",class:p.value.content({class:[!n.default&&t.class,t.ui?.content]})},u.value,{onAfterEnter:g[0]||(g[0]=x=>i("after:enter")),onAfterLeave:g[1]||(g[1]=x=>i("after:leave"))},Tr(d.value)),{default:_(()=>[n.content&&(r.title||n.title||r.description||n.description)?(v(),C(f(Ir),{key:0},{default:_(()=>[r.title||n.title?(v(),C(f(rr),{key:0},{default:_(()=>[S(m.$slots,"title",{},()=>[ce(Z(r.title),1)])]),_:3})):D("",!0),r.description||n.description?(v(),C(f(ir),{key:1},{default:_(()=>[S(m.$slots,"description",{},()=>[ce(Z(r.description),1)])]),_:3})):D("",!0)]),_:3})):D("",!0),S(m.$slots,"content",{close:b},()=>[n.header||r.title||n.title||r.description||n.description||t.close||n.close?(v(),N("div",{key:0,"data-slot":"header",class:I(p.value.header({class:t.ui?.header}))},[S(m.$slots,"header",{close:b},()=>[T("div",{"data-slot":"wrapper",class:I(p.value.wrapper({class:t.ui?.wrapper}))},[r.title||n.title?(v(),C(f(rr),{key:0,"data-slot":"title",class:I(p.value.title({class:t.ui?.title}))},{default:_(()=>[S(m.$slots,"title",{},()=>[ce(Z(r.title),1)])]),_:3},8,["class"])):D("",!0),r.description||n.description?(v(),C(f(ir),{key:1,"data-slot":"description",class:I(p.value.description({class:t.ui?.description}))},{default:_(()=>[S(m.$slots,"description",{},()=>[ce(Z(r.description),1)])]),_:3},8,["class"])):D("",!0)],2),S(m.$slots,"actions"),t.close||n.close?(v(),C(f(Al),{key:0,"as-child":""},{default:_(()=>[S(m.$slots,"close",{ui:p.value},()=>[t.close?(v(),C(lt,L({key:0,icon:r.closeIcon||f(a).ui.icons.close,color:"neutral",variant:"ghost","aria-label":f(s)("modal.close")},typeof t.close=="object"?t.close:{},{"data-slot":"close",class:p.value.close({class:t.ui?.close})}),null,16,["icon","aria-label","class"])):D("",!0)])]),_:2},1024)):D("",!0)])],2)):D("",!0),n.body?(v(),N("div",{key:1,"data-slot":"body",class:I(p.value.body({class:t.ui?.body}))},[S(m.$slots,"body",{close:b})],2)):D("",!0),n.footer?(v(),N("div",{key:2,"data-slot":"footer",class:I(p.value.footer({class:t.ui?.footer}))},[S(m.$slots,"footer",{close:b})],2)):D("",!0)])]),_:2},1040,["class"])]),_:2},1024),n.default?(v(),C(f(xa),{key:0,"as-child":"",class:I(t.class)},{default:_(()=>[S(m.$slots,"default",{open:y})]),_:2},1032,["class"])):D("",!0),F(f(ba),ae(le(f(l))),{default:_(()=>[r.scrollable?(v(),C(f(En),{key:0,"data-slot":"overlay",class:I(p.value.overlay({class:t.ui?.overlay}))},{default:_(()=>[F(f(h))]),_:1},8,["class"])):(v(),N(xe,{key:1},[r.overlay?(v(),C(f(En),{key:0,"data-slot":"overlay",class:I(p.value.overlay({class:t.ui?.overlay}))},null,8,["class"])):D("",!0),F(f(h))],64))]),_:1},16)]),_:3},16))}};(function(){var r;try{if(typeof document<"u"){var e=document.createElement("style");e.nonce=(r=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:r.content,e.appendChild(document.createTextNode('[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1);animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform, 100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform, 100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true]):after{content:"";position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:hover,[data-vaul-handle]:active{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover: hover) and (pointer: fine){[data-vaul-drawer]{-webkit-user-select:none;user-select:none}}@media (pointer: fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{0%{transform:translate3d(0,var(--initial-transform, 100%),0)}to{transform:translateZ(0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform, 100%),0)}}@keyframes slideFromTop{0%{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}to{transform:translateZ(0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}}@keyframes slideFromLeft{0%{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}to{transform:translateZ(0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}}@keyframes slideFromRight{0%{transform:translate3d(var(--initial-transform, 100%),0,0)}to{transform:translateZ(0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform, 100%),0,0)}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Ag=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Sg=r=>typeof r<"u";function Mg(r){return JSON.parse(JSON.stringify(r))}function yo(r,e,t,i={}){var n,s,a;const{clone:o=!1,passive:l=!1,eventName:u,deep:d=!1,defaultValue:c,shouldEmit:h}=i,p=oa(),m=t||p?.emit||((n=p?.$emit)==null?void 0:n.bind(p))||((a=(s=p?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(p?.proxy));let g=u;e||(e="modelValue"),g=g||`update:${e.toString()}`;const y=w=>o?typeof o=="function"?o(w):Mg(w):w,b=()=>Sg(r[e])?y(r[e]):c,x=w=>{h?h(w)&&m(g,w):m(g,w)};if(l){const w=b(),A=z(w);let q=!1;return _e(()=>r[e],M=>{q||(q=!0,A.value=y(M),Ye(()=>q=!1))}),_e(A,M=>{!q&&(M!==r[e]||d)&&x(M)},{deep:d}),A}else return k({get(){return b()},set(w){x(w)}})}const[Lr,Bg]=Re("DrawerRoot"),hu=new WeakMap;function Le(r,e,t=!1){if(!r||!(r instanceof HTMLElement)||!e)return;const i={};Object.entries(e).forEach(([n,s])=>{if(n.startsWith("--")){r.style.setProperty(n,s);return}i[n]=r.style[n],r.style[n]=s}),!t&&hu.set(r,i)}function qg(r,e){if(!r||!(r instanceof HTMLElement))return;const t=hu.get(r);t&&Object.entries(t).forEach(([i,n])=>{r.style[i]=n})}function rn(r,e){const t=window.getComputedStyle(r),i=t.transform||t.webkitTransform||t.mozTransform;let n=i.match(/^matrix3d\((.+)\)$/);return n?Number.parseFloat(n[1].split(", ")[Oe(e)?13:12]):(n=i.match(/^matrix\((.+)\)$/),n?Number.parseFloat(n[1].split(", ")[Oe(e)?5:4]):null)}function kg(r){return 8*(Math.log(r+1)-2)}function Oe(r){switch(r){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return r}}function ds(r,e){if(!r)return()=>{};const t=r.style.cssText;return Object.assign(r.style,e),()=>{r.style.cssText=t}}function Eg(...r){return(...e)=>{for(const t of r)typeof t=="function"&&t(...e)}}const ve={DURATION:.5,EASE:[.32,.72,0,1]},fu=.4,Fg=.25,Og=100,pu=8,nn=16,mu=26,vo="vaul-dragging";function zg({activeSnapPoint:r,snapPoints:e,drawerRef:t,overlayRef:i,fadeFromIndex:n,onSnapPointChange:s,direction:a}){const o=z(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);function l(){o.value={innerWidth:window.innerWidth,innerHeight:window.innerHeight}}He(()=>{typeof window<"u"&&window.addEventListener("resize",l)}),Bd(()=>{typeof window<"u"&&window.removeEventListener("resize",l)});const u=k(()=>(e.value&&r.value===e.value[e.value.length-1])??null),d=k(()=>e.value&&e.value.length>0&&(n?.value||n?.value===0)&&!Number.isNaN(n?.value)&&e.value[n?.value??-1]===r.value||!e.value),c=k(()=>{var x;return((x=e.value)==null?void 0:x.findIndex(w=>w===r.value))??null}),h=k(()=>{var x;return((x=e.value)==null?void 0:x.map(w=>{const A=typeof w=="string";let q=0;if(A&&(q=Number.parseInt(w,10)),Oe(a.value)){const B=A?q:o.value?w*o.value.innerHeight:0;return o.value?a.value==="bottom"?o.value.innerHeight-B:-o.value.innerHeight+B:B}const M=A?q:o.value?w*o.value.innerWidth:0;return o.value?a.value==="right"?o.value.innerWidth-M:-o.value.innerWidth+M:M}))??[]}),p=k(()=>{var x;return c.value!==null?(x=h.value)==null?void 0:x[c.value]:null}),m=x=>{var w,A,q,M;const B=((w=h.value)==null?void 0:w.findIndex(H=>H===x))??null;Ye(()=>{var H;s(B,h.value),Le((H=t.value)==null?void 0:H.$el,{transition:`transform ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`,transform:Oe(a.value)?`translate3d(0, ${x}px, 0)`:`translate3d(${x}px, 0, 0)`})}),h.value&&B!==h.value.length-1&&B!==n?.value?Le((A=i.value)==null?void 0:A.$el,{transition:`opacity ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`,opacity:"0"}):Le((q=i.value)==null?void 0:q.$el,{transition:`opacity ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`,opacity:"1"}),r.value=B!==null?((M=e.value)==null?void 0:M[B])??null:null};_e([r,h,e],()=>{var x;if(r.value){const w=((x=e.value)==null?void 0:x.findIndex(A=>A===r.value))??-1;h.value&&w!==-1&&typeof h.value[w]=="number"&&m(h.value[w])}},{immediate:!0});function g({draggedDistance:x,closeDrawer:w,velocity:A,dismissible:q}){var M,B,H;if(n.value===void 0)return;const E=a.value==="bottom"||a.value==="right"?(p.value??0)-x:(p.value??0)+x,R=c.value===n.value-1,U=c.value===0,W=x>0;if(R&&Le((M=i.value)==null?void 0:M.$el,{transition:`opacity ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`}),A>2&&!W){q?w():m(h.value[0]);return}if(A>2&&W&&h&&e.value){m(h.value[e.value.length-1]);return}const te=(B=h.value)==null?void 0:B.reduce((oe,J)=>typeof oe!="number"||typeof J!="number"?oe:Math.abs(J-E)<Math.abs(oe-E)?J:oe),Q=Oe(a.value)?window.innerHeight:window.innerWidth;if(A>fu&&Math.abs(x)<Q*.4){const oe=W?1:-1;if(oe>0&&u){m(h.value[(((H=e.value)==null?void 0:H.length)??0)-1]);return}if(U&&oe<0&&q&&w(),c.value===null)return;m(h.value[c.value+oe]);return}m(te)}function y({draggedDistance:x}){var w;if(p.value===null)return;const A=a.value==="bottom"||a.value==="right"?p.value-x:p.value+x;(a.value==="bottom"||a.value==="right")&&A<h.value[h.value.length-1]||(a.value==="top"||a.value==="left")&&A>h.value[h.value.length-1]||Le((w=t.value)==null?void 0:w.$el,{transform:Oe(a.value)?`translate3d(0, ${A}px, 0)`:`translate3d(${A}px, 0, 0)`})}function b(x,w){if(!e.value||typeof c.value!="number"||!h.value||n.value===void 0)return null;const A=c.value===n.value-1;if(c.value>=n.value&&w)return 0;if(A&&!w)return 1;if(!d.value&&!A)return null;const q=A?c.value+1:c.value-1,M=A?h.value[q]-h.value[q-1]:h.value[q+1]-h.value[q],B=x/Math.abs(M);return A?1-B:B}return{isLastSnapPoint:u,shouldFade:d,getPercentageDragged:b,activeSnapPointIndex:c,onRelease:g,onDrag:y,snapPointsOffset:h}}function bo(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}let mr=null;function Ig(r){const{isOpen:e,modal:t,nested:i,hasBeenOpened:n,preventScrollRestoration:s,noBodyStyles:a}=r,o=z(typeof window<"u"?window.location.href:""),l=z(0);function u(){if(bo()&&mr===null&&e.value&&!a.value){mr={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height};const{scrollX:c,innerHeight:h}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.value}px`,left:`${-c}px`,right:"0px",height:"auto"}),setTimeout(()=>{requestAnimationFrame(()=>{const p=h-window.innerHeight;p&&l.value>=h&&(document.body.style.top=`-${l.value+p}px`)})},300)}}function d(){if(bo()&&mr!==null&&!a.value){const c=-Number.parseInt(document.body.style.top,10),h=-Number.parseInt(document.body.style.left,10);Object.assign(document.body.style,mr),window.requestAnimationFrame(()=>{if(s.value&&o.value!==window.location.href){o.value=window.location.href;return}window.scrollTo(h,c)}),mr=null}}return He(()=>{function c(){l.value=window.scrollY}c(),window.addEventListener("scroll",c),Mi(()=>{window.removeEventListener("scroll",c)})}),_e([e,n,o],()=>{i.value||!n.value||(e.value?(window.matchMedia("(display-mode: standalone)").matches||u(),t.value||setTimeout(()=>{d()},500)):d())}),{restorePositionSetting:d}}function Tg(r,e){return r&&r.value?r:e}function Pg(r){const{emitDrag:e,emitRelease:t,emitClose:i,emitOpenChange:n,open:s,dismissible:a,nested:o,modal:l,shouldScaleBackground:u,setBackgroundColorOnScale:d,scrollLockTimeout:c,closeThreshold:h,activeSnapPoint:p,fadeFromIndex:m,direction:g,noBodyStyles:y,handleOnly:b,preventScrollRestoration:x}=r,w=z(s.value??!1),A=z(!1),q=z(!1),M=z(!1),B=z(null),H=z(null),E=z(null),R=z(null),U=z(null),W=z(!1),te=z(null),Q=z(0),oe=z(!1);z(0);const J=z(null);z(0);const ee=k(()=>{var ie;return((ie=J.value)==null?void 0:ie.$el.getBoundingClientRect().height)||0}),Y=Tg(r.snapPoints,z(void 0)),he=k(()=>{var ie;return Y&&(((ie=Y.value)==null?void 0:ie.length)??0)>0}),se=z(null),{activeSnapPointIndex:ye,onRelease:fr,snapPointsOffset:Ku,onDrag:Xu,shouldFade:Da,getPercentageDragged:Yu}=zg({snapPoints:Y,activeSnapPoint:p,drawerRef:J,fadeFromIndex:m,overlayRef:B,onSnapPointChange:Ju,direction:g});function Ju(ie,Ae){Y.value&&ie===Ae.length-1&&(H.value=new Date)}Ig({isOpen:w,modal:l,nested:o,hasBeenOpened:A,noBodyStyles:y,preventScrollRestoration:x});function Gr(){return(window.innerWidth-mu)/window.innerWidth}function $a(ie,Ae){var Pe;if(!ie)return!1;let ge=ie;const Ne=(Pe=window.getSelection())==null?void 0:Pe.toString(),Je=J.value?rn(J.value.$el,g.value):null,bt=new Date;if(ge.hasAttribute("data-vaul-no-drag")||ge.closest("[data-vaul-no-drag]"))return!1;if(g.value==="right"||g.value==="left")return!0;if(H.value&&bt.getTime()-H.value.getTime()<500)return!1;if(Je!==null&&(g.value==="bottom"?Je>0:Je<0))return!0;if(Ne&&Ne.length>0)return!1;if(U.value&&bt.getTime()-U.value.getTime()<c.value&&Je===0||Ae)return U.value=bt,!1;for(;ge;){if(ge.scrollHeight>ge.clientHeight){if(ge.scrollTop!==0)return U.value=new Date,!1;if(ge.getAttribute("role")==="dialog")return!0}ge=ge.parentNode}return!0}function Zu(ie){!a.value&&!Y.value||J.value&&!J.value.$el.contains(ie.target)||(q.value=!0,E.value=new Date,ie.target.setPointerCapture(ie.pointerId),Q.value=Oe(g.value)?ie.clientY:ie.clientX)}function Qu(ie){var Ae,Pe,ge,Ne,Je,bt;if(J.value&&q.value){const Fi=g.value==="bottom"||g.value==="right"?1:-1,Kr=(Q.value-(Oe(g.value)?ie.clientY:ie.clientX))*Fi,Xr=Kr>0,Ha=Y.value&&!a.value&&!Xr;if(Ha&&ye.value===0)return;const ts=Math.abs(Kr),Na=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");let pi=ts/ee.value;const Va=Yu(ts,Xr);if(Va!==null&&(pi=Va),Ha&&pi>=1||!W.value&&!$a(ie.target,Xr))return;if((Ae=J?.value)==null||Ae.$el.classList.add(vo),W.value=!0,Le((Pe=J.value)==null?void 0:Pe.$el,{transition:"none"}),Le((ge=B.value)==null?void 0:ge.$el,{transition:"none"}),Y.value&&Xu({draggedDistance:Kr}),Xr&&!Y.value){const mi=kg(Kr),Yr=Math.min(mi*-1,0)*Fi;Le((Ne=J.value)==null?void 0:Ne.$el,{transform:Oe(g.value)?`translate3d(0, ${Yr}px, 0)`:`translate3d(${Yr}px, 0, 0)`});return}const nd=1-pi;if((Da.value||m.value&&ye.value===m.value-1)&&(e(pi),Le((Je=B.value)==null?void 0:Je.$el,{opacity:`${nd}`,transition:"none"},!0)),Na&&B.value&&u.value){const mi=Math.min(Gr()+pi*(1-Gr()),1),Yr=8-pi*8,Ua=Math.max(0,14-pi*14);Le(Na,{borderRadius:`${Yr}px`,transform:Oe(g.value)?`scale(${mi}) translate3d(0, ${Ua}px, 0)`:`scale(${mi}) translate3d(${Ua}px, 0, 0)`,transition:"none"},!0)}if(!Y.value){const mi=ts*Fi;Le((bt=J.value)==null?void 0:bt.$el,{transform:Oe(g.value)?`translate3d(0, ${mi}px, 0)`:`translate3d(${mi}px, 0, 0)`})}}}function La(){var ie;if(!J.value)return;const Ae=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]"),Pe=rn(J.value.$el,g.value);Le(J.value.$el,{transform:"translate3d(0, 0, 0)",transition:`transform ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`}),Le((ie=B.value)==null?void 0:ie.$el,{transition:`opacity ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`,opacity:"1"}),u.value&&Pe&&Pe>0&&w.value&&Le(Ae,{borderRadius:`${pu}px`,overflow:"hidden",...Oe(g.value)?{transform:`scale(${Gr()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Gr()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ve.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ve.EASE.join(",")})`},!0)}function pr(ie){J.value&&(i(),ie||(w.value=!1),window.setTimeout(()=>{Y.value&&(p.value=Y.value[0])},ve.DURATION*1e3))}gt(()=>{if(!w.value&&u.value&&Ag){const ie=setTimeout(()=>{qg(document.body)},200);return()=>clearTimeout(ie)}}),_e(s,()=>{w.value=s.value,s.value||pr()});function ed(ie){if(!q.value||!J.value)return;J.value.$el.classList.remove(vo),W.value=!1,q.value=!1,R.value=new Date;const Ae=rn(J.value.$el,g.value);if(!$a(ie.target,!1)||!Ae||Number.isNaN(Ae)||E.value===null)return;const Pe=R.value.getTime()-E.value.getTime(),ge=Q.value-(Oe(g.value)?ie.clientY:ie.clientX),Ne=Math.abs(ge)/Pe;if(Ne>.05&&(M.value=!0,window.setTimeout(()=>{M.value=!1},200)),Y.value){const bt=g.value==="bottom"||g.value==="right"?1:-1;fr({draggedDistance:ge*bt,closeDrawer:pr,velocity:Ne,dismissible:a.value}),t(!0);return}if(g.value==="bottom"||g.value==="right"?ge>0:ge<0){La(),t(!0);return}if(Ne>fu){pr(),t(!1);return}const Je=Math.min(J.value.$el.getBoundingClientRect().height??0,window.innerHeight);if(Ae>=Je*h.value){pr(),t(!1);return}t(!0),La()}_e(w,ie=>{ie&&(H.value=new Date),n(ie)},{immediate:!0});function td(ie){var Ae,Pe;const ge=ie?(window.innerWidth-nn)/window.innerWidth:1,Ne=ie?-16:0;te.value&&window.clearTimeout(te.value),Le((Ae=J.value)==null?void 0:Ae.$el,{transition:`transform ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`,transform:`scale(${ge}) translate3d(0, ${Ne}px, 0)`}),!ie&&(Pe=J.value)!=null&&Pe.$el&&(te.value=window.setTimeout(()=>{var Je,bt;const Fi=rn((Je=J.value)==null?void 0:Je.$el,g.value);Le((bt=J.value)==null?void 0:bt.$el,{transition:"none",transform:Oe(g.value)?`translate3d(0, ${Fi}px, 0)`:`translate3d(${Fi}px, 0, 0)`})},500))}function id(ie){var Ae;if(ie<0)return;const Pe=Oe(g.value)?window.innerHeight:window.innerWidth,ge=(Pe-nn)/Pe,Ne=ge+ie*(1-ge),Je=-16+ie*nn;Le((Ae=J.value)==null?void 0:Ae.$el,{transform:Oe(g.value)?`scale(${Ne}) translate3d(0, ${Je}px, 0)`:`scale(${Ne}) translate3d(${Je}px, 0, 0)`,transition:"none"})}function rd(ie){var Ae;const Pe=Oe(g.value)?window.innerHeight:window.innerWidth,ge=ie?(Pe-nn)/Pe:1,Ne=ie?-16:0;ie&&Le((Ae=J.value)==null?void 0:Ae.$el,{transition:`transform ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`,transform:Oe(g.value)?`scale(${ge}) translate3d(0, ${Ne}px, 0)`:`scale(${ge}) translate3d(${Ne}px, 0, 0)`})}return{open:s,isOpen:w,modal:l,keyboardIsOpen:oe,hasBeenOpened:A,drawerRef:J,drawerHeightRef:ee,overlayRef:B,handleRef:se,isDragging:q,dragStartTime:E,isAllowedToDrag:W,snapPoints:Y,activeSnapPoint:p,hasSnapPoints:he,pointerStart:Q,dismissible:a,snapPointsOffset:Ku,direction:g,shouldFade:Da,fadeFromIndex:m,shouldScaleBackground:u,setBackgroundColorOnScale:d,onPress:Zu,onDrag:Qu,onRelease:ed,closeDrawer:pr,onNestedDrag:id,onNestedRelease:rd,onNestedOpenChange:td,emitClose:i,emitDrag:e,emitRelease:t,emitOpenChange:n,nested:o,handleOnly:b,noBodyStyles:y}}const gu=O({__name:"DrawerRoot",props:{activeSnapPoint:{default:void 0},closeThreshold:{default:Fg},shouldScaleBackground:{type:Boolean,default:void 0},setBackgroundColorOnScale:{type:Boolean,default:!0},scrollLockTimeout:{default:Og},fixed:{type:Boolean,default:void 0},dismissible:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},nested:{type:Boolean,default:!1},direction:{default:"bottom"},noBodyStyles:{type:Boolean},handleOnly:{type:Boolean,default:!1},preventScrollRestoration:{type:Boolean},snapPoints:{default:void 0},fadeFromIndex:{default:void 0}},emits:["drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(r,{expose:e,emit:t}){const i=r,n=t;We();const s=k(()=>i.fadeFromIndex??(i.snapPoints&&i.snapPoints.length-1)),a=yo(i,"open",n,{defaultValue:i.defaultOpen,passive:i.open===void 0}),o=yo(i,"activeSnapPoint",n,{passive:i.activeSnapPoint===void 0}),l={emitDrag:m=>n("drag",m),emitRelease:m=>n("release",m),emitClose:()=>n("close"),emitOpenChange:m=>{n("update:open",m),setTimeout(()=>{n("animationEnd",m)},ve.DURATION*1e3)}},{closeDrawer:u,hasBeenOpened:d,modal:c,isOpen:h}=Bg(Pg({...l,...vt(i),activeSnapPoint:o,fadeFromIndex:s,open:a}));function p(m){if(a.value!==void 0){l.emitOpenChange(m);return}h.value=m,m?d.value=!0:u()}return e({open:h}),(m,g)=>(v(),C(f(pa),{open:f(h),modal:f(c),"onUpdate:open":p},{default:_(()=>[S(m.$slots,"default",{open:f(h)})]),_:3},8,["open","modal"]))}}),Rg=O({__name:"DrawerRootNested",props:{activeSnapPoint:{},closeThreshold:{},shouldScaleBackground:{type:Boolean},setBackgroundColorOnScale:{type:Boolean},scrollLockTimeout:{},fixed:{type:Boolean},dismissible:{type:Boolean},modal:{type:Boolean},open:{type:Boolean},defaultOpen:{type:Boolean},nested:{type:Boolean},direction:{},noBodyStyles:{type:Boolean},handleOnly:{type:Boolean},preventScrollRestoration:{type:Boolean},snapPoints:{},fadeFromIndex:{}},emits:["drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(r,{emit:e}){const t=r,i=e,{onNestedDrag:n,onNestedOpenChange:s,onNestedRelease:a}=Lr();function o(){s(!1)}function l(c){n(c)}function u(c){c&&s(c),i("update:open",c)}const d=Ce(t,i);return(c,h)=>(v(),C(gu,L(f(d),{nested:"",onClose:o,onDrag:l,onRelease:f(a),"onUpdate:open":u}),{default:_(()=>[S(c.$slots,"default")]),_:3},16,["onRelease"]))}}),Dg=O({__name:"DrawerOverlay",setup(r){const{overlayRef:e,hasSnapPoints:t,isOpen:i,shouldFade:n}=Lr();return(s,a)=>(v(),C(f(En),{ref_key:"overlayRef",ref:e,"data-vaul-overlay":"","data-vaul-snap-points":f(i)&&f(t)?"true":"false","data-vaul-snap-points-overlay":f(i)&&f(n)?"true":"false"},null,8,["data-vaul-snap-points","data-vaul-snap-points-overlay"]))}}),$g=()=>()=>{};function Lg(){const{direction:r,isOpen:e,shouldScaleBackground:t,setBackgroundColorOnScale:i,noBodyStyles:n}=Lr(),s=z(null),a=z(document.body.style.backgroundColor);function o(){return(window.innerWidth-mu)/window.innerWidth}gt(l=>{if(e.value&&t.value){s.value&&clearTimeout(s.value);const u=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!u)return;Eg(i.value&&!n.value?ds(document.body,{background:"black"}):$g,ds(u,{transformOrigin:Oe(r.value)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ve.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ve.EASE.join(",")})`}));const d=ds(u,{borderRadius:`${pu}px`,overflow:"hidden",...Oe(r.value)?{transform:`scale(${o()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${o()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});l(()=>{d(),s.value=window.setTimeout(()=>{a.value?document.body.style.background=a.value:document.body.style.removeProperty("background")},ve.DURATION*1e3)})}},{flush:"pre"})}const Hg=O({__name:"DrawerContent",setup(r){const{open:e,isOpen:t,snapPointsOffset:i,hasSnapPoints:n,drawerRef:s,onPress:a,onDrag:o,onRelease:l,modal:u,emitOpenChange:d,dismissible:c,keyboardIsOpen:h,closeDrawer:p,direction:m,handleOnly:g}=Lr();Lg();const y=z(!1),b=k(()=>i.value&&i.value.length>0?`${i.value[0]}px`:"0");function x(q){if(!u.value||q.defaultPrevented){q.preventDefault();return}h.value&&(h.value=!1),c.value?d(!1):q.preventDefault()}function w(q){g.value||a(q)}function A(q){g.value||o(q)}return gt(()=>{n.value&&window.requestAnimationFrame(()=>{y.value=!0})}),(q,M)=>(v(),C(f(va),{ref_key:"drawerRef",ref:s,"data-vaul-drawer":"","data-vaul-drawer-direction":f(m),"data-vaul-delayed-snap-points":y.value?"true":"false","data-vaul-snap-points":f(t)&&f(n)?"true":"false",style:qt({"--snap-point-height":b.value}),onPointerdown:w,onPointermove:A,onPointerup:f(l),onPointerDownOutside:x,onOpenAutoFocus:M[0]||(M[0]=fe(()=>{},["prevent"])),onEscapeKeyDown:M[1]||(M[1]=B=>{f(c)||B.preventDefault()})},{default:_(()=>[S(q.$slots,"default")]),_:3},8,["data-vaul-drawer-direction","data-vaul-delayed-snap-points","data-vaul-snap-points","style","onPointerup"]))}}),Ng=["data-vaul-drawer-visible"],Vg={"data-vaul-handle-hitarea":"","aria-hidden":"true"},Ug=250,jg=120,Wg=O({__name:"DrawerHandle",props:{preventCycle:{type:Boolean,default:!1}},setup(r){const e=r,{onPress:t,onDrag:i,handleRef:n,handleOnly:s,isOpen:a,snapPoints:o,activeSnapPoint:l,isDragging:u,dismissible:d,closeDrawer:c}=Lr(),h=z(null),p=z(!1);function m(){if(p.value){b();return}window.setTimeout(()=>{g()},jg)}function g(){if(u.value||e.preventCycle||p.value){b();return}if(b(),!o.value||o.value.length===0){d.value||c();return}const A=l.value===o.value[o.value.length-1];if(A&&d.value){c();return}const q=o.value.findIndex(B=>B===l.value);if(q===-1)return;const M=A?0:q+1;l.value=o.value[M]}function y(){h.value=window.setTimeout(()=>{p.value=!0},Ug)}function b(){h.value&&window.clearTimeout(h.value),p.value=!1}function x(A){s.value&&t(A),y()}function w(A){s.value&&i(A)}return(A,q)=>(v(),N("div",{ref_key:"handleRef",ref:n,"data-vaul-drawer-visible":f(a)?"true":"false","data-vaul-handle":"","aria-hidden":"true",onClick:m,onPointercancel:b,onPointerdown:x,onPointermove:w},[T("span",Vg,[S(A.$slots,"default")])],40,Ng))}}),Gg={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default ring ring-default flex focus:outline-none",handle:["shrink-0 !bg-accented","transition-opacity"],container:"w-full flex flex-col gap-4 p-4 overflow-y-auto",header:"",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",body:"flex-1",footer:"flex flex-col gap-1.5"},variants:{direction:{top:{content:"mb-24 flex-col-reverse",handle:"mb-4"},right:{content:"flex-row",handle:"!ml-4"},bottom:{content:"mt-24 flex-col",handle:"mt-4"},left:{content:"flex-row-reverse",handle:"!mr-4"}},inset:{true:{content:"rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]"}},snapPoints:{true:""}},compoundVariants:[{direction:["top","bottom"],class:{content:"h-auto max-h-[96%]",handle:"!w-12 !h-1.5 mx-auto"}},{direction:["top","bottom"],snapPoints:!0,class:{content:"h-full"}},{direction:["right","left"],class:{content:"w-auto max-w-[calc(100%-2rem)]",handle:"!h-12 !w-1.5 mt-auto mb-auto"}},{direction:["right","left"],snapPoints:!0,class:{content:"w-full"}},{direction:"top",inset:!0,class:{content:"inset-x-4 top-4"}},{direction:"top",inset:!1,class:{content:"inset-x-0 top-0 rounded-b-lg"}},{direction:"bottom",inset:!0,class:{content:"inset-x-4 bottom-4"}},{direction:"bottom",inset:!1,class:{content:"inset-x-0 bottom-0 rounded-t-lg"}},{direction:"left",inset:!0,class:{content:"inset-y-4 left-4"}},{direction:"left",inset:!1,class:{content:"inset-y-0 left-0 rounded-r-lg"}},{direction:"right",inset:!0,class:{content:"inset-y-4 right-4"}},{direction:"right",inset:!1,class:{content:"inset-y-0 right-0 rounded-l-lg"}}]},Kg={__name:"UDrawer",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},inset:{type:Boolean,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},handle:{type:Boolean,required:!1,default:!0},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},nested:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},activeSnapPoint:{type:[Number,String,null],required:!1},closeThreshold:{type:Number,required:!1},shouldScaleBackground:{type:Boolean,required:!1},setBackgroundColorOnScale:{type:Boolean,required:!1},scrollLockTimeout:{type:Number,required:!1},fixed:{type:Boolean,required:!1},dismissible:{type:Boolean,required:!1,default:!0},modal:{type:Boolean,required:!1,default:!0},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},direction:{type:String,required:!1,default:"bottom"},noBodyStyles:{type:Boolean,required:!1},handleOnly:{type:Boolean,required:!1},preventScrollRestoration:{type:Boolean,required:!1},snapPoints:{type:Array,required:!1}},emits:["close:prevent","drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(r,{emit:e}){const t=r,i=e,n=We(),s=Te(),a=Ce(Ft(t,"activeSnapPoint","closeThreshold","shouldScaleBackground","setBackgroundColorOnScale","scrollLockTimeout","fixed","dismissible","modal","open","defaultOpen","nested","direction","noBodyStyles","handleOnly","preventScrollRestoration","snapPoints"),i),o=lr(je(()=>t.portal)),l=je(()=>t.content),u=k(()=>t.dismissible?{}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((h,p)=>(h[p]=m=>{m.preventDefault(),i("close:prevent")},h),{})),d=k(()=>ue({extend:ue(Gg),...s.ui?.drawer||{}})({direction:t.direction,inset:t.inset,snapPoints:t.snapPoints&&t.snapPoints.length>0}));return(c,h)=>(v(),C(or(r.nested?f(Rg):f(gu)),ae(le(f(a))),{default:_(()=>[n.default?(v(),C(f(xa),{key:0,"as-child":"",class:I(t.class)},{default:_(()=>[S(c.$slots,"default")]),_:3},8,["class"])):D("",!0),F(f(ba),ae(le(f(o))),{default:_(()=>[r.overlay?(v(),C(f(Dg),{key:0,"data-slot":"overlay",class:I(d.value.overlay({class:t.ui?.overlay}))},null,8,["class"])):D("",!0),F(f(Hg),L({"data-slot":"content",class:d.value.content({class:[!n.default&&t.class,t.ui?.content]})},l.value,Tr(u.value)),{default:_(()=>[r.handle?(v(),C(f(Wg),{key:0,"data-slot":"handle",class:I(d.value.handle({class:t.ui?.handle}))},null,8,["class"])):D("",!0),n.content&&(r.title||n.title||r.description||n.description)?(v(),C(f(Ir),{key:1},{default:_(()=>[r.title||n.title?(v(),C(f(rr),{key:0},{default:_(()=>[S(c.$slots,"title",{},()=>[ce(Z(r.title),1)])]),_:3})):D("",!0),r.description||n.description?(v(),C(f(ir),{key:1},{default:_(()=>[S(c.$slots,"description",{},()=>[ce(Z(r.description),1)])]),_:3})):D("",!0)]),_:3})):D("",!0),S(c.$slots,"content",{},()=>[T("div",{"data-slot":"container",class:I(d.value.container({class:t.ui?.container}))},[n.header||r.title||n.title||r.description||n.description?(v(),N("div",{key:0,"data-slot":"header",class:I(d.value.header({class:t.ui?.header}))},[S(c.$slots,"header",{},()=>[r.title||n.title?(v(),C(f(rr),{key:0,"data-slot":"title",class:I(d.value.title({class:t.ui?.title}))},{default:_(()=>[S(c.$slots,"title",{},()=>[ce(Z(r.title),1)])]),_:3},8,["class"])):D("",!0),r.description||n.description?(v(),C(f(ir),{key:1,"data-slot":"description",class:I(d.value.description({class:t.ui?.description}))},{default:_(()=>[S(c.$slots,"description",{},()=>[ce(Z(r.description),1)])]),_:3},8,["class"])):D("",!0)])],2)):D("",!0),n.body?(v(),N("div",{key:1,"data-slot":"body",class:I(d.value.body({class:t.ui?.body}))},[S(c.$slots,"body")],2)):D("",!0),n.footer?(v(),N("div",{key:2,"data-slot":"footer",class:I(d.value.footer({class:t.ui?.footer}))},[S(c.$slots,"footer")],2)):D("",!0)],2)])]),_:3},16,["class"])]),_:3},16)]),_:3},16))}},Xg={slots:{root:"bg-default/75 backdrop-blur border-b border-default h-(--ui-header-height) sticky top-0 z-50",container:"flex items-center justify-between gap-3 h-full",left:"lg:flex-1 flex items-center gap-1.5",center:"hidden lg:flex",right:"flex items-center justify-end lg:flex-1 gap-1.5",title:"shrink-0 font-bold text-xl text-highlighted flex items-end gap-1.5",toggle:"lg:hidden",content:"lg:hidden",overlay:"lg:hidden",header:"px-4 sm:px-6 h-(--ui-header-height) shrink-0 flex items-center justify-between gap-3",body:"p-4 sm:p-6 overflow-y-auto"},variants:{toggleSide:{left:{toggle:"-ms-1.5"},right:{toggle:"-me-1.5"}}}},Yg=Object.assign({inheritAttrs:!1},{__name:"UHeader",props:qn({as:{type:null,required:!1,default:"header"},title:{type:String,required:!1,default:"Nuxt UI"},to:{type:String,required:!1,default:"/"},mode:{type:null,required:!1,default:"modal"},menu:{type:null,required:!1},toggle:{type:[Boolean,Object],required:!1,default:!0},toggleSide:{type:String,required:!1,default:"right"},class:{type:null,required:!1},ui:{type:null,required:!1}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(r){const e=r,t=We(),i=ua(r,"open",{type:Boolean,default:!1}),n=qd(),{t:s}=Bi(),a=Te(),[o,l]=_r(),[u,d]=_r(),[c,h]=_r(),p=k(()=>(t.title&&kd(t.title())||e.title||"Nuxt UI").trim());_e(()=>n.fullPath,()=>{i.value=!1});const m=k(()=>ue({extend:ue(Xg),...a.ui?.header||{}})()),g=k(()=>({slideover:wg,modal:Cg,drawer:Kg})[e.mode]),y=je(()=>Er(e.menu,{content:{onOpenAutoFocus:x=>x.preventDefault()}},e.mode==="modal"?{fullscreen:!0,transition:!1}:{}));function b(){i.value=!i.value}return(x,w)=>(v(),N(xe,null,[F(f(c),null,{default:_(()=>[S(x.$slots,"toggle",{open:i.value,toggle:b,ui:m.value},()=>[r.toggle?(v(),C(lt,L({key:0,color:"neutral",variant:"ghost","aria-label":i.value?f(s)("header.close"):f(s)("header.open"),icon:i.value?f(a).ui.icons.close:f(a).ui.icons.menu},typeof r.toggle=="object"?r.toggle:{},{"data-slot":"toggle",class:m.value.toggle({class:e.ui?.toggle,toggleSide:r.toggleSide}),onClick:b}),null,16,["aria-label","icon","class"])):D("",!0)])]),_:3}),F(f(o),null,{default:_(()=>[T("div",{"data-slot":"left",class:I(m.value.left({class:e.ui?.left}))},[r.toggleSide==="left"?(v(),C(f(h),{key:0})):D("",!0),S(x.$slots,"left",{},()=>[F(hl,{to:r.to,"aria-label":p.value,"data-slot":"title",class:I(m.value.title({class:e.ui?.title}))},{default:_(()=>[S(x.$slots,"title",{},()=>[ce(Z(r.title),1)])]),_:3},8,["to","aria-label","class"])])],2)]),_:3}),F(f(u),null,{default:_(()=>[T("div",{"data-slot":"right",class:I(m.value.right({class:e.ui?.right}))},[S(x.$slots,"right"),r.toggleSide==="right"?(v(),C(f(h),{key:0})):D("",!0)],2)]),_:3}),F(f(re),L({as:r.as},x.$attrs,{"data-slot":"root",class:m.value.root({class:[e.ui?.root,e.class]})}),{default:_(()=>[S(x.$slots,"top"),F(bg,{"data-slot":"container",class:I(m.value.container({class:e.ui?.container}))},{default:_(()=>[F(f(l)),T("div",{"data-slot":"center",class:I(m.value.center({class:e.ui?.center}))},[S(x.$slots,"default")],2),F(f(d))]),_:3},8,["class"]),S(x.$slots,"bottom")]),_:3},16,["as","class"]),F(f(g),L({open:i.value,"onUpdate:open":w[0]||(w[0]=A=>i.value=A),title:f(s)("header.title"),description:f(s)("header.description")},y.value,{ui:{overlay:m.value.overlay({class:e.ui?.overlay}),content:m.value.content({class:e.ui?.content})}}),{content:_(A=>[S(x.$slots,"content",ae(le(A)),()=>[r.mode!=="drawer"?(v(),N("div",{key:0,"data-slot":"header",class:I(m.value.header({class:e.ui?.header}))},[F(f(l)),F(f(d))],2)):D("",!0),T("div",{"data-slot":"body",class:I(m.value.body({class:e.ui?.body}))},[S(x.$slots,"body")],2)])]),_:3},16,["open","title","description","ui"])],64))}}),Jg=Ed("/logo.svg"),Zg={};function Qg(r,e){const t=hg,i=lt,n=yg,s=Yg;return v(),C(s,null,{title:_(()=>[...e[0]||(e[0]=[T("div",{class:"flex items-center"},[T("img",{src:Jg,alt:"Tres.js",class:"h-3 mr-4"}),T("a",{class:"font-bold text-dark font-sans text-sm",href:"/",title:"Home"},[ce("Tres"),T("span",{class:"text-primary-400"},"DevTools")])],-1)])]),right:_(()=>[F(t),F(n,{text:"Open on GitHub",kbds:["meta","G"]},{default:_(()=>[F(i,{color:"neutral",variant:"ghost",size:"xs",to:"https://github.com/nuxt/ui",target:"_blank",icon:"i-simple-icons-github","aria-label":"GitHub"})]),_:1})]),_:1})}const ey=Object.assign(fl(Zg,[["render",Qg]]),{__name:"TheHeader"}),ty={slots:{base:"font-medium inline-flex items-center",label:"truncate",leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailingIcon:"shrink-0"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{xs:{base:"text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},sm:{base:"text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm",leadingIcon:"size-3",leadingAvatarSize:"3xs",trailingIcon:"size-3"},md:{base:"text-xs px-2 py-1 gap-1 rounded-md",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},lg:{base:"text-sm px-2 py-1 gap-1.5 rounded-md",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"text-base px-2.5 py-1 gap-1.5 rounded-md",leadingIcon:"size-6",leadingAvatarSize:"2xs",trailingIcon:"size-6"}},square:{true:""}},compoundVariants:[{color:"primary",variant:"solid",class:"bg-primary text-inverted"},{color:"secondary",variant:"solid",class:"bg-secondary text-inverted"},{color:"success",variant:"solid",class:"bg-success text-inverted"},{color:"info",variant:"solid",class:"bg-info text-inverted"},{color:"warning",variant:"solid",class:"bg-warning text-inverted"},{color:"error",variant:"solid",class:"bg-error text-inverted"},{color:"primary",variant:"outline",class:"text-primary ring ring-inset ring-primary/50"},{color:"secondary",variant:"outline",class:"text-secondary ring ring-inset ring-secondary/50"},{color:"success",variant:"outline",class:"text-success ring ring-inset ring-success/50"},{color:"info",variant:"outline",class:"text-info ring ring-inset ring-info/50"},{color:"warning",variant:"outline",class:"text-warning ring ring-inset ring-warning/50"},{color:"error",variant:"outline",class:"text-error ring ring-inset ring-error/50"},{color:"primary",variant:"soft",class:"bg-primary/10 text-primary"},{color:"secondary",variant:"soft",class:"bg-secondary/10 text-secondary"},{color:"success",variant:"soft",class:"bg-success/10 text-success"},{color:"info",variant:"soft",class:"bg-info/10 text-info"},{color:"warning",variant:"soft",class:"bg-warning/10 text-warning"},{color:"error",variant:"soft",class:"bg-error/10 text-error"},{color:"primary",variant:"subtle",class:"bg-primary/10 text-primary ring ring-inset ring-primary/25"},{color:"secondary",variant:"subtle",class:"bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"},{color:"success",variant:"subtle",class:"bg-success/10 text-success ring ring-inset ring-success/25"},{color:"info",variant:"subtle",class:"bg-info/10 text-info ring ring-inset ring-info/25"},{color:"warning",variant:"subtle",class:"bg-warning/10 text-warning ring ring-inset ring-warning/25"},{color:"error",variant:"subtle",class:"bg-error/10 text-error ring ring-inset ring-error/25"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"},{size:"xs",square:!0,class:"p-0.5"},{size:"sm",square:!0,class:"p-1"},{size:"md",square:!0,class:"p-1"},{size:"lg",square:!0,class:"p-1"},{size:"xl",square:!0,class:"p-1"}],defaultVariants:{color:"primary",variant:"solid",size:"md"}},hi={__name:"UBadge",props:{as:{type:null,required:!1,default:"span"},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(r){const e=r,t=We(),i=Te(),{orientation:n,size:s}=da(e),{isLeading:a,isTrailing:o,leadingIconName:l,trailingIconName:u}=pl(e),d=k(()=>ue({extend:ue(ty),...i.ui?.badge||{}})({color:e.color,variant:e.variant,size:s.value||e.size,square:e.square||!t.default&&!e.label,fieldGroup:n.value}));return(c,h)=>(v(),C(f(re),{as:r.as,"data-slot":"base",class:I(d.value.base({class:[e.ui?.base,e.class]}))},{default:_(()=>[S(c.$slots,"leading",{ui:d.value},()=>[f(a)&&f(l)?(v(),C(Me,{key:0,name:f(l),"data-slot":"leadingIcon",class:I(d.value.leadingIcon({class:e.ui?.leadingIcon}))},null,8,["name","class"])):r.avatar?(v(),C(ur,L({key:1,size:e.ui?.leadingAvatarSize||d.value.leadingAvatarSize()},r.avatar,{"data-slot":"leadingAvatar",class:d.value.leadingAvatar({class:e.ui?.leadingAvatar})}),null,16,["size","class"])):D("",!0)]),S(c.$slots,"default",{ui:d.value},()=>[r.label!==void 0&&r.label!==null?(v(),N("span",{key:0,"data-slot":"label",class:I(d.value.label({class:e.ui?.label}))},Z(r.label),3)):D("",!0)]),S(c.$slots,"trailing",{ui:d.value},()=>[f(o)&&f(u)?(v(),C(Me,{key:0,name:f(u),"data-slot":"trailingIcon",class:I(d.value.trailingIcon({class:e.ui?.trailingIcon}))},null,8,["name","class"])):D("",!0)])]),_:3},8,["as","class"]))}},iy={class:"font-mono text-xs"},ry={key:1,class:"mr-1 w-4 h-4"},ny={class:"flex items-center gap-2 flex-1 min-w-0"},sy={class:"text-gray-700 font-medium"},ay=O({__name:"TreeGraph",props:{item:{},level:{default:0}},emits:["select-object"],setup(r,{emit:e}){const t=r,i=e,n=z(t.item.defaultExpanded??!1),s=()=>{n.value=!n.value},a=()=>{i("select-object",t.item.value)},o=k(()=>t.item.children&&t.item.children.length>0),l=k(()=>({paddingLeft:`${t.level*16}px`}));return(u,d)=>{const c=Me,h=hi,p=yu;return v(),N("div",iy,[T("div",{style:qt(f(l)),class:"flex items-center py-1 hover:bg-gray-50 group cursor-pointer",onClick:a},[f(o)?(v(),N("div",{key:0,class:"mr-1 w-4 h-4 flex items-center justify-center",onClick:fe(s,["stop"])},[F(c,{name:f(n)?"i-tabler:caret-down-filled":"i-tabler:caret-right-filled",class:"w-3 h-3 text-gray-400"},null,8,["name"])])):(v(),N("div",ry)),T("div",ny,[F(c,{name:r.item.icon,class:"w-4 h-4 text-gray-600 flex-shrink-0"},null,8,["name"]),T("span",sy,Z(r.item.label),1),r.item.name?(v(),C(h,{key:0,color:"primary",size:"sm",variant:"soft"},{default:_(()=>[ce(Z(r.item.name),1)]),_:1})):D("",!0),r.item.memorySize>0?(v(),C(h,{key:1,color:"warning",size:"sm",variant:"soft"},{default:_(()=>[ce(Z(r.item.memorySize)+" KB ",1)]),_:1})):D("",!0)])],4),f(o)&&f(n)?(v(!0),N(xe,{key:0},Xe(r.item.children,m=>(v(),C(p,{key:m.key,item:m,level:r.level+1,onSelectObject:d[0]||(d[0]=g=>i("select-object",g))},null,8,["item","level"]))),128)):D("",!0)])}}}),yu=Object.assign(ay,{__name:"TreeGraph"}),oy={slots:{root:"relative overflow-hidden w-full rounded-lg p-4 flex gap-2.5",wrapper:"min-w-0 flex-1 flex flex-col",title:"text-sm font-medium",description:"text-sm opacity-90",icon:"shrink-0 size-5",avatar:"shrink-0",avatarSize:"2xl",actions:"flex flex-wrap gap-1.5 shrink-0",close:"p-0"},variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},orientation:{horizontal:{root:"items-center",actions:"items-center"},vertical:{root:"items-start",actions:"items-start mt-2.5"}},title:{true:{description:"mt-1"}}},compoundVariants:[{color:"primary",variant:"solid",class:{root:"bg-primary text-inverted"}},{color:"secondary",variant:"solid",class:{root:"bg-secondary text-inverted"}},{color:"success",variant:"solid",class:{root:"bg-success text-inverted"}},{color:"info",variant:"solid",class:{root:"bg-info text-inverted"}},{color:"warning",variant:"solid",class:{root:"bg-warning text-inverted"}},{color:"error",variant:"solid",class:{root:"bg-error text-inverted"}},{color:"primary",variant:"outline",class:{root:"text-primary ring ring-inset ring-primary/25"}},{color:"secondary",variant:"outline",class:{root:"text-secondary ring ring-inset ring-secondary/25"}},{color:"success",variant:"outline",class:{root:"text-success ring ring-inset ring-success/25"}},{color:"info",variant:"outline",class:{root:"text-info ring ring-inset ring-info/25"}},{color:"warning",variant:"outline",class:{root:"text-warning ring ring-inset ring-warning/25"}},{color:"error",variant:"outline",class:{root:"text-error ring ring-inset ring-error/25"}},{color:"primary",variant:"soft",class:{root:"bg-primary/10 text-primary"}},{color:"secondary",variant:"soft",class:{root:"bg-secondary/10 text-secondary"}},{color:"success",variant:"soft",class:{root:"bg-success/10 text-success"}},{color:"info",variant:"soft",class:{root:"bg-info/10 text-info"}},{color:"warning",variant:"soft",class:{root:"bg-warning/10 text-warning"}},{color:"error",variant:"soft",class:{root:"bg-error/10 text-error"}},{color:"primary",variant:"subtle",class:{root:"bg-primary/10 text-primary ring ring-inset ring-primary/25"}},{color:"secondary",variant:"subtle",class:{root:"bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"}},{color:"success",variant:"subtle",class:{root:"bg-success/10 text-success ring ring-inset ring-success/25"}},{color:"info",variant:"subtle",class:{root:"bg-info/10 text-info ring ring-inset ring-info/25"}},{color:"warning",variant:"subtle",class:{root:"bg-warning/10 text-warning ring ring-inset ring-warning/25"}},{color:"error",variant:"subtle",class:{root:"bg-error/10 text-error ring ring-inset ring-error/25"}},{color:"neutral",variant:"solid",class:{root:"text-inverted bg-inverted"}},{color:"neutral",variant:"outline",class:{root:"text-highlighted bg-default ring ring-inset ring-default"}},{color:"neutral",variant:"soft",class:{root:"text-highlighted bg-elevated/50"}},{color:"neutral",variant:"subtle",class:{root:"text-highlighted bg-elevated/50 ring ring-inset ring-accented"}}],defaultVariants:{color:"primary",variant:"solid"}},vu={__name:"UAlert",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},orientation:{type:null,required:!1,default:"vertical"},actions:{type:Array,required:!1},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=e,n=We(),{t:s}=Bi(),a=Te(),o=k(()=>ue({extend:ue(oy),...a.ui?.alert||{}})({color:t.color,variant:t.variant,orientation:t.orientation,title:!!t.title||!!n.title}));return(l,u)=>(v(),C(f(re),{as:r.as,"data-orientation":r.orientation,"data-slot":"root",class:I(o.value.root({class:[t.ui?.root,t.class]}))},{default:_(()=>[S(l.$slots,"leading",{ui:o.value},()=>[r.avatar?(v(),C(ur,L({key:0,size:t.ui?.avatarSize||o.value.avatarSize()},r.avatar,{"data-slot":"avatar",class:o.value.avatar({class:t.ui?.avatar})}),null,16,["size","class"])):r.icon?(v(),C(Me,{key:1,name:r.icon,"data-slot":"icon",class:I(o.value.icon({class:t.ui?.icon}))},null,8,["name","class"])):D("",!0)]),T("div",{"data-slot":"wrapper",class:I(o.value.wrapper({class:t.ui?.wrapper}))},[r.title||n.title?(v(),N("div",{key:0,"data-slot":"title",class:I(o.value.title({class:t.ui?.title}))},[S(l.$slots,"title",{},()=>[ce(Z(r.title),1)])],2)):D("",!0),r.description||n.description?(v(),N("div",{key:1,"data-slot":"description",class:I(o.value.description({class:t.ui?.description}))},[S(l.$slots,"description",{},()=>[ce(Z(r.description),1)])],2)):D("",!0),r.orientation==="vertical"&&(r.actions?.length||n.actions)?(v(),N("div",{key:2,"data-slot":"actions",class:I(o.value.actions({class:t.ui?.actions}))},[S(l.$slots,"actions",{},()=>[(v(!0),N(xe,null,Xe(r.actions,(d,c)=>(v(),C(lt,L({key:c,size:"xs"},{ref_for:!0},d),null,16))),128))])],2)):D("",!0)],2),r.orientation==="horizontal"&&(r.actions?.length||n.actions)||r.close?(v(),N("div",{key:0,"data-slot":"actions",class:I(o.value.actions({class:t.ui?.actions,orientation:"horizontal"}))},[r.orientation==="horizontal"&&(r.actions?.length||n.actions)?S(l.$slots,"actions",{key:0},()=>[(v(!0),N(xe,null,Xe(r.actions,(d,c)=>(v(),C(lt,L({key:c,size:"xs"},{ref_for:!0},d),null,16))),128))]):D("",!0),S(l.$slots,"close",{ui:o.value},()=>[r.close?(v(),C(lt,L({key:0,icon:r.closeIcon||f(a).ui.icons.close,color:"neutral",variant:"link","aria-label":f(s)("alert.close")},typeof r.close=="object"?r.close:{},{"data-slot":"close",class:o.value.close({class:t.ui?.close}),onClick:u[0]||(u[0]=d=>i("update:open",!1))}),null,16,["icon","aria-label","class"])):D("",!0)])],2)):D("",!0)]),_:3},8,["as","data-orientation","class"]))}},ly={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],increment:"absolute flex items-center",decrement:"absolute flex items-center"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},size:{xs:"px-2 py-1 text-xs gap-1",sm:"px-2.5 py-1.5 text-xs gap-1.5",md:"px-2.5 py-1.5 text-sm gap-1.5",lg:"px-3 py-2 text-sm gap-2",xl:"px-3 py-2 text-base gap-2"},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},disabled:{true:{increment:"opacity-75 cursor-not-allowed",decrement:"opacity-75 cursor-not-allowed"}},orientation:{horizontal:{base:"text-center",increment:"inset-y-0 end-0 pe-1",decrement:"inset-y-0 start-0 ps-1"},vertical:{increment:"top-0 end-0 pe-1 [&>button]:py-0 scale-80",decrement:"bottom-0 end-0 pe-1 [&>button]:py-0 scale-80"}},highlight:{true:""},increment:{false:""},decrement:{false:""}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{orientation:"horizontal",decrement:!1,class:"text-start"},{decrement:!0,size:"xs",class:"ps-7"},{decrement:!0,size:"sm",class:"ps-8"},{decrement:!0,size:"md",class:"ps-9"},{decrement:!0,size:"lg",class:"ps-10"},{decrement:!0,size:"xl",class:"ps-11"},{increment:!0,size:"xs",class:"pe-7"},{increment:!0,size:"sm",class:"pe-8"},{increment:!0,size:"md",class:"pe-9"},{increment:!0,size:"lg",class:"pe-10"},{increment:!0,size:"xl",class:"pe-11"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},bu=Object.assign({inheritAttrs:!1},{__name:"UInputNumber",props:{as:{type:null,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},highlight:{type:Boolean,required:!1},orientation:{type:String,required:!1,default:"horizontal"},increment:{type:[Boolean,Object],required:!1,default:!0},incrementIcon:{type:null,required:!1},incrementDisabled:{type:Boolean,required:!1},decrement:{type:[Boolean,Object],required:!1,default:!0},decrementIcon:{type:null,required:!1},decrementDisabled:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1},modelModifiers:{type:Object,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},modelValue:{type:[Number,null],required:!1},defaultValue:{type:Number,required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1},stepSnapping:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},required:{type:Boolean,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},formatOptions:{type:null,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1}},emits:["update:modelValue","blur","change"],setup(r,{expose:e,emit:t}){const i=r,n=t,s=du(i,"modelValue",n,{defaultValue:i.defaultValue}),{t:a}=Bi(),o=Te(),l=Ce(Ft(i,"as","defaultValue","min","max","step","stepSnapping","formatOptions","disableWheelChange","invertWheelChange","readonly"),n),{emitFormBlur:u,emitFormFocus:d,emitFormChange:c,emitFormInput:h,id:p,color:m,size:g,name:y,highlight:b,disabled:x,ariaAttrs:w}=ca(i),{orientation:A,size:q}=da(i),M=k(()=>q.value||g.value),B=k(()=>ue({extend:ue(ly),...o.ui?.inputNumber||{}})({color:m.value,variant:i.variant,size:M.value,highlight:b.value,orientation:i.orientation,fieldGroup:A.value,increment:i.orientation==="vertical"?!!i.increment||!!i.decrement:!!i.increment,decrement:i.orientation==="vertical"?!1:!!i.decrement})),H=k(()=>i.incrementIcon||(i.orientation==="horizontal"?o.ui.icons.plus:o.ui.icons.chevronUp)),E=k(()=>i.decrementIcon||(i.orientation==="horizontal"?o.ui.icons.minus:o.ui.icons.chevronDown)),R=ml("inputRef");function U(Q){i.modelModifiers?.optional&&(Q=Q??void 0);const oe=new Event("change",{target:{value:Q}});n("change",oe),c(),h()}function W(Q){u(),n("blur",Q)}function te(){i.autofocus&&R.value?.$el?.focus()}return He(()=>{setTimeout(()=>{te()},i.autofocusDelay)}),e({inputRef:je(()=>R.value?.$el)}),(Q,oe)=>(v(),C(f(Am),L(f(l),{id:f(p),"model-value":f(s),"data-slot":"root",class:B.value.root({class:[i.ui?.root,i.class]}),name:f(y),disabled:f(x),"onUpdate:modelValue":U}),{default:_(()=>[F(f(Em),L({...Q.$attrs,...f(w)},{ref_key:"inputRef",ref:R,placeholder:r.placeholder,required:r.required,"data-slot":"base",class:B.value.base({class:i.ui?.base}),onBlur:W,onFocus:f(d)}),null,16,["placeholder","required","class","onFocus"]),r.increment?(v(),N("div",{key:0,"data-slot":"increment",class:I(B.value.increment({class:i.ui?.increment}))},[F(f(qm),{"as-child":"",disabled:f(x)||r.incrementDisabled},{default:_(()=>[S(Q.$slots,"increment",{},()=>[F(lt,L({icon:H.value,color:f(m),size:r.size,variant:"link","aria-label":f(a)("inputNumber.increment")},typeof r.increment=="object"?r.increment:void 0),null,16,["icon","color","size","aria-label"])])]),_:3},8,["disabled"])],2)):D("",!0),r.decrement?(v(),N("div",{key:1,"data-slot":"decrement",class:I(B.value.decrement({class:i.ui?.decrement}))},[F(f(Mm),{"as-child":"",disabled:f(x)||r.decrementDisabled},{default:_(()=>[S(Q.$slots,"decrement",{},()=>[F(lt,L({icon:E.value,color:f(m),size:r.size,variant:"link","aria-label":f(a)("inputNumber.decrement")},typeof r.decrement=="object"?r.decrement:void 0),null,16,["icon","color","size","aria-label"])])]),_:3},8,["disabled"])],2)):D("",!0)]),_:3},16,["id","model-value","class","name","disabled"]))}}),uy=O({__name:"EditableNumber",props:{modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,i=e,n=z(!1),s=z(0),a=z(),o=k(()=>Number(t.modelValue).toFixed(2)),l=()=>{n.value=!0,s.value=t.modelValue},u=()=>{i("update:modelValue",s.value),n.value=!1},d=()=>{s.value=t.modelValue,n.value=!1};return(c,h)=>{const p=hi,m=bu;return n.value?(v(),C(m,{key:1,ref_key:"inputRef",ref:a,modelValue:s.value,"onUpdate:modelValue":h[0]||(h[0]=g=>s.value=g),step:.01,variant:"soft",size:"xs",orientation:"vertical","format-options":{minimumFractionDigits:0,maximumFractionDigits:2},class:"w-20 font-mono",onBlur:u,onKeyup:[ht(u,["enter"]),ht(d,["escape"])]},null,8,["modelValue"])):(v(),C(p,{key:0,variant:"soft",color:"neutral",size:"sm",class:"font-mono cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700",onClick:l},{default:_(()=>[ce(Z(o.value),1)]),_:1}))}}}),dy=Object.assign(uy,{__name:"EditableNumber"}),K=255,ft=100,ai=125,Zi=150;var j,Mt,Ze,Pn;(function(r){r.HEX="HEX",r.RGB="RGB",r.HWB="HWB",r.HSL="HSL",r.CIELab="CIELab",r.LCH="LCH",r.CMYK="CMYK"})(j||(j={})),(function(r){r.ANALOGOUS="ANALOGOUS",r.COMPLEMENTARY="COMPLEMENTARY",r.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",r.TRIADIC="TRIADIC",r.TETRADIC="TETRADIC",r.SQUARE="SQUARE"})(Mt||(Mt={})),(function(r){r.ADDITIVE="ADDITIVE",r.SUBTRACTIVE="SUBTRACTIVE"})(Ze||(Ze={})),(function(r){r.black="#000000",r.silver="#C0C0C0",r.gray="#808080",r.white="#FFFFFF",r.maroon="#800000",r.red="#FF0000",r.purple="#800080",r.fuchsia="#FF00FF",r.green="#008000",r.lime="#00FF00",r.olive="#808000",r.yellow="#FFFF00",r.navy="#000080",r.blue="#0000FF",r.teal="#008080",r.aqua="#00FFFF",r.orange="#FFA500",r.aliceblue="#F0F8FF",r.antiquewhite="#FAEBD7",r.aquamarine="#7FFFD4",r.azure="#F0FFFF",r.beige="#F5F5DC",r.bisque="#FFE4C4",r.blanchedalmond="#FFEBCD",r.blueviolet="#8A2BE2",r.brown="#A52A2A",r.burlywood="#DEB887",r.cadetblue="#5F9EA0",r.chartreuse="#7FFF00",r.chocolate="#D2691E",r.coral="#FF7F50",r.cornflowerblue="#6495ED",r.cornsilk="#FFF8DC",r.crimson="#DC143C",r.cyan="#00FFFF",r.darkblue="#00008B",r.darkcyan="#008B8B",r.darkgoldenrod="#B8860B",r.darkgray="#A9A9A9",r.darkgreen="#006400",r.darkgrey="#A9A9A9",r.darkkhaki="#BDB76B",r.darkmagenta="#8B008B",r.darkolivegreen="#556B2F",r.darkorange="#FF8C00",r.darkorchid="#9932CC",r.darkred="#8B0000",r.darksalmon="#E9967A",r.darkseagreen="#8FBC8F",r.darkslateblue="#483D8B",r.darkslategray="#2F4F4F",r.darkslategrey="#2F4F4F",r.darkturquoise="#00CED1",r.darkviolet="#9400D3",r.deeppink="#FF1493",r.deepskyblue="#00BFFF",r.dimgray="#696969",r.dimgrey="#696969",r.dodgerblue="#1E90FF",r.firebrick="#B22222",r.floralwhite="#FFFAF0",r.forestgreen="#228B22",r.gainsboro="#DCDCDC",r.ghostwhite="#F8F8FF",r.gold="#FFD700",r.goldenrod="#DAA520",r.greenyellow="#ADFF2F",r.grey="#808080",r.honeydew="#F0FFF0",r.hotpink="#FF69B4",r.indianred="#CD5C5C",r.indigo="#4B0082",r.ivory="#FFFFF0",r.khaki="#F0E68C",r.lavender="#E6E6FA",r.lavenderblush="#FFF0F5",r.lawngreen="#7CFC00",r.lemonchiffon="#FFFACD",r.lightblue="#ADD8E6",r.lightcoral="#F08080",r.lightcyan="#E0FFFF",r.lightgoldenrodyellow="#FAFAD2",r.lightgray="#D3D3D3",r.lightgreen="#90EE90",r.lightgrey="#D3D3D3",r.lightpink="#FFB6C1",r.lightsalmon="#FFA07A",r.lightseagreen="#20B2AA",r.lightskyblue="#87CEFA",r.lightslategray="#778899",r.lightslategrey="#778899",r.lightsteelblue="#B0C4DE",r.lightyellow="#FFFFE0",r.limegreen="#32CD32",r.linen="#FAF0E6",r.magenta="#FF00FF",r.mediumaquamarine="#66CDAA",r.mediumblue="#0000CD",r.mediumorchid="#BA55D3",r.mediumpurple="#9370DB",r.mediumseagreen="#3CB371",r.mediumslateblue="#7B68EE",r.mediumspringgreen="#00FA9A",r.mediumturquoise="#48D1CC",r.mediumvioletred="#C71585",r.midnightblue="#191970",r.mintcream="#F5FFFA",r.mistyrose="#FFE4E1",r.moccasin="#FFE4B5",r.navajowhite="#FFDEAD",r.oldlace="#FDF5E6",r.olivedrab="#6B8E23",r.orangered="#FF4500",r.orchid="#DA70D6",r.palegoldenrod="#EEE8AA",r.palegreen="#98FB98",r.paleturquoise="#AFEEEE",r.palevioletred="#DB7093",r.papayawhip="#FFEFD5",r.peachpuff="#FFDAB9",r.peru="#CD853F",r.pink="#FFC0CB",r.plum="#DDA0DD",r.powderblue="#B0E0E6",r.rosybrown="#BC8F8F",r.royalblue="#4169E1",r.saddlebrown="#8B4513",r.salmon="#FA8072",r.sandybrown="#F4A460",r.seagreen="#2E8B57",r.seashell="#FFF5EE",r.sienna="#A0522D",r.skyblue="#87CEEB",r.slateblue="#6A5ACD",r.slategray="#708090",r.slategrey="#708090",r.snow="#FFFAFA",r.springgreen="#00FF7F",r.steelblue="#4682B4",r.tan="#D2B48C",r.thistle="#D8BFD8",r.tomato="#FF6347",r.turquoise="#40E0D0",r.violet="#EE82EE",r.wheat="#F5DEB3",r.whitesmoke="#F5F5F5",r.yellowgreen="#9ACD32",r.rebeccapurple="#663399"})(Pn||(Pn={}));const xu=Object.keys(Pn),cy={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],HWB:["H","W","B","A"],CIELab:["L","a","b","A"],LCH:["L","C","H","A"],CMYK:["C","M","Y","K","A"]},Gs={ABGR:j.RGB,ABHW:j.HWB,ACHL:j.LCH,ACKMY:j.CMYK,AHLS:j.HSL,ALAB:j.CIELab,BGR:j.RGB,BHW:j.HWB,CHL:j.LCH,CKMY:j.CMYK,HLS:j.HSL,LAB:j.CIELab};var Ar;(function(r){r.NUMBER="number",r.BOOLEAN="boolean"})(Ar||(Ar={}));const it={[j.HEX]:/^#(?:(?<r>[a-f\d])(?<g>[a-f\d])(?<b>[a-f\d])(?<a>[a-f\d])?|(?<rr>[a-f\d]{2})(?<gg>[a-f\d]{2})(?<bb>[a-f\d]{2})(?<aa>[a-f\d]{2})?)$/i,[j.RGB]:/^rgba?\s*\(\s*(?:(?<r_legacy>(?:\d*\.)?\d+%?)\s*,\s*(?<g_legacy>(?:\d*\.)?\d+%?)\s*,\s*(?<b_legacy>(?:\d*\.)?\d+%?)(?:\s*,\s*(?<a_legacy>(?:\d*\.)?\d+))?|(?<r>(?:\d*\.)?\d+%?)\s+(?<g>(?:\d*\.)?\d+%?)\s+(?<b>(?:\d*\.)?\d+%?)(?:\s*\/\s*(?<a>(?:\d*\.)?\d+%?))?|from\s+(?<from>(?:\w+|\w+\(\s*[^())]+\s*\)|\w+\(from\s+\w+\(.*\)\s*\)|#[a-fA-F\d]+))\s+(?<relative_r>(?:[rgb]|(?:\d*\.)?\d+|calc\([rgb()/*\-+\d.\s]+\)))\s+(?<relative_g>(?:[rgb]|(?:\d*\.)?\d+|calc\([rgb()/*\-+\d.\s]+\)))\s+(?<relative_b>(?:[rgb]|(?:\d*\.)?\d+|calc\([rgb()/*\-+\d.\s]+\)))(?:\s*\/\s*(?<relative_a>(?:(?:\d*\.)?\d+%?|calc\([()/*\-+\d.\s\w]*(?:alpha)?[()/*\-+\d.\s\w]*\)|alpha)))?)\s*\)$/,[j.HWB]:/^hwb\s*\(\s*(?:(?<h>(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s+(?<w>(?:\d*\.)?\d+)%\s+(?<b>(?:\d*\.)?\d+)%(?:\s*\/\s*(?<a>(?:\d*\.)?\d+%?))?|from\s+(?<from>(?:\w+|\w+\(\s*[^())]+\s*\)|\w+\(from\s+\w+\(.*\)\s*\)|#[a-fA-F\d]+))\s+(?<relative_h>(?:[hwb]|(?:\d*\.)?\d+|calc\([hwb()/*\-+\d.\s]+\)))\s+(?<relative_w>(?:[hwb]|(?:\d*\.)?\d+|calc\([hwb()/*\-+\d.\s]+\)))%?\s+(?<relative_b>(?:[hwb]|(?:\d*\.)?\d+|calc\([hwb()/*\-+\d.\s]+\)))%?(?:\s*\/\s*(?<relative_a>(?:(?:\d*\.)?\d+%?|calc\([()/*\-+\d.\s\w]*(?:alpha)?[()/*\-+\d.\s\w]*\)|alpha)))?)\s*\)$/,[j.HSL]:/^hsla?\s*\(\s*(?:(?<h_legacy>-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*(?<s_legacy>(?:\d*\.)?\d+)%\s*,\s*(?<l_legacy>(?:\d*\.)?\d+)%(?:\s*,\s*(?<a_legacy>(?:\d*\.)?\d+))?|(?<h>-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s+(?<s>(?:\d*\.)?\d+)%?\s+(?<l>(?:\d*\.)?\d+)%?(?:\s*\/\s*(?<a>(?:\d*\.)?\d+%?))?|from\s+(?<from>(?:\w+|\w+\(\s*[^())]+\s*\)|\w+\(from\s+\w+\(.*\)\s*\)|#[a-fA-F\d]+))\s+(?<relative_h>(?:[hsl]|(?:\d*\.)?\d+|calc\([hsl()/*\-+\d.\s]+\)))\s+(?<relative_s>(?:[hsl]|(?:\d*\.)?\d+|calc\([hsl()/*\-+\d.\s]+\)))%?\s+(?<relative_l>(?:[hsl]|(?:\d*\.)?\d+|calc\([hsl()/*\-+\d.\s]+\)))%?(?:\s*\/\s*(?<relative_a>(?:(?:\d*\.)?\d+%?|calc\([()/*\-+\d.\s\w]*(?:alpha)?[()/*\-+\d.\s\w]*\)|alpha)))?)\s*\)$/,[j.CIELab]:/^lab\s*\(\s*(?:(?<L>(?:\d*\.)?\d+%?)\s+(?<a>-?(?:\d*\.)?\d+%?)\s+(?<b>-?(?:\d*\.)?\d+%?)(?:\s*\/\s*(?<A>(?:\d*\.)?\d+%?))?|from\s+(?<from>(?:\w+|\w+\(\s*[^())]+\s*\)|\w+\(from\s+\w+\(.*\)\s*\)|#[a-fA-F\d]+))\s+(?<relative_L>(?:[lab]|(?:\d*\.)?\d+|calc\([lab()/*\-+\d.\s]+\)))\s+(?<relative_a>(?:[lab]|(?:\d*\.)?\d+|calc\([lab()/*\-+\d.\s]+\)))\s+(?<relative_b>(?:[lab]|(?:\d*\.)?\d+|calc\([lab()/*\-+\d.\s]+\)))(?:\s*\/\s*(?<relative_A>(?:(?:\d*\.)?\d+%?|calc\([()/*\-+\d.\s\w]*(?:alpha)?[()/*\-+\d.\s\w]*\)|alpha)))?)\s*\)$/,[j.LCH]:/^lch\s*\(\s*(?:(?<l>(?:\d*\.)?\d+%?)\s+(?<c>-?(?:\d*\.)?\d+%?)\s+(?<h>-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)(?:\s*\/\s*(?<a>(?:\d*\.)?\d+%?))?|from\s+(?<from>(?:\w+|\w+\(\s*[^())]+\s*\)|\w+\(from\s+\w+\(.*\)\s*\)|#[a-fA-F\d]+))\s+(?<relative_l>(?:[lch]|(?:\d*\.)?\d+|calc\([lch()/*\-+\d.\s]+\)))\s+(?<relative_c>(?:[lch]|(?:\d*\.)?\d+|calc\([lch()/*\-+\d.\s]+\)))\s+(?<relative_h>(?:[lch]|(?:\d*\.)?\d+|calc\([lch()/*\-+\d.\s]+\)))(?:\s*\/\s*(?<relative_a>(?:(?:\d*\.)?\d+%?|calc\([()/*\-+\d.\s\w]*(?:alpha)?[()/*\-+\d.\s\w]*\)|alpha)))?)\s*\)$/,[j.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:(?<c_legacy>(?:\d*\.)?\d+%?)\s*,\s*(?<m_legacy>(?:\d*\.)?\d+%?)\s*,\s*(?<y_legacy>(?:\d*\.)?\d+%?)\s*,\s*(?<k_legacy>(?:\d*\.)?\d+%?)(?:\s*,\s*(?<a_legacy>(?:\d*\.)?\d+))?|(?<c>(?:\d*\.)?\d+%?)\s+(?<m>(?:\d*\.)?\d+%?)\s+(?<y>(?:\d*\.)?\d+%?)\s+(?<k>(?:\d*\.)?\d+%?)(?:\s*\/\s*(?<a>(?:\d*\.)?\d+%?))?)\s*\)$/},dt={REGEXP:/^calc\(\s*(?<operation>[\d./*+-\w\s]+)\s*\)$/,SCOPED:/\(\s*([^()]+)\s*\)/g,DIVISION:/\s*(?<left>(?:(?:\d*\.)?\d+|\w+))\s*\/\s*(?<right>(?:(?:\d*\.)?\d+|\w+))\s*/,MULTIPLICATION:/\s*(?<left>(?:(?:\d*\.)?\d+|\w+))\s*\*\s*(?<right>(?:(?:\d*\.)?\d+|\w+))\s*/,SUM:/\s*(?<left>(?:(?:\d*\.)?\d+|\w+))\s*\+\s*(?<right>(?:(?:\d*\.)?\d+|\w+))\s*/,REST:/\s*(?<left>(?:(?:\d*\.)?\d+|\w+))\s*-\s*(?<right>(?:(?:\d*\.)?\d+|\w+))\s*/},wu=/^(?<number>-?(?:\d*\.)?\d+)(?<units>(?:deg|grad|rad|turn)?)$/,Be=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,Ks=/^0x([a-f\d]{1,2})$/i,hy=/\{(\d+)\}/g,fy=/,( +|\d+)/g,py=/ +/,my="The provided string color doesn't have a correct format",gy="The provided color object doesn't have the proper keys or format",yy="is not a valid operation for a relative color";var Ve,ze,qr;(function(r){r.NONE="none",r.DEGREES="deg",r.GRADIANS="grad",r.RADIANS="rad",r.TURNS="turn"})(Ve||(Ve={})),(function(r){r.NONE="none",r.PERCENT="percent"})(ze||(ze={})),(function(r){r.DEVICE_CMYK="device-cmyk",r.CMYK="cmyk"})(qr||(qr={}));const It={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:Ve.NONE,rgbUnit:ze.NONE,labUnit:ze.NONE,lchUnit:ze.NONE,cmykUnit:ze.PERCENT,alphaUnit:ze.NONE,cmykFunction:qr.DEVICE_CMYK},be=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),cr=r=>+`${r}`.replace(Be,"$1"),tt=r=>Be.test(`${r}`)?cr(r):Math.min(+r,100),sn=r=>(r.length===1&&(r+=r),parseInt(r,16)),an=r=>{const e=$(r,0).toString(16).toUpperCase();return e.length===1?`0x0${e}`:`0x${e}`},_i=(r,e=!1)=>!e&&Be.test(r)?Math.min(K*cr(r)/100,K):Ks.test(r)?(r.length===3&&(r+=r.slice(-1)),e?$(r)/K:$(r)):Math.min(+r,e?1:K),Rn=r=>Be.test(r)?ne(ai*cr(r)/100,-125,ai):ne(+r,-125,ai),_u=r=>Be.test(r)?ne(Zi*cr(r)/100,-150,Zi):ne(+r,-150,Zi),ni=r=>Math.min(Be.test(r)?cr(r)/100:+r,1),Cu=r=>[...r].sort().join("").toUpperCase(),$=(r,e=6)=>{const t=Math.pow(10,e);return Math.round(+r*t)/t},ne=(r,e,t)=>Math.max(e,Math.min(r,t)),Au=r=>180*r/Math.PI,Su=r=>r*Math.PI/180,Bn=360,mt=r=>{if(typeof r=="string"){const e=r.match(wu).groups,t=+e.number;switch(e.units){case Ve.RADIANS:r=$(Au(t));break;case Ve.TURNS:r=$(t*Bn);break;case Ve.GRADIANS:r=$(.9*t);break;case Ve.DEGREES:default:r=t}}return(r>360||r<0)&&(r-=Math.floor(r/Bn)*Bn),r},me=r=>(typeof r=="string"&&(r=Be.test(r)?cr(r)/100:+r),isNaN(+r)||r>1?1:$(r)),Mu=(r,e)=>{let t;switch(e){case Ve.RADIANS:t=$(Su(r));break;case Ve.TURNS:t=$(r/Bn);break;case Ve.GRADIANS:t=$(10/9*r);break;case Ve.DEGREES:case Ve.NONE:default:t=r}return t},cs=r=>`${r}`in Ze,Bu=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],vy=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],Qi=Bu.map((r=>r.reduce(((e,t)=>e+t),0))),hs=(r,e,t)=>(t<0&&(t+=6),t>=6&&(t-=6),$(t<1?((e-r)*t+r)*K:t<3?e*K:t<4?((e-r)*(4-t)+r)*K:r*K)),by=r=>r<=.04045?r/12.92:((r+.055)/1.055)**2.4,xy=r=>r<=.0031308?12.92*r:1.055*r**(1/2.4)-.055,qu=(r,e,t,i)=>{const n=[0,0,0],s=[r,e,t];return i.forEach(((a,o)=>{a.forEach(((l,u)=>{n[o]+=l*s[u]}))})),n},pe=(r,e,t)=>{e/=100;const i=(t/=100)<=.5?t*(e+1):t+e-t*e,n=2*t-i;return{R:hs(n,i,(r/=60)+2),G:hs(n,i,r),B:hs(n,i,r-2)}},ui=(r,e,t,i=1)=>{r/=K,e/=K,t/=K,i=Math.min(i,1);const n=Math.max(r,e,t),s=Math.min(r,e,t),a=n-s;let o=0,l=0;const u=(n+s)/2;if(a!==0){switch(n){case r:o=(e-t)/a%6;break;case e:o=(t-r)/a+2;break;case t:o=(r-e)/a+4}o=$(60*o),o<0&&(o+=360),l=a/(1-Math.abs(2*u-1))}return{H:o,S:$(100*l),L:$(100*u),A:i}},di=(r,e,t)=>{const i=[r/K,e/K,t/K].map(by),n=qu(i[0],i[1],i[2],Bu),s=((a,o,l)=>{const u=h=>h>.008856451679035631?Math.cbrt(h):h/.12841854934601665+.13793103448275862,d=u(a/Qi[0]),c=u(o/Qi[1]);return[116*c-16,500*(d-c),200*(c-u(l/Qi[2]))]})(n[0],n[1],n[2]);return{L:s[0],a:s[1],b:s[2]}},kr=(r,e,t)=>{const i=((s,a,o)=>{const l=h=>h>.20689655172413793?h**3:.12841854934601665*(h-.13793103448275862),u=(s+16)/116,d=a/500,c=o/200;return[Qi[0]*l(u+d),Qi[1]*l(u),Qi[2]*l(u-c)]})(r,e,t),n=qu(i[0],i[1],i[2],vy).map(xy);return{R:ne(n[0]*K,0,K),G:ne(n[1]*K,0,K),B:ne(n[2]*K,0,K)}},ku=(r,e,t)=>{const i=Math.sqrt(e**2+t**2),n=Au(Math.atan2(t,e));return{L:r,C:i,H:mt(n)}},Eu=(r,e,t)=>{const i=Su(t);return{L:r,a:e*Math.cos(i),b:e*Math.sin(i)}},ci=(r,e,t)=>{const i=di(r,e,t);return ku(i.L,i.a,i.b)},Dn=(r,e,t)=>{const i=Eu(r,e,t);return kr(i.L,i.a,i.b)},Si=(r,e,t,i=1)=>({H:ui(r,e,t,i).H,W:$(Math.min(r,e,t)/K*100),B:$(100*(1-Math.max(r,e,t)/K)),A:i}),$n=(r,e,t)=>{const i=1-(t/=100)-(e/=100),n=i*(1-Math.abs(r/60%2-1));let s=0,a=0,o=0;return r<60?(s=i,a=n,o=0):r>=60&&r<120?(s=n,a=i,o=0):r>=120&&r<180?(s=0,a=i,o=n):r>=180&&r<240?(s=0,a=n,o=i):r>=240&&r<300?(s=n,a=0,o=i):r>=300&&(s=i,a=0,o=n),s+=e,a+=e,o+=e,{R:ne(s*K,0,K),G:ne(a*K,0,K),B:ne(o*K,0,K)}},Ia=(r,e,t,i)=>({R:$(K*(1-r)*(i=1-i)),G:$(K*(1-e)*i),B:$(K*(1-t)*i)}),Fu=(r,e,t)=>{r/=K,e/=K,t/=K;const i=1-Math.max(r,e,t),n=1-i,s=n&&(n-e)/n,a=n&&(n-t)/n;return{C:$(100*(n&&(n-r)/n)),M:$(100*s),Y:$(100*a),K:$(100*i)}},xo=(r,e)=>{if(r<0&&(r+=360),r>360&&(r-=360),r===360||r===0)return r;const t=[[0,120],[120,180],[180,240],[240,360]],i=[[0,60],[60,120],[120,240],[240,360]],n=e?i:t;let s=0,a=0,o=0,l=0;return(e?t:i).find(((u,d)=>r>=u[0]&&r<u[1]&&(s=u[0],a=u[1],o=n[d][0],l=n[d][1],!0))),o+(l-o)/(a-s)*(r-s)};class Ou{get rgb(){return this._rgb}}class wy extends Ou{constructor(e){super();const t=e.match(it.HEX).groups;this._r=t.r??t.rr,this._g=t.g??t.gg,this._b=t.b??t.bb,this._a=t.a??t.aa;const i={R:sn(this._r),G:sn(this._g),B:sn(this._b)};this._a!==void 0&&(i.A=sn(this._a)/K),this._rgb=i}}class Ie{constructor(e,t,i){this._operations=new Map([[dt.DIVISION,this._division],[dt.MULTIPLICATION,this._multiplication],[dt.SUM,this._sum],[dt.REST,this._rest]]),this._colorIndex=e;let n=t,s=0;if(Number.isNaN(+t))if(t in i)this._result=i[t];else if(dt.REGEXP.test(n))dt.REGEXP.lastIndex=0,this._result=this._getCalcValue(n,i);else{for(;dt.SCOPED.test(n)&&s<100;){if(dt.SCOPED.lastIndex=0,n=n.replace(dt.SCOPED,((a,o)=>this._calculate(o,i).toString())),dt.REGEXP.test(n)){dt.REGEXP.lastIndex=0;break}s++}this._result=this._getCalcValue(n,i)}else this._result=+t}_division(e,t){return e/t}_multiplication(e,t){return e*t}_sum(e,t){return e+t}_rest(e,t){return e-t}_getCalcValue(e,t){const i=e.match(dt.REGEXP).groups.operation,n=this._calculate(i,t);if(Number.isNaN(n))throw new Error(`Invalid value for ${this._colorIndex}. ${i} ${yy}`);return n}_calculate(e,t){return this._operations.forEach(((i,n)=>{let s=0;for(;n.test(e)&&s<100;)e=e.replace(n,((a,o,l)=>i(t[o]??+o,t[l]??+l).toString())),s++})),+e}get result(){return this._result}}class Qn extends Ou{get hasPercentageAlpha(){return Be.test(this._a)}}class Xs extends Qn{constructor(e,t){super();const i=e.match(it.RGB).groups,{r_legacy:n,g_legacy:s,b_legacy:a,a_legacy:o,r:l,g:u,b:d,a:c,from:h,relative_r:p,relative_g:m,relative_b:g,relative_a:y}=i;if(h){const b=t(h),x={r:b.R,g:b.G,b:b.B,alpha:b.A??1},w=new Ie("r",p,x).result,A=new Ie("g",m,x).result,q=new Ie("b",g,x).result,M={R:Math.min(w,K),G:Math.min(A,K),B:Math.min(q,K)};if(y){const B=new Ie("alpha",y,x).result;M.A=Math.min(B,1)}this._rgb=M}else{this._r=n??l,this._g=s??u,this._b=a??d,this._a=o??c;const b={R:Math.min(_i(this._r),K),G:Math.min(_i(this._g),K),B:Math.min(_i(this._b),K)};this._a!==void 0&&(b.A=me(this._a)),this._rgb=b}}get hasPercentageValues(){return Be.test(this._r)&&Be.test(this._g)&&Be.test(this._b)}static test(e){return it.RGB.test(e)}}class Ta extends Qn{get angleUnit(){if(this._h){const e=this._h.match(wu).groups.units;return e===""?Ve.NONE:e}return Ve.NONE}}class Ys extends Ta{constructor(e,t){super();const i=e.match(it.HSL).groups,{h_legacy:n,s_legacy:s,l_legacy:a,a_legacy:o,h:l,s:u,l:d,a:c,from:h,relative_h:p,relative_s:m,relative_l:g,relative_a:y}=i;if(h){const b=t(h),x=ui(b.R,b.G,b.B,b.A),w={h:x.H,s:x.S,l:x.L,alpha:x.A},A=new Ie("h",p,w).result,q=new Ie("s",m,w).result,M=new Ie("l",g,w).result,B=pe(ne(A,0,360),ne(q,0,ft),ne(M,0,ft));if(y){const H=new Ie("alpha",y,w).result;B.A=ne(H,0,1)}this._rgb=B}else{this._h=n??l,this._s=s??u,this._l=a??d,this._a=o??c;const b=pe(mt(this._h),tt(this._s),tt(this._l));this._a!==void 0&&(b.A=me(this._a)),this._rgb=b}}static test(e){return it.HSL.test(e)}}class Js extends Ta{constructor(e,t){super();const i=e.match(it.HWB).groups,{h:n,w:s,b:a,a:o,from:l,relative_h:u,relative_w:d,relative_b:c,relative_a:h}=i;if(l){const p=t(l),m=Si(p.R,p.G,p.B,p.A),g={h:m.H,w:m.W,b:m.B,alpha:m.A},y=new Ie("h",u,g).result,b=new Ie("w",d,g).result,x=new Ie("b",c,g).result,w=$n(ne(y,0,360),ne(b,0,ft),ne(x,0,ft));if(h){const A=new Ie("alpha",h,g).result;w.A=ne(A,0,1)}this._rgb=w}else{this._h=n,this._w=s,this._b=a,this._a=o;const p=$n(mt(this._h),tt(this._w),tt(this._b));this._a!==void 0&&(p.A=me(this._a)),this._rgb=p}}static test(e){return it.HWB.test(e)}}class Zs extends Qn{constructor(e,t){super();const i=e.match(it.CIELab).groups,{L:n,a:s,b:a,A:o,from:l,relative_L:u,relative_a:d,relative_b:c,relative_A:h}=i;if(l){const p=t(l),m=di(p.R,p.G,p.B),g={l:m.L,a:m.a,b:m.b,alpha:p.A??1},y=new Ie("l",u,g).result,b=new Ie("a",d,g).result,x=new Ie("b",c,g).result,w=kr(ne(y,0,ft),ne(b,-125,ai),ne(x,-125,ai));if(h){const A=new Ie("alpha",h,g).result;w.A=ne(A,0,1)}this._rgb=w}else{this._L=n,this._A=s,this._B=a,this._a=o;const p=kr(tt(this._L),Rn(this._A),Rn(this._B));this._a!==void 0&&(p.A=me(this._a)),this._rgb=p}}get hasPercentageValues(){return Be.test(this._L)&&Be.test(this._A)&&Be.test(this._B)}static test(e){return it.CIELab.test(e)}}class Qs extends Ta{constructor(e,t){super();const i=e.match(it.LCH).groups,{l:n,c:s,h:a,a:o,from:l,relative_l:u,relative_c:d,relative_h:c,relative_a:h}=i;if(l){const p=t(l),m=ci(p.R,p.G,p.B),g={l:m.L,c:m.C,h:m.H,alpha:p.A??1},y=new Ie("l",u,g).result,b=new Ie("c",d,g).result,x=new Ie("h",c,g).result,w=Dn(ne(y,0,ft),ne(b,-150,Zi),mt(x));if(h){const A=new Ie("alpha",h,g).result;w.A=ne(A,0,1)}this._rgb=w}else{this._l=n,this._c=s,this._h=a,this._a=o;const p=Dn(tt(this._l),_u(this._c),mt(this._h));this._a!==void 0&&(p.A=me(this._a)),this._rgb=p}}get hasPercentageValues(){return Be.test(this._l)&&Be.test(this._c)}static test(e){return it.LCH.test(e)}}class ea extends Qn{constructor(e){super();const t=e.match(it.CMYK).groups;this._c=t.c_legacy??t.c,this._m=t.m_legacy??t.m,this._y=t.y_legacy??t.y,this._k=t.k_legacy??t.k,this._a=t.a_legacy??t.a;const i=Ia(ni(this._c),ni(this._m),ni(this._y),ni(this._k));this._a!==void 0&&(i.A=me(this._a)),this._rgb=i}get hasPercentageValues(){return Be.test(this._c)&&Be.test(this._m)&&Be.test(this._y)&&Be.test(this._k)}static test(e){return it.CMYK.test(e)}}const $e=r=>typeof r=="string"?(e=>{let t;if(Object.keys(j).some((i=>{if(it[i].test(e))return t=i,!0})),!t&&~xu.indexOf(e)&&(t=j.HEX),!t)throw new Error(my);return t})(r):(e=>{let t,i=!1;const n=Cu(Object.keys(e));if(Gs[n]&&(t=Gs[n]),t&&t===j.RGB){const s=Object.entries(e).some((o=>!Ks.test(`${o[1]}`))),a=Object.entries(e).some((o=>!(Be.test(`${o[1]}`)||!Ks.test(`${o[1]}`)&&!isNaN(+o[1])&&+o[1]<=K)));s&&a&&(i=!0),s||(t=j.HEX)}if(!t||i)throw new Error(gy);return t})(r),_y={[j.HEX](r){const e=~xu.indexOf(r)?Pn[r]:r;return new wy(e).rgb},[j.RGB]:r=>new Xs(r,Ue).rgb,[j.HSL]:r=>new Ys(r,Ue).rgb,[j.HWB]:r=>new Js(r,Ue).rgb,[j.CIELab]:r=>new Zs(r,Ue).rgb,[j.LCH]:r=>new Qs(r,Ue).rgb,[j.CMYK]:r=>new ea(r).rgb},Cy={[j.HEX](r){const e={R:_i(`${r.R}`),G:_i(`${r.G}`),B:_i(`${r.B}`)};return be(r,"A")&&(e.A=Math.min(_i(`${r.A}`,!0),1)),e},[j.RGB](r){return this.HEX(r)},[j.HSL](r){const e=tt(`${r.S}`),t=tt(`${r.L}`),i=pe(mt(r.H),e,t);return be(r,"A")&&(i.A=me(r.A)),i},[j.HWB](r){const e=tt(`${r.W}`),t=tt(`${r.B}`),i=$n(mt(r.H),e,t);return be(r,"A")&&(i.A=me(r.A)),i},[j.CIELab](r){const e=tt(`${r.L}`),t=Rn(`${r.a}`),i=Rn(`${r.b}`),n=kr(e,t,i);return be(r,"A")&&(n.A=me(r.A)),n},[j.LCH](r){const e=tt(`${r.L}`),t=_u(`${r.C}`),i=mt(`${r.H}`),n=Dn(e,t,i);return be(r,"A")&&(n.A=me(r.A)),n},[j.CMYK](r){const e=ni(`${r.C}`),t=ni(`${r.M}`),i=ni(`${r.Y}`),n=ni(`${r.K}`),s=Ia(e,t,i,n);return be(r,"A")&&(s.A=me(r.A)),s}},Ue=(r,e=$e(r))=>typeof r=="string"?_y[e](r):Cy[e](r),we=(r,...e)=>{const t=[],i=[],n=[],s=[],a=[],o=[],l=[],u=Object.values(Ve),d=Object.values(ze),c=Object.values(qr),h={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const p of e)if(typeof p=="string"){if(t.push(p),p.includes(",")){h.legacyCSS++;const m=p.match(fy);new Set(m).size===1&&py.test(m[0].slice(1))&&h.spacesAfterCommas++}if(Ys.test(p)){const m=new Ys(p,Ue);i.push(m.angleUnit),l.push(m.hasPercentageAlpha);continue}if(Js.test(p)){const m=new Js(p,Ue);i.push(m.angleUnit),l.push(m.hasPercentageAlpha);continue}if(Xs.test(p)){const m=new Xs(p,Ue);n.push(m.hasPercentageValues),l.push(m.hasPercentageAlpha);continue}if(Zs.test(p)){const m=new Zs(p,Ue);s.push(m.hasPercentageValues),l.push(m.hasPercentageAlpha);continue}if(Qs.test(p)){const m=new Qs(p,Ue);i.push(m.angleUnit),a.push(m.hasPercentageValues),l.push(m.hasPercentageAlpha);continue}if(ea.test(p)){const m=new ea(p);o.push(m.hasPercentageValues),p.startsWith("cmyk")&&h.cmykFunction++,l.push(m.hasPercentageAlpha)}}return{decimals:typeof r.decimals===Ar.NUMBER?r.decimals:It.decimals,legacyCSS:typeof r.legacyCSS===Ar.BOOLEAN?r.legacyCSS:!!(t.length&&h.legacyCSS===t.length)||It.legacyCSS,spacesAfterCommas:typeof r.spacesAfterCommas===Ar.BOOLEAN?r.spacesAfterCommas:!!(t.length&&h.spacesAfterCommas===t.length)||It.spacesAfterCommas,anglesUnit:r.anglesUnit&&u.includes(r.anglesUnit)?r.anglesUnit:new Set(i).size===1?i[0]:It.anglesUnit,rgbUnit:r.rgbUnit&&d.includes(r.rgbUnit)?r.rgbUnit:new Set(n).size===1&&n[0]?ze.PERCENT:It.rgbUnit,labUnit:r.labUnit&&d.includes(r.labUnit)?r.labUnit:new Set(s).size===1&&s[0]?ze.PERCENT:It.labUnit,lchUnit:r.lchUnit&&d.includes(r.lchUnit)?r.lchUnit:new Set(a).size===1&&a[0]?ze.PERCENT:It.lchUnit,cmykUnit:r.cmykUnit&&d.includes(r.cmykUnit)?r.cmykUnit:new Set(o).size!==1||o[0]?It.cmykUnit:ze.NONE,alphaUnit:r.alphaUnit&&d.includes(r.alphaUnit)?r.alphaUnit:new Set(l).size===1&&l[0]?ze.PERCENT:It.alphaUnit,cmykFunction:r.cmykFunction&&c.includes(r.cmykFunction)?r.cmykFunction:o.length&&o.length===h.cmykFunction?qr.CMYK:It.cmykFunction}},ta=(r,e)=>({H:$(r.H,e),S:$(r.S,e),L:$(r.L,e)}),fs=r=>r?", ":",",yi=(r,e)=>{const t=Cu(Object.keys(r));return cy[Gs[t]].reduce(((i,n,s)=>{const a=r[n];return a!==void 0&&i.push(e(a,s)),i}),[])},vi=(r,e)=>r.replace(hy,((t,i)=>`${e[+i-1]}`)),wr=(r,e,t=!1)=>{const{alphaUnit:i,legacyCSS:n,decimals:s}=e;return i!==ze.PERCENT||n&&!t?$(r,s):`${$(100*r,s)}%`},wo=r=>{const{anglesUnit:e,decimals:t}=r;return(i,n)=>n===0&&e!==Ve.NONE?`${$(Mu(i,e),t)}${e}`:n===3?wr(i,r):$(i,t)},G={[j.HEX]:r=>{const e=yi(r,(i=>(n=>{let s=$(n,0).toString(16).toUpperCase();return s.length===1&&(s=`0${s}`),s})($(i)))),t=e.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return vi(t,e)},[j.RGB]:(r,e)=>{const{decimals:t,legacyCSS:i,spacesAfterCommas:n,rgbUnit:s}=e,a=fs(n),o=yi(r,((u,d)=>s===ze.PERCENT&&d<3?`${((c,h)=>$(c/K*100,h))(u,t)}%`:d===3?wr(u,e):$(u,t))),l=i?o.length===4?`rgba({1}${a}{2}${a}{3}${a}{4})`:`rgb({1}${a}{2}${a}{3})`:o.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return vi(l,o)},[j.HSL]:(r,e)=>{const{legacyCSS:t,spacesAfterCommas:i}=e,n=fs(i),s=wo(e),a=yi(r,s),o=t?a.length===4?`hsla({1}${n}{2}%${n}{3}%${n}{4})`:`hsl({1}${n}{2}%${n}{3}%)`:a.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return vi(o,a)},[j.HWB]:(r,e)=>{const t=wo(e),i=yi(r,t),n=i.length===4?"hwb({1} {2}% {3}% / {4})":"hwb({1} {2}% {3}%)";return vi(n,i)},[j.CIELab]:(r,e)=>{const{decimals:t,labUnit:i}=e,n=yi(r,((a,o)=>{if(o===0){const l=$(tt(a),t);return i===ze.PERCENT?`${l}%`:`${l}`}return o<3?i===ze.PERCENT?`${((l,u)=>$(l/ai*100,u))(a,t)}%`:$(a,t):wr(a,e,!0)})),s=n.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return vi(s,n)},[j.LCH]:(r,e)=>{const{decimals:t,lchUnit:i,anglesUnit:n}=e,s=yi(r,((o,l)=>{if(l===0){const u=$(tt(o),t);return i===ze.PERCENT?`${u}%`:`${u}`}return l===1?i===ze.PERCENT?`${((u,d)=>$(u/Zi*100,d))(o,t)}%`:$(o,t):l===2?n!==Ve.NONE?`${$(Mu(o,n),t)}${n}`:$(o,t):wr(o,e,!0)})),a=s.length===4?"lch({1} {2} {3} / {4})":"lch({1} {2} {3})";return vi(a,s)},[j.CMYK]:(r,e)=>{const{decimals:t,legacyCSS:i,spacesAfterCommas:n,cmykUnit:s,cmykFunction:a}=e,o=fs(n),l=yi(r,((d,c)=>s===ze.PERCENT&&c<4?`${$(d,t)}%`:c===4?wr(d,e):$(d/100,t))),u=i?l.length===5?`${a}({1}${o}{2}${o}{3}${o}{4}${o}{5})`:`${a}({1}${o}{2}${o}{3}${o}{4})`:l.length===5?`${a}({1} {2} {3} {4} / {5})`:`${a}({1} {2} {3} {4})`;return vi(u,l)}},hr=(r,e,t)=>e.reduce(((i,n)=>[...i,{...r,H:t===Ze.ADDITIVE?mt(r.H+n):mt(xo(xo(r.H,!1)+n,!0))}]),[{...r}]),Ay=(r,e)=>hr(r,[30,-30],e),Sy=(r,e)=>hr(r,[180],e),My=(r,e)=>hr(r,[150,-150],e),By=(r,e)=>hr(r,[120,-120],e),qy=(r,e)=>hr(r,[60,-120,180],e),ky=(r,e)=>hr(r,[90,-90,180],e),V={[j.HEX]:r=>({R:an(r.R),G:an(r.G),B:an(r.B)}),HEXA(r){const e=V.HEX(r);return e.A=be(r,"A")?an(r.A*K):"0xFF",e},[j.RGB](r,e){const t=Ey(r,e);return be(t,"A")&&delete t.A,t},RGBA(r,e){const t=V.RGB(r,e);return t.A=be(r,"A")?$(r.A):1,t},[j.HSL](r,e){const t=ui(r.R,r.G,r.B);return delete t.A,ta(t,e)},HSLA(r,e){const t=V.HSL(r,e);return t.A=be(r,"A")?$(r.A,e):1,t},[j.HWB](r,e){const t=Si(r.R,r.G,r.B);return delete t.A,((i,n)=>({H:$(i.H,n),W:$(i.W,n),B:$(i.B,n)}))(t,e)},HWBA(r,e){const t=V.HWB(r,e);return t.A=be(r,"A")?$(r.A,e):1,t},[j.CIELab]:(r,e)=>((t,i)=>({L:$(t.L,i),a:$(t.a,i),b:$(t.b,i)}))(di(r.R,r.G,r.B),e),CIELabA(r,e){const t=V.CIELab(r,e);return t.A=be(r,"A")?$(r.A,e):1,t},[j.LCH]:(r,e)=>((t,i)=>({L:$(t.L,i),C:$(t.C,i),H:$(t.H,i)}))(ci(r.R,r.G,r.B),e),LCHA(r,e){const t=V.LCH(r,e);return t.A=be(r,"A")?$(r.A,e):1,t},[j.CMYK]:(r,e)=>((t,i)=>({C:$(t.C,i),M:$(t.M,i),Y:$(t.Y,i),K:$(t.K,i)}))(Fu(r.R,r.G,r.B),e),CMYKA(r,e){const t=V.CMYK(r,e);return t.A=be(r,"A")?$(r.A,e):1,t}},on=(r,e,t,i)=>{const n=$e(r),s=typeof r=="string",a=Ue(r,n),o=typeof r=="string"&&be(a,"A")||typeof r!="string"&&be(r,"A"),l=ui(a.R,a.G,a.B,a.A);o||delete l.A;const u=t?l.L/(e+1):(100-l.L)/(e+1),d=Array(e).fill(null).map(((c,h)=>({...l,L:l.L+u*(h+1)*(1-2*+t)})));switch(n){case j.HEX:default:return d.map((c=>{const h=pe(c.H,c.S,c.L);return o&&(h.A=c.A),s?o?G.HEX({...h,A:$(h.A*K)}):G.HEX(h):o?V.HEXA(h):V.HEX(h)}));case j.RGB:return d.map((c=>{const h=pe(c.H,c.S,c.L);return o&&(h.A=c.A),s?G.RGB(h,i):o?V.RGBA(h,i.decimals):V.RGB(h,i.decimals)}));case j.HSL:return d.map((c=>s?G.HSL(c,i):o?V.HSLA({...pe(c.H,c.S,c.L),A:c.A},i.decimals):V.HSL(pe(c.H,c.S,c.L),i.decimals)));case j.HWB:return d.map((c=>{const h=pe(c.H,c.S,c.L);o&&(h.A=c.A);const p=o?V.HWBA(h,i.decimals):V.HWB(h,i.decimals);return s?G.HWB(p,i):p}));case j.CIELab:return d.map((c=>{const h=pe(c.H,c.S,c.L);o&&(h.A=c.A);const p=o?V.CIELabA(h,i.decimals):V.CIELab(h,i.decimals);return s?G.CIELab(p,i):p}));case j.LCH:return d.map((c=>{const h=pe(c.H,c.S,c.L),p=ci(h.R,h.G,h.B);return o&&(p.A=c.A),s?G.LCH(p,i):o?V.LCHA({...h,A:c.A},i.decimals):V.LCH(h,i.decimals)}))}},Ti={buildHarmony(r,e,t,i){const n=$e(r),s=Ue(r,n),a=ui(s.R,s.G,s.B,s.A),o=typeof r=="string"&&be(s,"A")||typeof r!="string"&&be(r,"A"),l=typeof r=="string";switch(n){case j.HEX:default:return o?this.HEXA(ta(a,0),e,t,l):this.HEX(ta(a,0),e,t,l);case j.HSL:return o?this.HSLA(a,e,t,l,i):this.HSL(a,e,t,l,i);case j.HWB:return o?this.HWBA(a,e,t,l,i):this.HWB(a,e,t,l,i);case j.RGB:return o?this.RGBA(a,e,t,l,i):this.RGB(a,e,t,l,i);case j.CIELab:return o?this.CIELabA(a,e,t,l,i):this.CIELab(a,e,t,l,i);case j.LCH:return o?this.LCHA(a,e,t,l,i):this.LCH(a,e,t,l,i)}},[j.HEX]:(r,e,t,i)=>e(r,t).map((n=>i?G.HEX(pe(n.H,n.S,n.L)):V.HEX(pe(n.H,n.S,n.L)))),HEXA:(r,e,t,i)=>e(r,t).map((n=>i?G.HEX({...pe(n.H,n.S,n.L),A:me(n.A)*K}):V.HEXA({...pe(n.H,n.S,n.L),A:me(n.A)}))),[j.RGB]:(r,e,t,i,n)=>e(r,t).map((s=>i?G.RGB(pe(s.H,s.S,s.L),n):V.RGB(pe(s.H,s.S,s.L),n.decimals))),RGBA:(r,e,t,i,n)=>e(r,t).map((s=>i?G.RGB({...pe(s.H,s.S,s.L),A:me(s.A)},n):V.RGBA({...pe(s.H,s.S,s.L),A:me(s.A)},n.decimals))),[j.HSL]:(r,e,t,i,n)=>e(r,t).map((s=>i?G.HSL({H:s.H,S:s.S,L:s.L},n):V.HSL(pe(s.H,s.S,s.L),n.decimals))),HSLA:(r,e,t,i,n)=>e(r,t).map((s=>i?G.HSL({...s,A:me(s.A)},n):V.HSLA({...pe(s.H,s.S,s.L),A:me(s.A)},n.decimals))),[j.HWB]:(r,e,t,i,n)=>e(r,t).map((s=>{const a=pe(s.H,s.S,s.L),o=Si(a.R,a.G,a.B);return i?G.HWB({H:o.H,W:o.W,B:o.B},n):V.HWB(a,n.decimals)})),HWBA:(r,e,t,i,n)=>e(r,t).map((s=>{const a=pe(s.H,s.S,s.L),o=Si(a.R,a.G,a.B);return i?G.HWB({...o,A:me(s.A)},n):V.HWBA({...a,A:me(s.A)},n.decimals)})),[j.CIELab]:(r,e,t,i,n)=>e(r,t).map((s=>{const a=pe(s.H,s.S,s.L);return i?G.CIELab(di(a.R,a.G,a.B),n):V.CIELab(a,n.decimals)})),CIELabA:(r,e,t,i,n)=>e(r,t).map((s=>{const a=pe(s.H,s.S,s.L);return i?G.CIELab({...di(a.R,a.G,a.B),A:me(s.A)},n):V.CIELabA({...a,A:me(s.A)},n.decimals)})),[j.LCH]:(r,e,t,i,n)=>e(r,t).map((s=>{const a=pe(s.H,s.S,s.L);return i?G.LCH(ci(a.R,a.G,a.B),n):V.LCH(a,n.decimals)})),LCHA:(r,e,t,i,n)=>e(r,t).map((s=>{const a=pe(s.H,s.S,s.L);return i?G.LCH({...ci(a.R,a.G,a.B),A:me(s.A)},n):V.LCHA({...a,A:me(s.A)},n.decimals)}))},Xi={mix(r,e){const t=r.map((a=>{const o=$e(a);return Ue(a,o)})),i=e===Ze.SUBTRACTIVE?t.map((a=>{const o=((l,u,d)=>{const c=Math.min(l,u,d),h=Math.min(K-l,K-u,K-d),p=l-c,m=u-c,g=d-c,y=Math.min(p,m),b=p-y,x=(m+y)/2,w=(g+m-y)/2,A=Math.max(b,x,w)/Math.max(p,m,g),q=isNaN(A)||A===1/0||A<=0?1:A;return{R:b/q+h,Y:x/q+h,B:w/q+h}})(a.R,a.G,a.B);return be(a,"A")&&(o.A=a.A),o})):null;function n(a){const o=e===Ze.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return a.reduce(((l,u)=>{const d=be(u,"A")?u.A:1,c={R:Math.min(l.R+u.R*d,K),B:Math.min(l.B+u.B*d,K),A:1-(1-d)*(1-l.A)},h="G"in l?l.G:l.Y,p="G"in u?u.G:u.Y;return{...c,...e===Ze.ADDITIVE?{G:Math.min(h+p*d,K)}:{Y:Math.min(h+p*d,K)}}}),o)}let s;if(e===Ze.ADDITIVE)s=n(t);else{const a=n(i);s=((o,l,u)=>{const d=Math.min(o,l,u),c=Math.min(K-o,K-l,K-u),h=o-d,p=l-d,m=u-d,g=Math.min(p,m),y=h+p-g,b=p+g,x=2*(m-g),w=Math.max(y,b,x)/Math.max(h,p,m),A=isNaN(w)||w===1/0||w<=0?1:w;return{R:y/A+c,G:b/A+c,B:x/A+c}})(a.R,a.Y,a.B),s.A=a.A}return{R:$(s.R),G:$(s.G),B:$(s.B),A:ne(s.A,0,1)}},[j.HEX](r,e,t){const i=this.mix(r,e);return delete i.A,t?G.HEX(i):V.HEX(i)},HEXA(r,e,t){const i=this.mix(r,e);return i.A=t?me(i.A)*K:me(i.A),t?G.HEX(i):V.HEXA(i)},[j.RGB](r,e,t,i){const n=this.mix(r,e);return delete n.A,t?G.RGB(n,i):V.RGB(n,i.decimals)},RGBA(r,e,t,i){const n=this.mix(r,e);return t?G.RGB(n,i):V.RGBA(n,i.decimals)},[j.HSL](r,e,t,i){const n=this.mix(r,e),s=ui(n.R,n.G,n.B);return delete n.A,delete s.A,t?G.HSL(s,i):V.HSL(n,i.decimals)},HSLA(r,e,t,i){const n=this.mix(r,e),s=ui(n.R,n.G,n.B,n.A);return t?G.HSL(s,i):V.HSLA(n,i.decimals)},[j.HWB](r,e,t,i){const n=this.mix(r,e),s=Si(n.R,n.G,n.B);return delete n.A,delete s.A,t?G.HWB(s,i):V.HWB(n,i.decimals)},HWBA(r,e,t,i){const n=this.mix(r,e),s=Si(n.R,n.G,n.B,n.A);return t?G.HWB(s,i):V.HWBA(n,i.decimals)},[j.CIELab](r,e,t,i){const n=this.mix(r,e),s=di(n.R,n.G,n.B);return delete n.A,t?G.CIELab(s,i):V.CIELab(n,i.decimals)},CIELabA(r,e,t,i){const n=this.mix(r,e),s=di(n.R,n.G,n.B);return be(n,"A")&&(s.A=n.A),t?G.CIELab(s,i):V.CIELabA(n,i.decimals)},[j.LCH](r,e,t,i){const n=this.mix(r,e),s=ci(n.R,n.G,n.B);return delete n.A,t?G.LCH(s,i):V.LCH(n,i.decimals)},LCHA(r,e,t,i){const n=this.mix(r,e),s=ci(n.R,n.G,n.B);return be(n,"A")&&(s.A=n.A),t?G.LCH(s,i):V.LCHA(n,i.decimals)}},Ey=(r,e)=>({R:$(r.R,e),G:$(r.G,e),B:$(r.B,e),...be(r,"A")?{A:$(r.A,e)}:{}}),Qe=(r,e,t,i)=>i(Ue(r,e),t),Ln=(r,e,t,i,n)=>(t<1&&(t=5),((a,o,l)=>{const u=l-1,d=(o.R-a.R)/u,c=(o.G-a.G)/u,h=(o.B-a.B)/u,p=me(a.A),m=(me(o.A)-p)/u;return Array(l).fill(null).map(((g,y)=>y===0?a:y===u?o:{R:$(a.R+d*y),G:$(a.G+c*y),B:$(a.B+h*y),A:$(p+m*y)}))})(Ue(r),Ue(e),t).map((a=>n(a,i))));function qe(r){const{from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:s,cssFunction:a}=r,o=typeof i=="number"?Ln(e,t,i,n?.decimals,s):Ln(e,t,5,i?.decimals,s);return a?o.map((l=>a(l,we((typeof i=="number"?n:i)??{},e,t)))):o}function ke(r){const{colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:n,css:s}=r,a=we((typeof t=="string"?i:t)??{},...e);return n(e,typeof t=="string"?t:Ze.ADDITIVE,s,a)}const ps=(r,e,t,i)=>({[Mt.ANALOGOUS]:Ti.buildHarmony(e,Ay,t,i),[Mt.COMPLEMENTARY]:Ti.buildHarmony(e,Sy,t,i),[Mt.SPLIT_COMPLEMENTARY]:Ti.buildHarmony(e,My,t,i),[Mt.TRIADIC]:Ti.buildHarmony(e,By,t,i),[Mt.TETRADIC]:Ti.buildHarmony(e,qy,t,i),[Mt.SQUARE]:Ti.buildHarmony(e,ky,t,i)})[r],Ee=Object.fromEntries(Object.entries(Xi).map((r=>{const[e,t]=r;return[e,t.bind(Xi)]})));class Se{constructor(e,t={}){this._options=we(t,e),this.rgb=Ue(e),this.update("rgb")}update(...e){e.includes("rgb")||this.updateRGB(),e.includes("hsl")||this.updateHSL(),e.includes("hwb")||this.updateHWB(),e.includes("lab")||this.updateLAB(),e.includes("lch")||this.updateLCH(),e.includes("cmyk")||this.updateCMYK()}updateRGB(){this.rgb={...pe(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateHSL(){this.hsl=ui(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateHWB(){this.hwb=Si(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLAB(){this.lab={...di(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateLCH(){this.lch={...ci(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=Fu(this.rgb.R,this.rgb.G,this.rgb.B)}updateRGBFromHWB(){this.rgb={...$n(this.hwb.H,this.hwb.W,this.hwb.B),A:this.rgb.A}}updateRGBFromLCH(){this.rgb={...Dn(this.lch.L,this.lch.C,this.lch.H),A:this.rgb.A}}updateRGBFromCMYK(){this.rgb={...Ia(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLAB(){this.rgb={...kr(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateLCHFromLAB(){this.lch={...ku(this.lab.L,this.lab.a,this.lab.b),A:this.lab.A}}updateLABromLCH(){this.lab={...Eu(this.lch.L,this.lch.C,this.lch.H),A:this.lch.A}}setOptions(e={}){return this._options={...this._options,...e},this}setR(e){this.rgb.R=ne(e,0,K),this.update("rgb")}setG(e){return this.rgb.G=ne(e,0,K),this.update("rgb"),this}setB(e){return this.rgb.B=ne(e,0,K),this.update("rgb"),this}setH(e){return this.hsl.H=mt(e),this.update("hsl"),this}setS(e){return this.hsl.S=ne(e,0,ft),this.update("hsl"),this}setL(e){return this.hsl.L=ne(e,0,ft),this.update("hsl"),this}setWhiteness(e){return this.hwb.W=ne(e,0,ft),this.updateRGBFromHWB(),this.update("rgb","hwb"),this}setBlackness(e){return this.hwb.B=ne(e,0,ft),this.updateRGBFromHWB(),this.update("rgb","hwb"),this}setCIEL(e){return this.lab.L=ne(e,0,ft),this.updateRGBFromLAB(),this.updateLCHFromLAB(),this.update("rgb","lab","lch"),this}setCIEa(e){return this.lab.a=ne(e,-125,ai),this.updateRGBFromLAB(),this.updateLCHFromLAB(),this.update("rgb","lab","lch"),this}setCIEb(e){return this.lab.b=ne(e,-125,ai),this.updateRGBFromLAB(),this.updateLCHFromLAB(),this.update("rgb","lab","lch"),this}setLCHL(e){return this.lch.L=ne(e,0,ft),this.updateRGBFromLCH(),this.updateLABromLCH(),this.update("rgb","lab","lch"),this}setLCHC(e){return this.lch.C=ne(e,0,Zi),this.updateRGBFromLCH(),this.updateLABromLCH(),this.update("rgb","lab","lch"),this}setLCHH(e){return this.lch.H=mt(e),this.updateRGBFromLCH(),this.updateLABromLCH(),this.update("rgb","lab","lch"),this}setA(e){const t=ne(e,0,1);return this.rgb.A=t,this.hsl.A=t,this.hwb.A=t,this.lab.A=t,this.lch.A=t,this.cmyk.A=t,this}setC(e){return this.cmyk.C=ne(e,0,100),this.updateRGBFromCMYK(),this.update("cmyk"),this}setM(e){return this.cmyk.M=ne(e,0,100),this.updateRGBFromCMYK(),this.update("cmyk"),this}setY(e){return this.cmyk.Y=ne(e,0,100),this.updateRGBFromCMYK(),this.update("cmyk"),this}setK(e){return this.cmyk.K=ne(e,0,100),this.updateRGBFromCMYK(),this.update("cmyk"),this}get options(){return this._options}get R(){return $(this.rgb.R,this.options.decimals)}get G(){return $(this.rgb.G,this.options.decimals)}get B(){return $(this.rgb.B,this.options.decimals)}get H(){return $(this.hsl.H,this.options.decimals)}get S(){return $(this.hsl.S,this.options.decimals)}get L(){return $(this.hsl.L,this.options.decimals)}get Whiteness(){return $(this.hwb.W,this.options.decimals)}get Blackness(){return $(this.hwb.B,this.options.decimals)}get CIEL(){return $(this.lab.L,this.options.decimals)}get CIEa(){return $(this.lab.a,this.options.decimals)}get CIEb(){return $(this.lab.b,this.options.decimals)}get LCHL(){return $(this.lch.L,this.options.decimals)}get LCHC(){return $(this.lch.C,this.options.decimals)}get LCHH(){return $(this.lch.H,this.options.decimals)}get A(){return $(this.hsl.A,this.options.decimals)}get C(){return $(this.cmyk.C,this.options.decimals)}get M(){return $(this.cmyk.M,this.options.decimals)}get Y(){return $(this.cmyk.Y,this.options.decimals)}get K(){return $(this.cmyk.K,this.options.decimals)}get HEXObject(){return V.HEX(this.rgb)}get HEXAObject(){return V.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get HWBObject(){return{H:this.H,W:this.Whiteness,B:this.Blackness}}get HWBAObject(){return{...this.HWBObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get LCHObject(){return{L:this.LCHL,C:this.LCHC,H:this.LCHH}}get LCHAObject(){return{...this.LCHObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return G.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return G.HEX({R:this.R,G:this.G,B:this.B,A:this.A*K})}get RGB(){return G.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return G.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return G.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return G.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get HWB(){return G.HWB({H:this.H,W:this.Whiteness,B:this.Blackness},this.options)}get HWBA(){return G.HWB({H:this.H,W:this.Whiteness,B:this.Blackness,A:this.A},this.options)}get CIELab(){return G.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return G.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get LCH(){return G.LCH({L:this.LCHL,C:this.LCHC,H:this.LCHH},this.options)}get LCHA(){return G.LCH({L:this.LCHL,C:this.LCHC,H:this.LCHH,A:this.A},this.options)}get CMYK(){return G.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return G.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(e){const t=$e(e);return Qe(e,t,0,V.HEX)}static toHEX(e){return G.HEX(Se.toHEXObject(e))}static toHEXAObject(e){const t=$e(e);return Qe(e,t,0,V.HEXA)}static toHEXA(e){return G.HEX(Se.toHEXAObject(e))}static toRGBObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.RGB)}static toRGB(e,t={}){const i=Se.toRGBObject(e,t),n=we(t,e);return G.RGB(i,n)}static toRGBAObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.RGBA)}static toRGBA(e,t={}){const i=Se.toRGBAObject(e,t),n=we(t,e);return G.RGB(i,n)}static toHSLObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.HSL)}static toHSL(e,t={}){const i=Se.toHSLObject(e,t),n=we(t,e);return G.HSL(i,n)}static toHSLAObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.HSLA)}static toHSLA(e,t={}){const i=Se.toHSLAObject(e,t),n=we(t,e);return G.HSL(i,n)}static toHWBObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.HWB)}static toHWB(e,t={}){const i=Se.toHWBObject(e,t),n=we(t,e);return G.HWB(i,n)}static toHWBAObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.HWBA)}static toHWBA(e,t={}){const i=Se.toHWBAObject(e,t),n=we(t,e);return G.HWB(i,n)}static toCIELabObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.CIELab)}static toCIELab(e,t={}){const i=Se.toCIELabObject(e,t),n=we(t,e);return G.CIELab(i,n)}static toCIELabAObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.CIELabA)}static toCIELabA(e,t={}){const i=Se.toCIELabAObject(e,t),n=we(t,e);return G.CIELab(i,n)}static toLCHObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.LCH)}static toLCH(e,t={}){const i=Se.toLCHObject(e,t),n=we(t,e);return G.LCH(i,n)}static toLCHAObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.LCHA)}static toLCHA(e,t={}){const i=Se.toLCHAObject(e,t),n=we(t,e);return G.LCH(i,n)}static toCMYKObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.CMYK)}static toCMYK(e,t={}){const i=Se.toCMYKObject(e,t),n=we(t,e);return G.CMYK(i,n)}static toCMYKAObject(e,t={}){const i=$e(e);return Qe(e,i,t.decimals,V.CMYKA)}static toCMYKA(e,t={}){const i=Se.toCMYKAObject(e,t),n=we(t,e);return G.CMYK(i,n)}static getBlendHEXObject(e,t,i=5){return Ln(e,t,i,0,V.HEX)}static getBlendHEX(e,t,i=5){return Se.getBlendHEXObject(e,t,i).map((n=>G.HEX(n)))}static getBlendHEXAObject(e,t,i=5){return Ln(e,t,i,0,V.HEXA)}static getBlendHEXA(e,t,i=5){return Se.getBlendHEXAObject(e,t,i).map((n=>G.HEX(n)))}static getBlendRGBObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.RGB})}static getBlendRGB(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.RGB,cssFunction:G.RGB})}static getBlendRGBAObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.RGBA})}static getBlendRGBA(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.RGBA,cssFunction:G.RGB})}static getBlendHSLObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.HSL})}static getBlendHSL(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.HSL,cssFunction:G.HSL})}static getBlendHSLAObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.HSLA})}static getBlendHSLA(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.HSLA,cssFunction:G.HSL})}static getBlendHWBObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.HWB})}static getBlendHWB(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.HWB,cssFunction:G.HWB})}static getBlendHWBAObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.HWBA})}static getBlendHWBA(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.HWBA,cssFunction:G.HWB})}static getBlendCIELabObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.CIELab})}static getBlendCIELab(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.CIELab,cssFunction:G.CIELab})}static getBlendCIELabAObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.CIELabA})}static getBlendCIELabA(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.CIELabA,cssFunction:G.CIELab})}static getBlendLCHObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.LCH})}static getBlendLCH(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.LCH,cssFunction:G.LCH})}static getBlendLCHAObject(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.LCHA})}static getBlendLCHA(e,t,i,n){return qe({from:e,to:t,thirdParameter:i,fourthParameter:n,translateFunction:V.LCHA,cssFunction:G.LCH})}static getMixHEXObject(e,t=Ze.ADDITIVE){return Xi.HEX(e,t,!1)}static getMixHEX(e,t=Ze.ADDITIVE){return Xi.HEX(e,t,!0)}static getMixHEXAObject(e,t=Ze.ADDITIVE){return Xi.HEXA(e,t,!1)}static getMixHEXA(e,t=Ze.ADDITIVE){return Xi.HEXA(e,t,!0)}static getMixRGBObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.RGB,css:!1})}static getMixRGB(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.RGB,css:!0})}static getMixRGBAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.RGBA,css:!1})}static getMixRGBA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.RGBA,css:!0})}static getMixHSLObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.HSL,css:!1})}static getMixHSL(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.HSL,css:!0})}static getMixHSLAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.HSLA,css:!1})}static getMixHSLA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.HSLA,css:!0})}static getMixHWBObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.HWB,css:!1})}static getMixHWB(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.HWB,css:!0})}static getMixHWBAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.HWBA,css:!1})}static getMixHWBA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.HWBA,css:!0})}static getMixCIELabObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.CIELab,css:!1})}static getMixCIELab(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.CIELab,css:!0})}static getMixCIELabAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.CIELabA,css:!1})}static getMixCIELabA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.CIELabA,css:!0})}static getMixLCHObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.LCH,css:!1})}static getMixLCH(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.LCH,css:!0})}static getMixLCHAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.LCHA,css:!1})}static getMixLCHA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Ee.LCHA,css:!0})}static getShades(e,t,i){return typeof t=="number"?on(e,t,!0,we(i||{},e)):on(e,5,!0,we(t||{},e))}static getTints(e,t,i){return typeof t=="number"?on(e,t,!1,we(i||{},e)):on(e,5,!1,we(t||{},e))}static getHarmony(e,t,i,n){return`${t}`in Mt?ps(t,e,cs(i)?i:Ze.ADDITIVE,we(cs(i)?n||{}:i||{},e)):cs(t)?ps(Mt.COMPLEMENTARY,e,t,we(i||{},e)):ps(Mt.COMPLEMENTARY,e,Ze.ADDITIVE,we(t||{},e))}}const Fy={slots:{root:"data-[disabled]:opacity-75",picker:"flex gap-4",selector:"rounded-md touch-none",selectorBackground:"w-full h-full relative rounded-md",selectorThumb:"-translate-y-1/2 -translate-x-1/2 absolute size-4 ring-2 ring-white rounded-full cursor-pointer data-[disabled]:cursor-not-allowed",track:"w-[8px] relative rounded-md touch-none",trackThumb:"absolute transform -translate-y-1/2 -translate-x-[4px] rtl:translate-x-[4px] size-4 rounded-full ring-2 ring-white cursor-pointer data-[disabled]:cursor-not-allowed"},variants:{size:{xs:{selector:"w-38 h-38",track:"h-38"},sm:{selector:"w-40 h-40",track:"h-40"},md:{selector:"w-42 h-42",track:"h-42"},lg:{selector:"w-44 h-44",track:"h-44"},xl:{selector:"w-46 h-46",track:"h-46"}}},compoundVariants:[],defaultVariants:{size:"md"}},Oy=["data-disabled"],zy=["data-disabled"];function Iy(r){const e=r.S*(r.L<50?r.L:100-r.L),t=r.L+e/100;return{h:r.H,s:r.L===0?r.S:2*e/t,v:t}}function _o(r){const e=(200-r.s)*r.v/100;return{H:r.h,S:e===0||e===200?0:Math.round(r.s*r.v/(e<=100?e:200-e)),L:e/2}}const Ty={__name:"UColorPicker",props:qn({as:{type:null,required:!1},throttle:{type:Number,required:!1,default:50},disabled:{type:Boolean,required:!1},defaultValue:{type:String,required:!1,default:"#FFFFFF"},format:{type:String,required:!1,default:"hex"},size:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},{modelValue:{type:String},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=ua(r,"modelValue",{type:String}),i=Te(),n=k(()=>ue({extend:ue(Fy),...i.ui?.colorPicker||{}})({size:e.size})),s=k({get(){try{const M=new Se(t.value||e.defaultValue);return Iy(M.HSLObject)}catch{return{h:0,s:0,v:100}}},set(M){const B=new Se(_o(M),{labUnit:"percent",cmykUnit:"percent",cmykFunction:"cmyk"});switch(e.format){case"rgb":t.value=B.RGB;break;case"hsl":t.value=B.HSL;break;case"cmyk":t.value=B.CMYK;break;case"lab":t.value=B.CIELab;break;case"hex":default:t.value=B.HEX}}});function a(M,B,H="both",E={x:0,y:0},R){const U=z(E),W=z(),te=go(M),Q=go(B);function oe(Y){if(Rt(R))return Y.preventDefault();const he=Rt(B);W.value={x:Y.clientX-(he?Y.clientX-Q.left.value+he.scrollLeft:te.left.value),y:Y.clientY-(he?Y.clientY-Q.top.value+he.scrollTop:te.top.value)},J(Y)}function J(Y){if(!W.value)return;const he=Rt(B);let{x:se,y:ye}=U.value;he&&(H==="x"||H==="both")&&(se=Math.min(Math.max(0,(Y.clientX-W.value.x)/he.scrollWidth*100),100)),he&&(H==="y"||H==="both")&&(ye=Math.min(Math.max(0,(Y.clientY-W.value.y)/he.scrollHeight*100),100)),U.value={x:se,y:ye}}function ee(){W.value&&(W.value=void 0)}return ul&&(Cr(B,"pointerdown",oe),Cr(window,"pointermove",J),Cr(window,"pointerup",ee)),{position:U}}function o(M,B="left"){return B==="right"?M*100/360:M/100*360}function l(M){return 100-M}const u=z(null),d=z(null),c=z(null),h=z(null),p=k(()=>e.disabled),{position:m}=a(d,u,"both",{x:s.value.s,y:l(s.value.v)},p),{position:g}=a(h,c,"y",{x:0,y:o(s.value.h,"right")},p),{pause:y,resume:b}=Fd(s,M=>{m.value={x:M.s,y:l(M.v)},g.value={x:0,y:o(M.h,"right")}});Od([m,g],()=>{y(),s.value={h:o(g.value.y),s:m.value.x,v:l(m.value.y)},Ye(b)},{throttle:()=>e.throttle});const x=k(()=>new Se(_o({h:o(g.value.y),s:100,v:100})).HEX),w=k(()=>({backgroundColor:x.value})),A=k(()=>({backgroundColor:new Se(t.value||e.defaultValue).HEX,left:`${m.value.x}%`,top:`${m.value.y}%`})),q=k(()=>({backgroundColor:x.value,top:`${g.value.y}%`}));return(M,B)=>(v(),C(f(re),{as:r.as,"data-slot":"root",class:I(n.value.root({class:[e.ui?.root,e.class]})),"data-disabled":p.value?!0:void 0},{default:_(()=>[T("div",{"data-slot":"picker",class:I(n.value.picker({class:e.ui?.picker}))},[T("div",{ref_key:"selectorRef",ref:u,"data-slot":"selector",class:I(n.value.selector({class:e.ui?.selector})),style:qt(w.value)},[T("div",{"data-slot":"selectorBackground",class:I(n.value.selectorBackground({class:e.ui?.selectorBackground})),"data-color-picker-background":""},[T("div",{ref_key:"selectorThumbRef",ref:d,"data-slot":"selectorThumb",class:I(n.value.selectorThumb({class:e.ui?.selectorThumb})),style:qt(A.value),"data-disabled":p.value?!0:void 0},null,14,Oy)],2)],6),T("div",{ref_key:"trackRef",ref:c,"data-slot":"track",class:I(n.value.track({class:e.ui?.track})),"data-color-picker-track":""},[T("div",{ref_key:"trackThumbRef",ref:h,"data-slot":"trackThumb",class:I(n.value.trackThumb({class:e.ui?.trackThumb})),style:qt(q.value),"data-disabled":p.value?!0:void 0},null,14,zy)],2)],2)]),_:1},8,["as","class","data-disabled"]))}},Py=fl(Ty,[["__scopeId","data-v-2248f709"]]),xt={Root:Ql,Trigger:eu,Portal:$p,Content:kp,Arrow:Jl,Item:zp,Group:Fp,Separator:jp,CheckboxItem:Sp,ItemIndicator:Tp,Label:Rp,RadioGroup:Hp,RadioItem:Vp,Sub:Gp,SubContent:Xp,SubTrigger:Jp},Ry={Root:rm,Trigger:hm,Portal:dm,Content:lm,Arrow:em},Dy={Root:sp,Trigger:_p,Portal:xp,Content:vp,Arrow:up,Close:cp,Anchor:op},$y={slots:{content:"bg-default shadow-lg rounded-md ring ring-default data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-popover-content-transform-origin) focus:outline-none pointer-events-auto",arrow:"fill-default"}},Ly={__name:"UPopover",props:{mode:{type:null,required:!1,default:"click"},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},modal:{type:Boolean,required:!1},openDelay:{type:Number,required:!1,default:0},closeDelay:{type:Number,required:!1,default:0}},emits:["close:prevent","update:open"],setup(r,{emit:e}){const t=r,i=e,n=We(),s=Te(),a=t.mode==="hover"?Ft(t,"defaultOpen","open","openDelay","closeDelay"):Ft(t,"defaultOpen","open","modal"),o=Ce(a,i),l=lr(je(()=>t.portal)),u=je(()=>Er(t.content,{side:"bottom",sideOffset:8,collisionPadding:8})),d=k(()=>t.dismissible?{}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((g,y)=>(g[y]=b=>{b.preventDefault(),i("close:prevent")},g),{})),c=je(()=>t.arrow),h=k(()=>ue({extend:ue($y),...s.ui?.popover||{}})({side:u.value.side})),p=k(()=>t.mode==="hover"?Ry:Dy);return(m,g)=>(v(),C(f(p).Root,ae(le(f(o))),{default:_(({open:y,close:b})=>[n.default||r.reference?(v(),C(f(p).Trigger,{key:0,"as-child":"",reference:r.reference,class:I(t.class)},{default:_(()=>[S(m.$slots,"default",{open:y})]),_:2},1032,["reference","class"])):D("",!0),"Anchor"in p.value&&n.anchor?(v(),C(f(p).Anchor,{key:1,"as-child":""},{default:_(()=>[S(m.$slots,"anchor",ae(le(b?{close:b}:{})))]),_:2},1024)):D("",!0),F(f(p).Portal,ae(le(f(l))),{default:_(()=>[F(f(p).Content,L(u.value,{"data-slot":"content",class:h.value.content({class:[!n.default&&t.class,t.ui?.content]})},Tr(d.value)),{default:_(()=>[S(m.$slots,"content",ae(le(b?{close:b}:{}))),r.arrow?(v(),C(f(p).Arrow,L({key:0},c.value,{"data-slot":"arrow",class:h.value.arrow({class:t.ui?.arrow})}),null,16,["class"])):D("",!0)]),_:2},1040,["class"])]),_:2},1040)]),_:3},16))}},Hy=O({__name:"EditableColor",props:{modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,i=e,n=z(t.modelValue),s=()=>{i("update:modelValue",n.value)};return(a,o)=>{const l=lt,u=Py,d=Ly;return v(),C(d,{onBlur:s},{content:_(()=>[F(u,{modelValue:n.value,"onUpdate:modelValue":[o[0]||(o[0]=c=>n.value=c),s],class:"p-2"},null,8,["modelValue"])]),default:_(()=>[F(l,{label:n.value,color:"neutral",size:"xs",variant:"soft"},{leading:_(()=>[T("span",{style:qt({backgroundColor:n.value}),class:"size-3 rounded-full"},null,4)]),_:1},8,["label"])]),_:1})}}}),Ny=Object.assign(Hy,{__name:"EditableColor"}),zu={__name:"UDropdownMenuContent",props:{items:{type:null,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0},sub:{type:Boolean,required:!1},labelKey:{type:null,required:!0},descriptionKey:{type:null,required:!0},checkedIcon:{type:null,required:!1},loadingIcon:{type:null,required:!1},externalIcon:{type:[Boolean,String],required:!1,skipCheck:!0},class:{type:null,required:!1},ui:{type:null,required:!0},uiOverride:{type:null,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=e,n=We(),{dir:s}=Bi(),a=Te(),o=lr(je(()=>t.portal)),l=Ce(dl(t,"sub","items","portal","labelKey","descriptionKey","checkedIcon","loadingIcon","externalIcon","class","ui","uiOverride"),i),u=()=>yl(n,["default"]),[d,c]=_r(),h=k(()=>s.value==="rtl"?a.ui.icons.chevronLeft:a.ui.icons.chevronRight),p=k(()=>t.items?.length?zd(t.items)?t.items:[t.items]:[]);return(m,g)=>(v(),N(xe,null,[F(f(d),null,{default:_(({item:y,active:b,index:x})=>[S(m.$slots,y.slot||"item",{item:y,index:x,ui:r.ui},()=>[S(m.$slots,y.slot?`${y.slot}-leading`:"item-leading",{item:y,active:b,index:x,ui:r.ui},()=>[y.loading?(v(),C(Me,{key:0,name:r.loadingIcon||f(a).ui.icons.loading,"data-slot":"itemLeadingIcon",class:I(r.ui.itemLeadingIcon({class:[r.uiOverride?.itemLeadingIcon,y.ui?.itemLeadingIcon],color:y?.color,loading:!0}))},null,8,["name","class"])):y.icon?(v(),C(Me,{key:1,name:y.icon,"data-slot":"itemLeadingIcon",class:I(r.ui.itemLeadingIcon({class:[r.uiOverride?.itemLeadingIcon,y.ui?.itemLeadingIcon],color:y?.color,active:b}))},null,8,["name","class"])):y.avatar?(v(),C(ur,L({key:2,size:y.ui?.itemLeadingAvatarSize||r.uiOverride?.itemLeadingAvatarSize||r.ui.itemLeadingAvatarSize()},y.avatar,{"data-slot":"itemLeadingAvatar",class:r.ui.itemLeadingAvatar({class:[r.uiOverride?.itemLeadingAvatar,y.ui?.itemLeadingAvatar],active:b})}),null,16,["size","class"])):D("",!0)]),f(Tt)(y,t.labelKey)||n[y.slot?`${y.slot}-label`:"item-label"]||f(Tt)(y,t.descriptionKey)||n[y.slot?`${y.slot}-description`:"item-description"]?(v(),N("span",{key:0,"data-slot":"itemWrapper",class:I(r.ui.itemWrapper({class:[r.uiOverride?.itemWrapper,y.ui?.itemWrapper]}))},[T("span",{"data-slot":"itemLabel",class:I(r.ui.itemLabel({class:[r.uiOverride?.itemLabel,y.ui?.itemLabel],active:b}))},[S(m.$slots,y.slot?`${y.slot}-label`:"item-label",{item:y,active:b,index:x},()=>[ce(Z(f(Tt)(y,t.labelKey)),1)]),y.target==="_blank"&&r.externalIcon!==!1?(v(),C(Me,{key:0,name:typeof r.externalIcon=="string"?r.externalIcon:f(a).ui.icons.external,"data-slot":"itemLabelExternalIcon",class:I(r.ui.itemLabelExternalIcon({class:[r.uiOverride?.itemLabelExternalIcon,y.ui?.itemLabelExternalIcon],color:y?.color,active:b}))},null,8,["name","class"])):D("",!0)],2),f(Tt)(y,t.descriptionKey)?(v(),N("span",{key:0,"data-slot":"itemDescription",class:I(r.ui.itemDescription({class:[r.uiOverride?.itemDescription,y.ui?.itemDescription]}))},[S(m.$slots,y.slot?`${y.slot}-description`:"item-description",{item:y,active:b,index:x},()=>[ce(Z(f(Tt)(y,t.descriptionKey)),1)])],2)):D("",!0)],2)):D("",!0),T("span",{"data-slot":"itemTrailing",class:I(r.ui.itemTrailing({class:[r.uiOverride?.itemTrailing,y.ui?.itemTrailing]}))},[S(m.$slots,y.slot?`${y.slot}-trailing`:"item-trailing",{item:y,active:b,index:x,ui:r.ui},()=>[y.children?.length?(v(),C(Me,{key:0,name:h.value,"data-slot":"itemTrailingIcon",class:I(r.ui.itemTrailingIcon({class:[r.uiOverride?.itemTrailingIcon,y.ui?.itemTrailingIcon],color:y?.color,active:b}))},null,8,["name","class"])):y.kbds?.length?(v(),N("span",{key:1,"data-slot":"itemTrailingKbds",class:I(r.ui.itemTrailingKbds({class:[r.uiOverride?.itemTrailingKbds,y.ui?.itemTrailingKbds]}))},[(v(!0),N(xe,null,Xe(y.kbds,(w,A)=>(v(),C(cu,L({key:A,size:y.ui?.itemTrailingKbdsSize||r.uiOverride?.itemTrailingKbdsSize||r.ui.itemTrailingKbdsSize()},{ref_for:!0},typeof w=="string"?{value:w}:w),null,16,["size"]))),128))],2)):D("",!0)]),F(f(xt).ItemIndicator,{"as-child":""},{default:_(()=>[F(Me,{name:r.checkedIcon||f(a).ui.icons.check,"data-slot":"itemTrailingIcon",class:I(r.ui.itemTrailingIcon({class:[r.uiOverride?.itemTrailingIcon,y.ui?.itemTrailingIcon],color:y?.color}))},null,8,["name","class"])]),_:2},1024)],2)])]),_:3}),F(f(xt).Portal,ae(le(f(o))),{default:_(()=>[(v(),C(or(r.sub?f(xt).SubContent:f(xt).Content),L({"data-slot":"content",class:r.ui.content({class:[r.uiOverride?.content,t.class]})},f(l)),{default:_(()=>[S(m.$slots,"content-top"),T("div",{role:"presentation","data-slot":"viewport",class:I(r.ui.viewport({class:r.uiOverride?.viewport}))},[(v(!0),N(xe,null,Xe(p.value,(y,b)=>(v(),C(f(xt).Group,{key:`group-${b}`,"data-slot":"group",class:I(r.ui.group({class:r.uiOverride?.group}))},{default:_(()=>[(v(!0),N(xe,null,Xe(y,(x,w)=>(v(),N(xe,{key:`group-${b}-${w}`},[x.type==="label"?(v(),C(f(xt).Label,{key:0,"data-slot":"label",class:I(r.ui.label({class:[r.uiOverride?.label,x.ui?.label,x.class]}))},{default:_(()=>[F(f(c),{item:x,index:w},null,8,["item","index"])]),_:2},1032,["class"])):x.type==="separator"?(v(),C(f(xt).Separator,{key:1,"data-slot":"separator",class:I(r.ui.separator({class:[r.uiOverride?.separator,x.ui?.separator,x.class]}))},null,8,["class"])):x?.children?.length?(v(),C(f(xt).Sub,{key:2,open:x.open,"default-open":x.defaultOpen},{default:_(()=>[F(f(xt).SubTrigger,{as:"button",type:"button",disabled:x.disabled,"text-value":f(Tt)(x,t.labelKey),"data-slot":"item",class:I(r.ui.item({class:[r.uiOverride?.item,x.ui?.item,x.class],color:x?.color}))},{default:_(()=>[F(f(c),{item:x,index:w},null,8,["item","index"])]),_:2},1032,["disabled","text-value","class"]),F(zu,L({sub:"",class:x.ui?.content,ui:r.ui,"ui-override":r.uiOverride,portal:r.portal,items:x.children,align:"start","align-offset":-4,"side-offset":3,"label-key":r.labelKey,"description-key":r.descriptionKey,"checked-icon":r.checkedIcon,"loading-icon":r.loadingIcon,"external-icon":r.externalIcon},{ref_for:!0},x.content),gl({_:2},[Xe(u(),(A,q)=>({name:q,fn:_(M=>[S(m.$slots,q,L({ref_for:!0},M))])}))]),1040,["class","ui","ui-override","portal","items","label-key","description-key","checked-icon","loading-icon","external-icon"])]),_:2},1032,["open","default-open"])):x.type==="checkbox"?(v(),C(f(xt).CheckboxItem,{key:3,"model-value":x.checked,disabled:x.disabled,"text-value":f(Tt)(x,t.labelKey),"data-slot":"item",class:I(r.ui.item({class:[r.uiOverride?.item,x.ui?.item,x.class],color:x?.color})),"onUpdate:modelValue":x.onUpdateChecked,onSelect:x.onSelect},{default:_(()=>[F(f(c),{item:x,index:w},null,8,["item","index"])]),_:2},1032,["model-value","disabled","text-value","class","onUpdate:modelValue","onSelect"])):(v(),C(f(xt).Item,{key:4,"as-child":"",disabled:x.disabled,"text-value":f(Tt)(x,t.labelKey),onSelect:x.onSelect},{default:_(()=>[F(hl,L({ref_for:!0},f(Id)(x),{custom:""}),{default:_(({active:A,...q})=>[F(Td,L({ref_for:!0},q,{"data-slot":"item",class:r.ui.item({class:[r.uiOverride?.item,x.ui?.item,x.class],color:x?.color,active:A})}),{default:_(()=>[F(f(c),{item:x,active:A,index:w},null,8,["item","active","index"])]),_:2},1040,["class"])]),_:2},1040)]),_:2},1032,["disabled","text-value","onSelect"]))],64))),128))]),_:2},1032,["class"]))),128))],2),S(m.$slots,"default"),S(m.$slots,"content-bottom")]),_:3},16,["class"]))]),_:3},16)],64))}},Vy={slots:{content:"min-w-32 bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-dropdown-menu-content-transform-origin) flex flex-col",viewport:"relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1",arrow:"fill-default",group:"p-1 isolate",label:"w-full flex items-center font-semibold text-highlighted",separator:"-mx-1 my-1 h-px bg-border",item:"group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75",itemLeadingIcon:"shrink-0",itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"",itemTrailing:"ms-auto inline-flex gap-1.5 items-center",itemTrailingIcon:"shrink-0",itemTrailingKbds:"hidden lg:inline-flex items-center shrink-0",itemTrailingKbdsSize:"",itemWrapper:"flex-1 flex flex-col text-start min-w-0",itemLabel:"truncate",itemDescription:"truncate text-muted",itemLabelExternalIcon:"inline-block size-3 align-top text-dimmed"},variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},active:{true:{item:"text-highlighted before:bg-elevated",itemLeadingIcon:"text-default"},false:{item:["text-default data-highlighted:text-highlighted data-[state=open]:text-highlighted data-highlighted:before:bg-elevated/50 data-[state=open]:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["text-dimmed group-data-highlighted:text-default group-data-[state=open]:text-default","transition-colors"]}},loading:{true:{itemLeadingIcon:"animate-spin"}},size:{xs:{label:"p-1 text-xs gap-1",item:"p-1 text-xs gap-1",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemTrailingIcon:"size-4",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"sm"},sm:{label:"p-1.5 text-xs gap-1.5",item:"p-1.5 text-xs gap-1.5",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemTrailingIcon:"size-4",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"sm"},md:{label:"p-1.5 text-sm gap-1.5",item:"p-1.5 text-sm gap-1.5",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemTrailingIcon:"size-5",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"md"},lg:{label:"p-2 text-sm gap-2",item:"p-2 text-sm gap-2",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemTrailingIcon:"size-5",itemTrailingKbds:"gap-1",itemTrailingKbdsSize:"md"},xl:{label:"p-2 text-base gap-2",item:"p-2 text-base gap-2",itemLeadingIcon:"size-6",itemLeadingAvatarSize:"xs",itemTrailingIcon:"size-6",itemTrailingKbds:"gap-1",itemTrailingKbdsSize:"lg"}}},compoundVariants:[{color:"primary",active:!1,class:{item:"text-primary data-highlighted:text-primary data-highlighted:before:bg-primary/10 data-[state=open]:before:bg-primary/10",itemLeadingIcon:"text-primary/75 group-data-highlighted:text-primary group-data-[state=open]:text-primary"}},{color:"secondary",active:!1,class:{item:"text-secondary data-highlighted:text-secondary data-highlighted:before:bg-secondary/10 data-[state=open]:before:bg-secondary/10",itemLeadingIcon:"text-secondary/75 group-data-highlighted:text-secondary group-data-[state=open]:text-secondary"}},{color:"success",active:!1,class:{item:"text-success data-highlighted:text-success data-highlighted:before:bg-success/10 data-[state=open]:before:bg-success/10",itemLeadingIcon:"text-success/75 group-data-highlighted:text-success group-data-[state=open]:text-success"}},{color:"info",active:!1,class:{item:"text-info data-highlighted:text-info data-highlighted:before:bg-info/10 data-[state=open]:before:bg-info/10",itemLeadingIcon:"text-info/75 group-data-highlighted:text-info group-data-[state=open]:text-info"}},{color:"warning",active:!1,class:{item:"text-warning data-highlighted:text-warning data-highlighted:before:bg-warning/10 data-[state=open]:before:bg-warning/10",itemLeadingIcon:"text-warning/75 group-data-highlighted:text-warning group-data-[state=open]:text-warning"}},{color:"error",active:!1,class:{item:"text-error data-highlighted:text-error data-highlighted:before:bg-error/10 data-[state=open]:before:bg-error/10",itemLeadingIcon:"text-error/75 group-data-highlighted:text-error group-data-[state=open]:text-error"}},{color:"primary",active:!0,class:{item:"text-primary before:bg-primary/10",itemLeadingIcon:"text-primary"}},{color:"secondary",active:!0,class:{item:"text-secondary before:bg-secondary/10",itemLeadingIcon:"text-secondary"}},{color:"success",active:!0,class:{item:"text-success before:bg-success/10",itemLeadingIcon:"text-success"}},{color:"info",active:!0,class:{item:"text-info before:bg-info/10",itemLeadingIcon:"text-info"}},{color:"warning",active:!0,class:{item:"text-warning before:bg-warning/10",itemLeadingIcon:"text-warning"}},{color:"error",active:!0,class:{item:"text-error before:bg-error/10",itemLeadingIcon:"text-error"}}],defaultVariants:{size:"md"}},Iu={__name:"UDropdownMenu",props:{size:{type:null,required:!1},items:{type:null,required:!1},checkedIcon:{type:null,required:!1},loadingIcon:{type:null,required:!1},externalIcon:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},disabled:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=e,n=We(),s=Te(),a=Ce(Ft(t,"defaultOpen","open","modal"),i),o=je(()=>Er(t.content,{side:"bottom",sideOffset:8,collisionPadding:8})),l=je(()=>t.arrow),u=()=>yl(n,["default"]),d=k(()=>ue({extend:ue(Vy),...s.ui?.dropdownMenu||{}})({size:t.size}));return(c,h)=>(v(),C(f(Ql),ae(le(f(a))),{default:_(({open:p})=>[n.default?(v(),C(f(eu),{key:0,"as-child":"",class:I(t.class),disabled:r.disabled},{default:_(()=>[S(c.$slots,"default",{open:p})]),_:2},1032,["class","disabled"])):D("",!0),F(zu,L({class:d.value.content({class:[!n.default&&t.class,t.ui?.content]}),ui:d.value,"ui-override":t.ui},o.value,{items:r.items,portal:r.portal,"label-key":r.labelKey,"description-key":r.descriptionKey,"checked-icon":r.checkedIcon,"loading-icon":r.loadingIcon,"external-icon":r.externalIcon}),gl({default:_(()=>[r.arrow?(v(),C(f(Jl),L({key:0},l.value,{"data-slot":"arrow",class:d.value.arrow({class:t.ui?.arrow})}),null,16,["class"])):D("",!0)]),_:2},[Xe(u(),(m,g)=>({name:g,fn:_(y=>[S(c.$slots,g,ae(le(y)))])}))]),1040,["class","ui","ui-override","items","portal","label-key","description-key","checked-icon","loading-icon","external-icon"])]),_:3},16))}},Co=async r=>{try{await navigator.clipboard.writeText(r)}catch(e){console.error("Failed to copy path:",e)}},Tu=async r=>{try{const e=`:${r.path.replace(/\./g,"-")}="${JSON.stringify(r.value)}"`;await navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy prop:",e)}},Uy=async r=>{try{const e=r.children?.map(i=>i.value)||[],t=`:${r.path.replace(/\./g,"-")}='[${e.map(i=>typeof i=="string"?`"${i}"`:i).join(", ")}]'`;await navigator.clipboard.writeText(t)}catch(e){console.error("Failed to copy prop as array:",e)}},Pu=async r=>{try{const e=JSON.stringify(r);await navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy value:",e)}},Ru=async r=>{try{if(!r.children||r.children.length<3)return;await navigator.clipboard.writeText(`new Vector3(${r.children[0].value}, ${r.children[1].value}, ${r.children[2].value})`)}catch(e){console.error("Failed to copy prop as Vector3:",e)}},jy=async r=>{try{const t=`[${(r.children?.map(i=>i.value)||[]).map(i=>typeof i=="string"?`"${i}"`:i).join(", ")}]`;await navigator.clipboard.writeText(t)}catch(e){console.error("Failed to copy prop as array:",e)}},Wy=async r=>{try{let e={};r.children&&r.children.length>0&&(e=r.children.reduce((t,i)=>(t[i.label]=i.value,t),{})),await navigator.clipboard.writeText(JSON.stringify(e,null,2))}catch(e){console.error("Failed to copy value as JSON:",e)}},Du=async r=>{try{const e=r.children?.find(u=>u.label==="x"),t=r.children?.find(u=>u.label==="y"),i=r.children?.find(u=>u.label==="z"),n=r.children?.find(u=>u.label==="order"),s=e?.value||0,a=t?.value||0,o=i?.value||0,l=n?.value||"XYZ";await navigator.clipboard.writeText(`new Euler(${s}, ${a}, ${o}, '${l}')`)}catch(e){console.error("Failed to copy value as Euler:",e)}},$u=async r=>{try{const e=r.children?.find(u=>u.label==="x"),t=r.children?.find(u=>u.label==="y"),i=r.children?.find(u=>u.label==="z"),n=r.children?.find(u=>u.label==="w"),s=e?.value||0,a=t?.value||0,o=i?.value||0,l=n?.value||1;await navigator.clipboard.writeText(`new Quaternion(${s}, ${a}, ${o}, ${l})`)}catch(e){console.error("Failed to copy value as Quaternion:",e)}};function Gy(r){let e=0,t=r;return r.scene&&(t=r.scene),t.traverse(i=>{if(i.isMesh&&i.geometry){const n=i.geometry,s=n.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,a=n.index?n.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=n.attributes.normal?n.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,l=n.attributes.uv?n.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,u=s+a+o+l;e+=u}}),e}function Ky(r){return(r/1024).toFixed(2)}const Lu="180",ia=0,Xy=1,Yy=2,Ao=1,So=100,Mo=204,Bo=205,qo=3,Jy=0,Hu=300,ko=1e3,ln=1001,Eo=1002,Zy=1006,Qy=1008,ev=1009,tv=1015,iv=1023,Nu="",St="srgb",Fo="srgb-linear",Oo="linear",ms="srgb",Pi=7680,zo=519,Io=35044,un=2e3,To=2001;class es{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 n=i[e];if(n!==void 0){const s=n.indexOf(t);s!==-1&&n.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 n=i.slice(0);for(let s=0,a=n.length;s<a;s++)n[s].call(this,e);e.target=null}}}const Ge=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function Hr(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(Ge[r&255]+Ge[r>>8&255]+Ge[r>>16&255]+Ge[r>>24&255]+"-"+Ge[e&255]+Ge[e>>8&255]+"-"+Ge[e>>16&15|64]+Ge[e>>24&255]+"-"+Ge[t&63|128]+Ge[t>>8&255]+"-"+Ge[t>>16&255]+Ge[t>>24&255]+Ge[i&255]+Ge[i>>8&255]+Ge[i>>16&255]+Ge[i>>24&255]).toLowerCase()}function de(r,e,t){return Math.max(e,Math.min(t,r))}function rv(r,e){return(r%e+e)%e}function gs(r,e,t){return(1-t)*r+t*e}function gr(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function et(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}class kt{constructor(e=0,t=0){kt.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,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[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=de(this.x,e.x,t.x),this.y=de(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=de(this.x,e,t),this.y=de(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(de(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(de(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),n=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*n+e.x,this.y=s*n+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Nr{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,s,a,o){let l=i[n+0],u=i[n+1],d=i[n+2],c=i[n+3];const h=s[a+0],p=s[a+1],m=s[a+2],g=s[a+3];if(o===0){e[t+0]=l,e[t+1]=u,e[t+2]=d,e[t+3]=c;return}if(o===1){e[t+0]=h,e[t+1]=p,e[t+2]=m,e[t+3]=g;return}if(c!==g||l!==h||u!==p||d!==m){let y=1-o;const b=l*h+u*p+d*m+c*g,x=b>=0?1:-1,w=1-b*b;if(w>Number.EPSILON){const q=Math.sqrt(w),M=Math.atan2(q,b*x);y=Math.sin(y*M)/q,o=Math.sin(o*M)/q}const A=o*x;if(l=l*y+h*A,u=u*y+p*A,d=d*y+m*A,c=c*y+g*A,y===1-o){const q=1/Math.sqrt(l*l+u*u+d*d+c*c);l*=q,u*=q,d*=q,c*=q}}e[t]=l,e[t+1]=u,e[t+2]=d,e[t+3]=c}static multiplyQuaternionsFlat(e,t,i,n,s,a){const o=i[n],l=i[n+1],u=i[n+2],d=i[n+3],c=s[a],h=s[a+1],p=s[a+2],m=s[a+3];return e[t]=o*m+d*c+l*p-u*h,e[t+1]=l*m+d*h+u*c-o*p,e[t+2]=u*m+d*p+o*h-l*c,e[t+3]=d*m-o*c-l*h-u*p,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,n){return this._x=e,this._y=t,this._z=i,this._w=n,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,n=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,u=o(i/2),d=o(n/2),c=o(s/2),h=l(i/2),p=l(n/2),m=l(s/2);switch(a){case"XYZ":this._x=h*d*c+u*p*m,this._y=u*p*c-h*d*m,this._z=u*d*m+h*p*c,this._w=u*d*c-h*p*m;break;case"YXZ":this._x=h*d*c+u*p*m,this._y=u*p*c-h*d*m,this._z=u*d*m-h*p*c,this._w=u*d*c+h*p*m;break;case"ZXY":this._x=h*d*c-u*p*m,this._y=u*p*c+h*d*m,this._z=u*d*m+h*p*c,this._w=u*d*c-h*p*m;break;case"ZYX":this._x=h*d*c-u*p*m,this._y=u*p*c+h*d*m,this._z=u*d*m-h*p*c,this._w=u*d*c+h*p*m;break;case"YZX":this._x=h*d*c+u*p*m,this._y=u*p*c+h*d*m,this._z=u*d*m-h*p*c,this._w=u*d*c-h*p*m;break;case"XZY":this._x=h*d*c-u*p*m,this._y=u*p*c-h*d*m,this._z=u*d*m+h*p*c,this._w=u*d*c+h*p*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],n=t[4],s=t[8],a=t[1],o=t[5],l=t[9],u=t[2],d=t[6],c=t[10],h=i+o+c;if(h>0){const p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(d-l)*p,this._y=(s-u)*p,this._z=(a-n)*p}else if(i>o&&i>c){const p=2*Math.sqrt(1+i-o-c);this._w=(d-l)/p,this._x=.25*p,this._y=(n+a)/p,this._z=(s+u)/p}else if(o>c){const p=2*Math.sqrt(1+o-i-c);this._w=(s-u)/p,this._x=(n+a)/p,this._y=.25*p,this._z=(l+d)/p}else{const p=2*Math.sqrt(1+c-i-o);this._w=(a-n)/p,this._x=(s+u)/p,this._y=(l+d)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.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(de(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const n=Math.min(1,t/i);return this.slerp(e,n),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,n=e._y,s=e._z,a=e._w,o=t._x,l=t._y,u=t._z,d=t._w;return this._x=i*d+a*o+n*u-s*l,this._y=n*d+a*l+s*o-i*u,this._z=s*d+a*u+i*l-n*o,this._w=a*d-i*o-n*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,n=this._y,s=this._z,a=this._w;let o=a*e._w+i*e._x+n*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=i,this._y=n,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const p=1-t;return this._w=p*a+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*s+t*this._z,this.normalize(),this}const u=Math.sqrt(l),d=Math.atan2(u,o),c=Math.sin((1-t)*d)/u,h=Math.sin(t*d)/u;return this._w=a*c+this._w*h,this._x=i*c+this._x*h,this._y=n*c+this._y*h,this._z=s*c+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(),n=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(n*Math.sin(e),n*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 P{constructor(e=0,t=0,i=0){P.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(Po.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Po.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*n,this.y=s[1]*t+s[4]*i+s[7]*n,this.z=s[2]*t+s[5]*i+s[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,s=e.elements,a=1/(s[3]*t+s[7]*i+s[11]*n+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*n+s[12])*a,this.y=(s[1]*t+s[5]*i+s[9]*n+s[13])*a,this.z=(s[2]*t+s[6]*i+s[10]*n+s[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,n=this.z,s=e.x,a=e.y,o=e.z,l=e.w,u=2*(a*n-o*i),d=2*(o*t-s*n),c=2*(s*i-a*t);return this.x=t+l*u+a*c-o*d,this.y=i+l*d+o*u-s*c,this.z=n+l*c+s*d-a*u,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,n=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*n,this.y=s[1]*t+s[5]*i+s[9]*n,this.z=s[2]*t+s[6]*i+s[10]*n,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=de(this.x,e.x,t.x),this.y=de(this.y,e.y,t.y),this.z=de(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=de(this.x,e,t),this.y=de(this.y,e,t),this.z=de(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(de(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,n=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=n*l-s*o,this.y=s*a-i*l,this.z=i*o-n*a,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 ys.copy(this).projectOnVector(e),this.sub(ys)}reflect(e){return this.sub(ys.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(de(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}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 n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*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(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,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 ys=new P,Po=new Nr;class fi{constructor(e,t,i,n,s,a,o,l,u){fi.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,n,s,a,o,l,u)}set(e,t,i,n,s,a,o,l,u){const d=this.elements;return d[0]=e,d[1]=n,d[2]=o,d[3]=t,d[4]=s,d[5]=l,d[6]=i,d[7]=a,d[8]=u,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,n=t.elements,s=this.elements,a=i[0],o=i[3],l=i[6],u=i[1],d=i[4],c=i[7],h=i[2],p=i[5],m=i[8],g=n[0],y=n[3],b=n[6],x=n[1],w=n[4],A=n[7],q=n[2],M=n[5],B=n[8];return s[0]=a*g+o*x+l*q,s[3]=a*y+o*w+l*M,s[6]=a*b+o*A+l*B,s[1]=u*g+d*x+c*q,s[4]=u*y+d*w+c*M,s[7]=u*b+d*A+c*B,s[2]=h*g+p*x+m*q,s[5]=h*y+p*w+m*M,s[8]=h*b+p*A+m*B,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],n=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],d=e[8];return t*a*d-t*o*u-i*s*d+i*o*l+n*s*u-n*a*l}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],d=e[8],c=d*a-o*u,h=o*l-d*s,p=u*s-a*l,m=t*c+i*h+n*p;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/m;return e[0]=c*g,e[1]=(n*u-d*i)*g,e[2]=(o*i-n*a)*g,e[3]=h*g,e[4]=(d*t-n*l)*g,e[5]=(n*s-o*t)*g,e[6]=p*g,e[7]=(i*l-u*t)*g,e[8]=(a*t-i*s)*g,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,n,s,a,o){const l=Math.cos(s),u=Math.sin(s);return this.set(i*l,i*u,-i*(l*a+u*o)+a+e,-n*u,n*l,-n*(-u*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(vs.makeScale(e,t)),this}rotate(e){return this.premultiply(vs.makeRotation(-e)),this}translate(e,t){return this.premultiply(vs.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 n=0;n<9;n++)if(t[n]!==i[n])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 vs=new fi;function nv(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function Ro(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}const Do={};function $o(r){r in Do||(Do[r]=!0,console.warn(r))}const Lo=new fi().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ho=new fi().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function sv(){const r={enabled:!0,workingColorSpace:Fo,spaces:{},convert:function(n,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===ms&&(n.r=Kt(n.r),n.g=Kt(n.g),n.b=Kt(n.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(n.applyMatrix3(this.spaces[s].toXYZ),n.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===ms&&(n.r=er(n.r),n.g=er(n.g),n.b=er(n.b))),n},workingToColorSpace:function(n,s){return this.convert(n,this.workingColorSpace,s)},colorSpaceToWorking:function(n,s){return this.convert(n,s,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===Nu?Oo:this.spaces[n].transfer},getToneMappingMode:function(n){return this.spaces[n].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(n,s=this.workingColorSpace){return n.fromArray(this.spaces[s].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n)},_getMatrix:function(n,s,a){return n.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(n,s){return $o("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(n,s)},toWorkingColorSpace:function(n,s){return $o("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(n,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return r.define({[Fo]:{primaries:e,whitePoint:i,transfer:Oo,toXYZ:Lo,fromXYZ:Ho,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:St},outputColorSpaceConfig:{drawingBufferColorSpace:St}},[St]:{primaries:e,whitePoint:i,transfer:ms,toXYZ:Lo,fromXYZ:Ho,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:St}}}),r}const wt=sv();function Kt(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function er(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let Ri;class av{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Ri===void 0&&(Ri=Ro("canvas")),Ri.width=e.width,Ri.height=e.height;const n=Ri.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),i=Ri}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Ro("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const n=i.getImageData(0,0,e.width,e.height),s=n.data;for(let a=0;a<s.length;a++)s[a]=Kt(s[a]/255)*255;return i.putImageData(n,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(Kt(t[i]/255)*255):t[i]=Kt(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let ov=0;class lv{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ov++}),this.uuid=Hr(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},n=this.data;if(n!==null){let s;if(Array.isArray(n)){s=[];for(let a=0,o=n.length;a<o;a++)n[a].isDataTexture?s.push(bs(n[a].image)):s.push(bs(n[a]))}else s=bs(n);i.url=s}return t||(e.images[this.uuid]=i),i}}function bs(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?av.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let uv=0;const xs=new P;class Ci extends es{constructor(e=Ci.DEFAULT_IMAGE,t=Ci.DEFAULT_MAPPING,i=ln,n=ln,s=Zy,a=Qy,o=iv,l=ev,u=Ci.DEFAULT_ANISOTROPY,d=Nu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:uv++}),this.uuid=Hr(),this.name="",this.source=new lv(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=n,this.magFilter=s,this.minFilter=a,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=l,this.offset=new kt(0,0),this.repeat=new kt(1,1),this.center=new kt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new fi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(xs).x}get height(){return this.source.getSize(xs).y}get depth(){return this.source.getSize(xs).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const n=this[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}n&&i&&n.isVector2&&i.isVector2||n&&i&&n.isVector3&&i.isVector3||n&&i&&n.isMatrix3&&i.isMatrix3?n.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Hu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ko:e.x=e.x-Math.floor(e.x);break;case ln:e.x=e.x<0?0:1;break;case Eo: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 ko:e.y=e.y-Math.floor(e.y);break;case ln:e.y=e.y<0?0:1;break;case Eo: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++}}Ci.DEFAULT_IMAGE=null;Ci.DEFAULT_MAPPING=Hu;Ci.DEFAULT_ANISOTROPY=1;class Vr{constructor(e=0,t=0,i=0,n=1){Vr.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}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,n){return this.x=e,this.y=t,this.z=i,this.w=n,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,n=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*s,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*s,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*s,this.w=a[3]*t+a[7]*i+a[11]*n+a[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,n,s;const l=e.elements,u=l[0],d=l[4],c=l[8],h=l[1],p=l[5],m=l[9],g=l[2],y=l[6],b=l[10];if(Math.abs(d-h)<.01&&Math.abs(c-g)<.01&&Math.abs(m-y)<.01){if(Math.abs(d+h)<.1&&Math.abs(c+g)<.1&&Math.abs(m+y)<.1&&Math.abs(u+p+b-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(u+1)/2,A=(p+1)/2,q=(b+1)/2,M=(d+h)/4,B=(c+g)/4,H=(m+y)/4;return w>A&&w>q?w<.01?(i=0,n=.707106781,s=.707106781):(i=Math.sqrt(w),n=M/i,s=B/i):A>q?A<.01?(i=.707106781,n=0,s=.707106781):(n=Math.sqrt(A),i=M/n,s=H/n):q<.01?(i=.707106781,n=.707106781,s=0):(s=Math.sqrt(q),i=B/s,n=H/s),this.set(i,n,s,t),this}let x=Math.sqrt((y-m)*(y-m)+(c-g)*(c-g)+(h-d)*(h-d));return Math.abs(x)<.001&&(x=1),this.x=(y-m)/x,this.y=(c-g)/x,this.z=(h-d)/x,this.w=Math.acos((u+p+b-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=de(this.x,e.x,t.x),this.y=de(this.y,e.y,t.y),this.z=de(this.z,e.z,t.z),this.w=de(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=de(this.x,e,t),this.y=de(this.y,e,t),this.z=de(this.z,e,t),this.w=de(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(de(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 Ur{constructor(e=new P(1/0,1/0,1/0),t=new P(-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<i;t+=3)this.expandByPoint(_t.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(_t.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=_t.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,_t):_t.fromBufferAttribute(s,a),_t.applyMatrix4(e.matrixWorld),this.expandByPoint(_t);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),dn.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),dn.copy(i.boundingBox)),dn.applyMatrix4(e.matrixWorld),this.union(dn)}const n=e.children;for(let s=0,a=n.length;s<a;s++)this.expandByObject(n[s],t);return this}containsPoint(e){return e.x>=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,_t),_t.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(yr),cn.subVectors(this.max,yr),Di.subVectors(e.a,yr),$i.subVectors(e.b,yr),Li.subVectors(e.c,yr),Qt.subVectors($i,Di),ei.subVectors(Li,$i),bi.subVectors(Di,Li);let t=[0,-Qt.z,Qt.y,0,-ei.z,ei.y,0,-bi.z,bi.y,Qt.z,0,-Qt.x,ei.z,0,-ei.x,bi.z,0,-bi.x,-Qt.y,Qt.x,0,-ei.y,ei.x,0,-bi.y,bi.x,0];return!ws(t,Di,$i,Li,cn)||(t=[1,0,0,0,1,0,0,0,1],!ws(t,Di,$i,Li,cn))?!1:(hn.crossVectors(Qt,ei),t=[hn.x,hn.y,hn.z],ws(t,Di,$i,Li,cn))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,_t).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(_t).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:(Vt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Vt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Vt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Vt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Vt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Vt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Vt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Vt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Vt),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Vt=[new P,new P,new P,new P,new P,new P,new P,new P],_t=new P,dn=new Ur,Di=new P,$i=new P,Li=new P,Qt=new P,ei=new P,bi=new P,yr=new P,cn=new P,hn=new P,xi=new P;function ws(r,e,t,i,n){for(let s=0,a=r.length-3;s<=a;s+=3){xi.fromArray(r,s);const o=n.x*Math.abs(xi.x)+n.y*Math.abs(xi.y)+n.z*Math.abs(xi.z),l=e.dot(xi),u=t.dot(xi),d=i.dot(xi);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>o)return!1}return!0}const dv=new Ur,vr=new P,_s=new P;class Vu{constructor(e=new P,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):dv.setFromPoints(e).getCenter(i);let n=0;for(let s=0,a=e.length;s<a;s++)n=Math.max(n,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.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;vr.subVectors(e,this.center);const t=vr.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector(vr,n/i),this.radius+=n}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):(_s.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(vr.copy(e.center).add(_s)),this.expandByPoint(vr.copy(e.center).sub(_s))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Ut=new P,Cs=new P,fn=new P,ti=new P,As=new P,pn=new P,Ss=new P;class cv{constructor(e=new P,t=new P(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,Ut)),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=Ut.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ut.copy(this.origin).addScaledVector(this.direction,t),Ut.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){Cs.copy(e).add(t).multiplyScalar(.5),fn.copy(t).sub(e).normalize(),ti.copy(this.origin).sub(Cs);const s=e.distanceTo(t)*.5,a=-this.direction.dot(fn),o=ti.dot(this.direction),l=-ti.dot(fn),u=ti.lengthSq(),d=Math.abs(1-a*a);let c,h,p,m;if(d>0)if(c=a*l-o,h=a*o-l,m=s*d,c>=0)if(h>=-m)if(h<=m){const g=1/d;c*=g,h*=g,p=c*(c+a*h+2*o)+h*(a*c+h+2*l)+u}else h=s,c=Math.max(0,-(a*h+o)),p=-c*c+h*(h+2*l)+u;else h=-s,c=Math.max(0,-(a*h+o)),p=-c*c+h*(h+2*l)+u;else h<=-m?(c=Math.max(0,-(-a*s+o)),h=c>0?-s:Math.min(Math.max(-s,-l),s),p=-c*c+h*(h+2*l)+u):h<=m?(c=0,h=Math.min(Math.max(-s,-l),s),p=h*(h+2*l)+u):(c=Math.max(0,-(a*s+o)),h=c>0?s:Math.min(Math.max(-s,-l),s),p=-c*c+h*(h+2*l)+u);else h=a>0?-s:s,c=Math.max(0,-(a*h+o)),p=-c*c+h*(h+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,c),n&&n.copy(Cs).addScaledVector(fn,h),p}intersectSphere(e,t){Ut.subVectors(e.center,this.origin);const i=Ut.dot(this.direction),n=Ut.dot(Ut)-i*i,s=e.radius*e.radius;if(n>s)return null;const a=Math.sqrt(s-n),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1: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,n,s,a,o,l;const u=1/this.direction.x,d=1/this.direction.y,c=1/this.direction.z,h=this.origin;return u>=0?(i=(e.min.x-h.x)*u,n=(e.max.x-h.x)*u):(i=(e.max.x-h.x)*u,n=(e.min.x-h.x)*u),d>=0?(s=(e.min.y-h.y)*d,a=(e.max.y-h.y)*d):(s=(e.max.y-h.y)*d,a=(e.min.y-h.y)*d),i>a||s>n||((s>i||isNaN(i))&&(i=s),(a<n||isNaN(n))&&(n=a),c>=0?(o=(e.min.z-h.z)*c,l=(e.max.z-h.z)*c):(o=(e.max.z-h.z)*c,l=(e.min.z-h.z)*c),i>l||o>n)||((o>i||i!==i)&&(i=o),(l<n||n!==n)&&(n=l),n<0)?null:this.at(i>=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,Ut)!==null}intersectTriangle(e,t,i,n,s){As.subVectors(t,e),pn.subVectors(i,e),Ss.crossVectors(As,pn);let a=this.direction.dot(Ss),o;if(a>0){if(n)return null;o=1}else if(a<0)o=-1,a=-a;else return null;ti.subVectors(this.origin,e);const l=o*this.direction.dot(pn.crossVectors(ti,pn));if(l<0)return null;const u=o*this.direction.dot(As.cross(ti));if(u<0||l+u>a)return null;const d=-o*ti.dot(Ss);return d<0?null:this.at(d/a,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 Et{constructor(e,t,i,n,s,a,o,l,u,d,c,h,p,m,g,y){Et.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,n,s,a,o,l,u,d,c,h,p,m,g,y)}set(e,t,i,n,s,a,o,l,u,d,c,h,p,m,g,y){const b=this.elements;return b[0]=e,b[4]=t,b[8]=i,b[12]=n,b[1]=s,b[5]=a,b[9]=o,b[13]=l,b[2]=u,b[6]=d,b[10]=c,b[14]=h,b[3]=p,b[7]=m,b[11]=g,b[15]=y,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 Et().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,n=1/Hi.setFromMatrixColumn(e,0).length(),s=1/Hi.setFromMatrixColumn(e,1).length(),a=1/Hi.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,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]*a,t[9]=i[9]*a,t[10]=i[10]*a,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,n=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(n),u=Math.sin(n),d=Math.cos(s),c=Math.sin(s);if(e.order==="XYZ"){const h=a*d,p=a*c,m=o*d,g=o*c;t[0]=l*d,t[4]=-l*c,t[8]=u,t[1]=p+m*u,t[5]=h-g*u,t[9]=-o*l,t[2]=g-h*u,t[6]=m+p*u,t[10]=a*l}else if(e.order==="YXZ"){const h=l*d,p=l*c,m=u*d,g=u*c;t[0]=h+g*o,t[4]=m*o-p,t[8]=a*u,t[1]=a*c,t[5]=a*d,t[9]=-o,t[2]=p*o-m,t[6]=g+h*o,t[10]=a*l}else if(e.order==="ZXY"){const h=l*d,p=l*c,m=u*d,g=u*c;t[0]=h-g*o,t[4]=-a*c,t[8]=m+p*o,t[1]=p+m*o,t[5]=a*d,t[9]=g-h*o,t[2]=-a*u,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const h=a*d,p=a*c,m=o*d,g=o*c;t[0]=l*d,t[4]=m*u-p,t[8]=h*u+g,t[1]=l*c,t[5]=g*u+h,t[9]=p*u-m,t[2]=-u,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const h=a*l,p=a*u,m=o*l,g=o*u;t[0]=l*d,t[4]=g-h*c,t[8]=m*c+p,t[1]=c,t[5]=a*d,t[9]=-o*d,t[2]=-u*d,t[6]=p*c+m,t[10]=h-g*c}else if(e.order==="XZY"){const h=a*l,p=a*u,m=o*l,g=o*u;t[0]=l*d,t[4]=-c,t[8]=u*d,t[1]=h*c+g,t[5]=a*d,t[9]=p*c-m,t[2]=m*c-p,t[6]=o*d,t[10]=g*c+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(hv,e,fv)}lookAt(e,t,i){const n=this.elements;return nt.subVectors(e,t),nt.lengthSq()===0&&(nt.z=1),nt.normalize(),ii.crossVectors(i,nt),ii.lengthSq()===0&&(Math.abs(i.z)===1?nt.x+=1e-4:nt.z+=1e-4,nt.normalize(),ii.crossVectors(i,nt)),ii.normalize(),mn.crossVectors(nt,ii),n[0]=ii.x,n[4]=mn.x,n[8]=nt.x,n[1]=ii.y,n[5]=mn.y,n[9]=nt.y,n[2]=ii.z,n[6]=mn.z,n[10]=nt.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,s=this.elements,a=i[0],o=i[4],l=i[8],u=i[12],d=i[1],c=i[5],h=i[9],p=i[13],m=i[2],g=i[6],y=i[10],b=i[14],x=i[3],w=i[7],A=i[11],q=i[15],M=n[0],B=n[4],H=n[8],E=n[12],R=n[1],U=n[5],W=n[9],te=n[13],Q=n[2],oe=n[6],J=n[10],ee=n[14],Y=n[3],he=n[7],se=n[11],ye=n[15];return s[0]=a*M+o*R+l*Q+u*Y,s[4]=a*B+o*U+l*oe+u*he,s[8]=a*H+o*W+l*J+u*se,s[12]=a*E+o*te+l*ee+u*ye,s[1]=d*M+c*R+h*Q+p*Y,s[5]=d*B+c*U+h*oe+p*he,s[9]=d*H+c*W+h*J+p*se,s[13]=d*E+c*te+h*ee+p*ye,s[2]=m*M+g*R+y*Q+b*Y,s[6]=m*B+g*U+y*oe+b*he,s[10]=m*H+g*W+y*J+b*se,s[14]=m*E+g*te+y*ee+b*ye,s[3]=x*M+w*R+A*Q+q*Y,s[7]=x*B+w*U+A*oe+q*he,s[11]=x*H+w*W+A*J+q*se,s[15]=x*E+w*te+A*ee+q*ye,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],n=e[8],s=e[12],a=e[1],o=e[5],l=e[9],u=e[13],d=e[2],c=e[6],h=e[10],p=e[14],m=e[3],g=e[7],y=e[11],b=e[15];return m*(+s*l*c-n*u*c-s*o*h+i*u*h+n*o*p-i*l*p)+g*(+t*l*p-t*u*h+s*a*h-n*a*p+n*u*d-s*l*d)+y*(+t*u*c-t*o*p-s*a*c+i*a*p+s*o*d-i*u*d)+b*(-n*o*d-t*l*c+t*o*h+n*a*c-i*a*h+i*l*d)}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 n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],d=e[8],c=e[9],h=e[10],p=e[11],m=e[12],g=e[13],y=e[14],b=e[15],x=c*y*u-g*h*u+g*l*p-o*y*p-c*l*b+o*h*b,w=m*h*u-d*y*u-m*l*p+a*y*p+d*l*b-a*h*b,A=d*g*u-m*c*u+m*o*p-a*g*p-d*o*b+a*c*b,q=m*c*l-d*g*l-m*o*h+a*g*h+d*o*y-a*c*y,M=t*x+i*w+n*A+s*q;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/M;return e[0]=x*B,e[1]=(g*h*s-c*y*s-g*n*p+i*y*p+c*n*b-i*h*b)*B,e[2]=(o*y*s-g*l*s+g*n*u-i*y*u-o*n*b+i*l*b)*B,e[3]=(c*l*s-o*h*s-c*n*u+i*h*u+o*n*p-i*l*p)*B,e[4]=w*B,e[5]=(d*y*s-m*h*s+m*n*p-t*y*p-d*n*b+t*h*b)*B,e[6]=(m*l*s-a*y*s-m*n*u+t*y*u+a*n*b-t*l*b)*B,e[7]=(a*h*s-d*l*s+d*n*u-t*h*u-a*n*p+t*l*p)*B,e[8]=A*B,e[9]=(m*c*s-d*g*s-m*i*p+t*g*p+d*i*b-t*c*b)*B,e[10]=(a*g*s-m*o*s+m*i*u-t*g*u-a*i*b+t*o*b)*B,e[11]=(d*o*s-a*c*s-d*i*u+t*c*u+a*i*p-t*o*p)*B,e[12]=q*B,e[13]=(d*g*n-m*c*n+m*i*h-t*g*h-d*i*y+t*c*y)*B,e[14]=(m*o*n-a*g*n-m*i*l+t*g*l+a*i*y-t*o*y)*B,e[15]=(a*c*n-d*o*n+d*i*l-t*c*l-a*i*h+t*o*h)*B,this}scale(e){const t=this.elements,i=e.x,n=e.y,s=e.z;return t[0]*=i,t[4]*=n,t[8]*=s,t[1]*=i,t[5]*=n,t[9]*=s,t[2]*=i,t[6]*=n,t[10]*=s,t[3]*=i,t[7]*=n,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],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}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),n=Math.sin(t),s=1-i,a=e.x,o=e.y,l=e.z,u=s*a,d=s*o;return this.set(u*a+i,u*o-n*l,u*l+n*o,0,u*o+n*l,d*o+i,d*l-n*a,0,u*l-n*o,d*l+n*a,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,n,s,a){return this.set(1,i,s,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){const n=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,u=s+s,d=a+a,c=o+o,h=s*u,p=s*d,m=s*c,g=a*d,y=a*c,b=o*c,x=l*u,w=l*d,A=l*c,q=i.x,M=i.y,B=i.z;return n[0]=(1-(g+b))*q,n[1]=(p+A)*q,n[2]=(m-w)*q,n[3]=0,n[4]=(p-A)*M,n[5]=(1-(h+b))*M,n[6]=(y+x)*M,n[7]=0,n[8]=(m+w)*B,n[9]=(y-x)*B,n[10]=(1-(h+g))*B,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){const n=this.elements;let s=Hi.set(n[0],n[1],n[2]).length();const a=Hi.set(n[4],n[5],n[6]).length(),o=Hi.set(n[8],n[9],n[10]).length();this.determinant()<0&&(s=-s),e.x=n[12],e.y=n[13],e.z=n[14],Ct.copy(this);const u=1/s,d=1/a,c=1/o;return Ct.elements[0]*=u,Ct.elements[1]*=u,Ct.elements[2]*=u,Ct.elements[4]*=d,Ct.elements[5]*=d,Ct.elements[6]*=d,Ct.elements[8]*=c,Ct.elements[9]*=c,Ct.elements[10]*=c,t.setFromRotationMatrix(Ct),i.x=s,i.y=a,i.z=o,this}makePerspective(e,t,i,n,s,a,o=un,l=!1){const u=this.elements,d=2*s/(t-e),c=2*s/(i-n),h=(t+e)/(t-e),p=(i+n)/(i-n);let m,g;if(l)m=s/(a-s),g=a*s/(a-s);else if(o===un)m=-(a+s)/(a-s),g=-2*a*s/(a-s);else if(o===To)m=-a/(a-s),g=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return u[0]=d,u[4]=0,u[8]=h,u[12]=0,u[1]=0,u[5]=c,u[9]=p,u[13]=0,u[2]=0,u[6]=0,u[10]=m,u[14]=g,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,i,n,s,a,o=un,l=!1){const u=this.elements,d=2/(t-e),c=2/(i-n),h=-(t+e)/(t-e),p=-(i+n)/(i-n);let m,g;if(l)m=1/(a-s),g=a/(a-s);else if(o===un)m=-2/(a-s),g=-(a+s)/(a-s);else if(o===To)m=-1/(a-s),g=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return u[0]=d,u[4]=0,u[8]=0,u[12]=h,u[1]=0,u[5]=c,u[9]=0,u[13]=p,u[2]=0,u[6]=0,u[10]=m,u[14]=g,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])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 Hi=new P,Ct=new Et,hv=new P(0,0,0),fv=new P(1,1,1),ii=new P,mn=new P,nt=new P,No=new Et,Vo=new Nr;class jr{constructor(e=0,t=0,i=0,n=jr.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}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,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,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 n=e.elements,s=n[0],a=n[4],o=n[8],l=n[1],u=n[5],d=n[9],c=n[2],h=n[6],p=n[10];switch(t){case"XYZ":this._y=Math.asin(de(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-d,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-de(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-c,s),this._z=0);break;case"ZXY":this._x=Math.asin(de(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-c,p),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-de(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin(de(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-c,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-de(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-d,p),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 No.makeRotationFromQuaternion(e),this.setFromRotationMatrix(No,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Vo.setFromEuler(this),this.setFromQuaternion(Vo,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}}jr.DEFAULT_ORDER="XYZ";class pv{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let mv=0;const Uo=new P,Ni=new Nr,jt=new Et,gn=new P,br=new P,gv=new P,yv=new Nr,jo=new P(1,0,0),Wo=new P(0,1,0),Go=new P(0,0,1),Ko={type:"added"},vv={type:"removed"},Vi={type:"childadded",child:null},Ms={type:"childremoved",child:null};class Xt extends es{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:mv++}),this.uuid=Hr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Xt.DEFAULT_UP.clone();const e=new P,t=new jr,i=new Nr,n=new P(1,1,1);function s(){i.setFromEuler(t,!1)}function a(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Et},normalMatrix:{value:new fi}}),this.matrix=new Et,this.matrixWorld=new Et,this.matrixAutoUpdate=Xt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Xt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new pv,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Ni.setFromAxisAngle(e,t),this.quaternion.multiply(Ni),this}rotateOnWorldAxis(e,t){return Ni.setFromAxisAngle(e,t),this.quaternion.premultiply(Ni),this}rotateX(e){return this.rotateOnAxis(jo,e)}rotateY(e){return this.rotateOnAxis(Wo,e)}rotateZ(e){return this.rotateOnAxis(Go,e)}translateOnAxis(e,t){return Uo.copy(e).applyQuaternion(this.quaternion),this.position.add(Uo.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(jo,e)}translateY(e){return this.translateOnAxis(Wo,e)}translateZ(e){return this.translateOnAxis(Go,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(jt.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?gn.copy(e):gn.set(e,t,i);const n=this.parent;this.updateWorldMatrix(!0,!1),br.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?jt.lookAt(br,gn,this.up):jt.lookAt(gn,br,this.up),this.quaternion.setFromRotationMatrix(jt),n&&(jt.extractRotation(n.matrixWorld),Ni.setFromRotationMatrix(jt),this.quaternion.premultiply(Ni.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Ko),Vi.child=e,this.dispatchEvent(Vi),Vi.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(vv),Ms.child=e,this.dispatchEvent(Ms),Ms.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),jt.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),jt.multiply(e.parent.matrixWorld)),e.applyMatrix4(jt),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Ko),Vi.child=e,this.dispatchEvent(Vi),Vi.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){const a=this.children[i].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const n=this.children;for(let s=0,a=n.length;s<a;s++)n[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(br,e,gv),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(br,yv,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const n=this.children;for(let s=0,a=n.length;s<a;s++)n[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const n={};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),this.frustumCulled===!1&&(n.frustumCulled=!1),this.renderOrder!==0&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),n.instanceInfo=this._instanceInfo.map(o=>({...o})),n.availableInstanceIds=this._availableInstanceIds.slice(),n.availableGeometryIds=this._availableGeometryIds.slice(),n.nextIndexStart=this._nextIndexStart,n.nextVertexStart=this._nextVertexStart,n.geometryCount=this._geometryCount,n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.matricesTexture=this._matricesTexture.toJSON(e),n.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(n.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(n.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(n.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let u=0,d=l.length;u<d;u++){const c=l[u];s(e.shapes,c)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,u=this.material.length;l<u;l++)o.push(s(e.materials,this.material[l]));n.material=o}else n.material=s(e.materials,this.material);if(this.children.length>0){n.children=[];for(let o=0;o<this.children.length;o++)n.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];n.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),u=a(e.textures),d=a(e.images),c=a(e.shapes),h=a(e.skeletons),p=a(e.animations),m=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),d.length>0&&(i.images=d),c.length>0&&(i.shapes=c),h.length>0&&(i.skeletons=h),p.length>0&&(i.animations=p),m.length>0&&(i.nodes=m)}return i.object=n,i;function a(o){const l=[];for(const u in o){const d=o[u];delete d.metadata,l.push(d)}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;i<e.children.length;i++){const n=e.children[i];this.add(n.clone())}return this}}Xt.DEFAULT_UP=new P(0,1,0);Xt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Xt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const At=new P,Wt=new P,Bs=new P,Gt=new P,Ui=new P,ji=new P,Xo=new P,qs=new P,ks=new P,Es=new P,Fs=new Vr,Os=new Vr,zs=new Vr;class Bt{constructor(e=new P,t=new P,i=new P){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),At.subVectors(e,t),n.cross(At);const s=n.lengthSq();return s>0?n.multiplyScalar(1/Math.sqrt(s)):n.set(0,0,0)}static getBarycoord(e,t,i,n,s){At.subVectors(n,t),Wt.subVectors(i,t),Bs.subVectors(e,t);const a=At.dot(At),o=At.dot(Wt),l=At.dot(Bs),u=Wt.dot(Wt),d=Wt.dot(Bs),c=a*u-o*o;if(c===0)return s.set(0,0,0),null;const h=1/c,p=(u*l-o*d)*h,m=(a*d-o*l)*h;return s.set(1-p-m,m,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Gt)===null?!1:Gt.x>=0&&Gt.y>=0&&Gt.x+Gt.y<=1}static getInterpolation(e,t,i,n,s,a,o,l){return this.getBarycoord(e,t,i,n,Gt)===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,Gt.x),l.addScaledVector(a,Gt.y),l.addScaledVector(o,Gt.z),l)}static getInterpolatedAttribute(e,t,i,n,s,a){return Fs.setScalar(0),Os.setScalar(0),zs.setScalar(0),Fs.fromBufferAttribute(e,t),Os.fromBufferAttribute(e,i),zs.fromBufferAttribute(e,n),a.setScalar(0),a.addScaledVector(Fs,s.x),a.addScaledVector(Os,s.y),a.addScaledVector(zs,s.z),a}static isFrontFacing(e,t,i,n){return At.subVectors(i,t),Wt.subVectors(e,t),At.cross(Wt).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),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 At.subVectors(this.c,this.b),Wt.subVectors(this.a,this.b),At.cross(Wt).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Bt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Bt.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,s){return Bt.getInterpolation(e,this.a,this.b,this.c,t,i,n,s)}containsPoint(e){return Bt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Bt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,n=this.b,s=this.c;let a,o;Ui.subVectors(n,i),ji.subVectors(s,i),qs.subVectors(e,i);const l=Ui.dot(qs),u=ji.dot(qs);if(l<=0&&u<=0)return t.copy(i);ks.subVectors(e,n);const d=Ui.dot(ks),c=ji.dot(ks);if(d>=0&&c<=d)return t.copy(n);const h=l*c-d*u;if(h<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(i).addScaledVector(Ui,a);Es.subVectors(e,s);const p=Ui.dot(Es),m=ji.dot(Es);if(m>=0&&p<=m)return t.copy(s);const g=p*u-l*m;if(g<=0&&u>=0&&m<=0)return o=u/(u-m),t.copy(i).addScaledVector(ji,o);const y=d*m-p*c;if(y<=0&&c-d>=0&&p-m>=0)return Xo.subVectors(s,n),o=(c-d)/(c-d+(p-m)),t.copy(n).addScaledVector(Xo,o);const b=1/(y+g+h);return a=g*b,o=h*b,t.copy(i).addScaledVector(Ui,a).addScaledVector(ji,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Uu={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},ri={h:0,s:0,l:0},yn={h:0,s:0,l:0};function Is(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class Wr{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 n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=St){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,wt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,n=wt.workingColorSpace){return this.r=e,this.g=t,this.b=i,wt.colorSpaceToWorking(this,n),this}setHSL(e,t,i,n=wt.workingColorSpace){if(e=rv(e,1),t=de(t,0,1),i=de(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,a=2*i-s;this.r=Is(a,s,e+1/3),this.g=Is(a,s,e),this.b=Is(a,s,e-1/3)}return wt.colorSpaceToWorking(this,n),this}setStyle(e,t=St){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=n[1],o=n[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))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(o))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(o))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(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=n[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===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=St){const i=Uu[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=Kt(e.r),this.g=Kt(e.g),this.b=Kt(e.b),this}copyLinearToSRGB(e){return this.r=er(e.r),this.g=er(e.g),this.b=er(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=St){return wt.workingToColorSpace(Ke.copy(this),e),Math.round(de(Ke.r*255,0,255))*65536+Math.round(de(Ke.g*255,0,255))*256+Math.round(de(Ke.b*255,0,255))}getHexString(e=St){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=wt.workingColorSpace){wt.workingToColorSpace(Ke.copy(this),t);const i=Ke.r,n=Ke.g,s=Ke.b,a=Math.max(i,n,s),o=Math.min(i,n,s);let l,u;const d=(o+a)/2;if(o===a)l=0,u=0;else{const c=a-o;switch(u=d<=.5?c/(a+o):c/(2-a-o),a){case i:l=(n-s)/c+(n<s?6:0);break;case n:l=(s-i)/c+2;break;case s:l=(i-n)/c+4;break}l/=6}return e.h=l,e.s=u,e.l=d,e}getRGB(e,t=wt.workingColorSpace){return wt.workingToColorSpace(Ke.copy(this),t),e.r=Ke.r,e.g=Ke.g,e.b=Ke.b,e}getStyle(e=St){wt.workingToColorSpace(Ke.copy(this),e);const t=Ke.r,i=Ke.g,n=Ke.b;return e!==St?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(n*255)})`}offsetHSL(e,t,i){return this.getHSL(ri),this.setHSL(ri.h+e,ri.s+t,ri.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(ri),e.getHSL(yn);const i=gs(ri.h,yn.h,t),n=gs(ri.s,yn.s,t),s=gs(ri.l,yn.l,t);return this.setHSL(i,n,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,n=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*n,this.g=s[1]*t+s[4]*i+s[7]*n,this.b=s[2]*t+s[5]*i+s[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ke=new Wr;Wr.NAMES=Uu;let bv=0;class xv extends es{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:bv++}),this.uuid=Hr(),this.name="",this.type="Material",this.blending=Ao,this.side=ia,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Mo,this.blendDst=Bo,this.blendEquation=So,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Wr(0,0,0),this.blendAlpha=0,this.depthFunc=qo,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=zo,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Pi,this.stencilZFail=Pi,this.stencilZPass=Pi,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=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 n=this[t];if(n===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,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.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),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!==Ao&&(i.blending=this.blending),this.side!==ia&&(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!==Mo&&(i.blendSrc=this.blendSrc),this.blendDst!==Bo&&(i.blendDst=this.blendDst),this.blendEquation!==So&&(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!==qo&&(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!==zo&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Pi&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Pi&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Pi&&(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 n(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=n(e.textures),a=n(e.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}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 n=t.length;i=new Array(n);for(let s=0;s!==n;++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++}}class ju extends xv{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Wr(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 jr,this.combine=Jy,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 Fe=new P,vn=new kt;let wv=0;class tr{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:wv++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Io,this.updateRanges=[],this.gpuType=tv,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 n=0,s=this.itemSize;n<s;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)vn.fromBufferAttribute(this,t),vn.applyMatrix3(e),this.setXY(t,vn.x,vn.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)Fe.fromBufferAttribute(this,t),Fe.applyMatrix3(e),this.setXYZ(t,Fe.x,Fe.y,Fe.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)Fe.fromBufferAttribute(this,t),Fe.applyMatrix4(e),this.setXYZ(t,Fe.x,Fe.y,Fe.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Fe.fromBufferAttribute(this,t),Fe.applyNormalMatrix(e),this.setXYZ(t,Fe.x,Fe.y,Fe.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Fe.fromBufferAttribute(this,t),Fe.transformDirection(e),this.setXYZ(t,Fe.x,Fe.y,Fe.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=gr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=et(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=gr(t,this.array)),t}setX(e,t){return this.normalized&&(t=et(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=gr(t,this.array)),t}setY(e,t){return this.normalized&&(t=et(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=gr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=et(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=gr(t,this.array)),t}setW(e,t){return this.normalized&&(t=et(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=et(t,this.array),i=et(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=et(t,this.array),i=et(i,this.array),n=et(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,s){return e*=this.itemSize,this.normalized&&(t=et(t,this.array),i=et(i,this.array),n=et(n,this.array),s=et(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Io&&(e.usage=this.usage),e}}class _v extends tr{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class Cv extends tr{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class Av extends tr{constructor(e,t,i){super(new Float32Array(e),t,i)}}let Sv=0;const ct=new Et,Ts=new Xt,Wi=new P,st=new Ur,xr=new Ur,De=new P;class Pa extends es{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Sv++}),this.uuid=Hr(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(nv(e)?Cv:_v)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new fi().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const n=this.attributes.tangent;return n!==void 0&&(n.transformDirection(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ct.makeRotationFromQuaternion(e),this.applyMatrix4(ct),this}rotateX(e){return ct.makeRotationX(e),this.applyMatrix4(ct),this}rotateY(e){return ct.makeRotationY(e),this.applyMatrix4(ct),this}rotateZ(e){return ct.makeRotationZ(e),this.applyMatrix4(ct),this}translate(e,t,i){return ct.makeTranslation(e,t,i),this.applyMatrix4(ct),this}scale(e,t,i){return ct.makeScale(e,t,i),this.applyMatrix4(ct),this}lookAt(e){return Ts.lookAt(e),Ts.updateMatrix(),this.applyMatrix4(Ts.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Wi).negate(),this.translate(Wi.x,Wi.y,Wi.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let n=0,s=e.length;n<s;n++){const a=e[n];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Av(i,3))}else{const i=Math.min(e.length,t.count);for(let n=0;n<i;n++){const s=e[n];t.setXYZ(n,s.x,s.y,s.z||0)}e.length>t.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 Ur);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 P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,n=t.length;i<n;i++){const s=t[i];st.setFromBufferAttribute(s),this.morphTargetsRelative?(De.addVectors(this.boundingBox.min,st.min),this.boundingBox.expandByPoint(De),De.addVectors(this.boundingBox.max,st.max),this.boundingBox.expandByPoint(De)):(this.boundingBox.expandByPoint(st.min),this.boundingBox.expandByPoint(st.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Vu);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new P,1/0);return}if(e){const i=this.boundingSphere.center;if(st.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];xr.setFromBufferAttribute(o),this.morphTargetsRelative?(De.addVectors(st.min,xr.min),st.expandByPoint(De),De.addVectors(st.max,xr.max),st.expandByPoint(De)):(st.expandByPoint(xr.min),st.expandByPoint(xr.max))}st.getCenter(i);let n=0;for(let s=0,a=e.count;s<a;s++)De.fromBufferAttribute(e,s),n=Math.max(n,i.distanceToSquared(De));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let u=0,d=o.count;u<d;u++)De.fromBufferAttribute(o,u),l&&(Wi.fromBufferAttribute(e,u),De.add(Wi)),n=Math.max(n,i.distanceToSquared(De))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,n=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new tr(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let H=0;H<i.count;H++)o[H]=new P,l[H]=new P;const u=new P,d=new P,c=new P,h=new kt,p=new kt,m=new kt,g=new P,y=new P;function b(H,E,R){u.fromBufferAttribute(i,H),d.fromBufferAttribute(i,E),c.fromBufferAttribute(i,R),h.fromBufferAttribute(s,H),p.fromBufferAttribute(s,E),m.fromBufferAttribute(s,R),d.sub(u),c.sub(u),p.sub(h),m.sub(h);const U=1/(p.x*m.y-m.x*p.y);isFinite(U)&&(g.copy(d).multiplyScalar(m.y).addScaledVector(c,-p.y).multiplyScalar(U),y.copy(c).multiplyScalar(p.x).addScaledVector(d,-m.x).multiplyScalar(U),o[H].add(g),o[E].add(g),o[R].add(g),l[H].add(y),l[E].add(y),l[R].add(y))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let H=0,E=x.length;H<E;++H){const R=x[H],U=R.start,W=R.count;for(let te=U,Q=U+W;te<Q;te+=3)b(e.getX(te+0),e.getX(te+1),e.getX(te+2))}const w=new P,A=new P,q=new P,M=new P;function B(H){q.fromBufferAttribute(n,H),M.copy(q);const E=o[H];w.copy(E),w.sub(q.multiplyScalar(q.dot(E))).normalize(),A.crossVectors(M,E);const U=A.dot(l[H])<0?-1:1;a.setXYZW(H,w.x,w.y,w.z,U)}for(let H=0,E=x.length;H<E;++H){const R=x[H],U=R.start,W=R.count;for(let te=U,Q=U+W;te<Q;te+=3)B(e.getX(te+0)),B(e.getX(te+1)),B(e.getX(te+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new tr(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let h=0,p=i.count;h<p;h++)i.setXYZ(h,0,0,0);const n=new P,s=new P,a=new P,o=new P,l=new P,u=new P,d=new P,c=new P;if(e)for(let h=0,p=e.count;h<p;h+=3){const m=e.getX(h+0),g=e.getX(h+1),y=e.getX(h+2);n.fromBufferAttribute(t,m),s.fromBufferAttribute(t,g),a.fromBufferAttribute(t,y),d.subVectors(a,s),c.subVectors(n,s),d.cross(c),o.fromBufferAttribute(i,m),l.fromBufferAttribute(i,g),u.fromBufferAttribute(i,y),o.add(d),l.add(d),u.add(d),i.setXYZ(m,o.x,o.y,o.z),i.setXYZ(g,l.x,l.y,l.z),i.setXYZ(y,u.x,u.y,u.z)}else for(let h=0,p=t.count;h<p;h+=3)n.fromBufferAttribute(t,h+0),s.fromBufferAttribute(t,h+1),a.fromBufferAttribute(t,h+2),d.subVectors(a,s),c.subVectors(n,s),d.cross(c),i.setXYZ(h+0,d.x,d.y,d.z),i.setXYZ(h+1,d.x,d.y,d.z),i.setXYZ(h+2,d.x,d.y,d.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)De.fromBufferAttribute(e,t),De.normalize(),e.setXYZ(t,De.x,De.y,De.z)}toNonIndexed(){function e(o,l){const u=o.array,d=o.itemSize,c=o.normalized,h=new u.constructor(l.length*d);let p=0,m=0;for(let g=0,y=l.length;g<y;g++){o.isInterleavedBufferAttribute?p=l[g]*o.data.stride+o.offset:p=l[g]*d;for(let b=0;b<d;b++)h[m++]=u[p++]}return new tr(h,d,c)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Pa,i=this.index.array,n=this.attributes;for(const o in n){const l=n[o],u=e(l,i);t.setAttribute(o,u)}const s=this.morphAttributes;for(const o in s){const l=[],u=s[o];for(let d=0,c=u.length;d<c;d++){const h=u[d],p=e(h,i);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const u=a[o];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);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 u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const n={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],d=[];for(let c=0,h=u.length;c<h;c++){const p=u[c];d.push(p.toJSON(e.data))}d.length>0&&(n[l]=d,s=!0)}s&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),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());const n=e.attributes;for(const u in n){const d=n[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],c=s[u];for(let h=0,p=c.length;h<p;h++)d.push(c[h].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let u=0,d=a.length;u<d;u++){const c=a[u];this.addGroup(c.start,c.count,c.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Yo=new Et,wi=new cv,bn=new Vu,Jo=new P,xn=new P,wn=new P,_n=new P,Ps=new P,Cn=new P,Zo=new P,An=new P;class Mv extends Xt{constructor(e=new Pa,t=new ju){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=n.length;s<a;s++){const o=n[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const i=this.geometry,n=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(n,e);const o=this.morphTargetInfluences;if(s&&o){Cn.set(0,0,0);for(let l=0,u=s.length;l<u;l++){const d=o[l],c=s[l];d!==0&&(Ps.fromBufferAttribute(c,e),a?Cn.addScaledVector(Ps,d):Cn.addScaledVector(Ps.sub(t),d))}t.add(Cn)}return t}raycast(e,t){const i=this.geometry,n=this.material,s=this.matrixWorld;n!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),bn.copy(i.boundingSphere),bn.applyMatrix4(s),wi.copy(e.ray).recast(e.near),!(bn.containsPoint(wi.origin)===!1&&(wi.intersectSphere(bn,Jo)===null||wi.origin.distanceToSquared(Jo)>(e.far-e.near)**2))&&(Yo.copy(s).invert(),wi.copy(e.ray).applyMatrix4(Yo),!(i.boundingBox!==null&&wi.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,wi)))}_computeIntersections(e,t,i){let n;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,c=s.attributes.normal,h=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,g=h.length;m<g;m++){const y=h[m],b=a[y.materialIndex],x=Math.max(y.start,p.start),w=Math.min(o.count,Math.min(y.start+y.count,p.start+p.count));for(let A=x,q=w;A<q;A+=3){const M=o.getX(A),B=o.getX(A+1),H=o.getX(A+2);n=Sn(this,b,e,i,u,d,c,M,B,H),n&&(n.faceIndex=Math.floor(A/3),n.face.materialIndex=y.materialIndex,t.push(n))}}else{const m=Math.max(0,p.start),g=Math.min(o.count,p.start+p.count);for(let y=m,b=g;y<b;y+=3){const x=o.getX(y),w=o.getX(y+1),A=o.getX(y+2);n=Sn(this,a,e,i,u,d,c,x,w,A),n&&(n.faceIndex=Math.floor(y/3),t.push(n))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,g=h.length;m<g;m++){const y=h[m],b=a[y.materialIndex],x=Math.max(y.start,p.start),w=Math.min(l.count,Math.min(y.start+y.count,p.start+p.count));for(let A=x,q=w;A<q;A+=3){const M=A,B=A+1,H=A+2;n=Sn(this,b,e,i,u,d,c,M,B,H),n&&(n.faceIndex=Math.floor(A/3),n.face.materialIndex=y.materialIndex,t.push(n))}}else{const m=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);for(let y=m,b=g;y<b;y+=3){const x=y,w=y+1,A=y+2;n=Sn(this,a,e,i,u,d,c,x,w,A),n&&(n.faceIndex=Math.floor(y/3),t.push(n))}}}}function Bv(r,e,t,i,n,s,a,o){let l;if(e.side===Xy?l=i.intersectTriangle(a,s,n,!0,o):l=i.intersectTriangle(n,s,a,e.side===ia,o),l===null)return null;An.copy(o),An.applyMatrix4(r.matrixWorld);const u=t.ray.origin.distanceTo(An);return u<t.near||u>t.far?null:{distance:u,point:An.clone(),object:r}}function Sn(r,e,t,i,n,s,a,o,l,u){r.getVertexPosition(o,xn),r.getVertexPosition(l,wn),r.getVertexPosition(u,_n);const d=Bv(r,e,t,i,xn,wn,_n,Zo);if(d){const c=new P;Bt.getBarycoord(Zo,xn,wn,_n,c),n&&(d.uv=Bt.getInterpolatedAttribute(n,o,l,u,c,new kt)),s&&(d.uv1=Bt.getInterpolatedAttribute(s,o,l,u,c,new kt)),a&&(d.normal=Bt.getInterpolatedAttribute(a,o,l,u,c,new P),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a:o,b:l,c:u,normal:new P,materialIndex:0};Bt.getNormal(xn,wn,_n,h.normal),d.face=h,d.barycoord=c}return d}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Lu}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Lu);class qv extends Mv{type="HighlightMesh";createTime;constructor(...e){super(...e),this.createTime=Date.now()}onBeforeRender(){const t=(Date.now()-this.createTime)/1e3,s=1+.07*Math.sin(2.5*t);this.scale.set(s,s,s)}}const Wu={scene:"i-carbon-web-services-container",perspectivecamera:"i-carbon-video",mesh:"i-carbon-cube",group:"i-carbon-group-objects",ambientlight:"i-carbon-light",directionallight:"i-carbon-light",spotlight:"i-iconoir-project-curve-3d",position:"i-iconoir-axes",rotation:"i-carbon-rotate-clockwise",scale:"i-iconoir-ellipse-3d-three-points",bone:"i-ph-bone",skinnedmesh:"carbon:3d-print-mesh"};function Qo(r){return{name:r.name,value:r,key:r.uuid,label:r.type,type:r.type,icon:Wu[r.type.toLowerCase()]||"i-carbon-cube",defaultExpanded:r.isScene,memorySize:Math.round(Gy(r)/1024),children:[]}}function kv(r){function e(i,n){i.children.forEach(s=>{if(s.type==="HighlightMesh")return;const a=Qo(s);n.children.push(a),e(s,a)})}const t=Qo(r);return e(r,t),t}function Ki(r,e="root",t="root",i=new WeakSet){const n=typeof r;if(r===null||n!=="object")return{label:e,type:n,path:t,value:r,defaultExpanded:t==="root"};if(i.has(r))return{label:e,type:"circular",path:t,value:"[Circular]",defaultExpanded:t==="root"};if(i.add(r),Array.isArray(r))return{label:e,type:"array",path:t,value:`Array[${r.length}]`,defaultExpanded:t==="root",children:r.map((o,l)=>Ki(o,String(l),`${t}[${l}]`,i))};const s=[],a=r.constructor?.name||"Object";if(a==="_Euler"){const o=r,l=["x","y","z","order"];for(const u of l){const d=o[u],c=t==="root"?u:`${t}.${u}`;s.push(Ki(d,u,c,i))}}else if(a==="Quaternion"){const o=r,l=["x","y","z","w"];for(const u of l){const d=o[u],c=t==="root"?u:`${t}.${u}`;s.push(Ki(d,u,c,i))}}else if(a==="_Vector3"){const o=r,l=["x","y","z"];for(const u of l){const d=o[u],c=t==="root"?u:`${t}.${u}`;s.push(Ki(d,u,c,i))}}else for(const o of Object.keys(r)){if(o.startsWith("_")||o.startsWith("$")||o==="__v_isRef"||o==="__v_isReactive"||o==="__v_isShallow"||o==="__v_raw"||o==="__v_isReadonly")continue;const l=r[o];if(typeof l=="function")continue;const u=t==="root"?o:`${t}.${o}`;s.push(Ki(l,o,u,i))}return{label:e,type:"object",path:t,value:a==="Euler"?"Euler":a==="Quaternion"?"Quaternion":a==="Vector3"?"Vector3":a,defaultExpanded:t==="root",children:s}}function Ev(r){const e=new ju({color:11003607,transparent:!0,opacity:.2,depthTest:!1,side:Yy});return new qv(r.geometry.clone(),e)}const Fv={key:1,class:"w-3 h-3 rounded-full border border-gray-300 dark:border-gray-600",style:{background:"linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57)"}},Ov={key:2,class:"w-3 h-3 rounded-full border border-gray-300 dark:border-gray-600 bg-gray-200 dark:bg-gray-700"},zv=O({__name:"MaterialBadge",props:{material:{},displayValue:{}},setup(r){function e(s){return s!==null&&typeof s=="object"&&s.constructor?.name?.includes("Material")}function t(s){if(!s||typeof s!="object")return null;if("color"in s&&s.color&&typeof s.color=="object"){const a=s.color;if("getHexString"in a&&typeof a.getHexString=="function")return`#${a.getHexString()}`}return null}function i(s){return s!==null&&typeof s=="object"&&(s.constructor?.name==="MeshNormalMaterial"||s.constructor?.name==="MeshStandardMaterial"||s.constructor?.name==="MeshBasicMaterial")}function n(s){return typeof s=="boolean"?"text-blue-500":typeof s=="number"?"text-primary-500":typeof s=="string"?"text-red-500":typeof s>"u"?"text-gray-400":"text-gray-600"}return(s,a)=>{const o=hi;return e(r.material)?(v(),C(o,{key:0,variant:"soft",color:"neutral",size:"sm",class:"flex items-center gap-1 ml-1"},{default:_(()=>[t(r.material)?(v(),N("div",{key:0,class:"w-3 h-3 rounded-full border border-gray-300 dark:border-gray-600",style:qt({backgroundColor:t(r.material)})},null,4)):i(r.material)?(v(),N("div",Fv)):(v(),N("div",Ov)),T("span",{class:I(n(r.material))},Z(r.displayValue),3)]),_:1})):D("",!0)}}}),Iv=Object.assign(zv,{__name:"InspectorMaterialBadge"}),Tv=O({__name:"GeometryBadge",props:{geometry:{},displayValue:{}},setup(r){const e={box:"i-carbon-cube",sphere:"i-tabler-circle",plane:"i-tabler-square",cylinder:"i-tabler-cylinder",cone:"i-tabler-cone",torus:"i-tabler-circle-dashed",circle:"i-tabler-circle-filled",ring:"i-tabler-circle",dodecahedron:"i-carbon-polygon",icosahedron:"i-carbon-polygon",octahedron:"i-carbon-polygon",tetrahedron:"i-carbon-polygon",tube:"i-tabler-pipe",extrude:"i-tabler-box",lathe:"i-tabler-rotate-3d"};function t(s){return s!==null&&typeof s=="object"&&s.constructor?.name?.includes("Geometry")}function i(s){if(!s||typeof s!="object")return"i-carbon-cube";const o=(s.constructor?.name?.toLowerCase()||"").replace(/geometry$/,"").replace(/^_+/,"");return e[o]||"i-carbon-cube"}function n(s){return typeof s=="boolean"?"text-blue-500":typeof s=="number"?"text-primary-500":typeof s=="string"?"text-red-500":typeof s>"u"?"text-gray-400":"text-gray-600"}return(s,a)=>{const o=Me,l=hi;return t(r.geometry)?(v(),C(l,{key:0,variant:"soft",color:"neutral",size:"sm",class:"flex items-center gap-1 ml-1"},{default:_(()=>[F(o,{name:i(r.geometry),class:"w-3 h-3 text-gray-600"},null,8,["name"]),T("span",{class:I(n(r.geometry))},Z(r.displayValue),3)]),_:1})):D("",!0)}}}),Pv=Object.assign(Tv,{__name:"InspectorGeometryBadge"}),Rv={class:"text-sm text-gray-500 pt-2 pb-8"},Dv={class:"flex items-center gap-1 py-0.5 mb-4 hover:bg-gray-50 group"},$v={class:"text-gray-600 font-semibold"},Lv={class:"pl-5 flex flex-col gap-1"},Hv={class:"flex items-center gap-1 min-w-0"},Nv={key:0,class:"flex items-center gap-1 ml-1"},Vv=O({__name:"Props",props:{object:{}},emits:["update-value"],setup(r,{emit:e}){const t=e,i=r,n=k(()=>Wu[i.object.type.toLowerCase()]||"i-carbon-cube"),s={PerspectiveCamera:["fov","position","rotation","far","near","aspect"],OrthographicCamera:["position","rotation","left","right","top","bottom","near","far"],DirectionalLight:["color","intensity","position"],PointLight:["color","intensity","position","distance","decay"],SpotLight:["color","intensity","position","target","angle","penumbra"],AmbientLight:["color","intensity"],Mesh:["position","rotation","scale","material","geometry","visible"],SkinnedMesh:["position","rotation","scale","material","geometry","skeleton"],Group:["position","rotation","scale","visible"],Object3D:["position","rotation","scale","visible"],Scene:["background","environment","fog"]};function a(m,g){return g&&typeof g=="object"&&"r"in g&&"g"in g&&"b"in g&&"getHexString"in g?`#${g.getHexString()}`:g}const o=k(()=>{const m=i.object.type;return(s[m]||["position","rotation","scale"]).map(y=>{const b=l(i.object,y);return{key:y,value:a(y,b),displayValue:u(y,b)}}).filter(y=>y.value!==void 0)});function l(m,g){return g.split(".").reduce((y,b)=>y&&typeof y=="object"&&b in y?y[b]:void 0,m)}function u(m,g){return g==null?"undefined":d(g)?"vector":c(g)?g.constructor?.name||"Material":h(g)?(g.constructor?.name||"Geometry").replace(/Geometry$/,"").replace(/^_+/,""):g&&typeof g=="object"&&"r"in g&&"g"in g&&"b"in g&&"getHexString"in g?`#${g.getHexString()}`:typeof g=="number"?Number.isInteger(g)?g.toString():g.toFixed(2):typeof g=="boolean"?g?"true":"false":typeof g=="object"?g.constructor?.name||"Object":String(g)}function d(m){return m!==null&&typeof m=="object"&&"x"in m&&"y"in m&&"z"in m&&typeof m.x=="number"&&typeof m.y=="number"&&typeof m.z=="number"}function c(m){return m!==null&&typeof m=="object"&&m.constructor?.name?.includes("Material")}function h(m){return m!==null&&typeof m=="object"&&m.constructor?.name?.includes("Geometry")}function p(m){return typeof m=="boolean"?"text-blue-500":typeof m=="number"?"text-green-500":typeof m=="string"?"text-red-500":typeof m>"u"?"text-gray-400":"text-gray-600"}return(m,g)=>{const y=Me,b=hi,x=dy,w=lt,A=Ny,q=Iu;return v(),N("div",Rv,[T("div",Dv,[F(y,{name:n.value,class:"w-4 h-4 text-gray-600 flex-shrink-0"},null,8,["name"]),T("span",$v,Z(r.object.type),1),r.object.name?(v(),C(b,{key:0,variant:"soft",size:"xs",class:"ml-2"},{default:_(()=>[ce(Z(r.object.name),1)]),_:1})):D("",!0)]),T("div",Lv,[(v(!0),N(xe,null,Xe(o.value,M=>(v(),N("div",{key:M.key,class:"flex items-center justify-between py-0.5 hover:bg-gray-50 group"},[T("div",Hv,[T("span",null,Z(M.key)+" :",1),d(M.value)?(v(),N("div",Nv,[F(x,{modelValue:M.value.x,"onUpdate:modelValue":[B=>M.value.x=B,B=>t("update-value",M.key+".x",B)]},null,8,["modelValue","onUpdate:modelValue"]),F(x,{modelValue:M.value.y,"onUpdate:modelValue":[B=>M.value.y=B,B=>t("update-value",M.key+".y",B)]},null,8,["modelValue","onUpdate:modelValue"]),F(x,{modelValue:M.value.z,"onUpdate:modelValue":[B=>M.value.z=B,B=>t("update-value",M.key+".z",B)]},null,8,["modelValue","onUpdate:modelValue"])])):c(M.value)?(v(),C(Iv,{key:1,material:M.value,"display-value":M.displayValue},null,8,["material","display-value"])):h(M.value)?(v(),C(Pv,{key:2,geometry:M.value,"display-value":M.displayValue},null,8,["geometry","display-value"])):M.key==="visible"?(v(),C(w,{key:3,size:"xs",class:"ml-1 mr-1",variant:"soft",icon:M.value?"i-lucide-eye":"i-lucide-eye-closed",onClick:()=>t("update-value",M.key,!M.value)},null,8,["icon","onClick"])):M.key==="color"?(v(),C(A,{key:4,modelValue:M.value,"onUpdate:modelValue":[B=>M.value=B,B=>t("update-value",M.key,B)]},null,8,["modelValue","onUpdate:modelValue"])):typeof M.value=="number"?(v(),C(x,{key:5,modelValue:M.value,"onUpdate:modelValue":[B=>M.value=B,B=>t("update-value",M.key,B)],class:"ml-1"},null,8,["modelValue","onUpdate:modelValue"])):(v(),N("span",{key:6,class:I([p(M.value),"ml-1"])},Z(M.displayValue),3))]),T("div",{class:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",onClick:g[0]||(g[0]=fe(()=>{},["stop"]))},[F(q,{size:"xs",items:[{label:"Copy Value",icon:"i-lucide:copy",onSelect:()=>f(Pu)(M.value)},M.displayValue==="vector"&&{label:"Copy as prop",icon:"i-material-symbols:data-array",onSelect:()=>f(Tu)({path:M.key,value:Object.values(M.value)})},M.displayValue==="vector"&&M.key==="rotation"&&{label:"Copy as Euler",icon:"i-lucide:rotate-3d",onSelect:()=>f(Du)({children:[{label:"x",value:M.value.x},{label:"y",value:M.value.y},{label:"z",value:M.value.z},{label:"order",value:M.value.order||"XYZ"}]})},M.displayValue==="vector"&&M.key!=="rotation"&&{label:"Copy as Vector3",icon:"i-lucide:pen-line",onSelect:()=>f(Ru)({children:Object.values(M.value).map(B=>({value:B}))})},M.displayValue==="vector"&&M.key==="quaternion"&&{label:"Copy as Quaternion",icon:"i-lucide:rotate-3d",onSelect:()=>f($u)({children:[{label:"x",value:M.value.x},{label:"y",value:M.value.y},{label:"z",value:M.value.z},{label:"w",value:M.value.w||1}]})}].filter(Boolean),ui:{content:"w-48"}},{default:_(()=>[F(w,{size:"xs",variant:"ghost",color:"gray",icon:"i-lucide-ellipsis-vertical",title:"Copy value"})]),_:1},8,["items"])])]))),128))])])}}}),Uv=Object.assign(Vv,{__name:"InspectorProps"}),jv={slots:{root:"flex items-center align-center text-center",border:"",container:"font-medium text-default flex",icon:"shrink-0 size-5",avatar:"shrink-0",avatarSize:"2xs",label:"text-sm"},variants:{color:{primary:{border:"border-primary"},secondary:{border:"border-secondary"},success:{border:"border-success"},info:{border:"border-info"},warning:{border:"border-warning"},error:{border:"border-error"},neutral:{border:"border-default"}},orientation:{horizontal:{root:"w-full flex-row",border:"w-full",container:"mx-3 whitespace-nowrap"},vertical:{root:"h-full flex-col",border:"h-full",container:"my-2"}},size:{xs:"",sm:"",md:"",lg:"",xl:""},type:{solid:{border:"border-solid"},dashed:{border:"border-dashed"},dotted:{border:"border-dotted"}}},compoundVariants:[{orientation:"horizontal",size:"xs",class:{border:"border-t"}},{orientation:"horizontal",size:"sm",class:{border:"border-t-[2px]"}},{orientation:"horizontal",size:"md",class:{border:"border-t-[3px]"}},{orientation:"horizontal",size:"lg",class:{border:"border-t-[4px]"}},{orientation:"horizontal",size:"xl",class:{border:"border-t-[5px]"}},{orientation:"vertical",size:"xs",class:{border:"border-s"}},{orientation:"vertical",size:"sm",class:{border:"border-s-[2px]"}},{orientation:"vertical",size:"md",class:{border:"border-s-[3px]"}},{orientation:"vertical",size:"lg",class:{border:"border-s-[4px]"}},{orientation:"vertical",size:"xl",class:{border:"border-s-[5px]"}}],defaultVariants:{color:"neutral",size:"xs",type:"solid"}},Wv={__name:"USeparator",props:{as:{type:null,required:!1},label:{type:String,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},color:{type:null,required:!1},size:{type:null,required:!1},type:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},class:{type:null,required:!1},ui:{type:null,required:!1},decorative:{type:Boolean,required:!1}},setup(r){const e=r,t=We(),i=Te(),n=Zt(Ft(e,"as","decorative","orientation")),s=k(()=>ue({extend:ue(jv),...i.ui?.separator||{}})({color:e.color,orientation:e.orientation,size:e.size,type:e.type}));return(a,o)=>(v(),C(f(Im),L(f(n),{"data-slot":"root",class:s.value.root({class:[e.ui?.root,e.class]})}),{default:_(()=>[T("div",{"data-slot":"border",class:I(s.value.border({class:e.ui?.border}))},null,2),r.label||r.icon||r.avatar||t.default?(v(),N(xe,{key:0},[T("div",{"data-slot":"container",class:I(s.value.container({class:e.ui?.container}))},[S(a.$slots,"default",{ui:s.value},()=>[r.label?(v(),N("span",{key:0,"data-slot":"label",class:I(s.value.label({class:e.ui?.label}))},Z(r.label),3)):r.icon?(v(),C(Me,{key:1,name:r.icon,"data-slot":"icon",class:I(s.value.icon({class:e.ui?.icon}))},null,8,["name","class"])):r.avatar?(v(),C(ur,L({key:2,size:e.ui?.avatarSize||s.value.avatarSize()},r.avatar,{"data-slot":"avatar",class:s.value.avatar({class:e.ui?.avatar})}),null,16,["size","class"])):D("",!0)])],2),T("div",{"data-slot":"border",class:I(s.value.border({class:e.ui?.border}))},null,2)],64)):D("",!0)]),_:3},16,["class"]))}},Gv={slots:{root:"relative flex items-start",container:"flex items-center",base:"rounded-sm ring ring-inset ring-accented overflow-hidden focus-visible:outline-2 focus-visible:outline-offset-2",indicator:"flex items-center justify-center size-full text-inverted",icon:"shrink-0 size-full",wrapper:"w-full",label:"block font-medium text-default",description:"text-muted"},variants:{color:{primary:{base:"focus-visible:outline-primary",indicator:"bg-primary"},secondary:{base:"focus-visible:outline-secondary",indicator:"bg-secondary"},success:{base:"focus-visible:outline-success",indicator:"bg-success"},info:{base:"focus-visible:outline-info",indicator:"bg-info"},warning:{base:"focus-visible:outline-warning",indicator:"bg-warning"},error:{base:"focus-visible:outline-error",indicator:"bg-error"},neutral:{base:"focus-visible:outline-inverted",indicator:"bg-inverted"}},variant:{list:{root:""},card:{root:"border border-muted rounded-lg"}},indicator:{start:{root:"flex-row",wrapper:"ms-2"},end:{root:"flex-row-reverse",wrapper:"me-2"},hidden:{base:"sr-only",wrapper:"text-center"}},size:{xs:{base:"size-3",container:"h-4",wrapper:"text-xs"},sm:{base:"size-3.5",container:"h-4",wrapper:"text-xs"},md:{base:"size-4",container:"h-5",wrapper:"text-sm"},lg:{base:"size-4.5",container:"h-5",wrapper:"text-sm"},xl:{base:"size-5",container:"h-6",wrapper:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},disabled:{true:{root:"opacity-75",base:"cursor-not-allowed",label:"cursor-not-allowed",description:"cursor-not-allowed"}},checked:{true:""}},compoundVariants:[{size:"xs",variant:"card",class:{root:"p-2.5"}},{size:"sm",variant:"card",class:{root:"p-3"}},{size:"md",variant:"card",class:{root:"p-3.5"}},{size:"lg",variant:"card",class:{root:"p-4"}},{size:"xl",variant:"card",class:{root:"p-4.5"}},{color:"primary",variant:"card",class:{root:"has-data-[state=checked]:border-primary"}},{color:"secondary",variant:"card",class:{root:"has-data-[state=checked]:border-secondary"}},{color:"success",variant:"card",class:{root:"has-data-[state=checked]:border-success"}},{color:"info",variant:"card",class:{root:"has-data-[state=checked]:border-info"}},{color:"warning",variant:"card",class:{root:"has-data-[state=checked]:border-warning"}},{color:"error",variant:"card",class:{root:"has-data-[state=checked]:border-error"}},{color:"neutral",variant:"card",class:{root:"has-data-[state=checked]:border-inverted"}},{variant:"card",disabled:!0,class:{root:"cursor-not-allowed"}}],defaultVariants:{size:"md",color:"primary",variant:"list",indicator:"start"}},Kv=Object.assign({inheritAttrs:!1},{__name:"UCheckbox",props:qn({as:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},indicator:{type:null,required:!1},icon:{type:null,required:!1},indeterminateIcon:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},disabled:{type:Boolean,required:!1},required:{type:Boolean,required:!1},name:{type:String,required:!1},value:{type:null,required:!1},id:{type:String,required:!1},defaultValue:{type:[Boolean,String],required:!1}},{modelValue:{type:[Boolean,String],default:void 0},modelModifiers:{}}),emits:qn(["change"],["update:modelValue"]),setup(r,{emit:e}){const t=r,i=We(),n=e,s=ua(r,"modelValue",{type:[Boolean,String],default:void 0}),a=Te(),o=Zt(Ft(t,"required","value","defaultValue")),{id:l,emitFormChange:u,emitFormInput:d,size:c,color:h,name:p,disabled:m,ariaAttrs:g}=ca(t),y=l.value??nl(),b=k(()=>ue({extend:ue(Gv),...a.ui?.checkbox||{}})({size:c.value,color:h.value,variant:t.variant,indicator:t.indicator,required:t.required,disabled:m.value}));function x(w){const A=new Event("change",{target:{value:w}});n("change",A),u(),d()}return(w,A)=>(v(),C(f(re),{as:!r.variant||r.variant==="list"?r.as:f(lo),"data-slot":"root",class:I(b.value.root({class:[t.ui?.root,t.class]}))},{default:_(()=>[T("div",{"data-slot":"container",class:I(b.value.container({class:t.ui?.container}))},[F(f(Kc),L({id:f(y)},{...f(o),...w.$attrs,...f(g)},{modelValue:s.value,"onUpdate:modelValue":[A[0]||(A[0]=q=>s.value=q),x],name:f(p),disabled:f(m),"data-slot":"base",class:b.value.base({class:t.ui?.base})}),{default:_(({modelValue:q})=>[F(f(Yc),{"data-slot":"indicator",class:I(b.value.indicator({class:t.ui?.indicator}))},{default:_(()=>[q==="indeterminate"?(v(),C(Me,{key:0,name:r.indeterminateIcon||f(a).ui.icons.minus,"data-slot":"icon",class:I(b.value.icon({class:t.ui?.icon}))},null,8,["name","class"])):(v(),C(Me,{key:1,name:r.icon||f(a).ui.icons.check,"data-slot":"icon",class:I(b.value.icon({class:t.ui?.icon}))},null,8,["name","class"]))]),_:2},1032,["class"])]),_:1},16,["id","modelValue","name","disabled","class"])],2),r.label||i.label||r.description||i.description?(v(),N("div",{key:0,"data-slot":"wrapper",class:I(b.value.wrapper({class:t.ui?.wrapper}))},[r.label||i.label?(v(),C(or(!r.variant||r.variant==="list"?f(lo):"p"),{key:0,for:f(y),"data-slot":"label",class:I(b.value.label({class:t.ui?.label}))},{default:_(()=>[S(w.$slots,"label",{label:r.label},()=>[ce(Z(r.label),1)])]),_:3},8,["for","class"])):D("",!0),r.description||i.description?(v(),N("p",{key:1,"data-slot":"description",class:I(b.value.description({class:t.ui?.description}))},[S(w.$slots,"description",{description:r.description},()=>[ce(Z(r.description),1)])],2)):D("",!0)],2)):D("",!0)]),_:3},8,["as","class"]))}}),Xv={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-xs gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-xs gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-sm gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-sm gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},Yv=["id","type","value","name","placeholder","disabled","required","autocomplete"],Jv=Object.assign({inheritAttrs:!1},{__name:"UInput",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},type:{type:null,required:!1,default:"text"},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autocomplete:{type:null,required:!1,default:"off"},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},modelModifiers:{type:Object,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(r,{expose:e,emit:t}){const i=r,n=t,s=We(),a=du(i,"modelValue",n,{defaultValue:i.defaultValue}),o=Te(),{emitFormBlur:l,emitFormInput:u,emitFormChange:d,size:c,color:h,id:p,name:m,highlight:g,disabled:y,emitFormFocus:b,ariaAttrs:x}=ca(i,{deferInputValidation:!0}),{orientation:w,size:A}=da(i),{isLeading:q,isTrailing:M,leadingIconName:B,trailingIconName:H}=pl(i),E=k(()=>A.value||c.value),R=k(()=>ue({extend:ue(Xv),...o.ui?.input||{}})({type:i.type,color:h.value,variant:i.variant,size:E?.value,loading:i.loading,highlight:g.value,leading:q.value||!!i.avatar||!!s.leading,trailing:M.value||!!s.trailing,fieldGroup:w.value})),U=ml("inputRef");function W(ee){i.modelModifiers?.trim&&(ee=ee?.trim()??null),(i.modelModifiers?.number||i.type==="number")&&(ee=Pd(ee)),i.modelModifiers?.nullable&&(ee||=null),i.modelModifiers?.optional&&(ee||=void 0),a.value=ee,u()}function te(ee){i.modelModifiers?.lazy||W(ee.target.value)}function Q(ee){const Y=ee.target.value;i.modelModifiers?.lazy&&W(Y),i.modelModifiers?.trim&&(ee.target.value=Y.trim()),d(),n("change",ee)}function oe(ee){l(),n("blur",ee)}function J(){i.autofocus&&U.value?.focus()}return He(()=>{setTimeout(()=>{J()},i.autofocusDelay)}),e({inputRef:U}),(ee,Y)=>(v(),C(f(re),{as:r.as,"data-slot":"root",class:I(R.value.root({class:[i.ui?.root,i.class]}))},{default:_(()=>[T("input",L({id:f(p),ref_key:"inputRef",ref:U,type:r.type,value:f(a),name:f(m),placeholder:r.placeholder,"data-slot":"base",class:R.value.base({class:i.ui?.base}),disabled:f(y),required:r.required,autocomplete:r.autocomplete},{...ee.$attrs,...f(x)},{onInput:te,onBlur:oe,onChange:Q,onFocus:Y[0]||(Y[0]=(...he)=>f(b)&&f(b)(...he))}),null,16,Yv),S(ee.$slots,"default",{ui:R.value}),f(q)||r.avatar||s.leading?(v(),N("span",{key:0,"data-slot":"leading",class:I(R.value.leading({class:i.ui?.leading}))},[S(ee.$slots,"leading",{ui:R.value},()=>[f(q)&&f(B)?(v(),C(Me,{key:0,name:f(B),"data-slot":"leadingIcon",class:I(R.value.leadingIcon({class:i.ui?.leadingIcon}))},null,8,["name","class"])):r.avatar?(v(),C(ur,L({key:1,size:i.ui?.leadingAvatarSize||R.value.leadingAvatarSize()},r.avatar,{"data-slot":"leadingAvatar",class:R.value.leadingAvatar({class:i.ui?.leadingAvatar})}),null,16,["size","class"])):D("",!0)])],2)):D("",!0),f(M)||s.trailing?(v(),N("span",{key:1,"data-slot":"trailing",class:I(R.value.trailing({class:i.ui?.trailing}))},[S(ee.$slots,"trailing",{ui:R.value},()=>[f(H)?(v(),C(Me,{key:0,name:f(H),"data-slot":"trailingIcon",class:I(R.value.trailingIcon({class:i.ui?.trailingIcon}))},null,8,["name","class"])):D("",!0)])],2)):D("",!0)]),_:3},8,["as","class"]))}}),Zv={class:"font-mono text-xs text-gray-500"},Qv={key:1,class:"mr-1 w-4 h-4"},eb={class:"flex items-center gap-1 flex-1 min-w-0"},tb={class:"text-gray-600 font-semibold"},ib=O({__name:"Tree",props:{node:{},level:{default:0},selectedObject:{}},emits:["update-value"],setup(r,{emit:e}){const t=r,i=e,n=z(t.node.defaultExpanded??!1),s=z(null),a=()=>{n.value=!n.value},o=w=>typeof w=="boolean"?"text-blue-500":typeof w=="number"?"text-green-500":typeof w=="string"?"text-red-500":typeof w>"u"?"text-gray-400":"text-gray-600",l=w=>typeof w=="boolean"?w?"true":"false":typeof w=="number"?w.toString():typeof w=="string"?`"${w}"`:w===null?"null":typeof w>"u"?"undefined":"object",u=()=>{if(typeof t.node.value=="number"){const w=t.node.value+1;i("update-value",t.node.path,w)}},d=()=>{if(typeof t.node.value=="number"){const w=t.node.value-1;i("update-value",t.node.path,w)}},c=w=>{i("update-value",t.node.path,w)},h=()=>{const w=typeof t.node.value=="string"?t.node.value:JSON.stringify(t.node.value);s.value={path:t.node.path,value:w}},p=()=>{if(s.value)try{const{value:w}=s.value;let A=w;Number.isNaN(Number(w))?(w.toLowerCase()==="true"||w.toLowerCase()==="false")&&(A=w.toLowerCase()==="true"):A=Number(w),i("update-value",t.node.path,A)}catch(w){console.error("Failed to apply edit:",w)}finally{s.value=null}},m=()=>{s.value=null},g=w=>{w.key==="Enter"?p():w.key==="Escape"&&m()},y=k(()=>t.node.children&&t.node.children.length>0),b=k(()=>!y.value),x=k(()=>({paddingLeft:`${t.level*16}px`}));return(w,A)=>{const q=Me,M=lt,B=Iu,H=Kv,E=Jv,R=bu,U=Gu;return v(),N("div",Zv,[T("div",{style:qt(x.value),class:I(["flex items-center py-0.5 hover:bg-gray-50 group",{"cursor-pointer":y.value}])},[y.value?(v(),N("div",{key:0,class:"mr-1 w-4 h-4 flex items-center justify-center",onClick:a},[F(q,{name:n.value?"i-tabler:caret-down-filled":"i-tabler:caret-right-filled",class:"w-3 h-3 text-gray-400"},null,8,["name"])])):(v(),N("div",Qv)),T("div",eb,[r.node.type==="object"||r.node.type==="array"?(v(),N(xe,{key:0},[T("span",{class:"cursor-pointer select-none",onClick:A[0]||(A[0]=W=>y.value?a():void 0)},[ce(Z(r.node.label)+" : ",1),T("span",tb,Z(r.node.value),1)]),r.node.type!=="array"?(v(),C(B,{key:0,size:"xs",items:[{label:"Copy Path",icon:"i-lucide:link",onSelect:()=>f(Co)(r.node.path)},{label:"Copy value as Array",icon:"i-material-symbols:data-array",onSelect:()=>f(jy)(r.node)},r.node.value==="_Vector3"?{label:"Copy value as Vector3",icon:"i-lucide:pen-line",onSelect:()=>f(Ru)(r.node)}:null,r.node.value==="_Euler"?{label:"Copy as Euler",icon:"i-lucide:rotate-3d",onSelect:()=>f(Du)(r.node)}:null,r.node.value==="_Quaternion"?{label:"Copy as Quaternion",icon:"i-lucide:rotate-3d",onSelect:()=>f($u)(r.node)}:null,{label:"Copy value as JSON",icon:"i-material-symbols:data-object",onSelect:()=>f(Wy)(r.node)},r.node.value==="_Vector3"||r.node.value==="_Euler"||r.node.value==="_Quaternion"?{label:"Copy as Prop",icon:"i-lucide:code",onSelect:()=>f(Uy)(r.node)}:null].filter(Boolean),ui:{content:"w-48"}},{default:_(()=>[F(M,{size:"xs",variant:"ghost",color:"gray",icon:"i-lucide-ellipsis-vertical",title:"Copy value"})]),_:1},8,["items"])):D("",!0)],64)):(v(),N(xe,{key:1},[T("span",null,Z(r.node.label)+" :",1),typeof r.node.value=="boolean"?(v(),C(H,{key:0,"model-value":r.node.value,size:"xs","onUpdate:modelValue":c,onClick:A[1]||(A[1]=fe(()=>{},["stop"]))},null,8,["model-value"])):s.value?.path===r.node.path&&typeof r.node.value!="number"&&typeof r.node.value!="boolean"?(v(),C(E,{key:1,modelValue:s.value.value,"onUpdate:modelValue":A[2]||(A[2]=W=>s.value.value=W),size:"xs",class:"w-20",variant:"soft",onKeydown:fe(g,["stop"]),onBlur:p,onFocus:A[3]||(A[3]=W=>W.target?.select()),onClick:A[4]||(A[4]=fe(()=>{},["stop"]))},null,8,["modelValue"])):s.value?.path===r.node.path&&typeof r.node.value=="number"?(v(),C(R,{key:2,modelValue:s.value.value,"onUpdate:modelValue":A[5]||(A[5]=W=>s.value.value=W),size:"xs",variant:"subtle",orientation:"vertical","format-options":{minimumFractionDigits:0,maximumFractionDigits:2},class:"w-20",onKeydown:fe(g,["stop"]),onBlur:p,onFocus:A[6]||(A[6]=W=>W.target?.select()),onClick:A[7]||(A[7]=fe(()=>{},["stop"]))},null,8,["modelValue"])):typeof r.node.value!="boolean"?(v(),N("span",{key:3,class:I([o(r.node.value),"cursor-pointer hover:bg-gray-100 px-1 py-0.5 rounded"]),onClick:fe(h,["stop"])},Z(l(r.node.value)),3)):D("",!0)],64)),b.value?(v(),N("div",{key:2,class:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",onClick:A[8]||(A[8]=fe(()=>{},["stop"]))},[typeof r.node.value=="number"?(v(),N(xe,{key:0},[F(M,{size:"xs",variant:"ghost",color:"gray",icon:"i-tabler:minus",title:"Decrease value",onClick:fe(d,["stop"])}),F(M,{size:"xs",variant:"ghost",color:"gray",icon:"i-tabler:plus",title:"Increase value",onClick:fe(u,["stop"])})],64)):D("",!0),F(B,{size:"xs",items:[{label:"Copy Value",icon:"i-lucide:copy",onSelect:()=>f(Pu)(r.node.value)},{label:"Copy Path",icon:"i-lucide:link",onSelect:()=>f(Co)(r.node.path)},{label:"Copy as prop",icon:"i-lucide:pen-line",onSelect:()=>f(Tu)(r.node)}],ui:{content:"w-48"}},{default:_(()=>[F(M,{size:"xs",variant:"ghost",color:"gray",icon:"i-lucide-ellipsis-vertical",title:"Copy value"})]),_:1},8,["items"])])):D("",!0)])],6),y.value&&n.value?(v(!0),N(xe,{key:0},Xe(r.node.children,W=>(v(),C(U,{key:`${W.path}-${W.label}`,node:W,level:r.level+1,"selected-object":r.selectedObject,onUpdateValue:A[9]||(A[9]=(te,Q)=>i("update-value",te,Q))},null,8,["node","level","selected-object"]))),128)):D("",!0)])}}}),Gu=Object.assign(ib,{__name:"InspectorTree"});function rb(r){let e=0;return r.traverse(t=>{t.isObject3D&&e++}),e}function nb(){const r={scene:ns({objects:0,graph:null,value:void 0,selected:void 0,assets:[]}),fps:ns({value:0,accumulator:[],lastLoggedTime:Date.now(),logInterval:1e3}),memory:ns({currentMem:0,averageMem:0,maxMemory:0,allocatedMem:0,accumulator:[],lastLoggedTime:Date.now(),logInterval:1e3}),renderer:na({info:{render:{frame:0,calls:0,triangles:0,points:0,lines:0},memory:{geometries:0,textures:0},programs:[]}})};let e=null;return typeof window<"u"&&window.parent.parent.__TRES__DEVTOOLS__&&window.parent.parent.__TRES__DEVTOOLS__.subscribe(t=>{if(t.type==="context"){const i=t.data;if(i.scene.value.children.length>0){const n=i.scene.value.uuid;n!==e&&(r.scene.value=i.scene.value,r.scene.objects=rb(i.scene.value),r.scene.graph=kv(i.scene.value),e=n)}else r.scene.value=void 0,r.scene.graph=null,e=null;i.renderer?.instance?.info&&(Object.assign(r.renderer.info.render,i.renderer.instance.info.render),Object.assign(r.renderer.info.memory,i.renderer.instance.info.memory),r.renderer.info.programs=[...i.renderer.instance.info.programs||[]])}else if(t.type==="performance"){const i=t.data;Object.assign(r.fps,i.fps),r.fps.accumulator=[...i.fps.accumulator],Object.assign(r.memory,i.memory),r.memory.accumulator=[...i.memory.accumulator]}}),r}const Ra=cl(nb),sb={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},ab={key:0,class:"relative isolate"},ob=O({__name:"index",setup(r){const{scene:e}=Ra(),t=at(null),i=at(null),n=z(0);function s(d){t.value&&t.value.remove(i.value),d&&d.isMesh&&(i.value=Ev(d),d.add(Rt(i))),t.value=d,n.value++}const a=k(()=>(n.value,Ki(t.value))),o=(d,c)=>{t.value&&(l(t.value,d,c),d.includes("color")||n.value++)},l=(d,c,h)=>{if(!d||typeof d!="object")return;const p=c.split(".");let m=d;for(let x=0;x<p.length-1;x++){const w=p[x];if(m[w]&&typeof m[w]=="object")m=m[w];else return}const g=p[p.length-1],y=x=>typeof x=="string"&&/^#[0-9a-f]{6}$/i.test(x);m[g]=y(h)?new Wr(h):h;const b=d;b.isCamera&&u(c)&&b.updateProjectionMatrix()},u=d=>{const c=["fov","aspect","near","far","left","right","top","bottom"],h=d.split(".").pop();return c.includes(h||"")};return(d,c)=>{const h=yu,p=vu,m=Uv,g=Wv,y=Gu;return v(),N("div",sb,[T("div",null,[f(e).value&&f(e).graph?(v(),C(h,{key:f(e).graph.key,item:f(e).graph,onSelectObject:s},null,8,["item"])):(v(),C(p,{key:1,color:"neutral",variant:"subtle",title:"No scene available",description:"Please open a view with a scene to view its graph.",icon:"i-lucide-terminal"}))]),T("div",null,[t.value?(v(),N("div",ab,[(v(),C(m,{key:n.value,object:t.value,onUpdateValue:o},null,8,["object"])),F(g),F(y,{class:"pt-4",node:a.value,"selected-object":t.value,onUpdateValue:o},null,8,["node","selected-object"])])):D("",!0)])])}}}),lb=Object.assign(ob,{__name:"SceneGraph"}),ub=["points"],Rs=40,el=2,db=O({__name:"DevtoolsGraph",props:{points:{default:()=>[]},value:{default:0},unit:{default:""},label:{default:""},color:{default:"primary"}},setup(r){const e=r,t=z(140);gt(()=>{const n=Math.max(...e.points,30);t.value=Math.max(n,t.value)});const i=k(()=>e.points.map((n,s)=>`${s*el},${Rs-n*Rs/t.value}`).join(" "));return(n,s)=>(v(),N("div",{class:I(["graph relative p-1 rounded text-right text-xs outline-none border-none font-sans",`graph-${r.color}`])},[T("div",{class:I(["absolute bottom-0.5 right-1 font-mono text-xs",`text-${r.color}`])},Z(Math.round(r.value))+" "+Z(r.unit),3),(v(),N("svg",{width:"100%",height:Rs,xmlns:"http://www.w3.org/2000/svg"},[T("polyline",{points:f(i),fill:"none","stroke-width":el,"stroke-linecap":"round","stroke-linejoin":"round",class:I(r.color)},null,10,ub)]))],2))}}),cb=Object.assign(db,{__name:"DevtoolsGraph"}),hb={slots:{root:"rounded-lg overflow-hidden",header:"p-4 sm:px-6",body:"p-4 sm:p-6",footer:"p-4 sm:px-6"},variants:{variant:{solid:{root:"bg-inverted text-inverted"},outline:{root:"bg-default ring ring-default divide-y divide-default"},soft:{root:"bg-elevated/50 divide-y divide-default"},subtle:{root:"bg-elevated/50 ring ring-default divide-y divide-default"}}},defaultVariants:{variant:"outline"}},fb={__name:"UCard",props:{as:{type:null,required:!1},variant:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(r){const e=r,t=We(),i=Te(),n=k(()=>ue({extend:ue(hb),...i.ui?.card||{}})({variant:e.variant}));return(s,a)=>(v(),C(f(re),{as:r.as,"data-slot":"root",class:I(n.value.root({class:[e.ui?.root,e.class]}))},{default:_(()=>[t.header?(v(),N("div",{key:0,"data-slot":"header",class:I(n.value.header({class:e.ui?.header}))},[S(s.$slots,"header")],2)):D("",!0),t.default?(v(),N("div",{key:1,"data-slot":"body",class:I(n.value.body({class:e.ui?.body}))},[S(s.$slots,"default")],2)):D("",!0),t.footer?(v(),N("div",{key:2,"data-slot":"footer",class:I(n.value.footer({class:e.ui?.footer}))},[S(s.$slots,"footer")],2)):D("",!0)]),_:3},8,["as","class"]))}},pb={class:"text-sm dark:text-gray-400 text-gray-500 font-mono"},mb={key:0,class:"h-1 border-b dark:border-gray-400 border-gray-500 w-4"},gb={class:"flex gap-2 items-center -mb2.5"},yb={key:0},vb={class:"p4 dark:text-gray-400 text-gray-500 text-xs font-mono"},bb=O({__name:"ProgramsModuleItem",props:{item:{},depth:{default:0}},setup(r){const e=z(!1);return(t,i)=>{const n=hi;return v(),N("div",pb,[T("div",{class:"flex gap-2 items-end cursor-pointer pt2 mb2",onClick:i[0]||(i[0]=s=>e.value=!f(e))},[r.depth>0?(v(),N("span",mb)):D("",!0),T("div",gb,[T("i",{class:I(r.item.icon)},null,2),ce(" "+Z(r.item.type)+" ",1),r.item.name?(v(),C(n,{key:0,variant:"soft"},{default:_(()=>[ce(Z(r.item.name),1)]),_:1})):D("",!0)])]),f(e)?(v(),N("div",yb,[T("div",vb,[i[1]||(i[1]=T("p",{class:"text-xs font-bold dark:text-gray-300/80 text-gray-700/80 mb2 op-80"}," Uniforms ",-1)),(v(!0),N(xe,null,Xe(Object.entries(r.item.uniforms.map),([s,a])=>(v(),N("div",{key:s},[ce(Z(s)+" ",1),F(n,{color:"gray",variant:"soft"},{default:_(()=>[ce(Z(a?.cache[a?.cache.length-1]),1)]),_:2},1024)]))),128))])])):D("",!0)])}}}),xb=Object.assign(bb,{__name:"ProgramsModuleItem"}),wb=O({__name:"ProgramsModule",setup(r){const{renderer:e}=Ra(),t={shaderMaterial:"i-file-icons-vertexshader"},i=k(()=>e.info.programs.map(n=>({...n,icon:t[n.type]||"i-file-icons-vertexshader",uniforms:n.getUniforms(),attributes:n.getAttributes()})));return(n,s)=>{const a=xb;return v(!0),N(xe,null,Xe(f(i),o=>(v(),C(a,{key:o.id,item:o},null,8,["item"]))),128)}}}),_b=Object.assign(wb,{__name:"ProgramsModule"}),Cb={class:"space-y-6"},Ab={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Sb={class:"flex items-center justify-between"},Mb={class:"flex items-center gap-2"},Bb={class:"space-y-4"},qb={class:"flex items-center justify-between"},kb={class:"flex items-center gap-2"},Eb={class:"space-y-4"},Fb={class:"grid grid-cols-2 gap-4 text-sm"},Ob={class:"font-mono font-semibold"},zb={class:"font-mono font-semibold"},Ib={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Tb={class:"flex items-center gap-2"},Pb={class:"space-y-4"},Rb={class:"grid grid-cols-2 gap-4"},Db={class:"text-center p-4 bg-gray-50 dark:bg-gray-800 rounded-lg"},$b={class:"flex items-center justify-center gap-2 mb-2"},Lb={class:"font-mono text-sm font-bold"},Hb={class:"text-center p-4 bg-gray-50 dark:bg-gray-800 rounded-lg"},Nb={class:"flex items-center justify-center gap-2 mb-2"},Vb={class:"font-mono text-sm font-bold"},Ub={class:"flex items-center gap-2"},jb={class:"grid grid-cols-2 gap-3"},Wb={class:"text-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"},Gb={class:"flex items-center justify-center gap-2 mb-2"},Kb={class:"font-mono font-bold"},Xb={class:"text-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"},Yb={class:"flex items-center justify-center gap-2 mb-2"},Jb={class:"font-mono font-bold"},Zb={class:"text-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"},Qb={class:"flex items-center justify-center gap-2 mb-2"},e0={class:"font-mono font-bold"},t0={class:"text-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"},i0={class:"flex items-center justify-center gap-2 mb-2"},r0={class:"font-mono font-bold"},n0={class:"flex items-center gap-2"},s0=O({__name:"PerformanceMonitor",setup(r){const{fps:e,memory:t,renderer:i}=Ra(),n=k(()=>e.value>=50?{color:"primary",label:"Excellent"}:e.value>=30?{color:"warning",label:"Good"}:{color:"error",label:"Poor"}),s=k(()=>{const a=t.currentMem;return a<100?{color:"primary",label:"Low"}:a<500?{color:"warning",label:"Moderate"}:{color:"error",label:"High"}});return(a,o)=>{const l=Me,u=hi,d=cb,c=fb,h=vu,p=_b;return v(),N("div",Cb,[T("div",Ab,[F(c,null,{header:_(()=>[T("div",Sb,[T("div",Mb,[F(l,{name:"i-tabler:activity",class:"w-5 h-5"}),o[0]||(o[0]=T("h3",{class:"text-sm font-semibold"}," Frame Rate ",-1))]),F(u,{color:f(n).color,variant:"soft",size:"sm"},{default:_(()=>[ce(Z(f(n).label),1)]),_:1},8,["color"])])]),default:_(()=>[T("div",Bb,[F(d,{points:f(e).accumulator,value:f(e).value,color:"primary",unit:"FPS",label:"FPS"},null,8,["points","value"])])]),_:1}),F(c,null,{header:_(()=>[T("div",qb,[T("div",kb,[F(l,{name:"i-tabler:cpu",class:"w-5 h-5"}),o[1]||(o[1]=T("h3",{class:"text-sm font-semibold"}," Memory Usage ",-1))]),F(u,{color:f(s).color,variant:"soft",size:"sm"},{default:_(()=>[ce(Z(f(s).label),1)]),_:1},8,["color"])])]),default:_(()=>[T("div",Eb,[F(d,{points:f(t).accumulator,value:f(t).currentMem,color:"warning",unit:"MB",label:"Memory"},null,8,["points","value"]),T("div",Fb,[T("div",null,[o[2]||(o[2]=T("div",{class:"text-gray-600 dark:text-gray-400"}," Current ",-1)),T("div",Ob,Z(Math.round(f(t).currentMem))+" MB ",1)]),T("div",null,[o[3]||(o[3]=T("div",{class:"text-gray-600 dark:text-gray-400"}," Peak ",-1)),T("div",zb,Z(Math.round(f(t).maxMemory))+" MB ",1)])])])]),_:1})]),T("div",Ib,[F(c,null,{header:_(()=>[T("div",Tb,[F(l,{name:"i-tabler:database",class:"w-5 h-5"}),o[4]||(o[4]=T("h3",{class:"font-semibold"}," Memory Details ",-1))])]),default:_(()=>[T("div",Pb,[T("div",Rb,[T("div",Db,[T("div",$b,[F(l,{name:"i-tabler:box",class:"w-5 h-5"}),T("span",Lb,Z(f(i).info?.memory?.geometries||0),1)]),o[5]||(o[5]=T("div",{class:"text-xs text-gray-600 dark:text-gray-400"}," Geometries ",-1))]),T("div",Hb,[T("div",Nb,[F(l,{name:"i-tabler:photo",class:"w-5 h-5"}),T("span",Vb,Z(f(i).info?.memory?.textures||0),1)]),o[6]||(o[6]=T("div",{class:"text-xs text-gray-600 dark:text-gray-400"}," Textures ",-1))])]),F(h,{icon:"i-tabler:info-circle",color:"primary",variant:"soft",title:"Memory Allocation",description:`Approximately ${f(Ky)(f(t).allocatedMem)} KB allocated by 3D objects`},null,8,["description"])])]),_:1}),F(c,null,{header:_(()=>[T("div",Ub,[F(l,{name:"i-tabler:chart-bar",class:"w-5 h-5"}),o[7]||(o[7]=T("h3",{class:"font-semibold"}," Render Statistics ",-1))])]),default:_(()=>[T("div",jb,[T("div",Wb,[T("div",Gb,[F(l,{name:"i-tabler:refresh",class:"w-4 h-4 text-primary-500"}),T("span",Kb,Z(f(i)?.info?.render?.calls||0),1)]),o[8]||(o[8]=T("div",{class:"text-xs text-gray-600 dark:text-gray-400"}," Draw Calls ",-1))]),T("div",Xb,[T("div",Yb,[F(l,{name:"i-tabler:triangle",class:"w-4 h-4 text-orange-500"}),T("span",Jb,Z(f(i)?.info?.render?.triangles||0),1)]),o[9]||(o[9]=T("div",{class:"text-xs text-gray-600 dark:text-gray-400"}," Triangles ",-1))]),T("div",Zb,[T("div",Qb,[F(l,{name:"i-tabler:point",class:"w-4 h-4 text-blue-500"}),T("span",e0,Z(f(i)?.info?.render?.points||0),1)]),o[10]||(o[10]=T("div",{class:"text-xs text-gray-600 dark:text-gray-400"}," Points ",-1))]),T("div",t0,[T("div",i0,[F(l,{name:"i-tabler:line",class:"w-4 h-4 text-red-500"}),T("span",r0,Z(f(i)?.info?.render?.lines||0),1)]),o[11]||(o[11]=T("div",{class:"text-xs text-gray-600 dark:text-gray-400"}," Lines ",-1))])])]),_:1})]),F(c,null,{header:_(()=>[T("div",n0,[F(l,{name:"i-tabler:code",class:"w-5 h-5"}),o[12]||(o[12]=T("h3",{class:"font-semibold"}," Shader Programs ",-1))])]),default:_(()=>[F(p)]),_:1})])}}}),a0=Object.assign(s0,{__name:"PerformanceMonitor"}),o0={slots:{root:"flex items-center gap-2",list:"relative flex p-1 group",indicator:"absolute transition-[translate,width] duration-200",trigger:["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",label:"truncate",trailingBadge:"shrink-0",trailingBadgeSize:"sm",content:"focus:outline-none w-full"},variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{pill:{list:"bg-elevated rounded-lg",trigger:"grow",indicator:"rounded-md shadow-xs"},link:{list:"border-default",indicator:"rounded-full",trigger:"focus:outline-none"}},orientation:{horizontal:{root:"flex-col",list:"w-full",indicator:"left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",trigger:"justify-center"},vertical:{list:"flex-col",indicator:"top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"}},size:{xs:{trigger:"px-2 py-1 text-xs gap-1",leadingIcon:"size-4",leadingAvatarSize:"3xs"},sm:{trigger:"px-2.5 py-1.5 text-xs gap-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs"},md:{trigger:"px-3 py-1.5 text-sm gap-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs"},lg:{trigger:"px-3 py-2 text-sm gap-2",leadingIcon:"size-5",leadingAvatarSize:"2xs"},xl:{trigger:"px-3 py-2 text-base gap-2",leadingIcon:"size-6",leadingAvatarSize:"xs"}}},compoundVariants:[{orientation:"horizontal",variant:"pill",class:{indicator:"inset-y-1"}},{orientation:"horizontal",variant:"link",class:{list:"border-b -mb-px",indicator:"-bottom-px h-px"}},{orientation:"vertical",variant:"pill",class:{indicator:"inset-x-1",list:"items-center"}},{orientation:"vertical",variant:"link",class:{list:"border-s -ms-px",indicator:"-start-px w-px"}},{color:"primary",variant:"pill",class:{indicator:"bg-primary",trigger:"data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"}},{color:"secondary",variant:"pill",class:{indicator:"bg-secondary",trigger:"data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-secondary"}},{color:"success",variant:"pill",class:{indicator:"bg-success",trigger:"data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-success"}},{color:"info",variant:"pill",class:{indicator:"bg-info",trigger:"data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-info"}},{color:"warning",variant:"pill",class:{indicator:"bg-warning",trigger:"data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-warning"}},{color:"error",variant:"pill",class:{indicator:"bg-error",trigger:"data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-error"}},{color:"neutral",variant:"pill",class:{indicator:"bg-inverted",trigger:"data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-inverted"}},{color:"primary",variant:"link",class:{indicator:"bg-primary",trigger:"data-[state=active]:text-primary focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"}},{color:"secondary",variant:"link",class:{indicator:"bg-secondary",trigger:"data-[state=active]:text-secondary focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"}},{color:"success",variant:"link",class:{indicator:"bg-success",trigger:"data-[state=active]:text-success focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"}},{color:"info",variant:"link",class:{indicator:"bg-info",trigger:"data-[state=active]:text-info focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"}},{color:"warning",variant:"link",class:{indicator:"bg-warning",trigger:"data-[state=active]:text-warning focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"}},{color:"error",variant:"link",class:{indicator:"bg-error",trigger:"data-[state=active]:text-error focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"}},{color:"neutral",variant:"link",class:{indicator:"bg-inverted",trigger:"data-[state=active]:text-highlighted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"}}],defaultVariants:{color:"primary",variant:"pill",size:"md"}},l0={__name:"UTabs",props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},content:{type:Boolean,required:!1,default:!0},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:null,required:!1},defaultValue:{type:null,required:!1,default:"0"},modelValue:{type:null,required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(r,{expose:e,emit:t}){const i=r,n=t,s=We(),a=Te(),o=Ce(Ft(i,"as","unmountOnHide"),n),l=k(()=>ue({extend:ue(o0),...a.ui?.tabs||{}})({color:i.color,variant:i.variant,size:i.size,orientation:i.orientation})),u=z([]);return e({triggersRef:u}),(d,c)=>(v(),C(f(Rm),L(f(o),{"model-value":r.modelValue,"default-value":r.defaultValue,orientation:r.orientation,"activation-mode":r.activationMode,"data-slot":"root",class:l.value.root({class:[i.ui?.root,i.class]})}),{default:_(()=>[F(f(Vm),{"data-slot":"list",class:I(l.value.list({class:i.ui?.list}))},{default:_(()=>[F(f(Hm),{"data-slot":"indicator",class:I(l.value.indicator({class:i.ui?.indicator}))},null,8,["class"]),S(d.$slots,"list-leading"),(v(!0),N(xe,null,Xe(r.items,(h,p)=>(v(),C(f(jm),{key:p,ref_for:!0,ref:m=>u.value[p]=m,value:h.value??String(p),disabled:h.disabled,"data-slot":"trigger",class:I(l.value.trigger({class:[i.ui?.trigger,h.ui?.trigger]}))},{default:_(()=>[S(d.$slots,"leading",{item:h,index:p,ui:l.value},()=>[h.icon?(v(),C(Me,{key:0,name:h.icon,"data-slot":"leadingIcon",class:I(l.value.leadingIcon({class:[i.ui?.leadingIcon,h.ui?.leadingIcon]}))},null,8,["name","class"])):h.avatar?(v(),C(ur,L({key:1,size:h.ui?.leadingAvatarSize||i.ui?.leadingAvatarSize||l.value.leadingAvatarSize()},{ref_for:!0},h.avatar,{"data-slot":"leadingAvatar",class:l.value.leadingAvatar({class:[i.ui?.leadingAvatar,h.ui?.leadingAvatar]})}),null,16,["size","class"])):D("",!0)]),f(Tt)(h,i.labelKey)||s.default?(v(),N("span",{key:0,"data-slot":"label",class:I(l.value.label({class:[i.ui?.label,h.ui?.label]}))},[S(d.$slots,"default",{item:h,index:p},()=>[ce(Z(f(Tt)(h,i.labelKey)),1)])],2)):D("",!0),S(d.$slots,"trailing",{item:h,index:p,ui:l.value},()=>[h.badge||h.badge===0?(v(),C(hi,L({key:0,color:"neutral",variant:"outline",size:h.ui?.trailingBadgeSize||i.ui?.trailingBadgeSize||l.value.trailingBadgeSize()},{ref_for:!0},typeof h.badge=="string"||typeof h.badge=="number"?{label:h.badge}:h.badge,{"data-slot":"trailingBadge",class:l.value.trailingBadge({class:[i.ui?.trailingBadge,h.ui?.trailingBadge]})}),null,16,["size","class"])):D("",!0)])]),_:2},1032,["value","disabled","class"]))),128)),S(d.$slots,"list-trailing")]),_:3},8,["class"]),r.content?(v(!0),N(xe,{key:0},Xe(r.items,(h,p)=>(v(),C(f($m),{key:p,value:h.value??String(p),"data-slot":"content",class:I(l.value.content({class:[i.ui?.content,h.ui?.content,h.class]}))},{default:_(()=>[S(d.$slots,h.slot||"content",{item:h,index:p,ui:l.value},()=>[ce(Z(h.content),1)])]),_:2},1032,["value","class"]))),128)):D("",!0)]),_:3},16,["model-value","default-value","orientation","activation-mode","class"]))}},u0={class:"pattern-bg"},d0={class:"bg-(--ui-bg) p-8 min-h-[calc(100vh-var(--ui-header-height))] max-w-screen-xl mx-auto pt-2 bg-default"},h0=O({__name:"index",setup(r){const e=[{label:"Scene Graph",description:"Explore and inspect the 3D scene hierarchy and object properties.",icon:"i-lucide-film",slot:"scene-graph"},{label:"Performance",description:"Monitor frame rate, memory usage, and rendering statistics.",icon:"i-lucide-chart-line",slot:"performance"}];return(t,i)=>{const n=ey,s=lb,a=a0,o=l0;return v(),N("div",u0,[F(n),T("main",d0,[F(o,{items:e,color:"primary",size:"lg",variant:"link",ui:{trigger:"grow"},class:"gap-4 w-full"},{"scene-graph":_(()=>[F(s)]),performance:_(()=>[F(a)]),_:1})])])}}});export{h0 as default};
|