import{d as R,i as E,e as w,l as q,p as P,f as r,h as s,g as K,j as Q,k as M,r as u,m as O,n as z,o as m,w as I,q as N,s as U,t as V,u as A,v as D,x as _,y as $}from"./index.3860cfb7.js";import{Q as G}from"./QScrollObserver.bee97f98.js";import{Q as L}from"./QResizeObserver.5bcf8d41.js";import{_ as J}from"./plugin-vue_export-helper.21dcd24c.js";var X=R({name:"QPageContainer",setup(t,{slots:v}){const{proxy:{$q:a}}=Q(),n=E(q,w);if(n===w)return console.error("QPageContainer needs to be child of QLayout"),w;P(M,!0);const d=r(()=>{const i={};return n.header.space===!0&&(i.paddingTop=`${n.header.size}px`),n.right.space===!0&&(i[`padding${a.lang.rtl===!0?"Left":"Right"}`]=`${n.right.size}px`),n.footer.space===!0&&(i.paddingBottom=`${n.footer.size}px`),n.left.space===!0&&(i[`padding${a.lang.rtl===!0?"Right":"Left"}`]=`${n.left.size}px`),i});return()=>s("div",{class:"q-page-container",style:d.value},K(v.default))}}),Y=R({name:"QLayout",props:{container:Boolean,view:{type:String,default:"hhh lpr fff",validator:t=>/^(h|l)h(h|r) lpr (f|l)f(f|r)$/.test(t.toLowerCase())},onScroll:Function,onScrollHeight:Function,onResize:Function},setup(t,{slots:v,emit:a}){const{proxy:{$q:n}}=Q(),d=u(null),i=u(n.screen.height),y=u(t.container===!0?0:n.screen.width),S=u({position:0,direction:"down",inflectionPoint:0}),h=u(0),l=u(O.value===!0?0:z()),H=r(()=>"q-layout q-layout--"+(t.container===!0?"containerized":"standard")),T=r(()=>t.container===!1?{minHeight:n.screen.height+"px"}:null),F=r(()=>l.value!==0?{[n.lang.rtl===!0?"left":"right"]:`${l.value}px`}:null),W=r(()=>l.value!==0?{[n.lang.rtl===!0?"right":"left"]:0,[n.lang.rtl===!0?"left":"right"]:`-${l.value}px`,width:`calc(100% + ${l.value}px)`}:null);function B(e){if(t.container===!0||document.qScrollPrevented!==!0){const o={position:e.position.top,direction:e.direction,directionChanged:e.directionChanged,inflectionPoint:e.inflectionPoint.top,delta:e.delta.top};S.value=o,t.onScroll!==void 0&&a("scroll",o)}}function k(e){const{height:o,width:c}=e;let f=!1;i.value!==o&&(f=!0,i.value=o,t.onScrollHeight!==void 0&&a("scrollHeight",o),b()),y.value!==c&&(f=!0,y.value=c),f===!0&&t.onResize!==void 0&&a("resize",e)}function j({height:e}){h.value!==e&&(h.value=e,b())}function b(){if(t.container===!0){const e=i.value>h.value?z():0;l.value!==e&&(l.value=e)}}let g=null;const x={instances:{},view:r(()=>t.view),isContainer:r(()=>t.container),rootRef:d,height:i,containerHeight:h,scrollbarWidth:l,totalWidth:r(()=>y.value+l.value),rows:r(()=>{const e=t.view.toLowerCase().split(" ");return{top:e[0].split(""),middle:e[1].split(""),bottom:e[2].split("")}}),header:m({size:0,offset:0,space:!1}),right:m({size:300,offset:0,space:!1}),footer:m({size:0,offset:0,space:!1}),left:m({size:300,offset:0,space:!1}),scroll:S,animate(){g!==null?clearTimeout(g):document.body.classList.add("q-body--layout-animate"),g=setTimeout(()=>{g=null,document.body.classList.remove("q-body--layout-animate")},155)},update(e,o,c){x[e][o]=c}};if(P(q,x),z()>0){let c=function(){e=null,o.classList.remove("hide-scrollbar")},f=function(){if(e===null){if(o.scrollHeight>n.screen.height)return;o.classList.add("hide-scrollbar")}else clearTimeout(e);e=setTimeout(c,300)},p=function(C){e!==null&&C==="remove"&&(clearTimeout(e),c()),window[`${C}EventListener`]("resize",f)},e=null;const o=document.body;I(()=>t.container!==!0?"add":"remove",p),t.container!==!0&&p("add"),N(()=>{p("remove")})}return()=>{const e=U(v.default,[s(G,{onScroll:B}),s(L,{onResize:k})]),o=s("div",{class:H.value,style:T.value,ref:t.container===!0?void 0:d,tabindex:-1},e);return t.container===!0?s("div",{class:"q-layout-container overflow-hidden",ref:d},[s(L,{onResize:j}),s("div",{class:"absolute-full",style:F.value},[s("div",{class:"scroll",style:W.value},[o])])]):o}}});const Z={};function ee(t,v){const a=V("router-view");return A(),D(Y,{view:"lHh Lpr lFf"},{default:_(()=>[$(X,null,{default:_(()=>[$(a)]),_:1})]),_:1})}var le=J(Z,[["render",ee]]);export{le as default};
