@mxtommy/kip 3.1.0 → 3.1.2-beta1

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.
@@ -1,4 +1,4 @@
1
- import{A as Sd,B as Cd,C as xd,D as Ui,E as hn,F as Td,G as Ed,H as Ad,I as Dd,J as Pd,K as Md,L as Od,a as Fi,b as Hi,c as Gi,d as po,e as dn,f as xr,g as ui,h as ji,i as jt,j as fo,k as go,l as Kn,m as cn,n as vo,o as yo,p as mi,q as La,r as bo,s as Tr,t as kd,u as Fa,v as Ha,w as Ga,x as ja,y as $n,z as Er}from"./chunk-KQMVFIRU.js";import{b as Wd,g as Bd}from"./chunk-5BPL4ALQ.js";import{a as lt,b as pd,c as co,d as Qn,e as Xn,f as fd,g as gd,h as vd}from"./chunk-UIK3O3GZ.js";import"./chunk-YQQFIIO5.js";import{a as yd,b as bd,c as _d,d as wd,e as uo,f as mo}from"./chunk-WJMKCVFQ.js";import{a as Yn,b as ho}from"./chunk-MCACXEYY.js";import{a as Id,b as Rd,c as Nd}from"./chunk-OG77M7OV.js";import{a as lo}from"./chunk-FMVUDX5R.js";import"./chunk-FFCTE2U5.js";import"./chunk-7OTNT2GF.js";import{a as Wl,b as Bl,c as zl,d as Vl,e as Ll,f as Fl,g as Ln,h as Hl,i as no,k as Gl,l as jl,m as Ul,n as Yl,o as ki,p as Bt}from"./chunk-VIHODUV4.js";import{f as hd}from"./chunk-FCC7GNHD.js";import"./chunk-SGYCFQGT.js";import{a as ii}from"./chunk-Y2VTFOTB.js";import{a as md}from"./chunk-RCSPPHLA.js";import{a as Vn,b as Ml,c as Ol,d as to,f as io,g as ti,h as Cr,i as Fn,j as Na,k as Wt,l as te,m as Hn,n as wi,o as Gn,p as ql,r as Li,y as ud}from"./chunk-AHFD2AA5.js";import{$ as Da,$a as Ai,$b as Nt,$c as eo,$d as oo,Ac as ce,Ae as od,Bb as Ia,Bc as Xe,Be as ad,Cb as de,Cc as kl,Da as Zt,Dc as E,Ea as V,Eb as vl,Ec as xt,Ee as za,Fa as L,Fc as at,Fd as Il,G as rl,Ga as dt,Gd as Rl,H as Ta,Ha as dl,Hb as G,Hd as Nl,I as ol,Ia as Wn,Ib as Jt,Ic as Ae,J as al,Jb as bi,Jc as De,K as On,Ka as on,Kb as yl,Kc as Pe,Ke as sd,Lb as fe,Lc as Sl,Le as qn,Ma as cl,Mc as Cl,Me as ld,Nb as ke,Nc as xl,Ne as Va,O as Xr,Oa as st,Oc as Bn,Od as jn,Pa as ut,Pe as dd,Q as kr,Qd as Wa,R as Ea,Ra as Wi,Rc as Jr,S as Aa,Sa as Q,Sc as Tl,Se as cd,Ta as Ee,Tc as El,Td as Ql,U as sl,Ub as bl,Va as an,Vc as Ra,Vd as Xl,Wa as hl,Wd as Kl,Xc as zn,Yb as be,Yd as ro,Zb as j,_b as it,a as $,aa as In,ae as $l,b as rt,be as Zl,c as il,cb as ul,cd as Fe,ce as Jl,d as ka,db as ml,dc as Ge,de as ao,e as wr,eb as Sr,ec as Zr,ed as Al,ee as ed,f as Sa,fa as Pa,fd as Vi,g as rn,gc as Bi,ha as Gt,hc as zi,ia as Ma,ic as v,jc as _,je as td,kc as B,ke as id,la as Ve,lc as _l,le as Un,m as bt,mc as wl,ne as ln,o as Ni,oa as ot,oc as ee,od as Dl,pa as $t,qb as Oa,qc as F,ra as Rn,rb as Kr,rc as se,sc as ei,sd as _i,t as nl,ta as Nn,tb as pl,tc as Ct,te as nd,u as Ca,ua as M,ub as P,uc as ci,vc as sn,ve as ni,wb as fl,wc as Je,wd as Pl,we as so,xb as gl,xc as je,xe as rd,y as xa,ya as ll,yb as $r,yc as Ue,ye as hi,z as Ht,zb as Rt,ze as Ba}from"./chunk-JIJMSRKJ.js";var Qa=ka(Ao=>{(function(){"use strict";var r=function(){this.init()};r.prototype={init:function(){var s=this||n;return s._counter=1e3,s._html5AudioPool=[],s.html5PoolSize=10,s._codecs={},s._howls=[],s._muted=!1,s._volume=1,s._canPlayEvent="canplaythrough",s._navigator=typeof window<"u"&&window.navigator?window.navigator:null,s.masterGain=null,s.noAudio=!1,s.usingWebAudio=!0,s.autoSuspend=!0,s.ctx=null,s.autoUnlock=!0,s._setup(),s},volume:function(s){var c=this||n;if(s=parseFloat(s),c.ctx||f(),typeof s<"u"&&s>=0&&s<=1){if(c._volume=s,c._muted)return c;c.usingWebAudio&&c.masterGain.gain.setValueAtTime(s,n.ctx.currentTime);for(var p=0;p<c._howls.length;p++)if(!c._howls[p]._webAudio)for(var y=c._howls[p]._getSoundIds(),k=0;k<y.length;k++){var x=c._howls[p]._soundById(y[k]);x&&x._node&&(x._node.volume=x._volume*s)}return c}return c._volume},mute:function(s){var c=this||n;c.ctx||f(),c._muted=s,c.usingWebAudio&&c.masterGain.gain.setValueAtTime(s?0:c._volume,n.ctx.currentTime);for(var p=0;p<c._howls.length;p++)if(!c._howls[p]._webAudio)for(var y=c._howls[p]._getSoundIds(),k=0;k<y.length;k++){var x=c._howls[p]._soundById(y[k]);x&&x._node&&(x._node.muted=s?!0:x._muted)}return c},stop:function(){for(var s=this||n,c=0;c<s._howls.length;c++)s._howls[c].stop();return s},unload:function(){for(var s=this||n,c=s._howls.length-1;c>=0;c--)s._howls[c].unload();return s.usingWebAudio&&s.ctx&&typeof s.ctx.close<"u"&&(s.ctx.close(),s.ctx=null,f()),s},codecs:function(s){return(this||n)._codecs[s.replace(/^x-/,"")]},_setup:function(){var s=this||n;if(s.state=s.ctx&&s.ctx.state||"suspended",s._autoSuspend(),!s.usingWebAudio)if(typeof Audio<"u")try{var c=new Audio;typeof c.oncanplaythrough>"u"&&(s._canPlayEvent="canplay")}catch{s.noAudio=!0}else s.noAudio=!0;try{var c=new Audio;c.muted&&(s.noAudio=!0)}catch{}return s.noAudio||s._setupCodecs(),s},_setupCodecs:function(){var s=this||n,c=null;try{c=typeof Audio<"u"?new Audio:null}catch{return s}if(!c||typeof c.canPlayType!="function")return s;var p=c.canPlayType("audio/mpeg;").replace(/^no$/,""),y=s._navigator?s._navigator.userAgent:"",k=y.match(/OPR\/(\d+)/g),x=k&&parseInt(k[0].split("/")[1],10)<33,A=y.indexOf("Safari")!==-1&&y.indexOf("Chrome")===-1,z=y.match(/Version\/(.*?) /),Y=A&&z&&parseInt(z[1],10)<15;return s._codecs={mp3:!!(!x&&(p||c.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!p,opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(c.canPlayType('audio/wav; codecs="1"')||c.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(c.canPlayType("audio/x-m4b;")||c.canPlayType("audio/m4b;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!Y&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!Y&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!c.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")},s},_unlockAudio:function(){var s=this||n;if(!(s._audioUnlocked||!s.ctx)){s._audioUnlocked=!1,s.autoUnlock=!1,!s._mobileUnloaded&&s.ctx.sampleRate!==44100&&(s._mobileUnloaded=!0,s.unload()),s._scratchBuffer=s.ctx.createBuffer(1,1,22050);var c=function(p){for(;s._html5AudioPool.length<s.html5PoolSize;)try{var y=new Audio;y._unlocked=!0,s._releaseHtml5Audio(y)}catch{s.noAudio=!0;break}for(var k=0;k<s._howls.length;k++)if(!s._howls[k]._webAudio)for(var x=s._howls[k]._getSoundIds(),A=0;A<x.length;A++){var z=s._howls[k]._soundById(x[A]);z&&z._node&&!z._node._unlocked&&(z._node._unlocked=!0,z._node.load())}s._autoResume();var Y=s.ctx.createBufferSource();Y.buffer=s._scratchBuffer,Y.connect(s.ctx.destination),typeof Y.start>"u"?Y.noteOn(0):Y.start(0),typeof s.ctx.resume=="function"&&s.ctx.resume(),Y.onended=function(){Y.disconnect(0),s._audioUnlocked=!0,document.removeEventListener("touchstart",c,!0),document.removeEventListener("touchend",c,!0),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",c,!0);for(var re=0;re<s._howls.length;re++)s._howls[re]._emit("unlock")}};return document.addEventListener("touchstart",c,!0),document.addEventListener("touchend",c,!0),document.addEventListener("click",c,!0),document.addEventListener("keydown",c,!0),s}},_obtainHtml5Audio:function(){var s=this||n;if(s._html5AudioPool.length)return s._html5AudioPool.pop();var c=new Audio().play();return c&&typeof Promise<"u"&&(c instanceof Promise||typeof c.then=="function")&&c.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(s){var c=this||n;return s._unlocked&&c._html5AudioPool.push(s),c},_autoSuspend:function(){var s=this;if(!(!s.autoSuspend||!s.ctx||typeof s.ctx.suspend>"u"||!n.usingWebAudio)){for(var c=0;c<s._howls.length;c++)if(s._howls[c]._webAudio){for(var p=0;p<s._howls[c]._sounds.length;p++)if(!s._howls[c]._sounds[p]._paused)return s}return s._suspendTimer&&clearTimeout(s._suspendTimer),s._suspendTimer=setTimeout(function(){if(s.autoSuspend){s._suspendTimer=null,s.state="suspending";var y=function(){s.state="suspended",s._resumeAfterSuspend&&(delete s._resumeAfterSuspend,s._autoResume())};s.ctx.suspend().then(y,y)}},3e4),s}},_autoResume:function(){var s=this;if(!(!s.ctx||typeof s.ctx.resume>"u"||!n.usingWebAudio))return s.state==="running"&&s.ctx.state!=="interrupted"&&s._suspendTimer?(clearTimeout(s._suspendTimer),s._suspendTimer=null):s.state==="suspended"||s.state==="running"&&s.ctx.state==="interrupted"?(s.ctx.resume().then(function(){s.state="running";for(var c=0;c<s._howls.length;c++)s._howls[c]._emit("resume")}),s._suspendTimer&&(clearTimeout(s._suspendTimer),s._suspendTimer=null)):s.state==="suspending"&&(s._resumeAfterSuspend=!0),s}};var n=new r,e=function(s){var c=this;if(!s.src||s.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}c.init(s)};e.prototype={init:function(s){var c=this;return n.ctx||f(),c._autoplay=s.autoplay||!1,c._format=typeof s.format!="string"?s.format:[s.format],c._html5=s.html5||!1,c._muted=s.mute||!1,c._loop=s.loop||!1,c._pool=s.pool||5,c._preload=typeof s.preload=="boolean"||s.preload==="metadata"?s.preload:!0,c._rate=s.rate||1,c._sprite=s.sprite||{},c._src=typeof s.src!="string"?s.src:[s.src],c._volume=s.volume!==void 0?s.volume:1,c._xhr={method:s.xhr&&s.xhr.method?s.xhr.method:"GET",headers:s.xhr&&s.xhr.headers?s.xhr.headers:null,withCredentials:s.xhr&&s.xhr.withCredentials?s.xhr.withCredentials:!1},c._duration=0,c._state="unloaded",c._sounds=[],c._endTimers={},c._queue=[],c._playLock=!1,c._onend=s.onend?[{fn:s.onend}]:[],c._onfade=s.onfade?[{fn:s.onfade}]:[],c._onload=s.onload?[{fn:s.onload}]:[],c._onloaderror=s.onloaderror?[{fn:s.onloaderror}]:[],c._onplayerror=s.onplayerror?[{fn:s.onplayerror}]:[],c._onpause=s.onpause?[{fn:s.onpause}]:[],c._onplay=s.onplay?[{fn:s.onplay}]:[],c._onstop=s.onstop?[{fn:s.onstop}]:[],c._onmute=s.onmute?[{fn:s.onmute}]:[],c._onvolume=s.onvolume?[{fn:s.onvolume}]:[],c._onrate=s.onrate?[{fn:s.onrate}]:[],c._onseek=s.onseek?[{fn:s.onseek}]:[],c._onunlock=s.onunlock?[{fn:s.onunlock}]:[],c._onresume=[],c._webAudio=n.usingWebAudio&&!c._html5,typeof n.ctx<"u"&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(c),c._autoplay&&c._queue.push({event:"play",action:function(){c.play()}}),c._preload&&c._preload!=="none"&&c.load(),c},load:function(){var s=this,c=null;if(n.noAudio){s._emit("loaderror",null,"No audio support.");return}typeof s._src=="string"&&(s._src=[s._src]);for(var p=0;p<s._src.length;p++){var y,k;if(s._format&&s._format[p])y=s._format[p];else{if(k=s._src[p],typeof k!="string"){s._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}y=/^data:audio\/([^;,]+);/i.exec(k),y||(y=/\.([^.]+)$/.exec(k.split("?",1)[0])),y&&(y=y[1].toLowerCase())}if(y||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),y&&n.codecs(y)){c=s._src[p];break}}if(!c){s._emit("loaderror",null,"No codec support for selected audio sources.");return}return s._src=c,s._state="loading",window.location.protocol==="https:"&&c.slice(0,5)==="http:"&&(s._html5=!0,s._webAudio=!1),new t(s),s._webAudio&&o(s),s},play:function(s,c){var p=this,y=null;if(typeof s=="number")y=s,s=null;else{if(typeof s=="string"&&p._state==="loaded"&&!p._sprite[s])return null;if(typeof s>"u"&&(s="__default",!p._playLock)){for(var k=0,x=0;x<p._sounds.length;x++)p._sounds[x]._paused&&!p._sounds[x]._ended&&(k++,y=p._sounds[x]._id);k===1?s=null:y=null}}var A=y?p._soundById(y):p._inactiveSound();if(!A)return null;if(y&&!s&&(s=A._sprite||"__default"),p._state!=="loaded"){A._sprite=s,A._ended=!1;var z=A._id;return p._queue.push({event:"play",action:function(){p.play(z)}}),z}if(y&&!A._paused)return c||p._loadQueue("play"),A._id;p._webAudio&&n._autoResume();var Y=Math.max(0,A._seek>0?A._seek:p._sprite[s][0]/1e3),re=Math.max(0,(p._sprite[s][0]+p._sprite[s][1])/1e3-Y),_e=re*1e3/Math.abs(A._rate),Le=p._sprite[s][0]/1e3,Ye=(p._sprite[s][0]+p._sprite[s][1])/1e3;A._sprite=s,A._ended=!1;var $e=function(){A._paused=!1,A._seek=Y,A._start=Le,A._stop=Ye,A._loop=!!(A._loop||p._sprite[s][2])};if(Y>=Ye){p._ended(A);return}var he=A._node;if(p._webAudio){var mt=function(){p._playLock=!1,$e(),p._refreshBuffer(A);var ft=A._muted||p._muted?0:A._volume;he.gain.setValueAtTime(ft,n.ctx.currentTime),A._playStart=n.ctx.currentTime,typeof he.bufferSource.start>"u"?A._loop?he.bufferSource.noteGrainOn(0,Y,86400):he.bufferSource.noteGrainOn(0,Y,re):A._loop?he.bufferSource.start(0,Y,86400):he.bufferSource.start(0,Y,re),_e!==1/0&&(p._endTimers[A._id]=setTimeout(p._ended.bind(p,A),_e)),c||setTimeout(function(){p._emit("play",A._id),p._loadQueue()},0)};n.state==="running"&&n.ctx.state!=="interrupted"?mt():(p._playLock=!0,p.once("resume",mt),p._clearTimer(A._id))}else{var ct=function(){he.currentTime=Y,he.muted=A._muted||p._muted||n._muted||he.muted,he.volume=A._volume*n.volume(),he.playbackRate=A._rate;try{var ft=he.play();if(ft&&typeof Promise<"u"&&(ft instanceof Promise||typeof ft.then=="function")?(p._playLock=!0,$e(),ft.then(function(){p._playLock=!1,he._unlocked=!0,c?p._loadQueue():p._emit("play",A._id)}).catch(function(){p._playLock=!1,p._emit("playerror",A._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),A._ended=!0,A._paused=!0})):c||(p._playLock=!1,$e(),p._emit("play",A._id)),he.playbackRate=A._rate,he.paused){p._emit("playerror",A._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}s!=="__default"||A._loop?p._endTimers[A._id]=setTimeout(p._ended.bind(p,A),_e):(p._endTimers[A._id]=function(){p._ended(A),he.removeEventListener("ended",p._endTimers[A._id],!1)},he.addEventListener("ended",p._endTimers[A._id],!1))}catch(xi){p._emit("playerror",A._id,xi)}};he.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(he.src=p._src,he.load());var qt=window&&window.ejecta||!he.readyState&&n._navigator.isCocoonJS;if(he.readyState>=3||qt)ct();else{p._playLock=!0,p._state="loading";var pt=function(){p._state="loaded",ct(),he.removeEventListener(n._canPlayEvent,pt,!1)};he.addEventListener(n._canPlayEvent,pt,!1),p._clearTimer(A._id)}}return A._id},pause:function(s){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"pause",action:function(){c.pause(s)}}),c;for(var p=c._getSoundIds(s),y=0;y<p.length;y++){c._clearTimer(p[y]);var k=c._soundById(p[y]);if(k&&!k._paused&&(k._seek=c.seek(p[y]),k._rateSeek=0,k._paused=!0,c._stopFade(p[y]),k._node))if(c._webAudio){if(!k._node.bufferSource)continue;typeof k._node.bufferSource.stop>"u"?k._node.bufferSource.noteOff(0):k._node.bufferSource.stop(0),c._cleanBuffer(k._node)}else(!isNaN(k._node.duration)||k._node.duration===1/0)&&k._node.pause();arguments[1]||c._emit("pause",k?k._id:null)}return c},stop:function(s,c){var p=this;if(p._state!=="loaded"||p._playLock)return p._queue.push({event:"stop",action:function(){p.stop(s)}}),p;for(var y=p._getSoundIds(s),k=0;k<y.length;k++){p._clearTimer(y[k]);var x=p._soundById(y[k]);x&&(x._seek=x._start||0,x._rateSeek=0,x._paused=!0,x._ended=!0,p._stopFade(y[k]),x._node&&(p._webAudio?x._node.bufferSource&&(typeof x._node.bufferSource.stop>"u"?x._node.bufferSource.noteOff(0):x._node.bufferSource.stop(0),p._cleanBuffer(x._node)):(!isNaN(x._node.duration)||x._node.duration===1/0)&&(x._node.currentTime=x._start||0,x._node.pause(),x._node.duration===1/0&&p._clearSound(x._node))),c||p._emit("stop",x._id))}return p},mute:function(s,c){var p=this;if(p._state!=="loaded"||p._playLock)return p._queue.push({event:"mute",action:function(){p.mute(s,c)}}),p;if(typeof c>"u")if(typeof s=="boolean")p._muted=s;else return p._muted;for(var y=p._getSoundIds(c),k=0;k<y.length;k++){var x=p._soundById(y[k]);x&&(x._muted=s,x._interval&&p._stopFade(x._id),p._webAudio&&x._node?x._node.gain.setValueAtTime(s?0:x._volume,n.ctx.currentTime):x._node&&(x._node.muted=n._muted?!0:s),p._emit("mute",x._id))}return p},volume:function(){var s=this,c=arguments,p,y;if(c.length===0)return s._volume;if(c.length===1||c.length===2&&typeof c[1]>"u"){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):p=parseFloat(c[0])}else c.length>=2&&(p=parseFloat(c[0]),y=parseInt(c[1],10));var A;if(typeof p<"u"&&p>=0&&p<=1){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"volume",action:function(){s.volume.apply(s,c)}}),s;typeof y>"u"&&(s._volume=p),y=s._getSoundIds(y);for(var z=0;z<y.length;z++)A=s._soundById(y[z]),A&&(A._volume=p,c[2]||s._stopFade(y[z]),s._webAudio&&A._node&&!A._muted?A._node.gain.setValueAtTime(p,n.ctx.currentTime):A._node&&!A._muted&&(A._node.volume=p*n.volume()),s._emit("volume",A._id))}else return A=y?s._soundById(y):s._sounds[0],A?A._volume:0;return s},fade:function(s,c,p,y){var k=this;if(k._state!=="loaded"||k._playLock)return k._queue.push({event:"fade",action:function(){k.fade(s,c,p,y)}}),k;s=Math.min(Math.max(0,parseFloat(s)),1),c=Math.min(Math.max(0,parseFloat(c)),1),p=parseFloat(p),k.volume(s,y);for(var x=k._getSoundIds(y),A=0;A<x.length;A++){var z=k._soundById(x[A]);if(z){if(y||k._stopFade(x[A]),k._webAudio&&!z._muted){var Y=n.ctx.currentTime,re=Y+p/1e3;z._volume=s,z._node.gain.setValueAtTime(s,Y),z._node.gain.linearRampToValueAtTime(c,re)}k._startFadeInterval(z,s,c,p,x[A],typeof y>"u")}}return k},_startFadeInterval:function(s,c,p,y,k,x){var A=this,z=c,Y=p-c,re=Math.abs(Y/.01),_e=Math.max(4,re>0?y/re:y),Le=Date.now();s._fadeTo=p,s._interval=setInterval(function(){var Ye=(Date.now()-Le)/y;Le=Date.now(),z+=Y*Ye,z=Math.round(z*100)/100,Y<0?z=Math.max(p,z):z=Math.min(p,z),A._webAudio?s._volume=z:A.volume(z,s._id,!0),x&&(A._volume=z),(p<c&&z<=p||p>c&&z>=p)&&(clearInterval(s._interval),s._interval=null,s._fadeTo=null,A.volume(p,s._id),A._emit("fade",s._id))},_e)},_stopFade:function(s){var c=this,p=c._soundById(s);return p&&p._interval&&(c._webAudio&&p._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(p._interval),p._interval=null,c.volume(p._fadeTo,s),p._fadeTo=null,c._emit("fade",s)),c},loop:function(){var s=this,c=arguments,p,y,k;if(c.length===0)return s._loop;if(c.length===1)if(typeof c[0]=="boolean")p=c[0],s._loop=p;else return k=s._soundById(parseInt(c[0],10)),k?k._loop:!1;else c.length===2&&(p=c[0],y=parseInt(c[1],10));for(var x=s._getSoundIds(y),A=0;A<x.length;A++)k=s._soundById(x[A]),k&&(k._loop=p,s._webAudio&&k._node&&k._node.bufferSource&&(k._node.bufferSource.loop=p,p&&(k._node.bufferSource.loopStart=k._start||0,k._node.bufferSource.loopEnd=k._stop,s.playing(x[A])&&(s.pause(x[A],!0),s.play(x[A],!0)))));return s},rate:function(){var s=this,c=arguments,p,y;if(c.length===0)y=s._sounds[0]._id;else if(c.length===1){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):p=parseFloat(c[0])}else c.length===2&&(p=parseFloat(c[0]),y=parseInt(c[1],10));var A;if(typeof p=="number"){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"rate",action:function(){s.rate.apply(s,c)}}),s;typeof y>"u"&&(s._rate=p),y=s._getSoundIds(y);for(var z=0;z<y.length;z++)if(A=s._soundById(y[z]),A){s.playing(y[z])&&(A._rateSeek=s.seek(y[z]),A._playStart=s._webAudio?n.ctx.currentTime:A._playStart),A._rate=p,s._webAudio&&A._node&&A._node.bufferSource?A._node.bufferSource.playbackRate.setValueAtTime(p,n.ctx.currentTime):A._node&&(A._node.playbackRate=p);var Y=s.seek(y[z]),re=(s._sprite[A._sprite][0]+s._sprite[A._sprite][1])/1e3-Y,_e=re*1e3/Math.abs(A._rate);(s._endTimers[y[z]]||!A._paused)&&(s._clearTimer(y[z]),s._endTimers[y[z]]=setTimeout(s._ended.bind(s,A),_e)),s._emit("rate",A._id)}}else return A=s._soundById(y),A?A._rate:s._rate;return s},seek:function(){var s=this,c=arguments,p,y;if(c.length===0)s._sounds.length&&(y=s._sounds[0]._id);else if(c.length===1){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):s._sounds.length&&(y=s._sounds[0]._id,p=parseFloat(c[0]))}else c.length===2&&(p=parseFloat(c[0]),y=parseInt(c[1],10));if(typeof y>"u")return 0;if(typeof p=="number"&&(s._state!=="loaded"||s._playLock))return s._queue.push({event:"seek",action:function(){s.seek.apply(s,c)}}),s;var A=s._soundById(y);if(A)if(typeof p=="number"&&p>=0){var z=s.playing(y);z&&s.pause(y,!0),A._seek=p,A._ended=!1,s._clearTimer(y),!s._webAudio&&A._node&&!isNaN(A._node.duration)&&(A._node.currentTime=p);var Y=function(){z&&s.play(y,!0),s._emit("seek",y)};if(z&&!s._webAudio){var re=function(){s._playLock?setTimeout(re,0):Y()};setTimeout(re,0)}else Y()}else if(s._webAudio){var _e=s.playing(y)?n.ctx.currentTime-A._playStart:0,Le=A._rateSeek?A._rateSeek-A._seek:0;return A._seek+(Le+_e*Math.abs(A._rate))}else return A._node.currentTime;return s},playing:function(s){var c=this;if(typeof s=="number"){var p=c._soundById(s);return p?!p._paused:!1}for(var y=0;y<c._sounds.length;y++)if(!c._sounds[y]._paused)return!0;return!1},duration:function(s){var c=this,p=c._duration,y=c._soundById(s);return y&&(p=c._sprite[y._sprite][1]/1e3),p},state:function(){return this._state},unload:function(){for(var s=this,c=s._sounds,p=0;p<c.length;p++)c[p]._paused||s.stop(c[p]._id),s._webAudio||(s._clearSound(c[p]._node),c[p]._node.removeEventListener("error",c[p]._errorFn,!1),c[p]._node.removeEventListener(n._canPlayEvent,c[p]._loadFn,!1),c[p]._node.removeEventListener("ended",c[p]._endFn,!1),n._releaseHtml5Audio(c[p]._node)),delete c[p]._node,s._clearTimer(c[p]._id);var y=n._howls.indexOf(s);y>=0&&n._howls.splice(y,1);var k=!0;for(p=0;p<n._howls.length;p++)if(n._howls[p]._src===s._src||s._src.indexOf(n._howls[p]._src)>=0){k=!1;break}return i&&k&&delete i[s._src],n.noAudio=!1,s._state="unloaded",s._sounds=[],s=null,null},on:function(s,c,p,y){var k=this,x=k["_on"+s];return typeof c=="function"&&x.push(y?{id:p,fn:c,once:y}:{id:p,fn:c}),k},off:function(s,c,p){var y=this,k=y["_on"+s],x=0;if(typeof c=="number"&&(p=c,c=null),c||p)for(x=0;x<k.length;x++){var A=p===k[x].id;if(c===k[x].fn&&A||!c&&A){k.splice(x,1);break}}else if(s)y["_on"+s]=[];else{var z=Object.keys(y);for(x=0;x<z.length;x++)z[x].indexOf("_on")===0&&Array.isArray(y[z[x]])&&(y[z[x]]=[])}return y},once:function(s,c,p){var y=this;return y.on(s,c,p,1),y},_emit:function(s,c,p){for(var y=this,k=y["_on"+s],x=k.length-1;x>=0;x--)(!k[x].id||k[x].id===c||s==="load")&&(setTimeout(function(A){A.call(this,c,p)}.bind(y,k[x].fn),0),k[x].once&&y.off(s,k[x].fn,k[x].id));return y._loadQueue(s),y},_loadQueue:function(s){var c=this;if(c._queue.length>0){var p=c._queue[0];p.event===s&&(c._queue.shift(),c._loadQueue()),s||p.action()}return c},_ended:function(s){var c=this,p=s._sprite;if(!c._webAudio&&s._node&&!s._node.paused&&!s._node.ended&&s._node.currentTime<s._stop)return setTimeout(c._ended.bind(c,s),100),c;var y=!!(s._loop||c._sprite[p][2]);if(c._emit("end",s._id),!c._webAudio&&y&&c.stop(s._id,!0).play(s._id),c._webAudio&&y){c._emit("play",s._id),s._seek=s._start||0,s._rateSeek=0,s._playStart=n.ctx.currentTime;var k=(s._stop-s._start)*1e3/Math.abs(s._rate);c._endTimers[s._id]=setTimeout(c._ended.bind(c,s),k)}return c._webAudio&&!y&&(s._paused=!0,s._ended=!0,s._seek=s._start||0,s._rateSeek=0,c._clearTimer(s._id),c._cleanBuffer(s._node),n._autoSuspend()),!c._webAudio&&!y&&c.stop(s._id,!0),c},_clearTimer:function(s){var c=this;if(c._endTimers[s]){if(typeof c._endTimers[s]!="function")clearTimeout(c._endTimers[s]);else{var p=c._soundById(s);p&&p._node&&p._node.removeEventListener("ended",c._endTimers[s],!1)}delete c._endTimers[s]}return c},_soundById:function(s){for(var c=this,p=0;p<c._sounds.length;p++)if(s===c._sounds[p]._id)return c._sounds[p];return null},_inactiveSound:function(){var s=this;s._drain();for(var c=0;c<s._sounds.length;c++)if(s._sounds[c]._ended)return s._sounds[c].reset();return new t(s)},_drain:function(){var s=this,c=s._pool,p=0,y=0;if(!(s._sounds.length<c)){for(y=0;y<s._sounds.length;y++)s._sounds[y]._ended&&p++;for(y=s._sounds.length-1;y>=0;y--){if(p<=c)return;s._sounds[y]._ended&&(s._webAudio&&s._sounds[y]._node&&s._sounds[y]._node.disconnect(0),s._sounds.splice(y,1),p--)}}},_getSoundIds:function(s){var c=this;if(typeof s>"u"){for(var p=[],y=0;y<c._sounds.length;y++)p.push(c._sounds[y]._id);return p}else return[s]},_refreshBuffer:function(s){var c=this;return s._node.bufferSource=n.ctx.createBufferSource(),s._node.bufferSource.buffer=i[c._src],s._panner?s._node.bufferSource.connect(s._panner):s._node.bufferSource.connect(s._node),s._node.bufferSource.loop=s._loop,s._loop&&(s._node.bufferSource.loopStart=s._start||0,s._node.bufferSource.loopEnd=s._stop||0),s._node.bufferSource.playbackRate.setValueAtTime(s._rate,n.ctx.currentTime),c},_cleanBuffer:function(s){var c=this,p=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(!s.bufferSource)return c;if(n._scratchBuffer&&s.bufferSource&&(s.bufferSource.onended=null,s.bufferSource.disconnect(0),p))try{s.bufferSource.buffer=n._scratchBuffer}catch{}return s.bufferSource=null,c},_clearSound:function(s){var c=/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent);c||(s.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(s){this._parent=s,this.init()};t.prototype={init:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,c._sounds.push(s),s.create(),s},create:function(){var s=this,c=s._parent,p=n._muted||s._muted||s._parent._muted?0:s._volume;return c._webAudio?(s._node=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),s._node.gain.setValueAtTime(p,n.ctx.currentTime),s._node.paused=!0,s._node.connect(n.masterGain)):n.noAudio||(s._node=n._obtainHtml5Audio(),s._errorFn=s._errorListener.bind(s),s._node.addEventListener("error",s._errorFn,!1),s._loadFn=s._loadListener.bind(s),s._node.addEventListener(n._canPlayEvent,s._loadFn,!1),s._endFn=s._endListener.bind(s),s._node.addEventListener("ended",s._endFn,!1),s._node.src=c._src,s._node.preload=c._preload===!0?"auto":c._preload,s._node.volume=p*n.volume(),s._node.load()),s},reset:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._rateSeek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,s},_errorListener:function(){var s=this;s._parent._emit("loaderror",s._id,s._node.error?s._node.error.code:0),s._node.removeEventListener("error",s._errorFn,!1)},_loadListener:function(){var s=this,c=s._parent;c._duration=Math.ceil(s._node.duration*10)/10,Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue()),s._node.removeEventListener(n._canPlayEvent,s._loadFn,!1)},_endListener:function(){var s=this,c=s._parent;c._duration===1/0&&(c._duration=Math.ceil(s._node.duration*10)/10,c._sprite.__default[1]===1/0&&(c._sprite.__default[1]=c._duration*1e3),c._ended(s)),s._node.removeEventListener("ended",s._endFn,!1)}};var i={},o=function(s){var c=s._src;if(i[c]){s._duration=i[c].duration,d(s);return}if(/^data:[^;]+;base64,/.test(c)){for(var p=atob(c.split(",")[1]),y=new Uint8Array(p.length),k=0;k<p.length;++k)y[k]=p.charCodeAt(k);l(y.buffer,s)}else{var x=new XMLHttpRequest;x.open(s._xhr.method,c,!0),x.withCredentials=s._xhr.withCredentials,x.responseType="arraybuffer",s._xhr.headers&&Object.keys(s._xhr.headers).forEach(function(A){x.setRequestHeader(A,s._xhr.headers[A])}),x.onload=function(){var A=(x.status+"")[0];if(A!=="0"&&A!=="2"&&A!=="3"){s._emit("loaderror",null,"Failed loading audio file with status: "+x.status+".");return}l(x.response,s)},x.onerror=function(){s._webAudio&&(s._html5=!0,s._webAudio=!1,s._sounds=[],delete i[c],s.load())},a(x)}},a=function(s){try{s.send()}catch{s.onerror()}},l=function(s,c){var p=function(){c._emit("loaderror",null,"Decoding audio data failed.")},y=function(k){k&&c._sounds.length>0?(i[c._src]=k,d(c,k)):p()};typeof Promise<"u"&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(s).then(y).catch(p):n.ctx.decodeAudioData(s,y,p)},d=function(s,c){c&&!s._duration&&(s._duration=c.duration),Object.keys(s._sprite).length===0&&(s._sprite={__default:[0,s._duration*1e3]}),s._state!=="loaded"&&(s._state="loaded",s._emit("load"),s._loadQueue())},f=function(){if(n.usingWebAudio){try{typeof AudioContext<"u"?n.ctx=new AudioContext:typeof webkitAudioContext<"u"?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var s=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),c=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),p=c?parseInt(c[1],10):null;if(s&&p&&p<9){var y=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!y&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:n,Howl:e}}),typeof Ao<"u"&&(Ao.Howler=n,Ao.Howl=e),typeof global<"u"?(global.HowlerGlobal=r,global.Howler=n,global.Howl=e,global.Sound=t):typeof window<"u"&&(window.HowlerGlobal=r,window.Howler=n,window.Howl=e,window.Sound=t)})();(function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(n){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var t=e._howls.length-1;t>=0;t--)e._howls[t].stereo(n);return e},HowlerGlobal.prototype.pos=function(n,e,t){var i=this;if(!i.ctx||!i.ctx.listener)return i;if(e=typeof e!="number"?i._pos[1]:e,t=typeof t!="number"?i._pos[2]:t,typeof n=="number")i._pos=[n,e,t],typeof i.ctx.listener.positionX<"u"?(i.ctx.listener.positionX.setTargetAtTime(i._pos[0],Howler.ctx.currentTime,.1),i.ctx.listener.positionY.setTargetAtTime(i._pos[1],Howler.ctx.currentTime,.1),i.ctx.listener.positionZ.setTargetAtTime(i._pos[2],Howler.ctx.currentTime,.1)):i.ctx.listener.setPosition(i._pos[0],i._pos[1],i._pos[2]);else return i._pos;return i},HowlerGlobal.prototype.orientation=function(n,e,t,i,o,a){var l=this;if(!l.ctx||!l.ctx.listener)return l;var d=l._orientation;if(e=typeof e!="number"?d[1]:e,t=typeof t!="number"?d[2]:t,i=typeof i!="number"?d[3]:i,o=typeof o!="number"?d[4]:o,a=typeof a!="number"?d[5]:a,typeof n=="number")l._orientation=[n,e,t,i,o,a],typeof l.ctx.listener.forwardX<"u"?(l.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),l.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),l.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),l.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),l.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),l.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):l.ctx.listener.setOrientation(n,e,t,i,o,a);else return d;return l},Howl.prototype.init=function(n){return function(e){var t=this;return t._orientation=e.orientation||[1,0,0],t._stereo=e.stereo||null,t._pos=e.pos||null,t._pannerAttr={coneInnerAngle:typeof e.coneInnerAngle<"u"?e.coneInnerAngle:360,coneOuterAngle:typeof e.coneOuterAngle<"u"?e.coneOuterAngle:360,coneOuterGain:typeof e.coneOuterGain<"u"?e.coneOuterGain:0,distanceModel:typeof e.distanceModel<"u"?e.distanceModel:"inverse",maxDistance:typeof e.maxDistance<"u"?e.maxDistance:1e4,panningModel:typeof e.panningModel<"u"?e.panningModel:"HRTF",refDistance:typeof e.refDistance<"u"?e.refDistance:1,rolloffFactor:typeof e.rolloffFactor<"u"?e.rolloffFactor:1},t._onstereo=e.onstereo?[{fn:e.onstereo}]:[],t._onpos=e.onpos?[{fn:e.onpos}]:[],t._onorientation=e.onorientation?[{fn:e.onorientation}]:[],n.call(this,e)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,e){var t=this;if(!t._webAudio)return t;if(t._state!=="loaded")return t._queue.push({event:"stereo",action:function(){t.stereo(n,e)}}),t;var i=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof e>"u")if(typeof n=="number")t._stereo=n,t._pos=[n,0,0];else return t._stereo;for(var o=t._getSoundIds(e),a=0;a<o.length;a++){var l=t._soundById(o[a]);if(l)if(typeof n=="number")l._stereo=n,l._pos=[n,0,0],l._node&&(l._pannerAttr.panningModel="equalpower",(!l._panner||!l._panner.pan)&&r(l,i),i==="spatial"?typeof l._panner.positionX<"u"?(l._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),l._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),l._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):l._panner.setPosition(n,0,0):l._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),t._emit("stereo",l._id);else return l._stereo}return t},Howl.prototype.pos=function(n,e,t,i){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"pos",action:function(){o.pos(n,e,t,i)}}),o;if(e=typeof e!="number"?0:e,t=typeof t!="number"?-.5:t,typeof i>"u")if(typeof n=="number")o._pos=[n,e,t];else return o._pos;for(var a=o._getSoundIds(i),l=0;l<a.length;l++){var d=o._soundById(a[l]);if(d)if(typeof n=="number")d._pos=[n,e,t],d._node&&((!d._panner||d._panner.pan)&&r(d,"spatial"),typeof d._panner.positionX<"u"?(d._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(t,Howler.ctx.currentTime)):d._panner.setPosition(n,e,t)),o._emit("pos",d._id);else return d._pos}return o},Howl.prototype.orientation=function(n,e,t,i){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"orientation",action:function(){o.orientation(n,e,t,i)}}),o;if(e=typeof e!="number"?o._orientation[1]:e,t=typeof t!="number"?o._orientation[2]:t,typeof i>"u")if(typeof n=="number")o._orientation=[n,e,t];else return o._orientation;for(var a=o._getSoundIds(i),l=0;l<a.length;l++){var d=o._soundById(a[l]);if(d)if(typeof n=="number")d._orientation=[n,e,t],d._node&&(d._panner||(d._pos||(d._pos=o._pos||[0,0,-.5]),r(d,"spatial")),typeof d._panner.orientationX<"u"?(d._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),d._panner.orientationY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.orientationZ.setValueAtTime(t,Howler.ctx.currentTime)):d._panner.setOrientation(n,e,t)),o._emit("orientation",d._id);else return d._orientation}return o},Howl.prototype.pannerAttr=function(){var n=this,e=arguments,t,i,o;if(!n._webAudio)return n;if(e.length===0)return n._pannerAttr;if(e.length===1)if(typeof e[0]=="object")t=e[0],typeof i>"u"&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),n._pannerAttr={coneInnerAngle:typeof t.pannerAttr.coneInnerAngle<"u"?t.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:typeof t.pannerAttr.coneOuterAngle<"u"?t.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:typeof t.pannerAttr.coneOuterGain<"u"?t.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:typeof t.pannerAttr.distanceModel<"u"?t.pannerAttr.distanceModel:n._distanceModel,maxDistance:typeof t.pannerAttr.maxDistance<"u"?t.pannerAttr.maxDistance:n._maxDistance,refDistance:typeof t.pannerAttr.refDistance<"u"?t.pannerAttr.refDistance:n._refDistance,rolloffFactor:typeof t.pannerAttr.rolloffFactor<"u"?t.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:typeof t.pannerAttr.panningModel<"u"?t.pannerAttr.panningModel:n._panningModel});else return o=n._soundById(parseInt(e[0],10)),o?o._pannerAttr:n._pannerAttr;else e.length===2&&(t=e[0],i=parseInt(e[1],10));for(var a=n._getSoundIds(i),l=0;l<a.length;l++)if(o=n._soundById(a[l]),o){var d=o._pannerAttr;d={coneInnerAngle:typeof t.coneInnerAngle<"u"?t.coneInnerAngle:d.coneInnerAngle,coneOuterAngle:typeof t.coneOuterAngle<"u"?t.coneOuterAngle:d.coneOuterAngle,coneOuterGain:typeof t.coneOuterGain<"u"?t.coneOuterGain:d.coneOuterGain,distanceModel:typeof t.distanceModel<"u"?t.distanceModel:d.distanceModel,maxDistance:typeof t.maxDistance<"u"?t.maxDistance:d.maxDistance,refDistance:typeof t.refDistance<"u"?t.refDistance:d.refDistance,rolloffFactor:typeof t.rolloffFactor<"u"?t.rolloffFactor:d.rolloffFactor,panningModel:typeof t.panningModel<"u"?t.panningModel:d.panningModel};var f=o._panner;f||(o._pos||(o._pos=n._pos||[0,0,-.5]),r(o,"spatial"),f=o._panner),f.coneInnerAngle=d.coneInnerAngle,f.coneOuterAngle=d.coneOuterAngle,f.coneOuterGain=d.coneOuterGain,f.distanceModel=d.distanceModel,f.maxDistance=d.maxDistance,f.refDistance=d.refDistance,f.rolloffFactor=d.rolloffFactor,f.panningModel=d.panningModel}return n},Sound.prototype.init=function(n){return function(){var e=this,t=e._parent;e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,n.call(this),e._stereo?t.stereo(e._stereo):e._pos&&t.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}}(Sound.prototype.init),Sound.prototype.reset=function(n){return function(){var e=this,t=e._parent;return e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,e._stereo?t.stereo(e._stereo):e._pos?t.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,t._refreshBuffer(e)),n.call(this)}}(Sound.prototype.reset);var r=function(n,e){e=e||"spatial",e==="spatial"?(n._panner=Howler.ctx.createPanner(),n._panner.coneInnerAngle=n._pannerAttr.coneInnerAngle,n._panner.coneOuterAngle=n._pannerAttr.coneOuterAngle,n._panner.coneOuterGain=n._pannerAttr.coneOuterGain,n._panner.distanceModel=n._pannerAttr.distanceModel,n._panner.maxDistance=n._pannerAttr.maxDistance,n._panner.refDistance=n._pannerAttr.refDistance,n._panner.rolloffFactor=n._pannerAttr.rolloffFactor,n._panner.panningModel=n._pannerAttr.panningModel,typeof n._panner.positionX<"u"?(n._panner.positionX.setValueAtTime(n._pos[0],Howler.ctx.currentTime),n._panner.positionY.setValueAtTime(n._pos[1],Howler.ctx.currentTime),n._panner.positionZ.setValueAtTime(n._pos[2],Howler.ctx.currentTime)):n._panner.setPosition(n._pos[0],n._pos[1],n._pos[2]),typeof n._panner.orientationX<"u"?(n._panner.orientationX.setValueAtTime(n._orientation[0],Howler.ctx.currentTime),n._panner.orientationY.setValueAtTime(n._orientation[1],Howler.ctx.currentTime),n._panner.orientationZ.setValueAtTime(n._orientation[2],Howler.ctx.currentTime)):n._panner.setOrientation(n._orientation[0],n._orientation[1],n._orientation[2])):(n._panner=Howler.ctx.createStereoPanner(),n._panner.pan.setValueAtTime(n._stereo,Howler.ctx.currentTime)),n._panner.connect(n._node),n._paused||n._parent.pause(n._id,!0).play(n._id,!0)}})()});var us=ka((s2,Bo)=>{(function(r){"use strict";function n(u){if(Array.isArray(u)){for(var h=0,m=Array(u.length);h<u.length;h++)m[h]=u[h];return m}return Array.from(u)}function e(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?u:h}function t(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}function i(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function o(u,h){if(h||(h=typeof window>"u"?global:window),h[u]!==void 0)return h[u];if(Ti===null){var m=window.getComputedStyle(document.documentElement,"");Ti=(Array.prototype.slice.call(m).join("").match(/-(moz|webkit|ms)-/)||m.OLink===""&&["","o"]||["",""])[1]}if(Ti==="")return null;var w=u.charAt(0).toUpperCase()+u.substr(1),C=h[Ti+w];return C!==void 0?C:null}function a(u,h,m,w,C,T,O){if(typeof w!="function")throw new TypeError("Invalid animation rule:",w);var N=u-m,R=N/C,W=0;R>1&&(R=1),R!==1&&(W=w(R),isFinite(W)&&!isNaN(W)&&(R=W)),h&&h(R),N<C?O.frame=Ur(function(U){return a(U,h,m,w,C,T,O)}):(T&&T(),O.inProgress=!1)}function l(){Array.prototype.constructor.apply(this,arguments)}function d(u){if(!(u instanceof DOMException&&u.result===2152923147))throw u}function f(u,h){return h.replace(va,function(m,w){var C=u[w];return C!==void 0?C:m})}function s(u){return u.majorTicks instanceof Array||(u.majorTicks=u.majorTicks?[u.majorTicks]:[]),u.majorTicks.length||(u.majorTicks.push(Z.formatMajorTickNumber(u.minValue,u)),u.majorTicks.push(Z.formatMajorTickNumber(u.maxValue,u))),[u.tickSide!=="right",u.tickSide!=="left"]}function c(u,h,m,w,C,T){u.beginPath(),u.moveTo(h+T,m),u.lineTo(h+w-T,m),u.quadraticCurveTo(h+w,m,h+w,m+T),u.lineTo(h+w,m+C-T),u.quadraticCurveTo(h+w,m+C,h+w-T,m+C),u.lineTo(h+T,m+C),u.quadraticCurveTo(h,m+C,h,m+C-T),u.lineTo(h,m+T),u.quadraticCurveTo(h,m,h+T,m),u.closePath()}function p(u,h){var m=h.valueDec,w=h.valueInt,C=0,T=void 0,O=void 0,N=void 0;if(u=parseFloat(u),N=u<0,u=Math.abs(u),m>0){for(O=u.toFixed(m).toString().split("."),T=w-O[0].length;C<T;++C)O[0]="0"+O[0];O=(N?"-":"")+O[0]+"."+O[1]}else{for(O=Math.round(u).toString(),T=w-O.length;C<T;++C)O="0"+O;O=(N?"-":"")+O}return O}function y(u,h){var m=void 0,w=!1;return m=h.majorTicksDec===0?Math.round(u).toString():u.toFixed(h.majorTicksDec),h.majorTicksInt>1?(w=~m.indexOf("."),~m.indexOf("-")?"-"+[h.majorTicksInt+h.majorTicksDec+2+(w?1:0)-m.length].join("0")+m.replace("-",""):[h.majorTicksInt+h.majorTicksDec+1+(w?1:0)-m.length].join("0")+m):m}function k(u){return u*Math.PI/180}function x(u,h){return{x:-u*Math.sin(h),y:u*Math.cos(h)}}function A(u,h,m,w){var C=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,O=u.createLinearGradient(C?0:T,C?T:0,C?0:w,C?w:0);return O.addColorStop(0,h),O.addColorStop(1,m),O}function z(u,h){h.needleShadow&&(u.shadowOffsetX=2,u.shadowOffsetY=2,u.shadowBlur=10,u.shadowColor=h.colorNeedleShadowDown)}function Y(u,h,m){return u["font"+h+"Style"]+" "+u["font"+h+"Weight"]+" "+u["font"+h+"Size"]*m+"px "+u["font"+h]}function re(u){u.shadowOffsetX=null,u.shadowOffsetY=null,u.shadowBlur=null,u.shadowColor="",u.strokeStyle=null,u.lineWidth=0,u.save()}function _e(u,h,m,w){h.valueTextShadow&&(u.shadowOffsetX=m,u.shadowOffsetY=m,u.shadowBlur=w,u.shadowColor=h.colorValueTextShadow)}function Le(u,h,m,w,C,T){if(h.valueBox){re(u);var O=h.valueDec?1+h.valueDec:0,N="9".repeat(Math.max.apply(null,[String(parseInt(m)).length+O].concat(h.majorTicks.map(function(we){return String(parseInt(we,10)).length+O})))),R=h.valueText||p(m,h),W=T/200,U=T/100,q=.4*U,J=1.2*U;u.font=Y(h,"Value",W),_e(u,h,q,J);var le=u.measureText(h.valueText?R:"-"+p(Number(N),h)).width;re(u);var pe=parseFloat(h.fontValueSize)*W+q+J,Oe=U*parseFloat(h.valueBoxStroke),ge=2*T-2*Oe,Ne=le+10*U,We=1.1*pe+q+J,Be=U*h.valueBoxBorderRadius,ue=(parseFloat(h.valueBoxWidth)||0)/100*ge;ue>Ne&&(Ne=ue),Ne>ge&&(Ne=ge);var xe=w-Ne/2,ve=C-We/2,oe=C-5.75*U;if(u.beginPath(),Be?c(u,xe,ve,Ne,We,Be):u.rect(xe,ve,Ne,We),Oe){var ye=u.createRadialGradient(w,oe,10*U,w,oe,20*U);ye.addColorStop(0,h.colorValueBoxRect),ye.addColorStop(1,h.colorValueBoxRectEnd),u.strokeStyle=ye,u.lineWidth=Oe,u.stroke()}h.colorValueBoxShadow&&(u.shadowBlur=1.2*U,u.shadowColor=h.colorValueBoxShadow),h.colorValueBoxBackground&&(u.fillStyle=h.colorValueBoxBackground,u.fill()),u.closePath(),u.restore(),_e(u,h,q,J),u.fillStyle=h.colorValueText,u.textAlign="center",u.textBaseline="alphabetic",u.fillText(R,xe+Ne/2,C+We/2-pe/3),u.restore()}}function Ye(u){var h=u.value,m=u.minValue,w=u.maxValue,C=.01*(w-m);return{normal:h<m?m:h>w?w:h,indented:h<m?m-C:h>w?w+C:h}}function $e(u,h,m,w,C){m.beginPath(),m.arc(0,0,Ot(u),0,2*nn,!0),m.lineWidth=h,m.strokeStyle=C?Z.linearGradient(m,w,C,u):w,m.stroke(),m.closePath()}function he(u,h){var m=Ft.pixelRatio;return u.maxRadius||(u.maxRadius=u.max-h.borderShadowWidth-h.borderOuterWidth*m-h.borderMiddleWidth*m-h.borderInnerWidth*m+(h.borderOuterWidth?.5:0)+(h.borderMiddleWidth?.5:0)+(h.borderInnerWidth?.5:0)),u.maxRadius}function mt(u,h){function m(q,J,le,pe,Oe,ge){return J&&(!ge&&h.borderShadowWidth&&(le.save(),le.shadowBlur=h.borderShadowWidth,le.shadowColor=h.colorBorderShadow),$e(q,J*w,le,pe,Oe),!ge&&h.borderShadowWidth&&(ge=!0,le.restore())),ge}var w=Ft.pixelRatio,C=h.borderShadowWidth*w,T=u.max-C-h.borderOuterWidth*w/2,O=T-h.borderOuterWidth*w/2-h.borderMiddleWidth*w/2+.5,N=O-h.borderMiddleWidth*w/2-h.borderInnerWidth*w/2+.5,R=he(u,h),W=void 0,U=!1;u.save(),U=m(T,h.borderOuterWidth,u,h.colorBorderOuter,h.colorBorderOuterEnd,U),U=m(O,h.borderMiddleWidth,u,h.colorBorderMiddle,h.colorBorderMiddleEnd,U),U=m(N,h.borderInnerWidth,u,h.colorBorderInner,h.colorBorderInnerEnd,U),!U&&h.borderShadowWidth&&(u.shadowBlur=h.borderShadowWidth,u.shadowColor=h.colorBorderShadow),u.beginPath(),u.arc(0,0,Ot(R),0,2*nn,!0),h.colorPlateEnd?(W=u.createRadialGradient(0,0,R/2,0,0,R),W.addColorStop(0,h.colorPlate),W.addColorStop(1,h.colorPlateEnd)):W=h.colorPlate,u.fillStyle=W,u.fill(),u.closePath(),u.restore()}function ct(u,h){if(h.highlights!=="false"&&h.highlights.length&&h.highlightsWidth!==0){var m=u.max*(parseFloat(h.highlightsWidth)||0)/100,w=Ot(pt(u,h)-m/2),C=h.highlights.length,T=(h.maxValue-h.minValue)/h.ticksAngle;u.save();for(var O=0;O<C;O++){var N=h.highlights[O];u.lineWidth=m,u.lineCap=h.highlightsLineCap,u.strokeStyle=N.color,u.beginPath(),u.rotate(An),u.arc(0,0,w,Z.radians(h.startAngle+(N.from-h.minValue)/T),Z.radians(h.startAngle+(N.to-h.minValue)/T),!1),u.stroke(),u.closePath(),u.restore(),u.save()}u.restore()}}function qt(u,h){var m=pt(u,h),w=void 0,C=void 0,T=void 0,O=0,N=Math.abs(h.minorTicks)||0,R=h.ticksAngle/(h.maxValue-h.minValue);h.exactTicks?(C=h.maxValue-h.minValue,w=N?C/N:0,O=(It.mod(h.majorTicks[0],N)||0)*R):w=N*(h.majorTicks.length-1),u.lineWidth=Ft.pixelRatio,u.strokeStyle=h.colorMinorTicks||h.colorStrokeTicks,u.save();for(var W=0;W<w;++W)(T=h.startAngle+O+W*(h.ticksAngle/w))<=h.ticksAngle+h.startAngle&&(u.rotate(Z.radians(T)),u.beginPath(),u.moveTo(0,m),u.lineTo(0,m-.075*u.max),Cn(u));u.restore()}function pt(u,h){var m=u.max/100;return he(u,h)-5*m-(h.barWidth?2*(parseFloat(h.barStrokeWidth)||0)+((parseFloat(h.barWidth)||0)+5)*m:0)}function ft(u,h){Z.prepareTicks(h);var m=Ot(pt(u,h)),w=void 0,C=h.majorTicks.length,T=Ft.pixelRatio;u.lineWidth=2*T,w=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(C).fill(h.colorStrokeTicks||h.colorMajorTicks);for(var O=0;O<C;++O)u.save(),u.strokeStyle=w[O],u.rotate(Z.radians(xi(h,h.exactTicks?h.majorTicks[O]:O,C))),u.beginPath(),u.moveTo(0,m),u.lineTo(0,m-.15*u.max),u.stroke(),u.closePath(),u.restore();h.strokeTicks&&(u.save(),u.strokeStyle=h.colorStrokeTicks||w[0],u.rotate(An),u.beginPath(),u.arc(0,0,m,Z.radians(h.startAngle),Z.radians(h.startAngle+h.ticksAngle),!1),u.stroke(),u.closePath(),u.restore())}function xi(u,h,m){if(u.exactTicks){var w=u.ticksAngle/(u.maxValue-u.minValue);return u.startAngle+w*(h-u.minValue)}return u.startAngle+h*(u.ticksAngle/(m-1))}function Cn(u){u.stroke(),u.restore(),u.closePath(),u.save()}function X(u,h){var m=pt(u,h)-.15*u.max,w={},C=0,T=h.majorTicks.length,O=h.animationTarget!=="needle",N=h.colorNumbers instanceof Array?h.colorNumbers:new Array(T).fill(h.colorNumbers),R=O?-(h.value-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle:0;for(O&&(u.save(),u.rotate(-Z.radians(R))),u.font=Z.font(h,"Numbers",u.max/200),u.lineWidth=0,u.textAlign="center",u.textBaseline="middle";C<T;++C){var W=R+xi(h,h.exactTicks?h.majorTicks[C]:C,T),U=u.measureText(h.majorTicks[C]).width,q=h.fontNumbersSize,J=Math.sqrt(U*U+q*q)/2,le=Z.radialPoint(m-J-h.numbersMargin/100*u.max,Z.radians(W));W===360&&(W=0),w[W]||(w[W]=!0,u.fillStyle=N[C],u.fillText(h.majorTicks[C],le.x,le.y))}O&&u.restore()}function ie(u,h){h.title&&(u.save(),u.font=Z.font(h,"Title",u.max/200),u.fillStyle=h.colorTitle,u.textAlign="center",u.fillText(h.title,0,-u.max/4.25,.8*u.max),u.restore())}function ae(u,h){h.units&&(u.save(),u.font=Z.font(h,"Units",u.max/200),u.fillStyle=h.colorUnits,u.textAlign="center",u.fillText(Z.formatContext(h,h.units),0,u.max/3.25,.8*u.max),u.restore())}function Me(u,h){if(h.needle){var m=h.animationTarget!=="needle",w=h.ticksAngle<360?Z.normalizedValue(h).indented:h.value,C=m?h.startAngle:h.startAngle+(w-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle;h.barStartPosition==="right"&&(C=h.startAngle+h.ticksAngle-(w-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle);var T=he(u,h),O=Ot(T/100*h.needleCircleSize),N=Ot(T/100*h.needleCircleSize*.75),R=Ot(T/100*h.needleEnd),W=Ot(h.needleStart?T/100*h.needleStart:0),U=T/100*h.needleWidth,q=T/100*h.needleWidth/2,J=Ft.pixelRatio;u.save(),Z.drawNeedleShadow(u,h),u.rotate(Z.radians(C)),u.fillStyle=Z.linearGradient(u,h.colorNeedle,h.colorNeedleEnd,R-W),h.needleType==="arrow"?(u.beginPath(),u.moveTo(-q,-W),u.lineTo(-U,0),u.lineTo(-1*J,R),u.lineTo(J,R),u.lineTo(U,0),u.lineTo(q,-W),u.closePath(),u.fill(),u.beginPath(),u.lineTo(-.5*J,R),u.lineTo(-1*J,R),u.lineTo(-U,0),u.lineTo(-q,-W),u.lineTo(q/2*J-2*J,-W),u.closePath(),u.fillStyle=h.colorNeedleShadowUp,u.fill()):(u.beginPath(),u.moveTo(-q,R),u.lineTo(-q,W),u.lineTo(q,W),u.lineTo(q,R),u.closePath(),u.fill()),u.restore(),h.needleCircleSize&&(u.save(),Z.drawNeedleShadow(u,h),h.needleCircleOuter&&(u.beginPath(),u.arc(0,0,O,0,2*nn,!0),u.fillStyle=Z.linearGradient(u,h.colorNeedleCircleOuter,h.colorNeedleCircleOuterEnd,O),u.fill(),u.closePath()),h.needleCircleInner&&(u.beginPath(),u.arc(0,0,N,0,2*nn,!0),u.fillStyle=Z.linearGradient(u,h.colorNeedleCircleInner,h.colorNeedleCircleInnerEnd,N),u.fill(),u.closePath()),u.restore())}}function nt(u,h,m){Z.drawValueBox(u,h,m,0,u.max-.33*u.max,u.max)}function gt(u){var h=u.startAngle,m=u.startAngle+u.ticksAngle,w=h,C=h+(Z.normalizedValue(u).normal-u.minValue)/(u.maxValue-u.minValue)*u.ticksAngle;if(u.barStartPosition==="middle"){var T=.5*(u.minValue+u.maxValue);u.value<T?(w=180-(T-Z.normalizedValue(u).normal)/(u.maxValue-u.minValue)*u.ticksAngle,C=180):(w=180,C=180+(Z.normalizedValue(u).normal-T)/(u.maxValue-u.minValue)*u.ticksAngle)}else u.barStartPosition==="right"&&(w=m-C+h,C=m);return{startAngle:w,endAngle:C}}function vt(u,h){var m=u.max/100,w=he(u,h)-5*m,C=parseFloat(h.barStrokeWidth+"")||0,T=(parseFloat(h.barWidth+"")||0)*m,O=w-2*C-T,N=(w-O)/2,R=O+N,W=C/R,U=h.startAngle,q=h.startAngle+h.ticksAngle;if(u.save(),u.rotate(An),C&&(u.beginPath(),u.arc(0,0,R,Z.radians(U)-W,Z.radians(q)+W,!1),u.strokeStyle=h.colorBarStroke,u.lineWidth=2*N,u.stroke(),u.closePath()),T&&(u.beginPath(),u.arc(0,0,R,Z.radians(U),Z.radians(q),!1),u.strokeStyle=h.colorBar,u.lineWidth=T,u.stroke(),u.closePath(),h.barShadow&&(u.save(),u.beginPath(),u.arc(0,0,w,Z.radians(U),Z.radians(q),!1),u.clip(),u.beginPath(),u.strokeStyle=h.colorBar,u.lineWidth=1,u.shadowBlur=h.barShadow,u.shadowColor=h.colorBarShadow,u.shadowOffsetX=0,u.shadowOffsetY=0,u.arc(0,0,w,Z.radians(h.startAngle),Z.radians(h.startAngle+h.ticksAngle),!1),u.stroke(),u.closePath(),u.restore()),h.barProgress)){var J=gt(h),le=J.startAngle,pe=J.endAngle;u.beginPath(),u.arc(0,0,R,Z.radians(le),Z.radians(pe),!1),u.strokeStyle=h.colorBarProgress,u.lineWidth=T,u.stroke(),u.closePath()}u.restore()}function Et(u){return u.options.animatedValue?u.options.value:u.value}function Ke(u,h,m,w,C,T,O,N){u.beginPath(),u.fillStyle=N?Z.linearGradient(u,O,N,C>T?C:T,T>C,C>T?m:w):O,h>0?Z.roundRect(u,m,w,C,T,h):u.rect(m,w,C,T),u.fill(),u.closePath()}function xn(u,h,m,w,C,T,O,N,R){u.beginPath(),u.lineWidth=h,u.strokeStyle=R?Z.linearGradient(u,N,R,O,!0,C):N,m>0?Z.roundRect(u,w,C,T,O,m):u.rect(w,C,T,O),u.stroke(),u.closePath()}function ht(u,h,m,w,C,T){function O(we,Te,Qe,_t){return we&&(!_t&&h.borderShadowWidth&&(u.save(),u.shadowBlur=h.borderShadowWidth,u.shadowColor=h.colorBorderShadow),xn(u,we*N,R,m+we*N/2-oe,w+we*N/2-oe,W,le,Te,Qe),oe+=.5*N,!_t&&h.borderShadowWidth&&(_t=!0,u.restore())),_t}var N=Ft.pixelRatio,R=h.borderRadius*N,W=C-h.borderShadowWidth-h.borderOuterWidth*N,U=W-h.borderOuterWidth*N-h.borderMiddleWidth*N,q=U-h.borderMiddleWidth*N-h.borderInnerWidth*N,J=q-h.borderInnerWidth*N,le=T-h.borderShadowWidth-h.borderOuterWidth*N,pe=le-h.borderOuterWidth*N-h.borderMiddleWidth*N,Oe=pe-h.borderMiddleWidth*N-h.borderInnerWidth*N,ge=Oe-h.borderInnerWidth*N,Ne=m-(U-W)/2,We=Ne-(q-U)/2,Be=We-(J-q)/2,ue=w-(pe-le)/2,xe=ue-(Oe-pe)/2,ve=xe-(ge-Oe)/2,oe=0,ye=!1;return u.save(),ye=O(h.borderOuterWidth,h.colorBorderOuter,h.colorBorderOuterEnd,ye),ye=O(h.borderMiddleWidth,h.colorBorderMiddle,h.colorBorderMiddleEnd,ye),ye=O(h.borderInnerWidth,h.colorBorderInner,h.colorBorderInnerEnd,ye),!ye&&h.borderShadowWidth&&(u.shadowBlur=h.borderShadowWidth,u.shadowColor=h.colorBorderShadow),Ke(u,R,Be,ve,J+2*oe,ge+2*oe,h.colorPlate,h.colorPlateEnd),u.restore(),[Be,ve,J,ge]}function Ze(u,h,m,w,C,T){var O=Ft.pixelRatio,N=T>=C,R=N?.85*C:T,W=N?T:C;m=N?Ce(m+(C-R)/2):m;var U=!!h.title,q=!!h.units,J=!!h.valueBox,le=void 0,pe=void 0,Oe=void 0;N?(pe=Ce(.05*W),le=Ce(.075*W),Oe=Ce(.11*W),U&&(W-=le,w+=le),q&&(W-=pe),J&&(W-=Oe)):(pe=le=Ce(.15*R),U&&(R-=le,w+=le),q&&(R-=pe));var ge=2*h.barStrokeWidth,Ne=h.barBeginCircle?Ce(R*h.barBeginCircle/200-ge/2):0,We=Ce(R*h.barWidth/100-ge),Be=Ce(W*h.barLength/100-ge),ue=Ce((W-Be)/2),xe=Ce(m+(N?R/2:ue+Ne)),ve=Ce(w+(N?W-ue-Ne+ge/2:R/2)),oe=!N||h.hasLeft&&h.hasRight?0:(h.hasRight?-1:1)*h.ticksWidth/100*R,ye=N||h.hasLeft&&h.hasRight?0:(h.hasRight?-1:1)*h.ticksWidth/100*R;return u.barDimensions={isVertical:N,width:R,length:W,barWidth:We,barLength:Be,strokeWidth:ge,barMargin:ue,radius:Ne,pixelRatio:O,barOffset:null,titleMargin:U?le:0,unitsMargin:q?pe:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:m+oe,Y:w+ye,x0:xe+oe,y0:ve+ye,baseX:m,baseY:w,ticksPadding:h.ticksPadding/100},u.barDimensions}function He(u,h,m,w,C,T,O){var N=Ze(u,h,w,C,T,O),R=N.isVertical,W=N.width,U=N.barWidth,q=N.barLength,J=N.strokeWidth,le=N.barMargin,pe=N.radius,Oe=N.x0,ge=N.y0,Ne=N.X,We=N.Y,Be=q;u.save(),u.beginPath();var ue=null;if(h.barBeginCircle){var xe=Z.radians(R?270:0),ve=Math.asin(U/2/pe),oe=Math.cos(ve),ye=Math.sin(ve),we=Oe+(R?pe*ye:pe*oe-J/2),Te=R?ge-pe*oe:ge+pe*ye,Qe=Ot(R?Te-ge:we-Oe);ue=Ce(Qe+pe);var _t=R?Ce(Oe-pe*ye):we,wt=R?Te:Ce(ge-pe*ye);m==="progress"&&(q=ue+(q-ue)*(Z.normalizedValue(h).normal-h.minValue)/(h.maxValue-h.minValue));var kt=Ce(we+q-ue+J/2),Kt=Ce(Te-q+ue-J/2);u.arc(Oe,ge,pe,xe+ve,xe-ve),R?(u.moveTo(we,wt),u.lineTo(we,Kt),u.lineTo(_t,Kt),u.lineTo(_t,wt)):(u.moveTo(we,wt),u.lineTo(kt,wt),u.lineTo(kt,Te),u.lineTo(we,Te))}else{var Pn=Ce(R?Ne+(W-U)/2:Ne+le),Mn=Ce(R?We+q+le:We+(W-U)/2);m==="progress"&&(q*=(h.value-h.minValue)/(h.maxValue-h.minValue)),R?u.rect(Pn,Mn,U,-q):u.rect(Pn,Mn,q,U)}m!=="progress"&&h.barStrokeWidth&&(u.lineWidth=J,u.strokeStyle=h.colorBarStroke,u.stroke()),m!=="progress"&&h.colorBar?(u.fillStyle=h.colorBarEnd?Z.linearGradient(u,h.colorBar,h.colorBarEnd,q,R,R?We:Ne):h.colorBar,u.fill()):m==="progress"&&h.colorBarProgress&&(u.fillStyle=h.colorBarProgressEnd?Z.linearGradient(u,h.colorBarProgress,h.colorBarProgressEnd,Be,R,R?We:Ne):h.colorBarProgress,u.fill()),u.closePath(),u.restore(),h.barBeginCircle&&(u.barDimensions.radius+=J),u.barDimensions.barOffset=ue,u.barDimensions.barWidth+=J,u.barDimensions.barLength+=J}function qe(u,h,m,w,C,T){He(u,h,"",m,w,C,T)}function Yt(u,h){return h.needleSide!==u||h.tickSide!==u||h.numberSide!==u}function di(u,h,m,w,C,T){h.barProgress&&He(u,h,"progress",m,w,C,T)}function en(u,h){var m=u.barDimensions,w=m.isVertical,C=m.width,T=m.length,O=m.barWidth,N=m.barOffset,R=m.barMargin,W=m.X,U=m.Y,q=m.ticksLength,J=m.ticksPadding,le=C*(parseFloat(h.highlightsWidth)||0)/100;if(h.highlights&&le){var pe=h.tickSide!=="right",Oe=h.tickSide!=="left",ge=0,Ne=h.highlights.length,We=(C-O)/2,Be=h.maxValue-h.minValue,ue=Ce(w?W+We:W+R+N),xe=le,ve=w?U+T-R-N:U+We,oe=Ce((h.ticksWidth/100+J)*C)+(le-h.ticksWidth/100*C),ye=Ce(O+J*C);for(u.save();ge<Ne;ge++){var we=h.highlights[ge],Te=q*Ot(h.minValue-we.from)/Be,Qe=q*Ot((we.to-we.from)/Be);u.beginPath(),u.fillStyle=we.color,w?(pe&&u.rect(ue-oe,ve-Te,xe,-Qe),Oe&&u.rect(ue+ye,ve-Te,xe,-Qe)):(pe&&u.rect(ue+Te,ve-oe,Qe,xe),Oe&&u.rect(ue+Te,ve+ye,Qe,xe)),u.fill(),u.closePath()}u.restore()}}function gi(u,h,m,w,C){u.beginPath(),u.moveTo(h,m),u.lineTo(w,C),u.stroke(),u.closePath()}function Mi(u,h,m,w,C,T,O,N,R){var W=u.barDimensions,U=W.isVertical,q=W.length,J=W.barWidth,le=W.barOffset,pe=W.barMargin,Oe=W.pixelRatio,ge=W.width,Ne=W.X,We=W.Y,Be=W.ticksLength,ue=W.ticksPadding,xe=(ge-J)/2,ve=void 0,oe=void 0,ye=0,we=m.length,Te=void 0,Qe=R*ge,_t=xe-ue*ge,wt=xe+J+Qe+ue*ge,kt=h instanceof Array?h:new Array(m.length).fill(h);u.save(),u.lineWidth=N*Oe;for(var Kt=Be/(C-w);ye<we;ye++)Te=m[ye],u.strokeStyle=kt[ye],U?(oe=We+q-pe-le+(w-Te)*Kt,T&&(ve=Ne+_t,gi(u,ve,oe,Ce(ve-Qe),oe)),O&&(ve=Ne+wt,gi(u,ve,oe,Ce(ve-Qe),oe))):(ve=Ne+pe+le-(w-Te)*Kt,T&&(oe=We+_t,gi(u,ve,oe,ve,Ce(oe-Qe))),O&&(oe=We+wt,gi(u,ve,Ce(oe),ve,oe-Qe)));u.restore()}function Qt(u,h){var m=Z.prepareTicks(h),w=vr(m,2),C=w[0],T=w[1],O=2,N=(h.maxValue-h.minValue)/(h.majorTicks.length-1),R=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(h.majorTicks.length).fill(h.colorStrokeTicks||h.colorMajorTicks);if(Mi(u,R,h.exactTicks?h.majorTicks:h.majorTicks.map(function(Qe,_t){return h.minValue+N*_t}),h.minValue,h.maxValue,C,T,O,h.ticksWidth/100),h.strokeTicks){var W=u.barDimensions,U=W.isVertical,q=W.length,J=W.width,le=W.barWidth,pe=W.barMargin,Oe=W.barOffset,ge=W.X,Ne=W.Y,We=W.ticksLength,Be=W.pixelRatio,ue=W.ticksPadding,xe=(J-le)/2+le+ue*J,ve=(J-le)/2-ue*J,oe=void 0,ye=void 0,we=void 0,Te=void 0;u.strokeStyle=h.colorStrokeTicks||R[0],O*=Be,U?(ye=Ne+q-pe-Oe+O/2,Te=ye-We-O,C&&(we=oe=Ce(ge+ve),Xt(u,oe,ye,we,Te)),T&&(we=oe=Ce(ge+xe),Xt(u,oe,ye,we,Te))):(oe=ge+pe+Oe-O/2,we=oe+We+O,C&&(Te=ye=Ce(Ne+ve),Xt(u,oe,ye,we,Te)),T&&(Te=ye=Ce(Ne+xe),Xt(u,oe,ye,we,Te)))}}function Xt(u,h,m,w,C){u.beginPath(),u.moveTo(h,m),u.lineTo(w,C),u.stroke(),u.closePath()}function Fr(u,h){var m=Z.prepareTicks(h),w=vr(m,2),C=w[0],T=w[1],O=[],N=h.minValue,R=Math.abs(h.minorTicks)||0,W=R?(h.maxValue-h.minValue)/(R*(h.majorTicks.length-1)):0;if(R)if(h.exactTicks)for(var U=It.mod(h.majorTicks[0],R)||0;N<h.maxValue;N+=R)U+N<h.maxValue&&O.push(U+N);else for(;N<h.maxValue;N+=W)O.push(N);Mi(u,h.colorMinorTicks||h.colorStrokeTicks,O,h.minValue,h.maxValue,C,T,1,h.ticksWidthMinor/100)}function Hr(u,h){var m=u.barDimensions,w=m.isVertical,C=m.length,T=m.width,O=m.barWidth,N=m.barMargin,R=m.barOffset,W=m.X,U=m.Y,q=m.ticksLength,J=m.ticksPadding,le=h.maxValue-h.minValue,pe=le/(h.majorTicks.length-1),Oe=h.exactTicks?h.majorTicks:h.majorTicks.map(function(kt,Kt){return h.minValue+pe*Kt}),ge=Oe.length,Ne=h.numberSide!=="right",We=h.numberSide!=="left",Be=h.fontNumbersSize*T/200,ue=0,xe=(h.ticksWidth/100+2*J)*T,ve=(T-O)/2-xe,oe=(T-O)/2+O+xe,ye=void 0,we=void 0,Te=void 0,Qe=void 0,_t=h.colorNumbers instanceof Array?h.colorNumbers:new Array(ge).fill(h.colorNumbers),wt=h.numbersMargin/100*T;for(u.font=Z.font(h,"Numbers",T/200),u.lineWidth=0,u.textAlign="center";ue<ge;ue++)u.fillStyle=_t[ue],Qe=h.majorTicks[ue],Te=h.exactTicks?q*((Oe[ue]-h.minValue)/le):ue*q/(ge-1),w?(we=U+C-N-R-Te+Be/3,Ne&&(u.textAlign="right",u.fillText(Qe,W+ve-wt,we)),We&&(u.textAlign="left",u.fillText(Qe,W+oe+wt,we))):(u.measureText(Qe).width,ye=W+N+R+Te,Ne&&u.fillText(Qe,ye,U+ve-wt),We&&u.fillText(Qe,ye,U+oe+Be+wt))}function Tn(u,h){if(h.title){var m=u.barDimensions,w=m.isVertical,C=m.width,T=m.length,O=m.baseX,N=m.baseY,R=m.titleMargin,W=h.fontTitleSize*C/200,U=Ce(O+(w?C:T)/2),q=Ce(N+R/2-(w?W:W/2)-.025*(w?T:C));u.save(),u.textAlign="center",u.fillStyle=h.colorTitle,u.font=Z.font(h,"Title",C/200),u.lineWidth=0,u.fillText(h.title,U,q,w?C:T),u.restore()}}function Mt(u,h){if(h.units){var m=u.barDimensions,w=m.isVertical,C=m.width,T=m.length,O=m.baseX,N=m.baseY,R=m.unitsMargin,W=h.fontUnitsSize*C/200,U=Ce(O+(w?C:T)/2),q=Ce(N+(w?T:C)+R/2-W/2);u.save(),u.textAlign="center",u.fillStyle=h.colorUnits,u.font=Z.font(h,"Units",C/200),u.lineWidth=0,u.fillText(Z.formatContext(h,h.units),U,q,w?C:T),u.restore()}}function ma(u,h){if(h.needle){var m=u.barDimensions,w=m.isVertical,C=m.width,T=m.length,O=m.barWidth,N=m.barOffset,R=m.barMargin,W=m.ticksLength,U=m.X,q=m.Y,J=m.ticksPadding,le=h.needleSide!=="right",pe=h.needleSide!=="left",Oe=W*(Z.normalizedValue(h).indented-h.minValue)/(h.maxValue-h.minValue),ge=(h.ticksWidth/100+J)*C,Ne=O/2+ge,We=Ne*(h.needleEnd/100),Be=void 0,ue=void 0,xe=void 0,ve=void 0,oe=h.needleType.toLowerCase()==="arrow"?fa:pa,ye=(C-O)/2,we=Ne*(h.needleStart/100),Te=ye-ge-we,Qe=ye+O+ge+we;u.save(),Z.drawNeedleShadow(u,h),w?(xe=Ce(q+T-R-N-Oe),le&&(Be=Ce(U+Te),ue=Be+We,oe(u,h,Be,xe,ue,xe,We)),pe&&(Be=Ce(U+Qe),ue=Be-We,oe(u,h,Be,xe,ue,xe,We,!0))):(Be=Ce(U+R+N+Oe),le&&(xe=Ce(q+Te),ve=xe+We,oe(u,h,Be,xe,Be,ve,We)),pe&&(xe=Ce(q+Qe),ve=xe-We,oe(u,h,Be,xe,Be,ve,We,!0))),u.restore()}}function Gr(u,h,m,w){return h.colorNeedleEnd?Z.linearGradient(u,w?h.colorNeedleEnd:h.colorNeedle,w?h.colorNeedle:h.colorNeedleEnd,m,!u.barDimensions.isVertical):h.colorNeedle}function pa(u,h,m,w,C,T,O,N){u.lineWidth=h.needleWidth,u.strokeStyle=Gr(u,h,O,N),u.beginPath(),u.moveTo(m,w),u.lineTo(C,T),u.stroke(),u.closePath()}function fa(u,h,m,w,C,T,O,N){var R=Ce(.4*O),W=O-R,U=m===C,q=h.needleWidth/2;u.fillStyle=Gr(u,h,O,N),u.beginPath(),U?(w>T&&(W*=-1),u.moveTo(m-q,w),u.lineTo(m+q,w),u.lineTo(m+q,w+W),u.lineTo(m,T),u.lineTo(m-q,w+W),u.lineTo(m-q,w)):(m>C&&(W*=-1),u.moveTo(m,w-q),u.lineTo(m,w+q),u.lineTo(m+W,w+q),u.lineTo(C,w),u.lineTo(m+W,w-q),u.lineTo(m,w-q)),u.fill(),u.closePath()}function ga(u,h,m,w,C,T,O){var N=(parseFloat(h.fontValueSize)||0)*T/200,R=(.11*O-N)/2;u.barDimensions.isVertical&&Z.drawValueBox(u,h,m,w+T/2,C+O-N-R,T)}var vr=function(){function u(h,m){var w=[],C=!0,T=!1,O=void 0;try{for(var N,R=h[Symbol.iterator]();!(C=(N=R.next()).done)&&(w.push(N.value),!m||w.length!==m);C=!0);}catch(W){T=!0,O=W}finally{try{!C&&R.return&&R.return()}finally{if(T)throw O}}return w}return function(h,m){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return u(h,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),En=function u(h,m,w){h===null&&(h=Function.prototype);var C=Object.getOwnPropertyDescriptor(h,m);if(C===void 0){var T=Object.getPrototypeOf(h);return T===null?void 0:u(T,m,w)}if("value"in C)return C.value;var O=C.get;if(O!==void 0)return O.call(w)},jr=function u(h,m,w,C){var T=Object.getOwnPropertyDescriptor(h,m);if(T===void 0){var O=Object.getPrototypeOf(h);O!==null&&u(O,m,w,C)}else if("value"in T&&T.writable)T.value=w;else{var N=T.set;N!==void 0&&N.call(C,w)}return w},vi=function(){function u(h,m){for(var w=0;w<m.length;w++){var C=m[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(h,C.key,C)}}return function(h,m,w){return m&&u(h.prototype,m),w&&u(h,w),h}}(),Ti=null,yr=function(){function u(){i(this,u),this._events={},this.addListener=this.on,this.removeListener=this.off}return vi(u,[{key:"emit",value:function(h){if(this._events[h]){for(var m=0,w=this._events[h].length,C=arguments.length,T=Array(C>1?C-1:0),O=1;O<C;O++)T[O-1]=arguments[O];for(;m<w;m++)this._events[h][m]&&this._events[h][m].apply(this,T)}}},{key:"once",value:function(h){for(var m=arguments.length,w=Array(m>1?m-1:0),C=1;C<m;C++)w[C-1]=arguments[C];for(var T=0,O=w.length,N=this;T<O;T++)(function(){var R=w[T],W=function U(){N.off(h,U),R.apply(N,arguments)};w[T]=W})();this.on.apply(this,[h].concat(w))}},{key:"on",value:function(h){this._events[h]||(this._events[h]=[]);for(var m=0,w=arguments.length<=1?0:arguments.length-1;m<w;m++)this._events[h].push(arguments.length<=m+1?void 0:arguments[m+1])}},{key:"off",value:function(h){if(this._events[h])for(var m=0,w=arguments.length<=1?0:arguments.length-1;m<w;m++)for(var C=arguments.length<=m+1?void 0:arguments[m+1],T=void 0;~(T=this._events[h].indexOf(C));)this._events[h].splice(T,1)}},{key:"removeAllListeners",value:function(h){delete this._events[h]}},{key:"listeners",get:function(){return this._events}}]),u}(),Ur=o("requestAnimationFrame")||function(u){return setTimeout(function(){return u(new Date().getTime())},1e3/60)},tn={linear:function(u){return u},quad:function(u){return Math.pow(u,2)},dequad:function(u){return 1-tn.quad(1-u)},quint:function(u){return Math.pow(u,5)},dequint:function(u){return 1-Math.pow(1-u,5)},cycle:function(u){return 1-Math.sin(Math.acos(u))},decycle:function(u){return Math.sin(Math.acos(1-u))},bounce:function(u){return 1-tn.debounce(1-u)},debounce:function(u){for(var h=0,m=1;;h+=m,m/=2)if(u>=(7-4*h)/11)return-Math.pow((11-6*h-11*u)/4,2)+Math.pow(m,2)},elastic:function(u){return 1-tn.delastic(1-u)},delastic:function(u){return Math.pow(2,10*(u-1))*Math.cos(20*Math.PI*1.5/3*u)}},br=function(){function u(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,u),this.duration=m,this.rule=h,this.draw=w,this.end=C,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",w);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",C)}return vi(u,[{key:"animate",value:function(h,m){var w=this;this.frame&&this.cancel();var C=window.performance&&window.performance.now?window.performance.now():o("animationStartTime")||Date.now();h=h||this.draw,m=m||this.end,this.draw=h,this.end=m,this.frame=Ur(function(T){return a(T,h,C,tn[w.rule]||w.rule,w.duration,m,w)})}},{key:"cancel",value:function(){this.frame&&((o("cancelAnimationFrame")||function(h){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),u}();br.rules=tn;var Oi=function(){function u(h,m,w){i(this,u),this.options=h,this.element=m.toLowerCase(),this.type=u.toDashed(w),this.Type=r[w],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||u.domReady(this.traverse.bind(this))}return vi(u,[{key:"isValidNode",value:function(h){return!(!h.tagName||h.tagName.toLowerCase()!==this.element||h.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var h=document.getElementsByTagName(this.element),m=0,w=h.length;m<w;m++)this.process(h[m]);this.isObservable&&!this.mutationsObserved&&(new MutationObserver(this.observe.bind(this)).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this.mutationsObserved=!0)}},{key:"observe",value:function(h){for(var m=0,w=h.length;m<w;m++){var C=h[m];if(C.type==="attributes"&&C.attributeName==="data-type"&&this.isValidNode(C.target)&&C.oldValue!==this.type)setTimeout(this.process.bind(this,C.target));else if(C.addedNodes&&C.addedNodes.length)for(var T=0,O=C.addedNodes.length;T<O;T++)setTimeout(this.process.bind(this,C.addedNodes[T]))}}},{key:"process",value:function(h){var m=this;if(!this.isValidNode(h))return null;var w=void 0,C=JSON.parse(JSON.stringify(this.options)),T=null;for(w in C)if(C.hasOwnProperty(w)){var O=u.toAttributeName(w),N=u.parse(h.getAttribute(O));N!=null&&(C[w]=N)}return C.renderTo=h,T=new this.Type(C),T.draw&&T.draw(),this.isObservable&&(T.observer=new MutationObserver(function(R){R.forEach(function(W){if(W.type==="attributes"){var U=W.attributeName.toLowerCase(),q=h.getAttribute(U).toLowerCase();if(U==="data-type"&&q&&q!==m.type)T.observer.disconnect(),delete T.observer,T.destroy&&T.destroy();else if(U.substr(0,5)==="data-"){var J=U.substr(5).split("-").map(function(pe,Oe){return Oe?pe.charAt(0).toUpperCase()+pe.substr(1):pe}).join(""),le={};le[J]=u.parse(h.getAttribute(W.attributeName)),J==="value"?T&&(T.value=le[J]):T.update&&T.update(le)}}})}),T.observer.observe(h,{attributes:!0})),T}}],[{key:"parse",value:function(h){if(h==="true")return!0;if(h==="false")return!1;if(h!=="undefined"){if(h==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(h))return h.split(",");try{return JSON.parse(h)}catch{}return h}}},{key:"toDashed",value:function(h){for(var m=h.split(/(?=[A-Z])/),w=1,C=m.length,T=m[0].toLowerCase();w<C;w++)T+="-"+m[w].toLowerCase();return T}},{key:"toCamelCase",value:function(h){for(var m=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],w=h.split(/-/),C=0,T=w.length,O="";C<T;C++)O+=C||m?w[C][0].toUpperCase()+w[C].substr(1).toLowerCase():w[C].toLowerCase();return O}},{key:"toAttributeName",value:function(h){return"data-"+u.toDashed(h)}},{key:"domReady",value:function(h){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return h();window.addEventListener?window.addEventListener("DOMContentLoaded",h,!1):window.attachEvent&&window.attachEvent("onload",h)}}]),u}(),Ft=function(){function u(h,m,w){i(this,u),u.collection.push(this),this.width=m||0,this.height=w||0,this.element=h,this.init()}return vi(u,[{key:"init",value:function(){var h=u.pixelRatio;this.element.width=this.width*h,this.element.height=this.height*h,this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.elementClone=this.element.cloneNode(!0),this.context=this.element.getContext("2d"),this.contextClone=this.elementClone.getContext("2d"),this.drawWidth=this.element.width,this.drawHeight=this.element.height,this.drawX=this.drawWidth/2,this.drawY=this.drawHeight/2,this.minSide=this.drawX<this.drawY?this.drawX:this.drawY,this.contextClone.translate(this.drawX,this.drawY),this.elementClone.initialized=!1,this.context.translate(this.drawX,this.drawY),this.context.max=this.contextClone.max=this.minSide,this.context.maxRadius=this.contextClone.maxRadius=null}},{key:"destroy",value:function(){var h=u.collection.indexOf(this);~h&&u.collection.splice(h,1),this.context.clearRect(-this.drawX,-this.drawY,this.drawWidth,this.drawHeight),this.context.max=null,delete this.context.max,this.context.maxRadius=null,delete this.context.maxRadius,this.context=null,this.contextClone=null,this.elementClone=null,this.element=null,this.onRedraw=null}},{key:"commit",value:function(){var h=u.pixelRatio;return h!==1&&this.contextClone.scale(h,h),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var h=0,m=u.collection.length;h<m;h++)u.collection[h].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),u}();Ft.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(Ft.redraw);var Ii={renderTo:null,width:0,height:0,minValue:0,maxValue:100,value:0,units:!1,exactTicks:!1,majorTicks:[0,20,40,60,80,100],minorTicks:10,strokeTicks:!0,animatedValue:!1,animateOnInit:!1,title:!1,borders:!0,numbersMargin:1,listeners:null,valueInt:3,valueDec:2,majorTicksInt:1,majorTicksDec:0,animation:!0,animationDuration:500,animationRule:"cycle",colorPlate:"#fff",colorPlateEnd:"",colorMajorTicks:"#444",colorMinorTicks:"#666",colorStrokeTicks:"",colorTitle:"#888",colorUnits:"#888",colorNumbers:"#444",colorNeedle:"rgba(240,128,128,1)",colorNeedleEnd:"rgba(255,160,122,.9)",colorValueText:"#444",colorValueTextShadow:"rgba(0,0,0,0.3)",colorBorderShadow:"rgba(0,0,0,0.5)",colorBorderOuter:"#ddd",colorBorderOuterEnd:"#aaa",colorBorderMiddle:"#eee",colorBorderMiddleEnd:"#f0f0f0",colorBorderInner:"#fafafa",colorBorderInnerEnd:"#ccc",colorValueBoxRect:"#888",colorValueBoxRectEnd:"#666",colorValueBoxBackground:"#babab2",colorValueBoxShadow:"rgba(0,0,0,1)",colorNeedleShadowUp:"rgba(2,255,255,0.2)",colorNeedleShadowDown:"rgba(188,143,143,0.45)",colorBarStroke:"#222",colorBar:"#ccc",colorBarProgress:"#888",colorBarShadow:"#000",fontNumbers:"Arial",fontTitle:"Arial",fontUnits:"Arial",fontValue:"Arial",fontNumbersSize:20,fontTitleSize:24,fontUnitsSize:22,fontValueSize:26,fontNumbersStyle:"normal",fontTitleStyle:"normal",fontUnitsStyle:"normal",fontValueStyle:"normal",fontNumbersWeight:"normal",fontTitleWeight:"normal",fontUnitsWeight:"normal",fontValueWeight:"normal",needle:!0,needleShadow:!0,needleType:"arrow",needleStart:5,needleEnd:85,needleWidth:4,borderOuterWidth:3,borderMiddleWidth:3,borderInnerWidth:3,borderShadowWidth:3,valueBox:!0,valueBoxStroke:5,valueBoxWidth:0,valueText:"",valueTextShadow:!0,valueBoxBorderRadius:2.5,highlights:[{from:20,to:60,color:"#eee"},{from:60,to:80,color:"#ccc"},{from:80,to:100,color:"#999"}],highlightsWidth:15,highlightsLineCap:"butt",barWidth:20,barStrokeWidth:0,barProgress:!0,barShadow:0};l.prototype=Object.create(Array.prototype),l.prototype.constructor=l,l.prototype.get=function(u){if(typeof u=="string")for(var h=0,m=this.length;h<m;h++){var w=this[h].options.renderTo.tagName?this[h].options.renderTo:document.getElementById(this[h].options.renderTo||"");if(w.getAttribute("id")===u)return this[h]}else if(typeof u=="number")return this[u];return null};var _r="2.2.1",Ce=Math.round,Ot=Math.abs,Ri=new l;Ri.version=_r;var It=function(u){function h(m){i(this,h);var w=e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this)),C=w.constructor.name;if(C==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(Ri.push(w),m.listeners&&Object.keys(m.listeners).forEach(function(O){(m.listeners[O]instanceof Array?m.listeners[O]:[m.listeners[O]]).forEach(function(N){w.on(O,N)})}),w.version=_r,w.type=r[C]||h,w.initialized=!1,m.minValue=parseFloat(m.minValue),m.maxValue=parseFloat(m.maxValue),m.value=parseFloat(m.value)||0,m.borders||(m.borderInnerWidth=m.borderMiddleWidth=m.borderOuterWidth=0),!m.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var T=m.renderTo.tagName?m.renderTo:document.getElementById(m.renderTo);if(!(T instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return m.width=parseFloat(m.width)||0,m.height=parseFloat(m.height)||0,m.width&&m.height||(m.width||(m.width=T.parentNode?T.parentNode.offsetWidth:T.offsetWidth),m.height||(m.height=T.parentNode?T.parentNode.offsetHeight:T.offsetHeight)),w.options=m||{},w.options.animateOnInit&&(w._value=w.options.value,w.options.value=w.options.minValue),w.canvas=new Ft(T,m.width,m.height),w.canvas.onRedraw=w.draw.bind(w),w.animation=new br(m.animationRule,m.animationDuration),w}return t(h,u),vi(h,[{key:"update",value:function(m){return Object.assign(this.options,this.type.configure(m||{})),this.canvas.width=this.options.width,this.canvas.height=this.options.height,this.animation.rule=this.options.animationRule,this.animation.duration=this.options.animationDuration,this.canvas.redraw(),this}},{key:"destroy",value:function(){var m=Ri.indexOf(this);~m&&Ri.splice(m,1),this.canvas.destroy(),this.canvas=null,this.animation.destroy(),this.animation=null,this.emit("destroy")}},{key:"draw",value:function(){return this.options.animateOnInit&&!this.initialized&&(this.value=this._value,this.initialized=!0,this.emit("init")),this.emit("render"),this}},{key:"value",set:function(m){var w=this;m=h.ensureValue(m,this.options.minValue);var C=this.options.value;if(m!==C)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===m))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=m),this.emit("animationStart"),this.animation.animate(function(T){var O=C+(m-C)*T;w.options.animatedValue&&w.emit("value",O,w.value),w.options.value=O,w.draw(),w.emit("animate",T,w.options.value)},function(){w._value!==void 0&&(w.emit("value",w._value,w.value),w.options.value=w._value,delete w._value),w.draw(),w.emit("animationEnd"),w.animation.frame=null})}else this.emit("value",m,this.value),this.options.value=m,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(m){return m}},{key:"initialize",value:function(m,w){return new Oi(w,"canvas",m)}},{key:"fromElement",value:function(m){var w=Oi.toCamelCase(m.getAttribute("data-type")),C=m.attributes,T=0,O=C.length,N={};if(w){for(/Gauge$/.test(w)||(w+="Gauge");T<O;T++)N[Oi.toCamelCase(C[T].name.replace(/^data-/,""),!1)]=Oi.parse(C[T].value);new Oi(N,m.tagName,w).process(m)}}},{key:"ensureValue",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return m=parseFloat(m),!isNaN(m)&&isFinite(m)||(m=parseFloat(w)||0),m}},{key:"mod",value:function(m,w){return(m%w+w)%w}},{key:"version",get:function(){return _r}}]),h}(yr);r!==void 0&&(r.BaseGauge=It,r.gauges=(window.document||{}).gauges=Ri);var va=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,Z={roundRect:c,padValue:p,formatMajorTickNumber:y,radians:k,radialPoint:x,linearGradient:A,drawNeedleShadow:z,drawValueBox:Le,verifyError:d,prepareTicks:s,font:Y,normalizedValue:Ye,formatContext:f},nn=Math.PI,An=nn/2,qr=Object.assign({},Ii,{ticksAngle:270,startAngle:45,colorNeedleCircleOuter:"#f0f0f0",colorNeedleCircleOuterEnd:"#ccc",colorNeedleCircleInner:"#e8e8e8",colorNeedleCircleInnerEnd:"#f5f5f5",needleCircleSize:10,needleCircleInner:!0,needleCircleOuter:!0,needleStart:20,animationTarget:"needle",useMinPath:!1,barWidth:0,barStartPosition:"left"}),ya=function(u){function h(m){return i(this,h),m=Object.assign({},qr,m||{}),e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h.configure(m)))}return t(h,u),vi(h,[{key:"draw",value:function(){try{var m=this.canvas,w=[-m.drawX,-m.drawY,m.drawWidth,m.drawHeight],C=w[0],T=w[1],O=w[2],N=w[3],R=this.options;if(R.animationTarget==="needle"){if(!m.elementClone.initialized){var W=m.contextClone;W.clearRect(C,T,O,N),this.emit("beforePlate"),mt(W,R),this.emit("beforeHighlights"),ct(W,R),this.emit("beforeMinorTicks"),qt(W,R),this.emit("beforeMajorTicks"),ft(W,R),this.emit("beforeNumbers"),X(W,R),this.emit("beforeTitle"),ie(W,R),this.emit("beforeUnits"),ae(W,R),m.elementClone.initialized=!0}this.canvas.commit(),m.context.clearRect(C,T,O,N),m.context.drawImage(m.elementClone,C,T,O,N),this.emit("beforeProgressBar"),vt(m.context,R),this.emit("beforeValueBox"),nt(m.context,R,Et(this)),this.emit("beforeNeedle"),Me(m.context,R)}else{var U=-Z.radians((R.value-R.minValue)/(R.maxValue-R.minValue)*R.ticksAngle);if(m.context.clearRect(C,T,O,N),this.emit("beforePlate"),mt(m.context,R),m.context.rotate(U),this.emit("beforeHighlights"),ct(m.context,R),this.emit("beforeMinorTicks"),qt(m.context,R),this.emit("beforeMajorTicks"),ft(m.context,R),this.emit("beforeNumbers"),X(m.context,R),this.emit("beforeProgressBar"),vt(m.context,R),m.context.rotate(-U),!m.elementClone.initialized){var q=m.contextClone;q.clearRect(C,T,O,N),this.emit("beforeTitle"),ie(q,R),this.emit("beforeUnits"),ae(q,R),this.emit("beforeNeedle"),Me(q,R),m.elementClone.initialized=!0}m.context.drawImage(m.elementClone,C,T,O,N)}this.emit("beforeValueBox"),nt(m.context,R,Et(this)),En(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"draw",this).call(this)}catch(J){Z.verifyError(J)}return this}},{key:"value",set:function(m){m=It.ensureValue(m,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=m,m=this.options.value+((m-this.options.value)%360+540)%360-180),jr(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",m,this)},get:function(){return En(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this)}}],[{key:"configure",value:function(m){return m.barWidth>50&&(m.barWidth=50),isNaN(m.startAngle)&&(m.startAngle=45),isNaN(m.ticksAngle)&&(m.ticksAngle=270),m.ticksAngle>360&&(m.ticksAngle=360),m.ticksAngle<0&&(m.ticksAngle=0),m.startAngle<0&&(m.startAngle=0),m.startAngle>360&&(m.startAngle=360),m}}]),h}(It);r!==void 0&&(r.RadialGauge=ya),It.initialize("RadialGauge",qr);var Yr=Object.assign({},Ii,{borderRadius:0,barBeginCircle:30,colorBarEnd:"",colorBarProgressEnd:"",needleWidth:6,tickSide:"both",needleSide:"both",numberSide:"both",ticksWidth:10,ticksWidthMinor:5,ticksPadding:5,barLength:85,fontTitleSize:26,highlightsWidth:10}),Dn=function(u){function h(m){return i(this,h),m=Object.assign({},Yr,m||{}),e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h.configure(m)))}return t(h,u),vi(h,[{key:"draw",value:function(){try{var m=this.canvas,w=[-m.drawX,-m.drawY,m.drawWidth,m.drawHeight],C=w[0],T=w[1],O=w[2],N=w[3],R=this.options;if(!m.elementClone.initialized){var W=m.contextClone;W.clearRect(C,T,O,N),this.emit("beforePlate"),this.drawBox=ht(W,R,C,T,O,N),this.emit("beforeBar"),qe.apply(void 0,[W,R].concat(n(this.drawBox))),m.contextClone.barDimensions=W.barDimensions,this.emit("beforeHighlights"),en(W,R),this.emit("beforeMinorTicks"),Fr(W,R),this.emit("beforeMajorTicks"),Qt(W,R),this.emit("beforeNumbers"),Hr(W,R),this.emit("beforeTitle"),Tn(W,R),this.emit("beforeUnits"),Mt(W,R),m.elementClone.initialized=!0}this.canvas.commit(),m.context.clearRect(C,T,O,N),m.context.drawImage(m.elementClone,C,T,O,N),this.emit("beforeProgressBar"),di.apply(void 0,[m.context,R].concat(n(this.drawBox))),this.emit("beforeNeedle"),ma(m.context,R),this.emit("beforeValueBox"),ga.apply(void 0,[m.context,R,R.animatedValue?this.options.value:this.value].concat(n(this.drawBox))),En(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"draw",this).call(this)}catch(U){Z.verifyError(U)}return this}}],[{key:"configure",value:function(m){return m.barStrokeWidth>=m.barWidth&&(m.barStrokeWidth=Ce(m.barWidth/2)),m.hasLeft=Yt("right",m),m.hasRight=Yt("left",m),m.value>m.maxValue&&(m.value=m.maxValue),m.value<m.minValue&&(m.value=m.minValue),It.configure(m)}}]),h}(It);r!==void 0&&(r.LinearGauge=Dn),It.initialize("LinearGauge",Yr),typeof Bo<"u"&&Object.assign(r,{Collection:l,GenericOptions:Ii,Animation:br,BaseGauge:It,drawings:Z,SmartCanvas:Ft,DomObserver:Oi,vendorize:o})})(typeof Bo<"u"?Bo.exports:window)});var Wu=ka((PT,ua)=>{(function(r,n,e,t){"use strict";var i=["","webkit","Moz","MS","ms","o"],o=n.createElement("div"),a="function",l=Math.round,d=Math.abs,f=Date.now;function s(g,b,S){return setTimeout(Y(g,S),b)}function c(g,b,S){return Array.isArray(g)?(p(g,S[b],S),!0):!1}function p(g,b,S){var I;if(g)if(g.forEach)g.forEach(b,S);else if(g.length!==t)for(I=0;I<g.length;)b.call(S,g[I],I,g),I++;else for(I in g)g.hasOwnProperty(I)&&b.call(S,g[I],I,g)}function y(g,b,S){var I="DEPRECATED METHOD: "+b+`
1
+ import{A as Sd,B as Cd,C as xd,D as Ui,E as hn,F as Td,G as Ed,H as Ad,I as Dd,J as Pd,K as Md,L as Od,a as Fi,b as Hi,c as Gi,d as po,e as dn,f as xr,g as ui,h as ji,i as jt,j as fo,k as go,l as Kn,m as cn,n as vo,o as yo,p as mi,q as La,r as bo,s as Tr,t as kd,u as Fa,v as Ha,w as Ga,x as ja,y as $n,z as Er}from"./chunk-VNUEOPPK.js";import{b as Wd,g as Bd}from"./chunk-5BPL4ALQ.js";import{a as lt,b as pd,c as co,d as Qn,e as Xn,f as fd,g as gd,h as vd}from"./chunk-JDTWKTDJ.js";import"./chunk-YQQFIIO5.js";import{a as yd,b as bd,c as _d,d as wd,e as uo,f as mo}from"./chunk-WJMKCVFQ.js";import{a as Yn,b as ho}from"./chunk-MCACXEYY.js";import{a as Id,b as Rd,c as Nd}from"./chunk-OG77M7OV.js";import{a as lo}from"./chunk-FMVUDX5R.js";import"./chunk-FFCTE2U5.js";import"./chunk-7OTNT2GF.js";import{a as Wl,b as Bl,c as zl,d as Vl,e as Ll,f as Fl,g as Ln,h as Hl,i as no,k as Gl,l as jl,m as Ul,n as Yl,o as ki,p as Bt}from"./chunk-VIHODUV4.js";import{f as hd}from"./chunk-FCC7GNHD.js";import"./chunk-SGYCFQGT.js";import{a as ii}from"./chunk-M5YAMDFT.js";import{a as md}from"./chunk-RCSPPHLA.js";import{a as Vn,b as Ml,c as Ol,d as to,f as io,g as ti,h as Cr,i as Fn,j as Na,k as Wt,l as te,m as Hn,n as wi,o as Gn,p as ql,r as Li,y as ud}from"./chunk-AHFD2AA5.js";import{$ as Da,$a as Ai,$b as Nt,$c as eo,$d as oo,Ac as ce,Ae as od,Bb as Ia,Bc as Xe,Be as ad,Cb as de,Cc as kl,Da as Zt,Dc as E,Ea as V,Eb as vl,Ec as xt,Ee as za,Fa as L,Fc as at,Fd as Il,G as rl,Ga as dt,Gd as Rl,H as Ta,Ha as dl,Hb as G,Hd as Nl,I as ol,Ia as Wn,Ib as Jt,Ic as Ae,J as al,Jb as bi,Jc as De,K as On,Ka as on,Kb as yl,Kc as Pe,Ke as sd,Lb as fe,Lc as Sl,Le as qn,Ma as cl,Mc as Cl,Me as ld,Nb as ke,Nc as xl,Ne as Va,O as Xr,Oa as st,Oc as Bn,Od as jn,Pa as ut,Pe as dd,Q as kr,Qd as Wa,R as Ea,Ra as Wi,Rc as Jr,S as Aa,Sa as Q,Sc as Tl,Se as cd,Ta as Ee,Tc as El,Td as Ql,U as sl,Ub as bl,Va as an,Vc as Ra,Vd as Xl,Wa as hl,Wd as Kl,Xc as zn,Yb as be,Yd as ro,Zb as j,_b as it,a as $,aa as In,ae as $l,b as rt,be as Zl,c as il,cb as ul,cd as Fe,ce as Jl,d as ka,db as ml,dc as Ge,de as ao,e as wr,eb as Sr,ec as Zr,ed as Al,ee as ed,f as Sa,fa as Pa,fd as Vi,g as rn,gc as Bi,ha as Gt,hc as zi,ia as Ma,ic as v,jc as _,je as td,kc as B,ke as id,la as Ve,lc as _l,le as Un,m as bt,mc as wl,ne as ln,o as Ni,oa as ot,oc as ee,od as Dl,pa as $t,qb as Oa,qc as F,ra as Rn,rb as Kr,rc as se,sc as ei,sd as _i,t as nl,ta as Nn,tb as pl,tc as Ct,te as nd,u as Ca,ua as M,ub as P,uc as ci,vc as sn,ve as ni,wb as fl,wc as Je,wd as Pl,we as so,xb as gl,xc as je,xe as rd,y as xa,ya as ll,yb as $r,yc as Ue,ye as hi,z as Ht,zb as Rt,ze as Ba}from"./chunk-JIJMSRKJ.js";var Qa=ka(Ao=>{(function(){"use strict";var r=function(){this.init()};r.prototype={init:function(){var s=this||n;return s._counter=1e3,s._html5AudioPool=[],s.html5PoolSize=10,s._codecs={},s._howls=[],s._muted=!1,s._volume=1,s._canPlayEvent="canplaythrough",s._navigator=typeof window<"u"&&window.navigator?window.navigator:null,s.masterGain=null,s.noAudio=!1,s.usingWebAudio=!0,s.autoSuspend=!0,s.ctx=null,s.autoUnlock=!0,s._setup(),s},volume:function(s){var c=this||n;if(s=parseFloat(s),c.ctx||f(),typeof s<"u"&&s>=0&&s<=1){if(c._volume=s,c._muted)return c;c.usingWebAudio&&c.masterGain.gain.setValueAtTime(s,n.ctx.currentTime);for(var p=0;p<c._howls.length;p++)if(!c._howls[p]._webAudio)for(var y=c._howls[p]._getSoundIds(),k=0;k<y.length;k++){var x=c._howls[p]._soundById(y[k]);x&&x._node&&(x._node.volume=x._volume*s)}return c}return c._volume},mute:function(s){var c=this||n;c.ctx||f(),c._muted=s,c.usingWebAudio&&c.masterGain.gain.setValueAtTime(s?0:c._volume,n.ctx.currentTime);for(var p=0;p<c._howls.length;p++)if(!c._howls[p]._webAudio)for(var y=c._howls[p]._getSoundIds(),k=0;k<y.length;k++){var x=c._howls[p]._soundById(y[k]);x&&x._node&&(x._node.muted=s?!0:x._muted)}return c},stop:function(){for(var s=this||n,c=0;c<s._howls.length;c++)s._howls[c].stop();return s},unload:function(){for(var s=this||n,c=s._howls.length-1;c>=0;c--)s._howls[c].unload();return s.usingWebAudio&&s.ctx&&typeof s.ctx.close<"u"&&(s.ctx.close(),s.ctx=null,f()),s},codecs:function(s){return(this||n)._codecs[s.replace(/^x-/,"")]},_setup:function(){var s=this||n;if(s.state=s.ctx&&s.ctx.state||"suspended",s._autoSuspend(),!s.usingWebAudio)if(typeof Audio<"u")try{var c=new Audio;typeof c.oncanplaythrough>"u"&&(s._canPlayEvent="canplay")}catch{s.noAudio=!0}else s.noAudio=!0;try{var c=new Audio;c.muted&&(s.noAudio=!0)}catch{}return s.noAudio||s._setupCodecs(),s},_setupCodecs:function(){var s=this||n,c=null;try{c=typeof Audio<"u"?new Audio:null}catch{return s}if(!c||typeof c.canPlayType!="function")return s;var p=c.canPlayType("audio/mpeg;").replace(/^no$/,""),y=s._navigator?s._navigator.userAgent:"",k=y.match(/OPR\/(\d+)/g),x=k&&parseInt(k[0].split("/")[1],10)<33,A=y.indexOf("Safari")!==-1&&y.indexOf("Chrome")===-1,z=y.match(/Version\/(.*?) /),Y=A&&z&&parseInt(z[1],10)<15;return s._codecs={mp3:!!(!x&&(p||c.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!p,opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(c.canPlayType('audio/wav; codecs="1"')||c.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(c.canPlayType("audio/x-m4b;")||c.canPlayType("audio/m4b;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!Y&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!Y&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!c.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")},s},_unlockAudio:function(){var s=this||n;if(!(s._audioUnlocked||!s.ctx)){s._audioUnlocked=!1,s.autoUnlock=!1,!s._mobileUnloaded&&s.ctx.sampleRate!==44100&&(s._mobileUnloaded=!0,s.unload()),s._scratchBuffer=s.ctx.createBuffer(1,1,22050);var c=function(p){for(;s._html5AudioPool.length<s.html5PoolSize;)try{var y=new Audio;y._unlocked=!0,s._releaseHtml5Audio(y)}catch{s.noAudio=!0;break}for(var k=0;k<s._howls.length;k++)if(!s._howls[k]._webAudio)for(var x=s._howls[k]._getSoundIds(),A=0;A<x.length;A++){var z=s._howls[k]._soundById(x[A]);z&&z._node&&!z._node._unlocked&&(z._node._unlocked=!0,z._node.load())}s._autoResume();var Y=s.ctx.createBufferSource();Y.buffer=s._scratchBuffer,Y.connect(s.ctx.destination),typeof Y.start>"u"?Y.noteOn(0):Y.start(0),typeof s.ctx.resume=="function"&&s.ctx.resume(),Y.onended=function(){Y.disconnect(0),s._audioUnlocked=!0,document.removeEventListener("touchstart",c,!0),document.removeEventListener("touchend",c,!0),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",c,!0);for(var re=0;re<s._howls.length;re++)s._howls[re]._emit("unlock")}};return document.addEventListener("touchstart",c,!0),document.addEventListener("touchend",c,!0),document.addEventListener("click",c,!0),document.addEventListener("keydown",c,!0),s}},_obtainHtml5Audio:function(){var s=this||n;if(s._html5AudioPool.length)return s._html5AudioPool.pop();var c=new Audio().play();return c&&typeof Promise<"u"&&(c instanceof Promise||typeof c.then=="function")&&c.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(s){var c=this||n;return s._unlocked&&c._html5AudioPool.push(s),c},_autoSuspend:function(){var s=this;if(!(!s.autoSuspend||!s.ctx||typeof s.ctx.suspend>"u"||!n.usingWebAudio)){for(var c=0;c<s._howls.length;c++)if(s._howls[c]._webAudio){for(var p=0;p<s._howls[c]._sounds.length;p++)if(!s._howls[c]._sounds[p]._paused)return s}return s._suspendTimer&&clearTimeout(s._suspendTimer),s._suspendTimer=setTimeout(function(){if(s.autoSuspend){s._suspendTimer=null,s.state="suspending";var y=function(){s.state="suspended",s._resumeAfterSuspend&&(delete s._resumeAfterSuspend,s._autoResume())};s.ctx.suspend().then(y,y)}},3e4),s}},_autoResume:function(){var s=this;if(!(!s.ctx||typeof s.ctx.resume>"u"||!n.usingWebAudio))return s.state==="running"&&s.ctx.state!=="interrupted"&&s._suspendTimer?(clearTimeout(s._suspendTimer),s._suspendTimer=null):s.state==="suspended"||s.state==="running"&&s.ctx.state==="interrupted"?(s.ctx.resume().then(function(){s.state="running";for(var c=0;c<s._howls.length;c++)s._howls[c]._emit("resume")}),s._suspendTimer&&(clearTimeout(s._suspendTimer),s._suspendTimer=null)):s.state==="suspending"&&(s._resumeAfterSuspend=!0),s}};var n=new r,e=function(s){var c=this;if(!s.src||s.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}c.init(s)};e.prototype={init:function(s){var c=this;return n.ctx||f(),c._autoplay=s.autoplay||!1,c._format=typeof s.format!="string"?s.format:[s.format],c._html5=s.html5||!1,c._muted=s.mute||!1,c._loop=s.loop||!1,c._pool=s.pool||5,c._preload=typeof s.preload=="boolean"||s.preload==="metadata"?s.preload:!0,c._rate=s.rate||1,c._sprite=s.sprite||{},c._src=typeof s.src!="string"?s.src:[s.src],c._volume=s.volume!==void 0?s.volume:1,c._xhr={method:s.xhr&&s.xhr.method?s.xhr.method:"GET",headers:s.xhr&&s.xhr.headers?s.xhr.headers:null,withCredentials:s.xhr&&s.xhr.withCredentials?s.xhr.withCredentials:!1},c._duration=0,c._state="unloaded",c._sounds=[],c._endTimers={},c._queue=[],c._playLock=!1,c._onend=s.onend?[{fn:s.onend}]:[],c._onfade=s.onfade?[{fn:s.onfade}]:[],c._onload=s.onload?[{fn:s.onload}]:[],c._onloaderror=s.onloaderror?[{fn:s.onloaderror}]:[],c._onplayerror=s.onplayerror?[{fn:s.onplayerror}]:[],c._onpause=s.onpause?[{fn:s.onpause}]:[],c._onplay=s.onplay?[{fn:s.onplay}]:[],c._onstop=s.onstop?[{fn:s.onstop}]:[],c._onmute=s.onmute?[{fn:s.onmute}]:[],c._onvolume=s.onvolume?[{fn:s.onvolume}]:[],c._onrate=s.onrate?[{fn:s.onrate}]:[],c._onseek=s.onseek?[{fn:s.onseek}]:[],c._onunlock=s.onunlock?[{fn:s.onunlock}]:[],c._onresume=[],c._webAudio=n.usingWebAudio&&!c._html5,typeof n.ctx<"u"&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(c),c._autoplay&&c._queue.push({event:"play",action:function(){c.play()}}),c._preload&&c._preload!=="none"&&c.load(),c},load:function(){var s=this,c=null;if(n.noAudio){s._emit("loaderror",null,"No audio support.");return}typeof s._src=="string"&&(s._src=[s._src]);for(var p=0;p<s._src.length;p++){var y,k;if(s._format&&s._format[p])y=s._format[p];else{if(k=s._src[p],typeof k!="string"){s._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}y=/^data:audio\/([^;,]+);/i.exec(k),y||(y=/\.([^.]+)$/.exec(k.split("?",1)[0])),y&&(y=y[1].toLowerCase())}if(y||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),y&&n.codecs(y)){c=s._src[p];break}}if(!c){s._emit("loaderror",null,"No codec support for selected audio sources.");return}return s._src=c,s._state="loading",window.location.protocol==="https:"&&c.slice(0,5)==="http:"&&(s._html5=!0,s._webAudio=!1),new t(s),s._webAudio&&o(s),s},play:function(s,c){var p=this,y=null;if(typeof s=="number")y=s,s=null;else{if(typeof s=="string"&&p._state==="loaded"&&!p._sprite[s])return null;if(typeof s>"u"&&(s="__default",!p._playLock)){for(var k=0,x=0;x<p._sounds.length;x++)p._sounds[x]._paused&&!p._sounds[x]._ended&&(k++,y=p._sounds[x]._id);k===1?s=null:y=null}}var A=y?p._soundById(y):p._inactiveSound();if(!A)return null;if(y&&!s&&(s=A._sprite||"__default"),p._state!=="loaded"){A._sprite=s,A._ended=!1;var z=A._id;return p._queue.push({event:"play",action:function(){p.play(z)}}),z}if(y&&!A._paused)return c||p._loadQueue("play"),A._id;p._webAudio&&n._autoResume();var Y=Math.max(0,A._seek>0?A._seek:p._sprite[s][0]/1e3),re=Math.max(0,(p._sprite[s][0]+p._sprite[s][1])/1e3-Y),_e=re*1e3/Math.abs(A._rate),Le=p._sprite[s][0]/1e3,Ye=(p._sprite[s][0]+p._sprite[s][1])/1e3;A._sprite=s,A._ended=!1;var $e=function(){A._paused=!1,A._seek=Y,A._start=Le,A._stop=Ye,A._loop=!!(A._loop||p._sprite[s][2])};if(Y>=Ye){p._ended(A);return}var he=A._node;if(p._webAudio){var mt=function(){p._playLock=!1,$e(),p._refreshBuffer(A);var ft=A._muted||p._muted?0:A._volume;he.gain.setValueAtTime(ft,n.ctx.currentTime),A._playStart=n.ctx.currentTime,typeof he.bufferSource.start>"u"?A._loop?he.bufferSource.noteGrainOn(0,Y,86400):he.bufferSource.noteGrainOn(0,Y,re):A._loop?he.bufferSource.start(0,Y,86400):he.bufferSource.start(0,Y,re),_e!==1/0&&(p._endTimers[A._id]=setTimeout(p._ended.bind(p,A),_e)),c||setTimeout(function(){p._emit("play",A._id),p._loadQueue()},0)};n.state==="running"&&n.ctx.state!=="interrupted"?mt():(p._playLock=!0,p.once("resume",mt),p._clearTimer(A._id))}else{var ct=function(){he.currentTime=Y,he.muted=A._muted||p._muted||n._muted||he.muted,he.volume=A._volume*n.volume(),he.playbackRate=A._rate;try{var ft=he.play();if(ft&&typeof Promise<"u"&&(ft instanceof Promise||typeof ft.then=="function")?(p._playLock=!0,$e(),ft.then(function(){p._playLock=!1,he._unlocked=!0,c?p._loadQueue():p._emit("play",A._id)}).catch(function(){p._playLock=!1,p._emit("playerror",A._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),A._ended=!0,A._paused=!0})):c||(p._playLock=!1,$e(),p._emit("play",A._id)),he.playbackRate=A._rate,he.paused){p._emit("playerror",A._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}s!=="__default"||A._loop?p._endTimers[A._id]=setTimeout(p._ended.bind(p,A),_e):(p._endTimers[A._id]=function(){p._ended(A),he.removeEventListener("ended",p._endTimers[A._id],!1)},he.addEventListener("ended",p._endTimers[A._id],!1))}catch(xi){p._emit("playerror",A._id,xi)}};he.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(he.src=p._src,he.load());var qt=window&&window.ejecta||!he.readyState&&n._navigator.isCocoonJS;if(he.readyState>=3||qt)ct();else{p._playLock=!0,p._state="loading";var pt=function(){p._state="loaded",ct(),he.removeEventListener(n._canPlayEvent,pt,!1)};he.addEventListener(n._canPlayEvent,pt,!1),p._clearTimer(A._id)}}return A._id},pause:function(s){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"pause",action:function(){c.pause(s)}}),c;for(var p=c._getSoundIds(s),y=0;y<p.length;y++){c._clearTimer(p[y]);var k=c._soundById(p[y]);if(k&&!k._paused&&(k._seek=c.seek(p[y]),k._rateSeek=0,k._paused=!0,c._stopFade(p[y]),k._node))if(c._webAudio){if(!k._node.bufferSource)continue;typeof k._node.bufferSource.stop>"u"?k._node.bufferSource.noteOff(0):k._node.bufferSource.stop(0),c._cleanBuffer(k._node)}else(!isNaN(k._node.duration)||k._node.duration===1/0)&&k._node.pause();arguments[1]||c._emit("pause",k?k._id:null)}return c},stop:function(s,c){var p=this;if(p._state!=="loaded"||p._playLock)return p._queue.push({event:"stop",action:function(){p.stop(s)}}),p;for(var y=p._getSoundIds(s),k=0;k<y.length;k++){p._clearTimer(y[k]);var x=p._soundById(y[k]);x&&(x._seek=x._start||0,x._rateSeek=0,x._paused=!0,x._ended=!0,p._stopFade(y[k]),x._node&&(p._webAudio?x._node.bufferSource&&(typeof x._node.bufferSource.stop>"u"?x._node.bufferSource.noteOff(0):x._node.bufferSource.stop(0),p._cleanBuffer(x._node)):(!isNaN(x._node.duration)||x._node.duration===1/0)&&(x._node.currentTime=x._start||0,x._node.pause(),x._node.duration===1/0&&p._clearSound(x._node))),c||p._emit("stop",x._id))}return p},mute:function(s,c){var p=this;if(p._state!=="loaded"||p._playLock)return p._queue.push({event:"mute",action:function(){p.mute(s,c)}}),p;if(typeof c>"u")if(typeof s=="boolean")p._muted=s;else return p._muted;for(var y=p._getSoundIds(c),k=0;k<y.length;k++){var x=p._soundById(y[k]);x&&(x._muted=s,x._interval&&p._stopFade(x._id),p._webAudio&&x._node?x._node.gain.setValueAtTime(s?0:x._volume,n.ctx.currentTime):x._node&&(x._node.muted=n._muted?!0:s),p._emit("mute",x._id))}return p},volume:function(){var s=this,c=arguments,p,y;if(c.length===0)return s._volume;if(c.length===1||c.length===2&&typeof c[1]>"u"){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):p=parseFloat(c[0])}else c.length>=2&&(p=parseFloat(c[0]),y=parseInt(c[1],10));var A;if(typeof p<"u"&&p>=0&&p<=1){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"volume",action:function(){s.volume.apply(s,c)}}),s;typeof y>"u"&&(s._volume=p),y=s._getSoundIds(y);for(var z=0;z<y.length;z++)A=s._soundById(y[z]),A&&(A._volume=p,c[2]||s._stopFade(y[z]),s._webAudio&&A._node&&!A._muted?A._node.gain.setValueAtTime(p,n.ctx.currentTime):A._node&&!A._muted&&(A._node.volume=p*n.volume()),s._emit("volume",A._id))}else return A=y?s._soundById(y):s._sounds[0],A?A._volume:0;return s},fade:function(s,c,p,y){var k=this;if(k._state!=="loaded"||k._playLock)return k._queue.push({event:"fade",action:function(){k.fade(s,c,p,y)}}),k;s=Math.min(Math.max(0,parseFloat(s)),1),c=Math.min(Math.max(0,parseFloat(c)),1),p=parseFloat(p),k.volume(s,y);for(var x=k._getSoundIds(y),A=0;A<x.length;A++){var z=k._soundById(x[A]);if(z){if(y||k._stopFade(x[A]),k._webAudio&&!z._muted){var Y=n.ctx.currentTime,re=Y+p/1e3;z._volume=s,z._node.gain.setValueAtTime(s,Y),z._node.gain.linearRampToValueAtTime(c,re)}k._startFadeInterval(z,s,c,p,x[A],typeof y>"u")}}return k},_startFadeInterval:function(s,c,p,y,k,x){var A=this,z=c,Y=p-c,re=Math.abs(Y/.01),_e=Math.max(4,re>0?y/re:y),Le=Date.now();s._fadeTo=p,s._interval=setInterval(function(){var Ye=(Date.now()-Le)/y;Le=Date.now(),z+=Y*Ye,z=Math.round(z*100)/100,Y<0?z=Math.max(p,z):z=Math.min(p,z),A._webAudio?s._volume=z:A.volume(z,s._id,!0),x&&(A._volume=z),(p<c&&z<=p||p>c&&z>=p)&&(clearInterval(s._interval),s._interval=null,s._fadeTo=null,A.volume(p,s._id),A._emit("fade",s._id))},_e)},_stopFade:function(s){var c=this,p=c._soundById(s);return p&&p._interval&&(c._webAudio&&p._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(p._interval),p._interval=null,c.volume(p._fadeTo,s),p._fadeTo=null,c._emit("fade",s)),c},loop:function(){var s=this,c=arguments,p,y,k;if(c.length===0)return s._loop;if(c.length===1)if(typeof c[0]=="boolean")p=c[0],s._loop=p;else return k=s._soundById(parseInt(c[0],10)),k?k._loop:!1;else c.length===2&&(p=c[0],y=parseInt(c[1],10));for(var x=s._getSoundIds(y),A=0;A<x.length;A++)k=s._soundById(x[A]),k&&(k._loop=p,s._webAudio&&k._node&&k._node.bufferSource&&(k._node.bufferSource.loop=p,p&&(k._node.bufferSource.loopStart=k._start||0,k._node.bufferSource.loopEnd=k._stop,s.playing(x[A])&&(s.pause(x[A],!0),s.play(x[A],!0)))));return s},rate:function(){var s=this,c=arguments,p,y;if(c.length===0)y=s._sounds[0]._id;else if(c.length===1){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):p=parseFloat(c[0])}else c.length===2&&(p=parseFloat(c[0]),y=parseInt(c[1],10));var A;if(typeof p=="number"){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"rate",action:function(){s.rate.apply(s,c)}}),s;typeof y>"u"&&(s._rate=p),y=s._getSoundIds(y);for(var z=0;z<y.length;z++)if(A=s._soundById(y[z]),A){s.playing(y[z])&&(A._rateSeek=s.seek(y[z]),A._playStart=s._webAudio?n.ctx.currentTime:A._playStart),A._rate=p,s._webAudio&&A._node&&A._node.bufferSource?A._node.bufferSource.playbackRate.setValueAtTime(p,n.ctx.currentTime):A._node&&(A._node.playbackRate=p);var Y=s.seek(y[z]),re=(s._sprite[A._sprite][0]+s._sprite[A._sprite][1])/1e3-Y,_e=re*1e3/Math.abs(A._rate);(s._endTimers[y[z]]||!A._paused)&&(s._clearTimer(y[z]),s._endTimers[y[z]]=setTimeout(s._ended.bind(s,A),_e)),s._emit("rate",A._id)}}else return A=s._soundById(y),A?A._rate:s._rate;return s},seek:function(){var s=this,c=arguments,p,y;if(c.length===0)s._sounds.length&&(y=s._sounds[0]._id);else if(c.length===1){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):s._sounds.length&&(y=s._sounds[0]._id,p=parseFloat(c[0]))}else c.length===2&&(p=parseFloat(c[0]),y=parseInt(c[1],10));if(typeof y>"u")return 0;if(typeof p=="number"&&(s._state!=="loaded"||s._playLock))return s._queue.push({event:"seek",action:function(){s.seek.apply(s,c)}}),s;var A=s._soundById(y);if(A)if(typeof p=="number"&&p>=0){var z=s.playing(y);z&&s.pause(y,!0),A._seek=p,A._ended=!1,s._clearTimer(y),!s._webAudio&&A._node&&!isNaN(A._node.duration)&&(A._node.currentTime=p);var Y=function(){z&&s.play(y,!0),s._emit("seek",y)};if(z&&!s._webAudio){var re=function(){s._playLock?setTimeout(re,0):Y()};setTimeout(re,0)}else Y()}else if(s._webAudio){var _e=s.playing(y)?n.ctx.currentTime-A._playStart:0,Le=A._rateSeek?A._rateSeek-A._seek:0;return A._seek+(Le+_e*Math.abs(A._rate))}else return A._node.currentTime;return s},playing:function(s){var c=this;if(typeof s=="number"){var p=c._soundById(s);return p?!p._paused:!1}for(var y=0;y<c._sounds.length;y++)if(!c._sounds[y]._paused)return!0;return!1},duration:function(s){var c=this,p=c._duration,y=c._soundById(s);return y&&(p=c._sprite[y._sprite][1]/1e3),p},state:function(){return this._state},unload:function(){for(var s=this,c=s._sounds,p=0;p<c.length;p++)c[p]._paused||s.stop(c[p]._id),s._webAudio||(s._clearSound(c[p]._node),c[p]._node.removeEventListener("error",c[p]._errorFn,!1),c[p]._node.removeEventListener(n._canPlayEvent,c[p]._loadFn,!1),c[p]._node.removeEventListener("ended",c[p]._endFn,!1),n._releaseHtml5Audio(c[p]._node)),delete c[p]._node,s._clearTimer(c[p]._id);var y=n._howls.indexOf(s);y>=0&&n._howls.splice(y,1);var k=!0;for(p=0;p<n._howls.length;p++)if(n._howls[p]._src===s._src||s._src.indexOf(n._howls[p]._src)>=0){k=!1;break}return i&&k&&delete i[s._src],n.noAudio=!1,s._state="unloaded",s._sounds=[],s=null,null},on:function(s,c,p,y){var k=this,x=k["_on"+s];return typeof c=="function"&&x.push(y?{id:p,fn:c,once:y}:{id:p,fn:c}),k},off:function(s,c,p){var y=this,k=y["_on"+s],x=0;if(typeof c=="number"&&(p=c,c=null),c||p)for(x=0;x<k.length;x++){var A=p===k[x].id;if(c===k[x].fn&&A||!c&&A){k.splice(x,1);break}}else if(s)y["_on"+s]=[];else{var z=Object.keys(y);for(x=0;x<z.length;x++)z[x].indexOf("_on")===0&&Array.isArray(y[z[x]])&&(y[z[x]]=[])}return y},once:function(s,c,p){var y=this;return y.on(s,c,p,1),y},_emit:function(s,c,p){for(var y=this,k=y["_on"+s],x=k.length-1;x>=0;x--)(!k[x].id||k[x].id===c||s==="load")&&(setTimeout(function(A){A.call(this,c,p)}.bind(y,k[x].fn),0),k[x].once&&y.off(s,k[x].fn,k[x].id));return y._loadQueue(s),y},_loadQueue:function(s){var c=this;if(c._queue.length>0){var p=c._queue[0];p.event===s&&(c._queue.shift(),c._loadQueue()),s||p.action()}return c},_ended:function(s){var c=this,p=s._sprite;if(!c._webAudio&&s._node&&!s._node.paused&&!s._node.ended&&s._node.currentTime<s._stop)return setTimeout(c._ended.bind(c,s),100),c;var y=!!(s._loop||c._sprite[p][2]);if(c._emit("end",s._id),!c._webAudio&&y&&c.stop(s._id,!0).play(s._id),c._webAudio&&y){c._emit("play",s._id),s._seek=s._start||0,s._rateSeek=0,s._playStart=n.ctx.currentTime;var k=(s._stop-s._start)*1e3/Math.abs(s._rate);c._endTimers[s._id]=setTimeout(c._ended.bind(c,s),k)}return c._webAudio&&!y&&(s._paused=!0,s._ended=!0,s._seek=s._start||0,s._rateSeek=0,c._clearTimer(s._id),c._cleanBuffer(s._node),n._autoSuspend()),!c._webAudio&&!y&&c.stop(s._id,!0),c},_clearTimer:function(s){var c=this;if(c._endTimers[s]){if(typeof c._endTimers[s]!="function")clearTimeout(c._endTimers[s]);else{var p=c._soundById(s);p&&p._node&&p._node.removeEventListener("ended",c._endTimers[s],!1)}delete c._endTimers[s]}return c},_soundById:function(s){for(var c=this,p=0;p<c._sounds.length;p++)if(s===c._sounds[p]._id)return c._sounds[p];return null},_inactiveSound:function(){var s=this;s._drain();for(var c=0;c<s._sounds.length;c++)if(s._sounds[c]._ended)return s._sounds[c].reset();return new t(s)},_drain:function(){var s=this,c=s._pool,p=0,y=0;if(!(s._sounds.length<c)){for(y=0;y<s._sounds.length;y++)s._sounds[y]._ended&&p++;for(y=s._sounds.length-1;y>=0;y--){if(p<=c)return;s._sounds[y]._ended&&(s._webAudio&&s._sounds[y]._node&&s._sounds[y]._node.disconnect(0),s._sounds.splice(y,1),p--)}}},_getSoundIds:function(s){var c=this;if(typeof s>"u"){for(var p=[],y=0;y<c._sounds.length;y++)p.push(c._sounds[y]._id);return p}else return[s]},_refreshBuffer:function(s){var c=this;return s._node.bufferSource=n.ctx.createBufferSource(),s._node.bufferSource.buffer=i[c._src],s._panner?s._node.bufferSource.connect(s._panner):s._node.bufferSource.connect(s._node),s._node.bufferSource.loop=s._loop,s._loop&&(s._node.bufferSource.loopStart=s._start||0,s._node.bufferSource.loopEnd=s._stop||0),s._node.bufferSource.playbackRate.setValueAtTime(s._rate,n.ctx.currentTime),c},_cleanBuffer:function(s){var c=this,p=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(!s.bufferSource)return c;if(n._scratchBuffer&&s.bufferSource&&(s.bufferSource.onended=null,s.bufferSource.disconnect(0),p))try{s.bufferSource.buffer=n._scratchBuffer}catch{}return s.bufferSource=null,c},_clearSound:function(s){var c=/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent);c||(s.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(s){this._parent=s,this.init()};t.prototype={init:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,c._sounds.push(s),s.create(),s},create:function(){var s=this,c=s._parent,p=n._muted||s._muted||s._parent._muted?0:s._volume;return c._webAudio?(s._node=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),s._node.gain.setValueAtTime(p,n.ctx.currentTime),s._node.paused=!0,s._node.connect(n.masterGain)):n.noAudio||(s._node=n._obtainHtml5Audio(),s._errorFn=s._errorListener.bind(s),s._node.addEventListener("error",s._errorFn,!1),s._loadFn=s._loadListener.bind(s),s._node.addEventListener(n._canPlayEvent,s._loadFn,!1),s._endFn=s._endListener.bind(s),s._node.addEventListener("ended",s._endFn,!1),s._node.src=c._src,s._node.preload=c._preload===!0?"auto":c._preload,s._node.volume=p*n.volume(),s._node.load()),s},reset:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._rateSeek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,s},_errorListener:function(){var s=this;s._parent._emit("loaderror",s._id,s._node.error?s._node.error.code:0),s._node.removeEventListener("error",s._errorFn,!1)},_loadListener:function(){var s=this,c=s._parent;c._duration=Math.ceil(s._node.duration*10)/10,Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue()),s._node.removeEventListener(n._canPlayEvent,s._loadFn,!1)},_endListener:function(){var s=this,c=s._parent;c._duration===1/0&&(c._duration=Math.ceil(s._node.duration*10)/10,c._sprite.__default[1]===1/0&&(c._sprite.__default[1]=c._duration*1e3),c._ended(s)),s._node.removeEventListener("ended",s._endFn,!1)}};var i={},o=function(s){var c=s._src;if(i[c]){s._duration=i[c].duration,d(s);return}if(/^data:[^;]+;base64,/.test(c)){for(var p=atob(c.split(",")[1]),y=new Uint8Array(p.length),k=0;k<p.length;++k)y[k]=p.charCodeAt(k);l(y.buffer,s)}else{var x=new XMLHttpRequest;x.open(s._xhr.method,c,!0),x.withCredentials=s._xhr.withCredentials,x.responseType="arraybuffer",s._xhr.headers&&Object.keys(s._xhr.headers).forEach(function(A){x.setRequestHeader(A,s._xhr.headers[A])}),x.onload=function(){var A=(x.status+"")[0];if(A!=="0"&&A!=="2"&&A!=="3"){s._emit("loaderror",null,"Failed loading audio file with status: "+x.status+".");return}l(x.response,s)},x.onerror=function(){s._webAudio&&(s._html5=!0,s._webAudio=!1,s._sounds=[],delete i[c],s.load())},a(x)}},a=function(s){try{s.send()}catch{s.onerror()}},l=function(s,c){var p=function(){c._emit("loaderror",null,"Decoding audio data failed.")},y=function(k){k&&c._sounds.length>0?(i[c._src]=k,d(c,k)):p()};typeof Promise<"u"&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(s).then(y).catch(p):n.ctx.decodeAudioData(s,y,p)},d=function(s,c){c&&!s._duration&&(s._duration=c.duration),Object.keys(s._sprite).length===0&&(s._sprite={__default:[0,s._duration*1e3]}),s._state!=="loaded"&&(s._state="loaded",s._emit("load"),s._loadQueue())},f=function(){if(n.usingWebAudio){try{typeof AudioContext<"u"?n.ctx=new AudioContext:typeof webkitAudioContext<"u"?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var s=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),c=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),p=c?parseInt(c[1],10):null;if(s&&p&&p<9){var y=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!y&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:n,Howl:e}}),typeof Ao<"u"&&(Ao.Howler=n,Ao.Howl=e),typeof global<"u"?(global.HowlerGlobal=r,global.Howler=n,global.Howl=e,global.Sound=t):typeof window<"u"&&(window.HowlerGlobal=r,window.Howler=n,window.Howl=e,window.Sound=t)})();(function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(n){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var t=e._howls.length-1;t>=0;t--)e._howls[t].stereo(n);return e},HowlerGlobal.prototype.pos=function(n,e,t){var i=this;if(!i.ctx||!i.ctx.listener)return i;if(e=typeof e!="number"?i._pos[1]:e,t=typeof t!="number"?i._pos[2]:t,typeof n=="number")i._pos=[n,e,t],typeof i.ctx.listener.positionX<"u"?(i.ctx.listener.positionX.setTargetAtTime(i._pos[0],Howler.ctx.currentTime,.1),i.ctx.listener.positionY.setTargetAtTime(i._pos[1],Howler.ctx.currentTime,.1),i.ctx.listener.positionZ.setTargetAtTime(i._pos[2],Howler.ctx.currentTime,.1)):i.ctx.listener.setPosition(i._pos[0],i._pos[1],i._pos[2]);else return i._pos;return i},HowlerGlobal.prototype.orientation=function(n,e,t,i,o,a){var l=this;if(!l.ctx||!l.ctx.listener)return l;var d=l._orientation;if(e=typeof e!="number"?d[1]:e,t=typeof t!="number"?d[2]:t,i=typeof i!="number"?d[3]:i,o=typeof o!="number"?d[4]:o,a=typeof a!="number"?d[5]:a,typeof n=="number")l._orientation=[n,e,t,i,o,a],typeof l.ctx.listener.forwardX<"u"?(l.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),l.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),l.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),l.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),l.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),l.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):l.ctx.listener.setOrientation(n,e,t,i,o,a);else return d;return l},Howl.prototype.init=function(n){return function(e){var t=this;return t._orientation=e.orientation||[1,0,0],t._stereo=e.stereo||null,t._pos=e.pos||null,t._pannerAttr={coneInnerAngle:typeof e.coneInnerAngle<"u"?e.coneInnerAngle:360,coneOuterAngle:typeof e.coneOuterAngle<"u"?e.coneOuterAngle:360,coneOuterGain:typeof e.coneOuterGain<"u"?e.coneOuterGain:0,distanceModel:typeof e.distanceModel<"u"?e.distanceModel:"inverse",maxDistance:typeof e.maxDistance<"u"?e.maxDistance:1e4,panningModel:typeof e.panningModel<"u"?e.panningModel:"HRTF",refDistance:typeof e.refDistance<"u"?e.refDistance:1,rolloffFactor:typeof e.rolloffFactor<"u"?e.rolloffFactor:1},t._onstereo=e.onstereo?[{fn:e.onstereo}]:[],t._onpos=e.onpos?[{fn:e.onpos}]:[],t._onorientation=e.onorientation?[{fn:e.onorientation}]:[],n.call(this,e)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,e){var t=this;if(!t._webAudio)return t;if(t._state!=="loaded")return t._queue.push({event:"stereo",action:function(){t.stereo(n,e)}}),t;var i=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof e>"u")if(typeof n=="number")t._stereo=n,t._pos=[n,0,0];else return t._stereo;for(var o=t._getSoundIds(e),a=0;a<o.length;a++){var l=t._soundById(o[a]);if(l)if(typeof n=="number")l._stereo=n,l._pos=[n,0,0],l._node&&(l._pannerAttr.panningModel="equalpower",(!l._panner||!l._panner.pan)&&r(l,i),i==="spatial"?typeof l._panner.positionX<"u"?(l._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),l._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),l._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):l._panner.setPosition(n,0,0):l._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),t._emit("stereo",l._id);else return l._stereo}return t},Howl.prototype.pos=function(n,e,t,i){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"pos",action:function(){o.pos(n,e,t,i)}}),o;if(e=typeof e!="number"?0:e,t=typeof t!="number"?-.5:t,typeof i>"u")if(typeof n=="number")o._pos=[n,e,t];else return o._pos;for(var a=o._getSoundIds(i),l=0;l<a.length;l++){var d=o._soundById(a[l]);if(d)if(typeof n=="number")d._pos=[n,e,t],d._node&&((!d._panner||d._panner.pan)&&r(d,"spatial"),typeof d._panner.positionX<"u"?(d._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(t,Howler.ctx.currentTime)):d._panner.setPosition(n,e,t)),o._emit("pos",d._id);else return d._pos}return o},Howl.prototype.orientation=function(n,e,t,i){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"orientation",action:function(){o.orientation(n,e,t,i)}}),o;if(e=typeof e!="number"?o._orientation[1]:e,t=typeof t!="number"?o._orientation[2]:t,typeof i>"u")if(typeof n=="number")o._orientation=[n,e,t];else return o._orientation;for(var a=o._getSoundIds(i),l=0;l<a.length;l++){var d=o._soundById(a[l]);if(d)if(typeof n=="number")d._orientation=[n,e,t],d._node&&(d._panner||(d._pos||(d._pos=o._pos||[0,0,-.5]),r(d,"spatial")),typeof d._panner.orientationX<"u"?(d._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),d._panner.orientationY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.orientationZ.setValueAtTime(t,Howler.ctx.currentTime)):d._panner.setOrientation(n,e,t)),o._emit("orientation",d._id);else return d._orientation}return o},Howl.prototype.pannerAttr=function(){var n=this,e=arguments,t,i,o;if(!n._webAudio)return n;if(e.length===0)return n._pannerAttr;if(e.length===1)if(typeof e[0]=="object")t=e[0],typeof i>"u"&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),n._pannerAttr={coneInnerAngle:typeof t.pannerAttr.coneInnerAngle<"u"?t.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:typeof t.pannerAttr.coneOuterAngle<"u"?t.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:typeof t.pannerAttr.coneOuterGain<"u"?t.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:typeof t.pannerAttr.distanceModel<"u"?t.pannerAttr.distanceModel:n._distanceModel,maxDistance:typeof t.pannerAttr.maxDistance<"u"?t.pannerAttr.maxDistance:n._maxDistance,refDistance:typeof t.pannerAttr.refDistance<"u"?t.pannerAttr.refDistance:n._refDistance,rolloffFactor:typeof t.pannerAttr.rolloffFactor<"u"?t.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:typeof t.pannerAttr.panningModel<"u"?t.pannerAttr.panningModel:n._panningModel});else return o=n._soundById(parseInt(e[0],10)),o?o._pannerAttr:n._pannerAttr;else e.length===2&&(t=e[0],i=parseInt(e[1],10));for(var a=n._getSoundIds(i),l=0;l<a.length;l++)if(o=n._soundById(a[l]),o){var d=o._pannerAttr;d={coneInnerAngle:typeof t.coneInnerAngle<"u"?t.coneInnerAngle:d.coneInnerAngle,coneOuterAngle:typeof t.coneOuterAngle<"u"?t.coneOuterAngle:d.coneOuterAngle,coneOuterGain:typeof t.coneOuterGain<"u"?t.coneOuterGain:d.coneOuterGain,distanceModel:typeof t.distanceModel<"u"?t.distanceModel:d.distanceModel,maxDistance:typeof t.maxDistance<"u"?t.maxDistance:d.maxDistance,refDistance:typeof t.refDistance<"u"?t.refDistance:d.refDistance,rolloffFactor:typeof t.rolloffFactor<"u"?t.rolloffFactor:d.rolloffFactor,panningModel:typeof t.panningModel<"u"?t.panningModel:d.panningModel};var f=o._panner;f||(o._pos||(o._pos=n._pos||[0,0,-.5]),r(o,"spatial"),f=o._panner),f.coneInnerAngle=d.coneInnerAngle,f.coneOuterAngle=d.coneOuterAngle,f.coneOuterGain=d.coneOuterGain,f.distanceModel=d.distanceModel,f.maxDistance=d.maxDistance,f.refDistance=d.refDistance,f.rolloffFactor=d.rolloffFactor,f.panningModel=d.panningModel}return n},Sound.prototype.init=function(n){return function(){var e=this,t=e._parent;e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,n.call(this),e._stereo?t.stereo(e._stereo):e._pos&&t.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}}(Sound.prototype.init),Sound.prototype.reset=function(n){return function(){var e=this,t=e._parent;return e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,e._stereo?t.stereo(e._stereo):e._pos?t.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,t._refreshBuffer(e)),n.call(this)}}(Sound.prototype.reset);var r=function(n,e){e=e||"spatial",e==="spatial"?(n._panner=Howler.ctx.createPanner(),n._panner.coneInnerAngle=n._pannerAttr.coneInnerAngle,n._panner.coneOuterAngle=n._pannerAttr.coneOuterAngle,n._panner.coneOuterGain=n._pannerAttr.coneOuterGain,n._panner.distanceModel=n._pannerAttr.distanceModel,n._panner.maxDistance=n._pannerAttr.maxDistance,n._panner.refDistance=n._pannerAttr.refDistance,n._panner.rolloffFactor=n._pannerAttr.rolloffFactor,n._panner.panningModel=n._pannerAttr.panningModel,typeof n._panner.positionX<"u"?(n._panner.positionX.setValueAtTime(n._pos[0],Howler.ctx.currentTime),n._panner.positionY.setValueAtTime(n._pos[1],Howler.ctx.currentTime),n._panner.positionZ.setValueAtTime(n._pos[2],Howler.ctx.currentTime)):n._panner.setPosition(n._pos[0],n._pos[1],n._pos[2]),typeof n._panner.orientationX<"u"?(n._panner.orientationX.setValueAtTime(n._orientation[0],Howler.ctx.currentTime),n._panner.orientationY.setValueAtTime(n._orientation[1],Howler.ctx.currentTime),n._panner.orientationZ.setValueAtTime(n._orientation[2],Howler.ctx.currentTime)):n._panner.setOrientation(n._orientation[0],n._orientation[1],n._orientation[2])):(n._panner=Howler.ctx.createStereoPanner(),n._panner.pan.setValueAtTime(n._stereo,Howler.ctx.currentTime)),n._panner.connect(n._node),n._paused||n._parent.pause(n._id,!0).play(n._id,!0)}})()});var us=ka((s2,Bo)=>{(function(r){"use strict";function n(u){if(Array.isArray(u)){for(var h=0,m=Array(u.length);h<u.length;h++)m[h]=u[h];return m}return Array.from(u)}function e(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?u:h}function t(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}function i(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function o(u,h){if(h||(h=typeof window>"u"?global:window),h[u]!==void 0)return h[u];if(Ti===null){var m=window.getComputedStyle(document.documentElement,"");Ti=(Array.prototype.slice.call(m).join("").match(/-(moz|webkit|ms)-/)||m.OLink===""&&["","o"]||["",""])[1]}if(Ti==="")return null;var w=u.charAt(0).toUpperCase()+u.substr(1),C=h[Ti+w];return C!==void 0?C:null}function a(u,h,m,w,C,T,O){if(typeof w!="function")throw new TypeError("Invalid animation rule:",w);var N=u-m,R=N/C,W=0;R>1&&(R=1),R!==1&&(W=w(R),isFinite(W)&&!isNaN(W)&&(R=W)),h&&h(R),N<C?O.frame=Ur(function(U){return a(U,h,m,w,C,T,O)}):(T&&T(),O.inProgress=!1)}function l(){Array.prototype.constructor.apply(this,arguments)}function d(u){if(!(u instanceof DOMException&&u.result===2152923147))throw u}function f(u,h){return h.replace(va,function(m,w){var C=u[w];return C!==void 0?C:m})}function s(u){return u.majorTicks instanceof Array||(u.majorTicks=u.majorTicks?[u.majorTicks]:[]),u.majorTicks.length||(u.majorTicks.push(Z.formatMajorTickNumber(u.minValue,u)),u.majorTicks.push(Z.formatMajorTickNumber(u.maxValue,u))),[u.tickSide!=="right",u.tickSide!=="left"]}function c(u,h,m,w,C,T){u.beginPath(),u.moveTo(h+T,m),u.lineTo(h+w-T,m),u.quadraticCurveTo(h+w,m,h+w,m+T),u.lineTo(h+w,m+C-T),u.quadraticCurveTo(h+w,m+C,h+w-T,m+C),u.lineTo(h+T,m+C),u.quadraticCurveTo(h,m+C,h,m+C-T),u.lineTo(h,m+T),u.quadraticCurveTo(h,m,h+T,m),u.closePath()}function p(u,h){var m=h.valueDec,w=h.valueInt,C=0,T=void 0,O=void 0,N=void 0;if(u=parseFloat(u),N=u<0,u=Math.abs(u),m>0){for(O=u.toFixed(m).toString().split("."),T=w-O[0].length;C<T;++C)O[0]="0"+O[0];O=(N?"-":"")+O[0]+"."+O[1]}else{for(O=Math.round(u).toString(),T=w-O.length;C<T;++C)O="0"+O;O=(N?"-":"")+O}return O}function y(u,h){var m=void 0,w=!1;return m=h.majorTicksDec===0?Math.round(u).toString():u.toFixed(h.majorTicksDec),h.majorTicksInt>1?(w=~m.indexOf("."),~m.indexOf("-")?"-"+[h.majorTicksInt+h.majorTicksDec+2+(w?1:0)-m.length].join("0")+m.replace("-",""):[h.majorTicksInt+h.majorTicksDec+1+(w?1:0)-m.length].join("0")+m):m}function k(u){return u*Math.PI/180}function x(u,h){return{x:-u*Math.sin(h),y:u*Math.cos(h)}}function A(u,h,m,w){var C=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,O=u.createLinearGradient(C?0:T,C?T:0,C?0:w,C?w:0);return O.addColorStop(0,h),O.addColorStop(1,m),O}function z(u,h){h.needleShadow&&(u.shadowOffsetX=2,u.shadowOffsetY=2,u.shadowBlur=10,u.shadowColor=h.colorNeedleShadowDown)}function Y(u,h,m){return u["font"+h+"Style"]+" "+u["font"+h+"Weight"]+" "+u["font"+h+"Size"]*m+"px "+u["font"+h]}function re(u){u.shadowOffsetX=null,u.shadowOffsetY=null,u.shadowBlur=null,u.shadowColor="",u.strokeStyle=null,u.lineWidth=0,u.save()}function _e(u,h,m,w){h.valueTextShadow&&(u.shadowOffsetX=m,u.shadowOffsetY=m,u.shadowBlur=w,u.shadowColor=h.colorValueTextShadow)}function Le(u,h,m,w,C,T){if(h.valueBox){re(u);var O=h.valueDec?1+h.valueDec:0,N="9".repeat(Math.max.apply(null,[String(parseInt(m)).length+O].concat(h.majorTicks.map(function(we){return String(parseInt(we,10)).length+O})))),R=h.valueText||p(m,h),W=T/200,U=T/100,q=.4*U,J=1.2*U;u.font=Y(h,"Value",W),_e(u,h,q,J);var le=u.measureText(h.valueText?R:"-"+p(Number(N),h)).width;re(u);var pe=parseFloat(h.fontValueSize)*W+q+J,Oe=U*parseFloat(h.valueBoxStroke),ge=2*T-2*Oe,Ne=le+10*U,We=1.1*pe+q+J,Be=U*h.valueBoxBorderRadius,ue=(parseFloat(h.valueBoxWidth)||0)/100*ge;ue>Ne&&(Ne=ue),Ne>ge&&(Ne=ge);var xe=w-Ne/2,ve=C-We/2,oe=C-5.75*U;if(u.beginPath(),Be?c(u,xe,ve,Ne,We,Be):u.rect(xe,ve,Ne,We),Oe){var ye=u.createRadialGradient(w,oe,10*U,w,oe,20*U);ye.addColorStop(0,h.colorValueBoxRect),ye.addColorStop(1,h.colorValueBoxRectEnd),u.strokeStyle=ye,u.lineWidth=Oe,u.stroke()}h.colorValueBoxShadow&&(u.shadowBlur=1.2*U,u.shadowColor=h.colorValueBoxShadow),h.colorValueBoxBackground&&(u.fillStyle=h.colorValueBoxBackground,u.fill()),u.closePath(),u.restore(),_e(u,h,q,J),u.fillStyle=h.colorValueText,u.textAlign="center",u.textBaseline="alphabetic",u.fillText(R,xe+Ne/2,C+We/2-pe/3),u.restore()}}function Ye(u){var h=u.value,m=u.minValue,w=u.maxValue,C=.01*(w-m);return{normal:h<m?m:h>w?w:h,indented:h<m?m-C:h>w?w+C:h}}function $e(u,h,m,w,C){m.beginPath(),m.arc(0,0,Ot(u),0,2*nn,!0),m.lineWidth=h,m.strokeStyle=C?Z.linearGradient(m,w,C,u):w,m.stroke(),m.closePath()}function he(u,h){var m=Ft.pixelRatio;return u.maxRadius||(u.maxRadius=u.max-h.borderShadowWidth-h.borderOuterWidth*m-h.borderMiddleWidth*m-h.borderInnerWidth*m+(h.borderOuterWidth?.5:0)+(h.borderMiddleWidth?.5:0)+(h.borderInnerWidth?.5:0)),u.maxRadius}function mt(u,h){function m(q,J,le,pe,Oe,ge){return J&&(!ge&&h.borderShadowWidth&&(le.save(),le.shadowBlur=h.borderShadowWidth,le.shadowColor=h.colorBorderShadow),$e(q,J*w,le,pe,Oe),!ge&&h.borderShadowWidth&&(ge=!0,le.restore())),ge}var w=Ft.pixelRatio,C=h.borderShadowWidth*w,T=u.max-C-h.borderOuterWidth*w/2,O=T-h.borderOuterWidth*w/2-h.borderMiddleWidth*w/2+.5,N=O-h.borderMiddleWidth*w/2-h.borderInnerWidth*w/2+.5,R=he(u,h),W=void 0,U=!1;u.save(),U=m(T,h.borderOuterWidth,u,h.colorBorderOuter,h.colorBorderOuterEnd,U),U=m(O,h.borderMiddleWidth,u,h.colorBorderMiddle,h.colorBorderMiddleEnd,U),U=m(N,h.borderInnerWidth,u,h.colorBorderInner,h.colorBorderInnerEnd,U),!U&&h.borderShadowWidth&&(u.shadowBlur=h.borderShadowWidth,u.shadowColor=h.colorBorderShadow),u.beginPath(),u.arc(0,0,Ot(R),0,2*nn,!0),h.colorPlateEnd?(W=u.createRadialGradient(0,0,R/2,0,0,R),W.addColorStop(0,h.colorPlate),W.addColorStop(1,h.colorPlateEnd)):W=h.colorPlate,u.fillStyle=W,u.fill(),u.closePath(),u.restore()}function ct(u,h){if(h.highlights!=="false"&&h.highlights.length&&h.highlightsWidth!==0){var m=u.max*(parseFloat(h.highlightsWidth)||0)/100,w=Ot(pt(u,h)-m/2),C=h.highlights.length,T=(h.maxValue-h.minValue)/h.ticksAngle;u.save();for(var O=0;O<C;O++){var N=h.highlights[O];u.lineWidth=m,u.lineCap=h.highlightsLineCap,u.strokeStyle=N.color,u.beginPath(),u.rotate(An),u.arc(0,0,w,Z.radians(h.startAngle+(N.from-h.minValue)/T),Z.radians(h.startAngle+(N.to-h.minValue)/T),!1),u.stroke(),u.closePath(),u.restore(),u.save()}u.restore()}}function qt(u,h){var m=pt(u,h),w=void 0,C=void 0,T=void 0,O=0,N=Math.abs(h.minorTicks)||0,R=h.ticksAngle/(h.maxValue-h.minValue);h.exactTicks?(C=h.maxValue-h.minValue,w=N?C/N:0,O=(It.mod(h.majorTicks[0],N)||0)*R):w=N*(h.majorTicks.length-1),u.lineWidth=Ft.pixelRatio,u.strokeStyle=h.colorMinorTicks||h.colorStrokeTicks,u.save();for(var W=0;W<w;++W)(T=h.startAngle+O+W*(h.ticksAngle/w))<=h.ticksAngle+h.startAngle&&(u.rotate(Z.radians(T)),u.beginPath(),u.moveTo(0,m),u.lineTo(0,m-.075*u.max),Cn(u));u.restore()}function pt(u,h){var m=u.max/100;return he(u,h)-5*m-(h.barWidth?2*(parseFloat(h.barStrokeWidth)||0)+((parseFloat(h.barWidth)||0)+5)*m:0)}function ft(u,h){Z.prepareTicks(h);var m=Ot(pt(u,h)),w=void 0,C=h.majorTicks.length,T=Ft.pixelRatio;u.lineWidth=2*T,w=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(C).fill(h.colorStrokeTicks||h.colorMajorTicks);for(var O=0;O<C;++O)u.save(),u.strokeStyle=w[O],u.rotate(Z.radians(xi(h,h.exactTicks?h.majorTicks[O]:O,C))),u.beginPath(),u.moveTo(0,m),u.lineTo(0,m-.15*u.max),u.stroke(),u.closePath(),u.restore();h.strokeTicks&&(u.save(),u.strokeStyle=h.colorStrokeTicks||w[0],u.rotate(An),u.beginPath(),u.arc(0,0,m,Z.radians(h.startAngle),Z.radians(h.startAngle+h.ticksAngle),!1),u.stroke(),u.closePath(),u.restore())}function xi(u,h,m){if(u.exactTicks){var w=u.ticksAngle/(u.maxValue-u.minValue);return u.startAngle+w*(h-u.minValue)}return u.startAngle+h*(u.ticksAngle/(m-1))}function Cn(u){u.stroke(),u.restore(),u.closePath(),u.save()}function X(u,h){var m=pt(u,h)-.15*u.max,w={},C=0,T=h.majorTicks.length,O=h.animationTarget!=="needle",N=h.colorNumbers instanceof Array?h.colorNumbers:new Array(T).fill(h.colorNumbers),R=O?-(h.value-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle:0;for(O&&(u.save(),u.rotate(-Z.radians(R))),u.font=Z.font(h,"Numbers",u.max/200),u.lineWidth=0,u.textAlign="center",u.textBaseline="middle";C<T;++C){var W=R+xi(h,h.exactTicks?h.majorTicks[C]:C,T),U=u.measureText(h.majorTicks[C]).width,q=h.fontNumbersSize,J=Math.sqrt(U*U+q*q)/2,le=Z.radialPoint(m-J-h.numbersMargin/100*u.max,Z.radians(W));W===360&&(W=0),w[W]||(w[W]=!0,u.fillStyle=N[C],u.fillText(h.majorTicks[C],le.x,le.y))}O&&u.restore()}function ie(u,h){h.title&&(u.save(),u.font=Z.font(h,"Title",u.max/200),u.fillStyle=h.colorTitle,u.textAlign="center",u.fillText(h.title,0,-u.max/4.25,.8*u.max),u.restore())}function ae(u,h){h.units&&(u.save(),u.font=Z.font(h,"Units",u.max/200),u.fillStyle=h.colorUnits,u.textAlign="center",u.fillText(Z.formatContext(h,h.units),0,u.max/3.25,.8*u.max),u.restore())}function Me(u,h){if(h.needle){var m=h.animationTarget!=="needle",w=h.ticksAngle<360?Z.normalizedValue(h).indented:h.value,C=m?h.startAngle:h.startAngle+(w-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle;h.barStartPosition==="right"&&(C=h.startAngle+h.ticksAngle-(w-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle);var T=he(u,h),O=Ot(T/100*h.needleCircleSize),N=Ot(T/100*h.needleCircleSize*.75),R=Ot(T/100*h.needleEnd),W=Ot(h.needleStart?T/100*h.needleStart:0),U=T/100*h.needleWidth,q=T/100*h.needleWidth/2,J=Ft.pixelRatio;u.save(),Z.drawNeedleShadow(u,h),u.rotate(Z.radians(C)),u.fillStyle=Z.linearGradient(u,h.colorNeedle,h.colorNeedleEnd,R-W),h.needleType==="arrow"?(u.beginPath(),u.moveTo(-q,-W),u.lineTo(-U,0),u.lineTo(-1*J,R),u.lineTo(J,R),u.lineTo(U,0),u.lineTo(q,-W),u.closePath(),u.fill(),u.beginPath(),u.lineTo(-.5*J,R),u.lineTo(-1*J,R),u.lineTo(-U,0),u.lineTo(-q,-W),u.lineTo(q/2*J-2*J,-W),u.closePath(),u.fillStyle=h.colorNeedleShadowUp,u.fill()):(u.beginPath(),u.moveTo(-q,R),u.lineTo(-q,W),u.lineTo(q,W),u.lineTo(q,R),u.closePath(),u.fill()),u.restore(),h.needleCircleSize&&(u.save(),Z.drawNeedleShadow(u,h),h.needleCircleOuter&&(u.beginPath(),u.arc(0,0,O,0,2*nn,!0),u.fillStyle=Z.linearGradient(u,h.colorNeedleCircleOuter,h.colorNeedleCircleOuterEnd,O),u.fill(),u.closePath()),h.needleCircleInner&&(u.beginPath(),u.arc(0,0,N,0,2*nn,!0),u.fillStyle=Z.linearGradient(u,h.colorNeedleCircleInner,h.colorNeedleCircleInnerEnd,N),u.fill(),u.closePath()),u.restore())}}function nt(u,h,m){Z.drawValueBox(u,h,m,0,u.max-.33*u.max,u.max)}function gt(u){var h=u.startAngle,m=u.startAngle+u.ticksAngle,w=h,C=h+(Z.normalizedValue(u).normal-u.minValue)/(u.maxValue-u.minValue)*u.ticksAngle;if(u.barStartPosition==="middle"){var T=.5*(u.minValue+u.maxValue);u.value<T?(w=180-(T-Z.normalizedValue(u).normal)/(u.maxValue-u.minValue)*u.ticksAngle,C=180):(w=180,C=180+(Z.normalizedValue(u).normal-T)/(u.maxValue-u.minValue)*u.ticksAngle)}else u.barStartPosition==="right"&&(w=m-C+h,C=m);return{startAngle:w,endAngle:C}}function vt(u,h){var m=u.max/100,w=he(u,h)-5*m,C=parseFloat(h.barStrokeWidth+"")||0,T=(parseFloat(h.barWidth+"")||0)*m,O=w-2*C-T,N=(w-O)/2,R=O+N,W=C/R,U=h.startAngle,q=h.startAngle+h.ticksAngle;if(u.save(),u.rotate(An),C&&(u.beginPath(),u.arc(0,0,R,Z.radians(U)-W,Z.radians(q)+W,!1),u.strokeStyle=h.colorBarStroke,u.lineWidth=2*N,u.stroke(),u.closePath()),T&&(u.beginPath(),u.arc(0,0,R,Z.radians(U),Z.radians(q),!1),u.strokeStyle=h.colorBar,u.lineWidth=T,u.stroke(),u.closePath(),h.barShadow&&(u.save(),u.beginPath(),u.arc(0,0,w,Z.radians(U),Z.radians(q),!1),u.clip(),u.beginPath(),u.strokeStyle=h.colorBar,u.lineWidth=1,u.shadowBlur=h.barShadow,u.shadowColor=h.colorBarShadow,u.shadowOffsetX=0,u.shadowOffsetY=0,u.arc(0,0,w,Z.radians(h.startAngle),Z.radians(h.startAngle+h.ticksAngle),!1),u.stroke(),u.closePath(),u.restore()),h.barProgress)){var J=gt(h),le=J.startAngle,pe=J.endAngle;u.beginPath(),u.arc(0,0,R,Z.radians(le),Z.radians(pe),!1),u.strokeStyle=h.colorBarProgress,u.lineWidth=T,u.stroke(),u.closePath()}u.restore()}function Et(u){return u.options.animatedValue?u.options.value:u.value}function Ke(u,h,m,w,C,T,O,N){u.beginPath(),u.fillStyle=N?Z.linearGradient(u,O,N,C>T?C:T,T>C,C>T?m:w):O,h>0?Z.roundRect(u,m,w,C,T,h):u.rect(m,w,C,T),u.fill(),u.closePath()}function xn(u,h,m,w,C,T,O,N,R){u.beginPath(),u.lineWidth=h,u.strokeStyle=R?Z.linearGradient(u,N,R,O,!0,C):N,m>0?Z.roundRect(u,w,C,T,O,m):u.rect(w,C,T,O),u.stroke(),u.closePath()}function ht(u,h,m,w,C,T){function O(we,Te,Qe,_t){return we&&(!_t&&h.borderShadowWidth&&(u.save(),u.shadowBlur=h.borderShadowWidth,u.shadowColor=h.colorBorderShadow),xn(u,we*N,R,m+we*N/2-oe,w+we*N/2-oe,W,le,Te,Qe),oe+=.5*N,!_t&&h.borderShadowWidth&&(_t=!0,u.restore())),_t}var N=Ft.pixelRatio,R=h.borderRadius*N,W=C-h.borderShadowWidth-h.borderOuterWidth*N,U=W-h.borderOuterWidth*N-h.borderMiddleWidth*N,q=U-h.borderMiddleWidth*N-h.borderInnerWidth*N,J=q-h.borderInnerWidth*N,le=T-h.borderShadowWidth-h.borderOuterWidth*N,pe=le-h.borderOuterWidth*N-h.borderMiddleWidth*N,Oe=pe-h.borderMiddleWidth*N-h.borderInnerWidth*N,ge=Oe-h.borderInnerWidth*N,Ne=m-(U-W)/2,We=Ne-(q-U)/2,Be=We-(J-q)/2,ue=w-(pe-le)/2,xe=ue-(Oe-pe)/2,ve=xe-(ge-Oe)/2,oe=0,ye=!1;return u.save(),ye=O(h.borderOuterWidth,h.colorBorderOuter,h.colorBorderOuterEnd,ye),ye=O(h.borderMiddleWidth,h.colorBorderMiddle,h.colorBorderMiddleEnd,ye),ye=O(h.borderInnerWidth,h.colorBorderInner,h.colorBorderInnerEnd,ye),!ye&&h.borderShadowWidth&&(u.shadowBlur=h.borderShadowWidth,u.shadowColor=h.colorBorderShadow),Ke(u,R,Be,ve,J+2*oe,ge+2*oe,h.colorPlate,h.colorPlateEnd),u.restore(),[Be,ve,J,ge]}function Ze(u,h,m,w,C,T){var O=Ft.pixelRatio,N=T>=C,R=N?.85*C:T,W=N?T:C;m=N?Ce(m+(C-R)/2):m;var U=!!h.title,q=!!h.units,J=!!h.valueBox,le=void 0,pe=void 0,Oe=void 0;N?(pe=Ce(.05*W),le=Ce(.075*W),Oe=Ce(.11*W),U&&(W-=le,w+=le),q&&(W-=pe),J&&(W-=Oe)):(pe=le=Ce(.15*R),U&&(R-=le,w+=le),q&&(R-=pe));var ge=2*h.barStrokeWidth,Ne=h.barBeginCircle?Ce(R*h.barBeginCircle/200-ge/2):0,We=Ce(R*h.barWidth/100-ge),Be=Ce(W*h.barLength/100-ge),ue=Ce((W-Be)/2),xe=Ce(m+(N?R/2:ue+Ne)),ve=Ce(w+(N?W-ue-Ne+ge/2:R/2)),oe=!N||h.hasLeft&&h.hasRight?0:(h.hasRight?-1:1)*h.ticksWidth/100*R,ye=N||h.hasLeft&&h.hasRight?0:(h.hasRight?-1:1)*h.ticksWidth/100*R;return u.barDimensions={isVertical:N,width:R,length:W,barWidth:We,barLength:Be,strokeWidth:ge,barMargin:ue,radius:Ne,pixelRatio:O,barOffset:null,titleMargin:U?le:0,unitsMargin:q?pe:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:m+oe,Y:w+ye,x0:xe+oe,y0:ve+ye,baseX:m,baseY:w,ticksPadding:h.ticksPadding/100},u.barDimensions}function He(u,h,m,w,C,T,O){var N=Ze(u,h,w,C,T,O),R=N.isVertical,W=N.width,U=N.barWidth,q=N.barLength,J=N.strokeWidth,le=N.barMargin,pe=N.radius,Oe=N.x0,ge=N.y0,Ne=N.X,We=N.Y,Be=q;u.save(),u.beginPath();var ue=null;if(h.barBeginCircle){var xe=Z.radians(R?270:0),ve=Math.asin(U/2/pe),oe=Math.cos(ve),ye=Math.sin(ve),we=Oe+(R?pe*ye:pe*oe-J/2),Te=R?ge-pe*oe:ge+pe*ye,Qe=Ot(R?Te-ge:we-Oe);ue=Ce(Qe+pe);var _t=R?Ce(Oe-pe*ye):we,wt=R?Te:Ce(ge-pe*ye);m==="progress"&&(q=ue+(q-ue)*(Z.normalizedValue(h).normal-h.minValue)/(h.maxValue-h.minValue));var kt=Ce(we+q-ue+J/2),Kt=Ce(Te-q+ue-J/2);u.arc(Oe,ge,pe,xe+ve,xe-ve),R?(u.moveTo(we,wt),u.lineTo(we,Kt),u.lineTo(_t,Kt),u.lineTo(_t,wt)):(u.moveTo(we,wt),u.lineTo(kt,wt),u.lineTo(kt,Te),u.lineTo(we,Te))}else{var Pn=Ce(R?Ne+(W-U)/2:Ne+le),Mn=Ce(R?We+q+le:We+(W-U)/2);m==="progress"&&(q*=(h.value-h.minValue)/(h.maxValue-h.minValue)),R?u.rect(Pn,Mn,U,-q):u.rect(Pn,Mn,q,U)}m!=="progress"&&h.barStrokeWidth&&(u.lineWidth=J,u.strokeStyle=h.colorBarStroke,u.stroke()),m!=="progress"&&h.colorBar?(u.fillStyle=h.colorBarEnd?Z.linearGradient(u,h.colorBar,h.colorBarEnd,q,R,R?We:Ne):h.colorBar,u.fill()):m==="progress"&&h.colorBarProgress&&(u.fillStyle=h.colorBarProgressEnd?Z.linearGradient(u,h.colorBarProgress,h.colorBarProgressEnd,Be,R,R?We:Ne):h.colorBarProgress,u.fill()),u.closePath(),u.restore(),h.barBeginCircle&&(u.barDimensions.radius+=J),u.barDimensions.barOffset=ue,u.barDimensions.barWidth+=J,u.barDimensions.barLength+=J}function qe(u,h,m,w,C,T){He(u,h,"",m,w,C,T)}function Yt(u,h){return h.needleSide!==u||h.tickSide!==u||h.numberSide!==u}function di(u,h,m,w,C,T){h.barProgress&&He(u,h,"progress",m,w,C,T)}function en(u,h){var m=u.barDimensions,w=m.isVertical,C=m.width,T=m.length,O=m.barWidth,N=m.barOffset,R=m.barMargin,W=m.X,U=m.Y,q=m.ticksLength,J=m.ticksPadding,le=C*(parseFloat(h.highlightsWidth)||0)/100;if(h.highlights&&le){var pe=h.tickSide!=="right",Oe=h.tickSide!=="left",ge=0,Ne=h.highlights.length,We=(C-O)/2,Be=h.maxValue-h.minValue,ue=Ce(w?W+We:W+R+N),xe=le,ve=w?U+T-R-N:U+We,oe=Ce((h.ticksWidth/100+J)*C)+(le-h.ticksWidth/100*C),ye=Ce(O+J*C);for(u.save();ge<Ne;ge++){var we=h.highlights[ge],Te=q*Ot(h.minValue-we.from)/Be,Qe=q*Ot((we.to-we.from)/Be);u.beginPath(),u.fillStyle=we.color,w?(pe&&u.rect(ue-oe,ve-Te,xe,-Qe),Oe&&u.rect(ue+ye,ve-Te,xe,-Qe)):(pe&&u.rect(ue+Te,ve-oe,Qe,xe),Oe&&u.rect(ue+Te,ve+ye,Qe,xe)),u.fill(),u.closePath()}u.restore()}}function gi(u,h,m,w,C){u.beginPath(),u.moveTo(h,m),u.lineTo(w,C),u.stroke(),u.closePath()}function Mi(u,h,m,w,C,T,O,N,R){var W=u.barDimensions,U=W.isVertical,q=W.length,J=W.barWidth,le=W.barOffset,pe=W.barMargin,Oe=W.pixelRatio,ge=W.width,Ne=W.X,We=W.Y,Be=W.ticksLength,ue=W.ticksPadding,xe=(ge-J)/2,ve=void 0,oe=void 0,ye=0,we=m.length,Te=void 0,Qe=R*ge,_t=xe-ue*ge,wt=xe+J+Qe+ue*ge,kt=h instanceof Array?h:new Array(m.length).fill(h);u.save(),u.lineWidth=N*Oe;for(var Kt=Be/(C-w);ye<we;ye++)Te=m[ye],u.strokeStyle=kt[ye],U?(oe=We+q-pe-le+(w-Te)*Kt,T&&(ve=Ne+_t,gi(u,ve,oe,Ce(ve-Qe),oe)),O&&(ve=Ne+wt,gi(u,ve,oe,Ce(ve-Qe),oe))):(ve=Ne+pe+le-(w-Te)*Kt,T&&(oe=We+_t,gi(u,ve,oe,ve,Ce(oe-Qe))),O&&(oe=We+wt,gi(u,ve,Ce(oe),ve,oe-Qe)));u.restore()}function Qt(u,h){var m=Z.prepareTicks(h),w=vr(m,2),C=w[0],T=w[1],O=2,N=(h.maxValue-h.minValue)/(h.majorTicks.length-1),R=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(h.majorTicks.length).fill(h.colorStrokeTicks||h.colorMajorTicks);if(Mi(u,R,h.exactTicks?h.majorTicks:h.majorTicks.map(function(Qe,_t){return h.minValue+N*_t}),h.minValue,h.maxValue,C,T,O,h.ticksWidth/100),h.strokeTicks){var W=u.barDimensions,U=W.isVertical,q=W.length,J=W.width,le=W.barWidth,pe=W.barMargin,Oe=W.barOffset,ge=W.X,Ne=W.Y,We=W.ticksLength,Be=W.pixelRatio,ue=W.ticksPadding,xe=(J-le)/2+le+ue*J,ve=(J-le)/2-ue*J,oe=void 0,ye=void 0,we=void 0,Te=void 0;u.strokeStyle=h.colorStrokeTicks||R[0],O*=Be,U?(ye=Ne+q-pe-Oe+O/2,Te=ye-We-O,C&&(we=oe=Ce(ge+ve),Xt(u,oe,ye,we,Te)),T&&(we=oe=Ce(ge+xe),Xt(u,oe,ye,we,Te))):(oe=ge+pe+Oe-O/2,we=oe+We+O,C&&(Te=ye=Ce(Ne+ve),Xt(u,oe,ye,we,Te)),T&&(Te=ye=Ce(Ne+xe),Xt(u,oe,ye,we,Te)))}}function Xt(u,h,m,w,C){u.beginPath(),u.moveTo(h,m),u.lineTo(w,C),u.stroke(),u.closePath()}function Fr(u,h){var m=Z.prepareTicks(h),w=vr(m,2),C=w[0],T=w[1],O=[],N=h.minValue,R=Math.abs(h.minorTicks)||0,W=R?(h.maxValue-h.minValue)/(R*(h.majorTicks.length-1)):0;if(R)if(h.exactTicks)for(var U=It.mod(h.majorTicks[0],R)||0;N<h.maxValue;N+=R)U+N<h.maxValue&&O.push(U+N);else for(;N<h.maxValue;N+=W)O.push(N);Mi(u,h.colorMinorTicks||h.colorStrokeTicks,O,h.minValue,h.maxValue,C,T,1,h.ticksWidthMinor/100)}function Hr(u,h){var m=u.barDimensions,w=m.isVertical,C=m.length,T=m.width,O=m.barWidth,N=m.barMargin,R=m.barOffset,W=m.X,U=m.Y,q=m.ticksLength,J=m.ticksPadding,le=h.maxValue-h.minValue,pe=le/(h.majorTicks.length-1),Oe=h.exactTicks?h.majorTicks:h.majorTicks.map(function(kt,Kt){return h.minValue+pe*Kt}),ge=Oe.length,Ne=h.numberSide!=="right",We=h.numberSide!=="left",Be=h.fontNumbersSize*T/200,ue=0,xe=(h.ticksWidth/100+2*J)*T,ve=(T-O)/2-xe,oe=(T-O)/2+O+xe,ye=void 0,we=void 0,Te=void 0,Qe=void 0,_t=h.colorNumbers instanceof Array?h.colorNumbers:new Array(ge).fill(h.colorNumbers),wt=h.numbersMargin/100*T;for(u.font=Z.font(h,"Numbers",T/200),u.lineWidth=0,u.textAlign="center";ue<ge;ue++)u.fillStyle=_t[ue],Qe=h.majorTicks[ue],Te=h.exactTicks?q*((Oe[ue]-h.minValue)/le):ue*q/(ge-1),w?(we=U+C-N-R-Te+Be/3,Ne&&(u.textAlign="right",u.fillText(Qe,W+ve-wt,we)),We&&(u.textAlign="left",u.fillText(Qe,W+oe+wt,we))):(u.measureText(Qe).width,ye=W+N+R+Te,Ne&&u.fillText(Qe,ye,U+ve-wt),We&&u.fillText(Qe,ye,U+oe+Be+wt))}function Tn(u,h){if(h.title){var m=u.barDimensions,w=m.isVertical,C=m.width,T=m.length,O=m.baseX,N=m.baseY,R=m.titleMargin,W=h.fontTitleSize*C/200,U=Ce(O+(w?C:T)/2),q=Ce(N+R/2-(w?W:W/2)-.025*(w?T:C));u.save(),u.textAlign="center",u.fillStyle=h.colorTitle,u.font=Z.font(h,"Title",C/200),u.lineWidth=0,u.fillText(h.title,U,q,w?C:T),u.restore()}}function Mt(u,h){if(h.units){var m=u.barDimensions,w=m.isVertical,C=m.width,T=m.length,O=m.baseX,N=m.baseY,R=m.unitsMargin,W=h.fontUnitsSize*C/200,U=Ce(O+(w?C:T)/2),q=Ce(N+(w?T:C)+R/2-W/2);u.save(),u.textAlign="center",u.fillStyle=h.colorUnits,u.font=Z.font(h,"Units",C/200),u.lineWidth=0,u.fillText(Z.formatContext(h,h.units),U,q,w?C:T),u.restore()}}function ma(u,h){if(h.needle){var m=u.barDimensions,w=m.isVertical,C=m.width,T=m.length,O=m.barWidth,N=m.barOffset,R=m.barMargin,W=m.ticksLength,U=m.X,q=m.Y,J=m.ticksPadding,le=h.needleSide!=="right",pe=h.needleSide!=="left",Oe=W*(Z.normalizedValue(h).indented-h.minValue)/(h.maxValue-h.minValue),ge=(h.ticksWidth/100+J)*C,Ne=O/2+ge,We=Ne*(h.needleEnd/100),Be=void 0,ue=void 0,xe=void 0,ve=void 0,oe=h.needleType.toLowerCase()==="arrow"?fa:pa,ye=(C-O)/2,we=Ne*(h.needleStart/100),Te=ye-ge-we,Qe=ye+O+ge+we;u.save(),Z.drawNeedleShadow(u,h),w?(xe=Ce(q+T-R-N-Oe),le&&(Be=Ce(U+Te),ue=Be+We,oe(u,h,Be,xe,ue,xe,We)),pe&&(Be=Ce(U+Qe),ue=Be-We,oe(u,h,Be,xe,ue,xe,We,!0))):(Be=Ce(U+R+N+Oe),le&&(xe=Ce(q+Te),ve=xe+We,oe(u,h,Be,xe,Be,ve,We)),pe&&(xe=Ce(q+Qe),ve=xe-We,oe(u,h,Be,xe,Be,ve,We,!0))),u.restore()}}function Gr(u,h,m,w){return h.colorNeedleEnd?Z.linearGradient(u,w?h.colorNeedleEnd:h.colorNeedle,w?h.colorNeedle:h.colorNeedleEnd,m,!u.barDimensions.isVertical):h.colorNeedle}function pa(u,h,m,w,C,T,O,N){u.lineWidth=h.needleWidth,u.strokeStyle=Gr(u,h,O,N),u.beginPath(),u.moveTo(m,w),u.lineTo(C,T),u.stroke(),u.closePath()}function fa(u,h,m,w,C,T,O,N){var R=Ce(.4*O),W=O-R,U=m===C,q=h.needleWidth/2;u.fillStyle=Gr(u,h,O,N),u.beginPath(),U?(w>T&&(W*=-1),u.moveTo(m-q,w),u.lineTo(m+q,w),u.lineTo(m+q,w+W),u.lineTo(m,T),u.lineTo(m-q,w+W),u.lineTo(m-q,w)):(m>C&&(W*=-1),u.moveTo(m,w-q),u.lineTo(m,w+q),u.lineTo(m+W,w+q),u.lineTo(C,w),u.lineTo(m+W,w-q),u.lineTo(m,w-q)),u.fill(),u.closePath()}function ga(u,h,m,w,C,T,O){var N=(parseFloat(h.fontValueSize)||0)*T/200,R=(.11*O-N)/2;u.barDimensions.isVertical&&Z.drawValueBox(u,h,m,w+T/2,C+O-N-R,T)}var vr=function(){function u(h,m){var w=[],C=!0,T=!1,O=void 0;try{for(var N,R=h[Symbol.iterator]();!(C=(N=R.next()).done)&&(w.push(N.value),!m||w.length!==m);C=!0);}catch(W){T=!0,O=W}finally{try{!C&&R.return&&R.return()}finally{if(T)throw O}}return w}return function(h,m){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return u(h,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),En=function u(h,m,w){h===null&&(h=Function.prototype);var C=Object.getOwnPropertyDescriptor(h,m);if(C===void 0){var T=Object.getPrototypeOf(h);return T===null?void 0:u(T,m,w)}if("value"in C)return C.value;var O=C.get;if(O!==void 0)return O.call(w)},jr=function u(h,m,w,C){var T=Object.getOwnPropertyDescriptor(h,m);if(T===void 0){var O=Object.getPrototypeOf(h);O!==null&&u(O,m,w,C)}else if("value"in T&&T.writable)T.value=w;else{var N=T.set;N!==void 0&&N.call(C,w)}return w},vi=function(){function u(h,m){for(var w=0;w<m.length;w++){var C=m[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(h,C.key,C)}}return function(h,m,w){return m&&u(h.prototype,m),w&&u(h,w),h}}(),Ti=null,yr=function(){function u(){i(this,u),this._events={},this.addListener=this.on,this.removeListener=this.off}return vi(u,[{key:"emit",value:function(h){if(this._events[h]){for(var m=0,w=this._events[h].length,C=arguments.length,T=Array(C>1?C-1:0),O=1;O<C;O++)T[O-1]=arguments[O];for(;m<w;m++)this._events[h][m]&&this._events[h][m].apply(this,T)}}},{key:"once",value:function(h){for(var m=arguments.length,w=Array(m>1?m-1:0),C=1;C<m;C++)w[C-1]=arguments[C];for(var T=0,O=w.length,N=this;T<O;T++)(function(){var R=w[T],W=function U(){N.off(h,U),R.apply(N,arguments)};w[T]=W})();this.on.apply(this,[h].concat(w))}},{key:"on",value:function(h){this._events[h]||(this._events[h]=[]);for(var m=0,w=arguments.length<=1?0:arguments.length-1;m<w;m++)this._events[h].push(arguments.length<=m+1?void 0:arguments[m+1])}},{key:"off",value:function(h){if(this._events[h])for(var m=0,w=arguments.length<=1?0:arguments.length-1;m<w;m++)for(var C=arguments.length<=m+1?void 0:arguments[m+1],T=void 0;~(T=this._events[h].indexOf(C));)this._events[h].splice(T,1)}},{key:"removeAllListeners",value:function(h){delete this._events[h]}},{key:"listeners",get:function(){return this._events}}]),u}(),Ur=o("requestAnimationFrame")||function(u){return setTimeout(function(){return u(new Date().getTime())},1e3/60)},tn={linear:function(u){return u},quad:function(u){return Math.pow(u,2)},dequad:function(u){return 1-tn.quad(1-u)},quint:function(u){return Math.pow(u,5)},dequint:function(u){return 1-Math.pow(1-u,5)},cycle:function(u){return 1-Math.sin(Math.acos(u))},decycle:function(u){return Math.sin(Math.acos(1-u))},bounce:function(u){return 1-tn.debounce(1-u)},debounce:function(u){for(var h=0,m=1;;h+=m,m/=2)if(u>=(7-4*h)/11)return-Math.pow((11-6*h-11*u)/4,2)+Math.pow(m,2)},elastic:function(u){return 1-tn.delastic(1-u)},delastic:function(u){return Math.pow(2,10*(u-1))*Math.cos(20*Math.PI*1.5/3*u)}},br=function(){function u(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,u),this.duration=m,this.rule=h,this.draw=w,this.end=C,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",w);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",C)}return vi(u,[{key:"animate",value:function(h,m){var w=this;this.frame&&this.cancel();var C=window.performance&&window.performance.now?window.performance.now():o("animationStartTime")||Date.now();h=h||this.draw,m=m||this.end,this.draw=h,this.end=m,this.frame=Ur(function(T){return a(T,h,C,tn[w.rule]||w.rule,w.duration,m,w)})}},{key:"cancel",value:function(){this.frame&&((o("cancelAnimationFrame")||function(h){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),u}();br.rules=tn;var Oi=function(){function u(h,m,w){i(this,u),this.options=h,this.element=m.toLowerCase(),this.type=u.toDashed(w),this.Type=r[w],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||u.domReady(this.traverse.bind(this))}return vi(u,[{key:"isValidNode",value:function(h){return!(!h.tagName||h.tagName.toLowerCase()!==this.element||h.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var h=document.getElementsByTagName(this.element),m=0,w=h.length;m<w;m++)this.process(h[m]);this.isObservable&&!this.mutationsObserved&&(new MutationObserver(this.observe.bind(this)).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this.mutationsObserved=!0)}},{key:"observe",value:function(h){for(var m=0,w=h.length;m<w;m++){var C=h[m];if(C.type==="attributes"&&C.attributeName==="data-type"&&this.isValidNode(C.target)&&C.oldValue!==this.type)setTimeout(this.process.bind(this,C.target));else if(C.addedNodes&&C.addedNodes.length)for(var T=0,O=C.addedNodes.length;T<O;T++)setTimeout(this.process.bind(this,C.addedNodes[T]))}}},{key:"process",value:function(h){var m=this;if(!this.isValidNode(h))return null;var w=void 0,C=JSON.parse(JSON.stringify(this.options)),T=null;for(w in C)if(C.hasOwnProperty(w)){var O=u.toAttributeName(w),N=u.parse(h.getAttribute(O));N!=null&&(C[w]=N)}return C.renderTo=h,T=new this.Type(C),T.draw&&T.draw(),this.isObservable&&(T.observer=new MutationObserver(function(R){R.forEach(function(W){if(W.type==="attributes"){var U=W.attributeName.toLowerCase(),q=h.getAttribute(U).toLowerCase();if(U==="data-type"&&q&&q!==m.type)T.observer.disconnect(),delete T.observer,T.destroy&&T.destroy();else if(U.substr(0,5)==="data-"){var J=U.substr(5).split("-").map(function(pe,Oe){return Oe?pe.charAt(0).toUpperCase()+pe.substr(1):pe}).join(""),le={};le[J]=u.parse(h.getAttribute(W.attributeName)),J==="value"?T&&(T.value=le[J]):T.update&&T.update(le)}}})}),T.observer.observe(h,{attributes:!0})),T}}],[{key:"parse",value:function(h){if(h==="true")return!0;if(h==="false")return!1;if(h!=="undefined"){if(h==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(h))return h.split(",");try{return JSON.parse(h)}catch{}return h}}},{key:"toDashed",value:function(h){for(var m=h.split(/(?=[A-Z])/),w=1,C=m.length,T=m[0].toLowerCase();w<C;w++)T+="-"+m[w].toLowerCase();return T}},{key:"toCamelCase",value:function(h){for(var m=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],w=h.split(/-/),C=0,T=w.length,O="";C<T;C++)O+=C||m?w[C][0].toUpperCase()+w[C].substr(1).toLowerCase():w[C].toLowerCase();return O}},{key:"toAttributeName",value:function(h){return"data-"+u.toDashed(h)}},{key:"domReady",value:function(h){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return h();window.addEventListener?window.addEventListener("DOMContentLoaded",h,!1):window.attachEvent&&window.attachEvent("onload",h)}}]),u}(),Ft=function(){function u(h,m,w){i(this,u),u.collection.push(this),this.width=m||0,this.height=w||0,this.element=h,this.init()}return vi(u,[{key:"init",value:function(){var h=u.pixelRatio;this.element.width=this.width*h,this.element.height=this.height*h,this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.elementClone=this.element.cloneNode(!0),this.context=this.element.getContext("2d"),this.contextClone=this.elementClone.getContext("2d"),this.drawWidth=this.element.width,this.drawHeight=this.element.height,this.drawX=this.drawWidth/2,this.drawY=this.drawHeight/2,this.minSide=this.drawX<this.drawY?this.drawX:this.drawY,this.contextClone.translate(this.drawX,this.drawY),this.elementClone.initialized=!1,this.context.translate(this.drawX,this.drawY),this.context.max=this.contextClone.max=this.minSide,this.context.maxRadius=this.contextClone.maxRadius=null}},{key:"destroy",value:function(){var h=u.collection.indexOf(this);~h&&u.collection.splice(h,1),this.context.clearRect(-this.drawX,-this.drawY,this.drawWidth,this.drawHeight),this.context.max=null,delete this.context.max,this.context.maxRadius=null,delete this.context.maxRadius,this.context=null,this.contextClone=null,this.elementClone=null,this.element=null,this.onRedraw=null}},{key:"commit",value:function(){var h=u.pixelRatio;return h!==1&&this.contextClone.scale(h,h),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var h=0,m=u.collection.length;h<m;h++)u.collection[h].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),u}();Ft.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(Ft.redraw);var Ii={renderTo:null,width:0,height:0,minValue:0,maxValue:100,value:0,units:!1,exactTicks:!1,majorTicks:[0,20,40,60,80,100],minorTicks:10,strokeTicks:!0,animatedValue:!1,animateOnInit:!1,title:!1,borders:!0,numbersMargin:1,listeners:null,valueInt:3,valueDec:2,majorTicksInt:1,majorTicksDec:0,animation:!0,animationDuration:500,animationRule:"cycle",colorPlate:"#fff",colorPlateEnd:"",colorMajorTicks:"#444",colorMinorTicks:"#666",colorStrokeTicks:"",colorTitle:"#888",colorUnits:"#888",colorNumbers:"#444",colorNeedle:"rgba(240,128,128,1)",colorNeedleEnd:"rgba(255,160,122,.9)",colorValueText:"#444",colorValueTextShadow:"rgba(0,0,0,0.3)",colorBorderShadow:"rgba(0,0,0,0.5)",colorBorderOuter:"#ddd",colorBorderOuterEnd:"#aaa",colorBorderMiddle:"#eee",colorBorderMiddleEnd:"#f0f0f0",colorBorderInner:"#fafafa",colorBorderInnerEnd:"#ccc",colorValueBoxRect:"#888",colorValueBoxRectEnd:"#666",colorValueBoxBackground:"#babab2",colorValueBoxShadow:"rgba(0,0,0,1)",colorNeedleShadowUp:"rgba(2,255,255,0.2)",colorNeedleShadowDown:"rgba(188,143,143,0.45)",colorBarStroke:"#222",colorBar:"#ccc",colorBarProgress:"#888",colorBarShadow:"#000",fontNumbers:"Arial",fontTitle:"Arial",fontUnits:"Arial",fontValue:"Arial",fontNumbersSize:20,fontTitleSize:24,fontUnitsSize:22,fontValueSize:26,fontNumbersStyle:"normal",fontTitleStyle:"normal",fontUnitsStyle:"normal",fontValueStyle:"normal",fontNumbersWeight:"normal",fontTitleWeight:"normal",fontUnitsWeight:"normal",fontValueWeight:"normal",needle:!0,needleShadow:!0,needleType:"arrow",needleStart:5,needleEnd:85,needleWidth:4,borderOuterWidth:3,borderMiddleWidth:3,borderInnerWidth:3,borderShadowWidth:3,valueBox:!0,valueBoxStroke:5,valueBoxWidth:0,valueText:"",valueTextShadow:!0,valueBoxBorderRadius:2.5,highlights:[{from:20,to:60,color:"#eee"},{from:60,to:80,color:"#ccc"},{from:80,to:100,color:"#999"}],highlightsWidth:15,highlightsLineCap:"butt",barWidth:20,barStrokeWidth:0,barProgress:!0,barShadow:0};l.prototype=Object.create(Array.prototype),l.prototype.constructor=l,l.prototype.get=function(u){if(typeof u=="string")for(var h=0,m=this.length;h<m;h++){var w=this[h].options.renderTo.tagName?this[h].options.renderTo:document.getElementById(this[h].options.renderTo||"");if(w.getAttribute("id")===u)return this[h]}else if(typeof u=="number")return this[u];return null};var _r="2.2.1",Ce=Math.round,Ot=Math.abs,Ri=new l;Ri.version=_r;var It=function(u){function h(m){i(this,h);var w=e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this)),C=w.constructor.name;if(C==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(Ri.push(w),m.listeners&&Object.keys(m.listeners).forEach(function(O){(m.listeners[O]instanceof Array?m.listeners[O]:[m.listeners[O]]).forEach(function(N){w.on(O,N)})}),w.version=_r,w.type=r[C]||h,w.initialized=!1,m.minValue=parseFloat(m.minValue),m.maxValue=parseFloat(m.maxValue),m.value=parseFloat(m.value)||0,m.borders||(m.borderInnerWidth=m.borderMiddleWidth=m.borderOuterWidth=0),!m.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var T=m.renderTo.tagName?m.renderTo:document.getElementById(m.renderTo);if(!(T instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return m.width=parseFloat(m.width)||0,m.height=parseFloat(m.height)||0,m.width&&m.height||(m.width||(m.width=T.parentNode?T.parentNode.offsetWidth:T.offsetWidth),m.height||(m.height=T.parentNode?T.parentNode.offsetHeight:T.offsetHeight)),w.options=m||{},w.options.animateOnInit&&(w._value=w.options.value,w.options.value=w.options.minValue),w.canvas=new Ft(T,m.width,m.height),w.canvas.onRedraw=w.draw.bind(w),w.animation=new br(m.animationRule,m.animationDuration),w}return t(h,u),vi(h,[{key:"update",value:function(m){return Object.assign(this.options,this.type.configure(m||{})),this.canvas.width=this.options.width,this.canvas.height=this.options.height,this.animation.rule=this.options.animationRule,this.animation.duration=this.options.animationDuration,this.canvas.redraw(),this}},{key:"destroy",value:function(){var m=Ri.indexOf(this);~m&&Ri.splice(m,1),this.canvas.destroy(),this.canvas=null,this.animation.destroy(),this.animation=null,this.emit("destroy")}},{key:"draw",value:function(){return this.options.animateOnInit&&!this.initialized&&(this.value=this._value,this.initialized=!0,this.emit("init")),this.emit("render"),this}},{key:"value",set:function(m){var w=this;m=h.ensureValue(m,this.options.minValue);var C=this.options.value;if(m!==C)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===m))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=m),this.emit("animationStart"),this.animation.animate(function(T){var O=C+(m-C)*T;w.options.animatedValue&&w.emit("value",O,w.value),w.options.value=O,w.draw(),w.emit("animate",T,w.options.value)},function(){w._value!==void 0&&(w.emit("value",w._value,w.value),w.options.value=w._value,delete w._value),w.draw(),w.emit("animationEnd"),w.animation.frame=null})}else this.emit("value",m,this.value),this.options.value=m,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(m){return m}},{key:"initialize",value:function(m,w){return new Oi(w,"canvas",m)}},{key:"fromElement",value:function(m){var w=Oi.toCamelCase(m.getAttribute("data-type")),C=m.attributes,T=0,O=C.length,N={};if(w){for(/Gauge$/.test(w)||(w+="Gauge");T<O;T++)N[Oi.toCamelCase(C[T].name.replace(/^data-/,""),!1)]=Oi.parse(C[T].value);new Oi(N,m.tagName,w).process(m)}}},{key:"ensureValue",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return m=parseFloat(m),!isNaN(m)&&isFinite(m)||(m=parseFloat(w)||0),m}},{key:"mod",value:function(m,w){return(m%w+w)%w}},{key:"version",get:function(){return _r}}]),h}(yr);r!==void 0&&(r.BaseGauge=It,r.gauges=(window.document||{}).gauges=Ri);var va=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,Z={roundRect:c,padValue:p,formatMajorTickNumber:y,radians:k,radialPoint:x,linearGradient:A,drawNeedleShadow:z,drawValueBox:Le,verifyError:d,prepareTicks:s,font:Y,normalizedValue:Ye,formatContext:f},nn=Math.PI,An=nn/2,qr=Object.assign({},Ii,{ticksAngle:270,startAngle:45,colorNeedleCircleOuter:"#f0f0f0",colorNeedleCircleOuterEnd:"#ccc",colorNeedleCircleInner:"#e8e8e8",colorNeedleCircleInnerEnd:"#f5f5f5",needleCircleSize:10,needleCircleInner:!0,needleCircleOuter:!0,needleStart:20,animationTarget:"needle",useMinPath:!1,barWidth:0,barStartPosition:"left"}),ya=function(u){function h(m){return i(this,h),m=Object.assign({},qr,m||{}),e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h.configure(m)))}return t(h,u),vi(h,[{key:"draw",value:function(){try{var m=this.canvas,w=[-m.drawX,-m.drawY,m.drawWidth,m.drawHeight],C=w[0],T=w[1],O=w[2],N=w[3],R=this.options;if(R.animationTarget==="needle"){if(!m.elementClone.initialized){var W=m.contextClone;W.clearRect(C,T,O,N),this.emit("beforePlate"),mt(W,R),this.emit("beforeHighlights"),ct(W,R),this.emit("beforeMinorTicks"),qt(W,R),this.emit("beforeMajorTicks"),ft(W,R),this.emit("beforeNumbers"),X(W,R),this.emit("beforeTitle"),ie(W,R),this.emit("beforeUnits"),ae(W,R),m.elementClone.initialized=!0}this.canvas.commit(),m.context.clearRect(C,T,O,N),m.context.drawImage(m.elementClone,C,T,O,N),this.emit("beforeProgressBar"),vt(m.context,R),this.emit("beforeValueBox"),nt(m.context,R,Et(this)),this.emit("beforeNeedle"),Me(m.context,R)}else{var U=-Z.radians((R.value-R.minValue)/(R.maxValue-R.minValue)*R.ticksAngle);if(m.context.clearRect(C,T,O,N),this.emit("beforePlate"),mt(m.context,R),m.context.rotate(U),this.emit("beforeHighlights"),ct(m.context,R),this.emit("beforeMinorTicks"),qt(m.context,R),this.emit("beforeMajorTicks"),ft(m.context,R),this.emit("beforeNumbers"),X(m.context,R),this.emit("beforeProgressBar"),vt(m.context,R),m.context.rotate(-U),!m.elementClone.initialized){var q=m.contextClone;q.clearRect(C,T,O,N),this.emit("beforeTitle"),ie(q,R),this.emit("beforeUnits"),ae(q,R),this.emit("beforeNeedle"),Me(q,R),m.elementClone.initialized=!0}m.context.drawImage(m.elementClone,C,T,O,N)}this.emit("beforeValueBox"),nt(m.context,R,Et(this)),En(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"draw",this).call(this)}catch(J){Z.verifyError(J)}return this}},{key:"value",set:function(m){m=It.ensureValue(m,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=m,m=this.options.value+((m-this.options.value)%360+540)%360-180),jr(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",m,this)},get:function(){return En(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this)}}],[{key:"configure",value:function(m){return m.barWidth>50&&(m.barWidth=50),isNaN(m.startAngle)&&(m.startAngle=45),isNaN(m.ticksAngle)&&(m.ticksAngle=270),m.ticksAngle>360&&(m.ticksAngle=360),m.ticksAngle<0&&(m.ticksAngle=0),m.startAngle<0&&(m.startAngle=0),m.startAngle>360&&(m.startAngle=360),m}}]),h}(It);r!==void 0&&(r.RadialGauge=ya),It.initialize("RadialGauge",qr);var Yr=Object.assign({},Ii,{borderRadius:0,barBeginCircle:30,colorBarEnd:"",colorBarProgressEnd:"",needleWidth:6,tickSide:"both",needleSide:"both",numberSide:"both",ticksWidth:10,ticksWidthMinor:5,ticksPadding:5,barLength:85,fontTitleSize:26,highlightsWidth:10}),Dn=function(u){function h(m){return i(this,h),m=Object.assign({},Yr,m||{}),e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h.configure(m)))}return t(h,u),vi(h,[{key:"draw",value:function(){try{var m=this.canvas,w=[-m.drawX,-m.drawY,m.drawWidth,m.drawHeight],C=w[0],T=w[1],O=w[2],N=w[3],R=this.options;if(!m.elementClone.initialized){var W=m.contextClone;W.clearRect(C,T,O,N),this.emit("beforePlate"),this.drawBox=ht(W,R,C,T,O,N),this.emit("beforeBar"),qe.apply(void 0,[W,R].concat(n(this.drawBox))),m.contextClone.barDimensions=W.barDimensions,this.emit("beforeHighlights"),en(W,R),this.emit("beforeMinorTicks"),Fr(W,R),this.emit("beforeMajorTicks"),Qt(W,R),this.emit("beforeNumbers"),Hr(W,R),this.emit("beforeTitle"),Tn(W,R),this.emit("beforeUnits"),Mt(W,R),m.elementClone.initialized=!0}this.canvas.commit(),m.context.clearRect(C,T,O,N),m.context.drawImage(m.elementClone,C,T,O,N),this.emit("beforeProgressBar"),di.apply(void 0,[m.context,R].concat(n(this.drawBox))),this.emit("beforeNeedle"),ma(m.context,R),this.emit("beforeValueBox"),ga.apply(void 0,[m.context,R,R.animatedValue?this.options.value:this.value].concat(n(this.drawBox))),En(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"draw",this).call(this)}catch(U){Z.verifyError(U)}return this}}],[{key:"configure",value:function(m){return m.barStrokeWidth>=m.barWidth&&(m.barStrokeWidth=Ce(m.barWidth/2)),m.hasLeft=Yt("right",m),m.hasRight=Yt("left",m),m.value>m.maxValue&&(m.value=m.maxValue),m.value<m.minValue&&(m.value=m.minValue),It.configure(m)}}]),h}(It);r!==void 0&&(r.LinearGauge=Dn),It.initialize("LinearGauge",Yr),typeof Bo<"u"&&Object.assign(r,{Collection:l,GenericOptions:Ii,Animation:br,BaseGauge:It,drawings:Z,SmartCanvas:Ft,DomObserver:Oi,vendorize:o})})(typeof Bo<"u"?Bo.exports:window)});var Wu=ka((PT,ua)=>{(function(r,n,e,t){"use strict";var i=["","webkit","Moz","MS","ms","o"],o=n.createElement("div"),a="function",l=Math.round,d=Math.abs,f=Date.now;function s(g,b,S){return setTimeout(Y(g,S),b)}function c(g,b,S){return Array.isArray(g)?(p(g,S[b],S),!0):!1}function p(g,b,S){var I;if(g)if(g.forEach)g.forEach(b,S);else if(g.length!==t)for(I=0;I<g.length;)b.call(S,g[I],I,g),I++;else for(I in g)g.hasOwnProperty(I)&&b.call(S,g[I],I,g)}function y(g,b,S){var I="DEPRECATED METHOD: "+b+`
2
2
  `+S+` AT
3
3
  `;return function(){var H=new Error("get-stack-trace"),K=H&&H.stack?H.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ze=r.console&&(r.console.warn||r.console.log);return ze&&ze.call(r.console,I,K),g.apply(this,arguments)}}var k;typeof Object.assign!="function"?k=function(b){if(b===t||b===null)throw new TypeError("Cannot convert undefined or null to object");for(var S=Object(b),I=1;I<arguments.length;I++){var H=arguments[I];if(H!==t&&H!==null)for(var K in H)H.hasOwnProperty(K)&&(S[K]=H[K])}return S}:k=Object.assign;var x=y(function(b,S,I){for(var H=Object.keys(S),K=0;K<H.length;)(!I||I&&b[H[K]]===t)&&(b[H[K]]=S[H[K]]),K++;return b},"extend","Use `assign`."),A=y(function(b,S){return x(b,S,!0)},"merge","Use `assign`.");function z(g,b,S){var I=b.prototype,H;H=g.prototype=Object.create(I),H.constructor=g,H._super=I,S&&k(H,S)}function Y(g,b){return function(){return g.apply(b,arguments)}}function re(g,b){return typeof g==a?g.apply(b&&b[0]||t,b):g}function _e(g,b){return g===t?b:g}function Le(g,b,S){p(mt(b),function(I){g.addEventListener(I,S,!1)})}function Ye(g,b,S){p(mt(b),function(I){g.removeEventListener(I,S,!1)})}function $e(g,b){for(;g;){if(g==b)return!0;g=g.parentNode}return!1}function he(g,b){return g.indexOf(b)>-1}function mt(g){return g.trim().split(/\s+/g)}function ct(g,b,S){if(g.indexOf&&!S)return g.indexOf(b);for(var I=0;I<g.length;){if(S&&g[I][S]==b||!S&&g[I]===b)return I;I++}return-1}function qt(g){return Array.prototype.slice.call(g,0)}function pt(g,b,S){for(var I=[],H=[],K=0;K<g.length;){var ze=b?g[K][b]:g[K];ct(H,ze)<0&&I.push(g[K]),H[K]=ze,K++}return S&&(b?I=I.sort(function(St,At){return St[b]>At[b]}):I=I.sort()),I}function ft(g,b){for(var S,I,H=b[0].toUpperCase()+b.slice(1),K=0;K<i.length;){if(S=i[K],I=S?S+H:b,I in g)return I;K++}return t}var xi=1;function Cn(){return xi++}function X(g){var b=g.ownerDocument||g;return b.defaultView||b.parentWindow||r}var ie=/mobile|tablet|ip(ad|hone|od)|android/i,ae="ontouchstart"in r,Me=ft(r,"PointerEvent")!==t,nt=ae&&ie.test(navigator.userAgent),gt="touch",vt="pen",Et="mouse",Ke="kinect",xn=25,ht=1,Ze=2,He=4,qe=8,Yt=1,di=2,en=4,gi=8,Mi=16,Qt=di|en,Xt=gi|Mi,Fr=Qt|Xt,Hr=["x","y"],Tn=["clientX","clientY"];function Mt(g,b){var S=this;this.manager=g,this.callback=b,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(I){re(g.options.enable,[g])&&S.handler(I)},this.init()}Mt.prototype={handler:function(){},init:function(){this.evEl&&Le(this.element,this.evEl,this.domHandler),this.evTarget&&Le(this.target,this.evTarget,this.domHandler),this.evWin&&Le(X(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Ye(this.element,this.evEl,this.domHandler),this.evTarget&&Ye(this.target,this.evTarget,this.domHandler),this.evWin&&Ye(X(this.element),this.evWin,this.domHandler)}};function ma(g){var b,S=g.options.inputClass;return S?b=S:Me?b=It:nt?b=Dn:ae?b=w:b=Ii,new b(g,Gr)}function Gr(g,b,S){var I=S.pointers.length,H=S.changedPointers.length,K=b&ht&&I-H===0,ze=b&(He|qe)&&I-H===0;S.isFirst=!!K,S.isFinal=!!ze,K&&(g.session={}),S.eventType=b,pa(g,S),g.emit("hammer.input",S),g.recognize(S),g.session.prevInput=S}function pa(g,b){var S=g.session,I=b.pointers,H=I.length;S.firstInput||(S.firstInput=vr(b)),H>1&&!S.firstMultiple?S.firstMultiple=vr(b):H===1&&(S.firstMultiple=!1);var K=S.firstInput,ze=S.firstMultiple,yt=ze?ze.center:K.center,St=b.center=En(I);b.timeStamp=f(),b.deltaTime=b.timeStamp-K.timeStamp,b.angle=yr(yt,St),b.distance=Ti(yt,St),fa(S,b),b.offsetDirection=vi(b.deltaX,b.deltaY);var At=jr(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=At.x,b.overallVelocityY=At.y,b.overallVelocity=d(At.x)>d(At.y)?At.x:At.y,b.scale=ze?tn(ze.pointers,I):1,b.rotation=ze?Ur(ze.pointers,I):0,b.maxPointers=S.prevInput?b.pointers.length>S.prevInput.maxPointers?b.pointers.length:S.prevInput.maxPointers:b.pointers.length,ga(S,b);var yi=g.element;$e(b.srcEvent.target,yi)&&(yi=b.srcEvent.target),b.target=yi}function fa(g,b){var S=b.center,I=g.offsetDelta||{},H=g.prevDelta||{},K=g.prevInput||{};(b.eventType===ht||K.eventType===He)&&(H=g.prevDelta={x:K.deltaX||0,y:K.deltaY||0},I=g.offsetDelta={x:S.x,y:S.y}),b.deltaX=H.x+(S.x-I.x),b.deltaY=H.y+(S.y-I.y)}function ga(g,b){var S=g.lastInterval||b,I=b.timeStamp-S.timeStamp,H,K,ze,yt;if(b.eventType!=qe&&(I>xn||S.velocity===t)){var St=b.deltaX-S.deltaX,At=b.deltaY-S.deltaY,yi=jr(I,St,At);K=yi.x,ze=yi.y,H=d(yi.x)>d(yi.y)?yi.x:yi.y,yt=vi(St,At),g.lastInterval=b}else H=S.velocity,K=S.velocityX,ze=S.velocityY,yt=S.direction;b.velocity=H,b.velocityX=K,b.velocityY=ze,b.direction=yt}function vr(g){for(var b=[],S=0;S<g.pointers.length;)b[S]={clientX:l(g.pointers[S].clientX),clientY:l(g.pointers[S].clientY)},S++;return{timeStamp:f(),pointers:b,center:En(b),deltaX:g.deltaX,deltaY:g.deltaY}}function En(g){var b=g.length;if(b===1)return{x:l(g[0].clientX),y:l(g[0].clientY)};for(var S=0,I=0,H=0;H<b;)S+=g[H].clientX,I+=g[H].clientY,H++;return{x:l(S/b),y:l(I/b)}}function jr(g,b,S){return{x:b/g||0,y:S/g||0}}function vi(g,b){return g===b?Yt:d(g)>=d(b)?g<0?di:en:b<0?gi:Mi}function Ti(g,b,S){S||(S=Hr);var I=b[S[0]]-g[S[0]],H=b[S[1]]-g[S[1]];return Math.sqrt(I*I+H*H)}function yr(g,b,S){S||(S=Hr);var I=b[S[0]]-g[S[0]],H=b[S[1]]-g[S[1]];return Math.atan2(H,I)*180/Math.PI}function Ur(g,b){return yr(b[1],b[0],Tn)+yr(g[1],g[0],Tn)}function tn(g,b){return Ti(b[0],b[1],Tn)/Ti(g[0],g[1],Tn)}var br={mousedown:ht,mousemove:Ze,mouseup:He},Oi="mousedown",Ft="mousemove mouseup";function Ii(){this.evEl=Oi,this.evWin=Ft,this.pressed=!1,Mt.apply(this,arguments)}z(Ii,Mt,{handler:function(b){var S=br[b.type];S&ht&&b.button===0&&(this.pressed=!0),S&Ze&&b.which!==1&&(S=He),this.pressed&&(S&He&&(this.pressed=!1),this.callback(this.manager,S,{pointers:[b],changedPointers:[b],pointerType:Et,srcEvent:b}))}});var _r={pointerdown:ht,pointermove:Ze,pointerup:He,pointercancel:qe,pointerout:qe},Ce={2:gt,3:vt,4:Et,5:Ke},Ot="pointerdown",Ri="pointermove pointerup pointercancel";r.MSPointerEvent&&!r.PointerEvent&&(Ot="MSPointerDown",Ri="MSPointerMove MSPointerUp MSPointerCancel");function It(){this.evEl=Ot,this.evWin=Ri,Mt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}z(It,Mt,{handler:function(b){var S=this.store,I=!1,H=b.type.toLowerCase().replace("ms",""),K=_r[H],ze=Ce[b.pointerType]||b.pointerType,yt=ze==gt,St=ct(S,b.pointerId,"pointerId");K&ht&&(b.button===0||yt)?St<0&&(S.push(b),St=S.length-1):K&(He|qe)&&(I=!0),!(St<0)&&(S[St]=b,this.callback(this.manager,K,{pointers:S,changedPointers:[b],pointerType:ze,srcEvent:b}),I&&S.splice(St,1))}});var va={touchstart:ht,touchmove:Ze,touchend:He,touchcancel:qe},Z="touchstart",nn="touchstart touchmove touchend touchcancel";function An(){this.evTarget=Z,this.evWin=nn,this.started=!1,Mt.apply(this,arguments)}z(An,Mt,{handler:function(b){var S=va[b.type];if(S===ht&&(this.started=!0),!!this.started){var I=qr.call(this,b,S);S&(He|qe)&&I[0].length-I[1].length===0&&(this.started=!1),this.callback(this.manager,S,{pointers:I[0],changedPointers:I[1],pointerType:gt,srcEvent:b})}}});function qr(g,b){var S=qt(g.touches),I=qt(g.changedTouches);return b&(He|qe)&&(S=pt(S.concat(I),"identifier",!0)),[S,I]}var ya={touchstart:ht,touchmove:Ze,touchend:He,touchcancel:qe},Yr="touchstart touchmove touchend touchcancel";function Dn(){this.evTarget=Yr,this.targetIds={},Mt.apply(this,arguments)}z(Dn,Mt,{handler:function(b){var S=ya[b.type],I=u.call(this,b,S);I&&this.callback(this.manager,S,{pointers:I[0],changedPointers:I[1],pointerType:gt,srcEvent:b})}});function u(g,b){var S=qt(g.touches),I=this.targetIds;if(b&(ht|Ze)&&S.length===1)return I[S[0].identifier]=!0,[S,S];var H,K,ze=qt(g.changedTouches),yt=[],St=this.target;if(K=S.filter(function(At){return $e(At.target,St)}),b===ht)for(H=0;H<K.length;)I[K[H].identifier]=!0,H++;for(H=0;H<ze.length;)I[ze[H].identifier]&&yt.push(ze[H]),b&(He|qe)&&delete I[ze[H].identifier],H++;if(yt.length)return[pt(K.concat(yt),"identifier",!0),yt]}var h=2500,m=25;function w(){Mt.apply(this,arguments);var g=Y(this.handler,this);this.touch=new Dn(this.manager,g),this.mouse=new Ii(this.manager,g),this.primaryTouch=null,this.lastTouches=[]}z(w,Mt,{handler:function(b,S,I){var H=I.pointerType==gt,K=I.pointerType==Et;if(!(K&&I.sourceCapabilities&&I.sourceCapabilities.firesTouchEvents)){if(H)C.call(this,S,I);else if(K&&O.call(this,I))return;this.callback(b,S,I)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function C(g,b){g&ht?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):g&(He|qe)&&T.call(this,b)}function T(g){var b=g.changedPointers[0];if(b.identifier===this.primaryTouch){var S={x:b.clientX,y:b.clientY};this.lastTouches.push(S);var I=this.lastTouches,H=function(){var K=I.indexOf(S);K>-1&&I.splice(K,1)};setTimeout(H,h)}}function O(g){for(var b=g.srcEvent.clientX,S=g.srcEvent.clientY,I=0;I<this.lastTouches.length;I++){var H=this.lastTouches[I],K=Math.abs(b-H.x),ze=Math.abs(S-H.y);if(K<=m&&ze<=m)return!0}return!1}var N=ft(o.style,"touchAction"),R=N!==t,W="compute",U="auto",q="manipulation",J="none",le="pan-x",pe="pan-y",Oe=We();function ge(g,b){this.manager=g,this.set(b)}ge.prototype={set:function(g){g==W&&(g=this.compute()),R&&this.manager.element.style&&Oe[g]&&(this.manager.element.style[N]=g),this.actions=g.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var g=[];return p(this.manager.recognizers,function(b){re(b.options.enable,[b])&&(g=g.concat(b.getTouchAction()))}),Ne(g.join(" "))},preventDefaults:function(g){var b=g.srcEvent,S=g.offsetDirection;if(this.manager.session.prevented){b.preventDefault();return}var I=this.actions,H=he(I,J)&&!Oe[J],K=he(I,pe)&&!Oe[pe],ze=he(I,le)&&!Oe[le];if(H){var yt=g.pointers.length===1,St=g.distance<2,At=g.deltaTime<250;if(yt&&St&&At)return}if(!(ze&&K)&&(H||K&&S&Qt||ze&&S&Xt))return this.preventSrc(b)},preventSrc:function(g){this.manager.session.prevented=!0,g.preventDefault()}};function Ne(g){if(he(g,J))return J;var b=he(g,le),S=he(g,pe);return b&&S?J:b||S?b?le:pe:he(g,q)?q:U}function We(){if(!R)return!1;var g={},b=r.CSS&&r.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(S){g[S]=b?r.CSS.supports("touch-action",S):!0}),g}var Be=1,ue=2,xe=4,ve=8,oe=ve,ye=16,we=32;function Te(g){this.options=k({},this.defaults,g||{}),this.id=Cn(),this.manager=null,this.options.enable=_e(this.options.enable,!0),this.state=Be,this.simultaneous={},this.requireFail=[]}Te.prototype={defaults:{},set:function(g){return k(this.options,g),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(g){if(c(g,"recognizeWith",this))return this;var b=this.simultaneous;return g=wt(g,this),b[g.id]||(b[g.id]=g,g.recognizeWith(this)),this},dropRecognizeWith:function(g){return c(g,"dropRecognizeWith",this)?this:(g=wt(g,this),delete this.simultaneous[g.id],this)},requireFailure:function(g){if(c(g,"requireFailure",this))return this;var b=this.requireFail;return g=wt(g,this),ct(b,g)===-1&&(b.push(g),g.requireFailure(this)),this},dropRequireFailure:function(g){if(c(g,"dropRequireFailure",this))return this;g=wt(g,this);var b=ct(this.requireFail,g);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(g){return!!this.simultaneous[g.id]},emit:function(g){var b=this,S=this.state;function I(H){b.manager.emit(H,g)}S<ve&&I(b.options.event+Qe(S)),I(b.options.event),g.additionalEvent&&I(g.additionalEvent),S>=ve&&I(b.options.event+Qe(S))},tryEmit:function(g){if(this.canEmit())return this.emit(g);this.state=we},canEmit:function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(we|Be)))return!1;g++}return!0},recognize:function(g){var b=k({},g);if(!re(this.options.enable,[this,b])){this.reset(),this.state=we;return}this.state&(oe|ye|we)&&(this.state=Be),this.state=this.process(b),this.state&(ue|xe|ve|ye)&&this.tryEmit(b)},process:function(g){},getTouchAction:function(){},reset:function(){}};function Qe(g){return g&ye?"cancel":g&ve?"end":g&xe?"move":g&ue?"start":""}function _t(g){return g==Mi?"down":g==gi?"up":g==di?"left":g==en?"right":""}function wt(g,b){var S=b.manager;return S?S.get(g):g}function kt(){Te.apply(this,arguments)}z(kt,Te,{defaults:{pointers:1},attrTest:function(g){var b=this.options.pointers;return b===0||g.pointers.length===b},process:function(g){var b=this.state,S=g.eventType,I=b&(ue|xe),H=this.attrTest(g);return I&&(S&qe||!H)?b|ye:I||H?S&He?b|ve:b&ue?b|xe:ue:we}});function Kt(){kt.apply(this,arguments),this.pX=null,this.pY=null}z(Kt,kt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Fr},getTouchAction:function(){var g=this.options.direction,b=[];return g&Qt&&b.push(pe),g&Xt&&b.push(le),b},directionTest:function(g){var b=this.options,S=!0,I=g.distance,H=g.direction,K=g.deltaX,ze=g.deltaY;return H&b.direction||(b.direction&Qt?(H=K===0?Yt:K<0?di:en,S=K!=this.pX,I=Math.abs(g.deltaX)):(H=ze===0?Yt:ze<0?gi:Mi,S=ze!=this.pY,I=Math.abs(g.deltaY))),g.direction=H,S&&I>b.threshold&&H&b.direction},attrTest:function(g){return kt.prototype.attrTest.call(this,g)&&(this.state&ue||!(this.state&ue)&&this.directionTest(g))},emit:function(g){this.pX=g.deltaX,this.pY=g.deltaY;var b=_t(g.direction);b&&(g.additionalEvent=this.options.event+b),this._super.emit.call(this,g)}});function Pn(){kt.apply(this,arguments)}z(Pn,kt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[J]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.scale-1)>this.options.threshold||this.state&ue)},emit:function(g){if(g.scale!==1){var b=g.scale<1?"in":"out";g.additionalEvent=this.options.event+b}this._super.emit.call(this,g)}});function Mn(){Te.apply(this,arguments),this._timer=null,this._input=null}z(Mn,Te,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[U]},process:function(g){var b=this.options,S=g.pointers.length===b.pointers,I=g.distance<b.threshold,H=g.deltaTime>b.time;if(this._input=g,!I||!S||g.eventType&(He|qe)&&!H)this.reset();else if(g.eventType&ht)this.reset(),this._timer=s(function(){this.state=oe,this.tryEmit()},b.time,this);else if(g.eventType&He)return oe;return we},reset:function(){clearTimeout(this._timer)},emit:function(g){this.state===oe&&(g&&g.eventType&He?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function ba(){kt.apply(this,arguments)}z(ba,kt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[J]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.rotation)>this.options.threshold||this.state&ue)}});function _a(){kt.apply(this,arguments)}z(_a,kt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Qt|Xt,pointers:1},getTouchAction:function(){return Kt.prototype.getTouchAction.call(this)},attrTest:function(g){var b=this.options.direction,S;return b&(Qt|Xt)?S=g.overallVelocity:b&Qt?S=g.overallVelocityX:b&Xt&&(S=g.overallVelocityY),this._super.attrTest.call(this,g)&&b&g.offsetDirection&&g.distance>this.options.threshold&&g.maxPointers==this.options.pointers&&d(S)>this.options.velocity&&g.eventType&He},emit:function(g){var b=_t(g.offsetDirection);b&&this.manager.emit(this.options.event+b,g),this.manager.emit(this.options.event,g)}});function Qr(){Te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}z(Qr,Te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[q]},process:function(g){var b=this.options,S=g.pointers.length===b.pointers,I=g.distance<b.threshold,H=g.deltaTime<b.time;if(this.reset(),g.eventType&ht&&this.count===0)return this.failTimeout();if(I&&H&&S){if(g.eventType!=He)return this.failTimeout();var K=this.pTime?g.timeStamp-this.pTime<b.interval:!0,ze=!this.pCenter||Ti(this.pCenter,g.center)<b.posThreshold;this.pTime=g.timeStamp,this.pCenter=g.center,!ze||!K?this.count=1:this.count+=1,this._input=g;var yt=this.count%b.taps;if(yt===0)return this.hasRequireFailures()?(this._timer=s(function(){this.state=oe,this.tryEmit()},b.interval,this),ue):oe}return we},failTimeout:function(){return this._timer=s(function(){this.state=we},this.options.interval,this),we},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==oe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ei(g,b){return b=b||{},b.recognizers=_e(b.recognizers,Ei.defaults.preset),new wa(g,b)}Ei.VERSION="2.0.7",Ei.defaults={domEvents:!1,touchAction:W,enable:!0,inputTarget:null,inputClass:null,preset:[[ba,{enable:!1}],[Pn,{enable:!1},["rotate"]],[_a,{direction:Qt}],[Kt,{direction:Qt},["swipe"]],[Qr],[Qr,{event:"doubletap",taps:2},["tap"]],[Mn]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Bu=1,el=2;function wa(g,b){this.options=k({},Ei.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=ma(this),this.touchAction=new ge(this,this.options.touchAction),tl(this,!0),p(this.options.recognizers,function(S){var I=this.add(new S[0](S[1]));S[2]&&I.recognizeWith(S[2]),S[3]&&I.requireFailure(S[3])},this)}wa.prototype={set:function(g){return k(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},stop:function(g){this.session.stopped=g?el:Bu},recognize:function(g){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(g);var S,I=this.recognizers,H=b.curRecognizer;(!H||H&&H.state&oe)&&(H=b.curRecognizer=null);for(var K=0;K<I.length;)S=I[K],b.stopped!==el&&(!H||S==H||S.canRecognizeWith(H))?S.recognize(g):S.reset(),!H&&S.state&(ue|xe|ve)&&(H=b.curRecognizer=S),K++}},get:function(g){if(g instanceof Te)return g;for(var b=this.recognizers,S=0;S<b.length;S++)if(b[S].options.event==g)return b[S];return null},add:function(g){if(c(g,"add",this))return this;var b=this.get(g.options.event);return b&&this.remove(b),this.recognizers.push(g),g.manager=this,this.touchAction.update(),g},remove:function(g){if(c(g,"remove",this))return this;if(g=this.get(g),g){var b=this.recognizers,S=ct(b,g);S!==-1&&(b.splice(S,1),this.touchAction.update())}return this},on:function(g,b){if(g!==t&&b!==t){var S=this.handlers;return p(mt(g),function(I){S[I]=S[I]||[],S[I].push(b)}),this}},off:function(g,b){if(g!==t){var S=this.handlers;return p(mt(g),function(I){b?S[I]&&S[I].splice(ct(S[I],b),1):delete S[I]}),this}},emit:function(g,b){this.options.domEvents&&zu(g,b);var S=this.handlers[g]&&this.handlers[g].slice();if(!(!S||!S.length)){b.type=g,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var I=0;I<S.length;)S[I](b),I++}},destroy:function(){this.element&&tl(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function tl(g,b){var S=g.element;if(S.style){var I;p(g.options.cssProps,function(H,K){I=ft(S.style,K),b?(g.oldCssProps[I]=S.style[I],S.style[I]=H):S.style[I]=g.oldCssProps[I]||""}),b||(g.oldCssProps={})}}function zu(g,b){var S=n.createEvent("Event");S.initEvent(g,!0,!0),S.gesture=b,b.target.dispatchEvent(S)}k(Ei,{INPUT_START:ht,INPUT_MOVE:Ze,INPUT_END:He,INPUT_CANCEL:qe,STATE_POSSIBLE:Be,STATE_BEGAN:ue,STATE_CHANGED:xe,STATE_ENDED:ve,STATE_RECOGNIZED:oe,STATE_CANCELLED:ye,STATE_FAILED:we,DIRECTION_NONE:Yt,DIRECTION_LEFT:di,DIRECTION_RIGHT:en,DIRECTION_UP:gi,DIRECTION_DOWN:Mi,DIRECTION_HORIZONTAL:Qt,DIRECTION_VERTICAL:Xt,DIRECTION_ALL:Fr,Manager:wa,Input:Mt,TouchAction:ge,TouchInput:Dn,MouseInput:Ii,PointerEventInput:It,TouchMouseInput:w,SingleTouchInput:An,Recognizer:Te,AttrRecognizer:kt,Tap:Qr,Pan:Kt,Swipe:_a,Pinch:Pn,Rotate:ba,Press:Mn,on:Le,off:Ye,each:p,merge:A,extend:x,assign:k,inherit:z,bindFn:Y,prefixed:ft});var Vu=typeof r<"u"?r:typeof self<"u"?self:{};Vu.Hammer=Ei,typeof define=="function"&&define.amd?define(function(){return Ei}):typeof ua<"u"&&ua.exports?ua.exports=Ei:r[e]=Ei})(window,document,"Hammer")});function zd(r,n,e,t,i){let o=(...a)=>(console.warn("gridstack.js: Function `"+e+"` is deprecated in "+i+" and has been replaced with `"+t+"`. It will be **removed** in a future release"),n.apply(r,a));return o.prototype=n.prototype,o}var D=class r{static getElements(n,e=document){if(typeof n=="string"){let t="getElementById"in e?e:void 0;if(t&&!isNaN(+n[0])){let o=t.getElementById(n);return o?[o]:[]}let i=e.querySelectorAll(n);return!i.length&&n[0]!=="."&&n[0]!=="#"&&(i=e.querySelectorAll("."+n),i.length||(i=e.querySelectorAll("#"+n))),Array.from(i)}return[n]}static getElement(n,e=document){if(typeof n=="string"){let t="getElementById"in e?e:void 0;if(!n.length)return null;if(t&&n[0]==="#")return t.getElementById(n.substring(1));if(n[0]==="#"||n[0]==="."||n[0]==="[")return e.querySelector(n);if(t&&!isNaN(+n[0]))return t.getElementById(n);let i=e.querySelector(n);return t&&!i&&(i=t.getElementById(n)),i||(i=e.querySelector("."+n)),i}return n}static lazyLoad(n){return n.lazyLoad||n.grid?.opts?.lazyLoad&&n.lazyLoad!==!1}static createDiv(n,e){let t=document.createElement("div");return n.forEach(i=>{i&&t.classList.add(i)}),e?.appendChild(t),t}static shouldSizeToContent(n,e=!1){return n?.grid&&(e?n.sizeToContent===!0||n.grid.opts.sizeToContent===!0&&n.sizeToContent===void 0:!!n.sizeToContent||n.grid.opts.sizeToContent&&n.sizeToContent!==!1)}static isIntercepted(n,e){return!(n.y>=e.y+e.h||n.y+n.h<=e.y||n.x+n.w<=e.x||n.x>=e.x+e.w)}static isTouching(n,e){return r.isIntercepted(n,{x:e.x-.5,y:e.y-.5,w:e.w+1,h:e.h+1})}static areaIntercept(n,e){let t=n.x>e.x?n.x:e.x,i=n.x+n.w<e.x+e.w?n.x+n.w:e.x+e.w;if(i<=t)return 0;let o=n.y>e.y?n.y:e.y,a=n.y+n.h<e.y+e.h?n.y+n.h:e.y+e.h;return a<=o?0:(i-t)*(a-o)}static area(n){return n.w*n.h}static sort(n,e=1){return n.sort((i,o)=>{let a=e*((i.y??1e4)-(o.y??1e4));return a===0?e*((i.x??1e4)-(o.x??1e4)):a})}static find(n,e){return e?n.find(t=>t.id===e):void 0}static createStylesheet(n,e,t){let i=document.createElement("style"),o=t?.nonce;return o&&(i.nonce=o),i.setAttribute("type","text/css"),i.setAttribute("gs-style-id",n),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),e?e.insertBefore(i,e.firstChild):(e=document.getElementsByTagName("head")[0],e.appendChild(i)),i}static removeStylesheet(n,e){let i=(e||document).querySelector("STYLE[gs-style-id="+n+"]");i&&i.parentNode&&i.remove()}static addCSSRule(n,e,t){n.textContent+=`${e} { ${t} } `}static toBool(n){return typeof n=="boolean"?n:typeof n=="string"?(n=n.toLowerCase(),!(n===""||n==="no"||n==="false"||n==="0")):!!n}static toNumber(n){return n===null||n.length===0?void 0:Number(n)}static parseHeight(n){let e,t="px";if(typeof n=="string")if(n==="auto"||n==="")e=0;else{let i=n.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${n}`);t=i[2]||"px",e=parseFloat(i[1])}else e=n;return{h:e,unit:t}}static defaults(n,...e){return e.forEach(t=>{for(let i in t){if(!t.hasOwnProperty(i))return;n[i]===null||n[i]===void 0?n[i]=t[i]:typeof t[i]=="object"&&typeof n[i]=="object"&&this.defaults(n[i],t[i])}}),n}static same(n,e){if(typeof n!="object")return n==e;if(typeof n!=typeof e||Object.keys(n).length!==Object.keys(e).length)return!1;for(let t in n)if(n[t]!==e[t])return!1;return!0}static copyPos(n,e,t=!1){return e.x!==void 0&&(n.x=e.x),e.y!==void 0&&(n.y=e.y),e.w!==void 0&&(n.w=e.w),e.h!==void 0&&(n.h=e.h),t&&(e.minW&&(n.minW=e.minW),e.minH&&(n.minH=e.minH),e.maxW&&(n.maxW=e.maxW),e.maxH&&(n.maxH=e.maxH)),n}static samePos(n,e){return n&&e&&n.x===e.x&&n.y===e.y&&(n.w||1)===(e.w||1)&&(n.h||1)===(e.h||1)}static sanitizeMinMax(n){n.minW||delete n.minW,n.minH||delete n.minH,n.maxW||delete n.maxW,n.maxH||delete n.maxH}static removeInternalAndSame(n,e){if(!(typeof n!="object"||typeof e!="object"))for(let t in n){let i=n[t],o=e[t];t[0]==="_"||i===o?delete n[t]:i&&typeof i=="object"&&o!==void 0&&(r.removeInternalAndSame(i,o),Object.keys(i).length||delete n[t])}}static removeInternalForSave(n,e=!0){for(let t in n)(t[0]==="_"||n[t]===null||n[t]===void 0)&&delete n[t];delete n.grid,e&&delete n.el,n.autoPosition||delete n.autoPosition,n.noResize||delete n.noResize,n.noMove||delete n.noMove,n.locked||delete n.locked,(n.w===1||n.w===n.minW)&&delete n.w,(n.h===1||n.h===n.minH)&&delete n.h}static throttle(n,e){let t=!1;return(...i)=>{t||(t=!0,setTimeout(()=>{n(...i),t=!1},e))}}static removePositioningStyles(n){let e=n.style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")}static getScrollElement(n){if(!n)return document.scrollingElement||document.documentElement;let e=getComputedStyle(n);return/(auto|scroll)/.test(e.overflow+e.overflowY)?n:this.getScrollElement(n.parentElement)}static updateScrollPosition(n,e,t){let i=n.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(i.top<0||i.bottom>o){let a=i.bottom-o,l=i.top,d=this.getScrollElement(n);if(d!==null){let f=d.scrollTop;i.top<0&&t<0?n.offsetHeight>o?d.scrollTop+=t:d.scrollTop+=Math.abs(l)>Math.abs(t)?t:l:t>0&&(n.offsetHeight>o?d.scrollTop+=t:d.scrollTop+=a>t?t:a),e.top+=d.scrollTop-f}}}static updateScrollResize(n,e,t){let i=this.getScrollElement(e),o=i.clientHeight,a=i===this.getScrollElement()?0:i.getBoundingClientRect().top,l=n.clientY-a,d=l<t,f=l>o-t;d?i.scrollBy({behavior:"smooth",top:l-t}):f&&i.scrollBy({behavior:"smooth",top:t-(o-l)})}static clone(n){return n==null||typeof n!="object"?n:n instanceof Array?[...n]:$({},n)}static cloneDeep(n){let e=["parentGrid","el","grid","subGrid","engine"],t=r.clone(n);for(let i in t)t.hasOwnProperty(i)&&typeof t[i]=="object"&&i.substring(0,2)!=="__"&&!e.find(o=>o===i)&&(t[i]=r.cloneDeep(n[i]));return t}static cloneNode(n){let e=n.cloneNode(!0);return e.removeAttribute("id"),e}static appendTo(n,e){let t;typeof e=="string"?t=r.getElement(e):t=e,t&&t.appendChild(n)}static addElStyles(n,e){if(e instanceof Object)for(let t in e)e.hasOwnProperty(t)&&(Array.isArray(e[t])?e[t].forEach(i=>{n.style[t]=i}):n.style[t]=e[t])}static initEvent(n,e){let t={type:e.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:e.target?e.target:n.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(o=>t[o]=n[o]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(o=>t[o]=n[o]),$($({},t),i)}static simulateMouseEvent(n,e,t){let i=n,o=new MouseEvent(e,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:n.target});(t||n.target).dispatchEvent(o)}static getValuesFromTransformedElement(n){let e=document.createElement("div");r.addElStyles(e,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),n.appendChild(e);let t=e.getBoundingClientRect();return n.removeChild(e),e.remove(),{xScale:1/t.width,yScale:1/t.height,xOffset:t.left,yOffset:t.top}}static swap(n,e,t){if(!n)return;let i=n[e];n[e]=n[t],n[t]=i}static canBeRotated(n){return!(!n||n.w===n.h||n.locked||n.noResize||n.grid?.opts.disableResize||n.minW&&n.minW===n.maxW||n.minH&&n.minH===n.maxH)}};var _o=(()=>{class r{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,o={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!o.nested&&!this.float&&this.swap(e,i))return!0;let a=t;!this._loading&&this._useEntireRowArea(e,t)&&(a={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,a,o.skip));let l=!1,d={nested:!0,pack:!1},f=0;for(;i=i||this.collide(e,a,o.skip);){if(f++>this.nodes.length*2)throw new Error("Infinite collide check");let s;if(i.locked||this._loading||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,rt($({},i),{y:e.y}),e)||!this.collide(i,rt($({},i),{y:t.y-i.h}),e))){e._skipDown=e._skipDown||t.y>e.y;let c=$(rt($({},t),{y:i.y+i.h}),d);s=this._loading&&D.samePos(e,c)?!0:this.moveNode(e,c),(i.locked||this._loading)&&s?D.copyPos(t,e):!i.locked&&s&&o.pack&&(this._packNodes(),t.y=i.y+i.h,D.copyPos(e,t)),l=l||s}else s=this.moveNode(i,$(rt($({},i),{y:t.y+t.h,skip:e}),d));if(!s)return l;i=void 0}return l}collide(e,t=e,i){let o=e._id,a=i?._id;return this.nodes.find(l=>l._id!==o&&l._id!==a&&D.isIntercepted(l,t))}collideAll(e,t=e,i){let o=e._id,a=i?._id;return this.nodes.filter(l=>l._id!==o&&l._id!==a&&D.isIntercepted(l,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let o=e._rect,a=$({},t.rect);a.y>o.y?(a.h+=a.y-o.y,a.y=o.y):a.h+=o.y-a.y,a.x>o.x?(a.w+=a.x-o.x,a.x=o.x):a.w+=o.x-a.x;let l,d=.5;for(let f of i){if(f.locked||!f._rect)break;let s=f._rect,c=Number.MAX_VALUE,p=Number.MAX_VALUE;o.y<s.y?c=(a.y+a.h-s.y)/s.h:o.y+o.h>s.y+s.h&&(c=(s.y+s.h-a.y)/s.h),o.x<s.x?p=(a.x+a.w-s.x)/s.w:o.x+o.w>s.x+s.w&&(p=(s.x+s.w-a.x)/s.w);let y=Math.min(p,c);y>d&&(d=y,l=f)}return t.collide=l,l}cacheRects(e,t,i,o,a,l){return this.nodes.forEach(d=>d._rect={y:d.y*t+i,x:d.x*e+l,w:d.w*e-l-o,h:d.h*t-i-a}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let a=t.x,l=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=a,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=l):(e.x=a,e.y=l),e._dirty=t._dirty=!0,!0}let o;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(o=D.isTouching(e,t)))return i();if(o!==!1){if(e.w===t.w&&e.x===t.x&&(o||(o=D.isTouching(e,t)))){if(t.y<e.y){let a=e;e=t,t=a}return i()}if(o!==!1){if(e.h===t.h&&e.y===t.y&&(o||(o=D.isTouching(e,t)))){if(t.x<e.x){let a=e;e=t,t=a}return i()}return!1}}}isAreaEmpty(e,t,i,o){let a={x:e||0,y:t||0,w:i||1,h:o||1};return!this.collide(a)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();let i=this.batchMode;i||this.batchUpdate();let o=this._inColumnResize;o||(this._inColumnResize=!0);let a=this.nodes;return this.nodes=[],a.forEach((l,d,f)=>{let s;l.locked||(l.autoPosition=!0,e==="list"&&d&&(s=f[d-1])),this.addNode(l,!1,s)}),o||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=D.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){let i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){e._id=e._id??r._idSeq++;let i=e.id;if(i){let a=1;for(;this.nodes.find(l=>l.id===e.id&&l!==e);)e.id=i+"_"+a++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);let o={x:0,y:0,w:1,h:1};return D.defaults(e,o),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,D.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=o.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=o.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=o.w),isNaN(e.h)&&(e.h=o.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){let i=e._orig||D.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id&&this.findCacheLayout(e,this.defaultColumn)===-1){let a=$({},e);a.autoPosition||a.x===void 0?(delete a.x,delete a.y):a.x=Math.min(this.defaultColumn-1,a.x),a.w=Math.min(this.defaultColumn,a.w||1),this.cacheOneLayout(a,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),D.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!D.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;let t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=D.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||D.samePos(e,e._orig)||(D.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,o){let a=o?o.y*i+(o.x+o.w):0,l=!1;for(let d=a;!l;++d){let f=d%i,s=Math.floor(d/i);if(f+e.w>i)continue;let c={x:f,y:s,w:e.w,h:e.h};t.find(p=>D.isIntercepted(c,p))||((e.x!==f||e.y!==s)&&(e._dirty=!0),e.x=f,e.y=s,delete e.autoPosition,l=!0)}return l}addNode(e,t=!1,i){let o=this.nodes.find(l=>l._id===e._id);if(o)return o;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let a;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,a=!0),this.nodes.push(e),t&&this.addedNodes.push(e),a||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(o=>o._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(o=>o._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(o=>o._removeDOM=!0);let i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i,o=new r({column:this.column,float:this.float,nodes:this.nodes.map(l=>l._id===e._id?(i=$({},l),i):$({},l))});if(!i)return!1;let a=o.moveNode(i,t)&&o.getRow()<=Math.max(this.getRow(),this.maxRow);if(!a&&!t.resizing&&t.collide){let l=t.collide.el.gridstackNode;if(this.swap(e,l))return this._notify(),!0}return a?(o.nodes.filter(l=>l._dirty).forEach(l=>{let d=this.nodes.find(f=>f._id===l._id);d&&(D.copyPos(d,l),d._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new r({column:this.column,float:this.float,nodes:this.nodes.map(o=>$({},o))}),i=$({},e);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=D.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);let o=e.w!==t.w||e.h!==t.h,a=D.copyPos({},e,!0);if(D.copyPos(a,t),this.nodeBoundFix(a,o),D.copyPos(t,a),!t.forceCollide&&D.samePos(e,t))return!1;let l=D.copyPos({},e),d=this.collideAll(e,a,t.skip),f=!0;if(d.length){let s=e._moving&&!t.nested,c=s?this.directionCollideCoverage(e,t,d):d[0];if(s&&c&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){let p=D.areaIntercept(t.rect,c._rect),y=D.area(t.rect),k=D.area(c._rect);p/(y<k?y:k)>.8&&(c.grid.makeSubGrid(c.el,void 0,e),c=void 0)}c?f=!this._fixCollisions(e,a,c,t):(f=!1,i&&delete t.pack)}return f&&!D.samePos(e,a)&&(e._dirty=!0,D.copyPos(e,a)),t.pack&&this._packNodes()._notify(),!D.samePos(e,l)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t){let i=this._layouts?.length,o=i&&this.column!==i-1?this._layouts[i-1]:null,a=[];return this.sortNodes(),this.nodes.forEach(l=>{let d=o?.find(s=>s._id===l._id),f=$($({},l),d||{});D.removeInternalForSave(f,!e),t&&t(l,f),a.push(f)}),a}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let o=i/this.column;e.forEach(a=>{if(!a._orig)return;let l=t.find(d=>d._id===a._id);l&&(l.y>=0&&a.y!==a._orig.y&&(l.y+=a.y-a._orig.y),a.x!==a._orig.x&&(l.x=Math.round(a.x*o)),a.w!==a._orig.w&&(l.w=Math.round(a.w*o)))})}}),this)}columnChanged(e,t,i="moveScale"){if(!this.nodes.length||!t||e===t)return this;let o=i==="compact"||i==="list";o&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let a=[],l=o?this.nodes:D.sort(this.nodes,-1);if(t>e&&this._layouts){let d=this._layouts[t]||[],f=this._layouts.length-1;!d.length&&e!==f&&this._layouts[f]?.length&&(e=f,this._layouts[f].forEach(s=>{let c=l.find(p=>p._id===s._id);c&&(!o&&!s.autoPosition&&(c.x=s.x??c.x,c.y=s.y??c.y),c.w=s.w??c.w,(s.x==null||s.y===void 0)&&(c.autoPosition=!0))})),d.forEach(s=>{let c=l.findIndex(p=>p._id===s._id);if(c!==-1){let p=l[c];if(o){p.w=s.w;return}(s.autoPosition||isNaN(s.x)||isNaN(s.y))&&this.findEmptyPosition(s,a),s.autoPosition||(p.x=s.x??p.x,p.y=s.y??p.y,p.w=s.w??p.w,a.push(p)),l.splice(c,1)}})}if(o)this.compact(i,!1);else{if(l.length)if(typeof i=="function")i(t,e,a,l);else{let d=o||i==="none"?1:t/e,f=i==="move"||i==="moveScale",s=i==="scale"||i==="moveScale";l.forEach(c=>{c.x=t===1?0:f?Math.round(c.x*d):Math.min(c.x,t-1),c.w=t===1||e===1?1:s?Math.round(c.w*d)||1:Math.min(c.w,t),a.push(c)}),l=[]}a=D.sort(a,-1),this._inColumnResize=!0,this.nodes=[],a.forEach(d=>{this.addNode(d,!1),delete d._orig})}return this.nodes.forEach(d=>delete d._orig),this.batchUpdate(!1,!o),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let o=[];return e.forEach((a,l)=>{if(a._id===void 0){let d=a.id?this.nodes.find(f=>f.id===a.id):void 0;a._id=d?._id??r._idSeq++}o[l]={x:a.x,y:a.y,w:a.w,_id:a._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=o,this}cacheOneLayout(e,t){e._id=e._id??r._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];let o=this.findCacheLayout(e,t);return o===-1?this._layouts[t].push(i):this._layouts[t][o]=i,this}findCacheLayout(e,t){return this._layouts?.[t]?.findIndex(i=>i._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){let i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(let t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}return r._idSeq=0,r})();var zt={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};var ne=class{};var Dt=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),ri=class{};function wo(r,n){r.touches.length>1||(r.cancelable&&r.preventDefault(),D.simulateMouseEvent(r.changedTouches[0],n))}function Vd(r,n){r.cancelable&&r.preventDefault(),D.simulateMouseEvent(r,n)}function Zn(r){ri.touchHandled||(ri.touchHandled=!0,wo(r,"mousedown"))}function Jn(r){ri.touchHandled&&wo(r,"mousemove")}function er(r){if(!ri.touchHandled)return;ri.pointerLeaveTimeout&&(window.clearTimeout(ri.pointerLeaveTimeout),delete ri.pointerLeaveTimeout);let n=!!ne.dragElement;wo(r,"mouseup"),n||wo(r,"click"),ri.touchHandled=!1}function tr(r){r.pointerType!=="mouse"&&r.target.releasePointerCapture(r.pointerId)}function Ua(r){ne.dragElement&&r.pointerType!=="mouse"&&Vd(r,"mouseenter")}function qa(r){ne.dragElement&&r.pointerType!=="mouse"&&(ri.pointerLeaveTimeout=window.setTimeout(()=>{delete ri.pointerLeaveTimeout,Vd(r,"mouseleave")},10))}var Ld=(()=>{class r{constructor(e,t,i){this.host=e,this.dir=t,this.option=i,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){let e=this.el=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(`${r.prefix}${this.dir}`),e.style.zIndex="100",e.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Dt&&(this.el.addEventListener("touchstart",Zn),this.el.addEventListener("pointerdown",tr)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Dt&&(this.el.removeEventListener("touchstart",Zn),this.el.removeEventListener("pointerdown",tr)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Dt&&(this.el.addEventListener("touchmove",Jn),this.el.addEventListener("touchend",er)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){let t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Dt&&(this.el.removeEventListener("touchmove",Jn),this.el.removeEventListener("touchend",er)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}return r.prefix="ui-resizable-",r})();var qi=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(n,e){this._eventRegister[n]=e}off(n){delete this._eventRegister[n]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(n,e){if(!this.disabled&&this._eventRegister&&this._eventRegister[n])return this._eventRegister[n](e)}};var Fd=(()=>{class r extends qi{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{let o=this.el.parentElement.getBoundingClientRect(),a={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},l=this.temporalRect||a;return{position:{left:(l.left-o.left)*this.rectScale.x,top:(l.top-o.top)*this.rectScale.y},size:{width:l.width*this.rectScale.x,height:l.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){let t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(o=>this.option[o]=e[o]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),ne.overResizeElement===this&&delete ne.overResizeElement),this}_mouseOver(e){ne.overResizeElement||ne.dragElement||(ne.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){ne.overResizeElement===this&&(delete ne.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new Ld(this.el,e,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:t=>{this._resizing(t,e)}})),this}_resizeStart(e){this.sizeToContent=D.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=D.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();let t=D.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();let i=D.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){let t=D.initEvent(e,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=r._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let e=this.el.parentElement,t=D.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return r._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){let i=this.startEvent,o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=e.clientX-i.clientX,l=this.sizeToContent?0:e.clientY-i.clientY,d,f;t.indexOf("e")>-1?o.width+=a:t.indexOf("w")>-1&&(o.width-=a,o.left+=a,d=!0),t.indexOf("s")>-1?o.height+=l:t.indexOf("n")>-1&&(o.height-=l,o.top+=l,f=!0);let s=this._constrainSize(o.width,o.height,d,f);return Math.round(o.width)!==Math.round(s.width)&&(t.indexOf("w")>-1&&(o.left+=o.width-s.width),o.width=s.width),Math.round(o.height)!==Math.round(s.height)&&(t.indexOf("n")>-1&&(o.top+=o.height-s.height),o.height=s.height),o}_constrainSize(e,t,i,o){let a=this.option,l=(i?a.maxWidthMoveLeft:a.maxWidth)||Number.MAX_SAFE_INTEGER,d=a.minWidth/this.rectScale.x||e,f=(o?a.maxHeightMoveUp:a.maxHeight)||Number.MAX_SAFE_INTEGER,s=a.minHeight/this.rectScale.y||t,c=Math.min(l,Math.max(d,e)),p=Math.min(f,Math.max(s,t));return{width:c,height:p}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let t=this.el.parentElement,{left:i,top:o}=t.getBoundingClientRect();e={left:i,top:o,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{let i=this.temporalRect[t],o=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*o+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}return r._originStyleProp=["width","height","position","left","top","opacity","zIndex"],r})();var Lu='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Hd=(()=>{class r extends qi{constructor(e,t={}){super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=t?.handle?.substring(1),o=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:o?.subGrid?[e.querySelector(t.handle)||e]:Array.from(e.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),Dt&&(e.addEventListener("touchstart",Zn),e.addEventListener("pointerdown",tr))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),Dt&&(t.removeEventListener("touchstart",Zn),t.removeEventListener("pointerdown",tr))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(!ne.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(Lu)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete ne.dragElement,delete ne.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Dt&&(e.currentTarget.addEventListener("touchmove",Jn),e.currentTarget.addEventListener("touchend",er)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),ne.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;let t=D.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){let t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),ne.pauseDrag){let i=Number.isInteger(ne.pauseDrag)?ne.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),i)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,ne.dragElement=this;let i=this.el.gridstackNode?.grid;i?ne.dropElement=i.el.ddElement.ddDroppable:delete ne.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=D.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);let o=D.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(o,this.ui()),this.triggerEvent("dragstart",o),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Dt&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Jn,!0),e.currentTarget.removeEventListener("touchend",er,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),ne.dropElement?.el===this.el.parentElement&&delete ne.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let t=D.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(t),this.triggerEvent("dragstop",t),ne.dropElement&&ne.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete ne.dragElement,delete ne.dropElement,delete ne.mouseHandled,e.preventDefault()}_keyEvent(e){let t=this.el.gridstackNode,i=t?.grid||ne.dropElement?.el?.gridstack;if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!D.canBeRotated(t))return;t._origRotate=t._origRotate||$({},t._orig),delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",D.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=D.cloneNode(this.el)),e.parentElement||D.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=r.originStyleProp.map(t=>this.el.style[t]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging");let t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){let t=this.helper,i=this.dragElementOriginStyle.transition||null;t.style.transition=this.dragElementOriginStyle.transition="none",r.originStyleProp.forEach(o=>t.style[o]=this.dragElementOriginStyle[o]||null),setTimeout(()=>t.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t={left:0,top:0},i=this.helper.style,o=this.dragOffset;i.left=(e.clientX+o.offsetLeft-t.left)*this.dragTransform.xScale+"px",i.top=(e.clientY+o.offsetTop-t.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,t,i){let o=0,a=0;i&&(o=this.dragTransform.xOffset,a=this.dragTransform.yOffset);let l=t.getBoundingClientRect();return{left:l.left,top:l.top,offsetLeft:-e.clientX+l.left-o,offsetTop:-e.clientY+l.top-a,width:l.width*this.dragTransform.xScale,height:l.height*this.dragTransform.yScale}}ui(){let t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:(i.left-t.left)*this.dragTransform.xScale}}}}return r.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"],r})();var ko=class extends qi{constructor(n,e={}){super(),this.el=n,this.option=e,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(n,e){super.on(n,e)}off(n){super.off(n)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Dt&&(this.el.addEventListener("pointerenter",Ua),this.el.addEventListener("pointerleave",qa)))}disable(n=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),n||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Dt&&(this.el.removeEventListener("pointerenter",Ua),this.el.removeEventListener("pointerleave",qa)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(n){return Object.keys(n).forEach(e=>this.option[e]=n[e]),this._setupAccept(),this}_mouseEnter(n){if(!ne.dragElement||!this._canDrop(ne.dragElement.el))return;n.preventDefault(),n.stopPropagation(),ne.dropElement&&ne.dropElement!==this&&ne.dropElement._mouseLeave(n,!0),ne.dropElement=this;let e=D.initEvent(n,{target:this.el,type:"dropover"});this.option.over&&this.option.over(e,this._ui(ne.dragElement)),this.triggerEvent("dropover",e),this.el.classList.add("ui-droppable-over")}_mouseLeave(n,e=!1){if(!ne.dragElement||ne.dropElement!==this)return;n.preventDefault(),n.stopPropagation();let t=D.initEvent(n,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(t,this._ui(ne.dragElement)),this.triggerEvent("dropout",t),ne.dropElement===this&&(delete ne.dropElement,!e)){let i,o=this.el.parentElement;for(;!i&&o;)i=o.ddElement?.ddDroppable,o=o.parentElement;i&&i._mouseEnter(n)}}drop(n){n.preventDefault();let e=D.initEvent(n,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(ne.dragElement)),this.triggerEvent("drop",e)}_canDrop(n){return n&&(!this.accept||this.accept(n))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=n=>n.classList.contains(this.option.accept)||n.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(n){return $({draggable:n.el},n.ui())}};var So=class r{static init(n){return n.ddElement||(n.ddElement=new r(n)),n.ddElement}constructor(n){this.el=n}on(n,e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(n)>-1?this.ddDraggable.on(n,e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(n)>-1?this.ddDroppable.on(n,e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(n)>-1&&this.ddResizable.on(n,e),this}off(n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(n)>-1?this.ddDraggable.off(n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(n)>-1?this.ddDroppable.off(n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(n)>-1&&this.ddResizable.off(n),this}setupDraggable(n){return this.ddDraggable?this.ddDraggable.updateOption(n):this.ddDraggable=new Hd(this.el,n),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(n){return this.ddResizable?this.ddResizable.updateOption(n):this.ddResizable=new Fd(this.el,n),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(n){return this.ddDroppable?this.ddDroppable.updateOption(n):this.ddDroppable=new ko(this.el,n),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Co=class{resizable(n,e,t,i){return this._getDDElements(n,e).forEach(o=>{if(e==="disable"||e==="enable")o.ddResizable&&o.ddResizable[e]();else if(e==="destroy")o.ddResizable&&o.cleanResizable();else if(e==="option")o.setupResizable({[t]:i});else{let l=o.el.gridstackNode.grid,d=o.el.getAttribute("gs-resize-handles")||l.opts.resizable.handles||"e,s,se";d==="all"&&(d="n,e,s,w,se,sw,ne,nw");let f=!l.opts.alwaysShowResizeHandle;o.setupResizable(rt($({},l.opts.resizable),{handles:d,autoHide:f,start:e.start,stop:e.stop,resize:e.resize}))}}),this}draggable(n,e,t,i){return this._getDDElements(n,e).forEach(o=>{if(e==="disable"||e==="enable")o.ddDraggable&&o.ddDraggable[e]();else if(e==="destroy")o.ddDraggable&&o.cleanDraggable();else if(e==="option")o.setupDraggable({[t]:i});else{let a=o.el.gridstackNode.grid;o.setupDraggable(rt($({},a.opts.draggable),{start:e.start,stop:e.stop,drag:e.drag}))}}),this}dragIn(n,e){return this._getDDElements(n).forEach(t=>t.setupDraggable(e)),this}droppable(n,e,t,i){return typeof e.accept=="function"&&!e._accept&&(e._accept=e.accept,e.accept=o=>e._accept(o)),this._getDDElements(n,e).forEach(o=>{e==="disable"||e==="enable"?o.ddDroppable&&o.ddDroppable[e]():e==="destroy"?o.ddDroppable&&o.cleanDroppable():e==="option"?o.setupDroppable({[t]:i}):o.setupDroppable(e)}),this}isDroppable(n){return!!(n?.ddElement?.ddDroppable&&!n.ddElement.ddDroppable.disabled)}isDraggable(n){return!!(n?.ddElement?.ddDraggable&&!n.ddElement.ddDraggable.disabled)}isResizable(n){return!!(n?.ddElement?.ddResizable&&!n.ddElement.ddResizable.disabled)}on(n,e,t){return this._getDDElements(n).forEach(i=>i.on(e,o=>{t(o,ne.dragElement?ne.dragElement.el:o.target,ne.dragElement?ne.dragElement.helper:null)})),this}off(n,e){return this._getDDElements(n).forEach(t=>t.off(e)),this}_getDDElements(n,e){let t=n.gridstack||e!=="destroy"&&e!=="disable",i=D.getElements(n);return i.length?i.map(a=>a.ddElement||(t?So.init(a):null)).filter(a=>a):[]}};var Pt=new Co,ir=(()=>{class r{static init(e={},t=".grid-stack"){if(typeof document>"u")return null;let i=r.getGridElement(t);return i?(i.gridstack||(i.gridstack=new r(i,D.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
4
4
  Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},t=".grid-stack"){let i=[];return typeof document>"u"||(r.getGridElements(t).forEach(o=>{o.gridstack||(o.gridstack=new r(o,D.cloneDeep(e))),i.push(o.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
@@ -116,7 +116,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
116
116
 
117
117
  window.hammerInstance = hammer; // Store the instance to prevent multiple listeners
118
118
  }
119
- `,e.body.appendChild(t)}ngOnDestroy(){window.removeEventListener("message",this.handleIframeGesture),this._authTokenSubscription?.unsubscribe(),this.destroyDataStreams()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-freeboardsk"]],viewQuery:function(t,i){t&1&&ce(i.iframe,mf,5),t&2&&Xe()},features:[fe],decls:5,vars:6,consts:[["freeboardSkIframe",""],[3,"configChange","config","id"],["width","100%","height","100%","frameborder","0","sandbox","allow-same-origin allow-scripts allow-forms",3,"src"],[1,"widgetOverlay"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),B(1,"iframe",2,0),Jr(3,"safe"),ke(4,pf,1,0,"div",3),_()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("src",Tl(3,4,i.widgetUrl),Kr),P(3),Ge(i.dashboard.isDashboardStatic()?-1:4))},dependencies:[Re,th],styles:[".widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent}"]})}return r})();var Zi=wr(us(),1),oh=wr(us(),1);var ff=["gauge"],gf=r=>r.replace(/(\-\w)/g,n=>n[1].toUpperCase()),vf=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nh=r=>gf(r),rh=(()=>{class r{el;zone;canvas;gauge;isInited=!1;preInitValue;preInitOptions;domListener;constructor(e,t){this.el=e,this.zone=t}get options(){let e={};e.renderTo=this.canvas.nativeElement;for(let t of this.el.nativeElement.attributes){let i=nh(t.name);e[i]=Zi.DomObserver.parse(t.value)}for(let t in this.preInitOptions)e[t]=this.preInitOptions[t];return this.isInited&&(this.preInitOptions=null),e}set options(e){if(!this.isInited){this.preInitOptions=e;return}this.update(e)}set value(e){if(!this.isInited){this.preInitValue=e;return}this.zone.runOutsideAngular(()=>{this.gauge.value=e})}update(e){if(e)for(let t in e){let i=e[t].toString();if(t==="value")this.value=Zi.DomObserver.parse(i);else{let o=vf(t);this.el.nativeElement.setAttribute(o,i)}}}ngOnDestroy(){this.destroy(),this.cleanup()}cleanup(){}destroy(){this.stopListeningForDOMEvents(),this.gauge.destroy()}ngAfterViewInit(){this.initGauge(),this.listenForDOMEvents(),this.isInited=!0,this.preInitValue&&(this.value=this.preInitValue)}listenForDOMEvents(){this.domListener=new MutationObserver(e=>{let t={};e.forEach(i=>{i.type==="attributes"&&(t[nh(i.attributeName)]=Zi.DomObserver.parse(this.el.nativeElement.getAttribute(i.attributeName)))}),this.basicUpdate(t)}),this.domListener.observe(this.el.nativeElement,{attributes:!0})}stopListeningForDOMEvents(){this.domListener&&(this.domListener.disconnect(),this.domListener=null)}initGauge(){let e=this.options;(!e.hasOwnProperty("renderTo")||!e.renderTo)&&(e.renderTo=this.canvas.nativeElement),this.basicUpdate(e)}basicUpdate(e){typeof e.value=="number"&&(this.value=e.value,delete e.value),Object.keys(e).length&&this.gauge.update(e)}static \u0275fac=function(t){return new(t||r)(Rt(Ee),Rt(ut))};static \u0275dir=bi({type:r,viewQuery:function(t,i){if(t&1&&Je(ff,7),t&2){let o;je(o=Ue())&&(i.canvas=o.first)}},inputs:{options:"options",value:"value"}})}return r})();var zo=(()=>{class r extends rh{constructor(e,t){super(e,t)}ngOnInit(){this.gauge=new Zi.LinearGauge(this.options).draw()}static \u0275fac=function(t){return new(t||r)(Rt(Ee),Rt(ut))};static \u0275cmp=G({type:r,selectors:[["linear-gauge"]],features:[fe],decls:2,vars:0,consts:[["gauge",""]],template:function(t,i){t&1&&B(0,"canvas",null,0)},encapsulation:2})}return r})();var Vo=(()=>{class r extends rh{constructor(e,t){super(e,t)}ngOnInit(){this.gauge=new Zi.RadialGauge(this.options).draw()}static \u0275fac=function(t){return new(t||r)(Rt(Ee),Rt(ut))};static \u0275cmp=G({type:r,selectors:[["radial-gauge"]],features:[fe],decls:2,vars:0,consts:[["gauge",""]],template:function(t,i){t&1&&B(0,"canvas",null,0)},encapsulation:2})}return r})(),hr=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Jt({type:r});static \u0275inj=$t({})}return r})();var ah=["compassGauge"];function ps(r){let n=r.match(/(\d+(\.\d+)?|\.\d+)/g);if(!n||n.length<3)throw new Error("Invalid RGBA format");let[e,t,i,o=1]=n.map(Number),a=o===1?"":Math.round(o*255).toString(16).padStart(2,"0").toUpperCase();return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1).toUpperCase()+a}function yf(r){return r<0&&(r=360+r),r}var sh=(()=>{class r extends Ie{DEG="deg";LINE="line";NEEDLE_START=40;NEEDLE_END=100;NEEDLE_CIRCLE_SIZE=15;BORDER_MIDDLE_WIDTH=2;BORDER_INNER_WIDTH=2;ANIMATION_TARGET_PLATE="plate";ANIMATION_TARGET_NEEDLE="needle";textValue="--";value=0;ngGauge;gauge;gaugeOptions={};colorStrokeTicks="";unitName=null;state=te.Normal;negToPortPaths=["self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater"];constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",isConvertUnitToConfigurable:!1,convertUnitTo:this.DEG,sampleTime:500}},gauge:{type:"ngRadial",subType:"baseplateCompass",enableTicks:!0,compassUseNumbers:!1,showValueBox:!1},enableTimeout:!1,color:"contrast",dataTimeout:5},Fe(()=>{this.theme()&&this.startWidget()})}ngOnInit(){this.validateConfig(),this.setGaugeConfig()}startWidget(){this.setGaugeConfig(),this.ngGauge.update(this.gaugeOptions),this.unsubscribeDataStream(),this.observeDataStream("gaugePath",e=>{(!e||!e.data)&&(e={data:{value:0,timestamp:new Date},state:te.Normal},this.textValue="--",this.value=0),e.state==null&&(e.state=te.Normal);let t=this.negToPortPaths.includes(this.widgetProperties.config.paths.gaugePath.path)?yf(e.data.value):e.data.value;if(this.value=Math.min(Math.max(t,0),360),this.textValue=this.value.toFixed(0),this.state!==e.state){this.state=e.state;let i={};switch(e.state){case te.Emergency:i.colorValueText=this.theme().zoneEmergency;break;case te.Alarm:i.colorValueText=this.theme().zoneAlarm;break;case te.Warn:i.colorValueText=this.theme().zoneWarn;break;case te.Alert:i.colorValueText=this.theme().zoneAlert;break;default:i.colorValueText=this.theme().contrast}this.ngGauge.update(i)}})}updateConfig(e){this.widgetProperties.config=e,this.setCanvasHight(),this.startWidget()}setCanvasHight(){let e=this.gauge.nativeElement.getBoundingClientRect(),t={};t.height=e.height,t.width=e.width,this.ngGauge.update(t)}ngAfterViewInit(){this.setCanvasHight(),this.startWidget()}onResized(e){let t={};t.height=e.contentRect.height,t.width=e.contentRect.width,this.ngGauge.update(t)}setGaugeConfig(){this.gaugeOptions.title=this.widgetProperties.config.displayName?this.widgetProperties.config.displayName:"",this.gaugeOptions.minValue=0,this.gaugeOptions.maxValue=360,this.gaugeOptions.valueDec=0,this.gaugeOptions.valueInt=1,this.gaugeOptions.units="",this.gaugeOptions.barProgress=!1,this.gaugeOptions.barWidth=0,this.gaugeOptions.valueBox=this.widgetProperties.config.gauge.showValueBox,this.gaugeOptions.fontValueSize=60,this.gaugeOptions.valueBoxWidth=26,this.gaugeOptions.valueBoxBorderRadius=10,this.gaugeOptions.valueBoxStroke=0,this.gaugeOptions.ticksAngle=360,this.gaugeOptions.startAngle=180,this.gaugeOptions.exactTicks=!1,this.gaugeOptions.strokeTicks="",this.gaugeOptions.majorTicks=this.widgetProperties.config.gauge.compassUseNumbers?["N","30","60","E","120","150","S","210","240","W","300","330","N"]:["N","NE","E","SE","S","SW","W","NW","N"],this.gaugeOptions.majorTicksDec=0,this.gaugeOptions.majorTicksInt=1,this.gaugeOptions.numbersMargin=5,this.gaugeOptions.fontNumbersSize=25,this.gaugeOptions.minorTicks=this.widgetProperties.config.gauge.compassUseNumbers?3:2,this.gaugeOptions.needle=!0,this.gaugeOptions.needleType=this.LINE,this.gaugeOptions.needleStart=this.NEEDLE_START,this.gaugeOptions.needleEnd=this.NEEDLE_END,this.gaugeOptions.needleCircleSize=this.NEEDLE_CIRCLE_SIZE,this.gaugeOptions.needleWidth=4,this.gaugeOptions.needleShadow=!1,this.gaugeOptions.needleCircleInner=!1,this.gaugeOptions.needleCircleOuter=!1,this.gaugeOptions.borders=!0,this.gaugeOptions.borderOuterWidth=0,this.gaugeOptions.borderMiddleWidth=this.BORDER_MIDDLE_WIDTH,this.gaugeOptions.borderInnerWidth=this.BORDER_INNER_WIDTH,this.gaugeOptions.borderShadowWidth=0,this.gaugeOptions.highlights=[],this.gaugeOptions.fontTitle="Roboto",this.gaugeOptions.fontTitleWeight="normal",this.gaugeOptions.fontTitleSize=25,this.gaugeOptions.fontUnits="Roboto",this.gaugeOptions.fontUnitsSize=25,this.gaugeOptions.fontUnitsWeight="normal",this.gaugeOptions.barStrokeWidth=0,this.gaugeOptions.barShadow=0,this.gaugeOptions.fontValue="Roboto",this.gaugeOptions.fontValueWeight="bold",this.gaugeOptions.valueTextShadow=!1,this.gaugeOptions.colorValueBoxShadow="",this.gaugeOptions.fontNumbers="Roboto",this.gaugeOptions.fontNumbersWeight="bold",this.gaugeOptions.highlightsWidth=0,this.widgetProperties.config.gauge.subType==="marineCompass"?(this.gaugeOptions.animationTarget=this.ANIMATION_TARGET_PLATE,this.gaugeOptions.useMinPath=!0):this.widgetProperties.config.gauge.subType==="baseplateCompass"&&(this.gaugeOptions.animationTarget=this.ANIMATION_TARGET_NEEDLE,this.gaugeOptions.useMinPath=!0),this.gaugeOptions.animation=!0,this.gaugeOptions.animateOnInit=!0,this.gaugeOptions.animatedValue=!0,this.gaugeOptions.animationRule="linear",this.gaugeOptions.animationDuration=this.widgetProperties.config.paths.gaugePath.sampleTime-50,this.setGaugeOptions(this.getColors(this.widgetProperties.config.color).color,ps(this.getColors(this.widgetProperties.config.color).dim),ps(this.getColors(this.widgetProperties.config.color).dimmer))}setGaugeOptions(e,t,i){let o=ps(this.getColors("contrast").dim);this.gaugeOptions.colorBarProgress=e,this.gaugeOptions.colorBorderMiddle=t,this.gaugeOptions.colorBorderMiddleEnd=t,this.gaugeOptions.colorNeedle=e,this.gaugeOptions.colorNeedleEnd=e,this.gaugeOptions.colorTitle=o,this.gaugeOptions.colorUnits=o,this.gaugeOptions.colorValueText=e,this.gaugeOptions.colorMinorTicks=o,this.gaugeOptions.colorNumbers=this.widgetProperties.config.gauge.compassUseNumbers?[this.theme().port,o,o,t,o,o,t,o,o,t,o,o,this.theme().port]:[this.theme().port,t,t,t,t,t,t,t,this.theme().port],this.gaugeOptions.colorMajorTicks=this.widgetProperties.config.gauge.compassUseNumbers?[this.theme().port,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().port]:[this.theme().port,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().port],this.gaugeOptions.colorPlate=this.gaugeOptions.colorPlateEnd=this.gaugeOptions.colorBorderInner=this.gaugeOptions.colorBorderInnerEnd=this.theme().cardColor,this.gaugeOptions.colorBar=this.theme().background,this.gaugeOptions.colorBarStroke="",this.gaugeOptions.colorValueBoxBackground=this.theme().background,this.gaugeOptions.colorNeedleShadowUp="",this.gaugeOptions.colorNeedleShadowDown="",this.gaugeOptions.colorNeedleCircleInner=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleInnerEnd=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleOuter=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleOuterEnd=this.gaugeOptions.colorPlate}getColors(e){return{contrast:{color:this.theme().contrast,dim:this.theme().contrastDim,dimmer:this.theme().contrastDimmer},blue:{color:this.theme().blue,dim:this.theme().blueDim,dimmer:this.theme().blueDimmer},green:{color:this.theme().green,dim:this.theme().greenDim,dimmer:this.theme().greenDimmer},pink:{color:this.theme().pink,dim:this.theme().pinkDim,dimmer:this.theme().pinkDimmer},orange:{color:this.theme().orange,dim:this.theme().orangeDim,dimmer:this.theme().orangeDimmer},purple:{color:this.theme().purple,dim:this.theme().purpleDim,dimmer:this.theme().purpleDimmer},yellow:{color:this.theme().yellow,dim:this.theme().yellowDim,dimmer:this.theme().yellowDimmer},grey:{color:this.theme().grey,dim:this.theme().greyDim,dimmer:this.theme().yellowDimmer}}[e]}ngOnDestroy(){this.destroyDataStreams(),this.ngGauge=null,this.gauge=null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-gauge-ng-compass"]],viewQuery:function(t,i){if(t&1&&(Je(ah,7),Je(ah,7,Ee)),t&2){let o;je(o=Ue())&&(i.ngGauge=o.first),je(o=Ue())&&(i.gauge=o.first)}},features:[fe],decls:3,vars:7,consts:[["compassGauge",""],[3,"configChange","config","id"],[3,"onResize","id","options","value"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(1,"radial-gauge",2,0),F("onResize",function(l){return V(o),L(i.onResized(l))}),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),ci("id",i.widgetProperties.uuid),j("options",i.gaugeOptions)("value",i.value),be("value-text",i.textValue)("color-stroke-ticks",i.colorStrokeTicks))},dependencies:[Re,tt,et,hr,Vo],styles:["radial-gauge{display:block;position:relative;width:100%;height:100%} radial-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);padding:10px}"]})}return r})();function Lo(r,n){let e=[],t=n-r,i=0,o=10;t=lh(n-r,!1),i=lh(t/(o-1),!0);let a=Math.floor(r/i)*i,l=Math.ceil(n/i)*i;e.push(a);let d=t/i;for(let f=0;f<d;f++)if(e[f]<l){let s=(Number(e[f].toFixed(2))*100+Number(i.toFixed(2))*100)/100;e.push(s)}return{min:a,max:l,majorTicks:e}}function lh(r,n){let e=Math.floor(Math.log10(r)),t=r/Math.pow(10,e),i=null;return n?1.5>t?i=1:3>t?i=2:7>t?i=5:i=10:1>=t?i=1:2>=t?i=2:5>=t?i=5:i=10,i*Math.pow(10,e)}var dh=["linearGauge"],ch=(()=>{class r extends Ie{ngGauge;gauge;textValue="--";value=0;gaugeOptions={};isGaugeVertical=!0;metaSub;state=te.Normal;constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{lower:0,upper:100,type:"linear"},gauge:{type:"ngLinear",subType:"vertical",enableTicks:!1,highlightsWidth:5,useNeedle:!1},numInt:1,numDecimal:0,color:"contrast",enableTimeout:!1,dataTimeout:5,ignoreZones:!1},Fe(()=>{this.theme()&&this.startWidget()})}ngOnInit(){this.validateConfig()}startWidget(){this.setGaugeConfig(),this.ngGauge.update(this.gaugeOptions),this.unsubscribeDataStream(),this.unsubscribeMetaStream(),this.metaSub?.unsubscribe(),this.observeDataStream("gaugePath",e=>{if((!e||!e.data)&&(e={data:{value:0,timestamp:new Date},state:te.Normal}),e.state==null&&(e.state=te.Normal),this.value=Math.min(Math.max(e.data.value,this.widgetProperties.config.displayScale.lower),this.widgetProperties.config.displayScale.upper),this.state!==e.state){this.state=e.state;let t={};if(!this.widgetProperties.config.ignoreZones)switch(e.state){case te.Emergency:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.theme().zoneEmergency,t.colorValueText=this.theme().zoneEmergency):(t.colorBarProgress=this.theme().zoneEmergency,t.colorValueText=this.theme().zoneEmergency);break;case te.Alarm:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.theme().zoneAlarm,t.colorValueText=this.theme().zoneAlarm):(t.colorBarProgress=this.theme().zoneAlarm,t.colorValueText=this.theme().zoneAlarm);break;case te.Warn:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.theme().zoneWarn,t.colorValueText=this.theme().zoneWarn):(t.colorBarProgress=this.theme().zoneWarn,t.colorValueText=this.theme().zoneWarn);break;case te.Alert:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.theme().zoneAlert,t.colorValueText=this.theme().zoneAlert):(t.colorBarProgress=this.theme().zoneAlert,t.colorValueText=this.theme().zoneAlert);break;default:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.getColors(this.widgetProperties.config.color).color,t.colorValueText=this.getColors(this.widgetProperties.config.color).color):(t.colorBarProgress=this.getColors(this.widgetProperties.config.color).color,t.colorValueText=this.getColors(this.widgetProperties.config.color).color)}this.ngGauge.update(t)}}),this.widgetProperties.config.ignoreZones||(this.observeMetaStream(),this.metaSub=this.zones$.subscribe(e=>{e&&e.length>0&&this.setHighlights(e)}))}updateConfig(e){this.widgetProperties.config=e,this.startWidget()}ngAfterViewInit(){this.setCanvasHight,this.startWidget()}onResized(e){let t={};this.widgetProperties.config.gauge.subType==="vertical"?(t.height=e.contentRect.height,t.width=t.height*.3,t.width>e.contentRect.width&&(t.width=e.contentRect.width,t.height=t.width/.3)):(t.width=e.contentRect.width,t.height=t.width*.3,t.height>e.contentRect.height&&(t.height=e.contentRect.height,t.width=t.height/.3)),t.height-=10,this.ngGauge.update(t)}setCanvasHight(){let e=this.gauge.nativeElement.getBoundingClientRect(),t={};t.height=e.height,t.width=e.width,this.ngGauge.update(t)}setGaugeConfig(){let e=this.widgetProperties.config.gauge.subType==="vertical",t=this.widgetProperties.config.gauge.useNeedle,i=this.widgetProperties.config.gauge.enableTicks,o=Lo(this.widgetProperties.config.displayScale.lower,this.widgetProperties.config.displayScale.upper),a=this.gauge.nativeElement.getBoundingClientRect(),l=null,d=null;this.widgetProperties.config.gauge.subType==="vertical"?(l=a.height,d=a.height*.3):(l=a.width*.3,d=a.width);let f={height:l,width:d,minValue:o.min,maxValue:o.max,valueInt:this.widgetProperties.config.numInt!==void 0&&this.widgetProperties.config.numInt!==null?this.widgetProperties.config.numInt:1,valueDec:this.widgetProperties.config.numDecimal!==void 0&&this.widgetProperties.config.numDecimal!==null?this.widgetProperties.config.numDecimal:2,title:this.widgetProperties.config.displayName,fontTitleSize:40,fontTitle:"Roboto",fontTitleWeight:"bold",barLength:e?80:90,barWidth:i?30:60,barProgress:!0,barBeginCircle:0,barStrokeWidth:0,barShadow:0,needle:!0,needleType:this.widgetProperties.config.gauge.useNeedle?"arrow":"line",needleShadow:!1,needleSide:"both",needleStart:this.widgetProperties.config.gauge.useNeedle?22:-45,needleEnd:this.widgetProperties.config.gauge.useNeedle?120:55,colorNeedleEnd:"",colorNeedleShadowUp:"",colorNeedleShadowDown:"black",units:this.widgetProperties.config.paths.gaugePath.convertUnitTo,fontUnits:"Roboto",fontUnitsWeight:"normal",borders:!1,borderOuterWidth:0,colorBorderOuter:"red",colorBorderOuterEnd:"red",borderMiddleWidth:0,colorBorderMiddle:"#63afdf",colorBorderMiddleEnd:"#63afdf",borderInnerWidth:0,colorBorderInner:"red",colorBorderInnerEnd:"#121212",borderShadowWidth:0,borderRadius:0,colorBarEnd:"",colorBarStroke:"0",valueBoxStroke:0,colorValueBoxRect:"",colorValueBoxRectEnd:"",colorValueBoxBackground:this.theme().background,fontValueSize:50,fontValue:"Roboto",fontValueWeight:"bold",valueTextShadow:!1,colorValueBoxShadow:"",fontNumbers:"Roboto",fontNumbersWeight:"normal",fontUnitsSize:this.isGaugeVertical?40:35,colorTitle:this.getColors("contrast").dim,colorUnits:this.getColors("contrast").dim,colorValueText:this.getColors(this.widgetProperties.config.color).color,colorPlate:this.theme().cardColor,colorBar:this.theme().background,colorMajorTicks:this.getColors("contrast").dim,colorMinorTicks:this.getColors("contrast").dim,colorNumbers:this.getColors("contrast").dim,majorTicks:i?o.majorTicks:[],majorTicksInt:this.widgetProperties.config.numInt!==void 0&&this.widgetProperties.config.numInt!==null?this.widgetProperties.config.numInt:1,majorTicksDec:this.widgetProperties.config.numDecimal!==void 0&&this.widgetProperties.config.numDecimal!==null?this.widgetProperties.config.numDecimal:2,numberSide:"left",fontNumbersSize:i?25:0,numbersMargin:e?8:4,tickSide:"left",ticksWidth:i?10:0,ticksPadding:0,strokeTicks:!1,minorTicks:i?2:0,ticksWidthMinor:i?6:0,valueBox:!0,valueBoxWidth:35,valueBoxBorderRadius:10,highlights:[],highlightsWidth:this.widgetProperties.config.gauge.highlightsWidth,animation:!0,animationRule:"linear",animatedValue:!1,animateOnInit:!1,animationDuration:this.widgetProperties.config.paths.gaugePath.sampleTime-25};Object.assign(this.gaugeOptions,f),this.setThemePaletteColor()}setThemePaletteColor(){let e="",t="";switch(this.widgetProperties.config.color){case"contrast":e=this.theme().contrast,t=this.theme().contrastDim;break;case"blue":e=this.theme().blue,t=this.theme().blueDim;break;case"green":e=this.theme().green,t=this.theme().greenDim;break;case"pink":e=this.theme().pink,t=this.theme().pinkDim;break;case"orange":e=this.theme().orange,t=this.theme().orangeDim;break;case"purple":e=this.theme().purple,t=this.theme().purpleDim;break;case"grey":e=this.theme().grey,t=this.theme().greyDim;break;case"yellow":e=this.theme().yellow,t=this.theme().yellowDim;break;default:e=this.theme().contrast,t=this.theme().contrastDim;break}Object.assign(this.gaugeOptions,{colorBarProgress:this.widgetProperties.config.gauge.useNeedle?"":e,colorBarProgressEnd:"",colorNeedle:this.widgetProperties.config.gauge.useNeedle?e:t,needleWidth:this.widgetProperties.config.gauge.useNeedle?20:0})}getColors(e){return{contrast:{color:this.theme().contrast,dim:this.theme().contrastDim,dimmer:this.theme().contrastDimmer},blue:{color:this.theme().blue,dim:this.theme().blueDim,dimmer:this.theme().blueDimmer},green:{color:this.theme().green,dim:this.theme().greenDim,dimmer:this.theme().greenDimmer},pink:{color:this.theme().pink,dim:this.theme().pinkDim,dimmer:this.theme().pinkDimmer},orange:{color:this.theme().orange,dim:this.theme().orangeDim,dimmer:this.theme().orangeDimmer},purple:{color:this.theme().purple,dim:this.theme().purpleDim,dimmer:this.theme().purpleDimmer},yellow:{color:this.theme().yellow,dim:this.theme().yellowDim,dimmer:this.theme().yellowDimmer},grey:{color:this.theme().grey,dim:this.theme().greyDim,dimmer:this.theme().yellowDimmer}}[e]}setHighlights(e){let t=[],i=[...e].sort((a,l)=>a.lower-l.lower);for(let a of i){let l=null,d=null,f;switch(a.state){case te.Emergency:f=this.theme().zoneEmergency;break;case te.Alarm:f=this.theme().zoneAlarm;break;case te.Warn:f=this.theme().zoneWarn;break;case te.Alert:f=this.theme().zoneAlert;break;case te.Nominal:f=this.theme().zoneNominal;break;default:f="rgba(0,0,0,0)"}if(l=this.unitsService.convertToUnit(this.widgetProperties.config.paths.gaugePath.convertUnitTo,a.lower),d=this.unitsService.convertToUnit(this.widgetProperties.config.paths.gaugePath.convertUnitTo,a.upper),!(d<this.widgetProperties.config.displayScale.lower||l>this.widgetProperties.config.displayScale.upper)){if(l=l!==null?l:this.widgetProperties.config.displayScale.lower,d=d!==null?d:this.widgetProperties.config.displayScale.upper,l=Math.max(l,this.widgetProperties.config.displayScale.lower),d>this.widgetProperties.config.displayScale.upper){d=this.widgetProperties.config.displayScale.upper,t.push({from:l,to:d,color:f});break}t.push({from:l,to:d,color:f})}}let o={};o.highlightsWidth=this.widgetProperties.config.gauge.highlightsWidth,o.highlights=JSON.stringify(t,null,1),this.ngGauge.update(o)}ngOnDestroy(){this.destroyDataStreams(),this.metaSub?.unsubscribe(),this.ngGauge=null,this.gauge=null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-gauge-ng-linear"]],viewQuery:function(t,i){if(t&1&&(Je(dh,7,zo),Je(dh,7,Ee)),t&2){let o;je(o=Ue())&&(i.ngGauge=o.first),je(o=Ue())&&(i.gauge=o.first)}},features:[fe],decls:4,vars:5,consts:[["host",""],["linearGauge",""],[3,"configChange","config","id"],[1,"linearGauge",3,"onResize","id","options","value"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",2,0),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(2,"linear-gauge",3,1),F("onResize",function(l){return V(o),L(i.onResized(l))}),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(2),ci("id",i.widgetProperties.uuid),j("options",i.gaugeOptions)("value",i.value))},dependencies:[Re,tt,et,hr,zo],styles:["linear-gauge{display:block;position:relative;width:100%;height:100%} linear-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);margin-top:5px}"]})}return r})();var hh=["radialGauge"],uh=(()=>{class r extends Ie{LINE="line";ANIMATION_TARGET_NEEDLE="needle";ngGauge;gauge;textValue="--";value=0;gaugeOptions={};colorStrokeTicks="";unitName=null;metaSub;state=te.Normal;constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{lower:0,upper:100,type:"linear"},gauge:{type:"ngRadial",subType:"measuring",enableTicks:!0,compassUseNumbers:!1,highlightsWidth:5},numInt:1,numDecimal:0,enableTimeout:!1,color:"contrast",dataTimeout:5,ignoreZones:!1},Fe(()=>{this.theme()&&this.startWidget()})}ngOnInit(){this.validateConfig(),this.setGaugeConfig()}startWidget(){this.setGaugeConfig(),this.ngGauge.update(this.gaugeOptions),this.unsubscribeDataStream(),this.unsubscribeMetaStream(),this.metaSub?.unsubscribe(),this.observeDataStream("gaugePath",e=>{if((!e||!e.data)&&(e={data:{value:0,timestamp:new Date},state:te.Normal}),e.state==null&&(e.state=te.Normal),this.value=Math.min(Math.max(e.data.value,this.widgetProperties.config.displayScale.lower),this.widgetProperties.config.displayScale.upper),this.state!==e.state){this.state=e.state;let t={};if(!this.widgetProperties.config.ignoreZones)switch(e.state){case te.Alarm:t.colorBorderMiddle=this.theme().cardColor,t.colorBarProgress=this.theme().zoneAlarm,t.colorValueText=this.theme().zoneAlarm;break;case te.Warn:t.colorBorderMiddle=this.theme().cardColor,t.colorBarProgress=this.theme().zoneWarn,t.colorValueText=this.theme().zoneWarn;break;case te.Alert:t.colorBorderMiddle=this.theme().cardColor,t.colorBarProgress=this.theme().zoneAlert,t.colorValueText=this.theme().zoneAlert;break;default:t.colorBorderMiddle=this.theme().cardColor,t.colorBarProgress=this.widgetProperties.config.gauge.subType=="measuring"?this.getColors(this.widgetProperties.config.color).color:this.getColors(this.widgetProperties.config.color).dim,t.colorValueText=this.getColors(this.widgetProperties.config.color).color}this.ngGauge.update(t)}}),this.widgetProperties.config.ignoreZones||(this.observeMetaStream(),this.metaSub=this.zones$.subscribe(e=>{e&&e.length>0&&this.widgetProperties.config.gauge.subType=="measuring"&&this.setHighlights(e)}))}updateConfig(e){this.widgetProperties.config=e,this.setCanvasHight(),this.startWidget()}setCanvasHight(){let e=this.gauge.nativeElement.getBoundingClientRect(),t={};t.height=e.height,t.width=e.width,this.ngGauge.update(t)}ngAfterViewInit(){this.setCanvasHight(),this.startWidget()}onResized(e){let t={};t.height=e.contentRect.height,t.width=e.contentRect.width,this.ngGauge.update(t)}setGaugeConfig(){switch(this.gaugeOptions.title=this.widgetProperties.config.displayName?this.widgetProperties.config.displayName:"",this.gaugeOptions.highlights=[],this.gaugeOptions.fontTitle="Roboto",this.gaugeOptions.fontTitleWeight="bold",this.gaugeOptions.fontUnits="Roboto",this.gaugeOptions.fontUnitsSize=25,this.gaugeOptions.fontUnitsWeight="normal",this.gaugeOptions.barStrokeWidth=0,this.gaugeOptions.barShadow=0,this.gaugeOptions.colorBarStroke="",this.gaugeOptions.fontValue="Roboto",this.gaugeOptions.fontValueWeight="bold",this.gaugeOptions.valueTextShadow=!1,this.gaugeOptions.colorValueBoxShadow="",this.gaugeOptions.fontNumbers="Roboto",this.gaugeOptions.fontNumbersWeight="bold",this.gaugeOptions.valueInt=this.widgetProperties.config.numInt!==void 0&&this.widgetProperties.config.numInt!==null?this.widgetProperties.config.numInt:1,this.gaugeOptions.valueDec=this.widgetProperties.config.numDecimal!==void 0&&this.widgetProperties.config.numDecimal!==null?this.widgetProperties.config.numDecimal:2,this.gaugeOptions.majorTicksInt=this.widgetProperties.config.numInt!==void 0&&this.widgetProperties.config.numInt!==null?this.widgetProperties.config.numInt:1,this.gaugeOptions.majorTicksDec=this.widgetProperties.config.numDecimal!==void 0&&this.widgetProperties.config.numDecimal!==null?this.widgetProperties.config.numDecimal:2,this.gaugeOptions.highlightsWidth=this.widgetProperties.config.gauge.highlightsWidth,this.gaugeOptions.animation=!0,this.gaugeOptions.animateOnInit=!1,this.gaugeOptions.animatedValue=!1,this.gaugeOptions.animationRule="linear",this.gaugeOptions.animationDuration=this.widgetProperties.config.paths.gaugePath.sampleTime-25,this.gaugeOptions.colorBorderShadow=!1,this.gaugeOptions.colorBorderOuter=this.theme().cardColor,this.gaugeOptions.colorBorderOuterEnd="",this.gaugeOptions.colorBorderMiddle=this.theme().cardColor,this.gaugeOptions.colorBorderMiddleEnd="",this.gaugeOptions.colorBarProgress=this.getColors(this.widgetProperties.config.color).color,this.gaugeOptions.colorNeedle=this.getColors(this.widgetProperties.config.color).dim,this.gaugeOptions.colorNeedleEnd=this.getColors(this.widgetProperties.config.color).dim,this.gaugeOptions.colorTitle=this.theme().contrastDim,this.gaugeOptions.colorUnits=this.theme().contrastDim,this.gaugeOptions.colorValueText=this.getColors(this.widgetProperties.config.color).color,this.colorStrokeTicks=this.theme().contrastDim,this.gaugeOptions.colorMinorTicks=this.theme().contrastDim,this.gaugeOptions.colorNumbers=this.theme().contrastDim,this.gaugeOptions.colorMajorTicks=this.theme().contrastDim,this.gaugeOptions.colorPlate=this.gaugeOptions.colorPlateEnd=this.theme().cardColor,this.gaugeOptions.colorBar=this.theme().background,this.gaugeOptions.colorNeedleShadowUp="",this.gaugeOptions.colorNeedleShadowDown="black",this.gaugeOptions.colorNeedleCircleInner=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleInnerEnd=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleOuter=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleOuterEnd=this.gaugeOptions.colorPlate,this.widgetProperties.config.gauge.subType){case"capacity":this.configureCapacityGauge();break;case"measuring":this.configureMeasuringGauge();break;default:}}getColors(e){return{contrast:{color:this.theme().contrast,dim:this.theme().contrastDim,dimmer:this.theme().contrastDimmer},blue:{color:this.theme().blue,dim:this.theme().blueDim,dimmer:this.theme().blueDimmer},green:{color:this.theme().green,dim:this.theme().greenDim,dimmer:this.theme().greenDimmer},pink:{color:this.theme().pink,dim:this.theme().pinkDim,dimmer:this.theme().pinkDimmer},orange:{color:this.theme().orange,dim:this.theme().orangeDim,dimmer:this.theme().orangeDimmer},purple:{color:this.theme().purple,dim:this.theme().purpleDim,dimmer:this.theme().purpleDimmer},yellow:{color:this.theme().yellow,dim:this.theme().yellowDim,dimmer:this.theme().yellowDimmer},grey:{color:this.theme().grey,dim:this.theme().greyDim,dimmer:this.theme().yellowDimmer}}[e]}configureCapacityGauge(){this.gaugeOptions.minValue=this.widgetProperties.config.displayScale.lower,this.gaugeOptions.maxValue=this.widgetProperties.config.displayScale.upper,this.gaugeOptions.units=this.widgetProperties.config.paths.gaugePath.convertUnitTo,this.gaugeOptions.fontTitleSize=40,this.gaugeOptions.barProgress=!0,this.gaugeOptions.barWidth=20,this.gaugeOptions.colorBarProgress=this.getColors(this.widgetProperties.config.color).dim,this.gaugeOptions.valueBox=!0,this.gaugeOptions.fontValueSize=60,this.gaugeOptions.valueBoxWidth=10,this.gaugeOptions.valueBoxBorderRadius=5,this.gaugeOptions.valueBoxStroke=0,this.gaugeOptions.colorValueBoxBackground="",this.gaugeOptions.colorValueBoxRect="",this.gaugeOptions.colorValueBoxRectEnd="",this.gaugeOptions.ticksAngle=360,this.gaugeOptions.startAngle=180,this.gaugeOptions.majorTicks=0,this.gaugeOptions.exactTicks=!0,this.gaugeOptions.strokeTicks=!1,this.gaugeOptions.minorTicks=0,this.gaugeOptions.numbersMargin=0,this.gaugeOptions.fontNumbersSize=0,this.gaugeOptions.colorMajorTicks=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNumbers=this.gaugeOptions.colorMinorTicks="",this.gaugeOptions.needle=!0,this.gaugeOptions.needleType=this.LINE,this.gaugeOptions.needleWidth=2,this.gaugeOptions.needleShadow=!1,this.gaugeOptions.needleStart=75,this.gaugeOptions.needleEnd=95,this.gaugeOptions.needleCircleSize=1,this.gaugeOptions.needleCircleInner=!1,this.gaugeOptions.needleCircleOuter=!1,this.gaugeOptions.borders=!0,this.gaugeOptions.borderOuterWidth=2,this.gaugeOptions.borderMiddleWidth=1,this.gaugeOptions.borderInnerWidth=0,this.gaugeOptions.borderShadowWidth=0,this.gaugeOptions.animationTarget=this.ANIMATION_TARGET_NEEDLE,this.gaugeOptions.useMinPath=!1}configureMeasuringGauge(){let e=this.widgetProperties.config.paths.gaugePath.convertUnitTo,t=Lo(this.widgetProperties.config.displayScale.lower,this.widgetProperties.config.displayScale.upper);this.gaugeOptions.minValue=t.min,this.gaugeOptions.maxValue=t.max,this.gaugeOptions.units=this.widgetProperties.config.paths.gaugePath.convertUnitTo,this.gaugeOptions.fontTitleSize=24,this.gaugeOptions.barProgress=!0,this.gaugeOptions.barWidth=15,this.gaugeOptions.valueBox=!0,this.gaugeOptions.fontValueSize=60,this.gaugeOptions.valueBoxWidth=100,this.gaugeOptions.valueBoxBorderRadius=0,this.gaugeOptions.valueBoxStroke=0,this.gaugeOptions.colorValueBoxBackground="",this.gaugeOptions.exactTicks=!1,this.gaugeOptions.majorTicks=t.majorTicks,this.gaugeOptions.minorTicks=2,this.gaugeOptions.ticksAngle=270,this.gaugeOptions.startAngle=45,this.gaugeOptions.strokeTicks=!0,this.gaugeOptions.numbersMargin=3,this.gaugeOptions.fontNumbersSize=15,this.gaugeOptions.needle=!0,this.gaugeOptions.needleType=this.LINE,this.gaugeOptions.needleWidth=2,this.gaugeOptions.needleShadow=!1,this.gaugeOptions.needleStart=0,this.gaugeOptions.needleEnd=95,this.gaugeOptions.needleCircleSize=10,this.gaugeOptions.needleCircleInner=!1,this.gaugeOptions.needleCircleOuter=!1,this.gaugeOptions.borders=!0,this.gaugeOptions.borderOuterWidth=2,this.gaugeOptions.borderMiddleWidth=1,this.gaugeOptions.borderInnerWidth=0,this.gaugeOptions.borderShadowWidth=0,this.gaugeOptions.animationTarget=this.ANIMATION_TARGET_NEEDLE,this.gaugeOptions.useMinPath=!1}setHighlights(e){let t=[],i=[...e].sort((a,l)=>a.lower-l.lower);for(let a of i){let l=null,d=null,f;switch(a.state){case te.Emergency:f=this.theme().zoneEmergency;break;case te.Alarm:f=this.theme().zoneAlarm;break;case te.Warn:f=this.theme().zoneWarn;break;case te.Alert:f=this.theme().zoneAlert;break;case te.Nominal:f=this.theme().zoneNominal;break;default:f="rgba(0,0,0,0)"}if(l=this.unitsService.convertToUnit(this.widgetProperties.config.paths.gaugePath.convertUnitTo,a.lower),d=this.unitsService.convertToUnit(this.widgetProperties.config.paths.gaugePath.convertUnitTo,a.upper),!(d<this.widgetProperties.config.displayScale.lower||l>this.widgetProperties.config.displayScale.upper)){if(l=l!==null?l:this.widgetProperties.config.displayScale.lower,d=d!==null?d:this.widgetProperties.config.displayScale.upper,l=Math.max(l,this.widgetProperties.config.displayScale.lower),d>this.widgetProperties.config.displayScale.upper){d=this.widgetProperties.config.displayScale.upper,t.push({from:l,to:d,color:f});break}t.push({from:l,to:d,color:f})}}let o={};o.highlightsWidth=this.widgetProperties.config.gauge.highlightsWidth,o.highlights=JSON.stringify(t,null,1),this.ngGauge.update(o)}ngOnDestroy(){this.destroyDataStreams(),this.metaSub?.unsubscribe(),this.ngGauge=null,this.gauge=null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-gauge-ng-radial"]],viewQuery:function(t,i){if(t&1&&(Je(hh,7),Je(hh,7,Ee)),t&2){let o;je(o=Ue())&&(i.ngGauge=o.first),je(o=Ue())&&(i.gauge=o.first)}},features:[fe],decls:3,vars:5,consts:[["radialGauge",""],[3,"configChange","config","id"],[3,"onResize","id","options","value"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(1,"radial-gauge",2,0),F("onResize",function(l){return V(o),L(i.onResized(l))}),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),ci("id",i.widgetProperties.uuid),j("options",i.gaugeOptions)("value",i.value))},dependencies:[Re,tt,et,hr,Vo],styles:["radial-gauge{display:block;position:relative;width:100%;height:100%} radial-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);padding:0}"]})}return r})();var fs={darkGray:steelseries.BackgroundColor.DARK_GRAY,satinGray:steelseries.BackgroundColor.SATIN_GRAY,lightGray:steelseries.BackgroundColor.LIGHT_GRAY,white:steelseries.BackgroundColor.WHITE,black:steelseries.BackgroundColor.BLACK,beige:steelseries.BackgroundColor.BEIGE,brown:steelseries.BackgroundColor.BROWN,red:steelseries.BackgroundColor.RED,green:steelseries.BackgroundColor.GREEN,blue:steelseries.BackgroundColor.BLUE,anthracite:steelseries.BackgroundColor.ANTHRACITE,mud:steelseries.BackgroundColor.MUD,punchedSheet:steelseries.BackgroundColor.PUNCHED_SHEET,carbon:steelseries.BackgroundColor.CARBON,stainless:steelseries.BackgroundColor.STAINLESS,brushedMetal:steelseries.BackgroundColor.BRUSHED_METAL,brushedStainless:steelseries.BackgroundColor.BRUSHED_STAINLESS,turned:steelseries.BackgroundColor.TURNED},gs={blackMetal:steelseries.FrameDesign.BLACK_METAL,metal:steelseries.FrameDesign.METAL,shinyMetal:steelseries.FrameDesign.SHINY_METAL,brass:steelseries.FrameDesign.BRASS,steel:steelseries.FrameDesign.STEEL,chrome:steelseries.FrameDesign.CHROME,gold:steelseries.FrameDesign.GOLD,anthracite:steelseries.FrameDesign.ANTHRACITE,tiltedGray:steelseries.FrameDesign.TILTED_GRAY,tiltedBlack:steelseries.FrameDesign.TILTED_BLACK,glossyMetal:steelseries.FrameDesign.GLOSSY_METAL},mh=(()=>{class r{unitsService=M(Yn);widgetUUID=Q(void 0);subType=Q(void 0);barGauge=Q(void 0);radialSize=Q(void 0);backgroundColor=Q(void 0);frameColor=Q(void 0);minValue=Q(void 0);maxValue=Q(void 0);decimals=Q(void 0);zones=Q(void 0);title=Q(void 0);units=Q(void 0);value=Q(void 0);theme=Q(void 0,{alias:"themeColors"});gaugeStarted=!1;gauge;gaugeOptions={};paddingTop=0;ngOnInit(){this.buildOptions()}buildOptions(){this.gaugeOptions.minValue=this.minValue(),this.gaugeOptions.maxValue=this.maxValue();let e=this.decimals();this.gaugeOptions.lcdDecimals=e??2,this.gaugeOptions.titleString=this.title(),this.gaugeOptions.unitString=this.units(),this.subType()=="radial"&&(this.gaugeOptions.gaugeType=this.setGaugeType(this.radialSize()));let t=this.zones();if(t){let i=[],o=[],a=[...t].sort((l,d)=>l.lower-d.lower);for(let l of a){let d=null,f=null,s;switch(l.state){case te.Emergency:s=this.theme().zoneEmergency;break;case te.Alarm:s=this.theme().zoneAlarm;break;case te.Warn:s=this.theme().zoneWarn;break;case te.Alert:s=this.theme().zoneAlert;break;case te.Nominal:s=this.theme().zoneNominal;break;default:s="rgba(0,0,0,0)"}let c=this.units();if(c=="ratio"?(d=l.lower,f=l.upper):(d=this.unitsService.convertToUnit(c,l.lower),f=this.unitsService.convertToUnit(c,l.upper)),!(f<this.minValue()||d>this.maxValue())){if(d=d!==null?d:this.minValue(),f=f!==null?f:this.maxValue(),d=Math.max(d,this.minValue()),f>this.maxValue()){f=this.maxValue(),i.push(steelseries.Section(d,f,s));break}i.push(steelseries.Section(d,f,s))}}this.gaugeOptions.section=i,this.gaugeOptions.area=o,this.gaugeOptions.useSectionColors=!0}fs[this.backgroundColor()]&&(this.gaugeOptions.backgroundColor=fs[this.backgroundColor()]),gs[this.frameColor()]&&(this.gaugeOptions.frameDesign=gs[this.frameColor()]),this.barGauge()&&(this.gaugeOptions.valueColor=steelseries.ColorDef.GREEN),this.gaugeOptions.lcdVisible=!0,this.gaugeOptions.thresholdVisible=!1,this.gaugeOptions.threshold=this.maxValue(),this.gaugeOptions.ledVisible=!1}setGaugeType(e){switch(e){case"quarter":return steelseries.GaugeType.TYPE1;case"half":return steelseries.GaugeType.TYPE2;case"three-quarter":return steelseries.GaugeType.TYPE3;case"full":default:return steelseries.GaugeType.TYPE4}}startGauge(){this.gaugeStarted=!0,this.buildOptions();let e=this.subType();e=="radial"?this.gauge=new steelseries.Radial(this.widgetUUID(),this.gaugeOptions):e=="linear"&&(this.barGauge()?this.gauge=new steelseries.LinearBargraph(this.widgetUUID(),this.gaugeOptions):this.gauge=new steelseries.Linear(this.widgetUUID(),this.gaugeOptions))}onResized(e){if(!(e.contentRect.height<50||e.contentRect.width<50)){if(this.subType()=="radial"){let t=Math.min(e.contentRect.height,e.contentRect.width);this.gaugeOptions.size=t}else this.gaugeOptions.width=e.contentRect.width,this.gaugeOptions.height=e.contentRect.height;this.startGauge()}}ngOnChanges(e){this.gaugeStarted&&(e.value&&!e.value.firstChange&&this.gauge.setValueAnimated(e.value.currentValue),e.zones&&this.startGauge(),e.title&&this.gauge.setTitleString(e.title.currentValue),e.backgroundColor&&this.gauge.setBackgroundColor(fs[e.backgroundColor.currentValue]),e.frameColor&&this.gauge.setFrameDesign(gs[e.frameColor.currentValue]),e.radialSize&&this.startGauge(),e.minValue&&this.gauge.setMinValue(e.minValue.currentValue),e.maxValue&&this.gauge.setMaxValue(e.maxValue.currentValue))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["gauge-steel"]],inputs:{widgetUUID:[1,"widgetUUID"],subType:[1,"subType"],barGauge:[1,"barGauge"],radialSize:[1,"radialSize"],backgroundColor:[1,"backgroundColor"],frameColor:[1,"frameColor"],minValue:[1,"minValue"],maxValue:[1,"maxValue"],decimals:[1,"decimals"],zones:[1,"zones"],title:[1,"title"],units:[1,"units"],value:[1,"value"],theme:[1,"themeColors","theme"]},features:[Zt],decls:4,vars:1,consts:[["gauge",""],[1,"wrapper",3,"onResize"],[2,"z-index","inherit",3,"id"]],template:function(t,i){if(t&1){let o=ee();v(0,"div",1),F("onResize",function(l){return V(o),L(i.onResized(l))}),v(1,"canvas",2,0),E(3," Browser does not support canvas element. "),_()()}t&2&&(P(),ci("id",i.widgetUUID()))},dependencies:[tt,et],styles:[".sgWrapper[_ngcontent-%COMP%]{height:100%;width:100%;text-align:center}"]})}return r})();var ph=(()=>{class r extends Ie{dataValue=0;zones=[];metaSub;constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{type:"linear",lower:0,upper:100},gauge:{type:"steel",subType:"radial",backgroundColor:"carbon",faceColor:"anthracite",radialSize:"full",rotateFace:!1,digitalMeter:!1},numDecimal:2,enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}ngOnInit(){this.validateConfig(),this.startWidget()}startWidget(){this.unsubscribeDataStream(),this.unsubscribeMetaStream(),this.metaSub?.unsubscribe(),this.observeDataStream("gaugePath",e=>{(!e||!e.data)&&(e={data:{value:0,timestamp:new Date},state:"normal"}),this.dataValue=Math.min(Math.max(e.data.value,this.widgetProperties.config.displayScale.lower),this.widgetProperties.config.displayScale.upper)}),this.widgetProperties.config.ignoreZones?this.zones=[]:(this.observeMetaStream(),this.metaSub=this.zones$.subscribe(e=>{e?e.length>0?this.zones=e:this.zones=[]:this.zones=[]}))}updateConfig(e){this.widgetProperties.config=e,this.startWidget()}ngOnDestroy(){this.destroyDataStreams(),this.metaSub?.unsubscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-gauge-steel"]],features:[fe],decls:2,vars:16,consts:[[3,"configChange","config","id"],[3,"widgetUUID","subType","barGauge","radialSize","backgroundColor","frameColor","minValue","maxValue","decimals","zones","title","units","value","themeColors"]],template:function(t,i){t&1&&(v(0,"widget-host",0),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),B(1,"gauge-steel",1),_()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("widgetUUID",i.widgetProperties.uuid)("subType",i.widgetProperties.config.gauge.subType)("barGauge",i.widgetProperties.config.gauge.digitalMeter)("radialSize",i.widgetProperties.config.gauge.radialSize)("backgroundColor",i.widgetProperties.config.gauge.backgroundColor)("frameColor",i.widgetProperties.config.gauge.faceColor)("minValue",i.widgetProperties.config.displayScale.lower)("maxValue",i.widgetProperties.config.displayScale.upper)("decimals",i.widgetProperties.config.numDecimal)("zones",i.zones)("title",i.widgetProperties.config.displayName)("units",i.widgetProperties.config.paths.gaugePath.convertUnitTo)("value",i.dataValue)("themeColors",i.theme()))},dependencies:[Re,mh],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}gauge-steel[_ngcontent-%COMP%]{display:block;position:relative;width:100%;height:100%} .wrapper{display:block;position:relative;width:100%;height:100%;padding:10px} .wrapper>canvas{display:block;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}"]})}return r})();var bf=["plainIframe"];function _f(r,n){if(r&1&&B(0,"iframe",2,0),r&2){let e=se();j("src",e.widgetUrl,Kr)}}function wf(r,n){r&1&&(v(0,"div",3)(1,"h2"),E(2,"Empty or bad URL"),_(),v(3,"p"),E(4," IMPORTANT: cross-domain security rules (CORS) apply to this widget. "),_(),v(5,"p"),E(6,"Typically, you can load Grafana graphs, Signal K apps or other related tools. "),_()())}var fh=(()=>{class r extends Ie{_sanitizer=M(Ln);_dashboard=M(lt);iframe;widgetUrl=null;displayTransparentOverlay=an("block");constructor(){super(),this.defaultConfig={widgetUrl:null,allowInput:!1},Fe(()=>{this._dashboard.isDashboardStatic()?this.displayTransparentOverlay.set(this.widgetProperties.config.allowInput?"none":"block"):this.displayTransparentOverlay.set("block")})}ngOnInit(){this.validateConfig(),this.validateUrlAccess(this.widgetProperties?.config?.widgetUrl),window.addEventListener("message",this.handleIframeGesture),this.displayTransparentOverlay.set(this.widgetProperties.config.allowInput?"none":"block")}ngAfterViewInit(){this.iframe&&(this.iframe.nativeElement.onload=()=>this.injectHammerJS())}startWidget(){}ngOnDestroy(){window.removeEventListener("message",this.handleIframeGesture)}handleIframeGesture=e=>{if(e.data){if(e.data.gesture&&e.data.eventData.instanceId===this.widgetProperties.uuid)switch(e.data.gesture){case"swipeup":this._dashboard.previousDashboard();break;case"swipedown":this._dashboard.nextDashboard();break;case"swipeleft":let t=new Event("openLeftSidenav",{bubbles:!0,cancelable:!0});window.document.dispatchEvent(t);break;case"swiperight":let i=new Event("openRightSidenav",{bubbles:!0,cancelable:!0});window.document.dispatchEvent(i);break;default:break}if(e.data.type==="keydown"&&e.data.keyEventData.instanceId===this.widgetProperties.uuid){let{key:t,ctrlKey:i,shiftKey:o}=e.data.keyEventData,a=new KeyboardEvent("keydown",{key:t,ctrlKey:i,shiftKey:o,bubbles:!0,cancelable:!0});document.dispatchEvent(a)}}};injectHammerJS(){let e=document.getElementsByTagName("base")[0]?.href||"/",t=this.iframe.nativeElement.contentWindow,i=this.iframe.nativeElement.contentDocument;if(!i||!t){console.error("[WidgetIframe] Iframe contentDocument or contentWindow is undefined. Possible cross-origin issue or iframe not fully loaded.");return}if(t.Hammer){console.log("[WidgetIframe] HammerJS already loaded in iframe");return}let o=i.createElement("script");o.src=`${e}assets/hammer.min.js`,o.onload=()=>this.injectSwipeHandler(),i.body.appendChild(o)}injectSwipeHandler(){let e=this.iframe.nativeElement.contentDocument;if(!e){console.error("[WidgetIframe] Iframe contentDocument is undefined. Possible cross-origin issue or iframe not fully loaded.");return}let t=e.createElement("script");t.textContent=`
119
+ `,e.body.appendChild(t)}ngOnDestroy(){window.removeEventListener("message",this.handleIframeGesture),this._authTokenSubscription?.unsubscribe(),this.destroyDataStreams()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-freeboardsk"]],viewQuery:function(t,i){t&1&&ce(i.iframe,mf,5),t&2&&Xe()},features:[fe],decls:5,vars:6,consts:[["freeboardSkIframe",""],[3,"configChange","config","id"],["width","100%","height","100%","frameborder","0","sandbox","allow-same-origin allow-scripts allow-forms",3,"src"],[1,"widgetOverlay"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),B(1,"iframe",2,0),Jr(3,"safe"),ke(4,pf,1,0,"div",3),_()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("src",Tl(3,4,i.widgetUrl),Kr),P(3),Ge(i.dashboard.isDashboardStatic()?-1:4))},dependencies:[Re,th],styles:[".widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent}"]})}return r})();var Zi=wr(us(),1),oh=wr(us(),1);var ff=["gauge"],gf=r=>r.replace(/(\-\w)/g,n=>n[1].toUpperCase()),vf=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nh=r=>gf(r),rh=(()=>{class r{el;zone;canvas;gauge;isInited=!1;preInitValue;preInitOptions;domListener;constructor(e,t){this.el=e,this.zone=t}get options(){let e={};e.renderTo=this.canvas.nativeElement;for(let t of this.el.nativeElement.attributes){let i=nh(t.name);e[i]=Zi.DomObserver.parse(t.value)}for(let t in this.preInitOptions)e[t]=this.preInitOptions[t];return this.isInited&&(this.preInitOptions=null),e}set options(e){if(!this.isInited){this.preInitOptions=e;return}this.update(e)}set value(e){if(!this.isInited){this.preInitValue=e;return}this.zone.runOutsideAngular(()=>{this.gauge.value=e})}update(e){if(e)for(let t in e){let i=e[t].toString();if(t==="value")this.value=Zi.DomObserver.parse(i);else{let o=vf(t);this.el.nativeElement.setAttribute(o,i)}}}ngOnDestroy(){this.destroy(),this.cleanup()}cleanup(){}destroy(){this.stopListeningForDOMEvents(),this.gauge.destroy()}ngAfterViewInit(){this.initGauge(),this.listenForDOMEvents(),this.isInited=!0,this.preInitValue&&(this.value=this.preInitValue)}listenForDOMEvents(){this.domListener=new MutationObserver(e=>{let t={};e.forEach(i=>{i.type==="attributes"&&(t[nh(i.attributeName)]=Zi.DomObserver.parse(this.el.nativeElement.getAttribute(i.attributeName)))}),this.basicUpdate(t)}),this.domListener.observe(this.el.nativeElement,{attributes:!0})}stopListeningForDOMEvents(){this.domListener&&(this.domListener.disconnect(),this.domListener=null)}initGauge(){let e=this.options;(!e.hasOwnProperty("renderTo")||!e.renderTo)&&(e.renderTo=this.canvas.nativeElement),this.basicUpdate(e)}basicUpdate(e){typeof e.value=="number"&&(this.value=e.value,delete e.value),Object.keys(e).length&&this.gauge.update(e)}static \u0275fac=function(t){return new(t||r)(Rt(Ee),Rt(ut))};static \u0275dir=bi({type:r,viewQuery:function(t,i){if(t&1&&Je(ff,7),t&2){let o;je(o=Ue())&&(i.canvas=o.first)}},inputs:{options:"options",value:"value"}})}return r})();var zo=(()=>{class r extends rh{constructor(e,t){super(e,t)}ngOnInit(){this.gauge=new Zi.LinearGauge(this.options).draw()}static \u0275fac=function(t){return new(t||r)(Rt(Ee),Rt(ut))};static \u0275cmp=G({type:r,selectors:[["linear-gauge"]],features:[fe],decls:2,vars:0,consts:[["gauge",""]],template:function(t,i){t&1&&B(0,"canvas",null,0)},encapsulation:2})}return r})();var Vo=(()=>{class r extends rh{constructor(e,t){super(e,t)}ngOnInit(){this.gauge=new Zi.RadialGauge(this.options).draw()}static \u0275fac=function(t){return new(t||r)(Rt(Ee),Rt(ut))};static \u0275cmp=G({type:r,selectors:[["radial-gauge"]],features:[fe],decls:2,vars:0,consts:[["gauge",""]],template:function(t,i){t&1&&B(0,"canvas",null,0)},encapsulation:2})}return r})(),hr=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Jt({type:r});static \u0275inj=$t({})}return r})();var ah=["compassGauge"];function ps(r){let n=r.match(/(\d+(\.\d+)?|\.\d+)/g);if(!n||n.length<3)throw new Error("Invalid RGBA format");let[e,t,i,o=1]=n.map(Number),a=o===1?"":Math.round(o*255).toString(16).padStart(2,"0").toUpperCase();return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1).toUpperCase()+a}function yf(r){return r<0&&(r=360+r),r}var sh=(()=>{class r extends Ie{DEG="deg";LINE="line";NEEDLE_START=40;NEEDLE_END=100;NEEDLE_CIRCLE_SIZE=15;BORDER_MIDDLE_WIDTH=2;BORDER_INNER_WIDTH=2;ANIMATION_TARGET_PLATE="plate";ANIMATION_TARGET_NEEDLE="needle";textValue="--";value=0;ngGauge;gauge;gaugeOptions={};colorStrokeTicks="";unitName=null;state=te.Normal;negToPortPaths=["self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater"];constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",isConvertUnitToConfigurable:!1,convertUnitTo:this.DEG,sampleTime:500}},gauge:{type:"ngRadial",subType:"baseplateCompass",enableTicks:!0,compassUseNumbers:!1,showValueBox:!1},enableTimeout:!1,color:"contrast",dataTimeout:5},Fe(()=>{this.theme()&&this.startWidget()})}ngOnInit(){this.validateConfig(),this.setGaugeConfig()}startWidget(){this.setGaugeConfig(),this.ngGauge.update(this.gaugeOptions),this.unsubscribeDataStream(),this.observeDataStream("gaugePath",e=>{(!e||!e.data)&&(e={data:{value:0,timestamp:new Date},state:te.Normal},this.textValue="--",this.value=0),e.state==null&&(e.state=te.Normal);let t=this.negToPortPaths.includes(this.widgetProperties.config.paths.gaugePath.path)?yf(e.data.value):e.data.value;if(this.value=Math.min(Math.max(t,0),360),this.textValue=this.value.toFixed(0),this.state!==e.state){this.state=e.state;let i={};switch(e.state){case te.Emergency:i.colorValueText=this.theme().zoneEmergency;break;case te.Alarm:i.colorValueText=this.theme().zoneAlarm;break;case te.Warn:i.colorValueText=this.theme().zoneWarn;break;case te.Alert:i.colorValueText=this.theme().zoneAlert;break;default:i.colorValueText=this.theme().contrast}this.ngGauge.update(i)}})}updateConfig(e){this.widgetProperties.config=e,this.setCanvasHight(),this.startWidget()}setCanvasHight(){let e=this.gauge.nativeElement.getBoundingClientRect(),t={};t.height=e.height,t.width=e.width,this.ngGauge.update(t)}ngAfterViewInit(){this.setCanvasHight(),this.startWidget()}onResized(e){let t={};t.height=e.contentRect.height,t.width=e.contentRect.width,this.ngGauge.update(t)}setGaugeConfig(){this.gaugeOptions.title=this.widgetProperties.config.displayName?this.widgetProperties.config.displayName:"",this.gaugeOptions.minValue=0,this.gaugeOptions.maxValue=360,this.gaugeOptions.valueDec=0,this.gaugeOptions.valueInt=1,this.gaugeOptions.units="",this.gaugeOptions.barProgress=!1,this.gaugeOptions.barWidth=0,this.gaugeOptions.valueBox=this.widgetProperties.config.gauge.showValueBox,this.gaugeOptions.fontValueSize=60,this.gaugeOptions.valueBoxWidth=26,this.gaugeOptions.valueBoxBorderRadius=10,this.gaugeOptions.valueBoxStroke=0,this.gaugeOptions.ticksAngle=360,this.gaugeOptions.startAngle=180,this.gaugeOptions.exactTicks=!1,this.gaugeOptions.strokeTicks="",this.gaugeOptions.majorTicks=this.widgetProperties.config.gauge.compassUseNumbers?["N","30","60","E","120","150","S","210","240","W","300","330","N"]:["N","NE","E","SE","S","SW","W","NW","N"],this.gaugeOptions.majorTicksDec=0,this.gaugeOptions.majorTicksInt=1,this.gaugeOptions.numbersMargin=5,this.gaugeOptions.fontNumbersSize=25,this.gaugeOptions.minorTicks=this.widgetProperties.config.gauge.compassUseNumbers?3:2,this.gaugeOptions.needle=!0,this.gaugeOptions.needleType=this.LINE,this.gaugeOptions.needleStart=this.NEEDLE_START,this.gaugeOptions.needleEnd=this.NEEDLE_END,this.gaugeOptions.needleCircleSize=this.NEEDLE_CIRCLE_SIZE,this.gaugeOptions.needleWidth=4,this.gaugeOptions.needleShadow=!1,this.gaugeOptions.needleCircleInner=!1,this.gaugeOptions.needleCircleOuter=!1,this.gaugeOptions.borders=!0,this.gaugeOptions.borderOuterWidth=0,this.gaugeOptions.borderMiddleWidth=this.BORDER_MIDDLE_WIDTH,this.gaugeOptions.borderInnerWidth=this.BORDER_INNER_WIDTH,this.gaugeOptions.borderShadowWidth=0,this.gaugeOptions.highlights=[],this.gaugeOptions.fontTitle="Roboto",this.gaugeOptions.fontTitleWeight="normal",this.gaugeOptions.fontTitleSize=25,this.gaugeOptions.fontUnits="Roboto",this.gaugeOptions.fontUnitsSize=25,this.gaugeOptions.fontUnitsWeight="normal",this.gaugeOptions.barStrokeWidth=0,this.gaugeOptions.barShadow=0,this.gaugeOptions.fontValue="Roboto",this.gaugeOptions.fontValueWeight="bold",this.gaugeOptions.valueTextShadow=!1,this.gaugeOptions.colorValueBoxShadow="",this.gaugeOptions.fontNumbers="Roboto",this.gaugeOptions.fontNumbersWeight="bold",this.gaugeOptions.highlightsWidth=0,this.widgetProperties.config.gauge.subType==="marineCompass"?(this.gaugeOptions.animationTarget=this.ANIMATION_TARGET_PLATE,this.gaugeOptions.useMinPath=!0):this.widgetProperties.config.gauge.subType==="baseplateCompass"&&(this.gaugeOptions.animationTarget=this.ANIMATION_TARGET_NEEDLE,this.gaugeOptions.useMinPath=!0),this.gaugeOptions.animation=!0,this.gaugeOptions.animateOnInit=!0,this.gaugeOptions.animatedValue=!0,this.gaugeOptions.animationRule="linear",this.gaugeOptions.animationDuration=this.widgetProperties.config.paths.gaugePath.sampleTime-50,this.setGaugeOptions(this.getColors(this.widgetProperties.config.color).color,ps(this.getColors(this.widgetProperties.config.color).dim),ps(this.getColors(this.widgetProperties.config.color).dimmer))}setGaugeOptions(e,t,i){let o=ps(this.getColors("contrast").dim);this.gaugeOptions.colorBarProgress=e,this.gaugeOptions.colorBorderMiddle=t,this.gaugeOptions.colorBorderMiddleEnd=t,this.gaugeOptions.colorNeedle=e,this.gaugeOptions.colorNeedleEnd=e,this.gaugeOptions.colorTitle=o,this.gaugeOptions.colorUnits=o,this.gaugeOptions.colorValueText=e,this.gaugeOptions.colorMinorTicks=o,this.gaugeOptions.colorNumbers=this.widgetProperties.config.gauge.compassUseNumbers?[this.theme().port,o,o,t,o,o,t,o,o,t,o,o,this.theme().port]:[this.theme().port,t,t,t,t,t,t,t,this.theme().port],this.gaugeOptions.colorMajorTicks=this.widgetProperties.config.gauge.compassUseNumbers?[this.theme().port,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().port]:[this.theme().port,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().contrast,this.theme().port],this.gaugeOptions.colorPlate=this.gaugeOptions.colorPlateEnd=this.gaugeOptions.colorBorderInner=this.gaugeOptions.colorBorderInnerEnd=this.theme().cardColor,this.gaugeOptions.colorBar=this.theme().background,this.gaugeOptions.colorBarStroke="",this.gaugeOptions.colorValueBoxBackground=this.theme().background,this.gaugeOptions.colorNeedleShadowUp="",this.gaugeOptions.colorNeedleShadowDown="",this.gaugeOptions.colorNeedleCircleInner=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleInnerEnd=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleOuter=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleOuterEnd=this.gaugeOptions.colorPlate}getColors(e){return{contrast:{color:this.theme().contrast,dim:this.theme().contrastDim,dimmer:this.theme().contrastDimmer},blue:{color:this.theme().blue,dim:this.theme().blueDim,dimmer:this.theme().blueDimmer},green:{color:this.theme().green,dim:this.theme().greenDim,dimmer:this.theme().greenDimmer},pink:{color:this.theme().pink,dim:this.theme().pinkDim,dimmer:this.theme().pinkDimmer},orange:{color:this.theme().orange,dim:this.theme().orangeDim,dimmer:this.theme().orangeDimmer},purple:{color:this.theme().purple,dim:this.theme().purpleDim,dimmer:this.theme().purpleDimmer},yellow:{color:this.theme().yellow,dim:this.theme().yellowDim,dimmer:this.theme().yellowDimmer},grey:{color:this.theme().grey,dim:this.theme().greyDim,dimmer:this.theme().yellowDimmer}}[e]}ngOnDestroy(){this.destroyDataStreams(),this.ngGauge=null,this.gauge=null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-gauge-ng-compass"]],viewQuery:function(t,i){if(t&1&&(Je(ah,7),Je(ah,7,Ee)),t&2){let o;je(o=Ue())&&(i.ngGauge=o.first),je(o=Ue())&&(i.gauge=o.first)}},features:[fe],decls:3,vars:7,consts:[["compassGauge",""],[3,"configChange","config","id"],[3,"onResize","id","options","value"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(1,"radial-gauge",2,0),F("onResize",function(l){return V(o),L(i.onResized(l))}),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),ci("id",i.widgetProperties.uuid),j("options",i.gaugeOptions)("value",i.value),be("value-text",i.textValue)("color-stroke-ticks",i.colorStrokeTicks))},dependencies:[Re,tt,et,hr,Vo],styles:["radial-gauge{display:block;position:relative;width:100%;height:100%} radial-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);padding:10px}"]})}return r})();function Lo(r,n){let e=[],t=n-r,i=0,o=10;t=lh(n-r,!1),i=lh(t/(o-1),!0);let a=Math.floor(r/i)*i,l=Math.ceil(n/i)*i;e.push(a);let d=t/i;for(let f=0;f<d;f++)if(e[f]<l){let s=(Number(e[f].toFixed(2))*100+Number(i.toFixed(2))*100)/100;e.push(s)}return{min:a,max:l,majorTicks:e}}function lh(r,n){let e=Math.floor(Math.log10(r)),t=r/Math.pow(10,e),i=null;return n?1.5>t?i=1:3>t?i=2:7>t?i=5:i=10:1>=t?i=1:2>=t?i=2:5>=t?i=5:i=10,i*Math.pow(10,e)}var dh=["linearGauge"],ch=(()=>{class r extends Ie{ngGauge;gauge;textValue="--";value=0;gaugeOptions={};isGaugeVertical=!0;metaSub;state=te.Normal;constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{lower:0,upper:100,type:"linear"},gauge:{type:"ngLinear",subType:"vertical",enableTicks:!1,highlightsWidth:5,useNeedle:!1},numInt:1,numDecimal:0,color:"contrast",enableTimeout:!1,dataTimeout:5,ignoreZones:!1},Fe(()=>{this.theme()&&this.startWidget()})}ngOnInit(){this.validateConfig()}startWidget(){this.setGaugeConfig(),this.ngGauge.update(this.gaugeOptions),this.unsubscribeDataStream(),this.unsubscribeMetaStream(),this.metaSub?.unsubscribe(),this.observeDataStream("gaugePath",e=>{if((!e||!e.data)&&(e={data:{value:0,timestamp:new Date},state:te.Normal}),e.state==null&&(e.state=te.Normal),this.value=Math.min(Math.max(e.data.value,this.widgetProperties.config.displayScale.lower),this.widgetProperties.config.displayScale.upper),this.state!==e.state){this.state=e.state;let t={};if(!this.widgetProperties.config.ignoreZones)switch(e.state){case te.Emergency:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.theme().zoneEmergency,t.colorValueText=this.theme().zoneEmergency):(t.colorBarProgress=this.theme().zoneEmergency,t.colorValueText=this.theme().zoneEmergency);break;case te.Alarm:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.theme().zoneAlarm,t.colorValueText=this.theme().zoneAlarm):(t.colorBarProgress=this.theme().zoneAlarm,t.colorValueText=this.theme().zoneAlarm);break;case te.Warn:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.theme().zoneWarn,t.colorValueText=this.theme().zoneWarn):(t.colorBarProgress=this.theme().zoneWarn,t.colorValueText=this.theme().zoneWarn);break;case te.Alert:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.theme().zoneAlert,t.colorValueText=this.theme().zoneAlert):(t.colorBarProgress=this.theme().zoneAlert,t.colorValueText=this.theme().zoneAlert);break;default:this.widgetProperties.config.gauge.useNeedle?(t.colorNeedle=this.getColors(this.widgetProperties.config.color).color,t.colorValueText=this.getColors(this.widgetProperties.config.color).color):(t.colorBarProgress=this.getColors(this.widgetProperties.config.color).color,t.colorValueText=this.getColors(this.widgetProperties.config.color).color)}this.ngGauge.update(t)}}),this.widgetProperties.config.ignoreZones||(this.observeMetaStream(),this.metaSub=this.zones$.subscribe(e=>{e&&e.length>0&&this.setHighlights(e)}))}updateConfig(e){this.widgetProperties.config=e,this.startWidget()}ngAfterViewInit(){this.setCanvasHight,this.startWidget()}onResized(e){let t={};this.widgetProperties.config.gauge.subType==="vertical"?(t.height=e.contentRect.height,t.width=t.height*.3,t.width>e.contentRect.width&&(t.width=e.contentRect.width,t.height=t.width/.3)):(t.width=e.contentRect.width,t.height=t.width*.3,t.height>e.contentRect.height&&(t.height=e.contentRect.height,t.width=t.height/.3)),t.height-=10,this.ngGauge.update(t)}setCanvasHight(){let e=this.gauge.nativeElement.getBoundingClientRect(),t={};t.height=e.height,t.width=e.width,this.ngGauge.update(t)}setGaugeConfig(){let e=this.widgetProperties.config.gauge.subType==="vertical",t=this.widgetProperties.config.gauge.useNeedle,i=this.widgetProperties.config.gauge.enableTicks,o=Lo(this.widgetProperties.config.displayScale.lower,this.widgetProperties.config.displayScale.upper),a=this.gauge.nativeElement.getBoundingClientRect(),l=null,d=null;this.widgetProperties.config.gauge.subType==="vertical"?(l=a.height,d=a.height*.3):(l=a.width*.3,d=a.width);let f={height:l,width:d,minValue:o.min,maxValue:o.max,valueInt:this.widgetProperties.config.numInt!==void 0&&this.widgetProperties.config.numInt!==null?this.widgetProperties.config.numInt:1,valueDec:this.widgetProperties.config.numDecimal!==void 0&&this.widgetProperties.config.numDecimal!==null?this.widgetProperties.config.numDecimal:2,title:this.widgetProperties.config.displayName,fontTitleSize:40,fontTitle:"Roboto",fontTitleWeight:"bold",barLength:e?80:90,barWidth:i?30:60,barProgress:!0,barBeginCircle:0,barStrokeWidth:0,barShadow:0,needle:!0,needleType:this.widgetProperties.config.gauge.useNeedle?"arrow":"line",needleShadow:!1,needleSide:"both",needleStart:this.widgetProperties.config.gauge.useNeedle?22:-45,needleEnd:this.widgetProperties.config.gauge.useNeedle?120:55,colorNeedleEnd:"",colorNeedleShadowUp:"",colorNeedleShadowDown:"black",units:this.widgetProperties.config.paths.gaugePath.convertUnitTo,fontUnits:"Roboto",fontUnitsWeight:"normal",borders:!1,borderOuterWidth:0,colorBorderOuter:"red",colorBorderOuterEnd:"red",borderMiddleWidth:0,colorBorderMiddle:"#63afdf",colorBorderMiddleEnd:"#63afdf",borderInnerWidth:0,colorBorderInner:"red",colorBorderInnerEnd:"#121212",borderShadowWidth:0,borderRadius:0,colorBarEnd:"",colorBarStroke:"0",valueBoxStroke:0,colorValueBoxRect:"",colorValueBoxRectEnd:"",colorValueBoxBackground:this.theme().background,fontValueSize:50,fontValue:"Roboto",fontValueWeight:"bold",valueTextShadow:!1,colorValueBoxShadow:"",fontNumbers:"Roboto",fontNumbersWeight:"normal",fontUnitsSize:this.isGaugeVertical?40:35,colorTitle:this.getColors("contrast").dim,colorUnits:this.getColors("contrast").dim,colorValueText:this.getColors(this.widgetProperties.config.color).color,colorPlate:this.theme().cardColor,colorBar:this.theme().background,colorMajorTicks:this.getColors("contrast").dim,colorMinorTicks:this.getColors("contrast").dim,colorNumbers:this.getColors("contrast").dim,majorTicks:i?o.majorTicks:[],majorTicksInt:this.widgetProperties.config.numInt!==void 0&&this.widgetProperties.config.numInt!==null?this.widgetProperties.config.numInt:1,majorTicksDec:this.widgetProperties.config.numDecimal!==void 0&&this.widgetProperties.config.numDecimal!==null?this.widgetProperties.config.numDecimal:2,numberSide:"left",fontNumbersSize:i?25:0,numbersMargin:e?8:4,tickSide:"left",ticksWidth:i?10:0,ticksPadding:0,strokeTicks:!1,minorTicks:i?2:0,ticksWidthMinor:i?6:0,valueBox:!0,valueBoxWidth:35,valueBoxBorderRadius:10,highlights:[],highlightsWidth:this.widgetProperties.config.gauge.highlightsWidth,animation:!0,animationRule:"linear",animatedValue:!1,animateOnInit:!1,animationDuration:this.widgetProperties.config.paths.gaugePath.sampleTime-25};Object.assign(this.gaugeOptions,f),this.setThemePaletteColor()}setThemePaletteColor(){let e="",t="";switch(this.widgetProperties.config.color){case"contrast":e=this.theme().contrast,t=this.theme().contrastDim;break;case"blue":e=this.theme().blue,t=this.theme().blueDim;break;case"green":e=this.theme().green,t=this.theme().greenDim;break;case"pink":e=this.theme().pink,t=this.theme().pinkDim;break;case"orange":e=this.theme().orange,t=this.theme().orangeDim;break;case"purple":e=this.theme().purple,t=this.theme().purpleDim;break;case"grey":e=this.theme().grey,t=this.theme().greyDim;break;case"yellow":e=this.theme().yellow,t=this.theme().yellowDim;break;default:e=this.theme().contrast,t=this.theme().contrastDim;break}Object.assign(this.gaugeOptions,{colorBarProgress:this.widgetProperties.config.gauge.useNeedle?"":e,colorBarProgressEnd:"",colorNeedle:this.widgetProperties.config.gauge.useNeedle?e:t,needleWidth:this.widgetProperties.config.gauge.useNeedle?20:0})}getColors(e){return{contrast:{color:this.theme().contrast,dim:this.theme().contrastDim,dimmer:this.theme().contrastDimmer},blue:{color:this.theme().blue,dim:this.theme().blueDim,dimmer:this.theme().blueDimmer},green:{color:this.theme().green,dim:this.theme().greenDim,dimmer:this.theme().greenDimmer},pink:{color:this.theme().pink,dim:this.theme().pinkDim,dimmer:this.theme().pinkDimmer},orange:{color:this.theme().orange,dim:this.theme().orangeDim,dimmer:this.theme().orangeDimmer},purple:{color:this.theme().purple,dim:this.theme().purpleDim,dimmer:this.theme().purpleDimmer},yellow:{color:this.theme().yellow,dim:this.theme().yellowDim,dimmer:this.theme().yellowDimmer},grey:{color:this.theme().grey,dim:this.theme().greyDim,dimmer:this.theme().yellowDimmer}}[e]}setHighlights(e){let t=[],i=[...e].sort((a,l)=>a.lower-l.lower);for(let a of i){let l=null,d=null,f;switch(a.state){case te.Emergency:f=this.theme().zoneEmergency;break;case te.Alarm:f=this.theme().zoneAlarm;break;case te.Warn:f=this.theme().zoneWarn;break;case te.Alert:f=this.theme().zoneAlert;break;case te.Nominal:f=this.theme().zoneNominal;break;default:f="rgba(0,0,0,0)"}if(l=this.unitsService.convertToUnit(this.widgetProperties.config.paths.gaugePath.convertUnitTo,a.lower),d=this.unitsService.convertToUnit(this.widgetProperties.config.paths.gaugePath.convertUnitTo,a.upper),!(d<this.widgetProperties.config.displayScale.lower||l>this.widgetProperties.config.displayScale.upper)){if(l=l!==null?l:this.widgetProperties.config.displayScale.lower,d=d!==null?d:this.widgetProperties.config.displayScale.upper,l=Math.max(l,this.widgetProperties.config.displayScale.lower),d>this.widgetProperties.config.displayScale.upper){d=this.widgetProperties.config.displayScale.upper,t.push({from:l,to:d,color:f});break}t.push({from:l,to:d,color:f})}}let o={};o.highlightsWidth=this.widgetProperties.config.gauge.highlightsWidth,o.highlights=JSON.stringify(t,null,1),this.ngGauge.update(o)}ngOnDestroy(){this.destroyDataStreams(),this.metaSub?.unsubscribe(),this.ngGauge=null,this.gauge=null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-gauge-ng-linear"]],viewQuery:function(t,i){if(t&1&&(Je(dh,7,zo),Je(dh,7,Ee)),t&2){let o;je(o=Ue())&&(i.ngGauge=o.first),je(o=Ue())&&(i.gauge=o.first)}},features:[fe],decls:4,vars:5,consts:[["host",""],["linearGauge",""],[3,"configChange","config","id"],[1,"linearGauge",3,"onResize","id","options","value"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",2,0),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(2,"linear-gauge",3,1),F("onResize",function(l){return V(o),L(i.onResized(l))}),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(2),ci("id",i.widgetProperties.uuid),j("options",i.gaugeOptions)("value",i.value))},dependencies:[Re,tt,et,hr,zo],styles:["linear-gauge{display:block;position:relative;width:100%;height:100%} linear-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);margin-top:5px}"]})}return r})();var hh=["radialGauge"],uh=(()=>{class r extends Ie{LINE="line";ANIMATION_TARGET_NEEDLE="needle";ngGauge;gauge;textValue="--";value=0;gaugeOptions={};colorStrokeTicks="";unitName=null;metaSub;state=te.Normal;constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{lower:0,upper:100,type:"linear"},gauge:{type:"ngRadial",subType:"measuring",enableTicks:!0,compassUseNumbers:!1,highlightsWidth:5},numInt:1,numDecimal:0,enableTimeout:!1,color:"contrast",dataTimeout:5,ignoreZones:!1},Fe(()=>{this.theme()&&this.startWidget()})}ngOnInit(){this.validateConfig(),this.setGaugeConfig()}startWidget(){this.setGaugeConfig(),this.ngGauge.update(this.gaugeOptions),this.unsubscribeDataStream(),this.unsubscribeMetaStream(),this.metaSub?.unsubscribe(),this.observeDataStream("gaugePath",e=>{if((!e||!e.data)&&(e={data:{value:0,timestamp:new Date},state:te.Normal}),e.state==null&&(e.state=te.Normal),this.value=Math.min(Math.max(e.data.value,this.widgetProperties.config.displayScale.lower),this.widgetProperties.config.displayScale.upper),this.state!==e.state){this.state=e.state;let t={};if(!this.widgetProperties.config.ignoreZones)switch(e.state){case te.Alarm:t.colorBorderMiddle=this.theme().cardColor,t.colorBarProgress=this.theme().zoneAlarm,t.colorValueText=this.theme().zoneAlarm;break;case te.Warn:t.colorBorderMiddle=this.theme().cardColor,t.colorBarProgress=this.theme().zoneWarn,t.colorValueText=this.theme().zoneWarn;break;case te.Alert:t.colorBorderMiddle=this.theme().cardColor,t.colorBarProgress=this.theme().zoneAlert,t.colorValueText=this.theme().zoneAlert;break;default:t.colorBorderMiddle=this.theme().cardColor,t.colorBarProgress=this.widgetProperties.config.gauge.subType=="measuring"?this.getColors(this.widgetProperties.config.color).color:this.getColors(this.widgetProperties.config.color).dim,t.colorValueText=this.getColors(this.widgetProperties.config.color).color}this.ngGauge.update(t)}}),this.widgetProperties.config.ignoreZones||(this.observeMetaStream(),this.metaSub=this.zones$.subscribe(e=>{e&&e.length>0&&this.widgetProperties.config.gauge.subType=="measuring"&&this.setHighlights(e)}))}updateConfig(e){this.widgetProperties.config=e,this.setCanvasHight(),this.startWidget()}setCanvasHight(){let e=this.gauge.nativeElement.getBoundingClientRect(),t={};t.height=e.height,t.width=e.width,this.ngGauge.update(t)}ngAfterViewInit(){this.setCanvasHight(),this.startWidget()}onResized(e){let t={};t.height=e.contentRect.height,t.width=e.contentRect.width,this.ngGauge.update(t)}setGaugeConfig(){switch(this.gaugeOptions.title=this.widgetProperties.config.displayName?this.widgetProperties.config.displayName:"",this.gaugeOptions.highlights=[],this.gaugeOptions.fontTitle="Roboto",this.gaugeOptions.fontTitleWeight="bold",this.gaugeOptions.fontUnits="Roboto",this.gaugeOptions.fontUnitsSize=25,this.gaugeOptions.fontUnitsWeight="normal",this.gaugeOptions.barStrokeWidth=0,this.gaugeOptions.barShadow=0,this.gaugeOptions.colorBarStroke="",this.gaugeOptions.fontValue="Roboto",this.gaugeOptions.fontValueWeight="bold",this.gaugeOptions.valueTextShadow=!1,this.gaugeOptions.colorValueBoxShadow="",this.gaugeOptions.fontNumbers="Roboto",this.gaugeOptions.fontNumbersWeight="bold",this.gaugeOptions.valueInt=this.widgetProperties.config.numInt!==void 0&&this.widgetProperties.config.numInt!==null?this.widgetProperties.config.numInt:1,this.gaugeOptions.valueDec=this.widgetProperties.config.numDecimal!==void 0&&this.widgetProperties.config.numDecimal!==null?this.widgetProperties.config.numDecimal:2,this.gaugeOptions.majorTicksInt=this.widgetProperties.config.numInt!==void 0&&this.widgetProperties.config.numInt!==null?this.widgetProperties.config.numInt:1,this.gaugeOptions.majorTicksDec=this.widgetProperties.config.numDecimal!==void 0&&this.widgetProperties.config.numDecimal!==null?this.widgetProperties.config.numDecimal:2,this.gaugeOptions.highlightsWidth=this.widgetProperties.config.gauge.highlightsWidth,this.gaugeOptions.animation=!0,this.gaugeOptions.animateOnInit=!1,this.gaugeOptions.animatedValue=!1,this.gaugeOptions.animationRule="linear",this.gaugeOptions.animationDuration=this.widgetProperties.config.paths.gaugePath.sampleTime-25,this.gaugeOptions.colorBorderShadow=!1,this.gaugeOptions.colorBorderOuter=this.theme().cardColor,this.gaugeOptions.colorBorderOuterEnd="",this.gaugeOptions.colorBorderMiddle=this.theme().cardColor,this.gaugeOptions.colorBorderMiddleEnd="",this.gaugeOptions.colorBarProgress=this.getColors(this.widgetProperties.config.color).color,this.gaugeOptions.colorNeedle=this.getColors(this.widgetProperties.config.color).dim,this.gaugeOptions.colorNeedleEnd=this.getColors(this.widgetProperties.config.color).dim,this.gaugeOptions.colorTitle=this.theme().contrastDim,this.gaugeOptions.colorUnits=this.theme().contrastDim,this.gaugeOptions.colorValueText=this.getColors(this.widgetProperties.config.color).color,this.colorStrokeTicks=this.theme().contrastDim,this.gaugeOptions.colorMinorTicks=this.theme().contrastDim,this.gaugeOptions.colorNumbers=this.theme().contrastDim,this.gaugeOptions.colorMajorTicks=this.theme().contrastDim,this.gaugeOptions.colorPlate=this.gaugeOptions.colorPlateEnd=this.theme().cardColor,this.gaugeOptions.colorBar=this.theme().background,this.gaugeOptions.colorNeedleShadowUp="",this.gaugeOptions.colorNeedleShadowDown="black",this.gaugeOptions.colorNeedleCircleInner=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleInnerEnd=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleOuter=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNeedleCircleOuterEnd=this.gaugeOptions.colorPlate,this.widgetProperties.config.gauge.subType){case"capacity":this.configureCapacityGauge();break;case"measuring":this.configureMeasuringGauge();break;default:}}getColors(e){return{contrast:{color:this.theme().contrast,dim:this.theme().contrastDim,dimmer:this.theme().contrastDimmer},blue:{color:this.theme().blue,dim:this.theme().blueDim,dimmer:this.theme().blueDimmer},green:{color:this.theme().green,dim:this.theme().greenDim,dimmer:this.theme().greenDimmer},pink:{color:this.theme().pink,dim:this.theme().pinkDim,dimmer:this.theme().pinkDimmer},orange:{color:this.theme().orange,dim:this.theme().orangeDim,dimmer:this.theme().orangeDimmer},purple:{color:this.theme().purple,dim:this.theme().purpleDim,dimmer:this.theme().purpleDimmer},yellow:{color:this.theme().yellow,dim:this.theme().yellowDim,dimmer:this.theme().yellowDimmer},grey:{color:this.theme().grey,dim:this.theme().greyDim,dimmer:this.theme().yellowDimmer}}[e]}configureCapacityGauge(){this.gaugeOptions.minValue=this.widgetProperties.config.displayScale.lower,this.gaugeOptions.maxValue=this.widgetProperties.config.displayScale.upper,this.gaugeOptions.units=this.widgetProperties.config.paths.gaugePath.convertUnitTo,this.gaugeOptions.fontTitleSize=40,this.gaugeOptions.barProgress=!0,this.gaugeOptions.barWidth=20,this.gaugeOptions.colorBarProgress=this.getColors(this.widgetProperties.config.color).dim,this.gaugeOptions.valueBox=!0,this.gaugeOptions.fontValueSize=60,this.gaugeOptions.valueBoxWidth=10,this.gaugeOptions.valueBoxBorderRadius=5,this.gaugeOptions.valueBoxStroke=0,this.gaugeOptions.colorValueBoxBackground="",this.gaugeOptions.colorValueBoxRect="",this.gaugeOptions.colorValueBoxRectEnd="",this.gaugeOptions.ticksAngle=360,this.gaugeOptions.startAngle=180,this.gaugeOptions.majorTicks=0,this.gaugeOptions.exactTicks=!0,this.gaugeOptions.strokeTicks=!1,this.gaugeOptions.minorTicks=0,this.gaugeOptions.numbersMargin=0,this.gaugeOptions.fontNumbersSize=0,this.gaugeOptions.colorMajorTicks=this.gaugeOptions.colorPlate,this.gaugeOptions.colorNumbers=this.gaugeOptions.colorMinorTicks="",this.gaugeOptions.needle=!0,this.gaugeOptions.needleType=this.LINE,this.gaugeOptions.needleWidth=2,this.gaugeOptions.needleShadow=!1,this.gaugeOptions.needleStart=75,this.gaugeOptions.needleEnd=95,this.gaugeOptions.needleCircleSize=1,this.gaugeOptions.needleCircleInner=!1,this.gaugeOptions.needleCircleOuter=!1,this.gaugeOptions.borders=!0,this.gaugeOptions.borderOuterWidth=2,this.gaugeOptions.borderMiddleWidth=1,this.gaugeOptions.borderInnerWidth=0,this.gaugeOptions.borderShadowWidth=0,this.gaugeOptions.animationTarget=this.ANIMATION_TARGET_NEEDLE,this.gaugeOptions.useMinPath=!1}configureMeasuringGauge(){let e=this.widgetProperties.config.paths.gaugePath.convertUnitTo,t=Lo(this.widgetProperties.config.displayScale.lower,this.widgetProperties.config.displayScale.upper);this.gaugeOptions.minValue=t.min,this.gaugeOptions.maxValue=t.max,this.gaugeOptions.units=this.widgetProperties.config.paths.gaugePath.convertUnitTo,this.gaugeOptions.fontTitleSize=24,this.gaugeOptions.barProgress=!0,this.gaugeOptions.barWidth=15,this.gaugeOptions.valueBox=!0,this.gaugeOptions.fontValueSize=60,this.gaugeOptions.valueBoxWidth=100,this.gaugeOptions.valueBoxBorderRadius=0,this.gaugeOptions.valueBoxStroke=0,this.gaugeOptions.colorValueBoxBackground="",this.gaugeOptions.exactTicks=!1,this.gaugeOptions.majorTicks=t.majorTicks,this.gaugeOptions.minorTicks=2,this.gaugeOptions.ticksAngle=270,this.gaugeOptions.startAngle=45,this.gaugeOptions.strokeTicks=!0,this.gaugeOptions.numbersMargin=3,this.gaugeOptions.fontNumbersSize=15,this.gaugeOptions.needle=!0,this.gaugeOptions.needleType=this.LINE,this.gaugeOptions.needleWidth=2,this.gaugeOptions.needleShadow=!1,this.gaugeOptions.needleStart=0,this.gaugeOptions.needleEnd=95,this.gaugeOptions.needleCircleSize=10,this.gaugeOptions.needleCircleInner=!1,this.gaugeOptions.needleCircleOuter=!1,this.gaugeOptions.borders=!0,this.gaugeOptions.borderOuterWidth=2,this.gaugeOptions.borderMiddleWidth=1,this.gaugeOptions.borderInnerWidth=0,this.gaugeOptions.borderShadowWidth=0,this.gaugeOptions.animationTarget=this.ANIMATION_TARGET_NEEDLE,this.gaugeOptions.useMinPath=!1}setHighlights(e){let t=[],i=[...e].sort((a,l)=>a.lower-l.lower);for(let a of i){let l=null,d=null,f;switch(a.state){case te.Emergency:f=this.theme().zoneEmergency;break;case te.Alarm:f=this.theme().zoneAlarm;break;case te.Warn:f=this.theme().zoneWarn;break;case te.Alert:f=this.theme().zoneAlert;break;case te.Nominal:f=this.theme().zoneNominal;break;default:f="rgba(0,0,0,0)"}if(l=this.unitsService.convertToUnit(this.widgetProperties.config.paths.gaugePath.convertUnitTo,a.lower),d=this.unitsService.convertToUnit(this.widgetProperties.config.paths.gaugePath.convertUnitTo,a.upper),!(d<this.widgetProperties.config.displayScale.lower||l>this.widgetProperties.config.displayScale.upper)){if(l=l!==null?l:this.widgetProperties.config.displayScale.lower,d=d!==null?d:this.widgetProperties.config.displayScale.upper,l=Math.max(l,this.widgetProperties.config.displayScale.lower),d>this.widgetProperties.config.displayScale.upper){d=this.widgetProperties.config.displayScale.upper,t.push({from:l,to:d,color:f});break}t.push({from:l,to:d,color:f})}}let o={};o.highlightsWidth=this.widgetProperties.config.gauge.highlightsWidth,o.highlights=JSON.stringify(t,null,1),this.ngGauge.update(o)}ngOnDestroy(){this.destroyDataStreams(),this.metaSub?.unsubscribe(),this.ngGauge=null,this.gauge=null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-gauge-ng-radial"]],viewQuery:function(t,i){if(t&1&&(Je(hh,7),Je(hh,7,Ee)),t&2){let o;je(o=Ue())&&(i.ngGauge=o.first),je(o=Ue())&&(i.gauge=o.first)}},features:[fe],decls:3,vars:5,consts:[["radialGauge",""],[3,"configChange","config","id"],[3,"onResize","id","options","value"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(1,"radial-gauge",2,0),F("onResize",function(l){return V(o),L(i.onResized(l))}),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),ci("id",i.widgetProperties.uuid),j("options",i.gaugeOptions)("value",i.value))},dependencies:[Re,tt,et,hr,Vo],styles:["radial-gauge{display:block;position:relative;width:100%;height:100%} radial-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);padding:0}"]})}return r})();var fs={darkGray:steelseries.BackgroundColor.DARK_GRAY,satinGray:steelseries.BackgroundColor.SATIN_GRAY,lightGray:steelseries.BackgroundColor.LIGHT_GRAY,white:steelseries.BackgroundColor.WHITE,black:steelseries.BackgroundColor.BLACK,beige:steelseries.BackgroundColor.BEIGE,brown:steelseries.BackgroundColor.BROWN,red:steelseries.BackgroundColor.RED,green:steelseries.BackgroundColor.GREEN,blue:steelseries.BackgroundColor.BLUE,anthracite:steelseries.BackgroundColor.ANTHRACITE,mud:steelseries.BackgroundColor.MUD,punchedSheet:steelseries.BackgroundColor.PUNCHED_SHEET,carbon:steelseries.BackgroundColor.CARBON,stainless:steelseries.BackgroundColor.STAINLESS,brushedMetal:steelseries.BackgroundColor.BRUSHED_METAL,brushedStainless:steelseries.BackgroundColor.BRUSHED_STAINLESS,turned:steelseries.BackgroundColor.TURNED},gs={blackMetal:steelseries.FrameDesign.BLACK_METAL,metal:steelseries.FrameDesign.METAL,shinyMetal:steelseries.FrameDesign.SHINY_METAL,brass:steelseries.FrameDesign.BRASS,steel:steelseries.FrameDesign.STEEL,chrome:steelseries.FrameDesign.CHROME,gold:steelseries.FrameDesign.GOLD,anthracite:steelseries.FrameDesign.ANTHRACITE,tiltedGray:steelseries.FrameDesign.TILTED_GRAY,tiltedBlack:steelseries.FrameDesign.TILTED_BLACK,glossyMetal:steelseries.FrameDesign.GLOSSY_METAL},mh=(()=>{class r{unitsService=M(Yn);widgetUUID=Q(void 0);subType=Q(void 0);barGauge=Q(void 0);radialSize=Q(void 0);backgroundColor=Q(void 0);frameColor=Q(void 0);minValue=Q(void 0);maxValue=Q(void 0);decimals=Q(void 0);zones=Q(void 0);title=Q(void 0);units=Q(void 0);value=Q(void 0);theme=Q(void 0,{alias:"themeColors"});gaugeStarted=!1;gauge;gaugeOptions={};paddingTop=0;ngOnInit(){this.buildOptions()}buildOptions(){this.gaugeOptions.minValue=this.minValue(),this.gaugeOptions.maxValue=this.maxValue();let e=this.decimals();this.gaugeOptions.lcdDecimals=e??2,this.gaugeOptions.titleString=this.title(),this.gaugeOptions.unitString=this.units(),this.subType()=="radial"&&(this.gaugeOptions.gaugeType=this.setGaugeType(this.radialSize()));let t=this.zones();if(t){let i=[],o=[],a=[...t].sort((l,d)=>l.lower-d.lower);for(let l of a){let d=null,f=null,s;switch(l.state){case te.Emergency:s=this.theme().zoneEmergency;break;case te.Alarm:s=this.theme().zoneAlarm;break;case te.Warn:s=this.theme().zoneWarn;break;case te.Alert:s=this.theme().zoneAlert;break;case te.Nominal:s=this.theme().zoneNominal;break;default:s="rgba(0,0,0,0)"}let c=this.units();if(c=="ratio"?(d=l.lower,f=l.upper):(d=this.unitsService.convertToUnit(c,l.lower),f=this.unitsService.convertToUnit(c,l.upper)),!(f<this.minValue()||d>this.maxValue())){if(d=d!==null?d:this.minValue(),f=f!==null?f:this.maxValue(),d=Math.max(d,this.minValue()),f>this.maxValue()){f=this.maxValue(),i.push(steelseries.Section(d,f,s));break}i.push(steelseries.Section(d,f,s))}}this.gaugeOptions.section=i,this.gaugeOptions.area=o,this.gaugeOptions.useSectionColors=!0}fs[this.backgroundColor()]&&(this.gaugeOptions.backgroundColor=fs[this.backgroundColor()]),gs[this.frameColor()]&&(this.gaugeOptions.frameDesign=gs[this.frameColor()]),this.barGauge()&&(this.gaugeOptions.valueColor=steelseries.ColorDef.GREEN),this.gaugeOptions.lcdVisible=!0,this.gaugeOptions.thresholdVisible=!1,this.gaugeOptions.threshold=this.maxValue(),this.gaugeOptions.ledVisible=!1}setGaugeType(e){switch(e){case"quarter":return steelseries.GaugeType.TYPE1;case"half":return steelseries.GaugeType.TYPE2;case"three-quarter":return steelseries.GaugeType.TYPE3;case"full":default:return steelseries.GaugeType.TYPE4}}startGauge(){this.gaugeStarted=!0,this.buildOptions();let e=this.subType();e=="radial"?this.gauge=new steelseries.Radial(this.widgetUUID(),this.gaugeOptions):e=="linear"&&(this.barGauge()?this.gauge=new steelseries.LinearBargraph(this.widgetUUID(),this.gaugeOptions):this.gauge=new steelseries.Linear(this.widgetUUID(),this.gaugeOptions))}onResized(e){if(!(e.contentRect.height<50||e.contentRect.width<50)){if(this.subType()=="radial"){let t=Math.min(e.contentRect.height,e.contentRect.width);this.gaugeOptions.size=t}else this.gaugeOptions.width=e.contentRect.width,this.gaugeOptions.height=e.contentRect.height;this.startGauge()}}ngOnChanges(e){this.gaugeStarted&&(e.value&&!e.value.firstChange&&this.gauge.setValueAnimated(e.value.currentValue),e.zones&&this.startGauge(),e.title&&this.gauge.setTitleString(e.title.currentValue),e.backgroundColor&&this.gauge.setBackgroundColor(fs[e.backgroundColor.currentValue]),e.frameColor&&this.gauge.setFrameDesign(gs[e.frameColor.currentValue]),e.radialSize&&this.startGauge(),e.minValue&&this.gauge.setMinValue(e.minValue.currentValue),e.maxValue&&this.gauge.setMaxValue(e.maxValue.currentValue))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["gauge-steel"]],inputs:{widgetUUID:[1,"widgetUUID"],subType:[1,"subType"],barGauge:[1,"barGauge"],radialSize:[1,"radialSize"],backgroundColor:[1,"backgroundColor"],frameColor:[1,"frameColor"],minValue:[1,"minValue"],maxValue:[1,"maxValue"],decimals:[1,"decimals"],zones:[1,"zones"],title:[1,"title"],units:[1,"units"],value:[1,"value"],theme:[1,"themeColors","theme"]},features:[Zt],decls:4,vars:1,consts:[["gauge",""],[1,"wrapper",3,"onResize"],[2,"z-index","inherit",3,"id"]],template:function(t,i){if(t&1){let o=ee();v(0,"div",1),F("onResize",function(l){return V(o),L(i.onResized(l))}),v(1,"canvas",2,0),E(3," Browser does not support canvas element. "),_()()}t&2&&(P(),ci("id",i.widgetUUID()))},dependencies:[tt,et],styles:[".sgWrapper[_ngcontent-%COMP%]{height:100%;width:100%;text-align:center}"]})}return r})();var ph=(()=>{class r extends Ie{dataValue=0;zones=[];metaSub;constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{type:"linear",lower:0,upper:100},gauge:{type:"steel",subType:"radial",backgroundColor:"carbon",faceColor:"anthracite",radialSize:"full",rotateFace:!1,digitalMeter:!1},numDecimal:2,enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}ngOnInit(){this.validateConfig(),this.startWidget()}startWidget(){this.unsubscribeDataStream(),this.unsubscribeMetaStream(),this.metaSub?.unsubscribe(),this.observeDataStream("gaugePath",e=>{(!e||!e.data)&&(e={data:{value:0,timestamp:new Date},state:"normal"}),this.dataValue=Math.min(Math.max(e.data.value,this.widgetProperties.config.displayScale.lower),this.widgetProperties.config.displayScale.upper)}),this.widgetProperties.config.ignoreZones?this.zones=[]:(this.observeMetaStream(),this.metaSub=this.zones$.subscribe(e=>{e?e.length>0?this.zones=e:this.zones=[]:this.zones=[]}))}updateConfig(e){this.widgetProperties.config=e,this.startWidget()}ngOnDestroy(){this.destroyDataStreams(),this.metaSub?.unsubscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-gauge-steel"]],features:[fe],decls:2,vars:16,consts:[[3,"configChange","config","id"],[3,"widgetUUID","subType","barGauge","radialSize","backgroundColor","frameColor","minValue","maxValue","decimals","zones","title","units","value","themeColors"]],template:function(t,i){t&1&&(v(0,"widget-host",0),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),B(1,"gauge-steel",1),_()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("widgetUUID",i.widgetProperties.uuid)("subType",i.widgetProperties.config.gauge.subType)("barGauge",i.widgetProperties.config.gauge.digitalMeter)("radialSize",i.widgetProperties.config.gauge.radialSize)("backgroundColor",i.widgetProperties.config.gauge.backgroundColor)("frameColor",i.widgetProperties.config.gauge.faceColor)("minValue",i.widgetProperties.config.displayScale.lower)("maxValue",i.widgetProperties.config.displayScale.upper)("decimals",i.widgetProperties.config.numDecimal)("zones",i.zones)("title",i.widgetProperties.config.displayName)("units",i.widgetProperties.config.paths.gaugePath.convertUnitTo)("value",i.dataValue)("themeColors",i.theme()))},dependencies:[Re,mh],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}gauge-steel[_ngcontent-%COMP%]{display:block;position:relative;width:100%;height:100%} .wrapper{display:block;position:relative;width:100%;height:100%;padding:10px} .wrapper>canvas{display:block;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}"]})}return r})();var bf=["plainIframe"];function _f(r,n){if(r&1&&B(0,"iframe",2,0),r&2){let e=se();j("src",e.widgetUrl,Kr)}}function wf(r,n){r&1&&(v(0,"div",3)(1,"h2"),E(2,"Empty or bad URL"),_(),v(3,"p"),E(4," IMPORTANT: cross-domain security rules (CORS) apply to this widget. "),_(),v(5,"p"),E(6,"Typically, you can load Grafana graphs, Signal K apps or other related tools. "),_()())}var fh=(()=>{class r extends Ie{_sanitizer=M(Ln);_dashboard=M(lt);iframe;widgetUrl=null;displayTransparentOverlay=an("block");constructor(){super(),this.defaultConfig={widgetUrl:null,allowInput:!1},Fe(()=>{this._dashboard.isDashboardStatic()?this.displayTransparentOverlay.set(this.widgetProperties.config.allowInput?"none":"block"):this.displayTransparentOverlay.set("block")})}ngOnInit(){this.validateConfig(),window.addEventListener("message",this.handleIframeGesture),this.displayTransparentOverlay.set(this.widgetProperties.config.allowInput?"none":"block"),this.widgetUrl=this.resolveUrl(this.widgetProperties.config.widgetUrl)}ngAfterViewInit(){this.iframe&&(this.iframe.nativeElement.onload=()=>this.injectHammerJS())}startWidget(){}ngOnDestroy(){window.removeEventListener("message",this.handleIframeGesture)}handleIframeGesture=e=>{if(e.data){if(e.data.gesture&&e.data.eventData.instanceId===this.widgetProperties.uuid)switch(e.data.gesture){case"swipeup":this._dashboard.previousDashboard();break;case"swipedown":this._dashboard.nextDashboard();break;case"swipeleft":let t=new Event("openLeftSidenav",{bubbles:!0,cancelable:!0});window.document.dispatchEvent(t);break;case"swiperight":let i=new Event("openRightSidenav",{bubbles:!0,cancelable:!0});window.document.dispatchEvent(i);break;default:break}if(e.data.type==="keydown"&&e.data.keyEventData.instanceId===this.widgetProperties.uuid){let{key:t,ctrlKey:i,shiftKey:o}=e.data.keyEventData,a=new KeyboardEvent("keydown",{key:t,ctrlKey:i,shiftKey:o,bubbles:!0,cancelable:!0});document.dispatchEvent(a)}}};injectHammerJS(){let e=document.getElementsByTagName("base")[0]?.href||"/",t=this.iframe.nativeElement.contentWindow,i=this.iframe.nativeElement.contentDocument;if(!i||!t){console.error("[WidgetIframe] Iframe contentDocument or contentWindow is undefined. Possible cross-origin issue or iframe not fully loaded.");return}if(t.Hammer){console.log("[WidgetIframe] HammerJS already loaded in iframe");return}let o=i.createElement("script");o.src=`${e}assets/hammer.min.js`,o.onload=()=>this.injectSwipeHandler(),i.body.appendChild(o)}injectSwipeHandler(){let e=this.iframe.nativeElement.contentDocument;if(!e){console.error("[WidgetIframe] Iframe contentDocument is undefined. Possible cross-origin issue or iframe not fully loaded.");return}let t=e.createElement("script");t.textContent=`
120
120
  if (!window.hammerInstance) {
121
121
  const hammer = new Hammer(document.body);
122
122
  hammer.get('swipe').set({ direction: Hammer.DIRECTION_ALL, velocity: 1.5, threshold: 200, domEvents: true });
@@ -226,7 +226,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
226
226
 
227
227
  window.hammerInstance = hammer; // Store the instance to prevent multiple listeners
228
228
  }
229
- `,e.body.appendChild(t)}updateConfig(e){this.validateUrlAccess(this.widgetProperties.config.widgetUrl=e.widgetUrl)}validateUrlAccess(e){e&&(this.widgetUrl=this.isValidProtocol(e)?this._sanitizer.bypassSecurityTrustResourceUrl(e):null)}isValidProtocol(e){try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return console.warn("[Embed Widget] isValidUrl: Invalid URL:",e),!1}}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-iframe"]],viewQuery:function(t,i){if(t&1&&Je(bf,5),t&2){let o;je(o=Ue())&&(i.iframe=o.first)}},features:[fe],decls:4,vars:5,consts:[["plainIframe",""],[3,"configChange","config","id"],["width","100%","height","100%","frameborder","0",1,"widgetIframe",3,"src"],[2,"padding","15px"],[1,"widgetOverlay"]],template:function(t,i){t&1&&(v(0,"widget-host",1),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),ke(1,_f,2,1,"iframe",2)(2,wf,7,0,"div",3),B(3,"div",4),_()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),Ge(i.widgetUrl?1:2),P(2),it("display",i.displayTransparentOverlay()))},dependencies:[Re],styles:[".widgetIframe[_ngcontent-%COMP%]{background-color:#fff}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent}"]})}return r})();var kf=["canvasValue"],gh=(()=>{class r extends Ie{canvasValue=de.required("canvasValue");canvas=M(Tt);latPos="";longPos="";labelColor=void 0;valueColor=void 0;maxTextWidth=0;maxTextHeight=0;middle=0;center=0;fontSizeOffset=0;canvasValCtx;isDestroyed=!1;constructor(){super(),this.defaultConfig={displayName:"Position",filterSelfPaths:!0,paths:{longPath:{description:"Longitude",path:"self.navigation.position.longitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"longitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500},latPath:{description:"Latitude",path:"self.navigation.position.latitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"latitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},color:"contrast",enableTimeout:!1,dataTimeout:5},Fe(()=>{this.theme()&&(this.getColors(this.widgetProperties.config.color),this.drawValue())})}ngOnInit(){this.validateConfig()}ngAfterViewInit(){this.canvas.setHighDPISize(this.canvasValue().nativeElement,this.canvasValue().nativeElement.parentElement.getBoundingClientRect()),this.maxTextHeight=Math.floor(this.canvasValue().nativeElement.height*.6/2),this.maxTextWidth=Math.floor(this.canvasValue().nativeElement.width*.85),this.canvasValCtx=this.canvasValue().nativeElement.getContext("2d"),this.calculateFontSizeAndPositions(),document.fonts.ready.then(()=>{this.isDestroyed||this.startWidget()})}startWidget(){this.unsubscribeDataStream(),this.observeDataStream("longPath",e=>{this.longPos=e.data.value?e.data.value.toString():"",this.drawValue()}),this.observeDataStream("latPath",e=>{this.latPos=e.data.value?e.data.value.toString():"",this.drawValue()})}ngOnDestroy(){this.isDestroyed=!0,this.unsubscribeDataStream(),this.canvas.clearCanvas(this.canvasValCtx,this.canvasValue().nativeElement.width,this.canvasValue().nativeElement.height),this.canvasValue().nativeElement.remove()}updateConfig(e){this.widgetProperties.config=e,this.getColors(this.widgetProperties.config.color),this.startWidget()}onResized(e){e.contentRect.height<25||e.contentRect.width<25||(this.canvas.setHighDPISize(this.canvasValue().nativeElement,this.canvasValue().nativeElement.parentElement.getBoundingClientRect()),this.maxTextHeight=Math.floor(this.canvasValue().nativeElement.height*.6/2),this.maxTextWidth=Math.floor(this.canvasValue().nativeElement.width*.85),this.calculateFontSizeAndPositions(),this.drawValue())}getColors(e){switch(e){case"white":this.labelColor=this.theme().contrastDim,this.valueColor=this.theme().contrast;break;case"blue":this.labelColor=this.theme().blueDim,this.valueColor=this.theme().blue;break;case"green":this.labelColor=this.theme().greenDim,this.valueColor=this.theme().green;break;case"pink":this.labelColor=this.theme().pinkDim,this.valueColor=this.theme().pink;break;case"orange":this.labelColor=this.theme().orangeDim,this.valueColor=this.theme().orange;break;case"purple":this.labelColor=this.theme().purpleDim,this.valueColor=this.theme().purple;break;case"grey":this.labelColor=this.theme().greyDim,this.valueColor=this.theme().grey;break;case"yellow":this.labelColor=this.theme().yellowDim,this.valueColor=this.theme().yellow;break;default:this.labelColor=this.theme().contrastDim,this.valueColor=this.theme().contrast;break}}calculateFontSizeAndPositions(){this.center=this.canvasValue().nativeElement.width/2,this.middle=this.canvasValue().nativeElement.height*.57;let e=this.latPos.length>this.longPos.length?this.latPos:this.longPos,t=this.canvas.calculateOptimalFontSize(this.canvasValCtx,e,this.maxTextWidth,this.maxTextHeight,"bold");this.fontSizeOffset=Math.floor(t*5e-4)}drawValue(){this.canvasValCtx&&(this.canvas.clearCanvas(this.canvasValCtx,this.canvasValue().nativeElement.width,this.canvasValue().nativeElement.height),this.canvas.drawText(this.canvasValCtx,this.latPos,this.center,this.middle-this.fontSizeOffset,this.maxTextWidth,this.maxTextHeight,"bold",this.valueColor,"center","bottom"),this.canvas.drawText(this.canvasValCtx,this.longPos,this.center,this.middle+this.fontSizeOffset,this.maxTextWidth,this.maxTextHeight,"bold",this.valueColor,"center","top"))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-position"]],viewQuery:function(t,i){t&1&&ce(i.canvasValue,kf,5),t&2&&Xe()},features:[fe],decls:5,vars:4,consts:[["canvasValue",""],[3,"configChange","config","id"],[3,"text","color"],[1,"textGenericWrapper",3,"onResize"],[1,"canvas"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),B(1,"widget-title",2),v(2,"div",3),F("onResize",function(l){return V(o),L(i.onResized(l))}),B(3,"canvas",4,0),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("text",i.widgetProperties.config.displayName)("color",i.labelColor))},dependencies:[Re,tt,et,si],styles:[".textGenericWrapper[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}.canvas[_ngcontent-%COMP%]{position:absolute;top:0;left:0;z-index:inherit}"]})}return r})();var Fo=(()=>{class r{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new Ni(t),timeoutID:null,intervalMS:i},this.kipTimers[e].currentValue.asObservable())}startTimer(e){this.kipTimers.hasOwnProperty(e)&&this.kipTimers[e].timeoutID===null&&(this.kipTimers[e].timeoutID=setInterval(()=>{this.kipTimers[e].currentValue.next(this.kipTimers[e].currentValue.value+1)},this.kipTimers[e].intervalMS))}stopTimer(e){this.kipTimers.hasOwnProperty(e)&&this.kipTimers[e].timeoutID!==null&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null)}setTimer(e,t){this.kipTimers.hasOwnProperty(e)&&this.kipTimers[e].currentValue.next(t)}deleteTimer(e){this.kipTimers.hasOwnProperty(e)&&(this.stopTimer(e),this.kipTimers[e].currentValue.complete(),delete this.kipTimers[e])}isRunning(e){let t=!1;return e in this.kipTimers&&(t=this.kipTimers[e].timeoutID!==null),t}static \u0275fac=function(t){return new(t||r)};static \u0275prov=ot({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var Sf=["canvasEl"];function Cf(r,n){if(r&1){let e=ee();v(0,"button",12),F("click",function(){V(e);let i=se();return L(i.startTimer())}),E(1," Start "),_()}}function xf(r,n){if(r&1){let e=ee();v(0,"button",13),F("click",function(){V(e);let i=se();return L(i.pauseTimer())}),E(1," Pause "),_()}}var vh=(()=>{class r extends Ie{TimersService=M(Fo);canvas=M(Tt);canvasEl=de("canvasEl");dataValue=null;zoneState=null;currentValueLength=0;valueFontSize=1;flashOn=!1;flashInterval=null;timerRunning=!1;timeName="race";warnColor=null;warmContrast=null;textColor=null;timerSub=null;canvasCtx=null;constructor(){super(),this.defaultConfig={timerLength:300,color:"contrast"},Fe(()=>{this.theme()&&(this.getColors(this.widgetProperties.config.color),this.updateCanvas())})}ngOnInit(){this.validateConfig(),this.subscribeTimer(),this.startWidget()}startWidget(){this.getColors(this.widgetProperties.config.color),this.canvasCtx=this.canvasEl().nativeElement.getContext("2d")}updateConfig(e){this.widgetProperties.config=e,this.startWidget(),this.updateCanvas()}onResized(e){e.contentRect.height<50||e.contentRect.width<50||(this.canvasEl().nativeElement.width!=Math.floor(e.contentRect.width)||this.canvasEl().nativeElement.height!=Math.floor(e.contentRect.height))&&(this.canvasEl().nativeElement.width=Math.floor(e.contentRect.width),this.canvasEl().nativeElement.height=Math.floor(e.contentRect.height/2),this.currentValueLength=0,this.updateCanvas())}subscribeTimer(){this.timerRunning=this.TimersService.isRunning(this.timeName);let e=this.widgetProperties.config.timerLength*-1*10;this.timerSub=this.TimersService.createTimer(this.timeName,-3e3,100).subscribe(t=>{this.dataValue=t,t>0?this.zoneState=te.Normal:t>-100?this.zoneState=te.Alarm:t>-300?this.zoneState=te.Warn:this.zoneState=te.Normal,this.zoneState==te.Alarm&&!this.flashInterval?this.flashInterval=setInterval(()=>{this.flashOn=!this.flashOn,this.updateCanvas()},500):this.zoneState!=te.Alarm&&clearInterval(this.flashInterval),this.updateCanvas()})}startTimer(){this.TimersService.startTimer(this.timeName),this.timerRunning=!0}resetTimer(){this.unsubscribeTimer(),this.TimersService.deleteTimer(this.timeName),this.timerRunning=!1,this.subscribeTimer()}pauseTimer(){this.TimersService.stopTimer(this.timeName),this.timerRunning=!1}roundToMin(){let e=this.dataValue;this.dataValue<0&&(e=e*-1);let t=e%600;this.dataValue>0?t>300?this.TimersService.setTimer(this.timeName,this.dataValue+(600-t)):this.TimersService.setTimer(this.timeName,this.dataValue-t):t>300?this.TimersService.setTimer(this.timeName,this.dataValue-(600-t)):this.TimersService.setTimer(this.timeName,this.dataValue+t)}addOneMin(){this.TimersService.setTimer(this.timeName,this.dataValue+600)}remOneMin(){this.TimersService.setTimer(this.timeName,this.dataValue-600)}getColors(e){switch(e){case"contrast":this.textColor=this.theme().contrast,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"blue":this.textColor=this.theme().blue,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"green":this.textColor=this.theme().green,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"pink":this.textColor=this.theme().pink,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"orange":this.textColor=this.theme().orange,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"purple":this.textColor=this.theme().purple,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"grey":this.textColor=this.theme().grey,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"yellow":this.textColor=this.theme().yellow,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;default:this.textColor=this.theme().contrast,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break}}unsubscribeTimer(){this.timerSub?.unsubscribe()}ngOnDestroy(){this.timerSub?.unsubscribe(),this.canvasCtx&&this.canvas.clearCanvas(this.canvasCtx,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height),clearInterval(this.flashInterval),this.destroyDataStreams()}updateCanvas(){this.canvasCtx&&(this.canvas.clearCanvas(this.canvasCtx,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height),this.drawValue())}drawValue(){let e=this.canvasEl().nativeElement,t=Math.floor(e.width*.95),i=Math.floor(e.height),o;if(this.dataValue!=null){let a=Math.abs(this.dataValue),l=Math.floor(a/600),d=Math.floor(a%600/10),f=Math.floor(a%10);o=`${l}:${("0"+d).slice(-2)}.${f}`,this.dataValue<0&&(o=`-${o}`)}else o="--";switch(this.currentValueLength!==o.length&&(this.currentValueLength=o.length,this.valueFontSize=this.canvas.calculateOptimalFontSize(this.canvasCtx,o,t,i,"bold")),this.zoneState){case te.Alarm:this.flashOn?this.canvasCtx.fillStyle=this.textColor:(this.canvas.drawRectangle(this.canvasCtx,0,0,e.width,e.height,this.warnColor),this.canvasCtx.fillStyle=this.textColor);break;case te.Warn:this.canvasCtx.fillStyle=this.warnColor;break;default:this.canvasCtx.fillStyle=this.textColor}this.canvas.drawText(this.canvasCtx,o,e.width/2,e.height/2,t,i,"bold",this.canvasCtx.fillStyle,"center","middle")}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-racetimer"]],viewQuery:function(t,i){t&1&&ce(i.canvasEl,Sf,5),t&2&&Xe()},features:[fe],decls:17,vars:4,consts:[["canvasEl",""],[3,"configChange","config","id"],[1,"raceWrapper",3,"onResize"],["id","canvasValue",1,"canvas-size"],[1,"timerBarContainer"],[1,"timer-button-groups","timer-adjusters-group"],["mat-flat-button","",1,"timer-adjust-buttons",3,"click"],["mat-flat-button","",1,"timer-reset-button",3,"click"],[1,"timer-button-groups","timer-countdown-group"],["mat-flat-button","","class","timer-start-button button-color-red",3,"click",4,"ngIf"],["mat-flat-button","","class","timer-start-button",3,"click",4,"ngIf"],["mat-flat-button","",1,"timer-synch-button","button-color-red",3,"click"],["mat-flat-button","",1,"timer-start-button","button-color-red",3,"click"],["mat-flat-button","",1,"timer-start-button",3,"click"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(1,"div",2),F("onResize",function(l){return V(o),L(i.onResized(l))}),B(2,"canvas",3,0),v(4,"div",4)(5,"div",5)(6,"button",6),F("click",function(){return V(o),L(i.remOneMin())}),E(7," -1 "),_(),v(8,"button",7),F("click",function(){return V(o),L(i.resetTimer())}),E(9," Reset "),_(),v(10,"button",6),F("click",function(){return V(o),L(i.addOneMin())}),E(11," +1 "),_()(),v(12,"div",8),ke(13,Cf,2,0,"button",9)(14,xf,2,0,"button",10),v(15,"button",11),F("click",function(){return V(o),L(i.roundToMin())}),E(16," Synch "),_()()()()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(13),j("ngIf",!i.timerRunning),P(),j("ngIf",i.timerRunning))},dependencies:[Re,tt,et,ni,_i],styles:[".raceWrapper[_ngcontent-%COMP%]{height:100%;width:100%}.canvas-size[_ngcontent-%COMP%]{position:absolute;width:100%;height:50%;top:0;left:0;z-index:inherit}.button-color-red[_ngcontent-%COMP%]{--mdc-filled-button-container-color: var(--kip-port-color);--mdc-filled-button-label-text-color: var(--kip-contrast-color)}.timerBarContainer[_ngcontent-%COMP%]{position:absolute;left:0;bottom:8%;height:auto;width:calc(100% - 20px);margin:0 10px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:stretch;align-content:stretch;gap:20px}.timer-button-groups[_ngcontent-%COMP%]{min-width:247px;max-width:100%;--mdc-filled-button-container-shape: 5px}.timer-adjusters-group[_ngcontent-%COMP%]{flex-grow:1;flex-shrink:1}.timer-countdown-group[_ngcontent-%COMP%]{flex-grow:3;flex-shrink:3}.timer-synch-button[_ngcontent-%COMP%]{width:calc(50% - 5px);margin-left:5px}.timer-start-button[_ngcontent-%COMP%]{width:calc(50% - 5px);margin-right:5px}.timer-reset-button[_ngcontent-%COMP%]{width:calc(40% + -0px);margin:0 10px}.timer-adjust-buttons[_ngcontent-%COMP%]{width:calc(30% - 10px)}"]})}return r})();var Tf=["gaugeBarAnimate"],yh=(()=>{class r{gaugeBarAnimate;displayName=Q.required();displayNameColor=Q.required();dataValue=Q.required();unitLabel=Q.required();barColor=Q.required();barColorGradient=Q.required();barColorBackground=Q.required();gaugeValue=Q.required();gaugeMinValue=Q.required();gaugeMaxValue=Q.required();newGaugeValue=1;oldGaugeValue=1;constructor(){}ngOnChanges(e){if(e.gaugeValue&&!e.gaugeValue.firstChange){let t=this.gaugeMaxValue()-this.gaugeMinValue(),i=t!==0?195/t:0;this.oldGaugeValue=this.newGaugeValue,this.newGaugeValue=(e.gaugeValue.currentValue-this.gaugeMinValue())*i,this.gaugeBarAnimate?.nativeElement&&requestAnimationFrame(()=>{this.gaugeBarAnimate?.nativeElement&&this.gaugeBarAnimate.nativeElement.beginElement()})}}ngOnDestroy(){this.gaugeBarAnimate=null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["svg-simple-linear-gauge"]],viewQuery:function(t,i){if(t&1&&Je(Tf,5),t&2){let o;je(o=Ue())&&(i.gaugeBarAnimate=o.first)}},inputs:{displayName:[1,"displayName"],displayNameColor:[1,"displayNameColor"],dataValue:[1,"dataValue"],unitLabel:[1,"unitLabel"],barColor:[1,"barColor"],barColorGradient:[1,"barColorGradient"],barColorBackground:[1,"barColorBackground"],gaugeValue:[1,"gaugeValue"],gaugeMinValue:[1,"gaugeMinValue"],gaugeMaxValue:[1,"gaugeMaxValue"]},features:[Zt],decls:24,vars:11,consts:[["gaugeBarAnimate",""],[0,"xmlns","osb","http://www.openswatchbook.org/uri/2009/osb",0,"xmlns","dc","http://purl.org/dc/elements/1.1/",0,"xmlns","cc","http://creativecommons.org/ns#",0,"xmlns","rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#",0,"xmlns","svg","http://www.w3.org/2000/svg","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","viewBox","0 0 205 50","preserveAspectRatio","xMidYMid","version","1.1","id","svg8",1,"svg-simple-linear"],["id","defs2"],["id","gaugeBarGradient"],["id","stop849","offset","0",2,"stop-opacity","1"],["id","stop851","offset","0.40",2,"stop-opacity","0"],["id","linearGradient855","gradientTransform","translate(5,-30)","gradientUnits","userSpaceOnUse","y2","34.5","x2","-5","y1","34.5","x1","-6","href","#gaugeBarGradient"],["id","layer1",2,"display","inline"],["id","GaugeBackground","width","195","height","9","x","5","y","30","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","gaugeBar"],["id","gaugeValue","width","1","height","9","x","0","y","0","ry","0",2,"mix-blend-mode","normal","fill-opacity","1","stroke-width","0.0864229"],["id","gaugeValueGradient","transform","scale(-1,1)","width","1","height","9","x","-1","y","0","ry","0",2,"display","inline","opacity","1","mix-blend-mode","multiply","fill","url(#linearGradient855)","stroke-width","0.0864229"],[0,"xlink","href","#gaugeBar","transform","translate(5,30)"],["attributeName","transform","type","scale","begin","indefinite","dur","0.5s","additive","sum","fill","freeze"],["id","layer2",2,"display","inline"],[0,"xml","space","preserve","x","4.1731763","y","25.413595","id","displayNameText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["id","tspan1945","x","4.1731763","y","25.413595",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["text-anchor","end","id","gaugeTexts","y","25.293016","x","200.37138",0,"xml","space","preserve",1,"simpleLinear-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["y","25.293016","x","200.37138","id","valueText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["dy","-9","id","unitText",2,"text-transform","capitalize","font-size","9.87778px"]],template:function(t,i){t&1&&(dt(),v(0,"svg",1)(1,"defs",2)(2,"linearGradient",3),B(3,"stop",4)(4,"stop",5),_(),B(5,"linearGradient",6),_(),v(6,"g",7),B(7,"rect",8),v(8,"defs")(9,"g",9),B(10,"rect",10)(11,"rect",11),_()(),v(12,"use",12),B(13,"animateTransform",13,0),_()(),v(15,"g",14)(16,"text",15)(17,"tspan",16),E(18),_()(),v(19,"text",17)(20,"tspan",18),E(21),_(),v(22,"tspan",19),E(23),_()()()()),t&2&&(P(3),be("stop-color",i.barColorGradient()),P(),be("stop-color",i.barColorGradient()),P(3),be("fill",i.barColorBackground()),P(5),it("fill",i.barColor()),P(),be("from",i.oldGaugeValue+" 1")("to",i.newGaugeValue+" 1"),P(4),be("fill",i.displayNameColor()),P(),at(" ",i.displayName(),""),P(3),xt(i.dataValue()),P(2),xt(i.unitLabel()))},styles:["svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.simpleLinear-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}"]})}return r})();var bh=(()=>{class r extends Ie{unitsLabel="";dataLabelValue="0";dataValue=0;barColor="";barColorGradient="";barColorBackground="";constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,color:"contrast",enableTimeout:!1,dataTimeout:5},Fe(()=>{this.theme()&&this.updateGaugeSettings()})}ngOnInit(){this.validateConfig(),this.startWidget()}startWidget(){this.widgetProperties.config.gauge.unitLabelFormat=="abr"?this.unitsLabel=this.widgetProperties.config.paths.gaugePath.convertUnitTo.substr(0,1):this.unitsLabel=this.widgetProperties.config.paths.gaugePath.convertUnitTo,this.unsubscribeDataStream(),this.observeDataStream("gaugePath",e=>{e.data.value==null?(this.dataValue=0,this.dataLabelValue="--"):(this.dataValue=Math.min(Math.max(e.data.value,this.widgetProperties.config.displayScale.lower),this.widgetProperties.config.displayScale.upper),this.dataLabelValue=this.dataValue.toFixed(this.widgetProperties.config.numDecimal))})}updateConfig(e){this.widgetProperties.config=e,this.startWidget(),this.updateGaugeSettings()}updateGaugeSettings(){switch(this.barColorBackground=this.theme().background,this.widgetProperties.config.color){case"contrast":this.barColor=this.theme().contrast,this.barColorGradient=this.theme().contrastDimmer;break;case"blue":this.barColor=this.theme().blue,this.barColorGradient=this.theme().blueDimmer;break;case"green":this.barColor=this.theme().green,this.barColorGradient=this.theme().greenDimmer;break;case"pink":this.barColor=this.theme().pink,this.barColorGradient=this.theme().pinkDimmer;break;case"orange":this.barColor=this.theme().orange,this.barColorGradient=this.theme().orangeDimmer;break;case"purple":this.barColor=this.theme().purple,this.barColorGradient=this.theme().purpleDimmer;break;case"grey":this.barColor=this.theme().grey,this.barColorGradient=this.theme().greyDimmer;break;case"yellow":this.barColor=this.theme().yellow,this.barColorGradient=this.theme().yellowDimmer;break;default:this.barColor=this.theme().contrast,this.barColorGradient=this.theme().contrastDimmer}}ngOnDestroy(){this.destroyDataStreams()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-simple-linear"]],features:[fe],decls:2,vars:12,consts:[[3,"configChange","config","id"],[1,"simpleLinearGaugeContainer",3,"displayName","displayNameColor","unitLabel","dataValue","barColor","barColorGradient","barColorBackground","gaugeValue","gaugeMaxValue","gaugeMinValue"]],template:function(t,i){t&1&&(v(0,"widget-host",0),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),B(1,"svg-simple-linear-gauge",1),_()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("displayName",i.widgetProperties.config.displayName)("displayNameColor",i.theme().contrastDim)("unitLabel",i.unitsLabel)("dataValue",i.dataLabelValue)("barColor",i.barColor)("barColorGradient",i.barColorGradient)("barColorBackground",i.barColorBackground)("gaugeValue",i.dataLabelValue)("gaugeMaxValue",i.widgetProperties.config.displayScale.upper)("gaugeMinValue",i.widgetProperties.config.displayScale.lower))},dependencies:[Re,yh],styles:[".simpleLinearGaugeContainer[_ngcontent-%COMP%]{display:block;position:relative;height:100%;width:100%;padding:0}"]})}return r})();function Ef(r,n){if(r&1){let e=ee();v(0,"h3"),E(1,"Getting Started"),_(),v(2,"p"),E(3,"Welcome to KIP! Here are some basic gestures to help you navigate the application:"),_(),v(4,"table")(5,"tr")(6,"th"),E(7,"Actions"),_(),v(8,"th"),E(9,"Gestures"),_(),v(10,"th"),E(11,"Keyboard Shortcuts"),_()(),v(12,"tr")(13,"td"),E(14,"Cycle through dashboards"),_(),v(15,"td"),E(16,"Swipe Up/Down"),_(),v(17,"td"),E(18,"Shift + Ctrl + Up/Down Arrow"),_()(),v(19,"tr")(20,"td"),E(21,"Open Actions menu"),_(),v(22,"td"),E(23,"Swipe left"),_(),v(24,"td"),E(25,"Shift + Ctrl + Right Arrow"),_()(),v(26,"tr")(27,"td"),E(28,"Open Notification menu"),_(),v(29,"td"),E(30,"Swipe right"),_(),v(31,"td"),E(32,"Shift + Ctrl + Left Arrow"),_()()(),v(33,"h3"),E(34,"Log in to Signal K"),_(),v(35,"p"),E(36," The first step is to configure Signal K server authentication ("),v(37,"i"),E(38,"a pre-existing Signal K server user/password is required"),_(),E(39,"). Swipe left to open the Actions menu, hit Settings, toggle Login to server and enter you pre-existing Signal K credentials. "),_(),v(40,"h3"),E(41,"Option 1: Load Demonstration Dashboards"),_(),v(42,"p"),E(43," Try the sample dashboards using data from your server. : "),B(44,"br"),v(45,"button",2),F("click",function(){V(e);let i=se();return L(i.loadDemoConfig())}),E(46,"Load Demo"),_()(),v(47,"h3"),E(48,"Option 2: Create Your Own Layout"),_(),v(49,"p"),E(50,' The text you are reading is actually a full screen widget in a dashboard. Dashboards are "Locked" by default to prevent accidental modifications. To edit a dashboard, swipe left and hit the bottom unlock menu button. You can later add and manage dashboards using the Dashboards page from the Actions menu. '),_(),v(51,"p")(52,"strong"),E(53,"Try editing the Dashboard now to receive further instructions!"),_()()}}function Af(r,n){r&1&&(v(0,"h3"),E(1,"Build Your Layout"),_(),v(2,"p"),E(3," First, resize this Tutorial widget using the now visible dashed borders so it does not take up all the screen. You can delete this Tutorial widget later when you are done with the instructions. Then, to add a widget: in an empty dashboard area, press and hold. This will open the widget selection panel. Here you can choose from a variety of widgets. "),_(),v(4,"p"),E(5,"To manage widgets, you can:"),_(),v(6,"ul")(7,"li")(8,"strong"),E(9,"Touch and drag"),_(),E(10," to move widgets"),_(),v(11,"li")(12,"strong"),E(13,"Drag corners and sides"),_(),E(14," to resize widgets"),_(),v(15,"li")(16,"strong"),E(17,"Double Tap"),_(),E(18," on a widget to configure it"),_(),v(19,"li")(20,"strong"),E(21,"Press and Hold"),_(),E(22," on a widget to delete or duplicate widgets"),_()(),v(23,"h3"),E(24,"Exit Dashboard Edit Mode"),_(),v(25,"p"),E(26,"Use the Save or Cancel buttons in the lower right corner to either persist your changes or revert changes."),_(),v(27,"h3"),E(28,"Add More Dashboards"),_(),v(29,"p"),E(30,"Swipe left and hit the Dashboards button. From this page you can add, rename, position and duplicate dashboards."),_())}var _h=(()=>{class r extends Ie{dashboard=M(lt);settings=M(ti);constructor(){super()}loadDemoConfig(){this.settings.loadDemoConfig()}startWidget(){}updateConfig(e){}ngOnDestroy(){this.destroyDataStreams()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-tutorial"]],features:[fe],decls:4,vars:3,consts:[[3,"configChange","config","id"],[1,"tutorial-container"],["mat-raised-button","",2,"margin-left","15px",3,"click"]],template:function(t,i){t&1&&(v(0,"widget-host",0),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),v(1,"div",1),ke(2,Ef,54,0)(3,Af,31,0),_()()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(2),Ge(i.dashboard.isDashboardStatic()?2:3))},dependencies:[Re,ni],styles:[".tutorial-container[_ngcontent-%COMP%]{position:absolute;top:0;left:0;display:block;height:100%;width:100%;overflow:none}.tutorial-container[_ngcontent-%COMP%]{padding:0 15px}table[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{border:1px solid var(--mat-sys-on-background);border-collapse:collapse}tr[_ngcontent-%COMP%]:nth-child(2n){background-color:var(--mat-sys-surface-container-high)}"]})}return r})();var Df=["compassAnimate"],Pf=["appWindAnimate"],Mf=["trueWindAnimate"],Of=["appWindValueAnimate"],If=["trueWindValueAnimate"],Rf=["waypointAnimate"],Nf=["courseOverGroundAnimate"];function Wf(r,n){r&1&&(dt(),v(0,"g",150)(1,"g",151),B(2,"path",152)(3,"path",153)(4,"path",154)(5,"path",155)(6,"path",156)(7,"path",157)(8,"path",158)(9,"path",159)(10,"path",160),_(),B(11,"path",161)(12,"path",162)(13,"path",163)(14,"path",164)(15,"path",165)(16,"path",166)(17,"path",167),_())}function Bf(r,n){if(r&1&&(dt(),B(0,"path",168)),r&2){let e=se();be("d",e.closeHauledLineStbdPath)}}function zf(r,n){if(r&1&&(dt(),B(0,"path",169)),r&2){let e=se();be("d",e.closeHauledLinePortPath)}}function Vf(r,n){if(r&1&&(dt(),B(0,"path",170)),r&2){let e=se();be("d",e.portWindSectorPath)}}function Lf(r,n){if(r&1&&(dt(),B(0,"path",171)),r&2){let e=se();be("d",e.stbdWindSectorPath)}}var Ho=([r,n],[e,t],[i,o])=>(Math.atan2(o-t,i-e)-Math.atan2(n-t,r-e)+3*Math.PI)%(2*Math.PI)-Math.PI,wh=(()=>{class r{compassAnimate=de.required("compassAnimate",{read:Ee});appWindAnimate=de.required("appWindAnimate",{read:Ee});trueWindAnimate=de.required("trueWindAnimate",{read:Ee});appWindValueAnimate=de.required("appWindValueAnimate",{read:Ee});trueWindValueAnimate=de.required("trueWindValueAnimate",{read:Ee});waypointAnimate=de.required("waypointAnimate",{read:Ee});courseOverGroundAnimate=de.required("courseOverGroundAnimate",{read:Ee});compassHeading=Q(void 0);courseOverGroundAngle=Q(void 0);courseOverGroundEnable=Q(void 0);trueWindAngle=Q(void 0);trueWindSpeed=Q(void 0);appWindAngle=Q(void 0);appWindSpeed=Q(void 0);laylineAngle=Q(void 0);closeHauledLineEnable=Q(void 0);sailSetupEnable=Q(void 0);windSectorEnable=Q(void 0);waypointAngle=Q(void 0);waypointEnable=Q(void 0);trueWindMinHistoric=Q(void 0);trueWindMidHistoric=Q(void 0);trueWindMaxHistoric=Q(void 0);compassFaceplate;headingValue="--";appWind;appWindValue;appWindSpeedDisplay="--";trueWind;trueWindValue;trueWindSpeedDisplay="--";trueWindHeading=0;waypoint;waypointActive=!1;courseOverGround;courseOverGroundActive=!1;closeHauledLinePortPath="M 231,231 231,90";closeHauledLineStbdPath="M 231,231 231,90";portWindSectorPath="none";stbdWindSectorPath="none";constructor(){this.appWind={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.appWindValue={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.trueWind={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.trueWindValue={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.compassFaceplate={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.waypoint={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.courseOverGround={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0}}ngAfterViewInit(){this.compassFaceplate.animationElement=this.compassAnimate(),this.appWind.animationElement=this.appWindAnimate(),this.appWindValue.animationElement=this.appWindValueAnimate(),this.trueWind.animationElement=this.trueWindAnimate(),this.trueWindValue.animationElement=this.trueWindValueAnimate(),this.waypoint.animationElement=this.waypointAnimate(),this.courseOverGround.animationElement=this.courseOverGroundAnimate()}ngOnChanges(e){if(e.compassHeading&&!e.compassHeading.firstChange){if(e.compassHeading.currentValue===null)return;this.compassFaceplate.oldDegreeIndicator=this.compassFaceplate.newDegreeIndicator,this.compassFaceplate.newDegreeIndicator=e.compassHeading.currentValue.toFixed(0),this.headingValue=this.compassFaceplate.newDegreeIndicator,this.smoothCircularRotation(this.compassFaceplate),this.updateClauseHauledLines(),this.updateWindSectors()}if(e.courseOverGroundAngle){if(this.courseOverGroundEnable()==!1){this.courseOverGroundActive=!1;return}e.courseOverGroundAngle.firstChange||(e.courseOverGroundAngle.currentValue===null?this.courseOverGroundActive=!1:(this.courseOverGroundActive=!0,this.courseOverGround.oldDegreeIndicator=this.courseOverGround.newDegreeIndicator,this.courseOverGround.newDegreeIndicator=e.courseOverGroundAngle.currentValue.toFixed(0),this.smoothCircularRotation(this.courseOverGround)))}if(e.waypointAngle){if(this.waypointEnable()==!1){this.waypointActive=!1;return}e.waypointAngle.firstChange||(e.waypointAngle.currentValue===null?this.waypointActive=!1:(this.waypointActive=!0,this.waypoint.oldDegreeIndicator=this.waypoint.newDegreeIndicator,this.waypoint.newDegreeIndicator=e.waypointAngle.currentValue.toFixed(0),this.smoothCircularRotation(this.waypoint)))}if(e.appWindAngle&&!e.appWindAngle.firstChange){if(e.appWindAngle.currentValue===null)return;this.appWind.oldDegreeIndicator=this.appWind.newDegreeIndicator,this.appWindValue.oldDegreeIndicator=this.appWindValue.newDegreeIndicator,this.appWind.newDegreeIndicator=e.appWindAngle.currentValue.toFixed(0);let t=Number(e.appWindAngle.currentValue)*-1;this.appWindValue.newDegreeIndicator=t.toFixed(0),this.smoothCircularRotation(this.appWind,this.appWindValue)}if(e.trueWindAngle&&!e.trueWindAngle.firstChange){if(e.trueWindAngle.currentValue===null)return;this.trueWind.oldDegreeIndicator=this.trueWind.newDegreeIndicator,this.trueWindValue.oldDegreeIndicator=this.trueWindValue.newDegreeIndicator,this.trueWindHeading=e.trueWindAngle.currentValue,this.trueWind.newDegreeIndicator=this.addHeading(this.trueWindHeading,Number(this.compassFaceplate.newDegreeIndicator)*-1).toFixed(0);let t=Number(this.trueWind.newDegreeIndicator)*-1;this.trueWindValue.newDegreeIndicator=t.toFixed(0),this.smoothCircularRotation(this.trueWind,this.trueWindValue),this.updateClauseHauledLines()}if(e.appWindSpeed&&!e.appWindSpeed.firstChange){if(e.appWindSpeed.currentValue===null)return;this.appWindSpeedDisplay=e.appWindSpeed.currentValue.toFixed(1)}if(e.trueWindSpeed&&!e.trueWindSpeed.firstChange){if(e.trueWindSpeed.currentValue===null)return;this.trueWindSpeedDisplay=e.trueWindSpeed.currentValue.toFixed(1)}(e.trueWindMinHistoric&&!e.trueWindMinHistoric.firstChange||e.trueWindMaxHistoric&&!e.trueWindMaxHistoric.firstChange)&&isNaN(Number(this.trueWindMinHistoric()))&&isNaN(Number(this.trueWindMaxHistoric()))&&this.updateWindSectors()}updateClauseHauledLines(){let e=this.addHeading(Number(this.trueWind.newDegreeIndicator),this.laylineAngle()*-1),t=160*Math.sin(e*Math.PI/180)+231,i=160*Math.cos(e*Math.PI/180)*-1+231;this.closeHauledLinePortPath="M 231,231 "+t+","+i;let o=this.addHeading(Number(this.trueWind.newDegreeIndicator),this.laylineAngle()),a=160*Math.sin(o*Math.PI/180)+231,l=160*Math.cos(o*Math.PI/180)*-1+231;this.closeHauledLineStbdPath="M 231,231 "+a+","+l}updateWindSectors(){let e=this.addHeading(this.addHeading(this.trueWindMinHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()*-1),t=this.addHeading(this.addHeading(this.trueWindMidHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()*-1),i=this.addHeading(this.addHeading(this.trueWindMaxHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()*-1),o=160*Math.sin(e*Math.PI/180)+231,a=160*Math.cos(e*Math.PI/180)*-1+231,l=160*Math.sin(t*Math.PI/180)+231,d=160*Math.cos(t*Math.PI/180)*-1+231,f=160*Math.sin(i*Math.PI/180)+231,s=160*Math.cos(i*Math.PI/180)*-1+231,c=Math.abs(Ho([o,a],[l,d],[f,s]))>Math.PI/2?0:1,p=Ho([f,s],[o,a],[l,d])>0?0:1;this.portWindSectorPath="M 231,231 L "+o+","+a+" A 160,160 0 "+c+" "+p+" "+f+","+s+" z";let y=this.addHeading(this.addHeading(this.trueWindMinHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()),k=this.addHeading(this.addHeading(this.trueWindMidHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()),x=this.addHeading(this.addHeading(this.trueWindMaxHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()),A=160*Math.sin(y*Math.PI/180)+231,z=160*Math.cos(y*Math.PI/180)*-1+231,Y=160*Math.sin(k*Math.PI/180)+231,re=160*Math.cos(k*Math.PI/180)*-1+231,_e=160*Math.sin(x*Math.PI/180)+231,Le=160*Math.cos(x*Math.PI/180)*-1+231,Ye=Math.abs(Ho([A,z],[Y,re],[_e,Le]))>Math.PI/2?0:1,$e=Ho([_e,Le],[A,z],[Y,re])>0?0:1;this.stbdWindSectorPath="M 231,231 L "+A+","+z+" A 160,160 0 "+Ye+" "+$e+" "+_e+","+Le+" z"}addHeading(e=0,t=0){let i=e+t;for(;i>359;)i=i-359;for(;i<0;)i=i+359;return i}smoothCircularRotation(e,t){let i=Number(e.oldDegreeIndicator),o=Number(e.newDegreeIndicator),a=i-o;e.animationElement&&a!=0&&(Math.abs(a)>180?Math.sign(a)==1?i==359?(e.oldDegreeIndicator="0",e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.oldDegreeIndicator="0",t.animationElement.nativeElement.beginElement())):(e.newDegreeIndicator="359",e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.newDegreeIndicator="-359",t.animationElement.nativeElement.beginElement()),e.oldDegreeIndicator="0",e.newDegreeIndicator=o.toFixed(0),e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.oldDegreeIndicator=e.oldDegreeIndicator,t.newDegreeIndicator="0",t.animationElement.nativeElement.beginElement())):i==0?(e.oldDegreeIndicator="359",e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.oldDegreeIndicator="-359",t.animationElement.nativeElement.beginElement())):(e.newDegreeIndicator="0",e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.newDegreeIndicator="0",t.animationElement.nativeElement.beginElement()),e.oldDegreeIndicator="359",e.newDegreeIndicator=o.toFixed(0),e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.oldDegreeIndicator="-359",t.newDegreeIndicator=(o*-1).toFixed(0),t.animationElement.nativeElement.beginElement())):(e.animationElement.nativeElement.beginElement(),t!==void 0&&t.animationElement.nativeElement.beginElement()))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["app-svg-wind"]],viewQuery:function(t,i){t&1&&(ce(i.compassAnimate,Df,5,Ee),ce(i.appWindAnimate,Pf,5,Ee),ce(i.trueWindAnimate,Mf,5,Ee),ce(i.appWindValueAnimate,Of,5,Ee),ce(i.trueWindValueAnimate,If,5,Ee),ce(i.waypointAnimate,Rf,5,Ee),ce(i.courseOverGroundAnimate,Nf,5,Ee)),t&2&&Xe(7)},inputs:{compassHeading:[1,"compassHeading"],courseOverGroundAngle:[1,"courseOverGroundAngle"],courseOverGroundEnable:[1,"courseOverGroundEnable"],trueWindAngle:[1,"trueWindAngle"],trueWindSpeed:[1,"trueWindSpeed"],appWindAngle:[1,"appWindAngle"],appWindSpeed:[1,"appWindSpeed"],laylineAngle:[1,"laylineAngle"],closeHauledLineEnable:[1,"closeHauledLineEnable"],sailSetupEnable:[1,"sailSetupEnable"],windSectorEnable:[1,"windSectorEnable"],waypointAngle:[1,"waypointAngle"],waypointEnable:[1,"waypointEnable"],trueWindMinHistoric:[1,"trueWindMinHistoric"],trueWindMidHistoric:[1,"trueWindMidHistoric"],trueWindMaxHistoric:[1,"trueWindMaxHistoric"]},features:[Zt],decls:177,vars:30,consts:[["courseOverGroundAnimate",""],["waypointAnimate",""],["compassAnimate",""],["appWindValueAnimate",""],["appWindAnimate",""],["trueWindValueAnimate",""],["trueWindAnimate",""],["viewBox","0 0 462 462","preserveAspectRatio","xMidYMid","version","1.1","id","svg8",0,"xmlns","xlink","http://www.w3.org/1999/xlink","xmlns","http://www.w3.org/2000/svg",0,"xmlns","svg","http://www.w3.org/2000/svg",0,"xmlns","rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#",0,"xmlns","cc","http://creativecommons.org/ns#"],["id","defs2"],["id","linearGradient14212"],["offset","0","id","stop14208",1,"boatBackground",2,"stop-opacity","1"],["offset","1","id","stop14210",1,"boatBackground",2,"stop-opacity","0"],["id","linearGradient7154"],["offset","0","id","stop7150",1,"port",2,"stop-opacity","1"],["offset","0.39871383","id","stop7152",1,"boatBackground",2,"stop-opacity","0.56470591"],["id","linearGradient1133"],["offset","0","id","stop1129",1,"starboard",2,"stop-opacity","1"],["offset","0.39871383","id","stop1131",1,"boatBackground",2,"stop-opacity","0.56603771"],[0,"xlink","href","#linearGradient1133","id","linearGradient1135","x1","472.6088","y1","531.48444","x2","472.49197","y2","879.10449","gradientUnits","userSpaceOnUse","spreadMethod","pad","gradientTransform","matrix(-1,0,0,1,703.32731,-474.28644)"],[0,"xlink","href","#linearGradient7154","id","linearGradient7156","x1","-472.64746","y1","531.50549","x2","-472.46103","y2","879.07489","gradientUnits","userSpaceOnUse","gradientTransform","translate(703.32731,-474.28644)"],[0,"xlink","href","#linearGradient14212","id","linearGradient14214","x1","250.36952","y1","296.6875","x2","252.56253","y2","512.70984","gradientUnits","userSpaceOnUse"],[0,"xlink","href","#linearGradient14212","id","linearGradient20477","gradientUnits","userSpaceOnUse","x1","250.84233","y1","382.58936","x2","249.67986","y2","510.65265","gradientTransform","matrix(1.0960272,0,0,0.99845438,-43.954738,-169.73034)",1,"boatBackground"],[0,"xlink","href","#linearGradient14212","id","linearGradient24749","gradientUnits","userSpaceOnUse","gradientTransform","matrix(-1.0960272,0,0,0.99845438,505.95474,-169.73034)","x1","250.84233","y1","382.58936","x2","249.67986","y2","510.65265"],["id","layer1","transform","matrix(0.1248082,0,0,0.11220779,-23.713913,416.39261)","style","display:inline",4,"ngIf"],["id","layerBackground",2,"display","inline"],["id","portStarboardDial","transform","matrix(1.2528928,0,0,1.2528928,-58.41824,-58.418234)",2,"display","inline"],["id","dial",2,"display","inline"],["d","M 230.84956,397.3848 A 165.94029,166.38596 0 0 1 65.282663,231.0632 165.94029,166.38596 0 0 1 230.72204,64.614075","id","Port",2,"display","inline","fill","none","fill-opacity","0","stroke","url(#linearGradient7156)","stroke-width","14.8205","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","M 230.68031,397.38592 A 165.94029,166.38596 0 0 0 374.4654,314.23407 165.94029,166.38596 0 0 0 374.48627,147.80217 165.94029,166.38596 0 0 0 230.72204,64.614055","id","Starboard",2,"display","inline","opacity","1","fill","none","fill-opacity","1","stroke","url(#linearGradient1135)","stroke-width","14.8205","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","Markers",1,"compass-inner-ring",2,"display","inline"],["id","path7189","d","m 80.687566,144.4454 12.77685,7.39357",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 144.00413,80.713346 7.37674,12.80605","id","path7191",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7193","d","m 317.35705,80.343646 -7.37672,12.80611",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 380.94363,143.80506 -12.77686,7.39366","id","path7195",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7197","d","m 404.35295,230.63031 -14.75348,3e-5",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 381.31248,317.55462 -12.77692,-7.3936","id","path7199",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7201","d","m 317.99591,381.28669 -7.37678,-12.80612",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 231.36885,404.74957 -3e-5,-14.78727","id","path7203",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7205","d","m 144.64297,381.65636 7.37672,-12.80615",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 81.056382,318.19494 12.776874,-7.39367","id","path7207",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7209","d","m 57.647056,231.36969 14.753506,-6e-5",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 230.63116,57.250436 6e-5,14.78725","id","path7211",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684811","transform","matrix(0.98473974,0.17403345,-0.1732637,0.98487547,0,0)","cy","20.915556","cx","267.08746","id","path7213",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4713458","rx","1.4687726","id","circle7219","cx","295.5636","cy","-28.405027","transform","matrix(0.93944096,0.3427108,-0.34133044,0.93994337,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4703517","rx","1.4697686","transform","matrix(0.7653205,0.64364938,-0.64192532,0.76676716,0,0)","cy","-137.90392","cx","325.09726","id","circle7221",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4697686","rx","1.4703517","id","circle7223","cx","325.22626","cy","-194.73386","transform","matrix(0.64192538,0.76676711,-0.76532046,0.64364943,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4687726","rx","1.4713458","transform","matrix(0.34133049,0.93994335,-0.93944093,0.34271086,0,0)","cy","-304.00223","cx","296.08084","id","circle7225",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4684812","rx","1.4716377","id","circle7227","cx","267.66086","cy","-353.1622","transform","matrix(0.1732637,0.98487547,-0.98473974,0.17403346,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4684812","rx","1.4716377","transform","matrix(-0.1732637,0.98487547,-0.98473974,-0.17403346,0,0)","cy","-433.23273","cx","187.41795","id","circle7229",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4687726","rx","1.4713457","id","circle7231","cx","138.06422","cy","-461.74182","transform","matrix(-0.34133048,0.93994335,-0.93944094,-0.34271083,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4697688","rx","1.4703517","transform","matrix(-0.64192535,0.76676714,-0.7653205,-0.64364938,0,0)","cy","-491.38818","cx","28.452917","id","circle7233",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4703517","rx","1.4697688","id","circle7235","cx","-28.442974","cy","-491.58316","transform","matrix(-0.7653205,0.64364938,-0.64192535,-0.76676714,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4713457","rx","1.4687726","transform","matrix(-0.93944094,0.34271083,-0.34133048,-0.93994335,0,0)","cy","-462.55035","cx","-137.82401","id","circle7237",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684812","id","circle7239","cx","-187.01695","cy","-434.16339","transform","matrix(-0.98473974,0.17403346,-0.1732637,-0.98487547,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684812","transform","matrix(-0.98473974,-0.17403346,0.1732637,-0.98487547,0,0)","cy","-353.92023","cx","-267.08746","id","circle7241",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4713457","rx","1.4687726","id","circle7243","cx","-295.56357","cy","-304.53366","transform","matrix(-0.93944094,-0.34271083,0.34133048,-0.93994335,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4703517","rx","1.4697688","transform","matrix(-0.7653205,-0.64364938,0.64192535,-0.76676714,0,0)","cy","-194.80986","cx","-325.09729","id","circle7245",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4697688","rx","1.4703517","id","circle7247","cx","-325.22629","cy","-137.84785","transform","matrix(-0.64192535,-0.76676714,0.7653205,-0.64364938,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4687726","rx","1.4713457","transform","matrix(-0.34133048,-0.93994335,0.93944094,-0.34271083,0,0)","cy","-28.354155","cx","-296.08081","id","circle7249",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4684812","rx","1.4716377","id","circle7251","cx","-267.66086","cy","20.871838","transform","matrix(-0.1732637,-0.98487547,0.98473974,-0.17403346,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4684812","rx","1.4716377","transform","matrix(0.1732637,-0.98487547,0.98473974,0.17403346,0,0)","cy","100.94239","cx","-187.41795","id","circle7253",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4687726","rx","1.4713458","id","circle7255","cx","-138.06422","cy","129.38542","transform","matrix(0.34133049,-0.93994335,0.93944093,0.34271086,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4697686","rx","1.4703517","transform","matrix(0.64192538,-0.76676711,0.76532046,0.64364943,0,0)","cy","158.80649","cx","-28.452925","id","circle7257",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4703517","rx","1.4697686","id","circle7259","cx","28.442968","cy","158.86946","transform","matrix(0.7653205,-0.64364938,0.64192532,0.76676716,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4713458","rx","1.4687726","transform","matrix(0.93944096,-0.3427108,0.34133044,0.93994337,0,0)","cy","129.61153","cx","137.82397","id","circle7261",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684811","id","circle7263","cx","187.01694","cy","101.15855","transform","matrix(0.98473974,-0.17403345,0.1732637,0.98487547,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684811","transform","matrix(0.98473974,-0.17403345,0.1732637,0.98487547,0,0)","cy","101.15855","cx","187.01694","id","circle7265",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","vessel"],["d","m 290.42597,338.16266 c 2.63751,1.24549 18.13789,-172.91133 -60.18622,-214.49975","id","rightSide",2,"display","inline","fill","none","fill-opacity","1","stroke","url(#linearGradient20477)","stroke-width","3.29218","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.5"],["d","m 171.57403,338.16266 c -2.63751,1.24549 -18.13789,-172.91133 60.18622,-214.49975","id","LeftSide",2,"display","inline","fill","none","fill-opacity","1","stroke","url(#linearGradient24749)","stroke-width","3.29218","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.5"],["id","LayerLayline",2,"display","inline"],["id","PortLayline","style","display:inline;fill:none;stroke-width:3;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:4px;stroke-opacity:0.6","class","laylines",4,"ngIf"],["class","laylines","style","display:inline;fill:none;stroke-width:3;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:4px;stroke-opacity:0.6","id","StbdLayline",4,"ngIf"],["id","layerLayline",2,"display","inline"],["id","portSectorShift","class","wind-sector-port","style","fill-opacity:0.5;stroke:none;stroke-width:1.90858;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.483517",4,"ngIf"],["id","StbdSectorShift","class","wind-sector-stbd","style","fill-opacity:0.5;stroke:none;stroke-width:1.90858;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.483517",4,"ngIf"],["id","layerCompassHeading",2,"display","inline"],["ry","180.0916","rx","180.39105","id","circle4732","cx","231","cy","231",1,"compass-inner-ring",2,"display","inline","fill","none","stroke-width","25.7045","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 263.57231,46.351529 -2.645,14.975662","id","use6608",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 295.14524,54.854852 -5.20963,14.289576","id","use6610",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 351.51519,87.473623 -9.79086,11.648999","id","use6614",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 374.59941,110.59797 -11.66832,9.77463","id","use6616",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 407.08076,166.9848 -14.31341,5.20098","id","use6620",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 415.4909,198.53405 -15.00058,2.64064","id","use6622",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 415.3802,263.58022 -15.00058,-2.64063","id","use6626",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 406.86273,295.10073 -14.31336,-5.201","id","use6628",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 374.82713,351.8892 -11.66835,-9.77469","id","use6632",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 351.6643,374.93512 -9.79091,-11.64903","id","use6634",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 295.18368,407.36246 -5.20963,-14.28959","id","use6638",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 263.582,415.7587 -2.64498,-14.97568","id","use6640",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 198.42768,415.64815 2.64502,-14.97563","id","use6644",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 166.85475,407.14491 5.20963,-14.28964","id","use6646",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 110.48482,374.52608 9.7909,-11.64895","id","use6650",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 87.400578,351.40175 11.668341,-9.77468","id","use6652",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 54.919243,295.01489 14.313345,-5.20101","id","use6656",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 46.509108,263.46566 15.000536,-2.64062","id","use6658",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 46.619797,198.41948 15.000536,2.64063","id","use6662",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 55.137227,166.89897 14.313356,5.20102","id","use6664",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 87.172904,110.11054 11.668332,9.77464","id","use6668",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 110.33569,87.064604 9.79094,11.648998","id","use6670",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 166.81632,54.63722 5.20964,14.289621","id","use6674",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 198.41802,46.241065 2.645,14.975629","id","use6676",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["transform","scale(1.0008192,0.99918148)","id","textNorth","y","59.938854","x","220.36444",0,"xml","space","preserve",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","24.6764px","line-height","1.25","font-family","sans-serif","-inkscape-font-specification","'sans-serif, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","fill-opacity","1","stroke","none","stroke-width","20.2921","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.854271"],["y","59.938854","x","220.36444","id","tspan4586",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","24.6764px","font-family","sans-serif","-inkscape-font-specification","'sans-serif, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","writing-mode","lr-tb","text-anchor","start","stroke","none","stroke-width","20.2921","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.854271"],["transform","matrix(0.85624422,0.51732097,-0.51817793,0.85482117,0,0)",0,"xml","space","preserve","x","306.34256","y","-96.410698","id","use7031",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-96.410698","x","306.34256","id","tspan7101",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(0.48244023,0.87542368,-0.87687739,0.48163639,0,0)",0,"xml","space","preserve","x","301.879","y","-266.04935","id","use7033",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-266.04935","x","301.879","id","tspan7103",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.02063317,0.99895735,-1.0006182,-0.0206025,0,0)",0,"xml","space","preserve","x","214.30859","y","-410.76288","id","use7035",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-410.76288","x","214.30859","id","tspan7105",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.51817793,0.85482117,-0.85624422,-0.51732097,0,0)",0,"xml","space","preserve","x","60.744469","y","-490.80396","id","use7037",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-490.80396","x","60.744469","id","tspan7109",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.87687739,0.48163639,-0.48244023,-0.87542368,0,0)",0,"xml","space","preserve","x","-109.23221","y","-488.53186","id","use7039",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-488.53186","x","-109.23221","id","tspan7111",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-1.0006182,-0.0206025,0.02063317,-0.99895735,0,0)",0,"xml","space","preserve","x","-250.87608","y","-401.37546","id","use7041",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-401.37546","x","-250.87608","id","tspan7113",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.85624422,-0.51732097,0.51817793,-0.85482117,0,0)",0,"xml","space","preserve","x","-332.97412","y","-254.26855","id","use7043",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-254.26855","x","-332.97412","id","tspan7115",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.48244023,-0.87542368,0.87687739,-0.48163639,0,0)",0,"xml","space","preserve","x","-328.56262","y","-84.81398","id","use7045",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-84.81398","x","-328.56262","id","tspan7117",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(0.02063317,-0.99895735,1.0006182,0.0206025,0,0)",0,"xml","space","preserve","x","-243.82649","y","60.284389","id","use7047",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","60.284389","x","-243.82649","id","tspan7119",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(0.51817793,-0.85482117,0.85624422,0.51732097,0,0)",0,"xml","space","preserve","x","-94.569901","y","141.12741","id","use7049",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","141.12741","x","-94.569901","id","tspan7121",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(0.84497054,-0.53548077,0.5363647,0.84356435,0,0)",0,"xml","space","preserve","x","68.010208","y","143.99249","id","use7051",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","143.99249","x","68.010208","id","tspan7125",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["id","COGIndicator"],["id","indicator","d","m 233.42911,73.408997 a 2.5,2.5 0 0 1 -2.5,2.5 2.5,2.5 0 0 1 -2.5,-2.5 2.5,2.5 0 0 1 2.5,-2.5 2.5,2.5 0 0 1 2.5,2.5 z m -11.72079,-40.278243 6.73667,-4.970565 c 1.41548,-1.044398 3.69456,-1.044398 5.11004,0 l 6.73666,4.97056 c 1.41549,1.044397 1.41549,2.725985 0,3.770382 l -6.73667,4.970566 c -1.41547,1.044391 -3.69456,1.044397 -5.11004,0 l -6.73666,-4.97056 c -1.41548,-1.044397 -1.41548,-2.725991 0,-3.770383 z m 6.73255,-4.677026 h 5 v 45.031639 h -5 z",1,"course-over-ground",2,"stroke-width","5.76507","stroke-linecap","square"],["attributeName","transform","type","rotate","begin","indefinite","dur","0.5s","additive","replace","fill","freeze"],["id","waypoint",2,"display","inline"],["id","waypoint","transform","translate(-0.00209063,3)"],["id","path6341","cx","231","cy","72.35717","r","5.6431713",1,"next-waypoint",2,"fill","none","fill-opacity","1","stroke-width","5.7","stroke-dasharray","none","stroke-opacity","0.984314"],["id","g11647","transform","matrix(1.0001219,0,0,0.99974754,-0.02606381,-20.276417)",2,"fill","#afafaf","fill-opacity","1","stroke","#afafaf","stroke-opacity","1"],["id","path10836","d","m 240.4718,93.050621 c 2.54775,0.153686 5.11457,0.356643 7.70105,0.601581 h 0.34551",2,"fill","#afafaf","fill-opacity","1","stroke","#afafaf","stroke-width","2.3","stroke-dasharray","none","stroke-opacity","1"],["id","path11640","d","m 213.62158,93.652202 c 2.61223,-0.320275 5.24415,-0.552387 7.8965,-0.705521",2,"fill","#afafaf","fill-opacity","1","stroke","#afafaf","stroke-width","2.3","stroke-dasharray","none","stroke-opacity","1"],["id","layerWindAngle",2,"display","inline"],["x","0","y","0","width","33","height","83","viewBox","0 0 33 83","id","AppWindCoord",2,"overflow","visible"],["id","NeddleAWA","d","m 231,7.2483045 a 16.130346,16.130346 0 0 0 -16.13086,16.1308605 16.130346,16.130346 0 0 0 4.87109,11.494141 l 11.40039,54.181641 0.006,0.01367 11.27539,-54.357423 A 16.130346,16.130346 0 0 0 247.13086,23.379165 16.130346,16.130346 0 0 0 231,7.2483045 Z",1,"app-wind",2,"display","inline","fill-opacity","1","stroke","#afafaf","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],[0,"xml","space","preserve","x","233","y","52.233677","id","LabelAWS",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline","fill-opacity","1","stroke","none","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],["viewBox","-231.5 -8 33 53","id","AWSCoord",2,"overflow","visible"],[0,"xml","space","preserve","alignment-baseline","middle","x","0","y","0","id","ValueAWS","transform","scale(1.0128481,0.98731488)",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","14.3px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline","fill-opacity","1","stroke","none","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],["x","0","y","0","width","33","height","53","viewBox","0 0 33 53","id","TrueWindCoord",2,"overflow","visible"],["id","NeddleTWA","d","m 231,7.25 a 16.122065,16.122065 0 0 0 -16.12109,16.121093 16.122065,16.122065 0 0 0 4.70117,11.322266 l 11.52148,24.009766 0.008,0.0059 11.41015,-24.115234 A 16.122065,16.122065 0 0 0 247.12109,23.371093 16.122065,16.122065 0 0 0 231,7.25 Z",1,"true-wind",2,"display","inline","fill-opacity","0.996078","stroke","#000000","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],[0,"xml","space","preserve","x","232.99219","y","52.227623","id","LabelTWS",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline","fill-opacity","1","stroke","none","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],["viewBox","-231.5 -24 33 53","id","TWSCoord",2,"overflow","visible"],[0,"xml","space","preserve","alignment-baseline","middle","x","0","y","0","id","ValueTWS",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","14.3px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline","fill-opacity","1","stroke","none","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],["id","LayerHeadingIndicator","transform","translate(4,8)",2,"display","inline"],["id","FaceplateHeading","width","67.073669","height","38.361046","x","194.46938","y","30.8176","d","m 225.64754,33.805625 1.6301,0.0048 c 17.39931,0.05072 31.39725,3.329857 31.38553,7.35232 l -0.0685,23.494107 c -0.0117,4.022464 -14.02856,7.21993 -31.42786,7.169208 l -1.63011,-0.0048 c -17.3993,-0.05072 -31.39725,-3.329857 -31.38552,-7.352321 l 0.0685,-23.494107 c 0.0117,-4.022463 14.02855,-7.219929 31.42786,-7.169207 z","ry","7.3267355","rx","32.688519","transform","matrix(1.002028,0,0,0.77009941,-0.86633959,3.237595)",1,"heading-background",2,"display","inline","opacity","1","fill-opacity","1","stroke-width","2.5","stroke-linecap","butt","stroke-linejoin","round","stroke-dasharray","none","stroke-opacity","1"],[0,"xml","space","preserve","x","226.14061","y","52.178043","id","ValueHeading",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","24px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline"],["id","tspan349","x","226.14061","y","52.178043"],["id","layer1","transform","matrix(0.1248082,0,0,0.11220779,-23.713913,416.39261)",2,"display","inline"],["id","Boat","transform","matrix(2.4762966,0,0,2.4762966,312.32639,-480.88375)",1,"sailSetupBoat",2,"display","inline"],["d","m 117.80581,288.1415 -22.540223,29.3722 h -16.5349 l 0.25052,-26.32688 c -1.06637,-2.75393 -2.56049,-3.06484 -4.84601,-3.55125 z","id","path2110",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 8.9767971,282.82435 -4.95991,24.75841 h 7.7154099 l 7.16432,-23.7875","id","path2148",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["id","scafo_1_","d","m 195.42256,265.29369 c 0,0 -12.46584,10.53388 -18.18235,16.95385 -1.87779,2.10888 -8.08356,2.76316 -16.33955,3.62976 -32.36804,3.39759 -103.815953,4.14078 -157.1129429,-4.52397 3.49616,-2.32158 3.79424,-8.74891 5.51442,-13.35052 7.1e-4,0 131.6522929,-0.0975 186.1204229,-2.70912 z",2,"display","inline","fill","none","stroke-width","3","stroke-dasharray","none"],["d","m 23.541277,239.61115 h 94.045203 l 0.39645,2.12132 -94.545213,0.35355 z","id","path2154",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 102.35735,2.5312768 h 4.37983 c 8.9756,36.5347612 12.51565,95.9939792 14.23441,163.1344432 v 92.86113 h -2.73738 l 0.54748,-92.86113 C 116.16119,110.0212 115.191,52.56101 105.64222,4.5390852 Z","id","path2158",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 104.27966,267.15927 -0.22723,-7.83783 c 22.67574,-0.50375 30.37822,0.37193 37.04087,7.36281","id","path2116",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 1.0329568,282.20014 5.7927027,-15.82819 1.9208522,1.18337","id","path2104",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","2.13494","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","M 116.99965,68.100007 190.49965,265.1","id","path2160",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","M 8.8139634,266.87847 102.98152,3.5208385","id","path2208",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 268.56631,196.18971 -7.52466,-0.0957 -42.6992,68.72135 -26.43173,67.95776 -0.29576,0.48195 -0.11878,1.21163 -0.092,1.15201 76.51843,-0.0845 0.0422,-3.68441 0.0578,-2.60466 -0.0832,-3.58678 0.40814,-30.21044 0.43451,-38.16536 0.11267,-19.13053 0.008,-13.73528 -0.12432,-16.23422 z","id","Reef3","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef3",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke-width","2.34613","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 266.10811,139.30664 h -7.42901 l -42.69918,68.72134 -26.43173,67.95777 -14.01711,50.03862 -1.05129,5.07493 -0.70001,4.5951 94.06196,-0.0639 0.15835,-8.47316 0.0577,-2.44384 0.46668,-44.66571 0.42579,-41.29152 -0.2351,-38.16536 -0.74826,-19.13053 -0.75663,-13.54396 -0.6982,-16.61687 z","id","Reef2","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef2",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke-width","2.34613","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 261.10546,61.763841 h -6.78005 l -42.69918,68.721369 -26.43173,67.95776 -20.02404,74.06637 -14.96301,59.55366 -0.75384,3.65964 118.40312,-0.24747 0.3958,-35.2044 0.55482,-54.44997 0.036,-42.1476 -1.91047,-41.81069 -1.92241,-38.16537 -1.00784,-19.5199 -0.75663,-13.803549 -1.08758,-16.746654 z","id","Reef1","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef1",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke-width","2.34613","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 250.83842,-17.681808 h -6.40769 l -42.45096,68.72137 -26.43173,67.957768 -20.02404,74.06638 -17.62115,71.77563 -15.21827,71.01207 145.19283,-0.39575 0.95061,-116.19575 v -15.85565 l -3.08946,-66.73565 -2.85177,-52.536575 -3.08946,-39.284109 -2.37648,-20.588657 -1.9012,-14.6723772 -2.13885,-14.9090281 z","id","Main","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupFull",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke-width","2.34613","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 308.08151,183.27812 -13.93148,139.40275 65.92617,-1.08343","id","WorkingJib","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef2",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke","#000000","stroke-width","1.67085","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 291.85104,138.47323 -31.19542,207.55672 108.08107,-0.81342","id","Jib","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef1",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke","#000000","stroke-width","2.33332","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 272.14328,86.627245 -57.69332,284.259845 162.9035,-2.80365","id","Genoa","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupFull",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke","#000000","stroke-width","2.36044","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["id","PortLayline",1,"laylines",2,"display","inline","fill","none","stroke-width","3","stroke-linecap","square","stroke-linejoin","miter","stroke-miterlimit","0","stroke-dasharray","4px","stroke-opacity","0.6"],["id","StbdLayline",1,"laylines",2,"display","inline","fill","none","stroke-width","3","stroke-linecap","square","stroke-linejoin","miter","stroke-miterlimit","0","stroke-dasharray","4px","stroke-opacity","0.6"],["id","portSectorShift",1,"wind-sector-port",2,"fill-opacity","0.5","stroke","none","stroke-width","1.90858","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.483517"],["id","StbdSectorShift",1,"wind-sector-stbd",2,"fill-opacity","0.5","stroke","none","stroke-width","1.90858","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.483517"]],template:function(t,i){t&1&&(dt(),v(0,"svg",7)(1,"defs",8)(2,"linearGradient",9),B(3,"stop",10)(4,"stop",11),_(),v(5,"linearGradient",12),B(6,"stop",13)(7,"stop",14),_(),v(8,"linearGradient",15),B(9,"stop",16)(10,"stop",17),_(),B(11,"linearGradient",18)(12,"linearGradient",19)(13,"linearGradient",20)(14,"linearGradient",21)(15,"linearGradient",22),_(),ke(16,Wf,18,0,"g",23),v(17,"g",24)(18,"g",25)(19,"g",26),B(20,"path",27)(21,"path",28),_(),v(22,"g",29),B(23,"path",30)(24,"path",31)(25,"path",32)(26,"path",33)(27,"path",34)(28,"path",35)(29,"path",36)(30,"path",37)(31,"path",38)(32,"path",39)(33,"path",40)(34,"path",41)(35,"ellipse",42)(36,"ellipse",43)(37,"ellipse",44)(38,"ellipse",45)(39,"ellipse",46)(40,"ellipse",47)(41,"ellipse",48)(42,"ellipse",49)(43,"ellipse",50)(44,"ellipse",51)(45,"ellipse",52)(46,"ellipse",53)(47,"ellipse",54)(48,"ellipse",55)(49,"ellipse",56)(50,"ellipse",57)(51,"ellipse",58)(52,"ellipse",59)(53,"ellipse",60)(54,"ellipse",61)(55,"ellipse",62)(56,"ellipse",63)(57,"ellipse",64)(58,"ellipse",65)(59,"ellipse",66),_()(),v(60,"g",67),B(61,"path",68)(62,"path",69),_()(),v(63,"g",70),ke(64,Bf,1,1,"path",71)(65,zf,1,1,"path",72),_(),v(66,"g",73),ke(67,Vf,1,1,"path",74)(68,Lf,1,1,"path",75),_(),v(69,"g",76),B(70,"ellipse",77)(71,"path",78)(72,"path",79)(73,"path",80)(74,"path",81)(75,"path",82)(76,"path",83)(77,"path",84)(78,"path",85)(79,"path",86)(80,"path",87)(81,"path",88)(82,"path",89)(83,"path",90)(84,"path",91)(85,"path",92)(86,"path",93)(87,"path",94)(88,"path",95)(89,"path",96)(90,"path",97)(91,"path",98)(92,"path",99)(93,"path",100)(94,"path",101),v(95,"text",102)(96,"tspan",103),E(97,"N"),_()(),v(98,"text",104)(99,"tspan",105),E(100,"30"),_()(),v(101,"text",106)(102,"tspan",107),E(103,"60"),_()(),v(104,"text",108)(105,"tspan",109),E(106,"90"),_()(),v(107,"text",110)(108,"tspan",111),E(109,"120"),_()(),v(110,"text",112)(111,"tspan",113),E(112,"150"),_()(),v(113,"text",114)(114,"tspan",115),E(115,"180"),_()(),v(116,"text",116)(117,"tspan",117),E(118,"210"),_()(),v(119,"text",118)(120,"tspan",119),E(121,"240"),_()(),v(122,"text",120)(123,"tspan",121),E(124,"270"),_()(),v(125,"text",122)(126,"tspan",123),E(127,"300"),_()(),v(128,"text",124)(129,"tspan",125),E(130,"330"),_()(),v(131,"g",126),B(132,"path",127)(133,"animateTransform",128,0),_(),v(135,"g",129)(136,"g",130),B(137,"circle",131),v(138,"g",132),B(139,"path",133)(140,"path",134),_()(),B(141,"animateTransform",128,1),_(),B(143,"animateTransform",128,2),_(),v(145,"g",135)(146,"svg",136)(147,"g"),B(148,"path",137),v(149,"text",138),E(150,"A "),_(),v(151,"svg",139)(152,"g")(153,"text",140),E(154),_(),B(155,"animateTransform",128,3),_()(),B(157,"animateTransform",128,4),_()(),v(159,"svg",141)(160,"g"),B(161,"path",142),v(162,"text",143),E(163,"T "),_(),v(164,"svg",144)(165,"g")(166,"text",145),E(167),_(),B(168,"animateTransform",128,5),_()(),B(170,"animateTransform",128,6),_()()(),v(172,"g",146),B(173,"path",147),v(174,"text",148)(175,"tspan",149),E(176),_()()()()),t&2&&(P(16),j("ngIf",i.sailSetupEnable()),P(47),it("display",i.closeHauledLineEnable()?"inline":"none"),P(),j("ngIf",i.trueWindAngle()!=null),P(),j("ngIf",i.trueWindAngle()!=null),P(),it("display",i.windSectorEnable()?"inline":"none"),P(),j("ngIf",i.portWindSectorPath!="none"),P(),j("ngIf",i.stbdWindSectorPath!="none"),P(63),it("display",i.courseOverGroundActive?"inline":"none"),P(2),be("from",i.courseOverGround.oldDegreeIndicator+" 231 231")("to",i.courseOverGround.newDegreeIndicator+" 231 231"),P(2),it("display",i.waypointActive?"inline":"none"),P(6),be("from",i.waypoint.oldDegreeIndicator+" 231 231")("to",i.waypoint.newDegreeIndicator+" 231 231"),P(2),be("from","-"+i.compassFaceplate.oldDegreeIndicator+" 231 231")("to","-"+i.compassFaceplate.newDegreeIndicator+" 231 231"),P(11),at(" ",i.appWindSpeedDisplay," "),P(),be("from",i.appWindValue.oldDegreeIndicator)("to",i.appWindValue.newDegreeIndicator),P(2),be("from",i.appWind.oldDegreeIndicator+" 231 231")("to",i.appWind.newDegreeIndicator+" 231 231"),P(10),at(" ",i.trueWindSpeedDisplay," "),P(),be("from",i.trueWindValue.oldDegreeIndicator)("to",i.trueWindValue.newDegreeIndicator),P(2),be("from",i.trueWind.oldDegreeIndicator+" 231 231")("to",i.trueWind.newDegreeIndicator+" 231 231"),P(6),xt(i.headingValue))},dependencies:[_i],styles:["svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.compass-inner-ring[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color);fill:var(--kip-contrast-color)}.starboard[_ngcontent-%COMP%]{stop-color:var(--kip-starboard-color)}.port[_ngcontent-%COMP%]{stop-color:var(--kip-port-color)}.wind-text[_ngcontent-%COMP%]{fill:var(--kip-widget-card-background-color);stroke:var(--kip-widget-card-background-color)}.heading-background[_ngcontent-%COMP%]{stroke:var(--mat-sys-background);fill:var(--kip-contrast-color)}.boatBackground[_ngcontent-%COMP%]{stop-color:var(--kip-contrast-color)!important}.true-wind[_ngcontent-%COMP%]{fill:var(--kip-yellow-color)}.app-wind[_ngcontent-%COMP%]{fill:var(--kip-blue-color)}.course-over-ground[_ngcontent-%COMP%]{fill:var(--kip-pink-color)}.next-waypoint[_ngcontent-%COMP%]{stroke:var(--kip-green-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)}"]})}return r})();var kh=(()=>{class r extends Ie{zones=M(ut);currentHeading=0;courseOverGroundAngle=0;appWindAngle=0;appWindSpeed=0;trueWindAngle=0;trueWindSpeed=0;waypointAngle=0;trueWindHistoric=[];trueWindMinHistoric;trueWindMidHistoric;trueWindMaxHistoric;windSectorObservableSub=null;constructor(){super(),this.defaultConfig={filterSelfPaths:!0,paths:{headingPath:{description:"Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},courseOverGround:{description:"Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint Bearing",path:"self.navigation.courseGreatCircle.nextPoint.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,sailSetupEnable:!1,enableTimeout:!1,dataTimeout:5}}ngOnInit(){this.validateConfig(),this.startWidget()}startWidget(){this.unsubscribeDataStream(),this.stopWindSectors(),this.observeDataStream("headingPath",e=>{e.data.value==null&&(e.data.value=0),this.currentHeading=e.data.value}),this.observeDataStream("courseOverGround",e=>{e.data.value==null&&(e.data.value=0),this.courseOverGroundAngle=e.data.value}),this.observeDataStream("nextWaypointBearing",e=>{e.data.value<0?this.waypointAngle=360+e.data.value:this.waypointAngle=e.data.value}),this.observeDataStream("appWindAngle",e=>{e.data.value==null&&(e.data.value=0),e.data.value<0?this.appWindAngle=360+e.data.value:this.appWindAngle=e.data.value}),this.observeDataStream("appWindSpeed",e=>{e.data.value==null&&(e.data.value=0),this.appWindSpeed=e.data.value}),this.observeDataStream("trueWindSpeed",e=>{e.data.value==null&&(e.data.value=0),this.trueWindSpeed=e.data.value}),this.observeDataStream("trueWindAngle",e=>{e.data.value==null&&(e.data.value=0),this.widgetProperties.config.paths.trueWindAngle.path.match("angleTrueWater")||this.widgetProperties.config.paths.trueWindAngle.path.match("angleTrueGround")?this.trueWindAngle=this.addHeading(this.currentHeading,e.data.value):this.widgetProperties.config.paths.trueWindAngle.path.match("direction")?this.trueWindAngle=e.data.value:this.trueWindAngle=e.data.value,this.widgetProperties.config.windSectorEnable&&this.addHistoricalTrue(this.trueWindAngle)}),this.startWindSectors()}updateConfig(e){this.widgetProperties.config=e,this.startWidget()}ngOnDestroy(){this.destroyDataStreams(),this.stopWindSectors()}startWindSectors(){this.zones.runOutsideAngular(()=>{this.windSectorObservableSub=ol(500).subscribe(e=>{this.historicalCleanup()})})}addHistoricalTrue(e){this.trueWindHistoric.push({timestamp:Date.now(),heading:e});let t=this.arcForAngles(this.trueWindHistoric.map(i=>i.heading));this.trueWindMinHistoric=t[0],this.trueWindMaxHistoric=t[1],this.trueWindMidHistoric=t[2]}arcForAngles(e){return e.slice(1).reduce((t,i)=>{let o=i;for(;o<t[0]-180;)o+=360;for(;o>t[1]+180;)o-=360;return t[0]=Math.min(t[0],o),t[1]=Math.max(t[1],o),t[2]=(t[1]-t[0])/2+t[0],t},[e[0],e[0]])}historicalCleanup(){let e=Date.now()-this.widgetProperties.config.windSectorWindowSeconds*1e3;for(let t=this.trueWindHistoric.length-1;t>=0;--t)this.trueWindHistoric[t].timestamp<e&&this.trueWindHistoric.splice(t,1)}stopWindSectors(){this.windSectorObservableSub?.unsubscribe()}addHeading(e,t){let i=e+t;for(;i>359;)i=i-359;for(;i<0;)i=i+359;return i}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-wind-steer"]],features:[fe],decls:2,vars:18,consts:[[3,"configChange","config","id"],[3,"compassHeading","courseOverGroundAngle","courseOverGroundEnable","trueWindAngle","trueWindSpeed","appWindAngle","appWindSpeed","laylineAngle","closeHauledLineEnable","windSectorEnable","waypointAngle","waypointEnable","trueWindMinHistoric","trueWindMidHistoric","trueWindMaxHistoric","sailSetupEnable"]],template:function(t,i){t&1&&(v(0,"widget-host",0),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),B(1,"app-svg-wind",1),_()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("compassHeading",i.currentHeading)("courseOverGroundAngle",i.courseOverGroundAngle)("courseOverGroundEnable",i.widgetProperties.config.courseOverGroundEnable)("trueWindAngle",i.trueWindAngle)("trueWindSpeed",i.trueWindSpeed)("appWindAngle",i.appWindAngle)("appWindSpeed",i.appWindSpeed)("laylineAngle",i.widgetProperties.config.laylineAngle)("closeHauledLineEnable",i.widgetProperties.config.laylineEnable)("windSectorEnable",i.widgetProperties.config.windSectorEnable)("waypointAngle",i.waypointAngle)("waypointEnable",i.widgetProperties.config.waypointEnable)("trueWindMinHistoric",i.trueWindMinHistoric)("trueWindMidHistoric",i.trueWindMidHistoric)("trueWindMaxHistoric",i.trueWindMaxHistoric)("sailSetupEnable",i.defaultConfig.sailSetupEnable))},dependencies:[wh,Re],encapsulation:2})}return r})();var Ff=["canvasEl"],Sh=(()=>{class r extends Ie{canvasEl=de("canvasEl");canvas=M(Tt);canvasCtx=null;isDestroyed=!1;maxTextWidth=0;maxTextHeight=0;constructor(){super(),this.defaultConfig={displayName:"Static Label",color:"green",bgColor:"grey",noColor:!1,noBgColor:!0},Fe(()=>{this.theme()&&(this.getColors(this.widgetProperties.config.color),this.updateCanvas())})}ngOnInit(){this.validateConfig()}ngAfterViewInit(){this.canvas.setHighDPISize(this.canvasEl().nativeElement,this.canvasEl().nativeElement.parentElement.getBoundingClientRect()),this.canvasCtx=this.canvasEl().nativeElement.getContext("2d"),this.maxTextWidth=Math.floor(this.canvasEl().nativeElement.width-40),this.maxTextHeight=Math.floor(this.canvasEl().nativeElement.height-40),document.fonts.ready.then(()=>{this.isDestroyed||this.updateCanvas()})}ngOnDestroy(){this.isDestroyed=!0,this.canvas.clearCanvas(this.canvasCtx,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height),this.canvasEl().nativeElement.remove()}startWidget(){}updateConfig(e){e.displayName?this.widgetProperties.config.displayName=e.displayName:this.widgetProperties.config.displayName="",this.updateCanvas()}onResized(e){this.canvas.setHighDPISize(this.canvasEl().nativeElement,e.contentRect),this.maxTextWidth=Math.floor(this.canvasEl().nativeElement.width-40),this.maxTextHeight=Math.floor(this.canvasEl().nativeElement.height-40),document.fonts.ready.then(()=>{this.updateCanvas()})}getColors(e){switch(e){case"contrast":return this.theme().contrast;case"blue":return this.theme().blue;case"green":return this.theme().green;case"pink":return this.theme().pink;case"orange":return this.theme().orange;case"purple":return this.theme().purple;case"grey":return this.theme().grey;case"yellow":return this.theme().yellow;default:return this.theme().contrast}}updateCanvas(){this.canvasCtx&&(this.canvas.clearCanvas(this.canvasCtx,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height),this.widgetProperties.config.noBgColor||this.canvas.drawRectangle(this.canvasCtx,0,0,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height,this.getColors(this.widgetProperties.config.bgColor)),this.drawValue())}drawValue(){this.canvas.drawText(this.canvasCtx,this.widgetProperties.config.displayName,Math.floor(this.canvasEl().nativeElement.width/2),Math.floor(this.canvasEl().nativeElement.height/2+10),this.maxTextWidth,this.maxTextHeight,"bold",this.getColors(this.widgetProperties.config.color))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-label"]],viewQuery:function(t,i){t&1&&ce(i.canvasEl,Ff,5),t&2&&Xe()},features:[fe],decls:4,vars:2,consts:[["canvasEl",""],[3,"configChange","config","id"],[1,"wrapper",3,"onResize"],[1,"canvas",2,"z-index","inherit"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(1,"div",2),F("onResize",function(l){return V(o),L(i.onResized(l))}),B(2,"canvas",3,0),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid))},dependencies:[Re,tt,et],styles:[".wrapper[_ngcontent-%COMP%]{position:relative;display:block;width:100%;height:100%}.canvas[_ngcontent-%COMP%]{display:block;position:absolute;top:0;left:0;z-index:inherit;border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium))}"]})}return r})();var Hf=["svgSlider"];function Gf(r,n){r&1&&B(0,"div",11)}var Ch=(()=>{class r extends Ie{svgElement=de.required("svgSlider");canvas=M(Tt);dashboard=M(lt);signalkRequestsService=M(Fi);appService=M(ii);labelColor=void 0;barColor=void 0;skRequestSub=new rn;lineStartPx;lineWidthPx;lineEndPx;resizeTimeout;debounceTimeout;handlePosition=20;pathValue=0;lineStart=this.handlePosition;isDragStarted=!1;lineWidth="0px";VIEWBOX_WIDTH=200;LINE_START=20;LINE_WIDTH=160;colorMap=new Map([["contrast",{label:this.theme().contrastDim,bar:this.theme().contrast}],["blue",{label:this.theme().blueDim,bar:this.theme().blue}],["green",{label:this.theme().greenDim,bar:this.theme().green}],["pink",{label:this.theme().pinkDim,bar:this.theme().pink}],["orange",{label:this.theme().orangeDim,bar:this.theme().orange}],["purple",{label:this.theme().purpleDim,bar:this.theme().purple}],["grey",{label:this.theme().greyDim,bar:this.theme().grey}],["yellow",{label:this.theme().yellowDim,bar:this.theme().yellow}]]);valueChange$=new bt;constructor(){super(),this.defaultConfig={displayName:"Slider Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric PUT path",path:null,source:null,pathType:"number",isPathConfigurable:!0,convertUnitTo:"unitless",showPathSkUnitsFilter:!1,pathSkUnitsFilter:"unitless",supportsPut:!0,sampleTime:500}},displayScale:{lower:0,upper:1,type:"linear"},enableTimeout:!1,dataTimeout:5,color:"contrast"},Fe(()=>{this.theme()&&this.getColors(this.widgetProperties.config.color)})}ngOnInit(){this.validateConfig(),this.valueChange$.pipe(Ht(e=>this.isWithinMargin(e,this.widgetProperties.config.displayScale.lower)?this.widgetProperties.config.displayScale.lower:this.isWithinMargin(e,this.widgetProperties.config.displayScale.upper)?this.widgetProperties.config.displayScale.upper:parseFloat(e.toFixed(2))),Xr(200),sl()).subscribe(e=>{this.sendValue(e)})}ngAfterViewInit(){this.startWidget()}startWidget(){this.unsubscribeDataStream(),this.observeDataStream("gaugePath",e=>{if(!e||!e.data){this.handlePosition=this.mapValueToPosition(this.widgetProperties.config.displayScale.lower);return}this.updateHandlePosition(this.mapValueToPosition(e.data.value))}),this.skRequestSub?.unsubscribe(),this.subscribeSKRequest()}mapValueToPosition(e){let t=this.widgetProperties.config.displayScale.upper-this.widgetProperties.config.displayScale.lower,i=this.LINE_WIDTH;return(e-this.widgetProperties.config.displayScale.lower)/t*i+this.LINE_START}mapPositionToValue(e){let t=this.widgetProperties.config.displayScale.upper-this.widgetProperties.config.displayScale.lower,i=this.LINE_WIDTH;return(e-this.LINE_START)/i*t+this.widgetProperties.config.displayScale.lower}isWithinMargin(e,t){let i=(this.widgetProperties.config.displayScale.upper-this.widgetProperties.config.displayScale.lower)*.01;return Math.abs(e-t)<=i}subscribeSKRequest(){this.skRequestSub=this.signalkRequestsService.subscribeRequest().subscribe(e=>{if(e.widgetUUID==this.widgetProperties.uuid){let t=`Toggle Widget ${this.widgetProperties.config.displayName}: `;e.statusCode!=200&&(e.message?t+=e.message:t+=e.statusCode+" - "+e.statusCodeDescription,this.appService.sendSnackbarNotification(t,0))}})}sendValue(e){let t=this.widgetProperties.config.paths.gaugePath.path;this.signalkRequestsService.putRequest(t,e,this.widgetProperties.uuid)}updateConfig(e){this.widgetProperties.config=e,this.getColors(this.widgetProperties.config.color),this.calculateLineBounds(),this.startWidget()}onResized(e){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.calculateLineBounds()},200)}calculateLineBounds(){if(!this.svgElement()?.nativeElement){console.warn("[Slider Widget] SVG element is not initialized yet.");return}let e=this.svgElement().nativeElement.getBoundingClientRect(),t=this.LINE_START/this.VIEWBOX_WIDTH*e.width,i=this.LINE_WIDTH/this.VIEWBOX_WIDTH*e.width;this.lineStartPx=t,this.lineWidthPx=i,this.lineEndPx=this.lineStartPx+this.lineWidthPx}updateHandlePosition(e){this.handlePosition=e,this.lineWidth=`${e-this.lineStart}px`}getPointerX(e){return e.clientX-this.svgElement().nativeElement.getBoundingClientRect().left}onPointerDown(e){this.isDragStarted=!0,this.onPointerMove(e),e.stopPropagation(),e.preventDefault()}onPointerMove(e){if(this.isDragStarted){let t=this.getPointerX(e);if(t>=this.lineStartPx&&t<=this.lineEndPx){let i=(t-this.lineStartPx)/this.lineWidthPx*this.LINE_WIDTH+this.LINE_START;this.updateHandlePosition(i),this.handlePosition<=this.LINE_START?this.pathValue=this.widgetProperties.config.displayScale.lower:this.handlePosition>=this.LINE_START+this.LINE_WIDTH?this.pathValue=this.widgetProperties.config.displayScale.upper:this.pathValue=this.mapPositionToValue(this.handlePosition),this.valueChange$.next(this.pathValue)}}}onPointerUp(e){this.isDragStarted=!1,this.valueChange$.next(this.pathValue)}onPointerLeave(e){this.isDragStarted&&(this.isDragStarted=!1,this.valueChange$.next(this.pathValue))}getColors(e){let t=this.colorMap.get(e)||this.colorMap.get("contrast");this.labelColor=t.label,this.barColor=t.bar}ngOnDestroy(){this.destroyDataStreams(),this.skRequestSub?.unsubscribe(),this.valueChange$.complete(),clearTimeout(this.debounceTimeout),clearTimeout(this.resizeTimeout)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-slider"]],viewQuery:function(t,i){t&1&&ce(i.svgElement,Hf,5),t&2&&Xe()},features:[fe],decls:12,vars:9,consts:[["svgSlider",""],[3,"configChange","config","id"],[3,"text","color"],[1,"widgets-container",3,"onResize"],["width","100%","height","100%","viewBox","0 40 200 40"],["width","160","height","8","rx","4.5","id","rect3","x","20","y","56",1,"slider-bg-bar",2,"display","inline","stroke-width","1.57144"],["height","8","rx","4.5","id","rect3","x","20","y","56",2,"display","inline","stroke-width","1.57144"],["id","g22"],["cy","60","fill","#ffffff","id","circle3","r","19.549999",2,"display","inline","fill","#4d4d4d","fill-opacity","1","stroke","#8c8c8c","stroke-width","0.9","stroke-dasharray","none","stroke-opacity","1"],["cy","60","fill","#ffffff","id","circle3-3","r","17.950001",2,"display","inline","fill","#ffffff","fill-opacity","1","stroke","#e6e6e6","stroke-width","1.8","stroke-dasharray","none","stroke-opacity","0.97"],["cursor","pointer","width","200","height","40","x","0","y","40",2,"display","inline","fill","rgba(0, 0, 0, 0)","stroke","none","stroke-width","0.3","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0",3,"pointerdown","pointerup","pointermove","pointerleave"],[1,"widgetOverlay"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),B(1,"widget-title",2),v(2,"div",3),F("onResize",function(l){return V(o),L(i.onResized(l))}),dt(),v(3,"svg",4),B(4,"rect",5)(5,"rect",6),v(6,"g",7),B(7,"circle",8)(8,"circle",9),_(),v(9,"rect",10,0),F("pointerdown",function(l){return V(o),L(i.onPointerDown(l))})("pointerup",function(l){return V(o),L(i.onPointerUp(l))})("pointermove",function(l){return V(o),L(i.onPointerMove(l))})("pointerleave",function(l){return V(o),L(i.onPointerLeave(l))}),_()()(),ke(11,Gf,1,0,"div",11),_()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("text",i.widgetProperties.config.displayName)("color",i.labelColor),P(4),be("width",i.lineWidth)("fill",i.barColor),P(2),be("cx",i.handlePosition),P(),be("cx",i.handlePosition),P(3),Ge(i.dashboard.isDashboardStatic()?-1:11))},dependencies:[Re,tt,et,si],styles:[".widgets-container[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 20px}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent;z-index:21}.slider-bg-bar[_ngcontent-%COMP%]{fill:var(--mat-sys-inverse-on-surface)}"]})}return r})();var jf=["grid"];function Uf(r,n){if(r&1){let e=ee();v(0,"div",2)(1,"button",3),F("click",function(){V(e);let i=se();return L(i.saveLayoutChanges())}),v(2,"mat-icon"),E(3,"done"),_()(),v(4,"button",4),F("click",function(){V(e);let i=se();return L(i.cancelLayoutChanges())}),v(5,"mat-icon"),E(6,"close"),_()()()}}function qf(r,n){r&1&&B(0,"notification-badge")}function Yf(r,n){if(r&1&&(B(0,"dashboard-scroller",5),ke(1,qf,1,0,"notification-badge")),r&2){let e=se();j("activePage",e.dashboard.activeDashboard())("dashboards",e.dashboard.dashboards()),P(),Ge(e.notificationsInfo().alarmCount>0?1:-1)}}var vs=(()=>{class r{_app=M(ii);_dialog=M(Qn);dashboard=M(lt);_notifications=M(Yi);_destroyRef=M(cl);_uiEvent=M(Xn);notificationsInfo=Wt(this._notifications.observerNotificationsInfo());isDashboardStatic=Wt(this.dashboard.isDashboardStatic$);_gridstack;_previousIsStaticState=!0;gridOptions={margin:4,minRow:12,maxRow:12,float:!0,acceptWidgets:!1,resizable:{handles:"all"}};constructor(){un.addComponentToSelectorType([ec,Jd,tc,oc,bh,ch,uh,sh,ph,ih,lc,eh,vh,fh,_h,kh,gh,Sh,Ch]),Fe(()=>{this.loadDashboard(this.dashboard.activeDashboard())})}ngAfterViewInit(){this.dashboard.isDashboardStatic$.pipe(Na(this._destroyRef)).subscribe(e=>{e?(this._gridstack.grid.setStatic(e),e!==this._previousIsStaticState&&(this.saveDashboard(),this._previousIsStaticState=e)):(this._gridstack.grid.setStatic(e),this._previousIsStaticState=e)}),this.dashboard.widgetAction$.pipe(Na(this._destroyRef)).subscribe(e=>{e&&this._gridstack.grid.getGridItems().forEach(t=>{if(t.gridstackNode.id===e.id)switch(e.operation){case"delete":this.deleteWidget(t);break;case"duplicate":this.duplicateWidget(t);break;default:break}})}),this.resizeGridColumns(),this._uiEvent.addHotkeyListener((e,t)=>this.handleKeyDown(e,t),{ctrlKey:!0,keys:["arrowdown","arrowup"]}),setTimeout(()=>{this.loadDashboard(this.dashboard.activeDashboard())})}ngOnDestroy(){this._gridstack?.grid&&this._gridstack.grid.destroy(!0),this._gridstack=null,this._uiEvent.removeHotkeyListener(this.handleKeyDown.bind(this))}handleKeyDown(e,t){e==="arrowdown"?this.previousDashboard(t):e==="arrowup"&&this.nextDashboard(t)}resizeGridColumns(){this._gridstack.grid.cellHeight(window.innerHeight/this._gridstack.grid.getRow())}loadDashboard(e){let t=this.dashboard.dashboards()[e];this._gridstack.grid?.load(t.configuration)}saveDashboard(){let e=this._gridstack.grid.save(!1,!1)||null;this.dashboard.updateConfiguration(this.dashboard.activeDashboard(),e)}saveLayoutChanges(){this.dashboard.setStaticDashboard(!0)}cancelLayoutChanges(){this.loadDashboard(this.dashboard.activeDashboard()),this.dashboard.setStaticDashboard(!0)}addNewWidget(e){if(!this.dashboard.isDashboardStatic()){let t=e.center.x,i=e.center.y,o=this._gridstack.grid.getCellFromPixel({left:t,top:i});this._gridstack.grid.isAreaEmpty(o.x,o.y,1,1)&&(this._gridstack.grid.willItFit({x:o.x,y:o.y,w:2,h:3})?this._dialog.openFrameDialog({title:"Add Widget",component:"select-widget"},!0).subscribe(l=>{if(!l)return;let d=Vn.create(),f={x:o.x,y:o.y,w:2,h:3,id:d,selector:l,input:{widgetProperties:{type:l,uuid:d}}};this._gridstack.grid.addWidget(f)}):this._app.sendSnackbarNotification("Add Widget Error: Not enough space at the selected location. Please reorganize the dashboard to free up space or choose a larger empty area.",0))}}duplicateWidget(e){let t=Vn.create(),i=e.gridstackNode,o={w:i.w,h:i.h,id:t,selector:i.selector,input:{widgetProperties:{type:i.input.widgetProperties.type,uuid:t,config:Fn(i.input.widgetProperties.config)}}};this._gridstack.grid.willItFit(o)?this._gridstack.grid.addWidget(o):(o.h=2,o.w=2,this._gridstack.grid.willItFit(o)?this._gridstack.grid.addWidget(o):this._app.sendSnackbarNotification("Duplication failed: Insufficient space on the dashboard. Please reorganize to free up space.",0))}deleteWidget(e){this._gridstack.grid.removeWidget(e)}nextDashboard(e){e.preventDefault(),this.dashboard.isDashboardStatic()&&this.dashboard.nextDashboard()}previousDashboard(e){e.preventDefault(),this.dashboard.isDashboardStatic()&&this.dashboard.previousDashboard()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["dashboard"]],viewQuery:function(t,i){if(t&1&&Je(jf,7),t&2){let o;je(o=Ue())&&(i._gridstack=o.first)}},decls:4,vars:2,consts:[["grid",""],[3,"swipeup","swipedown","press","resize","options"],[1,"edit-layout-close-icon"],["mat-fab","",1,"layout-action-btn",2,"margin-right","10px",3,"click"],["mat-fab","",1,"layout-action-btn",3,"click"],[3,"activePage","dashboards"]],template:function(t,i){if(t&1){let o=ee();v(0,"gridstack",1,0),F("swipeup",function(l){return V(o),L(i.previousDashboard(l))})("swipedown",function(l){return V(o),L(i.nextDashboard(l))})("press",function(l){return V(o),L(i.addNewWidget(l))})("resize",function(){return V(o),L(i.resizeGridColumns())},!1,pl),_(),ke(2,Uf,7,0,"div",2)(3,Yf,2,3)}t&2&&(j("options",i.gridOptions),P(2),Ge(i.dashboard.isDashboardStatic()?3:2))},dependencies:[Ud,un,Yd,Bt,ki,hi,so,Kd],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;height:100%;width:100%}.grid-stack[_ngcontent-%COMP%]{width:100%}.edit-layout-close-icon[_ngcontent-%COMP%]{position:absolute;bottom:20px;right:20px;cursor:pointer;z-index:100}.layout-action-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary);background-color:var(--mat-sys-primary)}"]})}return r})();var xh=[{path:"dashboard",component:vs},{path:"settings",loadComponent:()=>import("./chunk-J7GRTP4C.js").then(r=>r.AppSettingsComponent)},{path:"help",loadComponent:()=>import("./chunk-LMRTNYJV.js").then(r=>r.AppHelpComponent)},{path:"data",loadComponent:()=>import("./chunk-RNM4H3MR.js").then(r=>r.DataInspectorComponent)},{path:"dashboards",loadComponent:()=>import("./chunk-VN4MZHZZ.js").then(r=>r.DashboardsEditorComponent)},{path:"datasets",loadComponent:()=>import("./chunk-AGPPRVTP.js").then(r=>r.SettingsDatasetsComponent)},{path:"configurations",loadComponent:()=>import("./chunk-HOX4MDFB.js").then(r=>r.SettingsConfigComponent)},{path:"login",loadComponent:()=>import("./chunk-COOW4B4W.js").then(r=>r.WidgetLoginComponent)},{path:"**",component:vs}];var Th={production:!0};var Rh=wr(Qa());function Qf(r,n){if(r&1){let e=ee();v(0,"div",1)(1,"button",2),F("click",function(){V(e);let i=se();return L(i.action())}),E(2),_()()}if(r&2){let e=se();P(2),at(" ",e.data.action," ")}}var Xf=["label"];function Kf(r,n){}var $f=Math.pow(2,31)-1,Ir=class{_overlayRef;instance;containerInstance;_afterDismissed=new bt;_afterOpened=new bt;_onAction=new bt;_durationTimeoutId;_dismissedByAction=!1;constructor(n,e){this._overlayRef=e,this.containerInstance=n,n._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(n){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(n,$f))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},Eh=new Rn("MatSnackBarData"),ur=class{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},Zf=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275dir=bi({type:r,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return r})(),Jf=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275dir=bi({type:r,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return r})(),eg=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275dir=bi({type:r,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return r})(),tg=(()=>{class r{snackBarRef=M(Ir);data=M(Eh);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(t,i){t&1&&(v(0,"div",0),E(1),_(),ke(2,Qf,3,1,"div",1)),t&2&&(P(),at(" ",i.data.message,`
229
+ `,e.body.appendChild(t)}updateConfig(e){this.widgetUrl=this.resolveUrl(e.widgetUrl)}isValidProtocol(e){try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return console.warn("[Embed Widget] isValidUrl: Invalid URL:",e),!1}}resolveUrl(e){if(!e)return null;try{let t=new URL(e,window.location.origin);return this.isValidProtocol(t.href)?this._sanitizer.bypassSecurityTrustResourceUrl(t.href):null}catch{return console.warn("[Embed Widget] Invalid URL:",e),null}}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-iframe"]],viewQuery:function(t,i){if(t&1&&Je(bf,5),t&2){let o;je(o=Ue())&&(i.iframe=o.first)}},features:[fe],decls:4,vars:5,consts:[["plainIframe",""],[3,"configChange","config","id"],["width","100%","height","100%","frameborder","0",1,"widgetIframe",3,"src"],[2,"padding","15px"],[1,"widgetOverlay"]],template:function(t,i){t&1&&(v(0,"widget-host",1),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),ke(1,_f,2,1,"iframe",2)(2,wf,7,0,"div",3),B(3,"div",4),_()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),Ge(i.widgetUrl?1:2),P(2),it("display",i.displayTransparentOverlay()))},dependencies:[Re],styles:[".widgetIframe[_ngcontent-%COMP%]{background-color:#fff}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent}"]})}return r})();var kf=["canvasValue"],gh=(()=>{class r extends Ie{canvasValue=de.required("canvasValue");canvas=M(Tt);latPos="";longPos="";labelColor=void 0;valueColor=void 0;maxTextWidth=0;maxTextHeight=0;middle=0;center=0;fontSizeOffset=0;canvasValCtx;isDestroyed=!1;constructor(){super(),this.defaultConfig={displayName:"Position",filterSelfPaths:!0,paths:{longPath:{description:"Longitude",path:"self.navigation.position.longitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"longitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500},latPath:{description:"Latitude",path:"self.navigation.position.latitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"latitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},color:"contrast",enableTimeout:!1,dataTimeout:5},Fe(()=>{this.theme()&&(this.getColors(this.widgetProperties.config.color),this.drawValue())})}ngOnInit(){this.validateConfig()}ngAfterViewInit(){this.canvas.setHighDPISize(this.canvasValue().nativeElement,this.canvasValue().nativeElement.parentElement.getBoundingClientRect()),this.maxTextHeight=Math.floor(this.canvasValue().nativeElement.height*.6/2),this.maxTextWidth=Math.floor(this.canvasValue().nativeElement.width*.85),this.canvasValCtx=this.canvasValue().nativeElement.getContext("2d"),this.calculateFontSizeAndPositions(),document.fonts.ready.then(()=>{this.isDestroyed||this.startWidget()})}startWidget(){this.unsubscribeDataStream(),this.observeDataStream("longPath",e=>{this.longPos=e.data.value?e.data.value.toString():"",this.drawValue()}),this.observeDataStream("latPath",e=>{this.latPos=e.data.value?e.data.value.toString():"",this.drawValue()})}ngOnDestroy(){this.isDestroyed=!0,this.unsubscribeDataStream(),this.canvas.clearCanvas(this.canvasValCtx,this.canvasValue().nativeElement.width,this.canvasValue().nativeElement.height),this.canvasValue().nativeElement.remove()}updateConfig(e){this.widgetProperties.config=e,this.getColors(this.widgetProperties.config.color),this.startWidget()}onResized(e){e.contentRect.height<25||e.contentRect.width<25||(this.canvas.setHighDPISize(this.canvasValue().nativeElement,this.canvasValue().nativeElement.parentElement.getBoundingClientRect()),this.maxTextHeight=Math.floor(this.canvasValue().nativeElement.height*.6/2),this.maxTextWidth=Math.floor(this.canvasValue().nativeElement.width*.85),this.calculateFontSizeAndPositions(),this.drawValue())}getColors(e){switch(e){case"white":this.labelColor=this.theme().contrastDim,this.valueColor=this.theme().contrast;break;case"blue":this.labelColor=this.theme().blueDim,this.valueColor=this.theme().blue;break;case"green":this.labelColor=this.theme().greenDim,this.valueColor=this.theme().green;break;case"pink":this.labelColor=this.theme().pinkDim,this.valueColor=this.theme().pink;break;case"orange":this.labelColor=this.theme().orangeDim,this.valueColor=this.theme().orange;break;case"purple":this.labelColor=this.theme().purpleDim,this.valueColor=this.theme().purple;break;case"grey":this.labelColor=this.theme().greyDim,this.valueColor=this.theme().grey;break;case"yellow":this.labelColor=this.theme().yellowDim,this.valueColor=this.theme().yellow;break;default:this.labelColor=this.theme().contrastDim,this.valueColor=this.theme().contrast;break}}calculateFontSizeAndPositions(){this.center=this.canvasValue().nativeElement.width/2,this.middle=this.canvasValue().nativeElement.height*.57;let e=this.latPos.length>this.longPos.length?this.latPos:this.longPos,t=this.canvas.calculateOptimalFontSize(this.canvasValCtx,e,this.maxTextWidth,this.maxTextHeight,"bold");this.fontSizeOffset=Math.floor(t*5e-4)}drawValue(){this.canvasValCtx&&(this.canvas.clearCanvas(this.canvasValCtx,this.canvasValue().nativeElement.width,this.canvasValue().nativeElement.height),this.canvas.drawText(this.canvasValCtx,this.latPos,this.center,this.middle-this.fontSizeOffset,this.maxTextWidth,this.maxTextHeight,"bold",this.valueColor,"center","bottom"),this.canvas.drawText(this.canvasValCtx,this.longPos,this.center,this.middle+this.fontSizeOffset,this.maxTextWidth,this.maxTextHeight,"bold",this.valueColor,"center","top"))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-position"]],viewQuery:function(t,i){t&1&&ce(i.canvasValue,kf,5),t&2&&Xe()},features:[fe],decls:5,vars:4,consts:[["canvasValue",""],[3,"configChange","config","id"],[3,"text","color"],[1,"textGenericWrapper",3,"onResize"],[1,"canvas"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),B(1,"widget-title",2),v(2,"div",3),F("onResize",function(l){return V(o),L(i.onResized(l))}),B(3,"canvas",4,0),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("text",i.widgetProperties.config.displayName)("color",i.labelColor))},dependencies:[Re,tt,et,si],styles:[".textGenericWrapper[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}.canvas[_ngcontent-%COMP%]{position:absolute;top:0;left:0;z-index:inherit}"]})}return r})();var Fo=(()=>{class r{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new Ni(t),timeoutID:null,intervalMS:i},this.kipTimers[e].currentValue.asObservable())}startTimer(e){this.kipTimers.hasOwnProperty(e)&&this.kipTimers[e].timeoutID===null&&(this.kipTimers[e].timeoutID=setInterval(()=>{this.kipTimers[e].currentValue.next(this.kipTimers[e].currentValue.value+1)},this.kipTimers[e].intervalMS))}stopTimer(e){this.kipTimers.hasOwnProperty(e)&&this.kipTimers[e].timeoutID!==null&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null)}setTimer(e,t){this.kipTimers.hasOwnProperty(e)&&this.kipTimers[e].currentValue.next(t)}deleteTimer(e){this.kipTimers.hasOwnProperty(e)&&(this.stopTimer(e),this.kipTimers[e].currentValue.complete(),delete this.kipTimers[e])}isRunning(e){let t=!1;return e in this.kipTimers&&(t=this.kipTimers[e].timeoutID!==null),t}static \u0275fac=function(t){return new(t||r)};static \u0275prov=ot({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var Sf=["canvasEl"];function Cf(r,n){if(r&1){let e=ee();v(0,"button",12),F("click",function(){V(e);let i=se();return L(i.startTimer())}),E(1," Start "),_()}}function xf(r,n){if(r&1){let e=ee();v(0,"button",13),F("click",function(){V(e);let i=se();return L(i.pauseTimer())}),E(1," Pause "),_()}}var vh=(()=>{class r extends Ie{TimersService=M(Fo);canvas=M(Tt);canvasEl=de("canvasEl");dataValue=null;zoneState=null;currentValueLength=0;valueFontSize=1;flashOn=!1;flashInterval=null;timerRunning=!1;timeName="race";warnColor=null;warmContrast=null;textColor=null;timerSub=null;canvasCtx=null;constructor(){super(),this.defaultConfig={timerLength:300,color:"contrast"},Fe(()=>{this.theme()&&(this.getColors(this.widgetProperties.config.color),this.updateCanvas())})}ngOnInit(){this.validateConfig(),this.subscribeTimer(),this.startWidget()}startWidget(){this.getColors(this.widgetProperties.config.color),this.canvasCtx=this.canvasEl().nativeElement.getContext("2d")}updateConfig(e){this.widgetProperties.config=e,this.startWidget(),this.updateCanvas()}onResized(e){e.contentRect.height<50||e.contentRect.width<50||(this.canvasEl().nativeElement.width!=Math.floor(e.contentRect.width)||this.canvasEl().nativeElement.height!=Math.floor(e.contentRect.height))&&(this.canvasEl().nativeElement.width=Math.floor(e.contentRect.width),this.canvasEl().nativeElement.height=Math.floor(e.contentRect.height/2),this.currentValueLength=0,this.updateCanvas())}subscribeTimer(){this.timerRunning=this.TimersService.isRunning(this.timeName);let e=this.widgetProperties.config.timerLength*-1*10;this.timerSub=this.TimersService.createTimer(this.timeName,-3e3,100).subscribe(t=>{this.dataValue=t,t>0?this.zoneState=te.Normal:t>-100?this.zoneState=te.Alarm:t>-300?this.zoneState=te.Warn:this.zoneState=te.Normal,this.zoneState==te.Alarm&&!this.flashInterval?this.flashInterval=setInterval(()=>{this.flashOn=!this.flashOn,this.updateCanvas()},500):this.zoneState!=te.Alarm&&clearInterval(this.flashInterval),this.updateCanvas()})}startTimer(){this.TimersService.startTimer(this.timeName),this.timerRunning=!0}resetTimer(){this.unsubscribeTimer(),this.TimersService.deleteTimer(this.timeName),this.timerRunning=!1,this.subscribeTimer()}pauseTimer(){this.TimersService.stopTimer(this.timeName),this.timerRunning=!1}roundToMin(){let e=this.dataValue;this.dataValue<0&&(e=e*-1);let t=e%600;this.dataValue>0?t>300?this.TimersService.setTimer(this.timeName,this.dataValue+(600-t)):this.TimersService.setTimer(this.timeName,this.dataValue-t):t>300?this.TimersService.setTimer(this.timeName,this.dataValue-(600-t)):this.TimersService.setTimer(this.timeName,this.dataValue+t)}addOneMin(){this.TimersService.setTimer(this.timeName,this.dataValue+600)}remOneMin(){this.TimersService.setTimer(this.timeName,this.dataValue-600)}getColors(e){switch(e){case"contrast":this.textColor=this.theme().contrast,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"blue":this.textColor=this.theme().blue,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"green":this.textColor=this.theme().green,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"pink":this.textColor=this.theme().pink,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"orange":this.textColor=this.theme().orange,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"purple":this.textColor=this.theme().purple,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"grey":this.textColor=this.theme().grey,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;case"yellow":this.textColor=this.theme().yellow,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break;default:this.textColor=this.theme().contrast,this.warnColor=this.theme().zoneAlarm,this.warmContrast=this.theme().zoneAlarm;break}}unsubscribeTimer(){this.timerSub?.unsubscribe()}ngOnDestroy(){this.timerSub?.unsubscribe(),this.canvasCtx&&this.canvas.clearCanvas(this.canvasCtx,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height),clearInterval(this.flashInterval),this.destroyDataStreams()}updateCanvas(){this.canvasCtx&&(this.canvas.clearCanvas(this.canvasCtx,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height),this.drawValue())}drawValue(){let e=this.canvasEl().nativeElement,t=Math.floor(e.width*.95),i=Math.floor(e.height),o;if(this.dataValue!=null){let a=Math.abs(this.dataValue),l=Math.floor(a/600),d=Math.floor(a%600/10),f=Math.floor(a%10);o=`${l}:${("0"+d).slice(-2)}.${f}`,this.dataValue<0&&(o=`-${o}`)}else o="--";switch(this.currentValueLength!==o.length&&(this.currentValueLength=o.length,this.valueFontSize=this.canvas.calculateOptimalFontSize(this.canvasCtx,o,t,i,"bold")),this.zoneState){case te.Alarm:this.flashOn?this.canvasCtx.fillStyle=this.textColor:(this.canvas.drawRectangle(this.canvasCtx,0,0,e.width,e.height,this.warnColor),this.canvasCtx.fillStyle=this.textColor);break;case te.Warn:this.canvasCtx.fillStyle=this.warnColor;break;default:this.canvasCtx.fillStyle=this.textColor}this.canvas.drawText(this.canvasCtx,o,e.width/2,e.height/2,t,i,"bold",this.canvasCtx.fillStyle,"center","middle")}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-racetimer"]],viewQuery:function(t,i){t&1&&ce(i.canvasEl,Sf,5),t&2&&Xe()},features:[fe],decls:17,vars:4,consts:[["canvasEl",""],[3,"configChange","config","id"],[1,"raceWrapper",3,"onResize"],["id","canvasValue",1,"canvas-size"],[1,"timerBarContainer"],[1,"timer-button-groups","timer-adjusters-group"],["mat-flat-button","",1,"timer-adjust-buttons",3,"click"],["mat-flat-button","",1,"timer-reset-button",3,"click"],[1,"timer-button-groups","timer-countdown-group"],["mat-flat-button","","class","timer-start-button button-color-red",3,"click",4,"ngIf"],["mat-flat-button","","class","timer-start-button",3,"click",4,"ngIf"],["mat-flat-button","",1,"timer-synch-button","button-color-red",3,"click"],["mat-flat-button","",1,"timer-start-button","button-color-red",3,"click"],["mat-flat-button","",1,"timer-start-button",3,"click"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(1,"div",2),F("onResize",function(l){return V(o),L(i.onResized(l))}),B(2,"canvas",3,0),v(4,"div",4)(5,"div",5)(6,"button",6),F("click",function(){return V(o),L(i.remOneMin())}),E(7," -1 "),_(),v(8,"button",7),F("click",function(){return V(o),L(i.resetTimer())}),E(9," Reset "),_(),v(10,"button",6),F("click",function(){return V(o),L(i.addOneMin())}),E(11," +1 "),_()(),v(12,"div",8),ke(13,Cf,2,0,"button",9)(14,xf,2,0,"button",10),v(15,"button",11),F("click",function(){return V(o),L(i.roundToMin())}),E(16," Synch "),_()()()()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(13),j("ngIf",!i.timerRunning),P(),j("ngIf",i.timerRunning))},dependencies:[Re,tt,et,ni,_i],styles:[".raceWrapper[_ngcontent-%COMP%]{height:100%;width:100%}.canvas-size[_ngcontent-%COMP%]{position:absolute;width:100%;height:50%;top:0;left:0;z-index:inherit}.button-color-red[_ngcontent-%COMP%]{--mdc-filled-button-container-color: var(--kip-port-color);--mdc-filled-button-label-text-color: var(--kip-contrast-color)}.timerBarContainer[_ngcontent-%COMP%]{position:absolute;left:0;bottom:8%;height:auto;width:calc(100% - 20px);margin:0 10px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:stretch;align-content:stretch;gap:20px}.timer-button-groups[_ngcontent-%COMP%]{min-width:247px;max-width:100%;--mdc-filled-button-container-shape: 5px}.timer-adjusters-group[_ngcontent-%COMP%]{flex-grow:1;flex-shrink:1}.timer-countdown-group[_ngcontent-%COMP%]{flex-grow:3;flex-shrink:3}.timer-synch-button[_ngcontent-%COMP%]{width:calc(50% - 5px);margin-left:5px}.timer-start-button[_ngcontent-%COMP%]{width:calc(50% - 5px);margin-right:5px}.timer-reset-button[_ngcontent-%COMP%]{width:calc(40% + -0px);margin:0 10px}.timer-adjust-buttons[_ngcontent-%COMP%]{width:calc(30% - 10px)}"]})}return r})();var Tf=["gaugeBarAnimate"],yh=(()=>{class r{gaugeBarAnimate;displayName=Q.required();displayNameColor=Q.required();dataValue=Q.required();unitLabel=Q.required();barColor=Q.required();barColorGradient=Q.required();barColorBackground=Q.required();gaugeValue=Q.required();gaugeMinValue=Q.required();gaugeMaxValue=Q.required();newGaugeValue=1;oldGaugeValue=1;constructor(){}ngOnChanges(e){if(e.gaugeValue&&!e.gaugeValue.firstChange){let t=this.gaugeMaxValue()-this.gaugeMinValue(),i=t!==0?195/t:0;this.oldGaugeValue=this.newGaugeValue,this.newGaugeValue=(e.gaugeValue.currentValue-this.gaugeMinValue())*i,this.gaugeBarAnimate?.nativeElement&&requestAnimationFrame(()=>{this.gaugeBarAnimate?.nativeElement&&this.gaugeBarAnimate.nativeElement.beginElement()})}}ngOnDestroy(){this.gaugeBarAnimate=null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["svg-simple-linear-gauge"]],viewQuery:function(t,i){if(t&1&&Je(Tf,5),t&2){let o;je(o=Ue())&&(i.gaugeBarAnimate=o.first)}},inputs:{displayName:[1,"displayName"],displayNameColor:[1,"displayNameColor"],dataValue:[1,"dataValue"],unitLabel:[1,"unitLabel"],barColor:[1,"barColor"],barColorGradient:[1,"barColorGradient"],barColorBackground:[1,"barColorBackground"],gaugeValue:[1,"gaugeValue"],gaugeMinValue:[1,"gaugeMinValue"],gaugeMaxValue:[1,"gaugeMaxValue"]},features:[Zt],decls:24,vars:11,consts:[["gaugeBarAnimate",""],[0,"xmlns","osb","http://www.openswatchbook.org/uri/2009/osb",0,"xmlns","dc","http://purl.org/dc/elements/1.1/",0,"xmlns","cc","http://creativecommons.org/ns#",0,"xmlns","rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#",0,"xmlns","svg","http://www.w3.org/2000/svg","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","viewBox","0 0 205 50","preserveAspectRatio","xMidYMid","version","1.1","id","svg8",1,"svg-simple-linear"],["id","defs2"],["id","gaugeBarGradient"],["id","stop849","offset","0",2,"stop-opacity","1"],["id","stop851","offset","0.40",2,"stop-opacity","0"],["id","linearGradient855","gradientTransform","translate(5,-30)","gradientUnits","userSpaceOnUse","y2","34.5","x2","-5","y1","34.5","x1","-6","href","#gaugeBarGradient"],["id","layer1",2,"display","inline"],["id","GaugeBackground","width","195","height","9","x","5","y","30","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","gaugeBar"],["id","gaugeValue","width","1","height","9","x","0","y","0","ry","0",2,"mix-blend-mode","normal","fill-opacity","1","stroke-width","0.0864229"],["id","gaugeValueGradient","transform","scale(-1,1)","width","1","height","9","x","-1","y","0","ry","0",2,"display","inline","opacity","1","mix-blend-mode","multiply","fill","url(#linearGradient855)","stroke-width","0.0864229"],[0,"xlink","href","#gaugeBar","transform","translate(5,30)"],["attributeName","transform","type","scale","begin","indefinite","dur","0.5s","additive","sum","fill","freeze"],["id","layer2",2,"display","inline"],[0,"xml","space","preserve","x","4.1731763","y","25.413595","id","displayNameText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["id","tspan1945","x","4.1731763","y","25.413595",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["text-anchor","end","id","gaugeTexts","y","25.293016","x","200.37138",0,"xml","space","preserve",1,"simpleLinear-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["y","25.293016","x","200.37138","id","valueText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["dy","-9","id","unitText",2,"text-transform","capitalize","font-size","9.87778px"]],template:function(t,i){t&1&&(dt(),v(0,"svg",1)(1,"defs",2)(2,"linearGradient",3),B(3,"stop",4)(4,"stop",5),_(),B(5,"linearGradient",6),_(),v(6,"g",7),B(7,"rect",8),v(8,"defs")(9,"g",9),B(10,"rect",10)(11,"rect",11),_()(),v(12,"use",12),B(13,"animateTransform",13,0),_()(),v(15,"g",14)(16,"text",15)(17,"tspan",16),E(18),_()(),v(19,"text",17)(20,"tspan",18),E(21),_(),v(22,"tspan",19),E(23),_()()()()),t&2&&(P(3),be("stop-color",i.barColorGradient()),P(),be("stop-color",i.barColorGradient()),P(3),be("fill",i.barColorBackground()),P(5),it("fill",i.barColor()),P(),be("from",i.oldGaugeValue+" 1")("to",i.newGaugeValue+" 1"),P(4),be("fill",i.displayNameColor()),P(),at(" ",i.displayName(),""),P(3),xt(i.dataValue()),P(2),xt(i.unitLabel()))},styles:["svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.simpleLinear-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}"]})}return r})();var bh=(()=>{class r extends Ie{unitsLabel="";dataLabelValue="0";dataValue=0;barColor="";barColorGradient="";barColorBackground="";constructor(){super(),this.defaultConfig={displayName:"Gauge Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,color:"contrast",enableTimeout:!1,dataTimeout:5},Fe(()=>{this.theme()&&this.updateGaugeSettings()})}ngOnInit(){this.validateConfig(),this.startWidget()}startWidget(){this.widgetProperties.config.gauge.unitLabelFormat=="abr"?this.unitsLabel=this.widgetProperties.config.paths.gaugePath.convertUnitTo.substr(0,1):this.unitsLabel=this.widgetProperties.config.paths.gaugePath.convertUnitTo,this.unsubscribeDataStream(),this.observeDataStream("gaugePath",e=>{e.data.value==null?(this.dataValue=0,this.dataLabelValue="--"):(this.dataValue=Math.min(Math.max(e.data.value,this.widgetProperties.config.displayScale.lower),this.widgetProperties.config.displayScale.upper),this.dataLabelValue=this.dataValue.toFixed(this.widgetProperties.config.numDecimal))})}updateConfig(e){this.widgetProperties.config=e,this.startWidget(),this.updateGaugeSettings()}updateGaugeSettings(){switch(this.barColorBackground=this.theme().background,this.widgetProperties.config.color){case"contrast":this.barColor=this.theme().contrast,this.barColorGradient=this.theme().contrastDimmer;break;case"blue":this.barColor=this.theme().blue,this.barColorGradient=this.theme().blueDimmer;break;case"green":this.barColor=this.theme().green,this.barColorGradient=this.theme().greenDimmer;break;case"pink":this.barColor=this.theme().pink,this.barColorGradient=this.theme().pinkDimmer;break;case"orange":this.barColor=this.theme().orange,this.barColorGradient=this.theme().orangeDimmer;break;case"purple":this.barColor=this.theme().purple,this.barColorGradient=this.theme().purpleDimmer;break;case"grey":this.barColor=this.theme().grey,this.barColorGradient=this.theme().greyDimmer;break;case"yellow":this.barColor=this.theme().yellow,this.barColorGradient=this.theme().yellowDimmer;break;default:this.barColor=this.theme().contrast,this.barColorGradient=this.theme().contrastDimmer}}ngOnDestroy(){this.destroyDataStreams()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-simple-linear"]],features:[fe],decls:2,vars:12,consts:[[3,"configChange","config","id"],[1,"simpleLinearGaugeContainer",3,"displayName","displayNameColor","unitLabel","dataValue","barColor","barColorGradient","barColorBackground","gaugeValue","gaugeMaxValue","gaugeMinValue"]],template:function(t,i){t&1&&(v(0,"widget-host",0),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),B(1,"svg-simple-linear-gauge",1),_()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("displayName",i.widgetProperties.config.displayName)("displayNameColor",i.theme().contrastDim)("unitLabel",i.unitsLabel)("dataValue",i.dataLabelValue)("barColor",i.barColor)("barColorGradient",i.barColorGradient)("barColorBackground",i.barColorBackground)("gaugeValue",i.dataLabelValue)("gaugeMaxValue",i.widgetProperties.config.displayScale.upper)("gaugeMinValue",i.widgetProperties.config.displayScale.lower))},dependencies:[Re,yh],styles:[".simpleLinearGaugeContainer[_ngcontent-%COMP%]{display:block;position:relative;height:100%;width:100%;padding:0}"]})}return r})();function Ef(r,n){if(r&1){let e=ee();v(0,"h3"),E(1,"Getting Started"),_(),v(2,"p"),E(3,"Welcome to KIP! Here are some basic gestures to help you navigate the application:"),_(),v(4,"table")(5,"tr")(6,"th"),E(7,"Actions"),_(),v(8,"th"),E(9,"Gestures"),_(),v(10,"th"),E(11,"Keyboard Shortcuts"),_()(),v(12,"tr")(13,"td"),E(14,"Cycle through dashboards"),_(),v(15,"td"),E(16,"Swipe Up/Down"),_(),v(17,"td"),E(18,"Shift + Ctrl + Up/Down Arrow"),_()(),v(19,"tr")(20,"td"),E(21,"Open Actions menu"),_(),v(22,"td"),E(23,"Swipe left"),_(),v(24,"td"),E(25,"Shift + Ctrl + Right Arrow"),_()(),v(26,"tr")(27,"td"),E(28,"Open Notification menu"),_(),v(29,"td"),E(30,"Swipe right"),_(),v(31,"td"),E(32,"Shift + Ctrl + Left Arrow"),_()()(),v(33,"h3"),E(34,"Log in to Signal K"),_(),v(35,"p"),E(36," The first step is to configure Signal K server authentication ("),v(37,"i"),E(38,"a pre-existing Signal K server user/password is required"),_(),E(39,"). Swipe left to open the Actions menu, hit Settings, toggle Login to server and enter you pre-existing Signal K credentials. "),_(),v(40,"h3"),E(41,"Option 1: Load Demonstration Dashboards"),_(),v(42,"p"),E(43," Try the sample dashboards using data from your server. : "),B(44,"br"),v(45,"button",2),F("click",function(){V(e);let i=se();return L(i.loadDemoConfig())}),E(46,"Load Demo"),_()(),v(47,"h3"),E(48,"Option 2: Create Your Own Layout"),_(),v(49,"p"),E(50,' The text you are reading is actually a full screen widget in a dashboard. Dashboards are "Locked" by default to prevent accidental modifications. To edit a dashboard, swipe left and hit the bottom unlock menu button. You can later add and manage dashboards using the Dashboards page from the Actions menu. '),_(),v(51,"p")(52,"strong"),E(53,"Try editing the Dashboard now to receive further instructions!"),_()()}}function Af(r,n){r&1&&(v(0,"h3"),E(1,"Build Your Layout"),_(),v(2,"p"),E(3," First, resize this Tutorial widget using the now visible dashed borders so it does not take up all the screen. You can delete this Tutorial widget later when you are done with the instructions. Then, to add a widget: in an empty dashboard area, press and hold. This will open the widget selection panel. Here you can choose from a variety of widgets. "),_(),v(4,"p"),E(5,"To manage widgets, you can:"),_(),v(6,"ul")(7,"li")(8,"strong"),E(9,"Touch and drag"),_(),E(10," to move widgets"),_(),v(11,"li")(12,"strong"),E(13,"Drag corners and sides"),_(),E(14," to resize widgets"),_(),v(15,"li")(16,"strong"),E(17,"Double Tap"),_(),E(18," on a widget to configure it"),_(),v(19,"li")(20,"strong"),E(21,"Press and Hold"),_(),E(22," on a widget to delete or duplicate widgets"),_()(),v(23,"h3"),E(24,"Exit Dashboard Edit Mode"),_(),v(25,"p"),E(26,"Use the Save or Cancel buttons in the lower right corner to either persist your changes or revert changes."),_(),v(27,"h3"),E(28,"Add More Dashboards"),_(),v(29,"p"),E(30,"Swipe left and hit the Dashboards button. From this page you can add, rename, position and duplicate dashboards."),_())}var _h=(()=>{class r extends Ie{dashboard=M(lt);settings=M(ti);constructor(){super()}loadDemoConfig(){this.settings.loadDemoConfig()}startWidget(){}updateConfig(e){}ngOnDestroy(){this.destroyDataStreams()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-tutorial"]],features:[fe],decls:4,vars:3,consts:[[3,"configChange","config","id"],[1,"tutorial-container"],["mat-raised-button","",2,"margin-left","15px",3,"click"]],template:function(t,i){t&1&&(v(0,"widget-host",0),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),v(1,"div",1),ke(2,Ef,54,0)(3,Af,31,0),_()()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(2),Ge(i.dashboard.isDashboardStatic()?2:3))},dependencies:[Re,ni],styles:[".tutorial-container[_ngcontent-%COMP%]{position:absolute;top:0;left:0;display:block;height:100%;width:100%;overflow:none}.tutorial-container[_ngcontent-%COMP%]{padding:0 15px}table[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{border:1px solid var(--mat-sys-on-background);border-collapse:collapse}tr[_ngcontent-%COMP%]:nth-child(2n){background-color:var(--mat-sys-surface-container-high)}"]})}return r})();var Df=["compassAnimate"],Pf=["appWindAnimate"],Mf=["trueWindAnimate"],Of=["appWindValueAnimate"],If=["trueWindValueAnimate"],Rf=["waypointAnimate"],Nf=["courseOverGroundAnimate"];function Wf(r,n){r&1&&(dt(),v(0,"g",150)(1,"g",151),B(2,"path",152)(3,"path",153)(4,"path",154)(5,"path",155)(6,"path",156)(7,"path",157)(8,"path",158)(9,"path",159)(10,"path",160),_(),B(11,"path",161)(12,"path",162)(13,"path",163)(14,"path",164)(15,"path",165)(16,"path",166)(17,"path",167),_())}function Bf(r,n){if(r&1&&(dt(),B(0,"path",168)),r&2){let e=se();be("d",e.closeHauledLineStbdPath)}}function zf(r,n){if(r&1&&(dt(),B(0,"path",169)),r&2){let e=se();be("d",e.closeHauledLinePortPath)}}function Vf(r,n){if(r&1&&(dt(),B(0,"path",170)),r&2){let e=se();be("d",e.portWindSectorPath)}}function Lf(r,n){if(r&1&&(dt(),B(0,"path",171)),r&2){let e=se();be("d",e.stbdWindSectorPath)}}var Ho=([r,n],[e,t],[i,o])=>(Math.atan2(o-t,i-e)-Math.atan2(n-t,r-e)+3*Math.PI)%(2*Math.PI)-Math.PI,wh=(()=>{class r{compassAnimate=de.required("compassAnimate",{read:Ee});appWindAnimate=de.required("appWindAnimate",{read:Ee});trueWindAnimate=de.required("trueWindAnimate",{read:Ee});appWindValueAnimate=de.required("appWindValueAnimate",{read:Ee});trueWindValueAnimate=de.required("trueWindValueAnimate",{read:Ee});waypointAnimate=de.required("waypointAnimate",{read:Ee});courseOverGroundAnimate=de.required("courseOverGroundAnimate",{read:Ee});compassHeading=Q(void 0);courseOverGroundAngle=Q(void 0);courseOverGroundEnable=Q(void 0);trueWindAngle=Q(void 0);trueWindSpeed=Q(void 0);appWindAngle=Q(void 0);appWindSpeed=Q(void 0);laylineAngle=Q(void 0);closeHauledLineEnable=Q(void 0);sailSetupEnable=Q(void 0);windSectorEnable=Q(void 0);waypointAngle=Q(void 0);waypointEnable=Q(void 0);trueWindMinHistoric=Q(void 0);trueWindMidHistoric=Q(void 0);trueWindMaxHistoric=Q(void 0);compassFaceplate;headingValue="--";appWind;appWindValue;appWindSpeedDisplay="--";trueWind;trueWindValue;trueWindSpeedDisplay="--";trueWindHeading=0;waypoint;waypointActive=!1;courseOverGround;courseOverGroundActive=!1;closeHauledLinePortPath="M 231,231 231,90";closeHauledLineStbdPath="M 231,231 231,90";portWindSectorPath="none";stbdWindSectorPath="none";constructor(){this.appWind={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.appWindValue={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.trueWind={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.trueWindValue={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.compassFaceplate={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.waypoint={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0},this.courseOverGround={oldDegreeIndicator:"0",newDegreeIndicator:"0",animationElement:void 0}}ngAfterViewInit(){this.compassFaceplate.animationElement=this.compassAnimate(),this.appWind.animationElement=this.appWindAnimate(),this.appWindValue.animationElement=this.appWindValueAnimate(),this.trueWind.animationElement=this.trueWindAnimate(),this.trueWindValue.animationElement=this.trueWindValueAnimate(),this.waypoint.animationElement=this.waypointAnimate(),this.courseOverGround.animationElement=this.courseOverGroundAnimate()}ngOnChanges(e){if(e.compassHeading&&!e.compassHeading.firstChange){if(e.compassHeading.currentValue===null)return;this.compassFaceplate.oldDegreeIndicator=this.compassFaceplate.newDegreeIndicator,this.compassFaceplate.newDegreeIndicator=e.compassHeading.currentValue.toFixed(0),this.headingValue=this.compassFaceplate.newDegreeIndicator,this.smoothCircularRotation(this.compassFaceplate),this.updateClauseHauledLines(),this.updateWindSectors()}if(e.courseOverGroundAngle){if(this.courseOverGroundEnable()==!1){this.courseOverGroundActive=!1;return}e.courseOverGroundAngle.firstChange||(e.courseOverGroundAngle.currentValue===null?this.courseOverGroundActive=!1:(this.courseOverGroundActive=!0,this.courseOverGround.oldDegreeIndicator=this.courseOverGround.newDegreeIndicator,this.courseOverGround.newDegreeIndicator=e.courseOverGroundAngle.currentValue.toFixed(0),this.smoothCircularRotation(this.courseOverGround)))}if(e.waypointAngle){if(this.waypointEnable()==!1){this.waypointActive=!1;return}e.waypointAngle.firstChange||(e.waypointAngle.currentValue===null?this.waypointActive=!1:(this.waypointActive=!0,this.waypoint.oldDegreeIndicator=this.waypoint.newDegreeIndicator,this.waypoint.newDegreeIndicator=e.waypointAngle.currentValue.toFixed(0),this.smoothCircularRotation(this.waypoint)))}if(e.appWindAngle&&!e.appWindAngle.firstChange){if(e.appWindAngle.currentValue===null)return;this.appWind.oldDegreeIndicator=this.appWind.newDegreeIndicator,this.appWindValue.oldDegreeIndicator=this.appWindValue.newDegreeIndicator,this.appWind.newDegreeIndicator=e.appWindAngle.currentValue.toFixed(0);let t=Number(e.appWindAngle.currentValue)*-1;this.appWindValue.newDegreeIndicator=t.toFixed(0),this.smoothCircularRotation(this.appWind,this.appWindValue)}if(e.trueWindAngle&&!e.trueWindAngle.firstChange){if(e.trueWindAngle.currentValue===null)return;this.trueWind.oldDegreeIndicator=this.trueWind.newDegreeIndicator,this.trueWindValue.oldDegreeIndicator=this.trueWindValue.newDegreeIndicator,this.trueWindHeading=e.trueWindAngle.currentValue,this.trueWind.newDegreeIndicator=this.addHeading(this.trueWindHeading,Number(this.compassFaceplate.newDegreeIndicator)*-1).toFixed(0);let t=Number(this.trueWind.newDegreeIndicator)*-1;this.trueWindValue.newDegreeIndicator=t.toFixed(0),this.smoothCircularRotation(this.trueWind,this.trueWindValue),this.updateClauseHauledLines()}if(e.appWindSpeed&&!e.appWindSpeed.firstChange){if(e.appWindSpeed.currentValue===null)return;this.appWindSpeedDisplay=e.appWindSpeed.currentValue.toFixed(1)}if(e.trueWindSpeed&&!e.trueWindSpeed.firstChange){if(e.trueWindSpeed.currentValue===null)return;this.trueWindSpeedDisplay=e.trueWindSpeed.currentValue.toFixed(1)}(e.trueWindMinHistoric&&!e.trueWindMinHistoric.firstChange||e.trueWindMaxHistoric&&!e.trueWindMaxHistoric.firstChange)&&isNaN(Number(this.trueWindMinHistoric()))&&isNaN(Number(this.trueWindMaxHistoric()))&&this.updateWindSectors()}updateClauseHauledLines(){let e=this.addHeading(Number(this.trueWind.newDegreeIndicator),this.laylineAngle()*-1),t=160*Math.sin(e*Math.PI/180)+231,i=160*Math.cos(e*Math.PI/180)*-1+231;this.closeHauledLinePortPath="M 231,231 "+t+","+i;let o=this.addHeading(Number(this.trueWind.newDegreeIndicator),this.laylineAngle()),a=160*Math.sin(o*Math.PI/180)+231,l=160*Math.cos(o*Math.PI/180)*-1+231;this.closeHauledLineStbdPath="M 231,231 "+a+","+l}updateWindSectors(){let e=this.addHeading(this.addHeading(this.trueWindMinHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()*-1),t=this.addHeading(this.addHeading(this.trueWindMidHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()*-1),i=this.addHeading(this.addHeading(this.trueWindMaxHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()*-1),o=160*Math.sin(e*Math.PI/180)+231,a=160*Math.cos(e*Math.PI/180)*-1+231,l=160*Math.sin(t*Math.PI/180)+231,d=160*Math.cos(t*Math.PI/180)*-1+231,f=160*Math.sin(i*Math.PI/180)+231,s=160*Math.cos(i*Math.PI/180)*-1+231,c=Math.abs(Ho([o,a],[l,d],[f,s]))>Math.PI/2?0:1,p=Ho([f,s],[o,a],[l,d])>0?0:1;this.portWindSectorPath="M 231,231 L "+o+","+a+" A 160,160 0 "+c+" "+p+" "+f+","+s+" z";let y=this.addHeading(this.addHeading(this.trueWindMinHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()),k=this.addHeading(this.addHeading(this.trueWindMidHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()),x=this.addHeading(this.addHeading(this.trueWindMaxHistoric(),Number(this.compassFaceplate.newDegreeIndicator)*-1),this.laylineAngle()),A=160*Math.sin(y*Math.PI/180)+231,z=160*Math.cos(y*Math.PI/180)*-1+231,Y=160*Math.sin(k*Math.PI/180)+231,re=160*Math.cos(k*Math.PI/180)*-1+231,_e=160*Math.sin(x*Math.PI/180)+231,Le=160*Math.cos(x*Math.PI/180)*-1+231,Ye=Math.abs(Ho([A,z],[Y,re],[_e,Le]))>Math.PI/2?0:1,$e=Ho([_e,Le],[A,z],[Y,re])>0?0:1;this.stbdWindSectorPath="M 231,231 L "+A+","+z+" A 160,160 0 "+Ye+" "+$e+" "+_e+","+Le+" z"}addHeading(e=0,t=0){let i=e+t;for(;i>359;)i=i-359;for(;i<0;)i=i+359;return i}smoothCircularRotation(e,t){let i=Number(e.oldDegreeIndicator),o=Number(e.newDegreeIndicator),a=i-o;e.animationElement&&a!=0&&(Math.abs(a)>180?Math.sign(a)==1?i==359?(e.oldDegreeIndicator="0",e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.oldDegreeIndicator="0",t.animationElement.nativeElement.beginElement())):(e.newDegreeIndicator="359",e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.newDegreeIndicator="-359",t.animationElement.nativeElement.beginElement()),e.oldDegreeIndicator="0",e.newDegreeIndicator=o.toFixed(0),e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.oldDegreeIndicator=e.oldDegreeIndicator,t.newDegreeIndicator="0",t.animationElement.nativeElement.beginElement())):i==0?(e.oldDegreeIndicator="359",e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.oldDegreeIndicator="-359",t.animationElement.nativeElement.beginElement())):(e.newDegreeIndicator="0",e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.newDegreeIndicator="0",t.animationElement.nativeElement.beginElement()),e.oldDegreeIndicator="359",e.newDegreeIndicator=o.toFixed(0),e.animationElement.nativeElement.beginElement(),t!==void 0&&(t.oldDegreeIndicator="-359",t.newDegreeIndicator=(o*-1).toFixed(0),t.animationElement.nativeElement.beginElement())):(e.animationElement.nativeElement.beginElement(),t!==void 0&&t.animationElement.nativeElement.beginElement()))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["app-svg-wind"]],viewQuery:function(t,i){t&1&&(ce(i.compassAnimate,Df,5,Ee),ce(i.appWindAnimate,Pf,5,Ee),ce(i.trueWindAnimate,Mf,5,Ee),ce(i.appWindValueAnimate,Of,5,Ee),ce(i.trueWindValueAnimate,If,5,Ee),ce(i.waypointAnimate,Rf,5,Ee),ce(i.courseOverGroundAnimate,Nf,5,Ee)),t&2&&Xe(7)},inputs:{compassHeading:[1,"compassHeading"],courseOverGroundAngle:[1,"courseOverGroundAngle"],courseOverGroundEnable:[1,"courseOverGroundEnable"],trueWindAngle:[1,"trueWindAngle"],trueWindSpeed:[1,"trueWindSpeed"],appWindAngle:[1,"appWindAngle"],appWindSpeed:[1,"appWindSpeed"],laylineAngle:[1,"laylineAngle"],closeHauledLineEnable:[1,"closeHauledLineEnable"],sailSetupEnable:[1,"sailSetupEnable"],windSectorEnable:[1,"windSectorEnable"],waypointAngle:[1,"waypointAngle"],waypointEnable:[1,"waypointEnable"],trueWindMinHistoric:[1,"trueWindMinHistoric"],trueWindMidHistoric:[1,"trueWindMidHistoric"],trueWindMaxHistoric:[1,"trueWindMaxHistoric"]},features:[Zt],decls:177,vars:30,consts:[["courseOverGroundAnimate",""],["waypointAnimate",""],["compassAnimate",""],["appWindValueAnimate",""],["appWindAnimate",""],["trueWindValueAnimate",""],["trueWindAnimate",""],["viewBox","0 0 462 462","preserveAspectRatio","xMidYMid","version","1.1","id","svg8",0,"xmlns","xlink","http://www.w3.org/1999/xlink","xmlns","http://www.w3.org/2000/svg",0,"xmlns","svg","http://www.w3.org/2000/svg",0,"xmlns","rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#",0,"xmlns","cc","http://creativecommons.org/ns#"],["id","defs2"],["id","linearGradient14212"],["offset","0","id","stop14208",1,"boatBackground",2,"stop-opacity","1"],["offset","1","id","stop14210",1,"boatBackground",2,"stop-opacity","0"],["id","linearGradient7154"],["offset","0","id","stop7150",1,"port",2,"stop-opacity","1"],["offset","0.39871383","id","stop7152",1,"boatBackground",2,"stop-opacity","0.56470591"],["id","linearGradient1133"],["offset","0","id","stop1129",1,"starboard",2,"stop-opacity","1"],["offset","0.39871383","id","stop1131",1,"boatBackground",2,"stop-opacity","0.56603771"],[0,"xlink","href","#linearGradient1133","id","linearGradient1135","x1","472.6088","y1","531.48444","x2","472.49197","y2","879.10449","gradientUnits","userSpaceOnUse","spreadMethod","pad","gradientTransform","matrix(-1,0,0,1,703.32731,-474.28644)"],[0,"xlink","href","#linearGradient7154","id","linearGradient7156","x1","-472.64746","y1","531.50549","x2","-472.46103","y2","879.07489","gradientUnits","userSpaceOnUse","gradientTransform","translate(703.32731,-474.28644)"],[0,"xlink","href","#linearGradient14212","id","linearGradient14214","x1","250.36952","y1","296.6875","x2","252.56253","y2","512.70984","gradientUnits","userSpaceOnUse"],[0,"xlink","href","#linearGradient14212","id","linearGradient20477","gradientUnits","userSpaceOnUse","x1","250.84233","y1","382.58936","x2","249.67986","y2","510.65265","gradientTransform","matrix(1.0960272,0,0,0.99845438,-43.954738,-169.73034)",1,"boatBackground"],[0,"xlink","href","#linearGradient14212","id","linearGradient24749","gradientUnits","userSpaceOnUse","gradientTransform","matrix(-1.0960272,0,0,0.99845438,505.95474,-169.73034)","x1","250.84233","y1","382.58936","x2","249.67986","y2","510.65265"],["id","layer1","transform","matrix(0.1248082,0,0,0.11220779,-23.713913,416.39261)","style","display:inline",4,"ngIf"],["id","layerBackground",2,"display","inline"],["id","portStarboardDial","transform","matrix(1.2528928,0,0,1.2528928,-58.41824,-58.418234)",2,"display","inline"],["id","dial",2,"display","inline"],["d","M 230.84956,397.3848 A 165.94029,166.38596 0 0 1 65.282663,231.0632 165.94029,166.38596 0 0 1 230.72204,64.614075","id","Port",2,"display","inline","fill","none","fill-opacity","0","stroke","url(#linearGradient7156)","stroke-width","14.8205","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","M 230.68031,397.38592 A 165.94029,166.38596 0 0 0 374.4654,314.23407 165.94029,166.38596 0 0 0 374.48627,147.80217 165.94029,166.38596 0 0 0 230.72204,64.614055","id","Starboard",2,"display","inline","opacity","1","fill","none","fill-opacity","1","stroke","url(#linearGradient1135)","stroke-width","14.8205","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","Markers",1,"compass-inner-ring",2,"display","inline"],["id","path7189","d","m 80.687566,144.4454 12.77685,7.39357",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 144.00413,80.713346 7.37674,12.80605","id","path7191",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7193","d","m 317.35705,80.343646 -7.37672,12.80611",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 380.94363,143.80506 -12.77686,7.39366","id","path7195",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7197","d","m 404.35295,230.63031 -14.75348,3e-5",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 381.31248,317.55462 -12.77692,-7.3936","id","path7199",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7201","d","m 317.99591,381.28669 -7.37678,-12.80612",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 231.36885,404.74957 -3e-5,-14.78727","id","path7203",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7205","d","m 144.64297,381.65636 7.37672,-12.80615",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 81.056382,318.19494 12.776874,-7.39367","id","path7207",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","path7209","d","m 57.647056,231.36969 14.753506,-6e-5",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 230.63116,57.250436 6e-5,14.78725","id","path7211",2,"fill","none","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684811","transform","matrix(0.98473974,0.17403345,-0.1732637,0.98487547,0,0)","cy","20.915556","cx","267.08746","id","path7213",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4713458","rx","1.4687726","id","circle7219","cx","295.5636","cy","-28.405027","transform","matrix(0.93944096,0.3427108,-0.34133044,0.93994337,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4703517","rx","1.4697686","transform","matrix(0.7653205,0.64364938,-0.64192532,0.76676716,0,0)","cy","-137.90392","cx","325.09726","id","circle7221",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4697686","rx","1.4703517","id","circle7223","cx","325.22626","cy","-194.73386","transform","matrix(0.64192538,0.76676711,-0.76532046,0.64364943,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4687726","rx","1.4713458","transform","matrix(0.34133049,0.93994335,-0.93944093,0.34271086,0,0)","cy","-304.00223","cx","296.08084","id","circle7225",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4684812","rx","1.4716377","id","circle7227","cx","267.66086","cy","-353.1622","transform","matrix(0.1732637,0.98487547,-0.98473974,0.17403346,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4684812","rx","1.4716377","transform","matrix(-0.1732637,0.98487547,-0.98473974,-0.17403346,0,0)","cy","-433.23273","cx","187.41795","id","circle7229",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4687726","rx","1.4713457","id","circle7231","cx","138.06422","cy","-461.74182","transform","matrix(-0.34133048,0.93994335,-0.93944094,-0.34271083,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4697688","rx","1.4703517","transform","matrix(-0.64192535,0.76676714,-0.7653205,-0.64364938,0,0)","cy","-491.38818","cx","28.452917","id","circle7233",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4703517","rx","1.4697688","id","circle7235","cx","-28.442974","cy","-491.58316","transform","matrix(-0.7653205,0.64364938,-0.64192535,-0.76676714,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4713457","rx","1.4687726","transform","matrix(-0.93944094,0.34271083,-0.34133048,-0.93994335,0,0)","cy","-462.55035","cx","-137.82401","id","circle7237",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684812","id","circle7239","cx","-187.01695","cy","-434.16339","transform","matrix(-0.98473974,0.17403346,-0.1732637,-0.98487547,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684812","transform","matrix(-0.98473974,-0.17403346,0.1732637,-0.98487547,0,0)","cy","-353.92023","cx","-267.08746","id","circle7241",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4713457","rx","1.4687726","id","circle7243","cx","-295.56357","cy","-304.53366","transform","matrix(-0.93944094,-0.34271083,0.34133048,-0.93994335,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4703517","rx","1.4697688","transform","matrix(-0.7653205,-0.64364938,0.64192535,-0.76676714,0,0)","cy","-194.80986","cx","-325.09729","id","circle7245",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4697688","rx","1.4703517","id","circle7247","cx","-325.22629","cy","-137.84785","transform","matrix(-0.64192535,-0.76676714,0.7653205,-0.64364938,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4687726","rx","1.4713457","transform","matrix(-0.34133048,-0.93994335,0.93944094,-0.34271083,0,0)","cy","-28.354155","cx","-296.08081","id","circle7249",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4684812","rx","1.4716377","id","circle7251","cx","-267.66086","cy","20.871838","transform","matrix(-0.1732637,-0.98487547,0.98473974,-0.17403346,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4684812","rx","1.4716377","transform","matrix(0.1732637,-0.98487547,0.98473974,0.17403346,0,0)","cy","100.94239","cx","-187.41795","id","circle7253",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4687726","rx","1.4713458","id","circle7255","cx","-138.06422","cy","129.38542","transform","matrix(0.34133049,-0.93994335,0.93944093,0.34271086,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4697686","rx","1.4703517","transform","matrix(0.64192538,-0.76676711,0.76532046,0.64364943,0,0)","cy","158.80649","cx","-28.452925","id","circle7257",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4703517","rx","1.4697686","id","circle7259","cx","28.442968","cy","158.86946","transform","matrix(0.7653205,-0.64364938,0.64192532,0.76676716,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4713458","rx","1.4687726","transform","matrix(0.93944096,-0.3427108,0.34133044,0.93994337,0,0)","cy","129.61153","cx","137.82397","id","circle7261",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684811","id","circle7263","cx","187.01694","cy","101.15855","transform","matrix(0.98473974,-0.17403345,0.1732637,0.98487547,0,0)",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["ry","1.4716377","rx","1.4684811","transform","matrix(0.98473974,-0.17403345,0.1732637,0.98487547,0,0)","cy","101.15855","cx","187.01694","id","circle7265",2,"fill-opacity","1","stroke-width","1.61443","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","vessel"],["d","m 290.42597,338.16266 c 2.63751,1.24549 18.13789,-172.91133 -60.18622,-214.49975","id","rightSide",2,"display","inline","fill","none","fill-opacity","1","stroke","url(#linearGradient20477)","stroke-width","3.29218","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.5"],["d","m 171.57403,338.16266 c -2.63751,1.24549 -18.13789,-172.91133 60.18622,-214.49975","id","LeftSide",2,"display","inline","fill","none","fill-opacity","1","stroke","url(#linearGradient24749)","stroke-width","3.29218","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.5"],["id","LayerLayline",2,"display","inline"],["id","PortLayline","style","display:inline;fill:none;stroke-width:3;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:4px;stroke-opacity:0.6","class","laylines",4,"ngIf"],["class","laylines","style","display:inline;fill:none;stroke-width:3;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:4px;stroke-opacity:0.6","id","StbdLayline",4,"ngIf"],["id","layerLayline",2,"display","inline"],["id","portSectorShift","class","wind-sector-port","style","fill-opacity:0.5;stroke:none;stroke-width:1.90858;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.483517",4,"ngIf"],["id","StbdSectorShift","class","wind-sector-stbd","style","fill-opacity:0.5;stroke:none;stroke-width:1.90858;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.483517",4,"ngIf"],["id","layerCompassHeading",2,"display","inline"],["ry","180.0916","rx","180.39105","id","circle4732","cx","231","cy","231",1,"compass-inner-ring",2,"display","inline","fill","none","stroke-width","25.7045","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 263.57231,46.351529 -2.645,14.975662","id","use6608",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 295.14524,54.854852 -5.20963,14.289576","id","use6610",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 351.51519,87.473623 -9.79086,11.648999","id","use6614",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 374.59941,110.59797 -11.66832,9.77463","id","use6616",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 407.08076,166.9848 -14.31341,5.20098","id","use6620",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 415.4909,198.53405 -15.00058,2.64064","id","use6622",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 415.3802,263.58022 -15.00058,-2.64063","id","use6626",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 406.86273,295.10073 -14.31336,-5.201","id","use6628",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 374.82713,351.8892 -11.66835,-9.77469","id","use6632",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 351.6643,374.93512 -9.79091,-11.64903","id","use6634",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 295.18368,407.36246 -5.20963,-14.28959","id","use6638",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 263.582,415.7587 -2.64498,-14.97568","id","use6640",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 198.42768,415.64815 2.64502,-14.97563","id","use6644",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 166.85475,407.14491 5.20963,-14.28964","id","use6646",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 110.48482,374.52608 9.7909,-11.64895","id","use6650",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 87.400578,351.40175 11.668341,-9.77468","id","use6652",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 54.919243,295.01489 14.313345,-5.20101","id","use6656",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 46.509108,263.46566 15.000536,-2.64062","id","use6658",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 46.619797,198.41948 15.000536,2.64063","id","use6662",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 55.137227,166.89897 14.313356,5.20102","id","use6664",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 87.172904,110.11054 11.668332,9.77464","id","use6668",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 110.33569,87.064604 9.79094,11.648998","id","use6670",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 166.81632,54.63722 5.20964,14.289621","id","use6674",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["d","m 198.41802,46.241065 2.645,14.975629","id","use6676",1,"wind-text",2,"display","inline","fill-opacity","1","stroke-width","2.02924","stroke-linecap","butt","stroke-linejoin","miter","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["transform","scale(1.0008192,0.99918148)","id","textNorth","y","59.938854","x","220.36444",0,"xml","space","preserve",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","24.6764px","line-height","1.25","font-family","sans-serif","-inkscape-font-specification","'sans-serif, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","fill-opacity","1","stroke","none","stroke-width","20.2921","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.854271"],["y","59.938854","x","220.36444","id","tspan4586",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","24.6764px","font-family","sans-serif","-inkscape-font-specification","'sans-serif, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","writing-mode","lr-tb","text-anchor","start","stroke","none","stroke-width","20.2921","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.854271"],["transform","matrix(0.85624422,0.51732097,-0.51817793,0.85482117,0,0)",0,"xml","space","preserve","x","306.34256","y","-96.410698","id","use7031",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-96.410698","x","306.34256","id","tspan7101",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(0.48244023,0.87542368,-0.87687739,0.48163639,0,0)",0,"xml","space","preserve","x","301.879","y","-266.04935","id","use7033",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-266.04935","x","301.879","id","tspan7103",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.02063317,0.99895735,-1.0006182,-0.0206025,0,0)",0,"xml","space","preserve","x","214.30859","y","-410.76288","id","use7035",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-410.76288","x","214.30859","id","tspan7105",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.51817793,0.85482117,-0.85624422,-0.51732097,0,0)",0,"xml","space","preserve","x","60.744469","y","-490.80396","id","use7037",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-490.80396","x","60.744469","id","tspan7109",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.87687739,0.48163639,-0.48244023,-0.87542368,0,0)",0,"xml","space","preserve","x","-109.23221","y","-488.53186","id","use7039",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-488.53186","x","-109.23221","id","tspan7111",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-1.0006182,-0.0206025,0.02063317,-0.99895735,0,0)",0,"xml","space","preserve","x","-250.87608","y","-401.37546","id","use7041",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-401.37546","x","-250.87608","id","tspan7113",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.85624422,-0.51732097,0.51817793,-0.85482117,0,0)",0,"xml","space","preserve","x","-332.97412","y","-254.26855","id","use7043",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-254.26855","x","-332.97412","id","tspan7115",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(-0.48244023,-0.87542368,0.87687739,-0.48163639,0,0)",0,"xml","space","preserve","x","-328.56262","y","-84.81398","id","use7045",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","-84.81398","x","-328.56262","id","tspan7117",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(0.02063317,-0.99895735,1.0006182,0.0206025,0,0)",0,"xml","space","preserve","x","-243.82649","y","60.284389","id","use7047",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","60.284389","x","-243.82649","id","tspan7119",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(0.51817793,-0.85482117,0.85624422,0.51732097,0,0)",0,"xml","space","preserve","x","-94.569901","y","141.12741","id","use7049",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","141.12741","x","-94.569901","id","tspan7121",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["transform","matrix(0.84497054,-0.53548077,0.5363647,0.84356435,0,0)",0,"xml","space","preserve","x","68.010208","y","143.99249","id","use7051",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","line-height","1.25","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","start","letter-spacing","0px","word-spacing","0px","writing-mode","lr-tb","text-anchor","start","display","inline","fill-opacity","1","stroke","none","stroke-width","1.02642"],["y","143.99249","x","68.010208","id","tspan7125",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","13.709px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","stroke-width","1.02642"],["id","COGIndicator"],["id","indicator","d","m 233.42911,73.408997 a 2.5,2.5 0 0 1 -2.5,2.5 2.5,2.5 0 0 1 -2.5,-2.5 2.5,2.5 0 0 1 2.5,-2.5 2.5,2.5 0 0 1 2.5,2.5 z m -11.72079,-40.278243 6.73667,-4.970565 c 1.41548,-1.044398 3.69456,-1.044398 5.11004,0 l 6.73666,4.97056 c 1.41549,1.044397 1.41549,2.725985 0,3.770382 l -6.73667,4.970566 c -1.41547,1.044391 -3.69456,1.044397 -5.11004,0 l -6.73666,-4.97056 c -1.41548,-1.044397 -1.41548,-2.725991 0,-3.770383 z m 6.73255,-4.677026 h 5 v 45.031639 h -5 z",1,"course-over-ground",2,"stroke-width","5.76507","stroke-linecap","square"],["attributeName","transform","type","rotate","begin","indefinite","dur","0.5s","additive","replace","fill","freeze"],["id","waypoint",2,"display","inline"],["id","waypoint","transform","translate(-0.00209063,3)"],["id","path6341","cx","231","cy","72.35717","r","5.6431713",1,"next-waypoint",2,"fill","none","fill-opacity","1","stroke-width","5.7","stroke-dasharray","none","stroke-opacity","0.984314"],["id","g11647","transform","matrix(1.0001219,0,0,0.99974754,-0.02606381,-20.276417)",2,"fill","#afafaf","fill-opacity","1","stroke","#afafaf","stroke-opacity","1"],["id","path10836","d","m 240.4718,93.050621 c 2.54775,0.153686 5.11457,0.356643 7.70105,0.601581 h 0.34551",2,"fill","#afafaf","fill-opacity","1","stroke","#afafaf","stroke-width","2.3","stroke-dasharray","none","stroke-opacity","1"],["id","path11640","d","m 213.62158,93.652202 c 2.61223,-0.320275 5.24415,-0.552387 7.8965,-0.705521",2,"fill","#afafaf","fill-opacity","1","stroke","#afafaf","stroke-width","2.3","stroke-dasharray","none","stroke-opacity","1"],["id","layerWindAngle",2,"display","inline"],["x","0","y","0","width","33","height","83","viewBox","0 0 33 83","id","AppWindCoord",2,"overflow","visible"],["id","NeddleAWA","d","m 231,7.2483045 a 16.130346,16.130346 0 0 0 -16.13086,16.1308605 16.130346,16.130346 0 0 0 4.87109,11.494141 l 11.40039,54.181641 0.006,0.01367 11.27539,-54.357423 A 16.130346,16.130346 0 0 0 247.13086,23.379165 16.130346,16.130346 0 0 0 231,7.2483045 Z",1,"app-wind",2,"display","inline","fill-opacity","1","stroke","#afafaf","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],[0,"xml","space","preserve","x","233","y","52.233677","id","LabelAWS",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline","fill-opacity","1","stroke","none","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],["viewBox","-231.5 -8 33 53","id","AWSCoord",2,"overflow","visible"],[0,"xml","space","preserve","alignment-baseline","middle","x","0","y","0","id","ValueAWS","transform","scale(1.0128481,0.98731488)",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","14.3px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline","fill-opacity","1","stroke","none","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],["x","0","y","0","width","33","height","53","viewBox","0 0 33 53","id","TrueWindCoord",2,"overflow","visible"],["id","NeddleTWA","d","m 231,7.25 a 16.122065,16.122065 0 0 0 -16.12109,16.121093 16.122065,16.122065 0 0 0 4.70117,11.322266 l 11.52148,24.009766 0.008,0.0059 11.41015,-24.115234 A 16.122065,16.122065 0 0 0 247.12109,23.371093 16.122065,16.122065 0 0 0 231,7.25 Z",1,"true-wind",2,"display","inline","fill-opacity","0.996078","stroke","#000000","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],[0,"xml","space","preserve","x","232.99219","y","52.227623","id","LabelTWS",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline","fill-opacity","1","stroke","none","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],["viewBox","-231.5 -24 33 53","id","TWSCoord",2,"overflow","visible"],[0,"xml","space","preserve","alignment-baseline","middle","x","0","y","0","id","ValueTWS",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","14.3px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline","fill-opacity","1","stroke","none","stroke-width","0","stroke-dasharray","none","stroke-opacity","1"],["id","LayerHeadingIndicator","transform","translate(4,8)",2,"display","inline"],["id","FaceplateHeading","width","67.073669","height","38.361046","x","194.46938","y","30.8176","d","m 225.64754,33.805625 1.6301,0.0048 c 17.39931,0.05072 31.39725,3.329857 31.38553,7.35232 l -0.0685,23.494107 c -0.0117,4.022464 -14.02856,7.21993 -31.42786,7.169208 l -1.63011,-0.0048 c -17.3993,-0.05072 -31.39725,-3.329857 -31.38552,-7.352321 l 0.0685,-23.494107 c 0.0117,-4.022463 14.02855,-7.219929 31.42786,-7.169207 z","ry","7.3267355","rx","32.688519","transform","matrix(1.002028,0,0,0.77009941,-0.86633959,3.237595)",1,"heading-background",2,"display","inline","opacity","1","fill-opacity","1","stroke-width","2.5","stroke-linecap","butt","stroke-linejoin","round","stroke-dasharray","none","stroke-opacity","1"],[0,"xml","space","preserve","x","226.14061","y","52.178043","id","ValueHeading",1,"wind-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","24px","font-family","Arial","-inkscape-font-specification","'Arial, Bold'","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-anchor","middle","display","inline"],["id","tspan349","x","226.14061","y","52.178043"],["id","layer1","transform","matrix(0.1248082,0,0,0.11220779,-23.713913,416.39261)",2,"display","inline"],["id","Boat","transform","matrix(2.4762966,0,0,2.4762966,312.32639,-480.88375)",1,"sailSetupBoat",2,"display","inline"],["d","m 117.80581,288.1415 -22.540223,29.3722 h -16.5349 l 0.25052,-26.32688 c -1.06637,-2.75393 -2.56049,-3.06484 -4.84601,-3.55125 z","id","path2110",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 8.9767971,282.82435 -4.95991,24.75841 h 7.7154099 l 7.16432,-23.7875","id","path2148",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["id","scafo_1_","d","m 195.42256,265.29369 c 0,0 -12.46584,10.53388 -18.18235,16.95385 -1.87779,2.10888 -8.08356,2.76316 -16.33955,3.62976 -32.36804,3.39759 -103.815953,4.14078 -157.1129429,-4.52397 3.49616,-2.32158 3.79424,-8.74891 5.51442,-13.35052 7.1e-4,0 131.6522929,-0.0975 186.1204229,-2.70912 z",2,"display","inline","fill","none","stroke-width","3","stroke-dasharray","none"],["d","m 23.541277,239.61115 h 94.045203 l 0.39645,2.12132 -94.545213,0.35355 z","id","path2154",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 102.35735,2.5312768 h 4.37983 c 8.9756,36.5347612 12.51565,95.9939792 14.23441,163.1344432 v 92.86113 h -2.73738 l 0.54748,-92.86113 C 116.16119,110.0212 115.191,52.56101 105.64222,4.5390852 Z","id","path2158",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 104.27966,267.15927 -0.22723,-7.83783 c 22.67574,-0.50375 30.37822,0.37193 37.04087,7.36281","id","path2116",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 1.0329568,282.20014 5.7927027,-15.82819 1.9208522,1.18337","id","path2104",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","2.13494","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","M 116.99965,68.100007 190.49965,265.1","id","path2160",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","M 8.8139634,266.87847 102.98152,3.5208385","id","path2208",2,"display","inline","fill","none","fill-rule","evenodd","stroke-width","3","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 268.56631,196.18971 -7.52466,-0.0957 -42.6992,68.72135 -26.43173,67.95776 -0.29576,0.48195 -0.11878,1.21163 -0.092,1.15201 76.51843,-0.0845 0.0422,-3.68441 0.0578,-2.60466 -0.0832,-3.58678 0.40814,-30.21044 0.43451,-38.16536 0.11267,-19.13053 0.008,-13.73528 -0.12432,-16.23422 z","id","Reef3","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef3",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke-width","2.34613","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 266.10811,139.30664 h -7.42901 l -42.69918,68.72134 -26.43173,67.95777 -14.01711,50.03862 -1.05129,5.07493 -0.70001,4.5951 94.06196,-0.0639 0.15835,-8.47316 0.0577,-2.44384 0.46668,-44.66571 0.42579,-41.29152 -0.2351,-38.16536 -0.74826,-19.13053 -0.75663,-13.54396 -0.6982,-16.61687 z","id","Reef2","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef2",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke-width","2.34613","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 261.10546,61.763841 h -6.78005 l -42.69918,68.721369 -26.43173,67.95776 -20.02404,74.06637 -14.96301,59.55366 -0.75384,3.65964 118.40312,-0.24747 0.3958,-35.2044 0.55482,-54.44997 0.036,-42.1476 -1.91047,-41.81069 -1.92241,-38.16537 -1.00784,-19.5199 -0.75663,-13.803549 -1.08758,-16.746654 z","id","Reef1","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef1",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke-width","2.34613","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 250.83842,-17.681808 h -6.40769 l -42.45096,68.72137 -26.43173,67.957768 -20.02404,74.06638 -17.62115,71.77563 -15.21827,71.01207 145.19283,-0.39575 0.95061,-116.19575 v -15.85565 l -3.08946,-66.73565 -2.85177,-52.536575 -3.08946,-39.284109 -2.37648,-20.588657 -1.9012,-14.6723772 -2.13885,-14.9090281 z","id","Main","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupFull",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke-width","2.34613","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 308.08151,183.27812 -13.93148,139.40275 65.92617,-1.08343","id","WorkingJib","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef2",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke","#000000","stroke-width","1.67085","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 291.85104,138.47323 -31.19542,207.55672 108.08107,-0.81342","id","Jib","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupReef1",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke","#000000","stroke-width","2.33332","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["d","m 272.14328,86.627245 -57.69332,284.259845 162.9035,-2.80365","id","Genoa","transform","matrix(1.5736253,0,0,1.5736253,181.67439,-417.86068)",1,"sailSetupFull",2,"display","inline","fill-opacity","1","fill-rule","evenodd","stroke","#000000","stroke-width","2.36044","stroke-linecap","butt","stroke-linejoin","miter","stroke-dasharray","none","stroke-opacity","1"],["id","PortLayline",1,"laylines",2,"display","inline","fill","none","stroke-width","3","stroke-linecap","square","stroke-linejoin","miter","stroke-miterlimit","0","stroke-dasharray","4px","stroke-opacity","0.6"],["id","StbdLayline",1,"laylines",2,"display","inline","fill","none","stroke-width","3","stroke-linecap","square","stroke-linejoin","miter","stroke-miterlimit","0","stroke-dasharray","4px","stroke-opacity","0.6"],["id","portSectorShift",1,"wind-sector-port",2,"fill-opacity","0.5","stroke","none","stroke-width","1.90858","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.483517"],["id","StbdSectorShift",1,"wind-sector-stbd",2,"fill-opacity","0.5","stroke","none","stroke-width","1.90858","stroke-linecap","butt","stroke-linejoin","round","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","0.483517"]],template:function(t,i){t&1&&(dt(),v(0,"svg",7)(1,"defs",8)(2,"linearGradient",9),B(3,"stop",10)(4,"stop",11),_(),v(5,"linearGradient",12),B(6,"stop",13)(7,"stop",14),_(),v(8,"linearGradient",15),B(9,"stop",16)(10,"stop",17),_(),B(11,"linearGradient",18)(12,"linearGradient",19)(13,"linearGradient",20)(14,"linearGradient",21)(15,"linearGradient",22),_(),ke(16,Wf,18,0,"g",23),v(17,"g",24)(18,"g",25)(19,"g",26),B(20,"path",27)(21,"path",28),_(),v(22,"g",29),B(23,"path",30)(24,"path",31)(25,"path",32)(26,"path",33)(27,"path",34)(28,"path",35)(29,"path",36)(30,"path",37)(31,"path",38)(32,"path",39)(33,"path",40)(34,"path",41)(35,"ellipse",42)(36,"ellipse",43)(37,"ellipse",44)(38,"ellipse",45)(39,"ellipse",46)(40,"ellipse",47)(41,"ellipse",48)(42,"ellipse",49)(43,"ellipse",50)(44,"ellipse",51)(45,"ellipse",52)(46,"ellipse",53)(47,"ellipse",54)(48,"ellipse",55)(49,"ellipse",56)(50,"ellipse",57)(51,"ellipse",58)(52,"ellipse",59)(53,"ellipse",60)(54,"ellipse",61)(55,"ellipse",62)(56,"ellipse",63)(57,"ellipse",64)(58,"ellipse",65)(59,"ellipse",66),_()(),v(60,"g",67),B(61,"path",68)(62,"path",69),_()(),v(63,"g",70),ke(64,Bf,1,1,"path",71)(65,zf,1,1,"path",72),_(),v(66,"g",73),ke(67,Vf,1,1,"path",74)(68,Lf,1,1,"path",75),_(),v(69,"g",76),B(70,"ellipse",77)(71,"path",78)(72,"path",79)(73,"path",80)(74,"path",81)(75,"path",82)(76,"path",83)(77,"path",84)(78,"path",85)(79,"path",86)(80,"path",87)(81,"path",88)(82,"path",89)(83,"path",90)(84,"path",91)(85,"path",92)(86,"path",93)(87,"path",94)(88,"path",95)(89,"path",96)(90,"path",97)(91,"path",98)(92,"path",99)(93,"path",100)(94,"path",101),v(95,"text",102)(96,"tspan",103),E(97,"N"),_()(),v(98,"text",104)(99,"tspan",105),E(100,"30"),_()(),v(101,"text",106)(102,"tspan",107),E(103,"60"),_()(),v(104,"text",108)(105,"tspan",109),E(106,"90"),_()(),v(107,"text",110)(108,"tspan",111),E(109,"120"),_()(),v(110,"text",112)(111,"tspan",113),E(112,"150"),_()(),v(113,"text",114)(114,"tspan",115),E(115,"180"),_()(),v(116,"text",116)(117,"tspan",117),E(118,"210"),_()(),v(119,"text",118)(120,"tspan",119),E(121,"240"),_()(),v(122,"text",120)(123,"tspan",121),E(124,"270"),_()(),v(125,"text",122)(126,"tspan",123),E(127,"300"),_()(),v(128,"text",124)(129,"tspan",125),E(130,"330"),_()(),v(131,"g",126),B(132,"path",127)(133,"animateTransform",128,0),_(),v(135,"g",129)(136,"g",130),B(137,"circle",131),v(138,"g",132),B(139,"path",133)(140,"path",134),_()(),B(141,"animateTransform",128,1),_(),B(143,"animateTransform",128,2),_(),v(145,"g",135)(146,"svg",136)(147,"g"),B(148,"path",137),v(149,"text",138),E(150,"A "),_(),v(151,"svg",139)(152,"g")(153,"text",140),E(154),_(),B(155,"animateTransform",128,3),_()(),B(157,"animateTransform",128,4),_()(),v(159,"svg",141)(160,"g"),B(161,"path",142),v(162,"text",143),E(163,"T "),_(),v(164,"svg",144)(165,"g")(166,"text",145),E(167),_(),B(168,"animateTransform",128,5),_()(),B(170,"animateTransform",128,6),_()()(),v(172,"g",146),B(173,"path",147),v(174,"text",148)(175,"tspan",149),E(176),_()()()()),t&2&&(P(16),j("ngIf",i.sailSetupEnable()),P(47),it("display",i.closeHauledLineEnable()?"inline":"none"),P(),j("ngIf",i.trueWindAngle()!=null),P(),j("ngIf",i.trueWindAngle()!=null),P(),it("display",i.windSectorEnable()?"inline":"none"),P(),j("ngIf",i.portWindSectorPath!="none"),P(),j("ngIf",i.stbdWindSectorPath!="none"),P(63),it("display",i.courseOverGroundActive?"inline":"none"),P(2),be("from",i.courseOverGround.oldDegreeIndicator+" 231 231")("to",i.courseOverGround.newDegreeIndicator+" 231 231"),P(2),it("display",i.waypointActive?"inline":"none"),P(6),be("from",i.waypoint.oldDegreeIndicator+" 231 231")("to",i.waypoint.newDegreeIndicator+" 231 231"),P(2),be("from","-"+i.compassFaceplate.oldDegreeIndicator+" 231 231")("to","-"+i.compassFaceplate.newDegreeIndicator+" 231 231"),P(11),at(" ",i.appWindSpeedDisplay," "),P(),be("from",i.appWindValue.oldDegreeIndicator)("to",i.appWindValue.newDegreeIndicator),P(2),be("from",i.appWind.oldDegreeIndicator+" 231 231")("to",i.appWind.newDegreeIndicator+" 231 231"),P(10),at(" ",i.trueWindSpeedDisplay," "),P(),be("from",i.trueWindValue.oldDegreeIndicator)("to",i.trueWindValue.newDegreeIndicator),P(2),be("from",i.trueWind.oldDegreeIndicator+" 231 231")("to",i.trueWind.newDegreeIndicator+" 231 231"),P(6),xt(i.headingValue))},dependencies:[_i],styles:["svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.compass-inner-ring[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color);fill:var(--kip-contrast-color)}.starboard[_ngcontent-%COMP%]{stop-color:var(--kip-starboard-color)}.port[_ngcontent-%COMP%]{stop-color:var(--kip-port-color)}.wind-text[_ngcontent-%COMP%]{fill:var(--kip-widget-card-background-color);stroke:var(--kip-widget-card-background-color)}.heading-background[_ngcontent-%COMP%]{stroke:var(--mat-sys-background);fill:var(--kip-contrast-color)}.boatBackground[_ngcontent-%COMP%]{stop-color:var(--kip-contrast-color)!important}.true-wind[_ngcontent-%COMP%]{fill:var(--kip-yellow-color)}.app-wind[_ngcontent-%COMP%]{fill:var(--kip-blue-color)}.course-over-ground[_ngcontent-%COMP%]{fill:var(--kip-pink-color)}.next-waypoint[_ngcontent-%COMP%]{stroke:var(--kip-green-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)}"]})}return r})();var kh=(()=>{class r extends Ie{zones=M(ut);currentHeading=0;courseOverGroundAngle=0;appWindAngle=0;appWindSpeed=0;trueWindAngle=0;trueWindSpeed=0;waypointAngle=0;trueWindHistoric=[];trueWindMinHistoric;trueWindMidHistoric;trueWindMaxHistoric;windSectorObservableSub=null;constructor(){super(),this.defaultConfig={filterSelfPaths:!0,paths:{headingPath:{description:"Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},courseOverGround:{description:"Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint Bearing",path:"self.navigation.courseGreatCircle.nextPoint.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,sailSetupEnable:!1,enableTimeout:!1,dataTimeout:5}}ngOnInit(){this.validateConfig(),this.startWidget()}startWidget(){this.unsubscribeDataStream(),this.stopWindSectors(),this.observeDataStream("headingPath",e=>{e.data.value==null&&(e.data.value=0),this.currentHeading=e.data.value}),this.observeDataStream("courseOverGround",e=>{e.data.value==null&&(e.data.value=0),this.courseOverGroundAngle=e.data.value}),this.observeDataStream("nextWaypointBearing",e=>{e.data.value<0?this.waypointAngle=360+e.data.value:this.waypointAngle=e.data.value}),this.observeDataStream("appWindAngle",e=>{e.data.value==null&&(e.data.value=0),e.data.value<0?this.appWindAngle=360+e.data.value:this.appWindAngle=e.data.value}),this.observeDataStream("appWindSpeed",e=>{e.data.value==null&&(e.data.value=0),this.appWindSpeed=e.data.value}),this.observeDataStream("trueWindSpeed",e=>{e.data.value==null&&(e.data.value=0),this.trueWindSpeed=e.data.value}),this.observeDataStream("trueWindAngle",e=>{e.data.value==null&&(e.data.value=0),this.widgetProperties.config.paths.trueWindAngle.path.match("angleTrueWater")||this.widgetProperties.config.paths.trueWindAngle.path.match("angleTrueGround")?this.trueWindAngle=this.addHeading(this.currentHeading,e.data.value):this.widgetProperties.config.paths.trueWindAngle.path.match("direction")?this.trueWindAngle=e.data.value:this.trueWindAngle=e.data.value,this.widgetProperties.config.windSectorEnable&&this.addHistoricalTrue(this.trueWindAngle)}),this.startWindSectors()}updateConfig(e){this.widgetProperties.config=e,this.startWidget()}ngOnDestroy(){this.destroyDataStreams(),this.stopWindSectors()}startWindSectors(){this.zones.runOutsideAngular(()=>{this.windSectorObservableSub=ol(500).subscribe(e=>{this.historicalCleanup()})})}addHistoricalTrue(e){this.trueWindHistoric.push({timestamp:Date.now(),heading:e});let t=this.arcForAngles(this.trueWindHistoric.map(i=>i.heading));this.trueWindMinHistoric=t[0],this.trueWindMaxHistoric=t[1],this.trueWindMidHistoric=t[2]}arcForAngles(e){return e.slice(1).reduce((t,i)=>{let o=i;for(;o<t[0]-180;)o+=360;for(;o>t[1]+180;)o-=360;return t[0]=Math.min(t[0],o),t[1]=Math.max(t[1],o),t[2]=(t[1]-t[0])/2+t[0],t},[e[0],e[0]])}historicalCleanup(){let e=Date.now()-this.widgetProperties.config.windSectorWindowSeconds*1e3;for(let t=this.trueWindHistoric.length-1;t>=0;--t)this.trueWindHistoric[t].timestamp<e&&this.trueWindHistoric.splice(t,1)}stopWindSectors(){this.windSectorObservableSub?.unsubscribe()}addHeading(e,t){let i=e+t;for(;i>359;)i=i-359;for(;i<0;)i=i+359;return i}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-wind-steer"]],features:[fe],decls:2,vars:18,consts:[[3,"configChange","config","id"],[3,"compassHeading","courseOverGroundAngle","courseOverGroundEnable","trueWindAngle","trueWindSpeed","appWindAngle","appWindSpeed","laylineAngle","closeHauledLineEnable","windSectorEnable","waypointAngle","waypointEnable","trueWindMinHistoric","trueWindMidHistoric","trueWindMaxHistoric","sailSetupEnable"]],template:function(t,i){t&1&&(v(0,"widget-host",0),Pe("configChange",function(a){return De(i.widgetProperties.config,a)||(i.widgetProperties.config=a),a}),F("configChange",function(a){return i.updateConfig(a)}),B(1,"app-svg-wind",1),_()),t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("compassHeading",i.currentHeading)("courseOverGroundAngle",i.courseOverGroundAngle)("courseOverGroundEnable",i.widgetProperties.config.courseOverGroundEnable)("trueWindAngle",i.trueWindAngle)("trueWindSpeed",i.trueWindSpeed)("appWindAngle",i.appWindAngle)("appWindSpeed",i.appWindSpeed)("laylineAngle",i.widgetProperties.config.laylineAngle)("closeHauledLineEnable",i.widgetProperties.config.laylineEnable)("windSectorEnable",i.widgetProperties.config.windSectorEnable)("waypointAngle",i.waypointAngle)("waypointEnable",i.widgetProperties.config.waypointEnable)("trueWindMinHistoric",i.trueWindMinHistoric)("trueWindMidHistoric",i.trueWindMidHistoric)("trueWindMaxHistoric",i.trueWindMaxHistoric)("sailSetupEnable",i.defaultConfig.sailSetupEnable))},dependencies:[wh,Re],encapsulation:2})}return r})();var Ff=["canvasEl"],Sh=(()=>{class r extends Ie{canvasEl=de("canvasEl");canvas=M(Tt);canvasCtx=null;isDestroyed=!1;maxTextWidth=0;maxTextHeight=0;constructor(){super(),this.defaultConfig={displayName:"Static Label",color:"green",bgColor:"grey",noColor:!1,noBgColor:!0},Fe(()=>{this.theme()&&(this.getColors(this.widgetProperties.config.color),this.updateCanvas())})}ngOnInit(){this.validateConfig()}ngAfterViewInit(){this.canvas.setHighDPISize(this.canvasEl().nativeElement,this.canvasEl().nativeElement.parentElement.getBoundingClientRect()),this.canvasCtx=this.canvasEl().nativeElement.getContext("2d"),this.maxTextWidth=Math.floor(this.canvasEl().nativeElement.width-40),this.maxTextHeight=Math.floor(this.canvasEl().nativeElement.height-40),document.fonts.ready.then(()=>{this.isDestroyed||this.updateCanvas()})}ngOnDestroy(){this.isDestroyed=!0,this.canvas.clearCanvas(this.canvasCtx,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height),this.canvasEl().nativeElement.remove()}startWidget(){}updateConfig(e){e.displayName?this.widgetProperties.config.displayName=e.displayName:this.widgetProperties.config.displayName="",this.updateCanvas()}onResized(e){this.canvas.setHighDPISize(this.canvasEl().nativeElement,e.contentRect),this.maxTextWidth=Math.floor(this.canvasEl().nativeElement.width-40),this.maxTextHeight=Math.floor(this.canvasEl().nativeElement.height-40),document.fonts.ready.then(()=>{this.updateCanvas()})}getColors(e){switch(e){case"contrast":return this.theme().contrast;case"blue":return this.theme().blue;case"green":return this.theme().green;case"pink":return this.theme().pink;case"orange":return this.theme().orange;case"purple":return this.theme().purple;case"grey":return this.theme().grey;case"yellow":return this.theme().yellow;default:return this.theme().contrast}}updateCanvas(){this.canvasCtx&&(this.canvas.clearCanvas(this.canvasCtx,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height),this.widgetProperties.config.noBgColor||this.canvas.drawRectangle(this.canvasCtx,0,0,this.canvasEl().nativeElement.width,this.canvasEl().nativeElement.height,this.getColors(this.widgetProperties.config.bgColor)),this.drawValue())}drawValue(){this.canvas.drawText(this.canvasCtx,this.widgetProperties.config.displayName,Math.floor(this.canvasEl().nativeElement.width/2),Math.floor(this.canvasEl().nativeElement.height/2+10),this.maxTextWidth,this.maxTextHeight,"bold",this.getColors(this.widgetProperties.config.color))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-label"]],viewQuery:function(t,i){t&1&&ce(i.canvasEl,Ff,5),t&2&&Xe()},features:[fe],decls:4,vars:2,consts:[["canvasEl",""],[3,"configChange","config","id"],[1,"wrapper",3,"onResize"],[1,"canvas",2,"z-index","inherit"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),v(1,"div",2),F("onResize",function(l){return V(o),L(i.onResized(l))}),B(2,"canvas",3,0),_()()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid))},dependencies:[Re,tt,et],styles:[".wrapper[_ngcontent-%COMP%]{position:relative;display:block;width:100%;height:100%}.canvas[_ngcontent-%COMP%]{display:block;position:absolute;top:0;left:0;z-index:inherit;border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium))}"]})}return r})();var Hf=["svgSlider"];function Gf(r,n){r&1&&B(0,"div",11)}var Ch=(()=>{class r extends Ie{svgElement=de.required("svgSlider");canvas=M(Tt);dashboard=M(lt);signalkRequestsService=M(Fi);appService=M(ii);labelColor=void 0;barColor=void 0;skRequestSub=new rn;lineStartPx;lineWidthPx;lineEndPx;resizeTimeout;debounceTimeout;handlePosition=20;pathValue=0;lineStart=this.handlePosition;isDragStarted=!1;lineWidth="0px";VIEWBOX_WIDTH=200;LINE_START=20;LINE_WIDTH=160;colorMap=new Map([["contrast",{label:this.theme().contrastDim,bar:this.theme().contrast}],["blue",{label:this.theme().blueDim,bar:this.theme().blue}],["green",{label:this.theme().greenDim,bar:this.theme().green}],["pink",{label:this.theme().pinkDim,bar:this.theme().pink}],["orange",{label:this.theme().orangeDim,bar:this.theme().orange}],["purple",{label:this.theme().purpleDim,bar:this.theme().purple}],["grey",{label:this.theme().greyDim,bar:this.theme().grey}],["yellow",{label:this.theme().yellowDim,bar:this.theme().yellow}]]);valueChange$=new bt;constructor(){super(),this.defaultConfig={displayName:"Slider Label",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric PUT path",path:null,source:null,pathType:"number",isPathConfigurable:!0,convertUnitTo:"unitless",showPathSkUnitsFilter:!1,pathSkUnitsFilter:"unitless",supportsPut:!0,sampleTime:500}},displayScale:{lower:0,upper:1,type:"linear"},enableTimeout:!1,dataTimeout:5,color:"contrast"},Fe(()=>{this.theme()&&this.getColors(this.widgetProperties.config.color)})}ngOnInit(){this.validateConfig(),this.valueChange$.pipe(Ht(e=>this.isWithinMargin(e,this.widgetProperties.config.displayScale.lower)?this.widgetProperties.config.displayScale.lower:this.isWithinMargin(e,this.widgetProperties.config.displayScale.upper)?this.widgetProperties.config.displayScale.upper:parseFloat(e.toFixed(2))),Xr(200),sl()).subscribe(e=>{this.sendValue(e)})}ngAfterViewInit(){this.startWidget()}startWidget(){this.unsubscribeDataStream(),this.observeDataStream("gaugePath",e=>{if(!e||!e.data){this.handlePosition=this.mapValueToPosition(this.widgetProperties.config.displayScale.lower);return}this.updateHandlePosition(this.mapValueToPosition(e.data.value))}),this.skRequestSub?.unsubscribe(),this.subscribeSKRequest()}mapValueToPosition(e){let t=this.widgetProperties.config.displayScale.upper-this.widgetProperties.config.displayScale.lower,i=this.LINE_WIDTH;return(e-this.widgetProperties.config.displayScale.lower)/t*i+this.LINE_START}mapPositionToValue(e){let t=this.widgetProperties.config.displayScale.upper-this.widgetProperties.config.displayScale.lower,i=this.LINE_WIDTH;return(e-this.LINE_START)/i*t+this.widgetProperties.config.displayScale.lower}isWithinMargin(e,t){let i=(this.widgetProperties.config.displayScale.upper-this.widgetProperties.config.displayScale.lower)*.01;return Math.abs(e-t)<=i}subscribeSKRequest(){this.skRequestSub=this.signalkRequestsService.subscribeRequest().subscribe(e=>{if(e.widgetUUID==this.widgetProperties.uuid){let t=`Toggle Widget ${this.widgetProperties.config.displayName}: `;e.statusCode!=200&&(e.message?t+=e.message:t+=e.statusCode+" - "+e.statusCodeDescription,this.appService.sendSnackbarNotification(t,0))}})}sendValue(e){let t=this.widgetProperties.config.paths.gaugePath.path;this.signalkRequestsService.putRequest(t,e,this.widgetProperties.uuid)}updateConfig(e){this.widgetProperties.config=e,this.getColors(this.widgetProperties.config.color),this.calculateLineBounds(),this.startWidget()}onResized(e){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.calculateLineBounds()},200)}calculateLineBounds(){if(!this.svgElement()?.nativeElement){console.warn("[Slider Widget] SVG element is not initialized yet.");return}let e=this.svgElement().nativeElement.getBoundingClientRect(),t=this.LINE_START/this.VIEWBOX_WIDTH*e.width,i=this.LINE_WIDTH/this.VIEWBOX_WIDTH*e.width;this.lineStartPx=t,this.lineWidthPx=i,this.lineEndPx=this.lineStartPx+this.lineWidthPx}updateHandlePosition(e){this.handlePosition=e,this.lineWidth=`${e-this.lineStart}px`}getPointerX(e){return e.clientX-this.svgElement().nativeElement.getBoundingClientRect().left}onPointerDown(e){this.isDragStarted=!0,this.onPointerMove(e),e.stopPropagation(),e.preventDefault()}onPointerMove(e){if(this.isDragStarted){let t=this.getPointerX(e);if(t>=this.lineStartPx&&t<=this.lineEndPx){let i=(t-this.lineStartPx)/this.lineWidthPx*this.LINE_WIDTH+this.LINE_START;this.updateHandlePosition(i),this.handlePosition<=this.LINE_START?this.pathValue=this.widgetProperties.config.displayScale.lower:this.handlePosition>=this.LINE_START+this.LINE_WIDTH?this.pathValue=this.widgetProperties.config.displayScale.upper:this.pathValue=this.mapPositionToValue(this.handlePosition),this.valueChange$.next(this.pathValue)}}}onPointerUp(e){this.isDragStarted=!1,this.valueChange$.next(this.pathValue)}onPointerLeave(e){this.isDragStarted&&(this.isDragStarted=!1,this.valueChange$.next(this.pathValue))}getColors(e){let t=this.colorMap.get(e)||this.colorMap.get("contrast");this.labelColor=t.label,this.barColor=t.bar}ngOnDestroy(){this.destroyDataStreams(),this.skRequestSub?.unsubscribe(),this.valueChange$.complete(),clearTimeout(this.debounceTimeout),clearTimeout(this.resizeTimeout)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["widget-slider"]],viewQuery:function(t,i){t&1&&ce(i.svgElement,Hf,5),t&2&&Xe()},features:[fe],decls:12,vars:9,consts:[["svgSlider",""],[3,"configChange","config","id"],[3,"text","color"],[1,"widgets-container",3,"onResize"],["width","100%","height","100%","viewBox","0 40 200 40"],["width","160","height","8","rx","4.5","id","rect3","x","20","y","56",1,"slider-bg-bar",2,"display","inline","stroke-width","1.57144"],["height","8","rx","4.5","id","rect3","x","20","y","56",2,"display","inline","stroke-width","1.57144"],["id","g22"],["cy","60","fill","#ffffff","id","circle3","r","19.549999",2,"display","inline","fill","#4d4d4d","fill-opacity","1","stroke","#8c8c8c","stroke-width","0.9","stroke-dasharray","none","stroke-opacity","1"],["cy","60","fill","#ffffff","id","circle3-3","r","17.950001",2,"display","inline","fill","#ffffff","fill-opacity","1","stroke","#e6e6e6","stroke-width","1.8","stroke-dasharray","none","stroke-opacity","0.97"],["cursor","pointer","width","200","height","40","x","0","y","40",2,"display","inline","fill","rgba(0, 0, 0, 0)","stroke","none","stroke-width","0.3","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0",3,"pointerdown","pointerup","pointermove","pointerleave"],[1,"widgetOverlay"]],template:function(t,i){if(t&1){let o=ee();v(0,"widget-host",1),Pe("configChange",function(l){return V(o),De(i.widgetProperties.config,l)||(i.widgetProperties.config=l),L(l)}),F("configChange",function(l){return V(o),L(i.updateConfig(l))}),B(1,"widget-title",2),v(2,"div",3),F("onResize",function(l){return V(o),L(i.onResized(l))}),dt(),v(3,"svg",4),B(4,"rect",5)(5,"rect",6),v(6,"g",7),B(7,"circle",8)(8,"circle",9),_(),v(9,"rect",10,0),F("pointerdown",function(l){return V(o),L(i.onPointerDown(l))})("pointerup",function(l){return V(o),L(i.onPointerUp(l))})("pointermove",function(l){return V(o),L(i.onPointerMove(l))})("pointerleave",function(l){return V(o),L(i.onPointerLeave(l))}),_()()(),ke(11,Gf,1,0,"div",11),_()}t&2&&(Ae("config",i.widgetProperties.config),j("id",i.widgetProperties.uuid),P(),j("text",i.widgetProperties.config.displayName)("color",i.labelColor),P(4),be("width",i.lineWidth)("fill",i.barColor),P(2),be("cx",i.handlePosition),P(),be("cx",i.handlePosition),P(3),Ge(i.dashboard.isDashboardStatic()?-1:11))},dependencies:[Re,tt,et,si],styles:[".widgets-container[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 20px}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent;z-index:21}.slider-bg-bar[_ngcontent-%COMP%]{fill:var(--mat-sys-inverse-on-surface)}"]})}return r})();var jf=["grid"];function Uf(r,n){if(r&1){let e=ee();v(0,"div",2)(1,"button",3),F("click",function(){V(e);let i=se();return L(i.saveLayoutChanges())}),v(2,"mat-icon"),E(3,"done"),_()(),v(4,"button",4),F("click",function(){V(e);let i=se();return L(i.cancelLayoutChanges())}),v(5,"mat-icon"),E(6,"close"),_()()()}}function qf(r,n){r&1&&B(0,"notification-badge")}function Yf(r,n){if(r&1&&(B(0,"dashboard-scroller",5),ke(1,qf,1,0,"notification-badge")),r&2){let e=se();j("activePage",e.dashboard.activeDashboard())("dashboards",e.dashboard.dashboards()),P(),Ge(e.notificationsInfo().alarmCount>0?1:-1)}}var vs=(()=>{class r{_app=M(ii);_dialog=M(Qn);dashboard=M(lt);_notifications=M(Yi);_destroyRef=M(cl);_uiEvent=M(Xn);notificationsInfo=Wt(this._notifications.observerNotificationsInfo());isDashboardStatic=Wt(this.dashboard.isDashboardStatic$);_gridstack;_previousIsStaticState=!0;gridOptions={margin:4,minRow:12,maxRow:12,float:!0,acceptWidgets:!1,resizable:{handles:"all"}};constructor(){un.addComponentToSelectorType([ec,Jd,tc,oc,bh,ch,uh,sh,ph,ih,lc,eh,vh,fh,_h,kh,gh,Sh,Ch]),Fe(()=>{this.loadDashboard(this.dashboard.activeDashboard())})}ngAfterViewInit(){this.dashboard.isDashboardStatic$.pipe(Na(this._destroyRef)).subscribe(e=>{e?(this._gridstack.grid.setStatic(e),e!==this._previousIsStaticState&&(this.saveDashboard(),this._previousIsStaticState=e)):(this._gridstack.grid.setStatic(e),this._previousIsStaticState=e)}),this.dashboard.widgetAction$.pipe(Na(this._destroyRef)).subscribe(e=>{e&&this._gridstack.grid.getGridItems().forEach(t=>{if(t.gridstackNode.id===e.id)switch(e.operation){case"delete":this.deleteWidget(t);break;case"duplicate":this.duplicateWidget(t);break;default:break}})}),this.resizeGridColumns(),this._uiEvent.addHotkeyListener((e,t)=>this.handleKeyDown(e,t),{ctrlKey:!0,keys:["arrowdown","arrowup"]}),setTimeout(()=>{this.loadDashboard(this.dashboard.activeDashboard())})}ngOnDestroy(){this._gridstack?.grid&&this._gridstack.grid.destroy(!0),this._gridstack=null,this._uiEvent.removeHotkeyListener(this.handleKeyDown.bind(this))}handleKeyDown(e,t){e==="arrowdown"?this.previousDashboard(t):e==="arrowup"&&this.nextDashboard(t)}resizeGridColumns(){this._gridstack.grid.cellHeight(window.innerHeight/this._gridstack.grid.getRow())}loadDashboard(e){let t=this.dashboard.dashboards()[e];this._gridstack.grid?.load(t.configuration)}saveDashboard(){let e=this._gridstack.grid.save(!1,!1)||null;this.dashboard.updateConfiguration(this.dashboard.activeDashboard(),e)}saveLayoutChanges(){this.dashboard.setStaticDashboard(!0)}cancelLayoutChanges(){this.loadDashboard(this.dashboard.activeDashboard()),this.dashboard.setStaticDashboard(!0)}addNewWidget(e){if(!this.dashboard.isDashboardStatic()){let t=e.center.x,i=e.center.y,o=this._gridstack.grid.getCellFromPixel({left:t,top:i});this._gridstack.grid.isAreaEmpty(o.x,o.y,1,1)&&(this._gridstack.grid.willItFit({x:o.x,y:o.y,w:2,h:3})?this._dialog.openFrameDialog({title:"Add Widget",component:"select-widget"},!0).subscribe(l=>{if(!l)return;let d=Vn.create(),f={x:o.x,y:o.y,w:2,h:3,id:d,selector:l,input:{widgetProperties:{type:l,uuid:d}}};this._gridstack.grid.addWidget(f)}):this._app.sendSnackbarNotification("Add Widget Error: Not enough space at the selected location. Please reorganize the dashboard to free up space or choose a larger empty area.",0))}}duplicateWidget(e){let t=Vn.create(),i=e.gridstackNode,o={w:i.w,h:i.h,id:t,selector:i.selector,input:{widgetProperties:{type:i.input.widgetProperties.type,uuid:t,config:Fn(i.input.widgetProperties.config)}}};this._gridstack.grid.willItFit(o)?this._gridstack.grid.addWidget(o):(o.h=2,o.w=2,this._gridstack.grid.willItFit(o)?this._gridstack.grid.addWidget(o):this._app.sendSnackbarNotification("Duplication failed: Insufficient space on the dashboard. Please reorganize to free up space.",0))}deleteWidget(e){this._gridstack.grid.removeWidget(e)}nextDashboard(e){e.preventDefault(),this.dashboard.isDashboardStatic()&&this.dashboard.nextDashboard()}previousDashboard(e){e.preventDefault(),this.dashboard.isDashboardStatic()&&this.dashboard.previousDashboard()}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["dashboard"]],viewQuery:function(t,i){if(t&1&&Je(jf,7),t&2){let o;je(o=Ue())&&(i._gridstack=o.first)}},decls:4,vars:2,consts:[["grid",""],[3,"swipeup","swipedown","press","resize","options"],[1,"edit-layout-close-icon"],["mat-fab","",1,"layout-action-btn",2,"margin-right","10px",3,"click"],["mat-fab","",1,"layout-action-btn",3,"click"],[3,"activePage","dashboards"]],template:function(t,i){if(t&1){let o=ee();v(0,"gridstack",1,0),F("swipeup",function(l){return V(o),L(i.previousDashboard(l))})("swipedown",function(l){return V(o),L(i.nextDashboard(l))})("press",function(l){return V(o),L(i.addNewWidget(l))})("resize",function(){return V(o),L(i.resizeGridColumns())},!1,pl),_(),ke(2,Uf,7,0,"div",2)(3,Yf,2,3)}t&2&&(j("options",i.gridOptions),P(2),Ge(i.dashboard.isDashboardStatic()?3:2))},dependencies:[Ud,un,Yd,Bt,ki,hi,so,Kd],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;height:100%;width:100%}.grid-stack[_ngcontent-%COMP%]{width:100%}.edit-layout-close-icon[_ngcontent-%COMP%]{position:absolute;bottom:20px;right:20px;cursor:pointer;z-index:100}.layout-action-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary);background-color:var(--mat-sys-primary)}"]})}return r})();var xh=[{path:"dashboard",component:vs},{path:"settings",loadComponent:()=>import("./chunk-ESVJJ726.js").then(r=>r.AppSettingsComponent)},{path:"help",loadComponent:()=>import("./chunk-LMRTNYJV.js").then(r=>r.AppHelpComponent)},{path:"data",loadComponent:()=>import("./chunk-RNM4H3MR.js").then(r=>r.DataInspectorComponent)},{path:"dashboards",loadComponent:()=>import("./chunk-4JDFLZMM.js").then(r=>r.DashboardsEditorComponent)},{path:"datasets",loadComponent:()=>import("./chunk-AGPPRVTP.js").then(r=>r.SettingsDatasetsComponent)},{path:"configurations",loadComponent:()=>import("./chunk-JO7KJNQK.js").then(r=>r.SettingsConfigComponent)},{path:"login",loadComponent:()=>import("./chunk-T4AQJP2M.js").then(r=>r.WidgetLoginComponent)},{path:"**",component:vs}];var Th={production:!0};var Rh=wr(Qa());function Qf(r,n){if(r&1){let e=ee();v(0,"div",1)(1,"button",2),F("click",function(){V(e);let i=se();return L(i.action())}),E(2),_()()}if(r&2){let e=se();P(2),at(" ",e.data.action," ")}}var Xf=["label"];function Kf(r,n){}var $f=Math.pow(2,31)-1,Ir=class{_overlayRef;instance;containerInstance;_afterDismissed=new bt;_afterOpened=new bt;_onAction=new bt;_durationTimeoutId;_dismissedByAction=!1;constructor(n,e){this._overlayRef=e,this.containerInstance=n,n._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(n){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(n,$f))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},Eh=new Rn("MatSnackBarData"),ur=class{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},Zf=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275dir=bi({type:r,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return r})(),Jf=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275dir=bi({type:r,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return r})(),eg=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275dir=bi({type:r,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return r})(),tg=(()=>{class r{snackBarRef=M(Ir);data=M(Eh);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(t,i){t&1&&(v(0,"div",0),E(1),_(),ke(2,Qf,3,1,"div",1)),t&2&&(P(),at(" ",i.data.message,`
230
230
  `),P(),Ge(i.hasAction?2:-1))},dependencies:[ni,Zf,Jf,eg],styles:[`.mat-mdc-simple-snack-bar{display:flex}
231
231
  `],encapsulation:2,changeDetection:0})}return r})(),ys="_mat-snack-bar-enter",bs="_mat-snack-bar-exit",ig=(()=>{class r extends ad{_ngZone=M(ut);_elementRef=M(Ee);_changeDetectorRef=M(zn);_platform=M(jn);_rendersRef;_animationsDisabled=M(Ai,{optional:!0})==="NoopAnimations";snackBarConfig=M(ur);_document=M(Vi);_trackedModals=new Set;_enterFallback;_exitFallback;_renders=new bt;_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new bt;_onExit=new bt;_onEnter=new bt;_animationState="void";_live;_label;_role;_liveElementId=M(ao).getId("mat-snack-bar-container-live-");constructor(){super();let e=this.snackBarConfig;e.politeness==="assertive"&&!e.announcementMessage?this._live="assertive":e.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert")),this._rendersRef=ml(()=>this._renders.next(),{manualCleanup:!0})}attachComponentPortal(e){this._assertNotAttached();let t=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),t}attachTemplatePortal(e){this._assertNotAttached();let t=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),t}attachDomPortal=e=>{this._assertNotAttached();let t=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),t};onAnimationEnd(e){e===bs?this._completeExit():e===ys&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?this._renders.pipe(kr(1)).subscribe(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(ys)))}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(ys)},200)))}exit(){return this._destroyed?nl(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?this._renders.pipe(kr(1)).subscribe(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(bs)))}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(bs),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit(),this._renders.complete(),this._rendersRef.destroy()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,t=this.snackBarConfig.panelClass;t&&(Array.isArray(t)?t.forEach(a=>e.classList.add(a)):e.classList.add(t)),this._exposeToModals();let i=this._label.nativeElement,o="mdc-snackbar__label";i.classList.toggle(o,!i.querySelector(`.${o}`))}_exposeToModals(){let e=this._liveElementId,t=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let i=0;i<t.length;i++){let o=t[i],a=o.getAttribute("aria-owns");this._trackedModals.add(o),a?a.indexOf(e)===-1&&o.setAttribute("aria-owns",a+" "+e):o.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let t=e.getAttribute("aria-owns");if(t){let i=t.replace(this._liveElementId,"").trim();i.length>0?e.setAttribute("aria-owns",i):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let e=this._elementRef.nativeElement,t=e.querySelector("[aria-hidden]"),i=e.querySelector("[aria-live]");if(t&&i){let o=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(o=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),o?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["mat-snack-bar-container"]],viewQuery:function(t,i){if(t&1&&(Je(za,7),Je(Xf,7)),t&2){let o;je(o=Ue())&&(i._portalOutlet=o.first),je(o=Ue())&&(i._label=o.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(t,i){t&1&&F("animationend",function(a){return i.onAnimationEnd(a.animationName)})("animationcancel",function(a){return i.onAnimationEnd(a.animationName)}),t&2&&Nt("mat-snack-bar-container-enter",i._animationState==="visible")("mat-snack-bar-container-exit",i._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!i._animationsDisabled)},features:[fe],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){t&1&&(v(0,"div",1)(1,"div",2,0)(3,"div",3),ke(4,Kf,0,0,"ng-template",4),_(),B(5,"div"),_()()),t&2&&(P(5),be("aria-live",i._live)("role",i._role)("id",i._liveElementId))},dependencies:[za],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mdc-snackbar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mdc-snackbar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mdc-snackbar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mdc-snackbar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
232
232
  `],encapsulation:2})}return r})();function ng(){return new ur}var rg=new Rn("mat-snack-bar-default-options",{providedIn:"root",factory:ng}),Ah=(()=>{class r{_overlay=M(cd);_live=M(Zl);_injector=M(on);_breakpointObserver=M(ro);_parentSnackBar=M(r,{optional:!0,skipSelf:!0});_defaultConfig=M(rg);_snackBarRefAtThisLevel=null;simpleSnackBarComponent=tg;snackBarContainerComponent=ig;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,t){return this._attach(e,t)}openFromTemplate(e,t){return this._attach(e,t)}open(e,t="",i){let o=$($({},this._defaultConfig),i);return o.data={message:e,action:t},o.announcementMessage===e&&(o.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,o)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,t){let i=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=on.create({parent:i||this._injector,providers:[{provide:ur,useValue:t}]}),a=new Ba(this.snackBarContainerComponent,t.viewContainerRef,o),l=e.attach(a);return l.instance.snackBarConfig=t,l.instance}_attach(e,t){let i=$($($({},new ur),this._defaultConfig),t),o=this._createOverlay(i),a=this._attachSnackBarContainer(o,i),l=new Ir(a,o);if(e instanceof fl){let d=new od(e,null,{$implicit:i.data,snackBarRef:l});l.instance=a.attachTemplatePortal(d)}else{let d=this._createInjector(i,l),f=new Ba(e,void 0,d),s=a.attachComponentPortal(f);l.instance=s.instance}return this._breakpointObserver.observe(ho.HandsetPortrait).pipe(Gt(o.detachments())).subscribe(d=>{o.overlayElement.classList.toggle(this.handsetCssClass,d.matches)}),i.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(i.announcementMessage,i.politeness)}),this._animateSnackBar(l,i),this._openedSnackBarRef=l,this._openedSnackBarRef}_animateSnackBar(e,t){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),t.announcementMessage&&this._live.clear()}),t.duration&&t.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(t.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let t=new dd;t.direction=e.direction;let i=this._overlay.position().global(),o=e.direction==="rtl",a=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!o||e.horizontalPosition==="end"&&o,l=!a&&e.horizontalPosition!=="center";return a?i.left("0"):l?i.right("0"):i.centerHorizontally(),e.verticalPosition==="top"?i.top("0"):i.bottom("0"),t.positionStrategy=i,this._overlay.create(t)}_createInjector(e,t){let i=e&&e.viewContainerRef&&e.viewContainerRef.injector;return on.create({parent:i||this._injector,providers:[{provide:Ir,useValue:t},{provide:Eh,useValue:e.data}]})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=ot({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var og=(r,n)=>n.path;function ag(r,n){r&1&&(v(0,"mat-icon"),E(1,"info"),_())}function sg(r,n){r&1&&(v(0,"mat-icon"),E(1,"info"),_())}function lg(r,n){r&1&&(v(0,"mat-icon",3),E(1,"report"),_())}function dg(r,n){r&1&&(v(0,"mat-icon",4),E(1,"warning"),_())}function cg(r,n){r&1&&(v(0,"mat-icon",5),E(1,"error"),_())}function hg(r,n){r&1&&(v(0,"mat-icon",6),E(1,"emergency_home"),_())}function ug(r,n){if(r&1){let e=ee();v(0,"div",2),ke(1,ag,2,0,"mat-icon")(2,sg,2,0,"mat-icon")(3,lg,2,0,"mat-icon",3)(4,dg,2,0,"mat-icon",4)(5,cg,2,0,"mat-icon",5)(6,hg,2,0,"mat-icon",6),v(7,"div",7),E(8),_(),v(9,"div",8),E(10),Jr(11,"slice"),_(),v(12,"div",9),E(13),_(),v(14,"button",10),F("click",function(){let i=V(e).$implicit,o=se();return L(o.silence(i.path))}),v(15,"mat-icon"),E(16,"music_off"),_()(),v(17,"button",11),F("click",function(){let i=V(e).$implicit,o=se();return L(o.clear(i.path))}),v(18,"mat-icon"),E(19,"published_with_changes"),_()()(),B(20,"mat-divider",12)}if(r&2){let e,t=n.$implicit;P(),Ge((e=t.value.state)==="nominal"?1:e==="normal"?2:e==="alert"?3:e==="warn"?4:e==="alarm"?5:e==="emergency"?6:-1),P(7),xt(t.value.state),P(2),xt(El(11,5,t.path,14)),P(3),xt(t.value.message),P(),j("disabled",!t.value.method.includes("sound"))}}function mg(r,n){r&1&&(v(0,"mat-list-item",13)(1,"span",15),E(2,"Notifications Disabled"),_(),v(3,"span")(4,"i"),E(5,"*Enable notifications in Settings."),_()()())}function pg(r,n){r&1&&(v(0,"mat-list-item",14)(1,"i"),E(2,'"No Notification"'),_()())}function fg(r,n){if(r&1&&ke(0,mg,6,0,"mat-list-item",13)(1,pg,3,0,"mat-list-item",14),r&2){let e=se();Ge(e.notificationConfig().disableNotifications?0:1)}}function gg(r,n){if(r&1){let e=ee();v(0,"button",17),F("click",function(){V(e);let i=se(2);return L(i.mutePlayer(!i.isMuted))}),v(1,"span",18),E(2,"volume_up"),_(),E(3," Unmute Audio "),_()}}function vg(r,n){if(r&1){let e=ee();v(0,"button",17),F("click",function(){V(e);let i=se(2);return L(i.mutePlayer(!i.isMuted))}),v(1,"span",18),E(2,"volume_off"),_(),E(3," Mute Audio "),_()}}function yg(r,n){if(r&1&&ke(0,gg,4,0,"button",16)(1,vg,4,0,"button",16),r&2){let e=se();Ge(e.isMuted?0:1)}}var Dh=(()=>{class r{_notificationsService=M(Yi);_notifications$=this._notificationsService.observeNotifications();notificationConfig=Wt(this._notificationsService.observeNotificationConfiguration(),{requireSync:!0});menuNotifications=Wt(this._notifications$.pipe(Ht(e=>{let t=[];return this.notificationConfig().devices.showNormalState||t.push(te.Normal),this.notificationConfig().devices.showNominalState||t.push(te.Nominal),e.filter(i=>i.value&&i.value.state&&!t.includes(i.value.state))}),Ht(e=>e.filter(t=>t.value&&t.value.method&&t.value.method.includes(Hn.Visual)))),{requireSync:!0,equal:Cr});isMuted=!1;mutePlayer(e){this.isMuted=e,this._notificationsService.mutePlayer(e)}silence(e){this._notificationsService.setSkMethod(e,[Hn.Visual])}clear(e){this._notificationsService.setSkState(e,te.Normal)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=G({type:r,selectors:[["menu-notifications"]],decls:6,vars:2,consts:[[1,"menu-item-container"],[1,"actions-container","actions-bottom-container"],[1,"notification-container"],[1,"icon-alert-color"],[1,"icon-warn-color"],[1,"icon-alarm-color"],[1,"icon-emergency-color"],[1,"notification-title"],[1,"notification-path","scrollable-text"],[1,"notification-text"],["mat-icon-button","",1,"notification-action-btn",3,"click","disabled"],["mat-icon-button","",1,"notification-action-btn",3,"click"],[1,"notification-divider"],["lines","3","disabled","true",2,"text-align","center"],["disabled","true",2,"text-align","center"],["matListItemTitle",""],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button"],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button",3,"click"],[1,"material-icons"]],template:function(t,i){t&1&&(v(0,"mat-list",0),Bi(1,ug,21,8,null,null,og,!1,fg,2,1),_(),v(4,"div",1),ke(5,yg,2,1),_()),t&2&&(P(),zi(i.menuNotifications()),P(4),Ge(i.notificationConfig().disableNotifications?-1:5))},dependencies:[mo,wd,uo,md,yd,hi,ni,nd,Eo,Nd,Rd,Bt,ki,Pl],styles:[".notification-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-evenly;padding:2px 10px 7px;overflow-y:scroll;overflow-x:hidden;scroll-behavior:smooth}mat-icon[_ngcontent-%COMP%]{margin-right:10px}.scrollable-text[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.scrollable-text[_ngcontent-%COMP%]:hover{overflow:auto;white-space:normal;word-wrap:break-word}.notification-title[_ngcontent-%COMP%]{text-transform:capitalize;font-size:var(--mat-sys-headline-small-size);width:calc(100% - 34px)}.notification-path[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-size);word-break:break-all;width:100%}.notification-text[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-line-height);font-style:italic;width:100%;overflow:auto;white-space:normal;word-wrap:break-word}.notification-action-btn[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container)}.notification-btn-container[_ngcontent-%COMP%]{display:inline-block;width:50%;height:48px;text-align:center}.menu-item-container[_ngcontent-%COMP%]{width:230px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;height:calc(100% - 48px)}.notification-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;background-color:var(--mat-sys-surface-container)}.actions-container[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column}.actions-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;height:48px}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large))}.icon-alert-color[_ngcontent-%COMP%]{color:var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{color:var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{color:var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:transparent}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.notification-divider[_ngcontent-%COMP%]{padding-top:10px}"]})}return r})();var Uo=["*"],_g=["content"],wg=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],kg=["mat-drawer","mat-drawer-content","*"];function Sg(r,n){if(r&1){let e=ee();v(0,"div",1),F("click",function(){V(e);let i=se();return L(i._onBackdropClicked())}),_()}if(r&2){let e=se();Nt("mat-drawer-shown",e._isShowingBackdrop())}}function Cg(r,n){r&1&&(v(0,"mat-drawer-content"),Ct(1,2),_())}var xg=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],Tg=["mat-sidenav","mat-sidenav-content","*"];function Eg(r,n){if(r&1){let e=ee();v(0,"div",1),F("click",function(){V(e);let i=se();return L(i._onBackdropClicked())}),_()}if(r&2){let e=se();Nt("mat-drawer-shown",e._isShowingBackdrop())}}function Ag(r,n){r&1&&(v(0,"mat-sidenav-content"),Ct(1,2),_())}var Dg=`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}