import{a as q}from"./chunk-AG5UR6GS.js";import{c as S,d as D,j as F,p as N,q as U,s as k,t as j,w as z}from"./chunk-HKLJ6VPZ.js";import{a as G}from"./chunk-MQ46LYK7.js";import{a as A,c as K}from"./chunk-PQ5Q7HJL.js";import{$b as E,Dc as R,Eb as s,F as x,Fb as d,Hb as L,Ib as w,O as f,Qb as b,Ua as o,Y as a,ac as _,bc as C,f as P,gb as B,mb as l,sb as I,tb as c,vb as T,yc as $,z as y}from"./chunk-56X5LYJH.js";import{g}from"./chunk-TSRGIXR5.js";function Q(n,e){if(n&1&&(L(0),s(1,"a",7),_(2),d(),w()),n&2){let t=b().$implicit;o(),c("routerLink",t.url),o(),C(t.label)}}function V(n,e){if(n&1&&_(0),n&2){let t=b().$implicit;C(t.label)}}function W(n,e){if(n&1&&(s(0,"li",5),l(1,Q,3,2,"ng-container",6)(2,V,1,1,"ng-template",null,0,$),d()),n&2){let t=e.last,r=E(3);T("active",t),I("aria-current",t?"page":null),o(),c("ngIf",!t)("ngIfElse",r)}}function X(n,e){if(n&1&&(s(0,"nav",2)(1,"ol",3),l(2,W,4,5,"li",4),d()()),n&2){let t=b();o(2),c("ngForOf",t.breadcrumbs)}}var H=class n{breadcrumbs=[];router=a(k);route=a(U);translate=a(A);featureTranslate=a(G);translateConfig=a(q);destroy$=new P;cdr=a(R);currentLanguage;ngOnInit(){return g(this,null,function*(){this.currentLanguage=this.translateConfig.currentLang,yield this.featureTranslate.loadFeature("shared"),this.buildBreadcrumb(this.route.root),this.router.events.pipe(y(e=>e instanceof N),x((e,t)=>e.url===t.url),f(this.destroy$)).subscribe(()=>{this.buildBreadcrumb(this.route.root)}),this.translate.onLangChange.pipe(f(this.destroy$)).subscribe(e=>g(this,null,function*(){this.currentLanguage=e.lang,yield this.featureTranslate.loadFeature("shared"),this.buildBreadcrumb(this.route.root)}))})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}buildBreadcrumb(e,t="",r=[]){let m=e.snapshot,h=m.url.map(i=>i.path).join("/"),u=h?`${t}/${h}`:t,O=m.data.breadcrumb,v=m.data.parentBreadcrumb,p=m.data.parentUrl;if(v&&p&&!r.some(i=>i.url===p)&&r.push({label:this.translate.instant(v),url:p}),O){let i=this.translate.instant(O),M=r.findIndex(J=>J.url===u);M===-1?r.push({label:i,url:u}):r[M].label=i}e.firstChild?this.buildBreadcrumb(e.firstChild,u,r):this.breadcrumbs=r,this.cdr.detectChanges()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=B({type:n,selectors:[["app-breadcrumb"]],decls:1,vars:1,consts:[["lastCrumb",""],["aria-label","breadcrumb","class","my-30",4,"ngIf"],["aria-label","breadcrumb",1,"my-30"],[1,"breadcrumb"],["class","breadcrumb-item",3,"active",4,"ngFor","ngForOf"],[1,"breadcrumb-item"],[4,"ngIf","ngIfElse"],[1,"text-decoration-none","mx-1",3,"routerLink"]],template:function(t,r){t&1&&l(0,X,3,1,"nav",1),t&2&&c("ngIf",r.breadcrumbs.length)},dependencies:[F,S,D,z,j,K],styles:['.breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before{font-family:bootstrap-icons;font-weight:900;color:#171d23;content:"\\f285"!important;float:left!important;padding-left:0!important}[dir=rtl][_ngcontent-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before{content:"\\f284"!important}[dir=rtl][_nghost-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before, [dir=rtl]   [_nghost-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before{content:"\\f284"!important}[dir=rtl][_ngcontent-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before{float:right!important}[dir=rtl][_nghost-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before, [dir=rtl]   [_nghost-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before{float:right!important}[dir=rtl][_ngcontent-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before{padding-left:7px!important}[dir=rtl][_nghost-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before, [dir=rtl]   [_nghost-%COMP%]   .breadcrumb-item[_ngcontent-%COMP%] + .breadcrumb-item[_ngcontent-%COMP%]:before{padding-left:7px!important}ol[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{font-size:clamp(14px,3vw,20px);font-weight:400;color:#171d23}.active[_ngcontent-%COMP%]{color:var(--primary);font-size:clamp(14px,3vw,20px);font-weight:400}']})};export{H as a};
