import{w as a}from"./p-2a37a33f.js";import{L as i,a as s,b as n,c as o}from"./p-5e1589de.js";const e=i=>new Promise((s,n)=>{a(()=>{t(i),r(i).then(a=>{a.animation&&a.animation.destroy(),c(i),s(a)},a=>{c(i),n(a)})})}),t=a=>{const i=a.enteringEl,s=a.leavingEl;h(i,s,a.direction),a.showGoBack?i.classList.add("can-go-back"):i.classList.remove("can-go-back"),v(i,!1),s&&v(s,!1)},r=async a=>{const i=await p(a);return i?d(i,a):w(a)},c=a=>{const i=a.leavingEl;a.enteringEl.classList.remove("ion-page-invisible"),void 0!==i&&i.classList.remove("ion-page-invisible")},p=async a=>{if(a.leavingEl&&a.animated&&0!==a.duration)return a.animationBuilder?a.animationBuilder:"ios"===a.mode?(await __sc_import_dos_wc_library("./p-327f9f57.js")).iosTransitionAnimation:(await __sc_import_dos_wc_library("./p-45e35376.js")).mdTransitionAnimation},d=async(a,i)=>{await m(i,!0);const s=a(i.baseEl,i);u(i.enteringEl,i.leavingEl);const n=await b(s,i);return i.progressCallback&&i.progressCallback(void 0),n&&_(i.enteringEl,i.leavingEl),{hasCompleted:n,animation:s}},w=async a=>{const i=a.enteringEl,s=a.leavingEl;return await m(a,!1),u(i,s),_(i,s),{hasCompleted:!0}},m=async(a,i)=>{const s=(void 0!==a.deepWait?a.deepWait:i)?[g(a.enteringEl),g(a.leavingEl)]:[y(a.enteringEl),y(a.leavingEl)];await Promise.all(s),await l(a.viewIsReady,a.enteringEl)},l=async(a,i)=>{a&&await a(i)},b=(a,i)=>{const s=i.progressCallback,n=new Promise(i=>{a.onFinish(a=>i(1===a))});return s?(a.progressStart(!0),s(a)):a.play(),n},u=(a,n)=>{f(n,i),f(a,s)},_=(a,i)=>{f(a,n),f(i,o)},f=(a,i)=>{if(a){const s=new CustomEvent(i,{bubbles:!1,cancelable:!1});a.dispatchEvent(s)}},y=a=>a&&a.componentOnReady?a.componentOnReady():Promise.resolve(),g=async a=>{const i=a;if(i){if(null!=i.componentOnReady&&null!=await i.componentOnReady())return;await Promise.all(Array.from(i.children).map(g))}},v=(a,i)=>{i?(a.setAttribute("aria-hidden","true"),a.classList.add("ion-page-hidden")):(a.hidden=!1,a.removeAttribute("aria-hidden"),a.classList.remove("ion-page-hidden"))},h=(a,i,s)=>{void 0!==a&&(a.style.zIndex="back"===s?"99":"101"),void 0!==i&&(i.style.zIndex="100")},P=a=>{if(a.classList.contains("ion-page"))return a;return a.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||a};export{g as d,P as g,f as l,v as s,e as t};