@yuno-payments/dashboard-design-system 3.1.0-beta.12 → 3.1.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -79,7 +79,7 @@ Defaulting to \`null\`.`}var _3=C3,SD=E3;const j3=m.forwardRef(({className:e,val
|
|
|
79
79
|
|
|
80
80
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
81
81
|
|
|
82
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},tL="DialogDescriptionWarning",nL=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wb(tL).contentName}}.`;return m.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Cb=lb,Sb=db,Eb=fb,Nb=pb,rL=mb,oL=xb,sL=yb,Js='[cmdk-group=""]',Xu='[cmdk-group-items=""]',aL='[cmdk-group-heading=""]',_b='[cmdk-item=""]',V1=`${_b}:not([aria-disabled="true"])`,Xd="cmdk-item-select",Yo="data-value",iL=(e,t,n)=>VO(e,t,n),jb=m.createContext(void 0),yi=()=>m.useContext(jb),kb=m.createContext(void 0),ah=()=>m.useContext(kb),Rb=m.createContext(void 0),Mb=m.forwardRef((e,t)=>{let n=Ko(()=>{var T,z;return{search:"",value:(z=(T=e.value)!=null?T:e.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ko(()=>new Set),o=Ko(()=>new Map),s=Ko(()=>new Map),a=Ko(()=>new Set),l=Db(e),{label:c,children:u,value:f,onValueChange:d,filter:p,shouldFilter:h,loop:g,disablePointerSelection:x=!1,vimBindings:v=!0,...y}=e,b=qe(),C=qe(),w=qe(),E=m.useRef(null),N=vL();co(()=>{if(f!==void 0){let T=f.trim();n.current.value=T,_.emit()}},[f]),co(()=>{N(6,k)},[]);let _=m.useMemo(()=>({subscribe:T=>(a.current.add(T),()=>a.current.delete(T)),snapshot:()=>n.current,setState:(T,z,H)=>{var D,W,Y,Z;if(!Object.is(n.current[T],z)){if(n.current[T]=z,T==="search")L(),F(),N(1,U);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let J=document.getElementById(w);J?J.focus():(D=document.getElementById(b))==null||D.focus()}if(N(7,()=>{var J;n.current.selectedItemId=(J=O())==null?void 0:J.id,_.emit()}),H||N(5,k),((W=l.current)==null?void 0:W.value)!==void 0){let J=z??"";(Z=(Y=l.current).onValueChange)==null||Z.call(Y,J);return}}_.emit()}},emit:()=>{a.current.forEach(T=>T())}}),[]),R=m.useMemo(()=>({value:(T,z,H)=>{var D;z!==((D=s.current.get(T))==null?void 0:D.value)&&(s.current.set(T,{value:z,keywords:H}),n.current.filtered.items.set(T,I(z,H)),N(2,()=>{F(),_.emit()}))},item:(T,z)=>(r.current.add(T),z&&(o.current.has(z)?o.current.get(z).add(T):o.current.set(z,new Set([T]))),N(3,()=>{L(),F(),n.current.value||U(),_.emit()}),()=>{s.current.delete(T),r.current.delete(T),n.current.filtered.items.delete(T);let H=O();N(4,()=>{L(),H?.getAttribute("id")===T&&U(),_.emit()})}),group:T=>(o.current.has(T)||o.current.set(T,new Set),()=>{s.current.delete(T),o.current.delete(T)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:C,listInnerRef:E}),[]);function I(T,z){var H,D;let W=(D=(H=l.current)==null?void 0:H.filter)!=null?D:iL;return T?W(T,n.current.search,z):0}function F(){if(!n.current.search||l.current.shouldFilter===!1)return;let T=n.current.filtered.items,z=[];n.current.filtered.groups.forEach(D=>{let W=o.current.get(D),Y=0;W.forEach(Z=>{let J=T.get(Z);Y=Math.max(J,Y)}),z.push([D,Y])});let H=E.current;V().sort((D,W)=>{var Y,Z;let J=D.getAttribute("id"),oe=W.getAttribute("id");return((Y=T.get(oe))!=null?Y:0)-((Z=T.get(J))!=null?Z:0)}).forEach(D=>{let W=D.closest(Xu);W?W.appendChild(D.parentElement===W?D:D.closest(`${Xu} > *`)):H.appendChild(D.parentElement===H?D:D.closest(`${Xu} > *`))}),z.sort((D,W)=>W[1]-D[1]).forEach(D=>{var W;let Y=(W=E.current)==null?void 0:W.querySelector(`${Js}[${Yo}="${encodeURIComponent(D[0])}"]`);Y?.parentElement.appendChild(Y)})}function U(){let T=V().find(H=>H.getAttribute("aria-disabled")!=="true"),z=T?.getAttribute(Yo);_.setState("value",z||void 0)}function L(){var T,z,H,D;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let W=0;for(let Y of r.current){let Z=(z=(T=s.current.get(Y))==null?void 0:T.value)!=null?z:"",J=(D=(H=s.current.get(Y))==null?void 0:H.keywords)!=null?D:[],oe=I(Z,J);n.current.filtered.items.set(Y,oe),oe>0&&W++}for(let[Y,Z]of o.current)for(let J of Z)if(n.current.filtered.items.get(J)>0){n.current.filtered.groups.add(Y);break}n.current.filtered.count=W}function k(){var T,z,H;let D=O();D&&(((T=D.parentElement)==null?void 0:T.firstChild)===D&&((H=(z=D.closest(Js))==null?void 0:z.querySelector(aL))==null||H.scrollIntoView({block:"nearest"})),D.scrollIntoView({block:"nearest"}))}function O(){var T;return(T=E.current)==null?void 0:T.querySelector(`${_b}[aria-selected="true"]`)}function V(){var T;return Array.from(((T=E.current)==null?void 0:T.querySelectorAll(V1))||[])}function A(T){let z=V()[T];z&&_.setState("value",z.getAttribute(Yo))}function $(T){var z;let H=O(),D=V(),W=D.findIndex(Z=>Z===H),Y=D[W+T];(z=l.current)!=null&&z.loop&&(Y=W+T<0?D[D.length-1]:W+T===D.length?D[0]:D[W+T]),Y&&_.setState("value",Y.getAttribute(Yo))}function B(T){let z=O(),H=z?.closest(Js),D;for(;H&&!D;)H=T>0?gL(H,Js):xL(H,Js),D=H?.querySelector(V1);D?_.setState("value",D.getAttribute(Yo)):$(T)}let P=()=>A(V().length-1),M=T=>{T.preventDefault(),T.metaKey?P():T.altKey?B(1):$(1)},G=T=>{T.preventDefault(),T.metaKey?A(0):T.altKey?B(-1):$(-1)};return m.createElement(se.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:T=>{var z;(z=y.onKeyDown)==null||z.call(y,T);let H=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||H))switch(T.key){case"n":case"j":{v&&T.ctrlKey&&M(T);break}case"ArrowDown":{M(T);break}case"p":case"k":{v&&T.ctrlKey&&G(T);break}case"ArrowUp":{G(T);break}case"Home":{T.preventDefault(),A(0);break}case"End":{T.preventDefault(),P();break}case"Enter":{T.preventDefault();let D=O();if(D){let W=new Event(Xd);D.dispatchEvent(W)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:bL},c),Jc(e,T=>m.createElement(kb.Provider,{value:_},m.createElement(jb.Provider,{value:R},T))))}),lL=m.forwardRef((e,t)=>{var n,r;let o=qe(),s=m.useRef(null),a=m.useContext(Rb),l=yi(),c=Db(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;co(()=>{if(!u)return l.item(o,a?.id)},[u]);let f=Ab(o,s,[e.value,e.children,s],e.keywords),d=ah(),p=_r(N=>N.value&&N.value===f.current),h=_r(N=>u||l.filter()===!1?!0:N.search?N.filtered.items.get(o)>0:!0);m.useEffect(()=>{let N=s.current;if(!(!N||e.disabled))return N.addEventListener(Xd,g),()=>N.removeEventListener(Xd,g)},[h,e.onSelect,e.disabled]);function g(){var N,_;x(),(_=(N=c.current).onSelect)==null||_.call(N,f.current)}function x(){d.setState("value",f.current,!0)}if(!h)return null;let{disabled:v,value:y,onSelect:b,forceMount:C,keywords:w,...E}=e;return m.createElement(se.div,{ref:Pt(s,t),...E,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||l.getDisablePointerSelection()?void 0:x,onClick:v?void 0:g},e.children)}),cL=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=qe(),l=m.useRef(null),c=m.useRef(null),u=qe(),f=yi(),d=_r(h=>o||f.filter()===!1?!0:h.search?h.filtered.groups.has(a):!0);co(()=>f.group(a),[]),Ab(a,l,[e.value,e.heading,c]);let p=m.useMemo(()=>({id:a,forceMount:o}),[o]);return m.createElement(se.div,{ref:Pt(l,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Jc(e,h=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(Rb.Provider,{value:p},h))))}),uL=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=m.useRef(null),s=_r(a=>!a.search);return!n&&!s?null:m.createElement(se.div,{ref:Pt(o,t),...r,"cmdk-separator":"",role:"separator"})}),dL=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=ah(),a=_r(u=>u.search),l=_r(u=>u.selectedItemId),c=yi();return m.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),m.createElement(se.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||s.setState("search",u.target.value),n?.(u.target.value)}})}),fL=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=m.useRef(null),a=m.useRef(null),l=_r(u=>u.selectedItemId),c=yi();return m.useEffect(()=>{if(a.current&&s.current){let u=a.current,f=s.current,d,p=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let h=u.offsetHeight;f.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(d),p.unobserve(u)}}},[]),m.createElement(se.div,{ref:Pt(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Jc(e,u=>m.createElement("div",{ref:Pt(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),pL=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return m.createElement(Cb,{open:n,onOpenChange:r},m.createElement(Sb,{container:a},m.createElement(Eb,{"cmdk-overlay":"",className:o}),m.createElement(Nb,{"aria-label":e.label,"cmdk-dialog":"",className:s},m.createElement(Mb,{ref:t,...l}))))}),hL=m.forwardRef((e,t)=>_r(n=>n.filtered.count===0)?m.createElement(se.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),mL=m.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return m.createElement(se.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Jc(e,a=>m.createElement("div",{"aria-hidden":!0},a)))}),Co=Object.assign(Mb,{List:fL,Item:lL,Input:dL,Group:cL,Separator:uL,Dialog:pL,Empty:hL,Loading:mL});function gL(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function xL(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Db(e){let t=m.useRef(e);return co(()=>{t.current=e}),t}var co=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Ko(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function _r(e){let t=ah(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function Ab(e,t,n,r=[]){let o=m.useRef(),s=yi();return co(()=>{var a;let l=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(e,l,c),(a=t.current)==null||a.setAttribute(Yo,l),o.current=l}),o}var vL=()=>{let[e,t]=m.useState(),n=Ko(()=>new Map);return co(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function yL(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Jc({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(yL(t),{ref:t.ref},n(t.props.children)):n(t)}var bL={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function wL({...e}){return i.jsx(Cb,{"data-slot":"dialog",...e})}function CL({...e}){return i.jsx(Sb,{"data-slot":"dialog-portal",...e})}function SL({className:e,...t}){return i.jsx(Eb,{"data-slot":"dialog-overlay",className:j("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000] bg-black/50",e),...t})}function EL({className:e,children:t,showCloseButton:n=!0,...r}){return i.jsxs(CL,{"data-slot":"dialog-portal",children:[i.jsx(SL,{}),i.jsxs(Nb,{"data-slot":"dialog-content",className:j("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[calc(50%_+_var(--app-content-left,0px)_/_2)] z-[1000] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&i.jsxs(sL,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 end-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[i.jsx(q,{name:"X",className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function NL({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-header",className:j("flex flex-col gap-2 text-center sm:text-left",e),...t})}function _L({className:e,...t}){return i.jsx(rL,{"data-slot":"dialog-title",className:j("text-lg leading-none font-semibold",e),...t})}function jL({className:e,...t}){return i.jsx(oL,{"data-slot":"dialog-description",className:j("text-muted-foreground text-sm",e),...t})}function bi({className:e,...t}){return i.jsx(Co,{"data-slot":"command",className:j("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function kL({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:o=!0,...s}){return i.jsxs(wL,{...s,children:[i.jsxs(NL,{className:"sr-only",children:[i.jsx(_L,{children:e}),i.jsx(jL,{children:t})]}),i.jsx(EL,{className:j("overflow-hidden p-0",r),showCloseButton:o,children:i.jsx(bi,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})]})}function Qc({className:e,...t}){return i.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex items-center gap-2 border-b border-border px-3",children:[i.jsx(q,{name:"MagnifyingGlass",className:"size-4 shrink-0 opacity-50"}),i.jsx(Co.Input,{"data-slot":"command-input",className:j("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function eu({className:e,...t}){return i.jsx(Co.List,{"data-slot":"command-list",className:j("max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function tu({...e}){return i.jsx(Co.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm text-muted-foreground",...e})}function $a({className:e,...t}){return i.jsx(Co.Group,{"data-slot":"command-group",className:j("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function Tb({className:e,...t}){return i.jsx(Co.Separator,{"data-slot":"command-separator",className:j("bg-border -mx-1 h-px",e),...t})}function Va({className:e,...t}){return i.jsx(Co.Item,{"data-slot":"command-item",className:j("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Pb({className:e,...t}){return i.jsx("span",{"data-slot":"command-shortcut",className:j("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const B1=(e,t)=>i.jsxs(Va,{value:e.value,keywords:[e.label,e.description,...e.keywords??[]].filter(Boolean),disabled:e.disabled,onSelect:()=>t?.(e.value),children:[e.icon&&i.jsx(q,{name:e.icon,size:"sm",className:"shrink-0 text-muted-foreground"}),i.jsxs("span",{className:"flex min-w-0 flex-col",children:[i.jsx("span",{className:"truncate",children:e.label}),e.description&&i.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.description})]}),e.shortcut&&i.jsx(Pb,{children:e.shortcut})]},e.value),Ob=S.forwardRef(({options:e=[],groups:t=[],onSelect:n,searchPlaceholder:r="Search",withSearch:o=!0,emptyState:s="No results found.",maxHeight:a,className:l,id:c},u)=>{const f=S.useId(),d=c||f,p=t.length>0;return i.jsxs(bi,{ref:u,id:d,className:j(l),children:[o&&i.jsx(Qc,{placeholder:r}),i.jsxs(eu,{style:a?{maxHeight:typeof a=="number"?`${a}px`:a}:void 0,children:[i.jsx(tu,{children:s}),p?t.map((h,g)=>i.jsxs("div",{children:[g>0&&i.jsx(Tb,{}),i.jsx($a,{heading:h.label,children:h.options.map(x=>B1(x,n))})]},h.label??g)):e.length>0&&i.jsx($a,{children:e.map(h=>B1(h,n))})]})]})});Ob.displayName="Command";function nu(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ru="Checkbox",[RL]=gt(ru),[ML,ih]=RL(ru);function DL(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:f="on",internal_do_not_use_render:d}=e,[p,h]=ht({prop:n,defaultProp:o??!1,onChange:c,caller:ru}),[g,x]=m.useState(null),[v,y]=m.useState(null),b=m.useRef(!1),C=g?!!a||!!g.closest("form"):!0,w={checked:p,disabled:s,setChecked:h,control:g,setControl:x,name:l,form:a,value:f,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:wr(o)?!1:o,isFormControl:C,bubbleInput:v,setBubbleInput:y};return i.jsx(ML,{scope:t,...w,children:AL(d)?d(w):r})}var Lb="CheckboxTrigger",Ib=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:a,disabled:l,checked:c,required:u,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=ih(Lb,e),x=Se(o,f),v=m.useRef(c);return m.useEffect(()=>{const y=s?.form;if(y){const b=()=>d(v.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[s,d]),i.jsx(se.button,{type:"button",role:"checkbox","aria-checked":wr(c)?"mixed":c,"aria-required":u,"data-state":Wb(c),"data-disabled":l?"":void 0,disabled:l,value:a,...r,ref:x,onKeyDown:ee(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:ee(n,y=>{d(b=>wr(b)?!0:!b),g&&h&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})});Ib.displayName=Lb;var Fb=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:a,disabled:l,value:c,onCheckedChange:u,form:f,...d}=e;return i.jsx(DL,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:l,required:a,onCheckedChange:u,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:p})=>i.jsxs(i.Fragment,{children:[i.jsx(Ib,{...d,ref:t,__scopeCheckbox:n}),p&&i.jsx(zb,{__scopeCheckbox:n})]})})});Fb.displayName=ru;var $b="CheckboxIndicator",Vb=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=ih($b,n);return i.jsx(Nt,{present:r||wr(s.checked)||s.checked===!0,children:i.jsx(se.span,{"data-state":Wb(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Vb.displayName=$b;var Bb="CheckboxBubbleInput",zb=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:a,required:l,disabled:c,name:u,value:f,form:d,bubbleInput:p,setBubbleInput:h}=ih(Bb,e),g=Se(n,h),x=nu(s),v=vc(r);m.useEffect(()=>{const b=p;if(!b)return;const C=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(C,"checked").set,N=!o.current;if(x!==s&&E){const _=new Event("click",{bubbles:N});b.indeterminate=wr(s),E.call(b,wr(s)?!1:s),b.dispatchEvent(_)}},[p,x,s,o]);const y=m.useRef(wr(s)?!1:s);return i.jsx(se.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??y.current,required:l,disabled:c,name:u,value:f,form:d,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});zb.displayName=Bb;function AL(e){return typeof e=="function"}function wr(e){return e==="indeterminate"}function Wb(e){return wr(e)?"indeterminate":e?"checked":"unchecked"}function Hb({className:e,...t}){return i.jsx(Fb,{"data-slot":"checkbox",className:j("peer group bg-background border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-xs border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsxs(Vb,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:[i.jsx(q,{name:"Check",className:"hidden size-3.5 group-data-[state=checked]:block"}),i.jsx(q,{name:"Minus",className:"hidden size-3.5 group-data-[state=indeterminate]:block"})]})})}const Ba=S.forwardRef(({label:e,description:t,id:n,name:r,disabled:o,onChange:s,className:a,labelClassName:l,info:c,...u},f)=>{const d=S.useId(),p=n||r||d,h=x=>{if(!s)return;s({target:{name:r||p,checked:x,type:"checkbox",value:x?"on":"off"},currentTarget:{name:r||p,checked:x,type:"checkbox",value:x?"on":"off"},preventDefault:()=>{},stopPropagation:()=>{}})},g=i.jsx(Hb,{ref:f,id:p,name:r,disabled:o,onCheckedChange:h,...u,className:j("cursor-pointer",a)});return e?i.jsxs("div",{className:"flex items-start gap-2",children:[g,i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(En,{htmlFor:p,className:j("text-sm leading-none cursor-pointer",o&&"text-muted-foreground",l),children:e}),c&&i.jsx(St,{content:c,children:i.jsx(q,{name:"Info",size:"sm",className:"cursor-default text-muted-foreground"})})]}),t&&i.jsx("p",{className:j("text-sm text-muted-foreground",o&&"opacity-50"),children:t})]})]}):g});Ba.displayName="Checkbox";var ou="Switch",[TL]=gt(ou),[PL,OL]=TL(ou),Gb=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:a,disabled:l,value:c="on",onCheckedChange:u,form:f,...d}=e,[p,h]=m.useState(null),g=Se(t,C=>h(C)),x=m.useRef(!1),v=p?f||!!p.closest("form"):!0,[y,b]=ht({prop:o,defaultProp:s??!1,onChange:u,caller:ou});return i.jsxs(PL,{scope:n,checked:y,disabled:l,children:[i.jsx(se.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":qb(y),"data-disabled":l?"":void 0,disabled:l,value:c,...d,ref:g,onClick:ee(e.onClick,C=>{b(w=>!w),v&&(x.current=C.isPropagationStopped(),x.current||C.stopPropagation())})}),v&&i.jsx(Kb,{control:p,bubbles:!x.current,name:r,value:c,checked:y,required:a,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});Gb.displayName=ou;var Ub="SwitchThumb",Yb=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=OL(Ub,n);return i.jsx(se.span,{"data-state":qb(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Yb.displayName=Ub;var LL="SwitchBubbleInput",Kb=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=m.useRef(null),l=Se(a,s),c=nu(n),u=vc(t);return m.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Kb.displayName=LL;function qb(e){return e?"checked":"unchecked"}var IL=Gb,FL=Yb;function $L({className:e,...t}){return i.jsx(IL,{"data-slot":"switch",className:j("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(FL,{"data-slot":"switch-thumb",className:j("bg-background shadow-sm dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:ltr:translate-x-[calc(100%-2px)] data-[state=checked]:rtl:-translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const lh=S.forwardRef(({label:e,description:t,side:n="left",variant:r="default",id:o,name:s,onChange:a,className:l,switchClassName:c,info:u,labelClassName:f,...d},p)=>{const h=S.useId(),g=o||s||h,x=b=>{if(!a)return;a({target:{name:s||g,checked:b,type:"checkbox",value:b?"on":"off"},currentTarget:{name:s||g,checked:b,type:"checkbox",value:b?"on":"off"},preventDefault:()=>{},stopPropagation:()=>{}})},v=i.jsx($L,{ref:p,id:g,name:s,className:j("cursor-pointer",c),onCheckedChange:x,...d}),y=j("flex gap-2 items-start",{"flex-row-reverse":n==="right","bg-input box-border justify-start p-4 rounded-lg border shadow-xs":r==="box"},l);return i.jsxs("div",{className:y,children:[v,i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(En,{htmlFor:g,className:j("text-sm leading-[18.39px] cursor-pointer",f),children:e}),u&&i.jsx(St,{content:u,children:i.jsx(q,{name:"Info",size:"sm",className:"cursor-default text-muted-foreground"})})]}),t&&i.jsx("p",{className:"text-sm text-muted-foreground",children:t})]})]})});lh.displayName="Switch";const ch=m.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{ref:n,"data-slot":"textarea",className:j("font-normal placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input flex min-h-16 w-full min-w-0 rounded-md border bg-background px-3 py-2 text-sm transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/40 focus-visible:ring-2","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","resize-none",e),...t}));ch.displayName="Textarea";const VL=We("flex gap-2 w-full",{variants:{layout:{vertical:"flex-col",horizontal:"flex-row items-start gap-4"}},defaultVariants:{layout:"vertical"}}),BL=We("",{variants:{layout:{vertical:"",horizontal:"mt-2"}},defaultVariants:{layout:"vertical"}}),Zb=S.forwardRef(({className:e,layout:t,label:n,description:r,error:o,id:s,disabled:a,textareaProps:l,...c},u)=>{const f=S.useId(),d=s||l?.id||f,p=!!o;return i.jsxs("div",{className:j(VL({layout:t}),e),children:[n&&i.jsx(En,{htmlFor:d,className:j(BL({layout:t})),children:n}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsx(ch,{ref:u,disabled:a,className:j(p&&"border-destructive focus-visible:border-destructive",l?.className),"aria-invalid":p,"aria-describedby":r||o?`${d}-description`:void 0,...c,...l,id:d}),(r||o)&&i.jsx("p",{id:`${d}-description`,className:j("text-xs",o?"text-destructive":"text-muted-foreground"),children:o||r})]})]})});Zb.displayName="Textarea";const Xb=S.forwardRef(({maxLength:e=6,className:t,containerClassName:n,label:r,error:o,id:s,...a},l)=>{const c=S.useId(),u=s||c,f=!!o;return i.jsxs(bo,{orientation:"vertical","data-invalid":f,className:j(t),children:[r&&i.jsx(Rs,{htmlFor:u,children:r}),i.jsx(p3,{ref:l,maxLength:e,containerClassName:j(n),"aria-invalid":f?!0:void 0,"aria-describedby":o?`${u}-description`:void 0,...a,children:Array.from({length:e}).map((d,p)=>i.jsx(m.Fragment,{children:i.jsx(h3,{children:i.jsx(m3,{index:p,"aria-invalid":f?!0:void 0})})},p))}),o&&i.jsx(Dr,{id:`${u}-description`,className:"text-left",children:o})]})});Xb.displayName="OTPField";const zL=/[\u00AD\u061C\u180E\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/g,WL=/[\u00A0\u202F]/g,su=e=>typeof e!="string"?e:e.replace(zL,"").replace(WL," "),ut=e=>typeof e!="string"?e:su(e).trim(),uh=S.forwardRef(({value:e=[],onChange:t,label:n,description:r,error:o,placeholder:s="Type and press Enter...",disabled:a=!1,id:l,name:c,triggerKeys:u=["Enter","Tab","Comma","Space"],addOnBlur:f=!0,allowDuplicates:d=!1,maxItems:p,validate:h,badgeVariant:g="outline",orientation:x="vertical",className:v,deleteAll:y,"aria-label":b,"aria-labelledby":C},w)=>{const E=S.useId(),N=l||E,_=!!o,[R,I]=S.useState(""),[F,U]=S.useState(!1),[L,k]=S.useState(""),O=H=>{const D=ut(H);if(D!==""){if(p&&e.length>=p){k(`Maximum ${p} items allowed`);return}if(!d&&e.includes(D)){k("Duplicate values are not allowed");return}if(h){const W=h(D);if(W!==!0){k(typeof W=="string"?W:"Invalid value");return}}k(""),t([...e,D]),I("")}},V=H=>{t(e.filter(D=>D!==H)),k("")},A=H=>{const D=H.currentTarget.value;H.key==="Enter"&&u.includes("Enter")?(H.preventDefault(),O(D)):H.key==="Tab"&&u.includes("Tab")?D.trim()!==""&&(H.preventDefault(),O(D)):(H.key===","||H.key===",")&&u.includes("Comma")||H.key===" "&&u.includes("Space")?(H.preventDefault(),O(D)):H.key==="Backspace"&&D===""&&e.length>0&&t(e.slice(0,-1))},$=H=>{I(H.target.value),k("")},B=()=>{U(!0)},P=()=>{U(!1),f&&R.trim()!==""&&O(R)},M=H=>{const D=su(H.clipboardData?.getData("text")??""),W=[];if(u.includes("Comma")&&W.push(","),u.includes("Space")&&W.push(" "),W.length===0)return;const Y=new RegExp(`[${W.join("")}]+`);if(!Y.test(D))return;H.preventDefault();const J=D.split(Y).map(ce=>ut(ce)).filter(ce=>ce!=="");if(J.length===0)return;const oe=[];let ne=[...e];for(const ce of J){if(p&&ne.length>=p){k(`Maximum ${p} items allowed`);break}!d&&ne.includes(ce)||h&&h(ce)!==!0||(oe.push(ce),ne=[...ne,ce])}oe.length>0&&(k(""),t([...e,...oe]),I(""))},G=(H,D)=>{H.preventDefault(),H.stopPropagation(),V(D)},T=()=>{a||!y?.onClick||y.onClick()},z=o||L;return i.jsxs(bo,{orientation:x,"data-invalid":_,className:j("w-full",v),children:[n&&i.jsx(Rs,{htmlFor:N,children:n}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsxs("div",{className:j("font-normal file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex min-h-9 w-full min-w-0 rounded-md border bg-input px-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 text-sm","flex-wrap gap-1.5 items-center",F&&"border-ring ring-ring/50 ring-[3px]",(_||L)&&"border-destructive ring-destructive/20 dark:ring-destructive/40",a&&"opacity-50 cursor-not-allowed"),onClick:()=>{a||document.getElementById(N)?.focus()},children:[(()=>{const H=y&&!a&&e.length>=y.length;return i.jsxs(i.Fragment,{children:[H&&i.jsx("div",{onClick:D=>{D.preventDefault(),D.stopPropagation(),T()},children:i.jsx(Ze,{variant:"secondary",className:"gap-1 cursor-pointer flex items-center",children:y.label||"Delete all"})}),e.map((D,W)=>i.jsxs(Ze,{variant:g,children:[D,i.jsx("button",{type:"button","aria-label":`Remove ${D}`,disabled:a,onClick:Y=>G(Y,D),children:i.jsx(q,{name:"X",className:"h-3 w-3"})})]},`${D}-${W}`))]})})(),i.jsx("input",{ref:w,id:N,name:c,type:"text",value:R,onChange:$,onKeyDown:A,onFocus:B,onBlur:P,onPaste:M,placeholder:e.length===0?s:"",disabled:a,className:j("flex-1 min-w-[120px] outline-none bg-transparent border-none shadow-none p-0 h-6","placeholder:text-muted-foreground","disabled:cursor-not-allowed"),"aria-label":b,"aria-labelledby":C,"aria-invalid":_||!!L,"aria-describedby":r||z?`${N}-description`:void 0})]}),r&&!z&&i.jsx(Ms,{id:`${N}-description`,children:r}),z&&i.jsx(Dr,{id:`${N}-description`,children:z})]})]})});uh.displayName="MultiValuesField";var dh="Radio",[HL,Jb]=gt(dh),[GL,UL]=HL(dh),Qb=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:a,value:l="on",onCheck:c,form:u,...f}=e,[d,p]=m.useState(null),h=Se(t,v=>p(v)),g=m.useRef(!1),x=d?u||!!d.closest("form"):!0;return i.jsxs(GL,{scope:n,checked:o,disabled:a,children:[i.jsx(se.button,{type:"button",role:"radio","aria-checked":o,"data-state":r5(o),"data-disabled":a?"":void 0,disabled:a,value:l,...f,ref:h,onClick:ee(e.onClick,v=>{o||c?.(),x&&(g.current=v.isPropagationStopped(),g.current||v.stopPropagation())})}),x&&i.jsx(n5,{control:d,bubbles:!g.current,name:r,value:l,checked:o,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Qb.displayName=dh;var e5="RadioIndicator",t5=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=UL(e5,n);return i.jsx(Nt,{present:r||s.checked,children:i.jsx(se.span,{"data-state":r5(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});t5.displayName=e5;var YL="RadioBubbleInput",n5=m.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=m.useRef(null),l=Se(a,s),c=nu(n),u=vc(t);return m.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),i.jsx(se.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});n5.displayName=YL;function r5(e){return e?"checked":"unchecked"}var KL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],au="RadioGroup",[qL]=gt(au,[Ar,Jb]),o5=Ar(),s5=Jb(),[ZL,XL]=qL(au),a5=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:a=!1,disabled:l=!1,orientation:c,dir:u,loop:f=!0,onValueChange:d,...p}=e,h=o5(n),g=yo(u),[x,v]=ht({prop:s,defaultProp:o??null,onChange:d,caller:au});return i.jsx(ZL,{scope:n,name:r,required:a,disabled:l,value:x,onValueChange:v,children:i.jsx($c,{asChild:!0,...h,orientation:c,dir:g,loop:f,children:i.jsx(se.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":l?"":void 0,dir:g,...p,ref:t})})})});a5.displayName=au;var i5="RadioGroupItem",l5=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=XL(i5,n),a=s.disabled||r,l=o5(n),c=s5(n),u=m.useRef(null),f=Se(t,u),d=s.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const h=x=>{KL.includes(x.key)&&(p.current=!0)},g=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),i.jsx(Vc,{asChild:!0,...l,focusable:!a,active:d,children:i.jsx(Qb,{disabled:a,required:s.required,checked:d,...c,...o,name:s.name,ref:f,onCheck:()=>s.onValueChange(o.value),onKeyDown:ee(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:ee(o.onFocus,()=>{p.current&&u.current?.click()})})})});l5.displayName=i5;var JL="RadioGroupIndicator",c5=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=s5(n);return i.jsx(t5,{...o,...r,ref:t})});c5.displayName=JL;var QL=a5,eI=l5,tI=c5;function iu({className:e,...t}){return i.jsx(QL,{"data-slot":"radio-group",className:j("grid gap-3",e),...t})}function lu({className:e,...t}){return i.jsx(eI,{"data-slot":"radio-group-item",className:j("border-input bg-background text-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aspect-square size-4 shrink-0 rounded-full border transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(tI,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:i.jsx("span",{className:"size-2 rounded-full bg-primary"})})})}const u5=({option:e,radioId:t,isInlineLayout:n=!1})=>i.jsxs("div",{className:n?"flex items-center gap-3":"flex items-start gap-3",children:[i.jsx(lu,{value:e.value,id:t,disabled:e.disabled,className:"cursor-pointer mt-0.5"}),n?i.jsxs(i.Fragment,{children:[i.jsx(En,{htmlFor:t,className:j("cursor-pointer",e.disabled&&"text-muted-foreground"),children:e.label}),e.description&&i.jsx("p",{className:"text-sm text-muted-foreground ms-auto",children:e.description})]}):i.jsxs("div",{className:"flex flex-col gap-1.5 flex-1",children:[i.jsx(En,{htmlFor:t,className:j("cursor-pointer",e.disabled&&"text-muted-foreground"),children:e.label}),e.description&&i.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})]}),d5=S.forwardRef(({options:e,name:t,label:n,orientation:r="vertical",layout:o="stacked",onChange:s,"aria-labelledby":a,...l},c)=>{const u=o==="inline",f=r==="horizontal",d=`${S.useId()}-label`,p=a??(n!=null?d:void 0),h=i.jsx(iu,{ref:c,className:f?"flex flex-row flex-wrap gap-6":"flex flex-col gap-3",onValueChange:s,"aria-labelledby":p,...l,children:e.map(g=>{const x=`${t}-${g.value}`;return i.jsx(u5,{option:g,radioId:x,isInlineLayout:u},g.value)})});return n==null?h:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx("span",{id:d,className:"text-sm font-medium text-foreground",children:n}),h]})});d5.displayName="RadioGroup";const f5=m.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:j("flex min-w-0 w-full rounded-md border border-input bg-background overflow-hidden","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","has-[[data-slot=input-group-control][aria-invalid='true']]:border-destructive has-[[data-slot=input-group-control][aria-invalid='true']]:ring-destructive/20 dark:has-[[data-slot=input-group-control][aria-invalid='true']]:ring-destructive/40",e),...t}));f5.displayName="InputGroup";const Jd=m.forwardRef(({className:e,align:t="inline-start",...n},r)=>i.jsx("div",{ref:r,className:j("flex items-center gap-1.5 h-9 shrink-0",t==="inline-start"&&"order-first ps-3",t==="inline-end"&&"order-last pe-3",t==="block-start"&&"order-first flex-col w-full pb-1.5 px-0 h-auto",t==="block-end"&&"order-last flex-col w-full pt-1.5 px-0 h-auto",e),...n}));Jd.displayName="InputGroupAddon";const p5=m.forwardRef(({className:e,...t},n)=>i.jsx(Ds,{ref:n,"data-slot":"input-group-control",className:j("flex-1 min-w-0 border-0 shadow-none rounded-none bg-transparent","focus-visible:ring-0 focus-visible:border-0","aria-invalid:border-0 aria-invalid:ring-0",e),...t}));p5.displayName="InputGroupInput";const nI=m.forwardRef(({className:e,...t},n)=>i.jsx(ch,{ref:n,"data-slot":"input-group-control",className:j("flex-1 min-w-0 border-0 shadow-none rounded-none bg-transparent","focus-visible:ring-0 focus-visible:border-0",e),...t}));nI.displayName="InputGroupTextarea";const rI=m.forwardRef(({className:e,...t},n)=>i.jsx("span",{ref:n,className:j("text-sm text-muted-foreground whitespace-nowrap",e),...t}));rI.displayName="InputGroupText";const oI=We("shrink-0",{variants:{size:{xs:"h-7 px-2 text-xs",sm:"h-8 px-3 text-sm","icon-xs":"size-7","icon-sm":"size-8"}},defaultVariants:{size:"sm"}}),sI=m.forwardRef(({className:e,size:t,...n},r)=>i.jsx(Ct,{ref:r,className:j(oI({size:t}),e),...n}));sI.displayName="InputGroupButton";const gs=S.forwardRef(({className:e,orientation:t="vertical",label:n,description:r,error:o,info:s,requiredIndicator:a,required:l,id:c,button:u,disabled:f,startIcon:d,startIconProps:p,endIcon:h,endIconProps:g,inputProps:x,...v},y)=>{const b=S.useId(),C=c||x?.id||b,w=!!o;return i.jsxs(bo,{orientation:t,"data-invalid":w,className:j("w-full",e),children:[i.jsx(ks,{htmlFor:C,label:n,info:s,requiredIndicator:a,required:l,disabled:f}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsxs(f5,{className:"flex-1",children:[d&&i.jsx(Jd,{align:"inline-start",children:i.jsx(q,{name:p?.name||d,size:"sm",...p,className:j("cursor-default text-muted-foreground",p?.className)})}),i.jsx(p5,{ref:y,disabled:f,required:l,className:j(x?.className),"aria-invalid":w?!0:void 0,"aria-describedby":r||o?`${C}-description`:void 0,...v,...x,id:C}),h&&i.jsx(Jd,{align:"inline-end",children:i.jsx(q,{name:g?.name||h,size:"sm",...g,className:j("cursor-default text-muted-foreground",g?.className)})})]}),u&&i.jsx(ot,{disabled:f,...u})]}),r&&!o&&i.jsx(Ms,{id:`${C}-description`,children:r}),o&&i.jsx(Dr,{id:`${C}-description`,children:o})]})]})});gs.displayName="Field";const h5=m.forwardRef(({className:e,value:t,...n},r)=>i.jsx(Ds,{ref:r,type:"time",step:"1",value:t,className:j("h-9",e),...n}));h5.displayName="TimePicker";const aI=Array.from({length:12},(e,t)=>t+1),iI=Array.from({length:24},(e,t)=>t),lI=["AM","PM"],cI=e=>{if(e===0)return Array.from({length:60},(n,r)=>r);const t=60/e;return Array.from({length:t},(n,r)=>r*e)},fr=e=>e.toString().padStart(2,"0"),uI=e=>{const t=e>=12?"PM":"AM",n=e>12?e-12:e;return{hour:e===0?12:n,meridiem:t}},dI=(e,t)=>e===12?t==="AM"?0:12:t==="PM"?e+12:e,Kl=m.forwardRef(({className:e,label:t,error:n,description:r,orientation:o="vertical",id:s,onChange:a,mode:l="native",divisorMinutes:c=0,width:u=140,value:f,disabled:d,use24Hour:p=!1,...h},g)=>{const x=S.useId(),v=s||x,y=!!n;if(l==="native"){const b=i.jsx(h5,{ref:g,id:v,value:f,disabled:d,className:j(y&&"border-destructive focus-visible:border-destructive",!(t||n||r)&&e),"aria-invalid":y?!0:void 0,"aria-describedby":r||n?`${v}-description`:void 0,...h,onChange:C=>{a?.(C.target.value)}});return t||n||r?i.jsxs(bo,{orientation:o,"data-invalid":y,className:j("w-full",e),children:[t&&i.jsx(Rs,{htmlFor:v,children:t}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[b,r&&!n&&i.jsx(Ms,{id:`${v}-description`,children:r}),n&&i.jsx(Dr,{id:`${v}-description`,children:n})]})]}):b}return i.jsx(fI,{value:f||(p?"00:00":"12:00"),onChange:a,divisorMinutes:c,width:u,label:t,error:n,description:r,disabled:d,className:e,use24Hour:p})});Kl.displayName="TimePicker";const fI=({value:e,onChange:t,divisorMinutes:n,width:r,label:o,error:s,description:a,disabled:l,className:c,use24Hour:u=!1})=>{const[f,d]=S.useState(!1),p=S.useRef(null),h=S.useRef(null),g=$=>{const[B,P]=$.split(":"),M=parseInt(B,10)||0,G=parseInt(P,10)||0;if(u)return{hour24:M,minute:G,hour:M,meridiem:"AM"};const{hour:T,meridiem:z}=uI(M);return{hour24:M,minute:G,hour:T,meridiem:z}},{hour:x,hour24:v,minute:y,meridiem:b}=g(e),[C,w]=S.useState(u?v:x),[E,N]=S.useState(y),[_,R]=S.useState(b),I=cI(n),F=($,B,P)=>{let M;u?M=$:M=dI($,P);const G=`${fr(M)}:${fr(B)}`;t?.(G)},U=$=>{w($),F($,E,_)},L=$=>{N($),F(C,$,_)},k=$=>{R($),F(C,E,$)};S.useEffect(()=>{const $=B=>{h.current&&!h.current.contains(B.target)&&d(!1)};if(f)return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[f]);const O=u?`${fr(C)}:${fr(E)}`:`${fr(C)}:${fr(E)} ${_}`,V=u?iI:aI,A=i.jsxs("div",{ref:h,className:j("relative inline-block",c),style:{width:typeof r=="number"?`${r}px`:r},children:[i.jsxs("button",{type:"button",disabled:l,onClick:()=>!l&&d(!f),className:j("flex items-center justify-between w-full h-9 px-3 py-2","text-sm rounded-md border border-input bg-input","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive"),children:[i.jsx("span",{children:O}),i.jsx(q,{name:f?"CaretUp":"CaretDown",size:"sm",className:"ml-2"})]}),f&&i.jsxs("div",{ref:p,className:j("absolute z-popover mt-1 bg-popover border border-border rounded-md shadow-lg","flex divide-x divide-border"),style:{width:"fit-content",minWidth:u?"140px":"200px"},children:[i.jsx("div",{className:"flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]",children:V.map($=>i.jsx("button",{type:"button",onClick:()=>U($),className:j("px-3 py-2 text-sm text-left hover:bg-accent",C===$&&"bg-primary text-primary-foreground hover:bg-primary"),children:fr($)},$))}),i.jsx("div",{className:"flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]",children:I.map($=>i.jsx("button",{type:"button",onClick:()=>L($),className:j("px-3 py-2 text-sm text-left hover:bg-accent",E===$&&"bg-primary text-primary-foreground hover:bg-primary"),children:fr($)},$))}),!u&&i.jsx("div",{className:"flex flex-col min-w-[60px]",children:lI.map($=>i.jsx("button",{type:"button",onClick:()=>k($),className:j("px-3 py-2 text-sm text-left hover:bg-accent",_===$&&"bg-primary text-primary-foreground hover:bg-primary"),children:$},$))})]})]});return o||s||a?i.jsxs(bo,{orientation:"vertical",className:j("w-full",c),children:[o&&i.jsx(Rs,{children:o}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[A,a&&!s&&i.jsx(Ms,{children:a}),s&&i.jsx(Dr,{children:s})]})]}):A},pI=We("flex gap-2 w-full",{variants:{layout:{vertical:"flex-col",horizontal:"flex-row items-start gap-4"}},defaultVariants:{layout:"vertical"}}),hI=We("",{variants:{layout:{vertical:"",horizontal:"mt-2"}},defaultVariants:{layout:"vertical"}}),cu=S.forwardRef(({placeholder:e="Search",onSearch:t,limitSearch:n=10,persistKey:r="",value:o="",searchOnChange:s=!0,enableHistory:a=!0,label:l,description:c,error:u,id:f,disabled:d,layout:p="vertical",className:h,inputProps:g,actionName:x,...v},y)=>{const b=S.useId(),C=f||g?.id||b,w=!!u,[E,N]=S.useState(ut(o)),[_,R]=S.useState(()=>{if(!r)return[];try{const D=JSON.parse(localStorage.getItem(`${r}_searchfield`)??"null");if(!Array.isArray(D))return[];const W=new Set;return D.reduce((Y,Z)=>{const J=ut(Z?.value??"");return!J||W.has(J)||(W.add(J),Y.push({...Z,label:J,value:J})),Y},[])}catch{return[]}}),[I,F]=S.useState([]),[U,L]=S.useState(!1),[k,O]=S.useState(!1),V=S.useRef(null),A=S.useRef(null),$=D=>{const W=D.target.value;N(W),(W===""||s)&&t(ut(W))},B=D=>{const W=D.currentTarget,Y=D.clipboardData.getData("text"),Z=W.selectionStart??E.length,J=W.selectionEnd??E.length,oe=E.slice(0,Z)+Y+E.slice(J),ne=ut(oe);ne!==oe&&(D.preventDefault(),N(ne),(ne===""||s)&&t(ne))},P=D=>{D.key==="Enter"&&E!==""&&M()},M=()=>{const D=ut(E);if(D){if(D!==E&&N(D),a){const W={label:D,value:D},Y=_.filter(J=>J.value!==D),Z=_.length<n?[W,...Y]:[W,...Y.slice(0,n-1)];R(Z),r&&localStorage.setItem(`${r}_searchfield`,JSON.stringify(Z))}t(D)}},G=()=>{N(""),t(""),V.current?.focus()},T=D=>{const W=ut(D);N(W),t(W),L(!1),V.current?.focus()},z=()=>{L(!0)},H=()=>{k||L(!1)};return S.useEffect(()=>{const D=ut(o);N(D),D!==o&&t(D)},[o]),S.useEffect(()=>{const D=_.map(W=>({...W,isSelected:W.value===E})).filter(W=>E===""?!0:W.label.toLowerCase().includes(E.toLowerCase()));F(D)},[E,_]),i.jsxs("div",{"data-action-name":x,className:j(pI({layout:p}),h),children:[l&&i.jsx(En,{htmlFor:C,className:j(hI({layout:p})),children:l}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:"relative flex",children:[i.jsx(Ds,{ref:D=>{typeof y=="function"?y(D):y&&(y.current=D),D&&(V.current=D)},type:"text",value:E,onChange:$,onPaste:B,onKeyDown:P,onFocus:z,onBlur:H,placeholder:e,disabled:d,autoComplete:"off","aria-invalid":w,"aria-describedby":c||u?`${C}-description`:void 0,...v,...g,id:C,className:j(w&&"border-destructive focus-visible:border-destructive","!px-9",g?.className)}),i.jsx("button",{type:"button","aria-label":"Search",onClick:M,disabled:d,className:j("absolute start-3 top-1/2 -translate-y-1/2 inline-flex items-center text-muted-foreground dark:text-foreground",!d&&"cursor-pointer hover:text-foreground transition-colors"),children:i.jsx(q,{name:"MagnifyingGlass",size:"sm"})}),E&&i.jsx("button",{type:"button","aria-label":"Clear search",onClick:G,disabled:d,className:j("absolute end-3 top-1/2 -translate-y-1/2 inline-flex items-center text-muted-foreground",!d&&"cursor-pointer hover:text-foreground transition-colors"),children:i.jsx(q,{name:"XCircle",size:"sm",weight:"fill"})})]}),a&&I.length>0&&U&&i.jsx("div",{ref:A,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),className:j("absolute z-popover w-full mt-1 rounded-md border bg-popover text-popover-foreground shadow-md","max-h-[300px] overflow-y-auto"),children:i.jsx("div",{className:"py-1",children:I.map((D,W)=>i.jsx("button",{type:"button",onClick:()=>T(D.value),className:j("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",D.isSelected&&"bg-accent text-accent-foreground"),children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(q,{name:"ClockCounterClockwise",size:"sm",className:"text-muted-foreground"}),i.jsx("span",{className:"truncate",children:D.label})]})},`${D.value}-${W}`))})})]}),(c||u)&&i.jsx("p",{id:`${C}-description`,className:j("text-sm",u?"text-destructive":"text-muted-foreground"),children:u||c})]})]})});cu.displayName="SearchField";const mI=({allowed:e,children:t,message:n="You don't have permission to perform this action"})=>e?i.jsx(i.Fragment,{children:t}):i.jsx(St,{content:n,show:!e,children:i.jsx("span",{className:"block w-full",children:t})}),m5=({options:e,icon:t=null,ariaLabel:n="more",className:r,disabled:o=!1,marginBottom:s})=>{const[a,l]=m.useState(!1),c=d=>{l(d)},u=d=>{d.allowed&&d.handleClick&&d.handleClick(e),l(!1)};if(!e.actions||e.actions.length===0)return null;const f={};return s!==void 0&&(f.marginBottom=`${s}px`),i.jsx("div",{className:j("inline-flex relative",r),style:f,children:i.jsxs(Wc,{open:a,onOpenChange:c,children:[i.jsx(Hc,{asChild:!0,disabled:o,children:i.jsx(ot,{disabled:o,variant:"ghost",size:"icon",className:"h-8 w-8 p-1","aria-label":n,"aria-controls":a?"dots-menu":void 0,"aria-expanded":a,"aria-haspopup":"true",children:i.jsx(q,{name:t||"DotsThreeOutline",weight:t?"light":"fill",size:"sm",className:j("transition-colors",a?"text-primary-text":"text-muted-foreground")})})}),i.jsx(Gc,{id:"dots-menu",align:"end",className:j("max-h-[216px] overflow-y-auto"),children:e.actions.map(d=>i.jsx(mI,{allowed:d.allowed??!0,message:d.message,children:i.jsxs(gn,{onClick:()=>u(d),disabled:!d.allowed,"data-action-name":d.dataActionName,className:j("flex items-center gap-3.5 cursor-pointer",d.variant==="destructive"&&"text-destructive focus:text-destructive"),children:[i.jsx(q,{name:d.icon,size:"sm",className:"shrink-0"}),i.jsx("span",{className:j(d.variant==="success"&&"text-success"),children:d.name||String(d.key)})]})},d.key))})]})})};m5.displayName="DotsMenu";const g5=S.forwardRef(({defaultVisible:e=!1,label:t,forgotPasswordLinkProps:n,...r},o)=>{const[s,a]=S.useState(e),l=()=>{a(c=>!c)};return n&&t?i.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(En,{children:t}),i.jsx($p,{className:j("text-muted-foreground",n?.className),...n,children:n.children||"Forgot password?"})]}),i.jsx(gs,{ref:o,type:s?"text":"password",endIcon:s?"EyeClosed":"Eye",endIconProps:{onClick:l,className:"cursor-pointer",tooltip:s?"Hide password":"Show password"},...r})]}):i.jsx(gs,{ref:o,label:t,type:s?"text":"password",endIcon:s?"EyeClosed":"Eye",endIconProps:{onClick:l,className:"cursor-pointer",tooltip:s?"Hide password":"Show password"},...r})});g5.displayName="PasswordField";function z1(e,[t,n]){return Math.min(n,Math.max(t,e))}function gI(e){const t=xI(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,l=m.Children.toArray(s),c=l.find(yI);if(c){const u=c.props.children,f=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(u)?m.cloneElement(u,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function xI(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=wI(o),l=bI(s,o.props);return o.type!==m.Fragment&&(l.ref=r?Pt(r,a):a),m.cloneElement(o,l)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vI=Symbol("radix.slottable");function yI(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vI}function bI(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function wI(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var CI=[" ","Enter","ArrowUp","ArrowDown"],SI=[" ","Enter"],uo="Select",[uu,du,EI]=Sc(uo),[Ps]=gt(uo,[EI,Rr]),fu=Rr(),[NI,Or]=Ps(uo),[_I,jI]=Ps(uo),x5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:l,onValueChange:c,dir:u,name:f,autoComplete:d,disabled:p,required:h,form:g}=e,x=fu(t),[v,y]=m.useState(null),[b,C]=m.useState(null),[w,E]=m.useState(!1),N=yo(u),[_,R]=ht({prop:r,defaultProp:o??!1,onChange:s,caller:uo}),[I,F]=ht({prop:a,defaultProp:l,onChange:c,caller:uo}),U=m.useRef(null),L=v?g||!!v.closest("form"):!0,[k,O]=m.useState(new Set),V=Array.from(k).map(A=>A.props.value).join(";");return i.jsx(ni,{...x,children:i.jsxs(NI,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:E,contentId:qe(),value:I,onValueChange:F,open:_,onOpenChange:R,dir:N,triggerPointerDownPosRef:U,disabled:p,children:[i.jsx(uu.Provider,{scope:t,children:i.jsx(_I,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(A=>{O($=>new Set($).add(A))},[]),onNativeOptionRemove:m.useCallback(A=>{O($=>{const B=new Set($);return B.delete(A),B})},[]),children:n})}),L?i.jsxs(z5,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:I,onChange:A=>F(A.target.value),disabled:p,form:g,children:[I===void 0?i.jsx("option",{value:""}):null,Array.from(k)]},V):null]})})};x5.displayName=uo;var v5="SelectTrigger",y5=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=fu(n),a=Or(v5,n),l=a.disabled||r,c=Se(t,a.onTriggerChange),u=du(n),f=m.useRef("touch"),[d,p,h]=H5(x=>{const v=u().filter(C=>!C.disabled),y=v.find(C=>C.value===a.value),b=G5(v,x,y);b!==void 0&&a.onValueChange(b.value)}),g=x=>{l||(a.onOpenChange(!0),h()),x&&(a.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return i.jsx(ri,{asChild:!0,...s,children:i.jsx(se.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":W5(a.value)?"":void 0,...o,ref:c,onClick:ee(o.onClick,x=>{x.currentTarget.focus(),f.current!=="mouse"&&g(x)}),onPointerDown:ee(o.onPointerDown,x=>{f.current=x.pointerType;const v=x.target;v.hasPointerCapture(x.pointerId)&&v.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(g(x),x.preventDefault())}),onKeyDown:ee(o.onKeyDown,x=>{const v=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(v&&x.key===" ")&&CI.includes(x.key)&&(g(),x.preventDefault())})})})});y5.displayName=v5;var b5="SelectValue",w5=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...l}=e,c=Or(b5,n),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,d=Se(t,c.onValueNodeChange);return at(()=>{u(f)},[u,f]),i.jsx(se.span,{...l,ref:d,style:{pointerEvents:"none"},children:W5(c.value)?i.jsx(i.Fragment,{children:a}):s})});w5.displayName=b5;var kI="SelectIcon",C5=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return i.jsx(se.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});C5.displayName=kI;var RI="SelectPortal",S5=e=>i.jsx(Ns,{asChild:!0,...e});S5.displayName=RI;var fo="SelectContent",E5=m.forwardRef((e,t)=>{const n=Or(fo,e.__scopeSelect),[r,o]=m.useState();if(at(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?pc.createPortal(i.jsx(N5,{scope:e.__scopeSelect,children:i.jsx(uu.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),s):null}return i.jsx(_5,{...e,ref:t})});E5.displayName=fo;var mn=10,[N5,Lr]=Ps(fo),MI="SelectContentImpl",DI=gI("SelectContent.RemoveScroll"),_5=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:l,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:x,avoidCollisions:v,...y}=e,b=Or(fo,n),[C,w]=m.useState(null),[E,N]=m.useState(null),_=Se(t,Y=>w(Y)),[R,I]=m.useState(null),[F,U]=m.useState(null),L=du(n),[k,O]=m.useState(!1),V=m.useRef(!1);m.useEffect(()=>{if(C)return Tc(C)},[C]),Ac();const A=m.useCallback(Y=>{const[Z,...J]=L().map(ce=>ce.ref.current),[oe]=J.slice(-1),ne=document.activeElement;for(const ce of Y)if(ce===ne||(ce?.scrollIntoView({block:"nearest"}),ce===Z&&E&&(E.scrollTop=0),ce===oe&&E&&(E.scrollTop=E.scrollHeight),ce?.focus(),document.activeElement!==ne))return},[L,E]),$=m.useCallback(()=>A([R,C]),[A,R,C]);m.useEffect(()=>{k&&$()},[k,$]);const{onOpenChange:B,triggerPointerDownPosRef:P}=b;m.useEffect(()=>{if(C){let Y={x:0,y:0};const Z=oe=>{Y={x:Math.abs(Math.round(oe.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(P.current?.y??0))}},J=oe=>{Y.x<=10&&Y.y<=10?oe.preventDefault():C.contains(oe.target)||B(!1),document.removeEventListener("pointermove",Z),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",J,{capture:!0})}}},[C,B,P]),m.useEffect(()=>{const Y=()=>B(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[B]);const[M,G]=H5(Y=>{const Z=L().filter(ne=>!ne.disabled),J=Z.find(ne=>ne.ref.current===document.activeElement),oe=G5(Z,Y,J);oe&&setTimeout(()=>oe.ref.current.focus())}),T=m.useCallback((Y,Z,J)=>{const oe=!V.current&&!J;(b.value!==void 0&&b.value===Z||oe)&&(I(Y),oe&&(V.current=!0))},[b.value]),z=m.useCallback(()=>C?.focus(),[C]),H=m.useCallback((Y,Z,J)=>{const oe=!V.current&&!J;(b.value!==void 0&&b.value===Z||oe)&&U(Y)},[b.value]),D=r==="popper"?Qd:j5,W=D===Qd?{side:l,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return i.jsx(N5,{scope:n,content:C,viewport:E,onViewportChange:N,itemRefCallback:T,selectedItem:R,onItemLeave:z,itemTextRefCallback:H,focusSelectedItem:$,selectedItemText:F,position:r,isPositioned:k,searchRef:M,children:i.jsx(ui,{as:DI,allowPinchZoom:!0,children:i.jsx(ci,{asChild:!0,trapped:b.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:ee(o,Y=>{b.trigger?.focus({preventScroll:!0}),Y.preventDefault()}),children:i.jsx(Cs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:i.jsx(D,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Y=>Y.preventDefault(),...y,...W,onPlaced:()=>O(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ee(y.onKeyDown,Y=>{const Z=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!Z&&Y.key.length===1&&G(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let oe=L().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ne=Y.target,ce=oe.indexOf(ne);oe=oe.slice(ce+1)}setTimeout(()=>A(oe)),Y.preventDefault()}})})})})})})});_5.displayName=MI;var AI="SelectItemAlignedPosition",j5=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Or(fo,n),a=Lr(fo,n),[l,c]=m.useState(null),[u,f]=m.useState(null),d=Se(t,_=>f(_)),p=du(n),h=m.useRef(!1),g=m.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=a,C=m.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&x&&v&&y){const _=s.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),F=y.getBoundingClientRect();if(s.dir!=="rtl"){const ne=F.left-R.left,ce=I.left-ne,Ee=_.left-ce,re=_.width+Ee,ue=Math.max(re,R.width),K=window.innerWidth-mn,Q=z1(ce,[mn,Math.max(mn,K-ue)]);l.style.minWidth=re+"px",l.style.left=Q+"px"}else{const ne=R.right-F.right,ce=window.innerWidth-I.right-ne,Ee=window.innerWidth-_.right-ce,re=_.width+Ee,ue=Math.max(re,R.width),K=window.innerWidth-mn,Q=z1(ce,[mn,Math.max(mn,K-ue)]);l.style.minWidth=re+"px",l.style.right=Q+"px"}const U=p(),L=window.innerHeight-mn*2,k=x.scrollHeight,O=window.getComputedStyle(u),V=parseInt(O.borderTopWidth,10),A=parseInt(O.paddingTop,10),$=parseInt(O.borderBottomWidth,10),B=parseInt(O.paddingBottom,10),P=V+A+k+B+$,M=Math.min(v.offsetHeight*5,P),G=window.getComputedStyle(x),T=parseInt(G.paddingTop,10),z=parseInt(G.paddingBottom,10),H=_.top+_.height/2-mn,D=L-H,W=v.offsetHeight/2,Y=v.offsetTop+W,Z=V+A+Y,J=P-Z;if(Z<=H){const ne=U.length>0&&v===U[U.length-1].ref.current;l.style.bottom="0px";const ce=u.clientHeight-x.offsetTop-x.offsetHeight,Ee=Math.max(D,W+(ne?z:0)+ce+$),re=Z+Ee;l.style.height=re+"px"}else{const ne=U.length>0&&v===U[0].ref.current;l.style.top="0px";const Ee=Math.max(H,V+x.offsetTop+(ne?T:0)+W)+J;l.style.height=Ee+"px",x.scrollTop=Z-H+x.offsetTop}l.style.margin=`${mn}px 0`,l.style.minHeight=M+"px",l.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,l,u,x,v,y,s.dir,r]);at(()=>C(),[C]);const[w,E]=m.useState();at(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const N=m.useCallback(_=>{_&&g.current===!0&&(C(),b?.(),g.current=!1)},[C,b]);return i.jsx(PI,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:i.jsx(se.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});j5.displayName=AI;var TI="SelectPopperPosition",Qd=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=mn,...s}=e,a=fu(n);return i.jsx(yc,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Qd.displayName=TI;var[PI,fh]=Ps(fo,{}),ef="SelectViewport",k5=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Lr(ef,n),a=fh(ef,n),l=Se(t,s.onViewportChange),c=m.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("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}"},nonce:r}),i.jsx(uu.Slot,{scope:n,children:i.jsx(se.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ee(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=a;if(p?.current&&d){const h=Math.abs(c.current-f.scrollTop);if(h>0){const g=window.innerHeight-mn*2,x=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),y=Math.max(x,v);if(y<g){const b=y+h,C=Math.min(g,b),w=b-C;d.style.height=C+"px",d.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});k5.displayName=ef;var R5="SelectGroup",[OI,LI]=Ps(R5),M5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=qe();return i.jsx(OI,{scope:n,id:o,children:i.jsx(se.div,{role:"group","aria-labelledby":o,...r,ref:t})})});M5.displayName=R5;var D5="SelectLabel",A5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=LI(D5,n);return i.jsx(se.div,{id:o.id,...r,ref:t})});A5.displayName=D5;var ql="SelectItem",[II,T5]=Ps(ql),P5=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,l=Or(ql,n),c=Lr(ql,n),u=l.value===r,[f,d]=m.useState(s??""),[p,h]=m.useState(!1),g=Se(t,b=>c.itemRefCallback?.(b,r,o)),x=qe(),v=m.useRef("touch"),y=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(II,{scope:n,value:r,disabled:o,textId:x,isSelected:u,onItemTextChange:m.useCallback(b=>{d(C=>C||(b?.textContent??"").trim())},[]),children:i.jsx(uu.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:i.jsx(se.div,{role:"option","aria-labelledby":x,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:ee(a.onFocus,()=>h(!0)),onBlur:ee(a.onBlur,()=>h(!1)),onClick:ee(a.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:ee(a.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:ee(a.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:ee(a.onPointerMove,b=>{v.current=b.pointerType,o?c.onItemLeave?.():v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(a.onPointerLeave,b=>{b.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ee(a.onKeyDown,b=>{c.searchRef?.current!==""&&b.key===" "||(SI.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});P5.displayName=ql;var aa="SelectItemText",O5=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Or(aa,n),l=Lr(aa,n),c=T5(aa,n),u=jI(aa,n),[f,d]=m.useState(null),p=Se(t,y=>d(y),c.onItemTextChange,y=>l.itemTextRefCallback?.(y,c.value,c.disabled)),h=f?.textContent,g=m.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return at(()=>(x(g),()=>v(g)),[x,v,g]),i.jsxs(i.Fragment,{children:[i.jsx(se.span,{id:c.textId,...s,ref:p}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?pc.createPortal(s.children,a.valueNode):null]})});O5.displayName=aa;var L5="SelectItemIndicator",I5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return T5(L5,n).isSelected?i.jsx(se.span,{"aria-hidden":!0,...r,ref:t}):null});I5.displayName=L5;var tf="SelectScrollUpButton",F5=m.forwardRef((e,t)=>{const n=Lr(tf,e.__scopeSelect),r=fh(tf,e.__scopeSelect),[o,s]=m.useState(!1),a=Se(t,r.onScrollButtonChange);return at(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?i.jsx(V5,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});F5.displayName=tf;var nf="SelectScrollDownButton",$5=m.forwardRef((e,t)=>{const n=Lr(nf,e.__scopeSelect),r=fh(nf,e.__scopeSelect),[o,s]=m.useState(!1),a=Se(t,r.onScrollButtonChange);return at(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;s(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?i.jsx(V5,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});$5.displayName=nf;var V5=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Lr("SelectScrollButton",n),a=m.useRef(null),l=du(n),c=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),at(()=>{l().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(se.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ee(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ee(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ee(o.onPointerLeave,()=>{c()})})}),FI="SelectSeparator",B5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(se.div,{"aria-hidden":!0,...r,ref:t})});B5.displayName=FI;var rf="SelectArrow",$I=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=fu(n),s=Or(rf,n),a=Lr(rf,n);return s.open&&a.position==="popper"?i.jsx(bc,{...o,...r,ref:t}):null});$I.displayName=rf;var VI="SelectBubbleInput",z5=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=Se(r,o),a=nu(t);return m.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(l,t),l.dispatchEvent(d)}},[a,t]),i.jsx(se.select,{...n,style:{...wx,...n.style},ref:s,defaultValue:t})});z5.displayName=VI;function W5(e){return e===""||e===void 0}function H5(e){const t=un(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(a=>{const l=n.current+a;t(l),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function G5(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=BI(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function BI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zI=x5,U5=y5,WI=w5,HI=C5,GI=S5,Y5=E5,UI=k5,YI=M5,K5=A5,q5=P5,KI=O5,qI=I5,Z5=F5,X5=$5,J5=B5;const ZI=({dir:e,...t})=>i.jsx(zI,{dir:e??vo(),...t}),XI=YI,JI=WI,Q5=m.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(U5,{ref:r,className:j("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground outline-none transition-colors focus:border-ring focus:ring-2 focus:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:min-w-0 [&>span]:truncate",e),...n,children:[t,i.jsx(HI,{asChild:!0,children:i.jsx(q,{name:"CaretDown",size:"sm",className:"opacity-50 shrink-0"})})]}));Q5.displayName=U5.displayName;const ew=m.forwardRef(({className:e,...t},n)=>i.jsx(Z5,{ref:n,className:j("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(q,{name:"CaretUp",size:"sm"})}));ew.displayName=Z5.displayName;const tw=m.forwardRef(({className:e,...t},n)=>i.jsx(X5,{ref:n,className:j("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(q,{name:"CaretDown",size:"sm"})}));tw.displayName=X5.displayName;const nw=m.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>i.jsx(GI,{children:i.jsxs(Y5,{ref:o,className:j("relative z-select max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground animate-dialog-in shadow-lg",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(ew,{}),i.jsx(UI,{className:j("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(tw,{})]})}));nw.displayName=Y5.displayName;const rw=m.forwardRef(({className:e,...t},n)=>i.jsx(K5,{ref:n,className:j("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",e),...t}));rw.displayName=K5.displayName;const of=m.forwardRef(({className:e,children:t,badge:n,...r},o)=>i.jsxs(q5,{ref:o,className:j("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[i.jsx("span",{className:"absolute end-2 flex h-4 w-4 items-center justify-center",children:i.jsx(qI,{children:i.jsx(q,{name:"Check",size:"sm"})})}),i.jsx(KI,{children:t}),n&&i.jsx("span",{className:"ms-2 inline-flex items-center",children:n})]}));of.displayName=q5.displayName;const QI=m.forwardRef(({className:e,...t},n)=>i.jsx(J5,{ref:n,className:j("-mx-1 my-1 h-px bg-border",e),...t}));QI.displayName=J5.displayName;const ow=m.forwardRef(({label:e,description:t,error:n,info:r,requiredIndicator:o,required:s=!1,placeholder:a="Select an option",value:l,defaultValue:c,onChange:u,disabled:f=!1,options:d=[],groups:p=[],className:h,id:g,"aria-label":x},v)=>{const y=p.length>0,b=d.length>0;return i.jsxs("div",{className:j("w-full",h),children:[(e||r||o)&&i.jsx("div",{className:"mb-2",children:i.jsx(ks,{htmlFor:g,label:e,info:r,requiredIndicator:o,required:s,disabled:f})}),t&&!n&&i.jsx("p",{className:j("text-sm font-medium leading-none",j("text-muted-foreground mb-2",f&&"opacity-50")),children:t}),i.jsxs(ZI,{value:l,defaultValue:c,onValueChange:u,disabled:f,children:[i.jsx(Q5,{ref:v,id:g,"aria-label":x,className:j(n&&"border-destructive"),children:i.jsx(JI,{placeholder:a})}),i.jsxs(nw,{children:[y&&p.map((C,w)=>i.jsxs(XI,{children:[C.label&&i.jsx(rw,{children:C.label}),C.options.map(E=>i.jsxs(of,{value:E.value,badge:E.badge&&i.jsx(Ze,{variant:"info",children:E.badge}),children:[E.icon&&i.jsx("span",{className:"me-2 inline-flex items-center",children:E.icon}),E.label]},E.value))]},w)),!y&&b&&d.map(C=>i.jsx(of,{value:C.value,badge:C.badge&&i.jsx(Ze,{variant:"info",children:C.badge}),children:i.jsxs("span",{className:"flex items-center",children:[C.icon&&i.jsx("span",{className:"me-2 inline-flex items-center",children:C.icon}),C.label]})},C.value))]})]}),n&&i.jsx("p",{className:"text-sm font-medium leading-none text-destructive mt-2",children:n})]})});ow.displayName="Select";const sw=xv,aw=vv,ph=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},o)=>i.jsx(yv,{children:i.jsx(Lc,{ref:o,align:t,sideOffset:n,className:j("z-popover w-[var(--radix-popover-trigger-width)] rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),role:"combobox",...r})}));ph.displayName=Lc.displayName;const W1="__yuno_search_select_no_highlight__",eF="end",iw=m.forwardRef(({label:e,description:t,error:n,placeholder:r="Select an option",value:o,defaultValue:s,onChange:a,disabled:l=!1,options:c=[],groups:u=[],className:f,id:d,searchPlaceholder:p="Search",maxHeight:h=300,actionName:g,showItemValue:x=!1,showItemValueCopy:v=!0,showSelectedCheck:y=!0,contentWidth:b,"aria-label":C,"aria-labelledby":w,footer:E},N)=>{const[_,R]=m.useState(!1),[I,F]=m.useState(""),[U,L]=m.useState(W1),k=m.useCallback(D=>{L(W1),R(D)},[]),O=u.length>0,V=c.length>0,A=m.useCallback(()=>{if(!o)return null;if(O)for(const D of u){const W=D.options.find(Y=>Y.value===o);if(W)return W.label}else if(V){const D=c.find(W=>W.value===o);if(D)return D.label}return null},[o,u,c,O,V]),$=m.useCallback(D=>{if(!D)return{filteredOptions:c,filteredGroups:u};const W=D.toLowerCase();if(O){const Y=u.map(Z=>({...Z,options:Z.options.filter(J=>ut(J.label).toLowerCase().includes(W))})).filter(Z=>Z.options.length>0);return{filteredOptions:[],filteredGroups:Y}}else return{filteredOptions:c.filter(Z=>ut(Z.label).toLowerCase().includes(W)),filteredGroups:[]}},[c,u,O]),{filteredOptions:B,filteredGroups:P}=$(ut(I));m.useEffect(()=>{_&&setTimeout(()=>{document.querySelector('[data-slot="command-input"]')?.focus()},0)},[_]),m.useEffect(()=>{if(!_||!o)return;const D=setTimeout(()=>{document.querySelector('[data-slot="command-list"] [data-selected-option="true"]')?.scrollIntoView({block:eF})},0);return()=>clearTimeout(D)},[_,o]),m.useEffect(()=>{_||F("")},[_]),m.useEffect(()=>{s&&!o&&a?.(s)},[s,o,a]);const M=D=>{l||(a?.(D),R(!1))},G=(D,W)=>{D.stopPropagation(),D.preventDefault(),navigator.clipboard?.writeText(W)},T=D=>x&&D?i.jsxs("span",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{className:"truncate",children:D}),v&&i.jsx("button",{type:"button","aria-label":"Copy value",onPointerDown:W=>W.stopPropagation(),onClick:W=>G(W,D),className:"shrink-0 text-muted-foreground hover:text-foreground",children:i.jsx(q,{name:"Copy",size:"sm"})})]}):null,z=D=>i.jsxs("span",{className:"flex items-center justify-between gap-2",children:[i.jsxs("span",{className:"flex min-w-0 items-center",children:[D.icon&&i.jsx("span",{className:"mr-2 inline-flex items-center",children:D.icon}),i.jsx("span",{className:"truncate",children:D.label})]}),D.badge&&i.jsx(Ze,{variant:"info",children:D.badge})]}),H=A();return i.jsxs("div",{dir:vo(),className:j("w-full",f),children:[e&&i.jsx("div",{className:"flex items-center gap-1 mb-2",children:i.jsx(Rs,{htmlFor:d,className:j(l&&"text-muted-foreground"),children:e})}),t&&!n&&i.jsx("p",{className:j("text-sm font-medium leading-none",j("text-muted-foreground mb-2",l&&"text-muted-")),children:t}),i.jsxs(sw,{open:_,onOpenChange:k,children:[i.jsx(aw,{asChild:!0,children:i.jsxs("button",{ref:N,id:d,type:"button",disabled:l,role:"combobox","aria-expanded":_,"aria-haspopup":"listbox","aria-label":C,"aria-labelledby":w,"data-action-name":g,className:j("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-input px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:text-muted- shadow-xs [&>span]:min-w-0 [&>span]:truncate",n&&"border-destructive"),children:[i.jsx("span",{className:j("truncate",!H&&"text-muted-foreground"),children:H||r}),i.jsx(q,{name:"CaretDown",size:"sm",className:"text-muted- shrink-0"})]})}),i.jsx(ph,{className:"p-0",align:"start",style:b?{width:b}:void 0,children:i.jsxs(bi,{shouldFilter:!1,value:U,onValueChange:L,children:[i.jsx(Qc,{placeholder:p,"aria-label":p,value:I,onValueChange:F}),i.jsxs(eu,{style:{maxHeight:h},children:[i.jsx(tu,{children:i.jsx("p",{className:"text-sm font-medium leading-none text-muted-foreground py-6 text-center",children:"No results found."})}),O?P.map((D,W)=>i.jsxs($a,{children:[D.label&&i.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:D.label}),D.options.map(Y=>i.jsxs(Va,{value:Y.value,onSelect:()=>M(Y.value),"data-selected-option":o===Y.value?!0:void 0,className:j("cursor-pointer rounded-none",o===Y.value&&"bg-accent"),children:[i.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[z(Y),T(Y.value)]}),y&&o===Y.value&&i.jsx(q,{name:"Check",size:"sm",className:"ml-auto"})]},Y.value))]},W)):B.map(D=>i.jsxs(Va,{value:D.value,onSelect:()=>M(D.value),"data-selected-option":o===D.value?!0:void 0,className:j("cursor-pointer rounded-none",o===D.value&&"bg-accent"),children:[i.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[z(D),T(D.value)]}),y&&o===D.value&&i.jsx(q,{name:"Check",size:"sm",className:"ml-auto"})]},D.value))]}),E]})})]}),n&&i.jsx("p",{className:"text-sm font-medium leading-none text-destructive mt-2",children:n})]})});iw.displayName="SearchSelect";const lw=S.forwardRef(({value:e,variant:t="info",startIcon:n,emptyState:r="-",className:o},s)=>e?i.jsx(Ze,{ref:s,variant:t,startIcon:n,className:o,children:e}):i.jsx(i.Fragment,{children:r}));lw.displayName="DataTableBadgeCell";const tF=e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0),cw=S.forwardRef(({value:e,children:t,emptyState:n="-"},r)=>tF(e)?i.jsx("span",{ref:r,children:n}):i.jsx(i.Fragment,{children:t}));cw.displayName="DataTableCellWrapper";const uw=S.forwardRef(({value:e,formatFn:t,tooltip:n,emptyState:r="-",className:o},s)=>{if(!e)return i.jsx(i.Fragment,{children:r});const a=t?t(e):e,l=n===!1?null:n??a;return l?i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("div",{ref:s,className:j("truncate text-sm",o),children:a})}),i.jsx(Tt,{children:i.jsx("p",{children:l})})]})}):i.jsx("div",{ref:s,className:j("truncate text-sm",o),children:a})});uw.displayName="DataTableTextCell";const dw=e=>({copyToClipboard:S.useCallback(async n=>{const r=e?.successMessage??"Copied to clipboard",o=e?.errorMessage??"Failed to copy to clipboard";try{await navigator.clipboard.writeText(n),Kn.success(r),e?.onSuccess?.()}catch{try{const s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.appendChild(s);let a;try{s.focus(),s.select(),a=document.execCommand("copy")}finally{document.body.removeChild(s)}if(a)Kn.success(r),e?.onSuccess?.();else throw new Error("Copy command failed")}catch{Kn.error(o),e?.onError?.()}}},[e])}),fw=S.forwardRef(({value:e,linkTo:t,startIcon:n,startIconTooltip:r,copyTooltip:o="Copy",onCopySuccess:s,onCopyError:a,emptyState:l="-",className:c},u)=>{const{copyToClipboard:f}=dw({onSuccess:s,onError:a});if(!e)return i.jsx(i.Fragment,{children:l});const d=p=>{p.stopPropagation(),f(e)};return i.jsxs("div",{ref:u,className:j("flex items-center gap-2 w-full",c),children:[n&&i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("span",{className:"shrink-0 inline-flex",children:i.jsx(q,{name:n,weight:"fill",size:"sm",className:"text-primary-text"})})}),r&&i.jsx(Tt,{children:i.jsx("p",{children:r})})]})}),i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("span",{className:"truncate text-sm",children:t?i.jsx("a",{href:t,className:"text-primary-text hover:underline",onClick:p=>p.stopPropagation(),children:e}):e})}),i.jsx(Tt,{children:i.jsx("p",{children:e})})]})}),i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":o,className:"shrink-0 p-1 hover:bg-muted rounded",onClick:d,children:i.jsx(q,{name:"CopySimple",size:"sm",className:"text-muted-foreground"})})}),i.jsx(Tt,{children:i.jsx("p",{children:o})})]})})]})});fw.displayName="DataTableCopyCell";const nF=e=>{if(!e)return e;const t=e.replace(/[_.]/g," ").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)},pw=S.forwardRef(({status:e,statusMap:t,formatLabel:n=nF,emptyState:r="-",className:o},s)=>{if(!e)return i.jsx(i.Fragment,{children:r});const a=t?.[e]??t?.[e.toUpperCase()];return a?i.jsx("div",{ref:s,className:j(o),children:i.jsx(Ze,{startIcon:a.icon??"Info",variant:a.variant,children:a.label})}):i.jsx("div",{ref:s,className:j(o),children:i.jsx(Ze,{startIcon:"Info",variant:"info",children:n(e)})})});pw.displayName="DataTableStatusCell";const hw=S.forwardRef(({value:e,currency:t="USD",locales:n,size:r="xs",showCurrencyCode:o=!0,emptyState:s="-",className:a},l)=>e==null||Number.isNaN(e)?i.jsx(i.Fragment,{children:s}):i.jsx("div",{ref:l,className:j("flex",a),children:i.jsx(xp,{value:e,currency:t,locales:n,size:r,showCurrencyCode:o})}));hw.displayName="DataTableAmountCell";const rF=e=>{try{const t=typeof e=="string"?new Date(e):e;return new Intl.DateTimeFormat("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(t)}catch{return String(e)}},mw=S.forwardRef(({value:e,formatFn:t,emptyState:n="-",className:r},o)=>{if(!e)return i.jsx(i.Fragment,{children:n});const a=(t??rF)(e);return i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("div",{ref:o,className:j("truncate text-sm",r),children:a})}),i.jsx(Tt,{children:i.jsx("p",{children:a})})]})})});mw.displayName="DataTableDateCell";const oF="https://icons.prod.y.uno/flags",sF=e=>{if(typeof e!="string")return null;const t=e.trim().toUpperCase();return/^[A-Z]{2}$/.test(t)?t:null},gw=S.forwardRef(({code:e,showFlag:t=!0,showName:n=!1,getCountryName:r,flagBaseUrl:o=oF,emptyState:s="-",className:a},l)=>{const[c,u]=S.useState(!1);if(!e)return i.jsx(i.Fragment,{children:s});const f=sF(e),d=r?r(e):null,p=n&&d?d:e.toUpperCase(),h=d??e.toUpperCase(),g=t&&f&&!c;return i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsxs("div",{ref:l,className:j("flex items-center gap-2 truncate text-sm",a),children:[g&&i.jsx("img",{src:`${o}/flag-${f.toLowerCase()}.png`,alt:"","aria-hidden":!0,loading:"lazy",className:"size-4 shrink-0",onError:()=>u(!0)}),t&&f&&c&&i.jsx("span",{className:"shrink-0 rounded-sm bg-muted px-1 text-xs text-muted-foreground",children:f}),i.jsx("span",{className:"truncate",children:p})]})}),i.jsx(Tt,{children:i.jsx("p",{children:h})})]})})});gw.displayName="DataTableCountryCell";const xw=S.forwardRef(({value:e,decimals:t=2,showProgressBar:n=!1,emptyState:r="-",className:o},s)=>{if(e==null)return i.jsx(i.Fragment,{children:r});const a=e*100,l=new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:t}).format(a);return i.jsxs("div",{ref:s,className:j("flex items-center gap-3",o),children:[n&&i.jsx("div",{className:"h-1.5 flex-1 min-w-[50px] rounded-full bg-muted overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${Math.min(a,100)}%`}})}),i.jsxs("span",{className:"text-sm whitespace-nowrap",children:[l,"%"]})]})});xw.displayName="DataTablePercentageCell";const vw=S.forwardRef(({tags:e,maxVisible:t=2,variant:n="outline",emptyState:r="-",className:o},s)=>{if(!e||e.length===0)return i.jsx(i.Fragment,{children:r});const a=e.slice(0,t),l=e.slice(t);return i.jsxs("div",{ref:s,className:j("flex items-center gap-1 flex-wrap",o),children:[a.map(c=>i.jsx(Ze,{variant:n,className:"text-xs",children:c},c)),l.length>0&&i.jsx(At,{delayDuration:0,children:i.jsxs(Bt,{children:[i.jsx(zt,{children:i.jsxs(Ze,{variant:"outline",className:"text-xs cursor-pointer hover:border-primary hover:text-primary-text",children:["+",l.length]})}),i.jsx(Tt,{className:"p-2",children:i.jsx("div",{className:"space-y-1",children:l.map(c=>i.jsx("p",{className:"text-sm",children:c},c))})})]})})]})});vw.displayName="DataTableTagsCell";const yw=S.forwardRef(({items:e,maxVisible:t=1,emptyState:n="-",className:r},o)=>{if(!e||e.length===0)return i.jsx(i.Fragment,{children:n});const s=new Set,a=e.filter(u=>!u.name||s.has(u.name)?!1:(s.add(u.name),!0));if(a.length===0)return i.jsx(i.Fragment,{children:n});const l=a.slice(0,t),c=a.slice(t);return i.jsxs("div",{ref:o,className:j("flex items-center gap-2",r),children:[l.map(u=>i.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[u.src&&i.jsx("img",{src:u.src,alt:u.name,className:"h-4 w-4 shrink-0 object-contain",onError:f=>{f.currentTarget.style.display="none"}}),!u.src&&u.iconName&&i.jsx(q,{name:u.iconName,size:"sm",className:"shrink-0"}),i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("span",{className:"truncate text-sm",children:u.name})}),i.jsx(Tt,{children:i.jsx("p",{children:u.name})})]})})]},u.name)),c.length>0&&i.jsx(At,{delayDuration:0,children:i.jsxs(Bt,{children:[i.jsx(zt,{className:"shrink-0",children:i.jsxs(Ze,{variant:"outline",className:"text-xs cursor-pointer hover:border-primary hover:text-primary-text",children:["+",c.length]})}),i.jsx(Tt,{className:"p-2",children:i.jsx("div",{className:"space-y-2",children:c.map(u=>i.jsxs("div",{className:"flex items-center gap-3",children:[u.src&&i.jsx("img",{src:u.src,alt:u.name,className:"h-4 w-4 object-contain",onError:f=>{f.currentTarget.style.display="none"}}),!u.src&&u.iconName&&i.jsx(q,{name:u.iconName,size:"sm"}),i.jsx("span",{className:"text-sm",children:u.name})]},u.name))})})]})})]})});yw.displayName="DataTableIconTextCell";const bw=S.forwardRef(({items:e,maxVisible:t=4,emptyState:n="-",className:r},o)=>{if(!e||e.length===0)return i.jsx(i.Fragment,{children:n});const s=new Set,a=e.filter(f=>!f.name||s.has(f.name)?!1:(s.add(f.name),!0));if(a.length===0)return i.jsx(i.Fragment,{children:n});const l=a.slice(0,t),c=a.slice(t),u=f=>f.src?i.jsx("img",{src:f.src,alt:f.name,className:"h-5 w-5 shrink-0 object-contain",onError:d=>{d.currentTarget.style.display="none"}}):f.iconName?i.jsx(q,{name:f.iconName,size:"sm",className:"shrink-0"}):null;return i.jsxs("div",{ref:o,className:j("flex items-center gap-1.5",r),children:[l.map(f=>i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("span",{className:"inline-flex shrink-0",children:u(f)})}),i.jsx(Tt,{children:i.jsx("p",{children:f.name})})]})},f.name)),c.length>0&&i.jsx(At,{delayDuration:0,children:i.jsxs(Bt,{children:[i.jsx(zt,{className:"shrink-0",children:i.jsxs(Ze,{variant:"outline",className:"text-xs cursor-pointer hover:border-primary hover:text-primary-text",children:["+",c.length]})}),i.jsx(Tt,{className:"p-2",children:i.jsx("div",{className:"space-y-1",children:c.map(f=>i.jsx("div",{className:"text-sm",children:f.name},f.name))})})]})})]})});bw.displayName="DataTableIconCell";function xr(e,t){return typeof e=="function"?e(t):e}function Zt(e,t){return n=>{t.setState(r=>({...r,[e]:xr(n,r[e])}))}}function pu(e){return e instanceof Function}function aF(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function iF(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const a=t(s);a!=null&&a.length&&r(a)})};return r(e),n}function he(e,t,n){let r=[],o;return s=>{let a;n.key&&n.debug&&(a=Date.now());const l=e(s);if(!(l.length!==r.length||l.some((f,d)=>r[d]!==f)))return o;r=l;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...l),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-a)*100)/100,d=Math.round((Date.now()-u)*100)/100,p=d/16,h=(g,x)=>{for(g=String(g);g.length<x;)g=" "+g;return g};console.info(`%c⏱ ${h(d,5)} /${h(f,5)} ms`,`
|
|
82
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},tL="DialogDescriptionWarning",nL=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wb(tL).contentName}}.`;return m.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Cb=lb,Sb=db,Eb=fb,Nb=pb,rL=mb,oL=xb,sL=yb,Js='[cmdk-group=""]',Xu='[cmdk-group-items=""]',aL='[cmdk-group-heading=""]',_b='[cmdk-item=""]',V1=`${_b}:not([aria-disabled="true"])`,Xd="cmdk-item-select",Yo="data-value",iL=(e,t,n)=>VO(e,t,n),jb=m.createContext(void 0),yi=()=>m.useContext(jb),kb=m.createContext(void 0),ah=()=>m.useContext(kb),Rb=m.createContext(void 0),Mb=m.forwardRef((e,t)=>{let n=Ko(()=>{var T,z;return{search:"",value:(z=(T=e.value)!=null?T:e.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ko(()=>new Set),o=Ko(()=>new Map),s=Ko(()=>new Map),a=Ko(()=>new Set),l=Db(e),{label:c,children:u,value:f,onValueChange:d,filter:p,shouldFilter:h,loop:g,disablePointerSelection:x=!1,vimBindings:v=!0,...y}=e,b=qe(),C=qe(),w=qe(),E=m.useRef(null),N=vL();co(()=>{if(f!==void 0){let T=f.trim();n.current.value=T,_.emit()}},[f]),co(()=>{N(6,k)},[]);let _=m.useMemo(()=>({subscribe:T=>(a.current.add(T),()=>a.current.delete(T)),snapshot:()=>n.current,setState:(T,z,H)=>{var D,W,Y,Z;if(!Object.is(n.current[T],z)){if(n.current[T]=z,T==="search")L(),F(),N(1,U);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let J=document.getElementById(w);J?J.focus():(D=document.getElementById(b))==null||D.focus()}if(N(7,()=>{var J;n.current.selectedItemId=(J=O())==null?void 0:J.id,_.emit()}),H||N(5,k),((W=l.current)==null?void 0:W.value)!==void 0){let J=z??"";(Z=(Y=l.current).onValueChange)==null||Z.call(Y,J);return}}_.emit()}},emit:()=>{a.current.forEach(T=>T())}}),[]),R=m.useMemo(()=>({value:(T,z,H)=>{var D;z!==((D=s.current.get(T))==null?void 0:D.value)&&(s.current.set(T,{value:z,keywords:H}),n.current.filtered.items.set(T,I(z,H)),N(2,()=>{F(),_.emit()}))},item:(T,z)=>(r.current.add(T),z&&(o.current.has(z)?o.current.get(z).add(T):o.current.set(z,new Set([T]))),N(3,()=>{L(),F(),n.current.value||U(),_.emit()}),()=>{s.current.delete(T),r.current.delete(T),n.current.filtered.items.delete(T);let H=O();N(4,()=>{L(),H?.getAttribute("id")===T&&U(),_.emit()})}),group:T=>(o.current.has(T)||o.current.set(T,new Set),()=>{s.current.delete(T),o.current.delete(T)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:C,listInnerRef:E}),[]);function I(T,z){var H,D;let W=(D=(H=l.current)==null?void 0:H.filter)!=null?D:iL;return T?W(T,n.current.search,z):0}function F(){if(!n.current.search||l.current.shouldFilter===!1)return;let T=n.current.filtered.items,z=[];n.current.filtered.groups.forEach(D=>{let W=o.current.get(D),Y=0;W.forEach(Z=>{let J=T.get(Z);Y=Math.max(J,Y)}),z.push([D,Y])});let H=E.current;V().sort((D,W)=>{var Y,Z;let J=D.getAttribute("id"),oe=W.getAttribute("id");return((Y=T.get(oe))!=null?Y:0)-((Z=T.get(J))!=null?Z:0)}).forEach(D=>{let W=D.closest(Xu);W?W.appendChild(D.parentElement===W?D:D.closest(`${Xu} > *`)):H.appendChild(D.parentElement===H?D:D.closest(`${Xu} > *`))}),z.sort((D,W)=>W[1]-D[1]).forEach(D=>{var W;let Y=(W=E.current)==null?void 0:W.querySelector(`${Js}[${Yo}="${encodeURIComponent(D[0])}"]`);Y?.parentElement.appendChild(Y)})}function U(){let T=V().find(H=>H.getAttribute("aria-disabled")!=="true"),z=T?.getAttribute(Yo);_.setState("value",z||void 0)}function L(){var T,z,H,D;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let W=0;for(let Y of r.current){let Z=(z=(T=s.current.get(Y))==null?void 0:T.value)!=null?z:"",J=(D=(H=s.current.get(Y))==null?void 0:H.keywords)!=null?D:[],oe=I(Z,J);n.current.filtered.items.set(Y,oe),oe>0&&W++}for(let[Y,Z]of o.current)for(let J of Z)if(n.current.filtered.items.get(J)>0){n.current.filtered.groups.add(Y);break}n.current.filtered.count=W}function k(){var T,z,H;let D=O();D&&(((T=D.parentElement)==null?void 0:T.firstChild)===D&&((H=(z=D.closest(Js))==null?void 0:z.querySelector(aL))==null||H.scrollIntoView({block:"nearest"})),D.scrollIntoView({block:"nearest"}))}function O(){var T;return(T=E.current)==null?void 0:T.querySelector(`${_b}[aria-selected="true"]`)}function V(){var T;return Array.from(((T=E.current)==null?void 0:T.querySelectorAll(V1))||[])}function A(T){let z=V()[T];z&&_.setState("value",z.getAttribute(Yo))}function $(T){var z;let H=O(),D=V(),W=D.findIndex(Z=>Z===H),Y=D[W+T];(z=l.current)!=null&&z.loop&&(Y=W+T<0?D[D.length-1]:W+T===D.length?D[0]:D[W+T]),Y&&_.setState("value",Y.getAttribute(Yo))}function B(T){let z=O(),H=z?.closest(Js),D;for(;H&&!D;)H=T>0?gL(H,Js):xL(H,Js),D=H?.querySelector(V1);D?_.setState("value",D.getAttribute(Yo)):$(T)}let P=()=>A(V().length-1),M=T=>{T.preventDefault(),T.metaKey?P():T.altKey?B(1):$(1)},G=T=>{T.preventDefault(),T.metaKey?A(0):T.altKey?B(-1):$(-1)};return m.createElement(se.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:T=>{var z;(z=y.onKeyDown)==null||z.call(y,T);let H=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||H))switch(T.key){case"n":case"j":{v&&T.ctrlKey&&M(T);break}case"ArrowDown":{M(T);break}case"p":case"k":{v&&T.ctrlKey&&G(T);break}case"ArrowUp":{G(T);break}case"Home":{T.preventDefault(),A(0);break}case"End":{T.preventDefault(),P();break}case"Enter":{T.preventDefault();let D=O();if(D){let W=new Event(Xd);D.dispatchEvent(W)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:bL},c),Jc(e,T=>m.createElement(kb.Provider,{value:_},m.createElement(jb.Provider,{value:R},T))))}),lL=m.forwardRef((e,t)=>{var n,r;let o=qe(),s=m.useRef(null),a=m.useContext(Rb),l=yi(),c=Db(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;co(()=>{if(!u)return l.item(o,a?.id)},[u]);let f=Ab(o,s,[e.value,e.children,s],e.keywords),d=ah(),p=_r(N=>N.value&&N.value===f.current),h=_r(N=>u||l.filter()===!1?!0:N.search?N.filtered.items.get(o)>0:!0);m.useEffect(()=>{let N=s.current;if(!(!N||e.disabled))return N.addEventListener(Xd,g),()=>N.removeEventListener(Xd,g)},[h,e.onSelect,e.disabled]);function g(){var N,_;x(),(_=(N=c.current).onSelect)==null||_.call(N,f.current)}function x(){d.setState("value",f.current,!0)}if(!h)return null;let{disabled:v,value:y,onSelect:b,forceMount:C,keywords:w,...E}=e;return m.createElement(se.div,{ref:Pt(s,t),...E,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||l.getDisablePointerSelection()?void 0:x,onClick:v?void 0:g},e.children)}),cL=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=qe(),l=m.useRef(null),c=m.useRef(null),u=qe(),f=yi(),d=_r(h=>o||f.filter()===!1?!0:h.search?h.filtered.groups.has(a):!0);co(()=>f.group(a),[]),Ab(a,l,[e.value,e.heading,c]);let p=m.useMemo(()=>({id:a,forceMount:o}),[o]);return m.createElement(se.div,{ref:Pt(l,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Jc(e,h=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(Rb.Provider,{value:p},h))))}),uL=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=m.useRef(null),s=_r(a=>!a.search);return!n&&!s?null:m.createElement(se.div,{ref:Pt(o,t),...r,"cmdk-separator":"",role:"separator"})}),dL=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=ah(),a=_r(u=>u.search),l=_r(u=>u.selectedItemId),c=yi();return m.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),m.createElement(se.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||s.setState("search",u.target.value),n?.(u.target.value)}})}),fL=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=m.useRef(null),a=m.useRef(null),l=_r(u=>u.selectedItemId),c=yi();return m.useEffect(()=>{if(a.current&&s.current){let u=a.current,f=s.current,d,p=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let h=u.offsetHeight;f.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(d),p.unobserve(u)}}},[]),m.createElement(se.div,{ref:Pt(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Jc(e,u=>m.createElement("div",{ref:Pt(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),pL=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return m.createElement(Cb,{open:n,onOpenChange:r},m.createElement(Sb,{container:a},m.createElement(Eb,{"cmdk-overlay":"",className:o}),m.createElement(Nb,{"aria-label":e.label,"cmdk-dialog":"",className:s},m.createElement(Mb,{ref:t,...l}))))}),hL=m.forwardRef((e,t)=>_r(n=>n.filtered.count===0)?m.createElement(se.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),mL=m.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return m.createElement(se.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Jc(e,a=>m.createElement("div",{"aria-hidden":!0},a)))}),Co=Object.assign(Mb,{List:fL,Item:lL,Input:dL,Group:cL,Separator:uL,Dialog:pL,Empty:hL,Loading:mL});function gL(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function xL(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Db(e){let t=m.useRef(e);return co(()=>{t.current=e}),t}var co=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Ko(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function _r(e){let t=ah(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function Ab(e,t,n,r=[]){let o=m.useRef(),s=yi();return co(()=>{var a;let l=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(e,l,c),(a=t.current)==null||a.setAttribute(Yo,l),o.current=l}),o}var vL=()=>{let[e,t]=m.useState(),n=Ko(()=>new Map);return co(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function yL(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Jc({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(yL(t),{ref:t.ref},n(t.props.children)):n(t)}var bL={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function wL({...e}){return i.jsx(Cb,{"data-slot":"dialog",...e})}function CL({...e}){return i.jsx(Sb,{"data-slot":"dialog-portal",...e})}function SL({className:e,...t}){return i.jsx(Eb,{"data-slot":"dialog-overlay",className:j("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000] bg-black/50",e),...t})}function EL({className:e,children:t,showCloseButton:n=!0,...r}){return i.jsxs(CL,{"data-slot":"dialog-portal",children:[i.jsx(SL,{}),i.jsxs(Nb,{"data-slot":"dialog-content",className:j("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[calc(50%_+_var(--app-content-left,0px)_/_2)] z-[1000] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&i.jsxs(sL,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 end-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[i.jsx(q,{name:"X",className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function NL({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-header",className:j("flex flex-col gap-2 text-center sm:text-left",e),...t})}function _L({className:e,...t}){return i.jsx(rL,{"data-slot":"dialog-title",className:j("text-lg leading-none font-semibold",e),...t})}function jL({className:e,...t}){return i.jsx(oL,{"data-slot":"dialog-description",className:j("text-muted-foreground text-sm",e),...t})}function bi({className:e,...t}){return i.jsx(Co,{"data-slot":"command",className:j("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function kL({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:o=!0,...s}){return i.jsxs(wL,{...s,children:[i.jsxs(NL,{className:"sr-only",children:[i.jsx(_L,{children:e}),i.jsx(jL,{children:t})]}),i.jsx(EL,{className:j("overflow-hidden p-0",r),showCloseButton:o,children:i.jsx(bi,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})]})}function Qc({className:e,...t}){return i.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex items-center gap-2 border-b border-border px-3",children:[i.jsx(q,{name:"MagnifyingGlass",className:"size-4 shrink-0 opacity-50"}),i.jsx(Co.Input,{"data-slot":"command-input",className:j("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function eu({className:e,...t}){return i.jsx(Co.List,{"data-slot":"command-list",className:j("max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function tu({...e}){return i.jsx(Co.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm text-muted-foreground",...e})}function $a({className:e,...t}){return i.jsx(Co.Group,{"data-slot":"command-group",className:j("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function Tb({className:e,...t}){return i.jsx(Co.Separator,{"data-slot":"command-separator",className:j("bg-border -mx-1 h-px",e),...t})}function Va({className:e,...t}){return i.jsx(Co.Item,{"data-slot":"command-item",className:j("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Pb({className:e,...t}){return i.jsx("span",{"data-slot":"command-shortcut",className:j("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const B1=(e,t)=>i.jsxs(Va,{value:e.value,keywords:[e.label,e.description,...e.keywords??[]].filter(Boolean),disabled:e.disabled,onSelect:()=>t?.(e.value),children:[e.icon&&i.jsx(q,{name:e.icon,size:"sm",className:"shrink-0 text-muted-foreground"}),i.jsxs("span",{className:"flex min-w-0 flex-col",children:[i.jsx("span",{className:"truncate",children:e.label}),e.description&&i.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.description})]}),e.shortcut&&i.jsx(Pb,{children:e.shortcut})]},e.value),Ob=S.forwardRef(({options:e=[],groups:t=[],onSelect:n,searchPlaceholder:r="Search",withSearch:o=!0,emptyState:s="No results found.",maxHeight:a,className:l,id:c},u)=>{const f=S.useId(),d=c||f,p=t.length>0;return i.jsxs(bi,{ref:u,id:d,className:j(l),children:[o&&i.jsx(Qc,{placeholder:r}),i.jsxs(eu,{style:a?{maxHeight:typeof a=="number"?`${a}px`:a}:void 0,children:[i.jsx(tu,{children:s}),p?t.map((h,g)=>i.jsxs("div",{children:[g>0&&i.jsx(Tb,{}),i.jsx($a,{heading:h.label,children:h.options.map(x=>B1(x,n))})]},h.label??g)):e.length>0&&i.jsx($a,{children:e.map(h=>B1(h,n))})]})]})});Ob.displayName="Command";function nu(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ru="Checkbox",[RL]=gt(ru),[ML,ih]=RL(ru);function DL(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:f="on",internal_do_not_use_render:d}=e,[p,h]=ht({prop:n,defaultProp:o??!1,onChange:c,caller:ru}),[g,x]=m.useState(null),[v,y]=m.useState(null),b=m.useRef(!1),C=g?!!a||!!g.closest("form"):!0,w={checked:p,disabled:s,setChecked:h,control:g,setControl:x,name:l,form:a,value:f,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:wr(o)?!1:o,isFormControl:C,bubbleInput:v,setBubbleInput:y};return i.jsx(ML,{scope:t,...w,children:AL(d)?d(w):r})}var Lb="CheckboxTrigger",Ib=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:a,disabled:l,checked:c,required:u,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=ih(Lb,e),x=Se(o,f),v=m.useRef(c);return m.useEffect(()=>{const y=s?.form;if(y){const b=()=>d(v.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[s,d]),i.jsx(se.button,{type:"button",role:"checkbox","aria-checked":wr(c)?"mixed":c,"aria-required":u,"data-state":Wb(c),"data-disabled":l?"":void 0,disabled:l,value:a,...r,ref:x,onKeyDown:ee(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:ee(n,y=>{d(b=>wr(b)?!0:!b),g&&h&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})});Ib.displayName=Lb;var Fb=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:a,disabled:l,value:c,onCheckedChange:u,form:f,...d}=e;return i.jsx(DL,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:l,required:a,onCheckedChange:u,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:p})=>i.jsxs(i.Fragment,{children:[i.jsx(Ib,{...d,ref:t,__scopeCheckbox:n}),p&&i.jsx(zb,{__scopeCheckbox:n})]})})});Fb.displayName=ru;var $b="CheckboxIndicator",Vb=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=ih($b,n);return i.jsx(Nt,{present:r||wr(s.checked)||s.checked===!0,children:i.jsx(se.span,{"data-state":Wb(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Vb.displayName=$b;var Bb="CheckboxBubbleInput",zb=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:a,required:l,disabled:c,name:u,value:f,form:d,bubbleInput:p,setBubbleInput:h}=ih(Bb,e),g=Se(n,h),x=nu(s),v=vc(r);m.useEffect(()=>{const b=p;if(!b)return;const C=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(C,"checked").set,N=!o.current;if(x!==s&&E){const _=new Event("click",{bubbles:N});b.indeterminate=wr(s),E.call(b,wr(s)?!1:s),b.dispatchEvent(_)}},[p,x,s,o]);const y=m.useRef(wr(s)?!1:s);return i.jsx(se.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??y.current,required:l,disabled:c,name:u,value:f,form:d,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});zb.displayName=Bb;function AL(e){return typeof e=="function"}function wr(e){return e==="indeterminate"}function Wb(e){return wr(e)?"indeterminate":e?"checked":"unchecked"}function Hb({className:e,...t}){return i.jsx(Fb,{"data-slot":"checkbox",className:j("peer group bg-background border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-xs border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsxs(Vb,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:[i.jsx(q,{name:"Check",className:"hidden size-3.5 group-data-[state=checked]:block"}),i.jsx(q,{name:"Minus",className:"hidden size-3.5 group-data-[state=indeterminate]:block"})]})})}const Ba=S.forwardRef(({label:e,description:t,id:n,name:r,disabled:o,onChange:s,className:a,labelClassName:l,info:c,...u},f)=>{const d=S.useId(),p=n||r||d,h=x=>{if(!s)return;s({target:{name:r||p,checked:x,type:"checkbox",value:x?"on":"off"},currentTarget:{name:r||p,checked:x,type:"checkbox",value:x?"on":"off"},preventDefault:()=>{},stopPropagation:()=>{}})},g=i.jsx(Hb,{ref:f,id:p,name:r,disabled:o,onCheckedChange:h,...u,className:j("cursor-pointer",a)});return e?i.jsxs("div",{className:"flex items-start gap-2",children:[g,i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(En,{htmlFor:p,className:j("text-sm leading-none cursor-pointer",o&&"text-muted-foreground",l),children:e}),c&&i.jsx(St,{content:c,children:i.jsx(q,{name:"Info",size:"sm",className:"cursor-default text-muted-foreground"})})]}),t&&i.jsx("p",{className:j("text-sm text-muted-foreground",o&&"opacity-50"),children:t})]})]}):g});Ba.displayName="Checkbox";var ou="Switch",[TL]=gt(ou),[PL,OL]=TL(ou),Gb=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:a,disabled:l,value:c="on",onCheckedChange:u,form:f,...d}=e,[p,h]=m.useState(null),g=Se(t,C=>h(C)),x=m.useRef(!1),v=p?f||!!p.closest("form"):!0,[y,b]=ht({prop:o,defaultProp:s??!1,onChange:u,caller:ou});return i.jsxs(PL,{scope:n,checked:y,disabled:l,children:[i.jsx(se.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":qb(y),"data-disabled":l?"":void 0,disabled:l,value:c,...d,ref:g,onClick:ee(e.onClick,C=>{b(w=>!w),v&&(x.current=C.isPropagationStopped(),x.current||C.stopPropagation())})}),v&&i.jsx(Kb,{control:p,bubbles:!x.current,name:r,value:c,checked:y,required:a,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});Gb.displayName=ou;var Ub="SwitchThumb",Yb=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=OL(Ub,n);return i.jsx(se.span,{"data-state":qb(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Yb.displayName=Ub;var LL="SwitchBubbleInput",Kb=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=m.useRef(null),l=Se(a,s),c=nu(n),u=vc(t);return m.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Kb.displayName=LL;function qb(e){return e?"checked":"unchecked"}var IL=Gb,FL=Yb;function $L({className:e,...t}){return i.jsx(IL,{"data-slot":"switch",className:j("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(FL,{"data-slot":"switch-thumb",className:j("bg-background shadow-sm dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:ltr:translate-x-[calc(100%-2px)] data-[state=checked]:rtl:-translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const lh=S.forwardRef(({label:e,description:t,side:n="left",variant:r="default",id:o,name:s,onChange:a,className:l,switchClassName:c,info:u,labelClassName:f,...d},p)=>{const h=S.useId(),g=o||s||h,x=b=>{if(!a)return;a({target:{name:s||g,checked:b,type:"checkbox",value:b?"on":"off"},currentTarget:{name:s||g,checked:b,type:"checkbox",value:b?"on":"off"},preventDefault:()=>{},stopPropagation:()=>{}})},v=i.jsx($L,{ref:p,id:g,name:s,className:j("cursor-pointer",c),onCheckedChange:x,...d}),y=j("flex gap-2 items-start",{"flex-row-reverse":n==="right","bg-input box-border justify-start p-4 rounded-lg border shadow-xs":r==="box"},l);return i.jsxs("div",{className:y,children:[v,i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(En,{htmlFor:g,className:j("text-sm leading-[18.39px] cursor-pointer",f),children:e}),u&&i.jsx(St,{content:u,children:i.jsx(q,{name:"Info",size:"sm",className:"cursor-default text-muted-foreground"})})]}),t&&i.jsx("p",{className:"text-sm text-muted-foreground",children:t})]})]})});lh.displayName="Switch";const ch=m.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{ref:n,"data-slot":"textarea",className:j("font-normal placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input flex min-h-16 w-full min-w-0 rounded-md border bg-background px-3 py-2 text-sm transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/40 focus-visible:ring-2","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","resize-none",e),...t}));ch.displayName="Textarea";const VL=We("flex gap-2 w-full",{variants:{layout:{vertical:"flex-col",horizontal:"flex-row items-start gap-4"}},defaultVariants:{layout:"vertical"}}),BL=We("",{variants:{layout:{vertical:"",horizontal:"mt-2"}},defaultVariants:{layout:"vertical"}}),Zb=S.forwardRef(({className:e,layout:t,label:n,description:r,error:o,id:s,disabled:a,textareaProps:l,...c},u)=>{const f=S.useId(),d=s||l?.id||f,p=!!o;return i.jsxs("div",{className:j(VL({layout:t}),e),children:[n&&i.jsx(En,{htmlFor:d,className:j(BL({layout:t})),children:n}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsx(ch,{ref:u,disabled:a,className:j(p&&"border-destructive focus-visible:border-destructive",l?.className),"aria-invalid":p,"aria-describedby":r||o?`${d}-description`:void 0,...c,...l,id:d}),(r||o)&&i.jsx("p",{id:`${d}-description`,className:j("text-xs",o?"text-destructive":"text-muted-foreground"),children:o||r})]})]})});Zb.displayName="Textarea";const Xb=S.forwardRef(({maxLength:e=6,className:t,containerClassName:n,label:r,error:o,id:s,...a},l)=>{const c=S.useId(),u=s||c,f=!!o;return i.jsxs(bo,{orientation:"vertical","data-invalid":f,className:j(t),children:[r&&i.jsx(Rs,{htmlFor:u,children:r}),i.jsx(p3,{ref:l,maxLength:e,containerClassName:j(n),"aria-invalid":f?!0:void 0,"aria-describedby":o?`${u}-description`:void 0,...a,children:Array.from({length:e}).map((d,p)=>i.jsx(m.Fragment,{children:i.jsx(h3,{children:i.jsx(m3,{index:p,"aria-invalid":f?!0:void 0})})},p))}),o&&i.jsx(Dr,{id:`${u}-description`,className:"text-left",children:o})]})});Xb.displayName="OTPField";const zL=/[\u00AD\u061C\u180E\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/g,WL=/[\u00A0\u202F]/g,su=e=>typeof e!="string"?e:e.replace(zL,"").replace(WL," "),ut=e=>typeof e!="string"?e:su(e).trim(),uh=S.forwardRef(({value:e=[],onChange:t,label:n,description:r,error:o,placeholder:s="Type and press Enter...",disabled:a=!1,id:l,name:c,triggerKeys:u=["Enter","Tab","Comma","Space"],addOnBlur:f=!0,allowDuplicates:d=!1,maxItems:p,validate:h,badgeVariant:g="outline",orientation:x="vertical",className:v,deleteAll:y,"aria-label":b,"aria-labelledby":C},w)=>{const E=S.useId(),N=l||E,_=!!o,[R,I]=S.useState(""),[F,U]=S.useState(!1),[L,k]=S.useState(""),O=H=>{const D=ut(H);if(D!==""){if(p&&e.length>=p){k(`Maximum ${p} items allowed`);return}if(!d&&e.includes(D)){k("Duplicate values are not allowed");return}if(h){const W=h(D);if(W!==!0){k(typeof W=="string"?W:"Invalid value");return}}k(""),t([...e,D]),I("")}},V=H=>{t(e.filter(D=>D!==H)),k("")},A=H=>{const D=H.currentTarget.value;H.key==="Enter"&&u.includes("Enter")?(H.preventDefault(),O(D)):H.key==="Tab"&&u.includes("Tab")?D.trim()!==""&&(H.preventDefault(),O(D)):(H.key===","||H.key===",")&&u.includes("Comma")||H.key===" "&&u.includes("Space")?(H.preventDefault(),O(D)):H.key==="Backspace"&&D===""&&e.length>0&&t(e.slice(0,-1))},$=H=>{I(H.target.value),k("")},B=()=>{U(!0)},P=()=>{U(!1),f&&R.trim()!==""&&O(R)},M=H=>{const D=su(H.clipboardData?.getData("text")??""),W=[];if(u.includes("Comma")&&W.push(","),u.includes("Space")&&W.push(" "),W.length===0)return;const Y=new RegExp(`[${W.join("")}]+`);if(!Y.test(D))return;H.preventDefault();const J=D.split(Y).map(ce=>ut(ce)).filter(ce=>ce!=="");if(J.length===0)return;const oe=[];let ne=[...e];for(const ce of J){if(p&&ne.length>=p){k(`Maximum ${p} items allowed`);break}!d&&ne.includes(ce)||h&&h(ce)!==!0||(oe.push(ce),ne=[...ne,ce])}oe.length>0&&(k(""),t([...e,...oe]),I(""))},G=(H,D)=>{H.preventDefault(),H.stopPropagation(),V(D)},T=()=>{a||!y?.onClick||y.onClick()},z=o||L;return i.jsxs(bo,{orientation:x,"data-invalid":_,className:j("w-full",v),children:[n&&i.jsx(Rs,{htmlFor:N,children:n}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsxs("div",{className:j("font-normal file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex min-h-9 w-full min-w-0 rounded-md border bg-input px-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 text-sm","flex-wrap gap-1.5 items-center",F&&"border-ring ring-ring/50 ring-[3px]",(_||L)&&"border-destructive ring-destructive/20 dark:ring-destructive/40",a&&"opacity-50 cursor-not-allowed"),onClick:()=>{a||document.getElementById(N)?.focus()},children:[(()=>{const H=y&&!a&&e.length>=y.length;return i.jsxs(i.Fragment,{children:[H&&i.jsx("div",{onClick:D=>{D.preventDefault(),D.stopPropagation(),T()},children:i.jsx(Ze,{variant:"secondary",className:"gap-1 cursor-pointer flex items-center",children:y.label||"Delete all"})}),e.map((D,W)=>i.jsxs(Ze,{variant:g,children:[D,i.jsx("button",{type:"button","aria-label":`Remove ${D}`,disabled:a,onClick:Y=>G(Y,D),children:i.jsx(q,{name:"X",className:"h-3 w-3"})})]},`${D}-${W}`))]})})(),i.jsx("input",{ref:w,id:N,name:c,type:"text",value:R,onChange:$,onKeyDown:A,onFocus:B,onBlur:P,onPaste:M,placeholder:e.length===0?s:"",disabled:a,className:j("flex-1 min-w-[120px] outline-none bg-transparent border-none shadow-none p-0 h-6","placeholder:text-muted-foreground","disabled:cursor-not-allowed"),"aria-label":b,"aria-labelledby":C,"aria-invalid":_||!!L,"aria-describedby":r||z?`${N}-description`:void 0})]}),r&&!z&&i.jsx(Ms,{id:`${N}-description`,children:r}),z&&i.jsx(Dr,{id:`${N}-description`,children:z})]})]})});uh.displayName="MultiValuesField";var dh="Radio",[HL,Jb]=gt(dh),[GL,UL]=HL(dh),Qb=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:a,value:l="on",onCheck:c,form:u,...f}=e,[d,p]=m.useState(null),h=Se(t,v=>p(v)),g=m.useRef(!1),x=d?u||!!d.closest("form"):!0;return i.jsxs(GL,{scope:n,checked:o,disabled:a,children:[i.jsx(se.button,{type:"button",role:"radio","aria-checked":o,"data-state":r5(o),"data-disabled":a?"":void 0,disabled:a,value:l,...f,ref:h,onClick:ee(e.onClick,v=>{o||c?.(),x&&(g.current=v.isPropagationStopped(),g.current||v.stopPropagation())})}),x&&i.jsx(n5,{control:d,bubbles:!g.current,name:r,value:l,checked:o,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Qb.displayName=dh;var e5="RadioIndicator",t5=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=UL(e5,n);return i.jsx(Nt,{present:r||s.checked,children:i.jsx(se.span,{"data-state":r5(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});t5.displayName=e5;var YL="RadioBubbleInput",n5=m.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=m.useRef(null),l=Se(a,s),c=nu(n),u=vc(t);return m.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),i.jsx(se.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});n5.displayName=YL;function r5(e){return e?"checked":"unchecked"}var KL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],au="RadioGroup",[qL]=gt(au,[Ar,Jb]),o5=Ar(),s5=Jb(),[ZL,XL]=qL(au),a5=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:a=!1,disabled:l=!1,orientation:c,dir:u,loop:f=!0,onValueChange:d,...p}=e,h=o5(n),g=yo(u),[x,v]=ht({prop:s,defaultProp:o??null,onChange:d,caller:au});return i.jsx(ZL,{scope:n,name:r,required:a,disabled:l,value:x,onValueChange:v,children:i.jsx($c,{asChild:!0,...h,orientation:c,dir:g,loop:f,children:i.jsx(se.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":l?"":void 0,dir:g,...p,ref:t})})})});a5.displayName=au;var i5="RadioGroupItem",l5=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=XL(i5,n),a=s.disabled||r,l=o5(n),c=s5(n),u=m.useRef(null),f=Se(t,u),d=s.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const h=x=>{KL.includes(x.key)&&(p.current=!0)},g=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),i.jsx(Vc,{asChild:!0,...l,focusable:!a,active:d,children:i.jsx(Qb,{disabled:a,required:s.required,checked:d,...c,...o,name:s.name,ref:f,onCheck:()=>s.onValueChange(o.value),onKeyDown:ee(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:ee(o.onFocus,()=>{p.current&&u.current?.click()})})})});l5.displayName=i5;var JL="RadioGroupIndicator",c5=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=s5(n);return i.jsx(t5,{...o,...r,ref:t})});c5.displayName=JL;var QL=a5,eI=l5,tI=c5;function iu({className:e,...t}){return i.jsx(QL,{"data-slot":"radio-group",className:j("grid gap-3",e),...t})}function lu({className:e,...t}){return i.jsx(eI,{"data-slot":"radio-group-item",className:j("border-input bg-background text-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aspect-square size-4 shrink-0 rounded-full border transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(tI,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:i.jsx("span",{className:"size-2 rounded-full bg-primary"})})})}const u5=({option:e,radioId:t,isInlineLayout:n=!1})=>i.jsxs("div",{className:n?"flex items-center gap-3":"flex items-start gap-3",children:[i.jsx(lu,{value:e.value,id:t,disabled:e.disabled,className:"cursor-pointer mt-0.5"}),n?i.jsxs(i.Fragment,{children:[i.jsx(En,{htmlFor:t,className:j("cursor-pointer",e.disabled&&"text-muted-foreground"),children:e.label}),e.description&&i.jsx("p",{className:"text-sm text-muted-foreground ms-auto",children:e.description})]}):i.jsxs("div",{className:"flex flex-col gap-1.5 flex-1",children:[i.jsx(En,{htmlFor:t,className:j("cursor-pointer",e.disabled&&"text-muted-foreground"),children:e.label}),e.description&&i.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})]}),d5=S.forwardRef(({options:e,name:t,label:n,orientation:r="vertical",layout:o="stacked",onChange:s,"aria-labelledby":a,...l},c)=>{const u=o==="inline",f=r==="horizontal",d=`${S.useId()}-label`,p=a??(n!=null?d:void 0),h=i.jsx(iu,{ref:c,className:f?"flex flex-row flex-wrap gap-6":"flex flex-col gap-3",onValueChange:s,"aria-labelledby":p,...l,children:e.map(g=>{const x=`${t}-${g.value}`;return i.jsx(u5,{option:g,radioId:x,isInlineLayout:u},g.value)})});return n==null?h:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx("span",{id:d,className:"text-sm font-medium text-foreground",children:n}),h]})});d5.displayName="RadioGroup";const f5=m.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:j("flex min-w-0 w-full rounded-md border border-input bg-background overflow-hidden","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","has-[[data-slot=input-group-control][aria-invalid='true']]:border-destructive has-[[data-slot=input-group-control][aria-invalid='true']]:ring-destructive/20 dark:has-[[data-slot=input-group-control][aria-invalid='true']]:ring-destructive/40",e),...t}));f5.displayName="InputGroup";const Jd=m.forwardRef(({className:e,align:t="inline-start",...n},r)=>i.jsx("div",{ref:r,className:j("flex items-center gap-1.5 h-9 shrink-0",t==="inline-start"&&"order-first ps-3",t==="inline-end"&&"order-last pe-3",t==="block-start"&&"order-first flex-col w-full pb-1.5 px-0 h-auto",t==="block-end"&&"order-last flex-col w-full pt-1.5 px-0 h-auto",e),...n}));Jd.displayName="InputGroupAddon";const p5=m.forwardRef(({className:e,...t},n)=>i.jsx(Ds,{ref:n,"data-slot":"input-group-control",className:j("flex-1 min-w-0 border-0 shadow-none rounded-none bg-transparent","focus-visible:ring-0 focus-visible:border-0","aria-invalid:border-0 aria-invalid:ring-0",e),...t}));p5.displayName="InputGroupInput";const nI=m.forwardRef(({className:e,...t},n)=>i.jsx(ch,{ref:n,"data-slot":"input-group-control",className:j("flex-1 min-w-0 border-0 shadow-none rounded-none bg-transparent","focus-visible:ring-0 focus-visible:border-0",e),...t}));nI.displayName="InputGroupTextarea";const rI=m.forwardRef(({className:e,...t},n)=>i.jsx("span",{ref:n,className:j("text-sm text-muted-foreground whitespace-nowrap",e),...t}));rI.displayName="InputGroupText";const oI=We("shrink-0",{variants:{size:{xs:"h-7 px-2 text-xs",sm:"h-8 px-3 text-sm","icon-xs":"size-7","icon-sm":"size-8"}},defaultVariants:{size:"sm"}}),sI=m.forwardRef(({className:e,size:t,...n},r)=>i.jsx(Ct,{ref:r,className:j(oI({size:t}),e),...n}));sI.displayName="InputGroupButton";const gs=S.forwardRef(({className:e,orientation:t="vertical",label:n,description:r,error:o,info:s,requiredIndicator:a,required:l,id:c,button:u,disabled:f,startIcon:d,startIconProps:p,endIcon:h,endIconProps:g,inputProps:x,...v},y)=>{const b=S.useId(),C=c||x?.id||b,w=!!o;return i.jsxs(bo,{orientation:t,"data-invalid":w,className:j("w-full",e),children:[i.jsx(ks,{htmlFor:C,label:n,info:s,requiredIndicator:a,required:l,disabled:f}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsxs(f5,{className:"flex-1",children:[d&&i.jsx(Jd,{align:"inline-start",children:i.jsx(q,{name:p?.name||d,size:"sm",...p,className:j("cursor-default text-muted-foreground",p?.className)})}),i.jsx(p5,{ref:y,disabled:f,required:l,className:j(x?.className),"aria-invalid":w?!0:void 0,"aria-describedby":r||o?`${C}-description`:void 0,...v,...x,id:C}),h&&i.jsx(Jd,{align:"inline-end",children:i.jsx(q,{name:g?.name||h,size:"sm",...g,className:j("cursor-default text-muted-foreground",g?.className)})})]}),u&&i.jsx(ot,{disabled:f,...u})]}),r&&!o&&i.jsx(Ms,{id:`${C}-description`,children:r}),o&&i.jsx(Dr,{id:`${C}-description`,children:o})]})]})});gs.displayName="Field";const h5=m.forwardRef(({className:e,value:t,...n},r)=>i.jsx(Ds,{ref:r,type:"time",step:"1",value:t,className:j("h-9",e),...n}));h5.displayName="TimePicker";const aI=Array.from({length:12},(e,t)=>t+1),iI=Array.from({length:24},(e,t)=>t),lI=["AM","PM"],cI=e=>{if(e===0)return Array.from({length:60},(n,r)=>r);const t=60/e;return Array.from({length:t},(n,r)=>r*e)},fr=e=>e.toString().padStart(2,"0"),uI=e=>{const t=e>=12?"PM":"AM",n=e>12?e-12:e;return{hour:e===0?12:n,meridiem:t}},dI=(e,t)=>e===12?t==="AM"?0:12:t==="PM"?e+12:e,Kl=m.forwardRef(({className:e,label:t,error:n,description:r,orientation:o="vertical",id:s,onChange:a,mode:l="native",divisorMinutes:c=0,width:u=140,value:f,disabled:d,use24Hour:p=!1,...h},g)=>{const x=S.useId(),v=s||x,y=!!n;if(l==="native"){const b=i.jsx(h5,{ref:g,id:v,value:f,disabled:d,className:j(y&&"border-destructive focus-visible:border-destructive",!(t||n||r)&&e),"aria-invalid":y?!0:void 0,"aria-describedby":r||n?`${v}-description`:void 0,...h,onChange:C=>{a?.(C.target.value)}});return t||n||r?i.jsxs(bo,{orientation:o,"data-invalid":y,className:j("w-full",e),children:[t&&i.jsx(Rs,{htmlFor:v,children:t}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[b,r&&!n&&i.jsx(Ms,{id:`${v}-description`,children:r}),n&&i.jsx(Dr,{id:`${v}-description`,children:n})]})]}):b}return i.jsx(fI,{value:f||(p?"00:00":"12:00"),onChange:a,divisorMinutes:c,width:u,label:t,error:n,description:r,disabled:d,className:e,use24Hour:p})});Kl.displayName="TimePicker";const fI=({value:e,onChange:t,divisorMinutes:n,width:r,label:o,error:s,description:a,disabled:l,className:c,use24Hour:u=!1})=>{const[f,d]=S.useState(!1),p=S.useRef(null),h=S.useRef(null),g=$=>{const[B,P]=$.split(":"),M=parseInt(B,10)||0,G=parseInt(P,10)||0;if(u)return{hour24:M,minute:G,hour:M,meridiem:"AM"};const{hour:T,meridiem:z}=uI(M);return{hour24:M,minute:G,hour:T,meridiem:z}},{hour:x,hour24:v,minute:y,meridiem:b}=g(e),[C,w]=S.useState(u?v:x),[E,N]=S.useState(y),[_,R]=S.useState(b),I=cI(n),F=($,B,P)=>{let M;u?M=$:M=dI($,P);const G=`${fr(M)}:${fr(B)}`;t?.(G)},U=$=>{w($),F($,E,_)},L=$=>{N($),F(C,$,_)},k=$=>{R($),F(C,E,$)};S.useEffect(()=>{const $=B=>{h.current&&!h.current.contains(B.target)&&d(!1)};if(f)return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[f]);const O=u?`${fr(C)}:${fr(E)}`:`${fr(C)}:${fr(E)} ${_}`,V=u?iI:aI,A=i.jsxs("div",{ref:h,className:j("relative inline-block",c),style:{width:typeof r=="number"?`${r}px`:r},children:[i.jsxs("button",{type:"button",disabled:l,onClick:()=>!l&&d(!f),className:j("flex items-center justify-between w-full h-9 px-3 py-2","text-sm rounded-md border border-input bg-input","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive"),children:[i.jsx("span",{children:O}),i.jsx(q,{name:f?"CaretUp":"CaretDown",size:"sm",className:"ml-2"})]}),f&&i.jsxs("div",{ref:p,className:j("absolute z-popover mt-1 bg-popover border border-border rounded-md shadow-lg","flex divide-x divide-border"),style:{width:"fit-content",minWidth:u?"140px":"200px"},children:[i.jsx("div",{className:"flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]",children:V.map($=>i.jsx("button",{type:"button",onClick:()=>U($),className:j("px-3 py-2 text-sm text-left hover:bg-accent",C===$&&"bg-primary text-primary-foreground hover:bg-primary"),children:fr($)},$))}),i.jsx("div",{className:"flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]",children:I.map($=>i.jsx("button",{type:"button",onClick:()=>L($),className:j("px-3 py-2 text-sm text-left hover:bg-accent",E===$&&"bg-primary text-primary-foreground hover:bg-primary"),children:fr($)},$))}),!u&&i.jsx("div",{className:"flex flex-col min-w-[60px]",children:lI.map($=>i.jsx("button",{type:"button",onClick:()=>k($),className:j("px-3 py-2 text-sm text-left hover:bg-accent",_===$&&"bg-primary text-primary-foreground hover:bg-primary"),children:$},$))})]})]});return o||s||a?i.jsxs(bo,{orientation:"vertical",className:j("w-full",c),children:[o&&i.jsx(Rs,{children:o}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[A,a&&!s&&i.jsx(Ms,{children:a}),s&&i.jsx(Dr,{children:s})]})]}):A},pI=We("flex gap-2 w-full",{variants:{layout:{vertical:"flex-col",horizontal:"flex-row items-start gap-4"}},defaultVariants:{layout:"vertical"}}),hI=We("",{variants:{layout:{vertical:"",horizontal:"mt-2"}},defaultVariants:{layout:"vertical"}}),cu=S.forwardRef(({placeholder:e="Search",onSearch:t,limitSearch:n=10,persistKey:r="",value:o="",searchOnChange:s=!0,enableHistory:a=!0,label:l,description:c,error:u,id:f,disabled:d,layout:p="vertical",className:h,inputProps:g,actionName:x,...v},y)=>{const b=S.useId(),C=f||g?.id||b,w=!!u,[E,N]=S.useState(ut(o)),[_,R]=S.useState(()=>{if(!r)return[];try{const D=JSON.parse(localStorage.getItem(`${r}_searchfield`)??"null");if(!Array.isArray(D))return[];const W=new Set;return D.reduce((Y,Z)=>{const J=ut(Z?.value??"");return!J||W.has(J)||(W.add(J),Y.push({...Z,label:J,value:J})),Y},[])}catch{return[]}}),[I,F]=S.useState([]),[U,L]=S.useState(!1),[k,O]=S.useState(!1),V=S.useRef(null),A=S.useRef(null),$=D=>{const W=D.target.value;N(W),(W===""||s)&&t(ut(W))},B=D=>{const W=D.currentTarget,Y=D.clipboardData.getData("text"),Z=W.selectionStart??E.length,J=W.selectionEnd??E.length,oe=E.slice(0,Z)+Y+E.slice(J),ne=ut(oe);ne!==oe&&(D.preventDefault(),N(ne),(ne===""||s)&&t(ne))},P=D=>{D.key==="Enter"&&E!==""&&M()},M=()=>{const D=ut(E);if(D){if(D!==E&&N(D),a){const W={label:D,value:D},Y=_.filter(J=>J.value!==D),Z=_.length<n?[W,...Y]:[W,...Y.slice(0,n-1)];R(Z),r&&localStorage.setItem(`${r}_searchfield`,JSON.stringify(Z))}t(D)}},G=()=>{N(""),t(""),V.current?.focus()},T=D=>{const W=ut(D);N(W),t(W),L(!1),V.current?.focus()},z=()=>{L(!0)},H=()=>{k||L(!1)};return S.useEffect(()=>{const D=ut(o);N(D),D!==o&&t(D)},[o]),S.useEffect(()=>{const D=_.map(W=>({...W,isSelected:W.value===E})).filter(W=>E===""?!0:W.label.toLowerCase().includes(E.toLowerCase()));F(D)},[E,_]),i.jsxs("div",{"data-action-name":x,className:j(pI({layout:p}),h),children:[l&&i.jsx(En,{htmlFor:C,className:j(hI({layout:p})),children:l}),i.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:"relative flex",children:[i.jsx(Ds,{ref:D=>{typeof y=="function"?y(D):y&&(y.current=D),D&&(V.current=D)},type:"text",value:E,onChange:$,onPaste:B,onKeyDown:P,onFocus:z,onBlur:H,placeholder:e,disabled:d,autoComplete:"off","aria-invalid":w,"aria-describedby":c||u?`${C}-description`:void 0,...v,...g,id:C,className:j(w&&"border-destructive focus-visible:border-destructive","!px-9",g?.className)}),i.jsx("button",{type:"button","aria-label":"Search",onClick:M,disabled:d,className:j("absolute start-3 top-1/2 -translate-y-1/2 inline-flex items-center text-muted-foreground dark:text-foreground",!d&&"cursor-pointer hover:text-foreground transition-colors"),children:i.jsx(q,{name:"MagnifyingGlass",size:"sm"})}),E&&i.jsx("button",{type:"button","aria-label":"Clear search",onClick:G,disabled:d,className:j("absolute end-3 top-1/2 -translate-y-1/2 inline-flex items-center text-muted-foreground",!d&&"cursor-pointer hover:text-foreground transition-colors"),children:i.jsx(q,{name:"XCircle",size:"sm",weight:"fill"})})]}),a&&I.length>0&&U&&i.jsx("div",{ref:A,onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),className:j("absolute z-popover w-full mt-1 rounded-md border bg-popover text-popover-foreground shadow-md","max-h-[300px] overflow-y-auto"),children:i.jsx("div",{className:"py-1",children:I.map((D,W)=>i.jsx("button",{type:"button",onClick:()=>T(D.value),className:j("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",D.isSelected&&"bg-accent text-accent-foreground"),children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(q,{name:"ClockCounterClockwise",size:"sm",className:"text-muted-foreground"}),i.jsx("span",{className:"truncate",children:D.label})]})},`${D.value}-${W}`))})})]}),(c||u)&&i.jsx("p",{id:`${C}-description`,className:j("text-sm",u?"text-destructive":"text-muted-foreground"),children:u||c})]})]})});cu.displayName="SearchField";const mI=({allowed:e,children:t,message:n="You don't have permission to perform this action"})=>e?i.jsx(i.Fragment,{children:t}):i.jsx(St,{content:n,show:!e,children:i.jsx("span",{className:"block w-full",children:t})}),m5=({options:e,icon:t=null,ariaLabel:n="more",className:r,disabled:o=!1,marginBottom:s})=>{const[a,l]=m.useState(!1),c=d=>{l(d)},u=d=>{d.allowed&&d.handleClick&&d.handleClick(e),l(!1)};if(!e.actions||e.actions.length===0)return null;const f={};return s!==void 0&&(f.marginBottom=`${s}px`),i.jsx("div",{className:j("inline-flex relative",r),style:f,children:i.jsxs(Wc,{open:a,onOpenChange:c,children:[i.jsx(Hc,{asChild:!0,disabled:o,children:i.jsx(ot,{disabled:o,variant:"ghost",size:"icon",className:"h-8 w-8 p-1","aria-label":n,"aria-controls":a?"dots-menu":void 0,"aria-expanded":a,"aria-haspopup":"true",children:i.jsx(q,{name:t||"DotsThreeOutline",weight:t?"light":"fill",size:"sm",className:j("transition-colors",a?"text-primary-text":"text-muted-foreground")})})}),i.jsx(Gc,{id:"dots-menu",align:"end",className:j("max-h-[216px] overflow-y-auto"),children:e.actions.map(d=>i.jsx(mI,{allowed:d.allowed??!0,message:d.message,children:i.jsxs(gn,{onClick:()=>u(d),disabled:!d.allowed,"data-action-name":d.dataActionName,className:j("flex items-center gap-3.5 cursor-pointer",d.variant==="destructive"&&"text-destructive focus:text-destructive"),children:[i.jsx(q,{name:d.icon,size:"sm",className:"shrink-0"}),i.jsx("span",{className:j(d.variant==="success"&&"text-success"),children:d.name||String(d.key)})]})},d.key))})]})})};m5.displayName="DotsMenu";const g5=S.forwardRef(({defaultVisible:e=!1,label:t,forgotPasswordLinkProps:n,...r},o)=>{const[s,a]=S.useState(e),l=()=>{a(c=>!c)};return n&&t?i.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(En,{children:t}),i.jsx($p,{className:j("text-muted-foreground",n?.className),...n,children:n.children||"Forgot password?"})]}),i.jsx(gs,{ref:o,type:s?"text":"password",endIcon:s?"EyeClosed":"Eye",endIconProps:{onClick:l,className:"cursor-pointer",tooltip:s?"Hide password":"Show password"},...r})]}):i.jsx(gs,{ref:o,label:t,type:s?"text":"password",endIcon:s?"EyeClosed":"Eye",endIconProps:{onClick:l,className:"cursor-pointer",tooltip:s?"Hide password":"Show password"},...r})});g5.displayName="PasswordField";function z1(e,[t,n]){return Math.min(n,Math.max(t,e))}function gI(e){const t=xI(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,l=m.Children.toArray(s),c=l.find(yI);if(c){const u=c.props.children,f=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(u)?m.cloneElement(u,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function xI(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=wI(o),l=bI(s,o.props);return o.type!==m.Fragment&&(l.ref=r?Pt(r,a):a),m.cloneElement(o,l)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vI=Symbol("radix.slottable");function yI(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vI}function bI(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function wI(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var CI=[" ","Enter","ArrowUp","ArrowDown"],SI=[" ","Enter"],uo="Select",[uu,du,EI]=Sc(uo),[Ps]=gt(uo,[EI,Rr]),fu=Rr(),[NI,Or]=Ps(uo),[_I,jI]=Ps(uo),x5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:l,onValueChange:c,dir:u,name:f,autoComplete:d,disabled:p,required:h,form:g}=e,x=fu(t),[v,y]=m.useState(null),[b,C]=m.useState(null),[w,E]=m.useState(!1),N=yo(u),[_,R]=ht({prop:r,defaultProp:o??!1,onChange:s,caller:uo}),[I,F]=ht({prop:a,defaultProp:l,onChange:c,caller:uo}),U=m.useRef(null),L=v?g||!!v.closest("form"):!0,[k,O]=m.useState(new Set),V=Array.from(k).map(A=>A.props.value).join(";");return i.jsx(ni,{...x,children:i.jsxs(NI,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:E,contentId:qe(),value:I,onValueChange:F,open:_,onOpenChange:R,dir:N,triggerPointerDownPosRef:U,disabled:p,children:[i.jsx(uu.Provider,{scope:t,children:i.jsx(_I,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(A=>{O($=>new Set($).add(A))},[]),onNativeOptionRemove:m.useCallback(A=>{O($=>{const B=new Set($);return B.delete(A),B})},[]),children:n})}),L?i.jsxs(z5,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:I,onChange:A=>F(A.target.value),disabled:p,form:g,children:[I===void 0?i.jsx("option",{value:""}):null,Array.from(k)]},V):null]})})};x5.displayName=uo;var v5="SelectTrigger",y5=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=fu(n),a=Or(v5,n),l=a.disabled||r,c=Se(t,a.onTriggerChange),u=du(n),f=m.useRef("touch"),[d,p,h]=H5(x=>{const v=u().filter(C=>!C.disabled),y=v.find(C=>C.value===a.value),b=G5(v,x,y);b!==void 0&&a.onValueChange(b.value)}),g=x=>{l||(a.onOpenChange(!0),h()),x&&(a.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return i.jsx(ri,{asChild:!0,...s,children:i.jsx(se.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":W5(a.value)?"":void 0,...o,ref:c,onClick:ee(o.onClick,x=>{x.currentTarget.focus(),f.current!=="mouse"&&g(x)}),onPointerDown:ee(o.onPointerDown,x=>{f.current=x.pointerType;const v=x.target;v.hasPointerCapture(x.pointerId)&&v.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(g(x),x.preventDefault())}),onKeyDown:ee(o.onKeyDown,x=>{const v=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(v&&x.key===" ")&&CI.includes(x.key)&&(g(),x.preventDefault())})})})});y5.displayName=v5;var b5="SelectValue",w5=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...l}=e,c=Or(b5,n),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,d=Se(t,c.onValueNodeChange);return at(()=>{u(f)},[u,f]),i.jsx(se.span,{...l,ref:d,style:{pointerEvents:"none"},children:W5(c.value)?i.jsx(i.Fragment,{children:a}):s})});w5.displayName=b5;var kI="SelectIcon",C5=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return i.jsx(se.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});C5.displayName=kI;var RI="SelectPortal",S5=e=>i.jsx(Ns,{asChild:!0,...e});S5.displayName=RI;var fo="SelectContent",E5=m.forwardRef((e,t)=>{const n=Or(fo,e.__scopeSelect),[r,o]=m.useState();if(at(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?pc.createPortal(i.jsx(N5,{scope:e.__scopeSelect,children:i.jsx(uu.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),s):null}return i.jsx(_5,{...e,ref:t})});E5.displayName=fo;var mn=10,[N5,Lr]=Ps(fo),MI="SelectContentImpl",DI=gI("SelectContent.RemoveScroll"),_5=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:l,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:x,avoidCollisions:v,...y}=e,b=Or(fo,n),[C,w]=m.useState(null),[E,N]=m.useState(null),_=Se(t,Y=>w(Y)),[R,I]=m.useState(null),[F,U]=m.useState(null),L=du(n),[k,O]=m.useState(!1),V=m.useRef(!1);m.useEffect(()=>{if(C)return Tc(C)},[C]),Ac();const A=m.useCallback(Y=>{const[Z,...J]=L().map(ce=>ce.ref.current),[oe]=J.slice(-1),ne=document.activeElement;for(const ce of Y)if(ce===ne||(ce?.scrollIntoView({block:"nearest"}),ce===Z&&E&&(E.scrollTop=0),ce===oe&&E&&(E.scrollTop=E.scrollHeight),ce?.focus(),document.activeElement!==ne))return},[L,E]),$=m.useCallback(()=>A([R,C]),[A,R,C]);m.useEffect(()=>{k&&$()},[k,$]);const{onOpenChange:B,triggerPointerDownPosRef:P}=b;m.useEffect(()=>{if(C){let Y={x:0,y:0};const Z=oe=>{Y={x:Math.abs(Math.round(oe.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(P.current?.y??0))}},J=oe=>{Y.x<=10&&Y.y<=10?oe.preventDefault():C.contains(oe.target)||B(!1),document.removeEventListener("pointermove",Z),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",J,{capture:!0})}}},[C,B,P]),m.useEffect(()=>{const Y=()=>B(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[B]);const[M,G]=H5(Y=>{const Z=L().filter(ne=>!ne.disabled),J=Z.find(ne=>ne.ref.current===document.activeElement),oe=G5(Z,Y,J);oe&&setTimeout(()=>oe.ref.current.focus())}),T=m.useCallback((Y,Z,J)=>{const oe=!V.current&&!J;(b.value!==void 0&&b.value===Z||oe)&&(I(Y),oe&&(V.current=!0))},[b.value]),z=m.useCallback(()=>C?.focus(),[C]),H=m.useCallback((Y,Z,J)=>{const oe=!V.current&&!J;(b.value!==void 0&&b.value===Z||oe)&&U(Y)},[b.value]),D=r==="popper"?Qd:j5,W=D===Qd?{side:l,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return i.jsx(N5,{scope:n,content:C,viewport:E,onViewportChange:N,itemRefCallback:T,selectedItem:R,onItemLeave:z,itemTextRefCallback:H,focusSelectedItem:$,selectedItemText:F,position:r,isPositioned:k,searchRef:M,children:i.jsx(ui,{as:DI,allowPinchZoom:!0,children:i.jsx(ci,{asChild:!0,trapped:b.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:ee(o,Y=>{b.trigger?.focus({preventScroll:!0}),Y.preventDefault()}),children:i.jsx(Cs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:i.jsx(D,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Y=>Y.preventDefault(),...y,...W,onPlaced:()=>O(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ee(y.onKeyDown,Y=>{const Z=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!Z&&Y.key.length===1&&G(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let oe=L().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ne=Y.target,ce=oe.indexOf(ne);oe=oe.slice(ce+1)}setTimeout(()=>A(oe)),Y.preventDefault()}})})})})})})});_5.displayName=MI;var AI="SelectItemAlignedPosition",j5=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Or(fo,n),a=Lr(fo,n),[l,c]=m.useState(null),[u,f]=m.useState(null),d=Se(t,_=>f(_)),p=du(n),h=m.useRef(!1),g=m.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=a,C=m.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&x&&v&&y){const _=s.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),F=y.getBoundingClientRect();if(s.dir!=="rtl"){const ne=F.left-R.left,ce=I.left-ne,Ee=_.left-ce,re=_.width+Ee,ue=Math.max(re,R.width),K=window.innerWidth-mn,Q=z1(ce,[mn,Math.max(mn,K-ue)]);l.style.minWidth=re+"px",l.style.left=Q+"px"}else{const ne=R.right-F.right,ce=window.innerWidth-I.right-ne,Ee=window.innerWidth-_.right-ce,re=_.width+Ee,ue=Math.max(re,R.width),K=window.innerWidth-mn,Q=z1(ce,[mn,Math.max(mn,K-ue)]);l.style.minWidth=re+"px",l.style.right=Q+"px"}const U=p(),L=window.innerHeight-mn*2,k=x.scrollHeight,O=window.getComputedStyle(u),V=parseInt(O.borderTopWidth,10),A=parseInt(O.paddingTop,10),$=parseInt(O.borderBottomWidth,10),B=parseInt(O.paddingBottom,10),P=V+A+k+B+$,M=Math.min(v.offsetHeight*5,P),G=window.getComputedStyle(x),T=parseInt(G.paddingTop,10),z=parseInt(G.paddingBottom,10),H=_.top+_.height/2-mn,D=L-H,W=v.offsetHeight/2,Y=v.offsetTop+W,Z=V+A+Y,J=P-Z;if(Z<=H){const ne=U.length>0&&v===U[U.length-1].ref.current;l.style.bottom="0px";const ce=u.clientHeight-x.offsetTop-x.offsetHeight,Ee=Math.max(D,W+(ne?z:0)+ce+$),re=Z+Ee;l.style.height=re+"px"}else{const ne=U.length>0&&v===U[0].ref.current;l.style.top="0px";const Ee=Math.max(H,V+x.offsetTop+(ne?T:0)+W)+J;l.style.height=Ee+"px",x.scrollTop=Z-H+x.offsetTop}l.style.margin=`${mn}px 0`,l.style.minHeight=M+"px",l.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,l,u,x,v,y,s.dir,r]);at(()=>C(),[C]);const[w,E]=m.useState();at(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const N=m.useCallback(_=>{_&&g.current===!0&&(C(),b?.(),g.current=!1)},[C,b]);return i.jsx(PI,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:i.jsx(se.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});j5.displayName=AI;var TI="SelectPopperPosition",Qd=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=mn,...s}=e,a=fu(n);return i.jsx(yc,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Qd.displayName=TI;var[PI,fh]=Ps(fo,{}),ef="SelectViewport",k5=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Lr(ef,n),a=fh(ef,n),l=Se(t,s.onViewportChange),c=m.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("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}"},nonce:r}),i.jsx(uu.Slot,{scope:n,children:i.jsx(se.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ee(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=a;if(p?.current&&d){const h=Math.abs(c.current-f.scrollTop);if(h>0){const g=window.innerHeight-mn*2,x=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),y=Math.max(x,v);if(y<g){const b=y+h,C=Math.min(g,b),w=b-C;d.style.height=C+"px",d.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});k5.displayName=ef;var R5="SelectGroup",[OI,LI]=Ps(R5),M5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=qe();return i.jsx(OI,{scope:n,id:o,children:i.jsx(se.div,{role:"group","aria-labelledby":o,...r,ref:t})})});M5.displayName=R5;var D5="SelectLabel",A5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=LI(D5,n);return i.jsx(se.div,{id:o.id,...r,ref:t})});A5.displayName=D5;var ql="SelectItem",[II,T5]=Ps(ql),P5=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,l=Or(ql,n),c=Lr(ql,n),u=l.value===r,[f,d]=m.useState(s??""),[p,h]=m.useState(!1),g=Se(t,b=>c.itemRefCallback?.(b,r,o)),x=qe(),v=m.useRef("touch"),y=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(II,{scope:n,value:r,disabled:o,textId:x,isSelected:u,onItemTextChange:m.useCallback(b=>{d(C=>C||(b?.textContent??"").trim())},[]),children:i.jsx(uu.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:i.jsx(se.div,{role:"option","aria-labelledby":x,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:ee(a.onFocus,()=>h(!0)),onBlur:ee(a.onBlur,()=>h(!1)),onClick:ee(a.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:ee(a.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:ee(a.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:ee(a.onPointerMove,b=>{v.current=b.pointerType,o?c.onItemLeave?.():v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(a.onPointerLeave,b=>{b.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ee(a.onKeyDown,b=>{c.searchRef?.current!==""&&b.key===" "||(SI.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});P5.displayName=ql;var aa="SelectItemText",O5=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Or(aa,n),l=Lr(aa,n),c=T5(aa,n),u=jI(aa,n),[f,d]=m.useState(null),p=Se(t,y=>d(y),c.onItemTextChange,y=>l.itemTextRefCallback?.(y,c.value,c.disabled)),h=f?.textContent,g=m.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return at(()=>(x(g),()=>v(g)),[x,v,g]),i.jsxs(i.Fragment,{children:[i.jsx(se.span,{id:c.textId,...s,ref:p}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?pc.createPortal(s.children,a.valueNode):null]})});O5.displayName=aa;var L5="SelectItemIndicator",I5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return T5(L5,n).isSelected?i.jsx(se.span,{"aria-hidden":!0,...r,ref:t}):null});I5.displayName=L5;var tf="SelectScrollUpButton",F5=m.forwardRef((e,t)=>{const n=Lr(tf,e.__scopeSelect),r=fh(tf,e.__scopeSelect),[o,s]=m.useState(!1),a=Se(t,r.onScrollButtonChange);return at(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?i.jsx(V5,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});F5.displayName=tf;var nf="SelectScrollDownButton",$5=m.forwardRef((e,t)=>{const n=Lr(nf,e.__scopeSelect),r=fh(nf,e.__scopeSelect),[o,s]=m.useState(!1),a=Se(t,r.onScrollButtonChange);return at(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;s(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?i.jsx(V5,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});$5.displayName=nf;var V5=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Lr("SelectScrollButton",n),a=m.useRef(null),l=du(n),c=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),at(()=>{l().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(se.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ee(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ee(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ee(o.onPointerLeave,()=>{c()})})}),FI="SelectSeparator",B5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(se.div,{"aria-hidden":!0,...r,ref:t})});B5.displayName=FI;var rf="SelectArrow",$I=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=fu(n),s=Or(rf,n),a=Lr(rf,n);return s.open&&a.position==="popper"?i.jsx(bc,{...o,...r,ref:t}):null});$I.displayName=rf;var VI="SelectBubbleInput",z5=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=Se(r,o),a=nu(t);return m.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(l,t),l.dispatchEvent(d)}},[a,t]),i.jsx(se.select,{...n,style:{...wx,...n.style},ref:s,defaultValue:t})});z5.displayName=VI;function W5(e){return e===""||e===void 0}function H5(e){const t=un(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(a=>{const l=n.current+a;t(l),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function G5(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=BI(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function BI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zI=x5,U5=y5,WI=w5,HI=C5,GI=S5,Y5=E5,UI=k5,YI=M5,K5=A5,q5=P5,KI=O5,qI=I5,Z5=F5,X5=$5,J5=B5;const ZI=({dir:e,...t})=>i.jsx(zI,{dir:e??vo(),...t}),XI=YI,JI=WI,Q5=m.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(U5,{ref:r,className:j("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground outline-none transition-colors focus:border-ring focus:ring-2 focus:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:min-w-0 [&>span]:truncate",e),...n,children:[t,i.jsx(HI,{asChild:!0,children:i.jsx(q,{name:"CaretDown",size:"sm",className:"opacity-50 shrink-0"})})]}));Q5.displayName=U5.displayName;const ew=m.forwardRef(({className:e,...t},n)=>i.jsx(Z5,{ref:n,className:j("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(q,{name:"CaretUp",size:"sm"})}));ew.displayName=Z5.displayName;const tw=m.forwardRef(({className:e,...t},n)=>i.jsx(X5,{ref:n,className:j("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(q,{name:"CaretDown",size:"sm"})}));tw.displayName=X5.displayName;const nw=m.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>i.jsx(GI,{children:i.jsxs(Y5,{ref:o,className:j("relative z-select max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground animate-dialog-in shadow-lg",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(ew,{}),i.jsx(UI,{className:j("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(tw,{})]})}));nw.displayName=Y5.displayName;const rw=m.forwardRef(({className:e,...t},n)=>i.jsx(K5,{ref:n,className:j("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",e),...t}));rw.displayName=K5.displayName;const of=m.forwardRef(({className:e,children:t,badge:n,...r},o)=>i.jsxs(q5,{ref:o,className:j("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[i.jsx("span",{className:"absolute end-2 flex h-4 w-4 items-center justify-center",children:i.jsx(qI,{children:i.jsx(q,{name:"Check",size:"sm"})})}),i.jsx(KI,{children:t}),n&&i.jsx("span",{className:"ms-2 inline-flex items-center",children:n})]}));of.displayName=q5.displayName;const QI=m.forwardRef(({className:e,...t},n)=>i.jsx(J5,{ref:n,className:j("-mx-1 my-1 h-px bg-border",e),...t}));QI.displayName=J5.displayName;const ow=m.forwardRef(({label:e,description:t,error:n,info:r,requiredIndicator:o,required:s=!1,placeholder:a="Select an option",value:l,defaultValue:c,onChange:u,disabled:f=!1,options:d=[],groups:p=[],className:h,id:g,"aria-label":x},v)=>{const y=p.length>0,b=d.length>0;return i.jsxs("div",{className:j("w-full",h),children:[(e||r||o)&&i.jsx("div",{className:"mb-2",children:i.jsx(ks,{htmlFor:g,label:e,info:r,requiredIndicator:o,required:s,disabled:f})}),t&&!n&&i.jsx("p",{className:j("text-sm font-medium leading-none",j("text-muted-foreground mb-2",f&&"opacity-50")),children:t}),i.jsxs(ZI,{value:l,defaultValue:c,onValueChange:u,disabled:f,children:[i.jsx(Q5,{ref:v,id:g,"aria-label":x,className:j(n&&"border-destructive"),children:i.jsx(JI,{placeholder:a})}),i.jsxs(nw,{children:[y&&p.map((C,w)=>i.jsxs(XI,{children:[C.label&&i.jsx(rw,{children:C.label}),C.options.map(E=>i.jsxs(of,{value:E.value,badge:E.badge&&i.jsx(Ze,{variant:"info",children:E.badge}),children:[E.icon&&i.jsx("span",{className:"me-2 inline-flex items-center",children:E.icon}),E.label]},E.value))]},w)),!y&&b&&d.map(C=>i.jsx(of,{value:C.value,badge:C.badge&&i.jsx(Ze,{variant:"info",children:C.badge}),children:i.jsxs("span",{className:"flex items-center",children:[C.icon&&i.jsx("span",{className:"me-2 inline-flex items-center",children:C.icon}),C.label]})},C.value))]})]}),n&&i.jsx("p",{className:"text-sm font-medium leading-none text-destructive mt-2",children:n})]})});ow.displayName="Select";const sw=xv,aw=vv,ph=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},o)=>i.jsx(yv,{children:i.jsx(Lc,{ref:o,align:t,sideOffset:n,className:j("z-popover w-[var(--radix-popover-trigger-width)] rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),role:"combobox",...r})}));ph.displayName=Lc.displayName;const W1="__yuno_search_select_no_highlight__",eF="end",iw=m.forwardRef(({label:e,description:t,error:n,placeholder:r="Select an option",value:o,defaultValue:s,onChange:a,disabled:l=!1,options:c=[],groups:u=[],className:f,id:d,searchPlaceholder:p="Search",maxHeight:h=300,actionName:g,showItemValue:x=!1,showItemValueCopy:v=!0,showSelectedCheck:y=!0,contentWidth:b,"aria-label":C,"aria-labelledby":w,footer:E},N)=>{const[_,R]=m.useState(!1),[I,F]=m.useState(""),[U,L]=m.useState(W1),k=m.useCallback(D=>{L(W1),R(D)},[]),O=u.length>0,V=c.length>0,A=m.useCallback(()=>{if(!o)return null;if(O)for(const D of u){const W=D.options.find(Y=>Y.value===o);if(W)return W.label}else if(V){const D=c.find(W=>W.value===o);if(D)return D.label}return null},[o,u,c,O,V]),$=m.useCallback(D=>{if(!D)return{filteredOptions:c,filteredGroups:u};const W=D.toLowerCase();if(O){const Y=u.map(Z=>({...Z,options:Z.options.filter(J=>ut(J.label).toLowerCase().includes(W))})).filter(Z=>Z.options.length>0);return{filteredOptions:[],filteredGroups:Y}}else return{filteredOptions:c.filter(Z=>ut(Z.label).toLowerCase().includes(W)),filteredGroups:[]}},[c,u,O]),{filteredOptions:B,filteredGroups:P}=$(ut(I));m.useEffect(()=>{_&&setTimeout(()=>{document.querySelector('[data-slot="command-input"]')?.focus()},0)},[_]),m.useEffect(()=>{if(!_||!o)return;const D=setTimeout(()=>{document.querySelector('[data-slot="command-list"] [data-selected-option="true"]')?.scrollIntoView({block:eF})},0);return()=>clearTimeout(D)},[_,o]),m.useEffect(()=>{_||F("")},[_]),m.useEffect(()=>{s&&!o&&a?.(s)},[s,o,a]);const M=D=>{l||(a?.(D),R(!1))},G=(D,W)=>{D.stopPropagation(),D.preventDefault(),navigator.clipboard?.writeText(W)},T=D=>x&&D?i.jsxs("span",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{className:"truncate",children:D}),v&&i.jsx("button",{type:"button","aria-label":"Copy value",onPointerDown:W=>W.stopPropagation(),onClick:W=>G(W,D),className:"shrink-0 text-muted-foreground hover:text-foreground",children:i.jsx(q,{name:"Copy",size:"sm"})})]}):null,z=D=>i.jsxs("span",{className:"flex items-center justify-between gap-2",children:[i.jsxs("span",{className:"flex min-w-0 items-center",children:[D.icon&&i.jsx("span",{className:"mr-2 inline-flex items-center",children:D.icon}),i.jsx("span",{className:"truncate",children:D.label})]}),D.badge&&i.jsx(Ze,{variant:"info",children:D.badge})]}),H=A();return i.jsxs("div",{dir:vo(),className:j("w-full",f),children:[e&&i.jsx("div",{className:"flex items-center gap-1 mb-2",children:i.jsx(Rs,{htmlFor:d,className:j(l&&"text-muted-foreground"),children:e})}),t&&!n&&i.jsx("p",{className:j("text-sm font-medium leading-none",j("text-muted-foreground mb-2",l&&"text-muted-")),children:t}),i.jsxs(sw,{open:_,onOpenChange:k,children:[i.jsx(aw,{asChild:!0,children:i.jsxs("button",{ref:N,id:d,type:"button",disabled:l,role:"combobox","aria-expanded":_,"aria-haspopup":"listbox","aria-label":C,"aria-labelledby":w,"data-action-name":g,className:j("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-input px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:text-muted- shadow-xs [&>span]:min-w-0 [&>span]:truncate",n&&"border-destructive"),children:[i.jsx("span",{className:j("truncate",!H&&"text-muted-foreground"),children:H||r}),i.jsx(q,{name:"CaretDown",size:"sm",className:"text-muted- shrink-0"})]})}),i.jsx(ph,{className:"p-0",align:"start",style:b?{width:b}:void 0,children:i.jsxs(bi,{shouldFilter:!1,value:U,onValueChange:L,children:[i.jsx(Qc,{placeholder:p,"aria-label":p,value:I,onValueChange:F}),i.jsxs(eu,{style:{maxHeight:h},children:[i.jsx(tu,{children:i.jsx("p",{className:"text-sm font-medium leading-none text-muted-foreground py-6 text-center",children:"No results found."})}),O?P.map((D,W)=>i.jsxs($a,{children:[D.label&&i.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:D.label}),D.options.map(Y=>i.jsxs(Va,{value:Y.value,onSelect:()=>M(Y.value),"data-selected-option":o===Y.value?!0:void 0,className:j("cursor-pointer rounded-none",o===Y.value&&"bg-accent"),children:[i.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[z(Y),T(Y.value)]}),y&&o===Y.value&&i.jsx(q,{name:"Check",size:"sm",className:"ml-auto"})]},Y.value))]},W)):B.map(D=>i.jsxs(Va,{value:D.value,onSelect:()=>M(D.value),"data-selected-option":o===D.value?!0:void 0,className:j("cursor-pointer rounded-none",o===D.value&&"bg-accent"),children:[i.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[z(D),T(D.value)]}),y&&o===D.value&&i.jsx(q,{name:"Check",size:"sm",className:"ml-auto"})]},D.value))]}),E]})})]}),n&&i.jsx("p",{className:"text-sm font-medium leading-none text-destructive mt-2",children:n})]})});iw.displayName="SearchSelect";const lw=S.forwardRef(({value:e,variant:t="info",startIcon:n,emptyState:r="-",className:o},s)=>e?i.jsx(Ze,{ref:s,variant:t,startIcon:n,className:o,children:e}):i.jsx(i.Fragment,{children:r}));lw.displayName="DataTableBadgeCell";const tF=e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0),cw=S.forwardRef(({value:e,children:t,emptyState:n="-"},r)=>tF(e)?i.jsx("span",{ref:r,children:n}):i.jsx(i.Fragment,{children:t}));cw.displayName="DataTableCellWrapper";const uw=S.forwardRef(({value:e,formatFn:t,tooltip:n,emptyState:r="-",className:o},s)=>{if(!e)return i.jsx(i.Fragment,{children:r});const a=t?t(e):e,l=n===!1?null:n??a;return l?i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("div",{ref:s,className:j("truncate text-sm",o),children:a})}),i.jsx(Tt,{children:i.jsx("p",{children:l})})]})}):i.jsx("div",{ref:s,className:j("truncate text-sm",o),children:a})});uw.displayName="DataTableTextCell";const dw=e=>({copyToClipboard:S.useCallback(async n=>{const r=e?.successMessage??"Copied to clipboard",o=e?.errorMessage??"Failed to copy to clipboard";try{await navigator.clipboard.writeText(n),Kn.success(r),e?.onSuccess?.()}catch{try{const s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.appendChild(s);let a;try{s.focus(),s.select(),a=document.execCommand("copy")}finally{document.body.removeChild(s)}if(a)Kn.success(r),e?.onSuccess?.();else throw new Error("Copy command failed")}catch{Kn.error(o),e?.onError?.()}}},[e])}),fw=S.forwardRef(({value:e,linkTo:t,startIcon:n,startIconTooltip:r,copyTooltip:o="Copy",onCopySuccess:s,onCopyError:a,emptyState:l="-",className:c},u)=>{const{copyToClipboard:f}=dw({onSuccess:s,onError:a});if(!e)return i.jsx(i.Fragment,{children:l});const d=p=>{p.stopPropagation(),f(e)};return i.jsxs("div",{ref:u,className:j("flex items-center gap-2 w-full",c),children:[n&&i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("span",{className:"shrink-0 inline-flex",children:i.jsx(q,{name:n,weight:"fill",size:"sm",className:"text-primary-text"})})}),r&&i.jsx(Tt,{children:i.jsx("p",{children:r})})]})}),i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("span",{className:"truncate text-sm",children:t?i.jsx("a",{href:t,className:"text-primary-text hover:underline",onClick:p=>p.stopPropagation(),children:e}):e})}),i.jsx(Tt,{children:i.jsx("p",{children:e})})]})}),i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":o,className:"shrink-0 p-1 hover:bg-muted rounded",onClick:d,children:i.jsx(q,{name:"CopySimple",size:"sm",className:"text-muted-foreground"})})}),i.jsx(Tt,{children:i.jsx("p",{children:o})})]})})]})});fw.displayName="DataTableCopyCell";const nF=e=>{if(!e)return e;const t=e.replace(/[_.]/g," ").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)},pw=S.forwardRef(({status:e,statusMap:t,formatLabel:n=nF,emptyState:r="-",className:o},s)=>{if(!e)return i.jsx(i.Fragment,{children:r});const a=t?.[e]??t?.[e.toUpperCase()];return a?i.jsx("div",{ref:s,className:j(o),children:i.jsx(Ze,{startIcon:a.icon??"Info",variant:a.variant,children:a.label})}):i.jsx("div",{ref:s,className:j(o),children:i.jsx(Ze,{startIcon:"Info",variant:"info",children:n(e)})})});pw.displayName="DataTableStatusCell";const hw=S.forwardRef(({value:e,currency:t="USD",locales:n,size:r="xs",showCurrencyCode:o=!0,emptyState:s="-",className:a},l)=>e==null||Number.isNaN(e)?i.jsx(i.Fragment,{children:s}):i.jsx("div",{ref:l,className:j("flex",a),children:i.jsx(xp,{value:e,currency:t,locales:n,size:r,showCurrencyCode:o})}));hw.displayName="DataTableAmountCell";const rF=e=>{try{const t=typeof e=="string"?new Date(e):e;return new Intl.DateTimeFormat("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(t)}catch{return String(e)}},mw=S.forwardRef(({value:e,formatFn:t,emptyState:n="-",className:r},o)=>{if(!e)return i.jsx(i.Fragment,{children:n});const a=(t??rF)(e);return i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("div",{ref:o,className:j("truncate text-sm",r),children:a})}),i.jsx(Tt,{children:i.jsx("p",{children:a})})]})})});mw.displayName="DataTableDateCell";const oF="https://dashboard-assets.y.uno/flags",sF=e=>{if(typeof e!="string")return null;const t=e.trim().toUpperCase();return/^[A-Z]{2}$/.test(t)?t:null},gw=S.forwardRef(({code:e,showFlag:t=!0,showName:n=!1,getCountryName:r,flagBaseUrl:o=oF,emptyState:s="-",className:a},l)=>{const[c,u]=S.useState(!1);if(!e)return i.jsx(i.Fragment,{children:s});const f=sF(e),d=r?r(e):null,p=n&&d?d:e.toUpperCase(),h=d??e.toUpperCase(),g=t&&f&&!c;return i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsxs("div",{ref:l,className:j("flex items-center gap-2 truncate text-sm",a),children:[g&&i.jsx("img",{src:`${o}/${f.toLowerCase()}.svg`,alt:"","aria-hidden":!0,loading:"lazy",className:"size-4 shrink-0",onError:()=>u(!0)}),t&&f&&c&&i.jsx("span",{className:"shrink-0 rounded-sm bg-muted px-1 text-xs text-muted-foreground",children:f}),i.jsx("span",{className:"truncate",children:p})]})}),i.jsx(Tt,{children:i.jsx("p",{children:h})})]})})});gw.displayName="DataTableCountryCell";const xw=S.forwardRef(({value:e,decimals:t=2,showProgressBar:n=!1,emptyState:r="-",className:o},s)=>{if(e==null)return i.jsx(i.Fragment,{children:r});const a=e*100,l=new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:t}).format(a);return i.jsxs("div",{ref:s,className:j("flex items-center gap-3",o),children:[n&&i.jsx("div",{className:"h-1.5 flex-1 min-w-[50px] rounded-full bg-muted overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${Math.min(a,100)}%`}})}),i.jsxs("span",{className:"text-sm whitespace-nowrap",children:[l,"%"]})]})});xw.displayName="DataTablePercentageCell";const vw=S.forwardRef(({tags:e,maxVisible:t=2,variant:n="outline",emptyState:r="-",className:o},s)=>{if(!e||e.length===0)return i.jsx(i.Fragment,{children:r});const a=e.slice(0,t),l=e.slice(t);return i.jsxs("div",{ref:s,className:j("flex items-center gap-1 flex-wrap",o),children:[a.map(c=>i.jsx(Ze,{variant:n,className:"text-xs",children:c},c)),l.length>0&&i.jsx(At,{delayDuration:0,children:i.jsxs(Bt,{children:[i.jsx(zt,{children:i.jsxs(Ze,{variant:"outline",className:"text-xs cursor-pointer hover:border-primary hover:text-primary-text",children:["+",l.length]})}),i.jsx(Tt,{className:"p-2",children:i.jsx("div",{className:"space-y-1",children:l.map(c=>i.jsx("p",{className:"text-sm",children:c},c))})})]})})]})});vw.displayName="DataTableTagsCell";const yw=S.forwardRef(({items:e,maxVisible:t=1,emptyState:n="-",className:r},o)=>{if(!e||e.length===0)return i.jsx(i.Fragment,{children:n});const s=new Set,a=e.filter(u=>!u.name||s.has(u.name)?!1:(s.add(u.name),!0));if(a.length===0)return i.jsx(i.Fragment,{children:n});const l=a.slice(0,t),c=a.slice(t);return i.jsxs("div",{ref:o,className:j("flex items-center gap-2",r),children:[l.map(u=>i.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[u.src&&i.jsx("img",{src:u.src,alt:u.name,className:"h-4 w-4 shrink-0 object-contain",onError:f=>{f.currentTarget.style.display="none"}}),!u.src&&u.iconName&&i.jsx(q,{name:u.iconName,size:"sm",className:"shrink-0"}),i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("span",{className:"truncate text-sm",children:u.name})}),i.jsx(Tt,{children:i.jsx("p",{children:u.name})})]})})]},u.name)),c.length>0&&i.jsx(At,{delayDuration:0,children:i.jsxs(Bt,{children:[i.jsx(zt,{className:"shrink-0",children:i.jsxs(Ze,{variant:"outline",className:"text-xs cursor-pointer hover:border-primary hover:text-primary-text",children:["+",c.length]})}),i.jsx(Tt,{className:"p-2",children:i.jsx("div",{className:"space-y-2",children:c.map(u=>i.jsxs("div",{className:"flex items-center gap-3",children:[u.src&&i.jsx("img",{src:u.src,alt:u.name,className:"h-4 w-4 object-contain",onError:f=>{f.currentTarget.style.display="none"}}),!u.src&&u.iconName&&i.jsx(q,{name:u.iconName,size:"sm"}),i.jsx("span",{className:"text-sm",children:u.name})]},u.name))})})]})})]})});yw.displayName="DataTableIconTextCell";const bw=S.forwardRef(({items:e,maxVisible:t=4,emptyState:n="-",className:r},o)=>{if(!e||e.length===0)return i.jsx(i.Fragment,{children:n});const s=new Set,a=e.filter(f=>!f.name||s.has(f.name)?!1:(s.add(f.name),!0));if(a.length===0)return i.jsx(i.Fragment,{children:n});const l=a.slice(0,t),c=a.slice(t),u=f=>f.src?i.jsx("img",{src:f.src,alt:f.name,className:"h-5 w-5 shrink-0 object-contain",onError:d=>{d.currentTarget.style.display="none"}}):f.iconName?i.jsx(q,{name:f.iconName,size:"sm",className:"shrink-0"}):null;return i.jsxs("div",{ref:o,className:j("flex items-center gap-1.5",r),children:[l.map(f=>i.jsx(At,{children:i.jsxs(Bt,{children:[i.jsx(zt,{asChild:!0,children:i.jsx("span",{className:"inline-flex shrink-0",children:u(f)})}),i.jsx(Tt,{children:i.jsx("p",{children:f.name})})]})},f.name)),c.length>0&&i.jsx(At,{delayDuration:0,children:i.jsxs(Bt,{children:[i.jsx(zt,{className:"shrink-0",children:i.jsxs(Ze,{variant:"outline",className:"text-xs cursor-pointer hover:border-primary hover:text-primary-text",children:["+",c.length]})}),i.jsx(Tt,{className:"p-2",children:i.jsx("div",{className:"space-y-1",children:c.map(f=>i.jsx("div",{className:"text-sm",children:f.name},f.name))})})]})})]})});bw.displayName="DataTableIconCell";function xr(e,t){return typeof e=="function"?e(t):e}function Zt(e,t){return n=>{t.setState(r=>({...r,[e]:xr(n,r[e])}))}}function pu(e){return e instanceof Function}function aF(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function iF(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const a=t(s);a!=null&&a.length&&r(a)})};return r(e),n}function he(e,t,n){let r=[],o;return s=>{let a;n.key&&n.debug&&(a=Date.now());const l=e(s);if(!(l.length!==r.length||l.some((f,d)=>r[d]!==f)))return o;r=l;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...l),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-a)*100)/100,d=Math.round((Date.now()-u)*100)/100,p=d/16,h=(g,x)=>{for(g=String(g);g.length<x;)g=" "+g;return g};console.info(`%c⏱ ${h(d,5)} /${h(f,5)} ms`,`
|
|
83
83
|
font-size: .6rem;
|
|
84
84
|
font-weight: bold;
|
|
85
85
|
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n?.key)}return o}}function me(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function lF(e,t,n,r){const o=()=>{var a;return(a=s.getValue())!=null?a:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:he(()=>[e,n,t,s],(a,l,c,u)=>({table:a,column:l,row:c,cell:u,getValue:u.getValue,renderValue:u.renderValue}),me(e.options,"debugCells","cell.getContext"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(s,n,t,e)},{}),s}function cF(e,t,n,r){var o,s;const l={...e._getDefaultColumnDef(),...t},c=l.accessorKey;let u=(o=(s=l.id)!=null?s:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?o:typeof l.header=="string"?l.header:void 0,f;if(l.accessorFn?f=l.accessorFn:c&&(c.includes(".")?f=p=>{let h=p;for(const x of c.split(".")){var g;h=(g=h)==null?void 0:g[x],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${x}" in deeply nested key "${c}" returned undefined.`)}return h}:f=p=>p[l.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(u)}`,accessorFn:f,parent:r,depth:n,columnDef:l,columns:[],getFlatColumns:he(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},me(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:he(()=>[e._getOrderColumnsFn()],p=>{var h;if((h=d.columns)!=null&&h.length){let g=d.columns.flatMap(x=>x.getLeafColumns());return p(g)}return[d]},me(e.options,"debugColumns","column.getLeafColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const vt="debugHeaders";function H1(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),a.push(c)};return l(s),a},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(s,e)}),s}const uF={createTable:e=>{e.getHeaderGroups=he(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,a;const l=(s=r?.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?s:[],c=(a=o?.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?a:[],u=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Zi(t,[...l,...u,...c],e)},me(e.options,vt,"getHeaderGroups")),e.getCenterHeaderGroups=he(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Zi(t,n,e,"center")),me(e.options,vt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=he(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?o:[];return Zi(t,s,e,"left")},me(e.options,vt,"getLeftHeaderGroups")),e.getRightHeaderGroups=he(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?o:[];return Zi(t,s,e,"right")},me(e.options,vt,"getRightHeaderGroups")),e.getFooterGroups=he(()=>[e.getHeaderGroups()],t=>[...t].reverse(),me(e.options,vt,"getFooterGroups")),e.getLeftFooterGroups=he(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),me(e.options,vt,"getLeftFooterGroups")),e.getCenterFooterGroups=he(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),me(e.options,vt,"getCenterFooterGroups")),e.getRightFooterGroups=he(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),me(e.options,vt,"getRightFooterGroups")),e.getFlatHeaders=he(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),me(e.options,vt,"getFlatHeaders")),e.getLeftFlatHeaders=he(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),me(e.options,vt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=he(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),me(e.options,vt,"getCenterFlatHeaders")),e.getRightFlatHeaders=he(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),me(e.options,vt,"getRightFlatHeaders")),e.getCenterLeafHeaders=he(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),me(e.options,vt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=he(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),me(e.options,vt,"getLeftLeafHeaders")),e.getRightLeafHeaders=he(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),me(e.options,vt,"getRightLeafHeaders")),e.getLeafHeaders=he(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,a,l,c,u;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[],...(c=(u=r[0])==null?void 0:u.headers)!=null?c:[]].map(f=>f.getLeafHeaders()).flat()},me(e.options,vt,"getLeafHeaders"))}};function Zi(e,t,n,r){var o,s;let a=0;const l=function(p,h){h===void 0&&(h=1),a=Math.max(a,h),p.filter(g=>g.getIsVisible()).forEach(g=>{var x;(x=g.columns)!=null&&x.length&&l(g.columns,h+1)},0)};l(e);let c=[];const u=(p,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},x=[];p.forEach(v=>{const y=[...x].reverse()[0],b=v.column.depth===g.depth;let C,w=!1;if(b&&v.column.parent?C=v.column.parent:(C=v.column,w=!0),y&&y?.column===C)y.subHeaders.push(v);else{const E=H1(n,C,{id:[r,h,C.id,v?.id].filter(Boolean).join("_"),isPlaceholder:w,placeholderId:w?`${x.filter(N=>N.column===C).length}`:void 0,depth:h,index:x.length});E.subHeaders.push(v),x.push(E)}g.headers.push(v),v.headerGroup=g}),c.push(g),h>0&&u(x,h-1)},f=t.map((p,h)=>H1(n,p,{depth:a,index:h}));u(f,a-1),c.reverse();const d=p=>p.filter(g=>g.column.getIsVisible()).map(g=>{let x=0,v=0,y=[0];g.subHeaders&&g.subHeaders.length?(y=[],d(g.subHeaders).forEach(C=>{let{colSpan:w,rowSpan:E}=C;x+=w,y.push(E)})):x=1;const b=Math.min(...y);return v=v+b,g.colSpan=x,g.rowSpan=v,{colSpan:x,rowSpan:v}});return d((o=(s=c[0])==null?void 0:s.headers)!=null?o:[]),c}const hh=(e,t,n,r,o,s,a)=>{let l={id:t,index:r,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return l._valuesCache[c]=u.accessorFn(l.original,r),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=u.columnDef.getUniqueValues(l.original,r),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var u;return(u=l.getValue(c))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>iF(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],u=l;for(;;){const f=u.getParentRow();if(!f)break;c.push(f),u=f}return c.reverse()},getAllCells:he(()=>[e.getAllLeafColumns()],c=>c.map(u=>lF(e,l,u,u.id)),me(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:he(()=>[l.getAllCells()],c=>c.reduce((u,f)=>(u[f.column.id]=f,u),{}),me(e.options,"debugRows","getAllCellsByColumnId"))};for(let c=0;c<e._features.length;c++){const u=e._features[c];u==null||u.createRow==null||u.createRow(l,e)}return l},dF={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},ww=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};ww.autoRemove=e=>bn(e);const Cw=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Cw.autoRemove=e=>bn(e);const Sw=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};Sw.autoRemove=e=>bn(e);const Ew=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Ew.autoRemove=e=>bn(e);const Nw=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Nw.autoRemove=e=>bn(e)||!(e!=null&&e.length);const _w=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});_w.autoRemove=e=>bn(e)||!(e!=null&&e.length);const jw=(e,t,n)=>e.getValue(t)===n;jw.autoRemove=e=>bn(e);const kw=(e,t,n)=>e.getValue(t)==n;kw.autoRemove=e=>bn(e);const mh=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};mh.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(o)?1/0:o;if(s>a){const l=s;s=a,a=l}return[s,a]};mh.autoRemove=e=>bn(e)||bn(e[0])&&bn(e[1]);const Un={includesString:ww,includesStringSensitive:Cw,equalsString:Sw,arrIncludes:Ew,arrIncludesAll:Nw,arrIncludesSome:_w,equals:jw,weakEquals:kw,inNumberRange:mh};function bn(e){return e==null||e===""}const fF={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Zt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?Un.includesString:typeof r=="number"?Un.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Un.equals:Array.isArray(r)?Un.arrIncludes:Un.weakEquals},e.getFilterFn=()=>{var n,r;return pu(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Un[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r?.find(f=>f.id===e.id),a=xr(n,s?s.value:void 0);if(G1(o,a,e)){var l;return(l=r?.filter(f=>f.id!==e.id))!=null?l:[]}const c={id:e.id,value:a};if(s){var u;return(u=r?.map(f=>f.id===e.id?c:f))!=null?u:[]}return r!=null&&r.length?[...r,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=xr(t,o))==null?void 0:s.filter(a=>{const l=n.find(c=>c.id===a.id);if(l){const c=l.getFilterFn();if(G1(c,a.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function G1(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const pF=(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),hF=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},mF=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},gF=(e,t,n)=>{let r,o;return n.forEach(s=>{const a=s.getValue(e);a!=null&&(r===void 0?a>=a&&(r=o=a):(r>a&&(r=a),o<a&&(o=a)))}),[r,o]},xF=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},vF=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!aF(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,a)=>s-a);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},yF=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),bF=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,wF=(e,t)=>t.length,Ju={sum:pF,min:hF,max:mF,extent:gF,mean:xF,median:vF,unique:yF,uniqueCount:bF,count:wF},CF={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Zt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return Ju.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Ju.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return pu(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Ju[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function SF(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(a=>a.id===s)).filter(Boolean),...r]}const EF={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Zt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=he(n=>[Ea(t,n)],n=>n.findIndex(r=>r.id===e.id),me(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Ea(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Ea(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=he(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const a=[...t],l=[...o];for(;l.length&&a.length;){const c=a.shift(),u=l.findIndex(f=>f.id===c);u>-1&&s.push(l.splice(u,1)[0])}s=[...s,...l]}return SF(s,n,r)},me(e.options,"debugTable","_getOrderColumnsFn"))}},Qu=()=>({left:[],right:[]}),NF={getInitialState:e=>({columnPinning:Qu(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Zt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,a;if(n==="right"){var l,c;return{left:((l=o?.left)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((c=o?.right)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var u,f;return{left:[...((u=o?.left)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((f=o?.right)!=null?f:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((s=o?.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:((a=o?.right)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,a;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(l=>r?.includes(l)),a=n.some(l=>o?.includes(l));return s?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=he(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(a=>!s.includes(a.column.id))},me(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=he(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),me(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=he(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),me(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Qu():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Qu())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=he(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),me(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=he(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),me(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=he(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},me(e.options,"debugColumns","getCenterLeafColumns"))}};function _F(e){return e||(typeof document<"u"?document:null)}const Xi={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ed=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),jF={getDefaultColumnDef:()=>Xi,getInitialState:e=>({columnSizing:{},columnSizingInfo:ed(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Zt("columnSizing",e),onColumnSizingInfoChange:Zt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Xi.minSize,(r=s??e.columnDef.size)!=null?r:Xi.size),(o=e.columnDef.maxSize)!=null?o:Xi.maxSize)},e.getStart=he(n=>[n,Ea(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),me(t.options,"debugColumns","getStart")),e.getAfter=he(n=>[n,Ea(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),me(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),td(s)&&s.touches&&s.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],c=td(s)?Math.round(s.touches[0].clientX):s.clientX,u={},f=(y,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(C=>{var w,E;const N=t.options.columnResizeDirection==="rtl"?-1:1,_=(b-((w=C?.startOffset)!=null?w:0))*N,R=Math.max(_/((E=C?.startSize)!=null?E:0),-.999999);return C.columnSizingStart.forEach(I=>{let[F,U]=I;u[F]=Math.round(Math.max(U+U*R,0)*100)/100}),{...C,deltaOffset:_,deltaPercentage:R}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(C=>({...C,...u})))},d=y=>f("move",y),p=y=>{f("end",y),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=_F(n),g={moveHandler:y=>d(y.clientX),upHandler:y=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),p(y.clientX)}},x={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var b;h?.removeEventListener("touchmove",x.moveHandler),h?.removeEventListener("touchend",x.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),p((b=y.touches[0])==null?void 0:b.clientX)}},v=kF()?{passive:!1}:!1;td(s)?(h?.addEventListener("touchmove",x.moveHandler,v),h?.addEventListener("touchend",x.upHandler,v)):(h?.addEventListener("mousemove",g.moveHandler,v),h?.addEventListener("mouseup",g.upHandler,v)),t.setColumnSizingInfo(y=>({...y,startOffset:c,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ed():(n=e.initialState.columnSizingInfo)!=null?n:ed())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Ji=null;function kF(){if(typeof Ji=="boolean")return Ji;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Ji=e,Ji}function td(e){return e.type==="touchstart"}const RF={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Zt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=he(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),me(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=he(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],me(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>he(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),me(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ea(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const MF={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},DF={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Zt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Un.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return pu(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Un[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},AF={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Zt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const a=s.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=r,n=(o=n)!=null?o:!s,!s&&n)return{...a,[e.id]:!0};if(s&&!n){const{[e.id]:l,...c}=a;return c}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},sf=0,af=10,nd=()=>({pageIndex:sf,pageSize:af}),TF={getInitialState:e=>({...e,pagination:{...nd(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Zt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>xr(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?nd():(o=e.initialState.pagination)!=null?o:nd())},e.setPageIndex=r=>{e.setPagination(o=>{let s=xr(r,o.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,a)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?sf:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:sf)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?af:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:af)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,xr(r,o.pageSize)),a=o.pageSize*o.pageIndex,l=Math.floor(a/s);return{...o,pageIndex:l,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let a=xr(r,(s=e.options.pageCount)!=null?s:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),e.getPageOptions=he(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,a)=>a)),o},me(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},rd=()=>({top:[],bottom:[]}),PF={getInitialState:e=>({rowPinning:rd(),...e}),getDefaultOptions:e=>({onRowPinningChange:Zt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(c=>{let{id:u}=c;return u}):[],a=o?e.getParentRows().map(c=>{let{id:u}=c;return u}):[],l=new Set([...a,e.id,...s]);t.setRowPinning(c=>{var u,f;if(n==="bottom"){var d,p;return{top:((d=c?.top)!=null?d:[]).filter(x=>!(l!=null&&l.has(x))),bottom:[...((p=c?.bottom)!=null?p:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)]}}if(n==="top"){var h,g;return{top:[...((h=c?.top)!=null?h:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)],bottom:((g=c?.bottom)!=null?g:[]).filter(x=>!(l!=null&&l.has(x)))}}return{top:((u=c?.top)!=null?u:[]).filter(x=>!(l!=null&&l.has(x))),bottom:((f=c?.bottom)!=null?f:[]).filter(x=>!(l!=null&&l.has(x)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(l=>r?.includes(l)),a=n.some(l=>o?.includes(l));return s?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:l}=a;return l});return(r=s?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?rd():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:rd())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(a=>t.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=he(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),me(e.options,"debugRows","getTopRows")),e.getBottomRows=he(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),me(e.options,"debugRows","getBottomRows")),e.getCenterRows=he(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},me(e.options,"debugRows","getCenterRows"))}},OF={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Zt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{lf(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=he(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?od(e,n):{rows:[],flatRows:[],rowsById:{}},me(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=he(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?od(e,n):{rows:[],flatRows:[],rowsById:{}},me(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=he(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?od(e,n):{rows:[],flatRows:[],rowsById:{}},me(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var a;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const l={...s};return lf(l,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return gh(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return cf(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return cf(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},lf=(e,t,n,r,o)=>{var s;const a=o.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=a.subRows)!=null&&s.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>lf(e,l.id,n,r,o))};function od(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(a,l){return a.map(c=>{var u;const f=gh(c,n);if(f&&(r.push(c),o[c.id]=c),(u=c.subRows)!=null&&u.length&&(c={...c,subRows:s(c.subRows)}),f)return c}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function gh(e,t){var n;return(n=t[e.id])!=null?n:!1}function cf(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(a=>{if(!(s&&!o)&&(a.getCanSelect()&&(gh(a,t)?s=!0:o=!1),a.subRows&&a.subRows.length)){const l=cf(a,t);l==="all"?s=!0:(l==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const uf=/([0-9]+)/gm,LF=(e,t,n)=>Rw(jr(e.getValue(n)).toLowerCase(),jr(t.getValue(n)).toLowerCase()),IF=(e,t,n)=>Rw(jr(e.getValue(n)),jr(t.getValue(n))),FF=(e,t,n)=>xh(jr(e.getValue(n)).toLowerCase(),jr(t.getValue(n)).toLowerCase()),$F=(e,t,n)=>xh(jr(e.getValue(n)),jr(t.getValue(n))),VF=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},BF=(e,t,n)=>xh(e.getValue(n),t.getValue(n));function xh(e,t){return e===t?0:e>t?1:-1}function jr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Rw(e,t){const n=e.split(uf).filter(Boolean),r=t.split(uf).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),a=parseInt(o,10),l=parseInt(s,10),c=[a,l].sort();if(isNaN(c[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(c[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return n.length-r.length}const Qs={alphanumeric:LF,alphanumericCaseSensitive:IF,text:FF,textCaseSensitive:$F,datetime:VF,basic:BF},zF={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Zt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return Qs.datetime;if(typeof s=="string"&&(r=!0,s.split(uf).length>1))return Qs.alphanumeric}return r?Qs.text:Qs.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return pu(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Qs[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(a=>{const l=a?.find(h=>h.id===e.id),c=a?.findIndex(h=>h.id===e.id);let u=[],f,d=s?n:o==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?l?f="toggle":f="add":a!=null&&a.length&&c!==a.length-1?f="replace":l?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var p;u=[...a,{id:e.id,desc:d}],u.splice(0,u.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=a.map(h=>h.id===e.id?{...h,desc:d}:h):f==="remove"?u=a.filter(h=>h.id!==e.id):u=[{id:e.id,desc:d}];return u})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},WF=[uF,RF,EF,NF,dF,fF,MF,DF,zF,CF,AF,TF,PF,OF,jF];function HF(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...WF,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((p,h)=>Object.assign(p,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),a=p=>o.options.mergeOptions?o.options.mergeOptions(s,p):{...s,...p};let c={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(p=>{var h;c=(h=p.getInitialState==null?void 0:p.getInitialState(c))!=null?h:c});const u=[];let f=!1;const d={_features:r,options:{...s,...e},initialState:c,_queue:p=>{u.push(p),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:p=>{const h=xr(p,o.options);o.options=a(h)},getState:()=>o.options.state,setState:p=>{o.options.onStateChange==null||o.options.onStateChange(p)},_getRowId:(p,h,g)=>{var x;return(x=o.options.getRowId==null?void 0:o.options.getRowId(p,h,g))!=null?x:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(p,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[p];if(!g&&(g=o.getCoreRowModel().rowsById[p],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${p}`):new Error;return g},_getDefaultColumnDef:he(()=>[o.options.defaultColumn],p=>{var h;return p=(h=p)!=null?h:{},{header:g=>{const x=g.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:g=>{var x,v;return(x=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?x:null},...o._features.reduce((g,x)=>Object.assign(g,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...p}},me(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:he(()=>[o._getColumnDefs()],p=>{const h=function(g,x,v){return v===void 0&&(v=0),g.map(y=>{const b=cF(o,y,v,x),C=y;return b.columns=C.columns?h(C.columns,b,v+1):[],b})};return h(p)},me(e,"debugColumns","getAllColumns")),getAllFlatColumns:he(()=>[o.getAllColumns()],p=>p.flatMap(h=>h.getFlatColumns()),me(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:he(()=>[o.getAllFlatColumns()],p=>p.reduce((h,g)=>(h[g.id]=g,h),{}),me(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:he(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(p,h)=>{let g=p.flatMap(x=>x.getLeafColumns());return h(g)},me(e,"debugColumns","getAllLeafColumns")),getColumn:p=>{const h=o._getAllFlatColumnsById()[p];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${p}' does not exist.`),h}};Object.assign(o,d);for(let p=0;p<o._features.length;p++){const h=o._features[p];h==null||h.createTable==null||h.createTable(o)}return o}function Mw(){return e=>he(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,a){s===void 0&&(s=0);const l=[];for(let u=0;u<o.length;u++){const f=hh(e,e._getRowId(o[u],u,a),o[u],u,s,void 0,a?.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,l.push(f),e.options.getSubRows){var c;f.originalSubRows=e.options.getSubRows(o[u],u),(c=f.originalSubRows)!=null&&c.length&&(f.subRows=r(f.originalSubRows,s+1,f))}}return l};return n.rows=r(t),n},me(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function GF(e,t,n){return n.options.filterFromLeafRows?UF(e,t,n):YF(e,t,n)}function UF(e,t,n){var r;const o=[],s={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,l=function(c,u){u===void 0&&(u=0);const f=[];for(let p=0;p<c.length;p++){var d;let h=c[p];const g=hh(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(d=h.subRows)!=null&&d.length&&u<a){if(g.subRows=l(h.subRows,u+1),h=g,t(h)&&!g.subRows.length){f.push(h),s[h.id]=h,o.push(h);continue}if(t(h)||g.subRows.length){f.push(h),s[h.id]=h,o.push(h);continue}}else h=g,t(h)&&(f.push(h),s[h.id]=h,o.push(h))}return f};return{rows:l(e),flatRows:o,rowsById:s}}function YF(e,t,n){var r;const o=[],s={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,l=function(c,u){u===void 0&&(u=0);const f=[];for(let p=0;p<c.length;p++){let h=c[p];if(t(h)){var d;if((d=h.subRows)!=null&&d.length&&u<a){const x=hh(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);x.subRows=l(h.subRows,u+1),h=x}f.push(h),o.push(h),s[h.id]=h}}return f};return{rows:l(e),flatRows:o,rowsById:s}}function KF(){return e=>he(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let p=0;p<t.flatRows.length;p++)t.flatRows[p].columnFilters={},t.flatRows[p].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(p=>{var h;const g=e.getColumn(p.id);if(!g)return;const x=g.getFilterFn();if(!x){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${g.id}.`);return}o.push({id:p.id,filterFn:x,resolvedValue:(h=x.resolveFilterValue==null?void 0:x.resolveFilterValue(p.value))!=null?h:p.value})});const a=(n??[]).map(p=>p.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(p=>p.getCanGlobalFilter());r&&l&&c.length&&(a.push("__global__"),c.forEach(p=>{var h;s.push({id:p.id,filterFn:l,resolvedValue:(h=l.resolveFilterValue==null?void 0:l.resolveFilterValue(r))!=null?h:r})}));let u,f;for(let p=0;p<t.flatRows.length;p++){const h=t.flatRows[p];if(h.columnFilters={},o.length)for(let g=0;g<o.length;g++){u=o[g];const x=u.id;h.columnFilters[x]=u.filterFn(h,x,u.resolvedValue,v=>{h.columnFiltersMeta[x]=v})}if(s.length){for(let g=0;g<s.length;g++){f=s[g];const x=f.id;if(f.filterFn(h,x,f.resolvedValue,v=>{h.columnFiltersMeta[x]=v})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const d=p=>{for(let h=0;h<a.length;h++)if(p.columnFilters[a[h]]===!1)return!1;return!0};return GF(t.rows,d,e)},me(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function qF(){return e=>he(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(c=>{var u;return(u=e.getColumn(c.id))==null?void 0:u.getCanSort()}),a={};s.forEach(c=>{const u=e.getColumn(c.id);u&&(a[c.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=c=>{const u=c.map(f=>({...f}));return u.sort((f,d)=>{for(let h=0;h<s.length;h+=1){var p;const g=s[h],x=a[g.id],v=x.sortUndefined,y=(p=g?.desc)!=null?p:!1;let b=0;if(v){const C=f.getValue(g.id),w=d.getValue(g.id),E=C===void 0,N=w===void 0;if(E||N){if(v==="first")return E?-1:1;if(v==="last")return E?1:-1;b=E&&N?0:E?v:-v}}if(b===0&&(b=x.sortingFn(f,d,g.id)),b!==0)return y&&(b*=-1),x.invertSorting&&(b*=-1),b}return f.index-d.index}),u.forEach(f=>{var d;o.push(f),(d=f.subRows)!=null&&d.length&&(f.subRows=l(f.subRows))}),u};return{rows:l(n.rows),flatRows:o,rowsById:n.rowsById}},me(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function za(e,t){return e?ZF(e)?m.createElement(e,t):e:null}function ZF(e){return XF(e)||typeof e=="function"||JF(e)}function XF(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function JF(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Dw(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=m.useState(()=>({current:HF(t)})),[r,o]=m.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:a=>{o(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const Aw=e=>{const t=e.reduce((n,r)=>{const o=Number(r);return n+(isNaN(o)?0:o)},0);return Math.round(t*100)/100},Tw=e=>{const t=e.filter(r=>r!=null&&!isNaN(Number(r)));return t.length===0?0:t.reduce((r,o)=>r+Number(o),0)/t.length},Pw=e=>e.filter(t=>t!=null&&t!=="").length,Ow=e=>{const t=e.map(n=>Number(n)).filter(n=>!isNaN(n));return t.length>0?Math.min(...t):0},Lw=e=>{const t=e.map(n=>Number(n)).filter(n=>!isNaN(n));return t.length>0?Math.max(...t):0},Iw="__AGGREGATION_TOTALS_ROW__",QF={sum:Aw,avg:Tw,size:Pw,min:Ow,max:Lw},e$=e=>"accessorKey"in e&&typeof e.accessorKey=="string"?e.accessorKey:e.id,t$=e=>e.meta?.isActions===!0,n$=({rows:e,columns:t,aggregationLabel:n})=>{const r=e;return t.reduce((o,s,a)=>{const l=e$(s);if(!l)return o;if(a===0&&!s.aggregationFn)return o[l]=n,o;if(!s.aggregationFn)return o;const c=r.map(f=>f[l]);let u;if(typeof s.aggregationFn=="function")u=s.aggregationFn({values:c,field:l});else{const f=QF[s.aggregationFn];u=f?f(c):0}return o[l]=s.aggregationCell?s.aggregationCell(u):u,o},{id:Iw})};function r$({rows:e,columns:t,aggregationLabel:n="Total",onRowClick:r,className:o,...s},a){const l=S.useMemo(()=>t.some(d=>d.aggregationFn),[t]),c=S.useMemo(()=>l?n$({rows:e,columns:t,aggregationLabel:n}):null,[e,t,n,l]),u=Dw({data:e,columns:t,getCoreRowModel:Mw()}),f=S.useCallback((d,p)=>{p.target.closest('[data-column="actions"]')||r?.(d)},[r]);return i.jsx("div",{ref:a,className:j("h-full rounded-lg border border-border overflow-auto",o),...s,children:i.jsxs("table",{className:"w-full h-full border-collapse",children:[i.jsx(hs,{className:"sticky top-0 z-10",children:u.getHeaderGroups().map(d=>i.jsx(yn,{className:"border-b border-border bg-muted hover:bg-muted",children:d.headers.map((p,h)=>{const g=p.column.columnDef.meta,x=g?.isActions;return i.jsx(As,{className:j("h-12 px-4 text-sm font-medium text-muted-foreground bg-muted",h===0&&"ps-6",g?.headerAlign==="right"&&"text-right",x&&"sticky end-0 px-0"),style:{minWidth:p.column.columnDef.minSize,width:p.column.columnDef.size},children:p.isPlaceholder?null:za(p.column.columnDef.header,p.getContext())},p.id)})},d.id))}),i.jsxs(xi,{children:[u.getRowModel().rows.map(d=>i.jsx(yn,{className:j("h-12 border-b border-border bg-card text-foreground","hover:bg-muted",r&&"cursor-pointer"),onClick:r?p=>f(d.original,p):void 0,children:d.getVisibleCells().map((p,h)=>{const g=p.column.columnDef.meta,x=g?.isActions;return i.jsx(io,{className:j("px-4 text-sm",h===0&&"ps-6",g?.headerAlign==="right"&&"text-right",x&&"sticky end-0 bg-card px-0"),...x?{"data-column":"actions"}:{},children:za(p.column.columnDef.cell,p.getContext())},p.id)})},d.id)),i.jsx("tr",{"aria-hidden":"true"})]}),c&&i.jsx(Bp,{className:"sticky bottom-0 z-10 bg-muted",children:i.jsx(yn,{className:"h-12 bg-muted text-foreground hover:bg-muted",children:t.map((d,p)=>{const h=t$(d),g=("accessorKey"in d&&typeof d.accessorKey=="string"?d.accessorKey:d.id)||String(p),x=h?null:c[g],v=d.meta;return i.jsx(io,{className:j("px-4 text-sm font-bold bg-muted",p===0&&"ps-6",v?.headerAlign==="right"&&"text-right",h&&"sticky end-0 px-0"),children:x??""},g)})})})]})})}const Fw=S.forwardRef(r$);Fw.displayName="AggregatedTable";const $w=S.forwardRef(({open:e,label:t,clearLabel:n,onClear:r,children:o,className:s,...a},l)=>i.jsxs("div",{ref:l,role:"region","aria-label":a["aria-label"]??(typeof t=="string"?t:void 0),className:j("bg-popover border-border fixed bottom-6 left-1/2 z-50 flex max-w-[540px] -translate-x-1/2 items-center gap-6 rounded-md border px-6 py-4 shadow-lg transition-all duration-300",e?"translate-y-0 opacity-100":"pointer-events-none translate-y-4 opacity-0",s),...a,children:[i.jsx("span",{className:"text-popover-foreground text-sm whitespace-nowrap",children:t}),i.jsx("div",{className:"h-5",children:i.jsx(Ia,{orientation:"vertical",className:"h-full"})}),i.jsx("div",{className:"flex items-center gap-4",children:o}),i.jsx("div",{className:"h-5",children:i.jsx(Ia,{orientation:"vertical",className:"h-full"})}),i.jsx(ot,{variant:"ghost",size:"icon",onClick:r,"aria-label":n,children:i.jsx(q,{name:"XCircle",size:"md",weight:"fill",className:"text-foreground"})})]}));$w.displayName="BulkActionBar";var o$=Symbol.for("preact-signals");function hu(){if(Jn>1)Jn--;else{var e,t=!1;for((function(){var o=Xl;for(Xl=void 0;o!==void 0;)o.S.v===o.v&&(o.S.i=o.i),o=o.o})();Na!==void 0;){var n=Na;for(Na=void 0,Zl++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Bw(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Zl=0,Jn--,t)throw e}}function Qe(e){if(Jn>0)return e();df=++s$,Jn++;try{return e()}finally{hu()}}var Oe=void 0;function Le(e){var t=Oe;Oe=void 0;try{return e()}finally{Oe=t}}var Na=void 0,Jn=0,Zl=0,s$=0,df=0,Xl=void 0,Jl=0;function Vw(e){if(Oe!==void 0){var t=e.n;if(t===void 0||t.t!==Oe)return t={i:0,S:e,p:Oe.s,n:void 0,t:Oe,e:void 0,x:void 0,r:t},Oe.s!==void 0&&(Oe.s.n=t),Oe.s=t,e.n=t,32&Oe.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Oe.s,t.n=void 0,Oe.s.n=t,Oe.s=t),t}}function Ot(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Ot.prototype.brand=o$;Ot.prototype.h=function(){return!0};Ot.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Le(function(){var r;(r=t.W)==null||r.call(t)}))};Ot.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Le(function(){var o;(o=t.Z)==null||o.call(t)}))}};Ot.prototype.subscribe=function(e){var t=this;return Wt(function(){var n=t.value,r=Oe;Oe=void 0;try{e(n)}finally{Oe=r}},{name:"sub"})};Ot.prototype.valueOf=function(){return this.value};Ot.prototype.toString=function(){return this.value+""};Ot.prototype.toJSON=function(){return this.value};Ot.prototype.peek=function(){var e=Oe;Oe=void 0;try{return this.value}finally{Oe=e}};Object.defineProperty(Ot.prototype,"value",{get:function(){var e=Vw(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Zl>100)throw new Error("Cycle detected");(function(n){Jn!==0&&Zl===0&&n.l!==df&&(n.l=df,Xl={S:n,v:n.v,i:n.i,o:Xl})})(this),this.v=e,this.i++,Jl++,Jn++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{hu()}}}});function wi(e,t){return new Ot(e,t)}function Bw(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function zw(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ww(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function So(e,t){Ot.call(this,void 0),this.x=e,this.s=void 0,this.g=Jl-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}So.prototype=new Ot;So.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Jl))return!0;if(this.g=Jl,this.f|=1,this.i>0&&!Bw(this))return this.f&=-2,!0;var e=Oe;try{zw(this),Oe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Oe=e,Ww(this),this.f&=-2,!0};So.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Ot.prototype.S.call(this,e)};So.prototype.U=function(e){if(this.t!==void 0&&(Ot.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};So.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(So.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Vw(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function U1(e,t){return new So(e,t)}function Hw(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Jn++;var n=Oe;Oe=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,vh(e),r}finally{Oe=n,hu()}}}function vh(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Hw(e)}function a$(e){if(Oe!==this)throw new Error("Out-of-order effect");Ww(this),Oe=e,this.f&=-2,8&this.f&&vh(this),hu()}function Os(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}Os.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};Os.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Hw(this),zw(this),Jn++;var e=Oe;return Oe=this,a$.bind(this,e)};Os.prototype.N=function(){2&this.f||(this.f|=2,this.u=Na,Na=this)};Os.prototype.d=function(){this.f|=8,1&this.f||vh(this)};Os.prototype.dispose=function(){this.d()};function Wt(e,t){var n=new Os(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var i$=Object.create,yh=Object.defineProperty,l$=Object.defineProperties,c$=Object.getOwnPropertyDescriptor,u$=Object.getOwnPropertyDescriptors,Y1=Object.getOwnPropertySymbols,d$=Object.prototype.hasOwnProperty,f$=Object.prototype.propertyIsEnumerable,p$=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ls=e=>{throw TypeError(e)},ff=(e,t,n)=>t in e?yh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h$=(e,t)=>{for(var n in t||(t={}))d$.call(t,n)&&ff(e,n,t[n]);if(Y1)for(var n of Y1(t))f$.call(t,n)&&ff(e,n,t[n]);return e},m$=(e,t)=>l$(e,u$(t)),K1=(e,t)=>yh(e,"name",{value:t,configurable:!0}),g$=e=>{var t;return[,,,i$((t=void 0)!=null?t:null)]},Gw=["class","method","getter","setter","accessor","field","value","get","set"],ia=e=>e!==void 0&&typeof e!="function"?Ls("Function expected"):e,x$=(e,t,n,r,o)=>({kind:Gw[e],name:t,metadata:r,addInitializer:s=>n._?Ls("Already initialized"):o.push(ia(s||null))}),Uw=(e,t)=>ff(t,p$("metadata"),e[3]),Wr=(e,t,n,r)=>{for(var o=0,s=e[t>>1],a=s&&s.length;o<a;o++)t&1?s[o].call(n):r=s[o].call(n,r);return r},Is=(e,t,n,r,o,s)=>{var a,l,c,u,f,d=t&7,p=!!(t&8),h=!!(t&16),g=d>3?e.length+1:d?p?1:2:0,x=Gw[d+5],v=d>3&&(e[g-1]=[]),y=e[g]||(e[g]=[]),b=d&&(!h&&!p&&(o=o.prototype),d<5&&(d>3||!h)&&c$(d<4?o:{get[n](){return rn(this,s)},set[n](w){return gr(this,s,w)}},n));d?h&&d<4&&K1(s,(d>2?"set ":d>1?"get ":"")+n):K1(o,n);for(var C=r.length-1;C>=0;C--)u=x$(d,n,c={},e[3],y),d&&(u.static=p,u.private=h,f=u.access={has:h?w=>v$(o,w):w=>n in w},d^3&&(f.get=h?w=>(d^1?rn:y$)(w,o,d^4?s:b.get):w=>w[n]),d>2&&(f.set=h?(w,E)=>gr(w,o,E,d^4?s:b.set):(w,E)=>w[n]=E)),l=(0,r[C])(d?d<4?h?s:b[x]:d>4?void 0:{get:b.get,set:b.set}:o,u),c._=1,d^4||l===void 0?ia(l)&&(d>4?v.unshift(l):d?h?s=l:b[x]=l:o=l):typeof l!="object"||l===null?Ls("Object expected"):(ia(a=l.get)&&(b.get=a),ia(a=l.set)&&(b.set=a),ia(a=l.init)&&v.unshift(a));return d||Uw(e,o),b&&yh(o,n,b),h?d^4?s:b:o},bh=(e,t,n)=>t.has(e)||Ls("Cannot "+n),v$=(e,t)=>Object(t)!==t?Ls('Cannot use the "in" operator on this value'):e.has(t),rn=(e,t,n)=>(bh(e,t,"read from private field"),n?n.call(e):t.get(e)),la=(e,t,n)=>t.has(e)?Ls("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),gr=(e,t,n,r)=>(bh(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),y$=(e,t,n)=>(bh(e,t,"access private method"),n);function Wa(e,t){if(t){let n;return U1(()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return U1(e)}function Cr(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e=="function"&&typeof t=="function")return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((r,o)=>!Cr(r,t[o]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:!n.some(s=>!Cr(e[s],t[s]))}return!1}function Re({get:e},t){return{init(n){return wi(n)},get(){return e.call(this).value},set(n){const r=e.call(this);r.peek()!==n&&(r.value=n)}}}function et(e,t){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=Wa(e.bind(this)),n.set(this,r)),r.value}}function sd(e=!0){return function(t,n){n.addInitializer(function(){const r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),o=Object.getOwnPropertyDescriptor(r,n.name);o&&Object.defineProperty(r,n.name,m$(h$({},o),{enumerable:e}))})}}function Ci(...e){const t=e.map(n=>Wt(n));return()=>t.forEach(n=>n())}var Yw,Kw,qw,Zw,Xw,Jw,Rt,wh,ad,pf,hf,yt,Ch,id,Qw,mf,Sh,ld,gf,xf;Jw=[Re],Xw=[Re],Zw=[Re],qw=[sd()],Kw=[sd()],Yw=[sd()];var Eo=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Wr(Rt,5,this),la(this,yt),la(this,wh,Wr(Rt,8,this)),Wr(Rt,11,this),la(this,Ch,Wr(Rt,12,this)),Wr(Rt,15,this),la(this,Sh,Wr(Rt,16,this)),Wr(Rt,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return rn(this,yt,gf)}get initial(){return rn(this,yt,pf)}get previous(){return rn(this,yt,Qw)}set current(e){const t=Le(()=>rn(this,yt,gf));e&&t&&this.equals(t,e)||Qe(()=>{rn(this,yt,pf)||gr(this,yt,e,hf),gr(this,yt,t,mf),gr(this,yt,e,xf)})}reset(e=this.defaultValue){Qe(()=>{gr(this,yt,void 0,mf),gr(this,yt,e,hf),gr(this,yt,e,xf)})}};Rt=g$();wh=new WeakMap;yt=new WeakSet;Ch=new WeakMap;Sh=new WeakMap;ad=Is(Rt,20,"#initial",Jw,yt,wh),pf=ad.get,hf=ad.set;id=Is(Rt,20,"#previous",Xw,yt,Ch),Qw=id.get,mf=id.set;ld=Is(Rt,20,"#current",Zw,yt,Sh),gf=ld.get,xf=ld.set;Is(Rt,2,"current",qw,Eo);Is(Rt,2,"initial",Kw,Eo);Is(Rt,2,"previous",Yw,Eo);Uw(Rt,Eo);function cd(e){return Le(()=>{const t={};for(const n in e)t[n]=e[n];return t})}var Yr,b$=class{constructor(){la(this,Yr,new WeakMap)}get(e,t){var n;return e?(n=rn(this,Yr).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return rn(this,Yr).has(e)||rn(this,Yr).set(e,new Map),(r=rn(this,Yr).get(e))==null?void 0:r.set(t,n)}clear(e){var t;return e?(t=rn(this,Yr).get(e))==null?void 0:t.clear():void 0}};Yr=new WeakMap;var w$=Object.create,e4=Object.defineProperty,C$=Object.getOwnPropertyDescriptor,q1=Object.getOwnPropertySymbols,S$=Object.prototype.hasOwnProperty,E$=Object.prototype.propertyIsEnumerable,t4=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),mu=e=>{throw TypeError(e)},Z1=Math.pow,vf=(e,t,n)=>t in e?e4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N$=(e,t)=>{for(var n in t||(t={}))S$.call(t,n)&&vf(e,n,t[n]);if(q1)for(var n of q1(t))E$.call(t,n)&&vf(e,n,t[n]);return e},_$=e=>{var t;return[,,,w$((t=e?.[t4("metadata")])!=null?t:null)]},n4=["class","method","getter","setter","accessor","field","value","get","set"],r4=e=>e!==void 0&&typeof e!="function"?mu("Function expected"):e,j$=(e,t,n,r,o)=>({kind:n4[e],name:t,metadata:r,addInitializer:s=>n._?mu("Already initialized"):o.push(r4(s||null))}),k$=(e,t)=>vf(t,t4("metadata"),e[3]),R$=(e,t,n,r)=>{for(var o=0,s=e[t>>1],a=s&&s.length;o<a;o++)s[o].call(n);return r},o4=(e,t,n,r,o,s)=>{for(var a,l,c,u,f=t&7,d=!1,p=!1,h=2,g=n4[f+5],x=e[h]||(e[h]=[]),v=(o=o.prototype,C$(o,n)),y=r.length-1;y>=0;y--)c=j$(f,n,l={},e[3],x),c.static=d,c.private=p,u=c.access={has:b=>n in b},u.get=b=>b[n],a=(0,r[y])(v[g],c),l._=1,r4(a)&&(v[g]=a);return v&&e4(o,n,v),o},s4=(e,t,n)=>t.has(e)||mu("Cannot "+n),M$=(e,t,n)=>(s4(e,t,"read from private field"),t.get(e)),D$=(e,t,n)=>t.has(e)?mu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),A$=(e,t,n,r)=>(s4(e,t,"write to private field"),t.set(e,n),n),on=class yf{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new yf(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new yf(t,n)}},rr=class Kr{constructor(t,n,r,o){this.left=t,this.top=n,this.width=r,this.height=o,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:o,width:s,height:a,scale:l}=this,c=new Kr(o+t,r+n,s,a);return c.scale=N$({},l),c}get boundingRectangle(){const{width:t,height:n,left:r,top:o,right:s,bottom:a}=this;return{width:t,height:n,left:r,top:o,right:s,bottom:a}}get center(){const{left:t,top:n,right:r,bottom:o}=this;return new on((t+r)/2,(n+o)/2)}get area(){const{width:t,height:n}=this;return t*n}equals(t){if(!(t instanceof Kr))return!1;const{left:n,top:r,width:o,height:s}=this;return n===t.left&&r===t.top&&o===t.width&&s===t.height}containsPoint(t){const{top:n,left:r,bottom:o,right:s}=this;return n<=t.y&&t.y<=o&&r<=t.x&&t.x<=s}intersectionArea(t){return t instanceof Kr?T$(this,t):0}intersectionRatio(t){const{area:n}=this,r=this.intersectionArea(t);return r/(t.area+n-r)}get bottom(){const{top:t,height:n}=this;return t+n}get right(){const{left:t,width:n}=this;return t+n}get aspectRatio(){const{width:t,height:n}=this;return t/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:o}){return new Kr(n,t,r,o)}static delta(t,n,r={x:"center",y:"center"}){const o=(s,a)=>{const l=r[a],c=a==="x"?s.left:s.top,u=a==="x"?s.width:s.height;return l=="start"?c:l=="end"?c+u:c+u/2};return on.delta({x:o(t,"x"),y:o(t,"y")},{x:o(n,"x"),y:o(n,"y")})}static intersectionRatio(t,n){return Kr.from(t).intersectionRatio(Kr.from(n))}};function T$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=s-n;return r<o&&n<s?a*l:0}var a4,i4,bf,gl,Si,gu=class extends(bf=Eo,i4=[et],a4=[et],bf){constructor(t){const n=on.from(t);super(n,(r,o)=>on.equals(r,o)),R$(Si,5,this),D$(this,gl,0),this.velocity={x:0,y:0}}get delta(){return on.delta(this.current,this.initial)}get direction(){const{current:t,previous:n}=this;if(!n)return null;const r={x:t.x-n.x,y:t.y-n.y};return!r.x&&!r.y?null:Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up"}get current(){return super.current}set current(t){const{current:n}=this,r=on.from(t),o={x:r.x-n.x,y:r.y-n.y},s=Date.now(),a=s-M$(this,gl),l=c=>Math.round(c/a*100);Qe(()=>{A$(this,gl,s),this.velocity={x:l(o.x),y:l(o.y)},super.current=r})}reset(t=this.defaultValue){super.reset(on.from(t)),this.velocity={x:0,y:0}}};Si=_$(bf);gl=new WeakMap;o4(Si,2,"delta",i4,gu);o4(Si,2,"direction",a4,gu);k$(Si,gu);function wf({x:e,y:t},n){const r=Math.abs(e),o=Math.abs(t);return typeof n=="number"?Math.sqrt(Z1(r,2)+Z1(o,2))>n:"x"in n&&"y"in n?r>n.x&&o>n.y:"x"in n?r>n.x:"y"in n?o>n.y:!1}var l4=(e=>(e.Horizontal="x",e.Vertical="y",e))(l4||{}),c4=Object.values(l4),P$=Object.create,Eh=Object.defineProperty,O$=Object.defineProperties,L$=Object.getOwnPropertyDescriptor,I$=Object.getOwnPropertyDescriptors,Ql=Object.getOwnPropertySymbols,u4=Object.prototype.hasOwnProperty,d4=Object.prototype.propertyIsEnumerable,f4=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Fs=e=>{throw TypeError(e)},Cf=(e,t,n)=>t in e?Eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p4=(e,t)=>{for(var n in t||(t={}))u4.call(t,n)&&Cf(e,n,t[n]);if(Ql)for(var n of Ql(t))d4.call(t,n)&&Cf(e,n,t[n]);return e},h4=(e,t)=>O$(e,I$(t)),X1=(e,t)=>Eh(e,"name",{value:t,configurable:!0}),m4=(e,t)=>{var n={};for(var r in e)u4.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ql)for(var r of Ql(e))t.indexOf(r)<0&&d4.call(e,r)&&(n[r]=e[r]);return n},$s=e=>{var t;return[,,,P$((t=e?.[f4("metadata")])!=null?t:null)]},g4=["class","method","getter","setter","accessor","field","value","get","set"],ca=e=>e!==void 0&&typeof e!="function"?Fs("Function expected"):e,F$=(e,t,n,r,o)=>({kind:g4[e],name:t,metadata:r,addInitializer:s=>n._?Fs("Already initialized"):o.push(ca(s||null))}),No=(e,t)=>Cf(t,f4("metadata"),e[3]),we=(e,t,n,r)=>{for(var o=0,s=e[t>>1],a=s&&s.length;o<a;o++)t&1?s[o].call(n):r=s[o].call(n,r);return r},De=(e,t,n,r,o,s)=>{var a,l,c,u,f,d=t&7,p=!!(t&8),h=!!(t&16),g=d>3?e.length+1:d?p?1:2:0,x=g4[d+5],v=d>3&&(e[g-1]=[]),y=e[g]||(e[g]=[]),b=d&&(!h&&!p&&(o=o.prototype),d<5&&(d>3||!h)&&L$(d<4?o:{get[n](){return pt(this,s)},set[n](w){return sn(this,s,w)}},n));d?h&&d<4&&X1(s,(d>2?"set ":d>1?"get ":"")+n):X1(o,n);for(var C=r.length-1;C>=0;C--)u=F$(d,n,c={},e[3],y),d&&(u.static=p,u.private=h,f=u.access={has:h?w=>$$(o,w):w=>n in w},d^3&&(f.get=h?w=>(d^1?pt:V$)(w,o,d^4?s:b.get):w=>w[n]),d>2&&(f.set=h?(w,E)=>sn(w,o,E,d^4?s:b.set):(w,E)=>w[n]=E)),l=(0,r[C])(d?d<4?h?s:b[x]:d>4?void 0:{get:b.get,set:b.set}:o,u),c._=1,d^4||l===void 0?ca(l)&&(d>4?v.unshift(l):d?h?s=l:b[x]=l:o=l):typeof l!="object"||l===null?Fs("Object expected"):(ca(a=l.get)&&(b.get=a),ca(a=l.set)&&(b.set=a),ca(a=l.init)&&v.unshift(a));return d||No(e,o),b&&Eh(o,n,b),h?d^4?s:b:o},Nh=(e,t,n)=>t.has(e)||Fs("Cannot "+n),$$=(e,t)=>Object(t)!==t?Fs('Cannot use the "in" operator on this value'):e.has(t),pt=(e,t,n)=>(Nh(e,t,"read from private field"),n?n.call(e):t.get(e)),Fe=(e,t,n)=>t.has(e)?Fs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),sn=(e,t,n,r)=>(Nh(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),V$=(e,t,n)=>(Nh(e,t,"access private method"),n);function x4(e,t){return{plugin:e,options:t}}function _h(e){return t=>x4(e,t)}function jh(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var v4,Ha,kh,xl;v4=[Re];var Et=class{constructor(e,t){this.manager=e,this.options=t,Fe(this,kh,we(Ha,8,this,!1)),we(Ha,11,this),Fe(this,xl,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return Le(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){const t=Wt(e.bind(this));return pt(this,xl).add(t),t}destroy(){pt(this,xl).forEach(e=>e())}static configure(e){return x4(this,e)}};Ha=$s(null);kh=new WeakMap;xl=new WeakMap;De(Ha,4,"disabled",v4,Et,kh);No(Ha,Et);var Ei=class extends Et{},vl,ud=class{constructor(e){this.manager=e,this.instances=new Map,Fe(this,vl,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(jh).reduceRight((r,o)=>r.some(({plugin:s})=>s===o.plugin)?r:[o,...r],[]),n=t.map(({plugin:r})=>r);for(const r of pt(this,vl))if(!n.includes(r)){if(r.prototype instanceof Ei)continue;this.unregister(r)}for(const{plugin:r,options:o}of t)this.register(r,o);sn(this,vl,n)}get(e){return this.instances.get(e)}register(e,t){const n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;const r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){const t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(const e of this.instances.values())e.destroy();this.instances.clear()}};vl=new WeakMap;function B$(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Qi=[],qo,Zo,z$=class extends Et{constructor(e){super(e),Fe(this,qo),Fe(this,Zo),this.computeCollisions=this.computeCollisions.bind(this),sn(this,Zo,wi(Qi)),this.destroy=Ci(()=>{const t=this.computeCollisions(),n=Le(()=>this.manager.dragOperation.position.current);if(t!==Qi){const r=pt(this,qo);if(sn(this,qo,n),r&&n.x==r.x&&n.y==r.y)return}else sn(this,qo,void 0);pt(this,Zo).value=t},()=>{const{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){Le(()=>{e?pt(this,Zo).value=this.computeCollisions():sn(this,qo,void 0)})}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:o,shape:s,status:a}=r;if(!a.initialized||!s)return Qi;const l=[],c=[];for(const u of e??n.droppables){if(u.disabled||o&&!u.accepts(o))continue;const f=t??u.collisionDetector;if(!f)continue;c.push(u),u.shape;const d=Le(()=>f({droppable:u,dragOperation:r}));d&&(u.collisionPriority!=null&&(d.priority=u.collisionPriority),l.push(d))}return c.length===0?Qi:(l.sort(B$),l)}get collisions(){return pt(this,Zo).value}};qo=new WeakMap;Zo=new WeakMap;var W$=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){const{registry:n}=this,r=n.get(e);if(r)for(const o of r)o(...t)}},H$=class extends W${constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function yl(e,t=!0){let n=!1;return h4(p4({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var G$=class extends Ei{constructor(e){super(e);const t=(r,o)=>r.map(({id:s})=>s).join("")===o.map(({id:s})=>s).join("");let n=[];this.destroy=Ci(()=>{const{dragOperation:r,collisionObserver:o}=e;r.status.initializing&&(n=[],o.enable())},()=>{const{collisionObserver:r,monitor:o}=e,{collisions:s}=r;if(r.isDisabled())return;const a=yl({collisions:s});if(o.dispatch("collision",a),a.defaultPrevented||t(s,n))return;n=s;const[l]=s;Le(()=>{var c;l?.id!==((c=e.dragOperation.target)==null?void 0:c.id)&&(r.disable(),e.actions.setDropTarget(l?.id).then(()=>{r.enable()}))})})}},Vs=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(Vs||{}),Bs=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Bs||{}),y4,b4,w4,C4,S4,E4,N4,cn,Rh;N4=[Re],E4=[et],S4=[et],C4=[et],w4=[et],b4=[et],y4=[et];var ir=class{constructor(){we(cn,5,this),Fe(this,Rh,we(cn,8,this,"idle")),we(cn,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){const{value:e}=this;return e!=="idle"&&e!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(e){this.value=e}};cn=$s(null);Rh=new WeakMap;De(cn,4,"value",N4,ir,Rh);De(cn,2,"current",E4,ir);De(cn,2,"idle",S4,ir);De(cn,2,"initializing",C4,ir);De(cn,2,"initialized",w4,ir);De(cn,2,"dragging",b4,ir);De(cn,2,"dropped",y4,ir);No(cn,ir);var U$=class{constructor(e){this.manager=e}setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e=="string"||typeof e=="number"?e:e.id}setDropTarget(e){return Le(()=>{const{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=yl({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return Le(()=>{const{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");const r=new AbortController,{event:o,coordinates:s}=e;Qe(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=o??null,t.position.reset(s)});const a=yl({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",a),a.defaultPrevented?(t.reset(),r.abort(),r):(t.status.set("initializing"),t.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:l}=t;l.current==="initializing"&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:o,operation:t.snapshot(),cancelable:!1}))}),r)})}move(e){return Le(()=>{var t,n;const{dragOperation:r}=this.manager,{status:o,controller:s}=r;if(!o.dragging||!s||s.signal.aborted)return;const a=yl({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},(t=e.cancelable)!=null?t:!0);((n=e.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask(()=>{var l,c,u,f,d;if(a.defaultPrevented)return;const p=(d=e.to)!=null?d:{x:r.position.current.x+((c=(l=e.by)==null?void 0:l.x)!=null?c:0),y:r.position.current.y+((f=(u=e.by)==null?void 0:u.y)!=null?f:0)};r.position.current=p})})}stop(e={}){return Le(()=>{var t,n;const{dragOperation:r}=this.manager,{controller:o}=r;if(!o||o.signal.aborted)return;let s;const a=()=>{const c={resume:()=>{},abort:()=>{}};return s=new Promise((u,f)=>{c.resume=u,c.abort=f}),c};o.abort();const l=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const c=Le(()=>{var f;return((f=r.source)==null?void 0:f.status)==="dropping"}),u=()=>{r.controller===o&&(r.controller=void 0),r.reset()};if(c){const{source:f}=r,d=Wt(()=>{f?.status==="idle"&&(d(),u())})}else this.manager.renderer.rendering.then(u)})};r.canceled=(t=e.canceled)!=null?t:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:(n=e.canceled)!=null?n:!1,suspend:a}),s?s.then(l).catch(()=>r.reset()):l()})}},_4,j4,k4,R4,Vt,Mh,Dh,Ah,Th;R4=[Re],k4=[Re],j4=[Re],_4=[Re];var Ir=class{constructor(e,t){Fe(this,Mh,we(Vt,8,this)),we(Vt,11,this),Fe(this,Dh,we(Vt,12,this)),we(Vt,15,this),Fe(this,Ah,we(Vt,16,this)),we(Vt,19,this),Fe(this,Th,we(Vt,20,this)),we(Vt,23,this);const{effects:n,id:r,data:o={},disabled:s=!1,register:a=!0}=e;let l=r;this.manager=t,this.id=r,this.data=o,this.disabled=s,this.effects=()=>{var c;return[()=>{const{id:u,manager:f}=this;if(u!==l)return f?.registry.register(this),()=>f?.registry.unregister(this)},...(c=n?.())!=null?c:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&a&&queueMicrotask(this.register)}register(){var e;return(e=this.manager)==null?void 0:e.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};Vt=$s(null);Mh=new WeakMap;Dh=new WeakMap;Ah=new WeakMap;Th=new WeakMap;De(Vt,4,"manager",R4,Ir,Mh);De(Vt,4,"id",k4,Ir,Dh);De(Vt,4,"data",j4,Ir,Ah);De(Vt,4,"disabled",_4,Ir,Th);No(Vt,Ir);var J1=class{constructor(){this.map=wi(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const n=this.map.peek(),r=n.get(e),o=()=>this.unregister(e,t);if(r===t)return o;if(r){const l=this.cleanupFunctions.get(r);l?.(),this.cleanupFunctions.delete(r)}const s=new Map(n);s.set(e,t),this.map.value=s;const a=Ci(...t.effects());return this.cleanupFunctions.set(t,a),o},this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t)return;const r=this.cleanupFunctions.get(t);r?.(),this.cleanupFunctions.delete(t);const o=new Map(n);o.delete(e),this.map.value=o}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);t?.(),e.destroy()}this.map.value=new Map}},M4,D4,A4,T4,P4,O4,Sf,Mt,Ph,Oh,Lh,Fn=class extends(Sf=Ir,O4=[Re],P4=[Re],T4=[Re],A4=[et],D4=[et],M4=[et],Sf){constructor(t,n){var r=t,{modifiers:o,type:s,sensors:a}=r,l=m4(r,["modifiers","type","sensors"]);super(l,n),we(Mt,5,this),Fe(this,Ph,we(Mt,8,this)),we(Mt,11,this),Fe(this,Oh,we(Mt,12,this)),we(Mt,15,this),Fe(this,Lh,we(Mt,16,this,this.isDragSource?"dragging":"idle")),we(Mt,19,this),this.type=s,this.sensors=a,this.modifiers=o,this.alignment=l.alignment}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.source)==null?void 0:n.id)===this.id}};Mt=$s(Sf);Ph=new WeakMap;Oh=new WeakMap;Lh=new WeakMap;De(Mt,4,"type",O4,Fn,Ph);De(Mt,4,"modifiers",P4,Fn,Oh);De(Mt,4,"status",T4,Fn,Lh);De(Mt,2,"isDropping",A4,Fn);De(Mt,2,"isDragging",D4,Fn);De(Mt,2,"isDragSource",M4,Fn);No(Mt,Fn);var L4,I4,F4,$4,V4,B4,Ef,ct,Ih,Fh,$h,Vh,Bh,$n=class extends(Ef=Ir,B4=[Re],V4=[Re],$4=[Re],F4=[Re],I4=[Re],L4=[et],Ef){constructor(t,n){var r=t,{accept:o,collisionDetector:s,collisionPriority:a,type:l}=r,c=m4(r,["accept","collisionDetector","collisionPriority","type"]);super(c,n),we(ct,5,this),Fe(this,Ih,we(ct,8,this)),we(ct,11,this),Fe(this,Fh,we(ct,12,this)),we(ct,15,this),Fe(this,$h,we(ct,16,this)),we(ct,19,this),Fe(this,Vh,we(ct,20,this)),we(ct,23,this),Fe(this,Bh,we(ct,24,this)),we(ct,27,this),this.accept=o,this.collisionDetector=s,this.collisionPriority=a,this.type=l}accepts(t){const{accept:n}=this;return n?typeof n=="function"?n(t):t.type?Array.isArray(n)?n.includes(t.type):t.type===n:!1:!0}get isDropTarget(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.target)==null?void 0:n.id)===this.id}};ct=$s(Ef);Ih=new WeakMap;Fh=new WeakMap;$h=new WeakMap;Vh=new WeakMap;Bh=new WeakMap;De(ct,4,"accept",B4,$n,Ih);De(ct,4,"type",V4,$n,Fh);De(ct,4,"collisionDetector",$4,$n,$h);De(ct,4,"collisionPriority",F4,$n,Vh);De(ct,4,"shape",I4,$n,Bh);De(ct,2,"isDropTarget",L4,$n);No(ct,$n);var xs=class extends Et{constructor(e,t){super(e,t),this.manager=e,this.options=t}},Y$=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(const n of e??[])n.controller=this}onEvent(e){var t;if(!this.activated)if((t=this.constraints)!=null&&t.length)for(const n of this.constraints)n.onEvent(e);else this.activate(e)}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},bl,z4=class{constructor(e){this.options=e,Fe(this,bl)}set controller(e){sn(this,bl,e),e.signal.addEventListener("abort",()=>this.abort())}activate(e){var t;(t=pt(this,bl))==null||t.activate(e)}};bl=new WeakMap;var Q1=class extends Et{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},K$=class{constructor(e){this.draggables=new J1,this.droppables=new J1,this.plugins=new ud(e),this.sensors=new ud(e),this.modifiers=new ud(e)}register(e,t){if(e instanceof Fn)return this.draggables.register(e.id,e);if(e instanceof $n)return this.droppables.register(e.id,e);if(e.prototype instanceof Q1)return this.modifiers.register(e,t);if(e.prototype instanceof xs)return this.sensors.register(e,t);if(e.prototype instanceof Et)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof Ir)return e instanceof Fn?this.draggables.unregister(e.id,e):e instanceof $n?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof Q1)return this.modifiers.unregister(e);if(e.prototype instanceof xs)return this.sensors.unregister(e);if(e.prototype instanceof Et)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},W4,H4,G4,U4,Y4,K4,q4,Z4,X4,ua,wl,Xo,Ke,zh,Wh,Hh,Gh,Uh,da;X4=[et],Z4=[Re],q4=[Re],K4=[Re],Y4=[Re],U4=[Re],G4=[et],H4=[et],W4=[et];var jn=class{constructor(e){we(Ke,5,this),Fe(this,ua),Fe(this,wl),Fe(this,Xo,new Eo(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new ir,Fe(this,zh,we(Ke,8,this,!1)),we(Ke,11,this),Fe(this,Wh,we(Ke,12,this,null)),we(Ke,15,this),Fe(this,Hh,we(Ke,16,this,null)),we(Ke,19,this),Fe(this,Gh,we(Ke,20,this,null)),we(Ke,23,this),Fe(this,Uh,we(Ke,24,this,[])),we(Ke,27,this),this.position=new gu({x:0,y:0}),Fe(this,da,{x:0,y:0}),sn(this,ua,e)}get shape(){const{current:e,initial:t,previous:n}=pt(this,Xo);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?pt(this,Xo).current=e:pt(this,Xo).reset()}get source(){var e;const t=this.sourceIdentifier;if(t==null)return null;const n=pt(this,ua).registry.draggables.get(t);return n&&sn(this,wl,n),(e=n??pt(this,wl))!=null?e:null}get target(){var e;const t=this.targetIdentifier;return t!=null&&(e=pt(this,ua).registry.droppables.get(t))!=null?e:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const r of this.modifiers)n=r.apply(h4(p4({},this.snapshot()),{transform:n}));return sn(this,da,n),n}snapshot(){return Le(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:pt(this,da),shape:this.shape?cd(this.shape):null,position:cd(this.position),status:cd(this.status),canceled:this.canceled}))}reset(){Qe(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,pt(this,Xo).reset(),this.position.reset({x:0,y:0}),sn(this,da,{x:0,y:0}),this.modifiers=[]})}};Ke=$s(null);ua=new WeakMap;wl=new WeakMap;Xo=new WeakMap;zh=new WeakMap;Wh=new WeakMap;Hh=new WeakMap;Gh=new WeakMap;Uh=new WeakMap;da=new WeakMap;De(Ke,2,"shape",X4,jn);De(Ke,4,"canceled",Z4,jn,zh);De(Ke,4,"activatorEvent",q4,jn,Wh);De(Ke,4,"sourceIdentifier",K4,jn,Hh);De(Ke,4,"targetIdentifier",Y4,jn,Gh);De(Ke,4,"modifiers",U4,jn,Uh);De(Ke,2,"source",G4,jn);De(Ke,2,"target",H4,jn);De(Ke,2,"transform",W4,jn);No(Ke,jn);var q$={get rendering(){return Promise.resolve()}};function Qn(e,t){return typeof e=="function"?e(t):e??t}var Z$=class{constructor(t){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(p=>p.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var n;const r=t??{},o=Qn(r.plugins,[]),s=Qn(r.sensors,[]),a=Qn(r.modifiers,[]),l=(n=r.renderer)!=null?n:q$,c=new H$(this),u=new K$(this);this.registry=u,this.monitor=c,this.renderer=l,this.actions=new U$(this),this.dragOperation=new jn(this),this.collisionObserver=new z$(this),this.plugins=[G$,...o],this.modifiers=a,this.sensors=s;const{destroy:f}=this,d=Ci(()=>{var p,h,g;const x=Le(()=>this.dragOperation.modifiers),v=this.modifiers;for(const y of x)v.includes(y)||y.destroy();this.dragOperation.modifiers=(g=(h=(p=this.dragOperation.source)==null?void 0:p.modifiers)==null?void 0:h.map(y=>{const{plugin:b,options:C}=jh(y);return new b(this,C)}))!=null?g:v});this.destroy=()=>{d(),f()}}get plugins(){return this.registry.plugins.values}set plugins(t){this.registry.plugins.values=t}get modifiers(){return this.registry.modifiers.values}set modifiers(t){this.registry.modifiers.values=t}get sensors(){return this.registry.sensors.values}set sensors(t){this.registry.sensors.values=t}},J4=e=>{throw TypeError(e)},Yh=(e,t,n)=>t.has(e)||J4("Cannot "+n),Ce=(e,t,n)=>(Yh(e,t,"read from private field"),t.get(e)),$t=(e,t,n)=>t.has(e)?J4("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ut=(e,t,n,r)=>(Yh(e,t,"write to private field"),t.set(e,n),n),Q4=(e,t,n)=>(Yh(e,t,"access private method"),n);function xu(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function e6(e,t){const n=e.getAnimations();if(n.length>0)for(const r of n){if(r.playState!=="running")continue;const{effect:o}=r,a=(xu(o)?o.getKeyframes():[]).filter(t);if(a.length>0)return[a[a.length-1],r]}return null}function vu(e){const{width:t,height:n,top:r,left:o,bottom:s,right:a}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:o,bottom:s,right:a}}function Kh(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ni(e){return"nodeType"in e}function Xt(e){var t,n,r;return e?Kh(e)?e:Ni(e)?"defaultView"in e?(t=e.defaultView)!=null?t:window:(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function qh(e){const{Document:t}=Xt(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function po(e){return!e||Kh(e)?!1:e instanceof Xt(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function t6(e){return e instanceof Xt(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function _o(e){return e?Kh(e)?e.document:Ni(e)?qh(e)?e:po(e)||t6(e)?e.ownerDocument:document:document:document}function X$(e){var t,n,r,o;const{documentElement:s}=_o(e),a=Xt(e).visualViewport,l=(t=a?.width)!=null?t:s.clientWidth,c=(n=a?.height)!=null?n:s.clientHeight,u=(r=a?.offsetTop)!=null?r:0,f=(o=a?.offsetLeft)!=null?o:0;return{top:u,left:f,right:f+l,bottom:u+c,width:l,height:c}}function J$(e,t){if(Q$(e)&&e.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:o}=getComputedStyle(e);return n==="visible"&&r==="visible"&&o==="visible"}function Q$(e){return e.tagName==="DETAILS"}function Ga(e,t=e.getBoundingClientRect(),n=0){var r,o,s,a,l;let c=t;const{ownerDocument:u}=e,f=(r=u.defaultView)!=null?r:window;let d=e.parentElement;for(;d&&d!==u.documentElement;){if(!J$(d)){const C=d.getBoundingClientRect(),w=n*(C.bottom-C.top),E=n*(C.right-C.left),N=n*(C.bottom-C.top),_=n*(C.right-C.left);c={top:Math.max(c.top,C.top-w),right:Math.min(c.right,C.right+E),bottom:Math.min(c.bottom,C.bottom+N),left:Math.max(c.left,C.left-_),width:0,height:0},c.width=c.right-c.left,c.height=c.bottom-c.top}d=d.parentElement}const p=f.visualViewport,h=(o=p?.offsetTop)!=null?o:0,g=(s=p?.offsetLeft)!=null?s:0,x=(a=p?.width)!=null?a:f.innerWidth,v=(l=p?.height)!=null?l:f.innerHeight,y=n*v,b=n*x;return c={top:Math.max(c.top,h-y),right:Math.min(c.right,g+x+b),bottom:Math.min(c.bottom,h+v+y),left:Math.max(c.left,g-b),width:0,height:0},c.width=c.right-c.left,c.height=c.bottom-c.top,c.width<0&&(c.width=0),c.height<0&&(c.height=0),c}function vs(e){return{x:e.clientX,y:e.clientY}}var n6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Nf(e=document,t=new Set){if(t.has(e))return[];t.add(e);const n=[e];for(const r of Array.from(e.querySelectorAll("iframe, frame")))try{const o=r.contentDocument;o&&!t.has(o)&&n.push(...Nf(o,t))}catch{}try{const r=e.defaultView;if(r&&r!==window.top){const o=r.parent;o&&o.document&&o.document!==e&&n.push(...Nf(o.document,t))}}catch{}return n}function Zh(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function r6(){var e,t;const n=Zh()?window.visualViewport:null;return{x:(e=n?.offsetLeft)!=null?e:0,y:(t=n?.offsetTop)!=null?t:0}}function Xh(e){return!e||!Ni(e)?!1:e instanceof Xt(e).ShadowRoot}function ec(e){if(e&&Ni(e)){let t=e.getRootNode();if(Xh(t))return t;if(t instanceof Document)return t}return _o(e)}function Jh(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function eV(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((s,a)=>{const l=r[a];if(e0(s)&&e0(l)&&(s.type!=="file"&&(s.value=l.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),t0(s)&&t0(l)&&l.width>0&&l.height>0){const c=s.getContext("2d");c?.drawImage(l,0,0)}}),n}function e0(e){return"value"in e}function t0(e){return e.tagName==="CANVAS"}function o6(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(tV(r)){const{contentDocument:o}=r;if(o){const{left:s,top:a}=r.getBoundingClientRect();return o6(o,{x:t-s,y:n-a})}}return r}function tV(e){return e?.tagName==="IFRAME"}var _f=new WeakMap;function nV(e){return!!e.closest(`
|
package/dist/index.d.ts
CHANGED
|
@@ -1609,10 +1609,10 @@ export declare interface DataTableCopyCellProps {
|
|
|
1609
1609
|
* glyphs, so 24 call sites rendered a bare "US" where a flag was meant to be,
|
|
1610
1610
|
* and codes with no glyph at all — XK — were broken on every platform.
|
|
1611
1611
|
*
|
|
1612
|
-
* It now serves
|
|
1613
|
-
*
|
|
1612
|
+
* It now serves circular SVGs from dashboard-assets, which unifies three ways
|
|
1613
|
+
* of drawing a flag into one.
|
|
1614
1614
|
*
|
|
1615
|
-
* If the image fails — an offline browser, a code the
|
|
1615
|
+
* If the image fails — an offline browser, a code the set does not carry — the
|
|
1616
1616
|
* cell falls back to the code in a muted chip. A missing flag should not leave
|
|
1617
1617
|
* a broken-image icon in a table row.
|
|
1618
1618
|
*
|
|
@@ -1637,7 +1637,7 @@ export declare interface DataTableCountryCellProps {
|
|
|
1637
1637
|
getCountryName?: (code: string) => string;
|
|
1638
1638
|
/**
|
|
1639
1639
|
* Where the flags are served from, without a trailing slash. The file is
|
|
1640
|
-
* `{baseUrl}/
|
|
1640
|
+
* `{baseUrl}/{code}.svg`, lowercased.
|
|
1641
1641
|
*
|
|
1642
1642
|
* Point it at a self-hosted copy to drop the external request.
|
|
1643
1643
|
*/
|
package/dist/index.js
CHANGED
|
@@ -26370,7 +26370,7 @@ const TF = (e) => {
|
|
|
26370
26370
|
}
|
|
26371
26371
|
);
|
|
26372
26372
|
OF.displayName = "DataTableDateCell";
|
|
26373
|
-
const LF = "https://
|
|
26373
|
+
const LF = "https://dashboard-assets.y.uno/flags", IF = (e) => {
|
|
26374
26374
|
if (typeof e != "string") return null;
|
|
26375
26375
|
const t = e.trim().toUpperCase();
|
|
26376
26376
|
return /^[A-Z]{2}$/.test(t) ? t : null;
|
|
@@ -26400,7 +26400,7 @@ const LF = "https://icons.prod.y.uno/flags", IF = (e) => {
|
|
|
26400
26400
|
g && /* @__PURE__ */ l(
|
|
26401
26401
|
"img",
|
|
26402
26402
|
{
|
|
26403
|
-
src: `${o}
|
|
26403
|
+
src: `${o}/${f.toLowerCase()}.svg`,
|
|
26404
26404
|
alt: "",
|
|
26405
26405
|
"aria-hidden": !0,
|
|
26406
26406
|
loading: "lazy",
|