"use strict";const s=require("./mergeProps-DD8aR8go.cjs.js"),o=require("react-dom"),r=require("react");function u(e,n=!0){let[i,c]=r.useState(!0),t=i&&n;return s.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{if(t&&e.current&&"getAnimations"in e.current)for(let a of e.current.getAnimations())a instanceof CSSTransition&&a.cancel()},[e,t]),f(e,t,r.useCallback(()=>c(!1),[])),t}function $(e,n){let[i,c]=r.useState(n?"open":"closed");switch(i){case"open":n||c("exiting");break;case"closed":case"exiting":n&&c("open");break}let t=i==="exiting";return f(e,t,r.useCallback(()=>{c(a=>a==="exiting"?"closed":a)},[])),t}function f(e,n,i){s.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{if(n&&e.current){if(!("getAnimations"in e.current)){i();return}let c=e.current.getAnimations();if(c.length===0){i();return}let t=!1;return Promise.all(c.map(a=>a.finished)).then(()=>{t||o.flushSync(()=>{i()})}).catch(()=>{}),()=>{t=!0}}},[e,n,i])}exports.$d3f049242431219c$export$45fda7c47f93fd48=$;exports.$d3f049242431219c$export$6d3443f2c48bfc20=u;
//# sourceMappingURL=animation-CUKRNx9n.cjs.js.map
