import{w as i}from"./p-fb454e97.js";const a="ionViewWillLeave",e="ionViewDidLeave",n="ionViewWillUnload",o=a=>new Promise((e,n)=>{i(()=>{s(a),t(a).then(i=>{i.animation&&i.animation.destroy(),r(a),e(i)},i=>{r(a),n(i)})})}),s=i=>{const a=i.enteringEl,e=i.leavingEl;g(a,e,i.direction),i.showGoBack?a.classList.add("can-go-back"):a.classList.remove("can-go-back"),y(a,!1),e&&y(e,!1)},t=async i=>{const a=await c(i);return a?l(a,i):w(i)},r=i=>{const a=i.leavingEl;i.enteringEl.classList.remove("ion-page-invisible"),void 0!==a&&a.classList.remove("ion-page-invisible")},c=async i=>{if(i.leavingEl&&i.animated&&0!==i.duration)return i.animationBuilder?i.animationBuilder:"ios"===i.mode?(await __sc_import_resourceville("./p-54d01ebf.js")).iosTransitionAnimation:(await __sc_import_resourceville("./p-1368b180.js")).mdTransitionAnimation},l=async(i,a)=>{let e;await d(a,!0);try{const n=await __sc_import_resourceville("./p-252f5dc8.js");e=await n.create(i,a.baseEl,a)}catch(o){e=i(a.baseEl,a)}v(a.enteringEl,a.leavingEl);const n=await u(e,a);return a.progressCallback&&a.progressCallback(void 0),n&&b(a.enteringEl,a.leavingEl),{hasCompleted:n,animation:e}},w=async i=>{const a=i.enteringEl,e=i.leavingEl;return await d(i,!1),v(a,e),b(a,e),{hasCompleted:!0}},d=async(i,a)=>{const e=(void 0!==i.deepWait?i.deepWait:a)?[f(i.enteringEl),f(i.leavingEl)]:[_(i.enteringEl),_(i.leavingEl)];await Promise.all(e),await p(i.viewIsReady,i.enteringEl)},p=async(i,a)=>{i&&await i(a)},u=(i,a)=>{const e=a.progressCallback,n=new Promise(a=>{i.onFinish(e=>{"number"==typeof e?a(1===e):void 0!==i.hasCompleted&&a(i.hasCompleted)})});return e?(i.progressStart(!0),e(i)):i.play(),n},v=(i,a)=>{m(a,"ionViewWillLeave"),m(i,"ionViewWillEnter")},b=(i,a)=>{m(i,"ionViewDidEnter"),m(a,"ionViewDidLeave")},m=(i,a)=>{if(i){const e=new CustomEvent(a,{bubbles:!1,cancelable:!1});i.dispatchEvent(e)}},_=i=>i&&i.componentOnReady?i.componentOnReady():Promise.resolve(),f=async i=>{const a=i;if(a){if(null!=a.componentOnReady&&null!=await a.componentOnReady())return;await Promise.all(Array.from(a.children).map(f))}},y=(i,a)=>{a?(i.setAttribute("aria-hidden","true"),i.classList.add("ion-page-hidden")):(i.hidden=!1,i.removeAttribute("aria-hidden"),i.classList.remove("ion-page-hidden"))},g=(i,a,e)=>{void 0!==i&&(i.style.zIndex="back"===e?"99":"101"),void 0!==a&&(a.style.zIndex="100")},h=i=>{if(i.classList.contains("ion-page"))return i;return i.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||i};export{n as L,a,e as b,f as d,h as g,m as l,y as s,o as t}