@qodo/design-system 0.5.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-system.css +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +12 -7
- package/dist/index.esm.js +1172 -1166
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -67,7 +67,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
67
67
|
`)},Ns=function(){var e=parseInt(document.body.getAttribute(At)||"0",10);return isFinite(e)?e:0},$p=function(){l.useEffect(function(){return document.body.setAttribute(At,(Ns()+1).toString()),function(){var e=Ns()-1;e<=0?document.body.removeAttribute(At):document.body.setAttribute(At,e.toString())}},[])},Lp=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;$p();var s=l.useMemo(function(){return Dp(o)},[o]);return l.createElement(Mp,{styles:Fp(s,!t,o,r?"":"!important")})},Mn=!1;if(typeof window<"u")try{var gr=Object.defineProperty({},"passive",{get:function(){return Mn=!0,!0}});window.addEventListener("test",gr,gr),window.removeEventListener("test",gr,gr)}catch{Mn=!1}var Ct=Mn?{passive:!1}:!1,Vp=function(e){return e.tagName==="TEXTAREA"},Ka=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Vp(e)&&r[t]==="visible")},Bp=function(e){return Ka(e,"overflowY")},Wp=function(e){return Ka(e,"overflowX")},_s=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=Ya(e,n);if(o){var s=qa(e,n),a=s[1],i=s[2];if(a>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},zp=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Gp=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Ya=function(e,t){return e==="v"?Bp(t):Wp(t)},qa=function(e,t){return e==="v"?zp(t):Gp(t)},Hp=function(e,t){return e==="h"&&t==="rtl"?-1:1},Up=function(e,t,r,n,o){var s=Hp(e,window.getComputedStyle(t).direction),a=s*n,i=r.target,c=t.contains(i),u=!1,f=a>0,p=0,g=0;do{if(!i)break;var v=qa(e,i),w=v[0],m=v[1],x=v[2],y=m-x-s*w;(w||y)&&Ya(e,i)&&(p+=y,g+=w);var h=i.parentNode;i=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(p)<1||!f&&Math.abs(g)<1)&&(u=!0),u},vr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Is=function(e){return[e.deltaX,e.deltaY]},Os=function(e){return e&&"current"in e?e.current:e},Kp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yp=function(e){return`
|
|
68
68
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
69
69
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
70
|
-
`)},qp=0,St=[];function Xp(e){var t=l.useRef([]),r=l.useRef([0,0]),n=l.useRef(),o=l.useState(qp++)[0],s=l.useState(Ua)[0],a=l.useRef(e);l.useEffect(function(){a.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=hp([e.lockRef.current],(e.shards||[]).map(Os),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=l.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var y=vr(m),h=r.current,C="deltaX"in m?m.deltaX:h[0]-y[0],S="deltaY"in m?m.deltaY:h[1]-y[1],k,N=m.target,_=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in m&&_==="h"&&N.type==="range")return!1;var T=_s(_,N);if(!T)return!0;if(T?k=_:(k=_==="v"?"h":"v",T=_s(_,N)),!T)return!1;if(!n.current&&"changedTouches"in m&&(C||S)&&(n.current=k),!k)return!0;var H=n.current||k;return Up(H,x,m,H==="h"?C:S)},[]),c=l.useCallback(function(m){var x=m;if(!(!St.length||St[St.length-1]!==s)){var y="deltaY"in x?Is(x):vr(x),h=t.current.filter(function(k){return k.name===x.type&&(k.target===x.target||x.target===k.shadowParent)&&Kp(k.delta,y)})[0];if(h&&h.should){x.cancelable&&x.preventDefault();return}if(!h){var C=(a.current.shards||[]).map(Os).filter(Boolean).filter(function(k){return k.contains(x.target)}),S=C.length>0?i(x,C[0]):!a.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=l.useCallback(function(m,x,y,h){var C={name:m,delta:x,target:y,should:h,shadowParent:Zp(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),f=l.useCallback(function(m){r.current=vr(m),n.current=void 0},[]),p=l.useCallback(function(m){u(m.type,Is(m),m.target,i(m,e.lockRef.current))},[]),g=l.useCallback(function(m){u(m.type,vr(m),m.target,i(m,e.lockRef.current))},[]);l.useEffect(function(){return St.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",c,Ct),document.addEventListener("touchmove",c,Ct),document.addEventListener("touchstart",f,Ct),function(){St=St.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,Ct),document.removeEventListener("touchmove",c,Ct),document.removeEventListener("touchstart",f,Ct)}},[]);var v=e.removeScrollBar,w=e.inert;return l.createElement(l.Fragment,null,w?l.createElement(s,{styles:Yp(o)}):null,v?l.createElement(Lp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jp=Rp(Ha,Xp);var Hr=l.forwardRef(function(e,t){return l.createElement(Gr,$e({},e,{ref:t,sideCar:Jp}))});Hr.classNames=Gr.classNames;var Qp=[" ","Enter","ArrowUp","ArrowDown"],em=[" ","Enter"],ft="Select",[Ur,Kr,tm]=Xn(ft),[$t,Lb]=ke(ft,[tm,Ft]),Yr=Ft(),[rm,nt]=$t(ft),[nm,om]=$t(ft),Xa=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:c,dir:u,name:f,autoComplete:p,disabled:g,required:v,form:w}=e,m=Yr(t),[x,y]=l.useState(null),[h,C]=l.useState(null),[S,k]=l.useState(!1),N=Fr(u),[_,T]=Ee({prop:n,defaultProp:o??!1,onChange:s,caller:ft}),[H,K]=Ee({prop:a,defaultProp:i,onChange:c,caller:ft}),ee=l.useRef(null),J=x?w||!!x.closest("form"):!0,[Y,z]=l.useState(new Set),j=Array.from(Y).map(A=>A.props.value).join(";");return d.jsx(ao,{...m,children:d.jsxs(rm,{required:v,scope:t,trigger:x,onTriggerChange:y,valueNode:h,onValueNodeChange:C,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:ve(),value:H,onValueChange:K,open:_,onOpenChange:T,dir:N,triggerPointerDownPosRef:ee,disabled:g,children:[d.jsx(Ur.Provider,{scope:t,children:d.jsx(nm,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(A=>{z(D=>new Set(D).add(A))},[]),onNativeOptionRemove:l.useCallback(A=>{z(D=>{const E=new Set(D);return E.delete(A),E})},[]),children:r})}),J?d.jsxs(wi,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:p,value:H,onChange:A=>K(A.target.value),disabled:g,form:w,children:[H===void 0?d.jsx("option",{value:""}):null,Array.from(Y)]},j):null]})})};Xa.displayName=ft;var Za="SelectTrigger",Ja=l.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Yr(r),a=nt(Za,r),i=a.disabled||n,c=de(t,a.onTriggerChange),u=Kr(r),f=l.useRef("touch"),[p,g,v]=Si(m=>{const x=u().filter(C=>!C.disabled),y=x.find(C=>C.value===a.value),h=Ei(x,m,y);h!==void 0&&a.onValueChange(h.value)}),w=m=>{i||(a.onOpenChange(!0),v()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return d.jsx(zr,{asChild:!0,...s,children:d.jsx(U.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Ci(a.value)?"":void 0,...o,ref:c,onClick:Z(o.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&w(m)}),onPointerDown:Z(o.onPointerDown,m=>{f.current=m.pointerType;const x=m.target;x.hasPointerCapture(m.pointerId)&&x.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(w(m),m.preventDefault())}),onKeyDown:Z(o.onKeyDown,m=>{const x=p.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(x&&m.key===" ")&&Qp.includes(m.key)&&(w(),m.preventDefault())})})})});Ja.displayName=Za;var Qa="SelectValue",ei=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:a="",...i}=e,c=nt(Qa,r),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,p=de(t,c.onValueNodeChange);return he(()=>{u(f)},[u,f]),d.jsx(U.span,{...i,ref:p,style:{pointerEvents:"none"},children:Ci(c.value)?d.jsx(d.Fragment,{children:a}):s})});ei.displayName=Qa;var sm="SelectIcon",ti=l.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return d.jsx(U.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});ti.displayName=sm;var am="SelectPortal",ri=e=>d.jsx(tr,{asChild:!0,...e});ri.displayName=am;var pt="SelectContent",ni=l.forwardRef((e,t)=>{const r=nt(pt,e.__scopeSelect),[n,o]=l.useState();if(he(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?jr.createPortal(d.jsx(oi,{scope:e.__scopeSelect,children:d.jsx(Ur.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),s):null}return d.jsx(si,{...e,ref:t})});ni.displayName=pt;var Ae=10,[oi,ot]=$t(pt),im="SelectContentImpl",cm=ut("SelectContent.RemoveScroll"),si=l.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:x,...y}=e,h=nt(pt,r),[C,S]=l.useState(null),[k,N]=l.useState(null),_=de(t,O=>S(O)),[T,H]=l.useState(null),[K,ee]=l.useState(null),J=Kr(r),[Y,z]=l.useState(!1),j=l.useRef(!1);l.useEffect(()=>{if(C)return lo(C)},[C]),Zn();const A=l.useCallback(O=>{const[q,...te]=J().map(se=>se.ref.current),[re]=te.slice(-1),ie=document.activeElement;for(const se of O)if(se===ie||(se==null||se.scrollIntoView({block:"nearest"}),se===q&&k&&(k.scrollTop=0),se===re&&k&&(k.scrollTop=k.scrollHeight),se==null||se.focus(),document.activeElement!==ie))return},[J,k]),D=l.useCallback(()=>A([T,C]),[A,T,C]);l.useEffect(()=>{Y&&D()},[Y,D]);const{onOpenChange:E,triggerPointerDownPosRef:G}=h;l.useEffect(()=>{if(C){let O={x:0,y:0};const q=re=>{var ie,se;O={x:Math.abs(Math.round(re.pageX)-(((ie=G.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(re.pageY)-(((se=G.current)==null?void 0:se.y)??0))}},te=re=>{O.x<=10&&O.y<=10?re.preventDefault():C.contains(re.target)||E(!1),document.removeEventListener("pointermove",q),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",te,{capture:!0})}}},[C,E,G]),l.useEffect(()=>{const O=()=>E(!1);return window.addEventListener("blur",O),window.addEventListener("resize",O),()=>{window.removeEventListener("blur",O),window.removeEventListener("resize",O)}},[E]);const[oe,le]=Si(O=>{const q=J().filter(ie=>!ie.disabled),te=q.find(ie=>ie.ref.current===document.activeElement),re=Ei(q,O,te);re&&setTimeout(()=>re.ref.current.focus())}),R=l.useCallback((O,q,te)=>{const re=!j.current&&!te;(h.value!==void 0&&h.value===q||re)&&(H(O),re&&(j.current=!0))},[h.value]),F=l.useCallback(()=>C==null?void 0:C.focus(),[C]),W=l.useCallback((O,q,te)=>{const re=!j.current&&!te;(h.value!==void 0&&h.value===q||re)&&ee(O)},[h.value]),L=n==="popper"?Fn:ai,Q=L===Fn?{side:i,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:x}:{};return d.jsx(oi,{scope:r,content:C,viewport:k,onViewportChange:N,itemRefCallback:R,selectedItem:T,onItemLeave:F,itemTextRefCallback:W,focusSelectedItem:D,selectedItemText:K,position:n,isPositioned:Y,searchRef:oe,children:d.jsx(Hr,{as:cm,allowPinchZoom:!0,children:d.jsx($r,{asChild:!0,trapped:h.open,onMountAutoFocus:O=>{O.preventDefault()},onUnmountAutoFocus:Z(o,O=>{var q;(q=h.trigger)==null||q.focus({preventScroll:!0}),O.preventDefault()}),children:d.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:O=>O.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:d.jsx(L,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:O=>O.preventDefault(),...y,...Q,onPlaced:()=>z(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,O=>{const q=O.ctrlKey||O.altKey||O.metaKey;if(O.key==="Tab"&&O.preventDefault(),!q&&O.key.length===1&&le(O.key),["ArrowUp","ArrowDown","Home","End"].includes(O.key)){let re=J().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(O.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(O.key)){const ie=O.target,se=re.indexOf(ie);re=re.slice(se+1)}setTimeout(()=>A(re)),O.preventDefault()}})})})})})})});si.displayName=im;var lm="SelectItemAlignedPosition",ai=l.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=nt(pt,r),a=ot(pt,r),[i,c]=l.useState(null),[u,f]=l.useState(null),p=de(t,_=>f(_)),g=Kr(r),v=l.useRef(!1),w=l.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:y,focusSelectedItem:h}=a,C=l.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&u&&m&&x&&y){const _=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),K=y.getBoundingClientRect();if(s.dir!=="rtl"){const ie=K.left-T.left,se=H.left-ie,xe=_.left-se,Pe=_.width+xe,De=Math.max(Pe,T.width),Te=window.innerWidth-Ae,Xe=ls(se,[Ae,Math.max(Ae,Te-De)]);i.style.minWidth=Pe+"px",i.style.left=Xe+"px"}else{const ie=T.right-K.right,se=window.innerWidth-H.right-ie,xe=window.innerWidth-_.right-se,Pe=_.width+xe,De=Math.max(Pe,T.width),Te=window.innerWidth-Ae,Xe=ls(se,[Ae,Math.max(Ae,Te-De)]);i.style.minWidth=Pe+"px",i.style.right=Xe+"px"}const ee=g(),J=window.innerHeight-Ae*2,Y=m.scrollHeight,z=window.getComputedStyle(u),j=parseInt(z.borderTopWidth,10),A=parseInt(z.paddingTop,10),D=parseInt(z.borderBottomWidth,10),E=parseInt(z.paddingBottom,10),G=j+A+Y+E+D,oe=Math.min(x.offsetHeight*5,G),le=window.getComputedStyle(m),R=parseInt(le.paddingTop,10),F=parseInt(le.paddingBottom,10),W=_.top+_.height/2-Ae,L=J-W,Q=x.offsetHeight/2,O=x.offsetTop+Q,q=j+A+O,te=G-q;if(q<=W){const ie=ee.length>0&&x===ee[ee.length-1].ref.current;i.style.bottom="0px";const se=u.clientHeight-m.offsetTop-m.offsetHeight,xe=Math.max(L,Q+(ie?F:0)+se+D),Pe=q+xe;i.style.height=Pe+"px"}else{const ie=ee.length>0&&x===ee[0].ref.current;i.style.top="0px";const xe=Math.max(W,j+m.offsetTop+(ie?R:0)+Q)+te;i.style.height=xe+"px",m.scrollTop=q-W+m.offsetTop}i.style.margin=`${Ae}px 0`,i.style.minHeight=oe+"px",i.style.maxHeight=J+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[g,s.trigger,s.valueNode,i,u,m,x,y,s.dir,n]);he(()=>C(),[C]);const[S,k]=l.useState();he(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const N=l.useCallback(_=>{_&&w.current===!0&&(C(),h==null||h(),w.current=!1)},[C,h]);return d.jsx(dm,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:v,onScrollButtonChange:N,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:d.jsx(U.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ai.displayName=lm;var um="SelectPopperPosition",Fn=l.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ae,...s}=e,a=Yr(r);return d.jsx(io,{...a,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Fn.displayName=um;var[dm,uo]=$t(pt,{}),$n="SelectViewport",ii=l.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=ot($n,r),a=uo($n,r),i=de(t,s.onViewportChange),c=l.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),d.jsx(Ur.Slot,{scope:r,children:d.jsx(U.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Z(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=a;if(g!=null&&g.current&&p){const v=Math.abs(c.current-f.scrollTop);if(v>0){const w=window.innerHeight-Ae*2,m=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),y=Math.max(m,x);if(y<w){const h=y+v,C=Math.min(w,h),S=h-C;p.style.height=C+"px",p.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});ii.displayName=$n;var ci="SelectGroup",[fm,pm]=$t(ci),li=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=ve();return d.jsx(fm,{scope:r,id:o,children:d.jsx(U.div,{role:"group","aria-labelledby":o,...n,ref:t})})});li.displayName=ci;var ui="SelectLabel",di=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=pm(ui,r);return d.jsx(U.div,{id:o.id,...n,ref:t})});di.displayName=ui;var Rr="SelectItem",[mm,fi]=$t(Rr),pi=l.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...a}=e,i=nt(Rr,r),c=ot(Rr,r),u=i.value===n,[f,p]=l.useState(s??""),[g,v]=l.useState(!1),w=de(t,h=>{var C;return(C=c.itemRefCallback)==null?void 0:C.call(c,h,n,o)}),m=ve(),x=l.useRef("touch"),y=()=>{o||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(mm,{scope:r,value:n,disabled:o,textId:m,isSelected:u,onItemTextChange:l.useCallback(h=>{p(C=>C||((h==null?void 0:h.textContent)??"").trim())},[]),children:d.jsx(Ur.ItemSlot,{scope:r,value:n,disabled:o,textValue:f,children:d.jsx(U.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:w,onFocus:Z(a.onFocus,()=>v(!0)),onBlur:Z(a.onBlur,()=>v(!1)),onClick:Z(a.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:Z(a.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:Z(a.onPointerDown,h=>{x.current=h.pointerType}),onPointerMove:Z(a.onPointerMove,h=>{var C;x.current=h.pointerType,o?(C=c.onItemLeave)==null||C.call(c):x.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(a.onPointerLeave,h=>{var C;h.currentTarget===document.activeElement&&((C=c.onItemLeave)==null||C.call(c))}),onKeyDown:Z(a.onKeyDown,h=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&h.key===" "||(em.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});pi.displayName=Rr;var Ht="SelectItemText",mi=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,a=nt(Ht,r),i=ot(Ht,r),c=fi(Ht,r),u=om(Ht,r),[f,p]=l.useState(null),g=de(t,y=>p(y),c.onItemTextChange,y=>{var h;return(h=i.itemTextRefCallback)==null?void 0:h.call(i,y,c.value,c.disabled)}),v=f==null?void 0:f.textContent,w=l.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=u;return he(()=>(m(w),()=>x(w)),[m,x,w]),d.jsxs(d.Fragment,{children:[d.jsx(U.span,{id:c.textId,...s,ref:g}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?jr.createPortal(s.children,a.valueNode):null]})});mi.displayName=Ht;var gi="SelectItemIndicator",vi=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return fi(gi,r).isSelected?d.jsx(U.span,{"aria-hidden":!0,...n,ref:t}):null});vi.displayName=gi;var Ln="SelectScrollUpButton",hi=l.forwardRef((e,t)=>{const r=ot(Ln,e.__scopeSelect),n=uo(Ln,e.__scopeSelect),[o,s]=l.useState(!1),a=de(t,n.onScrollButtonChange);return he(()=>{if(r.viewport&&r.isPositioned){let i=function(){const u=c.scrollTop>0;s(u)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),o?d.jsx(bi,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});hi.displayName=Ln;var Vn="SelectScrollDownButton",xi=l.forwardRef((e,t)=>{const r=ot(Vn,e.__scopeSelect),n=uo(Vn,e.__scopeSelect),[o,s]=l.useState(!1),a=de(t,n.onScrollButtonChange);return he(()=>{if(r.viewport&&r.isPositioned){let i=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;s(f)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),o?d.jsx(bi,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});xi.displayName=Vn;var bi=l.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=ot("SelectScrollButton",r),a=l.useRef(null),i=Kr(r),c=l.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return l.useEffect(()=>()=>c(),[c]),he(()=>{var f;const u=i().find(p=>p.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[i]),d.jsx(U.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Z(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Z(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Z(o.onPointerLeave,()=>{c()})})}),gm="SelectSeparator",yi=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return d.jsx(U.div,{"aria-hidden":!0,...n,ref:t})});yi.displayName=gm;var Bn="SelectArrow",vm=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Yr(r),s=nt(Bn,r),a=ot(Bn,r);return s.open&&a.position==="popper"?d.jsx(co,{...o,...n,ref:t}):null});vm.displayName=Bn;var hm="SelectBubbleInput",wi=l.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=l.useRef(null),s=de(n,o),a=La(t);return l.useEffect(()=>{const i=o.current;if(!i)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(p)}},[a,t]),d.jsx(U.select,{...r,style:{...Va,...r.style},ref:s,defaultValue:t})});wi.displayName=hm;function Ci(e){return e===""||e===void 0}function Si(e){const t=Qe(e),r=l.useRef(""),n=l.useRef(0),o=l.useCallback(a=>{const i=r.current+a;t(i),(function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(i)},[t]),s=l.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function Ei(e,t,r){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let a=xm(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function xm(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var bm=Xa,Pi=Ja,ym=ei,wm=ti,Cm=ri,Ri=ni,Sm=ii,Em=li,ki=di,Ti=pi,Pm=mi,Rm=vi,Ai=hi,Ni=xi,_i=yi;/**
|
|
70
|
+
`)},qp=0,St=[];function Xp(e){var t=l.useRef([]),r=l.useRef([0,0]),n=l.useRef(),o=l.useState(qp++)[0],s=l.useState(Ua)[0],a=l.useRef(e);l.useEffect(function(){a.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=hp([e.lockRef.current],(e.shards||[]).map(Os),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=l.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var y=vr(m),h=r.current,C="deltaX"in m?m.deltaX:h[0]-y[0],S="deltaY"in m?m.deltaY:h[1]-y[1],k,N=m.target,_=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in m&&_==="h"&&N.type==="range")return!1;var T=_s(_,N);if(!T)return!0;if(T?k=_:(k=_==="v"?"h":"v",T=_s(_,N)),!T)return!1;if(!n.current&&"changedTouches"in m&&(C||S)&&(n.current=k),!k)return!0;var H=n.current||k;return Up(H,x,m,H==="h"?C:S)},[]),c=l.useCallback(function(m){var x=m;if(!(!St.length||St[St.length-1]!==s)){var y="deltaY"in x?Is(x):vr(x),h=t.current.filter(function(k){return k.name===x.type&&(k.target===x.target||x.target===k.shadowParent)&&Kp(k.delta,y)})[0];if(h&&h.should){x.cancelable&&x.preventDefault();return}if(!h){var C=(a.current.shards||[]).map(Os).filter(Boolean).filter(function(k){return k.contains(x.target)}),S=C.length>0?i(x,C[0]):!a.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=l.useCallback(function(m,x,y,h){var C={name:m,delta:x,target:y,should:h,shadowParent:Zp(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),f=l.useCallback(function(m){r.current=vr(m),n.current=void 0},[]),p=l.useCallback(function(m){u(m.type,Is(m),m.target,i(m,e.lockRef.current))},[]),g=l.useCallback(function(m){u(m.type,vr(m),m.target,i(m,e.lockRef.current))},[]);l.useEffect(function(){return St.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",c,Ct),document.addEventListener("touchmove",c,Ct),document.addEventListener("touchstart",f,Ct),function(){St=St.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,Ct),document.removeEventListener("touchmove",c,Ct),document.removeEventListener("touchstart",f,Ct)}},[]);var v=e.removeScrollBar,w=e.inert;return l.createElement(l.Fragment,null,w?l.createElement(s,{styles:Yp(o)}):null,v?l.createElement(Lp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jp=Rp(Ha,Xp);var Hr=l.forwardRef(function(e,t){return l.createElement(Gr,$e({},e,{ref:t,sideCar:Jp}))});Hr.classNames=Gr.classNames;var Qp=[" ","Enter","ArrowUp","ArrowDown"],em=[" ","Enter"],ft="Select",[Ur,Kr,tm]=Xn(ft),[$t,Vb]=ke(ft,[tm,Ft]),Yr=Ft(),[rm,nt]=$t(ft),[nm,om]=$t(ft),Xa=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:c,dir:u,name:f,autoComplete:p,disabled:g,required:v,form:w}=e,m=Yr(t),[x,y]=l.useState(null),[h,C]=l.useState(null),[S,k]=l.useState(!1),N=Fr(u),[_,T]=Ee({prop:n,defaultProp:o??!1,onChange:s,caller:ft}),[H,K]=Ee({prop:a,defaultProp:i,onChange:c,caller:ft}),ee=l.useRef(null),J=x?w||!!x.closest("form"):!0,[Y,z]=l.useState(new Set),j=Array.from(Y).map(A=>A.props.value).join(";");return d.jsx(ao,{...m,children:d.jsxs(rm,{required:v,scope:t,trigger:x,onTriggerChange:y,valueNode:h,onValueNodeChange:C,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:ve(),value:H,onValueChange:K,open:_,onOpenChange:T,dir:N,triggerPointerDownPosRef:ee,disabled:g,children:[d.jsx(Ur.Provider,{scope:t,children:d.jsx(nm,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(A=>{z(D=>new Set(D).add(A))},[]),onNativeOptionRemove:l.useCallback(A=>{z(D=>{const E=new Set(D);return E.delete(A),E})},[]),children:r})}),J?d.jsxs(wi,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:p,value:H,onChange:A=>K(A.target.value),disabled:g,form:w,children:[H===void 0?d.jsx("option",{value:""}):null,Array.from(Y)]},j):null]})})};Xa.displayName=ft;var Za="SelectTrigger",Ja=l.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Yr(r),a=nt(Za,r),i=a.disabled||n,c=de(t,a.onTriggerChange),u=Kr(r),f=l.useRef("touch"),[p,g,v]=Si(m=>{const x=u().filter(C=>!C.disabled),y=x.find(C=>C.value===a.value),h=Ei(x,m,y);h!==void 0&&a.onValueChange(h.value)}),w=m=>{i||(a.onOpenChange(!0),v()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return d.jsx(zr,{asChild:!0,...s,children:d.jsx(U.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Ci(a.value)?"":void 0,...o,ref:c,onClick:Z(o.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&w(m)}),onPointerDown:Z(o.onPointerDown,m=>{f.current=m.pointerType;const x=m.target;x.hasPointerCapture(m.pointerId)&&x.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(w(m),m.preventDefault())}),onKeyDown:Z(o.onKeyDown,m=>{const x=p.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(x&&m.key===" ")&&Qp.includes(m.key)&&(w(),m.preventDefault())})})})});Ja.displayName=Za;var Qa="SelectValue",ei=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:a="",...i}=e,c=nt(Qa,r),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,p=de(t,c.onValueNodeChange);return he(()=>{u(f)},[u,f]),d.jsx(U.span,{...i,ref:p,style:{pointerEvents:"none"},children:Ci(c.value)?d.jsx(d.Fragment,{children:a}):s})});ei.displayName=Qa;var sm="SelectIcon",ti=l.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return d.jsx(U.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});ti.displayName=sm;var am="SelectPortal",ri=e=>d.jsx(tr,{asChild:!0,...e});ri.displayName=am;var pt="SelectContent",ni=l.forwardRef((e,t)=>{const r=nt(pt,e.__scopeSelect),[n,o]=l.useState();if(he(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?jr.createPortal(d.jsx(oi,{scope:e.__scopeSelect,children:d.jsx(Ur.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),s):null}return d.jsx(si,{...e,ref:t})});ni.displayName=pt;var Ae=10,[oi,ot]=$t(pt),im="SelectContentImpl",cm=ut("SelectContent.RemoveScroll"),si=l.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:x,...y}=e,h=nt(pt,r),[C,S]=l.useState(null),[k,N]=l.useState(null),_=de(t,O=>S(O)),[T,H]=l.useState(null),[K,ee]=l.useState(null),J=Kr(r),[Y,z]=l.useState(!1),j=l.useRef(!1);l.useEffect(()=>{if(C)return lo(C)},[C]),Zn();const A=l.useCallback(O=>{const[q,...te]=J().map(se=>se.ref.current),[re]=te.slice(-1),ie=document.activeElement;for(const se of O)if(se===ie||(se==null||se.scrollIntoView({block:"nearest"}),se===q&&k&&(k.scrollTop=0),se===re&&k&&(k.scrollTop=k.scrollHeight),se==null||se.focus(),document.activeElement!==ie))return},[J,k]),D=l.useCallback(()=>A([T,C]),[A,T,C]);l.useEffect(()=>{Y&&D()},[Y,D]);const{onOpenChange:E,triggerPointerDownPosRef:G}=h;l.useEffect(()=>{if(C){let O={x:0,y:0};const q=re=>{var ie,se;O={x:Math.abs(Math.round(re.pageX)-(((ie=G.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(re.pageY)-(((se=G.current)==null?void 0:se.y)??0))}},te=re=>{O.x<=10&&O.y<=10?re.preventDefault():C.contains(re.target)||E(!1),document.removeEventListener("pointermove",q),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",te,{capture:!0})}}},[C,E,G]),l.useEffect(()=>{const O=()=>E(!1);return window.addEventListener("blur",O),window.addEventListener("resize",O),()=>{window.removeEventListener("blur",O),window.removeEventListener("resize",O)}},[E]);const[oe,le]=Si(O=>{const q=J().filter(ie=>!ie.disabled),te=q.find(ie=>ie.ref.current===document.activeElement),re=Ei(q,O,te);re&&setTimeout(()=>re.ref.current.focus())}),R=l.useCallback((O,q,te)=>{const re=!j.current&&!te;(h.value!==void 0&&h.value===q||re)&&(H(O),re&&(j.current=!0))},[h.value]),F=l.useCallback(()=>C==null?void 0:C.focus(),[C]),W=l.useCallback((O,q,te)=>{const re=!j.current&&!te;(h.value!==void 0&&h.value===q||re)&&ee(O)},[h.value]),L=n==="popper"?Fn:ai,Q=L===Fn?{side:i,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:x}:{};return d.jsx(oi,{scope:r,content:C,viewport:k,onViewportChange:N,itemRefCallback:R,selectedItem:T,onItemLeave:F,itemTextRefCallback:W,focusSelectedItem:D,selectedItemText:K,position:n,isPositioned:Y,searchRef:oe,children:d.jsx(Hr,{as:cm,allowPinchZoom:!0,children:d.jsx($r,{asChild:!0,trapped:h.open,onMountAutoFocus:O=>{O.preventDefault()},onUnmountAutoFocus:Z(o,O=>{var q;(q=h.trigger)==null||q.focus({preventScroll:!0}),O.preventDefault()}),children:d.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:O=>O.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:d.jsx(L,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:O=>O.preventDefault(),...y,...Q,onPlaced:()=>z(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,O=>{const q=O.ctrlKey||O.altKey||O.metaKey;if(O.key==="Tab"&&O.preventDefault(),!q&&O.key.length===1&&le(O.key),["ArrowUp","ArrowDown","Home","End"].includes(O.key)){let re=J().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(O.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(O.key)){const ie=O.target,se=re.indexOf(ie);re=re.slice(se+1)}setTimeout(()=>A(re)),O.preventDefault()}})})})})})})});si.displayName=im;var lm="SelectItemAlignedPosition",ai=l.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=nt(pt,r),a=ot(pt,r),[i,c]=l.useState(null),[u,f]=l.useState(null),p=de(t,_=>f(_)),g=Kr(r),v=l.useRef(!1),w=l.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:y,focusSelectedItem:h}=a,C=l.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&u&&m&&x&&y){const _=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),K=y.getBoundingClientRect();if(s.dir!=="rtl"){const ie=K.left-T.left,se=H.left-ie,xe=_.left-se,Pe=_.width+xe,De=Math.max(Pe,T.width),Te=window.innerWidth-Ae,Xe=ls(se,[Ae,Math.max(Ae,Te-De)]);i.style.minWidth=Pe+"px",i.style.left=Xe+"px"}else{const ie=T.right-K.right,se=window.innerWidth-H.right-ie,xe=window.innerWidth-_.right-se,Pe=_.width+xe,De=Math.max(Pe,T.width),Te=window.innerWidth-Ae,Xe=ls(se,[Ae,Math.max(Ae,Te-De)]);i.style.minWidth=Pe+"px",i.style.right=Xe+"px"}const ee=g(),J=window.innerHeight-Ae*2,Y=m.scrollHeight,z=window.getComputedStyle(u),j=parseInt(z.borderTopWidth,10),A=parseInt(z.paddingTop,10),D=parseInt(z.borderBottomWidth,10),E=parseInt(z.paddingBottom,10),G=j+A+Y+E+D,oe=Math.min(x.offsetHeight*5,G),le=window.getComputedStyle(m),R=parseInt(le.paddingTop,10),F=parseInt(le.paddingBottom,10),W=_.top+_.height/2-Ae,L=J-W,Q=x.offsetHeight/2,O=x.offsetTop+Q,q=j+A+O,te=G-q;if(q<=W){const ie=ee.length>0&&x===ee[ee.length-1].ref.current;i.style.bottom="0px";const se=u.clientHeight-m.offsetTop-m.offsetHeight,xe=Math.max(L,Q+(ie?F:0)+se+D),Pe=q+xe;i.style.height=Pe+"px"}else{const ie=ee.length>0&&x===ee[0].ref.current;i.style.top="0px";const xe=Math.max(W,j+m.offsetTop+(ie?R:0)+Q)+te;i.style.height=xe+"px",m.scrollTop=q-W+m.offsetTop}i.style.margin=`${Ae}px 0`,i.style.minHeight=oe+"px",i.style.maxHeight=J+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[g,s.trigger,s.valueNode,i,u,m,x,y,s.dir,n]);he(()=>C(),[C]);const[S,k]=l.useState();he(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const N=l.useCallback(_=>{_&&w.current===!0&&(C(),h==null||h(),w.current=!1)},[C,h]);return d.jsx(dm,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:v,onScrollButtonChange:N,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:d.jsx(U.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ai.displayName=lm;var um="SelectPopperPosition",Fn=l.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ae,...s}=e,a=Yr(r);return d.jsx(io,{...a,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Fn.displayName=um;var[dm,uo]=$t(pt,{}),$n="SelectViewport",ii=l.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=ot($n,r),a=uo($n,r),i=de(t,s.onViewportChange),c=l.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),d.jsx(Ur.Slot,{scope:r,children:d.jsx(U.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Z(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=a;if(g!=null&&g.current&&p){const v=Math.abs(c.current-f.scrollTop);if(v>0){const w=window.innerHeight-Ae*2,m=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),y=Math.max(m,x);if(y<w){const h=y+v,C=Math.min(w,h),S=h-C;p.style.height=C+"px",p.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});ii.displayName=$n;var ci="SelectGroup",[fm,pm]=$t(ci),li=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=ve();return d.jsx(fm,{scope:r,id:o,children:d.jsx(U.div,{role:"group","aria-labelledby":o,...n,ref:t})})});li.displayName=ci;var ui="SelectLabel",di=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=pm(ui,r);return d.jsx(U.div,{id:o.id,...n,ref:t})});di.displayName=ui;var Rr="SelectItem",[mm,fi]=$t(Rr),pi=l.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...a}=e,i=nt(Rr,r),c=ot(Rr,r),u=i.value===n,[f,p]=l.useState(s??""),[g,v]=l.useState(!1),w=de(t,h=>{var C;return(C=c.itemRefCallback)==null?void 0:C.call(c,h,n,o)}),m=ve(),x=l.useRef("touch"),y=()=>{o||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(mm,{scope:r,value:n,disabled:o,textId:m,isSelected:u,onItemTextChange:l.useCallback(h=>{p(C=>C||((h==null?void 0:h.textContent)??"").trim())},[]),children:d.jsx(Ur.ItemSlot,{scope:r,value:n,disabled:o,textValue:f,children:d.jsx(U.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:w,onFocus:Z(a.onFocus,()=>v(!0)),onBlur:Z(a.onBlur,()=>v(!1)),onClick:Z(a.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:Z(a.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:Z(a.onPointerDown,h=>{x.current=h.pointerType}),onPointerMove:Z(a.onPointerMove,h=>{var C;x.current=h.pointerType,o?(C=c.onItemLeave)==null||C.call(c):x.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(a.onPointerLeave,h=>{var C;h.currentTarget===document.activeElement&&((C=c.onItemLeave)==null||C.call(c))}),onKeyDown:Z(a.onKeyDown,h=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&h.key===" "||(em.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});pi.displayName=Rr;var Ht="SelectItemText",mi=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,a=nt(Ht,r),i=ot(Ht,r),c=fi(Ht,r),u=om(Ht,r),[f,p]=l.useState(null),g=de(t,y=>p(y),c.onItemTextChange,y=>{var h;return(h=i.itemTextRefCallback)==null?void 0:h.call(i,y,c.value,c.disabled)}),v=f==null?void 0:f.textContent,w=l.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=u;return he(()=>(m(w),()=>x(w)),[m,x,w]),d.jsxs(d.Fragment,{children:[d.jsx(U.span,{id:c.textId,...s,ref:g}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?jr.createPortal(s.children,a.valueNode):null]})});mi.displayName=Ht;var gi="SelectItemIndicator",vi=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return fi(gi,r).isSelected?d.jsx(U.span,{"aria-hidden":!0,...n,ref:t}):null});vi.displayName=gi;var Ln="SelectScrollUpButton",hi=l.forwardRef((e,t)=>{const r=ot(Ln,e.__scopeSelect),n=uo(Ln,e.__scopeSelect),[o,s]=l.useState(!1),a=de(t,n.onScrollButtonChange);return he(()=>{if(r.viewport&&r.isPositioned){let i=function(){const u=c.scrollTop>0;s(u)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),o?d.jsx(bi,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});hi.displayName=Ln;var Vn="SelectScrollDownButton",xi=l.forwardRef((e,t)=>{const r=ot(Vn,e.__scopeSelect),n=uo(Vn,e.__scopeSelect),[o,s]=l.useState(!1),a=de(t,n.onScrollButtonChange);return he(()=>{if(r.viewport&&r.isPositioned){let i=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<u;s(f)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),o?d.jsx(bi,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});xi.displayName=Vn;var bi=l.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=ot("SelectScrollButton",r),a=l.useRef(null),i=Kr(r),c=l.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return l.useEffect(()=>()=>c(),[c]),he(()=>{var f;const u=i().find(p=>p.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[i]),d.jsx(U.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Z(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Z(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Z(o.onPointerLeave,()=>{c()})})}),gm="SelectSeparator",yi=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return d.jsx(U.div,{"aria-hidden":!0,...n,ref:t})});yi.displayName=gm;var Bn="SelectArrow",vm=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Yr(r),s=nt(Bn,r),a=ot(Bn,r);return s.open&&a.position==="popper"?d.jsx(co,{...o,...n,ref:t}):null});vm.displayName=Bn;var hm="SelectBubbleInput",wi=l.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=l.useRef(null),s=de(n,o),a=La(t);return l.useEffect(()=>{const i=o.current;if(!i)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(p)}},[a,t]),d.jsx(U.select,{...r,style:{...Va,...r.style},ref:s,defaultValue:t})});wi.displayName=hm;function Ci(e){return e===""||e===void 0}function Si(e){const t=Qe(e),r=l.useRef(""),n=l.useRef(0),o=l.useCallback(a=>{const i=r.current+a;t(i),(function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(i)},[t]),s=l.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function Ei(e,t,r){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let a=xm(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function xm(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var bm=Xa,Pi=Ja,ym=ei,wm=ti,Cm=ri,Ri=ni,Sm=ii,Em=li,ki=di,Ti=pi,Pm=mi,Rm=vi,Ai=hi,Ni=xi,_i=yi;/**
|
|
71
71
|
* @license lucide-react v0.525.0 - ISC
|
|
72
72
|
*
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
@@ -117,14 +117,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
117
117
|
*
|
|
118
118
|
* This source code is licensed under the ISC license.
|
|
119
119
|
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Vm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bm=Lt("x",Vm),ji=bm,Wm=Em,Di=ym,po=l.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(Pi,{ref:n,className:$($("flex h-9 w-full min-w-0 items-center justify-between","rounded-md border bg-purple-mutted-700 border-purple-mutted-500","text-sm data-[placeholder]:text-muted-foreground [&:not([data-placeholder])]:text-purple-mutted-300 md:text-sm ","px-3 py-1","shadow-xs transition-[color,box-shadow] outline-none","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e)),...r,children:[t,d.jsx(wm,{asChild:!0,children:d.jsx(fo,{className:"h-4 w-4 text-purple-mutted-300"})})]}));po.displayName=Pi.displayName;const mo=l.forwardRef(({className:e,...t},r)=>d.jsx(Ai,{ref:r,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(Dm,{className:"h-4 w-4"})}));mo.displayName=Ai.displayName;const go=l.forwardRef(({className:e,...t},r)=>d.jsx(Ni,{ref:r,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(fo,{className:"h-4 w-4"})}));go.displayName=Ni.displayName;const vo=l.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>d.jsx(Cm,{children:d.jsxs(Ri,{ref:o,className:$("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-purple-mutted-600 border-purple-mutted-500 text-purple-mutted-300 shadow-md 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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[d.jsx(mo,{}),d.jsx(Sm,{className:$("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-[var(--radix-select-trigger-width)]"),children:t}),d.jsx(go,{})]})}));vo.displayName=Ri.displayName;const Mi=l.forwardRef(({className:e,...t},r)=>d.jsx(ki,{ref:r,className:$("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Mi.displayName=ki.displayName;const ho=l.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(Ti,{ref:n,className:$($("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-purple-mutted-500 focus:text-purple-100 text-purple-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),e),...r,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(Rm,{children:d.jsx(Oi,{className:"h-4 w-4"})})}),d.jsx(Pm,{children:t})]}));ho.displayName=Ti.displayName;const Fi=l.forwardRef(({className:e,...t},r)=>d.jsx(_i,{ref:r,className:$("-mx-1 my-1 h-px bg-muted",e),...t}));Fi.displayName=_i.displayName;var Ds=1,zm=.9,Gm=.8,Hm=.17,Cn=.1,Sn=.999,Um=.9999,Km=.99,Ym=/[\\\/_+.#"@\[\(\{&]/,qm=/[\\\/_+.#"@\[\(\{&]/g,Xm=/[\s-]/,$i=/[\s-]/g;function Wn(e,t,r,n,o,s,a){if(s===t.length)return o===e.length?Ds:Km;var i=`${o},${s}`;if(a[i]!==void 0)return a[i];for(var c=n.charAt(s),u=r.indexOf(c,o),f=0,p,g,v,w;u>=0;)p=Wn(e,t,r,n,u+1,s+1,a),p>f&&(u===o?p*=Ds:Ym.test(e.charAt(u-1))?(p*=Gm,v=e.slice(o,u-1).match(qm),v&&o>0&&(p*=Math.pow(Sn,v.length))):Xm.test(e.charAt(u-1))?(p*=zm,w=e.slice(o,u-1).match($i),w&&o>0&&(p*=Math.pow(Sn,w.length))):(p*=Hm,o>0&&(p*=Math.pow(Sn,u-o))),e.charAt(u)!==t.charAt(s)&&(p*=Um)),(p<Cn&&r.charAt(u-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(u-1)!==n.charAt(s))&&(g=Wn(e,t,r,n,u+1,s+2,a),g*Cn>p&&(p=g*Cn)),p>f&&(f=p),u=r.indexOf(c,u+1);return a[i]=f,f}function Ms(e){return e.toLowerCase().replace($i," ")}function Zm(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Wn(e,t,Ms(e),Ms(t),0,0,{})}function Jm(e,t){return l.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Qm(t),o=typeof r=="function"?r({present:n.isPresent}):l.Children.only(r),s=de(n.ref,eg(o));return typeof r=="function"||n.isPresent?l.cloneElement(o,{ref:s}):null};Ye.displayName="Presence";function Qm(e){const[t,r]=l.useState(),n=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),a=e?"mounted":"unmounted",[i,c]=Jm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const u=hr(n.current);s.current=i==="mounted"?u:"none"},[i]),he(()=>{const u=n.current,f=o.current;if(f!==e){const g=s.current,v=hr(u);e?c("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),he(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,p=v=>{const m=hr(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&m&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=v=>{v.target===t&&(s.current=hr(n.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:l.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function hr(e){return(e==null?void 0:e.animationName)||"none"}function eg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qr="Dialog",[Li,Vb]=ke(qr),[tg,Ie]=Li(qr),Vi=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=l.useRef(null),c=l.useRef(null),[u,f]=Ee({prop:n,defaultProp:o??!1,onChange:s,caller:qr});return d.jsx(tg,{scope:t,triggerRef:i,contentRef:c,contentId:ve(),titleId:ve(),descriptionId:ve(),open:u,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(p=>!p),[f]),modal:a,children:r})};Vi.displayName=qr;var Bi="DialogTrigger",Wi=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(Bi,r),s=de(t,o.triggerRef);return d.jsx(U.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":yo(o.open),...n,ref:s,onClick:Z(e.onClick,o.onOpenToggle)})});Wi.displayName=Bi;var xo="DialogPortal",[rg,zi]=Li(xo,{forceMount:void 0}),Gi=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=Ie(xo,t);return d.jsx(rg,{scope:t,forceMount:r,children:l.Children.map(n,a=>d.jsx(Ye,{present:r||s.open,children:d.jsx(tr,{asChild:!0,container:o,children:a})}))})};Gi.displayName=xo;var kr="DialogOverlay",Hi=l.forwardRef((e,t)=>{const r=zi(kr,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=Ie(kr,e.__scopeDialog);return s.modal?d.jsx(Ye,{present:n||s.open,children:d.jsx(og,{...o,ref:t})}):null});Hi.displayName=kr;var ng=ut("DialogOverlay.RemoveScroll"),og=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(kr,r);return d.jsx(Hr,{as:ng,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(U.div,{"data-state":yo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),mt="DialogContent",Ui=l.forwardRef((e,t)=>{const r=zi(mt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=Ie(mt,e.__scopeDialog);return d.jsx(Ye,{present:n||s.open,children:s.modal?d.jsx(sg,{...o,ref:t}):d.jsx(ag,{...o,ref:t})})});Ui.displayName=mt;var sg=l.forwardRef((e,t)=>{const r=Ie(mt,e.__scopeDialog),n=l.useRef(null),o=de(t,r.contentRef,n);return l.useEffect(()=>{const s=n.current;if(s)return lo(s)},[]),d.jsx(Ki,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,s=>s.preventDefault())})}),ag=l.forwardRef((e,t)=>{const r=Ie(mt,e.__scopeDialog),n=l.useRef(!1),o=l.useRef(!1);return d.jsx(Ki,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ki=l.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=Ie(mt,r),c=l.useRef(null),u=de(t,c);return Zn(),d.jsxs(d.Fragment,{children:[d.jsx($r,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:d.jsx(Qt,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":yo(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(ig,{titleId:i.titleId}),d.jsx(lg,{contentRef:c,descriptionId:i.descriptionId})]})]})}),bo="DialogTitle",Yi=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(bo,r);return d.jsx(U.h2,{id:o.titleId,...n,ref:t})});Yi.displayName=bo;var qi="DialogDescription",Xi=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(qi,r);return d.jsx(U.p,{id:o.descriptionId,...n,ref:t})});Xi.displayName=qi;var Zi="DialogClose",Ji=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(Zi,r);return d.jsx(U.button,{type:"button",...n,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});Ji.displayName=Zi;function yo(e){return e?"open":"closed"}var Qi="DialogTitleWarning",[Bb,ec]=vd(Qi,{contentName:mt,titleName:bo,docsSlug:"dialog"}),ig=({titleId:e})=>{const t=ec(Qi),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
120
|
+
*/const Vm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bm=Lt("x",Vm),ji=bm,Wm=Em,Di=ym,po=l.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(Pi,{ref:n,className:$($("flex h-9 w-full min-w-0 items-center justify-between","rounded-md border bg-purple-mutted-700 border-purple-mutted-500","text-sm data-[placeholder]:text-muted-foreground [&:not([data-placeholder])]:text-purple-mutted-300 md:text-sm ","px-3 py-1","shadow-xs transition-[color,box-shadow] outline-none","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e)),...r,children:[t,d.jsx(wm,{asChild:!0,children:d.jsx(fo,{className:"h-4 w-4 text-purple-mutted-300"})})]}));po.displayName=Pi.displayName;const mo=l.forwardRef(({className:e,...t},r)=>d.jsx(Ai,{ref:r,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(Dm,{className:"h-4 w-4"})}));mo.displayName=Ai.displayName;const go=l.forwardRef(({className:e,...t},r)=>d.jsx(Ni,{ref:r,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(fo,{className:"h-4 w-4"})}));go.displayName=Ni.displayName;const vo=l.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>d.jsx(Cm,{children:d.jsxs(Ri,{ref:o,className:$("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-purple-mutted-600 border-purple-mutted-500 text-purple-mutted-300 shadow-md 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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[d.jsx(mo,{}),d.jsx(Sm,{className:$("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-[var(--radix-select-trigger-width)]"),children:t}),d.jsx(go,{})]})}));vo.displayName=Ri.displayName;const Mi=l.forwardRef(({className:e,...t},r)=>d.jsx(ki,{ref:r,className:$("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Mi.displayName=ki.displayName;const ho=l.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(Ti,{ref:n,className:$($("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-purple-mutted-500 focus:text-purple-100 text-purple-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),e),...r,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(Rm,{children:d.jsx(Oi,{className:"h-4 w-4"})})}),d.jsx(Pm,{children:t})]}));ho.displayName=Ti.displayName;const Fi=l.forwardRef(({className:e,...t},r)=>d.jsx(_i,{ref:r,className:$("-mx-1 my-1 h-px bg-muted",e),...t}));Fi.displayName=_i.displayName;var Ds=1,zm=.9,Gm=.8,Hm=.17,Cn=.1,Sn=.999,Um=.9999,Km=.99,Ym=/[\\\/_+.#"@\[\(\{&]/,qm=/[\\\/_+.#"@\[\(\{&]/g,Xm=/[\s-]/,$i=/[\s-]/g;function Wn(e,t,r,n,o,s,a){if(s===t.length)return o===e.length?Ds:Km;var i=`${o},${s}`;if(a[i]!==void 0)return a[i];for(var c=n.charAt(s),u=r.indexOf(c,o),f=0,p,g,v,w;u>=0;)p=Wn(e,t,r,n,u+1,s+1,a),p>f&&(u===o?p*=Ds:Ym.test(e.charAt(u-1))?(p*=Gm,v=e.slice(o,u-1).match(qm),v&&o>0&&(p*=Math.pow(Sn,v.length))):Xm.test(e.charAt(u-1))?(p*=zm,w=e.slice(o,u-1).match($i),w&&o>0&&(p*=Math.pow(Sn,w.length))):(p*=Hm,o>0&&(p*=Math.pow(Sn,u-o))),e.charAt(u)!==t.charAt(s)&&(p*=Um)),(p<Cn&&r.charAt(u-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(u-1)!==n.charAt(s))&&(g=Wn(e,t,r,n,u+1,s+2,a),g*Cn>p&&(p=g*Cn)),p>f&&(f=p),u=r.indexOf(c,u+1);return a[i]=f,f}function Ms(e){return e.toLowerCase().replace($i," ")}function Zm(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Wn(e,t,Ms(e),Ms(t),0,0,{})}function Jm(e,t){return l.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Qm(t),o=typeof r=="function"?r({present:n.isPresent}):l.Children.only(r),s=de(n.ref,eg(o));return typeof r=="function"||n.isPresent?l.cloneElement(o,{ref:s}):null};Ye.displayName="Presence";function Qm(e){const[t,r]=l.useState(),n=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),a=e?"mounted":"unmounted",[i,c]=Jm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const u=hr(n.current);s.current=i==="mounted"?u:"none"},[i]),he(()=>{const u=n.current,f=o.current;if(f!==e){const g=s.current,v=hr(u);e?c("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&g!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),he(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,p=v=>{const m=hr(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&m&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=v=>{v.target===t&&(s.current=hr(n.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:l.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function hr(e){return(e==null?void 0:e.animationName)||"none"}function eg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qr="Dialog",[Li,Bb]=ke(qr),[tg,Ie]=Li(qr),Vi=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=l.useRef(null),c=l.useRef(null),[u,f]=Ee({prop:n,defaultProp:o??!1,onChange:s,caller:qr});return d.jsx(tg,{scope:t,triggerRef:i,contentRef:c,contentId:ve(),titleId:ve(),descriptionId:ve(),open:u,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(p=>!p),[f]),modal:a,children:r})};Vi.displayName=qr;var Bi="DialogTrigger",Wi=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(Bi,r),s=de(t,o.triggerRef);return d.jsx(U.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":yo(o.open),...n,ref:s,onClick:Z(e.onClick,o.onOpenToggle)})});Wi.displayName=Bi;var xo="DialogPortal",[rg,zi]=Li(xo,{forceMount:void 0}),Gi=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=Ie(xo,t);return d.jsx(rg,{scope:t,forceMount:r,children:l.Children.map(n,a=>d.jsx(Ye,{present:r||s.open,children:d.jsx(tr,{asChild:!0,container:o,children:a})}))})};Gi.displayName=xo;var kr="DialogOverlay",Hi=l.forwardRef((e,t)=>{const r=zi(kr,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=Ie(kr,e.__scopeDialog);return s.modal?d.jsx(Ye,{present:n||s.open,children:d.jsx(og,{...o,ref:t})}):null});Hi.displayName=kr;var ng=ut("DialogOverlay.RemoveScroll"),og=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(kr,r);return d.jsx(Hr,{as:ng,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(U.div,{"data-state":yo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),mt="DialogContent",Ui=l.forwardRef((e,t)=>{const r=zi(mt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=Ie(mt,e.__scopeDialog);return d.jsx(Ye,{present:n||s.open,children:s.modal?d.jsx(sg,{...o,ref:t}):d.jsx(ag,{...o,ref:t})})});Ui.displayName=mt;var sg=l.forwardRef((e,t)=>{const r=Ie(mt,e.__scopeDialog),n=l.useRef(null),o=de(t,r.contentRef,n);return l.useEffect(()=>{const s=n.current;if(s)return lo(s)},[]),d.jsx(Ki,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,s=>s.preventDefault())})}),ag=l.forwardRef((e,t)=>{const r=Ie(mt,e.__scopeDialog),n=l.useRef(!1),o=l.useRef(!1);return d.jsx(Ki,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ki=l.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=Ie(mt,r),c=l.useRef(null),u=de(t,c);return Zn(),d.jsxs(d.Fragment,{children:[d.jsx($r,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:d.jsx(Qt,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":yo(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(ig,{titleId:i.titleId}),d.jsx(lg,{contentRef:c,descriptionId:i.descriptionId})]})]})}),bo="DialogTitle",Yi=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(bo,r);return d.jsx(U.h2,{id:o.titleId,...n,ref:t})});Yi.displayName=bo;var qi="DialogDescription",Xi=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(qi,r);return d.jsx(U.p,{id:o.descriptionId,...n,ref:t})});Xi.displayName=qi;var Zi="DialogClose",Ji=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ie(Zi,r);return d.jsx(U.button,{type:"button",...n,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});Ji.displayName=Zi;function yo(e){return e?"open":"closed"}var Qi="DialogTitleWarning",[Wb,ec]=vd(Qi,{contentName:mt,titleName:bo,docsSlug:"dialog"}),ig=({titleId:e})=>{const t=ec(Qi),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
121
121
|
|
|
122
122
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
123
123
|
|
|
124
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},cg="DialogDescriptionWarning",lg=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ec(cg).contentName}}.`;return l.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},tc=Vi,ug=Wi,rc=Gi,nc=Hi,oc=Ui,dg=Yi,fg=Xi,sc=Ji,Gt='[cmdk-group=""]',En='[cmdk-group-items=""]',pg='[cmdk-group-heading=""]',ac='[cmdk-item=""]',Fs=`${ac}:not([aria-disabled="true"])`,zn="cmdk-item-select",Pt="data-value",mg=(e,t,r)=>Zm(e,t,r),ic=l.createContext(void 0),rr=()=>l.useContext(ic),cc=l.createContext(void 0),wo=()=>l.useContext(cc),lc=l.createContext(void 0),uc=l.forwardRef((e,t)=>{let r=Rt(()=>{var R,F;return{search:"",value:(F=(R=e.value)!=null?R:e.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=Rt(()=>new Set),o=Rt(()=>new Map),s=Rt(()=>new Map),a=Rt(()=>new Set),i=dc(e),{label:c,children:u,value:f,onValueChange:p,filter:g,shouldFilter:v,loop:w,disablePointerSelection:m=!1,vimBindings:x=!0,...y}=e,h=ve(),C=ve(),S=ve(),k=l.useRef(null),N=Pg();gt(()=>{if(f!==void 0){let R=f.trim();r.current.value=R,_.emit()}},[f]),gt(()=>{N(6,Y)},[]);let _=l.useMemo(()=>({subscribe:R=>(a.current.add(R),()=>a.current.delete(R)),snapshot:()=>r.current,setState:(R,F,W)=>{var L,Q,O,q;if(!Object.is(r.current[R],F)){if(r.current[R]=F,R==="search")J(),K(),N(1,ee);else if(R==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(S);te?te.focus():(L=document.getElementById(h))==null||L.focus()}if(N(7,()=>{var te;r.current.selectedItemId=(te=z())==null?void 0:te.id,_.emit()}),W||N(5,Y),((Q=i.current)==null?void 0:Q.value)!==void 0){let te=F??"";(q=(O=i.current).onValueChange)==null||q.call(O,te);return}}_.emit()}},emit:()=>{a.current.forEach(R=>R())}}),[]),T=l.useMemo(()=>({value:(R,F,W)=>{var L;F!==((L=s.current.get(R))==null?void 0:L.value)&&(s.current.set(R,{value:F,keywords:W}),r.current.filtered.items.set(R,H(F,W)),N(2,()=>{K(),_.emit()}))},item:(R,F)=>(n.current.add(R),F&&(o.current.has(F)?o.current.get(F).add(R):o.current.set(F,new Set([R]))),N(3,()=>{J(),K(),r.current.value||ee(),_.emit()}),()=>{s.current.delete(R),n.current.delete(R),r.current.filtered.items.delete(R);let W=z();N(4,()=>{J(),(W==null?void 0:W.getAttribute("id"))===R&&ee(),_.emit()})}),group:R=>(o.current.has(R)||o.current.set(R,new Set),()=>{s.current.delete(R),o.current.delete(R)}),filter:()=>i.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:h,inputId:S,labelId:C,listInnerRef:k}),[]);function H(R,F){var W,L;let Q=(L=(W=i.current)==null?void 0:W.filter)!=null?L:mg;return R?Q(R,r.current.search,F):0}function K(){if(!r.current.search||i.current.shouldFilter===!1)return;let R=r.current.filtered.items,F=[];r.current.filtered.groups.forEach(L=>{let Q=o.current.get(L),O=0;Q.forEach(q=>{let te=R.get(q);O=Math.max(te,O)}),F.push([L,O])});let W=k.current;j().sort((L,Q)=>{var O,q;let te=L.getAttribute("id"),re=Q.getAttribute("id");return((O=R.get(re))!=null?O:0)-((q=R.get(te))!=null?q:0)}).forEach(L=>{let Q=L.closest(En);Q?Q.appendChild(L.parentElement===Q?L:L.closest(`${En} > *`)):W.appendChild(L.parentElement===W?L:L.closest(`${En} > *`))}),F.sort((L,Q)=>Q[1]-L[1]).forEach(L=>{var Q;let O=(Q=k.current)==null?void 0:Q.querySelector(`${Gt}[${Pt}="${encodeURIComponent(L[0])}"]`);O==null||O.parentElement.appendChild(O)})}function ee(){let R=j().find(W=>W.getAttribute("aria-disabled")!=="true"),F=R==null?void 0:R.getAttribute(Pt);_.setState("value",F||void 0)}function J(){var R,F,W,L;if(!r.current.search||i.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let Q=0;for(let O of n.current){let q=(F=(R=s.current.get(O))==null?void 0:R.value)!=null?F:"",te=(L=(W=s.current.get(O))==null?void 0:W.keywords)!=null?L:[],re=H(q,te);r.current.filtered.items.set(O,re),re>0&&Q++}for(let[O,q]of o.current)for(let te of q)if(r.current.filtered.items.get(te)>0){r.current.filtered.groups.add(O);break}r.current.filtered.count=Q}function Y(){var R,F,W;let L=z();L&&(((R=L.parentElement)==null?void 0:R.firstChild)===L&&((W=(F=L.closest(Gt))==null?void 0:F.querySelector(pg))==null||W.scrollIntoView({block:"nearest"})),L.scrollIntoView({block:"nearest"}))}function z(){var R;return(R=k.current)==null?void 0:R.querySelector(`${ac}[aria-selected="true"]`)}function j(){var R;return Array.from(((R=k.current)==null?void 0:R.querySelectorAll(Fs))||[])}function A(R){let F=j()[R];F&&_.setState("value",F.getAttribute(Pt))}function D(R){var F;let W=z(),L=j(),Q=L.findIndex(q=>q===W),O=L[Q+R];(F=i.current)!=null&&F.loop&&(O=Q+R<0?L[L.length-1]:Q+R===L.length?L[0]:L[Q+R]),O&&_.setState("value",O.getAttribute(Pt))}function E(R){let F=z(),W=F==null?void 0:F.closest(Gt),L;for(;W&&!L;)W=R>0?Sg(W,Gt):Eg(W,Gt),L=W==null?void 0:W.querySelector(Fs);L?_.setState("value",L.getAttribute(Pt)):D(R)}let G=()=>A(j().length-1),oe=R=>{R.preventDefault(),R.metaKey?G():R.altKey?E(1):D(1)},le=R=>{R.preventDefault(),R.metaKey?A(0):R.altKey?E(-1):D(-1)};return l.createElement(U.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:R=>{var F;(F=y.onKeyDown)==null||F.call(y,R);let W=R.nativeEvent.isComposing||R.keyCode===229;if(!(R.defaultPrevented||W))switch(R.key){case"n":case"j":{x&&R.ctrlKey&&oe(R);break}case"ArrowDown":{oe(R);break}case"p":case"k":{x&&R.ctrlKey&&le(R);break}case"ArrowUp":{le(R);break}case"Home":{R.preventDefault(),A(0);break}case"End":{R.preventDefault(),G();break}case"Enter":{R.preventDefault();let L=z();if(L){let Q=new Event(zn);L.dispatchEvent(Q)}}}}},l.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:kg},c),Xr(e,R=>l.createElement(cc.Provider,{value:_},l.createElement(ic.Provider,{value:T},R))))}),gg=l.forwardRef((e,t)=>{var r,n;let o=ve(),s=l.useRef(null),a=l.useContext(lc),i=rr(),c=dc(e),u=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:a==null?void 0:a.forceMount;gt(()=>{if(!u)return i.item(o,a==null?void 0:a.id)},[u]);let f=fc(o,s,[e.value,e.children,s],e.keywords),p=wo(),g=rt(N=>N.value&&N.value===f.current),v=rt(N=>u||i.filter()===!1?!0:N.search?N.filtered.items.get(o)>0:!0);l.useEffect(()=>{let N=s.current;if(!(!N||e.disabled))return N.addEventListener(zn,w),()=>N.removeEventListener(zn,w)},[v,e.onSelect,e.disabled]);function w(){var N,_;m(),(_=(N=c.current).onSelect)==null||_.call(N,f.current)}function m(){p.setState("value",f.current,!0)}if(!v)return null;let{disabled:x,value:y,onSelect:h,forceMount:C,keywords:S,...k}=e;return l.createElement(U.div,{ref:lt(s,t),...k,id:o,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!g,"data-disabled":!!x,"data-selected":!!g,onPointerMove:x||i.getDisablePointerSelection()?void 0:m,onClick:x?void 0:w},e.children)}),vg=l.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...s}=e,a=ve(),i=l.useRef(null),c=l.useRef(null),u=ve(),f=rr(),p=rt(v=>o||f.filter()===!1?!0:v.search?v.filtered.groups.has(a):!0);gt(()=>f.group(a),[]),fc(a,i,[e.value,e.heading,c]);let g=l.useMemo(()=>({id:a,forceMount:o}),[o]);return l.createElement(U.div,{ref:lt(i,t),...s,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&l.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),Xr(e,v=>l.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},l.createElement(lc.Provider,{value:g},v))))}),hg=l.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=l.useRef(null),s=rt(a=>!a.search);return!r&&!s?null:l.createElement(U.div,{ref:lt(o,t),...n,"cmdk-separator":"",role:"separator"})}),xg=l.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=e.value!=null,s=wo(),a=rt(u=>u.search),i=rt(u=>u.selectedItemId),c=rr();return l.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),l.createElement(U.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":i,id:c.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||s.setState("search",u.target.value),r==null||r(u.target.value)}})}),bg=l.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,s=l.useRef(null),a=l.useRef(null),i=rt(u=>u.selectedItemId),c=rr();return l.useEffect(()=>{if(a.current&&s.current){let u=a.current,f=s.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=u.offsetHeight;f.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return g.observe(u),()=>{cancelAnimationFrame(p),g.unobserve(u)}}},[]),l.createElement(U.div,{ref:lt(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":n,id:c.listId},Xr(e,u=>l.createElement("div",{ref:lt(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),yg=l.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:s,container:a,...i}=e;return l.createElement(tc,{open:r,onOpenChange:n},l.createElement(rc,{container:a},l.createElement(nc,{"cmdk-overlay":"",className:o}),l.createElement(oc,{"aria-label":e.label,"cmdk-dialog":"",className:s},l.createElement(uc,{ref:t,...i}))))}),wg=l.forwardRef((e,t)=>rt(r=>r.filtered.count===0)?l.createElement(U.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Cg=l.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...s}=e;return l.createElement(U.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Xr(e,a=>l.createElement("div",{"aria-hidden":!0},a)))}),Vt=Object.assign(uc,{List:bg,Item:gg,Input:xg,Group:vg,Separator:hg,Dialog:yg,Empty:wg,Loading:Cg});function Sg(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Eg(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function dc(e){let t=l.useRef(e);return gt(()=>{t.current=e}),t}var gt=typeof window>"u"?l.useEffect:l.useLayoutEffect;function Rt(e){let t=l.useRef();return t.current===void 0&&(t.current=e()),t}function rt(e){let t=wo(),r=()=>e(t.snapshot());return l.useSyncExternalStore(t.subscribe,r,r)}function fc(e,t,r,n=[]){let o=l.useRef(),s=rr();return gt(()=>{var a;let i=(()=>{var u;for(let f of r){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():o.current}})(),c=n.map(u=>u.trim());s.value(e,i,c),(a=t.current)==null||a.setAttribute(Pt,i),o.current=i}),o}var Pg=()=>{let[e,t]=l.useState(),r=Rt(()=>new Map);return gt(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,o)=>{r.current.set(n,o),t({})}};function Rg(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Xr({asChild:e,children:t},r){return e&&l.isValidElement(t)?l.cloneElement(Rg(t),{ref:t.ref},r(t.props.children)):r(t)}var kg={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Tg({...e}){return d.jsx(tc,{"data-slot":"dialog",...e})}function Ag({...e}){return d.jsx(ug,{"data-slot":"dialog-trigger",...e})}function pc({...e}){return d.jsx(rc,{"data-slot":"dialog-portal",...e})}function Ng({...e}){return d.jsx(sc,{"data-slot":"dialog-close",...e})}function mc({className:e,...t}){return d.jsx(nc,{"data-slot":"dialog-overlay",className:$("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-foreground/50 dark:bg-foreground/50",e),...t})}function _g({className:e,children:t,showCloseButton:r=!0,...n}){return d.jsxs(pc,{"data-slot":"dialog-portal",children:[d.jsx(mc,{}),d.jsxs(oc,{"data-slot":"dialog-content",className:$("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 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg dark:bg-background dark:border-border",e),...n,children:[t,r&&d.jsxs(sc,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 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:[d.jsx(Bm,{}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ig({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:$("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Og({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-footer",className:$("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function jg({className:e,...t}){return d.jsx(dg,{"data-slot":"dialog-title",className:$("text-lg leading-none font-semibold",e),...t})}function Dg({className:e,...t}){return d.jsx(fg,{"data-slot":"dialog-description",className:$("text-muted-foreground text-sm dark:text-muted-foreground",e),...t})}function Mg({className:e,...t}){return d.jsx(Vt,{"data-slot":"command",className:$("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Fg({className:e,...t}){return d.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b border-purple-mutted-400 px-3 text-purple-mutted-300",children:[d.jsx(Lm,{className:"size-4 shrink-0 opacity-50"}),d.jsx(Vt.Input,{"data-slot":"command-input",className:$("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function $g({className:e,...t}){return d.jsx(Vt.List,{"data-slot":"command-list",className:$("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Lg({...e}){return d.jsx(Vt.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm text-purple-mutted-300",...e})}function Vg({className:e,...t}){return d.jsx(Vt.Group,{"data-slot":"command-group",className:$("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function Bg({className:e,...t}){return d.jsx(Vt.Item,{"data-slot":"command-item",className:$("data-[selected=true]:bg-purple-mutted-500 data-[selected=true]:text-purple-100 [&_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",e),...t})}var Zr="Popover",[gc,Wb]=ke(Zr,[Ft]),nr=Ft(),[Wg,st]=gc(Zr),vc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=nr(t),c=l.useRef(null),[u,f]=l.useState(!1),[p,g]=Ee({prop:n,defaultProp:o??!1,onChange:s,caller:Zr});return d.jsx(ao,{...i,children:d.jsx(Wg,{scope:t,contentId:ve(),triggerRef:c,open:p,onOpenChange:g,onOpenToggle:l.useCallback(()=>g(v=>!v),[g]),hasCustomAnchor:u,onCustomAnchorAdd:l.useCallback(()=>f(!0),[]),onCustomAnchorRemove:l.useCallback(()=>f(!1),[]),modal:a,children:r})})};vc.displayName=Zr;var hc="PopoverAnchor",zg=l.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=st(hc,r),s=nr(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return l.useEffect(()=>(a(),()=>i()),[a,i]),d.jsx(zr,{...s,...n,ref:t})});zg.displayName=hc;var xc="PopoverTrigger",bc=l.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=st(xc,r),s=nr(r),a=de(t,o.triggerRef),i=d.jsx(U.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ec(o.open),...n,ref:a,onClick:Z(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:d.jsx(zr,{asChild:!0,...s,children:i})});bc.displayName=xc;var Co="PopoverPortal",[Gg,Hg]=gc(Co,{forceMount:void 0}),yc=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=st(Co,t);return d.jsx(Gg,{scope:t,forceMount:r,children:d.jsx(Ye,{present:r||s.open,children:d.jsx(tr,{asChild:!0,container:o,children:n})})})};yc.displayName=Co;var _t="PopoverContent",wc=l.forwardRef((e,t)=>{const r=Hg(_t,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=st(_t,e.__scopePopover);return d.jsx(Ye,{present:n||s.open,children:s.modal?d.jsx(Kg,{...o,ref:t}):d.jsx(Yg,{...o,ref:t})})});wc.displayName=_t;var Ug=ut("PopoverContent.RemoveScroll"),Kg=l.forwardRef((e,t)=>{const r=st(_t,e.__scopePopover),n=l.useRef(null),o=de(t,n),s=l.useRef(!1);return l.useEffect(()=>{const a=n.current;if(a)return lo(a)},[]),d.jsx(Hr,{as:Ug,allowPinchZoom:!0,children:d.jsx(Cc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),s.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,u=i.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Z(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Yg=l.forwardRef((e,t)=>{const r=st(_t,e.__scopePopover),n=l.useRef(!1),o=l.useRef(!1);return d.jsx(Cc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Cc=l.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...p}=e,g=st(_t,r),v=nr(r);return Zn(),d.jsx($r,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:d.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:d.jsx(io,{"data-state":Ec(g.open),role:"dialog",id:g.contentId,...v,...p,ref:t,style:{...p.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)"}})})})}),Sc="PopoverClose",qg=l.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=st(Sc,r);return d.jsx(U.button,{type:"button",...n,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});qg.displayName=Sc;var Xg="PopoverArrow",Zg=l.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=nr(r);return d.jsx(co,{...o,...n,ref:t})});Zg.displayName=Xg;function Ec(e){return e?"open":"closed"}var Jg=vc,Qg=bc,ev=yc,tv=wc;function rv({...e}){return d.jsx(Jg,{"data-slot":"popover",...e})}function nv({...e}){return d.jsx(Qg,{"data-slot":"popover-trigger",...e})}function ov({className:e,align:t="center",sideOffset:r=4,...n}){return d.jsx(ev,{children:d.jsx(tv,{"data-slot":"popover-content",align:t,sideOffset:r,className:$("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",e),...n})})}const So=l.forwardRef(({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:o="Search...",emptyText:s="No option found.",disabled:a=!1,className:i,...c},u)=>{const[f,p]=l.useState(!1),[g,v]=l.useState(0),w=l.useRef(null),m=e.find(x=>x.value===t);return l.useEffect(()=>{w.current&&v(w.current.offsetWidth)},[]),d.jsxs(rv,{open:f,onOpenChange:p,children:[d.jsx(nv,{asChild:!0,children:d.jsxs(Mr,{ref:x=>{typeof u=="function"?u(x):u&&(u.current=x),w.current=x},variant:"outline",role:"combobox","aria-expanded":f,className:$("w-full h-9 px-3 py-1 justify-between rounded-md","border border-purple-mutted-500 bg-purple-mutted-700 hover:bg-purple-mutted-700","text-sm md:text-sm text-purple-mutted-300 hover:text-purple-mutted-300 focus:text-purple-mutted-300 active:text-purple-mutted-300","shadow-xs transition-[color,box-shadow] outline-none",{"text-muted-foreground":!m},i),disabled:a,...c,children:[m?m.label:n,d.jsx(Fm,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),d.jsx(ov,{className:"p-0 border bg-purple-mutted-600 border-purple-mutted-500 text-purple-mutted-300",style:{width:g>0?`${g}px`:"auto"},children:d.jsxs(Mg,{className:"w-full bg-purple-mutted-600",children:[d.jsx(Fg,{placeholder:o}),d.jsxs($g,{children:[d.jsx(Lg,{children:s}),d.jsx(Vg,{children:e.map(x=>d.jsxs(Bg,{value:x.value,disabled:x.disabled,className:$("text-purple-100 hover:bg-purple-mutted-500","focus:bg-purple-mutted-500 focus:text-purple-100",{"bg-purple-mutted-500":t===x.value}),onSelect:y=>{y!==t&&(r==null||r(y===t?"":y)),p(!1)},children:[d.jsx(Oi,{className:$("mr-2 h-4 w-4",t===x.value?"opacity-100":"opacity-0")}),x.label]},x.value))})]})]})})]})});So.displayName="Combobox";const sv=Dr("inline-flex items-center justify-center rounded-md border px-2 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 dark:border-border",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90 dark:bg-primary dark:text-primary-foreground dark:[a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 dark:bg-secondary dark:text-secondary-foreground dark:[a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive dark:text-destructive-foreground dark:[a&]:hover:bg-destructive/90",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground dark:text-foreground dark:[a&]:hover:bg-accent dark:[a&]:hover:text-accent-foreground",success:"bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-400 dark:border-green-800 "}},defaultVariants:{variant:"default"}});function av({className:e,variant:t,asChild:r=!1,...n}){const o=r?fa:"span";return d.jsx(o,{"data-slot":"badge",className:$(sv({variant:t}),e),...n})}function iv({className:e,...t}){return d.jsx("div",{"data-slot":"card",className:$("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm dark:bg-card dark:text-card-foreground dark:border-border",e),...t})}function cv({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:$("@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",e),...t})}function lv({className:e,...t}){return d.jsx("div",{"data-slot":"card-title",className:$("leading-none font-semibold",e),...t})}function uv({className:e,...t}){return d.jsx("div",{"data-slot":"card-description",className:$("text-muted-foreground text-sm dark:text-muted-foreground",e),...t})}function dv({className:e,...t}){return d.jsx("div",{"data-slot":"card-action",className:$("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function fv({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:$("px-6",e),...t})}function pv({className:e,...t}){return d.jsx("div",{"data-slot":"card-footer",className:$("flex items-center px-6 [.border-t]:pt-6",e),...t})}var Eo="Progress",Po=100,[mv,zb]=ke(Eo),[gv,vv]=mv(Eo),Pc=l.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:o,getValueLabel:s=hv,...a}=e;(o||o===0)&&!$s(o)&&console.error(xv(`${o}`,"Progress"));const i=$s(o)?o:Po;n!==null&&!Ls(n,i)&&console.error(bv(`${n}`,"Progress"));const c=Ls(n,i)?n:null,u=Tr(c)?s(c,i):void 0;return d.jsx(gv,{scope:r,value:c,max:i,children:d.jsx(U.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Tr(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Tc(c,i),"data-value":c??void 0,"data-max":i,...a,ref:t})})});Pc.displayName=Eo;var Rc="ProgressIndicator",kc=l.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,o=vv(Rc,r);return d.jsx(U.div,{"data-state":Tc(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...n,ref:t})});kc.displayName=Rc;function hv(e,t){return`${Math.round(e/t*100)}%`}function Tc(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Tr(e){return typeof e=="number"}function $s(e){return Tr(e)&&!isNaN(e)&&e>0}function Ls(e,t){return Tr(e)&&!isNaN(e)&&e<=t&&e>=0}function xv(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Po}\`.`}function bv(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
124
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},cg="DialogDescriptionWarning",lg=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ec(cg).contentName}}.`;return l.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},tc=Vi,ug=Wi,rc=Gi,nc=Hi,oc=Ui,dg=Yi,fg=Xi,sc=Ji,Gt='[cmdk-group=""]',En='[cmdk-group-items=""]',pg='[cmdk-group-heading=""]',ac='[cmdk-item=""]',Fs=`${ac}:not([aria-disabled="true"])`,zn="cmdk-item-select",Pt="data-value",mg=(e,t,r)=>Zm(e,t,r),ic=l.createContext(void 0),rr=()=>l.useContext(ic),cc=l.createContext(void 0),wo=()=>l.useContext(cc),lc=l.createContext(void 0),uc=l.forwardRef((e,t)=>{let r=Rt(()=>{var R,F;return{search:"",value:(F=(R=e.value)!=null?R:e.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=Rt(()=>new Set),o=Rt(()=>new Map),s=Rt(()=>new Map),a=Rt(()=>new Set),i=dc(e),{label:c,children:u,value:f,onValueChange:p,filter:g,shouldFilter:v,loop:w,disablePointerSelection:m=!1,vimBindings:x=!0,...y}=e,h=ve(),C=ve(),S=ve(),k=l.useRef(null),N=Pg();gt(()=>{if(f!==void 0){let R=f.trim();r.current.value=R,_.emit()}},[f]),gt(()=>{N(6,Y)},[]);let _=l.useMemo(()=>({subscribe:R=>(a.current.add(R),()=>a.current.delete(R)),snapshot:()=>r.current,setState:(R,F,W)=>{var L,Q,O,q;if(!Object.is(r.current[R],F)){if(r.current[R]=F,R==="search")J(),K(),N(1,ee);else if(R==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(S);te?te.focus():(L=document.getElementById(h))==null||L.focus()}if(N(7,()=>{var te;r.current.selectedItemId=(te=z())==null?void 0:te.id,_.emit()}),W||N(5,Y),((Q=i.current)==null?void 0:Q.value)!==void 0){let te=F??"";(q=(O=i.current).onValueChange)==null||q.call(O,te);return}}_.emit()}},emit:()=>{a.current.forEach(R=>R())}}),[]),T=l.useMemo(()=>({value:(R,F,W)=>{var L;F!==((L=s.current.get(R))==null?void 0:L.value)&&(s.current.set(R,{value:F,keywords:W}),r.current.filtered.items.set(R,H(F,W)),N(2,()=>{K(),_.emit()}))},item:(R,F)=>(n.current.add(R),F&&(o.current.has(F)?o.current.get(F).add(R):o.current.set(F,new Set([R]))),N(3,()=>{J(),K(),r.current.value||ee(),_.emit()}),()=>{s.current.delete(R),n.current.delete(R),r.current.filtered.items.delete(R);let W=z();N(4,()=>{J(),(W==null?void 0:W.getAttribute("id"))===R&&ee(),_.emit()})}),group:R=>(o.current.has(R)||o.current.set(R,new Set),()=>{s.current.delete(R),o.current.delete(R)}),filter:()=>i.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:h,inputId:S,labelId:C,listInnerRef:k}),[]);function H(R,F){var W,L;let Q=(L=(W=i.current)==null?void 0:W.filter)!=null?L:mg;return R?Q(R,r.current.search,F):0}function K(){if(!r.current.search||i.current.shouldFilter===!1)return;let R=r.current.filtered.items,F=[];r.current.filtered.groups.forEach(L=>{let Q=o.current.get(L),O=0;Q.forEach(q=>{let te=R.get(q);O=Math.max(te,O)}),F.push([L,O])});let W=k.current;j().sort((L,Q)=>{var O,q;let te=L.getAttribute("id"),re=Q.getAttribute("id");return((O=R.get(re))!=null?O:0)-((q=R.get(te))!=null?q:0)}).forEach(L=>{let Q=L.closest(En);Q?Q.appendChild(L.parentElement===Q?L:L.closest(`${En} > *`)):W.appendChild(L.parentElement===W?L:L.closest(`${En} > *`))}),F.sort((L,Q)=>Q[1]-L[1]).forEach(L=>{var Q;let O=(Q=k.current)==null?void 0:Q.querySelector(`${Gt}[${Pt}="${encodeURIComponent(L[0])}"]`);O==null||O.parentElement.appendChild(O)})}function ee(){let R=j().find(W=>W.getAttribute("aria-disabled")!=="true"),F=R==null?void 0:R.getAttribute(Pt);_.setState("value",F||void 0)}function J(){var R,F,W,L;if(!r.current.search||i.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let Q=0;for(let O of n.current){let q=(F=(R=s.current.get(O))==null?void 0:R.value)!=null?F:"",te=(L=(W=s.current.get(O))==null?void 0:W.keywords)!=null?L:[],re=H(q,te);r.current.filtered.items.set(O,re),re>0&&Q++}for(let[O,q]of o.current)for(let te of q)if(r.current.filtered.items.get(te)>0){r.current.filtered.groups.add(O);break}r.current.filtered.count=Q}function Y(){var R,F,W;let L=z();L&&(((R=L.parentElement)==null?void 0:R.firstChild)===L&&((W=(F=L.closest(Gt))==null?void 0:F.querySelector(pg))==null||W.scrollIntoView({block:"nearest"})),L.scrollIntoView({block:"nearest"}))}function z(){var R;return(R=k.current)==null?void 0:R.querySelector(`${ac}[aria-selected="true"]`)}function j(){var R;return Array.from(((R=k.current)==null?void 0:R.querySelectorAll(Fs))||[])}function A(R){let F=j()[R];F&&_.setState("value",F.getAttribute(Pt))}function D(R){var F;let W=z(),L=j(),Q=L.findIndex(q=>q===W),O=L[Q+R];(F=i.current)!=null&&F.loop&&(O=Q+R<0?L[L.length-1]:Q+R===L.length?L[0]:L[Q+R]),O&&_.setState("value",O.getAttribute(Pt))}function E(R){let F=z(),W=F==null?void 0:F.closest(Gt),L;for(;W&&!L;)W=R>0?Sg(W,Gt):Eg(W,Gt),L=W==null?void 0:W.querySelector(Fs);L?_.setState("value",L.getAttribute(Pt)):D(R)}let G=()=>A(j().length-1),oe=R=>{R.preventDefault(),R.metaKey?G():R.altKey?E(1):D(1)},le=R=>{R.preventDefault(),R.metaKey?A(0):R.altKey?E(-1):D(-1)};return l.createElement(U.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:R=>{var F;(F=y.onKeyDown)==null||F.call(y,R);let W=R.nativeEvent.isComposing||R.keyCode===229;if(!(R.defaultPrevented||W))switch(R.key){case"n":case"j":{x&&R.ctrlKey&&oe(R);break}case"ArrowDown":{oe(R);break}case"p":case"k":{x&&R.ctrlKey&&le(R);break}case"ArrowUp":{le(R);break}case"Home":{R.preventDefault(),A(0);break}case"End":{R.preventDefault(),G();break}case"Enter":{R.preventDefault();let L=z();if(L){let Q=new Event(zn);L.dispatchEvent(Q)}}}}},l.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:kg},c),Xr(e,R=>l.createElement(cc.Provider,{value:_},l.createElement(ic.Provider,{value:T},R))))}),gg=l.forwardRef((e,t)=>{var r,n;let o=ve(),s=l.useRef(null),a=l.useContext(lc),i=rr(),c=dc(e),u=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:a==null?void 0:a.forceMount;gt(()=>{if(!u)return i.item(o,a==null?void 0:a.id)},[u]);let f=fc(o,s,[e.value,e.children,s],e.keywords),p=wo(),g=rt(N=>N.value&&N.value===f.current),v=rt(N=>u||i.filter()===!1?!0:N.search?N.filtered.items.get(o)>0:!0);l.useEffect(()=>{let N=s.current;if(!(!N||e.disabled))return N.addEventListener(zn,w),()=>N.removeEventListener(zn,w)},[v,e.onSelect,e.disabled]);function w(){var N,_;m(),(_=(N=c.current).onSelect)==null||_.call(N,f.current)}function m(){p.setState("value",f.current,!0)}if(!v)return null;let{disabled:x,value:y,onSelect:h,forceMount:C,keywords:S,...k}=e;return l.createElement(U.div,{ref:lt(s,t),...k,id:o,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!g,"data-disabled":!!x,"data-selected":!!g,onPointerMove:x||i.getDisablePointerSelection()?void 0:m,onClick:x?void 0:w},e.children)}),vg=l.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...s}=e,a=ve(),i=l.useRef(null),c=l.useRef(null),u=ve(),f=rr(),p=rt(v=>o||f.filter()===!1?!0:v.search?v.filtered.groups.has(a):!0);gt(()=>f.group(a),[]),fc(a,i,[e.value,e.heading,c]);let g=l.useMemo(()=>({id:a,forceMount:o}),[o]);return l.createElement(U.div,{ref:lt(i,t),...s,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&l.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),Xr(e,v=>l.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},l.createElement(lc.Provider,{value:g},v))))}),hg=l.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=l.useRef(null),s=rt(a=>!a.search);return!r&&!s?null:l.createElement(U.div,{ref:lt(o,t),...n,"cmdk-separator":"",role:"separator"})}),xg=l.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=e.value!=null,s=wo(),a=rt(u=>u.search),i=rt(u=>u.selectedItemId),c=rr();return l.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),l.createElement(U.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":i,id:c.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||s.setState("search",u.target.value),r==null||r(u.target.value)}})}),bg=l.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,s=l.useRef(null),a=l.useRef(null),i=rt(u=>u.selectedItemId),c=rr();return l.useEffect(()=>{if(a.current&&s.current){let u=a.current,f=s.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=u.offsetHeight;f.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return g.observe(u),()=>{cancelAnimationFrame(p),g.unobserve(u)}}},[]),l.createElement(U.div,{ref:lt(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":n,id:c.listId},Xr(e,u=>l.createElement("div",{ref:lt(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),yg=l.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:s,container:a,...i}=e;return l.createElement(tc,{open:r,onOpenChange:n},l.createElement(rc,{container:a},l.createElement(nc,{"cmdk-overlay":"",className:o}),l.createElement(oc,{"aria-label":e.label,"cmdk-dialog":"",className:s},l.createElement(uc,{ref:t,...i}))))}),wg=l.forwardRef((e,t)=>rt(r=>r.filtered.count===0)?l.createElement(U.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Cg=l.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...s}=e;return l.createElement(U.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Xr(e,a=>l.createElement("div",{"aria-hidden":!0},a)))}),Vt=Object.assign(uc,{List:bg,Item:gg,Input:xg,Group:vg,Separator:hg,Dialog:yg,Empty:wg,Loading:Cg});function Sg(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Eg(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function dc(e){let t=l.useRef(e);return gt(()=>{t.current=e}),t}var gt=typeof window>"u"?l.useEffect:l.useLayoutEffect;function Rt(e){let t=l.useRef();return t.current===void 0&&(t.current=e()),t}function rt(e){let t=wo(),r=()=>e(t.snapshot());return l.useSyncExternalStore(t.subscribe,r,r)}function fc(e,t,r,n=[]){let o=l.useRef(),s=rr();return gt(()=>{var a;let i=(()=>{var u;for(let f of r){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():o.current}})(),c=n.map(u=>u.trim());s.value(e,i,c),(a=t.current)==null||a.setAttribute(Pt,i),o.current=i}),o}var Pg=()=>{let[e,t]=l.useState(),r=Rt(()=>new Map);return gt(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,o)=>{r.current.set(n,o),t({})}};function Rg(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Xr({asChild:e,children:t},r){return e&&l.isValidElement(t)?l.cloneElement(Rg(t),{ref:t.ref},r(t.props.children)):r(t)}var kg={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Tg({...e}){return d.jsx(tc,{"data-slot":"dialog",...e})}function Ag({...e}){return d.jsx(ug,{"data-slot":"dialog-trigger",...e})}function pc({...e}){return d.jsx(rc,{"data-slot":"dialog-portal",...e})}function Ng({...e}){return d.jsx(sc,{"data-slot":"dialog-close",...e})}function mc({className:e,...t}){return d.jsx(nc,{"data-slot":"dialog-overlay",className:$("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-foreground/50 dark:bg-foreground/50",e),...t})}function _g({className:e,children:t,showCloseButton:r=!0,...n}){return d.jsxs(pc,{"data-slot":"dialog-portal",children:[d.jsx(mc,{}),d.jsxs(oc,{"data-slot":"dialog-content",className:$("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 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg dark:bg-background dark:border-border",e),...n,children:[t,r&&d.jsxs(sc,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 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:[d.jsx(Bm,{}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ig({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:$("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Og({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-footer",className:$("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function jg({className:e,...t}){return d.jsx(dg,{"data-slot":"dialog-title",className:$("text-lg leading-none font-semibold",e),...t})}function Dg({className:e,...t}){return d.jsx(fg,{"data-slot":"dialog-description",className:$("text-muted-foreground text-sm dark:text-muted-foreground",e),...t})}function Mg({className:e,...t}){return d.jsx(Vt,{"data-slot":"command",className:$("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Fg({className:e,...t}){return d.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b border-purple-mutted-400 px-3 text-purple-mutted-300",children:[d.jsx(Lm,{className:"size-4 shrink-0 opacity-50"}),d.jsx(Vt.Input,{"data-slot":"command-input",className:$("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function $g({className:e,...t}){return d.jsx(Vt.List,{"data-slot":"command-list",className:$("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Lg({...e}){return d.jsx(Vt.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm text-purple-mutted-300",...e})}function Vg({className:e,...t}){return d.jsx(Vt.Group,{"data-slot":"command-group",className:$("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function Bg({className:e,...t}){return d.jsx(Vt.Item,{"data-slot":"command-item",className:$("data-[selected=true]:bg-purple-mutted-500 data-[selected=true]:text-purple-100 [&_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",e),...t})}var Zr="Popover",[gc,zb]=ke(Zr,[Ft]),nr=Ft(),[Wg,st]=gc(Zr),vc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=nr(t),c=l.useRef(null),[u,f]=l.useState(!1),[p,g]=Ee({prop:n,defaultProp:o??!1,onChange:s,caller:Zr});return d.jsx(ao,{...i,children:d.jsx(Wg,{scope:t,contentId:ve(),triggerRef:c,open:p,onOpenChange:g,onOpenToggle:l.useCallback(()=>g(v=>!v),[g]),hasCustomAnchor:u,onCustomAnchorAdd:l.useCallback(()=>f(!0),[]),onCustomAnchorRemove:l.useCallback(()=>f(!1),[]),modal:a,children:r})})};vc.displayName=Zr;var hc="PopoverAnchor",zg=l.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=st(hc,r),s=nr(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return l.useEffect(()=>(a(),()=>i()),[a,i]),d.jsx(zr,{...s,...n,ref:t})});zg.displayName=hc;var xc="PopoverTrigger",bc=l.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=st(xc,r),s=nr(r),a=de(t,o.triggerRef),i=d.jsx(U.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ec(o.open),...n,ref:a,onClick:Z(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:d.jsx(zr,{asChild:!0,...s,children:i})});bc.displayName=xc;var Co="PopoverPortal",[Gg,Hg]=gc(Co,{forceMount:void 0}),yc=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=st(Co,t);return d.jsx(Gg,{scope:t,forceMount:r,children:d.jsx(Ye,{present:r||s.open,children:d.jsx(tr,{asChild:!0,container:o,children:n})})})};yc.displayName=Co;var _t="PopoverContent",wc=l.forwardRef((e,t)=>{const r=Hg(_t,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=st(_t,e.__scopePopover);return d.jsx(Ye,{present:n||s.open,children:s.modal?d.jsx(Kg,{...o,ref:t}):d.jsx(Yg,{...o,ref:t})})});wc.displayName=_t;var Ug=ut("PopoverContent.RemoveScroll"),Kg=l.forwardRef((e,t)=>{const r=st(_t,e.__scopePopover),n=l.useRef(null),o=de(t,n),s=l.useRef(!1);return l.useEffect(()=>{const a=n.current;if(a)return lo(a)},[]),d.jsx(Hr,{as:Ug,allowPinchZoom:!0,children:d.jsx(Cc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),s.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,u=i.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Z(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Yg=l.forwardRef((e,t)=>{const r=st(_t,e.__scopePopover),n=l.useRef(!1),o=l.useRef(!1);return d.jsx(Cc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Cc=l.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...p}=e,g=st(_t,r),v=nr(r);return Zn(),d.jsx($r,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:d.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:d.jsx(io,{"data-state":Ec(g.open),role:"dialog",id:g.contentId,...v,...p,ref:t,style:{...p.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)"}})})})}),Sc="PopoverClose",qg=l.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=st(Sc,r);return d.jsx(U.button,{type:"button",...n,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});qg.displayName=Sc;var Xg="PopoverArrow",Zg=l.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=nr(r);return d.jsx(co,{...o,...n,ref:t})});Zg.displayName=Xg;function Ec(e){return e?"open":"closed"}var Jg=vc,Qg=bc,ev=yc,tv=wc;function rv({...e}){return d.jsx(Jg,{"data-slot":"popover",...e})}function nv({...e}){return d.jsx(Qg,{"data-slot":"popover-trigger",...e})}function ov({className:e,align:t="center",sideOffset:r=4,...n}){return d.jsx(ev,{children:d.jsx(tv,{"data-slot":"popover-content",align:t,sideOffset:r,className:$("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",e),...n})})}const So=l.forwardRef(({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:o="Search...",emptyText:s="No option found.",disabled:a=!1,className:i,...c},u)=>{const[f,p]=l.useState(!1),[g,v]=l.useState(0),w=l.useRef(null),m=e.find(x=>x.value===t);return l.useEffect(()=>{w.current&&v(w.current.offsetWidth)},[]),d.jsxs(rv,{open:f,onOpenChange:p,children:[d.jsx(nv,{asChild:!0,children:d.jsxs(Mr,{ref:x=>{typeof u=="function"?u(x):u&&(u.current=x),w.current=x},variant:"outline",role:"combobox","aria-expanded":f,className:$("w-full h-9 px-3 py-1 justify-between rounded-md","border border-purple-mutted-500 bg-purple-mutted-700 hover:bg-purple-mutted-700","text-sm md:text-sm text-purple-mutted-300 hover:text-purple-mutted-300 focus:text-purple-mutted-300 active:text-purple-mutted-300","shadow-xs transition-[color,box-shadow] outline-none",{"text-muted-foreground":!m},i),disabled:a,...c,children:[m?m.label:n,d.jsx(Fm,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),d.jsx(ov,{className:"p-0 border bg-purple-mutted-600 border-purple-mutted-500 text-purple-mutted-300",style:{width:g>0?`${g}px`:"auto"},children:d.jsxs(Mg,{className:"w-full bg-purple-mutted-600",children:[d.jsx(Fg,{placeholder:o}),d.jsxs($g,{children:[d.jsx(Lg,{children:s}),d.jsx(Vg,{children:e.map(x=>d.jsxs(Bg,{value:x.value,disabled:x.disabled,className:$("text-purple-100 hover:bg-purple-mutted-500","focus:bg-purple-mutted-500 focus:text-purple-100",{"bg-purple-mutted-500":t===x.value}),onSelect:y=>{y!==t&&(r==null||r(y===t?"":y)),p(!1)},children:[d.jsx(Oi,{className:$("mr-2 h-4 w-4",t===x.value?"opacity-100":"opacity-0")}),x.label]},x.value))})]})]})})]})});So.displayName="Combobox";const sv=Dr("inline-flex items-center justify-center rounded-md border px-2 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 dark:border-border",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90 dark:bg-primary dark:text-primary-foreground dark:[a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 dark:bg-secondary dark:text-secondary-foreground dark:[a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive dark:text-destructive-foreground dark:[a&]:hover:bg-destructive/90",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground dark:text-foreground dark:[a&]:hover:bg-accent dark:[a&]:hover:text-accent-foreground",success:"bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-400 dark:border-green-800 "}},defaultVariants:{variant:"default"}});function av({className:e,variant:t,asChild:r=!1,...n}){const o=r?fa:"span";return d.jsx(o,{"data-slot":"badge",className:$(sv({variant:t}),e),...n})}function iv({className:e,...t}){return d.jsx("div",{"data-slot":"card",className:$("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm dark:bg-card dark:text-card-foreground dark:border-border",e),...t})}function cv({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:$("@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",e),...t})}function lv({className:e,...t}){return d.jsx("div",{"data-slot":"card-title",className:$("leading-none font-semibold",e),...t})}function uv({className:e,...t}){return d.jsx("div",{"data-slot":"card-description",className:$("text-muted-foreground text-sm dark:text-muted-foreground",e),...t})}function dv({className:e,...t}){return d.jsx("div",{"data-slot":"card-action",className:$("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function fv({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:$("px-6",e),...t})}function pv({className:e,...t}){return d.jsx("div",{"data-slot":"card-footer",className:$("flex items-center px-6 [.border-t]:pt-6",e),...t})}var Eo="Progress",Po=100,[mv,Gb]=ke(Eo),[gv,vv]=mv(Eo),Pc=l.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:o,getValueLabel:s=hv,...a}=e;(o||o===0)&&!$s(o)&&console.error(xv(`${o}`,"Progress"));const i=$s(o)?o:Po;n!==null&&!Ls(n,i)&&console.error(bv(`${n}`,"Progress"));const c=Ls(n,i)?n:null,u=Tr(c)?s(c,i):void 0;return d.jsx(gv,{scope:r,value:c,max:i,children:d.jsx(U.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Tr(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Tc(c,i),"data-value":c??void 0,"data-max":i,...a,ref:t})})});Pc.displayName=Eo;var Rc="ProgressIndicator",kc=l.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,o=vv(Rc,r);return d.jsx(U.div,{"data-state":Tc(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...n,ref:t})});kc.displayName=Rc;function hv(e,t){return`${Math.round(e/t*100)}%`}function Tc(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Tr(e){return typeof e=="number"}function $s(e){return Tr(e)&&!isNaN(e)&&e>0}function Ls(e,t){return Tr(e)&&!isNaN(e)&&e<=t&&e>=0}function xv(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Po}\`.`}function bv(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
125
125
|
- a positive number
|
|
126
126
|
- less than the value passed to \`max\` (or ${Po} if no \`max\` prop is set)
|
|
127
127
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
128
128
|
|
|
129
|
-
Defaulting to \`null\`.`}var yv=Pc,wv=kc;function Cv({className:e,value:t,...r}){return d.jsx(yv,{"data-slot":"progress",className:$("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full dark:bg-primary/20",e),...r,children:d.jsx(wv,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all dark:bg-primary",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Sv({className:e,...t}){return d.jsx("div",{"data-slot":"skeleton",className:$("bg-accent animate-pulse rounded-md dark:bg-accent",e),...t})}var Jr="Switch",[Ev,Gb]=ke(Jr),[Pv,Rv]=Ev(Jr),Ac=l.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:s,required:a,disabled:i,value:c="on",onCheckedChange:u,form:f,...p}=e,[g,v]=l.useState(null),w=de(t,C=>v(C)),m=l.useRef(!1),x=g?f||!!g.closest("form"):!0,[y,h]=Ee({prop:o,defaultProp:s??!1,onChange:u,caller:Jr});return d.jsxs(Pv,{scope:r,checked:y,disabled:i,children:[d.jsx(U.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":Oc(y),"data-disabled":i?"":void 0,disabled:i,value:c,...p,ref:w,onClick:Z(e.onClick,C=>{h(S=>!S),x&&(m.current=C.isPropagationStopped(),m.current||C.stopPropagation())})}),x&&d.jsx(Ic,{control:g,bubbles:!m.current,name:n,value:c,checked:y,required:a,disabled:i,form:f,style:{transform:"translateX(-100%)"}})]})});Ac.displayName=Jr;var Nc="SwitchThumb",_c=l.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=Rv(Nc,r);return d.jsx(U.span,{"data-state":Oc(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});_c.displayName=Nc;var kv="SwitchBubbleInput",Ic=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},s)=>{const a=l.useRef(null),i=de(a,s),c=La(r),u=Aa(t);return l.useEffect(()=>{const f=a.current;if(!f)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==r&&v){const w=new Event("click",{bubbles:n});v.call(f,r),f.dispatchEvent(w)}},[c,r,n]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:i,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ic.displayName=kv;function Oc(e){return e?"checked":"unchecked"}var Tv=Ac,Av=_c;function Nv({className:e,...t}){return d.jsx(Tv,{"data-slot":"switch",className:$("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=checked]:bg-primary dark:data-[state=unchecked]:bg-input",e),...t,children:d.jsx(Av,{"data-slot":"switch-thumb",className:$("bg-background pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground")})})}var jc="Toggle",Ro=l.forwardRef((e,t)=>{const{pressed:r,defaultPressed:n,onPressedChange:o,...s}=e,[a,i]=Ee({prop:r,onChange:o,defaultProp:n??!1,caller:jc});return d.jsx(U.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:Z(e.onClick,()=>{e.disabled||i(!a)})})});Ro.displayName=jc;var _v=Ro;const Dc=Dr("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium text-foreground hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap dark:text-foreground dark:hover:bg-muted dark:hover:text-muted-foreground dark:data-[state=on]:bg-accent dark:data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent text-foreground dark:bg-transparent dark:text-foreground",outline:"border border-input bg-transparent text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-transparent dark:text-foreground dark:hover:bg-accent dark:hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Iv({className:e,variant:t,size:r,...n}){return d.jsx(_v,{"data-slot":"toggle",className:$(Dc({variant:t,size:r,className:e})),...n})}var Pn="rovingFocusGroup.onEntryFocus",Ov={bubbles:!1,cancelable:!0},or="RovingFocusGroup",[Gn,Mc,jv]=Xn(or),[Dv,Fc]=ke(or,[jv]),[Mv,Fv]=Dv(or),$c=l.forwardRef((e,t)=>d.jsx(Gn.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Gn.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx($v,{...e,ref:t})})}));$c.displayName=or;var $v=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=e,g=l.useRef(null),v=de(t,g),w=Fr(s),[m,x]=Ee({prop:a,defaultProp:i??null,onChange:c,caller:or}),[y,h]=l.useState(!1),C=Qe(u),S=Mc(r),k=l.useRef(!1),[N,_]=l.useState(0);return l.useEffect(()=>{const T=g.current;if(T)return T.addEventListener(Pn,C),()=>T.removeEventListener(Pn,C)},[C]),d.jsx(Mv,{scope:r,orientation:n,dir:w,loop:o,currentTabStopId:m,onItemFocus:l.useCallback(T=>x(T),[x]),onItemShiftTab:l.useCallback(()=>h(!0),[]),onFocusableItemAdd:l.useCallback(()=>_(T=>T+1),[]),onFocusableItemRemove:l.useCallback(()=>_(T=>T-1),[]),children:d.jsx(U.div,{tabIndex:y||N===0?-1:0,"data-orientation":n,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{k.current=!0}),onFocus:Z(e.onFocus,T=>{const H=!k.current;if(T.target===T.currentTarget&&H&&!y){const K=new CustomEvent(Pn,Ov);if(T.currentTarget.dispatchEvent(K),!K.defaultPrevented){const ee=S().filter(A=>A.focusable),J=ee.find(A=>A.active),Y=ee.find(A=>A.id===m),j=[J,Y,...ee].filter(Boolean).map(A=>A.ref.current);Bc(j,f)}}k.current=!1}),onBlur:Z(e.onBlur,()=>h(!1))})})}),Lc="RovingFocusGroupItem",Vc=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:a,...i}=e,c=ve(),u=s||c,f=Fv(Lc,r),p=f.currentTabStopId===u,g=Mc(r),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:m}=f;return l.useEffect(()=>{if(n)return v(),()=>w()},[n,v,w]),d.jsx(Gn.ItemSlot,{scope:r,id:u,focusable:n,active:o,children:d.jsx(U.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:Z(e.onMouseDown,x=>{n?f.onItemFocus(u):x.preventDefault()}),onFocus:Z(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=Bv(x,f.orientation,f.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let C=g().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){y==="prev"&&C.reverse();const S=C.indexOf(x.currentTarget);C=f.loop?Wv(C,S+1):C.slice(S+1)}setTimeout(()=>Bc(C))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:m!=null}):a})})});Vc.displayName=Lc;var Lv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Vv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Bv(e,t,r){const n=Vv(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Lv[n]}function Bc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Wv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var zv=$c,Gv=Vc,at="ToggleGroup",[Wc,Hb]=ke(at,[Fc]),zc=Fc(),ko=P.forwardRef((e,t)=>{const{type:r,...n}=e;if(r==="single"){const o=n;return d.jsx(Hv,{...o,ref:t})}if(r==="multiple"){const o=n;return d.jsx(Uv,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${at}\``)});ko.displayName=at;var[Gc,Hc]=Wc(at),Hv=P.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...s}=e,[a,i]=Ee({prop:r,defaultProp:n??"",onChange:o,caller:at});return d.jsx(Gc,{scope:e.__scopeToggleGroup,type:"single",value:P.useMemo(()=>a?[a]:[],[a]),onItemActivate:i,onItemDeactivate:P.useCallback(()=>i(""),[i]),children:d.jsx(Uc,{...s,ref:t})})}),Uv=P.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...s}=e,[a,i]=Ee({prop:r,defaultProp:n??[],onChange:o,caller:at}),c=P.useCallback(f=>i((p=[])=>[...p,f]),[i]),u=P.useCallback(f=>i((p=[])=>p.filter(g=>g!==f)),[i]);return d.jsx(Gc,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:d.jsx(Uc,{...s,ref:t})})});ko.displayName=at;var[Kv,Yv]=Wc(at),Uc=P.forwardRef((e,t)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:o=!0,orientation:s,dir:a,loop:i=!0,...c}=e,u=zc(r),f=Fr(a),p={role:"group",dir:f,...c};return d.jsx(Kv,{scope:r,rovingFocus:o,disabled:n,children:o?d.jsx(zv,{asChild:!0,...u,orientation:s,dir:f,loop:i,children:d.jsx(U.div,{...p,ref:t})}):d.jsx(U.div,{...p,ref:t})})}),Ar="ToggleGroupItem",Kc=P.forwardRef((e,t)=>{const r=Hc(Ar,e.__scopeToggleGroup),n=Yv(Ar,e.__scopeToggleGroup),o=zc(e.__scopeToggleGroup),s=r.value.includes(e.value),a=n.disabled||e.disabled,i={...e,pressed:s,disabled:a},c=P.useRef(null);return n.rovingFocus?d.jsx(Gv,{asChild:!0,...o,focusable:!a,active:s,ref:c,children:d.jsx(Vs,{...i,ref:t})}):d.jsx(Vs,{...i,ref:t})});Kc.displayName=Ar;var Vs=P.forwardRef((e,t)=>{const{__scopeToggleGroup:r,value:n,...o}=e,s=Hc(Ar,r),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=s.type==="single"?a:void 0;return d.jsx(Ro,{...i,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(n):s.onItemDeactivate(n)}})}),qv=ko,Xv=Kc;const Yc=l.createContext({size:"default",variant:"default"});function Zv({className:e,variant:t,size:r,children:n,...o}){return d.jsx(qv,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:$("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs dark:data-[variant=outline]:shadow-xs",e),...o,children:d.jsx(Yc.Provider,{value:{variant:t,size:r},children:n})})}function Jv({className:e,children:t,variant:r,size:n,...o}){const s=l.useContext(Yc);return d.jsx(Xv,{"data-slot":"toggle-group-item","data-variant":s.variant||r,"data-size":s.size||n,className:$(Dc({variant:s.variant||r,size:s.size||n}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",e),...o,children:t})}var[Qr,Ub]=ke("Tooltip",[Ft]),en=Ft(),qc="TooltipProvider",Qv=700,Hn="tooltip.open",[eh,To]=Qr(qc),Xc=e=>{const{__scopeTooltip:t,delayDuration:r=Qv,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,a=l.useRef(!0),i=l.useRef(!1),c=l.useRef(0);return l.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),d.jsx(eh,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:l.useCallback(u=>{i.current=u},[]),disableHoverableContent:o,children:s})};Xc.displayName=qc;var Zt="Tooltip",[th,sr]=Qr(Zt),Zc=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,c=To(Zt,e.__scopeTooltip),u=en(t),[f,p]=l.useState(null),g=ve(),v=l.useRef(0),w=a??c.disableHoverableContent,m=i??c.delayDuration,x=l.useRef(!1),[y,h]=Ee({prop:n,defaultProp:o??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Hn))):c.onClose(),s==null||s(_)},caller:Zt}),C=l.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),S=l.useCallback(()=>{window.clearTimeout(v.current),v.current=0,x.current=!1,h(!0)},[h]),k=l.useCallback(()=>{window.clearTimeout(v.current),v.current=0,h(!1)},[h]),N=l.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{x.current=!0,h(!0),v.current=0},m)},[m,h]);return l.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),d.jsx(ao,{...u,children:d.jsx(th,{scope:t,contentId:g,open:y,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:l.useCallback(()=>{c.isOpenDelayedRef.current?N():S()},[c.isOpenDelayedRef,N,S]),onTriggerLeave:l.useCallback(()=>{w?k():(window.clearTimeout(v.current),v.current=0)},[k,w]),onOpen:S,onClose:k,disableHoverableContent:w,children:r})})};Zc.displayName=Zt;var Un="TooltipTrigger",Jc=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=sr(Un,r),s=To(Un,r),a=en(r),i=l.useRef(null),c=de(t,i,o.onTriggerChange),u=l.useRef(!1),f=l.useRef(!1),p=l.useCallback(()=>u.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.jsx(zr,{asChild:!0,...a,children:d.jsx(U.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:Z(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Z(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Z(e.onBlur,o.onClose),onClick:Z(e.onClick,o.onClose)})})});Jc.displayName=Un;var Ao="TooltipPortal",[rh,nh]=Qr(Ao,{forceMount:void 0}),Qc=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,s=sr(Ao,t);return d.jsx(rh,{scope:t,forceMount:r,children:d.jsx(Ye,{present:r||s.open,children:d.jsx(tr,{asChild:!0,container:o,children:n})})})};Qc.displayName=Ao;var It="TooltipContent",el=l.forwardRef((e,t)=>{const r=nh(It,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,a=sr(It,e.__scopeTooltip);return d.jsx(Ye,{present:n||a.open,children:a.disableHoverableContent?d.jsx(tl,{side:o,...s,ref:t}):d.jsx(oh,{side:o,...s,ref:t})})}),oh=l.forwardRef((e,t)=>{const r=sr(It,e.__scopeTooltip),n=To(It,e.__scopeTooltip),o=l.useRef(null),s=de(t,o),[a,i]=l.useState(null),{trigger:c,onClose:u}=r,f=o.current,{onPointerInTransitChange:p}=n,g=l.useCallback(()=>{i(null),p(!1)},[p]),v=l.useCallback((w,m)=>{const x=w.currentTarget,y={x:w.clientX,y:w.clientY},h=ch(y,x.getBoundingClientRect()),C=lh(y,h),S=uh(m.getBoundingClientRect()),k=fh([...C,...S]);i(k),p(!0)},[p]);return l.useEffect(()=>()=>g(),[g]),l.useEffect(()=>{if(c&&f){const w=x=>v(x,f),m=x=>v(x,c);return c.addEventListener("pointerleave",w),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",m)}}},[c,f,v,g]),l.useEffect(()=>{if(a){const w=m=>{const x=m.target,y={x:m.clientX,y:m.clientY},h=(c==null?void 0:c.contains(x))||(f==null?void 0:f.contains(x)),C=!dh(y,a);h?g():C&&(g(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,f,a,u,g]),d.jsx(tl,{...e,ref:s})}),[sh,ah]=Qr(Zt,{isInside:!1}),ih=bd("TooltipContent"),tl=l.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,c=sr(It,r),u=en(r),{onClose:f}=c;return l.useEffect(()=>(document.addEventListener(Hn,f),()=>document.removeEventListener(Hn,f)),[f]),l.useEffect(()=>{if(c.trigger){const p=g=>{const v=g.target;v!=null&&v.contains(c.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,f]),d.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:d.jsxs(io,{"data-state":c.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(ih,{children:n}),d.jsx(sh,{scope:r,isInside:!0,children:d.jsx(pp,{id:c.contentId,role:"tooltip",children:o||n})})]})})});el.displayName=It;var rl="TooltipArrow",nl=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=en(r);return ah(rl,r).isInside?null:d.jsx(co,{...o,...n,ref:t})});nl.displayName=rl;function ch(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function lh(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function uh(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function dh(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],c=t[a],u=i.x,f=i.y,p=c.x,g=c.y;f>n!=g>n&&r<(p-u)*(n-f)/(g-f)+u&&(o=!o)}return o}function fh(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),ph(t)}function ph(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],a=r[r.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var mh=Xc,gh=Zc,vh=Jc,hh=Qc,xh=el,bh=nl;function ol({delayDuration:e=0,...t}){return d.jsx(mh,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function sl({...e}){return d.jsx(ol,{children:d.jsx(gh,{"data-slot":"tooltip",...e})})}function al({...e}){return d.jsx(vh,{"data-slot":"tooltip-trigger",...e})}function il({className:e,sideOffset:t=0,children:r,...n}){return d.jsx(hh,{children:d.jsxs(xh,{"data-slot":"tooltip-content",sideOffset:t,className:$("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance dark:bg-primary dark:text-primary-foreground",e),...n,children:[r,d.jsx(bh,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] dark:bg-primary dark:fill-primary"})]})})}var tn="Collapsible",[yh,cl]=ke(tn),[wh,No]=yh(tn),ll=l.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:s,onOpenChange:a,...i}=e,[c,u]=Ee({prop:n,defaultProp:o??!1,onChange:a,caller:tn});return d.jsx(wh,{scope:r,disabled:s,contentId:ve(),open:c,onOpenToggle:l.useCallback(()=>u(f=>!f),[u]),children:d.jsx(U.div,{"data-state":Io(c),"data-disabled":s?"":void 0,...i,ref:t})})});ll.displayName=tn;var ul="CollapsibleTrigger",dl=l.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=No(ul,r);return d.jsx(U.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Io(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:Z(e.onClick,o.onOpenToggle)})});dl.displayName=ul;var _o="CollapsibleContent",fl=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=No(_o,e.__scopeCollapsible);return d.jsx(Ye,{present:r||o.open,children:({present:s})=>d.jsx(Ch,{...n,ref:t,present:s})})});fl.displayName=_o;var Ch=l.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...s}=e,a=No(_o,r),[i,c]=l.useState(n),u=l.useRef(null),f=de(t,u),p=l.useRef(0),g=p.current,v=l.useRef(0),w=v.current,m=a.open||i,x=l.useRef(m),y=l.useRef(void 0);return l.useEffect(()=>{const h=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(h)},[]),he(()=>{const h=u.current;if(h){y.current=y.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const C=h.getBoundingClientRect();p.current=C.height,v.current=C.width,x.current||(h.style.transitionDuration=y.current.transitionDuration,h.style.animationName=y.current.animationName),c(n)}},[a.open,n]),d.jsx(U.div,{"data-state":Io(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...s,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:m&&o})});function Io(e){return e?"open":"closed"}var Sh=ll,Eh=dl,Ph=fl,Oe="Accordion",Rh=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Oo,kh,Th]=Xn(Oe),[rn,Kb]=ke(Oe,[Th,cl]),jo=cl(),pl=P.forwardRef((e,t)=>{const{type:r,...n}=e,o=n,s=n;return d.jsx(Oo.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?d.jsx(Ih,{...s,ref:t}):d.jsx(_h,{...o,ref:t})})});pl.displayName=Oe;var[ml,Ah]=rn(Oe),[gl,Nh]=rn(Oe,{collapsible:!1}),_h=P.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},collapsible:s=!1,...a}=e,[i,c]=Ee({prop:r,defaultProp:n??"",onChange:o,caller:Oe});return d.jsx(ml,{scope:e.__scopeAccordion,value:P.useMemo(()=>i?[i]:[],[i]),onItemOpen:c,onItemClose:P.useCallback(()=>s&&c(""),[s,c]),children:d.jsx(gl,{scope:e.__scopeAccordion,collapsible:s,children:d.jsx(vl,{...a,ref:t})})})}),Ih=P.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...s}=e,[a,i]=Ee({prop:r,defaultProp:n??[],onChange:o,caller:Oe}),c=P.useCallback(f=>i((p=[])=>[...p,f]),[i]),u=P.useCallback(f=>i((p=[])=>p.filter(g=>g!==f)),[i]);return d.jsx(ml,{scope:e.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:d.jsx(gl,{scope:e.__scopeAccordion,collapsible:!0,children:d.jsx(vl,{...s,ref:t})})})}),[Oh,nn]=rn(Oe),vl=P.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:o,orientation:s="vertical",...a}=e,i=P.useRef(null),c=de(i,t),u=kh(r),p=Fr(o)==="ltr",g=Z(e.onKeyDown,v=>{var T;if(!Rh.includes(v.key))return;const w=v.target,m=u().filter(H=>{var K;return!((K=H.ref.current)!=null&&K.disabled)}),x=m.findIndex(H=>H.ref.current===w),y=m.length;if(x===-1)return;v.preventDefault();let h=x;const C=0,S=y-1,k=()=>{h=x+1,h>S&&(h=C)},N=()=>{h=x-1,h<C&&(h=S)};switch(v.key){case"Home":h=C;break;case"End":h=S;break;case"ArrowRight":s==="horizontal"&&(p?k():N());break;case"ArrowDown":s==="vertical"&&k();break;case"ArrowLeft":s==="horizontal"&&(p?N():k());break;case"ArrowUp":s==="vertical"&&N();break}const _=h%y;(T=m[_].ref.current)==null||T.focus()});return d.jsx(Oh,{scope:r,disabled:n,direction:o,orientation:s,children:d.jsx(Oo.Slot,{scope:r,children:d.jsx(U.div,{...a,"data-orientation":s,ref:c,onKeyDown:n?void 0:g})})})}),Nr="AccordionItem",[jh,Do]=rn(Nr),hl=P.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...o}=e,s=nn(Nr,r),a=Ah(Nr,r),i=jo(r),c=ve(),u=n&&a.value.includes(n)||!1,f=s.disabled||e.disabled;return d.jsx(jh,{scope:r,open:u,disabled:f,triggerId:c,children:d.jsx(Sh,{"data-orientation":s.orientation,"data-state":Sl(u),...i,...o,ref:t,disabled:f,open:u,onOpenChange:p=>{p?a.onItemOpen(n):a.onItemClose(n)}})})});hl.displayName=Nr;var xl="AccordionHeader",bl=P.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=nn(Oe,r),s=Do(xl,r);return d.jsx(U.h3,{"data-orientation":o.orientation,"data-state":Sl(s.open),"data-disabled":s.disabled?"":void 0,...n,ref:t})});bl.displayName=xl;var Kn="AccordionTrigger",yl=P.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=nn(Oe,r),s=Do(Kn,r),a=Nh(Kn,r),i=jo(r);return d.jsx(Oo.ItemSlot,{scope:r,children:d.jsx(Eh,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:s.triggerId,...i,...n,ref:t})})});yl.displayName=Kn;var wl="AccordionContent",Cl=P.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=nn(Oe,r),s=Do(wl,r),a=jo(r);return d.jsx(Ph,{role:"region","aria-labelledby":s.triggerId,"data-orientation":o.orientation,...a,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Cl.displayName=wl;function Sl(e){return e?"open":"closed"}var Dh=pl,Mh=hl,Fh=bl,$h=yl,Lh=Cl;function Vh({...e}){return d.jsx(Dh,{"data-slot":"accordion",...e})}function Bh({className:e,...t}){return d.jsx(Mh,{"data-slot":"accordion-item",className:$("border-b last:border-b-0 dark:border-border",e),...t})}function Wh({className:e,children:t,...r}){return d.jsx(Fh,{className:"flex",children:d.jsxs($h,{"data-slot":"accordion-trigger",className:$("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium text-foreground transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180 dark:text-foreground dark:focus-visible:border-ring dark:focus-visible:ring-ring/50",e),...r,children:[t,d.jsx(fo,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 dark:text-muted-foreground"})]})})}function zh({className:e,children:t,...r}){return d.jsx(Lh,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-foreground dark:text-foreground",...r,children:d.jsx("div",{className:$("pt-0 pb-4",e),children:t})})}var Gh=e=>e.type==="checkbox",Ut=e=>e instanceof Date,Mo=e=>e==null;const El=e=>typeof e=="object";var vt=e=>!Mo(e)&&!Array.isArray(e)&&El(e)&&!Ut(e),Hh=e=>vt(e)&&e.target?Gh(e.target)?e.target.checked:e.target.value:e,Uh=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Kh=(e,t)=>e.has(Uh(t)),Yh=e=>{const t=e.constructor&&e.constructor.prototype;return vt(t)&&t.hasOwnProperty("isPrototypeOf")},qh=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Pl(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(qh&&(e instanceof Blob||n))&&(r||vt(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!Yh(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Pl(e[o]));else return e;return t}var Rl=e=>/^\w*$/.test(e),Yn=e=>e===void 0,Xh=e=>Array.isArray(e)?e.filter(Boolean):[],kl=e=>Xh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),we=(e,t,r)=>{if(!t||!vt(e))return r;const n=(Rl(t)?[t]:kl(t)).reduce((o,s)=>Mo(o)?o:o[s],e);return Yn(n)||n===e?Yn(e[t])?r:e[t]:n},Rn=e=>typeof e=="boolean",Bs=(e,t,r)=>{let n=-1;const o=Rl(t)?[t]:kl(t),s=o.length,a=s-1;for(;++n<s;){const i=o[n];let c=r;if(n!==a){const u=e[i];c=vt(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=c,e=e[i]}};const Ws={BLUR:"blur",CHANGE:"change"},zs={all:"all"},Fo=P.createContext(null);Fo.displayName="HookFormContext";const ar=()=>P.useContext(Fo),Zh=e=>{const{children:t,...r}=e;return P.createElement(Fo.Provider,{value:r},t)};var Jh=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const a=s;return t._proxyFormState[a]!==zs.all&&(t._proxyFormState[a]=!n||zs.all),r&&(r[a]=!0),e[a]}});return o};const Tl=typeof window<"u"?P.useLayoutEffect:P.useEffect;function Al(e){const t=ar(),{control:r=t.control,disabled:n,name:o,exact:s}=e||{},[a,i]=P.useState(r._formState),c=P.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Tl(()=>r._subscribe({name:o,formState:c.current,exact:s,callback:u=>{!n&&i({...r._formState,...u})}}),[o,n,s]),P.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),P.useMemo(()=>Jh(a,r,c.current,!1),[a,r])}var Qh=e=>typeof e=="string",ex=(e,t,r,n,o)=>Qh(e)?we(r,e,o):Array.isArray(e)?e.map(s=>we(r,s)):r,Gs=e=>Mo(e)||!El(e);function Nl(e,t,r=new WeakSet){if(Gs(e)||Gs(t))return e===t;if(Ut(e)&&Ut(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const a=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const i=t[s];if(Ut(a)&&Ut(i)||vt(a)&&vt(i)||Array.isArray(a)&&Array.isArray(i)?!Nl(a,i,r):a!==i)return!1}}return!0}function tx(e){const t=ar(),{control:r=t.control,name:n,defaultValue:o,disabled:s,exact:a,compute:i}=e||{},c=P.useRef(o),u=P.useRef(i),f=P.useRef(void 0);u.current=i;const p=P.useMemo(()=>r._getWatch(n,c.current),[r,n]),[g,v]=P.useState(u.current?u.current(p):p);return Tl(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:w=>{if(!s){const m=ex(n,r._names,w.values||r._formValues,!1,c.current);if(u.current){const x=u.current(m);Nl(x,f.current)||(v(x),f.current=x)}else v(m)}}}),[r,s,n,a]),P.useEffect(()=>r._removeUnmounted()),g}function rx(e){const t=ar(),{name:r,disabled:n,control:o=t.control,shouldUnregister:s,defaultValue:a}=e,i=Kh(o._names.array,r),c=P.useMemo(()=>we(o._formValues,r,we(o._defaultValues,r,a)),[o,r,a]),u=tx({control:o,name:r,defaultValue:c,exact:!0}),f=Al({control:o,name:r,exact:!0}),p=P.useRef(e),g=P.useRef(o.register(r,{...e.rules,value:u,...Rn(e.disabled)?{disabled:e.disabled}:{}}));p.current=e;const v=P.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!we(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!we(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!we(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!we(f.validatingFields,r)},error:{enumerable:!0,get:()=>we(f.errors,r)}}),[f,r]),w=P.useCallback(h=>g.current.onChange({target:{value:Hh(h),name:r},type:Ws.CHANGE}),[r]),m=P.useCallback(()=>g.current.onBlur({target:{value:we(o._formValues,r),name:r},type:Ws.BLUR}),[r,o._formValues]),x=P.useCallback(h=>{const C=we(o._fields,r);C&&h&&(C._f.ref={focus:()=>h.focus&&h.focus(),select:()=>h.select&&h.select(),setCustomValidity:S=>h.setCustomValidity(S),reportValidity:()=>h.reportValidity()})},[o._fields,r]),y=P.useMemo(()=>({name:r,value:u,...Rn(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:w,onBlur:m,ref:x}),[r,n,f.disabled,w,m,x,u]);return P.useEffect(()=>{const h=o._options.shouldUnregister||s;o.register(r,{...p.current.rules,...Rn(p.current.disabled)?{disabled:p.current.disabled}:{}});const C=(S,k)=>{const N=we(o._fields,S);N&&N._f&&(N._f.mount=k)};if(C(r,!0),h){const S=Pl(we(o._options.defaultValues,r));Bs(o._defaultValues,r,S),Yn(we(o._formValues,r))&&Bs(o._formValues,r,S)}return!i&&o.register(r),()=>{(i?h&&!o._state.action:h)?o.unregister(r):C(r,!1)}},[r,o,i,s]),P.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),P.useMemo(()=>({field:y,formState:f,fieldState:v}),[y,f,v])}const nx=e=>e.render(rx(e)),_l=P.createContext(void 0),Il=e=>{const{methods:t,disabled:r,children:n}=e;return d.jsx(_l.Provider,{value:{disabled:r},children:d.jsx(Zh,{...t,children:n})})},Ol=()=>{const e=P.useContext(_l),t=ar();if(!e||!t)throw new Error("formContext must be used within a FormProvider");return{...e,...t}},ox=({type:e="button",...t})=>{const r=()=>e==="submit"||e==="reset"?"default":"outline";return d.jsx(Mr,{type:e,variant:r(),...t})};var jl={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hs=P.createContext&&P.createContext(jl),sx=["attr","size","title"];function ax(e,t){if(e==null)return{};var r=ix(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ix(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_r.apply(this,arguments)}function Us(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ir(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Us(Object(r),!0).forEach(function(n){cx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Us(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cx(e,t,r){return t=lx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lx(e){var t=ux(e,"string");return typeof t=="symbol"?t:t+""}function ux(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dl(e){return e&&e.map((t,r)=>P.createElement(t.tag,Ir({key:r},t.attr),Dl(t.child)))}function Ml(e){return t=>P.createElement(dx,_r({attr:Ir({},e.attr)},t),Dl(e.child))}function dx(e){var t=r=>{var{attr:n,size:o,title:s}=e,a=ax(e,sx),i=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),P.createElement("svg",_r({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:c,style:Ir(Ir({color:e.color||r.color},r.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),s&&P.createElement("title",null,s),e.children)};return Hs!==void 0?P.createElement(Hs.Consumer,null,r=>t(r)):t(jl)}function fx(e){return Ml({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Circle_Info"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M11.5,15a.5.5,0,0,0,1,0h0V10.981a.5.5,0,0,0-1,0Z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"8.999",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M12,2.065A9.934,9.934,0,1,1,2.066,12,9.945,9.945,0,0,1,12,2.065Zm0,18.867A8.934,8.934,0,1,0,3.066,12,8.944,8.944,0,0,0,12,20.932Z"},child:[]}]}]}]})(e)}var px="Label",Fl=l.forwardRef((e,t)=>d.jsx(U.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Fl.displayName=px;var mx=Fl;function gx({className:e,...t}){return d.jsx(mx,{"data-slot":"label",className:$("flex items-center text-purple-mutted-300 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",e),...t})}const $l=l.createContext({}),vx=({...e})=>d.jsx($l.Provider,{value:{name:e.name},children:d.jsx(nx,{...e})}),on=()=>{const e=l.useContext($l),t=l.useContext(Ll),{getFieldState:r}=ar(),n=Al({name:e.name}),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},Ll=l.createContext({});function hx({className:e,...t}){const r=l.useId();return d.jsx(Ll.Provider,{value:{id:r},children:d.jsx("div",{"data-slot":"form-item",className:$("grid gap-2",e),...t})})}function xx({className:e,...t}){const{error:r,formItemId:n}=on();return d.jsx(gx,{"data-slot":"form-label","data-error":!!r,className:$("data-[error=true]:text-destructive font-normal text-sm",e),htmlFor:n,...t})}function bx({...e}){const{error:t,formItemId:r,formDescriptionId:n,formMessageId:o}=on();return d.jsx(fa,{"data-slot":"form-control",id:r,"aria-describedby":t?`${n} ${o}`:`${n}`,"aria-invalid":!!t,...e})}function yx({className:e,...t}){const{formDescriptionId:r}=on();return d.jsx("p",{"data-slot":"form-description",id:r,className:$("text-purple-mutted-300 text-sm",e),...t})}function wx({className:e,...t}){const{error:r,formMessageId:n}=on(),o=r?String((r==null?void 0:r.message)??""):t.children;return o?d.jsx("p",{"data-slot":"form-message",id:n,className:$("text-destructive text-sm",e),...t,children:o}):null}const $o=e=>t=>{const{name:r,label:n,description:o,tooltip:s,...a}=t,{control:i,disabled:c}=Ol(),u=()=>s?d.jsxs(sl,{children:[d.jsx(al,{asChild:!0,children:d.jsx(fx,{size:16})}),d.jsx(il,{children:d.jsx("p",{children:s})})]}):d.jsx(d.Fragment,{}),f=()=>o?d.jsx(yx,{children:o}):d.jsx(d.Fragment,{});return d.jsx(vx,{control:i,name:r,render:({field:p})=>d.jsxs(hx,{className:"flex flex-col gap-1.5",children:[n&&d.jsx(xx,{children:d.jsxs("span",{className:"flex items-center gap-1",children:[n,!!s&&u()]})}),d.jsx(bx,{children:d.jsx(e,{...p,...a,disabled:c})}),!!o&&f(),d.jsx(wx,{})]})})},Cx=$o(da),Vl=P.forwardRef(({options:e,placeholder:t,value:r,onChange:n,disabled:o},s)=>{var c;const a=u=>{n&&n({target:{value:u}})},i=u=>d.jsx(ho,{value:u.value,disabled:u.disabled,children:d.jsxs("div",{className:"flex flex-col",children:[u.label,u.subLabel&&d.jsx("span",{className:"text-xs text-muted-foreground",style:{overflowWrap:"anywhere"},children:u.subLabel})]})},u.value);return d.jsxs(ji,{value:r,onValueChange:a,disabled:o,children:[d.jsx(po,{ref:s,children:d.jsx(Di,{placeholder:t,children:r&&((c=e.find(u=>u.value===r))==null?void 0:c.label)})}),d.jsx(vo,{children:e.map(i)})]})});Vl.displayName="BaseSelectComponent";const Sx=$o(Vl),Ex=P.forwardRef((e,t)=>{const{options:r=[],placeholder:n,value:o,onChange:s=()=>{},disabled:a,searchPlaceholder:i,emptyText:c}=e,u=f=>{s({target:{value:f}})};return d.jsx(So,{ref:t,options:r,value:o,onValueChange:u,placeholder:n,searchPlaceholder:i,emptyText:c,disabled:a})}),Px=$o(Ex),Rx=e=>d.jsx("hr",{className:"w-full h-px border-purple-mutted-500",...e}),kx=({children:e,description:t,className:r})=>d.jsxs("div",{className:$("space-y-1",r),children:[d.jsx("h2",{className:"flex items-center gap-2.5 text-2xl text-white",children:e}),t&&d.jsx("span",{className:"text-sm text-purple-mutted-300",children:t})]}),ht=e=>{const{className:t,disabled:r=!1,methods:n,onSubmit:o=()=>{},...s}=e,{handleSubmit:a}=n,i=$("flex flex-col gap-6",{},t);return d.jsx(Il,{methods:n,disabled:r,children:d.jsx("form",{className:i,onSubmit:a(o),...s})})};ht.Button=ox;ht.Input=Cx;ht.Select=Sx;ht.Combobox=Px;ht.Divider=Rx;ht.Title=kx;function Tx(e){return e==null?[]:Array.isArray(e)?e:[e]}var Ax=e=>Array.from(Array(e).keys()),Ks=e=>(e==null?void 0:e.constructor.name)==="Array",Nx=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Lo(e[r],t[r]))return!1;return!0},Lo=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(t==null?void 0:t.isEqual)=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Ks(e)&&Ks(t))return Nx(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const r=Object.keys(t??Object.create(null)),n=r.length;for(let o=0;o<n;o++)if(!Reflect.has(e,r[o]))return!1;for(let o=0;o<n;o++){const s=r[o];if(!Lo(e[s],t[s]))return!1}return!0},_x=e=>e!=null&&typeof e=="object",wr=e=>typeof e=="string",Kt=e=>typeof e=="function",Ix=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ox=e=>Object.prototype.toString.call(e),Bl=Function.prototype.toString,jx=Bl.call(Object),Dx=e=>{if(!_x(e)||Ox(e)!="[object Object]"||$x(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const r=Ix(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Bl.call(r)==jx},Mx=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,Fx=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,$x=e=>Mx(e)||Fx(e),Lx=e=>e(),Vx=(...e)=>(...t)=>{e.forEach(function(r){r==null||r(...t)})},Bx=e=>Number.isNaN(e),Wx=e=>Bx(e)?0:e,zx=(e,t,r)=>{const n=Wx(e),o=n>=t,s=r==null||n<=r;return o&&s};function Wl(e){if(!Dx(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(n=>typeof n=="string"),r={};for(const n of t){const o=e[n];o!==void 0&&(r[n]=Wl(o))}return r}function Ys(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function Gx(e,t){if(e==null)throw new Error(t())}var zl=e=>typeof e=="object"&&e!==null,Me=e=>e?"":void 0,Hx=9,Ux=e=>zl(e)&&e.nodeType===Hx,Kx=e=>zl(e)&&e===e.window;function Yx(e){if(!e)return!1;const t=e.getRootNode();return Gl(t)===e}function qx(e){return Ux(e)?e:Kx(e)?e.document:(e==null?void 0:e.ownerDocument)??document}function Gl(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const r=t.shadowRoot.activeElement;if(!r||r===t)break;t=r}return t}var Xx=(...e)=>e.map(t=>{var r;return(r=t==null?void 0:t.trim)==null?void 0:r.call(t)}).filter(Boolean).join(" "),Zx=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,qs=e=>{const t={};let r;for(;r=Zx.exec(e);)t[r[1]]=r[2];return t},Jx=(e,t)=>{if(wr(e)){if(wr(t))return`${e};${t}`;e=qs(e)}else wr(t)&&(t=qs(t));return Object.assign({},e??{},t??{})};function je(...e){let t={};for(let r of e){if(!r)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof r[o]=="function"){t[o]=Vx(r[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=Xx(t[o],r[o]);continue}if(o==="style"){t[o]=Jx(t[o],r[o]);continue}t[o]=r[o]!==void 0?r[o]:t[o]}for(let o in r)t[o]===void 0&&(t[o]=r[o]);const n=Object.getOwnPropertySymbols(r);for(let o of n)t[o]=r[o]}return t}function Qx(e,t,r){let n=[],o;return s=>{const a=e(s);return(a.length!==n.length||a.some((c,u)=>!Lo(n[u],c)))&&(n=a,o=t(a,s)),o}}var kt=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(kt||{}),kn="__init__";function eb(e){const t=()=>{var a;return((a=e.getRootNode)==null?void 0:a.call(e))??document},r=()=>qx(t());return{...e,getRootNode:t,getDoc:r,getWin:()=>r().defaultView??window,getActiveElement:()=>Gl(t()),isActiveElement:Yx,getById:a=>t().getElementById(a)}}function tb(e){return new Proxy({},{get(t,r){return r==="style"?n=>e({style:n}).style:e}})}var rb=()=>e=>Array.from(new Set(e)),Hl=typeof globalThis.document<"u"?P.useLayoutEffect:P.useEffect;function Or(e){const t=e().value??e().defaultValue,r=e().isEqual??Object.is,[n]=P.useState(t),[o,s]=P.useState(n),a=e().value!==void 0,i=P.useRef(o);i.current=a?e().value:o;const c=P.useRef(i.current);Hl(()=>{c.current=i.current},[o,e().value]);const u=p=>{var w,m;const g=c.current,v=Kt(p)?p(g):p;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:v,prev:g}),a||s(v),r(v,g)||(m=(w=e()).onChange)==null||m.call(w,v,g)};function f(){return a?e().value:o}return{initial:n,ref:i,get:f,set(p){(e().sync?Jt.flushSync:Lx)(()=>u(p))},invoke(p,g){var v,w;(w=(v=e()).onChange)==null||w.call(v,p,g)},hash(p){var g,v;return((v=(g=e()).hash)==null?void 0:v.call(g,p))??String(p)}}}Or.cleanup=e=>{P.useEffect(()=>e,[])};Or.ref=e=>{const t=P.useRef(e);return{get:()=>t.current,set:r=>{t.current=r}}};function nb(e){const t=P.useRef(e);return{get(r){return t.current[r]},set(r,n){t.current[r]=n}}}var ob=(e,t)=>{const r=P.useRef(!1),n=P.useRef(!1);P.useEffect(()=>{if(r.current&&n.current)return t();n.current=!0},[...(e??[]).map(o=>typeof o=="function"?o():o)]),P.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[])};function sb(e,t={}){var ee,J,Y,z;const r=P.useMemo(()=>{const{id:j,ids:A,getRootNode:D}=t;return eb({id:j,ids:A,getRootNode:D})},[t]),n=(...j)=>{e.debug&&console.log(...j)},o=((ee=e.props)==null?void 0:ee.call(e,{props:Wl(t),scope:r}))??t,s=ab(o),a=(J=e.context)==null?void 0:J.call(e,{prop:s,bindable:Or,scope:r,flush:Xs,getContext(){return c},getComputed(){return k},getRefs(){return m},getEvent(){return v()}}),i=Ul(a),c={get(j){var A;return(A=i.current)==null?void 0:A[j].ref.current},set(j,A){var D;(D=i.current)==null||D[j].set(A)},initial(j){var A;return(A=i.current)==null?void 0:A[j].initial},hash(j){var D,E;const A=(D=i.current)==null?void 0:D[j].get();return(E=i.current)==null?void 0:E[j].hash(A)}},u=P.useRef(new Map),f=P.useRef(null),p=P.useRef(null),g=P.useRef({type:""}),v=()=>({...g.current,current(){return g.current},previous(){return p.current}}),w=()=>({...N,matches(...j){return j.includes(N.ref.current)},hasTag(j){var A,D;return!!((D=(A=e.states[N.ref.current])==null?void 0:A.tags)!=null&&D.includes(j))}}),m=nb(((Y=e.refs)==null?void 0:Y.call(e,{prop:s,context:c}))??{}),x=()=>({state:w(),context:c,event:v(),prop:s,send:K,action:y,guard:h,track:ob,refs:m,computed:k,flush:Xs,scope:r,choose:S}),y=j=>{const A=Kt(j)?j(x()):j;if(!A)return;const D=A.map(E=>{var oe,le;const G=(le=(oe=e.implementations)==null?void 0:oe.actions)==null?void 0:le[E];return G||Ys(`[zag-js] No implementation found for action "${JSON.stringify(E)}"`),G});for(const E of D)E==null||E(x())},h=j=>{var A,D;return Kt(j)?j(x()):(D=(A=e.implementations)==null?void 0:A.guards)==null?void 0:D[j](x())},C=j=>{const A=Kt(j)?j(x()):j;if(!A)return;const D=A.map(G=>{var le,R;const oe=(R=(le=e.implementations)==null?void 0:le.effects)==null?void 0:R[G];return oe||Ys(`[zag-js] No implementation found for effect "${JSON.stringify(G)}"`),oe}),E=[];for(const G of D){const oe=G==null?void 0:G(x());oe&&E.push(oe)}return()=>E.forEach(G=>G==null?void 0:G())},S=j=>Tx(j).find(A=>{let D=!A.guard;return wr(A.guard)?D=!!h(A.guard):Kt(A.guard)&&(D=A.guard(x())),D}),k=j=>{Gx(e.computed,()=>"[zag-js] No computed object found on machine");const A=e.computed[j];return A({context:c,event:v(),prop:s,refs:m,scope:r,computed:k})},N=Or(()=>({defaultValue:e.initialState({prop:s}),onChange(j,A){var E,G,oe,le;if(A){const R=u.current.get(A);R==null||R(),u.current.delete(A)}A&&y((E=e.states[A])==null?void 0:E.exit),y((G=f.current)==null?void 0:G.actions);const D=C((oe=e.states[j])==null?void 0:oe.effects);if(D&&u.current.set(j,D),A===kn){y(e.entry);const R=C(e.effects);R&&u.current.set(kn,R)}y((le=e.states[j])==null?void 0:le.entry)}})),_=P.useRef(void 0),T=P.useRef(kt.NotStarted);Hl(()=>{queueMicrotask(()=>{const D=T.current===kt.Started;T.current=kt.Started,n(D?"rehydrating...":"initializing...");const E=_.current??N.initial;N.invoke(E,D?N.get():kn)});const j=u.current,A=N.ref.current;return()=>{n("unmounting..."),_.current=A,T.current=kt.Stopped,j.forEach(D=>D==null?void 0:D()),u.current=new Map,f.current=null,queueMicrotask(()=>{y(e.exit)})}},[]);const H=()=>"ref"in N?N.ref.current:N.get(),K=j=>{queueMicrotask(()=>{var le,R;if(T.current!==kt.Started)return;p.current=g.current,g.current=j;let A=H();const D=((le=e.states[A].on)==null?void 0:le[j.type])??((R=e.on)==null?void 0:R[j.type]),E=S(D);if(!E)return;f.current=E;const G=E.target??A;n("transition",j.type,E.target||A,`(${E.actions})`);const oe=G!==A;oe?Jt.flushSync(()=>N.set(G)):E.reenter&&!oe?N.invoke(A,A):y(E.actions??[])})};return(z=e.watch)==null||z.call(e,x()),{state:w(),send:K,context:c,prop:s,scope:r,refs:m,computed:k,event:v(),getStatus:()=>T.current}}function Ul(e){const t=P.useRef(e);return t.current=e,t}function ab(e){const t=Ul(e);return function(n){return t.current[n]}}function Xs(e){queueMicrotask(()=>{Jt.flushSync(()=>e())})}var ib=tb(e=>e);function cb(...e){return t=>{const r=[];for(const n of e)if(typeof n=="function"){const o=n(t);typeof o=="function"&&r.push(o)}else n&&(n.current=t);if(r.length)return()=>{for(const n of r)n()}}}function lb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const Tn=e=>{const t=P.memo(P.forwardRef((r,n)=>{const{asChild:o,children:s,...a}=r;if(!o)return P.createElement(e,{...a,ref:n},s);if(!P.isValidElement(s))return null;const i=P.Children.only(s),c=lb(i);return P.cloneElement(i,{...je(a,i.props),ref:n?cb(n,c):c})}));return t.displayName=e.displayName||e.name,t},ub=()=>{const e=new Map;return new Proxy(Tn,{apply(t,r,n){return Tn(n[0])},get(t,r){const n=r;return e.has(n)||e.set(n,Tn(n)),e.get(n)}})},ze=ub();function db(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function ir(e={}){const{name:t,strict:r=!0,hookName:n="useContext",providerName:o="Provider",errorMessage:s,defaultValue:a}=e,i=P.createContext(a);i.displayName=t;function c(){var f;const u=P.useContext(i);if(!u&&r){const p=new Error(s??db(n,o));throw p.name="ContextError",(f=Error.captureStackTrace)==null||f.call(Error,p,c),p}return u}return[i.Provider,c,i]}const[fb,qe]=ir({name:"StepsContext",hookName:"useStepsContext",providerName:"<StepsProvider />"}),Kl=P.forwardRef((e,t)=>{const r=qe(),n=je(r.getContentProps({index:r.count}),e);return d.jsx(ze.div,{...n,ref:t})});Kl.displayName="StepsCompletedContent";const Vo=()=>(e,t)=>t.reduce((r,n)=>{const[o,s]=r,a=n;return s[a]!==void 0&&(o[a]=s[a]),delete s[a],[o,s]},[{},{...e}]),Yl=P.forwardRef((e,t)=>{const[r,n]=Vo()(e,["index"]),o=qe(),s=je(o.getContentProps(r),n);return d.jsx(ze.div,{...s,ref:t})});Yl.displayName="StepsContent";const[pb,Bo]=ir({name:"StepsItemPropsContext",hookName:"useStepsItemPropsContext",providerName:"<StepsItemPropsProvider />"}),ql=P.forwardRef((e,t)=>{const r=qe(),n=Bo(),o=je(r.getIndicatorProps(n),e);return d.jsx(ze.div,{...o,ref:t})});ql.displayName="StepsIndicator";const[mb,Yb]=ir({name:"StepsItemContext",hookName:"useStepsItemContext",providerName:"<StepsItem />"}),Xl=P.forwardRef((e,t)=>{const[r,n]=Vo()(e,["index"]),o=qe(),s=je(o.getItemProps(r),n),a=o.getItemState(r);return d.jsx(pb,{value:r,children:d.jsx(mb,{value:a,children:d.jsx(ze.div,{...s,ref:t})})})});Xl.displayName="StepsItem";const Zl=P.forwardRef((e,t)=>{const r=qe(),n=je(r.getListProps(),e);return d.jsx(ze.div,{...n,ref:t})});Zl.displayName="StepsList";const Jl=P.forwardRef((e,t)=>{const r=qe(),n=je(r.getNextTriggerProps(),e);return d.jsx(ze.button,{...n,ref:t})});Jl.displayName="StepsNextTrigger";const Ql=P.forwardRef((e,t)=>{const r=qe(),n=je(r.getPrevTriggerProps(),e);return d.jsx(ze.button,{...n,ref:t})});Ql.displayName="StepsPrevTrigger";var Yt=(e,t=[])=>({parts:(...r)=>{if(gb(t))return Yt(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>Yt(e,[...t,...r]),omit:(...r)=>Yt(e,t.filter(n=>!r.includes(n))),rename:r=>Yt(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${Et(e)}"][data-part="${Et(n)}"]`,`& [data-scope="${Et(e)}"][data-part="${Et(n)}"]`].join(", "),attrs:{"data-scope":Et(e),"data-part":Et(n)}}}),{})}),Et=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),gb=e=>e.length===0,vb=Yt("steps").parts("root","list","item","trigger","indicator","separator","content","nextTrigger","prevTrigger","progress"),Fe=vb.build(),hb=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`steps:${e.id}`},xb=e=>{var t;return((t=e.ids)==null?void 0:t.list)??`steps:${e.id}:list`},Zs=(e,t)=>{var r,n;return((n=(r=e.ids)==null?void 0:r.triggerId)==null?void 0:n.call(r,t))??`steps:${e.id}:trigger:${t}`},bb=(e,t)=>{var r,n;return((n=(r=e.ids)==null?void 0:r.contentId)==null?void 0:n.call(r,t))??`steps:${e.id}:content:${t}`};function yb(e,t){const{context:r,send:n,computed:o,prop:s,scope:a}=e,i=r.get("step"),c=s("count"),u=o("percent"),f=o("hasNextStep"),p=o("hasPrevStep"),g=y=>({triggerId:Zs(a,y.index),contentId:bb(a,y.index),current:y.index===i,completed:y.index<i,incomplete:y.index>i,index:y.index,first:y.index===0,last:y.index===c-1}),v=()=>{n({type:"STEP.NEXT",src:"next.trigger.click"})},w=()=>{n({type:"STEP.PREV",src:"prev.trigger.click"})},m=()=>{n({type:"STEP.RESET",src:"reset.trigger.click"})},x=y=>{n({type:"STEP.SET",value:y,src:"api.setValue"})};return{value:i,count:c,percent:u,hasNextStep:f,hasPrevStep:p,isCompleted:o("completed"),goToNextStep:v,goToPrevStep:w,resetStep:m,getItemState:g,setStep:x,getRootProps(){return t.element({...Fe.root.attrs,id:hb(a),dir:s("dir"),"data-orientation":s("orientation"),style:{"--percent":`${u}%`}})},getListProps(){const h=Ax(c).map((C,S)=>Zs(a,S));return t.element({...Fe.list.attrs,dir:s("dir"),id:xb(a),role:"tablist","aria-owns":h.join(" "),"aria-orientation":s("orientation"),"data-orientation":s("orientation")})},getItemProps(y){const h=g(y);return t.element({...Fe.item.attrs,dir:s("dir"),"aria-current":h.current?"step":void 0,"data-orientation":s("orientation")})},getTriggerProps(y){const h=g(y);return t.button({...Fe.trigger.attrs,id:h.triggerId,role:"tab",dir:s("dir"),tabIndex:!s("linear")||h.current?0:-1,"aria-selected":h.current,"aria-controls":h.contentId,"data-state":h.current?"open":"closed","data-orientation":s("orientation"),"data-complete":Me(h.completed),"data-current":Me(h.current),"data-incomplete":Me(h.incomplete),onClick(C){C.defaultPrevented||s("linear")||n({type:"STEP.SET",value:y.index,src:"trigger.click"})}})},getContentProps(y){const h=g(y);return t.element({...Fe.content.attrs,dir:s("dir"),id:h.contentId,role:"tabpanel",tabIndex:0,hidden:!h.current,"data-state":h.current?"open":"closed","data-orientation":s("orientation"),"aria-labelledby":h.triggerId})},getIndicatorProps(y){const h=g(y);return t.element({...Fe.indicator.attrs,dir:s("dir"),"aria-hidden":!0,"data-complete":Me(h.completed),"data-current":Me(h.current),"data-incomplete":Me(h.incomplete)})},getSeparatorProps(y){const h=g(y);return t.element({...Fe.separator.attrs,dir:s("dir"),"data-orientation":s("orientation"),"data-complete":Me(h.completed),"data-current":Me(h.current),"data-incomplete":Me(h.incomplete)})},getNextTriggerProps(){return t.button({...Fe.nextTrigger.attrs,dir:s("dir"),type:"button",disabled:!f,onClick(y){y.defaultPrevented||v()}})},getPrevTriggerProps(){return t.button({dir:s("dir"),...Fe.prevTrigger.attrs,type:"button",disabled:!p,onClick(y){y.defaultPrevented||w()}})},getProgressProps(){return t.element({dir:s("dir"),...Fe.progress.attrs,role:"progressbar","aria-valuenow":u,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":`${u}% complete`,"data-complete":Me(u===100)})}}}var wb={props({props:e}){return{defaultStep:0,count:1,linear:!1,orientation:"horizontal",...e}},context({prop:e,bindable:t}){return{step:t(()=>({defaultValue:e("defaultStep"),value:e("step"),onChange(r){var o,s;(o=e("onStepChange"))==null||o({step:r}),r==e("count")&&((s=e("onStepComplete"))==null||s())}}))}},computed:{percent:Qx(({context:e,prop:t})=>[e.get("step"),t("count")],([e,t])=>e/t*100),hasNextStep:({context:e,prop:t})=>e.get("step")<t("count"),hasPrevStep:({context:e})=>e.get("step")>0,completed:({context:e,prop:t})=>e.get("step")===t("count")},initialState(){return"idle"},entry:["validateStep"],states:{idle:{on:{"STEP.SET":{actions:["setStep"]},"STEP.NEXT":{actions:["goToNextStep"]},"STEP.PREV":{actions:["goToPrevStep"]},"STEP.RESET":{actions:["resetStep"]}}}},implementations:{actions:{goToNextStep({context:e,prop:t}){const r=Math.min(e.get("step")+1,t("count"));e.set("step",r)},goToPrevStep({context:e}){const t=Math.max(e.get("step")-1,0);e.set("step",t)},resetStep({context:e}){e.set("step",0)},setStep({context:e,event:t}){e.set("step",t.value)},validateStep({context:e,prop:t}){Cb(t("count"),e.get("step"))}}}},Cb=(e,t)=>{if(!zx(t,0,e))throw new RangeError(`[zag-js/steps] step index ${t} is out of bounds`)};rb()(["count","dir","getRootNode","id","ids","linear","onStepChange","onStepComplete","orientation","step","defaultStep"]);const[qb,Sb]=ir({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[Xb,Eb]=ir({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}});function Pb(e){const t=P.useId(),{getRootNode:r}=Sb(),{dir:n}=Eb(),o={id:t,dir:n,getRootNode:r,...e},s=sb(wb,o);return yb(s,ib)}const eu=P.forwardRef((e,t)=>{const[r,n]=Vo()(e,["defaultStep","id","ids","count","linear","onStepChange","onStepComplete","orientation","step"]),o=Pb(r),s=je(o.getRootProps(),n);return d.jsx(fb,{value:o,children:d.jsx(ze.div,{...s,ref:t})})});eu.displayName="StepsRoot";const tu=P.forwardRef((e,t)=>{const r=qe(),n=Bo(),o=je(r.getSeparatorProps(n),e);return d.jsx(ze.div,{...o,ref:t})});tu.displayName="StepsSeparator";const ru=P.forwardRef((e,t)=>{const r=qe(),n=Bo(),o=je(r.getTriggerProps(n),e);return d.jsx(ze.button,{...o,ref:t})});ru.displayName="StepsTrigger";function Rb(e){return Ml({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 6 9 17l-5-5"},child:[]}]})(e)}const nu=P.createContext(void 0),kb=({children:e,step:t})=>d.jsx(nu.Provider,{value:{step:t},children:e}),ou=()=>{const e=P.useContext(nu);if(!e)throw new Error("useSteps must be used within a StepsProvider");return e},Tb=({className:e,step:t,...r})=>{const n=$("flex flex-col gap-4",e);return d.jsx(kb,{step:t??0,children:d.jsx(eu,{className:n,step:t,...r})})},Ab=({className:e,...t})=>{const r=$("flex flex-row gap-4",e);return d.jsx(Zl,{className:r,...t})},Nb=({className:e,...t})=>{const r=$("flex flex-row items-center gap-4",e);return d.jsx(Xl,{className:r,...t})},_b=({className:e,...t})=>{const r=$("flex flex-row items-center gap-4 text-purple-mutted-100 text-sm",e);return d.jsx(ru,{className:r,...t})},Ib=({index:e,className:t,...r})=>{const{step:n}=ou(),o=e===n,s=e<n,a=$("flex items-center justify-center w-8 h-8 rounded-full text-white",s&&"bg-green-700",o&&"bg-green-600",!s&&!o&&"bg-purple-mutted-500",t),i=$({"text-white":o,"text-purple-mutted-300":!s&&e!==n});return d.jsx(ql,{className:a,...r,children:s?d.jsx(Rb,{className:"text-green-400"}):d.jsx("span",{className:i,children:e+1})})},Ob=({index:e,className:t,...r})=>{const{step:n}=ou(),o=e<n,s=$("min-w-12 h-px",o?"bg-green-400":"bg-gray-400",t);return d.jsx(tu,{className:s,...r})},jb=({className:e,...t})=>{const r=$(e);return d.jsx(Yl,{className:r,...t})},Db=({className:e,...t})=>{const r=$(e);return d.jsx(Kl,{className:r,...t})},Mb=({className:e,...t})=>{const r=$("bg-primary text-white px-4 py-2 rounded-md",e);return d.jsx(Ql,{className:r,...t})},Fb=({className:e,...t})=>{const r=$("bg-primary text-white px-4 py-2 rounded-md",e);return d.jsx(Jl,{className:r,...t})},$b={Root:Tb,List:Ab,Item:Nb,Trigger:_b,Indicator:Ib,Separator:Ob,Content:jb,CompletedContent:Db,PrevTrigger:Mb,NextTrigger:Fb};exports.Accordion=Vh;exports.AccordionContent=zh;exports.AccordionItem=Bh;exports.AccordionTrigger=Wh;exports.Badge=av;exports.Button=Mr;exports.Card=iv;exports.CardAction=dv;exports.CardContent=fv;exports.CardDescription=uv;exports.CardFooter=pv;exports.CardHeader=cv;exports.CardTitle=lv;exports.Combobox=So;exports.Dialog=Tg;exports.DialogClose=Ng;exports.DialogContent=_g;exports.DialogDescription=Dg;exports.DialogFooter=Og;exports.DialogHeader=Ig;exports.DialogOverlay=mc;exports.DialogPortal=pc;exports.DialogTitle=jg;exports.DialogTrigger=Ag;exports.Form=ht;exports.FormProvider=Il;exports.Input=da;exports.Progress=Cv;exports.Select=ji;exports.SelectContent=vo;exports.SelectGroup=Wm;exports.SelectItem=ho;exports.SelectLabel=Mi;exports.SelectScrollDownButton=go;exports.SelectScrollUpButton=mo;exports.SelectSeparator=Fi;exports.SelectTrigger=po;exports.SelectValue=Di;exports.Skeleton=Sv;exports.Steps=$b;exports.Switch=Nv;exports.Toggle=Iv;exports.ToggleGroup=Zv;exports.ToggleGroupItem=Jv;exports.Tooltip=sl;exports.TooltipContent=il;exports.TooltipProvider=ol;exports.TooltipTrigger=al;exports.borderRadius=Au;exports.cn=$;exports.colors=ku;exports.spacing=Tu;exports.typography=Nu;exports.useFormContext=Ol;
|
|
129
|
+
Defaulting to \`null\`.`}var yv=Pc,wv=kc;function Cv({className:e,value:t,...r}){return d.jsx(yv,{"data-slot":"progress",className:$("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full dark:bg-primary/20",e),...r,children:d.jsx(wv,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all dark:bg-primary",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Sv({className:e,...t}){return d.jsx("div",{"data-slot":"skeleton",className:$("bg-accent animate-pulse rounded-md dark:bg-accent",e),...t})}var Jr="Switch",[Ev,Hb]=ke(Jr),[Pv,Rv]=Ev(Jr),Ac=l.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:s,required:a,disabled:i,value:c="on",onCheckedChange:u,form:f,...p}=e,[g,v]=l.useState(null),w=de(t,C=>v(C)),m=l.useRef(!1),x=g?f||!!g.closest("form"):!0,[y,h]=Ee({prop:o,defaultProp:s??!1,onChange:u,caller:Jr});return d.jsxs(Pv,{scope:r,checked:y,disabled:i,children:[d.jsx(U.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":Oc(y),"data-disabled":i?"":void 0,disabled:i,value:c,...p,ref:w,onClick:Z(e.onClick,C=>{h(S=>!S),x&&(m.current=C.isPropagationStopped(),m.current||C.stopPropagation())})}),x&&d.jsx(Ic,{control:g,bubbles:!m.current,name:n,value:c,checked:y,required:a,disabled:i,form:f,style:{transform:"translateX(-100%)"}})]})});Ac.displayName=Jr;var Nc="SwitchThumb",_c=l.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=Rv(Nc,r);return d.jsx(U.span,{"data-state":Oc(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});_c.displayName=Nc;var kv="SwitchBubbleInput",Ic=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},s)=>{const a=l.useRef(null),i=de(a,s),c=La(r),u=Aa(t);return l.useEffect(()=>{const f=a.current;if(!f)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==r&&v){const w=new Event("click",{bubbles:n});v.call(f,r),f.dispatchEvent(w)}},[c,r,n]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:i,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ic.displayName=kv;function Oc(e){return e?"checked":"unchecked"}var Tv=Ac,Av=_c;function Nv({className:e,...t}){return d.jsx(Tv,{"data-slot":"switch",className:$("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=checked]:bg-primary dark:data-[state=unchecked]:bg-input",e),...t,children:d.jsx(Av,{"data-slot":"switch-thumb",className:$("bg-background pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground")})})}var jc="Toggle",Ro=l.forwardRef((e,t)=>{const{pressed:r,defaultPressed:n,onPressedChange:o,...s}=e,[a,i]=Ee({prop:r,onChange:o,defaultProp:n??!1,caller:jc});return d.jsx(U.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:Z(e.onClick,()=>{e.disabled||i(!a)})})});Ro.displayName=jc;var _v=Ro;const Dc=Dr("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium text-foreground hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap dark:text-foreground dark:hover:bg-muted dark:hover:text-muted-foreground dark:data-[state=on]:bg-accent dark:data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent text-foreground dark:bg-transparent dark:text-foreground",outline:"border border-input bg-transparent text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-transparent dark:text-foreground dark:hover:bg-accent dark:hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Iv({className:e,variant:t,size:r,...n}){return d.jsx(_v,{"data-slot":"toggle",className:$(Dc({variant:t,size:r,className:e})),...n})}var Pn="rovingFocusGroup.onEntryFocus",Ov={bubbles:!1,cancelable:!0},or="RovingFocusGroup",[Gn,Mc,jv]=Xn(or),[Dv,Fc]=ke(or,[jv]),[Mv,Fv]=Dv(or),$c=l.forwardRef((e,t)=>d.jsx(Gn.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Gn.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx($v,{...e,ref:t})})}));$c.displayName=or;var $v=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=e,g=l.useRef(null),v=de(t,g),w=Fr(s),[m,x]=Ee({prop:a,defaultProp:i??null,onChange:c,caller:or}),[y,h]=l.useState(!1),C=Qe(u),S=Mc(r),k=l.useRef(!1),[N,_]=l.useState(0);return l.useEffect(()=>{const T=g.current;if(T)return T.addEventListener(Pn,C),()=>T.removeEventListener(Pn,C)},[C]),d.jsx(Mv,{scope:r,orientation:n,dir:w,loop:o,currentTabStopId:m,onItemFocus:l.useCallback(T=>x(T),[x]),onItemShiftTab:l.useCallback(()=>h(!0),[]),onFocusableItemAdd:l.useCallback(()=>_(T=>T+1),[]),onFocusableItemRemove:l.useCallback(()=>_(T=>T-1),[]),children:d.jsx(U.div,{tabIndex:y||N===0?-1:0,"data-orientation":n,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{k.current=!0}),onFocus:Z(e.onFocus,T=>{const H=!k.current;if(T.target===T.currentTarget&&H&&!y){const K=new CustomEvent(Pn,Ov);if(T.currentTarget.dispatchEvent(K),!K.defaultPrevented){const ee=S().filter(A=>A.focusable),J=ee.find(A=>A.active),Y=ee.find(A=>A.id===m),j=[J,Y,...ee].filter(Boolean).map(A=>A.ref.current);Bc(j,f)}}k.current=!1}),onBlur:Z(e.onBlur,()=>h(!1))})})}),Lc="RovingFocusGroupItem",Vc=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:a,...i}=e,c=ve(),u=s||c,f=Fv(Lc,r),p=f.currentTabStopId===u,g=Mc(r),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:m}=f;return l.useEffect(()=>{if(n)return v(),()=>w()},[n,v,w]),d.jsx(Gn.ItemSlot,{scope:r,id:u,focusable:n,active:o,children:d.jsx(U.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:Z(e.onMouseDown,x=>{n?f.onItemFocus(u):x.preventDefault()}),onFocus:Z(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=Bv(x,f.orientation,f.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let C=g().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){y==="prev"&&C.reverse();const S=C.indexOf(x.currentTarget);C=f.loop?Wv(C,S+1):C.slice(S+1)}setTimeout(()=>Bc(C))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:m!=null}):a})})});Vc.displayName=Lc;var Lv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Vv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Bv(e,t,r){const n=Vv(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Lv[n]}function Bc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Wv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var zv=$c,Gv=Vc,at="ToggleGroup",[Wc,Ub]=ke(at,[Fc]),zc=Fc(),ko=P.forwardRef((e,t)=>{const{type:r,...n}=e;if(r==="single"){const o=n;return d.jsx(Hv,{...o,ref:t})}if(r==="multiple"){const o=n;return d.jsx(Uv,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${at}\``)});ko.displayName=at;var[Gc,Hc]=Wc(at),Hv=P.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...s}=e,[a,i]=Ee({prop:r,defaultProp:n??"",onChange:o,caller:at});return d.jsx(Gc,{scope:e.__scopeToggleGroup,type:"single",value:P.useMemo(()=>a?[a]:[],[a]),onItemActivate:i,onItemDeactivate:P.useCallback(()=>i(""),[i]),children:d.jsx(Uc,{...s,ref:t})})}),Uv=P.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...s}=e,[a,i]=Ee({prop:r,defaultProp:n??[],onChange:o,caller:at}),c=P.useCallback(f=>i((p=[])=>[...p,f]),[i]),u=P.useCallback(f=>i((p=[])=>p.filter(g=>g!==f)),[i]);return d.jsx(Gc,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:d.jsx(Uc,{...s,ref:t})})});ko.displayName=at;var[Kv,Yv]=Wc(at),Uc=P.forwardRef((e,t)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:o=!0,orientation:s,dir:a,loop:i=!0,...c}=e,u=zc(r),f=Fr(a),p={role:"group",dir:f,...c};return d.jsx(Kv,{scope:r,rovingFocus:o,disabled:n,children:o?d.jsx(zv,{asChild:!0,...u,orientation:s,dir:f,loop:i,children:d.jsx(U.div,{...p,ref:t})}):d.jsx(U.div,{...p,ref:t})})}),Ar="ToggleGroupItem",Kc=P.forwardRef((e,t)=>{const r=Hc(Ar,e.__scopeToggleGroup),n=Yv(Ar,e.__scopeToggleGroup),o=zc(e.__scopeToggleGroup),s=r.value.includes(e.value),a=n.disabled||e.disabled,i={...e,pressed:s,disabled:a},c=P.useRef(null);return n.rovingFocus?d.jsx(Gv,{asChild:!0,...o,focusable:!a,active:s,ref:c,children:d.jsx(Vs,{...i,ref:t})}):d.jsx(Vs,{...i,ref:t})});Kc.displayName=Ar;var Vs=P.forwardRef((e,t)=>{const{__scopeToggleGroup:r,value:n,...o}=e,s=Hc(Ar,r),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=s.type==="single"?a:void 0;return d.jsx(Ro,{...i,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(n):s.onItemDeactivate(n)}})}),qv=ko,Xv=Kc;const Yc=l.createContext({size:"default",variant:"default"});function Zv({className:e,variant:t,size:r,children:n,...o}){return d.jsx(qv,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:$("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs dark:data-[variant=outline]:shadow-xs",e),...o,children:d.jsx(Yc.Provider,{value:{variant:t,size:r},children:n})})}function Jv({className:e,children:t,variant:r,size:n,...o}){const s=l.useContext(Yc);return d.jsx(Xv,{"data-slot":"toggle-group-item","data-variant":s.variant||r,"data-size":s.size||n,className:$(Dc({variant:s.variant||r,size:s.size||n}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",e),...o,children:t})}var Qr="Collapsible",[Qv,qc]=ke(Qr),[eh,To]=Qv(Qr),Xc=l.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:s,onOpenChange:a,...i}=e,[c,u]=Ee({prop:n,defaultProp:o??!1,onChange:a,caller:Qr});return d.jsx(eh,{scope:r,disabled:s,contentId:ve(),open:c,onOpenToggle:l.useCallback(()=>u(f=>!f),[u]),children:d.jsx(U.div,{"data-state":No(c),"data-disabled":s?"":void 0,...i,ref:t})})});Xc.displayName=Qr;var Zc="CollapsibleTrigger",Jc=l.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=To(Zc,r);return d.jsx(U.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":No(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:Z(e.onClick,o.onOpenToggle)})});Jc.displayName=Zc;var Ao="CollapsibleContent",Qc=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=To(Ao,e.__scopeCollapsible);return d.jsx(Ye,{present:r||o.open,children:({present:s})=>d.jsx(th,{...n,ref:t,present:s})})});Qc.displayName=Ao;var th=l.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...s}=e,a=To(Ao,r),[i,c]=l.useState(n),u=l.useRef(null),f=de(t,u),p=l.useRef(0),g=p.current,v=l.useRef(0),w=v.current,m=a.open||i,x=l.useRef(m),y=l.useRef(void 0);return l.useEffect(()=>{const h=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(h)},[]),he(()=>{const h=u.current;if(h){y.current=y.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const C=h.getBoundingClientRect();p.current=C.height,v.current=C.width,x.current||(h.style.transitionDuration=y.current.transitionDuration,h.style.animationName=y.current.animationName),c(n)}},[a.open,n]),d.jsx(U.div,{"data-state":No(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...s,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:m&&o})});function No(e){return e?"open":"closed"}var rh=Xc,nh=Jc,oh=Qc,Oe="Accordion",sh=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[_o,ah,ih]=Xn(Oe),[en,Kb]=ke(Oe,[ih,qc]),Io=qc(),el=P.forwardRef((e,t)=>{const{type:r,...n}=e,o=n,s=n;return d.jsx(_o.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?d.jsx(dh,{...s,ref:t}):d.jsx(uh,{...o,ref:t})})});el.displayName=Oe;var[tl,ch]=en(Oe),[rl,lh]=en(Oe,{collapsible:!1}),uh=P.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},collapsible:s=!1,...a}=e,[i,c]=Ee({prop:r,defaultProp:n??"",onChange:o,caller:Oe});return d.jsx(tl,{scope:e.__scopeAccordion,value:P.useMemo(()=>i?[i]:[],[i]),onItemOpen:c,onItemClose:P.useCallback(()=>s&&c(""),[s,c]),children:d.jsx(rl,{scope:e.__scopeAccordion,collapsible:s,children:d.jsx(nl,{...a,ref:t})})})}),dh=P.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...s}=e,[a,i]=Ee({prop:r,defaultProp:n??[],onChange:o,caller:Oe}),c=P.useCallback(f=>i((p=[])=>[...p,f]),[i]),u=P.useCallback(f=>i((p=[])=>p.filter(g=>g!==f)),[i]);return d.jsx(tl,{scope:e.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:d.jsx(rl,{scope:e.__scopeAccordion,collapsible:!0,children:d.jsx(nl,{...s,ref:t})})})}),[fh,tn]=en(Oe),nl=P.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:o,orientation:s="vertical",...a}=e,i=P.useRef(null),c=de(i,t),u=ah(r),p=Fr(o)==="ltr",g=Z(e.onKeyDown,v=>{var T;if(!sh.includes(v.key))return;const w=v.target,m=u().filter(H=>{var K;return!((K=H.ref.current)!=null&&K.disabled)}),x=m.findIndex(H=>H.ref.current===w),y=m.length;if(x===-1)return;v.preventDefault();let h=x;const C=0,S=y-1,k=()=>{h=x+1,h>S&&(h=C)},N=()=>{h=x-1,h<C&&(h=S)};switch(v.key){case"Home":h=C;break;case"End":h=S;break;case"ArrowRight":s==="horizontal"&&(p?k():N());break;case"ArrowDown":s==="vertical"&&k();break;case"ArrowLeft":s==="horizontal"&&(p?N():k());break;case"ArrowUp":s==="vertical"&&N();break}const _=h%y;(T=m[_].ref.current)==null||T.focus()});return d.jsx(fh,{scope:r,disabled:n,direction:o,orientation:s,children:d.jsx(_o.Slot,{scope:r,children:d.jsx(U.div,{...a,"data-orientation":s,ref:c,onKeyDown:n?void 0:g})})})}),Nr="AccordionItem",[ph,Oo]=en(Nr),ol=P.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...o}=e,s=tn(Nr,r),a=ch(Nr,r),i=Io(r),c=ve(),u=n&&a.value.includes(n)||!1,f=s.disabled||e.disabled;return d.jsx(ph,{scope:r,open:u,disabled:f,triggerId:c,children:d.jsx(rh,{"data-orientation":s.orientation,"data-state":ul(u),...i,...o,ref:t,disabled:f,open:u,onOpenChange:p=>{p?a.onItemOpen(n):a.onItemClose(n)}})})});ol.displayName=Nr;var sl="AccordionHeader",al=P.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=tn(Oe,r),s=Oo(sl,r);return d.jsx(U.h3,{"data-orientation":o.orientation,"data-state":ul(s.open),"data-disabled":s.disabled?"":void 0,...n,ref:t})});al.displayName=sl;var Hn="AccordionTrigger",il=P.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=tn(Oe,r),s=Oo(Hn,r),a=lh(Hn,r),i=Io(r);return d.jsx(_o.ItemSlot,{scope:r,children:d.jsx(nh,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:s.triggerId,...i,...n,ref:t})})});il.displayName=Hn;var cl="AccordionContent",ll=P.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=tn(Oe,r),s=Oo(cl,r),a=Io(r);return d.jsx(oh,{role:"region","aria-labelledby":s.triggerId,"data-orientation":o.orientation,...a,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});ll.displayName=cl;function ul(e){return e?"open":"closed"}var mh=el,gh=ol,vh=al,hh=il,xh=ll;function bh({...e}){return d.jsx(mh,{"data-slot":"accordion",...e})}function yh({className:e,...t}){return d.jsx(gh,{"data-slot":"accordion-item",className:$("border-b last:border-b-0 dark:border-border",e),...t})}function wh({className:e,children:t,...r}){return d.jsx(vh,{className:"flex",children:d.jsxs(hh,{"data-slot":"accordion-trigger",className:$("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium text-foreground transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180 dark:text-foreground dark:focus-visible:border-ring dark:focus-visible:ring-ring/50",e),...r,children:[t,d.jsx(fo,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 dark:text-muted-foreground"})]})})}function Ch({className:e,children:t,...r}){return d.jsx(xh,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-foreground dark:text-foreground",...r,children:d.jsx("div",{className:$("pt-0 pb-4",e),children:t})})}var Sh=e=>e.type==="checkbox",Ut=e=>e instanceof Date,jo=e=>e==null;const dl=e=>typeof e=="object";var vt=e=>!jo(e)&&!Array.isArray(e)&&dl(e)&&!Ut(e),Eh=e=>vt(e)&&e.target?Sh(e.target)?e.target.checked:e.target.value:e,Ph=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Rh=(e,t)=>e.has(Ph(t)),kh=e=>{const t=e.constructor&&e.constructor.prototype;return vt(t)&&t.hasOwnProperty("isPrototypeOf")},Th=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function fl(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Th&&(e instanceof Blob||n))&&(r||vt(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!kh(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=fl(e[o]));else return e;return t}var pl=e=>/^\w*$/.test(e),Un=e=>e===void 0,Ah=e=>Array.isArray(e)?e.filter(Boolean):[],ml=e=>Ah(e.replace(/["|']|\]/g,"").split(/\.|\[/)),we=(e,t,r)=>{if(!t||!vt(e))return r;const n=(pl(t)?[t]:ml(t)).reduce((o,s)=>jo(o)?o:o[s],e);return Un(n)||n===e?Un(e[t])?r:e[t]:n},Rn=e=>typeof e=="boolean",Bs=(e,t,r)=>{let n=-1;const o=pl(t)?[t]:ml(t),s=o.length,a=s-1;for(;++n<s;){const i=o[n];let c=r;if(n!==a){const u=e[i];c=vt(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=c,e=e[i]}};const Ws={BLUR:"blur",CHANGE:"change"},zs={all:"all"},Do=P.createContext(null);Do.displayName="HookFormContext";const sr=()=>P.useContext(Do),Nh=e=>{const{children:t,...r}=e;return P.createElement(Do.Provider,{value:r},t)};var _h=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const a=s;return t._proxyFormState[a]!==zs.all&&(t._proxyFormState[a]=!n||zs.all),r&&(r[a]=!0),e[a]}});return o};const gl=typeof window<"u"?P.useLayoutEffect:P.useEffect;function vl(e){const t=sr(),{control:r=t.control,disabled:n,name:o,exact:s}=e||{},[a,i]=P.useState(r._formState),c=P.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return gl(()=>r._subscribe({name:o,formState:c.current,exact:s,callback:u=>{!n&&i({...r._formState,...u})}}),[o,n,s]),P.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),P.useMemo(()=>_h(a,r,c.current,!1),[a,r])}var Ih=e=>typeof e=="string",Oh=(e,t,r,n,o)=>Ih(e)?we(r,e,o):Array.isArray(e)?e.map(s=>we(r,s)):r,Gs=e=>jo(e)||!dl(e);function hl(e,t,r=new WeakSet){if(Gs(e)||Gs(t))return e===t;if(Ut(e)&&Ut(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const a=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const i=t[s];if(Ut(a)&&Ut(i)||vt(a)&&vt(i)||Array.isArray(a)&&Array.isArray(i)?!hl(a,i,r):a!==i)return!1}}return!0}function jh(e){const t=sr(),{control:r=t.control,name:n,defaultValue:o,disabled:s,exact:a,compute:i}=e||{},c=P.useRef(o),u=P.useRef(i),f=P.useRef(void 0);u.current=i;const p=P.useMemo(()=>r._getWatch(n,c.current),[r,n]),[g,v]=P.useState(u.current?u.current(p):p);return gl(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:w=>{if(!s){const m=Oh(n,r._names,w.values||r._formValues,!1,c.current);if(u.current){const x=u.current(m);hl(x,f.current)||(v(x),f.current=x)}else v(m)}}}),[r,s,n,a]),P.useEffect(()=>r._removeUnmounted()),g}function Dh(e){const t=sr(),{name:r,disabled:n,control:o=t.control,shouldUnregister:s,defaultValue:a}=e,i=Rh(o._names.array,r),c=P.useMemo(()=>we(o._formValues,r,we(o._defaultValues,r,a)),[o,r,a]),u=jh({control:o,name:r,defaultValue:c,exact:!0}),f=vl({control:o,name:r,exact:!0}),p=P.useRef(e),g=P.useRef(o.register(r,{...e.rules,value:u,...Rn(e.disabled)?{disabled:e.disabled}:{}}));p.current=e;const v=P.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!we(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!we(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!we(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!we(f.validatingFields,r)},error:{enumerable:!0,get:()=>we(f.errors,r)}}),[f,r]),w=P.useCallback(h=>g.current.onChange({target:{value:Eh(h),name:r},type:Ws.CHANGE}),[r]),m=P.useCallback(()=>g.current.onBlur({target:{value:we(o._formValues,r),name:r},type:Ws.BLUR}),[r,o._formValues]),x=P.useCallback(h=>{const C=we(o._fields,r);C&&h&&(C._f.ref={focus:()=>h.focus&&h.focus(),select:()=>h.select&&h.select(),setCustomValidity:S=>h.setCustomValidity(S),reportValidity:()=>h.reportValidity()})},[o._fields,r]),y=P.useMemo(()=>({name:r,value:u,...Rn(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:w,onBlur:m,ref:x}),[r,n,f.disabled,w,m,x,u]);return P.useEffect(()=>{const h=o._options.shouldUnregister||s;o.register(r,{...p.current.rules,...Rn(p.current.disabled)?{disabled:p.current.disabled}:{}});const C=(S,k)=>{const N=we(o._fields,S);N&&N._f&&(N._f.mount=k)};if(C(r,!0),h){const S=fl(we(o._options.defaultValues,r));Bs(o._defaultValues,r,S),Un(we(o._formValues,r))&&Bs(o._formValues,r,S)}return!i&&o.register(r),()=>{(i?h&&!o._state.action:h)?o.unregister(r):C(r,!1)}},[r,o,i,s]),P.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),P.useMemo(()=>({field:y,formState:f,fieldState:v}),[y,f,v])}const Mh=e=>e.render(Dh(e)),xl=P.createContext(void 0),bl=e=>{const{methods:t,disabled:r,children:n}=e;return d.jsx(xl.Provider,{value:{disabled:r},children:d.jsx(Nh,{...t,children:n})})},yl=()=>{const e=P.useContext(xl),t=sr();if(!e||!t)throw new Error("formContext must be used within a FormProvider");return{...e,...t}},Fh=({type:e="button",...t})=>{const r=()=>e==="submit"||e==="reset"?"default":"outline";return d.jsx(Mr,{type:e,variant:r(),...t})};var wl={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hs=P.createContext&&P.createContext(wl),$h=["attr","size","title"];function Lh(e,t){if(e==null)return{};var r=Vh(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Vh(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_r.apply(this,arguments)}function Us(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ir(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Us(Object(r),!0).forEach(function(n){Bh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Us(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bh(e,t,r){return t=Wh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wh(e){var t=zh(e,"string");return typeof t=="symbol"?t:t+""}function zh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cl(e){return e&&e.map((t,r)=>P.createElement(t.tag,Ir({key:r},t.attr),Cl(t.child)))}function Sl(e){return t=>P.createElement(Gh,_r({attr:Ir({},e.attr)},t),Cl(e.child))}function Gh(e){var t=r=>{var{attr:n,size:o,title:s}=e,a=Lh(e,$h),i=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),P.createElement("svg",_r({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:c,style:Ir(Ir({color:e.color||r.color},r.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),s&&P.createElement("title",null,s),e.children)};return Hs!==void 0?P.createElement(Hs.Consumer,null,r=>t(r)):t(wl)}function Hh(e){return Sl({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Circle_Info"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M11.5,15a.5.5,0,0,0,1,0h0V10.981a.5.5,0,0,0-1,0Z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"8.999",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M12,2.065A9.934,9.934,0,1,1,2.066,12,9.945,9.945,0,0,1,12,2.065Zm0,18.867A8.934,8.934,0,1,0,3.066,12,8.944,8.944,0,0,0,12,20.932Z"},child:[]}]}]}]})(e)}var Uh="Label",El=l.forwardRef((e,t)=>d.jsx(U.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));El.displayName=Uh;var Kh=El;function Yh({className:e,...t}){return d.jsx(Kh,{"data-slot":"label",className:$("flex items-center text-purple-mutted-300 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",e),...t})}const Pl=l.createContext({}),qh=({...e})=>d.jsx(Pl.Provider,{value:{name:e.name},children:d.jsx(Mh,{...e})}),rn=()=>{const e=l.useContext(Pl),t=l.useContext(Rl),{getFieldState:r}=sr(),n=vl({name:e.name}),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},Rl=l.createContext({});function Xh({className:e,...t}){const r=l.useId();return d.jsx(Rl.Provider,{value:{id:r},children:d.jsx("div",{"data-slot":"form-item",className:$("grid gap-2",e),...t})})}function Zh({className:e,...t}){const{error:r,formItemId:n}=rn();return d.jsx(Yh,{"data-slot":"form-label","data-error":!!r,className:$("data-[error=true]:text-destructive font-normal text-sm",e),htmlFor:n,...t})}function Jh({...e}){const{error:t,formItemId:r,formDescriptionId:n,formMessageId:o}=rn();return d.jsx(fa,{"data-slot":"form-control",id:r,"aria-describedby":t?`${n} ${o}`:`${n}`,"aria-invalid":!!t,...e})}function Qh({className:e,...t}){const{formDescriptionId:r}=rn();return d.jsx("p",{"data-slot":"form-description",id:r,className:$("text-purple-mutted-300 text-sm",e),...t})}function ex({className:e,...t}){const{error:r,formMessageId:n}=rn(),o=r?String((r==null?void 0:r.message)??""):t.children;return o?d.jsx("p",{"data-slot":"form-message",id:n,className:$("text-destructive text-sm",e),...t,children:o}):null}var[nn,Yb]=ke("Tooltip",[Ft]),on=Ft(),kl="TooltipProvider",tx=700,Kn="tooltip.open",[rx,Mo]=nn(kl),Tl=e=>{const{__scopeTooltip:t,delayDuration:r=tx,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,a=l.useRef(!0),i=l.useRef(!1),c=l.useRef(0);return l.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),d.jsx(rx,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:l.useCallback(u=>{i.current=u},[]),disableHoverableContent:o,children:s})};Tl.displayName=kl;var Zt="Tooltip",[nx,ar]=nn(Zt),Al=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,c=Mo(Zt,e.__scopeTooltip),u=on(t),[f,p]=l.useState(null),g=ve(),v=l.useRef(0),w=a??c.disableHoverableContent,m=i??c.delayDuration,x=l.useRef(!1),[y,h]=Ee({prop:n,defaultProp:o??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Kn))):c.onClose(),s==null||s(_)},caller:Zt}),C=l.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),S=l.useCallback(()=>{window.clearTimeout(v.current),v.current=0,x.current=!1,h(!0)},[h]),k=l.useCallback(()=>{window.clearTimeout(v.current),v.current=0,h(!1)},[h]),N=l.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{x.current=!0,h(!0),v.current=0},m)},[m,h]);return l.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),d.jsx(ao,{...u,children:d.jsx(nx,{scope:t,contentId:g,open:y,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:l.useCallback(()=>{c.isOpenDelayedRef.current?N():S()},[c.isOpenDelayedRef,N,S]),onTriggerLeave:l.useCallback(()=>{w?k():(window.clearTimeout(v.current),v.current=0)},[k,w]),onOpen:S,onClose:k,disableHoverableContent:w,children:r})})};Al.displayName=Zt;var Yn="TooltipTrigger",Nl=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=ar(Yn,r),s=Mo(Yn,r),a=on(r),i=l.useRef(null),c=de(t,i,o.onTriggerChange),u=l.useRef(!1),f=l.useRef(!1),p=l.useCallback(()=>u.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.jsx(zr,{asChild:!0,...a,children:d.jsx(U.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:Z(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Z(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Z(e.onBlur,o.onClose),onClick:Z(e.onClick,o.onClose)})})});Nl.displayName=Yn;var Fo="TooltipPortal",[ox,sx]=nn(Fo,{forceMount:void 0}),_l=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,s=ar(Fo,t);return d.jsx(ox,{scope:t,forceMount:r,children:d.jsx(Ye,{present:r||s.open,children:d.jsx(tr,{asChild:!0,container:o,children:n})})})};_l.displayName=Fo;var It="TooltipContent",Il=l.forwardRef((e,t)=>{const r=sx(It,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,a=ar(It,e.__scopeTooltip);return d.jsx(Ye,{present:n||a.open,children:a.disableHoverableContent?d.jsx(Ol,{side:o,...s,ref:t}):d.jsx(ax,{side:o,...s,ref:t})})}),ax=l.forwardRef((e,t)=>{const r=ar(It,e.__scopeTooltip),n=Mo(It,e.__scopeTooltip),o=l.useRef(null),s=de(t,o),[a,i]=l.useState(null),{trigger:c,onClose:u}=r,f=o.current,{onPointerInTransitChange:p}=n,g=l.useCallback(()=>{i(null),p(!1)},[p]),v=l.useCallback((w,m)=>{const x=w.currentTarget,y={x:w.clientX,y:w.clientY},h=ux(y,x.getBoundingClientRect()),C=dx(y,h),S=fx(m.getBoundingClientRect()),k=mx([...C,...S]);i(k),p(!0)},[p]);return l.useEffect(()=>()=>g(),[g]),l.useEffect(()=>{if(c&&f){const w=x=>v(x,f),m=x=>v(x,c);return c.addEventListener("pointerleave",w),f.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",m)}}},[c,f,v,g]),l.useEffect(()=>{if(a){const w=m=>{const x=m.target,y={x:m.clientX,y:m.clientY},h=(c==null?void 0:c.contains(x))||(f==null?void 0:f.contains(x)),C=!px(y,a);h?g():C&&(g(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,f,a,u,g]),d.jsx(Ol,{...e,ref:s})}),[ix,cx]=nn(Zt,{isInside:!1}),lx=bd("TooltipContent"),Ol=l.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,c=ar(It,r),u=on(r),{onClose:f}=c;return l.useEffect(()=>(document.addEventListener(Kn,f),()=>document.removeEventListener(Kn,f)),[f]),l.useEffect(()=>{if(c.trigger){const p=g=>{const v=g.target;v!=null&&v.contains(c.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,f]),d.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:d.jsxs(io,{"data-state":c.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(lx,{children:n}),d.jsx(ix,{scope:r,isInside:!0,children:d.jsx(pp,{id:c.contentId,role:"tooltip",children:o||n})})]})})});Il.displayName=It;var jl="TooltipArrow",Dl=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=on(r);return cx(jl,r).isInside?null:d.jsx(co,{...o,...n,ref:t})});Dl.displayName=jl;function ux(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function dx(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function fx(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function px(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],c=t[a],u=i.x,f=i.y,p=c.x,g=c.y;f>n!=g>n&&r<(p-u)*(n-f)/(g-f)+u&&(o=!o)}return o}function mx(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),gx(t)}function gx(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],a=r[r.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var vx=Tl,hx=Al,xx=Nl,bx=_l,yx=Il,wx=Dl;function Ml({delayDuration:e=0,...t}){return d.jsx(vx,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Fl({...e}){return d.jsx(Ml,{children:d.jsx(hx,{"data-slot":"tooltip",...e})})}function $l({...e}){return d.jsx(xx,{"data-slot":"tooltip-trigger",...e})}function Ll({className:e,sideOffset:t=0,children:r,...n}){return d.jsx(bx,{children:d.jsxs(yx,{"data-slot":"tooltip-content",sideOffset:t,className:$("bg-purple-mutted-700 border border-purple-mutted-600 text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,d.jsx(wx,{className:"bg-purple-mutted-700 fill-purple-mutted-700 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const $o=e=>t=>{const{name:r,label:n,description:o,tooltip:s,...a}=t,{control:i,disabled:c}=yl(),u=()=>s?d.jsxs(Fl,{children:[d.jsx($l,{asChild:!0,children:d.jsx(Hh,{size:16})}),d.jsx(Ll,{children:d.jsx("p",{children:s})})]}):d.jsx(d.Fragment,{}),f=()=>o?d.jsx(Qh,{children:o}):d.jsx(d.Fragment,{});return d.jsx(qh,{control:i,name:r,render:({field:p})=>d.jsxs(Xh,{className:"flex flex-col gap-1.5",children:[n&&d.jsx(Zh,{children:d.jsxs("span",{className:"flex items-center gap-1",children:[n,!!s&&u()]})}),d.jsx(Jh,{children:d.jsx(e,{...p,...a,disabled:c})}),!!o&&f(),d.jsx(ex,{})]})})},Cx=$o(da),Vl=P.forwardRef(({options:e,placeholder:t,value:r,onChange:n,disabled:o},s)=>{var c;const a=u=>{n&&n({target:{value:u}})},i=u=>d.jsx(ho,{value:u.value,disabled:u.disabled,children:d.jsxs("div",{className:"flex flex-col",children:[u.label,u.subLabel&&d.jsx("span",{className:"text-xs text-muted-foreground",style:{overflowWrap:"anywhere"},children:u.subLabel})]})},u.value);return d.jsxs(ji,{value:r,onValueChange:a,disabled:o,children:[d.jsx(po,{ref:s,children:d.jsx(Di,{placeholder:t,children:r&&((c=e.find(u=>u.value===r))==null?void 0:c.label)})}),d.jsx(vo,{children:e.map(i)})]})});Vl.displayName="BaseSelectComponent";const Sx=$o(Vl),Ex=P.forwardRef((e,t)=>{const{options:r=[],placeholder:n,value:o,onChange:s=()=>{},disabled:a,searchPlaceholder:i,emptyText:c}=e,u=f=>{s({target:{value:f}})};return d.jsx(So,{ref:t,options:r,value:o,onValueChange:u,placeholder:n,searchPlaceholder:i,emptyText:c,disabled:a})}),Px=$o(Ex),Rx=e=>d.jsx("hr",{className:"w-full h-px border-purple-mutted-500",...e}),kx=({children:e,description:t,className:r})=>d.jsxs("div",{className:$("space-y-1",r),children:[d.jsx("h2",{className:"flex items-center gap-2.5 text-2xl text-white",children:e}),t&&d.jsx("span",{className:"text-sm text-purple-mutted-300",children:t})]}),ht=e=>{const{className:t,disabled:r=!1,methods:n,onSubmit:o=()=>{},...s}=e,{handleSubmit:a}=n,i=$("flex flex-col gap-6",{},t);return d.jsx(bl,{methods:n,disabled:r,children:d.jsx("form",{className:i,onSubmit:a(o),...s})})};ht.Button=Fh;ht.Input=Cx;ht.Select=Sx;ht.Combobox=Px;ht.Divider=Rx;ht.Title=kx;function Tx(e){return e==null?[]:Array.isArray(e)?e:[e]}var Ax=e=>Array.from(Array(e).keys()),Ks=e=>(e==null?void 0:e.constructor.name)==="Array",Nx=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Lo(e[r],t[r]))return!1;return!0},Lo=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(t==null?void 0:t.isEqual)=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Ks(e)&&Ks(t))return Nx(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const r=Object.keys(t??Object.create(null)),n=r.length;for(let o=0;o<n;o++)if(!Reflect.has(e,r[o]))return!1;for(let o=0;o<n;o++){const s=r[o];if(!Lo(e[s],t[s]))return!1}return!0},_x=e=>e!=null&&typeof e=="object",wr=e=>typeof e=="string",Kt=e=>typeof e=="function",Ix=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ox=e=>Object.prototype.toString.call(e),Bl=Function.prototype.toString,jx=Bl.call(Object),Dx=e=>{if(!_x(e)||Ox(e)!="[object Object]"||$x(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const r=Ix(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Bl.call(r)==jx},Mx=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,Fx=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,$x=e=>Mx(e)||Fx(e),Lx=e=>e(),Vx=(...e)=>(...t)=>{e.forEach(function(r){r==null||r(...t)})},Bx=e=>Number.isNaN(e),Wx=e=>Bx(e)?0:e,zx=(e,t,r)=>{const n=Wx(e),o=n>=t,s=r==null||n<=r;return o&&s};function Wl(e){if(!Dx(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(n=>typeof n=="string"),r={};for(const n of t){const o=e[n];o!==void 0&&(r[n]=Wl(o))}return r}function Ys(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function Gx(e,t){if(e==null)throw new Error(t())}var zl=e=>typeof e=="object"&&e!==null,Me=e=>e?"":void 0,Hx=9,Ux=e=>zl(e)&&e.nodeType===Hx,Kx=e=>zl(e)&&e===e.window;function Yx(e){if(!e)return!1;const t=e.getRootNode();return Gl(t)===e}function qx(e){return Ux(e)?e:Kx(e)?e.document:(e==null?void 0:e.ownerDocument)??document}function Gl(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const r=t.shadowRoot.activeElement;if(!r||r===t)break;t=r}return t}var Xx=(...e)=>e.map(t=>{var r;return(r=t==null?void 0:t.trim)==null?void 0:r.call(t)}).filter(Boolean).join(" "),Zx=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,qs=e=>{const t={};let r;for(;r=Zx.exec(e);)t[r[1]]=r[2];return t},Jx=(e,t)=>{if(wr(e)){if(wr(t))return`${e};${t}`;e=qs(e)}else wr(t)&&(t=qs(t));return Object.assign({},e??{},t??{})};function je(...e){let t={};for(let r of e){if(!r)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof r[o]=="function"){t[o]=Vx(r[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=Xx(t[o],r[o]);continue}if(o==="style"){t[o]=Jx(t[o],r[o]);continue}t[o]=r[o]!==void 0?r[o]:t[o]}for(let o in r)t[o]===void 0&&(t[o]=r[o]);const n=Object.getOwnPropertySymbols(r);for(let o of n)t[o]=r[o]}return t}function Qx(e,t,r){let n=[],o;return s=>{const a=e(s);return(a.length!==n.length||a.some((c,u)=>!Lo(n[u],c)))&&(n=a,o=t(a,s)),o}}var kt=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(kt||{}),kn="__init__";function eb(e){const t=()=>{var a;return((a=e.getRootNode)==null?void 0:a.call(e))??document},r=()=>qx(t());return{...e,getRootNode:t,getDoc:r,getWin:()=>r().defaultView??window,getActiveElement:()=>Gl(t()),isActiveElement:Yx,getById:a=>t().getElementById(a)}}function tb(e){return new Proxy({},{get(t,r){return r==="style"?n=>e({style:n}).style:e}})}var rb=()=>e=>Array.from(new Set(e)),Hl=typeof globalThis.document<"u"?P.useLayoutEffect:P.useEffect;function Or(e){const t=e().value??e().defaultValue,r=e().isEqual??Object.is,[n]=P.useState(t),[o,s]=P.useState(n),a=e().value!==void 0,i=P.useRef(o);i.current=a?e().value:o;const c=P.useRef(i.current);Hl(()=>{c.current=i.current},[o,e().value]);const u=p=>{var w,m;const g=c.current,v=Kt(p)?p(g):p;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:v,prev:g}),a||s(v),r(v,g)||(m=(w=e()).onChange)==null||m.call(w,v,g)};function f(){return a?e().value:o}return{initial:n,ref:i,get:f,set(p){(e().sync?Jt.flushSync:Lx)(()=>u(p))},invoke(p,g){var v,w;(w=(v=e()).onChange)==null||w.call(v,p,g)},hash(p){var g,v;return((v=(g=e()).hash)==null?void 0:v.call(g,p))??String(p)}}}Or.cleanup=e=>{P.useEffect(()=>e,[])};Or.ref=e=>{const t=P.useRef(e);return{get:()=>t.current,set:r=>{t.current=r}}};function nb(e){const t=P.useRef(e);return{get(r){return t.current[r]},set(r,n){t.current[r]=n}}}var ob=(e,t)=>{const r=P.useRef(!1),n=P.useRef(!1);P.useEffect(()=>{if(r.current&&n.current)return t();n.current=!0},[...(e??[]).map(o=>typeof o=="function"?o():o)]),P.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[])};function sb(e,t={}){var ee,J,Y,z;const r=P.useMemo(()=>{const{id:j,ids:A,getRootNode:D}=t;return eb({id:j,ids:A,getRootNode:D})},[t]),n=(...j)=>{e.debug&&console.log(...j)},o=((ee=e.props)==null?void 0:ee.call(e,{props:Wl(t),scope:r}))??t,s=ab(o),a=(J=e.context)==null?void 0:J.call(e,{prop:s,bindable:Or,scope:r,flush:Xs,getContext(){return c},getComputed(){return k},getRefs(){return m},getEvent(){return v()}}),i=Ul(a),c={get(j){var A;return(A=i.current)==null?void 0:A[j].ref.current},set(j,A){var D;(D=i.current)==null||D[j].set(A)},initial(j){var A;return(A=i.current)==null?void 0:A[j].initial},hash(j){var D,E;const A=(D=i.current)==null?void 0:D[j].get();return(E=i.current)==null?void 0:E[j].hash(A)}},u=P.useRef(new Map),f=P.useRef(null),p=P.useRef(null),g=P.useRef({type:""}),v=()=>({...g.current,current(){return g.current},previous(){return p.current}}),w=()=>({...N,matches(...j){return j.includes(N.ref.current)},hasTag(j){var A,D;return!!((D=(A=e.states[N.ref.current])==null?void 0:A.tags)!=null&&D.includes(j))}}),m=nb(((Y=e.refs)==null?void 0:Y.call(e,{prop:s,context:c}))??{}),x=()=>({state:w(),context:c,event:v(),prop:s,send:K,action:y,guard:h,track:ob,refs:m,computed:k,flush:Xs,scope:r,choose:S}),y=j=>{const A=Kt(j)?j(x()):j;if(!A)return;const D=A.map(E=>{var oe,le;const G=(le=(oe=e.implementations)==null?void 0:oe.actions)==null?void 0:le[E];return G||Ys(`[zag-js] No implementation found for action "${JSON.stringify(E)}"`),G});for(const E of D)E==null||E(x())},h=j=>{var A,D;return Kt(j)?j(x()):(D=(A=e.implementations)==null?void 0:A.guards)==null?void 0:D[j](x())},C=j=>{const A=Kt(j)?j(x()):j;if(!A)return;const D=A.map(G=>{var le,R;const oe=(R=(le=e.implementations)==null?void 0:le.effects)==null?void 0:R[G];return oe||Ys(`[zag-js] No implementation found for effect "${JSON.stringify(G)}"`),oe}),E=[];for(const G of D){const oe=G==null?void 0:G(x());oe&&E.push(oe)}return()=>E.forEach(G=>G==null?void 0:G())},S=j=>Tx(j).find(A=>{let D=!A.guard;return wr(A.guard)?D=!!h(A.guard):Kt(A.guard)&&(D=A.guard(x())),D}),k=j=>{Gx(e.computed,()=>"[zag-js] No computed object found on machine");const A=e.computed[j];return A({context:c,event:v(),prop:s,refs:m,scope:r,computed:k})},N=Or(()=>({defaultValue:e.initialState({prop:s}),onChange(j,A){var E,G,oe,le;if(A){const R=u.current.get(A);R==null||R(),u.current.delete(A)}A&&y((E=e.states[A])==null?void 0:E.exit),y((G=f.current)==null?void 0:G.actions);const D=C((oe=e.states[j])==null?void 0:oe.effects);if(D&&u.current.set(j,D),A===kn){y(e.entry);const R=C(e.effects);R&&u.current.set(kn,R)}y((le=e.states[j])==null?void 0:le.entry)}})),_=P.useRef(void 0),T=P.useRef(kt.NotStarted);Hl(()=>{queueMicrotask(()=>{const D=T.current===kt.Started;T.current=kt.Started,n(D?"rehydrating...":"initializing...");const E=_.current??N.initial;N.invoke(E,D?N.get():kn)});const j=u.current,A=N.ref.current;return()=>{n("unmounting..."),_.current=A,T.current=kt.Stopped,j.forEach(D=>D==null?void 0:D()),u.current=new Map,f.current=null,queueMicrotask(()=>{y(e.exit)})}},[]);const H=()=>"ref"in N?N.ref.current:N.get(),K=j=>{queueMicrotask(()=>{var le,R;if(T.current!==kt.Started)return;p.current=g.current,g.current=j;let A=H();const D=((le=e.states[A].on)==null?void 0:le[j.type])??((R=e.on)==null?void 0:R[j.type]),E=S(D);if(!E)return;f.current=E;const G=E.target??A;n("transition",j.type,E.target||A,`(${E.actions})`);const oe=G!==A;oe?Jt.flushSync(()=>N.set(G)):E.reenter&&!oe?N.invoke(A,A):y(E.actions??[])})};return(z=e.watch)==null||z.call(e,x()),{state:w(),send:K,context:c,prop:s,scope:r,refs:m,computed:k,event:v(),getStatus:()=>T.current}}function Ul(e){const t=P.useRef(e);return t.current=e,t}function ab(e){const t=Ul(e);return function(n){return t.current[n]}}function Xs(e){queueMicrotask(()=>{Jt.flushSync(()=>e())})}var ib=tb(e=>e);function cb(...e){return t=>{const r=[];for(const n of e)if(typeof n=="function"){const o=n(t);typeof o=="function"&&r.push(o)}else n&&(n.current=t);if(r.length)return()=>{for(const n of r)n()}}}function lb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const Tn=e=>{const t=P.memo(P.forwardRef((r,n)=>{const{asChild:o,children:s,...a}=r;if(!o)return P.createElement(e,{...a,ref:n},s);if(!P.isValidElement(s))return null;const i=P.Children.only(s),c=lb(i);return P.cloneElement(i,{...je(a,i.props),ref:n?cb(n,c):c})}));return t.displayName=e.displayName||e.name,t},ub=()=>{const e=new Map;return new Proxy(Tn,{apply(t,r,n){return Tn(n[0])},get(t,r){const n=r;return e.has(n)||e.set(n,Tn(n)),e.get(n)}})},ze=ub();function db(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function ir(e={}){const{name:t,strict:r=!0,hookName:n="useContext",providerName:o="Provider",errorMessage:s,defaultValue:a}=e,i=P.createContext(a);i.displayName=t;function c(){var f;const u=P.useContext(i);if(!u&&r){const p=new Error(s??db(n,o));throw p.name="ContextError",(f=Error.captureStackTrace)==null||f.call(Error,p,c),p}return u}return[i.Provider,c,i]}const[fb,qe]=ir({name:"StepsContext",hookName:"useStepsContext",providerName:"<StepsProvider />"}),Kl=P.forwardRef((e,t)=>{const r=qe(),n=je(r.getContentProps({index:r.count}),e);return d.jsx(ze.div,{...n,ref:t})});Kl.displayName="StepsCompletedContent";const Vo=()=>(e,t)=>t.reduce((r,n)=>{const[o,s]=r,a=n;return s[a]!==void 0&&(o[a]=s[a]),delete s[a],[o,s]},[{},{...e}]),Yl=P.forwardRef((e,t)=>{const[r,n]=Vo()(e,["index"]),o=qe(),s=je(o.getContentProps(r),n);return d.jsx(ze.div,{...s,ref:t})});Yl.displayName="StepsContent";const[pb,Bo]=ir({name:"StepsItemPropsContext",hookName:"useStepsItemPropsContext",providerName:"<StepsItemPropsProvider />"}),ql=P.forwardRef((e,t)=>{const r=qe(),n=Bo(),o=je(r.getIndicatorProps(n),e);return d.jsx(ze.div,{...o,ref:t})});ql.displayName="StepsIndicator";const[mb,qb]=ir({name:"StepsItemContext",hookName:"useStepsItemContext",providerName:"<StepsItem />"}),Xl=P.forwardRef((e,t)=>{const[r,n]=Vo()(e,["index"]),o=qe(),s=je(o.getItemProps(r),n),a=o.getItemState(r);return d.jsx(pb,{value:r,children:d.jsx(mb,{value:a,children:d.jsx(ze.div,{...s,ref:t})})})});Xl.displayName="StepsItem";const Zl=P.forwardRef((e,t)=>{const r=qe(),n=je(r.getListProps(),e);return d.jsx(ze.div,{...n,ref:t})});Zl.displayName="StepsList";const Jl=P.forwardRef((e,t)=>{const r=qe(),n=je(r.getNextTriggerProps(),e);return d.jsx(ze.button,{...n,ref:t})});Jl.displayName="StepsNextTrigger";const Ql=P.forwardRef((e,t)=>{const r=qe(),n=je(r.getPrevTriggerProps(),e);return d.jsx(ze.button,{...n,ref:t})});Ql.displayName="StepsPrevTrigger";var Yt=(e,t=[])=>({parts:(...r)=>{if(gb(t))return Yt(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>Yt(e,[...t,...r]),omit:(...r)=>Yt(e,t.filter(n=>!r.includes(n))),rename:r=>Yt(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${Et(e)}"][data-part="${Et(n)}"]`,`& [data-scope="${Et(e)}"][data-part="${Et(n)}"]`].join(", "),attrs:{"data-scope":Et(e),"data-part":Et(n)}}}),{})}),Et=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),gb=e=>e.length===0,vb=Yt("steps").parts("root","list","item","trigger","indicator","separator","content","nextTrigger","prevTrigger","progress"),Fe=vb.build(),hb=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`steps:${e.id}`},xb=e=>{var t;return((t=e.ids)==null?void 0:t.list)??`steps:${e.id}:list`},Zs=(e,t)=>{var r,n;return((n=(r=e.ids)==null?void 0:r.triggerId)==null?void 0:n.call(r,t))??`steps:${e.id}:trigger:${t}`},bb=(e,t)=>{var r,n;return((n=(r=e.ids)==null?void 0:r.contentId)==null?void 0:n.call(r,t))??`steps:${e.id}:content:${t}`};function yb(e,t){const{context:r,send:n,computed:o,prop:s,scope:a}=e,i=r.get("step"),c=s("count"),u=o("percent"),f=o("hasNextStep"),p=o("hasPrevStep"),g=y=>({triggerId:Zs(a,y.index),contentId:bb(a,y.index),current:y.index===i,completed:y.index<i,incomplete:y.index>i,index:y.index,first:y.index===0,last:y.index===c-1}),v=()=>{n({type:"STEP.NEXT",src:"next.trigger.click"})},w=()=>{n({type:"STEP.PREV",src:"prev.trigger.click"})},m=()=>{n({type:"STEP.RESET",src:"reset.trigger.click"})},x=y=>{n({type:"STEP.SET",value:y,src:"api.setValue"})};return{value:i,count:c,percent:u,hasNextStep:f,hasPrevStep:p,isCompleted:o("completed"),goToNextStep:v,goToPrevStep:w,resetStep:m,getItemState:g,setStep:x,getRootProps(){return t.element({...Fe.root.attrs,id:hb(a),dir:s("dir"),"data-orientation":s("orientation"),style:{"--percent":`${u}%`}})},getListProps(){const h=Ax(c).map((C,S)=>Zs(a,S));return t.element({...Fe.list.attrs,dir:s("dir"),id:xb(a),role:"tablist","aria-owns":h.join(" "),"aria-orientation":s("orientation"),"data-orientation":s("orientation")})},getItemProps(y){const h=g(y);return t.element({...Fe.item.attrs,dir:s("dir"),"aria-current":h.current?"step":void 0,"data-orientation":s("orientation")})},getTriggerProps(y){const h=g(y);return t.button({...Fe.trigger.attrs,id:h.triggerId,role:"tab",dir:s("dir"),tabIndex:!s("linear")||h.current?0:-1,"aria-selected":h.current,"aria-controls":h.contentId,"data-state":h.current?"open":"closed","data-orientation":s("orientation"),"data-complete":Me(h.completed),"data-current":Me(h.current),"data-incomplete":Me(h.incomplete),onClick(C){C.defaultPrevented||s("linear")||n({type:"STEP.SET",value:y.index,src:"trigger.click"})}})},getContentProps(y){const h=g(y);return t.element({...Fe.content.attrs,dir:s("dir"),id:h.contentId,role:"tabpanel",tabIndex:0,hidden:!h.current,"data-state":h.current?"open":"closed","data-orientation":s("orientation"),"aria-labelledby":h.triggerId})},getIndicatorProps(y){const h=g(y);return t.element({...Fe.indicator.attrs,dir:s("dir"),"aria-hidden":!0,"data-complete":Me(h.completed),"data-current":Me(h.current),"data-incomplete":Me(h.incomplete)})},getSeparatorProps(y){const h=g(y);return t.element({...Fe.separator.attrs,dir:s("dir"),"data-orientation":s("orientation"),"data-complete":Me(h.completed),"data-current":Me(h.current),"data-incomplete":Me(h.incomplete)})},getNextTriggerProps(){return t.button({...Fe.nextTrigger.attrs,dir:s("dir"),type:"button",disabled:!f,onClick(y){y.defaultPrevented||v()}})},getPrevTriggerProps(){return t.button({dir:s("dir"),...Fe.prevTrigger.attrs,type:"button",disabled:!p,onClick(y){y.defaultPrevented||w()}})},getProgressProps(){return t.element({dir:s("dir"),...Fe.progress.attrs,role:"progressbar","aria-valuenow":u,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":`${u}% complete`,"data-complete":Me(u===100)})}}}var wb={props({props:e}){return{defaultStep:0,count:1,linear:!1,orientation:"horizontal",...e}},context({prop:e,bindable:t}){return{step:t(()=>({defaultValue:e("defaultStep"),value:e("step"),onChange(r){var o,s;(o=e("onStepChange"))==null||o({step:r}),r==e("count")&&((s=e("onStepComplete"))==null||s())}}))}},computed:{percent:Qx(({context:e,prop:t})=>[e.get("step"),t("count")],([e,t])=>e/t*100),hasNextStep:({context:e,prop:t})=>e.get("step")<t("count"),hasPrevStep:({context:e})=>e.get("step")>0,completed:({context:e,prop:t})=>e.get("step")===t("count")},initialState(){return"idle"},entry:["validateStep"],states:{idle:{on:{"STEP.SET":{actions:["setStep"]},"STEP.NEXT":{actions:["goToNextStep"]},"STEP.PREV":{actions:["goToPrevStep"]},"STEP.RESET":{actions:["resetStep"]}}}},implementations:{actions:{goToNextStep({context:e,prop:t}){const r=Math.min(e.get("step")+1,t("count"));e.set("step",r)},goToPrevStep({context:e}){const t=Math.max(e.get("step")-1,0);e.set("step",t)},resetStep({context:e}){e.set("step",0)},setStep({context:e,event:t}){e.set("step",t.value)},validateStep({context:e,prop:t}){Cb(t("count"),e.get("step"))}}}},Cb=(e,t)=>{if(!zx(t,0,e))throw new RangeError(`[zag-js/steps] step index ${t} is out of bounds`)};rb()(["count","dir","getRootNode","id","ids","linear","onStepChange","onStepComplete","orientation","step","defaultStep"]);const[Xb,Sb]=ir({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[Zb,Eb]=ir({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}});function Pb(e){const t=P.useId(),{getRootNode:r}=Sb(),{dir:n}=Eb(),o={id:t,dir:n,getRootNode:r,...e},s=sb(wb,o);return yb(s,ib)}const eu=P.forwardRef((e,t)=>{const[r,n]=Vo()(e,["defaultStep","id","ids","count","linear","onStepChange","onStepComplete","orientation","step"]),o=Pb(r),s=je(o.getRootProps(),n);return d.jsx(fb,{value:o,children:d.jsx(ze.div,{...s,ref:t})})});eu.displayName="StepsRoot";const tu=P.forwardRef((e,t)=>{const r=qe(),n=Bo(),o=je(r.getSeparatorProps(n),e);return d.jsx(ze.div,{...o,ref:t})});tu.displayName="StepsSeparator";const ru=P.forwardRef((e,t)=>{const r=qe(),n=Bo(),o=je(r.getTriggerProps(n),e);return d.jsx(ze.button,{...o,ref:t})});ru.displayName="StepsTrigger";function Rb(e){return Sl({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 6 9 17l-5-5"},child:[]}]})(e)}const nu=P.createContext(void 0),kb=({children:e,step:t})=>d.jsx(nu.Provider,{value:{step:t},children:e}),ou=()=>{const e=P.useContext(nu);if(!e)throw new Error("useSteps must be used within a StepsProvider");return e},Tb=({className:e,step:t,...r})=>{const n=$("flex flex-col gap-4",e);return d.jsx(kb,{step:t??0,children:d.jsx(eu,{className:n,step:t,...r})})},Ab=({className:e,...t})=>{const r=$("flex flex-row gap-4",e);return d.jsx(Zl,{className:r,...t})},Nb=({className:e,...t})=>{const r=$("flex flex-row items-center gap-4",e);return d.jsx(Xl,{className:r,...t})},_b=({className:e,...t})=>{const r=$("flex flex-row items-center gap-4 text-purple-mutted-100 text-sm",e);return d.jsx(ru,{className:r,...t})},Ib=({index:e,className:t,...r})=>{const{step:n}=ou(),o=e===n,s=e<n,a=$("flex items-center justify-center w-8 h-8 rounded-full text-white",s&&"bg-green-700",o&&"bg-green-600",!s&&!o&&"bg-purple-mutted-500",t),i=$({"text-white":o,"text-purple-mutted-300":!s&&e!==n});return d.jsx(ql,{className:a,...r,children:s?d.jsx(Rb,{className:"text-green-400"}):d.jsx("span",{className:i,children:e+1})})},Ob=({index:e,className:t,...r})=>{const{step:n}=ou(),o=e<n,s=$("min-w-12 h-px",o?"bg-green-400":"bg-gray-400",t);return d.jsx(tu,{className:s,...r})},jb=({className:e,...t})=>{const r=$(e);return d.jsx(Yl,{className:r,...t})},Db=({className:e,...t})=>{const r=$(e);return d.jsx(Kl,{className:r,...t})},Mb=({className:e,...t})=>{const r=$("bg-primary text-white px-4 py-2 rounded-md",e);return d.jsx(Ql,{className:r,...t})},Fb=({className:e,...t})=>{const r=$("bg-primary text-white px-4 py-2 rounded-md",e);return d.jsx(Jl,{className:r,...t})},$b={Root:Tb,List:Ab,Item:Nb,Trigger:_b,Indicator:Ib,Separator:Ob,Content:jb,CompletedContent:Db,PrevTrigger:Mb,NextTrigger:Fb},Lb=({children:e,content:t,providerProps:r={},triggerProps:n={},contentProps:o={}})=>d.jsx(Ml,{...r,children:d.jsxs(Fl,{children:[d.jsx($l,{...n,children:e}),t&&d.jsx(Ll,{...o,children:t})]})});exports.Accordion=bh;exports.AccordionContent=Ch;exports.AccordionItem=yh;exports.AccordionTrigger=wh;exports.Badge=av;exports.Button=Mr;exports.Card=iv;exports.CardAction=dv;exports.CardContent=fv;exports.CardDescription=uv;exports.CardFooter=pv;exports.CardHeader=cv;exports.CardTitle=lv;exports.Combobox=So;exports.Dialog=Tg;exports.DialogClose=Ng;exports.DialogContent=_g;exports.DialogDescription=Dg;exports.DialogFooter=Og;exports.DialogHeader=Ig;exports.DialogOverlay=mc;exports.DialogPortal=pc;exports.DialogTitle=jg;exports.DialogTrigger=Ag;exports.Form=ht;exports.FormProvider=bl;exports.Input=da;exports.Progress=Cv;exports.Select=ji;exports.SelectContent=vo;exports.SelectGroup=Wm;exports.SelectItem=ho;exports.SelectLabel=Mi;exports.SelectScrollDownButton=go;exports.SelectScrollUpButton=mo;exports.SelectSeparator=Fi;exports.SelectTrigger=po;exports.SelectValue=Di;exports.Skeleton=Sv;exports.Steps=$b;exports.Switch=Nv;exports.Toggle=Iv;exports.ToggleGroup=Zv;exports.ToggleGroupItem=Jv;exports.Tooltip=Lb;exports.borderRadius=Au;exports.cn=$;exports.colors=ku;exports.spacing=Tu;exports.typography=Nu;exports.useFormContext=yl;
|
|
130
130
|
//# sourceMappingURL=index.cjs.js.map
|