import{r as i,j as u,b as g}from"./vendor-react-BUCujlKS.js";import{c as m}from"./vendor-radix-ui-react-compose-refs-DcAh5WdT.js";function W(e){const r=C(e),t=i.forwardRef((o,n)=>{const{children:l,...a}=o,s=i.Children.toArray(l),c=s.find(R);if(c){const f=c.props.children,y=s.map(p=>p===c?i.Children.count(f)>1?i.Children.only(null):i.isValidElement(f)?f.props.children:null:p);return u.jsx(r,{...a,ref:n,children:i.isValidElement(f)?i.cloneElement(f,void 0,y):null})}return u.jsx(r,{...a,ref:n,children:l})});return t.displayName=`${e}.Slot`,t}function C(e){const r=i.forwardRef((t,o)=>{const{children:n,...l}=t;if(i.isValidElement(n)){const a=b(n),s=h(l,n.props);return n.type!==i.Fragment&&(s.ref=o?m(o,a):a),i.cloneElement(n,s)}return i.Children.count(n)>1?i.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var S=Symbol("radix.slottable");function R(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S}function h(e,r){const t={...r};for(const o in r){const n=e[o],l=r[o];/^on[A-Z]/.test(o)?n&&l?t[o]=(...s)=>{const c=l(...s);return n(...s),c}:n&&(t[o]=n):o==="style"?t[o]={...n,...l}:o==="className"&&(t[o]=[n,l].filter(Boolean).join(" "))}return{...e,...t}}function b(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var _=Symbol.for("react.lazy"),d=g[" use ".trim().toString()];function j(e){return typeof e=="object"&&e!==null&&"then"in e}function E(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===_&&"_payload"in e&&j(e._payload)}function N(e){const r=x(e),t=i.forwardRef((o,n)=>{let{children:l,...a}=o;E(l)&&typeof d=="function"&&(l=d(l._payload));const s=i.Children.toArray(l),c=s.find(P);if(c){const f=c.props.children,y=s.map(p=>p===c?i.Children.count(f)>1?i.Children.only(null):i.isValidElement(f)?f.props.children:null:p);return u.jsx(r,{...a,ref:n,children:i.isValidElement(f)?i.cloneElement(f,void 0,y):null})}return u.jsx(r,{...a,ref:n,children:l})});return t.displayName=`${e}.Slot`,t}function x(e){const r=i.forwardRef((t,o)=>{let{children:n,...l}=t;if(E(n)&&typeof d=="function"&&(n=d(n._payload)),i.isValidElement(n)){const a=A(n),s=V(l,n.props);return n.type!==i.Fragment&&(s.ref=o?m(o,a):a),i.cloneElement(n,s)}return i.Children.count(n)>1?i.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var $=Symbol("radix.slottable");function P(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$}function V(e,r){const t={...r};for(const o in r){const n=e[o],l=r[o];/^on[A-Z]/.test(o)?n&&l?t[o]=(...s)=>{const c=l(...s);return n(...s),c}:n&&(t[o]=n):o==="style"?t[o]={...n,...l}:o==="className"&&(t[o]=[n,l].filter(Boolean).join(" "))}return{...e,...t}}function A(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}export{N as a,W as c};
