import{aL as c,aJ as x,a_ as B,_ as D,aZ as T,q as H,bz as L,bF as S,bA as p,bh as q,aQ as f,ac as I,e as C,bT as G,aX as R,as as U,bG as N,U as Z,b8 as A,a1 as z}from"./W1VwgJDT.mjs";import{B as F}from"./D-j9Rl0W.mjs";const E=0,k=1,J=2;function P(v,g,_,r,n){c&&x();var b=B(),t=Z,i=b?N(t):A(t,!1,!1),l=b?N(t):A(t,!1,!1),a=new F(v);D(()=>{var h=I,u=g(),m=!1;let y=c&&T(u)===(v.data===H);if(y&&(L(S()),p(!1)),T(u)){var w=z(),d=!1;const s=e=>{if(!m){d=!0,w(!1),I===h&&h.deactivate(),C.ensure();try{e()}finally{G(!1),R||U()}}};u.then(e=>{s(()=>{f(i,e),a.ensure(k,r&&(o=>r(o,i)))})},e=>{s(()=>{if(f(l,e),a.ensure(J,n&&(o=>n(o,l))),!n)throw l.v})}),c?a.ensure(E,_):q(()=>{d||s(()=>{a.ensure(E,_)})})}else f(i,u),a.ensure(k,r&&(s=>r(s,i)));return y&&p(!0),()=>{m=!0}})}export{P as a};
