@mxtommy/kip
Version:
An advanced and versatile marine instrumentation package to display Signal K data.
4 lines • 228 kB
JavaScript
import{a as ai,b as eo,c as io,d as ao,e as oo}from"./chunk-7HGASC2C.js";import{a as Me}from"./chunk-SFOGOD7T.js";import{a as Xa,b as Ja,c as to,d as ii}from"./chunk-227VFT2C.js";import{a as yt,b as Xt}from"./chunk-7XQ5QE47.js";import{a as ja,b as qa,c as Ha,d as xe,e as Ka,f as j,g as Ya,h as $a,k as Qa,l as Za,m as Ae,n as lt,o as Zt}from"./chunk-FPJ3XPOG.js";import{g as aa,j as oa,o as la,p as Q,q as gt}from"./chunk-PFPMEH2B.js";import{a as Ea,b as Ga,c as Ia,d as zt,e as jt,g as Oa,h as qt,i as Ht,j as Kt,k as _e,l as bt}from"./chunk-JHWS5VWZ.js";import{a as ge}from"./chunk-ZDFGHJZD.js";import{a as za,b as ei}from"./chunk-MZFYZTYI.js";import{$ as vt,A as La,B as Na,C as rt,D as Va,E as Xe,F as Yt,G as _t,H as z,I as Ra,J as Ba,K as $t,L as Je,M as ve,N as F,P as ye,Q as J,R as P,T as L,U as ti,V as Wa,W as Ce,Y as Ua,_ as N,a as oe,ca as tt,da as Qt,e as ta,f as ea,h as ia,i as Ue,j as _i,k as ze,p as ra,q as Ze,r as Z,t as U,w as O,x as X,y as Fa,z as Pa}from"./chunk-2OWJVOTJ.js";import{$b as _,$c as Bt,$d as qe,A as se,Aa as w,Ab as Pt,Ac as T,Ad as Xi,Ae as $e,Bc as R,Be as ot,Cb as St,Cc as he,Ce as Qe,Da as Ft,Db as Bi,De as Ut,Ec as Hi,F as Gi,Fa as me,Fb as at,Fc as Ki,Fe as _a,Gb as Le,Gc as Yi,Ge as nt,Hb as Wi,I as hi,Ie as va,Ja as k,Jd as Ji,K as It,Kc as Tt,L as Ot,Mc as Nt,Me as ya,Na as ee,Nc as Re,Nd as Wt,Ne as Ca,O as Ii,Oa as pe,Od as na,P as Fe,Qa as wt,Qc as Vt,R as ce,Rb as et,Rc as Rt,Sb as u,Sd as vi,Tb as h,Td as sa,U as Oi,Ub as A,Ud as je,Ue as xa,Vb as Ne,Ve as Ma,W as Fi,Wb as C,Wd as ca,Xb as x,Xc as $i,Xe as wa,Yb as p,Yc as Be,Ye as Ci,Zb as n,Zd as da,Ze as Sa,_b as o,_c as Qi,a as st,ac as fi,ad as b,af as Ta,b as Mt,bc as bi,be as ma,bf as ka,ce as He,cf as Aa,dc as Ui,de as pa,ec as zi,ed as ae,ee as ua,f as H,fa as de,fc as ji,ff as Da,g as re,ga as Pe,gc as E,hc as qi,ia as Pi,ic as y,id as I,j as pi,je as ke,kc as g,ke as fe,lb as s,lc as ht,le as ha,m as le,mc as q,na as Te,nb as Ni,nc as ct,ne as yi,o as Se,oa as mt,oc as Lt,oe as Ke,pa as pt,pb as gi,pc as B,qc as W,qe as Ye,ra as K,re as $,sb as Vi,t as ui,ta as m,te as kt,uc as dt,ue as ft,vc as Ve,ve as be,wb as v,wc as V,wd as Zi,xa as Li,xb as ut,xc as ue,xe as ga,y as Oe,yb as Y,yc as ie,ye as fa,za as M,zb as Ri,zc as r,zd as We,ze as ba}from"./chunk-W2S6R4AZ.js";var Ol=(()=>{class a{_settings=m(Ue);_router=m(oa);dashboards=k([],{equal:_i});activeDashboard=k(0);_widgetAction=new Se(null);widgetAction$=this._widgetAction.asObservable();_isDashboardStatic=new Se(!0);isDashboardStatic$=this._isDashboardStatic.asObservable();isDashboardStatic=na(this.isDashboardStatic$);blankDashboard=[{id:null,name:"Dashboard 1",configuration:[{w:12,h:12,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-tutorial",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}]}];constructor(){let t=this._settings.getDashboardConfig();if(!t||t.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let i=this.blankDashboard.map(e=>Mt(st({},e),{id:oe.create()}));this.dashboards.set([...i])}else this.dashboards.set(this._settings.getDashboardConfig());Be(()=>{this._settings.saveDashboards(this.dashboards())})}toggleStaticDashboard(){this._isDashboardStatic.next(!this._isDashboardStatic.value)}add(t,i){this.dashboards.update(e=>[...e,{id:oe.create(),name:t,configuration:i}])}update(t,i){this.dashboards.update(e=>e.map((l,d)=>d===t?Mt(st({},l),{name:i}):l))}delete(t){this.dashboards.update(i=>i.filter((e,l)=>l!==t)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(t,i){if(t<0||t>=this.dashboards().length){console.error(`[Dashboard Service] Invalid itemIndex: ${t}`);return}let e=this.dashboards()[t],l=ze(e);l.id=oe.create(),l.name=i,Array.isArray(l.configuration)?l.configuration.forEach(d=>{d&&d.input?.widgetProperties?(d.id=oe.create(),d.input.widgetProperties.uuid=d.id):console.error("Dashboard Service] Widget configuration is missing required properties:",d)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",l.configuration),l.configuration=[]),this.dashboards.update(d=>[...d,l])}updateConfiguration(t,i){this.dashboards.update(e=>e.map((l,d)=>d===t?_i(l.configuration,i)?l:Mt(st({},l),{configuration:i}):l))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}setActiveDashboard(t){t>=0&&t<this.dashboards().length?this.activeDashboard.set(t):console.error(`[Dashboard Service] Invalid dashboard ID: ${t}`)}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(t){t>=0&&t<this.dashboards().length?this._router.navigate(["/dashboard",t]):console.error(`[Dashboard Service] Invalid dashboard ID: ${t}`)}navigateToNextDashboard(){let t=null;this.activeDashboard()-1<0?t=this.dashboards().length-1:t=this.activeDashboard()-1,this._router.navigate(["/dashboard",t])}navigateToPreviousDashboard(){let t=null;this.activeDashboard()+1>=this.dashboards().length?t=0:t=this.activeDashboard()+1,this._router.navigate(["/dashboard",t])}deleteWidget(t){this._widgetAction.next({id:t,operation:"delete"})}duplicateWidget(t){this._widgetAction.next({id:t,operation:"duplicate"})}setStaticDashboard(t){this._isDashboardStatic.next(t)}static \u0275fac=function(i){return new(i||a)};static \u0275prov=mt({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();function Uo(a,c){a&1&&ji(0)}var no=(()=>{class a{data=m(jt);static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["dialog-frame"]],decls:8,vars:3,consts:[[1,"dialogue-header"],["mat-dialog-title",""],["mat-icon-button","",1,"dialog-close-icon",3,"mat-dialog-close"],[1,"dialog-content-padding"],[4,"ngComponentOutlet"]],template:function(i,e){i&1&&(n(0,"div",0)(1,"h6",1),r(2),o(),n(3,"button",2)(4,"mat-icon"),r(5,"close"),o()()(),n(6,"mat-dialog-content",3),St(7,Uo,1,0,"ng-container",4),o()),i&2&&(s(2),T(e.data.title),s(),p("mat-dialog-close",!1),s(4),p("ngComponentOutlet",e.data.componentType))},dependencies:[Q,bt,qt,Ht,Kt,nt,ot,Zi],styles:[".dialogue-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:baseline}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}.dialog-content-padding[_ngcontent-%COMP%]{--mat-dialog-content-padding: 0px 24px 20px 24px}"]})}return a})();function zo(a,c){if(a&1&&(n(0,"button",4),r(1),o()),a&2){let t=g();p("mat-dialog-close",!0),s(),T(t.data.confirmBtnText)}}var ro=(()=>{class a{data=m(jt);static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["dialog-confirmation"]],decls:12,vars:6,consts:[[1,"dialogue-header"],["mat-dialog-title",""],["mat-icon-button","",1,"dialog-close-icon",3,"mat-dialog-close"],["align","end"],["mat-flat-button","",3,"mat-dialog-close"]],template:function(i,e){i&1&&(n(0,"div",0)(1,"h5",1),r(2),o(),n(3,"button",2)(4,"mat-icon"),r(5,"close"),o()()(),n(6,"mat-dialog-content"),r(7),o(),n(8,"mat-dialog-actions",3)(9,"button",4),r(10),o(),u(11,zo,2,2,"button",4),o()),i&2&&(s(2),T(e.data.title),s(),p("mat-dialog-close",!1),s(4),R(" ",e.data.message,`
`),s(2),p("mat-dialog-close",!1),s(),T(e.data.cancelBtnText),s(),h(e.data.confirmBtnText?11:-1))},dependencies:[Q,bt,qt,Ht,_e,Kt,nt,Ut,ot],styles:[".dialogue-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:baseline}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}"]})}return a})();function jo(a,c){if(a&1&&(n(0,"button",9),r(1),o()),a&2){let t=g(),i=dt(1);p("disabled",!i.valid),s(),T(t.data.confirmBtnText)}}var so=(()=>{class a{dialogRef=m(zt);data=m(jt);saveName(){this.dialogRef.close(this.data)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["dialog-name"]],decls:19,vars:6,consts:[["name","ngForm"],["name","name",3,"ngSubmit"],[1,"dialogue-header"],["mat-dialog-title",""],["mat-icon-button","",1,"dialog-close-icon",3,"mat-dialog-close"],[1,"field-margin"],["matInput","","type","text","id","name","placeholder","Name","name","name","required","","cdkFocusInitial","",3,"ngModelChange","ngModel"],["align","end"],["mat-flat-button","",3,"mat-dialog-close"],["mat-flat-button","","type","submit",3,"disabled"]],template:function(i,e){if(i&1){let l=E();n(0,"form",1,0),y("ngSubmit",function(){return M(l),w(e.saveName())}),n(2,"div",2)(3,"h5",3),r(4),o(),n(5,"button",4)(6,"mat-icon"),r(7,"close"),o()()(),n(8,"mat-dialog-content")(9,"mat-form-field",5)(10,"mat-label"),r(11,"Name"),o(),n(12,"input",6),Yi("ngModelChange",function(f){return M(l),Ki(e.data.name,f)||(e.data.name=f),w(f)}),o(),n(13,"mat-error"),r(14," A name is required "),o()()(),n(15,"mat-dialog-actions",7)(16,"button",8),r(17),o(),u(18,jo,2,2,"button",9),o()()}i&2&&(s(4),T(e.data.title),s(),p("mat-dialog-close",!1),s(7),Hi("ngModel",e.data.name),s(4),p("mat-dialog-close",!1),s(),T(e.data.cancelBtnText),s(),h(e.data.confirmBtnText?18:-1))},dependencies:[bt,qt,Ht,_e,Kt,gt,Q,vt,N,L,ti,Qt,tt,nt,Ut,ot,J,Xe,Z,O,X,F,Va,La],styles:[".dialogue-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:baseline}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}.field-margin[_ngcontent-%COMP%]{margin-left:15px;margin-bottom:15px}"]})}return a})();function qo(a,c){if(a&1&&(n(0,"mat-option",12),r(1),o()),a&2){let t=c.$implicit;p("value",Tt(t.value)),s(),T(t.label)}}function Ho(a,c){if(a&1){let t=E();n(0,"button",21),y("click",function(){M(t);let e=g();return w(e.moveCtrlUp())}),n(1,"mat-icon"),r(2,"arrow_drop_up"),o()()}}function Ko(a,c){if(a&1){let t=E();n(0,"button",22),y("click",function(){M(t);let e=g();return w(e.moveCtrlDown())}),n(1,"mat-icon"),r(2,"arrow_drop_down"),o()()}}var co=(()=>{class a{app=m(ge);ctrlFormGroup=b.required();controlIndex=b(void 0);arrayLength=b(void 0);deleteCtrl=Bt();moveUp=Bt();moveDown=Bt();colors=[];ngOnInit(){this.colors=this.app.configurableThemeColors}deleteControl(){let t={ctrlIndex:this.controlIndex(),pathID:this.ctrlFormGroup().get("pathID").value};this.deleteCtrl.emit(t)}moveCtrlUp(){this.moveUp.emit(this.controlIndex())}moveCtrlDown(){this.moveDown.emit(this.controlIndex())}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["boolean-control-config"]],inputs:{ctrlFormGroup:[1,"ctrlFormGroup"],controlIndex:[1,"controlIndex"],arrayLength:[1,"arrayLength"]},outputs:{deleteCtrl:"deleteCtrl",moveUp:"moveUp",moveDown:"moveDown"},decls:36,vars:3,consts:[[1,"ctrl-grid","rounded-card","rounded-card-color",3,"formGroup"],[1,"controls","flex-container"],[1,"flex-label"],[1,"full-width"],["matInput","","type","string","placeholder","Enter a display label...","formControlName","ctrlLabel"],[1,"flex-settings"],[1,"settings"],["placeholder","Select Type...","formControlName","type","name","type","required",""],["value","1"],["value","2"],["value","3"],["placeholder","Select Color...","formControlName","color","name","color","required",""],[3,"value"],[1,"flex-full-width"],["formControlName","isNumeric"],[1,"actions"],[1,"flex-actions"],[1,"btn-grid"],["mat-icon-button","","type","button","aria-label","Move control up in the list",1,"up"],["mat-icon-button","","type","button","aria-label","Move control down in the list",1,"down"],["mat-icon-button","","type","button","aria-label","Delete control",1,"delete",3,"click"],["mat-icon-button","","type","button","aria-label","Move control up in the list",1,"up",3,"click"],["mat-icon-button","","type","button","aria-label","Move control down in the list",1,"down",3,"click"]],template:function(i,e){i&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),r(5,"Label"),o(),_(6,"input",4),o()(),n(7,"div",5)(8,"mat-form-field",6)(9,"mat-label"),r(10,"Type"),o(),n(11,"mat-select",7)(12,"mat-option",8),r(13,"Toggle"),o(),n(14,"mat-option",9),r(15,"Push"),o(),n(16,"mat-option",10),r(17,"Indicator"),o()()()(),n(18,"div",5)(19,"mat-form-field",6)(20,"mat-label"),r(21,"Color"),o(),n(22,"mat-select",11),C(23,qo,2,3,"mat-option",12,A),o()()(),n(25,"div",13)(26,"mat-checkbox",14),r(27," Use numeric path "),o()()(),n(28,"div",15)(29,"div",16)(30,"div",17),u(31,Ho,3,0,"button",18),u(32,Ko,3,0,"button",19),n(33,"button",20),y("click",function(){return e.deleteControl()}),n(34,"mat-icon"),r(35,"delete"),o()()()()()()),i&2&&(p("formGroup",e.ctrlFormGroup()),s(23),x(e.colors),s(8),h(e.controlIndex()!==0?31:-1),s(),h(e.controlIndex()!==e.arrayLength()-1?32:-1))},dependencies:[J,Z,O,X,F,P,z,$t,N,L,tt,lt,j,ot,Xt,yt,gt,Q],styles:['.ctrl-grid[_ngcontent-%COMP%]{display:grid;width:auto;height:auto;margin:0 0 10px;grid-template-columns:[col-start] calc(100% - 90px) [col1-end] 80px [col2-end];grid-template-areas:"controls actions";row-gap:0px;column-gap:10px;justify-items:center;align-items:center;justify-content:center;align-content:center;padding-top:20px}.controls[_ngcontent-%COMP%]{grid-area:controls;width:100%}.actions[_ngcontent-%COMP%]{grid-area:actions}.btn-grid[_ngcontent-%COMP%]{display:grid;width:80px;height:80px;margin:0;grid-template-columns:[col-start] 50% [col1-end] 50% [col2-end];grid-template-rows:[row-start] 50% [row1-end] 50% [row2-end];grid-template-areas:"up delete" "down delete";row-gap:0px;column-gap:0px;justify-items:center;align-items:center;justify-content:center;align-content:center}.up[_ngcontent-%COMP%]{grid-area:up}.down[_ngcontent-%COMP%]{grid-area:down}.delete[_ngcontent-%COMP%]{grid-area:delete}.flex-label[_ngcontent-%COMP%]{flex-grow:2;flex-shrink:2}.flex-settings[_ngcontent-%COMP%]{flex-grow:1;flex-shrink:1}.settings[_ngcontent-%COMP%]{min-width:100px}.flex-actions[_ngcontent-%COMP%]{flex-grow:0;flex-shrink:0}.flex-full-width[_ngcontent-%COMP%]{width:100%}']})}return a})();function Yo(a,c){if(a&1){let t=E();n(0,"boolean-control-config",4),y("moveUp",function(e){M(t);let l=g();return w(l.moveUp(e))})("moveDown",function(e){M(t);let l=g();return w(l.moveDown(e))})("deleteCtrl",function(e){M(t);let l=g();return w(l.deletePath(e))}),o()}if(a&2){let t=c.$implicit,i=c.$index,e=g();p("ctrlFormGroup",e.getFormGroup(t))("controlIndex",i)("arrayLength",e.arrayLength)}}var mo=(()=>{class a{fb=m(ye);multiCtrlArray=b.required();addPath=Bt();updatePath=Bt();delPath=Bt();multiFormGroup=null;arrayLength=0;multiCtrlArraySubscription=null;ngOnInit(){this.arrayLength=this.multiCtrlArray().length,this.multiFormGroup=new Fa({multiCtrlArray:this.multiCtrlArray()}),this.multiCtrlArraySubscription=this.multiCtrlArray().valueChanges.pipe(Fe(350)).subscribe(t=>{this.updatePath.emit(t)})}addCtrlGroup(){let t=oe.create();this.multiCtrlArray().push(this.fb.group({ctrlLabel:[null,U.required],type:["1",U.required],pathID:[t],color:["contrast"],isNumeric:[!1],value:[null]})),this.arrayLength=this.multiCtrlArray().length;let i={path:{description:null,path:null,pathID:t,source:"default",pathType:"boolean",supportsPut:!0,isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:null,convertUnitTo:null,sampleTime:500},ctrlType:1};this.addPath.emit(i)}moveUp(t){let i=this.multiCtrlArray().at(t);this.multiCtrlArray().removeAt(t,{emitEvent:!1}),this.multiCtrlArray().insert(t-1,i,{emitEvent:!1})}moveDown(t){let i=this.multiCtrlArray().at(t);this.multiCtrlArray().removeAt(t,{emitEvent:!1}),this.multiCtrlArray().insert(t+1,i,{emitEvent:!1})}deletePath(t){this.delPath.emit(t),this.arrayLength=this.multiCtrlArray().length}getFormGroup(t){return t}ngOnDestroy(){this.multiCtrlArraySubscription?.unsubscribe()}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["boolean-multicontrol-options"]],inputs:{multiCtrlArray:[1,"multiCtrlArray"]},outputs:{addPath:"addPath",updatePath:"updatePath",delPath:"delPath"},decls:7,vars:1,consts:[[3,"formGroup"],["formArrayName","multiCtrlArray"],[1,"full-width",3,"ctrlFormGroup","controlIndex","arrayLength"],["type","button","mat-mini-fab","","color","primary","aria-label","Add control down in the list",1,"add-btn",3,"click"],[1,"full-width",3,"moveUp","moveDown","deleteCtrl","ctrlFormGroup","controlIndex","arrayLength"]],template:function(i,e){i&1&&(n(0,"div",0)(1,"div",1),C(2,Yo,1,3,"boolean-control-config",2,Ne),n(4,"button",3),y("click",function(){return e.addCtrlGroup()}),n(5,"mat-icon"),r(6,"add"),o()()()()),i&2&&(p("formGroup",e.multiFormGroup),s(2),x(e.multiCtrlArray().controls))},dependencies:[J,X,P,z,Ba,co,nt,_a,gt,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding-top:15px;padding-bottom:15px}.add-btn[_ngcontent-%COMP%]{margin-left:calc(50% - 20px)}"]})}return a})();var $o=["*"];var Qo=new K("MAT_CARD_CONFIG"),Os=(()=>{class a{appearance;constructor(){let t=m(Qo,{optional:!0});this.appearance=t?.appearance||"raised"}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:8,hostBindings:function(i,e){i&2&&V("mat-mdc-card-outlined",e.appearance==="outlined")("mdc-card--outlined",e.appearance==="outlined")("mat-mdc-card-filled",e.appearance==="filled")("mdc-card--filled",e.appearance==="filled")},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:$o,decls:1,vars:0,template:function(i,e){i&1&&(ht(),q(0))},styles:[`.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mat-card-elevated-container-color, var(--mat-sys-surface-container-low));border-color:var(--mat-card-elevated-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mat-card-elevated-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mat-card-outlined-container-color, var(--mat-sys-surface));border-radius:var(--mat-card-outlined-container-shape, var(--mat-sys-corner-medium));border-width:var(--mat-card-outlined-outline-width, 1px);border-color:var(--mat-card-outlined-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mat-card-outlined-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mat-mdc-card-filled{background-color:var(--mat-card-filled-container-color, var(--mat-sys-surface-container-highest));border-radius:var(--mat-card-filled-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mat-card-filled-container-elevation, var(--mat-sys-level0))}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}
`],encapsulation:2,changeDetection:0})}return a})();var po=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=ut({type:a});static \u0275inj=pt({imports:[$,$]})}return a})();function Zo(a,c){if(a&1&&(n(0,"mat-option",8),r(1),o()),a&2){let t=c.$implicit;p("value",Tt(t.value)),s(),T(t.label)}}var uo=(()=>{class a{app=m(ge);displayName=b.required();showLabel=b.required();convertUnitTo=b.required();datasetUUID=b.required();datasetAverageArray=b.required();showAverageData=b.required();trackAgainstAverage=b.required();showDatasetMinimumValueLine=b.required();showDatasetMaximumValueLine=b.required();showDatasetAverageValueLine=b.required();showDatasetAngleAverageValueLine=b.required();verticalChart=b.required();inverseYAxis=b.required();showTimeScale=b.required();showYScale=b.required();startScaleAtZero=b.required();yScaleSuggestedMin=b.required();yScaleSuggestedMax=b.required();enableMinMaxScaleLimit=b.required();yScaleMin=b.required();yScaleMax=b.required();numDecimal=b.required();color=b.required();colors=[];ngOnInit(){this.colors=this.app.configurableThemeColors,this.showAverageData().value||this.trackAgainstAverage().disable(),this.setValueScaleOptionsControls(this.enableMinMaxScaleLimit().value)}setValueScaleOptionsControls(t){t?(this.yScaleMin()?.enable(),this.yScaleMax()?.enable(),this.yScaleSuggestedMin()?.disable(),this.yScaleSuggestedMax()?.disable()):(this.yScaleMin()?.disable(),this.yScaleMax()?.disable(),this.yScaleSuggestedMin()?.enable(),this.yScaleSuggestedMax()?.enable())}setScaleControls(t){this.setValueScaleOptionsControls(t.value)}enableTrackAgainstMovingAverage(t){t.checked?this.trackAgainstAverage().enable():(this.trackAgainstAverage().setValue(t.checked),this.trackAgainstAverage().disable())}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["config-display-chart-options"]],inputs:{displayName:[1,"displayName"],showLabel:[1,"showLabel"],convertUnitTo:[1,"convertUnitTo"],datasetUUID:[1,"datasetUUID"],datasetAverageArray:[1,"datasetAverageArray"],showAverageData:[1,"showAverageData"],trackAgainstAverage:[1,"trackAgainstAverage"],showDatasetMinimumValueLine:[1,"showDatasetMinimumValueLine"],showDatasetMaximumValueLine:[1,"showDatasetMaximumValueLine"],showDatasetAverageValueLine:[1,"showDatasetAverageValueLine"],showDatasetAngleAverageValueLine:[1,"showDatasetAngleAverageValueLine"],verticalChart:[1,"verticalChart"],inverseYAxis:[1,"inverseYAxis"],showTimeScale:[1,"showTimeScale"],showYScale:[1,"showYScale"],startScaleAtZero:[1,"startScaleAtZero"],yScaleSuggestedMin:[1,"yScaleSuggestedMin"],yScaleSuggestedMax:[1,"yScaleSuggestedMax"],enableMinMaxScaleLimit:[1,"enableMinMaxScaleLimit"],yScaleMin:[1,"yScaleMin"],yScaleMax:[1,"yScaleMax"],numDecimal:[1,"numDecimal"],color:[1,"color"]},decls:84,vars:20,consts:[["minLine",""],[1,"tab-content"],[1,"chart-flex-container"],[1,"chart-panel-group"],[1,"full-width"],["matInput","","placeholder","Enter a label to display","name","displayName",3,"formControl"],["name","showLabel",1,"full-width",3,"formControl"],["placeholder","Select Color...","name","color","required","",3,"formControl"],[3,"value"],[1,"flex-item-rounded-card","rounded-card-color"],[2,"margin-left","10px"],["matInput","","type","number","min","0","max","5","placeholder","Enter or select number...","name","numDecimal","required","",3,"formControl"],["name","showAverageData",1,"full-width",2,"margin-top","10px",3,"change","formControl"],["name","trackAgainstAverage",1,"full-width",2,"margin-left","25px",3,"formControl"],["name","verticalChart",3,"formControl"],[1,"no-margin"],[1,"mat-caption"],["aria-label","Select an option","name","enableMinMaxScaleLimit",1,"chart-option-radio-group",3,"formControl"],[1,"chart-option-radio-button",3,"change","value"],[1,"chart-option-radio-button-config"],[1,"chart-option-radio-button-config-form-field"],["matInput","","type","number","name","yScaleSuggestedMin",3,"formControl"],["matInput","","type","number","name","yScaleSuggestedMax",3,"formControl"],[1,"chart-option-radio-button-config-item"],["matInput","","type","number","name","yScaleMin","required","",3,"formControl"],["matInput","","type","number","name","yScaleMax","required","",3,"formControl"],["name","showYScale",1,"full-width",3,"formControl"],["name","inverseYAxis",3,"formControl"],["name","showTimeScale",1,"full-width",3,"formControl"],["name","showDatasetMaximumValueLine",1,"full-width",3,"formControl"],["name","showDatasetAverageValueLine",1,"full-width",3,"formControl"],["name","showDatasetMinimumValueLine",1,"full-width",3,"formControl"]],template:function(i,e){if(i&1){let l=E();n(0,"div",1)(1,"div",2)(2,"div",3)(3,"mat-form-field",4)(4,"mat-label"),r(5,"Widget Label"),o(),_(6,"input",5),o()(),n(7,"div",3)(8,"mat-checkbox",6),r(9," Show Label "),o()()(),n(10,"div",2)(11,"mat-form-field",4)(12,"mat-label"),r(13,"Color"),o(),n(14,"mat-select",7),C(15,Zo,2,3,"mat-option",8,A),o()()(),n(17,"div",2)(18,"div",9)(19,"div")(20,"p"),r(21,"Series"),o(),n(22,"mat-form-field",10)(23,"mat-label"),r(24,"Value Decimal Places"),o(),_(25,"input",11),o(),n(26,"mat-checkbox",12),y("change",function(f){return M(l),w(e.enableTrackAgainstMovingAverage(f))}),r(27," Display Moving Average "),o(),n(28,"mat-checkbox",13),r(29," Track Against Moving Average "),o()(),n(30,"mat-checkbox",14),r(31," Vertical Data Graph "),o()(),n(32,"div",9)(33,"div")(34,"p",15),r(35,"Data Scale"),o(),n(36,"span",16),r(37,"(Default node is automatic scale)"),o(),n(38,"mat-radio-group",17)(39,"mat-radio-button",18),y("change",function(f){return M(l),w(e.setScaleControls(f))}),r(40,"Auto Scale"),o(),n(41,"div",19)(42,"mat-form-field",20)(43,"mat-label"),r(44,"Suggested Min"),o(),_(45,"input",21),o(),n(46,"mat-form-field",20)(47,"mat-label"),r(48,"Suggested Max"),o(),_(49,"input",22),o()(),n(50,"mat-radio-button",18),y("change",function(f){return M(l),w(e.setScaleControls(f))}),r(51," Fixed Scale "),o(),n(52,"div",19)(53,"div",23)(54,"mat-form-field",20)(55,"mat-label"),r(56,"Min"),o(),_(57,"input",24),o()(),n(58,"div",23)(59,"mat-form-field",20)(60,"mat-label"),r(61,"Max"),o(),_(62,"input",25),o()()()(),n(63,"mat-checkbox",26),r(64," Show Scale Ticks "),o(),n(65,"mat-checkbox",27),r(66," Inverse Scale "),o()()(),n(67,"div",9)(68,"div")(69,"p",15),r(70,"Time Scale"),o(),n(71,"mat-checkbox",28),r(72," Show Scale Ticks "),o()()(),n(73,"div",9)(74,"div")(75,"p",15),r(76,"Dataset"),o(),n(77,"mat-checkbox",29),r(78," Show Maximum Line "),o(),n(79,"mat-checkbox",30),r(80," Show Average Line "),o(),n(81,"mat-checkbox",31,0),r(83," Show Minimum Line "),o()()()()()}i&2&&(s(6),p("formControl",e.displayName()),s(2),p("formControl",e.showLabel()),s(6),p("formControl",e.color()),s(),x(e.colors),s(10),p("formControl",e.numDecimal()),s(),p("formControl",e.showAverageData()),s(2),p("formControl",e.trackAgainstAverage()),s(2),p("formControl",e.verticalChart()),s(8),p("formControl",e.enableMinMaxScaleLimit()),s(),p("value",!1),s(6),p("formControl",e.yScaleSuggestedMin()),s(4),p("formControl",e.yScaleSuggestedMax()),s(),p("value",!0),s(7),p("formControl",e.yScaleMin()),s(5),p("formControl",e.yScaleMax()),s(),p("formControl",e.showYScale()),s(2),p("formControl",e.inverseYAxis()),s(6),p("formControl",e.showTimeScale()),s(6),p("formControl",e.showDatasetMaximumValueLine()),s(2),p("formControl",e.showDatasetAverageValueLine()),s(2),p("formControl",e.showDatasetMinimumValueLine()))},dependencies:[po,vt,N,L,Xt,yt,Zt,lt,j,Ae,Qt,tt,to,Xa,Ja,P,Z,Yt,O,F,ve,Je,_t],styles:[".chart-flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;margin:15px 0;gap:15px;align-items:stretch}.chart-panel-group[_ngcontent-%COMP%]{min-width:250px;flex-grow:1}.no-margin[_ngcontent-%COMP%]{margin:0}.chart-option-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:0;align-items:flex-start}.chart-option-radio-button[_ngcontent-%COMP%]{margin:0}.chart-option-radio-button-config[_ngcontent-%COMP%]{margin-left:35px;display:flex;flex-direction:row;flex-wrap:wrap;gap:10px;align-items:flex-start}.chart-option-radio-button-config-item[_ngcontent-%COMP%]{flex-grow:0;flex-shrink:1;min-width:50px}.chart-option-radio-button-config-form-field[_ngcontent-%COMP%]{display:block;max-width:118px}"]})}return a})();var Xo=(a,c)=>c.uuid;function Jo(a,c){if(a&1&&(n(0,"mat-option",4),r(1),o()),a&2){let t=c.$implicit;p("value",t.uuid),s(),R(" ",t.label," ")}}function tn(a,c){if(a&1&&(n(0,"mat-option",4),r(1),o()),a&2){let t=c.$implicit;p("value",t.measure),s(),R(" ",t.description," ")}}function en(a,c){if(a&1&&(n(0,"mat-optgroup",6),C(1,tn,2,2,"mat-option",4,A),o()),a&2){let t=c.$implicit;p("label",t.group),s(),x(t.units)}}var ho=(()=>{class a{datasetService=m(ii);units=m(Me);datasetUUID=b.required();convertUnitTo=b.required();availableDataSets=[];unitList={};ngOnInit(){this.availableDataSets=this.datasetService.list().filter(i=>i.editable!==!1).sort();let t=this.datasetUUID();t.value&&this.setPathUnits(t.value)}setPathUnits(t){let i=this.datasetService.getDatasetConfig(t);return t&&i?(this.unitList=this.units.getConversionsForPath(i.path),this.convertUnitTo()?.enable(),!0):(this.unitList=this.units.getConversionsForPath(""),this.convertUnitTo()?.disable(),!1)}datasetChanged(t){this.setPathUnits(t.value)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["config-dataset-chart-options"]],inputs:{datasetUUID:[1,"datasetUUID"],convertUnitTo:[1,"convertUnitTo"]},decls:14,vars:2,consts:[[1,"display-content","tab-content"],[1,"widget-options-grid"],[1,"options-grid-span2"],["placeholder","Select dataset...","name","datasetUUID","required","",3,"selectionChange","formControl"],[3,"value"],["placeholder","Select unit...","name","convertUnitTo","required","",3,"formControl"],[3,"label"]],template:function(i,e){i&1&&(n(0,"div",0)(1,"div",1)(2,"mat-form-field",2)(3,"mat-label"),r(4,"Dataset"),o(),n(5,"mat-select",3),y("selectionChange",function(d){return e.datasetChanged(d)}),C(6,Jo,2,2,"mat-option",4,Xo),o()(),n(8,"mat-form-field",2)(9,"mat-label"),r(10,"Display Format"),o(),n(11,"mat-select",5),C(12,en,3,1,"mat-optgroup",6,A),o()()()()),i&2&&(s(5),p("formControl",e.datasetUUID()),s(),x(e.availableDataSets),s(5),p("formControl",e.convertUnitTo()),s(),x(e.unitList.conversions))},dependencies:[vt,N,L,Zt,lt,j,xe,P,O,F,_t],styles:[".display-content[_ngcontent-%COMP%]{display:block;height:100%;width:100%;padding-top:15px;padding-bottom:10px}"]})}return a})();var go=(()=>{class a{transform(t){return Object.keys(t)}static \u0275fac=function(i){return new(i||a)};static \u0275pipe=Ri({name:"objectKeys",type:a,pure:!0})}return a})();var on=["panel"],nn=["*"];function rn(a,c){if(a&1&&(fi(0,"div",1,0),q(2),bi()),a&2){let t=c.id,i=g();ie(i._classList),V("mat-mdc-autocomplete-visible",i.showPanel)("mat-mdc-autocomplete-hidden",!i.showPanel)("mat-autocomplete-panel-animations-enabled",!i._animationsDisabled)("mat-primary",i._color==="primary")("mat-accent",i._color==="accent")("mat-warn",i._color==="warn"),qi("id",i.id),et("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby(t))}}var Si=class{source;option;constructor(c,t){this.source=c,this.option=t}},_o=new K("mat-autocomplete-default-options",{providedIn:"root",factory:ln});function ln(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1}}var si=(()=>{class a{_changeDetectorRef=m(ae);_elementRef=m(wt);_defaults=m(_o);_animationsDisabled=ft();_activeOptionChanges=re.EMPTY;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(t){this._color=t,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple;optionSelected=new at;opened=new at;closed=new at;optionActivated=new at;set classList(t){this._classList=t,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}id=m(ke).getId("mat-autocomplete-");inertGroups;constructor(){let t=m(je);this.inertGroups=t?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new ha(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){let i=new Si(this,t);this.optionSelected.emit(i)}_getPanelAriaLabelledby(t){if(this.ariaLabel)return null;let i=t?t+" ":"";return this.ariaLabelledby?i+this.ariaLabelledby:t}_skipPredicate(){return!1}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(i,e,l){if(i&1&&(ct(l,j,5),ct(l,Ha,5)),i&2){let d;B(d=W())&&(e.options=d),B(d=W())&&(e.optionGroups=d)}},viewQuery:function(i,e){if(i&1&&(Lt(Ni,7),Lt(on,5)),i&2){let l;B(l=W())&&(e.template=l.first),B(l=W())&&(e.panel=l.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",I],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",I],requireSelection:[2,"requireSelection","requireSelection",I],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",I],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",I]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[Nt([{provide:qa,useExisting:a}])],ngContentSelectors:nn,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(i,e){i&1&&(ht(),Bi(0,rn,3,17,"ng-template"))},styles:[`div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}
`],encapsulation:2,changeDetection:0})}return a})();var sn={provide:Ze,useExisting:Te(()=>Ee),multi:!0};var vo=new K("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let a=m(Ft);return()=>Ci(a)}});function cn(a){let c=m(Ft);return()=>Ci(c)}var dn={provide:vo,deps:[],useFactory:cn},Ee=(()=>{class a{_environmentInjector=m(Li);_element=m(wt);_injector=m(Ft);_viewContainerRef=m(Vi);_zone=m(Le);_changeDetectorRef=m(ae);_dir=m(Ye,{optional:!0});_formField=m(Ua,{optional:!0,host:!0});_viewportRuler=m(xa);_scrollStrategy=m(vo);_renderer=m(gi);_animationsDisabled=ft();_defaults=m(_o,{optional:!0});_overlayRef;_portal;_componentDestroyed=!1;_initialized=new le;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue;_valueOnAttach;_valueOnLastKeydown;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=re.EMPTY;_breakpointObserver=m(He);_handsetLandscapeSubscription=re.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption;_closeKeyEventStream=new le;_overlayPanelClass=ma(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&Ke(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return It(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Ot(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Ot(()=>this._overlayAttached)):ui()).pipe(se(t=>t instanceof Ka?t:null))}optionSelections=Gi(()=>{let t=this.autocomplete?this.autocomplete.options:null;return t?t.changes.pipe(de(t),Pe(()=>It(...t.map(i=>i.onSelectionChange)))):this._initialized.pipe(Pe(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new pi(t=>{let i=l=>{let d=sa(l),f=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,S=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&d!==this._element.nativeElement&&!this._hasFocus()&&(!f||!f.contains(d))&&(!S||!S.contains(d))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(d)&&t.next(l)},e=[this._renderer.listen("document","click",i),this._renderer.listen("document","auxclick",i),this._renderer.listen("document","touchend",i)];return()=>{e.forEach(l=>l())}})}writeValue(t){Promise.resolve(null).then(()=>this._assignOptionValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){let i=t,e=i.keyCode,l=fe(i);if(e===27&&!l&&i.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&e===13&&this.panelOpen&&!l)this.activeOption._selectViaInteraction(),this._resetActiveItem(),i.preventDefault();else if(this.autocomplete){let d=this.autocomplete._keyManager.activeItem,f=e===38||e===40;e===9||f&&!l&&this.panelOpen?this.autocomplete._keyManager.onKeydown(i):f&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(f||this.autocomplete._keyManager.activeItem!==d)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(t){let i=t.target,e=i.value;if(i.type==="number"&&(e=e==""?null:parseFloat(e)),this._previousValue!==e){if(this._previousValue=e,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(e),!e)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let l=this.autocomplete.options?.find(d=>d.selected);if(l){let d=this._getDisplayValue(l.value);e!==d&&l.deselect(!1)}}if(this._canOpen()&&this._hasFocus()){let l=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(l)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_hasFocus(){return vi()===this._element.nativeElement}_floatLabel(t=!1){this._formField&&this._formField.floatLabel==="auto"&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let t=new pi(e=>{Wi(()=>{e.next()},{injector:this._environmentInjector})}),i=this.autocomplete.options?.changes.pipe(Pi(()=>this._positionStrategy.reapplyLastPosition()),Oi(0))??ui();return It(t,i).pipe(Pe(()=>this._zone.run(()=>{let e=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),e!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),ce(1)).subscribe(e=>this._setValueAndClose(e))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(t){let i=this.autocomplete;return i&&i.displayWith?i.displayWith(t):t}_assignOptionValue(t){let i=this._getDisplayValue(t);t==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(i??"")}_updateNativeInputValue(t){this._formField?this._formField._control.value=t:this._element.nativeElement.value=t,this._previousValue=t}_setValueAndClose(t){let i=this.autocomplete,e=t?t.source:this._pendingAutoselectedOption;e?(this._clearPreviousSelectedOption(e),this._assignOptionValue(e.value),this._onChange(e.value),i._emitSelectEvent(e),this._element.nativeElement.focus()):i.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(t,i){this.autocomplete?.options?.forEach(e=>{e!==t&&e.selected&&e.deselect(i)})}_openPanelInternal(t=this._element.nativeElement.value){if(this._attachOverlay(t),this._floatLabel(),this._trackedModal){let i=this.autocomplete.id;yi(this._trackedModal,"aria-owns",i)}}_attachOverlay(t){this.autocomplete;let i=this._overlayRef;i?(this._positionStrategy.setOrigin(this._getConnectedElement()),i.updateSize({width:this._getPanelWidth()})):(this._portal=new va(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),i=Aa(this._injector,this._getOverlayConfig()),this._overlayRef=i,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&i&&i.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(kt.HandsetLandscape).subscribe(l=>{l.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),i&&!i.hasAttached()&&(i.attach(this._portal),this._valueOnAttach=t,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let e=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&e!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=t=>{(t.keyCode===27&&!fe(t)||t.keyCode===38&&fe(t,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),t.stopPropagation(),t.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let t=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=t.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=t.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Sa({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass,panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let t=Ta(this._injector,this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){let i=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],e=this._aboveClass,l=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:e},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:e}],d;this.position==="above"?d=l:this.position==="below"?d=i:d=[...i,...l],t.withPositions(d)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let t=this.autocomplete;if(t.autoActiveFirstOption){let i=-1;for(let e=0;e<t.options.length;e++)if(!t.options.get(e).disabled){i=e;break}t._keyManager.