@andre-gra/oryx-ui 1.0.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.
@@ -0,0 +1,45 @@
1
+ (function(z,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],x):(z=typeof globalThis<"u"?globalThis:z||self,x(z.OryxUI={},z.ReactJSXRuntime,z.React,z.ReactDOM))})(this,function(z,x,c,Te){"use strict";var ad=Object.defineProperty;var ld=(z,x,c)=>x in z?ad(z,x,{enumerable:!0,configurable:!0,writable:!0,value:c}):z[x]=c;var Xe=(z,x,c)=>(ld(z,typeof x!="symbol"?x+"":x,c),c);function On(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const A=On(c),Lr=On(Te),dd="";function E(){return E=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},E.apply(this,arguments)}function Fr(e,n){const t=c.createContext(n);function o(i){const{children:s,...a}=i,l=c.useMemo(()=>a,Object.values(a));return c.createElement(t.Provider,{value:l},s)}function r(i){const s=c.useContext(t);if(s)return s;if(n!==void 0)return n;throw new Error(`\`${i}\` must be used within \`${e}\``)}return o.displayName=e+"Provider",[o,r]}function ue(e,n=[]){let t=[];function o(i,s){const a=c.createContext(s),l=t.length;t=[...t,s];function d(f){const{scope:g,children:h,...m}=f,p=(g==null?void 0:g[e][l])||a,v=c.useMemo(()=>m,Object.values(m));return c.createElement(p.Provider,{value:v},h)}function u(f,g){const h=(g==null?void 0:g[e][l])||a,m=c.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,u]}const r=()=>{const i=t.map(s=>c.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return r.scopeName=e,[o,Vr(r,...n)]}function Vr(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:l,scopeName:d})=>{const f=l(i)[`__scope${d}`];return{...a,...f}},{});return c.useMemo(()=>({[`__scope${n.scopeName}`]:s}),[s])}};return t.scopeName=n.scopeName,t}function Br(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function Lt(...e){return n=>e.forEach(t=>Br(t,n))}function H(...e){return c.useCallback(Lt(...e),e)}const Ae=c.forwardRef((e,n)=>{const{children:t,...o}=e,r=c.Children.toArray(t),i=r.find(Wr);if(i){const s=i.props.children,a=r.map(l=>l===i?c.Children.count(s)>1?c.Children.only(null):c.isValidElement(s)?s.props.children:null:l);return c.createElement(Ft,E({},o,{ref:n}),c.isValidElement(s)?c.cloneElement(s,void 0,a):null)}return c.createElement(Ft,E({},o,{ref:n}),t)});Ae.displayName="Slot";const Ft=c.forwardRef((e,n)=>{const{children:t,...o}=e;return c.isValidElement(t)?c.cloneElement(t,{...zr(o,t.props),ref:n?Lt(n,t.ref):t.ref}):c.Children.count(t)>1?c.Children.only(null):null});Ft.displayName="SlotClone";const Nn=({children:e})=>c.createElement(c.Fragment,null,e);function Wr(e){return c.isValidElement(e)&&e.type===Nn}function zr(e,n){const t={...n};for(const o in n){const r=e[o],i=n[o];/^on[A-Z]/.test(o)?r&&i?t[o]=(...a)=>{i(...a),r(...a)}:r&&(t[o]=r):o==="style"?t[o]={...r,...i}:o==="className"&&(t[o]=[r,i].filter(Boolean).join(" "))}return{...e,...t}}function ct(e){const n=e+"CollectionProvider",[t,o]=ue(n),[r,i]=t(n,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:p}=h,v=c.useRef(null),$=c.useRef(new Map).current;return c.createElement(r,{scope:m,itemMap:$,collectionRef:v},p)},a=e+"CollectionSlot",l=c.forwardRef((h,m)=>{const{scope:p,children:v}=h,$=i(a,p),w=H(m,$.collectionRef);return c.createElement(Ae,{ref:w},v)}),d=e+"CollectionItemSlot",u="data-radix-collection-item",f=c.forwardRef((h,m)=>{const{scope:p,children:v,...$}=h,w=c.useRef(null),b=H(m,w),y=i(d,p);return c.useEffect(()=>(y.itemMap.set(w,{ref:w,...$}),()=>void y.itemMap.delete(w))),c.createElement(Ae,{[u]:"",ref:b},v)});function g(h){const m=i(e+"CollectionConsumer",h);return c.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const $=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((y,C)=>$.indexOf(y.ref.current)-$.indexOf(C.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,o]}function N(e,n,{checkForDefaultPrevented:t=!0}={}){return function(r){if(e==null||e(r),t===!1||!r.defaultPrevented)return n==null?void 0:n(r)}}function q(e){const n=c.useRef(e);return c.useEffect(()=>{n.current=e}),c.useMemo(()=>(...t)=>{var o;return(o=n.current)===null||o===void 0?void 0:o.call(n,...t)},[])}function we({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,r]=Hr({defaultProp:n,onChange:t}),i=e!==void 0,s=i?e:o,a=q(t),l=c.useCallback(d=>{if(i){const f=typeof d=="function"?d(e):d;f!==e&&a(f)}else r(d)},[i,e,r,a]);return[s,l]}function Hr({defaultProp:e,onChange:n}){const t=c.useState(e),[o]=t,r=c.useRef(o),i=q(n);return c.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),t}const k=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,n)=>{const t=c.forwardRef((o,r)=>{const{asChild:i,...s}=o,a=i?Ae:n;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(a,E({},s,{ref:r}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{});function Vt(e,n){e&&Te.flushSync(()=>e.dispatchEvent(n))}const X=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{};function Kr(e,n){return c.useReducer((t,o)=>{const r=n[t][o];return r??t},e)}const ne=e=>{const{present:n,children:t}=e,o=jr(n),r=typeof t=="function"?t({present:o.isPresent}):c.Children.only(t),i=H(o.ref,r.ref);return typeof t=="function"||o.isPresent?c.cloneElement(r,{ref:i}):null};ne.displayName="Presence";function jr(e){const[n,t]=c.useState(),o=c.useRef({}),r=c.useRef(e),i=c.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Kr(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const d=it(o.current);i.current=a==="mounted"?d:"none"},[a]),X(()=>{const d=o.current,u=r.current;if(u!==e){const g=i.current,h=it(d);e?l("MOUNT"):h==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(u&&g!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),X(()=>{if(n){const d=f=>{const h=it(o.current).includes(f.animationName);f.target===n&&h&&Te.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===n&&(i.current=it(o.current))};return n.addEventListener("animationstart",u),n.addEventListener("animationcancel",d),n.addEventListener("animationend",d),()=>{n.removeEventListener("animationstart",u),n.removeEventListener("animationcancel",d),n.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:c.useCallback(d=>{d&&(o.current=getComputedStyle(d)),t(d)},[])}}function it(e){return(e==null?void 0:e.animationName)||"none"}const Ur=A["useId".toString()]||(()=>{});let Gr=0;function oe(e){const[n,t]=A.useState(Ur());return X(()=>{e||t(o=>o??String(Gr++))},[e]),e||(n?`radix-${n}`:"")}const In="Collapsible",[Yr,Dn]=ue(In),[Zr,Bt]=Yr(In),Xr=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,open:o,defaultOpen:r,disabled:i,onOpenChange:s,...a}=e,[l=!1,d]=we({prop:o,defaultProp:r,onChange:s});return c.createElement(Zr,{scope:t,disabled:i,contentId:oe(),open:l,onOpenToggle:c.useCallback(()=>d(u=>!u),[d])},c.createElement(k.div,E({"data-state":Wt(l),"data-disabled":i?"":void 0},a,{ref:n})))}),qr="CollapsibleTrigger",Jr=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,...o}=e,r=Bt(qr,t);return c.createElement(k.button,E({type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Wt(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled},o,{ref:n,onClick:N(e.onClick,r.onOpenToggle)}))}),Mn="CollapsibleContent",Qr=c.forwardRef((e,n)=>{const{forceMount:t,...o}=e,r=Bt(Mn,e.__scopeCollapsible);return c.createElement(ne,{present:t||r.open},({present:i})=>c.createElement(Rr,E({},o,{ref:n,present:i})))}),Rr=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,present:o,children:r,...i}=e,s=Bt(Mn,t),[a,l]=c.useState(o),d=c.useRef(null),u=H(n,d),f=c.useRef(0),g=f.current,h=c.useRef(0),m=h.current,p=s.open||a,v=c.useRef(p),$=c.useRef();return c.useEffect(()=>{const w=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(w)},[]),X(()=>{const w=d.current;if(w){$.current=$.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const b=w.getBoundingClientRect();f.current=b.height,h.current=b.width,v.current||(w.style.transitionDuration=$.current.transitionDuration,w.style.animationName=$.current.animationName),l(o)}},[s.open,o]),c.createElement(k.div,E({"data-state":Wt(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p},i,{ref:u,style:{["--radix-collapsible-content-height"]:g?`${g}px`:void 0,["--radix-collapsible-content-width"]:m?`${m}px`:void 0,...e.style}}),p&&r)});function Wt(e){return e?"open":"closed"}const ec=Xr,tc=Jr,nc=Qr,oc=c.createContext(void 0);function zt(e){const n=c.useContext(oc);return e||n||"ltr"}const xe="Accordion",rc=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ht,cc,ic]=ct(xe),[st,fd]=ue(xe,[ic,Dn]),Kt=Dn(),kn=c.forwardRef((e,n)=>{const{type:t,...o}=e,r=o,i=o;return c.createElement(Ht.Provider,{scope:e.__scopeAccordion},t==="multiple"?c.createElement(dc,E({},i,{ref:n})):c.createElement(lc,E({},r,{ref:n})))});kn.propTypes={type(e){const n=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof n=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(n)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[Ln,sc]=st(xe),[Fn,ac]=st(xe,{collapsible:!1}),lc=c.forwardRef((e,n)=>{const{value:t,defaultValue:o,onValueChange:r=()=>{},collapsible:i=!1,...s}=e,[a,l]=we({prop:t,defaultProp:o,onChange:r});return c.createElement(Ln,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:c.useCallback(()=>i&&l(""),[i,l])},c.createElement(Fn,{scope:e.__scopeAccordion,collapsible:i},c.createElement(Vn,E({},s,{ref:n}))))}),dc=c.forwardRef((e,n)=>{const{value:t,defaultValue:o,onValueChange:r=()=>{},...i}=e,[s=[],a]=we({prop:t,defaultProp:o,onChange:r}),l=c.useCallback(u=>a((f=[])=>[...f,u]),[a]),d=c.useCallback(u=>a((f=[])=>f.filter(g=>g!==u)),[a]);return c.createElement(Ln,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:d},c.createElement(Fn,{scope:e.__scopeAccordion,collapsible:!0},c.createElement(Vn,E({},i,{ref:n}))))}),[uc,at]=st(xe),Vn=c.forwardRef((e,n)=>{const{__scopeAccordion:t,disabled:o,dir:r,orientation:i="vertical",...s}=e,a=c.useRef(null),l=H(a,n),d=cc(t),f=zt(r)==="ltr",g=N(e.onKeyDown,h=>{var m;if(!rc.includes(h.key))return;const p=h.target,v=d().filter(T=>{var V;return!((V=T.ref.current)!==null&&V!==void 0&&V.disabled)}),$=v.findIndex(T=>T.ref.current===p),w=v.length;if($===-1)return;h.preventDefault();let b=$;const y=0,C=w-1,_=()=>{b=$+1,b>C&&(b=y)},P=()=>{b=$-1,b<y&&(b=C)};switch(h.key){case"Home":b=y;break;case"End":b=C;break;case"ArrowRight":i==="horizontal"&&(f?_():P());break;case"ArrowDown":i==="vertical"&&_();break;case"ArrowLeft":i==="horizontal"&&(f?P():_());break;case"ArrowUp":i==="vertical"&&P();break}const S=b%w;(m=v[S].ref.current)===null||m===void 0||m.focus()});return c.createElement(uc,{scope:t,disabled:o,direction:r,orientation:i},c.createElement(Ht.Slot,{scope:t},c.createElement(k.div,E({},s,{"data-orientation":i,ref:l,onKeyDown:o?void 0:g}))))}),jt="AccordionItem",[fc,Ut]=st(jt),pc=c.forwardRef((e,n)=>{const{__scopeAccordion:t,value:o,...r}=e,i=at(jt,t),s=sc(jt,t),a=Kt(t),l=oe(),d=o&&s.value.includes(o)||!1,u=i.disabled||e.disabled;return c.createElement(fc,{scope:t,open:d,disabled:u,triggerId:l},c.createElement(ec,E({"data-orientation":i.orientation,"data-state":Wn(d)},a,r,{ref:n,disabled:u,open:d,onOpenChange:f=>{f?s.onItemOpen(o):s.onItemClose(o)}})))}),mc="AccordionHeader",vc=c.forwardRef((e,n)=>{const{__scopeAccordion:t,...o}=e,r=at(xe,t),i=Ut(mc,t);return c.createElement(k.h3,E({"data-orientation":r.orientation,"data-state":Wn(i.open),"data-disabled":i.disabled?"":void 0},o,{ref:n}))}),Bn="AccordionTrigger",hc=c.forwardRef((e,n)=>{const{__scopeAccordion:t,...o}=e,r=at(xe,t),i=Ut(Bn,t),s=ac(Bn,t),a=Kt(t);return c.createElement(Ht.ItemSlot,{scope:t},c.createElement(tc,E({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":r.orientation,id:i.triggerId},a,o,{ref:n})))}),gc="AccordionContent",$c=c.forwardRef((e,n)=>{const{__scopeAccordion:t,...o}=e,r=at(xe,t),i=Ut(gc,t),s=Kt(t);return c.createElement(nc,E({role:"region","aria-labelledby":i.triggerId,"data-orientation":r.orientation},s,o,{ref:n,style:{["--radix-accordion-content-height"]:"var(--radix-collapsible-content-height)",["--radix-accordion-content-width"]:"var(--radix-collapsible-content-width)",...e.style}}))});function Wn(e){return e?"open":"closed"}const bc=kn,wc=pc,xc=vc,yc=hc,Cc=$c;function Ec(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}};/*!
2
+ Copyright (c) 2018 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var o=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var s=typeof i;if(s==="string"||s==="number")o.push(i);else if(Array.isArray(i)){if(i.length){var a=t.apply(null,i);a&&o.push(a)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){o.push(i.toString());continue}for(var l in i)n.call(i,l)&&i[l]&&o.push(l)}}}return o.join(" ")}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(zn);var _c=zn.exports;const O=Ec(_c),Gt=c.createContext(null),Hn=({children:e})=>{const[n,t]=c.useState(()=>{const o=localStorage.getItem("theme");return o!==null?o:"theme-amber"});return c.useEffect(()=>{localStorage.setItem("theme",n)},[n]),x.jsx(Gt.Provider,{value:{theme:n,changeTheme:t},children:e})},Yt=c.createContext(null),Kn=({children:e})=>{const[n,t]=c.useState(()=>{const o=localStorage.getItem("size");return o!==null?o:"3"});return c.useEffect(()=>{localStorage.setItem("size",n)},[n]),x.jsx(Yt.Provider,{value:{size:n,changeSize:t},children:e})},fe=()=>c.useContext(Gt),ye=()=>c.useContext(Yt),Sc=({items:e,className:n})=>{const{theme:t}=fe(),{size:o}=ye(),r=c.useRef(null),i=c.useRef(null);function s(){return i.current||(i.current=new Map),i.current}return x.jsx(bc,{className:O(t,`accordion-root${o}`,"bg-color2 shadow-[0_2px_10px] shadow-blackA7 max-w-fit max-h-fit",n),ref:r,type:e.length>1?"multiple":"single",children:e.map(a=>x.jsxs(wc,{className:O(t,"focus-within:shadow-color9 mt-px overflow-hidden first:mt-0 focus-within:relative focus-within:shadow-[0_0_0_2px]"),id:a.mainText,ref:l=>{const d=s();l?d.set(a.mainText,l):d.delete(a.mainText)},value:a.mainText,children:[x.jsx(xc,{className:O("flex"),children:x.jsx(yc,{className:O(t,`accordion-trigger${o}`,"text-color11 shadow-color9 hover:bg-color4 group flex flex-1 cursor-default items-center justify-between bg-color3 px-5 leading-none shadow-[0_1px_0] outline-none"),children:a.mainText})}),x.jsx(Cc,{className:O(t,`accordion-content${o}`,"text-color12 bg-color2 data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp overflow-hidden"),children:x.jsx("div",{className:O(`accordion-collapsibleText${o}`,"px-5 animate-fade-up"),children:a.collapsibleText})})]},a.mainText))})};function Ve(e,n){if(e==null)return{};var t={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(t[r]=e[r]);return t}var Pc=["color"],Tc=c.forwardRef(function(e,n){var t=e.color,o=t===void 0?"currentColor":t,r=Ve(e,Pc);return c.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:n}),c.createElement("path",{d:"M4.18179 6.18181C4.35753 6.00608 4.64245 6.00608 4.81819 6.18181L7.49999 8.86362L10.1818 6.18181C10.3575 6.00608 10.6424 6.00608 10.8182 6.18181C10.9939 6.35755 10.9939 6.64247 10.8182 6.81821L7.81819 9.81821C7.73379 9.9026 7.61934 9.95001 7.49999 9.95001C7.38064 9.95001 7.26618 9.9026 7.18179 9.81821L4.18179 6.81821C4.00605 6.64247 4.00605 6.35755 4.18179 6.18181Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Ac=["color"],Oc=c.forwardRef(function(e,n){var t=e.color,o=t===void 0?"currentColor":t,r=Ve(e,Ac);return c.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:n}),c.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Nc=["color"],jn=c.forwardRef(function(e,n){var t=e.color,o=t===void 0?"currentColor":t,r=Ve(e,Nc);return c.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:n}),c.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Ic=["color"],Dc=c.forwardRef(function(e,n){var t=e.color,o=t===void 0?"currentColor":t,r=Ve(e,Ic);return c.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:n}),c.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Mc=["color"],kc=c.forwardRef(function(e,n){var t=e.color,o=t===void 0?"currentColor":t,r=Ve(e,Mc);return c.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:n}),c.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Lc=["color"],Fc=c.forwardRef(function(e,n){var t=e.color,o=t===void 0?"currentColor":t,r=Ve(e,Lc);return c.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:n}),c.createElement("path",{d:"M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))});function Un(e,[n,t]){return Math.min(t,Math.max(n,e))}function Vc(e,n=globalThis==null?void 0:globalThis.document){const t=q(e);c.useEffect(()=>{const o=r=>{r.key==="Escape"&&t(r)};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[t,n])}const Zt="dismissableLayer.update",Bc="dismissableLayer.pointerDownOutside",Wc="dismissableLayer.focusOutside";let Gn;const zc=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lt=c.forwardRef((e,n)=>{var t;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...d}=e,u=c.useContext(zc),[f,g]=c.useState(null),h=(t=f==null?void 0:f.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,m]=c.useState({}),p=H(n,S=>g(S)),v=Array.from(u.layers),[$]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf($),b=f?v.indexOf(f):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,C=b>=w,_=Hc(S=>{const T=S.target,V=[...u.branches].some(I=>I.contains(T));!C||V||(i==null||i(S),a==null||a(S),S.defaultPrevented||l==null||l())},h),P=Kc(S=>{const T=S.target;[...u.branches].some(I=>I.contains(T))||(s==null||s(S),a==null||a(S),S.defaultPrevented||l==null||l())},h);return Vc(S=>{b===u.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},h),c.useEffect(()=>{if(f)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Gn=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Yn(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Gn)}},[f,h,o,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Yn())},[f,u]),c.useEffect(()=>{const S=()=>m({});return document.addEventListener(Zt,S),()=>document.removeEventListener(Zt,S)},[]),c.createElement(k.div,E({},d,{ref:p,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:N(e.onFocusCapture,P.onFocusCapture),onBlurCapture:N(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:N(e.onPointerDownCapture,_.onPointerDownCapture)}))});function Hc(e,n=globalThis==null?void 0:globalThis.document){const t=q(e),o=c.useRef(!1),r=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!o.current){let d=function(){Zn(Bc,t,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(n.removeEventListener("click",r.current),r.current=d,n.addEventListener("click",r.current,{once:!0})):d()}o.current=!1},s=window.setTimeout(()=>{n.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),n.removeEventListener("pointerdown",i),n.removeEventListener("click",r.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function Kc(e,n=globalThis==null?void 0:globalThis.document){const t=q(e),o=c.useRef(!1);return c.useEffect(()=>{const r=i=>{i.target&&!o.current&&Zn(Wc,t,{originalEvent:i},{discrete:!1})};return n.addEventListener("focusin",r),()=>n.removeEventListener("focusin",r)},[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Yn(){const e=new CustomEvent(Zt);document.dispatchEvent(e)}function Zn(e,n,t,{discrete:o}){const r=t.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&r.addEventListener(e,n,{once:!0}),o?Vt(r,i):r.dispatchEvent(i)}let Xt=0;function qt(){c.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!==null&&e!==void 0?e:Xn()),document.body.insertAdjacentElement("beforeend",(n=t[1])!==null&&n!==void 0?n:Xn()),Xt++,()=>{Xt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),Xt--}},[])}function Xn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const Jt="focusScope.autoFocusOnMount",Qt="focusScope.autoFocusOnUnmount",qn={bubbles:!1,cancelable:!0},Rt=c.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...s}=e,[a,l]=c.useState(null),d=q(r),u=q(i),f=c.useRef(null),g=H(n,p=>l(p)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let p=function(b){if(h.paused||!a)return;const y=b.target;a.contains(y)?f.current=y:Ce(f.current,{select:!0})},v=function(b){if(h.paused||!a)return;const y=b.relatedTarget;y!==null&&(a.contains(y)||Ce(f.current,{select:!0}))},$=function(b){const y=document.activeElement;for(const C of b)C.removedNodes.length>0&&(a!=null&&a.contains(y)||Ce(a))};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver($);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[o,a,h.paused]),c.useEffect(()=>{if(a){Rn.add(h);const p=document.activeElement;if(!a.contains(p)){const $=new CustomEvent(Jt,qn);a.addEventListener(Jt,d),a.dispatchEvent($),$.defaultPrevented||(jc(Xc(Jn(a)),{select:!0}),document.activeElement===p&&Ce(a))}return()=>{a.removeEventListener(Jt,d),setTimeout(()=>{const $=new CustomEvent(Qt,qn);a.addEventListener(Qt,u),a.dispatchEvent($),$.defaultPrevented||Ce(p??document.body,{select:!0}),a.removeEventListener(Qt,u),Rn.remove(h)},0)}}},[a,d,u,h]);const m=c.useCallback(p=>{if(!t&&!o||h.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,$=document.activeElement;if(v&&$){const w=p.currentTarget,[b,y]=Uc(w);b&&y?!p.shiftKey&&$===y?(p.preventDefault(),t&&Ce(b,{select:!0})):p.shiftKey&&$===b&&(p.preventDefault(),t&&Ce(y,{select:!0})):$===w&&p.preventDefault()}},[t,o,h.paused]);return c.createElement(k.div,E({tabIndex:-1},s,{ref:g,onKeyDown:m}))});function jc(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(Ce(o,{select:n}),document.activeElement!==t)return}function Uc(e){const n=Jn(e),t=Qn(n,e),o=Qn(n.reverse(),e);return[t,o]}function Jn(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function Qn(e,n){for(const t of e)if(!Gc(t,{upTo:n}))return t}function Gc(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Yc(e){return e instanceof HTMLInputElement&&"select"in e}function Ce(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&Yc(e)&&n&&e.select()}}const Rn=Zc();function Zc(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=eo(e,n),e.unshift(n)},remove(n){var t;e=eo(e,n),(t=e[0])===null||t===void 0||t.resume()}}}function eo(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Xc(e){return e.filter(n=>n.tagName!=="A")}function Be(e){return e.split("-")[1]}function en(e){return e==="y"?"height":"width"}function pe(e){return e.split("-")[0]}function Oe(e){return["top","bottom"].includes(pe(e))?"x":"y"}function to(e,n,t){let{reference:o,floating:r}=e;const i=o.x+o.width/2-r.width/2,s=o.y+o.height/2-r.height/2,a=Oe(n),l=en(a),d=o[l]/2-r[l]/2,u=a==="x";let f;switch(pe(n)){case"top":f={x:i,y:o.y-r.height};break;case"bottom":f={x:i,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:s};break;case"left":f={x:o.x-r.width,y:s};break;default:f={x:o.x,y:o.y}}switch(Be(n)){case"start":f[a]-=d*(t&&u?-1:1);break;case"end":f[a]+=d*(t&&u?-1:1)}return f}const qc=async(e,n,t)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=t,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(n));let d=await s.getElementRects({reference:e,floating:n,strategy:r}),{x:u,y:f}=to(d,o,l),g=o,h={},m=0;for(let p=0;p<a.length;p++){const{name:v,fn:$}=a[p],{x:w,y:b,data:y,reset:C}=await $({x:u,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:h,rects:d,platform:s,elements:{reference:e,floating:n}});u=w??u,f=b??f,h={...h,[v]:{...h[v],...y}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(g=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:r}):C.rects),{x:u,y:f}=to(d,g,l)),p=-1)}return{x:u,y:f,placement:g,strategy:r,middlewareData:h}};function me(e,n){return typeof e=="function"?e(n):e}function no(e){return typeof e!="number"?function(n){return{top:0,right:0,bottom:0,left:0,...n}}(e):{top:e,right:e,bottom:e,left:e}}function dt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function qe(e,n){var t;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:g=!1,padding:h=0}=me(n,e),m=no(h),p=a[g?f==="floating"?"reference":"floating":f],v=dt(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(p)))==null||t?p:p.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:l})),$=f==="floating"?{...s.floating,x:o,y:r}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(w))&&await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1},y=dt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:$,offsetParent:w,strategy:l}):$);return{top:(v.top-y.top+m.top)/b.y,bottom:(y.bottom-v.bottom+m.bottom)/b.y,left:(v.left-y.left+m.left)/b.x,right:(y.right-v.right+m.right)/b.x}}const Je=Math.min,Ne=Math.max;function tn(e,n,t){return Ne(e,Je(n,t))}const oo=e=>({name:"arrow",options:e,async fn(n){const{x:t,y:o,placement:r,rects:i,platform:s,elements:a}=n,{element:l,padding:d=0}=me(e,n)||{};if(l==null)return{};const u=no(d),f={x:t,y:o},g=Oe(r),h=en(g),m=await s.getDimensions(l),p=g==="y",v=p?"top":"left",$=p?"bottom":"right",w=p?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[g]-f[g]-i.floating[h],y=f[g]-i.reference[g],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let _=C?C[w]:0;_&&await(s.isElement==null?void 0:s.isElement(C))||(_=a.floating[w]||i.floating[h]);const P=b/2-y/2,S=_/2-m[h]/2-1,T=Je(u[v],S),V=Je(u[$],S),I=T,B=_-m[h]-V,L=_/2-m[h]/2+P,W=tn(I,L,B),F=Be(r)!=null&&L!=W&&i.reference[h]/2-(L<I?T:V)-m[h]/2<0?L<I?I-L:B-L:0;return{[g]:f[g]-F,data:{[g]:W,centerOffset:L-W+F}}}}),ro=["top","right","bottom","left"];ro.reduce((e,n)=>e.concat(n,n+"-start",n+"-end"),[]);const Jc={left:"right",right:"left",bottom:"top",top:"bottom"};function ut(e){return e.replace(/left|right|bottom|top/g,n=>Jc[n])}function Qc(e,n,t){t===void 0&&(t=!1);const o=Be(e),r=Oe(e),i=en(r);let s=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(s=ut(s)),{main:s,cross:ut(s)}}const Rc={start:"end",end:"start"};function nn(e){return e.replace(/start|end/g,n=>Rc[n])}const ei=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t;const{placement:o,middlewareData:r,rects:i,initialPlacement:s,platform:a,elements:l}=n,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...p}=me(e,n),v=pe(o),$=pe(s)===s,w=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=f||($||!m?[ut(s)]:function(I){const B=ut(I);return[nn(I),B,nn(B)]}(s));f||h==="none"||b.push(...function(I,B,L,W){const F=Be(I);let D=function(G,Z,te){const de=["left","right"],be=["right","left"],Se=["top","bottom"],Fe=["bottom","top"];switch(G){case"top":case"bottom":return te?Z?be:de:Z?de:be;case"left":case"right":return Z?Se:Fe;default:return[]}}(pe(I),L==="start",W);return F&&(D=D.map(G=>G+"-"+F),B&&(D=D.concat(D.map(nn)))),D}(s,m,h,w));const y=[s,...b],C=await qe(n,p),_=[];let P=((t=r.flip)==null?void 0:t.overflows)||[];if(d&&_.push(C[v]),u){const{main:I,cross:B}=Qc(o,i,w);_.push(C[I],C[B])}if(P=[...P,{placement:o,overflows:_}],!_.every(I=>I<=0)){var S,T;const I=(((S=r.flip)==null?void 0:S.index)||0)+1,B=y[I];if(B)return{data:{index:I,overflows:P},reset:{placement:B}};let L=(T=P.filter(W=>W.overflows[0]<=0).sort((W,F)=>W.overflows[1]-F.overflows[1])[0])==null?void 0:T.placement;if(!L)switch(g){case"bestFit":{var V;const W=(V=P.map(F=>[F.placement,F.overflows.filter(D=>D>0).reduce((D,G)=>D+G,0)]).sort((F,D)=>F[1]-D[1])[0])==null?void 0:V[0];W&&(L=W);break}case"initialPlacement":L=s}if(o!==L)return{reset:{placement:L}}}return{}}}};function co(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function io(e){return ro.some(n=>e[n]>=0)}const ti=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:t}=n,{strategy:o="referenceHidden",...r}=me(e,n);switch(o){case"referenceHidden":{const i=co(await qe(n,{...r,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:io(i)}}}case"escaped":{const i=co(await qe(n,{...r,altBoundary:!0}),t.floating);return{data:{escapedOffsets:i,escaped:io(i)}}}default:return{}}}}},ni=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){const{x:t,y:o}=n,r=await async function(i,s){const{placement:a,platform:l,elements:d}=i,u=await(l.isRTL==null?void 0:l.isRTL(d.floating)),f=pe(a),g=Be(a),h=Oe(a)==="x",m=["left","top"].includes(f)?-1:1,p=u&&h?-1:1,v=me(s,i);let{mainAxis:$,crossAxis:w,alignmentAxis:b}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...v};return g&&typeof b=="number"&&(w=g==="end"?-1*b:b),h?{x:w*p,y:$*m}:{x:$*m,y:w*p}}(n,e);return{x:t+r.x,y:o+r.y,data:r}}}};function so(e){return e==="x"?"y":"x"}const oi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x:$,y:w}=v;return{x:$,y:w}}},...l}=me(e,n),d={x:t,y:o},u=await qe(n,l),f=Oe(pe(r)),g=so(f);let h=d[f],m=d[g];if(i){const v=f==="y"?"bottom":"right";h=tn(h+u[f==="y"?"top":"left"],h,h-u[v])}if(s){const v=g==="y"?"bottom":"right";m=tn(m+u[g==="y"?"top":"left"],m,m-u[v])}const p=a.fn({...n,[f]:h,[g]:m});return{...p,data:{x:p.x-t,y:p.y-o}}}}},ri=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:t,y:o,placement:r,rects:i,middlewareData:s}=n,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=me(e,n),u={x:t,y:o},f=Oe(r),g=so(f);let h=u[f],m=u[g];const p=me(a,n),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const b=f==="y"?"height":"width",y=i.reference[f]-i.floating[b]+v.mainAxis,C=i.reference[f]+i.reference[b]-v.mainAxis;h<y?h=y:h>C&&(h=C)}if(d){var $,w;const b=f==="y"?"width":"height",y=["top","left"].includes(pe(r)),C=i.reference[g]-i.floating[b]+(y&&(($=s.offset)==null?void 0:$[g])||0)+(y?0:v.crossAxis),_=i.reference[g]+i.reference[b]+(y?0:((w=s.offset)==null?void 0:w[g])||0)-(y?v.crossAxis:0);m<C?m=C:m>_&&(m=_)}return{[f]:h,[g]:m}}}},ci=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:t,rects:o,platform:r,elements:i}=n,{apply:s=()=>{},...a}=me(e,n),l=await qe(n,a),d=pe(t),u=Be(t),f=Oe(t)==="x",{width:g,height:h}=o.floating;let m,p;d==="top"||d==="bottom"?(m=d,p=u===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(p=d,m=u==="end"?"top":"bottom");const v=h-l[m],$=g-l[p],w=!n.middlewareData.shift;let b=v,y=$;if(f){const _=g-l.left-l.right;y=u||w?Je($,_):_}else{const _=h-l.top-l.bottom;b=u||w?Je(v,_):_}if(w&&!u){const _=Ne(l.left,0),P=Ne(l.right,0),S=Ne(l.top,0),T=Ne(l.bottom,0);f?y=g-2*(_!==0||P!==0?_+P:Ne(l.left,l.right)):b=h-2*(S!==0||T!==0?S+T:Ne(l.top,l.bottom))}await s({...n,availableWidth:y,availableHeight:b});const C=await r.getDimensions(i.floating);return g!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function ee(e){var n;return((n=e.ownerDocument)==null?void 0:n.defaultView)||window}function re(e){return ee(e).getComputedStyle(e)}function ao(e){return e instanceof ee(e).Node}function Ee(e){return ao(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){return e instanceof ee(e).HTMLElement}function ve(e){return e instanceof ee(e).Element}function lo(e){return typeof ShadowRoot<"u"&&(e instanceof ee(e).ShadowRoot||e instanceof ShadowRoot)}function Qe(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=re(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function ii(e){return["table","td","th"].includes(Ee(e))}function on(e){const n=rn(),t=re(e);return t.transform!=="none"||t.perspective!=="none"||!!t.containerType&&t.containerType!=="normal"||!n&&!!t.backdropFilter&&t.backdropFilter!=="none"||!n&&!!t.filter&&t.filter!=="none"||["transform","perspective","filter"].some(o=>(t.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(t.contain||"").includes(o))}function rn(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ft(e){return["html","body","#document"].includes(Ee(e))}const cn=Math.min,We=Math.max,pt=Math.round,mt=Math.floor,Ie=e=>({x:e,y:e});function uo(e){const n=re(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=ce(e),i=r?e.offsetWidth:t,s=r?e.offsetHeight:o,a=pt(t)!==i||pt(o)!==s;return a&&(t=i,o=s),{width:t,height:o,$:a}}function sn(e){return ve(e)?e:e.contextElement}function ze(e){const n=sn(e);if(!ce(n))return Ie(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=uo(n);let s=(i?pt(t.width):t.width)/o,a=(i?pt(t.height):t.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const fo=Ie(0);function po(e,n,t){var o,r;if(n===void 0&&(n=!0),!rn())return fo;const i=e?ee(e):window;return!t||n&&t!==i?fo:{x:((o=i.visualViewport)==null?void 0:o.offsetLeft)||0,y:((r=i.visualViewport)==null?void 0:r.offsetTop)||0}}function De(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=sn(e);let s=Ie(1);n&&(o?ve(o)&&(s=ze(o)):s=ze(e));const a=po(i,t,o);let l=(r.left+a.x)/s.x,d=(r.top+a.y)/s.y,u=r.width/s.x,f=r.height/s.y;if(i){const g=ee(i),h=o&&ve(o)?ee(o):o;let m=g.frameElement;for(;m&&o&&h!==g;){const p=ze(m),v=m.getBoundingClientRect(),$=getComputedStyle(m),w=v.left+(m.clientLeft+parseFloat($.paddingLeft))*p.x,b=v.top+(m.clientTop+parseFloat($.paddingTop))*p.y;l*=p.x,d*=p.y,u*=p.x,f*=p.y,l+=w,d+=b,m=ee(m).frameElement}}return dt({width:u,height:f,x:l,y:d})}function he(e){return((ao(e)?e.ownerDocument:e.document)||window.document).documentElement}function vt(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function mo(e){return De(he(e)).left+vt(e).scrollLeft}function He(e){if(Ee(e)==="html")return e;const n=e.assignedSlot||e.parentNode||lo(e)&&e.host||he(e);return lo(n)?n.host:n}function vo(e){const n=He(e);return ft(n)?e.ownerDocument?e.ownerDocument.body:e.body:ce(n)&&Qe(n)?n:vo(n)}function ht(e,n){var t;n===void 0&&(n=[]);const o=vo(e),r=o===((t=e.ownerDocument)==null?void 0:t.body),i=ee(o);return r?n.concat(i,i.visualViewport||[],Qe(o)?o:[]):n.concat(o,ht(o))}function ho(e,n,t){let o;if(n==="viewport")o=function(r,i){const s=ee(r),a=he(r),l=s.visualViewport;let d=a.clientWidth,u=a.clientHeight,f=0,g=0;if(l){d=l.width,u=l.height;const h=rn();(!h||h&&i==="fixed")&&(f=l.offsetLeft,g=l.offsetTop)}return{width:d,height:u,x:f,y:g}}(e,t);else if(n==="document")o=function(r){const i=he(r),s=vt(r),a=r.ownerDocument.body,l=We(i.scrollWidth,i.clientWidth,a.scrollWidth,a.clientWidth),d=We(i.scrollHeight,i.clientHeight,a.scrollHeight,a.clientHeight);let u=-s.scrollLeft+mo(r);const f=-s.scrollTop;return re(a).direction==="rtl"&&(u+=We(i.clientWidth,a.clientWidth)-l),{width:l,height:d,x:u,y:f}}(he(e));else if(ve(n))o=function(r,i){const s=De(r,!0,i==="fixed"),a=s.top+r.clientTop,l=s.left+r.clientLeft,d=ce(r)?ze(r):Ie(1);return{width:r.clientWidth*d.x,height:r.clientHeight*d.y,x:l*d.x,y:a*d.y}}(n,t);else{const r=po(e);o={...n,x:n.x-r.x,y:n.y-r.y}}return dt(o)}function go(e,n){const t=He(e);return!(t===n||!ve(t)||ft(t))&&(re(t).position==="fixed"||go(t,n))}function $o(e,n){return ce(e)&&re(e).position!=="fixed"?n?n(e):e.offsetParent:null}function bo(e,n){const t=ee(e);if(!ce(e))return t;let o=$o(e,n);for(;o&&ii(o)&&re(o).position==="static";)o=$o(o,n);return o&&(Ee(o)==="html"||Ee(o)==="body"&&re(o).position==="static"&&!on(o))?t:o||function(r){let i=He(r);for(;ce(i)&&!ft(i);){if(on(i))return i;i=He(i)}return null}(e)||t}function si(e,n,t){const o=ce(n),r=he(n),i=t==="fixed",s=De(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const l=Ie(0);if(o||!o&&!i)if((Ee(n)!=="body"||Qe(r))&&(a=vt(n)),ce(n)){const d=De(n,!0,i,n);l.x=d.x+n.clientLeft,l.y=d.y+n.clientTop}else r&&(l.x=mo(r));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}const ai={getClippingRect:function(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const i=t==="clippingAncestors"?function(d,u){const f=u.get(d);if(f)return f;let g=ht(d).filter(v=>ve(v)&&Ee(v)!=="body"),h=null;const m=re(d).position==="fixed";let p=m?He(d):d;for(;ve(p)&&!ft(p);){const v=re(p),$=on(p);$||v.position!=="fixed"||(h=null),(m?!$&&!h:!$&&v.position==="static"&&h&&["absolute","fixed"].includes(h.position)||Qe(p)&&!$&&go(d,p))?g=g.filter(w=>w!==p):h=v,p=He(p)}return u.set(d,g),g}(n,this._c):[].concat(t),s=[...i,o],a=s[0],l=s.reduce((d,u)=>{const f=ho(n,u,r);return d.top=We(f.top,d.top),d.right=cn(f.right,d.right),d.bottom=cn(f.bottom,d.bottom),d.left=We(f.left,d.left),d},ho(n,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:n,offsetParent:t,strategy:o}=e;const r=ce(t),i=he(t);if(t===i)return n;let s={scrollLeft:0,scrollTop:0},a=Ie(1);const l=Ie(0);if((r||!r&&o!=="fixed")&&((Ee(t)!=="body"||Qe(i))&&(s=vt(t)),ce(t))){const d=De(t);a=ze(t),l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+l.x,y:n.y*a.y-s.scrollTop*a.y+l.y}},isElement:ve,getDimensions:function(e){return uo(e)},getOffsetParent:bo,getDocumentElement:he,getScale:ze,async getElementRects(e){let{reference:n,floating:t,strategy:o}=e;const r=this.getOffsetParent||bo,i=this.getDimensions;return{reference:si(n,await r(t),o),floating:{x:0,y:0,...await i(t)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>re(e).direction==="rtl"};function li(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,d=sn(e),u=r||i?[...d?ht(d):[],...ht(n)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",t,{passive:!0}),i&&v.addEventListener("resize",t)});const f=d&&a?function(v,$){let w,b=null;const y=he(v);function C(){clearTimeout(w),b&&b.disconnect(),b=null}return function _(P,S){P===void 0&&(P=!1),S===void 0&&(S=1),C();const{left:T,top:V,width:I,height:B}=v.getBoundingClientRect();if(P||$(),!I||!B)return;const L={rootMargin:-mt(V)+"px "+-mt(y.clientWidth-(T+I))+"px "+-mt(y.clientHeight-(V+B))+"px "+-mt(T)+"px",threshold:We(0,cn(1,S))||1};let W=!0;function F(D){const G=D[0].intersectionRatio;if(G!==S){if(!W)return _();G?_(!1,G):w=setTimeout(()=>{_(!1,1e-7)},100)}W=!1}try{b=new IntersectionObserver(F,{...L,root:y.ownerDocument})}catch{b=new IntersectionObserver(F,L)}b.observe(v)}(!0),C}(d,t):null;let g,h=-1,m=null;s&&(m=new ResizeObserver(v=>{let[$]=v;$&&$.target===d&&m&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(n)})),t()}),d&&!l&&m.observe(d),m.observe(n));let p=l?De(e):null;return l&&function v(){const $=De(e);!p||$.x===p.x&&$.y===p.y&&$.width===p.width&&$.height===p.height||t(),p=$,g=requestAnimationFrame(v)}(),t(),()=>{u.forEach(v=>{r&&v.removeEventListener("scroll",t),i&&v.removeEventListener("resize",t)}),f&&f(),m&&m.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const di=(e,n,t)=>{const o=new Map,r={platform:ai,...t},i={...r.platform,_c:o};return qc(e,n,{...r,platform:i})},ui=e=>{function n(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:e,fn(t){const{element:o,padding:r}=typeof e=="function"?e(t):e;return o&&n(o)?o.current!=null?oo({element:o.current,padding:r}).fn(t):{}:o?oo({element:o,padding:r}).fn(t):{}}}};var gt=typeof document<"u"?c.useLayoutEffect:c.useEffect;function $t(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,o,r;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!=n.length)return!1;for(o=t;o--!==0;)if(!$t(e[o],n[o]))return!1;return!0}if(r=Object.keys(e),t=r.length,t!==Object.keys(n).length)return!1;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=t;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!$t(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function wo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xo(e,n){const t=wo(e);return Math.round(n*t)/t}function yo(e){const n=A.useRef(e);return gt(()=>{n.current=e}),n}function fi(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:d}=e,[u,f]=A.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[g,h]=A.useState(o);$t(g,o)||h(o);const[m,p]=A.useState(null),[v,$]=A.useState(null),w=A.useCallback(D=>{D!=_.current&&(_.current=D,p(D))},[p]),b=A.useCallback(D=>{D!==P.current&&(P.current=D,$(D))},[$]),y=i||m,C=s||v,_=A.useRef(null),P=A.useRef(null),S=A.useRef(u),T=yo(l),V=yo(r),I=A.useCallback(()=>{if(!_.current||!P.current)return;const D={placement:n,strategy:t,middleware:g};V.current&&(D.platform=V.current),di(_.current,P.current,D).then(G=>{const Z={...G,isPositioned:!0};B.current&&!$t(S.current,Z)&&(S.current=Z,Lr.flushSync(()=>{f(Z)}))})},[g,n,t,V]);gt(()=>{d===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,f(D=>({...D,isPositioned:!1})))},[d]);const B=A.useRef(!1);gt(()=>(B.current=!0,()=>{B.current=!1}),[]),gt(()=>{if(y&&(_.current=y),C&&(P.current=C),y&&C){if(T.current)return T.current(y,C,I);I()}},[y,C,I,T]);const L=A.useMemo(()=>({reference:_,floating:P,setReference:w,setFloating:b}),[w,b]),W=A.useMemo(()=>({reference:y,floating:C}),[y,C]),F=A.useMemo(()=>{const D={position:t,left:0,top:0};if(!W.floating)return D;const G=xo(W.floating,u.x),Z=xo(W.floating,u.y);return a?{...D,transform:"translate("+G+"px, "+Z+"px)",...wo(W.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:G,top:Z}},[t,a,W.floating,u.x,u.y]);return A.useMemo(()=>({...u,update:I,refs:L,elements:W,floatingStyles:F}),[u,I,L,W,F])}const pi=c.forwardRef((e,n)=>{const{children:t,width:o=10,height:r=5,...i}=e;return c.createElement(k.svg,E({},i,{ref:n,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?t:c.createElement("polygon",{points:"0,0 30,0 15,10"}))});function mi(e){const[n,t]=c.useState(void 0);return X(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,d=Array.isArray(l)?l[0]:l;s=d.inlineSize,a=d.blockSize}else s=e.offsetWidth,a=e.offsetHeight;t({width:s,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0)},[e]),n}const Co="Popper",[Eo,bt]=ue(Co),[vi,_o]=Eo(Co),hi=e=>{const{__scopePopper:n,children:t}=e,[o,r]=c.useState(null);return c.createElement(vi,{scope:n,anchor:o,onAnchorChange:r},t)},gi="PopperAnchor",$i=c.forwardRef((e,n)=>{const{__scopePopper:t,virtualRef:o,...r}=e,i=_o(gi,t),s=c.useRef(null),a=H(n,s);return c.useEffect(()=>{i.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:c.createElement(k.div,E({},r,{ref:a}))}),So="PopperContent",[bi,wi]=Eo(So),xi=c.forwardRef((e,n)=>{var t,o,r,i,s,a,l,d;const{__scopePopper:u,side:f="bottom",sideOffset:g=0,align:h="center",alignOffset:m=0,arrowPadding:p=0,collisionBoundary:v=[],collisionPadding:$=0,sticky:w="partial",hideWhenDetached:b=!1,avoidCollisions:y=!0,onPlaced:C,..._}=e,P=_o(So,u),[S,T]=c.useState(null),V=H(n,Q=>T(Q)),[I,B]=c.useState(null),L=mi(I),W=(t=L==null?void 0:L.width)!==null&&t!==void 0?t:0,F=(o=L==null?void 0:L.height)!==null&&o!==void 0?o:0,D=f+(h!=="center"?"-"+h:""),G=typeof $=="number"?$:{top:0,right:0,bottom:0,left:0,...$},Z=Array.isArray(v)?v:[v],te=Z.length>0,de={padding:G,boundary:Z.filter(_i),altBoundary:te},{refs:be,floatingStyles:Se,placement:Fe,isPositioned:ae,middlewareData:le}=fi({strategy:"fixed",placement:D,whileElementsMounted:li,elements:{reference:P.anchor},middleware:[ni({mainAxis:g+F,alignmentAxis:m}),y&&oi({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?ri():void 0,...de}),y&&ei({...de}),ci({...de,apply:({elements:Q,rects:nt,availableWidth:ot,availableHeight:rt})=>{const{width:id,height:sd}=nt.reference,kt=Q.floating.style;kt.setProperty("--radix-popper-available-width",`${ot}px`),kt.setProperty("--radix-popper-available-height",`${rt}px`),kt.setProperty("--radix-popper-anchor-width",`${id}px`),kt.setProperty("--radix-popper-anchor-height",`${sd}px`)}}),I&&ui({element:I,padding:p}),Si({arrowWidth:W,arrowHeight:F}),b&&ti({strategy:"referenceHidden"})]}),[Pe,M]=Po(Fe),K=q(C);X(()=>{ae&&(K==null||K())},[ae,K]);const J=(r=le.arrow)===null||r===void 0?void 0:r.x,Y=(i=le.arrow)===null||i===void 0?void 0:i.y,j=((s=le.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[U,R]=c.useState();return X(()=>{S&&R(window.getComputedStyle(S).zIndex)},[S]),c.createElement("div",{ref:be.setFloating,"data-radix-popper-content-wrapper":"",style:{...Se,transform:ae?Se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,["--radix-popper-transform-origin"]:[(a=le.transformOrigin)===null||a===void 0?void 0:a.x,(l=le.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},c.createElement(bi,{scope:u,placedSide:Pe,onArrowChange:B,arrowX:J,arrowY:Y,shouldHideArrow:j},c.createElement(k.div,E({"data-side":Pe,"data-align":M},_,{ref:V,style:{..._.style,animation:ae?void 0:"none",opacity:(d=le.hide)!==null&&d!==void 0&&d.referenceHidden?0:void 0}}))))}),yi="PopperArrow",Ci={top:"bottom",right:"left",bottom:"top",left:"right"},Ei=c.forwardRef(function(n,t){const{__scopePopper:o,...r}=n,i=wi(yi,o),s=Ci[i.placedSide];return c.createElement("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},c.createElement(pi,E({},r,{ref:t,style:{...r.style,display:"block"}})))});function _i(e){return e!==null}const Si=e=>({name:"transformOrigin",options:e,fn(n){var t,o,r,i,s;const{placement:a,rects:l,middlewareData:d}=n,f=((t=d.arrow)===null||t===void 0?void 0:t.centerOffset)!==0,g=f?0:e.arrowWidth,h=f?0:e.arrowHeight,[m,p]=Po(a),v={start:"0%",center:"50%",end:"100%"}[p],$=((o=(r=d.arrow)===null||r===void 0?void 0:r.x)!==null&&o!==void 0?o:0)+g/2,w=((i=(s=d.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+h/2;let b="",y="";return m==="bottom"?(b=f?v:`${$}px`,y=`${-h}px`):m==="top"?(b=f?v:`${$}px`,y=`${l.floating.height+h}px`):m==="right"?(b=`${-h}px`,y=f?v:`${w}px`):m==="left"&&(b=`${l.floating.width+h}px`,y=f?v:`${w}px`),{data:{x:b,y}}}});function Po(e){const[n,t="center"]=e.split("-");return[n,t]}const To=hi,Ao=$i,Oo=xi,Pi=Ei,an=c.forwardRef((e,n)=>{var t;const{container:o=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...r}=e;return o?Te.createPortal(c.createElement(k.div,E({},r,{ref:n})),o):null});function No(e){const n=c.useRef({value:e,previous:e});return c.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}const Io=c.forwardRef((e,n)=>c.createElement(k.span,E({},e,{ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),Ti=Io;var Ai=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Ke=new WeakMap,wt=new WeakMap,xt={},ln=0,Do=function(e){return e&&(e.host||Do(e.parentNode))},Oi=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=Do(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},Ni=function(e,n,t,o){var r=Oi(n,Array.isArray(e)?e:[e]);xt[t]||(xt[t]=new WeakMap);var i=xt[t],s=[],a=new Set,l=new Set(r),d=function(f){!f||a.has(f)||(a.add(f),d(f.parentNode))};r.forEach(d);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))u(g);else{var h=g.getAttribute(o),m=h!==null&&h!=="false",p=(Ke.get(g)||0)+1,v=(i.get(g)||0)+1;Ke.set(g,p),i.set(g,v),s.push(g),p===1&&m&&wt.set(g,!0),v===1&&g.setAttribute(t,"true"),m||g.setAttribute(o,"true")}})};return u(n),a.clear(),ln++,function(){s.forEach(function(f){var g=Ke.get(f)-1,h=i.get(f)-1;Ke.set(f,g),i.set(f,h),g||(wt.has(f)||f.removeAttribute(o),wt.delete(f)),h||f.removeAttribute(t)}),ln--,ln||(Ke=new WeakMap,Ke=new WeakMap,wt=new WeakMap,xt={})}},dn=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=n||Ai(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),Ni(o,r,t,"aria-hidden")):function(){return null}},_e=function(){return _e=Object.assign||function(n){for(var t,o=1,r=arguments.length;o<r;o++){t=arguments[o];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},_e.apply(this,arguments)};function Ii(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]]);return t}function Di(e,n,t){if(t||arguments.length===2)for(var o=0,r=n.length,i;o<r;o++)(i||!(o in n))&&(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return e.concat(i||Array.prototype.slice.call(n))}typeof SuppressedError=="function"&&SuppressedError;var yt="right-scroll-bar-position",Ct="width-before-scroll-bar",Mi="with-scroll-bars-hidden",ki="--removed-body-scroll-bar-size";function Li(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function Fi(e,n){var t=c.useState(function(){return{value:e,callback:n,facade:{get current(){return t.value},set current(o){var r=t.value;r!==o&&(t.value=o,t.callback(o,r))}}}})[0];return t.callback=n,t.facade}function Vi(e,n){return Fi(n||null,function(t){return e.forEach(function(o){return Li(o,t)})})}var Et=function(){return Et=Object.assign||function(n){for(var t,o=1,r=arguments.length;o<r;o++){t=arguments[o];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Et.apply(this,arguments)};function Bi(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]]);return t}typeof SuppressedError=="function"&&SuppressedError;function Wi(e){return e}function zi(e,n){n===void 0&&(n=Wi);var t=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:e},useMedium:function(i){var s=n(i,o);return t.push(s),function(){t=t.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(o=!0;t.length;){var s=t;t=[],s.forEach(i)}t={push:function(a){return i(a)},filter:function(){return t}}},assignMedium:function(i){o=!0;var s=[];if(t.length){var a=t;t=[],a.forEach(i),s=t}var l=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(l)};d(),t={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),t}}}};return r}function Hi(e){e===void 0&&(e={});var n=zi(null);return n.options=Et({async:!0,ssr:!1},e),n}var Mo=function(e){var n=e.sideCar,t=Bi(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return A.createElement(o,Et({},t))};Mo.isSideCarExport=!0;function Ki(e,n){return e.useMedium(n),Mo}var ko=Hi(),un=function(){},_t=A.forwardRef(function(e,n){var t=A.useRef(null),o=A.useState({onScrollCapture:un,onWheelCapture:un,onTouchMoveCapture:un}),r=o[0],i=o[1],s=e.forwardProps,a=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,g=e.sideCar,h=e.noIsolation,m=e.inert,p=e.allowPinchZoom,v=e.as,$=v===void 0?"div":v,w=Ii(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=g,y=Vi([t,n]),C=_e(_e({},w),r);return A.createElement(A.Fragment,null,u&&A.createElement(b,{sideCar:ko,removeScrollBar:d,shards:f,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!p,lockRef:t}),s?A.cloneElement(A.Children.only(a),_e(_e({},C),{ref:y})):A.createElement($,_e({},C,{className:l,ref:y}),a))});_t.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_t.classNames={fullWidth:Ct,zeroRight:yt};var Lo,ji=function(){if(Lo)return Lo;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ui(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=ji();return n&&e.setAttribute("nonce",n),e}function Gi(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function Yi(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var Zi=function(){var e=0,n=null;return{add:function(t){e==0&&(n=Ui())&&(Gi(n,t),Yi(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},Xi=function(){var e=Zi();return function(n,t){A.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&t])}},Fo=function(){var e=Xi(),n=function(t){var o=t.styles,r=t.dynamic;return e(o,r),null};return n},qi={left:0,top:0,right:0,gap:0},fn=function(e){return parseInt(e||"",10)||0},Ji=function(e){var n=window.getComputedStyle(document.body),t=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],r=n[e==="padding"?"paddingRight":"marginRight"];return[fn(t),fn(o),fn(r)]},Qi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qi;var n=Ji(e),t=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-t+n[2]-n[0])}},Ri=Fo(),es=function(e,n,t,o){var r=e.left,i=e.top,s=e.right,a=e.gap;return t===void 0&&(t="margin"),`
6
+ .`.concat(Mi,` {
7
+ overflow: hidden `).concat(o,`;
8
+ padding-right: `).concat(a,"px ").concat(o,`;
9
+ }
10
+ body {
11
+ overflow: hidden `).concat(o,`;
12
+ overscroll-behavior: contain;
13
+ `).concat([n&&"position: relative ".concat(o,";"),t==="margin"&&`
14
+ padding-left: `.concat(r,`px;
15
+ padding-top: `).concat(i,`px;
16
+ padding-right: `).concat(s,`px;
17
+ margin-left:0;
18
+ margin-top:0;
19
+ margin-right: `).concat(a,"px ").concat(o,`;
20
+ `),t==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),`
21
+ }
22
+
23
+ .`).concat(yt,` {
24
+ right: `).concat(a,"px ").concat(o,`;
25
+ }
26
+
27
+ .`).concat(Ct,` {
28
+ margin-right: `).concat(a,"px ").concat(o,`;
29
+ }
30
+
31
+ .`).concat(yt," .").concat(yt,` {
32
+ right: 0 `).concat(o,`;
33
+ }
34
+
35
+ .`).concat(Ct," .").concat(Ct,` {
36
+ margin-right: 0 `).concat(o,`;
37
+ }
38
+
39
+ body {
40
+ `).concat(ki,": ").concat(a,`px;
41
+ }
42
+ `)},ts=function(e){var n=e.noRelative,t=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o,i=A.useMemo(function(){return Qi(r)},[r]);return A.createElement(Ri,{styles:es(i,!n,r,t?"":"!important")})},pn=!1;if(typeof window<"u")try{var St=Object.defineProperty({},"passive",{get:function(){return pn=!0,!0}});window.addEventListener("test",St,St),window.removeEventListener("test",St,St)}catch{pn=!1}var je=pn?{passive:!1}:!1,ns=function(e){return e.tagName==="TEXTAREA"},Vo=function(e,n){var t=window.getComputedStyle(e);return t[n]!=="hidden"&&!(t.overflowY===t.overflowX&&!ns(e)&&t[n]==="visible")},os=function(e){return Vo(e,"overflowY")},rs=function(e){return Vo(e,"overflowX")},Bo=function(e,n){var t=n;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var o=Wo(e,t);if(o){var r=zo(e,t),i=r[1],s=r[2];if(i>s)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},cs=function(e){var n=e.scrollTop,t=e.scrollHeight,o=e.clientHeight;return[n,t,o]},is=function(e){var n=e.scrollLeft,t=e.scrollWidth,o=e.clientWidth;return[n,t,o]},Wo=function(e,n){return e==="v"?os(n):rs(n)},zo=function(e,n){return e==="v"?cs(n):is(n)},ss=function(e,n){return e==="h"&&n==="rtl"?-1:1},as=function(e,n,t,o,r){var i=ss(e,window.getComputedStyle(n).direction),s=i*o,a=t.target,l=n.contains(a),d=!1,u=s>0,f=0,g=0;do{var h=zo(e,a),m=h[0],p=h[1],v=h[2],$=p-v-i*m;(m||$)&&Wo(e,a)&&(f+=$,g+=m),a=a.parentNode}while(!l&&a!==document.body||l&&(n.contains(a)||n===a));return(u&&(r&&f===0||!r&&s>f)||!u&&(r&&g===0||!r&&-s>g))&&(d=!0),d},Pt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ho=function(e){return[e.deltaX,e.deltaY]},Ko=function(e){return e&&"current"in e?e.current:e},ls=function(e,n){return e[0]===n[0]&&e[1]===n[1]},ds=function(e){return`
43
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
44
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
45
+ `)},us=0,Ue=[];function fs(e){var n=A.useRef([]),t=A.useRef([0,0]),o=A.useRef(),r=A.useState(us++)[0],i=A.useState(function(){return Fo()})[0],s=A.useRef(e);A.useEffect(function(){s.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var p=Di([e.lockRef.current],(e.shards||[]).map(Ko),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=A.useCallback(function(p,v){if("touches"in p&&p.touches.length===2)return!s.current.allowPinchZoom;var $=Pt(p),w=t.current,b="deltaX"in p?p.deltaX:w[0]-$[0],y="deltaY"in p?p.deltaY:w[1]-$[1],C,_=p.target,P=Math.abs(b)>Math.abs(y)?"h":"v";if("touches"in p&&P==="h"&&_.type==="range")return!1;var S=Bo(P,_);if(!S)return!0;if(S?C=P:(C=P==="v"?"h":"v",S=Bo(P,_)),!S)return!1;if(!o.current&&"changedTouches"in p&&(b||y)&&(o.current=C),!C)return!0;var T=o.current||C;return as(T,v,p,T==="h"?b:y,!0)},[]),l=A.useCallback(function(p){var v=p;if(!(!Ue.length||Ue[Ue.length-1]!==i)){var $="deltaY"in v?Ho(v):Pt(v),w=n.current.filter(function(C){return C.name===v.type&&C.target===v.target&&ls(C.delta,$)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(s.current.shards||[]).map(Ko).filter(Boolean).filter(function(C){return C.contains(v.target)}),y=b.length>0?a(v,b[0]):!s.current.noIsolation;y&&v.cancelable&&v.preventDefault()}}},[]),d=A.useCallback(function(p,v,$,w){var b={name:p,delta:v,target:$,should:w};n.current.push(b),setTimeout(function(){n.current=n.current.filter(function(y){return y!==b})},1)},[]),u=A.useCallback(function(p){t.current=Pt(p),o.current=void 0},[]),f=A.useCallback(function(p){d(p.type,Ho(p),p.target,a(p,e.lockRef.current))},[]),g=A.useCallback(function(p){d(p.type,Pt(p),p.target,a(p,e.lockRef.current))},[]);A.useEffect(function(){return Ue.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,je),document.addEventListener("touchmove",l,je),document.addEventListener("touchstart",u,je),function(){Ue=Ue.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,je),document.removeEventListener("touchmove",l,je),document.removeEventListener("touchstart",u,je)}},[]);var h=e.removeScrollBar,m=e.inert;return A.createElement(A.Fragment,null,m?A.createElement(i,{styles:ds(r)}):null,h?A.createElement(ts,{gapMode:"margin"}):null)}const ps=Ki(ko,fs);var jo=A.forwardRef(function(e,n){return A.createElement(_t,_e({},e,{ref:n,sideCar:ps}))});jo.classNames=_t.classNames;const mn=jo,ms=[" ","Enter","ArrowUp","ArrowDown"],vs=[" ","Enter"],Tt="Select",[At,Ot,hs]=ct(Tt),[Ge,hd]=ue(Tt,[hs,bt]),vn=bt(),[gs,Me]=Ge(Tt),[$s,bs]=Ge(Tt),ws=e=>{const{__scopeSelect:n,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:d,name:u,autoComplete:f,disabled:g,required:h}=e,m=vn(n),[p,v]=c.useState(null),[$,w]=c.useState(null),[b,y]=c.useState(!1),C=zt(d),[_=!1,P]=we({prop:o,defaultProp:r,onChange:i}),[S,T]=we({prop:s,defaultProp:a,onChange:l}),V=c.useRef(null),I=p?!!p.closest("form"):!0,[B,L]=c.useState(new Set),W=Array.from(B).map(F=>F.props.value).join(";");return c.createElement(To,m,c.createElement(gs,{required:h,scope:n,trigger:p,onTriggerChange:v,valueNode:$,onValueNodeChange:w,valueNodeHasChildren:b,onValueNodeHasChildrenChange:y,contentId:oe(),value:S,onValueChange:T,open:_,onOpenChange:P,dir:C,triggerPointerDownPosRef:V,disabled:g},c.createElement(At.Provider,{scope:n},c.createElement($s,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(F=>{L(D=>new Set(D).add(F))},[]),onNativeOptionRemove:c.useCallback(F=>{L(D=>{const G=new Set(D);return G.delete(F),G})},[])},t)),I?c.createElement(Qo,{key:W,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:S,onChange:F=>T(F.target.value),disabled:g},S===void 0?c.createElement("option",{value:""}):null,Array.from(B)):null))},xs="SelectTrigger",ys=c.forwardRef((e,n)=>{const{__scopeSelect:t,disabled:o=!1,...r}=e,i=vn(t),s=Me(xs,t),a=s.disabled||o,l=H(n,s.onTriggerChange),d=Ot(t),[u,f,g]=Ro(m=>{const p=d().filter(w=>!w.disabled),v=p.find(w=>w.value===s.value),$=er(p,m,v);$!==void 0&&s.onValueChange($.value)}),h=()=>{a||(s.onOpenChange(!0),g())};return c.createElement(Ao,E({asChild:!0},i),c.createElement(k.button,E({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":s.value===void 0?"":void 0},r,{ref:l,onClick:N(r.onClick,m=>{m.currentTarget.focus()}),onPointerDown:N(r.onPointerDown,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(h(),s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:N(r.onKeyDown,m=>{const p=u.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(p&&m.key===" ")&&ms.includes(m.key)&&(h(),m.preventDefault())})})))}),Cs="SelectValue",Es=c.forwardRef((e,n)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s,...a}=e,l=Me(Cs,t),{onValueNodeHasChildrenChange:d}=l,u=i!==void 0,f=H(n,l.onValueNodeChange);return X(()=>{d(u)},[d,u]),c.createElement(k.span,E({},a,{ref:f,style:{pointerEvents:"none"}}),l.value===void 0&&s!==void 0?s:i)}),_s=c.forwardRef((e,n)=>{const{__scopeSelect:t,children:o,...r}=e;return c.createElement(k.span,E({"aria-hidden":!0},r,{ref:n}),o||"▼")}),Ss=e=>c.createElement(an,E({asChild:!0},e)),Ye="SelectContent",Ps=c.forwardRef((e,n)=>{const t=Me(Ye,e.__scopeSelect),[o,r]=c.useState();if(X(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?Te.createPortal(c.createElement(Uo,{scope:e.__scopeSelect},c.createElement(At.Slot,{scope:e.__scopeSelect},c.createElement("div",null,e.children))),i):null}return c.createElement(Ts,E({},e,{ref:n}))}),ge=10,[Uo,ke]=Ge(Ye),Ts=c.forwardRef((e,n)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:v,...$}=e,w=Me(Ye,t),[b,y]=c.useState(null),[C,_]=c.useState(null),P=H(n,M=>y(M)),[S,T]=c.useState(null),[V,I]=c.useState(null),B=Ot(t),[L,W]=c.useState(!1),F=c.useRef(!1);c.useEffect(()=>{if(b)return dn(b)},[b]),qt();const D=c.useCallback(M=>{const[K,...J]=B().map(U=>U.ref.current),[Y]=J.slice(-1),j=document.activeElement;for(const U of M)if(U===j||(U==null||U.scrollIntoView({block:"nearest"}),U===K&&C&&(C.scrollTop=0),U===Y&&C&&(C.scrollTop=C.scrollHeight),U==null||U.focus(),document.activeElement!==j))return},[B,C]),G=c.useCallback(()=>D([S,b]),[D,S,b]);c.useEffect(()=>{L&&G()},[L,G]);const{onOpenChange:Z,triggerPointerDownPosRef:te}=w;c.useEffect(()=>{if(b){let M={x:0,y:0};const K=Y=>{var j,U,R,Q;M={x:Math.abs(Math.round(Y.pageX)-((j=(U=te.current)===null||U===void 0?void 0:U.x)!==null&&j!==void 0?j:0)),y:Math.abs(Math.round(Y.pageY)-((R=(Q=te.current)===null||Q===void 0?void 0:Q.y)!==null&&R!==void 0?R:0))}},J=Y=>{M.x<=10&&M.y<=10?Y.preventDefault():b.contains(Y.target)||Z(!1),document.removeEventListener("pointermove",K),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",K),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",J,{capture:!0})}}},[b,Z,te]),c.useEffect(()=>{const M=()=>Z(!1);return window.addEventListener("blur",M),window.addEventListener("resize",M),()=>{window.removeEventListener("blur",M),window.removeEventListener("resize",M)}},[Z]);const[de,be]=Ro(M=>{const K=B().filter(j=>!j.disabled),J=K.find(j=>j.ref.current===document.activeElement),Y=er(K,M,J);Y&&setTimeout(()=>Y.ref.current.focus())}),Se=c.useCallback((M,K,J)=>{const Y=!F.current&&!J;(w.value!==void 0&&w.value===K||Y)&&(T(M),Y&&(F.current=!0))},[w.value]),Fe=c.useCallback(()=>b==null?void 0:b.focus(),[b]),ae=c.useCallback((M,K,J)=>{const Y=!F.current&&!J;(w.value!==void 0&&w.value===K||Y)&&I(M)},[w.value]),le=o==="popper"?Go:As,Pe=le===Go?{side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:v}:{};return c.createElement(Uo,{scope:t,content:b,viewport:C,onViewportChange:_,itemRefCallback:Se,selectedItem:S,onItemLeave:Fe,itemTextRefCallback:ae,focusSelectedItem:G,selectedItemText:V,position:o,isPositioned:L,searchRef:de},c.createElement(mn,{as:Ae,allowPinchZoom:!0},c.createElement(Rt,{asChild:!0,trapped:w.open,onMountAutoFocus:M=>{M.preventDefault()},onUnmountAutoFocus:N(r,M=>{var K;(K=w.trigger)===null||K===void 0||K.focus({preventScroll:!0}),M.preventDefault()})},c.createElement(lt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:M=>M.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},c.createElement(le,E({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:M=>M.preventDefault()},$,Pe,{onPlaced:()=>W(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...$.style},onKeyDown:N($.onKeyDown,M=>{const K=M.ctrlKey||M.altKey||M.metaKey;if(M.key==="Tab"&&M.preventDefault(),!K&&M.key.length===1&&be(M.key),["ArrowUp","ArrowDown","Home","End"].includes(M.key)){let Y=B().filter(j=>!j.disabled).map(j=>j.ref.current);if(["ArrowUp","End"].includes(M.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(M.key)){const j=M.target,U=Y.indexOf(j);Y=Y.slice(U+1)}setTimeout(()=>D(Y)),M.preventDefault()}})}))))))}),As=c.forwardRef((e,n)=>{const{__scopeSelect:t,onPlaced:o,...r}=e,i=Me(Ye,t),s=ke(Ye,t),[a,l]=c.useState(null),[d,u]=c.useState(null),f=H(n,P=>u(P)),g=Ot(t),h=c.useRef(!1),m=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:$,focusSelectedItem:w}=s,b=c.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&p&&v&&$){const P=i.trigger.getBoundingClientRect(),S=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),V=$.getBoundingClientRect();if(i.dir!=="rtl"){const j=V.left-S.left,U=T.left-j,R=P.left-U,Q=P.width+R,nt=Math.max(Q,S.width),ot=window.innerWidth-ge,rt=Un(U,[ge,ot-nt]);a.style.minWidth=Q+"px",a.style.left=rt+"px"}else{const j=S.right-V.right,U=window.innerWidth-T.right-j,R=window.innerWidth-P.right-U,Q=P.width+R,nt=Math.max(Q,S.width),ot=window.innerWidth-ge,rt=Un(U,[ge,ot-nt]);a.style.minWidth=Q+"px",a.style.right=rt+"px"}const I=g(),B=window.innerHeight-ge*2,L=p.scrollHeight,W=window.getComputedStyle(d),F=parseInt(W.borderTopWidth,10),D=parseInt(W.paddingTop,10),G=parseInt(W.borderBottomWidth,10),Z=parseInt(W.paddingBottom,10),te=F+D+L+Z+G,de=Math.min(v.offsetHeight*5,te),be=window.getComputedStyle(p),Se=parseInt(be.paddingTop,10),Fe=parseInt(be.paddingBottom,10),ae=P.top+P.height/2-ge,le=B-ae,Pe=v.offsetHeight/2,M=v.offsetTop+Pe,K=F+D+M,J=te-K;if(K<=ae){const j=v===I[I.length-1].ref.current;a.style.bottom="0px";const U=d.clientHeight-p.offsetTop-p.offsetHeight,R=Math.max(le,Pe+(j?Fe:0)+U+G),Q=K+R;a.style.height=Q+"px"}else{const j=v===I[0].ref.current;a.style.top="0px";const R=Math.max(ae,F+p.offsetTop+(j?Se:0)+Pe)+J;a.style.height=R+"px",p.scrollTop=K-ae+p.offsetTop}a.style.margin=`${ge}px 0`,a.style.minHeight=de+"px",a.style.maxHeight=B+"px",o==null||o(),requestAnimationFrame(()=>h.current=!0)}},[g,i.trigger,i.valueNode,a,d,p,v,$,i.dir,o]);X(()=>b(),[b]);const[y,C]=c.useState();X(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const _=c.useCallback(P=>{P&&m.current===!0&&(b(),w==null||w(),m.current=!1)},[b,w]);return c.createElement(Os,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:_},c.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y}},c.createElement(k.div,E({},r,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}}))))}),Go=c.forwardRef((e,n)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=ge,...i}=e,s=vn(t);return c.createElement(Oo,E({},s,i,{ref:n,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Os,hn]=Ge(Ye,{}),Yo="SelectViewport",Ns=c.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=ke(Yo,t),i=hn(Yo,t),s=H(n,r.onViewportChange),a=c.useRef(0);return c.createElement(c.Fragment,null,c.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),c.createElement(At.Slot,{scope:t},c.createElement(k.div,E({"data-radix-select-viewport":"",role:"presentation"},o,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...o.style},onScroll:N(o.onScroll,l=>{const d=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&u){const g=Math.abs(a.current-d.scrollTop);if(g>0){const h=window.innerHeight-ge*2,m=parseFloat(u.style.minHeight),p=parseFloat(u.style.height),v=Math.max(m,p);if(v<h){const $=v+g,w=Math.min(h,$),b=$-w;u.style.height=w+"px",u.style.bottom==="0px"&&(d.scrollTop=b>0?b:0,u.style.justifyContent="flex-end")}}}a.current=d.scrollTop})}))))}),Is="SelectGroup",[Ds,Ms]=Ge(Is),ks=c.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=oe();return c.createElement(Ds,{scope:t,id:r},c.createElement(k.div,E({role:"group","aria-labelledby":r},o,{ref:n})))}),Ls="SelectLabel",Fs=c.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,r=Ms(Ls,t);return c.createElement(k.div,E({id:r.id},o,{ref:n}))}),gn="SelectItem",[Vs,Zo]=Ge(gn),Bs=c.forwardRef((e,n)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=e,a=Me(gn,t),l=ke(gn,t),d=a.value===o,[u,f]=c.useState(i??""),[g,h]=c.useState(!1),m=H(n,$=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,$,o,r)}),p=oe(),v=()=>{r||(a.onValueChange(o),a.onOpenChange(!1))};return c.createElement(Vs,{scope:t,value:o,disabled:r,textId:p,isSelected:d,onItemTextChange:c.useCallback($=>{f(w=>{var b;return w||((b=$==null?void 0:$.textContent)!==null&&b!==void 0?b:"").trim()})},[])},c.createElement(At.ItemSlot,{scope:t,value:o,disabled:r,textValue:u},c.createElement(k.div,E({role:"option","aria-labelledby":p,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1},s,{ref:m,onFocus:N(s.onFocus,()=>h(!0)),onBlur:N(s.onBlur,()=>h(!1)),onPointerUp:N(s.onPointerUp,v),onPointerMove:N(s.onPointerMove,$=>{if(r){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else $.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,$=>{if($.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:N(s.onKeyDown,$=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&$.key===" "||(vs.includes($.key)&&v(),$.key===" "&&$.preventDefault())})}))))}),Nt="SelectItemText",Ws=c.forwardRef((e,n)=>{const{__scopeSelect:t,className:o,style:r,...i}=e,s=Me(Nt,t),a=ke(Nt,t),l=Zo(Nt,t),d=bs(Nt,t),[u,f]=c.useState(null),g=H(n,$=>f($),l.onItemTextChange,$=>{var w;return(w=a.itemTextRefCallback)===null||w===void 0?void 0:w.call(a,$,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=c.useMemo(()=>c.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=d;return X(()=>(p(m),()=>v(m)),[p,v,m]),c.createElement(c.Fragment,null,c.createElement(k.span,E({id:l.textId},i,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Te.createPortal(i.children,s.valueNode):null)}),zs="SelectItemIndicator",Hs=c.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e;return Zo(zs,t).isSelected?c.createElement(k.span,E({"aria-hidden":!0},o,{ref:n})):null}),Xo="SelectScrollUpButton",Ks=c.forwardRef((e,n)=>{const t=ke(Xo,e.__scopeSelect),o=hn(Xo,e.__scopeSelect),[r,i]=c.useState(!1),s=H(n,o.onScrollButtonChange);return X(()=>{if(t.viewport&&t.isPositioned){let l=function(){const d=a.scrollTop>0;i(d)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?c.createElement(Jo,E({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=t;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),qo="SelectScrollDownButton",js=c.forwardRef((e,n)=>{const t=ke(qo,e.__scopeSelect),o=hn(qo,e.__scopeSelect),[r,i]=c.useState(!1),s=H(n,o.onScrollButtonChange);return X(()=>{if(t.viewport&&t.isPositioned){let l=function(){const d=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<d;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?c.createElement(Jo,E({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=t;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Jo=c.forwardRef((e,n)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=e,i=ke("SelectScrollButton",t),s=c.useRef(null),a=Ot(t),l=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),X(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(d=u.ref.current)===null||d===void 0||d.scrollIntoView({block:"nearest"})},[a]),c.createElement(k.div,E({"aria-hidden":!0},r,{ref:n,style:{flexShrink:0,...r.style},onPointerDown:N(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(r.onPointerMove,()=>{var d;(d=i.onItemLeave)===null||d===void 0||d.call(i),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(r.onPointerLeave,()=>{l()})}))}),Us=c.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e;return c.createElement(k.div,E({"aria-hidden":!0},o,{ref:n}))}),Qo=c.forwardRef((e,n)=>{const{value:t,...o}=e,r=c.useRef(null),i=H(n,r),s=No(t);return c.useEffect(()=>{const a=r.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),c.createElement(Io,{asChild:!0},c.createElement("select",E({},o,{ref:i,defaultValue:t})))});Qo.displayName="BubbleSelect";function Ro(e){const n=q(e),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const a=t.current+s;n(a),function l(d){t.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>l(""),1e3))}(a)},[n]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function er(e,n,t){const r=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,i=t?e.indexOf(t):-1;let s=Gs(e,Math.max(i,0));r.length===1&&(s=s.filter(d=>d!==t));const l=s.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==t?l:void 0}function Gs(e,n){return e.map((t,o)=>e[(n+o)%e.length])}const Ys=ws,Zs=ys,Xs=Es,qs=_s,Js=Ss,Qs=Ps,Rs=Ns,ea=ks,ta=Fs,na=Bs,oa=Ws,ra=Hs,ca=Ks,ia=js,sa=Us,aa=({label:e,placeholder:n,options:t,value:o,onValueChange:r,className:i,id:s})=>{const{theme:a}=fe(),{size:l}=ye();return x.jsxs(Ys,{value:o,onValueChange:r,children:[x.jsxs(Zs,{id:s,"aria-label":e,className:O(a,`select-trigger${l}`,"inline-flex items-center justify-center leading-none bg-color3 text-color11 shadow-[0_2px_10px] shadow-blackA7 hover:bg-color4 focus:shadow-[0_0_0_2px] focus:shadow-color10 data-[placeholder]:text-color9 outline-none",i),children:[x.jsx(Xs,{placeholder:n}),x.jsx(qs,{className:O(a,"select-icon text-color11"),children:x.jsx(jn,{})})]}),x.jsx(Js,{className:"z-10",children:x.jsxs(Qs,{className:O(a,`select-content${l}`,"overflow-hidden bg-color3 shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]"),children:[x.jsx(ca,{className:O(a,`select-scroll-up-button${l}`,"flex items-center justify-center bg-color3 text-color11 cursor-default"),children:x.jsx(Dc,{})}),x.jsx(Rs,{className:O(a,`select-viewport${l}`),children:t.map((d,u)=>x.jsxs("div",{children:[x.jsxs(ea,{children:[x.jsx(ta,{className:O(a,`select-label${l}`,"text-gray11"),children:d.label}),d.group.map(f=>x.jsx(tr,{theme:a,size:l,value:f.value,disabled:f.disabled,children:f.label},f.value))]}),t.length>1&&u<t.length-1&&x.jsx(sa,{className:O(a,`select-separator${l}`,"bg-color10")})]},d.label.toLowerCase()))}),x.jsx(ia,{className:O(a,`select-scroll-down-button${l}`,"flex items-center justify-center bg-color3 text-color11 cursor-default"),children:x.jsx(jn,{})})]})})]})},tr=c.forwardRef(({children:e,theme:n,size:t,...o},r)=>x.jsxs(na,{className:O(n,`select-item${t}`,"leading-none text-color11 flex items-center relative select-none data-[disabled]:text-gray8 data-[disabled]:pointer-events-none data-[highlighted]:outline-none data-[highlighted]:bg-color9 data-[highlighted]:text-color1"),...o,ref:r,children:[x.jsx(oa,{children:e}),x.jsx(ra,{className:O(n,`select-item-indicator${t}`,"absolute left-0 inline-flex items-center justify-center"),children:x.jsx(Oc,{})})]}));tr.displayName="SelectItem";const nr="Dialog",[or,rr]=ue(nr),[la,ie]=or(nr),da=e=>{const{__scopeDialog:n,children:t,open:o,defaultOpen:r,onOpenChange:i,modal:s=!0}=e,a=c.useRef(null),l=c.useRef(null),[d=!1,u]=we({prop:o,defaultProp:r,onChange:i});return c.createElement(la,{scope:n,triggerRef:a,contentRef:l,contentId:oe(),titleId:oe(),descriptionId:oe(),open:d,onOpenChange:u,onOpenToggle:c.useCallback(()=>u(f=>!f),[u]),modal:s},t)},ua="DialogTrigger",fa=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ie(ua,t),i=H(n,r.triggerRef);return c.createElement(k.button,E({type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":bn(r.open)},o,{ref:i,onClick:N(e.onClick,r.onOpenToggle)}))}),cr="DialogPortal",[pa,ir]=or(cr,{forceMount:void 0}),ma=e=>{const{__scopeDialog:n,forceMount:t,children:o,container:r}=e,i=ie(cr,n);return c.createElement(pa,{scope:n,forceMount:t},c.Children.map(o,s=>c.createElement(ne,{present:t||i.open},c.createElement(an,{asChild:!0,container:r},s))))},$n="DialogOverlay",va=c.forwardRef((e,n)=>{const t=ir($n,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,i=ie($n,e.__scopeDialog);return i.modal?c.createElement(ne,{present:o||i.open},c.createElement(ha,E({},r,{ref:n}))):null}),ha=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ie($n,t);return c.createElement(mn,{as:Ae,allowPinchZoom:!0,shards:[r.contentRef]},c.createElement(k.div,E({"data-state":bn(r.open)},o,{ref:n,style:{pointerEvents:"auto",...o.style}})))}),Ze="DialogContent",ga=c.forwardRef((e,n)=>{const t=ir(Ze,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,i=ie(Ze,e.__scopeDialog);return c.createElement(ne,{present:o||i.open},i.modal?c.createElement($a,E({},r,{ref:n})):c.createElement(ba,E({},r,{ref:n})))}),$a=c.forwardRef((e,n)=>{const t=ie(Ze,e.__scopeDialog),o=c.useRef(null),r=H(n,t.contentRef,o);return c.useEffect(()=>{const i=o.current;if(i)return dn(i)},[]),c.createElement(sr,E({},e,{ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:N(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=t.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:N(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:N(e.onFocusOutside,i=>i.preventDefault())}))}),ba=c.forwardRef((e,n)=>{const t=ie(Ze,e.__scopeDialog),o=c.useRef(!1),r=c.useRef(!1);return c.createElement(sr,E({},e,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;o.current||(a=t.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}o.current=!1,r.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const l=i.target;((a=t.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}}))}),sr=c.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:i,...s}=e,a=ie(Ze,t),l=c.useRef(null),d=H(n,l);return qt(),c.createElement(c.Fragment,null,c.createElement(Rt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:i},c.createElement(lt,E({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":bn(a.open)},s,{ref:d,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),ar="DialogTitle",wa=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ie(ar,t);return c.createElement(k.h2,E({id:r.titleId},o,{ref:n}))}),xa="DialogDescription",ya=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ie(xa,t);return c.createElement(k.p,E({id:r.descriptionId},o,{ref:n}))}),Ca="DialogClose",Ea=c.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ie(Ca,t);return c.createElement(k.button,E({type:"button"},o,{ref:n,onClick:N(e.onClick,()=>r.onOpenChange(!1))}))});function bn(e){return e?"open":"closed"}const _a="DialogTitleWarning",[Sa,gd]=Fr(_a,{contentName:Ze,titleName:ar,docsSlug:"dialog"}),Pa=da,Ta=fa,Aa=ma,Oa=va,Na=ga,Ia=wa,Da=ya,lr=Ea,Ma="AlertDialog",[ka,$d]=ue(Ma,[rr]),$e=rr(),La=e=>{const{__scopeAlertDialog:n,...t}=e,o=$e(n);return c.createElement(Pa,E({},o,t,{modal:!0}))},Fa=c.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=$e(t);return c.createElement(Ta,E({},r,o,{ref:n}))}),Va=e=>{const{__scopeAlertDialog:n,...t}=e,o=$e(n);return c.createElement(Aa,E({},o,t))},Ba=c.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=$e(t);return c.createElement(Oa,E({},r,o,{ref:n}))}),dr="AlertDialogContent",[Wa,za]=ka(dr),Ha=c.forwardRef((e,n)=>{const{__scopeAlertDialog:t,children:o,...r}=e,i=$e(t),s=c.useRef(null),a=H(n,s),l=c.useRef(null);return c.createElement(Sa,{contentName:dr,titleName:Ka,docsSlug:"alert-dialog"},c.createElement(Wa,{scope:t,cancelRef:l},c.createElement(Na,E({role:"alertdialog"},i,r,{ref:a,onOpenAutoFocus:N(r.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=l.current)===null||u===void 0||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault()}),c.createElement(Nn,null,o),!1)))}),Ka="AlertDialogTitle",ja=c.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=$e(t);return c.createElement(Ia,E({},r,o,{ref:n}))}),Ua=c.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=$e(t);return c.createElement(Da,E({},r,o,{ref:n}))}),Ga=c.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,r=$e(t);return c.createElement(lr,E({},r,o,{ref:n}))}),Ya="AlertDialogCancel",Za=c.forwardRef((e,n)=>{const{__scopeAlertDialog:t,...o}=e,{cancelRef:r}=za(Ya,t),i=$e(t),s=H(n,r);return c.createElement(lr,E({},i,o,{ref:s}))}),Xa=La,qa=Fa,Ja=Va,Qa=Ba,Ra=Ha,el=Ga,tl=Za,nl=ja,ol=Ua,rl=({texts:e,onAction:n,onCancel:t,className:o})=>{const{theme:r}=fe(),{size:i}=ye();return x.jsxs(Xa,{children:[x.jsx(qa,{asChild:!0,className:O(r,`alertdialog-trigger${i}`,"text-color11 hover:bg-color4 shadow-blackA7 inline-flex items-center justify-center bg-color3 font-medium leading-none shadow-[0_2px_10px] outline-none focus:shadow-[0_0_0_2px] focus:shadow-color10",o),children:x.jsx("button",{children:e.buttonTrigger})}),x.jsxs(Ja,{children:[x.jsx(Qa,{className:O(r,"bg-blackA9 data-[state=open]:animate-overlayShow fixed inset-0")}),x.jsxs(Ra,{className:O(r,`alertdialog-content${i}`,"data-[state=open]:animate-contentShow z-10 fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] bg-color2 shadow-color9 focus:outline-none"),children:[x.jsx(nl,{className:O(`alertdialog-title${i}`,"text-color12 m-0 font-medium"),children:e.content}),x.jsx(ol,{className:O(`alertdialog-description${i}`,"text-color11 mt-4 mb-5 leading-normal"),children:e.description}),x.jsxs("div",{className:O(`alertdialog-actions${i}`,"flex flex-wrap justify-end"),children:[x.jsx(tl,{asChild:!0,className:O(`alertdialog-cancel${i}`,"text-color11 bg-color4 hover:bg-color5 focus:shadow-color7 inline-flex items-center justify-center font-medium leading-none outline-none focus:shadow-[0_0_0_2px]"),children:x.jsx("button",{onClick:t,children:e.buttonCancel})}),x.jsx(el,{asChild:!0,className:O(`alertdialog-action${i}`,"text-error11 bg-error4 hover:bg-error5 focus:shadow-red7 inline-flex items-center justify-center font-medium leading-none outline-none focus:shadow-[0_0_0_2px]"),children:x.jsx("button",{onClick:n,children:e.action})})]})]})]})]})},Re="NavigationMenu",[wn,ur,cl]=ct(Re),[xn,il,sl]=ct(Re),[yn,bd]=ue(Re,[cl,sl]),[al,se]=yn(Re),[ll,dl]=yn(Re),ul=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,value:o,onValueChange:r,defaultValue:i,delayDuration:s=200,skipDelayDuration:a=300,orientation:l="horizontal",dir:d,...u}=e,[f,g]=c.useState(null),h=H(n,T=>g(T)),m=zt(d),p=c.useRef(0),v=c.useRef(0),$=c.useRef(0),[w,b]=c.useState(!0),[y="",C]=we({prop:o,onChange:T=>{const V=T!=="",I=a>0;V?(window.clearTimeout($.current),I&&b(!1)):(window.clearTimeout($.current),$.current=window.setTimeout(()=>b(!0),a)),r==null||r(T)},defaultProp:i}),_=c.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>C(""),150)},[C]),P=c.useCallback(T=>{window.clearTimeout(v.current),C(T)},[C]),S=c.useCallback(T=>{y===T?window.clearTimeout(v.current):p.current=window.setTimeout(()=>{window.clearTimeout(v.current),C(T)},s)},[y,C,s]);return c.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(v.current),window.clearTimeout($.current)},[]),c.createElement(fl,{scope:t,isRootMenu:!0,value:y,dir:m,orientation:l,rootNavigationMenu:f,onTriggerEnter:T=>{window.clearTimeout(p.current),w?S(T):P(T)},onTriggerLeave:()=>{window.clearTimeout(p.current),_()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:_,onItemSelect:T=>{C(V=>V===T?"":T)},onItemDismiss:()=>C("")},c.createElement(k.nav,E({"aria-label":"Main","data-orientation":l,dir:m},u,{ref:h})))}),fl=e=>{const{scope:n,isRootMenu:t,rootNavigationMenu:o,dir:r,orientation:i,children:s,value:a,onItemSelect:l,onItemDismiss:d,onTriggerEnter:u,onTriggerLeave:f,onContentEnter:g,onContentLeave:h}=e,[m,p]=c.useState(null),[v,$]=c.useState(new Map),[w,b]=c.useState(null);return c.createElement(al,{scope:n,isRootMenu:t,rootNavigationMenu:o,value:a,previousValue:No(a),baseId:oe(),dir:r,orientation:i,viewport:m,onViewportChange:p,indicatorTrack:w,onIndicatorTrackChange:b,onTriggerEnter:q(u),onTriggerLeave:q(f),onContentEnter:q(g),onContentLeave:q(h),onItemSelect:q(l),onItemDismiss:q(d),onViewportContentChange:c.useCallback((y,C)=>{$(_=>(_.set(y,C),new Map(_)))},[]),onViewportContentRemove:c.useCallback(y=>{$(C=>C.has(y)?(C.delete(y),new Map(C)):C)},[])},c.createElement(wn.Provider,{scope:n},c.createElement(ll,{scope:n,items:v},s)))},pl="NavigationMenuList",ml=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,...o}=e,r=se(pl,t),i=c.createElement(k.ul,E({"data-orientation":r.orientation},o,{ref:n}));return c.createElement(k.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange},c.createElement(wn.Slot,{scope:t},r.isRootMenu?c.createElement($r,{asChild:!0},i):i))}),vl="NavigationMenuItem",[hl,fr]=yn(vl),gl=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,value:o,...r}=e,i=oe(),s=o||i||"LEGACY_REACT_AUTO_VALUE",a=c.useRef(null),l=c.useRef(null),d=c.useRef(null),u=c.useRef(()=>{}),f=c.useRef(!1),g=c.useCallback((m="start")=>{if(a.current){u.current();const p=Cn(a.current);p.length&&En(m==="start"?p:p.reverse())}},[]),h=c.useCallback(()=>{if(a.current){const m=Cn(a.current);m.length&&(u.current=Tl(m))}},[]);return c.createElement(hl,{scope:t,value:s,triggerRef:l,contentRef:a,focusProxyRef:d,wasEscapeCloseRef:f,onEntryKeyDown:g,onFocusProxyEnter:g,onRootContentClose:h,onContentFocusOutside:h},c.createElement(k.li,E({},r,{ref:n})))}),pr="NavigationMenuTrigger",$l=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,disabled:o,...r}=e,i=se(pr,e.__scopeNavigationMenu),s=fr(pr,e.__scopeNavigationMenu),a=c.useRef(null),l=H(a,s.triggerRef,n),d=xr(i.baseId,s.value),u=yr(i.baseId,s.value),f=c.useRef(!1),g=c.useRef(!1),h=s.value===i.value;return c.createElement(c.Fragment,null,c.createElement(wn.ItemSlot,{scope:t,value:s.value},c.createElement(wr,{asChild:!0},c.createElement(k.button,E({id:d,disabled:o,"data-disabled":o?"":void 0,"data-state":Sn(h),"aria-expanded":h,"aria-controls":u},r,{ref:l,onPointerEnter:N(e.onPointerEnter,()=>{g.current=!1,s.wasEscapeCloseRef.current=!1}),onPointerMove:N(e.onPointerMove,Dt(()=>{o||g.current||s.wasEscapeCloseRef.current||f.current||(i.onTriggerEnter(s.value),f.current=!0)})),onPointerLeave:N(e.onPointerLeave,Dt(()=>{o||(i.onTriggerLeave(),f.current=!1)})),onClick:N(e.onClick,()=>{i.onItemSelect(s.value),g.current=h}),onKeyDown:N(e.onKeyDown,m=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];h&&m.key===v&&(s.onEntryKeyDown(),m.preventDefault())})})))),h&&c.createElement(c.Fragment,null,c.createElement(Ti,{"aria-hidden":!0,tabIndex:0,ref:s.focusProxyRef,onFocus:m=>{const p=s.contentRef.current,v=m.relatedTarget,$=v===a.current,w=p==null?void 0:p.contains(v);($||!w)&&s.onFocusProxyEnter($?"start":"end")}}),i.viewport&&c.createElement("span",{"aria-owns":u})))}),mr="navigationMenu.linkSelect",bl=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,active:o,onSelect:r,...i}=e;return c.createElement(wr,{asChild:!0},c.createElement(k.a,E({"data-active":o?"":void 0,"aria-current":o?"page":void 0},i,{ref:n,onClick:N(e.onClick,s=>{const a=s.target,l=new CustomEvent(mr,{bubbles:!0,cancelable:!0});if(a.addEventListener(mr,d=>r==null?void 0:r(d),{once:!0}),Vt(a,l),!l.defaultPrevented&&!s.metaKey){const d=new CustomEvent(It,{bubbles:!0,cancelable:!0});Vt(a,d)}},{checkForDefaultPrevented:!1})})))}),vr="NavigationMenuIndicator",wl=c.forwardRef((e,n)=>{const{forceMount:t,...o}=e,r=se(vr,e.__scopeNavigationMenu),i=!!r.value;return r.indicatorTrack?Te.createPortal(c.createElement(ne,{present:t||i},c.createElement(xl,E({},o,{ref:n}))),r.indicatorTrack):null}),xl=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,...o}=e,r=se(vr,t),i=ur(t),[s,a]=c.useState(null),[l,d]=c.useState(null),u=r.orientation==="horizontal",f=!!r.value;c.useEffect(()=>{var h;const p=(h=i().find(v=>v.value===r.value))===null||h===void 0?void 0:h.ref.current;p&&a(p)},[i,r.value]);const g=()=>{s&&d({size:u?s.offsetWidth:s.offsetHeight,offset:u?s.offsetLeft:s.offsetTop})};return _n(s,g),_n(r.indicatorTrack,g),l?c.createElement(k.div,E({"aria-hidden":!0,"data-state":f?"visible":"hidden","data-orientation":r.orientation},o,{ref:n,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...o.style}})):null}),et="NavigationMenuContent",yl=c.forwardRef((e,n)=>{const{forceMount:t,...o}=e,r=se(et,e.__scopeNavigationMenu),i=fr(et,e.__scopeNavigationMenu),s=H(i.contentRef,n),a=i.value===r.value,l={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...o};return r.viewport?c.createElement(Cl,E({forceMount:t},l,{ref:s})):c.createElement(ne,{present:t||a},c.createElement(hr,E({"data-state":Sn(a)},l,{ref:s,onPointerEnter:N(e.onPointerEnter,r.onContentEnter),onPointerLeave:N(e.onPointerLeave,Dt(r.onContentLeave)),style:{pointerEvents:!a&&r.isRootMenu?"none":void 0,...l.style}})))}),Cl=c.forwardRef((e,n)=>{const t=se(et,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=t;return X(()=>{o(e.value,{ref:n,...e})},[e,n,o]),X(()=>()=>r(e.value),[e.value,r]),null}),It="navigationMenu.rootContentDismiss",hr=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,value:o,triggerRef:r,focusProxyRef:i,wasEscapeCloseRef:s,onRootContentClose:a,onContentFocusOutside:l,...d}=e,u=se(et,t),f=c.useRef(null),g=H(f,n),h=xr(u.baseId,o),m=yr(u.baseId,o),p=ur(t),v=c.useRef(null),{onItemDismiss:$}=u;c.useEffect(()=>{const b=f.current;if(u.isRootMenu&&b){const y=()=>{var C;$(),a(),b.contains(document.activeElement)&&((C=r.current)===null||C===void 0||C.focus())};return b.addEventListener(It,y),()=>b.removeEventListener(It,y)}},[u.isRootMenu,e.value,r,$,a]);const w=c.useMemo(()=>{const y=p().map(V=>V.value);u.dir==="rtl"&&y.reverse();const C=y.indexOf(u.value),_=y.indexOf(u.previousValue),P=o===u.value,S=_===y.indexOf(o);if(!P&&!S)return v.current;const T=(()=>{if(C!==_){if(P&&_!==-1)return C>_?"from-end":"from-start";if(S&&C!==-1)return C>_?"to-start":"to-end"}return null})();return v.current=T,T},[u.previousValue,u.value,u.dir,p,o]);return c.createElement($r,{asChild:!0},c.createElement(lt,E({id:m,"aria-labelledby":h,"data-motion":w,"data-orientation":u.orientation},d,{ref:g,onDismiss:()=>{var b;const y=new Event(It,{bubbles:!0,cancelable:!0});(b=f.current)===null||b===void 0||b.dispatchEvent(y)},onFocusOutside:N(e.onFocusOutside,b=>{var y;l();const C=b.target;(y=u.rootNavigationMenu)!==null&&y!==void 0&&y.contains(C)&&b.preventDefault()}),onPointerDownOutside:N(e.onPointerDownOutside,b=>{var y;const C=b.target,_=p().some(S=>{var T;return(T=S.ref.current)===null||T===void 0?void 0:T.contains(C)}),P=u.isRootMenu&&((y=u.viewport)===null||y===void 0?void 0:y.contains(C));(_||P||!u.isRootMenu)&&b.preventDefault()}),onKeyDown:N(e.onKeyDown,b=>{const y=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!y){const P=Cn(b.currentTarget),S=document.activeElement,T=P.findIndex(B=>B===S),I=b.shiftKey?P.slice(0,T).reverse():P.slice(T+1,P.length);if(En(I))b.preventDefault();else{var _;(_=i.current)===null||_===void 0||_.focus()}}}),onEscapeKeyDown:N(e.onEscapeKeyDown,b=>{s.current=!0})})))}),gr="NavigationMenuViewport",El=c.forwardRef((e,n)=>{const{forceMount:t,...o}=e,i=!!se(gr,e.__scopeNavigationMenu).value;return c.createElement(ne,{present:t||i},c.createElement(_l,E({},o,{ref:n})))}),_l=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,children:o,...r}=e,i=se(gr,t),s=H(n,i.onViewportChange),a=dl(et,e.__scopeNavigationMenu),[l,d]=c.useState(null),[u,f]=c.useState(null),g=l?(l==null?void 0:l.width)+"px":void 0,h=l?(l==null?void 0:l.height)+"px":void 0,m=!!i.value,p=m?i.value:i.previousValue;return _n(u,()=>{u&&d({width:u.offsetWidth,height:u.offsetHeight})}),c.createElement(k.div,E({"data-state":Sn(m),"data-orientation":i.orientation},r,{ref:s,style:{pointerEvents:!m&&i.isRootMenu?"none":void 0,["--radix-navigation-menu-viewport-width"]:g,["--radix-navigation-menu-viewport-height"]:h,...r.style},onPointerEnter:N(e.onPointerEnter,i.onContentEnter),onPointerLeave:N(e.onPointerLeave,Dt(i.onContentLeave))}),Array.from(a.items).map(([$,{ref:w,forceMount:b,...y}])=>{const C=p===$;return c.createElement(ne,{key:$,present:b||C},c.createElement(hr,E({},y,{ref:Lt(w,_=>{C&&_&&f(_)})})))}))}),Sl="FocusGroup",$r=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,...o}=e,r=se(Sl,t);return c.createElement(xn.Provider,{scope:t},c.createElement(xn.Slot,{scope:t},c.createElement(k.div,E({dir:r.dir},o,{ref:n}))))}),br=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Pl="FocusGroupItem",wr=c.forwardRef((e,n)=>{const{__scopeNavigationMenu:t,...o}=e,r=il(t),i=se(Pl,t);return c.createElement(xn.ItemSlot,{scope:t},c.createElement(k.button,E({},o,{ref:n,onKeyDown:N(e.onKeyDown,s=>{if(["Home","End",...br].includes(s.key)){let l=r().map(f=>f.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(s.key)&&l.reverse(),br.includes(s.key)){const f=l.indexOf(s.currentTarget);l=l.slice(f+1)}setTimeout(()=>En(l)),s.preventDefault()}})})))});function Cn(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function En(e){const n=document.activeElement;return e.some(t=>t===n?!0:(t.focus(),document.activeElement!==n))}function Tl(e){return e.forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")}),()=>{e.forEach(n=>{const t=n.dataset.tabindex;n.setAttribute("tabindex",t)})}}function _n(e,n){const t=q(n);X(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(t)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,t])}function Sn(e){return e?"open":"closed"}function xr(e,n){return`${e}-trigger-${n}`}function yr(e,n){return`${e}-content-${n}`}function Dt(e){return n=>n.pointerType==="mouse"?e(n):void 0}const Al=ul,Ol=ml,Nl=gl,Il=$l,Cr=bl,Dl=wl,Ml=yl,kl=El,Ll=({items:e,className:n})=>{const{theme:t}=fe(),{size:o}=ye();return x.jsxs(Al,{className:O(t,"relative flex w-full justify-center z-50",n),children:[x.jsxs(Ol,{className:O(t,`navigation-menu-list${o}`,"center shadow-blackA7 m-0 flex flex-wrap list-none bg-color3 shadow-[0_2px_10px]"),children:[e.map((r,i)=>x.jsx(Nl,{children:r.item?x.jsxs(x.Fragment,{children:[x.jsxs(Il,{className:O(t,`navigation-menu-trigger${o}`,"text-color11 hover:bg-color4 focus:shadow-color7 group flex select-none items-center justify-between font-medium leading-none outline-none focus:shadow-[0_0_0_2px]"),children:[r.title,x.jsx(Tc,{className:O(t,"text-color10 relative transition-transform duration-[250] ease-in group-data-[state=open]:-rotate-180"),"aria-hidden":!0})]}),x.jsx(Ml,{className:O(t,`navigation-menu-content${o}`,"data-[motion=from-start]:animate-enterFromLeft data-[motion=from-end]:animate-enterFromRight data-[motion=to-start]:animate-exitToLeft data-[motion=to-end]:animate-exitToRight absolute top-0 left-0 w-full sm:w-auto"),children:x.jsx("ul",{className:O(t,"one m-0 grid list-none sm:grid-cols-[0.75fr_1fr]"),children:r.item.map((s,a)=>x.jsx(Er,{type:s.type,theme:t,href:s.href,title:s.title,size:o,children:s.text},`${s.title}-${a}`))})})]}):x.jsx(Cr,{className:O(`navigation-menu-simple-link${o}`,"text-color11 hover:bg-color4 focus:shadow-color7 block select-none font-medium leading-none no-underline outline-none focus:shadow-[0_0_0_2px]"),href:r.href,children:r.title})},`${r.title}-${i}`)),x.jsx(Dl,{className:O(t,`navigation-menu-indicator${o}`,"data-[state=visible]:animate-fadeIn data-[state=hidden]:animate-fadeOut top-full z-10 flex items-end justify-center overflow-hidden transition-[width,transform_250ms_ease]"),children:x.jsx("div",{className:O(t,"relative bg-color3")})})]}),x.jsx("div",{className:O(t,"perspective-[2000px] absolute top-full left-0 flex flex-col w-[inherit] md:flex-row md:w-fit justify-center"),children:x.jsx(kl,{className:O(t,`navigation-menu-viewport${o}`,"data-[state=open]:animate-scaleIn data-[state=closed]:animate-scaleOut relative h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden bg-color3 transition-[width,_height] duration-300 sm:w-[calc(var(--radix-navigation-menu-viewport-width)-64px)]")})})]})},Er=c.forwardRef(({className:e,children:n,theme:t,title:o,type:r,size:i,...s},a)=>x.jsx("li",{className:O(t,r==="card"&&"row-span-3 grid"),children:x.jsx(Cr,{asChild:!0,children:x.jsxs("a",{className:O(t,`navigation-menu-link${i}`,r==="card"?"card-nav focus:shadow-color7 bg-color7 flex h-full w-full select-none flex-col justify-end no-underline outline-none focus:shadow-[0_0_0_2px]":"text-nav focus:shadow-[0_0_0_2px] focus:shadow-color7 hover:bg-color4 block select-none leading-none no-underline outline-none transition-colors",e),...s,ref:a,children:[r==="card"&&x.jsxs("svg",{"aria-hidden":!0,width:"38",height:"38",viewBox:"0 0 25 25",fill:"white",className:"my-4",children:[x.jsx("path",{d:"M12 25C7.58173 25 4 21.4183 4 17C4 12.5817 7.58173 9 12 9V25Z"}),x.jsx("path",{d:"M12 0H4V8H12V0Z"}),x.jsx("path",{d:"M17 8C19.2091 8 21 6.20914 21 4C21 1.79086 19.2091 0 17 0C14.7909 0 13 1.79086 13 4C13 6.20914 14.7909 8 17 8Z"})]}),x.jsx("div",{className:"text-color12 font-medium leading-[1.2]",children:o}),x.jsx("p",{className:"text-color11 leading-[1.4]",children:n})]})})}));Er.displayName="ListItem";const _r="Popover",[Sr,wd]=ue(_r,[bt]),Mt=bt(),[Fl,Le]=Sr(_r),Vl=e=>{const{__scopePopover:n,children:t,open:o,defaultOpen:r,onOpenChange:i,modal:s=!1}=e,a=Mt(n),l=c.useRef(null),[d,u]=c.useState(!1),[f=!1,g]=we({prop:o,defaultProp:r,onChange:i});return c.createElement(To,a,c.createElement(Fl,{scope:n,contentId:oe(),triggerRef:l,open:f,onOpenChange:g,onOpenToggle:c.useCallback(()=>g(h=>!h),[g]),hasCustomAnchor:d,onCustomAnchorAdd:c.useCallback(()=>u(!0),[]),onCustomAnchorRemove:c.useCallback(()=>u(!1),[]),modal:s},t))},Bl="PopoverTrigger",Wl=c.forwardRef((e,n)=>{const{__scopePopover:t,...o}=e,r=Le(Bl,t),i=Mt(t),s=H(n,r.triggerRef),a=c.createElement(k.button,E({type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Ar(r.open)},o,{ref:s,onClick:N(e.onClick,r.onOpenToggle)}));return r.hasCustomAnchor?a:c.createElement(Ao,E({asChild:!0},i),a)}),Pr="PopoverPortal",[zl,Hl]=Sr(Pr,{forceMount:void 0}),Kl=e=>{const{__scopePopover:n,forceMount:t,children:o,container:r}=e,i=Le(Pr,n);return c.createElement(zl,{scope:n,forceMount:t},c.createElement(ne,{present:t||i.open},c.createElement(an,{asChild:!0,container:r},o)))},tt="PopoverContent",jl=c.forwardRef((e,n)=>{const t=Hl(tt,e.__scopePopover),{forceMount:o=t.forceMount,...r}=e,i=Le(tt,e.__scopePopover);return c.createElement(ne,{present:o||i.open},i.modal?c.createElement(Ul,E({},r,{ref:n})):c.createElement(Gl,E({},r,{ref:n})))}),Ul=c.forwardRef((e,n)=>{const t=Le(tt,e.__scopePopover),o=c.useRef(null),r=H(n,o),i=c.useRef(!1);return c.useEffect(()=>{const s=o.current;if(s)return dn(s)},[]),c.createElement(mn,{as:Ae,allowPinchZoom:!0},c.createElement(Tr,E({},e,{ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:N(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=t.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:N(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,d=a.button===2||l;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:N(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),Gl=c.forwardRef((e,n)=>{const t=Le(tt,e.__scopePopover),o=c.useRef(!1),r=c.useRef(!1);return c.createElement(Tr,E({},e,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;o.current||(a=t.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}o.current=!1,r.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const l=i.target;((a=t.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}}))}),Tr=c.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...f}=e,g=Le(tt,t),h=Mt(t);return qt(),c.createElement(Rt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:i},c.createElement(lt,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1)},c.createElement(Oo,E({"data-state":Ar(g.open),role:"dialog",id:g.contentId},h,f,{ref:n,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))}),Yl="PopoverClose",Zl=c.forwardRef((e,n)=>{const{__scopePopover:t,...o}=e,r=Le(Yl,t);return c.createElement(k.button,E({type:"button"},o,{ref:n,onClick:N(e.onClick,()=>r.onOpenChange(!1))}))}),Xl=c.forwardRef((e,n)=>{const{__scopePopover:t,...o}=e,r=Mt(t);return c.createElement(Pi,E({},r,o,{ref:n}))});function Ar(e){return e?"open":"closed"}const ql=Vl,Jl=Wl,Ql=Kl,Rl=jl,ed=Zl,td=Xl,nd=({buttonTriggerLabel:e,fields:n,className:t})=>{const{theme:o}=fe(),{size:r}=ye();return x.jsxs(ql,{children:[x.jsx(Jl,{asChild:!0,children:x.jsx("button",{className:O(o,`popover-trigger${r}`,"rounded-full inline-flex items-center justify-center text-color11 bg-color3 shadow-[0_2px_10px] shadow-blackA7 hover:bg-color4 focus:shadow-[0_0_0_2px] focus:shadow-black outline-none",t),"aria-label":e,children:x.jsx(Fc,{})})}),x.jsx(Ql,{children:x.jsxs(Rl,{className:O(o,`popover-content${r}`,"bg-color3 shadow-[0_10px_38px_-10px_hsla(206,22%,7%,.35),0_10px_20px_-15px_hsla(206,22%,7%,.2)] focus:shadow-[0_10px_38px_-10px_hsla(206,22%,7%,.35),0_10px_20px_-15px_hsla(206,22%,7%,.2),0_0_0_2px_hsla(206,22%,7%,.2)] will-change-[transform,opacity] data-[state=open]:data-[side=top]:animate-slideDownAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade"),children:[n.map((i,s)=>x.jsxs("div",{className:O(o,`popover-content-container${r}`,"flex flex-col"),children:[x.jsx("p",{className:O(o,`popover-content-paragraph${r}`,"text-color12 font-medium"),children:i.fieldTitle}),i.field.map(a=>x.jsxs("fieldset",{className:O(o,"flex justify-between items-center"),children:[x.jsx("label",{className:O(o,"text-color11"),htmlFor:a.htmlFor,children:a.label}),x.jsx("input",{className:O(o,"w-full inline-flex items-center justify-center flex-1 leading-none text-color11 shadow-[0_0_0_1px] shadow-color7 focus:shadow-[0_0_0_2px] focus:shadow-color8 outline-none"),id:a.id,defaultValue:a.defaultValue})]},`${s}-${a.label}`))]},`${s}-${i.fieldTitle}`)),x.jsx(ed,{className:O(o,`popover-close${r}`,"rounded-full inline-flex items-center justify-center text-color11 absolute hover:bg-color4 focus:shadow-[0_0_0_2px] focus:shadow-color7 outline-none"),"aria-label":"Close",children:x.jsx(kc,{})}),x.jsx(td,{className:O(o,"fill-color3")})]})})]})},Or="oryx-theme-interactions";class Nr{constructor(){Xe(this,"interactions",[]);Xe(this,"currentSession",null);this.loadFromStorage()}startSession(n,t){this.currentSession&&this.endSession(),this.currentSession={theme:n,size:t,startTime:Date.now()}}endSession(){if(!this.currentSession)return;const t=Date.now()-this.currentSession.startTime,o=new Date(this.currentSession.startTime),r={theme:this.currentSession.theme,size:this.currentSession.size,timestamp:this.currentSession.startTime,duration:t,dayOfWeek:o.getDay(),hourOfDay:o.getHours()};this.interactions.push(r),this.currentSession=null,this.interactions.length>1e3&&(this.interactions=this.interactions.slice(-1e3)),this.saveToStorage()}getInteractions(){return[...this.interactions]}getInteractionsInRange(n,t){return this.interactions.filter(o=>o.timestamp>=n&&o.timestamp<=t)}getRecentInteractions(n=30){const t=Date.now()-n*24*60*60*1e3;return this.interactions.filter(o=>o.timestamp>=t)}clearHistory(){this.interactions=[],this.currentSession=null,this.saveToStorage()}getInteractionCount(){return this.interactions.length}loadFromStorage(){try{const n=localStorage.getItem(Or);n&&(this.interactions=JSON.parse(n))}catch(n){console.warn("Failed to load interaction history:",n),this.interactions=[]}}saveToStorage(){try{localStorage.setItem(Or,JSON.stringify(this.interactions))}catch(n){console.warn("Failed to save interaction history:",n)}}}const Ir="oryx-theme-preferences",Pn=5;class Dr{constructor(){Xe(this,"tracker");Xe(this,"preferences",new Map);Xe(this,"mode","full-automatic");this.tracker=new Nr,this.loadPreferences()}recordChange(n,t){this.tracker.startSession(n,t),this.updatePreferences()}generateThemeFromPrompt(n){const t=n.toLowerCase();let o="theme-amber";return t.includes("dark")?(o="theme-amberDark",t.includes("blue")?o="theme-blueDark":t.includes("red")?o="theme-redDark":t.includes("green")&&(o="theme-greenDark")):t.includes("light")?(o="theme-amber",t.includes("blue")?o="theme-blue":t.includes("red")?o="theme-red":t.includes("green")&&(o="theme-green")):t.includes("blue")?o="theme-blue":t.includes("red")?o="theme-red":t.includes("green")?o="theme-green":t.includes("orange")?o="theme-orange":t.includes("pink")?o="theme-pink":t.includes("purple")?o="theme-purple":t.includes("grass")?o="theme-grass":t.includes("sky")?o="theme-sky":t.includes("mint")?o="theme-mint":t.includes("teal")?o="theme-teal":t.includes("violet")?o="theme-violet":t.includes("crimson")?o="theme-crimson":t.includes("brown")?o="theme-brown":t.includes("indigo")?o="theme-indigo":t.includes("yellow")?o="theme-yellow":t.includes("lime")?o="theme-lime":t.includes("plum")?o="theme-plum":t.includes("cyan")&&(o="theme-cyan"),o}getRecommendation(){const n=this.tracker.getRecentInteractions(30);if(n.length<Pn)return null;const t=new Date,o=t.getHours(),r=t.getDay();this.updatePreferences();let i=0,s=null;for(const d of this.preferences.values()){let u=d.score;const f=this.getTimeBoost(d,o);u*=1+f;const g=d.dayPatterns[r]/Math.max(...d.dayPatterns,1);u*=1+g*.3;const h=(Date.now()-d.lastUsed)/(1e3*60*60*24),m=Math.max(0,1-h/30);u*=1+m*.2,u>i&&(i=u,s=d)}if(!s)return null;const a=n.length,l=Math.min(1,s.usageCount/a*(a/20));return{theme:s.theme,size:s.size,confidence:l,reason:this.generateReason(s,o)}}getInsights(){const n=[],t=this.tracker.getRecentInteractions(30);if(t.length<Pn)return n.push(`Learning your preferences... (${t.length}/${Pn} interactions recorded)`),n;const o=Array.from(this.preferences.values()).sort((i,s)=>s.score-i.score);if(o.length>0){const i=o[0],s=i.theme.replace("theme-","");n.push(`Your favorite combination: ${s} theme with size ${i.size}`)}const r=this.getTimePreferences();return r&&n.push(r),n.push(`Tracking ${t.length} recent interactions`),n}setMode(n){this.mode=n}getMode(){return this.mode}getInteractionCount(){return this.tracker.getInteractionCount()}updatePreferences(){const n=this.tracker.getRecentInteractions(30);this.preferences.clear();for(const t of n){const o=this.getPreferenceKey(t.theme,t.size),r=this.preferences.get(o);if(r)r.usageCount++,r.totalDuration+=t.duration||0,r.lastUsed=Math.max(r.lastUsed,t.timestamp),this.updateTimePattern(r,t),r.dayPatterns[t.dayOfWeek]++;else{const i={theme:t.theme,size:t.size,usageCount:1,totalDuration:t.duration||0,lastUsed:t.timestamp,score:0,timePatterns:{morning:0,afternoon:0,evening:0,night:0},dayPatterns:[0,0,0,0,0,0,0]};this.updateTimePattern(i,t),i.dayPatterns[t.dayOfWeek]++,this.preferences.set(o,i)}}for(const t of this.preferences.values())t.score=this.calculateScore(t,n.length);this.savePreferences()}calculateScore(n,t){const o=n.usageCount/t,r=n.totalDuration/n.usageCount,i=Math.min(1,r/(30*60*1e3));return o*.7+i*.3}updateTimePattern(n,t){const o=t.hourOfDay;o>=6&&o<12?n.timePatterns.morning++:o>=12&&o<18?n.timePatterns.afternoon++:o>=18&&o<24?n.timePatterns.evening++:n.timePatterns.night++}getTimeBoost(n,t){let o;t>=6&&t<12?o="morning":t>=12&&t<18?o="afternoon":t>=18&&t<24?o="evening":o="night";const r=Object.values(n.timePatterns).reduce((i,s)=>i+s,0);return r>0?n.timePatterns[o]/r:0}getTimePreferences(){var i;const n={morning:0,afternoon:0,evening:0,night:0};for(const s of this.preferences.values())n.morning+=s.timePatterns.morning,n.afternoon+=s.timePatterns.afternoon,n.evening+=s.timePatterns.evening,n.night+=s.timePatterns.night;const t=Object.entries(n),o=Math.max(...t.map(([,s])=>s)),r=(i=t.find(([,s])=>s===o))==null?void 0:i[0];return r?`You're most active in the ${r}`:null}generateReason(n,t){const o=n.theme.replace("theme-","");let r="";return t>=6&&t<12?r="morning":t>=12&&t<18?r="afternoon":t>=18&&t<24?r="evening":r="night",`You often use ${o} (size ${n.size}) in the ${r}`}getPreferenceKey(n,t){return`${n}-${t}`}loadPreferences(){try{const n=localStorage.getItem(Ir);if(n){const t=JSON.parse(n);this.preferences=new Map(Object.entries(t))}}catch(n){console.warn("Failed to load preferences:",n)}}savePreferences(){try{const n=Object.fromEntries(this.preferences);localStorage.setItem(Ir,JSON.stringify(n))}catch(n){console.warn("Failed to save preferences:",n)}}}const Tn=c.createContext(null),Mr=({children:e,onRecommendation:n})=>{const t=c.useRef(null),[o,r]=c.useState({mode:"full-automatic",isActive:!0,isLearning:!0,interactionCount:0,currentSession:{theme:"theme-amber",size:"3",startTime:Date.now()}}),[i,s]=c.useState(null);c.useEffect(()=>{t.current||(t.current=new Dr,r(m=>({...m,interactionCount:t.current.getInteractionCount()})))},[]),c.useEffect(()=>{if(!o.isActive||!t.current)return;const m=()=>{const v=t.current.getRecommendation();s(v),v&&o.mode==="full-automatic"&&n&&v.confidence>=.3&&n(v),r($=>({...$,lastRecommendation:v||void 0}))};m();const p=setInterval(m,5*60*1e3);return()=>clearInterval(p)},[o.isActive,o.mode,n]);const a=c.useCallback((m,p)=>{t.current&&(t.current.recordChange(m,p),r(v=>({...v,interactionCount:t.current.getInteractionCount(),currentSession:{theme:m,size:p,startTime:Date.now()}})))},[]),l=c.useCallback(()=>{r(m=>({...m,isActive:!0}))},[]),d=c.useCallback(()=>{r(m=>({...m,isActive:!1}))},[]),u=c.useCallback(m=>{t.current&&t.current.setMode(m),r(p=>({...p,mode:m}))},[]),f=c.useCallback(()=>t.current?t.current.getInsights():[],[]),g=c.useCallback(m=>t.current?t.current.generateThemeFromPrompt(m):null,[]),h={state:o,recommendation:i,enableAgent:l,disableAgent:d,setMode:u,getInsights:f,recordInteraction:a,applyRecommendation:n||null,generateThemeFromPrompt:g};return x.jsx(Tn.Provider,{value:h,children:e})},An=()=>{const e=c.useContext(Tn);if(!e)throw new Error("useThemeAgent must be used within ThemeAgentProvider");return e},kr=()=>{const{theme:e}=fe(),{size:n}=ye(),{recordInteraction:t}=An();return c.useEffect(()=>{t(e,n)},[e,n,t]),null},od=({children:e,enableAgent:n=!0})=>{const{changeTheme:t}=fe(),{changeSize:o}=ye(),r=c.useCallback(i=>{t(i.theme),o(i.size)},[t,o]);return n?x.jsxs(Mr,{onRecommendation:r,children:[x.jsx(kr,{}),e]}):x.jsx(x.Fragment,{children:e})},rd=({children:e,defaultTheme:n,defaultSize:t,enableAgent:o=!0})=>x.jsx(Hn,{children:x.jsx(Kn,{children:x.jsx(od,{enableAgent:o,children:e})})}),cd=()=>{const{state:e,recommendation:n,getInsights:t,generateThemeFromPrompt:o}=An(),{changeTheme:r}=fe(),[i,s]=c.useState(""),[a,l]=c.useState(!1),d=t(),u=f=>{f==null||f.preventDefault();const g=o(i);g&&(r(g),l(!0)),s("")};return e.isActive?x.jsxs("div",{className:"theme-agent-panel bg-color2 border-color6 text-color11 rounded-lg border p-4 shadow-md",children:[x.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[x.jsx("h3",{className:"text-color12 text-sm font-semibold",children:"🤖 AI Theme Assistant"}),x.jsx("span",{className:`text-xs px-2 py-1 rounded ${e.isLearning?"bg-color3 text-color11":"bg-color6 text-color11"}`,children:e.mode==="full-automatic"?"Auto":"Manual"})]}),x.jsx("div",{className:"space-y-2 mb-3",children:d.map((f,g)=>x.jsx("p",{className:"text-xs text-color11",children:f},g))}),n&&x.jsxs("div",{className:"bg-color3 border-color7 mt-3 rounded border p-3",children:[x.jsx("p",{className:"text-color12 mb-1 text-xs font-medium",children:"Current Suggestion:"}),x.jsx("p",{className:"text-xs text-color11 mb-2",children:n.reason}),x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("span",{className:"text-xs text-color10",children:["Confidence: ",Math.round(n.confidence*100),"%"]}),e.mode==="full-automatic"&&x.jsx("span",{className:"text-xs text-green-600 font-medium",children:"✓ Auto-Applied"})]})]}),x.jsxs("div",{className:"mt-4",children:[x.jsx("label",{htmlFor:"theme-prompt",className:"text-color12 mb-2 block text-sm font-semibold",children:"🎨 Generate Theme with AI:"}),x.jsxs("form",{className:"flex flex-wrap gap-2",onSubmit:u,children:[x.jsx("input",{id:"theme-prompt",type:"text",placeholder:"e.g., 'A dark, futuristic theme with neon accents'",className:"bg-color1 border-color6 text-color11 flex-grow rounded-md border p-2 text-sm focus:outline-none focus:ring-2 focus:ring-color6",value:i,onChange:f=>s(f.target.value)}),x.jsx("button",{type:"submit",onAnimationEnd:()=>l(!1),className:O("bg-color6 text-color11 hover:bg-color7 rounded-md px-4 py-2 text-sm font-medium transition-colors",a&&"animate-pulse animate-once animate-duration-200"),children:"Generate"})]})]}),e.interactionCount<5&&x.jsx("div",{className:"bg-yellow-50 border-yellow-200 text-yellow-800 mt-3 rounded border p-2",children:x.jsx("p",{className:"text-xs",children:"🌱 Still learning... Try switching themes to help me understand your preferences!"})})]}):null};z.Accordion=Sc,z.AgentInteractionTracker=kr,z.AlertDialog=rl,z.InteractionTracker=Nr,z.NavigationMenu=Ll,z.OryxProvider=rd,z.Popover=nd,z.Select=aa,z.SizeContext=Yt,z.SizeProvider=Kn,z.ThemeAgent=Dr,z.ThemeAgentContext=Tn,z.ThemeAgentPanel=cd,z.ThemeAgentProvider=Mr,z.ThemeContext=Gt,z.ThemeProvider=Hn,z.useSize=ye,z.useTheme=fe,z.useThemeAgent=An,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});