@syncfusion/ej2-lineargauge
Version:
Essential JS 2 LinearGauge Components
10 lines • 60.9 kB
JavaScript
/*!
* filename: ej2-lineargauge.umd.min.js
* version : 17.3.14
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base"],t):t(e.ej={},e.ej2Base,e.ej2SvgBase)}(this,function(e,t,i){"use strict";function o(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function n(e,i){var o=document.getElementById("gauge-measuretext");return null===o&&(o=t.createElement("text",{id:"gauge-measuretext"}),document.body.appendChild(o)),o.innerHTML=e,o.style.position="absolute",o.style.fontSize=i.size,o.style.fontWeight=i.fontWeight,o.style.fontStyle=i.fontStyle,o.style.fontFamily=i.fontFamily,o.style.visibility="hidden",o.style.top="-100",o.style.left="0",o.style.whiteSpace="nowrap",new Q(o.clientWidth,o.clientHeight)}function r(e,t,i,o,n,r){return"pointer"===r?e<=o&&e>=n:null!=t&&t<=o&&t>=n&&null!=i&&i<=o&&i>=n}function a(e,t,i,o,n,r){var a=e.getBoundingClientRect(),s=t.getBoundingClientRect(),l=t.id.indexOf("MarkerPointer")>-1?s.height/2:o.isInversed?s.height:0,h=t.id.indexOf("MarkerPointer")>-1?s.width/2:o.isInversed?0:s.width,u=new Q(o.lineBounds.width,o.lineBounds.height),p="drag"===n?r.y-o.lineBounds.y:s.top+l-a.top-o.lineBounds.y,d="drag"===n?r.x-o.lineBounds.x:s.left+h-a.left-o.lineBounds.x,g="Vertical"===i?u.height:u.width,c="Vertical"===i?p:d,m="Vertical"===i?o.isInversed?c/g:1-c/g:o.isInversed?1-c/g:c/g;return m=m*o.visibleRange.delta+o.visibleRange.min}function s(e,o,n){var r=document.getElementById("gauge_path");null===r&&((r=t.createElement("text",{id:"gauge_path"})).style.position="absolute",r.style.top="0px",r.style.left="0px",n.appendChild(r));var a=new i.SvgRenderer("id").createSvg({id:"box_path",width:o.width,height:o.height});a.appendChild(e),r.appendChild(a);var s=e.getBBox();return t.remove(r),s}function l(e){return document.getElementById(e)}function h(e){var i=l(e);i&&t.remove(i)}function u(e){var t=!1;return e.map(function(e,i){e.pointers.map(function(e,i){e.enableDrag&&(t=!0)})}),t}function p(e,t,i,o){var n=(e-o.min)/o.delta;return n="Vertical"===i?t.isInversed?n:1-n:t.isInversed?1-n:n}function d(e){return"font-size:"+e.size+"; font-style:"+e.fontStyle+"; font-weight:"+e.fontWeight+"; font-family:"+e.fontFamily+";opacity:"+e.opacity+"; color:"+e.color+";"}function g(e,i,o){if(t.isNullOrUndefined(e))return null;for(var n=0,r=Object.keys(i);n<r.length;n++){var a=r[n];e=e.split("{"+a+"}").join(c(i[a],o).toString())}return e}function c(e,t){var i;return null!==(i=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)?i:""}function m(e){return e&&null!==e.match("{value}")?"":e}function y(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(o){i=t.compile(e)}return i}function f(e,t){var i,o;return t.appendChild(e),i=e.offsetWidth,o=e.offsetHeight,t.removeChild(e),new Q(i,o)}function v(e,t,o,n){var r,a={},s=new i.SvgRenderer(""),l="fill:"+o+"; font-size:"+t.size+"; font-style:"+t.fontStyle+" ; font-weight:"+t.fontWeight+"; font-family:"+t.fontFamily+"; text-anchor:"+e.anchor+"; transform:"+e.transform+"; opacity:"+t.opacity+"; dominant-baseline:"+e.baseLine+";";return a={id:e.id,x:e.x,y:e.y,style:l},r=s.createText(a,e.text),n.appendChild(r),r}function b(e,t,i,o){for(var n,r=t-e,a=x(i,o),s=r/a,l=Math.pow(10,Math.floor(Math.log(s)/Math.log(10))),h=0,u=[10,5,2,1];h<u.length;h++){if(n=l*u[h],a<r/n)break;s=n}return s}function x(e,t){var i=5*("Horizontal"===t?.533:1);return i=Math.max(e*(i/100),1)}function w(e,t){var i,o,n,r,a=[];return a=e.id.replace(t.element.id,"").split("_"),i=parseInt(a[2],10),o=parseInt(a[4],10),n=t.axes[i],r=t.axes[i].pointers[o],{axis:n,axisIndex:i,pointer:r,pointerIndex:o}}function P(e,t){var i=null;return t.forEach(function(t,o){e>=t.start&&t.end>=e&&(i=t.interior)}),i}function C(){return["#ff5985","#ffb133","#fcde0b","#27d5ff","#50c917"]}function S(e,i,o,n,r,a,s,l){var h,u,p=o.width,d=o.height,g=e.x,c=e.y;switch(i){case"Circle":u=(p+d)/4,g="Vertical"===a?s.opposedPosition?"Near"===l.placement?g-u:g+u:"Far"!==l.placement?g-u:g+u:g,c="Vertical"===a?c:s.opposedPosition?"Near"===l.placement?c-u:c+u:"Far"===l.placement?c+u:c-u,t.merge(r,{r:u,cx:g,cy:c});break;case"Diamond":case"Rectangle":g="Horizontal"===a?g-p/2:!s.opposedPosition&&"Far"!==l.placement||s.opposedPosition&&"Near"===l.placement?g-p:g,c="Vertical"===a?c:s.opposedPosition?"Near"===l.placement?c-d/2:c+d/2:"Far"===l.placement?c+d/2:c-d/2,h="Diamond"===i?"M "+g+" "+c+" L "+(g+p/2)+" "+(c-d/2)+" L "+(g+p)+" "+c+" L "+(g+p/2)+" "+(c+d/2)+" L "+g+" "+c+" z":"M "+g+" "+(c-d/2)+" L "+(g+p)+" "+(c-d/2)+" L "+(g+p)+" "+(c+d/2)+" L "+g+" "+(c+d/2)+" L "+g+" "+(c-d/2)+" z",t.merge(r,{d:h});break;case"Triangle":h="Vertical"===a?"M "+g+" "+c+" L"+(g-p)+" "+(c-d/2)+"L"+(g-p)+" "+(c+d/2)+" Z":"M "+g+" "+c+" L"+(g+p/2)+" "+(c-d)+"L"+(g-p/2)+" "+(c-d)+" Z",t.merge(r,{d:h});break;case"InvertedTriangle":h="Vertical"===a?"M "+g+" "+c+" L"+(g+p)+" "+(c-d/2)+"L"+(g+p)+" "+(c+d/2)+" Z":"M "+g+" "+c+" L"+(g+p/2)+" "+(c+d)+"L"+(g-p/2)+" "+(c+d)+" Z",t.merge(r,{d:h});break;case"Arrow":h="Vertical"===a?"M "+g+" "+c+" L"+(g-p/2)+" "+(c-d/2)+" L"+(g-p/2)+" "+(c-d/2+d/4)+" L"+(g-p)+" "+(c-d/2+d/4)+" L"+(g-p)+" "+(c+d/2-d/4)+" L"+(g-p/2)+" "+(c+d/2-d/4)+" L"+(g-p/2)+" "+(c+d/2)+"z":"M "+g+" "+c+" L"+(g+p/2)+" "+(c-d/2)+" L"+(g+p/2-p/4)+" "+(c-d/2)+" L"+(g+p/2-p/4)+" "+(c-d)+" L"+(g-p/2+p/4)+" "+(c-d)+" L"+(g-p/2+p/4)+" "+(c-d/2)+" L"+(g-p/2)+" "+(c-d/2)+"z",t.merge(r,{d:h});break;case"InvertedArrow":h="Vertical"===a?"M "+g+" "+c+"L"+(g+p/2)+" "+(c-d/2)+" L"+(g+p/2)+" "+(c-d/2+d/4)+" L"+(g+p)+" "+(c-d/2+d/4)+" L"+(g+p)+" "+(c+d/2-d/4)+" L"+(g+p/2)+" "+(c+d/2-d/4)+" L"+(g+p/2)+" "+(c+d/2)+"z":"M "+g+" "+c+" L"+(g+p/2)+" "+(c+d/2)+" L"+(g+p/2-p/4)+" "+(c+d/2)+" L"+(g+p/2-p/4)+" "+(c+d)+" L"+(g-p/2+p/4)+" "+(c+d)+" L"+(g-p/2+p/4)+" "+(c+d/2)+" L"+(g-p/2)+" "+(c+d/2)+"z",t.merge(r,{d:h});break;case"Image":t.merge(r,{href:n,height:d,width:p,x:g-p/2,y:c-d/2})}return r}function B(e,t,i,o,n,r,a,s){var l,h,u,p,d,g,c=" ",m=s;switch(t){case"RoundedRectangle":c="M "+(l=e.x)+" "+(m+(h=e.y))+" Q "+l+" "+h+" "+(l+m)+" "+h+" ",c+="L "+(l+(u=e.width)-m)+" "+h+" Q "+(l+u)+" "+h+" "+(l+u)+" "+(h+m)+" ",c+="L "+(l+u)+" "+(h+(p=e.height)-m)+" Q "+(l+u)+" "+(h+p)+" "+(l+u-m)+" "+(h+p)+" ",c+=" L "+(l+m)+" "+(h+p)+" Q "+l+" "+(h+p)+" "+l+" "+(h+p-m)+" ",c+="L "+l+" "+(m+h)+" z";break;case"Thermometer":var y="Vertical"===i?e.width:e.height;if(d=y+y/2/Math.PI,g=y/2,"Vertical"===i){var f=r+r/2/Math.PI-d,v="bar"===n?e.y+f:e.y,b="bar"===n?e.y+(g-g/Math.PI):e.y,x=e.height;c="M"+e.x+" "+(v+x)+" A "+d+" "+d+", 0, 1, 0, "+(e.x+e.width)+" "+(v+x)+" L "+(e.x+e.width)+" "+b+" A "+g+" "+g+", 0, 1, 0, "+e.x+" "+b+" z "}else{var w="bar"!==n||a.isInversed?e.x:e.x-(r+r/2/Math.PI-d),P="bar"===n?e.width-(g-g/Math.PI):e.width;c="M"+w+" "+e.y+" A "+d+" "+d+", 0, 1, 0, "+w+" "+(e.y+e.height)+" L "+(("bar"===n?e.x:w)+P)+" "+(e.y+e.height)+" A "+g+" "+g+", 0, 1, 0, "+(("bar"===n?e.x:w)+P)+" "+e.y+" z "}}return c}var A=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),T=function(e,t,i,o){var n,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),T([t.Property("16px")],i.prototype,"size",void 0),T([t.Property("")],i.prototype,"color",void 0),T([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),T([t.Property("Regular")],i.prototype,"fontWeight",void 0),T([t.Property("Normal")],i.prototype,"fontStyle",void 0),T([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),L=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),T([t.Property(10)],i.prototype,"left",void 0),T([t.Property(10)],i.prototype,"right",void 0),T([t.Property(10)],i.prototype,"top",void 0),T([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),T([t.Property(null)],i.prototype,"color",void 0),T([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),F=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),T([t.Property("")],i.prototype,"content",void 0),T([t.Property(0)],i.prototype,"x",void 0),T([t.Property(0)],i.prototype,"y",void 0),T([t.Property("None")],i.prototype,"verticalAlignment",void 0),T([t.Property("None")],i.prototype,"horizontalAlignment",void 0),T([t.Property("-1")],i.prototype,"zIndex",void 0),T([t.Complex({size:"12px",color:null},E)],i.prototype,"font",void 0),T([t.Property(null)],i.prototype,"axisIndex",void 0),T([t.Property(null)],i.prototype,"axisValue",void 0),i}(t.ChildProperty),R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),T([t.Property("Normal")],i.prototype,"type",void 0),T([t.Property(0)],i.prototype,"height",void 0),T([t.Property(0)],i.prototype,"width",void 0),T([t.Property(10)],i.prototype,"roundedCornerRadius",void 0),T([t.Property("transparent")],i.prototype,"backgroundColor",void 0),T([t.Complex({width:1,color:"#bfbfbf"},_)],i.prototype,"border",void 0),T([t.Property(0)],i.prototype,"offset",void 0),i}(t.ChildProperty),k=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),T([t.Property(!1)],i.prototype,"enable",void 0),T([t.Property("")],i.prototype,"fill",void 0),T([t.Complex({color:"",size:"13px"},E)],i.prototype,"textStyle",void 0),T([t.Property(null)],i.prototype,"format",void 0),T([t.Property(null)],i.prototype,"template",void 0),T([t.Property(!0)],i.prototype,"enableAnimation",void 0),T([t.Complex({},_)],i.prototype,"border",void 0),i}(t.ChildProperty),O=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),M=function(e,t,i,o){var n,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return O(i,e),M([t.Property("")],i.prototype,"dashArray",void 0),M([t.Property(null)],i.prototype,"height",void 0),M([t.Property(2)],i.prototype,"width",void 0),M([t.Property(null)],i.prototype,"color",void 0),M([t.Property(0)],i.prototype,"offset",void 0),i}(t.ChildProperty),I=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return O(i,e),M([t.Complex({size:"12px",color:null},E)],i.prototype,"font",void 0),M([t.Property(!1)],i.prototype,"useRangeColor",void 0),M([t.Property("")],i.prototype,"format",void 0),M([t.Property(0)],i.prototype,"offset",void 0),i}(t.ChildProperty),V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return O(i,e),M([t.Property(0)],i.prototype,"start",void 0),M([t.Property(0)],i.prototype,"end",void 0),M([t.Property("Outside")],i.prototype,"position",void 0),M([t.Property("")],i.prototype,"color",void 0),M([t.Property(10)],i.prototype,"startWidth",void 0),M([t.Property(10)],i.prototype,"endWidth",void 0),M([t.Property(0)],i.prototype,"offset",void 0),M([t.Complex({color:"#000000",width:0},_)],i.prototype,"border",void 0),i}(t.ChildProperty),j=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return O(i,e),M([t.Property(20)],i.prototype,"height",void 0),M([t.Property(2)],i.prototype,"width",void 0),M([t.Property(null)],i.prototype,"interval",void 0),M([t.Property(null)],i.prototype,"color",void 0),M([t.Property(null)],i.prototype,"offset",void 0),i}(t.ChildProperty),N=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.animationComplete=!0,t.currentValue=null,t}return O(i,e),M([t.Property("Marker")],i.prototype,"type",void 0),M([t.Property(null)],i.prototype,"value",void 0),M([t.Property("InvertedTriangle")],i.prototype,"markerType",void 0),M([t.Property(null)],i.prototype,"imageUrl",void 0),M([t.Complex({color:"#808080"},_)],i.prototype,"border",void 0),M([t.Property(10)],i.prototype,"roundedCornerRadius",void 0),M([t.Property("Far")],i.prototype,"placement",void 0),M([t.Property(20)],i.prototype,"height",void 0),M([t.Property(20)],i.prototype,"width",void 0),M([t.Property(null)],i.prototype,"color",void 0),M([t.Property(1)],i.prototype,"opacity",void 0),M([t.Property(0)],i.prototype,"animationDuration",void 0),M([t.Property(!1)],i.prototype,"enableDrag",void 0),M([t.Property(0)],i.prototype,"offset",void 0),M([t.Property(null)],i.prototype,"description",void 0),i}(t.ChildProperty),D=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.visibleLabels=[],t}return O(i,e),M([t.Property(0)],i.prototype,"minimum",void 0),M([t.Property(100)],i.prototype,"maximum",void 0),M([t.Property(!1)],i.prototype,"isInversed",void 0),M([t.Property(!1)],i.prototype,"opposedPosition",void 0),M([t.Complex({},z)],i.prototype,"line",void 0),M([t.Collection([{}],V)],i.prototype,"ranges",void 0),M([t.Collection([{}],N)],i.prototype,"pointers",void 0),M([t.Complex({width:2,height:20},j)],i.prototype,"majorTicks",void 0),M([t.Complex({width:1,height:10},j)],i.prototype,"minorTicks",void 0),M([t.Complex({},I)],i.prototype,"labelStyle",void 0),i}(t.ChildProperty),U="animationComplete",G="tooltipRender",H="annotationRender",X="gaugeMouseMove",Y="gaugeMouseDown",W=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),q=function(){return function(e,t,i,o){this.min=e,this.max=t,this.interval=i,this.delta=o}}(),Z=function(){return function(e,t){this.x=e,this.y=t}}(),Q=function(){return function(e,t){this.width=e,this.height=t}}(),J=function(){return function(e,t,i,o){this.x=e,this.y=t,this.width=i,this.height=o}}(),K=function(){return function(e){this.id=e}}(),$=function(e){function t(t,i,o,n,r,a,s,l){void 0===l&&(l="");var h=e.call(this,t)||this;return h.opacity=r,h.fill=i,h.stroke=n,h["stroke-width"]=o,h["stroke-dasharray"]=a,h.d=s,h.transform=l,h}return W(t,e),t}(K),ee=function(){return function(e,t,i,o,n,r,a){this.opacity=o,this.id=e,this.y=n.y,this.x=n.x,this.fill=t,this.stroke=i.color,this["stroke-width"]=i.width,this.height=n.height,this.width=n.width}}(),te=function(e){function t(t,i,o,n,r,a,s){void 0===a&&(a="");var l=e.call(this,t)||this;return l.transform="",l.baseLine="auto",l.x=i,l.y=o,l.anchor=n,l.text=r,l.transform=a,l.baseLine=s,l}return W(t,e),t}(K),ie=function(){return function(e,t,i){this.text=e,this.value=t,this.size=i}}(),oe=function(){return function(e,t){this.align=t,this.axisIndex=e}}(),ne=function(){function e(e){this.gauge=e}return e.prototype.calculateAxesBounds=function(){var e,t;this.gauge.nearSizes=[],this.gauge.farSizes=[];var i,o,n,r;this.gauge.containerBounds;this.checkThermometer();for(var a=0;a<this.gauge.axes.length;a++)(e=this.gauge.axes[a]).checkAlign=new oe(a,e.opposedPosition?"Far":"Near"),e.opposedPosition?this.gauge.farSizes.push(1):this.gauge.nearSizes.push(1),this.calculateLineBounds(e,a),this.calculateTickBounds(e,a),this.calculateLabelBounds(e,a),e.pointers.length>0&&this.calculatePointerBounds(e,a),e.ranges.length>0&&this.calculateRangesBounds(e,a),t=e.labelBounds,"Vertical"===this.gauge.orientation?(i=e.opposedPosition?e.lineBounds.x:t.x-8,o=e.lineBounds.y,r=e.lineBounds.height,n=Math.abs(e.opposedPosition?t.x+t.width+8-i:e.lineBounds.x-i)):(o=e.opposedPosition?e.lineBounds.y:t.y-t.height-8,i=e.lineBounds.x,n=e.lineBounds.width,r=Math.abs(e.opposedPosition?t.y+8-o:Math.abs(e.lineBounds.y-o))),e.bounds=new J(i,o,n,r)},e.prototype.calculateLineBounds=function(e,i){var o,n,r,a,s,l,h=e.line.height,u=this.gauge.orientation,p=this.gauge.containerBounds;h=e.line.width>0?h:null,"Vertical"===u?(n=t.isNullOrUndefined(h)?p.y:p.y+(p.height/2-h/2),r=e.line.width,a=t.isNullOrUndefined(h)?p.height:h):(o=t.isNullOrUndefined(h)?p.x:p.x+(p.width/2-h/2),a=e.line.width,r=t.isNullOrUndefined(h)?p.width:h),s=this.checkPreviousAxes(e,i),t.isNullOrUndefined(s)?"Vertical"===u?o=(e.opposedPosition?p.x+p.width:p.x)+e.line.offset:n=(e.opposedPosition?p.y+p.height:p.y)+e.line.offset:(l=this.gauge.axes[s],"Vertical"===u?o=(e.opposedPosition?l.bounds.x+l.bounds.width:l.bounds.x)+e.line.offset:n=(e.opposedPosition?l.bounds.y+l.bounds.height:l.bounds.y)+e.line.offset),e.lineBounds=new J(o,n,r,a)},e.prototype.calculateTickBounds=function(e,i){var o,n,r,a,s=Math.min(e.minimum,e.maximum),l=Math.max(e.minimum,e.maximum);s=s===l?l-1:s;e.majorTicks.interval;var h=e.lineBounds;r=e.majorTicks,a=e.minorTicks,e.majorInterval=r.interval,e.minorInterval=a.interval;var u="Vertical"===this.gauge.orientation?h.height:h.width,p=("Vertical"===this.gauge.orientation?h.width:h.height)/2;e.majorInterval=t.isNullOrUndefined(e.majorInterval)?b(s,l,u,this.gauge.orientation):r.interval,e.visibleRange=new q(s,l,e.majorInterval,l-s),e.minorInterval=t.isNullOrUndefined(e.minorInterval)?e.majorInterval/2:e.minorInterval,"Vertical"===this.gauge.orientation?(o=(e.opposedPosition?h.x+p:h.x-p-r.height)+r.offset,e.majorTickBounds=new J(o,h.y,r.height,h.height),o=(e.opposedPosition?h.x+p:h.x-p-a.height)+a.offset,e.minorTickBounds=new J(o,h.y,a.height,h.height)):(n=(e.opposedPosition?h.y+p:h.y-p-r.height)+r.offset,e.majorTickBounds=new J(h.x,n,h.width,r.height),n=(e.opposedPosition?h.y+p:h.y-p-a.height)+a.offset,e.minorTickBounds=new J(h.x,n,h.width,a.height))},e.prototype.calculateLabelBounds=function(e,t){var i,o,n,r,a=e.majorTickBounds,s=e.labelStyle.offset;this.calculateVisibleLabels(e),n=e.maxLabelSize.width,r=e.maxLabelSize.height/2,"Vertical"===this.gauge.orientation?(i=(e.opposedPosition?a.x+a.width+5:a.x-n-5)+s,o=e.lineBounds.y):(o=(e.opposedPosition?a.y+a.height+5+r:a.y-5)+s,i=e.lineBounds.x),e.labelBounds=new J(i,o,n,r)},e.prototype.calculatePointerBounds=function(e,t){for(var i,o=e.visibleRange,n=(this.gauge.orientation,e.lineBounds,e.labelBounds,Math.min(o.min,o.max)),a=Math.max(o.min,o.max),s=0;s<e.pointers.length;s++)(i=e.pointers[s]).currentValue=null!==i.value?i.value<n?n:i.value>a?a:i.value:n,i.width>0&&r(i.currentValue,null,null,o.max,o.min,"pointer")&&this["calculate"+i.type+"Bounds"](t,e,s,i)},e.prototype.calculateMarkerBounds=function(e,t,i,o){var n,r,a=t.lineBounds,s=o.offset,l=t.visibleRange,h=o.placement,u=t.majorTickBounds,d=t.labelBounds,g=o.border.width;"Vertical"===this.gauge.orientation?(n=t.opposedPosition?"Far"===h?d.x+d.width:"Center"===h?u.x+u.width:a.x:"Near"===h?d.x:"Center"===h?u.x:a.x,n=t.opposedPosition?("Near"===o.placement?n-g:n+g)+s:("Far"===o.placement?n+g:n-g)+s,r=p(o.currentValue,t,this.gauge.orientation,l)*a.height+a.y):(r=t.opposedPosition?"Far"===h?d.y:"Center"===h?u.y+u.height:a.y:"Near"===h?d.y-d.height:"Center"===h?u.y:a.y,r=t.opposedPosition?("Near"===o.placement?r-g:r+g)+s:("Far"===o.placement?r+g:r-g)+s,n=p(o.currentValue,t,this.gauge.orientation,l)*a.width+a.x),o.bounds=new J(n,r,o.width,o.height)},e.prototype.calculateBarBounds=function(e,t,i,o){var n,r,a,s,l,h,u=t.lineBounds,d=t.visibleRange,g=this.gauge.orientation,c=o.offset,m=this.gauge.containerBounds;"Vertical"===g?(n=m.width>0?m.x+(m.width/2-o.width/2):t.opposedPosition?u.x-o.width-10:u.x+10,n+=c,a=p(o.currentValue,t,g,d)*u.height+u.y,s=p(d.min,t,g,d)*u.height+u.y,l=Math.abs(s-a),a=t.isInversed?s:a,h=o.width):(n=p(d.min,t,g,d)*u.width+u.x,a=m.height>0?m.y+m.height/2-o.height/2:t.opposedPosition?u.y-o.height-10:u.y+10,a+=c,l=o.height,r=p(o.currentValue,t,g,d)*u.width+u.x,h=Math.abs(r-n),n=t.isInversed?r:n),o.bounds=new J(n,a,h,l)},e.prototype.calculateRangesBounds=function(e,t){for(var i,o,n,a,s,l,h,u,d,g,c,m,y,f=e.lineBounds,v=e.visibleRange,b=this.gauge.orientation,x=0;x<e.ranges.length;x++)r(null,(i=e.ranges[x]).start,i.end,v.max,v.min,"range")&&(o=Math.min(i.start,i.end),n=Math.max(i.start,i.end),g=i.position,c=i.startWidth,m=i.endWidth,y=this.gauge.rangePalettes.length?this.gauge.rangePalettes:["#ff5985","#ffb133","#fcde0b","#27d5ff","#50c917"],i.interior=i.color?i.color:y[x%y.length],"Vertical"===this.gauge.orientation?(l=f.x+i.offset,h=p(n,e,b,v)*f.height+f.y,d=p(o,e,b,v)*f.height+f.y,d-=h,a=e.opposedPosition?"Inside"===g?l-c:l+c:"Inside"===g?l+c:l-c,s=e.opposedPosition?"Inside"===g?l-m:l+m:"Inside"===g?l+m:l-m,i.path="M"+l+" "+h+" L "+l+" "+(h+d)+" L "+a+" "+(h+d)+" L "+s+" "+h+" L "+l+" "+h+" z "):(l=p(n,e,b,v)*f.width+f.x,h=e.lineBounds.y+i.offset,u=l-(u=p(o,e,b,v)*f.width+f.x),a=e.opposedPosition?"Inside"===g?h-c:h+c:"Inside"===g?h+c:h-c,s=e.opposedPosition?"Inside"===g?h-m:h+m:"Inside"===g?h+m:h-m,i.path="M"+l+" "+h+" L "+(l-u)+" "+h+" L "+(l-u)+" "+a+" L "+l+" "+s+" L "+l+" "+h+" z "))},e.prototype.checkPreviousAxes=function(e,t){var i=t-1;return i=i>=0?this.gauge.axes[i].checkAlign.align===e.checkAlign.align?i:this.checkPreviousAxes(e,i):null},e.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[];var t,i,o=e.visibleRange.min,r=e.visibleRange.max,a=e.visibleRange.interval,s=e.labelStyle,l=s.format&&null!==s.format.match("{value}");this.gauge.intl.getNumberFormat({format:m(s.format),useGrouping:this.gauge.useGroupingSeparator});for(var h=function(o){t={cancel:!1,name:"axisLabelRender",axis:e,text:l?g(s.format,{value:o},u.gauge):c(o,u.gauge).toString(),value:o},u.gauge.trigger("axisLabelRender",t,function(t){i=n(t.text,e.labelStyle.font),t.cancel||e.visibleLabels.push(new ie(t.text,o,i))})},u=this,p=o;p<=r&&a>0;p+=a)h(p);this.getMaxLabelWidth(this.gauge,e)},e.prototype.getMaxLabelWidth=function(e,t){t.maxLabelSize=new Q(0,0);for(var i,o=0;o<t.visibleLabels.length;o++)(i=t.visibleLabels[o]).size=n(i.text,t.labelStyle.font),i.size.width>t.maxLabelSize.width&&(t.maxLabelSize.width=i.size.width),i.size.height>t.maxLabelSize.height&&(t.maxLabelSize.height=i.size.height)},e.prototype.checkThermometer=function(){"Thermometer"===this.gauge.container.type&&this.gauge.axes.map(function(e,t){e.isInversed&&e.pointers.map(function(t,i){"Bar"===t.type&&(e.isInversed=!1)})})},e}(),re=function(){function e(e){this.gauge=e}return e.prototype.performMarkerAnimation=function(e,i,o){var n,r,a=this,s=e,l=i.visibleRange,h="Vertical"===this.gauge.orientation?i.lineBounds.height:i.lineBounds.width,u="Vertical"===this.gauge.orientation?i.lineBounds.y:i.lineBounds.x;"Vertical"===this.gauge.orientation?o.bounds.y=p(o.currentValue,i,this.gauge.orientation,l)*h+u:o.bounds.x=p(o.currentValue,i,this.gauge.orientation,l)*h+u,n=new $(s.id,null,null,null),n=S(o.bounds,o.markerType,new Q(o.width,o.height),o.imageUrl,n,this.gauge.orientation,i,o);var d,g=o.startValue,c=o.currentValue;g=g===c?l.min:g;var m=Math.abs(g-c),y=n.d;new t.Animation({}).animate(s,{duration:o.animationDuration,progress:function(e){e.timeStamp>=e.delay&&(r=(e.timeStamp-e.delay)/e.duration,d=g<c?g+r*m:g-r*m,"Vertical"===a.gauge.orientation?o.bounds.y=p(d,i,a.gauge.orientation,l)*h+u:o.bounds.x=p(d,i,a.gauge.orientation,l)*h+u,n=S(o.bounds,o.markerType,new Q(o.width,o.height),o.imageUrl,n,a.gauge.orientation,i,o),s.setAttribute("d",n.d))},end:function(e){s.setAttribute("d",y),o.startValue=o.currentValue,o.animationComplete=!0,a.gauge.trigger(U,{axis:a.gauge.isBlazor?null:i,pointer:o})}})},e.prototype.performBarAnimation=function(e,i,o){var n,r,a,s,l,h,u,d,g,c,m,y,f,v=this,b=i.visibleRange,x=e,w="Vertical"===this.gauge.orientation?i.lineBounds.height:i.lineBounds.width,P="Vertical"===this.gauge.orientation?i.lineBounds.y:i.lineBounds.x,C=(new Q(this.gauge.availableSize.width,this.gauge.availableSize.height),o.startValue),S=o.currentValue;C=C===S?b.min:C;var A="",T="",E=x.tagName;n=Math.abs(C-S);var L=p(S,i,this.gauge.orientation,b)*w+P,_=p(b.min,i,this.gauge.orientation,b)*w+P;c="Vertical"===this.gauge.orientation?i.isInversed?_:L:i.isInversed?L:_,g=Math.abs(_-L),"Thermometer"===this.gauge.container.type&&0===C&&(f=x.parentElement.childNodes[1].childNodes[0].childNodes[0],"Vertical"===this.gauge.orientation?(h=f.getAttribute("y"),l=f.getAttribute("height"),d=parseInt(h,10)+parseInt(l,10),f.setAttribute("y",d.toString())):(u=f.getAttribute("x"),m=f.getAttribute("width"),d=parseInt(u,10)+parseInt(m,10),f.setAttribute("width","0"))),A=B(o.bounds,this.gauge.container.type,this.gauge.orientation,new Q(o.bounds.width,o.bounds.height),"bar",this.gauge.container.width,i,o.roundedCornerRadius),new t.Animation({}).animate(x,{duration:o.animationDuration,progress:function(e){e.timeStamp>=e.delay&&(r=(e.timeStamp-e.delay)/e.duration,a=p(C<S?C+r*n:C-r*n,i,v.gauge.orientation,b)*w+P,s=p(b.min,i,v.gauge.orientation,b)*w+P,y=Math.abs(a-s),"Vertical"===v.gauge.orientation?(o.bounds.y=i.isInversed?s:a,o.bounds.height=y):(o.bounds.x=i.isInversed?a:s,o.bounds.width=y),"path"===E?(0===C&&"Thermometer"===v.gauge.container.type&&("Vertical"===v.gauge.orientation?f.setAttribute("y",(d-r*parseInt(l,10)).toString()):f.setAttribute("width",(r*parseInt(m,10)).toString())),T=B(o.bounds,v.gauge.container.type,v.gauge.orientation,new Q(o.bounds.width,o.bounds.height),"bar",v.gauge.container.width,i,o.roundedCornerRadius),x.setAttribute("d",T)):"Vertical"===v.gauge.orientation?(x.setAttribute("y",o.bounds.y.toString()),x.setAttribute("height",o.bounds.height.toString())):(x.setAttribute("x",o.bounds.x.toString()),x.setAttribute("width",o.bounds.width.toString())))},end:function(e){"path"===E?0===C&&"Thermometer"===v.gauge.container.type?x.parentElement.children[1].remove():x.setAttribute("d",A):"Vertical"===v.gauge.orientation?(x.setAttribute("y",c.toString()),x.setAttribute("height",g.toString())):(x.setAttribute("x",c.toString()),x.setAttribute("width",g.toString())),o.startValue=o.currentValue,v.gauge.trigger(U,{axis:v.gauge.isBlazor?null:i,pointer:o})}})},e}(),ae=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),se=function(e){function i(t){return e.call(this,t)||this}return ae(i,e),i.prototype.renderAxes=function(){var e,i,o,n=this;this.axisElements=[];var r=this.gauge.svgObject.querySelector("#"+this.gauge.element.id+"_Axis_Collections");r&&t.remove(r),this.axisObject=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_Axis_Collections",transform:"translate( 0, 0 )"});for(var a=0;a<this.gauge.axes.length;a++)i=(e=this.gauge.axes[a]).majorTicks,o=e.minorTicks,this.htmlObject=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_Axis_Group_"+a}),this.drawAxisLine(e,this.htmlObject,a),this.drawRanges(e,this.htmlObject,a),this.drawTicks(e,i,this.htmlObject,"MajorTicks",e.majorTickBounds),this.drawTicks(e,o,this.htmlObject,"MinorTicks",e.minorTickBounds),this.drawAxisLabels(e,this.htmlObject),this.drawPointers(e,this.htmlObject,a),this.axisElements.push(this.htmlObject);this.axisElements.forEach(function(e){n.axisObject.appendChild(e)}),this.gauge.svgObject.appendChild(this.axisObject),this.gauge.nearSizes.length!==this.gauge.farSizes.length&&this.gauge.axes.length>1&&this.axisAlign(this.gauge.axes)},i.prototype.axisAlign=function(e){var i,o,n=0,r=0;"Vertical"===this.gauge.orientation?(e.forEach(function(e,t){e.opposedPosition?r+=e.bounds.width:n+=e.bounds.width}),n+=this.gauge.containerBounds.width/2,r+=this.gauge.containerBounds.width/2,i=n/2-r/2,this.axisObject.setAttribute("transform","translate("+i+",0)"),t.isNullOrUndefined(this.gauge.containerObject)||this.gauge.containerObject.setAttribute("transform","translate("+i+",0)")):(e.forEach(function(e,t){e.opposedPosition?r+=e.bounds.height:n+=e.bounds.height}),n+=this.gauge.containerBounds.height/2,r+=this.gauge.containerBounds.height/2,o=n/2-r/2,this.axisObject.setAttribute("transform","translate(0,"+o+")"),t.isNullOrUndefined(this.gauge.containerObject)||this.gauge.containerObject.setAttribute("transform","translate(0,"+o+")"))},i.prototype.drawAxisLine=function(e,t,i){var o,n=e.lineBounds,r="",a=e.line.color||this.gauge.themeStyle.lineColor;e.line.width>0&&(r="M"+n.x+" "+n.y+" L "+("Vertical"===this.gauge.orientation?n.x:n.x+n.width)+" "+("Vertical"===this.gauge.orientation?n.y+n.height:n.y)+"z",o=new $(this.gauge.element.id+"_AxisLine_"+i,a,e.line.width,a,1,e.line.dashArray,r),t.appendChild(this.gauge.renderer.drawPath(o)))},i.prototype.drawTicks=function(e,t,i,o,n){for(var r,a,s,l="",h=e.visibleRange,u=e.lineBounds,d=e.majorTicks.color||this.gauge.themeStyle.majorTickColor,g=e.minorTicks.color||this.gauge.themeStyle.minorTickColor,c="MajorTicks"===o?d:g,m="MajorTicks"===o?e.majorInterval:e.minorInterval,y=h.min;y<=h.max&&m>0;y+=m)("MajorTicks"===o||"MinorTicks"===o&&y!==h.min&&y!==h.max&&y%e.majorInterval!=0)&&("Vertical"===this.gauge.orientation?(a=n.x,r=p(y,e,this.gauge.orientation,h)*u.height+u.y,l=l.concat("M"+a+" "+r+" L"+(a+t.height)+" "+r+" ")):(a=p(y,e,this.gauge.orientation,h)*u.width+u.x,r=n.y,l=l.concat("M"+a+" "+r+" L"+a+" "+(r+t.height)+" ")));s=new $(this.gauge.element.id+"_"+o+"Line_0",c,t.width,c,1,null,l),i.appendChild(this.gauge.renderer.drawPath(s))},i.prototype.drawAxisLabels=function(e,i){for(var o,n,r,a,s,l,h=e.lineBounds,u=e.labelBounds,d=e.majorTickBounds,g=e.visibleRange,c=this.gauge.themeStyle.labelColor,m=e.labelStyle.offset,y=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_AxisLabelsGroup"}),f=0;f<e.visibleLabels.length;f++)r=e.visibleLabels[f].size,l=e.labelStyle.useRangeColor?P(e.visibleLabels[f].value,e.ranges):null,l=t.isNullOrUndefined(l)?e.labelStyle.font.color||c:l,"Vertical"===this.gauge.orientation?(n=p(e.visibleLabels[f].value,e,this.gauge.orientation,g)*h.height+h.y,o=e.opposedPosition?u.x:d.x-r.width-5+m,n+=r.height/4):(o=p(e.visibleLabels[f].value,e,this.gauge.orientation,g)*h.width+h.x,n=u.y,a="middle",s=""),e.labelStyle.font.fontFamily=this.gauge.themeStyle.labelFontFamily||e.labelStyle.font.fontFamily,v(new te(this.gauge.element.id+"_AxisLabel_"+f,o,n,a,e.visibleLabels[f].text,null,s),e.labelStyle.font,l,y);i.appendChild(y)},i.prototype.drawPointers=function(e,i,o){var n,r,a,s;a=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_PointersGroup"});for(var l=0;l<e.pointers.length;l++)n=e.pointers[l],r="url(#"+this.gauge.element.id+"_AxisIndex_"+o+"__"+n.type+"ClipRect_"+l+")",t.isNullOrUndefined(n.bounds)||(s=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_AxisIndex_"+o+"_"+n.type+"Pointer_"+l,"clip-path":r}),t.isNullOrUndefined(n.startValue)&&(n.startValue=e.visibleRange.min),this["draw"+n.type+"Pointer"](e,o,n,l,s),a.appendChild(s));i.appendChild(a)},i.prototype.drawMarkerPointer=function(e,i,o,n,r){var a,s,h=this.gauge.element.id+"_AxisIndex_"+i+"_"+o.type+"Pointer_"+n;l(h)&&l(h).childElementCount>0&&t.remove(l(h));var u=o.color||this.gauge.themeStyle.pointerColor;a=new $(h,u,o.border.width,o.border.color,o.opacity,null,null,"translate( 0, 0 )"),a=S(o.bounds,o.markerType,new Q(o.width,o.height),o.imageUrl,a,this.gauge.orientation,e,o),s="Circle"===o.markerType?this.gauge.renderer.drawCircle(a):"Image"===o.markerType?this.gauge.renderer.drawImage(a):this.gauge.renderer.drawPath(a),r.appendChild(s),o.animationDuration>0&&!this.gauge.gaugeResized&&(o.animationComplete=!1,this.performMarkerAnimation(s,e,o)),s.setAttribute("aria-label",o.description||"Pointer:"+Number(o.currentValue).toString())},i.prototype.drawBarPointer=function(e,i,o,n,r){var a,h,u,p,d,g="",c=new Q(this.gauge.availableSize.width,this.gauge.availableSize.height),m=this.gauge.element.id+"_AxisIndex_"+i+"_"+o.type+"Pointer_"+n;if(l(m)&&l(m).childElementCount>0&&t.remove(l(m)),"Normal"===this.gauge.container.type?(a=new ee(m,o.color||this.gauge.themeStyle.pointerColor,o.border,o.opacity,o.bounds,null,null),d=o.bounds,u=this.gauge.renderer.drawRectangle(a)):(g=B(o.bounds,this.gauge.container.type,this.gauge.orientation,new Q(o.bounds.width,o.bounds.height),"bar",this.gauge.container.width,e,o.roundedCornerRadius),p=new $(m,o.color||this.gauge.themeStyle.pointerColor,o.border.width,o.border.color,o.opacity,null,g),d=s((u=this.gauge.renderer.drawPath(p)).cloneNode(!0),c,this.gauge.element)),l(m)&&l(m).childElementCount>0){var y=l(m).firstElementChild;"Normal"===this.gauge.container.type?(y.setAttribute("x",a.x+""),y.setAttribute("y",a.y+""),y.setAttribute("width",a.width+""),y.setAttribute("height",a.height+"")):y.setAttribute("d",p.d)}else r.appendChild(u);u.setAttribute("aria-label",o.description||"Pointer:"+Number(o.currentValue).toString()),o.animationDuration>0&&!this.gauge.gaugeResized&&("Thermometer"===this.gauge.container.type&&0===o.startValue&&(h=this.gauge.renderer.drawClipPath(new ee(this.gauge.element.id+"_AxisIndex_"+i+"__"+o.type+"ClipRect_"+n,"transparent",{width:1,color:"Gray"},1,d)),r.appendChild(h)),this.performBarAnimation(u,e,o))},i.prototype.drawRanges=function(e,i,o){for(var n,r,a=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_RangesGroup"}),s=0;s<e.ranges.length;s++)n=e.ranges[s],t.isNullOrUndefined(n.path)||(r=new $(this.gauge.element.id+"_AxisIndex_"+o+"_Range_"+s,n.interior,n.border.width,n.border.color,1,null,n.path),a.appendChild(this.gauge.renderer.drawPath(r)));i.appendChild(a)},i}(re),le=function(){function e(e){this.gauge=e}return e.prototype.renderAnnotationElements=function(){var e=this,i=this.gauge.element.id+"_Secondary_Element",o=t.createElement("div",{id:this.gauge.element.id+"_AnnotationsGroup"});if(o.style.position="absolute",o.style.top="0px",o.style.left="0px",this.gauge.annotations.map(function(t,i){null!==t.content&&e.createAnnotationTemplate(o,i)}),o.childElementCount>0&&!t.isNullOrUndefined(l(i))){l(i).appendChild(o);for(var n=0;n<this.gauge.annotations.length;n++)t.updateBlazorTemplate(this.gauge.element.id+"_ContentTemplate"+n,"ContentTemplate",this.gauge.annotations[n])}},e.prototype.createAnnotationTemplate=function(e,i){var o,n,r,a,s,l,h,u=this,g=!1,c=(this.gauge.element.id,this.gauge.annotations[i]);h=t.createElement("div",{id:this.gauge.element.id+"_Annotation_"+i,styles:"position: absolute; z-index:"+c.zIndex+";"});var m={cancel:!1,name:H,content:c.content,annotation:c,textStyle:c.font};if(m.textStyle.color=c.font.color||this.gauge.themeStyle.labelColor,this.gauge.isBlazor){var v=m.cancel,b=m.name,x=m.content,w=m.annotation,P=m.textStyle;m={cancel:v,name:b,content:x,annotation:w,textStyle:P}}this.gauge.trigger(H,m,function(v){if(!m.cancel){if((r=y(m.content))&&(window.Blazor||r(u.gauge,null,null,u.gauge.element.id+"_ContentTemplate"+i).length))for(var b=(a=Array.prototype.slice.call(r(window.Blazor?{}:u.gauge,null,null,u.gauge.element.id+"_ContentTemplate"+i))).length,x=0;x<b;x++)h.appendChild(a[x]);else h.appendChild(t.createElement("div",{innerHTML:m.content,styles:d(m.textStyle)}));var w=f(h.cloneNode(!0),u.gauge.element);if(t.isNullOrUndefined(c.axisValue)){var P=u.gauge.element.getBoundingClientRect(),C=u.gauge.svgObject.getBoundingClientRect();switch(g=!0,o=Math.abs(C.left-P.left),n=Math.abs(C.top-P.top),o="None"===c.horizontalAlignment?o+c.x:o,n="None"===c.verticalAlignment?n+c.y:n,c.verticalAlignment){case"Near":n+=c.y;break;case"Center":n=n+c.y+(C.height/2-w.height/2);break;case"Far":n=n+C.height+c.y-w.height}switch(c.horizontalAlignment){case"Near":o+=c.x;break;case"Center":o=o+c.x+(C.width/2-w.width/2);break;case"Far":o=o+C.width+c.x-w.width}}else{l=t.isNullOrUndefined(c.axisIndex)?0:c.axisIndex;var S=(s=u.gauge.axes[l]).visibleRange;g=c.axisValue>=S.min&&c.axisValue<=S.max;var B=s.lineBounds;"Vertical"===u.gauge.orientation?(o=B.x+c.x,n=p(c.axisValue,s,u.gauge.orientation,S)*B.height+B.y,n+=c.y):(o=p(c.axisValue,s,u.gauge.orientation,S)*B.width+B.x,o+=c.x,n=B.y+c.y),o-=w.width/2,n-=w.height/2}h.style.left=o+"px",h.style.top=n+"px",g&&e.appendChild(h)}})},e.prototype.getModuleName=function(){return"Annotations"},e.prototype.destroy=function(e){},e}(),he=function(){function e(e){this.gauge=e,this.element=e.element,this.tooltip=e.tooltip,this.textStyle=this.tooltip.textStyle,this.borderStyle=this.tooltip.border,this.tooltipId=this.gauge.element.id+"_LinearGauge_Tooltip",this.addEventListener()}return e.prototype.renderTooltip=function(e){var o,n,r=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,(n=e).changedTouches[0].pageX,n.changedTouches[0].pageY,o=n.target):(this.isTouch="touch"===e.pointerType,e.pageX,e.pageY,o=e.target);var a,s;if(o.id.indexOf("Pointer")>-1){this.pointerElement=o;var l=this.gauge.element.getBoundingClientRect(),h=w(this.pointerElement,this.gauge);this.currentAxis=h.axis,this.axisIndex=h.axisIndex,this.currentPointer=h.pointer;var u=this.tooltip.format&&null!==this.tooltip.format.match("{value}");if(this.tooltip.textStyle.fontFamily=this.gauge.themeStyle.fontFamily||this.tooltip.textStyle.fontFamily,this.tooltip.textStyle.opacity=this.gauge.themeStyle.tooltipTextOpacity||this.tooltip.textStyle.opacity,s=u?g(this.tooltip.format,{value:this.currentPointer.currentValue},this.gauge):c(this.currentPointer.currentValue,this.gauge).toString(),document.getElementById(this.tooltipId)?a=document.getElementById(this.tooltipId):(a=t.createElement("div",{id:this.tooltipId,className:"EJ2-LinearGauge-Tooltip",styles:"position: absolute;pointer-events:none;"}),document.getElementById(this.gauge.element.id+"_Secondary_Element").appendChild(a)),0!==a.childElementCount&&!this.gauge.pointerDrag)return null;var p=this.getTooltipLocation(),d={name:G,cancel:!1,gauge:this.gauge,event:e,location:p,content:s,tooltip:this.tooltip,axis:this.currentAxis,pointer:this.currentPointer},m=this.getTooltipPosition();p.y+=this.tooltip.template&&"Top"===m?20:0,p.x+=this.tooltip.template&&"Right"===m?20:0,this.gauge.trigger(G,d,function(e){var t=d.tooltip.template;null!==t&&1===Object.keys(t).length&&(t=t[Object.keys(t)[0]]);r.gauge.theme.toLowerCase();d.cancel||(d.tooltip.properties.textStyle.color=r.tooltip.textStyle.color||r.gauge.themeStyle.tooltipFontColor,r.svgTooltip=new i.Tooltip({enable:!0,header:"",data:{value:d.pointer.currentValue},template:t,content:[d.content],shapes:[],location:d.location,palette:[],inverted:!("Horizontal"===d.gauge.orientation),enableAnimation:d.tooltip.enableAnimation,fill:r.tooltip.fill||r.gauge.themeStyle.tooltipFillColor,availableSize:r.gauge.availableSize,areaBounds:new J(l.left,"Bottom"===m?p.y:l.top,"Right"===m?Math.abs(l.left-p.x):l.width,l.height),textStyle:d.tooltip.textStyle,border:d.tooltip.border,theme:d.gauge.theme,blazorTemplate:{name:"TooltipTemplate",parent:r.gauge.tooltip}}),r.svgTooltip.opacity=r.gauge.themeStyle.tooltipFillOpacity||r.svgTooltip.opacity,r.svgTooltip.appendTo(a))})}else this.removeTooltip()},e.prototype.getTooltipPosition=function(){return"Vertical"===this.gauge.orientation?this.currentAxis.opposedPosition?"Right":"Left":this.currentAxis.opposedPosition?"Top":"Bottom"},e.prototype.getTooltipLocation=function(){new Q(this.gauge.availableSize.width,this.gauge.availableSize.height);var e,t,i,o,n,r,a,s,h=this.gauge.element.id+"_AxisLine_"+this.axisIndex,u=this.gauge.element.id+"_MajorTicksLine_"+this.axisIndex;l(h)?(t=(s=l(h).getBoundingClientRect()).left,i=s.top):(s=l(u).getBoundingClientRect(),t=this.currentAxis.opposedPosition?s.left:s.left+s.width,i=this.currentAxis.opposedPosition?s.top:s.top+s.height),e=this.pointerElement.getBoundingClientRect();var p=this.gauge.element.getBoundingClientRect();return o=e.left-p.left,n=e.top-p.top,r=e.height,a=e.width,"Vertical"===this.gauge.orientation?(o=t-p.left,n="Marker"===this.currentPointer.type?n+r/2:this.currentAxis.isInversed?n+r:n):(n=i-p.top,o="Marker"===this.currentPointer.type?o+a/2:this.currentAxis.isInversed?o:o+a),new Z(o,n)},e.prototype.removeTooltip=function(){document.getElementsByClassName("EJ2-LinearGauge-Tooltip").length>0&&document.getElementsByClassName("EJ2-LinearGauge-Tooltip")[0].remove()},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.addEventListener=function(){this.gauge.isDestroyed||(this.gauge.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.gauge.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.gauge.isDestroyed||(this.gauge.off(t.Browser.touchMoveEvent,this.renderTooltip),this.gauge.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"Tooltip"},e.prototype.destroy=function(e){this.removeEventListener()},e}(),ue=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pe=function(e,t,i,o){var n,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},de=function(e){function s(t,i){var o=e.call(this,t,i)||this;return o.pointerDrag=!1,o.mouseX=0,o.mouseY=0,o.gaugeResized=!1,o}return ue(s,e),s.prototype.preRender=function(){this.isBlazor=window.Blazor,this.unWireEvents(),this.trigger("load",{gauge:this.isBlazor?null:this}),this.initPrivateVariable(),this.setCulture(),this.createSvg(),this.wireEvents()},s.prototype.setTheme=function(){this.themeStyle=function(e){var t;switch(e.toLowerCase()){case"materialdark":case"fabricdark":case"bootstrapdark":t={backgroundColor:"#333232",titleFontColor:"#ffffff",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#000000",labelColor:"#DADADA",lineColor:"#C8C8C8",majorTickColor:"#C8C8C8",minorTickColor:"#9A9A9A",pointerColor:"#9A9A9A"};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",tooltipFillColor:"#ffffff",tooltipFontColor:"#000000",labelColor:"#FFFFFF",lineColor:"#FFFFFF",majorTickColor:"#FFFFFF",minorTickColor:"#FFFFFF",pointerColor:"#FFFFFF"};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",labelColor:"#212529",lineColor:"#ADB5BD",majorTickColor:"#ADB5BD",minorTickColor:"#CED4DA",pointerColor:"#6C757D",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",labelFontFamily:"HelveticaNeue",tooltipFillOpacity:1,tooltipTextOpacity:.9,containerBackground:"#F8F9FA"};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",tooltipFillColor:"#FFFFF",tooltipFontColor:"#FFFFFF",labelColor:"#686868",lineColor:"#a6a6a6",majorTickColor:"#a6a6a6",minorTickColor:"#a6a6a6",pointerColor:"#a6a6a6",containerBackground:"#e0e0e0"}}return t}(this.theme)},s.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-lineargauge").length;this.element.id="lineargauge_control_"+e}this.renderer=new i.SvgRenderer(this.element.id),this.gaugeAxisLayoutPanel=new ne(this),this.axisRenderer=new se(this)},s.prototype.setCulture=function(){this.intl=new t.Internationalization},s.prototype.createSvg=function(){this.removeSvg(),this.calculateSize(),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},s.prototype.removeSvg=function(){for(var e=0;e<this.annotations.length;e++)t.resetBlazorTemplate(this.element.id+"_ContentTemplate"+e,"ContentTemplate");h(this.element.id+"_Secondary_Element"),t.isNullOrUndefined(this.svgObject)||t.isNullOrUndefined(this.svgObject.parentNode)||t.remove(this.svgObject)},s.prototype.calculateSize=function(){var e=o(this.width,this.element.offsetWidth)||this.element.offsetWidth||600,t=o(this.height,this.element.offsetHeight)||this.element.offsetHeight||450;this.availableSize=new Q(e,t)},s.prototype.render=function(){this.setTheme(),this.renderGaugeElements(),this.calculateBounds(),this.renderAxisElements(),this.renderComplete(),this.trigger("loaded",{gauge:this.isBlazor?null:this})},s.prototype.renderGaugeElements=function(){this.appendSecondaryElement(),this.renderBorder(),this.renderTitle(),this.renderContainer()},s.prototype.appendSecondaryElement=function(){if(t.isNullOrUndefined(l(this.element.id+"_Secondary_Element"))){var e=t.createElement("div");e.id=this.element.id+"_Secondary_Element",e.setAttribute("style","position: relative"),this.element.appendChild(e)}},s.prototype.renderArea=function(){var e=n(this.title,this.titleStyle),t=new J(this.actualRect.x,this.actualRect.y-e.height/2,this.actualRect.width,this.actualRect.height),i=new ee(this.element.id+"LinearGaugeBorder",this.background||this.themeStyle.backgroundColor,this.border,1,t);this.svgObject.appendChild(this.renderer.drawRectangle(i))},s.prototype.calculateBounds=function(){this.gaugeAxisLayoutPanel.calculateAxesBounds()},s.prototype.renderAxisElements=function(){this.axisRenderer.renderAxes(),this.element.appendChild(this.svgObject),this.annotationsModule&&this.annotationsModule.renderAnnotationElements()},s.prototype.renderBorder=function(){var e=this.border.width;if(e>0){var t=new ee(this.element.id+"_LinearGaugeBorder",this.background||this.themeStyle.backgroundColor,this.border,1,new J(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e),null,null);this.svgObject.appendChild(this.renderer.drawRectangle(t))}},s.prototype.renderTitle=function(){var e,i,o,r,a,s=n(this.title,this.titleStyle),l=new te(this.element.id+"_LinearGaugeTitle",this.availableSize.width/2,this.margin.top+s.height/2,"middle",this.title);if(a={x:l.x-s.width/2,y:l.y,width:s.width,height:s.height},e=this.margin.left,i=t.isNullOrUndefined(a)?this.margin.top:a.y,o=this.availableSize.height-i-this.margin.bottom,r=this.availableSize.width-this.margin.left-this.margin.right,this.actualRect={x:e,y:i,width:r,height:o},this.title){this.titleStyle.fontFamily=this.themeStyle.fontFamily||this.titleStyle.fontFamily,this.titleStyle.size=this.themeStyle.fontSize||this.titleStyle.size;var h=v(l,this.titleStyle,this.titleStyle.color||this.themeStyle.titleFontColor,this.svgObject);h.setAttribute("aria-label",this.description||this.title),h.setAttribute("tabindex",this.tabIndex.toString())}},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,t.Browser.touchStartEvent,this.gaugeOnMouseDown),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMove),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEnd),t.EventHandler.remove(this.element,"contextmenu",this.gaugeRightClick),t.EventHandler.remove(this.element,t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeave),t.EventHandler.remove(window,t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.gaugeResize.bind(this))},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.gaugeOnMouseDown,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEnd,this),t.EventHandler.add(this.element,"contextmenu",this.gaugeRightClick,this),t.EventHandler.add(this.element,t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeave,this),t.EventHandler.add(window,t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.gaugeResize,this),this.setStyle(this.element)},s.prototype.setStyle=function(e){e.style.touchAction=u(this.axes)?"none":"element",e.style.msTouchAction=u(this.axes)?"none":"element",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative"},s.prototype.gaugeResize=function(e){var t=this,i={gauge:this.isBlazor?null:this,previousSize:new Q(this.availableSize.width,this.availableSize.height),name:"resized",currentSize:new Q(0,0)};return this.resizeTo&&clearTimeout(this.resizeTo),this.element.classList.contains("e-lineargauge")&&(this.resizeTo=window.setTimeout(function(){t.createSvg(),t.renderGaugeElements(),t.calculateBounds(),t.renderAxisElements(),i.currentSize=new Q(t.availableSize.width,t.availableSize.height),t.trigger("resized",i),t.render()},500)),!1},s.prototype.destroy=function(){this.unWireEvents(),this.removeSvg(),e.prototype.destroy.call(this)},s.prototype.renderContainer=function(){var e,t,i,o,n,r,a,s,l="",h="transparent"!==this.container.backgroundColor||"Bootstrap4"!==this.theme&&"Material"!==this.theme?this.container.backgroundColor:this.themeStyle.containerBackground,u=this.container.width;a=u+u/2/Math.PI,r=u/2,"Vertical"===t