import{a as G,b as V,c as $,e as A}from"./chunk-OFYIPW5Z.js";import{$b as L,Gc as H,Tc as O,Uc as j,Xc as W,Yc as d,Zb as B}from"./chunk-ATD4AEXQ.js";import{$c as k,Bb as x,Ka as n,Kc as w,Mb as p,Nb as P,Oa as v,Pb as y,Qb as l,Rb as u,Ta as C,Tb as T,Ua as E,Ub as b,Vb as _,Wb as M,_c as U,ac as D,bd as F,da as g,fc as R,gc as N,hb as m,hc as I,ib as c,nb as h,ob as i,pb as r,qb as S,xa as f}from"./chunk-BXH3QC5E.js";var J=()=>({day:"2-digit",month:"long"});function K(t,q){if(t&1&&(i(0,"div",8)(1,"span"),l(2),r()()),t&2){let e=x();p("background",e.getRouteColor())("color",e.getTextColor()),P("hide-header-text",e.panelExpandedState),n(2),T("",e.getRouteDrivingDayName(),", ",e.getRouteNumber())}}function Q(t,q){if(t&1&&(i(0,"div",7)(1,"div",9)(2,"div",10),l(3),r(),i(4,"div",11),l(5),R(6,"numberToDatePipe"),r()(),i(7,"div",12)(8,"div",10),l(9),r(),i(10,"div",11),l(11),r()()()),t&2){let e=x();n(),p("--route-color",e.getRouteColor()),n(),p("color",e.getTextColor()),n(),u(e.getRouteDrivingDayName()),n(),p("color",e.getTextColor()),n(),u(I(6,10,e.returnRoute.date,D(13,J))),n(4),u(e.getRouteNumber()),n(2),u(e.getRouteDescription())}}var X=(()=>{class t{translateService;class="abs-return-route-expansion-panel";returnRoute;panelExpandedState;constructor(e){this.translateService=e}ngOnChanges(e){if(e.returnRoute){let o=e.returnRoute.currentValue;(!o||o.date<0)&&(this.returnRoute=null)}}getRouteDrivingDayName(){return B.fromNumberToDate(this.returnRoute.date).setLocale(L.getLocale()).toLocaleString({weekday:"long"})}getRouteNumber(){return`${this.translateService.instant("LBL_ROUTE")} ${this.returnRoute.routeNumber}`}getRouteDescription(){return this.returnRoute.routeDescription}getRouteColor(){return`#${d.getNearestHexColor(this.returnRoute?.dayColor).backgroundColor}`}getTextColor(){let e=d.getNearestHexColor(this.returnRoute?.dayColor).backgroundColor;return`#${d.getHighestContrastTextColor(e)}`}static \u0275fac=function(o){return new(o||t)(v(U))};static \u0275cmp=C({type:t,selectors:[["abs-return-route-expansion-panel"]],hostVars:2,hostBindings:function(o,a){o&2&&y(a.class)},inputs:{returnRoute:"returnRoute",panelExpandedState:"panelExpandedState"},standalone:!1,features:[f],decls:10,vars:7,consts:[[1,"abs-expansion-panel",3,"expandedChange","expanded","disabled"],[1,"abs-expansion-panel-header"],[1,"abs-panel-title"],["svgIcon","truck",1,"panel-title-icon"],[1,"panel-title-text"],[1,"return-route-header-text",3,"hide-header-text","background","color"],[1,"return-route-expanded-row-wrapper"],[1,"return-route-expanded-row"],[1,"return-route-header-text"],[1,"route-info","route-info--date"],[1,"route-text"],[1,"route-subtext"],[1,"route-info","route-info--description"]],template:function(o,a){o&1&&(i(0,"mat-expansion-panel",0),M("expandedChange",function(s){return _(a.panelExpandedState,s)||(a.panelExpandedState=s),s}),i(1,"mat-expansion-panel-header",1)(2,"mat-panel-title",2),S(3,"mat-icon",3),i(4,"span",4),l(5),R(6,"translate"),r()(),m(7,K,3,8,"div",5),r(),i(8,"div",6),m(9,Q,12,14,"div",7),r()()),o&2&&(b("expanded",a.panelExpandedState),h("disabled",!a.returnRoute),n(5),u(N(6,5,"LBL_RETURN_ROUTE")),n(2),c(a.returnRoute?7:-1),n(2),c(a.returnRoute?9:-1))},dependencies:[G,V,$,O,k,H],encapsulation:2})}return t})();var Y=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=E({type:t});static \u0275inj=g({imports:[w,A,j,F,W]})}return t})();export{X as a,Y as b};
