import{V as S,W as T,M as Y,u as x,X as E,Y as M,Z as O}from"./CcSQ4gIZ.mjs";function n(r,f){return r===f||(r==null?void 0:r[O])===f}function B(r={},f,i,k){var p=S.r,h=E;return T(()=>{var a,t;return Y(()=>{a=t,t=[],x(()=>{r!==i(...t)&&(f(r,...t),a&&n(i(...a),r)&&f(null,...a))})}),()=>{let s=h;for(;s!==p&&s.parent!==null&&s.parent.f&M;)s=s.parent;const w=()=>{t&&n(i(...t),r)&&f(null,...t)},c=s.teardown;s.teardown=()=>{w(),c==null||c()}}}),r}export{B as b};
