1import{a as f}from"./chunk-YVI2JMEM.js";import"./chunk-BKH6YGYZ.js";import{f as c,i as d,m as a,n as h,q as b,r}from"./chunk-5KZ656EV.js";import{k as s}from"./chunk-24IZEI4V.js";var g=":host(.tab-hidden){display:none !important}",w=(()=>{let t=class{constructor(e){d(this,e),this.loaded=!1,this.active=!1}componentWillLoad(){return s(this,null,function*(){this.active&&(yield this.setActive())})}setActive(){return s(this,null,function*(){yield this.prepareLazyLoaded(),this.active=!0})}changeActive(e){e&&this.prepareLazyLoaded()}prepareLazyLoaded(){if(!this.loaded&&this.component!=null){this.loaded=!0;try{return f(this.delegate,this.el,this.component,["ion-page"])}catch(e){c("[ion-tab] - Exception in prepareLazyLoaded:",e)}}return Promise.resolve(void 0)}render(){let{tab:e,active:i,component:n}=this;return a(h,{key:"dbad8fe9f1566277d14647626308eaf1601ab01f",role:"tabpanel","aria-hidden":i?null:"true","aria-labelledby":`tab-button-${e}`,class:{"ion-page":n===void 0,"tab-hidden":!i}},a("slot",{key:"3be64f4e7161f6769aaf8e4dcb5293fcaa09af45"}))}get el(){return b(this)}static get watchers(){return{active:["changeActive"]}}};return t.style=g,t})(),y=":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}",m=class{constructor(t){d(this,t),this.ionNavWillLoad=r(this,"ionNavWillLoad",7),this.ionTabsWillChange=r(this,"ionTabsWillChange",3),this.ionTabsDidChange=r(this,"ionTabsDidChange",3),this.transitioning=!1,this.useRouter=!1,this.onTabClicked=e=>{let{href:i,tab:n}=e.detail;if(this.useRouter&&i!==void 0){let o=document.querySelector("ion-router");o&&o.push(i)}else this.select(n)}}componentWillLoad(){return s(this,null,function*(){if(this.useRouter||(this.useRouter=(!!this.el.querySelector("ion-router-outlet")||!!document.querySelector("ion-router"))&&!this.el.closest("[no-router]")),!this.useRouter){let t=this.tabs;t.length>0&&(yield this.select(t[0]))}this.ionNavWillLoad.emit()})}componentWillRender(){let t=this.el.querySelector("ion-tab-bar");if(t){let e=this.selectedTab?this.selectedTab.tab:void 0;if(!e&&this.useRouter&&typeof window<"u"){let i=window.location.pathname,n=this.el.querySelectorAll("ion-tab-button");for(let o of n){let l=o.getAttribute("tab");if(l&&i.includes(l)){e=l;break}}}t.selectedTab=e}}select(t){return s(this,null,function*(){let e=u(this.tabs,t);return this.shouldSwitch(e)?(yield this.setActive(e),yield this.notifyRouter(),this.tabSwitch(),!0):!1})}getTab(t){return s(this,null,function*(){return u(this.tabs,t)})}getSelected(){return Promise.resolve(this.selectedTab?this.selectedTab.tab:void 0)}setRouteId(t){return s(this,null,function*(){let e=u(this.tabs,t);return this.shouldSwitch(e)?(yield this.setActive(e),{changed:!0,element:this.selectedTab,markVisible:()=>this.tabSwitch()}):{changed:!1,element:this.selectedTab}})}getRouteId(){return s(this,null,function*(){var t;let e=(t=this.selectedTab)===null||t===void 0?void 0:t.tab;return e!==void 0?{id:e,element:this.selectedTab}:void 0})}setActive(t){return this.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(){let t=this.selectedTab,e=this.leavingTab;this.leavingTab=void 0,this.transitioning=!1,t&&e!==t&&(e&&(e.active=!1),this.ionTabsDidChange.emit({tab:t.tab}))}notifyRouter(){if(this.useRouter){let t=document.querySelector("ion-router");if(t)return t.navChanged("forward")}return Promise.resolve(!1)}shouldSwitch(t){let e=this.selectedTab;return t!==void 0&&t!==e&&!this.transitioning}get tabs(){return Array.from(this.el.querySelectorAll("ion-tab"))}render(){return a(h,{key:"6dd1d17cc5a7aff4b910303006b4478080ca97af",onIonTabButtonClick:this.onTabClicked},a("slot",{key:"db54a692d1a825498a116f090eb305f7cceceb5a",name:"top"}),a("div",{key:"e1b7d49ba7032e9071de2029695254e2a8303be9",class:"tabs-inner"},a("slot",{key:"4c3b58d5292c8c834e7532c51de0861068943d79"})),a("slot",{key:"dd59c0b9b217dfbfb0fccdbc6896b593278549cc",name:"bottom"}))}get el(){return b(this)}},u=(t,e)=>{let i=typeof e=="string"?t.find(n=>n.tab===e):e;return i||c(`[ion-tabs] - Tab with id: "${i}" does not exist`),i};m.style=y;export{w as ion_tab,m as ion_tabs};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.