var me=Object.defineProperty,be=Object.defineProperties;var $e=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var te=(e,t,r)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&te(e,r,t[r]);if(ee)for(var r of ee(t))_e.call(t,r)&&te(e,r,t[r]);return e},ae=(e,t)=>be(e,$e(t));var ne=(e,t,r)=>new Promise((h,n)=>{var $=v=>{try{g(r.next(v))}catch(H){n(H)}},d=v=>{try{g(r.throw(v))}catch(H){n(H)}},g=v=>v.done?h(v.value):Promise.resolve(v.value).then($,d);g((r=r.apply(e,t)).next())});import{n as p,r as ye,aB as Ce,a as U,R as Pe,v as O,cu as Fe,f as P,W as ke,Y as we,Z,cj as Be,O as T,an as Re,cv as Te,cw as Se,b as ce,b9 as Oe,L as ue,o as j,h as G,i as K,aK as S,q as z,bn as de,J as Ae,aq as L,cx as Ie,K as fe,k as w,cy as xe,cz as Ee,H as Ne,cA as je,aN as y,aa as ze,at as re,aG as oe,j as ie,aI as We,aJ as De,z as D,aL as Le,aM as Me,F as Ve,B as qe,t as Je,aH as Ze,l as le,N as ge}from"./index.c32990f8.js";import{B as Ge}from"./index.18793a5c.js";import{A as Ke}from"./index.b82f04cc.js";import{u as Ue}from"./useWindowSizeFn.aeae38b8.js";import{a as Xe}from"./useContentViewHeight.9f7d31eb.js";import{A as Ye}from"./ArrowLeftOutlined.261ec900.js";import{T as Qe}from"./transButton.c32900a3.js";var et={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"},tt=et;function se(e){for(var t=1;t{e(),L(()=>{t=!0})}),Ie(()=>{t&&e()})}function ut(e,t,r,h,n=0,$=O(0)){const d=O(null),{footerHeightRef:g}=Xe();let v={useLayoutFooter:!0};const H=f=>{v=f};function x(){L(()=>{R()})}function F(f,k="all"){var l,a,o,u;function _(i){return Number(i.replace(/[^\d]/g,""))}let m=0;const b="0px";if(f){const i=getComputedStyle(f),s=_((l=i==null?void 0:i.marginTop)!=null?l:b),c=_((a=i==null?void 0:i.marginBottom)!=null?a:b),C=_((o=i==null?void 0:i.paddingTop)!=null?o:b),A=_((u=i==null?void 0:i.paddingBottom)!=null?u:b);k==="all"?(m+=s,m+=c,m+=C,m+=A):k==="top"?(m+=s,m+=C):(m+=c,m+=A)}return m}function B(f){return f==null?null:f instanceof HTMLDivElement?f:f.$el}function R(){return ne(this,null,function*(){var u;if(!e.value)return;yield L();const f=B(w(t));if(!f)return;const{bottomIncludeBody:k}=xe(f);let _=0;r.forEach(i=>{var s,c;_+=(c=(s=B(w(i)))==null?void 0:s.offsetHeight)!=null?c:0});let m=(u=F(f))!=null?u:0;h.forEach(i=>{m+=F(B(w(i)))});let b=0;function l(i,s){if(i&&s){const c=i.parentElement;c&&(Ne(s)?c.classList.contains(s)?b+=F(c,"bottom"):(b+=F(c,"bottom"),l(c,s)):je(s)&&s>0&&(b+=F(c,"bottom"),l(c,--s)))}}Ee(n)?l(f,w(n)):l(f,n);let a=k-w(g)-w($)-_-m-b;const o=()=>{var i;(i=v.elements)==null||i.forEach(s=>{var c,C;a+=(C=(c=B(w(s)))==null?void 0:c.offsetHeight)!=null?C:0})};v.useLayoutFooter&&w(g)>0,o(),d.value=a})}return ct(()=>{L(()=>{R()})}),Ue(()=>{R()},50,{immediate:!0}),fe(()=>[g.value],()=>{R()},{flush:"post",immediate:!0}),{redoHeight:x,setCompensation:H,contentHeight:d}}const dt=U({name:"PageWrapper",components:{PageFooter:ve,PageHeader:it},inheritAttrs:!1,props:{title:y.string,dense:y.bool,ghost:y.bool,content:y.string,contentStyle:{type:Object},contentBackground:y.bool,contentFullHeight:y.bool,contentClass:y.string,fixedHeight:y.bool,upwardSpace:y.oneOfType([y.number,y.string]).def(0)},setup(e,{slots:t,attrs:r}){const h=O(null),n=O(null),$=O(null),d=O(null),{prefixCls:g}=ce("page-wrapper");ze(vt,P(()=>e.fixedHeight));const v=P(()=>e.contentFullHeight),H=P(()=>e.upwardSpace),{redoHeight:x,setCompensation:F,contentHeight:B}=ut(v,h,[n,d],[$],H);F({useLayoutFooter:!0,elements:[d]});const R=P(()=>{var l;return[g,{[`${g}--dense`]:e.dense},(l=r.class)!=null?l:{}]}),f=P(()=>e.content||(t==null?void 0:t.headerContent)||e.title||_.value.length),k=P(()=>(t==null?void 0:t.leftFooter)||(t==null?void 0:t.rightFooter)),_=P(()=>Object.keys(re(t,"default","leftFooter","rightFooter","headerContent"))),m=P(()=>{const{contentFullHeight:l,contentStyle:a,fixedHeight:o}=e;if(!l)return W({},a);const u=`${w(B)}px`;return W(ae(W({},a),{minHeight:u}),o?{height:u}:{})}),b=P(()=>{const{contentBackground:l,contentClass:a}=e;return[`${g}-content`,a,{[`${g}-content-bg`]:l}]});return fe(()=>[k.value],()=>{x()},{flush:"post",immediate:!0}),{getContentStyle:m,wrapperRef:h,headerRef:n,contentRef:$,footerRef:d,getClass:R,getHeaderSlots:_,prefixCls:g,getShowHeader:f,getShowFooter:k,omit:re,getContentClass:b}}});function ft(e,t,r,h,n,$){const d=oe("PageHeader"),g=oe("PageFooter");return j(),G("div",{class:z(e.getClass),ref:"wrapperRef"},[e.getShowHeader?(j(),ie(d,Ze({key:0,ghost:e.ghost,title:e.title},e.omit(e.$attrs,"class"),{ref:"headerRef"}),We({default:D(()=>[e.content?(j(),G(Ve,{key:0},[qe(Je(e.content),1)],64)):S(e.$slots,"headerContent",{key:1})]),_:2},[De(e.getHeaderSlots,v=>({name:v,fn:D(H=>[S(e.$slots,v,Le(Me(H||{})))])}))]),1040,["ghost","title"])):le("",!0),K("div",{class:z(["overflow-hidden",e.getContentClass]),style:de(e.getContentStyle),ref:"contentRef"},[S(e.$slots,"default")],6),e.getShowFooter?(j(),ie(g,{key:1,ref:"footerRef"},{left:D(()=>[S(e.$slots,"leftFooter")]),right:D(()=>[S(e.$slots,"rightFooter")]),_:3},512)):le("",!0)],2)}var gt=ue(dt,[["render",ft]]);ge(ve);const Ct=ge(gt),vt="PageWrapperFixedHeight";export{Ct as P,vt as a,ct as o};