import{a6 as w,al as O,bn as T,bU as x,O as E,g as Y,S as k}from"./W1VwgJDT.mjs";function n(r,a){return r===a||(r==null?void 0:r[k])===a}function D(r={},a,i,A){var p=w.r,S=E;return O(()=>{var f,t;return T(()=>{f=t,t=[],x(()=>{n(i(...t),r)||(a(r,...t),f&&n(i(...f),r)&&a(null,...f))})}),()=>{let s=S;for(;s!==p&&s.parent!==null&&s.parent.f&Y;)s=s.parent;const h=()=>{t&&n(i(...t),r)&&a(null,...t)},c=s.teardown;s.teardown=()=>{h(),c==null||c()}}}),r}export{D as b};
