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