realchart 1.1.7 → 1.1.8
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.
- package/dist/index.esm.js +2 -2
- package/dist/index.ie.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart v1.1.
|
|
3
|
+
* RealChart v1.1.8
|
|
4
4
|
* Copyright (C) 2023-2024 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},a=function(t){return"string"==typeof t&&t.length>0},o=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,_=Math.floor,c=Math.ceil,d=Math.cos,u=Math.sin,p=function(t){return Math.pow(10,t)},g=Math.log10,m=Math.min,f=Math.max,w=Math.abs,x=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},y=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},b=function(t,e){return void 0!==t?t:e},v=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},V=(t,e,s)=>t+(e-t)*s,S=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class k{static log(...t){this.LOGGING&&console.log(...t)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&k.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(m(s,k.month_days[k.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),a=new Date(r,i+1,0).getDate(),o=t.getDate()+n-1,h=e+Math.ceil((a+n-7)/7),l=e+Math.floor(o/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!i(t))return l({},t)}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(i(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-S}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=f(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=f(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=i(t)?[]:{};for(let s of Object.keys(t))e[s]=k.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),k.log(t,+new Date-s+"ms")}static clamp(t,e,s){return f(e,m(s,t))}static makeIntArray(t,e){const s=new Array(f(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=w(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}}k.LOGGING=!1,k.week_days=["일","월","화","수","목","금","토"],k.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],k.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],k.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const P={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let C="ko",A=P[C]||P[C="ko"];const L=(t,e)=>{t&&s(e)&&(A=P[t.substring(0,2)]=Object.assign(P.ko,P.en,e))};let E=0;class N{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(E++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class M extends N{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const T=void 0,R=Math.PI,O=2*R,B=-R/2,D=2*R/360,$=360/R/2,z="%".charCodeAt(0);function F(t){return t>O?t%O:t}function I(t){return parseFloat(t.toPrecision(12))}function H(t){return Math.floor(1e6*t)/1e6}function G(t){return null==t?null:String(t)}function j(t){return t+"px"}function W(t){return null==t||Number.isNaN(t)||""===t}function X(t){return t<10?"0"+t:String(t)}function Y(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function U(t,e){const s={};return s[t]=e,s}function Z(t,e,s){let i,r=!1;if(null==t){if(e)return null;i=s||0,r=!0}else if("string"==typeof t){const s=t.trim();if(0===s.length?i=NaN:s.charCodeAt(s.length-1)===z?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;it(A.invalidSizeValue,t)}}else if(i=+t,isNaN(i)){if(e)return null;i=s||0,r=!0}else r=!0;return{size:i,fixed:r}}function q(t,e){return Z(t,!0)||Z(e,!1)}function K(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Q="fill",J={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},tt=function(t){const e=J[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return J[t]=e,e}return e};class et extends Error{}const st=function(t,e){if(!t)throw new et(e)},it=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},rt=function(t,e,r,a=!0,o=!0,h=!1,_){let c,d;if(a&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),i(t))c=[],t.forEach((t=>{if(s(t)&&n(t.color)){const s={fromValue:x(t.fromValue,d?d.toValue:e),toValue:x(t.toValue,r),color:t.color,style:t.style?l({},t.style):T};s.fromValue<s.toValue&&(c.push(s),d=s)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<r)),o&&c.forEach((t=>{t.fromValue=f(t.fromValue,e),t.toValue=m(t.toValue,r)}));else if(s(t)&&i(t.colors)&&t.colors.length>0){const s=t.colors,n=i(t.styles)?t.styles:null;if(c=[],i(t.steps)&&t.steps.length>0){const a=i(t.steps)?t.steps:null;e<a[0]&&a.unshift(e),r>a[a.length-1]&&a.push(r);for(let t=0;t<a.length-1;t++)c.push({fromValue:a[t],toValue:a[t+1],color:s[m(t,s.length-1)],style:n?n[m(t,n.length-1)]:T})}else{let i=x(t.fromValue,e);const a=x(t.toValue,r),o=(a-i)/s.length;let h=0;for(;i<a;)c.push({fromValue:i,toValue:i+=o,color:s[m(h,s.length-1)],style:n?n[m(h,n.length-1)]:T}),h++}}if(h&&c&&c.length>0){let t=0,s=e;for(;t<c.length;)c[t].fromValue>s&&c.splice(t,0,{fromValue:s,toValue:c[t].fromValue,color:_}),s=c[t].toValue,t++;c[t-1].toValue<r&&c.push({fromValue:c[t-1].toValue,toValue:r,color:_})}return c},nt="vertical-lr",at="vertical-rl",ot=function(t){return t&&"object"==typeof t};class ht extends M{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),i(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=i(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(i(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else ot(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e=0,s=-1){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){(isNaN(t)||t<0)&&(t=this._rows.length-1),this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&it(A.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class lt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let r;i(s)?r=new ht({},s):ot(s)&&i(s.values)&&(r=new ht(s.options,s.values)),this._map[e]=r}}}const _t="0".charCodeAt(0),ct="#".charCodeAt(0),dt=",".charCodeAt(0),ut="s".charCodeAt(0),pt="a".charCodeAt(0);class gt{static getFormatter(t){let e=gt.Formatters[t];return e||(gt.Formatters[t]=e=new gt(t)),e}static get Default(){return gt.getFormatter(gt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===_t;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===ct;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===_t;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===dt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===ut){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===pt){s.signDisplay="never";break}}return s.minimumIntegerDigits=f(1,s.minimumIntegerDigits),s}}}gt.DEFAULT_FORMAT="",gt.Formatters={};const mt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],ft=[".","/","-",":"],wt="Z".charCodeAt(0),xt="z".charCodeAt(0),yt="A".charCodeAt(0),bt="a".charCodeAt(0),vt="y".charCodeAt(0),Vt="M".charCodeAt(0),St="m".charCodeAt(0),kt="W".charCodeAt(0),Pt="w".charCodeAt(0),Ct="d".charCodeAt(0),At="H".charCodeAt(0),Lt="h".charCodeAt(0),Et="S".charCodeAt(0),Nt="s".charCodeAt(0);class Mt{static getFormatter(t){let e=Mt.Formatters[t];return e||(Mt.Formatters[t]=e=new Mt(t)),e}static get Default(){return Mt.getFormatter(A.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||A.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var a=s[r],o=a.length;switch(a.charCodeAt(0)){case vt:i+=o>2?t.getFullYear():X(t.getFullYear()%100);break;case Vt:i+=o>1?X(t.getMonth()+1):t.getMonth()+1;break;case Ct:i+=o>1?X(t.getDate()):t.getDate();break;case kt:i+=o>1?X(k.weekOfYear(t,e)+1):k.weekOfMonth(t,e,!0)+1;break;case Pt:i+=o>1?k.long_week_days[t.getDay()]:k.week_days[t.getDay()];break;case At:i+=o>1?X(t.getHours()):t.getHours();break;case Lt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=o>1?X(e):e}else i+=o>1?X(t.getHours()):t.getHours();break;case St:i+=o>1?X(t.getMinutes()):t.getMinutes();break;case Nt:i+=o>1?X(t.getSeconds()):t.getSeconds();break;case bt:case yt:t.getHours()<12?i+=A.am:i+=A.pm;break;case Et:let s=t.getMilliseconds();i+=3==o?Y(s):2==o?X(s):s.toString().substring(0,o);break;default:i+=a}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(ft.indexOf(n)>=0)e.push(n),r++;else{let a=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(a,r),mt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=yt&&e<=wt||e>=bt&&e<=xt)&&it(A.invalidDateFormat,t)}e.push(n)}if(r<i&&k.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&k.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||A.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Mt.Formatters={};class Tt{static isBright(t){return new Tt(t).isBright()}static getContrast(t,e,s){return new Tt(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(k.startsWith(t,"rgb(")&&k.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):k.startsWith(t,"rgba(")&&k.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):k.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Tt(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}class Rt{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}var Ot;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Ot||(Ot={}));const Bt={name:"RealChart",version:"1.1.7",license:"enterprise",code:""};class Dt{static decode(t){const e=Dt.CHARS,s=Dt.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}Dt.PAD="=",Dt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class $t{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let a=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return a=(a>>16^i>>16)<<16|65535&(65535&a^65535&i),(a>>16)+(s>>16)+((65535&a)+(65535&s)>>16)<<16|(65535&a)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=$t.xor,i=$t.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=$t.xor,i=$t.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=$t.kb,i=$t._encryptBlock;let r,n,a,o=0,h=0,l={left:0,right:0};const _={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*$t.POW8|e[o++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,a=_.p.length;r<a;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,a=_["s"+r].length;n<a;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=$t._decryptBlock;let i=$t._init(e),r=[],n=Dt.decode(t),a=n.length>>3,o=0,h={left:null,right:null};for(let t=0;t<a;t++){h.left=n[o]*$t.POW24|n[o+1]*$t.POW16|n[o+2]*$t.POW8|n[o+3],h.right=n[o+4]*$t.POW24|n[o+5]*$t.POW16|n[o+6]*$t.POW8|n[o+7],s(h,i);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),o+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}$t.POW2=Math.pow(2,2),$t.POW3=Math.pow(2,3),$t.POW4=Math.pow(2,4),$t.POW8=Math.pow(2,8),$t.POW16=Math.pow(2,16),$t.POW24=Math.pow(2,24),$t.kb={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],k:[202,218,204,100]};class zt{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substr(1,t.length-1),e.substr(e.indexOf(t),t.length)==t)}static _getLDKey(t){let e="";for(let s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}}return!1}static decrypt(t){const e={},s=$t.decrypt(t,"dkdl"+this._getLDKey($t.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}class Ft extends N{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this.loaded=!1,this._windowResizeHandler=t=>{this._windowResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=zt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==Bt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(Bt.license!=Ot.Developer&&!zt.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(Ot).includes(n))throw new Error(s);if(Bt.code=i.code,Bt.license=i.lic,n==Ot.Evaluation||n==Ot.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||Ft.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Rt.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}setData(t,e,s){W(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}clearDefs(){Rt.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(It.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(It.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new Wt(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new Yt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}_setTesting(){this._testing=!0,It.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler,!0)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(e,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof HTMLDivElement||it(A.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");l(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=i,this._container.appendChild(n);const a=this._svg=r.createElementNS(t,"svg");a.classList.add("rct-svg"),a.style.setProperty("overflow","visible","important"),a.setAttribute("width","100%"),a.setAttribute("height","100%");const o=r.createElement("desc");o.textContent="Created by RealChart v1.1.7",a.appendChild(o);const h=this._defs=r.createElementNS(t,"defs");this._initDefs(r,h),a.appendChild(h),n.appendChild(a),this._root=new Gt(this),a.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),l(this._htmlRoot.style,{position:"absolute"})}_initDefs(e,s){let i=e.createElementNS(t,"filter");i.setAttribute("id",Ft.SHADOW_FILTER);const r=e.createElementNS(t,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=e.createElementNS(t,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const a=e.createElementNS(t,"feFlood");a.setAttribute("flood-color","#000"),i.appendChild(a);const o=e.createElementNS(t,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),i.appendChild(o);const h=e.createElementNS(t,"feMerge"),l=e.createElementNS(t,"feMergeNode"),_=e.createElementNS(t,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(!this.orphaned)if(+new Date<=this._toAnimation)this.$_requestRender();else{k.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;l(this._htmlRoot.style,{left:j(e.left-t.left),top:j(e.top-t.top)}),this._doRenderBackground(this._container.firstElementChild,this._root,s,i);const r=this._padding=Rt.getPadding(this._root.dom);this._doRender({x:r.left,y:r.top,width:s-r.left-r.right,height:i-r.top-r.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),k.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_windowResized(){this.invalidateLayout()}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}Ft.CLASS_NAME="rct-control",Ft.SHADOW_FILTER="rr-chart-shadow-filter",Ft._animatable=!0;class It extends N{constructor(e,s,i=T){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return W(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}isDomAnimating(){return!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t){return this._scaleX===t&&this._scaleY===t||(this._scaleX=this._scaleY=t,this._updateTransform()),this}trans(t,e){return t=k.isValidNum(t)?t:this._tx,e=k.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=k.isValidNum(t)?t:this._tx,e=k.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&k.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&k.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(t),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==T&&(this._dom.setAttribute("style",this._saveStyle),delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(tt(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(tt(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(tt(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let s in t)e.setProperty(tt(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i?this._dom.setAttribute(i,r):s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),t&&this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?t&&this._dom.classList.add(t):this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this._dom.classList.add(t):s(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,b(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}hasData(t){return null!=this.dom.getAttribute("data-"+t)}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==s||s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==e||e.addEventListener("finish",(()=>{this.setVis(!1)}))}else this.setVis(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(It.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return It.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(k.isValidNum(e)||k.isValidNum(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),k.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+k.pick(this._originX,t.getAttribute("x"),0)+" "+k.pick(this._originY,t.getAttribute("y")||0)+")");const r=k.getNumber(this._scaleX,1),n=k.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}It.DEBUGGING=!1,It.TESTING=!1,It.ASSET_KEY="_asset_",It.TEMP_KEY="_temp_";class Ht extends It{constructor(t,e){super(t,e,"g")}}class Gt extends It{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class jt extends It{constructor(t){super(t,T,"clipPath");const e=this._id=k.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Wt extends jt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,a=0){super(t);const o=this._rect=new It(t,null,"rect");o.setAttr("fill","none"),n>0&&o.setAttr("rx",String(n)),a>0&&o.setAttr("ry",String(a)),isNaN(e)||o.setBounds(e,s,i,r),this.add(o)}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class Xt extends It{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Yt extends jt{constructor(t){super(t),this.add(this._circle=new It(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class Ut{constructor(){this.dragging=!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this.dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this.dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._doCanceled()}finally{this.end(-1,-1)}}drop(t,e,s){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,s){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_doCompleted(t,e,s){}_doEnded(t,e){}}var Zt,qt,Kt;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Zt||(Zt={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(qt||(qt={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Kt||(Kt={}));class Qt extends It{constructor(t,e=void 0){super(t,e,"text"),this._layout=qt.TOP,this._overflow=Kt.WRAP,this._dirty=!0,this._text="",this.anchor=Zt.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.75*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case qt.MIDDLE:i=Math.floor(s/2);break;case qt.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=f(0,t),(e=m(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,a=s.length;do{r=Math.ceil((n+a)/2);i.getSubStringLength(0,r)>t?a=r-1:n=r}while(n<a);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Tt.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}applyStyles(t){super.setStyles(t)}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const Jt="$_TH",te="$_TW";class ee{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?gt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Mt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=s[r+2]||"");i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),a=n.indexOf(";");if(a>0){const t=n.indexOf(";",a+1);t>=a?this._literals.push(r,n.substring(0,a),n.substring(a+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,a),n.substring(a+1),T),0===this._literals[2].length&&(this._literals[2]=T)}else this._literals.push(r,n,T,T);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class se extends ee{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}class ie extends se{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-link")}}const re={t:class extends se{tag(){return"</t>"}},b:class extends se{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends se{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:ie};class ne{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new ee).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in re){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",a=t.indexOf(n,e+1);if(a>=0){const e=t.substring(i,a+n.length);r=(new re[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const ae=/<br.*?>|\r\n|\n/;class oe{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,s,i,r,n){const a=e.doc,o=x(this.lineHeight,1),h=this._lines,l=h.length,_=[],c=[];e.clearDom(),r=r||e;const d=e.getStyle("writing-mode"),u=d===nt||d===at;for(let s=0;s<l;s++){const i=h[s];let l=0,d=0,p=null;for(let s of i.words){const i=s.prepareSpan(e.appendElement(a,"tspan"),r,n),o=i.getBBox();if(i[te]=o.width,i[Jt]=o.height,u?(l=f(l,i[te]),d+=i[Jt]):(l+=i[te],d=f(d,i[Jt])),p||(p=i),s instanceof ie){const r=a.createElementNS(t,"a");r.setAttribute("href",s.url),r.setAttribute("target",s.target),r.appendChild(i),e.appendDom(r)}}c.push(p),i[Jt]=d*o,i[te]=l*o,_.push(0==s?i[te]/2:i[te])}if(l>0){let t=h[0];for(let s=1;s<c.length;s++)if(c[s]){let i=0,r=0;if(u?null!=c[s-1]&&(i=Math.floor(t[te]-e.getAscent(t[te]))+e.getAscent(h[s][te])):r=Math.floor(t[Jt]-e.getAscent(t[Jt]))+e.getAscent(h[s][Jt]),c[s]==c.find((t=>null!=t))&&null==c[0]){const r=e.insertElement(a,"tspan",c[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[te]=n.width,r[Jt]=t[Jt]=n.height,c[0]=r}switch(d){case nt:c[s].setAttribute("dx",String(i)),c[s].setAttribute("y","0");break;case at:c[s].setAttribute("dx",String(-i)),c[s].setAttribute("y","0");break;default:c[s].setAttribute("x","0"),c[s].setAttribute("dy",String(r))}t=h[s]}if(u){const t=e.parent.dom.classList.contains("rct-annotation"),s=e.getBBox().width,[i]=c,r=i[te];if(t)i.setAttribute("dx",String(d===at?s-r/2:r/2));else switch(d){case nt:i.setAttribute("x",String((s-r)/-2));break;case at:i.setAttribute("x",String((s-r)/2))}}else e.layoutText(h[0][Jt])}}layout(t,e,s,i,r){const n=t.getBBox();let a=0,o=0;const h=t.getStyle("writing-mode");if(h===nt||h===at)switch(a=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=Zt.MIDDLE,o=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=Zt.END,o=n.height-r.bottom;break;default:t.anchor=Zt.START,o=r.top}else switch(o=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=Zt.MIDDLE,a=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=Zt.END,a=n.width-r.right;break;default:t.anchor=Zt.START,a=r.left}t.trans(a,o)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(ae);for(let t of s)e.push((new ne).parse(t))}}}class he{constructor(t){this.source=t}hasDef(){return!0}}class le extends he{_setStops(e,s){s.setAttribute("id",this.source.id);const r=this.source.color,n=null==this.source.opacity?1:this.source.opacity,a=i(r)?[...r]:[r,"white"],o=i(n)?[...n]:Array(a.length).fill(n);1===a.length&&a.push("white"),a.forEach(((i,r)=>{!function(e,s,i,r,n){const a=e.createElementNS(t,"stop");a.setAttribute("offset",String(i)),a.setAttribute("stop-color",r),a.setAttribute("stop-opacity",String(n)),s.appendChild(a)}(e,s,r/(a.length-1),i,null==o[r]?1:o[r])}))}}class _e extends le{getEelement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:a,y2:o}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,i),s.dir){case"up":a=1;break;case"right":n=1;break;case"left":r=1;break;default:o=1}return i.setAttribute("x1",r),i.setAttribute("y1",a),i.setAttribute("x2",n),i.setAttribute("y2",o),i}}_e.TYPE="lineargradient";class ce extends le{getEelement(e,s){const i=e.createElementNS(t,"radialGradient");return W(s.cx)||i.setAttribute("cx",s.cx),W(s.cy)||i.setAttribute("cy",s.cy),W(s.r)||i.setAttribute("r",s.r),this._setStops(e,i),i}}ce.TYPE="radialgradient";class de extends he{getEelement(e,i){const r=e.createElementNS(t,"pattern"),a=e.createElementNS(t,"path");let o,h,_,c,d=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),a.classList.add("rct-pattern"),+i.pattern>=0){const t=de.STOCK[+i.pattern%de.STOCK.length];o=t.path,h=t.style,d=!t.fill,_=t.width||20,c=t.height||20}else n(i.pattern)&&(o=i.pattern,_=i.width||i.height||20,c=i.height||i.width||20);r.setAttribute("width",String(_)),r.setAttribute("height",String(c)),a.setAttribute("d",o),h&&l(a.style,h),i.style&&l(a.style,i.style),d&&(a.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const s=e.createElementNS(t,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(_)),s.setAttribute("height",String(c))}return r.append(a),r}}de.TYPE="pattern",de.STOCK=[{path:"M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M0 0 L0 3 L5.2 6 L10.4 3 L10.4 0 M5.2 6 L5.2 12 L0 15 L0 18 M5.2 12 L10.4 15 L10.4 18",width:10.4,height:18,style:{strokeWidth:"0.3px"}},{path:"M0 0h5v5H0zM5 5h5v5H5z",fill:!0,width:10,height:10},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!0,width:10,height:10},{path:"M0 2.8 L5 0 L10 2.8 L10 14 L5 16.8 L0 14 L0 2.8 M5 0 L5 5.6 L0 8.4 L5 11.2 L5 16.8 M5 5.6 L10 8.4 L5 11.2",style:{strokeWidth:"0.3px"},width:10,height:16.8},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!1,width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M 0 0 L 12 12 L 24 0 M 4 0 L 12 8 L 20 0 M 8 0 L 12 4 L 16 0 M 0 4 L 8 12 L 0 20 M 0 8 L 4 12 L 0 16 M 0 24 L 12 12 L 24 24 M 4 24 L 12 16 L 20 24 M 8 24 L 12 20 L 16 24 M 24 20 L 16 12 L 24 4 M 24 16 L 20 12 L 24 8",width:24,height:24,fill:!1,style:{strokeWidth:"0.4px"}},{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",style:{strokeWidth:"0.3px"},width:5,height:5},{path:"M-2.5 1.25l5 2.5L7.5 1.25l5 2.5 M-2.5 6.25l5 2.5 5-2.5 5 2.5 M-2.5 11.25l5 2.5 5-2.5 5 2.5 M-2.5 16.25l5 2.5 5-2.5 5 2.5",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M25 1.95v.26c-.79 0-1.43.64-1.43 1.43 0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54h-4.56v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.69 1.69 0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4l-.31-.31a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8 0 .79.64 1.43 1.43 1.43v.26c-.93 0-1.69-.76-1.69-1.69.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39h-4.56v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33-.79 0-1.43.64-1.43 1.43h-.26c0-.93.76-1.69 1.69-1.69.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63v-4.56h-4.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8a1.43 1.43 0 1 0-2.86 0c0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54H6.38v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.7 1.69h-.26c0-.79-.64-1.43-1.43-1.43-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87v-4.56H1.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.7v-.26c.79 0 1.43-.64 1.43-1.43 0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56v-4.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.93 0-1.69-.76-1.69-1.69s.76-1.69 1.69-1.69c.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63V6.38H1.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8 0-.79-.64-1.43-1.43-1.43v-.26c.93 0 1.69.76 1.69 1.69 0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56V1.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33.79 0 1.43-.64 1.43-1.43h.26c0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4L7.57.98a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8a1.43 1.43 0 1 0 2.86 0c0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56V1.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.95 0-1.71-.76-1.71-1.69h.26c0 .79.64 1.43 1.43 1.43.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69ZM10.94 18.62c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69s1.69.76 1.69 1.69c0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56v-4.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33a1.43 1.43 0 1 0 0-2.86c-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87V6.38h-4.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.69s-1.69-.76-1.69-1.69c.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39H6.38v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33a1.43 1.43 0 1 0 0 2.86c.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56Z",width:25,height:25,fill:!1,style:{strokeWidth:"0.3px"}},{path:"M 0 8 L 8 0 L 12 4 L 4 12 Z M -2 2 L 2 6 M 2 -2 L 6 2 M 6 10 L 10 14 M 10 6 L 14 10",width:12,height:12,style:{strokeWidth:"0.5px"}},{path:"M0 13.66 6.34 10 10 16.34 3.66 20zM0 6.34 3.66 0 10 3.66 6.34 10zM10 16.34 13.66 10 20 13.66 16.34 20zM10 3.66 16.34 0 20 6.34 13.66 10zM0 6.34v7.32M20 6.36v7.3M6.34 10h7.32",width:20,height:20,style:{strokeWidth:"0.3px"},fill:!1}];class ue extends he{prepare(){const t=this.source;return this._colors=i(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&k.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getEelement(t,e){this._colors=i(e.colors)?e.colors:[]}}ue.TYPE="colors";class pe extends he{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||pe.SIZE,height:e.height||e.width||pe.SIZE})}}pe.TYPE="images",pe.SIZE=20;class ge{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(t))t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}));else if(s(t)){const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(It.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=de.TYPE:i(t.colors)?e=ue.TYPE:i(t.images)&&(e=pe.TYPE)),e)switch(e.toLowerCase()){case _e.TYPE:return new _e(t);case ce.TYPE:return new ce(t);case de.TYPE:return new de(t);case ue.TYPE:return new ue(t);case pe.TYPE:return new pe(t)}}}}let me=0;const fe=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},we=function(t,e){const r=s(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];i(n)?r[t]=n.slice(0):n instanceof Date?r[t]=new Date(n):s(n)?r[t]=we(r[t],n):r[t]=n}return r};class xe extends N{constructor(t){super(),this.chart=t,me++}init(){const t=this._op=we({},this.constructor.defaults);this._doInit(t),this._doApply(t);const e={};return this._doInitChildren(e),this._children=Object.keys(e),this._children.length>0&&l(t,e),t}_doInit(t){}_doInitChildren(t){}_initObject(){return this.init(),this}get options(){return this._op}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this._op.visible}_load(t){const e=this._op;if(this._config=t,void 0!==t&&!this._doSetSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(e,t)}return this._doApply(e),e}loadOptions(t){return this.clearOptions(),this._load(t),this}saveOptions(t=!0){const e={};return this._doSave(e,this.constructor.defaults,t),e}updateOptions(t,e=!0){const s=function(t,e){const i=t._op;let r={};void 0===e||t._doSetSimple(e)||(t._children.forEach((t=>{e.hasOwnProperty(t)&&(r[t]=e[t],delete e[t])})),we(i,e)),t.$_applyOptions(i);for(const e in r)s(t[e],r[e])};return s(this,void 0!==t?Object.assign({},t):void 0),e&&this._changed(),this}updateOption(t,e,s=!0){if(this[t]instanceof xe)this[t]._doSetSimple(e);else{const i=this._op;e!==i[t]&&(i[t]=e,this.$_applyOptions(i),s&&this._changed())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s.hasOwnProperty(t)&&(this[t]instanceof xe?this[t]._doSetSimple(!h(i)||!i):(s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,s=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof xe)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;e.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),s&&this._changed()}return this}clearOptions(t=!0){const e=function(t){if(t){const s=t._op=we({},t.constructor.defaults);return t.$_applyOptions(s),t._children.forEach((i=>{s[i]=e(t[i])})),s}};return e(this),t&&this._changed(),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof xe?t[r]=this[r]._load(n):i(n)?t[r]=n.slice(0):n instanceof Date?t[r]=new Date(n):s(n)?t[r]=l({},n):t[r]=n)}}_doSave(t,e,s){const r=this._op;for(const n in r)if(r.hasOwnProperty(n))if(s&&this[n]instanceof xe)t[n]=this[n].saveOptions(!0);else{const s=r[n];i(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=Z(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doUpdate(t){for(const e in t)if(t.hasOwnProperty(e)){let r=t[e];this._doLoadProp(e,r)||(this[e]instanceof xe?this[e].updateOptions(r):i(r)?this[e]=r.slice(0):r instanceof Date?this[e]=new Date(r):s(r)?this[e]=l({},r):this[e]=r)}}_doPrepareRender(t){}}xe.REFRESHED="refreshed",xe.defaults={visible:!0};class ye{constructor(t){this._items=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}items(){return this._items.slice(0)}_internalItems(){return this._items}updateOptions(t,e){}}class be extends xe{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=x(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?gt.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new oe),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,s){if(k.isValidNum(t)){const i=this._numSymbols&&e&&k.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this.$_getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}be.defaults=fe(xe.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class ve extends be{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof pe&&(this._images=e)}this._root=this._images?"":this._op.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2);return s instanceof pe?s.getImage(i):i}return this._root+t}}}ve.defaults=fe(be.defaults,{iconPosition:"default",iconGap:2});class Ve extends xe{}const Se={};class ke extends xe{static register(...t){t.forEach((t=>{Se[t.type]=t}))}constructor(t,e){super(t),this.inBody=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this.chart.isInverted(),i=this._op;let r,n;if(this.inBody){const a=+i.x1,o=+i.x2,h=+i.y1,l=+i.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(a)){const i=this.chart.xAxis;s?this._y=e-i.getPos(e,a):this._x=i.getPos(t,a),isNaN(o)||(s?n=this._h=e-i.getPos(e,o)-this._y:r=this._w=i.getPos(t,o)-this._x)}if(!isNaN(h)){const i=this.chart.yAxis;s?this._x=i.getPos(t,h):this._y=e-i.getPos(e,h),isNaN(l)||(s?r=this._w=i.getPos(t,l)-this._x:n=this._h=e-i.getPos(e,l)-this._y)}}return isNaN(r)?r=K(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=K(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,s,i,r,n,a){let o,h,l;if(isNaN(h=this._x))switch(o=this.getOffset(n,a),h=e,this._op.align){case"center":h+=(i-n)/2+o.x;break;case"right":h+=i-o.x-n;break;default:this._anchorObj?h+=(i-n)/2+o.x:h+=o.x}else o=o||this.getOffset(n,a),h=this._x+o.x;if(isNaN(l=this._y))switch(o=o||this.getOffset(n,a),l=s,this._op.verticalAlign){case"middle":l+=(r-a)/2-o.y;break;case"bottom":l+=r-o.y-a;break;default:l+=o.y}else o=o||this.getOffset(n,a),l=this._y+o.y;return{x:h,y:l}}refresh(){this._changed(xe.REFRESHED)}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}ke.defaults=fe(xe.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Pe extends ye{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getAnnotation(t){const e=this._map[t];if(e instanceof ke)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],a=this._map={};i(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(r,t,s,e))})):s(t)&&n.push(this.$_loadItem(r,t,0,e)),n.forEach((t=>{t.name&&(a[t.name]=t)})),this.owner.options.annotation=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):T}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const a=t._getAnnotationType(r);if(!a)throw new Error("Invalid annotation type: "+e.type);const o=new a(t,i);return o.init(),o.index=s,o._load(e),o}}class Ce extends xe{}Ce.defaults=fe(xe.defaults,{minWidth:50});class Ae extends xe{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.flag=new Ce(this.axis.chart).init(),this._args={axis:void 0,pos:void 0,flag:void 0,points:void 0}}isBar(){return!this.axis.continuous()&&"line"!==this._op.type}getFlag(t,e){const s=this.axis.axisValueAt(t,e);return s instanceof Date?Mt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):gt.getFormatter(this._op.numberFormat).toStr(s)}moved(t,e,s){this._op.onChange&&(this._args.pos=t,this._args.flag=e,this._args.points=s.slice(0),this._op.onChange(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t){return r(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}Ae.defaults=fe(xe.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Le={};class Ee extends xe{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Ne extends Ee{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Ne.defaults=fe(Ee.defaults,{visible:void 0});class Me extends Ee{getRotation(){return this.axis._isHorz?0:isNaN(this._rotation)?"opposite"===this.axis.options.position?90:270:this._rotation}_isVisible(){return this._op.visible&&!W(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation)}}Me.defaults=fe(Ee.defaults,{align:"middle",offset:0,gap:5});class Te extends Ee{getRows(){const t=this.axis,e=this._op.colors,s=e?e.length:0,i=[];if(this._op.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.axisMin(),to:t.getBaseValue(),color:this._op.belowColor}),s>0){const r=t._ticks;let n=0;r[0].value>t.axisMin()&&(e[n%s]&&i.push({axis:t,from:t.axisMin(),to:r[0].value,color:e[n%s]}),n++);for(let a=1;a<r.length;a++,n++)e[n%s]&&i.push({axis:t,from:r[a-1].value,to:r[a].value,color:e[n%s]});r[r.length-1].value<t.axisMax()&&e[n%s]&&i.push({axis:t,from:r[r.length-1].value,to:t.axisMax(),color:e[n%s]})}return i}_doSetSimple(t){return n(t)?(this._op.colors=[t,null],!0):i(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Re extends Ee{_doInitChildren(t){t.rows=(this._rows=new Te(this.axis)).init()}get rows(){return this._rows}_isVisible(){return this.axis._isPolar?!1!==this._op.visible:null==this._op.visible?!this.axis._isX:this._op.visible}}Re.defaults=fe(Ee.defaults,{visible:void 0});class Oe extends ve{getDefaultIconPos(){return"left"}}Oe.defaults=fe(ve.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Be extends Ee{_doInitChildren(t){t.label=(this._label=new Oe(this.axis.chart)).init()}get label(){return this._label}canConstainedTo(t,e){const s=this._op;if(i(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(i(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}Be.defaults=fe(Ee.defaults,{front:!1,zindex:0});class De extends Be{}class $e extends Be{}class ze extends Ee{canUseNumSymbols(){return!0}_doSetSimple(t){return k.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}}ze.defaults=fe(Ee.defaults,{visible:!1,length:7,gap:3});class Fe extends ve{constructor(t){super(t&&t.chart),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)}}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){var s;const i=this._op,r=t.index;if(i.textCallback){const e=i.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?b(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?b(i.firstText,i.text):r==e-1?b(i.lastText,i.text):i.text}getLabelStyle(t,e){const i=this._op,r=t.index;if(i.styleCallback){const e=i.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(s(e))return e}return 1==e?i.lastStyle||i.firstStyle:0==r?i.firstStyle:r==e-1?i.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Fe.defaults=fe(ve.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Ie extends Ee{getThickness(){return Math.max(0,this._op.thickness)}getMinThumbSize(){return Math.max(0,this._op.minThumbSize)}getGap(){return Math.max(0,this._op.gap)}getGapFar(){return Math.max(0,this._op.gapFar)}}Ie.defaults=fe(Ee.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class He{constructor(t){this.axis=t}total(){return this.max-this.min}length(){return this.end-this.start}isFull(){return this.start===this.min&&this.end===this.max}resize(t,e,s){if((t=isNaN(t)?this.start:f(this.min,m(this.max,t)))>(e=isNaN(e)?this.end:f(t,m(this.max,e)))){const s=t;t=e,e=s}const i=this.max-this.min;if((t!==this.start||e!==this.end)&&e>t&&(isNaN(s)||(e-t)/i>=s)&&i/(e-t)>1)return this.start=t,this.end=e,!0}}class Ge extends Ne{}class je extends xe{static register(...t){t.forEach((t=>{Le[t.type]=t,t.subtype&&(Le[t.subtype]=t)}))}_animating(){return!isNaN(this._prevRate)}constructor(t,e){super(t),this._series=[],this._minPad=0,this._maxPad=0,this._values=[],this._labelArgs={},this._seriesChanged=!1,this.guides=[],this._isX=e}_doInitChildren(t){t.title=(this._title=new Me(this)).init(),t.line=(this._line=new Ne(this)).init(),t.sectorLine=(this._sectorLine=new Ge(this)).init(),t.tick=(this._tick=this._createTickModel()).init(),t.label=(this._label=this._createLabel()).init(),t.grid=(this._grid=this._createGrid()).init(),t.crosshair=(this._crosshair=new Ae(this)).init(),t.scrollBar=(this._scrollBar=new Ie(this)).init()}_type(){return this.constructor.type}get name(){return this._name}get title(){return this._title}get line(){return this._line}get sectorLine(){return this._sectorLine}get tick(){return this._tick}get label(){return this._label}get grid(){return this._grid}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get xy(){return this._isX?"x":"y"}isEmpty(){return this._isEmpty}_checkEmpty(){if(this._series.length>0)for(const t of this._series)if(!t.isEmpty(!0))return!1;return!0}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return B+D*this._op.startAngle}getTotalAngle(){return D*f(0,m(360,x(this._op.totalAngle,360)))}isArced(){return this._op.totalAngle>0&&this._op.totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach((e=>{e.visible&&t.push(...e.getVisibleSeries())})),t}unitPad(){return 0}labelsVisible(){return this._label.visible&&this._ticks.length>0}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:t}isBased(){return!1}isBaseVisible(){return this.axisMin()<this.getBaseValue()}disconnect(){this._series=[]}getSeries(){const t=[];return this._series.forEach((e=>{t.push(...e.getVisibleSeries())})),t}collectValues(){this._values=[],this._series.forEach((t=>{t.collectValues(this,t.needAxes()?this._values:null)}))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(this._values)}))}collectReferentsValues(){this._series.forEach((t=>{t.pointValuesPrepared(this)}))}_prepare(){this._isEmpty=this._checkEmpty()}_prepareRender(){var t;const e=this._op.position;this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isBetween=this.chart.isSplitted()&&"between"===e&&this._isX,this._isOpposite="opposite"===e,this._runPos=e,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),null===(t=this._label)||void 0===t||t._prepareRender();const s=this._series,i=this._values;if(this._isX&&this._prevSeries){if(!(this._seriesChanged=!k.equalArrays(s,this._prevSeries)))for(const t of s)if(t.seriesChanged()){this._seriesChanged=!0;break}}else this._seriesChanged=!1;if(this._zoom?this._range={min:this._zoom.start,max:this._zoom.end}:this._range=this._doCalculateRange(i),this._isX&&s.length>0)if(this.chart.isSplitted()){const t=[s[0]._row];for(let e=1;e<s.length;e++)t.indexOf(s[e]._row)<0&&t.push(s[e]._row);t.forEach((t=>{let e=0,i=0;s.forEach((s=>{s._row==t&&s.isClusterable()&&(e+=x(s.groupWidth(),1))})),s.forEach((s=>{if(s._row==t&&s.isClusterable()){const t=x(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=x(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=x(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+e}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[f(t,this._min),m(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new He(this),this._buildTicks(this._vlen),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return i.isFull()&&(this._zoom=null),this._zooming=!0,this._changed(),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXValue(t){return t}setPrevRate(t){this._prevRate=t}prev(t){return isNaN(this._prevRate)?t:this._op.reversed?t+(this._vlen-t)*(this._prevRate-1):t*this._prevRate}_load(t){return this.chart?super._load(this.chart.loadBase(t,this._isX?"xAxis":"yAxis",this._type())):super._load(t)}_doApply(t){const s=this,r=this.guides,n=function(t){var e;t!==s._guides&&(s._guides=t,e=i(t)?t:[t],r.length=0,e.forEach((t=>{let e;e="range"===t.type?new $e(s):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new De(s):new $e(s),e.init(),e._load(t),r.push(e)})))};super._doApply(t),this._name=t.name||`Axis ${this._index+1}`,e.call(t,"guide")?n(t.guide):e.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&!this._series.includes(t)&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?I(m(...t)||0):NaN,max:t.length>0?I(f(...t)||0):NaN}}}je.defaults=fe(xe.defaults,{row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,marginNear:0,marginFar:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>",animatable:!0,fixedSize:!1});class We extends ye{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;i(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),e.options[this.isX?"xAxis":"yAxis"]=this._items.map((t=>t.options))}contains(t){return this._items.indexOf(t)>=0}get(t){return n(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentsValues(){this._items.forEach((t=>t.collectReferentsValues()))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((e=>e._buildTicks(t)))}connect(t){const e=this._items,s=t.options,i=this.isX?s.xAxis:s.yAxis;let r;return o(i)&&i>=0&&i<e.length?r=e[i]:n(i)&&(r=e.find((t=>t.options.name===i))),r||(r=e[0]),r&&(r._connect(t),this.isX?t.setCol(x(s.col,r.options.col)):t.setRow(x(s.row,r.options.row))),r}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,s){var r;let n=t._getAxisType(e.type);if(!n){let a;if(i(e.categories))a="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){a="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){a=void 0;break}if(t.options.xAxis===s){a=void 0;break}if(W(t.options.xAxis)&&0===s){a=void 0;break}}}}else a=null===(r=t._getSeries().first)||void 0===r?void 0:r.defYAxisType();a&&(n=t._getAxisType(a))}n||(n=t._getAxisType("linear"));const a=new n(t,this.isX);return a.init(),a._load(e),a._index=s,a._isPolar=t.isPolar(),a}}class Xe{constructor(){this._axes=[]}}class Ye{constructor(t,e){this.chart=t,this.isX=e}rows(){return this._matrix.length}cols(){return this._matrix[0].length}get(t,e){return this._matrix[t][e]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((e=>e[t]))}_buildTicks(t){const e=this.isX;this._matrix.forEach(((s,i)=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.isBased()||s._buildTicks(t[e?s.options.col:s.options.row])}))}))})),this._matrix.forEach(((s,i)=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.isBased()&&s._buildTicks(t[e?s.options.col:s.options.row])}))}))}))}_calcPoints(t,e){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{const r=s?i.options.col:i.options.row;i._calcPoints(t[r],e)}))}))}))}}class Ue extends Ye{constructor(t){super(t,!0)}_prepare(t,e,s){const i=this._matrix=new Array(e+1);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<s;e++)i[t].push(new Xe)}t.forEach((t=>{const s=t.options.position;let r=t._row;"opposite"===s?(r++,t._runPos=s):r<e-1&&"between"===s?(r++,t._runPos="normal"):t._runPos=s,i[r][t._col]._axes.push(t)}))}}class Ze extends Ye{constructor(t){super(t,!1)}_prepare(t,e,s){const i=this._matrix=new Array(e);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<=s;e++)i[t].push(new Xe)}t.forEach((t=>{const e=t.options.position;let r=t._col;"opposite"===e?(r++,t._runPos=e):t._col<s-1&&"between"===e?(r++,t._runPos="normal"):t._runPos=e,i[t._row][r]._axes.push(t)}))}}class qe extends xe{_doPrepareRender(t){}}const Ke={},Qe={};class Je extends qe{constructor(){super(...arguments),this.index=-1}_type(){return this.constructor.type}get name(){return this._name}getSize(t,e){return{width:K(this._widthDim||this._sizeDim,t,t),height:K(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return K(this._leftDim,t)}getRight(t){return K(this._rightDim,t)}getTop(t){return K(this._topDim,t)}getBottom(t){return K(this._bottomDim,t)}_load(t){return this.chart?super._load(this.chart.loadBase(t,"gauge",this._type())):super._load(t)}_doApply(t){super._doApply(t),this._name=t.name||`Gauge ${this.index+1}`,this._setDims(t,"left","right","top","bottom","width","height","siz")}}Je.defaults=fe(qe.defaults,{size:"100%"});class ts extends xe{constructor(t){super(t.chart)}}class es extends Je{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{Ke[t.type]=t}))}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}es.defaults=fe(Je.defaults,{duration:500});class ss extends Je{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{Qe[t.type]=t,Qe[t.gaugeType]=t}))}get gauges(){return this._gauges.slice(0)}count(){return this._gauges.length}isEmpty(){return this._gauges.length<1}visibles(){return this._visibles.slice(0)}get(t){return this._gauges[t]}getVisible(t){return this._visibles[t]}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}_doApply(t){super._doApply(t),e.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const r=this._gaugesType();i(e)?e.forEach(((e,s)=>this.$_add(es._loadGauge(t,e,r)))):s(e)&&this.$_add(es._loadGauge(t,e,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}ss.defaults=fe(Je.defaults,{minValue:0});class is extends ye{constructor(){super(...arguments),this._map={},this._visibles=[],this._gauges=[]}get firstGauge(){return this._gauges[0]}isEmpty(t){return(t?this._visibles:this._items).length<1}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.options.row||0,r=s.options.col||0;return t===i&&e===r}))}getGauge(t){const e=this._map[t];if(e instanceof es)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,r=this._items=[],n=this._map={};i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof ss)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)})),e.options.gauge=this._gauges.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t._prepareRender()))}$_loadItem(t,e,s){let r=i(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=s,n}}class rs extends es{updateValue(t){t!==this._op.value&&(this._op.value=t,this._changed())}getLabel(t,e){return this._runValue=e,t.options.text||(t.options.prefix||"")+"${value}"+(t.options.suffix||"")}getParam(t){switch(t){case"value":return this._runValue;case"min":return this._op.minValue;case"max":return this._op.maxValue}}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}}rs.defaults=fe(es.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class ns extends xe{constructor(t){super(t.chart),this.scale=t}}ns.defaults=fe(xe.defaults,{reversed:!1,length:7});class as extends ve{getText(t){return k.isValidNum(t)?this._getText(null,t,w(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class os extends xe{constructor(t){super(t.chart),this.gauge=t}_doInitChildren(t){const e=this.chart;t.line=(this._line=new xe(e)).init(),t.tick=(this._tick=new ns(this)).init(),t.label=(this._label=new as(e)).init()}get line(){return this._line}get tick(){return this._tick}get label(){return this._label}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=x(s,e);const{min:i,max:r}=this._adjustMinMax(m(e,s),f(e,s));return this._steps=this._buildSteps(t,i,r)}buildGroupSteps(t,e){const{min:s,max:i}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,s,i)}getRate(t){return(f(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=x(s.options.minValue,t),e=x(s.options.maxValue,e),this._min=m(t,e),this._max=f(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.options.minValue,i=e.options.maxValue;return isNaN(s)&&(s=m(...t)),isNaN(i)&&(i=f(...t)),this._min=m(s,i),this._max=f(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){const i=this._op;let r;return r=Array.isArray(i.steps)?i.steps.slice(0):i.stepCount>0?this._getStepsByCount(i.stepCount,e,s):i.stepInterval>0?this._getStepsByInterval(i.stepInterval,e,s):i.stepPixels>0?this._getStepsByPixels(t,i.stepPixels,e,s):[e,s],this._min=r[0],this._max=r[r.length-1],r}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(I(e));for(let e=1;e<t;e++)n.push(I(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let a=n/(Math.floor(t/e)+1-1);const o=Math.pow(10,Math.floor(Math.log10(a))),h=this._getStepMultiples(o);let l,_=0;if(a/=o,h)if(a>h[_]){for(;_<h.length-1;_++)if(a>h[_]&&a<h[_+1]){a=h[++_];break}}else a=h[_];for(a*=o,this._step=a,r.push(I(l=s));;){if(l+=a,l>=i){r.push(I(i));break}r.push(I(l))}return r}}os.defaults=fe(xe.defaults,{position:"default",stepPixels:48,gap:8});class hs extends xe{}hs.defaults=fe(xe.defaults,{visible:!1});class ls extends xe{constructor(t){super(t.chart),this.gauge=t}_doInitChildren(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new hs(e)).init(),t.tickLabel=(this._tickLabel=new xe(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?K(this._thicknessDim,t,0):"inside"===this._op.position?t:ls.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=rt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}ls.defaults=fe(xe.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class _s extends be{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}_s.defaults=fe(be.defaults,{animatable:!0});class cs extends os{}class ds extends _s{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:K(this._offsetXDim,t,0),y:K(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}ds.defaults=fe(_s.defaults,{offsetX:0,offsetY:0});class us{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ps.DEF_CENTER),this.setCenterY(ps.DEF_CENTER),this.setRadius(ps.DEF_RADIUS),this.setInnerRadius(ps.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Z(b(t,ps.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Z(b(t,ps.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Z(b(t,ps.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Z(b(t,ps.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Z(t,!0))}getCenter(t,e){return{x:K(this._centerXDim,t,t/2),y:K(this._centerYDim,e,e/2)}}getExtents(t){const e=K(this._radiusDim,t,t/2),s=m(e,this._innerDim?K(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?K(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=x(t%360,0),i=f(0,m(360,x(e,360)));this._startRad=B+D*s,this._handRad=D*s,this._sweepRad=D*i}}class ps extends rs{_doInit(t){this._props=new us}_doInitChildren(t){t.label=(this._label=new ds(this.chart)).init()}get label(){return this._label}getProps(){return this._childProps||this._props}getCenter(t,e){return this._group?this._childProps.getCenter(t,e):this._props.getCenter(t,e)}getExtents(t){return this._group?this._childProps.getExtents(t):this._props.getExtents(t)}labelVisible(){return this._label.visible}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}setGroup(t,e){super.setGroup(t,e),t&&!this._childProps&&(this._childProps=new us)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.options.startAngle,e.options.sweepAngle):this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}ps.DEF_CENTER="50%",ps.DEF_RADIUS="40%",ps.DEF_INNER="80%",ps.defaults=fe(rs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class gs extends ss{_doInit(t){this.props=new us}_doInitChildren(t){t.label=(this._label=new ds(this.chart)).init()}get label(){return this._label}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this._op.itemGap||0;let i=t.radius;const r=(i-t.inner-s*(e-1))/e;this._visibles.forEach(((t,e)=>{const n=t._childProps;n.setRadius(i),n.setInnerRadius(i-r),i-=r+s}))}}_doApply(t){super._doApply(t);const e=this.props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}}gs.defaults=fe(ss.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let ms=class extends xe{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};ms.defaults=fe(xe.defaults,{visible:void 0});class fs extends be{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||fs.DEF_TEXT}}fs.DEF_TEXT="표시할 데이터가 없습니다.",fs.defaults=fe(xe.defaults,{visible:void 0});class ws extends xe{constructor(t){super(t),this._annotations=new Pe(this)}_doInitChildren(t){t.image=(this._image=new Ve(null)).init(),t.emptyView=(this._emptyView=new fs(this.chart)).init(),t.zoomButton=(this._zoomButton=new ms(this)).init()}anchorByName(t){const e=this.chart._getGauges().get(t);return e instanceof Je&&this.contains(e)?e:this._annotations.get(t)}get image(){return this._image}get emptyView(){return this._emptyView}get zoomButton(){return this._zoomButton}base(){return this}canZoom(){return!this.chart.isEmpty(!0)&&("x"===this._op.zoomType||"y"===this._op.zoomType||"both"===this._op.zoomType)}isEmpty(){return this.chart.isEmpty(!0)}getRadius(t,e){return K(this._radiusDim,m(t,e))}setPolar(t,e){return this._cx=K(this._centerXDim,t),this._cy=K(this._centerYDim,e),this._rd=K(this._radiusDim,m(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd}:void 0}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}contains(t){return!0}_doApply(t){const s=this,i=function(t){t!==s._anns&&(s._anns=t,s._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),e.call(t,"annotation")?i(t.annotation):e.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}ws.defaults=fe(xe.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class xs extends xe{}xs.defaults=fe(xe.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class ys extends xe{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class bs extends qe{constructor(){super(...arguments),this._items=[]}items(){return this._items.slice(0)}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return K(this._maxWidthDim,t,t)}getMaxHeight(t){return K(this._maxHeightDim,t,t)}getMarkerSize(){return x(this._op.markerSize,10)}_isVisible(){return!0===this._op.visible&&this._items.length>0||!1!==this._op.visible&&this._items.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t),this._location=b(this._op.location,"bottom"),this._items=this.chart._getLegendSources().map((t=>new ys(this,t))),this._op.reversed&&(this._items=this._items.reverse())}}bs.defaults=fe(qe.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"body",gap:6,itemGap:8,markerVisible:!0,markerSize:10,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0,pointHovering:!0});const vs={inOutSine:t=>-(d(R*t)-1)/2},Vs=function(t,e,s,i,r,n){const a=U(e,null!=s?s:"initial"),o=U(e,i),h=t.animate([a,o],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Ss{constructor(){this.delay=0,this.duration=Ss.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=m(1,f(0,I(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,s=null){this._started&&this._stop(),this.duration=x(t,Ss.DURATION),this.delay=e||0,this._easing=vs[s],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}Ss.DURATION=700,Ss.SHORT_DURATION=300;const ks=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Ps=.001,Cs=Math.PI;class As{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){const a=i>0,o=a?0:1;return r>0?n>0?(r=m(w(i)/2,s/2,r),n=m(w(i)/2,s/2,n),["M",t,e+(a?n:-n),"v",i+(a?-n-r:n+r),"a",r,r,0,0,o,r,a?r:-r,"h",s-2*r,"a",r,r,0,0,o,r,a?-r:r,"v",-i+(a?r+n:-r-n),"a",n,n,0,0,o,-n,a?-n:n,"h",2*n-s,"a",n,n,0,0,o,-n,a?n:-n,"Z"]):(r=m(w(i)/2,s/2,r),["M",t,e,"v",i+(a?-r:r),"a",r,r,0,0,o,r,a?r:-r,"h",s-2*r,"a",r,r,0,0,o,r,a?-r:r,"v",-i-r,"Z"]):n>0?(n=m(w(i)/2,s/2,n),["M",t,e+(a?n:-n),"v",i+(a?-n:+n),"h",s,"v",-i+(a?n:-n),"a",n,n,0,0,o,-n,a?-n:n,"h",2*n-s,"a",n,n,0,0,o,-n,a?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=m(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static arc(t,e,s,i,r,n,a,o=!1){const h=F(w(n-r)),l=2*Cs-h<.01,_=h-Cs<.01?0:1,c=a?1:0,p=d(r),g=u(r),m=d(n-=l?c?Ps:-.001:0),f=u(n),x=[];return x.push("M",t+s*p,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*f),l&&x.push("M",t,e),o&&x.push("Z"),x}static sector(t,e,s,i,r,n,a,o){const h=F(w(a-n)),l=2*Cs-h<Ps;let _=h-Cs<Ps?0:1;const c=o?1:0,p=d(n),g=u(n),m=d(a-=l?c?Ps:-.001:0),f=u(a),x=s*r,y=i*r,b=[];return b.push("M",t+s*p,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*f),l?b.push("M",t+x*m,e+y*f):b.push("L",t+x*m,e+y*f),isNaN(x)||b.push("A",x,y,0,_,1-c,t+x*p,e+y*g),b.push("Z"),b}static diamond(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,a=e+i/2+(i/2-i/2*u(r+6*Math.PI/5))/2,o=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,p=c/2,g=[];g.push("M",n+o*d(r),a+h*u(r));for(let t=0;t<5;t++)g.push("L",n+o*d(r),a+h*u(r),"L",n+l*d(r+p),a+_*u(r+p)),r+=c;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=As[e](0,0,2*s,2*i);break;default:r=As.circle(s,i,m(s,i))}t.setPath(r)}}class Ls extends It{static create(t,e,s,i,r,n,a=0){return new Ls(t,e,{x:s,y:i,width:r,height:n,r:a})}constructor(t,e=T,s=T){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&Object.assign({},this._rect)}set rect(t){if(t!==this._rect&&(this._rect=t&&Object.assign({},t),t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class Es extends Xt{constructor(t,e=T){super(t,e)}setBox(t,e,s,i){return this.setPath(As.box(t,e,s,i)),this}}let Ns=0;class Ms{constructor(t){this.pid=Ns++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}copy(){return Object.assign({},this)}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:i(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?(this._readObject(t,e),(i(e.drillDown)||s(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):i(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=T}getTooltip(t){var e;return t in this?this[t]:null===(e=this.source)||void 0===e?void 0:e[t]}initValues(){}initPrev(t,e){e.yValue=t.axisMin()}applyValueRate(t,e){}_assignTo(t){return l(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=+t.options.colorField;e.length>1?(this.x=e[x(t.options.xField,0)],this.y=e[x(t.options.yField,1)]):this.y=e[0],isNaN(s)||(this.color=e[s])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=v(t._yFielder(e),e.y,e.value),this.color=b(t._colorFielder(e),e.color),this.yLabel=e.yLabel}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class Ts{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}isEmpty(){return this._points.length<1}get(t){return this._points[t]}pointAt(t,e){function i(t,e,i){return s(t)?t.pid===e:t===i}return this._points.find((s=>i(t,s.pid,s.xValue)&&(void 0===e||i(e,s.pid,s.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){i(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return this._points.splice(e,1),!0}getProps(t){return this._points.map((e=>e.getProp(t)))}getCategories(t){return this._points.map((e=>e[t]))}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getPoints(t,e){const s=t._zoom;if(s){const e=this._points,i=e.length;let r=s.start,n=s.end;if(t.continuous()){let t,s,a=0;for(s=Number.MIN_VALUE;a<i-1;a++){if(t=e[a],r>=s&&r<t.xValue+(e[a+1].xValue-t.xValue)/2){r=a;break}s=t.xValue}for(r!==a&&(r=i-1),s=Number.MAX_VALUE,a=i-1;a>0;a--){if(t=e[a],n<s&&n>t.xValue-(t.xValue-e[a-1].xValue)/2){n=a;break}s=t.xValue}n!==a&&(n=0),r=f(r-1,0),n=m(n+1,i-1)}else r=f(0,Math.floor(r)),n=m(Math.ceil(n),i-1);return this._points.slice(r,n+1)}return this._points}}class Rs extends Ms{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return l(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=e.length>2?1:0;s>0&&(this.x=e[x(t.options.xField,0)]),this.y=e[x(t.options.yField,0+s)],this.z=e[x(t.options.zField,1+s)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=b(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.yValue=e.zValue=this.yValue}applyValueRate(t,e){this.zValue=V(t.zValue,this.zValue,e)}}class Os extends Ms{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return l(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[x(s.lowField,0+i)],this.y=e[y(s.highField,s.yField,1+i)],i>0&&(this.x=e[x(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=b(e[t.options.lowField],e.low),this.y=v(e[t.options.highField],e.high,this.y),this.lowLabel=e.lowLabel)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class Bs extends ze{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}Bs.defaults=fe(ze.defaults,{step:1});class Ds extends Fe{getTick(t,e){return null!=e?this._getText(e,e,!1,!1):""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}class $s extends Re{getPoints(t){const e=t._pts,s=t._ticks.length,i=[];if(s>0){const r=Math.max(1,t.tick.options.step||1);if(r>1)for(let t=0,n=1,a=e.length;t<=s&&n<a;t++,n+=r)i.push(e[n]);else for(let t=0;t<=s;t++)i.push(e[t+1])}return i}}class zs extends je{constructor(){super(...arguments),this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}getCategories(){return this._cats}xValueAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return this._catMin+e-2;return-1}getWdith(t,e){return 0}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_createGrid(){return new $s(this)}_createTickModel(){return new Bs(this)}_createLabel(){return new Ds(this)}collectValues(){this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=k.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){let t=super.getStartAngle(),e=+this._op.startOffset;return e>0&&(t-=m(e,1)*this._categories[0].w*O/this._len),t}_doPrepareRender(){const t=this._op;this._cats=[],this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=y(t.minPadding,t.padding,0),this._maxPad=y(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,x(t.categoryPadding,0))))}_doBuildTicks(t,e,s){const i=this._label;let r=this._cats=this._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const a=this._tick.options.step||1,o=[],h=t,l=e;t=this._catMin=Math.floor(t+.5),e=this._catMax=Math.ceil(e-.5);let _=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(_,this._tick.options.step||1));for(let e=-1;e>=t;e--)r.unshift(String(e)),n.unshift(1);_=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0),_+=this._catLen-r.length,n.length=r.length=this._catLen||0;const c=this._pts=[];if(_>0){let s=this._minPad;c.push(0);for(let i=t;i<=e;i++)c.push(s/_),s+=n[i-t]||1;c.push(s/_),c.push((s+this._maxPad)/_)}for(let e=1;e<c.length-2;e+=a){const s=t+e-1,r=this._categories[t+e-1];o.push({index:e-1,pos:NaN,value:s,label:i.getTick(e-1,r?r.t:s)})}return this._setMinMax(h,l),o}_calcPoints(t,e){super._calcPoints(t,e);const s=this._pts;if(e>0)for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(this._isPolar){if(e>0){const e=this._op.totalAngle*D;this._pts=s.map((s=>s/t*e))}}else{let t;t="edge"===this._tick.getPosition()?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPos(t,e){const s=this._pts,i=Math.floor(e-this._catMin+.5),r=s[i+1]+(s[i+2]-s[i+1])*(e-Math.floor(e+.5)+.5);return this._op.reversed?t-r:r}valueAt(t,e){this._op.reversed&&(e=t-e);for(let t=1;t<this._pts.length-1;t++)if(e>=this._pts[t]&&e<this._pts[t+1])return this._catMin+t-.5}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);return this._pts[s+2]-this._pts[s+2-1]}getLabelLength(t,e){const s=Math.floor(e-this._catMin+.5);return s>this._tstep?this._pts[s+2]-this._pts[s+2-this._tstep]:this._pts[s+2+this._tstep-1]-this._pts[s+2-1]}getValue(t){return o(t)?t:this._map[t]}getXValue(t){return this._cats[t-this._catMin]||t}$_collectCategories(t){const e=this._op.categories,r=this._categories=[];if(i(e)&&e.length>0)this._len=0,e.forEach((t=>{const e=null==t?1:x(t.weight,1),i=t&&t.icon;let n,a;null==t?a=n=null:s(t)?(n=b(t.name,t.label),a=b(t.label,t.name)):a=n=String(t),this._len+=e,r.push({c:n,t:a,w:e,i:i})}));else if(i(t))for(const e of t){const t=e.collectCategories(this);for(const e of t)r.find((t=>t.c===e))||r.push({c:e,w:1,t:e})}this._map={},r.forEach(((t,e)=>{null!=t.c&&(this._map[t.c]=e)}))}}zs.type="category",zs.defaults=fe(je.defaults,{padding:0,categoryPadding:.1,startOffset:0});const Fs={},Is={};class Hs extends ve{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point[e]||this._point.source[e]}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return k.isValidNum(t)?this._getText(null,t,w(t)>1e3,!0):t}getOffset(){const t=+this._op.offset;return isNaN(t)?"inside"===this._op.position?0:Hs.OFFSET:t}getDefaultIconPos(){return"top"}_isVisible(){return this._op.visible||r(this._op.visibleCallback)}_doSetSimple(t){return r(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Hs.OFFSET=4,Hs.defaults=fe(ve.defaults,{visible:void 0,position:"auto",textAlign:"center",distance:25});class Gs extends xe{constructor(t){super(t.chart),this.series=t}_doPrepareRender(t){const e=this.series,s=this._res=(e._runPoints.length-1)*Math.max(1,+this._op.resolution||5),i=e._minX>0?0:(e._maxX-e._minX)/s-e._minX,r=e._minY>0?0:(e._maxY-e._minY)/s-e._minY,n=e._runPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+i,y:t.yValue+r})));(this["_"+this._op.type]||this._linear).call(this,n,this._points=[]),this._points.forEach((t=>{t.x-=i,t.y-=r}))}isCurved(){const t=this._op.type;return!0===this._op.curved||null==this._op.curved&&("exponential"===t||"logarithmic"===t||"power"===t)}_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach((t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x}));const a=e*n-s*s,o=0===a?0:(e*r-s*i)/a;return{m:o,a:(i-o*s)/e}}_linear(t,e){const s=t.length;if(s>1){const{m:i,a:r}=this._calcLine(t);e.push({x:t[0].x,y:i*t[0].x+r}),e.push({x:t[s-1].x,y:i*t[s-1].x+r})}}_logarithmic(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:x(t.y,0)}))),{m:r,a:n}=this._calcLine(i),a=t[0].x,o=t[s-1].x,h=(o-a)/this._res;for(let t=a;t<=o;t+=h){const s=n+Math.log(t)*r;e.push({x:t,y:s})}}}_power(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:r,a:n}=this._calcLine(i),a=Math.exp(n),o=t[0].x,h=t[s-1].x,l=(h-o)/this._res;for(let t=o;t<=h;t+=l){const s=a*Math.pow(t,r);e.push({x:t,y:s})}}}_calcLine2(t){t.length;let e=0,s=0,i=0,r=0,n=0,a=0;t.forEach((t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),a+=t.x*t.y}));const o=s*i-a*a,h=Math.exp((i*r-a*n)/o);return{m:(s*n-a*r)/o,a:h}}_exponential(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:t.x,y:t.y}))),{m:r,a:n}=this._calcLine2(i),a=n,o=t[0].x,h=t[s-1].x,l=(h-o)/this._res;for(let t=o;t<=h;t+=l){const s=a*Math.exp(r*t);e.push({x:t,y:s})}}}_polynomial(t,e){const s=t.length;if(s>1){const i=[],r=[];let n=0,a=0;const o=2+1;for(let e=0;e<o;e++){for(let i=0;i<s;i++)n+=Math.pow(t[i].x,e)*t[i].y;i.push(n),n=0;const h=[];for(let i=0;i<o;i++){for(let r=0;r<s;r++)a+=Math.pow(t[r].x,e+i);h.push(a),a=0}r.push(h)}r.push(i);const h=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)w(s[t][r])>w(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,o),l=t[0].x,_=t[s-1].x,c=(_-l)/this._res;for(let t=l;t<=_;t+=c){const s=h.reduce(((e,s,i)=>e+s*Math.pow(t,i)),0);e.push({x:t,y:s})}}}_movingAverage(t,e){const s=t.length,i=f(1,m(s-1,this._op.movingInterval));let r=i;for(;r<=s;){const s=t.slice(r-i,r).reduce(((t,e)=>t+x(e.y,0)),0);e.push({x:t[r-1].x,y:s/i}),r++}}}Gs.defaults=fe(xe.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2});const js={x:"xValue",y:"yValue",z:"zValue"};class Ws extends Ss{constructor(t,e){super(),this.series=t,this.point=e,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return this.point._vr=t,this.series._changed(),!0}}class Xs extends Ms{}class Ys extends xe{constructor(){super(...arguments),this._row=0,this._col=0,this.index=-1,this.seriesIndex=0,this._simpleMode=!1}static register(...t){t.forEach((t=>{Fs[t.type]=t}))}static _loadSeries(t,e,s,i){const r=t._getSeriesType(s.type)||t._getSeriesType(i||t.type);if(!r)throw new Error("Invalid series type: "+s.type+", "+t.type);const n=new r(t);return n.init(),n.index=e,n.seriesIndex=t._seriesIndex++,n._load(s),n}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return e.getTooltip(s)||t._xAxisObj.getXValue(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getTooltip(s)}}_doInit(t){this._points=new Ts(this),this._pointArgs={}}_doInitChildren(t){t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){k.log("onDataValueChanged",e,s,i,r);const n=this._runPoints[e];if(n){const t={};t[s]=i,this.updatePoint(n,t)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){k.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){k.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){k.log("onDataChanged")}getTooltipText(t,e){return this._op.tooltipCallback?(this._getPointCallbackArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs)):this._op.tooltipText}getTooltipParam(t,e,s){return Ys.getPointTooltipParam(t,e,s)}_type(){return this.constructor.type}_viewType(){return this._type()}get name(){return this._name}get pointLabel(){return this._pointLabel}get data(){return this._data}_setData(t){t!==this._data&&(this._op.data=this._data=t,this._dataSourceDirty=!0,this._changed())}get pointCount(){return this._runPoints.length}get visiblePointCount(){return this._visPoints.length}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}_getVisiblePoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}isMarker(){return!1}displayName(){return this._op.label||this.name}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e)),this._legendMarker}legendColor(){return this._calcedColor}legendLabel(){return this._op.label||this.name}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s}canMaxPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}getVisibleSeries(){return[this]}_getNoClip(t){return this._group?this._group.options.noClip:this._op.noClip}needClip(t){const e=this._getNoClip(t);return t?!1===e:!0!==e}setCol(t){this._col=t}setRow(t){this._row=t}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(t){const e=t.getValue(this._op.xStart),s=isNaN(e)?t.getValue(this.chart._chartOptions.getXStart(t)):e;return t._zoom?Math.floor(t._zoom.start):s||0}$_getXStep(t){return b(this._op.xStep,this.chart._chartOptions.options.xStep)||1}_prepareRender(){if(this._xAxisObj=this._group?this._group._xAxisObj:this.chart._connectSeries(this,!0),this._yAxisObj=this._group?this._group._yAxisObj:this.chart._connectSeries(this,!1),this._calcedColor=void 0,this._dataSourceDirty){const t=this._doLoadData(this._data);this._loadPoints(t),this._dataSourceDirty=!1}this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this._pointLabel._prepareRender(),super._prepareRender()}prepareAfter(){this._pointsChanged=!1}collectCategories(t){if(t instanceof zs){let e=t.options.categoryField;return null!=e?this._points.getProps(e):this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>n(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);n(i)&&(i=i.trim()),this._runPoints.forEach(((r,n)=>{let a=t.getValue(r.x);isNaN(a)&&(a=s,s=t.incStep(s,i)),isNaN(a)?r.isNull=!0:(r.xValue=a,e&&e.push(a))}))}else this._runPoints.forEach(((s,i)=>{if(s.isNull)s.y=s.yGroup=s.yValue=NaN;else{let i=null==s.y?NaN:t.getValue(s.y);isNaN(i)&&(i=t.getValue(s.y)),s.initValues(),isNaN(s._vr)||(isNaN(s._prev.yValue)&&s.initPrev(t,s._prev),i=s._prev.yValue+(i-s._prev.yValue)*s._vr,s.applyValueRate(s._prev,s._vr)),isNaN(i)?s.yGroup=0:(s.yGroup=s.yValue=i,e&&e.push(i)),s.isNull=isNaN(s.yValue)}}))}collectRanges(t){var e;const s=this._visPoints,i=s.length;if(i>0){const t=this._pointArgs;let r=s[0],n=r.xValue,a=n,o=r.yValue,h=o,l=r.zValue,_=l;const c=this.hasZ();r.vindex=0;for(let t=1;t<i;t++)r=s[t],r.vindex=t,isNaN(h)&&!isNaN(r.yValue)?o=h=r.yValue:r.yValue>h?h=r.yValue:r.yValue<o&&(o=r.yValue),isNaN(a)&&!isNaN(r.xValue)?n=a=r.xValue:r.xValue>a?a=r.xValue:r.xValue<n&&(n=r.xValue);if(c)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(_)&&!isNaN(e)?l=_=e:e>_?_=e:e<l&&(l=e)}if(this._minY=o,this._maxY=h,this._minX=n,this._maxX=a,null===(e=this._trendline)||void 0===e?void 0:e.visible){this._trendline._prepareRender();const t=this._trendline._points.map((t=>t.y)).sort(((t,e)=>t-e));this._minY=Math.min(this._minY,t[0]),this._maxY=Math.max(this._maxY,t[t.length-1])}t.yMin=this._minY,t.yMax=this._maxY,t.xMin=this._minX,t.xMax=this._maxX,c&&(t.zMin=this._minZ=l,t.zMax=this._maxZ=_)}this.$_prepareViewRanges(s),isNaN(this._minY)||t.push(this._minY,this._maxY)}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=rt(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=T}))}pointValuesPrepared(t){this._referents&&this._referents.forEach((e=>e.reference(this,t))),this.visible&&(this._visPoints=this._runPoints.filter((t=>t.visible)))}reference(t,e){}getLegendSources(t){!1!==this._op.visibleInLegend&&t.push(this)}getLabelPosition(t){return t}getLabelOff(t){return t}referBy(t){t&&(this._referents?this._referents.indexOf(t)<0&&this._referents.push(t):this._referents=[t])}setPointVisible(t,e){t&&e!==t.visible&&(t.visible=e,this.chart._pointVisibleChanged(this,t))}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._argsPoint=null,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){e!==this._argsPoint&&(this._argsPoint=e).assignTo(t)}getPointText(t,e,s){let i;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),null!=i)?i:(i=t.getPointText(e),null!=i?i:s)}getPointStyle(t){if(this._op.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this._op.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(this._pointLabel.options.styleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.options.styleCallback(this._pointArgs)}pointClicked(t){if(this._op.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}pointHovered(t){this._op.onPointHover&&(t&&this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointHover(t?this._pointArgs:null))}getViewRangeAxis(){return this._op.viewRangeValue||this._defViewRangeValue()}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(e.options.visibleCallback?(this._getPointCallbackArgs(this._pointArgs,t),e.options.visibleCallback(this._pointArgs)):!0===e.visible)}getPointAt(t){return n(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:T}updatePoint(t,e){if(t instanceof Ms||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&(this.chart._dataChanged(),this.chart.animatable()&&(s.ani=new Ws(this,t),s.ani.start())),this._changed(),!!s}return!1}updateData(t){this._setData(t),this.chart._dataChanged()}addPoint(t){const e=this._doAddPoint(t);if(e){if(this._points.add(e),this.chart._dataChanged(),this.chart.animatable()){this._pointsChanged=!0;const t=e._prev=e.copy();t.ani=new Ws(this,e),t.ani.start()}this._changed()}return e}addPoints(t){const e=[];return i(t)&&t.forEach((t=>{const s=this._doAddPoint(t);s&&e.push(s)&&this._points.add(s)})),e.length>0&&(this._pointsChanged=!0,this.chart._dataChanged(),this.chart.animatable()&&e.forEach((t=>{const e=t._prev=t.copy();e.ani=new Ws(this,t),e.ani.start()})),this._changed()),e}removePoint(t){if(t instanceof Ms||(t=this.getPointAt(t)),t&&this._points.remove(t))return this._doPointRemoved(t),this._pointsChanged=!0,this.chart._dataChanged(),this._changed(),!0}removePoints(t){if(i(t)){const e=[];t.forEach((t=>{t instanceof Ms||(t=this.getPointAt(t)),t&&this._points.remove(t)&&e.push(t)})),e.length>0&&(this._doPointsRemoved(e),this._pointsChanged=!0,this.chart._dataChanged(),this._changed())}return 0}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders()}_createLabel(t){return new Hs(t)}_createPoint(t){return new Xs(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField"]}_createFielder(t){return r(t)?e=>t(e):n(t)?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach((e=>{const s=`_${e}er`;(!this[s]||e in t&&this[`_${e}`]!==t[e])&&(this[s]=this._createFielder(t[e]),this[`_${e}`]=t[e])}))}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(i(t))return t;if(t){let e;if(t._obj instanceof ht?e=t._obj:t instanceof ht&&(e=t),e)return e!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=e,this._cdata&&this._cdata._addListener(this)),e._internalValues()}}_loadPoints(t){var e,s;this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=this._runColor=o(t.color)?`var(--color-${(Math.floor(t.color)-1)%12+1})`:t.color;let s,r;i(t.pointColors)?s=t.pointColors:n(t.pointColors)?r=this.chart._assets.get(t.pointColors):this._colorByPoint()&&(s=this.chart.options.options.colors),r instanceof ue?(r.prepare(),this._runPoints.forEach(((t,s)=>{t.color=t.color||r.getNext()||e}))):i(s)?this._runPoints.forEach(((t,i)=>{t.color=t.color||s[i%s.length]||e})):this._runPoints.forEach(((t,s)=>{t.color=t.color||e})),this._preparePointArgs(this._pointArgs)}_setViewRange(t,e){const s=t[js[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=T}_defViewRangeValue(){return"y"}_canSort(){return!0}}Ys.LEGEND_MARKER="rct-legend-item-marker",Ys.defaults=fe(xe.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}:<b> ${yValue}</b>",loadAnimation:"default",hoverEffect:"default"});class Us extends ye{constructor(){super(...arguments),this._map={},this._visibles=[],this._series=[],this._visibleSeries=[]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(t){return!(t?this._visibles:this._items).find((e=>!e.isEmpty(t)))}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}_clear(){}get(t){return this._items[t]}getSeries(t){return this._map[t]}getVisibleSeries(){return this._visibleSeries.slice(0)}getPaneSeries(t,e){return this._visibleSeries.filter((s=>t===s._row&&e===s._col))}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}load(t){const e=this.chart,r=this._items=[],n=this._series=[];i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{t instanceof ri?n.push(...t.series):t instanceof Ys&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t))),e.options.series=this._items.map((t=>t.options))}add(t){const e=this.$_loadItem(this.chart,t,this._series.length);if(e)return this._items.push(e),this._series.push(e),this.$_add(e),e}remove(t){let e;if(t instanceof Ys?e=t:n(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),e.name&&delete this._map[e.name],e;if(e._group.remove(e))return e}}updateData(t){}prepareRender(){const t=[];let e=0;this._visibles=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0))),this._series.forEach((s=>{s.visible&&(!s._group||s._group.visible)&&t.push(s),s.hasShape()&&s.setShape(ks[e++%ks.length])})),this._visibleSeries=t.sort(((t,e)=>{let s=+(t.group?t.group.zOrder:t.zOrder)||0,i=+(e.group?e.group.zOrder:e.zOrder)||0;return s===i&&t.group&&t.group===e.group?(+t.zOrder||0)-(+e.zOrder||0):s-i}));const s=this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof ti&&(t._single=1===s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){let r=i(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const i=new r(t);return i.init(),i._load(e),i.index=s,i}return Ys._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Qs||(this._widget=!1),t.name&&(this._map[t.name]=t);for(const e of this._series)if(e!==t){if(!t.canMixWith(e))throw new Error("동시에 표시할 수 없는 시리즈들입니다: "+t._type()+", "+e._type());if(t._referOtherSeries(e))break}}}class Zs extends Ys{_doInitChildren(t){super._doInitChildren(t),t.trendline=(this._trendline=new Gs(this)).init()}get trendline(){return this._trendline}}Zs.defaults=fe(Ys.defaults,{});class qs extends xe{constructor(t){super(t.chart),this.series=t,this._args={}}getMarkerStyle(t){if(this._op.styleCallback)return this.series._getPointCallbackArgs(this._args,t),this._op.styleCallback(this._args)}}qs.defaults=fe(xe.defaults,{radius:3});class Ks extends Ms{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return b(this.x,this.y)}styleLegendMarker(t){}}class Qs extends Ys{getCenter(t,e){return{x:K(this._centerXDim,t),y:K(this._centerYDim,e)}}getLabelPosition(){const t=this._pointLabel.options.position;return"auto"===t?"inside":t}needAxes(){return!1}_colorByPoint(){return!0}getLegendSources(t){this._op.legendByPoint?!1!==this._op.visibleInLegend&&this._runPoints.forEach((e=>{t.push(e)})):super.getLegendSources(t)}_doApply(t){const e=this;var s,i;super._doApply(t),s=t.centerX,i=t.centerY,s!==e._centerX&&(e._centerX=s,e._centerXDim=Z(v(s,e._op.center,Qs.CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=Z(v(i,e._op.center,Qs.CENTER),!0))}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}}Qs.CENTER="50%",Qs.defaults=fe(Ys.defaults,{legendByPoint:!1,centerX:"50%",centerY:"50%"});class Js extends Qs{getRadius(t,e){return K(this._radiusDim,m(t,e))}_doApply(t){const e=this;var s;super._doApply(t),(s=t.radius)!==e._radius&&(e._radiusDim=Z(b(e._radius=s,Js.defaults.radius),!0))}}Js.defaults=fe(Qs.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class ti extends Zs{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0,this._minPointWidth=0}groupWidth(){return this._op.pointWidth}getMinPointWidth(){return this._minPointWidth}getPointWidth(t){const e=this._group;let s=t;return e?(s*=e._clusterWidth,s*=1-2*e.options.groupPadding,s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,f(this._minPointWidth,s)}getPointPos(t){const e=this._group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.options.groupPadding,s-=s*e.options.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}getLabelPosition(t){return"auto"===t?"outsideFirst":t}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this._op.pointPadding)?this._single?.25:this._group?.1:.2:Math.max(0,Math.min(.5,this._op.pointPadding)),this._minPointWidth=x(this.getMinPointWidth(),0)}}ti.defaults=fe(Ys.defaults,{pointWidth:1});class ei extends ti{_doPrepareRender(){super._doPrepareRender(),this._base=x(this._getGroupBase(),this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this._op.baseValue}isBased(t){return t===this._yAxisObj}}ei.defaults=fe(ti.defaults,{baseValue:0,nullAsBase:!1});class si extends ti{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=this._getBottomValue(t);e&&!isNaN(s)&&e.push(s)}))}}class ii extends si{}class ri extends xe{constructor(){super(...arguments),this.index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{Is[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{Is[t.seriesType]=t}))}static collectTooltipText(t,e,s){let i=t.tooltipHeader||"";return t.tooltipRow&&e.forEach(((e,r)=>{s.vindex>=e._visPoints.length||(i&&(i+="<br>"),i+=t.tooltipRow.replace("series","series."+r).replace(/\$\{/g,"${"+r+"."))})),i+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",i}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=+i.substring(0,r);return isNaN(n)||(s=(e=t[n])._visPoints[s.vindex],i=i.substring(r+1)),i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Ys.getPointTooltipParam(e,s,i)}getTooltipText(t,e){return ri.collectTooltipText(this._op,this._visibles,e)}getTooltipParam(t,e,s){return ri.inflateTooltipParam(this._visibles,t,e,s)}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(t){return(t?this._visibles:this._series).length<1}canCategorized(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}setCol(t){this._col=t,this._series.forEach((e=>e.setCol(t)))}setRow(t){this._row=t,this._series.forEach((e=>e.setRow(t)))}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this._op.layout){case"stack":this.$_collectStack(t,e);break;case"fill":this.$_collectFill(t,e);break;default:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}collectRanges(t){this._visibles.forEach((e=>{e.collectRanges(t)}))}pointValuesPrepared(t){this._series.forEach((e=>e.pointValuesPrepared(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}getLegendSources(t){var e;const s=this._op;if(!1!==s.visibleInLegend&&this.visible){const i=this._series;if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==s.layout&&"stack"!==s.layout)i.forEach((e=>e.getLegendSources(t)));else for(let e=i.length-1;e>=0;e--)i[e].getLegendSources(t)}}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s}canMaxPadding(t,e){const s=this.getBaseValue(t);return(isNaN(s)||e>s||!this.isBased(t))&&"fill"!==this._op.layout}getVisPoints(t){return this._visibles.map((e=>e._visPoints[t.vindex]))}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e._getVisiblePoints()))),t}_doApply(t){super._doApply(t),e.call(t,"children")&&this.$_loadSeries(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._series.map((t=>t.saveOptions()))}_prepareRender(){const t=this._visibles;if(this._stacked="stack"===this._op.layout||"fill"===this._op.layout,this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0))),!(this._seriesChanged=!k.equalArrays(t,this._visibles)))for(let t=this._visibles.length-1;t>=0;t--)if(this._visibles[t].seriesChanged()){this._seriesChanged=!0;break}super._prepareRender()}_doPrepareRender(t){this._xAxisObj=this.chart._connectSeries(this,!0),this._yAxisObj=this.chart._connectSeries(this,!1),this._visibles.length>0&&(this._visibles.forEach((t=>t._prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_doPrepareSeries(t){}$_loadSeries(t,e){const r=this._seriesType();i(e)?e.forEach(((e,s)=>this.$_add(Ys._loadSeries(t,this._series.length,e,r)))):s(e)&&this.$_add(Ys._loadSeries(t,this._series.length,e,r))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t);if(isNaN(s))for(const t of i.values()){t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)t[e].yGroup=t[e-1].yGroup+(t[e].yValue||0);e.push(t[t.length-1].yGroup)}else for(const t of i.values()){let i=t[0].yValue||0,r=i>=s?0:-1,n=i<s?0:-1;t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)i=t[e].yValue||0,i>=s?(r>=0&&(t[e].yGroup=t[r].yGroup+i*(i<0?-1:1)),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i*(i>=0?-1:1)),n=e);r>=0&&e.push(t[r].yGroup),n>=0&&e.push(t[n].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.options.layoutMax||100,r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce(((t,e)=>t+(e.yValue||0)),0);if(0===s){for(const e of t)e.yValue=e.yGroup=0;e.push(0)}else{let r=0;for(const e of t)r=e.yGroup=(e.yValue||0)/s*i+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(w(e.yValue)||0)),0);if(0===r){for(const e of t)e.yValue=e.yGroup=0;e.push(0,0)}else{let n=0,a=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?a=e.yGroup=(e.yValue||0)+a:n=e.yGroup=(e.yValue||0)+n;e.push(a,n)}}}}ri.defaults=fe(xe.defaults,{layout:"default",layoutMax:100,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>"});class ni extends ri{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class ai extends ri{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0}groupWidth(){return this._op.groupWidth}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}ai.defaults=fe(ri.defaults,{groupWidth:1,groupPadding:.1});class oi extends Zs{isMarker(){return!0}}oi.defaults=fe(Ys.defaults,{colorByPoint:!1});class hi extends xe{}class li extends xe{}const _i={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},ci={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},di={minPadding:0,maxPadding:0};class ui extends xe{constructor(){super(...arguments),this._dataChanged=!0}_doInitChildren(t){const e=this.chart;t.handle=(this._handle=new hi(e)).init(),t.mask=(this._mask=new li(e)).init(),t.borderLine=(this._borderLine=new xe(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return x(this._op.thickness,ui.defaults.thickness)}getGap(){return x(this._op.gap,ui.defaults.gap)}getGapFar(){return x(this._op.gapFar,ui.defaults.gapFar)}getSize(){return this.getThickness()+this.getGap()+this.getGapFar()}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const i={};if(s(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),i.series=l({},e.series,_i[t]())}else i.series=_i.area();s(e.xAxis)?i.xAxis=l({},e.xAxis,(ci[e.xAxis.type]||ci.linear)(),di):i.xAxis=l({},di),s(e.yAxis)?i.yAxis=l({},e.yAxis,(ci[e.yAxis.type]||ci.linear)(),di):i.yAxis=l(ci.linear(),di),this._chartConfig=i,this._axisType=i.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}ui.defaults=fe(xe.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class pi extends ws{constructor(t){super(t.chart),this.pane=t}base(){return this.chart._body}contains(t){return t.options.col===this.pane.col||t.options.row===this.pane.row}}pi.defaults=fe(ws.defaults,{radius:void 0,centerX:void 0,centerY:void 0});class gi extends xe{constructor(t,e,s){super(t),this.row=e,this.col=s}_doInitChildren(t){t.body=(this._body=new pi(this)).init()}get body(){return this._body}_prepareRender(){this.body._prepareRender()}}class mi extends xe{constructor(){super(...arguments),this._cols=1,this._rows=1,this._panes={},this._vcols=1,this._vrows=1,this._vpanes=[]}count(){return this._vrows*this._vcols}rowCount(){return this._vrows}colCount(){return this._vcols}paneCount(){return this._vrows*this._vcols}getPane(t,e){return this._vpanes[t][e]}getRow(t){return this._vpanes[t]}getColumn(t){return this._vpanes.map((e=>e[t]))}_doLoadProp(t,e){return["panes","cols","rows"].indexOf(t)>=0||super._doLoadProp(t,e)}_doSetSimple(t){if(i(t)&&t.length>0){const e=this._op;return e.rows=f(1,+t[0]),e.cols=f(1,x(+t[1],e.rows)),e.rows>0&&e.cols>0&&(this.$_parsePanes(e.rows,e.cols),this.visible=!0),!0}return super._doSetSimple(t)}_load(t){return super._load(t),s(t)&&(this.$_parsePanes(this._op.rows=t.rows,this._op.cols=t.cols),this._panes=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._xAxes=t._xPaneAxes,this._yAxes=t._yPaneAxes,this._vpanes=this.$_collectPanes(t),this._vpanes.forEach((t=>t.forEach((t=>t._prepareRender()))))}getXLens(t){return new Array(this._vcols).fill(t/this._vcols)}getYLens(t){return new Array(this._vrows).fill(t/this._vrows)}layoutAxes(t,e,s,i){const r=this.getXLens(s?e:t),n=this.getYLens(s?t:e);this._xAxes._buildTicks(r),this._yAxes._buildTicks(n),this.$_calcAxesPoints(r,n,0)}$_calcAxesPoints(t,e,s){this._xAxes._calcPoints(t,s),this._yAxes._calcPoints(e,s)}calcAxesPoints(t,e){this.$_calcAxesPoints(t,e,101)}calcSizes(t,e){this._widths=this.$_calcSizes(t,this._widths),this._heights=this.$_calcSizes(e,this._heights)}getAnnotation(t){for(const e in this._panes){const s=this._panes[e].body.getAnnotation(t);if(s)return s}}$_parseSizes(t){let e;return e=i(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],e.map((t=>{if(n(t)){const e=t.trim();return{size:"*"===e?1:parseFloat(e)}}return+t||{size:1}}))}$_parsePanes(t,e){this._widths=this.$_parseSizes(e),this._heights=this.$_parseSizes(t),this._cols=this._widths.length,this._rows=this._heights.length}$_loadPanes(t){const e={};return t=i(t)?t:s(t)?[t]:null,i(t)&&t.forEach((t=>{const s=+t.row||0,i=+t.col||0;if(i>=0&&i<this._cols&&s>=0&&s<this._rows){const r=new gi(this.chart,s,i);r.init(),r._load(t),e[s+","+i]=r}})),e}$_collectPanes(t){const e=t._getXAxes()._internalItems(),s=t._getYAxes()._internalItems(),i=[],r=[],n=[];e.concat(s).forEach((t=>{const e=t.options.row||0,s=t.options.col||0;t._row=e,t._col=s,s>=0&&s<this._cols&&i.indexOf(s)<0&&i.push(s),e>=0&&e<this._rows&&r.indexOf(e)<0&&r.push(e)})),i.sort(),r.sort();for(let e=0;e<r.length;e++){const s=[];for(let r=0;r<i.length;r++){const i=this._panes[e+","+r]||new gi(t,e,r)._initObject();s.push(i)}n.push(s)}return this._vrows=n.length,this._vcols=n[0].length,n}$_calcSizes(t,e){}}mi.defaults=fe(xe.defaults,{visible:!1,gap:0});class fi extends xe{_isVisible(){return this._op.visible&&!W(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}fi.defaults=fe(xe.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10});class wi extends fi{}wi.defaults=fe(fi.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class xi extends xe{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)}}setTarget(t,e,s){let i=b(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followPointer())}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?gt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Mt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}xi.defaults=fe(xe.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class yi extends ke{_isVisible(){return this._op.visible&&!W(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}yi.type="image";class bi extends ke{getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this._op.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}getShape(){return this._op.shape||bi.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}bi.type="shape",bi.defaults=fe(ke.defaults,{width:64,height:64,shape:"square"});class vi extends ke{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!W(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?gt.getFormatter(s):T),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Mt.getFormatter(t):T)}(t.timeFormat)}}vi.type="text",vi.defaults=fe(ke.defaults,{text:"Text"});class Vi extends Re{getPoints(t,e){return t.hasBreak()?t._ticks.filter((e=>!t.isBreak(e.value))).map((s=>t.getPos(e,s.value))):t._ticks.map((s=>t.getPos(e,s.value)))}}class Si extends ze{constructor(){super(...arguments),this._strictEnds=!1,this._strictTicks=!1}_isValidInterval(t){return t>0}_normalizeSteps(t,e,s){return t}buildSteps(t,e,s,n,a=!1){var o,h;const l=this._op;let _;return this._strictTicks=this._strictEnds=!1,this._step=NaN,a?_=this._getStepsByPixels(t,x(.85*l.stepPixels,60),e,s,n):i(l.steps)||r(l.stepCallback)?(_=l.stepCallback?l.stepCallback.call(T,{length:t,minValue:s,maxValue:n}):l.steps.slice(0),_.length>0&&isNaN(_[0])&&(_[0]=s),_.length>1&&isNaN(_[_.length-1])&&(_[_.length-1]=n),this._strictTicks=this._strictEnds=!0):_=this._baseAxis instanceof Li&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,e,s,n,!0):l.stepCount>0?this._getStepsByCount(l.stepCount,e,s,n,!1):this._isValidInterval(l.stepInterval)?this._getStepsByInterval(l.stepInterval,e,s,n):l.stepPixels>0?this._getStepsByPixels(t,((null===(o=this.axis)||void 0===o?void 0:o._isPolar)&&!(null===(h=this.axis)||void 0===h?void 0:h._isX)?.5:1)*l.stepPixels,e,s,n):s!==n?[s,n]:[s],_}getNextStep(t,e){return t+e*this._step}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_findBaseAxis(){if(null!=this._op.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this._op.baseAxis);e!==t&&e instanceof Li&&(this._baseAxis=e,e.tick._baseAxis=null)}}$_normalizeMin(t,e){return t>_(t/e)*e?t=_(t/e)*e:t<c(t/e)*e&&(t=c(t/e)*e),I(t)}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,a=i-s;let o=a/(t-1);const h=Math.pow(10,Math.floor(Math.log10(o))),l=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&o/h==2.5&&_(t*a/o)==t*a/o?this._step=o:o=this._step=c(o/h)*h:o=a/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this.$_normalizeMin(s,h);else{for(st(s<e&&i>e,"base error"),t=f(3,t);;){if(!(c((e-s)/o)+c((i-e)/o)+1>t))break;o+=h}s=e-c((e-s)/o)*o}else s=n._fixedMin;l.push(s);for(let e=1;e<t;e++)l.push(I(l[e-1]+o));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=this.$_normalizeMin(s,t),isNaN(e))for(r.push(n=s);n<i;)r.push(n=I(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=I(n-t));for(n=e;n<i;)r.push(n=I(n+t))}return this._step=t,r}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i,r){i>=s?i=s:r<=s&&(r=s);const n=r-i,a=[];if(0===n)return isNaN(i)?[]:[i];let o=t>250?5:t>200?4:t>150?3:t>80?2:1,h=f(this.axis._isX?1:o,_(t/e))+1,l=n/(h-1);const d=Math.pow(10,Math.floor(g(l))),u=this._getStepMultiples(d);let p,m=0;if(l/=d,u)if(l>u[m]){for(;m<u.length-1;m++)if(l>u[m]&&l<u[m+1]){l=u[++m];break}}else l=u[m];if(l*=d,isNaN(s))i=this.$_normalizeMin(i,l);else{for(st(i<=s&&r>=s,"base error"),h=f(3,h);m<u.length;){if(!(c((s-i)/l)+c((r-s)/l)+1>h))break;l=m<u.length-1?u[m+1]*d:2*l,m++}i=s-c((s-i)/l)*l}for(this._step=l,a.push(I(p=i));p<r;)a.push(I(p+=l));return a}}Si.defaults=fe(ze.defaults,{stepPixels:72,baseRange:!1});class ki extends Fe{}ki.defaults=fe(Fe.defaults,{numberFormat:"0.##"});class Pi extends ki{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!0)}}Pi.defaults=fe(ki.defaults,{useSymbols:!0});class Ci extends Ee{getSize(t){return K(this._sizeDim,t)}_doApply(t){super._doApply(t),this._op.space=x(this._op.space,0),this._sizeDim=Z(this._op.size,!1)}}Ci.defaults=fe(Ee.defaults,{enabled:!0,size:"30%",space:16,gridVisible:!0});class Ai extends Ne{}Ai.defaults=fe(Ne.defaults,{visible:!1});class Li extends je{constructor(){super(...arguments),this._breaks=[]}_doInitChildren(t){super._doInitChildren(t),t.baseLine=(this._baseLine=new Ai(this)).init()}get baseLine(){return this._baseLine}get tick(){return this._tick}get grid(){return this._grid}getBaseValue(){return this._op.baseValue}hasBreak(){return null!=this._runBreaks}_getBreaks(){return this._runBreaks?this._runBreaks.slice(0,1):[]}isBreak(t){if(this._runBreaks){const e=this._runBreaks[0];return!e.options.gridVisible&&(t===e.options.from||t===e.options.to)}}_doApply(t){super._doApply(t),e.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new Vi(this)}_createTickModel(){return new Si(this)}_doPrepareRender(){this._baseVal=parseFloat(this._op.baseValue),this._tick._findBaseAxis()}_doBuildTicks(t,e,s){if(isNaN(t)||isNaN(e))return[];const i=this._tick,r=i._baseAxis instanceof Li&&i._baseAxis._ticks.length>0;let n,{min:a,max:o}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e),h=this._baseVal;if(isNaN(h)&&a<0&&o>0&&(h=0),isNaN(h)?a<0&&o>0&&(h=0):(a=Math.min(a,h),o=Math.max(o,h)),r&&i.options.baseRange&&(a=i._baseAxis.axisMin(),o=i._baseAxis.axisMax()),a===o)n=[a];else if(n=i.buildSteps(s,h,a,o,!1),n.length>0){if(i._strictTicks||(n=i._normalizeSteps(n,a,o)),!isNaN(this._fixedMin)||!i._strictEnds&&"tick"!==this._getStartFit())for(;n.length>2&&n[0]<a;)n.shift();else if(!i._strictEnds&&!r){for(;n.length>2&&n[1]<=a;)n.shift();if(!isNaN(i._step))for(;n[0]>a;)n.unshift(i.getNextStep(n[0],-1))}if(a=Math.min(a,n[0]),!isNaN(this._op.strictMax)||!i._strictEnds&&"tick"!==this._getEndFit())for(;n.length>2&&o<n[n.length-1];)n.pop();else if(!i._strictEnds&&!r){for(;n.length>2&&n[n.length-2]>=o;)n.pop();if(!isNaN(i._step))for(;n[n.length-1]<o;)n.push(i.getNextStep(n[n.length-1],1))}o=Math.max(o,n[n.length-1])}else n.push(a+(o-a)/2);this._setMinMax(a,o);const l=[];this._runBreaks&&(n=this.$_getBrokenSteps(this._runBreaks,s,a,o));let _=NaN;for(let t=0;t<n.length;t++){const e=this._createTick(s,t,n[t]);e.value!==_&&(l.push(e),_=e.value)}return l}_createTick(t,e,s){return{index:e,pos:NaN,value:I(s),label:this.label.getTick(e,s)||String(s)}}_calcPoints(t,e){if(e>100&&this._isX)if(this._min===this._max)this._unitLen=t/4;else{const e=this.$_calcUnitLength(this._isPolar?this.getTotalAngle():t);e&&(this._unitLen=e.len,this._isPolar||this._zoom||(this._min-=e.min/2,this._max+=e.min/2))}super._calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this._tick.buildSteps(t.len,void 0,t.from,t.to,!0)}$_getBrokenSteps(t,e,s,i){let r=0,n=s;const a=[n],o=this._sects=[];e-=t.reduce(((t,e)=>t+e.options.space),0),t.forEach((t=>{const s=t.options,i=t.getSize(e),h={from:n,to:t.options.from,pos:r,len:i};r+=i,o.push(h,t._sect={from:s.from,to:s.to,pos:r,len:s.space}),r+=s.space;this.$_buildBrokenSteps(h).forEach((t=>{t>h.from&&t<=h.to&&a.push(t)})),s.space>0&&a.push(s.to)}));const h=t[t.length-1];if(i>h.options.to){const t={from:h.options.to,to:i,pos:r,len:this._vlen-r};o.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&e<=t.to&&a.push(e)}))}return this._lastSect=o[o.length-1],a}getPos(t,e){if(this._runBreaks){const s=this._sects.find((t=>e<t.to))||this._lastSect,i=s.len*(e-s.from)/(s.to-s.from);return this._op.reversed?H(t-i-s.pos):H(i+s.pos)}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return H(this._op.reversed?t-s:s)}}valueAt(t,e){if(this._isHorz?this._op.reversed&&(e=t-e):this._op.reversed||(e=t-e),this._runBreaks){let t=0;for(const s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_getStartFit(){return"default"===this._op.startFit?this._isX?"value":"tick":this._op.startFit}_getEndFit(){return"default"===this._op.endFit?this._isX?"value":"tick":this._op.endFit}_adjustMinMax(t,e,s){const i=this._op;let r=this.isZoomed(),n=this.isZoomed(),a=!0,o=!0,h=NaN,l=NaN;this._series.forEach((t=>{const _=t.getBaseValue(this);isNaN(_)||(isNaN(i.minValue)&&_<=e?t.isBased(this)?e=_:h=x(m(h,_),_):isNaN(i.maxValue)&&_>=s&&(t.isBased(this)?s=_:l=x(f(l,_),_))),!r&&a&&t.canMinPadding(this,e)&&(a=!1),!n&&o&&t.canMaxPadding(this,s)&&(o=!1)})),r||(r=a),n||(n=o),this._fixedMin=this._fixedMax=NaN;let _=0,c=0;isNaN(i.strictMin)?i.minValue<e?e=i.minValue:r?this._fixedMin=e:_=y(i.minPadding,i.padding,0):this._fixedMin=e=i.strictMin,isNaN(i.strictMax)?i.maxValue>s?s=i.maxValue:n?this._fixedMax=s:c=y(i.maxPadding,i.padding,0):this._fixedMax=s=i.strictMax;let d=f(0,s-e),u=e-d*(this._minPad=_),p=s+d*(this._maxPad=c);return!isNaN(h)&&h<=e&&u<h&&(u=this._fixedMin=h),!isNaN(l)&&l>=s&&p>l&&(p=this._fixedMax=l),{min:u,max:p}}$_calcUnitLength(t){const e=[];if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&e.push(...t._getVisiblePoints())})),e.length>0){const s=this._isX;let i=e.map((t=>s?t.xValue:t.yValue)).sort(((t,e)=>t-e));for(let t=i.length-1;t>0;t--)i[t]===i[t-1]&&i.splice(t,1);return this._calcUnitLen(i,t,this._min,this._max)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/this._ticks.length;return{len:x(e*=t/(i-s+t),1),min:t}}return{len:e,min:0}}{let r=t[1]-t[0];for(let e=2;e<t.length;e++)r=m(r,t[e]-t[e-1]);return{len:x(e*=r/(i-s+r),1),min:r}}}$_loadBreak(t){if(s(t)&&"from"in t&&"to"in t){const e=new Ci(this);return e.init(),e._load(t),e}}$_loadBreaks(t){if(i(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.options.to=e.options.to}const e=this._breaks.sort(((t,e)=>t.options.from-e.options.from)).filter((t=>t.options.to>t.options.from));if(this._runBreaks=null,e.length>0){const i=this._runBreaks=[];i.push(l(new Ci(this)._initObject(),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],a=e[r];s=n,a.options.from<s.options.to?t(n,a):i.push(l(new Ci(this)._initObject(),a))}}var s}}Li.defaults=fe(je.defaults,{nullable:!0,padding:.04,startFit:"default",endFit:"default"});class Ei extends Li{get label(){return this._label}_createLabel(){return new Pi(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof ri&&"fill"===r[0].options.layout&&(i.max=r[0].options.layoutMax),i}}Ei.type="linear";class Ni extends Si{canUseNumSymbols(){return this.axis.axisMax()>g(500)}_getStepMultiples(t){return[1,2,5,10]}_normalizeSteps(t,e,s){if(!this._op.arrangeDecimals)return t;const i=[];let r=s-e;for(let e=0;e<t.length;e++){const n=i.length;let a=t[e],o=_(a);if(a===o){let t=i[n-1];e>1&&a-t<r&&(t=Math.pow(10,t),_(t)!==I(t)&&i.pop()),i.push(a)}else if(a>0&&a>o){if(a=o+g(10*(a-o)),a<=s)(0===n||a>i[n-1])&&i.push(a);else if(n>0){if(i[e-1]>=s)break;{const r=p(_(g(t[e]-t[e-1]))),n=t[e],o=n-_(n);if(r<1)for(let t=1;t<10;t++)if(o>g(t)&&o<g(t+1)){const e=_(n)+g(t);if(e>=s){a=e;break}}i.push(a)}}}else if(e>0&&a<=s&&a>i[n-1])i.push(a);else if(a>s)break;i.length>1&&(r=Math.min(.5,r,i[i.length-1]-i[i.length-2]))}return i}}Ni.defaults=fe(Si.defaults,{arrangeDecimals:!0});class Mi extends Li{_createLabel(){return new Pi(this)}_createTickModel(){return new Ni(this)}collectValues(){super.collectValues(),this._values=this._values.filter((t=>t>0))}getPos(t,e){return e=e>0?g(e):-1,super.getPos(t,e)}_doCalculateRange(t){const e=super._doCalculateRange(t);return e.min=g(e.min),e.max=g(e.max),e}_createTick(t,e,s){return super._createTick(t,e,I(p(s)))}_calcUnitLen(t,e,s,i){let r=g(t[1])-g(t[0]);for(let e=2;e<t.length;e++)r=m(r,g(t[e])-g(t[e-1]));const n=i-s,a=r/n;return{len:x(e*=a,1),min:n*a}}}Mi.type="log";const Ti=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Ri=[[1,2,5,10,20,25,50,100,200,250,500],[1,2,5,10,15,30],[1,2,3,4,6,8,12],[1,2,3,4,6,12],[1,2],[1,2],[1,2,3,4,6]],Oi={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Bi extends Si{getNextStep(t,e){const s=new Date(t);switch(e*=this._step,this._scale){case 7:s.setFullYear(s.getFullYear()+e);break;case 6:s.setMonth(s.getMonth()+e);break;case 5:s.setDate(s.getDate()+7*e);break;case 4:s.setDate(s.getDate()+e);break;case 3:s.setHours(s.getHours()+e);break;case 2:s.setMinutes(s.getMinutes()+e);break;case 1:s.setSeconds(s.getSeconds()+e);break;case 0:s.setMilliseconds(s.getMilliseconds()+e)}return+s}_isValidInterval(t){return isNaN(t)?n(t)&&Oi.hasOwnProperty(t.charAt(t.length-1))?(t=parseFloat(t),!isNaN(t)&&(t<=-1||t>=1)):void 0:0!=+t}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Ti[e]/2&&t<Ti[e+1]/2)return this._scale=e,Ri[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],a=r-i;if(0===a)return n;const o=this.axis,h=new Date(o._calcedMin);let l=Math.floor(t/this._op.stepPixels)+1,_=f(1,Math.floor(a/(l-1)));const c=this._getStepMultiples(_),d=Ti[this._scale];if(_/=d,c)if(_>c[0]){let t=0;for(;t<c.length-1;t++)if(_>c[t]&&_<c[t+1]){_=c[t+1];break}}else _=c[0];const u=o.date(i),p=o.date(r);let g,m=u;if(7===this._scale){const t=h.getFullYear();let e=m.getFullYear();this._step=_=Math.ceil(_),m=new Date(e,0),e<t&&e+_>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=_,m=new Date(e,0)}while(m<=p)}else if(6===this._scale){let t=m.getFullYear(),e=m.getMonth();this._step=_=Math.ceil(_),m=new Date(t,e),m<h&&new Date(t,e+_)>h&&(e=h.getMonth(),m=new Date(h.getFullYear(),e));do{n.push(+m),m.setMonth(m.getMonth()+_)}while(m<=p)}else if(4===this._scale||5===this._scale){let t=m.getFullYear(),e=m.getMonth(),s=m.getDate();const i=5===this._scale?7:1;this._step=_=Math.ceil(_),m=new Date(t,e,s),m<h&&new Date(t,e,s+i*_)>h&&(s=h.getDate(),m=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+m),m.setDate(m.getDate()+_*i)}while(m<=p)}else{switch(this._step=_,_*=d,this._scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}g=m.getTime();const t=h.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,s,i){if(n(t)){const r=this.axis,n=new Date(r._calcedMin),a=[],o=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=Oi[o],t=Ti[this._scale];let c=new Date(s);switch(this._scale){case 7:const t=n.getFullYear();let e=c.getFullYear();c.setMonth(0,1),e<t&&t<e+h&&(c=new Date(t,0));break;case 6:c.setDate(1),c.setHours(0,0,0,0),_=new Date(c),_.setMonth(_.getMonth()+h),c<n&&n<_&&(c=new Date(n),c.setDate(1),c.setHours(0,0,0,0));break;case 5:case 4:let s=5===this._scale?7:1;c.setHours(0,0,0,0),_=new Date(c),_.setDate(_.getDate()+h*s),c<n&&_>n&&(c=new Date(n),c.setHours(0,0,0,0));break;case 3:c.setMinutes(0);case 2:c.setSeconds(0);case 1:c.setMilliseconds(0)}if(this._step=h,s=+c,isNaN(e))for(a.push(l=s);l<i;)a.push(l=this.getNextStep(l,1));else{for(a.push(l=e);l>s;)a.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)a.push(l=this.getNextStep(l,1))}return this._step=t,a}return super._getStepsByInterval(t,e,s,i)}}const Di=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd HH:mm"},{format:"MM-dd",beginningFormat:"yyyy-MM-dd"},{format:"MM W주",beginningFormat:"yyyy-MM-dd"},{format:"yyyy-MM",beginningFormat:"yyyy-MM"},{format:"yyyy",beginningFormat:"yyyy"}];class $i extends ki{_doApply(t){super._doApply(t);const e=n(t.timeFormat)?t.timeFormat:void 0,r=n(t.beginningFormat)?t.beginningFormat:void 0,o=t.timeFormats,h=t.useBeginningFormat;if(this._formats=Di.map((t=>l(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&r&&this._formats.forEach((t=>{t.beginningFormat=r})),i(o))for(let t=0;t<o.length;t++){const e=this._formats[t],i=o[t];a(i)?e.format=i:s(i)&&(a(i.format)&&(e.format=i.format),h&&a(i.beginningFormat)&&(e.beginningFormat=i.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);if(this._formatter)return this._formatter.toStr(r,s.startOfWeek);const n=this._formats,a=i.tick._scale,o=Mt.getFormatter;switch(a){case 7:return o(n[a].format).toStr(r,s.startOfWeek);case 6:return 0===t||0===r.getMonth()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 5:case 4:return 0===t||1===r.getDate()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 3:return 0===t||0===r.getHours()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 2:return 0===t||0===r.getMinutes()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 1:return 0===t||0===r.getSeconds()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 0:return 0===t||0===r.getMilliseconds()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek)}}}$i.defaults=fe(ki.defaults,{useBeginningFormat:!0});class zi extends Li{get label(){return this._label}_createTickModel(){return new Bi(this)}_createLabel(){return new $i(this)}collectValues(){this._offset=60*x(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return o(t)?t:t instanceof Date?t.getTime():n(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(n(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXValue(t){return isNaN(t)?NaN:new Date(t)}}zi.type="time",zi.subtype="date",zi.defaults=fe(Li.defaults,{baseValue:NaN});const Fi="bullet",Ii="circle",Hi="linear";class Gi extends _s{getWidth(t){return K(this._widthDim,t)}getHeight(t){return K(this._heightDim,t)}getMaxWidth(t){return K(this._maxWidthDim,t)}getMaxHeight(t){return K(this._maxHeightDim,t)}getGap(t){return K(this._gapDim,t,0)}_doApply(t){super._doApply(t),this._setDims(t,"width","height","maxWidth","maxHeight","gap")}}Gi.defaults=fe(_s.defaults,{maxWidth:"30%",maxHeight:"30%",gap:10});class ji extends rs{_doInitChildren(t){super._doInitChildren(t),t.label=(this._label=new Gi(this.chart)).init(),t.scale=(this._scale=new cs(this)).init()}get label(){return this._label}get scale(){return this._scale}isVertical(){return this._group?this._group.options.vertical:this._op.vertical}scaleVisible(){return!this._group&&this._scale.visible}calcedMinMax(){return this._scale.range()}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}}ji.defaults=fe(rs.defaults,{reversed:!1});class Wi extends ts{constructor(){super(...arguments),this._args={gauge:null,value:NaN}}getStyle(t,e){if(this._op.styleCallback){this._args.gauge=t,this._args.value=e;return this._op.styleCallback(this._args)}}}class Xi extends ji{_doInitChildren(t){super._doInitChildren(t),t.valueBar=(this._valueBar=new Wi(this)).init(),t.band=(this._band=new ls(this)).init()}get valueBar(){return this._valueBar}get band(){return this._band}}Xi.type=Hi;class Yi extends xe{}Yi.defaults=fe(xe.defaults,{opposite:!1,gap:10});class Ui extends Gi{}Ui.defaults=fe(Gi.defaults,{gap:10});class Zi extends ss{_doInitChildren(t){super._doInitChildren(t),t.label=(this._label=new Ui(this.chart)).init(),t.itemLabel=(this._itemLabel=new Yi(this.chart)).init(),t.scale=(this._scale=new cs(this)).init()}get label(){return this._label}get itemLabel(){return this._itemLabel}get scale(){return this._scale}calcedMinMax(){return this.scale.range()}}Zi.defaults=fe(ss.defaults,{vertical:!1,itemGap:10});class qi extends Zi{_doInitChildren(t){super._doInitChildren(t),t.band=(this._band=new ls(this)).init()}get band(){return this._band}_gaugesType(){return"linear"}_doPrepareRender(t){super._doPrepareRender(t),this.band.visible&&this.band._prepareRender()}}qi.type="lineargroup",qi.gaugeType=Hi;class Ki extends xe{constructor(t){super(t.chart),this.gauge=t}getRanges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null)}$_internalRanges(){if(!this._runRanges){const t=this.gauge.options;this._runRanges=rt(this._ranges,t.minValue,t.maxValue,this._op.rangeInclusive)}return this._runRanges}}Ki.defaults=fe(xe.defaults,{vertical:!0,rangeInclusive:!0});class Qi extends ts{}Qi.defaults=fe(xe.defaults,{visible:!0});class Ji extends Wi{}class tr extends ji{_doInitChildren(t){super._doInitChildren(t),t.band=(this._band=new Ki(this)).init(),t.targetBar=(this._targetBar=new Qi(this)).init(),t.valueBar=(this._valueBar=new Ji(this)).init()}get band(){return this._band}get targetBar(){return this._targetBar}get valueBar(){return this._valueBar}getRanges(t,e,s){return rt(this._op.ranges,t,e,b(s,this._op.rangeInclusive))}}tr.type=Fi,tr.defaults=fe(ji.defaults,{rangeInclusive:!0});class er extends Zi{getRanges(t,e,s){return rt(this._op.ranges,t,e,b(s,this._op.rangeInclusive))}_gaugesType(){return"bullet"}}er.type="bulletgroup",er.gaugeType=Fi,er.defaults=fe(Zi.defaults,{rangeInclusive:!0});class sr extends ts{getRange(t,e){const s=this.$_internalRanges(t);if(s)for(const t of s)if(e>=t.fromValue&&e<t.toValue)return t}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null)}$_internalRanges(t){return this._runRanges||(this._runRanges=rt(this._ranges,t.minValue,t.maxValue,this._op.rangeInclusive)),this._runRanges}}sr.defaults=fe(xe.defaults,{rangeInclusive:!0});class ir extends sr{getSegmentThickness(t){return K(this._segmentThicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentThickness")}}ir.defaults=fe(sr.defaults,{segmentGap:0});class rr extends sr{getThickness(t){return K(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}rr.defaults=fe(sr.defaults,{thickness:"100%",stroked:!1});(class extends ts{}).defaults=fe(xe.defaults,{visible:!1});class nr extends ts{getExtents(t){return{radius:K(this._radiusDim,t,0),length:K(this._lengthDim,t,0),offset:K(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}nr.defaults=fe(xe.defaults,{visible:!1,radius:3,length:"100%",offset:0});class ar extends ts{getRadius(t){return K(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}ar.defaults=fe(xe.defaults,{visible:!1,radius:5});class or extends os{_getStepMultiples(t){return[1,2,2.5,5,10]}}or.defaults=fe(os.defaults,{visible:!1,stepPixels:72});class hr extends ps{_doInitChildren(t){super._doInitChildren(t),t.band=(this._band=new ls(this)).init(),t.scale=(this._scale=new or(this)).init(),t.rim=(this._rim=new ir(this)).init(),t.valueRim=(this._valueRim=new rr(this)).init(),t.hand=(this._hand=new nr(this)).init(),t.pin=(this._pin=new ar(this)).init()}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}getExtents(t){const e=super.getExtents(t),s=this.scale,i=this.band;let r=e.radius;const n=r-e.inner;if(i.visible)switch(e.bandThick=i.getThickness(n),i.options.position){case"inside":e.band=r-(n-e.bandThick)/2;break;case"opposite":e.band=e.inner-i.options.gap,e.inner=e.band-e.bandThick;break;default:e.band=r+=e.bandThick+i.options.gap}if(e.scaleTick=f(1,s.tick.options.length||0),e.scaleLabel=16,"opposite"===s.options.position)e.scale=e.inner-s.options.gap,e.inner=e.scale-e.scaleTick-e.scaleLabel;else e.scale=r+s.options.gap;return e}}hr.type=Ii;class lr extends gs{_gaugesType(){return"circle"}}lr.type="circlegroup",lr.gaugeType=Ii,lr.defaults=fe(gs.defaults,{innerRadius:"50%"});class _r extends ts{getThickness(t){return K(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}_r.defaults=fe(xe.defaults,{thickness:7});class cr extends ts{getLength(t){return K(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}cr.defaults=fe(xe.defaults,{thickness:7,length:"60%"});class dr extends cr{}dr.defaults=fe(cr.defaults,{thickness:5,length:"85%"});class ur extends cr{}ur.defaults=fe(cr.defaults,{thickness:2,length:"95%",animatable:!1,duration:200});class pr extends ts{constructor(t,e){super(t),this.length=e}}class gr extends ts{}gr.defaults=fe(xe.defaults,{step:1,offset:1});class mr extends ts{constructor(t,e){super(t),this.raidus=e}}class fr extends be{constructor(t){super(t.chart)}}fr.defaults=fe(be.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"});class wr extends es{_doInitChildren(t){super._doInitChildren(t),t.rim=(this.rim=new _r(this)).init(),t.hourHand=(this.hourHand=new cr(this)).init(),t.minuteHand=(this.minuteHand=new dr(this)).init(),t.secondHand=(this.secondHand=new ur(this)).init(),t.tick=(this.tick=new pr(this,10)).init(),t.minorTick=(this.minorTick=new pr(this,5)).init(),t.tickLabel=(this.tickLabel=new gr(this)).init(),t.pin=(this.pin=new mr(this,5)).init(),t.label=(this.label=new fr(this)).init()}getTime(){const t=this._op;return t.time instanceof Date?t.time:n(t.time)?new Date(t.time):isNaN(t.time)?void 0:new Date(t.time)}getExtents(t,e){const s=m(t,e);return{cx:K(this._centerXDim,t,t/2),cy:K(this._centerYDim,e,e/3),rd:K(this._radiusDim,s,s/2)}}_doApply(t){const e=this;var s,i,r;super._doApply(t),s=t.centerX,i=t.centerY,r=t.radius,(e._centerXDim||s!==e._centerX)&&(e._centerXDim=Z(b(e._centerX=s,ps.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=Z(b(e._centerY=i,ps.DEF_CENTER),!0)),e._radiusDim&&r===e._radius||(e._radiusDim=Z(b(e._radius=r,ps.DEF_RADIUS),!0))}}wr.type="clock",wr.defaults=fe(es.defaults,{centerX:"50%",centerY:"50%",radius:"40%",active:!0});const xr="line",yr="area",br="circlebar";class vr extends ii{pointLabelCount(){return 2}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Os(t)}_getBottomValue(t){return t.lowValue}}vr.type="barrange",vr.defaults=fe(ii.defaults,{tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Vr extends Ms{}class Sr extends ei{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Vr(t)}_getGroupBase(){return this._group?this._group.options.baseValue:this._op.baseValue}}Sr.defaults=fe(ei.defaults,{colorByPoint:!1});class kr extends Sr{_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}}kr.type="bar";class Pr extends ai{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:x(this._op.baseValue,t.getBaseValue())}_doPrepareSeries(t){if("default"===this._op.layout){const e=t.length>1?t.map((t=>t.options.pointWidth)).reduce(((t,e)=>t+e),0):t[0].options.pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.options.pointWidth/e,t._childPos=s,s+=t._childWidth}))}else this._op.layout}}Pr.defaults=fe(ai.defaults,{baseValue:0});class Cr extends Pr{_canContain(t){return t instanceof kr}}Cr.type="bargroup",Cr.seriesType="bar";class Ar extends It{constructor(t,e){super(t,Ys.LEGEND_MARKER),this._size=e,this.add(this._marker=new Xt(t)),this.setShape("circle",12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}_renderShape(t){As.setShape(this._marker,this._shape,t/2,t/2),this._marker.trans(this._markerOffset(t),0)}_markerOffset(t){return 0}}class Lr extends Ar{constructor(t,e){super(t,e),this.insertFirst(this._line=new Xt(t)),this.insertFirst(this._area=new Xt(t)),this._area.setBoolData("fill",!0)}_renderShape(t){super._renderShape(t);const e=["M",0,.5*t,"L",2*t,0],s=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(e.join(" ")),this._area.setPath(s.join(" ")))}_markerOffset(t){return t/2}}class Er extends Ar{constructor(t,e){super(t,e),this.insertFirst(this._line=new Xt(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Xt(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Xt(t)),this._area.setBoolData("fill",!0)}_renderShape(t){super._renderShape(t);const e=["M",0,.3*t,"L",.7*t,0,"L",2*t,.4*t],s=["M",0,t,"L",t,.7*t,"L",2*t,t],i=["M",0,.3*t,"L",.7*t,0,"L",2*t,.4*t,"L",2*t,t,"L",t,.7*t,"L",0,t,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(e.join(" ")),this._line2.setPath(s.join(" ")),this._area.setPath(i.join(" ")))}_markerOffset(t){return t/2}}class Nr extends Xt{constructor(t,e=T,s=T){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){k.isNumber(t)?this.setPath(As.line(t,e,s,i)):t&&this.setPath(As.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(As.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(As.line(t,e,t,s))}setHLine(t,e,s){this.setPath(As.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(As.line(e,t,s,t))}}class Mr extends Ar{constructor(t,e){super(t,e),this.insertFirst(this._line=new Nr(t))}_renderShape(t){super._renderShape(t),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setHLine(t/2,0,2*t),this._shape&&this._line.setStyle("strokeDasharray",""))}_markerOffset(t){return t/2}}class Tr extends Ms{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Rr extends qs{}Rr.defaults=fe(qs.defaults,{radius:4,hoverScale:1.75});class Or extends Hs{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Or.ALIGN_GAP:0:t}}Or.ALIGN_GAP=4,Or.defaults=fe(Hs.defaults,{position:"head",align:"center"});class Br extends Zs{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new Rr(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this.marker.options.shape||this._shape:null}getRadius(t){return x(t.radius,this.marker.options.radius)}prepareLines(t){this._lines=this._doPrepareLines(t)}get pointLabel(){return this._pointLabel}_createLabel(t){return new Or(t)}_createPoint(t){return new Tr(t)}hasShape(){return!0}setShape(t){this._shape=t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Mr(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),m(e,2*this.marker.options.radius)),s}_doPrepareLines(t){const e=t.length,s=[];if(this._containsNull){let i=0;for(;i<e;){const r=[];for(;t[i].isNull&&i<e;)i++;for(;i<e&&!t[i].isNull;)r.push(t[i++]);r.length>0&&s.push(r)}}else s.push(t.slice());return s}}Br.defaults=fe(Ys.defaults,{nullAsBase:!1});class Dr extends ve{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}Dr.defaults=fe(ve.defaults,{visible:!1,offset:8});class $r extends Br{_doInitChildren(t){super._doInitChildren(t),t.flag=(this._flag=new Dr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isMarker(){return!0}getLineType(){return this._group instanceof jr||this._group instanceof Wr?this._group.options.lineType:this._op.lineType}getBaseValue(t){return t._isX?NaN:this._base}_doPrepareRender(){super._doPrepareRender(),this._base=y(this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue,this._yAxisObj.getBaseValue(),0)}}$r.type=xr,$r.defaults=fe(Br.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1});class zr extends $r{_viewType(){return"line"}getLineType(){return"spline"}}zr.type="spline";class Fr extends Tr{}class Ir extends $r{_doInitChildren(t){super._doInitChildren(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>0){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=x(t[0].yLow,t[0].py),e.push(s)}return e}const e=this._group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach((e=>{const s=e.slice(0);i.push(s),i.push(t(s))}))}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return new Lr(t,e)}_createPoint(t){return new Fr(t)}_doPrepareLines(t){if(this._containsNull&&this._group&&this._group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doPrepareLines(t)}}Ir.type=yr;class Hr extends Fr{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return l(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=e.length>2?1:0;this.low=e[x(t.options.lowField,0+s)],this.y=e[x(t.options.yField,1+s)],s>0&&(this.x=e[x(t.options.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=b(e[t.options.lowField],e.low),this.y=v(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class Gr extends Br{_createLegendMarker(t,e){return new Er(t,e)}_createPoint(t){return new Hr(t)}getLineType(){return this._op.curved?"spline":"default"}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}_doPrepareLines(t){const e=super._doPrepareLines(t),s=[];return e.forEach((t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}s.push(t,e)})),s}}Gr.type="arearange",Gr.defaults=fe(Br.defaults,{curved:!1,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class jr extends ri{_canContain(t){return t instanceof $r}getBaseValue(t){return t===this._yAxisObj?y(this._op.baseValue,t.getBaseValue(),0):NaN}}jr.type="linegroup",jr.seriesType=xr,jr.defaults=fe(ri.defaults,{lineType:"default"});class Wr extends ri{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this._op.layout}}}_canContain(t){return t instanceof Ir}getBaseValue(t){return t===this._yAxisObj?y(this._op.baseValue,t.getBaseValue(),0):NaN}}Wr.type="areagroup",Wr.seriesType=yr,Wr.defaults=fe(ri.defaults,{lineType:"default"});class Xr extends Fr{}class Yr extends Ir{getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Xr(t)}_doLoadData(t){const e=super._doLoadData(t);if(i(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return t.referBy(this),!0}reference(t,e){if(!e._isX){const e=t._runPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this._loadTable(e);this._doLoadPoints(s),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}_loadTable(t){const e=function(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},s=t.length;if(s<1)return;const i=this._op,r=t.reduce(((t,e)=>t+e),0)/s,n=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-r,2)))/(s-1)),a=n/i.pointsInSigma,o=r-i.sigmas*n,h=r+i.sigmas*n;let l=r;const _=[];for(_.push(e(r,n,l));l>o;)l-=a,_.unshift(e(r,n,l));for(l=r;l<h;)l+=a,_.push(e(r,n,l));return _}}Yr.type="bellcurve",Yr.defaults=fe(Ir.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Ur extends Ms{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return l(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.min=e[x(s.minField,0+i)],this.low=e[x(s.lowField,1+i)],this.mid=e[x(s.midField,2+i)],this.high=e[x(s.highField,3+i)],this.y=e[y(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=b(e[s.minField],e.min),this.low=b(e[s.lowField],e.low),this.mid=b(e[s.midField],e.mid),this.y=v(e[s.highField],e.high,this.y),this.minLabel=e.minLabel}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}initValues(){this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high)}initPrev(t,e){e.yValue=e.highValue=e.midValue=e.lowValue=e.minValue=this.minValue}applyValueRate(t,e){this.minValue=V(t.minValue,this.minValue,e),this.lowValue=V(t.lowValue,this.lowValue,e),this.midValue=V(t.midValue,this.midValue,e),this.highValue=V(t.highValue,this.highValue,e)}}class Zr extends ii{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Ur(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}}Zr.type="boxplot",Zr.defaults=fe(ii.defaults,{tooltipText:"<b>${name}</b><br>min: <b>${minValue}</b><br>low: <b>${lowValue}</b><br>mid: <b>${midValue}</b><br>high: <b>${highValue}</b><br>max: <b>${maxValue}</b>"});class qr extends Rs{}class Kr extends oi{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:K(this._minSizeDim,t),max:K(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new qr(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=m(t,s.zValue),e=f(e,s.zValue))})),this._noSize=(this._zMin=t)===(this._zMax=e)}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}}Kr.type="bubble",Kr.defaults=fe(oi.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>"});class Qr extends ni{_canContain(t){return t instanceof $r}_doConstraintYValues(t){const e={};t.forEach((t=>{t._runPoints.forEach((t=>{const s=t.xValue,i=e[s];i?i.push(t):e[s]=[t]}))}));for(const t in e)e[t].sort(((t,e)=>t.yValue-e.yValue)).forEach(((t,e)=>{t.yLabel=b(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return k.makeIntArray(0,t.length)}}Qr.type="bump",Qr.seriesType=xr;const Jr=function(t){return isNaN(t)?0:t};class tn{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}end(t=!1){return this._path.length>0?(t&&this._path.push("Z"),this._path.join(" ")):""}close(t){const e=this.end(!0);return t&&this.clear(),e}move(t,e){return o(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return o(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return o(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return o(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Jr(t[e]),Jr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Jr(t[e].x),Jr(t[e].y));return this}polygon(...t){return o(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s}, ${e} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 ${2*-s},0`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const s={x1:this._path[t+1],y1:this._path[t+2],x2:this._path[t+3],y2:this._path[t+4]};return e&&this._path.splice(t,5),s}}getPoints(t,e,s=!0){const i=[];for(;t<this._path.length&&i.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)i.push({x:this._path[t+1],y:this._path[t+2]}),s&&this._path.splice(t,3);return i}}class en extends Ms{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return l(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.low=e[x(s.lowField,0+i)],this.close=e[x(s.closeField,1+i)],this.open=e[x(s.openField,2+i)],this.y=e[y(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=b(e[s.lowField],e.low),this.open=b(e[s.openField],e.open),this.close=b(e[s.closeField],e.close),this.y=v(e[s.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}initValues(){this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close)}initPrev(t,e){e.yValue=e.lowValue=e.openValue=e.closeValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e),this.openValue=V(t.openValue,this.openValue,e),this.closeValue=V(t.closeValue,this.closeValue,e)}}class sn extends ii{canCategorized(){return!0}_createPoint(t){return new en(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new tn;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new Xt(t,Ys.LEGEND_MARKER,s.end())}}sn.type="candlestick",sn.defaults=fe(ii.defaults,{tooltipText:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class rn extends Hs{}rn.defaults=fe(Hs.defaults,{position:"inside"});class nn extends Sr{get pointLabel(){return this._pointLabel}_createLabel(t){return new rn(t)}}nn.type=br;class an extends Pr{_canContain(t){return t instanceof nn}}an.type="circlebargroup",an.seriesType=br;class on extends Os{}class hn extends qs{}hn.defaults=fe(qs.defaults,{radius:4,shape:"circle"});class ln extends ii{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new hn(this)).init(),t.lowMarker=(this._lowMarker=new hn(this)).init()}get marker(){return this._marker}get lowMarker(){return this._lowMarker}canCategorized(){return!0}_getBottomValue(t){return t.lowValue}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+f(0,this.marker.options.radius)}_createPoint(t){return new on(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=x(e.radius,s),n=e.shape||i;this._runPoints.forEach((t=>{t.radius=s,t.shape=i,t.lowRadius=r,t.lowShape=n}))}}ln.type="dumbbell";class _n extends Ms{}class cn extends ei{getSegmentSize(t){return K(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new _n(t)}_createLegendMarker(t,e){const s=new tn;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new Xt(t,Ys.LEGEND_MARKER,s.end())}}cn.type="equalizer",cn.defaults=fe(ei.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class dn extends ii{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Os(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new tn).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new Xt(t,Ys.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}dn.type="errorbar",dn.defaults=fe(ii.defaults,{pointPadding:.3,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class un extends Ks{}class pn extends Qs{getSize(t,e){return{width:f(.1*t,K(this._widthDim,t)),height:f(.1*e,K(this._heightDim,e))}}getNeckSize(t,e){return{width:k.clamp(K(this._neckWidthDim,t),.1*t,t),height:k.clamp(K(this._neckHeightDim,e),.1*e,e)}}_createPoint(t){return new un(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=q(e._width,pn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=q(e._height,pn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=q(e._neckWidth,pn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=q(e._neckHeight,pn.defaults.neckHeight))}(t.neckHeight)}}pn.type="funnel",pn.defaults=fe(Qs.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",legendByPoint:!1});class gn extends Rs{}class mn extends Zs{getColor(t){}canMixWith(t){return!1}canCategorized(){return!0}hasZ(){return!0}defYAxisType(){return"category"}_createPoint(t){return new gn(t)}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((s=>{isNaN(s.zValue)||(t=m(t,s.zValue),e=f(e,s.zValue))})),this._heatMin=t,this._heatMax=e}}mn.type="heatmap",mn.defaults=fe(Ys.defaults,{tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>heat: <b>${z}</b>"});class fn extends Ms{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return l(super._assignTo(t),{min:this.min,max:this.max})}}const wn={squreRoot:function(t){return Math.ceil(Math.sqrt(t))},struges:function(t){return Math.ceil(Math.log(t)*Math.LOG2E)},rice:function(t){return Math.ceil(2*Math.pow(t,1/3))}};class xn extends Zs{getBinCount(t){const e=x(this._op.binWidth,0);if(e>0)return t/e;return x(this._op.binsNumber,0)<1?wn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new fn(t)}_doLoadPoints(t){function e(t){let e;return e=i(t)?t[x(this.yField,0)]:s(t)?v(t[this.yField],t.y,t.value):t,parseFloat(e)}const r=this._op,n=[];let a=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||a.push(i)}if(a.length>0){a=a.sort(((t,e)=>t-e)),r.minValue<a[0]&&a.unshift(r.minValue),r.maxValue>a[a.length-1]&&a.push(r.maxValue);const t=a.length,e=a[0],s=a[t-1],i=this.getBinCount(t),o=this._binInterval=(s-e)/i;let h=0,l=e,_=l+o;for(let e=0;e<i;e++){let r=0;if(e==i-1)r=t-h;else for(;h<t&&a[h]<_;)r++,h++;n.push({x:l,y:r,min:l,max:e===i-1?s:_}),l=_,_=l+o}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._runPoints[this._runPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=x(this._op.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}}xn.type="histogram",xn.defaults=fe(Ys.defaults,{baseValue:0,binsNumber:"squreRoot"});class yn extends qs{}yn.defaults=fe(qs.defaults,{radius:4,shape:"circle"});class bn extends Ms{}class vn extends ei{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new yn(this)).init()}get marker(){return this._marker}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new bn(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.options.radius,e=this.marker.options.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}}vn.type="lollipop";class Vn extends en{}class Sn extends sn{_createPoint(t){return new Vn(t)}_createLegendMarker(t,e){const s=new tn;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new Xt(t,Ys.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}}Sn.type="ohlc";class kn extends Tr{}class Pn extends Br{getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new kn(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return t.referBy(this),!0}reference(t,e){if(!e._isX){const e=this;(function(t){const s=[],i=t.reduce(((t,e)=>t+x(e.yValue,0)),0);let r=0;t.forEach((t=>{t.isNull||s.push({x:t.xValue,y:r+=100*t.yValue/i})})),e._doLoadPoints(s),e._runPoints=e._points.getPoints(e._xAxisObj,e._yAxisObj)})(t._runPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}Pn.type="pareto",Pn.defaults=fe(Br.defaults,{curved:!1});class Cn extends Ks{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=Z(t,!0))}parse(t){super.parse(t),this.sliced=this.source.sliced,this.isNull=this.isNull||this.y<0}_assignTo(t){return l(super._assignTo(t),{sliced:this.sliced})}}class An extends ve{getDefaultIconPos(){return"left"}}class Ln extends Hs{}Ln.defaults=fe(Hs.defaults,{visible:!0});class En extends Js{_doInitChildren(t){super._doInitChildren(t),t.innerText=(this._innerText=new An(this.chart)).init()}get innerText(){return this._innerText}followPointer(){return!0}hasInner(){return this._innerRadiusDim&&this._innerRadiusDim.size>0}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return!this._group&&this._sliceOffsetDim?K(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new Ln(t)}_createPoint(t){return new Cn(t)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset")}_doPrepareRender(){super._doPrepareRender();let t=x(this._op.startAngle%360,0),e=f(0,m(360,x(this._op.totalAngle,360)));this._startRad=B+D*t,this._totalRad=D*e,this._groupPos=NaN}}En.type="pie",En.defaults=fe(Js.defaults,{groupSize:1,labelDistance:25,sliceOffset:"7%",autoSlice:!0,sliceDuration:300,borderRadius:0});class Nn extends ri{getPolarSize(t,e){return K(this._polarDim,m(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}_doApply(t){const e=this;var s;super._doApply(t),(s=t.polarSize)!==e._polarSize&&(e._polarSize=s,e._polarDim=Z(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=Z(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof En}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+x(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=x(t.options.groupSize,1)/e}))}}Nn.type="piegroup",Nn.seriesType="pie",Nn.defaults=fe(ri.defaults,{polarSize:"80%",innerSize:0});class Mn extends Ms{}class Tn extends oi{_createPoint(t){return new Mn(t)}_createLegendMarker(t,e){return new Ar(t,e)}_colorByPoint(){return this._op.colorByPoint}setShape(t){this._defShape=t}getShape(t){return this._op.shape||this._defShape}hasShape(){return!0}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),m(e,2*this._op.radius)),s}}Tn.type="scatter",Tn.defaults=fe(oi.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Rn extends Ms{_assignTo(t){return l(super._assignTo(t),{id:this.id,group:this.group})}_readArray(t,e){if(e.length<=2)this.isNull=!0;else{const s=e.length>3?1:0;s>0&&(this.x=e[x(t.options.xField,0)]),this.y=e[x(t.options.yField,0+s)],this.id=G(e[x(t.options.idField,1+s)]),this.group=G(e[x(t.options.groupField,2+s)])}}_readObject(t,e){super._readObject(t,e),this.id=G(e[t.options.idField]),this.group=G(e[t.options.groupField])}}(class extends xe{constructor(t){super(t.chart),this.level=t,this.floating=!0}}).defaults=fe(xe.defaults,{visible:!1});class On{constructor(t){this.point=t}level(){return this.parent?this.parent.level()+1:0}getArea(){return{x:this.x,y:this.y,width:this.width,height:this.height}}setArea(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}getTotal(){return this.children.reduce(((t,e)=>t+e.value),0)}}class Bn extends Ys{constructor(){super(...arguments),this._map={},this._levels=1}buildMap(t,e){function s(t){if(t.children){let e=0;t.children.forEach(((t,i)=>{s(t),e+=t.value})),t.value=e,t.children=t.children.sort(((t,e)=>e.value-t.value)),t.children.forEach(((t,e)=>{t.index=e})),n=f(n,t.level()+1+1)}else r.push(t),t.value=t.point?t.point.yValue:0}const i="vertical"===this._op.startDir||e>t,r=this._leafs=[];let n=1;return this._roots.forEach(((t,e)=>{s(t)})),this._roots=this._roots.sort(((t,e)=>e.value-t.value)),this._roots.forEach(((t,e)=>{t.index=e})),(this[this._op.algorithm]||this.squarify).call(this,this._roots,t,e,i),this._levels=n,{roots:this._roots,leafs:this._leafs}}needAxes(){return!1}canMixWith(t){return!1}_createPoint(t){return new Rn(t)}_getLabeledPoints(){return this._leafs.map((t=>t.point))}_doPrepareRender(){super._doPrepareRender(),this._roots=this.$_buildTree(this._runPoints)}$_buildTree(t){const e=[],s=[],i=this._map;t.forEach((t=>{if(t.id||!t.isNull){const r=new On(t);t.id&&(i[t.id]=r),t.group?s.push(r):e.push(r)}}));for(let t=s.length-1;t>=0;t--){const r=s[t],n=i[r.point.group];(r.parent=n)?(n.children||(n.children=[]),n.children.push(r),r.children&&s.splice(t,1)):(e.push(r),s.splice(t,1))}return e}$_squarifyRow(t,e,s,i){const r=e.width*e.height,n=e.width,a=e.height;let o=e.x,h=e.y,l=Number.MAX_VALUE,_=0;const c=[];if(2===t.length){return(1===s?n>a:n>=a)?t.forEach((t=>{t.setArea(o,h,n*t.value/i,a),o+=t.width})):t.forEach((t=>{t.setArea(o,h,n,a*t.value/i),h+=t.height})),0}for(;t.length>0;){let d,u,p,g,m;if(d=t.shift(),_+=d.value,g=_*r/i,1===s?(u=g/a,p=a*d.value/_):(p=g/n,u=n*d.value/_),m=f(u/p,p/u),t.length>0&&m>l)return t.unshift(d),_-=d.value,g=r*_/i,1===s?(p=a,u=g/p):(u=n,p=g/u),c.forEach((t=>{1===s?(t.setArea(o,h,u,a*t.value/_),h+=t.height):(t.setArea(o,h,n*t.value/_,p),o+=t.width)})),1===s?(e.x+=u,e.width-=u):(e.y+=p,e.height-=p),i-_;if(0===t.length)return g=r*_/i,1===s?(p=a,u=g/p):(u=n,p=g/u),c.push(d),c.forEach((t=>{1===s?(t.setArea(o,h,u,a*t.value/_),h+=t.height):(t.setArea(o,h,n*t.value/_,p),o+=t.width)})),0;l=m,c.push(d)}}$_squarify(t,e,s,i){const r=t.slice(0);let n=s?1:0,a=t.reduce(((t,e)=>t+e.value),0);do{a=this.$_squarifyRow(r,e,n,a),i&&(n=1-n)}while(a>0);t.forEach((t=>{t.children&&this.$_squarify(t.children,t.getArea(),!s,!0)}))}squarify(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!0)}strip(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!1)}$_sliceNext(t,e,s,i){if(t.x=e.x,t.y=e.y,1===s){const s=e.height*t.value/i;t.width=e.width,t.height=s,e.y+=s,e.height-=s}else{const s=e.width*t.value/i;t.height=e.height,t.width=s,e.x+=s,e.width-=s}t.children&&this.$_slice(t.children,t.getArea(),0===s,!0)}$_slice(t,e,s,i){let r=t.reduce(((t,e)=>t+e.value),0),n=s?1:0;t.forEach((t=>{this.$_sliceNext(t,e,n,r),r-=t.value,i&&(n=1-n)}))}slice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!1)}sliceDice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!0)}}Bn.type="treemap",Bn.defaults=fe(xe.defaults,{idField:"id",groupField:"group",algorithm:"squarify",alternate:!0,groupMode:!0});class Dn extends Ms{_assignTo(t){return l(super._assignTo(t),{length:this.length,angle:this.angle,lengthValue:this.lengthValue,angleValue:this.angleValue})}_valuesChangd(t){return this.length!==t.length||this.angle!==t.angle||super._valuesChangd(t)}_readArray(t,e){if(e.length<=2)this.isNull=!0;else{const s=e.length>3?1:0;s>0&&(this.x=e[x(t.options.xField,0)]),this.y=e[x(t.options.yField,0+s)],this.length=e[x(t.options.lengthField,1+s)],this.angle=e[x(t.options.angleField,2+s)]}}_readObject(t,e){super._readObject(t,e),this.length=b(e[t.options.lengthField],e.length),this.angle=b(e[t.options.angleField],e.angle),this.y=v(t._yFielder(e),e.y,e.value)}_readSingle(t){super._readSingle(t),this.length=this.angle=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lengthValue)||isNaN(this.angleValue))}initValues(){this.lengthValue=parseFloat(this.length),this.angleValue=parseFloat(this.angle)}initPrev(t,e){e.yValue=this.yValue,e.lengthValue=.001}applyValueRate(t,e){this.lengthValue=V(t.lengthValue,this.lengthValue,e)}}class $n extends Zs{_createPoint(t){return new Dn(t)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length>0){const e=this._op.maxLength,s=this._op.origin,i=t.map((t=>t.length)).reduce(((t,e)=>f(t,e)));t.forEach((t=>{const r=t.length/i;switch(t._len=r*e,s){case"start":t._off=-t._len/2;break;case"end":t._off=t._len/2;break;default:t._off=0}}))}}_createLegendMarker(t,e){const s=.3,i=.7*e,r=[0,-s*e,-.2*e,-s*e,0,-.6*e,.2*e,-s*e,0,-s*e,0,.6*e],n=["M",r[0],r[1]+i];for(let t=2;t<r.length;t+=2)n.push("L",r[t],r[t+1]+i);const a=new Xt(t,Ys.LEGEND_MARKER,n);return a.setStyle("strokeWidth","2px"),a.rotation=30,a}}$n.type="vector",$n.defaults=fe(Ys.defaults,{origin:"center",maxLength:20,startAngle:0,arrowHead:"close"});class zn extends Ms{constructor(){super(...arguments),this.low=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._intermediate=this.source.intermediate,this._isSum&&(this.y=0),this.save=this.y}}class Fn extends si{canCategorized(){return!0}_createPoint(t){return new zn(t)}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length<1)return;let e,s,i=t[0],r=i.y=i._isSum?0:i.y,n=r,a=r,o=r,h=0;for(let l=1,_=t.length;l<_;l++){if(i=t[l],i._isSum){const e=t[l-1],r=!0===i._intermediate||l<_-1&&!1!==i._intermediate,n=i.save=i.y=r?o:a;i.yGroup=i.yValue=i.y,r?o<0?(h=e.low,s=h-n):(s=e.y,h=s-n):(h=t[0].low,s=h+n),o=0}else e=i.y,e<0?n<0?(s=r+n,h=s+e):(s=r,h=s+e):(h=r,s=h+e),o+=e,a+=e;n=i.y,i.y=r=s,i.low=h}}_getBottomValue(t){return t.y=t.save,NaN}}Fn.type="waterfall";class In extends xe{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}}In.defaults=fe(xe.defaults,{text:"RealChart v1.0",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Hn extends xe{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==b(this._op.scope,"auto")?this._op.scope:this.chart._chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible?"axis":t.isMarker()&&t._group?"group":"point"}}Hn.defaults=fe(xe.defaults,{scope:"auto"});class Gn extends xe{_doInitChildren(t){t.credits=(this._credits=new In(null)).init(),t.pointHovering=(this._pointHovering=new Hn(this.chart)).init()}get credits(){return this._credits}get pointHovering(){return this._pointHovering}getXStart(t){return t instanceof Mi&&isNaN(this._op.xStart)?1:this._op.xStart||0}}var jn;Gn.defaults=fe(xe.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right",t.CENTER="center",t.MIDDLE="middle"}(jn||(jn={}));class Wn extends M{constructor(t){super(),this._data=new lt,this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._assets=new ge,(this._chartOptions=new Gn(this)).init(),(this._title=new fi(this)).init(),(this._subtitle=new wi(this)).init(),(this._legend=new bs(this)).init(),(this._tooltip=new xi(this)).init(),(this._split=new mi(this)).init(),(this._body=new ws(this)).init(),(this._navigator=new ui(this)).init(),(this._exporter=new xs(this)).init(),this._series=new Us(this),this._xAxes=new We(this,!0),this._yAxes=new We(this,!1),this._xPaneAxes=new Ue(this),this._yPaneAxes=new Ze(this),this._gauges=new is(this),this._annotations=new Pe(this),s(t)?this._load(t):this._initOptions()}_initOptions(){return this.options=Object.assign({},Wn.defaults)}_createChart(t){return new Wn(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries()}getTooltipText(t,e){return ri.collectTooltipText(this.axis.options,this.series,e)}getTooltipParam(t,e,s){return ri.inflateTooltipParam(this.series,t,e,s)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._chartOptions.pointHovering.getScope(e,s)),t){case"axis":return new i(e._xAxisObj);case"group":return e._group;default:return e}}get chart(){return this}anchorByName(t){}get type(){return this.options.type}get gaugeType(){return this.options.gaugeType}get polar(){return this.options.polar}get inverted(){return this.options.inverted}get timeOffset(){return this.options.options.timeOffset}get startOfWeek(){return this.options.options.startOfWeek}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){return this._gauges.firstGauge}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}_needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._annotations.getVisibles()}isGauge(){return this._gaugeOnly}isPolar(){return this._polar&&this._series.seriesCount()>0}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(t){return this._series.isEmpty(t)&&this._gauges.isEmpty(t)}seriesByName(t){return this._series.getSeries(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){return this._gauges.getGauge(t)}gaugeAt(t){return this._gauges.get(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items(),i=this._yAxes.items();let r;if(this.isInverted())switch(t){case jn.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case jn.RIGHT:r=s.filter((t=>t._isOpposite));break;case jn.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case jn.TOP:r=i.filter((t=>t._isOpposite));break;case jn.CENTER:r=s.filter((t=>t._isBetween))}else switch(t){case jn.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case jn.RIGHT:r=i.filter((t=>t._isOpposite));break;case jn.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case jn.TOP:r=s.filter((t=>t._isOpposite));break;case jn.MIDDLE:r=s.filter((t=>t._isBetween))}return r?e?r.filter((t=>t.visible)):r:[]}_getLegendSources(){return this._series.getLegendSources()}_setProperties(t,e=!0){const s=this.options;for(const e in Wn.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&we(n={},r.base),s(r[i])&&(n||(n={}),we(n,r[i])),n?we(n,t):t}_load(t){const e=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),this._assets.load(b(t.asset,t.assets)),e.options=this._chartOptions._load(t.options),e.title=this._title._load(t.title),e.subtitle=this._subtitle._load(t.subtitle),e.legend=this._legend._load(t.legend),e.tooltip=this._tooltip._load(t.tooltip),this._split._load(t.split),this._seriesIndex=0,this._series.load(t.series),this._gauges.load(b(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(v(t.xAxis,t.xAxes,{})),this._yAxes.load(v(t.yAxis,t.yAxes,{}))),e.body=this._body._load(t.body||t.plot),this._annotations.load(b(t.annotation,t.annotations),!1),e.seriesNavigator=this._navigator._load(t.seriesNavigator),e.exporting=this._exporter._load(t.exporting),this}update(t,e){this._setProperties(t,!1);for(const e in this){const s=this[e];(s instanceof xe||s instanceof ye||s instanceof ge)&&s.updateOptions(t[e],!1)}e&&this._modelChanged(null)}export(t){this._fireEvent("onExportRequest",t)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}_prepareRender(){const t=this._xAxes,e=this._yAxes,s=this._split;[t,e].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=s.visible,t.disconnect(),e.disconnect(),this._series.prepareRender(),t.prepare(),e.prepare(),t.collectValues(),e.collectValues(),t.collectReferentsValues(),e.collectReferentsValues(),e.collectRanges(),t.prepareRender(),e.prepareRender(),this._splitted&&!this._gaugeOnly&&(s._prepareRender(),this._xPaneAxes._prepare(t,s._vrows,s._vcols),this._yPaneAxes._prepare(e,s._vrows,s._vcols)),this._series.prepareAfter(),this._legend._prepareRender(),this._gauges.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator._prepareRender()}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t),this._yAxes._buildTicks(s?t:e),this.$_calcAxesPoints(t,e,s,0)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{t._calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{t._calcPoints(r,i)}))}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,101)}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t);return s&&(this._dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._dataChanged(),this._modelChanged(null),s}render(){this._fireEvent("onRefreshRequest")}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{}};if(s(t)){const r=this._templates={};for(const e in t){const i=t[e];s(i)&&(r[e]=l({},i))}["@xAxis","@yAxis","@series","@gauge","@annotation"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return we(we({},s),t)}else i(e)&&e.forEach((e=>{let s=this._templates[e];return s?we(we({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&Is[t.toLowerCase()]}_getSeriesType(t){return n(t)&&Fs[t.toLowerCase()]}_getAxisType(t){return n(t)&&Le[t.toLowerCase()]}_getGaugeType(t){return n(t)&&Ke[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&Qe[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Se[t.toLowerCase()]}getAxesGap(){return this._chartOptions.options.axisGap||0}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}Wn.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},je.register(zs,Ei,Mi,zi),Ys.register(Ir,Gr,vr,kr,Yr,Zr,Kr,sn,nn,ln,cn,dn,pn,mn,xn,$r,zr,vn,Sn,Pn,En,Tn,Bn,$n,Fn),ri.register(Wr,Cr,Qr,an,jr,Nn),ri.registerSeries(Wr,Cr,an,jr,Nn),es.register(tr,hr,wr,Xi),ss.register(er,lr,qi),ke.register(yi,bi,vi);const Xn="$ctrl";class Yn{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Wn(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[Xn]=null===(t=this[Xn])||void 0===t?void 0:t.destroy(),this._obj=null,this.$_destroyed=!0)}get options(){return this._obj.options}get data(){return this._obj._data}get type(){return this._obj.type}get gaugeType(){return this._obj.gaugeType}get inverted(){return this._obj.inverted}get polar(){return this._obj.polar}get chartOptions(){return this._obj._chartOptions}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get first(){return this._obj.first}get series(){return this._obj.firstSeries}get gauge(){return this._obj.firstGauge}get legend(){return this._obj._legend}get tooltip(){return this._obj._tooltip}get xAxis(){return this._obj.xAxis}get yAxis(){return this._obj.yAxis}get body(){return this._obj._body}get split(){return this._obj._split}get seriesNavigator(){return this._obj._navigator}get exporter(){return this._obj._exporter}getXAxis(t){return this._obj.getXAxis(t)}getYAxis(t){return this._obj.getYAxis(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,i){var r;if(s(t)){const s="load chart";k.LOGGING&&console.time(s);let n=this._obj,a=n;this._loaded?(n.destroy(),a=this._obj=new Wn):(this._loaded=!0,n=null),a._load(t),a._loadAnimatable=e,this._loadCallback=i,k.log("chart-items:",me),k.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,a,n)}return this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(){this._obj.render()}setParam(t,e,s){this._obj.setParam(t,e,s)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}}class Un{constructor(t,e){this._obj=new ht(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,s){this._obj.setValue(t,e,s)}getValues(t,e=0,s=-1){return this._obj.getValues(t,e,s)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class Zn extends N{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestroy(){this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.dom.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,a=this._views;for(;a.length>t;)n.push(a.pop().remove());for(;a.length<t;){const e=this.$_create(i);a.push(e),null==s||s(e,a.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){return this._views=this._views.sort(t),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const qn=Object.freeze({x:0,y:0,width:0,height:0}),Kn=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function Qn(t){return{width:t.width,height:t.height}}function Jn(t){return t.width<=0||t.height<=0}class ta{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new ta(t,t,t,t):new ta(t,t,e,e):new ta(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new ta(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=x(t.paddingLeft,0),this.right=x(t.paddingRight,0),this.top=x(t.paddingTop,0),this.bottom=x(t.paddingBottom,0),this}applyMargin(t){return this.left=x(t.marginLeft,0),this.right=x(t.marginRight,0),this.top=x(t.marginTop,0),this.bottom=x(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}}ta.Empty=Object.freeze(new ta),ta.Temp=new ta;class ea extends It{constructor(t,e=T){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return ea.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}ea.IGNORE_ATTRS={width:"",height:""};class sa extends It{constructor(t,e=T){super(t,e,"g"),It.DEBUGGING&&(this.add(this._debugRect=new Ls(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),It.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Ls(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class ia extends sa{constructor(t,e,s){super(t,e),this._margins=new ta,this._paddings=new ta,this.add(this._background=new Ls(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const a=this._paddings;a.applyPadding(n);const o=this._doMeasure(t,e,s,i,r);if(o.width+=a.left+a.right,o.height+=a.top+a.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=o.width+=t.left+t.right,this.mh=o.height+=t.top+t.bottom}return this.mw=o.width,this.mh=o.height,o}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class ra extends ea{measure(t,e,s,i,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,s,i,r);return this.mw=n.width,this.mh=n.height,n}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}_setInverted(t){this._inverted=t}}class na extends sa{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class aa extends It{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=qn,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate(),this._dirty=!1},window.SVGGraphicsElement||(this._proxy=new Image,this._proxy.onload=()=>{this._dirty=!0,this.invalidate(),setTimeout((()=>{this.onloadProxy(),this._dirty=!1}),0)})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){return!!t&&(this.url=t,this.resize(e,s)&&(this._dirty=!0),!0)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){let t=this._bounds.width,e=this._bounds.height;0==t||e?0==e||t||(t=e/this._proxy.height*this._proxy.width):e=t/this._proxy.width*this._proxy.height,this._bounds={x:this._bounds.x,y:this._bounds.y,width:t,height:e}}return this._bounds}resize(t,e,s=!0){return this._dirty&&super.resize(t,e,s)}}class oa extends ea{constructor(t,e=T){super(t),this.add(this._text=new Qt(t,e)),this._text.anchor=Zt.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options.effect;return this._model=e,this._text.setStyleOrClass(e._style),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Ls(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.options.backgroundStyle)):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new Qt(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?this._icon||(this.add(this._icon=new aa(t,!1)),this._icon.url=s,this._icon.width=e.options.iconWidth,this._icon.height=e.options.iconHeight||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){var e;const s=null===(e=this._model)||void 0===e?void 0:e.options;if(t&&(null==s?void 0:s.autoContrast)&&this._text.setContrast(t,s.darkStyle||"rct-label-dark",s.lightStyle||"rct-label-light"),this._outline&&this._outline.parent){const t=Tt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.applyStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._icon;let s=0;const i=this._text.getBBox(),r=i.width,n=i.height;let a=r,o=n,h=0,l=0,_=0,c=0;if(e){const t=e.getBBox();switch(s=x(this._model.options.iconGap,0),h=t.width,l=t.height,this._model.getIconPos()){case"left":case"right":a+=s+h,o=Math.max(l,n);break;default:o+=s+l,a=Math.max(h,r)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);_=parseFloat(t.paddingLeft)||0,c=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,a+_+(parseFloat(t.paddingRight)||0),o+c+(parseFloat(t.paddingBottom)||0),t.rx)}if(e)switch(this._model.getIconPos()){case"left":e.trans(_,(o-l)/2),_+=h+s,a-=h+s;break;case"right":e.trans(_+a-h,(o-l)/2),a-=h+s;break;case"top":e.transX((a-h)/2),c+=l+s;break;case"bottom":e.trans((a-h)/2,c+n+s)}switch(t){case"center":_+=a/2,this._text.anchor=Zt.MIDDLE;break;case"right":_+=a,this._text.anchor=Zt.END;break;default:this._text.anchor=Zt.START}return this._text.trans(_,c),this}trans(t,e){return super.trans(t,e),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(this._text.tx,this._text.ty)),this}}class ha extends Ss{constructor(t,e,s,i){super(),this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}_doUpdate(t){if(this._axis.parent){const e=this._axis.model,s=this._prevMax-this._prevMin,i=(e.axisMax()-e.axisMin())/s;return t=i+(1-i)*t,e.setPrevRate(t),this._axis.invalidate(),!0}return!1}_doStop(){this._axis.model.setPrevRate(NaN),this._axis=null}}class la extends ia{constructor(t){super(t,la.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new Qt(t)),this._richText=new oe}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){this._angle=e.getRotation();const n=e.options;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),n.textOrientation&&this._textView.setStyle("textOrientation",n.textOrientation),this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null);const a=Qn(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(t){const e=this._textView,s=e.getStyle("writing-mode"),i=s===nt||s===at;t?this.rotation=0:this.setRotation(0,(i?this.width:this.height)/2,this._angle);let r=this._margins.top+this._paddings.top,n=0;switch(this.textAlign()){case"left":this._textView.anchor=Zt.START,i||(n-=this.width/2);break;case"right":this._textView.anchor=Zt.END,i?r+=this.height:n+=this.width/2;break;default:this._textView.anchor=Zt.MIDDLE,i&&(r+=this.height/2)}e.trans(n,r)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}la.TITLE_CLASS="rct-axis-title";class _a extends sa{constructor(t){super(t,ga.TICK_CLASS),this.add(this._lineView=new Nr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class ca extends oa{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0}setLabel(t,e,s,i,r){if(s){this._richText?this._richText._format!==s&&this._richText.setFormat(s):this._richText=new oe(s);const n=t.getIcon(e);this.setModel(this.doc,t,n&&t.getUrl(n),null),this._richText.build(this._text,i,r,t,t._domain),this._outline&&this._richText.build(this._outline,i,r,t,t._domain)}else this._richText&&(this._richText=null,this._text.text="")}rotatedWidth(){const t=this.rotation*D,e=this.getBBox();return w(u(t)*e.height)+w(d(t)*e.width)}rotatedHeight(){const t=this.rotation*D,e=this.getBBox();return w(d(t)*e.height)+w(u(t)*e.width)}}class da extends It{constructor(t){super(t,void 0),this.add(this._back=new Xt(t,"rct-crosshair-flag")),this.add(this._text=new Qt(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){this._text.text=e;const s=this._text.getBBox(),i=new tn,r=f(t.flag.minWidth||0,s.width+8);i.rect(0,0,r,s.height+4),this._back.setPath(i.end()),this._text.trans(r/2,2)}}}class ua extends sa{static isThumb(t){return t.classList.contains(ua.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Ls(t,ua.TRACK_CLASS)),this.add(this._thumbView=new Ls(t,ua.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=f(0,e),this._page=m(s,e),this._pos=m(t.min+e-s,f(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.options.reversed,(t=f(0,m(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:i}:{width:s,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=x(e.getMinThumbSize(),32),r=this._len,n=0===this._len,a=this._page,o=n?0:this._pos-s.min,h=e.getGap(),l=h+e.getGapFar();let _=this.width,c=this.height;if(this._vertical){_-=l,this._trackView.setBounds(h,0,_,c),c-=i;const t=(n||a===r?c:c*a/r)+i;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-c*o/r-t,_-2,t)}else{c-=h+e.getGapFar(),this._trackView.setBounds(0,h,_,c),_-=i;const t=(n||a===r?_:_*a/r)+i;this._reversed,this._thumbView.setBounds(n?0:_*o/r,h+1,t,c-2)}}}ua.CLASS_NAME="rct-axis-scrollbar",ua.TRACK_CLASS="rct-axis-scrollbar-track",ua.THUMB_CLASS="rct-axis-scrollbar-thumb";const pa=/\${label}.*?/g;class ga extends sa{constructor(t){super(t,ga.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._edgeStart=0,this._marginStart=0,this._marginEnd=0,this._edgeEnd=0,this.add(this._lineView=new Nr(t,ga.LINE_CLASS)),this.add(this._titleView=new la(t)),this.add(this._markContainer=new It(t,"rct-axis-ticks")),this.add(this._labelContainer=new It(t,"rct-axis-labels")),this._labelViews=new Zn(this._labelContainer,ca,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){return e.visible&&!this.model._isBetween?(this._scrollView||this.add(this._scrollView=new ua(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s]):(this._scrollView&&this._scrollView.setVis(!1),0)}checkHeight(t,e,s){const i=this.model,r=i.title;let n=i.tick.visible?i.tick.options.length:0;return this.$_prepareLabels(i,e)&&(n+=this.$_measureLabelsHorz(i,e,!0)),this._titleView.setVis(r.visible)&&(n+=this._titleView.measure(t,r,e,s,1).height,n+=r.options.gap),n+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),n}checkWidth(t,e,s){const i=this.model,r=i.title;let n=i.tick.visible?i.tick.options.length:0;return this.$_prepareLabels(i,e)&&(n+=this.$_measureLabelsVert(i,s,!0)),(this._titleView.visible=r.visible)&&(n+=this._titleView.measure(t,r,e,s,1).width,n+=r.options.gap),n+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),n}prepareGuides(t,e,s,i,r){[i,r].forEach(((i,r)=>{if(i.setVis(!this._empty)){const n=this.model.guides.filter((t=>t.options.front==(1===r)&&t.canConstainedTo(e,s)));i.setAll(t,n,!1)}}))}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new da(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick.options.length):(i="opposite"===s._runPos?m(0,this.width-n.width):f(0,this.width-s.tick.options.length-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){this._edgeStart=t,this._marginStart=e,this._marginEnd=s,this._edgeEnd=i}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}prepare(t){this.model=t,this._chartEmpty=t.chart.isEmpty(!0),this._empty=this._chartEmpty||t.isEmpty()}checkExtents(t){const e=this._prevModel,s=this._prevModel=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax;this._prevMin=s.axisMin(),this._prevMax=s.axisMax(),(!isNaN(e)&&this._prevMax!==e||!isNaN(t)&&this._prevMin!==t)&&!s._zooming&&s.options.animatable&&new ha(this,t,e,(()=>{this.invalidate()}))}}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const a=e.line,o=e.tick,h=e._isHorz,l=e._isBetween,_=this._titleView;let c=0;return(this._lineView.visible=a.visible)?(this._lineView.setStyleOrClass(a._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new Nr(t,ga.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(a._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=o.options.length||0,this._markLen>0&&(c+=e.tick.options.gap||0),c+=this._markLen,this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),l&&(c*=2),this.$_prepareLabels(e,h?s:i)?c+=this._labelSize=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i):this._labelSize=0,this._simpleMode?_.setVis(!1):(_.visible&&(c+=h?_.mh:_.mw,c+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(c+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?s:c,height:h?c:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t._ticks,n=t._markPoints,a=this._labelViews,o=this._markLen,h=this.width,l=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?l:0,0,h):this._lineView.setVLine(s?0:h,0,l),this._lineView2&&(e?this._lineView2.setHLine(l,0,h):this._lineView2.setVLine(0,0,l))),this._markContainer.visible&&(e?this._markViews.forEach(((e,i)=>{e.resize(1,o),e.layout().trans(t.prev(n[i]),s?l-o:0)})):this._markViews.forEach(((e,i)=>{e.resize(o,1),e.layout().trans(s?0:h-o,l-t.prev(n[i]))})));const _=o+(t.tick.options.gap||0);if(this._labelContainer.visible&&a.count>0&&(e?this.$_layoutLabelsHorz(a,r,i,s,h,l,_):this.$_layoutLabelsVert(a,r,i,s,h,l,_)),!this._simpleMode){const i=t.title.options,r=this._titleView,n=this._scrollView,a=this._labelSize;let o=0,c=0;if(r.visible){const n=+i.offset||0,d=+i.gap||0;if(r.resizeByMeasured().layout(e),e){if(c+=s?0:_+a+d,t.options.reversed)switch(i.align){case"start":o=h-r.width/2-n;break;case"end":o=r.width/2+n;break;default:o=h/2-n}else switch(i.align){case"start":o=r.width/2+n;break;case"end":o=h-r.width/2-n;break;default:o=h/2+n}r.trans(o,c),c+=r.height}else{const e=0===r._angle?r.width:r.height;if(o=s?_+a+d+e/2:h-_-a-d-e/2,t.options.reversed)if(0===r._angle)switch(i.align){case"start":c=0+n;break;case"end":c=l-r.height-n;break;default:c=(l-r.height)/2+n}else switch(i.align){case"start":c=r.width/2-r.height/2+n;break;case"end":c=l-r.width/2-r.height/2-n;break;default:c=(l-r.height)/2+n}else if(0===r._angle)switch(i.align){case"start":c=l-r.height-n;break;case"end":c=0+n;break;default:c=(l-r.height)/2-n}else switch(i.align){case"start":c=l-r.width/2-r.height/2-n;break;case"end":c=r.width/2-r.height/2+n;break;default:c=(l-r.height)/2-n}r.trans(o,c)}}else c+=s?0:_+a;(null==n?void 0:n.visible)&&(e?(n.trans(0,c).resize(this.width,n.mh),n.setScroll(t._zoom,t.options.reversed)):(n.trans(0,0).resize(n.mw,this.height),n.setScroll(t._zoom,t.options.reversed)),n.layout())}}$_prepareTickMarks(t,e){const s=this._markContainer;if(s.visible=e.tick.visible){const i=e._markPoints.length,r=this._markViews;for(;r.length<i;){const e=new _a(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}_prepareLabel(t,e,s,i,r){if(!r&&t.value===e.value)return;const n=s.getLabelText(e,i),a=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s._style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=n){a&&n.match(pa)?t.setLabel(s,e,n.replace(pa,a),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,null,null),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,e,a,1e3,1e3)}$_prepareLabels(t,e){if(this._labelContainer.setVis(!this._chartEmpty&&t.labelsVisible())){let e=t._ticks.length;return this._labelContainer.setStyleOrClass(t.label._style),e}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz2(t,e,s,i,r,n,a,o){const h=t.label,l=f(0,m(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,u=(i=f(1,i))*(r=m(f(1,r),_.length)),p=n||0,g=w(p)*D,x=g<35*D;let y,b=!1,v=0;for(let n=0;n<r;n++){let r=n*i+l;for(;r<c;r+=u){let i=0;for(let e=r;e<r+u&&e<c;e++)i+=t.getLabelLength(s,_[e].value);if(r+u<c){y=e.pull(v++),y.rotation=p,y.row=n,y.index=r,this._prepareLabel(y,_[r],h,c,o),y.setVis(!0);const t=i;if(0===p&&y.getBBox().width>=t){b=!0;break}if(x&&y.getBBox().width*d(g)>=t){b=!0;break}if(0!==p&&y.getBBox().height>=t){b=!0;break}}}if(b)return!0;r-u<c&&(y=e.pull(v++),y.row=n,y.rotation=p,y.index=r-u,this._prepareLabel(y,_[r-u],h,c,o),y.setVis(!0))}!a&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=f(0,m(s-1,i.options.startStep||0));e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s=!1){const i=t.label,r=i.options;let n,a=+r.step|0,o=+r.rows|0,h=+r.rotation%360,l=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,o,h,!1,s),_=this._labelViews._internalItems();if(this._labelRowPts=[0],l)if("none"===r.autoArrange)this._labelViews.prepare(t._ticks.length,((e,r,n)=>{e.rotation=h,e.row=0,e.index=r,this._prepareLabel(e,t._ticks[r],i,n,s),e.setVis(!0)})),_=this.$_applyStep(t,_,a||1);else{switch(a=o=0,i.options.autoArrange){case"rows":o=this.$_getRows(_);break;case"step":a=this.$_getStep(_)}if(a>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,s);)a++;else if(o>1){for(;t._ticks.length>o&&(_.forEach(((t,e)=>{t.row=e%o,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,o,0,!1,s));)o++;this._labelRowPts=[]}else if((isNaN(h)||Math.abs(Math.tan(h*D))<1)&&(h=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,o,h,!1,s))for(a=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,o,h,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,o,0,!0,s)&&_.forEach(((t,e)=>{t.rotation=h}));break}a++}}else;if(_.length>0){if(o>1){const t=!isNaN(h)&&0!=h,e=this._labelRowPts;for(let t=0;t<o;t++)e.push(0);_.forEach((s=>{e[s.row]=f(e[s.row],t?s.rotatedHeight():s.getBBox().height)})),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(h)||0==h){n=_[0].getBBox().height;for(let t=1;t<_.length;t++)n=f(n,_[t].getBBox().height)}else{n=_[0].rotatedHeight();for(let t=1;t<_.length;t++)n=f(n,_[t].rotatedHeight())}return n}return 0}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=f(1,i);e.forEach((t=>t.rotation=0));for(let i=0;i<r-1;i+=n){let a=0;for(let o=i;o<i+n&&o<r-1;o++)a+=t.getLabelLength(s,e[i].value);if(e[i].getBBox().height>=a)return!0}}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,a=t._ticks,o=a.length,h=f(1,i);let l,_=0,c=0;for(;_<o;_+=h){let i=0;for(let e=_;e<_+h&&e<o;e++)i+=t.getLabelLength(s,a[e].value);if(_+h<o&&(l=e.pull(c++),l.rotation=0,l.index=_,this._prepareLabel(l,a[_],n,o,r),l.setVis(!0),l.getBBox().height>=i))return!0}_-h<o&&(l=e.pull(c++),l.rotation=0,l.index=_-h,this._prepareLabel(l,a[_-h],n,o,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1){const i=t.label;let r=f(1,+i.options.step|0);const n=this.$_checkOverlappedVert2(t,this._labelViews,e,r,s);let a=this._labelViews._internalItems();if(n)if("none"===i.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,r,n)=>{e.rotation=0,e.index=r,this._prepareLabel(e,t._ticks[r],i,n,s),e.setVis(!0)})),a=this.$_applyStep(t,a,r||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++r,s););else;if(a.length>0){let t=a[0].getBBox().width;for(let e=1;e<a.length;e++)t=f(t,a[e].getBBox().width);return t}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,a){const o=this.model,h=o.label,l=o.options.reversed,_=this._labelRowPts,c=t.get(0).rotation,d=c*D,p=c<-15&&c>=-90||c>15&&c<=90,g=t.count;let m,f;t.freeHiddens(),t.forEach(((t,s)=>{t.setContrast(null).layout("center");const r=t.getBBox();m=o.prev(e[t.index].pos),f=i?n-a-r.height-_[t.row]:a+_[t.row],c<-15&&c>=-90?i?(m-=r.width,f-=u(d)*r.height/2,t.setRotation(r.width,r.height/2,-c)):(m-=r.width,f+=u(d)*r.height/2,t.setRotation(r.width,r.height/2,c)):c>15&&c<=90?i?(f+=u(d)*r.height/2,t.setRotation(0,r.height/2,-c)):(f-=u(d)*r.height/2,t.setRotation(0,r.height/2,c)):(m-=r.width/2,t.setRotation(r.width/2,0,i?-c:c)),t.trans(m,f)})),!p&&g>1&&(function(e,s,i){let r=!0;const n=s.rotatedWidth();let a=s.tx;if(a<-e._marginStart-e._edgeStart)if("pull"===(l?h.options.lastOverflow:h.options.firstOverflow))if(a=-e._marginStart-e._edgeStart+2,t.count>0){const t=i.tx;a+n+(+h.options.overflowGap||12)>t&&(r=!1)}else r=!1;else r=!1;r?s.transX(a):s.setVis(!1)}(this,t.get(l?g-1:0),t.get(l?g-2:1)),function(t,e,s){let i=!0,n=e.tx;const a=e.rotatedWidth();if(n+a>(r+=t._marginEnd+t._edgeEnd)){const t=h.options;"pull"===(l?t.firstOverflow:t.lastOverflow)?(n=r-a,s?n<s.tx+s.rotatedWidth()+(+t.overflowGap||12)&&(i=!1):i=!1):i=!1}i?e.transX(n):e.setVis(!1)}(this,t.get(l?0:g-1),t.get(l?1:g-2)))}$_layoutLabelsVert(t,e,s,i,r,n,a){const o=this.model,h=i?"left":s?"center":"right",l=i?a:r-a;t.freeHiddens(),t.forEach(((t,a)=>{t.setContrast(null).layout(h);const _=t.getBBox(),c=i?l:s?(r-_.width)/2:l-_.width;t.trans(c,n-o.prev(e[t.index].pos)-_.height/2)}))}}ga.AXIS_CLASS="rct-axis",ga.LINE_CLASS="rct-axis-line",ga.TICK_CLASS="rct-axis-tick";class ma extends It{constructor(t,e,s){super(t,ma.STYLE),this.add(this._back=new Ls(t,ma.BACK_STYLE)),this.add(this._textView=new Qt(t)),s&&this.dom.classList.add(s),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),s=(new ta).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}ma.STYLE="rct-button",ma.BACK_STYLE="rct-button-background";class fa extends It{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class wa extends Xt{setArc(t,e,s,i,r,n){this.setPath(As.arc(t,e,s,s,i,close?i+r:i-r,n))}}class xa extends wa{setPolyline(t){this.setPath(As.lines(...t))}}class ya extends Xt{static create(t,e,s,i,r,n,a,o,h=!0){return new ya(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:a,angle:o,clockwise:h})}static createInner(t,e="",s,i,r,n,a,o,h,l=!0){return new ya(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:a,start:o,angle:h,clockwise:l})}constructor(t,e=T,s=T){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return As.sector(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.innerRadius||0,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}$_renderArc(){return As.arc(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}}const ba={};class va extends ia{static register(...t){t.forEach((t=>{ba[t[0].type]=t[1]}))}constructor(t,e){super(t,va.CLASS_NAME+" "+e,"rct-annotation-background")}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}_layoutView(t,e,s,i,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),s,i,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,a=i.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":a+=(r-this.height)/2+t.y;break;case"bottom":a+=r+t.y;break;default:a-=this.height+t.y}return{x:n,y:a}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this._background.setBounds(t.x,t.y,this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}setRotation(t,e,s){return this._background.setRotation(t,e,s),this._setRotation(t,e,s),this}_setRotation(t,e,s){}}va.CLASS_NAME="rct-annotation";const Va={};class Sa extends na{static register(...t){t.forEach((t=>{Va[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Ls(t,Sa.PANE_CLASS)),this.add(this._contentContainer=new Ht(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Sa.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=l(Rt.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof Ma)return t;t=t.parent}}}Sa.GAUGE_CLASS="rct-gauge",Sa.PANE_CLASS="rct-gauge-pane";class ka extends Ss{constructor(t,e,s){super(),this.view=t,this.from=e,this.to=s}_doUpdate(t){return this.view._runValue=this.from+(this.to-this.from)*t,this.view._renderValue(),!0}}class Pa extends Sa{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return o(i)?gt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._prevValue=0}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this._ani&&(this._ani.stop(),this._ani=null,this._prevValue=0),super._doLayout(),this._checkValueAnimation()}_getValue(t){return f(t.options.minValue,m(t.options.maxValue,x(this._runValue,t.options.value)))}_checkValueAnimation(){const t=this.model;this._animatable&&t.options.animatable&&t.options.value!==this._prevValue&&(this._ani=new ka(this,this._prevValue,t.options.value).start((()=>this._runValue=NaN)),this._prevValue=t.options.value)}}class Ca extends oa{}class Aa extends sa{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new Ht(t,"rct-gauge-scale-ticks")),this._ticks=new Zn(this._tickContainer,Nr),this.add(this._labelContainer=new Ht(t,"rct-gauge-scale-tick-labels")),this._labels=new Zn(this._labelContainer,Ca)}}class La extends Aa{_createLine(t,e){return new Nr(t,e)}_doMeasure(t,e,s,i,r){const n=e._reversed,a=e._vertical,o=e.label,h=e.tick,l=e._steps,_=l.length;let c=a?e.options.gap:s,d=a?i:e.options.gap;if(this._tickContainer.setVis(h.visible)&&(this._tickContainer.setStyleOrClass(h._style),this._ticks.prepare(_)),a?c+=h.options.length:d+=h.options.length,this._labelContainer.setVis(o.visible)&&(this._labelContainer.setStyleOrClass(o._style),this._labels.prepare(_,(e=>{e.setModel(t,o,null,null)})),_>0))if(a){let t=0;this._labels.forEach(((e,s)=>{e.setText(o.getText(l[n?s:_-1-s])),t=f(e.getBBox().width)})),c+=t}else{let t=0;this._labels.forEach(((e,s)=>{e.setText(o.getText(l[n?_-1-s:s])),t=f(e.getBBox().height)})),d+=t}return{width:c,height:d}}_doLayout(){const t=this.model;t._vertical?this.$_layoutVert(t,this.width,this.height):this.$_layoutHorz(t,this.width,this.height)}$_layoutHorz(t,e,s){const i=t.options,r=this._line,n=t.tick,a=t._steps;a.length;const o="opposite"===i.position,h=o?-n.options.length:n.options.length;let l,_=o?s-i.gap:i.gap;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setHLine(_,0,e)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((s,i)=>{l=t.getRate(a[i])*e,s.setVLine(l,_,_+h)})),this._labelContainer.visible){let s=Number.MIN_SAFE_INTEGER;_=o?0:_+h,this._labels.forEach(((i,r)=>{i.layout("center");const n=i.getBBox();l=t.getRate(a[r])*e,i.setVis(l-n.width/2>s)&&(i.trans(l-n.width/2,_),s=l+n.width/2)}))}}$_layoutVert(t,e,s){const i=t.options,r=this._line,n=t.tick,a=t._steps;this.height,a.length;const o="opposite"===i.position,h=o?n.options.length:-n.options.length;let l,_=o?i.gap:e-i.gap;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setVLine(_,0,s)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((e,i)=>{l=t.getRate(a[i])*s,e.setHLine(l,_,_+h)})),this._labelContainer.visible){o?Zt.START:Zt.END;const r=o?"left":"right";_=o?_+h:e-i.gap+h,this._labels.forEach(((e,i)=>{e.layout(r);const n=e.getBBox(),h=o?_:_-n.width;l=t.getRate(a[i])*s,e.trans(h,l-n.height/2)}))}}}class Ea extends Pa{_measureLabelSize(t,e,s){const i=t.label,r=this.labelView();return i.setText(t.getLabel(i,t.options.value)),r.text=i.options.text,i.buildSvg(r,null,e,s,t,i._domain),Qn(r.getBBox())}_renderGauge(t,e){const s=this.model,i=x(this._runValue,s.options.value);this._measureGauge(s,s.label,this.labelView(),i,s.isVertical(),t,e),this._renderValue()}_renderValue(){const t=this.model,e=t.label,s=t.scale,i=this.labelView(),r=x(this._runValue,t.options.value),n=l({},this._rBand);if(this._renderScale(n),this.background().setRect(n),n.height>0&&this._renderBand(t,n,r),"top"!==e._runPos&&"bottom"!==e._runPos||(this._rLabel.height=n.height),this._renderLabel(t,e,i,r),!this._vertical&&("left"===e._runPos||"right"===e._runPos)&&s.visible&&"opposite"===s.options.position){const t=i.getBBox();i.ty+t.height>this.height&&i.transY(f(0,this.height-t.height))}}_measureGauge(t,e,s,i,r,n,a){const o=this._rBand=Kn(0,0,n,a);if(this._vertical=t._group instanceof Zi?t._group.options.vertical:r,e.visible){const r=e._runPos=b(e.options.position,this._vertical?"top":"left"),h=e._runVert="top"===r||"bottom"===r,l=t._group?t._group.itemLabel.options.gap:e._runGap=e.getGap(h?a:n);let _=h?n:e.getWidth(n),c=h?e.getHeight(a):a;const d=h?n:e.getMaxWidth(n),u=h?e.getMaxHeight(a):a,p=this._rLabel=Kn(0,0,n,a);s.setStyleOrClass(e._style),e.setText(t.getLabel(e,e.options.animatable?i:t.options.value)),s.text=e.options.text,e.buildSvg(s,null,x(_,d),x(c,u),t,e._domain);const g=s.getBBox();switch(h?(p.height=x(c,g.height),o.height=f(0,o.height-(p.height+l))):(p.width=x(_,g.width),this._wLabel=t._group?t._group._labelWidth:p.width,o.width=f(0,o.width-(this._wLabel+l))),r){case"top":o.y=p.height+l;break;case"bottom":p.y=o.height+l;break;case"right":p.x=o.width+l;break;default:o.x=this._wLabel+l}}else this._rLabel=null}_renderLabel(t,e,s,i){if(s.visible){const t=this._rLabel,i=s.getBBox();let r=t.x,n=t.y;switch(e._runPos){case"top":case"bottom":r+=t.width/2;break;case"right":r=this.width-t.width,s.anchor=Zt.START,n+=f(0,(t.height-i.height)/2);break;default:s.anchor=Zt.END,r+=this._wLabel,n+=f(0,(t.height-i.height)/2)}s.trans(r,n)}}_renderScale(t){const e=this.model,s=e.label,i=e.scale,r=this.scaleView(),n=this._vertical?t.height:t.width;let a,o;if(i._vertical=this._vertical,i._reversed=e.options.reversed,isNaN(this._runValue)&&i.buildSteps(n,e.options.value),r.setVis(e.scaleVisible())){const e=r.measure(this.doc,i,t.width,t.height,1);this._vertical?(a=0,o=t.y,t.width=f(0,t.width-e.width),"opposite"===i.options.position?a=t.x+t.width:(s._runVert||(a=t.x),t.x+=e.width)):(a=t.x,t.height=f(0,t.height-e.height),"opposite"===i.options.position?s._runVert?(o=t.y,t.y+=e.height):(this._rLabel.y=t.y+=e.height,o=t.y-e.height):o=t.y+t.height),r.resizeByMeasured().layout().trans(a,o)}}}class Na extends Pa{}class Ma extends Sa{_defaultCalss(){return Ma.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new Ht(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach((i=>i._setChartOptions(t,e,s)))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach(((s,i)=>{s.prepareGauge(t,e.getVisible(i))}))}}Ma.GAUGE_GROUP_CLASS="rct-gauge-group";class Ta{static reveal(t,e){new Oa(t,e)}static grow(t,e){new Da(t,e)}static spread(t,e){new $a(t,e)}static fadeIn(t){new Ra(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);window.Animation&&s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Ra extends Ta{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:Ss.DURATION,fill:"none"})}}class Oa extends Ta{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Ss.DURATION,fill:"none"}}$_clipRect(t){let e;if(t.model.needClip(!1))e=t.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else{const s=t.control;e=t.model.chart.isInverted()?t.clipRect(-s.width(),.1*-t.height,2*s.width(),1.2*t.height):t.clipRect(.1*-t.width,-s.height(),1.2*t.width,2*s.height())}return e}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:j(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:j(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class Ba extends Ss{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof It}_stop(){super._stop(),this._series=null}}class Da extends Ba{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class $a extends Ba{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class za extends Ba{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}var Fa;class Ia extends Ss{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(qa.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(i)}_doStart(){this._marker.beginHover(this._sv,this._focused)}_doUpdate(t){return!!this._marker.parent&&(this._marker.setHoverRate(this._sv,this._focused,t),!0)}_doStop(){this._marker.setBoolData(qa.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Ha extends oa{constructor(t){super(t,"rct-point-label")}}class Ga extends Ht{constructor(t){super(t,"rct-point-labels"),this._labels=[new Zn(this,Ha),new Zn(this,Ha)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}prepareLabel(t,e,s,i,r,n){const a=r.getPointText(i,s,n.options.text),o=n._style;e.point=i,e.setModel(t,n,null,null),e._text.internalClearStyleAndClass(),e._text.internalSetStyleOrClass(o),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),a?(n.prepareRich(a),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(n.getValue(i,s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(i.visible){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,a=s._getLabeledPoints(),o=this._maps,h=i._style;n[0].prepare(a.length),o[0]={},n[1].prepare(r>1?a.length:0),o[1]={},a.forEach(((r,a)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(a);l.setVis(e.isPointVisible(r))&&(this.prepareLabel(t,l,h,r,s,i),o[h][r.pid]=l)}})),this.setStyleOrClass(h)}else this.clear()}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class ja extends ea{constructor(t){super(t),this.add(this._line=new Xt(t))}setLine(t){this._line.setPath(t)}}class Wa extends ea{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Zn(this,ja)}prepare(t){const e=this._lines,s=t.getPoints(),i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.count).forEach(((t,e)=>{const i=s.get(e);t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class Xa extends Ht{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform","")),this.inverted}}const Ya={},Ua="rct-point-hover",Za="rct-point-unhover";class qa extends na{static register(...t){t.forEach((t=>{Ya[t[0].type]=t[1]}))}constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointContainer=new Xa(t,"rct-series-points")),this._labelContainer=new Ga(t)}clipInvertable(){return!0}getClipContainer(){return this._pointContainer}getClipContainer2(){return null}defaultAnimation(){return"reveal"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}isPointVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.setVis(!1)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}pointByDom(t){return this._getPointPool().elementOf(t)}getPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&(this._clearHoverClasses(e),!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e))}_doPointClicked(t){}prepareSeries(t,e){this.setModel(e),this.setData("index",e.seriesIndex%12),this.setData("pointcolors",e._colorByPoint()?"a":T),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),e._calcedColor=getComputedStyle(this.dom)[this._legendColorProp()],this._visPoints=this._collectVisPoints(e),this._prepareSeries(t,e)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach((t=>{t!==e&&t.removeClass(Ua).addClass(Za)}))):this._getPointPool().forEach((t=>{t.containsClass(Za)&&t.removeClass(Za).addClass(Ua)}))}_clearHoverClasses(t){t instanceof It&&t.removeClass(Ua).removeClass(Za)}focusPoints(t){const e="none"!==this.model.options.hoverEffect,s=this._hoverAnis,i=this._hoverPts,r=[],n=[];e&&(i.forEach((e=>{if(e instanceof It&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.stop(),e.setBoolData(qa.DATA_FOCUS,!1),e.restoreStyles(),e instanceof ro&&r.push(new Ia(this,e,!1,(()=>{e.endHover(this,!1)})))}})),t&&t.forEach((t=>{if(!t.point.isNull){const e=s.find((e=>e._marker===t));e&&e.stop(),t instanceof It&&(t.setBoolData(qa.DATA_FOCUS,!0),n.push(t),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof ro?r.push(new Ia(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof oo&&this._getPointPool().front(t))}}))),s&&s.forEach(((t,e)=>{t._started&&r.push(t)})),this._hoverAnis=r,this._hoverPts=n,this.model.pointHovered(n&&n.length>0?n[0].point:null)}_needFocusOrder(){return!0}getPointsAt(t,e){}getSiblings(t){return[t]}getSibling(t){}_doAttached(t){this.control.loaded&&Vs(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof Zs&&e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new Xt(t,"rct-series-trendline")),this._trendLineView.setVis(!0)):this._trendLineView&&this._trendLineView.setVis(!1),{width:s,height:i}}_doLayout(){this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(this._inverted),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable())}_doAfterLayout(){this.model._xAxisObj._seriesChanged&&new za(this,(()=>{this.invalidate()}))}_collectVisPoints(t){return t._visPoints}$_setColorIndex(t,e){t.setData("index",e.index%12)}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this.$_setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this._animating()),this._labelContainer.visible?this._labelContainer:T}_getGrowRate(){return x(this._growRate,1)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void i.line(t[r+1].px,t[r+1].py);const n=.35,a={x:0,y:0},o={x:0,y:0},h={x:0,y:0},l={x:t[r+1].px-t[r].px,y:t[r+1].py-t[r].py};let _={x:0,y:0},c=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=c,l.y/=c;let d=t[r+1].px-t[r].px,u=t[r].px,p=t[r].py;for(++r;r!=s;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].px-t[r].px,l.y=t[r+1].py-t[r].py,c=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=c,l.y/=c,l.x<h.x?(_.x=h.x-l.x,_.y=h.y-l.y):(_.x=l.x-h.x,_.y=l.y-h.y);const e=Math.sqrt(_.x*_.x+_.y*_.y);_.x/=e,_.y/=e,h.y*l.y>=0&&(_={x:1,y:0}),a.x=-_.x*d*n,a.y=-_.y*d*n;const s=u+o.x,g=p+o.y,m=t[r].px+a.x,f=t[r].py+a.y;i.curve(s,g,m,f,t[r].px,t[r].py),d=t[r+1].px-t[r].px,o.x=_.x*d*n,o.y=_.y*d*n,u=t[r].px,p=t[r].py}i.curve(u+o.x,p+o.y,t[r].px,t[r].py,t[r].px,t[r].py)}$_renderTrendline(t){const e=this.model;if(!(e instanceof Zs))return;const s=e.trendline,i=e._xAxisObj,r=e._yAxisObj,n=r._vlen,a=i._vlen,o=s._points.map((e=>{let s,o;return t?(o=a-i.getPos(a,e.x),s=r.getPos(n,e.y)):(s=i.getPos(a,e.x),o=n-r.getPos(n,e.y)),{x:s,y:o}}));if(this._trendLineView.setVis(o.length>1)){const t=new tn;t.move(o[0].x,o[0].y),s.isCurved()?this._drawSpline(o.map((t=>({px:t.x,py:t.y}))),0,-1,t):t.lines(...o),this._trendLineView.setPath(t.end(!1))}}_layoutLabel(t,e,s){let{inverted:i,x:r,y:n,hPoint:a,labelView:o,labelOff:h}=t;if(!o.setVis(r>=0&&r<=e&&n>=0&&n<=s))return;o.layout(o.textAlign());const l=t.reversed?a<=0:a<0,_=o.getBBox();let c=!0;switch(i?n-=_.height/2:r-=_.width/2,t.labelPos){case"inside":i?r-=(a+_.width)/2+(t.reversed?h:-h):n+=(a-_.height)/2+(t.reversed?h:-h);break;case"head":i?l?r+=_.width-h:r-=_.width+h:l?n-=_.height+h:n+=h;break;case"foot":i?r-=l?a+_.width+h:a-h:n+=l?a+h:a-_.height-h;break;default:i?l?r-=_.width+h:r+=h:l?n+=h:n-=_.height+h,c=!1}o.setContrast(c&&t.pointView.dom),o.trans(r,n)}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const a="x"===s,o=a?this.model._xAxisObj:this.model._yAxisObj,h=o.options.reversed,l=o.getPos(a?t:e,f(o.axisMin(),i.fromValue)),_=o.getPos(a?t:e,m(o.axisMax(),i.toValue));n?a?h?r.setBounds(_,-e,w(_-l),e):r.setBounds(l,-e,w(_-l),e):r.setBounds(0,-f(l,_),t,w(_-l)):a?h?r.setBounds(_,0,w(_-l),e):r.setBounds(l,0,w(_-l),e):r.setBounds(0,e-f(l,_),t,w(_-l))}_setFill(t,e){s(e)&&e[Q]?t.internalSetStyle(Q,e[Q]):n(e)&&t.dom.classList.add(e)}_savePrevs(){}}qa.POINT_CLASS="rct-point",qa.DATA_FOCUS="focus",qa.DATA_UNFOCUS="unfocus",qa.DATA_UNHOVER="unhover",qa.LEGEND_MARKER="rct-legend-item-marker";class Ka extends Xt{constructor(t){super(t,qa.POINT_CLASS)}savePrevs(){}}class Qa extends Ka{constructor(){super(...arguments),this.labelViews=[]}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let Ja=class extends Qa{layout(t,e,s,i){this.x=t,this.setPath(As.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class to extends ea{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class eo extends qa{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e){this._preparePoints(t,e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class so extends eo{_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._prevRate,a=s.pointLabel,o=this._labelViews(),h=s._xAxisObj,_=s._yAxisObj,c=_.options.reversed,d=2*h.unitPad(),u=_.prev(i?t:e),p=h.prev(i?e:t),g=i?0:e,m=_.axisMin(),w=_.getPos(u,m),y=s.getBaseValue(_)||0,b=x(_.getPos(u,f(m,y)),w),v=!isNaN(y),V=t=>_.getPos(u,t),S=t=>h.getPos(p,t),k=o&&l(this._labelInfo,{inverted:i,reversed:c,labelPos:s.getLabelPosition(a.options.position),labelOff:s.getLabelOff(a.getOffset())});this._getPointPool().forEach(((a,l)=>{const _=a.point;if(a.setVis(!_.isNull)){const c=h.getUnitLen(p,_.xValue)*(1-d);let u=s.getPointWidth(c),m=V(_.yGroup),f=b;if(_.yGroup!=_.yValue){const t=y>_.yGroup,e=_.yGroup<0,s=_.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=_.yGroup-_.yValue*(i?-1:1);f=V(r)}const w=(m-f)*r;let x=S(_.xValue)-c/2;if(isNaN(x)){const t=h.getUnitLen(p,_.xValue)*(1-d);x=S(_.xValue)-t/2}let P=g-m;isNaN(n+a.wSave)||(u=a.wSave+(u-a.wSave)*n),x+=s.getPointPos(c)+u/2,isNaN(n+a.xSave)||(x=a.xSave+(x-a.xSave)*n),_.xPos=x,_.yPos=P,this._layoutPoint(a,l,x,g-b*(1-r)-f*r,u,w),i&&(P=p-S(_.xValue)+c/2,x=g,_.yPos=P-=s.getPointPos(c)+u/2,_.xPos=x+=v?V(_.yGroup)*r:V(_.yGroup*r)),k&&(k.labelView=o.get(_,0))&&(k.pointView=a,k.x=x,k.y=P,k.wPoint=u,k.hPoint=w,this._layoutLabel(k,t,e))}}))}}class io extends eo{_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,a=s.pointLabel,o=this._labelViews(),h=s._xAxisObj,_=s._yAxisObj,c=2*h.unitPad(),d=i?t:e,u=i?e:t,p=i?0:e,g=o&&l(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(a.options.position),labelOff:s.getLabelOff(a.getOffset())});this._getPointPool().forEach(((a,l)=>{const m=a.point;if(a.setVis(!m.isNull)){const f=h.getUnitLen(u,m.xValue)*(1-c);let w=s.getPointWidth(f);const x=(_.getPos(d,m.yValue)-_.getPos(d,this._getLowValue(m)))*r;let y=h.getPos(u,m.xValue)-f/2,b=p-_.getPos(d,m.yGroup)*r;isNaN(n+a.wSave)||(w=a.wSave+(w-a.wSave)*n),y+=s.getPointPos(f)+w/2,isNaN(n+a.xSave)||(y=a.xSave+(y-a.xSave)*n),m.xPos=y,m.yPos=b,this._layoutPoint(a,l,y,b,w,x),i&&(b=u-h.getPos(u,m.xValue)+f/2,y=p,m.yPos=b-=s.getPointPos(f)+w/2,m.xPos=y+=_.getPos(d,m.yGroup)*r),o&&(g.pointView=a,g.hPoint=x,g.x=y,g.y=b,(g.labelView=o.get(m,0))&&(g.hPoint=x,this._layoutLabel(g,t,e)),(g.labelView=o.get(m,1))&&(i?g.x-=x:g.y+=x,g.hPoint=-x,this._layoutLabel(g,t,e)))}}))}}class ro extends Ka{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull?Number.MAX_VALUE:Math.sqrt(Math.pow(this.point.xPos-e,2)+Math.pow(this.point.yPos-s,2))-t}}class no extends qa{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>As[t](0-e,0-e,2*e,2*e)})),e}constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}clipInvertable(){return!1}getPointsAt(t,e){return[]}_getDrawer(t){return no._drawers[t]||no._drawers.circle}_layoutLabelView(t,e,s,i,r,n){let a=t.getBBox();"auto"===e&&(e=this._getAutoPos(a.width>=2*i*.9)),t.setVis(null!=e)&&(r-=a.width/2,"inside"===e?t.trans(r,n-a.height/2):e&&t.trans(r,n-i-a.height-s))}}Fa=no,no._drawers=Object.assign({circle:t=>As.circle(0,0,t)},Fa._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class ao extends Ss{constructor(t){super(),this.series=t,this.duration=300}_doUpdate(t){return!!this.series&&(this.series._zombieRate=this.series._zombie.visible?t:1-t,this.series._resizeZombie(),!0)}_doStop(){this.series&&(this.series._zombie=null,this.series._zombieAni=null,this.series.invalidate(),this.series=null)}}class oo extends qa{togglePointVisible(t){var e;this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(200)}isPointVisible(t){return t===this._zombie||super.isPointVisible(t)}_collectVisPoints(t){let e=super._collectVisPoints(t);return this._willZombie&&!this._willZombie.visible&&(e.push(this._willZombie),e=e.sort(((t,e)=>t.index-e.index))),e}_prepareSeries(t,e){var s;this._zombie&&(this._zombie=null,null===(s=this._zombieAni)||void 0===s||s.stop(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new ao(this),this._zombieAni.start()),this.setData("pointcolors","f")}_createPointLegendMarker(t,e,s){return Ls.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){this._clearHoverClasses(i),s._legendMarker||s.setLegendMarker(this._createPointLegendMarker(t,s,this.chart()._legend.getMarkerSize())),this._setPointStyle(i,e,s),s._calcedColor=getComputedStyle(i.dom).fill}}class ho extends va{constructor(t){super(t,ho.CLASS_NAME),this.add(this._imageView=new aa(t,!1)),this._imageView.onloadProxy=()=>{const t=this._imageView.getBBox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);return this._deflatePaddings(n),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(n.width,n.height),Qn(this._imageView.getBBox())}_doLayout(t){this._imageView.trans(t.x+this._paddings.left,t.y+this._paddings.top),super._doLayout(t)}_setRotation(t,e,s){this._imageView.setRotation(t,e,s)}}ho.CLASS_NAME="rct-image-annotation";class lo extends va{constructor(t){super(t,lo.CLASS_NAME),this.add(this._shapeView=new Xt(t))}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);return this._deflatePaddings(n),As.setShape(this._shapeView,e.getShape(),n.width/2,n.height/2),n}_doLayout(t){this._shapeView.trans(this._paddings.left+t.x,this._paddings.top+t.y),super._doLayout(t)}_setRotation(t,e,s){this._shapeView.setRotation(t,e,s)}}lo.CLASS_NAME="rct-shape-annotation";class _o extends va{constructor(t){super(t,_o.CLASS_NAME),this.add(this._textView=new Qt(t)),this._textView.anchor=Zt.START,this._richText=new oe}_doMeasure(t,e,s,i,r){const n=e.options,a=e.getSize(s,i),o=this._textView;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),n.textOrientation&&this._textView.setStyle("textOrientation",n.textOrientation),this._deflatePaddings(a),this._richText.setFormat(n.text),this._richText.build(o,s,i,null,e._domain);const h=Qn(this._textView.getBBox());return{width:x(a.width,h.width),height:x(a.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(t.x+this._textView.tx,t.y+this._textView.ty),super._doLayout(t)}_setRotation(t,e,s){this._textView.setRotation(t,e,s)}}_o.CLASS_NAME="rct-text-annotation";let co=class extends sa{constructor(t){super(t,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._labelGap=3,this._barViews=new Zn(this,Ls),this.add(this._labelContainer=new Ht(t,"rct-linear-gauge-band-tick-labels")),this._labels=new Zn(this._labelContainer,Qt)}_doMeasure(t,e,s,i,r){const n=e.gauge,a=this._vertical=n instanceof Xi?n.isVertical():n.options.vertical,o=e.options.position,h=this._thick=e.getThickness(a?s:i)+("inside"===o?0:this._gap=x(e.options.gap,0));let l=a?h:s,_=a?i:h;const c=this._ranges=e.getRanges();if(this._labelContainer.setVis(e.tickLabel.visible&&c.length>0)){const t=[c[0].fromValue].concat(c.map((t=>t.toValue)));if(this._labelContainer.setStyleOrClass(e.tickLabel._style),this._labels.prepare(c.length+1),a){let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=f(s.getBBox().width)})),l+=e+this._labelGap}else{let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=f(s.getBBox().height)})),_+=e}}return{width:l,height:_}}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=i._max-i._min;this._labelContainer.setVis(this.$_layoutBars(s,r,this._ranges)&&this._labelContainer.visible&&"inside"!==e.options.position)&&this.$_layoutLabels(s,r,this._ranges)}$_layoutBars(t,e,s){if(this._barViews.prepare(s.length),!this._barViews.isEmpty&&e>0){const t=this._vertical,i="inside"===this.model.options.position,r="opposite"===this.model.options.position,n=this.width,a=this.height,o=t?a:n,h=this._thick;let l=0;return this._barViews.prepare(s.length).forEach(((_,c)=>{const d=s[c],u=o*(d.toValue-d.fromValue)/e;if(t){const t=i||r?0:n-h;_.setBounds(t,a-l-u,h,u)}else{const t=r?a-h:0;_.setBounds(l,t,u,this._thick)}_.internalClearStyleAndClass(),_.setFill(d.color),d.style&&_.addStyleOrClass(d.style),l+=u})),!0}}$_layoutLabels(t,e,s){const i="opposite"===this.model.options.position;if(this._vertical){const t=this.height,r=i?Zt.START:Zt.END,n=i?this._thick+this._labelGap:this.width-this._thick-this._labelGap;let a=this._labels.get(0);a.anchor=r,a.trans(n,t-a.getBBox().height/2);for(let i=1;i<=s.length;i++){const o=t-t*s[i-1].toValue/e;a=this._labels.get(i),a.anchor=r,a.trans(n,o-a.getBBox().height/2)}}else{const t=this.width,r=i?0:this._thick;this._labels.get(0).trans(0,r);for(let i=1;i<=s.length;i++){const n=t*s[i-1].toValue/e;this._labels.get(i).trans(n,r)}}}};class uo extends Ea{constructor(t){super(t,"rct-linear-gauge")}_doInitContents(t,e){e.add(this._background=new Ls(t,"rct-linear-gauge-background")),e.add(this._bandView=new co(t)),e.add(this._scaleView=new La(t)),e.add(this._valueView=new Ls(t,"rct-linear-gauge-value")),e.add(this._labelView=new Qt(t))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderScale(t){const e=this.model.band,s=this._bandView;if(super._renderScale(t),s.setVis(e.visible)){const i=+e.options.gap||0,r=s.measure(this.doc,e,t.width,t.height,1);s.resizeByMeasured().layout(),this._vertical?"inside"===e.options.position?s.trans(t.x,t.y):"opposite"===e.options.position?(s.trans(t.x+t.width-r.width,t.y),t.width-=r.width+i):(s.trans(t.x,t.y),t.width-=r.width+i,t.x+=r.width+i):"inside"===e.options.position?s.trans(t.x,t.y):"opposite"===e.options.position?(s.trans(t.x,t.y),t.height-=r.height+i,t.y+=r.height+i):(s.trans(t.x,t.y+t.height-r.height),t.height-=r.height+i)}}_renderBand(t,e,s){const i=this._valueView,r=t.options.reversed,n=t.valueBar,a=t._group?t._group.scale:t.scale;if(i.setVis(!Jn(e)&&n.visible&&!a.isEmpty()&&!isNaN(t.options.value)))if(i.setStyleOrClass(n._style),i.internalSetStyleOrClass(n.getStyle(t,s)),this._vertical){const t=e.height*a.getRate(s),n=r?e.y:e.y+e.height-t;i.setBounds(e.x,n,e.width,t)}else{const t=e.width*a.getRate(s),n=r?e.x+e.width-t:e.x;i.setBounds(n,e.y,t,e.height)}}}class po extends Ma{constructor(t,e){super(t,e)}_doInitContents(t,e){super._doInitContents(t,e),e.insertFirst(this._scaleView=new La(t)),e.insertFirst(this._textView=new Qt(t,"rct-linear-gauge-group-label"))}_prepareGauge(t,e){this._textView.setVis(e.label.visible)&&this._textView.setStyleOrClass(e.label._style),this._scaleView.setVis(e.scale.visible)&&this._scaleView.setStyleOrClass(e.scale._style),super._prepareGauge(t,e)}_doRenderGauges(t,e,s,i){const r=this.model,n=r.options,a=this._textView,o=Kn(0,0,s,i);if(a.visible){a.text=r.label.options.text,r.label.buildSvg(a,null,NaN,NaN,r,null);const t=this._textView.getBBox().height+r.label.getGap(i);o.y+=t,o.height-=t,a.trans(this.width/2,0)}r._labelWidth=r._labelHeight=0,this._gaugeViews.forEach(((t,e)=>{const n=t._measureLabelSize(r.get(e),s,i);r._labelWidth=f(r._labelWidth,n.width),r._labelHeight=f(r._labelHeight,n.height)}));const h=(_=o)&&l({},_);var _;const c=r.itemLabel.options.gap;n.vertical?(h.height-=r._labelHeight+c,r.itemLabel.options.opposite||(h.y+=r._labelHeight+c)):(h.width-=r._labelWidth+c,r.itemLabel.options.opposite||(h.x+=r._labelWidth+c)),this._renderScale(r,o,h),n.vertical?this.$_layoutVert(this.doc,r,e,o):this.$_layoutHorz(this.doc,r,e,o)}_renderScale(t,e,s){const i=this._scaleView,r=t.scale,n=t.options.vertical,a=n?e.height:e.width,o=[];let h,l;if(this._gaugeViews.forEach(((e,s)=>{o.push(x(e._runValue,t.get(s).options.value))})),r.buildGroupSteps(a,o),r._vertical=n,i.setVis(r.visible)){const t=i.measure(this.doc,r,s.width,s.height,1);if(n){const i=t.width;s.width-=i,e.width-=i,l=s.y,"opposite"===r.options.position?h=s.x+s.width:(h=s.x,s.x+=i,e.x+=i)}else{const i=t.height;s.height-=i,e.height-=i,h=s.x,"opposite"===r.options.position?(l=s.y,s.y+=i,e.y+=i):l=s.y+s.height}i.resizeByMeasured().layout().trans(h,l)}}$_layoutVert(t,e,s,i){const r=i.height,n=(i.width-e.options.itemGap*(s.count-1))/s.count,a=i.y;let o=i.x;s.forEach(((s,i)=>{s.measure(t,e.get(i),n,r,0),s.resize(n,r),s.layout(),s.trans(o,a),o+=n+e.options.itemGap}))}$_layoutHorz(t,e,s,i){const r=e.options.itemGap,n=i.width,a=(i.height-r*(s.count-1))/s.count,o=i.x;let h=i.y;s.forEach(((s,i)=>{s.measure(t,e.get(i),n,a,0),s.resize(n,a),s.layout(),s.trans(o,h),h+=a+r}))}}class go extends Ea{constructor(t){super(t,"rct-bullet-gage")}_doInitContents(t,e){e.add(this._background=new Ls(t,"rct-bullet-gauge-background")),e.add(this._barContainer=new Ht(t,void 0)),this._barViews=new Zn(this._barContainer,Ls),e.add(this._valueView=new Ls(t,"rct-bullet-gauge-value")),e.add(this._targetView=new Ls(t,"rct-bullet-gauge-target")),e.add(this._scaleView=new La(t)),e.add(this._labelView=new Qt(t))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderBand(t,e,s){const i=t.options,r=t._group,n=t.options.reversed,a=this._vertical,o=r?r.scale:t.scale,h=this._valueView,l=this._targetView;if(this._barContainer.setVis(!Jn(e)&&!o.isEmpty())){const s=t.getRanges(o._min,o._max,!1)||(null==r?void 0:r.getRanges(o._min,o._max,!1));s&&(this._barContainer.setRect(e),this._barViews.prepare(s.length),a?this._barViews.forEach(((t,i)=>{const r=s[i],a=e.height*o.getRate(r.toValue-r.fromValue),h=e.height*o.getRate(r.fromValue);t.setBounds(0,n?h:e.height-h-a,e.width,a),t.internalClearStyleAndClass(),t.setFill(r.color),r.style&&t.addStyleOrClass(r.style)})):this._barViews.forEach(((t,i)=>{const r=s[i],a=e.width*o.getRate(r.toValue-r.fromValue),h=e.width*o.getRate(r.fromValue);t.setBounds(n?e.width-a-h:h,0,a,e.height),t.internalClearStyleAndClass(),t.setFill(r.color),r.style&&t.addStyleOrClass(r.style)})))}if(h.setVis(!o.isEmpty()&&!isNaN(s)))if(h.setStyleOrClass(t.valueBar._style),s<i.targetValue&&t.valueBar.options.belowStyle&&h.internalSetStyleOrClass(t.valueBar.options.belowStyle),h.internalSetStyleOrClass(t.valueBar.getStyle(t,s)),a){const t=e.height*o.getRate(s),i=n?e.y:e.y+e.height-t;h.setBounds(e.x+e.width/3,i,e.width/3,t)}else{const t=e.width*o.getRate(s),i=n?e.x+e.width-t:e.x;h.setBounds(i,e.y+e.height/3,t,e.height/3)}if(l.setVis(!o.isEmpty()&&!isNaN(i.targetValue)))if(l.setStyleOrClass(t.targetBar._style),a&&e.width>10){let t=e.height*o.getRate(i.targetValue);t=n?e.y+t:e.y+e.height-t,l.setBounds(e.x+5,t-1,e.width-10,3)}else if(!a&&e.height>10){let t=e.width*o.getRate(i.targetValue);t=n?e.x+e.width-t:e.x+t,l.setBounds(t-1,e.y+5,3,e.height-10)}}}class mo extends Aa{setExtents(t,e){this._center=t,this._exts=e}_createLine(t,e){return new wa(t,e)}_doMeasure(t,e,s,i,r){const n=e._steps.length-(360===e.gauge.options.sweepAngle?1:0);return this._line.setVis(e.line.visible)&&this._line.internalSetStyleOrClass(e.line._style),this._tickContainer.setVis(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick._style),this._ticks.prepare(n)),this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.internalSetStyleOrClass(e.label._style),this._labels.prepare(n,(t=>{}))),{width:s,height:i}}_doLayout(t){const e=this.model,s=e._steps,i=e.gauge,r=i.options,n="opposite"===e.options.position?-1:1,a=i._props,o=this._center.x,h=this._center.y,l=this._exts.scale,_=l+this.model.tick.options.length*n,c=a._sweepRad,p=a._startRad,g=r.maxValue-r.minValue,m=r.clockwise;let f,w,x,y;if(this._line.visible&&this._line.setArc(o,h,l,p,m?c:-c,m),this._tickContainer.visible&&this._ticks.forEach(((t,i,r)=>{const n=e.getRate(s[i])*(m?c:-c)+p;f=o+d(n)*l,w=h+u(n)*l,x=o+d(n)*_,y=h+u(n)*_,t.setLine(f,w,x,y)})),this._labelContainer.visible){this._labels.get(0).setText(String(r.maxValue));const t=_+.2*this._labels.get(0).getBBox().height*n;this._labels.forEach(((i,a,l)=>{const _=e.getRate(s[a])*(m?c:-c)+p;i.setText(String(I(r.minValue+e.getRate(s[a])*g)));const f=i.getBBox();x=o+d(_)*(t+f.width/2*n)-f.width/2,y=h+u(_)*(t+f.height/2*n)-f.height/2,i.trans(x,y)}))}}}class fo extends sa{constructor(t){super(t,"rct-circle-gauge-band"),this._sectorViews=new Zn(this,ya),this.add(this._labelContainer=new Ht(t,"rct-circle-gauge-band-tick-labels")),this._labels=new Zn(this._labelContainer,Qt)}setExtends(t,e){this._center=t,this._exts=e}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=s._props,n=this._center.x,a=this._center.y,o=this._exts.band,h=s.options.clockwise,l=1-this._exts.bandThick/o,_=e.getRanges(),c=r._sweepRad;s.options.maxValue,s.options.minValue;let d=r._startRad;this._sectorViews.prepare(_.length).forEach(((t,e)=>{const s=i.getRate(_[e].toValue-_[e].fromValue)*c;t.setSector({cx:n,cy:a,rx:o,ry:o,innerRadius:l,start:d,angle:s,clockwise:h}),t.internalClearStyleAndClass(),t.setFill(_[e].color),_[e].style&&t.addStyleOrClass(_[e].style),d+=h?s:-s}))}}class wo extends Xt{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new tn).circle(0,0,s).end())),this.internalSetStyleOrClass(t._style),this}}class xo extends Xt{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new tn;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(t._style),this}}class yo extends Na{constructor(t){super(t,"rct-circle-gauge")}_doInitContents(t,e){e.add(this._rimView=new ya(t,"rct-circle-gauge-rim")),e.add(this._valueView=new ya(t,"rct-circle-gauge-value")),e.add(this._innerView=new ya(t,"rct-circle-gauge-inner")),e.add(this._textView=new Qt(t,"rct-circle-gauge-label")),e.add(this._handContainer=new Ht(t,void 0)),e.add(this._scaleView=new mo(t)),e.add(this._bandView=new fo(t))}_backgroundView(){return this._rimView}_prepareGauge(t,e){this._rimView.setVis(e.rim.visible),this._scaleView.setVis(e.scale.visible),this._bandView.setVis(e.band.visible),this._valueView.setVis(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new xo(t,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new wo(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(e.labelVisible())&&this._textView.setStyleOrClass(e.label._style)}_renderGauge(t,e){const s=this.model,i=s.getCenter(t,e),r=s.getExtents(m(t,e));this.$_renderBackground(s,i,r),this._renderValue()}_renderValue(){const t=this.model,e=t.options,s=t.scale,i=t.getProps(),r=this._getValue(t),n=s.getRate(x(r,0)),a=this._center,o=this._exts,h=t.valueRim.getThickness(o.radiusThick),l=this._textView;if(this._valueView.visible){const s=t.valueRim,l=s.options,_=s.getRange(e,r),c=o.value+(l.stroked?0:h/2),d=this._valueView;d.setStyleOrClass(s._style),_&&(d.setStyle(l.stroked?"stroke":"fill",_.color),_.style&&d.addStyleOrClass(_.style)),l.stroked&&(d.setFill("none"),d.setStyle("strokeWidth",j(h))),d.setBoolData("stroked",l.stroked),d.setSectorEx({cx:a.x,cy:a.y,rx:c,ry:c,innerRadius:(c-h)/c,start:i._startRad,angle:i._sweepRad*n,clockwise:e.clockwise},l.stroked)}if(this._handView){const e=(i._handRad+i._sweepRad*n)*$;this._handView.render(t.hand,o.radius).transp(a).rotate(t.options.clockwise?e:-e)}if(l.visible){const s=t.label;if(s.setText(t.getLabel(s,s.options.animatable?r:e.value)),l.text=s.options.text,s.buildSvg(l,null,NaN,NaN,t,s._domain),l.setBoolData("grouped",!!t._group),t._group)this.$_layoutGroupedLabel(t,l,o);else{const t=l.getBBox(),e=s.getOffset(this.width,this.height);l.trans(a.x+e.x,a.y-t.height/2+e.y)}}}$_renderBackground(t,e,s){const i=t.getProps(),r=i._startRad;this._center=e,this._exts=s,t.scale.buildSteps(s.scale*i._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim._style),this._rimView.setSector({cx:e.x,cy:e.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:r,angle:i._sweepRad,clockwise:t.options.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(t.scale._style),this._scaleView.measure(this.doc,t.scale,this.width,this.height,0),this._scaleView.setExtents(e,s),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(t.band._style),this._bandView.measure(this.doc,t.band,this.width,this.height,0),this._bandView.setExtends(e,s),this._bandView.layout()),this._innerView.setStyleOrClass(t.options.innerStyle);let n=s.inner;const a=getComputedStyle(this._innerView.dom),o=parseFloat(a.strokeWidth);o>1&&(n-=o/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,n).trans(e.x,e.y)}$_layoutGroupedLabel(t,e,s){const i=e.getBBox(),r=this._rimView.getBBox(),n=+t._group.options.labelGap||0;e.anchor=Zt.END,e.trans(r.x+r.width/2-n,r.y+(s.radius-s.inner-i.height)/2)}}class bo extends Ss{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class vo extends ro{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}beginHover(t,e){this._saveRadius=this._radius}setHoverRate(t,e,s){const i=this.point,r=(+t.model.marker.options.hoverScale||1.8)-1;let n=this._radius;e?isNaN(s)||(n=this._radius=this._saveRadius*(1+s*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(s)?r:r*s)),As.setShape(this,t.model.getShape(i),n,n),this.index>0?this.trans(i.px2-n,i.py2-n):this.trans(i.xPos-n,i.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,s){const i=0===this.index?this.point.xPos:this.point.px2,r=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:Math.sqrt(Math.pow(i-e,2)+Math.pow(r-s,2))-t}distance2(t,e,s,i){const r=0===this.index?this.point.xPos:this.point.px2,n=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:i?Math.abs(n-s):Math.abs(r-e)}}class Vo extends Xa{}class So extends qa{constructor(t,e){super(t,e),this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new Vo(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Xt(t,"rct-line-series-line")),this._markers=new Zn(this._pointContainer,vo)}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;s._line.setStyle("strokeWidth",e.strokeWidth),s._shape?(s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")):s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e){e instanceof $r&&this._prepareBelow(e),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_prepareViewRanges(t){super._prepareViewRanges(t),this._prepareRanges(t,t._runRanges)}_renderSeries(t,e){this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this.model.prepareLines(this._visPoints)}_doAfterLayout(){this._layoutLines()}_runShowEffect(t){this._polar?t&&Ta.grow(this):t&&Ta.reveal(this,{from:function(t){const e=t.model._xAxisObj.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines()}getPointsAt(t,e){return[]}getNearest(t,e){const s=this.model.marker.options.radius,i=this._markers._internalItems();if(i&&i.length>0){const r=i.reduce(((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r));return{pv:r,dist:r.distance(s,t,e)}}}getNearest2(t,e,s){const i=this.model.marker.options.radius,r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce(((r,n)=>r.distance2(i,t,e,s)<n.distance2(i,t,e,s)?r:n));return{pv:n,dist:n.distance2(i,t,e,s)}}}getHintDistance(){return this.model.marker.options.hintDistance}canHover(t,e,s){return t<=this.model.marker.options.radius+s}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow=t.options.belowStyle&&t._minY<t.getBaseValue(t._yAxisObj),this._needBelow)return r||(this._lineContainer.insertChild(r=this._lowLine=new Xt(this.doc,"rct-line-series-line rct-line-series-line-below"),this._line),this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds(),this._upperClip.setAttr(It.ASSET_KEY,"1"),this._lowerClip.setAttr(It.ASSET_KEY,"1")),this._line.setClip(this._upperClip),r.setClip(this._lowerClip),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new Zn(this._lineContainer,Xt)),i.prepare(e.length);s.length<e.length;){const t=new Wt(this.doc);t.setAttr(It.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach((t=>t.remove())),s.length=0)}$_resetClips(t,e,s,i){const r=this.model._yAxisObj.options.reversed;let n;(n=this._upperClip)&&(i?r?n.setBounds(0,-s,e,t):n.setBounds(0,-t,e,t-s):r?n.setBounds(0,0+s,t,e-s):n.setBounds(0,0,t,s)),(n=this._lowerClip)&&(this._inverted?r?n.setBounds(0,-t,e,t):n.setBounds(0,-s,e,t-s):r?n.setBounds(0,0,t,s):n.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof $r&&this._needBelow,i=s?t.getBaseValue(t._yAxisObj):NaN,r=[t.marker._style,null];if(this._pointContainer.setVis(!t._simpleMode)){const n=this._markersPerPoint(),a=s&&t.options.belowStyle,o=e.length;this._markers.prepare(o*n,((n,h)=>{const l=e[h%o];l.isNull||(n.point=l,r[1]=s&&l.yValue<i?a:null,this._setPointStyle(n,t,l,r)),n.point=l,n.index=h<o?0:1}))}else this._markers.prepare(0)}_layoutMarker(t,e,s,i){const r=this.model,n=t.point,a=t._radius=r.getRadius(n);e&&t.internalSetStyleOrClass(e),As.setShape(t,r.getShape(n),a,a),t.setPos(s,i),t.trans(s-=a,i-=a)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,a=this._inverted,o=i.needClip(!1),h=this._getGrowRate(),l=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,p=i.pointLabel,g=p.options.position,m=p.options.align,f=p.getAlignOffset(),w=p.options.textAlign,x=p.getOffset(),y=this._labelViews(),b=i._xAxisObj,v=i._yAxisObj,V=this._polar=i.chart._body.getPolar(b),S=!!V,k=v.prev(a?e:s),P=b.prev(V?V.rd*O:a?s:e),C=a?0:s,A=t.length;t.forEach(((t,i)=>{let r,p;if(V){const e=V.start+b.getPos(P,t.xValue),s=v.getPos(V.rd,t.yGroup)*h;r=t.px=V.cx+s*d(e),p=t.py=V.cy+s*u(e)}else r=t.px=b.getPos(P,t.xValue),p=t.py=C-v.getPos(k,t.yGroup),a&&(r=v.getPos(k,t.yGroup),p=s-b.getPos(P,t.xValue));t.xPos=r,t.yPos=p;const L=this._markers.get(i),E=y&&y.get(t,0);if(L&&L.setVis(!t.isNull&&(S||!o||r>=0&&r<=e&&p>=0&&p<=s))){this._layoutMarker(L,n,r,p);const t=0==i&&null!=_?_:i==A-1&&null!=c?c:l;if(L.setStyle("opacity",t?"1":"0"),E){E.setContrast(null).layout(w);const t=E.getBBox(),e=L._radius;switch(E.visible=!0,g){case"inside":p-=t.height/2+x;break;case"foot":p+=x+(l?e:0);break;default:p-=t.height+x+(l?e:0)}switch(m){case"left":r-=t.width+(l?e:0)+f;break;case"right":r+=(l?e:0)+f;break;default:r-=t.width/2+f}E.trans(r,p)}}else E&&E.setVis(!1)}))}_layoutLines(){const t=this.model;if(!this._lineContainer.setVis(t._lines.length>0))return;const e=this.width,s=this.height,i=this._inverted,r=t instanceof $r&&this._needBelow;let n=this._buildLines2(t._lines,this._polar);if(t._runRanges)this._rangeLines.forEach(((r,a)=>{const o=t._runRanges[a];r.setPath(n),r.internalClearStyleAndClass(),r.internalSetStyle("stroke",o.color),r.internalSetStyleOrClass(o.style),Rt.setImportantStyle(r.dom.style,Q,"none"),r.setClip(this._rangeClips[a]),this._clipRange(e,s,t._runRangeValue,o,this._rangeClips[a],i)}));else{const e=this._line;e.setPath(n),e.internalClearStyleAndClass(),e.internalSetStyle("stroke",t._runColor),e.internalSetStyleOrClass(t._style),Rt.setImportantStyle(e.dom.style,Q,"none")}if(r){const r=this._lowLine,a=t._yAxisObj,o=t.getBaseValue(a);i?this.$_resetClips(e,s,a.getPos(e,o),!0):this.$_resetClips(e,s,s-a.getPos(s,o),!1),r.setPath(n),r.internalClearStyleAndClass(),r.internalSetStyle("stroke",t._runColor),r.internalSetStyleOrClass(t._style),r.internalSetStyleOrClass(t.options.belowStyle),Rt.setImportantStyle(r.dom.style,Q,"none")}}_buildLine2(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve2(t,s,i):r instanceof $r&&"step"===e?this._drawStep2(t,s,i,s?r.backDir():r.options.stepDir):this._drawLine2(t,s,i)}_buildLines2(t,e){const s=this.model,i=s.getLineType(),r=new tn;return"spline"===i?this._drawCurves(t,r):s instanceof $r&&"step"===i?this._drawSteps(t,r,s.options.stepDir):this._drawLines(t,r),r.end(e)}_drawLine2(t,e,s){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)this.model instanceof $r&&this.model.options.connectNullPoints&&t[e].isNull||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this._drawLine2(t,!1,e)))}_drawStep2(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(i){case"backward":s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py);break;case"center":s.line((t[e].px+t[e-1].px)/2,t[e-1].py),s.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&s.line(t[e].px,t[e].py);break;default:s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py)}}}_drawSteps(t,e,s){t.forEach((t=>this._drawStep2(t,!1,e,s)))}_drawCurve2(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),this._drawSpline(t,0,t.length-1,s))}_drawCurves(t,e){t.forEach((t=>this._drawCurve2(t,!1,e)))}_drawCurve(t,e,s){const i=t.length;let r;if(t&&t.length>1){let n=e;for(r=e;r<i;)if(t[r].isNull){r-1>n&&this._drawSpline(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].px,t[r].py),r++)}else r++;r-1>n&&this._drawSpline(t,n,r-1,s)}}_buildAreas(t,e,s){const i=new tn;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];this._buildLine2(n,e,!1,i),this._buildLine2(a,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class ko extends So{constructor(t){super(t,ko.CLASS),this._flagView=new oa(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){super._doLayout();const t=this.model,e=t.flag,s=this._flagView;let i;if(s.setVis(e.visible&&!!(i=e.label()))){s.setText(i),s.setModel(this.doc,e,null,null),s.layout("left");const r=e.options.offset,n=s.getBBox();let a,o;a=this._markers.last.x,o=this._markers.last.y,this._inverted?(t._xAxisObj.options.reversed?o+=r:o-=r+n.height,a-=n.width/2):(t._xAxisObj.options.reversed?a-=r+n.width:a+=r,o-=n.height/2),s.trans(a,o)}}}ko.CLASS="rct-line-series";class Po extends So{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new Vo(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Xt(t,"rct-area-series-area"))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}getClipContainer2(){return this._areaContainer}_prepareBelow(t){let e=this._lowArea;if(super._prepareBelow(t))return e||this._areaContainer.add(e=this._lowArea=new Xt(this.doc,"rct-area-series-area")),this._area.setClip(this._upperClip),e.setClip(this._lowerClip),!0;null==e||e.setClip(),this._area.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);let s=this._rangeAreas,i=this._rangeAreaClips;if(e){for(s||(s=this._rangeAreas=new Zn(this._areaContainer,Xt,"rct-area-series-area")),s.prepare(e.length);i.length<e.length;){const t=new Wt(this.doc);t.setAttr(It.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),i.push(t)}for(;i.length>e.length;)i.pop().remove()}else s&&(s.freeAll(),i.forEach((t=>t.remove())),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,a=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=a-r.getPos(n,s.yGroup-s.yValue)}}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar?this._layoutPolar(this._area,this._visPoints):this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model,s=e.options;if(!this._areaContainer.setVis(e._areas.length>0))return;const i=this.width,r=this.height,n=e.chart.isInverted(),a=this._needBelow?this._lowArea:void 0,o=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,s)=>{const a=e._runRanges[s];t.setBoolData("simple",this._simpleMode),t.setPath(o),t.internalClearStyleAndClass(),t.setFill(a.color),this._setFill(t,a.style),a.areaStyle&&t.internalSetStyleOrClass(a.areaStyle),t.setClip(this._rangeAreaClips[s]),this._clipRange(i,r,e._runRangeValue,a,this._rangeAreaClips[s],n)})):(t.setPath(o),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(Q,e._runColor),this._setFill(t,s.style),e.options.areaStyle&&t.internalSetStyleOrClass(s.areaStyle)),a&&(a.setBoolData("simple",this._simpleMode),a.setPath(o),a.internalClearStyleAndClass(),e._runColor&&a.internalSetStyle(Q,e._runColor),s.areaStyle&&a.internalSetStyleOrClass(s.areaStyle),this._setFill(a,e.options.belowStyle),s.belowAreaStyle&&a.internalSetStyleOrClass(s.belowAreaStyle))}_layoutPolar(t,e){const s=this.model,i=s._group,r=s._yAxisObj,n=r instanceof Ei?s.getBaseValue(r):NaN,a=this.height;r.getPos(a,k.isNotEmpty(n)?n:r.axisMax());const o=new tn;if(!i||"stack"!==i.options.layout&&"fill"!==i.options.layout){o.move(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)o.line(e[t].xPos,e[t].yPos);t.setPath(o.end())}else{o.move(e[0].xPos,e[0].yLow),o.line(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)o.line(e[t].xPos,e[t].yPos);o.line(e[e.length-1].xPos,e[e.length-1].yLow);for(let t=e.length-1;t>=0;t--)o.line(e[t].xPos,e[t].yLow);t.setPath(o.end())}t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style)}}class Co extends ya{constructor(t){super(t,qa.POINT_CLASS)}savePrevs(){}}class Ao extends so{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_preparePoints(t,e,s){e.chart.isPolar()?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.options.baseValue&&e.options.belowStyle&&t.addStyleOrClass(e.options.belowStyle)}_layoutPoints(t,e){this.model.chart.isPolar()?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s){this._bars||(this._bars=this._createBarPool(this._pointContainer)),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_parepareSectors(t,e,s){this._sectors||(this._sectors=new Zn(this._pointContainer,Co)),this._sectors.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart._body,n=t._xAxisObj,a=t._yAxisObj,o=r.getPolar(n),h=n.getTotalAngle(),l=o.cx,_=o.cy;let c,p,g;i&&(c=this._labelInfo,p=t.getLabelPosition(s.options.position),g=t.getLabelOff(s.getOffset())),this._sectors.forEach(((s,r)=>{const m=s.point,f=a.getPos(o.rd,m.yValue)*e;let w=a.getPos(o.rd,m.yGroup)*e;const x=n.getUnitLen(h,m.xValue),y=t.getPointWidth(x);let b=o.start+n.getPos(h,m.xValue);if(b+=t.getPointPos(x),s.setSector({cx:l,cy:_,rx:w,ry:w,innerRadius:(w-f)/w,start:b-y/2,angle:y,clockwise:!0}),b=s.start+s.angle/2,m.xPos=l+s.rx*d(b),m.yPos=_+s.ry*u(b),i&&(c.labelView=i.get(m,0))){c.labelView.layout("center");const t=c.labelView.getBBox();let e;"outside"===p?(w=_+(s.ry+t.height+g)*u(b),e=l+(s.rx+t.width+g)*d(b)):"head"===p?(w=_+(s.ry-t.height/2-g)*u(b)-t.height/2,e=l+(s.rx-t.height/2-g)*d(b)):(w=_+.7*s.ry*u(b)-t.height/2,e=l+.7*s.rx*d(b)),c.labelView.trans(e-t.width/2,w)}}))}}class Lo extends to{constructor(t){super(t,qa.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const s=this.point,i=s.yValue-s.minValue,r=t/2;const n=0+e-e*(s.lowValue-s.minValue)/i,a=0+e-e*(s.highValue-s.minValue)/i,o=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,a),this._stemDown.setVLine(r,n,e),this._min.setHLine(0,t/4,3*t/4),this._max.setHLine(0+e,t/4,3*t/4),this._box.setBox(0,a,t,o),this._mid.setHLine(0+e-e*(s.midValue-s.minValue)/i,0,t)}_doInitChildren(t){this.add(this._stemUp=new Nr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Nr(t,"rct-boxplot-point-stem")),this.add(this._box=new Ls(t,"rct-boxplot-point-box")),this.add(this._mid=new Nr(t,"rct-boxplot-point-mid")),this.add(this._min=new Nr(t,"rct-boxplot-point-min")),this.add(this._max=new Nr(t,"rct-boxplot-point-max"))}}class Eo extends ro{}let No=class extends to{constructor(t){super(t,qa.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(f(s.openValue,s.closeValue)-s.lowValue)/i),a=m(n,r),o=f(1,w(r-n)),h=s.close<s.open;this.x=this.tx+0,this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,e),this._body.setBox(-t/2,a,t,o),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._wickUpper=new Nr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Nr(t,"rct-candlestick-point-wick")),this.add(this._body=new Ls(t))}};class Mo extends Ka{layout(t,e,s){const i=new tn;i.circle(t,e,s),this.setPath(i.end())}}let To=class extends to{constructor(t){super(t,qa.POINT_CLASS),this.add(this._line=new Nr(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Xt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Xt(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,a=this.point,o=a.radius,h=a.lowRadius,l=s/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let _=t.getMarkerStyle(a);_&&r.internalSetStyleOrClass(_),_=e.getMarkerStyle(a),_&&n.internalSetStyleOrClass(_),this.x=this.tx+l,this._line.setVLine(l,0,i),As.setShape(r,a.shape,o,o),As.setShape(n,a.lowShape,h,h),r.trans(l-o,0-o),n.trans(l-h,i-o)}};let Ro=class extends ea{constructor(t){super(t,qa.POINT_CLASS),this._segments=new Zn(this,Xt),this._decimal=0,this.add(this._back=new Ls(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach(((t,e)=>{}))}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map((t=>-t))),this._back.setBounds(e,s-r,i,r),this._segments.forEach(((a,o,h)=>{o===h-1&&this._decimal>0?a.setPath(As.rectangle(e,s-t[2*o],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):a.setPath(As.rectangle(e,s-t[2*o],i,n(-1,t[2*o]-t[2*o+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};let Oo=class extends to{constructor(t){super(t,qa.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Nr(t)),this.add(this._whiskerUp=new Nr(t)),this.add(this._whiskerDown=new Nr(t)),this.add(this._back=new Ls(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const s=t/2;this.x=this.tx+s,this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class Bo extends Ka{}class Do extends Ls{constructor(t){super(t,qa.POINT_CLASS)}}let $o=class extends Qa{layout(t,e){this.setPath(As.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class zo extends ea{constructor(t){super(t,qa.POINT_CLASS),this.add(this._line=new Nr(t,"rct-lollipop-point-bar")),this.add(this._marker=new Xt(t,"rct-lollipop-point-marker"))}layout(t){const e=this.point.radius;this._line.setVLine(0,0,t),As.setShape(this._marker,this.point.shape,e,e),this._marker.trans(-e,-e)}savePrevs(){this.xSave=this.tx}}class Fo extends to{constructor(t){super(t,qa.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(m(s.openValue,s.closeValue)-s.lowValue)/i,a=0+e-e*(f(s.openValue,s.closeValue)-s.lowValue)/i,o=s.close<s.open;this.x=this.tx+0,this._back.setBox(r,0,t,e),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(a,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",o)}_doInitChildren(t){this.add(this._tickOpen=new Nr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Nr(t,"rct-ohlc-point-tick")),this.add(this._bar=new Nr(t)),this.add(this._back=new Ls(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class Io extends ya{constructor(t){super(t,qa.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1)}}class Ho extends ro{setHoverRate(t,e,s){const i=this.point,r=t._getDrawer(t.model.getShape(this.point)),n=(+t.model.options.hoverScale||1.8)-1;let a=t._radius;e?this._radius=a=t._radius*(1+(isNaN(s)?1:s)*n):a=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(a)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._radius}}class Go extends Ls{constructor(t){super(t,qa.POINT_CLASS)}get point(){return this.node.point}render(t){if(1!==t){const e=Object.assign({},this.node);e.width*=t,e.height*=t,e.x+=(this.node.width-e.width)/2,e.y+=(this.node.height-e.height)/2,this.setRect(e)}else this.setRect(this.node)}}class jo extends Ka{layout(t,e,s,i){const r=this.point._len,n=r*i,a=.5;let o,h=(r-n)/2;switch(t){case"none":o=[0,h-a*n,0,h+a*n];break;case"open":const t=.15,e=.45,s=.2;o=[0,h-e*n,0-t*n,h-s*n,0,h-a*n,0+t*n,h-s*n,0,h-e*n,0,h+a*n];break;default:const i=.1,r=.3;o=[0,h-r*n,0-i*n,h-r*n,0,h-a*n,0+i*n,h-r*n,0,h-r*n,0,h+a*n]}const l=this.point._off*i,_=["M",o[0],o[1]+l];for(let t=2;t<o.length;t+=2)_.push("L",o[t],o[t+1]+l);this.rotation=e,this.setPath(_)}}function Wo(t,e){return new(ba[e._type()])(t)}function Xo(t,e){return new(Ya[e._viewType()])(t)}qa.register([Ir,Po],[Gr,class extends So{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Vo(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Xt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Xt(t,"rct-areanrange-series-line")),Rt.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}getSiblings(t){return[t,this._markers.find((e=>e!==t&&e.point===t.point))]}getSibling(t){return t&&this._markers.find((e=>e!==t&&e.point===t.point))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r._style,a=r.visible,o=this._inverted;i._xAxisObj;const h=i._yAxisObj,l=o?e:s,_=o?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=_-h.getPos(l,s.lowValue)}const c=this._markers;for(let _=0,d=t.length;_<d;_++){const u=t[_],p=c.get(d+_);let g,m;o?(g=u.px2=h.getPos(l,u.lowValue),m=u.py2=c.get(_).ty+i.getRadius(u)):(g=u.px2=u.xPos,m=u.py2=u.yLow),p&&p.setVis(!u.isNull&&g>=0&&g<=e&&m>=0&&m<=s)&&(this._layoutMarker(p,n,g,m),p.setStyle("opacity",a||0==_&&!0===r.options.firstVisible||_===d-1&&!0===r.options.lastVisible?"1":"0"))}}_layoutLines(){super._layoutLines();const t=this._area,e=this.model;if(!this._areaContainer.setVis(e._lines.length>0))return;const s=this._buildAreas(e._lines,e.getLineType());t.setPath(s),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.setFill(e._runColor),this._setFill(t,e._style),e.options.areaStyle&&t.internalSetStyleOrClass(e.options.areaStyle)}}],[kr,class extends Ao{constructor(t){super(t,"rct-bar-series")}_createBarPool(t){return new Zn(t,Ja)}_prepareSeries(t,e){super._prepareSeries(t,e),this._rdTop=+e.options.topRadius||0,this._rdBottom=+e.options.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom)}}],[vr,class extends io{constructor(t){super(t,"rct-barrange-series"),this._bars=new Zn(this._pointContainer,Ja)}_getPointPool(){return this._bars}_prepareSeries(t,e){super._prepareSeries(t,e),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_getLowValue(t){return t.lowValue}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i+n,this._rd,this._rd)}}],[Yr,class extends Po{constructor(t){super(t,"rct-bellcurve-series")}}],[Zr,class extends io{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Zn(this._pointContainer,Lo)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}],[Kr,class extends no{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new Zn(t,Eo)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){t.getShape();const s=e.length;this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getAutoPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),a=this._getGrowRate(),o=+i.rotation||0,h=s.pointLabel,l=h.options.position,_=h.getOffset(),c=this._labelViews(),p=s._xAxisObj,g=s._yAxisObj,m=this._polar=s.chart._body.getPolar(p),f=g.prev(r?t:e),w=p.prev(m?m.rd*O:r?e:t),x=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:y,max:b}=s.getPixelMinMax(x),v=r?0:e,V=this._getDrawer(i.shape);let S;this._markers.forEach(((i,h)=>{const x=i.point,k=c&&(S=c.get(x,0));if(i.setVis(!x.isNull&&!isNaN(x.zValue))){const h=(i._radius=s.getRadius(x.zValue,y,b))*a;let c,P;if(m){const t=m.start+p.getPos(O,x.xValue),e=g.getPos(m.rd,x.yValue);c=m.cx+e*d(t),P=m.cy+e*u(t)}else c=p.getPos(w,x.xValue),P=v-g.getPos(f,x.yValue),r&&(c=g.getPos(f,x.yValue),P=e-p.getPos(w,x.xValue));x.xPos=c,x.yPos=P,i.setVis(!n||c>=0&&c<=t&&P>=0&&P<=e)?(i.setPath(V(h)).trans(c,P).rotate(o),k&&(S.setContrast(i.dom).layout("center"),this._layoutLabelView(S,l,_,h,c,P))):k&&k.setVis(!1)}else k&&k.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems().reduce(((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i));return{pv:s,dist:s.distance(s._radius,t,e)}}canHover(t,e,s){return t<=e._radius+s}}],[sn,class extends io{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Zn(this._pointContainer,No)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}}],[nn,class extends Ao{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Zn(t,Mo)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}],[ln,class extends io{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Zn(this._pointContainer,To)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(this.model.marker,this.model.lowMarker,r,n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._hmarker.setFill(e),t._lmarker.setFill(e)}}],[cn,class extends so{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Zn(this._pointContainer,Ro)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_layoutPoints(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPoints(t,e)}_layoutPoint(t,e,s,i,r,n){const a=this._prevRate;isNaN(a+t.wSave)||(r=t.wSave+(r-t.wSave)*a),isNaN(a+t.xSave)||(s=t.xSave+(s-t.xSave)*a),t.wPoint=r,t.hPoint=n,t.layout(this._pts,s,i)}$_parepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_buildSegments(t,e){const s=t.options,i=t._yAxisObj.axisMax(),r=s.segmented,n=s.segmentGap||0,a=this._pts=[];let o,h,l=0;for(h=s.maxCount>0?s.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),o=(e-n*(h-1))/h;a.length<2*h;)a.push(l,l+o),l+=o+n;a[a.length-1]=e;const _=a.length/2;this._bars.forEach((t=>{const n=t.point;if(t.setVis(!n.isNull)){const h=n.yValue/i;let l=-1,c=0;for(let t=0;t<_-1;t++)if(h>=a[2*t]/e&&h<a[2*(t+1)]/e){l=t+1,c=!r&&h<a[2*t+1]/e?h*e-a[2*t]:o;break}l<0&&(l=_,c=o),t.prepareSegments(_,l,c,s.backStyle)}}))}}],[dn,class extends io{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Zn(this._pointContainer,Oo)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}],[pn,class extends oo{constructor(t){super(t,"rct-funnel-series"),this._segments=new Zn(this._pointContainer,Bo),this.add(this._lineContainer=new Wa(t))}_getPointPool(){return this._segments}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSegments(t,e,this._visPoints),this._lineContainer.prepare(e)}_renderSeries(t,e){this.$_calcRates(this._visPoints),this.$_layoutSegments(t,e)}_runShowEffect(t){t&&Ta.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_resizeZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,s){this._segments.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcRates(t){const e=t.length;let s=0,i=0;if(t.forEach((t=>{s+=t.yValue*(t===this._zombie?this._zombieRate:1)})),e>1||e>0&&!this._zombie){let r=0;for(;r<e-1;r++){const e=t[r],n=I(e.yValue*(e===this._zombie?this._zombieRate:1)/s)||0;e.yRate=100*n,e.yPos=i,e.height=n,i+=n}t[r].yPos=i,t[r].height=1-i}else if(1==e){const e=t[0],s=I(this._zombieRate);i=1-s,e.yRate=100*s,e.yPos=i,e.height=s,e.yPos=i,e.height=1-i}}$_layoutSegments(t,e){function s(t){return _?g+(b-g)*(f-t)/(f-v):g+(b-g)*(t-m)/(v-m)}const i=this.model,r=this._labelViews(),n="inside"===i.getLabelPosition(),a=i.pointLabel,o=a.getOffset(),h=r&&a.options.distance||0,l=this._lineContainer,_=i.options.reversed,c=i.getSize(t,e),d=i.getNeckSize(c.width,c.height),u=new tn,p=i.getCenter(t,e),g=p.x-c.width/2,m=p.y-c.height/2,f=m+c.height,x=g+c.width/2,y=c.height-d.height,b=g+(c.width-d.width)/2,v=_?f-y:m+y;let V;this._lineContainer.setVis(r&&!n),this._segments.forEach((t=>{var e;const i=t.point;if(t.setVis(!i.isNull)){const a=i.yPos*c.height,p=(i.yPos+i.height)*c.height,g=_?f-a:m+a,S=_?f-p:m+p;let k,P,C,A;if(a>=y?(k=b,P=k+d.width,u.move(k,g).lines(P,g,P,S,k,S),t.ny=t.nx1=NaN):p<y?(k=s(g),P=k+2*(x-k),C=s(S),A=C+2*(x-C),u.move(k,g).lines(P,g,A,S,C,S),t.ny=NaN,t.nx1=C-k,t.nx2=A-k):(k=s(g),P=k+2*(x-k),C=b,A=C+d.width,u.move(k,g).lines(P,g,A,v,A,S,C,S,C,v),t.ny=v-g,t.nx1=C-k,t.nx2=A-k),t.setPath(u.close(!0)),i.xPos=x,i.yPos=g+(S-g)/2,r&&(V=r.get(i,0))){const e=l.get(i);if(e.setVis(!n)){const s=t.getBBox();let r=i.xPos,n=i.yPos;isNaN(t.ny)?isNaN(t.nx1)||(r-=t.nx1*s.height/2/s.height):w(t.ny)>s.height/2&&(r-=t.nx1*s.height/2/w(t.ny)),this.$_layoutLabel(V,s,e,o,h,r,n)}else this.$_layoutLabelInner(V,i.xPos,i.yPos);V.setContrast(n&&t.dom)}else null===(e=l.get(i))||void 0===e||e.setVis(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const o=t.getBBox();n+=e.width/2,s.setLine((new tn).move(0,0).line(r,0).end()),s.trans(n,a),n+=r+i,t.trans(n,a-o.height/2)}$_layoutLabelInner(t,e,s){const i=t.getBBox();t.trans(e-i.width/2,s-i.height/2)}}],[mn,class extends qa{constructor(t){super(t,"rct-heatmap-series"),this._cells=new Zn(this._pointContainer,Do)}_getPointPool(){return this._cells}_prepareSeries(t,e){this.$_parepareCells(e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this.$_layoutCells(t,e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutCells(this.width,this.height)}$_parepareCells(t,e){const s=new Tt(t._calcedColor),i=[{fill:void 0}],r=t._heatMin,n=t._heatMax-r;this._cells.prepare(e.length,((a,o)=>{const h=a.point=e[o];i[0].fill=s.brighten(1-(h.zValue-r)/n).toString(),this._setPointStyle(a,t,h,i)}))}$_layoutCells(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._labelViews(),a=s._xAxisObj,o=s._yAxisObj,h=i?t:e,l=i?e:t,_=i?0:e;this._cells.forEach((t=>{const e=t.point;if(t.setVis(!e.isNull)){const s=a.getUnitLen(l,e.xValue)*r,c=o.getUnitLen(h,e.yValue)*r;let d,u=a.getPos(l,e.xValue)-s/2,p=_-o.getPos(h,e.yValue)-c/2;if(e.xPos=i?_+o.getPos(h,e.yValue):u+s/2,e.yPos=i?l-a.getPos(l,e.xValue)+s/2:p+c/2,t.setBounds(u,p,s,c),n&&(d=n.get(e,0))){d.layout("center");const t=d.getBBox();i?(p=l-a.getPos(l,e.xValue)-t.height/2,u=_+o.getPos(h,e.yValue)):(u+=s/2,p+=(c-t.height)/2),u-=t.width/2,d.trans(u,p)}}}))}}],[xn,class extends eo{constructor(t){super(t,"rct-histogram-series"),this._bars=new Zn(this._pointContainer,$o)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,a=this._labelViews(),o=s._xAxisObj,h=s._yAxisObj,_=i?t:e,c=i?e:t,d=h.getPos(_,s.getBaseValue(h)),u=i?0:e,p=a&&l(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.options.position),labelOff:s.getLabelOff(n.getOffset())});this._getPointPool().forEach(((s,n)=>{const l=s.point,g=o.getPos(c,l.min),m=o.getPos(c,l.max),f=h.getPos(_,l.yValue),w=m-g+(m>g?-1:1),x=f-d;let y=g+(m-g)/2,b=u;l.xPos=y,l.yPos=b-=f,this._layoutPoint(s,n,y,b+x,w,x*r),p&&(p.labelView=a.get(l,0))&&(i&&(b=c-y,y=u,l.yPos=b,l.xPos=y+=h.getPos(_,l.yGroup)),p.pointView=s,p.x=y,p.y=b,p.wPoint=w,p.hPoint=x,this._layoutLabel(p,t,e))}))}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach(((a,o)=>{const h=a.point,l=s.getPos(t,h.min),_=s.getPos(t,h.max),c=l+(_-l)/2,d=i.getPos(e,a.point.yValue)*n,u=f(1,_-l-1);h.xPos=c,h.yPos=r-d,a.wPoint=u,a.hPoint=d,a.layout(c,r)}))}}],[$r,ko],[vn,class extends so{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,s){const i=e.marker,r=i._style;i.options.styleCallback,this._bars||(this._bars=new Zn(this._pointContainer,zo)),this._bars.prepare(s.length,((t,n)=>{const a=t.point=s[n];this._setPointStyle(t,e,a),r&&t._marker.setStyleOrClass(r);const o=i.getMarkerStyle(a);o&&t.internalSetStyleOrClass(o)}))}}],[Sn,class extends io{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Zn(this._pointContainer,Fo)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this.$_prepareSticks(e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}}],[Pn,class extends So{constructor(t){super(t,"rct-pareto-series")}}],[En,class extends oo{constructor(t){super(t,"rct-pie-series"),this._sectors=new Zn(this._pointContainer,Io,null,.5),this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new fa(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new oa(t,"rct-pie-series-inner")),this._textView._text.anchor=Zt.MIDDLE,this._labelContainer.add(this._lineContainer=new Wa(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText;this.$_prepareSectors(t,e,this._visPoints),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&s.visible)&&(this._textView.setModel(t,s,null,null),s.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rd=this.model.getRadius(t,e),this._rdInner=this.model.getInnerRadius(this._rd)}$_calcGroup(t,e){const s=this.model,i=s._group,r=Math.floor(i.getPolarSize(t,e)/2),n=i.getInnerRadius(r)*r,a=r-n;this._rd=n+(s._groupPos+s._groupSize)*a,this._rdInner=(n+s._groupPos*a)/this._rd}_runShowEffect(t){t&&Ta.grow(this,(t=>{const e=this._sectors.find((t=>t.point.sliced));e&&(e.trans(0,0),this.$_slice(e,this.model.options.autoSlice,!1))}))}_doPointClicked(t){if(t instanceof Io&&this.model.options.autoSlice){const e=this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0)}else this.invalidate()}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_resizeZombie(){this._renderSeries(this.width,this.height)}getClipContainer(){return null}$_prepareSectors(t,e,s){this._sectors.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=t.length,s=this.model.options.clockwise?1:-1,i=t.filter((t=>(t.visible||t===this._zombie)&&!t.isNull)).map((t=>t===this._zombie?t.yValue*this._zombieRate:t.yValue)).reduce(((t,e)=>t+e),0),r=this.model._totalRad*this._getGrowRate();let n=this.model._startRad;if(e>1||e>0&&!this._zombie)t.forEach((t=>{t.isNull||(t.yRate=I(t===this._zombie?t.yValue*this._zombieRate:t.yValue)/i||0,t.startAngle=n,n+=t.angle=s*t.yRate*r)}));else if(1==e){const e=t[0];e.startAngle=n,e.angle=s*this._zombieRate*r}}$_layoutSectors(t,e,s){const i=this.model,r=i.options.clockwise,n=this._getGrowRate(),a=i.getCenter(e,s),o=this._cx=a.x,h=this._cy=a.y,l=this._rd,_=this._rdInner,c=i.pointLabel,p=this._labelViews(),g="inside"===i.getLabelPosition(),m=c.getOffset(),f=c.options.distance||0,x=this._lineContainer,y=this._slicedOff=i.getSliceOffset(l)*n;let b;if(this._textView.visible){const t=this._textView.getBBox();this._textView.trans(o,h-t.height/2)}this._circle.setVis(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this.$_calcAngles(t),this._sectors.forEach((t=>{var e,s;const i=t.point;if(i.isNull)t.setVis(!1),p&&(b=p.get(i,0))&&b.setVis(!1),null===(s=x.get(i))||void 0===s||s.setVis(!1);else{const s=i.startAngle;let a=0,c=0;if(i.sliced&&n>=1&&!t.isDomAnimating()){const t=s+i.angle/2;a+=d(t)*y,c+=u(t)*y}t.trans(a,c).setVis(!0);const v=i.startAngle+i.angle/2;if(i.xPos=o+d(v)*(y+.7*l),i.yPos=h+u(v)*(y+.7*l),t.setPieSector(p,null,{cx:o,cy:h,rx:l,ry:l,innerRadius:_,start:s,angle:w(i.angle),clockwise:r}),p&&(b=p.get(i,0))){const e=x.get(i);e.setVis(!g)?this.$_layoutLabel(i,b,e,m,f,i.sliced?y:0,r):(e.visible=!1,this.$_layoutLabelInside(i,b,m,0,i.sliced?y:0)),b.setContrast(g&&t.dom).setVis(!0)}else null===(e=x.get(i))||void 0===e||e.setVis(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const o=e.isDomAnimating();!o&&e.layout("center");const h=e.getBBox(),l=t.startAngle+t.angle/2;let _=this._cx,c=this._cy,p=this._rd+.8*r,g=d(l)*n,m=u(l)*n,f=_+d(l)*this._rd,w=c+u(l)*this._rd,x=_+d(l)*p,y=c+u(l)*p;const b=x<_;let v;v=b?x-.2*r:x+.2*r,s&&s.setVis(p>0)&&(s.setLine((new tn).move(0,0).quad(x-f,y-w,v-f,y-w).end()),s.setPos(f,w),!o&&s.trans(f+g,w+m)),b?(v-=h.width+i,y-=h.height/2):(v+=i,y-=h.height/2),e.setPos(v,y),!o&&e.trans(v+g,y+m)}$_layoutLabelInside(t,e,s,i,r){e.layout("center");const n=e.getBBox(),a=this._rd*this._rdInner,o=(a>0?a+(this._rd-a)/2:.7*this._rd)+s,h=t.startAngle+t.angle/2;let l=this._cx+d(h)*o,_=this._cy+u(h)*o;e.move(l-n.width/2,_-n.height/2),l=this._cx+d(h)*(r+o),_=this._cy+u(h)*(r+o),e.trans(l-n.width/2,_-n.height/2)}$_slice(t,e,s){const i=this.model,r=i.options.autoSlice?i.options.sliceDuration:0,n=t.point,a=n.startAngle+n.angle/2;(n.sliced=e)?t.transEx(d(a)*this._slicedOff,u(a)*this._slicedOff,r):t.transEx(0,0,r);const o=this._labelViews();if(o){const t=i.pointLabel,a=this._lineContainer,h="inside"===i.getLabelPosition(),l=o.get(n,0);if(l){const o=!h&&a.get(n);if(s&&(h?this.$_layoutLabelInside(n,l,t.getOffset(),t.options.distance,this._slicedOff):this.$_layoutLabel(n,l,o,t.getOffset(),t.options.distance,this._slicedOff,i.options.clockwise)),e){let t=l.tx,e=l.ty;l.trans(l.x,l.y),l.transEx(t,e,r),o&&(t=o.tx,e=o.ty,o.trans(o.x,o.y),o.transEx(t,e,r))}else l.trans(l.tx,l.ty),l.transEx(l.x,l.y,r),o&&(o.trans(o.tx,o.ty),o.transEx(o.x,o.y,r))}}}}],[Tn,class extends no{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new Zn(t,Ho)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&(this._polar,Ta.grow(this))}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getAutoPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),a=s._xAxisObj,o=s._yAxisObj,h=this._polar=s.chart._body.getPolar(a),l=this._getGrowRate(),_=this._radius=Math.max(0,+s.options.radius||0)*l,c=+i.rotation||0,p=+i.jitterX||0,g=+i.jitterY||0,m=s.pointLabel,f=m.options.position,w=m.getOffset(),x=this._labelViews(),y=o.prev(r?t:e),b=a.prev(h?h.rd*O:r?e:t),v=r?0:e;let V;this._markers.forEach(((i,m)=>{const S=i.point,P=x&&(V=x.get(S,0));if(i.setVis(!S.isNull)){const m=this._getDrawer(s.getShape(S)),x=k.jitter(S.xValue,p),C=k.jitter(S.yGroup,g);let A,L;if(h){const t=h.start+a.getPos(O,x),e=o.getPos(h.rd,C)*l;A=h.cx+e*d(t),L=h.cy+e*u(t)}else A=a.getPos(b,x),L=v-o.getPos(y,C),r&&(A=o.getPos(y,C),L=e-a.getPos(b,x));S.xPos=A,S.yPos=L,i.setVis(!!h||!n||A>=0&&A<=t&&L>=0&&L<=e)?(i.setPath(m(i._radius||_)),i.trans(A,L).rotate(c),P&&this._layoutLabelView(V,f,w,_,A,L)):P&&P.setVis(!1)}else P&&P.setVis(!1)}))}getNearest(t,e){const s=this.model.options.radius,i=this._markers._internalItems().reduce(((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r));return{pv:i,dist:i.distance(s,t,e)}}canHover(t,e,s){return t<=this.model.options.radius+s}}],[Bn,class extends qa{constructor(t){super(t,"rct-treemap-series"),this._nodeViews=new Zn(this._pointContainer,Go)}_lazyPrepareLabels(){return!0}_getPointPool(){return this._nodeViews}_prepareSeries(t,e){}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._rootView?this.$_renderGroups(t,e):this.$_renderLeafs(t,e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this._rootView?this.$_renderGroups(this.width,this.height):this.$_renderLeafs(this.width,this.height)}$_renderLeafs(t,e){const s=this.model,i=s._xAxisObj,r=s._yAxisObj,n=this._inverted,a=this._getGrowRate(),o=this._labelViews(),h=n?t:e,l=n?e:t,{roots:_,leafs:c}=s.buildMap(l,h),d=new Tt(s._calcedColor),u=[{fill:""}];let p;null==o||o.prepare(this.doc,this),this._nodeViews.prepare(c.length,((t,e,_)=>{const g=c[e],m=g.point,f=g.parent;let w=d;f&&(!f._color&&f.point.color?w=f._color=new Tt(f.point.color):f._color&&(w=f._color)),t.node=g,u[0].fill=w.brighten(g.index/_).toString(),this._setPointStyle(t,s,m,u),i.options.reversed&&(g.x=l-g.x-g.width),r.options.reversed&&(g.y=h-g.y-g.height),n&&(g.y=g.y-h),t.render(a);let x=g.x+g.width/2,y=g.y+g.height/2;if(m.xPos=n?-g.y-g.height/2:x,m.yPos=n?l-g.x-g.width/2:y,o&&(p=o.get(m,0))){p.setContrast(t.dom).layout("center");const e=p.getBBox();p.setVis(g.width>=e.height&&g.height>=e.height)&&(n?(x=-g.y-g.height/2-e.width/2,y=l-g.x-(g.width+e.height)/2):(x-=e.width/2,y-=e.height/2),p.trans(x,y))}}))}$_renderGroups(t,e){}}],[$n,class extends qa{constructor(t){super(t,"rct-vector-series"),this._arrows=new Zn(this._pointContainer,jo)}_getPointPool(){return this._arrows}_prepareSeries(t,e){this.$_prepareArrows(e,this._visPoints)}_renderSeries(t,e){const s=this.model;let i=s.options.startAngle;const r=s.options.arrowHead,n=s._xAxisObj,a=s._yAxisObj,o=this._inverted,h=o?t:e,l=o?e:t,_=this._getGrowRate(),c=o?0:e,d=n.options.reversed?-1:1,u=a.options.reversed;this._pointContainer.invert(o,e),this._arrows.forEach((t=>{const e=t.point;if(t.setVis(!e.isNull)){const s=n.getPos(l,e.xValue),p=c-a.getPos(h,e.yValue);let g=i+e.angleValue*d;u&&(g=180-g),e.xPos=o?c+a.getPos(h,e.yValue):s,e.yPos=o?l-n.getPos(l,e.xValue):p,t.trans(s,p),t.layout(r,g,!1,_)}}))}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this._renderSeries(this.width,this.height)}getPointsAt(t,e){return[]}$_prepareArrows(t,e){this._arrows.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}}],[Fn,class extends io{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Zn(this._pointContainer,Ja),this.add(this._lineContainer=new Ht(t,"rct-waterfall-series-lines")),this._lines=new Zn(this._lineContainer,Nr)}_getPointPool(){return this._bars}_getLowValue(t){return t.low}_prepareSeries(t,e){super._prepareSeries(t,e),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){const a=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd),e>0){const t=this._lines.get(e-1),o=a._isSum?i-n:a.y>=0?i:i-n;t.setHLine(o,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPoints(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPoints(t,e)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r),t.setStyleOrClass(r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"")})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}]),Sa.register([hr,yo],[Xi,uo],[tr,go],[wr,class extends Sa{constructor(t){super(t,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(t,e){e.add(this._faceView=new fa(t,"rct-clock-gauge-face")),e.add(this._rimView=new ya(t,"rct-clock-gauge-rim")),e.add(this._labelView=new Qt(t,"rct-clock-gauge-label")),this._labelView.layout=qt.MIDDLE,e.add(this._tickContainer=new Ht(t,"rct-clock-gauge-ticks")),e.add(this._tickLabelContainer=new Ht(t,"rct-clock-gauge-tick-labels")),e.add(this._hourView=new Xt(t,"rct-clock-gauge-hour")),e.add(this._minuteView=new Xt(t,"rct-clock-gauge-minute")),e.add(this._secondView=new Xt(t,"rct-clock-gauge-second")),e.add(this._pinView=new fa(t,"rct-clock-gauge-pin")),this._tickViews=new Zn(this._tickContainer,Nr,"rct-clock-gauge-tick"),this._minorTickViews=new Zn(this._tickContainer,Nr,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new Zn(this._tickLabelContainer,Qt,"rct-clock-gauge-tick-label")}_prepareGauge(t,e){this._tickViews.prepare(e.tick.visible?12:0),this._minorTickViews.prepare(e.minorTick.visible?48:0);const s=Math.round(12/f(1,Math.floor(e.tickLabel.options.step)||1));this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=qt.MIDDLE}))}_renderGauge(t,e){const s=this.model,i=this._exts=s.getExtents(t,e);this._secRate=1,this.$_renderFace(s,i),this.$_renderHands(s,i),s.options.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const t=this._prevSec;this.$_renderHands(this.model,this._exts),w(t-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.options.animatable&&this.$_moveSecond(t)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,{cx:i,cy:r,rd:n}=e,a=this._rimThick=this._rimView.visible?this.model.rim.getThickness(n):0;this._faceView.setCircle(i,r,n),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim._style),this._rimView.setSector({cx:i,cy:r,rx:n,ry:n,innerRadius:1-a/n,start:0,angle:2*Math.PI,clockwise:!0}));const o=n-a;let h=o-this.model.tick.length,l=B,_=O/12;if(this._tickViews.forEach(((t,e)=>{t.setLine(i+d(l)*o,r+u(l)*o,i+d(l)*h,r+u(l)*h),l+=_})),!this._minorTickViews.isEmpty){let t=0;h=o-this.model.minorTick.length,l=B,_=O/60,this._minorTickViews.forEach((e=>{t%5==0&&(l+=_,t++),e.setLine(i+d(l)*o,r+u(l)*o,i+d(l)*h,r+u(l)*h),l+=_,t++}))}if(!this._tickLabelViews.isEmpty){const t=12/this._tickLabelViews.count,e=O/12*t;l=B,this._tickLabelViews.get(0).text="12",h=o-(this.model.tick.length+this.model.tickLabel.options.offset||0),h-=.5*this._tickLabelViews.get(0).getBBox().height,this._tickLabelViews.forEach(((s,n,a)=>{s.text=String(0===n?12:n*t),s.trans(i+d(l)*h,r+u(l)*h),l+=e}))}this._pinView.setCircle(i,r,t.pin.raidus),s.setVis(t.label.visible)&&(s.internalSetStyleOrClass(t.label._style),t.label.buildSvg(s,null,NaN,NaN,null,null),"bottom"===t.label.options.position?s.trans(i,r+h/2):s.trans(i,r-h/2))}$_getNow(){const t=this.model.options.timezone;let e=this.model.getTime()||new Date;if(!isNaN(t)){const s=e.getMinutes()+(e.getTimezoneOffset()+t);e.setMinutes(s)}return e}$_renderHands(t,e){const s=this.$_getNow(),i=s.getHours(),r=s.getMinutes(),n=s.getSeconds(),{cx:a,cy:o,rd:h}=e,l=new tn;let _,c,d,u;_=t.hourHand,c=this._hourView,c.setVis(_.visible)&&(u=O*(i/12+r/60/12+n/60/60/12),d=_.getLength(h-this._rimThick),l.rect(-_.options.thickness/2,-d,_.options.thickness,d),c.internalSetStyleOrClass(_._style),c.setPath(l.close(!0)).trans(a,o).rotate(u*$)),_=t.minuteHand,c=this._minuteView,c.setVis(_.visible)&&(u=O*(r/60+n/60/60),d=_.getLength(h-this._rimThick),l.rect(-_.options.thickness/2,-d,_.options.thickness,d),c.internalSetStyleOrClass(_._style),c.setPath(l.close(!0)).trans(a,o).rotate(u*$)),_=t.secondHand,c=this._secondView,c.setVis(_.visible)&&(u=this._secRate<1?O*(this._aniSec+this._secRate)/60:O*n/60,d=_.getLength(h-this._rimThick),l.rect(-_.options.thickness/2,-d,_.options.thickness,d),c.internalSetStyleOrClass(_._style),c.setPath(l.close(!0)).trans(a,o).rotate(u*$),this._prevSec=n)}$_moveSecond(t){if(!isNaN(t)){this._aniSec=t;const e=new bo(this);e.duration=this.model.secondHand.options.duration||200,e.start()}}}],[lr,class extends Ma{constructor(t){super(t,"rct-circle-gauge-group")}_createPool(t){return new Zn(t,yo)}_doRenderGauges(t,e,s,i){const r=this.doc,n=this.model,a=n.props.getCenter(s,i),o=n.props.getExtents(m(s,i));n.setChildExtents(o),s=i=2*o.radius,e.forEach(((t,e)=>{t.measure(r,n.getVisible(e),s,i,0),t.resize(s,i),t.layout()})),t.trans(a.x-o.radius,a.y-o.radius)}}],[qi,class extends po{constructor(t){super(t,"rct-linear-gauge-group")}_doInitContents(t,e){super._doInitContents(t,e),e.insertChild(this._bandView=new co(t),this._scaleView)}_createPool(t){return new Zn(t,uo)}_renderScale(t,e,s){super._renderScale(t,e,s);const i=this._bandView,r=t.band;let n,a;if(i.setVis(r.visible)){const o=+r.options.gap||0,h=i.measure(this.doc,r,s.width,s.height,1);if(t.options.vertical){const t=h.width+o;s.width-=t,e.width-=t,a=s.y,"opposite"===r.options.position?n=s.x+s.width+o:(n=s.x,s.x+=t,e.x+=t)}else{const t=h.height+o;s.height-=t,e.height-=t,n=s.x,"opposite"===r.options.position?(a=s.y,s.y+=t,e.y+=t):a=s.y+s.height+o}i.resizeByMeasured().layout().trans(n,a)}}}],[er,class extends po{constructor(t){super(t,"rct-bullet-gauge-group")}_createPool(t){return new Zn(t,go)}}]),va.register([vi,_o],[yi,ho],[bi,lo]);class Yo extends sa{constructor(t){super(t,"rct-axis-grid"),this._lines=new Zn(this,Nr)}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this.model,e=t.options,s=t.axis,i=this.width,r=this.height,n=s.isEmpty()?[]:t.getPoints(s,s._isHorz?i:r),a=this._lines.prepare(n.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),o=a.count-1;let h;a.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",n[e]===(s._isHorz?i:r))}));const l=null==e.firstVisible?t.visible:e.firstVisible,_=null==e.lastVisible?t.visible:e.lastVisible;s._isHorz?a.forEach(((e,i)=>{h=0===i?l:i===o?_:t.visible,e.setVis(h)&&e.setVLine(s.prev(n[i]),0,r)})):a.forEach(((e,a)=>{n[a],h=0===a?l:a===o?_:t.visible,e.setVis(h)&&e.setHLine(r-s.prev(n[a]),0,i)}))}}class Uo extends It{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Xt(t)),this._mask.setStroke("none"),this.add(this._upLine=new Xt(t)),this._upLine.setFill("none"),this.add(this._downLine=new Xt(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this._clip?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const i=this._model._sect.len,r=new tn;if(s){let t=0,s=0,n=i/2,a=i;for(r.move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(this._downLine.setPath(r.end(!1)),t=0,r.clear().move(n,t);t<e;)t+=20,r.line(a,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(a,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,a=i;for(r.move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(this._upLine.setPath(r.end(!1)),e=0,r.clear().move(e,a);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,a);for(this._downLine.setPath(r.end(!1)),e=0,r.clear().move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(r.line(e,a);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,a);this._mask.setPath(r.end())}}}class Zo extends It{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new oa(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){this.model=e,this._labelView.setVis(!!e.label.options.text)&&(this._labelView.setModel(t,e.label,null,null),this._labelView.setStyles(e.label._style))}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,null,null),this._labelView.layout("center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}}class qo extends Zo{constructor(t,e){super(t),this.insertFirst(this._line=new(e?xa:Nr)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.options.value))&&this._line.setStyles(e._style)}_doLayout(t,e){const s=this.model,i=s.options.value,r=s.label,n=r.options,a=this._line,o=this._labelView.setVis(r.visible)&&this._labelView,h=o.getBBox(),l=x(n.offsetX,0),_=x(n.offsetY,0);let c,d;if(this.vertical()){const r=s.axis.getPos(t,i);if(o.setVis(a.setVis(!isNaN(r)))&&(a.setVLine(r,0,e),o)){switch(n.align){case"center":c=r-h.width/2+l;break;case"right":c=r+l;break;default:c=r-h.width-l}switch(n.verticalAlign){case"bottom":d="inside"===n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="inside"===n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(o.setVis(a.setVis(!isNaN(r)))&&(a.setHLine(r,0,t),o)){switch(n.align){case"center":c=(t-h.width)/2-l;break;case"right":c="inside"===n.position?t-h.width-l:t+l;break;default:c="inside"===n.position?l:-1*(h.width+l)}switch(n.verticalAlign){case"bottom":d=r+_;break;case"middle":d=r-h.height/2-_;break;default:d=r-h.height-_}}}o.visible&&o.trans(c,d)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.options.value)&&i.label.visible)&&this._labelView,a=i.axis.getStartAngle(),o=i.axis.getPos(s.rd,i.options.value);r.setArc(s.cx,s.cy,o,a,i.axis.getTotalAngle(),!1),r.setStyle(Q,"none"),n&&n.trans(s.cx+o*d(s.start),s.cy+o*u(s.start))}}class Ko extends Zo{constructor(t,e){super(t),this.insertFirst(this._box=new(e?ya:Es)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e);const s=e.options,i=m(s.startValue,s.endValue),r=f(s.startValue,s.endValue);this._range=e.axis.trimRange(i,r),this.setVis(e.visible&&this._range[1]>this._range[0])&&this._box.setStyleOrClass(e._style)}_doLayout(t,e){const s=this.model;s.options;const i=s.label,r=i.options,n=this._box,[a,o]=this._range,h=this._labelView.setVis(i.visible)&&this._labelView,l=h.getBBox(),_=x(r.offsetX,0),c=x(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,a),d=s.axis.getPos(t,o);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(d!==i))){let s,a;switch(r.align){case"center":s=i+(d-i-l.width)/2+_;break;case"right":s=d-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":a="inside"===r.position?e-l.height-c:e+c;break;case"middle":a=(e-l.height)/2-c;break;default:a="inside"===r.position?c:-1*(l.height+c)}n.setBox(i,0,d,e),h&&h.trans(f(0,m(t,s)),a)}}else{const i=e-s.axis.getPos(e,a),d=e-s.axis.getPos(e,o);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(i!==d))){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="inside"===r.position?t-l.width-_:t+_;break;default:e="inside"===r.position?_:-1*(l.width+_)}switch(r.verticalAlign){case"bottom":s=i-l.height-c;break;case"middle":s=d+(i-d-l.height)/2-c;break;default:s=d+c}h&&h.trans(e,s),n.setBox(0,d,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,a=i.axis.getStartAngle(),o=i.axis.getPos(s.rd,i.options.startValue),h=i.axis.getPos(s.rd,i.options.endValue);if(r.setSector({cx:s.cx,cy:s.cy,rx:h,ry:h,innerRadius:o/h,start:a,angle:O,clockwise:!0}),n){const t=o+(h-o)/2;n.trans(s.cx+t*d(s.start),s.cy+t*u(s.start))}}}class Qo extends Ht{constructor(){super(...arguments),this._views=new Zn(this,Xt)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e,s){const i=this._rows;this._views.prepare(i.length),this._views.forEach(((s,r)=>{const n=i[r];if(n.axis._isHorz){const i=n.axis.getPos(t,n.from),r=n.axis.getPos(t,n.to);s.setPath(As.rectangle(i,0,r-i,e))}else{const i=n.axis.getPos(e,n.from),r=n.axis.getPos(e,n.to);s.setPath(As.rectangle(0,e-i,t,i-r))}s.setFill(n.color)}))}}class Jo extends Ht{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Ko?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof $e?i=this._rangePool.pop()||new Ko(t,s):e instanceof De&&(i=this._linePool.pop()||new qo(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class th extends Xt{constructor(t){super(t),this.ignorePointer()}setModel(t){t!=this.model&&(this.model=t,this._bar=t.isBar(),this.setClass(this._bar?"rct-crosshair-bar":"rct-crosshair-line"))}layout(t,e,s,i,r){const n=this.model.axis,a=n._isHorz,o=new tn;if(this._bar){const h=n._isHorz?i:r;let l;if(t?l=t.point.xValue:this.model.options.showAlways&&(l=n.options.reversed?n.xValueAt(a?i-e:s):n.xValueAt(a?e:r-s)),n instanceof zs&&(l=_(l)),!isNaN(l)){const t=n.getPos(h,l);let e=n.getUnitLen(h,l);a?o.rect(t-e/2,0,e,r):o.rect(0,r-t-e/2,i,e)}}else(t||this.model.options.showAlways)&&(a?o.vline(e,0,r):o.hline(s,0,i));this.setPath(o.end())}}class eh extends ma{constructor(t){super(t,"Reset Zoom",eh.CLASS_NAME),this.setVis(!1)}}eh.CLASS_NAME="rct-reset-zoom";class sh extends Ht{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Ls(t)),this.add(this._labelView=new oa(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),this._backView.resize(e,s);const i=this._labelView;t.buildSvg(i._text,i._outline,e,s,null,null),i.layout("center");const r=i.getBBox();i.trans((e-r.width)/2,(s-r.height)/2)}}class ih extends sa{constructor(t,e){super(t,ih.BODY_CLASS),this._gridViews=new Map,this._baseViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._annotationViews=[],this._annotationMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._owner=e,this.add(this._hitTester=new Ls(t)),this._hitTester.setFill("transparent"),this.add(this._background=new Ls(t,"rct-body-background")),this.add(this._image=new aa(t,!0,"rct-body-image")),this.add(this._emptyView=new sh(t)),this.add(this._gridRowContainer=new Qo(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new Ht(t,"rct-axis-grids")),this.add(this._baseContainer=new Ht(t,"rct-axis-bases")),this.add(this._guideContainer=new Jo(t,"rct-axis-guides")),this.add(this._annotationContainer=new Ht(t,"rct-annotations")),this.add(this._seriesContainer=new Ht(t,"rct-series-container")),this.add(this._axisBreakContainer=new Ht(t,"rct-axis-breaks")),this.add(this._labelContainer=new Ht(t,"rct-label-container")),this.add(this._frontGuideContainer=new Jo(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new Ht(t,"rct-front-annotations")),this.add(this._feedbackContainer=new Ht(t,"rct-feedbacks")),this.add(this._zoomButton=new eh(t)),this._crosshairViews=new Zn(this._feedbackContainer,th)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}prepareRender(t,e){this._animatable=Ft._animatable&&e.animatable(),this._prepareSeries(t,e,e._getSeries().getVisibleSeries()),this._prepareGauges(t,e,e._getGauges().getVisibles()),this._prepareAnnotations(t,e._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.prepare(),this._frontGuideContainer.prepare()}pointerMoved(t,e){const s=this.width,i=this.height,r=this._inverted,n=this._seriesViews,a=n.length,o=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let h,l;if(e instanceof SVGElement&&(e.classList.contains(qa.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(qa.POINT_CLASS)))for(let t=a-1;t>=0;t--)if(l=n[t].pointByDom(e),l){h=n[t];break}const _=null==e?void 0:e.classList,c=(null==_?void 0:_.value)&&(_.contains("rct-contextmenu-item")||_.contains("rct-contextmenu-list")),d=o&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!c;if(this._crosshairViews.forEach((e=>{e.setVis(d)&&e.layout(l,t.x,t.y,s,i)})),l)this.$_setFocused(h,l,t);else if(a>0){const e=this.chart()._chartOptions.pointHovering.getHintDistance(null==h?void 0:h.model);let s,i,l=!0;for(const t of n)if(!(t.model instanceof Br)){l=!1;break}if(h=null,l)if(a>1){const a=[];n.forEach((n=>{s=x(n.getHintDistance(),e),i=n.getNearest2(t.x,t.y,r),a.push({hint:s,sv:n,pv:i})}));const o=a.reduce(((e,s)=>r?w(e.pv.pv.point.xPos-t.x)<w(s.pv.pv.point.xPos-t.x)?e:s:w(e.pv.pv.point.yPos-t.y)<w(s.pv.pv.point.yPos-t.y)?e:s));h=o.sv,i=o.pv,s=o.hint}else h=n[0],s=x(h.getHintDistance(),e),i=h.getNearest2(t.x,t.y,r);else n.forEach((r=>{if(r.getHintDistance&&(s=x(r.getHintDistance(),e),s>0)){const e=r.getNearest(t.x,t.y);(!i||e.dist<i.dist)&&(h=r,i=e)}}));o&&i&&h.canHover(i.dist,i.pv,s)?this.$_setFocused(h,i.pv,t):this.$_setFocused(null,null,t)}return o}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,s){const i=this._focused,r=this._siblings,n=this._siblingSeries;let a,o,h;if(t&&e)switch(this.chart()._chartOptions.pointHovering.getScope(t.model,e.point)){case"axis":h=t.model._xAxisObj.getSeries();case"group":h||(h=t.model._group.getVisibleSeries());const i=h.map((t=>{if(t instanceof oi){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let a;if(t instanceof Kr){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),o=t.getRadius(n.zValue,i,r);a=Math.sqrt(Math.pow(n.xPos-s.x,2)+Math.pow(n.yPos-s.y,2))-o}else a=Math.sqrt(Math.pow(n.xPos-s.x,2)+Math.pow(n.yPos-s.y,2));a<i&&(i=a,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)}));a=h.map((t=>this._owner.getSeriesView(t))),o=[],i.forEach(((t,e)=>{o.push(a[e].getPointView(t))}));break;default:a=[t],o=[e]}let l=[];if(a&&a.forEach(((t,e)=>{l.push(...t.getSiblings(o[e]))})),l=l.length>1?l.sort(((t,e)=>t.hash-e.hash)):l.length>0?l:null,k.equalArrays(r,l)||(a&&a.forEach(((t,e)=>{t.focusPoints(t.getSiblings(o[e]))})),n&&n.forEach((t=>{(!a||a.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=a,this._siblings=l),e!==i){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,t&&this.$_focusSeries(t,!0),this.chart()._chartOptions.options.seriesHovering&&this.$_hoverSeries(t))}!this._focused||this._focused===i&&this._owner.tooltipVisible()&&!this.model.chart._tooltip.isFollowPointer(t.model)?!this._focused&&this._owner.tooltipVisible()&&this._owner.hideTooltip():s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?this._owner.showTooltip(t.model,e,[],this,s):this._owner.hideTooltip()}$_focusSeries(t,e){e?t.model._group?t.front(this._seriesViews,this._seriesViews.filter((e=>e.model._group===t.model._group))):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach((e=>{e.setBoolData(qa.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(qa.DATA_UNHOVER,t&&e!==t)}))}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(this._hoverPointSeries=s).hoverPoint(t):this._hoverPointSeries&&(this._hoverPointSeries.hoverPoint(null),this._hoverPointSeries=null)}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesMap.get(t)}isConnected(t){return!!this._seriesViews.find((e=>e.model._xAxisObj==t||e.model._yAxisObj==t))}getButton(t){if(this._zoomButton.contains(t))return this._zoomButton}buttonClicked(t){t===this._zoomButton&&(this.model.chart._getXAxes().resetZoom(),this.model.chart._getYAxes().resetZoom())}addFeedback(t){t&&this._feedbackContainer.add(t)}setZoom(t,e,s,i){const r=this.chart(),n=r.isInverted(),a=r.xAxis,o=n?this.height:this.width,h=a.valueAt(o,n?o-i:t),l=a.valueAt(o,n?o-e:s);a.zoom(h,l)&&(this._zoomRequested=!0)}animating(){let t=!1;for(const e of this._seriesViews)if(e.visible&&e._animating()){t=!0;break}return t}getTooltipPos(){return{x:this.tx,y:this.ty}}getFocusPointView(){return this._focused}getSeries(t){return this._seriesViews.find((e=>e.model===t))}removeFocus(){this._seriesViews.forEach((t=>{t._hoverPts.forEach((e=>{e instanceof ro&&e.endHover(t,!1),e.setBoolData(qa.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.stop()})),t._hoverAnis=[]})),this._owner.hideTooltip(),this._focused=null,this._siblings=null,this._siblingSeries=null}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=e.chart,a=e.base();if(this._polar=n.isPolar(),this._zoomRequested=!1,this._seriesClip||(this._seriesClip=this.control.clipBounds(),this._seriesClip2=this.control.clipBounds(),this._bodyClip=this.control.clipBounds()),this._background.setStyleOrClass(a._style),a!==e&&this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||n.isWidget()),this._emptyView.setVis(!1!==e.emptyView.visible&&e.isEmpty()),this._seriesViews.forEach(((e,n)=>{e.measure(t,this._series[n],s,i,r)})),!this._polar){this.$_prepareGrids(t,n);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,s,i,r);this.$_prepareAxisBreaks(t,n)}return this._gaugeViews.forEach(((e,n)=>{e.measure(t,this._gauges[n],s,i,r)})),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)})),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:s,height:i}}_clipSeries(t,e,s){const i=s?this._seriesClip:this._seriesClip2;t&&t.setClip(i),e&&e.setClip(i)}_doLayout(){const t=this.width,e=this.height,s=this._image;if(this._inverted?(this._seriesClip.setBounds(0,-t,e,t),this._seriesClip2.setBounds(0,0,t,e)):(this._seriesClip.setBounds(0,0,t,e),this._seriesClip2.setBounds(0,0,t,e)),this._bodyClip.setBounds(0,0,t,e),this._hitTester.resize(t,e),this._background.resize(t,e),s.setVis(s.setImage(this.model.image.options.url,t,e))&&s.setStyleOrClass(this.model.image._style),this._emptyView.visible&&(this.model.emptyView._prepareRender(),this._emptyView.layout(this.model.emptyView,t,e)),this._seriesViews.forEach((s=>{s.model.needClip(!1)&&this._clipSeries(s.getClipContainer(),s.getClipContainer2(),s.clipInvertable()),s.resize(t,e),s.trans(0,0),s.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){for(const s of this._gridViews.values())s.resize(t,e),s.layout();for(const s of this._baseViews.values()){const i=s.tag;s.setStyleOrClass(i.baseLine._style),i._isHorz?s.setVLine(i.getPos(t,i.getBaseValue()),0,e):s.setHLine(i.getPos(e,i.getBaseValue()),0,t)}this._breakViews.forEach((s=>{const i=s._model,r=i.axis;r._isHorz?r.options.reversed?s.trans(t-i._sect.pos,0):s.trans(i._sect.pos,0):r.options.reversed?s.trans(0,i._sect.pos):s.trans(0,e-i._sect.pos-i._sect.len),s.layout(t,e,i.axis._isHorz)}));const s=this.control;if(this._guideClip)this._guideClip.resize(s.width(),s.height());else{const t=s._padding;this._guideClip=s.clipBounds(-1*(t.left+this.tx),-1*(t.top+this.ty),s.width(),s.height())}[this._guideContainer,this._frontGuideContainer].forEach((s=>{s._views.forEach((s=>s.visible&&s.layout(t,e))),s.setClip(this._guideClip)})),this._gridRowContainer.layout(t,e,!1)}this.$_prepareCrosshairs(this.chart()),this._gaugeViews.forEach((s=>{s.resizeByMeasured(),s.layout().transp(s.getPosition(t,e))})),this._layoutAnnotations(this._inverted,this,t,e),this._zoomButton.visible&&this._zoomButton.trans(t-this._zoomButton.getBBox().width-10,10)}$_createGaugeView(t,e){return new(Va[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,a=this._baseViews;for(const t of r.keys())s&&e.containsAxis(t)&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of a.keys())(!s||!e.containsAxis(t)||t instanceof Li&&!t.baseLine.visible||!t.isBaseVisible())&&(a.get(t).remove(),a.delete(t));s&&[e._getXAxes(),e._getYAxes()].forEach((e=>e.forEach((e=>{const s=e.grid;if(!r.has(e)&&(s.visible||s.options.firstVisible||s.options.lastVisible)){const s=new Yo(t);r.set(e,s),i.add(s)}if(e instanceof Li&&e.baseLine.visible&&e.isBaseVisible()&&!a.has(e)){const s=new Nr(t,"rct-axis-baseline");a.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s){const i=this._inverted=e.isInverted(),r=this._seriesMap,n=this._seriesViews;for(const t of r.keys())s.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));this._series=s,n.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove())})),n.length=0,s.forEach((s=>{const a=r.get(s)||Xo(t,s);a._setChartOptions(i,this._animatable,e.loadAnimatable()),a.parent||(this._seriesContainer.add(a),this._labelContainer.add(a._labelContainer)),r.set(s,a),n.push(a),a.prepareSeries(t,s)})),this._seriesContainer.sort(n),n.forEach((t=>this._labelContainer.dom.appendChild(t._labelContainer.dom)))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,a=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,a.forEach((t=>t.remove())),a.length=0,s.forEach((s=>{const o=n.get(s)||this.$_createGaugeView(t,s);i.add(o),n.set(s,o),a.push(o),o.prepareGauge(t,s),o._setChartOptions(r,this._animatable,e.loadAnimatable())}))}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const a=r.get(e)||Wo(t,e);(e.options.front?i:s).add(a),r.set(e,a),n.push(a)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof Ei&&r.push(...t._getBreaks())}))));i.length<r.length;){const e=new Uo(t);s.add(e),i.push(e)}for(;i.length>r.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(r[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=[];[t._getXAxes(),t._getYAxes()].forEach((t=>t.forEach((t=>{t.crosshair.visible&&s.push(t.crosshair)})))),e.prepare(s.length,((t,e)=>{t.setModel(s[e]),t.setClip(this._bodyClip)}))}_layoutAnnotations(t,e,s,i){this._annotationViews.length>0&&this._annotationViews.forEach((r=>{r._layoutView(t,e,0,0,s,i),r.setClip(this._polar||r.model.options.noClip?T:this._bodyClip)}))}}ih.BODY_CLASS="rct-body";class rh extends It{constructor(t){super(t,nh.HANDLE_STYLE),this.add(this._back=new Ls(t)),this.add(this._shape=new Xt(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*m(t,e);const r=new tn;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2},i/=3,r.polygon(-i-1,0,-1,-i,-1,i),r.polygon(i+1,0,1,-i,1,i),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class nh extends sa{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(nh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(nh.MASK_STYLE)}constructor(t){super(t,nh.CLASS_NAME),this.add(this._back=new Ls(t,nh.BACK_STYLE)),this.add(this._container=new Ht(t,null)),this.add(this._mask=new Ls(t,nh.MASK_STYLE)),this.add(this._trackView=new Ls(t,nh.TRACK_CLASS)),this.add(this._thumbView=new Ls(t,nh.THUMB_CLASS)),this.add(this._startHandle=new rh(t)),this.add(this._endHandle=new rh(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",(()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()}))}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;n.firstSeries;let a=s,o=i;return e._vertical?a=e.getSize():o=e.getSize(),e._naviChart.layoutAxes(a,o,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis._calcPoints(a,101),e._naviChart.yAxis._calcPoints(o,1),{width:a,height:o}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=this.width,r=this.height;if(this._back.resize(i,r),e._vertical);else{const t=s?(s.start-s.min)*i/s.total():0,e=s?(s.end-s.min)*i/s.total():i;this._mask.setBounds(t,0,e-t,r),this._trackView.setBounds(-2,r,i+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,r,e-t,6),this._startHandle.layout(r/3,r/3,!1),this._startHandle.trans(t,r+3),this._endHandle.layout(r/3,r/3,!1),this._endHandle.trans(e,r+3)}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,i,r,1),this._seriesView.resize(i,r),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,i,r,1),this._xAxisView.resize(i,r),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=Xo(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s)}$_prepareXAxisView(t,e){const s=e.xAxis;let i=this._xAxisView;i&&i.model!==s&&(i.remove(),i=this._xAxisView=null),i||(this._container.add(i=this._xAxisView=new ga(t)),i._simpleMode=!0)}$_prepareYAxisView(t,e){const s=e.yAxis;let i=this._yAxisView;i&&i.model!==s&&(i.remove(),i=this._yAxisView=null),i||(this._container.add(i=this._yAxisView=new ga(t)),i._simpleMode=!0)}}nh.CLASS_NAME="rct-navigator",nh.BACK_STYLE="rct-navigator-back",nh.MASK_STYLE="rct-navigator-mask",nh.HANDLE_STYLE="rct-navigator-handle",nh.HANDLE_BACK_STYLE="rct-navigator-handle-back",nh.TRACK_CLASS="rct-navigator-track",nh.THUMB_CLASS="rct-navigator-thumb";class ah extends Ut{constructor(t){super(),this.chart=t}}class oh extends ah{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){const n=this.chart.getBounds(),a=this._body.getBounds();return this._xStart=e-(a.x-n.x),this._yStart=s-(a.y-n.y),this._body.addFeedback(this._feedback=new Ls(this.chart.doc(),"rct-zoom-tracker")),!0}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e-=i.y-s.y,this._body.setZoom(0,m(this._yStart,e),this._body.width,f(this._yStart,e))):(t-=i.x-s.x,this._body.setZoom(m(this._xStart,t),0,f(this._xStart,t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),a=this._body.getBounds();return this._vertical?(r=Math.max(0,Math.min(a.height,r-(a.y-n.y))),this._feedback.setBounds(0,m(this._yStart,r),this._body.width,w(this._yStart-r))):(i=Math.max(0,Math.min(a.width,i-(a.x-n.x))),this._feedback.setBounds(m(this._xStart,i),0,w(this._xStart-i),this._body.height)),!0}}class hh extends ah{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,a=n.model.axis._zoom;if(a){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=a.length(),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let a;return n._vertical?(a=n.svgToElement(i,r).y-this._startOff,a=n.getZoomPos(n.height-a-n._thumbView.height),n.model.axis.zoom(a,a+this._zoomLen)):(a=n.svgToElement(i,r).x-this._startOff,a=n.getZoomPos(a),n.model.axis.zoom(a,a+this._zoomLen),console.log(a)),!0}}class lh extends ah{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}_doStart(t,e,s,i,r){const n=this._handleView,a=n.elementToSvg(0,0);return this._startOff=n._vertical?s-a.y-n.height/2:e-a.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,a=n.model.axis();a._prepareZoom();let o=n.svgToElement(i,r).x-this._startOff;const h=a._zoom.total(),l=a._zoom.min,_=n.model.options.minSize;return this._handleView._vertical?this._isStart:this._isStart?o>0?a.zoom(o*h/n.width+l,NaN,_):a.zoom(l,NaN,_):o>0&&o<n.width?a.zoom(NaN,o*h/n.width+l,_):o>=n.width&&a.zoom(NaN,a._zoom.max,_),!0}}class _h extends ah{constructor(t,e,s){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,s,i,r){const n=this._view.model.axis(),a=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-a.y:e-a.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,a=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(a*this._totalLen/n.height):this.$_moveZoom(a*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=f(0,m(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class ch{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const s=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(t,e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),{x:s,y:i}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const r=this.isDragging(),n=this._clickElement;s<0||s>=e.control.dom().offsetWidth||i<0||i>=e.control.dom().offsetHeight||(r?this.$_doDrag(t,n,s,i):(!this._dragTracker&&(w(this._clickX-s)>3||w(this._clickY-i)>3)||this._dragTracker&&!r)&&this.$_startMove(t,n,s,i))}this._prevX=s,this._prevY=i,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(t.target)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleClick(t){const e=this._chart.chartView(),s=this._clickElement,i=e.getButton(s);let r,n,a;if(i)!0!==i.click()&&e.buttonClicked(i);else if(n=e.legendByDom(s))if(n.source instanceof Ms){const t=n.source,e=this._chart.model.seriesByPoint(t);if(e){e.setPointVisible(t,!t.visible);const s=this._chart.chartView().findSeriesView(e);s instanceof oo&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible,e.bodyView().hoverSeries(n.source.visible?n.source:null);else(a=e.seriesByDom(s))?a.clicked(s):(r=e.creditByDom(s))&&r.clicked(s)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return ua.isThumb(t)?new hh(this._chart,i.getScrollView(t)):nh.isHandle(t)?new lh(this._chart,i._navigatorView,t):nh.isMask(t)&&r&&r.model.isZoomed()?new _h(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new oh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(t,e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,s,i,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),this._dragTracker){if(this._dragTracker.start(t,e,s,i,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,s,i),this._dragTracker=null)}}class dh extends Ht{constructor(t){super(t,dh.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new Qt(t,"rct-history-item");e.anchor=Zt.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new Qt(t);e.anchor=Zt.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let a=0;a<r;a++)e[a].text=t[a].name,e[a].transX(n),a<r-1&&(n+=e[a].width+i,s[a].transX(n),n+=s[a].width+i)}}dh.TITLE_CLASS="rct-history";class uh extends sa{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new Ls(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Qt(t,"rct-legend-item-label")),this._label.anchor=Zt.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text()||"…";const n=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():qn,a=Qn(this._label.getBBox());return this._gap=x(e.legend.options.markerGap,0),{width:n.width+this._gap+a.width,height:f(n.height,a.height)}}_doLayout(t){const e=this._rMarker,s=x(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class ph extends ia{constructor(t){super(t,ph.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Zn(this,uh)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.options,a=e.items(),o=this._vertical="vertical"===e.getLayout();return this._ipr=x(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?x(n.gap,0):0,o?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,a),this.$_measure(t,e,o,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,a=t.itemGap||0,o=this._margins,h=this._paddings,l=this._vertical,_=o.left+h.left,c=o.top+h.top;let d,u=_,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor();t._marker.setColor(i),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(d=t.map((t=>t.height)).reduce(((t,e)=>t+e))+a*(t.length-1)+o.top+o.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach((t=>{t.trans(u,p),p+=t.height+a})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=_,"center"!==r&&"end"!==r||(d=t.map((t=>t.width)).reduce(((t,e)=>t+e))+a*(t.length-1)+o.left+o.right+h.left+h.right,u+="center"===r?(this.width-d)/2:this.width-d),t.forEach((t=>{t.trans(u,p),u+=t.width+a})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const a=e.options,o=e.items(),h=this._itemViews,l=a.itemGap||0,_=a.lineGap||0,c=e.getMarkerSize(),d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,m,w,x;h.forEach(((e,s)=>{e.setMarker(o[s].source.legendMarker(t,c)),e.measure(t,o[s],r,n,1)}));let y=0,b=0;if(s){for(;y<d;)x=h.get(y),b%i==0?(u.push(w=[x]),m=x.mh,b++,y++):(m+=l+x.mh,m<=n?(w.push(x),b++,y++):b=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=f(s,t.mw),r=f(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=f(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;y<d;)x=h.get(y),b%i==0?(u.push(w=[x]),g=x.mw,b++,y++):(g+=l+x.mw,g<=r?(w.push(x),b++,y++):b=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=f(s,t.mh)})),e+=l*(t.length-1),g=f(g,e),m+=s,p.push(s)})),m+=_*(u.length-1)}return{width:g,height:m}}}ph.LEGEND_CLASS="rct-legend";let gh=class extends ra{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(t,e,s,i,r){const n=this.views,a=[];for(this.isX=e,s&&s._axes.forEach((t=>{a.push(t)}));n.length<a.length;){const e=new ga(t);this.add(e),n.push(e)}for(;n.length>a.length;)n.pop().remove();if(n.forEach(((t,e)=>{a[e]._runPos,t.model=a[e]})),this.axes=a,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){const i=this.views,r=this.axes;i.forEach(((s,i)=>{const n=r[i];e.forEach((e=>{e.forEach((e=>{e.isConnected(n)&&s.setVis(this.visible)&&s.prepareGuides(t,e.row,e.col,e._guideContainer,e._frontGuideContainer)}))}))}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}setMargins(t,e,s,i){this.views.forEach((r=>r.setMargins(t,e,s,i)))}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){const n=this.axes;if(this.isHorz){let e=0;return this.views.forEach(((a,o)=>{e+=a.measure(t,n[o],s,i,r).height})),{width:s,height:e}}{let e=0;return this.views.forEach(((a,o)=>{e+=a.measure(t,n[o],s,i,r).width})),{width:e,height:i}}}_doLayout(t){this.isHorz?this.views.forEach((t=>{t.resize(this.width,t.mh),t.layout()})):this.views.forEach((t=>{t.resize(t.mw,this.height),t.transX(this.width-t.mw),t.layout()}))}};class mh extends ra{constructor(t,e){super(t,"rct-axis-container"),this.isX=e,this.sections=[]}prepare(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new gh(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((n,a)=>{this.isX?(n.row=i,n.col=a):(n.col=i,n.row=a),n.prepare(t,this.isX,r[a],e,s)}))}prepareGuides(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new gh(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((r,n)=>{this.isX?(r.row=i,r.col=n):(r.col=i,r.row=n),r.prepareGuides(t,e,s)}))}checkWidths(t,e,s){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkWidths(t,e,s)),0):0}checkHeights(t,e,s){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkHeights(t,e,s)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){let n=0,a=0;return this._isHorz?this.sections.forEach((n=>{a=f(a,n.measure(t,e,s,i,r).height)})):this.sections.forEach((a=>{n=f(n,a.measure(t,e,s,i,r).width)})),{width:n,height:a}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((e,s)=>{e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height),e.trans(t[2*s+1]-t[1],0),e.layout()})):this.width>0&&this.sections.forEach(((e,s)=>{e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]),e.trans(0,this.height-(t[2*(s+1)]-t[1])),e.layout()}))}}class fh extends ih{constructor(){super(...arguments),this.row=0,this.col=0}prepareRender(t,e){const s=this.row,i=this.col,r=e._split.getPane(s,i).body,n=e._getSeries().getPaneSeries(s,i),a=e._getGauges().getPaneVisibles(s,i);this._animatable=Ft._animatable&&e.animatable(),this._prepareSeries(t,e,n),this._prepareGauges(t,e,a),this._prepareAnnotations(t,r.getAnnotations())}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}}class wh extends Ht{constructor(t,e){super(t,wh.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}get bodies(){return this._bodies}bodyViewOf(t){return this._bodies.find((e=>e.contains(t)))}prepare(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)}measure(t,e,s,i,r,n,a){const o=e.chart,h=this._inverted=e.chart.isInverted(),l=r,_=n;this.$_prepareAxes(t,s,!0),this.$_prepareAxes(t,i,!1),e.layoutAxes(r,n,h,a),h?(r-=this._xContainers.reduce(((e,s)=>e+s.checkWidths(t,r,n)),0),n-=this._yContainers.reduce(((e,s)=>e+s.checkHeights(t,r,n)),0)):(n-=this._xContainers.reduce(((e,s)=>e+s.checkHeights(t,r,n)),0),r-=this._yContainers.reduce(((e,s)=>e+s.checkWidths(t,r,n)),0)),e.layoutAxes(r,n,h,a),this._xContainers.forEach((e=>e.measure(t,o,r,n,a))),this._yContainers.forEach((e=>e.measure(t,o,r,n,a))),r=l,n=_,h?(r-=this._xContainers.reduce(((t,e)=>t+e.mw),0),n-=this._yContainers.reduce(((t,e)=>t+e.mh),0)):(n-=this._xContainers.reduce(((t,e)=>t+e.mh),0),r-=this._yContainers.reduce(((t,e)=>t+e.mw),0)),e.layoutAxes(r,n,h,a),this.$_prepareAxisGuides(t,s,!0),this.$_prepareAxisGuides(t,s,!1),this._xContainers.forEach((e=>e.measure(t,o,r,n,a))),this._yContainers.forEach((e=>e.measure(t,o,r,n,a)));const c=e.getXLens(h?n:r),d=e.getYLens(h?r:n);e.calcAxesPoints(c,d)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this.$_calcExtents(t,e,s),this.$_layoutAxes(t,!0,e,s),this.$_layoutAxes(t,!1,e,s),this.$_layoutBodies(t,e,s)}seriesByDom(t){for(const e of this._bodies){const s=e.seriesByDom(t);if(s)return s}}getSeries(t){for(const e of this.bodies){const s=e.findSeries(t);if(s)return s}}$_init(t){this._back||(this.add(this._back=new Ls(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new Ht(t,T)),this.add(this._axisContainer=new Ht(t,T)))}$_prepareBodies(t,e){const s=e.chart,i=e.paneCount(),r=this._bodies,n=this._bodyMap=[];for(;r.length<i;){const e=new fh(t,this._owner);this._bodyContainer.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();for(let t=0;t<e.rowCount();t++){const s=[];for(let i=0;i<e.colCount();i++){const n=r[t*e.colCount()+i];s.push(n),n.row=t,n.col=i}n.push(s)}r.forEach((e=>{e.prepareRender(t,s),e.prepareGuideContainers(),e._gridRowContainer.prepare()}))}$_prepareAxes(t,e,s){const i=s?this._xContainers:this._yContainers,r=s?e.rows():e.cols();for(;i.length<r;){const e=new mh(t,s);this._axisContainer.add(e),i.push(e)}for(;i.length>r;)i.pop().remove();i.forEach(((s,i)=>{s.prepare(t,this._bodyMap,e,i)}))}$_prepareAxisGuides(t,e,s){(s?this._xContainers:this._yContainers).forEach(((s,i)=>{s.prepareGuides(t,this._bodyMap,e,i)}))}$_calc(t,e,s,i){const r=new Array(2*(e+1)),n=s-t.reduce(((t,e)=>t+e[i]),0),a=new Array(e);let o=0,h=0;for(h=0;h<e;h++)a[h]=n/e;for(h=0;h<e;h++)r[2*h]=o,r[2*h+1]=o+=t[h][i],o+=a[h];return r[2*h]=o,r[2*h+1]=o+t[h][i],r}$_calcExtents(t,e,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),e,"mw"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),s,"mh")):(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),s,"mh"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),e,"mw"))}$_layoutAxes(t,e,s,i){const r=this.control._padding,n=this._rowPoints,a=this._colPoints,o=e?this._xContainers:this._yContainers;if(this._inverted)if(e){const t=a[1],e=a[a.length-2]-t;o.forEach(((t,s)=>{t.resize(t.mw,e),t.trans(n[2*s],i-a[a.length-2]),t.layout(a)}))}else{const t=n[1],e=n[n.length-2]-t;o.forEach(((s,o)=>{const h=s.sections;for(let t=0,e=h.length;t<e;t++){const s=h[t],i=0===t?r.left:0,a=t===e-1?r.right:0;let o=0,l=0;e>1&&(o=n[2*t+1]-n[2*t],l=n[2*(t+1)+1]-n[2*(t+1)],0===t?h[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2:t===e-1?h[t-1].isEmpty()?o=n[2*(t-1)]-n[2*(t-1)-1]:o/=2:(h[t-1].isEmpty()?o=n[2*(t-1)]-n[2*(t-1)-1]:o/=2,h[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2)),s.setMargins(i,o,l,a)}s.resize(e,s.mh),s.trans(t,i-a[2*o+1]),s.layout(n)}))}else if(e){const t=a[1];s=a[a.length-2]-t,o.forEach(((e,h)=>{const l=e.sections;for(let t=0,e=l.length;t<e;t++){const s=l[t],i=0===h?r.left:0,_=h===o.length-1?r.right:0;let c=0,d=0;e>1&&(c=a[2*t+1]-a[2*t],d=a[2*(t+1)+1]-a[2*(t+1)],0===t?l[t+1].isEmpty()?d=a[2*(t+1)]-a[2*(t+1)-1]:d/=2:t===e-1?l[t-1].isEmpty()?c=a[2*(t-1)]-a[2*(t-1)-1]:c/=2:(l[t-1].isEmpty()?c=a[2*(t-1)]-a[2*(t-1)-1]:c/=2,l[t+1].isEmpty()?d=a[2*(t+1)]-n[2*(t+1)-1]:d/=2)),s.setMargins(i,c,d,_)}e.resize(s,e.mh),e.trans(t,i-n[2*h+1]),e.layout(a)}))}else{const t=n[n.length-2],e=t-n[1];o.forEach(((s,r)=>{s.resize(s.mw,e),s.trans(a[2*r],i-t),s.layout(n)}))}}$_layoutBodies(t,e,s){t.chart._body;const i=t.rowCount(),r=t.colCount(),n=this._rowPoints,a=this._colPoints,o=this._bodies;if(this._inverted)for(let e=0;e<i;e++){const s=n[2*(e+1)-1],i=n[2*(e+1)];for(let n=0;n<r;n++){const h=o[e*r+n],l=a[2*n+1],_=a[2*(n+1)];h.measure(this.doc,t.getPane(e,n).body,i-s,_-l,1),h.resize(i-s,_-l),h.trans(s,this.height-_),h.layout()}}else for(let e=0;e<i;e++){const i=n[2*(e+1)-1],h=n[2*(e+1)];for(let n=0;n<r;n++){const l=o[e*r+n],_=a[2*(n+1)-1],c=a[2*(n+1)];l.measure(this.doc,t.getPane(e,n).body,c-_,h-i,1),l.resize(c-_,h-i),l.trans(_,s-h),l.layout()}}}}wh.STYLE_NAME="rct-panes";class xh extends It{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new fa(t))}layout(){}}class yh extends It{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new Ht(t,"rct-polar-axis-markers")),this._markViews=new Zn(this._markContainer,xh),this.add(this._gridContainer=new It(t,"rct-polar-axis-grids")),this._labelViews=new Zn(this._labelContainer=s,ca,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this._markLen=e.tick.options.length,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s._style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=r){n&&r.match(pa)?t.setLabel(s,e,r.replace(pa,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(this._labelContainer.setVis(s.visible)){const t=e._ticks;this._labelContainer.setStyleOrClass(s._style),this._labelViews.prepare(t.length,((e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)}))}}prepareGuides(t,e,s){let i=this._model.guides.filter((t=>!t.options.front));e.setAll(t,i,!0),i=this._model.guides.filter((t=>t.options.front)),s.setAll(t,i,!0)}}class bh extends yh{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Zn(this._gridContainer,Nr,bh.GRID_CLASS),e.insertFirst(this._startView=new Nr(t,bh.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Nr(t,bh.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new xa(t,bh.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const a=t.getStartAngle(),o=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*o/O)),this._gridContainer.visible&&this._gridLines.forEach(((t,n)=>{const o=r[n].pos,h=e+d(a+o)*i,l=s+u(a+o)*i;t.setFill("none"),t.setLine(e,s,h,l)})),this._labelContainer.visible){const n=this._labelViews.count,o=Math.ceil(9/(360/n)),h=i+t.tick.options.length,l="center";this._labelViews.forEach(((t,i)=>{if(t.setVis(i%o==0)){t.layout(l);const n=r[i],o=t.getBBox(),_=a+n.pos,c=e+d(_)*(h+o.width/2)-o.width/2,p=s+u(_)*(h+o.height/2)-o.height/2;t.trans(c,p)}})),n>2&&w(r[n-1].pos-r[n-2].pos)<O/24&&this._labelViews.get(n-1).setVis(!1)}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,a,t.getTotalAngle(),!0);else{const t=[];r.map((r=>{const n=r.pos;t.push(e+d(a+n)*i,s+u(a+n)*i)})),this._lineView.setPolyline(t)}this._startView.visible&&(this._startView.setLine(e,s,e+d(a)*i,s+u(a)*i),this._endView.setLine(e,s,e+d(a+o)*i,s+u(a+o)*i))}}bh.LINE_CLASS="rct-polar-xaxis-line",bh.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",bh.GRID_CLASS="rct-polar-xaxis-grid-line";class vh extends yh{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridLines=new Zn(this._gridContainer,xa,vh.GRID_LINE_STYLE),e.add(this._lineView=new Nr(t,"rct-polar-yaxis-line"))}_doPrepare(t,e,s,i){const r=t.line;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridLines.prepare(e.length,null),(this._lineView.visible=r.visible)&&this._lineView.setStyleOrClass(r._style)}_doLayout(t,e,s,i,r,n){const a=n.getStartAngle(),o=n.getTotalAngle();if(this._gridContainer.visible){const t=this._circular;this._gridLines.forEach(((i,h)=>{const l=r[h].pos;if(i.setFill("none"),t)i.setArc(e,s,l,a,o,!0);else{const t=[];n._ticks.forEach((i=>{const r=i.pos;t.push(e+d(a+r)*l,s+u(a+r)*l)})),i.setPolyline(t)}}))}if(this._labelContainer.visible)if(n.isArced()){const t=n.getStartAngle();this._labelViews.forEach(((i,n)=>{const a=e+d(t)*r[n].pos-i.getBBox().width/2,o=s+u(t)*r[n].pos-i.getBBox().height/2;i.setContrast(null).trans(a,o)}))}else this._labelViews.forEach(((t,i)=>{t.setContrast(null).trans(e+2,s-r[i].pos-t.getBBox().height/2)}));this._lineView.visible&&this._lineView.setVLine(e,s,s-i)}}vh.GRID_LINE_STYLE="rct-polar-yaxis-grid-line";class Vh extends ih{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,a=super._doMeasure(t,e,s,i,r);return this._prepareAxes(t,n.xAxis,n._getYAxes().items(),this.model.options.circular,n.xAxis.isArced()),a}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._seriesViews.forEach((t=>{var r;t.model.needClip(!0)&&(this._polarClip||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(e,s,i),t.getClipContainer().setClip(this._polarClip),null===(r=t.getClipContainer2())||void 0===r||r.setClip(this._polarClip)),t.resize(2*i,2*i),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.layout(t.chart.xAxis,e,s,i)})),[this._guideContainer,this._frontGuideContainer].forEach((e=>{e._views.forEach((e=>e.visible&&e.layout(this.width,this.height,t.getPolar(e.model.axis))))})),this._layoutAnnotations(!1,this,this.width,this.height)}_prepareAxes(t,e,s,i,r){this._axisContainer||(this.insertFirst(this._axisLabelContainer=new Ht(t,"rct-polar-axis-labels")),this.insertFirst(this._lineContainer=new Ht(t,"rct_axis-lines")),this.insertFirst(this._axisContainer=new Ht(t,"rct-polar-axes")));const n=this._yAxisViews;for(;n.length<s.length;){const e=new vh(t,this._lineContainer,this._axisLabelContainer);this._axisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisView||this._axisContainer.add(this._xAxisView=new bh(t,this._lineContainer,this._axisLabelContainer)),this._xAxisView.prepare(t,e,i,r)}}class Sh extends ia{constructor(t,e){super(t,e?Sh.SUBTITLE_CLASS:Sh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new Qt(t)),this._richText=new oe}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),Qn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var kh,Ph;Sh.TITLE_CLASS="rct-title",Sh.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(kh||(kh={}));class Ch extends It{constructor(t){super(t,Ch.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._tailVisible=!0,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Xt(t,"rct-tooltip-back")),this.add(this._top=new Xt(t,"rct-tooltip-top")),this.add(this._textView=new Qt(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+Ft.SHADOW_FILTER+")"),this._textView.anchor=Zt.START,this._richText=new oe,this.close(!0,!1)}show(t,e,s,i,r,n,a){const o=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,o,s&&s.map((t=>t.point)));if(!l)return;const _=h.options,c=_.text||l.getTooltipText(t,o);if(!c||!c.trim())return;this.setStyleOrClass(h._style);const d=this.control,u=d.contentWidth(),p=d.contentHeight(),g=this._textView,w=t.chart.isInverted();let x=t._yAxisObj.options.reversed;this._richText.setFormat(c),this._richText.build(g,NaN,NaN,null,h.getTextDomain());const y=g.getBBox();let b=f(_.minWidth||0,y.width+16),v=f(_.minHeight||0,y.height+12)+this._topHeight;t instanceof En&&t.options.legendByPoint?this._top.setFill(o._calcedColor):this._top.setFill(t._calcedColor);const V="visible"===this.getStyle("visibility")?300:0,S=_.offset+this._tailSize,k=n.getFocusPointView().getBounds(),P=d.getBounds();let C,A=!1;if(w){C=r-v/2-f(0,m(r-v/2,p-v)),this._tailVisible=Math.abs(v/2-this._radius-this._tailSize/2)>Math.abs(C),A=h.isFollowPointer(t)?x?b+S>i:i+b+S>u:x?b+S>k.x-P.x+k.width:k.x-P.x-S>u-b,A&&(x=!x);const e=x?kh.LEFT:kh.RIGHT;this.drawTooltip(0,0,b,v,e,C),x?i-=b+S:i+=S,r-=v/2}else{C=i-b/2-f(0,m(i-b/2,u-b)),this._tailVisible=Math.abs(b/2-this._radius-this._tailSize/2)>Math.abs(C),A=h.isFollowPointer(t)?x?r+v+S>p:r-(v+S)<0:x?p-(k.y-P.y-d._padding.top)<v+S:P.bottom-k.bottom+S>p-v,A&&(x=!x);const e=x?kh.BOTTOM:kh.TOP;this.drawTooltip(0,0,b,v,e,C),i-=b/2,x?r+=S:r-=v+S}i=f(0,m(i,u-b)),r=f(0,m(r,p-v)),this.transEx(i,r,V,!1),0===V&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.options.hideDelay:xi.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Vs(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,n){const a=this._tailSize,o=this._radius,h=this._topHeight;let l=["M",t+o,e,"L",t+s-o,e,"Q",t+s,e,t+s,e+o,"L",t+s,e+i-o,"Q",t+s,e+i,t+s-o,e+i,"L",t+o,e+i,"Q",t,e+i,t,e+i-o,"L",t,e+o,"Q",t,e,t+o,e];if(this._tailVisible)switch(r){case kh.TOP:l=l.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case kh.BOTTOM:l=l.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case kh.LEFT:l=l.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case kh.RIGHT:l=l.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const _=r===kh.BOTTOM,c=_?["M",t,e+i-h,"l",s,0,"l",0,h-o,"q",0,o,-o,o,"l",2*o-s,0,"q",-o,0,-o,-o]:["M",t+o,e,"l",s-2*o,0,"q",o,0,o,o,"l",0,h-o,"l",-s,0,"l",0,o-h,"q",0,-o,o,-o],d=this._textView,u=d.getBBox();t+=(s-u.width)/2,e+=(i-u.height+(_?-h:h))/2,d.trans(t,e),this._top.setPath(c),this._back.setPath(l)}}Ch.CLASS_NAME="rct-tooltip";class Ah extends ra{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Sh(t,!1)),this.add(this.subtitleView=new Sh(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,a=e._subtitle;let o,h=0,l=0,_=0,c=0,d=this.titleView,u=s,p=0,g=0;switch(d.setVis(n.visible)?(o=d.measure(t,n,s,i,r),l=this._hTitle=o.height,h=this._wTitle=o.width):d.setModel(n),(d=this.subtitleView).setVis(a.visible)?(o=d.measure(t,a,s,i,r),c=this._hSub=o.height,_=this._wSub=o.width,g=+a.options.titleGap||0):d.setModel(a),a.options.position){case"left":case"right":p=f(l,c),u=h+g+_;break;default:p=l+g+c,u=f(u,h+_)}return p>0&&(p+=this.titleView.visible?x(n.options.gap,0):x(a.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,a=r&&r.options,o=i&&i.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,h=r&&r.visible?this._wSub>t.wPlot||"chart"===a.alignBase?t.wChart:t.wPlot:0;let l=this._wTitle>t.wPlot||i&&"chart"===n.alignBase?0:t.xPlot,_=this._wSub>t.wPlot||r&&"chart"===a.alignBase?0:t.xPlot;if(o>0&&h>0){const t=(t,e,s)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},c=()=>{const e=f(this._hTitle,this._hSub);g=f(g,g+t(i,e,this._hTitle)),w=f(w,w+t(r,e,this._hSub))},d=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(m=f(m,m+d(i,o,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":y=m;break;case"right":y=m+this._wTitle-this._wSub;break;default:y=m+(this._wTitle-this._wSub)/2}else y=f(y,y+d(r,h,this._wSub))},p=x(a.titleGap,0);let g=0,m=l,w=0,y=_;switch(n.align){case"left":switch(a.position){case"left":m=y+this._wSub+p,c();break;case"right":switch(y=m+this._wTitle+p,a.align){case"center":y=f(y,y+(h-this._wTitle-this._wSub)/2);break;case"right":y=f(y,_+h-this._wSub)}c();break;case"top":u(),g=w+this._hSub+p;break;default:u(),w=g+this._hTitle+p}break;case"right":switch(a.position){case"left":switch(m+=o-this._wTitle,a.align){case"center":y+=(o-this._wTitle-this._wSub)/2;break;case"right":y=m-p-this._wSub}c();break;case"right":y+=h-this._wSub,m=y-p-this._wTitle,c();break;case"top":u(),g=w+this._hSub+p;break;default:u(),w=g+this._hTitle+p}break;default:switch(a.position){case"left":switch(m+=(o-this._wTitle)/2,a.align){case"left":break;case"center":y+=(m-y-this._wSub)/2;break;case"right":y=m-p-this._wSub}c();break;case"right":switch(m+=(o-this._wTitle)/2,a.align){case"left":y=m+this._wTitle+p;break;case"center":y=m+this._wTitle+p,y+=(h-y-this._wSub)/2;break;case"right":y+=h-p-this._wSub}c();break;case"top":u(),g=w+this._hSub+p;break;default:u(),w=g+this._hTitle+p}}e.resizeByMeasured().layout().trans(m,g),s.resizeByMeasured().layout().trans(y,w)}else if(o>0||h>0){const t=o?i:r,n=o?e:s,a=o||h,c=o?this._wTitle:this._wSub;let d=o?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=a-c;break;default:d+=(a-c)/2}n.trans(d,0)}}}class Lh extends ra{_doInitChildren(t){this.add(this._legendView=new ph(t))}_doMeasure(t,e,s,i,r){const n=e._legend,a=this._legendView.measure(t,n,s,i,r),o=this._pos=n._location;return"left"===o||"right"===o?a.width+=this._legendView._gap:a.height+=this._legendView._gap,a}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}}class Eh extends ra{constructor(t,e){super(t),this.dir=e,this.views=[],this.visibles=[],this._gap=0}prepare(t,e,s,i,r){const n=this.views;let a,o=n.length;for(;n.length<s.length;)a=new ga(t),s[o++].visible&&this.add(a),n.push(a);for(;n.length>s.length;)a=n.pop(),a.parent&&a.remove();if(n.forEach(((t,e)=>{t.prepare(s[e])})),this.setVis(n.filter((t=>t.model.visible)).length>0)){const t=n[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){this.views.forEach(((i,r)=>{i.prepareGuides(t,NaN,NaN,e,s)}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map((t=>t.model)))}clean(){this.views.forEach((t=>t.clean()))}setMargins(t,e,s,i){this.views.forEach((r=>r.setMargins(t,e,s,i)))}_doMeasure(t,e,s,i,r){this._inverted;let n=0,a=0;return[this.views].forEach((e=>{if(e){const o=(this.isX,s),h=(this.isX,i);let l=0,_=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,o,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,_+=s.height}})),this.isHorz?_+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=f(n,l),a=f(a,_)}})),{width:n,height:a}}_doLayout(t){const e=this.control.loaded;let s=this.width,i=this.height,r=0,n=0;t=+t||0,[this.views].forEach((a=>{if(a){let o=0;a.forEach((t=>{t.visible&&(t.checkExtents(e),this.isHorz?t.resize(s,t.mh):t.resize(t.mw,i),t.layout(),this.isHorz?(t.trans(r,this.dir===jn.TOP?i-o-t.mh:o),o+=t.mh+this._gap):(t.trans(this.dir===jn.RIGHT?o:s-o-t.mw,n),o+=t.mw+this._gap))})),this.isHorz?r+=s+t:n+=i+t}}))}}class Nh extends sa{constructor(t){super(t,"rct-credits"),this.add(this._textView=new Qt(t)),this._textView.anchor=Zt.START}clicked(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.getBBox()}}class Mh extends Ht{constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new Ht(t,"rct-annotations")),this.add(this._plotContainer=new Ht(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new ih(t,this));for(const e in jn){const s=new Eh(t,jn[e]);this._plotContainer.add(s),this._axisSectionMap[jn[e]]=s}this.add(this._paneContainer=new wh(t,this)),this.add(this._titleSectionView=new Ah(t)),this.add(this._legendSectionView=new Lh(t)),this.add(this._frontAnnotationContainer=new Ht(t,"rct-front-annotations")),this.add(this._creditView=new Nh(t)),this.add(this._navigatorView=new nh(t)),this.add(this._historyView=new dh(t)),this.add(this._tooltipView=new Ch(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}clean(){for(const t in this._axisSectionMap)this._axisSectionMap[t].clean()}measure(t,e,s,i,r){const n=this._model=e,a=n.isPolar(),o=n._chartOptions.credits,h=n._legend,l=n._navigator;let _,c=s,d=i;if(this._inverted=n.isInverted(),n.isSplitted()?(this._plotContainer.setVis(!1),this._paneContainer.setVis(!0),this.$_preparePanes(t,n._split)):(this._plotContainer.setVis(!0),this._paneContainer.setVis(!1),this.$_prepareBody(t,a)),this._creditView.setVis(o.visible)&&(_=this._creditView.measure(t,o,c,d,r),o.isFloating()||("middle"!==o.options.verticalAlign?d-=_.height+(+o.options.offsetY||0)+(+o.options.gap||0):"center"!==o.options.align&&(c-=_.width+(+o.options.offsetX||0)+(+o.options.gap||0)))),_=this._titleSectionView.measure(t,n,c,d,r),d-=_.height,this._legendSectionView.setVis(h.visible))switch(_=this._legendSectionView.measure(t,n,c,d,r),h._location){case"top":case"bottom":d-=_.height;break;case"right":case"left":c-=_.width}this._navigatorView.setVis(l.visible),this._paneContainer.visible?this._paneContainer.measure(t,n._split,n._xPaneAxes,n._yPaneAxes,c,d,1):a?this.$_measurePolar(t,n,c,d,1):this.$_measurePlot(t,n,c,d,1),this._navigatorView.visible&&(n._navigator._vertical?d=this._bodyView.mh:c=this._bodyView.mw,this._navigatorView.measure(t,l,c,d,r)),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){const t=this.width,e=this.height;let s=t,i=e;const r=this._model,n=r.isPolar(),a=r._legend,o=this._creditView,h=r._chartOptions.credits,l=h.options,_=+l.gap||0;let c=0,d=0,u=0,p=0,g=0,m=0,f=0,w=0;o.visible&&(o.resizeByMeasured(),h.isFloating()||("middle"!==l.verticalAlign?(c=+l.offsetY||0,"top"===l.verticalAlign?i-=u=o.height+c+_:i-=p=o.height+c+_):(d=+l.offsetX||0,"left"===l.align?s-=g=o.width+d+_:s-=m=o.width+d+_)));const x=this._titleSectionView;let y=0;const b=w+u;x.visible&&(x.resizeByMeasured(),i-=y=x.height),f=g,w=e-p;const v=this._navigatorView;let V=0;v.visible&&(v.model._vertical||(v.resize(v.mw,v.mh-v.model.getGap()-v.model.getGapFar()),i-=V=v.mh));const S=this._legendSectionView;let k,P,C=0,A=0;if(S.visible)switch(S.resizeByMeasured().layout(),C=S.height,A=S.width,a._location){case"top":k=y+u,i-=C;break;case"bottom":i-=C,k=w-C,w-=C;break;case"right":s-=A,P=t-A;break;case"left":s-=A,f+=A,P=0}v.visible&&(w-=V,v.layout().transY(w+v.model.getGap()));let L,E=0,N=0,M=0,T=0;if(this._paneContainer.visible)this._paneContainer.trans(f,b+y).resize(s,i),this._paneContainer.layout(),M=i,T=s,L=this._paneContainer.getRect();else{const t=this._axisSectionMap,e=t[jn.CENTER],r=t[jn.MIDDLE];let a;if(!n){const n=this.control._padding;e&&e.visible&&(E=e.mw),r&&r.visible&&(N=r.mh),[jn.LEFT,jn.RIGHT].forEach((e=>{(a=t[e])&&a.visible&&(s-=a.mw)})),[jn.TOP,jn.BOTTOM].forEach((e=>{(a=t[e])&&a.visible&&(i-=a.mh)})),(a=t[jn.LEFT])&&a.visible&&(a.resize(a.mw,i),a.layout(N),f+=a.mw),(a=t[jn.RIGHT])&&a.visible&&(a.resize(a.mw,i),a.layout(N)),E>0&&(e.resize(a.mw,i),e.layout()),(a=t[jn.BOTTOM])&&a.visible&&(a.setMargins(n.left,f,this.width-f-s,Math.max(0,n.right-2)),a.resize(s,a.mh),a.layout(E),w-=a.mh),(a=t[jn.TOP])&&a.visible&&(a.setMargins(n.left,f,this.width-f-s,Math.max(0,n.right-1)),a.resize(s,a.mh),a.layout(E)),N>0&&(r.resize(s,a.mh),r.layout())}v.visible&&v.layout().transX(f);const o=this._org={x:f,y:w};this._plotWidth=s,this._plotHeight=i,n||((a=t[jn.LEFT])&&a.visible&&a.trans(o.x-a.mw,o.y-a.height),(a=t[jn.RIGHT])&&a.visible&&a.trans(o.x+s,o.y-a.height),E>0&&e.trans(o.x+(s-E)/2,o.y-e.height),(a=t[jn.BOTTOM])&&a.visible&&a.trans(o.x,o.y),(a=t[jn.TOP])&&a.visible&&a.trans(o.x,o.y-i-a.height),N>0&&r.trans(o.x,o.y-(i-N)/2-N));const h=this._currBody;M=this._plotHeight-N,T=this._plotWidth-E,f=o.x,w=o.y-this._plotHeight,h.resize(T,M),h.trans(f,w),h.layout(),L=h.getRect(),h._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(o.visible){let s,i;switch(o.layout(),l.verticalAlign){case"top":i=c;break;case"middle":i=(e-o.height)/2+c;break;default:i=p>0?e-p+_:e-o.height-c}switch(l.align){case"left":s=d;break;case"center":s=(t-o.width)/2+d;break;default:s=m>0?t-m+_:t-o.width-d}o.trans(s,i)}if(T+=E,x.visible&&x.layout({xPlot:f,wPlot:T,wChart:t}).trans(0,b),S.visible){const r=a.options,n=r.align,o=r.verticalAlign;if("body"===a._location){let t=+r.offsetX||0;switch(n){case"right":f+=T-A-t;break;case"center":f+=(T-A)/2+t;break;default:f+=t}switch(t=+r.offsetY||0,o){case"bottom":w+=M-C-t;break;case"middle":w+=(M-C)/2+t;break;default:w+=t}}else if(isNaN(k)){const t=+r.offsetY||0;if(f=P,"chart"===r.alignBase){switch(o){case"top":w=t;break;case"bottom":w=e-C-t;break;default:w=(e-C)/2+t}w+C>e&&(w=(e-C)/2)}else switch(o){case"top":w+=t;break;case"bottom":w=w+i-C-t;break;default:w=w+(i-C)/2+t}w+C>e&&(w=(e-C)/2),w<0&&(w=0)}else{const e=+r.offsetX||0;if(w=k,"chart"===r.alignBase)switch(n){case"left":f=e;break;case"right":f=t-A-e;break;default:f=(t-A)/2+e}else switch(n){case"left":f+=e;break;case"right":f=f+s-A-e;break;default:f+=(s-A)/2+e}f+A>t&&(f=(t-A)/2),f<0&&(f=0)}S.trans(f,w)}this.$_layoutAnnotations(this._inverted,t,e,L),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i,r){const{x:n,y:a}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},o=this._model.chart._tooltip.isFollowPointer(t),h=i.getTooltipPos(),l=o?r.x+h.x:n+h.x,_=o?r.y+h.y:a+h.y;this._tooltipView.show(t,e,s,l,_,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._paneContainer.visible?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){var i;const r=s,n=this._model&&this.bodyOf(s),a=null==r?void 0:r.classList,o=(null==a?void 0:a.value)&&(a.contains("rct-contextmenu-item")||a.contains("rct-contextmenu-list"));let h=this._hoverItem;if(this._hoverItem=null,n){const i=n.controlToElement(t,e),a=n.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(r)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(r);t&&(t.legend.options.seriesHovering&&t.source instanceof Ys?n.hoverSeries(t.source):t.legend.options.pointHovering&&t.source instanceof Ms&&n.hoverPoint(t.source))}if(h instanceof ys&&!(this._hoverItem instanceof ys)&&(n.hoverSeries(null),n.hoverPoint(null)),!a)return void n.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,r=e._isHorz?n.width:n.height,h=e._isHorz?i.x:i.y,l=a&&s.visible&&!o&&s.flag.visible&&!s.isBar()&&s.getFlag(r,h);if(l){t.showCrosshair(h,l);const r=[];n._seriesViews.forEach((t=>{let s,n=Number.MAX_SAFE_INTEGER;const a=this._model.inverted;t.model._visPoints.forEach((t=>{const r=t.xPos,o=t instanceof Hr&&!a?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=e._isX?Math.abs(i.x-r):Math.abs(i.y-o);h<n&&(n=h,s=t)})),r.push(s)})),s.moved(h,l,r)}else t.hideCrosshiar()}))}else(null===(i=this._model)||void 0===i?void 0:i.isSplitted())?this._paneContainer.bodies.forEach((t=>{t.removeFocus()})):this._currBody.removeFocus()}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in jn){const s=this._axisSectionMap[jn[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this,this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody,this._currBody.width,this._currBody.height))}isAnimating(){return this._bodyView.animating()}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new Vh(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model)}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),a=this._axisSectionMap;for(const s in a){const o=a[s];n?o.prepare(t,e,e.getAxes(s,!1),i,r):o.visible=!1}s.prepare()}$_prepareAxisGuides(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e._needAxes(),n=this._axisSectionMap;for(const e in n){const a=n[e];r&&a.visible&&a.prepareGuides(t,s,i)}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap;if(this._navigatorView.visible){const t=e._navigator;t._vertical?s-=t.getSize():i-=t.getSize()}const a=s,o=i;let h=0,l=0;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=n[jn.LEFT].checkWidths(t,s,i),s-=n[jn.RIGHT].checkWidths(t,s,i),i-=n[jn.BOTTOM].checkHeights(t,s,i),i-=n[jn.TOP].checkHeights(t,s,i),this._inverted?s-=h=n[jn.CENTER].checkWidths(t,s,i):i-=l=n[jn.MIDDLE].checkHeights(t,s,i),s-=h,i-=l,e.layoutAxes(s,i,this._inverted,r);for(const a in n){const o=n[a];o.visible&&o.measure(t,e,s,i,r)}s=a,i=o,h=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===jn.LEFT||t===jn.RIGHT?s-=e.mw:t!==jn.BOTTOM&&t!==jn.TOP||(i-=e.mh),this._inverted?t===jn.CENTER&&(s-=h=e.mw):t===jn.MIDDLE&&(i-=l=e.mh))}e.layoutAxes(s,i,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const a in n){const o=n[a];o.visible&&(o.measure(t,e,s,i,r),o.prepareGridRows(t,this._bodyView._gridRowContainer))}s=a,i=o,h=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===jn.LEFT||t===jn.RIGHT?s-=e.mw:t!==jn.BOTTOM&&t!==jn.TOP||(i-=e.mh),this._inverted?t===jn.CENTER&&(s-=h=e.mw):t===jn.MIDDLE&&(i-=l=e.mh))}e.axesLayouted(s,i,this._inverted),this._bodyView.measure(t,e._body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e._body.getRadius(s,i),a=2*Math.PI*n,o=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(a,o,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(a,o,!1),this._polarView.measure(t,e._body,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const a=r.get(e)||Wo(t,e);(e.options.front?i:s).add(a),r.set(e,a),n.push(a)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,a,o,h;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)n=-r.left,a=-r.top,o=e+r.left+r.right,h=s+r.top+r.bottom;else n=a=0,o=e,h=s;i._layoutView(t,this,n,a,o,h)}))}}!function(t){t.EXPORT="$$realchart_export"}(Ph||(Ph={}));class Th extends Ft{constructor(t,e){super(t,e),this.addElement(this._chartView=new Mh(t)),this.setPointerHandler(new ch(this))}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new Yn(null,((t,e)=>{this.changeModel(t,e)}))}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof ke&&s===xe.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearAssetDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Ph.EXPORT)this._exporter=t}_doRender(t){var e;const s=this.model,i=this._chartView;this.clearTemporaryDefs(),s&&(this.setData("theme",s._chartOptions.options.theme,!0),this.setData("palette",s._chartOptions.options.palette),s._prepareRender(),this._loadModules(),this._prepareModules()),this.loaded||i.clean(),i.measure(this.doc(),s,t.width,t.height,1),i.setRect(t),i.layout(),s&&s.afterRender(),(null===(e=this._chart)||void 0===e?void 0:e._loadCallback)&&(setTimeout(this._chart._loadCallback,0),this._chart._loadCallback=void 0)}_doRenderBackground(t,e,i,r){if(this.model){const i=this.model._chartOptions._style;if(s(i))for(const s in i)s.startsWith("padding")?e.setStyle(s,i[s]):t.style[s]=i[s]}}_loadModules(){if(!this._exporter){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this)}}_prepareModules(){this._exporter&&this._exporter.render(this.doc(),this.dom(),this.model._exporter.options)}_export(t){if(!this.model||!this._exporter)return;const e=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this._exporter.exportToImage(e,t)}}}class Rh{static getVersion(){return"1.1.7"}static setLocale(t,e){e&&L(t,e),(t=>{t&&(A=P[C=t.substring(0,2)]),A||(A=P[C="ko"])})(t)}static registerLocale(t,e){L(t,e)}static setDebugging(t){It.DEBUGGING=t}static setLogging(t){k.LOGGING=t}static setAnimatable(t){Ft._animatable=t}static configure(t){return t}static createChart(t,e,i,r=!0,n){const a=new Th(t,e);return s(i)&&a.chart.load(i,r,n),a.chart[Xn]=a,a.chart}static createData(t,e){return new Un(t||{},e)}}class Oh{static empty(){return new Oh}static create(t=0,e=0){return new Oh(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}const Bh=Rh.getVersion,Dh=Rh.setDebugging,$h=Rh.setLogging,zh=Rh.setAnimatable,Fh=Rh.configure,Ih=Rh.createChart,Hh=Rh.createData;export{ke as Annotation,Gr as AreaRangeSeries,Ir as AreaSeries,Wr as AreaSeriesGroup,je as Axis,Ai as AxisBaseLine,Re as AxisGrid,Ee as AxisItem,Fe as AxisLabel,Ne as AxisLine,Ie as AxisScrollBar,Ge as AxisSectorLine,ze as AxisTick,Me as AxisTitle,vr as BarRangeSeries,kr as BarSeries,Sr as BarSeriesBase,Cr as BarSeriesGroup,Pr as BarSeriesGroupBase,ei as BasedSeries,Yr as BellCurveSeries,ws as Body,Zr as BoxPlotSeries,Kr as BubbleSeries,tr as BulletGauge,Ki as BulletGaugeBand,er as BulletGaugeGroup,Qi as BulletTargetBar,Ji as BulletValueBar,Qr as BumpSeriesGroup,sn as CandlestickSeries,zs as CategoryAxis,$s as CategoryAxisGrid,Ds as CategoryAxisLabel,Bs as CategoryAxisTick,Yn as Chart,Un as ChartData,lt as ChartDataCollection,xe as ChartItem,Gn as ChartOptions,be as ChartText,rn as CircelBarPointLabel,nn as CircleBarSeries,an as CircleBarSeriesGroup,hr as CircleGauge,lr as CircleGaugeGroup,nr as CircleGaugeHand,ar as CircleGaugePin,ir as CircleGaugeRim,sr as CircleGaugeRimBase,or as CircleGaugeScale,rr as CircleGaugeValueRim,ps as CircularGauge,gs as CircularGaugeGroup,ds as CircularGaugeLabel,wr as ClockGauge,cr as ClockGaugeHand,fr as ClockGaugeLabel,dr as ClockGaugeMinuteHand,mr as ClockGaugePin,_r as ClockGaugeRim,ur as ClockGaugeSecondHand,pr as ClockGaugeTick,gr as ClockGaugeTickLabel,ti as ClusterableSeries,ai as ClusterableSeriesGroup,ni as ConstraintSeriesGroup,Li as ContinuousAxis,In as Credits,Ae as Crosshair,Ms as DataPoint,Ts as DataPointCollection,Hs as DataPointLabel,ln as DumbbellSeries,cn as EqualizerSeries,dn as ErrorBarSeries,xs as Exporter,pn as FunnelSeries,es as Gauge,Je as GaugeBase,ss as GaugeGroup,ts as GaugeItem,_s as GaugeLabel,ls as GaugeRangeBand,hs as GaugeRangeLabel,os as GaugeScale,mn as HeatmapSeries,xn as HistogramSeries,Oh as IPoint,ve as IconedText,yi as ImageAnnotation,bs as Legend,Or as LinePointLabel,$r as LineSeries,Br as LineSeriesBase,jr as LineSeriesGroup,Tr as LineSeriesPoint,Ei as LinearAxis,Xi as LinearGauge,ji as LinearGaugeBase,Yi as LinearGaugeChildLabel,qi as LinearGaugeGroup,Zi as LinearGaugeGroupBase,Ui as LinearGaugeGroupLabel,Gi as LinearGaugeLabel,cs as LinearGaugeScale,Wi as LinearValueBar,Mi as LogAxis,vn as LollipopSeries,ii as LowRangedSeries,oi as MarkerSeries,li as NavigatorMask,hi as NavigiatorHandle,Sn as OhlcSeries,Pn as ParetoSeries,En as PieSeries,Nn as PieSeriesGroup,Ln as PieSeriesLabel,An as PieSeriesText,Hn as PointHovering,Js as RadialSeries,si as RangedSeries,N as RcObject,Tn as ScatterSeries,Ys as Series,ri as SeriesGroup,qs as SeriesMarker,ui as SeriesNavigator,bi as ShapeAnnotation,zr as SplineSeries,mi as Split,wi as Subtitle,vi as TextAnnotation,zi as TimeAxis,fi as Title,xi as Tooltip,Bn as TreemapSeries,Gs as Trendline,rs as ValueGauge,$n as VectorSeries,Fn as WaterfallSeries,qe as Widget,Qs as WidgetSeries,Fh as configure,Ih as createChart,Hh as createData,Bh as getVersion,zh as setAnimatable,Dh as setDebugging,$h as setLogging};
|
|
7
|
+
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},a=function(t){return"string"==typeof t&&t.length>0},o=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,_=Math.floor,c=Math.ceil,d=Math.cos,u=Math.sin,p=function(t){return Math.pow(10,t)},g=Math.log10,m=Math.min,f=Math.max,w=Math.abs,x=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},y=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},b=function(t,e){return void 0!==t?t:e},v=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},V=(t,e,s)=>t+(e-t)*s,S=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class k{static log(...t){this.LOGGING&&console.log(...t)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&k.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(m(s,k.month_days[k.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),a=new Date(r,i+1,0).getDate(),o=t.getDate()+n-1,h=e+Math.ceil((a+n-7)/7),l=e+Math.floor(o/7);return s||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!i(t))return l({},t)}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(i(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-S}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=f(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=f(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=i(t)?[]:{};for(let s of Object.keys(t))e[s]=k.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),k.log(t,+new Date-s+"ms")}static clamp(t,e,s){return f(e,m(s,t))}static makeIntArray(t,e){const s=new Array(f(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=w(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}}k.LOGGING=!1,k.week_days=["일","월","화","수","목","금","토"],k.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],k.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],k.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const P={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let C="ko",A=P[C]||P[C="ko"];const L=(t,e)=>{t&&s(e)&&(A=P[t.substring(0,2)]=Object.assign(P.ko,P.en,e))};let E=0;class N{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(E++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class M extends N{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const T=void 0,R=Math.PI,O=2*R,B=-R/2,D=2*R/360,$=360/R/2,z="%".charCodeAt(0);function F(t){return t>O?t%O:t}function I(t){return parseFloat(t.toPrecision(12))}function H(t){return Math.floor(1e6*t)/1e6}function G(t){return null==t?null:String(t)}function j(t){return t+"px"}function W(t){return null==t||Number.isNaN(t)||""===t}function X(t){return t<10?"0"+t:String(t)}function Y(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function U(t,e){const s={};return s[t]=e,s}function Z(t,e,s){let i,r=!1;if(null==t){if(e)return null;i=s||0,r=!0}else if("string"==typeof t){const s=t.trim();if(0===s.length?i=NaN:s.charCodeAt(s.length-1)===z?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;it(A.invalidSizeValue,t)}}else if(i=+t,isNaN(i)){if(e)return null;i=s||0,r=!0}else r=!0;return{size:i,fixed:r}}function q(t,e){return Z(t,!0)||Z(e,!1)}function K(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Q="fill",J={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},tt=function(t){const e=J[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return J[t]=e,e}return e};class et extends Error{}const st=function(t,e){if(!t)throw new et(e)},it=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},rt=function(t,e,r,a=!0,o=!0,h=!1,_){let c,d;if(a&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),i(t))c=[],t.forEach((t=>{if(s(t)&&n(t.color)){const s={fromValue:x(t.fromValue,d?d.toValue:e),toValue:x(t.toValue,r),color:t.color,style:t.style?l({},t.style):T};s.fromValue<s.toValue&&(c.push(s),d=s)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<r)),o&&c.forEach((t=>{t.fromValue=f(t.fromValue,e),t.toValue=m(t.toValue,r)}));else if(s(t)&&i(t.colors)&&t.colors.length>0){const s=t.colors,n=i(t.styles)?t.styles:null;if(c=[],i(t.steps)&&t.steps.length>0){const a=i(t.steps)?t.steps:null;e<a[0]&&a.unshift(e),r>a[a.length-1]&&a.push(r);for(let t=0;t<a.length-1;t++)c.push({fromValue:a[t],toValue:a[t+1],color:s[m(t,s.length-1)],style:n?n[m(t,n.length-1)]:T})}else{let i=x(t.fromValue,e);const a=x(t.toValue,r),o=(a-i)/s.length;let h=0;for(;i<a;)c.push({fromValue:i,toValue:i+=o,color:s[m(h,s.length-1)],style:n?n[m(h,n.length-1)]:T}),h++}}if(h&&c&&c.length>0){let t=0,s=e;for(;t<c.length;)c[t].fromValue>s&&c.splice(t,0,{fromValue:s,toValue:c[t].fromValue,color:_}),s=c[t].toValue,t++;c[t-1].toValue<r&&c.push({fromValue:c[t-1].toValue,toValue:r,color:_})}return c},nt="vertical-lr",at="vertical-rl",ot=function(t){return t&&"object"==typeof t};class ht extends M{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),i(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=i(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(i(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else ot(t)?Object.assign(e,t):e[this._field]=t;return e}getValue(t,e){return this._checkRow(t),this._rows[t][e]}setValue(t,e,s){this._checkRow(t);const i=this._rows[t],r=i[e];s!==r&&(i[e]=s,this._rows[t]=i,this._fireEvent("onDataValueChanged",t,e,s,r),this._changed())}getValues(t,e=0,s=-1){const i=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(s)||s<0||s>i.length)&&(s=i.length);for(let n=e;n<s;n++)r.push(i[n][t]);return r}getRow(t){return this._checkRow(t),Object.assign({},this._rows[t])}addRow(t,e){isNaN(e)||e<0?e=this._rows.length:this._checkRow(e),this._rows.splice(e,0,t),this._fireEvent("onDataRowAdded",e),this._changed()}deleteRow(t){(isNaN(t)||t<0)&&(t=this._rows.length-1),this._checkRow(t);const e=this._rows[t];this._rows.splice(t,1),this._fireEvent("onDataRowDeleted",t,e),this._changed()}_checkRow(t){(t<0||t>this._rows.length)&&it(A.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class lt{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let r;i(s)?r=new ht({},s):ot(s)&&i(s.values)&&(r=new ht(s.options,s.values)),this._map[e]=r}}}const _t="0".charCodeAt(0),ct="#".charCodeAt(0),dt=",".charCodeAt(0),ut="s".charCodeAt(0),pt="a".charCodeAt(0);class gt{static getFormatter(t){let e=gt.Formatters[t];return e||(gt.Formatters[t]=e=new gt(t)),e}static get Default(){return gt.getFormatter(gt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===_t;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===ct;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===_t;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===dt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===ut){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===pt){s.signDisplay="never";break}}return s.minimumIntegerDigits=f(1,s.minimumIntegerDigits),s}}}gt.DEFAULT_FORMAT="",gt.Formatters={};const mt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],ft=[".","/","-",":"],wt="Z".charCodeAt(0),xt="z".charCodeAt(0),yt="A".charCodeAt(0),bt="a".charCodeAt(0),vt="y".charCodeAt(0),Vt="M".charCodeAt(0),St="m".charCodeAt(0),kt="W".charCodeAt(0),Pt="w".charCodeAt(0),Ct="d".charCodeAt(0),At="H".charCodeAt(0),Lt="h".charCodeAt(0),Et="S".charCodeAt(0),Nt="s".charCodeAt(0);class Mt{static getFormatter(t){let e=Mt.Formatters[t];return e||(Mt.Formatters[t]=e=new Mt(t)),e}static get Default(){return Mt.getFormatter(A.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||A.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,n=s.length;r<n;r++){var a=s[r],o=a.length;switch(a.charCodeAt(0)){case vt:i+=o>2?t.getFullYear():X(t.getFullYear()%100);break;case Vt:i+=o>1?X(t.getMonth()+1):t.getMonth()+1;break;case Ct:i+=o>1?X(t.getDate()):t.getDate();break;case kt:i+=o>1?X(k.weekOfYear(t,e)+1):k.weekOfMonth(t,e,!0)+1;break;case Pt:i+=o>1?k.long_week_days[t.getDay()]:k.week_days[t.getDay()];break;case At:i+=o>1?X(t.getHours()):t.getHours();break;case Lt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=o>1?X(e):e}else i+=o>1?X(t.getHours()):t.getHours();break;case St:i+=o>1?X(t.getMinutes()):t.getMinutes();break;case Nt:i+=o>1?X(t.getSeconds()):t.getSeconds();break;case bt:case yt:t.getHours()<12?i+=A.am:i+=A.pm;break;case Et:let s=t.getMilliseconds();i+=3==o?Y(s):2==o?X(s):s.toString().substring(0,o);break;default:i+=a}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(ft.indexOf(n)>=0)e.push(n),r++;else{let a=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(a,r),mt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=yt&&e<=wt||e>=bt&&e<=xt)&&it(A.invalidDateFormat,t)}e.push(n)}if(r<i&&k.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&k.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||A.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Mt.Formatters={};class Tt{static isBright(t){return new Tt(t).isBright()}static getContrast(t,e,s){return new Tt(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(k.startsWith(t,"rgb(")&&k.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):k.startsWith(t,"rgba(")&&k.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):k.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Tt(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}class Rt{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}var Ot;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Ot||(Ot={}));const Bt={name:"RealChart",version:"1.1.8",license:"enterprise",code:""};class Dt{static decode(t){const e=Dt.CHARS,s=Dt.PAD;let i=t.split(""),r=[],n=i.length;for(;i[--n]==s;);for(let t=0;t<n;){let s=e.indexOf(i[t++])<<18;t<=n&&(s|=e.indexOf(i[t++])<<12),t<=n&&(s|=e.indexOf(i[t++])<<6),t<=n&&(s|=e.indexOf(i[t++])),r.push(s>>>16&255),r.push(s>>>8&255),r.push(255&s)}for(;0==r[r.length-1];)r.pop();return r}}Dt.PAD="=",Dt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class $t{static union(t,e){const s=e.s3[255&t];t>>=8;const i=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let a=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return a=(a>>16^i>>16)<<16|65535&(65535&a^65535&i),(a>>16)+(s>>16)+((65535&a)+(65535&s)>>16)<<16|(65535&a)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=$t.xor,i=$t.union;let r=t.left,n=t.right;r=s(r,e.p[0]),n=s(n,s(i(r,e),e.p[1])),r=s(r,s(i(n,e),e.p[2])),n=s(n,s(i(r,e),e.p[3])),r=s(r,s(i(n,e),e.p[4])),n=s(n,s(i(r,e),e.p[5])),r=s(r,s(i(n,e),e.p[6])),n=s(n,s(i(r,e),e.p[7])),r=s(r,s(i(n,e),e.p[8])),n=s(n,s(i(r,e),e.p[9])),r=s(r,s(i(n,e),e.p[10])),n=s(n,s(i(r,e),e.p[11])),r=s(r,s(i(n,e),e.p[12])),n=s(n,s(i(r,e),e.p[13])),r=s(r,s(i(n,e),e.p[14])),n=s(n,s(i(r,e),e.p[15])),r=s(r,s(i(n,e),e.p[16])),t.right=r,t.left=s(n,e.p[17])}static _decryptBlock(t,e){const s=$t.xor,i=$t.union;let r=t.left,n=t.right;r=s(r,e.p[17]),n=s(n,s(i(r,e),e.p[16])),r=s(r,s(i(n,e),e.p[15])),n=s(n,s(i(r,e),e.p[14])),r=s(r,s(i(n,e),e.p[13])),n=s(n,s(i(r,e),e.p[12])),r=s(r,s(i(n,e),e.p[11])),n=s(n,s(i(r,e),e.p[10])),r=s(r,s(i(n,e),e.p[9])),n=s(n,s(i(r,e),e.p[8])),r=s(r,s(i(n,e),e.p[7])),n=s(n,s(i(r,e),e.p[6])),r=s(r,s(i(n,e),e.p[5])),n=s(n,s(i(r,e),e.p[4])),r=s(r,s(i(n,e),e.p[3])),n=s(n,s(i(r,e),e.p[2])),r=s(r,s(i(n,e),e.p[1])),t.right=r,t.left=s(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=$t.kb,i=$t._encryptBlock;let r,n,a,o=0,h=0,l={left:0,right:0};const _={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*$t.POW8|e[o++%i];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:s.s0.slice(0),s1:s.s1.slice(0),s2:s.s2.slice(0),s3:s.s3.slice(0)};for(r=0,a=_.p.length;r<a;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,a=_["s"+r].length;n<a;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=$t._decryptBlock;let i=$t._init(e),r=[],n=Dt.decode(t),a=n.length>>3,o=0,h={left:null,right:null};for(let t=0;t<a;t++){h.left=n[o]*$t.POW24|n[o+1]*$t.POW16|n[o+2]*$t.POW8|n[o+3],h.right=n[o+4]*$t.POW24|n[o+5]*$t.POW16|n[o+6]*$t.POW8|n[o+7],s(h,i);const t=h.left,e=h.right;r.push(t>>24&255),r.push(t>>16&255),r.push(t>>8&255),r.push(255&t),r.push(e>>24&255),r.push(e>>16&255),r.push(e>>8&255),r.push(255&e),o+=8}if(r[r.length-1]==r[r.length-2]||1==r[r.length-1]){let t=r[r.length-1];r.splice(r.length-t,t)}return String.fromCharCode.apply(null,r)}}$t.POW2=Math.pow(2,2),$t.POW3=Math.pow(2,3),$t.POW4=Math.pow(2,4),$t.POW8=Math.pow(2,8),$t.POW16=Math.pow(2,16),$t.POW24=Math.pow(2,24),$t.kb={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],k:[202,218,204,100]};class zt{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substr(1,t.length-1),e.substr(e.indexOf(t),t.length)==t)}static _getLDKey(t){let e="";for(let s=0,i=t.length;s<i;s++)e+=String.fromCharCode(t[s]>>1);return e}static includedDomains(t,e,s){let i=t.split(",");for(let t=0,r=i.length;t<r;t++){const r=i[t];if(this.eqaulsUpperDomain(r,e))return!0;if(s&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(s))return!0}}return!1}static decrypt(t){const e={},s=$t.decrypt(t,"dkdl"+this._getLDKey($t.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],n=i[1];n&&n.length>0&&(e[r]=n)}return e}}class Ft extends N{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this.loaded=!1,this._windowResizeHandler=t=>{this._windowResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},function(){const t=location.hostname;let e;const s="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=zt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==Bt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(Bt.license!=Ot.Developer&&!zt.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(Ot).includes(n))throw new Error(s);if(Bt.code=i.code,Bt.license=i.lic,n==Ot.Evaluation||n==Ot.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error("라이선스가 만료되었습니다.")}}catch(t){throw new Error(s)}}(),!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||Ft.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Rt.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}setData(t,e,s){W(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}clearDefs(){Rt.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(It.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(It.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new Wt(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new Yt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}_setTesting(){this._testing=!0,It.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler,!0)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(e,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof HTMLDivElement||it(A.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");l(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=i,this._container.appendChild(n);const a=this._svg=r.createElementNS(t,"svg");a.classList.add("rct-svg"),a.style.setProperty("overflow","visible","important"),a.setAttribute("width","100%"),a.setAttribute("height","100%");const o=r.createElement("desc");o.textContent="Created by RealChart v1.1.8",a.appendChild(o);const h=this._defs=r.createElementNS(t,"defs");this._initDefs(r,h),a.appendChild(h),n.appendChild(a),this._root=new Gt(this),a.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),l(this._htmlRoot.style,{position:"absolute"})}_initDefs(e,s){let i=e.createElementNS(t,"filter");i.setAttribute("id",Ft.SHADOW_FILTER);const r=e.createElementNS(t,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=e.createElementNS(t,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const a=e.createElementNS(t,"feFlood");a.setAttribute("flood-color","#000"),i.appendChild(a);const o=e.createElementNS(t,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),i.appendChild(o);const h=e.createElementNS(t,"feMerge"),l=e.createElementNS(t,"feMergeNode"),_=e.createElementNS(t,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(!this.orphaned)if(+new Date<=this._toAnimation)this.$_requestRender();else{k.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;l(this._htmlRoot.style,{left:j(e.left-t.left),top:j(e.top-t.top)}),this._doRenderBackground(this._container.firstElementChild,this._root,s,i);const r=this._padding=Rt.getPadding(this._root.dom);this._doRender({x:r.left,y:r.top,width:s-r.left-r.right,height:i-r.top-r.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),k.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_windowResized(){this.invalidateLayout()}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}Ft.CLASS_NAME="rct-control",Ft.SHADOW_FILTER="rr-chart-shadow-filter",Ft._animatable=!0;class It extends N{constructor(e,s,i=T){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return W(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}isDomAnimating(){return!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t){return this._scaleX===t&&this._scaleY===t||(this._scaleX=this._scaleY=t,this._updateTransform()),this}trans(t,e){return t=k.isValidNum(t)?t:this._tx,e=k.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=k.isValidNum(t)?t:this._tx,e=k.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&k.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&k.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(t),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==T&&(this._dom.setAttribute("style",this._saveStyle),delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(tt(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(tt(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(tt(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let s in t)e.setProperty(tt(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i?this._dom.setAttribute(i,r):s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),t&&this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?t&&this._dom.classList.add(t):this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this._dom.classList.add(t):s(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,b(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}hasData(t){return null!=this.dom.getAttribute("data-"+t)}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==s||s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==e||e.addEventListener("finish",(()=>{this.setVis(!1)}))}else this.setVis(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(It.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return It.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(k.isValidNum(e)||k.isValidNum(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),k.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+k.pick(this._originX,t.getAttribute("x"),0)+" "+k.pick(this._originY,t.getAttribute("y")||0)+")");const r=k.getNumber(this._scaleX,1),n=k.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}It.DEBUGGING=!1,It.TESTING=!1,It.ASSET_KEY="_asset_",It.TEMP_KEY="_temp_";class Ht extends It{constructor(t,e){super(t,e,"g")}}class Gt extends It{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class jt extends It{constructor(t){super(t,T,"clipPath");const e=this._id=k.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Wt extends jt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,a=0){super(t);const o=this._rect=new It(t,null,"rect");o.setAttr("fill","none"),n>0&&o.setAttr("rx",String(n)),a>0&&o.setAttr("ry",String(a)),isNaN(e)||o.setBounds(e,s,i,r),this.add(o)}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class Xt extends It{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Yt extends jt{constructor(t){super(t),this.add(this._circle=new It(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class Ut{constructor(){this.dragging=!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this.dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this.dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._doCanceled()}finally{this.end(-1,-1)}}drop(t,e,s){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,s)?this._doCompleted(t,e,s):this._doCanceled()}finally{this.end(e,s)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,s){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_doCompleted(t,e,s){}_doEnded(t,e){}}var Zt,qt,Kt;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Zt||(Zt={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(qt||(qt={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Kt||(Kt={}));class Qt extends It{constructor(t,e=void 0){super(t,e,"text"),this._layout=qt.TOP,this._overflow=Kt.WRAP,this._dirty=!0,this._text="",this.anchor=Zt.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.75*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case qt.MIDDLE:i=Math.floor(s/2);break;case qt.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=f(0,t),(e=m(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,a=s.length;do{r=Math.ceil((n+a)/2);i.getSubStringLength(0,r)>t?a=r-1:n=r}while(n<a);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Tt.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}applyStyles(t){super.setStyles(t)}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}const Jt="$_TH",te="$_TW";class ee{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?gt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Mt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=s[r+2]||"");i=i.replace(s[r],n)}return i}prepareSpan(t,e,s){const i=this.getText(e,s);return t.textContent=i,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let s=t.indexOf("${",e);if(s<0&&(s=t.indexOf("%{",e)),s<0)break;const i=t.indexOf("}",s+2);if(i<0)break;const r=t.substring(s,i+1),n=r.substring(2,r.length-1),a=n.indexOf(";");if(a>0){const t=n.indexOf(";",a+1);t>=a?this._literals.push(r,n.substring(0,a),n.substring(a+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,a),n.substring(a+1),T),0===this._literals[2].length&&(this._literals[2]=T)}else this._literals.push(r,n,T,T);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class se extends ee{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,n=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,n),t}_doPrepare(t,e,s,i){t.textContent=e.substring(s,i);const r=e.indexOf("style=");if(r>0&&r<s){const i=e[r+6],n=e.indexOf(i,r+7);n>0&&n<s&&t.setAttribute("style",e.substring(r+7,n))}}}class ie extends se{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,s,i){e.substring(2,s-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const s=t.substring(0,e),i=t.substring(e+1,t.length),r=i.substring(1,i.length-1);switch(s){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-link")}}const re={t:class extends se{tag(){return"</t>"}},b:class extends se{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends se{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:ie};class ne{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new ee).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in re){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",a=t.indexOf(n,e+1);if(a>=0){const e=t.substring(i,a+n.length);r=(new re[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const ae=/<br.*?>|\r\n|\n/;class oe{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,s,i,r,n){const a=e.doc,o=x(this.lineHeight,1),h=this._lines,l=h.length,_=[],c=[];e.clearDom(),r=r||e;const d=e.getStyle("writing-mode"),u=d===nt||d===at;for(let s=0;s<l;s++){const i=h[s];let l=0,d=0,p=null;for(let s of i.words){const i=s.prepareSpan(e.appendElement(a,"tspan"),r,n),o=i.getBBox();if(i[te]=o.width,i[Jt]=o.height,u?(l=f(l,i[te]),d+=i[Jt]):(l+=i[te],d=f(d,i[Jt])),p||(p=i),s instanceof ie){const r=a.createElementNS(t,"a");r.setAttribute("href",s.url),r.setAttribute("target",s.target),r.appendChild(i),e.appendDom(r)}}c.push(p),i[Jt]=d*o,i[te]=l*o,_.push(0==s?i[te]/2:i[te])}if(l>0){let t=h[0];for(let s=1;s<c.length;s++)if(c[s]){let i=0,r=0;if(u?null!=c[s-1]&&(i=Math.floor(t[te]-e.getAscent(t[te]))+e.getAscent(h[s][te])):r=Math.floor(t[Jt]-e.getAscent(t[Jt]))+e.getAscent(h[s][Jt]),c[s]==c.find((t=>null!=t))&&null==c[0]){const r=e.insertElement(a,"tspan",c[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[te]=n.width,r[Jt]=t[Jt]=n.height,c[0]=r}switch(d){case nt:c[s].setAttribute("dx",String(i)),c[s].setAttribute("y","0");break;case at:c[s].setAttribute("dx",String(-i)),c[s].setAttribute("y","0");break;default:c[s].setAttribute("x","0"),c[s].setAttribute("dy",String(r))}t=h[s]}if(u){const t=e.parent.dom.classList.contains("rct-annotation"),s=e.getBBox().width,[i]=c,r=i[te];if(t)i.setAttribute("dx",String(d===at?s-r/2:r/2));else switch(d){case nt:i.setAttribute("x",String((s-r)/-2));break;case at:i.setAttribute("x",String((s-r)/2))}}else e.layoutText(h[0][Jt])}}layout(t,e,s,i,r){const n=t.getBBox();let a=0,o=0;const h=t.getStyle("writing-mode");if(h===nt||h===at)switch(a=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=Zt.MIDDLE,o=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=Zt.END,o=n.height-r.bottom;break;default:t.anchor=Zt.START,o=r.top}else switch(o=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=Zt.MIDDLE,a=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=Zt.END,a=n.width-r.right;break;default:t.anchor=Zt.START,a=r.left}t.trans(a,o)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(ae);for(let t of s)e.push((new ne).parse(t))}}}class he{constructor(t){this.source=t}hasDef(){return!0}}class le extends he{_setStops(e,s){s.setAttribute("id",this.source.id);const r=this.source.color,n=null==this.source.opacity?1:this.source.opacity,a=i(r)?[...r]:[r,"white"],o=i(n)?[...n]:Array(a.length).fill(n);1===a.length&&a.push("white"),a.forEach(((i,r)=>{!function(e,s,i,r,n){const a=e.createElementNS(t,"stop");a.setAttribute("offset",String(i)),a.setAttribute("stop-color",r),a.setAttribute("stop-opacity",String(n)),s.appendChild(a)}(e,s,r/(a.length-1),i,null==o[r]?1:o[r])}))}}class _e extends le{getEelement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:a,y2:o}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,i),s.dir){case"up":a=1;break;case"right":n=1;break;case"left":r=1;break;default:o=1}return i.setAttribute("x1",r),i.setAttribute("y1",a),i.setAttribute("x2",n),i.setAttribute("y2",o),i}}_e.TYPE="lineargradient";class ce extends le{getEelement(e,s){const i=e.createElementNS(t,"radialGradient");return W(s.cx)||i.setAttribute("cx",s.cx),W(s.cy)||i.setAttribute("cy",s.cy),W(s.r)||i.setAttribute("r",s.r),this._setStops(e,i),i}}ce.TYPE="radialgradient";class de extends he{getEelement(e,i){const r=e.createElementNS(t,"pattern"),a=e.createElementNS(t,"path");let o,h,_,c,d=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),a.classList.add("rct-pattern"),+i.pattern>=0){const t=de.STOCK[+i.pattern%de.STOCK.length];o=t.path,h=t.style,d=!t.fill,_=t.width||20,c=t.height||20}else n(i.pattern)&&(o=i.pattern,_=i.width||i.height||20,c=i.height||i.width||20);r.setAttribute("width",String(_)),r.setAttribute("height",String(c)),a.setAttribute("d",o),h&&l(a.style,h),i.style&&l(a.style,i.style),d&&(a.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const s=e.createElementNS(t,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(_)),s.setAttribute("height",String(c))}return r.append(a),r}}de.TYPE="pattern",de.STOCK=[{path:"M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M0 0 L0 3 L5.2 6 L10.4 3 L10.4 0 M5.2 6 L5.2 12 L0 15 L0 18 M5.2 12 L10.4 15 L10.4 18",width:10.4,height:18,style:{strokeWidth:"0.3px"}},{path:"M0 0h5v5H0zM5 5h5v5H5z",fill:!0,width:10,height:10},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!0,width:10,height:10},{path:"M0 2.8 L5 0 L10 2.8 L10 14 L5 16.8 L0 14 L0 2.8 M5 0 L5 5.6 L0 8.4 L5 11.2 L5 16.8 M5 5.6 L10 8.4 L5 11.2",style:{strokeWidth:"0.3px"},width:10,height:16.8},{path:"m5 .037 4.957 4.957L5 9.951.043 4.994z",fill:!1,width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M 0 0 L 12 12 L 24 0 M 4 0 L 12 8 L 20 0 M 8 0 L 12 4 L 16 0 M 0 4 L 8 12 L 0 20 M 0 8 L 4 12 L 0 16 M 0 24 L 12 12 L 24 24 M 4 24 L 12 16 L 20 24 M 8 24 L 12 20 L 16 24 M 24 20 L 16 12 L 24 4 M 24 16 L 20 12 L 24 8",width:24,height:24,fill:!1,style:{strokeWidth:"0.4px"}},{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",style:{strokeWidth:"0.3px"},width:5,height:5},{path:"M-2.5 1.25l5 2.5L7.5 1.25l5 2.5 M-2.5 6.25l5 2.5 5-2.5 5 2.5 M-2.5 11.25l5 2.5 5-2.5 5 2.5 M-2.5 16.25l5 2.5 5-2.5 5 2.5",width:10,height:10,style:{strokeWidth:"0.3px"}},{path:"M25 1.95v.26c-.79 0-1.43.64-1.43 1.43 0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54h-4.56v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.69 1.69 0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4l-.31-.31a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8 0 .79.64 1.43 1.43 1.43v.26c-.93 0-1.69-.76-1.69-1.69.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39h-4.56v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33-.79 0-1.43.64-1.43 1.43h-.26c0-.93.76-1.69 1.69-1.69.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63v-4.56h-4.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8a1.43 1.43 0 1 0-2.86 0c0 .25.15.62.33.8l.31.31c.25.27.31.65.16.98l-.06.11c-.18.32-.5.52-.87.54H6.38v4.56c.02.26.17.5.39.63l.11.06c.21.1.52.05.68-.11l.31-.31c.27-.24.61-.39.98-.4.93 0 1.69.76 1.7 1.69h-.26c0-.79-.64-1.43-1.43-1.43-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87v-4.56H1.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.7v-.26c.79 0 1.43-.64 1.43-1.43 0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56v-4.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.93 0-1.69-.76-1.69-1.69s.76-1.69 1.69-1.69c.32 0 .75.18.98.4l.31.31c.19.17.45.21.68.11l.11-.06c.23-.13.38-.37.39-.63V6.38H1.56c-.36-.02-.69-.22-.87-.54l-.06-.11a.886.886 0 0 1 .16-.98l.31-.31c.2-.22.31-.5.33-.8 0-.79-.64-1.43-1.43-1.43v-.26c.93 0 1.69.76 1.69 1.69 0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56V1.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33.79 0 1.43-.64 1.43-1.43h.26c0 .93-.76 1.69-1.69 1.69-.36-.02-.71-.16-.98-.4L7.57.98a.63.63 0 0 0-.68-.11l-.11.06c-.23.13-.38.37-.39.63v4.56h4.56c.36.02.69.22.87.54l.06.11c.15.33.09.72-.16.98l-.31.31c-.2.22-.31.5-.33.8a1.43 1.43 0 1 0 2.86 0c0-.25-.15-.62-.33-.8l-.31-.31a.888.888 0 0 1-.16-.98l.06-.11c.18-.32.5-.52.87-.54h4.56V1.56a.812.812 0 0 0-.39-.63l-.11-.06a.647.647 0 0 0-.68.11l-.31.31c-.27.25-.62.39-.98.4-.95 0-1.71-.76-1.71-1.69h.26c0 .79.64 1.43 1.43 1.43.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69ZM10.94 18.62c.26-.02.5-.17.63-.39l.06-.11c.1-.21.05-.52-.11-.68l-.31-.31c-.25-.27-.39-.62-.4-.98 0-.93.76-1.69 1.69-1.69s1.69.76 1.69 1.69c0 .32-.18.75-.4.98l-.31.31a.63.63 0 0 0-.11.68l.06.11c.13.23.37.38.63.39h4.56v-4.56c.02-.36.22-.69.54-.87l.11-.06c.33-.15.72-.09.98.16l.31.31c.22.2.5.31.8.33a1.43 1.43 0 1 0 0-2.86c-.25 0-.62.15-.8.33l-.31.31c-.27.25-.65.31-.98.16l-.11-.06c-.32-.18-.52-.5-.54-.87V6.38h-4.56c-.26.02-.5.17-.63.39l-.06.11c-.1.21-.05.52.11.68l.31.31c.24.27.39.61.4.98 0 .93-.76 1.69-1.69 1.69s-1.69-.76-1.69-1.69c.02-.36.16-.71.4-.98l.31-.31a.63.63 0 0 0 .11-.68l-.06-.11a.764.764 0 0 0-.63-.39H6.38v4.56c-.02.36-.22.69-.54.87l-.11.06c-.33.15-.72.09-.98-.16l-.31-.31c-.22-.2-.5-.31-.8-.33a1.43 1.43 0 1 0 0 2.86c.25 0 .62-.15.8-.33l.31-.31c.27-.25.65-.31.98-.16l.11.06c.32.18.52.5.54.87v4.56h4.56Z",width:25,height:25,fill:!1,style:{strokeWidth:"0.3px"}},{path:"M 0 8 L 8 0 L 12 4 L 4 12 Z M -2 2 L 2 6 M 2 -2 L 6 2 M 6 10 L 10 14 M 10 6 L 14 10",width:12,height:12,style:{strokeWidth:"0.5px"}},{path:"M0 13.66 6.34 10 10 16.34 3.66 20zM0 6.34 3.66 0 10 3.66 6.34 10zM10 16.34 13.66 10 20 13.66 16.34 20zM10 3.66 16.34 0 20 6.34 13.66 10zM0 6.34v7.32M20 6.36v7.3M6.34 10h7.32",width:20,height:20,style:{strokeWidth:"0.3px"},fill:!1}];class ue extends he{prepare(){const t=this.source;return this._colors=i(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&k.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getEelement(t,e){this._colors=i(e.colors)?e.colors:[]}}ue.TYPE="colors";class pe extends he{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||pe.SIZE,height:e.height||e.width||pe.SIZE})}}pe.TYPE="images",pe.SIZE=20;class ge{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(t))t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}));else if(s(t)){const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(It.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}$_loadItem(t){if(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=de.TYPE:i(t.colors)?e=ue.TYPE:i(t.images)&&(e=pe.TYPE)),e)switch(e.toLowerCase()){case _e.TYPE:return new _e(t);case ce.TYPE:return new ce(t);case de.TYPE:return new de(t);case ue.TYPE:return new ue(t);case pe.TYPE:return new pe(t)}}}}let me=0;const fe=function(t,e){const s={};for(const e in t)s[e]=t[e];for(const t in e)s[t]=e[t];return s},we=function(t,e){const r=s(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];i(n)?r[t]=n.slice(0):n instanceof Date?r[t]=new Date(n):s(n)?r[t]=we(r[t],n):r[t]=n}return r};class xe extends N{constructor(t){super(),this.chart=t,me++}init(){const t=this._op=we({},this.constructor.defaults);this._doInit(t),this._doApply(t);const e={};return this._doInitChildren(e),this._children=Object.keys(e),this._children.length>0&&l(t,e),t}_doInit(t){}_doInitChildren(t){}_initObject(){return this.init(),this}get options(){return this._op}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this._op.visible}_load(t){const e=this._op;if(this._config=t,void 0!==t&&!this._doSetSimple(t)){if(null!==t&&null!=t.template){const e=this.chart&&this.chart.assignTemplates;e&&(t=e(t))}this._doLoad(e,t)}return this._doApply(e),e}loadOptions(t){return this.clearOptions(),this._load(t),this}saveOptions(t=!0){const e={};return this._doSave(e,this.constructor.defaults,t),e}updateOptions(t,e=!0){const s=function(t,e){const i=t._op;let r={};void 0===e||t._doSetSimple(e)||(t._children.forEach((t=>{e.hasOwnProperty(t)&&(r[t]=e[t],delete e[t])})),we(i,e)),t.$_applyOptions(i);for(const e in r)s(t[e],r[e])};return s(this,void 0!==t?Object.assign({},t):void 0),e&&this._changed(),this}updateOption(t,e,s=!0){if(this[t]instanceof xe)this[t]._doSetSimple(e);else{const i=this._op;e!==i[t]&&(i[t]=e,this.$_applyOptions(i),s&&this._changed())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s.hasOwnProperty(t)&&(this[t]instanceof xe?this[t]._doSetSimple(!h(i)||!i):(s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,s=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof xe)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;e.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),s&&this._changed()}return this}clearOptions(t=!0){const e=function(t){if(t){const s=t._op=we({},t.constructor.defaults);return t.$_applyOptions(s),t._children.forEach((i=>{s[i]=e(t[i])})),s}};return e(this),t&&this._changed(),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof xe?t[r]=this[r]._load(n):i(n)?t[r]=n.slice(0):n instanceof Date?t[r]=new Date(n):s(n)?t[r]=l({},n):t[r]=n)}}_doSave(t,e,s){const r=this._op;for(const n in r)if(r.hasOwnProperty(n))if(s&&this[n]instanceof xe)t[n]=this[n].saveOptions(!0);else{const s=r[n];i(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=Z(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doUpdate(t){for(const e in t)if(t.hasOwnProperty(e)){let r=t[e];this._doLoadProp(e,r)||(this[e]instanceof xe?this[e].updateOptions(r):i(r)?this[e]=r.slice(0):r instanceof Date?this[e]=new Date(r):s(r)?this[e]=l({},r):this[e]=r)}}_doPrepareRender(t){}}xe.REFRESHED="refreshed",xe.defaults={visible:!0};class ye{constructor(t){this._items=[],this.chart=t}get count(){return this._items.length}get first(){return this._items[0]}items(){return this._items.slice(0)}_internalItems(){return this._items}updateOptions(t,e){}}class be extends xe{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=x(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?gt.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new oe),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,s){if(k.isValidNum(t)){const i=this._numSymbols&&e&&k.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this.$_getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}be.defaults=fe(xe.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class ve extends be{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof pe&&(this._images=e)}this._root=this._images?"":this._op.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2);return s instanceof pe?s.getImage(i):i}return this._root+t}}}ve.defaults=fe(be.defaults,{iconPosition:"default",iconGap:2});class Ve extends xe{}const Se={};class ke extends xe{static register(...t){t.forEach((t=>{Se[t.type]=t}))}constructor(t,e){super(t),this.inBody=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this.chart.isInverted(),i=this._op;let r,n;if(this.inBody){const a=+i.x1,o=+i.x2,h=+i.y1,l=+i.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(a)){const i=this.chart.xAxis;s?this._y=e-i.getPos(e,a):this._x=i.getPos(t,a),isNaN(o)||(s?n=this._h=e-i.getPos(e,o)-this._y:r=this._w=i.getPos(t,o)-this._x)}if(!isNaN(h)){const i=this.chart.yAxis;s?this._x=i.getPos(t,h):this._y=e-i.getPos(e,h),isNaN(l)||(s?r=this._w=i.getPos(t,l)-this._x:n=this._h=e-i.getPos(e,l)-this._y)}}return isNaN(r)?r=K(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=K(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,s,i,r,n,a){let o,h,l;if(isNaN(h=this._x))switch(o=this.getOffset(n,a),h=e,this._op.align){case"center":h+=(i-n)/2+o.x;break;case"right":h+=i-o.x-n;break;default:this._anchorObj?h+=(i-n)/2+o.x:h+=o.x}else o=o||this.getOffset(n,a),h=this._x+o.x;if(isNaN(l=this._y))switch(o=o||this.getOffset(n,a),l=s,this._op.verticalAlign){case"middle":l+=(r-a)/2-o.y;break;case"bottom":l+=r-o.y-a;break;default:l+=o.y}else o=o||this.getOffset(n,a),l=this._y+o.y;return{x:h,y:l}}refresh(){this._changed(xe.REFRESHED)}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}ke.defaults=fe(xe.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Pe extends ye{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getAnnotation(t){const e=this._map[t];if(e instanceof ke)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],a=this._map={};i(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(r,t,s,e))})):s(t)&&n.push(this.$_loadItem(r,t,0,e)),n.forEach((t=>{t.name&&(a[t.name]=t)})),this.owner.options.annotation=this._items.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender(),t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):T}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const a=t._getAnnotationType(r);if(!a)throw new Error("Invalid annotation type: "+e.type);const o=new a(t,i);return o.init(),o.index=s,o._load(e),o}}class Ce extends xe{}Ce.defaults=fe(xe.defaults,{minWidth:50});class Ae extends xe{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.flag=new Ce(this.axis.chart).init(),this._args={axis:void 0,pos:void 0,flag:void 0,points:void 0}}isBar(){return!this.axis.continuous()&&"line"!==this._op.type}getFlag(t,e){const s=this.axis.axisValueAt(t,e);return s instanceof Date?Mt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):gt.getFormatter(this._op.numberFormat).toStr(s)}moved(t,e,s){this._op.onChange&&(this._args.pos=t,this._args.flag=e,this._args.points=s.slice(0),this._op.onChange(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t){return r(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}Ae.defaults=fe(xe.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Le={};class Ee extends xe{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Ne extends Ee{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Ne.defaults=fe(Ee.defaults,{visible:void 0});class Me extends Ee{getRotation(){return this.axis._isHorz?0:isNaN(this._rotation)?"opposite"===this.axis.options.position?90:270:this._rotation}_isVisible(){return this._op.visible&&!W(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation)}}Me.defaults=fe(Ee.defaults,{align:"middle",offset:0,gap:5});class Te extends Ee{getRows(){const t=this.axis,e=this._op.colors,s=e?e.length:0,i=[];if(this._op.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.axisMin(),to:t.getBaseValue(),color:this._op.belowColor}),s>0){const r=t._ticks;let n=0;r[0].value>t.axisMin()&&(e[n%s]&&i.push({axis:t,from:t.axisMin(),to:r[0].value,color:e[n%s]}),n++);for(let a=1;a<r.length;a++,n++)e[n%s]&&i.push({axis:t,from:r[a-1].value,to:r[a].value,color:e[n%s]});r[r.length-1].value<t.axisMax()&&e[n%s]&&i.push({axis:t,from:r[r.length-1].value,to:t.axisMax(),color:e[n%s]})}return i}_doSetSimple(t){return n(t)?(this._op.colors=[t,null],!0):i(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Re extends Ee{_doInitChildren(t){t.rows=(this._rows=new Te(this.axis)).init()}get rows(){return this._rows}_isVisible(){return this.axis._isPolar?!1!==this._op.visible:null==this._op.visible?!this.axis._isX:this._op.visible}}Re.defaults=fe(Ee.defaults,{visible:void 0});class Oe extends ve{getDefaultIconPos(){return"left"}}Oe.defaults=fe(ve.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Be extends Ee{_doInitChildren(t){t.label=(this._label=new Oe(this.axis.chart)).init()}get label(){return this._label}canConstainedTo(t,e){const s=this._op;if(i(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(i(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}Be.defaults=fe(Ee.defaults,{front:!1,zindex:0});class De extends Be{}class $e extends Be{}class ze extends Ee{canUseNumSymbols(){return!0}_doSetSimple(t){return k.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}}ze.defaults=fe(Ee.defaults,{visible:!1,length:7,gap:3});class Fe extends ve{constructor(t){super(t&&t.chart),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)}}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){var s;const i=this._op,r=t.index;if(i.textCallback){const e=i.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?b(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?b(i.firstText,i.text):r==e-1?b(i.lastText,i.text):i.text}getLabelStyle(t,e){const i=this._op,r=t.index;if(i.styleCallback){const e=i.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(s(e))return e}return 1==e?i.lastStyle||i.firstStyle:0==r?i.firstStyle:r==e-1?i.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Fe.defaults=fe(ve.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Ie extends Ee{getThickness(){return Math.max(0,this._op.thickness)}getMinThumbSize(){return Math.max(0,this._op.minThumbSize)}getGap(){return Math.max(0,this._op.gap)}getGapFar(){return Math.max(0,this._op.gapFar)}}Ie.defaults=fe(Ee.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class He{constructor(t){this.axis=t}total(){return this.max-this.min}length(){return this.end-this.start}isFull(){return this.start===this.min&&this.end===this.max}resize(t,e,s){if((t=isNaN(t)?this.start:f(this.min,m(this.max,t)))>(e=isNaN(e)?this.end:f(t,m(this.max,e)))){const s=t;t=e,e=s}const i=this.max-this.min;if((t!==this.start||e!==this.end)&&e>t&&(isNaN(s)||(e-t)/i>=s)&&i/(e-t)>1)return this.start=t,this.end=e,!0}}class Ge extends Ne{}class je extends xe{static register(...t){t.forEach((t=>{Le[t.type]=t,t.subtype&&(Le[t.subtype]=t)}))}_animating(){return!isNaN(this._prevRate)}constructor(t,e){super(t),this._series=[],this._minPad=0,this._maxPad=0,this._values=[],this._labelArgs={},this._seriesChanged=!1,this.guides=[],this._isX=e}_doInitChildren(t){t.title=(this._title=new Me(this)).init(),t.line=(this._line=new Ne(this)).init(),t.sectorLine=(this._sectorLine=new Ge(this)).init(),t.tick=(this._tick=this._createTickModel()).init(),t.label=(this._label=this._createLabel()).init(),t.grid=(this._grid=this._createGrid()).init(),t.crosshair=(this._crosshair=new Ae(this)).init(),t.scrollBar=(this._scrollBar=new Ie(this)).init()}_type(){return this.constructor.type}get name(){return this._name}get title(){return this._title}get line(){return this._line}get sectorLine(){return this._sectorLine}get tick(){return this._tick}get label(){return this._label}get grid(){return this._grid}get crosshair(){return this._crosshair}get scrollBar(){return this._scrollBar}get xy(){return this._isX?"x":"y"}isEmpty(){return this._isEmpty}_checkEmpty(){if(this._series.length>0)for(const t of this._series)if(!t.isEmpty(!0))return!1;return!0}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return B+D*this._op.startAngle}getTotalAngle(){return D*f(0,m(360,x(this._op.totalAngle,360)))}isArced(){return this._op.totalAngle>0&&this._op.totalAngle<360}getVisibleSeries(){const t=[];return this._series.forEach((e=>{e.visible&&t.push(...e.getVisibleSeries())})),t}unitPad(){return 0}labelsVisible(){return this._label.visible&&this._ticks.length>0}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:t}isBased(){return!1}isBaseVisible(){return this.axisMin()<this.getBaseValue()}disconnect(){this._series=[]}getSeries(){const t=[];return this._series.forEach((e=>{t.push(...e.getVisibleSeries())})),t}collectValues(){this._values=[],this._series.forEach((t=>{t.collectValues(this,t.needAxes()?this._values:null)}))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(this._values)}))}collectReferentsValues(){this._series.forEach((t=>{t.pointValuesPrepared(this)}))}_prepare(){this._isEmpty=this._checkEmpty()}_prepareRender(){var t;const e=this._op.position;this._isHorz=this.chart.isInverted()?!this._isX:this._isX,this._isBetween=this.chart.isSplitted()&&"between"===e&&this._isX,this._isOpposite="opposite"===e,this._runPos=e,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),null===(t=this._label)||void 0===t||t._prepareRender();const s=this._series,i=this._values;if(this._isX&&this._prevSeries){if(!(this._seriesChanged=!k.equalArrays(s,this._prevSeries)))for(const t of s)if(t.seriesChanged()){this._seriesChanged=!0;break}}else this._seriesChanged=!1;if(this._zoom?this._range={min:this._zoom.start,max:this._zoom.end}:this._range=this._doCalculateRange(i),this._isX&&s.length>0)if(this.chart.isSplitted()){const t=[s[0]._row];for(let e=1;e<s.length;e++)t.indexOf(s[e]._row)<0&&t.push(s[e]._row);t.forEach((t=>{let e=0,i=0;s.forEach((s=>{s._row==t&&s.isClusterable()&&(e+=x(s.groupWidth(),1))})),s.forEach((s=>{if(s._row==t&&s.isClusterable()){const t=x(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=x(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=x(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+e}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[f(t,this._min),m(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new He(this),this._buildTicks(this._vlen),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,s=NaN){const i=this._prepareZoom(),r=i.resize(t,e,s);return i.isFull()&&(this._zoom=null),this._zooming=!0,this._changed(),r}isZoomed(){return!!this._zoom}hasBreak(){return!1}isBreak(t){return!1}getTickLabelArgs(t,e){return this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXValue(t){return t}setPrevRate(t){this._prevRate=t}prev(t){return isNaN(this._prevRate)?t:this._op.reversed?t+(this._vlen-t)*(this._prevRate-1):t*this._prevRate}_load(t){return this.chart?super._load(this.chart.loadBase(t,this._isX?"xAxis":"yAxis",this._type())):super._load(t)}_doApply(t){const s=this,r=this.guides,n=function(t){var e;t!==s._guides&&(s._guides=t,e=i(t)?t:[t],r.length=0,e.forEach((t=>{let e;e="range"===t.type?new $e(s):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new De(s):new $e(s),e.init(),e._load(t),r.push(e)})))};super._doApply(t),this._name=t.name||`Axis ${this._index+1}`,e.call(t,"guide")?n(t.guide):e.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&!this._series.includes(t)&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?I(m(...t)||0):NaN,max:t.length>0?I(f(...t)||0):NaN}}}je.defaults=fe(xe.defaults,{row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,marginNear:0,marginFar:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>",animatable:!0,fixedSize:!1});class We extends ye{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;i(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),e.options[this.isX?"xAxis":"yAxis"]=this._items.map((t=>t.options))}contains(t){return this._items.indexOf(t)>=0}get(t){return n(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentsValues(){this._items.forEach((t=>t.collectReferentsValues()))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((e=>e._buildTicks(t)))}connect(t){const e=this._items,s=t.options,i=this.isX?s.xAxis:s.yAxis;let r;return o(i)&&i>=0&&i<e.length?r=e[i]:n(i)&&(r=e.find((t=>t.options.name===i))),r||(r=e[0]),r&&(r._connect(t),this.isX?t.setCol(x(s.col,r.options.col)):t.setRow(x(s.row,r.options.row))),r}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,s){var r;let n=t._getAxisType(e.type);if(!n){let a;if(i(e.categories))a="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){a="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){a=void 0;break}if(t.options.xAxis===s){a=void 0;break}if(W(t.options.xAxis)&&0===s){a=void 0;break}}}}else a=null===(r=t._getSeries().first)||void 0===r?void 0:r.defYAxisType();a&&(n=t._getAxisType(a))}n||(n=t._getAxisType("linear"));const a=new n(t,this.isX);return a.init(),a._load(e),a._index=s,a._isPolar=t.isPolar(),a}}class Xe{constructor(){this._axes=[]}}class Ye{constructor(t,e){this.chart=t,this.isX=e}rows(){return this._matrix.length}cols(){return this._matrix[0].length}get(t,e){return this._matrix[t][e]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((e=>e[t]))}_buildTicks(t){const e=this.isX;this._matrix.forEach(((s,i)=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.isBased()||s._buildTicks(t[e?s.options.col:s.options.row])}))}))})),this._matrix.forEach(((s,i)=>{s.forEach(((s,i)=>{s._axes.forEach((s=>{s.isBased()&&s._buildTicks(t[e?s.options.col:s.options.row])}))}))}))}_calcPoints(t,e){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{const r=s?i.options.col:i.options.row;i._calcPoints(t[r],e)}))}))}))}}class Ue extends Ye{constructor(t){super(t,!0)}_prepare(t,e,s){const i=this._matrix=new Array(e+1);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<s;e++)i[t].push(new Xe)}t.forEach((t=>{const s=t.options.position;let r=t._row;"opposite"===s?(r++,t._runPos=s):r<e-1&&"between"===s?(r++,t._runPos="normal"):t._runPos=s,i[r][t._col]._axes.push(t)}))}}class Ze extends Ye{constructor(t){super(t,!1)}_prepare(t,e,s){const i=this._matrix=new Array(e);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<=s;e++)i[t].push(new Xe)}t.forEach((t=>{const e=t.options.position;let r=t._col;"opposite"===e?(r++,t._runPos=e):t._col<s-1&&"between"===e?(r++,t._runPos="normal"):t._runPos=e,i[t._row][r]._axes.push(t)}))}}class qe extends xe{_doPrepareRender(t){}}const Ke={},Qe={};class Je extends qe{constructor(){super(...arguments),this.index=-1}_type(){return this.constructor.type}get name(){return this._name}getSize(t,e){return{width:K(this._widthDim||this._sizeDim,t,t),height:K(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return K(this._leftDim,t)}getRight(t){return K(this._rightDim,t)}getTop(t){return K(this._topDim,t)}getBottom(t){return K(this._bottomDim,t)}_load(t){return this.chart?super._load(this.chart.loadBase(t,"gauge",this._type())):super._load(t)}_doApply(t){super._doApply(t),this._name=t.name||`Gauge ${this.index+1}`,this._setDims(t,"left","right","top","bottom","width","height","siz")}}Je.defaults=fe(qe.defaults,{size:"100%"});class ts extends xe{constructor(t){super(t.chart)}}class es extends Je{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{Ke[t.type]=t}))}static _loadGauge(t,e,s){let i=t._getGaugeType(e.type);i||(i=t._getGaugeType(s||t.gaugeType));const r=new i(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}es.defaults=fe(Je.defaults,{duration:500});class ss extends Je{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{Qe[t.type]=t,Qe[t.gaugeType]=t}))}get gauges(){return this._gauges.slice(0)}count(){return this._gauges.length}isEmpty(){return this._gauges.length<1}visibles(){return this._visibles.slice(0)}get(t){return this._gauges[t]}getVisible(t){return this._visibles[t]}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}_doApply(t){super._doApply(t),e.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const r=this._gaugesType();i(e)?e.forEach(((e,s)=>this.$_add(es._loadGauge(t,e,r)))):s(e)&&this.$_add(es._loadGauge(t,e,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}ss.defaults=fe(Je.defaults,{minValue:0});class is extends ye{constructor(){super(...arguments),this._map={},this._visibles=[],this._gauges=[]}get firstGauge(){return this._gauges[0]}isEmpty(t){return(t?this._visibles:this._items).length<1}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.options.row||0,r=s.options.col||0;return t===i&&e===r}))}getGauge(t){const e=this._map[t];if(e instanceof es)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,r=this._items=[],n=this._map={};i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof ss)for(let e=0;e<t.count();e++){const s=t.get(e);s.name&&(n[s.name]=s),this._gauges.push(s)}else this._gauges.push(t)})),e.options.gauge=this._gauges.map((t=>t.options))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>t._prepareRender()))}$_loadItem(t,e,s){let r=i(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=s,n}}class rs extends es{updateValue(t){t!==this._op.value&&(this._op.value=t,this._changed())}getLabel(t,e){return this._runValue=e,t.options.text||(t.options.prefix||"")+"${value}"+(t.options.suffix||"")}getParam(t){switch(t){case"value":return this._runValue;case"min":return this._op.minValue;case"max":return this._op.maxValue}}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}}rs.defaults=fe(es.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class ns extends xe{constructor(t){super(t.chart),this.scale=t}}ns.defaults=fe(xe.defaults,{reversed:!1,length:7});class as extends ve{getText(t){return k.isValidNum(t)?this._getText(null,t,w(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class os extends xe{constructor(t){super(t.chart),this.gauge=t}_doInitChildren(t){const e=this.chart;t.line=(this._line=new xe(e)).init(),t.tick=(this._tick=new ns(this)).init(),t.label=(this._label=new as(e)).init()}get line(){return this._line}get tick(){return this._tick}get label(){return this._label}range(){return{min:this._min,max:this._max}}isEmpty(){return this._max<=this._min}buildSteps(t,e,s=NaN){s=x(s,e);const{min:i,max:r}=this._adjustMinMax(m(e,s),f(e,s));return this._steps=this._buildSteps(t,i,r)}buildGroupSteps(t,e){const{min:s,max:i}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,s,i)}getRate(t){return(f(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=x(s.options.minValue,t),e=x(s.options.maxValue,e),this._min=m(t,e),this._max=f(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.options.minValue,i=e.options.maxValue;return isNaN(s)&&(s=m(...t)),isNaN(i)&&(i=f(...t)),this._min=m(s,i),this._max=f(i,s),{min:this._min,max:this._max}}_buildSteps(t,e,s){const i=this._op;let r;return r=Array.isArray(i.steps)?i.steps.slice(0):i.stepCount>0?this._getStepsByCount(i.stepCount,e,s):i.stepInterval>0?this._getStepsByInterval(i.stepInterval,e,s):i.stepPixels>0?this._getStepsByPixels(t,i.stepPixels,e,s):[e,s],this._min=r[0],this._max=r[r.length-1],r}_getStepsByCount(t,e,s){let i=(s-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(i))),n=[];i=this._step=Math.ceil(i/r)*r,n.push(I(e));for(let e=1;e<t;e++)n.push(I(n[e-1]+i));return n}_getStepsByInterval(t,e,s){const i=[];let r;for(i.push(r=e);r<s;)i.push(r+=t);return this._step=t,i}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i){const r=[],n=i-s;if(0===n)return r;let a=n/(Math.floor(t/e)+1-1);const o=Math.pow(10,Math.floor(Math.log10(a))),h=this._getStepMultiples(o);let l,_=0;if(a/=o,h)if(a>h[_]){for(;_<h.length-1;_++)if(a>h[_]&&a<h[_+1]){a=h[++_];break}}else a=h[_];for(a*=o,this._step=a,r.push(I(l=s));;){if(l+=a,l>=i){r.push(I(i));break}r.push(I(l))}return r}}os.defaults=fe(xe.defaults,{position:"default",stepPixels:48,gap:8});class hs extends xe{}hs.defaults=fe(xe.defaults,{visible:!1});class ls extends xe{constructor(t){super(t.chart),this.gauge=t}_doInitChildren(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new hs(e)).init(),t.tickLabel=(this._tickLabel=new xe(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?K(this._thicknessDim,t,0):"inside"===this._op.position?t:ls.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null),this._setDim(t,"thickness")}$_internalRanges(){if(!this._runRanges){const t=this.gauge.calcedMinMax();this._runRanges=rt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}ls.defaults=fe(xe.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class _s extends be{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}_s.defaults=fe(be.defaults,{animatable:!0});class cs extends os{}class ds extends _s{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:K(this._offsetXDim,t,0),y:K(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}ds.defaults=fe(_s.defaults,{offsetX:0,offsetY:0});class us{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ps.DEF_CENTER),this.setCenterY(ps.DEF_CENTER),this.setRadius(ps.DEF_RADIUS),this.setInnerRadius(ps.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Z(b(t,ps.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Z(b(t,ps.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Z(b(t,ps.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Z(b(t,ps.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Z(t,!0))}getCenter(t,e){return{x:K(this._centerXDim,t,t/2),y:K(this._centerYDim,e,e/2)}}getExtents(t){const e=K(this._radiusDim,t,t/2),s=m(e,this._innerDim?K(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?K(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=x(t%360,0),i=f(0,m(360,x(e,360)));this._startRad=B+D*s,this._handRad=D*s,this._sweepRad=D*i}}class ps extends rs{_doInit(t){this._props=new us}_doInitChildren(t){t.label=(this._label=new ds(this.chart)).init()}get label(){return this._label}getProps(){return this._childProps||this._props}getCenter(t,e){return this._group?this._childProps.getCenter(t,e):this._props.getCenter(t,e)}getExtents(t){return this._group?this._childProps.getExtents(t):this._props.getExtents(t)}labelVisible(){return this._label.visible}_doApply(t){super._doApply(t);const e=this._props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}setGroup(t,e){super.setGroup(t,e),t&&!this._childProps&&(this._childProps=new us)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.options.startAngle,e.options.sweepAngle):this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}ps.DEF_CENTER="50%",ps.DEF_RADIUS="40%",ps.DEF_INNER="80%",ps.defaults=fe(rs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class gs extends ss{_doInit(t){this.props=new us}_doInitChildren(t){t.label=(this._label=new ds(this.chart)).init()}get label(){return this._label}setChildExtents(t){const e=this._visibles.length;if(e>0){const s=+this._op.itemGap||0;let i=t.radius;const r=(i-t.inner-s*(e-1))/e;this._visibles.forEach(((t,e)=>{const n=t._childProps;n.setRadius(i),n.setInnerRadius(i-r),i-=r+s}))}}_doApply(t){super._doApply(t);const e=this.props;e.setCenterX(t.centerX),e.setCenterY(t.centerY),e.setRadius(t.radius),e.setInnerRadius(t.innerRadius),e.setValueRadius(t.valueRadius)}}gs.defaults=fe(ss.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let ms=class extends xe{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};ms.defaults=fe(xe.defaults,{visible:void 0});class fs extends be{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||fs.DEF_TEXT}}fs.DEF_TEXT="표시할 데이터가 없습니다.",fs.defaults=fe(xe.defaults,{visible:void 0});class ws extends xe{constructor(t){super(t),this._annotations=new Pe(this)}_doInitChildren(t){t.image=(this._image=new Ve(null)).init(),t.emptyView=(this._emptyView=new fs(this.chart)).init(),t.zoomButton=(this._zoomButton=new ms(this)).init()}anchorByName(t){const e=this.chart._getGauges().get(t);return e instanceof Je&&this.contains(e)?e:this._annotations.get(t)}get image(){return this._image}get emptyView(){return this._emptyView}get zoomButton(){return this._zoomButton}base(){return this}canZoom(){return!this.chart.isEmpty(!0)&&("x"===this._op.zoomType||"y"===this._op.zoomType||"both"===this._op.zoomType)}isEmpty(){return this.chart.isEmpty(!0)}getRadius(t,e){return K(this._radiusDim,m(t,e))}setPolar(t,e){return this._cx=K(this._centerXDim,t),this._cy=K(this._centerYDim,e),this._rd=K(this._radiusDim,m(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd}:void 0}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}contains(t){return!0}_doApply(t){const s=this,i=function(t){t!==s._anns&&(s._anns=t,s._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),e.call(t,"annotation")?i(t.annotation):e.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}ws.defaults=fe(xe.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class xs extends xe{}xs.defaults=fe(xe.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class ys extends xe{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class bs extends qe{constructor(){super(...arguments),this._items=[]}items(){return this._items.slice(0)}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return K(this._maxWidthDim,t,t)}getMaxHeight(t){return K(this._maxHeightDim,t,t)}getMarkerSize(){return x(this._op.markerSize,10)}_isVisible(){return!0===this._op.visible&&this._items.length>0||!1!==this._op.visible&&this._items.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t),this._location=b(this._op.location,"bottom"),this._items=this.chart._getLegendSources().map((t=>new ys(this,t))),this._op.reversed&&(this._items=this._items.reverse())}}bs.defaults=fe(qe.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"body",gap:6,itemGap:8,markerVisible:!0,markerSize:10,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0,pointHovering:!0});const vs={inOutSine:t=>-(d(R*t)-1)/2},Vs=function(t,e,s,i,r,n){const a=U(e,null!=s?s:"initial"),o=U(e,i),h=t.animate([a,o],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Ss{constructor(){this.delay=0,this.duration=Ss.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=m(1,f(0,I(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,s=null){this._started&&this._stop(),this.duration=x(t,Ss.DURATION),this.delay=e||0,this._easing=vs[s],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}Ss.DURATION=700,Ss.SHORT_DURATION=300;const ks=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Ps=.001,Cs=Math.PI;class As{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(...t){let e=0;const s=["M",t[e],t[e+1]];for(;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s.push("Z"),s}static box(t,e,s,i){return["M",t,e,"L",s,e,"L",s,i,"L",t,i,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,s,i){return["M",t,e,"h",s,"v",i,"h",-s,"Z"]}static bar(t,e,s,i,r,n){const a=i>0,o=a?0:1;return r>0?n>0?(r=m(w(i)/2,s/2,r),n=m(w(i)/2,s/2,n),["M",t,e+(a?n:-n),"v",i+(a?-n-r:n+r),"a",r,r,0,0,o,r,a?r:-r,"h",s-2*r,"a",r,r,0,0,o,r,a?-r:r,"v",-i+(a?r+n:-r-n),"a",n,n,0,0,o,-n,a?-n:n,"h",2*n-s,"a",n,n,0,0,o,-n,a?n:-n,"Z"]):(r=m(w(i)/2,s/2,r),["M",t,e,"v",i+(a?-r:r),"a",r,r,0,0,o,r,a?r:-r,"h",s-2*r,"a",r,r,0,0,o,r,a?-r:r,"v",-i-r,"Z"]):n>0?(n=m(w(i)/2,s/2,n),["M",t,e+(a?n:-n),"v",i+(a?-n:+n),"h",s,"v",-i+(a?n:-n),"a",n,n,0,0,o,-n,a?-n:n,"h",2*n-s,"a",n,n,0,0,o,-n,a?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=m(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static arc(t,e,s,i,r,n,a,o=!1){const h=F(w(n-r)),l=2*Cs-h<.01,_=h-Cs<.01?0:1,c=a?1:0,p=d(r),g=u(r),m=d(n-=l?c?Ps:-.001:0),f=u(n),x=[];return x.push("M",t+s*p,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*f),l&&x.push("M",t,e),o&&x.push("Z"),x}static sector(t,e,s,i,r,n,a,o){const h=F(w(a-n)),l=2*Cs-h<Ps;let _=h-Cs<Ps?0:1;const c=o?1:0,p=d(n),g=u(n),m=d(a-=l?c?Ps:-.001:0),f=u(a),x=s*r,y=i*r,b=[];return b.push("M",t+s*p,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*f),l?b.push("M",t+x*m,e+y*f):b.push("L",t+x*m,e+y*f),isNaN(x)||b.push("A",x,y,0,_,1-c,t+x*p,e+y*g),b.push("Z"),b}static diamond(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i/2,"L",t+s/2,e+i,"L",t,e+i/2,"Z"]}static triangle(t,e,s,i){return["M",t+s/2,e,"L",t+s,e+i,"L",t,e+i,"Z"]}static itriangle(t,e,s,i){return["M",t,e,"L",t+s,e,"L",t+s/2,e+i,"Z"]}static star(t,e,s,i){let r=-Math.PI/2;const n=t+s/2,a=e+i/2+(i/2-i/2*u(r+6*Math.PI/5))/2,o=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,p=c/2,g=[];g.push("M",n+o*d(r),a+h*u(r));for(let t=0;t<5;t++)g.push("L",n+o*d(r),a+h*u(r),"L",n+l*d(r+p),a+_*u(r+p)),r+=c;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=As[e](0,0,2*s,2*i);break;default:r=As.circle(s,i,m(s,i))}t.setPath(r)}}class Ls extends It{static create(t,e,s,i,r,n,a=0){return new Ls(t,e,{x:s,y:i,width:r,height:n,r:a})}constructor(t,e=T,s=T){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&Object.assign({},this._rect)}set rect(t){if(t!==this._rect&&(this._rect=t&&Object.assign({},t),t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class Es extends Xt{constructor(t,e=T){super(t,e)}setBox(t,e,s,i){return this.setPath(As.box(t,e,s,i)),this}}let Ns=0;class Ms{constructor(t){this.pid=Ns++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}copy(){return Object.assign({},this)}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:i(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?(this._readObject(t,e),(i(e.drillDown)||s(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):i(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=T}getTooltip(t){var e;return t in this?this[t]:null===(e=this.source)||void 0===e?void 0:e[t]}initValues(){}initPrev(t,e){e.yValue=t.axisMin()}applyValueRate(t,e){}_assignTo(t){return l(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=+t.options.colorField;e.length>1?(this.x=e[x(t.options.xField,0)],this.y=e[x(t.options.yField,1)]):this.y=e[0],isNaN(s)||(this.color=e[s])}_readObject(t,e){var s,i,r,n;this.x=(s=t._xFielder(e),i=e.x,r=e.name,n=e.label,void 0!==s?s:void 0!==i?i:null!=r?r:n),this.y=v(t._yFielder(e),e.y,e.value),this.color=b(t._colorFielder(e),e.color),this.yLabel=e.yLabel}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class Ts{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}isEmpty(){return this._points.length<1}get(t){return this._points[t]}pointAt(t,e){function i(t,e,i){return s(t)?t.pid===e:t===i}return this._points.find((s=>i(t,s.pid,s.xValue)&&(void 0===e||i(e,s.pid,s.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){i(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return this._points.splice(e,1),!0}getProps(t){return this._points.map((e=>e.getProp(t)))}getCategories(t){return this._points.map((e=>e[t]))}forEach(t){for(let e=0,s=this._points.length;e<s&&!0!==t(this._points[e],e);e++);}getPoints(t,e){const s=t._zoom;if(s){const e=this._points,i=e.length;let r=s.start,n=s.end;if(t.continuous()){let t,s,a=0;for(s=Number.MIN_VALUE;a<i-1;a++){if(t=e[a],r>=s&&r<t.xValue+(e[a+1].xValue-t.xValue)/2){r=a;break}s=t.xValue}for(r!==a&&(r=i-1),s=Number.MAX_VALUE,a=i-1;a>0;a--){if(t=e[a],n<s&&n>t.xValue-(t.xValue-e[a-1].xValue)/2){n=a;break}s=t.xValue}n!==a&&(n=0),r=f(r-1,0),n=m(n+1,i-1)}else r=f(0,Math.floor(r)),n=m(Math.ceil(n),i-1);return this._points.slice(r,n+1)}return this._points}}class Rs extends Ms{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return l(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=e.length>2?1:0;s>0&&(this.x=e[x(t.options.xField,0)]),this.y=e[x(t.options.yField,0+s)],this.z=e[x(t.options.zField,1+s)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=b(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.yValue=e.zValue=this.yValue}applyValueRate(t,e){this.zValue=V(t.zValue,this.zValue,e)}}class Os extends Ms{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return l(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[x(s.lowField,0+i)],this.y=e[y(s.highField,s.yField,1+i)],i>0&&(this.x=e[x(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=b(e[t.options.lowField],e.low),this.y=v(e[t.options.highField],e.high,this.y),this.lowLabel=e.lowLabel)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class Bs extends ze{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}Bs.defaults=fe(ze.defaults,{step:1});class Ds extends Fe{getTick(t,e){return null!=e?this._getText(e,e,!1,!1):""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}class $s extends Re{getPoints(t){const e=t._pts,s=t._ticks.length,i=[];if(s>0){const r=Math.max(1,t.tick.options.step||1);if(r>1)for(let t=0,n=1,a=e.length;t<=s&&n<a;t++,n+=r)i.push(e[n]);else for(let t=0;t<=s;t++)i.push(e[t+1])}return i}}class zs extends je{constructor(){super(...arguments),this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}getCategories(){return this._cats}xValueAt(t){for(let e=2;e<this._pts.length-1;e++)if(t>=this._pts[e-1]&&t<this._pts[e])return this._catMin+e-2;return-1}getWdith(t,e){return 0}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_createGrid(){return new $s(this)}_createTickModel(){return new Bs(this)}_createLabel(){return new Ds(this)}collectValues(){this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=k.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){let t=super.getStartAngle(),e=+this._op.startOffset;return e>0&&(t-=m(e,1)*this._categories[0].w*O/this._len),t}_doPrepareRender(){const t=this._op;this._cats=[],this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=y(t.minPadding,t.padding,0),this._maxPad=y(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,x(t.categoryPadding,0))))}_doBuildTicks(t,e,s){const i=this._label;let r=this._cats=this._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const a=this._tick.options.step||1,o=[],h=t,l=e;t=this._catMin=Math.floor(t+.5),e=this._catMax=Math.ceil(e-.5);let _=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(_,this._tick.options.step||1));for(let e=-1;e>=t;e--)r.unshift(String(e)),n.unshift(1);_=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0),_+=this._catLen-r.length,n.length=r.length=this._catLen||0;const c=this._pts=[];if(_>0){let s=this._minPad;c.push(0);for(let i=t;i<=e;i++)c.push(s/_),s+=n[i-t]||1;c.push(s/_),c.push((s+this._maxPad)/_)}for(let e=1;e<c.length-2;e+=a){const s=t+e-1,r=this._categories[t+e-1];o.push({index:e-1,pos:NaN,value:s,label:i.getTick(e-1,r?r.t:s)})}return this._setMinMax(h,l),o}_calcPoints(t,e){super._calcPoints(t,e);const s=this._pts;if(e>0)for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(this._isPolar){if(e>0){const e=this._op.totalAngle*D;this._pts=s.map((s=>s/t*e))}}else{let t;t="edge"===this._tick.getPosition()?s.slice(1,s.length-1):this._ticks.map((t=>t.pos)),this._markPoints=t}}getPos(t,e){const s=this._pts,i=Math.floor(e-this._catMin+.5),r=s[i+1]+(s[i+2]-s[i+1])*(e-Math.floor(e+.5)+.5);return this._op.reversed?t-r:r}valueAt(t,e){this._op.reversed&&(e=t-e);for(let t=1;t<this._pts.length-1;t++)if(e>=this._pts[t]&&e<this._pts[t+1])return this._catMin+t-.5}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);return this._pts[s+2]-this._pts[s+2-1]}getLabelLength(t,e){const s=Math.floor(e-this._catMin+.5);return s>this._tstep?this._pts[s+2]-this._pts[s+2-this._tstep]:this._pts[s+2+this._tstep-1]-this._pts[s+2-1]}getValue(t){return o(t)?t:this._map[t]}getXValue(t){return this._cats[t-this._catMin]||t}$_collectCategories(t){const e=this._op.categories,r=this._categories=[];if(i(e)&&e.length>0)this._len=0,e.forEach((t=>{const e=null==t?1:x(t.weight,1),i=t&&t.icon;let n,a;null==t?a=n=null:s(t)?(n=b(t.name,t.label),a=b(t.label,t.name)):a=n=String(t),this._len+=e,r.push({c:n,t:a,w:e,i:i})}));else if(i(t))for(const e of t){const t=e.collectCategories(this);for(const e of t)r.find((t=>t.c===e))||r.push({c:e,w:1,t:e})}this._map={},r.forEach(((t,e)=>{null!=t.c&&(this._map[t.c]=e)}))}}zs.type="category",zs.defaults=fe(je.defaults,{padding:0,categoryPadding:.1,startOffset:0});const Fs={},Is={};class Hs extends ve{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point[e]||this._point.source[e]}}getValue(t,e){if(this._op.textField){const e=t.getProp(this._op.textField);if(null!=e)return e}return t.getPointLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return k.isValidNum(t)?this._getText(null,t,w(t)>1e3,!0):t}getOffset(){const t=+this._op.offset;return isNaN(t)?"inside"===this._op.position?0:Hs.OFFSET:t}getDefaultIconPos(){return"top"}_isVisible(){return this._op.visible||r(this._op.visibleCallback)}_doSetSimple(t){return r(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Hs.OFFSET=4,Hs.defaults=fe(ve.defaults,{visible:void 0,position:"auto",textAlign:"center",distance:25});class Gs extends xe{constructor(t){super(t.chart),this.series=t}_doPrepareRender(t){const e=this.series,s=this._res=(e._runPoints.length-1)*Math.max(1,+this._op.resolution||5),i=e._minX>0?0:(e._maxX-e._minX)/s-e._minX,r=e._minY>0?0:(e._maxY-e._minY)/s-e._minY,n=e._runPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+i,y:t.yValue+r})));(this["_"+this._op.type]||this._linear).call(this,n,this._points=[]),this._points.forEach((t=>{t.x-=i,t.y-=r}))}isCurved(){const t=this._op.type;return!0===this._op.curved||null==this._op.curved&&("exponential"===t||"logarithmic"===t||"power"===t)}_calcLine(t){const e=t.length;let s=0,i=0,r=0,n=0;t.forEach((t=>{s+=t.x,i+=t.y,r+=t.x*t.y,n+=t.x*t.x}));const a=e*n-s*s,o=0===a?0:(e*r-s*i)/a;return{m:o,a:(i-o*s)/e}}_linear(t,e){const s=t.length;if(s>1){const{m:i,a:r}=this._calcLine(t);e.push({x:t[0].x,y:i*t[0].x+r}),e.push({x:t[s-1].x,y:i*t[s-1].x+r})}}_logarithmic(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:x(t.y,0)}))),{m:r,a:n}=this._calcLine(i),a=t[0].x,o=t[s-1].x,h=(o-a)/this._res;for(let t=a;t<=o;t+=h){const s=n+Math.log(t)*r;e.push({x:t,y:s})}}}_power(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:r,a:n}=this._calcLine(i),a=Math.exp(n),o=t[0].x,h=t[s-1].x,l=(h-o)/this._res;for(let t=o;t<=h;t+=l){const s=a*Math.pow(t,r);e.push({x:t,y:s})}}}_calcLine2(t){t.length;let e=0,s=0,i=0,r=0,n=0,a=0;t.forEach((t=>{e+=t.x,s+=t.y,i+=t.x*t.x*t.y,r+=t.y*Math.log(t.y),n+=t.x*t.y*Math.log(t.y),a+=t.x*t.y}));const o=s*i-a*a,h=Math.exp((i*r-a*n)/o);return{m:(s*n-a*r)/o,a:h}}_exponential(t,e){const s=t.length;if(s>1){const i=t.map((t=>({x:t.x,y:t.y}))),{m:r,a:n}=this._calcLine2(i),a=n,o=t[0].x,h=t[s-1].x,l=(h-o)/this._res;for(let t=o;t<=h;t+=l){const s=a*Math.exp(r*t);e.push({x:t,y:s})}}}_polynomial(t,e){const s=t.length;if(s>1){const i=[],r=[];let n=0,a=0;const o=2+1;for(let e=0;e<o;e++){for(let i=0;i<s;i++)n+=Math.pow(t[i].x,e)*t[i].y;i.push(n),n=0;const h=[];for(let i=0;i<o;i++){for(let r=0;r<s;r++)a+=Math.pow(t[r].x,e+i);h.push(a),a=0}r.push(h)}r.push(i);const h=function(t,e){const s=t,i=t.length-1,r=[e];for(let t=0;t<i;t++){let e=t;for(let r=t+1;r<i;r++)w(s[t][r])>w(s[t][e])&&(e=r);for(let r=t;r<i+1;r++){const i=s[r][t];s[r][t]=s[r][e],s[r][e]=i}for(let e=t+1;e<i;e++)for(let r=i;r>=t;r--)s[r][e]-=s[r][t]*s[t][e]/s[t][t]}for(let t=i-1;t>=0;t--){let e=0;for(let n=t+1;n<i;n++)e+=s[n][t]*r[n];r[t]=(s[i][t]-e)/s[t][t]}return r}(r,o),l=t[0].x,_=t[s-1].x,c=(_-l)/this._res;for(let t=l;t<=_;t+=c){const s=h.reduce(((e,s,i)=>e+s*Math.pow(t,i)),0);e.push({x:t,y:s})}}}_movingAverage(t,e){const s=t.length,i=f(1,m(s-1,this._op.movingInterval));let r=i;for(;r<=s;){const s=t.slice(r-i,r).reduce(((t,e)=>t+x(e.y,0)),0);e.push({x:t[r-1].x,y:s/i}),r++}}}Gs.defaults=fe(xe.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2});const js={x:"xValue",y:"yValue",z:"zValue"};class Ws extends Ss{constructor(t,e){super(),this.series=t,this.point=e,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return this.point._vr=t,this.series._changed(),!0}}class Xs extends Ms{}class Ys extends xe{constructor(){super(...arguments),this._row=0,this._col=0,this.index=-1,this.seriesIndex=0,this._simpleMode=!1}static register(...t){t.forEach((t=>{Fs[t.type]=t}))}static _loadSeries(t,e,s,i){const r=t._getSeriesType(s.type)||t._getSeriesType(i||t.type);if(!r)throw new Error("Invalid series type: "+s.type+", "+t.type);const n=new r(t);return n.init(),n.index=e,n.seriesIndex=t._seriesIndex++,n._load(s),n}static getPointTooltipParam(t,e,s){switch(s){case"series":return t.displayName();case"name":return e.getTooltip(s)||t._xAxisObj.getXValue(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getTooltip(s)}}_doInit(t){this._points=new Ts(this),this._pointArgs={}}_doInitChildren(t){t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){k.log("onDataValueChanged",e,s,i,r);const n=this._runPoints[e];if(n){const t={};t[s]=i,this.updatePoint(n,t)}}onDataRowUpdated(t,e,s){}onDataRowAdded(t,e){k.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){k.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){k.log("onDataChanged")}getTooltipText(t,e){return this._op.tooltipCallback?(this._getPointCallbackArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs)):this._op.tooltipText}getTooltipParam(t,e,s){return Ys.getPointTooltipParam(t,e,s)}_type(){return this.constructor.type}_viewType(){return this._type()}get name(){return this._name}get pointLabel(){return this._pointLabel}get data(){return this._data}_setData(t){t!==this._data&&(this._op.data=this._data=t,this._dataSourceDirty=!0,this._changed())}get pointCount(){return this._runPoints.length}get visiblePointCount(){return this._visPoints.length}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}_getVisiblePoints(){return this._points.getPoints(this._xAxisObj,this._yAxisObj)}pointLabelCount(){return 1}isEmpty(){return this._points.isEmpty()}needAxes(){return!0}canCategorized(){return!1}hasZ(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}isMarker(){return!1}displayName(){return this._op.label||this.name}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e)),this._legendMarker}legendColor(){return this._calcedColor}legendLabel(){return this._op.label||this.name}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s}canMaxPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}getVisibleSeries(){return[this]}_getNoClip(t){return this._group?this._group.options.noClip:this._op.noClip}needClip(t){const e=this._getNoClip(t);return t?!1===e:!0!==e}setCol(t){this._col=t}setRow(t){this._row=t}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(t){const e=t.getValue(this._op.xStart),s=isNaN(e)?t.getValue(this.chart._chartOptions.getXStart(t)):e;return t._zoom?Math.floor(t._zoom.start):s||0}$_getXStep(t){return b(this._op.xStep,this.chart._chartOptions.options.xStep)||1}_prepareRender(){if(this._xAxisObj=this._group?this._group._xAxisObj:this.chart._connectSeries(this,!0),this._yAxisObj=this._group?this._group._yAxisObj:this.chart._connectSeries(this,!1),this._calcedColor=void 0,this._dataSourceDirty){const t=this._doLoadData(this._data);this._loadPoints(t),this._dataSourceDirty=!1}this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this._pointLabel._prepareRender(),super._prepareRender()}prepareAfter(){this._pointsChanged=!1}collectCategories(t){if(t instanceof zs){let e=t.options.categoryField;return null!=e?this._points.getProps(e):this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>n(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);n(i)&&(i=i.trim()),this._runPoints.forEach(((r,n)=>{let a=t.getValue(r.x);isNaN(a)&&(a=s,s=t.incStep(s,i)),isNaN(a)?r.isNull=!0:(r.xValue=a,e&&e.push(a))}))}else this._runPoints.forEach(((s,i)=>{if(s.isNull)s.y=s.yGroup=s.yValue=NaN;else{let i=null==s.y?NaN:t.getValue(s.y);isNaN(i)&&(i=t.getValue(s.y)),s.initValues(),isNaN(s._vr)||(isNaN(s._prev.yValue)&&s.initPrev(t,s._prev),i=s._prev.yValue+(i-s._prev.yValue)*s._vr,s.applyValueRate(s._prev,s._vr)),isNaN(i)?s.yGroup=0:(s.yGroup=s.yValue=i,e&&e.push(i)),s.isNull=isNaN(s.yValue)}}))}collectRanges(t){var e;const s=this._visPoints,i=s.length;if(i>0){const t=this._pointArgs;let r=s[0],n=r.xValue,a=n,o=r.yValue,h=o,l=r.zValue,_=l;const c=this.hasZ();r.vindex=0;for(let t=1;t<i;t++)r=s[t],r.vindex=t,isNaN(h)&&!isNaN(r.yValue)?o=h=r.yValue:r.yValue>h?h=r.yValue:r.yValue<o&&(o=r.yValue),isNaN(a)&&!isNaN(r.xValue)?n=a=r.xValue:r.xValue>a?a=r.xValue:r.xValue<n&&(n=r.xValue);if(c)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(_)&&!isNaN(e)?l=_=e:e>_?_=e:e<l&&(l=e)}if(this._minY=o,this._maxY=h,this._minX=n,this._maxX=a,null===(e=this._trendline)||void 0===e?void 0:e.visible){this._trendline._prepareRender();const t=this._trendline._points.map((t=>t.y)).sort(((t,e)=>t-e));this._minY=Math.min(this._minY,t[0]),this._maxY=Math.max(this._maxY,t[t.length-1])}t.yMin=this._minY,t.yMax=this._maxY,t.xMin=this._minX,t.xMax=this._maxX,c&&(t.zMin=this._minZ=l,t.zMax=this._maxZ=_)}this.$_prepareViewRanges(s),isNaN(this._minY)||t.push(this._minY,this._maxY)}_getRangeMinMax(t){let e,s;return"x"===t?(e=this._minX,s=this._maxX):"z"===t?(e=this._minZ,s=this._maxZ):(e=this._minY,s=this._maxY),{min:e,max:s}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:s,max:i}=this._getRangeMinMax(e);(this._runRanges=rt(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=T}))}pointValuesPrepared(t){this._referents&&this._referents.forEach((e=>e.reference(this,t))),this.visible&&(this._visPoints=this._runPoints.filter((t=>t.visible)))}reference(t,e){}getLegendSources(t){!1!==this._op.visibleInLegend&&t.push(this)}getLabelPosition(t){return t}getLabelOff(t){return t}referBy(t){t&&(this._referents?this._referents.indexOf(t)<0&&this._referents.push(t):this._referents=[t])}setPointVisible(t,e){t&&e!==t.visible&&(t.visible=e,this.chart._pointVisibleChanged(this,t))}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._argsPoint=null,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){e!==this._argsPoint&&(this._argsPoint=e).assignTo(t)}getPointText(t,e,s){let i;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),null!=i)?i:(i=t.getPointText(e),null!=i?i:s)}getPointStyle(t){if(this._op.pointStyleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this._op.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(this._pointLabel.options.styleCallback)return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.options.styleCallback(this._pointArgs)}pointClicked(t){if(this._op.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}pointHovered(t){this._op.onPointHover&&(t&&this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointHover(t?this._pointArgs:null))}getViewRangeAxis(){return this._op.viewRangeValue||this._defViewRangeValue()}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&(e.options.visibleCallback?(this._getPointCallbackArgs(this._pointArgs,t),e.options.visibleCallback(this._pointArgs)):!0===e.visible)}getPointAt(t){return n(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:T}updatePoint(t,e){if(t instanceof Ms||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&(this.chart._dataChanged(),this.chart.animatable()&&(s.ani=new Ws(this,t),s.ani.start())),this._changed(),!!s}return!1}updateData(t){this._setData(t),this.chart._dataChanged()}addPoint(t){const e=this._doAddPoint(t);if(e){if(this._points.add(e),this.chart._dataChanged(),this.chart.animatable()){this._pointsChanged=!0;const t=e._prev=e.copy();t.ani=new Ws(this,e),t.ani.start()}this._changed()}return e}addPoints(t){const e=[];return i(t)&&t.forEach((t=>{const s=this._doAddPoint(t);s&&e.push(s)&&this._points.add(s)})),e.length>0&&(this._pointsChanged=!0,this.chart._dataChanged(),this.chart.animatable()&&e.forEach((t=>{const e=t._prev=t.copy();e.ani=new Ws(this,t),e.ani.start()})),this._changed()),e}removePoint(t){if(t instanceof Ms||(t=this.getPointAt(t)),t&&this._points.remove(t))return this._doPointRemoved(t),this._pointsChanged=!0,this.chart._dataChanged(),this._changed(),!0}removePoints(t){if(i(t)){const e=[];t.forEach((t=>{t instanceof Ms||(t=this.getPointAt(t)),t&&this._points.remove(t)&&e.push(t)})),e.length>0&&(this._doPointsRemoved(e),this._pointsChanged=!0,this.chart._dataChanged(),this._changed())}return 0}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders()}_createLabel(t){return new Hs(t)}_createPoint(t){return new Xs(t)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),(s.isNull||(s.isNull=null==t||null==s.y))&&(this._containsNull=!0),s}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField"]}_createFielder(t){return r(t)?e=>t(e):n(t)?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach((e=>{const s=`_${e}er`;(!this[s]||e in t&&this[`_${e}`]!==t[e])&&(this[s]=this._createFielder(t[e]),this[`_${e}`]=t[e])}))}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(i(t))return t;if(t){let e;if(t._obj instanceof ht?e=t._obj:t instanceof ht&&(e=t),e)return e!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=e,this._cdata&&this._cdata._addListener(this)),e._internalValues()}}_loadPoints(t){var e,s;this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=this._runColor=o(t.color)?`var(--color-${(Math.floor(t.color)-1)%12+1})`:t.color;let s,r;i(t.pointColors)?s=t.pointColors:n(t.pointColors)?r=this.chart._assets.get(t.pointColors):this._colorByPoint()&&(s=this.chart.options.options.colors),r instanceof ue?(r.prepare(),this._runPoints.forEach(((t,s)=>{t.color=t.color||r.getNext()||e}))):i(s)?this._runPoints.forEach(((t,i)=>{t.color=t.color||s[i%s.length]||e})):this._runPoints.forEach(((t,s)=>{t.color=t.color||e})),this._preparePointArgs(this._pointArgs)}_setViewRange(t,e){const s=t[js[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=T}_defViewRangeValue(){return"y"}_canSort(){return!0}}Ys.LEGEND_MARKER="rct-legend-item-marker",Ys.defaults=fe(xe.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}:<b> ${yValue}</b>",loadAnimation:"default",hoverEffect:"default"});class Us extends ye{constructor(){super(...arguments),this._map={},this._visibles=[],this._series=[],this._visibleSeries=[]}get firstSeries(){return this._series[0]}get firstVisible(){return this._visibles[0]}get firstVisibleSeries(){return this._visibleSeries[0]}isWidget(){return this._widget}isEmpty(t){return!(t?this._visibles:this._items).find((e=>!e.isEmpty(t)))}visibles(){return this._visibles.slice(0)}series(){return this._series.slice(0)}seriesCount(){return this._series.length}needAxes(){return!!this._visibles.find((t=>t.needAxes()))||0===this._visibleSeries.length}_clear(){}get(t){return this._items[t]}getSeries(t){return this._map[t]}getVisibleSeries(){return this._visibleSeries.slice(0)}getPaneSeries(t,e){return this._visibleSeries.filter((s=>t===s._row&&e===s._col))}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}load(t){const e=this.chart,r=this._items=[],n=this._series=[];i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{t instanceof ri?n.push(...t.series):t instanceof Ys&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t))),e.options.series=this._items.map((t=>t.options))}add(t){const e=this.$_loadItem(this.chart,t,this._series.length);if(e)return this._items.push(e),this._series.push(e),this.$_add(e),e}remove(t){let e;if(t instanceof Ys?e=t:n(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),e.name&&delete this._map[e.name],e;if(e._group.remove(e))return e}}updateData(t){}prepareRender(){const t=[];let e=0;this._visibles=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0))),this._series.forEach((s=>{s.visible&&(!s._group||s._group.visible)&&t.push(s),s.hasShape()&&s.setShape(ks[e++%ks.length])})),this._visibleSeries=t.sort(((t,e)=>{let s=+(t.group?t.group.zOrder:t.zOrder)||0,i=+(e.group?e.group.zOrder:e.zOrder)||0;return s===i&&t.group&&t.group===e.group?(+t.zOrder||0)-(+e.zOrder||0):s-i}));const s=this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof ti&&(t._single=1===s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){let r=i(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const i=new r(t);return i.init(),i._load(e),i.index=s,i}return Ys._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Qs||(this._widget=!1),t.name&&(this._map[t.name]=t);for(const e of this._series)if(e!==t){if(!t.canMixWith(e))throw new Error("동시에 표시할 수 없는 시리즈들입니다: "+t._type()+", "+e._type());if(t._referOtherSeries(e))break}}}class Zs extends Ys{_doInitChildren(t){super._doInitChildren(t),t.trendline=(this._trendline=new Gs(this)).init()}get trendline(){return this._trendline}}Zs.defaults=fe(Ys.defaults,{});class qs extends xe{constructor(t){super(t.chart),this.series=t,this._args={}}getMarkerStyle(t){if(this._op.styleCallback)return this.series._getPointCallbackArgs(this._args,t),this._op.styleCallback(this._args)}}qs.defaults=fe(xe.defaults,{radius:3});class Ks extends Ms{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return b(this.x,this.y)}styleLegendMarker(t){}}class Qs extends Ys{getCenter(t,e){return{x:K(this._centerXDim,t),y:K(this._centerYDim,e)}}getLabelPosition(){const t=this._pointLabel.options.position;return"auto"===t?"inside":t}needAxes(){return!1}_colorByPoint(){return!0}getLegendSources(t){this._op.legendByPoint?!1!==this._op.visibleInLegend&&this._runPoints.forEach((e=>{t.push(e)})):super.getLegendSources(t)}_doApply(t){const e=this;var s,i;super._doApply(t),s=t.centerX,i=t.centerY,s!==e._centerX&&(e._centerX=s,e._centerXDim=Z(v(s,e._op.center,Qs.CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=Z(v(i,e._op.center,Qs.CENTER),!0))}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}}Qs.CENTER="50%",Qs.defaults=fe(Ys.defaults,{legendByPoint:!1,centerX:"50%",centerY:"50%"});class Js extends Qs{getRadius(t,e){return K(this._radiusDim,m(t,e))}_doApply(t){const e=this;var s;super._doApply(t),(s=t.radius)!==e._radius&&(e._radiusDim=Z(b(e._radius=s,Js.defaults.radius),!0))}}Js.defaults=fe(Qs.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class ti extends Zs{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0,this._minPointWidth=0}groupWidth(){return this._op.pointWidth}getMinPointWidth(){return this._minPointWidth}getPointWidth(t){const e=this._group;let s=t;return e?(s*=e._clusterWidth,s*=1-2*e.options.groupPadding,s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,f(this._minPointWidth,s)}getPointPos(t){const e=this._group;let s=t,i=0;return e?(i=s*e._clusterPos,s*=e._clusterWidth,i+=s*e.options.groupPadding,s-=s*e.options.groupPadding*2,i+=s*this._childPos,s*=this._childWidth):(i=s*this._clusterPos,s*=this._clusterWidth),i+=s*this._pointPad,i}getLabelPosition(t){return"auto"===t?"outsideFirst":t}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}_doPrepareRender(){super._doPrepareRender(),this._pointPad=isNaN(this._op.pointPadding)?this._single?.25:this._group?.1:.2:Math.max(0,Math.min(.5,this._op.pointPadding)),this._minPointWidth=x(this.getMinPointWidth(),0)}}ti.defaults=fe(Ys.defaults,{pointWidth:1});class ei extends ti{_doPrepareRender(){super._doPrepareRender(),this._base=x(this._getGroupBase(),this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this._op.baseValue}isBased(t){return t===this._yAxisObj}}ei.defaults=fe(ti.defaults,{baseValue:0,nullAsBase:!1});class si extends ti{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._runPoints.forEach((t=>{const s=this._getBottomValue(t);e&&!isNaN(s)&&e.push(s)}))}}class ii extends si{}class ri extends xe{constructor(){super(...arguments),this.index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{Is[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{Is[t.seriesType]=t}))}static collectTooltipText(t,e,s){let i=t.tooltipHeader||"";return t.tooltipRow&&e.forEach(((e,r)=>{s.vindex>=e._visPoints.length||(i&&(i+="<br>"),i+=t.tooltipRow.replace("series","series."+r).replace(/\$\{/g,"${"+r+"."))})),i+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",i}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=parseInt(i.substring(0,r));if(!isNaN(n)){const a=t[n]._visPoints[s.vindex];a&&(e=t[n],s=a,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Ys.getPointTooltipParam(e,s,i)}getTooltipText(t,e){return ri.collectTooltipText(this._op,this._visibles,e)}getTooltipParam(t,e,s){return ri.inflateTooltipParam(this._visibles,t,e,s)}get series(){return this._series.slice(0)}needAxes(){return!0}isEmpty(t){return(t?this._visibles:this._series).length<1}canCategorized(){return!1}defYAxisType(){return"linear"}isClusterable(){return!1}getBaseValue(t){return NaN}getVisibleSeries(){return this._visibles}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}setCol(t){this._col=t,this._series.forEach((e=>e.setCol(t)))}setRow(t){this._row=t,this._series.forEach((e=>e.setRow(t)))}isFirstVisible(t){return t===this._visibles[0]}isLastVisible(t){return t===this._visibles[this._visibles.length-1]}collectValues(t,e){if(this._visibles.length>0)if(t===this._visibles[0]._yAxisObj)switch(this._op.layout){case"stack":this.$_collectStack(t,e);break;case"fill":this.$_collectFill(t,e);break;default:this.$_collectValues(t,e)}else this.$_collectValues(t,e)}collectRanges(t){this._visibles.forEach((e=>{e.collectRanges(t)}))}pointValuesPrepared(t){this._series.forEach((e=>e.pointValuesPrepared(t)))}collectCategories(t){let e=[];return this._visibles.forEach((s=>e=e.concat(s.collectCategories(t)))),e}getLegendSources(t){var e;const s=this._op;if(!1!==s.visibleInLegend&&this.visible){const i=this._series;if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==s.layout&&"stack"!==s.layout)i.forEach((e=>e.getLegendSources(t)));else for(let e=i.length-1;e>=0;e--)i[e].getLegendSources(t)}}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s}canMaxPadding(t,e){const s=this.getBaseValue(t);return(isNaN(s)||e>s||!this.isBased(t))&&"fill"!==this._op.layout}getVisPoints(t){return this._visibles.map((e=>e._visPoints[t.vindex]))}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e._getVisiblePoints()))),t}_doApply(t){super._doApply(t),e.call(t,"children")&&this.$_loadSeries(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._series.map((t=>t.saveOptions()))}_prepareRender(){const t=this._visibles;if(this._stacked="stack"===this._op.layout||"fill"===this._op.layout,this._visibles=this._series.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0))),!(this._seriesChanged=!k.equalArrays(t,this._visibles)))for(let t=this._visibles.length-1;t>=0;t--)if(this._visibles[t].seriesChanged()){this._seriesChanged=!0;break}super._prepareRender()}_doPrepareRender(t){this._xAxisObj=this.chart._connectSeries(this,!0),this._yAxisObj=this.chart._connectSeries(this,!1),this._visibles.length>0&&(this._visibles.forEach((t=>t._prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_doPrepareSeries(t){}$_loadSeries(t,e){const r=this._seriesType();i(e)?e.forEach(((e,s)=>this.$_add(Ys._loadSeries(t,this._series.length,e,r)))):s(e)&&this.$_add(Ys._loadSeries(t,this._series.length,e,r))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t);if(isNaN(s))for(const t of i.values()){t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)t[e].yGroup=t[e-1].yGroup+(t[e].yValue||0);e.push(t[t.length-1].yGroup)}else for(const t of i.values()){let i=t[0].yValue||0,r=i>=s?0:-1,n=i<s?0:-1;t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)i=t[e].yValue||0,i>=s?(r>=0&&(t[e].yGroup=t[r].yGroup+i*(i<0?-1:1)),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i*(i>=0?-1:1)),n=e);r>=0&&e.push(t[r].yGroup),n>=0&&e.push(t[n].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.options.layoutMax||100,r=this.$_collectPoints(t);if(isNaN(s))for(const t of r.values()){const s=t.reduce(((t,e)=>t+(e.yValue||0)),0);if(0===s){for(const e of t)e.yValue=e.yGroup=0;e.push(0)}else{let r=0;for(const e of t)r=e.yGroup=(e.yValue||0)/s*i+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(w(e.yValue)||0)),0);if(0===r){for(const e of t)e.yValue=e.yGroup=0;e.push(0,0)}else{let n=0,a=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?a=e.yGroup=(e.yValue||0)+a:n=e.yGroup=(e.yValue||0)+n;e.push(a,n)}}}}ri.defaults=fe(xe.defaults,{layout:"default",layoutMax:100,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>"});class ni extends ri{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class ai extends ri{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0}groupWidth(){return this._op.groupWidth}isClusterable(){return!1!==this._op.clusterable}setCluster(t,e){this._clusterWidth=t,this._clusterPos=e}}ai.defaults=fe(ri.defaults,{groupWidth:1,groupPadding:.1});class oi extends Zs{isMarker(){return!0}}oi.defaults=fe(Ys.defaults,{colorByPoint:!1});class hi extends xe{}class li extends xe{}const _i={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},ci={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},di={minPadding:0,maxPadding:0};class ui extends xe{constructor(){super(...arguments),this._dataChanged=!0}_doInitChildren(t){const e=this.chart;t.handle=(this._handle=new hi(e)).init(),t.mask=(this._mask=new li(e)).init(),t.borderLine=(this._borderLine=new xe(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return x(this._op.thickness,ui.defaults.thickness)}getGap(){return x(this._op.gap,ui.defaults.gap)}getGapFar(){return x(this._op.gapFar,ui.defaults.gapFar)}getSize(){return this.getThickness()+this.getGap()+this.getGapFar()}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const i={};if(s(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),i.series=l({},e.series,_i[t]())}else i.series=_i.area();s(e.xAxis)?i.xAxis=l({},e.xAxis,(ci[e.xAxis.type]||ci.linear)(),di):i.xAxis=l({},di),s(e.yAxis)?i.yAxis=l({},e.yAxis,(ci[e.yAxis.type]||ci.linear)(),di):i.yAxis=l(ci.linear(),di),this._chartConfig=i,this._axisType=i.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}ui.defaults=fe(xe.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class pi extends ws{constructor(t){super(t.chart),this.pane=t}base(){return this.chart._body}contains(t){return t.options.col===this.pane.col||t.options.row===this.pane.row}}pi.defaults=fe(ws.defaults,{radius:void 0,centerX:void 0,centerY:void 0});class gi extends xe{constructor(t,e,s){super(t),this.row=e,this.col=s}_doInitChildren(t){t.body=(this._body=new pi(this)).init()}get body(){return this._body}_prepareRender(){this.body._prepareRender()}}class mi extends xe{constructor(){super(...arguments),this._cols=1,this._rows=1,this._panes={},this._vcols=1,this._vrows=1,this._vpanes=[]}count(){return this._vrows*this._vcols}rowCount(){return this._vrows}colCount(){return this._vcols}paneCount(){return this._vrows*this._vcols}getPane(t,e){return this._vpanes[t][e]}getRow(t){return this._vpanes[t]}getColumn(t){return this._vpanes.map((e=>e[t]))}_doLoadProp(t,e){return["panes","cols","rows"].indexOf(t)>=0||super._doLoadProp(t,e)}_doSetSimple(t){if(i(t)&&t.length>0){const e=this._op;return e.rows=f(1,+t[0]),e.cols=f(1,x(+t[1],e.rows)),e.rows>0&&e.cols>0&&(this.$_parsePanes(e.rows,e.cols),this.visible=!0),!0}return super._doSetSimple(t)}_load(t){return super._load(t),s(t)&&(this.$_parsePanes(this._op.rows=t.rows,this._op.cols=t.cols),this._panes=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._xAxes=t._xPaneAxes,this._yAxes=t._yPaneAxes,this._vpanes=this.$_collectPanes(t),this._vpanes.forEach((t=>t.forEach((t=>t._prepareRender()))))}getXLens(t){return new Array(this._vcols).fill(t/this._vcols)}getYLens(t){return new Array(this._vrows).fill(t/this._vrows)}layoutAxes(t,e,s,i){const r=this.getXLens(s?e:t),n=this.getYLens(s?t:e);this._xAxes._buildTicks(r),this._yAxes._buildTicks(n),this.$_calcAxesPoints(r,n,0)}$_calcAxesPoints(t,e,s){this._xAxes._calcPoints(t,s),this._yAxes._calcPoints(e,s)}calcAxesPoints(t,e){this.$_calcAxesPoints(t,e,101)}calcSizes(t,e){this._widths=this.$_calcSizes(t,this._widths),this._heights=this.$_calcSizes(e,this._heights)}getAnnotation(t){for(const e in this._panes){const s=this._panes[e].body.getAnnotation(t);if(s)return s}}$_parseSizes(t){let e;return e=i(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],e.map((t=>{if(n(t)){const e=t.trim();return{size:"*"===e?1:parseFloat(e)}}return+t||{size:1}}))}$_parsePanes(t,e){this._widths=this.$_parseSizes(e),this._heights=this.$_parseSizes(t),this._cols=this._widths.length,this._rows=this._heights.length}$_loadPanes(t){const e={};return t=i(t)?t:s(t)?[t]:null,i(t)&&t.forEach((t=>{const s=+t.row||0,i=+t.col||0;if(i>=0&&i<this._cols&&s>=0&&s<this._rows){const r=new gi(this.chart,s,i);r.init(),r._load(t),e[s+","+i]=r}})),e}$_collectPanes(t){const e=t._getXAxes()._internalItems(),s=t._getYAxes()._internalItems(),i=[],r=[],n=[];e.concat(s).forEach((t=>{const e=t.options.row||0,s=t.options.col||0;t._row=e,t._col=s,s>=0&&s<this._cols&&i.indexOf(s)<0&&i.push(s),e>=0&&e<this._rows&&r.indexOf(e)<0&&r.push(e)})),i.sort(),r.sort();for(let e=0;e<r.length;e++){const s=[];for(let r=0;r<i.length;r++){const i=this._panes[e+","+r]||new gi(t,e,r)._initObject();s.push(i)}n.push(s)}return this._vrows=n.length,this._vcols=n[0].length,n}$_calcSizes(t,e){}}mi.defaults=fe(xe.defaults,{visible:!1,gap:0});class fi extends xe{_isVisible(){return this._op.visible&&!W(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}fi.defaults=fe(xe.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10});class wi extends fi{}wi.defaults=fe(fi.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class xi extends xe{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)}}setTarget(t,e,s){let i=b(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followPointer())}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?gt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Mt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}xi.defaults=fe(xe.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class yi extends ke{_isVisible(){return this._op.visible&&!W(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}yi.type="image";class bi extends ke{getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this._op.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}getShape(){return this._op.shape||bi.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}bi.type="shape",bi.defaults=fe(ke.defaults,{width:64,height:64,shape:"square"});class vi extends ke{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!W(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?gt.getFormatter(s):T),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Mt.getFormatter(t):T)}(t.timeFormat)}}vi.type="text",vi.defaults=fe(ke.defaults,{text:"Text"});class Vi extends Re{getPoints(t,e){return t.hasBreak()?t._ticks.filter((e=>!t.isBreak(e.value))).map((s=>t.getPos(e,s.value))):t._ticks.map((s=>t.getPos(e,s.value)))}}class Si extends ze{constructor(){super(...arguments),this._strictEnds=!1,this._strictTicks=!1}_isValidInterval(t){return t>0}_normalizeSteps(t,e,s){return t}buildSteps(t,e,s,n,a=!1){var o,h;const l=this._op;let _;return this._strictTicks=this._strictEnds=!1,this._step=NaN,a?_=this._getStepsByPixels(t,x(.85*l.stepPixels,60),e,s,n):i(l.steps)||r(l.stepCallback)?(_=l.stepCallback?l.stepCallback.call(T,{length:t,minValue:s,maxValue:n}):l.steps.slice(0),_.length>0&&isNaN(_[0])&&(_[0]=s),_.length>1&&isNaN(_[_.length-1])&&(_[_.length-1]=n),this._strictTicks=this._strictEnds=!0):_=this._baseAxis instanceof Li&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,e,s,n,!0):l.stepCount>0?this._getStepsByCount(l.stepCount,e,s,n,!1):this._isValidInterval(l.stepInterval)?this._getStepsByInterval(l.stepInterval,e,s,n):l.stepPixels>0?this._getStepsByPixels(t,((null===(o=this.axis)||void 0===o?void 0:o._isPolar)&&!(null===(h=this.axis)||void 0===h?void 0:h._isX)?.5:1)*l.stepPixels,e,s,n):s!==n?[s,n]:[s],_}getNextStep(t,e){return t+e*this._step}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_findBaseAxis(){if(null!=this._op.baseAxis){const t=this.axis,e=(t._isX?this.chart._getXAxes():this.chart._getYAxes()).get(this._op.baseAxis);e!==t&&e instanceof Li&&(this._baseAxis=e,e.tick._baseAxis=null)}}$_normalizeMin(t,e){return t>_(t/e)*e?t=_(t/e)*e:t<c(t/e)*e&&(t=c(t/e)*e),I(t)}_getStepsByCount(t,e,s,i,r){s>e?(s=e,e=NaN):i<e&&(i=e,e=NaN),this._strictEnds=!0;const n=this.axis,a=i-s;let o=a/(t-1);const h=Math.pow(10,Math.floor(Math.log10(o))),l=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&o/h==2.5&&_(t*a/o)==t*a/o?this._step=o:o=this._step=c(o/h)*h:o=a/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this.$_normalizeMin(s,h);else{for(st(s<e&&i>e,"base error"),t=f(3,t);;){if(!(c((e-s)/o)+c((i-e)/o)+1>t))break;o+=h}s=e-c((e-s)/o)*o}else s=n._fixedMin;l.push(s);for(let e=1;e<t;e++)l.push(I(l[e-1]+o));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=this.$_normalizeMin(s,t),isNaN(e))for(r.push(n=s);n<i;)r.push(n=I(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=I(n-t));for(n=e;n<i;)r.push(n=I(n+t))}return this._step=t,r}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,s,i,r){i>=s?i=s:r<=s&&(r=s);const n=r-i,a=[];if(0===n)return isNaN(i)?[]:[i];let o=t>250?5:t>200?4:t>150?3:t>80?2:1,h=f(this.axis._isX?1:o,_(t/e))+1,l=n/(h-1);const d=Math.pow(10,Math.floor(g(l))),u=this._getStepMultiples(d);let p,m=0;if(l/=d,u)if(l>u[m]){for(;m<u.length-1;m++)if(l>u[m]&&l<u[m+1]){l=u[++m];break}}else l=u[m];if(l*=d,isNaN(s))i=this.$_normalizeMin(i,l);else{for(st(i<=s&&r>=s,"base error"),h=f(3,h);m<u.length;){if(!(c((s-i)/l)+c((r-s)/l)+1>h))break;l=m<u.length-1?u[m+1]*d:2*l,m++}i=s-c((s-i)/l)*l}for(this._step=l,a.push(I(p=i));p<r;)a.push(I(p+=l));return a}}Si.defaults=fe(ze.defaults,{stepPixels:72,baseRange:!1});class ki extends Fe{}ki.defaults=fe(Fe.defaults,{numberFormat:"0.##"});class Pi extends ki{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!0)}}Pi.defaults=fe(ki.defaults,{useSymbols:!0});class Ci extends Ee{getSize(t){return K(this._sizeDim,t)}_doApply(t){super._doApply(t),this._op.space=x(this._op.space,0),this._sizeDim=Z(this._op.size,!1)}}Ci.defaults=fe(Ee.defaults,{enabled:!0,size:"30%",space:16,gridVisible:!0});class Ai extends Ne{}Ai.defaults=fe(Ne.defaults,{visible:!1});class Li extends je{constructor(){super(...arguments),this._breaks=[]}_doInitChildren(t){super._doInitChildren(t),t.baseLine=(this._baseLine=new Ai(this)).init()}get baseLine(){return this._baseLine}get tick(){return this._tick}get grid(){return this._grid}getBaseValue(){return this._op.baseValue}hasBreak(){return null!=this._runBreaks}_getBreaks(){return this._runBreaks?this._runBreaks.slice(0,1):[]}isBreak(t){if(this._runBreaks){const e=this._runBreaks[0];return!e.options.gridVisible&&(t===e.options.from||t===e.options.to)}}_doApply(t){super._doApply(t),e.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new Vi(this)}_createTickModel(){return new Si(this)}_doPrepareRender(){this._baseVal=parseFloat(this._op.baseValue),this._tick._findBaseAxis()}_doBuildTicks(t,e,s){if(isNaN(t)||isNaN(e))return[];const i=this._tick,r=i._baseAxis instanceof Li&&i._baseAxis._ticks.length>0;let n,{min:a,max:o}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e),h=this._baseVal;if(isNaN(h)&&a<0&&o>0&&(h=0),isNaN(h)?a<0&&o>0&&(h=0):(a=Math.min(a,h),o=Math.max(o,h)),r&&i.options.baseRange&&(a=i._baseAxis.axisMin(),o=i._baseAxis.axisMax()),a===o)n=[a];else if(n=i.buildSteps(s,h,a,o,!1),n.length>0){if(i._strictTicks||(n=i._normalizeSteps(n,a,o)),!isNaN(this._fixedMin)||!i._strictEnds&&"tick"!==this._getStartFit())for(;n.length>2&&n[0]<a;)n.shift();else if(!i._strictEnds&&!r){for(;n.length>2&&n[1]<=a;)n.shift();if(!isNaN(i._step))for(;n[0]>a;)n.unshift(i.getNextStep(n[0],-1))}if(a=Math.min(a,n[0]),!isNaN(this._op.strictMax)||!i._strictEnds&&"tick"!==this._getEndFit())for(;n.length>2&&o<n[n.length-1];)n.pop();else if(!i._strictEnds&&!r){for(;n.length>2&&n[n.length-2]>=o;)n.pop();if(!isNaN(i._step))for(;n[n.length-1]<o;)n.push(i.getNextStep(n[n.length-1],1))}o=Math.max(o,n[n.length-1])}else n.push(a+(o-a)/2);this._setMinMax(a,o);const l=[];this._runBreaks&&(n=this.$_getBrokenSteps(this._runBreaks,s,a,o));let _=NaN;for(let t=0;t<n.length;t++){const e=this._createTick(s,t,n[t]);e.value!==_&&(l.push(e),_=e.value)}return l}_createTick(t,e,s){return{index:e,pos:NaN,value:I(s),label:this.label.getTick(e,s)||String(s)}}_calcPoints(t,e){if(e>100&&this._isX)if(this._min===this._max)this._unitLen=t/4;else{const e=this.$_calcUnitLength(this._isPolar?this.getTotalAngle():t);e&&(this._unitLen=e.len,this._isPolar||this._zoom||(this._min-=e.min/2,this._max+=e.min/2))}super._calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this._tick.buildSteps(t.len,void 0,t.from,t.to,!0)}$_getBrokenSteps(t,e,s,i){let r=0,n=s;const a=[n],o=this._sects=[];e-=t.reduce(((t,e)=>t+e.options.space),0),t.forEach((t=>{const s=t.options,i=t.getSize(e),h={from:n,to:t.options.from,pos:r,len:i};r+=i,o.push(h,t._sect={from:s.from,to:s.to,pos:r,len:s.space}),r+=s.space;this.$_buildBrokenSteps(h).forEach((t=>{t>h.from&&t<=h.to&&a.push(t)})),s.space>0&&a.push(s.to)}));const h=t[t.length-1];if(i>h.options.to){const t={from:h.options.to,to:i,pos:r,len:this._vlen-r};o.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&e<=t.to&&a.push(e)}))}return this._lastSect=o[o.length-1],a}getPos(t,e){if(this._runBreaks){const s=this._sects.find((t=>e<t.to))||this._lastSect,i=s.len*(e-s.from)/(s.to-s.from);return this._op.reversed?H(t-i-s.pos):H(i+s.pos)}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return H(this._op.reversed?t-s:s)}}valueAt(t,e){if(this._isHorz?this._op.reversed&&(e=t-e):this._op.reversed||(e=t-e),this._runBreaks){let t=0;for(const s of this._sects){if(e>=t&&e<t+s.len)return(s.to-s.from)*(e-t)/s.len+s.from;t+=s.len}return this._max}return(this._max-this._min)*e/t+this._min}xValueAt(t){return this.valueAt(this._vlen,t)}getUnitLen(t,e){return this._unitLen}getLabelLength(t,e){return Math.floor(t/this._ticks.length)}_getStartFit(){return"default"===this._op.startFit?this._isX?"value":"tick":this._op.startFit}_getEndFit(){return"default"===this._op.endFit?this._isX?"value":"tick":this._op.endFit}_adjustMinMax(t,e,s){const i=this._op;let r=this.isZoomed(),n=this.isZoomed(),a=!0,o=!0,h=NaN,l=NaN;this._series.forEach((t=>{const _=t.getBaseValue(this);isNaN(_)||(isNaN(i.minValue)&&_<=e?t.isBased(this)?e=_:h=x(m(h,_),_):isNaN(i.maxValue)&&_>=s&&(t.isBased(this)?s=_:l=x(f(l,_),_))),!r&&a&&t.canMinPadding(this,e)&&(a=!1),!n&&o&&t.canMaxPadding(this,s)&&(o=!1)})),r||(r=a),n||(n=o),this._fixedMin=this._fixedMax=NaN;let _=0,c=0;isNaN(i.strictMin)?i.minValue<e?e=i.minValue:r?this._fixedMin=e:_=y(i.minPadding,i.padding,0):this._fixedMin=e=i.strictMin,isNaN(i.strictMax)?i.maxValue>s?s=i.maxValue:n?this._fixedMax=s:c=y(i.maxPadding,i.padding,0):this._fixedMax=s=i.strictMax;let d=f(0,s-e),u=e-d*(this._minPad=_),p=s+d*(this._maxPad=c);return!isNaN(h)&&h<=e&&u<h&&(u=this._fixedMin=h),!isNaN(l)&&l>=s&&p>l&&(p=this._fixedMax=l),{min:u,max:p}}$_calcUnitLength(t){const e=[];if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&e.push(...t._getVisiblePoints())})),e.length>0){const s=this._isX;let i=e.map((t=>s?t.xValue:t.yValue)).sort(((t,e)=>t-e));for(let t=i.length-1;t>0;t--)i[t]===i[t-1]&&i.splice(t,1);return this._calcUnitLen(i,t,this._min,this._max)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/this._ticks.length;return{len:x(e*=t/(i-s+t),1),min:t}}return{len:e,min:0}}{let r=t[1]-t[0];for(let e=2;e<t.length;e++)r=m(r,t[e]-t[e-1]);return{len:x(e*=r/(i-s+r),1),min:r}}}$_loadBreak(t){if(s(t)&&"from"in t&&"to"in t){const e=new Ci(this);return e.init(),e._load(t),e}}$_loadBreaks(t){if(i(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){t.options.to=e.options.to}const e=this._breaks.sort(((t,e)=>t.options.from-e.options.from)).filter((t=>t.options.to>t.options.from));if(this._runBreaks=null,e.length>0){const i=this._runBreaks=[];i.push(l(new Ci(this)._initObject(),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],a=e[r];s=n,a.options.from<s.options.to?t(n,a):i.push(l(new Ci(this)._initObject(),a))}}var s}}Li.defaults=fe(je.defaults,{nullable:!0,padding:.04,startFit:"default",endFit:"default"});class Ei extends Li{get label(){return this._label}_createLabel(){return new Pi(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof ri&&"fill"===r[0].options.layout&&(i.max=r[0].options.layoutMax),i}}Ei.type="linear";class Ni extends Si{canUseNumSymbols(){return this.axis.axisMax()>g(500)}_getStepMultiples(t){return[1,2,5,10]}_normalizeSteps(t,e,s){if(!this._op.arrangeDecimals)return t;const i=[];let r=s-e;for(let e=0;e<t.length;e++){const n=i.length;let a=t[e],o=_(a);if(a===o){let t=i[n-1];e>1&&a-t<r&&(t=Math.pow(10,t),_(t)!==I(t)&&i.pop()),i.push(a)}else if(a>0&&a>o){if(a=o+g(10*(a-o)),a<=s)(0===n||a>i[n-1])&&i.push(a);else if(n>0){if(i[e-1]>=s)break;{const r=p(_(g(t[e]-t[e-1]))),n=t[e],o=n-_(n);if(r<1)for(let t=1;t<10;t++)if(o>g(t)&&o<g(t+1)){const e=_(n)+g(t);if(e>=s){a=e;break}}i.push(a)}}}else if(e>0&&a<=s&&a>i[n-1])i.push(a);else if(a>s)break;i.length>1&&(r=Math.min(.5,r,i[i.length-1]-i[i.length-2]))}return i}}Ni.defaults=fe(Si.defaults,{arrangeDecimals:!0});class Mi extends Li{_createLabel(){return new Pi(this)}_createTickModel(){return new Ni(this)}collectValues(){super.collectValues(),this._values=this._values.filter((t=>t>0))}getPos(t,e){return e=e>0?g(e):-1,super.getPos(t,e)}_doCalculateRange(t){const e=super._doCalculateRange(t);return e.min=g(e.min),e.max=g(e.max),e}_createTick(t,e,s){return super._createTick(t,e,I(p(s)))}_calcUnitLen(t,e,s,i){let r=g(t[1])-g(t[0]);for(let e=2;e<t.length;e++)r=m(r,g(t[e])-g(t[e-1]));const n=i-s,a=r/n;return{len:x(e*=a,1),min:n*a}}}Mi.type="log";const Ti=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Ri=[[1,2,5,10,20,25,50,100,200,250,500],[1,2,5,10,15,30],[1,2,3,4,6,8,12],[1,2,3,4,6,12],[1,2],[1,2],[1,2,3,4,6]],Oi={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Bi extends Si{getNextStep(t,e){const s=new Date(t);switch(e*=this._step,this._scale){case 7:s.setFullYear(s.getFullYear()+e);break;case 6:s.setMonth(s.getMonth()+e);break;case 5:s.setDate(s.getDate()+7*e);break;case 4:s.setDate(s.getDate()+e);break;case 3:s.setHours(s.getHours()+e);break;case 2:s.setMinutes(s.getMinutes()+e);break;case 1:s.setSeconds(s.getSeconds()+e);break;case 0:s.setMilliseconds(s.getMilliseconds()+e)}return+s}_isValidInterval(t){return isNaN(t)?n(t)&&Oi.hasOwnProperty(t.charAt(t.length-1))?(t=parseFloat(t),!isNaN(t)&&(t<=-1||t>=1)):void 0:0!=+t}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Ti[e]/2&&t<Ti[e+1]/2)return this._scale=e,Ri[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],a=r-i;if(0===a)return n;const o=this.axis,h=new Date(o._calcedMin);let l=Math.floor(t/this._op.stepPixels)+1,_=f(1,Math.floor(a/(l-1)));const c=this._getStepMultiples(_),d=Ti[this._scale];if(_/=d,c)if(_>c[0]){let t=0;for(;t<c.length-1;t++)if(_>c[t]&&_<c[t+1]){_=c[t+1];break}}else _=c[0];const u=o.date(i),p=o.date(r);let g,m=u;if(7===this._scale){const t=h.getFullYear();let e=m.getFullYear();this._step=_=Math.ceil(_),m=new Date(e,0),e<t&&e+_>t&&(e=t,m=new Date(e,0));do{n.push(+m),e+=_,m=new Date(e,0)}while(m<=p)}else if(6===this._scale){let t=m.getFullYear(),e=m.getMonth();this._step=_=Math.ceil(_),m=new Date(t,e),m<h&&new Date(t,e+_)>h&&(e=h.getMonth(),m=new Date(h.getFullYear(),e));do{n.push(+m),m.setMonth(m.getMonth()+_)}while(m<=p)}else if(4===this._scale||5===this._scale){let t=m.getFullYear(),e=m.getMonth(),s=m.getDate();const i=5===this._scale?7:1;this._step=_=Math.ceil(_),m=new Date(t,e,s),m<h&&new Date(t,e,s+i*_)>h&&(s=h.getDate(),m=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+m),m.setDate(m.getDate()+_*i)}while(m<=p)}else{switch(this._step=_,_*=d,this._scale){case 3:m.setMinutes(0);case 2:m.setSeconds(0);case 1:m.setMilliseconds(0)}g=m.getTime();const t=h.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,s,i){if(n(t)){const r=this.axis,n=new Date(r._calcedMin),a=[],o=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=Oi[o],t=Ti[this._scale];let c=new Date(s);switch(this._scale){case 7:const t=n.getFullYear();let e=c.getFullYear();c.setMonth(0,1),e<t&&t<e+h&&(c=new Date(t,0));break;case 6:c.setDate(1),c.setHours(0,0,0,0),_=new Date(c),_.setMonth(_.getMonth()+h),c<n&&n<_&&(c=new Date(n),c.setDate(1),c.setHours(0,0,0,0));break;case 5:case 4:let s=5===this._scale?7:1;c.setHours(0,0,0,0),_=new Date(c),_.setDate(_.getDate()+h*s),c<n&&_>n&&(c=new Date(n),c.setHours(0,0,0,0));break;case 3:c.setMinutes(0);case 2:c.setSeconds(0);case 1:c.setMilliseconds(0)}if(this._step=h,s=+c,isNaN(e))for(a.push(l=s);l<i;)a.push(l=this.getNextStep(l,1));else{for(a.push(l=e);l>s;)a.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)a.push(l=this.getNextStep(l,1))}return this._step=t,a}return super._getStepsByInterval(t,e,s,i)}}const Di=[{format:"SSS",beginningFormat:"mm:ss"},{format:"ss",beginningFormat:"mm:ss"},{format:"mm:ss",beginningFormat:"HH:mm:ss"},{format:"HH:mm",beginningFormat:"MM-dd HH:mm"},{format:"MM-dd",beginningFormat:"yyyy-MM-dd"},{format:"MM W주",beginningFormat:"yyyy-MM-dd"},{format:"yyyy-MM",beginningFormat:"yyyy-MM"},{format:"yyyy",beginningFormat:"yyyy"}];class $i extends ki{_doApply(t){super._doApply(t);const e=n(t.timeFormat)?t.timeFormat:void 0,r=n(t.beginningFormat)?t.beginningFormat:void 0,o=t.timeFormats,h=t.useBeginningFormat;if(this._formats=Di.map((t=>l(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&r&&this._formats.forEach((t=>{t.beginningFormat=r})),i(o))for(let t=0;t<o.length;t++){const e=this._formats[t],i=o[t];a(i)?e.format=i:s(i)&&(a(i.format)&&(e.format=i.format),h&&a(i.beginningFormat)&&(e.beginningFormat=i.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);if(this._formatter)return this._formatter.toStr(r,s.startOfWeek);const n=this._formats,a=i.tick._scale,o=Mt.getFormatter;switch(a){case 7:return o(n[a].format).toStr(r,s.startOfWeek);case 6:return 0===t||0===r.getMonth()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 5:case 4:return 0===t||1===r.getDate()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 3:return 0===t||0===r.getHours()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 2:return 0===t||0===r.getMinutes()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 1:return 0===t||0===r.getSeconds()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek);case 0:return 0===t||0===r.getMilliseconds()?o(n[a].beginningFormat).toStr(r,s.startOfWeek):o(n[a].format).toStr(r,s.startOfWeek)}}}$i.defaults=fe(ki.defaults,{useBeginningFormat:!0});class zi extends Li{get label(){return this._label}_createTickModel(){return new Bi(this)}_createLabel(){return new $i(this)}collectValues(){this._offset=60*x(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return o(t)?t:t instanceof Date?t.getTime():n(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(n(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXValue(t){return isNaN(t)?NaN:new Date(t)}}zi.type="time",zi.subtype="date",zi.defaults=fe(Li.defaults,{baseValue:NaN});const Fi="bullet",Ii="circle",Hi="linear";class Gi extends _s{getWidth(t){return K(this._widthDim,t)}getHeight(t){return K(this._heightDim,t)}getMaxWidth(t){return K(this._maxWidthDim,t)}getMaxHeight(t){return K(this._maxHeightDim,t)}getGap(t){return K(this._gapDim,t,0)}_doApply(t){super._doApply(t),this._setDims(t,"width","height","maxWidth","maxHeight","gap")}}Gi.defaults=fe(_s.defaults,{maxWidth:"30%",maxHeight:"30%",gap:10});class ji extends rs{_doInitChildren(t){super._doInitChildren(t),t.label=(this._label=new Gi(this.chart)).init(),t.scale=(this._scale=new cs(this)).init()}get label(){return this._label}get scale(){return this._scale}isVertical(){return this._group?this._group.options.vertical:this._op.vertical}scaleVisible(){return!this._group&&this._scale.visible}calcedMinMax(){return this._scale.range()}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}}ji.defaults=fe(rs.defaults,{reversed:!1});class Wi extends ts{constructor(){super(...arguments),this._args={gauge:null,value:NaN}}getStyle(t,e){if(this._op.styleCallback){this._args.gauge=t,this._args.value=e;return this._op.styleCallback(this._args)}}}class Xi extends ji{_doInitChildren(t){super._doInitChildren(t),t.valueBar=(this._valueBar=new Wi(this)).init(),t.band=(this._band=new ls(this)).init()}get valueBar(){return this._valueBar}get band(){return this._band}}Xi.type=Hi;class Yi extends xe{}Yi.defaults=fe(xe.defaults,{opposite:!1,gap:10});class Ui extends Gi{}Ui.defaults=fe(Gi.defaults,{gap:10});class Zi extends ss{_doInitChildren(t){super._doInitChildren(t),t.label=(this._label=new Ui(this.chart)).init(),t.itemLabel=(this._itemLabel=new Yi(this.chart)).init(),t.scale=(this._scale=new cs(this)).init()}get label(){return this._label}get itemLabel(){return this._itemLabel}get scale(){return this._scale}calcedMinMax(){return this.scale.range()}}Zi.defaults=fe(ss.defaults,{vertical:!1,itemGap:10});class qi extends Zi{_doInitChildren(t){super._doInitChildren(t),t.band=(this._band=new ls(this)).init()}get band(){return this._band}_gaugesType(){return"linear"}_doPrepareRender(t){super._doPrepareRender(t),this.band.visible&&this.band._prepareRender()}}qi.type="lineargroup",qi.gaugeType=Hi;class Ki extends xe{constructor(t){super(t.chart),this.gauge=t}getRanges(){var t;return null===(t=this.$_internalRanges())||void 0===t?void 0:t.slice(0)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null)}$_internalRanges(){if(!this._runRanges){const t=this.gauge.options;this._runRanges=rt(this._ranges,t.minValue,t.maxValue,this._op.rangeInclusive)}return this._runRanges}}Ki.defaults=fe(xe.defaults,{vertical:!0,rangeInclusive:!0});class Qi extends ts{}Qi.defaults=fe(xe.defaults,{visible:!0});class Ji extends Wi{}class tr extends ji{_doInitChildren(t){super._doInitChildren(t),t.band=(this._band=new Ki(this)).init(),t.targetBar=(this._targetBar=new Qi(this)).init(),t.valueBar=(this._valueBar=new Ji(this)).init()}get band(){return this._band}get targetBar(){return this._targetBar}get valueBar(){return this._valueBar}getRanges(t,e,s){return rt(this._op.ranges,t,e,b(s,this._op.rangeInclusive))}}tr.type=Fi,tr.defaults=fe(ji.defaults,{rangeInclusive:!0});class er extends Zi{getRanges(t,e,s){return rt(this._op.ranges,t,e,b(s,this._op.rangeInclusive))}_gaugesType(){return"bullet"}}er.type="bulletgroup",er.gaugeType=Fi,er.defaults=fe(Zi.defaults,{rangeInclusive:!0});class sr extends ts{getRange(t,e){const s=this.$_internalRanges(t);if(s)for(const t of s)if(e>=t.fromValue&&e<t.toValue)return t}_doApply(t){const e=this;var s;super._doApply(t),(s=t.ranges)!==e._ranges&&(e._ranges=s,e._runRanges=null)}$_internalRanges(t){return this._runRanges||(this._runRanges=rt(this._ranges,t.minValue,t.maxValue,this._op.rangeInclusive)),this._runRanges}}sr.defaults=fe(xe.defaults,{rangeInclusive:!0});class ir extends sr{getSegmentThickness(t){return K(this._segmentThicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentThickness")}}ir.defaults=fe(sr.defaults,{segmentGap:0});class rr extends sr{getThickness(t){return K(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}rr.defaults=fe(sr.defaults,{thickness:"100%",stroked:!1});(class extends ts{}).defaults=fe(xe.defaults,{visible:!1});class nr extends ts{getExtents(t){return{radius:K(this._radiusDim,t,0),length:K(this._lengthDim,t,0),offset:K(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}nr.defaults=fe(xe.defaults,{visible:!1,radius:3,length:"100%",offset:0});class ar extends ts{getRadius(t){return K(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}ar.defaults=fe(xe.defaults,{visible:!1,radius:5});class or extends os{_getStepMultiples(t){return[1,2,2.5,5,10]}}or.defaults=fe(os.defaults,{visible:!1,stepPixels:72});class hr extends ps{_doInitChildren(t){super._doInitChildren(t),t.band=(this._band=new ls(this)).init(),t.scale=(this._scale=new or(this)).init(),t.rim=(this._rim=new ir(this)).init(),t.valueRim=(this._valueRim=new rr(this)).init(),t.hand=(this._hand=new nr(this)).init(),t.pin=(this._pin=new ar(this)).init()}get band(){return this._band}get scale(){return this._scale}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}getExtents(t){const e=super.getExtents(t),s=this.scale,i=this.band;let r=e.radius;const n=r-e.inner;if(i.visible)switch(e.bandThick=i.getThickness(n),i.options.position){case"inside":e.band=r-(n-e.bandThick)/2;break;case"opposite":e.band=e.inner-i.options.gap,e.inner=e.band-e.bandThick;break;default:e.band=r+=e.bandThick+i.options.gap}if(e.scaleTick=f(1,s.tick.options.length||0),e.scaleLabel=16,"opposite"===s.options.position)e.scale=e.inner-s.options.gap,e.inner=e.scale-e.scaleTick-e.scaleLabel;else e.scale=r+s.options.gap;return e}}hr.type=Ii;class lr extends gs{_gaugesType(){return"circle"}}lr.type="circlegroup",lr.gaugeType=Ii,lr.defaults=fe(gs.defaults,{innerRadius:"50%"});class _r extends ts{getThickness(t){return K(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}_r.defaults=fe(xe.defaults,{thickness:7});class cr extends ts{getLength(t){return K(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}cr.defaults=fe(xe.defaults,{thickness:7,length:"60%"});class dr extends cr{}dr.defaults=fe(cr.defaults,{thickness:5,length:"85%"});class ur extends cr{}ur.defaults=fe(cr.defaults,{thickness:2,length:"95%",animatable:!1,duration:200});class pr extends ts{constructor(t,e){super(t),this.length=e}}class gr extends ts{}gr.defaults=fe(xe.defaults,{step:1,offset:1});class mr extends ts{constructor(t,e){super(t),this.raidus=e}}class fr extends be{constructor(t){super(t.chart)}}fr.defaults=fe(be.defaults,{text:"RealChart Clock<br>ver1.0",position:"top"});class wr extends es{_doInitChildren(t){super._doInitChildren(t),t.rim=(this.rim=new _r(this)).init(),t.hourHand=(this.hourHand=new cr(this)).init(),t.minuteHand=(this.minuteHand=new dr(this)).init(),t.secondHand=(this.secondHand=new ur(this)).init(),t.tick=(this.tick=new pr(this,10)).init(),t.minorTick=(this.minorTick=new pr(this,5)).init(),t.tickLabel=(this.tickLabel=new gr(this)).init(),t.pin=(this.pin=new mr(this,5)).init(),t.label=(this.label=new fr(this)).init()}getTime(){const t=this._op;return t.time instanceof Date?t.time:n(t.time)?new Date(t.time):isNaN(t.time)?void 0:new Date(t.time)}getExtents(t,e){const s=m(t,e);return{cx:K(this._centerXDim,t,t/2),cy:K(this._centerYDim,e,e/3),rd:K(this._radiusDim,s,s/2)}}_doApply(t){const e=this;var s,i,r;super._doApply(t),s=t.centerX,i=t.centerY,r=t.radius,(e._centerXDim||s!==e._centerX)&&(e._centerXDim=Z(b(e._centerX=s,ps.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=Z(b(e._centerY=i,ps.DEF_CENTER),!0)),e._radiusDim&&r===e._radius||(e._radiusDim=Z(b(e._radius=r,ps.DEF_RADIUS),!0))}}wr.type="clock",wr.defaults=fe(es.defaults,{centerX:"50%",centerY:"50%",radius:"40%",active:!0});const xr="line",yr="area",br="circlebar";class vr extends ii{pointLabelCount(){return 2}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Os(t)}_getBottomValue(t){return t.lowValue}}vr.type="barrange",vr.defaults=fe(ii.defaults,{tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Vr extends Ms{}class Sr extends ei{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Vr(t)}_getGroupBase(){return this._group?this._group.options.baseValue:this._op.baseValue}}Sr.defaults=fe(ei.defaults,{colorByPoint:!1});class kr extends Sr{_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}}kr.type="bar";class Pr extends ai{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:x(this._op.baseValue,t.getBaseValue())}_doPrepareSeries(t){if("default"===this._op.layout){const e=t.length>1?t.map((t=>t.options.pointWidth)).reduce(((t,e)=>t+e),0):t[0].options.pointWidth;let s=0;t.forEach((t=>{t._childWidth=t.options.pointWidth/e,t._childPos=s,s+=t._childWidth}))}else this._op.layout}}Pr.defaults=fe(ai.defaults,{baseValue:0});class Cr extends Pr{_canContain(t){return t instanceof kr}}Cr.type="bargroup",Cr.seriesType="bar";class Ar extends It{constructor(t,e){super(t,Ys.LEGEND_MARKER),this._size=e,this.add(this._marker=new Xt(t)),this.setShape("circle",12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}_renderShape(t){As.setShape(this._marker,this._shape,t/2,t/2),this._marker.trans(this._markerOffset(t),0)}_markerOffset(t){return 0}}class Lr extends Ar{constructor(t,e){super(t,e),this.insertFirst(this._line=new Xt(t)),this.insertFirst(this._area=new Xt(t)),this._area.setBoolData("fill",!0)}_renderShape(t){super._renderShape(t);const e=["M",0,.5*t,"L",2*t,0],s=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(e.join(" ")),this._area.setPath(s.join(" ")))}_markerOffset(t){return t/2}}class Er extends Ar{constructor(t,e){super(t,e),this.insertFirst(this._line=new Xt(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Xt(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Xt(t)),this._area.setBoolData("fill",!0)}_renderShape(t){super._renderShape(t);const e=["M",0,.3*t,"L",.7*t,0,"L",2*t,.4*t],s=["M",0,t,"L",t,.7*t,"L",2*t,t],i=["M",0,.3*t,"L",.7*t,0,"L",2*t,.4*t,"L",2*t,t,"L",t,.7*t,"L",0,t,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(e.join(" ")),this._line2.setPath(s.join(" ")),this._area.setPath(i.join(" ")))}_markerOffset(t){return t/2}}class Nr extends Xt{constructor(t,e=T,s=T){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){k.isNumber(t)?this.setPath(As.line(t,e,s,i)):t&&this.setPath(As.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(As.line(t,e,t,s))}setVLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(As.line(t,e,t,s))}setHLine(t,e,s){this.setPath(As.line(e,t,s,t))}setHLineC(t,e,s){const i=parseFloat(this.getStyle("stroke-width"));isNaN(i)||(t=Math.round(t)-i%2/2),this.setPath(As.line(e,t,s,t))}}class Mr extends Ar{constructor(t,e){super(t,e),this.insertFirst(this._line=new Nr(t))}_renderShape(t){super._renderShape(t),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setHLine(t/2,0,2*t),this._shape&&this._line.setStyle("strokeDasharray",""))}_markerOffset(t){return t/2}}class Tr extends Ms{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Rr extends qs{}Rr.defaults=fe(qs.defaults,{radius:4,hoverScale:1.75});class Or extends Hs{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Or.ALIGN_GAP:0:t}}Or.ALIGN_GAP=4,Or.defaults=fe(Hs.defaults,{position:"head",align:"center"});class Br extends Zs{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new Rr(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this.marker.options.shape||this._shape:null}getRadius(t){return x(t.radius,this.marker.options.radius)}prepareLines(t){this._lines=this._doPrepareLines(t)}get pointLabel(){return this._pointLabel}_createLabel(t){return new Or(t)}_createPoint(t){return new Tr(t)}hasShape(){return!0}setShape(t){this._shape=t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Mr(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),m(e,2*this.marker.options.radius)),s}_doPrepareLines(t){const e=t.length,s=[];if(this._containsNull){let i=0;for(;i<e;){const r=[];for(;t[i].isNull&&i<e;)i++;for(;i<e&&!t[i].isNull;)r.push(t[i++]);r.length>0&&s.push(r)}}else s.push(t.slice());return s}}Br.defaults=fe(Ys.defaults,{nullAsBase:!1});class Dr extends ve{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}Dr.defaults=fe(ve.defaults,{visible:!1,offset:8});class $r extends Br{_doInitChildren(t){super._doInitChildren(t),t.flag=(this._flag=new Dr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isMarker(){return!0}getLineType(){return this._group instanceof jr||this._group instanceof Wr?this._group.options.lineType:this._op.lineType}getBaseValue(t){return t._isX?NaN:this._base}_doPrepareRender(){super._doPrepareRender(),this._base=y(this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue,this._yAxisObj.getBaseValue(),0)}}$r.type=xr,$r.defaults=fe(Br.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1});class zr extends $r{_viewType(){return"line"}getLineType(){return"spline"}}zr.type="spline";class Fr extends Tr{}class Ir extends $r{_doInitChildren(t){super._doInitChildren(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>0){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=x(t[0].yLow,t[0].py),e.push(s)}return e}const e=this._group,s=this._lines,i=this._areas=[];if(e&&e._stacked){const e=[].concat(...s);i.push(e),i.push(t(e))}else s.forEach((e=>{const s=e.slice(0);i.push(s),i.push(t(s))}))}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return new Lr(t,e)}_createPoint(t){return new Fr(t)}_doPrepareLines(t){if(this._containsNull&&this._group&&this._group._stacked){const e=t.length,s=[];let i=0;for(;i<e;){const r=t[i].isNull,n=[];do{n.push(t[i++])}while(i<e&&t[i].isNull==r);s.push(n)}return s}return super._doPrepareLines(t)}}Ir.type=yr;class Hr extends Fr{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return l(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=e.length>2?1:0;this.low=e[x(t.options.lowField,0+s)],this.y=e[x(t.options.yField,1+s)],s>0&&(this.x=e[x(t.options.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=b(e[t.options.lowField],e.low),this.y=v(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class Gr extends Br{_createLegendMarker(t,e){return new Er(t,e)}_createPoint(t){return new Hr(t)}getLineType(){return this._op.curved?"spline":"default"}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._runPoints.forEach((t=>!t.isNull&&e.push(t.lowValue)))}_doPrepareLines(t){const e=super._doPrepareLines(t),s=[];return e.forEach((t=>{const e=[];for(let s=t.length-1;s>=0;s--){const i=t[s],r=i.toPoint();r.py=i.yLow,e.push(r)}s.push(t,e)})),s}}Gr.type="arearange",Gr.defaults=fe(Br.defaults,{curved:!1,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class jr extends ri{_canContain(t){return t instanceof $r}getBaseValue(t){return t===this._yAxisObj?y(this._op.baseValue,t.getBaseValue(),0):NaN}}jr.type="linegroup",jr.seriesType=xr,jr.defaults=fe(ri.defaults,{lineType:"default"});class Wr extends ri{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const s=this._visibles[e-1],i=t._areas,r=s._areas;for(let t=0;t<i.length;t+=2)i[t+1]=r[t].reverse();this._op.layout}}}_canContain(t){return t instanceof Ir}getBaseValue(t){return t===this._yAxisObj?y(this._op.baseValue,t.getBaseValue(),0):NaN}}Wr.type="areagroup",Wr.seriesType=yr,Wr.defaults=fe(ri.defaults,{lineType:"default"});class Xr extends Fr{}class Yr extends Ir{getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Xr(t)}_doLoadData(t){const e=super._doLoadData(t);if(i(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return t.referBy(this),!0}reference(t,e){if(!e._isX){const e=t._runPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this._loadTable(e);this._doLoadPoints(s),this._runPoints=this._points.getPoints(this._xAxisObj,this._yAxisObj),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}_loadTable(t){const e=function(t,e,s){const i=s-t;return{x:s,y:Math.exp(-i*i/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},s=t.length;if(s<1)return;const i=this._op,r=t.reduce(((t,e)=>t+e),0)/s,n=Math.sqrt(t.reduce(((t,e)=>t+Math.pow(e-r,2)))/(s-1)),a=n/i.pointsInSigma,o=r-i.sigmas*n,h=r+i.sigmas*n;let l=r;const _=[];for(_.push(e(r,n,l));l>o;)l-=a,_.unshift(e(r,n,l));for(l=r;l<h;)l+=a,_.push(e(r,n,l));return _}}Yr.type="bellcurve",Yr.defaults=fe(Ir.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Ur extends Ms{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return l(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.min=e[x(s.minField,0+i)],this.low=e[x(s.lowField,1+i)],this.mid=e[x(s.midField,2+i)],this.high=e[x(s.highField,3+i)],this.y=e[y(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=b(e[s.minField],e.min),this.low=b(e[s.lowField],e.low),this.mid=b(e[s.midField],e.mid),this.y=v(e[s.highField],e.high,this.y),this.minLabel=e.minLabel}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}initValues(){this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high)}initPrev(t,e){e.yValue=e.highValue=e.midValue=e.lowValue=e.minValue=this.minValue}applyValueRate(t,e){this.minValue=V(t.minValue,this.minValue,e),this.lowValue=V(t.lowValue,this.lowValue,e),this.midValue=V(t.midValue,this.midValue,e),this.highValue=V(t.highValue,this.highValue,e)}}class Zr extends ii{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Ur(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}}Zr.type="boxplot",Zr.defaults=fe(ii.defaults,{tooltipText:"<b>${name}</b><br>min: <b>${minValue}</b><br>low: <b>${lowValue}</b><br>mid: <b>${midValue}</b><br>high: <b>${highValue}</b><br>max: <b>${maxValue}</b>"});class qr extends Rs{}class Kr extends oi{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:K(this._minSizeDim,t),max:K(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new qr(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=m(t,s.zValue),e=f(e,s.zValue))})),this._noSize=(this._zMin=t)===(this._zMax=e)}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}}Kr.type="bubble",Kr.defaults=fe(oi.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>"});class Qr extends ni{_canContain(t){return t instanceof $r}_doConstraintYValues(t){const e={};t.forEach((t=>{t._runPoints.forEach((t=>{const s=t.xValue,i=e[s];i?i.push(t):e[s]=[t]}))}));for(const t in e)e[t].sort(((t,e)=>t.yValue-e.yValue)).forEach(((t,e)=>{t.yLabel=b(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return k.makeIntArray(0,t.length)}}Qr.type="bump",Qr.seriesType=xr;const Jr=function(t){return isNaN(t)?0:t};class tn{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}end(t=!1){return this._path.length>0?(t&&this._path.push("Z"),this._path.join(" ")):""}close(t){const e=this.end(!0);return t&&this.clear(),e}move(t,e){return o(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return o(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return o(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return o(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Jr(t[e]),Jr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Jr(t[e].x),Jr(t[e].y));return this}polygon(...t){return o(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s}, ${e} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 ${2*-s},0`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const s={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),s}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const s={x1:this._path[t+1],y1:this._path[t+2],x2:this._path[t+3],y2:this._path[t+4]};return e&&this._path.splice(t,5),s}}getPoints(t,e,s=!0){const i=[];for(;t<this._path.length&&i.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)i.push({x:this._path[t+1],y:this._path[t+2]}),s&&this._path.splice(t,3);return i}}class en extends Ms{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return l(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[x(s.xField,0)]),this.low=e[x(s.lowField,0+i)],this.close=e[x(s.closeField,1+i)],this.open=e[x(s.openField,2+i)],this.y=e[y(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=b(e[s.lowField],e.low),this.open=b(e[s.openField],e.open),this.close=b(e[s.closeField],e.close),this.y=v(e[s.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}initValues(){this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close)}initPrev(t,e){e.yValue=e.lowValue=e.openValue=e.closeValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e),this.openValue=V(t.openValue,this.openValue,e),this.closeValue=V(t.closeValue,this.closeValue,e)}}class sn extends ii{canCategorized(){return!0}_createPoint(t){return new en(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new tn;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new Xt(t,Ys.LEGEND_MARKER,s.end())}}sn.type="candlestick",sn.defaults=fe(ii.defaults,{tooltipText:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class rn extends Hs{}rn.defaults=fe(Hs.defaults,{position:"inside"});class nn extends Sr{get pointLabel(){return this._pointLabel}_createLabel(t){return new rn(t)}}nn.type=br;class an extends Pr{_canContain(t){return t instanceof nn}}an.type="circlebargroup",an.seriesType=br;class on extends Os{}class hn extends qs{}hn.defaults=fe(qs.defaults,{radius:4,shape:"circle"});class ln extends ii{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new hn(this)).init(),t.lowMarker=(this._lowMarker=new hn(this)).init()}get marker(){return this._marker}get lowMarker(){return this._lowMarker}canCategorized(){return!0}_getBottomValue(t){return t.lowValue}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+f(0,this.marker.options.radius)}_createPoint(t){return new on(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=x(e.radius,s),n=e.shape||i;this._runPoints.forEach((t=>{t.radius=s,t.shape=i,t.lowRadius=r,t.lowShape=n}))}}ln.type="dumbbell";class _n extends Ms{}class cn extends ei{getSegmentSize(t){return K(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new _n(t)}_createLegendMarker(t,e){const s=new tn;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new Xt(t,Ys.LEGEND_MARKER,s.end())}}cn.type="equalizer",cn.defaults=fe(ei.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class dn extends ii{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Os(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new tn).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new Xt(t,Ys.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}dn.type="errorbar",dn.defaults=fe(ii.defaults,{pointPadding:.3,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class un extends Ks{}class pn extends Qs{getSize(t,e){return{width:f(.1*t,K(this._widthDim,t)),height:f(.1*e,K(this._heightDim,e))}}getNeckSize(t,e){return{width:k.clamp(K(this._neckWidthDim,t),.1*t,t),height:k.clamp(K(this._neckHeightDim,e),.1*e,e)}}_createPoint(t){return new un(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=q(e._width,pn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=q(e._height,pn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=q(e._neckWidth,pn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=q(e._neckHeight,pn.defaults.neckHeight))}(t.neckHeight)}}pn.type="funnel",pn.defaults=fe(Qs.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",legendByPoint:!1});class gn extends Rs{}class mn extends Zs{getColor(t){}canMixWith(t){return!1}canCategorized(){return!0}hasZ(){return!0}defYAxisType(){return"category"}_createPoint(t){return new gn(t)}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((s=>{isNaN(s.zValue)||(t=m(t,s.zValue),e=f(e,s.zValue))})),this._heatMin=t,this._heatMax=e}}mn.type="heatmap",mn.defaults=fe(Ys.defaults,{tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>heat: <b>${z}</b>"});class fn extends Ms{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return l(super._assignTo(t),{min:this.min,max:this.max})}}const wn={squreRoot:function(t){return Math.ceil(Math.sqrt(t))},struges:function(t){return Math.ceil(Math.log(t)*Math.LOG2E)},rice:function(t){return Math.ceil(2*Math.pow(t,1/3))}};class xn extends Zs{getBinCount(t){const e=x(this._op.binWidth,0);if(e>0)return t/e;return x(this._op.binsNumber,0)<1?wn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new fn(t)}_doLoadPoints(t){function e(t){let e;return e=i(t)?t[x(this.yField,0)]:s(t)?v(t[this.yField],t.y,t.value):t,parseFloat(e)}const r=this._op,n=[];let a=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||a.push(i)}if(a.length>0){a=a.sort(((t,e)=>t-e)),r.minValue<a[0]&&a.unshift(r.minValue),r.maxValue>a[a.length-1]&&a.push(r.maxValue);const t=a.length,e=a[0],s=a[t-1],i=this.getBinCount(t),o=this._binInterval=(s-e)/i;let h=0,l=e,_=l+o;for(let e=0;e<i;e++){let r=0;if(e==i-1)r=t-h;else for(;h<t&&a[h]<_;)r++,h++;n.push({x:l,y:r,min:l,max:e===i-1?s:_}),l=_,_=l+o}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._runPoints[this._runPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=x(this._op.baseValue,this._yAxisObj.getBaseValue())}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}}xn.type="histogram",xn.defaults=fe(Ys.defaults,{baseValue:0,binsNumber:"squreRoot"});class yn extends qs{}yn.defaults=fe(qs.defaults,{radius:4,shape:"circle"});class bn extends Ms{}class vn extends ei{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new yn(this)).init()}get marker(){return this._marker}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new bn(t)}_doPrepareRender(){super._doPrepareRender();const t=this.marker.options.radius,e=this.marker.options.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e}))}}vn.type="lollipop";class Vn extends en{}class Sn extends sn{_createPoint(t){return new Vn(t)}_createLegendMarker(t,e){const s=new tn;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new Xt(t,Ys.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}}Sn.type="ohlc";class kn extends Tr{}class Pn extends Br{getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new kn(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return t.referBy(this),!0}reference(t,e){if(!e._isX){const e=this;(function(t){const s=[],i=t.reduce(((t,e)=>t+x(e.yValue,0)),0);let r=0;t.forEach((t=>{t.isNull||s.push({x:t.xValue,y:r+=100*t.yValue/i})})),e._doLoadPoints(s),e._runPoints=e._points.getPoints(e._xAxisObj,e._yAxisObj)})(t._runPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}Pn.type="pareto",Pn.defaults=fe(Br.defaults,{curved:!1});class Cn extends Ks{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}get thickness(){return this._thickness}set thickness(t){t!==this._thickness&&(this._thickness=t,this._thickDim=Z(t,!0))}parse(t){super.parse(t),this.sliced=this.source.sliced,this.isNull=this.isNull||this.y<0}_assignTo(t){return l(super._assignTo(t),{sliced:this.sliced})}}class An extends ve{getDefaultIconPos(){return"left"}}class Ln extends Hs{}Ln.defaults=fe(Hs.defaults,{visible:!0});class En extends Js{_doInitChildren(t){super._doInitChildren(t),t.innerText=(this._innerText=new An(this.chart)).init()}get innerText(){return this._innerText}followPointer(){return!0}hasInner(){return this._innerRadiusDim&&this._innerRadiusDim.size>0}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}getSliceOffset(t){return!this._group&&this._sliceOffsetDim?K(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new Ln(t)}_createPoint(t){return new Cn(t)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset")}_doPrepareRender(){super._doPrepareRender();let t=x(this._op.startAngle%360,0),e=f(0,m(360,x(this._op.totalAngle,360)));this._startRad=B+D*t,this._totalRad=D*e,this._groupPos=NaN}}En.type="pie",En.defaults=fe(Js.defaults,{groupSize:1,labelDistance:25,sliceOffset:"7%",autoSlice:!0,sliceDuration:300,borderRadius:0});class Nn extends ri{getPolarSize(t,e){return K(this._polarDim,m(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}_doApply(t){const e=this;var s;super._doApply(t),(s=t.polarSize)!==e._polarSize&&(e._polarSize=s,e._polarDim=Z(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=Z(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof En}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+x(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=x(t.options.groupSize,1)/e}))}}Nn.type="piegroup",Nn.seriesType="pie",Nn.defaults=fe(ri.defaults,{polarSize:"80%",innerSize:0});class Mn extends Ms{}class Tn extends oi{_createPoint(t){return new Mn(t)}_createLegendMarker(t,e){return new Ar(t,e)}_colorByPoint(){return this._op.colorByPoint}setShape(t){this._defShape=t}getShape(t){return this._op.shape||this._defShape}hasShape(){return!0}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),m(e,2*this._op.radius)),s}}Tn.type="scatter",Tn.defaults=fe(oi.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Rn extends Ms{_assignTo(t){return l(super._assignTo(t),{id:this.id,group:this.group})}_readArray(t,e){if(e.length<=2)this.isNull=!0;else{const s=e.length>3?1:0;s>0&&(this.x=e[x(t.options.xField,0)]),this.y=e[x(t.options.yField,0+s)],this.id=G(e[x(t.options.idField,1+s)]),this.group=G(e[x(t.options.groupField,2+s)])}}_readObject(t,e){super._readObject(t,e),this.id=G(e[t.options.idField]),this.group=G(e[t.options.groupField])}}(class extends xe{constructor(t){super(t.chart),this.level=t,this.floating=!0}}).defaults=fe(xe.defaults,{visible:!1});class On{constructor(t){this.point=t}level(){return this.parent?this.parent.level()+1:0}getArea(){return{x:this.x,y:this.y,width:this.width,height:this.height}}setArea(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}getTotal(){return this.children.reduce(((t,e)=>t+e.value),0)}}class Bn extends Ys{constructor(){super(...arguments),this._map={},this._levels=1}buildMap(t,e){function s(t){if(t.children){let e=0;t.children.forEach(((t,i)=>{s(t),e+=t.value})),t.value=e,t.children=t.children.sort(((t,e)=>e.value-t.value)),t.children.forEach(((t,e)=>{t.index=e})),n=f(n,t.level()+1+1)}else r.push(t),t.value=t.point?t.point.yValue:0}const i="vertical"===this._op.startDir||e>t,r=this._leafs=[];let n=1;return this._roots.forEach(((t,e)=>{s(t)})),this._roots=this._roots.sort(((t,e)=>e.value-t.value)),this._roots.forEach(((t,e)=>{t.index=e})),(this[this._op.algorithm]||this.squarify).call(this,this._roots,t,e,i),this._levels=n,{roots:this._roots,leafs:this._leafs}}needAxes(){return!1}canMixWith(t){return!1}_createPoint(t){return new Rn(t)}_getLabeledPoints(){return this._leafs.map((t=>t.point))}_doPrepareRender(){super._doPrepareRender(),this._roots=this.$_buildTree(this._runPoints)}$_buildTree(t){const e=[],s=[],i=this._map;t.forEach((t=>{if(t.id||!t.isNull){const r=new On(t);t.id&&(i[t.id]=r),t.group?s.push(r):e.push(r)}}));for(let t=s.length-1;t>=0;t--){const r=s[t],n=i[r.point.group];(r.parent=n)?(n.children||(n.children=[]),n.children.push(r),r.children&&s.splice(t,1)):(e.push(r),s.splice(t,1))}return e}$_squarifyRow(t,e,s,i){const r=e.width*e.height,n=e.width,a=e.height;let o=e.x,h=e.y,l=Number.MAX_VALUE,_=0;const c=[];if(2===t.length){return(1===s?n>a:n>=a)?t.forEach((t=>{t.setArea(o,h,n*t.value/i,a),o+=t.width})):t.forEach((t=>{t.setArea(o,h,n,a*t.value/i),h+=t.height})),0}for(;t.length>0;){let d,u,p,g,m;if(d=t.shift(),_+=d.value,g=_*r/i,1===s?(u=g/a,p=a*d.value/_):(p=g/n,u=n*d.value/_),m=f(u/p,p/u),t.length>0&&m>l)return t.unshift(d),_-=d.value,g=r*_/i,1===s?(p=a,u=g/p):(u=n,p=g/u),c.forEach((t=>{1===s?(t.setArea(o,h,u,a*t.value/_),h+=t.height):(t.setArea(o,h,n*t.value/_,p),o+=t.width)})),1===s?(e.x+=u,e.width-=u):(e.y+=p,e.height-=p),i-_;if(0===t.length)return g=r*_/i,1===s?(p=a,u=g/p):(u=n,p=g/u),c.push(d),c.forEach((t=>{1===s?(t.setArea(o,h,u,a*t.value/_),h+=t.height):(t.setArea(o,h,n*t.value/_,p),o+=t.width)})),0;l=m,c.push(d)}}$_squarify(t,e,s,i){const r=t.slice(0);let n=s?1:0,a=t.reduce(((t,e)=>t+e.value),0);do{a=this.$_squarifyRow(r,e,n,a),i&&(n=1-n)}while(a>0);t.forEach((t=>{t.children&&this.$_squarify(t.children,t.getArea(),!s,!0)}))}squarify(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!0)}strip(t,e,s,i){this.$_squarify(t,{x:0,y:0,width:e,height:s},i,!1)}$_sliceNext(t,e,s,i){if(t.x=e.x,t.y=e.y,1===s){const s=e.height*t.value/i;t.width=e.width,t.height=s,e.y+=s,e.height-=s}else{const s=e.width*t.value/i;t.height=e.height,t.width=s,e.x+=s,e.width-=s}t.children&&this.$_slice(t.children,t.getArea(),0===s,!0)}$_slice(t,e,s,i){let r=t.reduce(((t,e)=>t+e.value),0),n=s?1:0;t.forEach((t=>{this.$_sliceNext(t,e,n,r),r-=t.value,i&&(n=1-n)}))}slice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!1)}sliceDice(t,e,s,i){this.$_slice(t,{x:0,y:0,width:e,height:s},i,!0)}}Bn.type="treemap",Bn.defaults=fe(xe.defaults,{idField:"id",groupField:"group",algorithm:"squarify",alternate:!0,groupMode:!0});class Dn extends Ms{_assignTo(t){return l(super._assignTo(t),{length:this.length,angle:this.angle,lengthValue:this.lengthValue,angleValue:this.angleValue})}_valuesChangd(t){return this.length!==t.length||this.angle!==t.angle||super._valuesChangd(t)}_readArray(t,e){if(e.length<=2)this.isNull=!0;else{const s=e.length>3?1:0;s>0&&(this.x=e[x(t.options.xField,0)]),this.y=e[x(t.options.yField,0+s)],this.length=e[x(t.options.lengthField,1+s)],this.angle=e[x(t.options.angleField,2+s)]}}_readObject(t,e){super._readObject(t,e),this.length=b(e[t.options.lengthField],e.length),this.angle=b(e[t.options.angleField],e.angle),this.y=v(t._yFielder(e),e.y,e.value)}_readSingle(t){super._readSingle(t),this.length=this.angle=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lengthValue)||isNaN(this.angleValue))}initValues(){this.lengthValue=parseFloat(this.length),this.angleValue=parseFloat(this.angle)}initPrev(t,e){e.yValue=this.yValue,e.lengthValue=.001}applyValueRate(t,e){this.lengthValue=V(t.lengthValue,this.lengthValue,e)}}class $n extends Zs{_createPoint(t){return new Dn(t)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length>0){const e=this._op.maxLength,s=this._op.origin,i=t.map((t=>t.length)).reduce(((t,e)=>f(t,e)));t.forEach((t=>{const r=t.length/i;switch(t._len=r*e,s){case"start":t._off=-t._len/2;break;case"end":t._off=t._len/2;break;default:t._off=0}}))}}_createLegendMarker(t,e){const s=.3,i=.7*e,r=[0,-s*e,-.2*e,-s*e,0,-.6*e,.2*e,-s*e,0,-s*e,0,.6*e],n=["M",r[0],r[1]+i];for(let t=2;t<r.length;t+=2)n.push("L",r[t],r[t+1]+i);const a=new Xt(t,Ys.LEGEND_MARKER,n);return a.setStyle("strokeWidth","2px"),a.rotation=30,a}}$n.type="vector",$n.defaults=fe(Ys.defaults,{origin:"center",maxLength:20,startAngle:0,arrowHead:"close"});class zn extends Ms{constructor(){super(...arguments),this.low=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._intermediate=this.source.intermediate,this._isSum&&(this.y=0),this.save=this.y}}class Fn extends si{canCategorized(){return!0}_createPoint(t){return new zn(t)}_createLegendMarker(t,e){return Ls.create(t,Ys.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._runPoints;if(t.length<1)return;let e,s,i=t[0],r=i.y=i._isSum?0:i.y,n=r,a=r,o=r,h=0;for(let l=1,_=t.length;l<_;l++){if(i=t[l],i._isSum){const e=t[l-1],r=!0===i._intermediate||l<_-1&&!1!==i._intermediate,n=i.save=i.y=r?o:a;i.yGroup=i.yValue=i.y,r?o<0?(h=e.low,s=h-n):(s=e.y,h=s-n):(h=t[0].low,s=h+n),o=0}else e=i.y,e<0?n<0?(s=r+n,h=s+e):(s=r,h=s+e):(h=r,s=h+e),o+=e,a+=e;n=i.y,i.y=r=s,i.low=h}}_getBottomValue(t){return t.y=t.save,NaN}}Fn.type="waterfall";class In extends xe{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}}In.defaults=fe(xe.defaults,{text:"RealChart v1.0",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Hn extends xe{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==b(this._op.scope,"auto")?this._op.scope:this.chart._chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible?"axis":t.isMarker()&&t._group?"group":"point"}}Hn.defaults=fe(xe.defaults,{scope:"auto"});class Gn extends xe{_doInitChildren(t){t.credits=(this._credits=new In(null)).init(),t.pointHovering=(this._pointHovering=new Hn(this.chart)).init()}get credits(){return this._credits}get pointHovering(){return this._pointHovering}getXStart(t){return t instanceof Mi&&isNaN(this._op.xStart)?1:this._op.xStart||0}}var jn;Gn.defaults=fe(xe.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right",t.CENTER="center",t.MIDDLE="middle"}(jn||(jn={}));class Wn extends M{constructor(t){super(),this._data=new lt,this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._assets=new ge,(this._chartOptions=new Gn(this)).init(),(this._title=new fi(this)).init(),(this._subtitle=new wi(this)).init(),(this._legend=new bs(this)).init(),(this._tooltip=new xi(this)).init(),(this._split=new mi(this)).init(),(this._body=new ws(this)).init(),(this._navigator=new ui(this)).init(),(this._exporter=new xs(this)).init(),this._series=new Us(this),this._xAxes=new We(this,!0),this._yAxes=new We(this,!1),this._xPaneAxes=new Ue(this),this._yPaneAxes=new Ze(this),this._gauges=new is(this),this._annotations=new Pe(this),s(t)?this._load(t):this._initOptions()}_initOptions(){return this.options=Object.assign({},Wn.defaults)}_createChart(t){return new Wn(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries()}getTooltipText(t,e){return ri.collectTooltipText(this.axis.options,this.series,e)}getTooltipParam(t,e,s){return ri.inflateTooltipParam(this.series,t,e,s)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._chartOptions.pointHovering.getScope(e,s)),t){case"axis":return new i(e._xAxisObj);case"group":return e._group;default:return e}}get chart(){return this}anchorByName(t){}get type(){return this.options.type}get gaugeType(){return this.options.gaugeType}get polar(){return this.options.polar}get inverted(){return this.options.inverted}get timeOffset(){return this.options.options.timeOffset}get startOfWeek(){return this.options.options.startOfWeek}get first(){return this._series.first}get firstSeries(){return this._series.firstSeries}get firstGauge(){return this._gauges.firstGauge}get xAxis(){return this._xAxes.first}get yAxis(){return this._yAxes.first}_needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._annotations.getVisibles()}isGauge(){return this._gaugeOnly}isPolar(){return this._polar&&this._series.seriesCount()>0}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(t){return this._series.isEmpty(t)&&this._gauges.isEmpty(t)}seriesByName(t){return this._series.getSeries(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){return this._gauges.getGauge(t)}gaugeAt(t){return this._gauges.get(t)}annotationByName(t){return this._annotations.getAnnotation(t)||(this._splitted?this._split.getAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items(),i=this._yAxes.items();let r;if(this.isInverted())switch(t){case jn.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case jn.RIGHT:r=s.filter((t=>t._isOpposite));break;case jn.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case jn.TOP:r=i.filter((t=>t._isOpposite));break;case jn.CENTER:r=s.filter((t=>t._isBetween))}else switch(t){case jn.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case jn.RIGHT:r=i.filter((t=>t._isOpposite));break;case jn.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case jn.TOP:r=s.filter((t=>t._isOpposite));break;case jn.MIDDLE:r=s.filter((t=>t._isBetween))}return r?e?r.filter((t=>t.visible)):r:[]}_getLegendSources(){return this._series.getLegendSources()}_setProperties(t,e=!0){const s=this.options;for(const e in Wn.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&we(n={},r.base),s(r[i])&&(n||(n={}),we(n,r[i])),n?we(n,t):t}_load(t){const e=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),this._assets.load(b(t.asset,t.assets)),e.options=this._chartOptions._load(t.options),e.title=this._title._load(t.title),e.subtitle=this._subtitle._load(t.subtitle),e.legend=this._legend._load(t.legend),e.tooltip=this._tooltip._load(t.tooltip),this._split._load(t.split),this._seriesIndex=0,this._series.load(t.series),this._gauges.load(b(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(v(t.xAxis,t.xAxes,{})),this._yAxes.load(v(t.yAxis,t.yAxes,{}))),e.body=this._body._load(t.body||t.plot),this._annotations.load(b(t.annotation,t.annotations),!1),e.seriesNavigator=this._navigator._load(t.seriesNavigator),e.exporting=this._exporter._load(t.exporting),this}update(t,e){this._setProperties(t,!1);for(const e in this){const s=this[e];(s instanceof xe||s instanceof ye||s instanceof ge)&&s.updateOptions(t[e],!1)}e&&this._modelChanged(null)}export(t){this._fireEvent("onExportRequest",t)}_connectSeries(t,e){return e?this._xAxes.connect(t):this._yAxes.connect(t)}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}_prepareRender(){const t=this._xAxes,e=this._yAxes,s=this._split;[t,e].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=s.visible,t.disconnect(),e.disconnect(),this._series.prepareRender(),t.prepare(),e.prepare(),t.collectValues(),e.collectValues(),t.collectReferentsValues(),e.collectReferentsValues(),e.collectRanges(),t.prepareRender(),e.prepareRender(),this._splitted&&!this._gaugeOnly&&(s._prepareRender(),this._xPaneAxes._prepare(t,s._vrows,s._vcols),this._yPaneAxes._prepare(e,s._vrows,s._vcols)),this._series.prepareAfter(),this._legend._prepareRender(),this._gauges.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._navigator.visible&&this._navigator._prepareRender()}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t),this._yAxes._buildTicks(s?t:e),this.$_calcAxesPoints(t,e,s,0)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{t._calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{t._calcPoints(r,i)}))}axesLayouted(t,e,s){this.$_calcAxesPoints(t,e,s,101)}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t);return s&&(this._dataChanged(),this._modelChanged(s)),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._dataChanged(),this._modelChanged(null),s}render(){this._fireEvent("onRefreshRequest")}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{}};if(s(t)){const r=this._templates={};for(const e in t){const i=t[e];s(i)&&(r[e]=l({},i))}["@xAxis","@yAxis","@series","@gauge","@annotation"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return we(we({},s),t)}else i(e)&&e.forEach((e=>{let s=this._templates[e];return s?we(we({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&Is[t.toLowerCase()]}_getSeriesType(t){return n(t)&&Fs[t.toLowerCase()]}_getAxisType(t){return n(t)&&Le[t.toLowerCase()]}_getGaugeType(t){return n(t)&&Ke[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&Qe[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Se[t.toLowerCase()]}getAxesGap(){return this._chartOptions.options.axisGap||0}_modelChanged(t,e){this._fireEvent("onModelChanged",t,e)}_visibleChanged(t){this._fireEvent("onVisibleChanged",t)}_pointVisibleChanged(t,e){this._fireEvent("onPointVisibleChanged",t,e)}}Wn.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},je.register(zs,Ei,Mi,zi),Ys.register(Ir,Gr,vr,kr,Yr,Zr,Kr,sn,nn,ln,cn,dn,pn,mn,xn,$r,zr,vn,Sn,Pn,En,Tn,Bn,$n,Fn),ri.register(Wr,Cr,Qr,an,jr,Nn),ri.registerSeries(Wr,Cr,an,jr,Nn),es.register(tr,hr,wr,Xi),ss.register(er,lr,qi),ke.register(yi,bi,vi);const Xn="$ctrl";class Yn{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Wn(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[Xn]=null===(t=this[Xn])||void 0===t?void 0:t.destroy(),this._obj=null,this.$_destroyed=!0)}get options(){return this._obj.options}get data(){return this._obj._data}get type(){return this._obj.type}get gaugeType(){return this._obj.gaugeType}get inverted(){return this._obj.inverted}get polar(){return this._obj.polar}get chartOptions(){return this._obj._chartOptions}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get first(){return this._obj.first}get series(){return this._obj.firstSeries}get gauge(){return this._obj.firstGauge}get legend(){return this._obj._legend}get tooltip(){return this._obj._tooltip}get xAxis(){return this._obj.xAxis}get yAxis(){return this._obj.yAxis}get body(){return this._obj._body}get split(){return this._obj._split}get seriesNavigator(){return this._obj._navigator}get exporter(){return this._obj._exporter}getXAxis(t){return this._obj.getXAxis(t)}getYAxis(t){return this._obj.getYAxis(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,i){var r;if(s(t)){const s="load chart";k.LOGGING&&console.time(s);let n=this._obj,a=n;this._loaded?(n.destroy(),a=this._obj=new Wn):(this._loaded=!0,n=null),a._load(t),a._loadAnimatable=e,this._loadCallback=i,k.log("chart-items:",me),k.LOGGING&&console.timeEnd(s),null===(r=this._modelCallback)||void 0===r||r.call(this,a,n)}return this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(){this._obj.render()}setParam(t,e,s){this._obj.setParam(t,e,s)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}}class Un{constructor(t,e){this._obj=new ht(t||{},e)}get rowCount(){return this._obj.rowCount}getValue(t,e){return this._obj.getValue(t,e)}setValue(t,e,s){this._obj.setValue(t,e,s)}getValues(t,e=0,s=-1){return this._obj.getValues(t,e,s)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class Zn extends N{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestroy(){this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.dom.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,a=this._views;for(;a.length>t;)n.push(a.pop().remove());for(;a.length<t;){const e=this.$_create(i);a.push(e),null==s||s(e,a.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){return this._views=this._views.sort(t),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const qn=Object.freeze({x:0,y:0,width:0,height:0}),Kn=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function Qn(t){return{width:t.width,height:t.height}}function Jn(t){return t.width<=0||t.height<=0}class ta{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new ta(t,t,t,t):new ta(t,t,e,e):new ta(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new ta(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=x(t.paddingLeft,0),this.right=x(t.paddingRight,0),this.top=x(t.paddingTop,0),this.bottom=x(t.paddingBottom,0),this}applyMargin(t){return this.left=x(t.marginLeft,0),this.right=x(t.marginRight,0),this.top=x(t.marginTop,0),this.bottom=x(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}}ta.Empty=Object.freeze(new ta),ta.Temp=new ta;class ea extends It{constructor(t,e=T){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return ea.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}ea.IGNORE_ATTRS={width:"",height:""};class sa extends It{constructor(t,e=T){super(t,e,"g"),It.DEBUGGING&&(this.add(this._debugRect=new Ls(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),It.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Ls(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class ia extends sa{constructor(t,e,s){super(t,e),this._margins=new ta,this._paddings=new ta,this.add(this._background=new Ls(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const a=this._paddings;a.applyPadding(n);const o=this._doMeasure(t,e,s,i,r);if(o.width+=a.left+a.right,o.height+=a.top+a.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=o.width+=t.left+t.right,this.mh=o.height+=t.top+t.bottom}return this.mw=o.width,this.mh=o.height,o}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class ra extends ea{measure(t,e,s,i,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,s,i,r);return this.mw=n.width,this.mh=n.height,n}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}_setInverted(t){this._inverted=t}}class na extends sa{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class aa extends It{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=qn,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate(),this._dirty=!1},window.SVGGraphicsElement||(this._proxy=new Image,this._proxy.onload=()=>{this._dirty=!0,this.invalidate(),setTimeout((()=>{this.onloadProxy(),this._dirty=!1}),0)})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){return!!t&&(this.url=t,this.resize(e,s)&&(this._dirty=!0),!0)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){let t=this._bounds.width,e=this._bounds.height;0==t||e?0==e||t||(t=e/this._proxy.height*this._proxy.width):e=t/this._proxy.width*this._proxy.height,this._bounds={x:this._bounds.x,y:this._bounds.y,width:t,height:e}}return this._bounds}resize(t,e,s=!0){return this._dirty&&super.resize(t,e,s)}}class oa extends ea{constructor(t,e=T){super(t),this.add(this._text=new Qt(t,e)),this._text.anchor=Zt.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options.effect;return this._model=e,this._text.setStyleOrClass(e._style),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Ls(t,"rct-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(e.options.backgroundStyle)):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new Qt(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?this._icon||(this.add(this._icon=new aa(t,!1)),this._icon.url=s,this._icon.width=e.options.iconWidth,this._icon.height=e.options.iconHeight||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){var e;const s=null===(e=this._model)||void 0===e?void 0:e.options;if(t&&(null==s?void 0:s.autoContrast)&&this._text.setContrast(t,s.darkStyle||"rct-label-dark",s.lightStyle||"rct-label-light"),this._outline&&this._outline.parent){const t=Tt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.applyStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._icon;let s=0;const i=this._text.getBBox(),r=i.width,n=i.height;let a=r,o=n,h=0,l=0,_=0,c=0;if(e){const t=e.getBBox();switch(s=x(this._model.options.iconGap,0),h=t.width,l=t.height,this._model.getIconPos()){case"left":case"right":a+=s+h,o=Math.max(l,n);break;default:o+=s+l,a=Math.max(h,r)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);_=parseFloat(t.paddingLeft)||0,c=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,a+_+(parseFloat(t.paddingRight)||0),o+c+(parseFloat(t.paddingBottom)||0),t.rx)}if(e)switch(this._model.getIconPos()){case"left":e.trans(_,(o-l)/2),_+=h+s,a-=h+s;break;case"right":e.trans(_+a-h,(o-l)/2),a-=h+s;break;case"top":e.transX((a-h)/2),c+=l+s;break;case"bottom":e.trans((a-h)/2,c+n+s)}switch(t){case"center":_+=a/2,this._text.anchor=Zt.MIDDLE;break;case"right":_+=a,this._text.anchor=Zt.END;break;default:this._text.anchor=Zt.START}return this._text.trans(_,c),this}trans(t,e){return super.trans(t,e),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(this._text.tx,this._text.ty)),this}}class ha extends Ss{constructor(t,e,s,i){super(),this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}_doUpdate(t){if(this._axis.parent){const e=this._axis.model,s=this._prevMax-this._prevMin,i=(e.axisMax()-e.axisMin())/s;return t=i+(1-i)*t,e.setPrevRate(t),this._axis.invalidate(),!0}return!1}_doStop(){this._axis.model.setPrevRate(NaN),this._axis=null}}class la extends ia{constructor(t){super(t,la.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new Qt(t)),this._richText=new oe}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){this._angle=e.getRotation();const n=e.options;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),n.textOrientation&&this._textView.setStyle("textOrientation",n.textOrientation),this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null);const a=Qn(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(t){const e=this._textView,s=e.getStyle("writing-mode"),i=s===nt||s===at;t?this.rotation=0:this.setRotation(0,(i?this.width:this.height)/2,this._angle);let r=this._margins.top+this._paddings.top,n=0;switch(this.textAlign()){case"left":this._textView.anchor=Zt.START,i||(n-=this.width/2);break;case"right":this._textView.anchor=Zt.END,i?r+=this.height:n+=this.width/2;break;default:this._textView.anchor=Zt.MIDDLE,i&&(r+=this.height/2)}e.trans(n,r)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}la.TITLE_CLASS="rct-axis-title";class _a extends sa{constructor(t){super(t,ga.TICK_CLASS),this.add(this._lineView=new Nr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class ca extends oa{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0}setLabel(t,e,s,i,r){if(s){this._richText?this._richText._format!==s&&this._richText.setFormat(s):this._richText=new oe(s);const n=t.getIcon(e);this.setModel(this.doc,t,n&&t.getUrl(n),null),this._richText.build(this._text,i,r,t,t._domain),this._outline&&this._richText.build(this._outline,i,r,t,t._domain)}else this._richText&&(this._richText=null,this._text.text="")}rotatedWidth(){const t=this.rotation*D,e=this.getBBox();return w(u(t)*e.height)+w(d(t)*e.width)}rotatedHeight(){const t=this.rotation*D,e=this.getBBox();return w(d(t)*e.height)+w(u(t)*e.width)}}class da extends It{constructor(t){super(t,void 0),this.add(this._back=new Xt(t,"rct-crosshair-flag")),this.add(this._text=new Qt(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){this._text.text=e;const s=this._text.getBBox(),i=new tn,r=f(t.flag.minWidth||0,s.width+8);i.rect(0,0,r,s.height+4),this._back.setPath(i.end()),this._text.trans(r/2,2)}}}class ua extends sa{static isThumb(t){return t.classList.contains(ua.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Ls(t,ua.TRACK_CLASS)),this.add(this._thumbView=new Ls(t,ua.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=f(0,e),this._page=m(s,e),this._pos=m(t.min+e-s,f(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,s=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.options.reversed,(t=f(0,m(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:i}:{width:s,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=x(e.getMinThumbSize(),32),r=this._len,n=0===this._len,a=this._page,o=n?0:this._pos-s.min,h=e.getGap(),l=h+e.getGapFar();let _=this.width,c=this.height;if(this._vertical){_-=l,this._trackView.setBounds(h,0,_,c),c-=i;const t=(n||a===r?c:c*a/r)+i;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-c*o/r-t,_-2,t)}else{c-=h+e.getGapFar(),this._trackView.setBounds(0,h,_,c),_-=i;const t=(n||a===r?_:_*a/r)+i;this._reversed,this._thumbView.setBounds(n?0:_*o/r,h+1,t,c-2)}}}ua.CLASS_NAME="rct-axis-scrollbar",ua.TRACK_CLASS="rct-axis-scrollbar-track",ua.THUMB_CLASS="rct-axis-scrollbar-thumb";const pa=/\${label}.*?/g;class ga extends sa{constructor(t){super(t,ga.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._edgeStart=0,this._marginStart=0,this._marginEnd=0,this._edgeEnd=0,this.add(this._lineView=new Nr(t,ga.LINE_CLASS)),this.add(this._titleView=new la(t)),this.add(this._markContainer=new It(t,"rct-axis-ticks")),this.add(this._labelContainer=new It(t,"rct-axis-labels")),this._labelViews=new Zn(this._labelContainer,ca,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){return e.visible&&!this.model._isBetween?(this._scrollView||this.add(this._scrollView=new ua(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s]):(this._scrollView&&this._scrollView.setVis(!1),0)}checkHeight(t,e,s){const i=this.model,r=i.title;let n=i.tick.visible?i.tick.options.length:0;return this.$_prepareLabels(i,e)&&(n+=this.$_measureLabelsHorz(i,e,!0)),this._titleView.setVis(r.visible)&&(n+=this._titleView.measure(t,r,e,s,1).height,n+=r.options.gap),n+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),n}checkWidth(t,e,s){const i=this.model,r=i.title;let n=i.tick.visible?i.tick.options.length:0;return this.$_prepareLabels(i,e)&&(n+=this.$_measureLabelsVert(i,s,!0)),(this._titleView.visible=r.visible)&&(n+=this._titleView.measure(t,r,e,s,1).width,n+=r.options.gap),n+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),n}prepareGuides(t,e,s,i,r){[i,r].forEach(((i,r)=>{if(i.setVis(!this._empty)){const n=this.model.guides.filter((t=>t.options.front==(1===r)&&t.canConstainedTo(e,s)));i.setAll(t,n,!1)}}))}showCrosshair(t,e){const s=this.model;let i,r=this._crosshairView;r||this.add(r=this._crosshairView=new da(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick.options.length):(i="opposite"===s._runPos?m(0,this.width-n.width):f(0,this.width-s.tick.options.length-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){this._edgeStart=t,this._marginStart=e,this._marginEnd=s,this._edgeEnd=i}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}prepare(t){this.model=t,this._chartEmpty=t.chart.isEmpty(!0),this._empty=this._chartEmpty||t.isEmpty()}checkExtents(t){const e=this._prevModel,s=this._prevModel=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax;this._prevMin=s.axisMin(),this._prevMax=s.axisMax(),(!isNaN(e)&&this._prevMax!==e||!isNaN(t)&&this._prevMin!==t)&&!s._zooming&&s.options.animatable&&new ha(this,t,e,(()=>{this.invalidate()}))}}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const a=e.line,o=e.tick,h=e._isHorz,l=e._isBetween,_=this._titleView;let c=0;return(this._lineView.visible=a.visible)?(this._lineView.setStyleOrClass(a._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new Nr(t,ga.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(a._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=o.options.length||0,this._markLen>0&&(c+=e.tick.options.gap||0),c+=this._markLen,this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),l&&(c*=2),this.$_prepareLabels(e,h?s:i)?c+=this._labelSize=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i):this._labelSize=0,this._simpleMode?_.setVis(!1):(_.visible&&(c+=h?_.mh:_.mw,c+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(c+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?s:c,height:h?c:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t._ticks,n=t._markPoints,a=this._labelViews,o=this._markLen,h=this.width,l=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?l:0,0,h):this._lineView.setVLine(s?0:h,0,l),this._lineView2&&(e?this._lineView2.setHLine(l,0,h):this._lineView2.setVLine(0,0,l))),this._markContainer.visible&&(e?this._markViews.forEach(((e,i)=>{e.resize(1,o),e.layout().trans(t.prev(n[i]),s?l-o:0)})):this._markViews.forEach(((e,i)=>{e.resize(o,1),e.layout().trans(s?0:h-o,l-t.prev(n[i]))})));const _=o+(t.tick.options.gap||0);if(this._labelContainer.visible&&a.count>0&&(e?this.$_layoutLabelsHorz(a,r,i,s,h,l,_):this.$_layoutLabelsVert(a,r,i,s,h,l,_)),!this._simpleMode){const i=t.title.options,r=this._titleView,n=this._scrollView,a=this._labelSize;let o=0,c=0;if(r.visible){const n=+i.offset||0,d=+i.gap||0;if(r.resizeByMeasured().layout(e),e){if(c+=s?0:_+a+d,t.options.reversed)switch(i.align){case"start":o=h-r.width/2-n;break;case"end":o=r.width/2+n;break;default:o=h/2-n}else switch(i.align){case"start":o=r.width/2+n;break;case"end":o=h-r.width/2-n;break;default:o=h/2+n}r.trans(o,c),c+=r.height}else{const e=0===r._angle?r.width:r.height;if(o=s?_+a+d+e/2:h-_-a-d-e/2,t.options.reversed)if(0===r._angle)switch(i.align){case"start":c=0+n;break;case"end":c=l-r.height-n;break;default:c=(l-r.height)/2+n}else switch(i.align){case"start":c=r.width/2-r.height/2+n;break;case"end":c=l-r.width/2-r.height/2-n;break;default:c=(l-r.height)/2+n}else if(0===r._angle)switch(i.align){case"start":c=l-r.height-n;break;case"end":c=0+n;break;default:c=(l-r.height)/2-n}else switch(i.align){case"start":c=l-r.width/2-r.height/2-n;break;case"end":c=r.width/2-r.height/2+n;break;default:c=(l-r.height)/2-n}r.trans(o,c)}}else c+=s?0:_+a;(null==n?void 0:n.visible)&&(e?(n.trans(0,c).resize(this.width,n.mh),n.setScroll(t._zoom,t.options.reversed)):(n.trans(0,0).resize(n.mw,this.height),n.setScroll(t._zoom,t.options.reversed)),n.layout())}}$_prepareTickMarks(t,e){const s=this._markContainer;if(s.visible=e.tick.visible){const i=e._markPoints.length,r=this._markViews;for(;r.length<i;){const e=new _a(t);s.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();return!0}}_prepareLabel(t,e,s,i,r){if(!r&&t.value===e.value)return;const n=s.getLabelText(e,i),a=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s._style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=n){a&&n.match(pa)?t.setLabel(s,e,n.replace(pa,a),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,null,null),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,e,a,1e3,1e3)}$_prepareLabels(t,e){if(this._labelContainer.setVis(!this._chartEmpty&&t.labelsVisible())){let e=t._ticks.length;return this._labelContainer.setStyleOrClass(t.label._style),e}return 0}$_getRows(t){return 2}$_getStep(t){return 2}$_checkOverlappedHorz2(t,e,s,i,r,n,a,o){const h=t.label,l=f(0,m(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,u=(i=f(1,i))*(r=m(f(1,r),_.length)),p=n||0,g=w(p)*D,x=g<35*D;let y,b=!1,v=0;for(let n=0;n<r;n++){let r=n*i+l;for(;r<c;r+=u){let i=0;for(let e=r;e<r+u&&e<c;e++)i+=t.getLabelLength(s,_[e].value);if(r+u<c){y=e.pull(v++),y.rotation=p,y.row=n,y.index=r,this._prepareLabel(y,_[r],h,c,o),y.setVis(!0);const t=i;if(0===p&&y.getBBox().width>=t){b=!0;break}if(x&&y.getBBox().width*d(g)>=t){b=!0;break}if(0!==p&&y.getBBox().height>=t){b=!0;break}}}if(b)return!0;r-u<c&&(y=e.pull(v++),y.row=n,y.rotation=p,y.index=r-u,this._prepareLabel(y,_[r-u],h,c,o),y.setVis(!0))}!a&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=f(0,m(s-1,i.options.startStep||0));e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s=!1){const i=t.label,r=i.options;let n,a=+r.step|0,o=+r.rows|0,h=+r.rotation%360,l=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,o,h,!1,s),_=this._labelViews._internalItems();if(this._labelRowPts=[0],l)if("none"===r.autoArrange)this._labelViews.prepare(t._ticks.length,((e,r,n)=>{e.rotation=h,e.row=0,e.index=r,this._prepareLabel(e,t._ticks[r],i,n,s),e.setVis(!0)})),_=this.$_applyStep(t,_,a||1);else{switch(a=o=0,i.options.autoArrange){case"rows":o=this.$_getRows(_);break;case"step":a=this.$_getStep(_)}if(a>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,s);)a++;else if(o>1){for(;t._ticks.length>o&&(_.forEach(((t,e)=>{t.row=e%o,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,o,0,!1,s));)o++;this._labelRowPts=[]}else if((isNaN(h)||Math.abs(Math.tan(h*D))<1)&&(h=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,o,h,!1,s))for(a=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,o,h,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,o,0,!0,s)&&_.forEach(((t,e)=>{t.rotation=h}));break}a++}}else;if(_.length>0){if(o>1){const t=!isNaN(h)&&0!=h,e=this._labelRowPts;for(let t=0;t<o;t++)e.push(0);_.forEach((s=>{e[s.row]=f(e[s.row],t?s.rotatedHeight():s.getBBox().height)})),e.unshift(0);for(let t=2;t<e.length;t++)e[t]+=e[t-1];return e[e.length-1]}if(isNaN(h)||0==h){n=_[0].getBBox().height;for(let t=1;t<_.length;t++)n=f(n,_[t].getBBox().height)}else{n=_[0].rotatedHeight();for(let t=1;t<_.length;t++)n=f(n,_[t].rotatedHeight())}return n}return 0}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=f(1,i);e.forEach((t=>t.rotation=0));for(let i=0;i<r-1;i+=n){let a=0;for(let o=i;o<i+n&&o<r-1;o++)a+=t.getLabelLength(s,e[i].value);if(e[i].getBBox().height>=a)return!0}}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,a=t._ticks,o=a.length,h=f(1,i);let l,_=0,c=0;for(;_<o;_+=h){let i=0;for(let e=_;e<_+h&&e<o;e++)i+=t.getLabelLength(s,a[e].value);if(_+h<o&&(l=e.pull(c++),l.rotation=0,l.index=_,this._prepareLabel(l,a[_],n,o,r),l.setVis(!0),l.getBBox().height>=i))return!0}_-h<o&&(l=e.pull(c++),l.rotation=0,l.index=_-h,this._prepareLabel(l,a[_-h],n,o,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1){const i=t.label;let r=f(1,+i.options.step|0);const n=this.$_checkOverlappedVert2(t,this._labelViews,e,r,s);let a=this._labelViews._internalItems();if(n)if("none"===i.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,r,n)=>{e.rotation=0,e.index=r,this._prepareLabel(e,t._ticks[r],i,n,s),e.setVis(!0)})),a=this.$_applyStep(t,a,r||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++r,s););else;if(a.length>0){let t=a[0].getBBox().width;for(let e=1;e<a.length;e++)t=f(t,a[e].getBBox().width);return t}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,a){const o=this.model,h=o.label,l=o.options.reversed,_=this._labelRowPts,c=t.get(0).rotation,d=c*D,p=c<-15&&c>=-90||c>15&&c<=90,g=t.count;let m,f;t.freeHiddens(),t.forEach(((t,s)=>{t.setContrast(null).layout("center");const r=t.getBBox();m=o.prev(e[t.index].pos),f=i?n-a-r.height-_[t.row]:a+_[t.row],c<-15&&c>=-90?i?(m-=r.width,f-=u(d)*r.height/2,t.setRotation(r.width,r.height/2,-c)):(m-=r.width,f+=u(d)*r.height/2,t.setRotation(r.width,r.height/2,c)):c>15&&c<=90?i?(f+=u(d)*r.height/2,t.setRotation(0,r.height/2,-c)):(f-=u(d)*r.height/2,t.setRotation(0,r.height/2,c)):(m-=r.width/2,t.setRotation(r.width/2,0,i?-c:c)),t.trans(m,f)})),!p&&g>1&&(function(e,s,i){let r=!0;const n=s.rotatedWidth();let a=s.tx;if(a<-e._marginStart-e._edgeStart)if("pull"===(l?h.options.lastOverflow:h.options.firstOverflow))if(a=-e._marginStart-e._edgeStart+2,t.count>0){const t=i.tx;a+n+(+h.options.overflowGap||12)>t&&(r=!1)}else r=!1;else r=!1;r?s.transX(a):s.setVis(!1)}(this,t.get(l?g-1:0),t.get(l?g-2:1)),function(t,e,s){let i=!0,n=e.tx;const a=e.rotatedWidth();if(n+a>(r+=t._marginEnd+t._edgeEnd)){const t=h.options;"pull"===(l?t.firstOverflow:t.lastOverflow)?(n=r-a,s?n<s.tx+s.rotatedWidth()+(+t.overflowGap||12)&&(i=!1):i=!1):i=!1}i?e.transX(n):e.setVis(!1)}(this,t.get(l?0:g-1),t.get(l?1:g-2)))}$_layoutLabelsVert(t,e,s,i,r,n,a){const o=this.model,h=i?"left":s?"center":"right",l=i?a:r-a;t.freeHiddens(),t.forEach(((t,a)=>{t.setContrast(null).layout(h);const _=t.getBBox(),c=i?l:s?(r-_.width)/2:l-_.width;t.trans(c,n-o.prev(e[t.index].pos)-_.height/2)}))}}ga.AXIS_CLASS="rct-axis",ga.LINE_CLASS="rct-axis-line",ga.TICK_CLASS="rct-axis-tick";class ma extends It{constructor(t,e,s){super(t,ma.STYLE),this.add(this._back=new Ls(t,ma.BACK_STYLE)),this.add(this._textView=new Qt(t)),s&&this.dom.classList.add(s),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),s=(new ta).applyPadding(e),i=this._textView.getBBox();this._back.rect={x:0,y:0,width:i.width+s.left+s.right,height:i.height+s.top+s.bottom},this._textView.trans(i.width/2+s.left,s.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}ma.STYLE="rct-button",ma.BACK_STYLE="rct-button-background";class fa extends It{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class wa extends Xt{setArc(t,e,s,i,r,n){this.setPath(As.arc(t,e,s,s,i,close?i+r:i-r,n))}}class xa extends wa{setPolyline(t){this.setPath(As.lines(...t))}}class ya extends Xt{static create(t,e,s,i,r,n,a,o,h=!0){return new ya(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:a,angle:o,clockwise:h})}static createInner(t,e="",s,i,r,n,a,o,h,l=!0){return new ya(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:a,start:o,angle:h,clockwise:l})}constructor(t,e=T,s=T){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,s&&this._assignShape(s,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return As.sector(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.innerRadius||0,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}$_renderArc(){return As.arc(this.cx,this.cy,this.rx*this.rate,this.ry*this.rate,this.start,this.clockwise?this.start+this.angle:this.start-this.angle,this.clockwise)}}const ba={};class va extends ia{static register(...t){t.forEach((t=>{ba[t[0].type]=t[1]}))}constructor(t,e){super(t,va.CLASS_NAME+" "+e,"rct-annotation-background")}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}_layoutView(t,e,s,i,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),s,i,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,s=e._anchorObj;if(s){const i=t.getAnnotationAnchor(s);if(i){const t=e.getOffset(this.width,this.height),s=i.width,r=i.height;let n=i.tx,a=i.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=s+t.x;break;default:n+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":a+=(r-this.height)/2+t.y;break;case"bottom":a+=r+t.y;break;default:a-=this.height+t.y}return{x:n,y:a}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this._background.setBounds(t.x,t.y,this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}setRotation(t,e,s){return this._background.setRotation(t,e,s),this._setRotation(t,e,s),this}_setRotation(t,e,s){}}va.CLASS_NAME="rct-annotation";const Va={};class Sa extends na{static register(...t){t.forEach((t=>{Va[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Ls(t,Sa.PANE_CLASS)),this.add(this._contentContainer=new Ht(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Sa.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const s=this.model;let i=s.getLeft(t),r=s.getTop(e);return isNaN(i)&&(i=s.getRight(t)-this.width,isNaN(i)&&(i=(t-this.width)/2)),isNaN(r)&&(r=s.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:i,y:r}}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return e.getSize(s,i)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const s=l(Rt.getPadding(this.dom));t-=s.left+s.right,e-=s.top+s.bottom,this._renderGauge(t,e),this._contentContainer.trans(s.left,s.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof Ma)return t;t=t.parent}}}Sa.GAUGE_CLASS="rct-gauge",Sa.PANE_CLASS="rct-gauge-pane";class ka extends Ss{constructor(t,e,s){super(),this.view=t,this.from=e,this.to=s}_doUpdate(t){return this.view._runValue=this.from+(this.to-this.from)*t,this.view._renderValue(),!0}}class Pa extends Sa{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return o(i)?gt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._prevValue=0}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this._ani&&(this._ani.stop(),this._ani=null,this._prevValue=0),super._doLayout(),this._checkValueAnimation()}_getValue(t){return f(t.options.minValue,m(t.options.maxValue,x(this._runValue,t.options.value)))}_checkValueAnimation(){const t=this.model;this._animatable&&t.options.animatable&&t.options.value!==this._prevValue&&(this._ani=new ka(this,this._prevValue,t.options.value).start((()=>this._runValue=NaN)),this._prevValue=t.options.value)}}class Ca extends oa{}class Aa extends sa{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new Ht(t,"rct-gauge-scale-ticks")),this._ticks=new Zn(this._tickContainer,Nr),this.add(this._labelContainer=new Ht(t,"rct-gauge-scale-tick-labels")),this._labels=new Zn(this._labelContainer,Ca)}}class La extends Aa{_createLine(t,e){return new Nr(t,e)}_doMeasure(t,e,s,i,r){const n=e._reversed,a=e._vertical,o=e.label,h=e.tick,l=e._steps,_=l.length;let c=a?e.options.gap:s,d=a?i:e.options.gap;if(this._tickContainer.setVis(h.visible)&&(this._tickContainer.setStyleOrClass(h._style),this._ticks.prepare(_)),a?c+=h.options.length:d+=h.options.length,this._labelContainer.setVis(o.visible)&&(this._labelContainer.setStyleOrClass(o._style),this._labels.prepare(_,(e=>{e.setModel(t,o,null,null)})),_>0))if(a){let t=0;this._labels.forEach(((e,s)=>{e.setText(o.getText(l[n?s:_-1-s])),t=f(e.getBBox().width)})),c+=t}else{let t=0;this._labels.forEach(((e,s)=>{e.setText(o.getText(l[n?_-1-s:s])),t=f(e.getBBox().height)})),d+=t}return{width:c,height:d}}_doLayout(){const t=this.model;t._vertical?this.$_layoutVert(t,this.width,this.height):this.$_layoutHorz(t,this.width,this.height)}$_layoutHorz(t,e,s){const i=t.options,r=this._line,n=t.tick,a=t._steps;a.length;const o="opposite"===i.position,h=o?-n.options.length:n.options.length;let l,_=o?s-i.gap:i.gap;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setHLine(_,0,e)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((s,i)=>{l=t.getRate(a[i])*e,s.setVLine(l,_,_+h)})),this._labelContainer.visible){let s=Number.MIN_SAFE_INTEGER;_=o?0:_+h,this._labels.forEach(((i,r)=>{i.layout("center");const n=i.getBBox();l=t.getRate(a[r])*e,i.setVis(l-n.width/2>s)&&(i.trans(l-n.width/2,_),s=l+n.width/2)}))}}$_layoutVert(t,e,s){const i=t.options,r=this._line,n=t.tick,a=t._steps;this.height,a.length;const o="opposite"===i.position,h=o?n.options.length:-n.options.length;let l,_=o?i.gap:e-i.gap;if(r.setVis(t.line.visible)&&(r.setStyleOrClass(t.line._style),r.setVLine(_,0,s)),this._tickContainer.setVis(n.visible)&&this._ticks.forEach(((e,i)=>{l=t.getRate(a[i])*s,e.setHLine(l,_,_+h)})),this._labelContainer.visible){o?Zt.START:Zt.END;const r=o?"left":"right";_=o?_+h:e-i.gap+h,this._labels.forEach(((e,i)=>{e.layout(r);const n=e.getBBox(),h=o?_:_-n.width;l=t.getRate(a[i])*s,e.trans(h,l-n.height/2)}))}}}class Ea extends Pa{_measureLabelSize(t,e,s){const i=t.label,r=this.labelView();return i.setText(t.getLabel(i,t.options.value)),r.text=i.options.text,i.buildSvg(r,null,e,s,t,i._domain),Qn(r.getBBox())}_renderGauge(t,e){const s=this.model,i=x(this._runValue,s.options.value);this._measureGauge(s,s.label,this.labelView(),i,s.isVertical(),t,e),this._renderValue()}_renderValue(){const t=this.model,e=t.label,s=t.scale,i=this.labelView(),r=x(this._runValue,t.options.value),n=l({},this._rBand);if(this._renderScale(n),this.background().setRect(n),n.height>0&&this._renderBand(t,n,r),"top"!==e._runPos&&"bottom"!==e._runPos||(this._rLabel.height=n.height),this._renderLabel(t,e,i,r),!this._vertical&&("left"===e._runPos||"right"===e._runPos)&&s.visible&&"opposite"===s.options.position){const t=i.getBBox();i.ty+t.height>this.height&&i.transY(f(0,this.height-t.height))}}_measureGauge(t,e,s,i,r,n,a){const o=this._rBand=Kn(0,0,n,a);if(this._vertical=t._group instanceof Zi?t._group.options.vertical:r,e.visible){const r=e._runPos=b(e.options.position,this._vertical?"top":"left"),h=e._runVert="top"===r||"bottom"===r,l=t._group?t._group.itemLabel.options.gap:e._runGap=e.getGap(h?a:n);let _=h?n:e.getWidth(n),c=h?e.getHeight(a):a;const d=h?n:e.getMaxWidth(n),u=h?e.getMaxHeight(a):a,p=this._rLabel=Kn(0,0,n,a);s.setStyleOrClass(e._style),e.setText(t.getLabel(e,e.options.animatable?i:t.options.value)),s.text=e.options.text,e.buildSvg(s,null,x(_,d),x(c,u),t,e._domain);const g=s.getBBox();switch(h?(p.height=x(c,g.height),o.height=f(0,o.height-(p.height+l))):(p.width=x(_,g.width),this._wLabel=t._group?t._group._labelWidth:p.width,o.width=f(0,o.width-(this._wLabel+l))),r){case"top":o.y=p.height+l;break;case"bottom":p.y=o.height+l;break;case"right":p.x=o.width+l;break;default:o.x=this._wLabel+l}}else this._rLabel=null}_renderLabel(t,e,s,i){if(s.visible){const t=this._rLabel,i=s.getBBox();let r=t.x,n=t.y;switch(e._runPos){case"top":case"bottom":r+=t.width/2;break;case"right":r=this.width-t.width,s.anchor=Zt.START,n+=f(0,(t.height-i.height)/2);break;default:s.anchor=Zt.END,r+=this._wLabel,n+=f(0,(t.height-i.height)/2)}s.trans(r,n)}}_renderScale(t){const e=this.model,s=e.label,i=e.scale,r=this.scaleView(),n=this._vertical?t.height:t.width;let a,o;if(i._vertical=this._vertical,i._reversed=e.options.reversed,isNaN(this._runValue)&&i.buildSteps(n,e.options.value),r.setVis(e.scaleVisible())){const e=r.measure(this.doc,i,t.width,t.height,1);this._vertical?(a=0,o=t.y,t.width=f(0,t.width-e.width),"opposite"===i.options.position?a=t.x+t.width:(s._runVert||(a=t.x),t.x+=e.width)):(a=t.x,t.height=f(0,t.height-e.height),"opposite"===i.options.position?s._runVert?(o=t.y,t.y+=e.height):(this._rLabel.y=t.y+=e.height,o=t.y-e.height):o=t.y+t.height),r.resizeByMeasured().layout().trans(a,o)}}}class Na extends Pa{}class Ma extends Sa{_defaultCalss(){return Ma.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new Ht(t,"rct-gauge-group-container")),this._gaugeViews=this._createPool(this._gaugeContainer)}_setChartOptions(t,e,s){super._setChartOptions(t,e,s),this._gaugeViews.forEach((i=>i._setChartOptions(t,e,s)))}_prepareGauge(t,e){this._gaugeViews.prepare(e.count()),this._doPrepareGauges(t,e,this._gaugeViews)}_renderGauge(t,e){this._doRenderGauges(this._gaugeContainer,this._gaugeViews,t,e)}_doPrepareGauges(t,e,s){s.forEach(((s,i)=>{s.prepareGauge(t,e.getVisible(i))}))}}Ma.GAUGE_GROUP_CLASS="rct-gauge-group";class Ta{static reveal(t,e){new Oa(t,e)}static grow(t,e){new Da(t,e)}static spread(t,e){new $a(t,e)}static fadeIn(t){new Ra(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);window.Animation&&s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Ra extends Ta{constructor(t,e){super(t,e)}_createAnimation(t,e){const s={},i={};return s[e.prop]=e.start,i[e.prop]=e.end,t.dom.animate([s,i],{duration:Ss.DURATION,fill:"none"})}}class Oa extends Ta{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Ss.DURATION,fill:"none"}}$_clipRect(t){let e;if(t.model.needClip(!1))e=t.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else{const s=t.control;e=t.model.chart.isInverted()?t.clipRect(-s.width(),.1*-t.height,2*s.width(),1.2*t.height):t.clipRect(.1*-t.width,-s.height(),1.2*t.width,2*s.height())}return e}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:j(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:j(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class Ba extends Ss{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof It}_stop(){super._stop(),this._series=null}}class Da extends Ba{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class $a extends Ba{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class za extends Ba{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}var Fa;class Ia extends Ss{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(qa.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(i)}_doStart(){this._marker.beginHover(this._sv,this._focused)}_doUpdate(t){return!!this._marker.parent&&(this._marker.setHoverRate(this._sv,this._focused,t),!0)}_doStop(){this._marker.setBoolData(qa.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Ha extends oa{constructor(t){super(t,"rct-point-label")}}class Ga extends Ht{constructor(t){super(t,"rct-point-labels"),this._labels=[new Zn(this,Ha),new Zn(this,Ha)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}prepareLabel(t,e,s,i,r,n){const a=r.getPointText(i,s,n.options.text),o=n._style;e.point=i,e.setModel(t,n,null,null),e._text.internalClearStyleAndClass(),e._text.internalSetStyleOrClass(o),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),a?(n.prepareRich(a),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(i))):e.setText(n.getText(n.getValue(i,s)))}prepare(t,e){const s=e.model,i=s.pointLabel;if(i.visible){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,a=s._getLabeledPoints(),o=this._maps,h=i._style;n[0].prepare(a.length),o[0]={},n[1].prepare(r>1?a.length:0),o[1]={},a.forEach(((r,a)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(a);l.setVis(e.isPointVisible(r))&&(this.prepareLabel(t,l,h,r,s,i),o[h][r.pid]=l)}})),this.setStyleOrClass(h)}else this.clear()}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class ja extends ea{constructor(t){super(t),this.add(this._line=new Xt(t))}setLine(t){this._line.setPath(t)}}class Wa extends ea{constructor(t){super(t,"rct-point-label-lines"),this._lines=new Zn(this,ja)}prepare(t){const e=this._lines,s=t.getPoints(),i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.count).forEach(((t,e)=>{const i=s.get(e);t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class Xa extends Ht{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t!==this.inverted&&((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform","")),this.inverted}}const Ya={},Ua="rct-point-hover",Za="rct-point-unhover";class qa extends na{static register(...t){t.forEach((t=>{Ya[t[0].type]=t[1]}))}constructor(t,e){super(t,"rct-series "+e),this._simpleMode=!1,this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointContainer=new Xa(t,"rct-series-points")),this._labelContainer=new Ga(t)}clipInvertable(){return!0}getClipContainer(){return this._pointContainer}getClipContainer2(){return null}defaultAnimation(){return"reveal"}setGrowRate(t){isNaN(t)&&isNaN(this._growRate)||t===this._growRate||(this._growRate=t,isNaN(t)&&isNaN(this._posRate)&&isNaN(this._prevRate)?this.invalidate():this._doViewRateChanged(t))}setPosRate(t){isNaN(t)&&isNaN(this._posRate)||t===this._posRate||(this._posRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPosRateChanged(t))}setPrevRate(t){isNaN(t)&&isNaN(this._prevRate)||t===this._prevRate||(this._prevRate=t,isNaN(t)&&isNaN(this._growRate)&&isNaN(this._prevRate)?this.invalidate():this._doPrevRateChanged(t))}isPointVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_animationStarted(t){this._animations.push(t),this._labelContainer&&this._labelContainer.setVis(!1)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}pointByDom(t){return this._getPointPool().elementOf(t)}getPointView(t){return this._getPointPool().find((e=>e.point===t))}clicked(t){const e=this.pointByDom(t);e&&(this._clearHoverClasses(e),!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e))}_doPointClicked(t){}prepareSeries(t,e){this.setModel(e),this.setData("index",e.seriesIndex%12),this.setData("pointcolors",e._colorByPoint()?"a":T),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),e._calcedColor=getComputedStyle(this.dom)[this._legendColorProp()],this._visPoints=this._collectVisPoints(e),this._prepareSeries(t,e)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach((t=>{t!==e&&t.removeClass(Ua).addClass(Za)}))):this._getPointPool().forEach((t=>{t.containsClass(Za)&&t.removeClass(Za).addClass(Ua)}))}_clearHoverClasses(t){t instanceof It&&t.removeClass(Ua).removeClass(Za)}focusPoints(t){const e="none"!==this.model.options.hoverEffect,s=this._hoverAnis,i=this._hoverPts,r=[],n=[];e&&(i.forEach((e=>{if(e instanceof It&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.stop(),e.setBoolData(qa.DATA_FOCUS,!1),e.restoreStyles(),e instanceof ro&&r.push(new Ia(this,e,!1,(()=>{e.endHover(this,!1)})))}})),t&&t.forEach((t=>{if(t&&!t.point.isNull){const e=s.find((e=>e._marker===t));e&&e.stop(),t instanceof It&&(t.setBoolData(qa.DATA_FOCUS,!0),n.push(t),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof ro?r.push(new Ia(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof oo&&this._getPointPool().front(t))}}))),s&&s.forEach(((t,e)=>{t._started&&r.push(t)})),this._hoverAnis=r,this._hoverPts=n,this.model.pointHovered(n&&n.length>0?n[0].point:null)}_needFocusOrder(){return!0}getPointsAt(t,e){}getSiblings(t){return[t]}getSibling(t){}_doAttached(t){this.control.loaded&&Vs(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,s,i,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof Zs&&e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new Xt(t,"rct-series-trendline")),this._trendLineView.setVis(!0)):this._trendLineView&&this._trendLineView.setVis(!1),{width:s,height:i}}_doLayout(){this._labelViews(),this._renderSeries(this.width,this.height),this._trendLineView&&this._trendLineView.visible&&this.$_renderTrendline(this._inverted),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable())}_doAfterLayout(){this.model._xAxisObj._seriesChanged&&new za(this,(()=>{this.invalidate()}))}_collectVisPoints(t){return t._visPoints}$_setColorIndex(t,e){t.setData("index",e.index%12)}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s,i){t.setAttrEx("aria-label",s.ariaHint()),this.$_setColorIndex(t,s),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),i&&i.forEach((e=>e&&t.internalSetStyleOrClass(e))),s.color&&this._setPointColor(t,s.color),s.range&&(s.range.color&&this._setPointColor(t,s.range.color),s.range.style&&t.internalSetStyleOrClass(s.range.style));const r=e.getPointStyle(s);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this._animating()),this._labelContainer.visible?this._labelContainer:T}_getGrowRate(){return x(this._growRate,1)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void i.line(t[r+1].px,t[r+1].py);const n=.35,a={x:0,y:0},o={x:0,y:0},h={x:0,y:0},l={x:t[r+1].px-t[r].px,y:t[r+1].py-t[r].py};let _={x:0,y:0},c=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=c,l.y/=c;let d=t[r+1].px-t[r].px,u=t[r].px,p=t[r].py;for(++r;r!=s;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].px-t[r].px,l.y=t[r+1].py-t[r].py,c=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=c,l.y/=c,l.x<h.x?(_.x=h.x-l.x,_.y=h.y-l.y):(_.x=l.x-h.x,_.y=l.y-h.y);const e=Math.sqrt(_.x*_.x+_.y*_.y);_.x/=e,_.y/=e,h.y*l.y>=0&&(_={x:1,y:0}),a.x=-_.x*d*n,a.y=-_.y*d*n;const s=u+o.x,g=p+o.y,m=t[r].px+a.x,f=t[r].py+a.y;i.curve(s,g,m,f,t[r].px,t[r].py),d=t[r+1].px-t[r].px,o.x=_.x*d*n,o.y=_.y*d*n,u=t[r].px,p=t[r].py}i.curve(u+o.x,p+o.y,t[r].px,t[r].py,t[r].px,t[r].py)}$_renderTrendline(t){const e=this.model;if(!(e instanceof Zs))return;const s=e.trendline,i=e._xAxisObj,r=e._yAxisObj,n=r._vlen,a=i._vlen,o=s._points.map((e=>{let s,o;return t?(o=a-i.getPos(a,e.x),s=r.getPos(n,e.y)):(s=i.getPos(a,e.x),o=n-r.getPos(n,e.y)),{x:s,y:o}}));if(this._trendLineView.setVis(o.length>1)){const t=new tn;t.move(o[0].x,o[0].y),s.isCurved()?this._drawSpline(o.map((t=>({px:t.x,py:t.y}))),0,-1,t):t.lines(...o),this._trendLineView.setPath(t.end(!1))}}_layoutLabel(t,e,s){let{inverted:i,x:r,y:n,hPoint:a,labelView:o,labelOff:h}=t;if(!o.setVis(r>=0&&r<=e&&n>=0&&n<=s))return;o.layout(o.textAlign());const l=t.reversed?a<=0:a<0,_=o.getBBox();let c=!0;switch(i?n-=_.height/2:r-=_.width/2,t.labelPos){case"inside":i?r-=(a+_.width)/2+(t.reversed?h:-h):n+=(a-_.height)/2+(t.reversed?h:-h);break;case"head":i?l?r+=_.width-h:r-=_.width+h:l?n-=_.height+h:n+=h;break;case"foot":i?r-=l?a+_.width+h:a-h:n+=l?a+h:a-_.height-h;break;default:i?l?r-=_.width+h:r+=h:l?n+=h:n-=_.height+h,c=!1}o.setContrast(c&&t.pointView.dom),o.trans(r,n)}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const a="x"===s,o=a?this.model._xAxisObj:this.model._yAxisObj,h=o.options.reversed,l=o.getPos(a?t:e,f(o.axisMin(),i.fromValue)),_=o.getPos(a?t:e,m(o.axisMax(),i.toValue));n?a?h?r.setBounds(_,-e,w(_-l),e):r.setBounds(l,-e,w(_-l),e):r.setBounds(0,-f(l,_),t,w(_-l)):a?h?r.setBounds(_,0,w(_-l),e):r.setBounds(l,0,w(_-l),e):r.setBounds(0,e-f(l,_),t,w(_-l))}_setFill(t,e){s(e)&&e[Q]?t.internalSetStyle(Q,e[Q]):n(e)&&t.dom.classList.add(e)}_savePrevs(){}}qa.POINT_CLASS="rct-point",qa.DATA_FOCUS="focus",qa.DATA_UNFOCUS="unfocus",qa.DATA_UNHOVER="unhover",qa.LEGEND_MARKER="rct-legend-item-marker";class Ka extends Xt{constructor(t){super(t,qa.POINT_CLASS)}savePrevs(){}}class Qa extends Ka{constructor(){super(...arguments),this.labelViews=[]}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let Ja=class extends Qa{layout(t,e,s,i){this.x=t,this.setPath(As.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class to extends ea{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class eo extends qa{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e){this._preparePoints(t,e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class so extends eo{_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._prevRate,a=s.pointLabel,o=this._labelViews(),h=s._xAxisObj,_=s._yAxisObj,c=_.options.reversed,d=2*h.unitPad(),u=_.prev(i?t:e),p=h.prev(i?e:t),g=i?0:e,m=_.axisMin(),w=_.getPos(u,m),y=s.getBaseValue(_)||0,b=x(_.getPos(u,f(m,y)),w),v=!isNaN(y),V=t=>_.getPos(u,t),S=t=>h.getPos(p,t),k=o&&l(this._labelInfo,{inverted:i,reversed:c,labelPos:s.getLabelPosition(a.options.position),labelOff:s.getLabelOff(a.getOffset())});this._getPointPool().forEach(((a,l)=>{const _=a.point;if(a.setVis(!_.isNull)){const c=h.getUnitLen(p,_.xValue)*(1-d);let u=s.getPointWidth(c),m=V(_.yGroup),f=b;if(_.yGroup!=_.yValue){const t=y>_.yGroup,e=_.yGroup<0,s=_.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=_.yGroup-_.yValue*(i?-1:1);f=V(r)}const w=(m-f)*r;let x=S(_.xValue)-c/2;if(isNaN(x)){const t=h.getUnitLen(p,_.xValue)*(1-d);x=S(_.xValue)-t/2}let P=g-m;isNaN(n+a.wSave)||(u=a.wSave+(u-a.wSave)*n),x+=s.getPointPos(c)+u/2,isNaN(n+a.xSave)||(x=a.xSave+(x-a.xSave)*n),_.xPos=x,_.yPos=P,this._layoutPoint(a,l,x,g-b*(1-r)-f*r,u,w),i&&(P=p-S(_.xValue)+c/2,x=g,_.yPos=P-=s.getPointPos(c)+u/2,_.xPos=x+=v?V(_.yGroup)*r:V(_.yGroup*r)),k&&(k.labelView=o.get(_,0))&&(k.pointView=a,k.x=x,k.y=P,k.wPoint=u,k.hPoint=w,this._layoutLabel(k,t,e))}}))}}class io extends eo{_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const s=this.model,i=s.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,a=s.pointLabel,o=this._labelViews(),h=s._xAxisObj,_=s._yAxisObj,c=2*h.unitPad(),d=i?t:e,u=i?e:t,p=i?0:e,g=o&&l(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(a.options.position),labelOff:s.getLabelOff(a.getOffset())});this._getPointPool().forEach(((a,l)=>{const m=a.point;if(a.setVis(!m.isNull)){const f=h.getUnitLen(u,m.xValue)*(1-c);let w=s.getPointWidth(f);const x=(_.getPos(d,m.yValue)-_.getPos(d,this._getLowValue(m)))*r;let y=h.getPos(u,m.xValue)-f/2,b=p-_.getPos(d,m.yGroup)*r;isNaN(n+a.wSave)||(w=a.wSave+(w-a.wSave)*n),y+=s.getPointPos(f)+w/2,isNaN(n+a.xSave)||(y=a.xSave+(y-a.xSave)*n),m.xPos=y,m.yPos=b,this._layoutPoint(a,l,y,b,w,x),i&&(b=u-h.getPos(u,m.xValue)+f/2,y=p,m.yPos=b-=s.getPointPos(f)+w/2,m.xPos=y+=_.getPos(d,m.yGroup)*r),o&&(g.pointView=a,g.hPoint=x,g.x=y,g.y=b,(g.labelView=o.get(m,0))&&(g.hPoint=x,this._layoutLabel(g,t,e)),(g.labelView=o.get(m,1))&&(i?g.x-=x:g.y+=x,g.hPoint=-x,this._layoutLabel(g,t,e)))}}))}}class ro extends Ka{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull?Number.MAX_VALUE:Math.sqrt(Math.pow(this.point.xPos-e,2)+Math.pow(this.point.yPos-s,2))-t}}class no extends qa{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>As[t](0-e,0-e,2*e,2*e)})),e}constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}clipInvertable(){return!1}getPointsAt(t,e){return[]}_getDrawer(t){return no._drawers[t]||no._drawers.circle}_layoutLabelView(t,e,s,i,r,n){let a=t.getBBox();"auto"===e&&(e=this._getAutoPos(a.width>=2*i*.9)),t.setVis(null!=e)&&(r-=a.width/2,"inside"===e?t.trans(r,n-a.height/2):e&&t.trans(r,n-i-a.height-s))}}Fa=no,no._drawers=Object.assign({circle:t=>As.circle(0,0,t)},Fa._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class ao extends Ss{constructor(t){super(),this.series=t,this.duration=300}_doUpdate(t){return!!this.series&&(this.series._zombieRate=this.series._zombie.visible?t:1-t,this.series._resizeZombie(),!0)}_doStop(){this.series&&(this.series._zombie=null,this.series._zombieAni=null,this.series.invalidate(),this.series=null)}}class oo extends qa{togglePointVisible(t){var e;this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(200)}isPointVisible(t){return t===this._zombie||super.isPointVisible(t)}_collectVisPoints(t){let e=super._collectVisPoints(t);return this._willZombie&&!this._willZombie.visible&&(e.push(this._willZombie),e=e.sort(((t,e)=>t.index-e.index))),e}_prepareSeries(t,e){var s;this._zombie&&(this._zombie=null,null===(s=this._zombieAni)||void 0===s||s.stop(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new ao(this),this._zombieAni.start()),this.setData("pointcolors","f")}_createPointLegendMarker(t,e,s){return Ls.create(t,"rct-legend-item-marker",0,0,s,s,s/2)}_preparePoint(t,e,s,i){this._clearHoverClasses(i),s._legendMarker||s.setLegendMarker(this._createPointLegendMarker(t,s,this.chart()._legend.getMarkerSize())),this._setPointStyle(i,e,s),s._calcedColor=getComputedStyle(i.dom).fill}}class ho extends va{constructor(t){super(t,ho.CLASS_NAME),this.add(this._imageView=new aa(t,!1)),this._imageView.onloadProxy=()=>{const t=this._imageView.getBBox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);return this._deflatePaddings(n),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(n.width,n.height),Qn(this._imageView.getBBox())}_doLayout(t){this._imageView.trans(t.x+this._paddings.left,t.y+this._paddings.top),super._doLayout(t)}_setRotation(t,e,s){this._imageView.setRotation(t,e,s)}}ho.CLASS_NAME="rct-image-annotation";class lo extends va{constructor(t){super(t,lo.CLASS_NAME),this.add(this._shapeView=new Xt(t))}_doMeasure(t,e,s,i,r){const n=e.getSize(s,i);return this._deflatePaddings(n),As.setShape(this._shapeView,e.getShape(),n.width/2,n.height/2),n}_doLayout(t){this._shapeView.trans(this._paddings.left+t.x,this._paddings.top+t.y),super._doLayout(t)}_setRotation(t,e,s){this._shapeView.setRotation(t,e,s)}}lo.CLASS_NAME="rct-shape-annotation";class _o extends va{constructor(t){super(t,_o.CLASS_NAME),this.add(this._textView=new Qt(t)),this._textView.anchor=Zt.START,this._richText=new oe}_doMeasure(t,e,s,i,r){const n=e.options,a=e.getSize(s,i),o=this._textView;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),n.textOrientation&&this._textView.setStyle("textOrientation",n.textOrientation),this._deflatePaddings(a),this._richText.setFormat(n.text),this._richText.build(o,s,i,null,e._domain);const h=Qn(this._textView.getBBox());return{width:x(a.width,h.width),height:x(a.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(t.x+this._textView.tx,t.y+this._textView.ty),super._doLayout(t)}_setRotation(t,e,s){this._textView.setRotation(t,e,s)}}_o.CLASS_NAME="rct-text-annotation";let co=class extends sa{constructor(t){super(t,"rct-linear-gauge-band"),this._thick=0,this._gap=0,this._labelGap=3,this._barViews=new Zn(this,Ls),this.add(this._labelContainer=new Ht(t,"rct-linear-gauge-band-tick-labels")),this._labels=new Zn(this._labelContainer,Qt)}_doMeasure(t,e,s,i,r){const n=e.gauge,a=this._vertical=n instanceof Xi?n.isVertical():n.options.vertical,o=e.options.position,h=this._thick=e.getThickness(a?s:i)+("inside"===o?0:this._gap=x(e.options.gap,0));let l=a?h:s,_=a?i:h;const c=this._ranges=e.getRanges();if(this._labelContainer.setVis(e.tickLabel.visible&&c.length>0)){const t=[c[0].fromValue].concat(c.map((t=>t.toValue)));if(this._labelContainer.setStyleOrClass(e.tickLabel._style),this._labels.prepare(c.length+1),a){let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=f(s.getBBox().width)})),l+=e+this._labelGap}else{let e=0;this._labels.forEach(((s,i)=>{s.text=String(t[i]),e=f(s.getBBox().height)})),_+=e}}return{width:l,height:_}}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=i._max-i._min;this._labelContainer.setVis(this.$_layoutBars(s,r,this._ranges)&&this._labelContainer.visible&&"inside"!==e.options.position)&&this.$_layoutLabels(s,r,this._ranges)}$_layoutBars(t,e,s){if(this._barViews.prepare(s.length),!this._barViews.isEmpty&&e>0){const t=this._vertical,i="inside"===this.model.options.position,r="opposite"===this.model.options.position,n=this.width,a=this.height,o=t?a:n,h=this._thick;let l=0;return this._barViews.prepare(s.length).forEach(((_,c)=>{const d=s[c],u=o*(d.toValue-d.fromValue)/e;if(t){const t=i||r?0:n-h;_.setBounds(t,a-l-u,h,u)}else{const t=r?a-h:0;_.setBounds(l,t,u,this._thick)}_.internalClearStyleAndClass(),_.setFill(d.color),d.style&&_.addStyleOrClass(d.style),l+=u})),!0}}$_layoutLabels(t,e,s){const i="opposite"===this.model.options.position;if(this._vertical){const t=this.height,r=i?Zt.START:Zt.END,n=i?this._thick+this._labelGap:this.width-this._thick-this._labelGap;let a=this._labels.get(0);a.anchor=r,a.trans(n,t-a.getBBox().height/2);for(let i=1;i<=s.length;i++){const o=t-t*s[i-1].toValue/e;a=this._labels.get(i),a.anchor=r,a.trans(n,o-a.getBBox().height/2)}}else{const t=this.width,r=i?0:this._thick;this._labels.get(0).trans(0,r);for(let i=1;i<=s.length;i++){const n=t*s[i-1].toValue/e;this._labels.get(i).trans(n,r)}}}};class uo extends Ea{constructor(t){super(t,"rct-linear-gauge")}_doInitContents(t,e){e.add(this._background=new Ls(t,"rct-linear-gauge-background")),e.add(this._bandView=new co(t)),e.add(this._scaleView=new La(t)),e.add(this._valueView=new Ls(t,"rct-linear-gauge-value")),e.add(this._labelView=new Qt(t))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderScale(t){const e=this.model.band,s=this._bandView;if(super._renderScale(t),s.setVis(e.visible)){const i=+e.options.gap||0,r=s.measure(this.doc,e,t.width,t.height,1);s.resizeByMeasured().layout(),this._vertical?"inside"===e.options.position?s.trans(t.x,t.y):"opposite"===e.options.position?(s.trans(t.x+t.width-r.width,t.y),t.width-=r.width+i):(s.trans(t.x,t.y),t.width-=r.width+i,t.x+=r.width+i):"inside"===e.options.position?s.trans(t.x,t.y):"opposite"===e.options.position?(s.trans(t.x,t.y),t.height-=r.height+i,t.y+=r.height+i):(s.trans(t.x,t.y+t.height-r.height),t.height-=r.height+i)}}_renderBand(t,e,s){const i=this._valueView,r=t.options.reversed,n=t.valueBar,a=t._group?t._group.scale:t.scale;if(i.setVis(!Jn(e)&&n.visible&&!a.isEmpty()&&!isNaN(t.options.value)))if(i.setStyleOrClass(n._style),i.internalSetStyleOrClass(n.getStyle(t,s)),this._vertical){const t=e.height*a.getRate(s),n=r?e.y:e.y+e.height-t;i.setBounds(e.x,n,e.width,t)}else{const t=e.width*a.getRate(s),n=r?e.x+e.width-t:e.x;i.setBounds(n,e.y,t,e.height)}}}class po extends Ma{constructor(t,e){super(t,e)}_doInitContents(t,e){super._doInitContents(t,e),e.insertFirst(this._scaleView=new La(t)),e.insertFirst(this._textView=new Qt(t,"rct-linear-gauge-group-label"))}_prepareGauge(t,e){this._textView.setVis(e.label.visible)&&this._textView.setStyleOrClass(e.label._style),this._scaleView.setVis(e.scale.visible)&&this._scaleView.setStyleOrClass(e.scale._style),super._prepareGauge(t,e)}_doRenderGauges(t,e,s,i){const r=this.model,n=r.options,a=this._textView,o=Kn(0,0,s,i);if(a.visible){a.text=r.label.options.text,r.label.buildSvg(a,null,NaN,NaN,r,null);const t=this._textView.getBBox().height+r.label.getGap(i);o.y+=t,o.height-=t,a.trans(this.width/2,0)}r._labelWidth=r._labelHeight=0,this._gaugeViews.forEach(((t,e)=>{const n=t._measureLabelSize(r.get(e),s,i);r._labelWidth=f(r._labelWidth,n.width),r._labelHeight=f(r._labelHeight,n.height)}));const h=(_=o)&&l({},_);var _;const c=r.itemLabel.options.gap;n.vertical?(h.height-=r._labelHeight+c,r.itemLabel.options.opposite||(h.y+=r._labelHeight+c)):(h.width-=r._labelWidth+c,r.itemLabel.options.opposite||(h.x+=r._labelWidth+c)),this._renderScale(r,o,h),n.vertical?this.$_layoutVert(this.doc,r,e,o):this.$_layoutHorz(this.doc,r,e,o)}_renderScale(t,e,s){const i=this._scaleView,r=t.scale,n=t.options.vertical,a=n?e.height:e.width,o=[];let h,l;if(this._gaugeViews.forEach(((e,s)=>{o.push(x(e._runValue,t.get(s).options.value))})),r.buildGroupSteps(a,o),r._vertical=n,i.setVis(r.visible)){const t=i.measure(this.doc,r,s.width,s.height,1);if(n){const i=t.width;s.width-=i,e.width-=i,l=s.y,"opposite"===r.options.position?h=s.x+s.width:(h=s.x,s.x+=i,e.x+=i)}else{const i=t.height;s.height-=i,e.height-=i,h=s.x,"opposite"===r.options.position?(l=s.y,s.y+=i,e.y+=i):l=s.y+s.height}i.resizeByMeasured().layout().trans(h,l)}}$_layoutVert(t,e,s,i){const r=i.height,n=(i.width-e.options.itemGap*(s.count-1))/s.count,a=i.y;let o=i.x;s.forEach(((s,i)=>{s.measure(t,e.get(i),n,r,0),s.resize(n,r),s.layout(),s.trans(o,a),o+=n+e.options.itemGap}))}$_layoutHorz(t,e,s,i){const r=e.options.itemGap,n=i.width,a=(i.height-r*(s.count-1))/s.count,o=i.x;let h=i.y;s.forEach(((s,i)=>{s.measure(t,e.get(i),n,a,0),s.resize(n,a),s.layout(),s.trans(o,h),h+=a+r}))}}class go extends Ea{constructor(t){super(t,"rct-bullet-gage")}_doInitContents(t,e){e.add(this._background=new Ls(t,"rct-bullet-gauge-background")),e.add(this._barContainer=new Ht(t,void 0)),this._barViews=new Zn(this._barContainer,Ls),e.add(this._valueView=new Ls(t,"rct-bullet-gauge-value")),e.add(this._targetView=new Ls(t,"rct-bullet-gauge-target")),e.add(this._scaleView=new La(t)),e.add(this._labelView=new Qt(t))}_backgroundView(){return this._background}labelView(){return this._labelView}scaleView(){return this._scaleView}background(){return this._background}_prepareGauge(t,e){}_renderBand(t,e,s){const i=t.options,r=t._group,n=t.options.reversed,a=this._vertical,o=r?r.scale:t.scale,h=this._valueView,l=this._targetView;if(this._barContainer.setVis(!Jn(e)&&!o.isEmpty())){const s=t.getRanges(o._min,o._max,!1)||(null==r?void 0:r.getRanges(o._min,o._max,!1));s&&(this._barContainer.setRect(e),this._barViews.prepare(s.length),a?this._barViews.forEach(((t,i)=>{const r=s[i],a=e.height*o.getRate(r.toValue-r.fromValue),h=e.height*o.getRate(r.fromValue);t.setBounds(0,n?h:e.height-h-a,e.width,a),t.internalClearStyleAndClass(),t.setFill(r.color),r.style&&t.addStyleOrClass(r.style)})):this._barViews.forEach(((t,i)=>{const r=s[i],a=e.width*o.getRate(r.toValue-r.fromValue),h=e.width*o.getRate(r.fromValue);t.setBounds(n?e.width-a-h:h,0,a,e.height),t.internalClearStyleAndClass(),t.setFill(r.color),r.style&&t.addStyleOrClass(r.style)})))}if(h.setVis(!o.isEmpty()&&!isNaN(s)))if(h.setStyleOrClass(t.valueBar._style),s<i.targetValue&&t.valueBar.options.belowStyle&&h.internalSetStyleOrClass(t.valueBar.options.belowStyle),h.internalSetStyleOrClass(t.valueBar.getStyle(t,s)),a){const t=e.height*o.getRate(s),i=n?e.y:e.y+e.height-t;h.setBounds(e.x+e.width/3,i,e.width/3,t)}else{const t=e.width*o.getRate(s),i=n?e.x+e.width-t:e.x;h.setBounds(i,e.y+e.height/3,t,e.height/3)}if(l.setVis(!o.isEmpty()&&!isNaN(i.targetValue)))if(l.setStyleOrClass(t.targetBar._style),a&&e.width>10){let t=e.height*o.getRate(i.targetValue);t=n?e.y+t:e.y+e.height-t,l.setBounds(e.x+5,t-1,e.width-10,3)}else if(!a&&e.height>10){let t=e.width*o.getRate(i.targetValue);t=n?e.x+e.width-t:e.x+t,l.setBounds(t-1,e.y+5,3,e.height-10)}}}class mo extends Aa{setExtents(t,e){this._center=t,this._exts=e}_createLine(t,e){return new wa(t,e)}_doMeasure(t,e,s,i,r){const n=e._steps.length-(360===e.gauge.options.sweepAngle?1:0);return this._line.setVis(e.line.visible)&&this._line.internalSetStyleOrClass(e.line._style),this._tickContainer.setVis(e.tick.visible)&&(this._tickContainer.internalSetStyleOrClass(e.tick._style),this._ticks.prepare(n)),this._labelContainer.setVis(e.label.visible)&&(this._labelContainer.internalSetStyleOrClass(e.label._style),this._labels.prepare(n,(t=>{}))),{width:s,height:i}}_doLayout(t){const e=this.model,s=e._steps,i=e.gauge,r=i.options,n="opposite"===e.options.position?-1:1,a=i._props,o=this._center.x,h=this._center.y,l=this._exts.scale,_=l+this.model.tick.options.length*n,c=a._sweepRad,p=a._startRad,g=r.maxValue-r.minValue,m=r.clockwise;let f,w,x,y;if(this._line.visible&&this._line.setArc(o,h,l,p,m?c:-c,m),this._tickContainer.visible&&this._ticks.forEach(((t,i,r)=>{const n=e.getRate(s[i])*(m?c:-c)+p;f=o+d(n)*l,w=h+u(n)*l,x=o+d(n)*_,y=h+u(n)*_,t.setLine(f,w,x,y)})),this._labelContainer.visible){this._labels.get(0).setText(String(r.maxValue));const t=_+.2*this._labels.get(0).getBBox().height*n;this._labels.forEach(((i,a,l)=>{const _=e.getRate(s[a])*(m?c:-c)+p;i.setText(String(I(r.minValue+e.getRate(s[a])*g)));const f=i.getBBox();x=o+d(_)*(t+f.width/2*n)-f.width/2,y=h+u(_)*(t+f.height/2*n)-f.height/2,i.trans(x,y)}))}}}class fo extends sa{constructor(t){super(t,"rct-circle-gauge-band"),this._sectorViews=new Zn(this,ya),this.add(this._labelContainer=new Ht(t,"rct-circle-gauge-band-tick-labels")),this._labels=new Zn(this._labelContainer,Qt)}setExtends(t,e){this._center=t,this._exts=e}_doLayout(t){const e=this.model,s=e.gauge,i=s.scale,r=s._props,n=this._center.x,a=this._center.y,o=this._exts.band,h=s.options.clockwise,l=1-this._exts.bandThick/o,_=e.getRanges(),c=r._sweepRad;s.options.maxValue,s.options.minValue;let d=r._startRad;this._sectorViews.prepare(_.length).forEach(((t,e)=>{const s=i.getRate(_[e].toValue-_[e].fromValue)*c;t.setSector({cx:n,cy:a,rx:o,ry:o,innerRadius:l,start:d,angle:s,clockwise:h}),t.internalClearStyleAndClass(),t.setFill(_[e].color),_[e].style&&t.addStyleOrClass(_[e].style),d+=h?s:-s}))}}class wo extends Xt{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new tn).circle(0,0,s).end())),this.internalSetStyleOrClass(t._style),this}}class xo extends Xt{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new tn;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalSetStyleOrClass(t._style),this}}class yo extends Na{constructor(t){super(t,"rct-circle-gauge")}_doInitContents(t,e){e.add(this._rimView=new ya(t,"rct-circle-gauge-rim")),e.add(this._valueView=new ya(t,"rct-circle-gauge-value")),e.add(this._innerView=new ya(t,"rct-circle-gauge-inner")),e.add(this._textView=new Qt(t,"rct-circle-gauge-label")),e.add(this._handContainer=new Ht(t,void 0)),e.add(this._scaleView=new mo(t)),e.add(this._bandView=new fo(t))}_backgroundView(){return this._rimView}_prepareGauge(t,e){this._rimView.setVis(e.rim.visible),this._scaleView.setVis(e.scale.visible),this._bandView.setVis(e.band.visible),this._valueView.setVis(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new xo(t,"rct-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new wo(t,"rct-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVis(e.labelVisible())&&this._textView.setStyleOrClass(e.label._style)}_renderGauge(t,e){const s=this.model,i=s.getCenter(t,e),r=s.getExtents(m(t,e));this.$_renderBackground(s,i,r),this._renderValue()}_renderValue(){const t=this.model,e=t.options,s=t.scale,i=t.getProps(),r=this._getValue(t),n=s.getRate(x(r,0)),a=this._center,o=this._exts,h=t.valueRim.getThickness(o.radiusThick),l=this._textView;if(this._valueView.visible){const s=t.valueRim,l=s.options,_=s.getRange(e,r),c=o.value+(l.stroked?0:h/2),d=this._valueView;d.setStyleOrClass(s._style),_&&(d.setStyle(l.stroked?"stroke":"fill",_.color),_.style&&d.addStyleOrClass(_.style)),l.stroked&&(d.setFill("none"),d.setStyle("strokeWidth",j(h))),d.setBoolData("stroked",l.stroked),d.setSectorEx({cx:a.x,cy:a.y,rx:c,ry:c,innerRadius:(c-h)/c,start:i._startRad,angle:i._sweepRad*n,clockwise:e.clockwise},l.stroked)}if(this._handView){const e=(i._handRad+i._sweepRad*n)*$;this._handView.render(t.hand,o.radius).transp(a).rotate(t.options.clockwise?e:-e)}if(l.visible){const s=t.label;if(s.setText(t.getLabel(s,s.options.animatable?r:e.value)),l.text=s.options.text,s.buildSvg(l,null,NaN,NaN,t,s._domain),l.setBoolData("grouped",!!t._group),t._group)this.$_layoutGroupedLabel(t,l,o);else{const t=l.getBBox(),e=s.getOffset(this.width,this.height);l.trans(a.x+e.x,a.y-t.height/2+e.y)}}}$_renderBackground(t,e,s){const i=t.getProps(),r=i._startRad;this._center=e,this._exts=s,t.scale.buildSteps(s.scale*i._sweepRad,NaN),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim._style),this._rimView.setSector({cx:e.x,cy:e.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:r,angle:i._sweepRad,clockwise:t.options.clockwise})),this._scaleView.visible&&(this._scaleView.setStyleOrClass(t.scale._style),this._scaleView.measure(this.doc,t.scale,this.width,this.height,0),this._scaleView.setExtents(e,s),this._scaleView.layout()),this._bandView.visible&&(this._bandView.setStyleOrClass(t.band._style),this._bandView.measure(this.doc,t.band,this.width,this.height,0),this._bandView.setExtends(e,s),this._bandView.layout()),this._innerView.setStyleOrClass(t.options.innerStyle);let n=s.inner;const a=getComputedStyle(this._innerView.dom),o=parseFloat(a.strokeWidth);o>1&&(n-=o/2),this._innerView.setSector({cx:e.x,cy:e.y,rx:n,ry:n,innerRadius:0,start:0,angle:2*Math.PI,clockwise:!0}),this._pinView&&this._pinView.render(t.pin,n).trans(e.x,e.y)}$_layoutGroupedLabel(t,e,s){const i=e.getBBox(),r=this._rimView.getBBox(),n=+t._group.options.labelGap||0;e.anchor=Zt.END,e.trans(r.x+r.width/2-n,r.y+(s.radius-s.inner-i.height)/2)}}class bo extends Ss{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.view.model,this.view._exts),!0}}class vo extends ro{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}beginHover(t,e){this._saveRadius=this._radius}setHoverRate(t,e,s){const i=this.point,r=(+t.model.marker.options.hoverScale||1.8)-1;let n=this._radius;e?isNaN(s)||(n=this._radius=this._saveRadius*(1+s*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(s)?r:r*s)),As.setShape(this,t.model.getShape(i),n,n),this.index>0?this.trans(i.px2-n,i.py2-n):this.trans(i.xPos-n,i.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,s){const i=0===this.index?this.point.xPos:this.point.px2,r=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:Math.sqrt(Math.pow(i-e,2)+Math.pow(r-s,2))-t}distance2(t,e,s,i){const r=0===this.index?this.point.xPos:this.point.px2,n=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull?Number.MAX_VALUE:i?Math.abs(n-s):Math.abs(r-e)}}class Vo extends Xa{}class So extends qa{constructor(t,e){super(t,e),this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new Vo(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Xt(t,"rct-line-series-line")),this._markers=new Zn(this._pointContainer,vo)}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;s._line.setStyle("strokeWidth",e.strokeWidth),s._shape?(s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")):s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e){e instanceof $r&&this._prepareBelow(e),!this._simpleMode&&this.$_prepareMarkers(e,this._visPoints)}_prepareViewRanges(t){super._prepareViewRanges(t),this._prepareRanges(t,t._runRanges)}_renderSeries(t,e){this._lineContainer.invert(this._inverted,e),this._layoutMarkers(this._visPoints,t,e),this.model.prepareLines(this._visPoints)}_doAfterLayout(){this._layoutLines()}_runShowEffect(t){this._polar?t&&Ta.grow(this):t&&Ta.reveal(this,{from:function(t){const e=t.model._xAxisObj.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._layoutMarkers(this._visPoints,this.width,this.height),this._layoutLines()}getPointsAt(t,e){return[]}getNearest(t,e){const s=this.model.marker.options.radius,i=this._markers._internalItems();if(i&&i.length>0){const r=i.reduce(((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r));return{pv:r,dist:r.distance(s,t,e)}}}getNearest2(t,e,s){const i=this.model.marker.options.radius,r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce(((r,n)=>r.distance2(i,t,e,s)<n.distance2(i,t,e,s)?r:n));return{pv:n,dist:n.distance2(i,t,e,s)}}}getHintDistance(){return this.model.marker.options.hintDistance}canHover(t,e,s){return t<=this.model.marker.options.radius+s}_markersPerPoint(){return 1}_prepareBelow(t){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow=t.options.belowStyle&&t._minY<t.getBaseValue(t._yAxisObj),this._needBelow)return r||(this._lineContainer.insertChild(r=this._lowLine=new Xt(this.doc,"rct-line-series-line rct-line-series-line-below"),this._line),this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds(),this._upperClip.setAttr(It.ASSET_KEY,"1"),this._lowerClip.setAttr(It.ASSET_KEY,"1")),this._line.setClip(this._upperClip),r.setClip(this._lowerClip),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new Zn(this._lineContainer,Xt)),i.prepare(e.length);s.length<e.length;){const t=new Wt(this.doc);t.setAttr(It.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),s.push(t)}for(;s.length>e.length;)s.pop().remove()}else i&&(i.freeAll(),s.forEach((t=>t.remove())),s.length=0)}$_resetClips(t,e,s,i){const r=this.model._yAxisObj.options.reversed;let n;(n=this._upperClip)&&(i?r?n.setBounds(0,-s,e,t):n.setBounds(0,-t,e,t-s):r?n.setBounds(0,0+s,t,e-s):n.setBounds(0,0,t,s)),(n=this._lowerClip)&&(this._inverted?r?n.setBounds(0,-t,e,t):n.setBounds(0,-s,e,t-s):r?n.setBounds(0,0,t,s):n.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof $r&&this._needBelow,i=s?t.getBaseValue(t._yAxisObj):NaN,r=[t.marker._style,null];if(this._pointContainer.setVis(!t._simpleMode)){const n=this._markersPerPoint(),a=s&&t.options.belowStyle,o=e.length;this._markers.prepare(o*n,((n,h)=>{const l=e[h%o];l.isNull||(n.point=l,r[1]=s&&l.yValue<i?a:null,this._setPointStyle(n,t,l,r)),n.point=l,n.index=h<o?0:1}))}else this._markers.prepare(0)}_layoutMarker(t,e,s,i){const r=this.model,n=t.point,a=t._radius=r.getRadius(n);e&&t.internalSetStyleOrClass(e),As.setShape(t,r.getShape(n),a,a),t.setPos(s,i),t.trans(s-=a,i-=a)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,a=this._inverted,o=i.needClip(!1),h=this._getGrowRate(),l=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,p=i.pointLabel,g=p.options.position,m=p.options.align,f=p.getAlignOffset(),w=p.options.textAlign,x=p.getOffset(),y=this._labelViews(),b=i._xAxisObj,v=i._yAxisObj,V=this._polar=i.chart._body.getPolar(b),S=!!V,k=v.prev(a?e:s),P=b.prev(V?V.rd*O:a?s:e),C=a?0:s,A=t.length;t.forEach(((t,i)=>{let r,p,L,E;V?(L=V.start+b.getPos(P,t.xValue),E=v.getPos(V.rd,t.yGroup)*h,r=t.px=V.cx+E*d(L),p=t.py=V.cy+E*u(L)):(r=t.px=b.getPos(P,t.xValue),p=t.py=C-v.getPos(k,t.yGroup),a&&(r=v.getPos(k,t.yGroup),p=s-b.getPos(P,t.xValue))),t.xPos=r,t.yPos=p;const N=this._markers.get(i),M=y&&y.get(t,0);if(N&&N.setVis(!t.isNull&&(S||!o||r>=0&&r<=e&&p>=0&&p<=s))){this._layoutMarker(N,n,r,p);const t=0==i&&null!=_?_:i==A-1&&null!=c?c:l;if(N.setStyle("opacity",t?"1":"0"),M){M.setContrast(null).layout(w);const t=M.getBBox(),e=N._radius;if(M.visible=!0,V){switch(g){case"inside":E-=x;break;case"foot":E-=t.height/2+x;break;default:E+=t.height+x}r=V.cx+E*d(L),p=V.cy+E*u(L)-t.height/2}else switch(g){case"inside":p-=t.height/2+x;break;case"foot":p+=x+(l?e:0);break;default:p-=t.height+x+(l?e:0)}switch(m){case"left":r-=t.width+(l?e:0)+f;break;case"right":r+=(l?e:0)+f;break;default:r-=t.width/2+f}M.trans(r,p)}}else M&&M.setVis(!1)}))}_layoutLines(){const t=this.model;if(!this._lineContainer.setVis(t._lines.length>0))return;const e=this.width,s=this.height,i=this._inverted,r=t instanceof $r&&this._needBelow;let n=this._buildLines2(t._lines,this._polar);if(t._runRanges)this._rangeLines.forEach(((r,a)=>{const o=t._runRanges[a];r.setPath(n),r.internalClearStyleAndClass(),r.internalSetStyle("stroke",o.color),r.internalSetStyleOrClass(o.style),Rt.setImportantStyle(r.dom.style,Q,"none"),r.setClip(this._rangeClips[a]),this._clipRange(e,s,t._runRangeValue,o,this._rangeClips[a],i)}));else{const e=this._line;e.setPath(n),e.internalClearStyleAndClass(),e.internalSetStyle("stroke",t._runColor),e.internalSetStyleOrClass(t._style),Rt.setImportantStyle(e.dom.style,Q,"none")}if(r){const r=this._lowLine,a=t._yAxisObj,o=t.getBaseValue(a);i?this.$_resetClips(e,s,a.getPos(e,o),!0):this.$_resetClips(e,s,s-a.getPos(s,o),!1),r.setPath(n),r.internalClearStyleAndClass(),r.internalSetStyle("stroke",t._runColor),r.internalSetStyleOrClass(t._style),r.internalSetStyleOrClass(t.options.belowStyle),Rt.setImportantStyle(r.dom.style,Q,"none")}}_buildLine2(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve2(t,s,i):r instanceof $r&&"step"===e?this._drawStep2(t,s,i,s?r.backDir():r.options.stepDir):this._drawLine2(t,s,i)}_buildLines2(t,e){const s=this.model,i=s.getLineType(),r=new tn;return"spline"===i?this._drawCurves(t,r):s instanceof $r&&"step"===i?this._drawSteps(t,r,s.options.stepDir):this._drawLines(t,r),r.end(e)}_drawLine2(t,e,s){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)this.model instanceof $r&&this.model.options.connectNullPoints&&t[e].isNull||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this._drawLine2(t,!1,e)))}_drawStep2(t,e,s,i){if(t.length>1){s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(i){case"backward":s.line(t[e-1].px,t[e].py),s.line(t[e].px,t[e].py);break;case"center":s.line((t[e].px+t[e-1].px)/2,t[e-1].py),s.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&s.line(t[e].px,t[e].py);break;default:s.line(t[e].px,t[e-1].py),s.line(t[e].px,t[e].py)}}}_drawSteps(t,e,s){t.forEach((t=>this._drawStep2(t,!1,e,s)))}_drawCurve2(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),this._drawSpline(t,0,t.length-1,s))}_drawCurves(t,e){t.forEach((t=>this._drawCurve2(t,!1,e)))}_drawCurve(t,e,s){const i=t.length;let r;if(t&&t.length>1){let n=e;for(r=e;r<i;)if(t[r].isNull){r-1>n&&this._drawSpline(t,n,r-1,s);do{r++}while(r<i&&t[r].isNull);n=r,r<i&&(s.move(t[r].px,t[r].py),r++)}else r++;r-1>n&&this._drawSpline(t,n,r-1,s)}}_buildAreas(t,e,s){const i=new tn;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];this._buildLine2(n,e,!1,i),this._buildLine2(a,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class ko extends So{constructor(t){super(t,ko.CLASS),this._flagView=new oa(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){super._doLayout();const t=this.model,e=t.flag,s=this._flagView;let i;if(s.setVis(e.visible&&!!(i=e.label()))){s.setText(i),s.setModel(this.doc,e,null,null),s.layout("left");const r=e.options.offset,n=s.getBBox();let a,o;a=this._markers.last.x,o=this._markers.last.y,this._inverted?(t._xAxisObj.options.reversed?o+=r:o-=r+n.height,a-=n.width/2):(t._xAxisObj.options.reversed?a-=r+n.width:a+=r,o-=n.height/2),s.trans(a,o)}}}ko.CLASS="rct-line-series";class Po extends So{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new Vo(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Xt(t,"rct-area-series-area"))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}getClipContainer2(){return this._areaContainer}_prepareBelow(t){let e=this._lowArea;if(super._prepareBelow(t))return e||this._areaContainer.add(e=this._lowArea=new Xt(this.doc,"rct-area-series-area")),this._area.setClip(this._upperClip),e.setClip(this._lowerClip),!0;null==e||e.setClip(),this._area.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);let s=this._rangeAreas,i=this._rangeAreaClips;if(e){for(s||(s=this._rangeAreas=new Zn(this._areaContainer,Xt,"rct-area-series-area")),s.prepare(e.length);i.length<e.length;){const t=new Wt(this.doc);t.setAttr(It.ASSET_KEY,"1"),this.control.clipContainer().append(t.dom),i.push(t)}for(;i.length>e.length;)i.pop().remove()}else s&&(s.freeAll(),i.forEach((t=>t.remove())),i.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this._inverted,r=this.model._yAxisObj,n=i?e:s,a=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=a-r.getPos(n,s.yGroup-s.yValue)}}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar?this._layoutPolar(this._area,this._visPoints):this.$_layoutArea(this._area)}$_layoutArea(t){const e=this.model,s=e.options;if(!this._areaContainer.setVis(e._areas.length>0))return;const i=this.width,r=this.height,n=e.chart.isInverted(),a=this._needBelow?this._lowArea:void 0,o=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,s)=>{const a=e._runRanges[s];t.setBoolData("simple",this._simpleMode),t.setPath(o),t.internalClearStyleAndClass(),t.setFill(a.color),this._setFill(t,a.style),a.areaStyle&&t.internalSetStyleOrClass(a.areaStyle),t.setClip(this._rangeAreaClips[s]),this._clipRange(i,r,e._runRangeValue,a,this._rangeAreaClips[s],n)})):(t.setPath(o),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(Q,e._runColor),this._setFill(t,s.style),e.options.areaStyle&&t.internalSetStyleOrClass(s.areaStyle)),a&&(a.setBoolData("simple",this._simpleMode),a.setPath(o),a.internalClearStyleAndClass(),e._runColor&&a.internalSetStyle(Q,e._runColor),s.areaStyle&&a.internalSetStyleOrClass(s.areaStyle),this._setFill(a,e.options.belowStyle),s.belowAreaStyle&&a.internalSetStyleOrClass(s.belowAreaStyle))}_layoutPolar(t,e){const s=this.model,i=s._group,r=s._yAxisObj,n=r instanceof Ei?s.getBaseValue(r):NaN,a=this.height;r.getPos(a,k.isNotEmpty(n)?n:r.axisMax());const o=new tn;if(!i||"stack"!==i.options.layout&&"fill"!==i.options.layout){o.move(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)o.line(e[t].xPos,e[t].yPos);t.setPath(o.end())}else{o.move(e[0].xPos,e[0].yLow),o.line(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)o.line(e[t].xPos,e[t].yPos);o.line(e[e.length-1].xPos,e[e.length-1].yLow);for(let t=e.length-1;t>=0;t--)o.line(e[t].xPos,e[t].yLow);t.setPath(o.end())}t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style)}}class Co extends ya{constructor(t){super(t,qa.POINT_CLASS)}savePrevs(){}}class Ao extends so{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_preparePoints(t,e,s){e.chart.isPolar()?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.options.baseValue&&e.options.belowStyle&&t.addStyleOrClass(e.options.belowStyle)}_layoutPoints(t,e){this.model.chart.isPolar()?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s){this._bars||(this._bars=this._createBarPool(this._pointContainer)),this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_parepareSectors(t,e,s){this._sectors||(this._sectors=new Zn(this._pointContainer,Co)),this._sectors.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),s=t.pointLabel,i=this._labelViews(),r=t.chart._body,n=t._xAxisObj,a=t._yAxisObj,o=r.getPolar(n),h=n.getTotalAngle(),l=o.cx,_=o.cy;let c,p,g;i&&(c=this._labelInfo,p=t.getLabelPosition(s.options.position),g=t.getLabelOff(s.getOffset())),this._sectors.forEach(((s,r)=>{const m=s.point,f=a.getPos(o.rd,m.yValue)*e;let w=a.getPos(o.rd,m.yGroup)*e;const x=n.getUnitLen(h,m.xValue),y=t.getPointWidth(x);let b=o.start+n.getPos(h,m.xValue);if(b+=t.getPointPos(x),s.setSector({cx:l,cy:_,rx:w,ry:w,innerRadius:(w-f)/w,start:b-y/2,angle:y,clockwise:!0}),b=s.start+s.angle/2,m.xPos=l+s.rx*d(b),m.yPos=_+s.ry*u(b),i&&(c.labelView=i.get(m,0))){c.labelView.layout("center");const t=c.labelView.getBBox();let e;"outside"===p?(w=_+(s.ry+t.height+g)*u(b),e=l+(s.rx+t.width+g)*d(b)):"head"===p?(w=_+(s.ry-t.height/2-g)*u(b)-t.height/2,e=l+(s.rx-t.height/2-g)*d(b)):(w=_+.7*s.ry*u(b)-t.height/2,e=l+.7*s.rx*d(b)),c.labelView.trans(e-t.width/2,w)}}))}}class Lo extends to{constructor(t){super(t,qa.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const s=this.point,i=s.yValue-s.minValue,r=t/2;const n=0+e-e*(s.lowValue-s.minValue)/i,a=0+e-e*(s.highValue-s.minValue)/i,o=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,a),this._stemDown.setVLine(r,n,e),this._min.setHLine(0,t/4,3*t/4),this._max.setHLine(0+e,t/4,3*t/4),this._box.setBox(0,a,t,o),this._mid.setHLine(0+e-e*(s.midValue-s.minValue)/i,0,t)}_doInitChildren(t){this.add(this._stemUp=new Nr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Nr(t,"rct-boxplot-point-stem")),this.add(this._box=new Ls(t,"rct-boxplot-point-box")),this.add(this._mid=new Nr(t,"rct-boxplot-point-mid")),this.add(this._min=new Nr(t,"rct-boxplot-point-min")),this.add(this._max=new Nr(t,"rct-boxplot-point-max"))}}class Eo extends ro{}let No=class extends to{constructor(t){super(t,qa.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(f(s.openValue,s.closeValue)-s.lowValue)/i),a=m(n,r),o=f(1,w(r-n)),h=s.close<s.open;this.x=this.tx+0,this._wickUpper.setVLine(0,0,n),this._wickLower.setVLine(0,r,e),this._body.setBox(-t/2,a,t,o),this.setBoolData("decline",h)}_doInitChildren(t){this.add(this._wickUpper=new Nr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Nr(t,"rct-candlestick-point-wick")),this.add(this._body=new Ls(t))}};class Mo extends Ka{layout(t,e,s){const i=new tn;i.circle(t,e,s),this.setPath(i.end())}}let To=class extends to{constructor(t){super(t,qa.POINT_CLASS),this.add(this._line=new Nr(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Xt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Xt(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,a=this.point,o=a.radius,h=a.lowRadius,l=s/2;t._style&&r.setStyleOrClass(t._style),t._style&&n.setStyleOrClass(t._style),e._style&&n.internalSetStyleOrClass(e._style);let _=t.getMarkerStyle(a);_&&r.internalSetStyleOrClass(_),_=e.getMarkerStyle(a),_&&n.internalSetStyleOrClass(_),this.x=this.tx+l,this._line.setVLine(l,0,i),As.setShape(r,a.shape,o,o),As.setShape(n,a.lowShape,h,h),r.trans(l-o,0-o),n.trans(l-h,i-o)}};let Ro=class extends ea{constructor(t){super(t,qa.POINT_CLASS),this._segments=new Zn(this,Xt),this._decimal=0,this.add(this._back=new Ls(t)),this._back.setTransparent(!0)}prepareSegments(t,e,s,i){this._decimal=s,this._segments.prepare(Math.round(e)).forEach(((t,e)=>{}))}layout(t,e,s){const i=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=i/2,r<0&&(t=t.map((t=>-t))),this._back.setBounds(e,s-r,i,r),this._segments.forEach(((a,o,h)=>{o===h-1&&this._decimal>0?a.setPath(As.rectangle(e,s-t[2*o],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):a.setPath(As.rectangle(e,s-t[2*o],i,n(-1,t[2*o]-t[2*o+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};let Oo=class extends to{constructor(t){super(t,qa.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Nr(t)),this.add(this._whiskerUp=new Nr(t)),this.add(this._whiskerDown=new Nr(t)),this.add(this._back=new Ls(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const s=t/2;this.x=this.tx+s,this._stem.setVLine(s,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class Bo extends Ka{}class Do extends Ls{constructor(t){super(t,qa.POINT_CLASS)}}let $o=class extends Qa{layout(t,e){this.setPath(As.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class zo extends ea{constructor(t){super(t,qa.POINT_CLASS),this.add(this._line=new Nr(t,"rct-lollipop-point-bar")),this.add(this._marker=new Xt(t,"rct-lollipop-point-marker"))}layout(t){const e=this.point.radius;this._line.setVLine(0,0,t),As.setShape(this._marker,this.point.shape,e,e),this._marker.trans(-e,-e)}savePrevs(){this.xSave=this.tx}}class Fo extends to{constructor(t){super(t,qa.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(m(s.openValue,s.closeValue)-s.lowValue)/i,a=0+e-e*(f(s.openValue,s.closeValue)-s.lowValue)/i,o=s.close<s.open;this.x=this.tx+0,this._back.setBox(r,0,t,e),this._tickOpen.setHLine(n,r,0),this._tickClose.setHLine(a,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",o)}_doInitChildren(t){this.add(this._tickOpen=new Nr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Nr(t,"rct-ohlc-point-tick")),this.add(this._bar=new Nr(t)),this.add(this._back=new Ls(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class Io extends ya{constructor(t){super(t,qa.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1)}}class Ho extends ro{setHoverRate(t,e,s){const i=this.point,r=t._getDrawer(t.model.getShape(this.point)),n=(+t.model.options.hoverScale||1.8)-1;let a=t._radius;e?this._radius=a=t._radius*(1+(isNaN(s)?1:s)*n):a=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(a)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._radius}}class Go extends Ls{constructor(t){super(t,qa.POINT_CLASS)}get point(){return this.node.point}render(t){if(1!==t){const e=Object.assign({},this.node);e.width*=t,e.height*=t,e.x+=(this.node.width-e.width)/2,e.y+=(this.node.height-e.height)/2,this.setRect(e)}else this.setRect(this.node)}}class jo extends Ka{layout(t,e,s,i){const r=this.point._len,n=r*i,a=.5;let o,h=(r-n)/2;switch(t){case"none":o=[0,h-a*n,0,h+a*n];break;case"open":const t=.15,e=.45,s=.2;o=[0,h-e*n,0-t*n,h-s*n,0,h-a*n,0+t*n,h-s*n,0,h-e*n,0,h+a*n];break;default:const i=.1,r=.3;o=[0,h-r*n,0-i*n,h-r*n,0,h-a*n,0+i*n,h-r*n,0,h-r*n,0,h+a*n]}const l=this.point._off*i,_=["M",o[0],o[1]+l];for(let t=2;t<o.length;t+=2)_.push("L",o[t],o[t+1]+l);this.rotation=e,this.setPath(_)}}function Wo(t,e){return new(ba[e._type()])(t)}function Xo(t,e){return new(Ya[e._viewType()])(t)}qa.register([Ir,Po],[Gr,class extends So{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Vo(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Xt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Xt(t,"rct-areanrange-series-line")),Rt.setImportantStyle(this._lowerLine.dom.style,"fill","none")}_markersPerPoint(){return 2}getSiblings(t){return[t,this._markers.find((e=>e!==t&&e.point===t.point))]}getSibling(t){return t&&this._markers.find((e=>e!==t&&e.point===t.point))}decoreateLegend(t){super.decoreateLegend(t);const e=getComputedStyle(this._area.dom);t._marker._area.setStroke("none"),t._marker._area.setFill(e.fill),t._marker._area.setStyle("fillOpacity",e.fillOpacity)}_renderSeries(t,e){this._areaContainer.invert(this.model.chart.isInverted(),e),super._renderSeries(t,e)}_layoutMarkers(t,e,s){super._layoutMarkers(t,e,s);const i=this.model,r=i.marker,n=r._style,a=r.visible,o=this._inverted;i._xAxisObj;const h=i._yAxisObj,l=o?e:s,_=o?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=_-h.getPos(l,s.lowValue)}const c=this._markers;for(let _=0,d=t.length;_<d;_++){const u=t[_],p=c.get(d+_);let g,m;o?(g=u.px2=h.getPos(l,u.lowValue),m=u.py2=c.get(_).ty+i.getRadius(u)):(g=u.px2=u.xPos,m=u.py2=u.yLow),p&&p.setVis(!u.isNull&&g>=0&&g<=e&&m>=0&&m<=s)&&(this._layoutMarker(p,n,g,m),p.setStyle("opacity",a||0==_&&!0===r.options.firstVisible||_===d-1&&!0===r.options.lastVisible?"1":"0"))}}_layoutLines(){super._layoutLines();const t=this._area,e=this.model;if(!this._areaContainer.setVis(e._lines.length>0))return;const s=this._buildAreas(e._lines,e.getLineType());t.setPath(s),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.setFill(e._runColor),this._setFill(t,e._style),e.options.areaStyle&&t.internalSetStyleOrClass(e.options.areaStyle)}}],[kr,class extends Ao{constructor(t){super(t,"rct-bar-series")}_createBarPool(t){return new Zn(t,Ja)}_prepareSeries(t,e){super._prepareSeries(t,e),this._rdTop=+e.options.topRadius||0,this._rdBottom=+e.options.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom)}}],[vr,class extends io{constructor(t){super(t,"rct-barrange-series"),this._bars=new Zn(this._pointContainer,Ja)}_getPointPool(){return this._bars}_prepareSeries(t,e){super._prepareSeries(t,e),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_getLowValue(t){return t.lowValue}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i+n,this._rd,this._rd)}}],[Yr,class extends Po{constructor(t){super(t,"rct-bellcurve-series")}}],[Zr,class extends io{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Zn(this._pointContainer,Lo)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,s){this._boxes.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}],[Kr,class extends no{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new Zn(t,Eo)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){t.getShape();const s=e.length;this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getAutoPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),a=this._getGrowRate(),o=+i.rotation||0,h=s.pointLabel,l=h.options.position,_=h.getOffset(),c=this._labelViews(),p=s._xAxisObj,g=s._yAxisObj,m=this._polar=s.chart._body.getPolar(p),f=g.prev(r?t:e),w=p.prev(m?m.rd*O:r?e:t),x=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:y,max:b}=s.getPixelMinMax(x),v=r?0:e,V=this._getDrawer(i.shape);let S;this._markers.forEach(((i,h)=>{const x=i.point,k=c&&(S=c.get(x,0));if(i.setVis(!x.isNull&&!isNaN(x.zValue))){const h=(i._radius=s.getRadius(x.zValue,y,b))*a;let c,P;if(m){const t=m.start+p.getPos(O,x.xValue),e=g.getPos(m.rd,x.yValue);c=m.cx+e*d(t),P=m.cy+e*u(t)}else c=p.getPos(w,x.xValue),P=v-g.getPos(f,x.yValue),r&&(c=g.getPos(f,x.yValue),P=e-p.getPos(w,x.xValue));x.xPos=c,x.yPos=P,i.setVis(!n||c>=0&&c<=t&&P>=0&&P<=e)?(i.setPath(V(h)).trans(c,P).rotate(o),k&&(S.setContrast(i.dom).layout("center"),this._layoutLabelView(S,l,_,h,c,P))):k&&k.setVis(!1)}else k&&k.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems().reduce(((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i));return{pv:s,dist:s.distance(s._radius,t,e)}}canHover(t,e,s){return t<=e._radius+s}}],[sn,class extends io{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Zn(this._pointContainer,No)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._sticks.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}}],[nn,class extends Ao{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Zn(t,Mo)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}],[ln,class extends io{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Zn(this._pointContainer,To)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(this.model.marker,this.model.lowMarker,r,n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._hmarker.setFill(e),t._lmarker.setFill(e)}}],[cn,class extends so{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Zn(this._pointContainer,Ro)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_layoutPoints(t,e){const s=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,s),super._layoutPoints(t,e)}_layoutPoint(t,e,s,i,r,n){const a=this._prevRate;isNaN(a+t.wSave)||(r=t.wSave+(r-t.wSave)*a),isNaN(a+t.xSave)||(s=t.xSave+(s-t.xSave)*a),t.wPoint=r,t.hPoint=n,t.layout(this._pts,s,i)}$_parepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_buildSegments(t,e){const s=t.options,i=t._yAxisObj.axisMax(),r=s.segmented,n=s.segmentGap||0,a=this._pts=[];let o,h,l=0;for(h=s.maxCount>0?s.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),o=(e-n*(h-1))/h;a.length<2*h;)a.push(l,l+o),l+=o+n;a[a.length-1]=e;const _=a.length/2;this._bars.forEach((t=>{const n=t.point;if(t.setVis(!n.isNull)){const h=n.yValue/i;let l=-1,c=0;for(let t=0;t<_-1;t++)if(h>=a[2*t]/e&&h<a[2*(t+1)]/e){l=t+1,c=!r&&h<a[2*t+1]/e?h*e-a[2*t]:o;break}l<0&&(l=_,c=o),t.prepareSegments(_,l,c,s.backStyle)}}))}}],[dn,class extends io{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Zn(this._pointContainer,Oo)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}_layoutPoint(t,e,s,i,r,n){t.trans(s-r/2,i),t.layout(r,n)}}],[pn,class extends oo{constructor(t){super(t,"rct-funnel-series"),this._segments=new Zn(this._pointContainer,Bo),this.add(this._lineContainer=new Wa(t))}_getPointPool(){return this._segments}_prepareSeries(t,e){super._prepareSeries(t,e),this.$_prepareSegments(t,e,this._visPoints),this._lineContainer.prepare(e)}_renderSeries(t,e){this.$_calcRates(this._visPoints),this.$_layoutSegments(t,e)}_runShowEffect(t){t&&Ta.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_resizeZombie(){this._renderSeries(this.width,this.height)}_animationStarted(t){super._animationStarted(t),this._lineContainer.setVis(this._labelContainer.visible)}$_prepareSegments(t,e,s){this._segments.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcRates(t){const e=t.length;let s=0,i=0;if(t.forEach((t=>{s+=t.yValue*(t===this._zombie?this._zombieRate:1)})),e>1||e>0&&!this._zombie){let r=0;for(;r<e-1;r++){const e=t[r],n=I(e.yValue*(e===this._zombie?this._zombieRate:1)/s)||0;e.yRate=100*n,e.yPos=i,e.height=n,i+=n}t[r].yPos=i,t[r].height=1-i}else if(1==e){const e=t[0],s=I(this._zombieRate);i=1-s,e.yRate=100*s,e.yPos=i,e.height=s,e.yPos=i,e.height=1-i}}$_layoutSegments(t,e){function s(t){return _?g+(b-g)*(f-t)/(f-v):g+(b-g)*(t-m)/(v-m)}const i=this.model,r=this._labelViews(),n="inside"===i.getLabelPosition(),a=i.pointLabel,o=a.getOffset(),h=r&&a.options.distance||0,l=this._lineContainer,_=i.options.reversed,c=i.getSize(t,e),d=i.getNeckSize(c.width,c.height),u=new tn,p=i.getCenter(t,e),g=p.x-c.width/2,m=p.y-c.height/2,f=m+c.height,x=g+c.width/2,y=c.height-d.height,b=g+(c.width-d.width)/2,v=_?f-y:m+y;let V;this._lineContainer.setVis(r&&!n),this._segments.forEach((t=>{var e;const i=t.point;if(t.setVis(!i.isNull)){const a=i.yPos*c.height,p=(i.yPos+i.height)*c.height,g=_?f-a:m+a,S=_?f-p:m+p;let k,P,C,A;if(a>=y?(k=b,P=k+d.width,u.move(k,g).lines(P,g,P,S,k,S),t.ny=t.nx1=NaN):p<y?(k=s(g),P=k+2*(x-k),C=s(S),A=C+2*(x-C),u.move(k,g).lines(P,g,A,S,C,S),t.ny=NaN,t.nx1=C-k,t.nx2=A-k):(k=s(g),P=k+2*(x-k),C=b,A=C+d.width,u.move(k,g).lines(P,g,A,v,A,S,C,S,C,v),t.ny=v-g,t.nx1=C-k,t.nx2=A-k),t.setPath(u.close(!0)),i.xPos=x,i.yPos=g+(S-g)/2,r&&(V=r.get(i,0))){const e=l.get(i);if(e.setVis(!n)){const s=t.getBBox();let r=i.xPos,n=i.yPos;isNaN(t.ny)?isNaN(t.nx1)||(r-=t.nx1*s.height/2/s.height):w(t.ny)>s.height/2&&(r-=t.nx1*s.height/2/w(t.ny)),this.$_layoutLabel(V,s,e,o,h,r,n)}else this.$_layoutLabelInner(V,i.xPos,i.yPos);V.setContrast(n&&t.dom)}else null===(e=l.get(i))||void 0===e||e.setVis(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const o=t.getBBox();n+=e.width/2,s.setLine((new tn).move(0,0).line(r,0).end()),s.trans(n,a),n+=r+i,t.trans(n,a-o.height/2)}$_layoutLabelInner(t,e,s){const i=t.getBBox();t.trans(e-i.width/2,s-i.height/2)}}],[mn,class extends qa{constructor(t){super(t,"rct-heatmap-series"),this._cells=new Zn(this._pointContainer,Do)}_getPointPool(){return this._cells}_prepareSeries(t,e){this.$_parepareCells(e,this._visPoints)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this.$_layoutCells(t,e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutCells(this.width,this.height)}$_parepareCells(t,e){const s=new Tt(t._calcedColor),i=[{fill:void 0}],r=t._heatMin,n=t._heatMax-r;this._cells.prepare(e.length,((a,o)=>{const h=a.point=e[o];i[0].fill=s.brighten(1-(h.zValue-r)/n).toString(),this._setPointStyle(a,t,h,i)}))}$_layoutCells(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._labelViews(),a=s._xAxisObj,o=s._yAxisObj,h=i?t:e,l=i?e:t,_=i?0:e;this._cells.forEach((t=>{const e=t.point;if(t.setVis(!e.isNull)){const s=a.getUnitLen(l,e.xValue)*r,c=o.getUnitLen(h,e.yValue)*r;let d,u=a.getPos(l,e.xValue)-s/2,p=_-o.getPos(h,e.yValue)-c/2;if(e.xPos=i?_+o.getPos(h,e.yValue):u+s/2,e.yPos=i?l-a.getPos(l,e.xValue)+s/2:p+c/2,t.setBounds(u,p,s,c),n&&(d=n.get(e,0))){d.layout("center");const t=d.getBBox();i?(p=l-a.getPos(l,e.xValue)-t.height/2,u=_+o.getPos(h,e.yValue)):(u+=s/2,p+=(c-t.height)/2),u-=t.width/2,d.trans(u,p)}}}))}}],[xn,class extends eo{constructor(t){super(t,"rct-histogram-series"),this._bars=new Zn(this._pointContainer,$o)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,a=this._labelViews(),o=s._xAxisObj,h=s._yAxisObj,_=i?t:e,c=i?e:t,d=h.getPos(_,s.getBaseValue(h)),u=i?0:e,p=a&&l(this._labelInfo,{inverted:i,labelPos:s.getLabelPosition(n.options.position),labelOff:s.getLabelOff(n.getOffset())});this._getPointPool().forEach(((s,n)=>{const l=s.point,g=o.getPos(c,l.min),m=o.getPos(c,l.max),f=h.getPos(_,l.yValue),w=m-g+(m>g?-1:1),x=f-d;let y=g+(m-g)/2,b=u;l.xPos=y,l.yPos=b-=f,this._layoutPoint(s,n,y,b+x,w,x*r),p&&(p.labelView=a.get(l,0))&&(i&&(b=c-y,y=u,l.yPos=b,l.xPos=y+=h.getPos(_,l.yGroup)),p.pointView=s,p.x=y,p.y=b,p.wPoint=w,p.hPoint=x,this._layoutLabel(p,t,e))}))}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r)}))}$_layoutBars(t,e){const s=this.model._xAxisObj,i=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach(((a,o)=>{const h=a.point,l=s.getPos(t,h.min),_=s.getPos(t,h.max),c=l+(_-l)/2,d=i.getPos(e,a.point.yValue)*n,u=f(1,_-l-1);h.xPos=c,h.yPos=r-d,a.wPoint=u,a.hPoint=d,a.layout(c,r)}))}}],[$r,ko],[vn,class extends so{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,s){const i=e.marker,r=i._style;i.options.styleCallback,this._bars||(this._bars=new Zn(this._pointContainer,zo)),this._bars.prepare(s.length,((t,n)=>{const a=t.point=s[n];this._setPointStyle(t,e,a),r&&t._marker.setStyleOrClass(r);const o=i.getMarkerStyle(a);o&&t.internalSetStyleOrClass(o)}))}}],[Sn,class extends io{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Zn(this._pointContainer,Fo)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,s){this.$_prepareSticks(e,s)}_layoutPoint(t,e,s,i,r,n){t.trans(s,i),t.layout(r,n)}_setPointStyle(t,e,s,i){super._setPointStyle(t,e,s,i),s.closeValue<s.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}}],[Pn,class extends So{constructor(t){super(t,"rct-pareto-series")}}],[En,class extends oo{constructor(t){super(t,"rct-pie-series"),this._sectors=new Zn(this._pointContainer,Io,null,.5),this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new fa(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new oa(t,"rct-pie-series-inner")),this._textView._text.anchor=Zt.MIDDLE,this._labelContainer.add(this._lineContainer=new Wa(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText;this.$_prepareSectors(t,e,this._visPoints),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&s.visible)&&(this._textView.setModel(t,s,null,null),s.buildSvg(this._textView._text,this._textView._outline,NaN,NaN,e,null))}_renderSeries(t,e){isNaN(this.model._groupPos)?this.$_calcNormal(t,e):this.$_calcGroup(t,e),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rd=this.model.getRadius(t,e),this._rdInner=this.model.getInnerRadius(this._rd)}$_calcGroup(t,e){const s=this.model,i=s._group,r=Math.floor(i.getPolarSize(t,e)/2),n=i.getInnerRadius(r)*r,a=r-n;this._rd=n+(s._groupPos+s._groupSize)*a,this._rdInner=(n+s._groupPos*a)/this._rd}_runShowEffect(t){t&&Ta.grow(this,(t=>{const e=this._sectors.find((t=>t.point.sliced));e&&(e.trans(0,0),this.$_slice(e,this.model.options.autoSlice,!1))}))}_doPointClicked(t){if(t instanceof Io&&this.model.options.autoSlice){const e=this._sectors.find((t=>t.point.sliced));e&&this.$_slice(e,!1,!0),t!==e&&this.$_slice(t,!0,!0)}else this.invalidate()}_doViewRateChanged(t){this.$_layoutSectors(this._visPoints,this.width,this.height)}_resizeZombie(){this._renderSeries(this.width,this.height)}getClipContainer(){return null}$_prepareSectors(t,e,s){this._sectors.prepare(s.length,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=t.length,s=this.model.options.clockwise?1:-1,i=t.filter((t=>(t.visible||t===this._zombie)&&!t.isNull)).map((t=>t===this._zombie?t.yValue*this._zombieRate:t.yValue)).reduce(((t,e)=>t+e),0),r=this.model._totalRad*this._getGrowRate();let n=this.model._startRad;if(e>1||e>0&&!this._zombie)t.forEach((t=>{t.isNull||(t.yRate=I(t===this._zombie?t.yValue*this._zombieRate:t.yValue)/i||0,t.startAngle=n,n+=t.angle=s*t.yRate*r)}));else if(1==e){const e=t[0];e.startAngle=n,e.angle=s*this._zombieRate*r}}$_layoutSectors(t,e,s){const i=this.model,r=i.options.clockwise,n=this._getGrowRate(),a=i.getCenter(e,s),o=this._cx=a.x,h=this._cy=a.y,l=this._rd,_=this._rdInner,c=i.pointLabel,p=this._labelViews(),g="inside"===i.getLabelPosition(),m=c.getOffset(),f=c.options.distance||0,x=this._lineContainer,y=this._slicedOff=i.getSliceOffset(l)*n;let b;if(this._textView.visible){const t=this._textView.getBBox();this._textView.trans(o,h-t.height/2)}this._circle.setVis(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this.$_calcAngles(t),this._sectors.forEach((t=>{var e,s;const i=t.point;if(i.isNull)t.setVis(!1),p&&(b=p.get(i,0))&&b.setVis(!1),null===(s=x.get(i))||void 0===s||s.setVis(!1);else{const s=i.startAngle;let a=0,c=0;if(i.sliced&&n>=1&&!t.isDomAnimating()){const t=s+i.angle/2;a+=d(t)*y,c+=u(t)*y}t.trans(a,c).setVis(!0);const v=i.startAngle+i.angle/2;if(i.xPos=o+d(v)*(y+.7*l),i.yPos=h+u(v)*(y+.7*l),t.setPieSector(p,null,{cx:o,cy:h,rx:l,ry:l,innerRadius:_,start:s,angle:w(i.angle),clockwise:r}),p&&(b=p.get(i,0))){const e=x.get(i);e.setVis(!g)?this.$_layoutLabel(i,b,e,m,f,i.sliced?y:0,r):(e.visible=!1,this.$_layoutLabelInside(i,b,m,0,i.sliced?y:0)),b.setContrast(g&&t.dom).setVis(!0)}else null===(e=x.get(i))||void 0===e||e.setVis(!1)}}))}$_layoutLabel(t,e,s,i,r,n,a){const o=e.isDomAnimating();!o&&e.layout("center");const h=e.getBBox(),l=t.startAngle+t.angle/2;let _=this._cx,c=this._cy,p=this._rd+.8*r,g=d(l)*n,m=u(l)*n,f=_+d(l)*this._rd,w=c+u(l)*this._rd,x=_+d(l)*p,y=c+u(l)*p;const b=x<_;let v;v=b?x-.2*r:x+.2*r,s&&s.setVis(p>0)&&(s.setLine((new tn).move(0,0).quad(x-f,y-w,v-f,y-w).end()),s.setPos(f,w),!o&&s.trans(f+g,w+m)),b?(v-=h.width+i,y-=h.height/2):(v+=i,y-=h.height/2),e.setPos(v,y),!o&&e.trans(v+g,y+m)}$_layoutLabelInside(t,e,s,i,r){e.layout("center");const n=e.getBBox(),a=this._rd*this._rdInner,o=(a>0?a+(this._rd-a)/2:.7*this._rd)+s,h=t.startAngle+t.angle/2;let l=this._cx+d(h)*o,_=this._cy+u(h)*o;e.move(l-n.width/2,_-n.height/2),l=this._cx+d(h)*(r+o),_=this._cy+u(h)*(r+o),e.trans(l-n.width/2,_-n.height/2)}$_slice(t,e,s){const i=this.model,r=i.options.autoSlice?i.options.sliceDuration:0,n=t.point,a=n.startAngle+n.angle/2;(n.sliced=e)?t.transEx(d(a)*this._slicedOff,u(a)*this._slicedOff,r):t.transEx(0,0,r);const o=this._labelViews();if(o){const t=i.pointLabel,a=this._lineContainer,h="inside"===i.getLabelPosition(),l=o.get(n,0);if(l){const o=!h&&a.get(n);if(s&&(h?this.$_layoutLabelInside(n,l,t.getOffset(),t.options.distance,this._slicedOff):this.$_layoutLabel(n,l,o,t.getOffset(),t.options.distance,this._slicedOff,i.options.clockwise)),e){let t=l.tx,e=l.ty;l.trans(l.x,l.y),l.transEx(t,e,r),o&&(t=o.tx,e=o.ty,o.trans(o.x,o.y),o.transEx(t,e,r))}else l.trans(l.tx,l.ty),l.transEx(l.x,l.y,r),o&&(o.trans(o.tx,o.ty),o.transEx(o.x,o.y,r))}}}}],[Tn,class extends no{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new Zn(t,Ho)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&(this._polar,Ta.grow(this))}$_prepareMarkers(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getAutoPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const s=this.model,i=s.options,r=this._inverted,n=s.needClip(!1),a=s._xAxisObj,o=s._yAxisObj,h=this._polar=s.chart._body.getPolar(a),l=this._getGrowRate(),_=this._radius=Math.max(0,+s.options.radius||0)*l,c=+i.rotation||0,p=+i.jitterX||0,g=+i.jitterY||0,m=s.pointLabel,f=m.options.position,w=m.getOffset(),x=this._labelViews(),y=o.prev(r?t:e),b=a.prev(h?h.rd*O:r?e:t),v=r?0:e;let V;this._markers.forEach(((i,m)=>{const S=i.point,P=x&&(V=x.get(S,0));if(i.setVis(!S.isNull)){const m=this._getDrawer(s.getShape(S)),x=k.jitter(S.xValue,p),C=k.jitter(S.yGroup,g);let A,L;if(h){const t=h.start+a.getPos(O,x),e=o.getPos(h.rd,C)*l;A=h.cx+e*d(t),L=h.cy+e*u(t)}else A=a.getPos(b,x),L=v-o.getPos(y,C),r&&(A=o.getPos(y,C),L=e-a.getPos(b,x));S.xPos=A,S.yPos=L,i.setVis(!!h||!n||A>=0&&A<=t&&L>=0&&L<=e)?(i.setPath(m(i._radius||_)),i.trans(A,L).rotate(c),P&&this._layoutLabelView(V,f,w,_,A,L)):P&&P.setVis(!1)}else P&&P.setVis(!1)}))}getNearest(t,e){const s=this.model.options.radius,i=this._markers._internalItems().reduce(((i,r)=>i.distance(s,t,e)<r.distance(s,t,e)?i:r));return{pv:i,dist:i.distance(s,t,e)}}canHover(t,e,s){return t<=this.model.options.radius+s}}],[Bn,class extends qa{constructor(t){super(t,"rct-treemap-series"),this._nodeViews=new Zn(this._pointContainer,Go)}_lazyPrepareLabels(){return!0}_getPointPool(){return this._nodeViews}_prepareSeries(t,e){}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._rootView?this.$_renderGroups(t,e):this.$_renderLeafs(t,e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this._rootView?this.$_renderGroups(this.width,this.height):this.$_renderLeafs(this.width,this.height)}$_renderLeafs(t,e){const s=this.model,i=s._xAxisObj,r=s._yAxisObj,n=this._inverted,a=this._getGrowRate(),o=this._labelViews(),h=n?t:e,l=n?e:t,{roots:_,leafs:c}=s.buildMap(l,h),d=new Tt(s._calcedColor),u=[{fill:""}];let p;null==o||o.prepare(this.doc,this),this._nodeViews.prepare(c.length,((t,e,_)=>{const g=c[e],m=g.point,f=g.parent;let w=d;f&&(!f._color&&f.point.color?w=f._color=new Tt(f.point.color):f._color&&(w=f._color)),t.node=g,u[0].fill=w.brighten(g.index/_).toString(),this._setPointStyle(t,s,m,u),i.options.reversed&&(g.x=l-g.x-g.width),r.options.reversed&&(g.y=h-g.y-g.height),n&&(g.y=g.y-h),t.render(a);let x=g.x+g.width/2,y=g.y+g.height/2;if(m.xPos=n?-g.y-g.height/2:x,m.yPos=n?l-g.x-g.width/2:y,o&&(p=o.get(m,0))){p.setContrast(t.dom).layout("center");const e=p.getBBox();p.setVis(g.width>=e.height&&g.height>=e.height)&&(n?(x=-g.y-g.height/2-e.width/2,y=l-g.x-(g.width+e.height)/2):(x-=e.width/2,y-=e.height/2),p.trans(x,y))}}))}$_renderGroups(t,e){}}],[$n,class extends qa{constructor(t){super(t,"rct-vector-series"),this._arrows=new Zn(this._pointContainer,jo)}_getPointPool(){return this._arrows}_prepareSeries(t,e){this.$_prepareArrows(e,this._visPoints)}_renderSeries(t,e){const s=this.model;let i=s.options.startAngle;const r=s.options.arrowHead,n=s._xAxisObj,a=s._yAxisObj,o=this._inverted,h=o?t:e,l=o?e:t,_=this._getGrowRate(),c=o?0:e,d=n.options.reversed?-1:1,u=a.options.reversed;this._pointContainer.invert(o,e),this._arrows.forEach((t=>{const e=t.point;if(t.setVis(!e.isNull)){const s=n.getPos(l,e.xValue),p=c-a.getPos(h,e.yValue);let g=i+e.angleValue*d;u&&(g=180-g),e.xPos=o?c+a.getPos(h,e.yValue):s,e.yPos=o?l-n.getPos(l,e.xValue):p,t.trans(s,p),t.layout(r,g,!1,_)}}))}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this._renderSeries(this.width,this.height)}getPointsAt(t,e){return[]}$_prepareArrows(t,e){this._arrows.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}}],[Fn,class extends io{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Zn(this._pointContainer,Ja),this.add(this._lineContainer=new Ht(t,"rct-waterfall-series-lines")),this._lines=new Zn(this._lineContainer,Nr)}_getPointPool(){return this._bars}_getLowValue(t){return t.low}_prepareSeries(t,e){super._prepareSeries(t,e),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){const a=t.point;if(t.wPoint=r,t.hPoint=n,i+=n,t.layout(s,i,this._rd,this._rd),e>0){const t=this._lines.get(e-1),o=a._isSum?i-n:a.y>=0?i:i-n;t.setHLine(o,this._xPrev+this._wPrev/2,s-r/2)}this._xPrev=s,this._wPrev=r}_layoutPoints(t,e){this._inverted?this._lineContainer.dom.style.transform=`translate(0px, ${e}px) rotate(90deg) scale(-1, 1)`:this._lineContainer.dom.style.transform="",super._layoutPoints(t,e)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r),t.setStyleOrClass(r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"")})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}]),Sa.register([hr,yo],[Xi,uo],[tr,go],[wr,class extends Sa{constructor(t){super(t,"rct-clock-gauge"),this._rimThick=0,this._secRate=1}_doInitContents(t,e){e.add(this._faceView=new fa(t,"rct-clock-gauge-face")),e.add(this._rimView=new ya(t,"rct-clock-gauge-rim")),e.add(this._labelView=new Qt(t,"rct-clock-gauge-label")),this._labelView.layout=qt.MIDDLE,e.add(this._tickContainer=new Ht(t,"rct-clock-gauge-ticks")),e.add(this._tickLabelContainer=new Ht(t,"rct-clock-gauge-tick-labels")),e.add(this._hourView=new Xt(t,"rct-clock-gauge-hour")),e.add(this._minuteView=new Xt(t,"rct-clock-gauge-minute")),e.add(this._secondView=new Xt(t,"rct-clock-gauge-second")),e.add(this._pinView=new fa(t,"rct-clock-gauge-pin")),this._tickViews=new Zn(this._tickContainer,Nr,"rct-clock-gauge-tick"),this._minorTickViews=new Zn(this._tickContainer,Nr,"rct-clock-gauge-minor-tick"),this._tickLabelViews=new Zn(this._tickLabelContainer,Qt,"rct-clock-gauge-tick-label")}_prepareGauge(t,e){this._tickViews.prepare(e.tick.visible?12:0),this._minorTickViews.prepare(e.minorTick.visible?48:0);const s=Math.round(12/f(1,Math.floor(e.tickLabel.options.step)||1));this._tickLabelViews.prepare(e.tickLabel.visible?s:0,(t=>{t.layout=qt.MIDDLE}))}_renderGauge(t,e){const s=this.model,i=this._exts=s.getExtents(t,e);this._secRate=1,this.$_renderFace(s,i),this.$_renderHands(s,i),s.options.active&&!s.getTime()?this._runner||(this._runner=setInterval((()=>{const t=this._prevSec;this.$_renderHands(this.model,this._exts),w(t-this._prevSec)>=1&&this._secondView.visible&&s.chart.animatable()&&s.secondHand.options.animatable&&this.$_moveSecond(t)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,{cx:i,cy:r,rd:n}=e,a=this._rimThick=this._rimView.visible?this.model.rim.getThickness(n):0;this._faceView.setCircle(i,r,n),this._rimView.visible&&(this._rimView.internalSetStyleOrClass(t.rim._style),this._rimView.setSector({cx:i,cy:r,rx:n,ry:n,innerRadius:1-a/n,start:0,angle:2*Math.PI,clockwise:!0}));const o=n-a;let h=o-this.model.tick.length,l=B,_=O/12;if(this._tickViews.forEach(((t,e)=>{t.setLine(i+d(l)*o,r+u(l)*o,i+d(l)*h,r+u(l)*h),l+=_})),!this._minorTickViews.isEmpty){let t=0;h=o-this.model.minorTick.length,l=B,_=O/60,this._minorTickViews.forEach((e=>{t%5==0&&(l+=_,t++),e.setLine(i+d(l)*o,r+u(l)*o,i+d(l)*h,r+u(l)*h),l+=_,t++}))}if(!this._tickLabelViews.isEmpty){const t=12/this._tickLabelViews.count,e=O/12*t;l=B,this._tickLabelViews.get(0).text="12",h=o-(this.model.tick.length+this.model.tickLabel.options.offset||0),h-=.5*this._tickLabelViews.get(0).getBBox().height,this._tickLabelViews.forEach(((s,n,a)=>{s.text=String(0===n?12:n*t),s.trans(i+d(l)*h,r+u(l)*h),l+=e}))}this._pinView.setCircle(i,r,t.pin.raidus),s.setVis(t.label.visible)&&(s.internalSetStyleOrClass(t.label._style),t.label.buildSvg(s,null,NaN,NaN,null,null),"bottom"===t.label.options.position?s.trans(i,r+h/2):s.trans(i,r-h/2))}$_getNow(){const t=this.model.options.timezone;let e=this.model.getTime()||new Date;if(!isNaN(t)){const s=e.getMinutes()+(e.getTimezoneOffset()+t);e.setMinutes(s)}return e}$_renderHands(t,e){const s=this.$_getNow(),i=s.getHours(),r=s.getMinutes(),n=s.getSeconds(),{cx:a,cy:o,rd:h}=e,l=new tn;let _,c,d,u;_=t.hourHand,c=this._hourView,c.setVis(_.visible)&&(u=O*(i/12+r/60/12+n/60/60/12),d=_.getLength(h-this._rimThick),l.rect(-_.options.thickness/2,-d,_.options.thickness,d),c.internalSetStyleOrClass(_._style),c.setPath(l.close(!0)).trans(a,o).rotate(u*$)),_=t.minuteHand,c=this._minuteView,c.setVis(_.visible)&&(u=O*(r/60+n/60/60),d=_.getLength(h-this._rimThick),l.rect(-_.options.thickness/2,-d,_.options.thickness,d),c.internalSetStyleOrClass(_._style),c.setPath(l.close(!0)).trans(a,o).rotate(u*$)),_=t.secondHand,c=this._secondView,c.setVis(_.visible)&&(u=this._secRate<1?O*(this._aniSec+this._secRate)/60:O*n/60,d=_.getLength(h-this._rimThick),l.rect(-_.options.thickness/2,-d,_.options.thickness,d),c.internalSetStyleOrClass(_._style),c.setPath(l.close(!0)).trans(a,o).rotate(u*$),this._prevSec=n)}$_moveSecond(t){if(!isNaN(t)){this._aniSec=t;const e=new bo(this);e.duration=this.model.secondHand.options.duration||200,e.start()}}}],[lr,class extends Ma{constructor(t){super(t,"rct-circle-gauge-group")}_createPool(t){return new Zn(t,yo)}_doRenderGauges(t,e,s,i){const r=this.doc,n=this.model,a=n.props.getCenter(s,i),o=n.props.getExtents(m(s,i));n.setChildExtents(o),s=i=2*o.radius,e.forEach(((t,e)=>{t.measure(r,n.getVisible(e),s,i,0),t.resize(s,i),t.layout()})),t.trans(a.x-o.radius,a.y-o.radius)}}],[qi,class extends po{constructor(t){super(t,"rct-linear-gauge-group")}_doInitContents(t,e){super._doInitContents(t,e),e.insertChild(this._bandView=new co(t),this._scaleView)}_createPool(t){return new Zn(t,uo)}_renderScale(t,e,s){super._renderScale(t,e,s);const i=this._bandView,r=t.band;let n,a;if(i.setVis(r.visible)){const o=+r.options.gap||0,h=i.measure(this.doc,r,s.width,s.height,1);if(t.options.vertical){const t=h.width+o;s.width-=t,e.width-=t,a=s.y,"opposite"===r.options.position?n=s.x+s.width+o:(n=s.x,s.x+=t,e.x+=t)}else{const t=h.height+o;s.height-=t,e.height-=t,n=s.x,"opposite"===r.options.position?(a=s.y,s.y+=t,e.y+=t):a=s.y+s.height+o}i.resizeByMeasured().layout().trans(n,a)}}}],[er,class extends po{constructor(t){super(t,"rct-bullet-gauge-group")}_createPool(t){return new Zn(t,go)}}]),va.register([vi,_o],[yi,ho],[bi,lo]);class Yo extends sa{constructor(t){super(t,"rct-axis-grid"),this._lines=new Zn(this,Nr)}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this.model,e=t.options,s=t.axis,i=this.width,r=this.height,n=s.isEmpty()?[]:t.getPoints(s,s._isHorz?i:r),a=this._lines.prepare(n.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),o=a.count-1;let h;a.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",n[e]===(s._isHorz?i:r))}));const l=null==e.firstVisible?t.visible:e.firstVisible,_=null==e.lastVisible?t.visible:e.lastVisible;s._isHorz?a.forEach(((e,i)=>{h=0===i?l:i===o?_:t.visible,e.setVis(h)&&e.setVLine(s.prev(n[i]),0,r)})):a.forEach(((e,a)=>{n[a],h=0===a?l:a===o?_:t.visible,e.setVis(h)&&e.setHLine(r-s.prev(n[a]),0,i)}))}}class Uo extends It{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Xt(t)),this._mask.setStroke("none"),this.add(this._upLine=new Xt(t)),this._upLine.setFill("none"),this.add(this._downLine=new Xt(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this._clip?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const i=this._model._sect.len,r=new tn;if(s){let t=0,s=0,n=i/2,a=i;for(r.move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(this._downLine.setPath(r.end(!1)),t=0,r.clear().move(n,t);t<e;)t+=20,r.line(a,t),t+=20,r.line(n,t);for(this._upLine.setPath(r.end(!1)),t=0,r.clear().move(s,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(s,t);for(r.line(n,t);t>=0;)t-=20,r.line(a,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,a=i;for(r.move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(this._upLine.setPath(r.end(!1)),e=0,r.clear().move(e,a);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,a);for(this._downLine.setPath(r.end(!1)),e=0,r.clear().move(e,n);e<t;)e+=20,r.line(e,s),e+=20,r.line(e,n);for(r.line(e,a);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,a);this._mask.setPath(r.end())}}}class Zo extends It{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new oa(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){this.model=e,this._labelView.setVis(!!e.label.options.text)&&(this._labelView.setModel(t,e.label,null,null),this._labelView.setStyles(e.label._style))}layout(t,e,s){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,null,null),this._labelView.layout("center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}}class qo extends Zo{constructor(t,e){super(t),this.insertFirst(this._line=new(e?xa:Nr)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.options.value))&&this._line.setStyles(e._style)}_doLayout(t,e){const s=this.model,i=s.options.value,r=s.label,n=r.options,a=this._line,o=this._labelView.setVis(r.visible)&&this._labelView,h=o.getBBox(),l=x(n.offsetX,0),_=x(n.offsetY,0);let c,d;if(this.vertical()){const r=s.axis.getPos(t,i);if(o.setVis(a.setVis(!isNaN(r)))&&(a.setVLine(r,0,e),o)){switch(n.align){case"center":c=r-h.width/2+l;break;case"right":c=r+l;break;default:c=r-h.width-l}switch(n.verticalAlign){case"bottom":d="inside"===n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="inside"===n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(o.setVis(a.setVis(!isNaN(r)))&&(a.setHLine(r,0,t),o)){switch(n.align){case"center":c=(t-h.width)/2-l;break;case"right":c="inside"===n.position?t-h.width-l:t+l;break;default:c="inside"===n.position?l:-1*(h.width+l)}switch(n.verticalAlign){case"bottom":d=r+_;break;case"middle":d=r-h.height/2-_;break;default:d=r-h.height-_}}}o.visible&&o.trans(c,d)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.options.value)&&i.label.visible)&&this._labelView,a=i.axis.getStartAngle(),o=i.axis.getPos(s.rd,i.options.value);r.setArc(s.cx,s.cy,o,a,i.axis.getTotalAngle(),!1),r.setStyle(Q,"none"),n&&n.trans(s.cx+o*d(s.start),s.cy+o*u(s.start))}}class Ko extends Zo{constructor(t,e){super(t),this.insertFirst(this._box=new(e?ya:Es)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e);const s=e.options,i=m(s.startValue,s.endValue),r=f(s.startValue,s.endValue);this._range=e.axis.trimRange(i,r),this.setVis(e.visible&&this._range[1]>this._range[0])&&this._box.setStyleOrClass(e._style)}_doLayout(t,e){const s=this.model;s.options;const i=s.label,r=i.options,n=this._box,[a,o]=this._range,h=this._labelView.setVis(i.visible)&&this._labelView,l=h.getBBox(),_=x(r.offsetX,0),c=x(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,a),d=s.axis.getPos(t,o);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(d!==i))){let s,a;switch(r.align){case"center":s=i+(d-i-l.width)/2+_;break;case"right":s=d-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":a="inside"===r.position?e-l.height-c:e+c;break;case"middle":a=(e-l.height)/2-c;break;default:a="inside"===r.position?c:-1*(l.height+c)}n.setBox(i,0,d,e),h&&h.trans(f(0,m(t,s)),a)}}else{const i=e-s.axis.getPos(e,a),d=e-s.axis.getPos(e,o);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(i!==d))){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="inside"===r.position?t-l.width-_:t+_;break;default:e="inside"===r.position?_:-1*(l.width+_)}switch(r.verticalAlign){case"bottom":s=i-l.height-c;break;case"middle":s=d+(i-d-l.height)/2-c;break;default:s=d+c}h&&h.trans(e,s),n.setBox(0,d,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,a=i.axis.getStartAngle(),o=i.axis.getPos(s.rd,i.options.startValue),h=i.axis.getPos(s.rd,i.options.endValue);if(r.setSector({cx:s.cx,cy:s.cy,rx:h,ry:h,innerRadius:o/h,start:a,angle:O,clockwise:!0}),n){const t=o+(h-o)/2;n.trans(s.cx+t*d(s.start),s.cy+t*u(s.start))}}}class Qo extends Ht{constructor(){super(...arguments),this._views=new Zn(this,Xt)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e,s){const i=this._rows;this._views.prepare(i.length),this._views.forEach(((s,r)=>{const n=i[r];if(n.axis._isHorz){const i=n.axis.getPos(t,n.from),r=n.axis.getPos(t,n.to);s.setPath(As.rectangle(i,0,r-i,e))}else{const i=n.axis.getPos(e,n.from),r=n.axis.getPos(e,n.to);s.setPath(As.rectangle(0,e-i,t,i-r))}s.setFill(n.color)}))}}class Jo extends Ht{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Ko?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof $e?i=this._rangePool.pop()||new Ko(t,s):e instanceof De&&(i=this._linePool.pop()||new qo(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class th extends Xt{constructor(t){super(t),this.ignorePointer()}setModel(t){t!=this.model&&(this.model=t,this._bar=t.isBar(),this.setClass(this._bar?"rct-crosshair-bar":"rct-crosshair-line"))}layout(t,e,s,i,r){const n=this.model.axis,a=n._isHorz,o=new tn;if(this._bar){const h=n._isHorz?i:r;let l;if(t?l=t.point.xValue:this.model.options.showAlways&&(l=n.options.reversed?n.xValueAt(a?i-e:s):n.xValueAt(a?e:r-s)),n instanceof zs&&(l=_(l)),!isNaN(l)){const t=n.getPos(h,l);let e=n.getUnitLen(h,l);a?o.rect(t-e/2,0,e,r):o.rect(0,r-t-e/2,i,e)}}else(t||this.model.options.showAlways)&&(a?o.vline(e,0,r):o.hline(s,0,i));this.setPath(o.end())}}class eh extends ma{constructor(t){super(t,"Reset Zoom",eh.CLASS_NAME),this.setVis(!1)}}eh.CLASS_NAME="rct-reset-zoom";class sh extends Ht{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Ls(t)),this.add(this._labelView=new oa(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),this._backView.resize(e,s);const i=this._labelView;t.buildSvg(i._text,i._outline,e,s,null,null),i.layout("center");const r=i.getBBox();i.trans((e-r.width)/2,(s-r.height)/2)}}class ih extends sa{constructor(t,e){super(t,ih.BODY_CLASS),this._gridViews=new Map,this._baseViews=new Map,this._breakViews=[],this._seriesViews=[],this._seriesMap=new Map,this._annotationViews=[],this._annotationMap=new Map,this._gaugeViews=[],this._gaugeMap=new Map,this._owner=e,this.add(this._hitTester=new Ls(t)),this._hitTester.setFill("transparent"),this.add(this._background=new Ls(t,"rct-body-background")),this.add(this._image=new aa(t,!0,"rct-body-image")),this.add(this._emptyView=new sh(t)),this.add(this._gridRowContainer=new Qo(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new Ht(t,"rct-axis-grids")),this.add(this._baseContainer=new Ht(t,"rct-axis-bases")),this.add(this._guideContainer=new Jo(t,"rct-axis-guides")),this.add(this._annotationContainer=new Ht(t,"rct-annotations")),this.add(this._seriesContainer=new Ht(t,"rct-series-container")),this.add(this._axisBreakContainer=new Ht(t,"rct-axis-breaks")),this.add(this._labelContainer=new Ht(t,"rct-label-container")),this.add(this._frontGuideContainer=new Jo(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new Ht(t,"rct-front-annotations")),this.add(this._feedbackContainer=new Ht(t,"rct-feedbacks")),this.add(this._zoomButton=new eh(t)),this._crosshairViews=new Zn(this._feedbackContainer,th)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}prepareRender(t,e){this._animatable=Ft._animatable&&e.animatable(),this._prepareSeries(t,e,e._getSeries().getVisibleSeries()),this._prepareGauges(t,e,e._getGauges().getVisibles()),this._prepareAnnotations(t,e._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.prepare(),this._frontGuideContainer.prepare()}pointerMoved(t,e){const s=this.width,i=this.height,r=this._inverted,n=this._polar,a=this._seriesViews,o=a.length,h=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let l,_;if(e instanceof SVGElement&&(e.classList.contains(qa.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(qa.POINT_CLASS)))for(let t=o-1;t>=0;t--)if(_=a[t].pointByDom(e),_){l=a[t];break}const c=null==e?void 0:e.classList,d=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),u=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach((e=>{e.setVis(u)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(o>0){const e=this.chart()._chartOptions.pointHovering.getHintDistance(null==l?void 0:l.model);let s,i,_=!n;for(const t of a)if(!(t.model instanceof Br)){_=!1;break}if(l=null,_)if(o>1){const n=[];a.forEach((a=>{s=x(a.getHintDistance(),e),i=a.getNearest2(t.x,t.y,r),n.push({hint:s,sv:a,pv:i})}));const o=n.reduce(((e,s)=>e.pv&&s.pv?r?w(e.pv.pv.point.xPos-t.x)<w(s.pv.pv.point.xPos-t.x)?e:s:w(e.pv.pv.point.yPos-t.y)<w(s.pv.pv.point.yPos-t.y)?e:s:e||s));l=o.sv,i=o.pv,s=o.hint}else l=a[0],s=x(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else a.forEach((r=>{if(r.getHintDistance&&(s=x(r.getHintDistance(),e),s>0)){const e=r.getNearest(t.x,t.y);(!i||e.dist<i.dist)&&(l=r,i=e)}}));h&&i&&l.canHover(i.dist,i.pv,s)?this.$_setFocused(l,i.pv,t):this.$_setFocused(null,null,t)}return h}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,s){const i=this._focused,r=this._siblings,n=this._siblingSeries;let a,o,h;if(t&&e)switch(this.chart()._chartOptions.pointHovering.getScope(t.model,e.point)){case"axis":h=t.model._xAxisObj.getSeries();case"group":h||(h=t.model._group.getVisibleSeries());const i=h.map((t=>{if(t instanceof oi){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let a;if(t instanceof Kr){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),o=t.getRadius(n.zValue,i,r);a=Math.sqrt(Math.pow(n.xPos-s.x,2)+Math.pow(n.yPos-s.y,2))-o}else a=Math.sqrt(Math.pow(n.xPos-s.x,2)+Math.pow(n.yPos-s.y,2));a<i&&(i=a,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)}));a=h.map((t=>this._owner.getSeriesView(t))),o=[],i.forEach(((t,e)=>{o.push(a[e].getPointView(t))}));break;default:a=[t],o=[e]}let l=[];if(a&&a.forEach(((t,e)=>{l.push(...t.getSiblings(o[e]))})),l=l.length>1?l.sort(((t,e)=>t.hash-e.hash)):l.length>0?l:null,k.equalArrays(r,l)||(a&&a.forEach(((t,e)=>{t.focusPoints(t.getSiblings(o[e]))})),n&&n.forEach((t=>{(!a||a.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=a,this._siblings=l),e!==i){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,t&&this.$_focusSeries(t,!0),this.chart()._chartOptions.options.seriesHovering&&this.$_hoverSeries(t))}!this._focused||this._focused===i&&this._owner.tooltipVisible()&&!this.model.chart._tooltip.isFollowPointer(t.model)?!this._focused&&this._owner.tooltipVisible()&&this._owner.hideTooltip():s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?this._owner.showTooltip(t.model,e,[],this,s):this._owner.hideTooltip()}$_focusSeries(t,e){e?t.model._group?t.front(this._seriesViews,this._seriesViews.filter((e=>e.model._group===t.model._group))):t.front(this._seriesViews):t&&t.parent&&t.back(this._seriesViews)}$_hoverSeries(t){this._seriesViews.forEach((e=>{e.setBoolData(qa.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(qa.DATA_UNHOVER,t&&e!==t)}))}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(this._hoverPointSeries=s).hoverPoint(t):this._hoverPointSeries&&(this._hoverPointSeries.hoverPoint(null),this._hoverPointSeries=null)}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}findSeries(t){return this._seriesMap.get(t)}isConnected(t){return!!this._seriesViews.find((e=>e.model._xAxisObj==t||e.model._yAxisObj==t))}getButton(t){if(this._zoomButton.contains(t))return this._zoomButton}buttonClicked(t){t===this._zoomButton&&(this.model.chart._getXAxes().resetZoom(),this.model.chart._getYAxes().resetZoom())}addFeedback(t){t&&this._feedbackContainer.add(t)}setZoom(t,e,s,i){const r=this.chart(),n=r.isInverted(),a=r.xAxis,o=n?this.height:this.width,h=a.valueAt(o,n?o-i:t),l=a.valueAt(o,n?o-e:s);a.zoom(h,l)&&(this._zoomRequested=!0)}animating(){let t=!1;for(const e of this._seriesViews)if(e.visible&&e._animating()){t=!0;break}return t}getTooltipPos(){return{x:this.tx,y:this.ty}}getFocusPointView(){return this._focused}getSeries(t){return this._seriesViews.find((e=>e.model===t))}removeFocus(){this._seriesViews.forEach((t=>{t._hoverPts.forEach((e=>{e instanceof ro&&e.endHover(t,!1),e.setBoolData(qa.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.stop()})),t._hoverAnis=[]})),this._owner.hideTooltip(),this._focused=null,this._siblings=null,this._siblingSeries=null}getBounds(){return this._hitTester.getBounds()}_doMeasure(t,e,s,i,r){const n=e.chart,a=e.base();if(this._polar=n.isPolar(),this._zoomRequested=!1,this._seriesClip||(this._seriesClip=this.control.clipBounds(),this._seriesClip2=this.control.clipBounds(),this._bodyClip=this.control.clipBounds()),this._background.setStyleOrClass(a._style),a!==e&&this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||n.isWidget()),this._emptyView.setVis(!1!==e.emptyView.visible&&e.isEmpty()),this._seriesViews.forEach(((e,n)=>{e.measure(t,this._series[n],s,i,r)})),!this._polar){this.$_prepareGrids(t,n);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,s,i,r);this.$_prepareAxisBreaks(t,n)}return this._gaugeViews.forEach(((e,n)=>{e.measure(t,this._gauges[n],s,i,r)})),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)})),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:s,height:i}}_clipSeries(t,e,s){const i=s?this._seriesClip:this._seriesClip2;t&&t.setClip(i),e&&e.setClip(i)}_doLayout(){const t=this.width,e=this.height,s=this._image;if(this._inverted?(this._seriesClip.setBounds(0,-t,e,t),this._seriesClip2.setBounds(0,0,t,e)):(this._seriesClip.setBounds(0,0,t,e),this._seriesClip2.setBounds(0,0,t,e)),this._bodyClip.setBounds(0,0,t,e),this._hitTester.resize(t,e),this._background.resize(t,e),s.setVis(s.setImage(this.model.image.options.url,t,e))&&s.setStyleOrClass(this.model.image._style),this._emptyView.visible&&(this.model.emptyView._prepareRender(),this._emptyView.layout(this.model.emptyView,t,e)),this._seriesViews.forEach((s=>{s.model.needClip(!1)&&this._clipSeries(s.getClipContainer(),s.getClipContainer2(),s.clipInvertable()),s.resize(t,e),s.trans(0,0),s.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){for(const s of this._gridViews.values())s.resize(t,e),s.layout();for(const s of this._baseViews.values()){const i=s.tag;s.setStyleOrClass(i.baseLine._style),i._isHorz?s.setVLine(i.getPos(t,i.getBaseValue()),0,e):s.setHLine(i.getPos(e,i.getBaseValue()),0,t)}this._breakViews.forEach((s=>{const i=s._model,r=i.axis;r._isHorz?r.options.reversed?s.trans(t-i._sect.pos,0):s.trans(i._sect.pos,0):r.options.reversed?s.trans(0,i._sect.pos):s.trans(0,e-i._sect.pos-i._sect.len),s.layout(t,e,i.axis._isHorz)}));const s=this.control;if(this._guideClip)this._guideClip.resize(s.width(),s.height());else{const t=s._padding;this._guideClip=s.clipBounds(-1*(t.left+this.tx),-1*(t.top+this.ty),s.width(),s.height())}[this._guideContainer,this._frontGuideContainer].forEach((s=>{s._views.forEach((s=>s.visible&&s.layout(t,e))),s.setClip(this._guideClip)})),this._gridRowContainer.layout(t,e,!1)}this.$_prepareCrosshairs(this.chart()),this._gaugeViews.forEach((s=>{s.resizeByMeasured(),s.layout().transp(s.getPosition(t,e))})),this._layoutAnnotations(this._inverted,this,t,e),this._zoomButton.visible&&this._zoomButton.trans(t-this._zoomButton.getBBox().width-10,10)}$_createGaugeView(t,e){return new(Va[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,a=this._baseViews;for(const t of r.keys())s&&e.containsAxis(t)&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of a.keys())(!s||!e.containsAxis(t)||t instanceof Li&&!t.baseLine.visible||!t.isBaseVisible())&&(a.get(t).remove(),a.delete(t));s&&[e._getXAxes(),e._getYAxes()].forEach((e=>e.forEach((e=>{const s=e.grid;if(!r.has(e)&&(s.visible||s.options.firstVisible||s.options.lastVisible)){const s=new Yo(t);r.set(e,s),i.add(s)}if(e instanceof Li&&e.baseLine.visible&&e.isBaseVisible()&&!a.has(e)){const s=new Nr(t,"rct-axis-baseline");a.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s){const i=this._inverted=e.isInverted(),r=this._seriesMap,n=this._seriesViews;for(const t of r.keys())s.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));this._series=s,n.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove())})),n.length=0,s.forEach((s=>{const a=r.get(s)||Xo(t,s);a._setChartOptions(i,this._animatable,e.loadAnimatable()),a.parent||(this._seriesContainer.add(a),this._labelContainer.add(a._labelContainer)),r.set(s,a),n.push(a),a.prepareSeries(t,s)})),this._seriesContainer.sort(n),n.forEach((t=>this._labelContainer.dom.appendChild(t._labelContainer.dom)))}_prepareGauges(t,e,s){const i=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,a=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,a.forEach((t=>t.remove())),a.length=0,s.forEach((s=>{const o=n.get(s)||this.$_createGaugeView(t,s);i.add(o),n.set(s,o),a.push(o),o.prepareGauge(t,s),o._setChartOptions(r,this._animatable,e.loadAnimatable())}))}_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const a=r.get(e)||Wo(t,e);(e.options.front?i:s).add(a),r.set(e,a),n.push(a)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof Ei&&r.push(...t._getBreaks())}))));i.length<r.length;){const e=new Uo(t);s.add(e),i.push(e)}for(;i.length>r.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(r[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=[];[t._getXAxes(),t._getYAxes()].forEach((t=>t.forEach((t=>{t.crosshair.visible&&s.push(t.crosshair)})))),e.prepare(s.length,((t,e)=>{t.setModel(s[e]),t.setClip(this._bodyClip)}))}_layoutAnnotations(t,e,s,i){this._annotationViews.length>0&&this._annotationViews.forEach((r=>{r._layoutView(t,e,0,0,s,i),r.setClip(this._polar||r.model.options.noClip?T:this._bodyClip)}))}}ih.BODY_CLASS="rct-body";class rh extends It{constructor(t){super(t,nh.HANDLE_STYLE),this.add(this._back=new Ls(t)),this.add(this._shape=new Xt(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*m(t,e);const r=new tn;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2},i/=3,r.polygon(-i-1,0,-1,-i,-1,i),r.polygon(i+1,0,1,-i,1,i),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class nh extends sa{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(nh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(nh.MASK_STYLE)}constructor(t){super(t,nh.CLASS_NAME),this.add(this._back=new Ls(t,nh.BACK_STYLE)),this.add(this._container=new Ht(t,null)),this.add(this._mask=new Ls(t,nh.MASK_STYLE)),this.add(this._trackView=new Ls(t,nh.TRACK_CLASS)),this.add(this._thumbView=new Ls(t,nh.THUMB_CLASS)),this.add(this._startHandle=new rh(t)),this.add(this._endHandle=new rh(t)),this._startHandle.setStyle("cursor","ew-resize"),this._endHandle.setStyle("cursor","ew-resize"),this._mask.setStyle("cursor","ew-resize"),this._mask.dom.addEventListener("dblclick",(()=>{this.model.axis()._zoom&&this.model.axis().resetZoom()}))}dblClick(t){const e=this.model.axis();return this._startHandle.contains(t)?(e.zoom(e._zoom.min,e._zoom.end),!0):this._endHandle.contains(t)?(e.zoom(e._zoom.start,e._zoom.max),!0):void(this.contains(t)&&e.resetZoom())}svgToElement(t,e){return this.control.svgToElement(this._back,t,e)}_doMeasure(t,e,s,i,r){const n=e._naviChart;n.firstSeries;let a=s,o=i;return e._vertical?a=e.getSize():o=e.getSize(),e._naviChart.layoutAxes(a,o,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis._calcPoints(a,101),e._naviChart.yAxis._calcPoints(o,1),{width:a,height:o}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=this.width,r=this.height;if(this._back.resize(i,r),e._vertical);else{const t=s?(s.start-s.min)*i/s.total():0,e=s?(s.end-s.min)*i/s.total():i;this._mask.setBounds(t,0,e-t,r),this._trackView.setBounds(-2,r,i+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,r,e-t,6),this._startHandle.layout(r/3,r/3,!1),this._startHandle.trans(t,r+3),this._endHandle.layout(r/3,r/3,!1),this._endHandle.trans(e,r+3)}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,i,r,1),this._seriesView.resize(i,r),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,i,r,1),this._xAxisView.resize(i,r),this._xAxisView.layout()),this._yAxisView.setVis(!1)}$_prepareSeriesView(t,e){const s=e.firstSeries;let i=this._seriesView;i&&i.model!==s&&(i.remove(),i=this._seriesView=null),i||(this._container.add(i=this._seriesView=Xo(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s)}$_prepareXAxisView(t,e){const s=e.xAxis;let i=this._xAxisView;i&&i.model!==s&&(i.remove(),i=this._xAxisView=null),i||(this._container.add(i=this._xAxisView=new ga(t)),i._simpleMode=!0)}$_prepareYAxisView(t,e){const s=e.yAxis;let i=this._yAxisView;i&&i.model!==s&&(i.remove(),i=this._yAxisView=null),i||(this._container.add(i=this._yAxisView=new ga(t)),i._simpleMode=!0)}}nh.CLASS_NAME="rct-navigator",nh.BACK_STYLE="rct-navigator-back",nh.MASK_STYLE="rct-navigator-mask",nh.HANDLE_STYLE="rct-navigator-handle",nh.HANDLE_BACK_STYLE="rct-navigator-handle-back",nh.TRACK_CLASS="rct-navigator-track",nh.THUMB_CLASS="rct-navigator-thumb";class ah extends Ut{constructor(t){super(),this.chart=t}}class oh extends ah{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){const n=this.chart.getBounds(),a=this._body.getBounds();return this._xStart=e-(a.x-n.x),this._yStart=s-(a.y-n.y),this._body.addFeedback(this._feedback=new Ls(this.chart.doc(),"rct-zoom-tracker")),!0}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e-=i.y-s.y,this._body.setZoom(0,m(this._yStart,e),this._body.width,f(this._yStart,e))):(t-=i.x-s.x,this._body.setZoom(m(this._xStart,t),0,f(this._xStart,t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),a=this._body.getBounds();return this._vertical?(r=Math.max(0,Math.min(a.height,r-(a.y-n.y))),this._feedback.setBounds(0,m(this._yStart,r),this._body.width,w(this._yStart-r))):(i=Math.max(0,Math.min(a.width,i-(a.x-n.x))),this._feedback.setBounds(m(this._xStart,i),0,w(this._xStart-i),this._body.height)),!0}}class hh extends ah{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,a=n.model.axis._zoom;if(a){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=a.length(),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let a;return n._vertical?(a=n.svgToElement(i,r).y-this._startOff,a=n.getZoomPos(n.height-a-n._thumbView.height),n.model.axis.zoom(a,a+this._zoomLen)):(a=n.svgToElement(i,r).x-this._startOff,a=n.getZoomPos(a),n.model.axis.zoom(a,a+this._zoomLen),console.log(a)),!0}}class lh extends ah{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}_doStart(t,e,s,i,r){const n=this._handleView,a=n.elementToSvg(0,0);return this._startOff=n._vertical?s-a.y-n.height/2:e-a.x-n.width/2,this._handleView.setBoolData("select",!0),!0}_doEnded(t,e){this._handleView.setBoolData("select",!1)}_doDrag(t,e,s,i,r){const n=this._view,a=n.model.axis();a._prepareZoom();let o=n.svgToElement(i,r).x-this._startOff;const h=a._zoom.total(),l=a._zoom.min,_=n.model.options.minSize;return this._handleView._vertical?this._isStart:this._isStart?o>0?a.zoom(o*h/n.width+l,NaN,_):a.zoom(l,NaN,_):o>0&&o<n.width?a.zoom(NaN,o*h/n.width+l,_):o>=n.width&&a.zoom(NaN,a._zoom.max,_),!0}}class _h extends ah{constructor(t,e,s){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,s,i,r){const n=this._view.model.axis(),a=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-a.y:e-a.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,s,i,r){const n=this._view,a=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(a*this._totalLen/n.height):this.$_moveZoom(a*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=f(0,m(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class ch{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const s=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(t,e,s.x,s.y),this._prevX=this._clickX=s.x,this._prevY=this._clickY=s.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),{x:s,y:i}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const r=this.isDragging(),n=this._clickElement;s<0||s>=e.control.dom().offsetWidth||i<0||i>=e.control.dom().offsetHeight||(r?this.$_doDrag(t,n,s,i):(!this._dragTracker&&(w(this._clickX-s)>3||w(this._clickY-i)>3)||this._dragTracker&&!r)&&this.$_startMove(t,n,s,i))}this._prevX=s,this._prevY=i,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(t.target)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleClick(t){const e=this._chart.chartView(),s=this._clickElement,i=e.getButton(s);let r,n,a;if(i)!0!==i.click()&&e.buttonClicked(i);else if(n=e.legendByDom(s))if(n.source instanceof Ms){const t=n.source,e=this._chart.model.seriesByPoint(t);if(e){e.setPointVisible(t,!t.visible);const s=this._chart.chartView().findSeriesView(e);s instanceof oo&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible,e.bodyView().hoverSeries(n.source.visible?n.source:null);else(a=e.seriesByDom(s))?a.clicked(s):(r=e.creditByDom(s))&&r.clicked(s)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,s=this._clickElement;!e.visible||e.dblClick(s)}handleWheel(t){}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}isDragging(){return this._dragTracker&&this._dragTracker.dragging}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_pointerToPoint(t){const e=this._chart.svg().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_getDragTracker(t,e,s){const i=this._chart.chartView(),r=i.bodyOf(t);return ua.isThumb(t)?new hh(this._chart,i.getScrollView(t)):nh.isHandle(t)?new lh(this._chart,i._navigatorView,t):nh.isMask(t)&&r&&r.model.isZoomed()?new _h(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new oh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(t,e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,s,i,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),this._dragTracker){if(this._dragTracker.start(t,e,s,i,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,s,i),this._dragTracker=null)}}class dh extends Ht{constructor(t){super(t,dh.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new Qt(t,"rct-history-item");e.anchor=Zt.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new Qt(t);e.anchor=Zt.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let a=0;a<r;a++)e[a].text=t[a].name,e[a].transX(n),a<r-1&&(n+=e[a].width+i,s[a].transX(n),n+=s[a].width+i)}}dh.TITLE_CLASS="rct-history";class uh extends sa{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new Ls(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Qt(t,"rct-legend-item-label")),this._label.anchor=Zt.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text()||"…";const n=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():qn,a=Qn(this._label.getBBox());return this._gap=x(e.legend.options.markerGap,0),{width:n.width+this._gap+a.width,height:f(n.height,a.height)}}_doLayout(t){const e=this._rMarker,s=x(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class ph extends ia{constructor(t){super(t,ph.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new Zn(this,uh)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.options,a=e.items(),o=this._vertical="vertical"===e.getLayout();return this._ipr=x(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?x(n.gap,0):0,o?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,a),this.$_measure(t,e,o,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,a=t.itemGap||0,o=this._margins,h=this._paddings,l=this._vertical,_=o.left+h.left,c=o.top+h.top;let d,u=_,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor();t._marker.setColor(i),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(d=t.map((t=>t.height)).reduce(((t,e)=>t+e))+a*(t.length-1)+o.top+o.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach((t=>{t.trans(u,p),p+=t.height+a})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=_,"center"!==r&&"end"!==r||(d=t.map((t=>t.width)).reduce(((t,e)=>t+e))+a*(t.length-1)+o.left+o.right+h.left+h.right,u+="center"===r?(this.width-d)/2:this.width-d),t.forEach((t=>{t.trans(u,p),u+=t.width+a})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const a=e.options,o=e.items(),h=this._itemViews,l=a.itemGap||0,_=a.lineGap||0,c=e.getMarkerSize(),d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,m,w,x;h.forEach(((e,s)=>{e.setMarker(o[s].source.legendMarker(t,c)),e.measure(t,o[s],r,n,1)}));let y=0,b=0;if(s){for(;y<d;)x=h.get(y),b%i==0?(u.push(w=[x]),m=x.mh,b++,y++):(m+=l+x.mh,m<=n?(w.push(x),b++,y++):b=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=f(s,t.mw),r=f(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=f(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;y<d;)x=h.get(y),b%i==0?(u.push(w=[x]),g=x.mw,b++,y++):(g+=l+x.mw,g<=r?(w.push(x),b++,y++):b=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=f(s,t.mh)})),e+=l*(t.length-1),g=f(g,e),m+=s,p.push(s)})),m+=_*(u.length-1)}return{width:g,height:m}}}ph.LEGEND_CLASS="rct-legend";let gh=class extends ra{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(t,e,s,i,r){const n=this.views,a=[];for(this.isX=e,s&&s._axes.forEach((t=>{a.push(t)}));n.length<a.length;){const e=new ga(t);this.add(e),n.push(e)}for(;n.length>a.length;)n.pop().remove();if(n.forEach(((t,e)=>{a[e]._runPos,t.model=a[e]})),this.axes=a,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){const i=this.views,r=this.axes;i.forEach(((s,i)=>{const n=r[i];e.forEach((e=>{e.forEach((e=>{e.isConnected(n)&&s.setVis(this.visible)&&s.prepareGuides(t,e.row,e.col,e._guideContainer,e._frontGuideContainer)}))}))}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}setMargins(t,e,s,i){this.views.forEach((r=>r.setMargins(t,e,s,i)))}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){const n=this.axes;if(this.isHorz){let e=0;return this.views.forEach(((a,o)=>{e+=a.measure(t,n[o],s,i,r).height})),{width:s,height:e}}{let e=0;return this.views.forEach(((a,o)=>{e+=a.measure(t,n[o],s,i,r).width})),{width:e,height:i}}}_doLayout(t){this.isHorz?this.views.forEach((t=>{t.resize(this.width,t.mh),t.layout()})):this.views.forEach((t=>{t.resize(t.mw,this.height),t.transX(this.width-t.mw),t.layout()}))}};class mh extends ra{constructor(t,e){super(t,"rct-axis-container"),this.isX=e,this.sections=[]}prepare(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new gh(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((n,a)=>{this.isX?(n.row=i,n.col=a):(n.col=i,n.row=a),n.prepare(t,this.isX,r[a],e,s)}))}prepareGuides(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new gh(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((r,n)=>{this.isX?(r.row=i,r.col=n):(r.col=i,r.row=n),r.prepareGuides(t,e,s)}))}checkWidths(t,e,s){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkWidths(t,e,s)),0):0}checkHeights(t,e,s){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkHeights(t,e,s)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){let n=0,a=0;return this._isHorz?this.sections.forEach((n=>{a=f(a,n.measure(t,e,s,i,r).height)})):this.sections.forEach((a=>{n=f(n,a.measure(t,e,s,i,r).width)})),{width:n,height:a}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((e,s)=>{e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height),e.trans(t[2*s+1]-t[1],0),e.layout()})):this.width>0&&this.sections.forEach(((e,s)=>{e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]),e.trans(0,this.height-(t[2*(s+1)]-t[1])),e.layout()}))}}class fh extends ih{constructor(){super(...arguments),this.row=0,this.col=0}prepareRender(t,e){const s=this.row,i=this.col,r=e._split.getPane(s,i).body,n=e._getSeries().getPaneSeries(s,i),a=e._getGauges().getPaneVisibles(s,i);this._animatable=Ft._animatable&&e.animatable(),this._prepareSeries(t,e,n),this._prepareGauges(t,e,a),this._prepareAnnotations(t,r.getAnnotations())}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}}class wh extends Ht{constructor(t,e){super(t,wh.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}get bodies(){return this._bodies}bodyViewOf(t){return this._bodies.find((e=>e.contains(t)))}prepare(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)}measure(t,e,s,i,r,n,a){const o=e.chart,h=this._inverted=e.chart.isInverted(),l=r,_=n;this.$_prepareAxes(t,s,!0),this.$_prepareAxes(t,i,!1),e.layoutAxes(r,n,h,a),h?(r-=this._xContainers.reduce(((e,s)=>e+s.checkWidths(t,r,n)),0),n-=this._yContainers.reduce(((e,s)=>e+s.checkHeights(t,r,n)),0)):(n-=this._xContainers.reduce(((e,s)=>e+s.checkHeights(t,r,n)),0),r-=this._yContainers.reduce(((e,s)=>e+s.checkWidths(t,r,n)),0)),e.layoutAxes(r,n,h,a),this._xContainers.forEach((e=>e.measure(t,o,r,n,a))),this._yContainers.forEach((e=>e.measure(t,o,r,n,a))),r=l,n=_,h?(r-=this._xContainers.reduce(((t,e)=>t+e.mw),0),n-=this._yContainers.reduce(((t,e)=>t+e.mh),0)):(n-=this._xContainers.reduce(((t,e)=>t+e.mh),0),r-=this._yContainers.reduce(((t,e)=>t+e.mw),0)),e.layoutAxes(r,n,h,a),this.$_prepareAxisGuides(t,s,!0),this.$_prepareAxisGuides(t,s,!1),this._xContainers.forEach((e=>e.measure(t,o,r,n,a))),this._yContainers.forEach((e=>e.measure(t,o,r,n,a)));const c=e.getXLens(h?n:r),d=e.getYLens(h?r:n);e.calcAxesPoints(c,d)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this.$_calcExtents(t,e,s),this.$_layoutAxes(t,!0,e,s),this.$_layoutAxes(t,!1,e,s),this.$_layoutBodies(t,e,s)}seriesByDom(t){for(const e of this._bodies){const s=e.seriesByDom(t);if(s)return s}}getSeries(t){for(const e of this.bodies){const s=e.findSeries(t);if(s)return s}}$_init(t){this._back||(this.add(this._back=new Ls(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new Ht(t,T)),this.add(this._axisContainer=new Ht(t,T)))}$_prepareBodies(t,e){const s=e.chart,i=e.paneCount(),r=this._bodies,n=this._bodyMap=[];for(;r.length<i;){const e=new fh(t,this._owner);this._bodyContainer.add(e),r.push(e)}for(;r.length>i;)r.pop().remove();for(let t=0;t<e.rowCount();t++){const s=[];for(let i=0;i<e.colCount();i++){const n=r[t*e.colCount()+i];s.push(n),n.row=t,n.col=i}n.push(s)}r.forEach((e=>{e.prepareRender(t,s),e.prepareGuideContainers(),e._gridRowContainer.prepare()}))}$_prepareAxes(t,e,s){const i=s?this._xContainers:this._yContainers,r=s?e.rows():e.cols();for(;i.length<r;){const e=new mh(t,s);this._axisContainer.add(e),i.push(e)}for(;i.length>r;)i.pop().remove();i.forEach(((s,i)=>{s.prepare(t,this._bodyMap,e,i)}))}$_prepareAxisGuides(t,e,s){(s?this._xContainers:this._yContainers).forEach(((s,i)=>{s.prepareGuides(t,this._bodyMap,e,i)}))}$_calc(t,e,s,i){const r=new Array(2*(e+1)),n=s-t.reduce(((t,e)=>t+e[i]),0),a=new Array(e);let o=0,h=0;for(h=0;h<e;h++)a[h]=n/e;for(h=0;h<e;h++)r[2*h]=o,r[2*h+1]=o+=t[h][i],o+=a[h];return r[2*h]=o,r[2*h+1]=o+t[h][i],r}$_calcExtents(t,e,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),e,"mw"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),s,"mh")):(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),s,"mh"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),e,"mw"))}$_layoutAxes(t,e,s,i){const r=this.control._padding,n=this._rowPoints,a=this._colPoints,o=e?this._xContainers:this._yContainers;if(this._inverted)if(e){const t=a[1],e=a[a.length-2]-t;o.forEach(((t,s)=>{t.resize(t.mw,e),t.trans(n[2*s],i-a[a.length-2]),t.layout(a)}))}else{const t=n[1],e=n[n.length-2]-t;o.forEach(((s,o)=>{const h=s.sections;for(let t=0,e=h.length;t<e;t++){const s=h[t],i=0===t?r.left:0,a=t===e-1?r.right:0;let o=0,l=0;e>1&&(o=n[2*t+1]-n[2*t],l=n[2*(t+1)+1]-n[2*(t+1)],0===t?h[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2:t===e-1?h[t-1].isEmpty()?o=n[2*(t-1)]-n[2*(t-1)-1]:o/=2:(h[t-1].isEmpty()?o=n[2*(t-1)]-n[2*(t-1)-1]:o/=2,h[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2)),s.setMargins(i,o,l,a)}s.resize(e,s.mh),s.trans(t,i-a[2*o+1]),s.layout(n)}))}else if(e){const t=a[1];s=a[a.length-2]-t,o.forEach(((e,h)=>{const l=e.sections;for(let t=0,e=l.length;t<e;t++){const s=l[t],i=0===h?r.left:0,_=h===o.length-1?r.right:0;let c=0,d=0;e>1&&(c=a[2*t+1]-a[2*t],d=a[2*(t+1)+1]-a[2*(t+1)],0===t?l[t+1].isEmpty()?d=a[2*(t+1)]-a[2*(t+1)-1]:d/=2:t===e-1?l[t-1].isEmpty()?c=a[2*(t-1)]-a[2*(t-1)-1]:c/=2:(l[t-1].isEmpty()?c=a[2*(t-1)]-a[2*(t-1)-1]:c/=2,l[t+1].isEmpty()?d=a[2*(t+1)]-n[2*(t+1)-1]:d/=2)),s.setMargins(i,c,d,_)}e.resize(s,e.mh),e.trans(t,i-n[2*h+1]),e.layout(a)}))}else{const t=n[n.length-2],e=t-n[1];o.forEach(((s,r)=>{s.resize(s.mw,e),s.trans(a[2*r],i-t),s.layout(n)}))}}$_layoutBodies(t,e,s){t.chart._body;const i=t.rowCount(),r=t.colCount(),n=this._rowPoints,a=this._colPoints,o=this._bodies;if(this._inverted)for(let e=0;e<i;e++){const s=n[2*(e+1)-1],i=n[2*(e+1)];for(let n=0;n<r;n++){const h=o[e*r+n],l=a[2*n+1],_=a[2*(n+1)];h.measure(this.doc,t.getPane(e,n).body,i-s,_-l,1),h.resize(i-s,_-l),h.trans(s,this.height-_),h.layout()}}else for(let e=0;e<i;e++){const i=n[2*(e+1)-1],h=n[2*(e+1)];for(let n=0;n<r;n++){const l=o[e*r+n],_=a[2*(n+1)-1],c=a[2*(n+1)];l.measure(this.doc,t.getPane(e,n).body,c-_,h-i,1),l.resize(c-_,h-i),l.trans(_,s-h),l.layout()}}}}wh.STYLE_NAME="rct-panes";class xh extends It{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new fa(t))}layout(){}}class yh extends It{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new Ht(t,"rct-polar-axis-markers")),this._markViews=new Zn(this._markContainer,xh),this.add(this._gridContainer=new It(t,"rct-polar-axis-grids")),this._labelViews=new Zn(this._labelContainer=s,ca,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this._markLen=e.tick.options.length,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,s,i)}layout(t,e,s,i){const r=this._model._ticks;return this._doLayout(this._model,e,s,i,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,s,i){const r=s.getLabelText(e,i),n=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s._style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=r){n&&r.match(pa)?t.setLabel(s,e,r.replace(pa,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(this._labelContainer.setVis(s.visible)){const t=e._ticks;this._labelContainer.setStyleOrClass(s._style),this._labelViews.prepare(t.length,((e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)}))}}prepareGuides(t,e,s){let i=this._model.guides.filter((t=>!t.options.front));e.setAll(t,i,!0),i=this._model.guides.filter((t=>t.options.front)),s.setAll(t,i,!0)}}class bh extends yh{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new Zn(this._gridContainer,Nr,bh.GRID_CLASS),e.insertFirst(this._startView=new Nr(t,bh.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Nr(t,bh.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new xa(t,bh.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const a=t.getStartAngle(),o=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*o/O)),this._gridContainer.visible&&this._gridLines.forEach(((t,n)=>{const o=r[n].pos,h=e+d(a+o)*i,l=s+u(a+o)*i;t.setFill("none"),t.setLine(e,s,h,l)})),this._labelContainer.visible){const n=this._labelViews.count,o=Math.ceil(9/(360/n)),h=i+t.tick.options.length,l="center";this._labelViews.forEach(((t,i)=>{if(t.setVis(i%o==0)){t.layout(l);const n=r[i],o=t.getBBox(),_=a+n.pos,c=e+d(_)*(h+o.width/2)-o.width/2,p=s+u(_)*(h+o.height/2)-o.height/2;t.trans(c,p)}})),n>2&&w(r[n-1].pos-r[n-2].pos)<O/24&&this._labelViews.get(n-1).setVis(!1)}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,a,t.getTotalAngle(),!0);else{const t=[];r.map((r=>{const n=r.pos;t.push(e+d(a+n)*i,s+u(a+n)*i)})),this._lineView.setPolyline(t)}this._startView.visible&&(this._startView.setLine(e,s,e+d(a)*i,s+u(a)*i),this._endView.setLine(e,s,e+d(a+o)*i,s+u(a+o)*i))}}bh.LINE_CLASS="rct-polar-xaxis-line",bh.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",bh.GRID_CLASS="rct-polar-xaxis-grid-line";class vh extends yh{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridLines=new Zn(this._gridContainer,xa,vh.GRID_LINE_STYLE),e.add(this._lineView=new Nr(t,"rct-polar-yaxis-line"))}_doPrepare(t,e,s,i){const r=t.line;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridLines.prepare(e.length,null),(this._lineView.visible=r.visible)&&this._lineView.setStyleOrClass(r._style)}_doLayout(t,e,s,i,r,n){const a=n.getStartAngle(),o=n.getTotalAngle();if(this._gridContainer.visible){const t=this._circular;this._gridLines.forEach(((i,h)=>{const l=r[h].pos;if(i.setFill("none"),t)i.setArc(e,s,l,a,o,!0);else{const t=[];n._ticks.forEach((i=>{const r=i.pos;t.push(e+d(a+r)*l,s+u(a+r)*l)})),i.setPolyline(t)}}))}if(this._labelContainer.visible)if(n.isArced()){const t=n.getStartAngle();this._labelViews.forEach(((i,n)=>{const a=e+d(t)*r[n].pos-i.getBBox().width/2,o=s+u(t)*r[n].pos-i.getBBox().height/2;i.setContrast(null).trans(a,o)}))}else this._labelViews.forEach(((t,i)=>{t.setContrast(null).trans(e+2,s-r[i].pos-t.getBBox().height/2)}));this._lineView.visible&&this._lineView.setVLine(e,s,s-i)}}vh.GRID_LINE_STYLE="rct-polar-yaxis-grid-line";class Vh extends ih{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,a=super._doMeasure(t,e,s,i,r);return this._prepareAxes(t,n.xAxis,n._getYAxes().items(),this.model.options.circular,n.xAxis.isArced()),a}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._seriesViews.forEach((t=>{var r;t.model.needClip(!0)&&(this._polarClip||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(e,s,i),t.getClipContainer().setClip(this._polarClip),null===(r=t.getClipContainer2())||void 0===r||r.setClip(this._polarClip)),t.resize(2*i,2*i),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.layout(t.chart.xAxis,e,s,i)})),[this._guideContainer,this._frontGuideContainer].forEach((e=>{e._views.forEach((e=>e.visible&&e.layout(this.width,this.height,t.getPolar(e.model.axis))))})),this._layoutAnnotations(!1,this,this.width,this.height)}_prepareAxes(t,e,s,i,r){this._axisContainer||(this.insertFirst(this._axisLabelContainer=new Ht(t,"rct-polar-axis-labels")),this.insertFirst(this._lineContainer=new Ht(t,"rct_axis-lines")),this.insertFirst(this._axisContainer=new Ht(t,"rct-polar-axes")));const n=this._yAxisViews;for(;n.length<s.length;){const e=new vh(t,this._lineContainer,this._axisLabelContainer);this._axisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisView||this._axisContainer.add(this._xAxisView=new bh(t,this._lineContainer,this._axisLabelContainer)),this._xAxisView.prepare(t,e,i,r)}}class Sh extends ia{constructor(t,e){super(t,e?Sh.SUBTITLE_CLASS:Sh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new Qt(t)),this._richText=new oe}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),Qn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var kh,Ph;Sh.TITLE_CLASS="rct-title",Sh.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(kh||(kh={}));class Ch extends It{constructor(t){super(t,Ch.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._tailVisible=!0,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Xt(t,"rct-tooltip-back")),this.add(this._top=new Xt(t,"rct-tooltip-top")),this.add(this._textView=new Qt(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+Ft.SHADOW_FILTER+")"),this._textView.anchor=Zt.START,this._richText=new oe,this.close(!0,!1)}show(t,e,s,i,r,n,a){const o=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,o,s&&s.map((t=>t.point)));if(!l)return;const _=h.options,c=_.text||l.getTooltipText(t,o);if(!c||!c.trim())return;this.setStyleOrClass(h._style);const d=this.control,u=d.contentWidth(),p=d.contentHeight(),g=this._textView,w=t.chart.isInverted();let x=t._yAxisObj.options.reversed;this._richText.setFormat(c),this._richText.build(g,NaN,NaN,null,h.getTextDomain());const y=g.getBBox();let b=f(_.minWidth||0,y.width+16),v=f(_.minHeight||0,y.height+12)+this._topHeight;t instanceof En&&t.options.legendByPoint?this._top.setFill(o._calcedColor):this._top.setFill(t._calcedColor);const V="visible"===this.getStyle("visibility")?300:0,S=_.offset+this._tailSize,k=n.getFocusPointView().getBounds(),P=d.getBounds();let C,A=!1;if(w){C=r-v/2-f(0,m(r-v/2,p-v)),this._tailVisible=Math.abs(v/2-this._radius-this._tailSize/2)>Math.abs(C),A=h.isFollowPointer(t)?x?b+S>i:i+b+S>u:x?b+S>k.x-P.x+k.width:k.x-P.x-S>u-b,A&&(x=!x);const e=x?kh.LEFT:kh.RIGHT;this.drawTooltip(0,0,b,v,e,C),x?i-=b+S:i+=S,r-=v/2}else{C=i-b/2-f(0,m(i-b/2,u-b)),this._tailVisible=Math.abs(b/2-this._radius-this._tailSize/2)>Math.abs(C),A=h.isFollowPointer(t)?x?r+v+S>p:r-(v+S)<0:x?p-(k.y-P.y-d._padding.top)<v+S:P.bottom-k.bottom+S>p-v,A&&(x=!x);const e=x?kh.BOTTOM:kh.TOP;this.drawTooltip(0,0,b,v,e,C),i-=b/2,x?r+=S:r-=v+S}i=f(0,m(i,u-b)),r=f(0,m(r,p-v)),this.transEx(i,r,V,!1),0===V&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.options.hideDelay:xi.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Vs(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,n){const a=this._tailSize,o=this._radius,h=this._topHeight;let l=["M",t+o,e,"L",t+s-o,e,"Q",t+s,e,t+s,e+o,"L",t+s,e+i-o,"Q",t+s,e+i,t+s-o,e+i,"L",t+o,e+i,"Q",t,e+i,t,e+i-o,"L",t,e+o,"Q",t,e,t+o,e];if(this._tailVisible)switch(r){case kh.TOP:l=l.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case kh.BOTTOM:l=l.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case kh.LEFT:l=l.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case kh.RIGHT:l=l.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const _=r===kh.BOTTOM,c=_?["M",t,e+i-h,"l",s,0,"l",0,h-o,"q",0,o,-o,o,"l",2*o-s,0,"q",-o,0,-o,-o]:["M",t+o,e,"l",s-2*o,0,"q",o,0,o,o,"l",0,h-o,"l",-s,0,"l",0,o-h,"q",0,-o,o,-o],d=this._textView,u=d.getBBox();t+=(s-u.width)/2,e+=(i-u.height+(_?-h:h))/2,d.trans(t,e),this._top.setPath(c),this._back.setPath(l)}}Ch.CLASS_NAME="rct-tooltip";class Ah extends ra{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Sh(t,!1)),this.add(this.subtitleView=new Sh(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,a=e._subtitle;let o,h=0,l=0,_=0,c=0,d=this.titleView,u=s,p=0,g=0;switch(d.setVis(n.visible)?(o=d.measure(t,n,s,i,r),l=this._hTitle=o.height,h=this._wTitle=o.width):d.setModel(n),(d=this.subtitleView).setVis(a.visible)?(o=d.measure(t,a,s,i,r),c=this._hSub=o.height,_=this._wSub=o.width,g=+a.options.titleGap||0):d.setModel(a),a.options.position){case"left":case"right":p=f(l,c),u=h+g+_;break;default:p=l+g+c,u=f(u,h+_)}return p>0&&(p+=this.titleView.visible?x(n.options.gap,0):x(a.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,a=r&&r.options,o=i&&i.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,h=r&&r.visible?this._wSub>t.wPlot||"chart"===a.alignBase?t.wChart:t.wPlot:0;let l=this._wTitle>t.wPlot||i&&"chart"===n.alignBase?0:t.xPlot,_=this._wSub>t.wPlot||r&&"chart"===a.alignBase?0:t.xPlot;if(o>0&&h>0){const t=(t,e,s)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-s;default:return(e-s)/2}},c=()=>{const e=f(this._hTitle,this._hSub);g=f(g,g+t(i,e,this._hTitle)),w=f(w,w+t(r,e,this._hSub))},d=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(m=f(m,m+d(i,o,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":y=m;break;case"right":y=m+this._wTitle-this._wSub;break;default:y=m+(this._wTitle-this._wSub)/2}else y=f(y,y+d(r,h,this._wSub))},p=x(a.titleGap,0);let g=0,m=l,w=0,y=_;switch(n.align){case"left":switch(a.position){case"left":m=y+this._wSub+p,c();break;case"right":switch(y=m+this._wTitle+p,a.align){case"center":y=f(y,y+(h-this._wTitle-this._wSub)/2);break;case"right":y=f(y,_+h-this._wSub)}c();break;case"top":u(),g=w+this._hSub+p;break;default:u(),w=g+this._hTitle+p}break;case"right":switch(a.position){case"left":switch(m+=o-this._wTitle,a.align){case"center":y+=(o-this._wTitle-this._wSub)/2;break;case"right":y=m-p-this._wSub}c();break;case"right":y+=h-this._wSub,m=y-p-this._wTitle,c();break;case"top":u(),g=w+this._hSub+p;break;default:u(),w=g+this._hTitle+p}break;default:switch(a.position){case"left":switch(m+=(o-this._wTitle)/2,a.align){case"left":break;case"center":y+=(m-y-this._wSub)/2;break;case"right":y=m-p-this._wSub}c();break;case"right":switch(m+=(o-this._wTitle)/2,a.align){case"left":y=m+this._wTitle+p;break;case"center":y=m+this._wTitle+p,y+=(h-y-this._wSub)/2;break;case"right":y+=h-p-this._wSub}c();break;case"top":u(),g=w+this._hSub+p;break;default:u(),w=g+this._hTitle+p}}e.resizeByMeasured().layout().trans(m,g),s.resizeByMeasured().layout().trans(y,w)}else if(o>0||h>0){const t=o?i:r,n=o?e:s,a=o||h,c=o?this._wTitle:this._wSub;let d=o?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=a-c;break;default:d+=(a-c)/2}n.trans(d,0)}}}class Lh extends ra{_doInitChildren(t){this.add(this._legendView=new ph(t))}_doMeasure(t,e,s,i,r){const n=e._legend,a=this._legendView.measure(t,n,s,i,r),o=this._pos=n._location;return"left"===o||"right"===o?a.width+=this._legendView._gap:a.height+=this._legendView._gap,a}_doLayout(){const t=this._legendView,e=t._gap;let s=this.width,i=this.height,r=0,n=0;switch(this._pos){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:n+=e,i-=e}t.trans(r,n).resize(s,i),t.layout()}}class Eh extends ra{constructor(t,e){super(t),this.dir=e,this.views=[],this.visibles=[],this._gap=0}prepare(t,e,s,i,r){const n=this.views;let a,o=n.length;for(;n.length<s.length;)a=new ga(t),s[o++].visible&&this.add(a),n.push(a);for(;n.length>s.length;)a=n.pop(),a.parent&&a.remove();if(n.forEach(((t,e)=>{t.prepare(s[e])})),this.setVis(n.filter((t=>t.model.visible)).length>0)){const t=n[0].model;this.isX=t._isX,this.isHorz=t._isHorz,this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){this.views.forEach(((i,r)=>{i.prepareGuides(t,NaN,NaN,e,s)}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map((t=>t.model)))}clean(){this.views.forEach((t=>t.clean()))}setMargins(t,e,s,i){this.views.forEach((r=>r.setMargins(t,e,s,i)))}_doMeasure(t,e,s,i,r){this._inverted;let n=0,a=0;return[this.views].forEach((e=>{if(e){const o=(this.isX,s),h=(this.isX,i);let l=0,_=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,o,h,r);e.setAttr("xy",e.model._isX?"x":"y"),l+=s.width,_+=s.height}})),this.isHorz?_+=(e.length-1)*this._gap:l+=(e.length-1)*this._gap,n=f(n,l),a=f(a,_)}})),{width:n,height:a}}_doLayout(t){const e=this.control.loaded;let s=this.width,i=this.height,r=0,n=0;t=+t||0,[this.views].forEach((a=>{if(a){let o=0;a.forEach((t=>{t.visible&&(t.checkExtents(e),this.isHorz?t.resize(s,t.mh):t.resize(t.mw,i),t.layout(),this.isHorz?(t.trans(r,this.dir===jn.TOP?i-o-t.mh:o),o+=t.mh+this._gap):(t.trans(this.dir===jn.RIGHT?o:s-o-t.mw,n),o+=t.mw+this._gap))})),this.isHorz?r+=s+t:n+=i+t}}))}}class Nh extends sa{constructor(t){super(t,"rct-credits"),this.add(this._textView=new Qt(t)),this._textView.anchor=Zt.START}clicked(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.getBBox()}}class Mh extends Ht{constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new Ht(t,"rct-annotations")),this.add(this._plotContainer=new Ht(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new ih(t,this));for(const e in jn){const s=new Eh(t,jn[e]);this._plotContainer.add(s),this._axisSectionMap[jn[e]]=s}this.add(this._paneContainer=new wh(t,this)),this.add(this._titleSectionView=new Ah(t)),this.add(this._legendSectionView=new Lh(t)),this.add(this._frontAnnotationContainer=new Ht(t,"rct-front-annotations")),this.add(this._creditView=new Nh(t)),this.add(this._navigatorView=new nh(t)),this.add(this._historyView=new dh(t)),this.add(this._tooltipView=new Ch(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}clean(){for(const t in this._axisSectionMap)this._axisSectionMap[t].clean()}measure(t,e,s,i,r){const n=this._model=e,a=n.isPolar(),o=n._chartOptions.credits,h=n._legend,l=n._navigator;let _,c=s,d=i;if(this._inverted=n.isInverted(),n.isSplitted()?(this._plotContainer.setVis(!1),this._paneContainer.setVis(!0),this.$_preparePanes(t,n._split)):(this._plotContainer.setVis(!0),this._paneContainer.setVis(!1),this.$_prepareBody(t,a)),this._creditView.setVis(o.visible)&&(_=this._creditView.measure(t,o,c,d,r),o.isFloating()||("middle"!==o.options.verticalAlign?d-=_.height+(+o.options.offsetY||0)+(+o.options.gap||0):"center"!==o.options.align&&(c-=_.width+(+o.options.offsetX||0)+(+o.options.gap||0)))),_=this._titleSectionView.measure(t,n,c,d,r),d-=_.height,this._legendSectionView.setVis(h.visible))switch(_=this._legendSectionView.measure(t,n,c,d,r),h._location){case"top":case"bottom":d-=_.height;break;case"right":case"left":c-=_.width}this._navigatorView.setVis(l.visible),this._paneContainer.visible?this._paneContainer.measure(t,n._split,n._xPaneAxes,n._yPaneAxes,c,d,1):a?this.$_measurePolar(t,n,c,d,1):this.$_measurePlot(t,n,c,d,1),this._navigatorView.visible&&(n._navigator._vertical?d=this._bodyView.mh:c=this._bodyView.mw,this._navigatorView.measure(t,l,c,d,r)),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){const t=this.width,e=this.height;let s=t,i=e;const r=this._model,n=r.isPolar(),a=r._legend,o=this._creditView,h=r._chartOptions.credits,l=h.options,_=+l.gap||0;let c=0,d=0,u=0,p=0,g=0,m=0,f=0,w=0;o.visible&&(o.resizeByMeasured(),h.isFloating()||("middle"!==l.verticalAlign?(c=+l.offsetY||0,"top"===l.verticalAlign?i-=u=o.height+c+_:i-=p=o.height+c+_):(d=+l.offsetX||0,"left"===l.align?s-=g=o.width+d+_:s-=m=o.width+d+_)));const x=this._titleSectionView;let y=0;const b=w+u;x.visible&&(x.resizeByMeasured(),i-=y=x.height),f=g,w=e-p;const v=this._navigatorView;let V=0;v.visible&&(v.model._vertical||(v.resize(v.mw,v.mh-v.model.getGap()-v.model.getGapFar()),i-=V=v.mh));const S=this._legendSectionView;let k,P,C=0,A=0;if(S.visible)switch(S.resizeByMeasured().layout(),C=S.height,A=S.width,a._location){case"top":k=y+u,i-=C;break;case"bottom":i-=C,k=w-C,w-=C;break;case"right":s-=A,P=t-A;break;case"left":s-=A,f+=A,P=0}v.visible&&(w-=V,v.layout().transY(w+v.model.getGap()));let L,E=0,N=0,M=0,T=0;if(this._paneContainer.visible)this._paneContainer.trans(f,b+y).resize(s,i),this._paneContainer.layout(),M=i,T=s,L=this._paneContainer.getRect();else{const t=this._axisSectionMap,e=t[jn.CENTER],r=t[jn.MIDDLE];let a;if(!n){const n=this.control._padding;e&&e.visible&&(E=e.mw),r&&r.visible&&(N=r.mh),[jn.LEFT,jn.RIGHT].forEach((e=>{(a=t[e])&&a.visible&&(s-=a.mw)})),[jn.TOP,jn.BOTTOM].forEach((e=>{(a=t[e])&&a.visible&&(i-=a.mh)})),(a=t[jn.LEFT])&&a.visible&&(a.resize(a.mw,i),a.layout(N),f+=a.mw),(a=t[jn.RIGHT])&&a.visible&&(a.resize(a.mw,i),a.layout(N)),E>0&&(e.resize(a.mw,i),e.layout()),(a=t[jn.BOTTOM])&&a.visible&&(a.setMargins(n.left,f,this.width-f-s,Math.max(0,n.right-2)),a.resize(s,a.mh),a.layout(E),w-=a.mh),(a=t[jn.TOP])&&a.visible&&(a.setMargins(n.left,f,this.width-f-s,Math.max(0,n.right-1)),a.resize(s,a.mh),a.layout(E)),N>0&&(r.resize(s,a.mh),r.layout())}v.visible&&v.layout().transX(f);const o=this._org={x:f,y:w};this._plotWidth=s,this._plotHeight=i,n||((a=t[jn.LEFT])&&a.visible&&a.trans(o.x-a.mw,o.y-a.height),(a=t[jn.RIGHT])&&a.visible&&a.trans(o.x+s,o.y-a.height),E>0&&e.trans(o.x+(s-E)/2,o.y-e.height),(a=t[jn.BOTTOM])&&a.visible&&a.trans(o.x,o.y),(a=t[jn.TOP])&&a.visible&&a.trans(o.x,o.y-i-a.height),N>0&&r.trans(o.x,o.y-(i-N)/2-N));const h=this._currBody;M=this._plotHeight-N,T=this._plotWidth-E,f=o.x,w=o.y-this._plotHeight,h.resize(T,M),h.trans(f,w),h.layout(),L=h.getRect(),h._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(o.visible){let s,i;switch(o.layout(),l.verticalAlign){case"top":i=c;break;case"middle":i=(e-o.height)/2+c;break;default:i=p>0?e-p+_:e-o.height-c}switch(l.align){case"left":s=d;break;case"center":s=(t-o.width)/2+d;break;default:s=m>0?t-m+_:t-o.width-d}o.trans(s,i)}if(T+=E,x.visible&&x.layout({xPlot:f,wPlot:T,wChart:t}).trans(0,b),S.visible){const r=a.options,n=r.align,o=r.verticalAlign;if("body"===a._location){let t=+r.offsetX||0;switch(n){case"right":f+=T-A-t;break;case"center":f+=(T-A)/2+t;break;default:f+=t}switch(t=+r.offsetY||0,o){case"bottom":w+=M-C-t;break;case"middle":w+=(M-C)/2+t;break;default:w+=t}}else if(isNaN(k)){const t=+r.offsetY||0;if(f=P,"chart"===r.alignBase){switch(o){case"top":w=t;break;case"bottom":w=e-C-t;break;default:w=(e-C)/2+t}w+C>e&&(w=(e-C)/2)}else switch(o){case"top":w+=t;break;case"bottom":w=w+i-C-t;break;default:w=w+(i-C)/2+t}w+C>e&&(w=(e-C)/2),w<0&&(w=0)}else{const e=+r.offsetX||0;if(w=k,"chart"===r.alignBase)switch(n){case"left":f=e;break;case"right":f=t-A-e;break;default:f=(t-A)/2+e}else switch(n){case"left":f+=e;break;case"right":f=f+s-A-e;break;default:f+=(s-A)/2+e}f+A>t&&(f=(t-A)/2),f<0&&(f=0)}S.trans(f,w)}this.$_layoutAnnotations(this._inverted,t,e,L),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i,r){const{x:n,y:a}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},o=this._model.chart._tooltip.isFollowPointer(t),h=i.getTooltipPos(),l=o?r.x+h.x:n+h.x,_=o?r.y+h.y:a+h.y;this._tooltipView.show(t,e,s,l,_,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._paneContainer.visible?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}findSeriesView(t){return this._currBody.findSeries(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}bodyOf(t){return this._model.isSplitted()?this._paneContainer.bodyViewOf(t):this._currBody}pointerMoved(t,e,s){var i;const r=s,n=this._model&&this.bodyOf(s),a=null==r?void 0:r.classList,o=(null==a?void 0:a.value)&&(a.contains("rct-contextmenu-item")||a.contains("rct-contextmenu-list"));let h=this._hoverItem;if(this._hoverItem=null,n){const i=n.controlToElement(t,e),a=n.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(r)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(r);t&&(t.legend.options.seriesHovering&&t.source instanceof Ys?n.hoverSeries(t.source):t.legend.options.pointHovering&&t.source instanceof Ms&&n.hoverPoint(t.source))}if(h instanceof ys&&!(this._hoverItem instanceof ys)&&(n.hoverSeries(null),n.hoverPoint(null)),!a)return void n.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,r=e._isHorz?n.width:n.height,h=e._isHorz?i.x:i.y,l=a&&s.visible&&!o&&s.flag.visible&&!s.isBar()&&s.getFlag(r,h);if(l){t.showCrosshair(h,l);const r=[];n._seriesViews.forEach((t=>{let s,n=Number.MAX_SAFE_INTEGER;const a=this._model.inverted;t.model._visPoints.forEach((t=>{const r=t.xPos,o=t instanceof Hr&&!a?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=e._isX?Math.abs(i.x-r):Math.abs(i.y-o);h<n&&(n=h,s=t)})),r.push(s)})),s.moved(h,l,r)}else t.hideCrosshiar()}))}else(null===(i=this._model)||void 0===i?void 0:i.isSplitted())?this._paneContainer.bodies.forEach((t=>{t.removeFocus()})):this._currBody.removeFocus()}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in jn){const s=this._axisSectionMap[jn[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this,this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody,this._currBody.width,this._currBody.height))}isAnimating(){return this._bodyView.animating()}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new Vh(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(s=this._bodyView)||void 0===s||s.setVis(!1),this._polarView.setVis(!0)):(null===(i=this._polarView)||void 0===i||i.setVis(!1),this._bodyView.setVis(!0),this._currBody=this._bodyView),this._currBody.prepareRender(t,this._model)}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),a=this._axisSectionMap;for(const s in a){const o=a[s];n?o.prepare(t,e,e.getAxes(s,!1),i,r):o.visible=!1}s.prepare()}$_prepareAxisGuides(t,e){const s=this._currBody._guideContainer,i=this._currBody._frontGuideContainer,r=!e.isPolar()&&e._needAxes(),n=this._axisSectionMap;for(const e in n){const a=n[e];r&&a.visible&&a.prepareGuides(t,s,i)}}$_measurePlot(t,e,s,i,r){const n=this._axisSectionMap;if(this._navigatorView.visible){const t=e._navigator;t._vertical?s-=t.getSize():i-=t.getSize()}const a=s,o=i;let h=0,l=0;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=n[jn.LEFT].checkWidths(t,s,i),s-=n[jn.RIGHT].checkWidths(t,s,i),i-=n[jn.BOTTOM].checkHeights(t,s,i),i-=n[jn.TOP].checkHeights(t,s,i),this._inverted?s-=h=n[jn.CENTER].checkWidths(t,s,i):i-=l=n[jn.MIDDLE].checkHeights(t,s,i),s-=h,i-=l,e.layoutAxes(s,i,this._inverted,r);for(const a in n){const o=n[a];o.visible&&o.measure(t,e,s,i,r)}s=a,i=o,h=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===jn.LEFT||t===jn.RIGHT?s-=e.mw:t!==jn.BOTTOM&&t!==jn.TOP||(i-=e.mh),this._inverted?t===jn.CENTER&&(s-=h=e.mw):t===jn.MIDDLE&&(i-=l=e.mh))}e.layoutAxes(s,i,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const a in n){const o=n[a];o.visible&&(o.measure(t,e,s,i,r),o.prepareGridRows(t,this._bodyView._gridRowContainer))}s=a,i=o,h=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===jn.LEFT||t===jn.RIGHT?s-=e.mw:t!==jn.BOTTOM&&t!==jn.TOP||(i-=e.mh),this._inverted?t===jn.CENTER&&(s-=h=e.mw):t===jn.MIDDLE&&(i-=l=e.mh))}e.axesLayouted(s,i,this._inverted),this._bodyView.measure(t,e._body,s,i,r)}$_measurePolar(t,e,s,i,r){const n=e._body.getRadius(s,i),a=2*Math.PI*n,o=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(a,o,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(a,o,!1),this._polarView.measure(t,e._body,s,i,r)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const a=r.get(e)||Wo(t,e);(e.options.front?i:s).add(a),r.set(e,a),n.push(a)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,a,o,h;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)n=-r.left,a=-r.top,o=e+r.left+r.right,h=s+r.top+r.bottom;else n=a=0,o=e,h=s;i._layoutView(t,this,n,a,o,h)}))}}!function(t){t.EXPORT="$$realchart_export"}(Ph||(Ph={}));class Th extends Ft{constructor(t,e){super(t,e),this.addElement(this._chartView=new Mh(t)),this.setPointerHandler(new ch(this))}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new Yn(null,((t,e)=>{this.changeModel(t,e)}))}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof ke&&s===xe.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,s){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearAssetDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}scroll(t,e){var s;null===(s=this._chartView.getAxis(t))||void 0===s||s.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Ph.EXPORT)this._exporter=t}_doRender(t){var e;const s=this.model,i=this._chartView;this.clearTemporaryDefs(),s&&(this.setData("theme",s._chartOptions.options.theme,!0),this.setData("palette",s._chartOptions.options.palette),s._prepareRender(),this._loadModules(),this._prepareModules()),this.loaded||i.clean(),i.measure(this.doc(),s,t.width,t.height,1),i.setRect(t),i.layout(),s&&s.afterRender(),(null===(e=this._chart)||void 0===e?void 0:e._loadCallback)&&(setTimeout(this._chart._loadCallback,0),this._chart._loadCallback=void 0)}_doRenderBackground(t,e,i,r){if(this.model){const i=this.model._chartOptions._style;if(s(i))for(const s in i)s.startsWith("padding")?e.setStyle(s,i[s]):t.style[s]=i[s]}}_loadModules(){if(!this._exporter){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this)}}_prepareModules(){this._exporter&&this._exporter.render(this.doc(),this.dom(),this.model._exporter.options)}_export(t){if(!this.model||!this._exporter)return;const e=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this._exporter.exportToImage(e,t)}}}class Rh{static getVersion(){return"1.1.8"}static setLocale(t,e){e&&L(t,e),(t=>{t&&(A=P[C=t.substring(0,2)]),A||(A=P[C="ko"])})(t)}static registerLocale(t,e){L(t,e)}static setDebugging(t){It.DEBUGGING=t}static setLogging(t){k.LOGGING=t}static setAnimatable(t){Ft._animatable=t}static configure(t){return t}static createChart(t,e,i,r=!0,n){const a=new Th(t,e);return s(i)&&a.chart.load(i,r,n),a.chart[Xn]=a,a.chart}static createData(t,e){return new Un(t||{},e)}}class Oh{static empty(){return new Oh}static create(t=0,e=0){return new Oh(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}const Bh=Rh.getVersion,Dh=Rh.setDebugging,$h=Rh.setLogging,zh=Rh.setAnimatable,Fh=Rh.configure,Ih=Rh.createChart,Hh=Rh.createData;export{ke as Annotation,Gr as AreaRangeSeries,Ir as AreaSeries,Wr as AreaSeriesGroup,je as Axis,Ai as AxisBaseLine,Re as AxisGrid,Ee as AxisItem,Fe as AxisLabel,Ne as AxisLine,Ie as AxisScrollBar,Ge as AxisSectorLine,ze as AxisTick,Me as AxisTitle,vr as BarRangeSeries,kr as BarSeries,Sr as BarSeriesBase,Cr as BarSeriesGroup,Pr as BarSeriesGroupBase,ei as BasedSeries,Yr as BellCurveSeries,ws as Body,Zr as BoxPlotSeries,Kr as BubbleSeries,tr as BulletGauge,Ki as BulletGaugeBand,er as BulletGaugeGroup,Qi as BulletTargetBar,Ji as BulletValueBar,Qr as BumpSeriesGroup,sn as CandlestickSeries,zs as CategoryAxis,$s as CategoryAxisGrid,Ds as CategoryAxisLabel,Bs as CategoryAxisTick,Yn as Chart,Un as ChartData,lt as ChartDataCollection,xe as ChartItem,Gn as ChartOptions,be as ChartText,rn as CircelBarPointLabel,nn as CircleBarSeries,an as CircleBarSeriesGroup,hr as CircleGauge,lr as CircleGaugeGroup,nr as CircleGaugeHand,ar as CircleGaugePin,ir as CircleGaugeRim,sr as CircleGaugeRimBase,or as CircleGaugeScale,rr as CircleGaugeValueRim,ps as CircularGauge,gs as CircularGaugeGroup,ds as CircularGaugeLabel,wr as ClockGauge,cr as ClockGaugeHand,fr as ClockGaugeLabel,dr as ClockGaugeMinuteHand,mr as ClockGaugePin,_r as ClockGaugeRim,ur as ClockGaugeSecondHand,pr as ClockGaugeTick,gr as ClockGaugeTickLabel,ti as ClusterableSeries,ai as ClusterableSeriesGroup,ni as ConstraintSeriesGroup,Li as ContinuousAxis,In as Credits,Ae as Crosshair,Ms as DataPoint,Ts as DataPointCollection,Hs as DataPointLabel,ln as DumbbellSeries,cn as EqualizerSeries,dn as ErrorBarSeries,xs as Exporter,pn as FunnelSeries,es as Gauge,Je as GaugeBase,ss as GaugeGroup,ts as GaugeItem,_s as GaugeLabel,ls as GaugeRangeBand,hs as GaugeRangeLabel,os as GaugeScale,mn as HeatmapSeries,xn as HistogramSeries,Oh as IPoint,ve as IconedText,yi as ImageAnnotation,bs as Legend,Or as LinePointLabel,$r as LineSeries,Br as LineSeriesBase,jr as LineSeriesGroup,Tr as LineSeriesPoint,Ei as LinearAxis,Xi as LinearGauge,ji as LinearGaugeBase,Yi as LinearGaugeChildLabel,qi as LinearGaugeGroup,Zi as LinearGaugeGroupBase,Ui as LinearGaugeGroupLabel,Gi as LinearGaugeLabel,cs as LinearGaugeScale,Wi as LinearValueBar,Mi as LogAxis,vn as LollipopSeries,ii as LowRangedSeries,oi as MarkerSeries,li as NavigatorMask,hi as NavigiatorHandle,Sn as OhlcSeries,Pn as ParetoSeries,En as PieSeries,Nn as PieSeriesGroup,Ln as PieSeriesLabel,An as PieSeriesText,Hn as PointHovering,Js as RadialSeries,si as RangedSeries,N as RcObject,Tn as ScatterSeries,Ys as Series,ri as SeriesGroup,qs as SeriesMarker,ui as SeriesNavigator,bi as ShapeAnnotation,zr as SplineSeries,mi as Split,wi as Subtitle,vi as TextAnnotation,zi as TimeAxis,fi as Title,xi as Tooltip,Bn as TreemapSeries,Gs as Trendline,rs as ValueGauge,$n as VectorSeries,Fn as WaterfallSeries,qe as Widget,Qs as WidgetSeries,Fh as configure,Ih as createChart,Hh as createData,Bh as getVersion,zh as setAnimatable,Dh as setDebugging,$h as setLogging};
|