import{k as f,o as D,q as H,v as g,x as b,H as w,y as C,z as S,A as p,B as q,C as c,D as E,E as G,F as L,G as R,I as U,J as N,U as z,m as T,K as F}from"./Dpn8_Hnn.mjs";import{B as J}from"./Bg0ZbUei.mjs";const k=0,A=1,K=2;function P(v,x,_,r,n){f&&D();var m=H(),t=z,i=m?N(t):T(t,!1,!1),o=m?N(t):T(t,!1,!1),a=new J(v);g(()=>{var y=E,u=x(),h=!1;let d=f&&b(u)===(v.data===w);if(d&&(C(S()),p(!1)),b(u)){var B=F(),I=!1;const s=e=>{if(!h){I=!0,B(!1),E===y&&y.deactivate(),G.ensure();try{e()}finally{L(!1),R||U()}}};u.then(e=>{s(()=>{c(i,e),a.ensure(A,r&&(l=>r(l,i)))})},e=>{s(()=>{if(c(o,e),a.ensure(K,n&&(l=>n(l,o))),!n)throw o.v})}),f?a.ensure(k,_):q(()=>{I||s(()=>{a.ensure(k,_)})})}else c(i,u),a.ensure(A,r&&(s=>r(s,i)));return d&&p(!0),()=>{h=!0}})}export{P as a};
