"use strict";const m=require("react"),v=require("./index-MQ0c3ZX_.js");function b(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=b(m);function g(e,n,{checkForDefaultPrevented:t=!0}={}){return function(o){if(e?.(o),t===!1||!o.defaultPrevented)return n?.(o)}}var R=c[" useInsertionEffect ".trim().toString()]||v.useLayoutEffect2;function E({prop:e,defaultProp:n,onChange:t=()=>{},caller:r}){const[o,l,i]=C({defaultProp:n,onChange:t}),u=e!==void 0,a=u?e:o;{const s=c.useRef(e!==void 0);c.useEffect(()=>{const f=s.current;f!==u&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${u?"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.`),s.current=u},[u,r])}const d=c.useCallback(s=>{if(u){const f=S(s)?s(e):s;f!==e&&i.current?.(f)}else l(s)},[u,e,l,i]);return[a,d]}function C({defaultProp:e,onChange:n}){const[t,r]=c.useState(e),o=c.useRef(t),l=c.useRef(n);return R(()=>{l.current=n},[n]),c.useEffect(()=>{o.current!==t&&(l.current?.(t),o.current=t)},[t,o]),[t,r,l]}function S(e){return typeof e=="function"}exports.composeEventHandlers=g;exports.useControllableState=E;
//# sourceMappingURL=index-Dkj4QRX8.js.map
