import{r as e}from"./react-DAXU6W__.js";function n(e,n){return"function"==typeof e?e(n):e&&(e.current=n),e}var t="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,r=new WeakMap;function a(a,u){var c,f,o,l=(c=null,f=function(e){return a.forEach(function(t){return n(t,e)})},(o=e.useState(function(){return{value:c,callback:f,facade:{get current(){return o.value},set current(e){var n=o.value;n!==e&&(o.value=e,o.callback(e,n))}}}})[0]).callback=f,o.facade);return t(function(){var e=r.get(l);if(e){var t=new Set(e),u=new Set(a),c=l.current;t.forEach(function(e){u.has(e)||n(e,null)}),u.forEach(function(e){t.has(e)||n(e,c)})}r.set(l,a)},[a]),l}export{a as u};
