import{s as d}from"./chunk-LvLJmgfZ.js";import{t as m}from"./react-Bj1aDYRI.js";var e=d(m(),1),f={prefix:String(Math.round(Math.random()*1e10)),current:0},l=e.createContext(f),p=e.createContext(!1);typeof window<"u"&&window.document&&window.document.createElement;var c=new WeakMap;function x(t=!1){var u,i;let r=(0,e.useContext)(l),n=(0,e.useRef)(null);if(n.current===null&&!t){let a=(i=(u=e.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:u.ReactCurrentOwner)==null?void 0:i.current;if(a){let o=c.get(a);o==null?c.set(a,{id:r.current,state:a.memoizedState}):a.memoizedState!==o.state&&(r.current=o.id,c.delete(a))}n.current=++r.current}return n.current}function S(t){let r=(0,e.useContext)(l),n=x(!!t),u=`react-aria${r.prefix}`;return t||`${u}-${n}`}function _(t){let r=e.useId(),[n]=(0,e.useState)(s()),u=n?"react-aria":`react-aria${f.prefix}`;return t||`${u}-${r}`}var E=typeof e.useId=="function"?_:S;function w(){return!1}function C(){return!0}function R(t){return()=>{}}function s(){return typeof e.useSyncExternalStore=="function"?e.useSyncExternalStore(R,w,C):(0,e.useContext)(p)}export{E as n,s as t};
