"use strict";const y=require("react"),E=require("react-dom"),S=require("./index-_XxjJPRD.js"),p=require("react/jsx-runtime"),g=require("./index-kcwFA4Dv.js");function m(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=m(y),h=m(E);function v(e){const t=C(e),n=i.forwardRef((o,r)=>{const{children:s,...c}=o,l=i.Children.toArray(s),u=l.find(b);if(u){const d=u.props.children,f=l.map(a=>a===u?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:a);return p.jsx(t,{...c,ref:r,children:i.isValidElement(d)?i.cloneElement(d,void 0,f):null})}return p.jsx(t,{...c,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function C(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const c=w(r),l=P(s,r.props);return r.type!==i.Fragment&&(l.ref=o?S.composeRefs(o,c):c),i.cloneElement(r,l)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var R=Symbol("radix.slottable");function b(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===R}function P(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...l)=>{const u=s(...l);return r(...l),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function w(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var O=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],j=O.reduce((e,t)=>{const n=v(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:c,...l}=r,u=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...l,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function D(e,t){e&&h.flushSync(()=>e.dispatchEvent(t))}function _(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var N=i[" useInsertionEffect ".trim().toString()]||g.useLayoutEffect2;function $({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,c]=x({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:r;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const a=f.current;a!==l&&console.warn(`${o} is changing from ${a?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=l},[l,o])}const d=i.useCallback(f=>{if(l){const a=I(f)?f(e):f;a!==e&&c.current?.(a)}else s(f)},[l,e,s,c]);return[u,d]}function x({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),s=i.useRef(t);return N(()=>{s.current=t},[t]),i.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}function I(e){return typeof e=="function"}exports.Primitive=j;exports.composeEventHandlers=_;exports.createSlot=v;exports.dispatchDiscreteCustomEvent=D;exports.useControllableState=$;
//# sourceMappingURL=index-DlMXYAr3.js.map
