import{rast,dasi,hass,Hase,caso}from"./p-38dcedc4.js";constn=class{constructor(s){t(this,s),this.ionNavWillLoad=i(this,"ionNavWillLoad",7),this.ionTabsWillChange=i(this,"ionTabsWillChange",3),this.ionTabsDidChange=i(this,"ionTabsDidChange",3),this.transitioning=!1,this.useRouter=!1,this.onTabClicked=t=>{const{href:i,tab:s}=t.detail;if(this.useRouter&&void0!==i){constt=document.querySelector("ion-router");t&&t.push(i)}elsethis.select(s)}}asynccomponentWillLoad(){if(this.useRouter||(this.useRouter=!!document.querySelector("ion-router")&&!this.el.closest("[no-router]")),!this.useRouter){constt=this.tabs;t.length>0&&awaitthis.select(t[0])}this.ionNavWillLoad.emit()}componentWillRender(){constt=this.el.querySelector("ion-tab-bar");t&&(t.selectedTab=this.selectedTab?this.selectedTab.tab:void0)}asyncselect(t){consti=h(this.tabs,t);return!!this.shouldSwitch(i)&&(awaitthis.setActive(i),awaitthis.notifyRouter(),this.tabSwitch(),!0)}asyncgetTab(t){returnh(this.tabs,t)}getSelected(){returnPromise.resolve(this.selectedTab?this.selectedTab.tab:void0)}asyncsetRouteId(t){consti=h(this.tabs,t);returnthis.shouldSwitch(i)?(awaitthis.setActive(i),{changed:!0,element:this.selectedTab,markVisible:()=>this.tabSwitch()}):{changed:!1,element:this.selectedTab}}asyncgetRouteId(){constt=this.selectedTab&&this.selectedTab.tab;returnvoid0!==t?{id:t,element:this.selectedTab}:void0}setActive(t){returnthis.transitioning?Promise.reject("transitioning already happening"):(this.transitioning=!0,this.leavingTab=this.selectedTab,this.selectedTab=t,this.ionTabsWillChange.emit({tab:t.tab}),t.active=!0,Promise.resolve())}tabSwitch(){constt=this.selectedTab,i=this.leavingTab;this.leavingTab=void0,this.transitioning=!1,t&&i!==t&&(i&&(i.active=!1),this.ionTabsDidChange.emit({tab:t.tab}))}notifyRouter(){if(this.useRouter){constt=document.querySelector("ion-router");if(t)returnt.navChanged("forward")}returnPromise.resolve(!1)}shouldSwitch(t){returnvoid0!==t&&t!==this.selectedTab&&!this.transitioning}gettabs(){returnArray.from(this.el.querySelectorAll("ion-tab"))}render(){returns(e,{onIonTabButtonClick:this.onTabClicked},s("slot",{name:"top"}),s("div",{class:"tabs-inner"},s("slot",null)),s("slot",{name:"bottom"}))}getel(){returno(this)}},h=(t,i)=>{consts="string"==typeofi?t.find((t=>t.tab===i)):i;returns||console.error(`tab with id: "${s}" does not exist`),s};n.style=":host{left:0;right:0;top:0;bottom:0;display:flex;position:absolute;flex-direction:column;width:100%;height:100%;contain:layout size style;z-index:0}.tabs-inner{position:relative;flex:1;contain:layout size style}";export{nasion_tabs}