"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("@antsoo-lib/icons"),w=require("../_util/classNames.js"),A=require("../_util/hooks/useDestroyed.js"),i=require("../_util/props-util/index.js"),O=require("../_util/transButton.js"),l=require("../_util/type.js"),S=require("../_util/vue-types/index.js");require("../avatar/index.js");require("../breadcrumb/index.js");const D=require("../config-provider/hooks/useConfigInject.js"),E=require("../locale/LocaleReceiver.js"),F=require("../space/index.js"),M=require("../vc-resize-observer/index.js"),z=require("./style/index.js"),L=require("../breadcrumb/Breadcrumb.js"),_=require("../avatar/Avatar.js"),m=()=>({backIcon:l.vNodeType(),prefixCls:String,title:l.vNodeType(),subTitle:l.vNodeType(),breadcrumb:S.default.object,tags:l.vNodeType(),footer:l.vNodeType(),extra:l.vNodeType(),avatar:l.objectType(),ghost:{type:Boolean,default:void 0},onBack:Function}),G=e.defineComponent({compatConfig:{MODE:3},name:"APageHeader",inheritAttrs:!1,props:m(),slots:Object,setup(a,{emit:V,slots:r,attrs:f}){const{prefixCls:n,direction:v,pageHeader:$}=D.default("page-header",a),[q,y]=z.default(n),b=e.shallowRef(!1),x=A.default(),T=({width:t})=>{x.value||(b.value=t<768)},k=e.computed(()=>a.ghost??$?.value?.ghost??!0),p=()=>a.backIcon??r.backIcon?.()??(v.value==="rtl"?e.createVNode(h.ArrowRightOutlined,null,null):e.createVNode(h.ArrowLeftOutlined,null,null)),C=t=>!t||!a.onBack?null:e.createVNode(E.default,{componentName:"PageHeader",children:({back:o})=>e.createVNode("div",{class:`${n.value}-back`},[e.createVNode(O.default,{onClick:c=>{V("back",c)},class:`${n.value}-back-button`,"aria-label":o},{default:()=>[t]})])},null),B=()=>a.breadcrumb?e.createVNode(L.default,a.breadcrumb,null):r.breadcrumb?.(),I=()=>{const{avatar:t}=a,o=a.title??r.title?.(),c=a.subTitle??r.subTitle?.(),d=a.tags??r.tags?.(),s=a.extra??r.extra?.(),u=`${n.value}-heading`,g=o||c||d||s;if(!g)return null;const R=p(),N=C(R),j=N||t||g;return e.createVNode("div",{class:u},[j&&e.createVNode("div",{class:`${u}-left`},[N,t?e.createVNode(_.default,t,null):r.avatar?.(),o&&e.createVNode("span",{class:`${u}-title`,title:typeof o=="string"?o:void 0},[o]),c&&e.createVNode("span",{class:`${u}-sub-title`,title:typeof c=="string"?c:void 0},[c]),d&&e.createVNode("span",{class:`${u}-tags`},[d])]),s&&e.createVNode("span",{class:`${u}-extra`},[e.createVNode(F.default,null,{default:()=>[s]})])])},H=()=>{const t=a.footer??i.filterEmpty(r.footer?.());return i.isEmptyContent(t)?null:e.createVNode("div",{class:`${n.value}-footer`},[t])},P=t=>e.createVNode("div",{class:`${n.value}-content`},[t]);return()=>{const t=a.breadcrumb?.routes||r.breadcrumb,o=a.footer||r.footer,c=i.flattenChildren(r.default?.()),d=w.default(n.value,{"has-breadcrumb":t,"has-footer":o,[`${n.value}-ghost`]:k.value,[`${n.value}-rtl`]:v.value==="rtl",[`${n.value}-compact`]:b.value},f.class,y.value);return q(e.createVNode(M.default,{onResize:T},{default:()=>[e.createVNode("div",{...f,class:d},[B(),I(),c.length?P(c):null,H()])]}))}}}),J=l.withInstall(G);exports.default=J;exports.pageHeaderProps=m;
