import{c as A}from"./utils-Q0fnGDhj.js";import{r as s,j as _,b as I}from"./client-BbMi5ewG.js";import{c as O,d as P}from"./Button-1dacbE2T.js";/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],H=A("chevron-up",j);function b(e,t=[]){let n=[];function r(l,i){const c=s.createContext(i),u=n.length;n=[...n,i];const a=d=>{var C;const{scope:m,children:v,...y}=d,f=((C=m==null?void 0:m[e])==null?void 0:C[u])||c,p=s.useMemo(()=>y,Object.values(y));return _.jsx(f.Provider,{value:p,children:v})};a.displayName=l+"Provider";function x(d,m){var f;const v=((f=m==null?void 0:m[e])==null?void 0:f[u])||c,y=s.useContext(v);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${l}\``)}return[a,x]}const o=()=>{const l=n.map(i=>s.createContext(i));return function(c){const u=(c==null?void 0:c[e])||l;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,T(o,...t)]}function T(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const i=r.reduce((c,{useScope:u,scopeName:a})=>{const d=u(l)[`__scope${a}`];return{...c,...d}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function g(e){const t=w(e),n=s.forwardRef((r,o)=>{const{children:l,...i}=r,c=s.Children.toArray(l),u=c.find(L);if(u){const a=u.props.children,x=c.map(d=>d===u?s.Children.count(a)>1?s.Children.only(null):s.isValidElement(a)?a.props.children:null:d);return _.jsx(t,{...i,ref:o,children:s.isValidElement(a)?s.cloneElement(a,void 0,x):null})}return _.jsx(t,{...i,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function w(e){const t=s.forwardRef((n,r)=>{const{children:o,...l}=n;if(s.isValidElement(o)){const i=D(o),c=V(l,o.props);return o.type!==s.Fragment&&(c.ref=r?O(r,i):i),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $=Symbol("radix.slottable");function L(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$}function V(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...c)=>{const u=l(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function D(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function F(e){const t=e+"CollectionProvider",[n,r]=b(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=f=>{const{scope:p,children:C}=f,S=I.useRef(null),R=I.useRef(new Map).current;return _.jsx(o,{scope:p,itemMap:R,collectionRef:S,children:C})};i.displayName=t;const c=e+"CollectionSlot",u=g(c),a=I.forwardRef((f,p)=>{const{scope:C,children:S}=f,R=l(c,C),E=P(p,R.collectionRef);return _.jsx(u,{ref:E,children:S})});a.displayName=c;const x=e+"CollectionItemSlot",d="data-radix-collection-item",m=g(x),v=I.forwardRef((f,p)=>{const{scope:C,children:S,...R}=f,E=I.useRef(null),M=P(p,E),h=l(x,C);return I.useEffect(()=>(h.itemMap.set(E,{ref:E,...R}),()=>void h.itemMap.delete(E))),_.jsx(m,{[d]:"",ref:M,children:S})});v.displayName=x;function y(f){const p=l(e+"CollectionConsumer",f);return I.useCallback(()=>{const S=p.collectionRef.current;if(!S)return[];const R=Array.from(S.querySelectorAll(`[${d}]`));return Array.from(p.itemMap.values()).sort((h,N)=>R.indexOf(h.ref.current)-R.indexOf(N.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:i,Slot:a,ItemSlot:v},y,r]}function q(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}export{H as C,F as c,q as u};
//# sourceMappingURL=index-BbWn2ja9.js.map
