@tresjs/nuxt 5.3.0 → 5.4.0

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.
@@ -1 +0,0 @@
1
- import{i as Zi,f as Ls,g as il,h as k,j as od,r as z,k as sa,l as _e,m as Vr,n as zn,p as ja,q as ai,s as Je,v as yt,x as kt,y as Ur,z as nl,A as rl,B as qi,C as sl,D as He,E as mt,F as O,G as Re,H as rt,I as bt,J as S,K as f,L as X,M as C,o as v,w as _,N as L,P as ne,O as ld,Q as aa,R as ud,S as yi,T as rs,U as dd,V as cd,W as ss,X as Ga,b as E,Y as In,Z as un,$ as Ht,a0 as D,a1 as ae,a2 as le,a3 as Tn,a4 as oa,a5 as Pn,a6 as Rn,c as N,a7 as xe,a8 as Xe,a9 as ft,aa as fe,ab as dn,ac as al,ad as ot,ae as ol,af as ll,ag as Ii,ah as ul,ai as hd,aj as Ft,ak as Wr,al as Qt,am as Ce,an as fd,ao as dl,ap as pd,aq as cl,ar as md,as as la,at as gd,au as je,av as yd,d as ce,t as Z,aw as Dn,ax as ua,ay as vd,az as bd,aA as xd,aB as qr,aC as wd,aD as _d,aE as hl,aF as Cd,aG as Ad,aH as Sd,aI as Md,aJ as ki,aK as Te,aL as fl,aM as Me,aN as I,aO as ut,aP as Bd,aQ as ue,aR as zt,aS as cn,aT as We,a as T,aU as qd,aV as Fr,aW as da,aX as kd,aY as Fd,aZ as pl,a_ as Ed,_ as ml,a$ as ca,b0 as gl,b1 as hn,b2 as ha,b3 as yl,b4 as Od,b5 as zd,b6 as Id,b7 as Td,b8 as Rt,b9 as vl,ba as bl,bb as Pd,bc as Rd,bd as Dd,be as as}from"#entry";function $d(n,e=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY){return Math.min(t,Math.max(e,n))}function er(n,e){let t=n;const i=e.toString(),r=i.indexOf("."),s=r>=0?i.length-r:0;if(s>0){const a=10**s;t=Math.round(t*a)/a}return t}function Ld(n,e,t,i){e=Number(e),t=Number(t);const r=(n-(Number.isNaN(e)?0:e))%i;let s=er(Math.abs(r)*2>=i?n+Math.sign(r)*(i-Math.abs(r)):n-r,i);return Number.isNaN(e)?!Number.isNaN(t)&&s>t&&(s=Math.floor(er(t/i,i))*i):s<e?s=e:!Number.isNaN(t)&&s>t&&(s=e+Math.floor(er((t-e)/i,i))*i),s=er(s,i),s}function Ka(n,e){return Zi(n)?!1:Array.isArray(n)?n.some(t=>Ls(t,e)):Ls(n,e)}const Hd=["INPUT","TEXTAREA"];function Nd(n,e,t,i={}){if(!e||i.enableIgnoredElement&&Hd.includes(e.nodeName))return null;const{arrowKeyOptions:r="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]=[n.key==="ArrowRight",n.key==="ArrowLeft",n.key==="ArrowUp",n.key==="ArrowDown",n.key==="Home",n.key==="End"],x=p||m,b=c||h;if(!g&&!y&&(!x&&!b||r==="vertical"&&b||r==="horizontal"&&x))return null;const w=t?Array.from(t.querySelectorAll(s)):a;if(!w.length)return null;u&&n.preventDefault();let A=null;return b||x?A=xl(w,e,{goForward:x?m:l==="ltr"?c:h,loop:o}):g?A=w.at(0)||null:y&&(A=w.at(-1)||null),d&&A?.focus(),A}function xl(n,e,t,i=n.length){if(--i===0)return null;const r=n.indexOf(e),s=t.goForward?r+1:r-1;if(!t.loop&&(s<0||s>=n.length))return null;const a=(s+n.length)%n.length,o=n[a];return o?o.hasAttribute("disabled")&&o.getAttribute("disabled")!=="false"?xl(n,o,t,i):o:null}const Vd=il(()=>{const n=z(new Map),e=z(),t=k(()=>{for(const a of n.value.values())if(a)return!0;return!1}),i=sa({scrollBody:z(!0)});let r=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&&r?.(),e.value=void 0};return _e(t,(a,o)=>{if(!Vr)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"?zn({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&&(r=ai(document,"touchmove",c=>Ud(c),{passive:!1})),Je(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),n});function fa(n){const e=Math.random().toString(36).substring(2,7),t=Vd();t.value.set(e,n??!1);const i=k({get:()=>t.value.get(e)??!1,set:r=>t.value.set(e,r)});return od(()=>{t.value.delete(e)}),i}function wl(n){const e=window.getComputedStyle(n);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&n.clientWidth<n.scrollWidth||e.overflowY==="auto"&&n.clientHeight<n.scrollHeight)return!0;{const t=n.parentNode;return!(t instanceof Element)||t.tagName==="BODY"?!1:wl(t)}}function Ud(n){const e=n||window.event,t=e.target;return t instanceof Element&&wl(t)?!1:e.touches.length>1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function jr(n){const e=sa({dir:z("ltr")});return k(()=>n?.value||e.dir?.value||"ltr")}let os=0;function _l(){yt(n=>{if(!Vr)return;const e=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",e[0]??Xa()),document.body.insertAdjacentElement("beforeend",e[1]??Xa()),os++,n(()=>{os===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(t=>t.remove()),os--})})}function Xa(){const n=document.createElement("span");return n.setAttribute("data-reka-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}function Cl(n){return k(()=>kt(n)?!!Ur(n)?.closest("form"):!0)}function Al(n,e){const t=nl(!1,300),i=z(null),r=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=Wd(d,u.getBoundingClientRect()),h=jd(d,c),p=Gd(l.getBoundingClientRect()),m=Xd([...h,...p]);i.value=m,t.value=!0}return yt(o=>{if(n.value&&e.value){const l=d=>a(d,e.value),u=d=>a(d,n.value);n.value.addEventListener("pointerleave",l),e.value.addEventListener("pointerleave",u),o(()=>{n.value?.removeEventListener("pointerleave",l),e.value?.removeEventListener("pointerleave",u)})}}),yt(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=n.value?.contains(d)||e.value?.contains(d),p=!Kd(c,i.value),m=!!d.closest("[data-grace-area-trigger]");h?s():(p||m)&&(s(),r.trigger())};n.value?.ownerDocument.addEventListener("pointermove",l),o(()=>n.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:t,onPointerExit:r.on}}function Wd(n,e){const t=Math.abs(e.top-n.y),i=Math.abs(e.bottom-n.y),r=Math.abs(e.right-n.x),s=Math.abs(e.left-n.x);switch(Math.min(t,i,r,s)){case s:return"left";case r:return"right";case t:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function jd(n,e,t=5){const i=[];switch(e){case"top":i.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":i.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":i.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":i.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return i}function Gd(n){const{top:e,right:t,bottom:i,left:r}=n;return[{x:r,y:e},{x:t,y:e},{x:t,y:i},{x:r,y:i}]}function Kd(n,e){const{x:t,y:i}=n;let r=!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&&(r=!r)}return r}function Xd(n){const e=n.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),Yd(e)}function Yd(n){if(n.length<=1)return n.slice();const e=[];for(let i=0;i<n.length;i++){const r=n[i];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let i=n.length-1;i>=0;i--){const r=n[i];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}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 Jd=function(n){if(typeof document>"u")return null;var e=Array.isArray(n)?n[0]:n;return e.ownerDocument.body},Ti=new WeakMap,tr=new WeakMap,ir={},ls=0,Sl=function(n){return n&&(n.host||Sl(n.parentNode))},Zd=function(n,e){return e.map(function(t){if(n.contains(t))return t;var i=Sl(t);return i&&n.contains(i)?i:(console.error("aria-hidden",t,"in not contained inside",n,". Doing nothing"),null)}).filter(function(t){return!!t})},Qd=function(n,e,t,i){var r=Zd(e,Array.isArray(n)?n:[n]);ir[t]||(ir[t]=new WeakMap);var s=ir[t],a=[],o=new Set,l=new Set(r),u=function(c){!c||o.has(c)||(o.add(c),u(c.parentNode))};r.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=(Ti.get(h)||0)+1,y=(s.get(h)||0)+1;Ti.set(h,g),s.set(h,y),a.push(h),g===1&&m&&tr.set(h,!0),y===1&&h.setAttribute(t,"true"),m||h.setAttribute(i,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(e),o.clear(),ls++,function(){a.forEach(function(c){var h=Ti.get(c)-1,p=s.get(c)-1;Ti.set(c,h),s.set(c,p),h||(tr.has(c)||c.removeAttribute(i),tr.delete(c)),p||c.removeAttribute(t)}),ls--,ls||(Ti=new WeakMap,Ti=new WeakMap,tr=new WeakMap,ir={})}},ec=function(n,e,t){t===void 0&&(t="data-aria-hidden");var i=Array.from(Array.isArray(n)?n:[n]),r=Jd(n);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Qd(i,r,t,"aria-hidden")):function(){return null}};function pa(n){let e;_e(()=>Ur(n),t=>{t?e=ec(t):e&&e()}),qi(()=>{e&&e()})}function vt(n,e="reka"){return`${e}-${sl?.()}`}function tc(n){const e=sa({locale:z("en")});return k(()=>n?.value||e.locale?.value||"en")}function ic(n){const e=z(),t=k(()=>e.value?.width??0),i=k(()=>e.value?.height??0);return He(()=>{const r=Ur(n);if(r){e.value={width:r.offsetWidth,height:r.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=r.offsetWidth,u=r.offsetHeight;e.value={width:l,height:u}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else e.value=void 0}),{width:t,height:i}}function nc(n){const e=nl("",1e3);return{search:e,handleTypeaheadSearch:(r,s)=>{e.value=e.value+r;{const a=mt(),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=sc(u,e.value,l?.textValue),c=o.find(h=>h.textValue===d);return c&&c.ref.focus(),c?.ref}},resetTypeahead:()=>{e.value=""}}}function rc(n,e){return n.map((t,i)=>n[(e+i)%n.length])}function sc(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let a=rc(n,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==t));const l=a.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==t?l:void 0}const[Nt,ac]=Re("DialogRoot");var oc=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(n,{emit:e}){const t=n,r=rt(t,"open",e,{defaultValue:t.defaultOpen,passive:t.open===void 0}),s=z(),a=z(),{modal:o}=bt(t);return ac({open:r,modal:o,openModal:()=>{r.value=!0},onOpenChange:l=>{r.value=l},onOpenToggle:()=>{r.value=!r.value},contentId:"",titleId:"",descriptionId:"",triggerElement:s,contentElement:a}),(l,u)=>S(l.$slots,"default",{open:f(r),close:()=>r.value=!1})}}),ma=oc,lc=O({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n;X();const t=Nt();return(i,r)=>(v(),C(f(ne),L(e,{type:i.as==="button"?"button":void 0,onClick:r[0]||(r[0]=s=>f(t).onOpenChange(!1))}),{default:_(()=>[S(i.$slots,"default")]),_:3},16,["type"]))}}),Ml=lc;const uc=ld(()=>z([]));function dc(){const n=uc();return{add(e){const t=n.value[0];e!==t&&t?.pause(),n.value=Ya(n.value,e),n.value.unshift(e)},remove(e){n.value=Ya(n.value,e),n.value[0]?.resume()}}}function Ya(n,e){const t=[...n],i=t.indexOf(e);return i!==-1&&t.splice(i,1),t}function cc(n){return n.filter(e=>e.tagName!=="A")}var hc=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(n,{emit:e}){const t=n,i=e,{currentRef:r,currentElement:s}=X(),a=z(null),o=dc(),l=aa({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});yt(d=>{if(!Vr)return;const c=s.value;if(!t.trapped)return;function h(y){if(l.paused||!c)return;const x=y.target;c.contains(x)?a.value=x:yi(a.value,{select:!0})}function p(y){if(l.paused||!c)return;const x=y.relatedTarget;x!==null&&(c.contains(x)||yi(a.value,{select:!0}))}function m(y){c.contains(a.value)||yi(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()})}),yt(async d=>{const c=s.value;if(await Je(),!c)return;o.add(l);const h=mt();if(!c.contains(h)){const m=new CustomEvent(rs,Ga);c.addEventListener(rs,g=>i("mountAutoFocus",g)),c.dispatchEvent(m),m.defaultPrevented||(dd(cc(cd(c)),{select:!0}),mt()===h&&yi(c))}d(()=>{c.removeEventListener(rs,y=>i("mountAutoFocus",y));const m=new CustomEvent(ss,Ga),g=y=>{i("unmountAutoFocus",y)};c.addEventListener(ss,g),c.dispatchEvent(m),setTimeout(()=>{m.defaultPrevented||yi(h??document.body,{select:!0}),c.removeEventListener(ss,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=mt();if(c&&h){const p=d.currentTarget,[m,g]=ud(p);m&&g?!d.shiftKey&&h===g?(d.preventDefault(),t.loop&&yi(m,{select:!0})):d.shiftKey&&h===m&&(d.preventDefault(),t.loop&&yi(g,{select:!0})):h===p&&d.preventDefault()}}return(d,c)=>(v(),C(f(ne),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":d.asChild,as:d.as,onKeydown:u},{default:_(()=>[S(d.$slots,"default")]),_:3},8,["as-child","as"]))}}),ga=hc;const fc="menu.itemSelect",Hs=["Enter"," "],pc=["ArrowDown","PageUp","Home"],Bl=["ArrowUp","PageDown","End"],mc=[...pc,...Bl],gc={ltr:[...Hs,"ArrowRight"],rtl:[...Hs,"ArrowLeft"]},yc={ltr:["ArrowLeft"],rtl:["ArrowRight"]};function ya(n){return n?"open":"closed"}function Er(n){return n==="indeterminate"}function va(n){return Er(n)?"indeterminate":n?"checked":"unchecked"}function vc(n){const e=mt();for(const t of n)if(t===e||(t.focus(),mt()!==e))return}function bc(n,e){const{x:t,y:i}=n;let r=!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&&(r=!r)}return r}function xc(n,e){if(!e)return!1;const t={x:n.clientX,y:n.clientY};return bc(t,e)}function qn(n){return n.pointerType==="mouse"}var wc=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(n,{emit:e}){const t=n,i=e,r=Nt(),{forwardRef:s,currentElement:a}=X();return r.titleId||=vt(void 0,"reka-dialog-title"),r.descriptionId||=vt(void 0,"reka-dialog-description"),He(()=>{r.contentElement=a,mt()!==document.body&&(r.triggerElement.value=mt())}),(o,l)=>(v(),C(f(ga),{"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:_(()=>[E(f(In),L({id:f(r).contentId,ref:f(s),as:o.as,"as-child":o.asChild,"disable-outside-pointer-events":o.disableOutsidePointerEvents,role:"dialog","aria-describedby":f(r).descriptionId,"aria-labelledby":f(r).titleId,"data-state":f(ya)(f(r).open.value)},o.$attrs,{onDismiss:l[0]||(l[0]=u=>f(r).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"]))}}),ql=wc,_c=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(n,{emit:e}){const t=n,i=e,r=Nt(),s=un(i),{forwardRef:a,currentElement:o}=X();return pa(o),(l,u)=>(v(),C(ql,L({...t,...f(s)},{ref:f(a),"trap-focus":f(r).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:u[0]||(u[0]=d=>{d.defaultPrevented||(d.preventDefault(),f(r).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"]))}}),Cc=_c,Ac=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(n,{emit:e}){const t=n,r=un(e);X();const s=Nt(),a=z(!1),o=z(!1);return(l,u)=>(v(),C(ql,L({...t,...f(r)},{"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))}}),Sc=Ac,Mc=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(n,{emit:e}){const t=n,i=e,r=Nt(),s=un(i),{forwardRef:a}=X();return(o,l)=>(v(),C(f(Ht),{present:o.forceMount||f(r).open.value},{default:_(()=>[f(r).modal.value?(v(),C(Cc,L({key:0,ref:f(a)},{...t,...f(s),...o.$attrs}),{default:_(()=>[S(o.$slots,"default")]),_:3},16)):(v(),C(Sc,L({key:1,ref:f(a)},{...t,...f(s),...o.$attrs}),{default:_(()=>[S(o.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),ba=Mc,Bc=O({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(n){const e=n;X();const t=Nt();return(i,r)=>(v(),C(f(ne),L(e,{id:f(t).descriptionId}),{default:_(()=>[S(i.$slots,"default")]),_:3},16,["id"]))}}),sn=Bc,qc=O({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=Nt();return fa(!0),X(),(t,i)=>(v(),C(f(ne),{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"]))}}),kc=qc,Fc=O({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=Nt(),{forwardRef:t}=X();return(i,r)=>f(e)?.modal.value?(v(),C(f(Ht),{key:0,present:i.forceMount||f(e).open.value},{default:_(()=>[E(kc,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)}}),Or=Fc,Ec=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(n){const e=n;return(t,i)=>(v(),C(f(Tn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),xa=Ec,Oc=O({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(n){const e=n,t=Nt();return X(),(i,r)=>(v(),C(f(ne),L(e,{id:f(t).titleId}),{default:_(()=>[S(i.$slots,"default")]),_:3},16,["id"]))}}),an=Oc,zc=O({__name:"DialogTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n,t=Nt(),{forwardRef:i,currentElement:r}=X();return t.contentId||=vt(void 0,"reka-dialog-content"),He(()=>{t.triggerElement.value=r.value}),(s,a)=>(v(),C(f(ne),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"]))}}),wa=zc;const Ic="rovingFocusGroup.onEntryFocus",Tc={bubbles:!1,cancelable:!0},Pc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Rc(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function Dc(n,e,t){const i=Rc(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Pc[i]}function kl(n,e=!1){const t=mt();for(const i of n)if(i===t||(i.focus({preventScroll:e}),mt()!==t))return}function $c(n,e){return n.map((t,i)=>n[(e+i)%n.length])}const[Lc,Hc]=Re("RovingFocusGroup");var Nc=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(n,{expose:e,emit:t}){const i=n,r=t,{loop:s,orientation:a,dir:o}=bt(i),l=jr(o),u=rt(i,"currentTabStopId",r,{defaultValue:i.defaultCurrentTabStopId,passive:i.currentTabStopId===void 0}),d=z(!1),c=z(!1),h=z(0),{getItems:p,CollectionSlot:m}=oa({isProvider:!0});function g(x){const b=!c.value;if(x.currentTarget&&x.target===x.currentTarget&&b&&!d.value){const w=new CustomEvent(Ic,Tc);if(x.currentTarget.dispatchEvent(w),r("entryFocus",w),!w.defaultPrevented){const A=p().map(F=>F.ref).filter(F=>F.dataset.disabled!==""),q=A.find(F=>F.getAttribute("data-active")===""),M=A.find(F=>F.getAttribute("data-highlighted")===""),B=A.find(F=>F.id===u.value),H=[q,M,B,...A].filter(Boolean);kl(H,i.preventScrollOnEntryFocus)}}c.value=!1}function y(){setTimeout(()=>{c.value=!1},1)}return e({getItems:p}),Hc({loop:s,dir:l,orientation:a,currentTabStopId:u,onItemFocus:x=>{u.value=x},onItemShiftTab:()=>{d.value=!0},onFocusableItemAdd:()=>{h.value++},onFocusableItemRemove:()=>{h.value--}}),(x,b)=>(v(),C(f(m),null,{default:_(()=>[E(f(ne),{tabindex:d.value||h.value===0?-1:0,"data-orientation":f(a),as:x.as,"as-child":x.asChild,dir:f(l),style:{outline:"none"},onMousedown:b[0]||(b[0]=w=>c.value=!0),onMouseup:y,onFocus:g,onBlur:b[1]||(b[1]=w=>d.value=!1)},{default:_(()=>[S(x.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),Fl=Nc,Vc=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(n){const e=n,t=Lc(),i=vt(),r=k(()=>e.tabStopId||i),s=k(()=>t.currentTabStopId.value===r.value),{getItems:a,CollectionItem:o}=oa();He(()=>{e.focusable&&t.onFocusableItemAdd()}),qi(()=>{e.focusable&&t.onFocusableItemRemove()});function l(u){if(u.key==="Tab"&&u.shiftKey){t.onItemShiftTab();return}if(u.target!==u.currentTarget)return;const d=Dc(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?$c(c,h+1):c.slice(h+1)}Je(()=>kl(c))}}return(u,d)=>(v(),C(f(o),null,{default:_(()=>[E(f(ne),{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(r.value):c.preventDefault()}),onFocus:d[1]||(d[1]=c=>f(t).onItemFocus(r.value)),onKeydown:l},{default:_(()=>[S(u.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),El=Vc,Uc=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(n){const e=n,{primitiveElement:t,currentElement:i}=Pn(),r=k(()=>e.checked??e.value);return _e(r,(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(Rn,L({ref_key:"primitiveElement",ref:t},{...e,...s.$attrs},{as:"input"}),null,16))}}),Ja=Uc,Wc=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(n){const e=n,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((r,s)=>typeof r=="object"?Object.entries(r).map(([a,o])=>({name:`${e.name}[${s}][${a}]`,value:o})):{name:`${e.name}[${s}]`,value:r}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([r,s])=>({name:`${e.name}[${r}]`,value:s})):[]);return(r,s)=>(v(),N(xe,null,[D(" We render single input if it's required "),t.value?(v(),C(Ja,L({key:r.name},{...e,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(v(!0),N(xe,{key:1},Xe(i.value,a=>(v(),C(Ja,L({key:a.name},{ref_for:!0},{...e,...r.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))],2112))}}),Ol=Wc;const[jc]=Re("CheckboxGroupRoot");function zr(n){return n==="indeterminate"}function zl(n){return zr(n)?"indeterminate":n?"checked":"unchecked"}const[Gc,Kc]=Re("CheckboxRoot");var Xc=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(n,{emit:e}){const t=n,i=e,{forwardRef:r,currentElement:s}=X(),a=jc(null),o=rt(t,"modelValue",i,{defaultValue:t.defaultValue,passive:t.modelValue===void 0}),l=k(()=>a?.disabled.value||t.disabled),u=k(()=>Zi(a?.modelValue.value)?o.value==="indeterminate"?"indeterminate":o.value:Ka(a.modelValue.value,t.value));function d(){if(Zi(a?.modelValue.value))o.value=zr(o.value)?!0:!o.value;else{const p=[...a.modelValue.value||[]];if(Ka(p,t.value)){const m=p.findIndex(g=>Ls(g,t.value));p.splice(m,1)}else p.push(t.value);a.modelValue.value=p}}const c=Cl(s),h=k(()=>t.id&&s.value?document.querySelector(`[for="${t.id}"]`)?.innerText:void 0);return Kc({disabled:l,state:u}),(p,m)=>(v(),C(dn(f(a)?.rovingFocus.value?f(El):f(ne)),L(p.$attrs,{id:p.id,ref:f(r),role:"checkbox","as-child":p.asChild,as:p.as,type:p.as==="button"?"button":void 0,"aria-checked":f(zr)(u.value)?"mixed":u.value,"aria-required":p.required,"aria-label":p.$attrs["aria-label"]||h.value,"data-state":f(zl)(u.value),"data-disabled":l.value?"":void 0,disabled:l.value,focusable:f(a)?.rovingFocus.value?!l.value:void 0,onKeydown:ft(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(Ol),{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"]))}}),Yc=Xc,Jc=O({__name:"CheckboxIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(n){const{forwardRef:e}=X(),t=Gc();return(i,r)=>(v(),C(f(Ht),{present:i.forceMount||f(zr)(f(t).state.value)||f(t).state.value===!0},{default:_(()=>[E(f(ne),L({ref:f(e),"data-state":f(zl)(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"]))}}),Zc=Jc;const[Il,Qc]=Re("PopperRoot");var eh=O({inheritAttrs:!1,__name:"PopperRoot",setup(n){const e=z();return Qc({anchor:e,onAnchorChange:t=>e.value=t}),(t,i)=>S(t.$slots,"default")}}),$n=eh,th=O({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n,{forwardRef:t,currentElement:i}=X(),r=Il();return al(()=>{r.onAnchorChange(e.reference??i.value)}),(s,a)=>(v(),C(f(ne),{ref:f(t),as:s.as,"as-child":s.asChild},{default:_(()=>[S(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),Ln=th;const ih={key:0,d:"M0 0L6 6L12 0"},nh={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var rh=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(n){const e=n;return X(),(t,i)=>(v(),C(f(ne),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",nh)):(v(),N("path",ih))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),sh=rh;function ah(n){return n!==null}function oh(n){return{name:"transformOrigin",options:n,fn(e){const{placement:t,rects:i,middlewareData:r}=e,a=r.arrow?.centerOffset!==0,o=a?0:n.arrowWidth,l=a?0:n.arrowHeight,[u,d]=Ns(t),c={start:"0%",center:"50%",end:"100%"}[d],h=(r.arrow?.x??0)+o/2,p=(r.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 Ns(n){const[e,t="center"]=n.split("-");return[e,t]}const lh=["top","right","bottom","left"],li=Math.min,lt=Math.max,Ir=Math.round,nr=Math.floor,$t=n=>({x:n,y:n}),uh={left:"right",right:"left",bottom:"top",top:"bottom"},dh={start:"end",end:"start"};function Vs(n,e,t){return lt(n,li(e,t))}function Jt(n,e){return typeof n=="function"?n(e):n}function Zt(n){return n.split("-")[0]}function fn(n){return n.split("-")[1]}function _a(n){return n==="x"?"y":"x"}function Ca(n){return n==="y"?"height":"width"}const ch=new Set(["top","bottom"]);function Dt(n){return ch.has(Zt(n))?"y":"x"}function Aa(n){return _a(Dt(n))}function hh(n,e,t){t===void 0&&(t=!1);const i=fn(n),r=Aa(n),s=Ca(r);let a=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Tr(a)),[a,Tr(a)]}function fh(n){const e=Tr(n);return[Us(n),e,Us(e)]}function Us(n){return n.replace(/start|end/g,e=>dh[e])}const Za=["left","right"],Qa=["right","left"],ph=["top","bottom"],mh=["bottom","top"];function gh(n,e,t){switch(n){case"top":case"bottom":return t?e?Qa:Za:e?Za:Qa;case"left":case"right":return e?ph:mh;default:return[]}}function yh(n,e,t,i){const r=fn(n);let s=gh(Zt(n),t==="start",i);return r&&(s=s.map(a=>a+"-"+r),e&&(s=s.concat(s.map(Us)))),s}function Tr(n){return n.replace(/left|right|bottom|top/g,e=>uh[e])}function vh(n){return{top:0,right:0,bottom:0,left:0,...n}}function Tl(n){return typeof n!="number"?vh(n):{top:n,right:n,bottom:n,left:n}}function Pr(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function eo(n,e,t){let{reference:i,floating:r}=n;const s=Dt(e),a=Aa(e),o=Ca(a),l=Zt(e),u=s==="y",d=i.x+i.width/2-r.width/2,c=i.y+i.height/2-r.height/2,h=i[o]/2-r[o]/2;let p;switch(l){case"top":p={x:d,y:i.y-r.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-r.width,y:c};break;default:p={x:i.x,y:i.y}}switch(fn(e)){case"start":p[a]-=h*(t&&u?-1:1);break;case"end":p[a]+=h*(t&&u?-1:1);break}return p}const bh=async(n,e,t)=>{const{placement:i="bottom",strategy:r="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:n,floating:e,strategy:r}),{x:d,y:c}=eo(u,i,l),h=i,p={},m=0;for(let g=0;g<o.length;g++){const{name:y,fn:x}=o[g],{x:b,y:w,data:A,reset:q}=await x({x:d,y:c,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:u,platform:a,elements:{reference:n,floating:e}});d=b??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:n,floating:e,strategy:r}):q.rects),{x:d,y:c}=eo(u,h,l)),g=-1)}return{x:d,y:c,placement:h,strategy:r,middlewareData:p}};async function kn(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:a,elements:o,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:h=!1,padding:p=0}=Jt(e,n),m=Tl(p),y=o[h?c==="floating"?"reference":"floating":c],x=Pr(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})),b=c==="floating"?{x:i,y:r,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=Pr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:w,strategy:l}):b);return{top:(x.top-q.top+m.top)/A.y,bottom:(q.bottom-x.bottom+m.bottom)/A.y,left:(x.left-q.left+m.left)/A.x,right:(q.right-x.right+m.right)/A.x}}const xh=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:s,platform:a,elements:o,middlewareData:l}=e,{element:u,padding:d=0}=Jt(n,e)||{};if(u==null)return{};const c=Tl(d),h={x:t,y:i},p=Aa(r),m=Ca(p),g=await a.getDimensions(u),y=p==="y",x=y?"top":"left",b=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,F=B/2-g[m]/2-1,R=li(c[x],F),U=li(c[b],F),j=R,te=B-g[m]-U,Q=B/2-g[m]/2+H,oe=Vs(j,Q,te),J=!l.arrow&&fn(r)!=null&&Q!==oe&&s.reference[m]/2-(Q<j?R:U)-g[m]/2<0,ee=J?Q<j?Q-j:Q-te:0;return{[p]:h[p]+ee,data:{[p]:oe,centerOffset:Q-oe-ee,...J&&{alignmentOffset:ee}},reset:J}}}),wh=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,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}=Jt(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const x=Zt(r),b=Dt(o),w=Zt(o)===o,A=await(l.isRTL==null?void 0:l.isRTL(u.floating)),q=h||(w||!g?[Tr(o)]:fh(o)),M=m!=="none";!h&&M&&q.push(...yh(o,g,m,A));const B=[o,...q],H=await kn(e,y),F=[];let R=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&F.push(H[x]),c){const Q=hh(r,a,A);F.push(H[Q[0]],H[Q[1]])}if(R=[...R,{placement:r,overflows:F}],!F.every(Q=>Q<=0)){var U,j;const Q=(((U=s.flip)==null?void 0:U.index)||0)+1,oe=B[Q];if(oe&&(!(c==="alignment"?b!==Dt(oe):!1)||R.every(Y=>Dt(Y.placement)===b?Y.overflows[0]>0:!0)))return{data:{index:Q,overflows:R},reset:{placement:oe}};let J=(j=R.filter(ee=>ee.overflows[0]<=0).sort((ee,Y)=>ee.overflows[1]-Y.overflows[1])[0])==null?void 0:j.placement;if(!J)switch(p){case"bestFit":{var te;const ee=(te=R.filter(Y=>{if(M){const he=Dt(Y.placement);return he===b||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(r!==J)return{reset:{placement:J}}}return{}}}};function to(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function io(n){return lh.some(e=>n[e]>=0)}const _h=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...r}=Jt(n,e);switch(i){case"referenceHidden":{const s=await kn(e,{...r,elementContext:"reference"}),a=to(s,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:io(a)}}}case"escaped":{const s=await kn(e,{...r,altBoundary:!0}),a=to(s,t.floating);return{data:{escapedOffsets:a,escaped:io(a)}}}default:return{}}}}},Pl=new Set(["left","top"]);async function Ch(n,e){const{placement:t,platform:i,elements:r}=n,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Zt(t),o=fn(t),l=Dt(t)==="y",u=Pl.has(a)?-1:1,d=s&&l?-1:1,c=Jt(e,n);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 Ah=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:s,placement:a,middlewareData:o}=e,l=await Ch(e,n);return a===((t=o.offset)==null?void 0:t.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:a}}}}},Sh=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...l}=Jt(n,e),u={x:t,y:i},d=await kn(e,l),c=Dt(Zt(r)),h=_a(c);let p=u[h],m=u[c];if(s){const y=h==="y"?"top":"left",x=h==="y"?"bottom":"right",b=p+d[y],w=p-d[x];p=Vs(b,p,w)}if(a){const y=c==="y"?"top":"left",x=c==="y"?"bottom":"right",b=m+d[y],w=m-d[x];m=Vs(b,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}}}}}},Mh=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:i,placement:r,rects:s,middlewareData:a}=e,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=Jt(n,e),d={x:t,y:i},c=Dt(r),h=_a(c);let p=d[h],m=d[c];const g=Jt(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 x,b;const w=h==="y"?"width":"height",A=Pl.has(Zt(r)),q=s.reference[c]-s.floating[w]+(A&&((x=a.offset)==null?void 0:x[c])||0)+(A?0:y.crossAxis),M=s.reference[c]+s.reference[w]+(A?0:((b=a.offset)==null?void 0:b[c])||0)-(A?y.crossAxis:0);m<q?m=q:m>M&&(m=M)}return{[h]:p,[c]:m}}}},Bh=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:s,platform:a,elements:o}=e,{apply:l=()=>{},...u}=Jt(n,e),d=await kn(e,u),c=Zt(r),h=fn(r),p=Dt(r)==="y",{width:m,height:g}=s.floating;let y,x;c==="top"||c==="bottom"?(y=c,x=h===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(x=c,y=h==="end"?"top":"bottom");const b=g-d.top-d.bottom,w=m-d.left-d.right,A=li(g-d[y],b),q=li(m-d[x],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=b),M&&!h){const R=lt(d.left,0),U=lt(d.right,0),j=lt(d.top,0),te=lt(d.bottom,0);p?H=m-2*(R!==0||U!==0?R+U:lt(d.left,d.right)):B=g-2*(j!==0||te!==0?j+te:lt(d.top,d.bottom))}await l({...e,availableWidth:H,availableHeight:B});const F=await a.getDimensions(o.floating);return m!==F.width||g!==F.height?{reset:{rects:!0}}:{}}}};function Gr(){return typeof window<"u"}function Fi(n){return Sa(n)?(n.nodeName||"").toLowerCase():"#document"}function dt(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Vt(n){var e;return(e=(Sa(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Sa(n){return Gr()?n instanceof Node||n instanceof dt(n).Node:!1}function It(n){return Gr()?n instanceof Element||n instanceof dt(n).Element:!1}function Lt(n){return Gr()?n instanceof HTMLElement||n instanceof dt(n).HTMLElement:!1}function no(n){return!Gr()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof dt(n).ShadowRoot}const qh=new Set(["inline","contents"]);function Hn(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=Tt(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!qh.has(r)}const kh=new Set(["table","td","th"]);function Fh(n){return kh.has(Fi(n))}const Eh=[":popover-open",":modal"];function Kr(n){return Eh.some(e=>{try{return n.matches(e)}catch{return!1}})}const Oh=["transform","translate","scale","rotate","perspective"],zh=["transform","translate","scale","rotate","perspective","filter"],Ih=["paint","layout","strict","content"];function Ma(n){const e=Ba(),t=It(n)?Tt(n):n;return Oh.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)||zh.some(i=>(t.willChange||"").includes(i))||Ih.some(i=>(t.contain||"").includes(i))}function Th(n){let e=ui(n);for(;Lt(e)&&!on(e);){if(Ma(e))return e;if(Kr(e))return null;e=ui(e)}return null}function Ba(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ph=new Set(["html","body","#document"]);function on(n){return Ph.has(Fi(n))}function Tt(n){return dt(n).getComputedStyle(n)}function Xr(n){return It(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ui(n){if(Fi(n)==="html")return n;const e=n.assignedSlot||n.parentNode||no(n)&&n.host||Vt(n);return no(e)?e.host:e}function Rl(n){const e=ui(n);return on(e)?n.ownerDocument?n.ownerDocument.body:n.body:Lt(e)&&Hn(e)?e:Rl(e)}function Fn(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=Rl(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),a=dt(r);if(s){const o=Ws(a);return e.concat(a,a.visualViewport||[],Hn(r)?r:[],o&&t?Fn(o):[])}return e.concat(r,Fn(r,[],t))}function Ws(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Dl(n){const e=Tt(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Lt(n),s=r?n.offsetWidth:t,a=r?n.offsetHeight:i,o=Ir(t)!==s||Ir(i)!==a;return o&&(t=s,i=a),{width:t,height:i,$:o}}function qa(n){return It(n)?n:n.contextElement}function Qi(n){const e=qa(n);if(!Lt(e))return $t(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=Dl(e);let a=(s?Ir(t.width):t.width)/i,o=(s?Ir(t.height):t.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const Rh=$t(0);function $l(n){const e=dt(n);return!Ba()||!e.visualViewport?Rh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Dh(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==dt(n)?!1:e}function Mi(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),s=qa(n);let a=$t(1);e&&(i?It(i)&&(a=Qi(i)):a=Qi(n));const o=Dh(s,t,i)?$l(s):$t(0);let l=(r.left+o.x)/a.x,u=(r.top+o.y)/a.y,d=r.width/a.x,c=r.height/a.y;if(s){const h=dt(s),p=i&&It(i)?dt(i):i;let m=h,g=Ws(m);for(;g&&i&&p!==m;){const y=Qi(g),x=g.getBoundingClientRect(),b=Tt(g),w=x.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,A=x.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,c*=y.y,l+=w,u+=A,m=dt(g),g=Ws(m)}}return Pr({width:d,height:c,x:l,y:u})}function Yr(n,e){const t=Xr(n).scrollLeft;return e?e.left+t:Mi(Vt(n)).left+t}function Ll(n,e){const t=n.getBoundingClientRect(),i=t.left+e.scrollLeft-Yr(n,t),r=t.top+e.scrollTop;return{x:i,y:r}}function $h(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const s=r==="fixed",a=Vt(i),o=e?Kr(e.floating):!1;if(i===a||o&&s)return t;let l={scrollLeft:0,scrollTop:0},u=$t(1);const d=$t(0),c=Lt(i);if((c||!c&&!s)&&((Fi(i)!=="body"||Hn(a))&&(l=Xr(i)),Lt(i))){const p=Mi(i);u=Qi(i),d.x=p.x+i.clientLeft,d.y=p.y+i.clientTop}const h=a&&!c&&!s?Ll(a,l):$t(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 Lh(n){return Array.from(n.getClientRects())}function Hh(n){const e=Vt(n),t=Xr(n),i=n.ownerDocument.body,r=lt(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=lt(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-t.scrollLeft+Yr(n);const o=-t.scrollTop;return Tt(i).direction==="rtl"&&(a+=lt(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:a,y:o}}const ro=25;function Nh(n,e){const t=dt(n),i=Vt(n),r=t.visualViewport;let s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(r){s=r.width,a=r.height;const d=Ba();(!d||d&&e==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}const u=Yr(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 Vh=new Set(["absolute","fixed"]);function Uh(n,e){const t=Mi(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,s=Lt(n)?Qi(n):$t(1),a=n.clientWidth*s.x,o=n.clientHeight*s.y,l=r*s.x,u=i*s.y;return{width:a,height:o,x:l,y:u}}function so(n,e,t){let i;if(e==="viewport")i=Nh(n,t);else if(e==="document")i=Hh(Vt(n));else if(It(e))i=Uh(e,t);else{const r=$l(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Pr(i)}function Hl(n,e){const t=ui(n);return t===e||!It(t)||on(t)?!1:Tt(t).position==="fixed"||Hl(t,e)}function Wh(n,e){const t=e.get(n);if(t)return t;let i=Fn(n,[],!1).filter(o=>It(o)&&Fi(o)!=="body"),r=null;const s=Tt(n).position==="fixed";let a=s?ui(n):n;for(;It(a)&&!on(a);){const o=Tt(a),l=Ma(a);!l&&o.position==="fixed"&&(r=null),(s?!l&&!r:!l&&o.position==="static"&&!!r&&Vh.has(r.position)||Hn(a)&&!l&&Hl(n,a))?i=i.filter(d=>d!==a):r=o,a=ui(a)}return e.set(n,i),i}function jh(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const a=[...t==="clippingAncestors"?Kr(e)?[]:Wh(e,this._c):[].concat(t),i],o=a[0],l=a.reduce((u,d)=>{const c=so(e,d,r);return u.top=lt(c.top,u.top),u.right=li(c.right,u.right),u.bottom=li(c.bottom,u.bottom),u.left=lt(c.left,u.left),u},so(e,o,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gh(n){const{width:e,height:t}=Dl(n);return{width:e,height:t}}function Kh(n,e,t){const i=Lt(e),r=Vt(e),s=t==="fixed",a=Mi(n,!0,s,e);let o={scrollLeft:0,scrollTop:0};const l=$t(0);function u(){l.x=Yr(r)}if(i||!i&&!s)if((Fi(e)!=="body"||Hn(r))&&(o=Xr(e)),i){const p=Mi(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else r&&u();s&&!i&&r&&u();const d=r&&!i&&!s?Ll(r,o):$t(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 us(n){return Tt(n).position==="static"}function ao(n,e){if(!Lt(n)||Tt(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Vt(n)===t&&(t=t.ownerDocument.body),t}function Nl(n,e){const t=dt(n);if(Kr(n))return t;if(!Lt(n)){let r=ui(n);for(;r&&!on(r);){if(It(r)&&!us(r))return r;r=ui(r)}return t}let i=ao(n,e);for(;i&&Fh(i)&&us(i);)i=ao(i,e);return i&&on(i)&&us(i)&&!Ma(i)?t:i||Th(n)||t}const Xh=async function(n){const e=this.getOffsetParent||Nl,t=this.getDimensions,i=await t(n.floating);return{reference:Kh(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Yh(n){return Tt(n).direction==="rtl"}const Jh={convertOffsetParentRelativeRectToViewportRelativeRect:$h,getDocumentElement:Vt,getClippingRect:jh,getOffsetParent:Nl,getElementRects:Xh,getClientRects:Lh,getDimensions:Gh,getScale:Qi,isElement:It,isRTL:Yh};function Vl(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function Zh(n,e){let t=null,i;const r=Vt(n);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=n.getBoundingClientRect(),{left:d,top:c,width:h,height:p}=u;if(o||e(),!h||!p)return;const m=nr(c),g=nr(r.clientWidth-(d+h)),y=nr(r.clientHeight-(c+p)),x=nr(d),w={rootMargin:-m+"px "+-g+"px "+-y+"px "+-x+"px",threshold:lt(0,li(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&&!Vl(u,n.getBoundingClientRect())&&a(),A=!1}try{t=new IntersectionObserver(q,{...w,root:r.ownerDocument})}catch{t=new IntersectionObserver(q,w)}t.observe(n)}return a(!0),s}function Qh(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=qa(n),d=r||s?[...u?Fn(u):[],...Fn(e)]:[];d.forEach(x=>{r&&x.addEventListener("scroll",t,{passive:!0}),s&&x.addEventListener("resize",t)});const c=u&&o?Zh(u,t):null;let h=-1,p=null;a&&(p=new ResizeObserver(x=>{let[b]=x;b&&b.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?Mi(n):null;l&&y();function y(){const x=Mi(n);g&&!Vl(g,x)&&t(),g=x,m=requestAnimationFrame(y)}return t(),()=>{var x;d.forEach(b=>{r&&b.removeEventListener("scroll",t),s&&b.removeEventListener("resize",t)}),c?.(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const ef=Ah,tf=Sh,oo=wh,nf=Bh,rf=_h,sf=xh,af=Mh,of=(n,e,t)=>{const i=new Map,r={platform:Jh,...t},s={...r.platform,_c:i};return bh(n,e,{...r,platform:s})};function lf(n){return n!=null&&typeof n=="object"&&"$el"in n}function js(n){if(lf(n)){const e=n.$el;return Sa(e)&&Fi(e)==="#comment"?null:e}return n}function Xi(n){return typeof n=="function"?n():f(n)}function uf(n){return{name:"arrow",options:n,fn(e){const t=js(Xi(n.element));return t==null?{}:sf({element:t,padding:n.padding}).fn(e)}}}function Ul(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function lo(n,e){const t=Ul(n);return Math.round(e*t)/t}function df(n,e,t){t===void 0&&(t={});const i=t.whileElementsMounted,r=k(()=>{var B;return(B=Xi(t.open))!=null?B:!0}),s=k(()=>Xi(t.middleware)),a=k(()=>{var B;return(B=Xi(t.placement))!=null?B:"bottom"}),o=k(()=>{var B;return(B=Xi(t.strategy))!=null?B:"absolute"}),l=k(()=>{var B;return(B=Xi(t.transform))!=null?B:!0}),u=k(()=>js(n.value)),d=k(()=>js(e.value)),c=z(0),h=z(0),p=z(o.value),m=z(a.value),g=ot({}),y=z(!1),x=k(()=>{const B={position:p.value,left:"0",top:"0"};if(!d.value)return B;const H=lo(d.value,c.value),F=lo(d.value,h.value);return l.value?{...B,transform:"translate("+H+"px, "+F+"px)",...Ul(d.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:H+"px",top:F+"px"}});let b;function w(){if(u.value==null||d.value==null)return;const B=r.value;of(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 b=="function"&&(b(),b=void 0)}function q(){if(A(),i===void 0){w();return}if(u.value!=null&&d.value!=null){b=i(u.value,d.value,w);return}}function M(){r.value||(y.value=!1)}return _e([s,a,o,r],w,{flush:"sync"}),_e([u,d],q,{flush:"sync"}),_e(r,M,{flush:"sync"}),ol()&&ll(A),{x:Ii(c),y:Ii(h),strategy:Ii(p),placement:Ii(m),middlewareData:Ii(g),isPositioned:Ii(y),floatingStyles:x,update:w}}const Wl={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},[cf,hf]=Re("PopperContent");var ff=O({inheritAttrs:!1,__name:"PopperContent",props:ul({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}},{...Wl}),emits:["placed"],setup(n,{emit:e}){const t=n,i=e,r=Il(),{forwardRef:s,currentElement:a}=X(),o=z(),l=z(),{width:u,height:d}=ic(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(ah),altBoundary:p.value.length>0})),g=k(()=>({mainAxis:t.sideFlip,crossAxis:t.alignFlip})),y=hd(()=>[ef({mainAxis:t.sideOffset+d.value,alignmentAxis:t.alignOffset}),t.prioritizePosition&&t.avoidCollisions&&oo({...m.value,...g.value}),t.avoidCollisions&&tf({mainAxis:!0,crossAxis:!!t.prioritizePosition,limiter:t.sticky==="partial"?af():void 0,...m.value}),!t.prioritizePosition&&t.avoidCollisions&&oo({...m.value,...g.value}),nf({...m.value,apply:({elements:j,rects:te,availableWidth:Q,availableHeight:oe})=>{const{width:J,height:ee}=te.reference,Y=j.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&&uf({element:l.value,padding:t.arrowPadding}),oh({arrowWidth:u.value,arrowHeight:d.value}),t.hideWhenDetached&&rf({strategy:"referenceHidden",...m.value})]),x=k(()=>t.reference??r.anchor.value),{floatingStyles:b,placement:w,isPositioned:A,middlewareData:q}=df(x,o,{strategy:t.positionStrategy,placement:c,whileElementsMounted:(...j)=>Qh(...j,{layoutShift:!t.disableUpdateOnLayoutShift,animationFrame:t.updatePositionStrategy==="always"}),middleware:y}),M=k(()=>Ns(w.value)[0]),B=k(()=>Ns(w.value)[1]);al(()=>{A.value&&i("placed")});const H=k(()=>q.value.arrow?.centerOffset!==0),F=z("");yt(()=>{a.value&&(F.value=window.getComputedStyle(a.value).zIndex)});const R=k(()=>q.value.arrow?.x??0),U=k(()=>q.value.arrow?.y??0);return hf({placedSide:M,onArrowChange:j=>l.value=j,arrowX:R,arrowY:U,shouldHideArrow:H}),(j,te)=>(v(),N("div",{ref_key:"floatingRef",ref:o,"data-reka-popper-content-wrapper":"",style:Ft({...f(b),transform:f(A)?f(b).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:F.value,"--reka-popper-transform-origin":[f(q).transformOrigin?.x,f(q).transformOrigin?.y].join(" "),...f(q).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[E(f(ne),L({ref:f(s)},j.$attrs,{"as-child":t.asChild,as:j.as,"data-side":M.value,"data-align":B.value,style:{animation:f(A)?void 0:"none"}}),{default:_(()=>[S(j.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Jr=ff;const pf={top:"bottom",right:"left",bottom:"top",left:"right"};var mf=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(n){const{forwardRef:e}=X(),t=cf(),i=k(()=>pf[t.placedSide.value]);return(r,s)=>(v(),N("span",{ref:a=>{f(t).onArrowChange(a)},style:Ft({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})},[E(sh,L(r.$attrs,{ref:f(e),style:{display:"block"},as:r.as,"as-child":r.asChild,rounded:r.rounded,width:r.width,height:r.height}),{default:_(()=>[S(r.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),Zr=mf,gf=O({__name:"MenuAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return(t,i)=>(v(),C(f(Ln),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),jl=gf,yf=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(n){const e=n;return(t,i)=>(v(),C(f(Zr),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),vf=yf;function bf(){const n=z(!1);return He(()=>{ai("keydown",()=>{n.value=!0},{capture:!0,passive:!0}),ai(["pointerdown","pointermove"],()=>{n.value=!1},{capture:!0,passive:!0})}),n}const xf=il(bf),[Ei,Gl]=Re(["MenuRoot","MenuSub"],"MenuContext"),[Nn,wf]=Re("MenuRoot");var _f=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(n,{emit:e}){const t=n,i=e,{modal:r,dir:s}=bt(t),a=jr(s),o=rt(t,"open",i),l=z(),u=xf();return Gl({open:o,onOpenChange:d=>{o.value=d},content:l,onContentChange:d=>{l.value=d}}),wf({onClose:()=>{o.value=!1},isUsingKeyboardRef:u,dir:a,modal:r}),(d,c)=>(v(),C(f($n),null,{default:_(()=>[S(d.$slots,"default")]),_:3}))}}),Cf=_f;const[ka,Af]=Re("MenuContent");var Sf=O({__name:"MenuContentImpl",props:ul({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}},{...Wl}),emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus","dismiss"],setup(n,{emit:e}){const t=n,i=e,r=Ei(),s=Nn(),{trapFocus:a,disableOutsidePointerEvents:o,loop:l}=bt(t);_l(),fa(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:x,currentElement:b}=X(),{handleTypeaheadSearch:w}=nc();_e(b,F=>{r.onContentChange(F)}),qi(()=>{window.clearTimeout(d.value)});function A(F){return p.value===h.value?.side&&xc(F,h.value?.area)}async function q(F){i("openAutoFocus",F),!F.defaultPrevented&&(F.preventDefault(),b.value?.focus({preventScroll:!0}))}function M(F){if(F.defaultPrevented)return;const U=F.target.closest("[data-reka-menu-content]")===F.currentTarget,j=F.ctrlKey||F.altKey||F.metaKey,te=F.key.length===1,Q=Nd(F,mt(),b.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(F.code==="Space")return;const oe=y.value?.getItems()??[];if(U&&(F.key==="Tab"&&F.preventDefault(),!j&&te&&w(F.key,oe)),F.target!==b.value||!mc.includes(F.key))return;F.preventDefault();const J=[...oe.map(ee=>ee.ref)];Bl.includes(F.key)&&J.reverse(),vc(J)}function B(F){F?.currentTarget?.contains?.(F.target)||(window.clearTimeout(d.value),u.value="")}function H(F){if(!qn(F))return;const R=F.target,U=m.value!==F.clientX;if(F?.currentTarget?.contains(R)&&U){const j=F.clientX>m.value?"right":"left";p.value=j,m.value=F.clientX}}return Af({onItemEnter:F=>!!A(F),onItemLeave:F=>{A(F)||(b.value?.focus(),g.value=null)},onTriggerLeave:F=>!!A(F),searchRef:u,pointerGraceTimerRef:c,onPointerGraceIntentChange:F=>{h.value=F}}),(F,R)=>(v(),C(f(ga),{"as-child":"",trapped:f(a),onMountAutoFocus:q,onUnmountAutoFocus:R[7]||(R[7]=U=>i("closeAutoFocus",U))},{default:_(()=>[E(f(In),{"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:_(()=>[E(f(Fl),{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:_(()=>[E(f(Jr),{ref:f(x),role:"menu",as:F.as,"as-child":F.asChild,"aria-orientation":"vertical","data-reka-menu-content":"","data-state":f(ya)(f(r).open.value),dir:f(s).dir.value,side:F.side,"side-offset":F.sideOffset,align:F.align,"align-offset":F.alignOffset,"avoid-collisions":F.avoidCollisions,"collision-boundary":F.collisionBoundary,"collision-padding":F.collisionPadding,"arrow-padding":F.arrowPadding,"prioritize-position":F.prioritizePosition,"position-strategy":F.positionStrategy,"update-position-strategy":F.updatePositionStrategy,sticky:F.sticky,"hide-when-detached":F.hideWhenDetached,reference:F.reference,onKeydown:M,onBlur:B,onPointermove:H},{default:_(()=>[S(F.$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"]))}}),Fa=Sf,Mf=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(n){const e=n,t=ka(),{forwardRef:i}=X(),{CollectionItem:r}=oa(),s=z(!1);async function a(l){l.defaultPrevented||qn(l)&&(e.disabled?t.onItemLeave(l):t.onItemEnter(l)||l.currentTarget?.focus({preventScroll:!0}))}async function o(l){await Je(),!l.defaultPrevented&&qn(l)&&t.onItemLeave(l)}return(l,u)=>(v(),C(f(r),{value:{textValue:l.textValue}},{default:_(()=>[E(f(ne),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 Je(),!(d.defaultPrevented||l.disabled)&&(s.value=!0)}),onBlur:u[1]||(u[1]=async d=>{await Je(),!d.defaultPrevented&&(s.value=!1)})}),{default:_(()=>[S(l.$slots,"default")]),_:3},16,["as","as-child","aria-disabled","data-disabled","data-highlighted"])]),_:3},8,["value"]))}}),Kl=Mf,Bf=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(n,{emit:e}){const t=n,i=e,{forwardRef:r,currentElement:s}=X(),a=Nn(),o=ka(),l=z(!1);async function u(){const d=s.value;if(!t.disabled&&d){const c=new CustomEvent(fc,{bubbles:!0,cancelable:!0});i("select",c),await Je(),c.defaultPrevented?l.value=!1:a.onClose()}}return(d,c)=>(v(),C(Kl,L(t,{ref:f(r),onClick:u,onPointerdown:c[0]||(c[0]=()=>{l.value=!0}),onPointerup:c[1]||(c[1]=async h=>{await Je(),!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(Hs).includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}),{default:_(()=>[S(d.$slots,"default")]),_:3},16))}}),Ea=Bf;const[qf,Xl]=Re(["MenuCheckboxItem","MenuRadioItem"],"MenuItemIndicatorContext");var kf=O({__name:"MenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(n){const e=qf({modelValue:z(!1)});return(t,i)=>(v(),C(f(Ht),{present:t.forceMount||f(Er)(f(e).modelValue.value)||f(e).modelValue.value===!0},{default:_(()=>[E(f(ne),{as:t.as,"as-child":t.asChild,"data-state":f(va)(f(e).modelValue.value)},{default:_(()=>[S(t.$slots,"default")]),_:3},8,["as","as-child","data-state"])]),_:3},8,["present"]))}}),Ff=kf,Ef=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(n,{emit:e}){const t=n,i=e,r=Wr(t,["modelValue"]),s=Qt(r),a=rt(t,"modelValue",i);return Xl({modelValue:a}),(o,l)=>(v(),C(Ea,L({role:"menuitemcheckbox"},f(s),{"aria-checked":f(Er)(f(a))?"mixed":f(a),"data-state":f(va)(f(a)),onSelect:l[0]||(l[0]=async u=>{i("select",u),f(Er)(f(a))?a.value=!0:a.value=!f(a)})}),{default:_(()=>[S(o.$slots,"default",{modelValue:f(a)})]),_:3},16,["aria-checked","data-state"]))}}),Of=Ef,zf=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(n,{emit:e}){const t=n,i=e,r=Ce(t,i),s=Ei(),{forwardRef:a,currentElement:o}=X();return pa(o),(l,u)=>(v(),C(Fa,L(f(r),{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"]))}}),If=zf,Tf=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(n,{emit:e}){const r=Ce(n,e),s=Ei();return(a,o)=>(v(),C(Fa,L(f(r),{"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))}}),Pf=Tf,Rf=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(n,{emit:e}){const r=Ce(n,e),s=Ei(),a=Nn();return(o,l)=>(v(),C(f(Ht),{present:o.forceMount||f(s).open.value},{default:_(()=>[f(a).modal.value?(v(),C(If,ae(L({key:0},{...o.$attrs,...f(r)})),{default:_(()=>[S(o.$slots,"default")]),_:3},16)):(v(),C(Pf,ae(L({key:1},{...o.$attrs,...f(r)})),{default:_(()=>[S(o.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Df=Rf,$f=O({__name:"MenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return(t,i)=>(v(),C(f(ne),L({role:"group"},e),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Yl=$f,Lf=O({__name:"MenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(n){const e=n;return(t,i)=>(v(),C(f(ne),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Hf=Lf,Nf=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(n){const e=n;return(t,i)=>(v(),C(f(Tn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Vf=Nf;const[Uf,Wf]=Re("MenuRadioGroup");var jf=O({__name:"MenuRadioGroup",props:{modelValue:{type:String,required:!1,default:""},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=e,r=Wr(t,["modelValue"]),s=Qt(r),a=rt(t,"modelValue",i);return Wf({modelValue:a,onValueChange:o=>{a.value=o}}),(o,l)=>(v(),C(Yl,ae(le(f(s))),{default:_(()=>[S(o.$slots,"default",{modelValue:f(a)})]),_:3},16))}}),Gf=jf,Kf=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(n,{emit:e}){const t=n,i=e,r=Wr(t,["value"]),s=Qt(r),{value:a}=bt(t),o=Uf(),l=k(()=>o.modelValue.value===a?.value);return Xl({modelValue:l}),(u,d)=>(v(),C(Ea,L({role:"menuitemradio"},f(s),{"aria-checked":l.value,"data-state":f(va)(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"]))}}),Xf=Kf,Yf=O({__name:"MenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return(t,i)=>(v(),C(f(ne),L(e,{role:"separator","aria-orientation":"horizontal"}),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Jf=Yf;const[Jl,Zf]=Re("MenuSub");var Qf=O({__name:"MenuSub",props:{open:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(n,{emit:e}){const t=n,r=rt(t,"open",e,{defaultValue:!1,passive:t.open===void 0}),s=Ei(),a=z(),o=z();return yt(l=>{s?.open.value===!1&&(r.value=!1),l(()=>r.value=!1)}),Gl({open:r,onOpenChange:l=>{r.value=l},content:o,onContentChange:l=>{o.value=l}}),Zf({triggerId:"",contentId:"",trigger:a,onTriggerChange:l=>{a.value=l}}),(l,u)=>(v(),C(f($n),null,{default:_(()=>[S(l.$slots,"default")]),_:3}))}}),ep=Qf,tp=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(n,{emit:e}){const r=Ce(n,e),s=Ei(),a=Nn(),o=Jl(),{forwardRef:l,currentElement:u}=X();return o.contentId||=vt(void 0,"reka-menu-sub-content"),(d,c)=>(v(),C(f(Ht),{present:d.forceMount||f(s).open.value},{default:_(()=>[E(Fa,L(f(r),{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(yc)[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"]))}}),ip=tp,np=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(n){const e=n,t=Ei(),i=Nn(),r=Jl(),s=ka(),a=z(null);r.triggerId||=vt(void 0,"reka-menu-sub-trigger");function o(){a.value&&window.clearTimeout(a.value),a.value=null}qi(()=>{o()});function l(c){!qn(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(!qn(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"],x=h[m?"right":"left"];s.onPointerGraceIntentChange({area:[{x:c.clientX+g,y:c.clientY},{x:y,y:h.top},{x,y:h.top},{x,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===" "||gc[i.dir.value].includes(c.key)&&(t.onOpenChange(!0),await Je(),t.content.value?.focus(),c.preventDefault())}return(c,h)=>(v(),C(jl,{"as-child":""},{default:_(()=>[E(Kl,L(e,{id:f(r).triggerId,ref:p=>{f(r)?.onTriggerChange(p?.$el)},"aria-haspopup":"menu","aria-expanded":f(t).open.value,"aria-controls":f(r).contentId,"data-state":f(ya)(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}))}}),rp=np;const[Oi,sp]=Re("PopoverRoot");var ap=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(n,{emit:e}){const t=n,i=e,{modal:r}=bt(t),s=rt(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0}),a=z(),o=z(!1);return sp({contentId:"",triggerId:"",modal:r,open:s,onOpenChange:l=>{s.value=l},onOpenToggle:()=>{s.value=!s.value},triggerElement:a,hasCustomAnchor:o}),(l,u)=>(v(),C(f($n),null,{default:_(()=>[S(l.$slots,"default",{open:f(s),close:()=>s.value=!1})]),_:3}))}}),op=ap,lp=O({__name:"PopoverAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;X();const t=Oi();return fd(()=>{t.hasCustomAnchor.value=!0}),qi(()=>{t.hasCustomAnchor.value=!1}),(i,r)=>(v(),C(f(Ln),ae(le(e)),{default:_(()=>[S(i.$slots,"default")]),_:3},16))}}),up=lp,dp=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(n){const e=n;return X(),(t,i)=>(v(),C(f(Zr),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),cp=dp,hp=O({__name:"PopoverClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n;X();const t=Oi();return(i,r)=>(v(),C(f(ne),{type:i.as==="button"?"button":void 0,as:i.as,"as-child":e.asChild,onClick:r[0]||(r[0]=s=>f(t).onOpenChange(!1))},{default:_(()=>[S(i.$slots,"default")]),_:3},8,["type","as","as-child"]))}}),fp=hp,pp=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(n,{emit:e}){const t=n,i=e,r=Qt(Wr(t,"trapFocus","disableOutsidePointerEvents")),{forwardRef:s}=X(),a=Oi();return _l(),(o,l)=>(v(),C(f(ga),{"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:_(()=>[E(f(In),{"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:_(()=>[E(f(Jr),L(f(r),{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"]))}}),Zl=pp,mp=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(n,{emit:e}){const t=n,i=e,r=Oi(),s=z(!1);fa(!0);const a=Ce(t,i),{forwardRef:o,currentElement:l}=X();return pa(l),(u,d)=>(v(),C(Zl,L(f(a),{ref:f(o),"trap-focus":f(r).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:d[0]||(d[0]=fe(c=>{i("closeAutoFocus",c),s.value||f(r).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"]))}}),gp=mp,yp=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(n,{emit:e}){const t=n,i=e,r=Oi(),s=z(!1),a=z(!1),o=Ce(t,i);return(l,u)=>(v(),C(Zl,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(r).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(r).triggerElement.value?.contains(c)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&a.value&&d.preventDefault()})}),{default:_(()=>[S(l.$slots,"default")]),_:3},16))}}),vp=yp,bp=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(n,{emit:e}){const t=n,i=e,r=Oi(),s=Ce(t,i),{forwardRef:a}=X();return r.contentId||=vt(void 0,"reka-popover-content"),(o,l)=>(v(),C(f(Ht),{present:o.forceMount||f(r).open.value},{default:_(()=>[f(r).modal.value?(v(),C(gp,L({key:0},f(s),{ref:f(a)}),{default:_(()=>[S(o.$slots,"default")]),_:3},16)):(v(),C(vp,L({key:1},f(s),{ref:f(a)}),{default:_(()=>[S(o.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),xp=bp,wp=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(n){const e=n;return(t,i)=>(v(),C(f(Tn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),_p=wp,Cp=O({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n,t=Oi(),{forwardRef:i,currentElement:r}=X();return t.triggerId||=vt(void 0,"reka-popover-trigger"),He(()=>{t.triggerElement.value=r.value}),(s,a)=>(v(),C(dn(f(t).hasCustomAnchor.value?f(ne):f(Ln)),{"as-child":""},{default:_(()=>[E(f(ne),{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}))}}),Ap=Cp,Sp=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(n){const e=n;return X(),(t,i)=>(v(),C(f(vf),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Ql=Sp,Mp=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(n,{emit:e}){const t=n,r=un(e);return X(),(s,a)=>(v(),C(f(Of),ae(le({...t,...f(r)})),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),Bp=Mp;const[eu,qp]=Re("DropdownMenuRoot");var kp=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(n,{emit:e}){const t=n,i=e;X();const r=rt(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0}),s=z(),{modal:a,dir:o}=bt(t),l=jr(o);return qp({open:r,onOpenChange:u=>{r.value=u},onOpenToggle:()=>{r.value=!r.value},triggerId:"",triggerElement:s,contentId:"",modal:a,dir:l}),(u,d)=>(v(),C(f(Cf),{open:f(r),"onUpdate:open":d[0]||(d[0]=c=>dl(r)?r.value=c:null),dir:f(l),modal:f(a)},{default:_(()=>[S(u.$slots,"default",{open:f(r)})]),_:3},8,["open","dir","modal"]))}}),tu=kp,Fp=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(n,{emit:e}){const r=Ce(n,e);X();const s=eu(),a=z(!1);function o(l){l.defaultPrevented||(a.value||setTimeout(()=>{s.triggerElement.value?.focus()},0),a.value=!1,l.preventDefault())}return s.contentId||=vt(void 0,"reka-dropdown-menu-content"),(l,u)=>(v(),C(f(Df),L(f(r),{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"]))}}),Ep=Fp,Op=O({__name:"DropdownMenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return X(),(t,i)=>(v(),C(f(Yl),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),zp=Op,Ip=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(n,{emit:e}){const t=n,r=un(e);return X(),(s,a)=>(v(),C(f(Ea),ae(le({...t,...f(r)})),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),Tp=Ip,Pp=O({__name:"DropdownMenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return X(),(t,i)=>(v(),C(f(Ff),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Rp=Pp,Dp=O({__name:"DropdownMenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return X(),(t,i)=>(v(),C(f(Hf),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),$p=Dp,Lp=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(n){const e=n;return(t,i)=>(v(),C(f(Vf),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Hp=Lp,Np=O({__name:"DropdownMenuRadioGroup",props:{modelValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=un(e);return X(),(s,a)=>(v(),C(f(Gf),ae(le({...t,...f(r)})),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),Vp=Np,Up=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(n,{emit:e}){const r=Ce(n,e);return X(),(s,a)=>(v(),C(f(Xf),ae(le(f(r))),{default:_(()=>[S(s.$slots,"default")]),_:3},16))}}),Wp=Up,jp=O({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n;return X(),(t,i)=>(v(),C(f(Jf),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Gp=jp,Kp=O({__name:"DropdownMenuSub",props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(n,{emit:e}){const t=n,r=rt(t,"open",e,{passive:t.open===void 0,defaultValue:t.defaultOpen??!1});return X(),(s,a)=>(v(),C(f(ep),{open:f(r),"onUpdate:open":a[0]||(a[0]=o=>dl(r)?r.value=o:null)},{default:_(()=>[S(s.$slots,"default",{open:f(r)})]),_:3},8,["open"]))}}),Xp=Kp,Yp=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(n,{emit:e}){const r=Ce(n,e);return X(),(s,a)=>(v(),C(f(ip),L(f(r),{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))}}),Jp=Yp,Zp=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(n){const e=n;return X(),(t,i)=>(v(),C(f(rp),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Qp=Zp,em=O({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n,t=eu(),{forwardRef:i,currentElement:r}=X();return He(()=>{t.triggerElement=r}),t.triggerId||=vt(void 0,"reka-dropdown-menu-trigger"),(s,a)=>(v(),C(f(jl),{"as-child":""},{default:_(()=>[E(f(ne),{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 Je(),f(t).open.value&&o.preventDefault())}),onKeydown:a[1]||(a[1]=ft(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}))}}),iu=em,tm=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(n){const e=n;return X(),(t,i)=>(v(),C(f(Zr),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),im=tm;const[Oa,nm]=Re("HoverCardRoot");var rm=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(n,{emit:e}){const t=n,i=e,{openDelay:r,closeDelay:s}=bt(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,r.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 nm({open:a,onOpenChange(y){a.value=y},onOpen:p,onClose:m,onDismiss:g,hasSelectionRef:u,isPointerDownOnContentRef:d,isPointerInTransitRef:c,triggerElement:h}),(y,x)=>(v(),C(f($n),null,{default:_(()=>[S(y.$slots,"default",{open:f(a)})]),_:3}))}}),sm=rm;function Gs(n){return e=>e.pointerType==="touch"?void 0:n()}function am(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();)e.push(t.currentNode);return e}var om=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(n,{emit:e}){const t=n,i=e,r=Qt(t),{forwardRef:s,currentElement:a}=X(),o=Oa(),{isPointerInTransit:l,onPointerExit:u}=Al(o.triggerElement,a);pd(o.isPointerInTransitRef,l,{direction:"rtl"}),u(()=>{o.onClose()});const d=z(!1);let c;yt(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,Je(()=>{document.getSelection()?.toString()!==""&&(o.hasSelectionRef.value=!0)})}return He(()=>{a.value&&(document.addEventListener("pointerup",h),am(a.value).forEach(m=>m.setAttribute("tabindex","-1")))}),qi(()=>{document.removeEventListener("pointerup",h),o.hasSelectionRef.value=!1,o.isPointerDownOnContentRef.value=!1}),(p,m)=>(v(),C(f(In),{"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:_(()=>[E(f(Jr),L({...f(r),...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"]))}}),lm=om,um=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(n,{emit:e}){const r=Ce(n,e),{forwardRef:s}=X(),a=Oa();return(o,l)=>(v(),C(f(Ht),{present:o.forceMount||f(a).open.value},{default:_(()=>[E(lm,L(f(r),{ref:f(s),onPointerenter:l[0]||(l[0]=u=>f(Gs)(f(a).onOpen)(u))}),{default:_(()=>[S(o.$slots,"default")]),_:3},16)]),_:3},8,["present"]))}}),dm=um,cm=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(n){const e=n;return(t,i)=>(v(),C(f(Tn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),hm=cm,fm=O({__name:"HoverCardTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"a"}},setup(n){const{forwardRef:e,currentElement:t}=X(),i=Oa();i.triggerElement=t;function r(){setTimeout(()=>{!i.isPointerInTransitRef.value&&!i.open.value&&i.onClose()},0)}return(s,a)=>(v(),C(f(Ln),{"as-child":"",reference:s.reference},{default:_(()=>[E(f(ne),{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(Gs)(f(i).onOpen)(o)),onPointerleave:a[1]||(a[1]=o=>f(Gs)(r)(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"]))}}),pm=fm,mm=O({__name:"Label",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"label"}},setup(n){const e=n;return X(),(t,i)=>(v(),C(f(ne),L(e,{onMousedown:i[0]||(i[0]=r=>{!r.defaultPrevented&&r.detail>1&&r.preventDefault()})}),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),uo=mm;let ds=new Map,Ks=!1;try{Ks=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let Rr=!1;try{Rr=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const nu={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class ru{format(e){let t="";if(!Ks&&this.options.signDisplay!=null?t=ym(this.numberFormatter,this.options.signDisplay,e):t=this.numberFormatter.format(e),this.options.style==="unit"&&!Rr){var i;let{unit:r,unitDisplay:s="short",locale:a}=this.resolvedOptions();if(!r)return t;let o=(i=nu[r])===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),r=this.numberFormatter.formatToParts(t);return[...i.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Ks&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!Rr&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=gm(e,t),this.options=t}}function gm(n,e={}){let{numberingSystem:t}=e;if(t&&n.includes("-nu-")&&(n.includes("-u-")||(n+="-u-"),n+=`-nu-${t}`),e.style==="unit"&&!Rr){var i;let{unit:a,unitDisplay:o="short"}=e;if(!a)throw new Error('unit option must be provided with style: "unit"');if(!(!((i=nu[a])===null||i===void 0)&&i[o]))throw new Error(`Unsupported unit ${a} with unitDisplay = ${o}`);e={...e,style:"decimal"}}let r=n+(e?Object.entries(e).sort((a,o)=>a[0]<o[0]?-1:1).join():"");if(ds.has(r))return ds.get(r);let s=new Intl.NumberFormat(n,e);return ds.set(r,s),s}function ym(n,e,t){if(e==="auto")return n.format(t);if(e==="never")return n.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 r=n.format(-t),s=n.format(t),a=r.replace(s,"").replace(/\u200e|\u061C/,"");return[...a].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),r.replace(s,"!!!").replace(a,"+").replace("!!!",s)}else return n.format(t)}}const vm=new RegExp("^.*\\(.*\\).*$"),bm=["latn","arab","hanidec","deva","beng","fullwide"];class su{parse(e){return cs(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,i){return cs(this.locale,this.options,e).isValidPartialNumber(e,t,i)}getNumberingSystem(e){return cs(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}}const co=new Map;function cs(n,e,t){let i=ho(n,e);if(!n.includes("-nu-")&&!i.isValidPartialNumber(t)){for(let r of bm)if(r!==i.options.numberingSystem){let s=ho(n+(n.includes("-u-")?"-nu-":"-u-nu-")+r,e);if(s.isValidPartialNumber(t))return s}}return i}function ho(n,e){let t=n+(e?Object.entries(e).sort((r,s)=>r[0]<s[0]?-1:1).join():""),i=co.get(t);return i||(i=new xm(n,e),co.set(t,i)),i}class xm{parse(e){let t=this.sanitize(e);if(this.symbols.group&&(t=Pi(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 r,s;let a={...this.options,style:"decimal",minimumFractionDigits:Math.min(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)+2,20),maximumFractionDigits:Math.min(((s=this.options.maximumFractionDigits)!==null&&s!==void 0?s:0)+2,20)};return new su(this.locale,a).parse(new ru(this.locale,a).format(i))}return this.options.currencySign==="accounting"&&vm.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=Pi(e,".",this.symbols.group))),this.symbols.group==="’"&&e.includes("'")&&(e=Pi(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=Pi(e," ",this.symbols.group),e=Pi(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=Pi(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=_m(e,this.formatter,this.options,t);var i,r;this.options.style==="percent"&&(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)>18||((r=this.options.maximumFractionDigits)!==null&&r!==void 0?r:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const fo=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),wm=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function _m(n,e,t,i){var r,s,a,o;let l=new Intl.NumberFormat(n,{...t,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),u=l.formatToParts(-10000.111),d=l.formatToParts(10000.111),c=wm.map(R=>l.formatToParts(R));var h;let p=(h=(r=u.find(R=>R.type==="minusSign"))===null||r===void 0?void 0:r.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(n,{...t,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(R=>R.type==="decimal"))===null||a===void 0?void 0:a.value,x=(o=u.find(R=>R.type==="group"))===null||o===void 0?void 0:o.value,b=u.filter(R=>!fo.has(R.type)).map(R=>po(R.value)),w=c.flatMap(R=>R.filter(U=>!fo.has(U.type)).map(U=>po(U.value))),A=[...new Set([...b,...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:x,literals:q,numeral:H,index:R=>String(B.get(R))}}function Pi(n,e,t){return n.replaceAll?n.replaceAll(e,t):n.split(e).join(t)}function po(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function au(n){const{disabled:e}=n,t=z(),i=rl(),r=()=>window.clearTimeout(t.value),s=h=>{r(),!e.value&&(i.trigger(),t.value=window.setTimeout(()=>{s(60)},h))},a=()=>{s(400)},o=()=>{r()},l=z(!1),u=k(()=>Ur(n.target)),d=h=>{h.button!==0||l.value||(h.preventDefault(),l.value=!0,a())},c=()=>{l.value=!1,o()};return Vr&&(ai(u||window,"pointerdown",d),ai(window,"pointerup",c),ai(window,"pointercancel",c)),{isPressed:l,onTrigger:i.on}}function mo(n,e=z({})){return cl(()=>new ru(n.value,e.value))}function Cm(n,e=z({})){return cl(()=>new su(n.value,e.value))}function go(n,e,t){let i=n==="+"?e+t:e-t;if(e%1!==0||t%1!==0){const r=e.toString().split("."),s=t.toString().split("."),a=r[1]&&r[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=n==="+"?e+t:e-t,i/=l}return i}const[za,Am]=Re("NumberFieldRoot");var Sm=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(n,{emit:e}){const t=n,i=e,{disabled:r,readonly:s,disableWheelChange:a,invertWheelChange:o,min:l,max:u,step:d,stepSnapping:c,formatOptions:h,id:p,locale:m}=bt(t),g=rt(t,"modelValue",i,{defaultValue:t.defaultValue,passive:t.modelValue===void 0}),{primitiveElement:y,currentElement:x}=Pn(),b=tc(m),w=Cl(x),A=z(),q=k(()=>!Zi(g.value)&&(Y(g.value)===l.value||l.value&&!isNaN(g.value)?go("-",g.value,d.value)<l.value:!1)),M=k(()=>!Zi(g.value)&&(Y(g.value)===u.value||u.value&&!isNaN(g.value)?go("+",g.value,d.value)>u.value:!1));function B(se,ye=1){if(A.value?.focus(),t.disabled||t.readonly)return;const gn=j.parse(A.value?.value??"");isNaN(gn)?g.value=l.value??0:se==="increase"?g.value=Y(gn+(d.value??1)*ye):g.value=Y(gn-(d.value??1)*ye)}function H(se=1){B("increase",se)}function F(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=mo(b,h),j=Cm(b,h),te=k(()=>U.resolvedOptions().maximumFractionDigits>0?"decimal":"numeric"),Q=mo(b,h),oe=k(()=>Zi(g.value)||isNaN(g.value)?"":Q.format(g.value));function J(se){return j.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=$d(se,l.value,u.value):ye=Ld(se,l.value,u.value,d.value),ye=j.parse(U.format(ye)),ye}function he(se){const ye=j.parse(se);return g.value=isNaN(ye)?void 0:Y(ye),se.length?(isNaN(ye),ee(oe.value)):ee(se)}return Am({modelValue:g,handleDecrease:F,handleIncrease:H,handleMinMaxValue:R,inputMode:te,inputEl:A,onInputElement:se=>A.value=se,textValue:oe,validate:J,applyInputValue:he,disabled:r,readonly:s,disableWheelChange:a,invertWheelChange:o,max:u,min:l,isDecreaseDisabled:q,isIncreaseDisabled:M,id:p}),(se,ye)=>(v(),C(f(ne),L(se.$attrs,{ref_key:"primitiveElement",ref:y,role:"group",as:se.as,"as-child":se.asChild,"data-disabled":f(r)?"":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(Ol),{key:0,type:"text",value:f(g),name:se.name,disabled:f(r),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"]))}}),Mm=Sm,Bm=O({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n,t=za(),i=k(()=>t.disabled?.value||t.readonly.value||e.disabled||t.isDecreaseDisabled.value),{primitiveElement:r,currentElement:s}=Pn(),{isPressed:a,onTrigger:o}=au({target:s,disabled:i});return o(()=>{t.handleDecrease()}),(l,u)=>(v(),C(f(ne),L(e,{ref_key:"primitiveElement",ref:r,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"]))}}),qm=Bm,km=O({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n,t=za(),i=k(()=>t.disabled?.value||t.readonly.value||e.disabled||t.isIncreaseDisabled.value),{primitiveElement:r,currentElement:s}=Pn(),{isPressed:a,onTrigger:o}=au({target:s,disabled:i});return o(()=>{t.handleIncrease()}),(l,u)=>(v(),C(f(ne),L(e,{ref_key:"primitiveElement",ref:r,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"]))}}),Fm=km,Em=O({__name:"NumberFieldInput",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},setup(n){const e=n,{primitiveElement:t,currentElement:i}=Pn(),r=za();function s(l){r.disableWheelChange.value||l.target===mt()&&(Math.abs(l.deltaY)<=Math.abs(l.deltaX)||(l.preventDefault(),l.deltaY>0?r.invertWheelChange.value?r.handleDecrease():r.handleIncrease():l.deltaY<0&&(r.invertWheelChange.value?r.handleIncrease():r.handleDecrease())))}He(()=>{r.onInputElement(i.value)});const a=z(r.textValue.value);_e(()=>r.textValue.value,()=>{a.value=r.textValue.value},{immediate:!0,deep:!0});function o(){requestAnimationFrame(()=>{a.value=r.textValue.value})}return(l,u)=>(v(),C(f(ne),L(e,{id:f(r).id.value,ref_key:"primitiveElement",ref:t,value:a.value,role:"spinbutton",type:"text",tabindex:"0",inputmode:f(r).inputMode.value,disabled:f(r).disabled.value?"":void 0,"data-disabled":f(r).disabled.value?"":void 0,readonly:f(r).readonly.value?"":void 0,"data-readonly":f(r).readonly.value?"":void 0,autocomplete:"off",autocorrect:"off",spellcheck:"false","aria-roledescription":"Number field","aria-valuenow":f(r).modelValue.value,"aria-valuemin":f(r).min.value,"aria-valuemax":f(r).max.value,onKeydown:[u[0]||(u[0]=ft(fe(d=>f(r).handleIncrease(),["prevent"]),["up"])),u[1]||(u[1]=ft(fe(d=>f(r).handleDecrease(),["prevent"]),["down"])),u[2]||(u[2]=ft(fe(d=>f(r).handleIncrease(10),["prevent"]),["page-up"])),u[3]||(u[3]=ft(fe(d=>f(r).handleDecrease(10),["prevent"]),["page-down"])),u[4]||(u[4]=ft(fe(d=>f(r).handleMinMaxValue("min"),["prevent"]),["home"])),u[5]||(u[5]=ft(fe(d=>f(r).handleMinMaxValue("max"),["prevent"]),["end"])),u[8]||(u[8]=ft(d=>f(r).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(r).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(r).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"]))}}),Om=Em,zm=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(n){const e=n,t=["horizontal","vertical"];function i(o){return t.includes(o)}const r=k(()=>i(e.orientation)?e.orientation:"horizontal"),s=k(()=>r.value==="vertical"?e.orientation:void 0),a=k(()=>e.decorative?{role:"none"}:{"aria-orientation":s.value,role:"separator"});return(o,l)=>(v(),C(f(ne),L({as:o.as,"as-child":o.asChild,"data-orientation":r.value},a.value),{default:_(()=>[S(o.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),Im=zm,Tm=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(n){const e=n;return(t,i)=>(v(),C(Im,ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Pm=Tm;const[Qr,Rm]=Re("TabsRoot");var Dm=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(n,{emit:e}){const t=n,i=e,{orientation:r,unmountOnHide:s,dir:a}=bt(t),o=jr(a);X();const l=rt(t,"modelValue",i,{defaultValue:t.defaultValue,passive:t.modelValue===void 0}),u=z();return Rm({modelValue:l,changeModelValue:d=>{l.value=d},orientation:r,dir:o,unmountOnHide:s,activationMode:t.activationMode,baseId:vt(void 0,"reka-tabs"),tabsList:u}),(d,c)=>(v(),C(f(ne),{dir:f(o),"data-orientation":f(r),"as-child":d.asChild,as:d.as},{default:_(()=>[S(d.$slots,"default",{modelValue:f(l)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),$m=Dm;function ou(n,e){return`${n}-trigger-${e}`}function lu(n,e){return`${n}-content-${e}`}var Lm=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(n){const e=n,{forwardRef:t}=X(),i=Qr(),r=k(()=>ou(i.baseId,e.value)),s=k(()=>lu(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(Ht),{present:l.forceMount||a.value,"force-mount":""},{default:_(({present:d})=>[E(f(ne),{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":r.value,hidden:!d,tabindex:"0",style:Ft({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"]))}}),Hm=Lm,Nm=O({__name:"TabsIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n,t=Qr();X();const i=z(),r=z({size:null,position:null});_e(()=>[t.modelValue.value,t?.dir.value],async()=>{await Je(),s()},{immediate:!0}),md([t.tabsList,i],s);function s(){i.value=t.tabsList.value?.querySelector('[role="tab"][data-state="active"]'),i.value&&(t.orientation.value==="horizontal"?r.value={size:i.value.offsetWidth,position:i.value.offsetLeft}:r.value={size:i.value.offsetHeight,position:i.value.offsetTop})}return(a,o)=>typeof r.value.size=="number"?(v(),C(f(ne),L({key:0},e,{style:{"--reka-tabs-indicator-size":`${r.value.size}px`,"--reka-tabs-indicator-position":`${r.value.position}px`}}),{default:_(()=>[S(a.$slots,"default")]),_:3},16,["style"])):D("v-if",!0)}}),Vm=Nm,Um=O({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(n){const e=n,{loop:t}=bt(e),{forwardRef:i,currentElement:r}=X(),s=Qr();return s.tabsList=r,(a,o)=>(v(),C(f(Fl),{"as-child":"",orientation:f(s).orientation.value,dir:f(s).dir.value,loop:f(t)},{default:_(()=>[E(f(ne),{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"]))}}),Wm=Um,jm=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(n){const e=n,{forwardRef:t}=X(),i=Qr(),r=k(()=>ou(i.baseId,e.value)),s=k(()=>lu(i.baseId,e.value)),a=k(()=>e.value===i.modelValue.value);return(o,l)=>(v(),C(f(El),{"as-child":"",focusable:!o.disabled,active:a.value},{default:_(()=>[E(f(ne),{id:r.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]=ft(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"]))}}),Gm=jm,Km=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(n){const e=n;return X(),(t,i)=>(v(),C(f(Zr),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),Xm=Km;const uu="tooltip.open",[es,Ym]=Re("TooltipRoot");var Jm=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(n,{emit:e}){const t=n,i=e;X();const r=la(),s=k(()=>t.disableHoverableContent??r.disableHoverableContent.value),a=k(()=>t.disableClosingTrigger??r.disableClosingTrigger.value),o=k(()=>t.disabled??r.disabled.value),l=k(()=>t.delayDuration??r.delayDuration.value),u=k(()=>t.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),d=rt(t,"open",i,{defaultValue:t.defaultOpen,passive:t.open===void 0});_e(d,w=>{r.onClose&&(w?(r.onOpen(),document.dispatchEvent(new CustomEvent(uu))):r.onClose())});const c=z(!1),h=z(),p=k(()=>d.value?c.value?"delayed-open":"instant-open":"closed"),{start:m,stop:g}=gd(()=>{c.value=!0,d.value=!0},l,{immediate:!1});function y(){g(),c.value=!1,d.value=!0}function x(){g(),d.value=!1}function b(){m()}return Ym({contentId:"",open:d,stateAttribute:p,trigger:h,onTriggerChange(w){h.value=w},onTriggerEnter(){r.isOpenDelayed.value?b():y()},onTriggerLeave(){s.value?x():g()},onOpen:y,onClose:x,disableHoverableContent:s,disableClosingTrigger:a,disabled:o,ignoreNonKeyboardFocus:u}),(w,A)=>(v(),C(f($n),null,{default:_(()=>[S(w.$slots,"default",{open:f(d)})]),_:3}))}}),Zm=Jm,Qm=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(n,{emit:e}){const t=n,i=e,r=es(),{forwardRef:s}=X(),a=je(),o=k(()=>a.default?.({})),l=k(()=>{if(t.ariaLabel)return t.ariaLabel;let d="";function c(h){typeof h.children=="string"&&h.type!==yd?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(()=>{ai(window,"scroll",d=>{d.target?.contains(r.trigger.value)&&r.onClose()}),ai(window,uu,r.onClose)}),(d,c)=>(v(),C(f(In),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:c[0]||(c[0]=h=>i("escapeKeyDown",h)),onPointerDownOutside:c[1]||(c[1]=h=>{f(r).disableClosingTrigger.value&&f(r).trigger.value?.contains(h.target)&&h.preventDefault(),i("pointerDownOutside",h)}),onFocusOutside:c[2]||(c[2]=fe(()=>{},["prevent"])),onDismiss:c[3]||(c[3]=h=>f(r).onClose())},{default:_(()=>[E(f(Jr),L({ref:f(s),"data-state":f(r).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"),E(f(Rn),{id:f(r).contentId,role:"tooltip"},{default:_(()=>[ce(Z(l.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),du=Qm,eg=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(n){const t=Qt(n),{forwardRef:i,currentElement:r}=X(),{trigger:s,onClose:a}=es(),o=la(),{isPointerInTransit:l,onPointerExit:u}=Al(s,r);return o.isPointerInTransitRef=l,u(()=>{a()}),(d,c)=>(v(),C(du,L({ref:f(i)},f(t)),{default:_(()=>[S(d.$slots,"default")]),_:3},16))}}),tg=eg,ig=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(n,{emit:e}){const t=n,i=e,r=es(),s=Ce(t,i),{forwardRef:a}=X();return(o,l)=>(v(),C(f(Ht),{present:o.forceMount||f(r).open.value},{default:_(()=>[(v(),C(dn(f(r).disableHoverableContent.value?du:tg),L({ref:f(a)},f(s)),{default:_(()=>[S(o.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),ng=ig,rg=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(n){const e=n;return(t,i)=>(v(),C(f(Tn),ae(le(e)),{default:_(()=>[S(t.$slots,"default")]),_:3},16))}}),sg=rg,ag=O({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const e=n,t=es(),i=la();t.contentId||=vt(void 0,"reka-tooltip-content");const{forwardRef:r,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,x)=>(v(),C(f(Ln),{"as-child":"",reference:y.reference},{default:_(()=>[E(f(ne),L({ref:f(r),"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":""},Dn(l.value)),{default:_(()=>[S(y.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),og=ag;function Sn(n={}){const{inheritAttrs:e=!0}=n,t=ot(),i=O({setup(s,{slots:a}){return()=>{t.value=a.default}}}),r=O({inheritAttrs:e,props:n.props,setup(s,{attrs:a,slots:o}){return()=>{var l;if(!t.value)throw new Error("[VueUse] Failed to find the definition of reusable template");const u=(l=t.value)===null||l===void 0?void 0:l.call(t,{...n.props==null?lg(a):s,$slots:o});return e&&u?.length===1?u[0]:u}}});return vd({define:i,reuse:r},[i,r])}function lg(n){const e={};for(const t in n)e[_d(t)]=n[t];return e}const Ia=Ad?window:void 0;function ln(n){var e;const t=kt(n);return(e=t?.$el)!==null&&e!==void 0?e:t}function Mn(...n){const e=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),t=k(()=>{const i=qr(kt(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return wd(()=>{var i,r;return[(i=(r=t.value)===null||r===void 0?void 0:r.map(s=>ln(s)))!==null&&i!==void 0?i:[Ia].filter(s=>s!=null),qr(kt(t.value?n[1]:n[0])),qr(f(t.value?n[2]:n[1])),kt(t.value?n[3]:n[2])]},([i,r,s,a],o,l)=>{if(!i?.length||!r?.length||!s?.length)return;const u=Sd(a)?{...a}:a,d=i.flatMap(c=>r.flatMap(h=>s.map(p=>e(c,h,p,u))));l(()=>{d.forEach(c=>c())})},{flush:"post"})}function ug(){const n=ot(!1),e=ua();return e&&He(()=>{n.value=!0},e),n}function cu(n){const e=ug();return k(()=>(e.value,!!n()))}function dg(n,e,t={}){const{window:i=Ia,...r}=t;let s;const a=cu(()=>i&&"MutationObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},l=_e(k(()=>{const c=qr(kt(n)).map(ln).filter(Cd);return new Set(c)}),c=>{o(),a.value&&c.size&&(s=new MutationObserver(e),c.forEach(h=>s.observe(h,r)))},{immediate:!0,flush:"post"}),u=()=>s?.takeRecords(),d=()=>{l(),o()};return hl(d),{isSupported:a,stop:d,takeRecords:u}}function cg(n){return JSON.parse(JSON.stringify(n))}function hg(n,e,t={}){const{window:i=Ia,...r}=t;let s;const a=cu(()=>i&&"ResizeObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},l=_e(k(()=>{const d=kt(n);return Array.isArray(d)?d.map(c=>ln(c)):[ln(d)]}),d=>{if(o(),a.value&&i){s=new ResizeObserver(e);for(const c of d)c&&s.observe(c,r)}},{immediate:!0,flush:"post"}),u=()=>{o(),l()};return hl(u),{isSupported:a,stop:u}}function yo(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=e,o=ot(0),l=ot(0),u=ot(0),d=ot(0),c=ot(0),h=ot(0),p=ot(0),m=ot(0);function g(){const x=ln(n);if(!x){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 b=x.getBoundingClientRect();o.value=b.height,l.value=b.bottom,u.value=b.left,d.value=b.right,c.value=b.top,h.value=b.width,p.value=b.x,m.value=b.y}function y(){a==="sync"?g():a==="next-frame"&&requestAnimationFrame(()=>g())}return hg(n,y),_e(()=>ln(n),x=>!x&&y()),dg(n,y,{attributeFilter:["style","class"]}),r&&Mn("scroll",y,{capture:!0,passive:!0}),i&&Mn("resize",y,{passive:!0}),xd(()=>{s&&y()}),{height:o,bottom:l,left:u,right:d,top:c,width:h,x:p,y:m,update:y}}function hu(n,e,t,i={}){var r,s;const{clone:a=!1,passive:o=!1,eventName:l,deep:u=!1,defaultValue:d,shouldEmit:c}=i,h=ua(),p=t||h?.emit||(h==null||(r=h.$emit)===null||r===void 0?void 0:r.bind(h))||(h==null||(s=h.proxy)===null||s===void 0||(s=s.$emit)===null||s===void 0?void 0:s.bind(h?.proxy));let m=l;m=m||`update:${e.toString()}`;const g=b=>a?typeof a=="function"?a(b):cg(b):b,y=()=>bd(n[e])?g(n[e]):d,x=b=>{c?c(b)&&p(m,b):p(m,b)};if(o){const b=z(y());let w=!1;return _e(()=>n[e],A=>{w||(w=!0,b.value=g(A),Je(()=>w=!1))}),_e(b,A=>{!w&&(A!==n[e]||u)&&x(A)},{deep:u}),b}else return k({get(){return y()},set(b){x(b)}})}const fg=()=>Md("color-mode").value,pg=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},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},setup(n){const e=n,{t}=ki(),i=fg(),r=Te(),s=Qt(fl(e,"icon")),a=k({get(){return i.value==="dark"},set(o){i.preference=o?"dark":"light"}});return(o,l)=>(v(),C(ut,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})=>[E(Me,{class:I(u.leadingIcon({class:[e.ui?.leadingIcon,"hidden dark:inline-block"]})),name:f(r).ui.icons.dark},null,8,["class","name"]),E(Me,{class:I(u.leadingIcon({class:[e.ui?.leadingIcon,"dark:hidden"]})),name:f(r).ui.icons.light},null,8,["class","name"])]),_:1},16))}}),rr={meta:"",ctrl:"",alt:"",win:"⊞",command:"⌘",shift:"⇧",control:"⌃",option:"⌥",enter:"↵",delete:"⌦",backspace:"⌫",escape:"Esc",tab:"⇥",capslock:"⇪",arrowup:"↑",arrowright:"→",arrowdown:"↓",arrowleft:"←",pageup:"⇞",pagedown:"⇟",home:"↖",end:"↘"},mg=()=>{const n=k(()=>navigator&&navigator.userAgent&&navigator.userAgent.match(/Macintosh;/)),e=aa({meta:" ",alt:" ",ctrl:" "});He(()=>{e.meta=n.value?rr.command:"Ctrl",e.ctrl=n.value?rr.control:"Ctrl",e.alt=n.value?rr.option:"Alt"});function t(i){if(i)return["meta","alt","ctrl"].includes(i)?e[i]:rr[i]||i}return{macOS:n,getKbdKey:t}},gg=Bd(mg),yg={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"}},fu={__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(n){const e=n,{getKbdKey:t}=gg(),i=Te(),r=k(()=>ue({extend:ue(yg),...i.ui?.kbd||{}}));return(s,a)=>(v(),C(f(ne),{as:n.as,class:I(r.value({class:e.class,color:e.color,variant:e.variant,size:e.size}))},{default:_(()=>[S(s.$slots,"default",{},()=>[ce(Z(f(t)(n.value)),1)])]),_:3},8,["as","class"]))}},vg={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"}},bg={__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(n,{emit:e}){const t=n,i=e,r=je(),s=Te(),a=Ce(zt(t,"defaultOpen","open","delayDuration","disableHoverableContent","disableClosingTrigger","ignoreNonKeyboardFocus"),i),o=cn(We(()=>t.portal)),l=We(()=>zn(t.content,{side:"bottom",sideOffset:8,collisionPadding:8})),u=We(()=>t.arrow),d=k(()=>ue({extend:ue(vg),...s.ui?.tooltip||{}})({side:l.value.side}));return(c,h)=>(v(),C(f(Zm),L(f(a),{disabled:!(n.text||n.kbds?.length||r.content)||t.disabled}),{default:_(({open:p})=>[r.default||n.reference?(v(),C(f(og),L({key:0},c.$attrs,{"as-child":"",reference:n.reference,class:t.class}),{default:_(()=>[S(c.$slots,"default",{open:p})]),_:2},1040,["reference","class"])):D("",!0),E(f(sg),ae(le(f(o))),{default:_(()=>[E(f(ng),L(l.value,{"data-slot":"content",class:d.value.content({class:[!r.default&&t.class,t.ui?.content]})}),{default:_(()=>[S(c.$slots,"content",{ui:d.value},()=>[n.text?(v(),N("span",{key:0,"data-slot":"text",class:I(d.value.text({class:t.ui?.text}))},Z(n.text),3)):D("",!0),n.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(n.kbds,(m,g)=>(v(),C(fu,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)]),n.arrow?(v(),C(f(Xm),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"]))}},xg={base:"w-full max-w-(--ui-container) mx-auto px-4 sm:px-6 lg:px-8"},wg={__name:"UContainer",props:{as:{type:null,required:!1},class:{type:null,required:!1}},setup(n){const e=n,t=Te(),i=k(()=>ue({extend:ue(xg),...t.ui?.container||{}}));return(r,s)=>(v(),C(f(ne),{as:n.as,class:I(i.value({class:e.class}))},{default:_(()=>[S(r.$slots,"default")]),_:3},8,["as","class"]))}},_g={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:""},right:{content:"max-w-md"},bottom:{content:""},left:{content:"max-w-md"}},inset:{true:{content:"rounded-lg"}},transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"}}},compoundVariants:[{side:"top",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 top-4"}},{side:"top",inset:!1,class:{content:"max-h-full inset-x-0 top-0"}},{side:"right",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 right-4"}},{side:"right",inset:!1,class:{content:"w-full inset-y-0 right-0"}},{side:"bottom",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 bottom-4"}},{side:"bottom",inset:!1,class:{content:"max-h-full inset-x-0 bottom-0"}},{side:"left",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 left-4"}},{side:"left",inset:!1,class:{content:"w-full inset-y-0 left-0"}},{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]"}}]},Cg={__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"},inset:{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(n,{emit:e}){const t=n,i=e,r=je(),{t:s}=ki(),a=Te(),o=Ce(zt(t,"open","defaultOpen","modal"),i),l=cn(We(()=>t.portal)),u=We(()=>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(_g),...a.ui?.slideover||{}})({transition:t.transition,side:t.side,inset:t.inset}));return(h,p)=>(v(),C(f(ma),ae(le(f(o))),{default:_(({open:m,close:g})=>[r.default?(v(),C(f(wa),{key:0,"as-child":"",class:I(t.class)},{default:_(()=>[S(h.$slots,"default",{open:m})]),_:2},1032,["class"])):D("",!0),E(f(xa),ae(le(f(l))),{default:_(()=>[n.overlay?(v(),C(f(Or),{key:0,"data-slot":"overlay",class:I(c.value.overlay({class:t.ui?.overlay}))},null,8,["class"])):D("",!0),E(f(ba),L({"data-side":n.side,"data-slot":"content",class:c.value.content({class:[!r.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"))},Dn(d.value)),{default:_(()=>[r.content&&(n.title||r.title||n.description||r.description)?(v(),C(f(Rn),{key:0},{default:_(()=>[n.title||r.title?(v(),C(f(an),{key:0},{default:_(()=>[S(h.$slots,"title",{},()=>[ce(Z(n.title),1)])]),_:3})):D("",!0),n.description||r.description?(v(),C(f(sn),{key:1},{default:_(()=>[S(h.$slots,"description",{},()=>[ce(Z(n.description),1)])]),_:3})):D("",!0)]),_:3})):D("",!0),S(h.$slots,"content",{close:g},()=>[r.header||n.title||r.title||n.description||r.description||t.close||r.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}))},[n.title||r.title?(v(),C(f(an),{key:0,"data-slot":"title",class:I(c.value.title({class:t.ui?.title}))},{default:_(()=>[S(h.$slots,"title",{},()=>[ce(Z(n.title),1)])]),_:3},8,["class"])):D("",!0),n.description||r.description?(v(),C(f(sn),{key:1,"data-slot":"description",class:I(c.value.description({class:t.ui?.description}))},{default:_(()=>[S(h.$slots,"description",{},()=>[ce(Z(n.description),1)])]),_:3},8,["class"])):D("",!0)],2),S(h.$slots,"actions"),t.close||r.close?(v(),C(f(Ml),{key:0,"as-child":""},{default:_(()=>[S(h.$slots,"close",{ui:c.value},()=>[t.close?(v(),C(ut,L({key:0,icon:n.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),r.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))}},Ag={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"}}]},Sg={__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(n,{emit:e}){const t=n,i=e,r=je(),{t:s}=ki(),a=Te(),o=Ce(zt(t,"open","defaultOpen","modal"),i),l=cn(We(()=>t.portal)),u=We(()=>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]=x=>{x.preventDefault(),i("close:prevent")},g),{})),[c,h]=Sn(),p=k(()=>ue({extend:ue(Ag),...a.ui?.modal||{}})({transition:t.transition,fullscreen:t.fullscreen,overlay:t.overlay,scrollable:t.scrollable}));return(m,g)=>(v(),C(f(ma),ae(le(f(o))),{default:_(({open:y,close:x})=>[E(f(c),null,{default:_(()=>[E(f(ba),L({"data-slot":"content",class:p.value.content({class:[!r.default&&t.class,t.ui?.content]})},u.value,{onAfterEnter:g[0]||(g[0]=b=>i("after:enter")),onAfterLeave:g[1]||(g[1]=b=>i("after:leave"))},Dn(d.value)),{default:_(()=>[r.content&&(n.title||r.title||n.description||r.description)?(v(),C(f(Rn),{key:0},{default:_(()=>[n.title||r.title?(v(),C(f(an),{key:0},{default:_(()=>[S(m.$slots,"title",{},()=>[ce(Z(n.title),1)])]),_:3})):D("",!0),n.description||r.description?(v(),C(f(sn),{key:1},{default:_(()=>[S(m.$slots,"description",{},()=>[ce(Z(n.description),1)])]),_:3})):D("",!0)]),_:3})):D("",!0),S(m.$slots,"content",{close:x},()=>[r.header||n.title||r.title||n.description||r.description||t.close||r.close?(v(),N("div",{key:0,"data-slot":"header",class:I(p.value.header({class:t.ui?.header}))},[S(m.$slots,"header",{close:x},()=>[T("div",{"data-slot":"wrapper",class:I(p.value.wrapper({class:t.ui?.wrapper}))},[n.title||r.title?(v(),C(f(an),{key:0,"data-slot":"title",class:I(p.value.title({class:t.ui?.title}))},{default:_(()=>[S(m.$slots,"title",{},()=>[ce(Z(n.title),1)])]),_:3},8,["class"])):D("",!0),n.description||r.description?(v(),C(f(sn),{key:1,"data-slot":"description",class:I(p.value.description({class:t.ui?.description}))},{default:_(()=>[S(m.$slots,"description",{},()=>[ce(Z(n.description),1)])]),_:3},8,["class"])):D("",!0)],2),S(m.$slots,"actions"),t.close||r.close?(v(),C(f(Ml),{key:0,"as-child":""},{default:_(()=>[S(m.$slots,"close",{ui:p.value},()=>[t.close?(v(),C(ut,L({key:0,icon:n.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),r.body?(v(),N("div",{key:1,"data-slot":"body",class:I(p.value.body({class:t.ui?.body}))},[S(m.$slots,"body",{close:x})],2)):D("",!0),r.footer?(v(),N("div",{key:2,"data-slot":"footer",class:I(p.value.footer({class:t.ui?.footer}))},[S(m.$slots,"footer",{close:x})],2)):D("",!0)])]),_:2},1040,["class"])]),_:2},1024),r.default?(v(),C(f(wa),{key:0,"as-child":"",class:I(t.class)},{default:_(()=>[S(m.$slots,"default",{open:y})]),_:2},1032,["class"])):D("",!0),E(f(xa),ae(le(f(l))),{default:_(()=>[n.scrollable?(v(),C(f(Or),{key:0,"data-slot":"overlay",class:I(p.value.overlay({class:t.ui?.overlay}))},{default:_(()=>[E(f(h))]),_:1},8,["class"])):(v(),N(xe,{key:1},[n.overlay?(v(),C(f(Or),{key:0,"data-slot":"overlay",class:I(p.value.overlay({class:t.ui?.overlay}))},null,8,["class"])):D("",!0),E(f(h))],64))]),_:1},16)]),_:3},16))}};(function(){var n;try{if(typeof document<"u"){var e=document.createElement("style");e.nonce=(n=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:n.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 Mg=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Bg=n=>typeof n<"u";function qg(n){return JSON.parse(JSON.stringify(n))}function vo(n,e,t,i={}){var r,s,a;const{clone:o=!1,passive:l=!1,eventName:u,deep:d=!1,defaultValue:c,shouldEmit:h}=i,p=ua(),m=t||p?.emit||((r=p?.$emit)==null?void 0:r.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):qg(w):w,x=()=>Bg(n[e])?y(n[e]):c,b=w=>{h?h(w)&&m(g,w):m(g,w)};if(l){const w=x(),A=z(w);let q=!1;return _e(()=>n[e],M=>{q||(q=!0,A.value=y(M),Je(()=>q=!1))}),_e(A,M=>{!q&&(M!==n[e]||d)&&b(M)},{deep:d}),A}else return k({get(){return x()},set(w){b(w)}})}const[Vn,kg]=Re("DrawerRoot"),pu=new WeakMap;function Le(n,e,t=!1){if(!n||!(n instanceof HTMLElement)||!e)return;const i={};Object.entries(e).forEach(([r,s])=>{if(r.startsWith("--")){n.style.setProperty(r,s);return}i[r]=n.style[r],n.style[r]=s}),!t&&pu.set(n,i)}function Fg(n,e){if(!n||!(n instanceof HTMLElement))return;const t=pu.get(n);t&&Object.entries(t).forEach(([i,r])=>{n.style[i]=r})}function sr(n,e){const t=window.getComputedStyle(n),i=t.transform||t.webkitTransform||t.mozTransform;let r=i.match(/^matrix3d\((.+)\)$/);return r?Number.parseFloat(r[1].split(", ")[Oe(e)?13:12]):(r=i.match(/^matrix\((.+)\)$/),r?Number.parseFloat(r[1].split(", ")[Oe(e)?5:4]):null)}function Eg(n){return 8*(Math.log(n+1)-2)}function Oe(n){switch(n){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return n}}function hs(n,e){if(!n)return()=>{};const t=n.style.cssText;return Object.assign(n.style,e),()=>{n.style.cssText=t}}function Og(...n){return(...e)=>{for(const t of n)typeof t=="function"&&t(...e)}}const ve={DURATION:.5,EASE:[.32,.72,0,1]},mu=.4,zg=.25,Ig=100,gu=8,ar=16,yu=26,bo="vaul-dragging";function Tg({activeSnapPoint:n,snapPoints:e,drawerRef:t,overlayRef:i,fadeFromIndex:r,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)}),qd(()=>{typeof window<"u"&&window.removeEventListener("resize",l)});const u=k(()=>(e.value&&n.value===e.value[e.value.length-1])??null),d=k(()=>e.value&&e.value.length>0&&(r?.value||r?.value===0)&&!Number.isNaN(r?.value)&&e.value[r?.value??-1]===n.value||!e.value),c=k(()=>{var b;return((b=e.value)==null?void 0:b.findIndex(w=>w===n.value))??null}),h=k(()=>{var b;return((b=e.value)==null?void 0:b.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 b;return c.value!==null?(b=h.value)==null?void 0:b[c.value]:null}),m=b=>{var w,A,q,M;const B=((w=h.value)==null?void 0:w.findIndex(H=>H===b))??null;Je(()=>{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, ${b}px, 0)`:`translate3d(${b}px, 0, 0)`})}),h.value&&B!==h.value.length-1&&B!==r?.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"}),n.value=B!==null?((M=e.value)==null?void 0:M[B])??null:null};_e([n,h,e],()=>{var b;if(n.value){const w=((b=e.value)==null?void 0:b.findIndex(A=>A===n.value))??-1;h.value&&w!==-1&&typeof h.value[w]=="number"&&m(h.value[w])}},{immediate:!0});function g({draggedDistance:b,closeDrawer:w,velocity:A,dismissible:q}){var M,B,H;if(r.value===void 0)return;const F=a.value==="bottom"||a.value==="right"?(p.value??0)-b:(p.value??0)+b,R=c.value===r.value-1,U=c.value===0,j=b>0;if(R&&Le((M=i.value)==null?void 0:M.$el,{transition:`opacity ${ve.DURATION}s cubic-bezier(${ve.EASE.join(",")})`}),A>2&&!j){q?w():m(h.value[0]);return}if(A>2&&j&&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-F)<Math.abs(oe-F)?J:oe),Q=Oe(a.value)?window.innerHeight:window.innerWidth;if(A>mu&&Math.abs(b)<Q*.4){const oe=j?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:b}){var w;if(p.value===null)return;const A=a.value==="bottom"||a.value==="right"?p.value-b:p.value+b;(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 x(b,w){if(!e.value||typeof c.value!="number"||!h.value||r.value===void 0)return null;const A=c.value===r.value-1;if(c.value>=r.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=b/Math.abs(M);return A?1-B:B}return{isLastSnapPoint:u,shouldFade:d,getPercentageDragged:x,activeSnapPointIndex:c,onRelease:g,onDrag:y,snapPointsOffset:h}}function xo(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}let vn=null;function Pg(n){const{isOpen:e,modal:t,nested:i,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:a}=n,o=z(typeof window<"u"?window.location.href:""),l=z(0);function u(){if(xo()&&vn===null&&e.value&&!a.value){vn={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(xo()&&vn!==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,vn),window.requestAnimationFrame(()=>{if(s.value&&o.value!==window.location.href){o.value=window.location.href;return}window.scrollTo(h,c)}),vn=null}}return He(()=>{function c(){l.value=window.scrollY}c(),window.addEventListener("scroll",c),qi(()=>{window.removeEventListener("scroll",c)})}),_e([e,r,o],()=>{i.value||!r.value||(e.value?(window.matchMedia("(display-mode: standalone)").matches||u(),t.value||setTimeout(()=>{d()},500)):d())}),{restorePositionSetting:d}}function Rg(n,e){return n&&n.value?n:e}function Dg(n){const{emitDrag:e,emitRelease:t,emitClose:i,emitOpenChange:r,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:x,preventScrollRestoration:b}=n,w=z(s.value??!1),A=z(!1),q=z(!1),M=z(!1),B=z(null),H=z(null),F=z(null),R=z(null),U=z(null),j=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=Rg(n.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:gn,snapPointsOffset:Yu,onDrag:Ju,shouldFade:$a,getPercentageDragged:Zu}=Tg({snapPoints:Y,activeSnapPoint:p,drawerRef:J,fadeFromIndex:m,overlayRef:B,onSnapPointChange:Qu,direction:g});function Qu(ie,Ae){Y.value&&ie===Ae.length-1&&(H.value=new Date)}Pg({isOpen:w,modal:l,nested:o,hasBeenOpened:A,noBodyStyles:y,preventScrollRestoration:b});function Yn(){return(window.innerWidth-yu)/window.innerWidth}function La(ie,Ae){var Pe;if(!ie)return!1;let ge=ie;const Ne=(Pe=window.getSelection())==null?void 0:Pe.toString(),Ze=J.value?sr(J.value.$el,g.value):null,xt=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&&xt.getTime()-H.value.getTime()<500)return!1;if(Ze!==null&&(g.value==="bottom"?Ze>0:Ze<0))return!0;if(Ne&&Ne.length>0)return!1;if(U.value&&xt.getTime()-U.value.getTime()<c.value&&Ze===0||Ae)return U.value=xt,!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 ed(ie){!a.value&&!Y.value||J.value&&!J.value.$el.contains(ie.target)||(q.value=!0,F.value=new Date,ie.target.setPointerCapture(ie.pointerId),Q.value=Oe(g.value)?ie.clientY:ie.clientX)}function td(ie){var Ae,Pe,ge,Ne,Ze,xt;if(J.value&&q.value){const zi=g.value==="bottom"||g.value==="right"?1:-1,Jn=(Q.value-(Oe(g.value)?ie.clientY:ie.clientX))*zi,Zn=Jn>0,Na=Y.value&&!a.value&&!Zn;if(Na&&ye.value===0)return;const ns=Math.abs(Jn),Va=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");let mi=ns/ee.value;const Ua=Zu(ns,Zn);if(Ua!==null&&(mi=Ua),Na&&mi>=1||!j.value&&!La(ie.target,Zn))return;if((Ae=J?.value)==null||Ae.$el.classList.add(bo),j.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&&Ju({draggedDistance:Jn}),Zn&&!Y.value){const gi=Eg(Jn),Qn=Math.min(gi*-1,0)*zi;Le((Ne=J.value)==null?void 0:Ne.$el,{transform:Oe(g.value)?`translate3d(0, ${Qn}px, 0)`:`translate3d(${Qn}px, 0, 0)`});return}const ad=1-mi;if(($a.value||m.value&&ye.value===m.value-1)&&(e(mi),Le((Ze=B.value)==null?void 0:Ze.$el,{opacity:`${ad}`,transition:"none"},!0)),Va&&B.value&&u.value){const gi=Math.min(Yn()+mi*(1-Yn()),1),Qn=8-mi*8,Wa=Math.max(0,14-mi*14);Le(Va,{borderRadius:`${Qn}px`,transform:Oe(g.value)?`scale(${gi}) translate3d(0, ${Wa}px, 0)`:`scale(${gi}) translate3d(${Wa}px, 0, 0)`,transition:"none"},!0)}if(!Y.value){const gi=ns*zi;Le((xt=J.value)==null?void 0:xt.$el,{transform:Oe(g.value)?`translate3d(0, ${gi}px, 0)`:`translate3d(${gi}px, 0, 0)`})}}}function Ha(){var ie;if(!J.value)return;const Ae=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]"),Pe=sr(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:`${gu}px`,overflow:"hidden",...Oe(g.value)?{transform:`scale(${Yn()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Yn()}) 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 yn(ie){J.value&&(i(),ie||(w.value=!1),window.setTimeout(()=>{Y.value&&(p.value=Y.value[0])},ve.DURATION*1e3))}yt(()=>{if(!w.value&&u.value&&Mg){const ie=setTimeout(()=>{Fg(document.body)},200);return()=>clearTimeout(ie)}}),_e(s,()=>{w.value=s.value,s.value||yn()});function id(ie){if(!q.value||!J.value)return;J.value.$el.classList.remove(bo),j.value=!1,q.value=!1,R.value=new Date;const Ae=sr(J.value.$el,g.value);if(!La(ie.target,!1)||!Ae||Number.isNaN(Ae)||F.value===null)return;const Pe=R.value.getTime()-F.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 xt=g.value==="bottom"||g.value==="right"?1:-1;gn({draggedDistance:ge*xt,closeDrawer:yn,velocity:Ne,dismissible:a.value}),t(!0);return}if(g.value==="bottom"||g.value==="right"?ge>0:ge<0){Ha(),t(!0);return}if(Ne>mu){yn(),t(!1);return}const Ze=Math.min(J.value.$el.getBoundingClientRect().height??0,window.innerHeight);if(Ae>=Ze*h.value){yn(),t(!1);return}t(!0),Ha()}_e(w,ie=>{ie&&(H.value=new Date),r(ie)},{immediate:!0});function nd(ie){var Ae,Pe;const ge=ie?(window.innerWidth-ar)/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 Ze,xt;const zi=sr((Ze=J.value)==null?void 0:Ze.$el,g.value);Le((xt=J.value)==null?void 0:xt.$el,{transition:"none",transform:Oe(g.value)?`translate3d(0, ${zi}px, 0)`:`translate3d(${zi}px, 0, 0)`})},500))}function rd(ie){var Ae;if(ie<0)return;const Pe=Oe(g.value)?window.innerHeight:window.innerWidth,ge=(Pe-ar)/Pe,Ne=ge+ie*(1-ge),Ze=-16+ie*ar;Le((Ae=J.value)==null?void 0:Ae.$el,{transform:Oe(g.value)?`scale(${Ne}) translate3d(0, ${Ze}px, 0)`:`scale(${Ne}) translate3d(${Ze}px, 0, 0)`,transition:"none"})}function sd(ie){var Ae;const Pe=Oe(g.value)?window.innerHeight:window.innerWidth,ge=ie?(Pe-ar)/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:F,isAllowedToDrag:j,snapPoints:Y,activeSnapPoint:p,hasSnapPoints:he,pointerStart:Q,dismissible:a,snapPointsOffset:Yu,direction:g,shouldFade:$a,fadeFromIndex:m,shouldScaleBackground:u,setBackgroundColorOnScale:d,onPress:ed,onDrag:td,onRelease:id,closeDrawer:yn,onNestedDrag:rd,onNestedRelease:sd,onNestedOpenChange:nd,emitClose:i,emitDrag:e,emitRelease:t,emitOpenChange:r,nested:o,handleOnly:x,noBodyStyles:y}}const vu=O({__name:"DrawerRoot",props:{activeSnapPoint:{default:void 0},closeThreshold:{default:zg},shouldScaleBackground:{type:Boolean,default:void 0},setBackgroundColorOnScale:{type:Boolean,default:!0},scrollLockTimeout:{default:Ig},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(n,{expose:e,emit:t}){const i=n,r=t;je();const s=k(()=>i.fadeFromIndex??(i.snapPoints&&i.snapPoints.length-1)),a=vo(i,"open",r,{defaultValue:i.defaultOpen,passive:i.open===void 0}),o=vo(i,"activeSnapPoint",r,{passive:i.activeSnapPoint===void 0}),l={emitDrag:m=>r("drag",m),emitRelease:m=>r("release",m),emitClose:()=>r("close"),emitOpenChange:m=>{r("update:open",m),setTimeout(()=>{r("animationEnd",m)},ve.DURATION*1e3)}},{closeDrawer:u,hasBeenOpened:d,modal:c,isOpen:h}=kg(Dg({...l,...bt(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(ma),{open:f(h),modal:f(c),"onUpdate:open":p},{default:_(()=>[S(m.$slots,"default",{open:f(h)})]),_:3},8,["open","modal"]))}}),$g=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(n,{emit:e}){const t=n,i=e,{onNestedDrag:r,onNestedOpenChange:s,onNestedRelease:a}=Vn();function o(){s(!1)}function l(c){r(c)}function u(c){c&&s(c),i("update:open",c)}const d=Ce(t,i);return(c,h)=>(v(),C(vu,L(f(d),{nested:"",onClose:o,onDrag:l,onRelease:f(a),"onUpdate:open":u}),{default:_(()=>[S(c.$slots,"default")]),_:3},16,["onRelease"]))}}),Lg=O({__name:"DrawerOverlay",setup(n){const{overlayRef:e,hasSnapPoints:t,isOpen:i,shouldFade:r}=Vn();return(s,a)=>(v(),C(f(Or),{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(r)?"true":"false"},null,8,["data-vaul-snap-points","data-vaul-snap-points-overlay"]))}}),Hg=()=>()=>{};function Ng(){const{direction:n,isOpen:e,shouldScaleBackground:t,setBackgroundColorOnScale:i,noBodyStyles:r}=Vn(),s=z(null),a=z(document.body.style.backgroundColor);function o(){return(window.innerWidth-yu)/window.innerWidth}yt(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;Og(i.value&&!r.value?hs(document.body,{background:"black"}):Hg,hs(u,{transformOrigin:Oe(n.value)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ve.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ve.EASE.join(",")})`}));const d=hs(u,{borderRadius:`${gu}px`,overflow:"hidden",...Oe(n.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 Vg=O({__name:"DrawerContent",setup(n){const{open:e,isOpen:t,snapPointsOffset:i,hasSnapPoints:r,drawerRef:s,onPress:a,onDrag:o,onRelease:l,modal:u,emitOpenChange:d,dismissible:c,keyboardIsOpen:h,closeDrawer:p,direction:m,handleOnly:g}=Vn();Ng();const y=z(!1),x=k(()=>i.value&&i.value.length>0?`${i.value[0]}px`:"0");function b(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 yt(()=>{r.value&&window.requestAnimationFrame(()=>{y.value=!0})}),(q,M)=>(v(),C(f(ba),{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(r)?"true":"false",style:Ft({"--snap-point-height":x.value}),onPointerdown:w,onPointermove:A,onPointerup:f(l),onPointerDownOutside:b,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"]))}}),Ug=["data-vaul-drawer-visible"],Wg={"data-vaul-handle-hitarea":"","aria-hidden":"true"},jg=250,Gg=120,Kg=O({__name:"DrawerHandle",props:{preventCycle:{type:Boolean,default:!1}},setup(n){const e=n,{onPress:t,onDrag:i,handleRef:r,handleOnly:s,isOpen:a,snapPoints:o,activeSnapPoint:l,isDragging:u,dismissible:d,closeDrawer:c}=Vn(),h=z(null),p=z(!1);function m(){if(p.value){x();return}window.setTimeout(()=>{g()},Gg)}function g(){if(u.value||e.preventCycle||p.value){x();return}if(x(),!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},jg)}function x(){h.value&&window.clearTimeout(h.value),p.value=!1}function b(A){s.value&&t(A),y()}function w(A){s.value&&i(A)}return(A,q)=>(v(),N("div",{ref_key:"handleRef",ref:r,"data-vaul-drawer-visible":f(a)?"true":"false","data-vaul-handle":"","aria-hidden":"true",onClick:m,onPointercancel:x,onPointerdown:b,onPointermove:w},[T("span",Wg,[S(A.$slots,"default")])],40,Ug))}}),Xg={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"}}]},Yg={__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(n,{emit:e}){const t=n,i=e,r=je(),s=Te(),a=Ce(zt(t,"activeSnapPoint","closeThreshold","shouldScaleBackground","setBackgroundColorOnScale","scrollLockTimeout","fixed","dismissible","modal","open","defaultOpen","nested","direction","noBodyStyles","handleOnly","preventScrollRestoration","snapPoints"),i),o=cn(We(()=>t.portal)),l=We(()=>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(Xg),...s.ui?.drawer||{}})({direction:t.direction,inset:t.inset,snapPoints:t.snapPoints&&t.snapPoints.length>0}));return(c,h)=>(v(),C(dn(n.nested?f($g):f(vu)),ae(le(f(a))),{default:_(()=>[r.default?(v(),C(f(wa),{key:0,"as-child":"",class:I(t.class)},{default:_(()=>[S(c.$slots,"default")]),_:3},8,["class"])):D("",!0),E(f(xa),ae(le(f(o))),{default:_(()=>[n.overlay?(v(),C(f(Lg),{key:0,"data-slot":"overlay",class:I(d.value.overlay({class:t.ui?.overlay}))},null,8,["class"])):D("",!0),E(f(Vg),L({"data-slot":"content",class:d.value.content({class:[!r.default&&t.class,t.ui?.content]})},l.value,Dn(u.value)),{default:_(()=>[n.handle?(v(),C(f(Kg),{key:0,"data-slot":"handle",class:I(d.value.handle({class:t.ui?.handle}))},null,8,["class"])):D("",!0),r.content&&(n.title||r.title||n.description||r.description)?(v(),C(f(Rn),{key:1},{default:_(()=>[n.title||r.title?(v(),C(f(an),{key:0},{default:_(()=>[S(c.$slots,"title",{},()=>[ce(Z(n.title),1)])]),_:3})):D("",!0),n.description||r.description?(v(),C(f(sn),{key:1},{default:_(()=>[S(c.$slots,"description",{},()=>[ce(Z(n.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}))},[r.header||n.title||r.title||n.description||r.description?(v(),N("div",{key:0,"data-slot":"header",class:I(d.value.header({class:t.ui?.header}))},[S(c.$slots,"header",{},()=>[n.title||r.title?(v(),C(f(an),{key:0,"data-slot":"title",class:I(d.value.title({class:t.ui?.title}))},{default:_(()=>[S(c.$slots,"title",{},()=>[ce(Z(n.title),1)])]),_:3},8,["class"])):D("",!0),n.description||r.description?(v(),C(f(sn),{key:1,"data-slot":"description",class:I(d.value.description({class:t.ui?.description}))},{default:_(()=>[S(c.$slots,"description",{},()=>[ce(Z(n.description),1)])]),_:3},8,["class"])):D("",!0)])],2)):D("",!0),r.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),r.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))}},Jg={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"}}}},Zg=Object.assign({inheritAttrs:!1},{__name:"UHeader",props:Fr({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(n){const e=n,t=je(),i=da(n,"open",{type:Boolean,default:!1}),r=kd(),{t:s}=ki(),a=Te(),[o,l]=Sn(),[u,d]=Sn(),[c,h]=Sn(),p=k(()=>(t.title&&Fd(t.title())||e.title||"Nuxt UI").trim());_e(()=>r.fullPath,()=>{i.value=!1});const m=k(()=>ue({extend:ue(Jg),...a.ui?.header||{}})()),g=k(()=>({slideover:Cg,modal:Sg,drawer:Yg})[e.mode]),y=We(()=>zn(e.menu,{content:{onOpenAutoFocus:b=>b.preventDefault()}},e.mode==="modal"?{fullscreen:!0,transition:!1}:{}));function x(){i.value=!i.value}return(b,w)=>(v(),N(xe,null,[E(f(c),null,{default:_(()=>[S(b.$slots,"toggle",{open:i.value,toggle:x,ui:m.value},()=>[n.toggle?(v(),C(ut,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 n.toggle=="object"?n.toggle:{},{"data-slot":"toggle",class:m.value.toggle({class:e.ui?.toggle,toggleSide:n.toggleSide}),onClick:x}),null,16,["aria-label","icon","class"])):D("",!0)])]),_:3}),E(f(o),null,{default:_(()=>[T("div",{"data-slot":"left",class:I(m.value.left({class:e.ui?.left}))},[n.toggleSide==="left"?(v(),C(f(h),{key:0})):D("",!0),S(b.$slots,"left",{},()=>[E(pl,{to:n.to,"aria-label":p.value,"data-slot":"title",class:I(m.value.title({class:e.ui?.title}))},{default:_(()=>[S(b.$slots,"title",{},()=>[ce(Z(n.title),1)])]),_:3},8,["to","aria-label","class"])])],2)]),_:3}),E(f(u),null,{default:_(()=>[T("div",{"data-slot":"right",class:I(m.value.right({class:e.ui?.right}))},[S(b.$slots,"right"),n.toggleSide==="right"?(v(),C(f(h),{key:0})):D("",!0)],2)]),_:3}),E(f(ne),L({as:n.as},b.$attrs,{"data-slot":"root",class:m.value.root({class:[e.ui?.root,e.class]})}),{default:_(()=>[S(b.$slots,"top"),E(wg,{"data-slot":"container",class:I(m.value.container({class:e.ui?.container}))},{default:_(()=>[E(f(l)),T("div",{"data-slot":"center",class:I(m.value.center({class:e.ui?.center}))},[S(b.$slots,"default")],2),E(f(d))]),_:3},8,["class"]),S(b.$slots,"bottom")]),_:3},16,["as","class"]),E(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(b.$slots,"content",ae(le(A)),()=>[n.mode!=="drawer"?(v(),N("div",{key:0,"data-slot":"header",class:I(m.value.header({class:e.ui?.header}))},[E(f(l)),E(f(d))],2)):D("",!0),T("div",{"data-slot":"body",class:I(m.value.body({class:e.ui?.body}))},[S(b.$slots,"body")],2)])]),_:3},16,["open","title","description","ui"])],64))}}),Qg=Ed("/logo.svg"),ey={};function ty(n,e){const t=pg,i=ut,r=bg,s=Zg;return v(),C(s,null,{title:_(()=>[...e[0]||(e[0]=[T("div",{class:"flex items-center"},[T("img",{src:Qg,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:_(()=>[E(t),E(r,{text:"Open on GitHub",kbds:["meta","G"]},{default:_(()=>[E(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 iy=Object.assign(ml(ey,[["render",ty]]),{__name:"TheHeader"}),ny={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"}},fi={__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(n){const e=n,t=je(),i=Te(),{orientation:r,size:s}=ca(e),{isLeading:a,isTrailing:o,leadingIconName:l,trailingIconName:u}=gl(e),d=k(()=>ue({extend:ue(ny),...i.ui?.badge||{}})({color:e.color,variant:e.variant,size:s.value||e.size,square:e.square||!t.default&&!e.label,fieldGroup:r.value}));return(c,h)=>(v(),C(f(ne),{as:n.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"])):n.avatar?(v(),C(hn,L({key:1,size:e.ui?.leadingAvatarSize||d.value.leadingAvatarSize()},n.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},()=>[n.label!==void 0&&n.label!==null?(v(),N("span",{key:0,"data-slot":"label",class:I(d.value.label({class:e.ui?.label}))},Z(n.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"]))}},ry={class:"font-mono text-xs"},sy={key:1,class:"mr-1 w-4 h-4"},ay={class:"flex items-center gap-2 flex-1 min-w-0"},oy={class:"text-gray-700 font-medium"},ly=O({__name:"TreeGraph",props:{item:{},level:{default:0}},emits:["select-object"],setup(n,{emit:e}){const t=n,i=e,r=z(t.item.defaultExpanded??!1),s=()=>{r.value=!r.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=fi,p=bu;return v(),N("div",ry,[T("div",{style:Ft(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"])},[E(c,{name:f(r)?"i-tabler:caret-down-filled":"i-tabler:caret-right-filled",class:"w-3 h-3 text-gray-400"},null,8,["name"])])):(v(),N("div",sy)),T("div",ay,[E(c,{name:n.item.icon,class:"w-4 h-4 text-gray-600 flex-shrink-0"},null,8,["name"]),T("span",oy,Z(n.item.label),1),n.item.name?(v(),C(h,{key:0,color:"primary",size:"sm",variant:"soft"},{default:_(()=>[ce(Z(n.item.name),1)]),_:1})):D("",!0),n.item.memorySize>0?(v(),C(h,{key:1,color:"warning",size:"sm",variant:"soft"},{default:_(()=>[ce(Z(n.item.memorySize)+" KB ",1)]),_:1})):D("",!0)])],4),f(o)&&f(r)?(v(!0),N(xe,{key:0},Xe(n.item.children,m=>(v(),C(p,{key:m.key,item:m,level:n.level+1,onSelectObject:d[0]||(d[0]=g=>i("select-object",g))},null,8,["item","level"]))),128)):D("",!0)])}}}),bu=Object.assign(ly,{__name:"TreeGraph"}),uy={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"}},xu={__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(n,{emit:e}){const t=n,i=e,r=je(),{t:s}=ki(),a=Te(),o=k(()=>ue({extend:ue(uy),...a.ui?.alert||{}})({color:t.color,variant:t.variant,orientation:t.orientation,title:!!t.title||!!r.title}));return(l,u)=>(v(),C(f(ne),{as:n.as,"data-orientation":n.orientation,"data-slot":"root",class:I(o.value.root({class:[t.ui?.root,t.class]}))},{default:_(()=>[S(l.$slots,"leading",{ui:o.value},()=>[n.avatar?(v(),C(hn,L({key:0,size:t.ui?.avatarSize||o.value.avatarSize()},n.avatar,{"data-slot":"avatar",class:o.value.avatar({class:t.ui?.avatar})}),null,16,["size","class"])):n.icon?(v(),C(Me,{key:1,name:n.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}))},[n.title||r.title?(v(),N("div",{key:0,"data-slot":"title",class:I(o.value.title({class:t.ui?.title}))},[S(l.$slots,"title",{},()=>[ce(Z(n.title),1)])],2)):D("",!0),n.description||r.description?(v(),N("div",{key:1,"data-slot":"description",class:I(o.value.description({class:t.ui?.description}))},[S(l.$slots,"description",{},()=>[ce(Z(n.description),1)])],2)):D("",!0),n.orientation==="vertical"&&(n.actions?.length||r.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(n.actions,(d,c)=>(v(),C(ut,L({key:c,size:"xs"},{ref_for:!0},d),null,16))),128))])],2)):D("",!0)],2),n.orientation==="horizontal"&&(n.actions?.length||r.actions)||n.close?(v(),N("div",{key:0,"data-slot":"actions",class:I(o.value.actions({class:t.ui?.actions,orientation:"horizontal"}))},[n.orientation==="horizontal"&&(n.actions?.length||r.actions)?S(l.$slots,"actions",{key:0},()=>[(v(!0),N(xe,null,Xe(n.actions,(d,c)=>(v(),C(ut,L({key:c,size:"xs"},{ref_for:!0},d),null,16))),128))]):D("",!0),S(l.$slots,"close",{ui:o.value},()=>[n.close?(v(),C(ut,L({key:0,icon:n.closeIcon||f(a).ui.icons.close,color:"neutral",variant:"link","aria-label":f(s)("alert.close")},typeof n.close=="object"?n.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"]))}},dy={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"}},wu=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(n,{expose:e,emit:t}){const i=n,r=t,s=hu(i,"modelValue",r,{defaultValue:i.defaultValue}),{t:a}=ki(),o=Te(),l=Ce(zt(i,"as","defaultValue","min","max","step","stepSnapping","formatOptions","disableWheelChange","invertWheelChange","readonly"),r),{emitFormBlur:u,emitFormFocus:d,emitFormChange:c,emitFormInput:h,id:p,color:m,size:g,name:y,highlight:x,disabled:b,ariaAttrs:w}=ha(i),{orientation:A,size:q}=ca(i),M=k(()=>q.value||g.value),B=k(()=>ue({extend:ue(dy),...o.ui?.inputNumber||{}})({color:m.value,variant:i.variant,size:M.value,highlight:x.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)),F=k(()=>i.decrementIcon||(i.orientation==="horizontal"?o.ui.icons.minus:o.ui.icons.chevronDown)),R=yl("inputRef");function U(Q){i.modelModifiers?.optional&&(Q=Q??void 0);const oe=new Event("change",{target:{value:Q}});r("change",oe),c(),h()}function j(Q){u(),r("blur",Q)}function te(){i.autofocus&&R.value?.$el?.focus()}return He(()=>{setTimeout(()=>{te()},i.autofocusDelay)}),e({inputRef:We(()=>R.value?.$el)}),(Q,oe)=>(v(),C(f(Mm),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(b),"onUpdate:modelValue":U}),{default:_(()=>[E(f(Om),L({...Q.$attrs,...f(w)},{ref_key:"inputRef",ref:R,placeholder:n.placeholder,required:n.required,"data-slot":"base",class:B.value.base({class:i.ui?.base}),onBlur:j,onFocus:f(d)}),null,16,["placeholder","required","class","onFocus"]),n.increment?(v(),N("div",{key:0,"data-slot":"increment",class:I(B.value.increment({class:i.ui?.increment}))},[E(f(Fm),{"as-child":"",disabled:f(b)||n.incrementDisabled},{default:_(()=>[S(Q.$slots,"increment",{},()=>[E(ut,L({icon:H.value,color:f(m),size:n.size,variant:"link","aria-label":f(a)("inputNumber.increment")},typeof n.increment=="object"?n.increment:void 0),null,16,["icon","color","size","aria-label"])])]),_:3},8,["disabled"])],2)):D("",!0),n.decrement?(v(),N("div",{key:1,"data-slot":"decrement",class:I(B.value.decrement({class:i.ui?.decrement}))},[E(f(qm),{"as-child":"",disabled:f(b)||n.decrementDisabled},{default:_(()=>[S(Q.$slots,"decrement",{},()=>[E(ut,L({icon:F.value,color:f(m),size:n.size,variant:"link","aria-label":f(a)("inputNumber.decrement")},typeof n.decrement=="object"?n.decrement:void 0),null,16,["icon","color","size","aria-label"])])]),_:3},8,["disabled"])],2)):D("",!0)]),_:3},16,["id","model-value","class","name","disabled"]))}}),cy=O({__name:"EditableNumber",props:{modelValue:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=e,r=z(!1),s=z(0),a=z(),o=k(()=>Number(t.modelValue).toFixed(2)),l=()=>{r.value=!0,s.value=t.modelValue},u=()=>{i("update:modelValue",s.value),r.value=!1},d=()=>{s.value=t.modelValue,r.value=!1};return(c,h)=>{const p=fi,m=wu;return r.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:[ft(u,["enter"]),ft(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}))}}}),hy=Object.assign(cy,{__name:"EditableNumber"});function fy(n){return ol()?(ll(n),!0):!1}function py(n){let e=0,t,i;const r=()=>{e-=1,i&&e<=0&&(i.stop(),t=void 0,i=void 0)};return(...s)=>(e+=1,i||(i=Od(!0),t=i.run(()=>n(...s))),fy(r),t)}const my=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const K=255,pt=100,oi=125,en=150;var W,Bt,Qe,Dr;(function(n){n.HEX="HEX",n.RGB="RGB",n.HWB="HWB",n.HSL="HSL",n.CIELab="CIELab",n.LCH="LCH",n.CMYK="CMYK"})(W||(W={})),(function(n){n.ANALOGOUS="ANALOGOUS",n.COMPLEMENTARY="COMPLEMENTARY",n.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",n.TRIADIC="TRIADIC",n.TETRADIC="TETRADIC",n.SQUARE="SQUARE"})(Bt||(Bt={})),(function(n){n.ADDITIVE="ADDITIVE",n.SUBTRACTIVE="SUBTRACTIVE"})(Qe||(Qe={})),(function(n){n.black="#000000",n.silver="#C0C0C0",n.gray="#808080",n.white="#FFFFFF",n.maroon="#800000",n.red="#FF0000",n.purple="#800080",n.fuchsia="#FF00FF",n.green="#008000",n.lime="#00FF00",n.olive="#808000",n.yellow="#FFFF00",n.navy="#000080",n.blue="#0000FF",n.teal="#008080",n.aqua="#00FFFF",n.orange="#FFA500",n.aliceblue="#F0F8FF",n.antiquewhite="#FAEBD7",n.aquamarine="#7FFFD4",n.azure="#F0FFFF",n.beige="#F5F5DC",n.bisque="#FFE4C4",n.blanchedalmond="#FFEBCD",n.blueviolet="#8A2BE2",n.brown="#A52A2A",n.burlywood="#DEB887",n.cadetblue="#5F9EA0",n.chartreuse="#7FFF00",n.chocolate="#D2691E",n.coral="#FF7F50",n.cornflowerblue="#6495ED",n.cornsilk="#FFF8DC",n.crimson="#DC143C",n.cyan="#00FFFF",n.darkblue="#00008B",n.darkcyan="#008B8B",n.darkgoldenrod="#B8860B",n.darkgray="#A9A9A9",n.darkgreen="#006400",n.darkgrey="#A9A9A9",n.darkkhaki="#BDB76B",n.darkmagenta="#8B008B",n.darkolivegreen="#556B2F",n.darkorange="#FF8C00",n.darkorchid="#9932CC",n.darkred="#8B0000",n.darksalmon="#E9967A",n.darkseagreen="#8FBC8F",n.darkslateblue="#483D8B",n.darkslategray="#2F4F4F",n.darkslategrey="#2F4F4F",n.darkturquoise="#00CED1",n.darkviolet="#9400D3",n.deeppink="#FF1493",n.deepskyblue="#00BFFF",n.dimgray="#696969",n.dimgrey="#696969",n.dodgerblue="#1E90FF",n.firebrick="#B22222",n.floralwhite="#FFFAF0",n.forestgreen="#228B22",n.gainsboro="#DCDCDC",n.ghostwhite="#F8F8FF",n.gold="#FFD700",n.goldenrod="#DAA520",n.greenyellow="#ADFF2F",n.grey="#808080",n.honeydew="#F0FFF0",n.hotpink="#FF69B4",n.indianred="#CD5C5C",n.indigo="#4B0082",n.ivory="#FFFFF0",n.khaki="#F0E68C",n.lavender="#E6E6FA",n.lavenderblush="#FFF0F5",n.lawngreen="#7CFC00",n.lemonchiffon="#FFFACD",n.lightblue="#ADD8E6",n.lightcoral="#F08080",n.lightcyan="#E0FFFF",n.lightgoldenrodyellow="#FAFAD2",n.lightgray="#D3D3D3",n.lightgreen="#90EE90",n.lightgrey="#D3D3D3",n.lightpink="#FFB6C1",n.lightsalmon="#FFA07A",n.lightseagreen="#20B2AA",n.lightskyblue="#87CEFA",n.lightslategray="#778899",n.lightslategrey="#778899",n.lightsteelblue="#B0C4DE",n.lightyellow="#FFFFE0",n.limegreen="#32CD32",n.linen="#FAF0E6",n.magenta="#FF00FF",n.mediumaquamarine="#66CDAA",n.mediumblue="#0000CD",n.mediumorchid="#BA55D3",n.mediumpurple="#9370DB",n.mediumseagreen="#3CB371",n.mediumslateblue="#7B68EE",n.mediumspringgreen="#00FA9A",n.mediumturquoise="#48D1CC",n.mediumvioletred="#C71585",n.midnightblue="#191970",n.mintcream="#F5FFFA",n.mistyrose="#FFE4E1",n.moccasin="#FFE4B5",n.navajowhite="#FFDEAD",n.oldlace="#FDF5E6",n.olivedrab="#6B8E23",n.orangered="#FF4500",n.orchid="#DA70D6",n.palegoldenrod="#EEE8AA",n.palegreen="#98FB98",n.paleturquoise="#AFEEEE",n.palevioletred="#DB7093",n.papayawhip="#FFEFD5",n.peachpuff="#FFDAB9",n.peru="#CD853F",n.pink="#FFC0CB",n.plum="#DDA0DD",n.powderblue="#B0E0E6",n.rosybrown="#BC8F8F",n.royalblue="#4169E1",n.saddlebrown="#8B4513",n.salmon="#FA8072",n.sandybrown="#F4A460",n.seagreen="#2E8B57",n.seashell="#FFF5EE",n.sienna="#A0522D",n.skyblue="#87CEEB",n.slateblue="#6A5ACD",n.slategray="#708090",n.slategrey="#708090",n.snow="#FFFAFA",n.springgreen="#00FF7F",n.steelblue="#4682B4",n.tan="#D2B48C",n.thistle="#D8BFD8",n.tomato="#FF6347",n.turquoise="#40E0D0",n.violet="#EE82EE",n.wheat="#F5DEB3",n.whitesmoke="#F5F5F5",n.yellowgreen="#9ACD32",n.rebeccapurple="#663399"})(Dr||(Dr={}));const _u=Object.keys(Dr),gy={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"]},Xs={ABGR:W.RGB,ABHW:W.HWB,ACHL:W.LCH,ACKMY:W.CMYK,AHLS:W.HSL,ALAB:W.CIELab,BGR:W.RGB,BHW:W.HWB,CHL:W.LCH,CKMY:W.CMYK,HLS:W.HSL,LAB:W.CIELab};var Bn;(function(n){n.NUMBER="number",n.BOOLEAN="boolean"})(Bn||(Bn={}));const nt={[W.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,[W.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*\)$/,[W.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*\)$/,[W.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*\)$/,[W.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*\)$/,[W.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*\)$/,[W.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*\)$/},ct={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*/},Cu=/^(?<number>-?(?:\d*\.)?\d+)(?<units>(?:deg|grad|rad|turn)?)$/,Be=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,Ys=/^0x([a-f\d]{1,2})$/i,yy=/\{(\d+)\}/g,vy=/,( +|\d+)/g,by=/ +/,xy="The provided string color doesn't have a correct format",wy="The provided color object doesn't have the proper keys or format",_y="is not a valid operation for a relative color";var Ve,ze,En;(function(n){n.NONE="none",n.DEGREES="deg",n.GRADIANS="grad",n.RADIANS="rad",n.TURNS="turn"})(Ve||(Ve={})),(function(n){n.NONE="none",n.PERCENT="percent"})(ze||(ze={})),(function(n){n.DEVICE_CMYK="device-cmyk",n.CMYK="cmyk"})(En||(En={}));const Pt={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:En.DEVICE_CMYK},be=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),pn=n=>+`${n}`.replace(Be,"$1"),it=n=>Be.test(`${n}`)?pn(n):Math.min(+n,100),or=n=>(n.length===1&&(n+=n),parseInt(n,16)),lr=n=>{const e=$(n,0).toString(16).toUpperCase();return e.length===1?`0x0${e}`:`0x${e}`},Ai=(n,e=!1)=>!e&&Be.test(n)?Math.min(K*pn(n)/100,K):Ys.test(n)?(n.length===3&&(n+=n.slice(-1)),e?$(n)/K:$(n)):Math.min(+n,e?1:K),$r=n=>Be.test(n)?re(oi*pn(n)/100,-125,oi):re(+n,-125,oi),Au=n=>Be.test(n)?re(en*pn(n)/100,-150,en):re(+n,-150,en),si=n=>Math.min(Be.test(n)?pn(n)/100:+n,1),Su=n=>[...n].sort().join("").toUpperCase(),$=(n,e=6)=>{const t=Math.pow(10,e);return Math.round(+n*t)/t},re=(n,e,t)=>Math.max(e,Math.min(n,t)),Mu=n=>180*n/Math.PI,Bu=n=>n*Math.PI/180,kr=360,gt=n=>{if(typeof n=="string"){const e=n.match(Cu).groups,t=+e.number;switch(e.units){case Ve.RADIANS:n=$(Mu(t));break;case Ve.TURNS:n=$(t*kr);break;case Ve.GRADIANS:n=$(.9*t);break;case Ve.DEGREES:default:n=t}}return(n>360||n<0)&&(n-=Math.floor(n/kr)*kr),n},me=n=>(typeof n=="string"&&(n=Be.test(n)?pn(n)/100:+n),isNaN(+n)||n>1?1:$(n)),qu=(n,e)=>{let t;switch(e){case Ve.RADIANS:t=$(Bu(n));break;case Ve.TURNS:t=$(n/kr);break;case Ve.GRADIANS:t=$(10/9*n);break;case Ve.DEGREES:case Ve.NONE:default:t=n}return t},fs=n=>`${n}`in Qe,ku=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],Cy=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],tn=ku.map((n=>n.reduce(((e,t)=>e+t),0))),ps=(n,e,t)=>(t<0&&(t+=6),t>=6&&(t-=6),$(t<1?((e-n)*t+n)*K:t<3?e*K:t<4?((e-n)*(4-t)+n)*K:n*K)),Ay=n=>n<=.04045?n/12.92:((n+.055)/1.055)**2.4,Sy=n=>n<=.0031308?12.92*n:1.055*n**(1/2.4)-.055,Fu=(n,e,t,i)=>{const r=[0,0,0],s=[n,e,t];return i.forEach(((a,o)=>{a.forEach(((l,u)=>{r[o]+=l*s[u]}))})),r},pe=(n,e,t)=>{e/=100;const i=(t/=100)<=.5?t*(e+1):t+e-t*e,r=2*t-i;return{R:ps(r,i,(n/=60)+2),G:ps(r,i,n),B:ps(r,i,n-2)}},di=(n,e,t,i=1)=>{n/=K,e/=K,t/=K,i=Math.min(i,1);const r=Math.max(n,e,t),s=Math.min(n,e,t),a=r-s;let o=0,l=0;const u=(r+s)/2;if(a!==0){switch(r){case n:o=(e-t)/a%6;break;case e:o=(t-n)/a+2;break;case t:o=(n-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}},ci=(n,e,t)=>{const i=[n/K,e/K,t/K].map(Ay),r=Fu(i[0],i[1],i[2],ku),s=((a,o,l)=>{const u=h=>h>.008856451679035631?Math.cbrt(h):h/.12841854934601665+.13793103448275862,d=u(a/tn[0]),c=u(o/tn[1]);return[116*c-16,500*(d-c),200*(c-u(l/tn[2]))]})(r[0],r[1],r[2]);return{L:s[0],a:s[1],b:s[2]}},On=(n,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[tn[0]*l(u+d),tn[1]*l(u),tn[2]*l(u-c)]})(n,e,t),r=Fu(i[0],i[1],i[2],Cy).map(Sy);return{R:re(r[0]*K,0,K),G:re(r[1]*K,0,K),B:re(r[2]*K,0,K)}},Eu=(n,e,t)=>{const i=Math.sqrt(e**2+t**2),r=Mu(Math.atan2(t,e));return{L:n,C:i,H:gt(r)}},Ou=(n,e,t)=>{const i=Bu(t);return{L:n,a:e*Math.cos(i),b:e*Math.sin(i)}},hi=(n,e,t)=>{const i=ci(n,e,t);return Eu(i.L,i.a,i.b)},Lr=(n,e,t)=>{const i=Ou(n,e,t);return On(i.L,i.a,i.b)},Bi=(n,e,t,i=1)=>({H:di(n,e,t,i).H,W:$(Math.min(n,e,t)/K*100),B:$(100*(1-Math.max(n,e,t)/K)),A:i}),Hr=(n,e,t)=>{const i=1-(t/=100)-(e/=100),r=i*(1-Math.abs(n/60%2-1));let s=0,a=0,o=0;return n<60?(s=i,a=r,o=0):n>=60&&n<120?(s=r,a=i,o=0):n>=120&&n<180?(s=0,a=i,o=r):n>=180&&n<240?(s=0,a=r,o=i):n>=240&&n<300?(s=r,a=0,o=i):n>=300&&(s=i,a=0,o=r),s+=e,a+=e,o+=e,{R:re(s*K,0,K),G:re(a*K,0,K),B:re(o*K,0,K)}},Ta=(n,e,t,i)=>({R:$(K*(1-n)*(i=1-i)),G:$(K*(1-e)*i),B:$(K*(1-t)*i)}),zu=(n,e,t)=>{n/=K,e/=K,t/=K;const i=1-Math.max(n,e,t),r=1-i,s=r&&(r-e)/r,a=r&&(r-t)/r;return{C:$(100*(r&&(r-n)/r)),M:$(100*s),Y:$(100*a),K:$(100*i)}},wo=(n,e)=>{if(n<0&&(n+=360),n>360&&(n-=360),n===360||n===0)return n;const t=[[0,120],[120,180],[180,240],[240,360]],i=[[0,60],[60,120],[120,240],[240,360]],r=e?i:t;let s=0,a=0,o=0,l=0;return(e?t:i).find(((u,d)=>n>=u[0]&&n<u[1]&&(s=u[0],a=u[1],o=r[d][0],l=r[d][1],!0))),o+(l-o)/(a-s)*(n-s)};class Iu{get rgb(){return this._rgb}}class My extends Iu{constructor(e){super();const t=e.match(nt.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:or(this._r),G:or(this._g),B:or(this._b)};this._a!==void 0&&(i.A=or(this._a)/K),this._rgb=i}}class Ie{constructor(e,t,i){this._operations=new Map([[ct.DIVISION,this._division],[ct.MULTIPLICATION,this._multiplication],[ct.SUM,this._sum],[ct.REST,this._rest]]),this._colorIndex=e;let r=t,s=0;if(Number.isNaN(+t))if(t in i)this._result=i[t];else if(ct.REGEXP.test(r))ct.REGEXP.lastIndex=0,this._result=this._getCalcValue(r,i);else{for(;ct.SCOPED.test(r)&&s<100;){if(ct.SCOPED.lastIndex=0,r=r.replace(ct.SCOPED,((a,o)=>this._calculate(o,i).toString())),ct.REGEXP.test(r)){ct.REGEXP.lastIndex=0;break}s++}this._result=this._getCalcValue(r,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(ct.REGEXP).groups.operation,r=this._calculate(i,t);if(Number.isNaN(r))throw new Error(`Invalid value for ${this._colorIndex}. ${i} ${_y}`);return r}_calculate(e,t){return this._operations.forEach(((i,r)=>{let s=0;for(;r.test(e)&&s<100;)e=e.replace(r,((a,o,l)=>i(t[o]??+o,t[l]??+l).toString())),s++})),+e}get result(){return this._result}}class ts extends Iu{get hasPercentageAlpha(){return Be.test(this._a)}}class Js extends ts{constructor(e,t){super();const i=e.match(nt.RGB).groups,{r_legacy:r,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 x=t(h),b={r:x.R,g:x.G,b:x.B,alpha:x.A??1},w=new Ie("r",p,b).result,A=new Ie("g",m,b).result,q=new Ie("b",g,b).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,b).result;M.A=Math.min(B,1)}this._rgb=M}else{this._r=r??l,this._g=s??u,this._b=a??d,this._a=o??c;const x={R:Math.min(Ai(this._r),K),G:Math.min(Ai(this._g),K),B:Math.min(Ai(this._b),K)};this._a!==void 0&&(x.A=me(this._a)),this._rgb=x}}get hasPercentageValues(){return Be.test(this._r)&&Be.test(this._g)&&Be.test(this._b)}static test(e){return nt.RGB.test(e)}}class Pa extends ts{get angleUnit(){if(this._h){const e=this._h.match(Cu).groups.units;return e===""?Ve.NONE:e}return Ve.NONE}}class Zs extends Pa{constructor(e,t){super();const i=e.match(nt.HSL).groups,{h_legacy:r,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 x=t(h),b=di(x.R,x.G,x.B,x.A),w={h:b.H,s:b.S,l:b.L,alpha:b.A},A=new Ie("h",p,w).result,q=new Ie("s",m,w).result,M=new Ie("l",g,w).result,B=pe(re(A,0,360),re(q,0,pt),re(M,0,pt));if(y){const H=new Ie("alpha",y,w).result;B.A=re(H,0,1)}this._rgb=B}else{this._h=r??l,this._s=s??u,this._l=a??d,this._a=o??c;const x=pe(gt(this._h),it(this._s),it(this._l));this._a!==void 0&&(x.A=me(this._a)),this._rgb=x}}static test(e){return nt.HSL.test(e)}}class Qs extends Pa{constructor(e,t){super();const i=e.match(nt.HWB).groups,{h:r,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=Bi(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,x=new Ie("w",d,g).result,b=new Ie("b",c,g).result,w=Hr(re(y,0,360),re(x,0,pt),re(b,0,pt));if(h){const A=new Ie("alpha",h,g).result;w.A=re(A,0,1)}this._rgb=w}else{this._h=r,this._w=s,this._b=a,this._a=o;const p=Hr(gt(this._h),it(this._w),it(this._b));this._a!==void 0&&(p.A=me(this._a)),this._rgb=p}}static test(e){return nt.HWB.test(e)}}class ea extends ts{constructor(e,t){super();const i=e.match(nt.CIELab).groups,{L:r,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=ci(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,x=new Ie("a",d,g).result,b=new Ie("b",c,g).result,w=On(re(y,0,pt),re(x,-125,oi),re(b,-125,oi));if(h){const A=new Ie("alpha",h,g).result;w.A=re(A,0,1)}this._rgb=w}else{this._L=r,this._A=s,this._B=a,this._a=o;const p=On(it(this._L),$r(this._A),$r(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 nt.CIELab.test(e)}}class ta extends Pa{constructor(e,t){super();const i=e.match(nt.LCH).groups,{l:r,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=hi(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,x=new Ie("c",d,g).result,b=new Ie("h",c,g).result,w=Lr(re(y,0,pt),re(x,-150,en),gt(b));if(h){const A=new Ie("alpha",h,g).result;w.A=re(A,0,1)}this._rgb=w}else{this._l=r,this._c=s,this._h=a,this._a=o;const p=Lr(it(this._l),Au(this._c),gt(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 nt.LCH.test(e)}}class ia extends ts{constructor(e){super();const t=e.match(nt.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=Ta(si(this._c),si(this._m),si(this._y),si(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 nt.CMYK.test(e)}}const $e=n=>typeof n=="string"?(e=>{let t;if(Object.keys(W).some((i=>{if(nt[i].test(e))return t=i,!0})),!t&&~_u.indexOf(e)&&(t=W.HEX),!t)throw new Error(xy);return t})(n):(e=>{let t,i=!1;const r=Su(Object.keys(e));if(Xs[r]&&(t=Xs[r]),t&&t===W.RGB){const s=Object.entries(e).some((o=>!Ys.test(`${o[1]}`))),a=Object.entries(e).some((o=>!(Be.test(`${o[1]}`)||!Ys.test(`${o[1]}`)&&!isNaN(+o[1])&&+o[1]<=K)));s&&a&&(i=!0),s||(t=W.HEX)}if(!t||i)throw new Error(wy);return t})(n),By={[W.HEX](n){const e=~_u.indexOf(n)?Dr[n]:n;return new My(e).rgb},[W.RGB]:n=>new Js(n,Ue).rgb,[W.HSL]:n=>new Zs(n,Ue).rgb,[W.HWB]:n=>new Qs(n,Ue).rgb,[W.CIELab]:n=>new ea(n,Ue).rgb,[W.LCH]:n=>new ta(n,Ue).rgb,[W.CMYK]:n=>new ia(n).rgb},qy={[W.HEX](n){const e={R:Ai(`${n.R}`),G:Ai(`${n.G}`),B:Ai(`${n.B}`)};return be(n,"A")&&(e.A=Math.min(Ai(`${n.A}`,!0),1)),e},[W.RGB](n){return this.HEX(n)},[W.HSL](n){const e=it(`${n.S}`),t=it(`${n.L}`),i=pe(gt(n.H),e,t);return be(n,"A")&&(i.A=me(n.A)),i},[W.HWB](n){const e=it(`${n.W}`),t=it(`${n.B}`),i=Hr(gt(n.H),e,t);return be(n,"A")&&(i.A=me(n.A)),i},[W.CIELab](n){const e=it(`${n.L}`),t=$r(`${n.a}`),i=$r(`${n.b}`),r=On(e,t,i);return be(n,"A")&&(r.A=me(n.A)),r},[W.LCH](n){const e=it(`${n.L}`),t=Au(`${n.C}`),i=gt(`${n.H}`),r=Lr(e,t,i);return be(n,"A")&&(r.A=me(n.A)),r},[W.CMYK](n){const e=si(`${n.C}`),t=si(`${n.M}`),i=si(`${n.Y}`),r=si(`${n.K}`),s=Ta(e,t,i,r);return be(n,"A")&&(s.A=me(n.A)),s}},Ue=(n,e=$e(n))=>typeof n=="string"?By[e](n):qy[e](n),we=(n,...e)=>{const t=[],i=[],r=[],s=[],a=[],o=[],l=[],u=Object.values(Ve),d=Object.values(ze),c=Object.values(En),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(vy);new Set(m).size===1&&by.test(m[0].slice(1))&&h.spacesAfterCommas++}if(Zs.test(p)){const m=new Zs(p,Ue);i.push(m.angleUnit),l.push(m.hasPercentageAlpha);continue}if(Qs.test(p)){const m=new Qs(p,Ue);i.push(m.angleUnit),l.push(m.hasPercentageAlpha);continue}if(Js.test(p)){const m=new Js(p,Ue);r.push(m.hasPercentageValues),l.push(m.hasPercentageAlpha);continue}if(ea.test(p)){const m=new ea(p,Ue);s.push(m.hasPercentageValues),l.push(m.hasPercentageAlpha);continue}if(ta.test(p)){const m=new ta(p,Ue);i.push(m.angleUnit),a.push(m.hasPercentageValues),l.push(m.hasPercentageAlpha);continue}if(ia.test(p)){const m=new ia(p);o.push(m.hasPercentageValues),p.startsWith("cmyk")&&h.cmykFunction++,l.push(m.hasPercentageAlpha)}}return{decimals:typeof n.decimals===Bn.NUMBER?n.decimals:Pt.decimals,legacyCSS:typeof n.legacyCSS===Bn.BOOLEAN?n.legacyCSS:!!(t.length&&h.legacyCSS===t.length)||Pt.legacyCSS,spacesAfterCommas:typeof n.spacesAfterCommas===Bn.BOOLEAN?n.spacesAfterCommas:!!(t.length&&h.spacesAfterCommas===t.length)||Pt.spacesAfterCommas,anglesUnit:n.anglesUnit&&u.includes(n.anglesUnit)?n.anglesUnit:new Set(i).size===1?i[0]:Pt.anglesUnit,rgbUnit:n.rgbUnit&&d.includes(n.rgbUnit)?n.rgbUnit:new Set(r).size===1&&r[0]?ze.PERCENT:Pt.rgbUnit,labUnit:n.labUnit&&d.includes(n.labUnit)?n.labUnit:new Set(s).size===1&&s[0]?ze.PERCENT:Pt.labUnit,lchUnit:n.lchUnit&&d.includes(n.lchUnit)?n.lchUnit:new Set(a).size===1&&a[0]?ze.PERCENT:Pt.lchUnit,cmykUnit:n.cmykUnit&&d.includes(n.cmykUnit)?n.cmykUnit:new Set(o).size!==1||o[0]?Pt.cmykUnit:ze.NONE,alphaUnit:n.alphaUnit&&d.includes(n.alphaUnit)?n.alphaUnit:new Set(l).size===1&&l[0]?ze.PERCENT:Pt.alphaUnit,cmykFunction:n.cmykFunction&&c.includes(n.cmykFunction)?n.cmykFunction:o.length&&o.length===h.cmykFunction?En.CMYK:Pt.cmykFunction}},na=(n,e)=>({H:$(n.H,e),S:$(n.S,e),L:$(n.L,e)}),ms=n=>n?", ":",",vi=(n,e)=>{const t=Su(Object.keys(n));return gy[Xs[t]].reduce(((i,r,s)=>{const a=n[r];return a!==void 0&&i.push(e(a,s)),i}),[])},bi=(n,e)=>n.replace(yy,((t,i)=>`${e[+i-1]}`)),An=(n,e,t=!1)=>{const{alphaUnit:i,legacyCSS:r,decimals:s}=e;return i!==ze.PERCENT||r&&!t?$(n,s):`${$(100*n,s)}%`},_o=n=>{const{anglesUnit:e,decimals:t}=n;return(i,r)=>r===0&&e!==Ve.NONE?`${$(qu(i,e),t)}${e}`:r===3?An(i,n):$(i,t)},G={[W.HEX]:n=>{const e=vi(n,(i=>(r=>{let s=$(r,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 bi(t,e)},[W.RGB]:(n,e)=>{const{decimals:t,legacyCSS:i,spacesAfterCommas:r,rgbUnit:s}=e,a=ms(r),o=vi(n,((u,d)=>s===ze.PERCENT&&d<3?`${((c,h)=>$(c/K*100,h))(u,t)}%`:d===3?An(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 bi(l,o)},[W.HSL]:(n,e)=>{const{legacyCSS:t,spacesAfterCommas:i}=e,r=ms(i),s=_o(e),a=vi(n,s),o=t?a.length===4?`hsla({1}${r}{2}%${r}{3}%${r}{4})`:`hsl({1}${r}{2}%${r}{3}%)`:a.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return bi(o,a)},[W.HWB]:(n,e)=>{const t=_o(e),i=vi(n,t),r=i.length===4?"hwb({1} {2}% {3}% / {4})":"hwb({1} {2}% {3}%)";return bi(r,i)},[W.CIELab]:(n,e)=>{const{decimals:t,labUnit:i}=e,r=vi(n,((a,o)=>{if(o===0){const l=$(it(a),t);return i===ze.PERCENT?`${l}%`:`${l}`}return o<3?i===ze.PERCENT?`${((l,u)=>$(l/oi*100,u))(a,t)}%`:$(a,t):An(a,e,!0)})),s=r.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return bi(s,r)},[W.LCH]:(n,e)=>{const{decimals:t,lchUnit:i,anglesUnit:r}=e,s=vi(n,((o,l)=>{if(l===0){const u=$(it(o),t);return i===ze.PERCENT?`${u}%`:`${u}`}return l===1?i===ze.PERCENT?`${((u,d)=>$(u/en*100,d))(o,t)}%`:$(o,t):l===2?r!==Ve.NONE?`${$(qu(o,r),t)}${r}`:$(o,t):An(o,e,!0)})),a=s.length===4?"lch({1} {2} {3} / {4})":"lch({1} {2} {3})";return bi(a,s)},[W.CMYK]:(n,e)=>{const{decimals:t,legacyCSS:i,spacesAfterCommas:r,cmykUnit:s,cmykFunction:a}=e,o=ms(r),l=vi(n,((d,c)=>s===ze.PERCENT&&c<4?`${$(d,t)}%`:c===4?An(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 bi(u,l)}},mn=(n,e,t)=>e.reduce(((i,r)=>[...i,{...n,H:t===Qe.ADDITIVE?gt(n.H+r):gt(wo(wo(n.H,!1)+r,!0))}]),[{...n}]),ky=(n,e)=>mn(n,[30,-30],e),Fy=(n,e)=>mn(n,[180],e),Ey=(n,e)=>mn(n,[150,-150],e),Oy=(n,e)=>mn(n,[120,-120],e),zy=(n,e)=>mn(n,[60,-120,180],e),Iy=(n,e)=>mn(n,[90,-90,180],e),V={[W.HEX]:n=>({R:lr(n.R),G:lr(n.G),B:lr(n.B)}),HEXA(n){const e=V.HEX(n);return e.A=be(n,"A")?lr(n.A*K):"0xFF",e},[W.RGB](n,e){const t=Ty(n,e);return be(t,"A")&&delete t.A,t},RGBA(n,e){const t=V.RGB(n,e);return t.A=be(n,"A")?$(n.A):1,t},[W.HSL](n,e){const t=di(n.R,n.G,n.B);return delete t.A,na(t,e)},HSLA(n,e){const t=V.HSL(n,e);return t.A=be(n,"A")?$(n.A,e):1,t},[W.HWB](n,e){const t=Bi(n.R,n.G,n.B);return delete t.A,((i,r)=>({H:$(i.H,r),W:$(i.W,r),B:$(i.B,r)}))(t,e)},HWBA(n,e){const t=V.HWB(n,e);return t.A=be(n,"A")?$(n.A,e):1,t},[W.CIELab]:(n,e)=>((t,i)=>({L:$(t.L,i),a:$(t.a,i),b:$(t.b,i)}))(ci(n.R,n.G,n.B),e),CIELabA(n,e){const t=V.CIELab(n,e);return t.A=be(n,"A")?$(n.A,e):1,t},[W.LCH]:(n,e)=>((t,i)=>({L:$(t.L,i),C:$(t.C,i),H:$(t.H,i)}))(hi(n.R,n.G,n.B),e),LCHA(n,e){const t=V.LCH(n,e);return t.A=be(n,"A")?$(n.A,e):1,t},[W.CMYK]:(n,e)=>((t,i)=>({C:$(t.C,i),M:$(t.M,i),Y:$(t.Y,i),K:$(t.K,i)}))(zu(n.R,n.G,n.B),e),CMYKA(n,e){const t=V.CMYK(n,e);return t.A=be(n,"A")?$(n.A,e):1,t}},ur=(n,e,t,i)=>{const r=$e(n),s=typeof n=="string",a=Ue(n,r),o=typeof n=="string"&&be(a,"A")||typeof n!="string"&&be(n,"A"),l=di(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(r){case W.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 W.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 W.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 W.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 W.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 W.LCH:return d.map((c=>{const h=pe(c.H,c.S,c.L),p=hi(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)}))}},Ri={buildHarmony(n,e,t,i){const r=$e(n),s=Ue(n,r),a=di(s.R,s.G,s.B,s.A),o=typeof n=="string"&&be(s,"A")||typeof n!="string"&&be(n,"A"),l=typeof n=="string";switch(r){case W.HEX:default:return o?this.HEXA(na(a,0),e,t,l):this.HEX(na(a,0),e,t,l);case W.HSL:return o?this.HSLA(a,e,t,l,i):this.HSL(a,e,t,l,i);case W.HWB:return o?this.HWBA(a,e,t,l,i):this.HWB(a,e,t,l,i);case W.RGB:return o?this.RGBA(a,e,t,l,i):this.RGB(a,e,t,l,i);case W.CIELab:return o?this.CIELabA(a,e,t,l,i):this.CIELab(a,e,t,l,i);case W.LCH:return o?this.LCHA(a,e,t,l,i):this.LCH(a,e,t,l,i)}},[W.HEX]:(n,e,t,i)=>e(n,t).map((r=>i?G.HEX(pe(r.H,r.S,r.L)):V.HEX(pe(r.H,r.S,r.L)))),HEXA:(n,e,t,i)=>e(n,t).map((r=>i?G.HEX({...pe(r.H,r.S,r.L),A:me(r.A)*K}):V.HEXA({...pe(r.H,r.S,r.L),A:me(r.A)}))),[W.RGB]:(n,e,t,i,r)=>e(n,t).map((s=>i?G.RGB(pe(s.H,s.S,s.L),r):V.RGB(pe(s.H,s.S,s.L),r.decimals))),RGBA:(n,e,t,i,r)=>e(n,t).map((s=>i?G.RGB({...pe(s.H,s.S,s.L),A:me(s.A)},r):V.RGBA({...pe(s.H,s.S,s.L),A:me(s.A)},r.decimals))),[W.HSL]:(n,e,t,i,r)=>e(n,t).map((s=>i?G.HSL({H:s.H,S:s.S,L:s.L},r):V.HSL(pe(s.H,s.S,s.L),r.decimals))),HSLA:(n,e,t,i,r)=>e(n,t).map((s=>i?G.HSL({...s,A:me(s.A)},r):V.HSLA({...pe(s.H,s.S,s.L),A:me(s.A)},r.decimals))),[W.HWB]:(n,e,t,i,r)=>e(n,t).map((s=>{const a=pe(s.H,s.S,s.L),o=Bi(a.R,a.G,a.B);return i?G.HWB({H:o.H,W:o.W,B:o.B},r):V.HWB(a,r.decimals)})),HWBA:(n,e,t,i,r)=>e(n,t).map((s=>{const a=pe(s.H,s.S,s.L),o=Bi(a.R,a.G,a.B);return i?G.HWB({...o,A:me(s.A)},r):V.HWBA({...a,A:me(s.A)},r.decimals)})),[W.CIELab]:(n,e,t,i,r)=>e(n,t).map((s=>{const a=pe(s.H,s.S,s.L);return i?G.CIELab(ci(a.R,a.G,a.B),r):V.CIELab(a,r.decimals)})),CIELabA:(n,e,t,i,r)=>e(n,t).map((s=>{const a=pe(s.H,s.S,s.L);return i?G.CIELab({...ci(a.R,a.G,a.B),A:me(s.A)},r):V.CIELabA({...a,A:me(s.A)},r.decimals)})),[W.LCH]:(n,e,t,i,r)=>e(n,t).map((s=>{const a=pe(s.H,s.S,s.L);return i?G.LCH(hi(a.R,a.G,a.B),r):V.LCH(a,r.decimals)})),LCHA:(n,e,t,i,r)=>e(n,t).map((s=>{const a=pe(s.H,s.S,s.L);return i?G.LCH({...hi(a.R,a.G,a.B),A:me(s.A)},r):V.LCHA({...a,A:me(s.A)},r.decimals)}))},Ji={mix(n,e){const t=n.map((a=>{const o=$e(a);return Ue(a,o)})),i=e===Qe.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),x=p-y,b=(m+y)/2,w=(g+m-y)/2,A=Math.max(x,b,w)/Math.max(p,m,g),q=isNaN(A)||A===1/0||A<=0?1:A;return{R:x/q+h,Y:b/q+h,B:w/q+h}})(a.R,a.G,a.B);return be(a,"A")&&(o.A=a.A),o})):null;function r(a){const o=e===Qe.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===Qe.ADDITIVE?{G:Math.min(h+p*d,K)}:{Y:Math.min(h+p*d,K)}}}),o)}let s;if(e===Qe.ADDITIVE)s=r(t);else{const a=r(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,x=p+g,b=2*(m-g),w=Math.max(y,x,b)/Math.max(h,p,m),A=isNaN(w)||w===1/0||w<=0?1:w;return{R:y/A+c,G:x/A+c,B:b/A+c}})(a.R,a.Y,a.B),s.A=a.A}return{R:$(s.R),G:$(s.G),B:$(s.B),A:re(s.A,0,1)}},[W.HEX](n,e,t){const i=this.mix(n,e);return delete i.A,t?G.HEX(i):V.HEX(i)},HEXA(n,e,t){const i=this.mix(n,e);return i.A=t?me(i.A)*K:me(i.A),t?G.HEX(i):V.HEXA(i)},[W.RGB](n,e,t,i){const r=this.mix(n,e);return delete r.A,t?G.RGB(r,i):V.RGB(r,i.decimals)},RGBA(n,e,t,i){const r=this.mix(n,e);return t?G.RGB(r,i):V.RGBA(r,i.decimals)},[W.HSL](n,e,t,i){const r=this.mix(n,e),s=di(r.R,r.G,r.B);return delete r.A,delete s.A,t?G.HSL(s,i):V.HSL(r,i.decimals)},HSLA(n,e,t,i){const r=this.mix(n,e),s=di(r.R,r.G,r.B,r.A);return t?G.HSL(s,i):V.HSLA(r,i.decimals)},[W.HWB](n,e,t,i){const r=this.mix(n,e),s=Bi(r.R,r.G,r.B);return delete r.A,delete s.A,t?G.HWB(s,i):V.HWB(r,i.decimals)},HWBA(n,e,t,i){const r=this.mix(n,e),s=Bi(r.R,r.G,r.B,r.A);return t?G.HWB(s,i):V.HWBA(r,i.decimals)},[W.CIELab](n,e,t,i){const r=this.mix(n,e),s=ci(r.R,r.G,r.B);return delete r.A,t?G.CIELab(s,i):V.CIELab(r,i.decimals)},CIELabA(n,e,t,i){const r=this.mix(n,e),s=ci(r.R,r.G,r.B);return be(r,"A")&&(s.A=r.A),t?G.CIELab(s,i):V.CIELabA(r,i.decimals)},[W.LCH](n,e,t,i){const r=this.mix(n,e),s=hi(r.R,r.G,r.B);return delete r.A,t?G.LCH(s,i):V.LCH(r,i.decimals)},LCHA(n,e,t,i){const r=this.mix(n,e),s=hi(r.R,r.G,r.B);return be(r,"A")&&(s.A=r.A),t?G.LCH(s,i):V.LCHA(r,i.decimals)}},Ty=(n,e)=>({R:$(n.R,e),G:$(n.G,e),B:$(n.B,e),...be(n,"A")?{A:$(n.A,e)}:{}}),et=(n,e,t,i)=>i(Ue(n,e),t),Nr=(n,e,t,i,r)=>(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(n),Ue(e),t).map((a=>r(a,i))));function qe(n){const{from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:s,cssFunction:a}=n,o=typeof i=="number"?Nr(e,t,i,r?.decimals,s):Nr(e,t,5,i?.decimals,s);return a?o.map((l=>a(l,we((typeof i=="number"?r:i)??{},e,t)))):o}function ke(n){const{colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:r,css:s}=n,a=we((typeof t=="string"?i:t)??{},...e);return r(e,typeof t=="string"?t:Qe.ADDITIVE,s,a)}const gs=(n,e,t,i)=>({[Bt.ANALOGOUS]:Ri.buildHarmony(e,ky,t,i),[Bt.COMPLEMENTARY]:Ri.buildHarmony(e,Fy,t,i),[Bt.SPLIT_COMPLEMENTARY]:Ri.buildHarmony(e,Ey,t,i),[Bt.TRIADIC]:Ri.buildHarmony(e,Oy,t,i),[Bt.TETRADIC]:Ri.buildHarmony(e,zy,t,i),[Bt.SQUARE]:Ri.buildHarmony(e,Iy,t,i)})[n],Fe=Object.fromEntries(Object.entries(Ji).map((n=>{const[e,t]=n;return[e,t.bind(Ji)]})));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=di(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateHWB(){this.hwb=Bi(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLAB(){this.lab={...ci(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateLCH(){this.lch={...hi(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=zu(this.rgb.R,this.rgb.G,this.rgb.B)}updateRGBFromHWB(){this.rgb={...Hr(this.hwb.H,this.hwb.W,this.hwb.B),A:this.rgb.A}}updateRGBFromLCH(){this.rgb={...Lr(this.lch.L,this.lch.C,this.lch.H),A:this.rgb.A}}updateRGBFromCMYK(){this.rgb={...Ta(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLAB(){this.rgb={...On(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateLCHFromLAB(){this.lch={...Eu(this.lab.L,this.lab.a,this.lab.b),A:this.lab.A}}updateLABromLCH(){this.lab={...Ou(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=re(e,0,K),this.update("rgb")}setG(e){return this.rgb.G=re(e,0,K),this.update("rgb"),this}setB(e){return this.rgb.B=re(e,0,K),this.update("rgb"),this}setH(e){return this.hsl.H=gt(e),this.update("hsl"),this}setS(e){return this.hsl.S=re(e,0,pt),this.update("hsl"),this}setL(e){return this.hsl.L=re(e,0,pt),this.update("hsl"),this}setWhiteness(e){return this.hwb.W=re(e,0,pt),this.updateRGBFromHWB(),this.update("rgb","hwb"),this}setBlackness(e){return this.hwb.B=re(e,0,pt),this.updateRGBFromHWB(),this.update("rgb","hwb"),this}setCIEL(e){return this.lab.L=re(e,0,pt),this.updateRGBFromLAB(),this.updateLCHFromLAB(),this.update("rgb","lab","lch"),this}setCIEa(e){return this.lab.a=re(e,-125,oi),this.updateRGBFromLAB(),this.updateLCHFromLAB(),this.update("rgb","lab","lch"),this}setCIEb(e){return this.lab.b=re(e,-125,oi),this.updateRGBFromLAB(),this.updateLCHFromLAB(),this.update("rgb","lab","lch"),this}setLCHL(e){return this.lch.L=re(e,0,pt),this.updateRGBFromLCH(),this.updateLABromLCH(),this.update("rgb","lab","lch"),this}setLCHC(e){return this.lch.C=re(e,0,en),this.updateRGBFromLCH(),this.updateLABromLCH(),this.update("rgb","lab","lch"),this}setLCHH(e){return this.lch.H=gt(e),this.updateRGBFromLCH(),this.updateLABromLCH(),this.update("rgb","lab","lch"),this}setA(e){const t=re(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=re(e,0,100),this.updateRGBFromCMYK(),this.update("cmyk"),this}setM(e){return this.cmyk.M=re(e,0,100),this.updateRGBFromCMYK(),this.update("cmyk"),this}setY(e){return this.cmyk.Y=re(e,0,100),this.updateRGBFromCMYK(),this.update("cmyk"),this}setK(e){return this.cmyk.K=re(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 et(e,t,0,V.HEX)}static toHEX(e){return G.HEX(Se.toHEXObject(e))}static toHEXAObject(e){const t=$e(e);return et(e,t,0,V.HEXA)}static toHEXA(e){return G.HEX(Se.toHEXAObject(e))}static toRGBObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.RGB)}static toRGB(e,t={}){const i=Se.toRGBObject(e,t),r=we(t,e);return G.RGB(i,r)}static toRGBAObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.RGBA)}static toRGBA(e,t={}){const i=Se.toRGBAObject(e,t),r=we(t,e);return G.RGB(i,r)}static toHSLObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.HSL)}static toHSL(e,t={}){const i=Se.toHSLObject(e,t),r=we(t,e);return G.HSL(i,r)}static toHSLAObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.HSLA)}static toHSLA(e,t={}){const i=Se.toHSLAObject(e,t),r=we(t,e);return G.HSL(i,r)}static toHWBObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.HWB)}static toHWB(e,t={}){const i=Se.toHWBObject(e,t),r=we(t,e);return G.HWB(i,r)}static toHWBAObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.HWBA)}static toHWBA(e,t={}){const i=Se.toHWBAObject(e,t),r=we(t,e);return G.HWB(i,r)}static toCIELabObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.CIELab)}static toCIELab(e,t={}){const i=Se.toCIELabObject(e,t),r=we(t,e);return G.CIELab(i,r)}static toCIELabAObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.CIELabA)}static toCIELabA(e,t={}){const i=Se.toCIELabAObject(e,t),r=we(t,e);return G.CIELab(i,r)}static toLCHObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.LCH)}static toLCH(e,t={}){const i=Se.toLCHObject(e,t),r=we(t,e);return G.LCH(i,r)}static toLCHAObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.LCHA)}static toLCHA(e,t={}){const i=Se.toLCHAObject(e,t),r=we(t,e);return G.LCH(i,r)}static toCMYKObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.CMYK)}static toCMYK(e,t={}){const i=Se.toCMYKObject(e,t),r=we(t,e);return G.CMYK(i,r)}static toCMYKAObject(e,t={}){const i=$e(e);return et(e,i,t.decimals,V.CMYKA)}static toCMYKA(e,t={}){const i=Se.toCMYKAObject(e,t),r=we(t,e);return G.CMYK(i,r)}static getBlendHEXObject(e,t,i=5){return Nr(e,t,i,0,V.HEX)}static getBlendHEX(e,t,i=5){return Se.getBlendHEXObject(e,t,i).map((r=>G.HEX(r)))}static getBlendHEXAObject(e,t,i=5){return Nr(e,t,i,0,V.HEXA)}static getBlendHEXA(e,t,i=5){return Se.getBlendHEXAObject(e,t,i).map((r=>G.HEX(r)))}static getBlendRGBObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.RGB})}static getBlendRGB(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.RGB,cssFunction:G.RGB})}static getBlendRGBAObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.RGBA})}static getBlendRGBA(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.RGBA,cssFunction:G.RGB})}static getBlendHSLObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.HSL})}static getBlendHSL(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.HSL,cssFunction:G.HSL})}static getBlendHSLAObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.HSLA})}static getBlendHSLA(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.HSLA,cssFunction:G.HSL})}static getBlendHWBObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.HWB})}static getBlendHWB(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.HWB,cssFunction:G.HWB})}static getBlendHWBAObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.HWBA})}static getBlendHWBA(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.HWBA,cssFunction:G.HWB})}static getBlendCIELabObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.CIELab})}static getBlendCIELab(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.CIELab,cssFunction:G.CIELab})}static getBlendCIELabAObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.CIELabA})}static getBlendCIELabA(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.CIELabA,cssFunction:G.CIELab})}static getBlendLCHObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.LCH})}static getBlendLCH(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.LCH,cssFunction:G.LCH})}static getBlendLCHAObject(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.LCHA})}static getBlendLCHA(e,t,i,r){return qe({from:e,to:t,thirdParameter:i,fourthParameter:r,translateFunction:V.LCHA,cssFunction:G.LCH})}static getMixHEXObject(e,t=Qe.ADDITIVE){return Ji.HEX(e,t,!1)}static getMixHEX(e,t=Qe.ADDITIVE){return Ji.HEX(e,t,!0)}static getMixHEXAObject(e,t=Qe.ADDITIVE){return Ji.HEXA(e,t,!1)}static getMixHEXA(e,t=Qe.ADDITIVE){return Ji.HEXA(e,t,!0)}static getMixRGBObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.RGB,css:!1})}static getMixRGB(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.RGB,css:!0})}static getMixRGBAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.RGBA,css:!1})}static getMixRGBA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.RGBA,css:!0})}static getMixHSLObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.HSL,css:!1})}static getMixHSL(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.HSL,css:!0})}static getMixHSLAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.HSLA,css:!1})}static getMixHSLA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.HSLA,css:!0})}static getMixHWBObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.HWB,css:!1})}static getMixHWB(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.HWB,css:!0})}static getMixHWBAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.HWBA,css:!1})}static getMixHWBA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.HWBA,css:!0})}static getMixCIELabObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.CIELab,css:!1})}static getMixCIELab(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.CIELab,css:!0})}static getMixCIELabAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.CIELabA,css:!1})}static getMixCIELabA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.CIELabA,css:!0})}static getMixLCHObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.LCH,css:!1})}static getMixLCH(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.LCH,css:!0})}static getMixLCHAObject(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.LCHA,css:!1})}static getMixLCHA(e,t,i){return ke({colors:e,secondParameter:t,thirdParameter:i,colorMixerFunction:Fe.LCHA,css:!0})}static getShades(e,t,i){return typeof t=="number"?ur(e,t,!0,we(i||{},e)):ur(e,5,!0,we(t||{},e))}static getTints(e,t,i){return typeof t=="number"?ur(e,t,!1,we(i||{},e)):ur(e,5,!1,we(t||{},e))}static getHarmony(e,t,i,r){return`${t}`in Bt?gs(t,e,fs(i)?i:Qe.ADDITIVE,we(fs(i)?r||{}:i||{},e)):fs(t)?gs(Bt.COMPLEMENTARY,e,t,we(i||{},e)):gs(Bt.COMPLEMENTARY,e,Qe.ADDITIVE,we(t||{},e))}}const Py={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"}},Ry=["data-disabled"],Dy=["data-disabled"];function $y(n){const e=n.S*(n.L<50?n.L:100-n.L),t=n.L+e/100;return{h:n.H,s:n.L===0?n.S:2*e/t,v:t}}function Co(n){const e=(200-n.s)*n.v/100;return{H:n.h,S:e===0||e===200?0:Math.round(n.s*n.v/(e<=100?e:200-e)),L:e/2}}const Ly={__name:"UColorPicker",props:Fr({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(n){const e=n,t=da(n,"modelValue",{type:String}),i=Te(),r=k(()=>ue({extend:ue(Py),...i.ui?.colorPicker||{}})({size:e.size})),s=k({get(){try{const M=new Se(t.value||e.defaultValue);return $y(M.HSLObject)}catch{return{h:0,s:0,v:100}}},set(M){const B=new Se(Co(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;default:t.value=B.HEX}}});function a(M,B,H="both",F={x:0,y:0},R){const U=z(F),j=z(),te=yo(M),Q=yo(B);function oe(Y){if(kt(R))return Y.preventDefault();const he=kt(B);j.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(!j.value)return;const he=kt(B);let{x:se,y:ye}=U.value;he&&(H==="x"||H==="both")&&(se=Math.min(Math.max(0,(Y.clientX-j.value.x)/he.scrollWidth*100),100)),he&&(H==="y"||H==="both")&&(ye=Math.min(Math.max(0,(Y.clientY-j.value.y)/he.scrollHeight*100),100)),U.value={x:se,y:ye}}function ee(){j.value&&(j.value=void 0)}return my&&(Mn(B,"pointerdown",oe),Mn(window,"pointermove",J),Mn(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:x}=zd(s,M=>{m.value={x:M.s,y:l(M.v)},g.value={x:0,y:o(M.h,"right")}});Id([m,g],()=>{y(),s.value={h:o(g.value.y),s:m.value.x,v:l(m.value.y)},Je(x)},{throttle:()=>e.throttle});const b=k(()=>new Se(Co({h:o(g.value.y),s:100,v:100})).HEX),w=k(()=>({backgroundColor:b.value})),A=k(()=>({backgroundColor:new Se(t.value||e.defaultValue).HEX,left:`${m.value.x}%`,top:`${m.value.y}%`})),q=k(()=>({backgroundColor:b.value,top:`${g.value.y}%`}));return(M,B)=>(v(),C(f(ne),{as:n.as,"data-slot":"root",class:I(r.value.root({class:[e.ui?.root,e.class]})),"data-disabled":p.value?!0:void 0},{default:_(()=>[T("div",{"data-slot":"picker",class:I(r.value.picker({class:e.ui?.picker}))},[T("div",{ref_key:"selectorRef",ref:u,"data-slot":"selector",class:I(r.value.selector({class:e.ui?.selector})),style:Ft(w.value)},[T("div",{"data-slot":"selectorBackground",class:I(r.value.selectorBackground({class:e.ui?.selectorBackground})),"data-color-picker-background":""},[T("div",{ref_key:"selectorThumbRef",ref:d,"data-slot":"selectorThumb",class:I(r.value.selectorThumb({class:e.ui?.selectorThumb})),style:Ft(A.value),"data-disabled":p.value?!0:void 0},null,14,Ry)],2)],6),T("div",{ref_key:"trackRef",ref:c,"data-slot":"track",class:I(r.value.track({class:e.ui?.track})),"data-color-picker-track":""},[T("div",{ref_key:"trackThumbRef",ref:h,"data-slot":"trackThumb",class:I(r.value.trackThumb({class:e.ui?.trackThumb})),style:Ft(q.value),"data-disabled":p.value?!0:void 0},null,14,Dy)],2)],2)]),_:1},8,["as","class","data-disabled"]))}},Hy=ml(Ly,[["__scopeId","data-v-97218ae2"]]),wt={Root:tu,Trigger:iu,Portal:Hp,Content:Ep,Arrow:Ql,Item:Tp,Group:zp,Separator:Gp,CheckboxItem:Bp,ItemIndicator:Rp,Label:$p,RadioGroup:Vp,RadioItem:Wp,Sub:Xp,SubContent:Jp,SubTrigger:Qp},Ny={Root:sm,Trigger:pm,Portal:hm,Content:dm,Arrow:im},Vy={Root:op,Trigger:Ap,Portal:_p,Content:xp,Arrow:cp,Close:fp,Anchor:up},Uy={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"}},Wy={__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(n,{emit:e}){const t=n,i=e,r=je(),s=Te(),a=t.mode==="hover"?zt(t,"defaultOpen","open","openDelay","closeDelay"):zt(t,"defaultOpen","open","modal"),o=Ce(a,i),l=cn(We(()=>t.portal)),u=We(()=>zn(t.content,{side:"bottom",sideOffset:8,collisionPadding:8})),d=k(()=>t.dismissible?{}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((g,y)=>(g[y]=x=>{x.preventDefault(),i("close:prevent")},g),{})),c=We(()=>t.arrow),h=k(()=>ue({extend:ue(Uy),...s.ui?.popover||{}})({side:u.value.side})),p=k(()=>t.mode==="hover"?Ny:Vy);return(m,g)=>(v(),C(f(p).Root,ae(le(f(o))),{default:_(({open:y,close:x})=>[r.default||n.reference?(v(),C(f(p).Trigger,{key:0,"as-child":"",reference:n.reference,class:I(t.class)},{default:_(()=>[S(m.$slots,"default",{open:y})]),_:2},1032,["reference","class"])):D("",!0),"Anchor"in p.value&&r.anchor?(v(),C(f(p).Anchor,{key:1,"as-child":""},{default:_(()=>[S(m.$slots,"anchor",ae(le(x?{close:x}:{})))]),_:2},1024)):D("",!0),E(f(p).Portal,ae(le(f(l))),{default:_(()=>[E(f(p).Content,L(u.value,{"data-slot":"content",class:h.value.content({class:[!r.default&&t.class,t.ui?.content]})},Dn(d.value)),{default:_(()=>[S(m.$slots,"content",ae(le(x?{close:x}:{}))),n.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))}},jy=O({__name:"EditableColor",props:{modelValue:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=e,r=z(t.modelValue),s=()=>{i("update:modelValue",r.value)};return(a,o)=>{const l=ut,u=Hy,d=Wy;return v(),C(d,{onBlur:s},{content:_(()=>[E(u,{modelValue:r.value,"onUpdate:modelValue":[o[0]||(o[0]=c=>r.value=c),s],class:"p-2"},null,8,["modelValue"])]),default:_(()=>[E(l,{label:r.value,color:"neutral",size:"xs",variant:"soft"},{leading:_(()=>[T("span",{style:Ft({backgroundColor:r.value}),class:"size-3 rounded-full"},null,4)]),_:1},8,["label"])]),_:1})}}}),Gy=Object.assign(jy,{__name:"EditableColor"}),Tu={__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(n,{emit:e}){const t=n,i=e,r=je(),{dir:s}=ki(),a=Te(),o=cn(We(()=>t.portal)),l=Ce(fl(t,"sub","items","portal","labelKey","descriptionKey","checkedIcon","loadingIcon","externalIcon","class","ui","uiOverride"),i),u=()=>bl(r,["default"]),[d,c]=Sn(),h=k(()=>s.value==="rtl"?a.ui.icons.chevronLeft:a.ui.icons.chevronRight),p=k(()=>t.items?.length?Td(t.items)?t.items:[t.items]:[]);return(m,g)=>(v(),N(xe,null,[E(f(d),null,{default:_(({item:y,active:x,index:b})=>[S(m.$slots,y.slot||"item",{item:y,index:b,ui:n.ui},()=>[S(m.$slots,y.slot?`${y.slot}-leading`:"item-leading",{item:y,active:x,index:b,ui:n.ui},()=>[y.loading?(v(),C(Me,{key:0,name:n.loadingIcon||f(a).ui.icons.loading,"data-slot":"itemLeadingIcon",class:I(n.ui.itemLeadingIcon({class:[n.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(n.ui.itemLeadingIcon({class:[n.uiOverride?.itemLeadingIcon,y.ui?.itemLeadingIcon],color:y?.color,active:x}))},null,8,["name","class"])):y.avatar?(v(),C(hn,L({key:2,size:y.ui?.itemLeadingAvatarSize||n.uiOverride?.itemLeadingAvatarSize||n.ui.itemLeadingAvatarSize()},y.avatar,{"data-slot":"itemLeadingAvatar",class:n.ui.itemLeadingAvatar({class:[n.uiOverride?.itemLeadingAvatar,y.ui?.itemLeadingAvatar],active:x})}),null,16,["size","class"])):D("",!0)]),f(Rt)(y,t.labelKey)||r[y.slot?`${y.slot}-label`:"item-label"]||f(Rt)(y,t.descriptionKey)||r[y.slot?`${y.slot}-description`:"item-description"]?(v(),N("span",{key:0,"data-slot":"itemWrapper",class:I(n.ui.itemWrapper({class:[n.uiOverride?.itemWrapper,y.ui?.itemWrapper]}))},[T("span",{"data-slot":"itemLabel",class:I(n.ui.itemLabel({class:[n.uiOverride?.itemLabel,y.ui?.itemLabel],active:x}))},[S(m.$slots,y.slot?`${y.slot}-label`:"item-label",{item:y,active:x,index:b},()=>[ce(Z(f(Rt)(y,t.labelKey)),1)]),y.target==="_blank"&&n.externalIcon!==!1?(v(),C(Me,{key:0,name:typeof n.externalIcon=="string"?n.externalIcon:f(a).ui.icons.external,"data-slot":"itemLabelExternalIcon",class:I(n.ui.itemLabelExternalIcon({class:[n.uiOverride?.itemLabelExternalIcon,y.ui?.itemLabelExternalIcon],color:y?.color,active:x}))},null,8,["name","class"])):D("",!0)],2),f(Rt)(y,t.descriptionKey)?(v(),N("span",{key:0,"data-slot":"itemDescription",class:I(n.ui.itemDescription({class:[n.uiOverride?.itemDescription,y.ui?.itemDescription]}))},[S(m.$slots,y.slot?`${y.slot}-description`:"item-description",{item:y,active:x,index:b},()=>[ce(Z(f(Rt)(y,t.descriptionKey)),1)])],2)):D("",!0)],2)):D("",!0),T("span",{"data-slot":"itemTrailing",class:I(n.ui.itemTrailing({class:[n.uiOverride?.itemTrailing,y.ui?.itemTrailing]}))},[S(m.$slots,y.slot?`${y.slot}-trailing`:"item-trailing",{item:y,active:x,index:b,ui:n.ui},()=>[y.children?.length?(v(),C(Me,{key:0,name:h.value,"data-slot":"itemTrailingIcon",class:I(n.ui.itemTrailingIcon({class:[n.uiOverride?.itemTrailingIcon,y.ui?.itemTrailingIcon],color:y?.color,active:x}))},null,8,["name","class"])):y.kbds?.length?(v(),N("span",{key:1,"data-slot":"itemTrailingKbds",class:I(n.ui.itemTrailingKbds({class:[n.uiOverride?.itemTrailingKbds,y.ui?.itemTrailingKbds]}))},[(v(!0),N(xe,null,Xe(y.kbds,(w,A)=>(v(),C(fu,L({key:A,size:y.ui?.itemTrailingKbdsSize||n.uiOverride?.itemTrailingKbdsSize||n.ui.itemTrailingKbdsSize()},{ref_for:!0},typeof w=="string"?{value:w}:w),null,16,["size"]))),128))],2)):D("",!0)]),E(f(wt).ItemIndicator,{"as-child":""},{default:_(()=>[E(Me,{name:n.checkedIcon||f(a).ui.icons.check,"data-slot":"itemTrailingIcon",class:I(n.ui.itemTrailingIcon({class:[n.uiOverride?.itemTrailingIcon,y.ui?.itemTrailingIcon],color:y?.color}))},null,8,["name","class"])]),_:2},1024)],2)])]),_:3}),E(f(wt).Portal,ae(le(f(o))),{default:_(()=>[(v(),C(dn(n.sub?f(wt).SubContent:f(wt).Content),L({"data-slot":"content",class:n.ui.content({class:[n.uiOverride?.content,t.class]})},f(l)),{default:_(()=>[S(m.$slots,"content-top",{sub:n.sub??!1}),T("div",{role:"presentation","data-slot":"viewport",class:I(n.ui.viewport({class:n.uiOverride?.viewport}))},[(v(!0),N(xe,null,Xe(p.value,(y,x)=>(v(),C(f(wt).Group,{key:`group-${x}`,"data-slot":"group",class:I(n.ui.group({class:n.uiOverride?.group}))},{default:_(()=>[(v(!0),N(xe,null,Xe(y,(b,w)=>(v(),N(xe,{key:`group-${x}-${w}`},[b.type==="label"?(v(),C(f(wt).Label,{key:0,"data-slot":"label",class:I(n.ui.label({class:[n.uiOverride?.label,b.ui?.label,b.class]}))},{default:_(()=>[E(f(c),{item:b,index:w},null,8,["item","index"])]),_:2},1032,["class"])):b.type==="separator"?(v(),C(f(wt).Separator,{key:1,"data-slot":"separator",class:I(n.ui.separator({class:[n.uiOverride?.separator,b.ui?.separator,b.class]}))},null,8,["class"])):b?.children?.length?(v(),C(f(wt).Sub,{key:2,open:b.open,"default-open":b.defaultOpen},{default:_(()=>[E(f(wt).SubTrigger,{as:"button",type:"button",disabled:b.disabled,"text-value":f(Rt)(b,t.labelKey),"data-slot":"item",class:I(n.ui.item({class:[n.uiOverride?.item,b.ui?.item,b.class],color:b?.color}))},{default:_(()=>[E(f(c),{item:b,index:w},null,8,["item","index"])]),_:2},1032,["disabled","text-value","class"]),E(Tu,L({sub:"",class:b.ui?.content,ui:n.ui,"ui-override":n.uiOverride,portal:n.portal,items:b.children,align:"start","align-offset":-4,"side-offset":3,"label-key":n.labelKey,"description-key":n.descriptionKey,"checked-icon":n.checkedIcon,"loading-icon":n.loadingIcon,"external-icon":n.externalIcon},{ref_for:!0},b.content),vl({_: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"])):b.type==="checkbox"?(v(),C(f(wt).CheckboxItem,{key:3,"model-value":b.checked,disabled:b.disabled,"text-value":f(Rt)(b,t.labelKey),"data-slot":"item",class:I(n.ui.item({class:[n.uiOverride?.item,b.ui?.item,b.class],color:b?.color})),"onUpdate:modelValue":b.onUpdateChecked,onSelect:b.onSelect},{default:_(()=>[E(f(c),{item:b,index:w},null,8,["item","index"])]),_:2},1032,["model-value","disabled","text-value","class","onUpdate:modelValue","onSelect"])):(v(),C(f(wt).Item,{key:4,"as-child":"",disabled:b.disabled,"text-value":f(Rt)(b,t.labelKey),onSelect:b.onSelect},{default:_(()=>[E(pl,L({ref_for:!0},f(Pd)(b),{custom:""}),{default:_(({active:A,...q})=>[E(Rd,L({ref_for:!0},q,{"data-slot":"item",class:n.ui.item({class:[n.uiOverride?.item,b.ui?.item,b.class],color:b?.color,active:A})}),{default:_(()=>[E(f(c),{item:b,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",{sub:n.sub??!1})]),_:3},16,["class"]))]),_:3},16)],64))}},Ky={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"}},Pu={__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(n,{emit:e}){const t=n,i=e,r=je(),s=Te(),a=Ce(zt(t,"defaultOpen","open","modal"),i),o=We(()=>zn(t.content,{side:"bottom",sideOffset:8,collisionPadding:8})),l=We(()=>t.arrow),u=()=>bl(r,["default"]),d=k(()=>ue({extend:ue(Ky),...s.ui?.dropdownMenu||{}})({size:t.size}));return(c,h)=>(v(),C(f(tu),ae(le(f(a))),{default:_(({open:p})=>[r.default?(v(),C(f(iu),{key:0,"as-child":"",class:I(t.class),disabled:n.disabled},{default:_(()=>[S(c.$slots,"default",{open:p})]),_:2},1032,["class","disabled"])):D("",!0),E(Tu,L({class:d.value.content({class:[!r.default&&t.class,t.ui?.content]}),ui:d.value,"ui-override":t.ui},o.value,{items:n.items,portal:n.portal,"label-key":n.labelKey,"description-key":n.descriptionKey,"checked-icon":n.checkedIcon,"loading-icon":n.loadingIcon,"external-icon":n.externalIcon}),vl({default:_(()=>[n.arrow?(v(),C(f(Ql),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))}},Ao=async n=>{try{await navigator.clipboard.writeText(n)}catch(e){console.error("Failed to copy path:",e)}},Ru=async n=>{try{const e=`:${n.path.replace(/\./g,"-")}="${JSON.stringify(n.value)}"`;await navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy prop:",e)}},Xy=async n=>{try{const e=n.children?.map(i=>i.value)||[],t=`:${n.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)}},Du=async n=>{try{const e=JSON.stringify(n);await navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy value:",e)}},$u=async n=>{try{if(!n.children||n.children.length<3)return;await navigator.clipboard.writeText(`new Vector3(${n.children[0].value}, ${n.children[1].value}, ${n.children[2].value})`)}catch(e){console.error("Failed to copy prop as Vector3:",e)}},Yy=async n=>{try{const t=`[${(n.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)}},Jy=async n=>{try{let e={};n.children&&n.children.length>0&&(e=n.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)}},Lu=async n=>{try{const e=n.children?.find(u=>u.label==="x"),t=n.children?.find(u=>u.label==="y"),i=n.children?.find(u=>u.label==="z"),r=n.children?.find(u=>u.label==="order"),s=e?.value||0,a=t?.value||0,o=i?.value||0,l=r?.value||"XYZ";await navigator.clipboard.writeText(`new Euler(${s}, ${a}, ${o}, '${l}')`)}catch(e){console.error("Failed to copy value as Euler:",e)}},Hu=async n=>{try{const e=n.children?.find(u=>u.label==="x"),t=n.children?.find(u=>u.label==="y"),i=n.children?.find(u=>u.label==="z"),r=n.children?.find(u=>u.label==="w"),s=e?.value||0,a=t?.value||0,o=i?.value||0,l=r?.value||1;await navigator.clipboard.writeText(`new Quaternion(${s}, ${a}, ${o}, ${l})`)}catch(e){console.error("Failed to copy value as Quaternion:",e)}};function Zy(n){let e=0,t=n;return n.scene&&(t=n.scene),t.traverse(i=>{if(i.isMesh&&i.geometry){const r=i.geometry,s=r.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,a=r.index?r.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=r.attributes.normal?r.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,l=r.attributes.uv?r.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,u=s+a+o+l;e+=u}}),e}function Qy(n){return(n/1024).toFixed(2)}const Nu="182",ra=0,ev=1,tv=2,So=1,Mo=100,Bo=204,qo=205,ko=3,iv=0,Vu=300,Fo=1e3,dr=1001,Eo=1002,nv=1006,rv=1008,sv=1009,av=1015,ov=1023,Uu="",Mt="srgb",Oo="srgb-linear",zo="linear",ys="srgb",Di=7680,Io=519,To=35044,cr=2e3,Po=2001;function lv(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Ro(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const Do={};function Ye(...n){const e="THREE."+n.shift();console.warn(e,...n)}function Ci(...n){const e="THREE."+n.shift();console.error(e,...n)}function $o(...n){const e=n.join(" ");e in Do||(Do[e]=!0,Ye(...n))}class is{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[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 Un(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(Ge[n&255]+Ge[n>>8&255]+Ge[n>>16&255]+Ge[n>>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(n,e,t){return Math.max(e,Math.min(t,n))}function uv(n,e){return(n%e+e)%e}function vs(n,e,t){return(1-t)*n+t*e}function bn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function tt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class Et{constructor(e=0,t=0){Et.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=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),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*r+e.x,this.y=s*r+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 Wn{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,a,o){let l=i[r+0],u=i[r+1],d=i[r+2],c=i[r+3],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=l*h+u*p+d*m+c*g;y<0&&(h=-h,p=-p,m=-m,g=-g,y=-y);let x=1-o;if(y<.9995){const b=Math.acos(y),w=Math.sin(b);x=Math.sin(x*b)/w,o=Math.sin(o*b)/w,l=l*x+h*o,u=u*x+p*o,d=d*x+m*o,c=c*x+g*o}else{l=l*x+h*o,u=u*x+p*o,d=d*x+m*o,c=c*x+g*o;const b=1/Math.sqrt(l*l+u*u+d*d+c*c);l*=b,u*=b,d*=b,c*=b}}e[t]=l,e[t+1]=u,e[t+2]=d,e[t+3]=c}static multiplyQuaternionsFlat(e,t,i,r,s,a){const o=i[r],l=i[r+1],u=i[r+2],d=i[r+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,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,u=o(i/2),d=o(r/2),c=o(s/2),h=l(i/2),p=l(r/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:Ye("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],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-r)*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=(r+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=(r+a)/p,this._y=.25*p,this._z=(l+d)/p}else{const p=2*Math.sqrt(1+c-i-o);this._w=(a-r)/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 r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,u=t._z,d=t._w;return this._x=i*d+a*o+r*u-s*l,this._y=r*d+a*l+s*o-i*u,this._z=s*d+a*u+i*l-r*o,this._w=a*d-i*o-r*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let i=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const u=Math.acos(o),d=Math.sin(u);l=Math.sin(l*u)/d,t=Math.sin(t*u)/d,this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class 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(Lo.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Lo.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,u=2*(a*r-o*i),d=2*(o*t-s*r),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=r+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,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=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,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*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 bs.copy(this).projectOnVector(e),this.sub(bs)}reflect(e){return this.sub(bs.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,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bs=new P,Lo=new Wn;class pi{constructor(e,t,i,r,s,a,o,l,u){pi.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,u)}set(e,t,i,r,s,a,o,l,u){const d=this.elements;return d[0]=e,d[1]=r,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,r=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=r[0],y=r[3],x=r[6],b=r[1],w=r[4],A=r[7],q=r[2],M=r[5],B=r[8];return s[0]=a*g+o*b+l*q,s[3]=a*y+o*w+l*M,s[6]=a*x+o*A+l*B,s[1]=u*g+d*b+c*q,s[4]=u*y+d*w+c*M,s[7]=u*x+d*A+c*B,s[2]=h*g+p*b+m*q,s[5]=h*y+p*w+m*M,s[8]=h*x+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],r=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+r*s*u-r*a*l}invert(){const e=this.elements,t=e[0],i=e[1],r=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+r*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]=(r*u-d*i)*g,e[2]=(o*i-r*a)*g,e[3]=h*g,e[4]=(d*t-r*l)*g,e[5]=(r*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,r,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,-r*u,r*l,-r*(-u*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(xs.makeScale(e,t)),this}rotate(e){return this.premultiply(xs.makeRotation(-e)),this}translate(e,t){return this.premultiply(xs.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const xs=new pi,Ho=new pi().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),No=new pi().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function dv(){const n={enabled:!0,workingColorSpace:Oo,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===ys&&(r.r=Xt(r.r),r.g=Xt(r.g),r.b=Xt(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===ys&&(r.r=nn(r.r),r.g=nn(r.g),r.b=nn(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Uu?zo:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return $o("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return $o("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Oo]:{primaries:e,whitePoint:i,transfer:zo,toXYZ:Ho,fromXYZ:No,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Mt},outputColorSpaceConfig:{drawingBufferColorSpace:Mt}},[Mt]:{primaries:e,whitePoint:i,transfer:ys,toXYZ:Ho,fromXYZ:No,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Mt}}}),n}const _t=dv();function Xt(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function nn(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let $i;class cv{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{$i===void 0&&($i=Ro("canvas")),$i.width=e.width,$i.height=e.height;const r=$i.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=$i}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 r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=Xt(s[a]/255)*255;return i.putImageData(r,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(Xt(t[i]/255)*255):t[i]=Xt(t[i]);return{data:t,width:e.width,height:e.height}}else return Ye("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let hv=0;class fv{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hv++}),this.uuid=Un(),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):typeof VideoFrame<"u"&&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:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(ws(r[a].image)):s.push(ws(r[a]))}else s=ws(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function ws(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?cv.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(Ye("Texture: Unable to serialize Texture."),{})}let pv=0;const _s=new P;class Si extends is{constructor(e=Si.DEFAULT_IMAGE,t=Si.DEFAULT_MAPPING,i=dr,r=dr,s=nv,a=rv,o=ov,l=sv,u=Si.DEFAULT_ANISOTROPY,d=Uu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:pv++}),this.uuid=Un(),this.name="",this.source=new fv(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Et(0,0),this.repeat=new Et(1,1),this.center=new Et(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pi,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(_s).x}get height(){return this.source.getSize(_s).y}get depth(){return this.source.getSize(_s).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){Ye(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){Ye(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.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!==Vu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Fo:e.x=e.x-Math.floor(e.x);break;case dr: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 Fo:e.y=e.y-Math.floor(e.y);break;case dr: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++}}Si.DEFAULT_IMAGE=null;Si.DEFAULT_MAPPING=Vu;Si.DEFAULT_ANISOTROPY=1;class jn{constructor(e=0,t=0,i=0,r=1){jn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*i+a[11]*r+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,r,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],x=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+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(u+1)/2,A=(p+1)/2,q=(x+1)/2,M=(d+h)/4,B=(c+g)/4,H=(m+y)/4;return w>A&&w>q?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=M/i,s=B/i):A>q?A<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(A),i=M/r,s=H/r):q<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(q),i=B/s,r=H/s),this.set(i,r,s,t),this}let b=Math.sqrt((y-m)*(y-m)+(c-g)*(c-g)+(h-d)*(h-d));return Math.abs(b)<.001&&(b=1),this.x=(y-m)/b,this.y=(c-g)/b,this.z=(h-d)/b,this.w=Math.acos((u+p+x-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 Gn{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(Ct.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Ct.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=Ct.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,Ct):Ct.fromBufferAttribute(s,a),Ct.applyMatrix4(e.matrixWorld),this.expandByPoint(Ct);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),hr.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),hr.copy(i.boundingBox)),hr.applyMatrix4(e.matrixWorld),this.union(hr)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[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,Ct),Ct.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(xn),fr.subVectors(this.max,xn),Li.subVectors(e.a,xn),Hi.subVectors(e.b,xn),Ni.subVectors(e.c,xn),ei.subVectors(Hi,Li),ti.subVectors(Ni,Hi),xi.subVectors(Li,Ni);let t=[0,-ei.z,ei.y,0,-ti.z,ti.y,0,-xi.z,xi.y,ei.z,0,-ei.x,ti.z,0,-ti.x,xi.z,0,-xi.x,-ei.y,ei.x,0,-ti.y,ti.x,0,-xi.y,xi.x,0];return!Cs(t,Li,Hi,Ni,fr)||(t=[1,0,0,0,1,0,0,0,1],!Cs(t,Li,Hi,Ni,fr))?!1:(pr.crossVectors(ei,ti),t=[pr.x,pr.y,pr.z],Cs(t,Li,Hi,Ni,fr))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ct).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ct).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:(Ut[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ut[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ut[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ut[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ut[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ut[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ut[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ut[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ut),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 Ut=[new P,new P,new P,new P,new P,new P,new P,new P],Ct=new P,hr=new Gn,Li=new P,Hi=new P,Ni=new P,ei=new P,ti=new P,xi=new P,xn=new P,fr=new P,pr=new P,wi=new P;function Cs(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){wi.fromArray(n,s);const o=r.x*Math.abs(wi.x)+r.y*Math.abs(wi.y)+r.z*Math.abs(wi.z),l=e.dot(wi),u=t.dot(wi),d=i.dot(wi);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>o)return!1}return!0}const mv=new Gn,wn=new P,As=new P;class Wu{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):mv.setFromPoints(e).getCenter(i);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),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;wn.subVectors(e,this.center);const t=wn.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(wn,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(As.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(wn.copy(e.center).add(As)),this.expandByPoint(wn.copy(e.center).sub(As))),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 Wt=new P,Ss=new P,mr=new P,ii=new P,Ms=new P,gr=new P,Bs=new P;class gv{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,Wt)),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=Wt.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Wt.copy(this.origin).addScaledVector(this.direction,t),Wt.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Ss.copy(e).add(t).multiplyScalar(.5),mr.copy(t).sub(e).normalize(),ii.copy(this.origin).sub(Ss);const s=e.distanceTo(t)*.5,a=-this.direction.dot(mr),o=ii.dot(this.direction),l=-ii.dot(mr),u=ii.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),r&&r.copy(Ss).addScaledVector(mr,h),p}intersectSphere(e,t){Wt.subVectors(e.center,this.origin);const i=Wt.dot(this.direction),r=Wt.dot(Wt)-i*i,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),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,r,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,r=(e.max.x-h.x)*u):(i=(e.max.x-h.x)*u,r=(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>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=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>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Wt)!==null}intersectTriangle(e,t,i,r,s){Ms.subVectors(t,e),gr.subVectors(i,e),Bs.crossVectors(Ms,gr);let a=this.direction.dot(Bs),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;ii.subVectors(this.origin,e);const l=o*this.direction.dot(gr.crossVectors(ii,gr));if(l<0)return null;const u=o*this.direction.dot(Ms.cross(ii));if(u<0||l+u>a)return null;const d=-o*ii.dot(Bs);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 Ot{constructor(e,t,i,r,s,a,o,l,u,d,c,h,p,m,g,y){Ot.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,u,d,c,h,p,m,g,y)}set(e,t,i,r,s,a,o,l,u,d,c,h,p,m,g,y){const x=this.elements;return x[0]=e,x[4]=t,x[8]=i,x[12]=r,x[1]=s,x[5]=a,x[9]=o,x[13]=l,x[2]=u,x[6]=d,x[10]=c,x[14]=h,x[3]=p,x[7]=m,x[11]=g,x[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 Ot().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 this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(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){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/Vi.setFromMatrixColumn(e,0).length(),s=1/Vi.setFromMatrixColumn(e,1).length(),a=1/Vi.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*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,r=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),u=Math.sin(r),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(yv,e,vv)}lookAt(e,t,i){const r=this.elements;return st.subVectors(e,t),st.lengthSq()===0&&(st.z=1),st.normalize(),ni.crossVectors(i,st),ni.lengthSq()===0&&(Math.abs(i.z)===1?st.x+=1e-4:st.z+=1e-4,st.normalize(),ni.crossVectors(i,st)),ni.normalize(),yr.crossVectors(st,ni),r[0]=ni.x,r[4]=yr.x,r[8]=st.x,r[1]=ni.y,r[5]=yr.y,r[9]=st.y,r[2]=ni.z,r[6]=yr.z,r[10]=st.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,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],x=i[14],b=i[3],w=i[7],A=i[11],q=i[15],M=r[0],B=r[4],H=r[8],F=r[12],R=r[1],U=r[5],j=r[9],te=r[13],Q=r[2],oe=r[6],J=r[10],ee=r[14],Y=r[3],he=r[7],se=r[11],ye=r[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*j+l*J+u*se,s[12]=a*F+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*j+h*J+p*se,s[13]=d*F+c*te+h*ee+p*ye,s[2]=m*M+g*R+y*Q+x*Y,s[6]=m*B+g*U+y*oe+x*he,s[10]=m*H+g*j+y*J+x*se,s[14]=m*F+g*te+y*ee+x*ye,s[3]=b*M+w*R+A*Q+q*Y,s[7]=b*B+w*U+A*oe+q*he,s[11]=b*H+w*j+A*J+q*se,s[15]=b*F+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],r=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],x=e[15],b=l*p-u*h,w=o*p-u*c,A=o*h-l*c,q=a*p-u*d,M=a*h-l*d,B=a*c-o*d;return t*(g*b-y*w+x*A)-i*(m*b-y*q+x*M)+r*(m*w-g*q+x*B)-s*(m*A-g*M+y*B)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],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],x=e[15],b=c*y*u-g*h*u+g*l*p-o*y*p-c*l*x+o*h*x,w=m*h*u-d*y*u-m*l*p+a*y*p+d*l*x-a*h*x,A=d*g*u-m*c*u+m*o*p-a*g*p-d*o*x+a*c*x,q=m*c*l-d*g*l-m*o*h+a*g*h+d*o*y-a*c*y,M=t*b+i*w+r*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]=b*B,e[1]=(g*h*s-c*y*s-g*r*p+i*y*p+c*r*x-i*h*x)*B,e[2]=(o*y*s-g*l*s+g*r*u-i*y*u-o*r*x+i*l*x)*B,e[3]=(c*l*s-o*h*s-c*r*u+i*h*u+o*r*p-i*l*p)*B,e[4]=w*B,e[5]=(d*y*s-m*h*s+m*r*p-t*y*p-d*r*x+t*h*x)*B,e[6]=(m*l*s-a*y*s-m*r*u+t*y*u+a*r*x-t*l*x)*B,e[7]=(a*h*s-d*l*s+d*r*u-t*h*u-a*r*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*x-t*c*x)*B,e[10]=(a*g*s-m*o*s+m*i*u-t*g*u-a*i*x+t*o*x)*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*r-m*c*r+m*i*h-t*g*h-d*i*y+t*c*y)*B,e[14]=(m*o*r-a*g*r-m*i*l+t*g*l+a*i*y-t*o*y)*B,e[15]=(a*c*r-d*o*r+d*i*l-t*c*l-a*i*h+t*o*h)*B,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,a=e.x,o=e.y,l=e.z,u=s*a,d=s*o;return this.set(u*a+i,u*o-r*l,u*l+r*o,0,u*o+r*l,d*o+i,d*l-r*a,0,u*l-r*o,d*l+r*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,r,s,a){return this.set(1,i,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=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,x=o*c,b=l*u,w=l*d,A=l*c,q=i.x,M=i.y,B=i.z;return r[0]=(1-(g+x))*q,r[1]=(p+A)*q,r[2]=(m-w)*q,r[3]=0,r[4]=(p-A)*M,r[5]=(1-(h+x))*M,r[6]=(y+b)*M,r[7]=0,r[8]=(m+w)*B,r[9]=(y-b)*B,r[10]=(1-(h+g))*B,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return i.set(1,1,1),t.identity(),this;let s=Vi.set(r[0],r[1],r[2]).length();const a=Vi.set(r[4],r[5],r[6]).length(),o=Vi.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),At.copy(this);const u=1/s,d=1/a,c=1/o;return At.elements[0]*=u,At.elements[1]*=u,At.elements[2]*=u,At.elements[4]*=d,At.elements[5]*=d,At.elements[6]*=d,At.elements[8]*=c,At.elements[9]*=c,At.elements[10]*=c,t.setFromRotationMatrix(At),i.x=s,i.y=a,i.z=o,this}makePerspective(e,t,i,r,s,a,o=cr,l=!1){const u=this.elements,d=2*s/(t-e),c=2*s/(i-r),h=(t+e)/(t-e),p=(i+r)/(i-r);let m,g;if(l)m=s/(a-s),g=a*s/(a-s);else if(o===cr)m=-(a+s)/(a-s),g=-2*a*s/(a-s);else if(o===Po)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,r,s,a,o=cr,l=!1){const u=this.elements,d=2/(t-e),c=2/(i-r),h=-(t+e)/(t-e),p=-(i+r)/(i-r);let m,g;if(l)m=1/(a-s),g=a/(a-s);else if(o===cr)m=-2/(a-s),g=-(a+s)/(a-s);else if(o===Po)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 r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Vi=new P,At=new Ot,yv=new P(0,0,0),vv=new P(1,1,1),ni=new P,yr=new P,st=new P,Vo=new Ot,Uo=new Wn;class Kn{constructor(e=0,t=0,i=0,r=Kn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],u=r[5],d=r[9],c=r[2],h=r[6],p=r[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:Ye("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Vo.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Vo,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Uo.setFromEuler(this),this.setFromQuaternion(Uo,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}}Kn.DEFAULT_ORDER="XYZ";class bv{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 xv=0;const Wo=new P,Ui=new Wn,jt=new Ot,vr=new P,_n=new P,wv=new P,_v=new Wn,jo=new P(1,0,0),Go=new P(0,1,0),Ko=new P(0,0,1),Xo={type:"added"},Cv={type:"removed"},Wi={type:"childadded",child:null},qs={type:"childremoved",child:null};class Yt extends is{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:xv++}),this.uuid=Un(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Yt.DEFAULT_UP.clone();const e=new P,t=new Kn,i=new Wn,r=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:r},modelViewMatrix:{value:new Ot},normalMatrix:{value:new pi}}),this.matrix=new Ot,this.matrixWorld=new Ot,this.matrixAutoUpdate=Yt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Yt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new bv,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 Ui.setFromAxisAngle(e,t),this.quaternion.multiply(Ui),this}rotateOnWorldAxis(e,t){return Ui.setFromAxisAngle(e,t),this.quaternion.premultiply(Ui),this}rotateX(e){return this.rotateOnAxis(jo,e)}rotateY(e){return this.rotateOnAxis(Go,e)}rotateZ(e){return this.rotateOnAxis(Ko,e)}translateOnAxis(e,t){return Wo.copy(e).applyQuaternion(this.quaternion),this.position.add(Wo.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(jo,e)}translateY(e){return this.translateOnAxis(Go,e)}translateZ(e){return this.translateOnAxis(Ko,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?vr.copy(e):vr.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),_n.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?jt.lookAt(_n,vr,this.up):jt.lookAt(vr,_n,this.up),this.quaternion.setFromRotationMatrix(jt),r&&(jt.extractRotation(r.matrixWorld),Ui.setFromRotationMatrix(jt),this.quaternion.premultiply(Ui.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(Ci("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(Xo),Wi.child=e,this.dispatchEvent(Wi),Wi.child=null):Ci("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(Cv),qs.child=e,this.dispatchEvent(qs),qs.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(Xo),Wi.child=e,this.dispatchEvent(Wi),Wi.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,r=this.children.length;i<r;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 r=this.children;for(let s=0,a=r.length;s<a;s++)r[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(_n,e,wv),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_n,_v,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,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;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,r=t.length;i<r;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 r=this.children;for(let s=0,a=r.length;s<a;s++)r[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 r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.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?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const 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&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.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]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.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=r,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 r=e.children[i];this.add(r.clone())}return this}}Yt.DEFAULT_UP=new P(0,1,0);Yt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Yt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const St=new P,Gt=new P,ks=new P,Kt=new P,ji=new P,Gi=new P,Yo=new P,Fs=new P,Es=new P,Os=new P,zs=new jn,Is=new jn,Ts=new jn;class qt{constructor(e=new P,t=new P,i=new P){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),St.subVectors(e,t),r.cross(St);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){St.subVectors(r,t),Gt.subVectors(i,t),ks.subVectors(e,t);const a=St.dot(St),o=St.dot(Gt),l=St.dot(ks),u=Gt.dot(Gt),d=Gt.dot(ks),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,r){return this.getBarycoord(e,t,i,r,Kt)===null?!1:Kt.x>=0&&Kt.y>=0&&Kt.x+Kt.y<=1}static getInterpolation(e,t,i,r,s,a,o,l){return this.getBarycoord(e,t,i,r,Kt)===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,Kt.x),l.addScaledVector(a,Kt.y),l.addScaledVector(o,Kt.z),l)}static getInterpolatedAttribute(e,t,i,r,s,a){return zs.setScalar(0),Is.setScalar(0),Ts.setScalar(0),zs.fromBufferAttribute(e,t),Is.fromBufferAttribute(e,i),Ts.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(zs,s.x),a.addScaledVector(Is,s.y),a.addScaledVector(Ts,s.z),a}static isFrontFacing(e,t,i,r){return St.subVectors(i,t),Gt.subVectors(e,t),St.cross(Gt).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return St.subVectors(this.c,this.b),Gt.subVectors(this.a,this.b),St.cross(Gt).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return qt.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let a,o;ji.subVectors(r,i),Gi.subVectors(s,i),Fs.subVectors(e,i);const l=ji.dot(Fs),u=Gi.dot(Fs);if(l<=0&&u<=0)return t.copy(i);Es.subVectors(e,r);const d=ji.dot(Es),c=Gi.dot(Es);if(d>=0&&c<=d)return t.copy(r);const h=l*c-d*u;if(h<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(i).addScaledVector(ji,a);Os.subVectors(e,s);const p=ji.dot(Os),m=Gi.dot(Os);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(Gi,o);const y=d*m-p*c;if(y<=0&&c-d>=0&&p-m>=0)return Yo.subVectors(s,r),o=(c-d)/(c-d+(p-m)),t.copy(r).addScaledVector(Yo,o);const x=1/(y+g+h);return a=g*x,o=h*x,t.copy(i).addScaledVector(ji,a).addScaledVector(Gi,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ju={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},br={h:0,s:0,l:0};function Ps(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Xn{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Mt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,_t.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=_t.workingColorSpace){return this.r=e,this.g=t,this.b=i,_t.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=_t.workingColorSpace){if(e=uv(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=Ps(a,s,e+1/3),this.g=Ps(a,s,e),this.b=Ps(a,s,e-1/3)}return _t.colorSpaceToWorking(this,r),this}setStyle(e,t=Mt){function i(s){s!==void 0&&parseFloat(s)<1&&Ye("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[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:Ye("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[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);Ye("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Mt){const i=ju[e.toLowerCase()];return i!==void 0?this.setHex(i,t):Ye("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=Xt(e.r),this.g=Xt(e.g),this.b=Xt(e.b),this}copyLinearToSRGB(e){return this.r=nn(e.r),this.g=nn(e.g),this.b=nn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Mt){return _t.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=Mt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=_t.workingColorSpace){_t.workingToColorSpace(Ke.copy(this),t);const i=Ke.r,r=Ke.g,s=Ke.b,a=Math.max(i,r,s),o=Math.min(i,r,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=(r-s)/c+(r<s?6:0);break;case r:l=(s-i)/c+2;break;case s:l=(i-r)/c+4;break}l/=6}return e.h=l,e.s=u,e.l=d,e}getRGB(e,t=_t.workingColorSpace){return _t.workingToColorSpace(Ke.copy(this),t),e.r=Ke.r,e.g=Ke.g,e.b=Ke.b,e}getStyle(e=Mt){_t.workingToColorSpace(Ke.copy(this),e);const t=Ke.r,i=Ke.g,r=Ke.b;return e!==Mt?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*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(br);const i=vs(ri.h,br.h,t),r=vs(ri.s,br.s,t),s=vs(ri.l,br.l,t);return this.setHSL(i,r,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,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[8]*r,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 Xn;Xn.NAMES=ju;let Av=0;class Sv extends is{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Av++}),this.uuid=Un(),this.name="",this.type="Material",this.blending=So,this.side=ra,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Bo,this.blendDst=qo,this.blendEquation=Mo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Xn(0,0,0),this.blendAlpha=0,this.depthFunc=ko,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Io,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Di,this.stencilZFail=Di,this.stencilZPass=Di,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){Ye(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){Ye(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.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!==So&&(i.blending=this.blending),this.side!==ra&&(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!==Bo&&(i.blendSrc=this.blendSrc),this.blendDst!==qo&&(i.blendDst=this.blendDst),this.blendEquation!==Mo&&(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!==ko&&(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!==Io&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Di&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Di&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Di&&(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.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(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 r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,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 Gu extends Sv{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Xn(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 Kn,this.combine=iv,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 Ee=new P,xr=new Et;let Mv=0;class rn{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:Mv++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=To,this.updateRanges=[],this.gpuType=av,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];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++)xr.fromBufferAttribute(this,t),xr.applyMatrix3(e),this.setXY(t,xr.x,xr.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)Ee.fromBufferAttribute(this,t),Ee.applyMatrix3(e),this.setXYZ(t,Ee.x,Ee.y,Ee.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)Ee.fromBufferAttribute(this,t),Ee.applyMatrix4(e),this.setXYZ(t,Ee.x,Ee.y,Ee.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Ee.fromBufferAttribute(this,t),Ee.applyNormalMatrix(e),this.setXYZ(t,Ee.x,Ee.y,Ee.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Ee.fromBufferAttribute(this,t),Ee.transformDirection(e),this.setXYZ(t,Ee.x,Ee.y,Ee.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=bn(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=tt(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=bn(t,this.array)),t}setX(e,t){return this.normalized&&(t=tt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=bn(t,this.array)),t}setY(e,t){return this.normalized&&(t=tt(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=bn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=tt(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=bn(t,this.array)),t}setW(e,t){return this.normalized&&(t=tt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=tt(t,this.array),i=tt(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=tt(t,this.array),i=tt(i,this.array),r=tt(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=tt(t,this.array),i=tt(i,this.array),r=tt(r,this.array),s=tt(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,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!==To&&(e.usage=this.usage),e}}class Bv extends rn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class qv extends rn{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class kv extends rn{constructor(e,t,i){super(new Float32Array(e),t,i)}}let Fv=0;const ht=new Ot,Rs=new Yt,Ki=new P,at=new Gn,Cn=new Gn,De=new P;class Ra extends is{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Fv++}),this.uuid=Un(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,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(lv(e)?qv:Bv)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,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 pi().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ht.makeRotationFromQuaternion(e),this.applyMatrix4(ht),this}rotateX(e){return ht.makeRotationX(e),this.applyMatrix4(ht),this}rotateY(e){return ht.makeRotationY(e),this.applyMatrix4(ht),this}rotateZ(e){return ht.makeRotationZ(e),this.applyMatrix4(ht),this}translate(e,t,i){return ht.makeTranslation(e,t,i),this.applyMatrix4(ht),this}scale(e,t,i){return ht.makeScale(e,t,i),this.applyMatrix4(ht),this}lookAt(e){return Rs.lookAt(e),Rs.updateMatrix(),this.applyMatrix4(Rs.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ki).negate(),this.translate(Ki.x,Ki.y,Ki.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new kv(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&Ye("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 Gn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Ci("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,r=t.length;i<r;i++){const s=t[i];at.setFromBufferAttribute(s),this.morphTargetsRelative?(De.addVectors(this.boundingBox.min,at.min),this.boundingBox.expandByPoint(De),De.addVectors(this.boundingBox.max,at.max),this.boundingBox.expandByPoint(De)):(this.boundingBox.expandByPoint(at.min),this.boundingBox.expandByPoint(at.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Ci('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 Wu);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Ci("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(at.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Cn.setFromBufferAttribute(o),this.morphTargetsRelative?(De.addVectors(at.min,Cn.min),at.expandByPoint(De),De.addVectors(at.max,Cn.max),at.expandByPoint(De)):(at.expandByPoint(Cn.min),at.expandByPoint(Cn.max))}at.getCenter(i);let r=0;for(let s=0,a=e.count;s<a;s++)De.fromBufferAttribute(e,s),r=Math.max(r,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&&(Ki.fromBufferAttribute(e,u),De.add(Ki)),r=Math.max(r,i.distanceToSquared(De))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&Ci('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){Ci("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new rn(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 Et,p=new Et,m=new Et,g=new P,y=new P;function x(H,F,R){u.fromBufferAttribute(i,H),d.fromBufferAttribute(i,F),c.fromBufferAttribute(i,R),h.fromBufferAttribute(s,H),p.fromBufferAttribute(s,F),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[F].add(g),o[R].add(g),l[H].add(y),l[F].add(y),l[R].add(y))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let H=0,F=b.length;H<F;++H){const R=b[H],U=R.start,j=R.count;for(let te=U,Q=U+j;te<Q;te+=3)x(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(r,H),M.copy(q);const F=o[H];w.copy(F),w.sub(q.multiplyScalar(q.dot(F))).normalize(),A.crossVectors(M,F);const U=A.dot(l[H])<0?-1:1;a.setXYZW(H,w.x,w.y,w.z,U)}for(let H=0,F=b.length;H<F;++H){const R=b[H],U=R.start,j=R.count;for(let te=U,Q=U+j;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 rn(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 r=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);r.fromBufferAttribute(t,m),s.fromBufferAttribute(t,g),a.fromBufferAttribute(t,y),d.subVectors(a,s),c.subVectors(r,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)r.fromBufferAttribute(t,h+0),s.fromBufferAttribute(t,h+1),a.fromBufferAttribute(t,h+2),d.subVectors(a,s),c.subVectors(r,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 x=0;x<d;x++)h[m++]=u[p++]}return new rn(h,d,c)}if(this.index===null)return Ye("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Ra,i=this.index.array,r=this.attributes;for(const o in r){const l=r[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 r={};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&&(r[l]=d,s=!0)}s&&(e.data.morphAttributes=r,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 r=e.attributes;for(const u in r){const d=r[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 Jo=new Ot,_i=new gv,wr=new Wu,Zo=new P,_r=new P,Cr=new P,Ar=new P,Ds=new P,Sr=new P,Qo=new P,Mr=new P;class Ev extends Yt{constructor(e=new Ra,t=new Gu){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 r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){Sr.set(0,0,0);for(let l=0,u=s.length;l<u;l++){const d=o[l],c=s[l];d!==0&&(Ds.fromBufferAttribute(c,e),a?Sr.addScaledVector(Ds,d):Sr.addScaledVector(Ds.sub(t),d))}t.add(Sr)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),wr.copy(i.boundingSphere),wr.applyMatrix4(s),_i.copy(e.ray).recast(e.near),!(wr.containsPoint(_i.origin)===!1&&(_i.intersectSphere(wr,Zo)===null||_i.origin.distanceToSquared(Zo)>(e.far-e.near)**2))&&(Jo.copy(s).invert(),_i.copy(e.ray).applyMatrix4(Jo),!(i.boundingBox!==null&&_i.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,_i)))}_computeIntersections(e,t,i){let r;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],x=a[y.materialIndex],b=Math.max(y.start,p.start),w=Math.min(o.count,Math.min(y.start+y.count,p.start+p.count));for(let A=b,q=w;A<q;A+=3){const M=o.getX(A),B=o.getX(A+1),H=o.getX(A+2);r=Br(this,x,e,i,u,d,c,M,B,H),r&&(r.faceIndex=Math.floor(A/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const m=Math.max(0,p.start),g=Math.min(o.count,p.start+p.count);for(let y=m,x=g;y<x;y+=3){const b=o.getX(y),w=o.getX(y+1),A=o.getX(y+2);r=Br(this,a,e,i,u,d,c,b,w,A),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,g=h.length;m<g;m++){const y=h[m],x=a[y.materialIndex],b=Math.max(y.start,p.start),w=Math.min(l.count,Math.min(y.start+y.count,p.start+p.count));for(let A=b,q=w;A<q;A+=3){const M=A,B=A+1,H=A+2;r=Br(this,x,e,i,u,d,c,M,B,H),r&&(r.faceIndex=Math.floor(A/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const m=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);for(let y=m,x=g;y<x;y+=3){const b=y,w=y+1,A=y+2;r=Br(this,a,e,i,u,d,c,b,w,A),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}}}function Ov(n,e,t,i,r,s,a,o){let l;if(e.side===ev?l=i.intersectTriangle(a,s,r,!0,o):l=i.intersectTriangle(r,s,a,e.side===ra,o),l===null)return null;Mr.copy(o),Mr.applyMatrix4(n.matrixWorld);const u=t.ray.origin.distanceTo(Mr);return u<t.near||u>t.far?null:{distance:u,point:Mr.clone(),object:n}}function Br(n,e,t,i,r,s,a,o,l,u){n.getVertexPosition(o,_r),n.getVertexPosition(l,Cr),n.getVertexPosition(u,Ar);const d=Ov(n,e,t,i,_r,Cr,Ar,Qo);if(d){const c=new P;qt.getBarycoord(Qo,_r,Cr,Ar,c),r&&(d.uv=qt.getInterpolatedAttribute(r,o,l,u,c,new Et)),s&&(d.uv1=qt.getInterpolatedAttribute(s,o,l,u,c,new Et)),a&&(d.normal=qt.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};qt.getNormal(_r,Cr,Ar,h.normal),d.face=h,d.barycoord=c}return d}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Nu}}));typeof window<"u"&&(window.__THREE__?Ye("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Nu);class zv extends Ev{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 Ku={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 el(n){return{name:n.name,value:n,key:n.uuid,label:n.type,type:n.type,icon:Ku[n.type.toLowerCase()]||"i-carbon-cube",defaultExpanded:n.isScene,memorySize:Math.round(Zy(n)/1024),children:[]}}function Iv(n){function e(i,r){i.children.forEach(s=>{if(s.type==="HighlightMesh")return;const a=el(s);r.children.push(a),e(s,a)})}const t=el(n);return e(n,t),t}function Yi(n,e="root",t="root",i=new WeakSet){const r=typeof n;if(n===null||r!=="object")return{label:e,type:r,path:t,value:n,defaultExpanded:t==="root"};if(i.has(n))return{label:e,type:"circular",path:t,value:"[Circular]",defaultExpanded:t==="root"};if(i.add(n),Array.isArray(n))return{label:e,type:"array",path:t,value:`Array[${n.length}]`,defaultExpanded:t==="root",children:n.map((o,l)=>Yi(o,String(l),`${t}[${l}]`,i))};const s=[],a=n.constructor?.name||"Object";if(a==="_Euler"){const o=n,l=["x","y","z","order"];for(const u of l){const d=o[u],c=t==="root"?u:`${t}.${u}`;s.push(Yi(d,u,c,i))}}else if(a==="Quaternion"){const o=n,l=["x","y","z","w"];for(const u of l){const d=o[u],c=t==="root"?u:`${t}.${u}`;s.push(Yi(d,u,c,i))}}else if(a==="_Vector3"){const o=n,l=["x","y","z"];for(const u of l){const d=o[u],c=t==="root"?u:`${t}.${u}`;s.push(Yi(d,u,c,i))}}else for(const o of Object.keys(n)){if(o.startsWith("_")||o.startsWith("$")||o==="__v_isRef"||o==="__v_isReactive"||o==="__v_isShallow"||o==="__v_raw"||o==="__v_isReadonly")continue;const l=n[o];if(typeof l=="function")continue;const u=t==="root"?o:`${t}.${o}`;s.push(Yi(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 Tv(n){const e=new Gu({color:11003607,transparent:!0,opacity:.2,depthTest:!1,side:tv});return new zv(n.geometry.clone(),e)}const Pv={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)"}},Rv={key:2,class:"w-3 h-3 rounded-full border border-gray-300 dark:border-gray-600 bg-gray-200 dark:bg-gray-700"},Dv=O({__name:"MaterialBadge",props:{material:{},displayValue:{}},setup(n){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 r(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=fi;return e(n.material)?(v(),C(o,{key:0,variant:"soft",color:"neutral",size:"sm",class:"flex items-center gap-1 ml-1"},{default:_(()=>[t(n.material)?(v(),N("div",{key:0,class:"w-3 h-3 rounded-full border border-gray-300 dark:border-gray-600",style:Ft({backgroundColor:t(n.material)})},null,4)):i(n.material)?(v(),N("div",Pv)):(v(),N("div",Rv)),T("span",{class:I(r(n.material))},Z(n.displayValue),3)]),_:1})):D("",!0)}}}),$v=Object.assign(Dv,{__name:"InspectorMaterialBadge"}),Lv=O({__name:"GeometryBadge",props:{geometry:{},displayValue:{}},setup(n){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 r(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=fi;return t(n.geometry)?(v(),C(l,{key:0,variant:"soft",color:"neutral",size:"sm",class:"flex items-center gap-1 ml-1"},{default:_(()=>[E(o,{name:i(n.geometry),class:"w-3 h-3 text-gray-600"},null,8,["name"]),T("span",{class:I(r(n.geometry))},Z(n.displayValue),3)]),_:1})):D("",!0)}}}),Hv=Object.assign(Lv,{__name:"InspectorGeometryBadge"}),Nv={class:"text-sm text-gray-500 pt-2 pb-8"},Vv={class:"flex items-center gap-1 py-0.5 mb-4 hover:bg-gray-50 group"},Uv={class:"text-gray-600 font-semibold"},Wv={class:"pl-5 flex flex-col gap-1"},jv={class:"flex items-center gap-1 min-w-0"},Gv={key:0,class:"flex items-center gap-1 ml-1"},Kv=O({__name:"Props",props:{object:{}},emits:["update-value"],setup(n,{emit:e}){const t=e,i=n,r=k(()=>Ku[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 x=l(i.object,y);return{key:y,value:a(y,x),displayValue:u(y,x)}}).filter(y=>y.value!==void 0)});function l(m,g){return g.split(".").reduce((y,x)=>y&&typeof y=="object"&&x in y?y[x]: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,x=fi,b=hy,w=ut,A=Gy,q=Pu;return v(),N("div",Nv,[T("div",Vv,[E(y,{name:r.value,class:"w-4 h-4 text-gray-600 flex-shrink-0"},null,8,["name"]),T("span",Uv,Z(n.object.type),1),n.object.name?(v(),C(x,{key:0,variant:"soft",size:"xs",class:"ml-2"},{default:_(()=>[ce(Z(n.object.name),1)]),_:1})):D("",!0)]),T("div",Wv,[(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",jv,[T("span",null,Z(M.key)+" :",1),d(M.value)?(v(),N("div",Gv,[E(b,{modelValue:M.value.x,"onUpdate:modelValue":[B=>M.value.x=B,B=>t("update-value",M.key+".x",B)]},null,8,["modelValue","onUpdate:modelValue"]),E(b,{modelValue:M.value.y,"onUpdate:modelValue":[B=>M.value.y=B,B=>t("update-value",M.key+".y",B)]},null,8,["modelValue","onUpdate:modelValue"]),E(b,{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($v,{key:1,material:M.value,"display-value":M.displayValue},null,8,["material","display-value"])):h(M.value)?(v(),C(Hv,{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(b,{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"]))},[E(q,{size:"xs",items:[{label:"Copy Value",icon:"i-lucide:copy",onSelect:()=>f(Du)(M.value)},M.displayValue==="vector"&&{label:"Copy as prop",icon:"i-material-symbols:data-array",onSelect:()=>f(Ru)({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(Lu)({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($u)({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(Hu)({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:_(()=>[E(w,{size:"xs",variant:"ghost",color:"gray",icon:"i-lucide-ellipsis-vertical",title:"Copy value"})]),_:1},8,["items"])])]))),128))])])}}}),Xv=Object.assign(Kv,{__name:"InspectorProps"}),Yv={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"}},Jv={__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(n){const e=n,t=je(),i=Te(),r=Qt(zt(e,"as","decorative","orientation")),s=k(()=>ue({extend:ue(Yv),...i.ui?.separator||{}})({color:e.color,orientation:e.orientation,size:e.size,type:e.type}));return(a,o)=>(v(),C(f(Pm),L(f(r),{"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),n.label||n.icon||n.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},()=>[n.label?(v(),N("span",{key:0,"data-slot":"label",class:I(s.value.label({class:e.ui?.label}))},Z(n.label),3)):n.icon?(v(),C(Me,{key:1,name:n.icon,"data-slot":"icon",class:I(s.value.icon({class:e.ui?.icon}))},null,8,["name","class"])):n.avatar?(v(),C(hn,L({key:2,size:e.ui?.avatarSize||s.value.avatarSize()},n.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"]))}},Zv={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"}},Qv=Object.assign({inheritAttrs:!1},{__name:"UCheckbox",props:Fr({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:Fr(["change"],["update:modelValue"]),setup(n,{emit:e}){const t=n,i=je(),r=e,s=da(n,"modelValue",{type:[Boolean,String],default:void 0}),a=Te(),o=Qt(zt(t,"required","value","defaultValue")),{id:l,emitFormChange:u,emitFormInput:d,size:c,color:h,name:p,disabled:m,ariaAttrs:g}=ha(t),y=l.value??sl(),x=k(()=>ue({extend:ue(Zv),...a.ui?.checkbox||{}})({size:c.value,color:h.value,variant:t.variant,indicator:t.indicator,required:t.required,disabled:m.value}));function b(w){const A=new Event("change",{target:{value:w}});r("change",A),u(),d()}return(w,A)=>(v(),C(f(ne),{as:!n.variant||n.variant==="list"?n.as:f(uo),"data-slot":"root",class:I(x.value.root({class:[t.ui?.root,t.class]}))},{default:_(()=>[T("div",{"data-slot":"container",class:I(x.value.container({class:t.ui?.container}))},[E(f(Yc),L({id:f(y)},{...f(o),...w.$attrs,...f(g)},{modelValue:s.value,"onUpdate:modelValue":[A[0]||(A[0]=q=>s.value=q),b],name:f(p),disabled:f(m),"data-slot":"base",class:x.value.base({class:t.ui?.base})}),{default:_(({modelValue:q})=>[E(f(Zc),{"data-slot":"indicator",class:I(x.value.indicator({class:t.ui?.indicator}))},{default:_(()=>[q==="indeterminate"?(v(),C(Me,{key:0,name:n.indeterminateIcon||f(a).ui.icons.minus,"data-slot":"icon",class:I(x.value.icon({class:t.ui?.icon}))},null,8,["name","class"])):(v(),C(Me,{key:1,name:n.icon||f(a).ui.icons.check,"data-slot":"icon",class:I(x.value.icon({class:t.ui?.icon}))},null,8,["name","class"]))]),_:2},1032,["class"])]),_:1},16,["id","modelValue","name","disabled","class"])],2),n.label||i.label||n.description||i.description?(v(),N("div",{key:0,"data-slot":"wrapper",class:I(x.value.wrapper({class:t.ui?.wrapper}))},[n.label||i.label?(v(),C(dn(!n.variant||n.variant==="list"?f(uo):"p"),{key:0,for:f(y),"data-slot":"label",class:I(x.value.label({class:t.ui?.label}))},{default:_(()=>[S(w.$slots,"label",{label:n.label},()=>[ce(Z(n.label),1)])]),_:3},8,["for","class"])):D("",!0),n.description||i.description?(v(),N("p",{key:1,"data-slot":"description",class:I(x.value.description({class:t.ui?.description}))},[S(w.$slots,"description",{description:n.description},()=>[ce(Z(n.description),1)])],2)):D("",!0)],2)):D("",!0)]),_:3},8,["as","class"]))}}),eb={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"}},tb=["id","type","value","name","placeholder","disabled","required","autocomplete"],ib=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(n,{expose:e,emit:t}){const i=n,r=t,s=je(),a=hu(i,"modelValue",r,{defaultValue:i.defaultValue}),o=Te(),{emitFormBlur:l,emitFormInput:u,emitFormChange:d,size:c,color:h,id:p,name:m,highlight:g,disabled:y,emitFormFocus:x,ariaAttrs:b}=ha(i,{deferInputValidation:!0}),{orientation:w,size:A}=ca(i),{isLeading:q,isTrailing:M,leadingIconName:B,trailingIconName:H}=gl(i),F=k(()=>A.value||c.value),R=k(()=>ue({extend:ue(eb),...o.ui?.input||{}})({type:i.type,color:h.value,variant:i.variant,size:F?.value,loading:i.loading,highlight:g.value,leading:q.value||!!i.avatar||!!s.leading,trailing:M.value||!!s.trailing,fieldGroup:w.value})),U=yl("inputRef");function j(ee){i.modelModifiers?.trim&&(ee=ee?.trim()??null),(i.modelModifiers?.number||i.type==="number")&&(ee=Dd(ee)),i.modelModifiers?.nullable&&(ee||=null),i.modelModifiers?.optional&&(ee||=void 0),a.value=ee,u()}function te(ee){i.modelModifiers?.lazy||j(ee.target.value)}function Q(ee){const Y=ee.target.value;i.modelModifiers?.lazy&&j(Y),i.modelModifiers?.trim&&(ee.target.value=Y.trim()),d(),r("change",ee)}function oe(ee){l(),r("blur",ee)}function J(){i.autofocus&&U.value?.focus()}return He(()=>{setTimeout(()=>{J()},i.autofocusDelay)}),e({inputRef:U}),(ee,Y)=>(v(),C(f(ne),{as:n.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:n.type,value:f(a),name:f(m),placeholder:n.placeholder,"data-slot":"base",class:R.value.base({class:i.ui?.base}),disabled:f(y),required:n.required,autocomplete:n.autocomplete},{...ee.$attrs,...f(b)},{onInput:te,onBlur:oe,onChange:Q,onFocus:Y[0]||(Y[0]=(...he)=>f(x)&&f(x)(...he))}),null,16,tb),S(ee.$slots,"default",{ui:R.value}),f(q)||n.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"])):n.avatar?(v(),C(hn,L({key:1,size:i.ui?.leadingAvatarSize||R.value.leadingAvatarSize()},n.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"]))}}),nb={class:"font-mono text-xs text-gray-500"},rb={key:1,class:"mr-1 w-4 h-4"},sb={class:"flex items-center gap-1 flex-1 min-w-0"},ab={class:"text-gray-600 font-semibold"},ob=O({__name:"Tree",props:{node:{},level:{default:0},selectedObject:{}},emits:["update-value"],setup(n,{emit:e}){const t=n,i=e,r=z(t.node.defaultExpanded??!1),s=z(null),a=()=>{r.value=!r.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),x=k(()=>!y.value),b=k(()=>({paddingLeft:`${t.level*16}px`}));return(w,A)=>{const q=Me,M=ut,B=Pu,H=Qv,F=ib,R=wu,U=Xu;return v(),N("div",nb,[T("div",{style:Ft(b.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},[E(q,{name:r.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",rb)),T("div",sb,[n.node.type==="object"||n.node.type==="array"?(v(),N(xe,{key:0},[T("span",{class:"cursor-pointer select-none",onClick:A[0]||(A[0]=j=>y.value?a():void 0)},[ce(Z(n.node.label)+" : ",1),T("span",ab,Z(n.node.value),1)]),n.node.type!=="array"?(v(),C(B,{key:0,size:"xs",items:[{label:"Copy Path",icon:"i-lucide:link",onSelect:()=>f(Ao)(n.node.path)},{label:"Copy value as Array",icon:"i-material-symbols:data-array",onSelect:()=>f(Yy)(n.node)},n.node.value==="_Vector3"?{label:"Copy value as Vector3",icon:"i-lucide:pen-line",onSelect:()=>f($u)(n.node)}:null,n.node.value==="_Euler"?{label:"Copy as Euler",icon:"i-lucide:rotate-3d",onSelect:()=>f(Lu)(n.node)}:null,n.node.value==="_Quaternion"?{label:"Copy as Quaternion",icon:"i-lucide:rotate-3d",onSelect:()=>f(Hu)(n.node)}:null,{label:"Copy value as JSON",icon:"i-material-symbols:data-object",onSelect:()=>f(Jy)(n.node)},n.node.value==="_Vector3"||n.node.value==="_Euler"||n.node.value==="_Quaternion"?{label:"Copy as Prop",icon:"i-lucide:code",onSelect:()=>f(Xy)(n.node)}:null].filter(Boolean),ui:{content:"w-48"}},{default:_(()=>[E(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(n.node.label)+" :",1),typeof n.node.value=="boolean"?(v(),C(H,{key:0,"model-value":n.node.value,size:"xs","onUpdate:modelValue":c,onClick:A[1]||(A[1]=fe(()=>{},["stop"]))},null,8,["model-value"])):s.value?.path===n.node.path&&typeof n.node.value!="number"&&typeof n.node.value!="boolean"?(v(),C(F,{key:1,modelValue:s.value.value,"onUpdate:modelValue":A[2]||(A[2]=j=>s.value.value=j),size:"xs",class:"w-20",variant:"soft",onKeydown:fe(g,["stop"]),onBlur:p,onFocus:A[3]||(A[3]=j=>j.target?.select()),onClick:A[4]||(A[4]=fe(()=>{},["stop"]))},null,8,["modelValue"])):s.value?.path===n.node.path&&typeof n.node.value=="number"?(v(),C(R,{key:2,modelValue:s.value.value,"onUpdate:modelValue":A[5]||(A[5]=j=>s.value.value=j),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]=j=>j.target?.select()),onClick:A[7]||(A[7]=fe(()=>{},["stop"]))},null,8,["modelValue"])):typeof n.node.value!="boolean"?(v(),N("span",{key:3,class:I([o(n.node.value),"cursor-pointer hover:bg-gray-100 px-1 py-0.5 rounded"]),onClick:fe(h,["stop"])},Z(l(n.node.value)),3)):D("",!0)],64)),x.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 n.node.value=="number"?(v(),N(xe,{key:0},[E(M,{size:"xs",variant:"ghost",color:"gray",icon:"i-tabler:minus",title:"Decrease value",onClick:fe(d,["stop"])}),E(M,{size:"xs",variant:"ghost",color:"gray",icon:"i-tabler:plus",title:"Increase value",onClick:fe(u,["stop"])})],64)):D("",!0),E(B,{size:"xs",items:[{label:"Copy Value",icon:"i-lucide:copy",onSelect:()=>f(Du)(n.node.value)},{label:"Copy Path",icon:"i-lucide:link",onSelect:()=>f(Ao)(n.node.path)},{label:"Copy as prop",icon:"i-lucide:pen-line",onSelect:()=>f(Ru)(n.node)}],ui:{content:"w-48"}},{default:_(()=>[E(M,{size:"xs",variant:"ghost",color:"gray",icon:"i-lucide-ellipsis-vertical",title:"Copy value"})]),_:1},8,["items"])])):D("",!0)])],6),y.value&&r.value?(v(!0),N(xe,{key:0},Xe(n.node.children,j=>(v(),C(U,{key:`${j.path}-${j.label}`,node:j,level:n.level+1,"selected-object":n.selectedObject,onUpdateValue:A[9]||(A[9]=(te,Q)=>i("update-value",te,Q))},null,8,["node","level","selected-object"]))),128)):D("",!0)])}}}),Xu=Object.assign(ob,{__name:"InspectorTree"});function lb(n){let e=0;return n.traverse(t=>{t.isObject3D&&e++}),e}function ub(){const n={scene:as({objects:0,graph:null,value:void 0,selected:void 0,assets:[]}),fps:as({value:0,accumulator:[],lastLoggedTime:Date.now(),logInterval:1e3}),memory:as({currentMem:0,averageMem:0,maxMemory:0,allocatedMem:0,accumulator:[],lastLoggedTime:Date.now(),logInterval:1e3}),renderer:aa({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 r=i.scene.value.uuid;r!==e&&(n.scene.value=i.scene.value,n.scene.objects=lb(i.scene.value),n.scene.graph=Iv(i.scene.value),e=r)}else n.scene.value=void 0,n.scene.graph=null,e=null;i.renderer?.instance?.info&&(Object.assign(n.renderer.info.render,i.renderer.instance.info.render),Object.assign(n.renderer.info.memory,i.renderer.instance.info.memory),n.renderer.info.programs=[...i.renderer.instance.info.programs||[]])}else if(t.type==="performance"){const i=t.data;Object.assign(n.fps,i.fps),n.fps.accumulator=[...i.fps.accumulator],Object.assign(n.memory,i.memory),n.memory.accumulator=[...i.memory.accumulator]}}),n}const Da=py(ub),db={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},cb={key:0,class:"relative isolate"},hb=O({__name:"index",setup(n){const{scene:e}=Da(),t=ot(null),i=ot(null),r=z(0);function s(d){t.value&&t.value.remove(i.value),d&&d.isMesh&&(i.value=Tv(d),d.add(kt(i))),t.value=d,r.value++}const a=k(()=>(r.value,Yi(t.value))),o=(d,c)=>{t.value&&(l(t.value,d,c),d.includes("color")||r.value++)},l=(d,c,h)=>{if(!d||typeof d!="object")return;const p=c.split(".");let m=d;for(let b=0;b<p.length-1;b++){const w=p[b];if(m[w]&&typeof m[w]=="object")m=m[w];else return}const g=p[p.length-1],y=b=>typeof b=="string"&&/^#[0-9a-f]{6}$/i.test(b);m[g]=y(h)?new Xn(h):h;const x=d;x.isCamera&&u(c)&&x.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=bu,p=xu,m=Xv,g=Jv,y=Xu;return v(),N("div",db,[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",cb,[(v(),C(m,{key:r.value,object:t.value,onUpdateValue:o},null,8,["object"])),E(g),E(y,{class:"pt-4",node:a.value,"selected-object":t.value,onUpdateValue:o},null,8,["node","selected-object"])])):D("",!0)])])}}}),fb=Object.assign(hb,{__name:"SceneGraph"}),pb=["points"],$s=40,tl=2,mb=O({__name:"DevtoolsGraph",props:{points:{default:()=>[]},value:{default:0},unit:{default:""},label:{default:""},color:{default:"primary"}},setup(n){const e=n,t=z(140);yt(()=>{const r=Math.max(...e.points,30);t.value=Math.max(r,t.value)});const i=k(()=>e.points.map((r,s)=>`${s*tl},${$s-r*$s/t.value}`).join(" "));return(r,s)=>(v(),N("div",{class:I(["graph relative p-1 rounded text-right text-xs outline-none border-none font-sans",`graph-${n.color}`])},[T("div",{class:I(["absolute bottom-0.5 right-1 font-mono text-xs",`text-${n.color}`])},Z(Math.round(n.value))+" "+Z(n.unit),3),(v(),N("svg",{width:"100%",height:$s,xmlns:"http://www.w3.org/2000/svg"},[T("polyline",{points:f(i),fill:"none","stroke-width":tl,"stroke-linecap":"round","stroke-linejoin":"round",class:I(n.color)},null,10,pb)]))],2))}}),gb=Object.assign(mb,{__name:"DevtoolsGraph"}),yb={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"}},vb={__name:"UCard",props:{as:{type:null,required:!1},variant:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(n){const e=n,t=je(),i=Te(),r=k(()=>ue({extend:ue(yb),...i.ui?.card||{}})({variant:e.variant}));return(s,a)=>(v(),C(f(ne),{as:n.as,"data-slot":"root",class:I(r.value.root({class:[e.ui?.root,e.class]}))},{default:_(()=>[t.header?(v(),N("div",{key:0,"data-slot":"header",class:I(r.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(r.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(r.value.footer({class:e.ui?.footer}))},[S(s.$slots,"footer")],2)):D("",!0)]),_:3},8,["as","class"]))}},bb={class:"text-sm dark:text-gray-400 text-gray-500 font-mono"},xb={key:0,class:"h-1 border-b dark:border-gray-400 border-gray-500 w-4"},wb={class:"flex gap-2 items-center -mb2.5"},_b={key:0},Cb={class:"p4 dark:text-gray-400 text-gray-500 text-xs font-mono"},Ab=O({__name:"ProgramsModuleItem",props:{item:{},depth:{default:0}},setup(n){const e=z(!1);return(t,i)=>{const r=fi;return v(),N("div",bb,[T("div",{class:"flex gap-2 items-end cursor-pointer pt2 mb2",onClick:i[0]||(i[0]=s=>e.value=!f(e))},[n.depth>0?(v(),N("span",xb)):D("",!0),T("div",wb,[T("i",{class:I(n.item.icon)},null,2),ce(" "+Z(n.item.type)+" ",1),n.item.name?(v(),C(r,{key:0,variant:"soft"},{default:_(()=>[ce(Z(n.item.name),1)]),_:1})):D("",!0)])]),f(e)?(v(),N("div",_b,[T("div",Cb,[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(n.item.uniforms.map),([s,a])=>(v(),N("div",{key:s},[ce(Z(s)+" ",1),E(r,{color:"gray",variant:"soft"},{default:_(()=>[ce(Z(a?.cache[a?.cache.length-1]),1)]),_:2},1024)]))),128))])])):D("",!0)])}}}),Sb=Object.assign(Ab,{__name:"ProgramsModuleItem"}),Mb=O({__name:"ProgramsModule",setup(n){const{renderer:e}=Da(),t={shaderMaterial:"i-file-icons-vertexshader"},i=k(()=>e.info.programs.map(r=>({...r,icon:t[r.type]||"i-file-icons-vertexshader",uniforms:r.getUniforms(),attributes:r.getAttributes()})));return(r,s)=>{const a=Sb;return v(!0),N(xe,null,Xe(f(i),o=>(v(),C(a,{key:o.id,item:o},null,8,["item"]))),128)}}}),Bb=Object.assign(Mb,{__name:"ProgramsModule"}),qb={class:"space-y-6"},kb={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Fb={class:"flex items-center justify-between"},Eb={class:"flex items-center gap-2"},Ob={class:"space-y-4"},zb={class:"flex items-center justify-between"},Ib={class:"flex items-center gap-2"},Tb={class:"space-y-4"},Pb={class:"grid grid-cols-2 gap-4 text-sm"},Rb={class:"font-mono font-semibold"},Db={class:"font-mono font-semibold"},$b={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Lb={class:"flex items-center gap-2"},Hb={class:"space-y-4"},Nb={class:"grid grid-cols-2 gap-4"},Vb={class:"text-center p-4 bg-gray-50 dark:bg-gray-800 rounded-lg"},Ub={class:"flex items-center justify-center gap-2 mb-2"},Wb={class:"font-mono text-sm font-bold"},jb={class:"text-center p-4 bg-gray-50 dark:bg-gray-800 rounded-lg"},Gb={class:"flex items-center justify-center gap-2 mb-2"},Kb={class:"font-mono text-sm font-bold"},Xb={class:"flex items-center gap-2"},Yb={class:"grid grid-cols-2 gap-3"},Jb={class:"text-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"},Zb={class:"flex items-center justify-center gap-2 mb-2"},Qb={class:"font-mono font-bold"},e0={class:"text-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"},t0={class:"flex items-center justify-center gap-2 mb-2"},i0={class:"font-mono font-bold"},n0={class:"text-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"},r0={class:"flex items-center justify-center gap-2 mb-2"},s0={class:"font-mono font-bold"},a0={class:"text-center p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"},o0={class:"flex items-center justify-center gap-2 mb-2"},l0={class:"font-mono font-bold"},u0={class:"flex items-center gap-2"},d0=O({__name:"PerformanceMonitor",setup(n){const{fps:e,memory:t,renderer:i}=Da(),r=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=fi,d=gb,c=vb,h=xu,p=Bb;return v(),N("div",qb,[T("div",kb,[E(c,null,{header:_(()=>[T("div",Fb,[T("div",Eb,[E(l,{name:"i-tabler:activity",class:"w-5 h-5"}),o[0]||(o[0]=T("h3",{class:"text-sm font-semibold"}," Frame Rate ",-1))]),E(u,{color:f(r).color,variant:"soft",size:"sm"},{default:_(()=>[ce(Z(f(r).label),1)]),_:1},8,["color"])])]),default:_(()=>[T("div",Ob,[E(d,{points:f(e).accumulator,value:f(e).value,color:"primary",unit:"FPS",label:"FPS"},null,8,["points","value"])])]),_:1}),E(c,null,{header:_(()=>[T("div",zb,[T("div",Ib,[E(l,{name:"i-tabler:cpu",class:"w-5 h-5"}),o[1]||(o[1]=T("h3",{class:"text-sm font-semibold"}," Memory Usage ",-1))]),E(u,{color:f(s).color,variant:"soft",size:"sm"},{default:_(()=>[ce(Z(f(s).label),1)]),_:1},8,["color"])])]),default:_(()=>[T("div",Tb,[E(d,{points:f(t).accumulator,value:f(t).currentMem,color:"warning",unit:"MB",label:"Memory"},null,8,["points","value"]),T("div",Pb,[T("div",null,[o[2]||(o[2]=T("div",{class:"text-gray-600 dark:text-gray-400"}," Current ",-1)),T("div",Rb,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",Db,Z(Math.round(f(t).maxMemory))+" MB ",1)])])])]),_:1})]),T("div",$b,[E(c,null,{header:_(()=>[T("div",Lb,[E(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",Hb,[T("div",Nb,[T("div",Vb,[T("div",Ub,[E(l,{name:"i-tabler:box",class:"w-5 h-5"}),T("span",Wb,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",jb,[T("div",Gb,[E(l,{name:"i-tabler:photo",class:"w-5 h-5"}),T("span",Kb,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))])]),E(h,{icon:"i-tabler:info-circle",color:"primary",variant:"soft",title:"Memory Allocation",description:`Approximately ${f(Qy)(f(t).allocatedMem)} KB allocated by 3D objects`},null,8,["description"])])]),_:1}),E(c,null,{header:_(()=>[T("div",Xb,[E(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",Yb,[T("div",Jb,[T("div",Zb,[E(l,{name:"i-tabler:refresh",class:"w-4 h-4 text-primary-500"}),T("span",Qb,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",e0,[T("div",t0,[E(l,{name:"i-tabler:triangle",class:"w-4 h-4 text-orange-500"}),T("span",i0,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",n0,[T("div",r0,[E(l,{name:"i-tabler:point",class:"w-4 h-4 text-blue-500"}),T("span",s0,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",a0,[T("div",o0,[E(l,{name:"i-tabler:line",class:"w-4 h-4 text-red-500"}),T("span",l0,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})]),E(c,null,{header:_(()=>[T("div",u0,[E(l,{name:"i-tabler:code",class:"w-5 h-5"}),o[12]||(o[12]=T("h3",{class:"font-semibold"}," Shader Programs ",-1))])]),default:_(()=>[E(p)]),_:1})])}}}),c0=Object.assign(d0,{__name:"PerformanceMonitor"}),h0={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"}},f0={__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(n,{expose:e,emit:t}){const i=n,r=t,s=je(),a=Te(),o=Ce(zt(i,"as","unmountOnHide"),r),l=k(()=>ue({extend:ue(h0),...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($m),L(f(o),{"model-value":n.modelValue,"default-value":n.defaultValue,orientation:n.orientation,"activation-mode":n.activationMode,"data-slot":"root",class:l.value.root({class:[i.ui?.root,i.class]})}),{default:_(()=>[E(f(Wm),{"data-slot":"list",class:I(l.value.list({class:i.ui?.list}))},{default:_(()=>[E(f(Vm),{"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(n.items,(h,p)=>(v(),C(f(Gm),{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(hn,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(Rt)(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(Rt)(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(fi,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"]),n.content?(v(!0),N(xe,{key:0},Xe(n.items,(h,p)=>(v(),C(f(Hm),{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"]))}},p0={class:"pattern-bg"},m0={class:"bg-(--ui-bg) p-8 min-h-[calc(100vh-var(--ui-header-height))] max-w-screen-xl mx-auto pt-2 bg-default"},y0=O({__name:"index",setup(n){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 r=iy,s=fb,a=c0,o=f0;return v(),N("div",p0,[E(r),T("main",m0,[E(o,{items:e,color:"primary",size:"lg",variant:"link",ui:{trigger:"grow"},class:"gap-4 w-full"},{"scene-graph":_(()=>[E(s)]),performance:_(()=>[E(a)]),_:1})])])}}});export{y0 as default};