| ${e.map((t=>W` | ${i[t]} | `))}
|---|---|
| ${ma({hass:this.hass,string:t.labelKey})} | ${e.map((e=>c(t.mode,t.away,e)))}
0&&t.stroke()}}function Fc(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x m&&(m=i),f=(g*f+e)/++g):(v(),t.lineTo(e,i),u=o,g=0,p=m=i),_=i}v()}function wp(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?yp:vp}const xp="function"==typeof Path2D;function kp(t,e,i,o){xp&&!e.options.segment?function(t,e,i,o){let a=e._path;a||(a=e._path=new Path2D,e.path(a,i,o)&&a.closePath()),fp(t,e.options),t.stroke(a)}(t,e,i,o):function(t,e,i,o){const{segments:a,options:n}=e,s=wp(e);for(const r of a)fp(t,n,r.style),t.beginPath(),s(t,e,r,{start:i,end:i+o-1})&&t.closePath(),t.stroke()}(t,e,i,o)}class Sp extends ku{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const o=i.spanGaps?this._loop:this._fullLoop;Md(this._points,i,t,o,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,o=t.options.spanGaps,a=i.length;if(!a)return[];const n=!!t._loop,{start:s,end:r}=function(t,e,i,o){let a=0,n=e-1;if(i&&!o)for(;at.ownerDocument.defaultView.getComputedStyle(t,null);const Ed=["top","right","bottom","left"];function Ld(t,e,i){const o={};i=i?"-"+i:"";for(let a=0;a<4;a++){const n=Ed[a];o[n]=parseFloat(t[e+"-"+n+i])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}const $d=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function zd(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:o}=e,a=Pd(i),n="border-box"===a.boxSizing,s=Ld(a,"padding"),r=Ld(a,"border","width"),{x:l,y:c,box:d}=function(t,e){const i=t.touches,o=i&&i.length?i[0]:t,{offsetX:a,offsetY:n}=o;let s,r,l=!1;if($d(a,n,t.target))s=a,r=n;else{const t=e.getBoundingClientRect();s=o.clientX-t.left,r=o.clientY-t.top,l=!0}return{x:s,y:r,box:l}}(t,i),h=s.left+(d&&r.left),u=s.top+(d&&r.top);let{width:p,height:m}=e;return n&&(p-=s.width+r.width,m-=s.height+r.height),{x:Math.round((l-h)/p*i.width/o),y:Math.round((c-u)/m*i.height/o)}}const Od=t=>Math.round(10*t)/10;function Vd(t,e,i,o){const a=Pd(t),n=Ld(a,"margin"),s=Ad(a.maxWidth,t,"clientWidth")||Vl,r=Ad(a.maxHeight,t,"clientHeight")||Vl,l=function(t,e,i){let o,a;if(void 0===e||void 0===i){const n=t&&Cd(t);if(n){const t=n.getBoundingClientRect(),s=Pd(n),r=Ld(s,"border","width"),l=Ld(s,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,o=Ad(s.maxWidth,n,"clientWidth"),a=Ad(s.maxHeight,n,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:o||Vl,maxHeight:a||Vl}}(t,e,i);let{width:c,height:d}=l;if("content-box"===a.boxSizing){const t=Ld(a,"border","width"),e=Ld(a,"padding");c-=e.width+t.width,d-=e.height+t.height}c=Math.max(0,c-n.width),d=Math.max(0,o?c/o:d-n.height),c=Od(Math.min(c,s,l.maxWidth)),d=Od(Math.min(d,r,l.maxHeight)),c&&!d&&(d=Od(c/2));return(void 0!==e||void 0!==i)&&o&&l.height&&d>l.height&&(d=l.height,c=Od(Math.floor(d*o))),{width:c,height:d}}function Hd(t,e,i){const o=e||1,a=Od(t.height*o),n=Od(t.width*o);t.height=Od(t.height),t.width=Od(t.width);const s=t.canvas;return s.style&&(i||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==o||s.height!==a||s.width!==n)&&(t.currentDevicePixelRatio=o,s.height=a,s.width=n,t.ctx.setTransform(o,0,0,o,0,0),!0)}const Id=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Dd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Rd(t,e){const i=function(t,e){return Pd(t).getPropertyValue(e)}(t,e),o=i&&i.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function Fd(t,e,i,o){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Nd(t,e,i,o){return{x:t.x+i*(e.x-t.x),y:"middle"===o?i<.5?t.y:e.y:"after"===o?i<1?t.y:e.y:i>0?e.y:t.y}}function jd(t,e,i,o){const a={x:t.cp2x,y:t.cp2y},n={x:e.cp1x,y:e.cp1y},s=Fd(t,a,i),r=Fd(a,n,i),l=Fd(n,e,i),c=Fd(s,r,i),d=Fd(r,l,i);return Fd(c,d,i)}function Wd(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Bd(t,e){let i,o;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,o=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=o)}function Ud(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Yd(t){return"angle"===t?{between:tc,compare:Ql,normalize:Jl}:{between:ic,compare:(t,e)=>t-e,normalize:t=>t}}function qd({start:t,end:e,count:i,loop:o,style:a}){return{start:t%i,end:e%i,loop:o&&(e-t+1)%i==0,style:a}}function Zd(t,e,i){if(!i)return[t];const{property:o,start:a,end:n}=i,s=e.length,{compare:r,between:l,normalize:c}=Yd(o),{start:d,end:h,loop:u,style:p}=function(t,e,i){const{property:o,start:a,end:n}=i,{between:s,normalize:r}=Yd(o),l=e.length;let c,d,{start:h,end:u,loop:p}=t;if(p){for(h+=l,u+=l,c=0,d=l;c{o[t]=Math.max(e[t],i[t])})),o}return o(t?["left","right"]:["top","bottom"])}function eu(t,e,i,o){const a=[];let n,s,r,l,c,d;for(n=0,s=t.length,c=0;nt.box.fullSize)),!0),o=Xh(qh(e,"left"),!0),a=Xh(qh(e,"right")),n=Xh(qh(e,"top"),!0),s=Xh(qh(e,"bottom")),r=Zh(e,"x"),l=Zh(e,"y");return{fullSize:i,leftAndTop:o.concat(n),rightAndBottom:a.concat(l).concat(s).concat(r),chartArea:qh(e,"chartArea"),vertical:o.concat(a).concat(l),horizontal:n.concat(s).concat(r)}}(t.boxes),l=r.vertical,c=r.horizontal;vl(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const d=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,h=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:n,availableHeight:s,vBoxMaxWidth:n/2/d,hBoxMaxHeight:s/2}),u=Object.assign({},a);Qh(u,id(o));const p=Object.assign({maxPadding:u,w:n,h:s,x:a.left,y:a.top},a),m=Kh(l.concat(c),h);eu(r.fullSize,p,h,m),eu(l,p,h,m),eu(c,p,h,m)&&eu(l,p,h,m),function(t){const e=t.maxPadding;function i(i){const o=Math.max(e[i]-t[i],0);return t[i]+=o,o}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),ou(r.leftAndTop,p,h,m),p.x+=p.w,p.y+=p.h,ou(r.rightAndBottom,p,h,m),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},vl(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class nu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,o){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,o?Math.floor(e/o):i)}}isAttached(t){return!0}updateConfig(t){}}class su extends nu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ru="$chartjs",lu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},cu=t=>null===t||""===t;const du=!!Id&&{passive:!0};function hu(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,du)}function uu(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function pu(t,e,i){const o=t.canvas,a=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||uu(i.addedNodes,o),e=e&&!uu(i.removedNodes,o);e&&i()}));return a.observe(document,{childList:!0,subtree:!0}),a}function mu(t,e,i){const o=t.canvas,a=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||uu(i.removedNodes,o),e=e&&!uu(i.addedNodes,o);e&&i()}));return a.observe(document,{childList:!0,subtree:!0}),a}const _u=new Map;let fu=0;function gu(){const t=window.devicePixelRatio;t!==fu&&(fu=t,_u.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function bu(t,e,i){const o=t.canvas,a=o&&Cd(o);if(!a)return;const n=dc(((t,e)=>{const o=a.clientWidth;i(t,e),o0}_computeGridLineItems(t){const e=this.axis,i=this.chart,o=this.options,{grid:a,position:n,border:s}=o,r=a.offset,l=this.isHorizontal(),c=this.ticks.length+(r?1:0),d=Pu(a),h=[],u=s.setContext(this.getContext()),p=u.display?u.width:0,m=p/2,_=function(t){return Vc(i,t,p)};let f,g,b,v,y,w,x,k,S,T,M,D;if("top"===n)f=_(this.bottom),w=this.bottom-d,k=f-m,T=_(t.top)+m,D=t.bottom;else if("bottom"===n)f=_(this.top),T=t.top,D=_(t.bottom)-m,w=f+m,k=this.top+d;else if("left"===n)f=_(this.right),y=this.right-d,x=f-m,S=_(t.left)+m,M=t.right;else if("right"===n)f=_(this.left),S=t.left,M=_(t.right)-m,y=f+m,x=this.left+d;else if("x"===e){if("center"===n)f=_((t.top+t.bottom)/2+.5);else if(pl(n)){const t=Object.keys(n)[0],e=n[t];f=_(this.chart.scales[t].getPixelForValue(e))}T=t.top,D=t.bottom,w=f+m,k=w+d}else if("y"===e){if("center"===n)f=_((t.left+t.right)/2);else if(pl(n)){const t=Object.keys(n)[0],e=n[t];f=_(this.chart.scales[t].getPixelForValue(e))}y=f-m,x=y-d,S=t.left,M=t.right}const C=fl(o.ticks.maxTicksLimit,c),A=Math.max(1,Math.ceil(c/C));for(g=0;gt.replace("rgb(","rgba(").replace(")",", 0.5)")));function Hp(t){return Op[t%Op.length]}function Ip(t){return Vp[t%Vp.length]}function Rp(t){let e=0;return(i,o)=>{const a=t.getDatasetMeta(o).controller;a instanceof Ah?e=function(t,e){return t.backgroundColor=t.data.map((()=>Hp(e++))),e}(i,e):a instanceof Eh?e=function(t,e){return t.backgroundColor=t.data.map((()=>Ip(e++))),e}(i,e):a&&(e=function(t,e){return t.borderColor=Hp(e),t.backgroundColor=Ip(e),++e}(i,e))}}function Fp(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Np={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:o},options:a}=t.config,{elements:n}=a,s=Fp(o)||(r=a)&&(r.borderColor||r.backgroundColor)||n&&Fp(n)||"rgba(0,0,0,0.1)"!==$c.borderColor||"rgba(0,0,0,0.1)"!==$c.backgroundColor;var r;if(!i.forceOverride&&s)return;const l=Rp(t);o.forEach(l)}};function jp(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Wp(t){t.data.datasets.forEach((t=>{jp(t)}))}var Bp={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Wp(t);const o=t.width;t.data.datasets.forEach(((e,a)=>{const{_data:n,indexAxis:s}=e,r=t.getDatasetMeta(a),l=n||e.data;if("y"===ad([s,t.options.indexAxis]))return;if(!r.controller.supportsDecimation)return;const c=t.scales[r.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:d,count:h}=function(t,e){const i=e.length;let o,a=0;const{iScale:n}=t,{min:s,max:r,minDefined:l,maxDefined:c}=n.getUserBounds();return l&&(a=ec(ac(e,n.axis,s).lo,0,i-1)),o=c?ec(ac(e,n.axis,r).hi+1,a,i)-a:i-a,{start:a,count:o}}(r,l);if(h<=(i.threshold||4*o))return void jp(e);let u;switch(hl(n)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,o,a){const n=a.samples||o;if(n>=i)return t.slice(e,e+i);const s=[],r=(i-2)/(n-2);let l=0;const c=e+i-1;let d,h,u,p,m,_=e;for(s[l++]=t[_],d=0;d=e&&l<=i&&o.push(l);if(o.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(n=0,s=o.length;nt-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(c_(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return c_(this._table,i*this._tableRange+this._minPos,!0)}}var h_=Object.freeze({__proto__:null,CategoryScale:Om,LinearScale:Rm,LogarithmicScale:Um,RadialLinearScale:t_,TimeScale:l_,TimeSeriesScale:d_});const u_=[Oh,zp,Lm,h_];var p_=Object.freeze({__proto__:null,Animation:nh,Animations:sh,ArcElement:_p,BarController:Dh,BarElement:$p,BasePlatform:nu,BasicPlatform:su,BubbleController:Ch,CategoryScale:Om,Chart:cp,Colors:Np,DatasetController:bh,Decimation:Bp,DomPlatform:wu,DoughnutController:Ah,Element:ku,Filler:lm,Interaction:Uh,Legend:um,LineController:Ph,LineElement:Sp,LinearScale:Rm,LogarithmicScale:Um,PieController:Lh,PointElement:Mp,PolarAreaController:Eh,RadarController:$h,RadialLinearScale:t_,Scale:$u,ScatterController:zh,SubTitle:fm,Ticks:Dc,TimeScale:l_,TimeSeriesScale:d_,Title:mm,Tooltip:Em,_adapters:Ih,_detectPlatform:xu,animator:ih,controllers:Oh,defaults:$c,elements:zp,layouts:au,plugins:Lm,registerables:u_,registry:Vu,scales:h_});function m_(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var __,f_={exports:{}};var g_,b_=(__||(__=1,g_=f_,function(t,e,i,o){var a,n=["","webkit","Moz","MS","ms","o"],s=e.createElement("div"),r="function",l=Math.round,c=Math.abs,d=Date.now;function h(t,e,i){return setTimeout(b(t,i),e)}function u(t,e,i){return!!Array.isArray(t)&&(p(t,i[e],i),!0)}function p(t,e,i){var a;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==o)for(a=0;a