/*! For license information please see 91102.c0bcef1ef4974ace.js.LICENSE.txt */
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[91102],{91102:(e,t,i)=>{i.r(t),i.d(t,{ion_tab:()=>n,ion_tabs:()=>r});var s=i(10467),a=i(96317),o=i(33345);const n=class{constructor(e){(0,a.r)(this,e),this.loaded=!1,this.active=!1,this.delegate=void 0,this.tab=void 0,this.component=void 0}componentWillLoad(){var e=this;return(0,s.A)((function*(){e.active&&(yield e.setActive())}))()}setActive(){var e=this;return(0,s.A)((function*(){yield e.prepareLazyLoaded(),e.active=!0}))()}changeActive(e){e&&this.prepareLazyLoaded()}prepareLazyLoaded(){if(!this.loaded&&null!=this.component){this.loaded=!0;try{return(0,o.a)(this.delegate,this.el,this.component,["ion-page"])}catch(e){console.error(e)}}return Promise.resolve(void 0)}render(){const{tab:e,active:t,component:i}=this;return(0,a.h)(a.e,{key:"2107ece2f1ebdf748bac8adb78a9ad67e7fc9057",role:"tabpanel","aria-hidden":t?null:"true","aria-labelledby":`tab-button-${e}`,class:{"ion-page":void 0===i,"tab-hidden":!t}},(0,a.h)("slot",{key:"b4a1bc1aa79f6b82b8f77b544bcb74e65229b541"}))}get el(){return(0,a.f)(this)}static get watchers(){return{active:["changeActive"]}}};n.style=":host(.tab-hidden){display:none !important}";const r=class{constructor(e){(0,a.r)(this,e),this.ionNavWillLoad=(0,a.c)(this,"ionNavWillLoad",7),this.ionTabsWillChange=(0,a.c)(this,"ionTabsWillChange",3),this.ionTabsDidChange=(0,a.c)(this,"ionTabsDidChange",3),this.transitioning=!1,this.onTabClicked=e=>{const{href:t,tab:i}=e.detail;if(this.useRouter&&void 0!==t){const e=document.querySelector("ion-router");e&&e.push(t)}else this.select(i)},this.selectedTab=void 0,this.useRouter=!1}componentWillLoad(){var e=this;return(0,s.A)((function*(){if(e.useRouter||(e.useRouter=!(!e.el.querySelector("ion-router-outlet")&&!document.querySelector("ion-router")||e.el.closest("[no-router]"))),!e.useRouter){const t=e.tabs;t.length>0&&(yield e.select(t[0]))}e.ionNavWillLoad.emit()}))()}componentWillRender(){const e=this.el.querySelector("ion-tab-bar");if(e){e.selectedTab=this.selectedTab?this.selectedTab.tab:void 0}}select(e){var t=this;return(0,s.A)((function*(){const i=getTab(t.tabs,e);return!!t.shouldSwitch(i)&&(yield t.setActive(i),yield t.notifyRouter(),t.tabSwitch(),!0)}))()}getTab(e){var t=this;return(0,s.A)((function*(){return getTab(t.tabs,e)}))()}getSelected(){return Promise.resolve(this.selectedTab?this.selectedTab.tab:void 0)}setRouteId(e){var t=this;return(0,s.A)((function*(){const i=getTab(t.tabs,e);return t.shouldSwitch(i)?(yield t.setActive(i),{changed:!0,element:t.selectedTab,markVisible:()=>t.tabSwitch()}):{changed:!1,element:t.selectedTab}}))()}getRouteId(){var e=this;return(0,s.A)((function*(){var t;const i=null===(t=e.selectedTab)||void 0===t?void 0:t.tab;return void 0!==i?{id:i,element:e.selectedTab}:void 0}))()}setActive(e){return this.transitioning?Promise.reject("transitioning already happening"):(this.transitioning=!0,this.leavingTab=this.selectedTab,this.selectedTab=e,this.ionTabsWillChange.emit({tab:e.tab}),e.active=!0,Promise.resolve())}tabSwitch(){const e=this.selectedTab,t=this.leavingTab;this.leavingTab=void 0,this.transitioning=!1,e&&t!==e&&(t&&(t.active=!1),this.ionTabsDidChange.emit({tab:e.tab}))}notifyRouter(){if(this.useRouter){const e=document.querySelector("ion-router");if(e)return e.navChanged("forward")}return Promise.resolve(!1)}shouldSwitch(e){return void 0!==e&&e!==this.selectedTab&&!this.transitioning}get tabs(){return Array.from(this.el.querySelectorAll("ion-tab"))}render(){return(0,a.h)(a.e,{key:"d357c4607cfc89fb88404fe12ea7ef5b397fe6bf",onIonTabButtonClick:this.onTabClicked},(0,a.h)("slot",{key:"18661896589a4ab3c74164f448b928abec9b4db0",name:"top"}),(0,a.h)("div",{key:"3bf30ea2540a196e868a78a861824b4b5d933afd",class:"tabs-inner"},(0,a.h)("slot",{key:"7cfc154d4d6c1642188ab6508a6be72c8234585e"})),(0,a.h)("slot",{key:"8057679c959195cbdfae156b8ae0cbfd978c5037",name:"bottom"}))}get el(){return(0,a.f)(this)}},getTab=(e,t)=>{const i="string"==typeof t?e.find((e=>e.tab===t)):t;return i||console.error(`tab with id: "${i}" does not exist`),i};r.style=":host{left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:100%;height:100%;contain:layout size style;z-index:0}.tabs-inner{position:relative;-ms-flex:1;flex:1;contain:layout size style}"}}]);