import{c as g,j as u,k as o,a as c,h,d as f,g as v,p as y,Q as m,w as C,bk as r,an as Q,am as x,X as $,bl as i}from"./index-DPOJo1e5.js";const b=g({name:"QPage",props:{padding:Boolean,styleFn:Function},setup(a,{slots:t}){const{proxy:{$q:n}}=v(),e=u(y,o);if(e===o)return console.error("QPage needs to be a deep child of QLayout"),o;if(u(m,o)===o)return console.error("QPage needs to be child of QPageContainer"),o;const l=c(()=>{const s=(e.header.space===!0?e.header.size:0)+(e.footer.space===!0?e.footer.size:0);if(typeof a.styleFn=="function"){const d=e.isContainer.value===!0?e.containerHeight.value:n.screen.height;return a.styleFn(s,d)}return{minHeight:e.isContainer.value===!0?e.containerHeight.value-s+"px":n.screen.height===0?s!==0?`calc(100vh - ${s}px)`:"100vh":n.screen.height-s+"px"}}),p=c(()=>`q-page${a.padding===!0?" q-layout-padding":""}`);return()=>h("main",{class:p.value,style:l.value},f(t.default))}});function q(a){{const t={active:!0};if(typeof a=="function"){const n=c(a);t.val=n.value,C(n,e=>{t.val=e,t.active===!0&&r()})}else t.val=a;i.push(t),r(),Q(()=>{t.active=!0,r()}),x(()=>{t.active=!1,r()}),$(()=>{i.splice(i.indexOf(t),1),r()})}}export{b as Q,q as u};
