import{a as Q}from"./chunk-5OVEFISH.js";import"./chunk-ECIPGGFF.js";import{a as H,d as U,g as z,i as G}from"./chunk-ORQ34GH7.js";import{b as X}from"./chunk-DBC4OESO.js";import{a as A}from"./chunk-XXO64O37.js";import{a as J}from"./chunk-KMX5PVQZ.js";import"./chunk-HJB5ICMZ.js";import"./chunk-TAYSHZWB.js";import"./chunk-7WODUV7D.js";import"./chunk-ZRBE56L3.js";import{a as K}from"./chunk-S3JIFK7T.js";import"./chunk-EQ67X7AF.js";import"./chunk-IVW2C32D.js";import{e as W,f as q}from"./chunk-KANMOB5U.js";import"./chunk-D3YCQTGW.js";import"./chunk-OBT56KUD.js";import{h as R,l as j,m as B}from"./chunk-NMCXU7N6.js";import{$b as I,Ac as L,B as k,Ba as O,Bc as s,Dc as v,Jc as V,K as F,Lc as S,Ma as x,Mc as N,Na as C,Nb as p,Rb as d,Uc as y,Vc as h,Xc as P,Yb as _,_b as b,ac as D,bc as o,cc as l,dc as M,gc as $,ha as g,hc as w,mc as T,o as E,oc as m,p as f,sb as r,tb as u}from"./chunk-IYD54RT7.js";import"./chunk-RVFOIZLJ.js";var Y=e=>({$implicit:e}),Z=(e,i)=>({"tw-bg-primary-100 tw-shadow-md hover:tw-bg-primary-400 dark:tw-bg-primary-600 dark:hover:tw-bg-primary-900":e,"dark:hover:tw-bg-background-disabled-button":i});function te(e,i){}function ie(e,i){e&1&&p(0,te,0,0,"ng-template")}function ne(e,i){if(e&1&&(o(0,"mat-icon",10),s(1),l()),e&2){let t=m(2).$implicit;r(),v("",t.icon," ")}}function oe(e,i){e&1&&(o(0,"mat-icon"),s(1,"chevron_right"),l())}function ae(e,i){e&1&&(o(0,"mat-icon"),s(1,"expand_more"),l())}function re(e,i){if(e&1){let t=w();o(0,"mat-list-item",6),T("click",function(){x(t);let n=m().$implicit;return C(n.isDropdownOpen=!n.isDropdownOpen)}),o(1,"div",7)(2,"div",8)(3,"div",9),p(4,ne,2,1,"mat-icon",10),l(),o(5,"div"),s(6),l()(),o(7,"div",11),p(8,oe,2,0,"mat-icon")(9,ae,2,0,"mat-icon"),l()()()}if(e&2){let t=m().$implicit,a=m(2);d("ngClass",N(5,Z,a.router.url.includes(t.routerLink)&&!t.isDropdownOpen,a.router.url.includes(t.routerLink)&&!t.isDropdownOpen)),r(4),_(4,t.icon!==""?4:-1),r(2),v(" ",t.label," "),r(2),_(8,t.isDropdownOpen?-1:8),r(),_(9,t.isDropdownOpen?9:-1)}}function le(e,i){if(e&1&&(o(0,"mat-icon",10),s(1),l()),e&2){let t=m(2).$implicit;r(),v("",t.icon," ")}}function me(e,i){if(e&1){let t=w();o(0,"mat-list-item",6),T("click",function(){x(t);let n=m(3);return C(n.closeTopLevelNav())}),o(1,"a",12)(2,"div",9),p(3,le,2,1,"mat-icon",10),l(),o(4,"div"),s(5),l()()()}if(e&2){let t=m().$implicit,a=m(2);d("ngClass",N(4,Z,a.router.url===t.routerLink,a.router.url!==t.routerLink)),r(),d("routerLink",t.routerLink),r(2),_(3,t.icon!==""?3:-1),r(2),v(" ",t.label," ")}}function pe(e,i){e&1&&$(0)}function ce(e,i){if(e&1&&(o(0,"mat-nav-list",4),M(1,"mat-divider"),o(2,"div",13),p(3,pe,1,0,"ng-container",3),y(4,"async"),l()()),e&2){let t=m().$implicit,a=m(2),n=L(6);r(3),d("ngTemplateOutlet",n)("ngTemplateOutletContext",S(4,Y,h(4,2,a.getElementsWithPermission(t.children))))}}function _e(e,i){if(e&1&&p(0,re,10,8,"mat-list-item",5)(1,me,6,7,"mat-list-item",5)(2,ce,5,6,"mat-nav-list",4),e&2){let t=i.$implicit;_(0,t.isDropdown?0:-1),r(),_(1,t.isDropdown?-1:1),r(),_(2,t.children&&t.isDropdownOpen?2:-1)}}function se(e,i){if(e&1&&(o(0,"div")(1,"mat-nav-list",4),I(2,_e,3,3,null,null,b),l()()),e&2){let t=i.$implicit;r(2),D(t)}}var de=(()=>{let i=class i{constructor(a,n,c){this.router=a,this.userService=n,this.sideNavService=c,this.navElements=Q}getElementsWithPermission(a){return E(a).pipe(g(n=>this.userService.userHasRoles(n.requiredRoles).pipe(g(c=>k(()=>c,f(n),f())))),F((n,c)=>[...n,c],[]))}closeTopLevelNav(){this.sideNavService.closeLeftSideNav=""}};i.\u0275fac=function(n){return new(n||i)(u(W),u(K),u(A))},i.\u0275cmp=O({type:i,selectors:[["osee-top-level-navigation"]],standalone:!0,features:[V],decls:7,vars:6,consts:[["recursiveMenu",""],[1,"tw-h-16","tw-text-xl","tw-font-bold"],[1,"tw-p-0"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"tw-py-0"],[1,"tw-py-6",3,"ngClass"],[1,"tw-py-6",3,"click","ngClass"],[1,"tw-flex","tw-items-center","tw-justify-between"],[1,"tw-flex","tw-flex-row","tw-items-center"],[1,"tw-pr-2"],["matListItemIcon",""],[1,"tw-flex","tw-items-center"],["queryParamsHandling","merge",1,"tw-flex","tw-flex-row","tw-items-center",3,"routerLink"],[1,"tw-pl-4"]],template:function(n,c){if(n&1&&(o(0,"mat-toolbar",1),s(1,"OSEE Navigator"),l(),o(2,"mat-nav-list",2),p(3,ie,1,0,null,3),y(4,"async"),l(),p(5,se,4,0,"ng-template",null,0,P)),n&2){let ee=L(6);r(3),d("ngTemplateOutlet",ee)("ngTemplateOutletContext",S(4,Y,h(4,2,c.getElementsWithPermission(c.navElements))))}},dependencies:[R,B,q,j,X,G,z,J,U,H],encapsulation:2});let e=i;return e})(),he=de;export{de as TopLevelNavigationComponent,he as default};
