@mxtommy/kip 4.8.4 → 4.8.5
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 +1 -1
- package/plugin/history-series.service.js +637 -0
- package/plugin/index.js +1322 -0
- package/plugin/kip-series-contract.js +31 -0
- package/plugin/openApi.json +855 -0
- package/plugin/sqlite-history-storage.service.js +1124 -0
- package/public/assets/help-docs/ais-radar.md +261 -0
- package/public/assets/help-docs/dashboards.md +1 -1
- package/public/assets/help-docs/menu.json +17 -2
- package/public/{chunk-Co2wVrD6.js → chunk-0ijGpqkR.js} +1 -1
- package/public/{chunk-JhFkJS7i.js → chunk-6MiGh2Ts.js} +1 -1
- package/public/{chunk-DIl1k00y.js → chunk-7QXXQf2h.js} +1 -1
- package/public/{chunk-CYYBxjrc.js → chunk-B4Wxwb2y.js} +1 -1
- package/public/{chunk-q9NoPvcx.js → chunk-BAVmyVwG.js} +1 -1
- package/public/{chunk-BfiyH3nV.js → chunk-BOlUTHo6.js} +1 -1
- package/public/{chunk-x7L6DXVK.js → chunk-BTv5PhTr.js} +1 -1
- package/public/{chunk-BeM64etA.js → chunk-BZG04c3j.js} +1 -1
- package/public/{chunk-0z3nIRXw.js → chunk-BaGEtCmz.js} +1 -1
- package/public/{chunk-otzyItXL.js → chunk-Bbyk4dOu.js} +1 -1
- package/public/{chunk-CCfhzpE8.js → chunk-Be5KcT7R.js} +1 -1
- package/public/{chunk-BFpzxIIT.js → chunk-Bp1YVCJL.js} +1 -1
- package/public/{chunk-CLs_NL1y.js → chunk-BwYOFdBA.js} +1 -1
- package/public/{chunk-D-_-GUVr.js → chunk-Bx77STup.js} +1 -1
- package/public/{chunk-COI6IBXH.js → chunk-ByC_hFSP.js} +1 -1
- package/public/{chunk-CIGP2YJm.js → chunk-ByFzHU1s.js} +1 -1
- package/public/{chunk-CXvWM_vF.js → chunk-BzH86te1.js} +1 -1
- package/public/{chunk-CxPx4NZv.js → chunk-C7ax8Sqz.js} +1 -1
- package/public/{chunk-CoCQ3DW2.js → chunk-C89yhdsn.js} +1 -1
- package/public/{chunk-BTOTKeBo.js → chunk-CJhkckXA.js} +1 -1
- package/public/{chunk-BUguZ7cK.js → chunk-CLIWxVhS.js} +1 -1
- package/public/{chunk-eQ1pa34Q.js → chunk-CQtqkz1Y.js} +1 -1
- package/public/{chunk-BIb-xYiS.js → chunk-CRy9Da7a.js} +1 -1
- package/public/{chunk-Do8wqING.js → chunk-CcaPRVAZ.js} +1 -1
- package/public/{chunk-BjINKQ03.js → chunk-CdNfAZ0G.js} +1 -1
- package/public/{chunk-CLTHuhlN.js → chunk-Cj0AJQ8U.js} +1 -1
- package/public/{chunk-B9nVBlGj.js → chunk-CkFpNfxN.js} +1 -1
- package/public/{chunk-B09jfNia.js → chunk-Cn9j0-tJ.js} +1 -1
- package/public/{chunk-_zRMMvCu.js → chunk-Co8V0LUu.js} +1 -1
- package/public/{chunk-ibauGmSP.js → chunk-CteyWXZ_.js} +1 -1
- package/public/{chunk-C6b8CVno.js → chunk-CuPmfpgh.js} +1 -1
- package/public/{chunk-DmkAKXR1.js → chunk-CwGTKplC.js} +1 -1
- package/public/{chunk-DPnbM-aB.js → chunk-CzEDfe2A.js} +1 -1
- package/public/{chunk-DUEKoZhd.js → chunk-D1Yncgg5.js} +1 -1
- package/public/{chunk-DTN-sa1K.js → chunk-D63LEt5t.js} +1 -1
- package/public/{chunk-BpcNrtxJ.js → chunk-DN39qO63.js} +1 -1
- package/public/{chunk-szQs8fiq.js → chunk-DNbLx4NZ.js} +1 -1
- package/public/{chunk-D1HYfaL_.js → chunk-DRPjASjZ.js} +1 -1
- package/public/{chunk-CyVRpGoJ.js → chunk-Dddd8rAh.js} +1 -1
- package/public/{chunk-C_OZJltF.js → chunk-DiDkZnhZ.js} +1 -1
- package/public/{chunk-CHAFm_nM.js → chunk-DonRL_4T.js} +1 -1
- package/public/{chunk-BJ-wyixK.js → chunk-DufX2AHa.js} +1 -1
- package/public/{chunk-07zHjmg-.js → chunk-DxS7HN4G.js} +1 -1
- package/public/{chunk-BLEZOsfR.js → chunk-Fy40z1B2.js} +1 -1
- package/public/{chunk-OeQDZKFO.js → chunk-MO2v041V.js} +1 -1
- package/public/{chunk-BuvyF0y5.js → chunk-MakCt36b.js} +1 -1
- package/public/{chunk-BZx964-p.js → chunk-TdI_E-cf.js} +1 -1
- package/public/{chunk-B0D54iJs.js → chunk-TneLdWrI.js} +1 -1
- package/public/{chunk-BN7A4g6c.js → chunk-YZWhRxa9.js} +1 -1
- package/public/{chunk-CQMVIDcp.js → chunk-_toW-rHA.js} +1 -1
- package/public/{chunk-B0eE4udE.js → chunk-tbyiK3Ur.js} +1 -1
- package/public/{chunk-D2953Rfp.js → chunk-urAQA4U_.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-YKDNK5VZ.js → main-F7NMHHV4.js} +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import {v,R,S}from'./chunk-CQNVyz8q.js';import {d1 as Hj,w,du as p,dv as rt$1,D as Dt,v as vt,F as Fa,dn as ge,aI as ms,J as JD,c as $h,B as Bh,$ as $j,ao as ue,dz as es,cn as wd,ci as dl,cp as Uh,cj as fl,_ as _w,T as TT,bD as HT,e as EE,M as Mw,d as ig,an as Hh,aA as gg,dA as UT,f as eg,K as Kw}from'./main-YKDNK5VZ.js';var nt=["rotatingDial"],it=["awaIndicator"],at=["twaIndicator"],ot=["wptIndicator"],rt=["setIndicator"],st=["cogIndicator"];function lt(m,b){m&1&&(wd(),dl(0,"g",69)(1,"text",100)(2,"tspan",101),TT(3,"330"),fl()(),dl(4,"text",102)(5,"tspan",103),TT(6,"300"),fl()(),dl(7,"text",104)(8,"tspan",105),TT(9,"W"),fl()(),dl(10,"text",106)(11,"tspan",107),TT(12,"240"),fl()(),dl(13,"text",108)(14,"tspan",109),TT(15,"210"),fl()(),dl(16,"text",110)(17,"tspan",111),TT(18,"S"),fl()(),dl(19,"text",112)(20,"tspan",113),TT(21,"150"),fl()(),dl(22,"text",114)(23,"tspan",115),TT(24,"120"),fl()(),dl(25,"text",116)(26,"tspan",117),TT(27,"E"),fl()(),dl(28,"text",118)(29,"tspan",119),TT(30,"60"),fl()(),dl(31,"text",120)(32,"tspan",121),TT(33,"30"),fl()(),dl(34,"text",122)(35,"tspan",123),TT(36,"N"),fl()()());}function dt(m,b){m&1&&(wd(),dl(0,"g",70)(1,"text",100)(2,"tspan",101),TT(3,"30"),fl()(),dl(4,"text",102)(5,"tspan",103),TT(6,"60"),fl()(),dl(7,"text",104)(8,"tspan",105),TT(9,"90"),fl()(),dl(10,"text",106)(11,"tspan",107),TT(12,"120"),fl()(),dl(13,"text",108)(14,"tspan",109),TT(15,"150"),fl()(),dl(16,"text",110)(17,"tspan",111),TT(18,"180"),fl()(),dl(19,"text",112)(20,"tspan",113),TT(21,"150"),fl()(),dl(22,"text",114)(23,"tspan",115),TT(24,"120"),fl()(),dl(25,"text",116)(26,"tspan",117),TT(27,"90"),fl()(),dl(28,"text",118)(29,"tspan",119),TT(30,"60"),fl()(),dl(31,"text",120)(32,"tspan",121),TT(33,"30"),fl()(),dl(34,"text",122)(35,"tspan",123),TT(36,"0"),fl()()());}var Y=([m,b],[n,e],[t,o])=>(Math.atan2(o-e,t-n)-Math.atan2(b-e,m-n)+3*Math.PI)%(2*Math.PI)-Math.PI,J=(()=>{class m{rotatingDial=$j.required("rotatingDial");awaIndicator=$j.required("awaIndicator");twaIndicator=$j.required("twaIndicator");wptIndicator=$j.required("wptIndicator");setIndicator=$j.required("setIndicator");cogIndicator=$j.required("cogIndicator");compassHeading=Hj.required();compassModeEnabled=Hj.required();courseOverGroundAngle=Hj(void 0);courseOverGroundEnabled=Hj.required();trueWindAngle=Hj.required();twsEnabled=Hj.required();twaEnabled=Hj.required();trueWindSpeed=Hj.required();trueWindSpeedUnit=Hj.required();appWindAngle=Hj.required();awsEnabled=Hj.required();appWindSpeed=Hj.required();appWindSpeedUnit=Hj.required();laylineAngle=Hj(void 0);closeHauledLineEnabled=Hj.required();sailSetupEnabled=Hj.required();windSectorEnabled=Hj.required();driftEnabled=Hj.required();driftSet=Hj(void 0);driftFlow=Hj(void 0);waypointAngle=Hj(void 0);waypointEnabled=Hj.required();trueWindMinHistoric=Hj(void 0);trueWindMidHistoric=Hj(void 0);trueWindMaxHistoric=Hj(void 0);compass={oldValue:0,newValue:0};twa={oldValue:0,newValue:0};awa={oldValue:0,newValue:0};wpt={oldValue:0,newValue:0};cog={oldValue:0,newValue:0};set={oldValue:0,newValue:0};compassInitialized=false;twaInitialized=false;awaInitialized=false;wptInitialized=false;cogInitialized=false;setInitialized=false;headingValue=vt("--");trueWindHeading=0;waypointActive=vt(false);portLaylinePrev=0;stbdLaylinePrev=0;portLaylineAnimId=null;stbdLaylineAnimId=null;closeHauledLinePortPath=vt("M 500,500 500,500");closeHauledLineStbdPath=vt("M 500,500 500,500");portSectorPrev={min:0,mid:0,max:0};stbdSectorPrev={min:0,mid:0,max:0};portSectorAnimId=null;stbdSectorAnimId=null;portWindSectorPath=vt("");stbdWindSectorPath=vt("");animationFrameIds=new WeakMap;CENTER=500;RADIUS=350;ANIMATION_DURATION=900;EPS_ANGLE=1;ngZone=w(ue);setRotationImmediate(n,e){n.setAttribute("transform",`rotate(${e} 500 500)`);}constructor(){Fa(()=>{let n=this.waypointEnabled();ge(()=>{this.waypointActive.set(n);});}),Fa(()=>{let n=this.compassModeEnabled(),e=this.compassHeading(),t=Number.isFinite(e)?Math.round(e):null;t!=null&&ge(()=>{let o=n?t:0,r=!this.compassInitialized;r?(this.compass.oldValue=o,this.compass.newValue=o,this.compassInitialized=true):(this.compass.oldValue=this.compass.newValue,this.compass.newValue=o),this.headingValue.set(t.toString()),this.rotatingDial()?.nativeElement&&(r||this.compass.oldValue===this.compass.newValue?this.setRotationImmediate(this.rotatingDial().nativeElement,-this.compass.newValue):S(this.rotatingDial().nativeElement,-this.compass.oldValue,-this.compass.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone),this.updateCloseHauledLines(false),this.updateWindSectors(false));});}),Fa(()=>{let n=this.courseOverGroundAngle(),e=Number.isFinite(n)?Math.round(n):null,t=this.compassModeEnabled();e!=null&&ge(()=>{let o=t?this.compass.newValue:0,r=e-o,p=!this.cogInitialized;p?(this.cog.oldValue=r,this.cog.newValue=r,this.cogInitialized=true):(this.cog.oldValue=this.cog.newValue,this.cog.newValue=r),this.cogIndicator()?.nativeElement&&(p||this.cog.oldValue===this.cog.newValue?this.setRotationImmediate(this.cogIndicator().nativeElement,this.cog.newValue):S(this.cogIndicator().nativeElement,this.cog.oldValue,this.cog.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone));});}),Fa(()=>{let n=this.waypointAngle();ge(()=>{if(n==null||!Number.isFinite(n)){this.waypointActive.set(false);return}this.waypointEnabled()?this.waypointActive.set(true):this.waypointActive.set(false);let e=!this.wptInitialized;e?(this.wpt.oldValue=n,this.wpt.newValue=n,this.wptInitialized=true):(this.wpt.oldValue=this.wpt.newValue,this.wpt.newValue=n),this.wptIndicator()?.nativeElement&&(e||this.wpt.oldValue===this.wpt.newValue?this.setRotationImmediate(this.wptIndicator().nativeElement,this.wpt.newValue):S(this.wptIndicator().nativeElement,this.wpt.oldValue,this.wpt.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone));});}),Fa(()=>{let n=this.appWindAngle(),e=Number.isFinite(n)?Math.round(n):null;e!=null&&ge(()=>{let t=!this.awaInitialized;t?(this.awa.oldValue=e,this.awa.newValue=e,this.awaInitialized=true):(this.awa.oldValue=this.awa.newValue,this.awa.newValue=e),this.awaIndicator()?.nativeElement&&(t||this.awa.oldValue===this.awa.newValue?this.setRotationImmediate(this.awaIndicator().nativeElement,this.awa.newValue):S(this.awaIndicator().nativeElement,this.awa.oldValue,this.awa.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone)),this.updateCloseHauledLines(!t);});}),Fa(()=>{let n=this.trueWindAngle(),e=Number.isFinite(n)?Math.round(n):null,t=this.compassModeEnabled();e!=null&&ge(()=>{this.trueWindHeading=e;let o=t?this.compass.newValue*-1:0,r=this.addHeading(this.trueWindHeading,o);this.twaInitialized?(this.twa.oldValue=this.twa.newValue,this.twa.newValue=r):(this.twa.oldValue=r,this.twa.newValue=r,this.twaInitialized=true),this.twaIndicator()?.nativeElement&&(!this.twaInitialized||this.twa.oldValue===this.twa.newValue?this.setRotationImmediate(this.twaIndicator().nativeElement,this.twa.newValue):S(this.twaIndicator().nativeElement,this.twa.oldValue,this.twa.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone));});}),Fa(()=>{this.laylineAngle(),this.closeHauledLineEnabled()&&ge(()=>this.updateCloseHauledLines());}),Fa(()=>{let n=this.driftSet(),e=Number.isFinite(n)?Math.round(n):null;e!=null&&ge(()=>{this.setInitialized?(this.set.oldValue=this.set.newValue,this.set.newValue=e):(this.set.oldValue=e,this.set.newValue=e,this.setInitialized=true),this.setIndicator()?.nativeElement&&(!this.setInitialized||this.set.oldValue===this.set.newValue?this.setRotationImmediate(this.setIndicator().nativeElement,this.set.newValue):S(this.setIndicator().nativeElement,this.set.oldValue,this.set.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone));});}),Fa(()=>{let n=this.windSectorEnabled();this.trueWindMinHistoric(),this.trueWindMidHistoric(),this.trueWindMaxHistoric(),this.laylineAngle(),ge(()=>{if(!n){this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId),this.portSectorAnimId=null,this.stbdSectorAnimId=null,this.portWindSectorPath.set(""),this.stbdWindSectorPath.set("");return}this.updateWindSectors(true);});});}updateCloseHauledLines(n=true){if(!this.closeHauledLineEnabled())return;let e=this.compassModeEnabled(),t=e&&Number(this.compass.newValue)||0,o=e&&Number(this.awa.newValue)||0,r=Number(this.laylineAngle())||0,p=e?this.addHeading(t,this.addHeading(o,r*-1)):this.addHeading(o,r*-1);this.animateLayline(this.portLaylinePrev,p,true,n),this.portLaylinePrev=p;let u=e?this.addHeading(t,this.addHeading(o,r)):this.addHeading(o,r);this.animateLayline(this.stbdLaylinePrev,u,false,n),this.stbdLaylinePrev=u;}animateLayline(n,e,t,o=true){if(t&&this.portLaylineAnimId&&cancelAnimationFrame(this.portLaylineAnimId),!t&&this.stbdLaylineAnimId&&cancelAnimationFrame(this.stbdLaylineAnimId),this.angleDelta(n,e)<this.EPS_ANGLE){this.drawLayline(e,t),t?this.portLaylineAnimId=null:this.stbdLaylineAnimId=null;return}if(!o){this.drawLayline(e,t),t?this.portLaylineAnimId=null:this.stbdLaylineAnimId=null;return}let r=v(n,e,this.ANIMATION_DURATION,p=>this.drawLayline(p,t),()=>{t?this.portLaylineAnimId=null:this.stbdLaylineAnimId=null;},this.ngZone);t?this.portLaylineAnimId=r:this.stbdLaylineAnimId=r;}drawLayline(n,e){let t=n*Math.PI/180,o=Math.floor(this.RADIUS*Math.sin(t)+this.CENTER),r=Math.floor(this.RADIUS*Math.cos(t)*-1+this.CENTER);e?this.closeHauledLinePortPath.set(`M ${this.CENTER},${this.CENTER} L ${o},${r}`):this.closeHauledLineStbdPath.set(`M ${this.CENTER},${this.CENTER} L ${o},${r}`);}windSectorsInitialized=false;updateWindSectors(n=true){if(!this.windSectorEnabled()||this.trueWindMinHistoric()==null||this.trueWindMidHistoric()==null||this.trueWindMaxHistoric()==null)return;let e={min:this.trueWindMinHistoric()??0,mid:this.trueWindMidHistoric()??0,max:this.trueWindMaxHistoric()??0},t={min:this.trueWindMinHistoric()??0,mid:this.trueWindMidHistoric()??0,max:this.trueWindMaxHistoric()??0};if(!this.windSectorsInitialized){this.windSectorsInitialized=true,n?(this.animateWindSector(e,e,true),this.animateWindSector(t,t,false)):(this.portWindSectorPath.set(this.computeSectorPath(e,true)),this.stbdWindSectorPath.set(this.computeSectorPath(t,false))),this.portSectorPrev=e,this.stbdSectorPrev=t;return}n?this.angleDelta(this.portSectorPrev.min,e.min)<this.EPS_ANGLE&&this.angleDelta(this.portSectorPrev.mid,e.mid)<this.EPS_ANGLE&&this.angleDelta(this.portSectorPrev.max,e.max)<this.EPS_ANGLE?(this.portWindSectorPath.set(this.computeSectorPath(e,true)),this.stbdWindSectorPath.set(this.computeSectorPath(t,false))):(this.animateWindSector(this.portSectorPrev,e,true),this.animateWindSector(this.stbdSectorPrev,t,false)):(this.portWindSectorPath.set(this.computeSectorPath(e,true)),this.stbdWindSectorPath.set(this.computeSectorPath(t,false))),this.portSectorPrev=e,this.stbdSectorPrev=t;}animateWindSector(n,e,t){if(t&&this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),!t&&this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId),this.angleDelta(n.min,e.min)<this.EPS_ANGLE&&this.angleDelta(n.mid,e.mid)<this.EPS_ANGLE&&this.angleDelta(n.max,e.max)<this.EPS_ANGLE){let p=this.computeSectorPath(e,t);t?this.portWindSectorPath.set(p):this.stbdWindSectorPath.set(p),t?this.portSectorAnimId=null:this.stbdSectorAnimId=null;return}let r=R(n,e,this.ANIMATION_DURATION,p=>{let u=this.computeSectorPath(p,t);t?this.portWindSectorPath.set(u):this.stbdWindSectorPath.set(u);},()=>{t?this.portSectorAnimId=null:this.stbdSectorAnimId=null;},this.ngZone);t?this.portSectorAnimId=r:this.stbdSectorAnimId=r;}addHeading(n=0,e=0){let t=(n+e)%360;return t<0&&(t+=360),t}ngOnDestroy(){this.portLaylineAnimId&&cancelAnimationFrame(this.portLaylineAnimId),this.stbdLaylineAnimId&&cancelAnimationFrame(this.stbdLaylineAnimId),this.portLaylineAnimId=null,this.stbdLaylineAnimId=null,this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId),this.portSectorAnimId=null,this.stbdSectorAnimId=null;let n=[this.rotatingDial(),this.awaIndicator(),this.twaIndicator(),this.wptIndicator(),this.setIndicator(),this.cogIndicator()];for(let e of n){let t=e?.nativeElement;if(!t)continue;let o=this.animationFrameIds.get(t);o&&cancelAnimationFrame(o),this.animationFrameIds.delete(t);}}angleDelta(n,e){let t=(e-n+540)%360-180;return Math.abs(t)}computeSectorPath(n,e){let o=(Number(this.laylineAngle())||0)*(e?-1:1),r=this.compassModeEnabled(),p=r&&Number(this.compass.newValue)||0,u=Number(this.awa.newValue)||0,M=r?this.addHeading(p,this.addHeading(n.min,o)):this.addHeading(o,this.addHeading(n.min,u*-1)),A=r?this.addHeading(p,this.addHeading(n.mid,o)):this.addHeading(o,this.addHeading(n.mid,u*-1)),W=r?this.addHeading(p,this.addHeading(n.max,o)):this.addHeading(o,this.addHeading(n.max,u*-1)),D=this.RADIUS*Math.sin(M*Math.PI/180)+this.CENTER,k=this.RADIUS*Math.cos(M*Math.PI/180)*-1+this.CENTER,O=this.RADIUS*Math.sin(A*Math.PI/180)+this.CENTER,U=this.RADIUS*Math.cos(A*Math.PI/180)*-1+this.CENTER,T=this.RADIUS*Math.sin(W*Math.PI/180)+this.CENTER,q=this.RADIUS*Math.cos(W*Math.PI/180)*-1+this.CENTER,K=Math.abs(Y([D,k],[O,U],[T,q]))>Math.PI/2?0:1,tt=Y([T,q],[D,k],[O,U])>0?0:1;return `M ${this.CENTER},${this.CENTER} L ${D},${k} A ${this.RADIUS},${this.RADIUS} 0 ${K} ${tt} ${T},${q} z`}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=JD({type:m,selectors:[["svg-windsteer"]],viewQuery:function(e,t){e&1&&eg(t.rotatingDial,nt,5)(t.awaIndicator,it,5)(t.twaIndicator,at,5)(t.wptIndicator,ot,5)(t.setIndicator,rt,5)(t.cogIndicator,st,5),e&2&&Kw(6);},inputs:{compassHeading:[1,"compassHeading"],compassModeEnabled:[1,"compassModeEnabled"],courseOverGroundAngle:[1,"courseOverGroundAngle"],courseOverGroundEnabled:[1,"courseOverGroundEnabled"],trueWindAngle:[1,"trueWindAngle"],twsEnabled:[1,"twsEnabled"],twaEnabled:[1,"twaEnabled"],trueWindSpeed:[1,"trueWindSpeed"],trueWindSpeedUnit:[1,"trueWindSpeedUnit"],appWindAngle:[1,"appWindAngle"],awsEnabled:[1,"awsEnabled"],appWindSpeed:[1,"appWindSpeed"],appWindSpeedUnit:[1,"appWindSpeedUnit"],laylineAngle:[1,"laylineAngle"],closeHauledLineEnabled:[1,"closeHauledLineEnabled"],sailSetupEnabled:[1,"sailSetupEnabled"],windSectorEnabled:[1,"windSectorEnabled"],driftEnabled:[1,"driftEnabled"],driftSet:[1,"driftSet"],driftFlow:[1,"driftFlow"],waypointAngle:[1,"waypointAngle"],waypointEnabled:[1,"waypointEnabled"],trueWindMinHistoric:[1,"trueWindMinHistoric"],trueWindMidHistoric:[1,"trueWindMidHistoric"],trueWindMaxHistoric:[1,"trueWindMaxHistoric"]},decls:124,vars:44,consts:[["rotatingDial",""],["wptIndicator",""],["setIndicator",""],["cogIndicator",""],["awaIndicator",""],["twaIndicator",""],["viewBox","0 0 1000 1000"],["id","defs1"],["id","linearGradient18"],["offset","0",1,"boat",2,"stop-opacity","0.71372495"],["offset","1",1,"boat",2,"stop-opacity","0"],["id","linearGradient16"],["id","linearGradient13"],["offset","0.41176471",1,"drift-arrow",2,"stop-opacity","1"],["offset","1",1,"drift-arrow",2,"stop-opacity","0"],["id","swatch4"],["offset","0","id","stop4",2,"stop-color","#000000","stop-opacity","1"],["clipPathUnits","userSpaceOnUse","id","clipPath16"],["id","ellipse16","cx","311.24539","cy","-1516.3778","rx","194.27342","ry","181.83022",2,"display","inline","fill","#9a9300","fill-opacity","1","stroke","none","stroke-width","55","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","1"],[0,"xlink","href","#linearGradient13","id","linearGradient14","x1","453.48047","y1","583.62891","x2","638.11328","y2","583.62891","gradientUnits","userSpaceOnUse","gradientTransform","matrix(0.00723393,1.2388183,-1.0538241,0.00615367,1111.2051,-179.73465)"],[0,"xlink","href","#linearGradient16","id","linearGradient17","x1","-502.04896","y1","439.35551","x2","-316","y2","439.35551","gradientUnits","userSpaceOnUse","gradientTransform","translate(0,49.000266)"],[0,"xlink","href","#linearGradient18","id","linearGradient19","x1","495.83999","y1","439.35551","x2","681.88895","y2","439.35551","gradientUnits","userSpaceOnUse","gradientTransform","translate(0,49.000266)"],["id","layerBackground",2,"display","inline"],["id","boat",2,"display","inline"],["id","portSide","d","M 498.75049,208.89453 A 267.09439,554.67401 0 0 1 678.45974,767.81661",2,"fill","none","fill-opacity","1","stroke","url(#linearGradient19)","stroke-width","5.821","stroke-linecap","round","stroke-miterlimit","0","stroke-dasharray","none"],["id","starboardSide","d","m -499.13846,208.89453 a 267.09439,554.67401 0 0 1 179.70925,558.92208","transform","scale(-1,1)",2,"fill","none","fill-opacity","1","stroke","url(#linearGradient17)","stroke-width","5.821","stroke-linecap","round","stroke-miterlimit","0","stroke-dasharray","none"],["id","layerCompass"],["id","fixedDial"],["id","portStarboardBackground","d","M 499.99997,10.520805 A 489.47916,489.47916 0 0 0 10.520805,499.99997 489.47916,489.47916 0 0 0 499.99997,989.47913 489.47916,489.47916 0 0 0 989.47913,499.99997 489.47916,489.47916 0 0 0 499.99997,10.520805 Z m 0,132.291665 a 357.1875,357.1875 0 0 1 357.18749,357.1875 357.1875,357.1875 0 0 1 -357.18749,357.18749 357.1875,357.1875 0 0 1 -357.1875,-357.18749 357.1875,357.1875 0 0 1 357.1875,-357.1875 z",1,"fixed-dial-background",2,"display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","port","d","M 93.283801,265.18231 A 469.63541,469.63541 0 0 1 339.37522,58.687079",1,"port",2,"display","inline","fill","none","stroke-width","39.6875","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","0"],["id","starboard","d","M 660.62476,58.687069 A 469.63541,469.63541 0 0 1 906.71619,265.18228",1,"starboard",2,"display","inline","fill","none","stroke-width","39.6875","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","0"],["id","barsAndText",1,"contrast-stroke",2,"display","inline"],["d","m 416.35095,19.837399 2.78142,15.77426","id","path199",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 334.23173,41.658798 5.47834,15.051615","id","path200",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 260.27336,81.806174 12.55151,21.739856","id","path37",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 187.44581,126.00035 10.29591,12.2702","id","path197",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 127.23918,185.95785 12.27019,10.29591","id","path198",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 83.252815,257.66724 21.739865,12.55151","id","path166",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 42.289518,332.39273 15.05162,5.47835","id","path195",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 20.127799,414.42077 15.774251,2.78142","id","path196",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 17.879075,498.47765 H 42.982096","id","path167",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 19.776759,583.71187 15.77426,-2.78142","id","path193",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 41.598167,665.8311 15.051615,-5.47834","id","path194",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 81.668963,739.71246 103.40883,727.16095","id","path168",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 125.93981,812.61701 12.2702,-10.29591","id","path191",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 185.89732,872.82365 10.29591,-12.27019","id","path192",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 257.53004,916.73298 12.55151,-21.73985","id","path169",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 332.33219,957.7732 5.47835,-15.05162","id","path189",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 414.36024,979.93493 2.78142,-15.77425","id","path190",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 498.34046,982.10672 V 957.0037","id","path170",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 583.65133,980.28596 580.86991,964.5117","id","path187",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 665.77057,958.46456 -5.47834,-15.05161","id","path188",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 739.57526,918.31683 727.02375,896.57698","id","path171",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 812.55647,874.12301 802.26056,861.85282","id","path185",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 872.76312,814.16551 860.49293,803.8696","id","path186",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 916.59579,742.45577 894.85593,729.90426","id","path172",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 957.71266,667.73063 -15.05161,-5.47834","id","path183",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 979.8744,585.70259 -15.77425,-2.78142","id","path184",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 981.96954,501.64535 -25.10304,10e-6","id","path173",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 980.22542,416.41149 -15.77425,2.78143","id","path181",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 958.40403,334.29226 -15.05161,5.47834","id","path182",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 918.17964,260.41055 -21.73986,12.55151","id","path174",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 874.06247,187.50636 -12.27018,10.29591","id","path180",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 817.34594,130.05494 -10.40259,12.17987","id","path179",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 742.31857,83.390025 729.76706,105.12988","id","path175",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 667.6701,42.350172 -5.47834,15.051615","id","path178",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 585.64206,20.188432 -2.78142,15.77425","id","path176",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 501.50816,18.016286 V 43.119307","id","path177",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["cx","500","cy","500","r","404",1,"rotating-dial-Backplate"],["id","dialLabelsCompass"],["id","dialLabelsPortStbd"],["id","LayerLayline"],["id","PortLayline",1,"laylines",2,"fill","none","stroke-width","5","stroke-dasharray","40, 20","stroke-dashoffset","0","stroke-opacity","0.6"],["id","StbdLayline",1,"laylines",2,"fill","none","stroke-width","5","stroke-dasharray","40, 20","stroke-dashoffset","0","stroke-opacity","0.6"],["id","LayerWindShift"],["id","portSectorShift",1,"wind-sector-port",2,"fill-opacity","0.5","stroke","none"],["id","StbdSectorShift",1,"wind-sector-stbd",2,"fill-opacity","0.5","stroke","none"],["clip-path","url(#clipPath16)","d","m 416.36313,-1521.3937 c 371.15015,24.6522 731.95257,192.9774 983.98757,467.456 227.2972,244.24389 363.1732,572.3808 369.4045,906.42978 15.9331,499.10271 -269.2071,986.17861 -700.5178,1232.88522 -485.08308,290.4843 -1134.555606,269.7346 -1599.2788,-52.7169 -404.5062,-269.24461 -653.2224,-759.35388 -614.1746,-1245.84043 30.2148,-487.61814 344.18931,-937.89997 780.52695,-1152.15867 176.96718,-89.2092 371.8823084,-142.3103 569.54914,-156.0363","transform","matrix(0.28310615,0,0,0.32000828,411.88452,661.64815)",1,"next-waypoint-bar",2,"display","inline","fill","none","stroke-width","30","stroke-miterlimit","0"],["id","path6341","cx","500","cy","175.00002","rx","17.361122","ry","17.361118",1,"next-waypoint",2,"display","inline","fill","none","stroke-width","15.2778","stroke-dasharray","none"],["id","setArrow","d","m 563.93337,480.60403 -64.4901,-94.9673 -63.37665,95.71396 58.48691,-30.71299 0.77713,133.08346 c 0.0992,16.99331 2.52916,30.65913 5.44822,30.64209 2.91911,-0.0171 5.18926,-13.71032 5.09001,-30.70362 l -0.77782,-133.20444 z",2,"fill","url(#linearGradient14)","stroke","none","stroke-width","1.18648"],["id","layerCounter"],["id","twsCounter"],[0,"xml","space","preserve","x","904.27722","y","150.88913","id","text43",1,"true-wind-label",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","34.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],[0,"xml","space","preserve","x","903.84814","y","114.73512","id","text42",1,"true-wind",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","66.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],[0,"xml","space","preserve","x","905.25897","y","52.894646","id","text41",1,"true-wind-label",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","34.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],["id","awsCounter"],[0,"xml","space","preserve","x","94.554222","y","150.88913","id","text39",1,"app-wind-label",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","34.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],[0,"xml","space","preserve","x","94.580925","y","114.63747","id","text40",1,"app-wind",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","66.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],[0,"xml","space","preserve","x","95.967644","y","52.894646","id","text39-7",1,"app-wind-label",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","34.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],["id","layerCurrent"],["id","text11",0,"xml","space","preserve","x","499.78842","y","523.55145",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-stretch","normal","font-size","66.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none"],["id","layerIndicators",2,"display","inline"],["d","m 506.20767,172.99458 a 6.3888631,8.8250643 0 0 1 -6.38888,8.82508 6.3888631,8.8250643 0 0 1 -6.38888,-8.82508 6.3888631,8.8250643 0 0 1 6.38888,-8.82509 6.3888631,8.8250643 0 0 1 6.38888,8.82509 z M 476.25472,30.811298 493.47058,13.265068 c 3.6173,-3.6867571 9.44162,-3.6867571 13.05892,0 l 17.21586,17.546106 c 3.6173,3.686743 3.6173,9.622786 0,13.309544 l -17.21595,17.54623 c -3.61721,3.686757 -9.44153,3.686757 -13.05893,0 L 476.25472,44.120841 c -3.6174,-3.686743 -3.6174,-9.622924 0,-13.309543 z m 17.20533,-16.510116 h 12.77766 V 173.26408 h -12.77766 z",1,"course-over-ground",2,"stroke-width","14.7329","stroke-linecap","square"],["d","m 451.77021,55.078207 42.08541,-33.202814 a 12.555638,12.555638 0.26446337 0 1 15.64423,0.07221 l 42.20046,33.930296 a 15.557694,15.557694 71.53185 0 1 5.32954,15.957795 L 504.17034,279.76529 a 2.5373267,2.5373267 0.02614114 0 1 -4.91879,-0.002 L 446.37431,70.966036 a 15.416336,15.416336 108.75875 0 1 5.3959,-15.887829 z","transform","matrix(0.7935953,0,0,0.92686935,101.84848,11.000842)",1,"app-wind",2,"display","inline","stroke-width","5.8876","stroke-miterlimit","0"],[0,"xml","space","preserve","x","500","y","110",1,"card-color",2,"font-weight","bold","font-size","70px","font-family","Roboto","text-align","center","text-anchor","middle","display","inline","stroke","none"],["d","m 451.77021,55.078207 42.08541,-33.202814 a 12.555638,12.555638 0.26446337 0 1 15.64423,0.07221 l 42.20046,33.930296 a 15.557694,15.557694 71.53185 0 1 5.32954,15.957795 L 504.17034,279.76529 a 2.5373267,2.5373267 0.02614114 0 1 -4.91879,-0.002 L 446.37431,70.966036 a 15.416336,15.416336 108.75875 0 1 5.3959,-15.887829 z","transform","matrix(0.60410307,0,0,0.70555435,196.91787,21.152867)",1,"true-wind",2,"display","inline","stroke","none","stroke-width","5.8876","stroke-miterlimit","0"],[0,"xml","space","preserve","x","500","y","110","id","text10",1,"card-color",2,"font-weight","bold","font-size","60px","font-family","Roboto","text-align","center","text-anchor","middle","display","inline","stroke","none"],["id","layerHeading",2,"display","inline"],["id","rect1","width","256.47919","height","108.5428","x","371.76041","y","10.805443","rx","23.757372",1,"heading-background",2,"stroke-width","4.43107","stroke-linejoin","bevel","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","0.509946"],["x","511.29395","y","102.86786",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","106.667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","5","stroke-linejoin","bevel","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","1"],[0,"xml","space","preserve","x","181.91386","y","284.25186","id","text3","transform","rotate(-30)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan3","x","181.91386","y","284.25186",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-183.53558","y","283.74811","id","text14","transform","rotate(-60)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan14","x","-183.53558","y","283.74811",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-499.70761","y","100.95312","id","text15","transform","rotate(-90)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan15","x","-499.70761","y","100.95312",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-681.66119","y","-216.36243","id","text16","transform","rotate(-120)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["x","-681.66119","y","-216.36243","id","tspan25",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-681.06616","y","-581.71271","id","text17","transform","rotate(-150)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan17","x","-681.06616","y","-581.71271",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-498.3313","y","-897.40875","id","text18","transform","scale(-1)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan18","x","-498.3313","y","-897.40875",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-184.41313","y","-1080.8452","id","text19","transform","rotate(150)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan19","x","-184.41313","y","-1080.8452",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","181.57225","y","-1080.8853","id","text20","transform","rotate(120)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan20","x","181.57225","y","-1080.8853",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","501.42661","y","-896.93701","id","text21","transform","rotate(90)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan21","x","501.42661","y","-896.93701",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","682.35815","y","-579.63336","id","text22","transform","rotate(60)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan22","x","682.35815","y","-579.63336",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","681.81525","y","-214.27321","id","text23","transform","rotate(30)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan23","x","681.81525","y","-214.27321",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","500.15503","y","101.96342","id","text24",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan24","x","500.15503","y","101.96342",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"]],template:function(e,t){e&1&&(wd(),dl(0,"svg",6)(1,"defs",7)(2,"linearGradient",8),Uh(3,"stop",9)(4,"stop",10),fl(),dl(5,"linearGradient",11),Uh(6,"stop",9)(7,"stop",10),fl(),dl(8,"linearGradient",12),Uh(9,"stop",13)(10,"stop",14),fl(),dl(11,"linearGradient",15),Uh(12,"stop",16),fl(),dl(13,"clipPath",17),Uh(14,"ellipse",18),fl(),Uh(15,"linearGradient",19)(16,"linearGradient",20)(17,"linearGradient",21),fl(),dl(18,"g",22)(19,"g",23),Uh(20,"path",24)(21,"path",25),fl()(),dl(22,"g",26)(23,"g",27),Uh(24,"path",28)(25,"path",29)(26,"path",30),fl(),dl(27,"g",null,0)(29,"g",31),Uh(30,"path",32)(31,"path",33)(32,"path",34)(33,"path",35)(34,"path",36)(35,"path",37)(36,"path",38)(37,"path",39)(38,"path",40)(39,"path",41)(40,"path",42)(41,"path",43)(42,"path",44)(43,"path",45)(44,"path",46)(45,"path",47)(46,"path",48)(47,"path",49)(48,"path",50)(49,"path",51)(50,"path",52)(51,"path",53)(52,"path",54)(53,"path",55)(54,"path",56)(55,"path",57)(56,"path",58)(57,"path",59)(58,"path",60)(59,"path",61)(60,"path",62)(61,"path",63)(62,"path",64)(63,"path",65)(64,"path",66)(65,"path",67)(66,"circle",68),_w(67,lt,37,0,":svg:g",69)(68,dt,37,0,":svg:g",70),fl(),dl(69,"g",71),Uh(70,"path",72)(71,"path",73),fl(),dl(72,"g",74),Uh(73,"path",75)(74,"path",76),fl(),dl(75,"g",null,1),Uh(77,"path",77)(78,"ellipse",78),fl(),dl(79,"g",null,2),Uh(81,"path",79),fl()()(),dl(82,"g",80)(83,"g",81)(84,"text",82),TT(85),fl(),dl(86,"text",83),TT(87),HT(88,"number"),fl(),dl(89,"text",84),TT(90,"TWS"),fl()(),dl(91,"g",85)(92,"text",86),TT(93),fl(),dl(94,"text",87),TT(95),HT(96,"number"),fl(),dl(97,"text",88),TT(98,"AWS"),fl()()(),dl(99,"g",89)(100,"text",90),TT(101),HT(102,"number"),fl()(),dl(103,"g",91)(104,"g",null,3),Uh(106,"path",92),fl(),dl(107,"g",null,4),Uh(109,"path",93),dl(110,"text",94),TT(111,"A"),fl()(),dl(112,"g",null,5),Uh(114,"path",95),dl(115,"text",96),TT(116,"T"),fl()()(),dl(117,"g",97),Uh(118,"rect",98),dl(119,"text",99)(120,"tspan"),TT(121),dl(122,"tspan"),TT(123,"\xB0"),fl()()()()()),e&2&&(EE(67),Mw(t.compassModeEnabled()?67:68),EE(2),ig("display",t.closeHauledLineEnabled()?"inline":"none"),EE(),ig("display",t.appWindAngle()!=null?"inline":"none"),Hh("d",t.closeHauledLineStbdPath()),EE(),ig("display",t.appWindAngle()!=null?"inline":"none"),Hh("d",t.closeHauledLinePortPath()),EE(),ig("display",t.windSectorEnabled()?"inline":"none"),EE(),ig("display",t.portWindSectorPath()?"inline":"none"),Hh("d",t.portWindSectorPath()||null),EE(),ig("display",t.stbdWindSectorPath()?"inline":"none"),Hh("d",t.stbdWindSectorPath()||null),EE(),Hh("display",t.waypointActive()&&t.compassModeEnabled()?"inline":"none"),EE(4),ig("display",t.driftEnabled()&&t.compassModeEnabled()?"inline":"none"),EE(4),ig("display",t.twsEnabled()?"inline":"none"),EE(2),gg(t.trueWindSpeedUnit()),EE(2),gg(UT(88,35,t.trueWindSpeed(),"1.1-1")??"--"),EE(4),ig("display",t.awsEnabled()?"inline":"none"),EE(2),gg(t.appWindSpeedUnit()),EE(2),gg(UT(96,38,t.appWindSpeed(),"1.1-1")??"--"),EE(4),ig("display",t.driftEnabled()&&t.compassModeEnabled()?"inline":"none"),EE(2),gg(UT(102,41,t.driftFlow(),"1.1-1")??"--"),EE(3),Hh("display",t.courseOverGroundEnabled()&&t.compassModeEnabled()?"inline":"none"),EE(8),ig("display",t.twaEnabled()?"inline":"none"),EE(9),gg(t.headingValue()));},dependencies:[es],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.fixed-dial-background[_ngcontent-%COMP%]{fill:var(--kip-grey-color)}.rotating-dial-Backplate[_ngcontent-%COMP%]{stroke:var(--mat-sys-background);fill:none;stroke-width:95}.starboard[_ngcontent-%COMP%]{stroke:var(--kip-starboard-color)}.port[_ngcontent-%COMP%]{stroke:var(--kip-port-color)}.heading-background[_ngcontent-%COMP%]{stroke:var(--kip-grey-color);fill:var(--kip-widget-card-background-color)}.boat[_ngcontent-%COMP%]{stop-color:var(--kip-grey-color)!important}.contrast-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}.contrast-stroke[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color)}.card-color[_ngcontent-%COMP%]{fill:var(--kip-widget-card-background-color)}.true-wind[_ngcontent-%COMP%]{fill:var(--kip-yellow-color)}.true-wind-label[_ngcontent-%COMP%]{fill:var(--kip-yellow-dim-color)}.app-wind[_ngcontent-%COMP%]{fill:var(--kip-orange-color)}.app-wind-label[_ngcontent-%COMP%]{fill:var(--kip-orange-dim-color)}.course-over-ground[_ngcontent-%COMP%]{fill:var(--kip-pink-color)}.next-waypoint[_ngcontent-%COMP%]{stroke:var(--kip-green-color)}.next-waypoint-bar[_ngcontent-%COMP%]{stroke:var(--kip-grey-color)}.laylines[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color)}.wind-sector-port[_ngcontent-%COMP%]{fill:var(--kip-port-color)}.wind-sector-stbd[_ngcontent-%COMP%]{fill:var(--kip-starboard-color)}.drift-arrow[_ngcontent-%COMP%]{stop-color:var(--kip-blue-color)}"]})}return m})();var St=(()=>{class m{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:false,filterSelfPaths:true,paths:{headingPath:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:1e3},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:1e3},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",showConvertUnitTo:false,convertUnitTo:"deg",sampleTime:1e3},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.course.calcValues.bearingTrue",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:1e3}},compassModeEnabled:true,windSectorEnable:true,windSectorWindowSeconds:5,laylineEnable:true,laylineAngle:40,waypointEnable:true,courseOverGroundEnable:true,driftEnable:true,awsEnable:true,twsEnable:true,twaEnable:true,sailSetupEnable:false,enableTimeout:false,dataTimeout:5};runtime=w(p);stream=w(rt$1);cfg=Dt(()=>this.runtime.options()??m.DEFAULT_CONFIG);compassModeEnabledValue=Dt(()=>this.cfg().compassModeEnabled??false);courseOverGroundEnabledValue=Dt(()=>this.cfg().courseOverGroundEnable??false);twsEnabledValue=Dt(()=>this.cfg().twsEnable??false);twaEnabledValue=Dt(()=>this.cfg().twaEnable??false);awsEnabledValue=Dt(()=>this.cfg().awsEnable??false);laylineAngleValue=Dt(()=>this.cfg().laylineAngle??40);closeHauledLineEnabledValue=Dt(()=>this.cfg().laylineEnable??false);windSectorEnabledValue=Dt(()=>this.cfg().windSectorEnable??false);driftEnabledValue=Dt(()=>this.cfg().driftEnable??false);waypointEnabledValue=Dt(()=>this.cfg().waypointEnable??false);hasHeading=false;hasCOG=false;hasAWA=false;hasAWS=false;hasTWA=false;hasTWS=false;hasSet=false;hasDrift=false;hasWPT=false;currentHeading=vt(0);courseOverGroundAngle=vt(0);appWindAngle=vt(0);appWindSpeed=vt(0);appWindSpeedUnit=vt("");trueWindAngle=vt(0);trueWindSpeed=vt(0);trueWindSpeedUnit=vt("");driftFlow=vt(0);driftSet=vt(0);waypointAngle=vt(0);historicalWindDirection=[];trueWindMinHistoric=vt(void 0);trueWindMidHistoric=vt(void 0);trueWindMaxHistoric=vt(void 0);windSectorObservableSub=null;windSamples=[];windMinDeque=[];windMaxDeque=[];windSampleIndex=0;lastUnwrapped=null;lastSector={};DEG_EPSILON=1;SPEED_EPSILON=.1;constructor(){Fa(()=>{let e=this.cfg().paths;ge(()=>{this.appWindSpeedUnit.set(e?.appWindSpeed?.convertUnitTo??""),this.trueWindSpeedUnit.set(e?.trueWindSpeed?.convertUnitTo??""),this.registerStreams(),this.stopWindSectors(),this.startWindSectors();});});}onHeadingUpdate=n=>{let e=this.normalizeAngle(this.getPathValueOrZero(n));(!this.hasHeading||this.angleDelta(this.currentHeading(),e)>=this.DEG_EPSILON)&&(this.currentHeading.set(e),this.hasHeading=true);};onCOGUpdate=n=>{let e=this.normalizeAngle(this.getPathValueOrZero(n));(!this.hasCOG||this.angleDelta(this.courseOverGroundAngle(),e)>=this.DEG_EPSILON)&&(this.courseOverGroundAngle.set(e),this.hasCOG=true);};onDriftUpdate=n=>{let e=this.getPathValueOrZero(n);(!this.hasDrift||Math.abs(this.driftFlow()-e)>=this.SPEED_EPSILON)&&(this.driftFlow.set(e),this.hasDrift=true);};onSetUpdate=n=>{let e=this.normalizeAngle(this.getPathValueOrZero(n));(!this.hasSet||this.angleDelta(this.driftSet(),e)>=this.DEG_EPSILON)&&(this.driftSet.set(e),this.hasSet=true);};onWaypointUpdate=n=>{let e=n.data.value,t=this.normalizeAngle(e);(!this.hasWPT||this.angleDelta(this.waypointAngle(),t)>=this.DEG_EPSILON)&&(this.waypointAngle.set(t),this.hasWPT=true);};onAppWindAngle=n=>{let e=this.getPathValueOrZero(n),t=this.normalizeAngle(e);(!this.hasAWA||this.angleDelta(this.appWindAngle(),t)>=this.DEG_EPSILON)&&(this.appWindAngle.set(t),this.hasAWA=true,this.runtime.options()?.windSectorEnable&&this.addHistoricalWindDirection(this.normalizeAngle(e)));};onAppWindSpeed=n=>{let e=this.getPathValueOrZero(n);(!this.hasAWS||Math.abs(this.appWindSpeed()-e)>=this.SPEED_EPSILON)&&(this.appWindSpeed.set(e),this.hasAWS=true);};onTrueWindSpeed=n=>{let e=this.getPathValueOrZero(n);(!this.hasTWS||Math.abs(this.trueWindSpeed()-e)>=this.SPEED_EPSILON)&&(this.trueWindSpeed.set(e),this.hasTWS=true);};onTrueWindAngle=n=>{let e=this.cfg(),t=e.paths?.trueWindAngle?.path||"",o=ht(t,this.getPathValueOrZero(n),this.currentHeading(),!!e?.compassModeEnabled),r=this.normalizeAngle(o);(!this.hasTWA||this.angleDelta(this.trueWindAngle(),r)>=this.DEG_EPSILON)&&(this.trueWindAngle.set(r),this.hasTWA=true);};registerStreams(){this.runtime.options()&&(this.stream.observe("headingPath",this.onHeadingUpdate),this.stream.observe("courseOverGround",this.onCOGUpdate),this.stream.observe("drift",this.onDriftUpdate),this.stream.observe("set",this.onSetUpdate),this.stream.observe("nextWaypointBearing",this.onWaypointUpdate),this.stream.observe("appWindAngle",this.onAppWindAngle),this.stream.observe("appWindSpeed",this.onAppWindSpeed),this.stream.observe("trueWindSpeed",this.onTrueWindSpeed),this.stream.observe("trueWindAngle",this.onTrueWindAngle));}ngOnDestroy(){this.stopWindSectors();}startWindSectors(){if(this.windSamples=[],this.windMinDeque=[],this.windMaxDeque=[],this.windSampleIndex=0,this.lastUnwrapped=null,this.lastSector={},!this.cfg().windSectorEnable){this.trueWindMinHistoric.set(void 0),this.trueWindMidHistoric.set(void 0),this.trueWindMaxHistoric.set(void 0),this.lastSector={};return}this.windSectorObservableSub=ms(1e3).subscribe(()=>{this.historicalCleanup();});}addHistoricalWindDirection(n){let e=Date.now(),t=this.unwrapAngle(n),o=this.windSampleIndex++;for(this.windSamples.push({t:e,u:t,i:o});this.windMinDeque.length&&this.windMinDeque[this.windMinDeque.length-1].u>=t;)this.windMinDeque.pop();for(this.windMinDeque.push({i:o,u:t});this.windMaxDeque.length&&this.windMaxDeque[this.windMaxDeque.length-1].u<=t;)this.windMaxDeque.pop();this.windMaxDeque.push({i:o,u:t});}historicalCleanup(){if(!this.cfg().windSectorEnable)return;let n=Date.now()-(this.cfg().windSectorWindowSeconds??5)*1e3;for(;this.windSamples.length&&this.windSamples[0].t<n;){let k=this.windSamples.shift();if(!k)break;this.windMinDeque.length&&this.windMinDeque[0].i===k.i&&this.windMinDeque.shift(),this.windMaxDeque.length&&this.windMaxDeque[0].i===k.i&&this.windMaxDeque.shift();}if(!this.windSamples.length||!this.windMinDeque.length||!this.windMaxDeque.length){(this.trueWindMinHistoric()!==void 0||this.trueWindMidHistoric()!==void 0||this.trueWindMaxHistoric()!==void 0)&&(this.trueWindMinHistoric.set(void 0),this.trueWindMidHistoric.set(void 0),this.trueWindMaxHistoric.set(void 0),this.lastSector={});return}let e=this.windMinDeque[0].u,t=this.windMaxDeque[0].u,o=(e+t)/2,r=this.normalizeAngle(e),p=this.normalizeAngle(o),u=this.normalizeAngle(t),M=this.lastSector.min,A=this.lastSector.mid,W=this.lastSector.max;(M===void 0||this.angleDelta(M,r)>=this.DEG_EPSILON||A===void 0||this.angleDelta(A,p)>=this.DEG_EPSILON||W===void 0||this.angleDelta(W,u)>=this.DEG_EPSILON)&&(this.trueWindMinHistoric.set(r),this.trueWindMidHistoric.set(p),this.trueWindMaxHistoric.set(u),this.lastSector={min:r,mid:p,max:u});}getPathValueOrZero(n){return n.data.value==null?0:n.data.value}stopWindSectors(){this.windSectorObservableSub?.unsubscribe();}unwrapAngle(n){if(this.lastUnwrapped==null)return this.lastUnwrapped=n,n;let e=this.lastUnwrapped,t=(e%360+360)%360,o=(n-t+540)%360-180,r=e+o;return this.lastUnwrapped=r,r}normalizeAngle(n){return (n%360+360)%360}angleDelta(n,e){let t=(e-n+540)%360-180;return Math.abs(t)}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=JD({type:m,selectors:[["widget-wind-steer"]],inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:25,consts:[[3,"compassHeading","compassModeEnabled","courseOverGroundAngle","courseOverGroundEnabled","trueWindAngle","twsEnabled","twaEnabled","trueWindSpeed","trueWindSpeedUnit","appWindAngle","awsEnabled","appWindSpeed","appWindSpeedUnit","laylineAngle","closeHauledLineEnabled","windSectorEnabled","driftEnabled","driftFlow","driftSet","waypointAngle","waypointEnabled","trueWindMinHistoric","trueWindMidHistoric","trueWindMaxHistoric","sailSetupEnabled"]],template:function(e,t){e&1&&$h(0,"svg-windsteer",0),e&2&&Bh("compassHeading",t.currentHeading())("compassModeEnabled",t.compassModeEnabledValue())("courseOverGroundAngle",t.courseOverGroundAngle())("courseOverGroundEnabled",t.courseOverGroundEnabledValue())("trueWindAngle",t.trueWindAngle())("twsEnabled",t.twsEnabledValue())("twaEnabled",t.twaEnabledValue())("trueWindSpeed",t.trueWindSpeed())("trueWindSpeedUnit",t.trueWindSpeedUnit())("appWindAngle",t.appWindAngle())("awsEnabled",t.awsEnabledValue())("appWindSpeed",t.appWindSpeed())("appWindSpeedUnit",t.appWindSpeedUnit())("laylineAngle",t.laylineAngleValue())("closeHauledLineEnabled",t.closeHauledLineEnabledValue())("windSectorEnabled",t.windSectorEnabledValue())("driftEnabled",t.driftEnabledValue())("driftFlow",t.driftFlow())("driftSet",t.driftSet())("waypointAngle",t.waypointAngle())("waypointEnabled",t.waypointEnabledValue())("trueWindMinHistoric",t.trueWindMinHistoric())("trueWindMidHistoric",t.trueWindMidHistoric())("trueWindMaxHistoric",t.trueWindMaxHistoric())("sailSetupEnabled",t.runtime.options()?.sailSetupEnable??false);},dependencies:[J],encapsulation:2})}return m})();function mt(m,b){let n=(m+b)%360;return n<0&&(n+=360),n}function ht(m,b,n,e){return (m.includes("angleTrueWater")||m.includes("angleTrueGround"))&&e?mt(n,b):b}export{St as WidgetWindComponent,ht as computeTrueWindBaseAngle};
|
|
1
|
+
import {v,R,S}from'./chunk-CQNVyz8q.js';import {d1 as Hj,w,du as p,dv as rt$1,D as Dt,v as vt,F as Fa,dn as ge,aI as ms,J as JD,c as $h,B as Bh,$ as $j,ao as ue,dz as es,cn as wd,ci as dl,cp as Uh,cj as fl,_ as _w,T as TT,bD as HT,e as EE,M as Mw,d as ig,an as Hh,aA as gg,dA as UT,f as eg,K as Kw}from'./main-F7NMHHV4.js';var nt=["rotatingDial"],it=["awaIndicator"],at=["twaIndicator"],ot=["wptIndicator"],rt=["setIndicator"],st=["cogIndicator"];function lt(m,b){m&1&&(wd(),dl(0,"g",69)(1,"text",100)(2,"tspan",101),TT(3,"330"),fl()(),dl(4,"text",102)(5,"tspan",103),TT(6,"300"),fl()(),dl(7,"text",104)(8,"tspan",105),TT(9,"W"),fl()(),dl(10,"text",106)(11,"tspan",107),TT(12,"240"),fl()(),dl(13,"text",108)(14,"tspan",109),TT(15,"210"),fl()(),dl(16,"text",110)(17,"tspan",111),TT(18,"S"),fl()(),dl(19,"text",112)(20,"tspan",113),TT(21,"150"),fl()(),dl(22,"text",114)(23,"tspan",115),TT(24,"120"),fl()(),dl(25,"text",116)(26,"tspan",117),TT(27,"E"),fl()(),dl(28,"text",118)(29,"tspan",119),TT(30,"60"),fl()(),dl(31,"text",120)(32,"tspan",121),TT(33,"30"),fl()(),dl(34,"text",122)(35,"tspan",123),TT(36,"N"),fl()()());}function dt(m,b){m&1&&(wd(),dl(0,"g",70)(1,"text",100)(2,"tspan",101),TT(3,"30"),fl()(),dl(4,"text",102)(5,"tspan",103),TT(6,"60"),fl()(),dl(7,"text",104)(8,"tspan",105),TT(9,"90"),fl()(),dl(10,"text",106)(11,"tspan",107),TT(12,"120"),fl()(),dl(13,"text",108)(14,"tspan",109),TT(15,"150"),fl()(),dl(16,"text",110)(17,"tspan",111),TT(18,"180"),fl()(),dl(19,"text",112)(20,"tspan",113),TT(21,"150"),fl()(),dl(22,"text",114)(23,"tspan",115),TT(24,"120"),fl()(),dl(25,"text",116)(26,"tspan",117),TT(27,"90"),fl()(),dl(28,"text",118)(29,"tspan",119),TT(30,"60"),fl()(),dl(31,"text",120)(32,"tspan",121),TT(33,"30"),fl()(),dl(34,"text",122)(35,"tspan",123),TT(36,"0"),fl()()());}var Y=([m,b],[n,e],[t,o])=>(Math.atan2(o-e,t-n)-Math.atan2(b-e,m-n)+3*Math.PI)%(2*Math.PI)-Math.PI,J=(()=>{class m{rotatingDial=$j.required("rotatingDial");awaIndicator=$j.required("awaIndicator");twaIndicator=$j.required("twaIndicator");wptIndicator=$j.required("wptIndicator");setIndicator=$j.required("setIndicator");cogIndicator=$j.required("cogIndicator");compassHeading=Hj.required();compassModeEnabled=Hj.required();courseOverGroundAngle=Hj(void 0);courseOverGroundEnabled=Hj.required();trueWindAngle=Hj.required();twsEnabled=Hj.required();twaEnabled=Hj.required();trueWindSpeed=Hj.required();trueWindSpeedUnit=Hj.required();appWindAngle=Hj.required();awsEnabled=Hj.required();appWindSpeed=Hj.required();appWindSpeedUnit=Hj.required();laylineAngle=Hj(void 0);closeHauledLineEnabled=Hj.required();sailSetupEnabled=Hj.required();windSectorEnabled=Hj.required();driftEnabled=Hj.required();driftSet=Hj(void 0);driftFlow=Hj(void 0);waypointAngle=Hj(void 0);waypointEnabled=Hj.required();trueWindMinHistoric=Hj(void 0);trueWindMidHistoric=Hj(void 0);trueWindMaxHistoric=Hj(void 0);compass={oldValue:0,newValue:0};twa={oldValue:0,newValue:0};awa={oldValue:0,newValue:0};wpt={oldValue:0,newValue:0};cog={oldValue:0,newValue:0};set={oldValue:0,newValue:0};compassInitialized=false;twaInitialized=false;awaInitialized=false;wptInitialized=false;cogInitialized=false;setInitialized=false;headingValue=vt("--");trueWindHeading=0;waypointActive=vt(false);portLaylinePrev=0;stbdLaylinePrev=0;portLaylineAnimId=null;stbdLaylineAnimId=null;closeHauledLinePortPath=vt("M 500,500 500,500");closeHauledLineStbdPath=vt("M 500,500 500,500");portSectorPrev={min:0,mid:0,max:0};stbdSectorPrev={min:0,mid:0,max:0};portSectorAnimId=null;stbdSectorAnimId=null;portWindSectorPath=vt("");stbdWindSectorPath=vt("");animationFrameIds=new WeakMap;CENTER=500;RADIUS=350;ANIMATION_DURATION=900;EPS_ANGLE=1;ngZone=w(ue);setRotationImmediate(n,e){n.setAttribute("transform",`rotate(${e} 500 500)`);}constructor(){Fa(()=>{let n=this.waypointEnabled();ge(()=>{this.waypointActive.set(n);});}),Fa(()=>{let n=this.compassModeEnabled(),e=this.compassHeading(),t=Number.isFinite(e)?Math.round(e):null;t!=null&&ge(()=>{let o=n?t:0,r=!this.compassInitialized;r?(this.compass.oldValue=o,this.compass.newValue=o,this.compassInitialized=true):(this.compass.oldValue=this.compass.newValue,this.compass.newValue=o),this.headingValue.set(t.toString()),this.rotatingDial()?.nativeElement&&(r||this.compass.oldValue===this.compass.newValue?this.setRotationImmediate(this.rotatingDial().nativeElement,-this.compass.newValue):S(this.rotatingDial().nativeElement,-this.compass.oldValue,-this.compass.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone),this.updateCloseHauledLines(false),this.updateWindSectors(false));});}),Fa(()=>{let n=this.courseOverGroundAngle(),e=Number.isFinite(n)?Math.round(n):null,t=this.compassModeEnabled();e!=null&&ge(()=>{let o=t?this.compass.newValue:0,r=e-o,p=!this.cogInitialized;p?(this.cog.oldValue=r,this.cog.newValue=r,this.cogInitialized=true):(this.cog.oldValue=this.cog.newValue,this.cog.newValue=r),this.cogIndicator()?.nativeElement&&(p||this.cog.oldValue===this.cog.newValue?this.setRotationImmediate(this.cogIndicator().nativeElement,this.cog.newValue):S(this.cogIndicator().nativeElement,this.cog.oldValue,this.cog.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone));});}),Fa(()=>{let n=this.waypointAngle();ge(()=>{if(n==null||!Number.isFinite(n)){this.waypointActive.set(false);return}this.waypointEnabled()?this.waypointActive.set(true):this.waypointActive.set(false);let e=!this.wptInitialized;e?(this.wpt.oldValue=n,this.wpt.newValue=n,this.wptInitialized=true):(this.wpt.oldValue=this.wpt.newValue,this.wpt.newValue=n),this.wptIndicator()?.nativeElement&&(e||this.wpt.oldValue===this.wpt.newValue?this.setRotationImmediate(this.wptIndicator().nativeElement,this.wpt.newValue):S(this.wptIndicator().nativeElement,this.wpt.oldValue,this.wpt.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone));});}),Fa(()=>{let n=this.appWindAngle(),e=Number.isFinite(n)?Math.round(n):null;e!=null&&ge(()=>{let t=!this.awaInitialized;t?(this.awa.oldValue=e,this.awa.newValue=e,this.awaInitialized=true):(this.awa.oldValue=this.awa.newValue,this.awa.newValue=e),this.awaIndicator()?.nativeElement&&(t||this.awa.oldValue===this.awa.newValue?this.setRotationImmediate(this.awaIndicator().nativeElement,this.awa.newValue):S(this.awaIndicator().nativeElement,this.awa.oldValue,this.awa.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone)),this.updateCloseHauledLines(!t);});}),Fa(()=>{let n=this.trueWindAngle(),e=Number.isFinite(n)?Math.round(n):null,t=this.compassModeEnabled();e!=null&&ge(()=>{this.trueWindHeading=e;let o=t?this.compass.newValue*-1:0,r=this.addHeading(this.trueWindHeading,o);this.twaInitialized?(this.twa.oldValue=this.twa.newValue,this.twa.newValue=r):(this.twa.oldValue=r,this.twa.newValue=r,this.twaInitialized=true),this.twaIndicator()?.nativeElement&&(!this.twaInitialized||this.twa.oldValue===this.twa.newValue?this.setRotationImmediate(this.twaIndicator().nativeElement,this.twa.newValue):S(this.twaIndicator().nativeElement,this.twa.oldValue,this.twa.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone));});}),Fa(()=>{this.laylineAngle(),this.closeHauledLineEnabled()&&ge(()=>this.updateCloseHauledLines());}),Fa(()=>{let n=this.driftSet(),e=Number.isFinite(n)?Math.round(n):null;e!=null&&ge(()=>{this.setInitialized?(this.set.oldValue=this.set.newValue,this.set.newValue=e):(this.set.oldValue=e,this.set.newValue=e,this.setInitialized=true),this.setIndicator()?.nativeElement&&(!this.setInitialized||this.set.oldValue===this.set.newValue?this.setRotationImmediate(this.setIndicator().nativeElement,this.set.newValue):S(this.setIndicator().nativeElement,this.set.oldValue,this.set.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,void 0,this.ngZone));});}),Fa(()=>{let n=this.windSectorEnabled();this.trueWindMinHistoric(),this.trueWindMidHistoric(),this.trueWindMaxHistoric(),this.laylineAngle(),ge(()=>{if(!n){this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId),this.portSectorAnimId=null,this.stbdSectorAnimId=null,this.portWindSectorPath.set(""),this.stbdWindSectorPath.set("");return}this.updateWindSectors(true);});});}updateCloseHauledLines(n=true){if(!this.closeHauledLineEnabled())return;let e=this.compassModeEnabled(),t=e&&Number(this.compass.newValue)||0,o=e&&Number(this.awa.newValue)||0,r=Number(this.laylineAngle())||0,p=e?this.addHeading(t,this.addHeading(o,r*-1)):this.addHeading(o,r*-1);this.animateLayline(this.portLaylinePrev,p,true,n),this.portLaylinePrev=p;let u=e?this.addHeading(t,this.addHeading(o,r)):this.addHeading(o,r);this.animateLayline(this.stbdLaylinePrev,u,false,n),this.stbdLaylinePrev=u;}animateLayline(n,e,t,o=true){if(t&&this.portLaylineAnimId&&cancelAnimationFrame(this.portLaylineAnimId),!t&&this.stbdLaylineAnimId&&cancelAnimationFrame(this.stbdLaylineAnimId),this.angleDelta(n,e)<this.EPS_ANGLE){this.drawLayline(e,t),t?this.portLaylineAnimId=null:this.stbdLaylineAnimId=null;return}if(!o){this.drawLayline(e,t),t?this.portLaylineAnimId=null:this.stbdLaylineAnimId=null;return}let r=v(n,e,this.ANIMATION_DURATION,p=>this.drawLayline(p,t),()=>{t?this.portLaylineAnimId=null:this.stbdLaylineAnimId=null;},this.ngZone);t?this.portLaylineAnimId=r:this.stbdLaylineAnimId=r;}drawLayline(n,e){let t=n*Math.PI/180,o=Math.floor(this.RADIUS*Math.sin(t)+this.CENTER),r=Math.floor(this.RADIUS*Math.cos(t)*-1+this.CENTER);e?this.closeHauledLinePortPath.set(`M ${this.CENTER},${this.CENTER} L ${o},${r}`):this.closeHauledLineStbdPath.set(`M ${this.CENTER},${this.CENTER} L ${o},${r}`);}windSectorsInitialized=false;updateWindSectors(n=true){if(!this.windSectorEnabled()||this.trueWindMinHistoric()==null||this.trueWindMidHistoric()==null||this.trueWindMaxHistoric()==null)return;let e={min:this.trueWindMinHistoric()??0,mid:this.trueWindMidHistoric()??0,max:this.trueWindMaxHistoric()??0},t={min:this.trueWindMinHistoric()??0,mid:this.trueWindMidHistoric()??0,max:this.trueWindMaxHistoric()??0};if(!this.windSectorsInitialized){this.windSectorsInitialized=true,n?(this.animateWindSector(e,e,true),this.animateWindSector(t,t,false)):(this.portWindSectorPath.set(this.computeSectorPath(e,true)),this.stbdWindSectorPath.set(this.computeSectorPath(t,false))),this.portSectorPrev=e,this.stbdSectorPrev=t;return}n?this.angleDelta(this.portSectorPrev.min,e.min)<this.EPS_ANGLE&&this.angleDelta(this.portSectorPrev.mid,e.mid)<this.EPS_ANGLE&&this.angleDelta(this.portSectorPrev.max,e.max)<this.EPS_ANGLE?(this.portWindSectorPath.set(this.computeSectorPath(e,true)),this.stbdWindSectorPath.set(this.computeSectorPath(t,false))):(this.animateWindSector(this.portSectorPrev,e,true),this.animateWindSector(this.stbdSectorPrev,t,false)):(this.portWindSectorPath.set(this.computeSectorPath(e,true)),this.stbdWindSectorPath.set(this.computeSectorPath(t,false))),this.portSectorPrev=e,this.stbdSectorPrev=t;}animateWindSector(n,e,t){if(t&&this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),!t&&this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId),this.angleDelta(n.min,e.min)<this.EPS_ANGLE&&this.angleDelta(n.mid,e.mid)<this.EPS_ANGLE&&this.angleDelta(n.max,e.max)<this.EPS_ANGLE){let p=this.computeSectorPath(e,t);t?this.portWindSectorPath.set(p):this.stbdWindSectorPath.set(p),t?this.portSectorAnimId=null:this.stbdSectorAnimId=null;return}let r=R(n,e,this.ANIMATION_DURATION,p=>{let u=this.computeSectorPath(p,t);t?this.portWindSectorPath.set(u):this.stbdWindSectorPath.set(u);},()=>{t?this.portSectorAnimId=null:this.stbdSectorAnimId=null;},this.ngZone);t?this.portSectorAnimId=r:this.stbdSectorAnimId=r;}addHeading(n=0,e=0){let t=(n+e)%360;return t<0&&(t+=360),t}ngOnDestroy(){this.portLaylineAnimId&&cancelAnimationFrame(this.portLaylineAnimId),this.stbdLaylineAnimId&&cancelAnimationFrame(this.stbdLaylineAnimId),this.portLaylineAnimId=null,this.stbdLaylineAnimId=null,this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId),this.portSectorAnimId=null,this.stbdSectorAnimId=null;let n=[this.rotatingDial(),this.awaIndicator(),this.twaIndicator(),this.wptIndicator(),this.setIndicator(),this.cogIndicator()];for(let e of n){let t=e?.nativeElement;if(!t)continue;let o=this.animationFrameIds.get(t);o&&cancelAnimationFrame(o),this.animationFrameIds.delete(t);}}angleDelta(n,e){let t=(e-n+540)%360-180;return Math.abs(t)}computeSectorPath(n,e){let o=(Number(this.laylineAngle())||0)*(e?-1:1),r=this.compassModeEnabled(),p=r&&Number(this.compass.newValue)||0,u=Number(this.awa.newValue)||0,M=r?this.addHeading(p,this.addHeading(n.min,o)):this.addHeading(o,this.addHeading(n.min,u*-1)),A=r?this.addHeading(p,this.addHeading(n.mid,o)):this.addHeading(o,this.addHeading(n.mid,u*-1)),W=r?this.addHeading(p,this.addHeading(n.max,o)):this.addHeading(o,this.addHeading(n.max,u*-1)),D=this.RADIUS*Math.sin(M*Math.PI/180)+this.CENTER,k=this.RADIUS*Math.cos(M*Math.PI/180)*-1+this.CENTER,O=this.RADIUS*Math.sin(A*Math.PI/180)+this.CENTER,U=this.RADIUS*Math.cos(A*Math.PI/180)*-1+this.CENTER,T=this.RADIUS*Math.sin(W*Math.PI/180)+this.CENTER,q=this.RADIUS*Math.cos(W*Math.PI/180)*-1+this.CENTER,K=Math.abs(Y([D,k],[O,U],[T,q]))>Math.PI/2?0:1,tt=Y([T,q],[D,k],[O,U])>0?0:1;return `M ${this.CENTER},${this.CENTER} L ${D},${k} A ${this.RADIUS},${this.RADIUS} 0 ${K} ${tt} ${T},${q} z`}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=JD({type:m,selectors:[["svg-windsteer"]],viewQuery:function(e,t){e&1&&eg(t.rotatingDial,nt,5)(t.awaIndicator,it,5)(t.twaIndicator,at,5)(t.wptIndicator,ot,5)(t.setIndicator,rt,5)(t.cogIndicator,st,5),e&2&&Kw(6);},inputs:{compassHeading:[1,"compassHeading"],compassModeEnabled:[1,"compassModeEnabled"],courseOverGroundAngle:[1,"courseOverGroundAngle"],courseOverGroundEnabled:[1,"courseOverGroundEnabled"],trueWindAngle:[1,"trueWindAngle"],twsEnabled:[1,"twsEnabled"],twaEnabled:[1,"twaEnabled"],trueWindSpeed:[1,"trueWindSpeed"],trueWindSpeedUnit:[1,"trueWindSpeedUnit"],appWindAngle:[1,"appWindAngle"],awsEnabled:[1,"awsEnabled"],appWindSpeed:[1,"appWindSpeed"],appWindSpeedUnit:[1,"appWindSpeedUnit"],laylineAngle:[1,"laylineAngle"],closeHauledLineEnabled:[1,"closeHauledLineEnabled"],sailSetupEnabled:[1,"sailSetupEnabled"],windSectorEnabled:[1,"windSectorEnabled"],driftEnabled:[1,"driftEnabled"],driftSet:[1,"driftSet"],driftFlow:[1,"driftFlow"],waypointAngle:[1,"waypointAngle"],waypointEnabled:[1,"waypointEnabled"],trueWindMinHistoric:[1,"trueWindMinHistoric"],trueWindMidHistoric:[1,"trueWindMidHistoric"],trueWindMaxHistoric:[1,"trueWindMaxHistoric"]},decls:124,vars:44,consts:[["rotatingDial",""],["wptIndicator",""],["setIndicator",""],["cogIndicator",""],["awaIndicator",""],["twaIndicator",""],["viewBox","0 0 1000 1000"],["id","defs1"],["id","linearGradient18"],["offset","0",1,"boat",2,"stop-opacity","0.71372495"],["offset","1",1,"boat",2,"stop-opacity","0"],["id","linearGradient16"],["id","linearGradient13"],["offset","0.41176471",1,"drift-arrow",2,"stop-opacity","1"],["offset","1",1,"drift-arrow",2,"stop-opacity","0"],["id","swatch4"],["offset","0","id","stop4",2,"stop-color","#000000","stop-opacity","1"],["clipPathUnits","userSpaceOnUse","id","clipPath16"],["id","ellipse16","cx","311.24539","cy","-1516.3778","rx","194.27342","ry","181.83022",2,"display","inline","fill","#9a9300","fill-opacity","1","stroke","none","stroke-width","55","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","1"],[0,"xlink","href","#linearGradient13","id","linearGradient14","x1","453.48047","y1","583.62891","x2","638.11328","y2","583.62891","gradientUnits","userSpaceOnUse","gradientTransform","matrix(0.00723393,1.2388183,-1.0538241,0.00615367,1111.2051,-179.73465)"],[0,"xlink","href","#linearGradient16","id","linearGradient17","x1","-502.04896","y1","439.35551","x2","-316","y2","439.35551","gradientUnits","userSpaceOnUse","gradientTransform","translate(0,49.000266)"],[0,"xlink","href","#linearGradient18","id","linearGradient19","x1","495.83999","y1","439.35551","x2","681.88895","y2","439.35551","gradientUnits","userSpaceOnUse","gradientTransform","translate(0,49.000266)"],["id","layerBackground",2,"display","inline"],["id","boat",2,"display","inline"],["id","portSide","d","M 498.75049,208.89453 A 267.09439,554.67401 0 0 1 678.45974,767.81661",2,"fill","none","fill-opacity","1","stroke","url(#linearGradient19)","stroke-width","5.821","stroke-linecap","round","stroke-miterlimit","0","stroke-dasharray","none"],["id","starboardSide","d","m -499.13846,208.89453 a 267.09439,554.67401 0 0 1 179.70925,558.92208","transform","scale(-1,1)",2,"fill","none","fill-opacity","1","stroke","url(#linearGradient17)","stroke-width","5.821","stroke-linecap","round","stroke-miterlimit","0","stroke-dasharray","none"],["id","layerCompass"],["id","fixedDial"],["id","portStarboardBackground","d","M 499.99997,10.520805 A 489.47916,489.47916 0 0 0 10.520805,499.99997 489.47916,489.47916 0 0 0 499.99997,989.47913 489.47916,489.47916 0 0 0 989.47913,499.99997 489.47916,489.47916 0 0 0 499.99997,10.520805 Z m 0,132.291665 a 357.1875,357.1875 0 0 1 357.18749,357.1875 357.1875,357.1875 0 0 1 -357.18749,357.18749 357.1875,357.1875 0 0 1 -357.1875,-357.18749 357.1875,357.1875 0 0 1 357.1875,-357.1875 z",1,"fixed-dial-background",2,"display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","port","d","M 93.283801,265.18231 A 469.63541,469.63541 0 0 1 339.37522,58.687079",1,"port",2,"display","inline","fill","none","stroke-width","39.6875","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","0"],["id","starboard","d","M 660.62476,58.687069 A 469.63541,469.63541 0 0 1 906.71619,265.18228",1,"starboard",2,"display","inline","fill","none","stroke-width","39.6875","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","0"],["id","barsAndText",1,"contrast-stroke",2,"display","inline"],["d","m 416.35095,19.837399 2.78142,15.77426","id","path199",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 334.23173,41.658798 5.47834,15.051615","id","path200",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 260.27336,81.806174 12.55151,21.739856","id","path37",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 187.44581,126.00035 10.29591,12.2702","id","path197",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 127.23918,185.95785 12.27019,10.29591","id","path198",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 83.252815,257.66724 21.739865,12.55151","id","path166",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 42.289518,332.39273 15.05162,5.47835","id","path195",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 20.127799,414.42077 15.774251,2.78142","id","path196",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 17.879075,498.47765 H 42.982096","id","path167",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 19.776759,583.71187 15.77426,-2.78142","id","path193",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 41.598167,665.8311 15.051615,-5.47834","id","path194",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 81.668963,739.71246 103.40883,727.16095","id","path168",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 125.93981,812.61701 12.2702,-10.29591","id","path191",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 185.89732,872.82365 10.29591,-12.27019","id","path192",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 257.53004,916.73298 12.55151,-21.73985","id","path169",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 332.33219,957.7732 5.47835,-15.05162","id","path189",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 414.36024,979.93493 2.78142,-15.77425","id","path190",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 498.34046,982.10672 V 957.0037","id","path170",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 583.65133,980.28596 580.86991,964.5117","id","path187",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 665.77057,958.46456 -5.47834,-15.05161","id","path188",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 739.57526,918.31683 727.02375,896.57698","id","path171",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 812.55647,874.12301 802.26056,861.85282","id","path185",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 872.76312,814.16551 860.49293,803.8696","id","path186",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 916.59579,742.45577 894.85593,729.90426","id","path172",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 957.71266,667.73063 -15.05161,-5.47834","id","path183",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 979.8744,585.70259 -15.77425,-2.78142","id","path184",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 981.96954,501.64535 -25.10304,10e-6","id","path173",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 980.22542,416.41149 -15.77425,2.78143","id","path181",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 958.40403,334.29226 -15.05161,5.47834","id","path182",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 918.17964,260.41055 -21.73986,12.55151","id","path174",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 874.06247,187.50636 -12.27018,10.29591","id","path180",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 817.34594,130.05494 -10.40259,12.17987","id","path179",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 742.31857,83.390025 729.76706,105.12988","id","path175",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 667.6701,42.350172 -5.47834,15.051615","id","path178",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 585.64206,20.188432 -2.78142,15.77425","id","path176",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 501.50816,18.016286 V 43.119307","id","path177",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["cx","500","cy","500","r","404",1,"rotating-dial-Backplate"],["id","dialLabelsCompass"],["id","dialLabelsPortStbd"],["id","LayerLayline"],["id","PortLayline",1,"laylines",2,"fill","none","stroke-width","5","stroke-dasharray","40, 20","stroke-dashoffset","0","stroke-opacity","0.6"],["id","StbdLayline",1,"laylines",2,"fill","none","stroke-width","5","stroke-dasharray","40, 20","stroke-dashoffset","0","stroke-opacity","0.6"],["id","LayerWindShift"],["id","portSectorShift",1,"wind-sector-port",2,"fill-opacity","0.5","stroke","none"],["id","StbdSectorShift",1,"wind-sector-stbd",2,"fill-opacity","0.5","stroke","none"],["clip-path","url(#clipPath16)","d","m 416.36313,-1521.3937 c 371.15015,24.6522 731.95257,192.9774 983.98757,467.456 227.2972,244.24389 363.1732,572.3808 369.4045,906.42978 15.9331,499.10271 -269.2071,986.17861 -700.5178,1232.88522 -485.08308,290.4843 -1134.555606,269.7346 -1599.2788,-52.7169 -404.5062,-269.24461 -653.2224,-759.35388 -614.1746,-1245.84043 30.2148,-487.61814 344.18931,-937.89997 780.52695,-1152.15867 176.96718,-89.2092 371.8823084,-142.3103 569.54914,-156.0363","transform","matrix(0.28310615,0,0,0.32000828,411.88452,661.64815)",1,"next-waypoint-bar",2,"display","inline","fill","none","stroke-width","30","stroke-miterlimit","0"],["id","path6341","cx","500","cy","175.00002","rx","17.361122","ry","17.361118",1,"next-waypoint",2,"display","inline","fill","none","stroke-width","15.2778","stroke-dasharray","none"],["id","setArrow","d","m 563.93337,480.60403 -64.4901,-94.9673 -63.37665,95.71396 58.48691,-30.71299 0.77713,133.08346 c 0.0992,16.99331 2.52916,30.65913 5.44822,30.64209 2.91911,-0.0171 5.18926,-13.71032 5.09001,-30.70362 l -0.77782,-133.20444 z",2,"fill","url(#linearGradient14)","stroke","none","stroke-width","1.18648"],["id","layerCounter"],["id","twsCounter"],[0,"xml","space","preserve","x","904.27722","y","150.88913","id","text43",1,"true-wind-label",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","34.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],[0,"xml","space","preserve","x","903.84814","y","114.73512","id","text42",1,"true-wind",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","66.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],[0,"xml","space","preserve","x","905.25897","y","52.894646","id","text41",1,"true-wind-label",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","34.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],["id","awsCounter"],[0,"xml","space","preserve","x","94.554222","y","150.88913","id","text39",1,"app-wind-label",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","34.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],[0,"xml","space","preserve","x","94.580925","y","114.63747","id","text40",1,"app-wind",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","66.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],[0,"xml","space","preserve","x","95.967644","y","52.894646","id","text39-7",1,"app-wind-label",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","34.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","14.5521","stroke-miterlimit","0"],["id","layerCurrent"],["id","text11",0,"xml","space","preserve","x","499.78842","y","523.55145",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-stretch","normal","font-size","66.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none"],["id","layerIndicators",2,"display","inline"],["d","m 506.20767,172.99458 a 6.3888631,8.8250643 0 0 1 -6.38888,8.82508 6.3888631,8.8250643 0 0 1 -6.38888,-8.82508 6.3888631,8.8250643 0 0 1 6.38888,-8.82509 6.3888631,8.8250643 0 0 1 6.38888,8.82509 z M 476.25472,30.811298 493.47058,13.265068 c 3.6173,-3.6867571 9.44162,-3.6867571 13.05892,0 l 17.21586,17.546106 c 3.6173,3.686743 3.6173,9.622786 0,13.309544 l -17.21595,17.54623 c -3.61721,3.686757 -9.44153,3.686757 -13.05893,0 L 476.25472,44.120841 c -3.6174,-3.686743 -3.6174,-9.622924 0,-13.309543 z m 17.20533,-16.510116 h 12.77766 V 173.26408 h -12.77766 z",1,"course-over-ground",2,"stroke-width","14.7329","stroke-linecap","square"],["d","m 451.77021,55.078207 42.08541,-33.202814 a 12.555638,12.555638 0.26446337 0 1 15.64423,0.07221 l 42.20046,33.930296 a 15.557694,15.557694 71.53185 0 1 5.32954,15.957795 L 504.17034,279.76529 a 2.5373267,2.5373267 0.02614114 0 1 -4.91879,-0.002 L 446.37431,70.966036 a 15.416336,15.416336 108.75875 0 1 5.3959,-15.887829 z","transform","matrix(0.7935953,0,0,0.92686935,101.84848,11.000842)",1,"app-wind",2,"display","inline","stroke-width","5.8876","stroke-miterlimit","0"],[0,"xml","space","preserve","x","500","y","110",1,"card-color",2,"font-weight","bold","font-size","70px","font-family","Roboto","text-align","center","text-anchor","middle","display","inline","stroke","none"],["d","m 451.77021,55.078207 42.08541,-33.202814 a 12.555638,12.555638 0.26446337 0 1 15.64423,0.07221 l 42.20046,33.930296 a 15.557694,15.557694 71.53185 0 1 5.32954,15.957795 L 504.17034,279.76529 a 2.5373267,2.5373267 0.02614114 0 1 -4.91879,-0.002 L 446.37431,70.966036 a 15.416336,15.416336 108.75875 0 1 5.3959,-15.887829 z","transform","matrix(0.60410307,0,0,0.70555435,196.91787,21.152867)",1,"true-wind",2,"display","inline","stroke","none","stroke-width","5.8876","stroke-miterlimit","0"],[0,"xml","space","preserve","x","500","y","110","id","text10",1,"card-color",2,"font-weight","bold","font-size","60px","font-family","Roboto","text-align","center","text-anchor","middle","display","inline","stroke","none"],["id","layerHeading",2,"display","inline"],["id","rect1","width","256.47919","height","108.5428","x","371.76041","y","10.805443","rx","23.757372",1,"heading-background",2,"stroke-width","4.43107","stroke-linejoin","bevel","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","0.509946"],["x","511.29395","y","102.86786",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","106.667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","5","stroke-linejoin","bevel","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","1"],[0,"xml","space","preserve","x","181.91386","y","284.25186","id","text3","transform","rotate(-30)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan3","x","181.91386","y","284.25186",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-183.53558","y","283.74811","id","text14","transform","rotate(-60)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan14","x","-183.53558","y","283.74811",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-499.70761","y","100.95312","id","text15","transform","rotate(-90)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan15","x","-499.70761","y","100.95312",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-681.66119","y","-216.36243","id","text16","transform","rotate(-120)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["x","-681.66119","y","-216.36243","id","tspan25",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-681.06616","y","-581.71271","id","text17","transform","rotate(-150)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan17","x","-681.06616","y","-581.71271",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-498.3313","y","-897.40875","id","text18","transform","scale(-1)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan18","x","-498.3313","y","-897.40875",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-184.41313","y","-1080.8452","id","text19","transform","rotate(150)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan19","x","-184.41313","y","-1080.8452",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","181.57225","y","-1080.8853","id","text20","transform","rotate(120)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan20","x","181.57225","y","-1080.8853",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","501.42661","y","-896.93701","id","text21","transform","rotate(90)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan21","x","501.42661","y","-896.93701",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","682.35815","y","-579.63336","id","text22","transform","rotate(60)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan22","x","682.35815","y","-579.63336",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","681.81525","y","-214.27321","id","text23","transform","rotate(30)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan23","x","681.81525","y","-214.27321",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","500.15503","y","101.96342","id","text24",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan24","x","500.15503","y","101.96342",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"]],template:function(e,t){e&1&&(wd(),dl(0,"svg",6)(1,"defs",7)(2,"linearGradient",8),Uh(3,"stop",9)(4,"stop",10),fl(),dl(5,"linearGradient",11),Uh(6,"stop",9)(7,"stop",10),fl(),dl(8,"linearGradient",12),Uh(9,"stop",13)(10,"stop",14),fl(),dl(11,"linearGradient",15),Uh(12,"stop",16),fl(),dl(13,"clipPath",17),Uh(14,"ellipse",18),fl(),Uh(15,"linearGradient",19)(16,"linearGradient",20)(17,"linearGradient",21),fl(),dl(18,"g",22)(19,"g",23),Uh(20,"path",24)(21,"path",25),fl()(),dl(22,"g",26)(23,"g",27),Uh(24,"path",28)(25,"path",29)(26,"path",30),fl(),dl(27,"g",null,0)(29,"g",31),Uh(30,"path",32)(31,"path",33)(32,"path",34)(33,"path",35)(34,"path",36)(35,"path",37)(36,"path",38)(37,"path",39)(38,"path",40)(39,"path",41)(40,"path",42)(41,"path",43)(42,"path",44)(43,"path",45)(44,"path",46)(45,"path",47)(46,"path",48)(47,"path",49)(48,"path",50)(49,"path",51)(50,"path",52)(51,"path",53)(52,"path",54)(53,"path",55)(54,"path",56)(55,"path",57)(56,"path",58)(57,"path",59)(58,"path",60)(59,"path",61)(60,"path",62)(61,"path",63)(62,"path",64)(63,"path",65)(64,"path",66)(65,"path",67)(66,"circle",68),_w(67,lt,37,0,":svg:g",69)(68,dt,37,0,":svg:g",70),fl(),dl(69,"g",71),Uh(70,"path",72)(71,"path",73),fl(),dl(72,"g",74),Uh(73,"path",75)(74,"path",76),fl(),dl(75,"g",null,1),Uh(77,"path",77)(78,"ellipse",78),fl(),dl(79,"g",null,2),Uh(81,"path",79),fl()()(),dl(82,"g",80)(83,"g",81)(84,"text",82),TT(85),fl(),dl(86,"text",83),TT(87),HT(88,"number"),fl(),dl(89,"text",84),TT(90,"TWS"),fl()(),dl(91,"g",85)(92,"text",86),TT(93),fl(),dl(94,"text",87),TT(95),HT(96,"number"),fl(),dl(97,"text",88),TT(98,"AWS"),fl()()(),dl(99,"g",89)(100,"text",90),TT(101),HT(102,"number"),fl()(),dl(103,"g",91)(104,"g",null,3),Uh(106,"path",92),fl(),dl(107,"g",null,4),Uh(109,"path",93),dl(110,"text",94),TT(111,"A"),fl()(),dl(112,"g",null,5),Uh(114,"path",95),dl(115,"text",96),TT(116,"T"),fl()()(),dl(117,"g",97),Uh(118,"rect",98),dl(119,"text",99)(120,"tspan"),TT(121),dl(122,"tspan"),TT(123,"\xB0"),fl()()()()()),e&2&&(EE(67),Mw(t.compassModeEnabled()?67:68),EE(2),ig("display",t.closeHauledLineEnabled()?"inline":"none"),EE(),ig("display",t.appWindAngle()!=null?"inline":"none"),Hh("d",t.closeHauledLineStbdPath()),EE(),ig("display",t.appWindAngle()!=null?"inline":"none"),Hh("d",t.closeHauledLinePortPath()),EE(),ig("display",t.windSectorEnabled()?"inline":"none"),EE(),ig("display",t.portWindSectorPath()?"inline":"none"),Hh("d",t.portWindSectorPath()||null),EE(),ig("display",t.stbdWindSectorPath()?"inline":"none"),Hh("d",t.stbdWindSectorPath()||null),EE(),Hh("display",t.waypointActive()&&t.compassModeEnabled()?"inline":"none"),EE(4),ig("display",t.driftEnabled()&&t.compassModeEnabled()?"inline":"none"),EE(4),ig("display",t.twsEnabled()?"inline":"none"),EE(2),gg(t.trueWindSpeedUnit()),EE(2),gg(UT(88,35,t.trueWindSpeed(),"1.1-1")??"--"),EE(4),ig("display",t.awsEnabled()?"inline":"none"),EE(2),gg(t.appWindSpeedUnit()),EE(2),gg(UT(96,38,t.appWindSpeed(),"1.1-1")??"--"),EE(4),ig("display",t.driftEnabled()&&t.compassModeEnabled()?"inline":"none"),EE(2),gg(UT(102,41,t.driftFlow(),"1.1-1")??"--"),EE(3),Hh("display",t.courseOverGroundEnabled()&&t.compassModeEnabled()?"inline":"none"),EE(8),ig("display",t.twaEnabled()?"inline":"none"),EE(9),gg(t.headingValue()));},dependencies:[es],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.fixed-dial-background[_ngcontent-%COMP%]{fill:var(--kip-grey-color)}.rotating-dial-Backplate[_ngcontent-%COMP%]{stroke:var(--mat-sys-background);fill:none;stroke-width:95}.starboard[_ngcontent-%COMP%]{stroke:var(--kip-starboard-color)}.port[_ngcontent-%COMP%]{stroke:var(--kip-port-color)}.heading-background[_ngcontent-%COMP%]{stroke:var(--kip-grey-color);fill:var(--kip-widget-card-background-color)}.boat[_ngcontent-%COMP%]{stop-color:var(--kip-grey-color)!important}.contrast-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}.contrast-stroke[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color)}.card-color[_ngcontent-%COMP%]{fill:var(--kip-widget-card-background-color)}.true-wind[_ngcontent-%COMP%]{fill:var(--kip-yellow-color)}.true-wind-label[_ngcontent-%COMP%]{fill:var(--kip-yellow-dim-color)}.app-wind[_ngcontent-%COMP%]{fill:var(--kip-orange-color)}.app-wind-label[_ngcontent-%COMP%]{fill:var(--kip-orange-dim-color)}.course-over-ground[_ngcontent-%COMP%]{fill:var(--kip-pink-color)}.next-waypoint[_ngcontent-%COMP%]{stroke:var(--kip-green-color)}.next-waypoint-bar[_ngcontent-%COMP%]{stroke:var(--kip-grey-color)}.laylines[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color)}.wind-sector-port[_ngcontent-%COMP%]{fill:var(--kip-port-color)}.wind-sector-stbd[_ngcontent-%COMP%]{fill:var(--kip-starboard-color)}.drift-arrow[_ngcontent-%COMP%]{stop-color:var(--kip-blue-color)}"]})}return m})();var St=(()=>{class m{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:false,filterSelfPaths:true,paths:{headingPath:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:1e3},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:1e3},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",showConvertUnitTo:false,convertUnitTo:"deg",sampleTime:1e3},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.course.calcValues.bearingTrue",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:false,sampleTime:1e3},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,showPathSkUnitsFilter:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:1e3}},compassModeEnabled:true,windSectorEnable:true,windSectorWindowSeconds:5,laylineEnable:true,laylineAngle:40,waypointEnable:true,courseOverGroundEnable:true,driftEnable:true,awsEnable:true,twsEnable:true,twaEnable:true,sailSetupEnable:false,enableTimeout:false,dataTimeout:5};runtime=w(p);stream=w(rt$1);cfg=Dt(()=>this.runtime.options()??m.DEFAULT_CONFIG);compassModeEnabledValue=Dt(()=>this.cfg().compassModeEnabled??false);courseOverGroundEnabledValue=Dt(()=>this.cfg().courseOverGroundEnable??false);twsEnabledValue=Dt(()=>this.cfg().twsEnable??false);twaEnabledValue=Dt(()=>this.cfg().twaEnable??false);awsEnabledValue=Dt(()=>this.cfg().awsEnable??false);laylineAngleValue=Dt(()=>this.cfg().laylineAngle??40);closeHauledLineEnabledValue=Dt(()=>this.cfg().laylineEnable??false);windSectorEnabledValue=Dt(()=>this.cfg().windSectorEnable??false);driftEnabledValue=Dt(()=>this.cfg().driftEnable??false);waypointEnabledValue=Dt(()=>this.cfg().waypointEnable??false);hasHeading=false;hasCOG=false;hasAWA=false;hasAWS=false;hasTWA=false;hasTWS=false;hasSet=false;hasDrift=false;hasWPT=false;currentHeading=vt(0);courseOverGroundAngle=vt(0);appWindAngle=vt(0);appWindSpeed=vt(0);appWindSpeedUnit=vt("");trueWindAngle=vt(0);trueWindSpeed=vt(0);trueWindSpeedUnit=vt("");driftFlow=vt(0);driftSet=vt(0);waypointAngle=vt(0);historicalWindDirection=[];trueWindMinHistoric=vt(void 0);trueWindMidHistoric=vt(void 0);trueWindMaxHistoric=vt(void 0);windSectorObservableSub=null;windSamples=[];windMinDeque=[];windMaxDeque=[];windSampleIndex=0;lastUnwrapped=null;lastSector={};DEG_EPSILON=1;SPEED_EPSILON=.1;constructor(){Fa(()=>{let e=this.cfg().paths;ge(()=>{this.appWindSpeedUnit.set(e?.appWindSpeed?.convertUnitTo??""),this.trueWindSpeedUnit.set(e?.trueWindSpeed?.convertUnitTo??""),this.registerStreams(),this.stopWindSectors(),this.startWindSectors();});});}onHeadingUpdate=n=>{let e=this.normalizeAngle(this.getPathValueOrZero(n));(!this.hasHeading||this.angleDelta(this.currentHeading(),e)>=this.DEG_EPSILON)&&(this.currentHeading.set(e),this.hasHeading=true);};onCOGUpdate=n=>{let e=this.normalizeAngle(this.getPathValueOrZero(n));(!this.hasCOG||this.angleDelta(this.courseOverGroundAngle(),e)>=this.DEG_EPSILON)&&(this.courseOverGroundAngle.set(e),this.hasCOG=true);};onDriftUpdate=n=>{let e=this.getPathValueOrZero(n);(!this.hasDrift||Math.abs(this.driftFlow()-e)>=this.SPEED_EPSILON)&&(this.driftFlow.set(e),this.hasDrift=true);};onSetUpdate=n=>{let e=this.normalizeAngle(this.getPathValueOrZero(n));(!this.hasSet||this.angleDelta(this.driftSet(),e)>=this.DEG_EPSILON)&&(this.driftSet.set(e),this.hasSet=true);};onWaypointUpdate=n=>{let e=n.data.value,t=this.normalizeAngle(e);(!this.hasWPT||this.angleDelta(this.waypointAngle(),t)>=this.DEG_EPSILON)&&(this.waypointAngle.set(t),this.hasWPT=true);};onAppWindAngle=n=>{let e=this.getPathValueOrZero(n),t=this.normalizeAngle(e);(!this.hasAWA||this.angleDelta(this.appWindAngle(),t)>=this.DEG_EPSILON)&&(this.appWindAngle.set(t),this.hasAWA=true,this.runtime.options()?.windSectorEnable&&this.addHistoricalWindDirection(this.normalizeAngle(e)));};onAppWindSpeed=n=>{let e=this.getPathValueOrZero(n);(!this.hasAWS||Math.abs(this.appWindSpeed()-e)>=this.SPEED_EPSILON)&&(this.appWindSpeed.set(e),this.hasAWS=true);};onTrueWindSpeed=n=>{let e=this.getPathValueOrZero(n);(!this.hasTWS||Math.abs(this.trueWindSpeed()-e)>=this.SPEED_EPSILON)&&(this.trueWindSpeed.set(e),this.hasTWS=true);};onTrueWindAngle=n=>{let e=this.cfg(),t=e.paths?.trueWindAngle?.path||"",o=ht(t,this.getPathValueOrZero(n),this.currentHeading(),!!e?.compassModeEnabled),r=this.normalizeAngle(o);(!this.hasTWA||this.angleDelta(this.trueWindAngle(),r)>=this.DEG_EPSILON)&&(this.trueWindAngle.set(r),this.hasTWA=true);};registerStreams(){this.runtime.options()&&(this.stream.observe("headingPath",this.onHeadingUpdate),this.stream.observe("courseOverGround",this.onCOGUpdate),this.stream.observe("drift",this.onDriftUpdate),this.stream.observe("set",this.onSetUpdate),this.stream.observe("nextWaypointBearing",this.onWaypointUpdate),this.stream.observe("appWindAngle",this.onAppWindAngle),this.stream.observe("appWindSpeed",this.onAppWindSpeed),this.stream.observe("trueWindSpeed",this.onTrueWindSpeed),this.stream.observe("trueWindAngle",this.onTrueWindAngle));}ngOnDestroy(){this.stopWindSectors();}startWindSectors(){if(this.windSamples=[],this.windMinDeque=[],this.windMaxDeque=[],this.windSampleIndex=0,this.lastUnwrapped=null,this.lastSector={},!this.cfg().windSectorEnable){this.trueWindMinHistoric.set(void 0),this.trueWindMidHistoric.set(void 0),this.trueWindMaxHistoric.set(void 0),this.lastSector={};return}this.windSectorObservableSub=ms(1e3).subscribe(()=>{this.historicalCleanup();});}addHistoricalWindDirection(n){let e=Date.now(),t=this.unwrapAngle(n),o=this.windSampleIndex++;for(this.windSamples.push({t:e,u:t,i:o});this.windMinDeque.length&&this.windMinDeque[this.windMinDeque.length-1].u>=t;)this.windMinDeque.pop();for(this.windMinDeque.push({i:o,u:t});this.windMaxDeque.length&&this.windMaxDeque[this.windMaxDeque.length-1].u<=t;)this.windMaxDeque.pop();this.windMaxDeque.push({i:o,u:t});}historicalCleanup(){if(!this.cfg().windSectorEnable)return;let n=Date.now()-(this.cfg().windSectorWindowSeconds??5)*1e3;for(;this.windSamples.length&&this.windSamples[0].t<n;){let k=this.windSamples.shift();if(!k)break;this.windMinDeque.length&&this.windMinDeque[0].i===k.i&&this.windMinDeque.shift(),this.windMaxDeque.length&&this.windMaxDeque[0].i===k.i&&this.windMaxDeque.shift();}if(!this.windSamples.length||!this.windMinDeque.length||!this.windMaxDeque.length){(this.trueWindMinHistoric()!==void 0||this.trueWindMidHistoric()!==void 0||this.trueWindMaxHistoric()!==void 0)&&(this.trueWindMinHistoric.set(void 0),this.trueWindMidHistoric.set(void 0),this.trueWindMaxHistoric.set(void 0),this.lastSector={});return}let e=this.windMinDeque[0].u,t=this.windMaxDeque[0].u,o=(e+t)/2,r=this.normalizeAngle(e),p=this.normalizeAngle(o),u=this.normalizeAngle(t),M=this.lastSector.min,A=this.lastSector.mid,W=this.lastSector.max;(M===void 0||this.angleDelta(M,r)>=this.DEG_EPSILON||A===void 0||this.angleDelta(A,p)>=this.DEG_EPSILON||W===void 0||this.angleDelta(W,u)>=this.DEG_EPSILON)&&(this.trueWindMinHistoric.set(r),this.trueWindMidHistoric.set(p),this.trueWindMaxHistoric.set(u),this.lastSector={min:r,mid:p,max:u});}getPathValueOrZero(n){return n.data.value==null?0:n.data.value}stopWindSectors(){this.windSectorObservableSub?.unsubscribe();}unwrapAngle(n){if(this.lastUnwrapped==null)return this.lastUnwrapped=n,n;let e=this.lastUnwrapped,t=(e%360+360)%360,o=(n-t+540)%360-180,r=e+o;return this.lastUnwrapped=r,r}normalizeAngle(n){return (n%360+360)%360}angleDelta(n,e){let t=(e-n+540)%360-180;return Math.abs(t)}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=JD({type:m,selectors:[["widget-wind-steer"]],inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:25,consts:[[3,"compassHeading","compassModeEnabled","courseOverGroundAngle","courseOverGroundEnabled","trueWindAngle","twsEnabled","twaEnabled","trueWindSpeed","trueWindSpeedUnit","appWindAngle","awsEnabled","appWindSpeed","appWindSpeedUnit","laylineAngle","closeHauledLineEnabled","windSectorEnabled","driftEnabled","driftFlow","driftSet","waypointAngle","waypointEnabled","trueWindMinHistoric","trueWindMidHistoric","trueWindMaxHistoric","sailSetupEnabled"]],template:function(e,t){e&1&&$h(0,"svg-windsteer",0),e&2&&Bh("compassHeading",t.currentHeading())("compassModeEnabled",t.compassModeEnabledValue())("courseOverGroundAngle",t.courseOverGroundAngle())("courseOverGroundEnabled",t.courseOverGroundEnabledValue())("trueWindAngle",t.trueWindAngle())("twsEnabled",t.twsEnabledValue())("twaEnabled",t.twaEnabledValue())("trueWindSpeed",t.trueWindSpeed())("trueWindSpeedUnit",t.trueWindSpeedUnit())("appWindAngle",t.appWindAngle())("awsEnabled",t.awsEnabledValue())("appWindSpeed",t.appWindSpeed())("appWindSpeedUnit",t.appWindSpeedUnit())("laylineAngle",t.laylineAngleValue())("closeHauledLineEnabled",t.closeHauledLineEnabledValue())("windSectorEnabled",t.windSectorEnabledValue())("driftEnabled",t.driftEnabledValue())("driftFlow",t.driftFlow())("driftSet",t.driftSet())("waypointAngle",t.waypointAngle())("waypointEnabled",t.waypointEnabledValue())("trueWindMinHistoric",t.trueWindMinHistoric())("trueWindMidHistoric",t.trueWindMidHistoric())("trueWindMaxHistoric",t.trueWindMaxHistoric())("sailSetupEnabled",t.runtime.options()?.sailSetupEnable??false);},dependencies:[J],encapsulation:2})}return m})();function mt(m,b){let n=(m+b)%360;return n<0&&(n+=360),n}function ht(m,b,n,e){return (m.includes("angleTrueWater")||m.includes("angleTrueGround"))&&e?mt(n,b):b}export{St as WidgetWindComponent,ht as computeTrueWindBaseAngle};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {cv as G}from'./main-
|
|
1
|
+
import {cv as G}from'./main-F7NMHHV4.js';var r={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function a$1(n){let e=G(G({},r),n);return `(() => {
|
|
2
2
|
if (window.__kipSwipeInit) return; window.__kipSwipeInit = true;
|
|
3
3
|
const instanceId='${e.instanceId}';
|
|
4
4
|
let pointerId=null; let startX=0; let startY=0; let startT=0; let peakPrimary=0; let peakCross=0; let cancelled=false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,e as e$1}from'./chunk-DPnbM-aB.js';import {g as ge$1}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,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,e}from'./chunk-BIb-xYiS.js';var ie=["alternatorSvg"];function oe(d,e){d&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No alternators detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K alternator paths or select alternators in widget settings."),ul()());}function ne(d){return d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Z=class d{static ALTERNATOR_DESCRIPTOR=a("widget-alternator");static SELF_ROOT_PATH=(()=>{let e=d.ALTERNATOR_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetAlternatorComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${d.SELF_ROOT_PATH}.*`;static PATH_REGEX=new RegExp(`^${ne(d.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 DEFAULT_CONFIG={color:"contrast",ignoreZones:false,alternator:{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("alternatorSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredAlternatorIds=vt([]);trackedDevices=vt([]);optionsById=vt({});cardMode=vt({displayMode:"full",metrics:["voltage","current","power","revolutions"]});alternatorsByKey=vt({});visibleAlternatorKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(i=>i.key);let r=this.alternatorsByKey(),t=new Set(this.discoveredAlternatorIds());return Object.keys(r).filter(i=>{let a=r[i];return !!a&&t.has(a.id)}).sort((i,a)=>i.localeCompare(a))});visibleAlternators=Dt(()=>{let e=this.visibleAlternatorKeys(),r=this.alternatorsByKey();return e.map(t=>r[t]).filter(t=>!!t)});hasAlternators=Dt(()=>this.visibleAlternators().length>0);activeDisplayMode=Dt(()=>this.renderMode()??this.cardMode().displayMode??"full");isCompactCardMode=Dt(()=>this.activeDisplayMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleAlternators();return e.length!==1?"Alternators":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$1=this.visibleAlternators(),r=this.theme(),t=this.widgetColors(),i=this.ignoreZones(),a=new Map;e$1.forEach(o=>a.set(o.id,(a.get(o.id)??0)+1));let l=new Set([...a.entries()].filter(([,o])=>o>1).map(([o])=>o)),s={};for(let o of e$1){let c=o.deviceKey??o.id,n=!!o.source&&l.has(o.id),p=this.resolveMostSevereState(o.powerState??null,o.currentState??null,o.voltageState??null,o.temperatureState??null,o.chargingModeState??null,o.revolutionsState??null,o.fieldDriveState??null,o.regulatorTemperatureState??null),T=this.resolveMostSevereState(o.voltageState??null,o.currentState??null),C=this.resolveMostSevereState(o.powerState??null,o.revolutionsState??null,o.temperatureState??null,o.regulatorTemperatureState??null),[u,I]=this.buildMetricRows(o);s[c]={id:o.id,titleText:this.resolveTitleText(o),modeText:this.isCompactCardMode()?"":this.resolveModeText(o),busText:this.isCompactCardMode()?"":n?o.source??"-":o.associatedBus||o.location||"-",metricsLineOne:u,metricsLineTwo:I,stateBarColor:e(p,t?.dim??"var(--kip-contrast-color)",r,i),titleTextColor:e(p,"var(--kip-contrast-color)",r,i),metaTextColor:e(this.resolveMostSevereState(o.chargingModeState??null,o.fieldDriveState??null),"var(--kip-contrast-dim-color)",r,i),primaryMetricsTextColor:e(T,"var(--kip-contrast-color)",r,i),secondaryMetricsTextColor:e(C,"var(--kip-contrast-color)",r,i)};}return s});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),i=this.visibleAlternators(),a=this.widgetColors();!this.svg||!a||this.requestRender({alternators:i,displayModels:t,widgetColors:a});});let e=[this.data.subscribePathTreeWithInitial(d.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$1(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${d.VIEWBOX_WIDTH} ${d.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Alternator View"),this.layer=this.svg.append("g").attr("class","alternator-layer");}applyConfig(e){let r=this.resolveAlternatorConfig(e);this.trackedDevices.set(r.trackedDevices??[]),this.reprojectSnapshotsToDeviceKeys(r.trackedDevices??[]),this.optionsById.set(r.optionsById),this.cardMode.set(this.normalizeCardMode(r.cardMode));}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map;e.forEach(t=>{let i=r.get(t.id)??[];i.push(t.key),r.set(t.id,i);}),this.alternatorsByKey.update(t=>{let i=t,a=false;return r.forEach((l,s)=>{let o=t[s];if(o){for(let c of l){if(t[c])continue;let n=e.find(p=>p.key===c);a||(i=G({},t),a=true),i[c]=z(G({},o),{source:n?.source??null,deviceKey:c});}a&&i[s]?.deviceKey===void 0&&delete i[s];}}),a?i:t});}resolveAlternatorConfig(e){let r=e.alternator,t=this.normalizeOptionsById(r?.optionsById??r?.alternatorOptionsById);return {trackedDevices:this.normalizeTrackedDevices(r?.trackedDevices),optionsById:t,cardMode:this.normalizeCardMode(r?.cardMode)}}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),l=this.normalizeOptionalString(i.source);if(!a||!l)return;let s=this.normalizeOptionalString(i.key)??`${a}||${l}`;r.set(s,{id:a,source:l,key:s});}),[...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}normalizeCardMode(e){let r=e&&typeof e=="object"?e:null;if(!r)return {displayMode:"full",metrics:["voltage","current","power","revolutions"]};let t=this.normalizeStringList(r?.metrics);return {displayMode:r?.displayMode==="compact"?"compact":"full",metrics:t.length?t:["voltage","current","power","revolutions"]}}normalizeStringList(e){if(!Array.isArray(e))return [];let r=new Set;return e.forEach(t=>{if(typeof t!="string")return;let i=t.trim();i.length>0&&r.add(i);}),[...r].sort((t,i)=>t.localeCompare(i))}normalizeOptionsById(e){if(!e||typeof e!="object")return {};let r={};return Object.entries(e).forEach(([t])=>{let i=this.normalizeOptionalString(t);i&&(r[i]={});}),r}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,l=`${t.id}::${t.key}`;if(this.pendingPathUpdates.set(l,{id:t.id,key:t.key,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();},d.PATH_BATCH_WINDOW_MS));}}parsePath(e){let r=e.match(d.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(i=>i.id)).forEach(i=>this.trackDiscoveredAlternator(i));let t=this.buildIdToDeviceKeysMap();this.alternatorsByKey.update(i=>{let a=i,l=false;for(let s of e){let o=t.get(s.id),c=o?.length?o:[s.id];for(let n of c){let p=!!o?.length,T=p?this.trackedDevices().find(Q=>Q.key===n):null,C=a[n]??{id:s.id,source:T?.source??null,deviceKey:p?n:void 0},u=G({},C);if(!this.applyValue(u,s.key,s.value,s.state))continue;let D=u.rawPower!=null?u.rawPower:u.voltage!=null&&u.current!=null?u.voltage*u.current:null;D!=null?u.power=Number.isFinite(D)?D:null:u.power=null,u.rawPower==null&&(u.powerState=this.resolveMostSevereState(u.voltageState??null,u.currentState??null)),l||(a=G({},a),l=true),a[n]=u;}}return l?a:i});}trackDiscoveredAlternator(e){let r=this.discoveredAlternatorIds();r.includes(e)||this.discoveredAlternatorIds.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 "chargingMode":return this.setMetricValue(e,"chargingMode","chargingModeState",this.toStringValue(t),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":case "realPower":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 "revolutions":return this.setMetricValue(e,"revolutions","revolutionsState",this.toNumber(t,"Hz"),i);case "fieldDrive":return this.setMetricValue(e,"fieldDrive","fieldDriveState",this.toNumber(t,"%"),i);case "regulatorTemperature":return this.setMetricValue(e,"regulatorTemperature","regulatorTemperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "setpointVoltage":return this.setMetricValue(e,"setpointVoltage","setpointVoltageState",this.toNumber(t,"V"),i);case "setpointCurrent":return this.setMetricValue(e,"setpointCurrent","setpointCurrentState",this.toNumber(t,"A"),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 l=!Object.is(e[r],i),s=!Object.is(e[t],a);return !l&&!s?false:(e[r]=i,e[t]=a,true)}requestRender(e){let r=this.widgetColors();!this.svg||!r||(this.pendingRenderSnapshot=e??{alternators:this.visibleAlternators(),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){if(!this.layer||!this.svg)return;let r=this.isCompactCardMode(),t=r?C:e$1,i=r?d.COMPACT_CARD_HEIGHT:d.CARD_HEIGHT,a=e.alternators.map((n,p)=>({key:n.deviceKey??n.id,alternator:n,y:p*(i+d.CARD_GAP)})),l=a.length?a[a.length-1].y+i:i;this.svg.attr("viewBox",`0 0 ${d.VIEWBOX_WIDTH} ${l}`);let s=this.layer.selectAll("g.alternator-card").data(a,n=>n.key),o=s.enter().append("g").attr("class","alternator-card");o.append("rect").attr("class","alternator-card-bg"),o.append("rect").attr("class","alternator-state-bar"),o.append("text").attr("class","alternator-title"),o.append("text").attr("class","alternator-id"),o.append("text").attr("class","alternator-mode"),o.append("text").attr("class","alternator-bus"),o.append("text").attr("class","alternator-metrics-1"),o.append("text").attr("class","alternator-metrics-2");let c=o.merge(s);c.attr("transform",n=>`translate(0, ${n.y})`),c.select("rect.alternator-card-bg").attr("x",.5).attr("y",.5).attr("rx",t.cardCornerRadius).attr("ry",t.cardCornerRadius).attr("width",d.VIEWBOX_WIDTH-1).attr("height",i-1).attr("stroke","var(--mat-sys-outline-variant)").attr("stroke-width",.5).attr("fill","none"),c.select("rect.alternator-state-bar").attr("x",1.5).attr("y",1.5).attr("rx",t.stateBarCornerRadius).attr("ry",t.stateBarCornerRadius).attr("width",3).attr("height",i-3).attr("fill",n=>e.displayModels[n.key]?.stateBarColor??e.widgetColors.dim),e.alternators.length>1?c.select("text.alternator-title").attr("x",t.titleX).attr("y",t.titleY).attr("font-size",t.titleFontSize).attr("fill",n=>e.displayModels[n.key]?.titleTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.titleText??this.resolveTitleText(n.alternator)):c.select("text.alternator-title").text(""),c.select("text.alternator-id").attr("x",t.idX).attr("y",t.idY).attr("text-anchor","end").attr("font-size",t.idFontSize).attr("fill","var(--kip-contrast-dim-color)").text(n=>n.alternator.id),c.select("text.alternator-mode").attr("x",t.metaLeftX).attr("y",t.metaY).attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",n=>e.displayModels[n.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(n=>e.displayModels[n.key]?.modeText??""),c.select("text.alternator-bus").attr("x",t.metaRightX).attr("y",t.metaY).attr("text-anchor","end").attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",n=>e.displayModels[n.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(n=>e.displayModels[n.key]?.busText??""),c.select("text.alternator-metrics-1").attr("x",t.lineOneX).attr("y",t.lineOneY).attr("font-size",t.lineOneFontSize).attr("fill",n=>e.displayModels[n.key]?.primaryMetricsTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.metricsLineOne??""),c.select("text.alternator-metrics-2").attr("x",t.lineTwoX).attr("y",t.lineTwoY).attr("font-size",t.lineTwoFontSize).attr("opacity",.85).attr("fill",n=>e.displayModels[n.key]?.secondaryMetricsTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.metricsLineTwo??""),s.exit().remove();}displayName(e){return e.name?.trim()||e.id}resolveTitleText(e){return e.name||`Alternator ${e.id}`}resolveModeText(e){return e.chargingMode?`Mode ${e.chargingMode}`:e.fieldDrive!=null?`Field ${e.fieldDrive.toFixed(0)} %`:"Mode -"}buildMetricRows(e){let r=this.cardMode();if(this.activeDisplayMode()==="full")return [`V ${this.formatValue(e.voltage,"V")} A ${this.formatValue(e.current,"A")}`,`P ${this.formatValue(e.power,"W")} RPM ${this.formatRevolutions(e.revolutions)}`];let t=r.metrics.map(l=>this.toMetricLabel(l,e)).filter(l=>!!l);if(!t.length)return ["V - A -","P - RPM -"];let i=t.slice(0,2).join(" "),a=t.slice(2,4).join(" ");return [i||" ",a||" "]}toMetricLabel(e,r){switch(e){case "voltage":return `V ${this.formatValue(r.voltage,"V")}`;case "current":return `A ${this.formatValue(r.current,"A")}`;case "power":return `P ${this.formatValue(r.power,"W")}`;case "temperature":return `T ${this.formatTemperature(r.temperature)}`;case "revolutions":return `RPM ${this.formatRevolutions(r.revolutions)}`;case "fieldDrive":return `FD ${this.formatPercent(r.fieldDrive)}`;case "regulatorTemperature":return `RT ${this.formatTemperature(r.regulatorTemperature)}`;default:return null}}formatValue(e,r){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${r}`}formatTemperature(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`}formatRevolutions(e){return e==null||Number.isNaN(e)?"-":Math.round(e*60).toString()}formatPercent(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(0)} %`}toStringValue(e){return typeof e=="string"?e: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||d)};static \u0275cmp=JD({type:d,selectors:[["widget-alternator"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,ie,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["alternatorSvg",""],[3,"text","color"],["aria-hidden","false",1,"alternator-svg"],[1,"alternator-empty"],[1,"alternator-empty-title"],[1,"alternator-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,oe,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasAlternators()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.alternator-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}.alternator-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)}.alternator-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.alternator-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{Z as WidgetAlternatorComponent};
|
|
1
|
+
import {C,e as e$1}from'./chunk-CzEDfe2A.js';import {g as ge$1}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,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-F7NMHHV4.js';import {c,e}from'./chunk-CRy9Da7a.js';var ie=["alternatorSvg"];function oe(d,e){d&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No alternators detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K alternator paths or select alternators in widget settings."),ul()());}function ne(d){return d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Z=class d{static ALTERNATOR_DESCRIPTOR=a("widget-alternator");static SELF_ROOT_PATH=(()=>{let e=d.ALTERNATOR_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetAlternatorComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${d.SELF_ROOT_PATH}.*`;static PATH_REGEX=new RegExp(`^${ne(d.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 DEFAULT_CONFIG={color:"contrast",ignoreZones:false,alternator:{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("alternatorSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredAlternatorIds=vt([]);trackedDevices=vt([]);optionsById=vt({});cardMode=vt({displayMode:"full",metrics:["voltage","current","power","revolutions"]});alternatorsByKey=vt({});visibleAlternatorKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(i=>i.key);let r=this.alternatorsByKey(),t=new Set(this.discoveredAlternatorIds());return Object.keys(r).filter(i=>{let a=r[i];return !!a&&t.has(a.id)}).sort((i,a)=>i.localeCompare(a))});visibleAlternators=Dt(()=>{let e=this.visibleAlternatorKeys(),r=this.alternatorsByKey();return e.map(t=>r[t]).filter(t=>!!t)});hasAlternators=Dt(()=>this.visibleAlternators().length>0);activeDisplayMode=Dt(()=>this.renderMode()??this.cardMode().displayMode??"full");isCompactCardMode=Dt(()=>this.activeDisplayMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleAlternators();return e.length!==1?"Alternators":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$1=this.visibleAlternators(),r=this.theme(),t=this.widgetColors(),i=this.ignoreZones(),a=new Map;e$1.forEach(o=>a.set(o.id,(a.get(o.id)??0)+1));let l=new Set([...a.entries()].filter(([,o])=>o>1).map(([o])=>o)),s={};for(let o of e$1){let c=o.deviceKey??o.id,n=!!o.source&&l.has(o.id),p=this.resolveMostSevereState(o.powerState??null,o.currentState??null,o.voltageState??null,o.temperatureState??null,o.chargingModeState??null,o.revolutionsState??null,o.fieldDriveState??null,o.regulatorTemperatureState??null),T=this.resolveMostSevereState(o.voltageState??null,o.currentState??null),C=this.resolveMostSevereState(o.powerState??null,o.revolutionsState??null,o.temperatureState??null,o.regulatorTemperatureState??null),[u,I]=this.buildMetricRows(o);s[c]={id:o.id,titleText:this.resolveTitleText(o),modeText:this.isCompactCardMode()?"":this.resolveModeText(o),busText:this.isCompactCardMode()?"":n?o.source??"-":o.associatedBus||o.location||"-",metricsLineOne:u,metricsLineTwo:I,stateBarColor:e(p,t?.dim??"var(--kip-contrast-color)",r,i),titleTextColor:e(p,"var(--kip-contrast-color)",r,i),metaTextColor:e(this.resolveMostSevereState(o.chargingModeState??null,o.fieldDriveState??null),"var(--kip-contrast-dim-color)",r,i),primaryMetricsTextColor:e(T,"var(--kip-contrast-color)",r,i),secondaryMetricsTextColor:e(C,"var(--kip-contrast-color)",r,i)};}return s});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),i=this.visibleAlternators(),a=this.widgetColors();!this.svg||!a||this.requestRender({alternators:i,displayModels:t,widgetColors:a});});let e=[this.data.subscribePathTreeWithInitial(d.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$1(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${d.VIEWBOX_WIDTH} ${d.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Alternator View"),this.layer=this.svg.append("g").attr("class","alternator-layer");}applyConfig(e){let r=this.resolveAlternatorConfig(e);this.trackedDevices.set(r.trackedDevices??[]),this.reprojectSnapshotsToDeviceKeys(r.trackedDevices??[]),this.optionsById.set(r.optionsById),this.cardMode.set(this.normalizeCardMode(r.cardMode));}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map;e.forEach(t=>{let i=r.get(t.id)??[];i.push(t.key),r.set(t.id,i);}),this.alternatorsByKey.update(t=>{let i=t,a=false;return r.forEach((l,s)=>{let o=t[s];if(o){for(let c of l){if(t[c])continue;let n=e.find(p=>p.key===c);a||(i=G({},t),a=true),i[c]=z(G({},o),{source:n?.source??null,deviceKey:c});}a&&i[s]?.deviceKey===void 0&&delete i[s];}}),a?i:t});}resolveAlternatorConfig(e){let r=e.alternator,t=this.normalizeOptionsById(r?.optionsById??r?.alternatorOptionsById);return {trackedDevices:this.normalizeTrackedDevices(r?.trackedDevices),optionsById:t,cardMode:this.normalizeCardMode(r?.cardMode)}}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),l=this.normalizeOptionalString(i.source);if(!a||!l)return;let s=this.normalizeOptionalString(i.key)??`${a}||${l}`;r.set(s,{id:a,source:l,key:s});}),[...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}normalizeCardMode(e){let r=e&&typeof e=="object"?e:null;if(!r)return {displayMode:"full",metrics:["voltage","current","power","revolutions"]};let t=this.normalizeStringList(r?.metrics);return {displayMode:r?.displayMode==="compact"?"compact":"full",metrics:t.length?t:["voltage","current","power","revolutions"]}}normalizeStringList(e){if(!Array.isArray(e))return [];let r=new Set;return e.forEach(t=>{if(typeof t!="string")return;let i=t.trim();i.length>0&&r.add(i);}),[...r].sort((t,i)=>t.localeCompare(i))}normalizeOptionsById(e){if(!e||typeof e!="object")return {};let r={};return Object.entries(e).forEach(([t])=>{let i=this.normalizeOptionalString(t);i&&(r[i]={});}),r}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,l=`${t.id}::${t.key}`;if(this.pendingPathUpdates.set(l,{id:t.id,key:t.key,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();},d.PATH_BATCH_WINDOW_MS));}}parsePath(e){let r=e.match(d.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(i=>i.id)).forEach(i=>this.trackDiscoveredAlternator(i));let t=this.buildIdToDeviceKeysMap();this.alternatorsByKey.update(i=>{let a=i,l=false;for(let s of e){let o=t.get(s.id),c=o?.length?o:[s.id];for(let n of c){let p=!!o?.length,T=p?this.trackedDevices().find(Q=>Q.key===n):null,C=a[n]??{id:s.id,source:T?.source??null,deviceKey:p?n:void 0},u=G({},C);if(!this.applyValue(u,s.key,s.value,s.state))continue;let D=u.rawPower!=null?u.rawPower:u.voltage!=null&&u.current!=null?u.voltage*u.current:null;D!=null?u.power=Number.isFinite(D)?D:null:u.power=null,u.rawPower==null&&(u.powerState=this.resolveMostSevereState(u.voltageState??null,u.currentState??null)),l||(a=G({},a),l=true),a[n]=u;}}return l?a:i});}trackDiscoveredAlternator(e){let r=this.discoveredAlternatorIds();r.includes(e)||this.discoveredAlternatorIds.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 "chargingMode":return this.setMetricValue(e,"chargingMode","chargingModeState",this.toStringValue(t),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":case "realPower":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 "revolutions":return this.setMetricValue(e,"revolutions","revolutionsState",this.toNumber(t,"Hz"),i);case "fieldDrive":return this.setMetricValue(e,"fieldDrive","fieldDriveState",this.toNumber(t,"%"),i);case "regulatorTemperature":return this.setMetricValue(e,"regulatorTemperature","regulatorTemperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "setpointVoltage":return this.setMetricValue(e,"setpointVoltage","setpointVoltageState",this.toNumber(t,"V"),i);case "setpointCurrent":return this.setMetricValue(e,"setpointCurrent","setpointCurrentState",this.toNumber(t,"A"),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 l=!Object.is(e[r],i),s=!Object.is(e[t],a);return !l&&!s?false:(e[r]=i,e[t]=a,true)}requestRender(e){let r=this.widgetColors();!this.svg||!r||(this.pendingRenderSnapshot=e??{alternators:this.visibleAlternators(),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){if(!this.layer||!this.svg)return;let r=this.isCompactCardMode(),t=r?C:e$1,i=r?d.COMPACT_CARD_HEIGHT:d.CARD_HEIGHT,a=e.alternators.map((n,p)=>({key:n.deviceKey??n.id,alternator:n,y:p*(i+d.CARD_GAP)})),l=a.length?a[a.length-1].y+i:i;this.svg.attr("viewBox",`0 0 ${d.VIEWBOX_WIDTH} ${l}`);let s=this.layer.selectAll("g.alternator-card").data(a,n=>n.key),o=s.enter().append("g").attr("class","alternator-card");o.append("rect").attr("class","alternator-card-bg"),o.append("rect").attr("class","alternator-state-bar"),o.append("text").attr("class","alternator-title"),o.append("text").attr("class","alternator-id"),o.append("text").attr("class","alternator-mode"),o.append("text").attr("class","alternator-bus"),o.append("text").attr("class","alternator-metrics-1"),o.append("text").attr("class","alternator-metrics-2");let c=o.merge(s);c.attr("transform",n=>`translate(0, ${n.y})`),c.select("rect.alternator-card-bg").attr("x",.5).attr("y",.5).attr("rx",t.cardCornerRadius).attr("ry",t.cardCornerRadius).attr("width",d.VIEWBOX_WIDTH-1).attr("height",i-1).attr("stroke","var(--mat-sys-outline-variant)").attr("stroke-width",.5).attr("fill","none"),c.select("rect.alternator-state-bar").attr("x",1.5).attr("y",1.5).attr("rx",t.stateBarCornerRadius).attr("ry",t.stateBarCornerRadius).attr("width",3).attr("height",i-3).attr("fill",n=>e.displayModels[n.key]?.stateBarColor??e.widgetColors.dim),e.alternators.length>1?c.select("text.alternator-title").attr("x",t.titleX).attr("y",t.titleY).attr("font-size",t.titleFontSize).attr("fill",n=>e.displayModels[n.key]?.titleTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.titleText??this.resolveTitleText(n.alternator)):c.select("text.alternator-title").text(""),c.select("text.alternator-id").attr("x",t.idX).attr("y",t.idY).attr("text-anchor","end").attr("font-size",t.idFontSize).attr("fill","var(--kip-contrast-dim-color)").text(n=>n.alternator.id),c.select("text.alternator-mode").attr("x",t.metaLeftX).attr("y",t.metaY).attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",n=>e.displayModels[n.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(n=>e.displayModels[n.key]?.modeText??""),c.select("text.alternator-bus").attr("x",t.metaRightX).attr("y",t.metaY).attr("text-anchor","end").attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",n=>e.displayModels[n.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(n=>e.displayModels[n.key]?.busText??""),c.select("text.alternator-metrics-1").attr("x",t.lineOneX).attr("y",t.lineOneY).attr("font-size",t.lineOneFontSize).attr("fill",n=>e.displayModels[n.key]?.primaryMetricsTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.metricsLineOne??""),c.select("text.alternator-metrics-2").attr("x",t.lineTwoX).attr("y",t.lineTwoY).attr("font-size",t.lineTwoFontSize).attr("opacity",.85).attr("fill",n=>e.displayModels[n.key]?.secondaryMetricsTextColor??"var(--kip-contrast-color)").text(n=>e.displayModels[n.key]?.metricsLineTwo??""),s.exit().remove();}displayName(e){return e.name?.trim()||e.id}resolveTitleText(e){return e.name||`Alternator ${e.id}`}resolveModeText(e){return e.chargingMode?`Mode ${e.chargingMode}`:e.fieldDrive!=null?`Field ${e.fieldDrive.toFixed(0)} %`:"Mode -"}buildMetricRows(e){let r=this.cardMode();if(this.activeDisplayMode()==="full")return [`V ${this.formatValue(e.voltage,"V")} A ${this.formatValue(e.current,"A")}`,`P ${this.formatValue(e.power,"W")} RPM ${this.formatRevolutions(e.revolutions)}`];let t=r.metrics.map(l=>this.toMetricLabel(l,e)).filter(l=>!!l);if(!t.length)return ["V - A -","P - RPM -"];let i=t.slice(0,2).join(" "),a=t.slice(2,4).join(" ");return [i||" ",a||" "]}toMetricLabel(e,r){switch(e){case "voltage":return `V ${this.formatValue(r.voltage,"V")}`;case "current":return `A ${this.formatValue(r.current,"A")}`;case "power":return `P ${this.formatValue(r.power,"W")}`;case "temperature":return `T ${this.formatTemperature(r.temperature)}`;case "revolutions":return `RPM ${this.formatRevolutions(r.revolutions)}`;case "fieldDrive":return `FD ${this.formatPercent(r.fieldDrive)}`;case "regulatorTemperature":return `RT ${this.formatTemperature(r.regulatorTemperature)}`;default:return null}}formatValue(e,r){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${r}`}formatTemperature(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`}formatRevolutions(e){return e==null||Number.isNaN(e)?"-":Math.round(e*60).toString()}formatPercent(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(0)} %`}toStringValue(e){return typeof e=="string"?e: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||d)};static \u0275cmp=JD({type:d,selectors:[["widget-alternator"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,ie,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["alternatorSvg",""],[3,"text","color"],["aria-hidden","false",1,"alternator-svg"],[1,"alternator-empty"],[1,"alternator-empty-title"],[1,"alternator-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,oe,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasAlternators()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.alternator-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}.alternator-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)}.alternator-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.alternator-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{Z as WidgetAlternatorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p as p$1}from'./chunk-CaD3zVfK.js';import {G as Gt,D as Dt$1}from'./chunk-
|
|
1
|
+
import {p as p$1}from'./chunk-CaD3zVfK.js';import {G as Gt,D as Dt$1}from'./chunk-BAVmyVwG.js';import {u}from'./chunk-Be5KcT7R.js';import {k}from'./chunk-tbyiK3Ur.js';import {d1 as Hj,w,du as p,dv as rt,dD as _,bu as ut,$ as $j,a6 as Lr,v as vt,D as Dt,dx as n$1,cw as z,cv as G,F as Fa,dn as ge$1,J as JD,_ as _w,M as Mw,f as eg,K as Kw,h as Fw,P as Pi,k as Qh,u as ul,g as qw,B as Bh,an as Hh,l as ud,m as dd}from'./main-F7NMHHV4.js';import {c}from'./chunk-CRy9Da7a.js';var Z=["linearGauge"];function Q(s,H){if(s&1){let t=Fw();Pi(0,"linear-gauge",2,0),Qh("resizeChange",function(a){ud(t);let e=qw();return dd(e.onResized(a))}),ul();}if(s&2){let t=qw();Bh("options",t.gaugeOptions)("value",t.displayValue()),Hh("value-text",t.textValue());}}var ge=(()=>{class s{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);streams=w(rt);metadata=w(_);unitsService=w(ut);static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",suppressBootstrapNull:true,isPathConfigurable:true,showPathSkUnitsFilter:true,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{lower:0,upper:100,type:"linear"},gauge:{type:"ngLinear",subType:"vertical",highlightsWidth:5,enableTicks:true,enableNeedle:false},numInt:1,numDecimal:0,color:"contrast",enableTimeout:false,dataTimeout:5,ignoreZones:false};ngGauge=$j("linearGauge");gauge=$j("linearGauge",{read:Lr});textValue=vt("--");value=vt(void 0);displayValue=Dt(()=>this.value()??0);shouldRenderGauge=Dt(()=>this.value()!==void 0);gaugeOptions={};viewReady=vt(false);gaugeBootstrapped=vt(false);animationEnabled=Dt(()=>this.gaugeBootstrapped());currentState=vt(n$1.Normal);normalizedConfig=Dt(()=>this.runtime.options()??s.DEFAULT_CONFIG);gaugePathConfig=Dt(()=>this.normalizedConfig().paths?.gaugePath);normalizedScale=Dt(()=>{let t=this.normalizedConfig().displayScale??s.DEFAULT_CONFIG.displayScale;return z(G({},t),{lower:t.lower??0,upper:t.upper??100})});adjustedScale=Dt(()=>{let t=this.normalizedConfig(),i=this.normalizedScale();return t.gauge?.enableTicks?p$1(i.lower,i.upper):{min:i.lower,max:i.upper,majorTicks:[]}});highlights=Dt(()=>{let t=this.metadata.zones(),i=this.normalizedConfig(),a=this.theme(),e=this.gaugePathConfig();return t?.length?a?i.ignoreZones?[]:e?k(t,a,e.convertUnitTo??"",this.unitsService,this.adjustedScale().min,this.adjustedScale().max):[]:[]:[]});displayName=Dt(()=>this.normalizedConfig().displayName||"Gauge Label");constructor(){Fa(()=>{this.normalizedConfig();let i=this.theme(),a=this.gaugePathConfig(),e=this.normalizedScale();!i||!a?.path||ge$1(()=>this.streams.observe("gaugePath",o=>{let n=o?.data?.value??null;if(n==null)this.value.set(e.lower),this.textValue.set("--");else {let r=Math.min(Math.max(n,e.lower),e.upper);this.value.set(r),this.textValue()==="--"&&this.textValue.set("");}o.state!==this.currentState()&&this.currentState.set(o.state);}));}),Fa(()=>{this.normalizedConfig().ignoreZones||ge$1(()=>this.metadata.observe("gaugePath"));}),Fa(()=>{let t=this.highlights();this.viewReady()&&ge$1(()=>{try{if(!t.length)this.ngGauge()?.update({highlights:[]});else {let i=JSON.stringify(t);this.ngGauge()?.update({highlights:i,highlightsWidth:this.normalizedConfig().gauge?.highlightsWidth});}}catch(i){}});}),Fa(()=>{let t=this.normalizedConfig(),i=this.theme(),a=this.adjustedScale();i&&ge$1(()=>{if(this.buildGaugeOptions(t,i,a),this.viewReady())try{this.ngGauge()?.update(this.gaugeOptions),this.applyInitialSize();}catch(e){}});}),Fa(()=>{let t=this.ngGauge();!t||this.gaugeBootstrapped()||ge$1(()=>{try{requestAnimationFrame(()=>{this.gaugeBootstrapped.set(!0);try{t.update({animation:!0,animatedValue:!0});}catch(i){}});}catch(i){}});}),Fa(()=>{let t=this.currentState();this.viewReady()&&ge$1(()=>{let i=this.normalizedConfig(),a=this.theme();if(!a||i.ignoreZones)return;let e={},o=i.gauge?.enableNeedle,n=c(i.color??"contrast",a);switch(t){case n$1.Alarm:o?(e.colorNeedle=a.zoneAlarm,e.colorValueText=a.zoneAlarm):(e.colorBarProgress=a.zoneAlarm,e.colorValueText=a.zoneAlarm);break;case n$1.Warn:o?(e.colorNeedle=a.zoneWarn,e.colorValueText=a.zoneWarn):(e.colorBarProgress=a.zoneWarn,e.colorValueText=a.zoneWarn);break;case n$1.Alert:o?(e.colorNeedle=a.zoneAlert,e.colorValueText=a.zoneAlert):(e.colorBarProgress=a.zoneAlert,e.colorValueText=a.zoneAlert);break;default:o?(e.colorNeedle=n.color,e.colorValueText=n.color):(e.colorBarProgress=n.color,e.colorValueText=n.color);}try{this.ngGauge()?.update(e);}catch(r){}});});}buildGaugeOptions(t,i,a){let e=this.gaugeOptions={},o=t.gauge?.subType==="vertical",n=t.gauge?.enableNeedle,r=t.gauge?.enableTicks,m=this.gaugePathConfig();e.minValue=a.min,e.maxValue=a.max,e.valueInt=t.numInt??1,e.valueDec=t.numDecimal??2,e.title=this.displayName(),e.fontTitleSize=40,e.fontTitle="Roboto",e.fontTitleWeight="bold",e.barLength=o?80:90,e.barWidth=r?n?0:30:60,e.barProgress=true,e.barBeginCircle=0,e.barStrokeWidth=0,e.barShadow=0,e.needle=!!n,e.needleType=n?"arrow":"line",e.needleStart=n?o?200:155:-45,e.needleEnd=n?o?175:180:55,e.needleShadow=true,e.needleSide="both",e.units=m?.convertUnitTo??"",e.fontUnits="Roboto",e.fontUnitsWeight="normal",e.borders=false,e.borderOuterWidth=0,e.borderMiddleWidth=0,e.borderInnerWidth=0,e.borderShadowWidth=0,e.borderRadius=0,e.valueBox=true,e.valueBoxWidth=35,e.valueBoxStroke=0,e.valueBoxBorderRadius=10,e.colorValueBoxRect="",e.colorValueBoxRectEnd="",e.colorValueBoxShadow="",e.fontValueSize=50,e.fontValue="Roboto",e.fontValueWeight="bold",e.valueTextShadow=false,e.fontNumbers="Roboto",e.fontNumbersWeight="normal",e.fontUnitsSize=o?40:35,e.colorTitle=c("contrast",i).dim,e.colorUnits=c("contrast",i).dim,e.colorValueBoxBackground=i.background;let u=c(t.color??"contrast",i);e.colorValueText=u.color,n?(e.colorNeedle=u.color,e.colorNeedleEnd=u.color,e.needleWidth=45,e.colorNeedleShadowUp=u.color,e.colorNeedleShadowDown=u.color):(e.colorBarProgress=u.color,e.colorBarProgressEnd="",e.needleWidth=0),e.colorPlate=i.cardColor,e.colorBar=i.background,e.colorBarEnd="",e.colorBarStroke="0",e.colorMajorTicks=c("contrast",i).dim,e.colorMinorTicks=c("contrast",i).dim,e.colorNumbers=c("contrast",i).dim,e.majorTicks=r?a.majorTicks:[],e.majorTicksInt=t.numInt??1,e.majorTicksDec=t.numDecimal??2,e.strokeTicks=!!r,e.minorTicks=r?2:0,e.ticksWidthMinor=r?6:0,e.numberSide=n?"right":"left",e.fontNumbersSize=r?o?22:30:0,e.numbersMargin=o?n?-7:-3:n?-33:-5,e.ticksWidth=r?n&&o?15:10:0,e.ticksPadding=r?o?n?0:5:n?9:8:0,e.tickSide="left",e.animation=this.animationEnabled(),e.animationRule="linear",e.animatedValue=this.animationEnabled(),e.animateOnInit=false,e.animationDuration=(m?.sampleTime??500)-25,e.highlights=[],e.highlightsWidth=t.gauge?.highlightsWidth;let N=this.highlights();N.length&&(e.highlights=JSON.stringify(N));}ngAfterViewInit(){this.viewReady.set(true),this.applyInitialSize();try{this.ngGauge()?.update(this.gaugeOptions);}catch(t){}}applyInitialSize(){let t=this.gauge()?.nativeElement;if(!t)return;let i=t.getBoundingClientRect(),a=.3,e,o;this.normalizedConfig().gauge?.subType==="vertical"?(e=i.height,o=i.height*a):(o=i.width,e=i.width*a);let m={height:e,width:o};try{this.ngGauge()?.update(m);}catch(u){}}onResized(t){let i=this.normalizedConfig(),a=.3,e=i.gauge?.subType==="vertical",o=0,n=0;e?(n=t.contentRect.height,o=n*a,o>t.contentRect.width&&(o=t.contentRect.width,n=o/a)):(o=t.contentRect.width,n=o*a,n>t.contentRect.height&&(n=t.contentRect.height,o=n/a));let r={width:o,height:n-10};try{this.ngGauge()?.update(r);}catch(m){}}static \u0275fac=function(i){return new(i||s)};static \u0275cmp=JD({type:s,selectors:[["widget-gauge-ng-linear"]],viewQuery:function(i,a){i&1&&eg(a.ngGauge,Z,5)(a.gauge,Z,5,Lr),i&2&&Kw(2);},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:1,consts:[["linearGauge",""],["kipResizeObserver","",1,"linearGauge",3,"options","value"],["kipResizeObserver","",1,"linearGauge",3,"resizeChange","options","value"]],template:function(i,a){i&1&&_w(0,Q,2,3,"linear-gauge",1),i&2&&Mw(a.shouldRenderGauge()?0:-1);},dependencies:[u,Gt,Dt$1],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block} linear-gauge{display:block;position:relative;width:100%;min-width:8px;height:100%;overflow:clip} linear-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);margin-top:5px}"]})}return s})();export{ge as WidgetGaugeNgLinearComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {cv as G}from'./main-
|
|
1
|
+
import {cv as G}from'./main-F7NMHHV4.js';var e={cardCornerRadius:4,stateBarCornerRadius:2.5,titleX:0,titleY:10,titleFontSize:12.5,primaryX:135,primaryY:48,primaryFontSize:34,primaryFontWeight:700,lineOneX:5,lineOneY:30,lineOneFontSize:20,lineTwoX:10,lineTwoY:93,lineTwoFontSize:8,idX:194,idY:26,idFontSize:7.5,metaLeftX:5,metaRightX:194,metaY:63,metaFontSize:8},C=G({},e);export{C,e};
|