@mxtommy/kip 4.0.3 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{A as wl,B as Jo,C as er,D as tr,E as ir,F as jn,G as Ca,H as xl,I as _l,J as Yn,K as Ji,L as Et,M as Qn,N as $n,O as Zn,P as ho,Q as po,R as Ml,S as Xn,T as Kn,a as Gt,b as ni,c as oo,d as vl,e as yl,f as Cl,g as Sl,h as je,i as Zi,j as Xi,k as ro,l as pn,m as va,n as ui,o as Ki,p as zt,q as so,r as lo,s as Hn,t as gn,u as co,v as mo,w as hi,x as Ko,y as uo,z as ya}from"./chunk-SY22WXMI.js";import{a as Al,b as ao}from"./chunk-RYHOAWDD.js";import{a as ii,b as $i,c as at}from"./chunk-PKKBBIJK.js";import{a as dl,b as cl,c as ml,d as zn,e as ul,f as Tt,g as hl,h as pl,i as gl,k as fl,m as Aa,n as bl}from"./chunk-HIADZ4BV.js";import{a as wt,b as Lt}from"./chunk-IO5SDLYV.js";import{a as sl,b as ll}from"./chunk-OQULS6SV.js";import{A as ft,B as ti,a as ce,c as Ws,d as Ci,e as Zs,f as Xs,g as Ks,h as Si,i as wi,k as Js,l as xi,m as _i,n as Mi,o as zi,p as Kt,r as mt,s as Yi,t as ol,u as Qi,w as rl,y as ut,z as ei}from"./chunk-QLTN6G6E.js";import{A as Bn,B as ki,C as Ti,D as kt,E as nl,F as al,G as Hi,H as Un,I as ji,J as ct,L as qn,M as pt,N as gt,a as qi,d as qt,e as Nn,f as ws,i as xs,j as _s,k as $a,l as Ms,m as Zt,n as Gn,o as dt,q as _t,s as nt,t as Mt,u as el,v as tl,w as no,x as il,y as Jt,z as Fn}from"./chunk-XDPHEQEO.js";import{b as Gs,f as Fs,g as Bs,h as zs,i as Xo,j as Hs,m as js,n as Ys,o as Qs,s as $s}from"./chunk-SZ2GUIT5.js";import{$ as cs,$b as Bt,Ab as Ct,Ad as Zo,Ba as La,Bb as St,Bc as za,Bd as Ka,C as ha,Ca as pa,Cc as Ha,Cd as Vs,D as xn,Db as te,Dd as Ja,E as Vi,Eb as me,Ec as Ss,F as Wi,Fa as g,Fb as It,Fd as Ot,Ga as ps,Gb as re,Gc as ja,Gd as ze,Hb as Je,Hd as Xe,I as ns,Ia as kn,Ib as Rn,Ic as Ya,J as Li,Ja as di,Jb as Ft,K as Gi,Kb as m,La as Ga,Lb as ne,Ld as mi,M as as,Mb as ye,N as os,Nb as Ui,Nc as et,Nd as Xt,O as rs,Oa as L,Oc as Qa,P as Ra,Pa as Wt,Pb as cn,Qa as st,Qb as mn,R as ss,Ra as Fa,Rb as un,S as ls,Sa as ga,Sc as Za,Ta as gs,Td as eo,U as ds,Ua as Bi,Ud as to,V as _n,Va as fs,Vb as ci,Vd as xt,W as Na,Wa as yt,Wd as io,X as Va,Xa as We,Xb as hn,Xc as ks,Xd as lt,Ya as Tn,Yb as ba,Z as Wa,Zd as Ls,_b as At,_d as Ke,a as Be,ab as Y,ac as Ua,b as Ze,ba as Mn,bb as G,ca as ht,cb as F,cc as W,d as Cm,da as Vt,db as Me,dc as se,dd as Ts,e as Zr,ea as Yt,eb as En,ec as R,ed as Es,f as it,fa as ms,fb as ue,fc as bs,fd as Ds,fe as Us,g as Ni,ga as A,gb as he,ge as qs,hb as T,hc as qa,i as jo,ia as us,ib as d,ic as $e,j as Nt,ja as q,jb as u,jc as v,ka as z,kb as U,kc as ie,kd as Xa,l as Ia,la as K,lb as _,m as Xr,ma as Ve,mb as k,mc as As,md as Vn,na as Fi,nb as H,nc as Ut,nd as Ps,oa as hs,ob as Dn,od as Is,p as Kr,pa as rt,pb as Pn,pc as qe,pd as Wn,q as Yo,qb as Ba,qc as $o,r as Jr,ra as w,rb as ae,sb as Pi,sd as Os,t as Oa,tb as B,u as Qo,ua as Qt,ub as fa,v as es,vb as I,vd as Rs,w as vi,wa as Ie,wb as In,wc as vs,wd as yi,xb as On,xc as ys,xd as Ln,y as ts,yb as dn,yc as Cs,yd as Ns,z as is,zb as $t}from"./chunk-OB3QLUH6.js";var mr=Cm((rx,Eo)=>{(function(n){"use strict";function o(c){if(Array.isArray(c)){for(var l=0,p=Array(c.length);l<c.length;l++)p[l]=c[l];return p}return Array.from(c)}function e(c,l){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||typeof l!="object"&&typeof l!="function"?c:l}function t(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(c,l):c.__proto__=l)}function i(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function a(c,l){if(l||(l=typeof window>"u"?global:window),l[c]!==void 0)return l[c];if(Pa===null){var p=window.getComputedStyle(document.documentElement,"");Pa=(Array.prototype.slice.call(p).join("").match(/-(moz|webkit|ms)-/)||p.OLink===""&&["","o"]||["",""])[1]}if(Pa==="")return null;var y=c.charAt(0).toUpperCase()+c.substr(1),S=l[Pa+y];return S!==void 0?S:null}function r(c,l,p,y,S,x,E){if(typeof y!="function")throw new TypeError("Invalid animation rule:",y);var O=c-p,P=O/S,V=0;P>1&&(P=1),P!==1&&(V=y(P),isFinite(V)&&!isNaN(V)&&(P=V)),l&&l(P),O<S?E.frame=Hr(function(Q){return r(Q,l,p,y,S,x,E)}):(x&&x(),E.inProgress=!1)}function s(){Array.prototype.constructor.apply(this,arguments)}function h(c){if(!(c instanceof DOMException&&c.result===2152923147))throw c}function f(c,l){return l.replace(Am,function(p,y){var S=c[y];return S!==void 0?S:p})}function b(c){return c.majorTicks instanceof Array||(c.majorTicks=c.majorTicks?[c.majorTicks]:[]),c.majorTicks.length||(c.majorTicks.push(oe.formatMajorTickNumber(c.minValue,c)),c.majorTicks.push(oe.formatMajorTickNumber(c.maxValue,c))),[c.tickSide!=="right",c.tickSide!=="left"]}function C(c,l,p,y,S,x){c.beginPath(),c.moveTo(l+x,p),c.lineTo(l+y-x,p),c.quadraticCurveTo(l+y,p,l+y,p+x),c.lineTo(l+y,p+S-x),c.quadraticCurveTo(l+y,p+S,l+y-x,p+S),c.lineTo(l+x,p+S),c.quadraticCurveTo(l,p+S,l,p+S-x),c.lineTo(l,p+x),c.quadraticCurveTo(l,p,l+x,p),c.closePath()}function M(c,l){var p=l.valueDec,y=l.valueInt,S=0,x=void 0,E=void 0,O=void 0;if(c=parseFloat(c),O=c<0,c=Math.abs(c),p>0){for(E=c.toFixed(p).toString().split("."),x=y-E[0].length;S<x;++S)E[0]="0"+E[0];E=(O?"-":"")+E[0]+"."+E[1]}else{for(E=Math.round(c).toString(),x=y-E.length;S<x;++S)E="0"+E;E=(O?"-":"")+E}return E}function N(c,l){var p=void 0,y=!1;return p=l.majorTicksDec===0?Math.round(c).toString():c.toFixed(l.majorTicksDec),l.majorTicksInt>1?(y=~p.indexOf("."),~p.indexOf("-")?"-"+[l.majorTicksInt+l.majorTicksDec+2+(y?1:0)-p.length].join("0")+p.replace("-",""):[l.majorTicksInt+l.majorTicksDec+1+(y?1:0)-p.length].join("0")+p):p}function D(c){return c*Math.PI/180}function j(c,l){return{x:-c*Math.sin(l),y:c*Math.cos(l)}}function X(c,l,p,y){var S=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],x=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,E=c.createLinearGradient(S?0:x,S?x:0,S?0:y,S?y:0);return E.addColorStop(0,l),E.addColorStop(1,p),E}function Z(c,l){l.needleShadow&&(c.shadowOffsetX=2,c.shadowOffsetY=2,c.shadowBlur=10,c.shadowColor=l.colorNeedleShadowDown)}function ee(c,l,p){return c["font"+l+"Style"]+" "+c["font"+l+"Weight"]+" "+c["font"+l+"Size"]*p+"px "+c["font"+l]}function be(c){c.shadowOffsetX=null,c.shadowOffsetY=null,c.shadowBlur=null,c.shadowColor="",c.strokeStyle=null,c.lineWidth=0,c.save()}function Oe(c,l,p,y){l.valueTextShadow&&(c.shadowOffsetX=p,c.shadowOffsetY=p,c.shadowBlur=y,c.shadowColor=l.colorValueTextShadow)}function Te(c,l,p,y,S,x){if(l.valueBox){be(c);var E=l.valueDec?1+l.valueDec:0,O="9".repeat(Math.max.apply(null,[String(parseInt(p)).length+E].concat(l.majorTicks.map(function(Pe){return String(parseInt(Pe,10)).length+E})))),P=l.valueText||M(p,l),V=x/200,Q=x/100,$=.4*Q,le=1.2*Q;c.font=ee(l,"Value",V),Oe(c,l,$,le);var ge=c.measureText(l.valueText?P:"-"+M(Number(O),l)).width;be(c);var ve=parseFloat(l.fontValueSize)*V+$+le,Ge=Q*parseFloat(l.valueBoxStroke),Ae=2*x-2*Ge,Re=ge+10*Q,Ne=1.1*ve+$+le,Fe=Q*l.valueBoxBorderRadius,ke=(parseFloat(l.valueBoxWidth)||0)/100*Ae;ke>Re&&(Re=ke),Re>Ae&&(Re=Ae);var De=y-Re/2,xe=S-Ne/2,fe=S-5.75*Q;if(c.beginPath(),Fe?C(c,De,xe,Re,Ne,Fe):c.rect(De,xe,Re,Ne),Ge){var Ce=c.createRadialGradient(y,fe,10*Q,y,fe,20*Q);Ce.addColorStop(0,l.colorValueBoxRect),Ce.addColorStop(1,l.colorValueBoxRectEnd),c.strokeStyle=Ce,c.lineWidth=Ge,c.stroke()}l.colorValueBoxShadow&&(c.shadowBlur=1.2*Q,c.shadowColor=l.colorValueBoxShadow),l.colorValueBoxBackground&&(c.fillStyle=l.colorValueBoxBackground,c.fill()),c.closePath(),c.restore(),Oe(c,l,$,le),c.fillStyle=l.colorValueText,c.textAlign="center",c.textBaseline="alphabetic",c.fillText(P,De+Re/2,S+Ne/2-ve/3),c.restore()}}function Ye(c){var l=c.value,p=c.minValue,y=c.maxValue,S=.01*(y-p);return{normal:l<p?p:l>y?y:l,indented:l<p?p-S:l>y?y+S:l}}function Ee(c,l,p,y,S){p.beginPath(),p.arc(0,0,li(c),0,2*ma,!0),p.lineWidth=l,p.strokeStyle=S?oe.linearGradient(p,y,S,c):y,p.stroke(),p.closePath()}function Le(c,l){var p=si.pixelRatio;return c.maxRadius||(c.maxRadius=c.max-l.borderShadowWidth-l.borderOuterWidth*p-l.borderMiddleWidth*p-l.borderInnerWidth*p+(l.borderOuterWidth?.5:0)+(l.borderMiddleWidth?.5:0)+(l.borderInnerWidth?.5:0)),c.maxRadius}function pe(c,l){function p($,le,ge,ve,Ge,Ae){return le&&(!Ae&&l.borderShadowWidth&&(ge.save(),ge.shadowBlur=l.borderShadowWidth,ge.shadowColor=l.colorBorderShadow),Ee($,le*y,ge,ve,Ge),!Ae&&l.borderShadowWidth&&(Ae=!0,ge.restore())),Ae}var y=si.pixelRatio,S=l.borderShadowWidth*y,x=c.max-S-l.borderOuterWidth*y/2,E=x-l.borderOuterWidth*y/2-l.borderMiddleWidth*y/2+.5,O=E-l.borderMiddleWidth*y/2-l.borderInnerWidth*y/2+.5,P=Le(c,l),V=void 0,Q=!1;c.save(),Q=p(x,l.borderOuterWidth,c,l.colorBorderOuter,l.colorBorderOuterEnd,Q),Q=p(E,l.borderMiddleWidth,c,l.colorBorderMiddle,l.colorBorderMiddleEnd,Q),Q=p(O,l.borderInnerWidth,c,l.colorBorderInner,l.colorBorderInnerEnd,Q),!Q&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),c.beginPath(),c.arc(0,0,li(P),0,2*ma,!0),l.colorPlateEnd?(V=c.createRadialGradient(0,0,P/2,0,0,P),V.addColorStop(0,l.colorPlate),V.addColorStop(1,l.colorPlateEnd)):V=l.colorPlate,c.fillStyle=V,c.fill(),c.closePath(),c.restore()}function He(c,l){if(l.highlights!=="false"&&l.highlights.length&&l.highlightsWidth!==0){var p=c.max*(parseFloat(l.highlightsWidth)||0)/100,y=li(tt(c,l)-p/2),S=l.highlights.length,x=(l.maxValue-l.minValue)/l.ticksAngle;c.save();for(var E=0;E<S;E++){var O=l.highlights[E];c.lineWidth=p,c.lineCap=l.highlightsLineCap,c.strokeStyle=O.color,c.beginPath(),c.rotate(Ho),c.arc(0,0,y,oe.radians(l.startAngle+(O.from-l.minValue)/x),oe.radians(l.startAngle+(O.to-l.minValue)/x),!1),c.stroke(),c.closePath(),c.restore(),c.save()}c.restore()}}function bt(c,l){var p=tt(c,l),y=void 0,S=void 0,x=void 0,E=0,O=Math.abs(l.minorTicks)||0,P=l.ticksAngle/(l.maxValue-l.minValue);l.exactTicks?(S=l.maxValue-l.minValue,y=O?S/O:0,E=(Ai.mod(l.majorTicks[0],O)||0)*P):y=O*(l.majorTicks.length-1),c.lineWidth=si.pixelRatio,c.strokeStyle=l.colorMinorTicks||l.colorStrokeTicks,c.save();for(var V=0;V<y;++V)(x=l.startAngle+E+V*(l.ticksAngle/y))<=l.ticksAngle+l.startAngle&&(c.rotate(oe.radians(x)),c.beginPath(),c.moveTo(0,p),c.lineTo(0,p-.075*c.max),rn(c));c.restore()}function tt(c,l){var p=c.max/100;return Le(c,l)-5*p-(l.barWidth?2*(parseFloat(l.barStrokeWidth)||0)+((parseFloat(l.barWidth)||0)+5)*p:0)}function ot(c,l){oe.prepareTicks(l);var p=li(tt(c,l)),y=void 0,S=l.majorTicks.length,x=si.pixelRatio;c.lineWidth=2*x,y=l.colorMajorTicks instanceof Array?l.colorMajorTicks:new Array(S).fill(l.colorStrokeTicks||l.colorMajorTicks);for(var E=0;E<S;++E)c.save(),c.strokeStyle=y[E],c.rotate(oe.radians(vt(l,l.exactTicks?l.majorTicks[E]:E,S))),c.beginPath(),c.moveTo(0,p),c.lineTo(0,p-.15*c.max),c.stroke(),c.closePath(),c.restore();l.strokeTicks&&(c.save(),c.strokeStyle=l.colorStrokeTicks||y[0],c.rotate(Ho),c.beginPath(),c.arc(0,0,p,oe.radians(l.startAngle),oe.radians(l.startAngle+l.ticksAngle),!1),c.stroke(),c.closePath(),c.restore())}function vt(c,l,p){if(c.exactTicks){var y=c.ticksAngle/(c.maxValue-c.minValue);return c.startAngle+y*(l-c.minValue)}return c.startAngle+l*(c.ticksAngle/(p-1))}function rn(c){c.stroke(),c.restore(),c.closePath(),c.save()}function Ta(c,l){var p=tt(c,l)-.15*c.max,y={},S=0,x=l.majorTicks.length,E=l.animationTarget!=="needle",O=l.colorNumbers instanceof Array?l.colorNumbers:new Array(x).fill(l.colorNumbers),P=E?-(l.value-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle:0;for(E&&(c.save(),c.rotate(-oe.radians(P))),c.font=oe.font(l,"Numbers",c.max/200),c.lineWidth=0,c.textAlign="center",c.textBaseline="middle";S<x;++S){var V=P+vt(l,l.exactTicks?l.majorTicks[S]:S,x),Q=c.measureText(l.majorTicks[S]).width,$=l.fontNumbersSize,le=Math.sqrt(Q*Q+$*$)/2,ge=oe.radialPoint(p-le-l.numbersMargin/100*c.max,oe.radians(V));V===360&&(V=0),y[V]||(y[V]=!0,c.fillStyle=O[S],c.fillText(l.majorTicks[S],ge.x,ge.y))}E&&c.restore()}function Rr(c,l){l.title&&(c.save(),c.font=oe.font(l,"Title",c.max/200),c.fillStyle=l.colorTitle,c.textAlign="center",c.fillText(l.title,0,-c.max/4.25,.8*c.max),c.restore())}function Nr(c,l){l.units&&(c.save(),c.font=oe.font(l,"Units",c.max/200),c.fillStyle=l.colorUnits,c.textAlign="center",c.fillText(oe.formatContext(l,l.units),0,c.max/3.25,.8*c.max),c.restore())}function Vr(c,l){if(l.needle){var p=l.animationTarget!=="needle",y=l.ticksAngle<360?oe.normalizedValue(l).indented:l.value,S=p?l.startAngle:l.startAngle+(y-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle;l.barStartPosition==="right"&&(S=l.startAngle+l.ticksAngle-(y-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle);var x=Le(c,l),E=li(x/100*l.needleCircleSize),O=li(x/100*l.needleCircleSize*.75),P=li(x/100*l.needleEnd),V=li(l.needleStart?x/100*l.needleStart:0),Q=x/100*l.needleWidth,$=x/100*l.needleWidth/2,le=si.pixelRatio;c.save(),oe.drawNeedleShadow(c,l),c.rotate(oe.radians(S)),c.fillStyle=oe.linearGradient(c,l.colorNeedle,l.colorNeedleEnd,P-V),l.needleType==="arrow"?(c.beginPath(),c.moveTo(-$,-V),c.lineTo(-Q,0),c.lineTo(-1*le,P),c.lineTo(le,P),c.lineTo(Q,0),c.lineTo($,-V),c.closePath(),c.fill(),c.beginPath(),c.lineTo(-.5*le,P),c.lineTo(-1*le,P),c.lineTo(-Q,0),c.lineTo(-$,-V),c.lineTo($/2*le-2*le,-V),c.closePath(),c.fillStyle=l.colorNeedleShadowUp,c.fill()):(c.beginPath(),c.moveTo(-$,P),c.lineTo(-$,V),c.lineTo($,V),c.lineTo($,P),c.closePath(),c.fill()),c.restore(),l.needleCircleSize&&(c.save(),oe.drawNeedleShadow(c,l),l.needleCircleOuter&&(c.beginPath(),c.arc(0,0,E,0,2*ma,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleOuter,l.colorNeedleCircleOuterEnd,E),c.fill(),c.closePath()),l.needleCircleInner&&(c.beginPath(),c.arc(0,0,O,0,2*ma,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleInner,l.colorNeedleCircleInnerEnd,O),c.fill(),c.closePath()),c.restore())}}function Wr(c,l,p){oe.drawValueBox(c,l,p,0,c.max-.33*c.max,c.max)}function Jc(c){var l=c.startAngle,p=c.startAngle+c.ticksAngle,y=l,S=l+(oe.normalizedValue(c).normal-c.minValue)/(c.maxValue-c.minValue)*c.ticksAngle;if(c.barStartPosition==="middle"){var x=.5*(c.minValue+c.maxValue);c.value<x?(y=180-(x-oe.normalizedValue(c).normal)/(c.maxValue-c.minValue)*c.ticksAngle,S=180):(y=180,S=180+(oe.normalizedValue(c).normal-x)/(c.maxValue-c.minValue)*c.ticksAngle)}else c.barStartPosition==="right"&&(y=p-S+l,S=p);return{startAngle:y,endAngle:S}}function Lr(c,l){var p=c.max/100,y=Le(c,l)-5*p,S=parseFloat(l.barStrokeWidth+"")||0,x=(parseFloat(l.barWidth+"")||0)*p,E=y-2*S-x,O=(y-E)/2,P=E+O,V=S/P,Q=l.startAngle,$=l.startAngle+l.ticksAngle;if(c.save(),c.rotate(Ho),S&&(c.beginPath(),c.arc(0,0,P,oe.radians(Q)-V,oe.radians($)+V,!1),c.strokeStyle=l.colorBarStroke,c.lineWidth=2*O,c.stroke(),c.closePath()),x&&(c.beginPath(),c.arc(0,0,P,oe.radians(Q),oe.radians($),!1),c.strokeStyle=l.colorBar,c.lineWidth=x,c.stroke(),c.closePath(),l.barShadow&&(c.save(),c.beginPath(),c.arc(0,0,y,oe.radians(Q),oe.radians($),!1),c.clip(),c.beginPath(),c.strokeStyle=l.colorBar,c.lineWidth=1,c.shadowBlur=l.barShadow,c.shadowColor=l.colorBarShadow,c.shadowOffsetX=0,c.shadowOffsetY=0,c.arc(0,0,y,oe.radians(l.startAngle),oe.radians(l.startAngle+l.ticksAngle),!1),c.stroke(),c.closePath(),c.restore()),l.barProgress)){var le=Jc(l),ge=le.startAngle,ve=le.endAngle;c.beginPath(),c.arc(0,0,P,oe.radians(ge),oe.radians(ve),!1),c.strokeStyle=l.colorBarProgress,c.lineWidth=x,c.stroke(),c.closePath()}c.restore()}function Gr(c){return c.options.animatedValue?c.options.value:c.value}function em(c,l,p,y,S,x,E,O){c.beginPath(),c.fillStyle=O?oe.linearGradient(c,E,O,S>x?S:x,x>S,S>x?p:y):E,l>0?oe.roundRect(c,p,y,S,x,l):c.rect(p,y,S,x),c.fill(),c.closePath()}function tm(c,l,p,y,S,x,E,O,P){c.beginPath(),c.lineWidth=l,c.strokeStyle=P?oe.linearGradient(c,O,P,E,!0,S):O,p>0?oe.roundRect(c,y,S,x,E,p):c.rect(y,S,x,E),c.stroke(),c.closePath()}function im(c,l,p,y,S,x){function E(Pe,Ue,Qe,Rt){return Pe&&(!Rt&&l.borderShadowWidth&&(c.save(),c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),tm(c,Pe*O,P,p+Pe*O/2-fe,y+Pe*O/2-fe,V,ge,Ue,Qe),fe+=.5*O,!Rt&&l.borderShadowWidth&&(Rt=!0,c.restore())),Rt}var O=si.pixelRatio,P=l.borderRadius*O,V=S-l.borderShadowWidth-l.borderOuterWidth*O,Q=V-l.borderOuterWidth*O-l.borderMiddleWidth*O,$=Q-l.borderMiddleWidth*O-l.borderInnerWidth*O,le=$-l.borderInnerWidth*O,ge=x-l.borderShadowWidth-l.borderOuterWidth*O,ve=ge-l.borderOuterWidth*O-l.borderMiddleWidth*O,Ge=ve-l.borderMiddleWidth*O-l.borderInnerWidth*O,Ae=Ge-l.borderInnerWidth*O,Re=p-(Q-V)/2,Ne=Re-($-Q)/2,Fe=Ne-(le-$)/2,ke=y-(ve-ge)/2,De=ke-(Ge-ve)/2,xe=De-(Ae-Ge)/2,fe=0,Ce=!1;return c.save(),Ce=E(l.borderOuterWidth,l.colorBorderOuter,l.colorBorderOuterEnd,Ce),Ce=E(l.borderMiddleWidth,l.colorBorderMiddle,l.colorBorderMiddleEnd,Ce),Ce=E(l.borderInnerWidth,l.colorBorderInner,l.colorBorderInnerEnd,Ce),!Ce&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),em(c,P,Fe,xe,le+2*fe,Ae+2*fe,l.colorPlate,l.colorPlateEnd),c.restore(),[Fe,xe,le,Ae]}function nm(c,l,p,y,S,x){var E=si.pixelRatio,O=x>=S,P=O?.85*S:x,V=O?x:S;p=O?we(p+(S-P)/2):p;var Q=!!l.title,$=!!l.units,le=!!l.valueBox,ge=void 0,ve=void 0,Ge=void 0;O?(ve=we(.05*V),ge=we(.075*V),Ge=we(.11*V),Q&&(V-=ge,y+=ge),$&&(V-=ve),le&&(V-=Ge)):(ve=ge=we(.15*P),Q&&(P-=ge,y+=ge),$&&(P-=ve));var Ae=2*l.barStrokeWidth,Re=l.barBeginCircle?we(P*l.barBeginCircle/200-Ae/2):0,Ne=we(P*l.barWidth/100-Ae),Fe=we(V*l.barLength/100-Ae),ke=we((V-Fe)/2),De=we(p+(O?P/2:ke+Re)),xe=we(y+(O?V-ke-Re+Ae/2:P/2)),fe=!O||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P,Ce=O||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P;return c.barDimensions={isVertical:O,width:P,length:V,barWidth:Ne,barLength:Fe,strokeWidth:Ae,barMargin:ke,radius:Re,pixelRatio:E,barOffset:null,titleMargin:Q?ge:0,unitsMargin:$?ve:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:p+fe,Y:y+Ce,x0:De+fe,y0:xe+Ce,baseX:p,baseY:y,ticksPadding:l.ticksPadding/100},c.barDimensions}function Fr(c,l,p,y,S,x,E){var O=nm(c,l,y,S,x,E),P=O.isVertical,V=O.width,Q=O.barWidth,$=O.barLength,le=O.strokeWidth,ge=O.barMargin,ve=O.radius,Ge=O.x0,Ae=O.y0,Re=O.X,Ne=O.Y,Fe=$;c.save(),c.beginPath();var ke=null;if(l.barBeginCircle){var De=oe.radians(P?270:0),xe=Math.asin(Q/2/ve),fe=Math.cos(xe),Ce=Math.sin(xe),Pe=Ge+(P?ve*Ce:ve*fe-le/2),Ue=P?Ae-ve*fe:Ae+ve*Ce,Qe=li(P?Ue-Ae:Pe-Ge);ke=we(Qe+ve);var Rt=P?we(Ge-ve*Ce):Pe,jt=P?Ue:we(Ae-ve*Ce);p==="progress"&&($=ke+($-ke)*(oe.normalizedValue(l).normal-l.minValue)/(l.maxValue-l.minValue));var ua=we(Pe+$-ke+le/2),ln=we(Ue-$+ke-le/2);c.arc(Ge,Ae,ve,De+xe,De-xe),P?(c.moveTo(Pe,jt),c.lineTo(Pe,ln),c.lineTo(Rt,ln),c.lineTo(Rt,jt)):(c.moveTo(Pe,jt),c.lineTo(ua,jt),c.lineTo(ua,Ue),c.lineTo(Pe,Ue))}else{var Qr=we(P?Re+(V-Q)/2:Re+ge),$r=we(P?Ne+$+ge:Ne+(V-Q)/2);p==="progress"&&($*=(l.value-l.minValue)/(l.maxValue-l.minValue)),P?c.rect(Qr,$r,Q,-$):c.rect(Qr,$r,$,Q)}p!=="progress"&&l.barStrokeWidth&&(c.lineWidth=le,c.strokeStyle=l.colorBarStroke,c.stroke()),p!=="progress"&&l.colorBar?(c.fillStyle=l.colorBarEnd?oe.linearGradient(c,l.colorBar,l.colorBarEnd,$,P,P?Ne:Re):l.colorBar,c.fill()):p==="progress"&&l.colorBarProgress&&(c.fillStyle=l.colorBarProgressEnd?oe.linearGradient(c,l.colorBarProgress,l.colorBarProgressEnd,Fe,P,P?Ne:Re):l.colorBarProgress,c.fill()),c.closePath(),c.restore(),l.barBeginCircle&&(c.barDimensions.radius+=le),c.barDimensions.barOffset=ke,c.barDimensions.barWidth+=le,c.barDimensions.barLength+=le}function am(c,l,p,y,S,x){Fr(c,l,"",p,y,S,x)}function Br(c,l){return l.needleSide!==c||l.tickSide!==c||l.numberSide!==c}function om(c,l,p,y,S,x){l.barProgress&&Fr(c,l,"progress",p,y,S,x)}function rm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,E=p.barWidth,O=p.barOffset,P=p.barMargin,V=p.X,Q=p.Y,$=p.ticksLength,le=p.ticksPadding,ge=S*(parseFloat(l.highlightsWidth)||0)/100;if(l.highlights&&ge){var ve=l.tickSide!=="right",Ge=l.tickSide!=="left",Ae=0,Re=l.highlights.length,Ne=(S-E)/2,Fe=l.maxValue-l.minValue,ke=we(y?V+Ne:V+P+O),De=ge,xe=y?Q+x-P-O:Q+Ne,fe=we((l.ticksWidth/100+le)*S)+(ge-l.ticksWidth/100*S),Ce=we(E+le*S);for(c.save();Ae<Re;Ae++){var Pe=l.highlights[Ae],Ue=$*li(l.minValue-Pe.from)/Fe,Qe=$*li((Pe.to-Pe.from)/Fe);c.beginPath(),c.fillStyle=Pe.color,y?(ve&&c.rect(ke-fe,xe-Ue,De,-Qe),Ge&&c.rect(ke+Ce,xe-Ue,De,-Qe)):(ve&&c.rect(ke+Ue,xe-fe,Qe,De),Ge&&c.rect(ke+Ue,xe+Ce,Qe,De)),c.fill(),c.closePath()}c.restore()}}function Ea(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function Ur(c,l,p,y,S,x,E,O,P){var V=c.barDimensions,Q=V.isVertical,$=V.length,le=V.barWidth,ge=V.barOffset,ve=V.barMargin,Ge=V.pixelRatio,Ae=V.width,Re=V.X,Ne=V.Y,Fe=V.ticksLength,ke=V.ticksPadding,De=(Ae-le)/2,xe=void 0,fe=void 0,Ce=0,Pe=p.length,Ue=void 0,Qe=P*Ae,Rt=De-ke*Ae,jt=De+le+Qe+ke*Ae,ua=l instanceof Array?l:new Array(p.length).fill(l);c.save(),c.lineWidth=O*Ge;for(var ln=Fe/(S-y);Ce<Pe;Ce++)Ue=p[Ce],c.strokeStyle=ua[Ce],Q?(fe=Ne+$-ve-ge+(y-Ue)*ln,x&&(xe=Re+Rt,Ea(c,xe,fe,we(xe-Qe),fe)),E&&(xe=Re+jt,Ea(c,xe,fe,we(xe-Qe),fe))):(xe=Re+ve+ge-(y-Ue)*ln,x&&(fe=Ne+Rt,Ea(c,xe,fe,xe,we(fe-Qe))),E&&(fe=Ne+jt,Ea(c,xe,we(fe),xe,fe-Qe)));c.restore()}function sm(c,l){var p=oe.prepareTicks(l),y=zr(p,2),S=y[0],x=y[1],E=2,O=(l.maxValue-l.minValue)/(l.majorTicks.length-1),P=l.colorMajorTicks instanceof Array?l.colorMajorTicks:new Array(l.majorTicks.length).fill(l.colorStrokeTicks||l.colorMajorTicks);if(Ur(c,P,l.exactTicks?l.majorTicks:l.majorTicks.map(function(Qe,Rt){return l.minValue+O*Rt}),l.minValue,l.maxValue,S,x,E,l.ticksWidth/100),l.strokeTicks){var V=c.barDimensions,Q=V.isVertical,$=V.length,le=V.width,ge=V.barWidth,ve=V.barMargin,Ge=V.barOffset,Ae=V.X,Re=V.Y,Ne=V.ticksLength,Fe=V.pixelRatio,ke=V.ticksPadding,De=(le-ge)/2+ge+ke*le,xe=(le-ge)/2-ke*le,fe=void 0,Ce=void 0,Pe=void 0,Ue=void 0;c.strokeStyle=l.colorStrokeTicks||P[0],E*=Fe,Q?(Ce=Re+$-ve-Ge+E/2,Ue=Ce-Ne-E,S&&(Pe=fe=we(Ae+xe),Da(c,fe,Ce,Pe,Ue)),x&&(Pe=fe=we(Ae+De),Da(c,fe,Ce,Pe,Ue))):(fe=Ae+ve+Ge-E/2,Pe=fe+Ne+E,S&&(Ue=Ce=we(Re+xe),Da(c,fe,Ce,Pe,Ue)),x&&(Ue=Ce=we(Re+De),Da(c,fe,Ce,Pe,Ue)))}}function Da(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function lm(c,l){var p=oe.prepareTicks(l),y=zr(p,2),S=y[0],x=y[1],E=[],O=l.minValue,P=Math.abs(l.minorTicks)||0,V=P?(l.maxValue-l.minValue)/(P*(l.majorTicks.length-1)):0;if(P)if(l.exactTicks)for(var Q=Ai.mod(l.majorTicks[0],P)||0;O<l.maxValue;O+=P)Q+O<l.maxValue&&E.push(Q+O);else for(;O<l.maxValue;O+=V)E.push(O);Ur(c,l.colorMinorTicks||l.colorStrokeTicks,E,l.minValue,l.maxValue,S,x,1,l.ticksWidthMinor/100)}function dm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.length,x=p.width,E=p.barWidth,O=p.barMargin,P=p.barOffset,V=p.X,Q=p.Y,$=p.ticksLength,le=p.ticksPadding,ge=l.maxValue-l.minValue,ve=ge/(l.majorTicks.length-1),Ge=l.exactTicks?l.majorTicks:l.majorTicks.map(function(ua,ln){return l.minValue+ve*ln}),Ae=Ge.length,Re=l.numberSide!=="right",Ne=l.numberSide!=="left",Fe=l.fontNumbersSize*x/200,ke=0,De=(l.ticksWidth/100+2*le)*x,xe=(x-E)/2-De,fe=(x-E)/2+E+De,Ce=void 0,Pe=void 0,Ue=void 0,Qe=void 0,Rt=l.colorNumbers instanceof Array?l.colorNumbers:new Array(Ae).fill(l.colorNumbers),jt=l.numbersMargin/100*x;for(c.font=oe.font(l,"Numbers",x/200),c.lineWidth=0,c.textAlign="center";ke<Ae;ke++)c.fillStyle=Rt[ke],Qe=l.majorTicks[ke],Ue=l.exactTicks?$*((Ge[ke]-l.minValue)/ge):ke*$/(Ae-1),y?(Pe=Q+S-O-P-Ue+Fe/3,Re&&(c.textAlign="right",c.fillText(Qe,V+xe-jt,Pe)),Ne&&(c.textAlign="left",c.fillText(Qe,V+fe+jt,Pe))):(c.measureText(Qe).width,Ce=V+O+P+Ue,Re&&c.fillText(Qe,Ce,Q+xe-jt),Ne&&c.fillText(Qe,Ce,Q+fe+Fe+jt))}function cm(c,l){if(l.title){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,E=p.baseX,O=p.baseY,P=p.titleMargin,V=l.fontTitleSize*S/200,Q=we(E+(y?S:x)/2),$=we(O+P/2-(y?V:V/2)-.025*(y?x:S));c.save(),c.textAlign="center",c.fillStyle=l.colorTitle,c.font=oe.font(l,"Title",S/200),c.lineWidth=0,c.fillText(l.title,Q,$,y?S:x),c.restore()}}function mm(c,l){if(l.units){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,E=p.baseX,O=p.baseY,P=p.unitsMargin,V=l.fontUnitsSize*S/200,Q=we(E+(y?S:x)/2),$=we(O+(y?x:S)+P/2-V/2);c.save(),c.textAlign="center",c.fillStyle=l.colorUnits,c.font=oe.font(l,"Units",S/200),c.lineWidth=0,c.fillText(oe.formatContext(l,l.units),Q,$,y?S:x),c.restore()}}function um(c,l){if(l.needle){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,E=p.barWidth,O=p.barOffset,P=p.barMargin,V=p.ticksLength,Q=p.X,$=p.Y,le=p.ticksPadding,ge=l.needleSide!=="right",ve=l.needleSide!=="left",Ge=V*(oe.normalizedValue(l).indented-l.minValue)/(l.maxValue-l.minValue),Ae=(l.ticksWidth/100+le)*S,Re=E/2+Ae,Ne=Re*(l.needleEnd/100),Fe=void 0,ke=void 0,De=void 0,xe=void 0,fe=l.needleType.toLowerCase()==="arrow"?pm:hm,Ce=(S-E)/2,Pe=Re*(l.needleStart/100),Ue=Ce-Ae-Pe,Qe=Ce+E+Ae+Pe;c.save(),oe.drawNeedleShadow(c,l),y?(De=we($+x-P-O-Ge),ge&&(Fe=we(Q+Ue),ke=Fe+Ne,fe(c,l,Fe,De,ke,De,Ne)),ve&&(Fe=we(Q+Qe),ke=Fe-Ne,fe(c,l,Fe,De,ke,De,Ne,!0))):(Fe=we(Q+P+O+Ge),ge&&(De=we($+Ue),xe=De+Ne,fe(c,l,Fe,De,Fe,xe,Ne)),ve&&(De=we($+Qe),xe=De-Ne,fe(c,l,Fe,De,Fe,xe,Ne,!0))),c.restore()}}function qr(c,l,p,y){return l.colorNeedleEnd?oe.linearGradient(c,y?l.colorNeedleEnd:l.colorNeedle,y?l.colorNeedle:l.colorNeedleEnd,p,!c.barDimensions.isVertical):l.colorNeedle}function hm(c,l,p,y,S,x,E,O){c.lineWidth=l.needleWidth,c.strokeStyle=qr(c,l,E,O),c.beginPath(),c.moveTo(p,y),c.lineTo(S,x),c.stroke(),c.closePath()}function pm(c,l,p,y,S,x,E,O){var P=we(.4*E),V=E-P,Q=p===S,$=l.needleWidth/2;c.fillStyle=qr(c,l,E,O),c.beginPath(),Q?(y>x&&(V*=-1),c.moveTo(p-$,y),c.lineTo(p+$,y),c.lineTo(p+$,y+V),c.lineTo(p,x),c.lineTo(p-$,y+V),c.lineTo(p-$,y)):(p>S&&(V*=-1),c.moveTo(p,y-$),c.lineTo(p,y+$),c.lineTo(p+V,y+$),c.lineTo(S,y),c.lineTo(p+V,y-$),c.lineTo(p,y-$)),c.fill(),c.closePath()}function gm(c,l,p,y,S,x,E){var O=(parseFloat(l.fontValueSize)||0)*x/200,P=(.11*E-O)/2;c.barDimensions.isVertical&&oe.drawValueBox(c,l,p,y+x/2,S+E-O-P,x)}var zr=(function(){function c(l,p){var y=[],S=!0,x=!1,E=void 0;try{for(var O,P=l[Symbol.iterator]();!(S=(O=P.next()).done)&&(y.push(O.value),!p||y.length!==p);S=!0);}catch(V){x=!0,E=V}finally{try{!S&&P.return&&P.return()}finally{if(x)throw E}}return y}return function(l,p){if(Array.isArray(l))return l;if(Symbol.iterator in Object(l))return c(l,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),Bo=function c(l,p,y){l===null&&(l=Function.prototype);var S=Object.getOwnPropertyDescriptor(l,p);if(S===void 0){var x=Object.getPrototypeOf(l);return x===null?void 0:c(x,p,y)}if("value"in S)return S.value;var E=S.get;if(E!==void 0)return E.call(y)},fm=function c(l,p,y,S){var x=Object.getOwnPropertyDescriptor(l,p);if(x===void 0){var E=Object.getPrototypeOf(l);E!==null&&c(E,p,y,S)}else if("value"in x&&x.writable)x.value=y;else{var O=x.set;O!==void 0&&O.call(S,y)}return y},sn=(function(){function c(l,p){for(var y=0;y<p.length;y++){var S=p[y];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(l,S.key,S)}}return function(l,p,y){return p&&c(l.prototype,p),y&&c(l,y),l}})(),Pa=null,bm=(function(){function c(){i(this,c),this._events={},this.addListener=this.on,this.removeListener=this.off}return sn(c,[{key:"emit",value:function(l){if(this._events[l]){for(var p=0,y=this._events[l].length,S=arguments.length,x=Array(S>1?S-1:0),E=1;E<S;E++)x[E-1]=arguments[E];for(;p<y;p++)this._events[l][p]&&this._events[l][p].apply(this,x)}}},{key:"once",value:function(l){for(var p=arguments.length,y=Array(p>1?p-1:0),S=1;S<p;S++)y[S-1]=arguments[S];for(var x=0,E=y.length,O=this;x<E;x++)(function(){var P=y[x],V=function Q(){O.off(l,Q),P.apply(O,arguments)};y[x]=V})();this.on.apply(this,[l].concat(y))}},{key:"on",value:function(l){this._events[l]||(this._events[l]=[]);for(var p=0,y=arguments.length<=1?0:arguments.length-1;p<y;p++)this._events[l].push(arguments.length<=p+1?void 0:arguments[p+1])}},{key:"off",value:function(l){if(this._events[l])for(var p=0,y=arguments.length<=1?0:arguments.length-1;p<y;p++)for(var S=arguments.length<=p+1?void 0:arguments[p+1],x=void 0;~(x=this._events[l].indexOf(S));)this._events[l].splice(x,1)}},{key:"removeAllListeners",value:function(l){delete this._events[l]}},{key:"listeners",get:function(){return this._events}}]),c})(),Hr=a("requestAnimationFrame")||function(c){return setTimeout(function(){return c(new Date().getTime())},1e3/60)},da={linear:function(c){return c},quad:function(c){return Math.pow(c,2)},dequad:function(c){return 1-da.quad(1-c)},quint:function(c){return Math.pow(c,5)},dequint:function(c){return 1-Math.pow(1-c,5)},cycle:function(c){return 1-Math.sin(Math.acos(c))},decycle:function(c){return Math.sin(Math.acos(1-c))},bounce:function(c){return 1-da.debounce(1-c)},debounce:function(c){for(var l=0,p=1;;l+=p,p/=2)if(c>=(7-4*l)/11)return-Math.pow((11-6*l-11*c)/4,2)+Math.pow(p,2)},elastic:function(c){return 1-da.delastic(1-c)},delastic:function(c){return Math.pow(2,10*(c-1))*Math.cos(20*Math.PI*1.5/3*c)}},Uo=(function(){function c(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,c),this.duration=p,this.rule=l,this.draw=y,this.end=S,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",y);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",S)}return sn(c,[{key:"animate",value:function(l,p){var y=this;this.frame&&this.cancel();var S=window.performance&&window.performance.now?window.performance.now():a("animationStartTime")||Date.now();l=l||this.draw,p=p||this.end,this.draw=l,this.end=p,this.frame=Hr(function(x){return r(x,l,S,da[y.rule]||y.rule,y.duration,p,y)})}},{key:"cancel",value:function(){this.frame&&((a("cancelAnimationFrame")||function(l){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),c})();Uo.rules=da;var wn=(function(){function c(l,p,y){i(this,c),this.options=l,this.element=p.toLowerCase(),this.type=c.toDashed(y),this.Type=n[y],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||c.domReady(this.traverse.bind(this))}return sn(c,[{key:"isValidNode",value:function(l){return!(!l.tagName||l.tagName.toLowerCase()!==this.element||l.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var l=document.getElementsByTagName(this.element),p=0,y=l.length;p<y;p++)this.process(l[p]);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(l){for(var p=0,y=l.length;p<y;p++){var S=l[p];if(S.type==="attributes"&&S.attributeName==="data-type"&&this.isValidNode(S.target)&&S.oldValue!==this.type)setTimeout(this.process.bind(this,S.target));else if(S.addedNodes&&S.addedNodes.length)for(var x=0,E=S.addedNodes.length;x<E;x++)setTimeout(this.process.bind(this,S.addedNodes[x]))}}},{key:"process",value:function(l){var p=this;if(!this.isValidNode(l))return null;var y=void 0,S=JSON.parse(JSON.stringify(this.options)),x=null;for(y in S)if(S.hasOwnProperty(y)){var E=c.toAttributeName(y),O=c.parse(l.getAttribute(E));O!=null&&(S[y]=O)}return S.renderTo=l,x=new this.Type(S),x.draw&&x.draw(),this.isObservable&&(x.observer=new MutationObserver(function(P){P.forEach(function(V){if(V.type==="attributes"){var Q=V.attributeName.toLowerCase(),$=l.getAttribute(Q).toLowerCase();if(Q==="data-type"&&$&&$!==p.type)x.observer.disconnect(),delete x.observer,x.destroy&&x.destroy();else if(Q.substr(0,5)==="data-"){var le=Q.substr(5).split("-").map(function(ve,Ge){return Ge?ve.charAt(0).toUpperCase()+ve.substr(1):ve}).join(""),ge={};ge[le]=c.parse(l.getAttribute(V.attributeName)),le==="value"?x&&(x.value=ge[le]):x.update&&x.update(ge)}}})}),x.observer.observe(l,{attributes:!0})),x}}],[{key:"parse",value:function(l){if(l==="true")return!0;if(l==="false")return!1;if(l!=="undefined"){if(l==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(l))return l.split(",");try{return JSON.parse(l)}catch{}return l}}},{key:"toDashed",value:function(l){for(var p=l.split(/(?=[A-Z])/),y=1,S=p.length,x=p[0].toLowerCase();y<S;y++)x+="-"+p[y].toLowerCase();return x}},{key:"toCamelCase",value:function(l){for(var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],y=l.split(/-/),S=0,x=y.length,E="";S<x;S++)E+=S||p?y[S][0].toUpperCase()+y[S].substr(1).toLowerCase():y[S].toLowerCase();return E}},{key:"toAttributeName",value:function(l){return"data-"+c.toDashed(l)}},{key:"domReady",value:function(l){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return l();window.addEventListener?window.addEventListener("DOMContentLoaded",l,!1):window.attachEvent&&window.attachEvent("onload",l)}}]),c})(),si=(function(){function c(l,p,y){i(this,c),c.collection.push(this),this.width=p||0,this.height=y||0,this.element=l,this.init()}return sn(c,[{key:"init",value:function(){var l=c.pixelRatio;this.element.width=this.width*l,this.element.height=this.height*l,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 l=c.collection.indexOf(this);~l&&c.collection.splice(l,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 l=c.pixelRatio;return l!==1&&this.contextClone.scale(l,l),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var l=0,p=c.collection.length;l<p;l++)c.collection[l].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),c})();si.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(si.redraw);var qo={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(c){if(typeof c=="string")for(var l=0,p=this.length;l<p;l++){var y=this[l].options.renderTo.tagName?this[l].options.renderTo:document.getElementById(this[l].options.renderTo||"");if(y.getAttribute("id")===c)return this[l]}else if(typeof c=="number")return this[c];return null};var zo="2.2.1",we=Math.round,li=Math.abs,ca=new s;ca.version=zo;var Ai=(function(c){function l(p){i(this,l);var y=e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this)),S=y.constructor.name;if(S==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(ca.push(y),p.listeners&&Object.keys(p.listeners).forEach(function(E){(p.listeners[E]instanceof Array?p.listeners[E]:[p.listeners[E]]).forEach(function(O){y.on(E,O)})}),y.version=zo,y.type=n[S]||l,y.initialized=!1,p.minValue=parseFloat(p.minValue),p.maxValue=parseFloat(p.maxValue),p.value=parseFloat(p.value)||0,p.borders||(p.borderInnerWidth=p.borderMiddleWidth=p.borderOuterWidth=0),!p.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var x=p.renderTo.tagName?p.renderTo:document.getElementById(p.renderTo);if(!(x instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return p.width=parseFloat(p.width)||0,p.height=parseFloat(p.height)||0,p.width&&p.height||(p.width||(p.width=x.parentNode?x.parentNode.offsetWidth:x.offsetWidth),p.height||(p.height=x.parentNode?x.parentNode.offsetHeight:x.offsetHeight)),y.options=p||{},y.options.animateOnInit&&(y._value=y.options.value,y.options.value=y.options.minValue),y.canvas=new si(x,p.width,p.height),y.canvas.onRedraw=y.draw.bind(y),y.animation=new Uo(p.animationRule,p.animationDuration),y}return t(l,c),sn(l,[{key:"update",value:function(p){return Object.assign(this.options,this.type.configure(p||{})),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 p=ca.indexOf(this);~p&&ca.splice(p,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(p){var y=this;p=l.ensureValue(p,this.options.minValue);var S=this.options.value;if(p!==S)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===p))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=p),this.emit("animationStart"),this.animation.animate(function(x){var E=S+(p-S)*x;y.options.animatedValue&&y.emit("value",E,y.value),y.options.value=E,y.draw(),y.emit("animate",x,y.options.value)},function(){y._value!==void 0&&(y.emit("value",y._value,y.value),y.options.value=y._value,delete y._value),y.draw(),y.emit("animationEnd"),y.animation.frame=null})}else this.emit("value",p,this.value),this.options.value=p,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(p){return p}},{key:"initialize",value:function(p,y){return new wn(y,"canvas",p)}},{key:"fromElement",value:function(p){var y=wn.toCamelCase(p.getAttribute("data-type")),S=p.attributes,x=0,E=S.length,O={};if(y){for(/Gauge$/.test(y)||(y+="Gauge");x<E;x++)O[wn.toCamelCase(S[x].name.replace(/^data-/,""),!1)]=wn.parse(S[x].value);new wn(O,p.tagName,y).process(p)}}},{key:"ensureValue",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return p=parseFloat(p),!isNaN(p)&&isFinite(p)||(p=parseFloat(y)||0),p}},{key:"mod",value:function(p,y){return(p%y+y)%y}},{key:"version",get:function(){return zo}}]),l})(bm);n!==void 0&&(n.BaseGauge=Ai,n.gauges=(window.document||{}).gauges=ca);var Am=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,oe={roundRect:C,padValue:M,formatMajorTickNumber:N,radians:D,radialPoint:j,linearGradient:X,drawNeedleShadow:Z,drawValueBox:Te,verifyError:h,prepareTicks:b,font:ee,normalizedValue:Ye,formatContext:f},ma=Math.PI,Ho=ma/2,jr=Object.assign({},qo,{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"}),vm=(function(c){function l(p){return i(this,l),p=Object.assign({},jr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),sn(l,[{key:"draw",value:function(){try{var p=this.canvas,y=[-p.drawX,-p.drawY,p.drawWidth,p.drawHeight],S=y[0],x=y[1],E=y[2],O=y[3],P=this.options;if(P.animationTarget==="needle"){if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,E,O),this.emit("beforePlate"),pe(V,P),this.emit("beforeHighlights"),He(V,P),this.emit("beforeMinorTicks"),bt(V,P),this.emit("beforeMajorTicks"),ot(V,P),this.emit("beforeNumbers"),Ta(V,P),this.emit("beforeTitle"),Rr(V,P),this.emit("beforeUnits"),Nr(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,E,O),p.context.drawImage(p.elementClone,S,x,E,O),this.emit("beforeProgressBar"),Lr(p.context,P),this.emit("beforeValueBox"),Wr(p.context,P,Gr(this)),this.emit("beforeNeedle"),Vr(p.context,P)}else{var Q=-oe.radians((P.value-P.minValue)/(P.maxValue-P.minValue)*P.ticksAngle);if(p.context.clearRect(S,x,E,O),this.emit("beforePlate"),pe(p.context,P),p.context.rotate(Q),this.emit("beforeHighlights"),He(p.context,P),this.emit("beforeMinorTicks"),bt(p.context,P),this.emit("beforeMajorTicks"),ot(p.context,P),this.emit("beforeNumbers"),Ta(p.context,P),this.emit("beforeProgressBar"),Lr(p.context,P),p.context.rotate(-Q),!p.elementClone.initialized){var $=p.contextClone;$.clearRect(S,x,E,O),this.emit("beforeTitle"),Rr($,P),this.emit("beforeUnits"),Nr($,P),this.emit("beforeNeedle"),Vr($,P),p.elementClone.initialized=!0}p.context.drawImage(p.elementClone,S,x,E,O)}this.emit("beforeValueBox"),Wr(p.context,P,Gr(this)),Bo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch(le){oe.verifyError(le)}return this}},{key:"value",set:function(p){p=Ai.ensureValue(p,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=p,p=this.options.value+((p-this.options.value)%360+540)%360-180),fm(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",p,this)},get:function(){return Bo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",this)}}],[{key:"configure",value:function(p){return p.barWidth>50&&(p.barWidth=50),isNaN(p.startAngle)&&(p.startAngle=45),isNaN(p.ticksAngle)&&(p.ticksAngle=270),p.ticksAngle>360&&(p.ticksAngle=360),p.ticksAngle<0&&(p.ticksAngle=0),p.startAngle<0&&(p.startAngle=0),p.startAngle>360&&(p.startAngle=360),p}}]),l})(Ai);n!==void 0&&(n.RadialGauge=vm),Ai.initialize("RadialGauge",jr);var Yr=Object.assign({},qo,{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}),ym=(function(c){function l(p){return i(this,l),p=Object.assign({},Yr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),sn(l,[{key:"draw",value:function(){try{var p=this.canvas,y=[-p.drawX,-p.drawY,p.drawWidth,p.drawHeight],S=y[0],x=y[1],E=y[2],O=y[3],P=this.options;if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,E,O),this.emit("beforePlate"),this.drawBox=im(V,P,S,x,E,O),this.emit("beforeBar"),am.apply(void 0,[V,P].concat(o(this.drawBox))),p.contextClone.barDimensions=V.barDimensions,this.emit("beforeHighlights"),rm(V,P),this.emit("beforeMinorTicks"),lm(V,P),this.emit("beforeMajorTicks"),sm(V,P),this.emit("beforeNumbers"),dm(V,P),this.emit("beforeTitle"),cm(V,P),this.emit("beforeUnits"),mm(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,E,O),p.context.drawImage(p.elementClone,S,x,E,O),this.emit("beforeProgressBar"),om.apply(void 0,[p.context,P].concat(o(this.drawBox))),this.emit("beforeNeedle"),um(p.context,P),this.emit("beforeValueBox"),gm.apply(void 0,[p.context,P,P.animatedValue?this.options.value:this.value].concat(o(this.drawBox))),Bo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch(Q){oe.verifyError(Q)}return this}}],[{key:"configure",value:function(p){return p.barStrokeWidth>=p.barWidth&&(p.barStrokeWidth=we(p.barWidth/2)),p.hasLeft=Br("right",p),p.hasRight=Br("left",p),p.value>p.maxValue&&(p.value=p.maxValue),p.value<p.minValue&&(p.value=p.minValue),Ai.configure(p)}}]),l})(Ai);n!==void 0&&(n.LinearGauge=ym),Ai.initialize("LinearGauge",Yr),typeof Eo<"u"&&Object.assign(n,{Collection:s,GenericOptions:qo,Animation:Uo,BaseGauge:Ai,drawings:oe,SmartCanvas:si,DomObserver:wn,vendorize:a})})(typeof Eo<"u"?Eo.exports:window)});var Ei=(()=>{class n{appSettings=A(Zt);data=A(Ci);_svcDatasetConfigs=[];_svcDataSource=[];_svcSubjectObserverRegistry=[];signedAnglePaths=new Set(["self.navigation.attitude.roll","self.navigation.attitude.pitch","self.navigation.attitude.yaw","self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater","self.steering.rudderAngle"]);constructor(){this._svcDatasetConfigs=this.appSettings.getDataSets(),this.cleanupDatasets(),this.startAll()}cleanupDatasets(){if(this.appSettings.configUpgrade()||this.appSettings.getAppConfig().configVersion<12)return;let t=this.appSettings.getDashboardConfig(),i=new Set;t.forEach(h=>{h.configuration?.forEach(f=>{f?.id&&i.add(f.id)})});function a(h){let f=h.match(/^(windtrends|speedtrends)-(.+)$/);return f?f[2]:null}let r=[],s=[];for(let h of this._svcDatasetConfigs){let f=h.label||"",b=!1;if(f.startsWith("windtrends-")||f.startsWith("speedtrends-")){let C=a(f);b=!!(C&&i.has(C))}else(f.startsWith("simple-chart-")||(f.match(/\|/g)||[]).length===4)&&(b=i.has(h.uuid));b?s.push(h):r.push(h)}r.length&&(r.forEach(h=>{console.warn(`[DatasetService] Cleaned dataset: uuid=${h.uuid}, label="${h.label}"`)}),this._svcDatasetConfigs=s,this.appSettings.saveDataSets(this._svcDatasetConfigs))}setupServiceSubjectRegistry(e,t){let i=this._svcSubjectObserverRegistry.findIndex(a=>a.datasetUuid==e);i>=0&&(this._svcSubjectObserverRegistry[i].rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(i,1)),this._svcSubjectObserverRegistry.push({datasetUuid:e,rxjsSubject:new Xr(t)})}createDataSourceConfiguration(e){let i={uuid:e.uuid,pathObserverSubscription:null,sampleTime:null,maxDataPoints:null,smoothingPeriod:null,historicalData:[]};switch(e.timeScaleFormat){case"Last 30 Minutes":i.maxDataPoints=120,i.sampleTime=15e3,i.smoothingPeriod=50;break;case"Last 5 Minutes":i.maxDataPoints=60,i.sampleTime=5e3,i.smoothingPeriod=25;break;case"Last Minute":i.maxDataPoints=60,i.sampleTime=1e3,i.smoothingPeriod=25;break;case"hour":i.maxDataPoints=e.period*120,i.sampleTime=3e4,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break;case"minute":i.maxDataPoints=e.period*60,i.sampleTime=1e3,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break;default:i.maxDataPoints=e.period*5,i.sampleTime=200,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break}return(!i.maxDataPoints||i.maxDataPoints<1)&&(i.maxDataPoints=1),i}startAll(){console.log("[Dataset Service] Auto Starting "+this._svcDatasetConfigs.length.toString()+" Datasets");for(let e of this._svcDatasetConfigs)this.start(e.uuid)}start(e){let t=this._svcDatasetConfigs.find(h=>h.uuid==e);if(!t){console.warn(`[Dataset Service] Dataset UUID:${e} not found`);return}let i=this.createDataSourceConfiguration(t);this.setupServiceSubjectRegistry(i.uuid,i.maxDataPoints);let a=this._svcDataSource[this._svcDataSource.push(i)-1];console.log(`[Dataset Service] Starting recording process: ${t.path}, Scale: ${t.timeScaleFormat}, Period: ${t.period}, Datapoints: ${i.maxDataPoints}`);function r(h){return f=>xn(h).pipe(cs(f,(b,C)=>C))}let s=this.resolveAngleDomain(t.path,t.baseUnit);a.pathObserverSubscription=this.data.subscribePath(t.path,t.pathSource).pipe(r(i.sampleTime)).subscribe(h=>{if(h.data.value===null)return;a.maxDataPoints>0&&a.historicalData.length>=a.maxDataPoints&&a.historicalData.shift(),a.historicalData.push(h.data.value);let f=this.updateDataset(a,t.baseUnit,s);this._svcSubjectObserverRegistry.find(b=>b.datasetUuid===a.uuid).rxjsSubject.next(f)})}stop(e){let t=this._svcDataSource.findIndex(i=>i.uuid==e);console.log(`[Dataset Service] Stopping Dataset ${e} data capture`),this._svcDataSource[t].pathObserverSubscription.unsubscribe(),this._svcDataSource.splice(t,1)}list(){return qt(this._svcDatasetConfigs)}getDatasetConfig(e){return this._svcDatasetConfigs.find(t=>t.uuid===e)}getDataSourceInfo(e){return this._svcDataSource.find(t=>t.uuid===e)}create(e,t,i,a,r,s=!0,h=!0,f){if(!e||!t||!i||!a||!r)return null;let b=f||qi.create(),C={uuid:b,path:e,pathSource:t,baseUnit:this.data.getPathUnitType(e),timeScaleFormat:i,period:a,label:r,editable:h};return console.log(`[Dataset Service] Creating ${s?"":"non-"}persistent ${h?"":"hidden "}dataset: ${C.uuid}, Path: ${C.path}, Source: ${C.pathSource} Scale: ${C.timeScaleFormat}, Period: ${C.period}`),this._svcDatasetConfigs.push(C),this.start(b),s===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),b}edit(e,t=!0){let i=this._svcDatasetConfigs.find(a=>a.uuid===e.uuid);return i?JSON.stringify(i)===JSON.stringify(e)?(console.log(`[Dataset Service] No changes detected for Dataset ${e.uuid}.`),!1):(this.stop(e.uuid),console.log(`[Dataset Service] Updating Dataset: ${e.uuid}`),e.baseUnit=this.data.getPathUnitType(e.path),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(a=>a.uuid===e.uuid),1,e),this.start(e.uuid),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0):!1}remove(e,t=!0){return!e||e===""||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:(this.stop(e),console.log(`[Dataset Service] Removing ${t?"":"non-"}persistent Dataset: ${e}`),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(i=>i.uuid===e),1),this._svcSubjectObserverRegistry.find(i=>i.datasetUuid===e).rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(this._svcSubjectObserverRegistry.findIndex(i=>i.datasetUuid===e),1),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0)}getDatasetObservable(e){let t=this._svcSubjectObserverRegistry.find(i=>i.datasetUuid==e);return t?t.rxjsSubject.asObservable():null}getDatasetBatchThenLiveObservable(e){let t=this._svcSubjectObserverRegistry.find(h=>h.datasetUuid==e);if(!t)return null;let i=t.rxjsSubject,a=i._buffer?i._buffer.slice():[],r=Kr([a]),s=i.pipe(ds(a.length));return ts(r,s)}updateDataset(e,t,i="scalar"){let a=null,r=null,s=null,h=null;if(t==="rad"){a=this.circularMeanRad(e.historicalData);let M=e.historicalData.slice(-e.smoothingPeriod);r=this.circularMeanRad(M);let{min:N,max:D}=this.circularMinMaxRad(e.historicalData);i==="direction"?(a=this.normalizeToDirection(a),r=this.normalizeToDirection(r),s=this.normalizeToDirection(N),h=this.normalizeToDirection(D)):i==="signed"?(a=this.normalizeToSigned(a),r=this.normalizeToSigned(r),s=this.normalizeToSigned(N),h=this.normalizeToSigned(D)):(s=N,h=D)}else a=b(e.historicalData),r=C(e.historicalData,e.smoothingPeriod),s=Math.min(...e.historicalData),h=Math.max(...e.historicalData);return{timestamp:Date.now(),data:{value:t==="rad"?i==="signed"?this.normalizeToSigned(e.historicalData[e.historicalData.length-1]):this.normalizeToDirection(e.historicalData[e.historicalData.length-1]):e.historicalData[e.historicalData.length-1],sma:r,ema:null,doubleEma:null,lastAverage:a,lastMinimum:s,lastMaximum:h}};function b(M){return M.length===0?null:M.reduce((D,j)=>D+j,0)/M.length}function C(M,N){M.length<N&&(N=M.length);let D=0;for(let j=M.length-N;j<M.length;j++)D+=M[j];return D/N}}circularMeanRad(e){if(e.length===0)return 0;let t=e.reduce((a,r)=>a+Math.sin(r),0),i=e.reduce((a,r)=>a+Math.cos(r),0);return Math.atan2(t/e.length,i/e.length)}circularMinMaxRad(e){if(e.length===0)return{min:0,max:0};let t=e.map(h=>(h*180/Math.PI+360)%360).sort((h,f)=>h-f),i=0,a=0;for(let h=0;h<t.length;h++){let f=(h+1)%t.length,b=(t[f]-t[h]+360)%360;b>i&&(i=b,a=f)}let r=t[a]*Math.PI/180,s=t[(a-1+t.length)%t.length]*Math.PI/180;return{min:r,max:s}}resolveAngleDomain(e,t){if(t!=="rad")return"scalar";let i=this.normalizePathKey(e);for(let a of this.signedAnglePaths)if(i===this.normalizePathKey(a))return"signed";return"direction"}normalizePathKey(e){return e.replace(/^vessels\.self\./,"").replace(/^self\./,"")}mod(e,t){return(e%t+t)%t}normalizeToDirection(e){let t=2*Math.PI;return this.mod(e,t)}normalizeToSigned(e){let t=2*Math.PI;return this.mod(e+Math.PI,t)-Math.PI}removeIfExists(e,t=!0){return!e||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:this.remove(e,t)}ngOnDestroy(){[...this._svcDataSource].forEach(e=>{try{this.stop(e.uuid)}catch{}}),this._svcSubjectObserverRegistry.forEach(e=>e.rxjsSubject.complete()),this._svcSubjectObserverRegistry=[]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=ht({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var kl=(()=>{class n{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new Ia(t),timeoutID:null,intervalMS:i},this.kipTimers[e].currentValue.asObservable())}startTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,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){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID!==null&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null)}setTimer(e,t){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].currentValue.next(t)}deleteTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,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}ngOnDestroy(){Object.keys(this.kipTimers).forEach(e=>{this.kipTimers[e].timeoutID&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null),this.kipTimers[e].currentValue.complete()}),this.kipTimers={}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=ht({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Tl=(()=>{class n{sanitizer=A(Za);transform(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Fa({name:"safe",type:n,pure:!0})}return n})();var Sm={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function go(n){let o=Be(Be({},Sm),n);return`(() => {
1
+ import{A as wl,B as Jo,C as er,D as tr,E as ir,F as jn,G as Ca,H as xl,I as _l,J as Yn,K as Ji,L as Et,M as Qn,N as $n,O as Zn,P as ho,Q as po,R as Ml,S as Xn,T as Kn,a as Gt,b as ni,c as oo,d as vl,e as yl,f as Cl,g as Sl,h as je,i as Zi,j as Xi,k as ro,l as pn,m as va,n as ui,o as Ki,p as zt,q as so,r as lo,s as Hn,t as gn,u as co,v as mo,w as hi,x as Ko,y as uo,z as ya}from"./chunk-SY22WXMI.js";import{a as Al,b as ao}from"./chunk-RYHOAWDD.js";import{a as ii,b as $i,c as at}from"./chunk-PKKBBIJK.js";import{a as dl,b as cl,c as ml,d as zn,e as ul,f as Tt,g as hl,h as pl,i as gl,k as fl,m as Aa,n as bl}from"./chunk-HIADZ4BV.js";import{a as wt,b as Lt}from"./chunk-IM2WDWW4.js";import{a as sl,b as ll}from"./chunk-OQULS6SV.js";import{A as ft,B as ti,a as ce,c as Ws,d as Ci,e as Zs,f as Xs,g as Ks,h as Si,i as wi,k as Js,l as xi,m as _i,n as Mi,o as zi,p as Kt,r as mt,s as Yi,t as ol,u as Qi,w as rl,y as ut,z as ei}from"./chunk-QLTN6G6E.js";import{A as Bn,B as ki,C as Ti,D as kt,E as nl,F as al,G as Hi,H as Un,I as ji,J as ct,L as qn,M as pt,N as gt,a as qi,d as qt,e as Nn,f as ws,i as xs,j as _s,k as $a,l as Ms,m as Zt,n as Gn,o as dt,q as _t,s as nt,t as Mt,u as el,v as tl,w as no,x as il,y as Jt,z as Fn}from"./chunk-XDPHEQEO.js";import{b as Gs,f as Fs,g as Bs,h as zs,i as Xo,j as Hs,m as js,n as Ys,o as Qs,s as $s}from"./chunk-SZ2GUIT5.js";import{$ as cs,$b as Bt,Ab as Ct,Ad as Zo,Ba as La,Bb as St,Bc as za,Bd as Ka,C as ha,Ca as pa,Cc as Ha,Cd as Vs,D as xn,Db as te,Dd as Ja,E as Vi,Eb as me,Ec as Ss,F as Wi,Fa as g,Fb as It,Fd as Ot,Ga as ps,Gb as re,Gc as ja,Gd as ze,Hb as Je,Hd as Xe,I as ns,Ia as kn,Ib as Rn,Ic as Ya,J as Li,Ja as di,Jb as Ft,K as Gi,Kb as m,La as Ga,Lb as ne,Ld as mi,M as as,Mb as ye,N as os,Nb as Ui,Nc as et,Nd as Xt,O as rs,Oa as L,Oc as Qa,P as Ra,Pa as Wt,Pb as cn,Qa as st,Qb as mn,R as ss,Ra as Fa,Rb as un,S as ls,Sa as ga,Sc as Za,Ta as gs,Td as eo,U as ds,Ua as Bi,Ud as to,V as _n,Va as fs,Vb as ci,Vd as xt,W as Na,Wa as yt,Wd as io,X as Va,Xa as We,Xb as hn,Xc as ks,Xd as lt,Ya as Tn,Yb as ba,Z as Wa,Zd as Ls,_b as At,_d as Ke,a as Be,ab as Y,ac as Ua,b as Ze,ba as Mn,bb as G,ca as ht,cb as F,cc as W,d as Cm,da as Vt,db as Me,dc as se,dd as Ts,e as Zr,ea as Yt,eb as En,ec as R,ed as Es,f as it,fa as ms,fb as ue,fc as bs,fd as Ds,fe as Us,g as Ni,ga as A,gb as he,ge as qs,hb as T,hc as qa,i as jo,ia as us,ib as d,ic as $e,j as Nt,ja as q,jb as u,jc as v,ka as z,kb as U,kc as ie,kd as Xa,l as Ia,la as K,lb as _,m as Xr,ma as Ve,mb as k,mc as As,md as Vn,na as Fi,nb as H,nc as Ut,nd as Ps,oa as hs,ob as Dn,od as Is,p as Kr,pa as rt,pb as Pn,pc as qe,pd as Wn,q as Yo,qb as Ba,qc as $o,r as Jr,ra as w,rb as ae,sb as Pi,sd as Os,t as Oa,tb as B,u as Qo,ua as Qt,ub as fa,v as es,vb as I,vd as Rs,w as vi,wa as Ie,wb as In,wc as vs,wd as yi,xb as On,xc as ys,xd as Ln,y as ts,yb as dn,yc as Cs,yd as Ns,z as is,zb as $t}from"./chunk-OB3QLUH6.js";var mr=Cm((rx,Eo)=>{(function(n){"use strict";function o(c){if(Array.isArray(c)){for(var l=0,p=Array(c.length);l<c.length;l++)p[l]=c[l];return p}return Array.from(c)}function e(c,l){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||typeof l!="object"&&typeof l!="function"?c:l}function t(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(c,l):c.__proto__=l)}function i(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function a(c,l){if(l||(l=typeof window>"u"?global:window),l[c]!==void 0)return l[c];if(Pa===null){var p=window.getComputedStyle(document.documentElement,"");Pa=(Array.prototype.slice.call(p).join("").match(/-(moz|webkit|ms)-/)||p.OLink===""&&["","o"]||["",""])[1]}if(Pa==="")return null;var y=c.charAt(0).toUpperCase()+c.substr(1),S=l[Pa+y];return S!==void 0?S:null}function r(c,l,p,y,S,x,E){if(typeof y!="function")throw new TypeError("Invalid animation rule:",y);var O=c-p,P=O/S,V=0;P>1&&(P=1),P!==1&&(V=y(P),isFinite(V)&&!isNaN(V)&&(P=V)),l&&l(P),O<S?E.frame=Hr(function(Q){return r(Q,l,p,y,S,x,E)}):(x&&x(),E.inProgress=!1)}function s(){Array.prototype.constructor.apply(this,arguments)}function h(c){if(!(c instanceof DOMException&&c.result===2152923147))throw c}function f(c,l){return l.replace(Am,function(p,y){var S=c[y];return S!==void 0?S:p})}function b(c){return c.majorTicks instanceof Array||(c.majorTicks=c.majorTicks?[c.majorTicks]:[]),c.majorTicks.length||(c.majorTicks.push(oe.formatMajorTickNumber(c.minValue,c)),c.majorTicks.push(oe.formatMajorTickNumber(c.maxValue,c))),[c.tickSide!=="right",c.tickSide!=="left"]}function C(c,l,p,y,S,x){c.beginPath(),c.moveTo(l+x,p),c.lineTo(l+y-x,p),c.quadraticCurveTo(l+y,p,l+y,p+x),c.lineTo(l+y,p+S-x),c.quadraticCurveTo(l+y,p+S,l+y-x,p+S),c.lineTo(l+x,p+S),c.quadraticCurveTo(l,p+S,l,p+S-x),c.lineTo(l,p+x),c.quadraticCurveTo(l,p,l+x,p),c.closePath()}function M(c,l){var p=l.valueDec,y=l.valueInt,S=0,x=void 0,E=void 0,O=void 0;if(c=parseFloat(c),O=c<0,c=Math.abs(c),p>0){for(E=c.toFixed(p).toString().split("."),x=y-E[0].length;S<x;++S)E[0]="0"+E[0];E=(O?"-":"")+E[0]+"."+E[1]}else{for(E=Math.round(c).toString(),x=y-E.length;S<x;++S)E="0"+E;E=(O?"-":"")+E}return E}function N(c,l){var p=void 0,y=!1;return p=l.majorTicksDec===0?Math.round(c).toString():c.toFixed(l.majorTicksDec),l.majorTicksInt>1?(y=~p.indexOf("."),~p.indexOf("-")?"-"+[l.majorTicksInt+l.majorTicksDec+2+(y?1:0)-p.length].join("0")+p.replace("-",""):[l.majorTicksInt+l.majorTicksDec+1+(y?1:0)-p.length].join("0")+p):p}function D(c){return c*Math.PI/180}function j(c,l){return{x:-c*Math.sin(l),y:c*Math.cos(l)}}function X(c,l,p,y){var S=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],x=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,E=c.createLinearGradient(S?0:x,S?x:0,S?0:y,S?y:0);return E.addColorStop(0,l),E.addColorStop(1,p),E}function Z(c,l){l.needleShadow&&(c.shadowOffsetX=2,c.shadowOffsetY=2,c.shadowBlur=10,c.shadowColor=l.colorNeedleShadowDown)}function ee(c,l,p){return c["font"+l+"Style"]+" "+c["font"+l+"Weight"]+" "+c["font"+l+"Size"]*p+"px "+c["font"+l]}function be(c){c.shadowOffsetX=null,c.shadowOffsetY=null,c.shadowBlur=null,c.shadowColor="",c.strokeStyle=null,c.lineWidth=0,c.save()}function Oe(c,l,p,y){l.valueTextShadow&&(c.shadowOffsetX=p,c.shadowOffsetY=p,c.shadowBlur=y,c.shadowColor=l.colorValueTextShadow)}function Te(c,l,p,y,S,x){if(l.valueBox){be(c);var E=l.valueDec?1+l.valueDec:0,O="9".repeat(Math.max.apply(null,[String(parseInt(p)).length+E].concat(l.majorTicks.map(function(Pe){return String(parseInt(Pe,10)).length+E})))),P=l.valueText||M(p,l),V=x/200,Q=x/100,$=.4*Q,le=1.2*Q;c.font=ee(l,"Value",V),Oe(c,l,$,le);var ge=c.measureText(l.valueText?P:"-"+M(Number(O),l)).width;be(c);var ve=parseFloat(l.fontValueSize)*V+$+le,Ge=Q*parseFloat(l.valueBoxStroke),Ae=2*x-2*Ge,Re=ge+10*Q,Ne=1.1*ve+$+le,Fe=Q*l.valueBoxBorderRadius,ke=(parseFloat(l.valueBoxWidth)||0)/100*Ae;ke>Re&&(Re=ke),Re>Ae&&(Re=Ae);var De=y-Re/2,xe=S-Ne/2,fe=S-5.75*Q;if(c.beginPath(),Fe?C(c,De,xe,Re,Ne,Fe):c.rect(De,xe,Re,Ne),Ge){var Ce=c.createRadialGradient(y,fe,10*Q,y,fe,20*Q);Ce.addColorStop(0,l.colorValueBoxRect),Ce.addColorStop(1,l.colorValueBoxRectEnd),c.strokeStyle=Ce,c.lineWidth=Ge,c.stroke()}l.colorValueBoxShadow&&(c.shadowBlur=1.2*Q,c.shadowColor=l.colorValueBoxShadow),l.colorValueBoxBackground&&(c.fillStyle=l.colorValueBoxBackground,c.fill()),c.closePath(),c.restore(),Oe(c,l,$,le),c.fillStyle=l.colorValueText,c.textAlign="center",c.textBaseline="alphabetic",c.fillText(P,De+Re/2,S+Ne/2-ve/3),c.restore()}}function Ye(c){var l=c.value,p=c.minValue,y=c.maxValue,S=.01*(y-p);return{normal:l<p?p:l>y?y:l,indented:l<p?p-S:l>y?y+S:l}}function Ee(c,l,p,y,S){p.beginPath(),p.arc(0,0,li(c),0,2*ma,!0),p.lineWidth=l,p.strokeStyle=S?oe.linearGradient(p,y,S,c):y,p.stroke(),p.closePath()}function Le(c,l){var p=si.pixelRatio;return c.maxRadius||(c.maxRadius=c.max-l.borderShadowWidth-l.borderOuterWidth*p-l.borderMiddleWidth*p-l.borderInnerWidth*p+(l.borderOuterWidth?.5:0)+(l.borderMiddleWidth?.5:0)+(l.borderInnerWidth?.5:0)),c.maxRadius}function pe(c,l){function p($,le,ge,ve,Ge,Ae){return le&&(!Ae&&l.borderShadowWidth&&(ge.save(),ge.shadowBlur=l.borderShadowWidth,ge.shadowColor=l.colorBorderShadow),Ee($,le*y,ge,ve,Ge),!Ae&&l.borderShadowWidth&&(Ae=!0,ge.restore())),Ae}var y=si.pixelRatio,S=l.borderShadowWidth*y,x=c.max-S-l.borderOuterWidth*y/2,E=x-l.borderOuterWidth*y/2-l.borderMiddleWidth*y/2+.5,O=E-l.borderMiddleWidth*y/2-l.borderInnerWidth*y/2+.5,P=Le(c,l),V=void 0,Q=!1;c.save(),Q=p(x,l.borderOuterWidth,c,l.colorBorderOuter,l.colorBorderOuterEnd,Q),Q=p(E,l.borderMiddleWidth,c,l.colorBorderMiddle,l.colorBorderMiddleEnd,Q),Q=p(O,l.borderInnerWidth,c,l.colorBorderInner,l.colorBorderInnerEnd,Q),!Q&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),c.beginPath(),c.arc(0,0,li(P),0,2*ma,!0),l.colorPlateEnd?(V=c.createRadialGradient(0,0,P/2,0,0,P),V.addColorStop(0,l.colorPlate),V.addColorStop(1,l.colorPlateEnd)):V=l.colorPlate,c.fillStyle=V,c.fill(),c.closePath(),c.restore()}function He(c,l){if(l.highlights!=="false"&&l.highlights.length&&l.highlightsWidth!==0){var p=c.max*(parseFloat(l.highlightsWidth)||0)/100,y=li(tt(c,l)-p/2),S=l.highlights.length,x=(l.maxValue-l.minValue)/l.ticksAngle;c.save();for(var E=0;E<S;E++){var O=l.highlights[E];c.lineWidth=p,c.lineCap=l.highlightsLineCap,c.strokeStyle=O.color,c.beginPath(),c.rotate(Ho),c.arc(0,0,y,oe.radians(l.startAngle+(O.from-l.minValue)/x),oe.radians(l.startAngle+(O.to-l.minValue)/x),!1),c.stroke(),c.closePath(),c.restore(),c.save()}c.restore()}}function bt(c,l){var p=tt(c,l),y=void 0,S=void 0,x=void 0,E=0,O=Math.abs(l.minorTicks)||0,P=l.ticksAngle/(l.maxValue-l.minValue);l.exactTicks?(S=l.maxValue-l.minValue,y=O?S/O:0,E=(Ai.mod(l.majorTicks[0],O)||0)*P):y=O*(l.majorTicks.length-1),c.lineWidth=si.pixelRatio,c.strokeStyle=l.colorMinorTicks||l.colorStrokeTicks,c.save();for(var V=0;V<y;++V)(x=l.startAngle+E+V*(l.ticksAngle/y))<=l.ticksAngle+l.startAngle&&(c.rotate(oe.radians(x)),c.beginPath(),c.moveTo(0,p),c.lineTo(0,p-.075*c.max),rn(c));c.restore()}function tt(c,l){var p=c.max/100;return Le(c,l)-5*p-(l.barWidth?2*(parseFloat(l.barStrokeWidth)||0)+((parseFloat(l.barWidth)||0)+5)*p:0)}function ot(c,l){oe.prepareTicks(l);var p=li(tt(c,l)),y=void 0,S=l.majorTicks.length,x=si.pixelRatio;c.lineWidth=2*x,y=l.colorMajorTicks instanceof Array?l.colorMajorTicks:new Array(S).fill(l.colorStrokeTicks||l.colorMajorTicks);for(var E=0;E<S;++E)c.save(),c.strokeStyle=y[E],c.rotate(oe.radians(vt(l,l.exactTicks?l.majorTicks[E]:E,S))),c.beginPath(),c.moveTo(0,p),c.lineTo(0,p-.15*c.max),c.stroke(),c.closePath(),c.restore();l.strokeTicks&&(c.save(),c.strokeStyle=l.colorStrokeTicks||y[0],c.rotate(Ho),c.beginPath(),c.arc(0,0,p,oe.radians(l.startAngle),oe.radians(l.startAngle+l.ticksAngle),!1),c.stroke(),c.closePath(),c.restore())}function vt(c,l,p){if(c.exactTicks){var y=c.ticksAngle/(c.maxValue-c.minValue);return c.startAngle+y*(l-c.minValue)}return c.startAngle+l*(c.ticksAngle/(p-1))}function rn(c){c.stroke(),c.restore(),c.closePath(),c.save()}function Ta(c,l){var p=tt(c,l)-.15*c.max,y={},S=0,x=l.majorTicks.length,E=l.animationTarget!=="needle",O=l.colorNumbers instanceof Array?l.colorNumbers:new Array(x).fill(l.colorNumbers),P=E?-(l.value-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle:0;for(E&&(c.save(),c.rotate(-oe.radians(P))),c.font=oe.font(l,"Numbers",c.max/200),c.lineWidth=0,c.textAlign="center",c.textBaseline="middle";S<x;++S){var V=P+vt(l,l.exactTicks?l.majorTicks[S]:S,x),Q=c.measureText(l.majorTicks[S]).width,$=l.fontNumbersSize,le=Math.sqrt(Q*Q+$*$)/2,ge=oe.radialPoint(p-le-l.numbersMargin/100*c.max,oe.radians(V));V===360&&(V=0),y[V]||(y[V]=!0,c.fillStyle=O[S],c.fillText(l.majorTicks[S],ge.x,ge.y))}E&&c.restore()}function Rr(c,l){l.title&&(c.save(),c.font=oe.font(l,"Title",c.max/200),c.fillStyle=l.colorTitle,c.textAlign="center",c.fillText(l.title,0,-c.max/4.25,.8*c.max),c.restore())}function Nr(c,l){l.units&&(c.save(),c.font=oe.font(l,"Units",c.max/200),c.fillStyle=l.colorUnits,c.textAlign="center",c.fillText(oe.formatContext(l,l.units),0,c.max/3.25,.8*c.max),c.restore())}function Vr(c,l){if(l.needle){var p=l.animationTarget!=="needle",y=l.ticksAngle<360?oe.normalizedValue(l).indented:l.value,S=p?l.startAngle:l.startAngle+(y-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle;l.barStartPosition==="right"&&(S=l.startAngle+l.ticksAngle-(y-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle);var x=Le(c,l),E=li(x/100*l.needleCircleSize),O=li(x/100*l.needleCircleSize*.75),P=li(x/100*l.needleEnd),V=li(l.needleStart?x/100*l.needleStart:0),Q=x/100*l.needleWidth,$=x/100*l.needleWidth/2,le=si.pixelRatio;c.save(),oe.drawNeedleShadow(c,l),c.rotate(oe.radians(S)),c.fillStyle=oe.linearGradient(c,l.colorNeedle,l.colorNeedleEnd,P-V),l.needleType==="arrow"?(c.beginPath(),c.moveTo(-$,-V),c.lineTo(-Q,0),c.lineTo(-1*le,P),c.lineTo(le,P),c.lineTo(Q,0),c.lineTo($,-V),c.closePath(),c.fill(),c.beginPath(),c.lineTo(-.5*le,P),c.lineTo(-1*le,P),c.lineTo(-Q,0),c.lineTo(-$,-V),c.lineTo($/2*le-2*le,-V),c.closePath(),c.fillStyle=l.colorNeedleShadowUp,c.fill()):(c.beginPath(),c.moveTo(-$,P),c.lineTo(-$,V),c.lineTo($,V),c.lineTo($,P),c.closePath(),c.fill()),c.restore(),l.needleCircleSize&&(c.save(),oe.drawNeedleShadow(c,l),l.needleCircleOuter&&(c.beginPath(),c.arc(0,0,E,0,2*ma,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleOuter,l.colorNeedleCircleOuterEnd,E),c.fill(),c.closePath()),l.needleCircleInner&&(c.beginPath(),c.arc(0,0,O,0,2*ma,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleInner,l.colorNeedleCircleInnerEnd,O),c.fill(),c.closePath()),c.restore())}}function Wr(c,l,p){oe.drawValueBox(c,l,p,0,c.max-.33*c.max,c.max)}function Jc(c){var l=c.startAngle,p=c.startAngle+c.ticksAngle,y=l,S=l+(oe.normalizedValue(c).normal-c.minValue)/(c.maxValue-c.minValue)*c.ticksAngle;if(c.barStartPosition==="middle"){var x=.5*(c.minValue+c.maxValue);c.value<x?(y=180-(x-oe.normalizedValue(c).normal)/(c.maxValue-c.minValue)*c.ticksAngle,S=180):(y=180,S=180+(oe.normalizedValue(c).normal-x)/(c.maxValue-c.minValue)*c.ticksAngle)}else c.barStartPosition==="right"&&(y=p-S+l,S=p);return{startAngle:y,endAngle:S}}function Lr(c,l){var p=c.max/100,y=Le(c,l)-5*p,S=parseFloat(l.barStrokeWidth+"")||0,x=(parseFloat(l.barWidth+"")||0)*p,E=y-2*S-x,O=(y-E)/2,P=E+O,V=S/P,Q=l.startAngle,$=l.startAngle+l.ticksAngle;if(c.save(),c.rotate(Ho),S&&(c.beginPath(),c.arc(0,0,P,oe.radians(Q)-V,oe.radians($)+V,!1),c.strokeStyle=l.colorBarStroke,c.lineWidth=2*O,c.stroke(),c.closePath()),x&&(c.beginPath(),c.arc(0,0,P,oe.radians(Q),oe.radians($),!1),c.strokeStyle=l.colorBar,c.lineWidth=x,c.stroke(),c.closePath(),l.barShadow&&(c.save(),c.beginPath(),c.arc(0,0,y,oe.radians(Q),oe.radians($),!1),c.clip(),c.beginPath(),c.strokeStyle=l.colorBar,c.lineWidth=1,c.shadowBlur=l.barShadow,c.shadowColor=l.colorBarShadow,c.shadowOffsetX=0,c.shadowOffsetY=0,c.arc(0,0,y,oe.radians(l.startAngle),oe.radians(l.startAngle+l.ticksAngle),!1),c.stroke(),c.closePath(),c.restore()),l.barProgress)){var le=Jc(l),ge=le.startAngle,ve=le.endAngle;c.beginPath(),c.arc(0,0,P,oe.radians(ge),oe.radians(ve),!1),c.strokeStyle=l.colorBarProgress,c.lineWidth=x,c.stroke(),c.closePath()}c.restore()}function Gr(c){return c.options.animatedValue?c.options.value:c.value}function em(c,l,p,y,S,x,E,O){c.beginPath(),c.fillStyle=O?oe.linearGradient(c,E,O,S>x?S:x,x>S,S>x?p:y):E,l>0?oe.roundRect(c,p,y,S,x,l):c.rect(p,y,S,x),c.fill(),c.closePath()}function tm(c,l,p,y,S,x,E,O,P){c.beginPath(),c.lineWidth=l,c.strokeStyle=P?oe.linearGradient(c,O,P,E,!0,S):O,p>0?oe.roundRect(c,y,S,x,E,p):c.rect(y,S,x,E),c.stroke(),c.closePath()}function im(c,l,p,y,S,x){function E(Pe,Ue,Qe,Rt){return Pe&&(!Rt&&l.borderShadowWidth&&(c.save(),c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),tm(c,Pe*O,P,p+Pe*O/2-fe,y+Pe*O/2-fe,V,ge,Ue,Qe),fe+=.5*O,!Rt&&l.borderShadowWidth&&(Rt=!0,c.restore())),Rt}var O=si.pixelRatio,P=l.borderRadius*O,V=S-l.borderShadowWidth-l.borderOuterWidth*O,Q=V-l.borderOuterWidth*O-l.borderMiddleWidth*O,$=Q-l.borderMiddleWidth*O-l.borderInnerWidth*O,le=$-l.borderInnerWidth*O,ge=x-l.borderShadowWidth-l.borderOuterWidth*O,ve=ge-l.borderOuterWidth*O-l.borderMiddleWidth*O,Ge=ve-l.borderMiddleWidth*O-l.borderInnerWidth*O,Ae=Ge-l.borderInnerWidth*O,Re=p-(Q-V)/2,Ne=Re-($-Q)/2,Fe=Ne-(le-$)/2,ke=y-(ve-ge)/2,De=ke-(Ge-ve)/2,xe=De-(Ae-Ge)/2,fe=0,Ce=!1;return c.save(),Ce=E(l.borderOuterWidth,l.colorBorderOuter,l.colorBorderOuterEnd,Ce),Ce=E(l.borderMiddleWidth,l.colorBorderMiddle,l.colorBorderMiddleEnd,Ce),Ce=E(l.borderInnerWidth,l.colorBorderInner,l.colorBorderInnerEnd,Ce),!Ce&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),em(c,P,Fe,xe,le+2*fe,Ae+2*fe,l.colorPlate,l.colorPlateEnd),c.restore(),[Fe,xe,le,Ae]}function nm(c,l,p,y,S,x){var E=si.pixelRatio,O=x>=S,P=O?.85*S:x,V=O?x:S;p=O?we(p+(S-P)/2):p;var Q=!!l.title,$=!!l.units,le=!!l.valueBox,ge=void 0,ve=void 0,Ge=void 0;O?(ve=we(.05*V),ge=we(.075*V),Ge=we(.11*V),Q&&(V-=ge,y+=ge),$&&(V-=ve),le&&(V-=Ge)):(ve=ge=we(.15*P),Q&&(P-=ge,y+=ge),$&&(P-=ve));var Ae=2*l.barStrokeWidth,Re=l.barBeginCircle?we(P*l.barBeginCircle/200-Ae/2):0,Ne=we(P*l.barWidth/100-Ae),Fe=we(V*l.barLength/100-Ae),ke=we((V-Fe)/2),De=we(p+(O?P/2:ke+Re)),xe=we(y+(O?V-ke-Re+Ae/2:P/2)),fe=!O||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P,Ce=O||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P;return c.barDimensions={isVertical:O,width:P,length:V,barWidth:Ne,barLength:Fe,strokeWidth:Ae,barMargin:ke,radius:Re,pixelRatio:E,barOffset:null,titleMargin:Q?ge:0,unitsMargin:$?ve:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:p+fe,Y:y+Ce,x0:De+fe,y0:xe+Ce,baseX:p,baseY:y,ticksPadding:l.ticksPadding/100},c.barDimensions}function Fr(c,l,p,y,S,x,E){var O=nm(c,l,y,S,x,E),P=O.isVertical,V=O.width,Q=O.barWidth,$=O.barLength,le=O.strokeWidth,ge=O.barMargin,ve=O.radius,Ge=O.x0,Ae=O.y0,Re=O.X,Ne=O.Y,Fe=$;c.save(),c.beginPath();var ke=null;if(l.barBeginCircle){var De=oe.radians(P?270:0),xe=Math.asin(Q/2/ve),fe=Math.cos(xe),Ce=Math.sin(xe),Pe=Ge+(P?ve*Ce:ve*fe-le/2),Ue=P?Ae-ve*fe:Ae+ve*Ce,Qe=li(P?Ue-Ae:Pe-Ge);ke=we(Qe+ve);var Rt=P?we(Ge-ve*Ce):Pe,jt=P?Ue:we(Ae-ve*Ce);p==="progress"&&($=ke+($-ke)*(oe.normalizedValue(l).normal-l.minValue)/(l.maxValue-l.minValue));var ua=we(Pe+$-ke+le/2),ln=we(Ue-$+ke-le/2);c.arc(Ge,Ae,ve,De+xe,De-xe),P?(c.moveTo(Pe,jt),c.lineTo(Pe,ln),c.lineTo(Rt,ln),c.lineTo(Rt,jt)):(c.moveTo(Pe,jt),c.lineTo(ua,jt),c.lineTo(ua,Ue),c.lineTo(Pe,Ue))}else{var Qr=we(P?Re+(V-Q)/2:Re+ge),$r=we(P?Ne+$+ge:Ne+(V-Q)/2);p==="progress"&&($*=(l.value-l.minValue)/(l.maxValue-l.minValue)),P?c.rect(Qr,$r,Q,-$):c.rect(Qr,$r,$,Q)}p!=="progress"&&l.barStrokeWidth&&(c.lineWidth=le,c.strokeStyle=l.colorBarStroke,c.stroke()),p!=="progress"&&l.colorBar?(c.fillStyle=l.colorBarEnd?oe.linearGradient(c,l.colorBar,l.colorBarEnd,$,P,P?Ne:Re):l.colorBar,c.fill()):p==="progress"&&l.colorBarProgress&&(c.fillStyle=l.colorBarProgressEnd?oe.linearGradient(c,l.colorBarProgress,l.colorBarProgressEnd,Fe,P,P?Ne:Re):l.colorBarProgress,c.fill()),c.closePath(),c.restore(),l.barBeginCircle&&(c.barDimensions.radius+=le),c.barDimensions.barOffset=ke,c.barDimensions.barWidth+=le,c.barDimensions.barLength+=le}function am(c,l,p,y,S,x){Fr(c,l,"",p,y,S,x)}function Br(c,l){return l.needleSide!==c||l.tickSide!==c||l.numberSide!==c}function om(c,l,p,y,S,x){l.barProgress&&Fr(c,l,"progress",p,y,S,x)}function rm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,E=p.barWidth,O=p.barOffset,P=p.barMargin,V=p.X,Q=p.Y,$=p.ticksLength,le=p.ticksPadding,ge=S*(parseFloat(l.highlightsWidth)||0)/100;if(l.highlights&&ge){var ve=l.tickSide!=="right",Ge=l.tickSide!=="left",Ae=0,Re=l.highlights.length,Ne=(S-E)/2,Fe=l.maxValue-l.minValue,ke=we(y?V+Ne:V+P+O),De=ge,xe=y?Q+x-P-O:Q+Ne,fe=we((l.ticksWidth/100+le)*S)+(ge-l.ticksWidth/100*S),Ce=we(E+le*S);for(c.save();Ae<Re;Ae++){var Pe=l.highlights[Ae],Ue=$*li(l.minValue-Pe.from)/Fe,Qe=$*li((Pe.to-Pe.from)/Fe);c.beginPath(),c.fillStyle=Pe.color,y?(ve&&c.rect(ke-fe,xe-Ue,De,-Qe),Ge&&c.rect(ke+Ce,xe-Ue,De,-Qe)):(ve&&c.rect(ke+Ue,xe-fe,Qe,De),Ge&&c.rect(ke+Ue,xe+Ce,Qe,De)),c.fill(),c.closePath()}c.restore()}}function Ea(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function Ur(c,l,p,y,S,x,E,O,P){var V=c.barDimensions,Q=V.isVertical,$=V.length,le=V.barWidth,ge=V.barOffset,ve=V.barMargin,Ge=V.pixelRatio,Ae=V.width,Re=V.X,Ne=V.Y,Fe=V.ticksLength,ke=V.ticksPadding,De=(Ae-le)/2,xe=void 0,fe=void 0,Ce=0,Pe=p.length,Ue=void 0,Qe=P*Ae,Rt=De-ke*Ae,jt=De+le+Qe+ke*Ae,ua=l instanceof Array?l:new Array(p.length).fill(l);c.save(),c.lineWidth=O*Ge;for(var ln=Fe/(S-y);Ce<Pe;Ce++)Ue=p[Ce],c.strokeStyle=ua[Ce],Q?(fe=Ne+$-ve-ge+(y-Ue)*ln,x&&(xe=Re+Rt,Ea(c,xe,fe,we(xe-Qe),fe)),E&&(xe=Re+jt,Ea(c,xe,fe,we(xe-Qe),fe))):(xe=Re+ve+ge-(y-Ue)*ln,x&&(fe=Ne+Rt,Ea(c,xe,fe,xe,we(fe-Qe))),E&&(fe=Ne+jt,Ea(c,xe,we(fe),xe,fe-Qe)));c.restore()}function sm(c,l){var p=oe.prepareTicks(l),y=zr(p,2),S=y[0],x=y[1],E=2,O=(l.maxValue-l.minValue)/(l.majorTicks.length-1),P=l.colorMajorTicks instanceof Array?l.colorMajorTicks:new Array(l.majorTicks.length).fill(l.colorStrokeTicks||l.colorMajorTicks);if(Ur(c,P,l.exactTicks?l.majorTicks:l.majorTicks.map(function(Qe,Rt){return l.minValue+O*Rt}),l.minValue,l.maxValue,S,x,E,l.ticksWidth/100),l.strokeTicks){var V=c.barDimensions,Q=V.isVertical,$=V.length,le=V.width,ge=V.barWidth,ve=V.barMargin,Ge=V.barOffset,Ae=V.X,Re=V.Y,Ne=V.ticksLength,Fe=V.pixelRatio,ke=V.ticksPadding,De=(le-ge)/2+ge+ke*le,xe=(le-ge)/2-ke*le,fe=void 0,Ce=void 0,Pe=void 0,Ue=void 0;c.strokeStyle=l.colorStrokeTicks||P[0],E*=Fe,Q?(Ce=Re+$-ve-Ge+E/2,Ue=Ce-Ne-E,S&&(Pe=fe=we(Ae+xe),Da(c,fe,Ce,Pe,Ue)),x&&(Pe=fe=we(Ae+De),Da(c,fe,Ce,Pe,Ue))):(fe=Ae+ve+Ge-E/2,Pe=fe+Ne+E,S&&(Ue=Ce=we(Re+xe),Da(c,fe,Ce,Pe,Ue)),x&&(Ue=Ce=we(Re+De),Da(c,fe,Ce,Pe,Ue)))}}function Da(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function lm(c,l){var p=oe.prepareTicks(l),y=zr(p,2),S=y[0],x=y[1],E=[],O=l.minValue,P=Math.abs(l.minorTicks)||0,V=P?(l.maxValue-l.minValue)/(P*(l.majorTicks.length-1)):0;if(P)if(l.exactTicks)for(var Q=Ai.mod(l.majorTicks[0],P)||0;O<l.maxValue;O+=P)Q+O<l.maxValue&&E.push(Q+O);else for(;O<l.maxValue;O+=V)E.push(O);Ur(c,l.colorMinorTicks||l.colorStrokeTicks,E,l.minValue,l.maxValue,S,x,1,l.ticksWidthMinor/100)}function dm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.length,x=p.width,E=p.barWidth,O=p.barMargin,P=p.barOffset,V=p.X,Q=p.Y,$=p.ticksLength,le=p.ticksPadding,ge=l.maxValue-l.minValue,ve=ge/(l.majorTicks.length-1),Ge=l.exactTicks?l.majorTicks:l.majorTicks.map(function(ua,ln){return l.minValue+ve*ln}),Ae=Ge.length,Re=l.numberSide!=="right",Ne=l.numberSide!=="left",Fe=l.fontNumbersSize*x/200,ke=0,De=(l.ticksWidth/100+2*le)*x,xe=(x-E)/2-De,fe=(x-E)/2+E+De,Ce=void 0,Pe=void 0,Ue=void 0,Qe=void 0,Rt=l.colorNumbers instanceof Array?l.colorNumbers:new Array(Ae).fill(l.colorNumbers),jt=l.numbersMargin/100*x;for(c.font=oe.font(l,"Numbers",x/200),c.lineWidth=0,c.textAlign="center";ke<Ae;ke++)c.fillStyle=Rt[ke],Qe=l.majorTicks[ke],Ue=l.exactTicks?$*((Ge[ke]-l.minValue)/ge):ke*$/(Ae-1),y?(Pe=Q+S-O-P-Ue+Fe/3,Re&&(c.textAlign="right",c.fillText(Qe,V+xe-jt,Pe)),Ne&&(c.textAlign="left",c.fillText(Qe,V+fe+jt,Pe))):(c.measureText(Qe).width,Ce=V+O+P+Ue,Re&&c.fillText(Qe,Ce,Q+xe-jt),Ne&&c.fillText(Qe,Ce,Q+fe+Fe+jt))}function cm(c,l){if(l.title){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,E=p.baseX,O=p.baseY,P=p.titleMargin,V=l.fontTitleSize*S/200,Q=we(E+(y?S:x)/2),$=we(O+P/2-(y?V:V/2)-.025*(y?x:S));c.save(),c.textAlign="center",c.fillStyle=l.colorTitle,c.font=oe.font(l,"Title",S/200),c.lineWidth=0,c.fillText(l.title,Q,$,y?S:x),c.restore()}}function mm(c,l){if(l.units){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,E=p.baseX,O=p.baseY,P=p.unitsMargin,V=l.fontUnitsSize*S/200,Q=we(E+(y?S:x)/2),$=we(O+(y?x:S)+P/2-V/2);c.save(),c.textAlign="center",c.fillStyle=l.colorUnits,c.font=oe.font(l,"Units",S/200),c.lineWidth=0,c.fillText(oe.formatContext(l,l.units),Q,$,y?S:x),c.restore()}}function um(c,l){if(l.needle){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,E=p.barWidth,O=p.barOffset,P=p.barMargin,V=p.ticksLength,Q=p.X,$=p.Y,le=p.ticksPadding,ge=l.needleSide!=="right",ve=l.needleSide!=="left",Ge=V*(oe.normalizedValue(l).indented-l.minValue)/(l.maxValue-l.minValue),Ae=(l.ticksWidth/100+le)*S,Re=E/2+Ae,Ne=Re*(l.needleEnd/100),Fe=void 0,ke=void 0,De=void 0,xe=void 0,fe=l.needleType.toLowerCase()==="arrow"?pm:hm,Ce=(S-E)/2,Pe=Re*(l.needleStart/100),Ue=Ce-Ae-Pe,Qe=Ce+E+Ae+Pe;c.save(),oe.drawNeedleShadow(c,l),y?(De=we($+x-P-O-Ge),ge&&(Fe=we(Q+Ue),ke=Fe+Ne,fe(c,l,Fe,De,ke,De,Ne)),ve&&(Fe=we(Q+Qe),ke=Fe-Ne,fe(c,l,Fe,De,ke,De,Ne,!0))):(Fe=we(Q+P+O+Ge),ge&&(De=we($+Ue),xe=De+Ne,fe(c,l,Fe,De,Fe,xe,Ne)),ve&&(De=we($+Qe),xe=De-Ne,fe(c,l,Fe,De,Fe,xe,Ne,!0))),c.restore()}}function qr(c,l,p,y){return l.colorNeedleEnd?oe.linearGradient(c,y?l.colorNeedleEnd:l.colorNeedle,y?l.colorNeedle:l.colorNeedleEnd,p,!c.barDimensions.isVertical):l.colorNeedle}function hm(c,l,p,y,S,x,E,O){c.lineWidth=l.needleWidth,c.strokeStyle=qr(c,l,E,O),c.beginPath(),c.moveTo(p,y),c.lineTo(S,x),c.stroke(),c.closePath()}function pm(c,l,p,y,S,x,E,O){var P=we(.4*E),V=E-P,Q=p===S,$=l.needleWidth/2;c.fillStyle=qr(c,l,E,O),c.beginPath(),Q?(y>x&&(V*=-1),c.moveTo(p-$,y),c.lineTo(p+$,y),c.lineTo(p+$,y+V),c.lineTo(p,x),c.lineTo(p-$,y+V),c.lineTo(p-$,y)):(p>S&&(V*=-1),c.moveTo(p,y-$),c.lineTo(p,y+$),c.lineTo(p+V,y+$),c.lineTo(S,y),c.lineTo(p+V,y-$),c.lineTo(p,y-$)),c.fill(),c.closePath()}function gm(c,l,p,y,S,x,E){var O=(parseFloat(l.fontValueSize)||0)*x/200,P=(.11*E-O)/2;c.barDimensions.isVertical&&oe.drawValueBox(c,l,p,y+x/2,S+E-O-P,x)}var zr=(function(){function c(l,p){var y=[],S=!0,x=!1,E=void 0;try{for(var O,P=l[Symbol.iterator]();!(S=(O=P.next()).done)&&(y.push(O.value),!p||y.length!==p);S=!0);}catch(V){x=!0,E=V}finally{try{!S&&P.return&&P.return()}finally{if(x)throw E}}return y}return function(l,p){if(Array.isArray(l))return l;if(Symbol.iterator in Object(l))return c(l,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),Bo=function c(l,p,y){l===null&&(l=Function.prototype);var S=Object.getOwnPropertyDescriptor(l,p);if(S===void 0){var x=Object.getPrototypeOf(l);return x===null?void 0:c(x,p,y)}if("value"in S)return S.value;var E=S.get;if(E!==void 0)return E.call(y)},fm=function c(l,p,y,S){var x=Object.getOwnPropertyDescriptor(l,p);if(x===void 0){var E=Object.getPrototypeOf(l);E!==null&&c(E,p,y,S)}else if("value"in x&&x.writable)x.value=y;else{var O=x.set;O!==void 0&&O.call(S,y)}return y},sn=(function(){function c(l,p){for(var y=0;y<p.length;y++){var S=p[y];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(l,S.key,S)}}return function(l,p,y){return p&&c(l.prototype,p),y&&c(l,y),l}})(),Pa=null,bm=(function(){function c(){i(this,c),this._events={},this.addListener=this.on,this.removeListener=this.off}return sn(c,[{key:"emit",value:function(l){if(this._events[l]){for(var p=0,y=this._events[l].length,S=arguments.length,x=Array(S>1?S-1:0),E=1;E<S;E++)x[E-1]=arguments[E];for(;p<y;p++)this._events[l][p]&&this._events[l][p].apply(this,x)}}},{key:"once",value:function(l){for(var p=arguments.length,y=Array(p>1?p-1:0),S=1;S<p;S++)y[S-1]=arguments[S];for(var x=0,E=y.length,O=this;x<E;x++)(function(){var P=y[x],V=function Q(){O.off(l,Q),P.apply(O,arguments)};y[x]=V})();this.on.apply(this,[l].concat(y))}},{key:"on",value:function(l){this._events[l]||(this._events[l]=[]);for(var p=0,y=arguments.length<=1?0:arguments.length-1;p<y;p++)this._events[l].push(arguments.length<=p+1?void 0:arguments[p+1])}},{key:"off",value:function(l){if(this._events[l])for(var p=0,y=arguments.length<=1?0:arguments.length-1;p<y;p++)for(var S=arguments.length<=p+1?void 0:arguments[p+1],x=void 0;~(x=this._events[l].indexOf(S));)this._events[l].splice(x,1)}},{key:"removeAllListeners",value:function(l){delete this._events[l]}},{key:"listeners",get:function(){return this._events}}]),c})(),Hr=a("requestAnimationFrame")||function(c){return setTimeout(function(){return c(new Date().getTime())},1e3/60)},da={linear:function(c){return c},quad:function(c){return Math.pow(c,2)},dequad:function(c){return 1-da.quad(1-c)},quint:function(c){return Math.pow(c,5)},dequint:function(c){return 1-Math.pow(1-c,5)},cycle:function(c){return 1-Math.sin(Math.acos(c))},decycle:function(c){return Math.sin(Math.acos(1-c))},bounce:function(c){return 1-da.debounce(1-c)},debounce:function(c){for(var l=0,p=1;;l+=p,p/=2)if(c>=(7-4*l)/11)return-Math.pow((11-6*l-11*c)/4,2)+Math.pow(p,2)},elastic:function(c){return 1-da.delastic(1-c)},delastic:function(c){return Math.pow(2,10*(c-1))*Math.cos(20*Math.PI*1.5/3*c)}},Uo=(function(){function c(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,c),this.duration=p,this.rule=l,this.draw=y,this.end=S,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",y);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",S)}return sn(c,[{key:"animate",value:function(l,p){var y=this;this.frame&&this.cancel();var S=window.performance&&window.performance.now?window.performance.now():a("animationStartTime")||Date.now();l=l||this.draw,p=p||this.end,this.draw=l,this.end=p,this.frame=Hr(function(x){return r(x,l,S,da[y.rule]||y.rule,y.duration,p,y)})}},{key:"cancel",value:function(){this.frame&&((a("cancelAnimationFrame")||function(l){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),c})();Uo.rules=da;var wn=(function(){function c(l,p,y){i(this,c),this.options=l,this.element=p.toLowerCase(),this.type=c.toDashed(y),this.Type=n[y],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||c.domReady(this.traverse.bind(this))}return sn(c,[{key:"isValidNode",value:function(l){return!(!l.tagName||l.tagName.toLowerCase()!==this.element||l.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var l=document.getElementsByTagName(this.element),p=0,y=l.length;p<y;p++)this.process(l[p]);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(l){for(var p=0,y=l.length;p<y;p++){var S=l[p];if(S.type==="attributes"&&S.attributeName==="data-type"&&this.isValidNode(S.target)&&S.oldValue!==this.type)setTimeout(this.process.bind(this,S.target));else if(S.addedNodes&&S.addedNodes.length)for(var x=0,E=S.addedNodes.length;x<E;x++)setTimeout(this.process.bind(this,S.addedNodes[x]))}}},{key:"process",value:function(l){var p=this;if(!this.isValidNode(l))return null;var y=void 0,S=JSON.parse(JSON.stringify(this.options)),x=null;for(y in S)if(S.hasOwnProperty(y)){var E=c.toAttributeName(y),O=c.parse(l.getAttribute(E));O!=null&&(S[y]=O)}return S.renderTo=l,x=new this.Type(S),x.draw&&x.draw(),this.isObservable&&(x.observer=new MutationObserver(function(P){P.forEach(function(V){if(V.type==="attributes"){var Q=V.attributeName.toLowerCase(),$=l.getAttribute(Q).toLowerCase();if(Q==="data-type"&&$&&$!==p.type)x.observer.disconnect(),delete x.observer,x.destroy&&x.destroy();else if(Q.substr(0,5)==="data-"){var le=Q.substr(5).split("-").map(function(ve,Ge){return Ge?ve.charAt(0).toUpperCase()+ve.substr(1):ve}).join(""),ge={};ge[le]=c.parse(l.getAttribute(V.attributeName)),le==="value"?x&&(x.value=ge[le]):x.update&&x.update(ge)}}})}),x.observer.observe(l,{attributes:!0})),x}}],[{key:"parse",value:function(l){if(l==="true")return!0;if(l==="false")return!1;if(l!=="undefined"){if(l==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(l))return l.split(",");try{return JSON.parse(l)}catch{}return l}}},{key:"toDashed",value:function(l){for(var p=l.split(/(?=[A-Z])/),y=1,S=p.length,x=p[0].toLowerCase();y<S;y++)x+="-"+p[y].toLowerCase();return x}},{key:"toCamelCase",value:function(l){for(var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],y=l.split(/-/),S=0,x=y.length,E="";S<x;S++)E+=S||p?y[S][0].toUpperCase()+y[S].substr(1).toLowerCase():y[S].toLowerCase();return E}},{key:"toAttributeName",value:function(l){return"data-"+c.toDashed(l)}},{key:"domReady",value:function(l){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return l();window.addEventListener?window.addEventListener("DOMContentLoaded",l,!1):window.attachEvent&&window.attachEvent("onload",l)}}]),c})(),si=(function(){function c(l,p,y){i(this,c),c.collection.push(this),this.width=p||0,this.height=y||0,this.element=l,this.init()}return sn(c,[{key:"init",value:function(){var l=c.pixelRatio;this.element.width=this.width*l,this.element.height=this.height*l,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 l=c.collection.indexOf(this);~l&&c.collection.splice(l,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 l=c.pixelRatio;return l!==1&&this.contextClone.scale(l,l),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var l=0,p=c.collection.length;l<p;l++)c.collection[l].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),c})();si.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(si.redraw);var qo={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(c){if(typeof c=="string")for(var l=0,p=this.length;l<p;l++){var y=this[l].options.renderTo.tagName?this[l].options.renderTo:document.getElementById(this[l].options.renderTo||"");if(y.getAttribute("id")===c)return this[l]}else if(typeof c=="number")return this[c];return null};var zo="2.2.1",we=Math.round,li=Math.abs,ca=new s;ca.version=zo;var Ai=(function(c){function l(p){i(this,l);var y=e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this)),S=y.constructor.name;if(S==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(ca.push(y),p.listeners&&Object.keys(p.listeners).forEach(function(E){(p.listeners[E]instanceof Array?p.listeners[E]:[p.listeners[E]]).forEach(function(O){y.on(E,O)})}),y.version=zo,y.type=n[S]||l,y.initialized=!1,p.minValue=parseFloat(p.minValue),p.maxValue=parseFloat(p.maxValue),p.value=parseFloat(p.value)||0,p.borders||(p.borderInnerWidth=p.borderMiddleWidth=p.borderOuterWidth=0),!p.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var x=p.renderTo.tagName?p.renderTo:document.getElementById(p.renderTo);if(!(x instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return p.width=parseFloat(p.width)||0,p.height=parseFloat(p.height)||0,p.width&&p.height||(p.width||(p.width=x.parentNode?x.parentNode.offsetWidth:x.offsetWidth),p.height||(p.height=x.parentNode?x.parentNode.offsetHeight:x.offsetHeight)),y.options=p||{},y.options.animateOnInit&&(y._value=y.options.value,y.options.value=y.options.minValue),y.canvas=new si(x,p.width,p.height),y.canvas.onRedraw=y.draw.bind(y),y.animation=new Uo(p.animationRule,p.animationDuration),y}return t(l,c),sn(l,[{key:"update",value:function(p){return Object.assign(this.options,this.type.configure(p||{})),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 p=ca.indexOf(this);~p&&ca.splice(p,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(p){var y=this;p=l.ensureValue(p,this.options.minValue);var S=this.options.value;if(p!==S)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===p))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=p),this.emit("animationStart"),this.animation.animate(function(x){var E=S+(p-S)*x;y.options.animatedValue&&y.emit("value",E,y.value),y.options.value=E,y.draw(),y.emit("animate",x,y.options.value)},function(){y._value!==void 0&&(y.emit("value",y._value,y.value),y.options.value=y._value,delete y._value),y.draw(),y.emit("animationEnd"),y.animation.frame=null})}else this.emit("value",p,this.value),this.options.value=p,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(p){return p}},{key:"initialize",value:function(p,y){return new wn(y,"canvas",p)}},{key:"fromElement",value:function(p){var y=wn.toCamelCase(p.getAttribute("data-type")),S=p.attributes,x=0,E=S.length,O={};if(y){for(/Gauge$/.test(y)||(y+="Gauge");x<E;x++)O[wn.toCamelCase(S[x].name.replace(/^data-/,""),!1)]=wn.parse(S[x].value);new wn(O,p.tagName,y).process(p)}}},{key:"ensureValue",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return p=parseFloat(p),!isNaN(p)&&isFinite(p)||(p=parseFloat(y)||0),p}},{key:"mod",value:function(p,y){return(p%y+y)%y}},{key:"version",get:function(){return zo}}]),l})(bm);n!==void 0&&(n.BaseGauge=Ai,n.gauges=(window.document||{}).gauges=ca);var Am=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,oe={roundRect:C,padValue:M,formatMajorTickNumber:N,radians:D,radialPoint:j,linearGradient:X,drawNeedleShadow:Z,drawValueBox:Te,verifyError:h,prepareTicks:b,font:ee,normalizedValue:Ye,formatContext:f},ma=Math.PI,Ho=ma/2,jr=Object.assign({},qo,{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"}),vm=(function(c){function l(p){return i(this,l),p=Object.assign({},jr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),sn(l,[{key:"draw",value:function(){try{var p=this.canvas,y=[-p.drawX,-p.drawY,p.drawWidth,p.drawHeight],S=y[0],x=y[1],E=y[2],O=y[3],P=this.options;if(P.animationTarget==="needle"){if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,E,O),this.emit("beforePlate"),pe(V,P),this.emit("beforeHighlights"),He(V,P),this.emit("beforeMinorTicks"),bt(V,P),this.emit("beforeMajorTicks"),ot(V,P),this.emit("beforeNumbers"),Ta(V,P),this.emit("beforeTitle"),Rr(V,P),this.emit("beforeUnits"),Nr(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,E,O),p.context.drawImage(p.elementClone,S,x,E,O),this.emit("beforeProgressBar"),Lr(p.context,P),this.emit("beforeValueBox"),Wr(p.context,P,Gr(this)),this.emit("beforeNeedle"),Vr(p.context,P)}else{var Q=-oe.radians((P.value-P.minValue)/(P.maxValue-P.minValue)*P.ticksAngle);if(p.context.clearRect(S,x,E,O),this.emit("beforePlate"),pe(p.context,P),p.context.rotate(Q),this.emit("beforeHighlights"),He(p.context,P),this.emit("beforeMinorTicks"),bt(p.context,P),this.emit("beforeMajorTicks"),ot(p.context,P),this.emit("beforeNumbers"),Ta(p.context,P),this.emit("beforeProgressBar"),Lr(p.context,P),p.context.rotate(-Q),!p.elementClone.initialized){var $=p.contextClone;$.clearRect(S,x,E,O),this.emit("beforeTitle"),Rr($,P),this.emit("beforeUnits"),Nr($,P),this.emit("beforeNeedle"),Vr($,P),p.elementClone.initialized=!0}p.context.drawImage(p.elementClone,S,x,E,O)}this.emit("beforeValueBox"),Wr(p.context,P,Gr(this)),Bo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch(le){oe.verifyError(le)}return this}},{key:"value",set:function(p){p=Ai.ensureValue(p,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=p,p=this.options.value+((p-this.options.value)%360+540)%360-180),fm(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",p,this)},get:function(){return Bo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",this)}}],[{key:"configure",value:function(p){return p.barWidth>50&&(p.barWidth=50),isNaN(p.startAngle)&&(p.startAngle=45),isNaN(p.ticksAngle)&&(p.ticksAngle=270),p.ticksAngle>360&&(p.ticksAngle=360),p.ticksAngle<0&&(p.ticksAngle=0),p.startAngle<0&&(p.startAngle=0),p.startAngle>360&&(p.startAngle=360),p}}]),l})(Ai);n!==void 0&&(n.RadialGauge=vm),Ai.initialize("RadialGauge",jr);var Yr=Object.assign({},qo,{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}),ym=(function(c){function l(p){return i(this,l),p=Object.assign({},Yr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),sn(l,[{key:"draw",value:function(){try{var p=this.canvas,y=[-p.drawX,-p.drawY,p.drawWidth,p.drawHeight],S=y[0],x=y[1],E=y[2],O=y[3],P=this.options;if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,E,O),this.emit("beforePlate"),this.drawBox=im(V,P,S,x,E,O),this.emit("beforeBar"),am.apply(void 0,[V,P].concat(o(this.drawBox))),p.contextClone.barDimensions=V.barDimensions,this.emit("beforeHighlights"),rm(V,P),this.emit("beforeMinorTicks"),lm(V,P),this.emit("beforeMajorTicks"),sm(V,P),this.emit("beforeNumbers"),dm(V,P),this.emit("beforeTitle"),cm(V,P),this.emit("beforeUnits"),mm(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,E,O),p.context.drawImage(p.elementClone,S,x,E,O),this.emit("beforeProgressBar"),om.apply(void 0,[p.context,P].concat(o(this.drawBox))),this.emit("beforeNeedle"),um(p.context,P),this.emit("beforeValueBox"),gm.apply(void 0,[p.context,P,P.animatedValue?this.options.value:this.value].concat(o(this.drawBox))),Bo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch(Q){oe.verifyError(Q)}return this}}],[{key:"configure",value:function(p){return p.barStrokeWidth>=p.barWidth&&(p.barStrokeWidth=we(p.barWidth/2)),p.hasLeft=Br("right",p),p.hasRight=Br("left",p),p.value>p.maxValue&&(p.value=p.maxValue),p.value<p.minValue&&(p.value=p.minValue),Ai.configure(p)}}]),l})(Ai);n!==void 0&&(n.LinearGauge=ym),Ai.initialize("LinearGauge",Yr),typeof Eo<"u"&&Object.assign(n,{Collection:s,GenericOptions:qo,Animation:Uo,BaseGauge:Ai,drawings:oe,SmartCanvas:si,DomObserver:wn,vendorize:a})})(typeof Eo<"u"?Eo.exports:window)});var Ei=(()=>{class n{appSettings=A(Zt);data=A(Ci);_svcDatasetConfigs=[];_svcDataSource=[];_svcSubjectObserverRegistry=[];signedAnglePaths=new Set(["self.navigation.attitude.roll","self.navigation.attitude.pitch","self.navigation.attitude.yaw","self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater","self.steering.rudderAngle"]);constructor(){this._svcDatasetConfigs=this.appSettings.getDataSets(),this.cleanupDatasets(),this.startAll()}cleanupDatasets(){if(this.appSettings.configUpgrade()||this.appSettings.getAppConfig().configVersion<12)return;let t=this.appSettings.getDashboardConfig(),i=new Set;t.forEach(h=>{h.configuration?.forEach(f=>{f?.id&&i.add(f.id)})});function a(h){let f=h.match(/^(windtrends|speedtrends)-(.+)$/);return f?f[2]:null}let r=[],s=[];for(let h of this._svcDatasetConfigs){let f=h.label||"",b=!1;if(f.startsWith("windtrends-")||f.startsWith("speedtrends-")){let C=a(f);b=!!(C&&i.has(C))}else(f.startsWith("simple-chart-")||(f.match(/\|/g)||[]).length===4)&&(b=i.has(h.uuid));b?s.push(h):r.push(h)}r.length&&(r.forEach(h=>{console.warn(`[DatasetService] Cleaned dataset: uuid=${h.uuid}, label="${h.label}"`)}),this._svcDatasetConfigs=s,this.appSettings.saveDataSets(this._svcDatasetConfigs))}setupServiceSubjectRegistry(e,t){let i=this._svcSubjectObserverRegistry.findIndex(a=>a.datasetUuid==e);i>=0&&(this._svcSubjectObserverRegistry[i].rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(i,1)),this._svcSubjectObserverRegistry.push({datasetUuid:e,rxjsSubject:new Xr(t)})}createDataSourceConfiguration(e){let i={uuid:e.uuid,pathObserverSubscription:null,sampleTime:null,maxDataPoints:null,smoothingPeriod:null,historicalData:[]};switch(e.timeScaleFormat){case"Last 30 Minutes":i.maxDataPoints=120,i.sampleTime=15e3,i.smoothingPeriod=50;break;case"Last 5 Minutes":i.maxDataPoints=60,i.sampleTime=5e3,i.smoothingPeriod=25;break;case"Last Minute":i.maxDataPoints=60,i.sampleTime=1e3,i.smoothingPeriod=25;break;case"hour":i.maxDataPoints=e.period*120,i.sampleTime=3e4,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break;case"minute":i.maxDataPoints=e.period*60,i.sampleTime=1e3,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break;default:i.maxDataPoints=e.period*5,i.sampleTime=200,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break}return(!i.maxDataPoints||i.maxDataPoints<1)&&(i.maxDataPoints=1),i}startAll(){console.log("[Dataset Service] Auto Starting "+this._svcDatasetConfigs.length.toString()+" Datasets");for(let e of this._svcDatasetConfigs)this.start(e.uuid)}start(e){let t=this._svcDatasetConfigs.find(h=>h.uuid==e);if(!t){console.warn(`[Dataset Service] Dataset UUID:${e} not found`);return}let i=this.createDataSourceConfiguration(t);this.setupServiceSubjectRegistry(i.uuid,i.maxDataPoints);let a=this._svcDataSource[this._svcDataSource.push(i)-1];console.log(`[Dataset Service] Starting recording process: ${t.path}, Scale: ${t.timeScaleFormat}, Period: ${t.period}, Datapoints: ${i.maxDataPoints}`);function r(h){return f=>xn(h).pipe(cs(f,(b,C)=>C))}let s=this.resolveAngleDomain(t.path,t.baseUnit);a.pathObserverSubscription=this.data.subscribePath(t.path,t.pathSource).pipe(r(i.sampleTime)).subscribe(h=>{if(h.data.value===null)return;a.maxDataPoints>0&&a.historicalData.length>=a.maxDataPoints&&a.historicalData.shift(),a.historicalData.push(h.data.value);let f=this.updateDataset(a,t.baseUnit,s);this._svcSubjectObserverRegistry.find(b=>b.datasetUuid===a.uuid).rxjsSubject.next(f)})}stop(e){let t=this._svcDataSource.findIndex(i=>i.uuid==e);console.log(`[Dataset Service] Stopping Dataset ${e} data capture`),this._svcDataSource[t].pathObserverSubscription.unsubscribe(),this._svcDataSource.splice(t,1)}list(){return qt(this._svcDatasetConfigs)}getDatasetConfig(e){return this._svcDatasetConfigs.find(t=>t.uuid===e)}getDataSourceInfo(e){return this._svcDataSource.find(t=>t.uuid===e)}create(e,t,i,a,r,s=!0,h=!0,f){if(!e||!t||!i||!a||!r)return null;let b=f||qi.create(),C={uuid:b,path:e,pathSource:t,baseUnit:this.data.getPathUnitType(e),timeScaleFormat:i,period:a,label:r,editable:h};return console.log(`[Dataset Service] Creating ${s?"":"non-"}persistent ${h?"":"hidden "}dataset: ${C.uuid}, Path: ${C.path}, Source: ${C.pathSource} Scale: ${C.timeScaleFormat}, Period: ${C.period}`),this._svcDatasetConfigs.push(C),this.start(b),s===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),b}edit(e,t=!0){let i=this._svcDatasetConfigs.find(a=>a.uuid===e.uuid);return i?JSON.stringify(i)===JSON.stringify(e)?(console.log(`[Dataset Service] No changes detected for Dataset ${e.uuid}.`),!1):(this.stop(e.uuid),console.log(`[Dataset Service] Updating Dataset: ${e.uuid}`),e.baseUnit=this.data.getPathUnitType(e.path),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(a=>a.uuid===e.uuid),1,e),this.start(e.uuid),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0):!1}remove(e,t=!0){return!e||e===""||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:(this.stop(e),console.log(`[Dataset Service] Removing ${t?"":"non-"}persistent Dataset: ${e}`),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(i=>i.uuid===e),1),this._svcSubjectObserverRegistry.find(i=>i.datasetUuid===e).rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(this._svcSubjectObserverRegistry.findIndex(i=>i.datasetUuid===e),1),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0)}getDatasetObservable(e){let t=this._svcSubjectObserverRegistry.find(i=>i.datasetUuid==e);return t?t.rxjsSubject.asObservable():null}getDatasetBatchThenLiveObservable(e){let t=this._svcSubjectObserverRegistry.find(h=>h.datasetUuid==e);if(!t)return null;let i=t.rxjsSubject,a=i._buffer?i._buffer.slice():[],r=Kr([a]),s=i.pipe(ds(a.length));return ts(r,s)}updateDataset(e,t,i="scalar"){let a=null,r=null,s=null,h=null;if(t==="rad"){a=this.circularMeanRad(e.historicalData);let M=e.historicalData.slice(-e.smoothingPeriod);r=this.circularMeanRad(M);let{min:N,max:D}=this.circularMinMaxRad(e.historicalData);i==="direction"?(a=this.normalizeToDirection(a),r=this.normalizeToDirection(r),s=this.normalizeToDirection(N),h=this.normalizeToDirection(D)):i==="signed"?(a=this.normalizeToSigned(a),r=this.normalizeToSigned(r),s=this.normalizeToSigned(N),h=this.normalizeToSigned(D)):(s=N,h=D)}else a=b(e.historicalData),r=C(e.historicalData,e.smoothingPeriod),s=Math.min(...e.historicalData),h=Math.max(...e.historicalData);return{timestamp:Date.now(),data:{value:t==="rad"?i==="signed"?this.normalizeToSigned(e.historicalData[e.historicalData.length-1]):this.normalizeToDirection(e.historicalData[e.historicalData.length-1]):e.historicalData[e.historicalData.length-1],sma:r,ema:null,doubleEma:null,lastAverage:a,lastMinimum:s,lastMaximum:h}};function b(M){return M.length===0?null:M.reduce((D,j)=>D+j,0)/M.length}function C(M,N){M.length<N&&(N=M.length);let D=0;for(let j=M.length-N;j<M.length;j++)D+=M[j];return D/N}}circularMeanRad(e){if(e.length===0)return 0;let t=e.reduce((a,r)=>a+Math.sin(r),0),i=e.reduce((a,r)=>a+Math.cos(r),0);return Math.atan2(t/e.length,i/e.length)}circularMinMaxRad(e){if(e.length===0)return{min:0,max:0};let t=e.map(h=>(h*180/Math.PI+360)%360).sort((h,f)=>h-f),i=0,a=0;for(let h=0;h<t.length;h++){let f=(h+1)%t.length,b=(t[f]-t[h]+360)%360;b>i&&(i=b,a=f)}let r=t[a]*Math.PI/180,s=t[(a-1+t.length)%t.length]*Math.PI/180;return{min:r,max:s}}resolveAngleDomain(e,t){if(t!=="rad")return"scalar";let i=this.normalizePathKey(e);for(let a of this.signedAnglePaths)if(i===this.normalizePathKey(a))return"signed";return"direction"}normalizePathKey(e){return e.replace(/^vessels\.self\./,"").replace(/^self\./,"")}mod(e,t){return(e%t+t)%t}normalizeToDirection(e){let t=2*Math.PI;return this.mod(e,t)}normalizeToSigned(e){let t=2*Math.PI;return this.mod(e+Math.PI,t)-Math.PI}removeIfExists(e,t=!0){return!e||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:this.remove(e,t)}ngOnDestroy(){[...this._svcDataSource].forEach(e=>{try{this.stop(e.uuid)}catch{}}),this._svcSubjectObserverRegistry.forEach(e=>e.rxjsSubject.complete()),this._svcSubjectObserverRegistry=[]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=ht({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var kl=(()=>{class n{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new Ia(t),timeoutID:null,intervalMS:i},this.kipTimers[e].currentValue.asObservable())}startTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,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){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID!==null&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null)}setTimer(e,t){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].currentValue.next(t)}deleteTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,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}ngOnDestroy(){Object.keys(this.kipTimers).forEach(e=>{this.kipTimers[e].timeoutID&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null),this.kipTimers[e].currentValue.complete()}),this.kipTimers={}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=ht({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Tl=(()=>{class n{sanitizer=A(Za);transform(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Fa({name:"safe",type:n,pure:!0})}return n})();var Sm={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function go(n){let o=Be(Be({},Sm),n);return`(() => {
2
2
  if (window.__kipSwipeInit) return; window.__kipSwipeInit = true;
3
3
  const instanceId='${o.instanceId}';
4
4
  let pointerId=null; let startX=0; let startY=0; let startT=0; let peakPrimary=0; let peakCross=0; let cancelled=false;
@@ -1,2 +1,2 @@
1
- import{a as Xe,m as mt,n as ut,o as ft,p as vt,q as Dt,r as bt}from"./chunk-XZW7P6RL.js";import"./chunk-SY22WXMI.js";import{a as xt}from"./chunk-IJ22WXFB.js";import{d as wt,e as St,g as Pt,h as yt}from"./chunk-RYHOAWDD.js";import"./chunk-PKKBBIJK.js";import"./chunk-HIADZ4BV.js";import{a as et,b as at}from"./chunk-IO5SDLYV.js";import{b as gt}from"./chunk-OQULS6SV.js";import"./chunk-QLTN6G6E.js";import"./chunk-XDPHEQEO.js";import"./chunk-SZ2GUIT5.js";import{D as Ae,Dd as fe,E as $,Ea as ae,Fa as b,Gb as Ke,Gd as M,Ha as le,Hb as ce,Hd as L,Jb as F,K as Fe,Kb as f,La as Ge,Lb as he,Ld as ve,Oa as R,Oc as me,Qa as de,Sc as Je,Td as lt,V as ie,Vd as dt,W as He,Wa as S,Wc as Qe,Wd as ct,X as A,Xa as U,Xb as pe,Ya as $e,Yd as ht,Z as Be,_d as q,ab as Ue,ad as tt,bb as We,bd as it,ca as se,cb as Ze,cd as j,dc as _e,de as pt,ea as k,ed as H,fb as je,fe as _t,g as T,ga as c,gb as qe,hb as I,hd as ue,i as te,ib as p,j as _,ja as E,jb as g,jd as x,ka as C,kb as W,l as Me,md as st,n as Le,na as ze,nc as ge,oa as ne,od as nt,pc as O,pd as rt,qc as Ye,ra as re,rb as Z,tb as m,ua as Ve,vb as y,w as Ne,wa as oe,wd as ot}from"./chunk-OB3QLUH6.js";function we(r){let t=r.cloneNode(!0),e=t.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();t.removeAttribute("id");for(let s=0;s<e.length;s++)e[s].removeAttribute("id");return i==="canvas"?Rt(r,t):(i==="input"||i==="select"||i==="textarea")&&Ct(r,t),Et("canvas",r,t,Rt),Et("input, textarea, select",r,t,Ct),t}function Et(r,t,e,i){let s=t.querySelectorAll(r);if(s.length){let n=e.querySelectorAll(r);for(let o=0;o<s.length;o++)i(s[o],n[o])}}var ni=0;function Ct(r,t){t.type!=="file"&&(t.value=r.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${ni++}`)}function Rt(r,t){let e=t.getContext("2d");if(e)try{e.drawImage(r,0,0)}catch{}}function Re(r){let t=r.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function Se(r,t,e){let{top:i,bottom:s,left:n,right:o}=r;return e>=i&&e<=s&&t>=n&&t<=o}function ri(r,t){let e=t.left<r.left,i=t.left+t.width>r.right,s=t.top<r.top,n=t.top+t.height>r.bottom;return e||i||s||n}function V(r,t,e){r.top+=t,r.bottom=r.top+r.height,r.left+=e,r.right=r.left+r.width}function It(r,t,e,i){let{top:s,right:n,bottom:o,left:a,width:l,height:d}=r,h=l*t,v=d*t;return i>s-v&&i<o+v&&e>a-h&&e<n+h}var K=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Re(e)})})}handleScroll(t){let e=H(t),i=this.positions.get(e);if(!i)return null;let s=i.scrollPosition,n,o;if(e===this._document){let d=this.getViewportScrollPosition();n=d.top,o=d.left}else n=e.scrollTop,o=e.scrollLeft;let a=s.top-n,l=s.left-o;return this.positions.forEach((d,h)=>{d.clientRect&&e!==h&&e.contains(h)&&V(d.clientRect,a,l)}),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Gt(r,t){let e=r.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(s=>i.appendChild(s)),i}function Ie(r,t,e){for(let i in t)if(t.hasOwnProperty(i)){let s=t[i];s?r.setProperty(i,s,e?.has(i)?"important":""):r.removeProperty(i)}return r}function N(r,t){let e=t?"":"none";Ie(r.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Tt(r,t,e){Ie(r.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function Y(r,t){return t&&t!="none"?r+" "+t:r}function kt(r,t){r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.style.transform=G(t.left,t.top)}function G(r,t){return`translate3d(${Math.round(r)}px, ${Math.round(t)}px, 0)`}function Ot(r){let t=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*t}function oi(r){let t=getComputedStyle(r),e=De(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=e.indexOf(i),n=De(t,"transition-duration"),o=De(t,"transition-delay");return Ot(n[s])+Ot(o[s])}function De(r,t){return r.getPropertyValue(t).split(",").map(i=>i.trim())}var ai=new Set(["position"]),Pe=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(t,e,i,s,n,o,a,l,d,h){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=h}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Mt(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return oi(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,s;if(i&&t){let n=t.matchSize?this._initialDomRect:null,o=t.viewContainer.createEmbeddedView(i,t.context);o.detectChanges(),s=Gt(o,this._document),this._previewEmbeddedView=o,t.matchSize?kt(s,n):s.style.transform=G(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=we(this._rootElement),kt(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return Ie(s.style,{"pointer-events":"none",margin:Mt(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},ai),N(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(n=>s.classList.add(n)):s.classList.add(e)),s}};function Mt(r){return"showPopover"in r}var li={passive:!0},Lt={passive:!1},di={passive:!1,capture:!0},ci=800,Nt="cdk-drag-placeholder",At=new Set(["position"]),ye=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=re(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=T.EMPTY;_pointerUpSubscription=T.EMPTY;_scrollSubscription=T.EMPTY;_resizeSubscription=T.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>N(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,s,n,o,a){this._config=e,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new K(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>x(i)),this._handles.forEach(i=>N(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=x(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Lt),i.listen(e,"touchstart",this._pointerDown,li),i.listen(e,"dragstart",this._nativeDragStart,Lt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?x(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&ri(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,s=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?s=t.top-e.top:e.bottom>t.bottom&&(s=t.bottom-e.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=G(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),N(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),N(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let s=Math.abs(e.x-this._pickupPositionOnPage.x),n=Math.abs(e.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){B(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",hi,di)}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new Pe(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,e)),Tt(s,!1,At),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),s=B(e),n=!s&&e.button!==0,o=this._rootElement,a=H(e),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+ci>Date.now(),d=s?it(e):tt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||n||l||d)return;if(this._handles.length){let P=o.style;this._rootElementTapHighlight=P.webkitTapHighlightColor||"",P.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(P=>this._updateOnScroll(P)),this._boundaryElement&&(this._boundaryRect=Re(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let v=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:v.x,y:v.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){Tt(this._rootElement,!0,At),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(t),n=this._getDragDistance(s),o=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,t,e,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&H(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n))},n=setTimeout(s,e*1.5),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Gt(this._placeholderRef,this._document)):i=we(this._rootElement),i.style.pointerEvents="none",i.classList.add(Nt),i}_getPointerPositionInElement(t,e,i){let s=e===this._rootElement?null:e,n=s?s.getBoundingClientRect():t,o=B(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,d=o.pageY-n.top-a.top;return{x:n.left-t.left+l,y:n.top-t.top+d}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=B(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,s=i.pageX-e.left,n=i.pageY-e.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return{x:s,y:n}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),h=a.top+o,v=a.bottom-(d-o),P=a.left+n,Q=a.right-(l-n);i=Ft(i,P,Q),s=Ft(s,h,v)}return{x:i,y:s}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(e-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=e>n.x?1:-1,n.x=e),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,N(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,s=G(t*i,e*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=Y(s,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=G(t,e);this._preview.setTransform(Y(s,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(t+=n),o>0&&(t-=o)):t=0,s.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:B(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=H(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&V(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=j(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let s=this._document;return e||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return x(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let s=this._anchor??=we(this._placeholder);s.classList.remove(Nt),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):x(e.element).appendChild(s)}}};function Ft(r,t,e){return Math.max(t,Math.min(e,r))}function B(r){return r.type[0]==="t"}function hi(r){r.preventDefault()}function J(r,t,e){let i=Ht(t,r.length-1),s=Ht(e,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n}function Ht(r,t){return Math.max(0,Math.min(t,r))}var X=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(t,e,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(D=>D.drag===t),d=n[o],h=n[l].clientRect,v=d.clientRect,P=l>o?1:-1,Q=this._getItemOffsetPx(h,v,P),ti=this._getSiblingOffsetPx(l,n,P),ii=n.slice();return J(n,l,o),n.forEach((D,si)=>{if(ii[si]===D)return;let Te=D.drag===t,ee=Te?Q:ti,ke=Te?t.getPlaceholderElement():D.drag.getRootElement();D.offset+=ee;let Oe=Math.round(D.offset*(1/D.drag.scale));a?(ke.style.transform=Y(`translate3d(${Oe}px, 0, 0)`,D.initialTransform),V(D.clientRect,0,ee)):(ke.style.transform=Y(`translate3d(0, ${Oe}px, 0)`,D.initialTransform),V(D.clientRect,ee,0))}),this._previousSwap.overlaps=Se(v,e,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(t,e,i,s){let n=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s,o=this._activeDraggables,a=o.indexOf(t),l=t.getPlaceholderElement(),d=o[n];if(d===t&&(d=o[n+1]),!d&&(n==null||n===-1||n<o.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(d=o[0]),a>-1&&o.splice(a,1),d&&!this._dragDropRegistry.isDragging(d)){let h=d.getRootElement();h.parentElement.insertBefore(l,h),o.splice(n,0,t)}else this._element.appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(s=>s.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{V(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Re(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=s?e.left-t.left:e.top-t.top;return i===-1&&(n+=s?e.width-t.width:e.height-t.height),n}_getSiblingOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=e[t].clientRect,o=e[t+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",d=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[d]:a+=n[l]-o.clientRect[d]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?t>=o.right:e>=o.bottom}else{let o=i[0].clientRect;return s?t<=o.left:e<=o.top}}_getItemIndexFromPointerPosition(t,e,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(s){let d=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return!1}return n?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,t)?-1:o}},xe=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let s=e[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(t)}sort(t,e,i,s){let n=this._getItemIndexFromPointerPosition(t,e,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===t)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(t),d=t.getPlaceholderElement(),h=a.getRootElement();n>l?h.after(d):h.before(d),J(this._activeItems,l,n);let v=this._getRootNode().elementFromPoint(e,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=h===v||h.contains(v),{previousIndex:l,currentIndex:n}}enter(t,e,i,s){let n=this._activeItems.indexOf(t);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===t&&s.nextSibling!==n&&(n===null?t.appendChild(s):n.parentNode===t&&t.insertBefore(s,n))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let s=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,t)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=j(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==t){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),h=Math.hypot(e-l,i-d);h<s&&(s=h,n=o)}}return n}},Bt=.05,$t=.05,w=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(w||{}),u=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(u||{}),Ee=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=T.EMPTY;_verticalScrollDirection=w.NONE;_horizontalScrollDirection=u.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,s,n){this._dragDropRegistry=e,this._ngZone=s,this._viewportRuler=n;let o=this.element=x(t);this._document=i,this.withOrientation("vertical").withElementContainer(o),e.registerDropContainer(this),this._parentPositions=new K(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,s,n,o,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(s=>s.isDragging()).every(s=>t.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof X&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new xe(this._document,this._dragDropRegistry);else{let e=new X(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=x(this.element),i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,s){if(this.sortingDisabled||!this._domRect||!It(this._domRect,Bt,e,i))return;let n=this._sortStrategy.sort(t,e,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,s=w.NONE,n=u.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||It(o.clientRect,Bt,t,e)&&([s,n]=pi(a,o.clientRect,this._direction,t,e),(s||n)&&(i=a))}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=Ut(l,e),n=Wt(l,t),i=window}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Ae(0,Le).pipe(A(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===w.UP?t.scrollBy(0,-e):this._verticalScrollDirection===w.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===u.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===u.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&Se(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(s=>s._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!Se(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let s=this._getShadowRoot().elementFromPoint(e,i);return s?s===this._container||this._container.contains(s):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=j(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Ut(r,t){let{top:e,bottom:i,height:s}=r,n=s*$t;return t>=e-n&&t<=e+n?w.UP:t>=i-n&&t<=i+n?w.DOWN:w.NONE}function Wt(r,t){let{left:e,right:i,width:s}=r,n=s*$t;return t>=e-n&&t<=e+n?u.LEFT:t>=i-n&&t<=i+n?u.RIGHT:u.NONE}function pi(r,t,e,i,s){let n=Ut(t,s),o=Wt(t,i),a=w.NONE,l=u.NONE;if(n){let d=r.scrollTop;n===w.UP?d>0&&(a=w.UP):r.scrollHeight-d>r.clientHeight&&(a=w.DOWN)}if(o){let d=r.scrollLeft;e==="rtl"?o===u.RIGHT?d<0&&(l=u.RIGHT):r.scrollWidth+d>r.clientWidth&&(l=u.LEFT):o===u.LEFT?d>0&&(l=u.LEFT):r.scrollWidth-d>r.clientWidth&&(l=u.RIGHT)}return[a,l]}var z={capture:!0},be={passive:!1,capture:!0},_i=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
1
+ import{a as Xe,m as mt,n as ut,o as ft,p as vt,q as Dt,r as bt}from"./chunk-OFUYGORI.js";import"./chunk-SY22WXMI.js";import{a as xt}from"./chunk-IJ22WXFB.js";import{d as wt,e as St,g as Pt,h as yt}from"./chunk-RYHOAWDD.js";import"./chunk-PKKBBIJK.js";import"./chunk-HIADZ4BV.js";import{a as et,b as at}from"./chunk-IM2WDWW4.js";import{b as gt}from"./chunk-OQULS6SV.js";import"./chunk-QLTN6G6E.js";import"./chunk-XDPHEQEO.js";import"./chunk-SZ2GUIT5.js";import{D as Ae,Dd as fe,E as $,Ea as ae,Fa as b,Gb as Ke,Gd as M,Ha as le,Hb as ce,Hd as L,Jb as F,K as Fe,Kb as f,La as Ge,Lb as he,Ld as ve,Oa as R,Oc as me,Qa as de,Sc as Je,Td as lt,V as ie,Vd as dt,W as He,Wa as S,Wc as Qe,Wd as ct,X as A,Xa as U,Xb as pe,Ya as $e,Yd as ht,Z as Be,_d as q,ab as Ue,ad as tt,bb as We,bd as it,ca as se,cb as Ze,cd as j,dc as _e,de as pt,ea as k,ed as H,fb as je,fe as _t,g as T,ga as c,gb as qe,hb as I,hd as ue,i as te,ib as p,j as _,ja as E,jb as g,jd as x,ka as C,kb as W,l as Me,md as st,n as Le,na as ze,nc as ge,oa as ne,od as nt,pc as O,pd as rt,qc as Ye,ra as re,rb as Z,tb as m,ua as Ve,vb as y,w as Ne,wa as oe,wd as ot}from"./chunk-OB3QLUH6.js";function we(r){let t=r.cloneNode(!0),e=t.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();t.removeAttribute("id");for(let s=0;s<e.length;s++)e[s].removeAttribute("id");return i==="canvas"?Rt(r,t):(i==="input"||i==="select"||i==="textarea")&&Ct(r,t),Et("canvas",r,t,Rt),Et("input, textarea, select",r,t,Ct),t}function Et(r,t,e,i){let s=t.querySelectorAll(r);if(s.length){let n=e.querySelectorAll(r);for(let o=0;o<s.length;o++)i(s[o],n[o])}}var ni=0;function Ct(r,t){t.type!=="file"&&(t.value=r.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${ni++}`)}function Rt(r,t){let e=t.getContext("2d");if(e)try{e.drawImage(r,0,0)}catch{}}function Re(r){let t=r.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function Se(r,t,e){let{top:i,bottom:s,left:n,right:o}=r;return e>=i&&e<=s&&t>=n&&t<=o}function ri(r,t){let e=t.left<r.left,i=t.left+t.width>r.right,s=t.top<r.top,n=t.top+t.height>r.bottom;return e||i||s||n}function V(r,t,e){r.top+=t,r.bottom=r.top+r.height,r.left+=e,r.right=r.left+r.width}function It(r,t,e,i){let{top:s,right:n,bottom:o,left:a,width:l,height:d}=r,h=l*t,v=d*t;return i>s-v&&i<o+v&&e>a-h&&e<n+h}var K=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Re(e)})})}handleScroll(t){let e=H(t),i=this.positions.get(e);if(!i)return null;let s=i.scrollPosition,n,o;if(e===this._document){let d=this.getViewportScrollPosition();n=d.top,o=d.left}else n=e.scrollTop,o=e.scrollLeft;let a=s.top-n,l=s.left-o;return this.positions.forEach((d,h)=>{d.clientRect&&e!==h&&e.contains(h)&&V(d.clientRect,a,l)}),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Gt(r,t){let e=r.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(s=>i.appendChild(s)),i}function Ie(r,t,e){for(let i in t)if(t.hasOwnProperty(i)){let s=t[i];s?r.setProperty(i,s,e?.has(i)?"important":""):r.removeProperty(i)}return r}function N(r,t){let e=t?"":"none";Ie(r.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Tt(r,t,e){Ie(r.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function Y(r,t){return t&&t!="none"?r+" "+t:r}function kt(r,t){r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.style.transform=G(t.left,t.top)}function G(r,t){return`translate3d(${Math.round(r)}px, ${Math.round(t)}px, 0)`}function Ot(r){let t=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*t}function oi(r){let t=getComputedStyle(r),e=De(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=e.indexOf(i),n=De(t,"transition-duration"),o=De(t,"transition-delay");return Ot(n[s])+Ot(o[s])}function De(r,t){return r.getPropertyValue(t).split(",").map(i=>i.trim())}var ai=new Set(["position"]),Pe=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(t,e,i,s,n,o,a,l,d,h){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=h}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Mt(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return oi(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,s;if(i&&t){let n=t.matchSize?this._initialDomRect:null,o=t.viewContainer.createEmbeddedView(i,t.context);o.detectChanges(),s=Gt(o,this._document),this._previewEmbeddedView=o,t.matchSize?kt(s,n):s.style.transform=G(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=we(this._rootElement),kt(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return Ie(s.style,{"pointer-events":"none",margin:Mt(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},ai),N(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(n=>s.classList.add(n)):s.classList.add(e)),s}};function Mt(r){return"showPopover"in r}var li={passive:!0},Lt={passive:!1},di={passive:!1,capture:!0},ci=800,Nt="cdk-drag-placeholder",At=new Set(["position"]),ye=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=re(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=T.EMPTY;_pointerUpSubscription=T.EMPTY;_scrollSubscription=T.EMPTY;_resizeSubscription=T.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>N(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,s,n,o,a){this._config=e,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new K(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>x(i)),this._handles.forEach(i=>N(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=x(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Lt),i.listen(e,"touchstart",this._pointerDown,li),i.listen(e,"dragstart",this._nativeDragStart,Lt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?x(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&ri(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,s=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?s=t.top-e.top:e.bottom>t.bottom&&(s=t.bottom-e.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=G(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),N(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),N(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let s=Math.abs(e.x-this._pickupPositionOnPage.x),n=Math.abs(e.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){B(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",hi,di)}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new Pe(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,e)),Tt(s,!1,At),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),s=B(e),n=!s&&e.button!==0,o=this._rootElement,a=H(e),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+ci>Date.now(),d=s?it(e):tt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||n||l||d)return;if(this._handles.length){let P=o.style;this._rootElementTapHighlight=P.webkitTapHighlightColor||"",P.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(P=>this._updateOnScroll(P)),this._boundaryElement&&(this._boundaryRect=Re(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let v=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:v.x,y:v.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){Tt(this._rootElement,!0,At),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(t),n=this._getDragDistance(s),o=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,t,e,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&H(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n))},n=setTimeout(s,e*1.5),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Gt(this._placeholderRef,this._document)):i=we(this._rootElement),i.style.pointerEvents="none",i.classList.add(Nt),i}_getPointerPositionInElement(t,e,i){let s=e===this._rootElement?null:e,n=s?s.getBoundingClientRect():t,o=B(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,d=o.pageY-n.top-a.top;return{x:n.left-t.left+l,y:n.top-t.top+d}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=B(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,s=i.pageX-e.left,n=i.pageY-e.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return{x:s,y:n}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),h=a.top+o,v=a.bottom-(d-o),P=a.left+n,Q=a.right-(l-n);i=Ft(i,P,Q),s=Ft(s,h,v)}return{x:i,y:s}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(e-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=e>n.x?1:-1,n.x=e),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,N(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,s=G(t*i,e*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=Y(s,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=G(t,e);this._preview.setTransform(Y(s,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(t+=n),o>0&&(t-=o)):t=0,s.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:B(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=H(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&V(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=j(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let s=this._document;return e||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return x(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let s=this._anchor??=we(this._placeholder);s.classList.remove(Nt),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):x(e.element).appendChild(s)}}};function Ft(r,t,e){return Math.max(t,Math.min(e,r))}function B(r){return r.type[0]==="t"}function hi(r){r.preventDefault()}function J(r,t,e){let i=Ht(t,r.length-1),s=Ht(e,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n}function Ht(r,t){return Math.max(0,Math.min(t,r))}var X=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(t,e,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(D=>D.drag===t),d=n[o],h=n[l].clientRect,v=d.clientRect,P=l>o?1:-1,Q=this._getItemOffsetPx(h,v,P),ti=this._getSiblingOffsetPx(l,n,P),ii=n.slice();return J(n,l,o),n.forEach((D,si)=>{if(ii[si]===D)return;let Te=D.drag===t,ee=Te?Q:ti,ke=Te?t.getPlaceholderElement():D.drag.getRootElement();D.offset+=ee;let Oe=Math.round(D.offset*(1/D.drag.scale));a?(ke.style.transform=Y(`translate3d(${Oe}px, 0, 0)`,D.initialTransform),V(D.clientRect,0,ee)):(ke.style.transform=Y(`translate3d(0, ${Oe}px, 0)`,D.initialTransform),V(D.clientRect,ee,0))}),this._previousSwap.overlaps=Se(v,e,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(t,e,i,s){let n=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s,o=this._activeDraggables,a=o.indexOf(t),l=t.getPlaceholderElement(),d=o[n];if(d===t&&(d=o[n+1]),!d&&(n==null||n===-1||n<o.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(d=o[0]),a>-1&&o.splice(a,1),d&&!this._dragDropRegistry.isDragging(d)){let h=d.getRootElement();h.parentElement.insertBefore(l,h),o.splice(n,0,t)}else this._element.appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(s=>s.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{V(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Re(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=s?e.left-t.left:e.top-t.top;return i===-1&&(n+=s?e.width-t.width:e.height-t.height),n}_getSiblingOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=e[t].clientRect,o=e[t+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",d=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[d]:a+=n[l]-o.clientRect[d]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?t>=o.right:e>=o.bottom}else{let o=i[0].clientRect;return s?t<=o.left:e<=o.top}}_getItemIndexFromPointerPosition(t,e,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(s){let d=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return!1}return n?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,t)?-1:o}},xe=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let s=e[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(t)}sort(t,e,i,s){let n=this._getItemIndexFromPointerPosition(t,e,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===t)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(t),d=t.getPlaceholderElement(),h=a.getRootElement();n>l?h.after(d):h.before(d),J(this._activeItems,l,n);let v=this._getRootNode().elementFromPoint(e,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=h===v||h.contains(v),{previousIndex:l,currentIndex:n}}enter(t,e,i,s){let n=this._activeItems.indexOf(t);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===t&&s.nextSibling!==n&&(n===null?t.appendChild(s):n.parentNode===t&&t.insertBefore(s,n))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let s=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,t)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=j(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==t){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),h=Math.hypot(e-l,i-d);h<s&&(s=h,n=o)}}return n}},Bt=.05,$t=.05,w=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(w||{}),u=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(u||{}),Ee=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=T.EMPTY;_verticalScrollDirection=w.NONE;_horizontalScrollDirection=u.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,s,n){this._dragDropRegistry=e,this._ngZone=s,this._viewportRuler=n;let o=this.element=x(t);this._document=i,this.withOrientation("vertical").withElementContainer(o),e.registerDropContainer(this),this._parentPositions=new K(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,s,n,o,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(s=>s.isDragging()).every(s=>t.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof X&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new xe(this._document,this._dragDropRegistry);else{let e=new X(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=x(this.element),i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,s){if(this.sortingDisabled||!this._domRect||!It(this._domRect,Bt,e,i))return;let n=this._sortStrategy.sort(t,e,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,s=w.NONE,n=u.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||It(o.clientRect,Bt,t,e)&&([s,n]=pi(a,o.clientRect,this._direction,t,e),(s||n)&&(i=a))}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=Ut(l,e),n=Wt(l,t),i=window}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Ae(0,Le).pipe(A(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===w.UP?t.scrollBy(0,-e):this._verticalScrollDirection===w.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===u.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===u.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&Se(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(s=>s._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!Se(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let s=this._getShadowRoot().elementFromPoint(e,i);return s?s===this._container||this._container.contains(s):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=j(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Ut(r,t){let{top:e,bottom:i,height:s}=r,n=s*$t;return t>=e-n&&t<=e+n?w.UP:t>=i-n&&t<=i+n?w.DOWN:w.NONE}function Wt(r,t){let{left:e,right:i,width:s}=r,n=s*$t;return t>=e-n&&t<=e+n?u.LEFT:t>=i-n&&t<=i+n?u.RIGHT:u.NONE}function pi(r,t,e,i,s){let n=Ut(t,s),o=Wt(t,i),a=w.NONE,l=u.NONE;if(n){let d=r.scrollTop;n===w.UP?d>0&&(a=w.UP):r.scrollHeight-d>r.clientHeight&&(a=w.DOWN)}if(o){let d=r.scrollLeft;e==="rtl"?o===u.RIGHT?d<0&&(l=u.RIGHT):r.scrollWidth+d>r.clientWidth&&(l=u.LEFT):o===u.LEFT?d>0&&(l=u.LEFT):r.scrollWidth-d>r.clientWidth&&(l=u.RIGHT)}return[a,l]}var z={capture:!0},be={passive:!1,capture:!0},_i=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
2
2
  `],encapsulation:2,changeDetection:0})}return r})(),Zt=(()=>{class r{_ngZone=c(U);_document=c(ne);_styleLoader=c(st);_renderer=c(le).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=re([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new _;pointerUp=new _;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,be)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(_i),this._activeDragInstances.update(s=>[...s,e]),this._activeDragInstances().length===1)){let s=i.type.startsWith("touch"),n=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),z],["selectstart",this._preventDefaultWhileDragging,be]];s?o.push(["touchend",n,z],["touchcancel",n,z]):o.push(["mouseup",n,z]),s||o.push(["mousemove",a=>this.pointerMove.next(a),be]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,d])=>this._renderer.listen(this._document,a,l,d))})}}stopDragging(e){this._activeDragInstances.update(i=>{let s=i.indexOf(e);return s>-1?(i.splice(s,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new te(s=>this._ngZone.runOutsideAngular(()=>{let n=this._renderer.listen(e,"scroll",o=>{this._activeDragInstances().length&&s.next(o)},z);return()=>{n()}}))),$(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||r)};static \u0275prov=se({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),gi={dragStartThreshold:5,pointerDirectionChangeThreshold:5},jt=(()=>{class r{_document=c(ne);_ngZone=c(U);_viewportRuler=c(_t);_dragDropRegistry=c(Zt);_renderer=c(le).createRenderer(null,null);constructor(){}createDrag(e,i=gi){return new ye(e,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry,this._renderer)}createDropList(e){return new Ee(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=se({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),zt=new k("CDK_DRAG_PARENT");var mi=new k("CdkDragHandle");var qt=new k("CDK_DRAG_CONFIG"),Kt=new k("CdkDropList"),Yt=(()=>{class r{element=c(oe);dropContainer=c(Kt,{optional:!0,skipSelf:!0});_ngZone=c(U);_viewContainerRef=c(Ge);_dir=c(fe,{optional:!0});_changeDetectorRef=c(ge);_selfHandle=c(mi,{optional:!0,self:!0});_parentDrag=c(zt,{optional:!0,skipSelf:!0});_dragDropRegistry=c(Zt);_destroyed=new _;_handles=new Me([]);_previewTemplate;_placeholderTemplate;_dragRef;data;lockAxis;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled;constrainPosition;previewClass;previewContainer;scale=1;started=new S;released=new S;ended=new S;entered=new S;exited=new S;dropped=new S;moved=new te(e=>{let i=this._dragRef.moved.pipe(Ne(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=c(ze);constructor(){let e=this.dropContainer,i=c(qt,{optional:!0}),s=c(jt);this._dragRef=s.createDrag(this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(A(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){$e(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,s=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,s&&!s.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),s=i.indexOf(e);s>-1&&(i.splice(s,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):x(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,s=this.dragStartDelay,n=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof s=="object"&&s?s:ue(s),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(Fe(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){e.withParent(s._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:s,constrainPosition:n,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:d,previewContainer:h}=e;this.disabled=l??!1,this.dragStartDelay=s||0,i&&(this.lockAxis=i),n&&(this.constrainPosition=n),o&&(this.previewClass=o),a&&(this.boundaryElement=a),d&&(this.rootElementSelector=d),h&&(this.previewContainer=h)}_setupHandlesListener(){this._handles.pipe(Be(e=>{let i=e.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),He(e=>$(...e.map(i=>i._stateChanges.pipe(ie(i))))),A(this._destroyed)).subscribe(e=>{let i=this._dragRef,s=e.element.nativeElement;e.disabled?i.disableHandle(s):i.enableHandle(s)})}static \u0275fac=function(i){return new(i||r)};static \u0275dir=de({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){i&2&&ce("cdk-drag-disabled",s.disabled)("cdk-drag-dragging",s._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",O],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Ye]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[pe([{provide:zt,useExisting:r}]),Ve]})}return r})(),Vt=new k("CdkDropListGroup");var Xt=(()=>{class r{element=c(oe);_changeDetectorRef=c(ge);_scrollDispatcher=c(pt);_dir=c(fe,{optional:!0});_group=c(Vt,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new _;_scrollableParentsResolved;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation;id=c(ot).getId("cdk-drop-list-");lockAxis;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e}_disabled;sortingDisabled;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled;autoScrollStep;elementContainerSelector;hasAnchor;dropped=new S;entered=new S;exited=new S;sorted=new S;_unsortedItems=new Set;constructor(){let e=c(jt),i=c(qt,{optional:!0});this._dropListRef=e.createDropList(this.element),this._dropListRef.data=this,i&&this._assignDefaults(i),this._dropListRef.enterPredicate=(s,n)=>this.enterPredicate(s.data,n.data),this._dropListRef.sortPredicate=(s,n,o)=>this.sortPredicate(s,n.data,o.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),r._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(e._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,i)=>e._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=r._dropLists.indexOf(this);e>-1&&r._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(ie(this._dir.value),A(this._destroyed)).subscribe(i=>e.withDirection(i)),e.beforeStarted.subscribe(()=>{let i=nt(this.connectedTo).map(s=>{if(typeof s=="string"){let n=r._dropLists.find(o=>o.id===s);return n}return s});if(this._group&&this._group._items.forEach(s=>{i.indexOf(s)===-1&&i.push(s)}),!this._scrollableParentsResolved){let s=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(n=>n.getElementRef().nativeElement);this._dropListRef.withScrollableParents(s),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let s=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(s)}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=ue(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(i.filter(s=>s&&s!==this).map(s=>s._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),$(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(e){let{lockAxis:i,draggingDisabled:s,sortingDisabled:n,listAutoScrollDisabled:o,listOrientation:a}=e;this.disabled=s??!1,this.sortingDisabled=n??!1,this.autoScrollDisabled=o??!1,this.orientation=a||"vertical",i&&(this.lockAxis=i)}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e)}static \u0275fac=function(i){return new(i||r)};static \u0275dir=de({type:r,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,s){i&2&&(Ue("id",s.id),ce("cdk-drop-list-disabled",s.disabled)("cdk-drop-list-dragging",s._dropListRef.isDragging())("cdk-drop-list-receiving",s._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",O],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",O],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",O],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",O]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[pe([{provide:Vt,useValue:void 0},{provide:Kt,useExisting:r}])]})}return r})();function ui(r,t){if(r&1){let e=Z();p(0,"button",0),m("click",function(){E(e);let s=y();return C(s.clickAction("cancel"))}),p(1,"mat-icon",1),f(2,"close"),g(),p(3,"span"),f(4,"Close"),g()()}}var Qt=(()=>{class r{_bottomSheetRef=c(vt);data=c(ft);showCancel=!!(this.data&&this.data.showCancel);clickAction(e){this._bottomSheetRef.dismiss(e)}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["dashboards-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(i,s){i&1&&(p(0,"mat-action-list")(1,"button",0),m("click",function(){return s.clickAction("duplicate")}),p(2,"mat-icon",1),f(3,"content_copy"),g(),p(4,"span"),f(5,"Duplicate"),g()(),p(6,"button",0),m("click",function(){return s.clickAction("delete")}),p(7,"mat-icon",1),f(8,"delete_forever"),g(),p(9,"span"),f(10,"Delete"),g()(),We(11,ui,5,0,"button",2),g()),i&2&&(b(11),Ze(s.showCancel?11:-1))},dependencies:[yt,St,Pt,wt,L,M],encapsulation:2})}return r})();var vi=(r,t)=>t.id;function Di(r,t){if(r&1){let e=Z();p(0,"div",5),m("cdkDragStarted",function(){E(e);let s=y();return C(s.dragStart())})("cdkDragMoved",function(s){E(e);let n=y();return C(n.onDragMoved(s))})("cdkDragEnded",function(){E(e);let s=y();return C(s.dragEnd())})("press",function(){let s=E(e).$index,n=y();return C(n.onPress(s))})("doubletap",function(){let s=E(e).$index,n=y();return C(n.editDashboard(s))}),p(1,"div",6),f(2),g(),p(3,"div"),W(4,"mat-icon",7),g(),p(5,"p",8),f(6),g()()}if(r&2){let e=t.$implicit,i=t.$index,s=y();I("mode","editor")("disableGestures",s._sheetOpen||s.suppressDrag)("cdkDragDisabled",s._sheetOpen||s.suppressDrag),b(2),he(i+1),b(2),Ke("width",72,"px")("height",72,"px"),I("svgIcon",e.icon||"dashboard"),b(2),he(e.name)}}var ei=(()=>{class r{pageTitle="Dashboards";_bottomSheet=c(Dt);_dashboard=c(et);_uiEvent=c(ut);_dialog=c(mt);_sanitizer=c(Je);_sheetOpen=!1;suppressDrag=!1;_dragActive=!1;_dragMoved=!1;_dragSuppressThresholdPx=4;addDashboard(){this._dialog.openDashboardPageEditorDialog({title:"New Dashboard",name:`Dashboard ${this._dashboard.dashboards().length+1}`,icon:"dashboard-dashboard",confirmBtnText:"Create",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{e&&this._dashboard.add(e.name,[],e.icon,e.collapseSplitShell)})}openBottomSheet(e){if(this._sheetOpen)return;this._sheetOpen=!0;let i=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Qt,i?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(n=>{switch(this._sheetOpen=!1,n){case"delete":this.deleteDashboard(e);break;case"duplicate":this.duplicateDashboard(e,`${this._dashboard.dashboards()[e].name}`);break;default:break}})}editDashboard(e){let i=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Dashboard Options",name:i.name,icon:i.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:i.collapseSplitShell??!1}).afterClosed().subscribe(s=>{s&&this._dashboard.update(e,s.name,s.icon,s.collapseSplitShell)})}deleteDashboard(e){this._dashboard.delete(e)}duplicateDashboard(e,i){let s=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Duplicate Dashboard",name:`${i} copy`,icon:s.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:s.collapseSplitShell??!1}).afterClosed().subscribe(n=>{n&&this._dashboard.duplicate(e,n.name,n.icon,n.collapseSplitShell)})}drop(e){this._dashboard.dashboards.update(i=>{let s=[...i];J(s,e.previousIndex,e.currentIndex);let n=this._dashboard.activeDashboard();return n===e.previousIndex?this._dashboard.activeDashboard.set(e.currentIndex):n>e.previousIndex&&n<=e.currentIndex?this._dashboard.activeDashboard.set(n-1):n<e.previousIndex&&n>=e.currentIndex&&this._dashboard.activeDashboard.set(n+1),s})}dragStart(){this._sheetOpen||this.suppressDrag||(this._uiEvent.isDragging.set(!0),this._dragActive=!0,this._dragMoved=!1)}dragEnd(){this._uiEvent.isDragging.set(!1),this._dragActive=!1,setTimeout(()=>{this._dragMoved=!1},60)}onDragMoved(e){if(!this._dragActive||this._dragMoved)return;Math.hypot(e.distance.x,e.distance.y)>this._dragSuppressThresholdPx&&(this._dragMoved=!0)}onPress(e){this._sheetOpen||this._dragMoved||(this.cancelPointerSequence(),this.openBottomSheet(e))}cancelPointerSequence(){this.suppressDrag=!0,this._dragActive=!1,this._dragMoved=!1,["pointerup","mouseup","touchend"].forEach(e=>{document.dispatchEvent(new Event(e,{bubbles:!0}))})}onPointerRelease(){this._sheetOpen||(this.suppressDrag=!1)}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["dashboards-editor"]],hostBindings:function(i,s){i&1&&m("mouseup",function(){return s.onPointerRelease()},ae)("touchend",function(){return s.onPointerRelease()},ae)},decls:10,vars:0,consts:[["cdkDropList","","cdkDropListOrientation","mixed",1,"dashboard-manage",3,"cdkDropListDropped"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"mode","disableGestures","cdkDragDisabled"],["tabindex","0",1,"dashboard-card","dashboard-item-add","dashboard-add-btn",3,"click","keydown"],["mat-fab",""],[2,"margin-top","10px"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"cdkDragStarted","cdkDragMoved","cdkDragEnded","press","doubletap","mode","disableGestures","cdkDragDisabled"],[1,"item-index"],["aria-hidden","false",1,"dashboard-icon",3,"svgIcon"],[1,"dashboard-name"]],template:function(i,s){i&1&&(p(0,"div",0),m("cdkDropListDropped",function(o){return s.drop(o)}),je(1,Di,7,10,"div",1,vi),p(3,"div",2),m("click",function(){return s.addDashboard()})("keydown",function(){return s.addDashboard()}),p(4,"button",3)(5,"mat-icon"),f(6,"add_box"),g()(),p(7,"p",4)(8,"i"),f(9,"Add Dashboard"),g()()()()),i&2&&(b(),qe(s._dashboard.dashboards()))},dependencies:[bt,q,ht,L,M,Xt,Yt,ct,lt,Xe],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow-y:auto;scroll-behavior:smooth}.dashboard-manage[_ngcontent-%COMP%]{box-sizing:border-box;padding:0 60px;width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-around;overflow-y:auto;scroll-behavior:smooth}.dashboard-card[_ngcontent-%COMP%]{position:relative;height:200px;width:300px;margin:10px;border-radius:15px;padding:10px;align-content:center;text-align:center;border:2px solid transparent}@media (max-width: 600px) and (orientation: portrait){.dashboard-manage[_ngcontent-%COMP%]{padding:0 70px}.dashboard-card[_ngcontent-%COMP%]{height:175px}}.dashboard-item[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container-highest);cursor:pointer}.dashboard-item[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-item-add[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container);cursor:pointer}.dashboard-item-add[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-add-btn[_ngcontent-%COMP%]{align-content:center;text-align:center;border:dashed 1px var(--mat-sys-outline)}.item-index[_ngcontent-%COMP%]{position:absolute;top:20px;left:20px;display:inline-flex;flex-wrap:wrap;height:42px;width:42px;background-color:var(--kip-contrast-dim-color);color:var(--mat-sys-surface-bright);border-radius:25%;align-content:center;align-items:center;justify-content:center;font-weight:700;font-size:1.25em;z-index:1}.dashboard-icon[_ngcontent-%COMP%]{opacity:.5}.dashboard-name[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:0;font-size:1.1em}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px var(--mat-sys-on-primary-container),0 8px 10px 1px var(--mat-sys-on-primary-container),0 3px 14px 2px var(--mat-sys-on-primary-container)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}"]})}return r})();var Ps=(()=>{class r{_router=c(Qe);app=c(at);_responsive=c(rt);_isPhonePortrait=me(this._responsive.observe(ve.HandsetPortrait));_isPhoneLandscape=me(this._responsive.observe(ve.HandsetLandscape));isPhonePortrait=_e(()=>this._isPhonePortrait().matches);isPhoneLandscape=_e(()=>this._isPhoneLandscape().matches);closePage(){this._router.navigate(["/dashboard"])}onActionItem(e){switch(e){case"help":this._router.navigate(["/help"]);break;case"datainspector":this._router.navigate(["/data"]);break;case"remotecontrol":this._router.navigate(["/remote"]);break;case"options":this._router.navigate(["/options"]);break;default:break}}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["settings"]],decls:11,vars:20,consts:[[1,"home-container"],[1,"actions-header-container"],[1,"actions-buttons-container"],["tabindex","0","svgIcon","settings","label","Options",3,"click","iconOnly","compact","iconSize"],["tabindex","0","svgIcon","troubleshoot","label","Data Inspector",3,"click","iconOnly","compact","iconSize"],["tabindex","0","svgIcon","remote-control","label","Remote Control",3,"click","iconOnly","compact","iconSize"],["tabindex","0","svgIcon","help-center","label","Help",3,"click","iconOnly","compact","iconSize"],["mat-icon-button","",1,"dialog-close-icon",3,"click"],[1,"dashboards-editor"]],template:function(i,s){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2)(3,"tile-large-icon",3),m("click",function(){return s.onActionItem("options")}),g(),p(4,"tile-large-icon",4),m("click",function(){return s.onActionItem("datainspector")}),g(),p(5,"tile-large-icon",5),m("click",function(){return s.onActionItem("remotecontrol")}),g(),p(6,"tile-large-icon",6),m("click",function(){return s.onActionItem("help")}),g()(),p(7,"button",7),m("click",function(){return s.closePage()}),p(8,"mat-icon"),f(9,"close"),g()()(),W(10,"dashboards-editor",8),g()),i&2&&(b(3),F(`${s.isPhonePortrait()?"no-label":"with-label"}`),I("iconOnly",s.isPhonePortrait())("compact",!0)("iconSize",48),b(),F(`${s.isPhonePortrait()?"no-label":"with-label"}`),I("iconOnly",s.isPhonePortrait())("compact",!0)("iconSize",48),b(),F(`${s.isPhonePortrait()?"no-label":"with-label"}`),I("iconOnly",s.isPhonePortrait())("compact",!0)("iconSize",48),b(),F(`${s.isPhonePortrait()?"no-label":"with-label"}`),I("iconOnly",s.isPhonePortrait())("compact",!0)("iconSize",48))},dependencies:[L,M,q,dt,xt,gt,ei],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.home-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.actions-header-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;width:100%;padding:5px 0 5px 10px}.with-label[_ngcontent-%COMP%]{height:80px;width:100px}.no-label[_ngcontent-%COMP%]{height:58px;width:63px}.dashboard-editor[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto}.actions-buttons-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px;margin-top:6px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}"]})}return r})();export{Ps as SettingsComponent};
package/public/index.html CHANGED
@@ -62,5 +62,5 @@
62
62
  </div>
63
63
  </app-root>
64
64
  </div>
65
- <link rel="modulepreload" href="chunk-3O3POI5Z.js"><link rel="modulepreload" href="chunk-XZW7P6RL.js"><link rel="modulepreload" href="chunk-F5X5MWHG.js"><link rel="modulepreload" href="chunk-SY22WXMI.js"><link rel="modulepreload" href="chunk-52M2PJJL.js"><link rel="modulepreload" href="chunk-IJ22WXFB.js"><link rel="modulepreload" href="chunk-RYHOAWDD.js"><link rel="modulepreload" href="chunk-BMDGKBYM.js"><link rel="modulepreload" href="chunk-AB255PKD.js"><link rel="modulepreload" href="chunk-PKKBBIJK.js"><script src="polyfills-KH22MU6U.js" type="module"></script><script src="scripts-7HSGK5LZ.js" defer></script><script src="main-PXPGE7J4.js" type="module"></script></body>
65
+ <link rel="modulepreload" href="chunk-ISEZELDP.js"><link rel="modulepreload" href="chunk-OFUYGORI.js"><link rel="modulepreload" href="chunk-F5X5MWHG.js"><link rel="modulepreload" href="chunk-SY22WXMI.js"><link rel="modulepreload" href="chunk-52M2PJJL.js"><link rel="modulepreload" href="chunk-IJ22WXFB.js"><link rel="modulepreload" href="chunk-RYHOAWDD.js"><link rel="modulepreload" href="chunk-BMDGKBYM.js"><link rel="modulepreload" href="chunk-AB255PKD.js"><link rel="modulepreload" href="chunk-PKKBBIJK.js"><script src="polyfills-KH22MU6U.js" type="module"></script><script src="scripts-7HSGK5LZ.js" defer></script><script src="main-UABQXYAC.js" type="module"></script></body>
66
66
  </html>