import{C as k,D as R,F as O,G as C,I as H,J as L,K as b,L as Y,M as W,N as $,O as T,c as g,s as D,a as j,f as y,P as q,Q as B,R as F,S as G,T as J,V as K,W as Q,e as z,w as U,h as E,y as X,i as Z}from"./runtime.CszH60Yz.js";import{b as x}from"./disclose-version.CW1F8DPW.js";const rr=["touchstart","touchmove"];function er(r){return rr.includes(r)}const tr=new Set,A=new Set;function m(r){var N;var e=this,s=e.ownerDocument,c=r.type,o=((N=r.composedPath)==null?void 0:N.call(r))||[],t=o[0]||r.target,u=0,_=r.__root;if(_){var d=o.indexOf(_);if(d!==-1&&(e===document||e===window)){r.__root=e;return}var h=o.indexOf(e);if(h===-1)return;d<=h&&(u=d)}if(t=o[u]||r.target,t!==e){k(r,"currentTarget",{configurable:!0,get(){return t||s}});var w=H,i=L;R(null),O(null);try{for(var a,n=[];t!==null;){var f=t.assignedSlot||t.parentNode||t.host||null;try{var l=t["__"+c];if(l!==void 0&&!t.disabled)if(C(l)){var[M,...P]=l;M.apply(t,[r,...P])}else l.call(t,r)}catch(p){a?n.push(p):a=p}if(r.cancelBubble||f===e||f===null)break;t=f}if(a){for(let p of n)queueMicrotask(()=>{throw p});throw a}}finally{r.__root=e,delete r.currentTarget,R(w),O(i)}}}let I=!0;function ir(r,e){var s=e==null?"":typeof e=="object"?e+"":e;s!==(r.__t??(r.__t=r.nodeValue))&&(r.__t=s,r.nodeValue=s==null?"":s+"")}function ar(r,e){return V(r,e)}function or(r,e){b(),e.intro=e.intro??!1;const s=e.target,c=E,o=y;try{for(var t=Y(s);t&&(t.nodeType!==8||t.data!==W);)t=$(t);if(!t)throw T;g(!0),D(t),j();const u=V(r,{...e,anchor:t});if(y===null||y.nodeType!==8||y.data!==q)throw B(),T;return g(!1),u}catch(u){if(u===T)return e.recover===!1&&F(),b(),G(s),g(!1),ar(r,e);throw u}finally{g(c),D(o)}}const v=new Map;function V(r,{target:e,anchor:s,props:c={},events:o,context:t,intro:u=!0}){b();var _=new Set,d=i=>{for(var a=0;a<i.length;a++){var n=i[a];if(!_.has(n)){_.add(n);var f=er(n);e.addEventListener(n,m,{passive:f});var l=v.get(n);l===void 0?(document.addEventListener(n,m,{passive:f}),v.set(n,1)):v.set(n,l+1)}}};d(J(tr)),A.add(d);var h=void 0,w=K(()=>{var i=s??e.appendChild(Q());return z(()=>{if(t){U({});var a=Z;a.c=t}o&&(c.$$events=o),E&&x(i,null),I=u,h=r(i,c)||{},I=!0,E&&(L.nodes_end=y),t&&X()}),()=>{var f;for(var a of _){e.removeEventListener(a,m);var n=v.get(a);--n===0?(document.removeEventListener(a,m),v.delete(a)):v.set(a,n)}A.delete(d),i!==s&&((f=i.parentNode)==null||f.removeChild(i))}});return S.set(h,w),h}let S=new WeakMap;function ur(r,e){const s=S.get(r);return s?(S.delete(r),s(e)):Promise.resolve()}export{I as a,or as h,ar as m,ir as s,ur as u};
