var V=Object.defineProperty,T=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var R=(e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t)=>{for(var r in t||(t={}))L.call(t,r)&&R(e,r,t[r]);if(P)for(var r of P(t))O.call(t,r)&&R(e,r,t[r]);return e},B=(e,t)=>T(e,G(t));var w=(e,t,r)=>new Promise((h,p)=>{var g=u=>{try{f(r.next(u))}catch(c){p(c)}},d=u=>{try{f(r.throw(u))}catch(c){p(c)}},f=u=>u.done?h(u.value):Promise.resolve(u.value).then(g,d);f((r=r.apply(e,t)).next())});import{d as U,f as z,a1 as F,h as K,U as I,a2 as b,a3 as E,k as j,af as M,ad as A,V as q,a5 as S,G as H,a6 as J}from"./vue-vendor-CxLCUzY4.js";import{y as D}from"./antd-vue-vendor-CDWW6V_M.js";import{C as Q,B as W,bo as X,cw as Y,cs as Z,cu as x,aU as ee,P as te,K as ne,F as ae,o as re,_ as se}from"./index-B_2CoVdl.js";import"./vxe-table-vendor-B5h3MVdD.js";const oe=U({name:"LayoutBreadcrumb",components:{Icon:re,[D.name]:D},props:{theme:ae.oneOf(["dark","light"])},setup(){const e=z([]),{currentRoute:t}=F(),{prefixCls:r}=Q("layout-breadcrumb"),{getShowBreadCrumbIcon:h}=W(),p=X(),{t:g}=ne();K(()=>w(this,null,function*(){var v,_,$;if(t.value.name===Y)return;const s=yield Z(),n=t.value.matched,a=n==null?void 0:n[n.length-1];let o=t.value.path;a&&((v=a==null?void 0:a.meta)!=null&&v.currentActiveMenu)&&(o=a.meta.currentActiveMenu);const i=x(s,o),m=s.filter(N=>N.path===i[0]),l=d(m,i);if(!l||l.length===0)return;const k=f(l);(_=t.value.meta)!=null&&_.currentActiveMenu&&k.push(B(y({},t.value),{name:(($=t.value.meta)==null?void 0:$.title)||t.value.name})),e.value=k}));function d(s,n){const a=[];return s.forEach(o=>{var i,m;n.includes(o.path)&&a.push(B(y({},o),{name:((i=o.meta)==null?void 0:i.title)||o.name})),(m=o.children)!=null&&m.length&&a.push(...d(o.children,n))}),a}function f(s){return ee(s,n=>{const{meta:a,name:o}=n;if(!a)return!!o;const{title:i,hideBreadcrumb:m}=a;return!(!i||m)}).filter(n=>{var a;return!((a=n.meta)!=null&&a.hideBreadcrumb)})}function u(s,n,a){a==null||a.preventDefault();const{children:o,redirect:i,meta:m}=s;if(o!=null&&o.length&&!i){a==null||a.stopPropagation();return}if(!(m!=null&&m.carryParam))if(i&&te(i))p(i);else{let l="";n.length===1?l=n[0]:l=`${n.slice(1).pop()||""}`,l=/^\//.test(l)?l:`/${l}`,p(l)}}function c(s,n){return s.indexOf(n)!==s.length-1}function C(s){var n;return s.icon||((n=s.meta)==null?void 0:n.icon)}return{routes:e,t:g,prefixCls:r,getIcon:C,getShowBreadCrumbIcon:h,handleClick:u,hasRedirect:c}}}),ce={key:1};function ie(e,t,r,h,p,g){const d=I("Icon"),f=I("router-link"),u=I("a-breadcrumb");return b(),E("div",{class:J([e.prefixCls,`${e.prefixCls}--${e.theme}`])},[j(u,{routes:e.routes},{itemRender:M(({route:c,routes:C,paths:s})=>[e.getShowBreadCrumbIcon&&e.getIcon(c)?(b(),A(d,{key:0,icon:e.getIcon(c)},null,8,["icon"])):q("",!0),e.hasRedirect(C,c)?(b(),A(f,{key:2,to:"",onClick:n=>e.handleClick(c,s,n),style:{color:"inherit"}},{default:M(()=>[H(S(e.t(c.name||c.meta.title)),1)]),_:2},1032,["onClick"])):(b(),E("span",ce,S(e.t(c.name||c.meta.title)),1))]),_:1},8,["routes"])],2)}const de=se(oe,[["render",ie]]);export{de as default};
