@collective-intelligence/ui-react 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{xe,r,x,L,lo,p,n,o,s,a,y,h,u,N,G,ne,l,c,E,O,se,ie,ye,bt,U,d,i,w,q,j,le,Q}from"./index-87bxrmfq.js";import{f,S}from"./index-s7dyqth2.js";import{_,F,B,z,M,D,V,T,Z}from"./index-7gzq3np4.js";import{ut,k,Ro,Fe,Be}from"./index-vs10z2rc.js";import{v}from"./index-9nkdbb33.js";import{e}from"./index-x6g6brsv.js";import*as ro from"react";import{jsx as xr}from"react/jsx-runtime";var ds=Object.defineProperty,_r=(m,t)=>ds(m,"name",{value:t,configurable:!0}),rn="Collapsible",[us,oo]=s(rn),[ps,nn]=us(rn),ms=ro.forwardRef(_r(function(t,g){let{__scopeCollapsible:b,open:H,defaultOpen:C,disabled:X,onOpenChange:te,...J}=t,[ee,ce]=i({prop:H,defaultProp:C??!1,onChange:te,caller:rn});return xr(ps,{scope:b,disabled:X,contentId:c(),open:ee,onOpenToggle:ro.useCallback(()=>ce((W)=>!W),[ce]),children:xr(a.div,{"data-state":Fr(ee),"data-disabled":X?"":void 0,...J,ref:g})})},"Collapsible")),fs="CollapsibleTrigger",an=ro.forwardRef(_r(function(t,g){let{__scopeCollapsible:b,...H}=t,C=nn(fs,b);return xr(a.button,{type:"button","aria-controls":C.open?C.contentId:void 0,"aria-expanded":C.open||!1,"data-state":Fr(C.open),"data-disabled":C.disabled?"":void 0,disabled:C.disabled,...H,ref:g,onClick:o(t.onClick,C.onOpenToggle)})},"CollapsibleTrigger")),aa="CollapsibleContent",sn=ro.forwardRef(_r(function(t,g){let{forceMount:b,...H}=t,C=nn(aa,t.__scopeCollapsible);return xr(d,{present:b||C.open,children:({present:X})=>xr(gs,{...H,ref:g,present:X})})},"CollapsibleContent")),gs=ro.forwardRef(_r(function(t,g){let{__scopeCollapsible:b,present:H,children:C,...X}=t,te=nn(aa,b),[J,ee]=ro.useState(H),ce=ro.useRef(null),W=r(g,ce),ge=ro.useRef(0),be=ge.current,Te=ro.useRef(0),Ie=Te.current,he=te.open||J,Ce=ro.useRef(he),Me=ro.useRef(void 0);return ro.useEffect(()=>{let Re=requestAnimationFrame(()=>Ce.current=!1);return()=>cancelAnimationFrame(Re)},[]),l(()=>{let Re=ce.current;if(Re){Me.current=Me.current||{transitionDuration:Re.style.transitionDuration,animationName:Re.style.animationName},Re.style.transitionDuration="0s",Re.style.animationName="none";let Pe=Re.getBoundingClientRect();if(ge.current=Pe.height,Te.current=Pe.width,!Ce.current)Re.style.transitionDuration=Me.current.transitionDuration,Re.style.animationName=Me.current.animationName;ee(H)}},[te.open,H]),xr(a.div,{"data-state":Fr(te.open),"data-disabled":te.disabled?"":void 0,id:te.contentId,hidden:!he,...X,ref:W,style:{["--radix-collapsible-content-height"]:be?`${be}px`:void 0,["--radix-collapsible-content-width"]:Ie?`${Ie}px`:void 0,...t.style},children:he&&C})},"CollapsibleContentImpl"));function Fr(m){return m?"open":"closed"}_r(Fr,"getState");var St=ms,ko=an,Mo=sn;import{jsx as ln}from"react/jsx-runtime";var hs=p("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{defaultVariants:{variant:"default"},variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}}}),$e=({className:m,variant:t,...g})=>ln("div",{"data-slot":"alert",role:"alert",className:e(hs({variant:t}),m),...g}),Ye=({className:m,...t})=>ln("div",{"data-slot":"alert-title",className:e("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",m),...t}),Ke=({className:m,...t})=>ln("div",{"data-slot":"alert-description",className:e("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",m),...t});import{jsx as bs}from"react/jsx-runtime";var Do=p("inline-flex items-center justify-center rounded-full border px-2.5 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{defaultVariants:{variant:"default"},variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",mono:"border-transparent bg-(--bg-surface-alt)/70 text-(--text-secondary) font-mono text-[10.5px] tracking-tight",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",soft:"border-transparent bg-(--bg-accent-soft) text-(--accent) [a&]:hover:bg-(--bg-accent-soft)/80"}}}),ue=({className:m,variant:t,asChild:g=!1,...b})=>bs(g?L:"span",{"data-slot":"badge",className:e(Do({variant:t}),m),...b});import{jsx as Xo,jsxs as ia}from"react/jsx-runtime";var To=p("flex flex-col text-card-foreground",{defaultVariants:{variant:"default"},variants:{variant:{default:"bg-card gap-6 rounded-lg border border-(--border-default) py-6 shadow-(--shadow-sm) dark:shadow-none",island:"gap-6 rounded-lg border border-border bg-card py-6 shadow-(--shadow-sm) dark:shadow-none",sheet:"overflow-hidden rounded-lg border border-border bg-card shadow-(--shadow-sm) dark:shadow-none"}}}),xs=()=>ia("div",{"aria-hidden":!0,"data-slot":"card-accent-gradient",className:"pointer-events-none absolute inset-0",children:[Xo("div",{className:"absolute -left-20 -top-24 h-72 w-72 rounded-full bg-(--accent) opacity-[0.09] blur-3xl will-change-transform animate-[aurora-drift_18s_ease-in-out_infinite]"}),Xo("div",{className:"absolute -right-10 -top-16 h-64 w-64 rounded-full bg-(--accent) opacity-[0.05] blur-3xl will-change-transform animate-[aurora-drift_24s_ease-in-out_infinite_reverse]"})]}),_o=({className:m,...t})=>Xo("div",{"data-slot":"card-header",className:e("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",m),...t}),Fo=({className:m,...t})=>Xo("div",{"data-slot":"card-title",className:e("leading-none font-semibold",m),...t}),Bo=({className:m,...t})=>Xo("div",{"data-slot":"card-description",className:e("text-muted-foreground text-sm",m),...t}),zo=({className:m,...t})=>Xo("div",{"data-slot":"card-action",className:e("col-start-2 row-span-2 row-start-1 self-start justify-self-end",m),...t}),Rt=({className:m,...t})=>Xo("div",{"data-slot":"card-content",className:e("px-6",m),...t}),Ho=({className:m,...t})=>Xo("div",{"data-slot":"card-footer",className:e("flex items-center px-6 [.border-t]:pt-6",m),...t}),oe=({children:m,className:t,variant:g,visual:b,...H})=>ia("div",{"data-slot":"card","data-variant":g??"default","data-visual":b,className:e(To({variant:g}),b==="accent_gradient"&&"relative overflow-hidden",t),...H,children:[b==="accent_gradient"?Xo(xs,{}):null,m]});import*as $t from"react";import{Fragment as Rs,jsx as rr,jsxs as ys}from"react/jsx-runtime";var Cs=Object.defineProperty,Jo=(m,t)=>Cs(m,"name",{value:t,configurable:!0}),cn="Checkbox",[Ps,Cu]=s(cn),[ws,dn]=Ps(cn);function sa(m){let{__scopeCheckbox:t,checked:g,children:b,defaultChecked:H,disabled:C,form:X,name:te,onCheckedChange:J,required:ee,value:ce="on",internal_do_not_use_render:W}=m,[ge,be]=i({prop:g,defaultProp:H??!1,onChange:J,caller:cn}),[Te,Ie]=$t.useState(null),[he,Ce]=$t.useState(null),Me=$t.useRef(!1),[Re,Pe]=$t.useReducer((Ve)=>Ve+1,0),qe=Te?!!X||!!Te.closest("form"):!0,De={checked:ge,disabled:C,setChecked:be,control:Te,setControl:Ie,name:te,form:X,value:ce,hasConsumerStoppedPropagationRef:Me,userInteractionCount:Re,onUserInteraction:Pe,required:ee,defaultChecked:Zo(H)?!1:H,isFormControl:qe,bubbleInput:he,setBubbleInput:Ce};return rr(ws,{scope:t,...De,children:da(W)?W(De):b})}Jo(sa,"CheckboxProvider");var Ss="CheckboxTrigger",Ts=$t.forwardRef(Jo(function({__scopeCheckbox:t,onKeyDown:g,onClick:b,...H},C){let{control:X,value:te,disabled:J,checked:ee,required:ce,setControl:W,setChecked:ge,hasConsumerStoppedPropagationRef:be,onUserInteraction:Te,isFormControl:Ie,bubbleInput:he}=dn(Ss,t),Ce=r(C,W),Me=$t.useRef(ee);return $t.useEffect(()=>{let Re=X?.form;if(Re){let Pe=Jo(()=>ge(Me.current),"reset");return Re.addEventListener("reset",Pe),()=>Re.removeEventListener("reset",Pe)}},[X,ge]),rr(a.button,{type:"button",role:"checkbox","aria-checked":Zo(ee)?"mixed":ee,"aria-required":ce,"data-state":un(ee),"data-disabled":J?"":void 0,disabled:J,value:te,...H,ref:Ce,onKeyDown:o(g,(Re)=>{if(Re.key==="Enter")Re.preventDefault()}),onClick:o(b,(Re)=>{if(Te(),ge((Pe)=>Zo(Pe)?!0:!Pe),he&&Ie){if(be.current=Re.isPropagationStopped(),!be.current)Re.stopPropagation()}})})},"CheckboxTrigger")),la=$t.forwardRef(Jo(function(t,g){let{__scopeCheckbox:b,name:H,checked:C,defaultChecked:X,required:te,disabled:J,value:ee,onCheckedChange:ce,form:W,...ge}=t;return rr(sa,{__scopeCheckbox:b,checked:C,defaultChecked:X,disabled:J,required:te,onCheckedChange:ce,name:H,form:W,value:ee,internal_do_not_use_render:({isFormControl:be})=>ys(Rs,{children:[rr(Ts,{...ge,ref:g,__scopeCheckbox:b}),be&&rr(Es,{__scopeCheckbox:b})]})})},"Checkbox")),Is="CheckboxIndicator",ca=$t.forwardRef(Jo(function(t,g){let{__scopeCheckbox:b,forceMount:H,...C}=t,X=dn(Is,b);return rr(d,{present:H||Zo(X.checked)||X.checked===!0,children:rr(a.span,{"data-state":un(X.checked),"data-disabled":X.disabled?"":void 0,...C,ref:g,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),_s="CheckboxBubbleInput",Es=$t.forwardRef(Jo(function({__scopeCheckbox:t,onClick:g,...b},H){let{control:C,hasConsumerStoppedPropagationRef:X,userInteractionCount:te,checked:J,defaultChecked:ee,required:ce,disabled:W,name:ge,value:be,form:Te,bubbleInput:Ie,setBubbleInput:he}=dn(_s,t),Ce=r(H,he),Me=E(C),Re=$t.useRef(!1),Pe=$t.useRef(J),qe=$t.useRef(te);$t.useEffect(()=>{let Ve=Ie;if(!Ve)return;let nt=window.HTMLInputElement.prototype,dt=Object.getOwnPropertyDescriptor(nt,"checked").set,Ct=te!==qe.current;qe.current=te;let ft=Pe.current!==J;Pe.current=J;let vt=!(Ct&&X.current);if(ft&&dt){Re.current=!Ct;let it=new Event("click",{bubbles:vt});Ve.indeterminate=Zo(J),dt.call(Ve,Zo(J)?!1:J),Ve.dispatchEvent(it),Re.current=!1}},[Ie,J,X,te]);let De=$t.useRef(Zo(J)?!1:J);return rr(a.input,{type:"checkbox","aria-hidden":!0,defaultChecked:ee??De.current,required:ce,disabled:W,name:ge,value:be,form:Te,...b,tabIndex:-1,ref:Ce,onClick:o(g,(Ve)=>{if(Re.current)Ve.stopPropagation()}),style:{...b.style,...Me,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function da(m){return typeof m==="function"}Jo(da,"isFunction");function Zo(m){return m==="indeterminate"}Jo(Zo,"isIndeterminate");function un(m){return Zo(m)?"indeterminate":m?"checked":"unchecked"}Jo(un,"getState");import{jsx as pn}from"react/jsx-runtime";var Xe=({className:m,...t})=>pn(la,{"data-slot":"checkbox",className:e("peer 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 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-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",m),...t,children:pn(ca,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:pn(f,{className:"size-3.5 text-current"})})});import{jsx as mn}from"react/jsx-runtime";var de=({...m})=>mn(St,{"data-slot":"collapsible",...m}),fe=({...m})=>mn(an,{"data-slot":"collapsible-trigger",...m}),pe=({...m})=>mn(sn,{"data-slot":"collapsible-content",...m});import*as xo from"react";var ua=1,Ms=0.9,Ds=0.8,Ns=0.17,fn=0.1,gn=0.999,As=0.9999,Os=0.99,Ls=/[\\\/_+.#"@\[\(\{&]/,Gs=/[\\\/_+.#"@\[\(\{&]/g,Bs=/[\s-]/,ma=/[\s-]/g;function vn(m,t,g,b,H,C,X){if(C===t.length)return H===m.length?ua:Os;var te=`${H},${C}`;if(X[te]!==void 0)return X[te];for(var J=b.charAt(C),ee=g.indexOf(J,H),ce=0,W,ge,be,Te;ee>=0;)W=vn(m,t,g,b,ee+1,C+1,X),W>ce&&(ee===H?W*=ua:Ls.test(m.charAt(ee-1))?(W*=Ds,be=m.slice(H,ee-1).match(Gs),be&&H>0&&(W*=Math.pow(gn,be.length))):Bs.test(m.charAt(ee-1))?(W*=Ms,Te=m.slice(H,ee-1).match(ma),Te&&H>0&&(W*=Math.pow(gn,Te.length))):(W*=Ns,H>0&&(W*=Math.pow(gn,ee-H))),m.charAt(ee)!==t.charAt(C)&&(W*=As)),(W<fn&&g.charAt(ee-1)===b.charAt(C+1)||b.charAt(C+1)===b.charAt(C)&&g.charAt(ee-1)!==b.charAt(C))&&(ge=vn(m,t,g,b,ee+1,C+2,X),ge*fn>W&&(W=ge*fn)),W>ce&&(ce=W),ee=g.indexOf(J,ee+1);return X[te]=ce,ce}function pa(m){return m.toLowerCase().replace(ma," ")}function fa(m,t,g){return m=g&&g.length>0?`${m+" "+g.join(" ")}`:m,vn(m,t,pa(m),pa(t),0,0,{})}import*as ke from"react";var Er='[cmdk-group=""]',hn='[cmdk-group-items=""]',Vs='[cmdk-group-heading=""]',va='[cmdk-item=""]',ga=`${va}:not([aria-disabled="true"])`,bn="cmdk-item-select",Cr="data-value",Fs=(m,t,g)=>fa(m,t,g),ha=ke.createContext(void 0),kr=()=>ke.useContext(ha),ba=ke.createContext(void 0),xn=()=>ke.useContext(ba),xa=ke.createContext(void 0),Ca=ke.forwardRef((m,t)=>{let g=Rr(()=>{var ve,Ae;return{search:"",value:(Ae=(ve=m.value)!=null?ve:m.defaultValue)!=null?Ae:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),b=Rr(()=>new Set),H=Rr(()=>new Map),C=Rr(()=>new Map),X=Rr(()=>new Set),te=Ra(m),{label:J,children:ee,value:ce,onValueChange:W,filter:ge,shouldFilter:be,loop:Te,disablePointerSelection:Ie=!1,vimBindings:he=!0,...Ce}=m,Me=c(),Re=c(),Pe=c(),qe=ke.useRef(null),De=Zs();cr(()=>{if(ce!==void 0){let ve=ce.trim();g.current.value=ve,Ve.emit()}},[ce]),cr(()=>{De(6,vt)},[]);let Ve=ke.useMemo(()=>({subscribe:(ve)=>(X.current.add(ve),()=>X.current.delete(ve)),snapshot:()=>g.current,setState:(ve,Ae,Ee)=>{var Se,Le,rt,Ne;if(!Object.is(g.current[ve],Ae)){if(g.current[ve]=Ae,ve==="search")ft(),dt(),De(1,Ct);else if(ve==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Oe=document.getElementById(Pe);Oe?Oe.focus():(Se=document.getElementById(Me))==null||Se.focus()}if(De(7,()=>{var Oe;g.current.selectedItemId=(Oe=it())==null?void 0:Oe.id,Ve.emit()}),Ee||De(5,vt),((Le=te.current)==null?void 0:Le.value)!==void 0){let Oe=Ae!=null?Ae:"";(Ne=(rt=te.current).onValueChange)==null||Ne.call(rt,Oe);return}}Ve.emit()}},emit:()=>{X.current.forEach((ve)=>ve())}}),[]),nt=ke.useMemo(()=>({value:(ve,Ae,Ee)=>{var Se;Ae!==((Se=C.current.get(ve))==null?void 0:Se.value)&&(C.current.set(ve,{value:Ae,keywords:Ee}),g.current.filtered.items.set(ve,st(Ae,Ee)),De(2,()=>{dt(),Ve.emit()}))},item:(ve,Ae)=>(b.current.add(ve),Ae&&(H.current.has(Ae)?H.current.get(Ae).add(ve):H.current.set(Ae,new Set([ve]))),De(3,()=>{ft(),dt(),g.current.value||Ct(),Ve.emit()}),()=>{C.current.delete(ve),b.current.delete(ve),g.current.filtered.items.delete(ve);let Ee=it();De(4,()=>{ft(),(Ee==null?void 0:Ee.getAttribute("id"))===ve&&Ct(),Ve.emit()})}),group:(ve)=>(H.current.has(ve)||H.current.set(ve,new Set),()=>{C.current.delete(ve),H.current.delete(ve)}),filter:()=>te.current.shouldFilter,label:J||m["aria-label"],getDisablePointerSelection:()=>te.current.disablePointerSelection,listId:Me,inputId:Pe,labelId:Re,listInnerRef:qe}),[]);function st(ve,Ae){var Ee,Se;let Le=(Se=(Ee=te.current)==null?void 0:Ee.filter)!=null?Se:Fs;return ve?Le(ve,g.current.search,Ae):0}function dt(){if(!g.current.search||te.current.shouldFilter===!1)return;let ve=g.current.filtered.items,Ae=[];g.current.filtered.groups.forEach((Se)=>{let Le=H.current.get(Se),rt=0;Le.forEach((Ne)=>{let Oe=ve.get(Ne);rt=Math.max(Oe,rt)}),Ae.push([Se,rt])});let Ee=qe.current;yt().sort((Se,Le)=>{var rt,Ne;let Oe=Se.getAttribute("id"),wt=Le.getAttribute("id");return((rt=ve.get(wt))!=null?rt:0)-((Ne=ve.get(Oe))!=null?Ne:0)}).forEach((Se)=>{let Le=Se.closest(hn);Le?Le.appendChild(Se.parentElement===Le?Se:Se.closest(`${hn} > *`)):Ee.appendChild(Se.parentElement===Ee?Se:Se.closest(`${hn} > *`))}),Ae.sort((Se,Le)=>Le[1]-Se[1]).forEach((Se)=>{var Le;let rt=(Le=qe.current)==null?void 0:Le.querySelector(`${Er}[${Cr}="${encodeURIComponent(Se[0])}"]`);rt==null||rt.parentElement.appendChild(rt)})}function Ct(){let ve=yt().find((Ee)=>Ee.getAttribute("aria-disabled")!=="true"),Ae=ve==null?void 0:ve.getAttribute(Cr);Ve.setState("value",Ae||void 0)}function ft(){var ve,Ae,Ee,Se;if(!g.current.search||te.current.shouldFilter===!1){g.current.filtered.count=b.current.size;return}g.current.filtered.groups=new Set;let Le=0;for(let rt of b.current){let Ne=(Ae=(ve=C.current.get(rt))==null?void 0:ve.value)!=null?Ae:"",Oe=(Se=(Ee=C.current.get(rt))==null?void 0:Ee.keywords)!=null?Se:[],wt=st(Ne,Oe);g.current.filtered.items.set(rt,wt),wt>0&&Le++}for(let[rt,Ne]of H.current)for(let Oe of Ne)if(g.current.filtered.items.get(Oe)>0){g.current.filtered.groups.add(rt);break}g.current.filtered.count=Le}function vt(){var ve,Ae,Ee;let Se=it();Se&&(((ve=Se.parentElement)==null?void 0:ve.firstChild)===Se&&((Ee=(Ae=Se.closest(Er))==null?void 0:Ae.querySelector(Vs))==null||Ee.scrollIntoView({block:"nearest"})),Se.scrollIntoView({block:"nearest"}))}function it(){var ve;return(ve=qe.current)==null?void 0:ve.querySelector(`${va}[aria-selected="true"]`)}function yt(){var ve;return Array.from(((ve=qe.current)==null?void 0:ve.querySelectorAll(ga))||[])}function Ge(ve){let Ae=yt()[ve];Ae&&Ve.setState("value",Ae.getAttribute(Cr))}function pt(ve){var Ae;let Ee=it(),Se=yt(),Le=Se.findIndex((Ne)=>Ne===Ee),rt=Se[Le+ve];(Ae=te.current)!=null&&Ae.loop&&(rt=Le+ve<0?Se[Se.length-1]:Le+ve===Se.length?Se[0]:Se[Le+ve]),rt&&Ve.setState("value",rt.getAttribute(Cr))}function Kt(ve){let Ae=it(),Ee=Ae==null?void 0:Ae.closest(Er),Se;for(;Ee&&!Se;)Ee=ve>0?qs(Ee,Er):Xs(Ee,Er),Se=Ee==null?void 0:Ee.querySelector(ga);Se?Ve.setState("value",Se.getAttribute(Cr)):pt(ve)}let xt=()=>Ge(yt().length-1),Yt=(ve)=>{ve.preventDefault(),ve.metaKey?xt():ve.altKey?Kt(1):pt(1)},qt=(ve)=>{ve.preventDefault(),ve.metaKey?Ge(0):ve.altKey?Kt(-1):pt(-1)};return ke.createElement(a.div,{ref:t,tabIndex:-1,...Ce,"cmdk-root":"",onKeyDown:(ve)=>{var Ae;(Ae=Ce.onKeyDown)==null||Ae.call(Ce,ve);let Ee=ve.nativeEvent.isComposing||ve.keyCode===229;if(!(ve.defaultPrevented||Ee))switch(ve.key){case"n":case"j":{he&&ve.ctrlKey&&Yt(ve);break}case"ArrowDown":{Yt(ve);break}case"p":case"k":{he&&ve.ctrlKey&&qt(ve);break}case"ArrowUp":{qt(ve);break}case"Home":{ve.preventDefault(),Ge(0);break}case"End":{ve.preventDefault(),xt();break}case"Enter":{ve.preventDefault();let Se=it();if(Se){let Le=new Event(bn);Se.dispatchEvent(Le)}}}}},ke.createElement("label",{"cmdk-label":"",htmlFor:nt.inputId,id:nt.labelId,style:Qs},J),Hr(m,(ve)=>ke.createElement(ba.Provider,{value:Ve},ke.createElement(ha.Provider,{value:nt},ve))))}),Hs=ke.forwardRef((m,t)=>{var g,b;let H=c(),C=ke.useRef(null),X=ke.useContext(xa),te=kr(),J=Ra(m),ee=(b=(g=J.current)==null?void 0:g.forceMount)!=null?b:X==null?void 0:X.forceMount;cr(()=>{if(!ee)return te.item(H,X==null?void 0:X.id)},[ee]);let ce=ya(H,C,[m.value,m.children,C],m.keywords),W=xn(),ge=nr((De)=>De.value&&De.value===ce.current),be=nr((De)=>ee||te.filter()===!1?!0:De.search?De.filtered.items.get(H)>0:!0);ke.useEffect(()=>{let De=C.current;if(!(!De||m.disabled))return De.addEventListener(bn,Te),()=>De.removeEventListener(bn,Te)},[be,m.onSelect,m.disabled]);function Te(){var De,Ve;Ie(),(Ve=(De=J.current).onSelect)==null||Ve.call(De,ce.current)}function Ie(){W.setState("value",ce.current,!0)}if(!be)return null;let{disabled:he,value:Ce,onSelect:Me,forceMount:Re,keywords:Pe,...qe}=m;return ke.createElement(a.div,{ref:xe(C,t),...qe,id:H,"cmdk-item":"",role:"option","aria-disabled":!!he,"aria-selected":!!ge,"data-disabled":!!he,"data-selected":!!ge,onPointerMove:he||te.getDisablePointerSelection()?void 0:Ie,onClick:he?void 0:Te},m.children)}),zs=ke.forwardRef((m,t)=>{let{heading:g,children:b,forceMount:H,...C}=m,X=c(),te=ke.useRef(null),J=ke.useRef(null),ee=c(),ce=kr(),W=nr((be)=>H||ce.filter()===!1?!0:be.search?be.filtered.groups.has(X):!0);cr(()=>ce.group(X),[]),ya(X,te,[m.value,m.heading,J]);let ge=ke.useMemo(()=>({id:X,forceMount:H}),[H]);return ke.createElement(a.div,{ref:xe(te,t),...C,"cmdk-group":"",role:"presentation",hidden:W?void 0:!0},g&&ke.createElement("div",{ref:J,"cmdk-group-heading":"","aria-hidden":!0,id:ee},g),Hr(m,(be)=>ke.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":g?ee:void 0},ke.createElement(xa.Provider,{value:ge},be))))}),js=ke.forwardRef((m,t)=>{let{alwaysRender:g,...b}=m,H=ke.useRef(null),C=nr((X)=>!X.search);return!g&&!C?null:ke.createElement(a.div,{ref:xe(H,t),...b,"cmdk-separator":"",role:"separator"})}),Us=ke.forwardRef((m,t)=>{let{onValueChange:g,...b}=m,H=m.value!=null,C=xn(),X=nr((ee)=>ee.search),te=nr((ee)=>ee.selectedItemId),J=kr();return ke.useEffect(()=>{m.value!=null&&C.setState("search",m.value)},[m.value]),ke.createElement(a.input,{ref:t,...b,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":J.listId,"aria-labelledby":J.labelId,"aria-activedescendant":te,id:J.inputId,type:"text",value:H?m.value:X,onChange:(ee)=>{H||C.setState("search",ee.target.value),g==null||g(ee.target.value)}})}),Ks=ke.forwardRef((m,t)=>{let{children:g,label:b="Suggestions",...H}=m,C=ke.useRef(null),X=ke.useRef(null),te=nr((ee)=>ee.selectedItemId),J=kr();return ke.useEffect(()=>{if(X.current&&C.current){let ee=X.current,ce=C.current,W,ge=new ResizeObserver(()=>{W=requestAnimationFrame(()=>{let be=ee.offsetHeight;ce.style.setProperty("--cmdk-list-height",be.toFixed(1)+"px")})});return ge.observe(ee),()=>{cancelAnimationFrame(W),ge.unobserve(ee)}}},[]),ke.createElement(a.div,{ref:xe(C,t),...H,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":te,"aria-label":b,id:J.listId},Hr(m,(ee)=>ke.createElement("div",{ref:xe(X,J.listInnerRef),"cmdk-list-sizer":""},ee)))}),$s=ke.forwardRef((m,t)=>{let{open:g,onOpenChange:b,overlayClassName:H,contentClassName:C,container:X,...te}=m;return ke.createElement(_,{open:g,onOpenChange:b},ke.createElement(F,{container:X},ke.createElement(B,{"cmdk-overlay":"",className:H}),ke.createElement(z,{"aria-label":m.label,"cmdk-dialog":"",className:C},ke.createElement(Ca,{ref:t,...te}))))}),Ys=ke.forwardRef((m,t)=>nr((g)=>g.filtered.count===0)?ke.createElement(a.div,{ref:t,...m,"cmdk-empty":"",role:"presentation"}):null),Ws=ke.forwardRef((m,t)=>{let{progress:g,children:b,label:H="Loading...",...C}=m;return ke.createElement(a.div,{ref:t,...C,"cmdk-loading":"",role:"progressbar","aria-valuenow":g,"aria-valuemin":0,"aria-valuemax":100,"aria-label":H},Hr(m,(X)=>ke.createElement("div",{"aria-hidden":!0},X)))}),ar=Object.assign(Ca,{List:Ks,Item:Hs,Input:Us,Group:zs,Separator:js,Dialog:$s,Empty:Ys,Loading:Ws});function qs(m,t){let g=m.nextElementSibling;for(;g;){if(g.matches(t))return g;g=g.nextElementSibling}}function Xs(m,t){let g=m.previousElementSibling;for(;g;){if(g.matches(t))return g;g=g.previousElementSibling}}function Ra(m){let t=ke.useRef(m);return cr(()=>{t.current=m}),t}var cr=typeof window>"u"?ke.useEffect:ke.useLayoutEffect;function Rr(m){let t=ke.useRef();return t.current===void 0&&(t.current=m()),t}function nr(m){let t=xn(),g=()=>m(t.snapshot());return ke.useSyncExternalStore(t.subscribe,g,g)}function ya(m,t,g,b=[]){let H=ke.useRef(),C=kr();return cr(()=>{var X;let te=(()=>{var ee;for(let ce of g){if(typeof ce=="string")return ce.trim();if(typeof ce=="object"&&"current"in ce)return ce.current?(ee=ce.current.textContent)==null?void 0:ee.trim():H.current}})(),J=b.map((ee)=>ee.trim());C.value(m,te,J),(X=t.current)==null||X.setAttribute(Cr,te),H.current=te}),H}var Zs=()=>{let[m,t]=ke.useState(),g=Rr(()=>new Map);return cr(()=>{g.current.forEach((b)=>b()),g.current=new Map},[m]),(b,H)=>{g.current.set(b,H),t({})}};function Js(m){let t=m.type;return typeof t=="function"?t(m.props):("render"in t)?t.render(m.props):m}function Hr({asChild:m,children:t},g){return m&&ke.isValidElement(t)?ke.cloneElement(Js(t),{ref:t.ref},g(t.props.children)):g(t)}var Qs={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};import{jsx as vo,jsxs as Cn}from"react/jsx-runtime";var ae=({className:m,...t})=>vo(ar,{"data-slot":"command",className:e("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",m),...t}),Vo=({title:m="Command Palette",description:t="Search for a command to run...",children:g,...b})=>Cn(M,{...b,children:[Cn(V,{className:"sr-only",children:[vo(T,{children:m}),vo(Z,{children:t})]}),vo(D,{className:"overflow-hidden p-0",children:vo(ae,{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:g})})]}),Ze=({className:m,...t})=>Cn("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[vo(Be,{className:"size-4 shrink-0 opacity-50"}),vo(ar.Input,{"data-slot":"command-input",className:e("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",m),...t})]}),me=({className:m,...t})=>vo(ar.List,{"data-slot":"command-list",className:e("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",m),...t}),Je=({...m})=>vo(ar.Empty,{"data-slot":"command-empty",className:"px-3 py-6 text-center text-sm",...m}),Y=({className:m,...t})=>vo(ar.Group,{"data-slot":"command-group",className:e("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",m),...t}),Pt=({className:m,...t})=>vo(ar.Separator,{"data-slot":"command-separator",className:e("bg-border -mx-1 h-px",m),...t}),A=({className:m,...t})=>vo(ar.Item,{"data-slot":"command-item",className:e("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default 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",m),...t}),Wo=({className:m,...t})=>vo("span",{"data-slot":"command-shortcut",className:e("text-muted-foreground ml-auto text-xs tracking-widest",m),...t});import*as Ut from"react";import{jsx as no}from"react/jsx-runtime";var el=Object.defineProperty,Qo=(m,t)=>el(m,"name",{value:t,configurable:!0}),Rn="Popover",[wa,op]=s(Rn,[O]),zr=O(),[tl,dr]=wa(Rn),ol=Qo((m)=>{let{__scopePopover:t,children:g,open:b,defaultOpen:H,onOpenChange:C,modal:X=!1}=m,te=zr(t),J=Ut.useRef(null),[ee,ce]=Ut.useState(!1),[W,ge]=i({prop:b,defaultProp:H??!1,onChange:C,caller:Rn});return no(se,{...te,children:no(tl,{scope:t,contentId:c(),triggerRef:J,open:W,onOpenChange:ge,onOpenToggle:Ut.useCallback(()=>ge((be)=>!be),[ge]),hasCustomAnchor:ee,onCustomAnchorAdd:Ut.useCallback(()=>ce(!0),[]),onCustomAnchorRemove:Ut.useCallback(()=>ce(!1),[]),modal:X,children:g})})},"Popover"),rl="PopoverAnchor",nl=Ut.forwardRef(Qo(function(t,g){let{__scopePopover:b,...H}=t,C=dr(rl,b),X=zr(b),{onCustomAnchorAdd:te,onCustomAnchorRemove:J}=C;return Ut.useEffect(()=>(te(),()=>J()),[te,J]),no(ie,{...X,...H,ref:g})},"PopoverAnchor")),al="PopoverTrigger",il=Ut.forwardRef(Qo(function(t,g){let{__scopePopover:b,...H}=t,C=dr(al,b),X=zr(b),te=r(g,C.triggerRef),J=no(a.button,{type:"button","aria-haspopup":"dialog","aria-expanded":C.open,"aria-controls":C.open?C.contentId:void 0,"data-state":yn(C.open),...H,ref:te,onClick:o(t.onClick,C.onOpenToggle)});return C.hasCustomAnchor?J:no(ie,{asChild:!0,...X,children:J})},"PopoverTrigger")),Sa="PopoverPortal",[sl,ll]=wa(Sa,{forceMount:void 0}),cl=Qo((m)=>{let{__scopePopover:t,forceMount:g,children:b,container:H}=m,C=dr(Sa,t);return no(sl,{scope:t,forceMount:g,children:no(d,{present:g||C.open,children:no(U,{asChild:!0,container:H,children:b})})})},"PopoverPortal"),Mr="PopoverContent",dl=Ut.forwardRef(Qo(function(t,g){let b=ll(Mr,t.__scopePopover),{forceMount:H=b.forceMount,...C}=t,X=dr(Mr,t.__scopePopover);return no(d,{present:H||X.open,children:X.modal?no(pl,{...C,ref:g}):no(ml,{...C,ref:g})})},"PopoverContent")),ul=x("PopoverContent.RemoveScroll"),pl=Ut.forwardRef(Qo(function(t,g){let b=dr(Mr,t.__scopePopover),H=Ut.useRef(null),C=r(g,H),X=Ut.useRef(!1);return Ut.useEffect(()=>{let te=H.current;if(te)return le(te)},[]),no(Q,{as:ul,allowPinchZoom:!0,children:no(Ta,{...t,ref:C,trapFocus:b.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:o(t.onCloseAutoFocus,(te)=>{if(te.preventDefault(),!X.current)b.triggerRef.current?.focus()}),onPointerDownOutside:o(t.onPointerDownOutside,(te)=>{let J=te.detail.originalEvent,ee=J.button===0&&J.ctrlKey===!0,ce=J.button===2||ee;X.current=ce},{checkForDefaultPrevented:!1}),onFocusOutside:o(t.onFocusOutside,(te)=>te.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),ml=Ut.forwardRef(Qo(function(t,g){let b=dr(Mr,t.__scopePopover),H=Ut.useRef(!1),C=Ut.useRef(!1);return no(Ta,{...t,ref:g,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(X)=>{if(t.onCloseAutoFocus?.(X),!X.defaultPrevented){if(!H.current)b.triggerRef.current?.focus();X.preventDefault()}H.current=!1,C.current=!1},onInteractOutside:(X)=>{if(t.onInteractOutside?.(X),!X.defaultPrevented){if(H.current=!0,X.detail.originalEvent.type==="pointerdown")C.current=!0}let te=X.target;if(b.triggerRef.current?.contains(te))X.preventDefault();if(X.detail.originalEvent.type==="focusin"&&C.current)X.preventDefault()}})},"PopoverContentNonModal")),Ta=Ut.forwardRef(Qo(function(t,g){let{__scopePopover:b,trapFocus:H,onOpenAutoFocus:C,onCloseAutoFocus:X,disableOutsidePointerEvents:te,onEscapeKeyDown:J,onPointerDownOutside:ee,onFocusOutside:ce,onInteractOutside:W,...ge}=t,be=dr(Mr,b),Te=zr(b);return G(),no(ne,{asChild:!0,loop:!0,trapped:H,onMountAutoFocus:C,onUnmountAutoFocus:X,children:no(N,{asChild:!0,disableOutsidePointerEvents:te,onInteractOutside:W,onEscapeKeyDown:J,onPointerDownOutside:ee,onFocusOutside:ce,onDismiss:()=>be.onOpenChange(!1),deferPointerDownOutside:!0,children:no(ye,{"data-state":yn(be.open),role:"dialog",id:be.contentId,...Te,...ge,ref:g,style:{...ge.style,...{"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}})})})},"PopoverContentImpl"));function yn(m){return m?"open":"closed"}Qo(yn,"getState");var Ia=ol,_a=nl,Ea=il,ka=cl,Ma=dl;import{jsx as Dr}from"react/jsx-runtime";var R=({...m})=>Dr(Ia,{"data-slot":"popover",...m}),P=({...m})=>Dr(Ea,{"data-slot":"popover-trigger",...m}),I=({className:m,align:t="center",sideOffset:g=4,...b})=>Dr(ka,{children:Dr(Ma,{"data-slot":"popover-content",align:t,sideOffset:g,className:e("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",m),...b})}),Go=({...m})=>Dr(_a,{"data-slot":"popover-anchor",...m});import{jsx as Zt,jsxs as Io,Fragment as Da}from"react/jsx-runtime";var gl={className:void 0,disabled:!1,emptyMessage:"No option found.",hasMore:!1,loadMoreLabel:"Load more",loading:!1,loadingMessage:"Loading options...",loadingMore:!1,modal:!1,placeholder:"Select option...",searchPlaceholder:"Search...",width:"200px"},vl=48,hl=({onVisible:m})=>{let t=xo.useRef(null),g=xo.useEffectEvent(m);return xo.useEffect(()=>{let b=t.current;if(!b||!("IntersectionObserver"in globalThis))return;let H=new IntersectionObserver((C)=>{if(C.some((X)=>X.isIntersecting))H.disconnect(),g()},{root:b.closest("[cmdk-list]"),rootMargin:`0px 0px ${vl}px 0px`});return H.observe(b),()=>{H.disconnect()}},[]),Zt("div",{ref:t,"aria-hidden":!0,className:"h-px"})},mt=xo.forwardRef(function(t,g){let b={...gl,...t},{options:H,id:C,value:X,selectedLabel:te,defaultValue:J,onChange:ee,placeholder:ce,searchPlaceholder:W,emptyMessage:ge,className:be,width:Te,disabled:Ie,loading:he,loadingMessage:Ce,onSearchChange:Me,onLoadMore:Re,hasMore:Pe,loadingMore:qe,loadMoreLabel:De,modal:Ve,actionOption:nt}=b,[st,dt]=xo.useState(!1),[Ct,ft]=xo.useState(J??""),vt=X!==void 0,it=vt?X:Ct,yt=(Ge)=>{let pt=Ge===it?"":Ge;if(!vt)ft(pt);ee?.(pt),dt(!1)};return Io(R,{modal:Ve,open:st,onOpenChange:dt,children:[Zt(P,{asChild:!0,children:Io(n,{ref:g,id:C,variant:"outline","aria-expanded":st,"aria-busy":he,className:e("justify-between",be),style:{width:Te},disabled:Ie,children:[it!==void 0&&it!==""?Zt("span",{className:"min-w-0 truncate",children:H.find((Ge)=>Ge.value===it)?.label??te??it}):Zt("span",{className:"min-w-0 truncate text-muted-foreground",children:ce}),he?Zt(k,{"aria-hidden":!0,className:"ml-2 size-4 shrink-0 animate-spin text-muted-foreground"}):Zt(Fe,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),Zt(I,{className:"p-0",style:{width:"var(--radix-popover-trigger-width)"},children:Io(ae,{shouldFilter:!Me,children:[Zt(Ze,{...Me?{onValueChange:Me}:{},placeholder:W}),Zt(me,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.5rem))]",children:he?Io("div",{"aria-live":"polite",className:"flex items-center justify-center gap-2 px-3 py-6 text-sm text-muted-foreground",children:[Zt(k,{"aria-hidden":!0,className:"size-4 animate-spin"}),Ce]}):Io(Da,{children:[Zt(Je,{children:ge}),Io(Y,{children:[H.map((Ge)=>Io(A,{value:Ge.label,keywords:[Ge.label],onSelect:()=>{yt(Ge.value)},children:[Zt(f,{className:e("mr-2 h-4 w-4",it===Ge.value?"opacity-100":"opacity-0")}),Zt("span",{className:"min-w-0 truncate",title:Ge.label,children:Ge.label})]},Ge.value)),Pe&&Re&&!qe?Zt(hl,{onVisible:Re},H.length):null]}),Pe&&Re?Io(Da,{children:[Zt(Pt,{}),Zt(Y,{children:Io(A,{disabled:qe,value:De,onSelect:Re,children:[qe?Zt(k,{"aria-hidden":!0,className:"animate-spin"}):null,De]})})]}):null,nt&&H.length>0?Zt(Pt,{}):null,nt?Zt(Y,{children:Io(A,{value:nt.label,keywords:[nt.label],onSelect:()=>{yt(nt.value)},children:[nt.icon,nt.label]})}):null]})})]})})]})});mt.displayName="Combobox";import{jsx as bl}from"react/jsx-runtime";var Qe=({className:m,...t})=>bl("textarea",{"data-slot":"textarea",className:e("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",m),...t});import*as jr from"react";var xl=Object.defineProperty,Cl=(m,t)=>xl(m,"name",{value:t,configurable:!0});function ze(m){let t=jr.useRef({value:m,previous:m});return jr.useMemo(()=>{if(t.current.value!==m)t.current.previous=t.current.value,t.current.value=m;return t.current.previous},[m])}Cl(ze,"usePrevious");import*as Na from"react";import{jsx as Pl}from"react/jsx-runtime";var Rl=Object.defineProperty,yl=(m,t)=>Rl(m,"name",{value:t,configurable:!0}),Pn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wl=Na.forwardRef(yl(function(t,g){return Pl(a.span,{...t,ref:g,style:{...Pn,...t.style}})},"VisuallyHidden")),It=wl;import*as In from"react";import{jsx as wn}from"react/jsx-runtime";var Tl=Object.defineProperty,er=(m,t)=>Tl(m,"name",{value:t,configurable:!0}),Aa="Progress",_n=100,[Il,yp]=s(Aa),[_l,El]=Il(Aa),kl=In.forwardRef(er(function(t,g){let{__scopeProgress:b,value:H=null,max:C,getValueLabel:X=Oa,...te}=t;if((C||C===0)&&!Sn(C))console.error(La(`${C}`,"Progress"));let J=Sn(C)?C:_n;if(H!==null&&!Tn(H,J))console.error(Ga(`${H}`,"Progress"));let ee=Tn(H,J)?H:null,ce=Nr(ee)?X(ee,J):void 0;return wn(_l,{scope:b,value:ee,max:J,children:wn(a.div,{"aria-valuemax":J,"aria-valuemin":0,"aria-valuenow":Nr(ee)?ee:void 0,"aria-valuetext":ce,role:"progressbar","data-state":En(ee,J),"data-value":ee??void 0,"data-max":J,...te,ref:g})})},"Progress")),Ml="ProgressIndicator",Dl=In.forwardRef(er(function(t,g){let{__scopeProgress:b,...H}=t,C=El(Ml,b);return wn(a.div,{"data-state":En(C.value,C.max),"data-value":C.value??void 0,"data-max":C.max,...H,ref:g})},"ProgressIndicator"));function Oa(m,t){return`${Math.round(m/t*100)}%`}er(Oa,"defaultGetValueLabel");function En(m,t){return m==null?"indeterminate":m===t?"complete":"loading"}er(En,"getProgressState");function Nr(m){return typeof m==="number"}er(Nr,"isNumber");function Sn(m){return Nr(m)&&!isNaN(m)&&m>0}er(Sn,"isValidMaxNumber");function Tn(m,t){return Nr(m)&&!isNaN(m)&&m<=t&&m>=0}er(Tn,"isValidValueNumber");function La(m,t){return`Invalid prop \`max\` of value \`${m}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${_n}\`.`}er(La,"getInvalidMaxError");function Ga(m,t){return`Invalid prop \`value\` of value \`${m}\` supplied to \`${t}\`. The \`value\` prop must be:
1
+ import{xe,r,x,L,lo,p,n,o,s,a,y,h,u,N,G,ne,l,c,E,O,se,ie,ye,bt,U,d,i,w,q,j,le,Q}from"./index-87bxrmfq.js";import{f,S}from"./index-s7dyqth2.js";import{_,F,B,z,M,D,V,T,Z}from"./index-z3yjnfyn.js";import{ut,k,Ro,Fe,Be}from"./index-vs10z2rc.js";import{v}from"./index-9nkdbb33.js";import{e}from"./index-x6g6brsv.js";import*as ro from"react";import{jsx as xr}from"react/jsx-runtime";var ds=Object.defineProperty,_r=(m,t)=>ds(m,"name",{value:t,configurable:!0}),rn="Collapsible",[us,oo]=s(rn),[ps,nn]=us(rn),ms=ro.forwardRef(_r(function(t,g){let{__scopeCollapsible:b,open:H,defaultOpen:C,disabled:X,onOpenChange:te,...J}=t,[ee,ce]=i({prop:H,defaultProp:C??!1,onChange:te,caller:rn});return xr(ps,{scope:b,disabled:X,contentId:c(),open:ee,onOpenToggle:ro.useCallback(()=>ce((W)=>!W),[ce]),children:xr(a.div,{"data-state":Fr(ee),"data-disabled":X?"":void 0,...J,ref:g})})},"Collapsible")),fs="CollapsibleTrigger",an=ro.forwardRef(_r(function(t,g){let{__scopeCollapsible:b,...H}=t,C=nn(fs,b);return xr(a.button,{type:"button","aria-controls":C.open?C.contentId:void 0,"aria-expanded":C.open||!1,"data-state":Fr(C.open),"data-disabled":C.disabled?"":void 0,disabled:C.disabled,...H,ref:g,onClick:o(t.onClick,C.onOpenToggle)})},"CollapsibleTrigger")),aa="CollapsibleContent",sn=ro.forwardRef(_r(function(t,g){let{forceMount:b,...H}=t,C=nn(aa,t.__scopeCollapsible);return xr(d,{present:b||C.open,children:({present:X})=>xr(gs,{...H,ref:g,present:X})})},"CollapsibleContent")),gs=ro.forwardRef(_r(function(t,g){let{__scopeCollapsible:b,present:H,children:C,...X}=t,te=nn(aa,b),[J,ee]=ro.useState(H),ce=ro.useRef(null),W=r(g,ce),ge=ro.useRef(0),be=ge.current,Te=ro.useRef(0),Ie=Te.current,he=te.open||J,Ce=ro.useRef(he),Me=ro.useRef(void 0);return ro.useEffect(()=>{let Re=requestAnimationFrame(()=>Ce.current=!1);return()=>cancelAnimationFrame(Re)},[]),l(()=>{let Re=ce.current;if(Re){Me.current=Me.current||{transitionDuration:Re.style.transitionDuration,animationName:Re.style.animationName},Re.style.transitionDuration="0s",Re.style.animationName="none";let Pe=Re.getBoundingClientRect();if(ge.current=Pe.height,Te.current=Pe.width,!Ce.current)Re.style.transitionDuration=Me.current.transitionDuration,Re.style.animationName=Me.current.animationName;ee(H)}},[te.open,H]),xr(a.div,{"data-state":Fr(te.open),"data-disabled":te.disabled?"":void 0,id:te.contentId,hidden:!he,...X,ref:W,style:{["--radix-collapsible-content-height"]:be?`${be}px`:void 0,["--radix-collapsible-content-width"]:Ie?`${Ie}px`:void 0,...t.style},children:he&&C})},"CollapsibleContentImpl"));function Fr(m){return m?"open":"closed"}_r(Fr,"getState");var St=ms,ko=an,Mo=sn;import{jsx as ln}from"react/jsx-runtime";var hs=p("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{defaultVariants:{variant:"default"},variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}}}),$e=({className:m,variant:t,...g})=>ln("div",{"data-slot":"alert",role:"alert",className:e(hs({variant:t}),m),...g}),Ye=({className:m,...t})=>ln("div",{"data-slot":"alert-title",className:e("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",m),...t}),Ke=({className:m,...t})=>ln("div",{"data-slot":"alert-description",className:e("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",m),...t});import{jsx as bs}from"react/jsx-runtime";var Do=p("inline-flex items-center justify-center rounded-full border px-2.5 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{defaultVariants:{variant:"default"},variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",mono:"border-transparent bg-(--bg-surface-alt)/70 text-(--text-secondary) font-mono text-[10.5px] tracking-tight",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",soft:"border-transparent bg-(--bg-accent-soft) text-(--accent) [a&]:hover:bg-(--bg-accent-soft)/80"}}}),ue=({className:m,variant:t,asChild:g=!1,...b})=>bs(g?L:"span",{"data-slot":"badge",className:e(Do({variant:t}),m),...b});import{jsx as Xo,jsxs as ia}from"react/jsx-runtime";var To=p("flex flex-col text-card-foreground",{defaultVariants:{variant:"default"},variants:{variant:{default:"bg-card gap-6 rounded-lg border border-(--border-default) py-6 shadow-(--shadow-sm) dark:shadow-none",island:"gap-6 rounded-lg border border-border bg-card py-6 shadow-(--shadow-sm) dark:shadow-none",sheet:"overflow-hidden rounded-lg border border-border bg-card shadow-(--shadow-sm) dark:shadow-none"}}}),xs=()=>ia("div",{"aria-hidden":!0,"data-slot":"card-accent-gradient",className:"pointer-events-none absolute inset-0",children:[Xo("div",{className:"absolute -left-20 -top-24 h-72 w-72 rounded-full bg-(--accent) opacity-[0.09] blur-3xl will-change-transform animate-[aurora-drift_18s_ease-in-out_infinite]"}),Xo("div",{className:"absolute -right-10 -top-16 h-64 w-64 rounded-full bg-(--accent) opacity-[0.05] blur-3xl will-change-transform animate-[aurora-drift_24s_ease-in-out_infinite_reverse]"})]}),_o=({className:m,...t})=>Xo("div",{"data-slot":"card-header",className:e("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",m),...t}),Fo=({className:m,...t})=>Xo("div",{"data-slot":"card-title",className:e("leading-none font-semibold",m),...t}),Bo=({className:m,...t})=>Xo("div",{"data-slot":"card-description",className:e("text-muted-foreground text-sm",m),...t}),zo=({className:m,...t})=>Xo("div",{"data-slot":"card-action",className:e("col-start-2 row-span-2 row-start-1 self-start justify-self-end",m),...t}),Rt=({className:m,...t})=>Xo("div",{"data-slot":"card-content",className:e("px-6",m),...t}),Ho=({className:m,...t})=>Xo("div",{"data-slot":"card-footer",className:e("flex items-center px-6 [.border-t]:pt-6",m),...t}),oe=({children:m,className:t,variant:g,visual:b,...H})=>ia("div",{"data-slot":"card","data-variant":g??"default","data-visual":b,className:e(To({variant:g}),b==="accent_gradient"&&"relative overflow-hidden",t),...H,children:[b==="accent_gradient"?Xo(xs,{}):null,m]});import*as $t from"react";import{Fragment as Rs,jsx as rr,jsxs as ys}from"react/jsx-runtime";var Cs=Object.defineProperty,Jo=(m,t)=>Cs(m,"name",{value:t,configurable:!0}),cn="Checkbox",[Ps,Cu]=s(cn),[ws,dn]=Ps(cn);function sa(m){let{__scopeCheckbox:t,checked:g,children:b,defaultChecked:H,disabled:C,form:X,name:te,onCheckedChange:J,required:ee,value:ce="on",internal_do_not_use_render:W}=m,[ge,be]=i({prop:g,defaultProp:H??!1,onChange:J,caller:cn}),[Te,Ie]=$t.useState(null),[he,Ce]=$t.useState(null),Me=$t.useRef(!1),[Re,Pe]=$t.useReducer((Ve)=>Ve+1,0),qe=Te?!!X||!!Te.closest("form"):!0,De={checked:ge,disabled:C,setChecked:be,control:Te,setControl:Ie,name:te,form:X,value:ce,hasConsumerStoppedPropagationRef:Me,userInteractionCount:Re,onUserInteraction:Pe,required:ee,defaultChecked:Zo(H)?!1:H,isFormControl:qe,bubbleInput:he,setBubbleInput:Ce};return rr(ws,{scope:t,...De,children:da(W)?W(De):b})}Jo(sa,"CheckboxProvider");var Ss="CheckboxTrigger",Ts=$t.forwardRef(Jo(function({__scopeCheckbox:t,onKeyDown:g,onClick:b,...H},C){let{control:X,value:te,disabled:J,checked:ee,required:ce,setControl:W,setChecked:ge,hasConsumerStoppedPropagationRef:be,onUserInteraction:Te,isFormControl:Ie,bubbleInput:he}=dn(Ss,t),Ce=r(C,W),Me=$t.useRef(ee);return $t.useEffect(()=>{let Re=X?.form;if(Re){let Pe=Jo(()=>ge(Me.current),"reset");return Re.addEventListener("reset",Pe),()=>Re.removeEventListener("reset",Pe)}},[X,ge]),rr(a.button,{type:"button",role:"checkbox","aria-checked":Zo(ee)?"mixed":ee,"aria-required":ce,"data-state":un(ee),"data-disabled":J?"":void 0,disabled:J,value:te,...H,ref:Ce,onKeyDown:o(g,(Re)=>{if(Re.key==="Enter")Re.preventDefault()}),onClick:o(b,(Re)=>{if(Te(),ge((Pe)=>Zo(Pe)?!0:!Pe),he&&Ie){if(be.current=Re.isPropagationStopped(),!be.current)Re.stopPropagation()}})})},"CheckboxTrigger")),la=$t.forwardRef(Jo(function(t,g){let{__scopeCheckbox:b,name:H,checked:C,defaultChecked:X,required:te,disabled:J,value:ee,onCheckedChange:ce,form:W,...ge}=t;return rr(sa,{__scopeCheckbox:b,checked:C,defaultChecked:X,disabled:J,required:te,onCheckedChange:ce,name:H,form:W,value:ee,internal_do_not_use_render:({isFormControl:be})=>ys(Rs,{children:[rr(Ts,{...ge,ref:g,__scopeCheckbox:b}),be&&rr(Es,{__scopeCheckbox:b})]})})},"Checkbox")),Is="CheckboxIndicator",ca=$t.forwardRef(Jo(function(t,g){let{__scopeCheckbox:b,forceMount:H,...C}=t,X=dn(Is,b);return rr(d,{present:H||Zo(X.checked)||X.checked===!0,children:rr(a.span,{"data-state":un(X.checked),"data-disabled":X.disabled?"":void 0,...C,ref:g,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),_s="CheckboxBubbleInput",Es=$t.forwardRef(Jo(function({__scopeCheckbox:t,onClick:g,...b},H){let{control:C,hasConsumerStoppedPropagationRef:X,userInteractionCount:te,checked:J,defaultChecked:ee,required:ce,disabled:W,name:ge,value:be,form:Te,bubbleInput:Ie,setBubbleInput:he}=dn(_s,t),Ce=r(H,he),Me=E(C),Re=$t.useRef(!1),Pe=$t.useRef(J),qe=$t.useRef(te);$t.useEffect(()=>{let Ve=Ie;if(!Ve)return;let nt=window.HTMLInputElement.prototype,dt=Object.getOwnPropertyDescriptor(nt,"checked").set,Ct=te!==qe.current;qe.current=te;let ft=Pe.current!==J;Pe.current=J;let vt=!(Ct&&X.current);if(ft&&dt){Re.current=!Ct;let it=new Event("click",{bubbles:vt});Ve.indeterminate=Zo(J),dt.call(Ve,Zo(J)?!1:J),Ve.dispatchEvent(it),Re.current=!1}},[Ie,J,X,te]);let De=$t.useRef(Zo(J)?!1:J);return rr(a.input,{type:"checkbox","aria-hidden":!0,defaultChecked:ee??De.current,required:ce,disabled:W,name:ge,value:be,form:Te,...b,tabIndex:-1,ref:Ce,onClick:o(g,(Ve)=>{if(Re.current)Ve.stopPropagation()}),style:{...b.style,...Me,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function da(m){return typeof m==="function"}Jo(da,"isFunction");function Zo(m){return m==="indeterminate"}Jo(Zo,"isIndeterminate");function un(m){return Zo(m)?"indeterminate":m?"checked":"unchecked"}Jo(un,"getState");import{jsx as pn}from"react/jsx-runtime";var Xe=({className:m,...t})=>pn(la,{"data-slot":"checkbox",className:e("peer 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 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-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",m),...t,children:pn(ca,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:pn(f,{className:"size-3.5 text-current"})})});import{jsx as mn}from"react/jsx-runtime";var de=({...m})=>mn(St,{"data-slot":"collapsible",...m}),fe=({...m})=>mn(an,{"data-slot":"collapsible-trigger",...m}),pe=({...m})=>mn(sn,{"data-slot":"collapsible-content",...m});import*as xo from"react";var ua=1,Ms=0.9,Ds=0.8,Ns=0.17,fn=0.1,gn=0.999,As=0.9999,Os=0.99,Ls=/[\\\/_+.#"@\[\(\{&]/,Gs=/[\\\/_+.#"@\[\(\{&]/g,Bs=/[\s-]/,ma=/[\s-]/g;function vn(m,t,g,b,H,C,X){if(C===t.length)return H===m.length?ua:Os;var te=`${H},${C}`;if(X[te]!==void 0)return X[te];for(var J=b.charAt(C),ee=g.indexOf(J,H),ce=0,W,ge,be,Te;ee>=0;)W=vn(m,t,g,b,ee+1,C+1,X),W>ce&&(ee===H?W*=ua:Ls.test(m.charAt(ee-1))?(W*=Ds,be=m.slice(H,ee-1).match(Gs),be&&H>0&&(W*=Math.pow(gn,be.length))):Bs.test(m.charAt(ee-1))?(W*=Ms,Te=m.slice(H,ee-1).match(ma),Te&&H>0&&(W*=Math.pow(gn,Te.length))):(W*=Ns,H>0&&(W*=Math.pow(gn,ee-H))),m.charAt(ee)!==t.charAt(C)&&(W*=As)),(W<fn&&g.charAt(ee-1)===b.charAt(C+1)||b.charAt(C+1)===b.charAt(C)&&g.charAt(ee-1)!==b.charAt(C))&&(ge=vn(m,t,g,b,ee+1,C+2,X),ge*fn>W&&(W=ge*fn)),W>ce&&(ce=W),ee=g.indexOf(J,ee+1);return X[te]=ce,ce}function pa(m){return m.toLowerCase().replace(ma," ")}function fa(m,t,g){return m=g&&g.length>0?`${m+" "+g.join(" ")}`:m,vn(m,t,pa(m),pa(t),0,0,{})}import*as ke from"react";var Er='[cmdk-group=""]',hn='[cmdk-group-items=""]',Vs='[cmdk-group-heading=""]',va='[cmdk-item=""]',ga=`${va}:not([aria-disabled="true"])`,bn="cmdk-item-select",Cr="data-value",Fs=(m,t,g)=>fa(m,t,g),ha=ke.createContext(void 0),kr=()=>ke.useContext(ha),ba=ke.createContext(void 0),xn=()=>ke.useContext(ba),xa=ke.createContext(void 0),Ca=ke.forwardRef((m,t)=>{let g=Rr(()=>{var ve,Ae;return{search:"",value:(Ae=(ve=m.value)!=null?ve:m.defaultValue)!=null?Ae:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),b=Rr(()=>new Set),H=Rr(()=>new Map),C=Rr(()=>new Map),X=Rr(()=>new Set),te=Ra(m),{label:J,children:ee,value:ce,onValueChange:W,filter:ge,shouldFilter:be,loop:Te,disablePointerSelection:Ie=!1,vimBindings:he=!0,...Ce}=m,Me=c(),Re=c(),Pe=c(),qe=ke.useRef(null),De=Zs();cr(()=>{if(ce!==void 0){let ve=ce.trim();g.current.value=ve,Ve.emit()}},[ce]),cr(()=>{De(6,vt)},[]);let Ve=ke.useMemo(()=>({subscribe:(ve)=>(X.current.add(ve),()=>X.current.delete(ve)),snapshot:()=>g.current,setState:(ve,Ae,Ee)=>{var Se,Le,rt,Ne;if(!Object.is(g.current[ve],Ae)){if(g.current[ve]=Ae,ve==="search")ft(),dt(),De(1,Ct);else if(ve==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Oe=document.getElementById(Pe);Oe?Oe.focus():(Se=document.getElementById(Me))==null||Se.focus()}if(De(7,()=>{var Oe;g.current.selectedItemId=(Oe=it())==null?void 0:Oe.id,Ve.emit()}),Ee||De(5,vt),((Le=te.current)==null?void 0:Le.value)!==void 0){let Oe=Ae!=null?Ae:"";(Ne=(rt=te.current).onValueChange)==null||Ne.call(rt,Oe);return}}Ve.emit()}},emit:()=>{X.current.forEach((ve)=>ve())}}),[]),nt=ke.useMemo(()=>({value:(ve,Ae,Ee)=>{var Se;Ae!==((Se=C.current.get(ve))==null?void 0:Se.value)&&(C.current.set(ve,{value:Ae,keywords:Ee}),g.current.filtered.items.set(ve,st(Ae,Ee)),De(2,()=>{dt(),Ve.emit()}))},item:(ve,Ae)=>(b.current.add(ve),Ae&&(H.current.has(Ae)?H.current.get(Ae).add(ve):H.current.set(Ae,new Set([ve]))),De(3,()=>{ft(),dt(),g.current.value||Ct(),Ve.emit()}),()=>{C.current.delete(ve),b.current.delete(ve),g.current.filtered.items.delete(ve);let Ee=it();De(4,()=>{ft(),(Ee==null?void 0:Ee.getAttribute("id"))===ve&&Ct(),Ve.emit()})}),group:(ve)=>(H.current.has(ve)||H.current.set(ve,new Set),()=>{C.current.delete(ve),H.current.delete(ve)}),filter:()=>te.current.shouldFilter,label:J||m["aria-label"],getDisablePointerSelection:()=>te.current.disablePointerSelection,listId:Me,inputId:Pe,labelId:Re,listInnerRef:qe}),[]);function st(ve,Ae){var Ee,Se;let Le=(Se=(Ee=te.current)==null?void 0:Ee.filter)!=null?Se:Fs;return ve?Le(ve,g.current.search,Ae):0}function dt(){if(!g.current.search||te.current.shouldFilter===!1)return;let ve=g.current.filtered.items,Ae=[];g.current.filtered.groups.forEach((Se)=>{let Le=H.current.get(Se),rt=0;Le.forEach((Ne)=>{let Oe=ve.get(Ne);rt=Math.max(Oe,rt)}),Ae.push([Se,rt])});let Ee=qe.current;yt().sort((Se,Le)=>{var rt,Ne;let Oe=Se.getAttribute("id"),wt=Le.getAttribute("id");return((rt=ve.get(wt))!=null?rt:0)-((Ne=ve.get(Oe))!=null?Ne:0)}).forEach((Se)=>{let Le=Se.closest(hn);Le?Le.appendChild(Se.parentElement===Le?Se:Se.closest(`${hn} > *`)):Ee.appendChild(Se.parentElement===Ee?Se:Se.closest(`${hn} > *`))}),Ae.sort((Se,Le)=>Le[1]-Se[1]).forEach((Se)=>{var Le;let rt=(Le=qe.current)==null?void 0:Le.querySelector(`${Er}[${Cr}="${encodeURIComponent(Se[0])}"]`);rt==null||rt.parentElement.appendChild(rt)})}function Ct(){let ve=yt().find((Ee)=>Ee.getAttribute("aria-disabled")!=="true"),Ae=ve==null?void 0:ve.getAttribute(Cr);Ve.setState("value",Ae||void 0)}function ft(){var ve,Ae,Ee,Se;if(!g.current.search||te.current.shouldFilter===!1){g.current.filtered.count=b.current.size;return}g.current.filtered.groups=new Set;let Le=0;for(let rt of b.current){let Ne=(Ae=(ve=C.current.get(rt))==null?void 0:ve.value)!=null?Ae:"",Oe=(Se=(Ee=C.current.get(rt))==null?void 0:Ee.keywords)!=null?Se:[],wt=st(Ne,Oe);g.current.filtered.items.set(rt,wt),wt>0&&Le++}for(let[rt,Ne]of H.current)for(let Oe of Ne)if(g.current.filtered.items.get(Oe)>0){g.current.filtered.groups.add(rt);break}g.current.filtered.count=Le}function vt(){var ve,Ae,Ee;let Se=it();Se&&(((ve=Se.parentElement)==null?void 0:ve.firstChild)===Se&&((Ee=(Ae=Se.closest(Er))==null?void 0:Ae.querySelector(Vs))==null||Ee.scrollIntoView({block:"nearest"})),Se.scrollIntoView({block:"nearest"}))}function it(){var ve;return(ve=qe.current)==null?void 0:ve.querySelector(`${va}[aria-selected="true"]`)}function yt(){var ve;return Array.from(((ve=qe.current)==null?void 0:ve.querySelectorAll(ga))||[])}function Ge(ve){let Ae=yt()[ve];Ae&&Ve.setState("value",Ae.getAttribute(Cr))}function pt(ve){var Ae;let Ee=it(),Se=yt(),Le=Se.findIndex((Ne)=>Ne===Ee),rt=Se[Le+ve];(Ae=te.current)!=null&&Ae.loop&&(rt=Le+ve<0?Se[Se.length-1]:Le+ve===Se.length?Se[0]:Se[Le+ve]),rt&&Ve.setState("value",rt.getAttribute(Cr))}function Kt(ve){let Ae=it(),Ee=Ae==null?void 0:Ae.closest(Er),Se;for(;Ee&&!Se;)Ee=ve>0?qs(Ee,Er):Xs(Ee,Er),Se=Ee==null?void 0:Ee.querySelector(ga);Se?Ve.setState("value",Se.getAttribute(Cr)):pt(ve)}let xt=()=>Ge(yt().length-1),Yt=(ve)=>{ve.preventDefault(),ve.metaKey?xt():ve.altKey?Kt(1):pt(1)},qt=(ve)=>{ve.preventDefault(),ve.metaKey?Ge(0):ve.altKey?Kt(-1):pt(-1)};return ke.createElement(a.div,{ref:t,tabIndex:-1,...Ce,"cmdk-root":"",onKeyDown:(ve)=>{var Ae;(Ae=Ce.onKeyDown)==null||Ae.call(Ce,ve);let Ee=ve.nativeEvent.isComposing||ve.keyCode===229;if(!(ve.defaultPrevented||Ee))switch(ve.key){case"n":case"j":{he&&ve.ctrlKey&&Yt(ve);break}case"ArrowDown":{Yt(ve);break}case"p":case"k":{he&&ve.ctrlKey&&qt(ve);break}case"ArrowUp":{qt(ve);break}case"Home":{ve.preventDefault(),Ge(0);break}case"End":{ve.preventDefault(),xt();break}case"Enter":{ve.preventDefault();let Se=it();if(Se){let Le=new Event(bn);Se.dispatchEvent(Le)}}}}},ke.createElement("label",{"cmdk-label":"",htmlFor:nt.inputId,id:nt.labelId,style:Qs},J),Hr(m,(ve)=>ke.createElement(ba.Provider,{value:Ve},ke.createElement(ha.Provider,{value:nt},ve))))}),Hs=ke.forwardRef((m,t)=>{var g,b;let H=c(),C=ke.useRef(null),X=ke.useContext(xa),te=kr(),J=Ra(m),ee=(b=(g=J.current)==null?void 0:g.forceMount)!=null?b:X==null?void 0:X.forceMount;cr(()=>{if(!ee)return te.item(H,X==null?void 0:X.id)},[ee]);let ce=ya(H,C,[m.value,m.children,C],m.keywords),W=xn(),ge=nr((De)=>De.value&&De.value===ce.current),be=nr((De)=>ee||te.filter()===!1?!0:De.search?De.filtered.items.get(H)>0:!0);ke.useEffect(()=>{let De=C.current;if(!(!De||m.disabled))return De.addEventListener(bn,Te),()=>De.removeEventListener(bn,Te)},[be,m.onSelect,m.disabled]);function Te(){var De,Ve;Ie(),(Ve=(De=J.current).onSelect)==null||Ve.call(De,ce.current)}function Ie(){W.setState("value",ce.current,!0)}if(!be)return null;let{disabled:he,value:Ce,onSelect:Me,forceMount:Re,keywords:Pe,...qe}=m;return ke.createElement(a.div,{ref:xe(C,t),...qe,id:H,"cmdk-item":"",role:"option","aria-disabled":!!he,"aria-selected":!!ge,"data-disabled":!!he,"data-selected":!!ge,onPointerMove:he||te.getDisablePointerSelection()?void 0:Ie,onClick:he?void 0:Te},m.children)}),zs=ke.forwardRef((m,t)=>{let{heading:g,children:b,forceMount:H,...C}=m,X=c(),te=ke.useRef(null),J=ke.useRef(null),ee=c(),ce=kr(),W=nr((be)=>H||ce.filter()===!1?!0:be.search?be.filtered.groups.has(X):!0);cr(()=>ce.group(X),[]),ya(X,te,[m.value,m.heading,J]);let ge=ke.useMemo(()=>({id:X,forceMount:H}),[H]);return ke.createElement(a.div,{ref:xe(te,t),...C,"cmdk-group":"",role:"presentation",hidden:W?void 0:!0},g&&ke.createElement("div",{ref:J,"cmdk-group-heading":"","aria-hidden":!0,id:ee},g),Hr(m,(be)=>ke.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":g?ee:void 0},ke.createElement(xa.Provider,{value:ge},be))))}),js=ke.forwardRef((m,t)=>{let{alwaysRender:g,...b}=m,H=ke.useRef(null),C=nr((X)=>!X.search);return!g&&!C?null:ke.createElement(a.div,{ref:xe(H,t),...b,"cmdk-separator":"",role:"separator"})}),Us=ke.forwardRef((m,t)=>{let{onValueChange:g,...b}=m,H=m.value!=null,C=xn(),X=nr((ee)=>ee.search),te=nr((ee)=>ee.selectedItemId),J=kr();return ke.useEffect(()=>{m.value!=null&&C.setState("search",m.value)},[m.value]),ke.createElement(a.input,{ref:t,...b,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":J.listId,"aria-labelledby":J.labelId,"aria-activedescendant":te,id:J.inputId,type:"text",value:H?m.value:X,onChange:(ee)=>{H||C.setState("search",ee.target.value),g==null||g(ee.target.value)}})}),Ks=ke.forwardRef((m,t)=>{let{children:g,label:b="Suggestions",...H}=m,C=ke.useRef(null),X=ke.useRef(null),te=nr((ee)=>ee.selectedItemId),J=kr();return ke.useEffect(()=>{if(X.current&&C.current){let ee=X.current,ce=C.current,W,ge=new ResizeObserver(()=>{W=requestAnimationFrame(()=>{let be=ee.offsetHeight;ce.style.setProperty("--cmdk-list-height",be.toFixed(1)+"px")})});return ge.observe(ee),()=>{cancelAnimationFrame(W),ge.unobserve(ee)}}},[]),ke.createElement(a.div,{ref:xe(C,t),...H,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":te,"aria-label":b,id:J.listId},Hr(m,(ee)=>ke.createElement("div",{ref:xe(X,J.listInnerRef),"cmdk-list-sizer":""},ee)))}),$s=ke.forwardRef((m,t)=>{let{open:g,onOpenChange:b,overlayClassName:H,contentClassName:C,container:X,...te}=m;return ke.createElement(_,{open:g,onOpenChange:b},ke.createElement(F,{container:X},ke.createElement(B,{"cmdk-overlay":"",className:H}),ke.createElement(z,{"aria-label":m.label,"cmdk-dialog":"",className:C},ke.createElement(Ca,{ref:t,...te}))))}),Ys=ke.forwardRef((m,t)=>nr((g)=>g.filtered.count===0)?ke.createElement(a.div,{ref:t,...m,"cmdk-empty":"",role:"presentation"}):null),Ws=ke.forwardRef((m,t)=>{let{progress:g,children:b,label:H="Loading...",...C}=m;return ke.createElement(a.div,{ref:t,...C,"cmdk-loading":"",role:"progressbar","aria-valuenow":g,"aria-valuemin":0,"aria-valuemax":100,"aria-label":H},Hr(m,(X)=>ke.createElement("div",{"aria-hidden":!0},X)))}),ar=Object.assign(Ca,{List:Ks,Item:Hs,Input:Us,Group:zs,Separator:js,Dialog:$s,Empty:Ys,Loading:Ws});function qs(m,t){let g=m.nextElementSibling;for(;g;){if(g.matches(t))return g;g=g.nextElementSibling}}function Xs(m,t){let g=m.previousElementSibling;for(;g;){if(g.matches(t))return g;g=g.previousElementSibling}}function Ra(m){let t=ke.useRef(m);return cr(()=>{t.current=m}),t}var cr=typeof window>"u"?ke.useEffect:ke.useLayoutEffect;function Rr(m){let t=ke.useRef();return t.current===void 0&&(t.current=m()),t}function nr(m){let t=xn(),g=()=>m(t.snapshot());return ke.useSyncExternalStore(t.subscribe,g,g)}function ya(m,t,g,b=[]){let H=ke.useRef(),C=kr();return cr(()=>{var X;let te=(()=>{var ee;for(let ce of g){if(typeof ce=="string")return ce.trim();if(typeof ce=="object"&&"current"in ce)return ce.current?(ee=ce.current.textContent)==null?void 0:ee.trim():H.current}})(),J=b.map((ee)=>ee.trim());C.value(m,te,J),(X=t.current)==null||X.setAttribute(Cr,te),H.current=te}),H}var Zs=()=>{let[m,t]=ke.useState(),g=Rr(()=>new Map);return cr(()=>{g.current.forEach((b)=>b()),g.current=new Map},[m]),(b,H)=>{g.current.set(b,H),t({})}};function Js(m){let t=m.type;return typeof t=="function"?t(m.props):("render"in t)?t.render(m.props):m}function Hr({asChild:m,children:t},g){return m&&ke.isValidElement(t)?ke.cloneElement(Js(t),{ref:t.ref},g(t.props.children)):g(t)}var Qs={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};import{jsx as vo,jsxs as Cn}from"react/jsx-runtime";var ae=({className:m,...t})=>vo(ar,{"data-slot":"command",className:e("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",m),...t}),Vo=({title:m="Command Palette",description:t="Search for a command to run...",children:g,...b})=>Cn(M,{...b,children:[Cn(V,{className:"sr-only",children:[vo(T,{children:m}),vo(Z,{children:t})]}),vo(D,{className:"overflow-hidden p-0",children:vo(ae,{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:g})})]}),Ze=({className:m,...t})=>Cn("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[vo(Be,{className:"size-4 shrink-0 opacity-50"}),vo(ar.Input,{"data-slot":"command-input",className:e("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",m),...t})]}),me=({className:m,...t})=>vo(ar.List,{"data-slot":"command-list",className:e("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",m),...t}),Je=({...m})=>vo(ar.Empty,{"data-slot":"command-empty",className:"px-3 py-6 text-center text-sm",...m}),Y=({className:m,...t})=>vo(ar.Group,{"data-slot":"command-group",className:e("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",m),...t}),Pt=({className:m,...t})=>vo(ar.Separator,{"data-slot":"command-separator",className:e("bg-border -mx-1 h-px",m),...t}),A=({className:m,...t})=>vo(ar.Item,{"data-slot":"command-item",className:e("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default 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",m),...t}),Wo=({className:m,...t})=>vo("span",{"data-slot":"command-shortcut",className:e("text-muted-foreground ml-auto text-xs tracking-widest",m),...t});import*as Ut from"react";import{jsx as no}from"react/jsx-runtime";var el=Object.defineProperty,Qo=(m,t)=>el(m,"name",{value:t,configurable:!0}),Rn="Popover",[wa,op]=s(Rn,[O]),zr=O(),[tl,dr]=wa(Rn),ol=Qo((m)=>{let{__scopePopover:t,children:g,open:b,defaultOpen:H,onOpenChange:C,modal:X=!1}=m,te=zr(t),J=Ut.useRef(null),[ee,ce]=Ut.useState(!1),[W,ge]=i({prop:b,defaultProp:H??!1,onChange:C,caller:Rn});return no(se,{...te,children:no(tl,{scope:t,contentId:c(),triggerRef:J,open:W,onOpenChange:ge,onOpenToggle:Ut.useCallback(()=>ge((be)=>!be),[ge]),hasCustomAnchor:ee,onCustomAnchorAdd:Ut.useCallback(()=>ce(!0),[]),onCustomAnchorRemove:Ut.useCallback(()=>ce(!1),[]),modal:X,children:g})})},"Popover"),rl="PopoverAnchor",nl=Ut.forwardRef(Qo(function(t,g){let{__scopePopover:b,...H}=t,C=dr(rl,b),X=zr(b),{onCustomAnchorAdd:te,onCustomAnchorRemove:J}=C;return Ut.useEffect(()=>(te(),()=>J()),[te,J]),no(ie,{...X,...H,ref:g})},"PopoverAnchor")),al="PopoverTrigger",il=Ut.forwardRef(Qo(function(t,g){let{__scopePopover:b,...H}=t,C=dr(al,b),X=zr(b),te=r(g,C.triggerRef),J=no(a.button,{type:"button","aria-haspopup":"dialog","aria-expanded":C.open,"aria-controls":C.open?C.contentId:void 0,"data-state":yn(C.open),...H,ref:te,onClick:o(t.onClick,C.onOpenToggle)});return C.hasCustomAnchor?J:no(ie,{asChild:!0,...X,children:J})},"PopoverTrigger")),Sa="PopoverPortal",[sl,ll]=wa(Sa,{forceMount:void 0}),cl=Qo((m)=>{let{__scopePopover:t,forceMount:g,children:b,container:H}=m,C=dr(Sa,t);return no(sl,{scope:t,forceMount:g,children:no(d,{present:g||C.open,children:no(U,{asChild:!0,container:H,children:b})})})},"PopoverPortal"),Mr="PopoverContent",dl=Ut.forwardRef(Qo(function(t,g){let b=ll(Mr,t.__scopePopover),{forceMount:H=b.forceMount,...C}=t,X=dr(Mr,t.__scopePopover);return no(d,{present:H||X.open,children:X.modal?no(pl,{...C,ref:g}):no(ml,{...C,ref:g})})},"PopoverContent")),ul=x("PopoverContent.RemoveScroll"),pl=Ut.forwardRef(Qo(function(t,g){let b=dr(Mr,t.__scopePopover),H=Ut.useRef(null),C=r(g,H),X=Ut.useRef(!1);return Ut.useEffect(()=>{let te=H.current;if(te)return le(te)},[]),no(Q,{as:ul,allowPinchZoom:!0,children:no(Ta,{...t,ref:C,trapFocus:b.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:o(t.onCloseAutoFocus,(te)=>{if(te.preventDefault(),!X.current)b.triggerRef.current?.focus()}),onPointerDownOutside:o(t.onPointerDownOutside,(te)=>{let J=te.detail.originalEvent,ee=J.button===0&&J.ctrlKey===!0,ce=J.button===2||ee;X.current=ce},{checkForDefaultPrevented:!1}),onFocusOutside:o(t.onFocusOutside,(te)=>te.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),ml=Ut.forwardRef(Qo(function(t,g){let b=dr(Mr,t.__scopePopover),H=Ut.useRef(!1),C=Ut.useRef(!1);return no(Ta,{...t,ref:g,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(X)=>{if(t.onCloseAutoFocus?.(X),!X.defaultPrevented){if(!H.current)b.triggerRef.current?.focus();X.preventDefault()}H.current=!1,C.current=!1},onInteractOutside:(X)=>{if(t.onInteractOutside?.(X),!X.defaultPrevented){if(H.current=!0,X.detail.originalEvent.type==="pointerdown")C.current=!0}let te=X.target;if(b.triggerRef.current?.contains(te))X.preventDefault();if(X.detail.originalEvent.type==="focusin"&&C.current)X.preventDefault()}})},"PopoverContentNonModal")),Ta=Ut.forwardRef(Qo(function(t,g){let{__scopePopover:b,trapFocus:H,onOpenAutoFocus:C,onCloseAutoFocus:X,disableOutsidePointerEvents:te,onEscapeKeyDown:J,onPointerDownOutside:ee,onFocusOutside:ce,onInteractOutside:W,...ge}=t,be=dr(Mr,b),Te=zr(b);return G(),no(ne,{asChild:!0,loop:!0,trapped:H,onMountAutoFocus:C,onUnmountAutoFocus:X,children:no(N,{asChild:!0,disableOutsidePointerEvents:te,onInteractOutside:W,onEscapeKeyDown:J,onPointerDownOutside:ee,onFocusOutside:ce,onDismiss:()=>be.onOpenChange(!1),deferPointerDownOutside:!0,children:no(ye,{"data-state":yn(be.open),role:"dialog",id:be.contentId,...Te,...ge,ref:g,style:{...ge.style,...{"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}})})})},"PopoverContentImpl"));function yn(m){return m?"open":"closed"}Qo(yn,"getState");var Ia=ol,_a=nl,Ea=il,ka=cl,Ma=dl;import{jsx as Dr}from"react/jsx-runtime";var R=({...m})=>Dr(Ia,{"data-slot":"popover",...m}),P=({...m})=>Dr(Ea,{"data-slot":"popover-trigger",...m}),I=({className:m,align:t="center",sideOffset:g=4,...b})=>Dr(ka,{children:Dr(Ma,{"data-slot":"popover-content",align:t,sideOffset:g,className:e("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",m),...b})}),Go=({...m})=>Dr(_a,{"data-slot":"popover-anchor",...m});import{jsx as Zt,jsxs as Io,Fragment as Da}from"react/jsx-runtime";var gl={className:void 0,disabled:!1,emptyMessage:"No option found.",hasMore:!1,loadMoreLabel:"Load more",loading:!1,loadingMessage:"Loading options...",loadingMore:!1,modal:!1,placeholder:"Select option...",searchPlaceholder:"Search...",width:"200px"},vl=48,hl=({onVisible:m})=>{let t=xo.useRef(null),g=xo.useEffectEvent(m);return xo.useEffect(()=>{let b=t.current;if(!b||!("IntersectionObserver"in globalThis))return;let H=new IntersectionObserver((C)=>{if(C.some((X)=>X.isIntersecting))H.disconnect(),g()},{root:b.closest("[cmdk-list]"),rootMargin:`0px 0px ${vl}px 0px`});return H.observe(b),()=>{H.disconnect()}},[]),Zt("div",{ref:t,"aria-hidden":!0,className:"h-px"})},mt=xo.forwardRef(function(t,g){let b={...gl,...t},{options:H,id:C,value:X,selectedLabel:te,defaultValue:J,onChange:ee,placeholder:ce,searchPlaceholder:W,emptyMessage:ge,className:be,width:Te,disabled:Ie,loading:he,loadingMessage:Ce,onSearchChange:Me,onLoadMore:Re,hasMore:Pe,loadingMore:qe,loadMoreLabel:De,modal:Ve,actionOption:nt}=b,[st,dt]=xo.useState(!1),[Ct,ft]=xo.useState(J??""),vt=X!==void 0,it=vt?X:Ct,yt=(Ge)=>{let pt=Ge===it?"":Ge;if(!vt)ft(pt);ee?.(pt),dt(!1)};return Io(R,{modal:Ve,open:st,onOpenChange:dt,children:[Zt(P,{asChild:!0,children:Io(n,{ref:g,id:C,variant:"outline","aria-expanded":st,"aria-busy":he,className:e("justify-between",be),style:{width:Te},disabled:Ie,children:[it!==void 0&&it!==""?Zt("span",{className:"min-w-0 truncate",children:H.find((Ge)=>Ge.value===it)?.label??te??it}):Zt("span",{className:"min-w-0 truncate text-muted-foreground",children:ce}),he?Zt(k,{"aria-hidden":!0,className:"ml-2 size-4 shrink-0 animate-spin text-muted-foreground"}):Zt(Fe,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),Zt(I,{className:"p-0",style:{width:"var(--radix-popover-trigger-width)"},children:Io(ae,{shouldFilter:!Me,children:[Zt(Ze,{...Me?{onValueChange:Me}:{},placeholder:W}),Zt(me,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.5rem))]",children:he?Io("div",{"aria-live":"polite",className:"flex items-center justify-center gap-2 px-3 py-6 text-sm text-muted-foreground",children:[Zt(k,{"aria-hidden":!0,className:"size-4 animate-spin"}),Ce]}):Io(Da,{children:[Zt(Je,{children:ge}),Io(Y,{children:[H.map((Ge)=>Io(A,{value:Ge.label,keywords:[Ge.label],onSelect:()=>{yt(Ge.value)},children:[Zt(f,{className:e("mr-2 h-4 w-4",it===Ge.value?"opacity-100":"opacity-0")}),Zt("span",{className:"min-w-0 truncate",title:Ge.label,children:Ge.label})]},Ge.value)),Pe&&Re&&!qe?Zt(hl,{onVisible:Re},H.length):null]}),Pe&&Re?Io(Da,{children:[Zt(Pt,{}),Zt(Y,{children:Io(A,{disabled:qe,value:De,onSelect:Re,children:[qe?Zt(k,{"aria-hidden":!0,className:"animate-spin"}):null,De]})})]}):null,nt&&H.length>0?Zt(Pt,{}):null,nt?Zt(Y,{children:Io(A,{value:nt.label,keywords:[nt.label],onSelect:()=>{yt(nt.value)},children:[nt.icon,nt.label]})}):null]})})]})})]})});mt.displayName="Combobox";import{jsx as bl}from"react/jsx-runtime";var Qe=({className:m,...t})=>bl("textarea",{"data-slot":"textarea",className:e("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",m),...t});import*as jr from"react";var xl=Object.defineProperty,Cl=(m,t)=>xl(m,"name",{value:t,configurable:!0});function ze(m){let t=jr.useRef({value:m,previous:m});return jr.useMemo(()=>{if(t.current.value!==m)t.current.previous=t.current.value,t.current.value=m;return t.current.previous},[m])}Cl(ze,"usePrevious");import*as Na from"react";import{jsx as Pl}from"react/jsx-runtime";var Rl=Object.defineProperty,yl=(m,t)=>Rl(m,"name",{value:t,configurable:!0}),Pn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wl=Na.forwardRef(yl(function(t,g){return Pl(a.span,{...t,ref:g,style:{...Pn,...t.style}})},"VisuallyHidden")),It=wl;import*as In from"react";import{jsx as wn}from"react/jsx-runtime";var Tl=Object.defineProperty,er=(m,t)=>Tl(m,"name",{value:t,configurable:!0}),Aa="Progress",_n=100,[Il,yp]=s(Aa),[_l,El]=Il(Aa),kl=In.forwardRef(er(function(t,g){let{__scopeProgress:b,value:H=null,max:C,getValueLabel:X=Oa,...te}=t;if((C||C===0)&&!Sn(C))console.error(La(`${C}`,"Progress"));let J=Sn(C)?C:_n;if(H!==null&&!Tn(H,J))console.error(Ga(`${H}`,"Progress"));let ee=Tn(H,J)?H:null,ce=Nr(ee)?X(ee,J):void 0;return wn(_l,{scope:b,value:ee,max:J,children:wn(a.div,{"aria-valuemax":J,"aria-valuemin":0,"aria-valuenow":Nr(ee)?ee:void 0,"aria-valuetext":ce,role:"progressbar","data-state":En(ee,J),"data-value":ee??void 0,"data-max":J,...te,ref:g})})},"Progress")),Ml="ProgressIndicator",Dl=In.forwardRef(er(function(t,g){let{__scopeProgress:b,...H}=t,C=El(Ml,b);return wn(a.div,{"data-state":En(C.value,C.max),"data-value":C.value??void 0,"data-max":C.max,...H,ref:g})},"ProgressIndicator"));function Oa(m,t){return`${Math.round(m/t*100)}%`}er(Oa,"defaultGetValueLabel");function En(m,t){return m==null?"indeterminate":m===t?"complete":"loading"}er(En,"getProgressState");function Nr(m){return typeof m==="number"}er(Nr,"isNumber");function Sn(m){return Nr(m)&&!isNaN(m)&&m>0}er(Sn,"isValidMaxNumber");function Tn(m,t){return Nr(m)&&!isNaN(m)&&m<=t&&m>=0}er(Tn,"isValidValueNumber");function La(m,t){return`Invalid prop \`max\` of value \`${m}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${_n}\`.`}er(La,"getInvalidMaxError");function Ga(m,t){return`Invalid prop \`value\` of value \`${m}\` supplied to \`${t}\`. The \`value\` prop must be:
2
2
  - a positive number
3
3
  - less than the value passed to \`max\` (or ${_n} if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.
@@ -1,2 +1,2 @@
1
- import{r,x,o,s,a,N,co,G,ne,l,c,U,d,i,le,Q}from"./index-87bxrmfq.js";import{C}from"./index-9nkdbb33.js";import{e}from"./index-x6g6brsv.js";import*as P from"react";import{Fragment as go,jsx as R}from"react/jsx-runtime";var so=Object.defineProperty,h=(f,t)=>so(f,"name",{value:t,configurable:!0}),k="Dialog",[K,ao]=s(k),[fo,I]=K(k),_=h((f)=>{let{__scopeDialog:t,children:m,open:u,defaultOpen:v,onOpenChange:p,modal:n=!0}=f,y=P.useRef(null),w=P.useRef(null),[W,A]=i({prop:u,defaultProp:v??!1,onChange:p,caller:k}),[to,eo]=P.useState(0),[io,no]=P.useState(0);return R(fo,{scope:t,triggerRef:y,contentRef:w,contentId:c(),titleId:c(),descriptionId:c(),titlePresent:to>0,descriptionPresent:io>0,setTitleCount:eo,setDescriptionCount:no,open:W,onOpenChange:A,onOpenToggle:P.useCallback(()=>A((lo)=>!lo),[A]),modal:n,children:m})},"Dialog"),po="DialogTrigger",ge=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(po,u),n=r(m,p.triggerRef);return R(a.button,{type:"button","aria-haspopup":"dialog","aria-expanded":p.open,"aria-controls":p.open?p.contentId:void 0,"data-state":S(p.open),...v,ref:n,onClick:o(t.onClick,p.onOpenToggle)})},"DialogTrigger")),X="DialogPortal",[uo,Y]=K(X,{forceMount:void 0}),F=h((f)=>{let{__scopeDialog:t,forceMount:m,children:u,container:v}=f,p=I(X,t);return R(uo,{scope:t,forceMount:m,children:P.Children.map(u,(n)=>R(d,{present:m||p.open,children:R(U,{asChild:!0,container:v,children:n})}))})},"DialogPortal"),L="DialogOverlay",B=P.forwardRef(h(function(t,m){let u=Y(L,t.__scopeDialog),{forceMount:v=u.forceMount,...p}=t,n=I(L,t.__scopeDialog);return n.modal?R(d,{present:v||n.open,children:R(Do,{...p,ref:m})}):null},"DialogOverlay")),mo=x("DialogOverlay.RemoveScroll"),Do=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(L,u),n=co(),y=r(m,n);return R(Q,{as:mo,allowPinchZoom:!0,shards:[p.contentRef],children:R(a.div,{"data-state":S(p.open),...v,ref:y,style:{pointerEvents:"auto",...v.style}})})},"DialogOverlayImpl")),E="DialogContent",z=P.forwardRef(h(function(t,m){let u=Y(E,t.__scopeDialog),{forceMount:v=u.forceMount,...p}=t,n=I(E,t.__scopeDialog);return R(d,{present:v||n.open,children:n.modal?R(vo,{...p,ref:m}):R(Po,{...p,ref:m})})},"DialogContent")),vo=P.forwardRef(h(function(t,m){let u=I(E,t.__scopeDialog),v=P.useRef(null),p=r(m,u.contentRef,v);return P.useEffect(()=>{let n=v.current;if(n)return le(n)},[]),R(q,{...t,ref:p,trapFocus:u.open,disableOutsidePointerEvents:u.open,onCloseAutoFocus:o(t.onCloseAutoFocus,(n)=>{n.preventDefault(),u.triggerRef.current?.focus()}),onPointerDownOutside:o(t.onPointerDownOutside,(n)=>{let y=n.detail.originalEvent,w=y.button===0&&y.ctrlKey===!0;if(y.button===2||w)n.preventDefault()}),onFocusOutside:o(t.onFocusOutside,(n)=>n.preventDefault())})},"DialogContentModal")),Po=P.forwardRef(h(function(t,m){let u=I(E,t.__scopeDialog),v=P.useRef(!1),p=P.useRef(!1);return R(q,{...t,ref:m,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(n)=>{if(t.onCloseAutoFocus?.(n),!n.defaultPrevented){if(!v.current)u.triggerRef.current?.focus();n.preventDefault()}v.current=!1,p.current=!1},onInteractOutside:(n)=>{if(t.onInteractOutside?.(n),!n.defaultPrevented){if(v.current=!0,n.detail.originalEvent.type==="pointerdown")p.current=!0}let y=n.target;if(u.triggerRef.current?.contains(y))n.preventDefault();if(n.detail.originalEvent.type==="focusin"&&p.current)n.preventDefault()}})},"DialogContentNonModal")),q=P.forwardRef(h(function(t,m){let{__scopeDialog:u,trapFocus:v,onOpenAutoFocus:p,onCloseAutoFocus:n,...y}=t,w=I(E,u);return G(),R(go,{children:R(ne,{asChild:!0,loop:!0,trapped:v,onMountAutoFocus:p,onUnmountAutoFocus:n,children:R(N,{role:"dialog",id:w.contentId,"aria-describedby":w.descriptionPresent?w.descriptionId:void 0,"aria-labelledby":w.titlePresent?w.titleId:void 0,"data-state":S(w.open),...y,ref:m,deferPointerDownOutside:!0,onDismiss:()=>w.onOpenChange(!1)})})})},"DialogContentImpl")),Ro="DialogTitle",he=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(Ro,u),{setTitleCount:n}=p;return l(()=>(n((y)=>y+1),()=>n((y)=>y-1)),[n]),R(a.h2,{id:p.titleId,...v,ref:m})},"DialogTitle")),Co="DialogDescription",ve=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(Co,u),{setDescriptionCount:n}=p;return l(()=>(n((y)=>y+1),()=>n((y)=>y-1)),[n]),R(a.p,{id:p.descriptionId,...v,ref:m})},"DialogDescription")),bo="DialogClose",H=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(bo,u);return R(a.button,{type:"button",...v,ref:m,onClick:o(t.onClick,()=>p.onOpenChange(!1))})},"DialogClose"));function S(f){return f?"open":"closed"}h(S,"getState");import{jsx as O,jsxs as j}from"react/jsx-runtime";var M=({...f})=>O(_,{"data-slot":"dialog",...f}),ma=({...f})=>O(ge,{"data-slot":"dialog-trigger",...f}),Yo=({...f})=>O(F,{"data-slot":"dialog-portal",...f}),ga=({...f})=>O(H,{"data-slot":"dialog-close",...f}),Ko=({className:f,...t})=>O(B,{"data-slot":"dialog-overlay",className:e("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-50 bg-black/50",f),...t}),_o={lg:"sm:max-w-2xl",md:"sm:max-w-lg",xl:"sm:max-w-4xl"},yo={content:"",viewport:"max-h-[calc(100vh-2rem)]"},D=({className:f,children:t,fixedBottom:m=!1,height:u="viewport",size:v="md",showCloseButton:p=!0,...n})=>j(Yo,{"data-slot":"dialog-portal",children:[O(Ko,{}),j(z,{"data-slot":"dialog-content",className:e("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-[50%] z-50 flex flex-col w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200",_o[v],yo[u],m&&"[&_[data-slot=dialog-footer]]:sticky [&_[data-slot=dialog-footer]]:bottom-0 [&_[data-slot=dialog-footer]]:z-10 [&_[data-slot=dialog-footer]]:-mx-6 [&_[data-slot=dialog-footer]]:border-t [&_[data-slot=dialog-footer]]:bg-background [&_[data-slot=dialog-footer]]:px-6 [&_[data-slot=dialog-footer]]:py-4 [&_[data-slot=form-actions]]:sticky [&_[data-slot=form-actions]]:bottom-0 [&_[data-slot=form-actions]]:z-10 [&_[data-slot=form-actions]]:-mx-6 [&_[data-slot=form-actions]]:border-t [&_[data-slot=form-actions]]:bg-background [&_[data-slot=form-actions]]:px-6 [&_[data-slot=form-actions]]:py-4",f),...n,children:[t,p?j(H,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-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:[O(C,{}),O("span",{className:"sr-only",children:"Close"})]}):null]})]}),ha=({className:f,...t})=>O("div",{"data-slot":"dialog-body",className:e("flex-1 min-h-0 flex flex-col",f),...t}),V=({className:f,...t})=>O("div",{"data-slot":"dialog-header",className:e("flex flex-col gap-2 text-center sm:text-left",f),...t}),ro=({className:f,...t})=>O("div",{"data-slot":"dialog-footer",className:e("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",f),...t}),T=({className:f,...t})=>O(he,{"data-slot":"dialog-title",className:e("text-lg leading-none font-semibold",f),...t}),Z=({className:f,...t})=>O(ve,{"data-slot":"dialog-description",className:e("text-muted-foreground text-sm",f),...t});import{jsx as ho}from"react/jsx-runtime";var g=({className:f,type:t,...m})=>ho("input",{type:t,"data-slot":"input",className:e("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",f),...m});import*as J from"react";import{jsx as Io}from"react/jsx-runtime";var Oo=Object.defineProperty,wo=(f,t)=>Oo(f,"name",{value:t,configurable:!0}),To=J.forwardRef(wo(function(t,m){return Io(a.label,{...t,ref:m,onMouseDown:(u)=>{if(u.target.closest("button, input, select, textarea"))return;if(t.onMouseDown?.(u),!u.defaultPrevented&&u.detail>1)u.preventDefault()}})},"Label")),oo=To;import{jsx as No}from"react/jsx-runtime";var b=({className:f,...t})=>No(oo,{"data-slot":"label",className:e("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",f),...t});
1
+ import{r,x,o,s,a,N,co,G,ne,l,c,U,d,i,le,Q}from"./index-87bxrmfq.js";import{C}from"./index-9nkdbb33.js";import{e}from"./index-x6g6brsv.js";import*as P from"react";import{Fragment as go,jsx as R}from"react/jsx-runtime";var so=Object.defineProperty,h=(f,t)=>so(f,"name",{value:t,configurable:!0}),k="Dialog",[K,ao]=s(k),[fo,I]=K(k),_=h((f)=>{let{__scopeDialog:t,children:m,open:u,defaultOpen:v,onOpenChange:p,modal:n=!0}=f,y=P.useRef(null),w=P.useRef(null),[W,A]=i({prop:u,defaultProp:v??!1,onChange:p,caller:k}),[to,eo]=P.useState(0),[io,no]=P.useState(0);return R(fo,{scope:t,triggerRef:y,contentRef:w,contentId:c(),titleId:c(),descriptionId:c(),titlePresent:to>0,descriptionPresent:io>0,setTitleCount:eo,setDescriptionCount:no,open:W,onOpenChange:A,onOpenToggle:P.useCallback(()=>A((lo)=>!lo),[A]),modal:n,children:m})},"Dialog"),po="DialogTrigger",ge=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(po,u),n=r(m,p.triggerRef);return R(a.button,{type:"button","aria-haspopup":"dialog","aria-expanded":p.open,"aria-controls":p.open?p.contentId:void 0,"data-state":S(p.open),...v,ref:n,onClick:o(t.onClick,p.onOpenToggle)})},"DialogTrigger")),X="DialogPortal",[uo,Y]=K(X,{forceMount:void 0}),F=h((f)=>{let{__scopeDialog:t,forceMount:m,children:u,container:v}=f,p=I(X,t);return R(uo,{scope:t,forceMount:m,children:P.Children.map(u,(n)=>R(d,{present:m||p.open,children:R(U,{asChild:!0,container:v,children:n})}))})},"DialogPortal"),L="DialogOverlay",B=P.forwardRef(h(function(t,m){let u=Y(L,t.__scopeDialog),{forceMount:v=u.forceMount,...p}=t,n=I(L,t.__scopeDialog);return n.modal?R(d,{present:v||n.open,children:R(Do,{...p,ref:m})}):null},"DialogOverlay")),mo=x("DialogOverlay.RemoveScroll"),Do=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(L,u),n=co(),y=r(m,n);return R(Q,{as:mo,allowPinchZoom:!0,shards:[p.contentRef],children:R(a.div,{"data-state":S(p.open),...v,ref:y,style:{pointerEvents:"auto",...v.style}})})},"DialogOverlayImpl")),E="DialogContent",z=P.forwardRef(h(function(t,m){let u=Y(E,t.__scopeDialog),{forceMount:v=u.forceMount,...p}=t,n=I(E,t.__scopeDialog);return R(d,{present:v||n.open,children:n.modal?R(vo,{...p,ref:m}):R(Po,{...p,ref:m})})},"DialogContent")),vo=P.forwardRef(h(function(t,m){let u=I(E,t.__scopeDialog),v=P.useRef(null),p=r(m,u.contentRef,v);return P.useEffect(()=>{let n=v.current;if(n)return le(n)},[]),R(q,{...t,ref:p,trapFocus:u.open,disableOutsidePointerEvents:u.open,onCloseAutoFocus:o(t.onCloseAutoFocus,(n)=>{n.preventDefault(),u.triggerRef.current?.focus()}),onPointerDownOutside:o(t.onPointerDownOutside,(n)=>{let y=n.detail.originalEvent,w=y.button===0&&y.ctrlKey===!0;if(y.button===2||w)n.preventDefault()}),onFocusOutside:o(t.onFocusOutside,(n)=>n.preventDefault())})},"DialogContentModal")),Po=P.forwardRef(h(function(t,m){let u=I(E,t.__scopeDialog),v=P.useRef(!1),p=P.useRef(!1);return R(q,{...t,ref:m,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(n)=>{if(t.onCloseAutoFocus?.(n),!n.defaultPrevented){if(!v.current)u.triggerRef.current?.focus();n.preventDefault()}v.current=!1,p.current=!1},onInteractOutside:(n)=>{if(t.onInteractOutside?.(n),!n.defaultPrevented){if(v.current=!0,n.detail.originalEvent.type==="pointerdown")p.current=!0}let y=n.target;if(u.triggerRef.current?.contains(y))n.preventDefault();if(n.detail.originalEvent.type==="focusin"&&p.current)n.preventDefault()}})},"DialogContentNonModal")),q=P.forwardRef(h(function(t,m){let{__scopeDialog:u,trapFocus:v,onOpenAutoFocus:p,onCloseAutoFocus:n,...y}=t,w=I(E,u);return G(),R(go,{children:R(ne,{asChild:!0,loop:!0,trapped:v,onMountAutoFocus:p,onUnmountAutoFocus:n,children:R(N,{role:"dialog",id:w.contentId,"aria-describedby":w.descriptionPresent?w.descriptionId:void 0,"aria-labelledby":w.titlePresent?w.titleId:void 0,"data-state":S(w.open),...y,ref:m,deferPointerDownOutside:!0,onDismiss:()=>w.onOpenChange(!1)})})})},"DialogContentImpl")),Ro="DialogTitle",he=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(Ro,u),{setTitleCount:n}=p;return l(()=>(n((y)=>y+1),()=>n((y)=>y-1)),[n]),R(a.h2,{id:p.titleId,...v,ref:m})},"DialogTitle")),Co="DialogDescription",ve=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(Co,u),{setDescriptionCount:n}=p;return l(()=>(n((y)=>y+1),()=>n((y)=>y-1)),[n]),R(a.p,{id:p.descriptionId,...v,ref:m})},"DialogDescription")),bo="DialogClose",H=P.forwardRef(h(function(t,m){let{__scopeDialog:u,...v}=t,p=I(bo,u);return R(a.button,{type:"button",...v,ref:m,onClick:o(t.onClick,()=>p.onOpenChange(!1))})},"DialogClose"));function S(f){return f?"open":"closed"}h(S,"getState");import{jsx as O,jsxs as j}from"react/jsx-runtime";var M=({...f})=>O(_,{"data-slot":"dialog",...f}),ma=({...f})=>O(ge,{"data-slot":"dialog-trigger",...f}),Yo=({...f})=>O(F,{"data-slot":"dialog-portal",...f}),ga=({...f})=>O(H,{"data-slot":"dialog-close",...f}),Ko=({className:f,...t})=>O(B,{"data-slot":"dialog-overlay",className:e("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-50 bg-black/50",f),...t}),_o={lg:"sm:max-w-2xl",md:"sm:max-w-lg",xl:"sm:max-w-4xl"},yo={content:"",viewport:"max-h-[calc(100vh-2rem)]"},D=({className:f,children:t,fixedBottom:m=!1,height:u="viewport",size:v="md",showCloseButton:p=!0,...n})=>j(Yo,{"data-slot":"dialog-portal",children:[O(Ko,{}),j(z,{"data-slot":"dialog-content",className:e("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-[50%] z-50 flex flex-col w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg outline-hidden duration-200",_o[v],yo[u],m&&"[&_[data-slot=dialog-footer]]:sticky [&_[data-slot=dialog-footer]]:bottom-0 [&_[data-slot=dialog-footer]]:z-10 [&_[data-slot=dialog-footer]]:-mx-6 [&_[data-slot=dialog-footer]]:border-t [&_[data-slot=dialog-footer]]:bg-background [&_[data-slot=dialog-footer]]:px-6 [&_[data-slot=dialog-footer]]:py-4 [&_[data-slot=form-actions]]:sticky [&_[data-slot=form-actions]]:bottom-0 [&_[data-slot=form-actions]]:z-10 [&_[data-slot=form-actions]]:-mx-6 [&_[data-slot=form-actions]]:border-t [&_[data-slot=form-actions]]:bg-background [&_[data-slot=form-actions]]:px-6 [&_[data-slot=form-actions]]:py-4",f),...n,children:[t,p?j(H,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-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:[O(C,{}),O("span",{className:"sr-only",children:"Close"})]}):null]})]}),ha=({className:f,...t})=>O("div",{"data-slot":"dialog-body",className:e("flex-1 min-h-0 flex flex-col",f),...t}),V=({className:f,...t})=>O("div",{"data-slot":"dialog-header",className:e("flex flex-col gap-2 text-center sm:text-left",f),...t}),ro=({className:f,...t})=>O("div",{"data-slot":"dialog-footer",className:e("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",f),...t}),T=({className:f,...t})=>O(he,{"data-slot":"dialog-title",className:e("text-lg leading-none font-semibold",f),...t}),Z=({className:f,...t})=>O(ve,{"data-slot":"dialog-description",className:e("text-muted-foreground text-sm",f),...t});import{jsx as ho}from"react/jsx-runtime";var g=({className:f,type:t,...m})=>ho("input",{type:t,"data-slot":"input",className:e("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",f),...m});import*as J from"react";import{jsx as Io}from"react/jsx-runtime";var Oo=Object.defineProperty,wo=(f,t)=>Oo(f,"name",{value:t,configurable:!0}),To=J.forwardRef(wo(function(t,m){return Io(a.label,{...t,ref:m,onMouseDown:(u)=>{if(u.target.closest("button, input, select, textarea"))return;if(t.onMouseDown?.(u),!u.defaultPrevented&&u.detail>1)u.preventDefault()}})},"Label")),oo=To;import{jsx as No}from"react/jsx-runtime";var b=({className:f,...t})=>No(oo,{"data-slot":"label",className:e("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",f),...t});
2
2
  export{ao,_,ge,F,B,z,he,ve,H,M,ma,Yo,ga,Ko,D,ha,V,ro,T,Z,g,b};
package/dist/resources.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{m}from"./index-s7dyqth2.js";import{n}from"./index-87bxrmfq.js";import{pt,jt,$t,Yt,Kt,Xt,Ue,Zt,Jt,Qt,eo,qe,wt,je,to}from"./index-rgye3pe5.js";import{M,D,T,Z,g,b}from"./index-7gzq3np4.js";import"./index-1kd3e9cz.js";import{v}from"./index-9nkdbb33.js";var L={};pt(L,{ResourceActionPrimitive:()=>G,ResourceDialogPrimitive:()=>J,ResourceFilterPrimitive:()=>W,ResourceFiltersBar:()=>Y,ResourceFormPrimitive:()=>Q,ResourceListPrimitive:()=>z,ResourcePaginationPrimitive:()=>K,ResourceTablePrimitive:()=>q});import{Fragment as _,useId as j}from"react";import{jsx as t,jsxs as P}from"react/jsx-runtime";var k=(...e)=>e.filter(Boolean).join(" "),oe={border:"1px solid currentColor",borderRadius:"0.5rem",padding:"0.75rem"},q=({caption:e,className:i,columns:r,empty:l="No resources found",getRowKey:s,onRowClick:o,renderActions:u,actionsLabel:d="Actions",stickyActions:a=!0,isPending:c=!1,isRowSelected:C,isRowExpanded:S,onExpandedChange:x,renderDetails:h,renderContextMenu:p,renderCell:w,rows:A,style:ee})=>{let I=u!==void 0||h!==void 0,V=a?"sticky right-0 z-10 shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":"";return P(Jt,{className:k("ci-resource-table",i),style:{borderCollapse:"collapse",width:"100%",...ee},children:[e?t(to,{children:e}):null,t(Qt,{children:P(qe,{children:[r.map((R)=>t(wt,{scope:"col",children:R.label},R.id)),I?t(wt,{className:V,children:t("span",{className:"sr-only",children:d})}):null]})}),t(eo,{children:A.length===0?t(qe,{children:t(je,{className:"py-10",colSpan:Math.max(r.length+(I?1:0),1),children:l})}):A.map((R)=>{let F=S?.(R)??!1,O=h?.(R,F),E=!!O,H=P(qe,{"data-state":C?.(R)?"selected":void 0,tabIndex:o?0:void 0,className:o?"cursor-pointer":void 0,onKeyDown:(y)=>{if(y.target===y.currentTarget&&(y.key==="Enter"||y.key===" "))y.preventDefault(),o?.(R)},onClick:(y)=>{if(y.target instanceof Element&&y.target.closest("[data-slot='row-actions']"))return;o?.(R)},children:[r.map((y)=>t(je,{children:w(R,y)},y.id)),I?P(je,{"data-slot":"row-actions",className:`flex gap-2 justify-end ${V}`,children:[u?.(R),E&&x?t(n,{type:"button",variant:"ghost",size:"icon","aria-label":F?"Collapse":"Expand","aria-expanded":F,disabled:c,onClick:()=>x(R,!F),children:F?t(v,{}):t(m,{})}):null]}):null]},s(R));return P(_,{children:[p?P(jt,{children:[t($t,{asChild:!0,children:H}),t(Yt,{children:p(R)})]}):H,E&&F?t(qe,{className:"hover:bg-transparent",children:t(je,{colSpan:r.length+(I?1:0),children:O})}):null]},s(R))})})]})},z=({ariaLabel:e="Resources",className:i,empty:r="No resources found",getItemKey:l,items:s,renderItem:o,renderContainer:u,style:d})=>u?u(s.length===0?r:s.map((a,c)=>t(_,{children:o(a,c)},l(a)))):t("ul",{"aria-label":e,className:k("ci-resource-list",i),style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"none",...d},children:s.length===0?t("li",{children:r}):s.map((a,c)=>t("li",{children:o(a,c)},l(a)))}),W=({className:e,inputProps:i,label:r,onChange:l,style:s,value:o})=>t(g,{...i,"aria-label":r,className:k("ci-resource-filter",e),onChange:(u)=>{l(u.currentTarget.value)},style:s,type:"search",value:o}),re=(e,i)=>{if(i<=7)return Array.from({length:i},(s,o)=>o+1);let r=Math.max(2,Math.min(e-1,i-3)),l=Math.min(i-1,Math.max(e+1,4));return[1,...r>2?[null]:[],...Array.from({length:l-r+1},(s,o)=>r+o),...l<i-1?[null]:[],i]},K=({className:e,currentPage:i,hasNextPage:r,hasPreviousPage:l=!1,isPending:s=!1,navigationLabel:o="Resource pagination",nextLabel:u="Next",onNext:d,onPrevious:a,onPageChange:c,totalPages:C,ellipsisLabel:S="More pages",previousLabel:x="Previous",style:h})=>t(Kt,{"aria-label":o,className:k("ci-resource-pagination",e),style:h,children:P(Xt,{children:[t(Ue,{children:t(n,{variant:"ghost",disabled:!l||s,onClick:a,type:"button",children:x})}),i!==void 0&&C!==void 0&&c?re(i,C).map((p,w)=>t(Ue,{children:p===null?t(Zt,{"aria-label":S}):t(n,{type:"button",size:"icon",variant:p===i?"outline":"ghost","aria-current":p===i?"page":void 0,disabled:s,onClick:()=>c(p),children:p})},p??`gap-${w}`)):null,i!==void 0&&(C===void 0||!c)?t(Ue,{children:P("span",{"aria-live":"polite",children:["Page ",i]})}):null,t(Ue,{children:t(n,{variant:"ghost",disabled:!r||s,onClick:d,type:"button",children:u})})]})}),G=({children:e,className:i,components:r,disabled:l=!1,onClick:s,pending:o=!1,style:u})=>{let d=r?.Button??n;return t(d,{"aria-busy":o,className:k("ci-resource-action",i),disabled:l||o,onClick:s,style:u,type:"button",children:e})},J=({children:e,className:i,components:r,open:l,onOpenChange:s,description:o,style:u,title:d})=>{let a=j(),c=j();if(!r?.Dialog)return t(M,{open:l,...s?{onOpenChange:s}:{},children:P(D,{className:i,style:u,"aria-describedby":o?c:void 0,children:[t(T,{children:d}),o?t(Z,{id:c,children:o}):null,e]})});if(!l)return null;let C=r.Dialog;return P(C,{open:l,"aria-labelledby":a,"aria-modal":"true",className:k("ci-resource-dialog",i),style:{...oe,...u},children:[t("h2",{id:a,children:d}),e]})};import{useId as te}from"react";import{jsx as f,jsxs as N}from"react/jsx-runtime";var ie=(e)=>e===null||e===void 0?"":String(e),ae=({field:e,id:i,value:r,disabled:l,errorId:s,onChange:o})=>{let u={"aria-describedby":s,"aria-invalid":s!==void 0,disabled:l,id:i,name:e.name,required:e.control!=="checkbox"&&e.required===!0&&r!==null};if(e.control==="select"){let d=e.options??[];return N("select",{...u,disabled:l||e.readOnly,className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm focus-visible:ring-ring focus-visible:ring-2",value:d.findIndex((a)=>a.value===r),onChange:(a)=>{let c=d[Number(a.currentTarget.value)];if(c)o(c.value)},children:[N("option",{value:-1,disabled:!0,children:["Select ",e.label]}),d.map((a,c)=>f("option",{value:c,children:a.label},c))]})}if(e.control==="checkbox")return f(g,{...u,className:"size-4",type:"checkbox",checked:r===!0,disabled:l||e.readOnly,onChange:(d)=>o(d.currentTarget.checked)});if(e.control==="custom")return N("p",{role:"alert",children:["A custom control is required for ",e.label,"."]});return f(g,{...u,readOnly:e.readOnly,type:e.control,value:ie(r),onChange:(d)=>{let a=d.currentTarget;o(e.control==="number"&&a.value!==""?a.valueAsNumber:a.value)}})},ne=({field:e,value:i,error:r,disabled:l,onChange:s,renderControl:o})=>{let u=te(),d=r?`${u}-error`:void 0,a={disabled:l,errorId:d,field:e,id:u,onChange:(c)=>{if(!l&&!e.readOnly)s(c)},value:i};return N("div",{className:"grid gap-2",children:[N(b,{htmlFor:u,children:[e.label,e.required?" *":""]}),e.control==="custom"&&o?o(a):f(ae,{...a}),e.nullable?f(n,{"aria-label":`Clear ${e.label}`,type:"button",variant:"ghost",size:"sm",className:"justify-self-start",disabled:l||e.readOnly||i===null,onClick:()=>s(null),children:"Clear"}):null,r?f("p",{id:d,role:"alert",className:"text-destructive text-sm",children:r}):null]})},Q=({label:e,fields:i,values:r,errors:l,onChange:s,onSubmit:o,onCancel:u,renderControl:d,pending:a=!1,disabled:c=!1,submitLabel:C="Save",cancelLabel:S="Cancel",error:x,className:h})=>N("form",{"aria-label":e,"aria-busy":a,className:h??"grid gap-4",onSubmit:(p)=>{if(p.preventDefault(),!a&&!c)o()},children:[x?f("div",{role:"alert",className:"text-destructive text-sm",children:x}):null,i.map((p)=>f(ne,{field:p,value:r[p.name],error:l?.[p.name],disabled:c||a,onChange:(w)=>s(p.name,w),renderControl:d},p.name)),N("div",{"data-slot":"form-actions",className:"flex justify-end gap-2",children:[u?f(n,{type:"button",variant:"outline",disabled:a,onClick:u,children:S}):null,f(n,{type:"submit",disabled:c||a,children:C})]})]});import{jsx as B,jsxs as X,Fragment as le}from"react/jsx-runtime";var U=(e)=>B("div",{className:"contents",children:e.control},e.key),Y=({label:e="Filter by",layout:i="stacked",controls:r})=>{if(r.length===0)return null;let l=r.filter((o)=>!o.fullWidth),s=r.filter((o)=>o.fullWidth);return B("div",{className:"mb-4",children:i==="inline"?B("form",{className:"flex flex-wrap items-end gap-2",onSubmit:(o)=>o.preventDefault(),children:r.map(U)}):X(le,{children:[l.length>0?X("form",{className:"flex flex-wrap gap-2 mb-2",onSubmit:(o)=>o.preventDefault(),children:[B(b,{className:"mt-3 mr-2",children:e}),l.map(U)]}):null,s.map((o)=>B("form",{className:"mb-2 last:mb-0",onSubmit:(u)=>u.preventDefault(),children:o.control},o.key))]})})};var{ResourceActionPrimitive:we,ResourceDialogPrimitive:Be,ResourceFilterPrimitive:Ie,ResourceFormPrimitive:Le,ResourceFiltersBar:Ae,ResourceListPrimitive:Me,ResourcePaginationPrimitive:Ve,ResourceTablePrimitive:Oe}=L;export{we as ResourceActionPrimitive,Be as ResourceDialogPrimitive,Ie as ResourceFilterPrimitive,Ae as ResourceFiltersBar,Le as ResourceFormPrimitive,Me as ResourceListPrimitive,Ve as ResourcePaginationPrimitive,Oe as ResourceTablePrimitive};
2
+ import{m}from"./index-s7dyqth2.js";import{n}from"./index-87bxrmfq.js";import{pt,jt,$t,Yt,Kt,Xt,Ue,Zt,Jt,Qt,eo,qe,wt,je,to}from"./index-rgye3pe5.js";import{M,D,T,Z,g,b}from"./index-z3yjnfyn.js";import"./index-1kd3e9cz.js";import{v}from"./index-9nkdbb33.js";var L={};pt(L,{ResourceActionPrimitive:()=>G,ResourceDialogPrimitive:()=>J,ResourceFilterPrimitive:()=>W,ResourceFiltersBar:()=>Y,ResourceFormPrimitive:()=>Q,ResourceListPrimitive:()=>z,ResourcePaginationPrimitive:()=>K,ResourceTablePrimitive:()=>q});import{Fragment as _,useId as j}from"react";import{jsx as t,jsxs as P}from"react/jsx-runtime";var k=(...e)=>e.filter(Boolean).join(" "),oe={border:"1px solid currentColor",borderRadius:"0.5rem",padding:"0.75rem"},q=({caption:e,className:i,columns:r,empty:l="No resources found",getRowKey:s,onRowClick:o,renderActions:u,actionsLabel:d="Actions",stickyActions:a=!0,isPending:c=!1,isRowSelected:C,isRowExpanded:S,onExpandedChange:x,renderDetails:h,renderContextMenu:p,renderCell:w,rows:A,style:ee})=>{let I=u!==void 0||h!==void 0,V=a?"sticky right-0 z-10 shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":"";return P(Jt,{className:k("ci-resource-table",i),style:{borderCollapse:"collapse",width:"100%",...ee},children:[e?t(to,{children:e}):null,t(Qt,{children:P(qe,{children:[r.map((R)=>t(wt,{scope:"col",children:R.label},R.id)),I?t(wt,{className:V,children:t("span",{className:"sr-only",children:d})}):null]})}),t(eo,{children:A.length===0?t(qe,{children:t(je,{className:"py-10",colSpan:Math.max(r.length+(I?1:0),1),children:l})}):A.map((R)=>{let F=S?.(R)??!1,O=h?.(R,F),E=!!O,H=P(qe,{"data-state":C?.(R)?"selected":void 0,tabIndex:o?0:void 0,className:o?"cursor-pointer":void 0,onKeyDown:(y)=>{if(y.target===y.currentTarget&&(y.key==="Enter"||y.key===" "))y.preventDefault(),o?.(R)},onClick:(y)=>{if(y.target instanceof Element&&y.target.closest("[data-slot='row-actions']"))return;o?.(R)},children:[r.map((y)=>t(je,{children:w(R,y)},y.id)),I?P(je,{"data-slot":"row-actions",className:`flex gap-2 justify-end ${V}`,children:[u?.(R),E&&x?t(n,{type:"button",variant:"ghost",size:"icon","aria-label":F?"Collapse":"Expand","aria-expanded":F,disabled:c,onClick:()=>x(R,!F),children:F?t(v,{}):t(m,{})}):null]}):null]},s(R));return P(_,{children:[p?P(jt,{children:[t($t,{asChild:!0,children:H}),t(Yt,{children:p(R)})]}):H,E&&F?t(qe,{className:"hover:bg-transparent",children:t(je,{colSpan:r.length+(I?1:0),children:O})}):null]},s(R))})})]})},z=({ariaLabel:e="Resources",className:i,empty:r="No resources found",getItemKey:l,items:s,renderItem:o,renderContainer:u,style:d})=>u?u(s.length===0?r:s.map((a,c)=>t(_,{children:o(a,c)},l(a)))):t("ul",{"aria-label":e,className:k("ci-resource-list",i),style:{display:"flex",flexDirection:"column",gap:"1rem",listStyle:"none",...d},children:s.length===0?t("li",{children:r}):s.map((a,c)=>t("li",{children:o(a,c)},l(a)))}),W=({className:e,inputProps:i,label:r,onChange:l,style:s,value:o})=>t(g,{...i,"aria-label":r,className:k("ci-resource-filter",e),onChange:(u)=>{l(u.currentTarget.value)},style:s,type:"search",value:o}),re=(e,i)=>{if(i<=7)return Array.from({length:i},(s,o)=>o+1);let r=Math.max(2,Math.min(e-1,i-3)),l=Math.min(i-1,Math.max(e+1,4));return[1,...r>2?[null]:[],...Array.from({length:l-r+1},(s,o)=>r+o),...l<i-1?[null]:[],i]},K=({className:e,currentPage:i,hasNextPage:r,hasPreviousPage:l=!1,isPending:s=!1,navigationLabel:o="Resource pagination",nextLabel:u="Next",onNext:d,onPrevious:a,onPageChange:c,totalPages:C,ellipsisLabel:S="More pages",previousLabel:x="Previous",style:h})=>t(Kt,{"aria-label":o,className:k("ci-resource-pagination",e),style:h,children:P(Xt,{children:[t(Ue,{children:t(n,{variant:"ghost",disabled:!l||s,onClick:a,type:"button",children:x})}),i!==void 0&&C!==void 0&&c?re(i,C).map((p,w)=>t(Ue,{children:p===null?t(Zt,{"aria-label":S}):t(n,{type:"button",size:"icon",variant:p===i?"outline":"ghost","aria-current":p===i?"page":void 0,disabled:s,onClick:()=>c(p),children:p})},p??`gap-${w}`)):null,i!==void 0&&(C===void 0||!c)?t(Ue,{children:P("span",{"aria-live":"polite",children:["Page ",i]})}):null,t(Ue,{children:t(n,{variant:"ghost",disabled:!r||s,onClick:d,type:"button",children:u})})]})}),G=({children:e,className:i,components:r,disabled:l=!1,onClick:s,pending:o=!1,style:u})=>{let d=r?.Button??n;return t(d,{"aria-busy":o,className:k("ci-resource-action",i),disabled:l||o,onClick:s,style:u,type:"button",children:e})},J=({children:e,className:i,components:r,open:l,onOpenChange:s,description:o,style:u,title:d})=>{let a=j(),c=j();if(!r?.Dialog)return t(M,{open:l,...s?{onOpenChange:s}:{},children:P(D,{className:i,style:u,"aria-describedby":o?c:void 0,children:[t(T,{children:d}),o?t(Z,{id:c,children:o}):null,e]})});if(!l)return null;let C=r.Dialog;return P(C,{open:l,"aria-labelledby":a,"aria-modal":"true",className:k("ci-resource-dialog",i),style:{...oe,...u},children:[t("h2",{id:a,children:d}),e]})};import{useId as te}from"react";import{jsx as f,jsxs as N}from"react/jsx-runtime";var ie=(e)=>e===null||e===void 0?"":String(e),ae=({field:e,id:i,value:r,disabled:l,errorId:s,onChange:o})=>{let u={"aria-describedby":s,"aria-invalid":s!==void 0,disabled:l,id:i,name:e.name,required:e.control!=="checkbox"&&e.required===!0&&r!==null};if(e.control==="select"){let d=e.options??[];return N("select",{...u,disabled:l||e.readOnly,className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm focus-visible:ring-ring focus-visible:ring-2",value:d.findIndex((a)=>a.value===r),onChange:(a)=>{let c=d[Number(a.currentTarget.value)];if(c)o(c.value)},children:[N("option",{value:-1,disabled:!0,children:["Select ",e.label]}),d.map((a,c)=>f("option",{value:c,children:a.label},c))]})}if(e.control==="checkbox")return f(g,{...u,className:"size-4",type:"checkbox",checked:r===!0,disabled:l||e.readOnly,onChange:(d)=>o(d.currentTarget.checked)});if(e.control==="custom")return N("p",{role:"alert",children:["A custom control is required for ",e.label,"."]});return f(g,{...u,readOnly:e.readOnly,type:e.control,value:ie(r),onChange:(d)=>{let a=d.currentTarget;o(e.control==="number"&&a.value!==""?a.valueAsNumber:a.value)}})},ne=({field:e,value:i,error:r,disabled:l,onChange:s,renderControl:o})=>{let u=te(),d=r?`${u}-error`:void 0,a={disabled:l,errorId:d,field:e,id:u,onChange:(c)=>{if(!l&&!e.readOnly)s(c)},value:i};return N("div",{className:"grid gap-2",children:[N(b,{htmlFor:u,children:[e.label,e.required?" *":""]}),e.control==="custom"&&o?o(a):f(ae,{...a}),e.nullable?f(n,{"aria-label":`Clear ${e.label}`,type:"button",variant:"ghost",size:"sm",className:"justify-self-start",disabled:l||e.readOnly||i===null,onClick:()=>s(null),children:"Clear"}):null,r?f("p",{id:d,role:"alert",className:"text-destructive text-sm",children:r}):null]})},Q=({label:e,fields:i,values:r,errors:l,onChange:s,onSubmit:o,onCancel:u,renderControl:d,pending:a=!1,disabled:c=!1,submitLabel:C="Save",cancelLabel:S="Cancel",error:x,className:h})=>N("form",{"aria-label":e,"aria-busy":a,className:h??"grid gap-4",onSubmit:(p)=>{if(p.preventDefault(),!a&&!c)o()},children:[x?f("div",{role:"alert",className:"text-destructive text-sm",children:x}):null,i.map((p)=>f(ne,{field:p,value:r[p.name],error:l?.[p.name],disabled:c||a,onChange:(w)=>s(p.name,w),renderControl:d},p.name)),N("div",{"data-slot":"form-actions",className:"flex justify-end gap-2",children:[u?f(n,{type:"button",variant:"outline",disabled:a,onClick:u,children:S}):null,f(n,{type:"submit",disabled:c||a,children:C})]})]});import{jsx as B,jsxs as X,Fragment as le}from"react/jsx-runtime";var U=(e)=>B("div",{className:"contents",children:e.control},e.key),Y=({label:e="Filter by",layout:i="stacked",controls:r})=>{if(r.length===0)return null;let l=r.filter((o)=>!o.fullWidth),s=r.filter((o)=>o.fullWidth);return B("div",{className:"mb-4",children:i==="inline"?B("form",{className:"flex flex-wrap items-end gap-2",onSubmit:(o)=>o.preventDefault(),children:r.map(U)}):X(le,{children:[l.length>0?X("form",{className:"flex flex-wrap gap-2 mb-2",onSubmit:(o)=>o.preventDefault(),children:[B(b,{className:"mt-3 mr-2",children:e}),l.map(U)]}):null,s.map((o)=>B("form",{className:"mb-2 last:mb-0",onSubmit:(u)=>u.preventDefault(),children:o.control},o.key))]})})};var{ResourceActionPrimitive:we,ResourceDialogPrimitive:Be,ResourceFilterPrimitive:Ie,ResourceFormPrimitive:Le,ResourceFiltersBar:Ae,ResourceListPrimitive:Me,ResourcePaginationPrimitive:Ve,ResourceTablePrimitive:Oe}=L;export{we as ResourceActionPrimitive,Be as ResourceDialogPrimitive,Ie as ResourceFilterPrimitive,Ae as ResourceFiltersBar,Le as ResourceFormPrimitive,Me as ResourceListPrimitive,Ve as ResourcePaginationPrimitive,Oe as ResourceTablePrimitive};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collective-intelligence/ui-react",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Public React primitives, design-system components, icons, illustrations, and utilities for Collective Intelligence applications.",
5
5
  "type": "module",
6
6
  "sideEffects": false,