@mxtommy/kip 4.8.2 → 4.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/package.json +27 -4
- package/public/{chunk-BIYHVfJl.js → chunk-07zHjmg-.js} +1 -1
- package/public/{chunk-NnB8OYZt.js → chunk-0z3nIRXw.js} +1 -1
- package/public/{chunk-CCiqU2uY.js → chunk-B09jfNia.js} +1 -1
- package/public/{chunk-Bq-eHuZV.js → chunk-B0D54iJs.js} +1 -1
- package/public/{chunk-DfGLo6Tb.js → chunk-B0eE4udE.js} +1 -1
- package/public/{chunk-CkfPr-c5.js → chunk-B9nVBlGj.js} +1 -1
- package/public/{chunk-B8zRhoG8.js → chunk-BFpzxIIT.js} +1 -1
- package/public/{chunk-D_wrJJxl.js → chunk-BIb-xYiS.js} +1 -1
- package/public/{chunk-CSpA60X7.js → chunk-BJ-wyixK.js} +1 -1
- package/public/{chunk-Bb1mO304.js → chunk-BLEZOsfR.js} +1 -1
- package/public/{chunk-7lulvsGI.js → chunk-BN7A4g6c.js} +1 -1
- package/public/{chunk-h2q_pbbF.js → chunk-BTOTKeBo.js} +1 -1
- package/public/{chunk-DjavLLpP.js → chunk-BUguZ7cK.js} +1 -1
- package/public/{chunk-B8gfh4xf.js → chunk-BZx964-p.js} +1 -1
- package/public/{chunk-CcvYOops.js → chunk-BeM64etA.js} +1 -1
- package/public/{chunk-DSvdWjO4.js → chunk-BfiyH3nV.js} +1 -1
- package/public/{chunk-B_PiPxb4.js → chunk-BjINKQ03.js} +1 -1
- package/public/{chunk-BdBWqZzL.js → chunk-BpcNrtxJ.js} +1 -1
- package/public/{chunk-C4FGoLDg.js → chunk-BuvyF0y5.js} +1 -1
- package/public/{chunk-DGOvRnAo.js → chunk-C6b8CVno.js} +1 -1
- package/public/{chunk-BgyxBAyq.js → chunk-CCfhzpE8.js} +1 -1
- package/public/{chunk-CoEM_FqS.js → chunk-CHAFm_nM.js} +1 -1
- package/public/{chunk-D0MyVrEL.js → chunk-CIGP2YJm.js} +1 -1
- package/public/{chunk-Bhah8DNM.js → chunk-CLTHuhlN.js} +1 -1
- package/public/{chunk-B6XxnPxk.js → chunk-CLs_NL1y.js} +1 -1
- package/public/{chunk-Cr34s2uQ.js → chunk-COI6IBXH.js} +1 -1
- package/public/{chunk-BxV0O2fU.js → chunk-CQMVIDcp.js} +1 -1
- package/public/{chunk-CHKQxw6E.js → chunk-CXvWM_vF.js} +1 -1
- package/public/{chunk-Di5pPpU7.js → chunk-CYYBxjrc.js} +1 -1
- package/public/{chunk-BW4m3O2L.js → chunk-C_OZJltF.js} +1 -1
- package/public/{chunk-CjsnWLUr.js → chunk-Co2wVrD6.js} +1 -1
- package/public/{chunk-DMhuBqKs.js → chunk-CoCQ3DW2.js} +1 -1
- package/public/{chunk-DMoEBcor.js → chunk-CxPx4NZv.js} +1 -1
- package/public/{chunk-CdSWuWKr.js → chunk-CyVRpGoJ.js} +1 -1
- package/public/{chunk-Dv77RFHm.js → chunk-D-_-GUVr.js} +1 -1
- package/public/{chunk-CU8RPnsi.js → chunk-D1HYfaL_.js} +1 -1
- package/public/{chunk-DBA0eRqb.js → chunk-D2953Rfp.js} +1 -1
- package/public/{chunk-Cu9FE8cB.js → chunk-DIl1k00y.js} +1 -1
- package/public/{chunk-CyURmwWh.js → chunk-DPnbM-aB.js} +1 -1
- package/public/{chunk-8hkXyEzG.js → chunk-DTN-sa1K.js} +1 -1
- package/public/{chunk-C3CwUYvD.js → chunk-DUEKoZhd.js} +1 -1
- package/public/{chunk-COMZv7NY.js → chunk-DmkAKXR1.js} +1 -1
- package/public/{chunk-zg7II0hz.js → chunk-Do8wqING.js} +1 -1
- package/public/{chunk-oPq9Nexl.js → chunk-JhFkJS7i.js} +1 -1
- package/public/{chunk-CJIxuzvd.js → chunk-OeQDZKFO.js} +1 -1
- package/public/{chunk-Bz9bswDl.js → chunk-_zRMMvCu.js} +1 -1
- package/public/{chunk-D-xDPCf7.js → chunk-eQ1pa34Q.js} +1 -1
- package/public/{chunk-DVB9tiW3.js → chunk-ibauGmSP.js} +1 -1
- package/public/{chunk-oZiyAw_P.js → chunk-otzyItXL.js} +1 -1
- package/public/{chunk-B6AwCAvV.js → chunk-q9NoPvcx.js} +1 -1
- package/public/{chunk-B15lj2T8.js → chunk-szQs8fiq.js} +1 -1
- package/public/{chunk-o977r5_s.js → chunk-x7L6DXVK.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-BNR44HGB.js → main-YKDNK5VZ.js} +4 -4
- package/plugin/history-series.service.js +0 -637
- package/plugin/index.js +0 -1322
- package/plugin/kip-series-contract.js +0 -31
- package/plugin/openApi.json +0 -855
- package/plugin/sqlite-history-storage.service.js +0 -1124
- package/plugin/src/history-series.service.js +0 -634
- package/plugin/src/index.js +0 -1322
- package/plugin/src/kip-series-contract.js +0 -31
- package/plugin/src/openApi.json +0 -855
- package/plugin/src/sqlite-history-storage.service.js +0 -1122
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxtommy/kip",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.4",
|
|
4
4
|
"description": "An advanced and versatile marine instrumentation package to display Signal K data.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -37,7 +37,30 @@
|
|
|
37
37
|
],
|
|
38
38
|
"signalk": {
|
|
39
39
|
"appIcon": "assets/icon-72x72.png",
|
|
40
|
-
"displayName": "KIP Instrument MFD"
|
|
40
|
+
"displayName": "KIP Instrument MFD",
|
|
41
|
+
"screenshots": [
|
|
42
|
+
"./images/KIPDemo.png",
|
|
43
|
+
"./images/KipFreeboard-SK-1024.png",
|
|
44
|
+
"./images/exterior_user_installs.png"
|
|
45
|
+
],
|
|
46
|
+
"requires": [
|
|
47
|
+
"@signalk/freeboard-sk",
|
|
48
|
+
"sk-ais-status-plugin",
|
|
49
|
+
"@signalk/server-api"
|
|
50
|
+
],
|
|
51
|
+
"recommends": [
|
|
52
|
+
"@meri-imperiumi/signalk-mob-notifier",
|
|
53
|
+
"@signalk/signalk-autopilot",
|
|
54
|
+
"pypilot-autopilot-provider",
|
|
55
|
+
"signalk-to-influxdb2",
|
|
56
|
+
"signalk-polar-performance-plugin",
|
|
57
|
+
"signalk-racer",
|
|
58
|
+
"signalk-anchoralarm-plugin",
|
|
59
|
+
"signalk-tides",
|
|
60
|
+
"@meri-imperiumi/signalk-autostate",
|
|
61
|
+
"signalk-venus-plugin",
|
|
62
|
+
"signalk-victron-battery-monitor"
|
|
63
|
+
]
|
|
41
64
|
},
|
|
42
65
|
"main": "plugin/index.js",
|
|
43
66
|
"files": [
|
|
@@ -115,7 +138,6 @@
|
|
|
115
138
|
"rxjs": "^7.8.2",
|
|
116
139
|
"sass": "^1.49.9",
|
|
117
140
|
"screenfull": "^6.0.2",
|
|
118
|
-
"sk-ais-status-plugin": "^1.0.0",
|
|
119
141
|
"steelseries": "^2.0.9",
|
|
120
142
|
"ts-node": "^10.9.2",
|
|
121
143
|
"tslib": "^2.6.2",
|
|
@@ -123,6 +145,7 @@
|
|
|
123
145
|
"vitest": "^4.1.0"
|
|
124
146
|
},
|
|
125
147
|
"dependencies": {
|
|
126
|
-
"@signalk/server-api": "^2.22.0"
|
|
148
|
+
"@signalk/server-api": "^2.22.0",
|
|
149
|
+
"sk-ais-status-plugin": "^1.0.0"
|
|
127
150
|
}
|
|
128
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {w,dc as O,dd as $e,J as JD,b2 as Ln,b3 as Gn,b4 as Xe,b5 as Pn,b6 as kn,b7 as ft,b9 as rn,ba as Qt,de as Nt,df as Vt,bb as rt,bc as ae,bd as an,be as It,bt as u,dh as zt,bh as xp,di as jt,h as Fw,P as Pi,k as Qh,T as TT,u as ul,_ as _w,c as $h,bi as Eg,l as ud,bj as ST,m as dd,bk as cD,bl as Jw,e as EE,aA as gg,M as Mw,bm as Ig,B as Bh,bn as FT,bo as lD,g as qw,bp as gl}from'./main-
|
|
1
|
+
import {w,dc as O,dd as $e,J as JD,b2 as Ln,b3 as Gn,b4 as Xe,b5 as Pn,b6 as kn,b7 as ft,b9 as rn,ba as Qt,de as Nt,df as Vt,bb as rt,bc as ae,bd as an,be as It,bt as u,dh as zt,bh as xp,di as jt,h as Fw,P as Pi,k as Qh,T as TT,u as ul,_ as _w,c as $h,bi as Eg,l as ud,bj as ST,m as dd,bk as cD,bl as Jw,e as EE,aA as gg,M as Mw,bm as Ig,B as Bh,bn as FT,bo as lD,g as qw,bp as gl}from'./main-YKDNK5VZ.js';var X=()=>({standalone:false});function Z(a,$){if(a&1&&(Pi(0,"div",3),$h(1,"i",10),TT(2),ul()),a&2){let p=qw();EE(2),gl(" ",p.data.error," ");}}var me=(()=>{class a{dialogRef=w(O);data=w($e);titleDialog="Sign in to Signal K";saveCredential(){this.data.error=null,this.dialogRef.close(this.data);}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=JD({type:a,selectors:[["app-modal-user-credential"]],decls:26,vars:10,consts:[["login","ngForm"],["name","login",3,"ngSubmit"],["mat-dialog-title",""],[1,"errorMsgBox"],[1,"login-grid"],[1,"userLoginInput"],["type","text","autocomplete","username","id","username","matInput","","placeholder","User ID","name","username","required","",3,"ngModelChange","ngModel","ngModelOptions"],["type","password","autocomplete","current-password","autocapitalize","off","autocorrect","off","spellcheck","false","id","current-password","matInput","","placeholder","Password","name","current-password","required","",3,"ngModelChange","ngModel","ngModelOptions"],["mat-flat-button","","type","button",3,"mat-dialog-close"],["mat-flat-button","","type","submit",3,"disabled"],["aria-hidden","true",1,"fa-solid","fa-times-circle",2,"color","red","padding-right","5px"]],template:function(d,i){if(d&1){let s=Fw();Pi(0,"form",1,0),Qh("ngSubmit",function(){return i.saveCredential()}),Pi(2,"span",2),TT(3),ul(),Pi(4,"mat-dialog-content"),_w(5,Z,3,1,"div",3),$h(6,"br"),Pi(7,"div",4)(8,"mat-form-field",5)(9,"mat-label"),TT(10,"User ID"),ul(),Pi(11,"input",6),Eg("ngModelChange",function(r){return ud(s),ST(i.data.user,r)||(i.data.user=r),dd(r)}),ul(),cD(),Pi(12,"mat-error"),TT(13," You must enter a User ID value "),ul()(),Pi(14,"mat-form-field",5)(15,"mat-label"),TT(16,"Password"),ul(),Pi(17,"input",7),Eg("ngModelChange",function(r){return ud(s),ST(i.data.password,r)||(i.data.password=r),dd(r)}),ul(),cD(),Pi(18,"mat-error"),TT(19," You must enter a password value "),ul()()()(),$h(20,"mat-divider"),Pi(21,"mat-dialog-actions")(22,"button",8),TT(23,"Cancel"),ul(),Pi(24,"button",9),TT(25,"Sign in"),ul()()();}if(d&2){let s=Jw(1);EE(3),gg(i.titleDialog),EE(2),Mw(i.data.error?5:-1),EE(6),Ig("ngModel",i.data.user),Bh("ngModelOptions",FT(8,X)),lD(),EE(6),Ig("ngModel",i.data.password),Bh("ngModelOptions",FT(9,X)),lD(),EE(5),Bh("mat-dialog-close",false),EE(2),Bh("disabled",!s.valid);}},dependencies:[Ln,Gn,Xe,Pn,kn,ft,rn,Qt,Nt,Vt,rt,ae,an,It,u,zt,xp,jt],styles:[".errorMsgBox[_ngcontent-%COMP%]{background-color:#fff8dc;color:#2f4f4f;display:flex;padding:5px;font-family:Arial,Times,serif;font-size:14px}.login-grid[_ngcontent-%COMP%]{display:grid;gap:10px;padding-left:10px;padding-right:10px}.userLoginInput[_ngcontent-%COMP%]{margin-bottom:10px}"]})}return a})();export{me as m};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {O}from'./chunk-o977r5_s.js';import {m as me}from'./chunk-BIYHVfJl.js';import {J as JD,aO as Sn$1,aP as Nt,c as $h,P as Pi,u as ul,B as Bh,w,aQ as ee,G as Gi$1,N,aR as lt,aS as De,aT as T,aU as I,aV as We,aW as w$1,aX as He$1,aY as xe,a7 as Gj,aZ as R,$ as $j,D as Dt$1,a_ as Gp,a$ as Zr,b0 as Wl,b1 as U,b2 as Ln$1,b3 as Gn$1,b4 as Xe,b5 as Pn$1,b6 as kn$1,b7 as ft$1,b8 as Ht,b9 as rn,ba as Qt,bb as rt,bc as ae,bd as an$1,be as It$1,bf as Kt,bg as mt,bh as xp,h as Fw,k as Qh,T as TT,bi as Eg,l as ud,bj as ST,m as dd,bk as cD,bl as Jw,e as EE,bm as Ig,bn as FT,bo as lD,bp as gl,bq as yg,br as vg,f as eg,K as Kw,i as ir,W as Wp,E as Em,bs as dp,bt as u,_ as _w,M as Mw,bu as ut$1,bv as Tn$1,bw as Bn$1,bx as Wn,by as gn$1,bz as hn$1,bA as Ft,bB as F,bC as Qa,X as xw,bD as HT,Y as Aw,bE as $T,bF as w$2,v as vt$1,bG as Bj,r as f,O as Op,bH as ln,bI as Lt,bJ as va,bK as an$2,bL as ft$2,t as pT,bM as Ge,bN as Hn$1,bO as ve,F as Fa,bP as si,a6 as Lr,bQ as Dn$1,aa as N$1,bR as ot,ad as Qe,aD as Ce$1,bS as oa$1,bT as Lg,ac as Mr,U as Kh,bU as jt,ay as lv,al as Zj,bV as Gw,bW as zw,s as sg,an as Hh,am as LT,bX as L,bY as m,bZ as Po,az as Yj,b_ as Gh,b$ as Jh,c0 as Zw,c1 as Yw,c2 as bh,c3 as Qs,c4 as Fn$1,c5 as Ut,c6 as Ii,af as Tu,c7 as Ir,c8 as Sv,ak as nw,c9 as Sh,ca as Kh$1,ap as Ki$1,aB as gr,ao as ue,aG as tD,ab as te,cb as E,cc as fn$1,av as _t$1,cd as N$2,ce as Ri,cf as xh,aH as j,cg as Ct,aj as zm,ch as Wo,ci as dl,cj as fl,d as ig,g as qw,aA as gg,S as ca,a9 as ru,ck as Nr,cl as G,cm as Kj,cn as wd,co as Mr$1,cp as Uh,cq as ie,cr as mg,cs as Sw,ct as Lh}from'./main-BNR44HGB.js';import'./chunk-h2q_pbbF.js';var tn=()=>[],nn=(n,u)=>u.key,an=(n,u)=>u.measure;function on(n,u){if(n&1&&(Pi(0,"mat-option",6),TT(1),ul()),n&2){let e=u.$implicit;Bh("value",e.measure),EE(),gg(e.description);}}function sn(n,u){if(n&1&&(Pi(0,"mat-form-field")(1,"mat-label"),TT(2),ul(),Pi(3,"mat-select",5),xw(4,on,2,2,"mat-option",6,an),ul(),cD(),ul()),n&2){let e=u.$implicit,t=qw();EE(2),gg(e.key),EE(),Bh("placeholder",e.key)("formControlName",e.key),lD(),EE(),Aw(t.groupUnits[e.key]??FT(3,tn));}}var Oi=(()=>{class n{units=w(ut$1);settings=w(Gi$1);toast=w(lt);unitsFormGroup=new Tn$1({});groupUnits={};ngOnInit(){let e=this.settings.getDefaultUnits(),t=this.units.getConversions();for(let i of t){if(i.group==="Position")continue;let s=[];for(let d of i.units)s.push(d);this.groupUnits[i.group]=s,this.unitsFormGroup.addControl(i.group,new Bn$1(e[i.group]));}this.unitsFormGroup.updateValueAndValidity();}submitConfig(){this.settings.setDefaultUnits(this.unitsFormGroup.value),this.toast.show("Configuration saved",1e3,true,"message");}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["settings-units"]],decls:11,vars:4,consts:[[2,"height","100%",3,"ngSubmit","formGroup"],[1,"unit-grid"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"],["required","",3,"placeholder","formControlName"],[3,"value"]],template:function(t,i){t&1&&(Pi(0,"form",0),Qh("ngSubmit",function(){return i.submitConfig()}),Pi(1,"p"),TT(2,"Configure your preferred default unit types. These defaults can be overridden within individual widget settings."),ul(),Pi(3,"div",1),xw(4,sn,6,4,"mat-form-field",null,nn),HT(6,"keyvalue"),ul(),Pi(7,"div",2),$h(8,"mat-divider",3),Pi(9,"button",4),TT(10,"Save"),ul()()()),t&2&&(Bh("formGroup",i.unitsFormGroup),EE(4),Aw($T(6,2,i.unitsFormGroup.controls)),EE(5),Bh("disabled",!i.unitsFormGroup.valid));},dependencies:[Ln$1,Gn$1,Pn$1,kn$1,ft$1,Wn,gn$1,hn$1,rt,ae,Ft,F,u,xp,Qa],styles:[".unit-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,auto));gap:10px}"]})}return n})();var Tt=new N$1("CdkAccordion"),Fi=(()=>{class n{_stateChanges=new te;_openCloseAllActions=new te;id=w(Mr).getId("cdk-accordion-");multi=false;openAll(){this.multi&&this._openCloseAllActions.next(true);}closeAll(){this._openCloseAllActions.next(false);}ngOnChanges(e){this._stateChanges.next(e);}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete();}static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",Zj]},exportAs:["cdkAccordion"],features:[LT([{provide:Tt,useExisting:n}]),lv]})}return n})(),Li=(()=>{class n{accordion=w(Tt,{optional:true,skipSelf:true});_changeDetectorRef=w(Gj);_expansionDispatcher=w(E);_openCloseAllSubscription=j.EMPTY;closed=new Qe;opened=new Qe;destroyed=new Qe;expandedChange=new Qe;id=w(Mr).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let t=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,t);}else this.closed.emit();this._changeDetectorRef.markForCheck();}}_expanded=false;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e);}_disabled=vt$1(false);_removeUniqueSelectionListener=()=>{};ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,t)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===t&&this.id!==e&&(this.expanded=false);}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions());}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe();}toggle(){this.disabled||(this.expanded=!this.expanded);}close(){this.disabled||(this.expanded=false);}open(){this.disabled||(this.expanded=true);}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e);})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",Zj],disabled:[2,"disabled","disabled",Zj]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[LT([{provide:Tt,useValue:void 0}])]})}return n})(),Ui=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=bh({type:n});static \u0275inj=Qs({})}return n})();var dn=["body"],cn=["bodyWrapper"],mn=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],hn=["mat-expansion-panel-header","*","mat-action-row"];function pn(n,u){}var gn=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],un=["mat-panel-title","mat-panel-description","*"];function _n(n,u){n&1&&(dl(0,"span",1),wd(),dl(1,"svg",2),Uh(2,"path",3),fl()());}var Et=new N$1("MAT_ACCORDION"),Bi=new N$1("MAT_EXPANSION_PANEL"),fn=(()=>{class n{_template=w(Mr$1);_expansionPanel=w(Bi,{optional:true});static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),Wi=new N$1("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),He=(()=>{class n extends Li{_viewContainerRef=w(Ki$1);_animationsDisabled=ot();_document=w(gr);_ngZone=w(ue);_elementRef=w(Lr);_renderer=w(tD);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e;}_hideToggle=false;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e;}_togglePosition;afterExpand=new Qe;afterCollapse=new Qe;_inputChanges=new te;accordion=w(Et,{optional:true,skipSelf:true});_lazyContent;_body;_bodyWrapper;_portal;_headerId=w(Mr).getId("mat-expansion-panel-header-");constructor(){super();let e=w(Wi,{optional:true});this._expansionDispatcher=w(E),e&&(this.hideToggle=e.hideToggle);}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":false}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded;}close(){this.expanded=false;}open(){this.expanded=true;}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(Tu(null),fn$1(()=>this.expanded&&!this._portal),_t$1(1)).subscribe(()=>{this._portal=new N$2(this._lazyContent._template,this._viewContainerRef);}),this._setupAnimationEvents();}ngOnChanges(e){this._inputChanges.next(e);}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete();}_containsFocus(){if(this._body){let e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return false}_transitionEndListener=({target:e,propertyName:t})=>{e===this._bodyWrapper?.nativeElement&&t==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit();});};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled");},200);});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,s){if(t&1&&Kh$1(s,fn,5),t&2){let d;Zw(d=Yw())&&(i._lazyContent=d.first);}},viewQuery:function(t,i){if(t&1&&Jh(dn,5)(cn,5),t&2){let s;Zw(s=Yw())&&(i._body=s.first),Zw(s=Yw())&&(i._bodyWrapper=s.first);}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(t,i){t&2&&sg("mat-expanded",i.expanded)("mat-expansion-panel-spacing",i._hasSpacing());},inputs:{hideToggle:[2,"hideToggle","hideToggle",Zj],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[LT([{provide:Et,useValue:void 0},{provide:Bi,useExisting:n}]),Sh,lv],ngContentSelectors:hn,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){t&1&&(Gw(mn),zw(0),Pi(1,"div",2,0)(3,"div",3,1)(5,"div",4),zw(6,1),xh(7,pn,0,0,"ng-template",5),ul(),zw(8,2),ul()()),t&2&&(EE(),Hh("inert",i.expanded?null:""),EE(2),Bh("id",i.id),Hh("aria-labelledby",i._headerId),EE(4),Bh("cdkPortalOutlet",i._portal));},dependencies:[Ri],styles:[`.mat-expansion-panel {
|
|
1
|
+
import {O}from'./chunk-x7L6DXVK.js';import {m as me}from'./chunk-07zHjmg-.js';import {J as JD,aO as Sn$1,aP as Nt,c as $h,P as Pi,u as ul,B as Bh,w,aQ as ee,G as Gi$1,N,aR as lt,aS as De,aT as T,aU as I,aV as We,aW as w$1,aX as He$1,aY as xe,a7 as Gj,aZ as R,$ as $j,D as Dt$1,a_ as Gp,a$ as Zr,b0 as Wl,b1 as U,b2 as Ln$1,b3 as Gn$1,b4 as Xe,b5 as Pn$1,b6 as kn$1,b7 as ft$1,b8 as Ht,b9 as rn,ba as Qt,bb as rt,bc as ae,bd as an$1,be as It$1,bf as Kt,bg as mt,bh as xp,h as Fw,k as Qh,T as TT,bi as Eg,l as ud,bj as ST,m as dd,bk as cD,bl as Jw,e as EE,bm as Ig,bn as FT,bo as lD,bp as gl,bq as yg,br as vg,f as eg,K as Kw,i as ir,W as Wp,E as Em,bs as dp,bt as u,_ as _w,M as Mw,bu as ut$1,bv as Tn$1,bw as Bn$1,bx as Wn,by as gn$1,bz as hn$1,bA as Ft,bB as F,bC as Qa,X as xw,bD as HT,Y as Aw,bE as $T,bF as w$2,v as vt$1,bG as Bj,r as f,O as Op,bH as ln,bI as Lt,bJ as va,bK as an$2,bL as ft$2,t as pT,bM as Ge,bN as Hn$1,bO as ve,F as Fa,bP as si,a6 as Lr,bQ as Dn$1,aa as N$1,bR as ot,ad as Qe,aD as Ce$1,bS as oa$1,bT as Lg,ac as Mr,U as Kh,bU as jt,ay as lv,al as Zj,bV as Gw,bW as zw,s as sg,an as Hh,am as LT,bX as L,bY as m,bZ as Po,az as Yj,b_ as Gh,b$ as Jh,c0 as Zw,c1 as Yw,c2 as bh,c3 as Qs,c4 as Fn$1,c5 as Ut,c6 as Ii,af as Tu,c7 as Ir,c8 as Sv,ak as nw,c9 as Sh,ca as Kh$1,ap as Ki$1,aB as gr,ao as ue,aG as tD,ab as te,cb as E,cc as fn$1,av as _t$1,cd as N$2,ce as Ri,cf as xh,aH as j,cg as Ct,aj as zm,ch as Wo,ci as dl,cj as fl,d as ig,g as qw,aA as gg,S as ca,a9 as ru,ck as Nr,cl as G,cm as Kj,cn as wd,co as Mr$1,cp as Uh,cq as ie,cr as mg,cs as Sw,ct as Lh}from'./main-YKDNK5VZ.js';import'./chunk-BTOTKeBo.js';var tn=()=>[],nn=(n,u)=>u.key,an=(n,u)=>u.measure;function on(n,u){if(n&1&&(Pi(0,"mat-option",6),TT(1),ul()),n&2){let e=u.$implicit;Bh("value",e.measure),EE(),gg(e.description);}}function sn(n,u){if(n&1&&(Pi(0,"mat-form-field")(1,"mat-label"),TT(2),ul(),Pi(3,"mat-select",5),xw(4,on,2,2,"mat-option",6,an),ul(),cD(),ul()),n&2){let e=u.$implicit,t=qw();EE(2),gg(e.key),EE(),Bh("placeholder",e.key)("formControlName",e.key),lD(),EE(),Aw(t.groupUnits[e.key]??FT(3,tn));}}var Oi=(()=>{class n{units=w(ut$1);settings=w(Gi$1);toast=w(lt);unitsFormGroup=new Tn$1({});groupUnits={};ngOnInit(){let e=this.settings.getDefaultUnits(),t=this.units.getConversions();for(let i of t){if(i.group==="Position")continue;let s=[];for(let d of i.units)s.push(d);this.groupUnits[i.group]=s,this.unitsFormGroup.addControl(i.group,new Bn$1(e[i.group]));}this.unitsFormGroup.updateValueAndValidity();}submitConfig(){this.settings.setDefaultUnits(this.unitsFormGroup.value),this.toast.show("Configuration saved",1e3,true,"message");}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["settings-units"]],decls:11,vars:4,consts:[[2,"height","100%",3,"ngSubmit","formGroup"],[1,"unit-grid"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"],["required","",3,"placeholder","formControlName"],[3,"value"]],template:function(t,i){t&1&&(Pi(0,"form",0),Qh("ngSubmit",function(){return i.submitConfig()}),Pi(1,"p"),TT(2,"Configure your preferred default unit types. These defaults can be overridden within individual widget settings."),ul(),Pi(3,"div",1),xw(4,sn,6,4,"mat-form-field",null,nn),HT(6,"keyvalue"),ul(),Pi(7,"div",2),$h(8,"mat-divider",3),Pi(9,"button",4),TT(10,"Save"),ul()()()),t&2&&(Bh("formGroup",i.unitsFormGroup),EE(4),Aw($T(6,2,i.unitsFormGroup.controls)),EE(5),Bh("disabled",!i.unitsFormGroup.valid));},dependencies:[Ln$1,Gn$1,Pn$1,kn$1,ft$1,Wn,gn$1,hn$1,rt,ae,Ft,F,u,xp,Qa],styles:[".unit-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,auto));gap:10px}"]})}return n})();var Tt=new N$1("CdkAccordion"),Fi=(()=>{class n{_stateChanges=new te;_openCloseAllActions=new te;id=w(Mr).getId("cdk-accordion-");multi=false;openAll(){this.multi&&this._openCloseAllActions.next(true);}closeAll(){this._openCloseAllActions.next(false);}ngOnChanges(e){this._stateChanges.next(e);}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete();}static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",Zj]},exportAs:["cdkAccordion"],features:[LT([{provide:Tt,useExisting:n}]),lv]})}return n})(),Li=(()=>{class n{accordion=w(Tt,{optional:true,skipSelf:true});_changeDetectorRef=w(Gj);_expansionDispatcher=w(E);_openCloseAllSubscription=j.EMPTY;closed=new Qe;opened=new Qe;destroyed=new Qe;expandedChange=new Qe;id=w(Mr).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let t=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,t);}else this.closed.emit();this._changeDetectorRef.markForCheck();}}_expanded=false;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e);}_disabled=vt$1(false);_removeUniqueSelectionListener=()=>{};ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,t)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===t&&this.id!==e&&(this.expanded=false);}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions());}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe();}toggle(){this.disabled||(this.expanded=!this.expanded);}close(){this.disabled||(this.expanded=false);}open(){this.disabled||(this.expanded=true);}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e);})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",Zj],disabled:[2,"disabled","disabled",Zj]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[LT([{provide:Tt,useValue:void 0}])]})}return n})(),Ui=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=bh({type:n});static \u0275inj=Qs({})}return n})();var dn=["body"],cn=["bodyWrapper"],mn=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],hn=["mat-expansion-panel-header","*","mat-action-row"];function pn(n,u){}var gn=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],un=["mat-panel-title","mat-panel-description","*"];function _n(n,u){n&1&&(dl(0,"span",1),wd(),dl(1,"svg",2),Uh(2,"path",3),fl()());}var Et=new N$1("MAT_ACCORDION"),Bi=new N$1("MAT_EXPANSION_PANEL"),fn=(()=>{class n{_template=w(Mr$1);_expansionPanel=w(Bi,{optional:true});static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),Wi=new N$1("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),He=(()=>{class n extends Li{_viewContainerRef=w(Ki$1);_animationsDisabled=ot();_document=w(gr);_ngZone=w(ue);_elementRef=w(Lr);_renderer=w(tD);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e;}_hideToggle=false;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e;}_togglePosition;afterExpand=new Qe;afterCollapse=new Qe;_inputChanges=new te;accordion=w(Et,{optional:true,skipSelf:true});_lazyContent;_body;_bodyWrapper;_portal;_headerId=w(Mr).getId("mat-expansion-panel-header-");constructor(){super();let e=w(Wi,{optional:true});this._expansionDispatcher=w(E),e&&(this.hideToggle=e.hideToggle);}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":false}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded;}close(){this.expanded=false;}open(){this.expanded=true;}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(Tu(null),fn$1(()=>this.expanded&&!this._portal),_t$1(1)).subscribe(()=>{this._portal=new N$2(this._lazyContent._template,this._viewContainerRef);}),this._setupAnimationEvents();}ngOnChanges(e){this._inputChanges.next(e);}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete();}_containsFocus(){if(this._body){let e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return false}_transitionEndListener=({target:e,propertyName:t})=>{e===this._bodyWrapper?.nativeElement&&t==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit();});};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled");},200);});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,s){if(t&1&&Kh$1(s,fn,5),t&2){let d;Zw(d=Yw())&&(i._lazyContent=d.first);}},viewQuery:function(t,i){if(t&1&&Jh(dn,5)(cn,5),t&2){let s;Zw(s=Yw())&&(i._body=s.first),Zw(s=Yw())&&(i._bodyWrapper=s.first);}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(t,i){t&2&&sg("mat-expanded",i.expanded)("mat-expansion-panel-spacing",i._hasSpacing());},inputs:{hideToggle:[2,"hideToggle","hideToggle",Zj],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[LT([{provide:Et,useValue:void 0},{provide:Bi,useExisting:n}]),Sh,lv],ngContentSelectors:hn,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){t&1&&(Gw(mn),zw(0),Pi(1,"div",2,0)(3,"div",3,1)(5,"div",4),zw(6,1),xh(7,pn,0,0,"ng-template",5),ul(),zw(8,2),ul()()),t&2&&(EE(),Hh("inert",i.expanded?null:""),EE(2),Bh("id",i.id),Hh("aria-labelledby",i._headerId),EE(4),Bh("cdkPortalOutlet",i._portal));},dependencies:[Ri],styles:[`.mat-expansion-panel {
|
|
2
2
|
box-sizing: content-box;
|
|
3
3
|
display: block;
|
|
4
4
|
margin: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {k}from'./chunk-DfGLo6Tb.js';import {d1 as Hj,w,du as p,dv as rt,dD as _$1,bu as ut,v as vt,D as Dt,F as Fa,dn as ge,J as JD,c as $h,B as Bh,$ as $j,cn as wd,ci as dl,cp as Uh,cj as fl,X as xw,cs as Sw,T as TT,e as EE,an as Hh,d as ig,Y as Aw,bp as gl,aA as gg,f as eg,K as Kw,g as qw,dx as n$1}from'./main-BNR44HGB.js';import {c}from'./chunk-D_wrJJxl.js';var O=["gaugeBarAnimate"];function Z(n,U){if(n&1&&(wd(),Uh(0,"rect",14)),n&2){let t=U.$implicit,a=qw();Hh("fill",t.color)("x",5+(t.from-a.gaugeMinValue())*a.scaleSliceValue())("width",(t.to-t.from)*a.scaleSliceValue());}}var _=(()=>{class n{gaugeBarAnimate=$j("gaugeBarAnimate");displayName=Hj.required();displayNameColor=Hj.required();dataValue=Hj.required();dataValueLabel=Hj.required();unitLabel=Hj.required();barColor=Hj.required();barColorGradient=Hj.required();barColorBackground=Hj.required();gaugeMinValue=Hj.required();gaugeMaxValue=Hj.required();highlights=Hj.required();scaleSliceValue=Dt(()=>{let t=this.gaugeMaxValue()-this.gaugeMinValue();return t!==0?195/t:0});newGaugeValue=vt(null);oldGaugeValue=vt(null);firstRenderApplied=false;scheduleRafId=null;constructor(){Fa(()=>{let t=this.gaugeMinValue(),a=this.dataValue();a==null&&(a=t);let e=(a-t)*this.scaleSliceValue();ge(()=>{let o=this.newGaugeValue();!this.firstRenderApplied||o===null?(this.oldGaugeValue.set(e),this.newGaugeValue.set(e),this.firstRenderApplied=true):(this.oldGaugeValue.set(o),this.newGaugeValue.set(e)),this.gaugeBarAnimate()?.nativeElement&&(this.scheduleRafId!==null&&cancelAnimationFrame(this.scheduleRafId),this.scheduleRafId=requestAnimationFrame(()=>{let r=this.gaugeBarAnimate();r?.nativeElement&&r.nativeElement.beginElement(),this.scheduleRafId=null;}));});});}ngOnDestroy(){this.scheduleRafId!==null&&(cancelAnimationFrame(this.scheduleRafId),this.scheduleRafId=null);}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=JD({type:n,selectors:[["svg-simple-linear-gauge"]],viewQuery:function(a,e){a&1&&eg(e.gaugeBarAnimate,O,5),a&2&&Kw();},inputs:{displayName:[1,"displayName"],displayNameColor:[1,"displayNameColor"],dataValue:[1,"dataValue"],dataValueLabel:[1,"dataValueLabel"],unitLabel:[1,"unitLabel"],barColor:[1,"barColor"],barColorGradient:[1,"barColorGradient"],barColorBackground:[1,"barColorBackground"],gaugeMinValue:[1,"gaugeMinValue"],gaugeMaxValue:[1,"gaugeMaxValue"],highlights:[1,"highlights"]},decls:26,vars:11,consts:[["gaugeBarAnimate",""],["viewBox","0 0 205 50","preserveAspectRatio","xMidYMid","version","1.1","id","svg8",1,"svg-simple-linear"],["id","defs2"],["id","gaugeBarGradient"],["id","stop849","offset","0",2,"stop-opacity","1"],["id","stop851","offset","0.40",2,"stop-opacity","0"],["id","linearGradient855","gradientTransform","translate(5,-30)","gradientUnits","userSpaceOnUse","y2","34.5","x2","-5","y1","34.5","x1","-6","href","#gaugeBarGradient"],["id","layer1",2,"display","inline"],["id","GaugeBackground","width","195","height","9","x","5","y","30","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","gaugeBar"],["id","gaugeValue","width","1","height","9","x","0","y","0","ry","0",2,"mix-blend-mode","normal","fill-opacity","1","stroke","none"],["id","gaugeValueGradient","transform","scale(-1,1)","width","1","height","9","x","-1","y","0","ry","0",2,"display","inline","opacity","1","mix-blend-mode","multiply","fill","url(#linearGradient855)","stroke","none"],[0,"xlink","href","#gaugeBar","transform","translate(5,30)"],["attributeName","transform","type","scale","begin","indefinite","dur","0.5s","additive","sum","fill","freeze"],["y","39.5","height","0.75","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","layer2",2,"display","inline"],[0,"xml","space","preserve","x","4.1731763","y","25.413595","id","displayNameText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["id","tspan1945","x","4.1731763","y","25.413595",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["text-anchor","end","id","gaugeTexts","y","25.293016","x","200.37138",0,"xml","space","preserve",1,"simpleLinear-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["y","25.293016","x","200.37138","id","valueText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["dy","-9","id","unitText",2,"text-transform","capitalize","font-size","9.87778px"]],template:function(a,e){a&1&&(wd(),dl(0,"svg",1)(1,"defs",2)(2,"linearGradient",3),Uh(3,"stop",4)(4,"stop",5),fl(),Uh(5,"linearGradient",6),fl(),dl(6,"g",7),Uh(7,"rect",8),dl(8,"defs")(9,"g",9),Uh(10,"rect",10)(11,"rect",11),fl()(),dl(12,"use",12),Uh(13,"animateTransform",13,0),fl(),xw(15,Z,1,3,":svg:rect",14,Sw),fl(),dl(17,"g",15)(18,"text",16)(19,"tspan",17),TT(20),fl()(),dl(21,"text",18)(22,"tspan",19),TT(23),fl(),dl(24,"tspan",20),TT(25),fl()()()()),a&2&&(EE(3),Hh("stop-color",e.barColorGradient()),EE(),Hh("stop-color",e.barColorGradient()),EE(3),Hh("fill",e.barColorBackground()),EE(5),ig("fill",e.barColor()),EE(),Hh("from",e.oldGaugeValue()+" 1")("to",e.newGaugeValue()+" 1"),EE(2),Aw(e.highlights()),EE(4),Hh("fill",e.displayNameColor()),EE(),gl(" ",e.displayName()),EE(3),gg(e.dataValueLabel()),EE(2),gg(e.unitLabel()));},styles:["svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.simpleLinear-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}"]})}return n})();var oe=(()=>{class n{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:true,showPathSkUnitsFilter:true,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,ignoreZones:false,color:"contrast",enableTimeout:false,dataTimeout:5};runtime=w(p);streams=w(rt);metadata=w(_$1,{optional:true});unitsService=w(ut);unitsLabel=vt("");dataLabelValue=vt("0");dataValue=vt(0);barColor=vt("");barColorGradient=vt("");barColorBackground=vt("");cfg=Dt(()=>this.runtime.options()??n.DEFAULT_CONFIG);displayNameSafe=Dt(()=>this.cfg().displayName??"Gauge Label");gaugeMaxValue=Dt(()=>this.cfg().displayScale?.upper??15);gaugeMinValue=Dt(()=>this.cfg().displayScale?.lower??0);gaugePathConfig=Dt(()=>this.cfg().paths?.gaugePath);highlights=Dt(()=>{let t=this.cfg(),a=this.theme(),e=this.gaugePathConfig();if(!a)return [];if(t.ignoreZones||!this.metadata)return [];let o=this.metadata.zones();if(!o?.length)return [];let r=e?.convertUnitTo??"",y=t.displayScale?.lower??0,u=t.displayScale?.upper??15;return k(o,a,r,this.unitsService,y,u)});lastState=null;constructor(){Fa(()=>{let t=this.cfg(),a=this.gaugePathConfig();a?.path&&ge(()=>{this.streams.observe("gaugePath",o=>{let r=this.theme();if(!r)return;let y=o?.data?.value;if(y==null)this.dataValue.set(t.displayScale?.lower??0),this.dataLabelValue.set("--");else {let u=Math.min(Math.max(y,t.displayScale?.lower??0),t.displayScale?.upper??15);this.dataValue.set(u),this.dataLabelValue.set(u.toFixed(t.numDecimal??2));}if(!t.ignoreZones){let u=o?.state;if(u&&u!==this.lastState)switch(this.lastState=u,u){case n$1.Alarm:this.barColor.set(r.zoneAlarm);break;case n$1.Warn:this.barColor.set(r.zoneWarn);break;case n$1.Alert:this.barColor.set(r.zoneAlert);break;case n$1.Nominal:this.barColor.set(r.zoneNominal);break;default:this.barColor.set(c(t.color??"contrast",r).color);break}}});let e=a.convertUnitTo??"";this.unitsLabel.set(t.gauge?.unitLabelFormat==="abr"?e.substring(0,1):e);});}),Fa(()=>{let t=this.cfg(),a=this.theme();a&&ge(()=>{this.barColorBackground.set(a.background);let e=c(t.color??"contrast",a);if(t.ignoreZones)this.barColor.set(e.color);else if(this.lastState)switch(this.lastState){case n$1.Alarm:this.barColor.set(a.zoneAlarm);break;case n$1.Warn:this.barColor.set(a.zoneWarn);break;case n$1.Alert:this.barColor.set(a.zoneAlert);break;case n$1.Nominal:this.barColor.set(a.zoneNominal);break;default:this.barColor.set(e.color);break}else this.barColor.set(e.color);this.barColorGradient.set(e.dimmer||e.dim||e.color);});}),Fa(()=>{let t=this.cfg(),a=this.metadata;t.ignoreZones||!a||ge(()=>a.observe("gaugePath"));});}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=JD({type:n,selectors:[["widget-simple-linear"]],inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:11,consts:[[1,"simpleLinearGaugeContainer",3,"displayName","displayNameColor","unitLabel","dataValue","dataValueLabel","barColor","barColorGradient","barColorBackground","gaugeMaxValue","gaugeMinValue","highlights"]],template:function(a,e){if(a&1&&$h(0,"svg-simple-linear-gauge",0),a&2){let o;Bh("displayName",e.displayNameSafe())("displayNameColor",(o=e.theme())==null?null:o.contrastDim)("unitLabel",e.unitsLabel())("dataValue",e.dataValue())("dataValueLabel",e.dataLabelValue())("barColor",e.barColor())("barColorGradient",e.barColorGradient())("barColorBackground",e.barColorBackground())("gaugeMaxValue",e.gaugeMaxValue())("gaugeMinValue",e.gaugeMinValue())("highlights",e.highlights());}},dependencies:[_],styles:[".simpleLinearGaugeContainer[_ngcontent-%COMP%]{display:block;position:relative;height:100%;width:100%;padding:0}"]})}return n})();export{oe as WidgetSimpleLinearComponent};
|
|
1
|
+
import {k}from'./chunk-B0eE4udE.js';import {d1 as Hj,w,du as p,dv as rt,dD as _$1,bu as ut,v as vt,D as Dt,F as Fa,dn as ge,J as JD,c as $h,B as Bh,$ as $j,cn as wd,ci as dl,cp as Uh,cj as fl,X as xw,cs as Sw,T as TT,e as EE,an as Hh,d as ig,Y as Aw,bp as gl,aA as gg,f as eg,K as Kw,g as qw,dx as n$1}from'./main-YKDNK5VZ.js';import {c}from'./chunk-BIb-xYiS.js';var O=["gaugeBarAnimate"];function Z(n,U){if(n&1&&(wd(),Uh(0,"rect",14)),n&2){let t=U.$implicit,a=qw();Hh("fill",t.color)("x",5+(t.from-a.gaugeMinValue())*a.scaleSliceValue())("width",(t.to-t.from)*a.scaleSliceValue());}}var _=(()=>{class n{gaugeBarAnimate=$j("gaugeBarAnimate");displayName=Hj.required();displayNameColor=Hj.required();dataValue=Hj.required();dataValueLabel=Hj.required();unitLabel=Hj.required();barColor=Hj.required();barColorGradient=Hj.required();barColorBackground=Hj.required();gaugeMinValue=Hj.required();gaugeMaxValue=Hj.required();highlights=Hj.required();scaleSliceValue=Dt(()=>{let t=this.gaugeMaxValue()-this.gaugeMinValue();return t!==0?195/t:0});newGaugeValue=vt(null);oldGaugeValue=vt(null);firstRenderApplied=false;scheduleRafId=null;constructor(){Fa(()=>{let t=this.gaugeMinValue(),a=this.dataValue();a==null&&(a=t);let e=(a-t)*this.scaleSliceValue();ge(()=>{let o=this.newGaugeValue();!this.firstRenderApplied||o===null?(this.oldGaugeValue.set(e),this.newGaugeValue.set(e),this.firstRenderApplied=true):(this.oldGaugeValue.set(o),this.newGaugeValue.set(e)),this.gaugeBarAnimate()?.nativeElement&&(this.scheduleRafId!==null&&cancelAnimationFrame(this.scheduleRafId),this.scheduleRafId=requestAnimationFrame(()=>{let r=this.gaugeBarAnimate();r?.nativeElement&&r.nativeElement.beginElement(),this.scheduleRafId=null;}));});});}ngOnDestroy(){this.scheduleRafId!==null&&(cancelAnimationFrame(this.scheduleRafId),this.scheduleRafId=null);}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=JD({type:n,selectors:[["svg-simple-linear-gauge"]],viewQuery:function(a,e){a&1&&eg(e.gaugeBarAnimate,O,5),a&2&&Kw();},inputs:{displayName:[1,"displayName"],displayNameColor:[1,"displayNameColor"],dataValue:[1,"dataValue"],dataValueLabel:[1,"dataValueLabel"],unitLabel:[1,"unitLabel"],barColor:[1,"barColor"],barColorGradient:[1,"barColorGradient"],barColorBackground:[1,"barColorBackground"],gaugeMinValue:[1,"gaugeMinValue"],gaugeMaxValue:[1,"gaugeMaxValue"],highlights:[1,"highlights"]},decls:26,vars:11,consts:[["gaugeBarAnimate",""],["viewBox","0 0 205 50","preserveAspectRatio","xMidYMid","version","1.1","id","svg8",1,"svg-simple-linear"],["id","defs2"],["id","gaugeBarGradient"],["id","stop849","offset","0",2,"stop-opacity","1"],["id","stop851","offset","0.40",2,"stop-opacity","0"],["id","linearGradient855","gradientTransform","translate(5,-30)","gradientUnits","userSpaceOnUse","y2","34.5","x2","-5","y1","34.5","x1","-6","href","#gaugeBarGradient"],["id","layer1",2,"display","inline"],["id","GaugeBackground","width","195","height","9","x","5","y","30","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","gaugeBar"],["id","gaugeValue","width","1","height","9","x","0","y","0","ry","0",2,"mix-blend-mode","normal","fill-opacity","1","stroke","none"],["id","gaugeValueGradient","transform","scale(-1,1)","width","1","height","9","x","-1","y","0","ry","0",2,"display","inline","opacity","1","mix-blend-mode","multiply","fill","url(#linearGradient855)","stroke","none"],[0,"xlink","href","#gaugeBar","transform","translate(5,30)"],["attributeName","transform","type","scale","begin","indefinite","dur","0.5s","additive","sum","fill","freeze"],["y","39.5","height","0.75","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","layer2",2,"display","inline"],[0,"xml","space","preserve","x","4.1731763","y","25.413595","id","displayNameText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["id","tspan1945","x","4.1731763","y","25.413595",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["text-anchor","end","id","gaugeTexts","y","25.293016","x","200.37138",0,"xml","space","preserve",1,"simpleLinear-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["y","25.293016","x","200.37138","id","valueText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["dy","-9","id","unitText",2,"text-transform","capitalize","font-size","9.87778px"]],template:function(a,e){a&1&&(wd(),dl(0,"svg",1)(1,"defs",2)(2,"linearGradient",3),Uh(3,"stop",4)(4,"stop",5),fl(),Uh(5,"linearGradient",6),fl(),dl(6,"g",7),Uh(7,"rect",8),dl(8,"defs")(9,"g",9),Uh(10,"rect",10)(11,"rect",11),fl()(),dl(12,"use",12),Uh(13,"animateTransform",13,0),fl(),xw(15,Z,1,3,":svg:rect",14,Sw),fl(),dl(17,"g",15)(18,"text",16)(19,"tspan",17),TT(20),fl()(),dl(21,"text",18)(22,"tspan",19),TT(23),fl(),dl(24,"tspan",20),TT(25),fl()()()()),a&2&&(EE(3),Hh("stop-color",e.barColorGradient()),EE(),Hh("stop-color",e.barColorGradient()),EE(3),Hh("fill",e.barColorBackground()),EE(5),ig("fill",e.barColor()),EE(),Hh("from",e.oldGaugeValue()+" 1")("to",e.newGaugeValue()+" 1"),EE(2),Aw(e.highlights()),EE(4),Hh("fill",e.displayNameColor()),EE(),gl(" ",e.displayName()),EE(3),gg(e.dataValueLabel()),EE(2),gg(e.unitLabel()));},styles:["svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.simpleLinear-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}"]})}return n})();var oe=(()=>{class n{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:true,showPathSkUnitsFilter:true,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,ignoreZones:false,color:"contrast",enableTimeout:false,dataTimeout:5};runtime=w(p);streams=w(rt);metadata=w(_$1,{optional:true});unitsService=w(ut);unitsLabel=vt("");dataLabelValue=vt("0");dataValue=vt(0);barColor=vt("");barColorGradient=vt("");barColorBackground=vt("");cfg=Dt(()=>this.runtime.options()??n.DEFAULT_CONFIG);displayNameSafe=Dt(()=>this.cfg().displayName??"Gauge Label");gaugeMaxValue=Dt(()=>this.cfg().displayScale?.upper??15);gaugeMinValue=Dt(()=>this.cfg().displayScale?.lower??0);gaugePathConfig=Dt(()=>this.cfg().paths?.gaugePath);highlights=Dt(()=>{let t=this.cfg(),a=this.theme(),e=this.gaugePathConfig();if(!a)return [];if(t.ignoreZones||!this.metadata)return [];let o=this.metadata.zones();if(!o?.length)return [];let r=e?.convertUnitTo??"",y=t.displayScale?.lower??0,u=t.displayScale?.upper??15;return k(o,a,r,this.unitsService,y,u)});lastState=null;constructor(){Fa(()=>{let t=this.cfg(),a=this.gaugePathConfig();a?.path&&ge(()=>{this.streams.observe("gaugePath",o=>{let r=this.theme();if(!r)return;let y=o?.data?.value;if(y==null)this.dataValue.set(t.displayScale?.lower??0),this.dataLabelValue.set("--");else {let u=Math.min(Math.max(y,t.displayScale?.lower??0),t.displayScale?.upper??15);this.dataValue.set(u),this.dataLabelValue.set(u.toFixed(t.numDecimal??2));}if(!t.ignoreZones){let u=o?.state;if(u&&u!==this.lastState)switch(this.lastState=u,u){case n$1.Alarm:this.barColor.set(r.zoneAlarm);break;case n$1.Warn:this.barColor.set(r.zoneWarn);break;case n$1.Alert:this.barColor.set(r.zoneAlert);break;case n$1.Nominal:this.barColor.set(r.zoneNominal);break;default:this.barColor.set(c(t.color??"contrast",r).color);break}}});let e=a.convertUnitTo??"";this.unitsLabel.set(t.gauge?.unitLabelFormat==="abr"?e.substring(0,1):e);});}),Fa(()=>{let t=this.cfg(),a=this.theme();a&&ge(()=>{this.barColorBackground.set(a.background);let e=c(t.color??"contrast",a);if(t.ignoreZones)this.barColor.set(e.color);else if(this.lastState)switch(this.lastState){case n$1.Alarm:this.barColor.set(a.zoneAlarm);break;case n$1.Warn:this.barColor.set(a.zoneWarn);break;case n$1.Alert:this.barColor.set(a.zoneAlert);break;case n$1.Nominal:this.barColor.set(a.zoneNominal);break;default:this.barColor.set(e.color);break}else this.barColor.set(e.color);this.barColorGradient.set(e.dimmer||e.dim||e.color);});}),Fa(()=>{let t=this.cfg(),a=this.metadata;t.ignoreZones||!a||ge(()=>a.observe("gaugePath"));});}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=JD({type:n,selectors:[["widget-simple-linear"]],inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:11,consts:[[1,"simpleLinearGaugeContainer",3,"displayName","displayNameColor","unitLabel","dataValue","dataValueLabel","barColor","barColorGradient","barColorBackground","gaugeMaxValue","gaugeMinValue","highlights"]],template:function(a,e){if(a&1&&$h(0,"svg-simple-linear-gauge",0),a&2){let o;Bh("displayName",e.displayNameSafe())("displayNameColor",(o=e.theme())==null?null:o.contrastDim)("unitLabel",e.unitsLabel())("dataValue",e.dataValue())("dataValueLabel",e.dataLabelValue())("barColor",e.barColor())("barColorGradient",e.barColorGradient())("barColorBackground",e.barColorBackground())("gaugeMaxValue",e.gaugeMaxValue())("gaugeMinValue",e.gaugeMinValue())("highlights",e.highlights());}},dependencies:[_],styles:[".simpleLinearGaugeContainer[_ngcontent-%COMP%]{display:block;position:relative;height:100%;width:100%;padding:0}"]})}return n})();export{oe as WidgetSimpleLinearComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {u}from'./chunk-
|
|
1
|
+
import {u}from'./chunk-CCfhzpE8.js';import {d1 as Hj,w,du as p,dv as rt,$ as $j,a as G,cu as T,aR as lt,v as vt,D as Dt,cw as z,cv as G$1,ab as te,F as Fa,dn as ge,as as ke,cN as Wl,dB as Gl,J as JD,dC as x,c as $h,P as Pi,k as Qh,cn as wd,u as ul,_ as _w,B as Bh,e as EE,an as Hh,M as Mw,f as eg,K as Kw}from'./main-YKDNK5VZ.js';var H=["svgSlider"];function q(o,e){o&1&&$h(0,"div",10);}var O=class o{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:false,displayName:"Slider Label",filterSelfPaths:true,paths:{gaugePath:{description:"PUT Supported Numeric Path. IMPORTANT: Format must be set to (base)",path:null,source:null,pathType:"number",isPathConfigurable:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:null,showConvertUnitTo:false,convertUnitTo:void 0,supportsPut:true,sampleTime:500}},displayScale:{lower:0,upper:1,type:"linear"},enableTimeout:false,dataTimeout:5,color:"contrast"};runtime=w(p);streams=w(rt);svgElement=$j.required("svgSlider");dashboard=w(G);signalkRequestsService=w(T);toast=w(lt);labelColor=vt("");barColor=vt("");lineStartPx=0;lineWidthPx=0;lineEndPx=0;resizeTimeout=null;handlePositionView=vt(20);lineWidthView=Dt(()=>`${Math.max(0,this.handlePositionView()-this.LINE_START)}px`);pathValue=0;lineStart=20;isDragStarted=false;VIEWBOX_WIDTH=200;LINE_START=20;LINE_WIDTH=160;colorMap=null;cfg=Dt(()=>this.runtime.options()??o.DEFAULT_CONFIG);gaugePathConfig=Dt(()=>this.cfg().paths?.gaugePath);displayNameSafe=Dt(()=>this.cfg().displayName??"Slider Label");displayScale=Dt(()=>{let e=this.cfg().displayScale??o.DEFAULT_CONFIG.displayScale;return z(G$1({},e),{lower:e.lower??0,upper:e.upper??1})});valueChange$=new te;constructor(){Fa(()=>{let e=this.theme(),t=this.cfg();!t||!e||ge(()=>{this.ensureColorMap(),this.getColors(t.color??"contrast");});}),Fa(()=>{this.cfg();this.gaugePathConfig()?.path&&ge(()=>{this.calculateLineBounds(),this.streams.observe("gaugePath",i=>{if(!i||!i.data){queueMicrotask(()=>this.updateHandlePosition(this.mapValueToPosition(this.displayScale().lower)));return}queueMicrotask(()=>this.updateHandlePosition(this.mapValueToPosition(i.data.value)));});});});}ngOnInit(){this.getColors(this.cfg().color??"contrast"),this.valueChange$.pipe(ke(e=>{let t=this.displayScale();return this.isWithinMargin(e,t.lower)?t.lower:this.isWithinMargin(e,t.upper)?t.upper:parseFloat(e.toFixed(2))}),Wl(200),Gl()).subscribe(e=>{this.sendValue(e);});}mapValueToPosition(e){let t=this.displayScale(),i=t.upper-t.lower,n=this.LINE_WIDTH;return (e-t.lower)/i*n+this.LINE_START}mapPositionToValue(e){let t=this.displayScale(),i=t.upper-t.lower,n=this.LINE_WIDTH;return (e-this.LINE_START)/n*i+t.lower}isWithinMargin(e,t){let i=this.displayScale(),n=(i.upper-i.lower)*.01;return Math.abs(e-t)<=n}sendValue(e){let t=this.gaugePathConfig()?.path;t&&this.signalkRequestsService.putRequest(t,e,this.id());}onResized(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.calculateLineBounds();},200);}calculateLineBounds(){if(!this.svgElement()?.nativeElement){console.warn("[Slider Widget] SVG element is not initialized yet.");return}let e=this.svgElement().nativeElement.getBoundingClientRect(),t=this.LINE_START/this.VIEWBOX_WIDTH*e.width,i=this.LINE_WIDTH/this.VIEWBOX_WIDTH*e.width;this.lineStartPx=t,this.lineWidthPx=i,this.lineEndPx=this.lineStartPx+this.lineWidthPx;}updateHandlePosition(e){let t=Math.max(this.LINE_START,Math.min(this.LINE_START+this.LINE_WIDTH,e));this.handlePositionView.set(t);}getPointerX(e){return e.clientX-this.svgElement().nativeElement.getBoundingClientRect().left}onPointerDown(e){this.isDragStarted=true,this.onPointerMove(e),e.stopPropagation(),e.preventDefault();}onPointerMove(e){if(this.isDragStarted){let t=this.getPointerX(e);if(t>=this.lineStartPx&&t<=this.lineEndPx){let i=(t-this.lineStartPx)/this.lineWidthPx*this.LINE_WIDTH+this.LINE_START;this.updateHandlePosition(i);let n=this.handlePositionView(),r=this.displayScale();n<=this.LINE_START?this.pathValue=r.lower:n>=this.LINE_START+this.LINE_WIDTH?this.pathValue=r.upper:this.pathValue=this.mapPositionToValue(n),this.valueChange$.next(this.pathValue);}}}onPointerUp(){this.isDragStarted=false,this.valueChange$.next(this.pathValue);}onPointerLeave(){this.isDragStarted&&(this.isDragStarted=false,this.valueChange$.next(this.pathValue));}getColors(e){if(this.ensureColorMap(),!this.colorMap)return;let t=this.colorMap.get(e)||this.colorMap.get("contrast");t&&(this.labelColor.set(t.label),this.barColor.set(t.bar));}ensureColorMap(){let e=this.theme();e&&(this.colorMap=new Map([["contrast",{label:e.contrastDim,bar:e.contrast}],["blue",{label:e.blueDim,bar:e.blue}],["green",{label:e.greenDim,bar:e.green}],["pink",{label:e.pinkDim,bar:e.pink}],["orange",{label:e.orangeDim,bar:e.orange}],["purple",{label:e.purpleDim,bar:e.purple}],["grey",{label:e.greyDim,bar:e.grey}],["yellow",{label:e.yellowDim,bar:e.yellow}]]));}ngOnDestroy(){this.valueChange$.complete(),this.resizeTimeout&&clearTimeout(this.resizeTimeout);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=JD({type:o,selectors:[["widget-slider"]],viewQuery:function(t,i){t&1&&eg(i.svgElement,H,5),t&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:11,vars:7,consts:[["svgSlider",""],[3,"text","color"],["kipResizeObserver","",1,"widgets-container",3,"resizeChange"],["width","100%","height","100%","viewBox","0 40 200 40"],["width","160","height","8","rx","4.5","id","rect3","x","20","y","56",1,"slider-bg-bar",2,"display","inline","stroke-width","1.57144"],["height","8","rx","4.5","id","rect3","x","20","y","56",2,"display","inline","stroke-width","1.57144"],["id","g22"],["cy","60","fill","#ffffff","id","circle3","r","19.549999",2,"display","inline","fill","#4d4d4d","fill-opacity","1","stroke","#8c8c8c","stroke-width","0.9","stroke-dasharray","none","stroke-opacity","1"],["cy","60","fill","#ffffff","id","circle3-3","r","17.950001",2,"display","inline","fill","#ffffff","fill-opacity","1","stroke","#e6e6e6","stroke-width","1.8","stroke-dasharray","none","stroke-opacity","0.97"],["cursor","pointer","width","200","height","40","x","0","y","40",2,"display","inline","fill","rgba(0, 0, 0, 0)","stroke","none","stroke-width","0.3","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0",3,"pointerdown","pointerup","pointermove","pointerleave"],[1,"widgetOverlay"]],template:function(t,i){t&1&&($h(0,"widget-title",1),Pi(1,"div",2),Qh("resizeChange",function(){return i.onResized()}),wd(),Pi(2,"svg",3),$h(3,"rect",4)(4,"rect",5),Pi(5,"g",6),$h(6,"circle",7)(7,"circle",8),ul(),Pi(8,"rect",9,0),Qh("pointerdown",function(r){return i.onPointerDown(r)})("pointerup",function(){return i.onPointerUp()})("pointermove",function(r){return i.onPointerMove(r)})("pointerleave",function(){return i.onPointerLeave()}),ul()(),_w(10,q,1,0,"div",10),ul()),t&2&&(Bh("text",i.displayNameSafe())("color",i.labelColor()),EE(4),Hh("width",i.lineWidthView())("fill",i.barColor()),EE(2),Hh("cx",i.handlePositionView()),EE(),Hh("cx",i.handlePositionView()),EE(3),Mw(i.dashboard.isDashboardStatic()?-1:10));},dependencies:[u,x],styles:[".widgets-container[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 20px}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent;z-index:21}.slider-bg-bar[_ngcontent-%COMP%]{fill:var(--mat-sys-inverse-on-surface)}"]})};export{O as WidgetSliderComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {dx as n$1}from'./main-
|
|
1
|
+
import {dx as n$1}from'./main-YKDNK5VZ.js';function k(g,s,l,m,f,r,b=false){let a=[],c=[...g].sort((o,n)=>(o.lower??-1/0)-(n.lower??-1/0));for(let o of c){let n=f,t=r,i;switch(o.state){case n$1.Emergency:i=s.zoneEmergency;break;case n$1.Alarm:i=s.zoneAlarm;break;case n$1.Warn:i=s.zoneWarn;break;case n$1.Alert:i=s.zoneAlert;break;case n$1.Nominal:i=s.zoneNominal;break;default:i="rgba(0,0,0,0)";}if(o.lower==null?n=f:n=m.convertToUnit(l,o.lower)??f,o.upper==null?t=r:t=m.convertToUnit(l,o.upper)??r,!(!Number.isFinite(n)||!Number.isFinite(t))&&!(t<f||n>r)){if(n=Math.max(n,f),t>r){t=r,a.push({from:n,to:t,color:i});break}a.push({from:n,to:t,color:i});}}return b&&(a=a.map(o=>({from:r-o.to,to:r-o.from,color:o.color}))),a}export{k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-ibauGmSP.js';import {d1 as Hj,w,du as p,a as G,H as Dr,G as Gi,$ as $j,v as vt,F as Fa,dn as ge,J as JD,cp as Uh,b_ as Gh,e as EE,d as ig,f as eg,K as Kw,dP as pp}from'./main-YKDNK5VZ.js';var C=["plainIframe"],j=(()=>{class a{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);_dashboard=w(G);_sanitizer=w(Dr);settings=w(Gi);static DEFAULT_CONFIG={};iframe=$j.required("plainIframe");widgetUrl=null;displayTransparentOverlay=vt("block");constructor(){let e=new URL("/signalk-anchoralarm-plugin/",window.location.origin);this.widgetUrl=this.toSafeResourceUrl(e),Fa(()=>{let i=this.runtime.options(),t=this._dashboard.isDashboardStatic();i&&ge(()=>{t?this.displayTransparentOverlay.set("none"):this.displayTransparentOverlay.set("block");});}),window.addEventListener("message",this.handleIframeGesture);}toSafeResourceUrl(e){return e.origin!==window.location.origin||!e.pathname.startsWith("/signalk-anchoralarm-plugin/")?null:this._sanitizer.bypassSecurityTrustResourceUrl(e.toString())}ngAfterViewInit(){if(this.iframe()){this.iframe().nativeElement.onload=()=>this.injectSwipeScript();try{let e=this.iframe().nativeElement.contentDocument;e&&(e.readyState==="complete"||e.readyState==="interactive")&&this.injectSwipeScript();}catch(e){}}}handleIframeGesture=e=>{if(!e.data)return;let i=e.data?.eventData?.instanceId||e.data?.keyEventData?.instanceId;if(!(!i||i!==this.id())){if(e.data.gesture)switch(e.data.gesture){case "swipeup":this._dashboard.navigateToPreviousDashboard();break;case "swipedown":this._dashboard.navigateToNextDashboard();break;case "swipeleft":{let t=new Event("openLeftSidenav",{bubbles:true,cancelable:true});window.document.dispatchEvent(t);break}case "swiperight":{let t=new Event("openRightSidenav",{bubbles:true,cancelable:true});window.document.dispatchEvent(t);break}}if(e.data.type==="keydown"&&e.data.keyEventData){let{key:t,ctrlKey:s,shiftKey:n}=e.data.keyEventData,I=new KeyboardEvent("keydown",{key:t,ctrlKey:s,shiftKey:n,bubbles:true,cancelable:true});document.dispatchEvent(I);}}};injectSwipeScript(){let e=this.iframe().nativeElement.contentWindow,i=this.iframe().nativeElement.contentDocument;if(!i||!e){console.error("[WidgetIframe] Iframe contentDocument or contentWindow is undefined. Possible cross-origin issue or iframe not fully loaded.");return}try{let t=`kip-gesture-inject-${this.id()}`;if(i.getElementById(t))return;let s=a$1({instanceId:this.id()}),n=i.createElement("script");n.id=t,n.textContent=s,i.body.appendChild(n);}catch(t){console.warn("[WidgetIframe] Failed to inject swipe script into iframe:",t);}}ngOnDestroy(){window.removeEventListener("message",this.handleIframeGesture),this.iframe()&&(this.iframe().nativeElement.onload=null);try{let e=this.iframe()?.nativeElement.contentDocument;if(e){let i=`kip-gesture-inject-${this.id()}`,t=e.getElementById(i);t&&t.parentNode&&t.parentNode.removeChild(t);}}catch(e){}}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=JD({type:a,selectors:[["widget-anchor-alarm"]],viewQuery:function(i,t){i&1&&eg(t.iframe,C,5),i&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:3,vars:3,consts:[["plainIframe",""],["width","100%","height","100%","frameborder","0",1,"widgetIframe",3,"src"],[1,"widgetOverlay"]],template:function(i,t){i&1&&Uh(0,"iframe",1,0)(2,"div",2),i&2&&(Gh("src",t.widgetUrl,pp),EE(2),ig("display",t.displayTransparentOverlay()));},styles:["[_nghost-%COMP%]{overflow:hidden}.widgetIframe[_ngcontent-%COMP%]{background-color:#fff;border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium))}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent}"]})}return a})();export{j as WidgetAnchorAlarmComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,e}from'./chunk-CyURmwWh.js';import {g as ge$2}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,$ as $j,v as vt,D as Dt,F as Fa,dn as ge$1,a_ as Gp,cv as G,cw as z,dx as n$1,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-BNR44HGB.js';import {c}from'./chunk-D_wrJJxl.js';var ge=["chargerSvg"];function me(c,e){c&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No chargers detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K charger paths or select chargers in widget settings."),ul()());}function fe(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var le=class c$1{static CHARGER_DESCRIPTOR=a("widget-charger");static SELF_ROOT_PATH=(()=>{let e=c$1.CHARGER_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetChargerComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${c$1.SELF_ROOT_PATH}.*`;static PATH_REGEX=new RegExp(`^${fe(c$1.SELF_ROOT_PATH)}\\.([^.]+)\\.(.+)$`);static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static COMPACT_CARD_HEIGHT=100;static CARD_GAP=8;static PATH_BATCH_WINDOW_MS=500;static CHARGER_DISPLAY_BASE_WIDTH=145;static CHARGER_DISPLAY_BASE_HEIGHT=37;static CHARGER_DISPLAY_HORIZONTAL_MARGIN=40;static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,charger:{trackedDevices:[],optionsById:{}}};id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);svgRef=$j.required("chargerSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredChargerIds=vt([]);trackedDevices=vt([]);chargersByKey=vt({});visibleChargerKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(s=>s.key);let r=this.chargersByKey(),t=new Set(this.discoveredChargerIds()),i=Object.keys(r).filter(s=>{let o=r[s];return !!o&&t.has(o.id)}).sort((s,o)=>s.localeCompare(o)),a=new Map;return i.forEach(s=>{let o=r[s];o&&s!==o.id&&a.set(o.id,true);}),i.filter(s=>{let o=r[s];return o?s!==o.id?true:!a.get(o.id):false})});visibleChargers=Dt(()=>{let e=this.visibleChargerKeys(),r=this.chargersByKey();return e.map(t=>r[t]).filter(t=>!!t)});hasChargers=Dt(()=>this.visibleChargers().length>0);isCompactCardMode=Dt(()=>this.renderMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleChargers();return e.length!==1?"Chargers":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e=this.visibleChargers(),r=new Map;e.forEach(a=>r.set(a.id,(r.get(a.id)??0)+1));let t=new Set([...r.entries()].filter(([,a])=>a>1).map(([a])=>a)),i={};for(let a of e){let s=a.deviceKey??a.id,o=!!a.source&&t.has(a.id),[n,m,p,h]=this.buildMetricRows(a);i[s]={id:a.id,source:a.source??null,deviceKey:a.deviceKey,titleText:this.resolveTitleText(a,o),modeText:this.isCompactCardMode()?"":this.resolveModeText(a),voltageText:n,currentText:m,powerText:p,temperatureText:h};}return i});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge$1(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),i=this.visibleChargers(),a=this.widgetColors();!this.svg||!a||this.requestRender({chargers:i,displayModels:t,widgetColors:a});});let e=[this.data.subscribePathTreeWithInitial(c$1.ROOT_PATTERN)],r=false;for(let t of e)if(t.initial.length){r=true;for(let i of t.initial)this.enqueuePathUpdate(i,true);}r&&(this.flushPendingPathUpdates(),this.initialPathPaintDone=true);for(let t of e)t.live$.pipe(Gp(this.destroyRef)).subscribe(i=>{this.enqueuePathUpdate(i);});}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$2(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${c$1.VIEWBOX_WIDTH} ${c$1.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Charger View"),this.layer=this.svg.append("g").attr("class","charger-layer");}applyConfig(e){let r=this.normalizeTrackedDevices(e.charger?.trackedDevices);this.trackedDevices.set(r),this.reprojectSnapshotsToDeviceKeys(r);}normalizeTrackedDevices(e){if(!Array.isArray(e))return [];let r=new Map;return e.forEach(t=>{if(!t||typeof t!="object")return;let i=t,a=this.normalizeOptionalString(i.id),s=this.normalizeOptionalString(i.source);if(!a||!s)return;let o=this.normalizeOptionalString(i.key)??`${a}||${s}`;r.set(o,{id:a,source:s,key:o});}),[...r.values()].sort((t,i)=>t.key.localeCompare(i.key))}buildIdToDeviceKeysMap(){let e=new Map;return this.trackedDevices().forEach(r=>{let t=e.get(r.id)??[];t.push(r.key),e.set(r.id,t);}),e}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map,t=new Map;e.forEach(i=>{let a=r.get(i.id)??[];a.push(i.key),r.set(i.id,a),t.set(i.key,i);}),this.chargersByKey.update(i=>{let a=i,s=false;return r.forEach((o,n)=>{let m=i[n];if(m){for(let p of o){if(i[p])continue;let h=t.get(p);s||(a=G({},i),s=true),a[p]=z(G({},m),{source:h?.source??null,deviceKey:p});}a[n]&&(a[n].deviceKey===void 0||a[n].deviceKey===n)&&(s||(a=G({},i),s=true),delete a[n]);}}),s?a:i});}normalizeOptionalString(e){if(typeof e!="string")return null;let r=e.trim();return r.length>0?r:null}enqueuePathUpdate(e,r=false){let t=this.parsePath(e.path);if(!t)return;let i=e.update?.data?.value??null,a=e.update?.state??null,s=this.extractUpdateSource(e),o=`${t.id}::${s??"*"}::${t.key}`;if(this.pendingPathUpdates.set(o,{id:t.id,key:t.key,source:s,value:i,state:a}),!r){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=window.setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},c$1.PATH_BATCH_WINDOW_MS));}}parsePath(e){let r=e.match(c$1.PATH_REGEX);return r?{id:r[1],key:r[2]}:null}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(a=>a.id)).forEach(a=>this.trackDiscoveredCharger(a));let t=this.buildIdToDeviceKeysMap(),i=new Map;this.trackedDevices().forEach(a=>i.set(a.key,a)),this.chargersByKey.update(a=>{let s=a,o=false;for(let n of e){let m=t.get(n.id),p=!!m?.length,h=[];if(p)if(n.source){let y=`${n.id}||${n.source}`;h=m?.includes(y)?[y]:[];}else h=m??[];else h=[n.source?`${n.id}||${n.source}`:n.id];for(let y of h){let b=p?i.get(y):null,f=s[y]??{id:n.id,source:b?.source??n.source??null,deviceKey:p||n.source?y:void 0},d=G({},f);if(!this.applyValue(d,n.key,n.value,n.state))continue;let M=d.rawPower!=null?d.rawPower:d.voltage!=null&&d.current!=null?d.voltage*d.current:null;M!=null?d.power=Number.isFinite(M)?M:null:d.power=null,d.rawPower==null&&(d.powerState=this.resolveMostSevereState(d.voltageState??null,d.currentState??null)),o||(s=G({},s),o=true),s[y]=d;}}return o?s:a});}extractUpdateSource(e){let r=this.normalizeOptionalString(e.source);return r||(this.normalizeOptionalString(e.update?.data?.source)??null)}trackDiscoveredCharger(e){let r=this.discoveredChargerIds();r.includes(e)||this.discoveredChargerIds.set([...r,e].sort((t,i)=>t.localeCompare(i)));}applyValue(e,r,t,i){switch(r){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "state":return this.setMetricValue(e,"state","stateState",this.toStringValue(t),i);case "offReason":return this.setMetricValue(e,"offReason","offReasonState",this.toStringValue(t),i);case "error":return this.setMetricValue(e,"error","errorState",this.toStringValue(t),i);case "mode":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),i);case "modeState":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),i);case "modeNumber":return this.setMetricValue(e,"modeNumber","modeNumberState",this.toNumber(t,""),i);case "chargingMode":return this.setMetricValue(e,"chargingMode","chargingModeState",this.toStringValue(t),i);case "chargingModeNumber":return this.setMetricValue(e,"chargingModeNumber","chargingModeNumberState",this.toNumber(t,""),i);case "output.voltage":{let a=this.toNumber(t,"V"),s=this.setMetricValue(e,"outputVoltage","outputVoltageState",a,i),o=this.setMetricValue(e,"voltage","voltageState",a,i);return s||o}case "input.voltage":return this.setMetricValue(e,"inputVoltage","inputVoltageState",this.toNumber(t,"V"),i);case "voltage":return this.setMetricValue(e,"voltage","voltageState",this.toNumber(t,"V"),i);case "current":return this.setMetricValue(e,"current","currentState",this.toNumber(t,"A"),i);case "power":return this.setMetricValue(e,"rawPower","powerState",this.toNumber(t,"W"),i);case "temperature":return this.setMetricValue(e,"temperature","temperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "leds.absorption":return this.setMetricValue(e,"ledsAbsorption","ledsAbsorptionState",this.toBoolean(t),i);case "leds.bulk":return this.setMetricValue(e,"ledsBulk","ledsBulkState",this.toBoolean(t),i);case "leds.float":return this.setMetricValue(e,"ledsFloat","ledsFloatState",this.toBoolean(t),i);case "leds.inverter":return this.setMetricValue(e,"ledsInverter","ledsInverterState",this.toBoolean(t),i);case "leds.lowBattery":return this.setMetricValue(e,"ledsLowBattery","ledsLowBatteryState",this.toBoolean(t),i);case "leds.mains":return this.setMetricValue(e,"ledsMains","ledsMainsState",this.toBoolean(t),i);case "leds.overload":return this.setMetricValue(e,"ledsOverload","ledsOverloadState",this.toBoolean(t),i);case "leds.temperature":return this.setMetricValue(e,"ledsTemperature","ledsTemperatureState",this.toBoolean(t),i);default:return false}}setValue(e,r,t){return Object.is(e[r],t)?false:(e[r]=t,true)}setMetricValue(e,r,t,i,a){let s=!Object.is(e[r],i),o=!Object.is(e[t],a);return !s&&!o?false:(e[r]=i,e[t]=a,true)}requestRender(e){let r=this.widgetColors();!this.svg||!r||(this.pendingRenderSnapshot=e??{chargers:this.visibleChargers(),displayModels:this.displayModels(),widgetColors:r},this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let t=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,t&&this.render(t);})));}render(e$1){if(!this.layer||!this.svg)return;let r=this.isCompactCardMode(),t=r?C:e,i=r?c$1.COMPACT_CARD_HEIGHT:c$1.CARD_HEIGHT,a=c$1.VIEWBOX_WIDTH-c$1.CHARGER_DISPLAY_HORIZONTAL_MARGIN,s=a/c$1.CHARGER_DISPLAY_BASE_WIDTH,o=a,n=(c$1.VIEWBOX_WIDTH-o)/2,m=r?8:t.titleY,p=r?33:60,h=e$1.chargers.map((l,P)=>({key:l.deviceKey??l.id,id:l.id,charger:l,y:P*(i+c$1.CARD_GAP)})),y=h.length?h[h.length-1].y+i:i;this.svg.attr("viewBox",`0 0 ${c$1.VIEWBOX_WIDTH} ${y}`);let b=this.layer.selectAll("g.charger-card").data(h,l=>l.key),f=b.enter().append("g").attr("class","charger-card"),d=f.append("g").attr("class","charger-display-group");d.append("path").attr("class","charger-shape-bulk").attr("d","m 39.280608,10.70371 1.604609,-3.7808024 c 0.06926,-0.1631805 0.314475,-0.553581 0.314475,-0.4368876 v 27.475177 c 0,0.116694 -0.142713,0.210638 -0.319983,0.210638 H 9.2681756 c -0.1772706,0 -0.3711555,-0.105758 -0.319983,-0.210638 l 1.2797184,-2.622833 c 1.150699,-2.358403 3.86281,-5.455024 6.286778,-6.406312 3.251217,-1.275942 7.834296,-2.821704 11.746419,-4.103315 4.312764,-1.412861 9.246151,-5.946636 11.0195,-10.125027 z").attr("transform","matrix(1.1068428,0,0,1.1601894,-8.804611,-6.1382561)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("rect").attr("class","charger-shape-absorption").attr("width",19.67485).attr("height",32.383526).attr("x",40.545158).attr("y",1.1331999).attr("rx",.19520389).attr("ry",.24451913).attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("path").attr("class","charger-shape-float").attr("d","m 66.03898,6.4101715 4.16646,3.2472635 c 1.876083,1.462185 5.139444,3.529899 7.448846,4.069504 5.055358,1.181215 11.386089,1.251612 11.38595,1.349059 l -0.02667,18.73082 c 0,0.127151 -0.103075,0.230227 -0.230226,0.230227 H 66.03898 c -0.127151,0 -0.230226,-0.103076 -0.230226,-0.230227 V 6.6403978 c 0,-0.1271504 0.103076,-0.2302261 0.230226,-0.2302263 z").attr("transform","matrix(1.1068428,0,0,1.1601894,-8.7228087,-6.1382561)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("path").attr("class","charger-shape-storage").attr("d","m 93.39395,15.253553 c 2.347866,2.587905 8.59059,4.802212 13.94479,4.852641 11.92289,0.112298 30.60094,0.205911 30.60096,0.259031 l 0.006,13.361558 c 3e-5,0.07786 -0.19912,0.140548 -0.44645,0.140548 h -44.1053 c -0.247332,0 -0.446448,-0.06269 -0.446448,-0.140548 V 15.394101 c 0,-0.07786 0.280259,-0.323728 0.446448,-0.140548 z").attr("transform","matrix(1.1077284,0,0,1.1178939,-8.9068494,-4.6850995)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),f.append("text").attr("class","charger-title"),f.append("text").attr("class","charger-mode");let E=f.append("text").attr("class","charger-voltage");E.append("tspan").attr("class","voltage-metric-value"),E.append("tspan").attr("class","voltage-metric-unit");let M=f.append("text").attr("class","charger-current");M.append("tspan").attr("class","current-metric-value"),M.append("tspan").attr("class","current-metric-unit");let L=f.append("text").attr("class","charger-power");L.append("tspan").attr("class","power-metric-value"),L.append("tspan").attr("class","power-metric-unit");let z=f.append("text").attr("class","charger-temperature");z.append("tspan").attr("class","temperature-metric-value"),z.append("tspan").attr("class","temperature-metric-unit");let u=f.merge(b);u.attr("transform",l=>`translate(0, ${l.y})`),u.select("g.charger-display-group").attr("transform",`translate(${n}, ${p}) scale(${s})`).each((l,P,ce)=>{let v=this.resolveShapeMode(l.charger),S=this.isShapeMode(v,"power supply"),D=e$1.widgetColors.dim,x="var(--mat-sys-background)",R=this.isShapeMode(v,"sustain")||S?"none":this.isShapeMode(v,"equalization")?"var(--kip-zone-alert-color)":this.isShapeMode(v,"overload")?"var(--kip-zone-alarm-color)":e$1.widgetColors.color,I=ge$2(ce[P]);I.select("path.charger-shape-bulk").attr("fill",this.isShapeMode(v,"bulk")||this.isShapeMode(v,"boost")||S?D:x).attr("stroke",R),I.select("rect.charger-shape-absorption").attr("fill",this.isShapeMode(v,"absorption")||S?D:x).attr("stroke",R),I.select("path.charger-shape-float").attr("fill",this.isShapeMode(v,"float")||S?D:x).attr("stroke",R),I.select("path.charger-shape-storage").attr("fill",this.isShapeMode(v,"storage")||S?D:x).attr("stroke",R);}),e$1.chargers.length>1?u.select("text.charger-title").attr("x",t.titleX).attr("y",m).attr("font-size",t.titleFontSize).attr("fill","var(--kip-contrast-dim-color)").text(l=>e$1.displayModels[l.key]?.titleText??this.resolveTitleText(l.charger)):u.select("text.charger-title").text(""),u.select("text.charger-voltage").attr("x",197).attr("y",25).attr("text-anchor","end").attr("font-size",t.primaryFontSize).attr("font-weight",t.primaryFontWeight).attr("fill","var(--kip-contrast-color)"),u.select("tspan.voltage-metric-value").text(l=>e$1.displayModels[l.key]?.voltageText??""),u.select("tspan.voltage-metric-unit").attr("dx",1).attr("font-size",22).attr("font-weight",500).attr("fill","var(--kip-contrast-color)").text("V"),u.select("text.charger-current").attr("x",197).attr("y",48).attr("text-anchor","end").attr("font-size",t.lineOneFontSize).attr("fill","var(--kip-contrast-color)"),u.select("tspan.current-metric-value").text(l=>e$1.displayModels[l.key]?.currentText??""),u.select("tspan.current-metric-unit").attr("dx",1).attr("font-size",12).attr("fill","var(--kip-contrast-color)").text("A"),u.select("text.charger-power").attr("x",5).attr("y",22).attr("fill","var(--kip-contrast-dim-color)").attr("font-size",10),u.select("tspan.power-metric-value").text(l=>e$1.displayModels[l.key]?.powerText??""),u.select("tspan.power-metric-unit").attr("dx",1).attr("font-size",6).attr("fill","var(--kip-contrast-dim-color)").text("W"),u.select("text.charger-temperature").attr("x",5).attr("y",34).attr("fill","var(--kip-contrast-dim-color)").attr("font-size",10),u.select("tspan.temperature-metric-value").text(l=>e$1.displayModels[l.key]?.temperatureText??""),u.select("tspan.temperature-metric-unit").attr("dx",1).attr("font-size",6).attr("fill","var(--kip-contrast-dim-color)").text(`${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`),u.select("text.charger-mode").attr("x",5).attr("y",46).attr("font-size",10).attr("fill","var(--kip-contrast-dim-color)").text(l=>e$1.displayModels[l.key]?.modeText??""),b.exit().remove();}resolveTitleText(e,r=false){let t=e.name||`Charger ${e.id}`;return !r||!e.source?t:`${t} [${e.source}]`}resolveModeText(e){if(e.chargingMode)return `Mode: ${e.chargingMode.charAt(0).toUpperCase()+e.chargingMode.slice(1)}`;if(e.mode)return `Mode: ${e.mode}`;let t=[{active:e.ledsAbsorption,label:"Absorption"},{active:e.ledsBulk,label:"Bulk"},{active:e.ledsFloat,label:"Float"},{active:e.ledsInverter,label:"Inverter"},{active:e.ledsLowBattery,label:"Low Battery"},{active:e.ledsMains,label:"Mains"},{active:e.ledsOverload,label:"Overload"},{active:e.ledsTemperature,label:"Temperature"}].filter(i=>i.active===true).map(i=>i.label);return t.length?`Mode: ${t.join(" / ")}`:"Mode --"}resolveShapeMode(e){return (e.chargingMode??e.mode??"").trim().toLowerCase()}isShapeMode(e,r){return !e||!r?false:e===r||e.includes(r)}buildMetricRows(e){return this.renderMode()==="full"||this.renderMode()===null?[`${this.formatValue(e.voltage,1)}`,`${this.formatValue(e.current,1)}`,`Power: ${this.formatValue(e.power,0)}`,`Temp: ${this.formatTemperature(e.temperature)}`]:[`${this.formatValue(e.voltage,1)}`,`${this.formatValue(e.current,1)}`,`P: ${this.formatValue(e.power,0)}`,`T: ${this.formatTemperature(e.temperature)}`]}formatValue(e,r){return e==null||Number.isNaN(e)?"-":`${e.toFixed(r)}`}formatTemperature(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(0)}`}toStringValue(e){return typeof e=="string"?e:null}toBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return true;if(e===0)return false}if(typeof e=="string"){let r=e.trim().toLowerCase();if(r==="true"||r==="1"||r==="on")return true;if(r==="false"||r==="0"||r==="off")return false}return null}resolveMostSevereState(...e){return e.some(r=>r===n$1.Alert)?n$1.Alert:e.some(r=>r===n$1.Alarm)?n$1.Alarm:e.some(r=>r===n$1.Warn)?n$1.Warn:e.some(r=>r===n$1.Normal)?n$1.Normal:null}toNumber(e,r){if(e==null||typeof e=="boolean")return null;let t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return null;let i=this.units.convertToUnit(r,t);return Number.isFinite(i)?i:t}static \u0275fac=function(r){return new(r||c$1)};static \u0275cmp=JD({type:c$1,selectors:[["widget-charger"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,ge,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["chargerSvg",""],[3,"text","color"],["aria-hidden","false",1,"charger-svg"],[1,"charger-empty"],[1,"charger-empty-title"],[1,"charger-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,me,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasChargers()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.charger-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.charger-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.charger-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.charger-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{le as WidgetChargerComponent};
|
|
1
|
+
import {C,e}from'./chunk-DPnbM-aB.js';import {g as ge$2}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,$ as $j,v as vt,D as Dt,F as Fa,dn as ge$1,a_ as Gp,cv as G,cw as z,dx as n$1,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-YKDNK5VZ.js';import {c}from'./chunk-BIb-xYiS.js';var ge=["chargerSvg"];function me(c,e){c&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No chargers detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K charger paths or select chargers in widget settings."),ul()());}function fe(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var le=class c$1{static CHARGER_DESCRIPTOR=a("widget-charger");static SELF_ROOT_PATH=(()=>{let e=c$1.CHARGER_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetChargerComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${c$1.SELF_ROOT_PATH}.*`;static PATH_REGEX=new RegExp(`^${fe(c$1.SELF_ROOT_PATH)}\\.([^.]+)\\.(.+)$`);static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static COMPACT_CARD_HEIGHT=100;static CARD_GAP=8;static PATH_BATCH_WINDOW_MS=500;static CHARGER_DISPLAY_BASE_WIDTH=145;static CHARGER_DISPLAY_BASE_HEIGHT=37;static CHARGER_DISPLAY_HORIZONTAL_MARGIN=40;static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,charger:{trackedDevices:[],optionsById:{}}};id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);svgRef=$j.required("chargerSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredChargerIds=vt([]);trackedDevices=vt([]);chargersByKey=vt({});visibleChargerKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(s=>s.key);let r=this.chargersByKey(),t=new Set(this.discoveredChargerIds()),i=Object.keys(r).filter(s=>{let o=r[s];return !!o&&t.has(o.id)}).sort((s,o)=>s.localeCompare(o)),a=new Map;return i.forEach(s=>{let o=r[s];o&&s!==o.id&&a.set(o.id,true);}),i.filter(s=>{let o=r[s];return o?s!==o.id?true:!a.get(o.id):false})});visibleChargers=Dt(()=>{let e=this.visibleChargerKeys(),r=this.chargersByKey();return e.map(t=>r[t]).filter(t=>!!t)});hasChargers=Dt(()=>this.visibleChargers().length>0);isCompactCardMode=Dt(()=>this.renderMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleChargers();return e.length!==1?"Chargers":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e=this.visibleChargers(),r=new Map;e.forEach(a=>r.set(a.id,(r.get(a.id)??0)+1));let t=new Set([...r.entries()].filter(([,a])=>a>1).map(([a])=>a)),i={};for(let a of e){let s=a.deviceKey??a.id,o=!!a.source&&t.has(a.id),[n,m,p,h]=this.buildMetricRows(a);i[s]={id:a.id,source:a.source??null,deviceKey:a.deviceKey,titleText:this.resolveTitleText(a,o),modeText:this.isCompactCardMode()?"":this.resolveModeText(a),voltageText:n,currentText:m,powerText:p,temperatureText:h};}return i});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge$1(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),i=this.visibleChargers(),a=this.widgetColors();!this.svg||!a||this.requestRender({chargers:i,displayModels:t,widgetColors:a});});let e=[this.data.subscribePathTreeWithInitial(c$1.ROOT_PATTERN)],r=false;for(let t of e)if(t.initial.length){r=true;for(let i of t.initial)this.enqueuePathUpdate(i,true);}r&&(this.flushPendingPathUpdates(),this.initialPathPaintDone=true);for(let t of e)t.live$.pipe(Gp(this.destroyRef)).subscribe(i=>{this.enqueuePathUpdate(i);});}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$2(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${c$1.VIEWBOX_WIDTH} ${c$1.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Charger View"),this.layer=this.svg.append("g").attr("class","charger-layer");}applyConfig(e){let r=this.normalizeTrackedDevices(e.charger?.trackedDevices);this.trackedDevices.set(r),this.reprojectSnapshotsToDeviceKeys(r);}normalizeTrackedDevices(e){if(!Array.isArray(e))return [];let r=new Map;return e.forEach(t=>{if(!t||typeof t!="object")return;let i=t,a=this.normalizeOptionalString(i.id),s=this.normalizeOptionalString(i.source);if(!a||!s)return;let o=this.normalizeOptionalString(i.key)??`${a}||${s}`;r.set(o,{id:a,source:s,key:o});}),[...r.values()].sort((t,i)=>t.key.localeCompare(i.key))}buildIdToDeviceKeysMap(){let e=new Map;return this.trackedDevices().forEach(r=>{let t=e.get(r.id)??[];t.push(r.key),e.set(r.id,t);}),e}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map,t=new Map;e.forEach(i=>{let a=r.get(i.id)??[];a.push(i.key),r.set(i.id,a),t.set(i.key,i);}),this.chargersByKey.update(i=>{let a=i,s=false;return r.forEach((o,n)=>{let m=i[n];if(m){for(let p of o){if(i[p])continue;let h=t.get(p);s||(a=G({},i),s=true),a[p]=z(G({},m),{source:h?.source??null,deviceKey:p});}a[n]&&(a[n].deviceKey===void 0||a[n].deviceKey===n)&&(s||(a=G({},i),s=true),delete a[n]);}}),s?a:i});}normalizeOptionalString(e){if(typeof e!="string")return null;let r=e.trim();return r.length>0?r:null}enqueuePathUpdate(e,r=false){let t=this.parsePath(e.path);if(!t)return;let i=e.update?.data?.value??null,a=e.update?.state??null,s=this.extractUpdateSource(e),o=`${t.id}::${s??"*"}::${t.key}`;if(this.pendingPathUpdates.set(o,{id:t.id,key:t.key,source:s,value:i,state:a}),!r){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=window.setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},c$1.PATH_BATCH_WINDOW_MS));}}parsePath(e){let r=e.match(c$1.PATH_REGEX);return r?{id:r[1],key:r[2]}:null}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(a=>a.id)).forEach(a=>this.trackDiscoveredCharger(a));let t=this.buildIdToDeviceKeysMap(),i=new Map;this.trackedDevices().forEach(a=>i.set(a.key,a)),this.chargersByKey.update(a=>{let s=a,o=false;for(let n of e){let m=t.get(n.id),p=!!m?.length,h=[];if(p)if(n.source){let y=`${n.id}||${n.source}`;h=m?.includes(y)?[y]:[];}else h=m??[];else h=[n.source?`${n.id}||${n.source}`:n.id];for(let y of h){let b=p?i.get(y):null,f=s[y]??{id:n.id,source:b?.source??n.source??null,deviceKey:p||n.source?y:void 0},d=G({},f);if(!this.applyValue(d,n.key,n.value,n.state))continue;let M=d.rawPower!=null?d.rawPower:d.voltage!=null&&d.current!=null?d.voltage*d.current:null;M!=null?d.power=Number.isFinite(M)?M:null:d.power=null,d.rawPower==null&&(d.powerState=this.resolveMostSevereState(d.voltageState??null,d.currentState??null)),o||(s=G({},s),o=true),s[y]=d;}}return o?s:a});}extractUpdateSource(e){let r=this.normalizeOptionalString(e.source);return r||(this.normalizeOptionalString(e.update?.data?.source)??null)}trackDiscoveredCharger(e){let r=this.discoveredChargerIds();r.includes(e)||this.discoveredChargerIds.set([...r,e].sort((t,i)=>t.localeCompare(i)));}applyValue(e,r,t,i){switch(r){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "state":return this.setMetricValue(e,"state","stateState",this.toStringValue(t),i);case "offReason":return this.setMetricValue(e,"offReason","offReasonState",this.toStringValue(t),i);case "error":return this.setMetricValue(e,"error","errorState",this.toStringValue(t),i);case "mode":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),i);case "modeState":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),i);case "modeNumber":return this.setMetricValue(e,"modeNumber","modeNumberState",this.toNumber(t,""),i);case "chargingMode":return this.setMetricValue(e,"chargingMode","chargingModeState",this.toStringValue(t),i);case "chargingModeNumber":return this.setMetricValue(e,"chargingModeNumber","chargingModeNumberState",this.toNumber(t,""),i);case "output.voltage":{let a=this.toNumber(t,"V"),s=this.setMetricValue(e,"outputVoltage","outputVoltageState",a,i),o=this.setMetricValue(e,"voltage","voltageState",a,i);return s||o}case "input.voltage":return this.setMetricValue(e,"inputVoltage","inputVoltageState",this.toNumber(t,"V"),i);case "voltage":return this.setMetricValue(e,"voltage","voltageState",this.toNumber(t,"V"),i);case "current":return this.setMetricValue(e,"current","currentState",this.toNumber(t,"A"),i);case "power":return this.setMetricValue(e,"rawPower","powerState",this.toNumber(t,"W"),i);case "temperature":return this.setMetricValue(e,"temperature","temperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "leds.absorption":return this.setMetricValue(e,"ledsAbsorption","ledsAbsorptionState",this.toBoolean(t),i);case "leds.bulk":return this.setMetricValue(e,"ledsBulk","ledsBulkState",this.toBoolean(t),i);case "leds.float":return this.setMetricValue(e,"ledsFloat","ledsFloatState",this.toBoolean(t),i);case "leds.inverter":return this.setMetricValue(e,"ledsInverter","ledsInverterState",this.toBoolean(t),i);case "leds.lowBattery":return this.setMetricValue(e,"ledsLowBattery","ledsLowBatteryState",this.toBoolean(t),i);case "leds.mains":return this.setMetricValue(e,"ledsMains","ledsMainsState",this.toBoolean(t),i);case "leds.overload":return this.setMetricValue(e,"ledsOverload","ledsOverloadState",this.toBoolean(t),i);case "leds.temperature":return this.setMetricValue(e,"ledsTemperature","ledsTemperatureState",this.toBoolean(t),i);default:return false}}setValue(e,r,t){return Object.is(e[r],t)?false:(e[r]=t,true)}setMetricValue(e,r,t,i,a){let s=!Object.is(e[r],i),o=!Object.is(e[t],a);return !s&&!o?false:(e[r]=i,e[t]=a,true)}requestRender(e){let r=this.widgetColors();!this.svg||!r||(this.pendingRenderSnapshot=e??{chargers:this.visibleChargers(),displayModels:this.displayModels(),widgetColors:r},this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let t=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,t&&this.render(t);})));}render(e$1){if(!this.layer||!this.svg)return;let r=this.isCompactCardMode(),t=r?C:e,i=r?c$1.COMPACT_CARD_HEIGHT:c$1.CARD_HEIGHT,a=c$1.VIEWBOX_WIDTH-c$1.CHARGER_DISPLAY_HORIZONTAL_MARGIN,s=a/c$1.CHARGER_DISPLAY_BASE_WIDTH,o=a,n=(c$1.VIEWBOX_WIDTH-o)/2,m=r?8:t.titleY,p=r?33:60,h=e$1.chargers.map((l,P)=>({key:l.deviceKey??l.id,id:l.id,charger:l,y:P*(i+c$1.CARD_GAP)})),y=h.length?h[h.length-1].y+i:i;this.svg.attr("viewBox",`0 0 ${c$1.VIEWBOX_WIDTH} ${y}`);let b=this.layer.selectAll("g.charger-card").data(h,l=>l.key),f=b.enter().append("g").attr("class","charger-card"),d=f.append("g").attr("class","charger-display-group");d.append("path").attr("class","charger-shape-bulk").attr("d","m 39.280608,10.70371 1.604609,-3.7808024 c 0.06926,-0.1631805 0.314475,-0.553581 0.314475,-0.4368876 v 27.475177 c 0,0.116694 -0.142713,0.210638 -0.319983,0.210638 H 9.2681756 c -0.1772706,0 -0.3711555,-0.105758 -0.319983,-0.210638 l 1.2797184,-2.622833 c 1.150699,-2.358403 3.86281,-5.455024 6.286778,-6.406312 3.251217,-1.275942 7.834296,-2.821704 11.746419,-4.103315 4.312764,-1.412861 9.246151,-5.946636 11.0195,-10.125027 z").attr("transform","matrix(1.1068428,0,0,1.1601894,-8.804611,-6.1382561)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("rect").attr("class","charger-shape-absorption").attr("width",19.67485).attr("height",32.383526).attr("x",40.545158).attr("y",1.1331999).attr("rx",.19520389).attr("ry",.24451913).attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("path").attr("class","charger-shape-float").attr("d","m 66.03898,6.4101715 4.16646,3.2472635 c 1.876083,1.462185 5.139444,3.529899 7.448846,4.069504 5.055358,1.181215 11.386089,1.251612 11.38595,1.349059 l -0.02667,18.73082 c 0,0.127151 -0.103075,0.230227 -0.230226,0.230227 H 66.03898 c -0.127151,0 -0.230226,-0.103076 -0.230226,-0.230227 V 6.6403978 c 0,-0.1271504 0.103076,-0.2302261 0.230226,-0.2302263 z").attr("transform","matrix(1.1068428,0,0,1.1601894,-8.7228087,-6.1382561)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("path").attr("class","charger-shape-storage").attr("d","m 93.39395,15.253553 c 2.347866,2.587905 8.59059,4.802212 13.94479,4.852641 11.92289,0.112298 30.60094,0.205911 30.60096,0.259031 l 0.006,13.361558 c 3e-5,0.07786 -0.19912,0.140548 -0.44645,0.140548 h -44.1053 c -0.247332,0 -0.446448,-0.06269 -0.446448,-0.140548 V 15.394101 c 0,-0.07786 0.280259,-0.323728 0.446448,-0.140548 z").attr("transform","matrix(1.1077284,0,0,1.1178939,-8.9068494,-4.6850995)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),f.append("text").attr("class","charger-title"),f.append("text").attr("class","charger-mode");let E=f.append("text").attr("class","charger-voltage");E.append("tspan").attr("class","voltage-metric-value"),E.append("tspan").attr("class","voltage-metric-unit");let M=f.append("text").attr("class","charger-current");M.append("tspan").attr("class","current-metric-value"),M.append("tspan").attr("class","current-metric-unit");let L=f.append("text").attr("class","charger-power");L.append("tspan").attr("class","power-metric-value"),L.append("tspan").attr("class","power-metric-unit");let z=f.append("text").attr("class","charger-temperature");z.append("tspan").attr("class","temperature-metric-value"),z.append("tspan").attr("class","temperature-metric-unit");let u=f.merge(b);u.attr("transform",l=>`translate(0, ${l.y})`),u.select("g.charger-display-group").attr("transform",`translate(${n}, ${p}) scale(${s})`).each((l,P,ce)=>{let v=this.resolveShapeMode(l.charger),S=this.isShapeMode(v,"power supply"),D=e$1.widgetColors.dim,x="var(--mat-sys-background)",R=this.isShapeMode(v,"sustain")||S?"none":this.isShapeMode(v,"equalization")?"var(--kip-zone-alert-color)":this.isShapeMode(v,"overload")?"var(--kip-zone-alarm-color)":e$1.widgetColors.color,I=ge$2(ce[P]);I.select("path.charger-shape-bulk").attr("fill",this.isShapeMode(v,"bulk")||this.isShapeMode(v,"boost")||S?D:x).attr("stroke",R),I.select("rect.charger-shape-absorption").attr("fill",this.isShapeMode(v,"absorption")||S?D:x).attr("stroke",R),I.select("path.charger-shape-float").attr("fill",this.isShapeMode(v,"float")||S?D:x).attr("stroke",R),I.select("path.charger-shape-storage").attr("fill",this.isShapeMode(v,"storage")||S?D:x).attr("stroke",R);}),e$1.chargers.length>1?u.select("text.charger-title").attr("x",t.titleX).attr("y",m).attr("font-size",t.titleFontSize).attr("fill","var(--kip-contrast-dim-color)").text(l=>e$1.displayModels[l.key]?.titleText??this.resolveTitleText(l.charger)):u.select("text.charger-title").text(""),u.select("text.charger-voltage").attr("x",197).attr("y",25).attr("text-anchor","end").attr("font-size",t.primaryFontSize).attr("font-weight",t.primaryFontWeight).attr("fill","var(--kip-contrast-color)"),u.select("tspan.voltage-metric-value").text(l=>e$1.displayModels[l.key]?.voltageText??""),u.select("tspan.voltage-metric-unit").attr("dx",1).attr("font-size",22).attr("font-weight",500).attr("fill","var(--kip-contrast-color)").text("V"),u.select("text.charger-current").attr("x",197).attr("y",48).attr("text-anchor","end").attr("font-size",t.lineOneFontSize).attr("fill","var(--kip-contrast-color)"),u.select("tspan.current-metric-value").text(l=>e$1.displayModels[l.key]?.currentText??""),u.select("tspan.current-metric-unit").attr("dx",1).attr("font-size",12).attr("fill","var(--kip-contrast-color)").text("A"),u.select("text.charger-power").attr("x",5).attr("y",22).attr("fill","var(--kip-contrast-dim-color)").attr("font-size",10),u.select("tspan.power-metric-value").text(l=>e$1.displayModels[l.key]?.powerText??""),u.select("tspan.power-metric-unit").attr("dx",1).attr("font-size",6).attr("fill","var(--kip-contrast-dim-color)").text("W"),u.select("text.charger-temperature").attr("x",5).attr("y",34).attr("fill","var(--kip-contrast-dim-color)").attr("font-size",10),u.select("tspan.temperature-metric-value").text(l=>e$1.displayModels[l.key]?.temperatureText??""),u.select("tspan.temperature-metric-unit").attr("dx",1).attr("font-size",6).attr("fill","var(--kip-contrast-dim-color)").text(`${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`),u.select("text.charger-mode").attr("x",5).attr("y",46).attr("font-size",10).attr("fill","var(--kip-contrast-dim-color)").text(l=>e$1.displayModels[l.key]?.modeText??""),b.exit().remove();}resolveTitleText(e,r=false){let t=e.name||`Charger ${e.id}`;return !r||!e.source?t:`${t} [${e.source}]`}resolveModeText(e){if(e.chargingMode)return `Mode: ${e.chargingMode.charAt(0).toUpperCase()+e.chargingMode.slice(1)}`;if(e.mode)return `Mode: ${e.mode}`;let t=[{active:e.ledsAbsorption,label:"Absorption"},{active:e.ledsBulk,label:"Bulk"},{active:e.ledsFloat,label:"Float"},{active:e.ledsInverter,label:"Inverter"},{active:e.ledsLowBattery,label:"Low Battery"},{active:e.ledsMains,label:"Mains"},{active:e.ledsOverload,label:"Overload"},{active:e.ledsTemperature,label:"Temperature"}].filter(i=>i.active===true).map(i=>i.label);return t.length?`Mode: ${t.join(" / ")}`:"Mode --"}resolveShapeMode(e){return (e.chargingMode??e.mode??"").trim().toLowerCase()}isShapeMode(e,r){return !e||!r?false:e===r||e.includes(r)}buildMetricRows(e){return this.renderMode()==="full"||this.renderMode()===null?[`${this.formatValue(e.voltage,1)}`,`${this.formatValue(e.current,1)}`,`Power: ${this.formatValue(e.power,0)}`,`Temp: ${this.formatTemperature(e.temperature)}`]:[`${this.formatValue(e.voltage,1)}`,`${this.formatValue(e.current,1)}`,`P: ${this.formatValue(e.power,0)}`,`T: ${this.formatTemperature(e.temperature)}`]}formatValue(e,r){return e==null||Number.isNaN(e)?"-":`${e.toFixed(r)}`}formatTemperature(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(0)}`}toStringValue(e){return typeof e=="string"?e:null}toBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return true;if(e===0)return false}if(typeof e=="string"){let r=e.trim().toLowerCase();if(r==="true"||r==="1"||r==="on")return true;if(r==="false"||r==="0"||r==="off")return false}return null}resolveMostSevereState(...e){return e.some(r=>r===n$1.Alert)?n$1.Alert:e.some(r=>r===n$1.Alarm)?n$1.Alarm:e.some(r=>r===n$1.Warn)?n$1.Warn:e.some(r=>r===n$1.Normal)?n$1.Normal:null}toNumber(e,r){if(e==null||typeof e=="boolean")return null;let t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return null;let i=this.units.convertToUnit(r,t);return Number.isFinite(i)?i:t}static \u0275fac=function(r){return new(r||c$1)};static \u0275cmp=JD({type:c$1,selectors:[["widget-charger"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,ge,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["chargerSvg",""],[3,"text","color"],["aria-hidden","false",1,"charger-svg"],[1,"charger-empty"],[1,"charger-empty-title"],[1,"charger-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,me,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasChargers()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.charger-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.charger-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.charger-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.charger-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{le as WidgetChargerComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {dx as n$1}from'./main-
|
|
1
|
+
import {dx as n$1}from'./main-YKDNK5VZ.js';function c(n,r){let i={contrast:{color:r.contrast,dim:r.contrastDim,dimmer:r.contrastDimmer},blue:{color:r.blue,dim:r.blueDim,dimmer:r.blueDimmer},green:{color:r.green,dim:r.greenDim,dimmer:r.greenDimmer},pink:{color:r.pink,dim:r.pinkDim,dimmer:r.pinkDimmer},orange:{color:r.orange,dim:r.orangeDim,dimmer:r.orangeDimmer},purple:{color:r.purple,dim:r.purpleDim,dimmer:r.purpleDimmer},yellow:{color:r.yellow,dim:r.yellowDim,dimmer:r.yellowDimmer},grey:{color:r.grey,dim:r.greyDim,dimmer:r.greyDimmer}},l=n in i?n:"contrast";return i[l]}function e(n,r,i,l){if(l||!n||!i)return r;switch(n){case n$1.Nominal:return i.zoneNominal;case n$1.Alarm:return i.zoneAlarm;case n$1.Warn:return i.zoneWarn;case n$1.Alert:return i.zoneAlert;default:return r}}export{c,e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {O}from'./chunk-o977r5_s.js';import {w,aS as De,aY as xe$1,a7 as Gj,i as ir,aR as lt$1,ab as te,$ as $j,cN as Wl,a_ as Gp,W as Wp,E as Em,F as Fa,cO as eu,cP as Z,as as ke,J as JD,cQ as ce,bb as rt$1,bc as ae$1,bH as ln$1,bd as an$1,O as Op,o as eu$1,y as yt,b as wt,cR as zt,bg as mt,c as $h,P as Pi$1,T as TT,u as ul,k as Qh,cS as pl,cf as xh,cT as hl,B as Bh,e as EE,f as eg,K as Kw,aB as gr,aF as Pr,ac as Mr,cU as $n,az as Yj,ad as Qe$1,aa as N,bA as Ft,bB as F,al as Zj,_ as _w,cn as wd,cV as Td,M as Mw,bp as gl,an as Hh,cW as Ur,ak as nw,ay as lv,cX as Xt,aq as Bn$1,cY as Io,aj as zm,cZ as Tm,c_ as Fm,c2 as bh,c3 as Qs,c4 as Fn$1,c8 as Sv,c9 as Sh,bV as Gw,bW as zw,am as LT,s as sg,c$ as Wh,bI as Lt,bQ as Dn$1,a6 as Lr,d0 as dh,bR as ot$1,v as vt,aD as Ce,bS as oa,ci as dl,cj as fl,bu as ut,aQ as ee,d1 as Hj,bh as xp,aA as gg,h as Fw,l as ud,g as qw,m as dd,X as xw,Y as Aw,bl as Jw,d2 as wt$1,d3 as ib,a9 as ru,cl as G,aC as L,ae as be,d4 as gi,bT as Lg,ag as bu,d5 as jt,d6 as _,d7 as Ce$1,d8 as Y$1,d9 as Cm,da as Qm,aJ as wm,db as Dm,ca as Kh,c0 as Zw,c1 as Yw,ap as Ki$1,co as Mr$1,dc as O$1,dd as $e$1,de as Nt,df as Vt,dg as pt,dh as zt$1,di as jt$1,bi as Eg,bj as ST,dj as Nw,bm as Ig,dk as Vh,at as Tp,cp as Uh}from'./main-BNR44HGB.js';var Vi=[[["caption"]],[["colgroup"],["col"]],"*"],Ui=["caption","colgroup, col","*"];function $i(i,o){i&1&&zw(0,2);}function Qi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",0),Wh(3,2)(4,3),ul(),Pi$1(5,"tfoot",0),Wh(6,4),ul());}function Wi(i,o){i&1&&Wh(0,1)(1,2)(2,3)(3,4);}var A=new N("CDK_TABLE");var Ue=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellDef",""]]})}return i})(),$e=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkHeaderCellDef",""]]})}return i})(),Ci=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkFooterCellDef",""]]})}return i})(),Y=(()=>{class i{_table=w(A,{optional:true});_hasStickyChanged=false;get name(){return this._name}set name(e){this._setNameInput(e);}_name;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;get stickyEnd(){return this._stickyEnd}set stickyEnd(e){e!==this._stickyEnd&&(this._stickyEnd=e,this._hasStickyChanged=true);}_stickyEnd=false;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`];}_setNameInput(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName());}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,Ue,5)(a,$e,5)(a,Ci,5),t&2){let r;Zw(r=Yw())&&(n.cell=r.first),Zw(r=Yw())&&(n.headerCell=r.first),Zw(r=Yw())&&(n.footerCell=r.first);}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",Zj],stickyEnd:[2,"stickyEnd","stickyEnd",Zj]}})}return i})(),Ve=class{constructor(o,e){e.nativeElement.classList.add(...o._columnCssClassName);}},bi=(()=>{class i extends Ve{constructor(){super(w(Y),w(Lr));}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[Sh]})}return i})();var Di=(()=>{class i extends Ve{constructor(){let e=w(Y),t=w(Lr);super(e,t);let n=e._table?._getCellRole();n&&t.nativeElement.setAttribute("role",n);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[Sh]})}return i})();var tt=(()=>{class i{template=w(Mr$1);_differs=w(ib);columns;_columnsDiffer;ngOnChanges(e){if(!this._columnsDiffer){let t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t);}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof Me?e.headerCell.template:this instanceof it?e.footerCell.template:e.cell.template}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,features:[lv]})}return i})(),Me=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),it=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),Qe=(()=>{class i extends tt{_table=w(A,{optional:true});when;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[Sh]})}return i})(),ae=(()=>{class i{_viewContainer=w(Ki$1);cells;context;static mostRecentCellOutlet=null;constructor(){i.mostRecentCellOutlet=this;}ngOnDestroy(){i.mostRecentCellOutlet===this&&(i.mostRecentCellOutlet=null);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellOutlet",""]]})}return i})(),nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-header-row"],["tr","cdk-header-row",""]],hostAttrs:["role","row",1,"cdk-header-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})();var ot=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})(),We=(()=>{class i{templateRef=w(Mr$1);_contentClassNames=["cdk-no-data-row","cdk-row"];_cellClassNames=["cdk-cell","cdk-no-data-cell"];_cellSelector="td, cdk-cell, [cdk-cell], .cdk-cell";static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["ng-template","cdkNoDataRow",""]]})}return i})(),yi=["top","bottom","left","right"],et=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(o=>this._updateCachedSizes(o)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=false;constructor(o,e,t=true,n=true,a,r,l){this._isNativeHtmlTable=o,this._stickCellCss=e,this._isBrowser=t,this._needsPositionStickyOnElement=n,this.direction=a,this._positionListener=r,this._tableInjector=l,this._borderCellCss={top:`${e}-border-elem-top`,bottom:`${e}-border-elem-bottom`,left:`${e}-border-elem-left`,right:`${e}-border-elem-right`};}clearStickyPositioning(o,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(o);let t=[];for(let n of o)n.nodeType===n.ELEMENT_NODE&&t.push(n,...Array.from(n.children));Tp({write:()=>{for(let n of t)this._removeStickyStyle(n,e);}},{injector:this._tableInjector});}updateStickyColumns(o,e,t,n=true,a=true){if(!o.length||!this._isBrowser||!(e.some(P=>P)||t.some(P=>P))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let r=o[0],l=r.children.length,u=this.direction==="rtl",p=u?"right":"left",g=u?"left":"right",w=e.lastIndexOf(true),S=t.indexOf(true),R,mt,ut;a&&this._updateStickyColumnReplayQueue({rows:[...o],stickyStartStates:[...e],stickyEndStates:[...t]}),Tp({earlyRead:()=>{R=this._getCellWidths(r,n),mt=this._getStickyStartColumnPositions(R,e),ut=this._getStickyEndColumnPositions(R,t);},write:()=>{for(let P of o)for(let I=0;I<l;I++){let ft=P.children[I];e[I]&&this._addStickyStyle(ft,p,mt[I],I===w),t[I]&&this._addStickyStyle(ft,g,ut[I],I===S);}this._positionListener&&R.some(P=>!!P)&&(this._positionListener.stickyColumnsUpdated({sizes:w===-1?[]:R.slice(0,w+1).map((P,I)=>e[I]?P:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:S===-1?[]:R.slice(S).map((P,I)=>t[I+S]?P:null).reverse()}));}},{injector:this._tableInjector});}stickRows(o,e,t){if(!this._isBrowser)return;let n=t==="bottom"?o.slice().reverse():o,a=t==="bottom"?e.slice().reverse():e,r=[],l=[],u=[];Tp({earlyRead:()=>{for(let p=0,g=0;p<n.length;p++){if(!a[p])continue;r[p]=g;let w=n[p];u[p]=this._isNativeHtmlTable?Array.from(w.children):[w];let S=this._retrieveElementSize(w).height;g+=S,l[p]=S;}},write:()=>{let p=a.lastIndexOf(true);for(let g=0;g<n.length;g++){if(!a[g])continue;let w=r[g],S=g===p;for(let R of u[g])this._addStickyStyle(R,t,w,S);}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:l,offsets:r,elements:u}):this._positionListener?.stickyFooterRowsUpdated({sizes:l,offsets:r,elements:u});}},{injector:this._tableInjector});}updateStickyFooterContainer(o,e){this._isNativeHtmlTable&&Tp({write:()=>{let t=o.querySelector("tfoot");t&&(e.some(n=>!n)?this._removeStickyStyle(t,["bottom"]):this._addStickyStyle(t,"bottom",0,false));}},{injector:this._tableInjector});}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=true;}_removeStickyStyle(o,e){if(!o.classList.contains(this._stickCellCss))return;for(let n of e)o.style[n]="",o.classList.remove(this._borderCellCss[n]);yi.some(n=>e.indexOf(n)===-1&&o.style[n])?o.style.zIndex=this._getCalculatedZIndex(o):(o.style.zIndex="",this._needsPositionStickyOnElement&&(o.style.position=""),o.classList.remove(this._stickCellCss));}_addStickyStyle(o,e,t,n){o.classList.add(this._stickCellCss),n&&o.classList.add(this._borderCellCss[e]),o.style[e]=`${t}px`,o.style.zIndex=this._getCalculatedZIndex(o),this._needsPositionStickyOnElement&&(o.style.cssText+="position: -webkit-sticky; position: sticky; ");}_getCalculatedZIndex(o){let e={top:100,bottom:10,left:1,right:1},t=0;for(let n of yi)o.style[n]&&(t+=e[n]);return t?`${t}`:""}_getCellWidths(o,e=true){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],n=o.children;for(let a=0;a<n.length;a++){let r=n[a];t.push(this._retrieveElementSize(r).width);}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(o,e){let t=[],n=0;for(let a=0;a<o.length;a++)e[a]&&(t[a]=n,n+=o[a]);return t}_getStickyEndColumnPositions(o,e){let t=[],n=0;for(let a=o.length;a>0;a--)e[a]&&(t[a]=n,n+=o[a]);return t}_retrieveElementSize(o){let e=this._elemSizeCache.get(o);if(e)return e;let t=o.getBoundingClientRect(),n={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(o,n),this._resizeObserver.observe(o,{box:"border-box"})),n}_updateStickyColumnReplayQueue(o){this._removeFromStickyColumnReplayQueue(o.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(o);}_removeFromStickyColumnReplayQueue(o){let e=new Set(o);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(n=>!e.has(n));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length);}_updateCachedSizes(o){let e=false;for(let t of o){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};n.width!==this._elemSizeCache.get(t.target)?.width&&qi(t.target)&&(e=true),this._elemSizeCache.set(t.target,n);}e&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(let t of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(t.rows,t.stickyStartStates,t.stickyEndStates,true,false);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null;}},0));}};function qi(i){return ["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(o=>i.classList.contains(o))}var xe=new N("STICKY_POSITIONING_LISTENER");var at=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._rowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","rowOutlet",""]]})}return i})(),rt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._headerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","headerRowOutlet",""]]})}return i})(),st=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._footerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","footerRowOutlet",""]]})}return i})(),lt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._noDataRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","noDataRowOutlet",""]]})}return i})(),ct=(()=>{class i{_differs=w(ib);_changeDetectorRef=w(Gj);_elementRef=w(Lr);_dir=w(ru,{optional:true});_platform=w(G);_viewRepeater;_viewportRuler=w(L);_injector=w(be);_virtualScrollViewport=w(gi,{optional:true,host:true});_positionListener=w(xe,{optional:true})||w(xe,{optional:true,skipSelf:true});_document=w(gr);_data;_renderedRange;_onDestroy=new te;_renderRows;_renderChangeSubscription=null;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef=null;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow=null;_headerRowDefChanged=true;_footerRowDefChanged=true;_stickyColumnStylesNeedReset=true;_forceRecalculateCellWidths=true;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=true;_isServer;_isShowingNoDataRow=false;_hasAllOutlets=false;_hasInitialized=false;_headerRowStickyUpdates=new te;_footerRowStickyUpdates=new te;_disableVirtualScrolling=false;_getCellRole(){if(this._cellRoleInternal===void 0){let e=this._elementRef.nativeElement.getAttribute("role");return e==="grid"||e==="treegrid"?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(e){this._trackByFn=e;}_trackByFn;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&(this._switchDataSource(e),this._changeDetectorRef.markForCheck());}_dataSource;_dataSourceChanges=new te;_dataStream=new te;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=e,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles());}_multiTemplateDataRows=false;get fixedLayout(){return this._virtualScrollEnabled()?true:this._fixedLayout}set fixedLayout(e){this._fixedLayout=e,this._forceRecalculateCellWidths=true,this._stickyColumnStylesNeedReset=true;}_fixedLayout=false;recycleRows=false;contentChanged=new Qe$1;viewChange=new Bn$1({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;get renderedRows(){return this._renderRows}constructor(){w(new Lg("role"),{optional:true})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable=this._elementRef.nativeElement.nodeName==="TABLE",this._dataDiffer=this._differs.find([]).create((t,n)=>this.trackBy?this.trackBy(n.dataIndex,n.data):n);}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(bu(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=true;});}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new jt:new _,this._virtualScrollEnabled()&&this._setupVirtualScrolling(this._virtualScrollViewport),this._hasInitialized=true;}ngAfterContentChecked(){this._canRender()&&this._render();}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(e=>{e?.clear();}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._headerRowStickyUpdates.complete(),this._footerRowStickyUpdates.complete(),this._onDestroy.next(),this._onDestroy.complete(),Ce$1(this.dataSource)&&this.dataSource.disconnect(this);}renderRows(){this._renderRows=this._getAllRenderRows();let e=this._dataDiffer.diff(this._renderRows);if(!e){this._updateNoDataRow(),this.contentChanged.next();return}let t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,t,(n,a,r)=>this._getEmbeddedViewArgs(n.item,r),n=>n.item.data,n=>{n.operation===Y$1.INSERTED&&n.context&&this._renderCellTemplateForItem(n.record.item.rowDef,n.context);}),this._updateRowIndexContext(),e.forEachIdentityChange(n=>{let a=t.get(n.currentIndex);a.context.$implicit=n.item.data;}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles();}addColumnDef(e){this._customColumnDefs.add(e);}removeColumnDef(e){this._customColumnDefs.delete(e);}addRowDef(e){this._customRowDefs.add(e);}removeRowDef(e){this._customRowDefs.delete(e);}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=true;}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=true;}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=true;}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=true;}setNoDataRow(e){this._customNoDataRow=e;}updateStickyHeaderRowStyles(){let e=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._headerRowOutlet,"thead");n&&(n.style.display=e.length?"":"none");}let t=this._headerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyFooterRowStyles(){let e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._footerRowOutlet,"tfoot");n&&(n.style.display=e.length?"":"none");}let t=this._footerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyColumnStyles(){let e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),n=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...n],["left","right"]),this._stickyColumnStylesNeedReset=false),e.forEach((a,r)=>{this._addStickyColumnStyles([a],this._headerRowDefs[r]);}),this._rowDefs.forEach(a=>{let r=[];for(let l=0;l<t.length;l++)this._renderRows[l].rowDef===a&&r.push(t[l]);this._addStickyColumnStyles(r,a);}),n.forEach((a,r)=>{this._addStickyColumnStyles([a],this._footerRowDefs[r]);}),Array.from(this._columnDefsByName.values()).forEach(a=>a.resetStickyChanged());}stickyColumnsUpdated(e){this._positionListener?.stickyColumnsUpdated(e);}stickyEndColumnsUpdated(e){this._positionListener?.stickyEndColumnsUpdated(e);}stickyHeaderRowsUpdated(e){this._headerRowStickyUpdates.next(e),this._positionListener?.stickyHeaderRowsUpdated(e);}stickyFooterRowsUpdated(e){this._footerRowStickyUpdates.next(e),this._positionListener?.stickyFooterRowsUpdated(e);}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=true,this._canRender()&&this._render());}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&this._rowDefs.length;let t=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||t,this._forceRecalculateCellWidths=t,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=false),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=false),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates();}_getAllRenderRows(){if(!Array.isArray(this._data)||!this._renderedRange)return [];let e=[],t=Math.min(this._data.length,this._renderedRange.end),n=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let a=this._renderedRange.start;a<t;a++){let r=this._data[a],l=this._getRenderRowsForData(r,a,n.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(let u=0;u<l.length;u++){let p=l[u],g=this._cachedRenderRowsMap.get(p.data);g.has(p.rowDef)?g.get(p.rowDef).push(p):g.set(p.rowDef,[p]),e.push(p);}}return e}_getRenderRowsForData(e,t,n){return this._getRowDefs(e,t).map(r=>{let l=n&&n.has(r)?n.get(r):[];if(l.length){let u=l.shift();return u.dataIndex=t,u}else return {data:e,rowDef:r,dataIndex:t}})}_cacheColumnDefs(){this._columnDefsByName.clear(),je(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t);});}_cacheRowDefs(){this._headerRowDefs=je(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=je(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=je(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);let e=this._rowDefs.filter(t=>!t.when);this._defaultRowDef=e[0];}_renderUpdatedColumns(){let e=(r,l)=>{let u=!!l.getColumnsDiff();return r||u},t=this._rowDefs.reduce(e,false);t&&this._forceRenderDataRows();let n=this._headerRowDefs.reduce(e,false);n&&this._forceRenderHeaderRows();let a=this._footerRowDefs.reduce(e,false);return a&&this._forceRenderFooterRows(),t||n||a}_switchDataSource(e){this._data=[],Ce$1(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=e;}_observeRenderChanges(){if(!this.dataSource)return;let e;Ce$1(this.dataSource)?e=this.dataSource.connect(this):Cm(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=Tm(this.dataSource)),this._renderChangeSubscription=Fm([e,this.viewChange]).pipe(bu(this._onDestroy)).subscribe(([t,n])=>{this._data=t||[],this._renderedRange=n,this._dataStream.next(t),this.renderRows();});}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((e,t)=>this._renderRow(this._headerRowOutlet,e,t)),this.updateStickyHeaderRowStyles();}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((e,t)=>this._renderRow(this._footerRowOutlet,e,t)),this.updateStickyFooterRowStyles();}_addStickyColumnStyles(e,t){let n=Array.from(t?.columns||[]).map(l=>{let u=this._columnDefsByName.get(l);return u}),a=n.map(l=>l.sticky),r=n.map(l=>l.stickyEnd);this._stickyStyler.updateStickyColumns(e,a,r,!this.fixedLayout||this._forceRecalculateCellWidths);}_getRenderedRows(e){let t=[];for(let n=0;n<e.viewContainer.length;n++){let a=e.viewContainer.get(n);t.push(a.rootNodes[0]);}return t}_getRowDefs(e,t){if(this._rowDefs.length===1)return [this._rowDefs[0]];let n=[];if(this.multiTemplateDataRows)n=this._rowDefs.filter(a=>!a.when||a.when(t,e));else {let a=this._rowDefs.find(r=>r.when&&r.when(t,e))||this._defaultRowDef;a&&n.push(a);}return n.length,n}_getEmbeddedViewArgs(e,t){let n=e.rowDef,a={$implicit:e.data};return {templateRef:n.template,context:a,index:t}}_renderRow(e,t,n,a={}){let r=e.viewContainer.createEmbeddedView(t.template,a,n);return this._renderCellTemplateForItem(t,a),r}_renderCellTemplateForItem(e,t){for(let n of this._getCellTemplates(e))ae.mostRecentCellOutlet&&ae.mostRecentCellOutlet._viewContainer.createEmbeddedView(n,t);this._changeDetectorRef.markForCheck();}_updateRowIndexContext(){let e=this._rowOutlet.viewContainer;for(let t=0,n=e.length;t<n;t++){let r=e.get(t).context;r.count=n,r.first=t===0,r.last=t===n-1,r.even=t%2===0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex;}}_getCellTemplates(e){return !e||!e.columns?[]:Array.from(e.columns,t=>{let n=this._columnDefsByName.get(t);return e.extractCellTemplate(n)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows();}_checkStickyStates(){let e=(t,n)=>t||n.hasStickyChanged();this._headerRowDefs.reduce(e,false)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,false)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,false)&&(this._stickyColumnStylesNeedReset=true,this.updateStickyColumnStyles());}_setupStickyStyler(){let e=this._dir?this._dir.value:"ltr",t=this._injector;this._stickyStyler=new et(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,e,this,t),(this._dir?this._dir.change:Tm()).pipe(bu(this._onDestroy)).subscribe(n=>{this._stickyStyler.direction=n,this.updateStickyColumnStyles();});}_setupVirtualScrolling(e){let t=typeof requestAnimationFrame<"u"?wm:Dm;this.viewChange.next({start:0,end:0}),e.renderedRangeStream.pipe(Qm(0,t),bu(this._onDestroy)).subscribe(this.viewChange),e.attach({dataStream:this._dataStream,measureRangeSize:(n,a)=>this._measureRangeSize(n,a)}),Fm([e.renderedContentOffset,this._headerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l){let u=a.offsets[r],p=n!==0?Math.max(n-u,u):-u;for(let g of l)g.style.top=`${-p}px`;}}}),Fm([e.renderedContentOffset,this._footerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l)for(let u of l)u.style.bottom=`${n+a.offsets[r]}px`;}});}_getOwnDefs(e){return e.filter(t=>!t._table||t._table===this)}_updateNoDataRow(){let e=this._customNoDataRow||this._noDataRow;if(!e)return;let t=this._rowOutlet.viewContainer.length===0;if(t===this._isShowingNoDataRow)return;let n=this._noDataRowOutlet.viewContainer;if(t){let a=n.createEmbeddedView(e.templateRef),r=a.rootNodes[0];if(a.rootNodes.length===1&&r?.nodeType===this._document.ELEMENT_NODE){r.setAttribute("role","row"),r.classList.add(...e._contentClassNames);let l=r.querySelectorAll(e._cellSelector);for(let u=0;u<l.length;u++)l[u].classList.add(...e._cellClassNames);}}else n.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck();}_measureRangeSize(e,t){if(e.start>=e.end||t!=="vertical")return 0;let n=this.viewChange.value,a=this._rowOutlet.viewContainer;e.start<n.start||e.end>n.end;let r=e.start-n.start,l=e.end-e.start,u,p;for(let S=0;S<l;S++){let R=a.get(S+r);if(R&&R.rootNodes.length){u=p=R.rootNodes[0];break}}for(let S=l-1;S>-1;S--){let R=a.get(S+r);if(R&&R.rootNodes.length){p=R.rootNodes[R.rootNodes.length-1];break}}let g=u?.getBoundingClientRect?.(),w=p?.getBoundingClientRect?.();return g&&w?w.bottom-g.top:0}_virtualScrollEnabled(){return !this._disableVirtualScrolling&&this._virtualScrollViewport!=null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,We,5)(a,Y,5)(a,Qe,5)(a,Me,5)(a,it,5),t&2){let r;Zw(r=Yw())&&(n._noDataRow=r.first),Zw(r=Yw())&&(n._contentColumnDefs=r),Zw(r=Yw())&&(n._contentRowDefs=r),Zw(r=Yw())&&(n._contentHeaderRowDefs=r),Zw(r=Yw())&&(n._contentFooterRowDefs=r);}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("cdk-table-fixed-layout",n.fixedLayout);},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",Zj],fixedLayout:[2,"fixedLayout","fixedLayout",Zj],recycleRows:[2,"recycleRows","recycleRows",Zj]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[LT([{provide:A,useExisting:i},{provide:xe,useValue:null}])],ngContentSelectors:Ui,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Vi),zw(0),zw(1,1),_w(2,$i,1,0),_w(3,Qi,7,0)(4,Wi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.cdk-table-fixed-layout {
|
|
1
|
+
import {O}from'./chunk-x7L6DXVK.js';import {w,aS as De,aY as xe$1,a7 as Gj,i as ir,aR as lt$1,ab as te,$ as $j,cN as Wl,a_ as Gp,W as Wp,E as Em,F as Fa,cO as eu,cP as Z,as as ke,J as JD,cQ as ce,bb as rt$1,bc as ae$1,bH as ln$1,bd as an$1,O as Op,o as eu$1,y as yt,b as wt,cR as zt,bg as mt,c as $h,P as Pi$1,T as TT,u as ul,k as Qh,cS as pl,cf as xh,cT as hl,B as Bh,e as EE,f as eg,K as Kw,aB as gr,aF as Pr,ac as Mr,cU as $n,az as Yj,ad as Qe$1,aa as N,bA as Ft,bB as F,al as Zj,_ as _w,cn as wd,cV as Td,M as Mw,bp as gl,an as Hh,cW as Ur,ak as nw,ay as lv,cX as Xt,aq as Bn$1,cY as Io,aj as zm,cZ as Tm,c_ as Fm,c2 as bh,c3 as Qs,c4 as Fn$1,c8 as Sv,c9 as Sh,bV as Gw,bW as zw,am as LT,s as sg,c$ as Wh,bI as Lt,bQ as Dn$1,a6 as Lr,d0 as dh,bR as ot$1,v as vt,aD as Ce,bS as oa,ci as dl,cj as fl,bu as ut,aQ as ee,d1 as Hj,bh as xp,aA as gg,h as Fw,l as ud,g as qw,m as dd,X as xw,Y as Aw,bl as Jw,d2 as wt$1,d3 as ib,a9 as ru,cl as G,aC as L,ae as be,d4 as gi,bT as Lg,ag as bu,d5 as jt,d6 as _,d7 as Ce$1,d8 as Y$1,d9 as Cm,da as Qm,aJ as wm,db as Dm,ca as Kh,c0 as Zw,c1 as Yw,ap as Ki$1,co as Mr$1,dc as O$1,dd as $e$1,de as Nt,df as Vt,dg as pt,dh as zt$1,di as jt$1,bi as Eg,bj as ST,dj as Nw,bm as Ig,dk as Vh,at as Tp,cp as Uh}from'./main-YKDNK5VZ.js';var Vi=[[["caption"]],[["colgroup"],["col"]],"*"],Ui=["caption","colgroup, col","*"];function $i(i,o){i&1&&zw(0,2);}function Qi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",0),Wh(3,2)(4,3),ul(),Pi$1(5,"tfoot",0),Wh(6,4),ul());}function Wi(i,o){i&1&&Wh(0,1)(1,2)(2,3)(3,4);}var A=new N("CDK_TABLE");var Ue=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellDef",""]]})}return i})(),$e=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkHeaderCellDef",""]]})}return i})(),Ci=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkFooterCellDef",""]]})}return i})(),Y=(()=>{class i{_table=w(A,{optional:true});_hasStickyChanged=false;get name(){return this._name}set name(e){this._setNameInput(e);}_name;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;get stickyEnd(){return this._stickyEnd}set stickyEnd(e){e!==this._stickyEnd&&(this._stickyEnd=e,this._hasStickyChanged=true);}_stickyEnd=false;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`];}_setNameInput(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName());}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,Ue,5)(a,$e,5)(a,Ci,5),t&2){let r;Zw(r=Yw())&&(n.cell=r.first),Zw(r=Yw())&&(n.headerCell=r.first),Zw(r=Yw())&&(n.footerCell=r.first);}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",Zj],stickyEnd:[2,"stickyEnd","stickyEnd",Zj]}})}return i})(),Ve=class{constructor(o,e){e.nativeElement.classList.add(...o._columnCssClassName);}},bi=(()=>{class i extends Ve{constructor(){super(w(Y),w(Lr));}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[Sh]})}return i})();var Di=(()=>{class i extends Ve{constructor(){let e=w(Y),t=w(Lr);super(e,t);let n=e._table?._getCellRole();n&&t.nativeElement.setAttribute("role",n);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[Sh]})}return i})();var tt=(()=>{class i{template=w(Mr$1);_differs=w(ib);columns;_columnsDiffer;ngOnChanges(e){if(!this._columnsDiffer){let t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t);}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof Me?e.headerCell.template:this instanceof it?e.footerCell.template:e.cell.template}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,features:[lv]})}return i})(),Me=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),it=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),Qe=(()=>{class i extends tt{_table=w(A,{optional:true});when;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[Sh]})}return i})(),ae=(()=>{class i{_viewContainer=w(Ki$1);cells;context;static mostRecentCellOutlet=null;constructor(){i.mostRecentCellOutlet=this;}ngOnDestroy(){i.mostRecentCellOutlet===this&&(i.mostRecentCellOutlet=null);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellOutlet",""]]})}return i})(),nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-header-row"],["tr","cdk-header-row",""]],hostAttrs:["role","row",1,"cdk-header-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})();var ot=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})(),We=(()=>{class i{templateRef=w(Mr$1);_contentClassNames=["cdk-no-data-row","cdk-row"];_cellClassNames=["cdk-cell","cdk-no-data-cell"];_cellSelector="td, cdk-cell, [cdk-cell], .cdk-cell";static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["ng-template","cdkNoDataRow",""]]})}return i})(),yi=["top","bottom","left","right"],et=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(o=>this._updateCachedSizes(o)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=false;constructor(o,e,t=true,n=true,a,r,l){this._isNativeHtmlTable=o,this._stickCellCss=e,this._isBrowser=t,this._needsPositionStickyOnElement=n,this.direction=a,this._positionListener=r,this._tableInjector=l,this._borderCellCss={top:`${e}-border-elem-top`,bottom:`${e}-border-elem-bottom`,left:`${e}-border-elem-left`,right:`${e}-border-elem-right`};}clearStickyPositioning(o,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(o);let t=[];for(let n of o)n.nodeType===n.ELEMENT_NODE&&t.push(n,...Array.from(n.children));Tp({write:()=>{for(let n of t)this._removeStickyStyle(n,e);}},{injector:this._tableInjector});}updateStickyColumns(o,e,t,n=true,a=true){if(!o.length||!this._isBrowser||!(e.some(P=>P)||t.some(P=>P))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let r=o[0],l=r.children.length,u=this.direction==="rtl",p=u?"right":"left",g=u?"left":"right",w=e.lastIndexOf(true),S=t.indexOf(true),R,mt,ut;a&&this._updateStickyColumnReplayQueue({rows:[...o],stickyStartStates:[...e],stickyEndStates:[...t]}),Tp({earlyRead:()=>{R=this._getCellWidths(r,n),mt=this._getStickyStartColumnPositions(R,e),ut=this._getStickyEndColumnPositions(R,t);},write:()=>{for(let P of o)for(let I=0;I<l;I++){let ft=P.children[I];e[I]&&this._addStickyStyle(ft,p,mt[I],I===w),t[I]&&this._addStickyStyle(ft,g,ut[I],I===S);}this._positionListener&&R.some(P=>!!P)&&(this._positionListener.stickyColumnsUpdated({sizes:w===-1?[]:R.slice(0,w+1).map((P,I)=>e[I]?P:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:S===-1?[]:R.slice(S).map((P,I)=>t[I+S]?P:null).reverse()}));}},{injector:this._tableInjector});}stickRows(o,e,t){if(!this._isBrowser)return;let n=t==="bottom"?o.slice().reverse():o,a=t==="bottom"?e.slice().reverse():e,r=[],l=[],u=[];Tp({earlyRead:()=>{for(let p=0,g=0;p<n.length;p++){if(!a[p])continue;r[p]=g;let w=n[p];u[p]=this._isNativeHtmlTable?Array.from(w.children):[w];let S=this._retrieveElementSize(w).height;g+=S,l[p]=S;}},write:()=>{let p=a.lastIndexOf(true);for(let g=0;g<n.length;g++){if(!a[g])continue;let w=r[g],S=g===p;for(let R of u[g])this._addStickyStyle(R,t,w,S);}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:l,offsets:r,elements:u}):this._positionListener?.stickyFooterRowsUpdated({sizes:l,offsets:r,elements:u});}},{injector:this._tableInjector});}updateStickyFooterContainer(o,e){this._isNativeHtmlTable&&Tp({write:()=>{let t=o.querySelector("tfoot");t&&(e.some(n=>!n)?this._removeStickyStyle(t,["bottom"]):this._addStickyStyle(t,"bottom",0,false));}},{injector:this._tableInjector});}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=true;}_removeStickyStyle(o,e){if(!o.classList.contains(this._stickCellCss))return;for(let n of e)o.style[n]="",o.classList.remove(this._borderCellCss[n]);yi.some(n=>e.indexOf(n)===-1&&o.style[n])?o.style.zIndex=this._getCalculatedZIndex(o):(o.style.zIndex="",this._needsPositionStickyOnElement&&(o.style.position=""),o.classList.remove(this._stickCellCss));}_addStickyStyle(o,e,t,n){o.classList.add(this._stickCellCss),n&&o.classList.add(this._borderCellCss[e]),o.style[e]=`${t}px`,o.style.zIndex=this._getCalculatedZIndex(o),this._needsPositionStickyOnElement&&(o.style.cssText+="position: -webkit-sticky; position: sticky; ");}_getCalculatedZIndex(o){let e={top:100,bottom:10,left:1,right:1},t=0;for(let n of yi)o.style[n]&&(t+=e[n]);return t?`${t}`:""}_getCellWidths(o,e=true){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],n=o.children;for(let a=0;a<n.length;a++){let r=n[a];t.push(this._retrieveElementSize(r).width);}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(o,e){let t=[],n=0;for(let a=0;a<o.length;a++)e[a]&&(t[a]=n,n+=o[a]);return t}_getStickyEndColumnPositions(o,e){let t=[],n=0;for(let a=o.length;a>0;a--)e[a]&&(t[a]=n,n+=o[a]);return t}_retrieveElementSize(o){let e=this._elemSizeCache.get(o);if(e)return e;let t=o.getBoundingClientRect(),n={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(o,n),this._resizeObserver.observe(o,{box:"border-box"})),n}_updateStickyColumnReplayQueue(o){this._removeFromStickyColumnReplayQueue(o.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(o);}_removeFromStickyColumnReplayQueue(o){let e=new Set(o);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(n=>!e.has(n));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length);}_updateCachedSizes(o){let e=false;for(let t of o){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};n.width!==this._elemSizeCache.get(t.target)?.width&&qi(t.target)&&(e=true),this._elemSizeCache.set(t.target,n);}e&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(let t of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(t.rows,t.stickyStartStates,t.stickyEndStates,true,false);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null;}},0));}};function qi(i){return ["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(o=>i.classList.contains(o))}var xe=new N("STICKY_POSITIONING_LISTENER");var at=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._rowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","rowOutlet",""]]})}return i})(),rt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._headerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","headerRowOutlet",""]]})}return i})(),st=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._footerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","footerRowOutlet",""]]})}return i})(),lt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._noDataRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","noDataRowOutlet",""]]})}return i})(),ct=(()=>{class i{_differs=w(ib);_changeDetectorRef=w(Gj);_elementRef=w(Lr);_dir=w(ru,{optional:true});_platform=w(G);_viewRepeater;_viewportRuler=w(L);_injector=w(be);_virtualScrollViewport=w(gi,{optional:true,host:true});_positionListener=w(xe,{optional:true})||w(xe,{optional:true,skipSelf:true});_document=w(gr);_data;_renderedRange;_onDestroy=new te;_renderRows;_renderChangeSubscription=null;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef=null;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow=null;_headerRowDefChanged=true;_footerRowDefChanged=true;_stickyColumnStylesNeedReset=true;_forceRecalculateCellWidths=true;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=true;_isServer;_isShowingNoDataRow=false;_hasAllOutlets=false;_hasInitialized=false;_headerRowStickyUpdates=new te;_footerRowStickyUpdates=new te;_disableVirtualScrolling=false;_getCellRole(){if(this._cellRoleInternal===void 0){let e=this._elementRef.nativeElement.getAttribute("role");return e==="grid"||e==="treegrid"?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(e){this._trackByFn=e;}_trackByFn;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&(this._switchDataSource(e),this._changeDetectorRef.markForCheck());}_dataSource;_dataSourceChanges=new te;_dataStream=new te;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=e,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles());}_multiTemplateDataRows=false;get fixedLayout(){return this._virtualScrollEnabled()?true:this._fixedLayout}set fixedLayout(e){this._fixedLayout=e,this._forceRecalculateCellWidths=true,this._stickyColumnStylesNeedReset=true;}_fixedLayout=false;recycleRows=false;contentChanged=new Qe$1;viewChange=new Bn$1({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;get renderedRows(){return this._renderRows}constructor(){w(new Lg("role"),{optional:true})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable=this._elementRef.nativeElement.nodeName==="TABLE",this._dataDiffer=this._differs.find([]).create((t,n)=>this.trackBy?this.trackBy(n.dataIndex,n.data):n);}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(bu(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=true;});}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new jt:new _,this._virtualScrollEnabled()&&this._setupVirtualScrolling(this._virtualScrollViewport),this._hasInitialized=true;}ngAfterContentChecked(){this._canRender()&&this._render();}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(e=>{e?.clear();}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._headerRowStickyUpdates.complete(),this._footerRowStickyUpdates.complete(),this._onDestroy.next(),this._onDestroy.complete(),Ce$1(this.dataSource)&&this.dataSource.disconnect(this);}renderRows(){this._renderRows=this._getAllRenderRows();let e=this._dataDiffer.diff(this._renderRows);if(!e){this._updateNoDataRow(),this.contentChanged.next();return}let t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,t,(n,a,r)=>this._getEmbeddedViewArgs(n.item,r),n=>n.item.data,n=>{n.operation===Y$1.INSERTED&&n.context&&this._renderCellTemplateForItem(n.record.item.rowDef,n.context);}),this._updateRowIndexContext(),e.forEachIdentityChange(n=>{let a=t.get(n.currentIndex);a.context.$implicit=n.item.data;}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles();}addColumnDef(e){this._customColumnDefs.add(e);}removeColumnDef(e){this._customColumnDefs.delete(e);}addRowDef(e){this._customRowDefs.add(e);}removeRowDef(e){this._customRowDefs.delete(e);}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=true;}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=true;}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=true;}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=true;}setNoDataRow(e){this._customNoDataRow=e;}updateStickyHeaderRowStyles(){let e=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._headerRowOutlet,"thead");n&&(n.style.display=e.length?"":"none");}let t=this._headerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyFooterRowStyles(){let e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._footerRowOutlet,"tfoot");n&&(n.style.display=e.length?"":"none");}let t=this._footerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyColumnStyles(){let e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),n=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...n],["left","right"]),this._stickyColumnStylesNeedReset=false),e.forEach((a,r)=>{this._addStickyColumnStyles([a],this._headerRowDefs[r]);}),this._rowDefs.forEach(a=>{let r=[];for(let l=0;l<t.length;l++)this._renderRows[l].rowDef===a&&r.push(t[l]);this._addStickyColumnStyles(r,a);}),n.forEach((a,r)=>{this._addStickyColumnStyles([a],this._footerRowDefs[r]);}),Array.from(this._columnDefsByName.values()).forEach(a=>a.resetStickyChanged());}stickyColumnsUpdated(e){this._positionListener?.stickyColumnsUpdated(e);}stickyEndColumnsUpdated(e){this._positionListener?.stickyEndColumnsUpdated(e);}stickyHeaderRowsUpdated(e){this._headerRowStickyUpdates.next(e),this._positionListener?.stickyHeaderRowsUpdated(e);}stickyFooterRowsUpdated(e){this._footerRowStickyUpdates.next(e),this._positionListener?.stickyFooterRowsUpdated(e);}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=true,this._canRender()&&this._render());}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&this._rowDefs.length;let t=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||t,this._forceRecalculateCellWidths=t,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=false),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=false),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates();}_getAllRenderRows(){if(!Array.isArray(this._data)||!this._renderedRange)return [];let e=[],t=Math.min(this._data.length,this._renderedRange.end),n=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let a=this._renderedRange.start;a<t;a++){let r=this._data[a],l=this._getRenderRowsForData(r,a,n.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(let u=0;u<l.length;u++){let p=l[u],g=this._cachedRenderRowsMap.get(p.data);g.has(p.rowDef)?g.get(p.rowDef).push(p):g.set(p.rowDef,[p]),e.push(p);}}return e}_getRenderRowsForData(e,t,n){return this._getRowDefs(e,t).map(r=>{let l=n&&n.has(r)?n.get(r):[];if(l.length){let u=l.shift();return u.dataIndex=t,u}else return {data:e,rowDef:r,dataIndex:t}})}_cacheColumnDefs(){this._columnDefsByName.clear(),je(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t);});}_cacheRowDefs(){this._headerRowDefs=je(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=je(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=je(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);let e=this._rowDefs.filter(t=>!t.when);this._defaultRowDef=e[0];}_renderUpdatedColumns(){let e=(r,l)=>{let u=!!l.getColumnsDiff();return r||u},t=this._rowDefs.reduce(e,false);t&&this._forceRenderDataRows();let n=this._headerRowDefs.reduce(e,false);n&&this._forceRenderHeaderRows();let a=this._footerRowDefs.reduce(e,false);return a&&this._forceRenderFooterRows(),t||n||a}_switchDataSource(e){this._data=[],Ce$1(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=e;}_observeRenderChanges(){if(!this.dataSource)return;let e;Ce$1(this.dataSource)?e=this.dataSource.connect(this):Cm(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=Tm(this.dataSource)),this._renderChangeSubscription=Fm([e,this.viewChange]).pipe(bu(this._onDestroy)).subscribe(([t,n])=>{this._data=t||[],this._renderedRange=n,this._dataStream.next(t),this.renderRows();});}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((e,t)=>this._renderRow(this._headerRowOutlet,e,t)),this.updateStickyHeaderRowStyles();}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((e,t)=>this._renderRow(this._footerRowOutlet,e,t)),this.updateStickyFooterRowStyles();}_addStickyColumnStyles(e,t){let n=Array.from(t?.columns||[]).map(l=>{let u=this._columnDefsByName.get(l);return u}),a=n.map(l=>l.sticky),r=n.map(l=>l.stickyEnd);this._stickyStyler.updateStickyColumns(e,a,r,!this.fixedLayout||this._forceRecalculateCellWidths);}_getRenderedRows(e){let t=[];for(let n=0;n<e.viewContainer.length;n++){let a=e.viewContainer.get(n);t.push(a.rootNodes[0]);}return t}_getRowDefs(e,t){if(this._rowDefs.length===1)return [this._rowDefs[0]];let n=[];if(this.multiTemplateDataRows)n=this._rowDefs.filter(a=>!a.when||a.when(t,e));else {let a=this._rowDefs.find(r=>r.when&&r.when(t,e))||this._defaultRowDef;a&&n.push(a);}return n.length,n}_getEmbeddedViewArgs(e,t){let n=e.rowDef,a={$implicit:e.data};return {templateRef:n.template,context:a,index:t}}_renderRow(e,t,n,a={}){let r=e.viewContainer.createEmbeddedView(t.template,a,n);return this._renderCellTemplateForItem(t,a),r}_renderCellTemplateForItem(e,t){for(let n of this._getCellTemplates(e))ae.mostRecentCellOutlet&&ae.mostRecentCellOutlet._viewContainer.createEmbeddedView(n,t);this._changeDetectorRef.markForCheck();}_updateRowIndexContext(){let e=this._rowOutlet.viewContainer;for(let t=0,n=e.length;t<n;t++){let r=e.get(t).context;r.count=n,r.first=t===0,r.last=t===n-1,r.even=t%2===0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex;}}_getCellTemplates(e){return !e||!e.columns?[]:Array.from(e.columns,t=>{let n=this._columnDefsByName.get(t);return e.extractCellTemplate(n)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows();}_checkStickyStates(){let e=(t,n)=>t||n.hasStickyChanged();this._headerRowDefs.reduce(e,false)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,false)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,false)&&(this._stickyColumnStylesNeedReset=true,this.updateStickyColumnStyles());}_setupStickyStyler(){let e=this._dir?this._dir.value:"ltr",t=this._injector;this._stickyStyler=new et(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,e,this,t),(this._dir?this._dir.change:Tm()).pipe(bu(this._onDestroy)).subscribe(n=>{this._stickyStyler.direction=n,this.updateStickyColumnStyles();});}_setupVirtualScrolling(e){let t=typeof requestAnimationFrame<"u"?wm:Dm;this.viewChange.next({start:0,end:0}),e.renderedRangeStream.pipe(Qm(0,t),bu(this._onDestroy)).subscribe(this.viewChange),e.attach({dataStream:this._dataStream,measureRangeSize:(n,a)=>this._measureRangeSize(n,a)}),Fm([e.renderedContentOffset,this._headerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l){let u=a.offsets[r],p=n!==0?Math.max(n-u,u):-u;for(let g of l)g.style.top=`${-p}px`;}}}),Fm([e.renderedContentOffset,this._footerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l)for(let u of l)u.style.bottom=`${n+a.offsets[r]}px`;}});}_getOwnDefs(e){return e.filter(t=>!t._table||t._table===this)}_updateNoDataRow(){let e=this._customNoDataRow||this._noDataRow;if(!e)return;let t=this._rowOutlet.viewContainer.length===0;if(t===this._isShowingNoDataRow)return;let n=this._noDataRowOutlet.viewContainer;if(t){let a=n.createEmbeddedView(e.templateRef),r=a.rootNodes[0];if(a.rootNodes.length===1&&r?.nodeType===this._document.ELEMENT_NODE){r.setAttribute("role","row"),r.classList.add(...e._contentClassNames);let l=r.querySelectorAll(e._cellSelector);for(let u=0;u<l.length;u++)l[u].classList.add(...e._cellClassNames);}}else n.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck();}_measureRangeSize(e,t){if(e.start>=e.end||t!=="vertical")return 0;let n=this.viewChange.value,a=this._rowOutlet.viewContainer;e.start<n.start||e.end>n.end;let r=e.start-n.start,l=e.end-e.start,u,p;for(let S=0;S<l;S++){let R=a.get(S+r);if(R&&R.rootNodes.length){u=p=R.rootNodes[0];break}}for(let S=l-1;S>-1;S--){let R=a.get(S+r);if(R&&R.rootNodes.length){p=R.rootNodes[R.rootNodes.length-1];break}}let g=u?.getBoundingClientRect?.(),w=p?.getBoundingClientRect?.();return g&&w?w.bottom-g.top:0}_virtualScrollEnabled(){return !this._disableVirtualScrolling&&this._virtualScrollViewport!=null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,We,5)(a,Y,5)(a,Qe,5)(a,Me,5)(a,it,5),t&2){let r;Zw(r=Yw())&&(n._noDataRow=r.first),Zw(r=Yw())&&(n._contentColumnDefs=r),Zw(r=Yw())&&(n._contentRowDefs=r),Zw(r=Yw())&&(n._contentHeaderRowDefs=r),Zw(r=Yw())&&(n._contentFooterRowDefs=r);}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("cdk-table-fixed-layout",n.fixedLayout);},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",Zj],fixedLayout:[2,"fixedLayout","fixedLayout",Zj],recycleRows:[2,"recycleRows","recycleRows",Zj]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[LT([{provide:A,useExisting:i},{provide:xe,useValue:null}])],ngContentSelectors:Ui,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Vi),zw(0),zw(1,1),_w(2,$i,1,0),_w(3,Qi,7,0)(4,Wi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.cdk-table-fixed-layout {
|
|
2
2
|
table-layout: fixed;
|
|
3
3
|
}
|
|
4
4
|
`],encapsulation:2,changeDetection:1})}return i})();function je(i,o){return i.concat(Array.from(o))}function wi(i,o){let e=o.toUpperCase(),t=i.viewContainer.element.nativeElement;for(;t;){let n=t.nodeType===1?t.nodeName:null;if(n===e)return t;if(n==="TABLE")break;t=t.parentNode;}return null}var vi=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=bh({type:i});static \u0275inj=Qs({imports:[wt$1]})}return i})();var Gi=[[["caption"]],[["colgroup"],["col"]],"*"],Ki=["caption","colgroup, col","*"];function Yi(i,o){i&1&&zw(0,2);}function Zi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",2),Wh(3,3)(4,4),ul(),Pi$1(5,"tfoot",0),Wh(6,5),ul());}function Xi(i,o){i&1&&Wh(0,1)(1,3)(2,4)(3,5);}var Si=(()=>{class i extends ct{stickyCssClass="mat-mdc-table-sticky";needsPositionStickyOnElement=false;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275cmp=JD({type:i,selectors:[["mat-table"],["table","mat-table",""]],hostAttrs:[1,"mat-mdc-table","mdc-data-table__table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("mat-table-fixed-layout",n.fixedLayout);},exportAs:["matTable"],features:[LT([{provide:ct,useExisting:i},{provide:A,useExisting:i},{provide:xe,useValue:null}]),Sh],ngContentSelectors:Ki,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["role","rowgroup",1,"mdc-data-table__content"],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Gi),zw(0),zw(1,1),_w(2,Yi,1,0),_w(3,Zi,7,0)(4,Xi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.mat-mdc-table-sticky {
|