realchart 1.3.12 → 1.3.13
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/gauge.js +1 -1
- package/gauge.mjs +1 -1
- package/heatmap.js +1 -1
- package/heatmap.mjs +1 -1
- package/index.d.ts +6 -1
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/split.js +1 -1
- package/split.mjs +1 -1
- package/treemap.js +1 -1
- package/treemap.mjs +1 -1
- package/vector.js +1 -1
- package/vector.mjs +1 -1
- package/wordcloud.js +1 -1
- package/wordcloud.mjs +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart v1.3.
|
|
3
|
+
* RealChart v1.3.13
|
|
4
4
|
* Copyright (C) 2023-2025 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",s=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,n=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return"string"==typeof t&&t.length>0},h=function(t){return"number"==typeof t},l=function(t){return"boolean"==typeof t},_=Object.assign,c=Math.floor,u=Math.ceil,d=Math.cos,p=Math.sin,g=function(t){return Math.pow(10,t)},m=Math.log10,f=Math.min,y=Math.max,b=Math.abs,x=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},w=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},v=function(t,e){return void 0!==t?t:e},S=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},V=(t,e,s)=>t+(e-t)*s,P=function(t){return"function"==typeof t?t:null},A=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class C{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&&C.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(f(s,C.month_days[C.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(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/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&&!r(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&&!r(t))return _({},t)}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(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(r(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 r(t)?t:null!=t?[t]:null}static copyArray(t){return r(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()-A}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=y(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 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=r(t)?[]:{};for(let s of Object.keys(t))e[s]=C.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(),C.log(t,+new Date-s+"ms")}static clamp(t,e,s){return y(e,f(s,t))}static makeIntArray(t,e){const s=new Array(y(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}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=b(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}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}}C.LOGGING=!1,C.week_days=["일","월","화","수","목","금","토"],C.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],C.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]],C.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const k={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 L="ko",N=k[L]||k[L="ko"];const E=(t,e)=>{t&&i(e)&&(N=k[t.substring(0,2)]=Object.assign(k.ko,k.en,e))};let M=0;class T{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(M++))}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 O extends T{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 B=void 0,R=Math.PI,D=2*R,F=-R/2,z=2*R/360,$=360/R/2,I="%".charCodeAt(0);function G(t){return t>D?t%D:t}function H(t){return parseFloat(t.toPrecision(12))}function j(t){return Math.floor(1e6*t)/1e6}function Y(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 U(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function Z(t,e){const s={};return s[t]=e,s}function q(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)===I?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;rt(N.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 K(t,e){return q(t,!0)||q(e,!1)}function Q(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const J="fill",tt={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"},et=function(t){const e=tt[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return tt[t]=e,e}return e};class st extends Error{}const it=function(t,e){if(!t)throw new st(e)},rt=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},nt=function(t,e,s,n=!0,a=!0,h=!1,l){let c,u;if(n&&(e=-Number.MAX_VALUE,s=Number.MAX_VALUE),r(t))c=[],t.forEach((t=>{if(i(t)&&o(t.color)){const i={fromValue:x(t.fromValue,u?u.toValue:e),toValue:x(t.toValue,s),color:t.color,style:t.style?_({},t.style):B};i.fromValue<i.toValue&&(c.push(i),u=i)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<s)),a&&c.forEach((t=>{t.fromValue=y(t.fromValue,e),t.toValue=f(t.toValue,s)}));else if(i(t)&&r(t.colors)&&t.colors.length>0){const i=t.colors,n=r(t.styles)?t.styles:null;if(c=[],r(t.steps)&&t.steps.length>0){const o=r(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),s>o[o.length-1]&&o.push(s);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:i[f(t,i.length-1)],style:n?n[f(t,n.length-1)]:B})}else{let r=x(t.fromValue,e);const o=x(t.toValue,s),a=(o-r)/i.length;let h=0;for(;r<o;)c.push({fromValue:r,toValue:r+=a,color:i[f(h,i.length-1)],style:n?n[f(h,n.length-1)]:B}),h++}}if(h&&c&&c.length>0){let t=0,i=e;for(;t<c.length;)c[t].fromValue>i&&c.splice(t,0,{fromValue:i,toValue:c[t].fromValue,color:l}),i=c[t].toValue,t++;c[t-1].toValue<s&&c.push({fromValue:c[t-1].toValue,toValue:s,color:l})}return c},ot="shuffle",at="random",ht="vertical-lr",lt="vertical-rl",_t=function(t){return t&&"object"==typeof t};class ct extends O{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),r(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=r(e)?e.slice():o(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(r(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else _t(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)&&rt(N.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class ut{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let i;r(s)?i=new ct({},s):_t(s)&&r(s.values)&&(i=new ct(s.options,s.values)),this._map[e]=i}}}const dt="0".charCodeAt(0),pt="#".charCodeAt(0),gt=",".charCodeAt(0),mt="s".charCodeAt(0),ft="a".charCodeAt(0);class yt{static getFormatter(t){let e=yt.Formatters[t];return e||(yt.Formatters[t]=e=new yt(t)),e}static get Default(){return yt.getFormatter(yt.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)===dt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===pt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===dt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===gt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===mt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===ft){s.signDisplay="never";break}}return s.minimumIntegerDigits=y(1,s.minimumIntegerDigits),s}}}yt.DEFAULT_FORMAT="",yt.Formatters={};const bt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],xt=[".","/","-",":"],wt="Z".charCodeAt(0),vt="z".charCodeAt(0),St="A".charCodeAt(0),Vt="a".charCodeAt(0),Pt="y".charCodeAt(0),At="M".charCodeAt(0),Ct="m".charCodeAt(0),kt="W".charCodeAt(0),Lt="w".charCodeAt(0),Nt="d".charCodeAt(0),Et="H".charCodeAt(0),Mt="h".charCodeAt(0),Tt="S".charCodeAt(0),Ot="s".charCodeAt(0);class Bt{static getFormatter(t){let e=Bt.Formatters[t];return e||(Bt.Formatters[t]=e=new Bt(t)),e}static get Default(){return Bt.getFormatter(N.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||N.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 o=s[r],a=o.length;switch(o.charCodeAt(0)){case Pt:i+=a>2?t.getFullYear():X(t.getFullYear()%100);break;case At:i+=a>1?X(t.getMonth()+1):t.getMonth()+1;break;case Nt:i+=a>1?X(t.getDate()):t.getDate();break;case kt:i+=a>1?X(C.weekOfYear(t,e)+1):C.weekOfMonth(t,e,!0)+1;break;case Lt:i+=a>1?C.long_week_days[t.getDay()]:C.week_days[t.getDay()];break;case Et:i+=a>1?X(t.getHours()):t.getHours();break;case Mt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?X(e):e}else i+=a>1?X(t.getHours()):t.getHours();break;case Ct:i+=a>1?X(t.getMinutes()):t.getMinutes();break;case Ot:i+=a>1?X(t.getSeconds()):t.getSeconds();break;case Vt:case St:t.getHours()<12?i+=N.am:i+=N.pm;break;case Tt:let s=t.getMilliseconds();i+=3==a?U(s):2==a?X(s):s.toString().substring(0,a);break;default:i+=o}}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(xt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),bt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=St&&e<=wt||e>=Vt&&e<=vt)&&rt(N.invalidDateFormat,t)}e.push(n)}if(r<i&&C.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&C.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||N.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Bt.Formatters={};class Rt{static isBright(t){return new Rt(t).isBright()}static getContrast(t,e,s){return new Rt(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(C.startsWith(t,"rgb(")&&C.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):C.startsWith(t,"rgba(")&&C.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):C.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 Rt(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 Dt{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 Ft;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Ft||(Ft={}));const zt={name:"RealChart",version:"1.3.12",license:"enterprise",code:""};class $t{static decode(t){const e=$t.CHARS,s=$t.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}}$t.PAD="=",$t.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class It{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 o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=It.xor,i=It.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=It.xor,i=It.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=It.kb,i=It._encryptBlock;let r,n,o,a=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*It.POW8|e[a++%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,o=_.p.length;r<o;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=_["s"+r].length;n<o;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=It._decryptBlock;let i=It._init(e),r=[],n=$t.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*It.POW24|n[a+1]*It.POW16|n[a+2]*It.POW8|n[a+3],h.right=n[a+4]*It.POW24|n[a+5]*It.POW16|n[a+6]*It.POW8|n[a+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),a+=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)}}It.POW2=Math.pow(2,2),It.POW3=Math.pow(2,3),It.POW4=Math.pow(2,4),It.POW8=Math.pow(2,8),It.POW16=Math.pow(2,16),It.POW24=Math.pow(2,24),It.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 Gt{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=It.decrypt(t,"dkdl"+this._getLDKey(It.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 Ht extends T{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._domResize=!1,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&this._domResized()},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=Gt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==zt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(zt.license!=Ft.Developer&&!Gt.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(Ft).includes(n))throw new Error(s);if(zt.code=i.code,zt.license=i.lic,n==Ft.Evaluation||n==Ft.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||Ht.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),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),Dt.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(){Dt.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(jt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(jt.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)}}setDomResize(t){t!=this._domResize&&(this._domResize=t)}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 Ut(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new qt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(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,jt.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){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),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){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),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(t,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof HTMLDivElement||rt(N.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");_(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 o=this._svg=r.createElementNS(e,"svg");o.classList.add("rct-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created by RealChart v1.3.12",o.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Wt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),_(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,s){let i=t.createElementNS(e,"filter");i.setAttribute("id",Ht.SHADOW_FILTER);const r=t.createElementNS(e,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=t.createElementNS(e,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=t.createElementNS(e,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=t.createElementNS(e,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=t.createElementNS(e,"feMerge"),l=t.createElementNS(e,"feMergeNode"),_=t.createElementNS(e,"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{C.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;_(this._htmlRoot.style,{left:Y(e.left-t.left),top:Y(e.top-t.top)});const r=this._container.firstElementChild;r.removeAttribute("style"),_(r.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)"}),this._doRenderBackground(r,this._root,s,i);const n=this._padding=Dt.getPadding(this._root.dom);this._doRender({x:n.left,y:n.top,width:s-n.left-n.right,height:i-n.top-n.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),C.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){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)}}Ht.CLASS_NAME="rct-control",Ht.SHADOW_FILTER="rr-chart-shadow-filter",Ht._animatable=!0;class jt extends T{constructor(t,s,i=B){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(e,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 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 tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}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=t?"":"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(t,s){const i=t.createElementNS(e,s);return this._dom.appendChild(i),i}insertElement(t,s,i){const r=t.createElementNS(e,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 o(e)&&e.indexOf("NaN"),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()}getBBoxEx(){const t=this._dom.getBBox();return t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){const s=this._dom.getBBox();return s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}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}setPosY(t){this._y=t}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=C.isValidNum(t)?t:this._tx,e=C.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=C.isValidNum(t)?t:this._tx,e=C.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}transEx2(t,e,s=0,i=!0){const r=C.isValidNum(t)?t:this._tx,n=C.isValidNum(e)?e:this._ty;if(r===this._tx&&n===this._ty)return this;if(s>0){const t=this._rotation||0,e=`translate(${this._tx||0}px, ${this._ty||0}px)`+(t?` rotate(${t}deg)`:""),o=`translate(${r}px, ${n}px)`+(t?` rotate(${t}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._dom.animate([{transform:e},{transform:o}],{duration:s,fill:"none"});i&&a.addEventListener("finish",(()=>{var t;this._dom.style.transformOrigin="",null===(t=this.control)||void 0===t||t.invalidateLayout()}))}return this._tx=r,this._ty=n,this._updateTransform(),this}transX(t){return t!==this._tx&&C.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&C.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}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.split(" ").filter((t=>t.length>0))),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!==B&&(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(et(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(et(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(et(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(o(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let s in t)e.setProperty(et(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){o(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this.addClass(t):i(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,v(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(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",(()=>{delete this.hiding,this.setVis(!1)})),this.hiding=!0}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(jt.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 jt.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=[];(C.isValidNum(e)||C.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+C.pick(this._originX,t.getAttribute("x"),0)+" "+C.pick(this._originY,t.getAttribute("y")||0)+")"),C.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=C.getNumber(this._scaleX,1),n=C.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}jt.DEBUGGING=!1,jt.TESTING=!1,jt.ASSET_KEY="_asset_",jt.TEMP_KEY="_temp_";class Yt extends jt{constructor(t,e){super(t,e,"g")}}class Wt extends jt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class Xt extends jt{constructor(t){super(t,B,"clipPath");const e=this._id=C.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Ut extends Xt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new jt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=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 Zt extends jt{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class qt extends Xt{constructor(t){super(t),this.add(this._circle=new jt(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class Kt{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._hideFeedback()}finally{this._doCanceled()}}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 Qt,Jt,te;t.TextAnchor=void 0,(Qt=t.TextAnchor||(t.TextAnchor={})).START="start",Qt.MIDDLE="middle",Qt.END="end",t.TextLayout=void 0,(Jt=t.TextLayout||(t.TextLayout={})).TOP="top",Jt.MIDDLE="middle",Jt.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(te||(te={}));class ee extends jt{constructor(e,s=void 0){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._overflow=te.WRAP,this._dirty=!0,this._text="",this.anchor=t.TextAnchor.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.72*t}layoutText(e){const s=this.getBBox(),i=this.getAscent(isNaN(e)?s.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(i/2);break;case t.TextLayout.BOTTOM:r=0;break;default:r=Math.ceil(i)}this.y=r}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=y(0,t),(e=f(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,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);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(Rt.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 se="$_TH",ie="$_TW";class re{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]?yt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Bt.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),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),B),0===this._literals[2].length&&(this._literals[2]=B)}else this._literals.push(r,n,B,B);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class ne extends re{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 oe extends ne{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 ae={t:class extends ne{tag(){return"</t>"}},b:class extends ne{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends ne{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:oe};class he{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 re).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 ae){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new ae[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 le=/<br.*?>|\r\n|\n/;class _e{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(t,s,r,n,o){const a=t.doc,h=x(this.lineHeight,1),l=this._lines,_=l.length,c=[],u=[];t.clearDom(),n=n||t;const d=t.getStyle("writing-mode"),p=d===ht||d===lt;for(let s=0;s<_;s++){const r=l[s];let d=0,g=0,m=null;for(let[h,l]of r.words.entries()){const c=0===s&&0===h,u=s===_-1&&h===r.words.length-1,f=l.prepareSpan(t.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=c&&t.prefix||"",s=u&&t.suffix||"";f.textContent=e+(f.textContent||"")+s}const b=f.getBBox();if(f[ie]=b.width,f[se]=b.height,p?(d=y(d,f[ie]),g+=f[se]):(d+=f[ie],g=y(g,f[se])),m||(m=f),l instanceof oe){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(f),t.appendDom(s)}}u.push(m),r[se]=g*h,r[ie]=d*h,c.push(0==s?r[ie]/2:r[ie])}if(_>0){let e=l[0];for(let s=1;s<u.length;s++)if(u[s]){let i=0,r=0;if(p?null!=u[s-1]&&(i=Math.floor(e[ie]-t.getAscent(e[ie]))+t.getAscent(l[s][ie])):r=e[se]-t.getAscent(e[se])+t.getAscent(l[s][se]),null==u[0]&&u[s]==u.find((t=>null!=t))){const r=t.insertElement(a,"tspan",u[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[ie]=n.width,r[se]=e[se]=n.height,u[0]=r}switch(d){case ht:u[s].setAttribute("dx",String(i)),u[s].setAttribute("y","0");break;case lt:u[s].setAttribute("dx",String(-i)),u[s].setAttribute("y","0");break;default:u[s].setAttribute("x","0"),u[s].setAttribute("dy",String(r))}e=l[s]}if(p){const e=t.parent.dom.classList.contains("rct-annotation"),s=t.getBBox().width,[i]=u,r=i[ie];if(e)i.setAttribute("dx",String(d===lt?s-r/2:r/2));else switch(d){case ht:i.setAttribute("x",String((s-r)/-2));break;case lt:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][se])}}layout(e,s,i,r,n){const o=e.getBBox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===ht||l===lt)switch(a=n.left+(i-n.left-n.right-o.width),s){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,s){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(i-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=i-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(le);for(let t of s)e.push((new he).parse(t))}}}class ce{constructor(t){this.source=t}hasDef(){return!0}}class ue extends ce{_setStops(t,s){s.setAttribute("id",this.source.id);const i=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=r(i)?[...i]:[i,"white"],a=r(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(t,s,i,r,n){const o=t.createElementNS(e,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(t,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class de extends ue{getEelement(t,s){const i=t.createElementNS(e,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}de.TYPE="lineargradient";class pe extends ue{getEelement(t,s){const i=t.createElementNS(e,"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(t,i),i}}pe.TYPE="radialgradient";class ge extends ce{prepare(){}getEelement(t,s){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,h,l,c,u=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rct-pattern"),+s.pattern>=0){const t=ge.STOCK[+s.pattern%ge.STOCK.length];a=t.path,h=t.style,u=!t.fill,l=t.width||20,c=t.height||20}else o(s.pattern)&&(a=s.pattern,l=s.width||s.height||20,c=s.height||s.width||20);r.setAttribute("width",String(l)),r.setAttribute("height",String(c)),n.setAttribute("d",a),h&&_(n.style,h),s.style&&_(n.style,s.style),u&&(n.style.fill="none");let d=s.backgroundStyle;if(o(d)||i(d)){const s=t.createElementNS(e,"rect");r.append(s),s.style.fill=o(d)?d:d.fill,s.setAttribute("width",String(l)),s.setAttribute("height",String(c))}return r.append(n),r}}ge.TYPE="pattern",ge.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 me extends ce{prepare(){const t=this.source;this._colors=r(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&C.shuffle(this._colors),this._index=0)}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=r(e.colors)?e.colors:[]}}me.TYPE="colors";class fe extends ce{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(o(e))this._images.push(t+e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||fe.SIZE,height:e.height||e.width||fe.SIZE})}}fe.TYPE="images",fe.SIZE=20;class ye{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],r(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(jt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}prepareRender(){this._items.forEach((t=>{t.prepare()}));for(const t in this._map)this.get(t).prepare()}get options(){return this._items.map((t=>t.source))}$_loadItem(t){if(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ge.TYPE:r(t.colors)?e=me.TYPE:r(t.images)&&(e=fe.TYPE)),e)switch(e.toLowerCase()){case de.TYPE:return new de(t);case pe.TYPE:return new pe(t);case ge.TYPE:return new ge(t);case me.TYPE:return new me(t);case fe.TYPE:return new fe(t)}}}}let be=0;const xe=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=["__proto__","constructor","prototype"],ve=function(t,e){const s=i(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!we.includes(t)){const n=e[t];r(n)?s[t]=n.slice(0):n instanceof Date?s[t]=new Date(n):i(n)?s[t]=ve(s[t],n):s[t]=n}return s};class Se extends T{constructor(t){super(),this.chart=t,be++}init(){const t=this._op=ve({},this.constructor.defaults);this._doInit(t),this._doApply(t);const e={};return this._doInitChildren(e),this._children=Object.keys(e),this._children.length>0&&_(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])})),ve(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 Se)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 Se?this[t]._doSetSimple(!l(i)||!i):(s[t]=!l(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,e=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Se)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;s.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),e&&this._changed()}return this}clearOptions(t=!0){const e=function(t){if(t){const s=t._op=ve({},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 s in e)if(e.hasOwnProperty(s)){let n=e[s];this._doLoadProp(s,n)||(this[s]instanceof Se?t[s]=this[s]._load(n):r(n)?t[s]=n.slice(0):n instanceof Date?t[s]=new Date(n):i(n)?t[s]=_({},n):t[s]=n)}}_doSave(t,e,s){const i=this._op;for(const n in i)if(i.hasOwnProperty(n))if(s&&this[n]instanceof Se)t[n]=this[n].saveOptions(!0);else{const s=i[n];r(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(l(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`]=q(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 s=t[e];this._doLoadProp(e,s)||(this[e]instanceof Se?this[e].updateOptions(s):r(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):i(s)?this[e]=_({},s):this[e]=s)}}_doPrepareRender(t){}}Se.REFRESHED="refreshed",Se.defaults={visible:!0};class Ve{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 Pe extends Se{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?yt.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 _e),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return o(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(C.isValidNum(t)){const i=this._numSymbols&&e&&C.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=o(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}}Pe.defaults=xe(Se.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Ae extends Pe{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 fe&&(this._images=e)}this._root=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),r=Number.isFinite(+i)?+i:i;return s instanceof fe?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}Ae.defaults=xe(Pe.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Ce extends Se{}const ke={};class Le extends Se{static register(...t){t.forEach((t=>{ke[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}needClip(){return!0!==this._op.noClip}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 o=+i.x1,a=+i.x2,h=+i.y1,l=+i.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(o)){const i=this.chart.xAxis;s?this._y=e-i.getPos(e,o):this._x=i.getPos(t,o),isNaN(a)||(s?n=this._h=e-i.getPos(e,a)-this._y:r=this._w=i.getPos(t,a)-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=Q(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=Q(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,s,i,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this._op.align){case"center":h+=(i-n)/2+a.x;break;case"right":h+=i-a.x-n;break;default:this._anchorObj?h+=(i-n)/2+a.x:h+=a.x}else a=a||this.getOffset(n,o),h=this._x+a.x;if(isNaN(l=this._y))switch(a=a||this.getOffset(n,o),l=s,this._op.verticalAlign){case"middle":l+=(r-o)/2-a.y;break;case"bottom":l+=r-a.y-o;break;default:l+=a.y}else a=a||this.getOffset(n,o),l=this._y+a.y;return{x:h,y:l}}refresh(){this._changed(Se.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(o(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){}}Le.defaults=xe(Se.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Ne extends Ve{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 Le)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t,e){const s=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach(((t,i)=>{n.push(this.$_loadItem(s,t,i,e))})):i(t)&&n.push(this.$_loadItem(s,t,0,e)),n.forEach((t=>{t.name&&(o[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):B}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=o(e.imageUrl)?"image":o(e.shape)?"shape":"text");const n=t._getAnnotationType(r);if(!n)throw new Error("Invalid annotation type: "+e.type);const a=new n(t,i);return a.init(),a.index=s,a._load(e),a}}class Ee extends Se{}Ee.defaults=xe(Se.defaults,{minWidth:50});class Me extends Se{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new Ee(this.axis.chart)).init(),this._args={chart:void 0,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?Bt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):yt.getFormatter(this._op.numberFormat).toStr(s)}moved(t,e,s){this._op.onChange&&(this._args.chart=this.chart.wrapper,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 n(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}Me.defaults=xe(Se.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Te={};class Oe extends Se{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Be extends Oe{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return o(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Be.defaults=xe(Oe.defaults,{visible:void 0});class Re extends Oe{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 o(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)}}Re.defaults=xe(Oe.defaults,{align:"middle",offset:0,gap:5});class De extends Oe{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 o=1;o<r.length;o++,n++)e[n%s]&&i.push({axis:t,from:r[o-1].value,to:r[o].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 o(t)?(this._op.colors=[t,null],!0):r(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Fe extends Oe{_doInitChildren(t){t.rows=(this._rows=new De(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}}Fe.defaults=xe(Oe.defaults,{visible:void 0});class ze extends Ae{getDefaultIconPos(){return"left"}}ze.defaults=xe(Ae.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class $e extends Oe{_doInitChildren(t){t.label=(this._label=new ze(this.axis.chart)).init()}get label(){return this._label}canConstainedTo(t,e){const s=this._op;if(r(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(r(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}$e.defaults=xe(Oe.defaults,{front:!1,zindex:0});class Ie extends $e{}class Ge extends $e{}class He extends Oe{canUseNumSymbols(){return!0}_doSetSimple(t){return C.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}}He.defaults=xe(Oe.defaults,{visible:!1,length:7,gap:3});class je extends Ae{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?v(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?v(i.firstText,i.text):r==e-1?v(i.lastText,i.text):i.text}getLabelStyle(t,e){const s=this._op,r=t.index;if(s.styleCallback){const e=s.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(i(e))return e}return 1==e?s.lastStyle||s.firstStyle:0==r?s.firstStyle:r==e-1?s.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}_getText(t,e,s,i){return o(t)?t:this._getNumberText(e,s,i)||e}}je.defaults=xe(Ae.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Ye extends Oe{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)}}Ye.defaults=xe(Oe.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class We{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:y(this.min,f(this.max,t)))>(e=isNaN(e)?this.end:y(this.min,f(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 Xe extends Be{}class Ue extends Se{static register(...t){t.forEach((t=>{Te[t.type]=t,t.subtype&&(Te[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 Re(this)).init(),t.line=(this._line=new Be(this)).init(),t.sectorLine=(this._sectorLine=new Xe(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 Me(this)).init(),t.scrollBar=(this._scrollBar=new Ye(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 F+z*x(this._op.startAngle,0)}getTotalAngle(){return z*y(0,f(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}getConnectableSeries(){const t=[];return this._series.forEach((e=>{e.connectable(this)&&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)}))}collectReferentValues(){this._series.forEach((t=>{t.prepareReferents(this)})),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){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=!C.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)))}polarOff(){return 0}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+C.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[y(t,this._min),f(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new We(this),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 r&&(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}getXLabel(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 e=this,i=this.guides,n=function(t){var s;t!==e._guides&&(e._guides=t,s=r(t)?t:[t],i.length=0,s.forEach((t=>{let s;s="range"===t.type?new Ge(e):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new Ie(e):new Ge(e),s.init(),s._load(t),i.push(s)})))};super._doApply(t),this._name=t.name||`Axis ${this._index+1}`,s.call(t,"guide")?n(t.guide):s.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?H(f(...t)||0):NaN,max:t.length>0?H(y(...t)||0):NaN}}}Ue.defaults=xe(Se.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 Ze extends Ve{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;r(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 o(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()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}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 h(i)&&i>=0&&i<e.length?r=e[i]:o(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 i;let n=t._getAxisType(e.type);if(!n){let o;if(r(e.categories))o="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){o="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){o=void 0;break}if(t.options.xAxis===s){o=void 0;break}if(W(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(i=t._getSeries().first)||void 0===i?void 0:i.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o.init(),o._load(e),o._index=s,o._isPolar=t.isPolar(),o}}class qe extends Se{_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:Q(this._widthDim||this._sizeDim,t,t),height:Q(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return Q(this._leftDim,t)}getRight(t){return Q(this._rightDim,t)}getTop(t){return Q(this._topDim,t)}getBottom(t){return Q(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=xe(qe.defaults,{size:"100%"});class ts 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}}ts.defaults=xe(Je.defaults,{duration:500});class es 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),s.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 s=this._gaugesType();r(e)?e.forEach(((e,i)=>this.$_add(ts._loadGauge(t,e,s)))):i(e)&&this.$_add(ts._loadGauge(t,e,s))}$_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)}}es.defaults=xe(Je.defaults,{minValue:0});class ss extends Ve{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 ts)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],n=this._map={};r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof es)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){if(0===Object.keys(Ke).length&&0===Object.keys(Qe).length)throw new Error("The gauge feature cannot be used without the required 'gauge' module. For installation and usage instructions, please visit: https://www.realchart.co.kr/guide/modules");let i=r(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i||(i=t._getGaugeType(e.type||t.gaugeType)),!i)throw new Error("Invalid gauge type: "+e.type);const n=new i(t);return n.init(),n._load(e),n.index=s,n}}class is extends ts{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}}}is.defaults=xe(ts.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class rs extends Se{constructor(t){super(t.chart),this.scale=t}}rs.defaults=xe(Se.defaults,{reversed:!1,length:7});class ns extends Ae{getText(t){return C.isValidNum(t)?this._getText(null,t,b(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class os extends Se{constructor(t){super(t.chart),this.gauge=t}_doInitChildren(t){const e=this.chart;t.line=(this._line=new Se(e)).init(),t.tick=(this._tick=new rs(this)).init(),t.label=(this._label=new ns(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(f(e,s),y(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(y(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=f(t,e),this._max=y(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=f(...t)),isNaN(i)&&(i=y(...t)),this._min=f(s,i),this._max=y(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(H(e));for(let e=1;e<t;e++)n.push(H(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 o=n/(Math.floor(t/e)+1-1);const a=Math.pow(10,Math.floor(Math.log10(o))),h=this._getStepMultiples(a);let l,_=0;if(o/=a,h)if(o>h[_]){for(;_<h.length-1;_++)if(o>h[_]&&o<h[_+1]){o=h[++_];break}}else o=h[_];for(o*=a,this._step=o,r.push(H(l=s));;){if(l+=o,l>=i){r.push(H(i));break}r.push(H(l))}return r}}os.defaults=xe(Se.defaults,{position:"default",stepPixels:48,gap:8});class as extends Se{}as.defaults=xe(Se.defaults,{visible:!1});class hs extends Se{constructor(t){super(t.chart),this.gauge=t}_doInitChildren(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new as(e)).init(),t.tickLabel=(this._tickLabel=new Se(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?Q(this._thicknessDim,t,0):"inside"===this._op.position?t:hs.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=nt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}hs.defaults=xe(Se.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class ls extends Pe{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}ls.defaults=xe(Pe.defaults,{animatable:!0});class _s extends ls{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:Q(this._offsetXDim,t,0),y:Q(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}_s.defaults=xe(ls.defaults,{offsetX:0,offsetY:0});class cs{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(us.DEF_CENTER),this.setCenterY(us.DEF_CENTER),this.setRadius(us.DEF_RADIUS),this.setInnerRadius(us.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=q(v(t,us.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=q(v(t,us.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=q(v(t,us.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=q(v(t,us.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=q(t,!0))}getCenter(t,e){return{x:Q(this._centerXDim,t,t/2),y:Q(this._centerYDim,e,e/2)}}getExtents(t){const e=Q(this._radiusDim,t,t/2),s=f(e,this._innerDim?Q(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?Q(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=x(t%360,0),i=y(0,f(360,x(e,360)));this._startRad=F+z*s,this._handRad=z*s,this._sweepRad=z*i}}class us extends is{_doInit(t){this._props=new cs}_doInitChildren(t){t.label=(this._label=new _s(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 cs)}_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)}}us.DEF_CENTER="50%",us.DEF_RADIUS="40%",us.DEF_INNER="80%",us.defaults=xe(is.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class ds extends es{_doInit(t){this.props=new cs}_doInitChildren(t){t.label=(this._label=new _s(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)}}ds.defaults=xe(es.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let ps=class extends Se{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};ps.defaults=xe(Se.defaults,{visible:void 0});class gs extends Pe{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||gs.DEF_TEXT}}gs.DEF_TEXT="표시할 데이터가 없습니다.",gs.defaults=xe(Se.defaults,{visible:void 0});class ms extends Se{constructor(t){super(t),this._annotations=new Ne(this)}_doInitChildren(t){t.image=(this._image=new Ce(null)).init(),t.emptyView=(this._emptyView=new gs(this.chart)).init(),t.zoomButton=(this._zoomButton=new ps(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof Je&&this.contains(s)?s: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)}getRadius(t,e){return Q(this._radiusDim,f(t,e))}setPolar(t,e){return this._cx=Q(this._centerXDim,t),this._cy=Q(this._centerYDim,e),this._rd=Q(this._radiusDim,f(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 e=this,i=function(t){t!==e._anns&&(e._anns=t,e._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),s.call(t,"annotation")?i(t.annotation):s.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}ms.defaults=xe(Se.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class fs extends Se{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}fs.defaults=xe(Se.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class ys extends Se{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 Q(this._maxWidthDim,t,t)}getMaxHeight(t){return Q(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=v(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=xe(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 xs={inOutSine:t=>-(d(R*t)-1)/2},ws=function(t,e,s,i,r,n){const o=Z(e,null!=s?s:"initial"),a=Z(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class vs{constructor(){this.delay=0,this.duration=vs.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=f(1,y(0,H(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,vs.DURATION),this.delay=e||0,this._easing=xs[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}}vs.DURATION=700,vs.SHORT_DURATION=300;const Ss={CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle",VLINE:"vline",HLINE:"hline",LINE:"line"},Vs=Object.values(Ss),Ps=.001,As=Math.PI;class Cs{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 o=i>0,a=o?0:1;return r>0?n>0?(r=f(b(i)/2,s/2,r),n=f(b(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=f(b(i)/2,s/2,r),["M",t,e,"v",i+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i-r,"Z"]):n>0?(n=f(b(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n:+n),"h",s,"v",-i+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=f(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,o,a=!1){const h=G(b(n-r)),l=2*As-h<.01,_=h-As<.01?0:1,c=o?1:0,u=d(r),g=p(r),m=d(n-=l?c?Ps:-.001:0),f=p(n),y=[];return y.push("M",t+s*u,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*f),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,s,i,r,n,o,a){const h=G(b(o-n)),l=2*As-h<Ps;let _=h-As<Ps?0:1;const c=a?1:0,u=d(n),g=p(n),m=d(o-=l?c?Ps:-.001:0),f=p(o),y=s*r,x=i*r,w=[];return w.push("M",t+s*u,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*f),l?w.push("M",t+y*m,e+x*f):w.push("L",t+y*m,e+x*f),isNaN(y)||w.push("A",y,x,0,_,1-c,t+y*u,e+x*g),w.push("Z"),w}static sectorPolygon(t,e,s,i,r,n,o,a){const h=[],l=G(b(o-n)),_=2*As-l<Ps,c=a?1:0,u=d(n),g=p(n),m=d(o-=_?c?Ps:-.001:0),f=p(o),y=s*r,x=i*r;return h.push([t+s*u,e+i*g]),h.push([t+s*m,e+i*f]),h.push([t+y*m,e+x*f]),h.push([t+y*u,e+x*g]),h}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,o=e+i/2+(i/2-i/2*p(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,u=c/2,g=[];g.push("M",n+a*d(r),o+h*p(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*p(r),"L",n+l*d(r+u),o+_*p(r+u)),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=Cs[e](0,0,2*s,2*i);break;default:r=Cs.circle(s,i,f(s,i))}t.setPath(r)}}class ks extends jt{static create(t,e,s,i,r,n,o=0){return new ks(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=B,s=B){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...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 Ls extends Zt{constructor(t,e=B){super(t,e)}setBox(t,e,s,i){return this.setPath(Cs.box(t,e,s,i)),this}}const Ns="none",Es="near",Ms="displayAll",Ts="largestFirst",Os="hidden",Bs="line",Rs="area",Ds="circlebar";let Fs=0;const zs="_deleted";class $s{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=Fs++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}isEmpty(){return!1}copy(){return{...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:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?(this._readObject(t,e),(r(e.drillDown)||i(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}getPointIcon(t){return this.icon}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getParam(t){var e,s,i;const r=this.source||{};if("value"===t)return null!==(e=r[t])&&void 0!==e?e:this.getValue();if(t.indexOf(".")>0){const e=t.split(/\./g);let i=null!==(s=this[e[0]])&&void 0!==s?s:r[e[0]];for(let t=1;t<e.length;t++)i=i[e[t]];return i}return null!==(i=this[t])&&void 0!==i?i:r[t]}_setDeleted(){this._prev=this.copy(),this[zs]=!0}_isDeleted(){return this[zs]}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):r(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=B}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return _(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,i=+t.options.iconField;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]),isNaN(i)||(this.icon=e[i])}_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=S(t._yFielder(e),e.y,e.value),this.color=v(t._colorFielder(e),e.color),this.icon=v(t._iconFielder(e),e.icon),this.yLabel=e.yLabel,this.labelOptions=e.labelOptions}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class Is{constructor(t){this._points=[],this._owner=t}get owner(){return this._owner}get count(){return this._points.length}isEmpty(){return this._points.length<1}get(t){return this._points[t]}pointAt(t,e){function s(t,e,s){return i(t)?t.pid===e:t===s}return this._points.find((i=>s(t,i.pid,i.xValue)&&(void 0===e||s(e,i.pid,i.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){r(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}clean(){this._points=this._points.filter((t=>!t[zs]))}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++);}getRunPoints(t,e){const s=this._points,i=t._zoom;if(this._owner.needAxes()&&i){s.length;let e=i.start,r=i.end;if(t.continuous())return s.filter((t=>t.xValue>=i.start&&i.end>=t.xValue)).slice(0);{const t=s.find((t=>!isNaN(s[0].xValue)));if(t){const s=t.xValue,i=Math.ceil(r-e);e=Math.floor(e),r=Math.min(r,e+i),e-=s,r-=s}}return s.slice(e,r+1)}return s}}class Gs extends $s{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return _(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=v(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 Hs extends $s{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 _(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[w(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=v(e[t.options.lowField],e.low),this.y=S(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 js extends He{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}js.defaults=xe(He.defaults,{step:1});class Ys extends je{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 Ws extends Fe{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,o=e.length;t<=s&&n<o;t++,n+=r)i.push(e[n]);else for(let t=0;t<=s;t++)i.push(e[t+1])}return i}}class Xs extends Ue{constructor(){super(...arguments),this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}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}polarOff(){return.5}_createGrid(){return new Ws(this)}_createTickModel(){return new js(this)}_createLabel(){return new Ys(this)}collectValues(){this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=C.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){var t;let e=super.getStartAngle(),s=+this._op.startOffset;return s>0&&(e-=f(s,1)*((null===(t=this._categories[0])||void 0===t?void 0:t.w)||1)*D/this._catLen),e}_doPrepareRender(){const t=this._op;this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=w(t.minPadding,t.padding,0),this._maxPad=w(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._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const o=this._tick.options.step||1,a=[],h=t,l=e;if(this._zoom){const s=Math.ceil(e-t);t=Math.floor(t),e=Math.min(e,t+s)}else t=Math.floor(t+.5),e=Math.ceil(e-.5);this._catMin=t;let _=this._catLen=Math.floor(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+=o){const s=t+e-1,r=this._categories[t+e-1];a.push({index:e-1,pos:NaN,value:s,label:i.getTick(e-1,r?r.t:s)})}return this._setMinMax(h,l),a}_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*z;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);const s=this._pts;for(let t=1;t<s.length-1;t++)if(e>=s[t]&&s[t+1]>=e)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 h(t)?t:this._map[t]}getXLabel(t){var e;return(null===(e=this._categories[t])||void 0===e?void 0:e.c)||t}_doCalculateRange(t){const e=super._doCalculateRange(t);return this._isX||(e.min=f(0,e.min),e.max=y(0,e.max)),e}$_collectCategories(t){const e=this._op.categories,s=this._categories=[];if(r(e)&&e.length>0)this._len=0,e.forEach((t=>{const e=null==t?1:x(t.weight,1),r=t&&t.icon;let n,o;null==t?o=n=null:i(t)?(n=v(t.name,t.label),o=v(t.label,t.name)):o=n=String(t),this._len+=e,s.push({c:n,t:o,w:e,i:r})}));else if(r(t)){let e=[];if(this._op.weightSeries&&this._op.weightField){const t=this.chart.seriesByName(this._op.weightSeries);t&&r(t.data)&&t.data.forEach((t=>{const s=t[this._op.weightField];C.isNumber(s)&&s>=0?e.push(s):e.push(1)}))}for(const i of t){i.collectCategories(this).forEach(((t,i)=>{s.find((e=>e.c===t))||s.push({c:t,w:e[i]||1,t:t})}))}}this._map={},s.forEach(((t,e)=>{null!=t.c&&(this._map[t.c]=e)}))}}var Us;Xs.type="category",Xs.defaults=xe(Ue.defaults,{padding:0,categoryPadding:.1,startOffset:0});const Zs={},qs={};class Ks extends Ae{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(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 C.isValidNum(t)?this._getText(null,t,b(t)>1e3,!0):t}getOffset(){return x(this._op.offset,0)}getDefaultIconPos(){return"top"}_isVisible(){return this._op.visible||n(this._op.visibleCallback)}_doSetSimple(t){return n(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Us=Ks,Ks.OFFSET=5,Ks.defaults=xe(Ae.defaults,{visible:void 0,position:"auto",offset:Us.OFFSET});class Qs extends Se{constructor(t){super(t.chart),this.series=t}_doPrepareRender(t){const e=this.series,s=this._res=(e._visPoints.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._visPoints.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 o=e*n-s*s,a=0===o?0:(e*r-s*i)/o;return{m:a,a:(i-a*s)/e}}_linear(t,e){const s=t.length;if(s>1){const{m:i,a:r}=this._calcLine(t);this._polar?e.push(...t.map((t=>({x:t.x,y:i*t.x+r})))):e.push({x:t[0].x,y:i*t[0].x+r},{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),o=t[0].x,a=t[s-1].x,h=(a-o)/this._res;for(let t=o;t<=a;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),o=Math.exp(n),a=t[0].x,h=t[s-1].x,l=(h-a)/this._res;for(let t=a;t<=h;t+=l){const s=o*t**r;e.push({x:t,y:s})}}}_calcLine2(t){t.length;let e=0,s=0,i=0,r=0,n=0,o=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),o+=t.x*t.y}));const a=s*i-o*o,h=Math.exp((i*r-o*n)/a);return{m:(s*n-o*r)/a,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),o=n,a=t[0].x,h=t[s-1].x,l=(h-a)/this._res;for(let t=a;t<=h;t+=l){const s=o*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,o=0;const a=2+1;for(let e=0;e<a;e++){for(let i=0;i<s;i++)n+=t[i].x**e*t[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=t[r].x**(e+i);h.push(o),o=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++)b(s[t][r])>b(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,a),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*t**i),0);e.push({x:t,y:s})}}}_movingAverage(t,e){const s=t.length,i=y(1,f(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++}}}Qs.defaults=xe(Se.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2});const Js={x:"xValue",y:"yValue",z:"zValue"};class ti extends vs{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 ei extends vs{constructor(t){super(),this.points=t,this.duration=300,this.endHandler=()=>{this.points.clean(),this.points.owner._dataPointsChanged(),this.points.owner.$_stopDeleteAni(this)},t.owner.$_setDeleteAni(this)}_doUpdate(t){return this.points.forEach((e=>{e._isDeleted()&&(e._vr=1-t)})),this.points.owner._changed(),!0}}class si extends $s{}class ii extends Se{constructor(){super(...arguments),this._row=0,this._col=0,this.index=-1,this.seriesIndex=0,this._simpleMode=!1}static register(...t){t.forEach((t=>{Zs[t.type]=t}))}static _loadSeries(t,e,s,i){let r=t._getSeriesType(s.type);if(!r&&s.type&&console.error(`Unknown series type: '${s.type}'`),!r&&(r=t._getSeriesType(i||t.type),!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.getParam(s)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getParam(s)}}_doInit(t){this._points=new Is(this),this._pointArgs={},this._paletteColors=Array(12).fill(0).map(((t,e)=>e));const{paletteMode:e}=this.chart.options.options;e==ot&&C.shuffle(this._paletteColors)}_doInitChildren(t){t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){C.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){C.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){C.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){C.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 ii.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 points(){return this._runPoints.slice(0)}get visiblePointCount(){return this._visPoints.length}get visiblePoints(){return this._visPoints.slice(0)}get canPolar(){return!1}getVisiblePoint(t){return this._visPoints[t]}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._visPoints}getPointsByRange(t,e){const s=[];return this._points.forEach((i=>{e>=i.xValue&&i.xValue>=t&&s.push(i)})),s}_getVisiblePoints(){return this._points.getRunPoints(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}connectable(t){return!1}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){if(t._zoom)return t instanceof Xs?Math.floor(t._zoom.start):t._zoom.start;{const e=t.getValue(this._op.xStart);return(isNaN(e)?t.getValue(this.chart._chartOptions.getXStart(t)):e)||0}}$_getXStep(t){var e;return null!==(e=v(this._op.xStep,this.chart._chartOptions.options.xStep))&&void 0!==e?e:1}_buildVisPoints(t){return t.filter((t=>!1!==t.visible))}_prepareRunPoints(t,e){this._runPoints=this._points.getRunPoints(t,e),this.visible&&!this._referents?this._visPoints=this._buildVisPoints(this._runPoints):this._visPoints=null}_dataSourceChanged(){const t=this._doLoadData(this._data);this._loadPoints(t)}_prepareRender(){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&&(this._dataSourceChanged(),this._dataSourceDirty=!1),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this._pointLabel._prepareRender(),super._prepareRender()}prepareAfter(){this._pointsChanged=!1}collectCategories(t){if(t instanceof Xs){let e=t.options.categoryField;return null!=e?this._points.getProps(e):this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);o(i)&&(i=i.trim()),this._runPoints.forEach(((r,n)=>{let o=t.getValue(r.x);isNaN(o)&&(o=s,s=t.incStep(s,i)),isNaN(o)?r.isNull=!0:(r.xValue=o,e&&!1!==r.visible&&e.push(o))}))}else this._runPoints.forEach(((s,i)=>{if(s.isNull)s.y=s.yGroup=s.yValue=NaN;else{let i=null==s.y?NaN:t?t.getValue(s.y):+s.y;isNaN(i)&&(i=null==t?void 0: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&&!1!==s.visible&&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,r=this.hasZ();let n=s[0],o=n.xValue,a=o,h=n.yValue,l=h,_=r?n.zValue:null,c=_;n.vindex=0;for(let t=1;t<i;t++)n=s[t],n.vindex=t,isNaN(l)&&!isNaN(n.yValue)?h=l=n.yValue:n.yValue>l?l=n.yValue:n.yValue<h&&(h=n.yValue),isNaN(a)&&!isNaN(n.xValue)?o=a=n.xValue:n.xValue>a?a=n.xValue:n.xValue<o&&(o=n.xValue);if(r)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(c)&&!isNaN(e)?_=c=e:e>c?c=e:e<_&&(_=e)}if(this._minY=h,this._maxY=l,this._minX=o,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,r&&(t.zMin=this._minZ=_,t.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),!isNaN(this._minY)&&t&&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=nt(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=B}))}prepareReferents(t){this._referents&&this._referents.forEach((e=>e.visible&&e.refer(this,t))),this.visible&&!this._visPoints&&(this._visPoints=this._buildVisPoints(this._runPoints))}refer(t,e){}getLegendSources(t){!1!==this._op.visibleInLegend&&t.push(this)}getLabelPos(t){return this._getLabelAutoPos(t,t.options.position)}_getLabelAutoPos(t,e){return e}getLabelPos2(t,e){return this._labelPosCallback?this._getLabelAutoPos(t,this._labelPosCallback(this._getPointCallbackArgs(this._pointArgs,e))):this._labelPos}getLabelOff(t){return t}getLabelOff2(t){return this._labelOffCallback?x(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Ks.OFFSET):this._labelOff}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.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),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()}isLabelsVisible(){return this._pointLabel.visible}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 o(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:B}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e){if(t instanceof $s||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&this.chart.animatable()&&(s.ani=new ti(this,t),s.ani.start()),this._dataPointsChanged(),!!s}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}addPoint(t){const e=this._doAddPoint(t);if(e){if(this._points.add(e),this.chart.animatable()){const t=e._prev=e.copy();t.ani=new ti(this,e),t.ani.start()}this._dataPointsChanged()}return e}addPoints(t){const e=[];return r(t)&&t.forEach((t=>{const s=this._doAddPoint(t);s&&e.push(s)&&this._points.add(s)})),e.length>0&&(this.chart.animatable()&&e.forEach((t=>{const e=t._prev=t.copy();e.ani=new ti(this,t),e.ani.start()})),this._dataPointsChanged()),e}_needDeleteAnimation(){return!1}removePoint(t){if(t instanceof $s||(t=this.getPointAt(t)),t){if(this._points.contains(t)&&this._needDeleteAnimation()&&this.chart.animatable())return t._setDeleted(),new ei(this._points).start(),this._changed(),!0;if(this._points.remove(t))return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePoints(t){if(r(t)){const e=this._needDeleteAnimation()&&this.chart.animatable(),s=[];if(t.forEach((t=>{t instanceof $s||(t=this.getPointAt(t)),t&&(e?(t._setDeleted(),s.push(t)):this._points.remove(t)&&s.push(t))})),s.length>0)return e?(new ei(this._points).start(),this._changed()):(this._doPointsRemoved(s),this._dataPointsChanged()),s.length}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 Ks(t)}_createPoint(t){return new si(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 ks.create(t,ii.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField","iconField"]}_createFielder(t){return n(t)?e=>t(e):null!=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(r(t))return t;if(t){let e;if(t._obj instanceof ct)e=t._obj;else if(t instanceof ct)e=t;else if(Number.isFinite(t)||i(t)||l(t))return[t];if(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=h(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%12+1)})`:t.color;let s,i;r(t.pointColors)?s=t.pointColors:o(t.pointColors)?i=this.chart._assets.get(t.pointColors):this._colorByPoint()&&(s=this.chart.options.options.colors),i instanceof me?this._runPoints.forEach(((t,s)=>{t.color=t.color||i.getNext()||e})):r(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),this._labelPosCallback=P(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=P(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_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=B}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDeleteAni(t){this._deleteAni&&this._deleteAni.stop(),this._deleteAni=t}$_stopDeleteAni(t){this._deleteAni===t&&(this._deleteAni=null)}isDeleting(){return!!this._deleteAni}}ii.LEGEND_MARKER="rct-legend-item-marker",ii.defaults=xe(Se.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}:<b> ${yValue}</b>",loadAnimation:"default",hoverEffect:"default",interactive:!0});class ri extends Ve{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)}_internalSeries(){return this._series}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))}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof fi&&e.series[0]._type()===t)return e.series[0]}}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}canPolar(){return this._series.length>0&&this._series.every((t=>t&&t.canPolar))}load(t){const e=this.chart,s=this._items=[],n=this._series=[];r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{t instanceof fi?n.push(...t.series):t instanceof ii&&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 ii?e=t:o(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(Vs[e++%Vs.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=1===this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof di&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){let i=r(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r.init(),r._load(e),r.index=s,r}return ii._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof ci||(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 ni extends ii{_doInitChildren(t){super._doInitChildren(t),t.trendline=(this._trendline=new Qs(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}ni.defaults=xe(ii.defaults,{});class oi extends Se{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)}}oi.defaults=xe(Se.defaults,{radius:3});class ai extends $s{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return v(this.x,this.y)}styleLegendMarker(t){}isEmpty(){return 0===this.yValue}initPrev(t,e){e.yValue=0}getParam(t){const e=super.getParam(t);return null==e&&"name"===t?this.x:e}}class hi extends Se{}hi.defaults=xe(Se.defaults,{curved:!0});class li extends Ks{constructor(t,e=!1){super(t),this.isSub=e}_doInitChildren(t){super._doInitChildren(t),t.connector=(this._connector=new hi(this.chart)).init()}get connector(){return this._connector}getAlign(){return"near"===this._op.align?-1:"far"===this._op.align?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}li.defaults=xe(Ks.defaults,{visible:!0,convergable:!0,align:Ns,dedupeMode:Ms});class _i extends Se{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?Q(this._minDim,$s.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=_i.DEF_COUNT),(this._dirty=!s||s.value!==i||s.count!==r)&&(isNaN(i)||(t=t.filter((t=>t.y>=i))),r>0&&t.length>r&&(r>1&&r--,t=t.slice(0,r)),this._save={count:r,value:i}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=q(t.minValue,!0)}}_i.DEF_COUNT=10,_i.defaults=xe(Se.defaults,{visible:!1,x:"기타"});class ci extends ii{_doInitChildren(t){super._doInitChildren(t),t.subLabel=(this._subLabel=this._createLabel(this.chart)).init(),t.othersGroup=(this._othersGroup=new _i(this.chart)).init()}get subLabel(){return this._subLabel}get othersGroup(){return this._othersGroup}getCenter(t,e){return{x:Q(this._centerXDim,t),y:Q(this._centerYDim,e)}}_getLabelAutoPos(t,e){return"auto"===e?t.isSub&&"inside"===super.getLabelPos(this._pointLabel)?"outside":"inside":e}needAxes(){return!1}_colorByPoint(){return!0}getLegendSources(t){this._op.legendByPoint?!1!==this._op.visibleInLegend&&(this._groupedPoints||this._runPoints).forEach((e=>{this._isVisibleInLegend(e)&&t.push(e)})):super.getLegendSources(t)}_isVisibleInLegend(t){return t.yValue>=0&&(t.yValue>0||this._op.zeroInLegend)}_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=q(S(s,e._op.center,ci.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=q(S(i,e._op.center,ci.DEF_CENTER),!0))}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_dataSourceChanged(){super._dataSourceChanged(),this._groupedPoints=null}contains(t){return super.contains(t)||this._groupedPoints&&t===this._groupedPoints[this._groupedPoints.length-1]}_buildVisPoints(t){const e=this.othersGroup;if(e.visible){if(!this._groupedPoints&&(this._groupedPoints=e.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({...this._op.othersGroup},t.slice(this._groupedPoints.length));e.parse(this),e.index=t.length,e.yValue=e.yGroup=e.y,this._groupedPoints.push(e)}t=this._groupedPoints}return super._buildVisPoints(t)}}ci.DEF_CENTER="50%",ci.defaults=xe(ii.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:ci.DEF_CENTER,centerY:ci.DEF_CENTER});class ui extends ci{getRadius(t,e){return Q(this._radiusDim,f(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=q(v(t._radius=e,ui.defaults.radius),!0))}(this,t.radius)}}ui.defaults=xe(ci.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class di extends ni{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0}groupWidth(){return this._op.pointWidth}getMinPointWidth(){return this._op.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,y(this._op.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}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._op.minPointWidth=x(this.getMinPointWidth(),0)}}di.defaults=xe(ii.defaults,{pointWidth:1,minPointWidth:0});class pi extends di{_doPrepareRender(){const t=this._op;super._doPrepareRender(),t.nullAsBase&&null!=t.baseValue&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),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}}pi.defaults=xe(di.defaults,{baseValue:0,nullAsBase:!1});class gi extends di{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach((t=>{const s=this._getBottomValue(t);e&&!isNaN(s)&&!1!==t.visible&&e.push(s)}))}}class mi extends gi{}class fi extends Se{constructor(){super(...arguments),this.index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{qs[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{qs[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("yValue","yValue."+s.index).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 o=t[n]._visPoints[s.vindex];o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),ii.getPointTooltipParam(e,s,i)}getTooltipText(t,e){return fi.collectTooltipText(this._op,this._visibles,e)}getTooltipParam(t,e,s){return fi.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}get visCount(){return this._visibles.length}_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)))}connectable(t){return!0}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)}))}prepareReferents(t){this._series.forEach((e=>e.prepareReferents(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),s.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=!C.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 s=this._seriesType();r(e)?e.forEach(((e,i)=>this.$_add(ii._loadSeries(t,this._series.length,e,s)))):i(e)&&this.$_add(ii._loadSeries(t,this._series.length,e,s))}$_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+(b(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,o=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}fi.defaults=xe(Se.defaults,{layout:"default",layoutMax:100,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>"});class yi extends fi{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class bi extends fi{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}}bi.defaults=xe(fi.defaults,{groupWidth:1,groupPadding:.1});class xi extends ni{isMarker(){return!0}}xi.defaults=xe(ii.defaults,{colorByPoint:!1});class wi extends Se{}class vi extends Se{}const Si={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Vi={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Pi={minPadding:0,maxPadding:0};class Ai extends Se{constructor(){super(...arguments),this._dataChanged=!0}_doInitChildren(t){const e=this.chart;t.handle=(this._handle=new wi(e)).init(),t.mask=(this._mask=new vi(e)).init(),t.borderLine=(this._borderLine=new Se(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return x(this._op.thickness,Ai.defaults.thickness)}getGap(){return x(this._op.gap,Ai.defaults.gap)}getGapFar(){return x(this._op.gapFar,Ai.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 s={};if(i(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),s.series=_({},e.series,Si[t]())}else s.series=Si.area();i(e.xAxis)?s.xAxis=_({},e.xAxis,(Vi[e.xAxis.type]||Vi.linear)(),Pi):s.xAxis=_({},Pi),i(e.yAxis)?s.yAxis=_({},e.yAxis,(Vi[e.yAxis.type]||Vi.linear)(),Pi):s.yAxis=_(Vi.linear(),Pi),this._chartConfig=s,this._axisType=s.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()}}Ai.defaults=xe(Se.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class Ci extends Se{_isVisible(){return this._op.visible&&!W(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ci.defaults=xe(Se.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10});class ki extends Ci{}ki.defaults=xe(Ci.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Li extends Se{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:s,_point:i,_ctx:r}=this,n=s._group,o="AxisContext"==r.constructor.name;let a=s,h=i;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const s=Number(t[1])||0;e=e.replace(s+".",""),a=o?r.series[s]:n.getVisibleSeries()[s]}}const l=e.match(/yValue\.(\d+)/);if(l){const t=Number(l[1])||0;h=a.getPoints().get(t||0),e="yValue"}return r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=v(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 o(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?yt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Bt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Li.defaults=xe(Se.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class Ni extends Le{_isVisible(){return this._op.visible&&!W(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}Ni.type="image";class Ei extends Le{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||Ei.defaults.shape}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Ei.type="shape",Ei.defaults=xe(Le.defaults,{width:64,height:64,shape:"square"});class Mi extends Le{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 o(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?yt.getFormatter(s):B),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Bt.getFormatter(t):B)}(t.timeFormat)}}Mi.type="text",Mi.defaults=xe(Le.defaults,{text:"Text"});class Ti extends Fe{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 Oi extends He{constructor(){super(...arguments),this._strictEnds=!1,this._strictTicks=!1}_isValidInterval(t){return t>0}_normalizeSteps(t,e,s){return t}buildSteps(t,e,s,i,o=!1){var a,h;const l=this._op;let _;return this._strictTicks=this._strictEnds=!1,this._step=NaN,o?_=this._getStepsByPixels(t,x(.85*l.stepPixels,60),e,s,i):r(l.steps)||n(l.stepCallback)?(l.stepCallback?(_=l.stepCallback.call(B,{chart:this.chart.wrapper,length:t,minValue:s,maxValue:i}),r(_)&&!_.every((t=>"number"!=typeof t))||(_=s!==i?[s,i]:[s])):_=l.steps.slice(0),_.length>0&&isNaN(_[0])&&(_[0]=s),_.length>1&&isNaN(_[_.length-1])&&(_[_.length-1]=i),this._strictTicks=this._strictEnds=!0):_=this._baseAxis instanceof zi&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,e,s,i,!0):l.stepCount>0?this._getStepsByCount(l.stepCount,e,s,i,!1):this._isValidInterval(l.stepInterval)?this._getStepsByInterval(l.stepInterval,e,s,i):l.stepPixels>0?this._getStepsByPixels(t,((null===(a=this.axis)||void 0===a?void 0:a._isPolar)&&!(null===(h=this.axis)||void 0===h?void 0:h._isX)?.5:1)*l.stepPixels,e,s,i):s!==i?[s,i]:[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 zi&&(this._baseAxis=e,e.tick._baseAxis=null)}}$_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<u(t/e)*e&&(t=u(t/e)*e),H(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,o=i-s;let a=o/(t-1);const h=Math.pow(10,Math.floor(Math.log10(a))),l=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/h==2.5&&c(t*o/a)==t*o/a?this._step=a:a=this._step=u(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this.$_normalizeMin(s,h);else{for(it(s<e&&i>e,"base error"),t=y(3,t);;){if(!(u((e-s)/a)+u((i-e)/a)+1>t))break;a+=h}s=e-u((e-s)/a)*a}else s=n._fixedMin;l.push(s);for(let e=1;e<t;e++)l.push(H(l[e-1]+a));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=H(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=H(n-t));for(n=e;n<i;)r.push(n=H(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,o=[];if(0===n)return isNaN(i)?[]:[i];let a=t>250?5:t>200?4:t>150?3:t>80?2:1,h=y(this.axis._isX?1:a,c(t/e))+1,l=n/(h-1);const _=Math.pow(10,Math.floor(m(l))),d=this._getStepMultiples(_);let p,g=0;if(l/=_,d)if(l>d[g]){for(;g<d.length-1;g++)if(l>d[g]&&l<d[g+1]){l=d[++g];break}}else l=d[g];if(l*=_,isNaN(s))i=this.$_normalizeMin(i,l);else{for(it(i<=s&&r>=s,"base error"),h=y(3,h);g<d.length;){if(!(u((s-i)/l)+u((r-s)/l)+1>h))break;l=g<d.length-1?d[g+1]*_:2*l,g++}i=s-u((s-i)/l)*l}for(this._step=l,o.push(H(p=i));p<r;)o.push(H(p+=l));return o}}Oi.defaults=xe(He.defaults,{stepPixels:72,baseRange:!1});class Bi extends je{}Bi.defaults=xe(je.defaults,{numberFormat:"0.##"});class Ri extends Bi{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!0)}}Ri.defaults=xe(Bi.defaults,{useSymbols:!0});class Di extends Oe{getSize(t){return Q(this._sizeDim,t)}_doApply(t){super._doApply(t),this._op.space=x(this._op.space,0),this._sizeDim=q(this._op.size,!1)}}Di.defaults=xe(Oe.defaults,{enabled:!0,size:"30%",space:16,gridVisible:!0});class Fi extends Be{}Fi.defaults=xe(Be.defaults,{visible:!1});class zi extends Ue{constructor(){super(...arguments),this._breaks=[]}_doInitChildren(t){super._doInitChildren(t),t.baseLine=(this._baseLine=new Fi(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),s.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new Ti(this)}_createTickModel(){return new Oi(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 zi&&i._baseAxis._ticks.length>0;let n,{min:o,max:a}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e),h=this._baseVal;if(isNaN(h)&&o<0&&a>0&&(h=0),isNaN(h)?o<0&&a>0&&(h=0):(o=Math.min(o,h),a=Math.max(a,h)),r&&i.options.baseRange&&(o=i._baseAxis.axisMin(),a=i._baseAxis.axisMax()),o===a)n=[o];else if(n=i.buildSteps(s,h,o,a,!1),n.length>0){if(i._strictTicks||(n=i._normalizeSteps(n,o,a)),!isNaN(this._fixedMin)||!i._strictEnds&&"tick"!==this._getStartFit())for(;n.length>2&&n[0]<o;)n.shift();else if(!i._strictEnds&&!r){for(;n.length>2&&n[1]<=o;)n.shift();if(!isNaN(i._step))for(;n[0]>o;)n.unshift(i.getNextStep(n[0],-1))}if(o=Math.min(o,n[0]),!isNaN(this._op.strictMax)||!i._strictEnds&&"tick"!==this._getEndFit())for(;n.length>2&&a<n[n.length-1];)n.pop();else if(!i._strictEnds&&!r){for(;n.length>2&&n[n.length-2]>=a;)n.pop();if(!isNaN(i._step))for(;n[n.length-1]<a;)n.push(i.getNextStep(n[n.length-1],1))}a=Math.max(a,n[n.length-1])}else n.push(o+(a-o)/2);this._setMinMax(o,a);const l=[];this._runBreaks&&(n=this.$_getBrokenSteps(this._runBreaks,s,o,a));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:H(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 o=[n],a=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,a.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&&o.push(t)})),s.space>0&&o.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};a.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&e<=t.to&&o.push(e)}))}return this._lastSect=a[a.length-1],o}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?j(t-i-s.pos):j(i+s.pos)}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return j(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){var i;const r=this._op;let n=this.isZoomed(),o=this.isZoomed(),a=!0,h=!0,l=NaN,_=NaN,c=!1;this._series.forEach((t=>{const i=t.getBaseValue(this);t instanceof xi&&(c=!0),isNaN(i)||(isNaN(r.minValue)&&i<=e?t.isBased(this)?e=i:l=x(f(l,i),i):isNaN(r.maxValue)&&i>=s&&(t.isBased(this)?s=i:_=x(y(_,i),i))),!n&&a&&t.canMinPadding(this,e)&&(a=!1),!o&&h&&t.canMaxPadding(this,s)&&(h=!1)})),n||(n=a),o||(o=h),this._fixedMin=this._fixedMax=NaN;let u=null!==(i=r.padding)&&void 0!==i?i:c||!this._isX?.04:0,d=0,p=0;isNaN(r.strictMin)?r.minValue<e?e=r.minValue:n?this._fixedMin=e:d=w(r.minPadding,u,0):this._fixedMin=e=r.strictMin,isNaN(r.strictMax)?r.maxValue>s?s=r.maxValue:o?this._fixedMax=s:p=w(r.maxPadding,u,0):this._fixedMax=s=r.strictMax;let g=y(0,s-e),m=e-g*(this._minPad=d),b=s+g*(this._maxPad=p);return!isNaN(l)&&l<=e&&m<l&&(m=this._fixedMin=l),!isNaN(_)&&_>=s&&b>_&&(b=this._fixedMax=_),{min:m,max:b}}$_calcUnitLength(t){const e=[];let s=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(e.push(...t._getVisiblePoints()),s++)})),0===s&&this._series.forEach((t=>{t.visible&&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=f(r,t[e]-t[e-1]);return{len:x(e*=r/(i-s+r),1),min:r}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new Di(this);return e.init(),e._load(t),e}}$_loadBreaks(t){if(r(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(_(new Di(this)._initObject(),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],o=e[r];s=n,o.options.from<s.options.to?t(n,o):i.push(_(new Di(this)._initObject(),o))}}var s}}zi.defaults=xe(Ue.defaults,{nullable:!0,startFit:"default",endFit:"default"});class $i extends zi{get label(){return this._label}_createLabel(){return new Ri(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof fi&&"fill"===r[0].options.layout&&(i.max=r[0].options.layoutMax),i}}$i.type="linear";class Ii extends Oi{canUseNumSymbols(){return this.axis.axisMax()>m(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 o=t[e],a=c(o);if(o===a){let t=i[n-1];e>1&&o-t<r&&(t=Math.pow(10,t),c(t)!==H(t)&&i.pop()),i.push(o)}else if(o>0&&o>a){if(o=a+m(10*(o-a)),o<=s)(0===n||o>i[n-1])&&i.push(o);else if(n>0){if(i[e-1]>=s)break;{const r=g(c(m(t[e]-t[e-1]))),n=t[e],a=n-c(n);if(r<1)for(let t=1;t<10;t++)if(a>m(t)&&a<m(t+1)){const e=c(n)+m(t);if(e>=s){o=e;break}}i.push(o)}}}else if(e>0&&o<=s&&o>i[n-1])i.push(o);else if(o>s)break;i.length>1&&(r=Math.min(.5,r,i[i.length-1]-i[i.length-2]))}return i}}Ii.defaults=xe(Oi.defaults,{arrangeDecimals:!0});class Gi extends zi{_createLabel(){return new Ri(this)}_createTickModel(){return new Ii(this)}collectValues(){super.collectValues(),this._values=this._values.filter((t=>t>0))}getPos(t,e){return e=e>0?m(e):-1,super.getPos(t,e)}_doCalculateRange(t){const e=super._doCalculateRange(t);return e.min=m(e.min),e.max=m(e.max),e}_createTick(t,e,s){return super._createTick(t,e,H(g(s)))}_calcUnitLen(t,e,s,i){let r=m(t[1])-m(t[0]);for(let e=2;e<t.length;e++)r=f(r,m(t[e])-m(t[e-1]));const n=i-s,o=r/n;return{len:x(e*=o,1),min:n*o}}}Gi.type="log";const Hi=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],ji=[[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]],Yi={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Wi extends Oi{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)?o(t)&&Yi.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>=Hi[e]/2&&t<Hi[e+1]/2)return this._scale=e,ji[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],o=r-i;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/this._op.stepPixels)+1,_=y(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),u=Hi[this._scale];if(_/=u,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 d=a.date(i),p=a.date(r);let g,m=d;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=_,_*=u,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(o(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=Yi[a],t=Hi[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(o.push(l=s);l<i;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>s;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,s,i)}}const Xi=[{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 Ui extends Bi{_doApply(t){super._doApply(t);const e=o(t.timeFormat)?t.timeFormat:void 0,s=o(t.beginningFormat)?t.beginningFormat:void 0,n=t.timeFormats,h=t.useBeginningFormat;if(this._formats=Xi.map((t=>_(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&s&&this._formats.forEach((t=>{t.beginningFormat=s})),r(n))for(let t=0;t<n.length;t++){const e=this._formats[t],s=n[t];a(s)?e.format=s:i(s)&&(a(s.format)&&(e.format=s.format),h&&a(s.beginningFormat)&&(e.beginningFormat=s.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,o=i.tick._scale,a=Bt.getFormatter;switch(o){case 7:return a(n[o].format).toStr(r,s.startOfWeek);case 6:return 0===t||0===r.getMonth()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 5:case 4:return 0===t||1===r.getDate()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 3:return 0===t||0===r.getHours()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 2:return 0===t||0===r.getMinutes()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 1:return 0===t||0===r.getSeconds()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 0:return 0===t||0===r.getMilliseconds()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek)}}}Ui.defaults=xe(Bi.defaults,{useBeginningFormat:!0});class Zi extends zi{get label(){return this._label}_createTickModel(){return new Wi(this)}_createLabel(){return new Ui(this)}collectValues(){this._offset=60*x(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return h(t)?t:t instanceof Date?t.getTime():o(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(o(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)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}}Zi.type="time",Zi.subtype="date",Zi.defaults=xe(zi.defaults,{baseValue:NaN});class qi extends mi{pointLabelCount(){return 2}_createLegendMarker(t,e){return ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Hs(t)}_getBottomValue(t){return t.lowValue}}qi.type="barrange",qi.defaults=xe(mi.defaults,{tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Ki extends $s{}class Qi extends pi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Ki(t)}_getGroupBase(){return this._group?this._group.options.baseValue:this._op.baseValue}}Qi.defaults=xe(pi.defaults,{colorByPoint:!1,pointOffset:0});class Ji extends Qi{_createLegendMarker(t,e){return ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Ji.type="bar";class tr extends bi{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}}tr.defaults=xe(bi.defaults,{baseValue:0});class er extends tr{_canContain(t){return t instanceof Ji}}er.type="bargroup",er.seriesType="bar";class sr extends jt{constructor(t,e){super(t,ii.LEGEND_MARKER),this._size=e,this.add(this._marker=new Zt(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){Cs.setShape(this._marker,this._shape,t/2,t/2),this._marker.trans(this._markerOffset(t),0)}_markerOffset(t){return 0}}class ir extends sr{constructor(t,e){super(t,e),this.insertFirst(this._line=new Zt(t)),this.insertFirst(this._area=new Zt(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 rr extends sr{constructor(t,e){super(t,e),this.insertFirst(this._line=new Zt(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Zt(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Zt(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 Zt{constructor(t,e=B,s=B){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){C.isNumber(t)?this.setPath(Cs.line(t,e,s,i)):t&&this.setPath(Cs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Cs.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(Cs.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Cs.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(Cs.line(e,t,s,t))}}class or extends sr{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 ar extends $s{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class hr extends oi{}hr.defaults=xe(oi.defaults,{radius:4,hoverScale:1.75});class lr extends Ks{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?lr.ALIGN_GAP:0:t}getPosition(){return v(this._op.position,"auto")}}lr.ALIGN_GAP=4,lr.defaults=xe(Ks.defaults,{position:"auto",align:"center"});class _r extends ni{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new hr(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 lr(t)}_createPoint(t){return new ar(t)}hasShape(){return!0}setShape(t){this._shape=t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new or(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),f(e,2*this.marker.options.radius)),s}_connectNulls(){return!1}_doPrepareLines(t){const e=t.length,s=[];if(this._containsNull&&!this._connectNulls()){let i=0;for(;i<e;){const r=[];for(;i<e&&t[i].isNull;)i++;for(;i<e&&!t[i].isNull;)r.push(t[i++]);r.length>0&&s.push(r)}}else s.push(t.slice());return s}}_r.defaults=xe(ii.defaults,{nullAsBase:!1});class cr extends Ae{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}cr.defaults=xe(Ae.defaults,{visible:!1,offset:8});class ur extends _r{_doInitChildren(t){super._doInitChildren(t),t.flag=(this._flag=new cr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof br||this._group instanceof xr?this._group.options.lineType:this._op.lineType}_connectNulls(){return this._op.connectNullPoints}getBaseValue(t){return t._isX?NaN:this._base}_doPrepareRender(){const t=this._op;super._doPrepareRender(),t.nullAsBase&&null!=t.baseValue&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),this.flag._prepareRender(),this._base=w(this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue,this._yAxisObj.getBaseValue(),0)}}ur.type=Bs,ur.defaults=xe(_r.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1});class dr extends ur{get canPolar(){return!1}_viewType(){return"line"}getLineType(){return"spline"}}dr.type="spline";class pr extends ar{}class gr extends ur{_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 ir(t,e)}_createPoint(t){return new pr(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)}}gr.type=Rs;class mr extends pr{get high(){return this.y}get highValue(){return this.yValue}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}labelCount(){return 2}_assignTo(t){return _(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=v(e[t.options.lowField],e.low),this.y=S(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 fr extends lr{getPosition(){return"auto"===this._op.position||null==this._op.position?"foot":this._op.position}}class yr extends _r{pointLabelCount(){return 2}_createLabel(t){return new fr(t)}_createLegendMarker(t,e){return new rr(t,e)}_createPoint(t){return new mr(t)}getLineType(){return this._op.curved?"spline":"default"}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._visPoints.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}}yr.type="arearange",yr.defaults=xe(_r.defaults,{curved:!1,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class br extends fi{_canContain(t){return t instanceof ur}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}}br.type="linegroup",br.seriesType=Bs,br.defaults=xe(fi.defaults,{lineType:"default"});class xr extends fi{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 gr}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}}xr.type="areagroup",xr.seriesType=Rs,xr.defaults=xe(fi.defaults,{lineType:"default"});class wr extends pr{}class vr extends gr{getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new wr(t)}_doLoadData(t){const e=super._doLoadData(t);if(r(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}refer(t,e){if(!e._isX){const e=t._visPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this._loadTable(e);this._doLoadPoints(s),this._prepareRunPoints(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)),o=n/i.pointsInSigma,a=r-i.sigmas*n,h=r+i.sigmas*n;let l=r;const _=[];for(_.push(e(r,n,l));l>a;)l-=o,_.unshift(e(r,n,l));for(l=r;l<h;)l+=o,_.push(e(r,n,l));return _}}vr.type="bellcurve",vr.defaults=xe(gr.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Sr extends $s{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 _(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[w(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=v(e[s.minField],e.min),this.low=v(e[s.lowField],e.low),this.mid=v(e[s.midField],e.mid),this.y=S(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 Vr extends mi{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Sr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}}Vr.type="boxplot",Vr.defaults=xe(mi.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 Pr extends Gs{}class Ar extends xi{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:Q(this._minSizeDim,t),max:Q(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 Pr(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=f(t,s.zValue),e=y(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)}}Ar.type="bubble",Ar.defaults=xe(xi.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>"});class Cr extends yi{_canContain(t){return t instanceof ur}_doConstraintYValues(t){const e={};t.forEach((t=>{t._visPoints.forEach((t=>{if(!1!==t.visible){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=v(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return C.makeIntArray(0,t.length)}}Cr.type="bump",Cr.seriesType=Bs;const kr=function(t){return isNaN(t)?0:t};class Lr{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}reset(t,e){return this._path=[],this.move(t,e),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 h(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return h(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return h(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 h(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(h(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",kr(t[e]),kr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",kr(t[e].x),kr(t[e].y));return this}polygon(...t){return h(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 Nr extends $s{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return _(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[w(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=v(e[s.lowField],e.low),this.open=v(e[s.openField],e.open),this.close=v(e[s.closeField],e.close),this.y=S(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 Er extends mi{canCategorized(){return!0}_createPoint(t){return new Nr(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Lr;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new Zt(t,ii.LEGEND_MARKER,s.end())}}Er.type="candlestick",Er.defaults=xe(mi.defaults,{tooltipText:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class Mr extends Ks{}Mr.defaults=xe(Ks.defaults,{position:"inside"});class Tr extends Qi{get pointLabel(){return this._pointLabel}_createLabel(t){return new Mr(t)}}Tr.type=Ds;class Or extends tr{_canContain(t){return t instanceof Tr}}Or.type="circlebargroup",Or.seriesType=Ds;class Br extends Hs{}class Rr extends oi{}Rr.defaults=xe(oi.defaults,{radius:4,shape:"circle"});class Dr extends mi{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new Rr(this)).init(),t.lowMarker=(this._lowMarker=new Rr(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)+y(0,this.marker.options.radius)}_createPoint(t){return new Br(t)}prepareAfter(){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._visPoints.forEach((t=>{t.radius=s,t.shape=i,t.lowRadius=r,t.lowShape=n})),super.prepareAfter()}}Dr.type="dumbbell";class Fr extends $s{}class zr extends pi{getSegmentSize(t){return Q(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Fr(t)}_createLegendMarker(t,e){const s=new Lr;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new Zt(t,ii.LEGEND_MARKER,s.end())}}zr.type="equalizer",zr.defaults=xe(pi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class $r extends mi{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Hs(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new Lr).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new Zt(t,ii.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}$r.type="errorbar",$r.defaults=xe(mi.defaults,{pointPadding:.3,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Ir extends ai{}class Gr extends Ir{constructor(t,e){super(t),this.points=e}}class Hr extends li{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?Hr.ENDED_DIST:Hr.OUTSIDE_DIST:this._op.distance||0}}Hr.OUTSIDE_DIST=25,Hr.ENDED_DIST=10;class jr extends ci{getSize(t,e){return{width:y(.1*t,Q(this._widthDim,t)),height:y(.1*e,Q(this._heightDim,e))}}getNeckSize(t,e){return{width:C.clamp(Q(this._neckWidthDim,t),.1*t,t),height:C.clamp(Q(this._neckHeightDim,e),.1*e,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new Hr(t)}_createPoint(t){return new Ir(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Gr(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=K(e._width,jr.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=K(e._height,jr.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=K(e._neckWidth,jr.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=K(e._neckHeight,jr.defaults.neckHeight))}(t.neckHeight)}}jr.type="funnel",jr.defaults=xe(ci.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",legendByPoint:!1});class Yr extends $s{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return _(super._assignTo(t),{min:this.min,max:this.max})}}const Wr={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 Xr extends ni{getBinCount(t){const e=x(this._op.binWidth,0);if(e>0)return t/e;return x(this._op.binsNumber,0)<1?Wr[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new Yr(t)}_doLoadPoints(t){function e(t){let e;return e=r(t)?t[x(this.yField,0)]:i(t)?S(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=this._op,n=[];let o=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||o.push(i)}if(o.length>0){o=o.sort(((t,e)=>t-e)),s.minValue<o[0]&&o.unshift(s.minValue),s.maxValue>o[o.length-1]&&o.push(s.maxValue);const t=o.length,e=o[0],i=o[t-1],r=this.getBinCount(t),a=this._binInterval=(i-e)/r;let h=0,l=e,_=l+a;for(let e=0;e<r;e++){let s=0;if(e==r-1)s=t-h;else for(;h<t&&o[h]<_;)s++,h++;n.push({x:l,y:s,min:l,max:e===r-1?i:_}),l=_,_=l+a}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._visPoints[this._visPoints.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 ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}}Xr.type="histogram",Xr.defaults=xe(ii.defaults,{baseValue:0,binsNumber:"squreRoot"});class Ur extends oi{}Ur.defaults=xe(oi.defaults,{radius:4,shape:"circle"});class Zr extends $s{}class qr extends pi{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new Ur(this)).init()}get marker(){return this._marker}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new Zr(t)}prepareAfter(){const t=this.marker.options.radius,e=this.marker.options.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e})),super.prepareAfter()}}qr.type="lollipop";class Kr extends Nr{}class Qr extends Er{_createPoint(t){return new Kr(t)}_createLegendMarker(t,e){const s=new Lr;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new Zt(t,ii.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}}Qr.type="ohlc";class Jr extends ar{}class tn extends _r{getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Jr(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return t.referBy(this),!0}refer(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._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}tn.type="pareto",tn.defaults=xe(_r.defaults,{curved:!1});class en extends ai{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}parse(t){super.parse(t),this.sliced=this.source.sliced,this.isNull=this.isNull||this.y<0}_assignTo(t){return _(super._assignTo(t),{sliced:this.sliced})}}class sn extends en{constructor(t,e){super(t),this.points=e}}class rn extends Ae{getDefaultIconPos(){return"left"}}class nn extends li{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?Q(this._distanceDim,e,0):t?Q(s?nn.INNER_DIST:nn.INSIDE_DIST,e):"far"===this._op.align?nn.ENDED_DIST:nn.OUTSIDE_DIST}}nn.INSIDE_DIST=q("30%",!1),nn.INNER_DIST=q("50%",!1),nn.OUTSIDE_DIST=25,nn.ENDED_DIST=10,nn.defaults=xe(li.defaults,{radius:.7,rotationMode:"arc"});class on extends ui{_doInitChildren(t){super._doInitChildren(t),t.innerText=(this._innerText=new rn(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?Q(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new nn(t)}_createPoint(t){return new en(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new sn(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","labelDistance","sliceOffset")}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=F+z*x(this._op.startAngle%360,0),this._totalRad=z*y(0,f(360,x(this._op.totalAngle,360))),this._groupPos=NaN}}on.type="pie",on.defaults=xe(ui.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class an extends fi{getPolarSize(t,e){return Q(this._polarDim,f(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}connectable(t){return!1}_doApply(t){const e=this;var s;super._doApply(t),(s=t.polarSize)!==e._polarSize&&(e._polarSize=s,e._polarDim=q(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=q(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof on}_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}))}}an.type="piegroup",an.seriesType="pie",an.defaults=xe(fi.defaults,{polarSize:"80%",innerSize:0});class hn extends $s{}class ln extends xi{_createPoint(t){return new hn(t)}_createLegendMarker(t,e){return new sr(t,e)}_colorByPoint(){return this._op.colorByPoint}setShape(t){this._defShape=t}get canPolar(){return!0}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),f(e,2*this._op.radius)),s}}ln.type="scatter",ln.defaults=xe(xi.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class _n extends $s{constructor(){super(...arguments),this.from=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._isMid=this.source.isMid,(this._isSum||this._isMid)&&(this.y=0)}getPointLabel(t){return this.y}}class cn extends Ks{}cn.defaults=xe(Ks.defaults,{offset:0});class un extends gi{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new cn(t)}_createPoint(t){return new _n(t)}_createLegendMarker(t,e){return ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,s=t[0],i=s.y=s.save=s._isSum?0:s.y,r=i,n=i,o=s.from=0,a=0,h=s.to=i,l=0;for(let _=1,c=t.length;_<c;_++){s=t[_];if(!0===s._isMid&&_<c)e=n,o=l,h=o+e,l=h,i=e,n=0;else if(s._isSum)e=r,o=0,h=e,i=e;else{if(null==s.y)continue;e=s.y,o=a+i,h=o+e,n+=e,r+=e,i=e}s.yGroup=s.yValue=e,s.from=o,s.to=h,s.y=Math.max(o,h),s.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}un.type="waterfall",un.defaults=xe(gi.defaults,{tooltipText:"<b>${name}</b><br>${series}:<b> ${y}</b>"});class dn extends Se{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}}dn.defaults=xe(Se.defaults,{text:"RealChart v1.0",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class pn extends Se{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"!==v(this._op.scope,"auto")?this._op.scope:this.chart._chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}pn.defaults=xe(Se.defaults,{scope:"auto"});class gn extends Se{_doInitChildren(t){t.credits=(this._credits=new dn(this.chart)).init(),t.pointHovering=(this._pointHovering=new pn(this.chart)).init()}get credits(){return this._credits}get pointHovering(){return this._pointHovering}getXStart(t){return t instanceof Gi&&isNaN(this._op.xStart)?1:this._op.xStart||0}}var mn;gn.defaults=xe(Se.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0,domResize:!1}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right",t.CENTER="center",t.MIDDLE="middle"}(mn||(mn={}));class fn extends O{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new ut,this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new ye,(this._chartOptions=new gn(this)).init(),(this._title=new Ci(this)).init(),(this._subtitle=new ki(this)).init(),(this._legend=new bs(this)).init(),(this._tooltip=new Li(this)).init(),fn.split_class&&(this._split=new fn.split_class(this)).init(),(this._body=new ms(this)).init(),(this._navigator=new Ai(this)).init(),(this._exporter=new fs(this)).init(),this._series=new ri(this),this._xAxes=new Ze(this,!0),this._yAxes=new Ze(this,!1),this._gauges=new ss(this),this._annotations=new Ne(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this.options=Object.assign({},fn.defaults)}_createChart(t){return new fn(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().filter((t=>t.needAxes()))}getTooltipText(t,e){return fi.collectTooltipText(this.axis.options,this.series,e)}getTooltipParam(t,e,s){return fi.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){const e=this.gaugeByName(t);return e instanceof Je?e:this._annotations.get(t)}get wrapper(){return this._wrapper}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(){var t;return null===(t=this._gauges)||void 0===t?void 0:t.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.canPolar()}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(t){return this._series.isEmpty(t)&&(null==this._gauges||this._gauges.isEmpty(t))}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.getGauge(t)}gaugeAt(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.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 mn.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case mn.RIGHT:r=s.filter((t=>t._isOpposite));break;case mn.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case mn.TOP:r=i.filter((t=>t._isOpposite));break;case mn.CENTER:r=s.filter((t=>t._isBetween))}else switch(t){case mn.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case mn.RIGHT:r=i.filter((t=>t._isOpposite));break;case mn.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case mn.TOP:r=s.filter((t=>t._isOpposite));break;case mn.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 fn.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,s){const r=this._bases[e];let n;return i(r.base)&&ve(n={},r.base),i(r[s])&&(n||(n={}),ve(n,r[s])),n?ve(n,t):t}_load(t){var e,s;const i=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),i.asset=this._assets.load(v(t.asset,t.assets)),i.options=this._chartOptions._load(t.options),i.title=this._title._load(t.title),i.subtitle=this._subtitle._load(t.subtitle),i.legend=this._legend._load(t.legend),i.tooltip=this._tooltip._load(t.tooltip),null===(e=this._split)||void 0===e||e._load(t.split),this._seriesIndex=0,this._series.load(t.series),null===(s=this._gauges)||void 0===s||s.load(v(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(S(t.xAxis,t.xAxes,{})),this._yAxes.load(S(t.yAxis,t.yAxes,{}))),i.body=this._body._load(t.body||t.plot),this._annotations.load(v(t.annotation,t.annotations),!1),i.seriesNavigator=this._navigator._load(t.seriesNavigator),i.exporting=this._exporter._load(t.exporting),this}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Se||s instanceof Ve||s instanceof ye)&&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(){var t;const e=this._xAxes,s=this._yAxes,i=this._split;[e,s].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,e.disconnect(),s.disconnect(),this._assets.prepareRender(),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&!this._gaugeOnly&&this._split.prepareRender(e,s),this._series.prepareAfter(),this._legend._prepareRender(),null===(t=this._gauges)||void 0===t||t.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(i(t)){const s=this._templates={};for(const e in t){const r=t[e];i(r)&&(s[e]=_({},r))}["@xAxis","@yAxis","@series","@gauge","@annotation"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(o(e)){let s=this._templates[e];if(s)return ve(ve({},s),t)}else r(e)&&e.forEach((e=>{let s=this._templates[e];return s?ve(ve({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&qs[t.toLowerCase()]}_getSeriesType(t){return o(t)&&Zs[t.toLowerCase()]}_getAxisType(t){return o(t)&&Te[t.toLowerCase()]}_getGaugeType(t){return o(t)&&Ke[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&Qe[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&ke[t.toLowerCase()]}getAxesGap(){return x(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)}}fn.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},Ue.register(Xs,$i,Gi,Zi),ii.register(gr,yr,qi,Ji,vr,Vr,Ar,Er,Tr,Dr,zr,$r,jr,Xr,ur,dr,qr,Qr,tn,on,ln,un),fi.register(xr,er,Cr,Or,br,an),fi.registerSeries(xr,er,Or,br,an),Le.register(Ni,Ei,Mi);const yn="$ctrl";class bn{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new fn(t,this),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[yn]=null===(t=this[yn])||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 assets(){return this._obj._assets}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 o(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart";C.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new fn(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,C.log("chart-items:",be),C.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,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)}draw(){this[yn].refresh()}}class xn{constructor(t,e){this._obj=new ct(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 wn extends T{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,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.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 vn=Object.freeze({x:0,y:0,width:0,height:0});function Sn(t){return{width:t.width,height:t.height}}const Vn=function(t){const e=t.x+t.width/2,s=t.y+t.height/2,i=t.rotation*Math.PI/180,r=t.width/2,n=t.height/2;return[[-r,-n],[r,-n],[r,n],[-r,n]].map((([t,r])=>[e+(t*Math.cos(i)-r*Math.sin(i)),s+(t*Math.sin(i)+r*Math.cos(i))]))},Pn=function(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s],r=t[(s+1)%t.length],n=[r[0]-i[0],r[1]-i[1]],o=[-n[1],n[0]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.push([o[0]/a,o[1]/a])}return e},An=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},Cn=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},kn=function(t,e){const s=Vn(t),i=Vn(e),r=Pn(s),n=Pn(i);for(const t of[...r,...n]){const e=An(s,t),r=An(i,t);if(!Cn(e,r))return!1}return!0},Ln=function(t,e){return!(t.y>=e.y+e.height||e.y>=t.y+t.height||t.x>=e.x+t.width||e.x>=t.x+t.width)};class Nn{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Nn(t,t,t,t):new Nn(t,t,e,e):new Nn(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 Nn(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}}}Nn.Empty=Object.freeze(new Nn),Nn.Temp=new Nn;class En extends jt{constructor(t,e=B){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return En.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}En.IGNORE_ATTRS={width:"",height:""};class Mn extends jt{constructor(t,e=B){super(t,e,"g"),jt.DEBUGGING&&(this.add(this._debugRect=new ks(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),jt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new ks(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 Tn extends Mn{constructor(t,e,s){super(t,e),this._margins=new Nn,this._paddings=new Nn,this.add(this._background=new ks(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 o=this._paddings;o.applyPadding(n);const a=this._doMeasure(t,e,s,i,r);if(a.width+=o.left+o.right,a.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=a.width+=t.left+t.right,this.mh=a.height+=t.top+t.bottom}return this.mw=a.width,this.mh=a.height,a}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 On extends En{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 Bn extends Mn{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 Rn extends jt{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=vn,this._isImageLoaded=!1,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._isImageLoaded=!0,this.invalidate(),this._dirty=!1},this.dom.onerror=()=>{this._dirty=!0,this._isImageLoaded=!1,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),this._isImageLoaded&&!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 Dn extends En{constructor(e,s=B){super(e),this.add(this._text=new ee(e,s)),this._text.anchor=t.TextAnchor.START}get text(){return this._text.text}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 ks(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 ee(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 Rn(t,!1)),this._icon.url=s,this._icon.width=e.options.iconWidth,this._icon.height=e.options.iconHeight):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=Rt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.applyStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(e){const s=this._icon;let i=0;const r=this._text.getBBox(),n=r.width,o=r.height;let a=n,h=o,l=0,_=0,c=0,u=0;if(s){const t=s.getBBox();switch(i=x(this._model.options.iconGap,0),l=t.width,_=t.height,this._model.getIconPos()){case"left":case"right":a+=i+l,h=Math.max(_,o);break;default:h+=i+_,a=Math.max(l,n)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);c=parseFloat(t.paddingLeft)||0,u=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,a+c+(parseFloat(t.paddingRight)||0),h+u+(parseFloat(t.paddingBottom)||0),t.rx)}if(s)switch(this._model.getIconPos()){case"left":s.trans(c,(h-_)/2),c+=l+i,a-=l+i;break;case"right":s.trans(c+a-l,(h-_)/2),a-=l+i;break;case"top":s.transX((a-l)/2),u+=_+i;break;case"bottom":s.trans((a-l)/2,u+o+i)}switch(e){case"center":c+=a/2,this._text.anchor=t.TextAnchor.MIDDLE;break;case"right":c+=a,this._text.anchor=t.TextAnchor.END;break;default:this._text.anchor=t.TextAnchor.START}return this._text.trans(c,u),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 Fn extends vs{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 zn extends Tn{constructor(t){super(t,zn.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new ee(t)),this._richText=new _e}_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 o=Sn(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=o.width;o.width=o.height,o.height=t}return o}_doLayout(e){const s=this._textView,i=s.getStyle("writing-mode"),r=i===ht||i===lt;e?this.rotation=0:this.setRotation(0,(r?this.width:this.height)/2,this._angle);let n=this._margins.top+this._paddings.top,o=0;switch(this.textAlign()){case"left":this._textView.anchor=t.TextAnchor.START,r||(o-=this.width/2);break;case"right":this._textView.anchor=t.TextAnchor.END,r?n+=this.height:o+=this.width/2;break;default:this._textView.anchor=t.TextAnchor.MIDDLE,r&&(n+=this.height/2)}s.trans(o,n)}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}}zn.TITLE_CLASS="rct-axis-title";class $n extends Mn{constructor(t){super(t,Yn.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 In extends Dn{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 _e(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*z,e=this.getBBox();return b(p(t)*e.height)+b(d(t)*e.width)}rotatedHeight(){const t=this.rotation*z,e=this.getBBox();return b(d(t)*e.height)+b(p(t)*e.width)}}class Gn extends jt{constructor(t){super(t,void 0),this.add(this._back=new Zt(t,"rct-crosshair-flag")),this.add(this._text=new ee(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const s=t.options.flag;this._text.text=(s.prefix||"")+e+(s.suffix||"");const i=this._text.getBBox(),r=new Lr,n=y(s.minWidth||0,i.width+8);r.rect(0,0,n,i.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}}}class Hn extends Mn{static isThumb(t){return t.classList.contains(Hn.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new ks(t,Hn.TRACK_CLASS)),this.add(this._thumbView=new ks(t,Hn.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=y(0,e),this._page=f(s,e),this._pos=f(t.min+e-s,y(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=y(0,f(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,o=this._page,a=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||o===r?c:c*o/r)+i;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-c*a/r-t,_-2,t)}else{c-=h+e.getGapFar(),this._trackView.setBounds(0,h,_,c),_-=i;const t=(n||o===r?_:_*o/r)+i;this._reversed,this._thumbView.setBounds(n?0:_*a/r,h+1,t,c-2)}}}Hn.CLASS_NAME="rct-axis-scrollbar",Hn.TRACK_CLASS="rct-axis-scrollbar-track",Hn.THUMB_CLASS="rct-axis-scrollbar-thumb";const jn=/\${label}.*?/g;class Yn extends Mn{constructor(t){super(t,Yn.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,Yn.LINE_CLASS)),this.add(this._titleView=new zn(t)),this.add(this._markContainer=new jt(t,"rct-axis-ticks")),this.add(this._labelContainer=new jt(t,"rct-axis-labels")),this._labelViews=new wn(this._labelContainer,In,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX)return e.visible&&!this.model._isBetween?(this._scrollView||this.add(this._scrollView=new Hn(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 Gn(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?f(0,this.width-n.width):y(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;if(this._prevMin=s.axisMin(),this._prevMax=s.axisMax(),!isNaN(e)&&this._prevMax!==e||!isNaN(t)&&this._prevMin!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:this._prevMax};s.options.animatable&&new Fn(this,t,e,(()=>{this.invalidate()}))}}}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,_=this._titleView;let c=0;return(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new nr(t,Yn.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a.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,o=this._labelViews,a=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,a),e.layout().trans(t.prev(n[i]),s?l-a:0)})):this._markViews.forEach(((e,i)=>{e.resize(a,1),e.layout().trans(s?0:h-a,l-t.prev(n[i]))})));const _=a+(t.tick.options.gap||0);if(this._labelContainer.visible&&o.count>0&&(e?this.$_layoutLabelsHorz(o,r,i,s,h,l,_):this.$_layoutLabelsVert(o,r,i,s,h,l,_)),!this._simpleMode){const i=t.title.options,r=this._titleView,n=this._scrollView,o=this._labelSize;let a=0,c=0;if(r.visible){const n=+i.offset||0,u=+i.gap||0;if(r.resizeByMeasured().layout(e),e){if(c+=s?0:_+o+u,t.options.reversed)switch(i.align){case"start":a=h-r.width/2-n;break;case"end":a=r.width/2+n;break;default:a=h/2-n}else switch(i.align){case"start":a=r.width/2+n;break;case"end":a=h-r.width/2-n;break;default:a=h/2+n}r.trans(a,c),c+=r.height}else{const e=0===r._angle?r.width:r.height;if(a=s?_+o+u+e/2:h-_-o-u-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(a,c)}}else c+=s?0:_+o;(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 $n(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),o=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s._style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=n){o&&n.match(jn)?t.setLabel(s,e,n.replace(jn,o),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,o,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,o,a){const h=t.label,l=y(0,f(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,u=(i=y(1,i))*(r=f(y(1,r),_.length)),p=n||0,g=b(p)*z,m=g<35*z;let x,w=!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){x=e.pull(v++),x.rotation=p,x.row=n,x.index=r,this._prepareLabel(x,_[r],h,c,a),x.setVis(!0);const t=i;if(0===p&&x.getBBox().width>=t){w=!0;break}if(m&&x.getBBox().width*d(g)>=t){w=!0;break}if(0!==p&&x.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-u;0<=t&&t<c&&(x=e.pull(v++),x.row=n,x.rotation=p,x.index=t,this._prepareLabel(x,_[t],h,c,a),x.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=y(0,f(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,o=+r.step|0,a=+r.rows|0,h=+r.rotation%360,l=this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,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,_,o||1);else{switch(o=a=0,i.options.autoArrange){case"rows":a=this.$_getRows(_);break;case"step":o=this.$_getStep(_)}if(o>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,s);)o++;else if(a>1){for(;t._ticks.length>a&&(_.forEach(((t,e)=>{t.row=e%a,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,a,0,!1,s));)a++;this._labelRowPts=[]}else if((isNaN(h)||Math.abs(Math.tan(h*z))<1)&&(h=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,h,!1,s))for(o=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,h,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,0,!0,s)&&_.forEach(((t,e)=>{t.rotation=h}));break}o++}}else;if(_.length>0){if(a>1){const t=!isNaN(h)&&0!=h,e=this._labelRowPts;for(let t=0;t<a;t++)e.push(0);_.forEach((s=>{e[s.row]=y(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=y(n,_[t].getBBox().height)}else{n=_[0].rotatedHeight();for(let t=1;t<_.length;t++)n=y(n,_[t].rotatedHeight())}return n}return 0}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=y(1,i);e.forEach((t=>t.rotation=0));for(let i=0;i<r-1;i+=n){let o=0;for(let a=i;a<i+n&&a<r-1;a++)o+=t.getLabelLength(s,e[i].value);if(e[i].getBBox().height>=o)return!0}}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,o=t._ticks,a=o.length,h=y(1,i);let l,_=n.options.startStep||0,c=0;for(;_<a;_+=h){let i=0;for(let e=_;e<_+h&&e<a;e++)i+=t.getLabelLength(s,o[e].value);if(_+h<a&&(l=e.pull(c++),l.rotation=0,l.index=_,this._prepareLabel(l,o[_],n,a,r),l.setVis(!0),l.getBBox().height>=i))return!0}const u=_-h;0<=u&&u<a&&(l=e.pull(c++),l.rotation=0,l.index=u,this._prepareLabel(l,o[u],n,a,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1){const i=t.label;let r=y(1,+i.options.step|0);const n=this.$_checkOverlappedVert2(t,this._labelViews,e,r,s);let o=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)})),o=this.$_applyStep(t,o,r||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++r,s););else;if(o.length>0){let t=o[0].getBBox().width;for(let e=1;e<o.length;e++)t=y(t,o[e].getBBox().width);return t}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o){const a=this.model,h=a.label,l=a.options.reversed,_=this._labelContainer.textAlign()||"center",c=this._labelRowPts,u=t.get(0).rotation,d=u*z,g=u<-15&&u>=-90||u>15&&u<=90,m=t.count;let f,y;t.freeHiddens(),t.forEach(((t,s)=>{t.setContrast(null).layout(_);const r=t.getBBox();f=a.prev(e[t.index].pos),y=i?n-o-r.height-c[t.row]:o+c[t.row],u<-15&&u>=-90?i?(f-=r.width,y-=p(d)*r.height/2,t.setRotation(r.width,r.height/2,-u)):(f-=r.width,y+=p(d)*r.height/2,t.setRotation(r.width,r.height/2,u)):u>15&&u<=90?i?(y+=p(d)*r.height/2,t.setRotation(0,r.height/2,-u)):(y-=p(d)*r.height/2,t.setRotation(0,r.height/2,u)):(f-=r.width/2,t.setRotation(r.width/2,0,i?-u:u)),t.trans(f,y)})),!g&&m>1&&(function(e,s,i){let r=!0;const n=s.rotatedWidth();let o=s.tx;if(o<-e._marginStart-e._edgeStart)if("pull"===(l?h.options.lastOverflow:h.options.firstOverflow))if(o=-e._marginStart-e._edgeStart+2,t.count>0){const t=i.tx;o+n+(+h.options.overflowGap||12)>t&&(r=!1)}else r=!1;else r=!1;r?s.transX(o):s.setVis(!1)}(this,t.get(l?m-1:0),t.get(l?m-2:1)),function(t,e,s){let i=!0,n=e.tx;const o=e.rotatedWidth();if(n+o>(r+=t._marginEnd+t._edgeEnd)){const t=h.options;"pull"===(l?t.firstOverflow:t.lastOverflow)?(n=r-o,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:m-1),t.get(l?1:m-2)))}$_layoutLabelsVert(t,e,s,i,r,n,o){const a=this.model,h=this._labelContainer.textAlign()||(i?"left":s?"center":"right"),l=i?o:r-o;t.freeHiddens(),t.forEach(((t,o)=>{t.setContrast(null).layout(h);const _=t.getBBox(),c=i?l:s?(r-_.width)/2:l-_.width;t.trans(c,n-a.prev(e[t.index].pos)-_.height/2)}))}}Yn.AXIS_CLASS="rct-axis",Yn.LINE_CLASS="rct-axis-line",Yn.TICK_CLASS="rct-axis-tick";class Wn extends jt{constructor(t,e,s){super(t,Wn.STYLE),this.add(this._back=new ks(t,Wn.BACK_STYLE)),this.add(this._textView=new ee(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 Nn).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}}Wn.STYLE="rct-button",Wn.BACK_STYLE="rct-button-background";class Xn extends jt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Un extends Zt{setArc(t,e,s,i,r,n){this.setPath(Cs.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Zn extends Un{setPolyline(t){this.setPath(Cs.lines(...t))}}class qn extends Zt{static create(t,e,s,i,r,n,o,a,h=!0){return new qn(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",s,i,r,n,o,a,h,l=!0){return new qn(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=B,s=B){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 Cs.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 Cs.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 Kn={};class Qn extends Tn{static register(...t){t.forEach((t=>{Kn[t[0].type]=t[1]}))}constructor(t,e){super(t,Qn.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new jt(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}addToTransform(t){this._transform.add(t)}_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,o=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":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}resetClip(t,e,s){this._clip||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}remove(){var t;return this._clip&&(null===(t=this.control)||void 0===t||t.removeDef(this._clip.dom)),super.remove()}_updateTransform(){this.model.needClip()?this._transform.dom.setAttribute("transform",this.getTransform()):super._updateTransform()}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}Qn.CLASS_NAME="rct-annotation";const Jn={};class to extends Bn{static register(...t){t.forEach((t=>{Jn[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new ks(t,to.PANE_CLASS)),this.add(this._contentContainer=new Yt(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return to.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}}isEmptyView(){return!1}_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=_(Dt.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 io)return t;t=t.parent}}}to.GAUGE_CLASS="rct-gauge",to.PANE_CLASS="rct-gauge-pane";class eo extends vs{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 so extends Dn{}class io extends to{_defaultCalss(){return io.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new Yt(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))}))}}io.GAUGE_GROUP_CLASS="rct-gauge-group";class ro{static reveal(t,e){new oo(t,e)}static grow(t,e){new ho(t,e)}static spread(t,e){new lo(t,e)}static fadeIn(t){new no(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 no extends ro{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:vs.DURATION,fill:"none"})}}class oo extends ro{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:vs.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:Y(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:Y(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class ao extends vs{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof jt}_stop(){super._stop(),this._series=null}}class ho extends ao{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class lo extends ao{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class _o extends ao{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}var co;class uo extends vs{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(vo.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(vo.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class po extends Dn{constructor(t){super(t,"rct-point-label")}}class go extends Yt{constructor(t){super(t,"rct-point-labels"),this._labels=[new wn(this,po),new wn(this,po)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}getWidth(t){let e=0;return this._labels[t].forEach((t=>e=y(e,t.getBBox().width))),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text),a=n._style;e.point=i,e.setModel(t,n,i.icon?n.getUrl(i.icon):null,null),e._text.internalClearStyleAndClass(),e._text.internalSetStyleOrClass(a),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),null!=o?(n.prepareRich(o),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(s.isLabelsVisible()){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,o=s._getLabeledPoints(),a=this._maps,h=i._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);l.setVis(e.isPointLabelVisible(r))&&(this.prepareLabel(t,l,h,r,s,i),a[h][r.pid]=l)}})),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}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)}}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const s=t[e].inflateBBox(-1,-1),i=t[e-1].inflateBBox(-1,-1);if(Ln(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Ts)for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(kn(h,l)?(r.point.yValue<t[s].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),r=n,i=s):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1)),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});kn(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),t[0].point.yValue<r.point.yValue?(e.get(t[0].point).setVis(!1),t[0].setVis(!1),t.splice(0,1)):(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1)))}}else for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(kn(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});kn(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n){const o=t.length,a=this.control.chartView().bodyView();if(o<2)return 0;const h=o/2|0;let l=0,_=0,c=0;for(t=t.sort(((t,e)=>t.ty-e.ty));c<h;){const e=t[c],s=t[c+1],i=e.inflateBBox(0,-1),r=s.inflateBBox(0,-1).y-(i.y+i.height);if(r<0){for(let e=c;e>=0;e--)t[e].shiftY(r);l-=r}c++}for(c=o-1;c>h;){const e=t[c],s=t[c-1],i=e.inflateBBox(0,-1),r=s.inflateBBox(0,-1),n=r.y+r.height-i.y;if(n>0){for(let e=c;e<o;e++)t[e].shiftY(n);_+=n}c--}if(i){let e;for(let s=0;s<o;s++)s<h?(e=t[s+1].ty-t[s].tbottom,e>0&&t[s].shiftY(Math.min(t[s].y-t[s].ty,e))):(e=t[s].ty-t[s-1].tbottom,e>0&&t[s].shiftY(-Math.min(t[s].ty-t[s].y,e)));let s=[];for(let i=0;i<o-1;i++)e=t[i+1].ty-t[i].tbottom,e>0&&(s[i]=e);if(l>0)for(let e=0;e<s.length&&!(t[0].ty>=t[0].y);e++){if(s[e]>0)for(let i=0;i<=e&&(t[i].shiftY(s[e]),!(t[i+1].ty>=t[i].tbottom));i++);s[e]=void 0}if(_>0)for(let e=s.length-1;e>=0&&!(t[o-1].ty<=t[o-1].y);e--)if(s[e]>0){for(let i=o-1;i>e&&(t[i].shiftY(-s[e]),!(t[i-1].tbottom<=t[i].ty));i--);s[e]=void 0}l=t[0].y-t[0].ty,_=t[o-1].ty-t[o-1].y,l+_>0&&t.forEach((t=>t.shiftY((l-_)/2)))}if(n===Os)for(let s=0;s<t.length;s++){const i=t[s];(i.ty<0||i.ty+i.getBBox().height>a.height)&&(e.get(i.point).setVis(!1),i.setVis(!1))}return 1}}class mo extends En{constructor(t){super(t),this.add(this._line=new Zt(t))}setLine(t){this._line.setPath(t)}}class fo extends En{constructor(t){super(t,"rct-point-label-lines"),this._lines=new wn(this,mo)}prepare(t){const e=this._lines,s=t._visPoints,i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.length).forEach(((t,e)=>{const i=s[e];t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class yo extends Yt{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 bo={},xo="rct-point-hover",wo="rct-point-unhover";class vo extends Bn{static register(...t){t.forEach((t=>{bo[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 yo(t,"rct-series-points")),this._labelContainer=new go(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))}isPointLabelVisible(t){return t.visible&&!t.isNull&&!t.isEmpty()&&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){}_getPointColors(){return"a"}prepareSeries(t,e,s){this.setModel(e),this.setData("index",e.seriesIndex%12),this.setData("pointcolors",e._colorByPoint()?this._getPointColors():B),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,s)}_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(xo).addClass(wo)}))):this._getPointPool().forEach((t=>{t.containsClass(wo)&&t.removeClass(wo).addClass(xo)}))}_clearHoverClasses(t){t instanceof jt&&t.removeClass(xo).removeClass(wo)}focusPoints(t){const e="none"!==this.model.options.hoverEffect,s=this._hoverAnis,i=this._hoverPts,r=[],n=[];this.model.options.interactive&&e&&(i.forEach((e=>{if(e instanceof jt&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.stop(),e.setBoolData(vo.DATA_FOCUS,!1),e.restoreStyles(),e instanceof No&&r.push(new uo(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 jt&&(t.setBoolData(vo.DATA_FOCUS,!0),n.push(t),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof No?r.push(new uo(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof To&&this.needFronting()&&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){}applyAutoRotation(t,e,s,i){if(!this.model.pointLabel.options.autoRotation)return;const{width:r,height:n}=t.getBBox(),o=e/s*(i||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&ws(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 ni&&e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new Zt(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 _o(this,(()=>{this.invalidate()}))}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){const{paletteMode:s}=this.model.chart.options.options,i=s===at?Math.floor(12*Math.random()):e.index%12;t.setData("index",this.model._paletteColors[i].toString())}_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:void 0}_getGrowRate(){return x(this._growRate,1)}_getPosRate(){return x(this._posRate,1)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0||this.model.isDeleting()}_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,o={x:0,y:0},a={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 u=t[r+1].px-t[r].px,d=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}),o.x=-_.x*u*n,o.y=-_.y*u*n;const s=d+a.x,g=p+a.y,m=t[r].px+o.x,f=t[r].py+o.y;i.curve(s,g,m,f,t[r].px,t[r].py),u=t[r+1].px-t[r].px,a.x=_.x*u*n,a.y=_.y*u*n,d=t[r].px,p=t[r].py}i.curve(d+a.x,p+a.y,t[r].px,t[r].py,t[r].px,t[r].py)}$_renderTrendline(t){const e=this.model;if(!(e instanceof ni))return;const s=e.chart.isPolar(),i=e.trendline,r=e._xAxisObj,n=e._yAxisObj,o=n._vlen,a=r._vlen;let h;if(s){const t=e.chart._body.getPolar(r);h=i._points.map((e=>{const s=t.start+r.getPos(a,e.x),i=n.getPos(t.rd,e.y);return{x:t.cx+i*d(s),y:t.cy+i*p(s)}}))}else h=i._points.map((e=>{let s,i;return t?(i=a-r.getPos(a,e.x),s=n.getPos(o,e.y)):(s=r.getPos(a,e.x),i=o-n.getPos(o,e.y)),{x:s,y:i}}));if(this._trendLineView.setVis(h.length>1)){this._trendLineView.setStyleOrClass(i.options.style);const t=new Lr;t.move(h[0].x,h[0].y),i.isCurved()&&!s?this._drawSpline(h.map((t=>({px:t.x,py:t.y}))),0,-1,t):(s&&i.isCurved(),t.lines(...h)),this._trendLineView.setPath(t.end(!1))}}_layoutLabel(t,e,s){let{inverted:i,x:r,y:n,hPoint:o,labelView:a,labelOff:h}=t;if(!a.setVis(r>=0&&r<=e&&n>=0&&n<=s))return;a.layout(t.textAlign);const l=t.reversed?o<=0:o<0,_=a.getBBox();let c=!0;switch(i?n-=_.height/2:r-=_.width/2,t.labelPos){case"inside":i?r-=(o+_.width)/2+(t.reversed?h:-h):n+=(o-_.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?o+_.width+h:o-h:n+=l?o+h:o-_.height-h;break;default:i?l?r-=_.width+h:r+=h:l?n+=h:n-=_.height+h,c=!1}a.setContrast(c&&t.pointView.dom),a.trans(r,n)}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const o="x"===s,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.options.reversed,l=a.getPos(o?t:e,y(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,f(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,b(_-l),e):r.setBounds(l,-e,b(_-l),e):r.setBounds(0,-y(l,_),t,b(_-l)):o?h?r.setBounds(_,0,b(_-l),e):r.setBounds(l,0,b(_-l),e):r.setBounds(0,e-y(l,_),t,b(_-l))}_setFill(t,e){i(e)&&e[J]?t.internalSetStyle(J,e[J]):o(e)&&t.dom.classList.add(e)}_savePrevs(){}}vo.POINT_CLASS="rct-point",vo.DATA_FOCUS="focus",vo.DATA_UNFOCUS="unfocus",vo.DATA_UNHOVER="unhover",vo.LEGEND_MARKER="rct-legend-item-marker";class So extends Zt{constructor(t){super(t,vo.POINT_CLASS)}savePrevs(){}}class Vo extends So{constructor(){super(...arguments),this.labelViews=[]}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let Po=class extends Vo{layout(t,e,s,i){this.x=t,this.setPath(Cs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class Ao extends En{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Co extends vo{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&&ro.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class ko extends Co{_prepareSeries(t,e){super._prepareSeries(t,e),this._pointOff=e.options.pointOffset||0}_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,o=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,l=s._yAxisObj,c=l.options.reversed,u=2*h.unitPad(),d=l.prev(i?t:e),p=h.prev(i?e:t),g=i?0:e,m=l.axisMin(),f=l.getPos(d,m),b=s.getBaseValue(l)||0,w=x(l.getPos(d,y(m,b)),f),v=!isNaN(b),S=t=>l.getPos(d,t),V=t=>h.getPos(p,t),P=this._pointOff,A=a&&_(this._labelInfo,{inverted:i,reversed:c,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign});this._getPointPool().forEach(((o,l)=>{const _=o.point;if(o.setVis(!_.isNull)){const c=h.getUnitLen(p,_.xValue)*(1-u);let d=s.getPointWidth(c),m=S(_.yGroup),f=w;if(_.yGroup!=_.yValue){const t=b>_.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=S(r)}const y=(m-f)*r;let x=V(_.xValue)-c/2;if(isNaN(x)){const t=h.getUnitLen(p,_.xValue)*(1-u);x=V(_.xValue)-t/2}let C=g-m;isNaN(n+o.wSave)||(d=o.wSave+(d-o.wSave)*n),x+=s.getPointPos(c)+d/2,isNaN(n+o.xSave)||(x=o.xSave+(x-o.xSave)*n),_.xPos=x+=d*P,_.yPos=C,this._layoutPoint(o,l,x,g-w*(1-r)-f*r,d,y),i&&(C=p-V(_.xValue)+c/2,x=g,_.yPos=C-=s.getPointPos(c)+d/2+d*P,_.xPos=x+=v?S(_.yGroup)*r:S(_.yGroup*r)),A&&(A.labelView=a.get(_,0))&&(A.pointView=o,A.x=x,A.y=C,A.wPoint=d,A.hPoint=y,this._layoutLabel(A,t,e))}}))}}class Lo extends Co{_getHighValue(t){return t.yValue}_prepareSeries(t,e){super._prepareSeries(t,e),this._pointOff=+e.options.pointOffset||0}_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,o=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,l=s._yAxisObj,c=2*h.unitPad(),u=i?t:e,d=i?e:t,p=i?0:e,g=this._pointOff,m=a&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign});this._getPointPool().forEach(((o,_)=>{const f=o.point;if(o.setVis(!f.isNull)){const y=h.getUnitLen(d,f.xValue)*(1-c);let b=s.getPointWidth(y);const x=(l.getPos(u,this._getHighValue(f))-l.getPos(u,this._getLowValue(f)))*r;let w=h.getPos(d,f.xValue)-y/2,v=p-l.getPos(u,this._getHighValue(f))*r;isNaN(n+o.wSave)||(b=o.wSave+(b-o.wSave)*n),w+=s.getPointPos(y)+b/2,isNaN(n+o.xSave)||(w=o.xSave+(w-o.xSave)*n),f.xPos=w+=b*g,f.yPos=v,this._layoutPoint(o,_,w,v,b,x),i&&(v=d-h.getPos(d,f.xValue)+y/2,w=p,f.yPos=v-=s.getPointPos(y)+b/2+b*g,f.xPos=w+=l.getPos(u,this._getHighValue(f))*r),a&&(m.pointView=o,m.hPoint=x,m.x=w,m.y=v,(m.labelView=a.get(f,0))&&(m.hPoint=x,this._layoutLabel(m,t,e)),(m.labelView=a.get(f,1))&&(i?m.x-=x:m.y+=x,m.hPoint=-x,this._layoutLabel(m,t,e)))}}))}}class No extends So{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-s)**2)-t}}class Eo extends vo{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Cs[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 co._drawers[t]||co._drawers.circle}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();"auto"===e&&(e=this._getAutoPos(o.width>=2*i*.9)),t.setVis(null!=e)&&(r-=o.width/2,"inside"===e?t.trans(r,n-o.height/2):e&&t.trans(r,n-i-o.height-s))}}co=Eo,Eo._drawers=Object.assign({circle:t=>Cs.circle(0,0,t)},co._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Mo extends vs{constructor(t,e){super(),this.series=t,this.duration=e}_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 To extends vo{togglePointVisible(t){var e;t.yValue<0||(this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(250))}needFronting(){return!0}isPointLabelVisible(t){return t===this._zombie||super.isPointLabelVisible(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 Mo(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_resizeZombie(){}_createPointLegendMarker(t,e,s){return ks.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 Oo extends Qn{constructor(t){super(t,Oo.CLASS_NAME),this.addToTransform(this._imageView=new Rn(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),Sn(this._imageView.getBBox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Oo.CLASS_NAME="rct-image-annotation";class Bo extends Qn{constructor(t){super(t,Bo.CLASS_NAME),this.addToTransform(this._shapeView=new Zt(t))}_doMeasure(t,e,s,i,r){var n,o,a,h;const l=e.getSize(s,i),_=null===(n=e.chart.xAxis)||void 0===n?void 0:n.getPos(s,e.options.x1),c=null===(o=e.chart.xAxis)||void 0===o?void 0:o.getPos(s,e.options.x2),u=null===(a=e.chart.yAxis)||void 0===a?void 0:a.getPos(i,e.options.y1),d=null===(h=e.chart.yAxis)||void 0===h?void 0:h.getPos(i,e.options.y2);let p=0,g=0;switch(e.getShape()){case Ss.HLINE:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(d)||(p=Number.isNaN(u)?i-d:l.height/2),this._shapeView.setPath(Cs.line(g,p,g+l.width,p));break;case Ss.VLINE:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(d)&&Number.isNaN(u)&&(p=i-d),this._shapeView.setPath(Cs.line(g,p,g,p+l.height));break;case Ss.LINE:Number.isNaN(c)||(g=Number.isNaN(_)?c:_>c?l.width:0),Number.isNaN(d)||(p=Number.isNaN(u)?i-d:u<d?l.height:0);const t=_>c?g-l.width:g+l.width,s=u<d?p-l.height:p+l.height;this._shapeView.setPath(Cs.line(g,p,t,s));break;default:Cs.setShape(this._shapeView,e.getShape(),l.width/2,l.height/2)}return this._deflatePaddings(l),l}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Bo.CLASS_NAME="rct-shape-annotation";class Ro extends Qn{constructor(e){super(e,Ro.CLASS_NAME),this.addToTransform(this._textView=new ee(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new _e}_doMeasure(t,e,s,i,r){const n=e.options,o=e.getSize(s,i),a=this._textView;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),n.textOrientation&&this._textView.setStyle("textOrientation",n.textOrientation),this._deflatePaddings(o),this._richText.setFormat(n.text),this._richText.build(a,s,i,null,e._domain);const h=Sn(this._textView.getBBox());return{width:x(o.width,h.width),height:x(o.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}Ro.CLASS_NAME="rct-text-annotation";class Do extends No{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)),Cs.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((i-e)**2+(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 Fo extends yo{}class zo extends vo{constructor(t,e){super(t,e),this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new Fo(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Zt(t,"rct-line-series-line")),this._markers=new wn(this._pointContainer,Do)}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,s){e instanceof ur&&(this._needBelow=e.options.belowStyle&&e._minY<e.getBaseValue(e._yAxisObj),this._prepareBelow(e,s)),!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(!!this._polar)}_runShowEffect(t){this._polar?t&&ro.grow(this):t&&ro.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(!!this._polar)}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,e){var s,i;const r=this.control;let n=this._lowLine;if(this._needBelow)return n||(n=this._lowLine=new Zt(this.doc,"rct-line-series-line rct-line-series-line-below"),e?this._lineContainer.add(n):this._lineContainer.insertChild(n,this._line),e?(this._upperClip=r.clipCircle(),this._lowerClip=r.clipCircle()):(this._upperClip=r.clipBounds(),this._lowerClip=r.clipBounds()),this._upperClip.setAttr(jt.ASSET_KEY,"1"),this._lowerClip.setAttr(jt.ASSET_KEY,"1")),this._line.setClip(this._upperClip),n.setClip(this._lowerClip),!0;null==n||n.setClip(),this._line.setClip(),null===(s=this._upperClip)||void 0===s||s.remove(),null===(i=this._lowerClip)||void 0===i||i.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new wn(this._lineContainer,Zt)),i.prepare(e.length);s.length<e.length;){const t=new Ut(this.doc);t.setAttr(jt.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._polar,n=this.model._yAxisObj.options.reversed;let o;(o=this._upperClip)&&(this._polar?o.setCircle(r.cx,r.cy,r.rd*this._getGrowRate()):i?n?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):n?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._polar?o.setCircle(r.cx,r.cy,r.rd*(s/e)*this._getGrowRate()):this._inverted?n?o.setBounds(0,-t,e,t):o.setBounds(0,-s,e,t-s):n?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof ur&&this._needBelow,i=s?t.getBaseValue(t._yAxisObj):NaN,r=[t.marker._style,null];if(this._pointContainer.setVis(!t._simpleMode)){const n=this._markersPerPoint(),o=s&&t.options.belowStyle,a=e.length;this._markers.prepare(a*n,((n,h)=>{const l=e[h%a];l.isNull||(n.point=l,r[1]=s&&l.yValue<i?o:null,this._setPointStyle(n,t,l,r)),n.point=l,n.index=h<a?0:1}))}else this._markers.prepare(0)}_layoutMarker(t,e,s,i){const r=this.model,n=t.point,o=t._radius=r.getRadius(n);e&&t.internalSetStyleOrClass(e),Cs.setShape(t,r.getShape(n),o,o),t.setPos(s,i),t.trans(s-=o,i-=o)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,o=this._inverted,a=i.needClip(!1),h=this._getGrowRate(),l=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,u=r.options.maxVisible,g=r.options.minVisible,m=i.pointLabel,f=m.options.align,y=m.getAlignOffset(),b=m.getOffset(),x=m.getPosition(),w=this._labelContainer._textAlign,v=this._labelViews(),S=i._xAxisObj,V=i._yAxisObj,P=this._polar=i.chart._body.getPolar(S),A=!!P,C=V.prev(o?e:s),k=S.prev(P?D:o?s:e),L=o?0:s,N=t.length;t.forEach(((t,m)=>{let E,M,T,O;P?(T=P.start+S.getPos(k,t.xValue),O=V.getPos(P.rd,t.yGroup)*h,E=t.px=P.cx+O*d(T),M=t.py=P.cy+O*p(T)):(E=t.px=S.getPos(k,t.xValue),M=t.py=L-V.getPos(C,t.yGroup),o&&(E=V.getPos(C,t.yGroup),M=s-S.getPos(k,t.xValue))),t.xPos=E,t.yPos=M;const B=this._markers.get(m),R=v&&v.get(t,0);if(B&&B.setVis(!t.isNull&&(A||!a||E>=0&&E<=e&&M>=0&&M<=s))){this._layoutMarker(B,n,E,M),i._maxY==t.yGroup&&r.options.maxVisible,i._minY==t.yGroup&&r.options.minVisible;const e=0==m&&null!=_?_:m==N-1&&null!=c?c:i._maxY==t.yGroup&&null!=u?u:i._minY==t.yGroup&&null!=g?g:l;if(B.setStyle("opacity",e?"1":"0"),R){R.setContrast(null).layout(w);const t=R.getBBox(),e=B._radius;if(R.visible=!0,P){switch(x){case"inside":O-=b;break;case"foot":O-=t.height/2+b;break;default:O+=t.height+b}E=P.cx+O*d(T),M=P.cy+O*p(T)-t.height/2,this.applyAutoRotation(R,T,P.total,S.options.totalAngle)}else switch(x){case"inside":M-=t.height/2+b;break;case"foot":M+=b+(l?e:0);break;default:M-=t.height+b+(l?e:0)}switch(f){case"left":E-=t.width+(l?e:0)+y;break;case"right":E+=(l?e:0)+y;break;default:E-=t.width/2+y}R.trans(E,M)}}else R&&R.setVis(!1)}))}_layoutLines(t){const e=this.model;if(!this._lineContainer.setVis(e._lines.length>0))return;const s=this.width,i=this.height,r=this._inverted,n=e instanceof ur&&this._needBelow;let o=this._buildLines2(e._lines,!!this._polar);if(e._runRanges)this._rangeLines.forEach(((t,n)=>{const a=e._runRanges[n];t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",a.color),t.internalSetStyleOrClass(a.style),Dt.setImportantStyle(t.dom.style,J,"none"),t.setClip(this._rangeClips[n]),this._clipRange(s,i,e._runRangeValue,a,this._rangeClips[n],r)}));else{const t=this._line;t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",e._runColor),t.internalSetStyleOrClass(e._style),Dt.setImportantStyle(t.dom.style,J,"none")}if(n){const n=this._lowLine,a=e._yAxisObj,h=e.getBaseValue(a);t?this.$_resetClips(s,i/2,a.getPos(i/2,h),!0):r?this.$_resetClips(s,i,a.getPos(s,h),!0):this.$_resetClips(s,i,i-a.getPos(i,h),!1),n.setPath(o),n.internalClearStyleAndClass(),n.internalSetStyle("stroke",e._runColor),n.internalSetStyleOrClass(e._style),n.internalSetStyleOrClass(e.options.belowStyle),Dt.setImportantStyle(n.dom.style,J,"none")}}_buildLine2(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve2(t,s,i):r instanceof ur&&"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 Lr;return"spline"===i?this._drawCurves(t,r):s instanceof ur&&"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 ur&&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 Lr;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine2(n,e,!1,i),this._buildLine2(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class $o extends zo{constructor(t){super(t,$o.CLASS),this._flagView=new Dn(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,s=e.flag,i=this._flagView,r=this.parent.parent;let n;if(i.setVis(s.visible&&!!(n=s.label()))){i.setText(n),i.setModel(this.doc,s,s.options.icon?s.getUrl(s.options.icon):null,null),i.setContrast(null).layout("left");const o=s.options.offset,a=i.getBBox();let h,l;h=this._markers.last.x,l=this._markers.last.y;let _;_=("step"==e.options.lineType&&"forward"==e.options.stepDir)!=this._inverted?l>this._markers.get(this._markers.count-2).y?"bottom":"top":h>this._markers.get(this._markers.count-2).x?"right":"left";const c={top:["top","right","left"],right:["right","top","bottom"],bottom:["bottom","right","left"],left:["left","top","bottom"]}[_],{width:u,height:d}=a,p=u/2,g=d/2,{width:m,height:f}=r,y=m/2,b=f/2,x=l>d+o,w=f>l+d+o,v=h>u+o,S=m>h+u+o,V={top:x,right:S,bottom:w,left:v};_=null!==(t=c.find((t=>V[t])))&&void 0!==t?t:_;const P=h>p&&m-h>p?h-p:h>y?m-u:0,A=l>g&&f>l+g?l-g:l>b?f-d:0;switch(_){case"top":h=P,l=x?l-d-o:0;break;case"bottom":h=P,l=w?l+o:f-d;break;case"left":h=v?h-u-o:0,l=A;break;case"right":h=S?h+o:m-u,l=A}i.trans(h,l)}}}$o.CLASS="rct-line-series";class Io extends zo{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new Fo(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Zt(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,e){let s=this._lowArea;if(super._prepareBelow(t,e))return s||this._areaContainer.add(s=this._lowArea=new Zt(this.doc,"rct-area-series-area")),this._area.setClip(this._upperClip),s.setClip(this._lowerClip),!0;null==s||s.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 wn(this._areaContainer,Zt,"rct-area-series-area")),s.prepare(e.length);i.length<e.length;){const t=new Ut(this.doc);t.setAttr(jt.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,o=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this._layoutPolar(this._area,this._visPoints)}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar||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(),o=this._needBelow?this._lowArea:void 0,a=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,s)=>{const o=e._runRanges[s];t.setBoolData("simple",this._simpleMode),t.setPath(a),t.internalClearStyleAndClass(),t.setFill(o.color),this._setFill(t,o.style),o.areaStyle&&t.internalSetStyleOrClass(o.areaStyle),t.setClip(this._rangeAreaClips[s]),this._clipRange(i,r,e._runRangeValue,o,this._rangeAreaClips[s],n)})):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(J,e._runColor),this._setFill(t,s.style),e.options.areaStyle&&t.internalSetStyleOrClass(s.areaStyle)),o&&(o.setBoolData("simple",this._simpleMode),o.setPath(a),o.internalClearStyleAndClass(),e._runColor&&o.internalSetStyle(J,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}_layoutPolar(t,e){const s=this.model,i=s._group,r=s._yAxisObj,n=r instanceof $i?s.getBaseValue(r):NaN;this.height;const o=this._polar,a=this._lowArea,h=new Lr;if(!i||"stack"!==i.options.layout&&"fill"!==i.options.layout){h.move(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);this._needBelow&&!isNaN(n)&&h.circle(o.cx,o.cy,r.getPos(o.rd,n)*this._getGrowRate());const s=h.end();t.setPath(s),null==a||a.setPath(s)}else{h.move(e[0].xPos,e[0].yLow),h.line(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);h.line(e[e.length-1].xPos,e[e.length-1].yLow);for(let t=e.length-1;t>=0;t--)h.line(e[t].xPos,e[t].yLow);t.setPath(h.end())}t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style),a&&(a.setBoolData("polar",!0),a.clearStyleAndClass(),a.setFill(s._runColor),a.addStyleOrClass(s._style),a.internalSetStyleOrClass(s.options.belowStyle),Dt.setImportantStyle(a.dom.style,"stroke","none"))}}class Go extends qn{constructor(t){super(t,vo.POINT_CLASS)}savePrevs(){}}class Ho extends ko{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 wn(this._pointContainer,Go)),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,o=t._yAxisObj,a=r.getPolar(n),h=this._pointOff-n.polarOff(),l=n.getTotalAngle(),_=a.cx,c=a.cy;let u,g,m,f;i&&(u=this._labelInfo,g=t.getLabelPos(s),m=t.getLabelOff(s.getOffset()),f=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const y=s.point,b=o.getPos(a.rd,y.yValue)*e;let x=o.getPos(a.rd,y.yGroup)*e;const w=n.getUnitLen(l,y.xValue),v=t.getPointWidth(w);let S=a.start+n.getPos(l,y.xValue);if(S+=v*h,S+=t.getPointPos(w),s.setSector({cx:_,cy:c,rx:x,ry:x,innerRadius:(x-b)/x,start:S-v/2,angle:v,clockwise:!0}),S=s.start+s.angle/2,y.xPos=_+s.rx*d(S),y.yPos=c+s.ry*p(S),i&&(u.labelView=i.get(y,0))){u.labelView.layout(f);const t=u.labelView.getBBox();let e;"outside"===g?(x=c+(s.ry+t.height+m)*p(S),e=_+(s.rx+t.width+m)*d(S)):"head"===g?(x=c+(s.ry-t.height/2-m)*p(S)-t.height/2,e=_+(s.rx-t.height/2-m)*d(S)):(x=c+.7*s.ry*p(S)-t.height/2,e=_+.7*s.rx*d(S)),"outside"!==g&&u.labelView.setContrast(s.dom),this.applyAutoRotation(u.labelView,S,a.total,n.options.totalAngle),u.labelView.trans(e-t.width/2,x)}}))}}class jo extends Ao{constructor(t){super(t,vo.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,o=0+e-e*(s.highValue-s.minValue)/i,a=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,o),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,o,t,a),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 ks(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 Yo extends No{}let Wo=class extends Ao{constructor(t){super(t,vo.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(f(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(y(s.openValue,s.closeValue)-s.lowValue)/i),o=f(n,r),a=y(1,b(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,o,t,a),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 ks(t))}};class Xo extends So{layout(t,e,s){const i=new Lr;i.circle(t,e,s),this.setPath(i.end())}}let Uo=class extends Ao{constructor(t){super(t,vo.POINT_CLASS),this.add(this._line=new nr(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Zt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Zt(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.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(o);_&&r.internalSetStyleOrClass(_),_=e.getMarkerStyle(o),_&&n.internalSetStyleOrClass(_),this.x=this.tx+l,this._line.setVLine(l,0,i),Cs.setShape(r,o.shape,a,a),Cs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};let Zo=class extends En{constructor(t){super(t,vo.POINT_CLASS),this._segments=new wn(this,Zt),this._decimal=0,this.add(this._back=new ks(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(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Cs.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Cs.rectangle(e,s-t[2*a],i,n(-1,t[2*a]-t[2*a+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};let qo=class extends Ao{constructor(t){super(t,vo.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 ks(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 Ko extends So{}let Qo=class extends Vo{layout(t,e){this.setPath(Cs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Jo extends En{constructor(t){super(t,vo.POINT_CLASS),this.add(this._line=new nr(t,"rct-lollipop-point-bar")),this.add(this._marker=new Zt(t,"rct-lollipop-point-marker"))}layout(t){const e=this.point.radius;this._line.setVLine(0,0,t),Cs.setShape(this._marker,this.point.shape,e,e),this._marker.trans(-e,-e)}savePrevs(){this.xSave=this.tx}}class ta extends Ao{constructor(t){super(t,vo.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(f(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(y(s.openValue,s.closeValue)-s.lowValue)/i,a=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(o,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",a)}_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 ks(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class ea extends qn{constructor(t){super(t,vo.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1),this.polygon=Cs.sectorPolygon(s.cx,s.cy,s.rx,s.ry,s.innerRadius,s.start,s.start+s.angle,s.clockwise)}}class sa extends No{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 o=t._radius;e?this._radius=o=t._radius*(1+(isNaN(s)?1:s)*n):o=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(o)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._radius}}function ia(t,e){return new(Kn[e._type()])(t)}function ra(t,e){return new(bo[e._viewType()])(t)}vo.register([gr,Io],[yr,class extends zo{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Fo(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Zt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Zt(t,"rct-areanrange-series-line")),Dt.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,o=r.visible,a=this._inverted,h=i._xAxisObj,l=i._yAxisObj,_=a?e:s,c=a?0:s,u=this._labelViews(),g=this._labelContainer._textAlign,m=this._polar=i.chart._body.getPolar(h),f=i.pointLabel,y=f.options.position,b=f.options.align,x=f.getAlignOffset(),w=f.getOffset();this._getGrowRate();for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=c-l.getPos(_,s.lowValue)}const v=this._markers;for(let c=0,f=t.length;c<f;c++){const S=t[c],V=v.get(f+c),P=u&&u.get(S,1);let A,C,k;if(a?(A=S.px2=l.getPos(_,S.lowValue),C=S.py2=v.get(c).ty+i.getRadius(S)):(A=S.px2=S.xPos,C=S.py2=S.yLow),V&&V.setVis(!S.isNull&&A>=0&&A<=e&&C>=0&&C<=s)){if(this._layoutMarker(V,n,A,C),V.setStyle("opacity",o||0==c&&!0===r.options.firstVisible||c===f-1&&!0===r.options.lastVisible?"1":"0"),P){P.setContrast(null).layout(g);const t=P.getBBox(),e=V._radius;if(P.visible=!0,m){switch(y){case"inside":C-=w;break;case"foot":C-=t.height/2+w;break;default:C+=t.height+w}A=m.cx+C*d(k),C=m.cy+C*p(k)-t.height/2,this.applyAutoRotation(P,k,m.total,h.options.totalAngle)}else switch(y){case"inside":C-=t.height/2+w;break;case"foot":C+=w+(o?e:0);break;default:C-=t.height+w+(o?e:0)}switch(b){case"left":A-=t.width+(o?e:0)+x;break;case"right":A+=(o?e:0)+x;break;default:A-=t.width/2+x}P.trans(A,C)}}else P&&P.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,s=this.model;if(!this._areaContainer.setVis(s._lines.length>0))return;const i=this._buildAreas(s._lines,s.getLineType());e.setPath(i),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),s._runColor&&e.setFill(s._runColor),this._setFill(e,s._style),s.options.areaStyle&&e.internalSetStyleOrClass(s.options.areaStyle)}}],[Ji,class extends Ho{constructor(t){super(t,"rct-bar-series")}_createBarPool(t){return new wn(t,Po)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.options;this._rdTop=+s.topRadius||0,this._rdBottom=+s.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom)}}],[qi,class extends Lo{constructor(t){super(t,"rct-barrange-series"),this._bars=new wn(this._pointContainer,Po)}_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)}}],[vr,class extends Io{constructor(t){super(t,"rct-bellcurve-series")}}],[Vr,class extends Lo{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new wn(this._pointContainer,jo)}_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)}}],[Ar,class extends Eo{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new wn(t,Yo)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ro.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),o=this._getGrowRate(),a=+i.rotation||0,h=s.pointLabel,l=h.options.position,_=h.getOffset(),c=this._labelContainer._textAlign,u=this._labelViews(),g=s._xAxisObj,m=s._yAxisObj,f=this._polar=s.chart._body.getPolar(g),y=m.prev(r?t:e),b=g.prev(f?D:r?e:t),x=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:w,max:v}=s.getPixelMinMax(x),S=r?0:e,V=this._getDrawer(i.shape);let P;this._markers.forEach(((i,h)=>{const x=i.point,A=u&&(P=u.get(x,0));if(i.setVis(!x.isNull&&!isNaN(x.zValue))){const h=(i._radius=s.getRadius(x.zValue,w,v))*o;let u,C;if(f){const t=f.start+g.getPos(b,x.xValue),e=m.getPos(f.rd,x.yValue);u=f.cx+e*d(t),C=f.cy+e*p(t)}else u=g.getPos(b,x.xValue),C=S-m.getPos(y,x.yValue),r&&(u=m.getPos(y,x.yValue),C=e-g.getPos(b,x.xValue));x.xPos=u,x.yPos=C,i.setVis(!n||u>=0&&u<=t&&C>=0&&C<=e)?(i.setPath(V(h)).trans(u,C).rotate(a),A&&(P.setContrast(i.dom).layout(c),this._layoutLabelView(P,l,_,h,u,C))):A&&A.setVis(!1)}else A&&A.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=s.reduce(((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i));return{pv:i,dist:i.distance(i._radius,t,e)}}}canHover(t,e,s){return t<=e._radius+s}}],[Er,class extends Lo{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new wn(this._pointContainer,Wo)}_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)}}],[Tr,class extends Ho{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new wn(t,Xo)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}],[Dr,class extends Lo{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new wn(this._pointContainer,Uo)}_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)}}],[zr,class extends ko{constructor(t){super(t,"rct-equalizer-series"),this._bars=new wn(this._pointContainer,Zo)}_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 o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(s=t.xSave+(s-t.xSave)*o),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,o=this._pts=[];let a,h,l=0;const _=t._yAxisObj,c=_.axisMin(),u=t.getBaseValue(_)||0,d=_.getPos(e,u);for(h=s.maxCount>0?s.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),a=(e-n*(h-1))/h;o.length<2*h;)o.push(l,l+a),l+=a+n;o[o.length-1]=e;const p=o.length/2;this._bars.forEach((t=>{const n=t.point;if(t.setVis(!n.isNull)){const h=n.yValue>=u?(e-d)/e*(n.yValue-u)/(i-u):d/e*(u-n.yValue)/(u-c);let l=-1,_=0;for(let t=0;t<p-1;t++)if(h>=o[2*t]/e&&h<o[2*(t+1)]/e){l=t+1,_=!r&&h<o[2*t+1]/e?h*e-o[2*t]:a;break}l<0&&(l=p,_=a),0===h&&(l=0),t.prepareSegments(p,l,_,s.backStyle)}}))}}],[$r,class extends Lo{constructor(t){super(t,"rct-errorbar-series"),this._bars=new wn(this._pointContainer,qo)}_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)}}],[jr,class extends To{constructor(t){super(t,"rct-funnel-series"),this._segments=new wn(this._pointContainer,Ko),this.add(this._lineContainer=new fo(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&&ro.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_resizeZombie(){super._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:t._isDeleted()?t._vr:1)})),e>1||e>0&&!this._zombie)if(1==e&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===e&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let r=0;for(;r<e-1;r++){const e=t[r],n=H(e.yValue*(e===this._zombie?this._zombieRate:e._isDeleted()?e._vr: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=H(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){const s=function(t){return u?y+(V-y)*(w-t)/(w-P):y+(V-y)*(t-x)/(P-x)},i=this.model,r=this._labelViews(),n=i.pointLabel,o="inside"===i.getLabelPos(n),a=n.getOffset(),h=n.getDistance(),l=n.getAlign(),_=null==r?void 0:r.textAlign(),c=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,u=i.options.reversed,d=n.options.opposite,p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),m=new Lr,f=i.getCenter(t,e),y=f.x-p.width/2,x=f.y-p.height/2,w=x+p.height,v=y+p.width/2,S=p.height-g.height,V=y+(p.width-g.width)/2,P=u?w-S:x+S,A=[],C=new Lr,k=(null==r?void 0:r.getWidth(0))||0;let L,N;this._lineContainer.setVis(r&&!o)&&this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach((i=>{const f=i.point;if(i.setVis(!f.isNull)){const y=f.yPos*p.height,E=(f.yPos+f.height)*p.height,M=u?w-y:x+y,T=u?w-E:x+E,O=E<S;let B,R,D,F;if(N=null==c?void 0:c.get(f),y>=S?(B=V,R=B+g.width,m.move(B,M).lines(R,M,R,T,B,T),i.ny=i.nx1=NaN):O?(B=s(M),R=B+2*(v-B),D=s(T),F=D+2*(v-D),m.move(B,M).lines(R,M,F,T,D,T),i.ny=NaN,i.nx1=D-B,i.nx2=F-B):(B=s(M),R=B+2*(v-B),D=V,F=D+g.width,m.move(B,M).lines(R,M,F,P,F,T,D,T,D,P),i.nx1=D-B,i.nx2=F-B,i.ny=b(P-M),i.nx3=D,i.nx4=F),i.setPath(m.close(!0)),f.xPos=v,f.yPos=M+(T-M)/2,r&&(L=r.get(f,0))&&L.visible){if(o){null==N||N.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),s=O?(R-B+(F-D))/2:g.width;switch(!t&&L.layout(_||"center"),n.options.align){case"near":L.trans(f.xPos-s/2+a,f.yPos-e.height/2);break;case"far":L.trans(f.xPos+s/2-e.width-a,f.yPos-e.height/2);break;default:L.trans(f.xPos-e.width/2,f.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,f,i,L,_,d,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,f,i,L,_,d,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!1,f,i,L,_,d,N,C,v,a,h);L.setContrast(o&&i.dom),A.push(L),L.setPosY(L.ty)}else null==N||N.setVis(!1)}}));const E=n.options.convergable,M=n.options.dedupeMode,T=n.options.overflow;r&&(o||0===l?"preserveOrder"!==M&&"largestFirst"!==M||r.dedupe(A,c,M):(null==r?void 0:r.arrangeVertical(A,c,e,E,M,T))&&this._segments.forEach((s=>{const i=s.point;i.isNull||(L=r.get(i,0),N=null==c?void 0:c.get(i),(null==L?void 0:L.visible)&&(-1===l?this.$_layoutLabelAligned(!0,i,s,L,_,d,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,_,d,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!0,i,s,L,_,d,N,C,v,a,h)))})))}$_calcX(t,e,s,i){const r=e.getBBox(),n=i?-1:1,o=r.height;let a=s+n*r.width/2;return isNaN(e.ny)?isNaN(e.nx1)||(a-=0===o?0:n*(e.nx1*o/2)/o):e.ny>r.height/2?a-=n*(e.nx1*o/2)/e.ny:a=i?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l,_,c){const u=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!u&&i.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,s,l,n);let m=l;if(n?m-=h.width/2:m+=h.width/2,o){const e=t?d.y+d.height/2-p:0;n?o.setLine(a.reset(0,0).line(m-g-c,e).end()):o.setLine(a.reset(0,0).line(m+c-g,e).end()),o.trans(g,p)}t||(n?m-=_+c+d.width:m+=c+_,i.trans(m,p-d.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,u,d){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),m=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left")),!t&&!p&&i.layout(r||(n?"right":"left"));let f,y=this.$_calcX(e,s,h,n);if(f=n?_+l+c:u-_-c-l,o){const e=t?g.y+g.height/2-m:0;n?o.setLine(a.reset(0,0).line(f-y-_,e).end()):o.setLine(a.reset(0,0).line(f+_-y,e).end()),o.trans(y,m)}t||(n?f-=l+_+g.width:f+=_+l,i.trans(f,m-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,_){const c=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),d=e.yPos;!t&&!c&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?u.y+u.height/2-d:0;n?o.setLine(a.reset(0,0).line(-_,e).end()):o.setLine(a.reset(0,0).line(_,e).end()),o.trans(p,d)}t||(n?p-=_+l+u.width:p+=_+l,i.trans(p,d-u.height/2))}}],[Xr,class extends Co{constructor(t){super(t,"rct-histogram-series"),this._bars=new wn(this._pointContainer,Qo)}_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,o=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,l=i?t:e,c=i?e:t,u=h.getPos(l,s.getBaseValue(h)),d=i?0:e,p=o&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign});this._getPointPool().forEach(((s,n)=>{const _=s.point,g=a.getPos(c,_.min),m=a.getPos(c,_.max),f=h.getPos(l,_.yValue),y=m-g+(m>g?-1:1),b=f-u;let x=g+(m-g)/2,w=d;_.xPos=x,_.yPos=w-=f,this._layoutPoint(s,n,x,w+b,y,b*r),p&&(p.labelView=o.get(_,0))&&(i&&(w=c-x,x=d,_.yPos=w,_.xPos=x+=h.getPos(l,_.yGroup)),p.pointView=s,p.x=x,p.y=w,p.wPoint=y,p.hPoint=b,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(((o,a)=>{const h=o.point,l=s.getPos(t,h.min),_=s.getPos(t,h.max),c=l+(_-l)/2,u=i.getPos(e,o.point.yValue)*n,d=y(1,_-l-1);h.xPos=c,h.yPos=r-u,o.wPoint=d,o.hPoint=u,o.layout(c,r)}))}}],[ur,$o],[qr,class extends ko{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 wn(this._pointContainer,Jo)),this._bars.prepare(s.length,((t,n)=>{const o=t.point=s[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=i.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)}))}}],[Qr,class extends Lo{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new wn(this._pointContainer,ta)}_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)}))}}],[tn,class extends zo{constructor(t){super(t,"rct-pareto-series")}}],[on,class extends To{constructor(e){super(e,"rct-pie-series"),this._sectors=new wn(this._pointContainer,ea,null,.5),this._pb=new Lr,this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new Xn(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Dn(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._labelContainer.add(this._lineContainer=new fo(e))}_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,s.options.icon?s.getUrl(s.options.icon):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,o=r-n;this._rd=n+(s._groupPos+s._groupSize)*o,this._rdInner=(n+s._groupPos*o)/this._rd}_runShowEffect(t){t&&ro.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 ea&&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(){super._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.yValue*(t===this._zombie?this._zombieRate:t._isDeleted()?t._vr:1))).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=>{1===e&&t._isDeleted()||1===e&&t._vr<1?(t.startAngle=n,t.angle=r*s*t._vr,t.yRate=100):t.isNull||(t.yRate=H(t.yValue*(t===this._zombie?this._zombieRate:t._isDeleted()?t._vr:1)/i)||0,t.startAngle=n,n+=t.angle=s*t.yRate*r,t.yRate*=100)}));else if(1==e){const e=t[0];e.startAngle=n,e.angle=s*this._zombieRate*r,e.yRate=100}}$_layoutSectors(t,e,s){const i=this.model,r=i.options.clockwise,n=this._getGrowRate(),o=i.getCenter(e,s),a=this._cx=o.x,h=this._cy=o.y,l=this._rd,_=this._rdInner,c=i.pointLabel,u=c.connector.options.curved,g=this._labelViews(),m="inside"===i.getLabelPos(c),f=x(c.options.radius,.7),y=this._pb,w=c.getDistance(m,l,_),v=c.getAlign();let S=null==g?void 0:g.textAlign();const V=this._lineContainer.setVis(c.connector.visible)?this._lineContainer:null,P=this._slicedOff=i.getSliceOffset(l)*n,A=[],C=[],k=[],L=(null==g?void 0:g.getWidth(0))||0;let N,E;if(this._wPlot=e,this._hPlot=s,!g||S||v||(S="center"),this._textView.visible){const t=this._textView._icon,e=this._textView._text.getBBox();let s=a,i=h;if(t){const r=x(this.model.innerText.options.iconGap,0),n=e.width,o=e.height,a=t.getBBox(),h=a.width,l=a.height;switch(this.model.innerText.getIconPos()){case"right":t.trans(n/2+r,(o-l)/2),s-=(h+r)/2;break;case"top":t.trans(h/-2,-(l+r)),i+=l+r/2;break;case"bottom":t.trans(h/-2,o+r),i-=(l+r)/2;break;default:t.trans(-(n/2+h+r),(o-l)/2),s+=(h+r)/2}}this._textView.trans(s,i-e.height/2)}this._circle.setVis(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this.$_calcAngles(t),this._sectors.forEach((t=>{const o=t.point;if(E=null==V?void 0:V.get(o),o.isNull)t.setVis(!1),g&&(N=g.get(o,0))&&N.setVis(!1),null==E||E.setVis(!1);else{const c=o.startAngle+o.angle/2,x=o.startAngle;let V=0,M=0;if(o.sliced&&n>=1&&!t.isDomAnimating()){const t=x+o.angle/2;V+=d(t)*P,M+=p(t)*P}if(t.trans(V,M).setVis(!0),o.xPos=a+d(c)*(P+l*f),o.yPos=h+p(c)*(P+l*f),t.setPieSector(g,null,{cx:a,cy:h,rx:l,ry:l,innerRadius:_,start:x,angle:b(o.angle),clockwise:r}),g&&(N=g.get(o,0))){const r=i.getLabelOff2(o);let n;m?(null==E||E.setVis(!1),this.$_layoutLabelInside(o,N,S,r,w,o.sliced?P:0)):(n=-1===v?this.$_layoutLabelAligned(!1,o,N,S,E,y,u,r,w,o.sliced?P:0):1==v?this.$_layoutLabelEnded(!1,o,N,S,E,y,u,r,w,o.sliced?P:0,L,e,s):this.$_layoutLabelOutside(!1,o,N,S,E,y,u,r,w,o.sliced?P:0),n?A.push(N):C.push(N)),N.setContrast(m&&t.dom).setVis(!0),k.push(N)}else null==E||E.setVis(!1)}}));const M=c.options.convergable,T=c.options.dedupeMode,O=c.options.overflow;g&&(m||0===v?"preserveOrder"!==T&&"largestFirst"!==T||g.dedupe(k,V,T):g.arrangeVertical(A,V,s,M,T,O)+g.arrangeVertical(C,V,s,M,T,O)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=i.getLabelOff2(r);N=g.get(r,0),E=null==V?void 0:V.get(r),(null==N?void 0:N.visible)&&(-1===v?this.$_layoutLabelAligned(!0,r,N,S,E,y,u,t,w,r.sliced?P:0):1==v?this.$_layoutLabelEnded(!0,r,N,S,E,y,u,t,w,r.sliced?P:0,L,e,s):this.$_layoutLabelOutside(!0,r,N,S,E,y,u,t,w,r.sliced?P:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,u=this._cx,g=this._cy,m=this._rd,f=m+l,y=u+d(c)*f,b=g+p(c)*f,x=y<u;!t&&!_&&s.layout(i||(x?"right":"left"));const w=s.getBBox(),v=b-w.height/2;let S,V,P,A=g+p(c)*m;if(x?(S=u+d(Math.PI)*m-h,V=S-w.width-a,P=u+d(Math.PI)*f-h,w.width):(S=u+d(0)*m+h,V=S+a,P=u+d(0)*f+h),r&&r.setVis(f>0)){const e=t?s.ty-v:0;o?r.setLine(n.reset(0,e).quad(.7*(y-S),e,y-S,0).end()):r.setLine(n.reset(0,e).line(y-S,0).end()),r.setPos(S,A),!_&&r.trans(S,b)}return t||(s.setPos(V,A-w.height/2),!_&&s.trans(V,A-w.height/2)),x}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,u){const g=s.isDomAnimating(),m=e.startAngle+e.angle/2,f=this._cx,y=this._cy,b=this._rd,x=b+l;let w=f+d(m)*x,v=y+p(m)*x;const S=w<f;!t&&!g&&s.layout(i||(S?"right":"left"));const V=s.getBBox(),P=v-V.height/2;let A,C,k,L=y+p(m)*b;if(S?(A=h+_+a,k=h+_-V.width,C=A):(A=c-h-_-a,k=c-h-_,C=A),r&&r.setVis(x>0)){const e=t?s.ty-P:0;o?r.setLine(n.reset(0,e).quad(0,e,w-C,0).end()):r.setLine(n.reset(0,e).line(w-C,0).end()),r.setPos(A,L),!g&&r.trans(C,v)}return t||(s.setPos(k,L-V.height/2),!g&&s.trans(k,L-V.height/2)),S}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating();!t&&!_&&s.layout(i);const c=s.getBBox(),u=e.startAngle+e.angle/2;let g=this._cx,m=this._cy,f=this._rd+.5*h,y=d(u)*l,b=p(u)*l,x=g+d(u)*this._rd,w=m+p(u)*this._rd,v=g+d(u)*f,S=m+p(u)*f;const V=v<g;let P,A;return V?(P=v-.2*h,A=P):(P=v+.2*h,A=P),r&&r.setVis(f>0)&&(t&&s.ty,o?r.setLine(n.reset(0,0).quad(v-x,S-w,P-x,S-w).end()):r.setLine(n.reset(0,0).lines(v-x,S-w,P-x,S-w).end()),r.setPos(x,w),!_&&r.trans(x+y,w+b)),t||(V?A-=c.width+a:A+=a,S-=c.height/2,s.setPos(A,S),!_&&s.trans(A+y,S+b)),V}$_layoutLabelInside(t,e,s,i,r,n){const o=e.isDomAnimating(),a=this.model,h=a.pointLabel,l=h.options.autoRotation,_=h.options.rotationMode,c=a.options.clockwise;!o&&e.layout(s||"center");const u=e.getBBox(),d=this._rd*this._rdInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=a.options.totalAngle||360;if("angle"===_){let i=p/t*s+90,r=(i+a.options.startAngle)%360;r+=c?0:360,i+=r>180?90:-90,e.setRotation(u.width/2,u.height/2,i)}else this.applyAutoRotation(e,p,t,s)}const g=h.options.align===Es?.3:h.options.align===Ns?.5:.7,m=d>0?d+(this._rd-d)/2:l?"angle"===_?this._rd*g+i:.8*this._rd+i:.7*this._rd+i,f=Math.cos(p),y=Math.sin(p);let b=this._cx+f*m,x=this._cy+y*m;e.move(b-u.width/2,x-u.height/2),b=this._cx+f*(n+m),x=this._cy+y*(n+m),e.trans(b-u.width/2,x-u.height/2)}$_slice(t,e,s){const i=this.model,r=this._labelViews(),n=i.pointLabel.getAlign(),o=this._slicedOff,a=i.options.autoSlice?i.options.sliceDuration:0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(d(l)*o,p(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,u=_.connector.options.curved,g="inside"===i.getLabelPos(_),m=r.get(h,0),f=i.pointLabel.getDistance(g,this._rd,this._rdInner);if(m){const t=!g&&c.get(h);if(s){let e=r.textAlign();!r||e||n||(e="center"),g?this.$_layoutLabelInside(h,m,e,_.getOffset(),f,o):0===n&&this.$_layoutLabelOutside(!1,h,m,e,t,this._pb,u,_.getOffset(),f,o)}if(e){let e=m.tx,s=m.ty,i=t.tx,r=t.ty;(g||0===n)&&(m.trans(m.x,m.y).transEx2(e,s,a),t&&t.trans(t.x,t.y).transEx(i,r,a))}else(g||0===n)&&(m.trans(m.tx,m.ty).transEx2(m.x,m.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}],[ln,class extends Eo{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new wn(t,sa)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&(this._polar,ro.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),o=s._xAxisObj,a=s._yAxisObj,h=this._polar=s.chart._body.getPolar(o),l=this._getGrowRate(),_=this._radius=Math.max(0,+s.options.radius||0)*l,c=+i.rotation||0,u=+i.jitterX||0,g=+i.jitterY||0,m=s.pointLabel,f=m.options.position,y=m.getOffset(),b=this._labelViews(),x=a.prev(r?t:e),w=o.prev(h?D:r?e:t),v=r?0:e;let S;this._markers.forEach(((i,m)=>{const V=i.point,P=b&&(S=b.get(V,0));if(i.setVis(!V.isNull)){const m=this._getDrawer(s.getShape(V)),b=C.jitter(V.xValue,u),A=C.jitter(V.yGroup,g);let k,L;if(h){const t=h.start+o.getPos(w,b),e=a.getPos(h.rd,A)*l;k=h.cx+e*d(t),L=h.cy+e*p(t)}else k=o.getPos(w,b),L=v-a.getPos(x,A),r&&(k=a.getPos(x,A),L=e-o.getPos(w,b));V.xPos=k,V.yPos=L,i.setVis(!!h||!n||k>=0&&k<=t&&L>=0&&L<=e)?(i.setPath(m(i._radius||_)),i.trans(k,L).rotate(c),P&&this._layoutLabelView(S,f,y,_,k,L)):P&&P.setVis(!1)}else P&&P.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=this.model.options.radius,r=s.reduce(((s,r)=>s.distance(i,t,e)<r.distance(i,t,e)?s:r));return{pv:r,dist:r.distance(i,t,e)}}}canHover(t,e,s){return t<=this.model.options.radius+s}}],[un,class extends Lo{constructor(t){super(t,"rct-waterfall-series"),this._bars=new wn(this._pointContainer,Po),this.add(this._lineContainer=new Yt(t,"rct-waterfall-series-lines")),this._lines=new wn(this._lineContainer,nr)}_getPointPool(){return this._bars}_getLowValue(t){return Math.min(t.from,t.to)}_getHighValue(t){return Math.max(t.from,t.to)}_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 o=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),a=o.y;let h;h=o._isSum||o._isMid?a<0?i:i-n:a<0?i-n:i,t.setHLine(h,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)}_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._isSum&&e.options.sumColor?this._setPointColor(t,e.options.sumColor):s.y<0&&e.options.negativeColor?this._setPointColor(t,e.options.negativeColor):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)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r);const n=r._isMid?"rct-waterfall-point-mid":r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"";n&&t.setStyleOrClass(n)})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}]),Qn.register([Mi,Ro],[Ni,Oo],[Ei,Bo]);class na extends Mn{constructor(t){super(t,"rct-axis-grid"),this._lines=new wn(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),o=this._lines.prepare(n.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),a=o.count-1;let h;o.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?o.forEach(((e,i)=>{h=0===i?l:i===a?_:t.visible,e.setVis(h)&&e.setVLine(s.prev(n[i]),0,r)})):o.forEach(((e,o)=>{n[o],h=0===o?l:o===a?_:t.visible,e.setVis(h)&&e.setHLine(r-s.prev(n[o]),0,i)}))}}class oa extends jt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Zt(t)),this._mask.setStroke("none"),this.add(this._upLine=new Zt(t)),this._upLine.setFill("none"),this.add(this._downLine=new Zt(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 Lr;if(s){let t=0,s=0,n=i/2,o=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(o,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(o,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,o=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,o);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,o);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,o);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,o);this._mask.setPath(r.end())}}}class aa extends jt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new Dn(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,this.model.label,null),this._labelView.layout(this.textAlign()||"center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}}class ha extends aa{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Zn: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,o=this._line,a=this._labelView.setVis(r.visible)&&this._labelView,h=a.getBBox(),l=x(n.offsetX,0),_=x(n.offsetY,0);let c,u;if(this.vertical()){const r=s.axis.getPos(t,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setVLine(r,0,e),a)){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":u="inside"===n.position?e-h.height-_:e+_;break;case"middle":u=(e-h.height)/2-_;break;default:u="inside"===n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setHLine(r,0,t),a)){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":u=r+_;break;case"middle":u=r-h.height/2-_;break;default:u=r-h.height-_}}}a.visible&&a.trans(c,u)}_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,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,i.options.value);r.setArc(s.cx,s.cy,a,o,i.axis.getTotalAngle(),!1),r.setStyle(J,"none"),n&&n.trans(s.cx+a*d(s.start),s.cy+a*p(s.start))}}class la extends aa{constructor(t,e){super(t),this.insertFirst(this._box=new(e?qn:Ls)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e);const s=e.options,i=f(s.startValue,s.endValue),r=y(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,[o,a]=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,o),u=s.axis.getPos(t,a);if(!isNaN(i)&&!isNaN(u)&&h.setVis(n.setVis(u!==i))){let s,o;switch(r.align){case"center":s=i+(u-i-l.width)/2+_;break;case"right":s=u-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":o="inside"===r.position?e-l.height-c:e+c;break;case"middle":o=(e-l.height)/2-c;break;default:o="inside"===r.position?c:-1*(l.height+c)}n.setBox(i,0,u,e),h&&h.trans(y(0,f(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),u=e-s.axis.getPos(e,a);if(!isNaN(i)&&!isNaN(u)&&h.setVis(n.setVis(i!==u))){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=u+(i-u-l.height)/2-c;break;default:s=u+c}h&&h.trans(e,s),n.setBox(0,u,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=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:a/h,start:o,angle:D,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*d(s.start),s.cy+t*p(s.start))}}}class _a extends Yt{constructor(){super(...arguments),this._views=new wn(this,Zt)}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(Cs.rectangle(i,0,r-i,e))}else{const i=n.axis.getPos(e,n.from),r=n.axis.getPos(e,n.to);s.setPath(Cs.rectangle(0,e-i,t,i-r))}s.setFill(n.color)}))}}class ca extends Yt{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof la?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof Ge?i=this._rangePool.pop()||new la(t,s):e instanceof Ie&&(i=this._linePool.pop()||new ha(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class ua extends Zt{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,o=n._isHorz,a=new Lr;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(o?i-e:s):n.xValueAt(o?e:r-s)),n instanceof Xs&&(l=c(l)),!isNaN(l)){const t=n.getPos(h,l);let e=n.getUnitLen(h,l);o?a.rect(t-e/2,0,e,r):a.rect(0,r-t-e/2,i,e)}}else(t||this.model.options.showAlways)&&(o?a.vline(e,0,r):a.hline(s,0,i));this.setPath(a.end())}}class da extends Wn{constructor(t){super(t,"Reset Zoom",da.CLASS_NAME),this.setVis(!1)}}da.CLASS_NAME="rct-reset-zoom";class pa extends Yt{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new ks(t,"rct-empty-view-back")),this.add(this._labelView=new Dn(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),"background"===t.options.effect&&this._backView.setStyleOrClass(t.options.backgroundStyle),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 ga extends Mn{constructor(t,e){super(t,ga.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 ks(t)),this._hitTester.setFill("transparent"),this.add(this._background=new ks(t,"rct-body-background")),this.add(this._image=new Rn(t,!0,"rct-body-image")),this.add(this._emptyView=new pa(t)),this.add(this._gridRowContainer=new _a(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new Yt(t,"rct-axis-grids")),this.add(this._baseContainer=new Yt(t,"rct-axis-bases")),this.add(this._guideContainer=new ca(t,"rct-axis-guides")),this.add(this._annotationContainer=new Yt(t,"rct-annotations")),this.add(this._seriesContainer=new Yt(t,"rct-series-container")),this.add(this._axisBreakContainer=new Yt(t,"rct-axis-breaks")),this.add(this._labelContainer=new Yt(t,"rct-label-container")),this.add(this._frontGuideContainer=new ca(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new Yt(t,"rct-front-annotations")),this.add(this._feedbackContainer=new Yt(t,"rct-feedbacks")),this.add(this._zoomButton=new da(t)),this._crosshairViews=new wn(this._feedbackContainer,ua)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}prepareRender(t,e,s){this._animatable=Ht._animatable&&e.animatable(),this._polar=s,this._prepareSeries(t,e,e._getSeries().getVisibleSeries()),e._getGauges()&&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,o=this._seriesViews,a=o.length,h=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let l,_;if(e instanceof SVGElement&&(e.classList.contains(vo.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(vo.POINT_CLASS)))for(let t=a-1;t>=0;t--)if(_=o[t].pointByDom(e),_){l=o[t];break}const c=null==e?void 0:e.classList,u=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),d=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!u;if(this._crosshairViews.forEach((e=>{e.setVis(d)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(a>0){const e=this.chart()._chartOptions.pointHovering.getHintDistance(null==l?void 0:l.model);let s,i,_=!n;for(const t of o)if(!(t.model instanceof _r)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=x(o.getHintDistance(),e),i=o.getNearest2(t.x,t.y,r),n.push({hint:s,sv:o,pv:i})}));const a=n.reduce(((e,s)=>e.pv&&s.pv?r?b(e.pv.pv.point.xPos-t.x)<b(s.pv.pv.point.xPos-t.x)?e:s:b(e.pv.pv.point.yPos-t.y)<b(s.pv.pv.point.yPos-t.y)?e:s:e||s));l=a.sv,i=a.pv,s=a.hint}else l=o[0],s=x(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.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.chart()._chartOptions.pointHovering,r=this._focused,n=this._siblings,o=this._siblingSeries;let a,h,l;if(t&&t.model.options.interactive&&e&&i.visible)switch(i.getScope(t.model,e.point)){case"axis":l=t.model._xAxisObj.getSeries();case"group":l||(l=t.model._group.getVisibleSeries());const i=l.map((t=>{if(t instanceof xi){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof Ar){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,i,r);o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2)-a}else o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2);o<i&&(i=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)}));a=l.map((t=>this._owner.getSeriesView(t))),h=[],i.forEach(((t,e)=>{h.push(a[e].getPointView(t))}));break;default:a=[t],h=[e]}let _=[];if(a&&a.forEach(((t,e)=>{_.push(...t.getSiblings(h[e]))})),_=_.length>1?_.sort(((t,e)=>t.hash-e.hash)):_.length>0?_:null,C.equalArrays(n,_)||(a&&a.forEach(((t,e)=>{t.focusPoints(t.getSiblings(h[e]))})),o&&o.forEach((t=>{(!a||a.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=a,this._siblings=_),e!==r){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,t&&t.model.options.interactive&&this.$_focusSeries(t,!0),this.chart()._chartOptions.options.seriesHovering&&t.model.options.interactive&&this.$_hoverSeries(t))}this._focused&&t.model.options.interactive&&(this._focused!==r||!this._owner.tooltipVisible()||this.model.chart._tooltip.isFollowPointer(t.model))?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():!this._focused&&this._owner.tooltipVisible()&&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(vo.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(vo.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(),o=r.xAxis,a=n?this.height:this.width,h=o.valueAt(a,n?a-i:t),l=o.valueAt(a,n?a-e:s);o.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 No&&e.endHover(t,!1),e.setBoolData(vo.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,o=e.base();if(this._zoomRequested=!1,this._seriesClip||(this._seriesClip=this.control.clipBounds(),this._seriesClip2=this.control.clipBounds(),this._bodyClip=this.control.clipBounds()),this._background.setStyleOrClass(o._style),o!==e&&this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||n.isWidget()),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)}_setImage(t,e){const s=this._image;s.setVis(s.setImage(this.model.image.options.url,t,e))&&s.setStyleOrClass(this.model.image._style)}_doLayout(){const t=this.model,e=this.width,s=this.height;if(this._image,this._inverted?(this._seriesClip.setBounds(0,-e,s,e),this._seriesClip2.setBounds(0,0,e,s)):(this._seriesClip.setBounds(0,0,e,s),this._seriesClip2.setBounds(0,0,e,s)),this._bodyClip.setBounds(0,0,e,s),this._hitTester.resize(e,s),this._background.resize(e,s),this._setImage(e,s),this._seriesViews.forEach((t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.resize(e,s),t.trans(0,0),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){for(const t of this._gridViews.values())t.resize(e,s),t.layout();for(const t of this._baseViews.values()){const i=t.tag;t.setStyleOrClass(i.baseLine._style),i._isHorz?t.setVLine(i.getPos(e,i.getBaseValue()),0,s):t.setHLine(i.getPos(s,i.getBaseValue()),0,e)}this._breakViews.forEach((t=>{const i=t._model,r=i.axis;r._isHorz?r.options.reversed?t.trans(e-i._sect.pos,0):t.trans(i._sect.pos,0):r.options.reversed?t.trans(0,i._sect.pos):t.trans(0,s-i._sect.pos-i._sect.len),t.layout(e,s,i.axis._isHorz)}));const t=this.control;if(this._guideClip)this._guideClip.resize(t.width(),t.height());else{const e=t._padding;this._guideClip=t.clipBounds(-1*(e.left+this.tx),-1*(e.top+this.ty),t.width(),t.height())}[this._guideContainer,this._frontGuideContainer].forEach((t=>{t._views.forEach((t=>t.visible&&t.layout(e,s))),t.setClip(this._guideClip)})),this._gridRowContainer.layout(e,s,!1)}this.$_prepareCrosshairs(t.chart),this._gaugeViews.forEach((t=>{t.resizeByMeasured(),t.layout().transp(t.getPosition(e,s))})),this._layoutAnnotations(this._inverted,this,e,s),this._zoomButton.visible&&this._zoomButton.trans(e-this._zoomButton.getBBox().width-10,10),this._emptyView.setVis(this.$_isEmpty(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(this.model.emptyView,e,s))}$_isEmpty(t){if(!1!==t.emptyView.visible&&t.chart.isEmpty(!0))return!0;let e=!0;for(const t of this._seriesViews)if(!t.isEmptyView()){e=!1;break}if(e)for(const t of this._gaugeViews)if(!t.isEmptyView()){e=!1;break}return e}$_createGaugeView(t,e){return new(Jn[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=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 o.keys())(!s||!e.containsAxis(t)||t instanceof zi&&!t.baseLine.visible||!t.isBaseVisible())&&(o.get(t).remove(),o.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 na(t);r.set(e,s),i.add(s)}if(e instanceof zi&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new nr(t,"rct-axis-baseline");o.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 o=r.get(s)||ra(t,s);o._setChartOptions(i,this._animatable,e.loadAnimatable()),o.parent||(this._seriesContainer.add(o),this._labelContainer.add(o._labelContainer)),r.set(s,o),n.push(o),o.prepareSeries(t,s,this._polar)})),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,o=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,o.forEach((t=>t.remove())),o.length=0,s.forEach((s=>{const a=n.get(s)||this.$_createGaugeView(t,s);i.add(a),n.set(s,a),o.push(a),a.prepareGauge(t,s),a._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.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||ia(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof $i&&r.push(...t._getBreaks())}))));i.length<r.length;){const e=new oa(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._needAxes()&&[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),!this._polar&&r.model.needClip()&&r.resetClip(this.control,s,i)}))}}ga.BODY_CLASS="rct-body";class ma extends jt{constructor(t){super(t,fa.HANDLE_STYLE),this.add(this._back=new ks(t)),this.add(this._shape=new Zt(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*f(t,e);const r=new Lr;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 fa extends Mn{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(fa.HANDLE_STYLE)}static isMask(t){return t.classList.contains(fa.MASK_STYLE)}constructor(t){super(t,fa.CLASS_NAME),this.add(this._back=new ks(t,fa.BACK_STYLE)),this.add(this._container=new Yt(t,null)),this.add(this._mask=new ks(t,fa.MASK_STYLE)),this.add(this._trackView=new ks(t,fa.TRACK_CLASS)),this.add(this._thumbView=new ks(t,fa.THUMB_CLASS)),this.add(this._startHandle=new ma(t)),this.add(this._endHandle=new ma(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 o=s,a=i;return e._vertical?o=e.getSize():a=e.getSize(),e._naviChart.layoutAxes(o,a,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis._calcPoints(o,101),e._naviChart.yAxis._calcPoints(a,1),{width:o,height:a}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=e.options,r=this.width,n=this.height;if(this._back.resize(r,n),e._vertical);else{const t=s?(s.start-s.min)*r/s.total():0,e=s?(s.end-s.min)*r/s.total():r;this._mask.setVis(i.mask.visible)&&(this._mask.setBounds(t,0,e-t,n),this._mask.setStyleOrClass(i.mask.style)),this._trackView.setBounds(-2,n,r+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,n,e-t,6),this._startHandle.setVis(i.handle.visible),this._endHandle.setVis(i.handle.visible),this._startHandle.visible&&this._endHandle&&(this._startHandle.layout(n/3,n/3,!1),this._startHandle.trans(t,n+3),this._endHandle.layout(n/3,n/3,!1),this._endHandle.trans(e,n+3),this._startHandle.setStyleOrClass(i.handle.style),this._endHandle.setStyleOrClass(i.handle.style))}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,r,n,1),this._seriesView.resize(r,n),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,r,n,1),this._xAxisView.resize(r,n),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=ra(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1)}$_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 Yn(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 Yn(t)),i._simpleMode=!0)}}fa.CLASS_NAME="rct-navigator",fa.BACK_STYLE="rct-navigator-back",fa.MASK_STYLE="rct-navigator-mask",fa.HANDLE_STYLE="rct-navigator-handle",fa.HANDLE_BACK_STYLE="rct-navigator-handle-back",fa.TRACK_CLASS="rct-navigator-track",fa.THUMB_CLASS="rct-navigator-thumb";class ya extends Kt{constructor(t){super(),this.chart=t}}class ba extends ya{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=y(0,e-(o.x-n.x)),this._yStart=y(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new ks(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e=y(0,f(i.height,e-(i.y-s.y))),this._body.setZoom(0,f(y(0,this._yStart),e),this._body.width,y(f(this._yStart,i.height),e))):(t=y(0,f(i.width,t-(i.x-s.x))),this._body.setZoom(y(0,f(this._xStart,t)),0,y(f(this._xStart,i.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=y(0,f(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,f(this._yStart,r),this._body.width,b(this._yStart-r))):(i=y(0,f(o.width,i-(o.x-n.x))),this._feedback.setBounds(f(this._xStart,i),0,b(this._xStart-i),this._body.height)),!0}}class xa extends ya{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=o.length(),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(i,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height),n.model.axis.zoom(o,o+this._zoomLen)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o),n.model.axis.zoom(o,o+this._zoomLen),console.log(o)),!0}}class wa extends ya{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,s,i,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?s-o.y-n.height/2:e-o.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,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(i,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,_=n.model.options.minSize;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(a*h/n.width+l,NaN,_):o.zoom(l,NaN,_):a>0&&a<n.width?o.zoom(NaN,a*h/n.width+l,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class va extends ya{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(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-o.y:e-o.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,o=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(o*this._totalLen/n.height):this.$_moveZoom(o*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=y(0,f(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class Sa{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(),s=t.target,{x:i,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const s=this.isDragging(),n=this._clickElement;i<0||i>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(s?this.$_doDrag(t,n,i,r):(!this._dragTracker&&(b(this._clickX-i)>3||b(this._clickY-r)>3)||this._dragTracker&&!s)&&this.$_startMove(t,n,i,r))}else this.$_stopDragTracker(t,s,i,r,!0);this._prevX=i,this._prevY=r,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(s)||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,o;const a=this._chart.chart.exporter;if(a.isContextMenuVisible()&&a.toggleContextMenu(),i)!0!==i.click()&&e.buttonClicked(i);else if(n=e.legendByDom(s))if(n.source instanceof $s){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 To&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible,e.bodyView().hoverSeries(n.source.visible?n.source:null);else(o=e.seriesByDom(s))?o.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 Hn.isThumb(t)?new xa(this._chart,i.getScrollView(t)):fa.isHandle(t)?new wa(this._chart,i._navigatorView,t):fa.isMask(t)&&r&&r.model.isZoomed()?new va(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new ba(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 Va extends Yt{constructor(t){super(t,Va.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(e,s){if(this.setVis(s&&s.length>0)){const i=this._itemViews,r=this._separators;for(;i.length<s.length;){const s=new ee(e,"rct-history-item");s.anchor=t.TextAnchor.START,i.push(s)}for(;i.length>s.length;)i.pop().remove();for(;r.length<s.length-1;){const s=new ee(e);s.anchor=t.TextAnchor.START,s.text=">",r.push(s)}for(;r.length>s.length-1;)r.pop().remove();this.$_layout(s)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let o=0;o<r;o++)e[o].text=t[o].name,e[o].transX(n),o<r-1&&(n+=e[o].width+i,s[o].transX(n),n+=s[o].width+i)}}Va.TITLE_CLASS="rct-history";class Pa extends Mn{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new ks(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new ee(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){var n,o;const a=e.source;this._label.setBoolData("hidden",!a.visible),this._marker.setBoolData("hidden",!a.visible),this._label.setBoolData("empty",null===(n=a.isEmpty)||void 0===n?void 0:n.call(a)),this._marker.setBoolData("empty",null===(o=a.isEmpty)||void 0===o?void 0:o.call(a)),this._label.text=e.text()||"…";const h=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():vn,l=Sn(this._label.getBBox());return this._gap=x(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:y(h.height,l.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 Aa extends Tn{constructor(t){super(t,Aa.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new wn(this,Pa)}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,o=e.items(),a=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,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,a,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,o=t.itemGap||0,a=this._margins,h=this._paddings,l=this._vertical,_=a.left+h.left,c=a.top+h.top;let u,d=_,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||(u=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-u)/2:this.height-u),t.forEach((t=>{t.trans(d,p),p+=t.height+o})),d+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),d=_,"center"!==r&&"end"!==r||(u=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,d+="center"===r?(this.width-u)/2:this.width-u),t.forEach((t=>{t.trans(d,p),d+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,a=e.items(),h=this._itemViews,l=o.itemGap||0,_=o.lineGap||0,c=e.getMarkerSize(),u=h.count,d=this._rowViews=[],p=this._sizes=[];let g,m,f,b;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,c)),e.measure(t,a[s],r,n,1)}));let x=0,w=0;if(s){for(;x<u;)b=h.get(x),w%i==0?(d.push(f=[b]),m=b.mh,w++,x++):(m+=l+b.mh,m<=n?(f.push(b),w++,x++):w=0);this._wMarkers=[],g=m=0,d.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=y(s,t.mw),r=y(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=y(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(d.length-1)}else{for(;x<u;)b=h.get(x),w%i==0?(d.push(f=[b]),g=b.mw,w++,x++):(g+=l+b.mw,g<=r?(f.push(b),w++,x++):w=0);g=m=0,d.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=y(s,t.mh)})),e+=l*(t.length-1),g=y(g,e),m+=s,p.push(s)})),m+=_*(d.length-1)}return{width:g,height:m}}}Aa.LEGEND_CLASS="rct-legend";class Ca extends jt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Xn(t))}layout(){}}class ka extends jt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new Yt(t,"rct-polar-axis-markers")),this._markViews=new wn(this._markContainer,Ca),this.add(this._gridContainer=new jt(t,"rct-polar-axis-grids")),this._labelViews=new wn(this._labelContainer=s,In,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this.setVis(e.visible)&&(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(jn)?t.setLabel(s,e,r.replace(jn,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(s.visible&&e.visible){const t=e._ticks;this._labelContainer.setStyleOrClass(s._style);const{start:i,total:r}=s.chart._body.getPolar(e),n="auto"===s.options.rotation,o=t.length;this._labelViews.prepare(o,((a,h,l)=>{a.setVis(!0),this._prepareLabel(a,t[h],s,l);const _=n?(i+e.getPos(o,t[h].value))/r*360+90:0,{width:c,height:u}=a.getBBox();a.setRotation(c/2,u/2,_)}))}else this._labelViews.forEach((t=>t.setVis(!1)))}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 La extends ka{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new wn(this._gridContainer,nr,La.GRID_CLASS),e.insertFirst(this._startView=new nr(t,La.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new nr(t,La.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Zn(t,La.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&&t.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(t.visible&&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 o=t.getStartAngle(),a=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*a/D)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+d(o+h)*i,_=s+p(o+h)*i;n.setFill("none"),n.setLine(e,s,l,_),n.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const n=this._labelViews.count,a=Math.ceil(9/(360/n)),h=i+t.tick.options.length,l=this._labelContainer.textAlign()||"center";this._labelViews.forEach(((t,i)=>{if(t.setVis(i%a==0)){t.layout(l);const n=r[i],a=t.getBBox(),_=o+n.pos,c=e+d(_)*(h+a.width/2)-a.width/2,u=s+p(_)*(h+a.height/2)-a.height/2;t.trans(c,u)}})),n>2&&b(r[n-1].pos-r[n-2].pos)<D/24&&this._labelViews.get(n-1).setVis(!1)}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,t.getTotalAngle(),!0);else{const t=[];r.map((r=>{const n=r.pos;t.push(e+d(o+n)*i,s+p(o+n)*i)})),this._lineView.setPolyline(t)}this._startView.visible&&(this._startView.setLine(e,s,e+d(o)*i,s+p(o)*i),this._endView.setLine(e,s,e+d(o+a)*i,s+p(o+a)*i))}}La.LINE_CLASS="rct-polar-xaxis-line",La.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",La.GRID_CLASS="rct-polar-xaxis-grid-line";class Na extends ka{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridLines=new wn(this._gridContainer,Zn,Na.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(t.visible&&!1!==t.grid.visible)&&this._gridLines.prepare(e.length,null),(this._lineView.visible=t.visible&&r.visible)&&this._lineView.setStyleOrClass(r._style)}_doLayout(t,e,s,i,r,n){const o=n.getStartAngle(),a=n.getTotalAngle();if(this._gridContainer.visible){const i=this._circular;this._gridLines.forEach(((h,l)=>{const _=r[l].pos;if(h.setFill("none"),i)h.setArc(e,s,_,o,a,!0);else{const t=[];n._ticks.forEach((i=>{const r=i.pos;t.push(e+d(o+r)*_,s+p(o+r)*_)})),h.setPolyline(t)}h.setStyleOrClass(t.grid.options.style)}))}if(this._labelContainer.visible)if(n.isArced()){const t=n.getStartAngle();this._labelViews.forEach(((i,n)=>{const o=e+d(t)*r[n].pos-i.getBBox().width/2,a=s+p(t)*r[n].pos-i.getBBox().height/2;i.setContrast(null).trans(o,a)}))}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)}}Na.GRID_LINE_STYLE="rct-polar-yaxis-grid-line";class Ea extends ga{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,o=super._doMeasure(t,e,s,i,r);return this._prepareAxes(t,n.xAxis,n._getYAxes().items(),this.model.options.circular,n.xAxis.isArced()),o}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._setImage(this.width,this.height),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.visible&&this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.visible&&r.layout(t.chart.xAxis,e,s,i)})),[this._guideContainer,this._frontGuideContainer].forEach((e=>{e._views.forEach((e=>e.visible&&e.model.axis.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 Yt(t,"rct-polar-axis-labels")),this.insertFirst(this._lineContainer=new Yt(t,"rct_axis-lines")),this.insertFirst(this._axisContainer=new Yt(t,"rct-polar-axes")));const n=this._yAxisViews;for(;n.length<s.length;){const e=new Na(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 La(t,this._lineContainer,this._axisLabelContainer)),this._xAxisView.prepare(t,e,i,r)}}class Ma extends Tn{constructor(t,e){super(t,e?Ma.SUBTITLE_CLASS:Ma.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new ee(t)),this._richText=new _e}_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),Sn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var Ta,Oa;Ma.TITLE_CLASS="rct-title",Ma.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Ta||(Ta={}));class Ba extends jt{constructor(e){super(e,Ba.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 Zt(e,"rct-tooltip-back")),this.add(this._top=new Zt(e,"rct-tooltip-top")),this.add(this._textView=new ee(e,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+Ht.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new _e,this.close(!0,!1)}show(t,e,s,i,r,n,o){const a=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,a,s&&s.map((t=>t.point)));if(!l)return;const _=h.options,c=_.text||"AxisContext"!==l.constructor.name&&t._group?t._group.getTooltipText(t,a):l.getTooltipText(t,a);if(!c||!c.trim())return;this.setStyleOrClass(h._style);const u=this.control,d=u.contentWidth(),p=u.contentHeight(),g=this._textView,m=t.chart.isInverted();let b=t._yAxisObj.options.reversed;this._richText.setFormat(c),this._richText.build(g,NaN,NaN,null,h.getTextDomain());const x=g.getBBox();let w=y(_.minWidth||0,x.width+16),v=y(_.minHeight||0,x.height+12)+this._topHeight,S=t._calcedColor;t instanceof ci?(t.options.legendByPoint||t._colorByPoint())&&(S=a._calcedColor):t._colorByPoint()&&(S=getComputedStyle(e.dom).fill),this._top.setFill(S);const V="visible"===this.getStyle("visibility")?300:0,P=_.offset+this._tailSize,A=n.getFocusPointView().getBounds(),C=u.getBounds();let k,L=!1;if(m){k=r-v/2-y(0,f(r-v/2,p-v)),this._tailVisible=Math.abs(v/2-this._radius-this._tailSize/2)>Math.abs(k),L=h.isFollowPointer(t)?b?w+P>i:i+w+P>d:b?w+P>A.x-C.x+A.width:A.x-C.x-P>d-w,L&&(b=!b);const e=b?Ta.LEFT:Ta.RIGHT;this.drawTooltip(0,0,w,v,e,k),b?i-=w+P:i+=P,r-=v/2}else{k=i-w/2-y(0,f(i-w/2,d-w)),this._tailVisible=Math.abs(w/2-this._radius-this._tailSize/2)>Math.abs(k),L=h.isFollowPointer(t)?b?r+v+P>p:r-(v+P)<0:b?p-(A.y-C.y-u._padding.top)<v+P:C.bottom-A.bottom+P>p-v,L&&(b=!b);const e=b?Ta.BOTTOM:Ta.TOP;this.drawTooltip(0,0,w,v,e,k),i-=w/2,b?r+=P:r-=v+P}i=y(0,f(i,d-w)),r=y(0,f(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:Li.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){ws(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,n){const o=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+s-a,e,"Q",t+s,e,t+s,e+a,"L",t+s,e+i-a,"Q",t+s,e+i,t+s-a,e+i,"L",t+a,e+i,"Q",t,e+i,t,e+i-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case Ta.TOP:l=l.concat(["M",t+s/2-o/2+n,e+i,"L",t+s/2+n,e+i+o,"L",t+s/2+o/2+n,e+i]);break;case Ta.BOTTOM:l=l.concat(["M",t+s/2-o/2+n,e,"L",t+s/2+n,e-o,"L",t+s/2+o/2+n,e]);break;case Ta.LEFT:l=l.concat(["M",t+s,e+i/2-o/2+n,"L",t+s+o,e+i/2+n,"L",t+s,e+i/2+o/2+n]);break;case Ta.RIGHT:l=l.concat(["M",t,e+i/2-o/2+n,"L",t-o,e+i/2+n,"L",t,e+i/2+o/2+n])}const _=r===Ta.BOTTOM,c=_?["M",t,e+i-h,"l",s,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-s,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",s-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-s,0,"l",0,a-h,"q",0,-a,a,-a],u=this._textView,d=u.getBBox();t+=(s-d.width)/2,e+=(i-d.height+(_?-h:h))/2,u.trans(t,e),this._top.setPath(c),this._back.setPath(l)}}Ba.CLASS_NAME="rct-tooltip";class Ra extends On{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Ma(t,!1)),this.add(this.subtitleView=new Ma(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,_=0,c=0,u=this.titleView,d=s,p=0,g=0;switch(u.setVis(n.visible)?(a=u.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):u.setModel(n),(u=this.subtitleView).setVis(o.visible)?(a=u.measure(t,o,s,i,r),c=this._hSub=a.height,_=this._wSub=a.width,g=+o.options.titleGap||0):u.setModel(o),o.options.position){case"left":case"right":p=y(l,c),d=h+g+_;break;default:p=l+g+c,d=y(d,h+_)}return p>0&&(p+=this.titleView.visible?x(n.options.gap,0):x(o.options.gap,0)),{width:d,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,o=r&&r.options,a=i&&i.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,h=r&&r.visible?this._wSub>t.wPlot||"chart"===o.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"===o.alignBase?0:t.xPlot;if(a>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=y(this._hTitle,this._hSub);g=y(g,g+t(i,e,this._hTitle)),f=y(f,f+t(r,e,this._hSub))},u=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},d=()=>{if(m=y(m,m+u(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":b=m;break;case"right":b=m+this._wTitle-this._wSub;break;default:b=m+(this._wTitle-this._wSub)/2}else b=y(b,b+u(r,h,this._wSub))},p=x(o.titleGap,0);let g=0,m=l,f=0,b=_;switch(n.align){case"left":switch(o.position){case"left":m=b+this._wSub+p,c();break;case"right":switch(b=m+this._wTitle+p,o.align){case"center":b=y(b,b+(h-this._wTitle-this._wSub)/2);break;case"right":b=y(b,_+h-this._wSub)}c();break;case"top":d(),g=f+this._hSub+p;break;default:d(),f=g+this._hTitle+p}break;case"right":switch(o.position){case"left":switch(m+=a-this._wTitle,o.align){case"center":b+=(a-this._wTitle-this._wSub)/2;break;case"right":b=m-p-this._wSub}c();break;case"right":b+=h-this._wSub,m=b-p-this._wTitle,c();break;case"top":d(),g=f+this._hSub+p;break;default:d(),f=g+this._hTitle+p}break;default:switch(o.position){case"left":switch(m+=(a-this._wTitle)/2,o.align){case"left":break;case"center":b+=(m-b-this._wSub)/2;break;case"right":b=m-p-this._wSub}c();break;case"right":switch(m+=(a-this._wTitle)/2,o.align){case"left":b=m+this._wTitle+p;break;case"center":b=m+this._wTitle+p,b+=(h-b-this._wSub)/2;break;case"right":b+=h-p-this._wSub}c();break;case"top":d(),g=f+this._hSub+p;break;default:d(),f=g+this._hTitle+p}}e.resizeByMeasured().layout().trans(m,g),s.resizeByMeasured().layout().trans(b,f)}else if(a>0||h>0){const t=a?i:r,n=a?e:s,o=a||h,c=a?this._wTitle:this._wSub;let u=a?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":u+=o-c;break;default:u+=(o-c)/2}n.trans(u,0)}}}class Da extends On{_doInitChildren(t){this.add(this._legendView=new Aa(t))}_doMeasure(t,e,s,i,r){const n=e._legend,o=this._legendView.measure(t,n,s,i,r),a=this._pos=n._location;return"left"===a||"right"===a?o.width+=this._legendView._gap:o.height+=this._legendView._gap,o}_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 Fa extends On{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 o,a=n.length;for(;n.length<s.length;)o=new Yn(t),s[a++].visible&&this.add(o),n.push(o);for(;n.length>s.length;)o=n.pop(),o.parent&&o.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,o=0;return[this.views].forEach((e=>{if(e){const a=(this.isX,s),h=(this.isX,i);let l=0,_=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,a,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=y(n,l),o=y(o,_)}})),{width:n,height:o}}_doLayout(t){const e=this.control.loaded,s=[];let i=this.width,r=this.height,n=0,o=0;t=+t||0,[this.views].forEach((a=>{if(a){let h=0;a.forEach((t=>{if(t.visible){const a=t.checkExtents(e);a&&s.push(a),this.isHorz?t.resize(i,t.mh):t.resize(t.mw,r),t.layout(),this.isHorz?(t.trans(n,this.dir===mn.TOP?r-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===mn.RIGHT?h:i-h-t.mw,o),h+=t.mw+this._gap)}})),this.isHorz?n+=i+t:o+=r+t}}));const a=this.control.chart.body.options.zoomCallback;s.length>0&&a&&Promise.resolve().then((()=>{s.forEach((({axis:t,from:e,to:s})=>{a({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof Xs?Math.floor(e):e,to:t instanceof Xs?Math.floor(s):s})}))}))}}class za extends Mn{constructor(e){super(e,"rct-credits"),this.add(this._textView=new ee(e)),this._textView.anchor=t.TextAnchor.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 $a extends Yt{static registerPaneClass(t){this.pane_class=t}constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new Yt(t,"rct-annotations")),this.add(this._plotContainer=new Yt(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new ga(t,this));for(const e in mn){const s=new Fa(t,mn[e]);this._plotContainer.add(s),this._axisSectionMap[mn[e]]=s}$a.pane_class&&this.add(this._paneContainer=new $a.pane_class(t,this)),this.add(this._titleSectionView=new Ra(t)),this.add(this._legendSectionView=new Da(t)),this.add(this._frontAnnotationContainer=new Yt(t,"rct-front-annotations")),this.add(this._creditView=new za(t)),this.add(this._navigatorView=new fa(t)),this.add(this._historyView=new Va(t)),this.add(this._tooltipView=new Ba(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){var n,o,a;const h=this._model=e,l=h.isPolar(),_=h._chartOptions.credits,c=h._legend,u=h._navigator;let d,p=s,g=i;if(this._inverted=h.isInverted(),h.isSplitted()?(this._plotContainer.setVis(!1),null===(n=this._paneContainer)||void 0===n||n.setVis(!0),this.$_preparePanes(t,h._split)):(this._plotContainer.setVis(!0),null===(o=this._paneContainer)||void 0===o||o.setVis(!1),this.$_prepareBody(t,l)),this._creditView.setVis(_.visible)&&(d=this._creditView.measure(t,_,p,g,r),_.isFloating()||("middle"!==_.options.verticalAlign?g-=d.height+(+_.options.offsetY||0)+(+_.options.gap||0):"center"!==_.options.align&&(p-=d.width+(+_.options.offsetX||0)+(+_.options.gap||0)))),d=this._titleSectionView.measure(t,h,p,g,r),g-=d.height,this._legendSectionView.setVis(c.visible))switch(d=this._legendSectionView.measure(t,h,p,g,r),c._location){case"top":case"bottom":g-=d.height;break;case"right":case"left":p-=d.width}this._navigatorView.setVis(u.visible),(null===(a=this._paneContainer)||void 0===a?void 0:a.visible)?this._paneContainer.measure(t,h._split,p,g,1):l?this.$_measurePolar(t,h,p,g,1):this.$_measurePlot(t,h,p,g,1),this._navigatorView.visible&&(h._navigator._vertical?g=this._bodyView.mh:p=this._bodyView.mw,this._navigatorView.measure(t,u,p,g,r)),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._chartOptions.credits,_=l.options,c=+_.gap||0;let u=0,d=0,p=0,g=0,m=0,f=0,y=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=p=h.height+u+c:r-=g=h.height+u+c):(d=+_.offsetX||0,"left"===_.align?i-=m=h.width+d+c:i-=f=h.width+d+c)));const x=this._titleSectionView;let w=0;const v=b+p;x.visible&&(x.resizeByMeasured(),r-=w=x.height),y=m,b=s-g;const S=this._navigatorView;let V=0;S.visible&&(S.model._vertical||(S.resize(S.mw,S.mh-S.model.getGap()-S.model.getGapFar()),r-=V=S.mh));const P=this._legendSectionView;let A,C,k=0,L=0;if(P.visible)switch(P.resizeByMeasured().layout(),k=P.height,L=P.width,a._location){case"top":A=w+p,r-=k;break;case"bottom":r-=k,A=b-k,b-=k;break;case"right":i-=L,C=e-L;break;case"left":i-=L,y+=L,C=0}S.visible&&(b-=V,S.layout().transY(b+S.model.getGap()));let N,E=0,M=0,T=0,O=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(y,v+w).resize(i,r),this._paneContainer.layout(),T=r,O=i,N=this._paneContainer.getRect();else{const t=this._axisSectionMap,e=t[mn.CENTER],s=t[mn.MIDDLE];let n;if(!o){const o=this.control._padding;e&&e.visible&&(E=e.mw),s&&s.visible&&(M=s.mh),[mn.LEFT,mn.RIGHT].forEach((e=>{(n=t[e])&&n.visible&&(i-=n.mw)})),[mn.TOP,mn.BOTTOM].forEach((e=>{(n=t[e])&&n.visible&&(r-=n.mh)})),(n=t[mn.LEFT])&&n.visible&&(n.resize(n.mw,r),n.layout(M),y+=n.mw),(n=t[mn.RIGHT])&&n.visible&&(n.resize(n.mw,r),n.layout(M)),E>0&&(e.resize(n.mw,r),e.layout()),(n=t[mn.BOTTOM])&&n.visible&&(n.setMargins(o.left,y,this.width-y-i,Math.max(0,o.right-2)),n.resize(i,n.mh),n.layout(E),b-=n.mh),(n=t[mn.TOP])&&n.visible&&(n.setMargins(o.left,y,this.width-y-i,Math.max(0,o.right-1)),n.resize(i,n.mh),n.layout(E)),M>0&&(s.resize(i,n.mh),s.layout())}S.visible&&S.layout().transX(y);const a=this._org={x:y,y:b};this._plotWidth=i,this._plotHeight=r,o||((n=t[mn.LEFT])&&n.visible&&n.trans(a.x-n.mw,a.y-n.height),(n=t[mn.RIGHT])&&n.visible&&n.trans(a.x+i,a.y-n.height),E>0&&e.trans(a.x+(i-E)/2,a.y-e.height),(n=t[mn.BOTTOM])&&n.visible&&n.trans(a.x,a.y),(n=t[mn.TOP])&&n.visible&&n.trans(a.x,a.y-r-n.height),M>0&&s.trans(a.x,a.y-(r-M)/2-M));const h=this._currBody;T=this._plotHeight-M,O=this._plotWidth-E,y=a.x,b=a.y-this._plotHeight,h.resize(O,T),h.trans(y,b),h.layout(),N=h.getRect(),h._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(h.visible){let t,i;switch(h.layout(),_.verticalAlign){case"top":i=u;break;case"middle":i=(s-h.height)/2+u;break;default:i=g>0?s-g+c:s-h.height-u}switch(_.align){case"left":t=d;break;case"center":t=(e-h.width)/2+d;break;default:t=f>0?e-f+c:e-h.width-d}h.trans(t,i)}if(O+=E,x.visible&&x.layout({xPlot:y,wPlot:O,wChart:e}).trans(0,v),P.visible){const t=a.options,n=t.align,o=t.verticalAlign;if("body"===a._location){let e=+t.offsetX||0;switch(n){case"right":y+=O-L-e;break;case"center":y+=(O-L)/2+e;break;default:y+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=T-k-e;break;case"middle":b+=(T-k)/2+e;break;default:b+=e}}else if(isNaN(A)){const e=+t.offsetY||0;if(y=C,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=s-k-e;break;default:b=(s-k)/2+e}b+k>s&&(b=(s-k)/2)}else switch(o){case"top":b+=e;break;case"bottom":b=b+r-k-e;break;default:b=b+(r-k)/2+e}b+k>s&&(b=(s-k)/2),b<0&&(b=0)}else{const s=+t.offsetX||0;if(b=A,"chart"===t.alignBase)switch(n){case"left":y=s;break;case"right":y=e-L-s;break;default:y=(e-L)/2+s}else switch(n){case"left":y+=s;break;case"right":y=y+i-L-s;break;default:y+=(i-L)/2+s}y+L>e&&(y=(e-L)/2),y<0&&(y=0)}P.trans(y,b)}this.$_layoutAnnotations(this._inverted,e,s,N),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i,r){const{x:n,y:o}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},a=this._model.chart._tooltip.isFollowPointer(t),h=i.getTooltipPos(),l=a?r.x+h.x:n+h.x,_=a?r.y+h.y:o+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){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.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),o=null==r?void 0:r.classList,a=(null==o?void 0:o.value)&&(o.contains("rct-contextmenu-item")||o.contains("rct-contextmenu-list"));let h=this._hoverItem;if(this._hoverItem=null,n){const i=n.controlToElement(t,e),o=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 ii?n.hoverSeries(t.source):t.legend.options.pointHovering&&t.source instanceof $s&&n.hoverPoint(t.source))}if(h instanceof ys&&!(this._hoverItem instanceof ys)&&(n.hoverSeries(null),n.hoverPoint(null)),!o)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=o&&s.visible&&!a&&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 o=this._model.inverted;t.model._visPoints.forEach((t=>{const r=t.xPos,a=t instanceof mr&&!o?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=e._isX?Math.abs(i.x-r):Math.abs(i.y-a);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 mn){const s=this._axisSectionMap[mn[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 Ea(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,e)}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const s in o){const a=o[s];n?a.prepare(t,e,e.getAxes(s,!1),i,r):a.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 o=n[e];r&&o.visible&&o.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 o=s,a=i;let h=0,l=0;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=n[mn.LEFT].checkWidths(t,s,i),s-=n[mn.RIGHT].checkWidths(t,s,i),i-=n[mn.BOTTOM].checkHeights(t,s,i),i-=n[mn.TOP].checkHeights(t,s,i),this._inverted?s-=h=n[mn.CENTER].checkWidths(t,s,i):i-=l=n[mn.MIDDLE].checkHeights(t,s,i),s-=h,i-=l,e.layoutAxes(s,i,this._inverted,r);for(const o in n){const a=n[o];a.visible&&a.measure(t,e,s,i,r)}s=o,i=a,h=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===mn.LEFT||t===mn.RIGHT?s-=e.mw:t!==mn.BOTTOM&&t!==mn.TOP||(i-=e.mh),this._inverted?t===mn.CENTER&&(s-=h=e.mw):t===mn.MIDDLE&&(i-=l=e.mh))}e.layoutAxes(s,i,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const o in n){const a=n[o];a.visible&&(a.measure(t,e,s,i,r),a.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a,h=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===mn.LEFT||t===mn.RIGHT?s-=e.mw:t!==mn.BOTTOM&&t!==mn.TOP||(i-=e.mh),this._inverted?t===mn.CENTER&&(s-=h=e.mw):t===mn.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),o=2*Math.PI*n,a=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(o,a,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(o,a,!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 o=r.get(e)||ia(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)n=-r.left,o=-r.top,a=e+r.left+r.right,h=s+r.top+r.bottom;else n=o=0,a=e,h=s;i._layoutView(t,this,n,o,a,h)}))}}!function(t){t.EXPORT="$$realchart_export"}(Oa||(Oa={}));class Ia extends Ht{constructor(t,e){super(t,e),this.addElement(this._chartView=new $a(t)),this.setPointerHandler(new Sa(this))}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new bn(null,((t,e)=>{this.changeModel(t,e)}))}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof Le&&s===Se.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===Oa.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_doRender(t){var e;const s=this.model,i=s._chartOptions.options,r=this._chartView;if(this.clearTemporaryDefs(),s&&(this.setData("theme",i.theme,!0),this.setData("palette",i.palette),this.setDomResize(i.domResize),s._prepareRender(),this._loadModules()),this.loaded||r.clean(),r.setVis(!1!==i.visible)&&(r.measure(this.doc(),s,t.width,t.height,1),r.setRect(t),r.layout(),s&&s.afterRender()),null===(e=this._chart)||void 0===e?void 0:e._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_doRenderBackground(t,e,s,r){if(this.model){const s=this.model._chartOptions._style;if(i(s))for(const i in s)i.startsWith("padding")?e.setStyle(i,s[i]):t.style[i]=s[i]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e.options.exporting)}}}class Ga{static getVersion(){return"1.3.12"}static setLocale(t,e){e&&E(t,e),(t=>{t&&(N=k[L=t.substring(0,2)]),N||(N=k[L="ko"])})(t)}static registerLocale(t,e){E(t,e)}static setDebugging(t){jt.DEBUGGING=t}static setLogging(t){C.LOGGING=t}static setAnimatable(t){Ht._animatable=t}static configure(t){return t}static createChart(t,e,s,r=!0,n){const o=new Ia(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[yn]=o,o.chart}static createData(t,e){return new xn(t||{},e)}}class Ha{static empty(){return new Ha}static create(t=0,e=0){return new Ha(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class ja{static empty(){return new ja}static create(t=0,e=0){return new ja(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const Ya=Ga.getVersion,Wa=Ga.setDebugging,Xa=Ga.setLogging,Ua=Ga.setAnimatable,Za=Ga.configure,qa=Ga.createChart,Ka=Ga.createData;t.Annotation=Le,t.ArcElement=Un,t.AreaRangeSeries=yr,t.AreaSeries=gr,t.AreaSeriesGroup=xr,t.AssetCollection=ye,t.Axis=Ue,t.AxisBaseLine=Fi,t.AxisCollection=Ze,t.AxisGrid=Fe,t.AxisItem=Oe,t.AxisLabel=je,t.AxisLine=Be,t.AxisScrollBar=Ye,t.AxisScrollView=Hn,t.AxisSectorLine=Xe,t.AxisTick=He,t.AxisTitle=Re,t.AxisView=Yn,t.BarRangeSeries=qi,t.BarSeries=Ji,t.BarSeriesBase=Qi,t.BarSeriesGroup=er,t.BarSeriesGroupBase=tr,t.BasedSeries=pi,t.BellCurveSeries=vr,t.Body=ms,t.BodyView=ga,t.BoxPlotSeries=Vr,t.BubbleSeries=Ar,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=Cr,t.CandlestickSeries=Er,t.CategoryAxis=Xs,t.CategoryAxisGrid=Ws,t.CategoryAxisLabel=Ys,t.CategoryAxisTick=js,t.Chart=bn,t.ChartControl=Ia,t.ChartData=xn,t.ChartDataCollection=ut,t.ChartElement=Mn,t.ChartItem=Se,t.ChartObject=fn,t.ChartOptions=gn,t.ChartText=Pe,t.ChartView=$a,t.CircelBarPointLabel=Mr,t.CircleBarSeries=Tr,t.CircleBarSeriesGroup=Or,t.CircleElement=Xn,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=us,t.CircularGaugeGroup=ds,t.CircularGaugeLabel=_s,t.ClockGaugeType="clock",t.ClusterableSeries=di,t.ClusterableSeriesGroup=bi,t.Color=Rt,t.ConnectableSeries=ni,t.ConstraintSeriesGroup=yi,t.ContentView=Bn,t.ContinuousAxis=zi,t.Credits=dn,t.Crosshair=Me,t.DataPoint=$s,t.DataPointCollection=Is,t.DataPointLabel=Ks,t.DumbbellSeries=Dr,t.ElementPool=wn,t.EqualizerSeries=zr,t.ErrorBarSeries=$r,t.Exporter=fs,t.FunnelSeries=jr,t.Gauge=ts,t.GaugeBase=Je,t.GaugeGroup=es,t.GaugeGroupView=io,t.GaugeItem=class extends Se{constructor(t){super(t.chart)}},t.GaugeLabel=ls,t.GaugeRangeBand=hs,t.GaugeRangeLabel=as,t.GaugeScale=os,t.GaugeView=to,t.HeatmapSeriesType="heatmap",t.HistogramSeries=Xr,t.IconedText=Ae,t.ImageAnnotation=Ni,t.LayerElement=Yt,t.Legend=bs,t.LineElement=nr,t.LinePointLabel=lr,t.LineSeries=ur,t.LineSeriesBase=_r,t.LineSeriesGroup=br,t.LineSeriesPoint=ar,t.LinearAxis=$i,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=Gi,t.LollipopSeries=qr,t.LowRangedSeries=mi,t.MarkerSeries=xi,t.MarkerSeriesPointView=No,t.MarkerSeriesView=Eo,t.NavigatorMask=vi,t.NavigiatorHandle=wi,t.ORG_ANGLE=F,t.OhlcSeries=Qr,t.OthersGroup=_i,t.PI_2=D,t.PaneContainer=class extends Yt{},t.ParetoSeries=tn,t.PathBuilder=Lr,t.PathElement=Zt,t.PieSeries=on,t.PieSeriesGroup=an,t.PieSeriesLabel=nn,t.PieSeriesText=rn,t.Point=Ha,t.PointElement=So,t.PointHovering=pn,t.PointLabelView=po,t.RAD_DEG=$,t.RadialSeries=ui,t.RangedSeries=gi,t.RcAnimation=vs,t.RcControl=Ht,t.RcElement=jt,t.RcObject=T,t.RectElement=ks,t.ScaleView=class extends Mn{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new Yt(t,"rct-gauge-scale-ticks")),this._ticks=new wn(this._tickContainer,nr),this.add(this._labelContainer=new Yt(t,"rct-gauge-scale-tick-labels")),this._labels=new wn(this._labelContainer,so)}},t.ScatterSeries=ln,t.SectionView=On,t.SectorElement=qn,t.Series=ii,t.SeriesAnimation=ro,t.SeriesGroup=fi,t.SeriesMarker=oi,t.SeriesNavigator=Ai,t.SeriesView=vo,t.ShapeAnnotation=Ei,t.Size=ja,t.SplineSeries=dr,t.Subtitle=ki,t.TextAnnotation=Mi,t.TextElement=ee,t.TimeAxis=Zi,t.Title=Ci,t.Tooltip=Li,t.TreemapSeriesType="treemap",t.Trendline=Qs,t.Utils=C,t.ValueGauge=is,t.ValueGaugeView=class extends to{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return h(i)?yt.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 y(t.options.minValue,f(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 eo(this,this._prevValue,t.options.value).start((()=>this._runValue=NaN)),this._prevValue=t.options.value)}},t.VectorSeriesType="vector",t.WaterfallSeries=un,t.Widget=qe,t.WidgetSeries=ci,t.WidgetSeriesPoint=ai,t.WidgetSeriesView=To,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=Gs,t.absv=b,t.assignObj=_,t.buildValueRanges=nt,t.calcPercent=Q,t.configure=Za,t.copyObj=t=>t&&_({},t),t.cos=d,t.createChart=qa,t.createData=Ka,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=xe,t.fixnum=H,t.getVersion=Ya,t.incv=V,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=i,t.isString=o,t.maxv=y,t.minv=f,t.parsePercentSize=q,t.pickNum=x,t.pickProp=v,t.pickProp3=S,t.pixel=Y,t.rectToSize=Sn,t.setAnimatable=Ua,t.setDebugging=Wa,t.setLogging=Xa,t.sin=p,t.toStr=function(t){return null==t?null:String(t)}}));
|
|
7
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",s=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,n=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return"string"==typeof t&&t.length>0},h=function(t){return"number"==typeof t},l=function(t){return"boolean"==typeof t},_=Object.assign,c=Math.floor,u=Math.ceil,d=Math.cos,p=Math.sin,g=function(t){return Math.pow(10,t)},m=Math.log10,f=Math.min,y=Math.max,b=Math.abs,x=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},w=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},v=function(t,e){return void 0!==t?t:e},S=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},V=(t,e,s)=>t+(e-t)*s,P=function(t){return"function"==typeof t?t:null},A=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class C{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&&C.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(f(s,C.month_days[C.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(),o=new Date(r,i+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/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&&!r(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&&!r(t))return _({},t)}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(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(r(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 r(t)?t:null!=t?[t]:null}static copyArray(t){return r(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()-A}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=y(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 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=r(t)?[]:{};for(let s of Object.keys(t))e[s]=C.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(),C.log(t,+new Date-s+"ms")}static clamp(t,e,s){return y(e,f(s,t))}static makeIntArray(t,e){const s=new Array(y(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}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=b(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}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}}C.LOGGING=!1,C.week_days=["일","월","화","수","목","금","토"],C.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],C.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]],C.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();const k={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 L="ko",N=k[L]||k[L="ko"];const E=(t,e)=>{t&&i(e)&&(N=k[t.substring(0,2)]=Object.assign(k.ko,k.en,e))};let M=0;class T{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(M++))}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 O extends T{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 B=void 0,R=Math.PI,D=2*R,F=-R/2,z=2*R/360,$=360/R/2,I="%".charCodeAt(0);function G(t){return t>D?t%D:t}function H(t){return parseFloat(t.toPrecision(12))}function j(t){return Math.floor(1e6*t)/1e6}function Y(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 U(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function Z(t,e){const s={};return s[t]=e,s}function q(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)===I?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;rt(N.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 K(t,e){return q(t,!0)||q(e,!1)}function Q(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const J="fill",tt={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"},et=function(t){const e=tt[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return tt[t]=e,e}return e};class st extends Error{}const it=function(t,e){if(!t)throw new st(e)},rt=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},nt=function(t,e,s,n=!0,a=!0,h=!1,l){let c,u;if(n&&(e=-Number.MAX_VALUE,s=Number.MAX_VALUE),r(t))c=[],t.forEach((t=>{if(i(t)&&o(t.color)){const i={fromValue:x(t.fromValue,u?u.toValue:e),toValue:x(t.toValue,s),color:t.color,style:t.style?_({},t.style):B};i.fromValue<i.toValue&&(c.push(i),u=i)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<s)),a&&c.forEach((t=>{t.fromValue=y(t.fromValue,e),t.toValue=f(t.toValue,s)}));else if(i(t)&&r(t.colors)&&t.colors.length>0){const i=t.colors,n=r(t.styles)?t.styles:null;if(c=[],r(t.steps)&&t.steps.length>0){const o=r(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),s>o[o.length-1]&&o.push(s);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:i[f(t,i.length-1)],style:n?n[f(t,n.length-1)]:B})}else{let r=x(t.fromValue,e);const o=x(t.toValue,s),a=(o-r)/i.length;let h=0;for(;r<o;)c.push({fromValue:r,toValue:r+=a,color:i[f(h,i.length-1)],style:n?n[f(h,n.length-1)]:B}),h++}}if(h&&c&&c.length>0){let t=0,i=e;for(;t<c.length;)c[t].fromValue>i&&c.splice(t,0,{fromValue:i,toValue:c[t].fromValue,color:l}),i=c[t].toValue,t++;c[t-1].toValue<s&&c.push({fromValue:c[t-1].toValue,toValue:s,color:l})}return c},ot="shuffle",at="random",ht="vertical-lr",lt="vertical-rl",_t=function(t){return t&&"object"==typeof t};class ct extends O{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),r(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=r(e)?e.slice():o(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(r(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else _t(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)&&rt(N.invalidRowIndex,t)}_changed(){this._fireEvent("onDataChanged")}}class ut{constructor(){this._map={}}get(t){return this._map[t]}load(t){for(const e in t){const s=t[e];let i;r(s)?i=new ct({},s):_t(s)&&r(s.values)&&(i=new ct(s.options,s.values)),this._map[e]=i}}}const dt="0".charCodeAt(0),pt="#".charCodeAt(0),gt=",".charCodeAt(0),mt="s".charCodeAt(0),ft="a".charCodeAt(0);class yt{static getFormatter(t){let e=yt.Formatters[t];return e||(yt.Formatters[t]=e=new yt(t)),e}static get Default(){return yt.getFormatter(yt.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)===dt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===pt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===dt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===gt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===mt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===ft){s.signDisplay="never";break}}return s.minimumIntegerDigits=y(1,s.minimumIntegerDigits),s}}}yt.DEFAULT_FORMAT="",yt.Formatters={};const bt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],xt=[".","/","-",":"],wt="Z".charCodeAt(0),vt="z".charCodeAt(0),St="A".charCodeAt(0),Vt="a".charCodeAt(0),Pt="y".charCodeAt(0),At="M".charCodeAt(0),Ct="m".charCodeAt(0),kt="W".charCodeAt(0),Lt="w".charCodeAt(0),Nt="d".charCodeAt(0),Et="H".charCodeAt(0),Mt="h".charCodeAt(0),Tt="S".charCodeAt(0),Ot="s".charCodeAt(0);class Bt{static getFormatter(t){let e=Bt.Formatters[t];return e||(Bt.Formatters[t]=e=new Bt(t)),e}static get Default(){return Bt.getFormatter(N.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||N.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 o=s[r],a=o.length;switch(o.charCodeAt(0)){case Pt:i+=a>2?t.getFullYear():X(t.getFullYear()%100);break;case At:i+=a>1?X(t.getMonth()+1):t.getMonth()+1;break;case Nt:i+=a>1?X(t.getDate()):t.getDate();break;case kt:i+=a>1?X(C.weekOfYear(t,e)+1):C.weekOfMonth(t,e,!0)+1;break;case Lt:i+=a>1?C.long_week_days[t.getDay()]:C.week_days[t.getDay()];break;case Et:i+=a>1?X(t.getHours()):t.getHours();break;case Mt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?X(e):e}else i+=a>1?X(t.getHours()):t.getHours();break;case Ct:i+=a>1?X(t.getMinutes()):t.getMinutes();break;case Ot:i+=a>1?X(t.getSeconds()):t.getSeconds();break;case Vt:case St:t.getHours()<12?i+=N.am:i+=N.pm;break;case Tt:let s=t.getMilliseconds();i+=3==a?U(s):2==a?X(s):s.toString().substring(0,a);break;default:i+=o}}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(xt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),bt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=St&&e<=wt||e>=Vt&&e<=vt)&&rt(N.invalidDateFormat,t)}e.push(n)}if(r<i&&C.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&C.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||N.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Bt.Formatters={};class Rt{static isBright(t){return new Rt(t).isBright()}static getContrast(t,e,s){return new Rt(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(C.startsWith(t,"rgb(")&&C.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):C.startsWith(t,"rgba(")&&C.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):C.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 Rt(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 Dt{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 Ft;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Ft||(Ft={}));const zt={name:"RealChart",version:"1.3.13",license:"enterprise",code:null};class $t{static decode(t){const e=$t.CHARS,s=$t.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}}$t.PAD="=",$t.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class It{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 o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^i>>16)<<16|65535&(65535&o^65535&i),(o>>16)+(s>>16)+((65535&o)+(65535&s)>>16)<<16|(65535&o)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=It.xor,i=It.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=It.xor,i=It.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=It.kb,i=It._encryptBlock;let r,n,o,a=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*It.POW8|e[a++%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,o=_.p.length;r<o;)i(l,_),_.p[r++]=l.left,_.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=_["s"+r].length;n<o;)i(l,_),_["s"+r][n++]=l.left,_["s"+r][n++]=l.right;return _}static decrypt(t,e){const s=It._decryptBlock;let i=It._init(e),r=[],n=$t.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*It.POW24|n[a+1]*It.POW16|n[a+2]*It.POW8|n[a+3],h.right=n[a+4]*It.POW24|n[a+5]*It.POW16|n[a+6]*It.POW8|n[a+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),a+=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)}}It.POW2=Math.pow(2,2),It.POW3=Math.pow(2,3),It.POW4=Math.pow(2,4),It.POW8=Math.pow(2,8),It.POW16=Math.pow(2,16),It.POW24=Math.pow(2,24),It.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 Gt{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=It.decrypt(t,"dkdl"+this._getLDKey(It.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 Ht extends T{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._domResize=!1,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&this._domResized()},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=zt.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=Gt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==zt.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(zt.license!=Ft.Developer&&!Gt.includedDomains(e,t.toLowerCase(),r))throw new Error(s);const n=i.lic.toLowerCase();if(!Object.values(Ft).includes(n))throw new Error(s);if(zt.license=i.lic,n==Ft.Evaluation||n==Ft.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||Ht.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),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),Dt.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(){Dt.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(jt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(jt.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)}}setDomResize(t){t!=this._domResize&&(this._domResize=t)}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 Ut(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new qt(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(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,jt.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){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),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){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),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(t,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof HTMLDivElement||rt(N.invalidOuterDiv,s);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");_(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 o=this._svg=r.createElementNS(e,"svg");o.classList.add("rct-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created by RealChart v"+zt.version,o.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Wt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),_(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,s){let i=t.createElementNS(e,"filter");i.setAttribute("id",Ht.SHADOW_FILTER);const r=t.createElementNS(e,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=t.createElementNS(e,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=t.createElementNS(e,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=t.createElementNS(e,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=t.createElementNS(e,"feMerge"),l=t.createElementNS(e,"feMergeNode"),_=t.createElementNS(e,"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{C.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;_(this._htmlRoot.style,{left:Y(e.left-t.left),top:Y(e.top-t.top)});const r=this._container.firstElementChild;r.removeAttribute("style"),_(r.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)"}),this._doRenderBackground(r,this._root,s,i);const n=this._padding=Dt.getPadding(this._root.dom);this._doRender({x:n.left,y:n.top,width:s-n.left-n.right,height:i-n.top-n.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),C.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){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)}}Ht.CLASS_NAME="rct-control",Ht.SHADOW_FILTER="rr-chart-shadow-filter",Ht._animatable=!0;class jt extends T{constructor(t,s,i=B){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(e,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 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 tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}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=t?"":"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(t,s){const i=t.createElementNS(e,s);return this._dom.appendChild(i),i}insertElement(t,s,i){const r=t.createElementNS(e,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 o(e)&&e.indexOf("NaN"),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()}getBBoxEx(){const t=this._dom.getBBox();return t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){const s=this._dom.getBBox();return s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}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}setPosY(t){this._y=t}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=C.isValidNum(t)?t:this._tx,e=C.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=C.isValidNum(t)?t:this._tx,e=C.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}transEx2(t,e,s=0,i=!0){const r=C.isValidNum(t)?t:this._tx,n=C.isValidNum(e)?e:this._ty;if(r===this._tx&&n===this._ty)return this;if(s>0){const t=this._rotation||0,e=`translate(${this._tx||0}px, ${this._ty||0}px)`+(t?` rotate(${t}deg)`:""),o=`translate(${r}px, ${n}px)`+(t?` rotate(${t}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._dom.animate([{transform:e},{transform:o}],{duration:s,fill:"none"});i&&a.addEventListener("finish",(()=>{var t;this._dom.style.transformOrigin="",null===(t=this.control)||void 0===t||t.invalidateLayout()}))}return this._tx=r,this._ty=n,this._updateTransform(),this}transX(t){return t!==this._tx&&C.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&C.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}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.split(" ").filter((t=>t.length>0))),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!==B&&(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(et(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(et(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(et(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(o(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let s in t)e.setProperty(et(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){o(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this.addClass(t):i(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,v(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(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",(()=>{delete this.hiding,this.setVis(!1)})),this.hiding=!0}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(jt.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 jt.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=[];(C.isValidNum(e)||C.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+C.pick(this._originX,t.getAttribute("x"),0)+" "+C.pick(this._originY,t.getAttribute("y")||0)+")"),C.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=C.getNumber(this._scaleX,1),n=C.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}jt.DEBUGGING=!1,jt.TESTING=!1,jt.ASSET_KEY="_asset_",jt.TEMP_KEY="_temp_";class Yt extends jt{constructor(t,e){super(t,e,"g")}}class Wt extends jt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class Xt extends jt{constructor(t){super(t,B,"clipPath");const e=this._id=C.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Ut extends Xt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new jt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=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 Zt extends jt{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class qt extends Xt{constructor(t){super(t),this.add(this._circle=new jt(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class Kt{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._hideFeedback()}finally{this._doCanceled()}}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 Qt,Jt,te;t.TextAnchor=void 0,(Qt=t.TextAnchor||(t.TextAnchor={})).START="start",Qt.MIDDLE="middle",Qt.END="end",t.TextLayout=void 0,(Jt=t.TextLayout||(t.TextLayout={})).TOP="top",Jt.MIDDLE="middle",Jt.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(te||(te={}));class ee extends jt{constructor(e,s=void 0){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._overflow=te.WRAP,this._dirty=!0,this._text="",this.anchor=t.TextAnchor.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.72*t}layoutText(e){const s=this.getBBox(),i=this.getAscent(isNaN(e)?s.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(i/2);break;case t.TextLayout.BOTTOM:r=0;break;default:r=Math.ceil(i)}this.y=r}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=y(0,t),(e=f(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,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);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(Rt.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 se="$_TH",ie="$_TW";class re{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]?yt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=s[3]?Bt.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),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),B),0===this._literals[2].length&&(this._literals[2]=B)}else this._literals.push(r,n,B,B);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class ne extends re{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 oe extends ne{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 ae={t:class extends ne{tag(){return"</t>"}},b:class extends ne{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends ne{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:oe};class he{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 re).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 ae){const e=t.indexOf(">",i+2);if(e>=0){const n="</"+s+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(i,o+n.length);r=(new ae[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 le=/<br.*?>|\r\n|\n/;class _e{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(t,s,r,n,o){const a=t.doc,h=x(this.lineHeight,1),l=this._lines,_=l.length,c=[],u=[];t.clearDom(),n=n||t;const d=t.getStyle("writing-mode"),p=d===ht||d===lt;for(let s=0;s<_;s++){const r=l[s];let d=0,g=0,m=null;for(let[h,l]of r.words.entries()){const c=0===s&&0===h,u=s===_-1&&h===r.words.length-1,f=l.prepareSpan(t.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=c&&t.prefix||"",s=u&&t.suffix||"";f.textContent=e+(f.textContent||"")+s}const b=f.getBBox();if(f[ie]=b.width,f[se]=b.height,p?(d=y(d,f[ie]),g+=f[se]):(d+=f[ie],g=y(g,f[se])),m||(m=f),l instanceof oe){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(f),t.appendDom(s)}}u.push(m),r[se]=g*h,r[ie]=d*h,c.push(0==s?r[ie]/2:r[ie])}if(_>0){let e=l[0];for(let s=1;s<u.length;s++)if(u[s]){let i=0,r=0;if(p?null!=u[s-1]&&(i=Math.floor(e[ie]-t.getAscent(e[ie]))+t.getAscent(l[s][ie])):r=e[se]-t.getAscent(e[se])+t.getAscent(l[s][se]),null==u[0]&&u[s]==u.find((t=>null!=t))){const r=t.insertElement(a,"tspan",u[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[ie]=n.width,r[se]=e[se]=n.height,u[0]=r}switch(d){case ht:u[s].setAttribute("dx",String(i)),u[s].setAttribute("y","0");break;case lt:u[s].setAttribute("dx",String(-i)),u[s].setAttribute("y","0");break;default:u[s].setAttribute("x","0"),u[s].setAttribute("dy",String(r))}e=l[s]}if(p){const e=t.parent.dom.classList.contains("rct-annotation"),s=t.getBBox().width,[i]=u,r=i[ie];if(e)i.setAttribute("dx",String(d===lt?s-r/2:r/2));else switch(d){case ht:i.setAttribute("x",String((s-r)/-2));break;case lt:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][se])}}layout(e,s,i,r,n){const o=e.getBBox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===ht||l===lt)switch(a=n.left+(i-n.left-n.right-o.width),s){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,s){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(i-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=i-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(le);for(let t of s)e.push((new he).parse(t))}}}class ce{constructor(t){this.source=t}hasDef(){return!0}}class ue extends ce{_setStops(t,s){s.setAttribute("id",this.source.id);const i=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=r(i)?[...i]:[i,"white"],a=r(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(t,s,i,r,n){const o=t.createElementNS(e,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(t,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class de extends ue{getEelement(t,s){const i=t.createElementNS(e,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}de.TYPE="lineargradient";class pe extends ue{getEelement(t,s){const i=t.createElementNS(e,"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(t,i),i}}pe.TYPE="radialgradient";class ge extends ce{prepare(){}getEelement(t,s){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,h,l,c,u=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rct-pattern"),+s.pattern>=0){const t=ge.STOCK[+s.pattern%ge.STOCK.length];a=t.path,h=t.style,u=!t.fill,l=t.width||20,c=t.height||20}else o(s.pattern)&&(a=s.pattern,l=s.width||s.height||20,c=s.height||s.width||20);r.setAttribute("width",String(l)),r.setAttribute("height",String(c)),n.setAttribute("d",a),h&&_(n.style,h),s.style&&_(n.style,s.style),u&&(n.style.fill="none");let d=s.backgroundStyle;if(o(d)||i(d)){const s=t.createElementNS(e,"rect");r.append(s),s.style.fill=o(d)?d:d.fill,s.setAttribute("width",String(l)),s.setAttribute("height",String(c))}return r.append(n),r}}ge.TYPE="pattern",ge.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 me extends ce{prepare(){const t=this.source;this._colors=r(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&C.shuffle(this._colors),this._index=0)}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=r(e.colors)?e.colors:[]}}me.TYPE="colors";class fe extends ce{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(o(e))this._images.push(t+e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||fe.SIZE,height:e.height||e.width||fe.SIZE})}}fe.TYPE="images",fe.SIZE=20;class ye{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],r(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(jt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}prepareRender(){this._items.forEach((t=>{t.prepare()}));for(const t in this._map)this.get(t).prepare()}get options(){return this._items.map((t=>t.source))}$_loadItem(t){if(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ge.TYPE:r(t.colors)?e=me.TYPE:r(t.images)&&(e=fe.TYPE)),e)switch(e.toLowerCase()){case de.TYPE:return new de(t);case pe.TYPE:return new pe(t);case ge.TYPE:return new ge(t);case me.TYPE:return new me(t);case fe.TYPE:return new fe(t)}}}}let be=0;const xe=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=["__proto__","constructor","prototype"],ve=function(t,e){const s=i(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!we.includes(t)){const n=e[t];r(n)?s[t]=n.slice(0):n instanceof Date?s[t]=new Date(n):i(n)?s[t]=ve(s[t],n):s[t]=n}return s};class Se extends T{constructor(t){super(),this.chart=t,be++}init(){const t=this._op=ve({},this.constructor.defaults);this._doInit(t),this._doApply(t);const e={};return this._doInitChildren(e),this._children=Object.keys(e),this._children.length>0&&_(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])})),ve(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 Se)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 Se?this[t]._doSetSimple(!l(i)||!i):(s[t]=!l(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,e=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Se)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;s.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),e&&this._changed()}return this}clearOptions(t=!0){const e=function(t){if(t){const s=t._op=ve({},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 s in e)if(e.hasOwnProperty(s)){let n=e[s];this._doLoadProp(s,n)||(this[s]instanceof Se?t[s]=this[s]._load(n):r(n)?t[s]=n.slice(0):n instanceof Date?t[s]=new Date(n):i(n)?t[s]=_({},n):t[s]=n)}}_doSave(t,e,s){const i=this._op;for(const n in i)if(i.hasOwnProperty(n))if(s&&this[n]instanceof Se)t[n]=this[n].saveOptions(!0);else{const s=i[n];r(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(l(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`]=q(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 s=t[e];this._doLoadProp(e,s)||(this[e]instanceof Se?this[e].updateOptions(s):r(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):i(s)?this[e]=_({},s):this[e]=s)}}_doPrepareRender(t){}}Se.REFRESHED="refreshed",Se.defaults={visible:!0};class Ve{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 Pe extends Se{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?yt.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 _e),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return o(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(C.isValidNum(t)){const i=this._numSymbols&&e&&C.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=o(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}}Pe.defaults=xe(Se.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Ae extends Pe{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 fe&&(this._images=e)}this._root=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),r=Number.isFinite(+i)?+i:i;return s instanceof fe?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}Ae.defaults=xe(Pe.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Ce extends Se{}const ke={};class Le extends Se{static register(...t){t.forEach((t=>{ke[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}needClip(){return!0!==this._op.noClip}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 o=+i.x1,a=+i.x2,h=+i.y1,l=+i.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(o)){const i=this.chart.xAxis;s?this._y=e-i.getPos(e,o):this._x=i.getPos(t,o),isNaN(a)||(s?n=this._h=e-i.getPos(e,a)-this._y:r=this._w=i.getPos(t,a)-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=Q(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=Q(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,s,i,r,n,o){let a,h,l;if(isNaN(h=this._x))switch(a=this.getOffset(n,o),h=e,this._op.align){case"center":h+=(i-n)/2+a.x;break;case"right":h+=i-a.x-n;break;default:this._anchorObj?h+=(i-n)/2+a.x:h+=a.x}else a=a||this.getOffset(n,o),h=this._x+a.x;if(isNaN(l=this._y))switch(a=a||this.getOffset(n,o),l=s,this._op.verticalAlign){case"middle":l+=(r-o)/2-a.y;break;case"bottom":l+=r-a.y-o;break;default:l+=a.y}else a=a||this.getOffset(n,o),l=this._y+a.y;return{x:h,y:l}}refresh(){this._changed(Se.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(o(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){}}Le.defaults=xe(Se.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Ne extends Ve{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 Le)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t,e){const s=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach(((t,i)=>{n.push(this.$_loadItem(s,t,i,e))})):i(t)&&n.push(this.$_loadItem(s,t,0,e)),n.forEach((t=>{t.name&&(o[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):B}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=o(e.imageUrl)?"image":o(e.shape)?"shape":"text");const n=t._getAnnotationType(r);if(!n)throw new Error("Invalid annotation type: "+e.type);const a=new n(t,i);return a.init(),a.index=s,a._load(e),a}}class Ee extends Se{}Ee.defaults=xe(Se.defaults,{minWidth:50});class Me extends Se{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new Ee(this.axis.chart)).init(),this._args={chart:void 0,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?Bt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):yt.getFormatter(this._op.numberFormat).toStr(s)}moved(t,e,s){this._op.onChange&&(this._args.chart=this.chart.wrapper,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 n(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}Me.defaults=xe(Se.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Te={};class Oe extends Se{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Be extends Oe{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return o(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Be.defaults=xe(Oe.defaults,{visible:void 0});class Re extends Oe{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 o(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)}}Re.defaults=xe(Oe.defaults,{align:"middle",offset:0,gap:5});class De extends Oe{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 o=1;o<r.length;o++,n++)e[n%s]&&i.push({axis:t,from:r[o-1].value,to:r[o].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 o(t)?(this._op.colors=[t,null],!0):r(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Fe extends Oe{_doInitChildren(t){t.rows=(this._rows=new De(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}}Fe.defaults=xe(Oe.defaults,{visible:void 0});class ze extends Ae{getDefaultIconPos(){return"left"}}ze.defaults=xe(Ae.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class $e extends Oe{_doInitChildren(t){t.label=(this._label=new ze(this.axis.chart)).init()}get label(){return this._label}canConstainedTo(t,e){const s=this._op;if(r(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(r(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}$e.defaults=xe(Oe.defaults,{front:!1,zindex:0});class Ie extends $e{}class Ge extends $e{}class He extends Oe{canUseNumSymbols(){return!0}_doSetSimple(t){return C.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}}He.defaults=xe(Oe.defaults,{visible:!1,length:7,gap:3});class je extends Ae{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?v(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?v(i.firstText,i.text):r==e-1?v(i.lastText,i.text):i.text}getLabelStyle(t,e){const s=this._op,r=t.index;if(s.styleCallback){const e=s.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(i(e))return e}return 1==e?s.lastStyle||s.firstStyle:0==r?s.firstStyle:r==e-1?s.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}_getText(t,e,s,i){return o(t)?t:this._getNumberText(e,s,i)||e}}je.defaults=xe(Ae.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class Ye extends Oe{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)}}Ye.defaults=xe(Oe.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class We{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:y(this.min,f(this.max,t)))>(e=isNaN(e)?this.end:y(this.min,f(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 Xe extends Be{}class Ue extends Se{static register(...t){t.forEach((t=>{Te[t.type]=t,t.subtype&&(Te[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 Re(this)).init(),t.line=(this._line=new Be(this)).init(),t.sectorLine=(this._sectorLine=new Xe(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 Me(this)).init(),t.scrollBar=(this._scrollBar=new Ye(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 F+z*x(this._op.startAngle,0)}getTotalAngle(){return z*y(0,f(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}getConnectableSeries(){const t=[];return this._series.forEach((e=>{e.connectable(this)&&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)}))}collectReferentValues(){this._series.forEach((t=>{t.prepareReferents(this)})),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){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=!C.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)))}polarOff(){return 0}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+C.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[y(t,this._min),f(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new We(this),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 r&&(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}getXLabel(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 e=this,i=this.guides,n=function(t){var s;t!==e._guides&&(e._guides=t,s=r(t)?t:[t],i.length=0,s.forEach((t=>{let s;s="range"===t.type?new Ge(e):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new Ie(e):new Ge(e),s.init(),s._load(t),i.push(s)})))};super._doApply(t),this._name=t.name||`Axis ${this._index+1}`,s.call(t,"guide")?n(t.guide):s.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?H(f(...t)||0):NaN,max:t.length>0?H(y(...t)||0):NaN}}}Ue.defaults=xe(Se.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 Ze extends Ve{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;r(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 o(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()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}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 h(i)&&i>=0&&i<e.length?r=e[i]:o(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 i;let n=t._getAxisType(e.type);if(!n){let o;if(r(e.categories))o="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){o="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){o=void 0;break}if(t.options.xAxis===s){o=void 0;break}if(W(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(i=t._getSeries().first)||void 0===i?void 0:i.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o.init(),o._load(e),o._index=s,o._isPolar=t.isPolar(),o}}class qe extends Se{_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:Q(this._widthDim||this._sizeDim,t,t),height:Q(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return Q(this._leftDim,t)}getRight(t){return Q(this._rightDim,t)}getTop(t){return Q(this._topDim,t)}getBottom(t){return Q(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=xe(qe.defaults,{size:"100%"});class ts 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}}ts.defaults=xe(Je.defaults,{duration:500});class es 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),s.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 s=this._gaugesType();r(e)?e.forEach(((e,i)=>this.$_add(ts._loadGauge(t,e,s)))):i(e)&&this.$_add(ts._loadGauge(t,e,s))}$_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)}}es.defaults=xe(Je.defaults,{minValue:0});class ss extends Ve{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 ts)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],n=this._map={};r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof es)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){if(0===Object.keys(Ke).length&&0===Object.keys(Qe).length)throw new Error("The gauge feature cannot be used without the required 'gauge' module. For installation and usage instructions, please visit: https://www.realchart.co.kr/guide/modules");let i=r(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i||(i=t._getGaugeType(e.type||t.gaugeType)),!i)throw new Error("Invalid gauge type: "+e.type);const n=new i(t);return n.init(),n._load(e),n.index=s,n}}class is extends ts{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}}}is.defaults=xe(ts.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class rs extends Se{constructor(t){super(t.chart),this.scale=t}}rs.defaults=xe(Se.defaults,{reversed:!1,length:7});class ns extends Ae{getText(t){return C.isValidNum(t)?this._getText(null,t,b(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class os extends Se{constructor(t){super(t.chart),this.gauge=t}_doInitChildren(t){const e=this.chart;t.line=(this._line=new Se(e)).init(),t.tick=(this._tick=new rs(this)).init(),t.label=(this._label=new ns(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(f(e,s),y(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(y(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=f(t,e),this._max=y(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=f(...t)),isNaN(i)&&(i=y(...t)),this._min=f(s,i),this._max=y(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(H(e));for(let e=1;e<t;e++)n.push(H(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 o=n/(Math.floor(t/e)+1-1);const a=Math.pow(10,Math.floor(Math.log10(o))),h=this._getStepMultiples(a);let l,_=0;if(o/=a,h)if(o>h[_]){for(;_<h.length-1;_++)if(o>h[_]&&o<h[_+1]){o=h[++_];break}}else o=h[_];for(o*=a,this._step=o,r.push(H(l=s));;){if(l+=o,l>=i){r.push(H(i));break}r.push(H(l))}return r}}os.defaults=xe(Se.defaults,{position:"default",stepPixels:48,gap:8});class as extends Se{}as.defaults=xe(Se.defaults,{visible:!1});class hs extends Se{constructor(t){super(t.chart),this.gauge=t}_doInitChildren(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new as(e)).init(),t.tickLabel=(this._tickLabel=new Se(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?Q(this._thicknessDim,t,0):"inside"===this._op.position?t:hs.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=nt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}hs.defaults=xe(Se.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class ls extends Pe{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}ls.defaults=xe(Pe.defaults,{animatable:!0});class _s extends ls{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:Q(this._offsetXDim,t,0),y:Q(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}_s.defaults=xe(ls.defaults,{offsetX:0,offsetY:0});class cs{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(us.DEF_CENTER),this.setCenterY(us.DEF_CENTER),this.setRadius(us.DEF_RADIUS),this.setInnerRadius(us.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=q(v(t,us.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=q(v(t,us.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=q(v(t,us.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=q(v(t,us.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=q(t,!0))}getCenter(t,e){return{x:Q(this._centerXDim,t,t/2),y:Q(this._centerYDim,e,e/2)}}getExtents(t){const e=Q(this._radiusDim,t,t/2),s=f(e,this._innerDim?Q(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?Q(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=x(t%360,0),i=y(0,f(360,x(e,360)));this._startRad=F+z*s,this._handRad=z*s,this._sweepRad=z*i}}class us extends is{_doInit(t){this._props=new cs}_doInitChildren(t){t.label=(this._label=new _s(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 cs)}_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)}}us.DEF_CENTER="50%",us.DEF_RADIUS="40%",us.DEF_INNER="80%",us.defaults=xe(is.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class ds extends es{_doInit(t){this.props=new cs}_doInitChildren(t){t.label=(this._label=new _s(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)}}ds.defaults=xe(es.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let ps=class extends Se{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};ps.defaults=xe(Se.defaults,{visible:void 0});class gs extends Pe{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||gs.DEF_TEXT}}gs.DEF_TEXT="표시할 데이터가 없습니다.",gs.defaults=xe(Se.defaults,{visible:void 0});class ms extends Se{constructor(t){super(t),this._annotations=new Ne(this)}_doInitChildren(t){t.image=(this._image=new Ce(null)).init(),t.emptyView=(this._emptyView=new gs(this.chart)).init(),t.zoomButton=(this._zoomButton=new ps(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof Je&&this.contains(s)?s: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)}getRadius(t,e){return Q(this._radiusDim,f(t,e))}setPolar(t,e){return this._cx=Q(this._centerXDim,t),this._cy=Q(this._centerYDim,e),this._rd=Q(this._radiusDim,f(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 e=this,i=function(t){t!==e._anns&&(e._anns=t,e._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),s.call(t,"annotation")?i(t.annotation):s.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}ms.defaults=xe(Se.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class fs extends Se{constructor(){super(...arguments),this._isCompose=!1}isCompose(){return this._isCompose}compose(t){this._isCompose||(this._module=t,this._isCompose=!0)}isContextMenuVisible(){return this._module&&this._module.isContextMenuVisible()}toggleContextMenu(){this._module&&this._module.toggleContextMenu()}exportToImage(t,e,s){this._module&&this._module.exportToImage(t,e,s)}}fs.defaults=xe(Se.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class ys extends Se{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 Q(this._maxWidthDim,t,t)}getMaxHeight(t){return Q(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=v(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=xe(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 xs={inOutSine:t=>-(d(R*t)-1)/2},ws=function(t,e,s,i,r,n){const o=Z(e,null!=s?s:"initial"),a=Z(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class vs{constructor(){this.delay=0,this.duration=vs.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=f(1,y(0,H(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,vs.DURATION),this.delay=e||0,this._easing=xs[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}}vs.DURATION=700,vs.SHORT_DURATION=300;const Ss={CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle",VLINE:"vline",HLINE:"hline",LINE:"line"},Vs=Object.values(Ss),Ps=.001,As=Math.PI;class Cs{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 o=i>0,a=o?0:1;return r>0?n>0?(r=f(b(i)/2,s/2,r),n=f(b(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=f(b(i)/2,s/2,r),["M",t,e,"v",i+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",s-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-i-r,"Z"]):n>0?(n=f(b(i)/2,s/2,n),["M",t,e+(o?n:-n),"v",i+(o?-n:+n),"h",s,"v",-i+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-s,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=f(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,o,a=!1){const h=G(b(n-r)),l=2*As-h<.01,_=h-As<.01?0:1,c=o?1:0,u=d(r),g=p(r),m=d(n-=l?c?Ps:-.001:0),f=p(n),y=[];return y.push("M",t+s*u,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*f),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,s,i,r,n,o,a){const h=G(b(o-n)),l=2*As-h<Ps;let _=h-As<Ps?0:1;const c=a?1:0,u=d(n),g=p(n),m=d(o-=l?c?Ps:-.001:0),f=p(o),y=s*r,x=i*r,w=[];return w.push("M",t+s*u,e+i*g,"A",s,i,0,_,c,t+s*m,e+i*f),l?w.push("M",t+y*m,e+x*f):w.push("L",t+y*m,e+x*f),isNaN(y)||w.push("A",y,x,0,_,1-c,t+y*u,e+x*g),w.push("Z"),w}static sectorPolygon(t,e,s,i,r,n,o,a){const h=[],l=G(b(o-n)),_=2*As-l<Ps,c=a?1:0,u=d(n),g=p(n),m=d(o-=_?c?Ps:-.001:0),f=p(o),y=s*r,x=i*r;return h.push([t+s*u,e+i*g]),h.push([t+s*m,e+i*f]),h.push([t+y*m,e+x*f]),h.push([t+y*u,e+x*g]),h}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,o=e+i/2+(i/2-i/2*p(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,u=c/2,g=[];g.push("M",n+a*d(r),o+h*p(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*p(r),"L",n+l*d(r+u),o+_*p(r+u)),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=Cs[e](0,0,2*s,2*i);break;default:r=Cs.circle(s,i,f(s,i))}t.setPath(r)}}class ks extends jt{static create(t,e,s,i,r,n,o=0){return new ks(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=B,s=B){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...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 Ls extends Zt{constructor(t,e=B){super(t,e)}setBox(t,e,s,i){return this.setPath(Cs.box(t,e,s,i)),this}}const Ns="none",Es="near",Ms="displayAll",Ts="largestFirst",Os="hidden",Bs="line",Rs="area",Ds="circlebar";let Fs=0;const zs="_deleted";class $s{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=Fs++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}isEmpty(){return!1}copy(){return{...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:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?(this._readObject(t,e),(r(e.drillDown)||i(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}getPointIcon(t){return this.icon}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getParam(t){var e,s,i;const r=this.source||{};if("value"===t)return null!==(e=r[t])&&void 0!==e?e:this.getValue();if(t.indexOf(".")>0){const e=t.split(/\./g);let i=null!==(s=this[e[0]])&&void 0!==s?s:r[e[0]];for(let t=1;t<e.length;t++)i=i[e[t]];return i}return null!==(i=this[t])&&void 0!==i?i:r[t]}_setDeleted(){this._prev=this.copy(),this[zs]=!0}_isDeleted(){return this[zs]}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):r(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=B}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return _(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,i=+t.options.iconField;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]),isNaN(i)||(this.icon=e[i])}_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=S(t._yFielder(e),e.y,e.value),this.color=v(t._colorFielder(e),e.color),this.icon=v(t._iconFielder(e),e.icon),this.yLabel=e.yLabel,this.labelOptions=e.labelOptions}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class Is{constructor(t){this._points=[],this._owner=t}get owner(){return this._owner}get count(){return this._points.length}isEmpty(){return this._points.length<1}get(t){return this._points[t]}pointAt(t,e){function s(t,e,s){return i(t)?t.pid===e:t===s}return this._points.find((i=>s(t,i.pid,i.xValue)&&(void 0===e||s(e,i.pid,i.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){r(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}clean(){this._points=this._points.filter((t=>!t[zs]))}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++);}getRunPoints(t,e){const s=this._points,i=t._zoom;if(this._owner.needAxes()&&i){s.length;let e=i.start,r=i.end;if(t.continuous())return s.filter((t=>t.xValue>=i.start&&i.end>=t.xValue)).slice(0);{const t=s.find((t=>!isNaN(s[0].xValue)));if(t){const s=t.xValue,i=Math.ceil(r-e);e=Math.floor(e),r=Math.min(r,e+i),e-=s,r-=s}}return s.slice(e,r+1)}return s}}class Gs extends $s{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return _(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=v(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 Hs extends $s{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 _(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[w(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=v(e[t.options.lowField],e.low),this.y=S(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 js extends He{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}js.defaults=xe(He.defaults,{step:1});class Ys extends je{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 Ws extends Fe{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,o=e.length;t<=s&&n<o;t++,n+=r)i.push(e[n]);else for(let t=0;t<=s;t++)i.push(e[t+1])}return i}}class Xs extends Ue{constructor(){super(...arguments),this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}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}polarOff(){return.5}_createGrid(){return new Ws(this)}_createTickModel(){return new js(this)}_createLabel(){return new Ys(this)}collectValues(){this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=C.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){var t;let e=super.getStartAngle(),s=+this._op.startOffset;return s>0&&(e-=f(s,1)*((null===(t=this._categories[0])||void 0===t?void 0:t.w)||1)*D/this._catLen),e}_doPrepareRender(){const t=this._op;this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=w(t.minPadding,t.padding,0),this._maxPad=w(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._categories.map((t=>t.c)),n=this._weights=this._categories.map((t=>t.w));const o=this._tick.options.step||1,a=[],h=t,l=e;if(this._zoom){const s=Math.ceil(e-t);t=Math.floor(t),e=Math.min(e,t+s)}else t=Math.floor(t+.5),e=Math.ceil(e-.5);this._catMin=t;let _=this._catLen=Math.floor(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+=o){const s=t+e-1,r=this._categories[t+e-1];a.push({index:e-1,pos:NaN,value:s,label:i.getTick(e-1,r?r.t:s)})}return this._setMinMax(h,l),a}_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*z;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);const s=this._pts;for(let t=1;t<s.length-1;t++)if(e>=s[t]&&s[t+1]>=e)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 h(t)?t:this._map[t]}getXLabel(t){var e;return(null===(e=this._categories[t])||void 0===e?void 0:e.c)||t}_doCalculateRange(t){const e=super._doCalculateRange(t);return this._isX||(e.min=f(0,e.min),e.max=y(0,e.max)),e}$_collectCategories(t){const e=this._op.categories,s=this._categories=[];if(r(e)&&e.length>0)this._len=0,e.forEach((t=>{const e=null==t?1:x(t.weight,1),r=t&&t.icon;let n,o;null==t?o=n=null:i(t)?(n=v(t.name,t.label),o=v(t.label,t.name)):o=n=String(t),this._len+=e,s.push({c:n,t:o,w:e,i:r})}));else if(r(t)){let e=[];if(this._op.weightSeries&&this._op.weightField){const t=this.chart.seriesByName(this._op.weightSeries);t&&r(t.data)&&t.data.forEach((t=>{const s=t[this._op.weightField];C.isNumber(s)&&s>=0?e.push(s):e.push(1)}))}for(const i of t){i.collectCategories(this).forEach(((t,i)=>{s.find((e=>e.c===t))||s.push({c:t,w:e[i]||1,t:t})}))}}this._map={},s.forEach(((t,e)=>{null!=t.c&&(this._map[t.c]=e)}))}}var Us;Xs.type="category",Xs.defaults=xe(Ue.defaults,{padding:0,categoryPadding:.1,startOffset:0});const Zs={},qs={};class Ks extends Ae{_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>this._point.getParam(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 C.isValidNum(t)?this._getText(null,t,b(t)>1e3,!0):t}getOffset(){return x(this._op.offset,0)}getDefaultIconPos(){return"top"}_isVisible(){return this._op.visible||n(this._op.visibleCallback)}_doSetSimple(t){return n(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Us=Ks,Ks.OFFSET=5,Ks.defaults=xe(Ae.defaults,{visible:void 0,position:"auto",offset:Us.OFFSET});class Qs extends Se{constructor(t){super(t.chart),this.series=t}_doPrepareRender(t){const e=this.series,s=this._res=(e._visPoints.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._visPoints.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 o=e*n-s*s,a=0===o?0:(e*r-s*i)/o;return{m:a,a:(i-a*s)/e}}_linear(t,e){const s=t.length;if(s>1){const{m:i,a:r}=this._calcLine(t);this._polar?e.push(...t.map((t=>({x:t.x,y:i*t.x+r})))):e.push({x:t[0].x,y:i*t[0].x+r},{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),o=t[0].x,a=t[s-1].x,h=(a-o)/this._res;for(let t=o;t<=a;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),o=Math.exp(n),a=t[0].x,h=t[s-1].x,l=(h-a)/this._res;for(let t=a;t<=h;t+=l){const s=o*t**r;e.push({x:t,y:s})}}}_calcLine2(t){t.length;let e=0,s=0,i=0,r=0,n=0,o=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),o+=t.x*t.y}));const a=s*i-o*o,h=Math.exp((i*r-o*n)/a);return{m:(s*n-o*r)/a,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),o=n,a=t[0].x,h=t[s-1].x,l=(h-a)/this._res;for(let t=a;t<=h;t+=l){const s=o*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,o=0;const a=2+1;for(let e=0;e<a;e++){for(let i=0;i<s;i++)n+=t[i].x**e*t[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=t[r].x**(e+i);h.push(o),o=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++)b(s[t][r])>b(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,a),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*t**i),0);e.push({x:t,y:s})}}}_movingAverage(t,e){const s=t.length,i=y(1,f(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++}}}Qs.defaults=xe(Se.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2});const Js={x:"xValue",y:"yValue",z:"zValue"};class ti extends vs{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 ei extends vs{constructor(t){super(),this.points=t,this.duration=300,this.endHandler=()=>{this.points.clean(),this.points.owner._dataPointsChanged(),this.points.owner.$_stopDeleteAni(this)},t.owner.$_setDeleteAni(this)}_doUpdate(t){return this.points.forEach((e=>{e._isDeleted()&&(e._vr=1-t)})),this.points.owner._changed(),!0}}class si extends $s{}class ii extends Se{constructor(){super(...arguments),this._row=0,this._col=0,this.index=-1,this.seriesIndex=0,this._simpleMode=!1}static register(...t){t.forEach((t=>{Zs[t.type]=t}))}static _loadSeries(t,e,s,i){let r=t._getSeriesType(s.type);if(!r&&s.type&&console.error(`Unknown series type: '${s.type}'`),!r&&(r=t._getSeriesType(i||t.type),!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.getParam(s)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[s]);default:return e.getParam(s)}}_doInit(t){this._points=new Is(this),this._pointArgs={},this._paletteColors=Array(12).fill(0).map(((t,e)=>e));const{paletteMode:e}=this.chart.options.options;e==ot&&C.shuffle(this._paletteColors)}_doInitChildren(t){t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){C.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){C.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){C.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){C.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 ii.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 points(){return this._runPoints.slice(0)}get visiblePointCount(){return this._visPoints.length}get visiblePoints(){return this._visPoints.slice(0)}get canPolar(){return!1}getVisiblePoint(t){return this._visPoints[t]}contains(t){return this._points.contains(t)}getPoints(){return this._points}_getLabeledPoints(){return this._visPoints}getPointsByRange(t,e){const s=[];return this._points.forEach((i=>{e>=i.xValue&&i.xValue>=t&&s.push(i)})),s}_getVisiblePoints(){return this._points.getRunPoints(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}connectable(t){return!1}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){if(t._zoom)return t instanceof Xs?Math.floor(t._zoom.start):t._zoom.start;{const e=t.getValue(this._op.xStart);return(isNaN(e)?t.getValue(this.chart._chartOptions.getXStart(t)):e)||0}}$_getXStep(t){var e;return null!==(e=v(this._op.xStep,this.chart._chartOptions.options.xStep))&&void 0!==e?e:1}_buildVisPoints(t){return t.filter((t=>!1!==t.visible))}_prepareRunPoints(t,e){this._runPoints=this._points.getRunPoints(t,e),this.visible&&!this._referents?this._visPoints=this._buildVisPoints(this._runPoints):this._visPoints=null}_dataSourceChanged(){const t=this._doLoadData(this._data);this._loadPoints(t)}_prepareRender(){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&&(this._dataSourceChanged(),this._dataSourceDirty=!1),this._prepareRunPoints(this._xAxisObj,this._yAxisObj),this._pointLabel._prepareRender(),super._prepareRender()}prepareAfter(){this._pointsChanged=!1}collectCategories(t){if(t instanceof Xs){let e=t.options.categoryField;return null!=e?this._points.getProps(e):this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);o(i)&&(i=i.trim()),this._runPoints.forEach(((r,n)=>{let o=t.getValue(r.x);isNaN(o)&&(o=s,s=t.incStep(s,i)),isNaN(o)?r.isNull=!0:(r.xValue=o,e&&!1!==r.visible&&e.push(o))}))}else this._runPoints.forEach(((s,i)=>{if(s.isNull)s.y=s.yGroup=s.yValue=NaN;else{let i=null==s.y?NaN:t?t.getValue(s.y):+s.y;isNaN(i)&&(i=null==t?void 0: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&&!1!==s.visible&&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,r=this.hasZ();let n=s[0],o=n.xValue,a=o,h=n.yValue,l=h,_=r?n.zValue:null,c=_;n.vindex=0;for(let t=1;t<i;t++)n=s[t],n.vindex=t,isNaN(l)&&!isNaN(n.yValue)?h=l=n.yValue:n.yValue>l?l=n.yValue:n.yValue<h&&(h=n.yValue),isNaN(a)&&!isNaN(n.xValue)?o=a=n.xValue:n.xValue>a?a=n.xValue:n.xValue<o&&(o=n.xValue);if(r)for(let t=1;t<i;t++){const e=s[t].zValue;isNaN(c)&&!isNaN(e)?_=c=e:e>c?c=e:e<_&&(_=e)}if(this._minY=h,this._maxY=l,this._minX=o,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,r&&(t.zMin=this._minZ=_,t.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),!isNaN(this._minY)&&t&&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=nt(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=B}))}prepareReferents(t){this._referents&&this._referents.forEach((e=>e.visible&&e.refer(this,t))),this.visible&&!this._visPoints&&(this._visPoints=this._buildVisPoints(this._runPoints))}refer(t,e){}getLegendSources(t){!1!==this._op.visibleInLegend&&t.push(this)}getLabelPos(t){return this._getLabelAutoPos(t,t.options.position)}_getLabelAutoPos(t,e){return e}getLabelPos2(t,e){return this._labelPosCallback?this._getLabelAutoPos(t,this._labelPosCallback(this._getPointCallbackArgs(this._pointArgs,e))):this._labelPos}getLabelOff(t){return t}getLabelOff2(t){return this._labelOffCallback?x(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Ks.OFFSET):this._labelOff}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.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),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()}isLabelsVisible(){return this._pointLabel.visible}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 o(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:B}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e){if(t instanceof $s||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&this.chart.animatable()&&(s.ani=new ti(this,t),s.ani.start()),this._dataPointsChanged(),!!s}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}addPoint(t){const e=this._doAddPoint(t);if(e){if(this._points.add(e),this.chart.animatable()){const t=e._prev=e.copy();t.ani=new ti(this,e),t.ani.start()}this._dataPointsChanged()}return e}addPoints(t){const e=[];return r(t)&&t.forEach((t=>{const s=this._doAddPoint(t);s&&e.push(s)&&this._points.add(s)})),e.length>0&&(this.chart.animatable()&&e.forEach((t=>{const e=t._prev=t.copy();e.ani=new ti(this,t),e.ani.start()})),this._dataPointsChanged()),e}_needDeleteAnimation(){return!1}removePoint(t){if(t instanceof $s||(t=this.getPointAt(t)),t){if(this._points.contains(t)&&this._needDeleteAnimation()&&this.chart.animatable())return t._setDeleted(),new ei(this._points).start(),this._changed(),!0;if(this._points.remove(t))return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePoints(t){if(r(t)){const e=this._needDeleteAnimation()&&this.chart.animatable(),s=[];if(t.forEach((t=>{t instanceof $s||(t=this.getPointAt(t)),t&&(e?(t._setDeleted(),s.push(t)):this._points.remove(t)&&s.push(t))})),s.length>0)return e?(new ei(this._points).start(),this._changed()):(this._doPointsRemoved(s),this._dataPointsChanged()),s.length}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 Ks(t)}_createPoint(t){return new si(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 ks.create(t,ii.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField","iconField"]}_createFielder(t){return n(t)?e=>t(e):null!=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(r(t))return t;if(t){let e;if(t._obj instanceof ct)e=t._obj;else if(t instanceof ct)e=t;else if(Number.isFinite(t)||i(t)||l(t))return[t];if(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=h(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%12+1)})`:t.color;let s,i;r(t.pointColors)?s=t.pointColors:o(t.pointColors)?i=this.chart._assets.get(t.pointColors):this._colorByPoint()&&(s=this.chart.options.options.colors),i instanceof me?this._runPoints.forEach(((t,s)=>{t.color=t.color||i.getNext()||e})):r(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),this._labelPosCallback=P(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=P(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_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=B}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDeleteAni(t){this._deleteAni&&this._deleteAni.stop(),this._deleteAni=t}$_stopDeleteAni(t){this._deleteAni===t&&(this._deleteAni=null)}isDeleting(){return!!this._deleteAni}}ii.LEGEND_MARKER="rct-legend-item-marker",ii.defaults=xe(Se.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}:<b> ${yValue}</b>",loadAnimation:"default",hoverEffect:"default",interactive:!0});class ri extends Ve{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)}_internalSeries(){return this._series}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))}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof fi&&e.series[0]._type()===t)return e.series[0]}}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}canPolar(){return this._series.length>0&&this._series.every((t=>t&&t.canPolar))}load(t){const e=this.chart,s=this._items=[],n=this._series=[];r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{t instanceof fi?n.push(...t.series):t instanceof ii&&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 ii?e=t:o(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(Vs[e++%Vs.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=1===this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof di&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){let i=r(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r.init(),r._load(e),r.index=s,r}return ii._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof ci||(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 ni extends ii{_doInitChildren(t){super._doInitChildren(t),t.trendline=(this._trendline=new Qs(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}ni.defaults=xe(ii.defaults,{});class oi extends Se{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)}}oi.defaults=xe(Se.defaults,{radius:3});class ai extends $s{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendLabel(){return v(this.x,this.y)}styleLegendMarker(t){}isEmpty(){return 0===this.yValue}initPrev(t,e){e.yValue=0}getParam(t){const e=super.getParam(t);return null==e&&"name"===t?this.x:e}}class hi extends Se{}hi.defaults=xe(Se.defaults,{curved:!0});class li extends Ks{constructor(t,e=!1){super(t),this.isSub=e}_doInitChildren(t){super._doInitChildren(t),t.connector=(this._connector=new hi(this.chart)).init()}get connector(){return this._connector}getAlign(){return"near"===this._op.align?-1:"far"===this._op.align?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}li.defaults=xe(Ks.defaults,{visible:!0,convergable:!0,align:Ns,dedupeMode:Ms});class _i extends Se{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?Q(this._minDim,$s.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=_i.DEF_COUNT),(this._dirty=!s||s.value!==i||s.count!==r)&&(isNaN(i)||(t=t.filter((t=>t.y>=i))),r>0&&t.length>r&&(r>1&&r--,t=t.slice(0,r)),this._save={count:r,value:i}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=q(t.minValue,!0)}}_i.DEF_COUNT=10,_i.defaults=xe(Se.defaults,{visible:!1,x:"기타"});class ci extends ii{_doInitChildren(t){super._doInitChildren(t),t.subLabel=(this._subLabel=this._createLabel(this.chart)).init(),t.othersGroup=(this._othersGroup=new _i(this.chart)).init()}get subLabel(){return this._subLabel}get othersGroup(){return this._othersGroup}getCenter(t,e){return{x:Q(this._centerXDim,t),y:Q(this._centerYDim,e)}}_getLabelAutoPos(t,e){return"auto"===e?t.isSub&&"inside"===super.getLabelPos(this._pointLabel)?"outside":"inside":e}needAxes(){return!1}_colorByPoint(){return!0}getLegendSources(t){this._op.legendByPoint?!1!==this._op.visibleInLegend&&(this._groupedPoints||this._runPoints).forEach((e=>{this._isVisibleInLegend(e)&&t.push(e)})):super.getLegendSources(t)}_isVisibleInLegend(t){return t.yValue>=0&&(t.yValue>0||this._op.zeroInLegend)}_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=q(S(s,e._op.center,ci.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=q(S(i,e._op.center,ci.DEF_CENTER),!0))}canMinPadding(t,e){return!1}canMaxPadding(t,e){return!1}_dataSourceChanged(){super._dataSourceChanged(),this._groupedPoints=null}contains(t){return super.contains(t)||this._groupedPoints&&t===this._groupedPoints[this._groupedPoints.length-1]}_buildVisPoints(t){const e=this.othersGroup;if(e.visible){if(!this._groupedPoints&&(this._groupedPoints=e.calculate(t),t.length>this._groupedPoints.length)){const e=this._createOthersPoint({...this._op.othersGroup},t.slice(this._groupedPoints.length));e.parse(this),e.index=t.length,e.yValue=e.yGroup=e.y,this._groupedPoints.push(e)}t=this._groupedPoints}return super._buildVisPoints(t)}}ci.DEF_CENTER="50%",ci.defaults=xe(ii.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:ci.DEF_CENTER,centerY:ci.DEF_CENTER});class ui extends ci{getRadius(t,e){return Q(this._radiusDim,f(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=q(v(t._radius=e,ui.defaults.radius),!0))}(this,t.radius)}}ui.defaults=xe(ci.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class di extends ni{constructor(){super(...arguments),this._clusterWidth=1,this._clusterPos=0,this._childWidth=1,this._childPos=0,this._pointPad=0}groupWidth(){return this._op.pointWidth}getMinPointWidth(){return this._op.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,y(this._op.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}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._op.minPointWidth=x(this.getMinPointWidth(),0)}}di.defaults=xe(ii.defaults,{pointWidth:1,minPointWidth:0});class pi extends di{_doPrepareRender(){const t=this._op;super._doPrepareRender(),t.nullAsBase&&null!=t.baseValue&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),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}}pi.defaults=xe(di.defaults,{baseValue:0,nullAsBase:!1});class gi extends di{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach((t=>{const s=this._getBottomValue(t);e&&!isNaN(s)&&!1!==t.visible&&e.push(s)}))}}class mi extends gi{}class fi extends Se{constructor(){super(...arguments),this.index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{qs[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{qs[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("yValue","yValue."+s.index).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 o=t[n]._visPoints[s.vindex];o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),ii.getPointTooltipParam(e,s,i)}getTooltipText(t,e){return fi.collectTooltipText(this._op,this._visibles,e)}getTooltipParam(t,e,s){return fi.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}get visCount(){return this._visibles.length}_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)))}connectable(t){return!0}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)}))}prepareReferents(t){this._series.forEach((e=>e.prepareReferents(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),s.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=!C.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 s=this._seriesType();r(e)?e.forEach(((e,i)=>this.$_add(ii._loadSeries(t,this._series.length,e,s)))):i(e)&&this.$_add(ii._loadSeries(t,this._series.length,e,s))}$_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+(b(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,o=0;for(const e of t)e.yValue=(e.yValue||0)/r*i,e.yValue<s?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}fi.defaults=xe(Se.defaults,{layout:"default",layoutMax:100,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>"});class yi extends fi{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class bi extends fi{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}}bi.defaults=xe(fi.defaults,{groupWidth:1,groupPadding:.1});class xi extends ni{isMarker(){return!0}}xi.defaults=xe(ii.defaults,{colorByPoint:!1});class wi extends Se{}class vi extends Se{}const Si={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Vi={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Pi={minPadding:0,maxPadding:0};class Ai extends Se{constructor(){super(...arguments),this._dataChanged=!0}_doInitChildren(t){const e=this.chart;t.handle=(this._handle=new wi(e)).init(),t.mask=(this._mask=new vi(e)).init(),t.borderLine=(this._borderLine=new Se(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return x(this._op.thickness,Ai.defaults.thickness)}getGap(){return x(this._op.gap,Ai.defaults.gap)}getGapFar(){return x(this._op.gapFar,Ai.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 s={};if(i(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),s.series=_({},e.series,Si[t]())}else s.series=Si.area();i(e.xAxis)?s.xAxis=_({},e.xAxis,(Vi[e.xAxis.type]||Vi.linear)(),Pi):s.xAxis=_({},Pi),i(e.yAxis)?s.yAxis=_({},e.yAxis,(Vi[e.yAxis.type]||Vi.linear)(),Pi):s.yAxis=_(Vi.linear(),Pi),this._chartConfig=s,this._axisType=s.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()}}Ai.defaults=xe(Se.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class Ci extends Se{_isVisible(){return this._op.visible&&!W(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ci.defaults=xe(Se.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10});class ki extends Ci{}ki.defaults=xe(Ci.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Li extends Se{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:s,_point:i,_ctx:r}=this,n=s._group,o="AxisContext"==r.constructor.name;let a=s,h=i;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const s=Number(t[1])||0;e=e.replace(s+".",""),a=o?r.series[s]:n.getVisibleSeries()[s]}}const l=e.match(/yValue\.(\d+)/);if(l){const t=Number(l[1])||0;h=a.getPoints().get(t||0),e="yValue"}return r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=v(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 o(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?yt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Bt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Li.defaults=xe(Se.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class Ni extends Le{_isVisible(){return this._op.visible&&!W(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}Ni.type="image";class Ei extends Le{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||Ei.defaults.shape}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Ei.type="shape",Ei.defaults=xe(Le.defaults,{width:64,height:64,shape:"square"});class Mi extends Le{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 o(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?yt.getFormatter(s):B),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Bt.getFormatter(t):B)}(t.timeFormat)}}Mi.type="text",Mi.defaults=xe(Le.defaults,{text:"Text"});class Ti extends Fe{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 Oi extends He{constructor(){super(...arguments),this._strictEnds=!1,this._strictTicks=!1}_isValidInterval(t){return t>0}_normalizeSteps(t,e,s){return t}buildSteps(t,e,s,i,o=!1){var a,h;const l=this._op;let _;return this._strictTicks=this._strictEnds=!1,this._step=NaN,o?_=this._getStepsByPixels(t,x(.85*l.stepPixels,60),e,s,i):r(l.steps)||n(l.stepCallback)?(l.stepCallback?(_=l.stepCallback.call(B,{chart:this.chart.wrapper,length:t,minValue:s,maxValue:i}),r(_)&&!_.every((t=>"number"!=typeof t))||(_=s!==i?[s,i]:[s])):_=l.steps.slice(0),_.length>0&&isNaN(_[0])&&(_[0]=s),_.length>1&&isNaN(_[_.length-1])&&(_[_.length-1]=i),this._strictTicks=this._strictEnds=!0):_=this._baseAxis instanceof zi&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,e,s,i,!0):l.stepCount>0?this._getStepsByCount(l.stepCount,e,s,i,!1):this._isValidInterval(l.stepInterval)?this._getStepsByInterval(l.stepInterval,e,s,i):l.stepPixels>0?this._getStepsByPixels(t,((null===(a=this.axis)||void 0===a?void 0:a._isPolar)&&!(null===(h=this.axis)||void 0===h?void 0:h._isX)?.5:1)*l.stepPixels,e,s,i):s!==i?[s,i]:[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 zi&&(this._baseAxis=e,e.tick._baseAxis=null)}}$_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<u(t/e)*e&&(t=u(t/e)*e),H(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,o=i-s;let a=o/(t-1);const h=Math.pow(10,Math.floor(Math.log10(a))),l=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/h==2.5&&c(t*o/a)==t*o/a?this._step=a:a=this._step=u(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this.$_normalizeMin(s,h);else{for(it(s<e&&i>e,"base error"),t=y(3,t);;){if(!(u((e-s)/a)+u((i-e)/a)+1>t))break;a+=h}s=e-u((e-s)/a)*a}else s=n._fixedMin;l.push(s);for(let e=1;e<t;e++)l.push(H(l[e-1]+a));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=H(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=H(n-t));for(n=e;n<i;)r.push(n=H(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,o=[];if(0===n)return isNaN(i)?[]:[i];let a=t>250?5:t>200?4:t>150?3:t>80?2:1,h=y(this.axis._isX?1:a,c(t/e))+1,l=n/(h-1);const _=Math.pow(10,Math.floor(m(l))),d=this._getStepMultiples(_);let p,g=0;if(l/=_,d)if(l>d[g]){for(;g<d.length-1;g++)if(l>d[g]&&l<d[g+1]){l=d[++g];break}}else l=d[g];if(l*=_,isNaN(s))i=this.$_normalizeMin(i,l);else{for(it(i<=s&&r>=s,"base error"),h=y(3,h);g<d.length;){if(!(u((s-i)/l)+u((r-s)/l)+1>h))break;l=g<d.length-1?d[g+1]*_:2*l,g++}i=s-u((s-i)/l)*l}for(this._step=l,o.push(H(p=i));p<r;)o.push(H(p+=l));return o}}Oi.defaults=xe(He.defaults,{stepPixels:72,baseRange:!1});class Bi extends je{}Bi.defaults=xe(je.defaults,{numberFormat:"0.##"});class Ri extends Bi{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!0)}}Ri.defaults=xe(Bi.defaults,{useSymbols:!0});class Di extends Oe{getSize(t){return Q(this._sizeDim,t)}_doApply(t){super._doApply(t),this._op.space=x(this._op.space,0),this._sizeDim=q(this._op.size,!1)}}Di.defaults=xe(Oe.defaults,{enabled:!0,size:"30%",space:16,gridVisible:!0});class Fi extends Be{}Fi.defaults=xe(Be.defaults,{visible:!1});class zi extends Ue{constructor(){super(...arguments),this._breaks=[]}_doInitChildren(t){super._doInitChildren(t),t.baseLine=(this._baseLine=new Fi(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),s.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new Ti(this)}_createTickModel(){return new Oi(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 zi&&i._baseAxis._ticks.length>0;let n,{min:o,max:a}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e),h=this._baseVal;if(isNaN(h)&&o<0&&a>0&&(h=0),isNaN(h)?o<0&&a>0&&(h=0):(o=Math.min(o,h),a=Math.max(a,h)),r&&i.options.baseRange&&(o=i._baseAxis.axisMin(),a=i._baseAxis.axisMax()),o===a)n=[o];else if(n=i.buildSteps(s,h,o,a,!1),n.length>0){if(i._strictTicks||(n=i._normalizeSteps(n,o,a)),!isNaN(this._fixedMin)||!i._strictEnds&&"tick"!==this._getStartFit())for(;n.length>2&&n[0]<o;)n.shift();else if(!i._strictEnds&&!r){for(;n.length>2&&n[1]<=o;)n.shift();if(!isNaN(i._step))for(;n[0]>o;)n.unshift(i.getNextStep(n[0],-1))}if(o=Math.min(o,n[0]),!isNaN(this._op.strictMax)||!i._strictEnds&&"tick"!==this._getEndFit())for(;n.length>2&&a<n[n.length-1];)n.pop();else if(!i._strictEnds&&!r){for(;n.length>2&&n[n.length-2]>=a;)n.pop();if(!isNaN(i._step))for(;n[n.length-1]<a;)n.push(i.getNextStep(n[n.length-1],1))}a=Math.max(a,n[n.length-1])}else n.push(o+(a-o)/2);this._setMinMax(o,a);const l=[];this._runBreaks&&(n=this.$_getBrokenSteps(this._runBreaks,s,o,a));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:H(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 o=[n],a=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,a.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&&o.push(t)})),s.space>0&&o.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};a.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&e<=t.to&&o.push(e)}))}return this._lastSect=a[a.length-1],o}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?j(t-i-s.pos):j(i+s.pos)}{const s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return j(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){var i;const r=this._op;let n=this.isZoomed(),o=this.isZoomed(),a=!0,h=!0,l=NaN,_=NaN,c=!1;this._series.forEach((t=>{const i=t.getBaseValue(this);t instanceof xi&&(c=!0),isNaN(i)||(isNaN(r.minValue)&&i<=e?t.isBased(this)?e=i:l=x(f(l,i),i):isNaN(r.maxValue)&&i>=s&&(t.isBased(this)?s=i:_=x(y(_,i),i))),!n&&a&&t.canMinPadding(this,e)&&(a=!1),!o&&h&&t.canMaxPadding(this,s)&&(h=!1)})),n||(n=a),o||(o=h),this._fixedMin=this._fixedMax=NaN;let u=null!==(i=r.padding)&&void 0!==i?i:c||!this._isX?.04:0,d=0,p=0;isNaN(r.strictMin)?r.minValue<e?e=r.minValue:n?this._fixedMin=e:d=w(r.minPadding,u,0):this._fixedMin=e=r.strictMin,isNaN(r.strictMax)?r.maxValue>s?s=r.maxValue:o?this._fixedMax=s:p=w(r.maxPadding,u,0):this._fixedMax=s=r.strictMax;let g=y(0,s-e),m=e-g*(this._minPad=d),b=s+g*(this._maxPad=p);return!isNaN(l)&&l<=e&&m<l&&(m=this._fixedMin=l),!isNaN(_)&&_>=s&&b>_&&(b=this._fixedMax=_),{min:m,max:b}}$_calcUnitLength(t){const e=[];let s=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(e.push(...t._getVisiblePoints()),s++)})),0===s&&this._series.forEach((t=>{t.visible&&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=f(r,t[e]-t[e-1]);return{len:x(e*=r/(i-s+r),1),min:r}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new Di(this);return e.init(),e._load(t),e}}$_loadBreaks(t){if(r(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(_(new Di(this)._initObject(),e[0]));for(let r=1;r<e.length;r++){const n=i[i.length-1],o=e[r];s=n,o.options.from<s.options.to?t(n,o):i.push(_(new Di(this)._initObject(),o))}}var s}}zi.defaults=xe(Ue.defaults,{nullable:!0,startFit:"default",endFit:"default"});class $i extends zi{get label(){return this._label}_createLabel(){return new Ri(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof fi&&"fill"===r[0].options.layout&&(i.max=r[0].options.layoutMax),i}}$i.type="linear";class Ii extends Oi{canUseNumSymbols(){return this.axis.axisMax()>m(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 o=t[e],a=c(o);if(o===a){let t=i[n-1];e>1&&o-t<r&&(t=Math.pow(10,t),c(t)!==H(t)&&i.pop()),i.push(o)}else if(o>0&&o>a){if(o=a+m(10*(o-a)),o<=s)(0===n||o>i[n-1])&&i.push(o);else if(n>0){if(i[e-1]>=s)break;{const r=g(c(m(t[e]-t[e-1]))),n=t[e],a=n-c(n);if(r<1)for(let t=1;t<10;t++)if(a>m(t)&&a<m(t+1)){const e=c(n)+m(t);if(e>=s){o=e;break}}i.push(o)}}}else if(e>0&&o<=s&&o>i[n-1])i.push(o);else if(o>s)break;i.length>1&&(r=Math.min(.5,r,i[i.length-1]-i[i.length-2]))}return i}}Ii.defaults=xe(Oi.defaults,{arrangeDecimals:!0});class Gi extends zi{_createLabel(){return new Ri(this)}_createTickModel(){return new Ii(this)}collectValues(){super.collectValues(),this._values=this._values.filter((t=>t>0))}getPos(t,e){return e=e>0?m(e):-1,super.getPos(t,e)}_doCalculateRange(t){const e=super._doCalculateRange(t);return e.min=m(e.min),e.max=m(e.max),e}_createTick(t,e,s){return super._createTick(t,e,H(g(s)))}_calcUnitLen(t,e,s,i){let r=m(t[1])-m(t[0]);for(let e=2;e<t.length;e++)r=f(r,m(t[e])-m(t[e-1]));const n=i-s,o=r/n;return{len:x(e*=o,1),min:n*o}}}Gi.type="log";const Hi=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],ji=[[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]],Yi={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Wi extends Oi{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)?o(t)&&Yi.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>=Hi[e]/2&&t<Hi[e+1]/2)return this._scale=e,ji[e];this._scale=7}_getStepsByPixels(t,e,s,i,r){const n=[],o=r-i;if(0===o)return n;const a=this.axis,h=new Date(a._calcedMin);let l=Math.floor(t/this._op.stepPixels)+1,_=y(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),u=Hi[this._scale];if(_/=u,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 d=a.date(i),p=a.date(r);let g,m=d;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=_,_*=u,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(o(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=Yi[a],t=Hi[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(o.push(l=s);l<i;)o.push(l=this.getNextStep(l,1));else{for(o.push(l=e);l>s;)o.unshift(l=this.getNextStep(l,-1));for(l=e;l<i;)o.push(l=this.getNextStep(l,1))}return this._step=t,o}return super._getStepsByInterval(t,e,s,i)}}const Xi=[{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 Ui extends Bi{_doApply(t){super._doApply(t);const e=o(t.timeFormat)?t.timeFormat:void 0,s=o(t.beginningFormat)?t.beginningFormat:void 0,n=t.timeFormats,h=t.useBeginningFormat;if(this._formats=Xi.map((t=>_(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&s&&this._formats.forEach((t=>{t.beginningFormat=s})),r(n))for(let t=0;t<n.length;t++){const e=this._formats[t],s=n[t];a(s)?e.format=s:i(s)&&(a(s.format)&&(e.format=s.format),h&&a(s.beginningFormat)&&(e.beginningFormat=s.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,o=i.tick._scale,a=Bt.getFormatter;switch(o){case 7:return a(n[o].format).toStr(r,s.startOfWeek);case 6:return 0===t||0===r.getMonth()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 5:case 4:return 0===t||1===r.getDate()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 3:return 0===t||0===r.getHours()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 2:return 0===t||0===r.getMinutes()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 1:return 0===t||0===r.getSeconds()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek);case 0:return 0===t||0===r.getMilliseconds()?a(n[o].beginningFormat).toStr(r,s.startOfWeek):a(n[o].format).toStr(r,s.startOfWeek)}}}Ui.defaults=xe(Bi.defaults,{useBeginningFormat:!0});class Zi extends zi{get label(){return this._label}_createTickModel(){return new Wi(this)}_createLabel(){return new Ui(this)}collectValues(){this._offset=60*x(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return h(t)?t:t instanceof Date?t.getTime():o(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(o(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)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}}Zi.type="time",Zi.subtype="date",Zi.defaults=xe(zi.defaults,{baseValue:NaN});class qi extends mi{pointLabelCount(){return 2}_createLegendMarker(t,e){return ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Hs(t)}_getBottomValue(t){return t.lowValue}}qi.type="barrange",qi.defaults=xe(mi.defaults,{tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Ki extends $s{}class Qi extends pi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Ki(t)}_getGroupBase(){return this._group?this._group.options.baseValue:this._op.baseValue}}Qi.defaults=xe(pi.defaults,{colorByPoint:!1,pointOffset:0});class Ji extends Qi{_createLegendMarker(t,e){return ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Ji.type="bar";class tr extends bi{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}}tr.defaults=xe(bi.defaults,{baseValue:0});class er extends tr{_canContain(t){return t instanceof Ji}}er.type="bargroup",er.seriesType="bar";class sr extends jt{constructor(t,e){super(t,ii.LEGEND_MARKER),this._size=e,this.add(this._marker=new Zt(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){Cs.setShape(this._marker,this._shape,t/2,t/2),this._marker.trans(this._markerOffset(t),0)}_markerOffset(t){return 0}}class ir extends sr{constructor(t,e){super(t,e),this.insertFirst(this._line=new Zt(t)),this.insertFirst(this._area=new Zt(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 rr extends sr{constructor(t,e){super(t,e),this.insertFirst(this._line=new Zt(t)),this._line.setFill("none"),this.insertFirst(this._line2=new Zt(t)),this._line2.setFill("none"),this.insertFirst(this._area=new Zt(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 Zt{constructor(t,e=B,s=B){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){C.isNumber(t)?this.setPath(Cs.line(t,e,s,i)):t&&this.setPath(Cs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Cs.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(Cs.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Cs.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(Cs.line(e,t,s,t))}}class or extends sr{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 ar extends $s{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class hr extends oi{}hr.defaults=xe(oi.defaults,{radius:4,hoverScale:1.75});class lr extends Ks{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?lr.ALIGN_GAP:0:t}getPosition(){return v(this._op.position,"auto")}}lr.ALIGN_GAP=4,lr.defaults=xe(Ks.defaults,{position:"auto",align:"center"});class _r extends ni{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new hr(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 lr(t)}_createPoint(t){return new ar(t)}hasShape(){return!0}setShape(t){this._shape=t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new or(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),f(e,2*this.marker.options.radius)),s}_connectNulls(){return!1}_doPrepareLines(t){const e=t.length,s=[];if(this._containsNull&&!this._connectNulls()){let i=0;for(;i<e;){const r=[];for(;i<e&&t[i].isNull;)i++;for(;i<e&&!t[i].isNull;)r.push(t[i++]);r.length>0&&s.push(r)}}else s.push(t.slice());return s}}_r.defaults=xe(ii.defaults,{nullAsBase:!1});class cr extends Ae{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}cr.defaults=xe(Ae.defaults,{visible:!1,offset:8});class ur extends _r{_doInitChildren(t){super._doInitChildren(t),t.flag=(this._flag=new cr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof br||this._group instanceof xr?this._group.options.lineType:this._op.lineType}_connectNulls(){return this._op.connectNullPoints}getBaseValue(t){return t._isX?NaN:this._base}_doPrepareRender(){const t=this._op;super._doPrepareRender(),t.nullAsBase&&null!=t.baseValue&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),this.flag._prepareRender(),this._base=w(this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue,this._yAxisObj.getBaseValue(),0)}}ur.type=Bs,ur.defaults=xe(_r.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1});class dr extends ur{get canPolar(){return!1}_viewType(){return"line"}getLineType(){return"spline"}}dr.type="spline";class pr extends ar{}class gr extends ur{_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 ir(t,e)}_createPoint(t){return new pr(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)}}gr.type=Rs;class mr extends pr{get high(){return this.y}get highValue(){return this.yValue}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}labelCount(){return 2}_assignTo(t){return _(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=v(e[t.options.lowField],e.low),this.y=S(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 fr extends lr{getPosition(){return"auto"===this._op.position||null==this._op.position?"foot":this._op.position}}class yr extends _r{pointLabelCount(){return 2}_createLabel(t){return new fr(t)}_createLegendMarker(t,e){return new rr(t,e)}_createPoint(t){return new mr(t)}getLineType(){return this._op.curved?"spline":"default"}collectValues(t,e){super.collectValues(t,e),e&&t===this._yAxisObj&&this._visPoints.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}}yr.type="arearange",yr.defaults=xe(_r.defaults,{curved:!1,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class br extends fi{_canContain(t){return t instanceof ur}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}}br.type="linegroup",br.seriesType=Bs,br.defaults=xe(fi.defaults,{lineType:"default"});class xr extends fi{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 gr}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}}xr.type="areagroup",xr.seriesType=Rs,xr.defaults=xe(fi.defaults,{lineType:"default"});class wr extends pr{}class vr extends gr{getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new wr(t)}_doLoadData(t){const e=super._doLoadData(t);if(r(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}refer(t,e){if(!e._isX){const e=t._visPoints.map((t=>t.yValue)).filter((t=>!isNaN(t))),s=this._loadTable(e);this._doLoadPoints(s),this._prepareRunPoints(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)),o=n/i.pointsInSigma,a=r-i.sigmas*n,h=r+i.sigmas*n;let l=r;const _=[];for(_.push(e(r,n,l));l>a;)l-=o,_.unshift(e(r,n,l));for(l=r;l<h;)l+=o,_.push(e(r,n,l));return _}}vr.type="bellcurve",vr.defaults=xe(gr.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Sr extends $s{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 _(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[w(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=v(e[s.minField],e.min),this.low=v(e[s.lowField],e.low),this.mid=v(e[s.midField],e.mid),this.high=v(e[s.highField],e.high),this.y=v(e[s.maxField],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 Vr extends mi{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Sr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}}Vr.type="boxplot",Vr.defaults=xe(mi.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 Pr extends Gs{}class Ar extends xi{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:Q(this._minSizeDim,t),max:Q(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 Pr(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=f(t,s.zValue),e=y(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)}}Ar.type="bubble",Ar.defaults=xe(xi.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>"});class Cr extends yi{_canContain(t){return t instanceof ur}_doConstraintYValues(t){const e={};t.forEach((t=>{t._visPoints.forEach((t=>{if(!1!==t.visible){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=v(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return C.makeIntArray(0,t.length)}}Cr.type="bump",Cr.seriesType=Bs;const kr=function(t){return isNaN(t)?0:t};class Lr{constructor(){this._path=[]}length(){return this._path.length}isEmpty(){return 0===this._path.length}clear(){return this._path=[],this}reset(t,e){return this._path=[],this.move(t,e),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 h(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return h(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return h(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 h(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(h(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",kr(t[e]),kr(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",kr(t[e].x),kr(t[e].y));return this}polygon(...t){return h(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 Nr extends $s{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return _(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[w(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=v(e[s.lowField],e.low),this.open=v(e[s.openField],e.open),this.close=v(e[s.closeField],e.close),this.y=S(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 Er extends mi{canCategorized(){return!0}_createPoint(t){return new Nr(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new Lr;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new Zt(t,ii.LEGEND_MARKER,s.end())}}Er.type="candlestick",Er.defaults=xe(mi.defaults,{tooltipText:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class Mr extends Ks{}Mr.defaults=xe(Ks.defaults,{position:"inside"});class Tr extends Qi{get pointLabel(){return this._pointLabel}_createLabel(t){return new Mr(t)}}Tr.type=Ds;class Or extends tr{_canContain(t){return t instanceof Tr}}Or.type="circlebargroup",Or.seriesType=Ds;class Br extends Hs{}class Rr extends oi{}Rr.defaults=xe(oi.defaults,{radius:4,shape:"circle"});class Dr extends mi{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new Rr(this)).init(),t.lowMarker=(this._lowMarker=new Rr(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)+y(0,this.marker.options.radius)}_createPoint(t){return new Br(t)}prepareAfter(){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._visPoints.forEach((t=>{t.radius=s,t.shape=i,t.lowRadius=r,t.lowShape=n})),super.prepareAfter()}}Dr.type="dumbbell";class Fr extends $s{}class zr extends pi{getSegmentSize(t){return Q(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Fr(t)}_createLegendMarker(t,e){const s=new Lr;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new Zt(t,ii.LEGEND_MARKER,s.end())}}zr.type="equalizer",zr.defaults=xe(pi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class $r extends mi{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new Hs(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new Lr).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new Zt(t,ii.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}$r.type="errorbar",$r.defaults=xe(mi.defaults,{pointPadding:.3,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Ir extends ai{}class Gr extends Ir{constructor(t,e){super(t),this.points=e}}class Hr extends li{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?Hr.ENDED_DIST:Hr.OUTSIDE_DIST:this._op.distance||0}}Hr.OUTSIDE_DIST=25,Hr.ENDED_DIST=10;class jr extends ci{getSize(t,e){return{width:y(.1*t,Q(this._widthDim,t)),height:y(.1*e,Q(this._heightDim,e))}}getNeckSize(t,e){return{width:C.clamp(Q(this._neckWidthDim,t),.1*t,t),height:C.clamp(Q(this._neckHeightDim,e),.1*e,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new Hr(t)}_createPoint(t){return new Ir(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Gr(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=K(e._width,jr.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=K(e._height,jr.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=K(e._neckWidth,jr.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=K(e._neckHeight,jr.defaults.neckHeight))}(t.neckHeight)}}jr.type="funnel",jr.defaults=xe(ci.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",legendByPoint:!1});class Yr extends $s{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return _(super._assignTo(t),{min:this.min,max:this.max})}}const Wr={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 Xr extends ni{getBinCount(t){const e=x(this._op.binWidth,0);if(e>0)return t/e;return x(this._op.binsNumber,0)<1?Wr[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new Yr(t)}_doLoadPoints(t){function e(t){let e;return e=r(t)?t[x(this.yField,0)]:i(t)?S(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=this._op,n=[];let o=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||o.push(i)}if(o.length>0){o=o.sort(((t,e)=>t-e)),s.minValue<o[0]&&o.unshift(s.minValue),s.maxValue>o[o.length-1]&&o.push(s.maxValue);const t=o.length,e=o[0],i=o[t-1],r=this.getBinCount(t),a=this._binInterval=(i-e)/r;let h=0,l=e,_=l+a;for(let e=0;e<r;e++){let s=0;if(e==r-1)s=t-h;else for(;h<t&&o[h]<_;)s++,h++;n.push({x:l,y:s,min:l,max:e===r-1?i:_}),l=_,_=l+a}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._visPoints[this._visPoints.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 ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}}Xr.type="histogram",Xr.defaults=xe(ii.defaults,{baseValue:0,binsNumber:"squreRoot"});class Ur extends oi{}Ur.defaults=xe(oi.defaults,{radius:4,shape:"circle"});class Zr extends $s{}class qr extends pi{_doInitChildren(t){super._doInitChildren(t),t.marker=(this._marker=new Ur(this)).init()}get marker(){return this._marker}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new Zr(t)}prepareAfter(){const t=this.marker.options.radius,e=this.marker.options.shape;this._runPoints.forEach((s=>{s.radius=t,s.shape=e})),super.prepareAfter()}}qr.type="lollipop";class Kr extends Nr{}class Qr extends Er{_createPoint(t){return new Kr(t)}_createLegendMarker(t,e){const s=new Lr;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new Zt(t,ii.LEGEND_MARKER,s.end());return i.setStyle("strokeWidth","2px"),i}}Qr.type="ohlc";class Jr extends ar{}class tn extends _r{getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Jr(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return t.referBy(this),!0}refer(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._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}tn.type="pareto",tn.defaults=xe(_r.defaults,{curved:!1});class en extends ai{constructor(){super(...arguments),this.sliced=!1,this.startAngle=0,this.angle=0}parse(t){super.parse(t),this.sliced=this.source.sliced,this.isNull=this.isNull||this.y<0}_assignTo(t){return _(super._assignTo(t),{sliced:this.sliced})}}class sn extends en{constructor(t,e){super(t),this.points=e}}class rn extends Ae{getDefaultIconPos(){return"left"}}class nn extends li{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?Q(this._distanceDim,e,0):t?Q(s?nn.INNER_DIST:nn.INSIDE_DIST,e):"far"===this._op.align?nn.ENDED_DIST:nn.OUTSIDE_DIST}}nn.INSIDE_DIST=q("30%",!1),nn.INNER_DIST=q("50%",!1),nn.OUTSIDE_DIST=25,nn.ENDED_DIST=10,nn.defaults=xe(li.defaults,{radius:.7,rotationMode:"arc"});class on extends ui{_doInitChildren(t){super._doInitChildren(t),t.innerText=(this._innerText=new rn(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?Q(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new nn(t)}_createPoint(t){return new en(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new sn(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","labelDistance","sliceOffset")}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=F+z*x(this._op.startAngle%360,0),this._totalRad=z*y(0,f(360,x(this._op.totalAngle,360))),this._groupPos=NaN}}on.type="pie",on.defaults=xe(ui.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class an extends fi{getPolarSize(t,e){return Q(this._polarDim,f(t,e))}getInnerRadius(t){const e=this._innerDim;return e?e.size/(e.fixed?t:100):0}connectable(t){return!1}_doApply(t){const e=this;var s;super._doApply(t),(s=t.polarSize)!==e._polarSize&&(e._polarSize=s,e._polarDim=q(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=q(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof on}_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}))}}an.type="piegroup",an.seriesType="pie",an.defaults=xe(fi.defaults,{polarSize:"80%",innerSize:0});class hn extends $s{}class ln extends xi{_createPoint(t){return new hn(t)}_createLegendMarker(t,e){return new sr(t,e)}_colorByPoint(){return this._op.colorByPoint}setShape(t){this._defShape=t}get canPolar(){return!0}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),f(e,2*this._op.radius)),s}}ln.type="scatter",ln.defaults=xe(xi.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class _n extends $s{constructor(){super(...arguments),this.from=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._isMid=this.source.isMid,(this._isSum||this._isMid)&&(this.y=0)}getPointLabel(t){return this.y}}class cn extends Ks{}cn.defaults=xe(Ks.defaults,{offset:0});class un extends gi{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new cn(t)}_createPoint(t){return new _n(t)}_createLegendMarker(t,e){return ks.create(t,ii.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,s=t[0],i=s.y=s.save=s._isSum?0:s.y,r=i,n=i,o=s.from=0,a=0,h=s.to=i,l=0;for(let _=1,c=t.length;_<c;_++){s=t[_];if(!0===s._isMid&&_<c)e=n,o=l,h=o+e,l=h,i=e,n=0;else if(s._isSum)e=r,o=0,h=e,i=e;else{if(null==s.y)continue;e=s.y,o=a+i,h=o+e,n+=e,r+=e,i=e}s.yGroup=s.yValue=e,s.from=o,s.to=h,s.y=Math.max(o,h),s.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}un.type="waterfall",un.defaults=xe(gi.defaults,{tooltipText:"<b>${name}</b><br>${series}:<b> ${y}</b>"});class dn extends Se{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}}dn.defaults=xe(Se.defaults,{text:"RealChart v1.0",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class pn extends Se{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"!==v(this._op.scope,"auto")?this._op.scope:this.chart._chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}pn.defaults=xe(Se.defaults,{scope:"auto"});class gn extends Se{_doInitChildren(t){t.credits=(this._credits=new dn(this.chart)).init(),t.pointHovering=(this._pointHovering=new pn(this.chart)).init()}get credits(){return this._credits}get pointHovering(){return this._pointHovering}getXStart(t){return t instanceof Gi&&isNaN(this._op.xStart)?1:this._op.xStart||0}}var mn;gn.defaults=xe(Se.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0,domResize:!1}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right",t.CENTER="center",t.MIDDLE="middle"}(mn||(mn={}));class fn extends O{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new ut,this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new ye,(this._chartOptions=new gn(this)).init(),(this._title=new Ci(this)).init(),(this._subtitle=new ki(this)).init(),(this._legend=new bs(this)).init(),(this._tooltip=new Li(this)).init(),fn.split_class&&(this._split=new fn.split_class(this)).init(),(this._body=new ms(this)).init(),(this._navigator=new Ai(this)).init(),(this._exporter=new fs(this)).init(),this._series=new ri(this),this._xAxes=new Ze(this,!0),this._yAxes=new Ze(this,!1),this._gauges=new ss(this),this._annotations=new Ne(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this.options=Object.assign({},fn.defaults)}_createChart(t){return new fn(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().filter((t=>t.needAxes()))}getTooltipText(t,e){return fi.collectTooltipText(this.axis.options,this.series,e)}getTooltipParam(t,e,s){return fi.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){const e=this.gaugeByName(t);return e instanceof Je?e:this._annotations.get(t)}get wrapper(){return this._wrapper}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(){var t;return null===(t=this._gauges)||void 0===t?void 0:t.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.canPolar()}isWidget(){return this._series.isWidget()}isInverted(){return this._inverted}isSplitted(){return this._splitted}isEmpty(t){return this._series.isEmpty(t)&&(null==this._gauges||this._gauges.isEmpty(t))}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}gaugeByName(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.getGauge(t)}gaugeAt(t){var e;return null===(e=this._gauges)||void 0===e?void 0:e.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 mn.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case mn.RIGHT:r=s.filter((t=>t._isOpposite));break;case mn.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case mn.TOP:r=i.filter((t=>t._isOpposite));break;case mn.CENTER:r=s.filter((t=>t._isBetween))}else switch(t){case mn.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case mn.RIGHT:r=i.filter((t=>t._isOpposite));break;case mn.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case mn.TOP:r=s.filter((t=>t._isOpposite));break;case mn.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 fn.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,s){const r=this._bases[e];let n;return i(r.base)&&ve(n={},r.base),i(r[s])&&(n||(n={}),ve(n,r[s])),n?ve(n,t):t}_load(t){var e,s;const i=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),i.asset=this._assets.load(v(t.asset,t.assets)),i.options=this._chartOptions._load(t.options),i.title=this._title._load(t.title),i.subtitle=this._subtitle._load(t.subtitle),i.legend=this._legend._load(t.legend),i.tooltip=this._tooltip._load(t.tooltip),null===(e=this._split)||void 0===e||e._load(t.split),this._seriesIndex=0,this._series.load(t.series),null===(s=this._gauges)||void 0===s||s.load(v(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(S(t.xAxis,t.xAxes,{})),this._yAxes.load(S(t.yAxis,t.yAxes,{}))),i.body=this._body._load(t.body||t.plot),this._annotations.load(v(t.annotation,t.annotations),!1),i.seriesNavigator=this._navigator._load(t.seriesNavigator),i.exporting=this._exporter._load(t.exporting),this}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Se||s instanceof Ve||s instanceof ye)&&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(){var t;const e=this._xAxes,s=this._yAxes,i=this._split;[e,s].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,e.disconnect(),s.disconnect(),this._assets.prepareRender(),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&!this._gaugeOnly&&this._split.prepareRender(e,s),this._series.prepareAfter(),this._legend._prepareRender(),null===(t=this._gauges)||void 0===t||t.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(i(t)){const s=this._templates={};for(const e in t){const r=t[e];i(r)&&(s[e]=_({},r))}["@xAxis","@yAxis","@series","@gauge","@annotation"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(o(e)){let s=this._templates[e];if(s)return ve(ve({},s),t)}else r(e)&&e.forEach((e=>{let s=this._templates[e];return s?ve(ve({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&qs[t.toLowerCase()]}_getSeriesType(t){return o(t)&&Zs[t.toLowerCase()]}_getAxisType(t){return o(t)&&Te[t.toLowerCase()]}_getGaugeType(t){return o(t)&&Ke[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&Qe[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&ke[t.toLowerCase()]}getAxesGap(){return x(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)}}fn.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},Ue.register(Xs,$i,Gi,Zi),ii.register(gr,yr,qi,Ji,vr,Vr,Ar,Er,Tr,Dr,zr,$r,jr,Xr,ur,dr,qr,Qr,tn,on,ln,un),fi.register(xr,er,Cr,Or,br,an),fi.registerSeries(xr,er,Or,br,an),Le.register(Ni,Ei,Mi);const yn="$ctrl";class bn{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new fn(t,this),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[yn]=null===(t=this[yn])||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 assets(){return this._obj._assets}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 o(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart";C.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new fn(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,C.log("chart-items:",be),C.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,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)}draw(){this[yn].refresh()}}class xn{constructor(t,e){this._obj=new ct(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 wn extends T{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,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.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 vn=Object.freeze({x:0,y:0,width:0,height:0});function Sn(t){return{width:t.width,height:t.height}}const Vn=function(t){const e=t.x+t.width/2,s=t.y+t.height/2,i=t.rotation*Math.PI/180,r=t.width/2,n=t.height/2;return[[-r,-n],[r,-n],[r,n],[-r,n]].map((([t,r])=>[e+(t*Math.cos(i)-r*Math.sin(i)),s+(t*Math.sin(i)+r*Math.cos(i))]))},Pn=function(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s],r=t[(s+1)%t.length],n=[r[0]-i[0],r[1]-i[1]],o=[-n[1],n[0]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);e.push([o[0]/a,o[1]/a])}return e},An=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},Cn=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},kn=function(t,e){const s=Vn(t),i=Vn(e),r=Pn(s),n=Pn(i);for(const t of[...r,...n]){const e=An(s,t),r=An(i,t);if(!Cn(e,r))return!1}return!0},Ln=function(t,e){return!(t.y>=e.y+e.height||e.y>=t.y+t.height||t.x>=e.x+t.width||e.x>=t.x+t.width)};class Nn{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Nn(t,t,t,t):new Nn(t,t,e,e):new Nn(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 Nn(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}}}Nn.Empty=Object.freeze(new Nn),Nn.Temp=new Nn;class En extends jt{constructor(t,e=B){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return En.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}En.IGNORE_ATTRS={width:"",height:""};class Mn extends jt{constructor(t,e=B){super(t,e,"g"),jt.DEBUGGING&&(this.add(this._debugRect=new ks(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),jt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new ks(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 Tn extends Mn{constructor(t,e,s){super(t,e),this._margins=new Nn,this._paddings=new Nn,this.add(this._background=new ks(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 o=this._paddings;o.applyPadding(n);const a=this._doMeasure(t,e,s,i,r);if(a.width+=o.left+o.right,a.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=a.width+=t.left+t.right,this.mh=a.height+=t.top+t.bottom}return this.mw=a.width,this.mh=a.height,a}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 On extends En{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 Bn extends Mn{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 Rn extends jt{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=vn,this._isImageLoaded=!1,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._isImageLoaded=!0,this.invalidate(),this._dirty=!1},this.dom.onerror=()=>{this._dirty=!0,this._isImageLoaded=!1,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),this._isImageLoaded&&!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 Dn extends En{constructor(e,s=B){super(e),this.add(this._text=new ee(e,s)),this._text.anchor=t.TextAnchor.START}get text(){return this._text.text}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 ks(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 ee(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 Rn(t,!1)),this._icon.url=s,this._icon.width=e.options.iconWidth,this._icon.height=e.options.iconHeight):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=Rt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.applyStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(e){const s=this._icon;let i=0;const r=this._text.getBBox(),n=r.width,o=r.height;let a=n,h=o,l=0,_=0,c=0,u=0;if(s){const t=s.getBBox();switch(i=x(this._model.options.iconGap,0),l=t.width,_=t.height,this._model.getIconPos()){case"left":case"right":a+=i+l,h=Math.max(_,o);break;default:h+=i+_,a=Math.max(l,n)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);c=parseFloat(t.paddingLeft)||0,u=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,a+c+(parseFloat(t.paddingRight)||0),h+u+(parseFloat(t.paddingBottom)||0),t.rx)}if(s)switch(this._model.getIconPos()){case"left":s.trans(c,(h-_)/2),c+=l+i,a-=l+i;break;case"right":s.trans(c+a-l,(h-_)/2),a-=l+i;break;case"top":s.transX((a-l)/2),u+=_+i;break;case"bottom":s.trans((a-l)/2,u+o+i)}switch(e){case"center":c+=a/2,this._text.anchor=t.TextAnchor.MIDDLE;break;case"right":c+=a,this._text.anchor=t.TextAnchor.END;break;default:this._text.anchor=t.TextAnchor.START}return this._text.trans(c,u),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 Fn extends vs{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 zn extends Tn{constructor(t){super(t,zn.TITLE_CLASS,"rct-axis-title-background"),this.add(this._textView=new ee(t)),this._richText=new _e}_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 o=Sn(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=o.width;o.width=o.height,o.height=t}return o}_doLayout(e){const s=this._textView,i=s.getStyle("writing-mode"),r=i===ht||i===lt;e?this.rotation=0:this.setRotation(0,(r?this.width:this.height)/2,this._angle);let n=this._margins.top+this._paddings.top,o=0;switch(this.textAlign()){case"left":this._textView.anchor=t.TextAnchor.START,r||(o-=this.width/2);break;case"right":this._textView.anchor=t.TextAnchor.END,r?n+=this.height:o+=this.width/2;break;default:this._textView.anchor=t.TextAnchor.MIDDLE,r&&(n+=this.height/2)}s.trans(o,n)}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}}zn.TITLE_CLASS="rct-axis-title";class $n extends Mn{constructor(t){super(t,Yn.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 In extends Dn{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 _e(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*z,e=this.getBBox();return b(p(t)*e.height)+b(d(t)*e.width)}rotatedHeight(){const t=this.rotation*z,e=this.getBBox();return b(d(t)*e.height)+b(p(t)*e.width)}}class Gn extends jt{constructor(t){super(t,void 0),this.add(this._back=new Zt(t,"rct-crosshair-flag")),this.add(this._text=new ee(t,"rct-crosshair-flag-text"))}setText(t,e){if(e!==this._text.text){const s=t.options.flag;this._text.text=(s.prefix||"")+e+(s.suffix||"");const i=this._text.getBBox(),r=new Lr,n=y(s.minWidth||0,i.width+8);r.rect(0,0,n,i.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}}}class Hn extends Mn{static isThumb(t){return t.classList.contains(Hn.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new ks(t,Hn.TRACK_CLASS)),this.add(this._thumbView=new ks(t,Hn.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=y(0,e),this._page=f(s,e),this._pos=f(t.min+e-s,y(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=y(0,f(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,o=this._page,a=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||o===r?c:c*o/r)+i;this._reversed,this._thumbView.setBounds(h+1,n?0:this.height-c*a/r-t,_-2,t)}else{c-=h+e.getGapFar(),this._trackView.setBounds(0,h,_,c),_-=i;const t=(n||o===r?_:_*o/r)+i;this._reversed,this._thumbView.setBounds(n?0:_*a/r,h+1,t,c-2)}}}Hn.CLASS_NAME="rct-axis-scrollbar",Hn.TRACK_CLASS="rct-axis-scrollbar-track",Hn.THUMB_CLASS="rct-axis-scrollbar-thumb";const jn=/\${label}.*?/g;class Yn extends Mn{constructor(t){super(t,Yn.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,Yn.LINE_CLASS)),this.add(this._titleView=new zn(t)),this.add(this._markContainer=new jt(t,"rct-axis-ticks")),this.add(this._labelContainer=new jt(t,"rct-axis-labels")),this._labelViews=new wn(this._labelContainer,In,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX)return e.visible&&!this.model._isBetween?(this._scrollView||this.add(this._scrollView=new Hn(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 Gn(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?f(0,this.width-n.width):y(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;if(this._prevMin=s.axisMin(),this._prevMax=s.axisMax(),!isNaN(e)&&this._prevMax!==e||!isNaN(t)&&this._prevMin!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:this._prevMax};s.options.animatable&&new Fn(this,t,e,(()=>{this.invalidate()}))}}}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,s,i,r){var n;const o=e.line,a=e.tick,h=e._isHorz,l=e._isBetween,_=this._titleView;let c=0;return(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new nr(t,Yn.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a.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,o=this._labelViews,a=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,a),e.layout().trans(t.prev(n[i]),s?l-a:0)})):this._markViews.forEach(((e,i)=>{e.resize(a,1),e.layout().trans(s?0:h-a,l-t.prev(n[i]))})));const _=a+(t.tick.options.gap||0);if(this._labelContainer.visible&&o.count>0&&(e?this.$_layoutLabelsHorz(o,r,i,s,h,l,_):this.$_layoutLabelsVert(o,r,i,s,h,l,_)),!this._simpleMode){const i=t.title.options,r=this._titleView,n=this._scrollView,o=this._labelSize;let a=0,c=0;if(r.visible){const n=+i.offset||0,u=+i.gap||0;if(r.resizeByMeasured().layout(e),e){if(c+=s?0:_+o+u,t.options.reversed)switch(i.align){case"start":a=h-r.width/2-n;break;case"end":a=r.width/2+n;break;default:a=h/2-n}else switch(i.align){case"start":a=r.width/2+n;break;case"end":a=h-r.width/2-n;break;default:a=h/2+n}r.trans(a,c),c+=r.height}else{const e=0===r._angle?r.width:r.height;if(a=s?_+o+u+e/2:h-_-o-u-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(a,c)}}else c+=s?0:_+o;(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 $n(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),o=e.label;if(t.value=e.value,t.internalClearStyleAndClass(),t.internalSetStyleOrClass(s._style),t.internalSetStyleOrClass(s.getLabelStyle(e,i)),null!=n){o&&n.match(jn)?t.setLabel(s,e,n.replace(jn,o),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,o,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,o,a){const h=t.label,l=y(0,f(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,u=(i=y(1,i))*(r=f(y(1,r),_.length)),p=n||0,g=b(p)*z,m=g<35*z;let x,w=!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){x=e.pull(v++),x.rotation=p,x.row=n,x.index=r,this._prepareLabel(x,_[r],h,c,a),x.setVis(!0);const t=i;if(0===p&&x.getBBox().width>=t){w=!0;break}if(m&&x.getBBox().width*d(g)>=t){w=!0;break}if(0!==p&&x.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-u;0<=t&&t<c&&(x=e.pull(v++),x.row=n,x.rotation=p,x.index=t,this._prepareLabel(x,_[t],h,c,a),x.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=y(0,f(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,o=+r.step|0,a=+r.rows|0,h=+r.rotation%360,l=this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,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,_,o||1);else{switch(o=a=0,i.options.autoArrange){case"rows":a=this.$_getRows(_);break;case"step":o=this.$_getStep(_)}if(o>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,s);)o++;else if(a>1){for(;t._ticks.length>a&&(_.forEach(((t,e)=>{t.row=e%a,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,a,0,!1,s));)a++;this._labelRowPts=[]}else if((isNaN(h)||Math.abs(Math.tan(h*z))<1)&&(h=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,h,!1,s))for(o=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,h,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,0,!0,s)&&_.forEach(((t,e)=>{t.rotation=h}));break}o++}}else;if(_.length>0){if(a>1){const t=!isNaN(h)&&0!=h,e=this._labelRowPts;for(let t=0;t<a;t++)e.push(0);_.forEach((s=>{e[s.row]=y(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=y(n,_[t].getBBox().height)}else{n=_[0].rotatedHeight();for(let t=1;t<_.length;t++)n=y(n,_[t].rotatedHeight())}return n}return 0}$_checkOverlappedVert(t,e,s,i){const r=e.length,n=y(1,i);e.forEach((t=>t.rotation=0));for(let i=0;i<r-1;i+=n){let o=0;for(let a=i;a<i+n&&a<r-1;a++)o+=t.getLabelLength(s,e[i].value);if(e[i].getBBox().height>=o)return!0}}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,o=t._ticks,a=o.length,h=y(1,i);let l,_=n.options.startStep||0,c=0;for(;_<a;_+=h){let i=0;for(let e=_;e<_+h&&e<a;e++)i+=t.getLabelLength(s,o[e].value);if(_+h<a&&(l=e.pull(c++),l.rotation=0,l.index=_,this._prepareLabel(l,o[_],n,a,r),l.setVis(!0),l.getBBox().height>=i))return!0}const u=_-h;0<=u&&u<a&&(l=e.pull(c++),l.rotation=0,l.index=u,this._prepareLabel(l,o[u],n,a,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1){const i=t.label;let r=y(1,+i.options.step|0);const n=this.$_checkOverlappedVert2(t,this._labelViews,e,r,s);let o=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)})),o=this.$_applyStep(t,o,r||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++r,s););else;if(o.length>0){let t=o[0].getBBox().width;for(let e=1;e<o.length;e++)t=y(t,o[e].getBBox().width);return t}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o){const a=this.model,h=a.label,l=a.options.reversed,_=this._labelContainer.textAlign()||"center",c=this._labelRowPts,u=t.get(0).rotation,d=u*z,g=u<-15&&u>=-90||u>15&&u<=90,m=t.count;let f,y;t.freeHiddens(),t.forEach(((t,s)=>{t.setContrast(null).layout(_);const r=t.getBBox();f=a.prev(e[t.index].pos),y=i?n-o-r.height-c[t.row]:o+c[t.row],u<-15&&u>=-90?i?(f-=r.width,y-=p(d)*r.height/2,t.setRotation(r.width,r.height/2,-u)):(f-=r.width,y+=p(d)*r.height/2,t.setRotation(r.width,r.height/2,u)):u>15&&u<=90?i?(y+=p(d)*r.height/2,t.setRotation(0,r.height/2,-u)):(y-=p(d)*r.height/2,t.setRotation(0,r.height/2,u)):(f-=r.width/2,t.setRotation(r.width/2,0,i?-u:u)),t.trans(f,y)})),!g&&m>1&&(function(e,s,i){let r=!0;const n=s.rotatedWidth();let o=s.tx;if(o<-e._marginStart-e._edgeStart)if("pull"===(l?h.options.lastOverflow:h.options.firstOverflow))if(o=-e._marginStart-e._edgeStart+2,t.count>0){const t=i.tx;o+n+(+h.options.overflowGap||12)>t&&(r=!1)}else r=!1;else r=!1;r?s.transX(o):s.setVis(!1)}(this,t.get(l?m-1:0),t.get(l?m-2:1)),function(t,e,s){let i=!0,n=e.tx;const o=e.rotatedWidth();if(n+o>(r+=t._marginEnd+t._edgeEnd)){const t=h.options;"pull"===(l?t.firstOverflow:t.lastOverflow)?(n=r-o,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:m-1),t.get(l?1:m-2)))}$_layoutLabelsVert(t,e,s,i,r,n,o){const a=this.model,h=this._labelContainer.textAlign()||(i?"left":s?"center":"right"),l=i?o:r-o;t.freeHiddens(),t.forEach(((t,o)=>{t.setContrast(null).layout(h);const _=t.getBBox(),c=i?l:s?(r-_.width)/2:l-_.width;t.trans(c,n-a.prev(e[t.index].pos)-_.height/2)}))}}Yn.AXIS_CLASS="rct-axis",Yn.LINE_CLASS="rct-axis-line",Yn.TICK_CLASS="rct-axis-tick";class Wn extends jt{constructor(t,e,s){super(t,Wn.STYLE),this.add(this._back=new ks(t,Wn.BACK_STYLE)),this.add(this._textView=new ee(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 Nn).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}}Wn.STYLE="rct-button",Wn.BACK_STYLE="rct-button-background";class Xn extends jt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Un extends Zt{setArc(t,e,s,i,r,n){this.setPath(Cs.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Zn extends Un{setPolyline(t){this.setPath(Cs.lines(...t))}}class qn extends Zt{static create(t,e,s,i,r,n,o,a,h=!0){return new qn(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",s,i,r,n,o,a,h,l=!0){return new qn(t,e,{cx:s,cy:i,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=B,s=B){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 Cs.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 Cs.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 Kn={};class Qn extends Tn{static register(...t){t.forEach((t=>{Kn[t[0].type]=t[1]}))}constructor(t,e){super(t,Qn.CLASS_NAME+" "+e,"rct-annotation-background"),this._transform=new jt(t,null,"g"),this.add(this._transform),this._transform.add(this._background)}update(t,e,s){this.measure(this.doc,this.model,e,s,0),this._layoutView(this.chart().isInverted(),t,0,0,e,s)}addToTransform(t){this._transform.add(t)}_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,o=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":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}resetClip(t,e,s){this._clip||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}remove(){var t;return this._clip&&(null===(t=this.control)||void 0===t||t.removeDef(this._clip.dom)),super.remove()}_updateTransform(){this.model.needClip()?this._transform.dom.setAttribute("transform",this.getTransform()):super._updateTransform()}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doLayout(t){const e=this.model.options.rotation;this.trans(t.x,t.y),this._background.resize(this.width,this.height),isNaN(e)||0===e?this.rotation=0:this.setRotation(this.width/2,this.height/2,e)}}Qn.CLASS_NAME="rct-annotation";const Jn={};class to extends Bn{static register(...t){t.forEach((t=>{Jn[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new ks(t,to.PANE_CLASS)),this.add(this._contentContainer=new Yt(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return to.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}}isEmptyView(){return!1}_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=_(Dt.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 io)return t;t=t.parent}}}to.GAUGE_CLASS="rct-gauge",to.PANE_CLASS="rct-gauge-pane";class eo extends vs{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 so extends Dn{}class io extends to{_defaultCalss(){return io.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new Yt(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))}))}}io.GAUGE_GROUP_CLASS="rct-gauge-group";class ro{static reveal(t,e){new oo(t,e)}static grow(t,e){new ho(t,e)}static spread(t,e){new lo(t,e)}static fadeIn(t){new no(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 no extends ro{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:vs.DURATION,fill:"none"})}}class oo extends ro{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:vs.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:Y(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:Y(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}}class ao extends vs{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof jt}_stop(){super._stop(),this._series=null}}class ho extends ao{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class lo extends ao{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class _o extends ao{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}var co;class uo extends vs{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(vo.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(vo.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class po extends Dn{constructor(t){super(t,"rct-point-label")}}class go extends Yt{constructor(t){super(t,"rct-point-labels"),this._labels=[new wn(this,po),new wn(this,po)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}getWidth(t){let e=0;return this._labels[t].forEach((t=>e=y(e,t.getBBox().width))),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text),a=n._style;e.point=i,e.setModel(t,n,i.icon?n.getUrl(i.icon):null,null),e._text.internalClearStyleAndClass(),e._text.internalSetStyleOrClass(a),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),null!=o?(n.prepareRich(o),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(s.isLabelsVisible()){this.setVis(!0);const r=s.pointLabelCount(),n=this._labels,o=s._getLabeledPoints(),a=this._maps,h=i._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);l.setVis(e.isPointLabelVisible(r))&&(this.prepareLabel(t,l,h,r,s,i),a[h][r.pid]=l)}})),this.setStyleOrClass(h),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}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)}}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const s=t[e].inflateBBox(-1,-1),i=t[e-1].inflateBBox(-1,-1);if(Ln(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Ts)for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(kn(h,l)?(r.point.yValue<t[s].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),r=n,i=s):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1)),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});kn(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1),t[0].point.yValue<r.point.yValue?(e.get(t[0].point).setVis(!1),t[0].setVis(!1),t.splice(0,1)):(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1)))}}else for(let s=1;s<t.length;s++){const n=t[s],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),h=Object.assign(o,{rotation:r.rotation}),l=Object.assign(a,{rotation:n.rotation});if(kn(h,l)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(s,1),--s):(r=n,i=s),s===t.length-1){const s=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});kn(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n){const o=t.length,a=this.control.chartView().bodyView();if(o<2)return 0;const h=o/2|0;let l=0,_=0,c=0;for(t=t.sort(((t,e)=>t.ty-e.ty));c<h;){const e=t[c],s=t[c+1],i=e.inflateBBox(0,-1),r=s.inflateBBox(0,-1).y-(i.y+i.height);if(r<0){for(let e=c;e>=0;e--)t[e].shiftY(r);l-=r}c++}for(c=o-1;c>h;){const e=t[c],s=t[c-1],i=e.inflateBBox(0,-1),r=s.inflateBBox(0,-1),n=r.y+r.height-i.y;if(n>0){for(let e=c;e<o;e++)t[e].shiftY(n);_+=n}c--}if(i){let e;for(let s=0;s<o;s++)s<h?(e=t[s+1].ty-t[s].tbottom,e>0&&t[s].shiftY(Math.min(t[s].y-t[s].ty,e))):(e=t[s].ty-t[s-1].tbottom,e>0&&t[s].shiftY(-Math.min(t[s].ty-t[s].y,e)));let s=[];for(let i=0;i<o-1;i++)e=t[i+1].ty-t[i].tbottom,e>0&&(s[i]=e);if(l>0)for(let e=0;e<s.length&&!(t[0].ty>=t[0].y);e++){if(s[e]>0)for(let i=0;i<=e&&(t[i].shiftY(s[e]),!(t[i+1].ty>=t[i].tbottom));i++);s[e]=void 0}if(_>0)for(let e=s.length-1;e>=0&&!(t[o-1].ty<=t[o-1].y);e--)if(s[e]>0){for(let i=o-1;i>e&&(t[i].shiftY(-s[e]),!(t[i-1].tbottom<=t[i].ty));i--);s[e]=void 0}l=t[0].y-t[0].ty,_=t[o-1].ty-t[o-1].y,l+_>0&&t.forEach((t=>t.shiftY((l-_)/2)))}if(n===Os)for(let s=0;s<t.length;s++){const i=t[s];(i.ty<0||i.ty+i.getBBox().height>a.height)&&(e.get(i.point).setVis(!1),i.setVis(!1))}return 1}}class mo extends En{constructor(t){super(t),this.add(this._line=new Zt(t))}setLine(t){this._line.setPath(t)}}class fo extends En{constructor(t){super(t,"rct-point-label-lines"),this._lines=new wn(this,mo)}prepare(t){const e=this._lines,s=t._visPoints,i=t.pointLabel,r=this._map={};i.visible?e.prepare(s.length).forEach(((t,e)=>{const i=s[e];t.visible=i.visible,r[i.pid]=t})):e.prepare(0)}get(t){return this._map[t.pid]}}class yo extends Yt{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 bo={},xo="rct-point-hover",wo="rct-point-unhover";class vo extends Bn{static register(...t){t.forEach((t=>{bo[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 yo(t,"rct-series-points")),this._labelContainer=new go(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))}isPointLabelVisible(t){return t.visible&&!t.isNull&&!t.isEmpty()&&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){}_getPointColors(){return"a"}prepareSeries(t,e,s){this.setModel(e),this.setData("index",e.seriesIndex%12),this.setData("pointcolors",e._colorByPoint()?this._getPointColors():B),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,s)}_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(xo).addClass(wo)}))):this._getPointPool().forEach((t=>{t.containsClass(wo)&&t.removeClass(wo).addClass(xo)}))}_clearHoverClasses(t){t instanceof jt&&t.removeClass(xo).removeClass(wo)}focusPoints(t){const e="none"!==this.model.options.hoverEffect,s=this._hoverAnis,i=this._hoverPts,r=[],n=[];this.model.options.interactive&&e&&(i.forEach((e=>{if(e instanceof jt&&(!t||t.indexOf(e)<0)){const t=s.find((t=>t._marker===e));t&&t.stop(),e.setBoolData(vo.DATA_FOCUS,!1),e.restoreStyles(),e instanceof No&&r.push(new uo(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 jt&&(t.setBoolData(vo.DATA_FOCUS,!0),n.push(t),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof No?r.push(new uo(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof To&&this.needFronting()&&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){}applyAutoRotation(t,e,s,i){if(!this.model.pointLabel.options.autoRotation)return;const{width:r,height:n}=t.getBBox(),o=e/s*(i||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&ws(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 ni&&e.trendline.visible?(this._trendLineView||this.add(this._trendLineView=new Zt(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 _o(this,(()=>{this.invalidate()}))}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){const{paletteMode:s}=this.model.chart.options.options,i=s===at?Math.floor(12*Math.random()):e.index%12;t.setData("index",this.model._paletteColors[i].toString())}_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:void 0}_getGrowRate(){return x(this._growRate,1)}_getPosRate(){return x(this._posRate,1)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0||this.model.isDeleting()}_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,o={x:0,y:0},a={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 u=t[r+1].px-t[r].px,d=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}),o.x=-_.x*u*n,o.y=-_.y*u*n;const s=d+a.x,g=p+a.y,m=t[r].px+o.x,f=t[r].py+o.y;i.curve(s,g,m,f,t[r].px,t[r].py),u=t[r+1].px-t[r].px,a.x=_.x*u*n,a.y=_.y*u*n,d=t[r].px,p=t[r].py}i.curve(d+a.x,p+a.y,t[r].px,t[r].py,t[r].px,t[r].py)}$_renderTrendline(t){const e=this.model;if(!(e instanceof ni))return;const s=e.chart.isPolar(),i=e.trendline,r=e._xAxisObj,n=e._yAxisObj,o=n._vlen,a=r._vlen;let h;if(s){const t=e.chart._body.getPolar(r);h=i._points.map((e=>{const s=t.start+r.getPos(a,e.x),i=n.getPos(t.rd,e.y);return{x:t.cx+i*d(s),y:t.cy+i*p(s)}}))}else h=i._points.map((e=>{let s,i;return t?(i=a-r.getPos(a,e.x),s=n.getPos(o,e.y)):(s=r.getPos(a,e.x),i=o-n.getPos(o,e.y)),{x:s,y:i}}));if(this._trendLineView.setVis(h.length>1)){this._trendLineView.setStyleOrClass(i.options.style);const t=new Lr;t.move(h[0].x,h[0].y),i.isCurved()&&!s?this._drawSpline(h.map((t=>({px:t.x,py:t.y}))),0,-1,t):(s&&i.isCurved(),t.lines(...h)),this._trendLineView.setPath(t.end(!1))}}_layoutLabel(t,e,s){let{inverted:i,x:r,y:n,hPoint:o,labelView:a,labelOff:h}=t;if(!a.setVis(r>=0&&r<=e&&n>=0&&n<=s))return;a.layout(t.textAlign);const l=t.reversed?o<=0:o<0,_=a.getBBox();let c=!0;switch(i?n-=_.height/2:r-=_.width/2,t.labelPos){case"inside":i?r-=(o+_.width)/2+(t.reversed?h:-h):n+=(o-_.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?o+_.width+h:o-h:n+=l?o+h:o-_.height-h;break;default:i?l?r-=_.width+h:r+=h:l?n+=h:n-=_.height+h,c=!1}a.setContrast(c&&t.pointView.dom),a.trans(r,n)}_clipRange(t,e,s,i,r,n){if(n){const s=t;t=e,e=s}const o="x"===s,a=o?this.model._xAxisObj:this.model._yAxisObj,h=a.options.reversed,l=a.getPos(o?t:e,y(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,f(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,b(_-l),e):r.setBounds(l,-e,b(_-l),e):r.setBounds(0,-y(l,_),t,b(_-l)):o?h?r.setBounds(_,0,b(_-l),e):r.setBounds(l,0,b(_-l),e):r.setBounds(0,e-y(l,_),t,b(_-l))}_setFill(t,e){i(e)&&e[J]?t.internalSetStyle(J,e[J]):o(e)&&t.dom.classList.add(e)}_savePrevs(){}}vo.POINT_CLASS="rct-point",vo.DATA_FOCUS="focus",vo.DATA_UNFOCUS="unfocus",vo.DATA_UNHOVER="unhover",vo.LEGEND_MARKER="rct-legend-item-marker";class So extends Zt{constructor(t){super(t,vo.POINT_CLASS)}savePrevs(){}}class Vo extends So{constructor(){super(...arguments),this.labelViews=[]}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let Po=class extends Vo{layout(t,e,s,i){this.x=t,this.setPath(Cs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class Ao extends En{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Co extends vo{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&&ro.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class ko extends Co{_prepareSeries(t,e){super._prepareSeries(t,e),this._pointOff=e.options.pointOffset||0}_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,o=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,l=s._yAxisObj,c=l.options.reversed,u=2*h.unitPad(),d=l.prev(i?t:e),p=h.prev(i?e:t),g=i?0:e,m=l.axisMin(),f=l.getPos(d,m),b=s.getBaseValue(l)||0,w=x(l.getPos(d,y(m,b)),f),v=!isNaN(b),S=t=>l.getPos(d,t),V=t=>h.getPos(p,t),P=this._pointOff,A=a&&_(this._labelInfo,{inverted:i,reversed:c,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign});this._getPointPool().forEach(((o,l)=>{const _=o.point;if(o.setVis(!_.isNull)){const c=h.getUnitLen(p,_.xValue)*(1-u);let d=s.getPointWidth(c),m=S(_.yGroup),f=w;if(_.yGroup!=_.yValue){const t=b>_.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=S(r)}const y=(m-f)*r;let x=V(_.xValue)-c/2;if(isNaN(x)){const t=h.getUnitLen(p,_.xValue)*(1-u);x=V(_.xValue)-t/2}let C=g-m;isNaN(n+o.wSave)||(d=o.wSave+(d-o.wSave)*n),x+=s.getPointPos(c)+d/2,isNaN(n+o.xSave)||(x=o.xSave+(x-o.xSave)*n),_.xPos=x+=d*P,_.yPos=C,this._layoutPoint(o,l,x,g-w*(1-r)-f*r,d,y),i&&(C=p-V(_.xValue)+c/2,x=g,_.yPos=C-=s.getPointPos(c)+d/2+d*P,_.xPos=x+=v?S(_.yGroup)*r:S(_.yGroup*r)),A&&(A.labelView=a.get(_,0))&&(A.pointView=o,A.x=x,A.y=C,A.wPoint=d,A.hPoint=y,this._layoutLabel(A,t,e))}}))}}class Lo extends Co{_getHighValue(t){return t.yValue}_prepareSeries(t,e){super._prepareSeries(t,e),this._pointOff=+e.options.pointOffset||0}_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,o=s.pointLabel,a=this._labelViews(),h=s._xAxisObj,l=s._yAxisObj,c=2*h.unitPad(),u=i?t:e,d=i?e:t,p=i?0:e,g=this._pointOff,m=a&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign});this._getPointPool().forEach(((o,_)=>{const f=o.point;if(o.setVis(!f.isNull)){const y=h.getUnitLen(d,f.xValue)*(1-c);let b=s.getPointWidth(y);const x=(l.getPos(u,this._getHighValue(f))-l.getPos(u,this._getLowValue(f)))*r;let w=h.getPos(d,f.xValue)-y/2,v=p-l.getPos(u,this._getHighValue(f))*r;isNaN(n+o.wSave)||(b=o.wSave+(b-o.wSave)*n),w+=s.getPointPos(y)+b/2,isNaN(n+o.xSave)||(w=o.xSave+(w-o.xSave)*n),f.xPos=w+=b*g,f.yPos=v,this._layoutPoint(o,_,w,v,b,x),i&&(v=d-h.getPos(d,f.xValue)+y/2,w=p,f.yPos=v-=s.getPointPos(y)+b/2+b*g,f.xPos=w+=l.getPos(u,this._getHighValue(f))*r),a&&(m.pointView=o,m.hPoint=x,m.x=w,m.y=v,(m.labelView=a.get(f,0))&&(m.hPoint=x,this._layoutLabel(m,t,e)),(m.labelView=a.get(f,1))&&(i?m.x-=x:m.y+=x,m.hPoint=-x,this._layoutLabel(m,t,e)))}}))}}class No extends So{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-s)**2)-t}}class Eo extends vo{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Cs[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 co._drawers[t]||co._drawers.circle}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();"auto"===e&&(e=this._getAutoPos(o.width>=2*i*.9)),t.setVis(null!=e)&&(r-=o.width/2,"inside"===e?t.trans(r,n-o.height/2):e&&t.trans(r,n-i-o.height-s))}}co=Eo,Eo._drawers=Object.assign({circle:t=>Cs.circle(0,0,t)},co._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Mo extends vs{constructor(t,e){super(),this.series=t,this.duration=e}_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 To extends vo{togglePointVisible(t){var e;t.yValue<0||(this._willZombie=t,t.visible||null===(e=this._labelContainer.get(t,0))||void 0===e||e.hide(250))}needFronting(){return!0}isPointLabelVisible(t){return t===this._zombie||super.isPointLabelVisible(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 Mo(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_resizeZombie(){}_createPointLegendMarker(t,e,s){return ks.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 Oo extends Qn{constructor(t){super(t,Oo.CLASS_NAME),this.addToTransform(this._imageView=new Rn(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),Sn(this._imageView.getBBox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Oo.CLASS_NAME="rct-image-annotation";class Bo extends Qn{constructor(t){super(t,Bo.CLASS_NAME),this.addToTransform(this._shapeView=new Zt(t))}_doMeasure(t,e,s,i,r){var n,o,a,h;const l=e.getSize(s,i),_=null===(n=e.chart.xAxis)||void 0===n?void 0:n.getPos(s,e.options.x1),c=null===(o=e.chart.xAxis)||void 0===o?void 0:o.getPos(s,e.options.x2),u=null===(a=e.chart.yAxis)||void 0===a?void 0:a.getPos(i,e.options.y1),d=null===(h=e.chart.yAxis)||void 0===h?void 0:h.getPos(i,e.options.y2);let p=0,g=0;switch(e.getShape()){case Ss.HLINE:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(d)||(p=Number.isNaN(u)?i-d:l.height/2),this._shapeView.setPath(Cs.line(g,p,g+l.width,p));break;case Ss.VLINE:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(d)&&Number.isNaN(u)&&(p=i-d),this._shapeView.setPath(Cs.line(g,p,g,p+l.height));break;case Ss.LINE:Number.isNaN(c)||(g=Number.isNaN(_)?c:_>c?l.width:0),Number.isNaN(d)||(p=Number.isNaN(u)?i-d:u<d?l.height:0);const t=_>c?g-l.width:g+l.width,s=u<d?p-l.height:p+l.height;this._shapeView.setPath(Cs.line(g,p,t,s));break;default:Cs.setShape(this._shapeView,e.getShape(),l.width/2,l.height/2)}return this._deflatePaddings(l),l}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Bo.CLASS_NAME="rct-shape-annotation";class Ro extends Qn{constructor(e){super(e,Ro.CLASS_NAME),this.addToTransform(this._textView=new ee(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new _e}_doMeasure(t,e,s,i,r){const n=e.options,o=e.getSize(s,i),a=this._textView;n.writingMode&&this._textView.setStyle("writingMode",n.writingMode),n.textOrientation&&this._textView.setStyle("textOrientation",n.textOrientation),this._deflatePaddings(o),this._richText.setFormat(n.text),this._richText.build(a,s,i,null,e._domain);const h=Sn(this._textView.getBBox());return{width:x(o.width,h.width),height:x(o.height,h.height)}}_doLayout(t){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}Ro.CLASS_NAME="rct-text-annotation";class Do extends No{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)),Cs.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((i-e)**2+(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 Fo extends yo{}class zo extends vo{constructor(t,e){super(t,e),this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new Fo(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new Zt(t,"rct-line-series-line")),this._markers=new wn(this._pointContainer,Do)}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,s){e instanceof ur&&(this._needBelow=e.options.belowStyle&&e._minY<e.getBaseValue(e._yAxisObj),this._prepareBelow(e,s)),!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(!!this._polar)}_runShowEffect(t){this._polar?t&&ro.grow(this):t&&ro.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(!!this._polar)}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,e){var s,i;const r=this.control;let n=this._lowLine;if(this._needBelow)return n||(n=this._lowLine=new Zt(this.doc,"rct-line-series-line rct-line-series-line-below"),e?this._lineContainer.add(n):this._lineContainer.insertChild(n,this._line),e?(this._upperClip=r.clipCircle(),this._lowerClip=r.clipCircle()):(this._upperClip=r.clipBounds(),this._lowerClip=r.clipBounds()),this._upperClip.setAttr(jt.ASSET_KEY,"1"),this._lowerClip.setAttr(jt.ASSET_KEY,"1")),this._line.setClip(this._upperClip),n.setClip(this._lowerClip),!0;null==n||n.setClip(),this._line.setClip(),null===(s=this._upperClip)||void 0===s||s.remove(),null===(i=this._lowerClip)||void 0===i||i.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new wn(this._lineContainer,Zt)),i.prepare(e.length);s.length<e.length;){const t=new Ut(this.doc);t.setAttr(jt.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._polar,n=this.model._yAxisObj.options.reversed;let o;(o=this._upperClip)&&(this._polar?o.setCircle(r.cx,r.cy,r.rd*this._getGrowRate()):i?n?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):n?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._polar?o.setCircle(r.cx,r.cy,r.rd*(s/e)*this._getGrowRate()):this._inverted?n?o.setBounds(0,-t,e,t):o.setBounds(0,-s,e,t-s):n?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof ur&&this._needBelow,i=s?t.getBaseValue(t._yAxisObj):NaN,r=[t.marker._style,null];if(this._pointContainer.setVis(!t._simpleMode)){const n=this._markersPerPoint(),o=s&&t.options.belowStyle,a=e.length;this._markers.prepare(a*n,((n,h)=>{const l=e[h%a];l.isNull||(n.point=l,r[1]=s&&l.yValue<i?o:null,this._setPointStyle(n,t,l,r)),n.point=l,n.index=h<a?0:1}))}else this._markers.prepare(0)}_layoutMarker(t,e,s,i){const r=this.model,n=t.point,o=t._radius=r.getRadius(n);e&&t.internalSetStyleOrClass(e),Cs.setShape(t,r.getShape(n),o,o),t.setPos(s,i),t.trans(s-=o,i-=o)}_layoutMarkers(t,e,s){const i=this.model,r=i.marker,n=r._style,o=this._inverted,a=i.needClip(!1),h=this._getGrowRate(),l=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,u=r.options.maxVisible,g=r.options.minVisible,m=i.pointLabel,f=m.options.align,y=m.getAlignOffset(),b=m.getOffset(),x=m.getPosition(),w=this._labelContainer._textAlign,v=this._labelViews(),S=i._xAxisObj,V=i._yAxisObj,P=this._polar=i.chart._body.getPolar(S),A=!!P,C=V.prev(o?e:s),k=S.prev(P?D:o?s:e),L=o?0:s,N=t.length;t.forEach(((t,m)=>{let E,M,T,O;P?(T=P.start+S.getPos(k,t.xValue),O=V.getPos(P.rd,t.yGroup)*h,E=t.px=P.cx+O*d(T),M=t.py=P.cy+O*p(T)):(E=t.px=S.getPos(k,t.xValue),M=t.py=L-V.getPos(C,t.yGroup),o&&(E=V.getPos(C,t.yGroup),M=s-S.getPos(k,t.xValue))),t.xPos=E,t.yPos=M;const B=this._markers.get(m),R=v&&v.get(t,0);if(B&&B.setVis(!t.isNull&&(A||!a||E>=0&&E<=e&&M>=0&&M<=s))){this._layoutMarker(B,n,E,M),i._maxY==t.yGroup&&r.options.maxVisible,i._minY==t.yGroup&&r.options.minVisible;const e=0==m&&null!=_?_:m==N-1&&null!=c?c:i._maxY==t.yGroup&&null!=u?u:i._minY==t.yGroup&&null!=g?g:l;if(B.setStyle("opacity",e?"1":"0"),R){R.setContrast(null).layout(w);const t=R.getBBox(),e=B._radius;if(R.visible=!0,P){switch(x){case"inside":O-=b;break;case"foot":O-=t.height/2+b;break;default:O+=t.height+b}E=P.cx+O*d(T),M=P.cy+O*p(T)-t.height/2,this.applyAutoRotation(R,T,P.total,S.options.totalAngle)}else switch(x){case"inside":M-=t.height/2+b;break;case"foot":M+=b+(l?e:0);break;default:M-=t.height+b+(l?e:0)}switch(f){case"left":E-=t.width+(l?e:0)+y;break;case"right":E+=(l?e:0)+y;break;default:E-=t.width/2+y}R.trans(E,M)}}else R&&R.setVis(!1)}))}_layoutLines(t){const e=this.model;if(!this._lineContainer.setVis(e._lines.length>0))return;const s=this.width,i=this.height,r=this._inverted,n=e instanceof ur&&this._needBelow;let o=this._buildLines2(e._lines,!!this._polar);if(e._runRanges)this._rangeLines.forEach(((t,n)=>{const a=e._runRanges[n];t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",a.color),t.internalSetStyleOrClass(a.style),Dt.setImportantStyle(t.dom.style,J,"none"),t.setClip(this._rangeClips[n]),this._clipRange(s,i,e._runRangeValue,a,this._rangeClips[n],r)}));else{const t=this._line;t.setPath(o),t.internalClearStyleAndClass(),t.internalSetStyle("stroke",e._runColor),t.internalSetStyleOrClass(e._style),Dt.setImportantStyle(t.dom.style,J,"none")}if(n){const n=this._lowLine,a=e._yAxisObj,h=e.getBaseValue(a);t?this.$_resetClips(s,i/2,a.getPos(i/2,h),!0):r?this.$_resetClips(s,i,a.getPos(s,h),!0):this.$_resetClips(s,i,i-a.getPos(i,h),!1),n.setPath(o),n.internalClearStyleAndClass(),n.internalSetStyle("stroke",e._runColor),n.internalSetStyleOrClass(e._style),n.internalSetStyleOrClass(e.options.belowStyle),Dt.setImportantStyle(n.dom.style,J,"none")}}_buildLine2(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve2(t,s,i):r instanceof ur&&"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 Lr;return"spline"===i?this._drawCurves(t,r):s instanceof ur&&"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 ur&&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 Lr;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine2(n,e,!1,i),this._buildLine2(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class $o extends zo{constructor(t){super(t,$o.CLASS),this._flagView=new Dn(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,s=e.flag,i=this._flagView,r=this.parent.parent;let n;if(i.setVis(s.visible&&!!(n=s.label()))){i.setText(n),i.setModel(this.doc,s,s.options.icon?s.getUrl(s.options.icon):null,null),i.setContrast(null).layout("left");const o=s.options.offset,a=i.getBBox();let h,l;h=this._markers.last.x,l=this._markers.last.y;let _;_=("step"==e.options.lineType&&"forward"==e.options.stepDir)!=this._inverted?l>this._markers.get(this._markers.count-2).y?"bottom":"top":h>this._markers.get(this._markers.count-2).x?"right":"left";const c={top:["top","right","left"],right:["right","top","bottom"],bottom:["bottom","right","left"],left:["left","top","bottom"]}[_],{width:u,height:d}=a,p=u/2,g=d/2,{width:m,height:f}=r,y=m/2,b=f/2,x=l>d+o,w=f>l+d+o,v=h>u+o,S=m>h+u+o,V={top:x,right:S,bottom:w,left:v};_=null!==(t=c.find((t=>V[t])))&&void 0!==t?t:_;const P=h>p&&m-h>p?h-p:h>y?m-u:0,A=l>g&&f>l+g?l-g:l>b?f-d:0;switch(_){case"top":h=P,l=x?l-d-o:0;break;case"bottom":h=P,l=w?l+o:f-d;break;case"left":h=v?h-u-o:0,l=A;break;case"right":h=S?h+o:m-u,l=A}i.trans(h,l)}}}$o.CLASS="rct-line-series";class Io extends zo{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new Fo(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new Zt(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,e){let s=this._lowArea;if(super._prepareBelow(t,e))return s||this._areaContainer.add(s=this._lowArea=new Zt(this.doc,"rct-area-series-area")),this._area.setClip(this._upperClip),s.setClip(this._lowerClip),!0;null==s||s.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 wn(this._areaContainer,Zt,"rct-area-series-area")),s.prepare(e.length);i.length<e.length;){const t=new Ut(this.doc);t.setAttr(jt.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,o=i?0:s;for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this._layoutPolar(this._area,this._visPoints)}_doAfterLayout(){var t;null===(t=this.model._group)||void 0===t||t.prepareLines(this.model),super._doAfterLayout(),this._polar||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(),o=this._needBelow?this._lowArea:void 0,a=this._buildAreas(e._areas,e.getLineType());e._runRanges?this._rangeAreas.forEach(((t,s)=>{const o=e._runRanges[s];t.setBoolData("simple",this._simpleMode),t.setPath(a),t.internalClearStyleAndClass(),t.setFill(o.color),this._setFill(t,o.style),o.areaStyle&&t.internalSetStyleOrClass(o.areaStyle),t.setClip(this._rangeAreaClips[s]),this._clipRange(i,r,e._runRangeValue,o,this._rangeAreaClips[s],n)})):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(J,e._runColor),this._setFill(t,s.style),e.options.areaStyle&&t.internalSetStyleOrClass(s.areaStyle)),o&&(o.setBoolData("simple",this._simpleMode),o.setPath(a),o.internalClearStyleAndClass(),e._runColor&&o.internalSetStyle(J,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}_layoutPolar(t,e){const s=this.model,i=s._group,r=s._yAxisObj,n=r instanceof $i?s.getBaseValue(r):NaN;this.height;const o=this._polar,a=this._lowArea,h=new Lr;if(!i||"stack"!==i.options.layout&&"fill"!==i.options.layout){h.move(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);this._needBelow&&!isNaN(n)&&h.circle(o.cx,o.cy,r.getPos(o.rd,n)*this._getGrowRate());const s=h.end();t.setPath(s),null==a||a.setPath(s)}else{h.move(e[0].xPos,e[0].yLow),h.line(e[0].xPos,e[0].yPos);for(let t=1;t<e.length;t++)h.line(e[t].xPos,e[t].yPos);h.line(e[e.length-1].xPos,e[e.length-1].yLow);for(let t=e.length-1;t>=0;t--)h.line(e[t].xPos,e[t].yLow);t.setPath(h.end())}t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style),a&&(a.setBoolData("polar",!0),a.clearStyleAndClass(),a.setFill(s._runColor),a.addStyleOrClass(s._style),a.internalSetStyleOrClass(s.options.belowStyle),Dt.setImportantStyle(a.dom.style,"stroke","none"))}}class Go extends qn{constructor(t){super(t,vo.POINT_CLASS)}savePrevs(){}}class Ho extends ko{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 wn(this._pointContainer,Go)),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,o=t._yAxisObj,a=r.getPolar(n),h=this._pointOff-n.polarOff(),l=n.getTotalAngle(),_=a.cx,c=a.cy;let u,g,m,f;i&&(u=this._labelInfo,g=t.getLabelPos(s),m=t.getLabelOff(s.getOffset()),f=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const y=s.point,b=o.getPos(a.rd,y.yValue)*e;let x=o.getPos(a.rd,y.yGroup)*e;const w=n.getUnitLen(l,y.xValue),v=t.getPointWidth(w);let S=a.start+n.getPos(l,y.xValue);if(S+=v*h,S+=t.getPointPos(w),s.setSector({cx:_,cy:c,rx:x,ry:x,innerRadius:(x-b)/x,start:S-v/2,angle:v,clockwise:!0}),S=s.start+s.angle/2,y.xPos=_+s.rx*d(S),y.yPos=c+s.ry*p(S),i&&(u.labelView=i.get(y,0))){u.labelView.layout(f);const t=u.labelView.getBBox();let e;"outside"===g?(x=c+(s.ry+t.height+m)*p(S),e=_+(s.rx+t.width+m)*d(S)):"head"===g?(x=c+(s.ry-t.height/2-m)*p(S)-t.height/2,e=_+(s.rx-t.height/2-m)*d(S)):(x=c+.7*s.ry*p(S)-t.height/2,e=_+.7*s.rx*d(S)),"outside"!==g&&u.labelView.setContrast(s.dom),this.applyAutoRotation(u.labelView,S,a.total,n.options.totalAngle),u.labelView.trans(e-t.width/2,x)}}))}}class jo extends Ao{constructor(t){super(t,vo.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,o=0+e-e*(s.highValue-s.minValue)/i,a=e*(s.highValue-s.lowValue)/i;s.color&&this._box.setFill(s.color),this.x=this.tx+r,this._stemUp.setVLine(r,0,o),this._stemDown.setVLine(r,n,e),this._max.setHLine(0,t/4,3*t/4),this._min.setHLine(0+e,t/4,3*t/4),this._box.setBox(0,o,t,a),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 ks(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 Yo extends No{}let Wo=class extends Ao{constructor(t){super(t,vo.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(f(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(y(s.openValue,s.closeValue)-s.lowValue)/i),o=f(n,r),a=y(1,b(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,o,t,a),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 ks(t))}};class Xo extends So{layout(t,e,s){const i=new Lr;i.circle(t,e,s),this.setPath(i.end())}}let Uo=class extends Ao{constructor(t){super(t,vo.POINT_CLASS),this.add(this._line=new nr(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new Zt(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new Zt(t,"rct-dumbbell-point-marker"))}layout(t,e,s,i){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,h=o.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(o);_&&r.internalSetStyleOrClass(_),_=e.getMarkerStyle(o),_&&n.internalSetStyleOrClass(_),this.x=this.tx+l,this._line.setVLine(l,0,i),Cs.setShape(r,o.shape,a,a),Cs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};let Zo=class extends En{constructor(t){super(t,vo.POINT_CLASS),this._segments=new wn(this,Zt),this._decimal=0,this.add(this._back=new ks(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(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Cs.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Cs.rectangle(e,s-t[2*a],i,n(-1,t[2*a]-t[2*a+1])))}))}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};let qo=class extends Ao{constructor(t){super(t,vo.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 ks(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 Ko extends So{}let Qo=class extends Vo{layout(t,e){this.setPath(Cs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class Jo extends En{constructor(t){super(t,vo.POINT_CLASS),this.add(this._line=new nr(t,"rct-lollipop-point-bar")),this.add(this._marker=new Zt(t,"rct-lollipop-point-marker"))}layout(t){const e=this.point.radius;this._line.setVLine(0,0,t),Cs.setShape(this._marker,this.point.shape,e,e),this._marker.trans(-e,-e)}savePrevs(){this.xSave=this.tx}}class ta extends Ao{constructor(t){super(t,vo.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(f(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(y(s.openValue,s.closeValue)-s.lowValue)/i,a=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(o,0,t/2),this._bar.setVLine(0,0,0+e),this.setBoolData("decline",a)}_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 ks(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class ea extends qn{constructor(t){super(t,vo.POINT_CLASS)}setPieSector(t,e,s){this._assignShape(s,!1),this.polygon=Cs.sectorPolygon(s.cx,s.cy,s.rx,s.ry,s.innerRadius,s.start,s.start+s.angle,s.clockwise)}}class sa extends No{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 o=t._radius;e?this._radius=o=t._radius*(1+(isNaN(s)?1:s)*n):o=t._radius*(1+n-(isNaN(s)?n:n*s)),this.setPath(r(o)),this.trans(i.xPos,i.yPos)}endHover(t,e){delete this._radius}}function ia(t,e){return new(Kn[e._type()])(t)}function ra(t,e){return new(bo[e._viewType()])(t)}vo.register([gr,Io],[yr,class extends zo{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Fo(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new Zt(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new Zt(t,"rct-areanrange-series-line")),Dt.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,o=r.visible,a=this._inverted,h=i._xAxisObj,l=i._yAxisObj,_=a?e:s,c=a?0:s,u=this._labelViews(),g=this._labelContainer._textAlign,m=this._polar=i.chart._body.getPolar(h),f=i.pointLabel,y=f.options.position,b=f.options.align,x=f.getAlignOffset(),w=f.getOffset();this._getGrowRate();for(let e=0,s=t.length;e<s;e++){const s=t[e];s.yLow=c-l.getPos(_,s.lowValue)}const v=this._markers;for(let c=0,f=t.length;c<f;c++){const S=t[c],V=v.get(f+c),P=u&&u.get(S,1);let A,C,k;if(a?(A=S.px2=l.getPos(_,S.lowValue),C=S.py2=v.get(c).ty+i.getRadius(S)):(A=S.px2=S.xPos,C=S.py2=S.yLow),V&&V.setVis(!S.isNull&&A>=0&&A<=e&&C>=0&&C<=s)){if(this._layoutMarker(V,n,A,C),V.setStyle("opacity",o||0==c&&!0===r.options.firstVisible||c===f-1&&!0===r.options.lastVisible?"1":"0"),P){P.setContrast(null).layout(g);const t=P.getBBox(),e=V._radius;if(P.visible=!0,m){switch(y){case"inside":C-=w;break;case"foot":C-=t.height/2+w;break;default:C+=t.height+w}A=m.cx+C*d(k),C=m.cy+C*p(k)-t.height/2,this.applyAutoRotation(P,k,m.total,h.options.totalAngle)}else switch(y){case"inside":C-=t.height/2+w;break;case"foot":C+=w+(o?e:0);break;default:C-=t.height+w+(o?e:0)}switch(b){case"left":A-=t.width+(o?e:0)+x;break;case"right":A+=(o?e:0)+x;break;default:A-=t.width/2+x}P.trans(A,C)}}else P&&P.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,s=this.model;if(!this._areaContainer.setVis(s._lines.length>0))return;const i=this._buildAreas(s._lines,s.getLineType());e.setPath(i),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),s._runColor&&e.setFill(s._runColor),this._setFill(e,s._style),s.options.areaStyle&&e.internalSetStyleOrClass(s.options.areaStyle)}}],[Ji,class extends Ho{constructor(t){super(t,"rct-bar-series")}_createBarPool(t){return new wn(t,Po)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.options;this._rdTop=+s.topRadius||0,this._rdBottom=+s.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom)}}],[qi,class extends Lo{constructor(t){super(t,"rct-barrange-series"),this._bars=new wn(this._pointContainer,Po)}_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)}}],[vr,class extends Io{constructor(t){super(t,"rct-bellcurve-series")}}],[Vr,class extends Lo{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new wn(this._pointContainer,jo)}_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)}}],[Ar,class extends Eo{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new wn(t,Yo)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&ro.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),o=this._getGrowRate(),a=+i.rotation||0,h=s.pointLabel,l=h.options.position,_=h.getOffset(),c=this._labelContainer._textAlign,u=this._labelViews(),g=s._xAxisObj,m=s._yAxisObj,f=this._polar=s.chart._body.getPolar(g),y=m.prev(r?t:e),b=g.prev(f?D:r?e:t),x=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:w,max:v}=s.getPixelMinMax(x),S=r?0:e,V=this._getDrawer(i.shape);let P;this._markers.forEach(((i,h)=>{const x=i.point,A=u&&(P=u.get(x,0));if(i.setVis(!x.isNull&&!isNaN(x.zValue))){const h=(i._radius=s.getRadius(x.zValue,w,v))*o;let u,C;if(f){const t=f.start+g.getPos(b,x.xValue),e=m.getPos(f.rd,x.yValue);u=f.cx+e*d(t),C=f.cy+e*p(t)}else u=g.getPos(b,x.xValue),C=S-m.getPos(y,x.yValue),r&&(u=m.getPos(y,x.yValue),C=e-g.getPos(b,x.xValue));x.xPos=u,x.yPos=C,i.setVis(!n||u>=0&&u<=t&&C>=0&&C<=e)?(i.setPath(V(h)).trans(u,C).rotate(a),A&&(P.setContrast(i.dom).layout(c),this._layoutLabelView(P,l,_,h,u,C))):A&&A.setVis(!1)}else A&&A.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=s.reduce(((s,i)=>s.distance(s._radius,t,e)<i.distance(i._radius,t,e)?s:i));return{pv:i,dist:i.distance(i._radius,t,e)}}}canHover(t,e,s){return t<=e._radius+s}}],[Er,class extends Lo{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new wn(this._pointContainer,Wo)}_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)}}],[Tr,class extends Ho{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new wn(t,Xo)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}],[Dr,class extends Lo{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new wn(this._pointContainer,Uo)}_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)}}],[zr,class extends ko{constructor(t){super(t,"rct-equalizer-series"),this._bars=new wn(this._pointContainer,Zo)}_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 o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(s=t.xSave+(s-t.xSave)*o),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,o=this._pts=[];let a,h,l=0;const _=t._yAxisObj,c=_.axisMin(),u=t.getBaseValue(_)||0,d=_.getPos(e,u);for(h=s.maxCount>0?s.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),a=(e-n*(h-1))/h;o.length<2*h;)o.push(l,l+a),l+=a+n;o[o.length-1]=e;const p=o.length/2;this._bars.forEach((t=>{const n=t.point;if(t.setVis(!n.isNull)){const h=n.yValue>=u?(e-d)/e*(n.yValue-u)/(i-u):d/e*(u-n.yValue)/(u-c);let l=-1,_=0;for(let t=0;t<p-1;t++)if(h>=o[2*t]/e&&h<o[2*(t+1)]/e){l=t+1,_=!r&&h<o[2*t+1]/e?h*e-o[2*t]:a;break}l<0&&(l=p,_=a),0===h&&(l=0),t.prepareSegments(p,l,_,s.backStyle)}}))}}],[$r,class extends Lo{constructor(t){super(t,"rct-errorbar-series"),this._bars=new wn(this._pointContainer,qo)}_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)}}],[jr,class extends To{constructor(t){super(t,"rct-funnel-series"),this._segments=new wn(this._pointContainer,Ko),this.add(this._lineContainer=new fo(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&&ro.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_resizeZombie(){super._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:t._isDeleted()?t._vr:1)})),e>1||e>0&&!this._zombie)if(1==e&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===e&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let r=0;for(;r<e-1;r++){const e=t[r],n=H(e.yValue*(e===this._zombie?this._zombieRate:e._isDeleted()?e._vr: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=H(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){const s=function(t){return u?y+(V-y)*(w-t)/(w-P):y+(V-y)*(t-x)/(P-x)},i=this.model,r=this._labelViews(),n=i.pointLabel,o="inside"===i.getLabelPos(n),a=n.getOffset(),h=n.getDistance(),l=n.getAlign(),_=null==r?void 0:r.textAlign(),c=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,u=i.options.reversed,d=n.options.opposite,p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),m=new Lr,f=i.getCenter(t,e),y=f.x-p.width/2,x=f.y-p.height/2,w=x+p.height,v=y+p.width/2,S=p.height-g.height,V=y+(p.width-g.width)/2,P=u?w-S:x+S,A=[],C=new Lr,k=(null==r?void 0:r.getWidth(0))||0;let L,N;this._lineContainer.setVis(r&&!o)&&this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach((i=>{const f=i.point;if(i.setVis(!f.isNull)){const y=f.yPos*p.height,E=(f.yPos+f.height)*p.height,M=u?w-y:x+y,T=u?w-E:x+E,O=E<S;let B,R,D,F;if(N=null==c?void 0:c.get(f),y>=S?(B=V,R=B+g.width,m.move(B,M).lines(R,M,R,T,B,T),i.ny=i.nx1=NaN):O?(B=s(M),R=B+2*(v-B),D=s(T),F=D+2*(v-D),m.move(B,M).lines(R,M,F,T,D,T),i.ny=NaN,i.nx1=D-B,i.nx2=F-B):(B=s(M),R=B+2*(v-B),D=V,F=D+g.width,m.move(B,M).lines(R,M,F,P,F,T,D,T,D,P),i.nx1=D-B,i.nx2=F-B,i.ny=b(P-M),i.nx3=D,i.nx4=F),i.setPath(m.close(!0)),f.xPos=v,f.yPos=M+(T-M)/2,r&&(L=r.get(f,0))&&L.visible){if(o){null==N||N.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),s=O?(R-B+(F-D))/2:g.width;switch(!t&&L.layout(_||"center"),n.options.align){case"near":L.trans(f.xPos-s/2+a,f.yPos-e.height/2);break;case"far":L.trans(f.xPos+s/2-e.width-a,f.yPos-e.height/2);break;default:L.trans(f.xPos-e.width/2,f.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,f,i,L,_,d,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,f,i,L,_,d,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!1,f,i,L,_,d,N,C,v,a,h);L.setContrast(o&&i.dom),A.push(L),L.setPosY(L.ty)}else null==N||N.setVis(!1)}}));const E=n.options.convergable,M=n.options.dedupeMode,T=n.options.overflow;r&&(o||0===l?"preserveOrder"!==M&&"largestFirst"!==M||r.dedupe(A,c,M):(null==r?void 0:r.arrangeVertical(A,c,e,E,M,T))&&this._segments.forEach((s=>{const i=s.point;i.isNull||(L=r.get(i,0),N=null==c?void 0:c.get(i),(null==L?void 0:L.visible)&&(-1===l?this.$_layoutLabelAligned(!0,i,s,L,_,d,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,_,d,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!0,i,s,L,_,d,N,C,v,a,h)))})))}$_calcX(t,e,s,i){const r=e.getBBox(),n=i?-1:1,o=r.height;let a=s+n*r.width/2;return isNaN(e.ny)?isNaN(e.nx1)||(a-=0===o?0:n*(e.nx1*o/2)/o):e.ny>r.height/2?a-=n*(e.nx1*o/2)/e.ny:a=i?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l,_,c){const u=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!u&&i.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,s,l,n);let m=l;if(n?m-=h.width/2:m+=h.width/2,o){const e=t?d.y+d.height/2-p:0;n?o.setLine(a.reset(0,0).line(m-g-c,e).end()):o.setLine(a.reset(0,0).line(m+c-g,e).end()),o.trans(g,p)}t||(n?m-=_+c+d.width:m+=c+_,i.trans(m,p-d.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,u,d){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),m=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left")),!t&&!p&&i.layout(r||(n?"right":"left"));let f,y=this.$_calcX(e,s,h,n);if(f=n?_+l+c:u-_-c-l,o){const e=t?g.y+g.height/2-m:0;n?o.setLine(a.reset(0,0).line(f-y-_,e).end()):o.setLine(a.reset(0,0).line(f+_-y,e).end()),o.trans(y,m)}t||(n?f-=l+_+g.width:f+=_+l,i.trans(f,m-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,_){const c=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),d=e.yPos;!t&&!c&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?u.y+u.height/2-d:0;n?o.setLine(a.reset(0,0).line(-_,e).end()):o.setLine(a.reset(0,0).line(_,e).end()),o.trans(p,d)}t||(n?p-=_+l+u.width:p+=_+l,i.trans(p,d-u.height/2))}}],[Xr,class extends Co{constructor(t){super(t,"rct-histogram-series"),this._bars=new wn(this._pointContainer,Qo)}_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,o=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,l=i?t:e,c=i?e:t,u=h.getPos(l,s.getBaseValue(h)),d=i?0:e,p=o&&_(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign});this._getPointPool().forEach(((s,n)=>{const _=s.point,g=a.getPos(c,_.min),m=a.getPos(c,_.max),f=h.getPos(l,_.yValue),y=m-g+(m>g?-1:1),b=f-u;let x=g+(m-g)/2,w=d;_.xPos=x,_.yPos=w-=f,this._layoutPoint(s,n,x,w+b,y,b*r),p&&(p.labelView=o.get(_,0))&&(i&&(w=c-x,x=d,_.yPos=w,_.xPos=x+=h.getPos(l,_.yGroup)),p.pointView=s,p.x=x,p.y=w,p.wPoint=y,p.hPoint=b,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(((o,a)=>{const h=o.point,l=s.getPos(t,h.min),_=s.getPos(t,h.max),c=l+(_-l)/2,u=i.getPos(e,o.point.yValue)*n,d=y(1,_-l-1);h.xPos=c,h.yPos=r-u,o.wPoint=d,o.hPoint=u,o.layout(c,r)}))}}],[ur,$o],[qr,class extends ko{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 wn(this._pointContainer,Jo)),this._bars.prepare(s.length,((t,n)=>{const o=t.point=s[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=i.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)}))}}],[Qr,class extends Lo{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new wn(this._pointContainer,ta)}_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)}))}}],[tn,class extends zo{constructor(t){super(t,"rct-pareto-series")}}],[on,class extends To{constructor(e){super(e,"rct-pie-series"),this._sectors=new wn(this._pointContainer,ea,null,.5),this._pb=new Lr,this._cx=0,this._cy=0,this._rd=0,this._rdInner=0,this._slicedOff=0,this.add(this._circle=new Xn(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new Dn(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._labelContainer.add(this._lineContainer=new fo(e))}_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,s.options.icon?s.getUrl(s.options.icon):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,o=r-n;this._rd=n+(s._groupPos+s._groupSize)*o,this._rdInner=(n+s._groupPos*o)/this._rd}_runShowEffect(t){t&&ro.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 ea&&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(){super._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.yValue*(t===this._zombie?this._zombieRate:t._isDeleted()?t._vr:1))).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=>{1===e&&t._isDeleted()||1===e&&t._vr<1?(t.startAngle=n,t.angle=r*s*t._vr,t.yRate=100):t.isNull||(t.yRate=H(t.yValue*(t===this._zombie?this._zombieRate:t._isDeleted()?t._vr:1)/i)||0,t.startAngle=n,n+=t.angle=s*t.yRate*r,t.yRate*=100)}));else if(1==e){const e=t[0];e.startAngle=n,e.angle=s*this._zombieRate*r,e.yRate=100}}$_layoutSectors(t,e,s){const i=this.model,r=i.options.clockwise,n=this._getGrowRate(),o=i.getCenter(e,s),a=this._cx=o.x,h=this._cy=o.y,l=this._rd,_=this._rdInner,c=i.pointLabel,u=c.connector.options.curved,g=this._labelViews(),m="inside"===i.getLabelPos(c),f=x(c.options.radius,.7),y=this._pb,w=c.getDistance(m,l,_),v=c.getAlign();let S=null==g?void 0:g.textAlign();const V=this._lineContainer.setVis(c.connector.visible)?this._lineContainer:null,P=this._slicedOff=i.getSliceOffset(l)*n,A=[],C=[],k=[],L=(null==g?void 0:g.getWidth(0))||0;let N,E;if(this._wPlot=e,this._hPlot=s,!g||S||v||(S="center"),this._textView.visible){const t=this._textView._icon,e=this._textView._text.getBBox();let s=a,i=h;if(t){const r=x(this.model.innerText.options.iconGap,0),n=e.width,o=e.height,a=t.getBBox(),h=a.width,l=a.height;switch(this.model.innerText.getIconPos()){case"right":t.trans(n/2+r,(o-l)/2),s-=(h+r)/2;break;case"top":t.trans(h/-2,-(l+r)),i+=l+r/2;break;case"bottom":t.trans(h/-2,o+r),i-=(l+r)/2;break;default:t.trans(-(n/2+h+r),(o-l)/2),s+=(h+r)/2}}this._textView.trans(s,i-e.height/2)}this._circle.setVis(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this.$_calcAngles(t),this._sectors.forEach((t=>{const o=t.point;if(E=null==V?void 0:V.get(o),o.isNull)t.setVis(!1),g&&(N=g.get(o,0))&&N.setVis(!1),null==E||E.setVis(!1);else{const c=o.startAngle+o.angle/2,x=o.startAngle;let V=0,M=0;if(o.sliced&&n>=1&&!t.isDomAnimating()){const t=x+o.angle/2;V+=d(t)*P,M+=p(t)*P}if(t.trans(V,M).setVis(!0),o.xPos=a+d(c)*(P+l*f),o.yPos=h+p(c)*(P+l*f),t.setPieSector(g,null,{cx:a,cy:h,rx:l,ry:l,innerRadius:_,start:x,angle:b(o.angle),clockwise:r}),g&&(N=g.get(o,0))){const r=i.getLabelOff2(o);let n;m?(null==E||E.setVis(!1),this.$_layoutLabelInside(o,N,S,r,w,o.sliced?P:0)):(n=-1===v?this.$_layoutLabelAligned(!1,o,N,S,E,y,u,r,w,o.sliced?P:0):1==v?this.$_layoutLabelEnded(!1,o,N,S,E,y,u,r,w,o.sliced?P:0,L,e,s):this.$_layoutLabelOutside(!1,o,N,S,E,y,u,r,w,o.sliced?P:0),n?A.push(N):C.push(N)),N.setContrast(m&&t.dom).setVis(!0),k.push(N)}else null==E||E.setVis(!1)}}));const M=c.options.convergable,T=c.options.dedupeMode,O=c.options.overflow;g&&(m||0===v?"preserveOrder"!==T&&"largestFirst"!==T||g.dedupe(k,V,T):g.arrangeVertical(A,V,s,M,T,O)+g.arrangeVertical(C,V,s,M,T,O)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=i.getLabelOff2(r);N=g.get(r,0),E=null==V?void 0:V.get(r),(null==N?void 0:N.visible)&&(-1===v?this.$_layoutLabelAligned(!0,r,N,S,E,y,u,t,w,r.sliced?P:0):1==v?this.$_layoutLabelEnded(!0,r,N,S,E,y,u,t,w,r.sliced?P:0,L,e,s):this.$_layoutLabelOutside(!0,r,N,S,E,y,u,t,w,r.sliced?P:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,u=this._cx,g=this._cy,m=this._rd,f=m+l,y=u+d(c)*f,b=g+p(c)*f,x=y<u;!t&&!_&&s.layout(i||(x?"right":"left"));const w=s.getBBox(),v=b-w.height/2;let S,V,P,A=g+p(c)*m;if(x?(S=u+d(Math.PI)*m-h,V=S-w.width-a,P=u+d(Math.PI)*f-h,w.width):(S=u+d(0)*m+h,V=S+a,P=u+d(0)*f+h),r&&r.setVis(f>0)){const e=t?s.ty-v:0;o?r.setLine(n.reset(0,e).quad(.7*(y-S),e,y-S,0).end()):r.setLine(n.reset(0,e).line(y-S,0).end()),r.setPos(S,A),!_&&r.trans(S,b)}return t||(s.setPos(V,A-w.height/2),!_&&s.trans(V,A-w.height/2)),x}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,u){const g=s.isDomAnimating(),m=e.startAngle+e.angle/2,f=this._cx,y=this._cy,b=this._rd,x=b+l;let w=f+d(m)*x,v=y+p(m)*x;const S=w<f;!t&&!g&&s.layout(i||(S?"right":"left"));const V=s.getBBox(),P=v-V.height/2;let A,C,k,L=y+p(m)*b;if(S?(A=h+_+a,k=h+_-V.width,C=A):(A=c-h-_-a,k=c-h-_,C=A),r&&r.setVis(x>0)){const e=t?s.ty-P:0;o?r.setLine(n.reset(0,e).quad(0,e,w-C,0).end()):r.setLine(n.reset(0,e).line(w-C,0).end()),r.setPos(A,L),!g&&r.trans(C,v)}return t||(s.setPos(k,L-V.height/2),!g&&s.trans(k,L-V.height/2)),S}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating();!t&&!_&&s.layout(i);const c=s.getBBox(),u=e.startAngle+e.angle/2;let g=this._cx,m=this._cy,f=this._rd+.5*h,y=d(u)*l,b=p(u)*l,x=g+d(u)*this._rd,w=m+p(u)*this._rd,v=g+d(u)*f,S=m+p(u)*f;const V=v<g;let P,A;return V?(P=v-.2*h,A=P):(P=v+.2*h,A=P),r&&r.setVis(f>0)&&(t&&s.ty,o?r.setLine(n.reset(0,0).quad(v-x,S-w,P-x,S-w).end()):r.setLine(n.reset(0,0).lines(v-x,S-w,P-x,S-w).end()),r.setPos(x,w),!_&&r.trans(x+y,w+b)),t||(V?A-=c.width+a:A+=a,S-=c.height/2,s.setPos(A,S),!_&&s.trans(A+y,S+b)),V}$_layoutLabelInside(t,e,s,i,r,n){const o=e.isDomAnimating(),a=this.model,h=a.pointLabel,l=h.options.autoRotation,_=h.options.rotationMode,c=a.options.clockwise;!o&&e.layout(s||"center");const u=e.getBBox(),d=this._rd*this._rdInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=a.options.totalAngle||360;if("angle"===_){let i=p/t*s+90,r=(i+a.options.startAngle)%360;r+=c?0:360,i+=r>180?90:-90,e.setRotation(u.width/2,u.height/2,i)}else this.applyAutoRotation(e,p,t,s)}const g=h.options.align===Es?.3:h.options.align===Ns?.5:.7,m=d>0?d+(this._rd-d)/2:l?"angle"===_?this._rd*g+i:.8*this._rd+i:.7*this._rd+i,f=Math.cos(p),y=Math.sin(p);let b=this._cx+f*m,x=this._cy+y*m;e.move(b-u.width/2,x-u.height/2),b=this._cx+f*(n+m),x=this._cy+y*(n+m),e.trans(b-u.width/2,x-u.height/2)}$_slice(t,e,s){const i=this.model,r=this._labelViews(),n=i.pointLabel.getAlign(),o=this._slicedOff,a=i.options.autoSlice?i.options.sliceDuration:0,h=t.point,l=h.startAngle+h.angle/2;if((h.sliced=e)?t.transEx(d(l)*o,p(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,u=_.connector.options.curved,g="inside"===i.getLabelPos(_),m=r.get(h,0),f=i.pointLabel.getDistance(g,this._rd,this._rdInner);if(m){const t=!g&&c.get(h);if(s){let e=r.textAlign();!r||e||n||(e="center"),g?this.$_layoutLabelInside(h,m,e,_.getOffset(),f,o):0===n&&this.$_layoutLabelOutside(!1,h,m,e,t,this._pb,u,_.getOffset(),f,o)}if(e){let e=m.tx,s=m.ty,i=t.tx,r=t.ty;(g||0===n)&&(m.trans(m.x,m.y).transEx2(e,s,a),t&&t.trans(t.x,t.y).transEx(i,r,a))}else(g||0===n)&&(m.trans(m.tx,m.ty).transEx2(m.x,m.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}],[ln,class extends Eo{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new wn(t,sa)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&(this._polar,ro.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),o=s._xAxisObj,a=s._yAxisObj,h=this._polar=s.chart._body.getPolar(o),l=this._getGrowRate(),_=this._radius=Math.max(0,+s.options.radius||0)*l,c=+i.rotation||0,u=+i.jitterX||0,g=+i.jitterY||0,m=s.pointLabel,f=m.options.position,y=m.getOffset(),b=this._labelViews(),x=a.prev(r?t:e),w=o.prev(h?D:r?e:t),v=r?0:e;let S;this._markers.forEach(((i,m)=>{const V=i.point,P=b&&(S=b.get(V,0));if(i.setVis(!V.isNull)){const m=this._getDrawer(s.getShape(V)),b=C.jitter(V.xValue,u),A=C.jitter(V.yGroup,g);let k,L;if(h){const t=h.start+o.getPos(w,b),e=a.getPos(h.rd,A)*l;k=h.cx+e*d(t),L=h.cy+e*p(t)}else k=o.getPos(w,b),L=v-a.getPos(x,A),r&&(k=a.getPos(x,A),L=e-o.getPos(w,b));V.xPos=k,V.yPos=L,i.setVis(!!h||!n||k>=0&&k<=t&&L>=0&&L<=e)?(i.setPath(m(i._radius||_)),i.trans(k,L).rotate(c),P&&this._layoutLabelView(S,f,y,_,k,L)):P&&P.setVis(!1)}else P&&P.setVis(!1)}))}getNearest(t,e){const s=this._markers._internalItems();if(s&&s.length>0){const i=this.model.options.radius,r=s.reduce(((s,r)=>s.distance(i,t,e)<r.distance(i,t,e)?s:r));return{pv:r,dist:r.distance(i,t,e)}}}canHover(t,e,s){return t<=this.model.options.radius+s}}],[un,class extends Lo{constructor(t){super(t,"rct-waterfall-series"),this._bars=new wn(this._pointContainer,Po),this.add(this._lineContainer=new Yt(t,"rct-waterfall-series-lines")),this._lines=new wn(this._lineContainer,nr)}_getPointPool(){return this._bars}_getLowValue(t){return Math.min(t.from,t.to)}_getHighValue(t){return Math.max(t.from,t.to)}_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 o=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),a=o.y;let h;h=o._isSum||o._isMid?a<0?i:i-n:a<0?i-n:i,t.setHLine(h,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)}_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._isSum&&e.options.sumColor?this._setPointColor(t,e.options.sumColor):s.y<0&&e.options.negativeColor?this._setPointColor(t,e.options.negativeColor):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)}$_parepareBars(t,e,s){this._bars.prepare(s.length,((t,i)=>{const r=t.point=s[i];this._setPointStyle(t,e,r);const n=r._isMid?"rct-waterfall-point-mid":r._isSum?"rct-waterfall-point-sum":r.y<0?"rct-waterfall-point-negative":"";n&&t.setStyleOrClass(n)})),this._lines.prepare(s.length-1,((t,e)=>{t.visible=!s[e].isNull&&!s[e+1].isNull}))}}]),Qn.register([Mi,Ro],[Ni,Oo],[Ei,Bo]);class na extends Mn{constructor(t){super(t,"rct-axis-grid"),this._lines=new wn(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),o=this._lines.prepare(n.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),a=o.count-1;let h;o.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?o.forEach(((e,i)=>{h=0===i?l:i===a?_:t.visible,e.setVis(h)&&e.setVLine(s.prev(n[i]),0,r)})):o.forEach(((e,o)=>{n[o],h=0===o?l:o===a?_:t.visible,e.setVis(h)&&e.setHLine(r-s.prev(n[o]),0,i)}))}}class oa extends jt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new Zt(t)),this._mask.setStroke("none"),this.add(this._upLine=new Zt(t)),this._upLine.setFill("none"),this.add(this._downLine=new Zt(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 Lr;if(s){let t=0,s=0,n=i/2,o=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(o,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(o,t),t-=20,r.line(n,t);this._mask.setPath(r.end())}else{let e=0,s=0,n=i/2,o=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,o);e<t;)e+=20,r.line(e,n),e+=20,r.line(e,o);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,o);e>=0;)e-=20,r.line(e,n),e-=20,r.line(e,o);this._mask.setPath(r.end())}}}class aa extends jt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new Dn(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,this.model.label,null),this._labelView.layout(this.textAlign()||"center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}}class ha extends aa{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Zn: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,o=this._line,a=this._labelView.setVis(r.visible)&&this._labelView,h=a.getBBox(),l=x(n.offsetX,0),_=x(n.offsetY,0);let c,u;if(this.vertical()){const r=s.axis.getPos(t,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setVLine(r,0,e),a)){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":u="inside"===n.position?e-h.height-_:e+_;break;case"middle":u=(e-h.height)/2-_;break;default:u="inside"===n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(a.setVis(o.setVis(!isNaN(r)))&&(o.setHLine(r,0,t),a)){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":u=r+_;break;case"middle":u=r-h.height/2-_;break;default:u=r-h.height-_}}}a.visible&&a.trans(c,u)}_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,o=i.axis.getStartAngle(),a=i.axis.getPos(s.rd,i.options.value);r.setArc(s.cx,s.cy,a,o,i.axis.getTotalAngle(),!1),r.setStyle(J,"none"),n&&n.trans(s.cx+a*d(s.start),s.cy+a*p(s.start))}}class la extends aa{constructor(t,e){super(t),this.insertFirst(this._box=new(e?qn:Ls)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e);const s=e.options,i=f(s.startValue,s.endValue),r=y(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,[o,a]=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,o),u=s.axis.getPos(t,a);if(!isNaN(i)&&!isNaN(u)&&h.setVis(n.setVis(u!==i))){let s,o;switch(r.align){case"center":s=i+(u-i-l.width)/2+_;break;case"right":s=u-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":o="inside"===r.position?e-l.height-c:e+c;break;case"middle":o=(e-l.height)/2-c;break;default:o="inside"===r.position?c:-1*(l.height+c)}n.setBox(i,0,u,e),h&&h.trans(y(0,f(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),u=e-s.axis.getPos(e,a);if(!isNaN(i)&&!isNaN(u)&&h.setVis(n.setVis(i!==u))){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=u+(i-u-l.height)/2-c;break;default:s=u+c}h&&h.trans(e,s),n.setBox(0,u,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,o=i.axis.getStartAngle(),a=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:a/h,start:o,angle:D,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*d(s.start),s.cy+t*p(s.start))}}}class _a extends Yt{constructor(){super(...arguments),this._views=new wn(this,Zt)}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(Cs.rectangle(i,0,r-i,e))}else{const i=n.axis.getPos(e,n.from),r=n.axis.getPos(e,n.to);s.setPath(Cs.rectangle(0,e-i,t,i-r))}s.setFill(n.color)}))}}class ca extends Yt{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}prepare(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof la?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof Ge?i=this._rangePool.pop()||new la(t,s):e instanceof Ie&&(i=this._linePool.pop()||new ha(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class ua extends Zt{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,o=n._isHorz,a=new Lr;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(o?i-e:s):n.xValueAt(o?e:r-s)),n instanceof Xs&&(l=c(l)),!isNaN(l)){const t=n.getPos(h,l);let e=n.getUnitLen(h,l);o?a.rect(t-e/2,0,e,r):a.rect(0,r-t-e/2,i,e)}}else(t||this.model.options.showAlways)&&(o?a.vline(e,0,r):a.hline(s,0,i));this.setPath(a.end())}}class da extends Wn{constructor(t){super(t,"Reset Zoom",da.CLASS_NAME),this.setVis(!1)}}da.CLASS_NAME="rct-reset-zoom";class pa extends Yt{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new ks(t,"rct-empty-view-back")),this.add(this._labelView=new Dn(t,"rct-empty-view-label"))}layout(t,e,s){this.setStyleOrClass(t._style),"background"===t.options.effect&&this._backView.setStyleOrClass(t.options.backgroundStyle),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 ga extends Mn{constructor(t,e){super(t,ga.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 ks(t)),this._hitTester.setFill("transparent"),this.add(this._background=new ks(t,"rct-body-background")),this.add(this._image=new Rn(t,!0,"rct-body-image")),this.add(this._emptyView=new pa(t)),this.add(this._gridRowContainer=new _a(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new Yt(t,"rct-axis-grids")),this.add(this._baseContainer=new Yt(t,"rct-axis-bases")),this.add(this._guideContainer=new ca(t,"rct-axis-guides")),this.add(this._annotationContainer=new Yt(t,"rct-annotations")),this.add(this._seriesContainer=new Yt(t,"rct-series-container")),this.add(this._axisBreakContainer=new Yt(t,"rct-axis-breaks")),this.add(this._labelContainer=new Yt(t,"rct-label-container")),this.add(this._frontGuideContainer=new ca(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new Yt(t,"rct-front-annotations")),this.add(this._feedbackContainer=new Yt(t,"rct-feedbacks")),this.add(this._zoomButton=new da(t)),this._crosshairViews=new wn(this._feedbackContainer,ua)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}prepareRender(t,e,s){this._animatable=Ht._animatable&&e.animatable(),this._polar=s,this._prepareSeries(t,e,e._getSeries().getVisibleSeries()),e._getGauges()&&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,o=this._seriesViews,a=o.length,h=t.x>=0&&t.x<s&&t.y>=0&&t.y<i;let l,_;if(e instanceof SVGElement&&(e.classList.contains(vo.POINT_CLASS)||e.parentElement instanceof SVGElement&&e.parentElement.classList.contains(vo.POINT_CLASS)))for(let t=a-1;t>=0;t--)if(_=o[t].pointByDom(e),_){l=o[t];break}const c=null==e?void 0:e.classList,u=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),d=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!u;if(this._crosshairViews.forEach((e=>{e.setVis(d)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(a>0){const e=this.chart()._chartOptions.pointHovering.getHintDistance(null==l?void 0:l.model);let s,i,_=!n;for(const t of o)if(!(t.model instanceof _r)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=x(o.getHintDistance(),e),i=o.getNearest2(t.x,t.y,r),n.push({hint:s,sv:o,pv:i})}));const a=n.reduce(((e,s)=>e.pv&&s.pv?r?b(e.pv.pv.point.xPos-t.x)<b(s.pv.pv.point.xPos-t.x)?e:s:b(e.pv.pv.point.yPos-t.y)<b(s.pv.pv.point.yPos-t.y)?e:s:e||s));l=a.sv,i=a.pv,s=a.hint}else l=o[0],s=x(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.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.chart()._chartOptions.pointHovering,r=this._focused,n=this._siblings,o=this._siblingSeries;let a,h,l;if(t&&t.model.options.interactive&&e&&i.visible)switch(i.getScope(t.model,e.point)){case"axis":l=t.model._xAxisObj.getSeries();case"group":l||(l=t.model._group.getVisibleSeries());const i=l.map((t=>{if(t instanceof xi){let e,i=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof Ar){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:i,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,i,r);o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2)-a}else o=Math.sqrt((n.xPos-s.x)**2+(n.yPos-s.y)**2);o<i&&(i=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)}));a=l.map((t=>this._owner.getSeriesView(t))),h=[],i.forEach(((t,e)=>{h.push(a[e].getPointView(t))}));break;default:a=[t],h=[e]}let _=[];if(a&&a.forEach(((t,e)=>{_.push(...t.getSiblings(h[e]))})),_=_.length>1?_.sort(((t,e)=>t.hash-e.hash)):_.length>0?_:null,C.equalArrays(n,_)||(a&&a.forEach(((t,e)=>{t.focusPoints(t.getSiblings(h[e]))})),o&&o.forEach((t=>{(!a||a.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=a,this._siblings=_),e!==r){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,t&&t.model.options.interactive&&this.$_focusSeries(t,!0),this.chart()._chartOptions.options.seriesHovering&&t.model.options.interactive&&this.$_hoverSeries(t))}this._focused&&t.model.options.interactive&&(this._focused!==r||!this._owner.tooltipVisible()||this.model.chart._tooltip.isFollowPointer(t.model))?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():!this._focused&&this._owner.tooltipVisible()&&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(vo.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(vo.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(),o=r.xAxis,a=n?this.height:this.width,h=o.valueAt(a,n?a-i:t),l=o.valueAt(a,n?a-e:s);o.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 No&&e.endHover(t,!1),e.setBoolData(vo.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,o=e.base();if(this._zoomRequested=!1,this._seriesClip||(this._seriesClip=this.control.clipBounds(),this._seriesClip2=this.control.clipBounds(),this._bodyClip=this.control.clipBounds()),this._background.setStyleOrClass(o._style),o!==e&&this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||n.isWidget()),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)}_setImage(t,e){const s=this._image;s.setVis(s.setImage(this.model.image.options.url,t,e))&&s.setStyleOrClass(this.model.image._style)}_doLayout(){const t=this.model,e=this.width,s=this.height;if(this._image,this._inverted?(this._seriesClip.setBounds(0,-e,s,e),this._seriesClip2.setBounds(0,0,e,s)):(this._seriesClip.setBounds(0,0,e,s),this._seriesClip2.setBounds(0,0,e,s)),this._bodyClip.setBounds(0,0,e,s),this._hitTester.resize(e,s),this._background.resize(e,s),this._setImage(e,s),this._seriesViews.forEach((t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.resize(e,s),t.trans(0,0),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){for(const t of this._gridViews.values())t.resize(e,s),t.layout();for(const t of this._baseViews.values()){const i=t.tag;t.setStyleOrClass(i.baseLine._style),i._isHorz?t.setVLine(i.getPos(e,i.getBaseValue()),0,s):t.setHLine(i.getPos(s,i.getBaseValue()),0,e)}this._breakViews.forEach((t=>{const i=t._model,r=i.axis;r._isHorz?r.options.reversed?t.trans(e-i._sect.pos,0):t.trans(i._sect.pos,0):r.options.reversed?t.trans(0,i._sect.pos):t.trans(0,s-i._sect.pos-i._sect.len),t.layout(e,s,i.axis._isHorz)}));const t=this.control;if(this._guideClip)this._guideClip.resize(t.width(),t.height());else{const e=t._padding;this._guideClip=t.clipBounds(-1*(e.left+this.tx),-1*(e.top+this.ty),t.width(),t.height())}[this._guideContainer,this._frontGuideContainer].forEach((t=>{t._views.forEach((t=>t.visible&&t.layout(e,s))),t.setClip(this._guideClip)})),this._gridRowContainer.layout(e,s,!1)}this.$_prepareCrosshairs(t.chart),this._gaugeViews.forEach((t=>{t.resizeByMeasured(),t.layout().transp(t.getPosition(e,s))})),this._layoutAnnotations(this._inverted,this,e,s),this._zoomButton.visible&&this._zoomButton.trans(e-this._zoomButton.getBBox().width-10,10),this._emptyView.setVis(this.$_isEmpty(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(this.model.emptyView,e,s))}$_isEmpty(t){if(!1!==t.emptyView.visible&&t.chart.isEmpty(!0))return!0;let e=!0;for(const t of this._seriesViews)if(!t.isEmptyView()){e=!1;break}if(e)for(const t of this._gaugeViews)if(!t.isEmptyView()){e=!1;break}return e}$_createGaugeView(t,e){return new(Jn[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=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 o.keys())(!s||!e.containsAxis(t)||t instanceof zi&&!t.baseLine.visible||!t.isBaseVisible())&&(o.get(t).remove(),o.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 na(t);r.set(e,s),i.add(s)}if(e instanceof zi&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new nr(t,"rct-axis-baseline");o.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 o=r.get(s)||ra(t,s);o._setChartOptions(i,this._animatable,e.loadAnimatable()),o.parent||(this._seriesContainer.add(o),this._labelContainer.add(o._labelContainer)),r.set(s,o),n.push(o),o.prepareSeries(t,s,this._polar)})),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,o=this._gaugeViews;for(const t of n.keys())s.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=s,o.forEach((t=>t.remove())),o.length=0,s.forEach((s=>{const a=n.get(s)||this.$_createGaugeView(t,s);i.add(a),n.set(s,a),o.push(a),a.prepareGauge(t,s),a._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.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||ia(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_prepareAxisBreaks(t,e){const s=this._axisBreakContainer,i=this._breakViews,r=[];for([e._getXAxes(),e._getYAxes()].forEach((t=>t.forEach((t=>{t instanceof $i&&r.push(...t._getBreaks())}))));i.length<r.length;){const e=new oa(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._needAxes()&&[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),!this._polar&&r.model.needClip()&&r.resetClip(this.control,s,i)}))}}ga.BODY_CLASS="rct-body";class ma extends jt{constructor(t){super(t,fa.HANDLE_STYLE),this.add(this._back=new ks(t)),this.add(this._shape=new Zt(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*f(t,e);const r=new Lr;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 fa extends Mn{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(fa.HANDLE_STYLE)}static isMask(t){return t.classList.contains(fa.MASK_STYLE)}constructor(t){super(t,fa.CLASS_NAME),this.add(this._back=new ks(t,fa.BACK_STYLE)),this.add(this._container=new Yt(t,null)),this.add(this._mask=new ks(t,fa.MASK_STYLE)),this.add(this._trackView=new ks(t,fa.TRACK_CLASS)),this.add(this._thumbView=new ks(t,fa.THUMB_CLASS)),this.add(this._startHandle=new ma(t)),this.add(this._endHandle=new ma(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 o=s,a=i;return e._vertical?o=e.getSize():a=e.getSize(),e._naviChart.layoutAxes(o,a,!1,1),this.$_prepareSeriesView(t,n),this.$_prepareXAxisView(t,n),this.$_prepareYAxisView(t,n),e._naviChart.xAxis._calcPoints(o,101),e._naviChart.yAxis._calcPoints(a,1),{width:o,height:a}}_doLayout(t){const e=this.model,s=e.axis()._zoom,i=e.options,r=this.width,n=this.height;if(this._back.resize(r,n),e._vertical);else{const t=s?(s.start-s.min)*r/s.total():0,e=s?(s.end-s.min)*r/s.total():r;this._mask.setVis(i.mask.visible)&&(this._mask.setBounds(t,0,e-t,n),this._mask.setStyleOrClass(i.mask.style)),this._trackView.setBounds(-2,n,r+4,6),this._trackView.setRadius(4),this._thumbView.setBounds(t,n,e-t,6),this._startHandle.setVis(i.handle.visible),this._endHandle.setVis(i.handle.visible),this._startHandle.visible&&this._endHandle&&(this._startHandle.layout(n/3,n/3,!1),this._startHandle.trans(t,n+3),this._endHandle.layout(n/3,n/3,!1),this._endHandle.trans(e,n+3),this._startHandle.setStyleOrClass(i.handle.style),this._endHandle.setStyleOrClass(i.handle.style))}this._seriesView&&(this._seriesView.measure(this.doc,e._naviChart.firstSeries,r,n,1),this._seriesView.resize(r,n),this._seriesView.layout(),this._seriesView.afterLayout()),this._xAxisView&&(this._xAxisView.measure(this.doc,e._naviChart.xAxis,r,n,1),this._xAxisView.resize(r,n),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=ra(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1)}$_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 Yn(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 Yn(t)),i._simpleMode=!0)}}fa.CLASS_NAME="rct-navigator",fa.BACK_STYLE="rct-navigator-back",fa.MASK_STYLE="rct-navigator-mask",fa.HANDLE_STYLE="rct-navigator-handle",fa.HANDLE_BACK_STYLE="rct-navigator-handle-back",fa.TRACK_CLASS="rct-navigator-track",fa.THUMB_CLASS="rct-navigator-thumb";class ya extends Kt{constructor(t){super(),this.chart=t}}class ba extends ya{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=y(0,e-(o.x-n.x)),this._yStart=y(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new ks(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const s=this.chart.getBounds(),i=this._body.getBounds();this._vertical?(e=y(0,f(i.height,e-(i.y-s.y))),this._body.setZoom(0,f(y(0,this._yStart),e),this._body.width,y(f(this._yStart,i.height),e))):(t=y(0,f(i.width,t-(i.x-s.x))),this._body.setZoom(y(0,f(this._xStart,t)),0,y(f(this._xStart,i.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,s,i,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=y(0,f(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,f(this._yStart,r),this._body.width,b(this._yStart-r))):(i=y(0,f(o.width,i-(o.x-n.x))),this._feedback.setBounds(f(this._xStart,i),0,b(this._xStart-i),this._body.height)),!0}}class xa extends ya{constructor(t,e){super(t),this._view=e}_doStart(t,e,s,i,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?s-t.y:e-t.x,this._zoomLen=o.length(),!0}return!1}_doDrag(t,e,s,i,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(i,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height),n.model.axis.zoom(o,o+this._zoomLen)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o),n.model.axis.zoom(o,o+this._zoomLen),console.log(o)),!0}}class wa extends ya{constructor(t,e,s){super(t),this._view=e,(this._isStart=e._startHandle.contains(s))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,s,i,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?s-o.y-n.height/2:e-o.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,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(i,r).x-this._startOff;const h=o._zoom.total(),l=o._zoom.min,_=n.model.options.minSize;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(a*h/n.width+l,NaN,_):o.zoom(l,NaN,_):a>0&&a<n.width?o.zoom(NaN,a*h/n.width+l,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class va extends ya{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(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?s-o.y:e-o.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,o=n.svgToElement(i,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(o*this._totalLen/n.height):this.$_moveZoom(o*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=y(0,f(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class Sa{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(),s=t.target,{x:i,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const s=this.isDragging(),n=this._clickElement;i<0||i>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(s?this.$_doDrag(t,n,i,r):(!this._dragTracker&&(b(this._clickX-i)>3||b(this._clickY-r)>3)||this._dragTracker&&!s)&&this.$_startMove(t,n,i,r))}else this.$_stopDragTracker(t,s,i,r,!0);this._prevX=i,this._prevY=r,this.isDragging()?(e.pointerMoved(-1,-1,null),this._stopEvent(t)):e.getButton(s)||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,o;const a=this._chart.chart.exporter;if(a.isContextMenuVisible()&&a.toggleContextMenu(),i)!0!==i.click()&&e.buttonClicked(i);else if(n=e.legendByDom(s))if(n.source instanceof $s){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 To&&s.togglePointVisible(t)}}else n.source.visible=!n.source.visible,e.bodyView().hoverSeries(n.source.visible?n.source:null);else(o=e.seriesByDom(s))?o.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 Hn.isThumb(t)?new xa(this._chart,i.getScrollView(t)):fa.isHandle(t)?new wa(this._chart,i._navigatorView,t):fa.isMask(t)&&r&&r.model.isZoomed()?new va(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new ba(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 Va extends Yt{constructor(t){super(t,Va.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(e,s){if(this.setVis(s&&s.length>0)){const i=this._itemViews,r=this._separators;for(;i.length<s.length;){const s=new ee(e,"rct-history-item");s.anchor=t.TextAnchor.START,i.push(s)}for(;i.length>s.length;)i.pop().remove();for(;r.length<s.length-1;){const s=new ee(e);s.anchor=t.TextAnchor.START,s.text=">",r.push(s)}for(;r.length>s.length-1;)r.pop().remove();this.$_layout(s)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let o=0;o<r;o++)e[o].text=t[o].name,e[o].transX(n),o<r-1&&(n+=e[o].width+i,s[o].transX(n),n+=s[o].width+i)}}Va.TITLE_CLASS="rct-history";class Pa extends Mn{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new ks(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new ee(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){var n,o;const a=e.source;this._label.setBoolData("hidden",!a.visible),this._marker.setBoolData("hidden",!a.visible),this._label.setBoolData("empty",null===(n=a.isEmpty)||void 0===n?void 0:n.call(a)),this._marker.setBoolData("empty",null===(o=a.isEmpty)||void 0===o?void 0:o.call(a)),this._label.text=e.text()||"…";const h=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():vn,l=Sn(this._label.getBBox());return this._gap=x(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:y(h.height,l.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 Aa extends Tn{constructor(t){super(t,Aa.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new wn(this,Pa)}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,o=e.items(),a=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,a?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,a,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,o=t.itemGap||0,a=this._margins,h=this._paddings,l=this._vertical,_=a.left+h.left,c=a.top+h.top;let u,d=_,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||(u=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-u)/2:this.height-u),t.forEach((t=>{t.trans(d,p),p+=t.height+o})),d+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),d=_,"center"!==r&&"end"!==r||(u=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,d+="center"===r?(this.width-u)/2:this.width-u),t.forEach((t=>{t.trans(d,p),d+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,a=e.items(),h=this._itemViews,l=o.itemGap||0,_=o.lineGap||0,c=e.getMarkerSize(),u=h.count,d=this._rowViews=[],p=this._sizes=[];let g,m,f,b;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,c)),e.measure(t,a[s],r,n,1)}));let x=0,w=0;if(s){for(;x<u;)b=h.get(x),w%i==0?(d.push(f=[b]),m=b.mh,w++,x++):(m+=l+b.mh,m<=n?(f.push(b),w++,x++):w=0);this._wMarkers=[],g=m=0,d.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=y(s,t.mw),r=y(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=y(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(d.length-1)}else{for(;x<u;)b=h.get(x),w%i==0?(d.push(f=[b]),g=b.mw,w++,x++):(g+=l+b.mw,g<=r?(f.push(b),w++,x++):w=0);g=m=0,d.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=y(s,t.mh)})),e+=l*(t.length-1),g=y(g,e),m+=s,p.push(s)})),m+=_*(d.length-1)}return{width:g,height:m}}}Aa.LEGEND_CLASS="rct-legend";class Ca extends jt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Xn(t))}layout(){}}class ka extends jt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new Yt(t,"rct-polar-axis-markers")),this._markViews=new wn(this._markContainer,Ca),this.add(this._gridContainer=new jt(t,"rct-polar-axis-grids")),this._labelViews=new wn(this._labelContainer=s,In,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,this.setVis(e.visible)&&(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(jn)?t.setLabel(s,e,r.replace(jn,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(s.visible&&e.visible){const t=e._ticks;this._labelContainer.setStyleOrClass(s._style);const{start:i,total:r}=s.chart._body.getPolar(e),n="auto"===s.options.rotation,o=t.length;this._labelViews.prepare(o,((a,h,l)=>{a.setVis(!0),this._prepareLabel(a,t[h],s,l);const _=n?(i+e.getPos(o,t[h].value))/r*360+90:0,{width:c,height:u}=a.getBBox();a.setRotation(c/2,u/2,_)}))}else this._labelViews.forEach((t=>t.setVis(!1)))}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 La extends ka{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new wn(this._gridContainer,nr,La.GRID_CLASS),e.insertFirst(this._startView=new nr(t,La.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new nr(t,La.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Zn(t,La.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&&t.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(t.visible&&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 o=t.getStartAngle(),a=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*a/D)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+d(o+h)*i,_=s+p(o+h)*i;n.setFill("none"),n.setLine(e,s,l,_),n.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const n=this._labelViews.count,a=Math.ceil(9/(360/n)),h=i+t.tick.options.length,l=this._labelContainer.textAlign()||"center";this._labelViews.forEach(((t,i)=>{if(t.setVis(i%a==0)){t.layout(l);const n=r[i],a=t.getBBox(),_=o+n.pos,c=e+d(_)*(h+a.width/2)-a.width/2,u=s+p(_)*(h+a.height/2)-a.height/2;t.trans(c,u)}})),n>2&&b(r[n-1].pos-r[n-2].pos)<D/24&&this._labelViews.get(n-1).setVis(!1)}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,t.getTotalAngle(),!0);else{const t=[];r.map((r=>{const n=r.pos;t.push(e+d(o+n)*i,s+p(o+n)*i)})),this._lineView.setPolyline(t)}this._startView.visible&&(this._startView.setLine(e,s,e+d(o)*i,s+p(o)*i),this._endView.setLine(e,s,e+d(o+a)*i,s+p(o+a)*i))}}La.LINE_CLASS="rct-polar-xaxis-line",La.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",La.GRID_CLASS="rct-polar-xaxis-grid-line";class Na extends ka{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridLines=new wn(this._gridContainer,Zn,Na.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(t.visible&&!1!==t.grid.visible)&&this._gridLines.prepare(e.length,null),(this._lineView.visible=t.visible&&r.visible)&&this._lineView.setStyleOrClass(r._style)}_doLayout(t,e,s,i,r,n){const o=n.getStartAngle(),a=n.getTotalAngle();if(this._gridContainer.visible){const i=this._circular;this._gridLines.forEach(((h,l)=>{const _=r[l].pos;if(h.setFill("none"),i)h.setArc(e,s,_,o,a,!0);else{const t=[];n._ticks.forEach((i=>{const r=i.pos;t.push(e+d(o+r)*_,s+p(o+r)*_)})),h.setPolyline(t)}h.setStyleOrClass(t.grid.options.style)}))}if(this._labelContainer.visible)if(n.isArced()){const t=n.getStartAngle();this._labelViews.forEach(((i,n)=>{const o=e+d(t)*r[n].pos-i.getBBox().width/2,a=s+p(t)*r[n].pos-i.getBBox().height/2;i.setContrast(null).trans(o,a)}))}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)}}Na.GRID_LINE_STYLE="rct-polar-yaxis-grid-line";class Ea extends ga{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,s,i,r){const n=e.chart,o=super._doMeasure(t,e,s,i,r);return this._prepareAxes(t,n.xAxis,n._getYAxes().items(),this.model.options.circular,n.xAxis.isArced()),o}_doLayout(){const t=this.model.setPolar(this.width,this.height),{cx:e,cy:s,rd:i}=t.getPolar(null);this._setImage(this.width,this.height),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.visible&&this._xAxisView.layout(t.chart.yAxis,e,s,i),this._yAxisViews.forEach((r=>{r.visible&&r.layout(t.chart.xAxis,e,s,i)})),[this._guideContainer,this._frontGuideContainer].forEach((e=>{e._views.forEach((e=>e.visible&&e.model.axis.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 Yt(t,"rct-polar-axis-labels")),this.insertFirst(this._lineContainer=new Yt(t,"rct_axis-lines")),this.insertFirst(this._axisContainer=new Yt(t,"rct-polar-axes")));const n=this._yAxisViews;for(;n.length<s.length;){const e=new Na(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 La(t,this._lineContainer,this._axisLabelContainer)),this._xAxisView.prepare(t,e,i,r)}}class Ma extends Tn{constructor(t,e){super(t,e?Ma.SUBTITLE_CLASS:Ma.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new ee(t)),this._richText=new _e}_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),Sn(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var Ta,Oa;Ma.TITLE_CLASS="rct-title",Ma.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Ta||(Ta={}));class Ba extends jt{constructor(e){super(e,Ba.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 Zt(e,"rct-tooltip-back")),this.add(this._top=new Zt(e,"rct-tooltip-top")),this.add(this._textView=new ee(e,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+Ht.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new _e,this.close(!0,!1)}show(t,e,s,i,r,n,o){const a=e.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,a,s&&s.map((t=>t.point)));if(!l)return;const _=h.options,c=_.text||"AxisContext"!==l.constructor.name&&t._group?t._group.getTooltipText(t,a):l.getTooltipText(t,a);if(!c||!c.trim())return;this.setStyleOrClass(h._style);const u=this.control,d=u.contentWidth(),p=u.contentHeight(),g=this._textView,m=t.chart.isInverted();let b=t._yAxisObj.options.reversed;this._richText.setFormat(c),this._richText.build(g,NaN,NaN,null,h.getTextDomain());const x=g.getBBox();let w=y(_.minWidth||0,x.width+16),v=y(_.minHeight||0,x.height+12)+this._topHeight,S=t._calcedColor;t instanceof ci?(t.options.legendByPoint||t._colorByPoint())&&(S=a._calcedColor):t._colorByPoint()&&(S=getComputedStyle(e.dom).fill),this._top.setFill(S);const V="visible"===this.getStyle("visibility")?300:0,P=_.offset+this._tailSize,A=n.getFocusPointView().getBounds(),C=u.getBounds();let k,L=!1;if(m){k=r-v/2-y(0,f(r-v/2,p-v)),this._tailVisible=Math.abs(v/2-this._radius-this._tailSize/2)>Math.abs(k),L=h.isFollowPointer(t)?b?w+P>i:i+w+P>d:b?w+P>A.x-C.x+A.width:A.x-C.x-P>d-w,L&&(b=!b);const e=b?Ta.LEFT:Ta.RIGHT;this.drawTooltip(0,0,w,v,e,k),b?i-=w+P:i+=P,r-=v/2}else{k=i-w/2-y(0,f(i-w/2,d-w)),this._tailVisible=Math.abs(w/2-this._radius-this._tailSize/2)>Math.abs(k),L=h.isFollowPointer(t)?b?r+v+P>p:r-(v+P)<0:b?p-(A.y-C.y-u._padding.top)<v+P:C.bottom-A.bottom+P>p-v,L&&(b=!b);const e=b?Ta.BOTTOM:Ta.TOP;this.drawTooltip(0,0,w,v,e,k),i-=w/2,b?r+=P:r-=v+P}i=y(0,f(i,d-w)),r=y(0,f(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:Li.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){ws(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,n){const o=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+s-a,e,"Q",t+s,e,t+s,e+a,"L",t+s,e+i-a,"Q",t+s,e+i,t+s-a,e+i,"L",t+a,e+i,"Q",t,e+i,t,e+i-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case Ta.TOP:l=l.concat(["M",t+s/2-o/2+n,e+i,"L",t+s/2+n,e+i+o,"L",t+s/2+o/2+n,e+i]);break;case Ta.BOTTOM:l=l.concat(["M",t+s/2-o/2+n,e,"L",t+s/2+n,e-o,"L",t+s/2+o/2+n,e]);break;case Ta.LEFT:l=l.concat(["M",t+s,e+i/2-o/2+n,"L",t+s+o,e+i/2+n,"L",t+s,e+i/2+o/2+n]);break;case Ta.RIGHT:l=l.concat(["M",t,e+i/2-o/2+n,"L",t-o,e+i/2+n,"L",t,e+i/2+o/2+n])}const _=r===Ta.BOTTOM,c=_?["M",t,e+i-h,"l",s,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-s,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",s-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-s,0,"l",0,a-h,"q",0,-a,a,-a],u=this._textView,d=u.getBBox();t+=(s-d.width)/2,e+=(i-d.height+(_?-h:h))/2,u.trans(t,e),this._top.setPath(c),this._back.setPath(l)}}Ba.CLASS_NAME="rct-tooltip";class Ra extends On{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Ma(t,!1)),this.add(this.subtitleView=new Ma(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,_=0,c=0,u=this.titleView,d=s,p=0,g=0;switch(u.setVis(n.visible)?(a=u.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):u.setModel(n),(u=this.subtitleView).setVis(o.visible)?(a=u.measure(t,o,s,i,r),c=this._hSub=a.height,_=this._wSub=a.width,g=+o.options.titleGap||0):u.setModel(o),o.options.position){case"left":case"right":p=y(l,c),d=h+g+_;break;default:p=l+g+c,d=y(d,h+_)}return p>0&&(p+=this.titleView.visible?x(n.options.gap,0):x(o.options.gap,0)),{width:d,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,o=r&&r.options,a=i&&i.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,h=r&&r.visible?this._wSub>t.wPlot||"chart"===o.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"===o.alignBase?0:t.xPlot;if(a>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=y(this._hTitle,this._hSub);g=y(g,g+t(i,e,this._hTitle)),f=y(f,f+t(r,e,this._hSub))},u=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},d=()=>{if(m=y(m,m+u(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":b=m;break;case"right":b=m+this._wTitle-this._wSub;break;default:b=m+(this._wTitle-this._wSub)/2}else b=y(b,b+u(r,h,this._wSub))},p=x(o.titleGap,0);let g=0,m=l,f=0,b=_;switch(n.align){case"left":switch(o.position){case"left":m=b+this._wSub+p,c();break;case"right":switch(b=m+this._wTitle+p,o.align){case"center":b=y(b,b+(h-this._wTitle-this._wSub)/2);break;case"right":b=y(b,_+h-this._wSub)}c();break;case"top":d(),g=f+this._hSub+p;break;default:d(),f=g+this._hTitle+p}break;case"right":switch(o.position){case"left":switch(m+=a-this._wTitle,o.align){case"center":b+=(a-this._wTitle-this._wSub)/2;break;case"right":b=m-p-this._wSub}c();break;case"right":b+=h-this._wSub,m=b-p-this._wTitle,c();break;case"top":d(),g=f+this._hSub+p;break;default:d(),f=g+this._hTitle+p}break;default:switch(o.position){case"left":switch(m+=(a-this._wTitle)/2,o.align){case"left":break;case"center":b+=(m-b-this._wSub)/2;break;case"right":b=m-p-this._wSub}c();break;case"right":switch(m+=(a-this._wTitle)/2,o.align){case"left":b=m+this._wTitle+p;break;case"center":b=m+this._wTitle+p,b+=(h-b-this._wSub)/2;break;case"right":b+=h-p-this._wSub}c();break;case"top":d(),g=f+this._hSub+p;break;default:d(),f=g+this._hTitle+p}}e.resizeByMeasured().layout().trans(m,g),s.resizeByMeasured().layout().trans(b,f)}else if(a>0||h>0){const t=a?i:r,n=a?e:s,o=a||h,c=a?this._wTitle:this._wSub;let u=a?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":u+=o-c;break;default:u+=(o-c)/2}n.trans(u,0)}}}class Da extends On{_doInitChildren(t){this.add(this._legendView=new Aa(t))}_doMeasure(t,e,s,i,r){const n=e._legend,o=this._legendView.measure(t,n,s,i,r),a=this._pos=n._location;return"left"===a||"right"===a?o.width+=this._legendView._gap:o.height+=this._legendView._gap,o}_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 Fa extends On{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 o,a=n.length;for(;n.length<s.length;)o=new Yn(t),s[a++].visible&&this.add(o),n.push(o);for(;n.length>s.length;)o=n.pop(),o.parent&&o.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,o=0;return[this.views].forEach((e=>{if(e){const a=(this.isX,s),h=(this.isX,i);let l=0,_=0;e.forEach((e=>{if(e.visible){const s=e.measure(t,e.model,a,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=y(n,l),o=y(o,_)}})),{width:n,height:o}}_doLayout(t){const e=this.control.loaded,s=[];let i=this.width,r=this.height,n=0,o=0;t=+t||0,[this.views].forEach((a=>{if(a){let h=0;a.forEach((t=>{if(t.visible){const a=t.checkExtents(e);a&&s.push(a),this.isHorz?t.resize(i,t.mh):t.resize(t.mw,r),t.layout(),this.isHorz?(t.trans(n,this.dir===mn.TOP?r-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===mn.RIGHT?h:i-h-t.mw,o),h+=t.mw+this._gap)}})),this.isHorz?n+=i+t:o+=r+t}}));const a=this.control.chart.body.options.zoomCallback;s.length>0&&a&&Promise.resolve().then((()=>{s.forEach((({axis:t,from:e,to:s})=>{a({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof Xs?Math.floor(e):e,to:t instanceof Xs?Math.floor(s):s})}))}))}}class za extends Mn{constructor(e){super(e,"rct-credits"),this.add(this._textView=new ee(e)),this._textView.anchor=t.TextAnchor.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 $a extends Yt{static registerPaneClass(t){this.pane_class=t}constructor(t){super(t,"rct-chart"),this._inverted=!1,this._axisSectionMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new Yt(t,"rct-annotations")),this.add(this._plotContainer=new Yt(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new ga(t,this));for(const e in mn){const s=new Fa(t,mn[e]);this._plotContainer.add(s),this._axisSectionMap[mn[e]]=s}$a.pane_class&&this.add(this._paneContainer=new $a.pane_class(t,this)),this.add(this._titleSectionView=new Ra(t)),this.add(this._legendSectionView=new Da(t)),this.add(this._frontAnnotationContainer=new Yt(t,"rct-front-annotations")),this.add(this._creditView=new za(t)),this.add(this._navigatorView=new fa(t)),this.add(this._historyView=new Va(t)),this.add(this._tooltipView=new Ba(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){var n,o,a;const h=this._model=e,l=h.isPolar(),_=h._chartOptions.credits,c=h._legend,u=h._navigator;let d,p=s,g=i;if(this._inverted=h.isInverted(),h.isSplitted()?(this._plotContainer.setVis(!1),null===(n=this._paneContainer)||void 0===n||n.setVis(!0),this.$_preparePanes(t,h._split)):(this._plotContainer.setVis(!0),null===(o=this._paneContainer)||void 0===o||o.setVis(!1),this.$_prepareBody(t,l)),this._creditView.setVis(_.visible)&&(d=this._creditView.measure(t,_,p,g,r),_.isFloating()||("middle"!==_.options.verticalAlign?g-=d.height+(+_.options.offsetY||0)+(+_.options.gap||0):"center"!==_.options.align&&(p-=d.width+(+_.options.offsetX||0)+(+_.options.gap||0)))),d=this._titleSectionView.measure(t,h,p,g,r),g-=d.height,this._legendSectionView.setVis(c.visible))switch(d=this._legendSectionView.measure(t,h,p,g,r),c._location){case"top":case"bottom":g-=d.height;break;case"right":case"left":p-=d.width}this._navigatorView.setVis(u.visible),(null===(a=this._paneContainer)||void 0===a?void 0:a.visible)?this._paneContainer.measure(t,h._split,p,g,1):l?this.$_measurePolar(t,h,p,g,1):this.$_measurePlot(t,h,p,g,1),this._navigatorView.visible&&(h._navigator._vertical?g=this._bodyView.mh:p=this._bodyView.mw,this._navigatorView.measure(t,u,p,g,r)),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,n)=>{e.measure(t,this._annotations[n],s,i,r)}))}layout(){var t;const e=this.width,s=this.height;let i=e,r=s;const n=this._model,o=n.isPolar(),a=n._legend,h=this._creditView,l=n._chartOptions.credits,_=l.options,c=+_.gap||0;let u=0,d=0,p=0,g=0,m=0,f=0,y=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=p=h.height+u+c:r-=g=h.height+u+c):(d=+_.offsetX||0,"left"===_.align?i-=m=h.width+d+c:i-=f=h.width+d+c)));const x=this._titleSectionView;let w=0;const v=b+p;x.visible&&(x.resizeByMeasured(),r-=w=x.height),y=m,b=s-g;const S=this._navigatorView;let V=0;S.visible&&(S.model._vertical||(S.resize(S.mw,S.mh-S.model.getGap()-S.model.getGapFar()),r-=V=S.mh));const P=this._legendSectionView;let A,C,k=0,L=0;if(P.visible)switch(P.resizeByMeasured().layout(),k=P.height,L=P.width,a._location){case"top":A=w+p,r-=k;break;case"bottom":r-=k,A=b-k,b-=k;break;case"right":i-=L,C=e-L;break;case"left":i-=L,y+=L,C=0}S.visible&&(b-=V,S.layout().transY(b+S.model.getGap()));let N,E=0,M=0,T=0,O=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(y,v+w).resize(i,r),this._paneContainer.layout(),T=r,O=i,N=this._paneContainer.getRect();else{const t=this._axisSectionMap,e=t[mn.CENTER],s=t[mn.MIDDLE];let n;if(!o){const o=this.control._padding;e&&e.visible&&(E=e.mw),s&&s.visible&&(M=s.mh),[mn.LEFT,mn.RIGHT].forEach((e=>{(n=t[e])&&n.visible&&(i-=n.mw)})),[mn.TOP,mn.BOTTOM].forEach((e=>{(n=t[e])&&n.visible&&(r-=n.mh)})),(n=t[mn.LEFT])&&n.visible&&(n.resize(n.mw,r),n.layout(M),y+=n.mw),(n=t[mn.RIGHT])&&n.visible&&(n.resize(n.mw,r),n.layout(M)),E>0&&(e.resize(n.mw,r),e.layout()),(n=t[mn.BOTTOM])&&n.visible&&(n.setMargins(o.left,y,this.width-y-i,Math.max(0,o.right-2)),n.resize(i,n.mh),n.layout(E),b-=n.mh),(n=t[mn.TOP])&&n.visible&&(n.setMargins(o.left,y,this.width-y-i,Math.max(0,o.right-1)),n.resize(i,n.mh),n.layout(E)),M>0&&(s.resize(i,n.mh),s.layout())}S.visible&&S.layout().transX(y);const a=this._org={x:y,y:b};this._plotWidth=i,this._plotHeight=r,o||((n=t[mn.LEFT])&&n.visible&&n.trans(a.x-n.mw,a.y-n.height),(n=t[mn.RIGHT])&&n.visible&&n.trans(a.x+i,a.y-n.height),E>0&&e.trans(a.x+(i-E)/2,a.y-e.height),(n=t[mn.BOTTOM])&&n.visible&&n.trans(a.x,a.y),(n=t[mn.TOP])&&n.visible&&n.trans(a.x,a.y-r-n.height),M>0&&s.trans(a.x,a.y-(r-M)/2-M));const h=this._currBody;T=this._plotHeight-M,O=this._plotWidth-E,y=a.x,b=a.y-this._plotHeight,h.resize(O,T),h.trans(y,b),h.layout(),N=h.getRect(),h._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}}))}if(h.visible){let t,i;switch(h.layout(),_.verticalAlign){case"top":i=u;break;case"middle":i=(s-h.height)/2+u;break;default:i=g>0?s-g+c:s-h.height-u}switch(_.align){case"left":t=d;break;case"center":t=(e-h.width)/2+d;break;default:t=f>0?e-f+c:e-h.width-d}h.trans(t,i)}if(O+=E,x.visible&&x.layout({xPlot:y,wPlot:O,wChart:e}).trans(0,v),P.visible){const t=a.options,n=t.align,o=t.verticalAlign;if("body"===a._location){let e=+t.offsetX||0;switch(n){case"right":y+=O-L-e;break;case"center":y+=(O-L)/2+e;break;default:y+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=T-k-e;break;case"middle":b+=(T-k)/2+e;break;default:b+=e}}else if(isNaN(A)){const e=+t.offsetY||0;if(y=C,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=s-k-e;break;default:b=(s-k)/2+e}b+k>s&&(b=(s-k)/2)}else switch(o){case"top":b+=e;break;case"bottom":b=b+r-k-e;break;default:b=b+(r-k)/2+e}b+k>s&&(b=(s-k)/2),b<0&&(b=0)}else{const s=+t.offsetX||0;if(b=A,"chart"===t.alignBase)switch(n){case"left":y=s;break;case"right":y=e-L-s;break;default:y=(e-L)/2+s}else switch(n){case"left":y+=s;break;case"right":y=y+i-L-s;break;default:y+=(i-L)/2+s}y+L>e&&(y=(e-L)/2),y<0&&(y=0)}P.trans(y,b)}this.$_layoutAnnotations(this._inverted,e,s,N),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i,r){const{x:n,y:o}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},a=this._model.chart._tooltip.isFollowPointer(t),h=i.getTooltipPos(),l=a?r.x+h.x:n+h.x,_=a?r.y+h.y:o+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){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.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),o=null==r?void 0:r.classList,a=(null==o?void 0:o.value)&&(o.contains("rct-contextmenu-item")||o.contains("rct-contextmenu-list"));let h=this._hoverItem;if(this._hoverItem=null,n){const i=n.controlToElement(t,e),o=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 ii?n.hoverSeries(t.source):t.legend.options.pointHovering&&t.source instanceof $s&&n.hoverPoint(t.source))}if(h instanceof ys&&!(this._hoverItem instanceof ys)&&(n.hoverSeries(null),n.hoverPoint(null)),!o)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=o&&s.visible&&!a&&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 o=this._model.inverted;t.model._visPoints.forEach((t=>{const r=t.xPos,a=t instanceof mr&&!o?t.yPos-(t.yPos-t.yLow)/2:t.yPos,h=e._isX?Math.abs(i.x-r):Math.abs(i.y-a);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 mn){const s=this._axisSectionMap[mn[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 Ea(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,e)}$_prepareAxes(t,e){const s=this._currBody._gridRowContainer,i=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const s in o){const a=o[s];n?a.prepare(t,e,e.getAxes(s,!1),i,r):a.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 o=n[e];r&&o.visible&&o.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 o=s,a=i;let h=0,l=0;this._bodyView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(s,i,this._inverted,r),s-=n[mn.LEFT].checkWidths(t,s,i),s-=n[mn.RIGHT].checkWidths(t,s,i),i-=n[mn.BOTTOM].checkHeights(t,s,i),i-=n[mn.TOP].checkHeights(t,s,i),this._inverted?s-=h=n[mn.CENTER].checkWidths(t,s,i):i-=l=n[mn.MIDDLE].checkHeights(t,s,i),s-=h,i-=l,e.layoutAxes(s,i,this._inverted,r);for(const o in n){const a=n[o];a.visible&&a.measure(t,e,s,i,r)}s=o,i=a,h=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===mn.LEFT||t===mn.RIGHT?s-=e.mw:t!==mn.BOTTOM&&t!==mn.TOP||(i-=e.mh),this._inverted?t===mn.CENTER&&(s-=h=e.mw):t===mn.MIDDLE&&(i-=l=e.mh))}e.layoutAxes(s,i,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const o in n){const a=n[o];a.visible&&(a.measure(t,e,s,i,r),a.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a,h=0,l=0;for(const t in n){const e=n[t];e.visible&&(t===mn.LEFT||t===mn.RIGHT?s-=e.mw:t!==mn.BOTTOM&&t!==mn.TOP||(i-=e.mh),this._inverted?t===mn.CENTER&&(s-=h=e.mw):t===mn.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),o=2*Math.PI*n,a=n;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(o,a,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(o,a,!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 o=r.get(e)||ia(t,e);(e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,s,i){const r=this.control._padding;let n,o,a,h;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)n=-r.left,o=-r.top,a=e+r.left+r.right,h=s+r.top+r.bottom;else n=o=0,a=e,h=s;i._layoutView(t,this,n,o,a,h)}))}}!function(t){t.EXPORT="$$realchart_export"}(Oa||(Oa={}));class Ia extends Ht{constructor(t,e){super(t,e),this.addElement(this._chartView=new $a(t)),this.setPointerHandler(new Sa(this))}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new bn(null,((t,e)=>{this.changeModel(t,e)}))}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof Le&&s===Se.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===Oa.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_doRender(t){var e;const s=this.model,i=s._chartOptions.options,r=this._chartView;if(this.clearTemporaryDefs(),s&&(this.setData("theme",i.theme,!0),this.setData("palette",i.palette),this.setDomResize(i.domResize),s._prepareRender(),this._loadModules()),this.loaded||r.clean(),r.setVis(!1!==i.visible)&&(r.measure(this.doc(),s,t.width,t.height,1),r.setRect(t),r.layout(),s&&s.afterRender()),null===(e=this._chart)||void 0===e?void 0:e._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_doRenderBackground(t,e,s,r){if(this.model){const s=this.model._chartOptions._style;if(i(s))for(const i in s)i.startsWith("padding")?e.setStyle(i,s[i]):t.style[i]=s[i]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e.options.exporting)}}}class Ga{static getVersion(){return zt.version}static setLicenseKey(t){zt.code=t}static setLocale(t,e){e&&E(t,e),(t=>{t&&(N=k[L=t.substring(0,2)]),N||(N=k[L="ko"])})(t)}static registerLocale(t,e){E(t,e)}static setDebugging(t){jt.DEBUGGING=t}static setLogging(t){C.LOGGING=t}static setAnimatable(t){Ht._animatable=t}static configure(t){return t}static createChart(t,e,s,r=!0,n){const o=new Ia(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[yn]=o,o.chart}static createData(t,e){return new xn(t||{},e)}}class Ha{static empty(){return new Ha}static create(t=0,e=0){return new Ha(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class ja{static empty(){return new ja}static create(t=0,e=0){return new ja(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const Ya=Ga.getVersion,Wa=Ga.setDebugging,Xa=Ga.setLogging,Ua=Ga.setAnimatable,Za=Ga.configure,qa=Ga.createChart,Ka=Ga.createData,Qa=Ga.setLicenseKey;t.Annotation=Le,t.ArcElement=Un,t.AreaRangeSeries=yr,t.AreaSeries=gr,t.AreaSeriesGroup=xr,t.AssetCollection=ye,t.Axis=Ue,t.AxisBaseLine=Fi,t.AxisCollection=Ze,t.AxisGrid=Fe,t.AxisItem=Oe,t.AxisLabel=je,t.AxisLine=Be,t.AxisScrollBar=Ye,t.AxisScrollView=Hn,t.AxisSectorLine=Xe,t.AxisTick=He,t.AxisTitle=Re,t.AxisView=Yn,t.BarRangeSeries=qi,t.BarSeries=Ji,t.BarSeriesBase=Qi,t.BarSeriesGroup=er,t.BarSeriesGroupBase=tr,t.BasedSeries=pi,t.BellCurveSeries=vr,t.Body=ms,t.BodyView=ga,t.BoxPlotSeries=Vr,t.BubbleSeries=Ar,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=Cr,t.CandlestickSeries=Er,t.CategoryAxis=Xs,t.CategoryAxisGrid=Ws,t.CategoryAxisLabel=Ys,t.CategoryAxisTick=js,t.Chart=bn,t.ChartControl=Ia,t.ChartData=xn,t.ChartDataCollection=ut,t.ChartElement=Mn,t.ChartItem=Se,t.ChartObject=fn,t.ChartOptions=gn,t.ChartText=Pe,t.ChartView=$a,t.CircelBarPointLabel=Mr,t.CircleBarSeries=Tr,t.CircleBarSeriesGroup=Or,t.CircleElement=Xn,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=us,t.CircularGaugeGroup=ds,t.CircularGaugeLabel=_s,t.ClockGaugeType="clock",t.ClusterableSeries=di,t.ClusterableSeriesGroup=bi,t.Color=Rt,t.ConnectableSeries=ni,t.ConstraintSeriesGroup=yi,t.ContentView=Bn,t.ContinuousAxis=zi,t.Credits=dn,t.Crosshair=Me,t.DataPoint=$s,t.DataPointCollection=Is,t.DataPointLabel=Ks,t.DumbbellSeries=Dr,t.ElementPool=wn,t.EqualizerSeries=zr,t.ErrorBarSeries=$r,t.Exporter=fs,t.FunnelSeries=jr,t.Gauge=ts,t.GaugeBase=Je,t.GaugeGroup=es,t.GaugeGroupView=io,t.GaugeItem=class extends Se{constructor(t){super(t.chart)}},t.GaugeLabel=ls,t.GaugeRangeBand=hs,t.GaugeRangeLabel=as,t.GaugeScale=os,t.GaugeView=to,t.HeatmapSeriesType="heatmap",t.HistogramSeries=Xr,t.IconedText=Ae,t.ImageAnnotation=Ni,t.LayerElement=Yt,t.Legend=bs,t.LineElement=nr,t.LinePointLabel=lr,t.LineSeries=ur,t.LineSeriesBase=_r,t.LineSeriesGroup=br,t.LineSeriesPoint=ar,t.LinearAxis=$i,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=Gi,t.LollipopSeries=qr,t.LowRangedSeries=mi,t.MarkerSeries=xi,t.MarkerSeriesPointView=No,t.MarkerSeriesView=Eo,t.NavigatorMask=vi,t.NavigiatorHandle=wi,t.ORG_ANGLE=F,t.OhlcSeries=Qr,t.OthersGroup=_i,t.PI_2=D,t.PaneContainer=class extends Yt{},t.ParetoSeries=tn,t.PathBuilder=Lr,t.PathElement=Zt,t.PieSeries=on,t.PieSeriesGroup=an,t.PieSeriesLabel=nn,t.PieSeriesText=rn,t.Point=Ha,t.PointElement=So,t.PointHovering=pn,t.PointLabelView=po,t.RAD_DEG=$,t.RadialSeries=ui,t.RangedSeries=gi,t.RcAnimation=vs,t.RcControl=Ht,t.RcElement=jt,t.RcObject=T,t.RectElement=ks,t.ScaleView=class extends Mn{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new Yt(t,"rct-gauge-scale-ticks")),this._ticks=new wn(this._tickContainer,nr),this.add(this._labelContainer=new Yt(t,"rct-gauge-scale-tick-labels")),this._labels=new wn(this._labelContainer,so)}},t.ScatterSeries=ln,t.SectionView=On,t.SectorElement=qn,t.Series=ii,t.SeriesAnimation=ro,t.SeriesGroup=fi,t.SeriesMarker=oi,t.SeriesNavigator=Ai,t.SeriesView=vo,t.ShapeAnnotation=Ei,t.Size=ja,t.SplineSeries=dr,t.Subtitle=ki,t.TextAnnotation=Mi,t.TextElement=ee,t.TimeAxis=Zi,t.Title=Ci,t.Tooltip=Li,t.TreemapSeriesType="treemap",t.Trendline=Qs,t.Utils=C,t.ValueGauge=is,t.ValueGaugeView=class extends to{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return h(i)?yt.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 y(t.options.minValue,f(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 eo(this,this._prevValue,t.options.value).start((()=>this._runValue=NaN)),this._prevValue=t.options.value)}},t.VectorSeriesType="vector",t.WaterfallSeries=un,t.Widget=qe,t.WidgetSeries=ci,t.WidgetSeriesPoint=ai,t.WidgetSeriesView=To,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=Gs,t.absv=b,t.assignObj=_,t.buildValueRanges=nt,t.calcPercent=Q,t.configure=Za,t.copyObj=t=>t&&_({},t),t.cos=d,t.createChart=qa,t.createData=Ka,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=xe,t.fixnum=H,t.getVersion=Ya,t.incv=V,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=i,t.isString=o,t.maxv=y,t.minv=f,t.parsePercentSize=q,t.pickNum=x,t.pickProp=v,t.pickProp3=S,t.pixel=Y,t.rectToSize=Sn,t.setAnimatable=Ua,t.setDebugging=Wa,t.setLicenseKey=Qa,t.setLogging=Xa,t.sin=p,t.toStr=function(t){return null==t?null:String(t)}}));
|