UNPKG

@mxtommy/kip

Version:

An advanced and versatile marine instrumentation package to display Signal K data.

1 lines 1.14 MB
import{$ as As,A as bs,B as po,C as Ji,D as Hl,E as ys,F as nr,G as ql,H as ar,I as or,J as go,K as fo,L as $l,M as jl,N as vo,O as rr,P as Yl,Q as $u,R as ju,S as Yu,T as ia,U as na,V as bo,W as Dt,X as aa,Y as oa,Z as yo,_ as Ku,a as ei,aa as Cs,b as fi,ba as Xu,c as Fi,ca as Zu,d as Fu,da as ra,e as Bu,ea as An,f as Gu,g as gs,h as zu,i as Uu,j as Hu,k as qu,l as St,m as ka,n as Zi,o as ea,p as Da,q as Rn,r as bn,s as yn,t as Qi,u as ta,v as Ci,w as fs,x as vs,y as ho,z as Ea}from"./chunk-NS2OV2OW.js";import{a as Wu,b as ps,c as vi}from"./chunk-W6MCE3GH.js";import{a as Qu,b as Ju,c as em,d as tm,e as im}from"./chunk-JMZYPL54.js";import{a as jt,b as gi,c as He,e as Ao,f as Co}from"./chunk-ACY7HYMZ.js";import{a as Iu,b as Pu,c as Ru,d as mo,e as Nu,f as Rt,g as Ou,h as Vu,k as Lu,m as ir,o as J,p as Ul,r as st}from"./chunk-IXUKD73N.js";import{b as Au,e as Cu,f as us}from"./chunk-VFJD3XKT.js";import{a as Li,b as Wi}from"./chunk-HF7V6XFA.js";import{a as Su,b as wu,c as _u,d as fn,e as pi,g as Mu,h as Pi,i as Ri,j as Ni,k as Kn,l as Qt,n as At,o as Qn,p as Du,q as Jn,s as Eu,u as Ct,v as qt,w as xt,x as $t}from"./chunk-ILQQCGMJ.js";import{A as Xn,B as ro,C as Oi,D as so,E as Pn,F as Vi,G as lo,H as co,I as Jt,J as rt,K as uo,L as vn,M as Pt,O as Zn,P as Ot,Q as yt,a as Di,b as Hc,d as Yt,e as Ei,f as fu,i as cs,j as vu,k as bu,l as yu,m as Ht,n as gn,o as ms,p as bt,r as mt,t as ot,u as Mt,v as Tu,w as Xi,x as hs,y as ku,z as We}from"./chunk-2TP7C66X.js";import{$ as zr,$a as Xr,$b as Lt,Aa as Rc,Ab as zt,Ad as rs,Ba as Ie,Bb as ye,Bc as z,Be as lu,Cb as Ae,Cc as L,D as xc,Da as hi,Db as R,Dc as Wc,Dd as ao,De as du,E as Sc,Ea as Je,Eb as d,Ec as Fc,Ee as cu,Fb as u,Fc as ft,Fe as uu,Ga as w,Gb as O,Gc as x,H as xa,Ha as W,Hb as D,Hc as he,I as Fr,Ia as dn,Ib as G,Id as oo,Ie as mu,J as wi,Jb as ee,Jc as ns,Je as hu,K as _i,Kb as un,La as nt,Lb as mn,Lc as ki,Ld as Zc,Le as pu,Mb as Jr,Nb as we,Nc as It,O as wc,Ob as ji,Od as Qc,P as qn,Pb as $,Pd as Ta,Pe as gu,Q as mi,Qa as Yr,Qb as Jo,Qd as jn,Qe as De,Ra as Kr,Rb as T,Rd as Jc,Re as Ii,S as _c,Sa,Sb as es,Se as xu,T as Mc,Tb as ts,Td as zl,Te as je,U as Br,Ub as is,Ud as ss,Ue as Xe,V as Gr,Vb as $n,Vd as eu,Wa as f,Wb as Mi,Xb as Ti,Xc as Bc,Xd as Ki,Ya as Nc,Yc as Gc,Z as Tc,Za as Oc,Zb as _e,Zc as zc,Zd as pn,_ as kc,_b as Me,a as Z,aa as Ur,ab as wa,ac as Te,ad as as,b as ge,ba as Dc,bc as dt,bd as hn,ca as to,cc as _a,ce as tu,d as u0,da as Hr,db as Zr,dc as ct,dd as io,de as iu,e as fc,ea as qr,ec as c,ee as _t,f as Le,fa as $r,fc as Q,fd as Uc,fe as ls,g as eo,ga as Ec,gb as H,gc as be,ge as Yn,ha as Ic,hb as cn,hc as Ut,he as nu,ib as Gt,ie as vt,j as Fl,jb as Qr,k as Zt,ka as jr,kb as Vc,kc as Mn,ke as ds,la as gt,lb as Qo,lc as Tn,ld as qc,le as et,m as sn,ma as ln,mb as Ai,mc as kn,md as $c,n as vc,nb as Lc,nc as Ma,nd as jc,ne as au,oa as _n,oc as Dn,pc as En,q as bc,qa as A,qc as Yi,r as yc,rc as Gl,rd as Yc,re as ou,s as Bl,sc as er,se as ru,t as Ac,ta as Pc,tc as tr,td as os,ud as Kc,va as ne,vb as ie,vc as ut,vd as Xc,w as Wr,wa as ae,wc as Et,x as Hn,xa as oe,xb as I,xc as In,xd as no,y as Cc,ya as Ue,yb as P,z as si,za as Zo,zb as Re,ze as su}from"./chunk-LEY6MANN.js";var Vd=u0((zW,gl)=>{(function(n){"use strict";function a(g){if(Array.isArray(g)){for(var p=0,b=Array(g.length);p<g.length;p++)b[p]=g[p];return b}return Array.from(g)}function e(g,p){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!p||typeof p!="object"&&typeof p!="function"?g:p}function t(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);g.prototype=Object.create(p&&p.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(g,p):g.__proto__=p)}function i(g,p){if(!(g instanceof p))throw new TypeError("Cannot call a class as a function")}function o(g,p){if(p||(p=typeof window>"u"?global:window),p[g]!==void 0)return p[g];if(Lr===null){var b=window.getComputedStyle(document.documentElement,"");Lr=(Array.prototype.slice.call(b).join("").match(/-(moz|webkit|ms)-/)||b.OLink===""&&["","o"]||["",""])[1]}if(Lr==="")return null;var M=g.charAt(0).toUpperCase()+g.substr(1),k=p[Lr+M];return k!==void 0?k:null}function r(g,p,b,M,k,V,q){if(typeof M!="function")throw new TypeError("Invalid animation rule:",M);var K=g-b,Y=K/k,X=0;Y>1&&(Y=1),Y!==1&&(X=M(Y),isFinite(X)&&!isNaN(X)&&(Y=X)),p&&p(Y),K<k?q.frame=uc(function(fe){return r(fe,p,b,M,k,V,q)}):(V&&V(),q.inProgress=!1)}function s(){Array.prototype.constructor.apply(this,arguments)}function l(g){if(!(g instanceof DOMException&&g.result===2152923147))throw g}function m(g,p){return p.replace(l0,function(b,M){var k=g[M];return k!==void 0?k:b})}function h(g){return g.majorTicks instanceof Array||(g.majorTicks=g.majorTicks?[g.majorTicks]:[]),g.majorTicks.length||(g.majorTicks.push(ke.formatMajorTickNumber(g.minValue,g)),g.majorTicks.push(ke.formatMajorTickNumber(g.maxValue,g))),[g.tickSide!=="right",g.tickSide!=="left"]}function v(g,p,b,M,k,V){g.beginPath(),g.moveTo(p+V,b),g.lineTo(p+M-V,b),g.quadraticCurveTo(p+M,b,p+M,b+V),g.lineTo(p+M,b+k-V),g.quadraticCurveTo(p+M,b+k,p+M-V,b+k),g.lineTo(p+V,b+k),g.quadraticCurveTo(p,b+k,p,b+k-V),g.lineTo(p,b+V),g.quadraticCurveTo(p,b,p+V,b),g.closePath()}function y(g,p){var b=p.valueDec,M=p.valueInt,k=0,V=void 0,q=void 0,K=void 0;if(g=parseFloat(g),K=g<0,g=Math.abs(g),b>0){for(q=g.toFixed(b).toString().split("."),V=M-q[0].length;k<V;++k)q[0]="0"+q[0];q=(K?"-":"")+q[0]+"."+q[1]}else{for(q=Math.round(g).toString(),V=M-q.length;k<V;++k)q="0"+q;q=(K?"-":"")+q}return q}function C(g,p){var b=void 0,M=!1;return b=p.majorTicksDec===0?Math.round(g).toString():g.toFixed(p.majorTicksDec),p.majorTicksInt>1?(M=~b.indexOf("."),~b.indexOf("-")?"-"+[p.majorTicksInt+p.majorTicksDec+2+(M?1:0)-b.length].join("0")+b.replace("-",""):[p.majorTicksInt+p.majorTicksDec+1+(M?1:0)-b.length].join("0")+b):b}function S(g){return g*Math.PI/180}function _(g,p){return{x:-g*Math.sin(p),y:g*Math.cos(p)}}function F(g,p,b,M){var k=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],V=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,q=g.createLinearGradient(k?0:V,k?V:0,k?0:M,k?M:0);return q.addColorStop(0,p),q.addColorStop(1,b),q}function E(g,p){p.needleShadow&&(g.shadowOffsetX=2,g.shadowOffsetY=2,g.shadowBlur=10,g.shadowColor=p.colorNeedleShadowDown)}function N(g,p,b){return g["font"+p+"Style"]+" "+g["font"+p+"Weight"]+" "+g["font"+p+"Size"]*b+"px "+g["font"+p]}function U(g){g.shadowOffsetX=null,g.shadowOffsetY=null,g.shadowBlur=null,g.shadowColor="",g.strokeStyle=null,g.lineWidth=0,g.save()}function j(g,p,b,M){p.valueTextShadow&&(g.shadowOffsetX=b,g.shadowOffsetY=b,g.shadowBlur=M,g.shadowColor=p.colorValueTextShadow)}function B(g,p,b,M,k,V){if(p.valueBox){U(g);var q=p.valueDec?1+p.valueDec:0,K="9".repeat(Math.max.apply(null,[String(parseInt(b)).length+q].concat(p.majorTicks.map(function(Ke){return String(parseInt(Ke,10)).length+q})))),Y=p.valueText||y(b,p),X=V/200,fe=V/100,ve=.4*fe,Ee=1.2*fe;g.font=N(p,"Value",X),j(g,p,ve,Ee);var Pe=g.measureText(p.valueText?Y:"-"+y(Number(K),p)).width;U(g);var Ve=parseFloat(p.fontValueSize)*X+ve+Ee,it=fe*parseFloat(p.valueBoxStroke),Oe=2*V-2*it,Ze=Pe+10*fe,Qe=1.1*Ve+ve+Ee,at=fe*p.valueBoxBorderRadius,$e=(parseFloat(p.valueBoxWidth)||0)/100*Oe;$e>Ze&&(Ze=$e),Ze>Oe&&(Ze=Oe);var Ye=M-Ze/2,ze=k-Qe/2,Ne=k-5.75*fe;if(g.beginPath(),at?v(g,Ye,ze,Ze,Qe,at):g.rect(Ye,ze,Ze,Qe),it){var Fe=g.createRadialGradient(M,Ne,10*fe,M,Ne,20*fe);Fe.addColorStop(0,p.colorValueBoxRect),Fe.addColorStop(1,p.colorValueBoxRectEnd),g.strokeStyle=Fe,g.lineWidth=it,g.stroke()}p.colorValueBoxShadow&&(g.shadowBlur=1.2*fe,g.shadowColor=p.colorValueBoxShadow),p.colorValueBoxBackground&&(g.fillStyle=p.colorValueBoxBackground,g.fill()),g.closePath(),g.restore(),j(g,p,ve,Ee),g.fillStyle=p.colorValueText,g.textAlign="center",g.textBaseline="alphabetic",g.fillText(Y,Ye+Ze/2,k+Qe/2-Ve/3),g.restore()}}function re(g){var p=g.value,b=g.minValue,M=g.maxValue,k=.01*(M-b);return{normal:p<b?b:p>M?M:p,indented:p<b?b-k:p>M?M+k:p}}function pe(g,p,b,M,k){b.beginPath(),b.arc(0,0,$i(g),0,2*Ko,!0),b.lineWidth=p,b.strokeStyle=k?ke.linearGradient(b,M,k,g):M,b.stroke(),b.closePath()}function te(g,p){var b=qi.pixelRatio;return g.maxRadius||(g.maxRadius=g.max-p.borderShadowWidth-p.borderOuterWidth*b-p.borderMiddleWidth*b-p.borderInnerWidth*b+(p.borderOuterWidth?.5:0)+(p.borderMiddleWidth?.5:0)+(p.borderInnerWidth?.5:0)),g.maxRadius}function se(g,p){function b(ve,Ee,Pe,Ve,it,Oe){return Ee&&(!Oe&&p.borderShadowWidth&&(Pe.save(),Pe.shadowBlur=p.borderShadowWidth,Pe.shadowColor=p.colorBorderShadow),pe(ve,Ee*M,Pe,Ve,it),!Oe&&p.borderShadowWidth&&(Oe=!0,Pe.restore())),Oe}var M=qi.pixelRatio,k=p.borderShadowWidth*M,V=g.max-k-p.borderOuterWidth*M/2,q=V-p.borderOuterWidth*M/2-p.borderMiddleWidth*M/2+.5,K=q-p.borderMiddleWidth*M/2-p.borderInnerWidth*M/2+.5,Y=te(g,p),X=void 0,fe=!1;g.save(),fe=b(V,p.borderOuterWidth,g,p.colorBorderOuter,p.colorBorderOuterEnd,fe),fe=b(q,p.borderMiddleWidth,g,p.colorBorderMiddle,p.colorBorderMiddleEnd,fe),fe=b(K,p.borderInnerWidth,g,p.colorBorderInner,p.colorBorderInnerEnd,fe),!fe&&p.borderShadowWidth&&(g.shadowBlur=p.borderShadowWidth,g.shadowColor=p.colorBorderShadow),g.beginPath(),g.arc(0,0,$i(Y),0,2*Ko,!0),p.colorPlateEnd?(X=g.createRadialGradient(0,0,Y/2,0,0,Y),X.addColorStop(0,p.colorPlate),X.addColorStop(1,p.colorPlateEnd)):X=p.colorPlate,g.fillStyle=X,g.fill(),g.closePath(),g.restore()}function de(g,p){if(p.highlights!=="false"&&p.highlights.length&&p.highlightsWidth!==0){var b=g.max*(parseFloat(p.highlightsWidth)||0)/100,M=$i(ue(g,p)-b/2),k=p.highlights.length,V=(p.maxValue-p.minValue)/p.ticksAngle;g.save();for(var q=0;q<k;q++){var K=p.highlights[q];g.lineWidth=b,g.lineCap=p.highlightsLineCap,g.strokeStyle=K.color,g.beginPath(),g.rotate(Wl),g.arc(0,0,M,ke.radians(p.startAngle+(K.from-p.minValue)/V),ke.radians(p.startAngle+(K.to-p.minValue)/V),!1),g.stroke(),g.closePath(),g.restore(),g.save()}g.restore()}}function ce(g,p){var b=ue(g,p),M=void 0,k=void 0,V=void 0,q=0,K=Math.abs(p.minorTicks)||0,Y=p.ticksAngle/(p.maxValue-p.minValue);p.exactTicks?(k=p.maxValue-p.minValue,M=K?k/K:0,q=(rn.mod(p.majorTicks[0],K)||0)*Y):M=K*(p.majorTicks.length-1),g.lineWidth=qi.pixelRatio,g.strokeStyle=p.colorMinorTicks||p.colorStrokeTicks,g.save();for(var X=0;X<M;++X)(V=p.startAngle+q+X*(p.ticksAngle/M))<=p.ticksAngle+p.startAngle&&(g.rotate(ke.radians(V)),g.beginPath(),g.moveTo(0,b),g.lineTo(0,b-.075*g.max),qe(g));g.restore()}function ue(g,p){var b=g.max/100;return te(g,p)-5*b-(p.barWidth?2*(parseFloat(p.barStrokeWidth)||0)+((parseFloat(p.barWidth)||0)+5)*b:0)}function me(g,p){ke.prepareTicks(p);var b=$i(ue(g,p)),M=void 0,k=p.majorTicks.length,V=qi.pixelRatio;g.lineWidth=2*V,M=p.colorMajorTicks instanceof Array?p.colorMajorTicks:new Array(k).fill(p.colorStrokeTicks||p.colorMajorTicks);for(var q=0;q<k;++q)g.save(),g.strokeStyle=M[q],g.rotate(ke.radians(Se(p,p.exactTicks?p.majorTicks[q]:q,k))),g.beginPath(),g.moveTo(0,b),g.lineTo(0,b-.15*g.max),g.stroke(),g.closePath(),g.restore();p.strokeTicks&&(g.save(),g.strokeStyle=p.colorStrokeTicks||M[0],g.rotate(Wl),g.beginPath(),g.arc(0,0,b,ke.radians(p.startAngle),ke.radians(p.startAngle+p.ticksAngle),!1),g.stroke(),g.closePath(),g.restore())}function Se(g,p,b){if(g.exactTicks){var M=g.ticksAngle/(g.maxValue-g.minValue);return g.startAngle+M*(p-g.minValue)}return g.startAngle+p*(g.ticksAngle/(b-1))}function qe(g){g.stroke(),g.restore(),g.closePath(),g.save()}function pt(g,p){var b=ue(g,p)-.15*g.max,M={},k=0,V=p.majorTicks.length,q=p.animationTarget!=="needle",K=p.colorNumbers instanceof Array?p.colorNumbers:new Array(V).fill(p.colorNumbers),Y=q?-(p.value-p.minValue)/(p.maxValue-p.minValue)*p.ticksAngle:0;for(q&&(g.save(),g.rotate(-ke.radians(Y))),g.font=ke.font(p,"Numbers",g.max/200),g.lineWidth=0,g.textAlign="center",g.textBaseline="middle";k<V;++k){var X=Y+Se(p,p.exactTicks?p.majorTicks[k]:k,V),fe=g.measureText(p.majorTicks[k]).width,ve=p.fontNumbersSize,Ee=Math.sqrt(fe*fe+ve*ve)/2,Pe=ke.radialPoint(b-Ee-p.numbersMargin/100*g.max,ke.radians(X));X===360&&(X=0),M[X]||(M[X]=!0,g.fillStyle=K[k],g.fillText(p.majorTicks[k],Pe.x,Pe.y))}q&&g.restore()}function tt(g,p){p.title&&(g.save(),g.font=ke.font(p,"Title",g.max/200),g.fillStyle=p.colorTitle,g.textAlign="center",g.fillText(p.title,0,-g.max/4.25,.8*g.max),g.restore())}function Bt(g,p){p.units&&(g.save(),g.font=ke.font(p,"Units",g.max/200),g.fillStyle=p.colorUnits,g.textAlign="center",g.fillText(ke.formatContext(p,p.units),0,g.max/3.25,.8*g.max),g.restore())}function ri(g,p){if(p.needle){var b=p.animationTarget!=="needle",M=p.ticksAngle<360?ke.normalizedValue(p).indented:p.value,k=b?p.startAngle:p.startAngle+(M-p.minValue)/(p.maxValue-p.minValue)*p.ticksAngle;p.barStartPosition==="right"&&(k=p.startAngle+p.ticksAngle-(M-p.minValue)/(p.maxValue-p.minValue)*p.ticksAngle);var V=te(g,p),q=$i(V/100*p.needleCircleSize),K=$i(V/100*p.needleCircleSize*.75),Y=$i(V/100*p.needleEnd),X=$i(p.needleStart?V/100*p.needleStart:0),fe=V/100*p.needleWidth,ve=V/100*p.needleWidth/2,Ee=qi.pixelRatio;g.save(),ke.drawNeedleShadow(g,p),g.rotate(ke.radians(k)),g.fillStyle=ke.linearGradient(g,p.colorNeedle,p.colorNeedleEnd,Y-X),p.needleType==="arrow"?(g.beginPath(),g.moveTo(-ve,-X),g.lineTo(-fe,0),g.lineTo(-1*Ee,Y),g.lineTo(Ee,Y),g.lineTo(fe,0),g.lineTo(ve,-X),g.closePath(),g.fill(),g.beginPath(),g.lineTo(-.5*Ee,Y),g.lineTo(-1*Ee,Y),g.lineTo(-fe,0),g.lineTo(-ve,-X),g.lineTo(ve/2*Ee-2*Ee,-X),g.closePath(),g.fillStyle=p.colorNeedleShadowUp,g.fill()):(g.beginPath(),g.moveTo(-ve,Y),g.lineTo(-ve,X),g.lineTo(ve,X),g.lineTo(ve,Y),g.closePath(),g.fill()),g.restore(),p.needleCircleSize&&(g.save(),ke.drawNeedleShadow(g,p),p.needleCircleOuter&&(g.beginPath(),g.arc(0,0,q,0,2*Ko,!0),g.fillStyle=ke.linearGradient(g,p.colorNeedleCircleOuter,p.colorNeedleCircleOuterEnd,q),g.fill(),g.closePath()),p.needleCircleInner&&(g.beginPath(),g.arc(0,0,K,0,2*Ko,!0),g.fillStyle=ke.linearGradient(g,p.colorNeedleCircleInner,p.colorNeedleCircleInnerEnd,K),g.fill(),g.closePath()),g.restore())}}function Sn(g,p,b){ke.drawValueBox(g,p,b,0,g.max-.33*g.max,g.max)}function Un(g){var p=g.startAngle,b=g.startAngle+g.ticksAngle,M=p,k=p+(ke.normalizedValue(g).normal-g.minValue)/(g.maxValue-g.minValue)*g.ticksAngle;if(g.barStartPosition==="middle"){var V=.5*(g.minValue+g.maxValue);g.value<V?(M=180-(V-ke.normalizedValue(g).normal)/(g.maxValue-g.minValue)*g.ticksAngle,k=180):(M=180,k=180+(ke.normalizedValue(g).normal-V)/(g.maxValue-g.minValue)*g.ticksAngle)}else g.barStartPosition==="right"&&(M=b-k+p,k=b);return{startAngle:M,endAngle:k}}function wn(g,p){var b=g.max/100,M=te(g,p)-5*b,k=parseFloat(p.barStrokeWidth+"")||0,V=(parseFloat(p.barWidth+"")||0)*b,q=M-2*k-V,K=(M-q)/2,Y=q+K,X=k/Y,fe=p.startAngle,ve=p.startAngle+p.ticksAngle;if(g.save(),g.rotate(Wl),k&&(g.beginPath(),g.arc(0,0,Y,ke.radians(fe)-X,ke.radians(ve)+X,!1),g.strokeStyle=p.colorBarStroke,g.lineWidth=2*K,g.stroke(),g.closePath()),V&&(g.beginPath(),g.arc(0,0,Y,ke.radians(fe),ke.radians(ve),!1),g.strokeStyle=p.colorBar,g.lineWidth=V,g.stroke(),g.closePath(),p.barShadow&&(g.save(),g.beginPath(),g.arc(0,0,M,ke.radians(fe),ke.radians(ve),!1),g.clip(),g.beginPath(),g.strokeStyle=p.colorBar,g.lineWidth=1,g.shadowBlur=p.barShadow,g.shadowColor=p.colorBarShadow,g.shadowOffsetX=0,g.shadowOffsetY=0,g.arc(0,0,M,ke.radians(p.startAngle),ke.radians(p.startAngle+p.ticksAngle),!1),g.stroke(),g.closePath(),g.restore()),p.barProgress)){var Ee=Un(p),Pe=Ee.startAngle,Ve=Ee.endAngle;g.beginPath(),g.arc(0,0,Y,ke.radians(Pe),ke.radians(Ve),!1),g.strokeStyle=p.colorBarProgress,g.lineWidth=V,g.stroke(),g.closePath()}g.restore()}function Za(g){return g.options.animatedValue?g.options.value:g.value}function zo(g,p,b,M,k,V,q,K){g.beginPath(),g.fillStyle=K?ke.linearGradient(g,q,K,k>V?k:V,V>k,k>V?b:M):q,p>0?ke.roundRect(g,b,M,k,V,p):g.rect(b,M,k,V),g.fill(),g.closePath()}function Hi(g,p,b,M,k,V,q,K,Y){g.beginPath(),g.lineWidth=p,g.strokeStyle=Y?ke.linearGradient(g,K,Y,q,!0,k):K,b>0?ke.roundRect(g,M,k,V,q,b):g.rect(M,k,V,q),g.stroke(),g.closePath()}function Uo(g,p,b,M,k,V){function q(Ke,lt,wt,ui){return Ke&&(!ui&&p.borderShadowWidth&&(g.save(),g.shadowBlur=p.borderShadowWidth,g.shadowColor=p.colorBorderShadow),Hi(g,Ke*K,Y,b+Ke*K/2-Ne,M+Ke*K/2-Ne,X,Pe,lt,wt),Ne+=.5*K,!ui&&p.borderShadowWidth&&(ui=!0,g.restore())),ui}var K=qi.pixelRatio,Y=p.borderRadius*K,X=k-p.borderShadowWidth-p.borderOuterWidth*K,fe=X-p.borderOuterWidth*K-p.borderMiddleWidth*K,ve=fe-p.borderMiddleWidth*K-p.borderInnerWidth*K,Ee=ve-p.borderInnerWidth*K,Pe=V-p.borderShadowWidth-p.borderOuterWidth*K,Ve=Pe-p.borderOuterWidth*K-p.borderMiddleWidth*K,it=Ve-p.borderMiddleWidth*K-p.borderInnerWidth*K,Oe=it-p.borderInnerWidth*K,Ze=b-(fe-X)/2,Qe=Ze-(ve-fe)/2,at=Qe-(Ee-ve)/2,$e=M-(Ve-Pe)/2,Ye=$e-(it-Ve)/2,ze=Ye-(Oe-it)/2,Ne=0,Fe=!1;return g.save(),Fe=q(p.borderOuterWidth,p.colorBorderOuter,p.colorBorderOuterEnd,Fe),Fe=q(p.borderMiddleWidth,p.colorBorderMiddle,p.colorBorderMiddleEnd,Fe),Fe=q(p.borderInnerWidth,p.colorBorderInner,p.colorBorderInnerEnd,Fe),!Fe&&p.borderShadowWidth&&(g.shadowBlur=p.borderShadowWidth,g.shadowColor=p.colorBorderShadow),zo(g,Y,at,ze,Ee+2*Ne,Oe+2*Ne,p.colorPlate,p.colorPlateEnd),g.restore(),[at,ze,Ee,Oe]}function Ho(g,p,b,M,k,V){var q=qi.pixelRatio,K=V>=k,Y=K?.85*k:V,X=K?V:k;b=K?Ge(b+(k-Y)/2):b;var fe=!!p.title,ve=!!p.units,Ee=!!p.valueBox,Pe=void 0,Ve=void 0,it=void 0;K?(Ve=Ge(.05*X),Pe=Ge(.075*X),it=Ge(.11*X),fe&&(X-=Pe,M+=Pe),ve&&(X-=Ve),Ee&&(X-=it)):(Ve=Pe=Ge(.15*Y),fe&&(Y-=Pe,M+=Pe),ve&&(Y-=Ve));var Oe=2*p.barStrokeWidth,Ze=p.barBeginCircle?Ge(Y*p.barBeginCircle/200-Oe/2):0,Qe=Ge(Y*p.barWidth/100-Oe),at=Ge(X*p.barLength/100-Oe),$e=Ge((X-at)/2),Ye=Ge(b+(K?Y/2:$e+Ze)),ze=Ge(M+(K?X-$e-Ze+Oe/2:Y/2)),Ne=!K||p.hasLeft&&p.hasRight?0:(p.hasRight?-1:1)*p.ticksWidth/100*Y,Fe=K||p.hasLeft&&p.hasRight?0:(p.hasRight?-1:1)*p.ticksWidth/100*Y;return g.barDimensions={isVertical:K,width:Y,length:X,barWidth:Qe,barLength:at,strokeWidth:Oe,barMargin:$e,radius:Ze,pixelRatio:q,barOffset:null,titleMargin:fe?Pe:0,unitsMargin:ve?Ve:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:b+Ne,Y:M+Fe,x0:Ye+Ne,y0:ze+Fe,baseX:b,baseY:M,ticksPadding:p.ticksPadding/100},g.barDimensions}function Qa(g,p,b,M,k,V,q){var K=Ho(g,p,M,k,V,q),Y=K.isVertical,X=K.width,fe=K.barWidth,ve=K.barLength,Ee=K.strokeWidth,Pe=K.barMargin,Ve=K.radius,it=K.x0,Oe=K.y0,Ze=K.X,Qe=K.Y,at=ve;g.save(),g.beginPath();var $e=null;if(p.barBeginCircle){var Ye=ke.radians(Y?270:0),ze=Math.asin(fe/2/Ve),Ne=Math.cos(ze),Fe=Math.sin(ze),Ke=it+(Y?Ve*Fe:Ve*Ne-Ee/2),lt=Y?Oe-Ve*Ne:Oe+Ve*Fe,wt=$i(Y?lt-Oe:Ke-it);$e=Ge(wt+Ve);var ui=Y?Ge(it-Ve*Fe):Ke,Si=Y?lt:Ge(Oe-Ve*Fe);b==="progress"&&(ve=$e+(ve-$e)*(ke.normalizedValue(p).normal-p.minValue)/(p.maxValue-p.minValue));var Xo=Ge(Ke+ve-$e+Ee/2),Ca=Ge(lt-ve+$e-Ee/2);g.arc(it,Oe,Ve,Ye+ze,Ye-ze),Y?(g.moveTo(Ke,Si),g.lineTo(Ke,Ca),g.lineTo(ui,Ca),g.lineTo(ui,Si)):(g.moveTo(Ke,Si),g.lineTo(Xo,Si),g.lineTo(Xo,lt),g.lineTo(Ke,lt))}else{var pc=Ge(Y?Ze+(X-fe)/2:Ze+Pe),gc=Ge(Y?Qe+ve+Pe:Qe+(X-fe)/2);b==="progress"&&(ve*=(p.value-p.minValue)/(p.maxValue-p.minValue)),Y?g.rect(pc,gc,fe,-ve):g.rect(pc,gc,ve,fe)}b!=="progress"&&p.barStrokeWidth&&(g.lineWidth=Ee,g.strokeStyle=p.colorBarStroke,g.stroke()),b!=="progress"&&p.colorBar?(g.fillStyle=p.colorBarEnd?ke.linearGradient(g,p.colorBar,p.colorBarEnd,ve,Y,Y?Qe:Ze):p.colorBar,g.fill()):b==="progress"&&p.colorBarProgress&&(g.fillStyle=p.colorBarProgressEnd?ke.linearGradient(g,p.colorBarProgress,p.colorBarProgressEnd,at,Y,Y?Qe:Ze):p.colorBarProgress,g.fill()),g.closePath(),g.restore(),p.barBeginCircle&&(g.barDimensions.radius+=Ee),g.barDimensions.barOffset=$e,g.barDimensions.barWidth+=Ee,g.barDimensions.barLength+=Ee}function qo(g,p,b,M,k,V){Qa(g,p,"",b,M,k,V)}function $o(g,p){return p.needleSide!==g||p.tickSide!==g||p.numberSide!==g}function Nr(g,p,b,M,k,V){p.barProgress&&Qa(g,p,"progress",b,M,k,V)}function Xf(g,p){var b=g.barDimensions,M=b.isVertical,k=b.width,V=b.length,q=b.barWidth,K=b.barOffset,Y=b.barMargin,X=b.X,fe=b.Y,ve=b.ticksLength,Ee=b.ticksPadding,Pe=k*(parseFloat(p.highlightsWidth)||0)/100;if(p.highlights&&Pe){var Ve=p.tickSide!=="right",it=p.tickSide!=="left",Oe=0,Ze=p.highlights.length,Qe=(k-q)/2,at=p.maxValue-p.minValue,$e=Ge(M?X+Qe:X+Y+K),Ye=Pe,ze=M?fe+V-Y-K:fe+Qe,Ne=Ge((p.ticksWidth/100+Ee)*k)+(Pe-p.ticksWidth/100*k),Fe=Ge(q+Ee*k);for(g.save();Oe<Ze;Oe++){var Ke=p.highlights[Oe],lt=ve*$i(p.minValue-Ke.from)/at,wt=ve*$i((Ke.to-Ke.from)/at);g.beginPath(),g.fillStyle=Ke.color,M?(Ve&&g.rect($e-Ne,ze-lt,Ye,-wt),it&&g.rect($e+Fe,ze-lt,Ye,-wt)):(Ve&&g.rect($e+lt,ze-Ne,wt,Ye),it&&g.rect($e+lt,ze+Fe,wt,Ye)),g.fill(),g.closePath()}g.restore()}}function Or(g,p,b,M,k){g.beginPath(),g.moveTo(p,b),g.lineTo(M,k),g.stroke(),g.closePath()}function lc(g,p,b,M,k,V,q,K,Y){var X=g.barDimensions,fe=X.isVertical,ve=X.length,Ee=X.barWidth,Pe=X.barOffset,Ve=X.barMargin,it=X.pixelRatio,Oe=X.width,Ze=X.X,Qe=X.Y,at=X.ticksLength,$e=X.ticksPadding,Ye=(Oe-Ee)/2,ze=void 0,Ne=void 0,Fe=0,Ke=b.length,lt=void 0,wt=Y*Oe,ui=Ye-$e*Oe,Si=Ye+Ee+wt+$e*Oe,Xo=p instanceof Array?p:new Array(b.length).fill(p);g.save(),g.lineWidth=K*it;for(var Ca=at/(k-M);Fe<Ke;Fe++)lt=b[Fe],g.strokeStyle=Xo[Fe],fe?(Ne=Qe+ve-Ve-Pe+(M-lt)*Ca,V&&(ze=Ze+ui,Or(g,ze,Ne,Ge(ze-wt),Ne)),q&&(ze=Ze+Si,Or(g,ze,Ne,Ge(ze-wt),Ne))):(ze=Ze+Ve+Pe-(M-lt)*Ca,V&&(Ne=Qe+ui,Or(g,ze,Ne,ze,Ge(Ne-wt))),q&&(Ne=Qe+Si,Or(g,ze,Ge(Ne),ze,Ne-wt)));g.restore()}function Zf(g,p){var b=ke.prepareTicks(p),M=cc(b,2),k=M[0],V=M[1],q=2,K=(p.maxValue-p.minValue)/(p.majorTicks.length-1),Y=p.colorMajorTicks instanceof Array?p.colorMajorTicks:new Array(p.majorTicks.length).fill(p.colorStrokeTicks||p.colorMajorTicks);if(lc(g,Y,p.exactTicks?p.majorTicks:p.majorTicks.map(function(wt,ui){return p.minValue+K*ui}),p.minValue,p.maxValue,k,V,q,p.ticksWidth/100),p.strokeTicks){var X=g.barDimensions,fe=X.isVertical,ve=X.length,Ee=X.width,Pe=X.barWidth,Ve=X.barMargin,it=X.barOffset,Oe=X.X,Ze=X.Y,Qe=X.ticksLength,at=X.pixelRatio,$e=X.ticksPadding,Ye=(Ee-Pe)/2+Pe+$e*Ee,ze=(Ee-Pe)/2-$e*Ee,Ne=void 0,Fe=void 0,Ke=void 0,lt=void 0;g.strokeStyle=p.colorStrokeTicks||Y[0],q*=at,fe?(Fe=Ze+ve-Ve-it+q/2,lt=Fe-Qe-q,k&&(Ke=Ne=Ge(Oe+ze),Vr(g,Ne,Fe,Ke,lt)),V&&(Ke=Ne=Ge(Oe+Ye),Vr(g,Ne,Fe,Ke,lt))):(Ne=Oe+Ve+it-q/2,Ke=Ne+Qe+q,k&&(lt=Fe=Ge(Ze+ze),Vr(g,Ne,Fe,Ke,lt)),V&&(lt=Fe=Ge(Ze+Ye),Vr(g,Ne,Fe,Ke,lt)))}}function Vr(g,p,b,M,k){g.beginPath(),g.moveTo(p,b),g.lineTo(M,k),g.stroke(),g.closePath()}function Qf(g,p){var b=ke.prepareTicks(p),M=cc(b,2),k=M[0],V=M[1],q=[],K=p.minValue,Y=Math.abs(p.minorTicks)||0,X=Y?(p.maxValue-p.minValue)/(Y*(p.majorTicks.length-1)):0;if(Y)if(p.exactTicks)for(var fe=rn.mod(p.majorTicks[0],Y)||0;K<p.maxValue;K+=Y)fe+K<p.maxValue&&q.push(fe+K);else for(;K<p.maxValue;K+=X)q.push(K);lc(g,p.colorMinorTicks||p.colorStrokeTicks,q,p.minValue,p.maxValue,k,V,1,p.ticksWidthMinor/100)}function Jf(g,p){var b=g.barDimensions,M=b.isVertical,k=b.length,V=b.width,q=b.barWidth,K=b.barMargin,Y=b.barOffset,X=b.X,fe=b.Y,ve=b.ticksLength,Ee=b.ticksPadding,Pe=p.maxValue-p.minValue,Ve=Pe/(p.majorTicks.length-1),it=p.exactTicks?p.majorTicks:p.majorTicks.map(function(Xo,Ca){return p.minValue+Ve*Ca}),Oe=it.length,Ze=p.numberSide!=="right",Qe=p.numberSide!=="left",at=p.fontNumbersSize*V/200,$e=0,Ye=(p.ticksWidth/100+2*Ee)*V,ze=(V-q)/2-Ye,Ne=(V-q)/2+q+Ye,Fe=void 0,Ke=void 0,lt=void 0,wt=void 0,ui=p.colorNumbers instanceof Array?p.colorNumbers:new Array(Oe).fill(p.colorNumbers),Si=p.numbersMargin/100*V;for(g.font=ke.font(p,"Numbers",V/200),g.lineWidth=0,g.textAlign="center";$e<Oe;$e++)g.fillStyle=ui[$e],wt=p.majorTicks[$e],lt=p.exactTicks?ve*((it[$e]-p.minValue)/Pe):$e*ve/(Oe-1),M?(Ke=fe+k-K-Y-lt+at/3,Ze&&(g.textAlign="right",g.fillText(wt,X+ze-Si,Ke)),Qe&&(g.textAlign="left",g.fillText(wt,X+Ne+Si,Ke))):(g.measureText(wt).width,Fe=X+K+Y+lt,Ze&&g.fillText(wt,Fe,fe+ze-Si),Qe&&g.fillText(wt,Fe,fe+Ne+at+Si))}function e0(g,p){if(p.title){var b=g.barDimensions,M=b.isVertical,k=b.width,V=b.length,q=b.baseX,K=b.baseY,Y=b.titleMargin,X=p.fontTitleSize*k/200,fe=Ge(q+(M?k:V)/2),ve=Ge(K+Y/2-(M?X:X/2)-.025*(M?V:k));g.save(),g.textAlign="center",g.fillStyle=p.colorTitle,g.font=ke.font(p,"Title",k/200),g.lineWidth=0,g.fillText(p.title,fe,ve,M?k:V),g.restore()}}function t0(g,p){if(p.units){var b=g.barDimensions,M=b.isVertical,k=b.width,V=b.length,q=b.baseX,K=b.baseY,Y=b.unitsMargin,X=p.fontUnitsSize*k/200,fe=Ge(q+(M?k:V)/2),ve=Ge(K+(M?V:k)+Y/2-X/2);g.save(),g.textAlign="center",g.fillStyle=p.colorUnits,g.font=ke.font(p,"Units",k/200),g.lineWidth=0,g.fillText(ke.formatContext(p,p.units),fe,ve,M?k:V),g.restore()}}function i0(g,p){if(p.needle){var b=g.barDimensions,M=b.isVertical,k=b.width,V=b.length,q=b.barWidth,K=b.barOffset,Y=b.barMargin,X=b.ticksLength,fe=b.X,ve=b.Y,Ee=b.ticksPadding,Pe=p.needleSide!=="right",Ve=p.needleSide!=="left",it=X*(ke.normalizedValue(p).indented-p.minValue)/(p.maxValue-p.minValue),Oe=(p.ticksWidth/100+Ee)*k,Ze=q/2+Oe,Qe=Ze*(p.needleEnd/100),at=void 0,$e=void 0,Ye=void 0,ze=void 0,Ne=p.needleType.toLowerCase()==="arrow"?a0:n0,Fe=(k-q)/2,Ke=Ze*(p.needleStart/100),lt=Fe-Oe-Ke,wt=Fe+q+Oe+Ke;g.save(),ke.drawNeedleShadow(g,p),M?(Ye=Ge(ve+V-Y-K-it),Pe&&(at=Ge(fe+lt),$e=at+Qe,Ne(g,p,at,Ye,$e,Ye,Qe)),Ve&&(at=Ge(fe+wt),$e=at-Qe,Ne(g,p,at,Ye,$e,Ye,Qe,!0))):(at=Ge(fe+Y+K+it),Pe&&(Ye=Ge(ve+lt),ze=Ye+Qe,Ne(g,p,at,Ye,at,ze,Qe)),Ve&&(Ye=Ge(ve+wt),ze=Ye-Qe,Ne(g,p,at,Ye,at,ze,Qe,!0))),g.restore()}}function dc(g,p,b,M){return p.colorNeedleEnd?ke.linearGradient(g,M?p.colorNeedleEnd:p.colorNeedle,M?p.colorNeedle:p.colorNeedleEnd,b,!g.barDimensions.isVertical):p.colorNeedle}function n0(g,p,b,M,k,V,q,K){g.lineWidth=p.needleWidth,g.strokeStyle=dc(g,p,q,K),g.beginPath(),g.moveTo(b,M),g.lineTo(k,V),g.stroke(),g.closePath()}function a0(g,p,b,M,k,V,q,K){var Y=Ge(.4*q),X=q-Y,fe=b===k,ve=p.needleWidth/2;g.fillStyle=dc(g,p,q,K),g.beginPath(),fe?(M>V&&(X*=-1),g.moveTo(b-ve,M),g.lineTo(b+ve,M),g.lineTo(b+ve,M+X),g.lineTo(b,V),g.lineTo(b-ve,M+X),g.lineTo(b-ve,M)):(b>k&&(X*=-1),g.moveTo(b,M-ve),g.lineTo(b,M+ve),g.lineTo(b+X,M+ve),g.lineTo(k,M),g.lineTo(b+X,M-ve),g.lineTo(b,M-ve)),g.fill(),g.closePath()}function o0(g,p,b,M,k,V,q){var K=(parseFloat(p.fontValueSize)||0)*V/200,Y=(.11*q-K)/2;g.barDimensions.isVertical&&ke.drawValueBox(g,p,b,M+V/2,k+q-K-Y,V)}var cc=(function(){function g(p,b){var M=[],k=!0,V=!1,q=void 0;try{for(var K,Y=p[Symbol.iterator]();!(k=(K=Y.next()).done)&&(M.push(K.value),!b||M.length!==b);k=!0);}catch(X){V=!0,q=X}finally{try{!k&&Y.return&&Y.return()}finally{if(V)throw q}}return M}return function(p,b){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return g(p,b);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),Nl=function g(p,b,M){p===null&&(p=Function.prototype);var k=Object.getOwnPropertyDescriptor(p,b);if(k===void 0){var V=Object.getPrototypeOf(p);return V===null?void 0:g(V,b,M)}if("value"in k)return k.value;var q=k.get;if(q!==void 0)return q.call(M)},r0=function g(p,b,M,k){var V=Object.getOwnPropertyDescriptor(p,b);if(V===void 0){var q=Object.getPrototypeOf(p);q!==null&&g(q,b,M,k)}else if("value"in V&&V.writable)V.value=M;else{var K=V.set;K!==void 0&&K.call(k,M)}return M},Aa=(function(){function g(p,b){for(var M=0;M<b.length;M++){var k=b[M];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(p,k.key,k)}}return function(p,b,M){return b&&g(p.prototype,b),M&&g(p,M),p}})(),Lr=null,s0=(function(){function g(){i(this,g),this._events={},this.addListener=this.on,this.removeListener=this.off}return Aa(g,[{key:"emit",value:function(p){if(this._events[p]){for(var b=0,M=this._events[p].length,k=arguments.length,V=Array(k>1?k-1:0),q=1;q<k;q++)V[q-1]=arguments[q];for(;b<M;b++)this._events[p][b]&&this._events[p][b].apply(this,V)}}},{key:"once",value:function(p){for(var b=arguments.length,M=Array(b>1?b-1:0),k=1;k<b;k++)M[k-1]=arguments[k];for(var V=0,q=M.length,K=this;V<q;V++)(function(){var Y=M[V],X=function fe(){K.off(p,fe),Y.apply(K,arguments)};M[V]=X})();this.on.apply(this,[p].concat(M))}},{key:"on",value:function(p){this._events[p]||(this._events[p]=[]);for(var b=0,M=arguments.length<=1?0:arguments.length-1;b<M;b++)this._events[p].push(arguments.length<=b+1?void 0:arguments[b+1])}},{key:"off",value:function(p){if(this._events[p])for(var b=0,M=arguments.length<=1?0:arguments.length-1;b<M;b++)for(var k=arguments.length<=b+1?void 0:arguments[b+1],V=void 0;~(V=this._events[p].indexOf(k));)this._events[p].splice(V,1)}},{key:"removeAllListeners",value:function(p){delete this._events[p]}},{key:"listeners",get:function(){return this._events}}]),g})(),uc=o("requestAnimationFrame")||function(g){return setTimeout(function(){return g(new Date().getTime())},1e3/60)},jo={linear:function(g){return g},quad:function(g){return Math.pow(g,2)},dequad:function(g){return 1-jo.quad(1-g)},quint:function(g){return Math.pow(g,5)},dequint:function(g){return 1-Math.pow(1-g,5)},cycle:function(g){return 1-Math.sin(Math.acos(g))},decycle:function(g){return Math.sin(Math.acos(1-g))},bounce:function(g){return 1-jo.debounce(1-g)},debounce:function(g){for(var p=0,b=1;;p+=b,b/=2)if(g>=(7-4*p)/11)return-Math.pow((11-6*p-11*g)/4,2)+Math.pow(b,2)},elastic:function(g){return 1-jo.delastic(1-g)},delastic:function(g){return Math.pow(2,10*(g-1))*Math.cos(20*Math.PI*1.5/3*g)}},Ol=(function(){function g(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,g),this.duration=b,this.rule=p,this.draw=M,this.end=k,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",M);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",k)}return Aa(g,[{key:"animate",value:function(p,b){var M=this;this.frame&&this.cancel();var k=window.performance&&window.performance.now?window.performance.now():o("animationStartTime")||Date.now();p=p||this.draw,b=b||this.end,this.draw=p,this.end=b,this.frame=uc(function(V){return r(V,p,k,jo[M.rule]||M.rule,M.duration,b,M)})}},{key:"cancel",value:function(){this.frame&&((o("cancelAnimationFrame")||function(p){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),g})();Ol.rules=jo;var Ja=(function(){function g(p,b,M){i(this,g),this.options=p,this.element=b.toLowerCase(),this.type=g.toDashed(M),this.Type=n[M],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||g.domReady(this.traverse.bind(this))}return Aa(g,[{key:"isValidNode",value:function(p){return!(!p.tagName||p.tagName.toLowerCase()!==this.element||p.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var p=document.getElementsByTagName(this.element),b=0,M=p.length;b<M;b++)this.process(p[b]);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(p){for(var b=0,M=p.length;b<M;b++){var k=p[b];if(k.type==="attributes"&&k.attributeName==="data-type"&&this.isValidNode(k.target)&&k.oldValue!==this.type)setTimeout(this.process.bind(this,k.target));else if(k.addedNodes&&k.addedNodes.length)for(var V=0,q=k.addedNodes.length;V<q;V++)setTimeout(this.process.bind(this,k.addedNodes[V]))}}},{key:"process",value:function(p){var b=this;if(!this.isValidNode(p))return null;var M=void 0,k=JSON.parse(JSON.stringify(this.options)),V=null;for(M in k)if(k.hasOwnProperty(M)){var q=g.toAttributeName(M),K=g.parse(p.getAttribute(q));K!=null&&(k[M]=K)}return k.renderTo=p,V=new this.Type(k),V.draw&&V.draw(),this.isObservable&&(V.observer=new MutationObserver(function(Y){Y.forEach(function(X){if(X.type==="attributes"){var fe=X.attributeName.toLowerCase(),ve=p.getAttribute(fe).toLowerCase();if(fe==="data-type"&&ve&&ve!==b.type)V.observer.disconnect(),delete V.observer,V.destroy&&V.destroy();else if(fe.substr(0,5)==="data-"){var Ee=fe.substr(5).split("-").map(function(Ve,it){return it?Ve.charAt(0).toUpperCase()+Ve.substr(1):Ve}).join(""),Pe={};Pe[Ee]=g.parse(p.getAttribute(X.attributeName)),Ee==="value"?V&&(V.value=Pe[Ee]):V.update&&V.update(Pe)}}})}),V.observer.observe(p,{attributes:!0})),V}}],[{key:"parse",value:function(p){if(p==="true")return!0;if(p==="false")return!1;if(p!=="undefined"){if(p==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(p))return p.split(",");try{return JSON.parse(p)}catch(b){}return p}}},{key:"toDashed",value:function(p){for(var b=p.split(/(?=[A-Z])/),M=1,k=b.length,V=b[0].toLowerCase();M<k;M++)V+="-"+b[M].toLowerCase();return V}},{key:"toCamelCase",value:function(p){for(var b=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],M=p.split(/-/),k=0,V=M.length,q="";k<V;k++)q+=k||b?M[k][0].toUpperCase()+M[k].substr(1).toLowerCase():M[k].toLowerCase();return q}},{key:"toAttributeName",value:function(p){return"data-"+g.toDashed(p)}},{key:"domReady",value:function(p){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return p();window.addEventListener?window.addEventListener("DOMContentLoaded",p,!1):window.attachEvent&&window.attachEvent("onload",p)}}]),g})(),qi=(function(){function g(p,b,M){i(this,g),g.collection.push(this),this.width=b||0,this.height=M||0,this.element=p,this.init()}return Aa(g,[{key:"init",value:function(){var p=g.pixelRatio;this.element.width=this.width*p,this.element.height=this.height*p,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 p=g.collection.indexOf(this);~p&&g.collection.splice(p,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 p=g.pixelRatio;return p!==1&&this.contextClone.scale(p,p),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var p=0,b=g.collection.length;p<b;p++)g.collection[p].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),g})();qi.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(qi.redraw);var Vl={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};s.prototype=Object.create(Array.prototype),s.prototype.constructor=s,s.prototype.get=function(g){if(typeof g=="string")for(var p=0,b=this.length;p<b;p++){var M=this[p].options.renderTo.tagName?this[p].options.renderTo:document.getElementById(this[p].options.renderTo||"");if(M.getAttribute("id")===g)return this[p]}else if(typeof g=="number")return this[g];return null};var Ll="2.2.1",Ge=Math.round,$i=Math.abs,Yo=new s;Yo.version=Ll;var rn=(function(g){function p(b){i(this,p);var M=e(this,(p.__proto__||Object.getPrototypeOf(p)).call(this)),k=M.constructor.name;if(k==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(Yo.push(M),b.listeners&&Object.keys(b.listeners).forEach(function(q){(b.listeners[q]instanceof Array?b.listeners[q]:[b.listeners[q]]).forEach(function(K){M.on(q,K)})}),M.version=Ll,M.type=n[k]||p,M.initialized=!1,b.minValue=parseFloat(b.minValue),b.maxValue=parseFloat(b.maxValue),b.value=parseFloat(b.value)||0,b.borders||(b.borderInnerWidth=b.borderMiddleWidth=b.borderOuterWidth=0),!b.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var V=b.renderTo.tagName?b.renderTo:document.getElementById(b.renderTo);if(!(V instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return b.width=parseFloat(b.width)||0,b.height=parseFloat(b.height)||0,b.width&&b.height||(b.width||(b.width=V.parentNode?V.parentNode.offsetWidth:V.offsetWidth),b.height||(b.height=V.parentNode?V.parentNode.offsetHeight:V.offsetHeight)),M.options=b||{},M.options.animateOnInit&&(M._value=M.options.value,M.options.value=M.options.minValue),M.canvas=new qi(V,b.width,b.height),M.canvas.onRedraw=M.draw.bind(M),M.animation=new Ol(b.animationRule,b.animationDuration),M}return t(p,g),Aa(p,[{key:"update",value:function(b){return Object.assign(this.options,this.type.configure(b||{})),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 b=Yo.indexOf(this);~b&&Yo.splice(b,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(b){var M=this;b=p.ensureValue(b,this.options.minValue);var k=this.options.value;if(b!==k)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===b))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=b),this.emit("animationStart"),this.animation.animate(function(V){var q=k+(b-k)*V;M.options.animatedValue&&M.emit("value",q,M.value),M.options.value=q,M.draw(),M.emit("animate",V,M.options.value)},function(){M._value!==void 0&&(M.emit("value",M._value,M.value),M.options.value=M._value,delete M._value),M.draw(),M.emit("animationEnd"),M.animation.frame=null})}else this.emit("value",b,this.value),this.options.value=b,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(b){return b}},{key:"initialize",value:function(b,M){return new Ja(M,"canvas",b)}},{key:"fromElement",value:function(b){var M=Ja.toCamelCase(b.getAttribute("data-type")),k=b.attributes,V=0,q=k.length,K={};if(M){for(/Gauge$/.test(M)||(M+="Gauge");V<q;V++)K[Ja.toCamelCase(k[V].name.replace(/^data-/,""),!1)]=Ja.parse(k[V].value);new Ja(K,b.tagName,M).process(b)}}},{key:"ensureValue",value:function(b){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return b=parseFloat(b),!isNaN(b)&&isFinite(b)||(b=parseFloat(M)||0),b}},{key:"mod",value:function(b,M){return(b%M+M)%M}},{key:"version",get:function(){return Ll}}]),p})(s0);n!==void 0&&(n.BaseGauge=rn,n.gauges=(window.document||{}).gauges=Yo);var l0=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,ke={roundRect:v,padValue:y,formatMajorTickNumber:C,radians:S,radialPoint:_,linearGradient:F,drawNeedleShadow:E,drawValueBox:B,verifyError:l,prepareTicks:h,font:N,normalizedValue:re,formatContext:m},Ko=Math.PI,Wl=Ko/2,mc=Object.assign({},Vl,{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"}),d0=(function(g){function p(b){return i(this,p),b=Object.assign({},mc,b||{}),e(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,p.configure(b)))}return t(p,g),Aa(p,[{key:"draw",value:function(){try{var b=this.canvas,M=[-b.drawX,-b.drawY,b.drawWidth,b.drawHeight],k=M[0],V=M[1],q=M[2],K=M[3],Y=this.options;if(Y.animationTarget==="needle"){if(!b.elementClone.initialized){var X=b.contextClone;X.clearRect(k,V,q,K),this.emit("beforePlate"),se(X,Y),this.emit("beforeHighlights"),de(X,Y),this.emit("beforeMinorTicks"),ce(X,Y),this.emit("beforeMajorTicks"),me(X,Y),this.emit("beforeNumbers"),pt(X,Y),this.emit("beforeTitle"),tt(X,Y),this.emit("beforeUnits"),Bt(X,Y),b.elementClone.initialized=!0}this.canvas.commit(),b.context.clearRect(k,V,q,K),b.context.drawImage(b.elementClone,k,V,q,K),this.emit("beforeProgressBar"),wn(b.context,Y),this.emit("beforeValueBox"),Sn(b.context,Y,Za(this)),this.emit("beforeNeedle"),ri(b.context,Y)}else{var fe=-ke.radians((Y.value-Y.minValue)/(Y.maxValue-Y.minValue)*Y.ticksAngle);if(b.context.clearRect(k,V,q,K),this.emit("beforePlate"),se(b.context,Y),b.context.rotate(fe),this.emit("beforeHighlights"),de(b.context,Y),this.emit("beforeMinorTicks"),ce(b.context,Y),this.emit("beforeMajorTicks"),me(b.context,Y),this.emit("beforeNumbers"),pt(b.context,Y),this.emit("beforeProgressBar"),wn(b.context,Y),b.context.rotate(-fe),!b.elementClone.initialized){var ve=b.contextClone;ve.clearRect(k,V,q,K),this.emit("beforeTitle"),tt(ve,Y),this.emit("beforeUnits"),Bt(ve,Y),this.emit("beforeNeedle"),ri(ve,Y),b.elementClone.initialized=!0}b.context.drawImage(b.elementClone,k,V,q,K)}this.emit("beforeValueBox"),Sn(b.context,Y,Za(this)),Nl(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"draw",this).call(this)}catch(Ee){ke.verifyError(Ee)}return this}},{key:"value",set:function(b){b=rn.ensureValue(b,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=b,b=this.options.value+((b-this.options.value)%360+540)%360-180),r0(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",b,this)},get:function(){return Nl(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this)}}],[{key:"configure",value:function(b){return b.barWidth>50&&(b.barWidth=50),isNaN(b.startAngle)&&(b.startAngle=45),isNaN(b.ticksAngle)&&(b.ticksAngle=270),b.ticksAngle>360&&(b.ticksAngle=360),b.ticksAngle<0&&(b.ticksAngle=0),b.startAngle<0&&(b.startAngle=0),b.startAngle>360&&(b.startAngle=360),b}}]),p})(rn);n!==void 0&&(n.RadialGauge=d0),rn.initialize("RadialGauge",mc);var hc=Object.assign({},Vl,{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}),c0=(function(g){function p(b){return i(this,p),b=Object.assign({},hc,b||{}),e(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,p.configure(b)))}return t(p,g),Aa(p,[{key:"draw",value:function(){try{var b=this.canvas,M=[-b.drawX,-b.drawY,b.drawWidth,b.drawHeight],k=M[0],V=M[1],q=M[2],K=M[3],Y=this.options;if(!b.elementClone.initialized){var X=b.contextClone;X.clearRect(k,V,q,K),this.emit("beforePlate"),this.drawBox=Uo(X,Y,k,V,q,K),this.emit("beforeBar"),qo.apply(void 0,[X,Y].concat(a(this.drawBox))),b.contextClone.barDimensions=X.barDimensions,this.emit("beforeHighlights"),Xf(X,Y),this.emit("beforeMinorTicks"),Qf(X,Y),this.emit("beforeMajorTicks"),Zf(X,Y),this.emit("beforeNumbers"),Jf(X,Y),this.emit("beforeTitle"),e0(X,Y),this.emit("beforeUnits"),t0(X,Y),b.elementClone.initialized=!0}this.canvas.commit(),b.context.clearRect(k,V,q,K),b.context.drawImage(b.elementClone,k,V,q,K),this.emit("beforeProgressBar"),Nr.apply(void 0,[b.context,Y].concat(a(this.drawBox))),this.emit("beforeNeedle"),i0(b.context,Y),this.emit("beforeValueBox"),o0.apply(void 0,[b.context,Y,Y.animatedValue?this.options.value:this.value].concat(a(this.drawBox))),Nl(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"draw",this).call(this)}catch(fe){ke.verifyError(fe)}return this}}],[{key:"configure",value:function(b){return b.barStrokeWidth>=b.barWidth&&(b.barStrokeWidth=Ge(b.barWidth/2)),b.hasLeft=$o("right",b),b.hasRight=$o("left",b),b.value>b.maxValue&&(b.value=b.maxValue),b.value<b.minValue&&(b.value=b.minValue),rn.configure(b)}}]),p})(rn);n!==void 0&&(n.LinearGauge=c0),rn.initialize("LinearGauge",hc),typeof gl<"u"&&Object.assign(n,{Collection:s,GenericOptions:Vl,Animation:Ol,BaseGauge:rn,drawings:ke,SmartCanvas:qi,DomObserver:Ja,vendorize:o})})(typeof gl<"u"?gl.exports:window)});var nm=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var Tt=(()=>{class n{_settings=A(Ht);_router=A(Cu);_destroyRef=A(Ie);dashboards=w([],{equal:Ei});activeDashboard=w(null);_widgetAction=new sn(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=w(!0);widgetClipboard=w(null);layoutEditSaved=w(0);layoutEditCanceled=w(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let i=nm.map(o=>ge(Z({},o),{id:Di.create()}));this.dashboards.set([...i])}else this.dashboards.set(e);this.applyDashboardParam(this.getRouteParam("id"),!1);let t=this._router.events.pipe(_i(i=>i instanceof Au),zr({bufferSize:1,refCount:!0}),De(this._destroyRef));t.pipe(mi(1),si(()=>this.getRouteParam("id"))).subscribe(i=>this.applyDashboardParam(i,!0)),t.pipe(Ur(1),si(()=>this.getRouteParam("id")),Br()).subscribe(i=>this.applyDashboardParam(i,!1)),W(()=>{let i=this.dashboards();z(()=>{this._settings.saveDashboards(i)})})}getRouteParam(e){let t=this._router.routerState.snapshot.root;for(;t;){if(t.paramMap.has(e))return t.paramMap.get(e);t=t.firstChild??null}return null}applyDashboardParam(e,t){if(e===null||e===""){t&&this.setActiveDashboardIndex(0);return}let i=Number(e);if(Number.isNaN(i)){t&&this.setActiveDashboardIndex(0);return}this.setActiveDashboardIndex(i)}setActiveDashboardIndex(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?this.activeDashboard.set(e):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,i,o){let r=0;return this.dashboards.update(s=>{let l=[...s,{id:Di.create(),name:e,icon:i??"dashboard-dashboard",configuration:t,collapseSplitShell:o??!1}];return r=l.length-1,l}),r}update(e,t,i,o){this.dashboards.update(r=>r.map((s,l)=>l===e?ge(Z({},s),{name:t,icon:i??"dashboard-dashboard",collapseSplitShell:o??!1}):s))}delete(e){this.dashboards.update(t=>t.filter((i,o)=>o!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,i,o){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let r=this.dashboards()[e],s=Yt(r);s.id=Di.create(),s.name=t,s.icon=i||"dashboard-dashboard",s.collapseSplitShell=o??!1,Array.isArray(s.configuration)?s.configuration.forEach(m=>{m&&m.input?.widgetProperties?(m.id=Di.create(),m.input.widgetProperties.uuid=m.id):console.error("Dashboard Service] Widget configuration is missing required properties:",m)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",s.configuration),s.configuration=[]);let l=-1;return this.dashboards.update(m=>{let h=[...m,s];return l=h.length-1,h}),l}updateConfiguration(e,t){let i=Yt(t??[]);this.dashboards.update(o=>o.map((r,s)=>s===e?Ei(r.configuration,i)?r:ge(Z({},r),{configuration:i}):r))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}navigateToActive(