import{r as t,f as i,h as s,d as e}from"./p-23450e8b.js";import{g as n}from"./p-8e599a9d.js";import{a,d as h}from"./p-387cea7f.js";import{s as o,p as r}from"./p-8538de1a.js";import{t as l}from"./p-64f725e8.js";import{g as d,c}from"./p-1e77b5bd.js";const u=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}";const f=class{constructor(s){t(this,s);this.ionNavWillLoad=i(this,"ionNavWillLoad",7);this.ionNavWillChange=i(this,"ionNavWillChange",3);this.ionNavDidChange=i(this,"ionNavDidChange",3);this.gestureOrAnimationInProgress=false;this.mode=d(this);this.delegate=undefined;this.animated=true;this.animation=undefined;this.swipeHandler=undefined}swipeHandlerChanged(){if(this.gesture){this.gesture.enable(this.swipeHandler!==undefined)}}async connectedCallback(){const t=()=>{this.gestureOrAnimationInProgress=true;if(this.swipeHandler){this.swipeHandler.onStart()}};this.gesture=(await import("./p-23d8b367.js")).createSwipeBackGesture(this.el,(()=>!this.gestureOrAnimationInProgress&&!!this.swipeHandler&&this.swipeHandler.canStart()),(()=>t()),(t=>{var i;return(i=this.ani)===null||i===void 0?void 0:i.progressStep(t)}),((t,i,s)=>{if(this.ani){this.ani.onFinish((()=>{this.gestureOrAnimationInProgress=false;if(this.swipeHandler){this.swipeHandler.onEnd(t)}}),{oneTimeCallback:true});let e=t?-.001:.001;if(!t){this.ani.easing("cubic-bezier(1, 0, 0.68, 0.28)");e+=n([0,0],[1,0],[.68,.28],[1,1],i)[0]}else{e+=n([0,0],[.32,.72],[0,1],[1,1],i)[0]}this.ani.progressEnd(t?1:0,e,s)}else{this.gestureOrAnimationInProgress=false}}));this.swipeHandlerChanged()}componentWillLoad(){this.ionNavWillLoad.emit()}disconnectedCallback(){if(this.gesture){this.gesture.destroy();this.gesture=undefined}}async commit(t,i,s){const e=await this.lock();let n=false;try{n=await this.transition(t,i,s)}catch(t){console.error(t)}e();return n}async setRouteId(t,i,s,e){const n=await this.setRoot(t,i,{duration:s==="root"?0:undefined,direction:s==="back"?"back":"forward",animationBuilder:e});return{changed:n,element:this.activeEl}}async getRouteId(){const t=this.activeEl;return t?{id:t.tagName,element:t,params:this.activeParams}:undefined}async setRoot(t,i,s){if(this.activeComponent===t&&o(i,this.activeParams)){return false}const e=this.activeEl;const n=await a(this.delegate,this.el,t,["ion-page","ion-page-invisible"],i);this.activeComponent=t;this.activeEl=n;this.activeParams=i;await this.commit(n,e,s);await h(this.delegate,e);return true}async transition(t,i,s={}){if(i===t){return false}this.ionNavWillChange.emit();const{el:e,mode:n}=this;const a=this.animated&&c.getBoolean("animated",true);const h=s.animationBuilder||this.animation||c.get("navAnimation");await l(Object.assign(Object.assign({mode:n,animated:a,enteringEl:t,leavingEl:i,baseEl:e,deepWait:r(e),progressCallback:s.progressAnimation?t=>{if(t!==undefined&&!this.gestureOrAnimationInProgress){this.gestureOrAnimationInProgress=true;t.onFinish((()=>{this.gestureOrAnimationInProgress=false;if(this.swipeHandler){this.swipeHandler.onEnd(false)}}),{oneTimeCallback:true});t.progressEnd(0,0,0)}else{this.ani=t}}:undefined},s),{animationBuilder:h}));this.ionNavDidChange.emit();return true}async lock(){const t=this.waitPromise;let i;this.waitPromise=new Promise((t=>i=t));if(t!==undefined){await t}return i}render(){return s("slot",null)}get el(){return e(this)}static get watchers(){return{swipeHandler:["swipeHandlerChanged"]}}};f.style=u;export{f as ion_router_outlet};
//# sourceMappingURL=p-54d649c6.entry.js.map