import{A as e,At as t,Q as n,T as r,U as i,a,bt as o,d as s,et as c,f as l,ft as u,ht as d,kt as f,l as p,nt as m,s as h}from"./dom-CdSnbvZ6.js";import{Q as g}from"./index-_dGt2VRU.js";import{t as _}from"./QScrollObserver-Bb3Glz7H.js";import{t as v}from"./QResizeObserver--PCYCJrv.js";var y=r({name:`QPageContainer`,setup(e,{slots:t}){let{proxy:{$q:r}}=n(),a=m(s,p);if(a===p)return console.error(`QPageContainer needs to be child of QLayout`),p;d(l,!0);let o=i(()=>{let e={};return a.header.space===!0&&(e.paddingTop=`${a.header.size}px`),a.right.space===!0&&(e[`padding${r.lang.rtl===!0?`Left`:`Right`}`]=`${a.right.size}px`),a.footer.space===!0&&(e.paddingBottom=`${a.footer.size}px`),a.left.space===!0&&(e[`padding${r.lang.rtl===!0?`Right`:`Left`}`]=`${a.left.size}px`),e});return()=>c(`div`,{class:`q-page-container`,style:o.value},h(t.default))}}),b=r({name:`QLayout`,props:{container:Boolean,view:{type:String,default:`hhh lpr fff`,validator:e=>/^(h|l)h(h|r) lpr (f|l)f(f|r)$/.test(e.toLowerCase())},onScroll:Function,onScrollHeight:Function,onResize:Function},setup(r,{slots:l,emit:p}){let{proxy:{$q:m}}=n(),h=t(null),y=t(m.screen.height),b=t(r.container===!0?0:m.screen.width),x=t({position:0,direction:`down`,inflectionPoint:0}),S=t(0),C=t(e.value===!0?0:g()),w=i(()=>`q-layout q-layout--`+(r.container===!0?`containerized`:`standard`)),T=i(()=>r.container===!1?{minHeight:m.screen.height+`px`}:null),E=i(()=>C.value===0?null:{[m.lang.rtl===!0?`left`:`right`]:`${C.value}px`}),D=i(()=>C.value===0?null:{[m.lang.rtl===!0?`right`:`left`]:0,[m.lang.rtl===!0?`left`:`right`]:`-${C.value}px`,width:`calc(100% + ${C.value}px)`});function O(e){if(r.container===!0||document.qScrollPrevented!==!0){let t={position:e.position.top,direction:e.direction,directionChanged:e.directionChanged,inflectionPoint:e.inflectionPoint.top,delta:e.delta.top};x.value=t,r.onScroll!==void 0&&p(`scroll`,t)}}function k(e){let{height:t,width:n}=e,i=!1;y.value!==t&&(i=!0,y.value=t,r.onScrollHeight!==void 0&&p(`scrollHeight`,t),j()),b.value!==n&&(i=!0,b.value=n),i===!0&&r.onResize!==void 0&&p(`resize`,e)}function A({height:e}){S.value!==e&&(S.value=e,j())}function j(){if(r.container===!0){let e=y.value>S.value?g():0;C.value!==e&&(C.value=e)}}let M=null,N={instances:{},view:i(()=>r.view),isContainer:i(()=>r.container),rootRef:h,height:y,containerHeight:S,scrollbarWidth:C,totalWidth:i(()=>b.value+C.value),rows:i(()=>{let e=r.view.toLowerCase().split(` `);return{top:e[0].split(``),middle:e[1].split(``),bottom:e[2].split(``)}}),header:f({size:0,offset:0,space:!1}),right:f({size:300,offset:0,space:!1}),footer:f({size:0,offset:0,space:!1}),left:f({size:300,offset:0,space:!1}),scroll:x,animate(){M===null?document.body.classList.add(`q-body--layout-animate`):clearTimeout(M),M=setTimeout(()=>{M=null,document.body.classList.remove(`q-body--layout-animate`)},155)},update(e,t,n){N[e][t]=n}};if(d(s,N),g()>0){let e=null,t=document.body;function n(){e=null,t.classList.remove(`hide-scrollbar`)}function i(){if(e===null){if(t.scrollHeight>m.screen.height)return;t.classList.add(`hide-scrollbar`)}else clearTimeout(e);e=setTimeout(n,300)}function a(t){e!==null&&t===`remove`&&(clearTimeout(e),n()),window[`${t}EventListener`](`resize`,i)}o(()=>r.container===!0?`remove`:`add`,a),r.container!==!0&&a(`add`),u(()=>{a(`remove`)})}return()=>{let e=a(l.default,[c(_,{onScroll:O}),c(v,{onResize:k})]),t=c(`div`,{class:w.value,style:T.value,ref:r.container===!0?void 0:h,tabindex:-1},e);return r.container===!0?c(`div`,{class:`q-layout-container overflow-hidden`,ref:h},[c(v,{onResize:A}),c(`div`,{class:`absolute-full`,style:E.value},[c(`div`,{class:`scroll`,style:D.value},[t])])]):t}}});export{y as n,b as t};