realchart 1.4.12 → 1.4.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 +2 -2
- package/heatmap.mjs +2 -2
- package/ie/gauge.ie.js +1 -1
- package/ie/heatmap.ie.js +2 -2
- package/ie/index.ie.js +2 -2
- package/ie/pictogram.ie.js +2 -2
- package/ie/split.ie.js +1 -1
- package/ie/treemap.ie.js +2 -2
- package/ie/vector.ie.js +2 -2
- package/ie/wordcloud.ie.js +2 -2
- package/index.d.ts +313 -133
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/pictogram.js +2 -2
- package/pictogram.mjs +2 -2
- package/split.js +1 -1
- package/split.mjs +1 -1
- package/treemap.js +2 -2
- package/treemap.mjs +2 -2
- package/vector.js +2 -2
- package/vector.mjs +2 -2
- package/wordcloud.js +2 -2
- package/wordcloud.mjs +2 -2
package/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart v1.4.
|
|
3
|
+
* RealChart v1.4.13
|
|
4
4
|
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"string"==typeof t&&t.length>0},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,_=Math.floor,c=Math.ceil,d=Math.cos,u=Math.sin,p=Math.log10,g=Math.min,m=Math.max,f=Math.abs,y=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},x=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},b=function(t,e){return void 0!==t?t:e},w=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},v=t=>t&&l({},t),S=(t,e,s)=>t+(e-t)*s,V=function(t){return"function"==typeof t?t:null},A={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 P="ko",C=A[P]||A[P="ko"];const k=(t,e)=>{t&&s(e)&&(C=A[t.substring(0,2)]=Object.assign(A.ko,A.en,e))},L=void 0,N=Math.PI,M=2*N,E=-N/2,T=2*N/360,B=360/N/2,O="%".charCodeAt(0);function R(t){return parseFloat(t.toPrecision(12))}function D(t){return Math.floor(1e6*t)/1e6}function $(t){return null==t?null:String(t)}function F(t){return t+"px"}function I(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function z(t){return null==t||Number.isNaN(t)||""===t}function H(t){return t<10?"0"+t:String(t)}function G(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function j(t,e){const s={};return s[t]=e,s}function X(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)===O?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;J(C.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 Y(t,e){return X(t,!0)||X(e,!1)}function W(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const U="fill",Z="stroke",q={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"},K=function(t){const e=q[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return q[t]=e,e}return e};class Q extends Error{}const J=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},tt=function(t,e,r,o=!0,a=!0,h=!1,_){let c,d;if(o&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),i(t))c=[],t.forEach((t=>{if(s(t)&&n(t.color)){const s={fromValue:y(t.fromValue,d?d.toValue:e),toValue:y(t.toValue,r),color:t.color,style:t.style?l({},t.style):L};s.fromValue<s.toValue&&(c.push(s),d=s)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<r)),a&&c.forEach((t=>{t.fromValue=m(t.fromValue,e),t.toValue=g(t.toValue,r)}));else if(s(t)&&i(t.colors)&&t.colors.length>0){const s=t.colors,n=i(t.styles)?t.styles:null;if(c=[],i(t.steps)&&t.steps.length>0){const o=i(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),r>o[o.length-1]&&o.push(r);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:s[g(t,s.length-1)],style:n?n[g(t,n.length-1)]:L})}else{let i=y(t.fromValue,e);const o=y(t.toValue,r),a=(o-i)/s.length;let h=0;for(;i<o;)c.push({fromValue:i,toValue:i+=a,color:s[g(h,s.length-1)],style:n?n[g(h,n.length-1)]:L}),h++}}if(h&&c&&c.length>0){let t=0,s=e;for(;t<c.length;)c[t].fromValue>s&&c.splice(t,0,{fromValue:s,toValue:c[t].fromValue,color:_}),s=c[t].toValue,t++;c[t-1].toValue<r&&c.push({fromValue:c[t-1].toValue,toValue:r,color:_})}return c},et="shuffle",st="random",it="vertical-lr",rt="vertical-rl",nt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const ot="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class at{static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...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&&at.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(g(s,at.month_days[at.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&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!i(t))return l({},t)}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(i(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-nt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=m(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=m(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 parseTuples(t){if(i(t)){const e=[];let s=-1/0;return t.forEach(((r,n)=>{i(r)?!isNaN(r[0])&&!isNaN(r[1])&&r[0]>s&&(e.push([+r[0],+r[1]]),s=r[0]):isNaN(r)||n!==t.length-1||e.push([1/0,+r])})),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+t]]}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 isDate(t){return t.getTime&&"[object Date]"===Object.prototype.toString.call(t)}static deepClone(t){if(null==t||"object"!=typeof t)return t;if(this.isDate(t))return new Date(t);{const e=i(t)?[]:{};for(let s of Object.keys(t))e[s]=this.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(),at.log(t,+new Date-s+"ms")}static clamp(t,e,s){return m(e,g(s,t))}static makeIntArray(t,e){const s=new Array(m(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 isAnimation(t){return"[object Animation]"===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=f(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}static diffAngle(t,e){const s=f(t-e);return g(s,M-s)}}at.LOGGING=!1,at.week_days=["일","월","화","수","목","금","토"],at.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],at.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]],at.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();let ht=0;class lt{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(ht++))}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 _t extends lt{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 ct=function(t){return t&&"object"==typeof t};class dt extends _t{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),i(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=i(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(i(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else ct(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)&&J(C.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 r;i(s)?r=new dt({},s):ct(s)&&i(s.values)&&(r=new dt(s.options,s.values)),this._map[e]=r}}}const pt="0".charCodeAt(0),gt="#".charCodeAt(0),mt=",".charCodeAt(0),ft="s".charCodeAt(0),yt="a".charCodeAt(0);class xt{static getFormatter(t){let e=xt.Formatters[t];return e||(xt.Formatters[t]=e=new xt(t)),e}static get Default(){return xt.getFormatter(xt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1},this._options2=Object.assign({},this._options),this._options2.useGrouping=!1}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toNum(t){return+t.toLocaleString(void 0,this._options2)}$_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)===pt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===gt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===pt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===mt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===ft){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===yt){s.signDisplay="never";break}}return s.minimumIntegerDigits=m(1,s.minimumIntegerDigits),s}}}xt.DEFAULT_FORMAT="",xt.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"],wt=[".","/","-",":"],vt="Z".charCodeAt(0),St="z".charCodeAt(0),Vt="A".charCodeAt(0),At="a".charCodeAt(0),Pt="y".charCodeAt(0),Ct="M".charCodeAt(0),kt="m".charCodeAt(0),Lt="W".charCodeAt(0),Nt="w".charCodeAt(0),Mt="d".charCodeAt(0),Et="H".charCodeAt(0),Tt="h".charCodeAt(0),Bt="S".charCodeAt(0),Ot="s".charCodeAt(0);class Rt{static getFormatter(t){let e=Rt.Formatters[t];return e||(Rt.Formatters[t]=e=new Rt(t)),e}static get Default(){return Rt.getFormatter(C.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||C.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():H(t.getFullYear()%100);break;case Ct:i+=a>1?H(t.getMonth()+1):t.getMonth()+1;break;case Mt:i+=a>1?H(t.getDate()):t.getDate();break;case Lt:i+=a>1?H(at.weekOfYear(t,e)+1):at.weekOfMonth(t,e,!0)+1;break;case Nt:i+=a>1?at.long_week_days[t.getDay()]:at.week_days[t.getDay()];break;case Et:i+=a>1?H(t.getHours()):t.getHours();break;case Tt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?H(e):e}else i+=a>1?H(t.getHours()):t.getHours();break;case kt:i+=a>1?H(t.getMinutes()):t.getMinutes();break;case Ot:i+=a>1?H(t.getSeconds()):t.getSeconds();break;case At:case Vt:t.getHours()<12?i+=C.am:i+=C.pm;break;case Bt:let s=t.getMilliseconds();i+=3==a?G(s):2==a?H(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(wt.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>=Vt&&e<=vt||e>=At&&e<=St)&&J(C.invalidDateFormat,t)}e.push(n)}if(r<i&&at.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&at.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||C.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Rt.Formatters={};class Dt{static isBright(t){return new Dt(t).isBright()}static getContrast(t,e,s){return new Dt(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Dt(t),r=new Dt(e),n=1-s,o=Math.round(i.r*s+r.r*n),a=Math.round(i.g*s+r.g*n),h=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return ot?new Dt(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(at.startsWith(t,"rgb(")&&at.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):at.startsWith(t,"rgba(")&&at.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):at.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 Dt(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}}Dt.BLACK="#000",Dt.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class $t{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 setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}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}}static hasFill(t){const e=window.getComputedStyle(t).fill;return e&&"none"!==e}static setVisible(t,e,s=""){return t.style.display=e?s:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let s=null;"string"==typeof e?s=e:$t.isSVGClipPathElement(e)&&(s=e.id||null),s?t.setAttribute("clip-path",`url(#${s})`):t.removeAttribute("clip-path")}static createClipRect(e,s){const i=e.createElementNS(t,"clipPath");return i.id=s,i.append(e.createElementNS(t,"rect")),i}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,s,i,r){return t.setAttribute("x",e),t.setAttribute("y",s),t.setAttribute("width",i),t.setAttribute("height",r),t}static isSVGElement(e){return $t.isElement(e)&&e.namespaceURI===t}static isSVGClipPathElement(t){return $t.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var Ft;$t.instanceOf=function(t,e){return $t.isElement(t)&&t.tagName===e.toUpperCase()},$t.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Ft||(Ft={}));const It={name:"RealChart",version:"1.4.12",license:"enterprise",code:null};class zt{static decode(t){const e=zt.CHARS,s=zt.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}}zt.PAD="=",zt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Ht{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=Ht.xor,i=Ht.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=Ht.xor,i=Ht.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=Ht.kb,i=Ht._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*Ht.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=Ht._decryptBlock;let i=Ht._init(e),r=[],n=zt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Ht.POW24|n[a+1]*Ht.POW16|n[a+2]*Ht.POW8|n[a+3],h.right=n[a+4]*Ht.POW24|n[a+5]*Ht.POW16|n[a+6]*Ht.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)}}Ht.POW2=Math.pow(2,2),Ht.POW3=Math.pow(2,3),Ht.POW4=Math.pow(2,4),Ht.POW8=Math.pow(2,8),Ht.POW16=Math.pow(2,16),Ht.POW24=Math.pow(2,24),Ht.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=Ht.decrypt(t,"dkdl"+this._getLDKey(Ht.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}}const jt={inOutSine:t=>-(d(N*t)-1)/2},Xt=function(t,e,s,i,r,n){const o=j(e,null!=s?s:"initial"),a=j(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Yt{constructor(){this.delay=0,this.duration=Yt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=g(1,m(0,R(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop(!0)}finally{t>=this.duration?this._stop(!1):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(!0)}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=y(t,Yt.DURATION),this.delay=e||0,this._easing=jt[s],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop(!1)),1.2*this.duration),this._handler()}_stop(t){var e;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(e=this.endHandler)||void 0===e||e.call(this,this,t))}_doStart(){}_doStop(){}_canUpdate(){return!0}}Yt.DURATION=700,Yt.SHORT_DURATION=300;class Wt extends Yt{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var s,i;null===(i=(s=this.props).endHandler)||void 0===i||i.call(s,this,e),this.props.dom=null,this.props=null}}_canUpdate(){return this.props.dom&&!!this.props.dom.parentElement}_doUpdate(t){return!1!==this.props.update(this.props,t)}}const Ut=function(t){return new Wt(t).start()},Zt=function(t){return isNaN(t)?0:t};class qt{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}push(...t){return t.forEach((t=>{a(t)||n(t)?this._path.push(t):this._path.push(t.x,t.y)})),this}move(t,e){return a(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return a(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return a(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 a(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(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Zt(t[e]),Zt(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Zt(t[e].x),Zt(t[e].y));return this}polygon(...t){return a(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}donut(t,e,s,i){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 1 ${2*s} 0 a ${s} ${s} 0 1 1 ${2*-s} 0 Z`),this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${2*-i} 0 Z`),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}spline(t,e,s){let i=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void this.line(t[i+1].px,t[i+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[i+1].px-t[i].px,y:t[i+1].py-t[i].py};let l={x:0,y:0},_=Math.sqrt(h.x*h.x+h.y*h.y);if(0===_)return void this.line(t[s].px,t[s].py);h.x/=_,h.y/=_;let c=t[i+1].px-t[i].px,d=t[i].px,u=t[i].py;for(++i;i!=s;i++){a.x=-h.x,a.y=-h.y,h.x=t[i+1].px-t[i].px,h.y=t[i+1].py-t[i].py,_=Math.sqrt(h.x*h.x+h.y*h.y),h.x/=_,h.y/=_,h.x<a.x?(l.x=a.x-h.x,l.y=a.y-h.y):(l.x=h.x-a.x,l.y=h.y-a.y);const e=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=e,l.y/=e,a.y*h.y>=0&&(l={x:1,y:0}),n.x=-l.x*c*r,n.y=-l.y*c*r;const s=d+o.x,p=u+o.y,g=t[i].px+n.x,m=t[i].py+n.y;this.curve(s,p,g,m,t[i].px,t[i].py),c=t[i+1].px-t[i].px,o.x=l.x*c*r,o.y=l.y*c*r,d=t[i].px,u=t[i].py}this.curve(d+o.x,u+o.y,t[i].px,t[i].py,t[i].px,t[i].py)}closedSpline(t,e){const s=t.length;if(s<3)return void this.line(t[1].px,t[1].py);const i=.17,r=e?e=>t[(e+s)%s]:e=>e<0?t[0]:e>=s?t[s-1]:t[e];for(let t=0,n=s-(e?0:1);t<n;t++){const e=r(t-1),s=r(t),n=r(t+1),o=r(t+2),a=s.px+(n.px-e.px)*i,h=s.py+(n.py-e.py)*i,l=n.px-(o.px-s.px)*i,_=n.py-(o.py-s.py)*i;this.curve(a,h,l,_,n.px,n.py)}}}const Kt={position:"relative",width:"100%",height:"100%",boxSizing:"border-box","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"};class Qt extends lt{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._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{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._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(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=It.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=Gt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==It.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(It.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(It.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&&$t.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,s||Qt.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),$t.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}win(){return this._dom.ownerDocument.defaultView}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}canvasCtx(){return this._canvas.getContext("2d")}setData(t,e,s){z(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))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){$t.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)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(t,"clipPath")).forEach((t=>t.remove()))}clearTemporaryDefs(){this.$_clearDefs(Jt.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}appendSvg(t){return t&&this._htmlRoot.append(t.dom),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)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}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){return this.addClip(new re(this.doc(),t,e,s,i,r,r))}clipCircle(){return this.addClip(new ae(this.doc()))}clipDonut(){return this.addClip(new he(this.doc()))}clipPath(){return this.addClip(new oe(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if($t.isElement(e)&&e.id===t){t=e;break}$t.isElement(t)&&t.parentNode===this._defs&&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}}getIEColor(t){return!t||t.startsWith("#")||t.startsWith("rgb")||(this._tester.style.color=t,t=getComputedStyle(this._tester).color),t}getRootDistance(){const t=this._svg.getBoundingClientRect(),e=this._root.getBounds();return{x:e.x-t.x,y:e.y-t.y}}_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(e,s,i){if(this._inited)return;const r=e.defaultView;s instanceof r.HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof r.HTMLDivElement||J(C.invalidOuterDiv,s),e=this._container.ownerDocument;const n=this._dom=e.createElement("div");l(n.style,Kt),n.className=i,this._container.appendChild(n);const o=this._svg=e.createElementNS(t,"svg");o.classList.add("rct-svg"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=e.createElement("desc");a.textContent="Created by RealChart v"+It.version,o.appendChild(a);const h=this._defs=e.createElementNS(t,"defs");this._initDefs(e,h),o.appendChild(h),n.appendChild(o),this._root=new se(this),o.appendChild(this._root._dom),this._htmlRoot=e.createElement("div"),n.appendChild(this._htmlRoot),l(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=e.createElement("div"),n.appendChild(this._tester),ot&&(this._canvas=e.createElement("canvas"))}_initDefs(e,s){let i=e.createElementNS(t,"filter");i.setAttribute("id",Qt.SHADOW_FILTER);const r=e.createElementNS(t,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=e.createElementNS(t,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=e.createElementNS(t,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=e.createElementNS(t,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=e.createElementNS(t,"feMerge"),l=e.createElementNS(t,"feMergeNode"),_=e.createElementNS(t,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}_canOverflowRender(){return!1}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{at.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,r=this._canvas;!r||r.width===s&&r.height==i||(r.width=s,r.height=i,r.style.width=F(s),r.style.height=F(i)),l(this._htmlRoot.style,{left:F(e.left-t.left),top:F(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),l(n.style,Kt),this._doRenderBackground(n,this._root,s,i);const o=this._padding=$t.getPadding(this._root.dom);this._doRender({x:o.left,y:o.top,width:s-o.left-o.right,height:i-o.top-o.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),at.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const i=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{i&&this.invalidateLayout(),this._resizeTimer=null}),s):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)}}Qt.CLASS_NAME="rct-control",Qt.SHADOW_FILTER="rr-chart-shadow-filter",Qt._animatable=!0;class Jt extends lt{constructor(e,s,i=L){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get win(){return this._dom.ownerDocument.defaultView}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,isNaN(t)?this.removeAttr("width"):this.setAttr("width",t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,isNaN(t)?this.removeAttr("height"):this.setAttr("height",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(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}removeAttr(t){return this._dom.removeAttribute(t),this}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return z(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(){let t=this._dom.getBBox();return ot&&(t={x:t.x,y:t.y,width:t.width,height:t.height}),t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){let s=this._dom.getBBox();return ot&&(s={x:s.x,y:s.y,width:s.width,height:s.height}),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._ani instanceof Wt||!!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,e=NaN){return e=isNaN(e)?t:e,this._scaleX===t&&this._scaleY===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=at.isValidNum(t)?t:this._tx,e=at.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)}$_cleanMove(t,e){var s;this._updateTransform(),e&&(null===(s=this.control)||void 0===s||s.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,s=0,i=!0){if(t=at.isValidNum(t)?t:this._tx,e=at.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._moveAni=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",(()=>{this.$_cleanMove(r,i)})),r.addEventListener("cancel",(()=>{this.$_cleanMove(r,i)}))):this.$_cleanMove(r,i)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,s=0,i=!0){if(t=at.isValidNum(t)?t:this._tx,e=at.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._rotation||0,n=`translate(${this._tx||0}px, ${this._ty||0}px)`+(r?` rotate(${r}deg)`:""),o=`translate(${t}px, ${e}px)`+(r?` rotate(${r}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._moveAni=this._dom.animate([{transform:n},{transform:o}],{duration:s,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)})),a.addEventListener("cancel",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)}))):(this._dom.style.transformOrigin="",this.$_cleanMove(a,i))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&at.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&at.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")||"",this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",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(K(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(K(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(K(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let s in t)e.setProperty(K(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this.addClass(t):s(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,b(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}stopAni(){return this._ani&&(this._ani.stop(),this._ani=null),this}removeLater(t,e){return this._parent&&(t>0?this._ani=Ut({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=m(0,t.from*(1-e)),!0),endHandler:(t,s)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!s&&this.remove(),null==e||e(this)},from:y(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=Ut({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=m(0,t.from*(1-e)),!0),endHandler:(t,e)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!e&&this.setVis(!1)},from:y(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}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=[];(at.isValidNum(e)||at.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+at.pick(this._originX,t.getAttribute("x"),0)+" "+at.pick(this._originY,t.getAttribute("y")||0)+")"),at.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=at.getNumber(this._scaleX,1),n=at.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.CLIP_KEY="_clip_",Jt.TEMP_KEY="_temp_";class te extends lt{constructor(e,s,i=!1){super(),this._control=s,this._dom=e.createElement("div"),i&&(this._svg=e.createElementNS(t,"svg"),$t.setStyles(this._svg,{width:"100%",height:"100%",boxSizing:"border-box",overflow:"visible"}),this._dom.appendChild(this._svg)),this._doInitDom(this._dom)}_doInitDom(t){t.style.position="absolute"}_doDestroy(){this._control=null,this._dom.remove()}get control(){return this._control}get dom(){return this._dom}addSvg(t){return t&&this._svg.appendChild(t.dom),t}setBounds(t,e,s,i){return $t.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${s}px`,height:`${i}px`}),this}setVis(t){return this._dom.style.display=t?this._getDisplay():"none",this}isVisible(){return"none"!==this._dom.style.display}setVisibility(t){return this._dom.style.visibility=t?"visible":"hidden",this}hasVisibility(){return"hidden"!==this._dom.style.visibility}_getDisplay(){return""}}class ee extends Jt{constructor(t,e){super(t,e,"g")}}class se extends Jt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class ie extends Jt{constructor(t){super(t,L,"clipPath");const e=this._id=at.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class re extends ie{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 ne extends Jt{constructor(t,e){super(t,e,"path")}get path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class oe extends ie{constructor(t){super(t),this._path=new ne(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class ae extends ie{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 he extends ie{constructor(t){super(t),this.add(this._donut=new ne(t))}setDonut(t,e,s,i){this._donut.setPath((new qt).donut(t,e,s,i).end())}}class le{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 _e,ce,de;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(_e||(_e={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(ce||(ce={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(de||(de={}));class ue extends Jt{constructor(t,e=void 0){super(t,e,"text"),this._layout=ce.TOP,this._overflow=de.WRAP,this._dirty=!0,this._text="",this.anchor=_e.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(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case ce.MIDDLE:i=Math.floor(s/2);break;case ce.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=m(0,t),(e=g(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(Dt.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}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 pe="$_TH",ge="$_TW";class me{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]?xt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=s[r+2]||"";else if(at.isDate(n)){const t=s[3]?Rt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}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),L),0===this._literals[2].length&&(this._literals[2]=L)}else this._literals.push(r,n,L,L);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class fe extends me{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 ye extends fe{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 xe={t:class extends fe{tag(){return"</t>"}},b:class extends fe{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends fe{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:ye};class be{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 me).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 xe){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 xe[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 we=/<br.*?>|\r\n|\n/;class ve{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,i,r,n,o){if(this._isVertical)return void this.buildVertical(e,i,r,n,o);const a=e.doc,h=y(this.lineHeight,1),l=this._lines,_=l.length,c=[],d=[];e.clearDom(),n=n||e;const u=e.getStyle("writing-mode"),p=this._vertical=u===it||u===rt;for(let i=0;i<_;i++){const r=l[i];let u=0,g=0,f=null;for(let[h,l]of r.words.entries()){const c=0===i&&0===h,d=i===_-1&&h===r.words.length-1,y=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(s(n.options)){const t=n.options,e=c&&t.prefix||"",s=d&&t.suffix||"";y.textContent=e+(y.textContent||"")+s}const x=y.getBBox();if(y[ge]=x.width,y[pe]=x.height,p?(u=m(u,y[ge]),g+=y[pe]):(u+=y[ge],g=m(g,y[pe])),f||(f=y),l instanceof ye){const s=a.createElementNS(t,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(y),e.appendDom(s)}}d.push(f),r[pe]=g*h,r[ge]=u*h,c.push(0==i?r[ge]/2:r[ge])}if(_>0){let t=l[0];for(let s=1;s<d.length;s++)if(d[s]){let i=0,r=0;if(p?null!=d[s-1]&&(i=Math.floor(t[ge]-e.getAscent(t[ge]))+e.getAscent(l[s][ge])):r=t[pe]-e.getAscent(t[pe])+e.getAscent(l[s][pe]),null==d[0]&&d[s]==d.find((t=>null!=t))){const r=e.insertElement(a,"tspan",d[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[ge]=n.width,r[pe]=t[pe]=n.height,d[0]=r}switch(u){case it:d[s].setAttribute("dx",String(i)),d[s].setAttribute("y","0");break;case rt:d[s].setAttribute("dx",String(-i)),d[s].setAttribute("y","0");break;default:d[s].setAttribute("x","0"),d[s].setAttribute("dy",String(r))}t=l[s]}if(p){const t=e.parent.dom.classList.contains("rct-annotation"),s=e.getBBox().width,[i]=d,r=i[ge];if(t)i.setAttribute("dx",String(u===rt?s-r/2:r/2));else switch(u){case it:i.setAttribute("x",String((s-r)/-2));break;case rt:i.setAttribute("x",String((s-r)/2))}}else e.layoutText(l[0][pe])}}buildVertical(e,i,r,n,o){const a=e.doc,h=y(this.lineHeight,1),l=this._lines,_=l.length,c=[];let d=0;const u=[];e.clearDom(),n=n||e;for(let i=0;i<_;i++){const r=l[i];let p=0,g=0,f=null,y=!1;for(let[h,l]of r.words.entries()){const c=0===i&&0===h,d=i===_-1&&h===r.words.length-1,u=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(s(n.options)){const t=n.options,e=c&&t.prefix||"",s=d&&t.suffix||"";u.textContent=e+(u.textContent||"")+s}" "===u.textContent&&(y=!0,u.textContent=".");const x=u.getBBox();if(u[ge]=x.width,u[pe]=x.height,y&&(u.textContent=" ",u[pe]*=.6,y=!1),p+=u[ge],g=m(g,u[pe]),f||(f=u),l instanceof ye){const s=a.createElementNS(t,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(u),e.appendDom(s)}}u.push(f),r[pe]=g*h,r[ge]=p*h,d=m(p,d),c.push(0==i?r[ge]/2:r[ge])}if(_>0){let t=l[0];u[0].setAttribute("x",String((d-u[0].getBBox().width)/2));for(let s=1;s<u.length;s++)u[s]&&(u[s].setAttribute("x",String((d-u[s].getBBox().width)/2)),u[s].setAttribute("dy",String(t[pe]-e.getAscent(t[pe])+e.getAscent(l[s][pe]))),t=l[s]);e.layoutText(l[0][pe])}}layout(t,e,s,i,r){const n=t.getBBox();let o=0,a=0;if(this._vertical)switch(o=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=_e.MIDDLE,a=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=_e.END,a=n.height-r.bottom;break;default:t.anchor=_e.START,a=r.top}else switch(a=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=_e.MIDDLE,o=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=_e.END,o=s-r.right;break;default:t.anchor=_e.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const s=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(we);for(let t of s)e.push((new be).parse(t))}}}class Se{constructor(t){this.source=t}hasDef(){return!0}}class Ve extends Se{_setStops(e,s){s.setAttribute("id",this.source.id);const r=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=i(r)?[...r]:[r,"white"],a=i(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(e,s,i,r,n){const o=e.createElementNS(t,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(e,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class Ae extends Ve{getEelement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,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}}Ae.TYPE="lineargradient";class Pe extends Ve{getEelement(e,s){const i=e.createElementNS(t,"radialGradient");return z(s.cx)||i.setAttribute("cx",s.cx),z(s.cy)||i.setAttribute("cy",s.cy),z(s.r)||i.setAttribute("r",s.r),this._setStops(e,i),i}}Pe.TYPE="radialgradient";class Ce extends Se{prepare(){}getEelement(e,i){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,h,_,c,d=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rct-pattern"),+i.pattern>=0){const t=Ce.STOCK[+i.pattern%Ce.STOCK.length];a=t.path,h=t.style,d=!t.fill,_=t.width||20,c=t.height||20}else n(i.pattern)&&(a=i.pattern,_=i.width||i.height||20,c=i.height||i.width||20);r.setAttribute("width",String(_)),r.setAttribute("height",String(c)),o.setAttribute("d",a),h&&l(o.style,h),i.style&&l(o.style,i.style),d&&(o.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const s=e.createElementNS(t,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(_)),s.setAttribute("height",String(c))}return r.append(o),r}}Ce.TYPE="pattern",Ce.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 ke extends Se{prepare(){const t=this.source;this._colors=i(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&at.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=i(e.colors)?e.colors:[]}}ke.TYPE="colors";class Le extends Se{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(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 n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||Le.SIZE,height:e.height||e.width||Le.SIZE})}}Le.TYPE="images",Le.SIZE=20;class Ne{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(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(s(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(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Ce.TYPE:i(t.colors)?e=ke.TYPE:i(t.images)&&(e=Le.TYPE)),e)switch(e.toLowerCase()){case Ae.TYPE:return new Ae(t);case Pe.TYPE:return new Pe(t);case Ce.TYPE:return new Ce(t);case ke.TYPE:return new ke(t);case Le.TYPE:return new Le(t)}}}}let Me=0;const Ee=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},Te=["__proto__","constructor","prototype"],Be=function(t,r){const n=s(t)?t:{};for(const t in r)if(e.call(r,t)&&!Te.includes(t)){const e=r[t];i(e)?n[t]=e.slice(0):s(e)?e._obj instanceof dt?n[t]=e:at.isDate(e)?n[t]=new Date(e):n[t]=Be(n[t],e):n[t]=e}return n};class Oe extends lt{constructor(t){super(),this.chart=t,Me++}init(){const t=this._op=Be({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(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}$_updateChildren(t){if(this._children)this._children.forEach((e=>t.hasOwnProperty(e)&&this[e].updateOptions(t[e])));else{this._children=[];for(const e in this){const s=this[e];s instanceof Oe&&(this._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}$_mergeOptions(t,e){const r=s(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];i(n)?r[t]=n.slice(0):s(n)?n instanceof dt?r[t]=n:n._obj instanceof dt?r[t]=n._obj:this[t]instanceof Oe?at.isDate(n)&&(r[t]=new Date(n)):r[t]=this.$_mergeOptions(r[t],n):r[t]=n}}updateOptions(t,e=!0){const i=this._op;return void 0===t||this._doSetSimple(t)||this.$_mergeOptions(i,t),this.$_applyOptions(i),s(t)&&this.$_updateChildren(t),e&&this._changed(),this}updateOption(t,e,s=!0,i=!1){if(this[t]instanceof Oe)this[t].updateOptions(e);else{const r=this._op;(i||e!==r[t])&&(r[t]=e,this.$_applyOptions(r),s&&this._changed())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s.hasOwnProperty(t)&&(this[t]instanceof Oe?this[t]._doSetSimple(!h(i)||!i):(s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,s=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Oe)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;e.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),s&&this._changed()}return this}clearOptions(t=!0){const e=function(t){var s;if(t){const i=t._op=Be({},t.constructor.defaults);return t.$_applyOptions(i),null===(s=t._children)||void 0===s||s.forEach((s=>{i[s]=e(t[s])})),i}};return e(this),t&&this._changed(),this}setStyle(t,s,i=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==s&&""!==s||(s=void 0),void 0===s?r&&e.call(r,t)&&(delete r[t],n=!0):r&&r[t]==s||(r||(r=this._style=this._op.style={}),r[t]=String(s),n=!0),n&&(this.$_applyOptions(this._op),i&&this._changed()),this}setStyles(t,e=!1,i=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),s(t)){n||(n=this._style=this._op.style={});for(const e in t){let s=t[e];n[e]!=s&&(null!==s&&""!==s||(s=void 0),void 0===s?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),i&&this._changed()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof Oe?t[r]=this[r]._load(n):i(n)?t[r]=n.slice(0):s(n)?n._obj instanceof dt?t[r]=n._obj:at.isDate(n)?t[r]=new Date(n):t[r]=l({},n):t[r]=n)}}_doSave(t,e,s){const r=this._op;for(const n in r)if(r.hasOwnProperty(n))if(s&&this[n]instanceof Oe)t[n]=this[n].saveOptions(!0);else{const s=r[n];i(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=X(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}Oe.REFRESHED="refreshed",Oe.defaults={visible:!0};class Re{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 De extends Oe{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=y(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?xt.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 ve),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}_getNumberText(t,e,s){if(at.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=at.scaleNumber(t,r,s)),i?n?i.toStr(n.value)+n.symbol:i.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this._getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}De.defaults=Ee(Oe.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class $e extends De{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 Le&&(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 Le?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}$e.defaults=Ee(De.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Fe extends Oe{}const Ie={};class ze extends Oe{static register(...t){t.forEach((t=>{Ie[t.type]=t}))}constructor(t,e){super(t),this.body=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}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.body){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.getAxisOf(this,!0);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.getAxisOf(this,!1);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=W(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=W(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(Oe.REFRESHED)}clicked(){return!1}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,this._row=isNaN(t.row)?NaN:t.row|0,this._col=isNaN(t.col)?NaN:t.col|0,(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){}}ze.defaults=Ee(Oe.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class He extends Re{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.options.row,r=s.options.col;return t===i&&e===r}))}getAnnotation(t){const e=this._map[t];if(e instanceof ze)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],o=this._map={};i(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(r,t,s,e?this.owner:void 0))})):s(t)&&n.push(this.$_loadItem(r,t,0,e?this.owner:void 0)),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):L}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,i);return a.init(),a.index=s,a._load(e),a}}class Ge extends Oe{}Ge.defaults=Ee(Oe.defaults,{minWidth:50});class je extends Oe{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new Ge(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 this.chart.win.Date?Rt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):xt.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 r(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}je.defaults=Ee(Oe.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Xe={};class Ye extends Oe{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class We extends Ye{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}We.defaults=Ee(Ye.defaults,{visible:void 0});class Ue extends Ye{getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return ot?"vertical"===e?0:"opposite"===this.axis.options.position?90:270:"vertical"===e||"vertical-lr"===e||"vertical-rl"===e?0:"opposite"===this.axis.options.position?90:270}return this._rotation}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation)}}Ue.defaults=Ee(Ye.defaults,{align:"middle",offset:0,gap:5});class Ze extends Ye{_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Ze.defaults=Ee(Ye.defaults,{position:"end",gap:2});class qe extends Ye{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 n(t)?(this._op.colors=[t,null],!0):i(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Ke extends Ye{_doInit(t){t.rows=(this._rows=new qe(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}}Ke.defaults=Ee(Ye.defaults,{visible:void 0,depthVisible:void 0});class Qe extends $e{getDefaultIconPos(){return"left"}}Qe.defaults=Ee($e.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Je extends Ye{_doInit(t){t.label=(this._label=new Qe(this.axis.chart)).init()}get label(){return this._label}canConstainedTo(t,e){const s=this._op;if(i(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(i(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}Je.defaults=Ee(Ye.defaults,{front:!1,zindex:0});class ts extends Je{}class es extends Je{}class ss extends Ye{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}_doSetSimple(t){return at.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),isFinite(this._op.length)?this._length=this._op.length:this._length=this.axis.label._inside?0:ss.DEF_LENGTH,this._gap=this._op.gap||0}}ss.DEF_LENGTH=7,ss.defaults=Ee(Ye.defaults,{visible:!1,gap:3});class is extends $e{constructor(t){super(t&&t.chart),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)}}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){var s;const i=this._op,r=t.index;if(i.textCallback){const e=i.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?b(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?b(i.firstText,i.text):r==e-1?b(i.lastText,i.text):i.text}getLabelStyle(t,e){const i=this._op,r=t.index;if(i.styleCallback){const e=i.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(s(e))return e}return 1==e?i.lastStyle||i.firstStyle:0==r?i.firstStyle:r==e-1?i.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===t.location}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}_getText(t,e,s,i){return n(t)?t:this._getNumberText(e,s,i)||e}}is.defaults=Ee($e.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class rs extends Ye{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)}}rs.defaults=Ee(Ye.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class ns{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}clamp(t,e=!0){return e?at.clamp(t,this.min,this.max):at.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,s){if(t>e){const s=t;t=e,e=s}const i=t!==this.start||e!==this.end,r=this.total(),n=this.axis.continuous();t=isNaN(t)?this.start:this.clamp(t,n);const o=(e=isNaN(e)?this.end:this.clamp(e,n))-t;if(i&&e>=t&&(isNaN(s)||o/r>=s)&&r/o>1)return this.axis._range={min:n?t:Math.floor(t),max:n?e:Math.ceil(e-1)},this.start=t,this.end=e,!0}}class os extends We{}class as extends Oe{static register(...t){t.forEach((t=>{Xe[t.type]=t,t.subtype&&(Xe[t.subtype]=t)}))}_animating(){return!isNaN(this._prevRate)}constructor(t,e){super(t),this._series=[],this._values=[],this._labelArgs={},this._seriesChanged=!1,this.guides=[],this._isX=e}_doInit(t){t.title=(this._title=new Ue(this)).init(),t.unitLabel=(this._unitLabel=new Ze(this)).init(),t.line=(this._line=new We(this)).init(),t.sectorLine=(this._sectorLine=new os(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 je(this)).init(),t.scrollBar=(this._scrollBar=new rs(this)).init()}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}get title(){return this._title}get unitLabel(){return this._unitLabel}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}checkVisible(){return!0===this._op.visible||!1!==this._op.visible&&!this._isEmpty}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}valueMin(){return this._min}valueMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return E+T*this._op.startAngle}getTotalAngle(){return T*this._op.totalAngle}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}getXStart(){return 0}dataToAxis(t){return t}axisToData(t){return t}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(){const t=this._values=[];this._isX?this._series.forEach((e=>{e.collectValues(this,e.needAxes()?t:null)})):this._series.forEach((e=>{const s=e.needAxes()?[]:null;e.collectValues(this,s),s&&(e._yMin=g(...s),e._yMax=m(...s),t.push(...s))}))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(this,this._values)}))}collectReferentValues(){this._series.forEach((t=>{t.prepareReferents(this)})),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){this._series=this._series.filter((t=>t._valid)),this.$_checkEmpty()}_checkValues(t){return t}_prepareRender(){const t=this.chart,e=this._op.position;this._isPolar=t.isPolar(),this._isHorz=t.isInverted()?!this._isX:this._isX,this._isBetween=t.isSplitted()&&"between"===e&&this._isX,this._isOpposite="opposite"===e,this._runPos=e,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),this._label._prepareRender(),this._tick._prepareRender();const s=this._series;if(this._isX&&this._prevSeries){if(!(this._seriesChanged=!at.equalArrays(s,this._prevSeries)))for(const t of s)if(t.seriesChanged()){this._seriesChanged=!0;break}}else this._seriesChanged=!1;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&s.length>0)if(t.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+=y(s.groupWidth(),1))})),s.forEach((s=>{if(s.row==t&&s.isClusterable()){const t=y(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=y(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=y(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t,e){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t,e),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+at.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[m(t,this._min),g(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new ns(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.chart=this.chart.wrapper,this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXLabel(t){return t}setPrevRate(t,e){this._prevSize=t,this._prevRate=e}prev(t){return isNaN(this._prevRate)?t:(this._op.reversed,t*this._prevRate)}isAnimating(){return!isNaN(this._prevRate)}_posValue(){const t=this._op.position;return"opposite"===t?-1:"between"===t?0:1}_load(t){return this.chart?super._load(this.chart.loadBase(t,this._isX?"xAxis":"yAxis",this._type())):super._load(t)}_doApply(t){const s=this,r=this.guides,n=function(t){var e;t!==s._guides&&(s._guides=t,e=i(t)?t:[t],r.length=0,e.forEach((t=>{let e;e="range"===t.type?new es(s):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new ts(s):new es(s),e.init(),e._load(t),r.push(e)})))};super._doApply(t),t.startAngle=y(this._op.startAngle,0),t.totalAngle=m(0,g(360,y(this._op.totalAngle,360))),this._name=t.name||`-axis-${this._index+1}`,this._row=y(Math.max(0,t.row|0),0),this._col=y(Math.max(0,t.col|0),0),e.call(t,"guide")?n(t.guide):e.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&this._series.indexOf(t)<0&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?R(g(...t)||0):NaN,max:t.length>0?R(m(...t)||0):NaN}}}as.defaults=Ee(Oe.defaults,{visible:void 0,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 hs extends Re{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;i(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),this._items.forEach((t=>{t.name&&this._map.set(t.name,t)}))}visibles(){return this._items.filter((t=>t.checkVisible()))}contains(t){return this._items.indexOf(t)>=0}get(t){return n(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t,e){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((s=>{(e<=2||s._isHorz)&&s._buildTicks(t,e)}))}connect(t){const e=this.isX,s=this._items,i=t.options,r=e?i.xAxis:i.yAxis;let o;if(a(r)&&r>=0&&r<s.length?o=s.find((t=>t._index===r)):n(r)&&(o=s.find((t=>t.options.name===r))),o||(o=s[0]),o&&this.chart.isValidAxis(o))return o._connect(t),this.isX?t.setCol(o.col):t.setRow(o.row),o}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,s){var r;let n=t._getAxisType(e.type);if(!n){let o;if(i(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(z(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(r=t._getSeries().first)||void 0===r?void 0:r.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._index=s,o.init(),o._load(e),o}}class ls extends Oe{_doPrepareRender(t){}}const _s={},cs={};class ds extends ls{constructor(){super(...arguments),this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}getSize(t,e){return{width:W(this._widthDim||this._sizeDim,t,t),height:W(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return W(this._leftDim,t)}getRight(t){return W(this._rightDim,t)}getTop(t){return W(this._topDim,t)}getBottom(t){return W(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._row=y(t.row|0,0),this._col=y(t.col|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}ds.defaults=Ee(ls.defaults,{size:"100%"});class us extends Oe{constructor(t){super(t.chart)}}class ps extends ds{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{_s[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}}ps.defaults=Ee(ds.defaults,{duration:500});class gs extends ds{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{cs[t.type]=t,cs[t.gaugeType]=t}))}get gauges(){return this._gauges.slice(0)}count(){return this._gauges.length}isEmpty(){return this._gauges.length<1}visibles(){return this._visibles.slice(0)}get(t){return this._gauges[t]}getVisible(t){return this._visibles[t]}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}_doApply(t){super._doApply(t),e.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const r=this._gaugesType();i(e)?e.forEach(((e,s)=>this.$_add(ps._loadGauge(t,e,r)))):s(e)&&this.$_add(ps._loadGauge(t,e,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}gs.defaults=Ee(ds.defaults,{minValue:0});class ms extends Re{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.row||0,r=s.col||0;return t===i&&e===r}))}getGauge(t){const e=this._map[t];if(e instanceof ps)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,r=this._items=[],n=this._map={};i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof gs)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._op.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(_s).length&&0===Object.keys(cs).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 r=i(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=s,n}}class fs extends ps{constructor(){super(...arguments),this._prevValue=0}_doInit(t){super._doInit(t),t.label=(this._label=this._createLabel()).init()}get label(){return this._label}getValue(){return m(this._op.minValue,g(this._op.maxValue,y(this._runValue,this._op.value)))}_setValueRate(t){this._runValue=this._prevValue+(this._op.value-this._prevValue)*t}updateValue(t){t!==this._op.value&&(this._op.value=t,this._changed())}getLabel(t,e){return t.options.text||(t.options.prefix||"")+"${value}"+(t.options.suffix||"")}getParam(t){switch(t){case"value":return this.label.options.animatable?y(this._runValue,this._op.value):this._op.value;case"min":return this._op.minValue;case"max":return this._op.maxValue}}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}}fs.defaults=Ee(ps.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class ys extends Oe{constructor(t){super(t.chart),this.scale=t}}ys.defaults=Ee(Oe.defaults,{reversed:!1,length:7});class xs extends $e{getText(t){return at.isValidNum(t)?this._getText(null,t,f(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class bs extends Oe{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new Oe(e)).init(),t.tick=(this._tick=new ys(this)).init(),t.label=(this._label=new xs(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=y(s,e);const{min:i,max:r}=this._adjustMinMax(g(e,s),m(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(m(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=y(s.options.minValue,t),e=y(s.options.maxValue,e),this._min=g(t,e),this._max=m(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=g(...t)),isNaN(i)&&(i=m(...t)),this._min=g(s,i),this._max=m(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(R(e));for(let e=1;e<t;e++)n.push(R(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(R(l=s));;){if(l+=o,l>=i){r.push(R(i));break}r.push(R(l))}return r}}bs.defaults=Ee(Oe.defaults,{position:"default",stepPixels:48,gap:8});class ws extends Oe{}ws.defaults=Ee(Oe.defaults,{visible:!1});class vs extends Oe{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new ws(e)).init(),t.tickLabel=(this._tickLabel=new Oe(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?W(this._thicknessDim,t,0):"inside"===this._op.position?t:vs.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=tt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}vs.defaults=Ee(Oe.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Ss extends De{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Ss.defaults=Ee(De.defaults,{animatable:!0});class Vs extends Ss{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Vs.defaults=Ee(Ss.defaults,{offsetX:0,offsetY:0});class As{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(Ps.DEF_CENTER),this.setCenterY(Ps.DEF_CENTER),this.setRadius(Ps.DEF_RADIUS),this.setInnerRadius(Ps.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=X(b(t,Ps.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=X(b(t,Ps.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=X(b(t,Ps.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=X(b(t,Ps.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=X(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),s=g(e,this._innerDim?W(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?W(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=y(t%360,0),i=m(0,g(360,y(e,360)));this._startRad=E+T*s,this._handRad=T*s,this._sweepRad=T*i}}class Ps extends fs{_doInit(t){super._doInit(t),this._props=new As}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}_createLabel(){return new Vs(this.chart)}_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 As)}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender();const e=this._group;e?this._childProps.prepareAngles(e.options.startAngle,e.options.sweepAngle):this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}Ps.DEF_CENTER="50%",Ps.DEF_RADIUS="40%",Ps.DEF_INNER="80%",Ps.defaults=Ee(fs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Cs extends gs{_doInit(t){this.props=new As,t.label=(this._label=new Vs(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)}}Cs.defaults=Ee(gs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let ks=class extends Oe{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};ks.defaults=Ee(Oe.defaults,{visible:void 0});class Ls extends De{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||Ls.DEF_TEXT}}Ls.DEF_TEXT="표시할 데이터가 없습니다.",Ls.defaults=Ee(Oe.defaults,{visible:void 0});class Ns extends Oe{}Ns.defaults=Ee(Oe.defaults,{visible:!1});class Ms extends Oe{_doInit(t){t.line=(this._line=new Ns(this.chart)).init(),t.endLine=(this._endLine=new Ns(this.chart)).init(),t.gridLine=(this._gridLine=new Ns(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}Ms.defaults=Ee(Oe.defaults,{});class Es extends Oe{_doInit(t){t.xSide=(this._xSide=new Ms(this.chart)).init(),t.ySide=(this._ySide=new Ms(this.chart)).init(),t.orgLine=(this._orgLine=new Ns(this.chart)).init()}get xSide(){return this._xSide}get ySide(){return this._ySide}get orgLine(){return this._orgLine}_isVisible(){return this._op.visible&&this._op.length>=0}_doSetSimple(t){return a(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.angle=g(60,m(30,y(t.angle,45)))}}Es.defaults=Ee(Oe.defaults,{visible:!1,length:32,angle:32});class Ts extends Oe{constructor(t){super(t),this._annotations=new He(this)}_doInit(t){t.depth=(this._depth=new Es(this.chart)).init(),t.image=(this._image=new Fe(null)).init(),t.emptyView=(this._emptyView=new Ls(this.chart)).init(),t.zoomButton=(this._zoomButton=new ks(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof ds&&this.contains(s)?s:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get zoomButton(){return this._zoomButton}canZoom(){return!this.chart.isEmpty(!0)&&("x"===this._op.zoomType||"y"===this._op.zoomType||"both"===this._op.zoomType)}_getDepth(t,e){if(this._depth.visible&&this.chart._getSeries().canDepth()){const s=this._depth.options,i=s.length,r=s.angle,n=c(d(r*T)*i),o=c(u(r*T)*i);return{depth:i,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return W(this._radiusDim,g(t,e))}setPolar(t,e){return this._cx=W(this._centerXDim,t),this._cy=W(this._centerYDim,e),this._rd=W(this._radiusDim,g(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,cyclic:t&&t.options.totalAngle>=360}:void 0}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}contains(t){return!0}_doApply(t){const s=this,i=function(t){t!==s._anns&&(s._anns=t,s._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),e.call(t,"annotation")?i(t.annotation):e.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}Ts.defaults=Ee(Oe.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class Bs extends Oe{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)}}Bs.defaults=Ee(Oe.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Os extends Oe{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class Rs extends ls{constructor(){super(...arguments),this._items=[],this._visItems=[],this._itemMap={}}items(){return this._visItems.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 W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(this._maxHeightDim,t,t)}getMarkerSize(){return y(this._op.markerSize,10)}getSources(t){const e=this._itemMap[t.source.legendKey()];return e?e.map((t=>t.source)):t.source}_isVisible(){return!0===this._op.visible&&this._visItems.length>0||!1!==this._op.visible&&this._visItems.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=b(e.location,"bottom"),this._items=this._getLegendSources().map((t=>new Os(this,t))),e.reversed&&(this._items=this._items.reverse());const s=this._itemMap={},i=this._visItems=[];this._items.forEach((t=>{const e=t.source.legendKey();if(at.isNotEmpty(e)&&""!==e){const r=s[e];r?r.push(t):(s[e]=[t],i.push(t))}else i.push(t)}))}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var Ds;Rs.defaults=Ee(ls.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 $s=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Fs=.001;class Is{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>this[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}static line(t,e,s,i){return["M",t,e,"L",s,i]}static polygon(...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=g(f(i)/2,s/2,r),n=g(f(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=g(f(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=g(f(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=g(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 isCircled(t){return M-t<Fs}static arc(t,e,s,i,r,n,o,a=!1){const h=g(M,f(n-r)),l=this.isCircled(h),_=h>N?1:0,c=o?1:0,p=d(r),m=u(r),y=d(n-=l?c?Fs:-.001:0),x=u(n),b=[];return b.push("M",t+s*p,e+i*m,"A",s,i,0,_,c,t+s*y,e+i*x),l&&b.push("M",t,e),a&&b.push("Z"),b}static sector(t,e,s,i,r,n,o,a){const h=g(M,f(o-n)),l=this.isCircled(h),_=h>N?1:0,c=a?1:0,p=d(n),m=u(n),y=d(o-=l?c?Fs:-.001:0),x=u(o),b=s*r,w=i*r,v=[];return v.push("M",t+s*p,e+i*m,"A",s,i,0,_,c,t+s*y,e+i*x),l?v.push("M",t+b*y,e+w*x):v.push("L",t+b*y,e+w*x),r>0&&v.push("A",b,w,0,_,1-c,t+b*p,e+w*m),v.push("Z"),v}static donut(t,e,s,i){return["M",t-s,e,"a",s,s,0,1,1,2*s,0,"a",s,s,0,1,1,2*-s,0,"Z","M",t-i,e,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0,"Z"]}static arc3d(t,e,s,i,r,n,o,a,h){function l(t,e,n,o){b.push("M",t,e,"A",s,i,0,c,_,n,o),b.push("L",n,o+r),b.push("A",s,i,0,c,1-_,t,e+r),b.push("Z")}const _=a?1:0;let c,p=g(M,f(o-n));const m=this.isCircled(p);let y=(n%M+M)%M,x=(o%M+M)%M;const b=[];let w,v,S,V;if(!m&&(_&&y<=N&&x>=0&&x<y||!_&&x<=N&&y>=0&&y<x))c=0,_?(w=t+s*d(n),v=e+i*u(n),S=t+s*d(N),V=e+i*u(N),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*d(0),v=e+i*u(0),S=t+s*d(o),V=e+i*u(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V)):(w=t+s*d(n),v=e+i*u(n),S=t+s*d(0),V=e+i*u(0),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*d(N),v=e+i*u(N),S=t+s*d(o),V=e+i*u(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V));else{w=t+s*d(n),v=e+i*u(n),S=t+s*d(o-=m?_?Fs:-.001:0),V=e+i*u(o),_?(y=m||y<=M&&!(x>=y&&x<M)?0:y,x=m||x>N&&!(y<=x&&y>N)?N:x):(y=m||y>N&&!(x<=y&&x>N)?N:y,x=m||x<M&&!(y>=x&&y<M)?0:x);const r=t+s*d(y),a=e+i*u(y),p=t+s*d(x-=m?_?Fs:-.001:0),g=e+i*u(x);c=f(x-y)>N?1:0,l(r,a,p,g),h&&(h.x1=w,h.y1=v,h.x2=S,h.y2=V)}return b}static arc3dInner(t,e,s,i,r,n,o,a,h){const l=g(M,f(o-n)),_=this.isCircled(l),c=a?1:0,p=t+s*d(n),m=e+i*u(n),y=t+s*d(o-=_?c?Fs:-.001:0),x=e+i*u(o),b=l>N?1:0,w=[];return w.push("M",p,m,"A",s,i,0,b,c,y,x),w.push(_?"M":"L",y,x+r),w.push("A",s,i,0,b,1-c,p,m+r),h&&(h.x1=p,h.y1=m,h.x2=y,h.y2=x),w.push("Z"),w}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*u(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,p=c/2,g=[];g.push("M",n+a*d(r),o+h*u(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*u(r),"L",n+l*d(r+p),o+_*u(r+p)),r+=c;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Ds[e](0,0,m(2*s,0),m(2*i,0));break;default:r=Ds.circle(s,i,m(g(s,i),0))}t.setPath(r)}}Ds=Is,Is._drawers=Object.assign({circle:t=>Ds.circle(0,0,t),none:t=>[]},Ds._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class zs extends Jt{static create(t,e,s,i,r,n,o=0){return new zs(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=L,s=L){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 Hs extends ne{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(Is.box(t,e,s,i)),this}}const Gs="head",js="far",Xs="inside",Ys="none",Ws="near",Us="displayAll",Zs="largestFirst",qs="hidden",Ks="line",Qs="area",Js="circlebar",ti="treemap",ei="heatmap",si="vector",ii="wordcloud",ri="pictogram",ni="pictorialbar",oi="pictorial",ai="racebar",hi="raceline";let li=0;const _i="_deleted";class ci{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=li++,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:i(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?(this._readObject(t,e),(i(e.drillDown)||s(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}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]];if(null!=i&&"object"==typeof i)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[_i]=!0}_isDeleted(){return this[_i]}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):i(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=L}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return l(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=t.options,i=+s.colorField,r=+s.iconField;e.length>1?(this.x=e[y(s.xField,0)],this.y=e[y(s.yField,1)]):this.y=e[0],isNaN(i)||(this.color=e[i]),isNaN(r)||(this.icon=e[r])}_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=w(t._yFielder(e),e.y,e.value),this.color=b(t._colorFielder(e),e.color),this.icon=b(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 di{constructor(t){this._points=[],this._owner=t}get owner(){return this._owner}get count(){return this._points.length}isEmpty(){return this._points.length<1}_internalPoints(){return this._points}get(t){return this._points[t]}pointAt(t,e){function i(t,e,i){return s(t)?t.pid===e:t===i}return this._points.find((s=>i(t,s.pid,s.xValue)&&(void 0===e||i(e,s.pid,s.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){i(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return this._points.splice(e,1),!0}clean(){this._points=this._points.filter((t=>!t[_i]))}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){const e=this._points,s=t._zoom;if(this._owner.needAxes()&&s){const s=t._range;let i=t.axisToData(s.min),r=t.axisToData(s.max);return t.continuous()?e.filter((t=>t.xValue>=i&&r>=t.xValue)).slice(0):e.filter((t=>t.xValue>i-.5&&r+.5>t.xValue)).slice(0)}return e}}class ui extends ci{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return l(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=t.options,i=e.length>2?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.y=e[y(s.yField,0+i)],this.z=e[y(s.zField,1+i)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=b(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.yValue=e.zValue=this.yValue}applyValueRate(t,e){this.zValue=S(t.zValue,this.zValue,e)}}class pi extends ci{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return l(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[y(s.lowField,0+i)],this.y=e[x(s.highField,s.yField,1+i)],i>0&&(this.x=e[y(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=b(e[t.options.lowField],e.low),this.y=w(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=S(t.lowValue,this.lowValue,e)}}class gi extends ss{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}gi.defaults=Ee(ss.defaults,{step:1});class mi extends is{getTick(t,e){if(null!=e){const t=this._getText(e,e,!1,!1),s=t.lastIndexOf(this.sep);return i(this.axis.options.categoryField)&&s>0?t.substring(s+this.sep.length):t}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}mi.defaults=Ee(is.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class fi extends Ke{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 yi extends as{constructor(){super(...arguments),this._minPad=0,this._maxPad=0,this._catStart=0,this._catStep=1,this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}get label(){return this._label}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}getCategorySeparator(){return this._op.categorySeparator||"+"}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new ns(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new fi(this)}_createTickModel(){return new gi(this)}_createLabel(){return new mi(this)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=at.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){var t;let e=super.getStartAngle(),s=+this._op.startOffset;return s>0&&(e-=g(s,1)*((null===(t=this._categories[0])||void 0===t?void 0:t.w)||1)*M/this._catLen),e}_doPrepareRender(){const t=this._op;this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=x(t.minPadding,t.padding,0),this._maxPad=x(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,y(t.categoryPadding,0))))}_adjustMinMax(t,e,s){const i=this._op;return i.minValue<t&&(t=i.minValue),i.maxValue>e&&(e=i.maxValue),{min:t,max:e}}_doBuildTicks(t,e,s,i){const r=this._label;let n=this._weights=this._categories.map((t=>{var e;return null!==(e=t.w)&&void 0!==e?e:1}));const o=this._tick.options.step||1,a=[];if(!this._zoom){const{min:i,max:r}=this._adjustMinMax(t,e,s);t=Math.floor(i),e=Math.ceil(r)}this._catMin=t,this._catMax=e;let h=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(h,this._tick.options.step||1));for(let e=-1;e>=t;e--)n.unshift(1);const l=Math.max(h,e+1);for(;n.length<l;)n.push(1);n=n.slice(Math.max(0,t),e-Math.min(0,t)+1),h=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0);const _=this._pts=[];if(h>0){let s=this._minPad;_.push(0);for(let i=t;i<=e;i++)_.push(s/h),s+=n[i-t]||1;_.push(s/h),_.push((s+this._maxPad)/h)}const c=this._catStart,d=this._catStep;for(let e=1;e<_.length-2;e+=o){const s=t+e-1,i=this._categories[s/d-c];a.push({index:e-1,pos:NaN,value:s,label:r.getTick(e-1,i?i.t:s)})}return this._setMinMax(t,e),a}_calcPoints(t,e){const s=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<s.length;t++)s[t]=0;else for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this._op.totalAngle*T;if(0===t)for(let t=0;t<s.length;t++)s[t]=0;else for(let i=0;i<s.length;i++)s[i]=s[i]/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],n=r+(s[i+2]-r)*(e-Math.floor(e+.5)+.5);return this._op.reversed?t-n:n}valueAt(t,e){const s=this._pts;this._op.reversed&&(e=t-e);for(let t=1;t<s.length-1;t++){const i=s[t],r=s[t+1];if(e>=i&&r>=e){return this._catMin+t-(1-(e-i)/(r-i))}}}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 a(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=g(0,e.min),e.max=m(0,e.max)),e}$_collectCategories(t){const e=this._op,r=e.categories,n=this._categories=[];if(i(r)&&r.length>0)this._len=0,r.forEach((t=>{const e=null==t?1:y(t.weight,1),i=t&&t.icon;let r,o;null==t?o=r=null:s(t)?(r=b(t.name,t.label),o=b(t.label,t.name)):o=r=String(t),this._len+=e,n.push({c:r,t:o,w:e,i:i})}));else{const s=this.chart.seriesByName(e.categorySeries),r=this.chart.seriesByName(e.weightSeries)||s,o=e.weightField,a=null==r?void 0:r.data;let h=[];!e.weightByFrequency&&o&&i(a)&&a.length>0&&a.forEach((t=>{const e=t[o];at.isNumber(e)&&e>=0?h.push(e):h.push(1)})),s&&(t=[s]);const l=e.weightByFrequency;let _,c=0;if(i(t)&&t.length>0)for(const e of t){const t=e.collectCategories(this);t.length>0&&t.forEach(((t,e)=>{l&&(t!==_?(c>0&&(n[n.length-1].w=c),_=t,c=1):c++),n.find((e=>e.c===t))||n.push({c:t,w:h[e]||1,t:t})}))}c>0&&(n[n.length-1].w=c)}this._map={},n.forEach(((t,e)=>{const s=t.v=e;null!=t.c&&(this._map[t.c]=s)}))}}yi.type="category",yi.defaults=Ee(as.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});class xi extends Oe{}xi.defaults=Ee(Oe.defaults,{visible:!1});class bi extends $e{getAlign(t,e,s,i){let r=this._op.align;return"auto"===r&&(r=t?s?"left":"right":i<=0?e?"left":"right":i>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,s){let i=this._op.verticalAlign;return"auto"===i&&(i=t?"middle":s?"bottom":"top"),i}getAlignPolar(t){let e=this._op.align;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100||s>=260&&s<=280?"center":s>100&&s<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._op.verticalAlign;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100?"bottom":s>=260&&s<=280?"top":"middle"}return e}getOffsetX(t){const e=this._op.offsetX;return isNaN(e)?"center"===t?0:bi.OFFSET:e}getOffsetY(t){const e=this._op.offsetY;return isNaN(e)?"middle"===t?0:bi.OFFSET:e}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),t.position=g(1,m(0,y(t.position,1))),t.align="left"===t.align||"center"===t.align||"right"===t.align?t.align:"auto",t.verticalAlign="top"===t.verticalAlign||"middle"===t.verticalAlign||"bottom"===t.verticalAlign?t.verticalAlign:"auto"}}bi.OFFSET=4,bi.defaults=Ee(Oe.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class wi extends Oe{getRadius(){return m(0,y(this._op.radius,4))}}wi.defaults=Ee(Oe.defaults,{visible:!1,radius:4});class vi extends Oe{constructor(t){super(t.chart),this.owner=t,this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),t.variableArea=(this._variableArea=new xi(this.chart)).init(),t.fixedArea=(this._fixedArea=new xi(this.chart)).init(),t.label=(this._label=new bi(this.chart)).init(),t.marker=(this._marker=new wi(this.chart)).init()}get variableArea(){return this._variableArea}get fixedArea(){return this._fixedArea}get expression(){return this._expr}get label(){return this._label}get marker(){return this._marker}getLabelDomain(){return this._labelDomain}setRange(t,e,s,i){return this._minX=t,this._maxX=e,this._minY=s,this._maxY=i,this}_doPrepareRender(t){const e=this._op,s=e.type,i=this.owner,r=this._res=Math.max(1,(i._visPoints.length-1)*Math.max(1,+e.resolution||5)),n=this._minX>0?0:(this._maxX-this._minX)/r-this._minX,o=this._minY>0?0:(this._maxY-this._minY)/r-this._minY,a=i._visPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+n,y:t.yValue+o}))).sort(((t,e)=>t.x-e.x)),h=(this["_"+s]||this._linear).call(this,this._formatter,a);if(this._points=[],h&&"function"==typeof h.evaluator){if(a.length>0){const t=a[0].x,i=a[a.length-1].x,r=e.forward>0?e.forward:0;let n=t-(e.backward>0?e.backward:0),o=i+r;if("logarithmic"===s||"power"===s){const t=Number.EPSILON||1e-12;n<=0&&(n=t)}const l=i-t,_=o-n,c=l>0?Math.ceil(this._res*_/l):this._res;for(let t=0;t<=c;t++){const e=n+(o-n)*t/c,s=h.evaluator(e);Number.isFinite(s)&&this._points.push({x:e,y:s})}}}else if(h&&Array.isArray(h.points))if("movingAverage"===s&&"flat"===e.maExtrapolation||"linear"===e.maExtrapolation){const t=e.forward>0?e.forward:0,s=e.backward>0?e.backward:0,i=h.points;if(i.length>0){const r=i[0],n=i[i.length-1],o=n.x-r.x,a="flat"===e.maExtrapolation;if(s>0){const t=Math.max(2,Math.ceil(this._res*s/o)),e=s/t;if(a){const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}else if(i.length>=2){const s=i[0],n=i[1],o=(n.y-s.y)/(n.x-s.x);for(let i=t;i>0;i--){const t=r.x-e*i,n=s.y+o*(t-s.x);this._points.push({x:t,y:n})}}else{const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}}if(this._points.push(...i),t>0){const e=Math.max(2,Math.ceil(this._res*t/o)),s=t/e;if(a){const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}else if(i.length>=2){const t=i[i.length-1],r=i[i.length-2],o=(t.y-r.y)/(t.x-r.x);for(let i=1;i<=e;i++){const e=n.x+s*i,r=t.y+o*(e-t.x);this._points.push({x:e,y:r})}}else{const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}}}}else this._points.push(...h.points);this._expr=h&&h.expr,this._points.forEach((t=>{t.x-=n,t.y-=o}))}getLabel(){return""}_doApply(t){super._doApply(t),t.forward=m(0,y(t.forward,0)),t.backward=m(0,y(t.backward,0)),this._formatter=xt.getFormatter(t.numberFormat||"0.####")}_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){if(e.length>1){const{m:s,a:i}=this._calcLine(e),r=t=>s*t+i;return{expr:`y = ${t.toStr(s)}x + ${t.toStr(i)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:y(t.y,0)}))),{m:i,a:r}=this._calcLine(s),n=t=>t<=0?NaN:r+Math.log(t)*i;return{expr:`y = ${t.toStr(i)}log(x) ${r>0?"+":"-"} ${t.toStr(f(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:i,a:r}=this._calcLine(s),n=Math.exp(r),o=t=>t<=0?NaN:n*t**i;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(i)})}`,evaluator:o}}return{}}_calcLine2(t){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){if(e.length>1){const s=e.map((t=>({x:t.x,y:t.y}))),{m:i,a:r}=this._calcLine2(s),n=r,o=t=>n*Math.exp(i*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(i)}x))`,evaluator:o}}return{}}_polynomial(t,e){const s=e.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let i=0;i<s;i++)n+=e[i].x**t*e[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=e[r].x**(t+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++)f(s[t][r])>f(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=>h.reduce(((e,s,i)=>e+s*t**i),0);return{expr:"y = "+(h.map(((e,s)=>{const i=+e;if(!isFinite(i)||0===i)return"";const r=t.toStr(i);if("0"===r)return"";if(0===s)return i<0?`-${r}`:`${r}`;return`${i<0?"- ":"+ "}${r}${1===s?"x":`x^${s}`}`})).filter((t=>t)).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const s=e.length,i=m(1,g(s-1,this._op.movingInterval)),r=[];let n=i;for(;n<=s;){const t=e.slice(n-i,n).reduce(((t,e)=>t+y(e.y,0)),0);r.push({x:e[n-1].x,y:t/i}),n++}return{expr:`y = movingAverage(${t.toStr(i)})`,points:r}}}var Si;vi.defaults=Ee(Oe.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const Vi={},Ai={};class Pi extends Oe{}Pi.defaults=Ee(Oe.defaults,{visible:!1});class Ci extends $e{_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 at.isValidNum(t)?this._getText(null,t,f(t)>1e3,!0):t}getOffset(){return y(this._op.offset,0)}getDefaultIconPos(){return"top"}getRotation(){return m(-90,g(90,y(this._op.rotation,0)))}_isVisible(){return this._op.visible||r(this._op.visibleCallback)}_doSetSimple(t){return r(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doApply(t){"auto"===t.position&&(t.position="default"),super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=y(t.verticalAdjust,0)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Si=Ci,Ci.OFFSET=4,Ci.defaults=Ee($e.defaults,{visible:void 0,position:"default",offset:Si.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});const ki={x:"xValue",y:"yValue",z:"zValue"};class Li extends Yt{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 Ni extends Yt{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 Mi extends ci{}const Ei=12;class Ti extends Oe{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0,this._simpleMode=!1}static register(...t){t.forEach((t=>{Vi[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._setIndex(e,t._seriesIndex++),n.init(),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 di(this),this._pointArgs={},this._paletteColors=Array(Ei).fill(0).map(((t,e)=>e));this.chart.chartOptions.options.paletteMode==et&&at.shuffle(this._paletteColors),t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){at.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){at.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){at.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){at.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 Ti.getPointTooltipParam(t,e,s)}_type(){return this.constructor.type}_viewType(){return this._type()}get index(){return this._index}get name(){return this._name}get row(){return this._row}setRow(t){this._row=t}get col(){return this._col}setCol(t){this._col=t}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}get isWidget(){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)}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}isXY(){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}legendStroke(){return this._calcedStroke}legendLabel(){return this._op.label||this.name}legendKey(){return this[this._op.legendKey]}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}isRace(){return!1}canDepth(){return!1}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}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(t){const e=t.getValue(this._op.xStart),s=isNaN(e)?t.getValue(this.chart.chartOptions.getXStart(t)):e;return y(s,t.getXStart())}$_getXStep(t){return w(this._op.xStep,this.chart.chartOptions.options.xStep,1)}_buildVisPoints(t){return t.filter((t=>!1!==t.visible))}_prepareRunPoints(t,e){this._runPoints=this._points.getRunPoints(t),this.visible&&!this._referents?this._visPoints=this._buildVisPoints(this._runPoints):this._visPoints=null}_dataSourceChanged(){const t=this._doLoadData(this._data);this._loadPoints(t)}_connect(t){this._xAxisObj=this._group?this._group._xAxisObj:t._connectSeries(this,!0),this._yAxisObj=this._group?this._group._yAxisObj:t._connectSeries(this,!1)}_prepareRender(){this._legended=null,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 yi)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.options.categoryField;if(null!=e){if(i(e)){const s=e.length-1,i=t.getCategorySeparator();return this._points._internalPoints().filter((t=>n(t.getProp(e[s])))).map((t=>e.map((e=>t.getProp(e))).join(i)))}return this._points.getProps(e).filter((t=>n(t)))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>n(t)))}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);n(i)&&(i=i.trim()),this._points.forEach(((e,r)=>{let n=t.getValue(e.x);isFinite(n)||(n=s,s=t.incStep(s,i)),e.xValue=n})),e&&this._runPoints.forEach((t=>{!1!==t.visible&&e.push(t.xValue)}))}else this._points.forEach(((e,s)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let s=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(s)&&t&&(s=t.getValue(e.y)),e.initValues(),isNaN(e._vr)||(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),s=e._prev.yValue+(s-e._prev.yValue)*e._vr,e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=s,e.isNull=!isFinite(s)}})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)}))}collectRanges(t,e){if(t&&t._isX)return void(e&&!isNaN(this._minX)&&e.push(this._minX,this._maxX));const s=this._visPoints,i=s.length;if(i>0){const t=this._trendline,e=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(null==t?void 0:t.visible){t.setRange(o,a,h,l)._prepareRender();const e=t._points||[],s=e.map((t=>t.y)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e)),i=e.map((t=>t.x)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e));s.length>0&&(h=Math.min(h,s[0]),l=Math.max(l,s[s.length-1])),i.length>0&&(o=Math.min(o,i[0]),a=Math.max(a,i[i.length-1]))}e.yMin=this._minY=h,e.yMax=this._maxY=l,e.xMin=this._minX=o,e.xMax=this._maxX=a,r&&(e.zMin=this._minZ=_,e.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return y(this._op.paddingRate,1)}_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=tt(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=L}))}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._getLabelDefaultPos(t,t.options.position)}_getLabelDefaultPos(t,e){return e}getLabelPos2(t,e){return this._labelPosCallback?this._getLabelDefaultPos(t,this._labelPosCallback(this._getPointCallbackArgs(this._pointArgs,e))):this._labelPos}getLabelOff(t){return t}getLabelOff2(t){return this._labelOffCallback?y(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Ci.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._preparePointArgs(t),(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 n(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:L}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e){if(t instanceof ci||(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 Li(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 Li(this,e),t.ani.start()}this._dataPointsChanged()}return e}addPoints(t){const e=[];return i(t)&&t.forEach((t=>{const s=this._doAddPoint(t);s&&e.push(s)&&this._points.add(s)})),e.length>0&&(this.chart.animatable()&&e.forEach((t=>{const e=t._prev=t.copy();e.ani=new Li(this,t),e.ani.start()})),this._dataPointsChanged()),e}_needDeleteAnimation(){return!1}removePoint(t){if(t instanceof ci||(t=this.getPointAt(t)),t){if(this._points.contains(t)&&this._needDeleteAnimation()&&this.chart.animatable())return t._setDeleted(),new Ni(this._points).start(),this._changed(),!0;if(this._points.remove(t))return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePoints(t){if(i(t)){const e=this._needDeleteAnimation()&&this.chart.animatable(),s=[];if(t.forEach((t=>{t instanceof ci||(t=this.getPointAt(t)),t&&(e?(t._setDeleted(),s.push(t)):this._points.remove(t)&&s.push(t))})),s.length>0)return e?(new Ni(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()}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new Ci(t)}_createPoint(t){return new Mi(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 zs.create(t,Ti.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 r(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(i(t))return t;if(t){let e;if(t._obj instanceof dt)e=t._obj;else if(t instanceof dt)e=t;else if(Number.isFinite(t)||s(t)||h(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;return this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=t.pointColors,s=this._runColor=a(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%Ei+1)})`:t.color;let r,o;i(e)?r=e:n(e)?e.endsWith("@pal")||e.endsWith("@palette")?r=this.chart.getPaletteColors(e.split("@")[0]):o=this.chart._assets.get(e):this._colorByPoint()&&(r=this.chart.chartOptions.options.colors),o instanceof ke?this._runPoints.forEach(((t,e)=>{t.color=t.color||o.getNext()||s})):i(r)?this._runPoints.forEach(((t,e)=>{t.color=t.color||r[e%r.length]||s})):this._runPoints.forEach(((t,e)=>{t.color=t.color||s})),this._preparePointArgs(this._pointArgs),this._labelPosCallback=V(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=V(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const s=t[ki[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=L}_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}}Ti.LEGEND_MARKER="rct-legend-item-marker",Ti.defaults=Ee(Oe.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}:<b> ${yValue}</b>",loadAnimation:"default",hoverEffect:"default",interactive:!0,paddingRate:1});class Bi extends Re{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}canDepth(){return this._visibleSeries.every((t=>t.canDepth()))}_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 Ui&&e.series[0]._type()===t)return e.series[0]}}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(t=-1,e=-1){const s=[];return this._items.forEach((i=>{i._valid&&!i._legended&&(t<0||t===i.row)&&(e<0||e===i.col)&&(i.getLegendSources(s),i._legended=t>=0&&e>=0)})),s}canPolar(){return this._series.length>0&&this._series.every((t=>t&&t.canPolar))}load(t){const e=this.chart,r=this._items=[],n=this._series=[];i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{t instanceof Ui?n.push(...t.series):t instanceof Ti&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t))),e._op.series=this._items.map((t=>t.options))}add(t,e){const s=this.$_loadItem(this.chart,t,this._series.length);if(s)return s._needAnimate=e,this._items.push(s),this._series.push(s),this.$_add(s),s}remove(t){let e;if(t instanceof Ti?e=t:n(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>{t._setIndex(e)})),e;if(e._group.remove(e))return e}}updateData(t){}connect(t){const e=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0)));e.forEach((e=>{e._connect(t),e._valid=Boolean(e._xAxisObj&&e._yAxisObj)})),this._visibles=e.filter((t=>t._valid))}prepareRender(){const t=[];let e=0;this._series.forEach((s=>{if(s.visible){const i=s._group;(i?i.visible&&i._valid:s._valid)&&(t.push(s),s.hasShape()&&s.setShape($s[e++%$s.length]),i||(s._valid=!0))}})),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 Gi&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){const r=i(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const i=new r(t);return i._setIndex(s),i.init(),i._load(e),i}return Ti._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof zi||(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 Oi extends Ti{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new vi(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}Oi.defaults=Ee(Ti.defaults,{});class Ri extends Oe{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)}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Ri.defaults=Ee(Oe.defaults,{radius:3});class Di extends ci{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return b(this.x,this.y)}legendKey(){return this._legendKey}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:"percent"===t?this._percent:e}}class $i extends Oe{_doSetSimple(t){return n(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}$i.defaults=Ee(Oe.defaults,{curved:!0});class Fi extends Ci{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new $i(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")}}Fi.defaults=Ee(Ci.defaults,{visible:!0,convergent:!0,align:Ys,dedupeMode:Us});class Ii extends Oe{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?W(this._minDim,ci.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=Ii.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=X(t.minValue,!0)}}Ii.DEF_COUNT=10,Ii.defaults=Ee(Oe.defaults,{visible:!1,x:"기타"});class zi extends Ti{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new Ii(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:W(this._centerXDim,t),y:W(this._centerYDim,e)}}_getLabelDefaultPos(t,e){return"default"===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=X(w(s,e._op.center,zi.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=X(w(i,e._op.center,zi.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach((t=>this._sum+=t.yValue));const s=this.getSum();this._runPoints.forEach((t=>t._percent=100*t.yValue/s))}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._op.legendKey,s=this.othersGroup;if(s.visible){if(!this._groupedPoints&&(this._groupedPoints=s.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).map(((t,s)=>(t.vindex=s,t._legendKey=t[e],t)))}}zi.DEF_CENTER="50%",zi.defaults=Ee(Ti.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:zi.DEF_CENTER,centerY:zi.DEF_CENTER});class Hi extends zi{getRadius(t,e){return W(this._radiusDim,g(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=X(b(t._radius=e,Hi.defaults.radius),!0))}(this,t.radius)}}Hi.defaults=Ee(zi.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class Gi extends Oi{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,e){const s=this._group;let i=t;return s?(i*=s._clusterWidth,i*=1-2*s.options.groupPadding,i*=this._childWidth):i*=this._clusterWidth,i*=1-2*this._pointPad,m(e,i)}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=y(this.getMinPointWidth(),0)}}Gi.defaults=Ee(Ti.defaults,{pointWidth:1,minPointWidth:0});class ji extends Ci{get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new Pi(this.chart)).init()}}ji.defaults=Ee(Ci.defaults,{});class Xi extends Gi{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new ji(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=m(0,x(e.depth,t.getDepth(),Xi.DEPTH)),this._distance=t.getDistance()+y(e.distance,0)):(this._depth=m(0,y(e.depth,Xi.DEPTH)),this._distance=y(e.distance,Xi.DISTANCE)),e.nullAsBase&&null!=e.baseValue&&this._runPoints.forEach((t=>{t.isNull&&(t.y=e.baseValue,t.isNull=!1)})),this._base=w(this._getGroupBase(),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_getGroupBase(){return this._op.baseValue}isBased(t){return t===this._yAxisObj}}Xi.DEPTH=10,Xi.DISTANCE=5,Xi.defaults=Ee(Gi.defaults,{nullAsBase:!1});class Yi extends Gi{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach((t=>{if(e){const s=this._getBottomValue(t);!isNaN(s)&&e.push(s)}}))}}class Wi extends Yi{}class Ui extends Oe{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{Ai[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{Ai[t.seriesType]=t}))}static collectTooltipText(t,e,s,i){let r=t.tooltipHeader||"";return t.tooltipRow&&e.forEach(((e,n)=>{let o;e!==s?e.needAxes()&&(o=e.getPointAt(i.xValue)):o=i,o&&(r&&(r+="<br>"),r+=t.tooltipRow.replace("yValue","yValue."+i.index).replace(/\$\{/g,"${"+n+"."))})),r+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",r}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=parseInt(i.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(s.xValue);o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),Ti.getPointTooltipParam(e,s,i)}getTooltipText(t,e){return Ui.collectTooltipText(this._op,this._visibles,t,e)}getTooltipParam(t,e,s){return Ui.inflateTooltipParam(this._visibles,t,e,s)}isXY(){return!1}isMarker(){return!1}get col(){return this._col}setCol(t){t!==this._col&&(this._col=t,this._series.forEach((e=>e.setCol(t))))}get row(){return this._row}setRow(t){t!==this._row&&(this._row=t,this._series.forEach((e=>e.setRow(t))))}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}isRace(){return!1}getDepth(){}getDistance(){return 0}get index(){return this._index}get visCount(){return this._visibles.length}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}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,e){this._visibles.forEach((s=>{s.collectRanges(t,e)}))}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,r=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==s.layout&&"stack"!==s.layout)i.forEach((t=>t.getLegendSources(r)));else for(let t=i.length-1;t>=0;t--)i[t].getLegendSources(r);s.reversedInLegend&&r.reverse(),t.push(...r)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),this._series.forEach(((t,e)=>{t._setIndex(e)})),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e._getVisiblePoints()))),t}getLayoutMax(){const t=y(this._op.layoutMax,Ui.LAYOUT_MAX);return t>0?t:Ui.LAYOUT_MAX}_doApply(t){super._doApply(t),e.call(t,"children")&&(this._series=[],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._legended=null,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=!at.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()}_connect(t){this._xAxisObj=t._connectSeries(this,!0),this._yAxisObj=t._connectSeries(this,!1)}_doPrepareRender(t){this._visibles.length>0&&(this._visibles.forEach((e=>e._connect(t))),this._visibles.forEach((t=>t._prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_setIndex(t){this._index=t}_doPrepareSeries(t){}$_loadSeries(t,e){const r=this._seriesType();i(e)?e.forEach(((e,s)=>this.$_add(Ti._loadSeries(t,this._series.length,e,r)))):s(e)&&this.$_add(Ti._loadSeries(t,this._series.length,e,r))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t);if(isNaN(s))for(const t of i.values()){t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)t[e].yGroup=t[e-1].yGroup+(t[e].yValue||0);e.push(t[t.length-1].yGroup)}else for(const t of i.values()){let i=t[0].yValue||0,r=i>=s?0:-1,n=i<s?0:-1;t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)i=t[e].yValue||0,i>=s?(r>=0&&(t[e].yGroup=t[r].yGroup+i*(i<0?-1:1)),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i*(i>=0?-1:1)),n=e);r>=0&&e.push(t[r].yGroup),n>=0&&e.push(t[n].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.getLayoutMax(),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)e.yValue=(e.yValue||0)/s*i,r=e.yGroup=e.yValue+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(f(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)}}}}Ui.LAYOUT_MAX=100,Ui.defaults=Ee(Oe.defaults,{layout:"default",layoutMax:Ui.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}:<b> ${yValue}</b>"});class Zi extends Ui{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class qi extends Ui{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}}qi.defaults=Ee(Ui.defaults,{groupWidth:1,groupPadding:.1});class Ki extends Oi{isMarker(){return!0}isXY(){return!0}}Ki.defaults=Ee(Ti.defaults,{colorByPoint:!1});class Qi extends Oe{}class Ji extends Oe{}const tr={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},er={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},sr={minPadding:0,maxPadding:0};class ir extends Oe{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){const e=this.chart;t.handle=(this._handle=new Qi(e)).init(),t.mask=(this._mask=new Ji(e)).init(),t.borderLine=(this._borderLine=new Oe(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return y(this._op.thickness,ir.defaults.thickness)}getGap(){return y(this._op.gap,ir.defaults.gap)}getGapFar(){return y(this._op.gapFar,ir.defaults.gapFar)}getSize(){return this.getThickness()+this.getGap()+this.getGapFar()}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const i={};if(s(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),i.series=l({},e.series,tr[t]())}else i.series=tr.area();s(e.xAxis)?i.xAxis=l({},e.xAxis,(er[e.xAxis.type]||er.linear)(),sr):i.xAxis=l({},sr),s(e.yAxis)?i.yAxis=l({},e.yAxis,(er[e.yAxis.type]||er.linear)(),sr):i.yAxis=l(er.linear(),sr),this._chartConfig=i,this._axisType=i.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}ir.defaults=Ee(Oe.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class rr extends Oe{_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}rr.defaults=Ee(Oe.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class nr extends rr{}nr.defaults=Ee(rr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class or extends Oe{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=!!r.axis;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]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(i.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=b(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this._op.noClip;return!!h(t)&&t}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followPointer())}getHeaderHeight(){const t=this._op;return t.simpleMode?0:m(y(t.headerHeight,0),0)}getTailSize(){return this._op.simpleMode?0:m(y(this._op.tailSize,0),0)}getBorderRadius(){return this._op.simpleMode?0:m(y(this._op.borderRadius,0),0)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?xt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Rt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}or.defaults=Ee(Oe.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",headerHeight:7,tailSize:10,borderRadius:5,simpleMode:!1,noClip:!1});const ar="vline",hr="hline",lr="line";class _r extends ze{_isVisible(){return this._op.visible&&!z(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}_r.type="image";class cr extends ze{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||cr.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}cr.type="shape",cr.defaults=Ee(ze.defaults,{width:64,height:64,shape:"square"});class dr extends ze{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?xt.getFormatter(s):L),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Rt.getFormatter(t):L)}(t.timeFormat)}}dr.type="text",dr.defaults=Ee(ze.defaults,{text:"Text"});class ur extends Ke{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 pr extends ss{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,s,i,n){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:n});isNaN(r)||(e=r)}return e>0?e:void 0}buildSteps(t,e,s,n,o,a=!1){const h=this._op,l={chart:this.chart.wrapper,length:e,minValue:t._calcedMin,maxValue:t._calcedMax,min:n,max:o},_=this.$_getStepPixels(e,l);let c,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,c=a?this._getStepsByPixels(e,y(.85*_,60),s,n,o,l):i(h.steps)||r(h.steps)||r(h.stepCallback)?this._getStepsBySteps(n,o,l):this._baseAxis instanceof xr&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,s,n,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,s,n,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,n,o))?this._getStepsByInterval(d,s,n,o):_>0?this._getStepsByPixels(e,_,s,n,o,l):n!==o?[n,o]:[n],c}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?m(8,c(t/(.9*e))+1):y(this._op.maxCount,1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){let s;if(super._doApply(t),this._stepPixels=!r(t.stepPixels)&&at.parseTuples(t.stepPixels),e.call(t,"stepMultiples"))if(r(t.stepMultiples))s=t.stepMultiples;else{let e;if(i(t.stepMultiples)){let s=Number.MIN_SAFE_INTEGER;e=[],t.stepMultiples.forEach((t=>{!isNaN(+t)&&t>s&&e.push(+t)}))}s=e&&e.length>0?e:void 0,s&&(s=s.filter((t=>t>=1)),s.length>0?s.sort(((t,e)=>t-e)):s=void 0)}this._userMultiples=s}$_getStepPixels(t,e){let s=this._stepPixels;if(r(s)&&(s=s.call(void 0,e)),!s){const t=this.axis;s=t._isPolar?pr.STEP_PIXELS_P:t._isX?pr.STEP_PIXELS_X:pr.STEP_PIXELS_Y}for(let e=0;e<s.length;e++)if(t<=s[e][0])return m(1,s[e][1])}_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 xr&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>_(t/e)*e?t=_(t/e)*e:t<c(t/e)*e&&(t=c(t/e)*e),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&&_(t*o/a)==t*o/a?this._step=a:a=this._step=c(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this._normalizeMin(s,h);else{for(!function(t,e){if(!t)throw new Q(e)}(s<e&&i>e,"base error"),t=m(3,t);;){if(!(c((e-s)/a)+c((i-e)/a)+1>t))break;a+=h}s=e-c((e-s)/a)*a}else s=n._fixedMin;l.push(R(s));for(let e=1;e<t;e++)l.push(R(l[e-1]+a));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=R(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=R(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=R(n-t));for(n=e;n<i;)r.push(n=R(n+t))}return this._step=t,r}_getStepMultiples(t,e){var s;return(null!==(s=r(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==s?s:this._op.fineStep)?pr.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?pr.STEP_MULTIPLES[0]:pr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,s){const n=this._op,o=r(n.steps)?n.steps:n.stepCallback;let a;return o?(a=o.call(void 0,s),i(a)&&!a.every((t=>!isNaN(+t)))||(a=t!==e?[t,e]:[t])):a=n.steps.filter((t=>isFinite(+t))).map((t=>+t)),a=a.filter(n.clipSteps?s=>s>=t&&s<=e:t=>isFinite(t)),a.sort(((t,e)=>t-e)),a.length>0&&!isFinite(+a[0])&&(a[0]=t),a.length>1&&!isFinite(+a[a.length-1])&&(a[a.length-1]=e),this._userTicks=this._strictEnds=!0,a}_getStepsByPixels(t,e,s,i,r,n){i>=s?i=s:r<=s&&(r=s);const o=r-i;if(0===o||t<=0)return isNaN(i)?[]:[i];const a=this.getMaxCount(t,e);let h=m(1,_(t/e))+1,l=o/(h-1);const d=function(t){return Math.pow(10,t)}(_(p(l))),u=this._getStepMultiples(d,n),g=[];let f,y=0;if(l/=d,u)if(l>u[y]){for(;y<u.length-1;y++)if(l>u[y]&&l<u[y+1]){l=l<=u[y]+(u[y+1]-u[y])/2?u[y]:u[y+1];break}}else l=u[y];for(;;){for(l*=d,(l<=0||!isFinite(l))&&(l=o/h),i=isNaN(s)?this._normalizeMin(i,l):s-c((s-i)/l)*l,this._step=l,g.push(R(f=i));f<r;)g.push(R(f+=l));if(!u||y>u.length-2||g.length<=a)break;l=u[++y],g.length=0}return g}}pr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],pr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],pr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],pr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],pr.defaults=Ee(ss.defaults,{baseRange:!1,enableDecimals:!0});class gr extends is{}gr.defaults=Ee(is.defaults,{numberFormat:"0.##"});class mr extends gr{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}mr.defaults=Ee(gr.defaults,{useSymbols:!0});class fr extends Ye{getSize(t){return Math.min(.9*t,W(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=y(this._op.space,0),this._sizeDim=X(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}fr.defaults=Ee(Ye.defaults,{size:"30%",space:16,gridVisible:!0});class yr extends We{_isVisible(){return this._op.visible}}yr.defaults=Ee(We.defaults,{visible:!1});class xr extends as{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new yr(this)).init()}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get grid(){return this._grid}getBaseValue(){return this._baseVal}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)}}$_getPadding(t,e,s){if(!t){if(this._isX&&this._isPolar)return 0;t=xr.PADDINGS}for(let i=0;i<t.length;i++)if(e<=t[i][0])return t[i][1]*s;return 0}_doApply(t){var s,i;super._doApply(t);const r=null!==(s=t.minPadding)&&void 0!==s?s:t.padding,o=null!==(i=t.maxPadding)&&void 0!==i?i:t.padding;let a;this._minPadPixels=NaN,n(r)&&r.endsWith("px")&&(a=parseFloat(r),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,n(o)&&o.endsWith("px")&&(a=parseFloat(o),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=at.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=at.parseTuples(o)),this._baseVal=+this._op.baseValue,this._strictMin=X(t.strictMin,!0),this._strictMax=X(t.strictMax,!0),e.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new ur(this)}_createTickModel(){return new pr(this)}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=y(this._runBase,this._min);isNaN(this._fixedMax)&&isNaN(this._maxPadPixels)&&this._calcedMax>e&&t[t.length-2]>this._calcedMax&&t[t.length-2]-this._calcedMax>.5*(t[t.length-2]-t[t.length-3])&&(t.pop(),this._setMinMax(this._min,t[t.length-1])),e=y(this._runBase,this._max),isNaN(this._fixedMin)&&isNaN(this._minPadPixels)&&this._calcedMin>e&&t[1]<this._calcedMin&&t[1]-this._calcedMin<.5*(t[1]-t[2])&&(t.shift(),this._setMinMax(t[0],this._max))}$_trimSteps(t,e,s){this._runBreaks?(this._lastSect=this._sects[this._sects.length-1],t.length>3&&t[t.length-3]>this._lastSect.from&&(this.$_trim(t),this._lastSect.to=t[t.length-1])):!this.tick._userTicks&&t.length>2&&this.$_trim(t)}_doBuildTicks(t,e,s,i){if(isNaN(t)||isNaN(e))return[];if(i>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,s,i),this.$_createTicks(t,s,this._min,this._max,i)}const r=this._tick,n=r._baseAxis instanceof xr&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let a,h,{min:l,max:_}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(l=r._baseAxis.axisMin(),_=r._baseAxis.axisMax()),this._mergedBreaks){this._runBreaks=this._mergedBreaks.slice(0);for(let t=this._runBreaks.length-1;t>=0;t--){const e=this._runBreaks[t];(isNaN(e.options.from)||isNaN(e.options.to)||e.options.from<=l||e.options.to>=_)&&this._runBreaks.splice(t,1)}this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;if(l===_)a=[l];else if(this._runBreaks)a=this.$_calcBrokenSteps(this._runBreaks,s,l,_),l=Math.min(l,a[0]),_=Math.max(_,a[a.length-1]);else if(a=r.buildSteps(this,s,this._runBase,l,_,!1),h=a.slice(0),a.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;a.length>1&&a[0]<l;)a.shift();a.length<2&&this._fixedMin<a[0]&&a.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;a.length>2&&a[1]<=l;)a.shift();if(!isNaN(r._step))for(;a[0]>l;)a.unshift(r.getNextStep(a[0],-1))}if(l=Math.min(l,a[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;a.length>1&&_<a[a.length-1];)a.pop();a.length<2&&this._fixedMax>a[a.length-1]&&a.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;a.length>2&&a[a.length-2]>=_;)a.pop();if(!isNaN(r._step))for(;a[a.length-1]<_;)a.push(r.getNextStep(a[a.length-1],1))}_=Math.max(_,a[a.length-1])}else a.push(l+(_-l)/2);this._prevSteps=a,this._setMinMax(l,_);const c=this.$_createTicks(a,s,l,_,i);if(this._isX)if(l===_)this._unitLen=s/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s);if(e){if(this._unitLen=e.len,!this._zoom||t){const s=h;let i=!1;if(t?isNaN(this._fixedMax)&&(_=this._max=Math.max(this._calcedMax+e.min,_)):(l=this._min=Math.min(this._calcedMin-e.min/2,l),_=this._max=Math.max(this._calcedMax+e.min/2,_)),c.length>1){let e,r;if(s[0]<l){for(r=-1;r<a.length-1&&s[r+1]<a[0];)r++;for(;r>=0&&(e=s[r])>=l;){const t=this.dataToAxis(c[0].value),s=this.dataToAxis(c[1].value);if(e<t&&t-e>=s-t){const t=this._createTick(0,e);c.unshift(t),a.unshift(e),i=!0}r--}}if(s[s.length-1]>_){for(r=s.length;r>0&&s[r-1]>a[a.length-1];)r--;for(;r<s.length&&(e=s[r])<=_;){const t=this.dataToAxis(c[c.length-1].value),s=this.dataToAxis(c[c.length-2].value);if(e>=t&&e-t>=t-s){const t=this._createTick(0,e);c.push(t),a.push(e),i=!0}r++}}else if(t&&_>s[s.length-1])for(;(e=a[a.length-1])<_;){const t=this.dataToAxis(c[c.length-1].value),s=this.dataToAxis(c[c.length-2].value);if(!(R(_-t)>R(t-s)))break;{const r=this._createTick(0,e+R(t-s));c.push(r),a.push(r.value),i=!0}}i&&c.forEach(((t,e)=>t.index=e))}}}else this._unitLen=1}return c}$_createTicks(t,e,s,i,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const s=this._createTick(e,t[e]);s.value!==o&&(n.push(s),o=s.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}_calcPoints(t,e){super._calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,s,i){let r=0,n=s;const o=[n],a=this._sects=[],h=e-t.reduce(((t,e)=>t+e.options.space),0);t.forEach((t=>{const e=t.options,s=t.getSize(h),i=Math.max(0,e.space||0),l={from:n,to:t.options.from,pos:r,len:s};r+=s,a.push(l,t._sect={from:e.from,to:e.to,pos:r,len:i}),r+=i;this.$_buildBrokenSteps(l).forEach((t=>{t>l.from&&t<=l.to&&o.push(t)})),i>0&&o.push(e.to)}));const l=t[t.length-1];if(i>l.options.to){const t={from:l.options.to,to:i,pos:r,len:e-r};a.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&o.push(e)}))}return this._lastSect=a[a.length-1],this._lastSect.to=o[o.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?D(t-i-s.pos):D(i+s.pos)}{let s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);return this._op.reversed&&(s=t-s,isNaN(this._prevRate)||(s+=this._prevSize-t)),D(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)}_isLog(){return!1}$_getStartFit(){return"default"===this._op.startFit?this._isX&&!this._isPolar?"value":"tick":this._op.startFit}$_getEndFit(){return"default"===this._op.endFit?this._isX&&!this._isPolar?"value":"tick":this._op.endFit}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-W(t,s):e+W(t,s)}_adjustMinMax(t,e,s){const i=this._isLog();let r,n=this.isZoomed(),o=this.isZoomed(),a=!0,h=!0,l=NaN,c=NaN,d=1;if(this._series.length>0){let t,_=0;this._series.forEach((t=>{isNaN(t._sBase=t.getBaseValue(this))||_++,d=m(d,t.getAxisPadRate())})),!this._isX&&_>0&&_<this._series.length&&(r={},this._series.forEach((t=>{const e=t._type();r[e]?r[e]=[g(t._yMin,r[e][0]),m(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]}))),this._series.forEach((r=>{let _=r._sBase;isNaN(_)||(_=R(_),i?_>=0&&_<=e&&_<=s&&(e=t=_):_<=e?r.isBased(this)?e=t=_:l=y(g(l,_),_):_>=s&&(r.isBased(this)?s=t=_:c=y(m(c,_),_))),a&&!n&&(i||r.canMinPadding(this,e,t))&&(a=!1),h&&!o&&(i||r.canMaxPadding(this,s,t))&&(h=!1)}))}else a=n,h=o;n||(n=a),o||(o=h),this._fixedMin=this._fixedMax=NaN;const u=m(0,s-e),p=this.$_calcStrict(this._strictMin,e,-u),f=this.$_calcStrict(this._strictMax,s,u);let x=NaN,b=NaN,w=0,v=0;isNaN(p)?n?this._fixedMin=e:isNaN(this._minPadPixels)?w=this.$_getPadding(this._minPaddings,t,d):x=this._minPadPixels:this._fixedMin=e=p,isNaN(f)?o?this._fixedMax=s:isNaN(this._maxPadPixels)?v=this.$_getPadding(this._maxPaddings,t,d):b=this._maxPadPixels:this._fixedMax=s=f;let S=e,V=s;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*w;e<S&&(S=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*v;e>V&&(V=e)}}else S-=u*w,V+=u*v;if(!isNaN(x)||!isNaN(b)){isNaN(x)&&(x=0),isNaN(b)&&(b=0);const e=Math.min(x+b,.9*t),s=u-_(u*(t-e)/t),i=Math.round(s*x/e);S-=i,V+=s-i}return!isNaN(l)&&l<=e&&S<l&&(S=this._fixedMin=l),!isNaN(c)&&c>=s&&V>c&&(V=this._fixedMax=c),{min:S,max:V}}$_calcXUnitLength(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&&!t.isXY()&&e.push(...t._getVisiblePoints())})),e.length>0){const s=e.map((t=>t.xValue)).sort(((t,e)=>t-e));for(let t=s.length-1;t>0;t--)s[t]===s[t-1]&&s.splice(t,1);return this._calcUnitLen(s,t,this._min,this._max)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/Math.max(8,this._ticks.length);return{len:y(e*=t/(i-s+t),4),min:t}}return{len:e,min:0}}{let r=e,n=t[1]-t[0];for(let e=2;e<t.length;e++)n=g(n,t[e]-t[e-1]);return r*=n/(i-s+n),{len:y(r,1),min:n}}}$_loadBreak(t){if(s(t)&&"from"in t&&"to"in t){const e=new fr(this);return e.init(),e._load(t),t.from>0?e:null}}$_loadBreaks(t){if(i(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._breaksChanged=!0,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.visible&&t.options.to>t.options.from));if(this._mergedBreaks=null,e.length>0){const i=this._mergedBreaks=[];i.push(l(new fr(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(l(new fr(this)._initObject(),o))}}var s}}xr.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],xr.defaults=Ee(as.defaults,{baseValue:0,nullable:!0,startFit:"default",endFit:"default"});class br extends xr{get label(){return this._label}_createLabel(){return new mr(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof Ui&&"fill"===r[0].options.layout&&(i.max=r[0].getLayoutMax()),i}}br.type="linear";const wr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],vr=[[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]],Sr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Vr extends pr{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}_getValidInterval(t,e,s,i,o){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:o});null!=r&&(e=r)}if(!isNaN(e))return+e>0?+e:NaN;if(n(e)&&Sr.hasOwnProperty(e.charAt(e.length-1))){const t=parseFloat(e);return t<=-1||t>=1?e:NaN}}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=wr[e]/2&&t<wr[e+1]/2)return this._scale=e,vr[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/e)+1,_=m(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),d=wr[this._scale];if(_/=d,c)if(_>c[0]){let t=0;for(;t<c.length-1;t++)if(_>c[t]&&_<c[t+1]){_=c[t+1];break}}else _=c[0];const u=a.date(i),p=a.date(r);let g,f=u;if(7===this._scale){const t=h.getFullYear();let e=f.getFullYear();this._step=_=Math.ceil(_),f=new Date(e,0),e<t&&e+_>t&&(e=t,f=new Date(e,0));do{n.push(+f),e+=_,f=new Date(e,0)}while(f<=p)}else if(6===this._scale){let t=f.getFullYear(),e=f.getMonth();this._step=_=Math.ceil(_),f=new Date(t,e),f<h&&new Date(t,e+_)>h&&(e=h.getMonth(),f=new Date(h.getFullYear(),e));do{n.push(+f),f.setMonth(f.getMonth()+_)}while(f<=p)}else if(4===this._scale||5===this._scale){let t=f.getFullYear(),e=f.getMonth(),s=f.getDate();const i=5===this._scale?7:1;this._step=_=Math.ceil(_),f=new Date(t,e,s),f<h&&new Date(t,e,s+i*_)>h&&(s=h.getDate(),f=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+f),f.setDate(f.getDate()+_*i)}while(f<=p)}else{switch(this._step=_,_*=d,this._scale){case 3:f.setMinutes(0);case 2:f.setSeconds(0);case 1:f.setMilliseconds(0)}g=f.getTime();const t=h.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,s,i){if(n(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=Sr[a],t=wr[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 Ar=[{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 Pr extends gr{_doApply(t){super._doApply(t);const e=n(t.timeFormat)?t.timeFormat:void 0,r=n(t.beginningFormat)?t.beginningFormat:void 0,a=t.timeFormats,h=t.useBeginningFormat;if(this._formats=Ar.map((t=>l(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&r&&this._formats.forEach((t=>{t.beginningFormat=r})),i(a))for(let t=0;t<a.length;t++){const e=this._formats[t],i=a[t];o(i)?e.format=i:s(i)&&(o(i.format)&&(e.format=i.format),h&&o(i.beginningFormat)&&(e.beginningFormat=i.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);if(this._formatter)return this._formatter.toStr(r,s.startOfWeek);const n=this._formats,o=i.tick._scale,a=Rt.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)}}}Pr.defaults=Ee(gr.defaults,{useBeginningFormat:!0});class Cr extends xr{get label(){return this._label}_createTickModel(){return new Vr(this)}_createLabel(){return new Pr(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}collectValues(){this._offset=60*y(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return a(t)?t:t instanceof this._dateClass?t.getTime():n(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(n(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}}Cr.type="time",Cr.subtype="date",Cr.defaults=Ee(xr.defaults,{baseValue:NaN});class kr extends pi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Lr extends Wi{pointLabelCount(){return 2}_createLegendMarker(t,e){return zs.create(t,Ti.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new kr(t)}_getBottomValue(t){return t.lowValue}}Lr.type="barrange",Lr.defaults=Ee(Wi.defaults,{tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Nr extends ci{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Mr extends Xi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Nr(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Mr.defaults=Ee(Xi.defaults,{colorByPoint:!1,pointOffset:0});class Er extends Mr{canDepth(){return!0}_createLegendMarker(t,e){return zs.create(t,Ti.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Er.type="bar";class Tr extends qi{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}getDepth(){return this._op.depth}getDistance(){return this._op.distance}_doApply(t){super._doApply(t),this._op.distance=y(t.distance,0)}_doPrepareSeries(t){const e=this._op.layout;if("default"===e){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}))}if("overlap"===e){let e=this.getDistance();t.forEach((t=>{t._groupDistance=e+=y(t.options.distance,0),e+=t.depth}))}else t.forEach((t=>{t._groupDistance=t.distance}))}}Tr.defaults=Ee(qi.defaults,{depth:10,distance:5});class Br extends Tr{_canContain(t){return t instanceof Er}}Br.type="bargroup",Br.seriesType="bar";class Or extends Jt{constructor(t){super(t,Ti.LEGEND_MARKER),this.add(this._back=new zs(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new ne(t))}render(t,e){const s=Math.max(8,2*e),i=2.1*s;t===this._shape&&e===this._rd&&s===this._size||(this._shape=t,this._rd=e,this._size=s,this._back.resize(1,s),this._renderShape(e,i,s),this._marker.trans(i/2-e,s/2-e))}_renderShape(t,e,s){Is.setShape(this._marker,this._shape,t,t)}}class Rr extends Or{constructor(t){super(t),this.insertFirst(this._line=new ne(t)),this.insertFirst(this._area=new ne(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,s/2,"L",e,0],r=["M",0,s/2,"L",e,0,"L",e,s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,s)}}class Dr extends Or{constructor(t){super(t),this.insertFirst(this._line=new ne(t)),this._line.setFill("none"),this.insertFirst(this._line2=new ne(t)),this._line2.setFill("none"),this.insertFirst(this._area=new ne(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s],r=["M",0,s,"L",e/2,.7*s,"L",e,s],n=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s,"L",e,s,"L",e/2,.7*s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,s)}}class $r extends ne{constructor(t,e=L,s=L){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){at.isNumber(t)?this.setPath(Is.line(t,e,s,i)):t&&this.setPath(Is.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Is.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(Is.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Is.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(Is.line(e,t,s,t))}}class Fr extends Or{constructor(t){super(t),this.insertFirst(this._line=new $r(t))}_renderShape(t,e,s){this._line&&(this._line.setHLine(s/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,s)}}class Ir extends ci{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class zr extends Ri{}zr.defaults=Ee(Ri.defaults,{radius:4,hoverScale:1.75});class Hr extends Ci{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Hr.ALIGN_GAP:0:t}getPosition(){return b(this._op.position,"default")}}Hr.ALIGN_GAP=4,Hr.defaults=Ee(Ci.defaults,{align:"center"});class Gr extends Oi{_doInit(t){super._doInit(t),t.marker=(this._marker=new zr(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return y(t.radius,this.marker.options.radius)}buildLines(t){return this._lines||(this._lines=this._doBuildLines(t)),this._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new Hr(t)}_createPoint(t){return new Ir(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Fr(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),g(e/2,this.marker.options.radius)),s}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_connectNulls(){return!1}_doBuildLines(t){const e=t.length,s=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls())s.push(t.slice());else{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)}}return s}}Gr.defaults=Ee(Ti.defaults,{nullAsBase:!1});class jr extends $e{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}jr.defaults=Ee($e.defaults,{visible:!1,offset:8});class Xr extends Gr{_doInit(t){super._doInit(t),t.flag=(this._flag=new jr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isConnectEnds(t,e){if(e){const e=this._op.connectEnds;if(h(e))return e;if(!t||"spline"===this._op.lineType)return!0}return!1}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof Qr||this._group instanceof Jr?this._group.options.lineType:this._op.lineType}_connectNulls(){return this._op.connectNullPoints}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_doPrepareRender(){const t=this._op;super._doPrepareRender(),this._base=w(this._getGroupBase(),this._yAxisObj.getBaseValue(),0),t.nullAsBase&&!isNaN(t.baseValue)&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),this.flag._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Xr.type=Ks,Xr.defaults=Ee(Gr.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Yr extends Xr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Yr.type="spline";class Wr extends Ir{}class Ur extends Xr{_doInit(t){super._doInit(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>1){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=y(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))}))}_createLegendMarker(t,e){return new Rr(t)}_createPoint(t){return new Wr(t)}isBased(t){return t===this._yAxisObj}_doBuildLines(t){if(!this.chart.isPolar()&&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._doBuildLines(t)}}Ur.type=Qs,Ur.defaults=Ee(Gr.defaults,{});class Zr extends Wr{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 l(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[y(s.lowField,0+i)],this.y=e[y(s.yField,1+i)],i>0&&(this.x=e[y(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=b(e[t.options.lowField],e.low),this.y=w(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=S(t.lowValue,this.lowValue,e)}}class qr extends Hr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class Kr extends Gr{pointLabelCount(){return 2}_createLabel(t){return new qr(t)}_createLegendMarker(t,e){return new Dr(t)}_createPoint(t){return new Zr(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)))}_doBuildLines(t){const e=super._doBuildLines(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}}Kr.type="arearange",Kr.defaults=Ee(Gr.defaults,{curved:!1,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class Qr extends Ui{_canContain(t){return t instanceof Xr}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}}Qr.type="linegroup",Qr.seriesType=Ks,Qr.defaults=Ee(Ui.defaults,{lineType:"default"});class Jr extends Ui{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 Ur}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}}Jr.type="areagroup",Jr.seriesType=Qs,Jr.defaults=Ee(Ui.defaults,{lineType:"default"});class tn extends Wr{}class en extends Ur{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new tn(t)}_doLoadData(t){const e=super._doLoadData(t);if(i(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return(this._refer=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 _}}en.type="bellcurve",en.defaults=Ee(Ur.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class sn extends ci{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return l(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.min=e[y(s.minField,0+i)],this.low=e[y(s.lowField,1+i)],this.mid=e[y(s.midField,2+i)],this.high=e[y(s.highField,3+i)],this.y=e[x(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=b(e[s.minField],e.min),this.low=b(e[s.lowField],e.low),this.mid=b(e[s.midField],e.mid),this.high=b(e[s.highField],e.high),this.y=b(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=S(t.minValue,this.minValue,e),this.lowValue=S(t.lowValue,this.lowValue,e),this.midValue=S(t.midValue,this.midValue,e),this.highValue=S(t.highValue,this.highValue,e)}}class rn extends Wi{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new sn(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return zs.create(t,Ti.LEGEND_MARKER,0,0,e,e,2)}}rn.type="boxplot",rn.defaults=Ee(Wi.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 nn extends ui{}class on extends Ki{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(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 nn(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(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=g(t,s.zValue),e=m(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)}}on.type="bubble",on.defaults=Ee(Ki.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>",paddingRate:2});class an extends Zi{_canContain(t){return t instanceof Xr}_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=b(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return at.makeIntArray(0,t.length)}}an.type="bump",an.seriesType=Ks;class hn extends ci{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return l(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.low=e[y(s.lowField,0+i)],this.close=e[y(s.closeField,1+i)],this.open=e[y(s.openField,2+i)],this.y=e[x(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=b(e[s.lowField],e.low),this.open=b(e[s.openField],e.open),this.close=b(e[s.closeField],e.close),this.y=w(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=S(t.lowValue,this.lowValue,e),this.openValue=S(t.openValue,this.openValue,e),this.closeValue=S(t.closeValue,this.closeValue,e)}}class ln extends Wi{canCategorized(){return!0}_createPoint(t){return new hn(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new qt;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new ne(t,Ti.LEGEND_MARKER).setPath(s.end())}}ln.type="candlestick",ln.defaults=Ee(Wi.defaults,{tooltipText:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class _n extends ji{}_n.defaults=Ee(Ci.defaults,{position:"inside"});class cn extends Mr{get pointLabel(){return this._pointLabel}_createLabel(t){return new _n(t)}}cn.type=Js;class dn extends Tr{_canContain(t){return t instanceof cn}}dn.type="circlebargroup",dn.seriesType=Js;class un extends pi{}class pn extends Ri{}pn.defaults=Ee(Ri.defaults,{radius:4,shape:"circle"});class gn extends Wi{_doInit(t){super._doInit(t),t.marker=(this._marker=new pn(this)).init(),t.lowMarker=(this._lowMarker=new pn(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)+m(0,this.marker.options.radius)}_createPoint(t){return new un(t)}prepareAfter(){const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=y(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()}}gn.type="dumbbell";class mn extends ci{}class fn extends Xi{getSegmentSize(t){return W(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new mn(t)}_createLegendMarker(t,e){const s=new qt;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new ne(t,Ti.LEGEND_MARKER).setPath(s.end())}}fn.type="equalizer",fn.defaults=Ee(Xi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class yn extends Wi{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new pi(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new qt).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new ne(t,Ti.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}yn.type="errorbar",yn.defaults=Ee(Wi.defaults,{pointPadding:.3,tooltipText:"<b>${name}</b><br>${series}: <b>${lowValue}</b> ~ <b>${highValue}</b>"});class xn extends Di{}class bn extends xn{constructor(t,e){super(t),this.points=e}}class wn extends Fi{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?wn.ENDED_DIST:wn.OUTSIDE_DIST:this._op.distance||0}}wn.OUTSIDE_DIST=25,wn.ENDED_DIST=10;class vn extends zi{getSize(t,e){return{width:m(.1*t,W(this._widthDim,t)),height:m(.1*e,W(this._heightDim,e))}}getNeckSize(t,e){return{width:at.clamp(W(this._neckWidthDim,t),this._minNeckWidth,t),height:at.clamp(W(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new wn(t)}_createPoint(t){return new xn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new bn(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=Y(e._width,vn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=Y(e._height,vn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=Y(e._neckWidth,vn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=Y(e._neckHeight,vn.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}vn.type="funnel",vn.defaults=Ee(zi.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class Sn extends ci{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return l(super._assignTo(t),{min:this.min,max:this.max})}}const Vn={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 An extends Oi{getBinCount(t){const e=y(this._op.binWidth,0);if(e>0)return t/e;return y(this._op.binsNumber,0)<1?Vn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new Sn(t)}_doLoadPoints(t){function e(t){let e;return e=i(t)?t[y(this.yField,0)]:s(t)?w(t[this.yField],t.y,t.value):t,parseFloat(e)}const r=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)),r.minValue<o[0]&&o.unshift(r.minValue),r.maxValue>o[o.length-1]&&o.push(r.maxValue);const t=o.length,e=o[0],s=o[t-1],i=this.getBinCount(t),a=this._binInterval=(s-e)/i;let h=0,l=e,_=l+a;for(let e=0;e<i;e++){let r=0;if(e==i-1)r=t-h;else for(;h<t&&o[h]<_;)r++,h++;n.push({x:l,y:r,min:l,max:e===i-1?s:_}),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(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return zs.create(t,Ti.LEGEND_MARKER,0,0,e,e,2)}}An.type="histogram",An.defaults=Ee(Ti.defaults,{baseValue:0,binsNumber:"squreRoot"});class Pn extends Ri{}Pn.defaults=Ee(Ri.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class Cn extends ci{_assignTo(t){return l(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const s=+t.options.colorField,i=+t.options.iconField,r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[y(r.xField,0)]),this.y=e[y(r.yField,0+n)],this.radius=e[y(r.radiusField,1+n)],isNaN(s)||(this.color=e[s]),isNaN(i)||(this.icon=e[i])}_readObject(t,e){super._readObject(t,e),this.radius=b(e[t.options.radiusField],e.radius)}}class kn extends Xi{_doInit(t){super._doInit(t),t.marker=(this._marker=new Pn(this)).init()}get marker(){return this._marker}_getFielderProps(){return["xField","yField","zField","colorField","iconField","radiusField"]}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new Cn(t)}prepareAfter(){const t=this.marker.options,e=t.radius,s=t.shape,i=this.options.radiusField,r=m(t.minRadius,0),n=m(t.maxRadius,r);if(i){const t=this._runPoints.map((t=>t.radius)).filter((t=>"number"==typeof t&&!Number.isNaN(t))),e=Math.min(...t),i=Math.max(...t)-e||1;this._runPoints.forEach((t=>{const o=(t.radius-e)/i;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=s}))}else this._runPoints.forEach((t=>{var i;t.radius=null!==(i=t.radius)&&void 0!==i?i:e,t.shape=s}));super.prepareAfter()}}kn.type="lollipop";class Ln extends hn{}class Nn extends ln{_createPoint(t){return new Ln(t)}_createLegendMarker(t,e){const s=new qt;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new ne(t,Ti.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}Nn.type="ohlc";class Mn extends Ir{}class En extends Gr{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Mn(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=this;(function(t){const s=[],i=t.reduce(((t,e)=>t+y(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)}}}En.type="pareto",En.defaults=Ee(Gr.defaults,{curved:!1});class Tn extends Di{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 l(super._assignTo(t),{sliced:this.sliced})}}class Bn extends Tn{constructor(t,e){super(t),this.points=e}}class On extends $e{getDefaultIconPos(){return"left"}}class Rn extends Fi{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?W(this._distanceDim,e,0):t?W(s?Rn.INNER_DIST:Rn.INSIDE_DIST,e):"far"===this._op.align?Rn.ENDED_DIST:Rn.OUTSIDE_DIST}}Rn.INSIDE_DIST=X("30%",!1),Rn.INNER_DIST=X("50%",!1),Rn.OUTSIDE_DIST=25,Rn.ENDED_DIST=10,Rn.defaults=Ee(Fi.defaults,{radius:.7,rotationMode:"arc"});class Dn extends Oe{getLength(){return this.visible?this._op.length:0}_isVisible(){return this._op.visible&&this._op.length>0}_doSetSimple(t){return a(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.length=m(0,y(t.length,0)),t.ratio=m(.3,g(.8,y(t.ratio,Dn.DEPTH_RATIO)))}}Dn.DEPTH_RATIO=.6,Dn.defaults=Ee(Oe.defaults,{visible:!1,length:25,ratio:Dn.DEPTH_RATIO});class $n extends Hi{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new On(this.chart)).init(),t.depth=(this._depth=new Dn(this.chart)).init()}get innerText(){return this._innerText}get depth(){return this._depth}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?W(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new Rn(t)}_createPoint(t){return new Tn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Bn(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset"),t.totalAngle<=0&&(t.totalAngle=360)}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=E+T*y(this._op.startAngle%360,0),this._totalRad=T*m(0,g(360,y(this._op.totalAngle,360))),this._groupPos=NaN}}$n.type="pie",$n.defaults=Ee(Hi.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class Fn extends Ui{getPolarSize(t,e){return W(this._polarDim,g(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=X(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=X(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof $n}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+y(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=y(t.options.groupSize,1)/e}))}}Fn.type="piegroup",Fn.seriesType="pie",Fn.defaults=Ee(Ui.defaults,{polarSize:"80%",innerSize:0});class In extends ci{}class zn extends Ki{_createPoint(t){return new In(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}_createLegendMarker(t,e){return new Or(t)}_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.render(this.getShape(null),g(e/2,this._op.radius)),s}}zn.type="scatter",zn.defaults=Ee(Ki.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Hn extends ci{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 Gn extends Ci{}Gn.defaults=Ee(Ci.defaults,{offset:0});class jn extends Yi{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Gn(t)}_createPoint(t){return new Hn(t)}_createLegendMarker(t,e){return zs.create(t,Ti.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}}jn.type="waterfall",jn.defaults=Ee(Yi.defaults,{tooltipText:"<b>${name}</b><br>${series}:<b> ${y}</b>"});class Xn extends pr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,s,i,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,s,i,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,s,i,r){const n=this._log,o=this._pow,a=this._snap;i>=s?i=s:r<=s&&(r=s);const h=r-i;if(0===h||t<=0)return isNaN(i)?[]:[i];let l=[],d=m(1,_(t/e))+1;if(r-i>=.5){if(0===h)return isNaN(i)?[]:[i];let t=h/(d-1);const e=o(Math.floor(n(t))),_=this._getStepMultiples(e);if(t/=e,_&&_.length>0)if(t>_[0]){for(let e=0;e<_.length-1;e++)if(t>_[e]&&t<_[e+1]){t=t<=_[e]+(_[e+1]-_[e])/2?_[e]:_[e+1];break}}else t=_[0];t*=e,(t<=0||!isFinite(t))&&(t=h/d),i=isNaN(s)?this._normalizeMin(i,t):s-c((s-i)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-i)>u._roundThreshold,g=.5;let m=i,f=a(m);for(l.push(f);f<r;)m+=t,f=a(p?Math.round(m):m),f>l[l.length-1]&&(f<r&&(1==l.length&&f-l[l.length-1]<t||l.length>1&&f-l[l.length-1]<(l[l.length-1]-l[l.length-2])*g)&&l.pop(),l.push(f))}else{i=o(i);const t=(r=o(r))-i;let e=t/(d-1);const s=o(_(n(e))),a=this._getStepMultiples(s);if(e/=s,a&&a.length>0){let t=a[0];for(let s=0;s<a.length-1;s++)if(e>a[s]&&e<a[s+1]){t=e<=a[s]+(a[s+1]-a[s])/2?a[s]:a[s+1];break}e=t}e*=s,(e<=0||!isFinite(e))&&(e=t/d);const h=1e-10*e;let c=_(i/e)*e;for(c<i&&(c+=e),l.push(n(c));c<=r+h;)c+=e,c>0&&l.push(n(c))}return l}}Xn.defaults=Ee(pr.defaults,{arrangeDecimals:!0});class Yn extends xr{_isLog(){return!0}_createLabel(){return new mr(this)}_createTickModel(){return new Xn(this)}_doApply(t){super._doApply(t);const e=this._logBase=m(2,y(t.logBase,10));this._roundThreshold=y(t.roundThrrehold,500),this._log=this.$_createLog(e),this._pow=this.$_createPow(e),this._snap=this.$_createSnap(e,this._log)}$_createLog(t){return 10===t?Math.log10:e=>Math.log10(e)/Math.log10(t)}$_createPow(t){return e=>Math.pow(t,e)}$_createSnap(t,e){return s=>{const i=_(s);return s===i?s:i+e((s-i)*t)}}dataToAxis(t){return this._log(t)}axisToData(t){return this._pow(t)}getXStart(){return 1}valueMin(){return this._pow(this._min)}valueMax(){return this._pow(this._max)}getPos(t,e){return e=e>0?this._log(e):-1,super.getPos(t,e)}_checkValues(t){return t.filter((t=>t>0))}_doCalculateRange(t){const e=super._doCalculateRange(this._values);return e.min=this._log(e.min),e.max=this._log(e.max),e}_createTick(t,e){return super._createTick(t,R(this._pow(e)))}_calcUnitLen(t,e,s,i){if(t.length<2)return super._calcUnitLen(t,e,s,i);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=g(n,r(t[e])-r(t[e-1]));const o=i-s,a=n/o;return{len:y(e*=a,1),min:o*a}}}Yn.type="log",Yn.defaults=Ee(xr.defaults,{logBase:10,roundThrrehold:500});class Wn extends Oe{isChartScope(){return"chart"===this.options.scope}getHoverEffect(){const t=this.options;return"auto"===t.hoverEffect?t.hoverImageUrl?"image":"background":t.hoverEffect}click(){if(this._op.onClick){const t={chart:this.chart.wrapper,button:this};this._op.onClick(t)}}}Wn.defaults=Ee(Oe.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class Un extends Re{load(t){const e=this.chart,s=this._items=[];i(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t))})):t&&s.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map((t=>t.options))}$_loadItem(t,e){const s=new Wn(t);return s.init(),s._load(e),s}}const Zn="$ctrl";class qn extends Oe{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}qn.defaults=Ee(Oe.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class Kn extends Oe{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==b(this._op.scope,"auto")?this._op.scope:this.chart.chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}Kn.defaults=Ee(Oe.defaults,{scope:"auto"});class Qn extends Oe{_doInit(t){t.pointHovering=(this._pointHovering=new Kn(this.chart)).init()}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this._op.xStart)&&void 0!==e?e:t.getXStart()}}var Jn;Qn.defaults=Ee(Oe.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0,resizeDelay:50}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right"}(Jn||(Jn={}));class to extends _t{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new ut,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Ne,(this._chartOptions=new Qn(this)).init(),(this._title=new rr(this)).init(),(this._subtitle=new nr(this)).init(),(this._legend=new Rs(this)).init(),(this._credits=new qn(this)).init(),(this._tooltip=new or(this)).init(),this._buttons=new Un(this),to.split_class&&(this._split=new to.split_class(this)).init(),(this._body=new Ts(this)).init(),(this._navigator=new ir(this)).init(),(this._exporter=new Bs(this)).init(),this._series=new Bi(this),this._xAxes=new hs(this,!0),this._yAxes=new hs(this,!1),this._gauges=new ms(this),this._annotations=new He(this),s(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},to.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[Zn]).win()}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new to(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}getAxisOf(t,e){return this._splitted?this._split.getAxisOf(t,e):e?this.xAxis:this.yAxis}isValidAxis(t){return t&&(!this._splitted||this._split.isValidAxis(t))}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter((t=>t.needAxes()))}getTooltipText(t,e){return Ui.collectTooltipText(this.axis.options,this.series,t,e)}getTooltipParam(t,e,s){return Ui.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?e._group:e;default:return e}}get chart(){return this}anchorByName(t){const e=this.gaugeByName(t);return e instanceof ds?e:this._annotations.get(t)}get wrapper(){return this._wrapper}get type(){return this._op.type}get gaugeType(){return this._op.gaugeType}get polar(){return this._op.polar}get inverted(){return this._op.inverted}get timeOffset(){return this._op.chart.timeOffset}get startOfWeek(){return this._op.chart.startOfWeek}get seriesCount(){return this._series.count}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}canOverflowRender(){return!1}_needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getAnnotations(){return this._annotations}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._splitted?this._annotations.getVisibles().filter((t=>isNaN(t.row)||isNaN(t.col))):this._annotations.getVisibles()}_getButtons(){return this._buttons}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))}_getXAxesAt(t,e){return this._splitted?this._xAxes._internalItems().filter((s=>s.col===t&&(!e||s.checkVisible()))):this._xAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter((s=>s.row===t&&(!e||s.checkVisible()))):this._yAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getXAxesAtPane(t,e,s){return this._splitted?this._xAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._xAxes._internalItems().filter((t=>!s||t.checkVisible()))}_getYAxesAtPane(t,e,s){return this._splitted?this._yAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._yAxes._internalItems().filter((t=>!s||t.checkVisible()))}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.getBodyAnnotation(t):this._body.getAnnotation(t))}axisByName(t){return this._xAxes.get(t)||this._yAxes.get(t)}containsAxis(t){return this._xAxes.contains(t)||this._yAxes.contains(t)}getXAxis(t){return this._xAxes.get(t)}getYAxis(t){return this._yAxes.get(t)}getAxes(t,e){const s=this._xAxes.items(),i=this._yAxes.items();let r;if(this.isInverted())switch(t){case Jn.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case Jn.RIGHT:r=s.filter((t=>t._isOpposite));break;case Jn.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case Jn.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case Jn.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case Jn.RIGHT:r=i.filter((t=>t._isOpposite));break;case Jn.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case Jn.TOP:r=s.filter((t=>t._isOpposite))}return r?e?r.filter((t=>t.checkVisible())):r:[]}_setProperties(t,e=!0){const s=this._op;for(const e in to.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&Be(n={},r.base),s(r[i])&&(n||(n={}),Be(n,r[i])),n?Be(n,t):t}_load(t){var e,i;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(b(t.asset,t.assets)),r.options=r.chart=this._chartOptions._load(b(t.chart,t.options)),s(t.chart)?this._credits._load(t.chart.credits):s(t.options)&&this._credits._load(t.options.credits),r.title=this._title._load(t.title),r.subtitle=this._subtitle._load(t.subtitle),r.legend=this._legend._load(t.legend),r.credits=this._credits._load(t.credits),this._buttons.load(b(t.button,t.buttons)),r.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series),null===(e=this._gauges)||void 0===e||e.load(b(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(w(t.xAxis,t.xAxes,{})),this._yAxes.load(w(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(i=this._split)||void 0===i||i._load(t.split),this._annotations.load(b(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(t.exporting),this}update(t,e){if(s(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Oe||s instanceof Re||s instanceof Ne)&&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;return[e,s].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,this._assets.prepareRender(),e.disconnect(),s.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&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(),this}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t,i),this._yAxes._buildTicks(s?t:e,i),this.$_calcAxesPoints(t,e,s,i)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&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,e);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")}getPaletteColors(t){let e=this._palColors[t];if(!e){const s=document.querySelector(".rct-root");if(s){const i="data-palette",r=s.getAttribute(i);s.setAttribute(i,t);const n=getComputedStyle(s);this._palColors[t]=e=[];for(let t=1;t<=Ei;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());s.setAttribute(i,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(s(t)){const r=this._templates={};for(const e in t){const i=t[e];s(i)&&(r[e]=l({},i))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return Be(Be({},s),t)}else i(e)&&e.forEach((e=>{let s=this._templates[e];return s?Be(Be({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&Ai[t.toLowerCase()]}_getSeriesType(t){return n(t)&&Vi[t.toLowerCase()]}_getAxisType(t){return n(t)&&Xe[t.toLowerCase()]}_getGaugeType(t){return n(t)&&_s[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&cs[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Ie[t.toLowerCase()]}getAxesGap(){return y(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)}}to.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},as.register(yi,br,Yn,Cr),Ti.register(Ur,Kr,Lr,Er,en,rn,on,ln,cn,gn,fn,yn,vn,An,Xr,Yr,kn,Nn,En,$n,zn,jn),Ui.register(Jr,Br,an,dn,Qr,Fn),Ui.registerSeries(Jr,Br,dn,Qr,Fn),ze.register(_r,cr,dr);class eo{constructor(t,e){this._modelCallback=e,this._obj=new to(t,this),this._loaded=s(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[Zn]=null===(t=this[Zn])||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 credits(){return this._obj._credits}get tooltip(){return this._obj._tooltip}get xAxis(){return this._obj.xAxis}get yAxis(){return this._obj.yAxis}get body(){return this._obj._body}get split(){return this._obj._split}get seriesNavigator(){return this._obj._navigator}get exporter(){return this._obj._exporter}getXAxis(t){return this._obj.getXAxis(t)}getYAxis(t){return this._obj.getYAxis(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}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,i){var r;if(s(t)){const s="load chart";at.LOGGING&&console.time(s);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new to(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,at.log("chart-items:",Me),at.LOGGING&&console.timeEnd(s),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[Zn].refresh()}}class so{constructor(t,e){this._obj=new dt(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 io extends lt{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_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.contains(t))return e}find(t){return this._views.find(t)}$_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){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const ro=Object.freeze({x:0,y:0,width:0,height:0}),no=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function oo(t){return{width:t.width,height:t.height}}function ao(t){return t.width<=0||t.height<=0}const ho=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))]))},lo=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},_o=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},co=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},uo=function(t,e){const s=ho(t),i=ho(e),r=lo(s),n=lo(i);for(const t of[...r,...n]){const e=_o(s,t),r=_o(i,t);if(!co(e,r))return!1}return!0},po=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 go{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new go(t,t,t,t):new go(t,t,e,e):new go(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 go(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=y(t.paddingLeft,0),this.right=y(t.paddingRight,0),this.top=y(t.paddingTop,0),this.bottom=y(t.paddingBottom,0),this}applyMargin(t){return this.left=y(t.marginLeft,0),this.right=y(t.marginRight,0),this.top=y(t.marginTop,0),this.bottom=y(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}}}go.Empty=Object.freeze(new go),go.Temp=new go;class mo extends Jt{constructor(t,e=L){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return mo.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}mo.IGNORE_ATTRS={width:"",height:""};class fo extends Jt{constructor(t,e=L){super(t,e,"g"),Jt.DEBUGGING&&(this.add(this._debugRect=new zs(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_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 zs(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 yo extends fo{constructor(t,e,s){super(t,e),this._margins=new go,this._paddings=new go,this.add(this._background=new zs(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}_inflaePaddings(t){const e=this._paddings;return t.width+=e.left+e.right,t.height+=e.top+e.bottom,t}}class xo extends mo{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 bo extends fo{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 wo extends Jt{constructor(t,e,s){super(t,s,"image"),this._bounds=ro,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this.invalidate()},this.dom.onerror=()=>{this.invalidate()},window.SVGGraphicsElement&&!ot||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout((()=>{this.onloadProxy()}),0)})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){this.url=t,this.resize(e,s)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,s=this._bounds.height;e>0&&!s?s=e/t.width*t.height:0==s||e||(e=s/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:s}}return this._bounds}resize(t,e,s){const i=this._proxy;return i&&(z(t)||z(e))&&(t>0&&z(e)?e=t/i.width*i.height:e>0&&z(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class vo extends mo{constructor(t,e=L){super(t),this.add(this._text=new ue(t,e)),this._text.anchor=_e.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.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),i&&this._text.internalSetStyleOrClass(i),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new zs(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 ue(t),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?(this._icon||this.add(this._icon=new wo(t,!1)),this._icon.setImage(s,+e.options.iconWidth,+e.options.iconHeight)):this._icon&&(this._icon.remove(),this._icon=null),this._box=void 0,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=Dt.getContrast(getComputedStyle(this._text.dom).fill);this._outline.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._text,s=this._outline,i=this._icon;let r=0;const n=e.getBBox(),o=n.width,a=n.height;let h=o,l=a,_=0,c=0,d=0,u=0;if(this._box=void 0,i){const t=i.getBBox();switch(r=y(this._model.options.iconGap,0),_=t.width,c=t.height,this._model.getIconPos()){case"left":case"right":h+=r+_,l=Math.max(c,a);break;default:l+=r+c,h=Math.max(_,o)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);d=parseFloat(t.paddingLeft)||0,u=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,h+d+(parseFloat(t.paddingRight)||0),l+u+(parseFloat(t.paddingBottom)||0),t.rx)}if(i)switch(this._model.getIconPos()){case"left":i.trans(d,(l-c)/2),d+=_+r,h-=_+r;break;case"right":i.trans(d+h-_,(l-c)/2),h-=_+r;break;case"top":i.trans((h-_)/2,u),u+=c+r;break;case"bottom":i.trans((h-_)/2,u+a+r)}switch(t){case"center":d+=h/2,e.anchor=_e.MIDDLE;break;case"right":d+=h,e.anchor=_e.END;break;default:e.anchor=_e.START}return e.trans(d,u),s&&(s.anchor=e.anchor,s.setAttr("y",e.getAttr("y")),s.trans(e.tx,e.ty)),this}setOutline(t){this._back&&this._back.remove(),this._outline||(this._outline=new ue(this.doc),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(t._style)}getBBox(){return this._box?this._box:this._box=super.getBBox()}}class So extends Yt{constructor(t,e,s,i,r){super(),this._axis=t,this._prevSize=e,this._prevMin=s,this._prevMax=i,this.start(r)}_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(this._prevSize,t),this._axis.invalidate(),!0}return!1}_doStop(){this._axis.model.setPrevRate(this._prevSize,NaN),this._axis=null}}class Vo extends yo{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new ue(t)),this._richText=new ve}rotatedWidth(){const t=this.model.getRotation()*T,e=this.getBBox();return f(u(t)*e.height)+f(d(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*T,e=this.getBBox();return f(d(t)*e.height)+f(u(t)*e.width)}_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,o=n.writingMode;o&&this._textView.setStyle("writingMode",o),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._richText._isVertical="vertical"===o,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(this._textView,s,i,null,null);const a=oo(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(t){const e=this._textView,s=e.getStyle("writing-mode"),i=s===it||s===rt;t?this.rotation=0:this.setRotation(0,(i?this.width:this.height)/2,this._angle);let r=this._margins.top+this._paddings.top,n=0;switch(this.textAlign()){case"left":e.anchor=_e.START,i||(n-=this.width/2);break;case"right":e.anchor=_e.END,i?r+=this.height:n+=this.width/2;break;default:e.anchor=_e.MIDDLE,i&&(r+=this.height/2)}e.trans(n,r)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}class Ao extends yo{constructor(t){super(t,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new ue(t)),this._textView.anchor=_e.START,this._richText=new ve}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),oo(this._textView.getBBox())}_doLayout(t){const e=this._textView;let s=this._margins.top+this._paddings.top,i=0;switch(this.textAlign()){case"left":e.anchor=_e.START,i-=this.width/2;break;case"right":e.anchor=_e.END,i+=this.width/2}e.trans(i,s)}}class Po extends fo{constructor(t){super(t,Mo.TICK_CLASS),this.add(this._lineView=new $r(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class Co extends vo{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1}setLabel(t,e,s,i,r,n){if(i){const o=t.getIcon(s);t.prepareRich(i),this.setModel(this.doc,t,o&&t.getUrl(o),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)}else t.prepareRich(""),this._text.text=""}applyBackgroundCallback(t,e){const s=t.options.backgroundStyleCallback;if("background"===t.options.effect&&s){const i=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(s(i))}}rotatedWidth(){const t=(this.rotation||0)*T,e=this.getBBox();return f(u(t)*e.height)+f(d(t)*e.width)}rotatedHeight(){const t=this.rotation*T,e=this.getBBox();return f(d(t)*e.height)+f(u(t)*e.width)}resizeBackByWeight(t,e,s,i,r,n,o,a,h,l=0){const _=this._back;if(_&&!t._isHorz){const t=this.getBBox(),c=r/a,d=e?n-o+l:s?n:l-o;_.transX(d-this.tx),_.shiftY((c-t.height)/-2-h),e?_.resize(i-l-2*(n+o),c-1):_.resize(i-n-l+o,c-1)}}}class ko extends Jt{constructor(t){super(t,void 0),this.add(this._back=new ne(t,"rct-crosshair-flag")),this.add(this._text=new ue(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 qt,n=m(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 Lo extends fo{static isThumb(t){return t.classList.contains(Lo.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new zs(t,Lo.TRACK_CLASS)),this.add(this._thumbView=new zs(t,Lo.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=m(0,e),this._page=g(s,e),this._pos=g(t.min+e-s,m(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=m(0,g(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=y(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)}}}Lo.CLASS_NAME="rct-axis-scrollbar",Lo.TRACK_CLASS="rct-axis-scrollbar-track",Lo.THUMB_CLASS="rct-axis-scrollbar-thumb";const No=/\${label}.*?/g;class Mo extends fo{constructor(t){super(t,Mo.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new $r(t,Mo.LINE_CLASS)),this.add(this._titleView=new Vo(t)),this.add(this._markContainer=new Jt(t,"rct-axis-ticks")),this.add(this._labelContainer=new Jt(t,"rct-axis-labels")),this.add(this._unitView=new Ao(t)),this._labelViews=new io(this._labelContainer,Co,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new Lo(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=m(0,i.tick._getLength())+m(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsHorz(i,e,!0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).height,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),o}checkWidth(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=m(0,i.tick._getLength())+m(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsVert(i,s,!0,0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).width,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),o}prepareGuides(t,e,s,i,r){[i,r].forEach(((i,r)=>{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 ko(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick._getLength()):(i="opposite"===s._runPos?g(0,this.width-n.width):m(0,this.width-s.tick._getLength()-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}prepare(t){this._model=t,this._chartEmpty=t.chart.isEmpty(!0)}checkExtents(t){const e=this._prevModel,s=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax,i=this._prevMin=s.axisMin(),r=this._prevMax=s.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&i!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:r};s.options.animatable&&new So(this,s._isHorz?this.mw:this.mh,t,e,(()=>{this.invalidate()}))}}this._prevModel=s}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,c=this._unitView;let d=0,u=0;return this._reversed=e.options.reversed,(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new $r(t,Mo.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a._getLength(),this._tickGap=a._getGap(),e.label._inside||(d+=this._markLen,d+=this._tickGap,l&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),this.$_prepareLabels(e,h?s:i)&&(u=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i,!1,r),e.label._inside&&(u=0)),this._labelSize=u,c.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).width)),d+=u,this._simpleMode?(_.setVis(!1),c.setVis(!1)):(_.visible&&(d+=h?_.mh:_.mw,d+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?s:d,height:h?d:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t.label._inside,n=t._ticks,o=t._markPoints,a=this._labelViews,h=this._unitView,l=this._markLen,_=this._tickGap,c=this.width,d=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?d:0,0,c):this._lineView.setVLine(s?0:c,0,d),this._lineView2&&(e?this._lineView2.setHLine(d,0,c):this._lineView2.setVLine(0,0,d))),this._markContainer.visible&&(e?this._markViews.forEach(((e,i)=>{e.resize(1,l),e.layout().trans(t.prev(o[i]),s?r?d:d-l:r?-l:0)})):this._markViews.forEach(((e,i)=>{e.resize(l,1),e.layout().trans(s?-l:r?c:c-l,d-t.prev(o[i]))})));const u=l+_;if(this._labelContainer.visible&&a.count>0&&(a.count>n.length?a.prepare(n.length):a.count<n.length&&at.warn("labelViews.count < ticks.length",a.count,n.length),e?this.$_layoutLabelsHorz(a,n,r,i,s,c,d,u):this.$_layoutLabelsVert(a,n,r,i,s,c,d,u)),h.visible&&(e?this.$_layoutUnitHorz(h,a,s,c,d,u):this.$_layoutUnitVert(h,a,s,c,d,u)),!this._simpleMode){const i=t.title.options,n=this._titleView,o=this._scrollView,a=this._labelSize;let h=0,l=0;if(n.visible){const o=+i.offset||0,_=+i.gap||0;if(n.resizeByMeasured().layout(e),e){if(l+=s?0:(r?0:u+a)+_,t.options.reversed)switch(i.align){case"start":h=c-n.width/2-o;break;case"end":h=n.width/2+o;break;default:h=c/2-o}else switch(i.align){case"start":h=n.width/2+o;break;case"end":h=c-n.width/2-o;break;default:h=c/2+o}n.trans(h,l),l+=n.height}else{const t=0===n._angle?n.width:n.height;if(h=s?r?_+t/2:u+a+_+t/2:r?t/2:c-u-a-_-t/2,this._reversed)if(0===n._angle)switch(i.align){case"start":l=0+o;break;case"end":l=d-n.height-o;break;default:l=(d-n.height)/2+o}else switch(i.align){case"start":l=n.width/2-n.height/2+o;break;case"end":l=d-n.width/2-n.height/2-o;break;default:l=(d-n.height)/2+o}else if(0===n._angle)switch(i.align){case"start":l=d-n.height-o;break;case"end":l=0+o;break;default:l=(d-n.height)/2-o}else switch(i.align){case"start":l=d-n.width/2-n.height/2-o;break;case"end":l=n.width/2-n.height/2+o;break;default:l=(d-n.height)/2-o}n.trans(h,l)}}else l+=s?0:u+a;(null==o?void 0:o.visible)&&(e?(o.trans(0,l).resize(this.width,o.mh),o.setScroll(t._zoom,this._reversed)):(o.trans(0,0).resize(o.mw,this.height),o.setScroll(t._zoom,this._reversed)),o.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 Po(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,a=s.getLabelStyle(e,i);if(t.value=e.value,null!=n){o&&n.match(No)?t.setLabel(s,a,e,n.replace(No,o),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,null,a),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,a,e,o,1e3,1e3);t.applyBackgroundCallback(s,e),t.layout("center")}$_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=m(0,g(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,u=(i=m(1,i))*(r=g(m(1,r),_.length)),p=n||0,y=f(p)*T,x=y<35*T;let b,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){b=e.pull(v++),b.rotation=p,b.row=n,b.index=r,this._prepareLabel(b,_[r],h,c,a),b.setVis(!0);const t=i;if(0===p&&b.getBBox().width>=t){w=!0;break}if(x&&b.getBBox().width*d(y)>=t){w=!0;break}if(0!==p&&b.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-u;0<=t&&t<c&&(b=e.pull(v++),b.row=n,b.rotation=p,b.index=t,this._prepareLabel(b,_[t],h,c,a),b.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=m(0,g(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.options.reversed,r=t.label,n=r.options;let o,a=+n.step|0,h=+n.rows|0,l=+n.rotation%360,_=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s),c=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===n.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=l,e.row=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),c=this.$_applyStep(t,c,a||1);else{switch(a=h=0,r.options.autoArrange){case"rows":h=this.$_getRows(c);break;case"step":a=this.$_getStep(c)}if(a>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,s);)a++;else if(h>1){for(;t._ticks.length>h&&(c.forEach(((t,e)=>{t.row=e%h,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,h,0,!1,s));)h++;this._labelRowPts=[]}else if((isNaN(l)||Math.abs(Math.tan(l*T))<1)&&(l=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s))for(a=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,0,!0,s)&&c.forEach(((t,e)=>{t.rotation=l}));break}a++}}else;if(c.length>0){if(h>1){const t=!isNaN(l)&&0!=l,e=this._labelRowPts;for(let t=0;t<h;t++)e.push(0);c.forEach((s=>{e[s.row]=m(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(l)||0==l){o=c[0].getBBox().height;for(let t=1;t<c.length;t++)o=m(o,c[t].getBBox().height);if(c.length>1){const e=t._ticks;let s=i?n.lastOverflow:n.firstOverflow;if("hidden"===s){const t=c[0],s=t.rotatedWidth();let i=e[t.index].pos-s/2,r=0;for(let t=1;t<c.length;t++)r=m(r,c[t].getBBox().height);(i+s>c[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(o=r,t.hidden=!0):t.hidden=!1}if(s=i?n.firstOverflow:n.lastOverflow,"hidden"===s){const t=c[c.length-1],s=t.rotatedWidth(),i=c[c.length-2],r=e[t.index-1].pos+i.getBBox().width/2;let n=e[t.index].pos-s/2,a=0;for(let t=0;t<c.length-1;t++)a=m(a,c[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>a?(o=a,t.hidden=!0):t.hidden=!1}}}else{o=c[0].rotatedHeight();for(let t=1;t<c.length;t++)o=m(o,c[t].rotatedHeight())}return o}return 0}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,o=t._ticks,a=o.length,h=m(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._text.getBBox().height>=i))return!0}const d=_-h;0<=d&&d<a&&(l=e.pull(c++),l.rotation=0,l.index=d,this._prepareLabel(l,o[d],n,a,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1,i=0){if(i>1&&t instanceof xr)return this._prevWidth;const r=t.label;let n=m(1,+r.options.step|0);const o=this.$_checkOverlappedVert2(t,this._labelViews,e,n,s);let a=this._labelViews._internalItems();if(o)if("none"===r.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),a=this.$_applyStep(t,a,n||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++n,s););else;if(this._labelViews.freeHiddens(),a=this._labelViews._internalItems(),a.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",s=this._labelContainer.textAlign()||e;let i;a[0].setContrast(null).layout(s),i=a[0].getBBox().width;for(let t=1;t<a.length;t++)a[t].setContrast(null).layout(s),i=m(i,a[t].getBBox().width);return this._prevWidth=i}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o,a){const h=this.model,l=h.label,_=this._reversed,c=this._labelContainer.textAlign()||"center",d=this._labelRowPts,p=t.get(0).rotation,g=p*T,m=+h.label.options.rows|0,f=p<-15&&p>=-90||p>15&&p<=90,x=t.count,b=y(h._prevRate,1);let w,v,S;if(t.freeHiddens(),t.forEach(((t,i)=>{const l=e[t.index];t.setVis(!!l)&&(t.setContrast(null).layout(c),w=t.getBBox(),v=h.prev(l.pos)+(_?n*(1-b):0),S=s?r?o+a+d[t.row]:-a-w.height-d[t.row]:r?o-a-w.height-d[t.row]:a+d[t.row],p<-15&&p>=-90?s?r?(S+=u(g)*w.height/2,t.setRotation(0,w.height/2,-p)):(S-=u(g)*w.height/2,t.setRotation(0,w.height/2,p)):r?(v-=w.width,S-=u(g)*w.height/2,t.setRotation(w.width,w.height/2,-p)):(v-=w.width,S+=u(g)*w.height/2,t.setRotation(w.width,w.height/2,p)):p>15&&p<=90?s?r?(v+=w.width,S-=u(g)*w.height/2,t.setRotation(w.width,w.height/2,-p)):(v-=w.width,S+=u(g)*w.height/2,t.setRotation(w.width,w.height/2,p)):r?(S+=u(g)*w.height/2,t.setRotation(0,w.height/2,-p)):(S-=u(g)*w.height/2,t.setRotation(0,w.height/2,p)):(v-=w.width/2,t.setRotation(w.width/2,0,r?-p:p)),t.trans(v,S))})),!f&&m<2&&x>1){let e=t.get(_?x-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2;let n=!0;const o=e.rotatedWidth(),a=_?i.lastOverflow:i.firstOverflow;let h,c=e.tx;c+o>=s.tx?"pull"===a?c=s?s.tx-o-r:0:n="hidden"!==a:(h=e.elementToSvg(0,0).x)<0&&("pull"===a?c=Math.min(s.tx-r,h+4):n="hidden"!==a),n?e.transX(c):e.setVis(!1)}(0,e,t.get(_?x-2:1)),e=t.get(_?0:x-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2,o=s.tx+s.rotatedWidth();let a=!0,h=e.tx;const c=e.rotatedWidth(),d=_?i.firstOverflow:i.lastOverflow;let u,p;h<=o?"pull"===d?h=Math.max(o+r,n-c):a="hidden"!==d:(u=e.elementToSvg(e.getBBox().width,0).x)>(p=t.control.getBounds().width)&&("pull"===d?h=Math.max(o+r,h-(u-p+4)):a="hidden"!==d),a?e.transX(h):e.setVis(!1)}(this,e,t.get(_?1:x-2))}}$_layoutLabelsVert(t,e,s,i,r,n,o,a){var h;const l=this.model,_=l instanceof yi&&l.label.options.fillToCategory,c=r?s?"right":"left":i?"center":s?"left":"right",d=_?l.label.options.verticalAlign:"middle",u=_?l.label.options.align:c,p=this._titleView,g=p.visible?p.rotatedWidth()+(null===(h=p.model)||void 0===h?void 0:h.options.gap):0,m=this._labelSize,f=l.tick._getGap();const x=this._reversed,b=x?y(l._prevRate,1):1;let w=x?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;t.forEach(((t,h)=>{const c=e[t.index];if(t.setVis(!!c)){const e=t.getBBox(),h=function(t,e){if(s)if(r)switch(t){case"center":return(m-e)/2-m-f-a;case"left":return-m-f-a;default:return-e-f-a}else switch(t){case"right":return n+a+f+m-e;case"center":return!p.visible&&i?(n-e)/2:n+a+f+(m-e)/2;default:return n+a+f}else if(r)switch(t){case"center":return a+(n-g-e-a+f)/2;case"right":return n-e-g+f;default:return a}else switch(t){case"left":return g-f;case"center":return!p.visible&&i?(n-e)/2:g+(n-g-e-a-f)/2;default:return n-a-e}}(u,e.width),y=o*b-l.prev(c.pos)-e.height/2;if(t.trans(h,y),_){const s=l._weights.reduce(((t,e)=>t+e))/l._weights[t.index],h=o/s,_="top"===d?(h-e.height)/-2:"bottom"===d?(h-e.height)/2:0;t.shiftY(_),t.resizeBackByWeight(l,i,r,n,o,a,f,s,_,g)}else!x&&t.ty+e.height>w+1||x&&t.ty<w-1?t.setVis(!1):w=x?t.ty+e.height:t.ty}}))}$_layoutUnitHorz(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="end"===o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p;a?h?(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)):(u=_.getBBox(),p=Math.max(_.tx+u.width+d,i-l.width)):h?(u=c.getBBox(),p=Math.max(c.tx+u.width+d,i-l.width)):(u=_.getBBox(),p=Math.min(_.tx-l.width-d,0)),t.layout().trans(p,n)}$_layoutUnitVert(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="end"===o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p=s?n:i-l.width-n;a?h?(c.getBBox(),u=Math.max(c.ty+l.height+d,r)):u=Math.min(_.ty-l.height-d,0):h?u=Math.min(c.ty-l.height-d,0):(_.getBBox(),u=Math.max(_.ty+l.height+d,r)),t.layout().trans(p,u)}}Mo.AXIS_CLASS="rct-axis",Mo.LINE_CLASS="rct-axis-line",Mo.TICK_CLASS="rct-axis-tick";class Eo extends Jt{constructor(t,e,s){super(t,Eo.STYLE),this.add(this._back=new zs(t,Eo.BACK_STYLE)),this.add(this._textView=new ue(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 go).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,rx:y(parseFloat(e.rx),0),ry:y(parseFloat(e.ry),0)},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}}Eo.STYLE="rct-button",Eo.BACK_STYLE="rct-button-background";class To extends Jt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Bo extends ne{setArc(t,e,s,i,r,n){this.setPath(Is.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Oo extends Bo{setPolyline(t){this.setPath(Is.polygon(...t))}}class Ro extends ne{constructor(t,e,s){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 Is.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 Is.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 Do={};class $o extends yo{static register(...t){t.forEach((t=>{Do[t[0].type]=t[1]}))}constructor(t,e){super(t,$o.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.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}clicked(){this.model.clicked()}pointerEnter(){}pointerLeave(){}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)}}$o.CLASS_NAME="rct-annotation";const Fo={};class Io extends bo{static register(...t){t.forEach((t=>{Fo[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new zs(t,Io.PANE_CLASS)),this.add(this._contentContainer=new ee(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Io.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=l($t.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 Xo)return t;t=t.parent}}}Io.GAUGE_CLASS="rct-gauge",Io.PANE_CLASS="rct-gauge-pane";class zo extends Yt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class Ho extends Io{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return a(i)?xt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._valueRate=NaN}_setValueRate(t){isNaN(t)&&isNaN(this._valueRate)||t===this._valueRate||(this._valueRate=t,isNaN(t)?this.invalidate():this._doValueRateChanged(t))}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this.stopAni(),super._doLayout(),this.$_checkValueAnimation()}$_checkValueAnimation(){const t=this.model;this._animatable&&t.options.animatable&&t.options.value!==t._prevValue&&(this._ani=new zo(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}}class Go extends vo{}class jo extends fo{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new ee(t,"rct-gauge-scale-ticks")),this._ticks=new io(this._tickContainer,$r),this.add(this._labelContainer=new ee(t,"rct-gauge-scale-tick-labels")),this._labels=new io(this._labelContainer,Go)}}class Xo extends Io{_defaultCalss(){return Xo.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new ee(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))}))}}Xo.GAUGE_GROUP_CLASS="rct-gauge-group";class Yo{static reveal(t,e){new Zo(t,e)}static grow(t,e){new Ko(t,e)}static spread(t,e){new Qo(t,e)}static fadeIn(t){new Wo(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);at.isAnimation(s)&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Wo extends Yo{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:Yt.DURATION,fill:"none"})}}class Uo extends Yo{static clipRect(t,e){const s=e.view||t;let i;if(t.model.needClip(!1))i=s.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)i=s.clipRect(0,0,t.width,t.height);else{const e=t.control;i=t.model.chart.isInverted()?s.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):s.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return i}constructor(t,e){super(t,e)}_createAnimation(t,e){const s=Uo.clipRect(t,e);let i;switch(e&&e.from){case"top":i=this.$_top(s,e);break;case"bottom":i=this.$_bottom(s,e);break;case"right":i=this.$_right(s,e);break;default:i=this.$_left(s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Yt.DURATION,fill:"none"}}$_left(t,e){return t.dom.firstElementChild.animate([{width:0},{width:""}],this.$_aniOptions(e))}$_right(t,e){return t.dom.firstElementChild.animate([{x:t.width},{x:""}],this.$_aniOptions(e))}$_top(t,e){return t.dom.firstElementChild.animate([{height:0},{height:""}],this.$_aniOptions(e))}$_bottom(t,e){return t.dom.firstElementChild.animate([{y:t.height},{y:""}],this.$_aniOptions(e))}}class Zo extends Yt{constructor(t,e){super(),this._series=t,this._cr=Uo.clipRect(t,e),this._from=e.from,this.endHandler=()=>{t._animationFinished(this),this._cr.dom.remove()},this.start(),t._animationStarted(this)}_canUpdate(){return this._series.parent instanceof Jt}_stop(t){super._stop(t),this._series=null}_doUpdate(t){const e=this._cr.dom.firstElementChild;switch(this._from){case"top":e.setAttribute("height",this._cr.height*t);break;case"bottom":e.setAttribute("y",this._cr.height*(1-t));break;case"right":e.setAttribute("x",this._cr.width*(1-t));break;default:e.setAttribute("width",this._cr.width*t)}return!0}}class qo extends Yt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Jt}_stop(t){super._stop(t),this._series=null}}class Ko extends qo{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Qo extends qo{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Jo extends qo{constructor(){super(...arguments),this.duration=500}_doUpdate(t){return this._series.setPrevRate(t),!0}_doStop(){this._series.setPrevRate(NaN)}}class ta extends vo{constructor(t){super(t,"rct-series-trendline-label")}}class ea extends ee{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new ne(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new ne(t,"rct-series-trendline-variable")),this.add(this._line=new ne(t)),this.add(this._label=new ta(t))}layout(t,e,s,i,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.options.reversed,a=e.owner._yAxisObj.options.reversed,h=this.$_getPoints(e,s);this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(s,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new ne(t,"rct-series-trendline-marker")),this.add(this._endMarker=new ne(t,"rct-series-trendline-marker"))),this.$_layoutMarkers(e,h)):this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)),this._fixedArea.setVis(e.fixedArea.visible)&&(this._fixedArea.setStyleOrClass(e.fixedArea._style),this._fixedArea.setPath(this.$_getFixed(n,o,a,s,h,i,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,s,h,i,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,null,e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(s,e,n,o,a,h,i,r))}$_getPoints(t,e){const s=t.owner,i=s.chart.isInverted(),r=s._xAxisObj,n=s._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map((t=>{const s=e.start+r.getPos(a,t.x),i=n.getPos(e.rd,t.y);return{x:e.cx+i*d(s),y:e.cy+i*u(s),a:s}})):t._points.map((t=>{let e,s;return i?(s=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),s=o-n.getPos(o,t.y)),{x:e,y:s}})),h}$_getLine(t,e){const s=new qt;return s.move(e[0].x,e[0].y),s.lines(...e),s.end()}$_getVariable(t,e,s,i,r,n,o){const a=new qt,h=r[0],l=r[r.length-1];if(i);else if(t)if(s){a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(h.x,l.y)}else{a.move(h.x,h.y),a.line(h.x,l.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else if(s){a.move(h.x,h.y),a.line(l.x,h.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else{a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(l.x,h.y)}return a.end()}$_getFixed(t,e,s,i,r,n,o){const a=new qt,h=r[0],l=r[r.length-1];return i||(t?s?a.polygon(h.x,h.y,n,h.y,n,l.y,h.x,l.y):a.polygon(0,h.y,h.x,h.y,h.x,l.y,0,l.y):s?a.polygon(h.x,0,l.x,0,l.x,h.y,h.x,h.y):a.polygon(h.x,h.y,l.x,h.y,l.x,o,h.x,o)),a.end()}$_layoutMarkers(t,e){const s=t.marker.getRadius();if(this._startMarker.setVis(s>0)&&this._endMarker.setVis(s>0)){const i=Is.getDrawer(t.marker.options.shape);this._startMarker.setPath(i(s)),this._endMarker.setPath(i(s)),this._startMarker.setStyleOrClass(t.marker._style),this._endMarker.setStyleOrClass(t.marker._style),this._startMarker.trans(e[0].x,e[0].y),this._endMarker.trans(e[e.length-1].x,e[e.length-1].y)}}$_layoutLabel(t,e,s,i,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,_=this._label;if(!String(h.options.text))return void _.setVis(!1);h.prepareRich(h.options.text),h.buildSvg(_._text,_._outline,NaN,NaN,h,e.getLabelDomain());const c=h.options.position,d=t?function(t){const e=Math.floor((n.length-1)*t),s=(n.length-1)*t-e;let i;if(e>=n.length-1)i=n[n.length-1].a;else{const t=n[e],r=n[e+1];i=t.a+(r.a-t.a)*s}return i}(c):0,u=t?h.getAlignPolar(d):h.getAlign(s,i,r,c),p=t?h.getVerticalAlignPolar(d):h.getVerticalAlign(s,i,r),g=h.getOffsetX(u)+("middle"===p?l:0),m=h.getOffsetY(p)+("center"===u?l:0),f=Math.floor((n.length-1)*c),y=(n.length-1)*c-f;let x,b;if(f>=n.length-1)x=n[n.length-1].x,b=n[n.length-1].y;else{const t=n[f],e=n[f+1];x=t.x+(e.x-t.x)*y,b=t.y+(e.y-t.y)*y}const w=_.getBBox();switch(u){case"left":x-=w.width+g;break;case"center":x-=w.width/2+g;break;case"right":x+=g}switch(p){case"top":b-=w.height+m;break;case"middle":b-=w.height/2+m;break;case"bottom":b+=m}t||(x<0&&(x=0),b<0&&(b=0),x+w.width>o&&(x=o-w.width),b+w.height>a&&(b=a-w.height)),_.trans(x,b)}}class sa extends Yt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(ca.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(ca.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class ia extends vo{constructor(t){super(t,"rct-point-label")}}class ra extends ee{constructor(t){super(t,"rct-point-labels"),this._labels=[new io(this,ia),new io(this,ia)],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=m(e,t.getBBox().width))),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text);e.point=i,e.setModel(t,n,i.icon?n.getUrl(i.icon):null,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.stopAni().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]}$_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(po(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===Zs)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(uo(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});uo(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(uo(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});uo(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n,o){const a=e.length;if(a<2)return 0;e.sort(((t,e)=>t.ty-e.ty));const h=t.getBBox(),l=h.y+h.height/2;let _=Number.MAX_SAFE_INTEGER,c=0;for(let t=0;t<a;t++){const s=e[t].inflateBBox(0,-1),i=Math.abs(l-(s.y+s.height/2));i<_&&(_=i,c=t)}const d=(t,s)=>{0!==s&&e[t].shiftY(s)},u=(t,s)=>{const i=e[t].inflateBBox(0,-1),r=e[s].inflateBBox(0,-1);return i.y+i.height-r.y};for(let t=0;t<c;t++){const e=u(t,t+1);if(e>0){d(t,-e);for(let e=t;e>0;e--){const t=u(e-1,e);t>0&&d(e-1,-t)}}}for(let t=a-1;t>=c&&t>0;t--){const e=u(t-1,t);if(e>0){d(t,e);for(let e=t;e<a-1;e++){const t=u(e,e+1);t>0&&d(e+1,t)}}}const p=this.control.chartView().bodyView().height;if(r){const t=(t,s)=>{for(let i=t;i<s;i++){const t=e[i].tbottom-e[i+1].ty;t>0&&d(i+1,t)}},s=(t,s)=>{for(let i=t;i>s;i--){const t=e[i].ty-e[i-1].tbottom;t<0&&d(i-1,t)}},i=e[0],r=e[a-1],n=e[c];let o=i.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const s=e[t+1].ty-e[t].tbottom;t<c?o+=s:h+=s}if(i.ty<0)if(o>=0){i.transY(0),t(0,c-1),n.ty<e[c-1].tbottom&&s(c,0),o=0;for(let t=0;t<c;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)i.transY(0),t(0,a-1),o=0;else{for(let t=c;t>0;t--){const s=e[t].ty-e[t-1].tbottom;d(t-1,s)}o=i.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),s(a-1,c+1),n.tbottom<e[c+1].ty&&t(c,a-1),h=0;for(let t=c;t<a-1;t++)h+=e[t+1].ty-e[t].tbottom}else if(o+h>0)r.transY(p-l),s(a-1,0),h=0;else{if(o>=0){i.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=c;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(i.ty<0&&h>0){const t=Math.min(i.ty+h,0);i.transY(t);for(let t=1;t<a;t++)e[t-1].tbottom>e[t].ty&&e[t].transY(e[t-1].tbottom)}}return o===qs&&e.forEach(((t,e)=>{const i=t.ty+t.getBBox().height;(t.ty<0||i>p)&&(s.get(t.point).setVis(!1),t.setVis(!1))})),1}}class na extends mo{constructor(t){super(t),this.add(this._line=new ne(t))}setLine(t){this._line.setPath(t)}}class oa extends mo{constructor(t){super(t,"rct-point-label-lines"),this._lines=new io(this,na)}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 aa extends ee{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t===this.inverted&&e===this._hSave||((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform",""),this._hSave=e),this.inverted}}const ha={},la="rct-point-hover",_a="rct-point-unhover";class ca extends bo{static register(...t){t.forEach((t=>{ha[t[0].type]=t[1]}))}static isPointDom(t){for(;$t.isSVGElement(t);){if(t.classList.contains(this.POINT_CLASS))return!0;t=t.parentElement}}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 aa(t,"rct-series-points")),this._labelContainer=new ra(t)}depthEnabled(){return!1}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"}_setDepth(t){this._depthExt=t}setCircular(t){}prepareSeries(t,e,s,i){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.chartOptions.options.paletteMode===st,this.setData("index",e._seriesIndex%Ei),this.setData("pointcolors",this._colorByPoint?this._getPointColors():L),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),e._calcedColor=r[this._legendColorProp()],e._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:"",this._visPoints=this._collectVisPoints(e),this._yReversed=e._yAxisObj.options.reversed,this._prepareSeries(t,e,s,i)}_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(la).addClass(_a)}))):this._getPointPool().forEach((t=>{t.containsClass(_a)&&t.removeClass(_a).addClass(la)}))}_clearHoverClasses(t){t instanceof Jt&&t.removeClass(la).removeClass(_a)}focusPointView(t,e){}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(ca.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof va&&r.push(new sa(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(ca.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof va?r.push(new sa(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof Aa&&this.needFronting()&&this._getPointPool().front(t),n.push(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&&Xt(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 Oi&&e.trendline.visible?(this._trendView||this.add(this._trendView=new ea(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.width,e=this.height,s=this.model,i=s.pointLabel,r=this._trendView;this._labelOverlap={model:i,inverted:this._inverted,width:t,height:e,fit:i._overflowFit,outline:i.options.overlapOutline,contrast:i.options.overlapContrast},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||s._needAnimate),s._needAnimate=!1,r&&r.setVis(r.visible&&(!s.trendline.options.autoHide||!this._animating()))&&this.$_renderTrendline(r,this._inverted,t,e),this._labelContainer.visible&&this._depthExt&&this._labelContainer.trans(this._depthExt.base,0)}_doAfterLayout(){this.model._xAxisObj._seriesChanged&&new Jo(this,(()=>{this.invalidate()}))}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const s=this._randomPalette?Math.floor(Math.random()*Ei):e.index%Ei;t.setData("index",this._model._paletteColors[s].toString())}else t.unsetData("index")}_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 y(this._growRate,1)}_getPosRate(){return y(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){}$_renderTrendline(t,e,s,i){const r=this.model;r instanceof Oi&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),s,i)}_layoutLabel(t,e,s,i){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=s&&o>=0&&o<=i))return;h.layout(e.textAlign);const _=e.below=e.reversed?a<=0:a<0,c=h.getBBox();let d=!0;r?(n-=e.distY,o+=e.distX,o-=c.height/2-c.height*t._vertAdjust):(n-=e.distX,o+=e.distY,n-=c.width/2);const u=n,p=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+c.width)/2+(e.reversed?l:-l)):(n-=e.base,o+=e.side,o+=(a-c.height)/2+(e.reversed?l:-l));break;case"head":r?(n-=e.side,o+=e.base,_?n+=l:n-=c.width+l):(n-=e.base,o+=e.side,_?o-=c.height+l:o+=l);break;case"foot":r?(n-=e.side,o+=e.base,n-=_?a+c.width+l:a-l):(n-=e.base,o+=e.side,o+=_?a+l:a-c.height-l);break;case"far":r?n=_?l:s-c.width-l:_?(n-=e.base,o=i-c.height-l):o=l,d=!1;break;default:r?_?n-=c.width+l:n+=l:_?(n-=e.base,o+=e.side,o+=l):o-=c.height+l,d=!1}this._checkLabelOverlap(h,c,u,p,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,c,n,o)}_checkLabelOverlap(t,e,s,i,r,n,o,a,h,l){const _=this._labelOverlap;let c=!1;if(!h){const h=_.fit;if(isFinite(h)&&(_.inverted?o+e.width>=_.width?c=(o=_.width+h-e.width)<s+r:o<=0&&(c=(o=-h)+e.width>s-r):a+e.height>=_.height?c=(a=_.height+h-e.height)<i+n:a<=0&&(c=(a=-h)+e.height>i-n)),c){if(!isFinite(h))return t.setVis(!1),!1;_.outline&&t.setOutline(_.model)}}return t.setContrast((h||c&&_.contrast)&&l),t.trans(o,a),!0}_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,m(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,g(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,f(_-l),e):r.setBounds(l,-e,f(_-l),e):r.setBounds(0,-m(l,_),t,f(_-l)):o?h?r.setBounds(_,0,f(_-l),e):r.setBounds(l,0,f(_-l),e):r.setBounds(0,e-m(l,_),t,f(_-l))}_setFill(t,e){s(e)&&e[U]?t.internalSetStyle(U,e[U]):n(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,s,i){if(this.model.chart.isInverted())return;const r=this._labelOverlap,n=this.model.pointLabel.getRotation();e||(e=t.getBBox());const o=e.width/2,a=e.height/2;this._adjustRotatedLabelPosition(t,r,e,s,i),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=e.height,h=y(e.fit,0),l=this.model._yAxisObj.options.reversed,_=this.model.chart.isInverted(),c=n.options.position;let d=this._getRotatedLabelDisplacement(o,s);if(!_&&c!==Xs)if(l?c!==js&&c!==Gs||(d*=-1):c===Gs&&(d*=-1),r-=d,l){const t=r+(-2*d+s.height)/2+s.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+s.height)/2<0&&(r=d-h)}t.trans(i,r)}_getRotatedLabelDisplacement(t,e){const s=t*Math.PI/180,i=Math.abs(Math.sin(s)),r=Math.abs(Math.cos(s)),n=e.width,o=e.height;return n/2*i+o/2*r-o/2}}ca.POINT_CLASS="rct-point",ca.DATA_FOCUS="focus",ca.DATA_UNFOCUS="unfocus",ca.DATA_UNHOVER="unhover",ca.LEGEND_MARKER="rct-legend-item-marker";class da extends ne{constructor(t){super(t,ca.POINT_CLASS)}savePrevs(){}}class ua extends da{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class pa extends Jt{constructor(t){super(t,ca.POINT_CLASS)}savePrevs(){}}class ga extends pa{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let ma=class extends ua{layout(t,e,s,i,r,n,o){this.x=t,this.setPath(Is.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}};class fa extends ga{constructor(t){super(t),this.add(this._topView=new ne(t)),this.add(this._frontView=new ne(t)),this.add(this._sideView=new ne(t))}layout(t,e,s,i,r,n,o){const a=this.wPoint,h=this.hPoint;let l=getComputedStyle(this._frontView.dom).fill;const _=h<0?e:e-h;if(ot&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(Is.rectangle(t-r,e+n,a,-h)),this._topView.setPath(Is.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",Dt.interpolate(o?Dt.BLACK:Dt.WHITE,l,.2)),this._sideView.setPath(Is.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",Dt.interpolate(o?Dt.WHITE:Dt.BLACK,l,.2))}}class ya extends mo{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class xa extends ca{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,s,i){this._preparePoints(t,e,this._visPoints,!!i)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&Yo.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class ba extends xa{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new oa(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.options.angle*T,this._base=d(this._depthAngle)*e.depth,this._side=u(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,s,i),this._pointOff=e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_prepareLayoutPoints(t,e){}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=this._prevRate,o=s.pointLabel,a=this._labelViews(),h=this._labelLineContainer,_=s._xAxisObj,c=s._yAxisObj,p=this._yReversed,g=this._depthExt,f=s._group?s._groupDistance:s.distance,x=g?f*(i?u(this._depthAngle):d(this._depthAngle)):0,b=g?f*(i?d(this._depthAngle):u(this._depthAngle)):0,w=2*_.unitPad(),v=y(s.options.minPointWidth,0),S=this._yLen=c.prev(i?t:e),V=_.prev(i?e:t),A=t=>c.getPos(S,t),P=t=>_.getPos(V,t),C=i?0:e,k=c.valueMin(),L=c.getPos(S,k),N=this._baseVal=s.getBaseValue(c),M=!isNaN(N),E=this._yBase=y(A(m(k,y(N,L))),L),T=this._pointOff,B=a&&l(this._labelInfo,{inverted:i,reversed:p,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:x,distY:b,side:this._side,base:this._base});a&&h.setVis(s.pointLabel.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(s.pointLabel.line._style),h.prepare(s),B.pb=new qt),this._prepareLayoutPoints(t,e),this._getPointPool().forEach(((h,l)=>{const c=h.point;if(h.setVis(!c.isNull)){const d=_.getUnitLen(V,c.xValue)*(1-w);let u=s.getPointWidth(d,v),p=A(c.yGroup),g=E;if(c.yGroup!=c.yValue){const t=N>c.yGroup,e=c.yGroup<0,s=c.yValue<0,i=t&&e&&!s||t&&!e&&!s||!t&&e&&s||!t&&!e&&s,r=c.yGroup-c.yValue*(i?-1:1);g=A(r)}const m=(p-g)*r;let f=P(c.xValue)-d/2,y=C-p;if(isNaN(f)){const t=_.getUnitLen(V,c.xValue)*(1-w);f=P(c.xValue)-t/2}isNaN(n+h.wSave)||(u=h.wSave+(u-h.wSave)*n),f+=s.getPointPos(d)+u/2,isNaN(n+h.xSave)||(f=h.xSave+(f-h.xSave)*n),c.xPos=f+=u*T,c.yPos=y,this._layoutPoint(h,l,f-x,C-E*(1-r)-g*r+b,u,m),i&&(y=V-P(c.xValue)+d/2,f=C,c.yPos=y-=s.getPointPos(d)+u/2+u*T,c.xPos=f+=M?A(c.yGroup)*r:A(c.yGroup*r)),B&&(B.labelView=a.get(c,0))&&(B.pointView=h,B.x=f,B.y=y,B.wPoint=u,B.hPoint=m,this._layoutLabel(o,B,t,e))}}))}_layoutLabel(t,e,s,i){if(super._layoutLabel(t,e,s,i),e.pb){const t=this._labelLineContainer.get(e.pointView.point),s=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?s.tx+s.getBBox().width:s.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?s.ty:s.ty+s.getBBox().height),t.setLine(e.pb.end())}}}class wa extends xa{_getHighValue(t){return t.yValue}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),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,_=s._yAxisObj,c=2*h.unitPad(),d=y(s.options.minPointWidth,0),u=i?t:e,p=i?e:t,g=i?0:e,m=this._pointOff,f=a&&l(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach(((l,y)=>{const x=l.point;if(l.setVis(!x.isNull)){const b=h.getUnitLen(p,x.xValue)*(1-c);let w=s.getPointWidth(b,d);const v=(_.getPos(u,this._getHighValue(x))-_.getPos(u,this._getLowValue(x)))*r;let S=h.getPos(p,x.xValue)-b/2,V=g-_.getPos(u,this._getHighValue(x))*r;isNaN(n+l.wSave)||(w=l.wSave+(w-l.wSave)*n),S+=s.getPointPos(b)+w/2,isNaN(n+l.xSave)||(S=l.xSave+(S-l.xSave)*n),x.xPos=S+=w*m,x.yPos=V,this._layoutPoint(l,y,S,V,w,v),i&&(V=p-h.getPos(p,x.xValue)+b/2,S=g,x.yPos=V-=s.getPointPos(b)+w/2+w*m,x.xPos=S+=_.getPos(u,this._getHighValue(x))*r),a&&(f.pointView=l,f.hPoint=v,f.x=S,f.y=V,(f.labelView=a.get(x,0))&&(f.hPoint=v,this._layoutLabel(o,f,t,e)),(f.labelView=a.get(x,1))&&(i?f.x-=v:f.y+=v,f.hPoint=-v,this._layoutLabel(o,f,t,e)))}}))}}class va extends da{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 Sa extends ca{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[]}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.options.position;let l=this._getRotatedLabelDisplacement(o,s);if(!a&&h!==Xs){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*i*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-i-o.height-s),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class Va extends Yt{constructor(t,e){super(),this.series=t,this.duration=e}_doUpdate(t){const e=this.series;return!!e&&(e._zombieRate=e._zombie.visible?t:1-t,e._refreshZombie(),!0)}_doStop(){const t=this.series;t&&(t._zombie=null,t._zombieAni=null,t.invalidate(),this.series=null)}}class Aa extends ca{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}clipInvertable(){return!1}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 Va(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return zs.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);const r=getComputedStyle(i.dom);s._calcedColor=r.fill,s._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class Pa extends $o{constructor(t){super(t,Pa.CLASS_NAME),this.addToTransform(this._imageView=new wo(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,s,i,r){const n=this._size=e.getSize(s,i);this._deflatePaddings(n),this.$_setImage(this.model.options.imageUrl);const o=this._imageView.getBBox();return this._inflaePaddings(o),oo(o)}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_setImage(t){this._imageView.setImage(t,this._size.width,this._size.height)}}Pa.CLASS_NAME="rct-image-annotation";class Ca extends $o{constructor(t){super(t,Ca.CLASS_NAME),this.addToTransform(this._shapeView=new ne(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),d=null===(a=e.chart.yAxis)||void 0===a?void 0:a.getPos(i,e.options.y1),u=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 hr:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:l.height/2),this._shapeView.setPath(Is.line(g,p,g+l.width,p));break;case ar:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(u)&&Number.isNaN(d)&&(p=i-u),this._shapeView.setPath(Is.line(g,p,g,p+l.height));break;case lr:Number.isNaN(c)||(g=Number.isNaN(_)?c:_>c?l.width:0),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:d<u?l.height:0);const t=_>c?g-l.width:g+l.width,s=d<u?p-l.height:p+l.height;this._shapeView.setPath(Is.line(g,p,t,s));break;default:Is.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)}}Ca.CLASS_NAME="rct-shape-annotation";class ka extends $o{constructor(t){super(t,ka.CLASS_NAME),this.addToTransform(this._textView=new ue(t)),this._textView.anchor=_e.START,this._richText=new ve}_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),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._deflatePaddings(o),this._richText._isVertical="vertical"===n.writingMode,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(a,s,i,null,e._domain);const h=oo(this._textView.getBBox());return{width:y(o.width,h.width),height:y(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)}}ka.CLASS_NAME="rct-text-annotation";class La extends va{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)),Is.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 Na extends aa{}class Ma extends ca{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new Na(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new ne(t,"rct-line-series-line")),this._markers=new io(this._pointContainer,La),this.add(this._tester=new ne(t)),this._tester.setFill("#ff000010")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;if(s._line.setStyle("strokeWidth",e.strokeWidth),s._shape){const t=getComputedStyle(this.dom);s._marker.setStyles({fill:t.fill,stroke:t.stroke}),s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")}else s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e,s){e instanceof Xr&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._based&&e.options.belowStyle,this._prepareBelow(e.chart.isPolar())),!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.buildLines(this._visPoints)}_doAfterLayout(){this._layoutLines(this._polar)}_runShowEffect(t){this._polar?t&&Yo.grow(this):t&&Yo.reveal(this,{from:function(t){const e=t.model._xAxisObj.options.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._prepareBelow(!!this._polar),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){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new ne(this.doc,"rct-line-series-line rct-line-series-line-below"),t?this._lineContainer.add(r):this._lineContainer.insertChild(r,this._line),t?this.isClip(this._innerClip)||(this._outerClip=i.clipPath(),this._innerClip=i.clipPath(),this._outerLineClip=i.clipPath(),this._innerLineClip=i.clipPath()):this.isClip(this._upperClip)||(this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds())),t?this._yReversed?(this._line.setClip(this._needBelow?this._innerLineClip:null),this._lowLine.setClip(this._outerLineClip)):(this._line.setClip(this._needBelow?this._outerLineClip:null),this._lowLine.setClip(this._innerLineClip)):(this._line.setClip(this._upperClip),r.setClip(this._lowerClip)),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new io(this._lineContainer,ne)),i.prepare(e.length);s.length<e.length;){const t=new re(this.doc);this.control.addClip(t),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._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:i,rd:r,min:o,max:a,cyclic:h}=this._polar,l=R(m(0,g((M-f(o-a))/2,.2))),_=n?1:this._getGrowRate();this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(Is.donut(t,i,r*_,s*_)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(Is.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Is.circle(t,i,s*_)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(Is.sector(t,i,r*_,r*_,s/e,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():Is.sector(t,i,r*_,r*_,s/e,o-l,a+l,!0))):(this._outerClip.setPath(Is.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Is.sector(t,i,s*_,s*_,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():Is.sector(t,i,s*_,s*_,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(i?r?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):r?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-s):o.setBounds(0,-s,e,s):r?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){const s=t instanceof Xr&&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)}_prepareMakrer(t){const e=this.model,s=t.point;t._shape=e.getShape(s),t._radius=e.getRadius(s)}_layoutMarker(t,e,s,i){const r=t._radius;e&&t.internalSetStyleOrClass(e),Is.setShape(t,t._shape,r,r),t.setPos(s,i),t.trans(s-=r,i-=r)}_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,p=r.options.maxVisible,g=r.options.minVisible,m=i.pointLabel,f=m.options.align,y=m.getAlignOffset(),x=m.getOffset(),b=m.getPosition(),w=this._labelContainer._textAlign,v=this._labelViews(),S=i._xAxisObj,V=i._yAxisObj,A=this._polar=i.chart._body.getPolar(S),P=!!A,{cx:C,cy:k,rd:L,start:N,total:M}=A||{},E=V.prev(o?e:s),T=S.prev(A?M:o?s:e),B=o?0:s,O=t.length,R=V.axisMax(),D=this._yReversed,$=V instanceof br?i.getBaseValue(V):NaN,F=$>V.axisMin(),I=V.getPos(L,$);t.forEach(((t,r)=>{let m,z,H,G;A?(H=N+S.getPos(T,t.xValue),G=D?isNaN(t.yGroup)?F?I:L:F?I+(V.getPos(L,t.yGroup)-I)*h:L-V.getPos(L,R-t.yGroup)*h:isNaN(t.yGroup)?F?I:0:F?I+(V.getPos(L,t.yGroup)-I)*h:V.getPos(L,t.yGroup)*h,m=t.px=C+G*d(H),z=t.py=k+G*u(H),t.angle=H):(m=t.px=S.getPos(T,t.xValue),z=t.py=B-V.getPos(E,t.yGroup),o&&(m=V.getPos(E,t.yGroup),z=s-S.getPos(T,t.xValue))),t.xPos=m,t.yPos=z;const j=m,X=z,Y=this._markers.get(r),W=v&&v.get(t,0);if(Y&&Y.setVis(!t.isNull&&(P||!a||m>=0&&m<=e&&z>=0&&z<=s))){this._prepareMakrer(Y),this._layoutMarker(Y,n,m,z),i._maxY,t.yGroup,i._minY,t.yGroup;const e=0==r&&null!=_?_:r==O-1&&null!=c?c:i._maxY==t.yGroup&&null!=p?p:i._minY==t.yGroup&&null!=g?g:l;if(Y.setStyle("opacity",e?"1":"0"),W){W.setContrast(null).layout(w);const e=W.getBBox(),s=Y._radius;if(W.visible=!0,A){switch(b){case"inside":D?t.yValue<$?G-=x:G+=x:t.yValue<$?G+=x:G-=x;break;case"foot":D?t.yValue<$?G-=e.height/2+x:G+=e.height/2+x:t.yValue<$?G+=e.height/2+x:G-=e.height/2+x;break;default:D?t.yValue<$?G+=e.height/2+x:G-=e.height/2+x:t.yValue<$?G-=e.height/2+x:G+=e.height/2+x}m=C+G*d(H),z=k+G*u(H)-e.height/2,this.applyAutoRotation(W,H,M,S.options.totalAngle)}else switch(b){case"inside":z-=e.height/2+x;break;case"foot":z+=x+(l?s:0);break;default:z-=e.height+x+(l?s:0)}switch(f){case"left":m-=e.width+(l?s:0)+y;break;case"right":m+=(l?s:0)+y;break;default:m-=e.width/2+y}this._checkLabelOverlap(W,e,j,X,s,s,m,z,!1,null),this._layoutLabelRotation(W,e,m,z)}}else W&&W.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 Xr&&this._needBelow;let o=this._buildLines(t,e._lines);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),$t.setImportantStyle(t.dom.style,U,"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),$t.setImportantStyle(t.dom.style,U,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);t?this.$_resetClips(s,i/2,h.getPos(i/2,l),!0):r?this.$_resetClips(s,i,h.getPos(s,l),!0):this.$_resetClips(s,i,i-h.getPos(i,l),!1),a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.options.belowStyle),$t.setImportantStyle(a.dom.style,U,"none"))}}_buildLine(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve(t,s,i):r instanceof Xr&&"step"===e?this._drawStep(t,s,i,s?r.backDir():r.options.stepDir):this.$_drawLine(t,s,i)}_buildLines(t,e){const s=this.model,i=s.getLineType(),r=new qt;return"spline"===i?this._drawCurves(t,e,r):s instanceof Xr&&"step"===i?this._drawSteps(e,r,s.options.stepDir):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,s){if(t.length>1){const i=this._model instanceof Xr&&this._model.options.connectNullPoints;s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&i||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this.$_drawLine(t,!1,e)))}_drawStep(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._drawStep(t,!1,e,s)))}_drawCurve(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),s.spline(t,0,t.length-1))}_drawCurves(t,e,s){if(t){const{cx:i,cy:r,rd:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof br?a.getBaseValue(h):NaN,_=l>h.axisMin()?h.getPos(n,l):0,c=e[0],p=c.length;let g,m;o?(s.move(c[0].px,c[0].py),s.closedSpline(c,!0)):(g=i+_*d(c[0].angle),m=r+_*u(c[0].angle),s.move(g,m),s.line(c[0].xPos,c[0].yPos),s.closedSpline(c,!1),g=i+_*d(c[p-1].angle),m=r+_*u(c[p-1].angle),s.line(g,m))}else e.forEach((t=>this._drawCurve(t,!1,s)))}_buildAreas(t,e,s){const i=new qt;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,i),this._buildLine(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class Ea extends Ma{constructor(t){super(t,Ea.CLASS),this._flagView=new vo(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:d,height:u}=a,p=d/2,g=u/2,{width:m,height:f}=r,y=m/2,x=f/2,b=l>u+o,w=f>l+u+o,v=h>d+o,S=m>h+d+o,V={top:b,right:S,bottom:w,left:v};_=null!==(t=c.find((t=>V[t])))&&void 0!==t?t:_;const A=h>p&&m-h>p?h-p:h>y?m-d:0,P=l>g&&f>l+g?l-g:l>x?f-u:0;switch(_){case"top":h=A,l=b?l-u-o:0;break;case"bottom":h=A,l=w?l+o:f-u;break;case"left":h=v?h-d-o:0,l=P;break;case"right":h=S?h+o:m-d,l=P}i.trans(h,l)}}}Ea.CLASS="rct-line-series";class Ta extends Ma{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Na(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new ne(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new ne(t,"rct-areanrange-series-line")),$t.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,p=this._labelViews(),g=this._labelContainer._textAlign,m=this._polar=i.chart._body.getPolar(h),f=i.pointLabel,y=f.options.position,x=f.options.align,b=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 i=0,c=t.length;i<c;i++){const f=t[i],S=v.get(c+i),V=p&&p.get(f,1);let A,P,C;this._prepareMakrer(S),a?(A=f.px2=l.getPos(_,f.lowValue),P=f.py2=v.get(i).ty+S._radius):(A=f.px2=f.xPos,P=f.py2=f.yLow);const k=A,L=P;if(S&&S.setVis(!f.isNull&&A>=0&&A<=e&&P>=0&&P<=s)){if(this._layoutMarker(S,n,A,P),S.setStyle("opacity",o||0==i&&!0===r.options.firstVisible||i===c-1&&!0===r.options.lastVisible?"1":"0"),V){V.setContrast(null).layout(g).setVis(!0);const t=V.getBBox(),e=S._radius;if(m){switch(y){case"inside":P-=w;break;case"foot":P-=t.height/2+w;break;default:P+=t.height+w}A=m.cx+P*d(C),P=m.cy+P*u(C)-t.height/2,this.applyAutoRotation(V,C,m.total,h.options.totalAngle)}else switch(y){case"inside":P-=t.height/2+w;break;case"foot":P+=w+(o?e:0);break;default:P-=t.height+w+(o?e:0)}switch(x){case"left":A-=t.width+(o?e:0)+b;break;case"right":A+=(o?e:0)+b;break;default:A-=t.width/2+b}this._checkLabelOverlap(V,t,k,L,e,e,A,P,!1,null),this._layoutLabelRotation(V,t)}}else V&&V.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)}}class Ba extends Ma{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new Na(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new ne(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){const e=this._area;let s=this._lowArea;if(super._prepareBelow(t))return s||this._areaContainer.add(s=this._lowArea=new ne(this.doc,"rct-area-series-area")),t?this._yReversed?(e.setClip(this._innerClip),s.setClip(this._outerClip)):(e.setClip(this._outerClip),s.setClip(this._innerClip)):(e.setClip(this._upperClip),s.setClip(this._lowerClip)),!0;null==s||s.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const s=this.doc,i=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new io(this._areaContainer,ne,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<g(e.length,i.length);t++)this.isClip(i[t])||(i[t]=this.control.addClip(new re(s)));for(;i.length<e.length;)i.push(this.control.addClip(new re(s)));for(;i.length>e.length;)i.pop().remove()}else r&&(r.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.isNull?s.yLow=NaN:s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this.$_layoutPolar(this._area,this._lowArea,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(U,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(U,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}setCircular(t){this._circular=t}$_layoutPolar(t,e,s){const i=this.model,r=i._group,n=i._xAxisObj,o=i._yAxisObj,a=this._yReversed,h=o instanceof br?i.getBaseValue(o):NaN,l=this._polar,{cx:_,cy:c,rd:p,cyclic:f}=l,x=new qt,b=s.length;if(!r||"stack"!==r.options.layout&&"fill"!==r.options.layout){const r=h>o.axisMin(),l=r?o.getPos(p,h):0,y=i.chart._body.options.circular;let w,v,S,V,A=!1,P=!1;if("spline"===i.options.lineType)this._drawCurves(this._polar,i.buildLines(s),x);else{f?x.move(s[0].xPos,s[0].yPos):(w=_+l*d(s[0].angle),v=c+l*u(s[0].angle),x.move(w,v),x.line(s[0].xPos,s[0].yPos));for(let t=1;t<b;t++)x.line(s[t].xPos,s[t].yPos);f||(w=_+l*d(s[b-1].angle),v=c+l*u(s[b-1].angle),x.line(w,v))}const C=s.map((t=>t.angle)),k=this._polar.min=g(...C),L=this._polar.max=m(...C),N=(new qt).push(x.end());if(r)f?x.circle(_,c,l):a&&x.push(...Is.arc(_,c,l,l,k,L,!0)),S=x.end(),A=!0,f?N.circle(_,c,l):N.push(...Is.arc(_,c,l,l,k,L,!0)),V=N.end(),P=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),s=n._ticks;x.push("Z"),f?y?x.circle(_,c,p):x.polygon(...s.map((s=>(console.log(s.value,s.pos),{x:_+d(t+s.pos/p*e/M)*p,y:c+u(t+s.pos/p*e/M)*p})))):y?x.push(...Is.sector(_,c,p,p,0,k,L,!0)):x.polygon({x:_,y:c},...s.map((s=>({x:_+d(t+s.pos/p*e/M)*p,y:c+u(t+s.pos/p*e/M)*p})),{x:_,y:c})),S=x.end(!0),A=!0}else S=x.end();t.setPath(S),t.setAttr("fill-rule",A?"evenodd":""),e&&(e.setPath(V||""),e.setAttr("fill-rule",P?"evenodd":""))}else{x.move(y(s[0].xPos,_),y(s[0].yLow,c)),x.line(y(s[0].xPos,_),y(s[0].yPos,c));for(let t=1;t<s.length;t++)x.line(y(s[t].xPos,_),y(s[t].yPos,c));x.line(y(s[s.length-1].xPos,_),y(s[s.length-1].yLow,c));for(let t=s.length-1;t>=0;t--)x.line(y(s[t].xPos,_),y(s[t].yLow,c));t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(i._runColor),t.addStyleOrClass(i._style),$t.setImportantStyle(t.dom.style,Z,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(i._runColor),e.addStyleOrClass(i._style),e.internalSetStyleOrClass(i.options.belowStyle),$t.setImportantStyle(e.dom.style,Z,"none")),i._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new oe(this.doc)));const t=Is.arc(_,c,p,p,l.start,l.start+l.total,!0);t.push("L",_,c),this._arcClip.setPath(t),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Oa extends wa{constructor(t){super(t,"rct-barrange-series"),this._bars=new io(this._pointContainer,ma)}_getPointPool(){return this._bars}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),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*y(t.point.width,1),t.hPoint=n,t.layout(s,i+n,this._rd,this._rd,0,0,this._inverted)}}class Ra extends Ro{constructor(t){super(t,ca.POINT_CLASS)}savePrevs(){}}class Da extends ba{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,s,i){this._polar=s,super._prepareSeries(t,e,s,i)}_preparePoints(t,e,s,i){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,i)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.getBaseValue(e._yAxisObj)&&e.options.belowStyle&&t.addStyleOrClass(e.options.belowStyle)}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s,i){this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i))),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 io(this._pointContainer,Ra)),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=o.options.reversed,h=2*n.unitPad(),l=r.getPolar(n),{cx:_,cy:c,rd:p}=l,m=o instanceof br?t.getBaseValue(o):NaN,f=m>o.axisMin(),y=o.getPos(p,m),x=this._pointOff,b=n.getTotalAngle();let w,v,S,V,A;i&&(w=this._labelInfo,v=t.getLabelPos(s),S=t.getLabelOff(s.getOffset()),V=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const P=s.point;if(s.setVis(!P.isNull)){const r=o.getPos(p,P.yGroup)*e,C=n.getUnitLen(b,P.xValue)*(1-h),k=t.getPointWidth(C,0);let L,N,M=l.start+n.getPos(b,P.xValue)-C/2;if(M+=k*x,M+=t.getPointPos(C)+k/2,a?f?(L=y+(o.getPos(p,P.yGroup)-y)*e,N=y):(L=p,N=o.getPos(p,P.yGroup*e)):f?(L=y+(o.getPos(p,P.yGroup)-y)*e,N=y):(L=r,N=0),s.setSector({cx:_,cy:c,rx:L,ry:L,innerRadius:N/L,start:M-k/2,angle:k,clockwise:!0}),M=s.start+s.angle/2,P.xPos=_+s.rx*d(M),P.yPos=c+s.ry*u(M),i&&(A=w.labelView=i.get(P,0))){A.layout(V);const{width:t,height:e}=A.getBBox(),i=s.ry,r=s.innerRadius*p;let o,h;o=a?f?P.yValue<m?"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?y+e/2+S:i-(i-y)/2+S:"outside"===v?i-e/2-S:"head"===v?g(y,i+e/2+S):"foot"===v?y-e/2-S:y-(y-i)/2-S:"outside"===v?r-e/2-S:"head"===v?g(p,r+e/2+S):"foot"===v?p-e/2-S:p-(p-r)/2-S:f?P.yValue<m?"outside"===v?i-e/2-S:"head"===v?i+e/2+S:"foot"===v?y-e/2-S:y-(y-i)/2-S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?y+e/2+S:i-(i-y)/2+S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:.7*i+S,h=c+o*u(M),o=_+o*d(M),"outside"!==v&&A.setContrast(s.dom),this.applyAutoRotation(A,M,l.total,n.options.totalAngle),A.trans(o-t/2,h-e/2)}}}))}}class $a extends Da{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new io(t,fa):new io(t,ma)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i);const r=e.options;this._rdTop=+r.topRadius||0,this._rdBottom=+r.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*y(t.point.width,1),t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}}class Fa extends Ba{constructor(t){super(t,"rct-bellcurve-series")}}class Ia extends ya{constructor(t){super(t,ca.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 $r(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new $r(t,"rct-boxplot-point-stem")),this.add(this._box=new zs(t,"rct-boxplot-point-box")),this.add(this._mid=new $r(t,"rct-boxplot-point-mid")),this.add(this._min=new $r(t,"rct-boxplot-point-min")),this.add(this._max=new $r(t,"rct-boxplot-point-max"))}}class za extends wa{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new io(this._pointContainer,Ia)}_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)}}class Ha extends va{}class Ga extends Sa{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new io(t,Ha)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Yo.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)}))}_getDefaultPos(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,p=this._labelViews(),g=s._xAxisObj,m=s._yAxisObj,f=this._polar=s.chart._body.getPolar(g),y=m.prev(r?t:e),x=g.prev(f?M:r?e:t),b=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:w,max:v}=s.getPixelMinMax(b),S=r?0:e,V=Is.getDrawer(i.shape);let A;this._markers.forEach(((i,h)=>{const b=i.point,P=p&&(A=p.get(b,0));if(i.setVis(!b.isNull&&!isNaN(b.zValue))){const h=(i._radius=s.getRadius(b.zValue,w,v))*o;let p,C;if(f){const t=f.start+g.getPos(x,b.xValue),e=m.getPos(f.rd,b.yValue);p=f.cx+e*d(t),C=f.cy+e*u(t)}else p=g.getPos(x,b.xValue),C=S-m.getPos(y,b.yValue),r&&(p=m.getPos(y,b.yValue),C=e-g.getPos(x,b.xValue));b.xPos=p,b.yPos=C,i.setVis(!n||p>=0&&p<=t&&C>=0&&C<=e)?(i.setPath(V(h)).trans(p,C).rotate(a),P&&(A.setContrast(i.dom).layout(c),this._layoutLabelView(A,l,_,h,p,C))):P&&P.setVis(!1)}else P&&P.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}}let ja=class extends ya{constructor(t){super(t,ca.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(g(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),o=g(n,r),a=m(1,f(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 $r(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new $r(t,"rct-candlestick-point-wick")),this.add(this._body=new zs(t))}};class Xa extends wa{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new io(this._pointContainer,ja)}_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)}}class Ya extends da{layout(t,e,s){const i=new qt;i.circle(t,e,s),this.setPath(i.end())}}class Wa extends Da{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new io(t,Ya)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}let Ua=class extends ya{constructor(t){super(t,ca.POINT_CLASS),this.add(this._line=new $r(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new ne(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new ne(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(_),r.setStyle("opacity",t.visible?"1":"0"),n.setStyle("opacity",e.visible?"1":"0"),this.x=this.tx+l,this._line.setVLine(l,0,i),Is.setShape(r,o.shape,a,a),Is.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};class Za extends wa{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new io(this._pointContainer,Ua)}_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)}}let qa=class extends mo{constructor(t){super(t,ca.POINT_CLASS),this._segments=new io(this,ne),this._decimal=0,this.add(this._back=new ne(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.setPath(Is.rectangle(e,s,i,-r)),this._segments.forEach(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(Is.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Is.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}};class Ka extends ba{constructor(t){super(t,"rct-equalizer-series"),this._bars=new io(this._pointContainer,qa)}_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(),d=t.getBaseValue(_)||0,u=_.getPos(_.options.reversed?0:e,d);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>=d?(e-u)/e*(n.yValue-d)/(i-d):u/e*(d-n.yValue)/(d-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)}}))}}let Qa=class extends ya{constructor(t){super(t,ca.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new $r(t)),this.add(this._whiskerUp=new $r(t)),this.add(this._whiskerDown=new $r(t)),this.add(this._back=new zs(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 Ja extends wa{constructor(t){super(t,"rct-errorbar-series"),this._bars=new io(this._pointContainer,Qa)}_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)}}class th extends da{}class eh extends Aa{constructor(t){super(t,"rct-funnel-series"),this._segments=new io(this._pointContainer,th),this.add(this._lineContainer=new oa(t))}_getPointPool(){return this._segments}getClipContainer(){return null}_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&&Yo.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_refreshZombie(){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=this._zombie,s=this._zombieRate,i=t.length;let r=0,n=0;if(t.forEach((t=>{r+=t.yValue*(t===e?s:t._isDeleted()?t._vr:1)})),i>1||i>0&&!e)if(1==i&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===i&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<i-1;o++){const i=t[o],a=R(i.yValue*(i===e?s:i._isDeleted()?i._vr:1)/r)||0;i.yRate=100*a,i.yPos=n,i.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==i){const e=t[0],i=R(s);n=1-i,e.yRate=100*i,e.yPos=n,e.height=i,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const s=function(t){return d?x+(V-x)*(w-t)/(w-A):x+(V-x)*(t-b)/(A-b)},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,d=i.options.reversed,u=n.options.opposite,p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),m=new qt,y=i.getCenter(t,e),x=y.x-p.width/2,b=y.y-p.height/2,w=b+p.height,v=x+p.width/2,S=p.height-g.height,V=x+(p.width-g.width)/2,A=d?w-S:b+S,P=[],C=new qt,k=(null==r?void 0:r.getWidth(0))||0;let L,N;this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach((i=>{const n=i.point;if(i.setVis(!n.isNull)){const y=n.yPos*p.height,x=(n.yPos+n.height)*p.height,M=d?w-y:b+y,E=d?w-x:b+x,T=x<S;let B,O,R,D;if(N=null==c?void 0:c.get(n),y>=S?(B=V,O=B+g.width,m.move(B,M).lines(O,M,O,E,B,E),i.ny=i.nx1=NaN):T?(B=s(M),O=B+2*(v-B),R=s(E),D=R+2*(v-R),m.move(B,M).lines(O,M,D,E,R,E),i.ny=NaN,i.nx1=R-B,i.nx2=D-B):(B=s(M),O=B+2*(v-B),R=V,D=R+g.width,m.move(B,M).lines(O,M,D,A,D,E,R,E,R,A),i.nx1=R-B,i.nx2=D-B,i.ny=f(A-M),i.nx3=R,i.nx4=D),i.setPath(m.close(!0)),n.xPos=v,n.yPos=M+(E-M)/2,r&&(L=r.get(n,0))&&L.visible){if(o){null==N||N.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),s=T?(O-B+(D-R))/2:g.width;switch(!t&&L.layout(_||"center"),l){case-1:L.trans(n.xPos-s/2+a,n.yPos-e.height/2);break;case 1:L.trans(n.xPos+s/2-e.width-a,n.yPos-e.height/2);break;default:L.trans(n.xPos-e.width/2,n.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,n,i,L,_,u,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,i,L,_,u,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!1,n,i,L,_,u,N,C,v,a,h);L.setContrast(o&&i.dom),P.push(L),L.setPosY(L.ty),this._layoutLabelRotation(L)}else N&&N.setVis(!1)}}));const M=n.options.convergent,E=n.options.dedupeMode,T=n.options.overflow;r&&(o||0===l?"preserveOrder"!==E&&"largestFirst"!==E||r.dedupe(P,c,E):(null==r?void 0:r.arrangeVertical(this,P,c,e,M,E,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,_,u,N,C,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,_,u,N,C,v,a,h,k,t,e):this.$_layoutLabelOutside(!0,i,s,L,_,u,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 d=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!d&&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?u.y+u.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+u.width:m+=c+_,i.trans(m,p-u.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d,u){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),m=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left"));const f=e.xPos=this.$_calcX(e,s,h,n);let y;if(y=n?_+l+c:d-_-c-l,o){const e=t?g.y+g.height/2-m:0;n?o.setLine(a.reset(0,0).line(y-f-_,e).end()):o.setLine(a.reset(0,0).line(y+_-f,e).end()),o.trans(f,m)}t||(n?y-=l+_+g.width:y+=_+l,i.trans(y,m-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,_){const c=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),u=e.yPos;!t&&!c&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-_,e).end()):o.setLine(a.reset(0,0).line(_,e).end()),o.trans(p,u)}t||(n?p-=_+l+d.width:p+=_+l,i.trans(p,u-d.height/2))}}let sh=class extends ua{layout(t,e){this.setPath(Is.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class ih extends xa{constructor(t){super(t,"rct-histogram-series"),this._bars=new io(this._pointContainer,sh)}_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,_=i?t:e,c=i?e:t,d=h.getPos(_,s.getBaseValue(h)),u=i?0:e,p=o&&l(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach(((s,l)=>{const g=s.point,m=a.getPos(c,g.min),f=a.getPos(c,g.max),y=h.getPos(_,g.yValue),x=f-m+(f>m?-1:1),b=y-d;let w=m+(f-m)/2,v=u;g.xPos=w,g.yPos=v-=y,this._layoutPoint(s,l,w,v+b,x,b*r),p&&(p.labelView=o.get(g,0))&&(i&&(v=c-w,w=u,g.yPos=v,g.xPos=w+=h.getPos(_,g.yGroup)),p.pointView=s,p.x=w,p.y=v,p.wPoint=x,p.hPoint=b,this._layoutLabel(n,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,d=i.getPos(e,o.point.yValue)*n,u=m(1,_-l-1);h.xPos=c,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(c,r)}))}}class rh extends mo{constructor(t){super(t,ca.POINT_CLASS),this.add(this._line=new $r(t,"rct-lollipop-point-bar")),this.add(this._marker=new ne(t,"rct-lollipop-point-marker"))}layout(t){var e;const s=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),Is.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class nh extends ba{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 io(this._pointContainer,rh)),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)}))}}class oh extends ya{constructor(t){super(t,ca.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(g(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(m(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 $r(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new $r(t,"rct-ohlc-point-tick")),this.add(this._bar=new $r(t)),this.add(this._back=new zs(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class ah extends wa{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new io(this._pointContainer,oh)}_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)}))}}class hh extends Ma{constructor(t){super(t,"rct-pareto-series")}}class lh extends ne{setOff(t){return this.off=f(t),this}}class _h extends Ro{constructor(t){super(t,ca.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class ch extends Jt{constructor(t){super(t,ca.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new Ro(t))}setSides(t,e,s,i,r){const n=this.point,o=R(N),a=R(((t?n.startAngle:n.startAngle+n.angle)+N/2+M)%M),h=R(a+(t?n.angle:-n.angle)-1e-4+M)%M,l=o-(a+f(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=N/2&&!(h>=a&&h<N/2)||h>=3*N/2&&!(a<h&&a>3*N/2)?(this._outArcView=i.setOff(g(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*N/2&&h<=N/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=N/2&&h<=3*N/2?(this._outArcView=i.setOff(g(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=i.setOff(l),a>=0&&a<=N&&this._outArcView.setOff(g(this._outArcView.off,this._side1View.off)),h>=N&&h<M&&this._outArcView.setOff(g(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,s){const i=Is.isCircled(s.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=s.innerRadius>0,o=s.depth,a=this._outPath,h=this._inPath,l=s.clockwise?s.angle:-s.angle;ot&&(r=this.control.getIEColor(r)),this._outArcView.setPath(Is.arc3d(s.cx,s.cy,s.rx,s.ry,o,s.start,s.start+l,s.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(Is.arc3dInner(s.cx,s.cy,s.rx*s.innerRadius,s.ry*s.innerRadius,o,s.start,s.start+l,s.clockwise,h)),this._side1View.setVis(!i),this._side2View.setVis(!i),this._side1View.visible&&(n?(this._side1View.setPath(Is.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(Is.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(Is.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(Is.polygon(s.cx,s.cy,a.x2,a.y2,a.x2,a.y2+o,s.cx,s.cy+o)))),this._sectorView._assignShape(s,!1),this._side1View.setStyle("fill",Dt.interpolate("#000",r,.2)),this._side2View.setStyle("fill",Dt.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",Dt.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",Dt.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(ca.DATA_FOCUS,t),this._side2View.setBoolData(ca.DATA_FOCUS,t),this._inArcView.setBoolData(ca.DATA_FOCUS,t),this._outArcView.setBoolData(ca.DATA_FOCUS,t)}contains(t){return super.contains(t)||this._side1View.contains(t)||this._side2View.contains(t)||this._inArcView.contains(t)||this._outArcView.contains(t)}setVis(t){return this._side1View.setVis(t),this._side2View.setVis(t),this._inArcView.setVis(t),this._outArcView.setVis(t),super.setVis(t)}addClass(t){return this._side1View&&(this._side1View.addClass(t),this._side2View.addClass(t),this._inArcView.addClass(t),this._outArcView.addClass(t)),super.addClass(t)}removeClass(t){return this._side1View&&(this._side1View.removeClass(t),this._side2View.removeClass(t),this._inArcView.removeClass(t),this._outArcView.removeClass(t)),super.removeClass(t)}trans(t,e){return this._side1View.trans(t,e),this._side2View.trans(t,e),this._inArcView.trans(t,e),this._outArcView.trans(t,e),super.trans(t,e)}transEx(t,e,s,i){return this._side1View.transEx(t,e,s,i),this._side2View.transEx(t,e,s,i),this._inArcView.transEx(t,e,s,i),this._outArcView.transEx(t,e,s,i),super.transEx(t,e,s,i)}}class dh extends Aa{constructor(t){super(t,"rct-pie-series"),this._deep=!1,this._pb=new qt,this._cx=0,this._cy=0,this._depth=0,this._ratio=1,this._rx=0,this._ry=0,this._rxInner=0,this._ryInner=0,this._slicedOff=0,this.add(this._circle=new To(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new vo(t,"rct-pie-series-inner")),this._textView._text.anchor=_e.MIDDLE,this._pointContainer.add(this._sideContainer=new ee(t,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new oa(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText,i=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.options.ratio:1,this.setBoolData("deep",i),this.$_prepareSectors(t,e,this._visPoints,i),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._deep?(this._ry=this._rx*this._ratio,this._ryInner=this._rxInner*this._ratio):(this._ry=this._rx,this._ryInner=this._rxInner),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rx=this.model.getRadius(t,e),this._rxInner=this.model.getInnerRadius(this._rx)}$_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._rx=n+(s._groupPos+s._groupSize)*o,this._rxInner=(n+s._groupPos*o)/this._rx}_runShowEffect(t){t&&Yo.grow(this,(t=>{const e=this._sectors.count>1&&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 _h||t instanceof ch)&&this.model.options.autoSlice){const e=this._sectors.count>1&&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)}_refreshZombie(){this._renderSeries(this.width,this.height)}focusPointView(t,e){t instanceof ch&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,s,i){const r=s.length;let n=this._sides;i!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(i?(this._sectors=new io(this._pointContainer,ch,null),n=this._sides=new io(this._sideContainer,lh,"rct-pie-series-side")):this._sectors=new io(this._pointContainer,_h,null)),this._deep=i,n&&n.prepare(4*r,((t,e)=>t.index=e)),this._sectors.prepare(r,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=this._zombie,s=this._zombieRate,i=t.length,r=this._model.options.clockwise?1:-1,n=t.filter((t=>(t.visible||t===e)&&!t.isNull)).map((t=>t.yValue*(t===e?s:t._isDeleted()?t._vr:1))).reduce(((t,e)=>t+e),0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%M;if(i>1||i>0&&!e)t.forEach((t=>{1===i&&t._isDeleted()||1===i&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=R(t.yValue*(t===e?s:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)}));else if(1==i){const e=t[0];e.startAngle=a,e.angle=r*s*o,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._rx,_=this._rxInner,c=this._depth,p=this._ratio,g=this._sides,m=i.pointLabel,x=m.connector.options.curved,b=this._labelViews(),w="inside"===i.getLabelPos(m),v=y(m.options.radius,.7),S=this._pb,V=m.getDistance(w,l,_),A=m.getAlign();let P=null==b?void 0:b.textAlign();const C=this._lineContainer.setVis(m.connector.visible)?this._lineContainer:null,k=this._slicedOff=i.getSliceOffset(l)*n,L=[],N=[],M=[],E=(null==b?void 0:b.getWidth(0))||0,T=this._sectors.count;let B,O;if(this._lineContainer.setStyleOrClass(m.connector.options.style),!b||P||A||(P="center"),this._textView.visible){const t=this._textView._icon,e=this._textView._text.getBBox();let s=a,i=h;if(t){const r=y(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._rx),this.$_calcAngles(t),this._sectors.forEach(((t,o)=>{const m=t.point;if(g){const e=4*o;t.setSides(r,g.get(e),g.get(e+1),g.get(e+2),g.get(e+3))}if(O=null==C?void 0:C.get(m),m.isNull)t.setVis(!1),b&&(B=b.get(m,0))&&B.setVis(!1),null==O||O.setVis(!1);else{const o=T>1&&m.sliced,g=m.startAngle,y=g+m.angle/2;let C=0,R=0;if(o&&n>=1&&!t.isDomAnimating()&&(C+=d(y)*k,R+=u(y)*k),t.trans(C,R).setVis(!0),m.xPos=a+d(y)*(k+l*v),m.yPos=h+u(y)*(k+l*v),t.render(b,null,{cx:a,cy:h,rx:l,ry:l*p,innerRadius:_,start:g,angle:f(m.angle),clockwise:r,depth:c}),b&&(B=b.get(m,0))){const r=i.getLabelOff2(m);let n;w?(null==O||O.setVis(!1),this.$_layoutLabelInside(m,B,P,r,V,o?k:0)):(n=-1===A?this.$_layoutLabelAligned(!1,m,B,P,O,S,x,r,V,o?k:0):1==A?this.$_layoutLabelEnded(!1,m,B,P,O,S,x,r,V,o?k:0,E,e,s):this.$_layoutLabelOutside(!1,m,B,P,O,S,x,r,V,o?k:0),n?L.push(B):N.push(B)),B.setContrast(w&&t.dom).setVis(!0),M.push(B),this._layoutLabelRotation(B)}else null==O||O.setVis(!1)}})),g&&g.sortDom(((t,e)=>{let s=e.off-t.off;return 0===s&&(s=t.index-e.index),s}));const R=m.options.convergent,D=m.options.dedupeMode,$=m.options.overflow;b&&(w||0===A?"preserveOrder"!==D&&"largestFirst"!==D||b.dedupe(M,C,D):b.arrangeVertical(this,L,C,s,R,D,$)+b.arrangeVertical(this,N,C,s,R,D,$)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=T>1&&r.sliced,n=i.getLabelOff2(r);B=b.get(r,0),O=null==C?void 0:C.get(r),(null==B?void 0:B.visible)&&(-1===A?this.$_layoutLabelAligned(!0,r,B,P,O,S,x,n,V,t?k:0):1==A?this.$_layoutLabelEnded(!0,r,B,P,O,S,x,n,V,t?k:0,E,e,s):this.$_layoutLabelOutside(!0,r,B,P,O,S,x,n,V,t?k:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,p=this._cx,g=this._cy,m=this._rx,f=this._ry,y=m+l,x=f+l,b=p+d(c)*y,w=g+u(c)*x,v=b<p;!t&&!_&&s.layout(i||(v?"right":"left"));const S=s.getBBox(),V=w-S.height/2;let A,P,C,k=g+u(c)*f;if(v?(A=p+d(Math.PI)*m-h,P=A-S.width-a,C=p+d(Math.PI)*y-h,S.width):(A=p+d(0)*m+h,P=A+a,C=p+d(0)*y+h),r&&r.setVis(y>0)){const e=t?s.ty-V:0;o?r.setLine(n.reset(0,e).quad(.7*(b-A),e,b-A,0).end()):r.setLine(n.reset(0,e).line(b-A,0).end()),r.setPos(A,k),!_&&r.trans(A,w)}return t||(s.setPos(P,k-S.height/2),!_&&s.trans(P,k-S.height/2)),v}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,p){const g=s.isDomAnimating(),m=e.startAngle+e.angle/2,f=this._cx,y=this._cy,x=this._rx,b=this._ry,w=x+l,v=b+l;let S=f+d(m)*w,V=y+u(m)*v;const A=S<f;!t&&!g&&s.layout(i||(A?"right":"left"));const P=s.getBBox(),C=V-P.height/2;let k,L,N,M=y+u(m)*b;if(A?(k=h+_+a,N=h+_-P.width,L=k):(k=c-h-_-a,N=c-h-_,L=k),r&&r.setVis(w>0)){const e=t?s.ty-C:0;o?r.setLine(n.reset(0,e).quad(0,e,S-L,0).end()):r.setLine(n.reset(0,e).line(S-L,0).end()),r.setPos(k,M),!g&&r.trans(L,V)}return t||(s.setPos(N,M-P.height/2),!g&&s.trans(N,M-P.height/2)),A}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating();!t&&!_&&s.layout(i);const c=s.getBBox(),p=e.startAngle+e.angle/2,g=this._cx,m=this._cy,f=this._rx+.5*h,y=this._ry+.5*h,x=d(p)*l,b=u(p)*l,w=g+d(p)*this._rx,v=m+u(p)*this._ry,S=g+d(p)*f;let V=m+u(p)*y;const A=S<g;let P,C;return A?(P=S-.2*h,C=P):(P=S+.2*h,C=P),r&&r.setVis(f>0)&&(o?r.setLine(n.reset(0,0).quad(S-w,V-v,P-w,V-v).end()):r.setLine(n.reset(0,0).lines(S-w,V-v,P-w,V-v).end()),r.setPos(w,v),!_&&r.trans(w+x,v+b)),t||(A?C-=c.width+a:C+=a,V-=c.height/2,s.setPos(C,V),!_&&s.trans(C+x,V+b)),A}$_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 d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=g(a.options.totalAngle||360,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(d.width/2,d.height/2,i)}else this.applyAutoRotation(e,p,t,s)}const m=h.options.align===Ws?.3:h.options.align===Ys?.5:.7,f=u>0?u+(this._rx-u)/2:l?"angle"===_?this._rx*m+i:.8*this._rx+i:.7*this._rx+i,y=this._deep?f*this._ratio:f,x=Math.cos(p),b=Math.sin(p);let w=this._cx+x*f,v=this._cy+b*y;e.move(w-d.width/2,v-d.height/2),w=this._cx+x*(n+f),v=this._cy+b*(n+y),e.trans(w-d.width/2,v-d.height/2)}$_slice(t,e,s){if(e&&this._sectors.count<2)return;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,u(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,p=_.connector.options.curved,g="inside"===i.getLabelPos(_),m=r.get(h,0),f=i.pointLabel.getDistance(g,this._rx,this._rxInner);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,p,_.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))}}}class uh extends va{setHoverRate(t,e,s){const i=this.point,r=Is.getDrawer(t.model.getShape(i)),n=(+t.model.options.hoverScale||1.8)-1;let o=t._radius;e?this._hoverRadius=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._hoverRadius}}class ph extends Sa{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new io(t,uh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Yo.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)}))}_getDefaultPos(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,p=+i.jitterX||0,g=+i.jitterY||0,m=s.pointLabel,f=m.options.position,y=m.getOffset(),x=this._labelViews(),b=a.prev(r?t:e),w=o.prev(h?h.total:r?e:t),v=r?0:e;let S;this._markers.forEach(((i,m)=>{const V=i.point,A=x&&(S=x.get(V,0));if(i.setVis(!V.isNull)){const m=Is.getDrawer(s.getShape(V)),x=at.jitter(V.xValue,p),P=at.jitter(V.yGroup,g);let C,k;if(h){const t=h.start+o.getPos(w,x),e=a.getPos(h.rd,P)*l;C=h.cx+e*d(t),k=h.cy+e*u(t)}else C=o.getPos(w,x),k=v-a.getPos(b,P),r&&(C=a.getPos(b,P),k=e-o.getPos(w,x));if(V.xPos=C,V.yPos=k,i.setVis(!!h||!n||C>=0&&C<=t&&k>=0&&k<=e)){const t=i._hoverRadius||_;i.setPath(m(t)),i.trans(C,k).rotate(c),A&&this._layoutLabelView(S,f,y,t,C,k)}else A&&A.setVis(!1)}else A&&A.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}}class gh extends wa{constructor(t){super(t,"rct-waterfall-series"),this._bars=new io(this._pointContainer,ma),this.add(this._lineContainer=new ee(t,"rct-waterfall-series-lines")),this._lines=new io(this._lineContainer,$r)}_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,s,i){super._prepareSeries(t,e,s,i),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,0,0,this._inverted),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}))}}function mh(t,e){return new(Do[e._type()])(t)}function fh(t,e){return new(ha[e._viewType()])(t)}ca.register([Ur,Ba],[Kr,Ta],[Er,$a],[Lr,Oa],[en,Fa],[rn,za],[on,Ga],[ln,Xa],[cn,Wa],[gn,Za],[fn,Ka],[yn,Ja],[vn,eh],[An,ih],[Xr,Ea],[kn,nh],[Nn,ah],[En,hh],[$n,dh],[zn,ph],[jn,gh]),$o.register([dr,ka],[_r,Pa],[cr,Ca]);class yh extends fo{constructor(t){super(t,"rct-axis-grid"),this._lines=new io(this,$r)}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this._model,e=t.options,s=t.axis,i=s.options.reversed,r=this.width,n=this.height,o=s.isEmpty()?[]:t.getPoints(s,s._isHorz?r:n),a=this._lines.prepare(o.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),h=a.count-1;let l;a.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",o[e]===(s._isHorz?r:n))}));const _=null==e.firstVisible?t.visible:e.firstVisible,c=null==e.lastVisible?t.visible:e.lastVisible;if(s._isHorz){const e=y(s._prevRate,1);a.forEach(((a,d)=>{l=0===d?_:d===h?c:t.visible,a.setVis(l)&&a.setVLine(s.prev(o[d])+(i?r*(1-e):0),0,n)}))}else{const e=i?y(s._prevRate,1):1;a.forEach(((i,a)=>{o[a],l=0===a?_:a===h?c:t.visible,i.setVis(l)&&i.setHLine(n*e-s.prev(o[a]),0,r)}))}}}class xh extends Jt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new ne(t)),this._mask.setStroke("none"),this.add(this._upLine=new ne(t)),this._upLine.setFill("none"),this.add(this._downLine=new ne(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this.isClip(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 qt;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 bh extends Jt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new vo(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)}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 wh extends bh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Oo:$r)(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=y(n.offsetX,0),_=y(n.offsetY,0);let c,d;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":d="inside"===n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="inside"===n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(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":d=r+_;break;case"middle":d=r-h.height/2-_;break;default:d=r-h.height-_}}}a.visible&&a.trans(c,d)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.options.value)&&i.label.visible)&&this._labelView,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(U,"none"),n&&n.trans(s.cx+a*d(s.start),s.cy+a*u(s.start))}}class vh extends bh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?Ro:Hs)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e);const s=e.options,i=g(s.startValue,s.endValue),r=m(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(),_=y(r.offsetX,0),c=y(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,o),d=s.axis.getPos(t,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(d!==i))){let s,o;switch(r.align){case"center":s=i+(d-i-l.width)/2+_;break;case"right":s=d-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":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,d,e),h&&h.trans(m(0,g(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),d=e-s.axis.getPos(e,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(i!==d))){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="inside"===r.position?t-l.width-_:t+_;break;default:e="inside"===r.position?_:-1*(l.width+_)}switch(r.verticalAlign){case"bottom":s=i-l.height-c;break;case"middle":s=d+(i-d-l.height)/2-c;break;default:s=d+c}h&&h.trans(e,s),n.setBox(0,d,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,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:M,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*d(s.start),s.cy+t*u(s.start))}}}class Sh extends ee{constructor(){super(...arguments),this._views=new io(this,ne)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e){const s=this._rows;this._views.prepare(s.length),this._views.forEach(((i,r)=>{const n=s[r],o=n.axis,a=Math.max(o.axisMin(),n.from),h=Math.max(o.axisMax(),n.to);if(n.axis._isHorz){const s=m(0,g(t,o.getPos(t,a))),r=m(0,g(t,o.getPos(t,h)));i.setPath(Is.rectangle(s,0,r-s,e))}else{const s=m(0,g(e,o.getPos(e,a))),r=m(0,g(e,o.getPos(e,h)));i.setPath(Is.rectangle(0,e-s,t,s-r))}i.setFill(n.color)}))}}class Vh extends ee{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof vh?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof es?i=this._rangePool.pop()||new vh(t,s):e instanceof ts&&(i=this._linePool.pop()||new wh(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Ah extends ne{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 qt;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 yi&&(l=_(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 Ph extends Eo{constructor(t){super(t,"Reset Zoom",Ph.CLASS_NAME),this.setVis(!1)}}Ph.CLASS_NAME="rct-reset-zoom";class Ch extends ee{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new zs(t,"rct-empty-view-back")),this.add(this._labelView=new vo(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 kh extends ee{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new io(this,$r)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,_=a.isEmpty()?[]:o.getPoints(a,a._isHorz?r-l:n-h);this._lines.prepare(_.length,((e,i)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),s?e.setLine(0,n-_[i],r,n-h-_[i]):e.setLine(_[i]+l,0,_[i],n)}))}}class Lh extends ee{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new ne(t)),this.add(this._gridContainer=new ee(t,"rct-body-depth-grids")),this.add(this._lineView=new $r(t,"rct-body-depth-side-line")),this.add(this._endView=new $r(t,"rct-body-depth-side-line"))}layout(t,e,s,i,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,s,i,n,o),this.$_renderGrids(t,e,r,s,i,n,o)}$_renderBack(t,e,s,i,r,n){const{side:o,base:a}=i,h=this._lineView,l=this._endView;t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e._style),h.setVis(e.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(e.line._style)),l.setVis(e.endLine.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(e.endLine._style)),s?(t.setPath(Is.polygon(0,o,a,0,a,n-o,0,n)),h.visible&&h.setVLineC(0,o,n),l.visible&&l.setLine(0,o,r,0)):(t.setPath(Is.polygon(a,0,r,0,r-a,o,0,o)),h.visible&&h.setHLineC(n,0,r-a),l.visible&&l.setLine(r,0,r-a,n))}$_renderGrids(t,e,s,i,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())s.has(t)||(h.delete(t),e.remove());for(const[l,_]of s.entries())if(l._isX===this.isX){let s=h.get(l);s||(s=new kh(t),h.set(l,s),a.add(s)),s.layout(e,_,i,r,n,o)}}}class Nh extends ee{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new Lh(t,!0)),this.add(this._ySideView=new Lh(t,!1)),this.add(this._orgLineView=new $r(t,"rct-body-depth-org-line"))}render(t,e,s,i,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,_=this._ySideView;l.setVis(s.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,s.xSide,e,r,i)),_.setVis(s.ySide.visible)&&(e?_.setBounds(0,o-h,n,h):_.setBounds(0,0,a,o),_.layout(t,s.ySide,!e,r,i)),this._orgLineView.setVis(s.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class Mh extends fo{constructor(t,e){super(t,Mh.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._hoverPointSeries=[],this._owner=e,this.add(this._hitTester=new zs(t)),this._hitTester.setFill("transparent"),this.add(this._background=new ne(t,"rct-body-background")),this.add(this._depthLayer=new Nh(t)),this.add(this._image=new wo(t,!0,"rct-body-image")),this.add(this._emptyView=new Ch(t)),this.add(this._gridRowContainer=new Sh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new ee(t,"rct-axis-grids")),this.add(this._baseContainer=new ee(t,"rct-axis-bases")),this.add(this._guideContainer=new Vh(t,"rct-axis-guides")),this.add(this._annotationContainer=new ee(t,"rct-annotations")),this.add(this._seriesContainer=new ee(t,"rct-series-container")),this.add(this._axisBreakContainer=new ee(t,"rct-axis-breaks")),this.add(this._labelContainer=new ee(t,"rct-label-container")),this.add(this._frontGuideContainer=new Vh(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new ee(t,"rct-front-annotations")),this.add(this._feedbackContainer=new ee(t,"rct-feedbacks")),this.add(this._zoomButton=new Ph(t)),this._crosshairViews=new io(this._feedbackContainer,Ah)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,s){const i=e.chart,r=e.depth.visible;this._animatable=Qt._animatable&&i.animatable(),this._polar=s,this._prepareSeries(t,e,i._getSeries().getVisibleSeries(),r),i._getGauges()&&this._prepareGauges(t,i,i._getGauges().getVisibles()),this._prepareAnnotations(t,i._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,s){return this._depthExt=t._body._getDepth(e,s)}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(ca.isPointDom(e))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,d=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),u=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach((e=>{e.setVis(u)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(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 Gr)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=y(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?f(e.pv.pv.point.xPos-t.x)<f(s.pv.pv.point.xPos-t.x)?e:s:f(e.pv.pv.point.yPos-t.y)<f(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=y(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.forEach((r=>{if(r.getHintDistance&&(s=y(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._owner,r=this.chart(),n=null==t?void 0:t.model,o=this.chart().chartOptions.pointHovering,a=this._focused,h=this._siblings,l=this._siblingSeries;let _,c,d;if(n&&n.options.interactive&&e&&o.visible)switch(o.getScope(n,e.point)){case"axis":d=n._xAxisObj.getSeries();case"group":d||(d=n._group.getVisibleSeries());const r=d.map((t=>{if(t instanceof Ki){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 on){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)}));_=d.map((t=>i.getSeriesView(t))),c=[],r.forEach(((t,e)=>{c.push(_[e].getPointView(t))}));break;default:_=[t],c=[e]}let u=[];if(_&&_.forEach(((t,e)=>{u.push(...t.getSiblings(c[e]))})),u=u.length>1?u.sort(((t,e)=>t.hash-e.hash)):u.length>0?u:null,at.equalArrays(h,u)||(_&&_.forEach(((t,e)=>{t.focusPoints(t.getSiblings(c[e]))})),l&&l.forEach((t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=_,this._siblings=u),e!==a){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,n&&n.options.interactive&&this.$_focusSeries(t,!0),n&&r.chartOptions.options.seriesHovering&&n.options.interactive&&this.$_hoverSeries(t))}this._focused&&n&&n.options.interactive&&(this._focused!==a||!i.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?i.showTooltip(n,e,[],this,s):i.hideTooltip():!this._focused&&i.tooltipVisible()&&i.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(ca.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(ca.DATA_UNHOVER,t&&e!==t)}))}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(s.hoverPoint(t),this._hoverPointSeries.push(s)):this._hoverPointSeries&&(this._hoverPointSeries.forEach((t=>t.hoverPoint(null))),this._hoverPointSeries.length=0)}clearHover(){this.hoverPoint(null),this.hoverSeries(null),this._seriesViews.forEach((t=>t.focusPoints(null))),this.removeFocus()}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}annotationByDom(t){return this._annotationViews.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 va&&e.endHover(t,!1),e.setBoolData(ca.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=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:s,l=a?a.hBody:i;if(this._zoomRequested=!1,this.isClip(this._seriesClip)||(this._seriesClip=n.clipBounds(),this._seriesClip2=n.clipBounds(),this._bodyClip=n.clipBounds()),this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||o.isWidget()),this._seriesViews.forEach(((e,s)=>{e.measure(t,this._series[s],h,l,r)})),!this._polar){this.$_prepareGrids(t,o);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,h,l,r);this.$_prepareAxisBreaks(t,o)}return this._gaugeViews.forEach(((e,s)=>{e.measure(t,this._gauges[s],h,l,r)})),this._annotationViews.forEach(((e,s)=>{e.measure(t,this._annotations[s],h,l,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)}_renderBackground(t,e,s){t.setPath(Is.rectangle(0,0,e,s))}_setImage(t,e,s,i){if(e.setVis(t.visible&&!!t.options.url))return e.setImage(t.options.url,s,i),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const s=this._depthExt,i=this.width,r=this.height;let n=s?s.wBody:i,o=s?s.hBody:r,a=s?s.base:0;if(this._inverted){const t=s?s.side:0;this._seriesClip.setBounds(-t,-n,r,i),this._seriesClip2.setBounds(-t,0,i,r)}else this._seriesClip.setBounds(-a,0,i,r),this._seriesClip2.setBounds(-a,0,i,r);if(this._bodyClip.setBounds(0,0,n,o),this._hitTester.trans(a,0).resize(n,o),this._background.trans(a,0).resize(n,o),this._seriesContainer.trans(a,0),this._renderBackground(this._background,n,o),this._setImage(e.image,this._image,n,o),this._depthLayer.setVis(!this._polar&&s&&s.depth>0),this._seriesViews.forEach((t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(s),t.resize(n,o),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){this._depthLayer.render(t.doc(),this._inverted,e.depth,this._gridViews,s,this.width,this.height);for(const t of this._gridViews.values())t.resize(n,o),t.trans(a,0),t.layout();for(const t of this._baseViews.values()){const e=t.tag;t.setStyleOrClass(e.baseLine._style),e._isHorz?t.setVLine(e.getPos(n,e.getBaseValue()),0,o):t.setHLine(o-e.getPos(o,e.getBaseValue()),0,n)}if(this._breakViews.forEach((t=>{const e=t._model,s=e.axis;s._isHorz?s.options.reversed?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):s.options.reversed?t.trans(0,e._sect.pos):t.trans(0,o-e._sect.pos-e._sect.len),t.layout(n,o,e.axis._isHorz)})),this.isClip(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.setVis(t._views.length>0)&&(t._views.forEach((t=>t.visible&&t.layout(n,o))),t.setClip(this._guideClip))})),this._gridRowContainer.layout(n,o),this._gridRowContainer.trans(a,0)}this.$_prepareCrosshairs(e.chart),this._gaugeViews.forEach((t=>{t.resizeByMeasured(),t.layout().transp(t.getPosition(n,o))})),this._layoutAnnotations(this._inverted,this,n,o),this._zoomButton.visible&&this._zoomButton.trans(n-this._zoomButton.getBBox().width-10,10),this._emptyView.setVis(this.$_isEmptyVisible(e))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(e.emptyView,n,o))}$_isEmptyVisible(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&&!1!==t.emptyView.visible}$_createGaugeView(t,e){return new(Fo[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())s&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())s&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof xr)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));s&&[e._getXAxesAtPane(a,h,!0),e._getYAxesAtPane(a,h,!0)].forEach((e=>e.forEach((e=>{const s=e.grid;if(!r.has(e)&&(s.visible||s.options.firstVisible||s.options.lastVisible)){const s=new yh(t);r.set(e,s),i.add(s)}if(e instanceof xr&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new $r(t,"rct-axis-baseline");o.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s,i){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=i?e.depth:null;for(const t of o.keys())s.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=s,a.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove())})),a.length=0,s.forEach((e=>{const s=o.get(e)||fh(t,e);s._setChartOptions(n,this._animatable,r.loadAnimatable()),s.parent||(this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer)),o.set(e,s),a.push(s),s.prepareSeries(t,e,this._polar,h)})),this._seriesContainer.sort(a),a.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)||mh(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=this.getCol(),n=this.getRow(),o=[];for([e._getXAxesAtPane(r,n,!1),e._getYAxesAtPane(r,n,!1)].forEach((t=>t.forEach((t=>{t instanceof br&&o.push(...t._getBreaks())}))));i.length<o.length;){const e=new xh(t);s.add(e),i.push(e)}for(;i.length>o.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(o[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=this.getCol(),i=this.getRow(),r=[];t._needAxes()&&[t._getXAxesAtPane(s,i,!0),t._getYAxesAtPane(s,i,!0)].forEach((t=>t.forEach((t=>{t.crosshair.visible&&r.push(t.crosshair)})))),e.prepare(r.length,((t,e)=>{t.setModel(r[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)}))}}Mh.BODY_CLASS="rct-body";class Eh extends Jt{constructor(t){super(t,Th.HANDLE_STYLE),this.add(this._back=new zs(t)),this.add(this._shape=new ne(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*g(t,e);const r=new qt;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 Th extends fo{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(Th.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Th.MASK_STYLE)}constructor(t){super(t,Th.CLASS_NAME),this.add(this._back=new zs(t,Th.BACK_STYLE)),this.add(this._container=new ee(t,null)),this.add(this._mask=new zs(t,Th.MASK_STYLE)),this.add(this._trackView=new zs(t,Th.TRACK_CLASS)),this.add(this._thumbView=new zs(t,Th.THUMB_CLASS)),this.add(this._startHandle=new Eh(t)),this.add(this._endHandle=new Eh(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=fh(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1,null)}$_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 Mo(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 Mo(t)),i._simpleMode=!0)}}Th.CLASS_NAME="rct-navigator",Th.BACK_STYLE="rct-navigator-back",Th.MASK_STYLE="rct-navigator-mask",Th.HANDLE_STYLE="rct-navigator-handle",Th.HANDLE_BACK_STYLE="rct-navigator-handle-back",Th.TRACK_CLASS="rct-navigator-track",Th.THUMB_CLASS="rct-navigator-thumb";class Bh extends le{constructor(t){super(),this.chart=t}}class Oh extends Bh{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=m(0,e-(o.x-n.x)),this._yStart=m(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new zs(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=m(0,g(i.height,e-(i.y-s.y))),this._body.setZoom(0,g(m(0,this._yStart),e),this._body.width,m(g(this._yStart,i.height),e))):(t=m(0,g(i.width,t-(i.x-s.x))),this._body.setZoom(m(0,g(this._xStart,t)),0,m(g(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=m(0,g(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,g(this._yStart,r),this._body.width,f(this._yStart-r))):(i=m(0,g(o.width,i-(o.x-n.x))),this._feedback.setBounds(g(this._xStart,i),0,f(this._xStart-i),this._body.height)),!0}}class Rh extends Bh{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=Math.floor(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)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class Dh extends Bh{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,c=a*h/n.width+l;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(c,NaN,_):o.zoom(l,NaN,_):a>0&&a<n.width?o.zoom(NaN,c,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class $h extends Bh{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=m(0,g(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class Fh{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&&(f(this._clickX-i)>3||f(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)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;const s=this._chart.model,i=this._chart.chartView(),r=this._clickElement,n=i.getButton(r);let o,a,h,l,_;const c=this._chart.chart.exporter;if(c.isContextMenuVisible()&&c.toggleContextMenu(),n)!0!==n.click()&&i.buttonClicked(n);else if(a=i.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:s.wrapper,source:a.legend.getSources(a)})){at.makeArray(a.legend.getSources(a),!0).forEach((t=>{if(t instanceof ci){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof Aa&&t.togglePointVisible(e)}}else a.source.visible=!a.source.visible,i.bodyView().hoverSeries(a.source.visible?a.source:null)}))}}else(h=i.seriesByDom(r))?h.clicked(r):(_=i.htmlButtonByDom(r))?_.click():(l=i.annotationByDom(r))?l.clicked():(o=i.creditByDom(r))&&o.clicked(r)}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 Lo.isThumb(t)?new Rh(this._chart,i.getScrollView(t)):Th.isHandle(t)?new Dh(this._chart,i._navigatorView,t):Th.isMask(t)&&r&&r.model.isZoomed()?new $h(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Oh(this._chart,r,i._inverted):void 0}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(t,e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,s,i,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,i-e,r-s)),this._dragTracker){if(this._dragTracker.start(t,e,s,i,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,s,i),this._dragTracker=null)}}class Ih extends ee{constructor(t){super(t,Ih.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new ue(t,"rct-history-item");e.anchor=_e.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new ue(t);e.anchor=_e.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let 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)}}Ih.TITLE_CLASS="rct-history";class zh extends fo{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new zs(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new ue(t,"rct-legend-item-label")),this._label.anchor=_e.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():ro,l=oo(this._label.getBBox());return this._gap=y(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:m(h.height,l.height)}}_doLayout(t){const e=this._rMarker,s=y(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 Hh extends yo{constructor(t){super(t,Hh.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new io(this,zh)}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=y(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?y(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 d,u=_,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor(),r=e.legendStroke();t._marker.setColor(i),r&&t._marker.setStroke(r),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(d=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=_,"center"!==r&&"end"!==r||(d=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-d)/2:this.width-d),t.forEach((t=>{t.trans(u,p),u+=t.width+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(),d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,f,y,x;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,c)),e.measure(t,a[s],r,n,1)}));let b=0,w=0;if(s){for(;b<d;)x=h.get(b),w%i==0?(u.push(y=[x]),f=x.mh,w++,b++):(f+=l+x.mh,f<=n?(y.push(x),w++,b++):w=0);this._wMarkers=[],g=f=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=m(s,t.mw),r=m(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),f=m(f,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;b<d;)x=h.get(b),w%i==0?(u.push(y=[x]),g=x.mw,w++,b++):(g+=l+x.mw,g<=r?(y.push(x),w++,b++):w=0);g=f=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=m(s,t.mh)})),e+=l*(t.length-1),g=m(g,e),f+=s,p.push(s)})),f+=_*(u.length-1)}return{width:g,height:f}}}Hh.LEGEND_CLASS="rct-legend";class Gh extends Jt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new To(t))}layout(){}}class jh extends Jt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new ee(t,"rct-polar-axis-markers")),this._markViews=new io(this._markContainer,Gh),this.add(this._gridContainer=new Jt(t,"rct-polar-axis-grids")),this._labelViews=new io(this._labelContainer=s,Co,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,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,o=s.getLabelStyle(e,i);if(t.value=e.value,null!=r){n&&r.match(No)?t.setLabel(s,o,e,r.replace(No,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(s.visible&&e.checkVisible()){const t=e._ticks,{start:i,total:r}=s.chart._body.getPolar(e),n="auto"===s.options.rotation,o=t.length;this._labelContainer.setStyleOrClass(s._style),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:d}=a.getBBox();a.setRotation(c/2,d/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 Xh extends jh{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new io(this._gridContainer,$r,Xh.GRID_CLASS),e.insertFirst(this._startView=new $r(t,Xh.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new $r(t,Xh.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Oo(t,Xh.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const o=t.getStartAngle(),a=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*a/M)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+d(o+h)*i,_=s+u(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;if(n>0){const a=Math.ceil(9/(360/n)),h=i+t.tick._getLength(),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(),c=t.angle=o+n.pos,p=e+d(c)*(h+a.width/2)-a.width/2,g=s+u(c)*(h+a.height/2)-a.height/2;t.trans(p,g),_.push(t)}}));const c=_.length;c>2&&(f(_[c-1].angle-_[c-2].angle)<M/24||at.diffAngle(_[c-1].angle,_[0].angle)<M/24)&&_[c-1].setVis(!1)}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+d(o)*i,s+u(o)*i),r.map((t=>{const r=t.pos;h.push(e+d(o+r)*i,s+u(o+r)*i)})),n&&r[r.length-1].pos<a&&h.push(e+d(o+a)*i,s+u(o+a)*i),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e,s,e+d(o)*i,s+u(o)*i),this._endView.setLine(e,s,e+d(o+a)*i,s+u(o+a)*i))}}Xh.LINE_CLASS="rct-polar-xaxis-line",Xh.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",Xh.GRID_CLASS="rct-polar-xaxis-grid-line";class Yh extends jh{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new io(this._gridContainer,Oo,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new $r(t,"rct-polar-yaxis-line")),e.add(this._baseView=new Oo(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,s,i){const r=t.line,n=t instanceof xr&&t.baseLine;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridViews.prepare(e.length,null),this._lineView.setVis(r.visible)&&this._lineView.setStyleOrClass(r._style),this._baseView.setVis(n.visible&&t.isBaseVisible())&&this._baseView.setStyleOrClass(n._style)}_doLayout(t,e,s,i,r,n){function o(t,i){if(t.setFill("none"),a)t.setArc(e,s,i,_,c,!0);else{const r=[];l&&h[0].pos>0&&r.push(e+d(_)*i,s+u(_)*i),h.forEach((t=>{const n=t.pos;r.push(e+d(_+n)*i,s+u(_+n)*i)})),l&&h[h.length-1].pos<c&&r.push(e+d(_+c)*i,s+u(_+c)*i),t.setPolyline(r)}}const a=this._circular,h=n._ticks,l=n.isArced(),_=n.getStartAngle(),c=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach(((e,s)=>{o(e,r[s].pos),e.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",i="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(l){const t=n.getStartAngle();this._labelViews.forEach(((n,a)=>{const h=n.getBBox();n.setContrast(null).trans(e+d(t)*r[a].pos-h.width*i+o,s+u(t)*r[a].pos-h.height/2)}))}else this._labelViews.forEach(((t,n)=>{const a=t.getBBox();t.setContrast(null).trans(e-a.width*i+o,s-r[n].pos-a.height/2)}))}this._lineView.visible&&(l?this._lineView.setLine(e,s,e+i*d(_),s+i*u(_)):this._lineView.setVLine(e,s,s-i)),this._baseView.visible&&o(this._baseView,t.getPos(i,t.getBaseValue()))}}class Wh extends Mh{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._circular=this.model.options.circular,this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,s){const{cx:i,cy:r,rd:n}=this.model.getPolar(null);t.setPath(Is.circle(i,r,n))}_setImage(t,e,s,i){const{cx:r,cy:n,rd:o}=this.model.getPolar(null);if(super._setImage(t,e,2*o,2*o))return e.trans(r-o,n-o),this.isClip(this._polarBodyClip)||(this._polarBodyClip=this.control.clipCircle()),this._polarBodyClip.setCircle(o,o,o),e.setClip(this._polarBodyClip),!0}_doLayout(){const t=this.width,e=this.height,s=this.model.setPolar(t,e),{cx:i,cy:r,rd:n}=s.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(s.image,this._image,t,e),this._seriesViews.forEach((t=>{var e;t.setCircular(this._circular),t.model.needClip(!0)&&(this.isClip(this._polarClip)||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(i,r,n),t.getClipContainer().setClip(this._polarClip),null===(e=t.getClipContainer2())||void 0===e||e.setClip(this._polarClip)),t.resize(2*n,2*n),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisContainer.visible&&this._xAxisView.layout(s.chart.yAxis,i,r,n),this._yAxisViews.forEach((t=>{t.layout(s.chart.xAxis,i,r,n)})),[this._guideContainer,this._frontGuideContainer].forEach((t=>{t._views.forEach((t=>t.visible&&t.layout(this.width,this.height,s.getPolar(t.model.axis))))})),this._layoutAnnotations(!1,this,t,e)}_prepareAxes(t,e,s,i,r){if(!this._xAxisContainer){const e=this._image;this.insertAfter(this._xAxisLabelContainer=new ee(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),e),this.insertAfter(this._yAxisLabelContainer=new ee(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),e),this.insertAfter(this._lineContainer=new ee(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new ee(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new ee(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<s.length;){const e=new Yh(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.setVis(!0),e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new Xh(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class Uh extends yo{constructor(t,e){super(t,e?Uh.SUBTITLE_CLASS:Uh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new ue(t)),this._richText=new ve}_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),oo(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var Zh,qh;Uh.TITLE_CLASS="rct-title",Uh.SUBTITLE_CLASS="rct-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Zh||(Zh={}));class Kh extends Jt{constructor(t){super(t,Kh.CLASS_NAME),this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new ne(t,"rct-tooltip-back")),this.add(this._top=new ne(t,"rct-tooltip-top")),this.add(this._textView=new ue(t,"rct-tooltip-text")),this._back.setAttr("filter","url(#"+Qt.SHADOW_FILTER+")"),this._textView.anchor=_e.START,this._richText=new ve,this.close(!0,!1)}show(t,e,s,i,r,n,o){const a=s.point,h=this._model=t.chart._tooltip,l=h.setTarget(t,a,i&&i.map((t=>t.point)));if(!l)return;const _=h.options,c=_.text||l.getTooltipText(t,a);if(!c||!c.trim())return;this.setStyleOrClass(h._style);const d=e.contentWidth(),u=e.contentHeight(),p=this._textView,f=h.getHeaderHeight(),y=h.getTailSize(),x=t.chart.isInverted(),b=t._yAxisObj;let w=b.options.reversed;t instanceof Xi&&t.getBaseValue(b)>s.point.yValue&&(w=!w),this._richText.setFormat(c),this._richText.build(p,NaN,NaN,null,h.getTextDomain());const v=p.getBBox();let S=m(_.minWidth||0,v.width+16),V=m(_.minHeight||0,v.height+12)+f,A=t._calcedColor;t instanceof zi?(t.options.legendByPoint||t._colorByPoint())&&(A=a._calcedColor):t._colorByPoint()&&(A=getComputedStyle(s.dom).fill),this._top.setFill(A);const P=this.isVisible()?300:0,C=_.offset+y,k=o.getFocusPointView().getBounds(),L=e.getBounds();let N,M,E=!1;const T=h.isFollowPointer(t);if(x&&!t.isWidget)N=n-V/2-m(0,g(n-V/2,u-V)),E=T?w?S+C>r:r+S+C>d:w?S+C>k.x-L.x+k.width:k.x-L.x-C>d-S,E&&(w=!w),M=w?Zh.LEFT:Zh.RIGHT,this.$_drawTooltip(0,0,S,V,M,N),w?r-=S+C:r+=C,n-=V/2;else{N=r-S/2-m(0,g(r-S/2,d-S));const t=T?n-e.getRootDistance().y:k.y-L.y-e._padding.top,s=T?u-n:L.bottom-k.bottom;if(t>=V+C||s>=V+C){(w?s>=V+C:t>=V+C)?M=w?Zh.BOTTOM:Zh.TOP:(M=w?Zh.TOP:Zh.BOTTOM,w=!w),this.$_drawTooltip(0,0,S,V,M,N),r-=S/2,w?n+=C:n-=V+C}else{N=n-V/2-m(0,g(n-V/2,u-V));const t=k.x-L.x;M=d-t>=S+C||t<S+C?Zh.RIGHT:Zh.LEFT,this.$_drawTooltip(0,0,S,V,M,N),M===Zh.RIGHT?r+=C:r-=S+C,n-=V/2}}return r=m(0,g(r,d-S)),n=m(0,g(n,u-V)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(m(0,r-20),m(0,n-20)),this.transEx(r,n,P/2,!1)):this.transEx(r,n,P,!1),0===P&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:r,y:n,w:S,h:V}}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:or.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Xt(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}$_drawTooltip(t,e,s,i,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let _=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case Zh.TOP:_=_.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case Zh.BOTTOM:_=_.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case Zh.LEFT:_=_.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case Zh.RIGHT:_=_.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const c=r===Zh.BOTTOM,d=c?["M",t,e+i-l,"l",s,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-s,0,"l",0,h-l,"q",0,-h,h,-h],u=this._textView,p=u.getBBox();t+=(s-p.width)/2,e+=(i-p.height+(c?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(_)}}Kh.CLASS_NAME="rct-tooltip";class Qh extends te{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new Kh(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,s,i,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,s,i,r,n),a=this.control.getRootDistance();this.setBounds(a.x,a.y,o.w,o.h)}close(t,e){this.setVisibility(!1),this._tooltipView.close(t,e)}}class Jh extends lt{static isButton(t){return t.classList.contains("rct-html-button")}constructor(t){super(),this._dom=this.$_initDom(t)}_doDestroy(){this._dom.remove(),this._dom=null,super._doDestroy()}get dom(){return this._dom}setVisible(t){return this._dom.style.display=t?"":"none",t}setModel(t){const e=this._dom,s=$t.isHoverAt(e),i=(this._model=t).options;return $t.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(i.width)?i.autoWidth?e.style.width="max-content":e.style.width="":e.style.width=I(i.width),isNaN(i.height)?e.style.height="":e.style.height=I(i.height),"custom"===i.hintMode?(i.hint?e.dataset.hint=i.hint:delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=i.hint||""),i.imageUrl?$t.setStyles(this._img,{display:"",width:F(i.imageWidth),height:F(i.imageHeight)}):$t.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(ot?this._hovered:s),this._span.textContent=i.text||"",this}layout(t){const e=this._dom,s=e.style,i=this._model.options,r=i.align,n=i.verticalAlign;s.left=F("left"===r?t.x+(i.offsetX||0):"right"===r?t.x+t.width-e.offsetWidth-(i.offsetX||0):t.x+(t.width-e.offsetWidth)/2+(i.offsetX||0)),s.top=F("top"===n?t.y+(i.offsetY||0):"bottom"===n?t.y+t.height-e.offsetHeight-(i.offsetY||0):t.y+(t.height-e.offsetHeight)/2+(i.offsetY||0))}pointerEnter(){this._hovered=!0,this.$_setImage(!0)}pointerLeave(){this._hovered=!1,this.$_setImage(!1)}click(){this._model.click()}$_initDom(t){const e=t.createElement("button"),s=t.createElement("div");return e.className="rct-html-button",$t.setStyles(e,{position:"absolute",textAlign:"center"}),$t.setStyles(s,{display:ot?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(s),this._img=t.createElement("span"),this._img.className="rct-html-button-image",$t.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),s.appendChild(this._img),this._span=t.createElement("span"),$t.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),ot&&$t.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),s.appendChild(this._span),e}$_setImage(t){const e=this._model.options;e.imageUrl?t&&"image"===this._model.getHoverEffect()?this._img.style.backgroundImage=`url(${e.hoverImageUrl||e.imageUrl})`:this._img.style.backgroundImage=`url(${e.imageUrl})`:this._img.style.backgroundImage=""}}class tl extends xo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Uh(t,!1)),this.add(this.subtitleView=new Uh(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,_=0,c=0,d=this.titleView,u=s,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):d.setModel(n),(d=this.subtitleView).setVis(o.visible)?(a=d.measure(t,o,s,i,r),c=this._hSub=a.height,_=this._wSub=a.width,g=+o.options.titleGap||0):d.setModel(o),o.options.position){case"leftSide":case"left":case"rightSide":case"right":p=m(l,c),u=h+g+_;break;default:p=l+g+c,u=m(u,h+_)}return p>0&&(p+=this.titleView.visible?y(n.options.gap,0):y(o.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,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=m(this._hTitle,this._hSub);g=m(g,g+t(i,e,this._hTitle)),x=m(x,x+t(r,e,this._hSub))},d=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(f=m(f,f+d(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":b=f;break;case"right":b=f+this._wTitle-this._wSub;break;default:b=f+(this._wTitle-this._wSub)/2}else b=m(b,b+d(r,h,this._wSub))},p=y(o.titleGap,0);let g=0,f=l,x=0,b=_;switch(n.align){case"left":switch(o.position){case"leftSide":case"left":f=b+this._wSub+p,c();break;case"rightSide":b=f+this._wTitle+p,c();break;case"right":switch(b=f+this._wTitle+p,o.align){case"center":b=m(b,b+(h-this._wTitle-this._wSub)/2);break;case"right":b=m(b,_+h-this._wSub)}c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}break;case"right":switch(o.position){case"leftSide":f+=a-this._wTitle,b=f-p-this._wSub,c();break;case"left":switch(f+=a-this._wTitle,o.align){case"center":b+=(a-this._wTitle-this._wSub)/2;break;case"right":b=f-p-this._wSub}c();break;case"rightSide":case"right":b+=h-this._wSub,f=b-p-this._wTitle,c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}break;default:switch(o.position){case"leftSide":f+=(a-this._wTitle)/2,b=f-this._wSub-p,c();break;case"left":switch(f+=(a-this._wTitle)/2,o.align){case"left":break;case"center":b+=(f-b-this._wSub)/2;break;case"right":b=f-this._wSub-p}c();break;case"rightSide":f+=(a-this._wTitle)/2,b=f+this._wTitle+p,c();break;case"right":switch(f+=(a-this._wTitle)/2,o.align){case"left":b=f+this._wTitle+p;break;case"center":b+=f+this._wTitle+p,b+=(h-b-this._wSub)/2;break;case"right":b+=h-p-this._wSub}c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}}const w=y(n.offset,0),v=y(o.offset,0);0!==w&&(f+="right"===n.align?-w:w,"leftSide"!==o.position&&"rightSide"!==o.position||(b+="right"===n.align?-w:w)),0!==v&&"leftSide"!==o.position&&"rightSide"!==o.position&&(b+="right"===o.align?-v:v),e.resizeByMeasured().layout().trans(f,g),s.resizeByMeasured().layout().trans(b,x)}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 d=a?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=o-c;break;default:d+=(o-c)/2}n.trans(d,0)}}}class el extends xo{_doInitChildren(t){this.add(this._legendView=new Hh(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 sl extends xo{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r,n){const o=this.views;let a;for(o.length;o.length<i.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>i.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach(((t,e)=>{t.prepare(i[e])})),this.setVis(o.length>0)){const t=o[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()))}_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=m(n,l),o=m(o,_)}})),{width:n,height:o}}_doLayout(t){const e=this.control,s=e.loaded,i=[];let r=this.width,n=this.height,o=0,a=0;t=+t||0,[this.views].forEach((e=>{if(e){let h=0;e.forEach((t=>{if(t.visible){const e=t.checkExtents(s);e&&i.push(e),this.isHorz?(t.resize(r,t.mh),t.model._calcPoints(this.width,999)):(t.model._calcPoints(this.height,999),t.resize(t.mw,n)),t.layout(),this.isHorz?(t.trans(o,this.dir===Jn.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===Jn.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}})),this.isHorz?o+=r+t:a+=n+t}}));const h=i.length>0&&e.chart.body.options.zoomCallback;h&&Promise.resolve().then((()=>{i.forEach((({axis:t,from:e,to:s})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof yi?Math.floor(e):e,to:t instanceof yi?Math.floor(s):s})}))}))}}class il extends fo{constructor(t){super(t,"rct-credits"),this.add(this._textView=new ue(t)),this._textView.anchor=_e.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 rl extends ee{}class nl extends ee{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._htmlButtons=[],this.add(this._annotationContainer=new ee(t,"rct-annotations")),this.add(this._plotContainer=new ee(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Mh(t,this));for(const e in Jn){const s=new sl(t,Jn[e]);this._plotContainer.add(s),this._axisSectionMap[Jn[e]]=s}nl.pane_class&&this.add(this._paneContainer=new nl.pane_class(t,this)),this.add(this._titleSectionView=new tl(t)),this.add(this._legendSectionView=new el(t)),this.add(this._frontAnnotationContainer=new ee(t,"rct-front-annotations")),this.add(this._creditView=new il(t)),this.add(this._navigatorView=new Th(t)),this.add(this._historyView=new Ih(t))}_doDestroy(){var t;this._htmlTooltipView=null===(t=this._htmlTooltipView)||void 0===t?void 0:t.destroy(),super._doDestroy()}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._credits,c=h._legend,d=h._navigator;let u,p=s,g=i;if(e._width=s,e._height=i,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)&&(u=this._creditView.measure(t,_,p,g,r),_.isFloating()||("middle"!==_.options.verticalAlign?g-=u.height+(+_.options.offsetY||0)+(+_.options.gap||0):"center"!==_.options.align&&(p-=u.width+(+_.options.offsetX||0)+(+_.options.gap||0)))),u=this._titleSectionView.measure(t,h,p,g,r),g-=u.height,this._legendSectionView.setVis(c.visible))switch(u=this._legendSectionView.measure(t,h,p,g,r),c._location){case"top":case"bottom":g-=u.height;break;case"right":case"left":p-=u.width}if(this._navigatorView.setVis(d.visible),null===(a=this._paneContainer)||void 0===a?void 0:a.visible)this._paneContainer.measure(t,h._split,p,g,1);else{if(this._navigatorView.visible){const t=h._navigator;t._vertical?p-=t.getSize():g-=t.getSize()}l?this.$_measurePolar(t,h,p,g,1):this.$_measurePlot(t,h,p,g,1)}if(this._navigatorView.visible){const e=l?this._polarView:this._bodyView;h._navigator._vertical?g=e.mh:p=e.mw,this._navigatorView.measure(t,d,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._credits,_=l.options,c=+_.gap||0,d=this._bodyView._depthExt;let u=0,p=0,g=0,m=0,f=0,y=0,x=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=g=h.height+u+c:r-=m=h.height+u+c):(p=+_.offsetX||0,"left"===_.align?i-=f=h.width+p+c:i-=y=h.width+p+c)));const w=this._titleSectionView;let v=0;const S=b+g;w.visible&&(w.resizeByMeasured(),r-=v=w.height),x=f,b=s-m;const V=this._navigatorView;let A=0;V.visible&&(V.model._vertical||(V.resize(V.mw,V.mh-V.model.getGap()-V.model.getGapFar()),r-=A=V.mh));const P=this._legendSectionView;let C,k,L=0,N=0;if(P.visible)switch(P.resizeByMeasured().layout(),L=P.height,N=P.width,a._location){case"top":C=v+g,r-=L;break;case"bottom":r-=L,C=b-L,b-=L;break;case"right":i-=N,k=e-N;break;case"left":i-=N,x+=N,k=0}V.visible&&(b-=A,V.layout().transY(b+V.model.getGap()));let M,E=0,T=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(x,S+v).resize(i,r),this._paneContainer.layout(),E=r,T=i,M=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([Jn.LEFT,Jn.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[Jn.TOP,Jn.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[Jn.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),x+=e.mw),(e=t[Jn.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[Jn.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0),b-=e.mh),(e=t[Jn.TOP])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0))),V.visible&&V.layout().transX(x);const s={x:x,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[Jn.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[Jn.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[Jn.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[Jn.TOP])&&e.visible&&e.trans(s.x,s.y-r-e.height));const n=this._currBody;E=this._plotHeight-0,T=this._plotWidth-0,x=s.x,b=s.y-this._plotHeight,n.resize(T,E),n.trans(x,b),n.layout(),M=n.getRect(),n._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=m>0?s-m+c:s-h.height-u}switch(_.align){case"left":t=p;break;case"center":t=(e-h.width)/2+p;break;default:t=y>0?e-y+c:e-h.width-p}h.trans(t,i)}if(T+=0,w.visible&&w.layout({xPlot:x,wPlot:T,wChart:e}).trans(0,S),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":x+=T-N-e;break;case"center":x+=(T-N)/2+e;break;default:x+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=E-L-e;break;case"middle":b+=(E-L)/2+e;break;default:b+=e}}else if(isNaN(C)){const e=+t.offsetY||0;if(x=k,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=s-L-e;break;default:b=(s-L)/2+e}b+L>s&&(b=(s-L)/2)}else switch(o){case"top":b+=e;break;case"bottom":b=b+r-L-e;break;default:b=b+(r-L)/2+e}b+L>s&&(b=(s-L)/2),b<0&&(b=0)}else{const s=+t.offsetX||0;if(b=C,"chart"===t.alignBase)switch(n){case"left":x=s;break;case"right":x=e-N-s;break;default:x=(e-N)/2+s}else switch(n){case"left":x+=s;break;case"right":x=x+i-N-s;break;default:x+=(i-N)/2+s}x+N>e&&(x=(e-N)/2),x<0&&(x=0)}P.trans(x,b)}this.$_layoutHtmlButtons(e,s),this.$_layoutAnnotations(this._inverted,e,s,M),this.hideTooltip()}showTooltip(t,e,s,i,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:_}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},c=i.getTooltipPos(),d=h?r.x+c.x:l+c.x,u=h?r.y+c.y:_+c.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new Qh(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,s,d,u,i)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new Kh(this.doc)),this._tooltipView.show(t,o,e,s,d,u,i))}tooltipVisible(){var t,e;return this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t?void 0:t.hasVisibility():null===(e=this._tooltipView)||void 0===e?void 0:e.isVisible()}hideTooltip(t=!0){var e,s;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(s=this._tooltipView)||void 0===s||s.close(!1,t)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new Mo(t)}legendByDom(t){let e=this._legendSectionView._legendView.legendByDom(t);return!e&&this._model.isSplitted()&&(e=this._paneContainer.legendByDom(t)),e}seriesByDom(t){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}annotationByDom(t){var e;let s=this._annotationViews.find((e=>e.dom.contains(t)));return s||((null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.annotationByDom(t):this._currBody.annotationByDom(t))}htmlButtonByDom(t){return this._htmlButtons.find((e=>e.dom.contains(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,r;const n=s,o=this._model&&this.bodyOf(s),a=null==n?void 0:n.classList,h=(null==a?void 0:a.value)&&(a.contains("rct-contextmenu-item")||a.contains("rct-contextmenu-list"));let l=this._hoverItem;if(this._hoverItem=null,(null===(i=this._model)||void 0===i?void 0:i.isSplitted())&&this._paneContainer.bodies.forEach((t=>{t!==o&&t.clearHover()})),o){const i=o.controlToElement(t,e),r=o.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(n)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(n);if(t){const e=t.legend;at.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof Ti?o.hoverSeries(t):e.options.pointHovering&&t instanceof ci&&o.hoverPoint(t)}))}}if(l instanceof Os&&!(this._hoverItem instanceof Os)&&(o.hoverPoint(null),o.hoverSeries(null)),this.$_handleAnnotationHover(s),!r)return void o.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,n=e._isHorz?o.width:o.height,a=e._isHorz?i.x:i.y,l=r&&s.visible&&!h&&s.flag.visible&&!s.isBar()&&s.getFlag(n,a);if(l){t.showCrosshair(a,l);const r=[];o._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 Zr&&!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(a,l,r)}else t.hideCrosshiar()}))}else(null===(r=this._model)||void 0===r?void 0:r.isSplitted())?this._paneContainer.bodies.forEach((t=>{t.removeFocus()})):this._currBody.removeFocus(),this.$_handleAnnotationHover(s)}pointerLeaved(t,e,s){this.$_clearAnnotationHover()}getAxis(t){for(const e in this._axisSectionMap){const s=this._axisSectionMap[e].views.find((e=>e.model===t));if(s)return s}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in Jn){const s=this._axisSectionMap[Jn[e]].getScrollView(t);if(s)return s}}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e?e.update(this,this.width,this.height):this._model.isSplitted()||(e=this._currBody._annotationViews.find((e=>e.model===t)),e&&e.update(this._currBody,this._currBody.width,this._currBody.height))}isAnimating(){return this._bodyView.animating()}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new Wh(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._body,e)}$_prepareHtmlButtons(t){const e=this._model._getButtons(),s=[];e._internalItems().forEach(((e,i)=>{let r=this._htmlButtons[i];r||(r=new Jh(t),this.control.appendDom(r.dom),this._htmlButtons[i]=r),s.push(r)}));for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].destroy();this._htmlButtons=s}$_layoutHtmlButtons(t,e){const s=this.control._padding,i=this._htmlButtons;if(i.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:s.left,y:s.top,width:t,height:e},o=this._model._getButtons()._internalItems();i.forEach(((t,e)=>{const s=o[e];t.setVisible(s.visible)&&t.setModel(s).layout(s.isChartScope()?n:r)}))}}$_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,this,e,e.getAxes(s,!0),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,o=s,a=i;let h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,_,this._inverted,r),s-=n[Jn.LEFT].checkWidths(t,s,i),s-=n[Jn.RIGHT].checkWidths(t,s,i),i-=n[Jn.BOTTOM].checkHeights(t,s,i),i-=n[Jn.TOP].checkHeights(t,s,i),h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r);for(const s in n){const i=n[s];i.visible&&i.measure(t,e,l,_,r)}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===Jn.LEFT||t===Jn.RIGHT?s-=e.mw:t!==Jn.BOTTOM&&t!==Jn.TOP||(i-=e.mh))}r++,h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const s in n){const i=n[s];i.visible&&(i.measure(t,e,l,_,r),i.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===Jn.LEFT||t===Jn.RIGHT?s-=e.mw:t!==Jn.BOTTOM&&t!==Jn.TOP||(i-=e.mh))}h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.axesLayouted(l,_,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.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||mh(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)}))}$_handleAnnotationHover(t){var e,s;if(!t)return;const i=this.htmlButtonByDom(t);if(i!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=i,void(null===(s=this._hoverButton)||void 0===s||s.pointerEnter());const r=this.annotationByDom(t),n=this._hoverAnnotation;r!==n&&(null==n||n.pointerLeave(),null==r||r.pointerEnter())}$_clearAnnotationHover(){this._hoverButton&&(this._hoverButton.pointerLeave(),this._hoverButton=null),this._hoverAnnotation&&(this._hoverAnnotation.pointerLeave(),this._hoverAnnotation=null)}}!function(t){t.EXPORT="$$realchart_export"}(qh||(qh={}));class ol extends Qt{constructor(t,e){super(t,e),this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new eo(null,((t,e)=>{this.$_changeModel(t,e)}))}_createChartView(t){return new nl(t)}_createPointerHandler(){return new Fh(this)}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof ze&&s===Oe.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 instanceof eo&&t!==this._chart&&(this.$_changeModel(t._obj,this.model),this._chart=t)}get model(){return this._chart._obj}$_changeModel(t,e){t!==e&&(this.clearAssetDefs(),this.clearClipDefs(),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===qh.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_canOverflowRender(){return!1}_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.setResizeDelay(i.resizeDelay),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,i,r){if(this.model){const i=this.model._chartOptions._style;if(s(i))for(const s in i)s.startsWith("padding")?e.setStyle(s,i[s]):t.style[s]=i[s]}}_loadModules(){if(!this.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._exporter.options)}}}class al{static getVersion(){return It.version}static setLicenseKey(t){It.code=t}static setLocale(t,e){e&&k(t,e),(t=>{t&&(C=A[P=t.substring(0,2)]),C||(C=A[P="ko"])})(t)}static registerLocale(t,e){k(t,e)}static setDebugging(t){Jt.DEBUGGING=t}static setLogging(t){at.LOGGING=t}static setAnimatable(t){Qt._animatable=t}static configure(t){return t}static createChart(t,e,i,r=!0,n){const o=new ol(t,e);return o.chart.load(s(i)?i:{},r,n),o.chart[Zn]=o,o.chart}static createData(t,e){return new so(t||{},e)}}class hl{static empty(){return new hl}static create(t=0,e=0){return new hl(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}const ll="bullet",_l="bulletgroup",cl="circle",dl="circlegroup",ul="clock",pl="linear",gl="lineargroup";class ml{static empty(){return new ml}static create(t=0,e=0){return new ml(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const fl=al.getVersion,yl=al.setDebugging,xl=al.setLogging,bl=al.setAnimatable,wl=al.configure,vl=al.createChart,Sl=al.createData,Vl=al.setLicenseKey;export{ze as Annotation,$o as AnnotationView,Bo as ArcElement,Kr as AreaRangeSeries,Ta as AreaRangeSeriesView,Ur as AreaSeries,Jr as AreaSeriesGroup,Ba as AreaSeriesView,Ne as AssetCollection,as as Axis,yr as AxisBaseLine,hs as AxisCollection,Ke as AxisGrid,Ye as AxisItem,is as AxisLabel,We as AxisLine,rs as AxisScrollBar,Lo as AxisScrollView,os as AxisSectorLine,ss as AxisTick,Ue as AxisTitle,Mo as AxisView,Lr as BarRangeSeries,Oa as BarRangeSeriesView,Er as BarSeries,Mr as BarSeriesBase,Br as BarSeriesGroup,Tr as BarSeriesGroupBase,Nr as BarSeriesPoint,$a as BarSeriesView,Da as BarSeriesViewBase,Xi as BasedSeries,ba as BasedSeriesView,en as BellCurveSeries,Fa as BellCurveSeriesView,Ts as Body,Es as BodyDepth,Mh as BodyView,rn as BoxPlotSeries,za as BoxPlotSeriesView,ga as BoxPointElementEx,on as BubbleSeries,Ga as BubbleSeriesView,_l as BulletGaugeGroupType,ll as BulletGaugeType,an as BumpSeriesGroup,ln as CandlestickSeries,Xa as CandlestickSeriesView,yi as CategoryAxis,fi as CategoryAxisGrid,mi as CategoryAxisLabel,gi as CategoryAxisTick,eo as Chart,ol as ChartControl,so as ChartData,ut as ChartDataCollection,fo as ChartElement,Oe as ChartItem,to as ChartObject,Qn as ChartOptions,Fh as ChartPointerHandler,De as ChartText,nl as ChartView,_n as CircelBarPointLabel,cn as CircleBarSeries,dn as CircleBarSeriesGroup,Wa as CircleBarSeriesView,To as CircleElement,dl as CircleGaugeGroupType,cl as CircleGaugeType,Ps as CircularGauge,Cs as CircularGaugeGroup,Vs as CircularGaugeLabel,ul as ClockGaugeType,Gi as ClusterableSeries,qi as ClusterableSeriesGroup,Dt as Color,Oi as ConnectableSeries,Zi as ConstraintSeriesGroup,bo as ContentView,xr as ContinuousAxis,qn as Credits,je as Crosshair,ci as DataPoint,di as DataPointCollection,Ci as DataPointLabel,$t as Dom,gn as DumbbellSeries,Za as DumbbellSeriesView,io as ElementPool,fn as EqualizerSeries,Ka as EqualizerSeriesView,yn as ErrorBarSeries,Ja as ErrorBarSeriesView,Bs as Exporter,vn as FunnelSeries,eh as FunnelSeriesView,ps as Gauge,ds as GaugeBase,gs as GaugeGroup,Xo as GaugeGroupView,us as GaugeItem,Ss as GaugeLabel,vs as GaugeRangeBand,ws as GaugeRangeLabel,bs as GaugeScale,Io as GaugeView,ei as HeatmapSeriesType,An as HistogramSeries,ih as HistogramSeriesView,$e as IconedText,_r as ImageAnnotation,Pa as ImageAnnotationView,wo as ImageElement,ee as LayerElement,Rs as Legend,Os as LegendItem,zh as LegendItemView,Hh as LegendView,$r as LineElement,Hr as LinePointLabel,Xr as LineSeries,Gr as LineSeriesBase,Ma as LineSeriesBaseView,Qr as LineSeriesGroup,Ir as LineSeriesPoint,Ea as LineSeriesView,br as LinearAxis,gl as LinearGaugeGroupType,pl as LinearGaugeType,Yn as LogAxis,kn as LollipopSeries,nh as LollipopSeriesView,Wi as LowRangedSeries,Ki as MarkerSeries,va as MarkerSeriesPointView,Sa as MarkerSeriesView,Ji as NavigatorMask,Qi as NavigiatorHandle,E as ORG_ANGLE,Nn as OhlcSeries,ah as OhlcSeriesView,Ii as OthersGroup,M as PI_2,rl as PaneContainer,En as ParetoSeries,hh as ParetoSeriesView,qt as PathBuilder,ne as PathElement,ri as PictogramSeriesType,ni as PictorialBarSeriesType,oi as PictorialSeriesType,$n as PieSeries,Fn as PieSeriesGroup,Rn as PieSeriesLabel,On as PieSeriesText,dh as PieSeriesView,hl as Point,da as PointElement,Kn as PointHovering,oa as PointLabelLineContainer,na as PointLabelLineView,ia as PointLabelView,B as RAD_DEG,ai as RaceBarSeriesType,hi as RaceLineSeriesType,Hi as RadialSeries,Yi as RangedSeries,Yt as RcAnimation,Qt as RcControl,Jt as RcElement,lt as RcObject,zs as RectElement,t as SVGNS,jo as ScaleView,zn as ScatterSeries,ph as ScatterSeriesView,xo as SectionView,Ro as SectorElement,Ti as Series,Yo as SeriesAnimation,Ui as SeriesGroup,Ri as SeriesMarker,ir as SeriesNavigator,ca as SeriesView,cr as ShapeAnnotation,Ca as ShapeAnnotationView,ml as Size,Yr as SplineSeries,nr as Subtitle,Is as SvgShapes,_e as TextAnchor,dr as TextAnnotation,ka as TextAnnotationView,ue as TextElement,ce as TextLayout,Cr as TimeAxis,rr as Title,or as Tooltip,ti as TreemapSeriesType,xi as TrendLineArea,bi as TrendLineLabel,vi as Trendline,at as Utils,fs as ValueGauge,Ho as ValueGaugeView,si as VectorSeriesType,jn as WaterfallSeries,gh as WaterfallSeriesView,ls as Widget,zi as WidgetSeries,$i as WidgetSeriesConnector,Fi as WidgetSeriesLabel,Di as WidgetSeriesPoint,Aa as WidgetSeriesView,ii as WordCloudSeriesType,ui as ZValuePoint,f as absv,l as assignObj,tt as buildValueRanges,W as calcPercent,wl as configure,v as copyObj,d as cos,vl as createChart,Sl as createData,no as createRect,Ee as extend,R as fixnum,fl as getVersion,S as incv,i as isArray,ao as isEmptyRect,ot as isIE,a as isNumber,s as isObject,n as isString,m as maxv,g as minv,X as parsePercentSize,y as pickNum,b as pickProp,w as pickProp3,F as pixel,oo as rectToSize,bl as setAnimatable,yl as setDebugging,Vl as setLicenseKey,xl as setLogging,u as sin,$ as toStr};
|
|
7
|
+
const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"string"==typeof t&&t.length>0},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,_=Math.floor,c=Math.ceil,d=Math.cos,u=Math.sin,p=Math.log10,g=Math.min,m=Math.max,f=Math.abs,y=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},x=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},b=function(t,e){return void 0!==t?t:e},w=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},v=t=>t&&l({},t),V=(t,e,s)=>t+(e-t)*s,S=function(t){return"function"==typeof t?t:null},A={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 P="ko",k=A[P]||A[P="ko"];const C=(t,e)=>{t&&s(e)&&(k=A[t.substring(0,2)]=Object.assign(A.ko,A.en,e))},N=void 0,L=Math.PI,M=2*L,E=-L/2,B=2*L/360,T=360/L/2,O="%".charCodeAt(0);function D(t){return parseFloat(t.toPrecision(12))}function R(t){return Math.floor(1e6*t)/1e6}function $(t){return null==t?null:String(t)}function F(t){return t+"px"}function I(t){return null!=t?"number"==typeof t?`${t}px`:t:null}function z(t){return null==t||Number.isNaN(t)||""===t}function H(t){return t<10?"0"+t:String(t)}function G(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function j(t,e){const s={};return s[t]=e,s}function X(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)===O?i=1===s.length?NaN:parseFloat(s):(i=parseFloat(s),r=!0),isNaN(i)){if(e)return null;J(k.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 Y(t,e){return X(t,!0)||X(e,!1)}function W(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const U="fill",Z="stroke",q={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"},K=function(t){const e=q[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return q[t]=e,e}return e};class Q extends Error{}const J=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},tt=function(t,e,r,o=!0,a=!0,h=!1,_){let c,d;if(o&&(e=-Number.MAX_VALUE,r=Number.MAX_VALUE),i(t))c=[],t.forEach((t=>{if(s(t)&&n(t.color)){const s={fromValue:y(t.fromValue,d?d.toValue:e),toValue:y(t.toValue,r),color:t.color,style:t.style?l({},t.style):N};s.fromValue<s.toValue&&(c.push(s),d=s)}})),c=c.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<r)),a&&c.forEach((t=>{t.fromValue=m(t.fromValue,e),t.toValue=g(t.toValue,r)}));else if(s(t)&&i(t.colors)&&t.colors.length>0){const s=t.colors,n=i(t.styles)?t.styles:null;if(c=[],i(t.steps)&&t.steps.length>0){const o=i(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),r>o[o.length-1]&&o.push(r);for(let t=0;t<o.length-1;t++)c.push({fromValue:o[t],toValue:o[t+1],color:s[g(t,s.length-1)],style:n?n[g(t,n.length-1)]:N})}else{let i=y(t.fromValue,e);const o=y(t.toValue,r),a=(o-i)/s.length;let h=0;for(;i<o;)c.push({fromValue:i,toValue:i+=a,color:s[g(h,s.length-1)],style:n?n[g(h,n.length-1)]:N}),h++}}if(h&&c&&c.length>0){let t=0,s=e;for(;t<c.length;)c[t].fromValue>s&&c.splice(t,0,{fromValue:s,toValue:c[t].fromValue,color:_}),s=c[t].toValue,t++;c[t-1].toValue<r&&c.push({fromValue:c[t-1].toValue,toValue:r,color:_})}return c},et="shuffle",st="random",it="vertical-lr",rt="vertical-rl",nt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const ot="undefined"!=typeof window&&"undefined"!=typeof document&&!!document.documentMode&&!!window.MSInputMethodContext;class at{static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...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&&at.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(g(s,at.month_days[at.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&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!i(t))return l({},t)}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(i(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-nt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=m(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=m(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 parseTuples(t){if(i(t)){const e=[];let s=-1/0;return t.forEach(((r,n)=>{i(r)?!isNaN(r[0])&&!isNaN(r[1])&&r[0]>s&&(e.push([+r[0],+r[1]]),s=r[0]):isNaN(r)||n!==t.length-1||e.push([1/0,+r])})),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+t]]}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 isDate(t){return t.getTime&&"[object Date]"===Object.prototype.toString.call(t)}static deepClone(t){if(null==t||"object"!=typeof t)return t;if(this.isDate(t))return new Date(t);{const e=i(t)?[]:{};for(let s of Object.keys(t))e[s]=this.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(),at.log(t,+new Date-s+"ms")}static clamp(t,e,s){return m(e,g(s,t))}static makeIntArray(t,e){const s=new Array(m(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 isAnimation(t){return"[object Animation]"===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=f(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}static diffAngle(t,e){const s=f(t-e);return g(s,M-s)}}at.LOGGING=!1,at.week_days=["일","월","화","수","목","금","토"],at.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],at.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]],at.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}();let ht=0;class lt{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(ht++))}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 _t extends lt{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 ct=function(t){return t&&"object"==typeof t};class dt extends _t{constructor(t,e){super(),this._rows=[],this.$_buildOptions(t||{}),i(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=i(e)?e.slice():n(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(i(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else ct(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)&&J(k.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 r;i(s)?r=new dt({},s):ct(s)&&i(s.values)&&(r=new dt(s.options,s.values)),this._map[e]=r}}}const pt="0".charCodeAt(0),gt="#".charCodeAt(0),mt=",".charCodeAt(0),ft="s".charCodeAt(0),yt="a".charCodeAt(0);class xt{static getFormatter(t){let e=xt.Formatters[t];return e||(xt.Formatters[t]=e=new xt(t)),e}static get Default(){return xt.getFormatter(xt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1},this._options2=Object.assign({},this._options),this._options2.useGrouping=!1}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toNum(t){return+t.toLocaleString(void 0,this._options2)}$_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)===pt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===gt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===pt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===mt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===ft){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===yt){s.signDisplay="never";break}}return s.minimumIntegerDigits=m(1,s.minimumIntegerDigits),s}}}xt.DEFAULT_FORMAT="",xt.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"],wt=[".","/","-",":"],vt="Z".charCodeAt(0),Vt="z".charCodeAt(0),St="A".charCodeAt(0),At="a".charCodeAt(0),Pt="y".charCodeAt(0),kt="M".charCodeAt(0),Ct="m".charCodeAt(0),Nt="W".charCodeAt(0),Lt="w".charCodeAt(0),Mt="d".charCodeAt(0),Et="H".charCodeAt(0),Bt="h".charCodeAt(0),Tt="S".charCodeAt(0),Ot="s".charCodeAt(0);class Dt{static getFormatter(t){let e=Dt.Formatters[t];return e||(Dt.Formatters[t]=e=new Dt(t)),e}static get Default(){return Dt.getFormatter(k.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||k.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():H(t.getFullYear()%100);break;case kt:i+=a>1?H(t.getMonth()+1):t.getMonth()+1;break;case Mt:i+=a>1?H(t.getDate()):t.getDate();break;case Nt:i+=a>1?H(at.weekOfYear(t,e)+1):at.weekOfMonth(t,e,!0)+1;break;case Lt:i+=a>1?at.long_week_days[t.getDay()]:at.week_days[t.getDay()];break;case Et:i+=a>1?H(t.getHours()):t.getHours();break;case Bt:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?H(e):e}else i+=a>1?H(t.getHours()):t.getHours();break;case Ct:i+=a>1?H(t.getMinutes()):t.getMinutes();break;case Ot:i+=a>1?H(t.getSeconds()):t.getSeconds();break;case At:case St:t.getHours()<12?i+=k.am:i+=k.pm;break;case Tt:let s=t.getMilliseconds();i+=3==a?G(s):2==a?H(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(wt.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<=vt||e>=At&&e<=Vt)&&J(k.invalidDateFormat,t)}e.push(n)}if(r<i&&at.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&at.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||k.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Dt.Formatters={};class Rt{static isBright(t){return new Rt(t).isBright()}static getContrast(t,e,s){return new Rt(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Rt(t),r=new Rt(e),n=1-s,o=Math.round(i.r*s+r.r*n),a=Math.round(i.g*s+r.g*n),h=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${a},${h},${l})`:`rgb(${o},${a},${h})`}static toColor(t){return ot?new Rt(t).toString():t}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(at.startsWith(t,"rgb(")&&at.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):at.startsWith(t,"rgba(")&&at.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):at.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}}Rt.BLACK="#000",Rt.WHITE="#fff","undefined"==typeof Element||Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);class $t{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 setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}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}}static hasFill(t){const e=window.getComputedStyle(t).fill;return e&&"none"!==e}static setVisible(t,e,s=""){return t.style.display=e?s:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let s=null;"string"==typeof e?s=e:$t.isSVGClipPathElement(e)&&(s=e.id||null),s?t.setAttribute("clip-path",`url(#${s})`):t.removeAttribute("clip-path")}static createClipRect(e,s){const i=e.createElementNS(t,"clipPath");return i.id=s,i.append(e.createElementNS(t,"rect")),i}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,s,i,r){return t.setAttribute("x",e),t.setAttribute("y",s),t.setAttribute("width",i),t.setAttribute("height",r),t}static isSVGElement(e){return $t.isElement(e)&&e.namespaceURI===t}static isSVGClipPathElement(t){return $t.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var Ft;$t.instanceOf=function(t,e){return $t.isElement(t)&&t.tagName===e.toUpperCase()},$t.isElement=function(t){return t&&1===t.nodeType},function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Ft||(Ft={}));const It={name:"RealChart",version:"1.4.13",license:"enterprise",code:null};class zt{static decode(t){const e=zt.CHARS,s=zt.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}}zt.PAD="=",zt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Ht{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=Ht.xor,i=Ht.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=Ht.xor,i=Ht.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=Ht.kb,i=Ht._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*Ht.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=Ht._decryptBlock;let i=Ht._init(e),r=[],n=zt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*Ht.POW24|n[a+1]*Ht.POW16|n[a+2]*Ht.POW8|n[a+3],h.right=n[a+4]*Ht.POW24|n[a+5]*Ht.POW16|n[a+6]*Ht.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)}}Ht.POW2=Math.pow(2,2),Ht.POW3=Math.pow(2,3),Ht.POW4=Math.pow(2,4),Ht.POW8=Math.pow(2,8),Ht.POW16=Math.pow(2,16),Ht.POW24=Math.pow(2,24),Ht.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=Ht.decrypt(t,"dkdl"+this._getLDKey(Ht.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}}const jt={linear:t=>t,inOutSine:t=>-(d(L*t)-1)/2},Xt=function(t,e,s,i,r,n){const o=j(e,null!=s?s:"initial"),a=j(e,i),h=t.animate([o,a],{duration:r,fill:"none"});return n&&(h?h.addEventListener("finish",n):setTimeout(n,0)),h};class Yt{constructor(){this.delay=0,this.duration=Yt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,s=t-this._started-this.delay;let i=g(1,m(0,D(s/this.duration)));this._easing&&(i=this._easing(i)),this._rate=i,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(i,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{s>=this.duration?this._stop(!1):!this._started||isFinite(this.duration)&&!this._timer||(this._ani=window.requestAnimationFrame(this._handler))}}}start(t){return this.endHandler||(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}cancel(){this._stop(!0)}rate(){return this._rate||0}_start(t,e=0,s=null){this._started&&this._stop(!0),this.duration=y(t,Yt.DURATION),this.delay=e||0,this._easing=jt[s],this._doStart(),this._started=this._prev=+new Date,isFinite(this.duration)&&(this._timer=setTimeout((()=>this._stop(!1)),1.2*this.duration)),this._handler()}_stop(t){var e;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(e=this.endHandler)||void 0===e||e.call(this,this,t))}_doStart(){}_doStop(){}_canUpdate(){return!0}}Yt.DURATION=700,Yt.SHORT_DURATION=300;class Wt extends Yt{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var s,i;null===(i=(s=this.props).endHandler)||void 0===i||i.call(s,this,e),this.props.dom=null,this.props=null}}_canUpdate(){return this.props.dom&&!!this.props.dom.parentElement}_doUpdate(t){return!1!==this.props.update(this.props,t)}}const Ut=function(t){return new Wt(t).start()},Zt=function(t){return isNaN(t)?0:t};class qt{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}push(...t){return t.forEach((t=>{a(t)||n(t)?this._path.push(t):this._path.push(t.x,t.y)})),this}move(t,e){return a(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return a(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return a(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 a(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(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Zt(t[e]),Zt(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Zt(t[e].x),Zt(t[e].y));return this}polygon(...t){return a(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}donut(t,e,s,i){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 1 ${2*s} 0 a ${s} ${s} 0 1 1 ${2*-s} 0 Z`),this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${2*-i} 0 Z`),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}spline(t,e,s){let i=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void this.line(t[i+1].px,t[i+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},h={x:t[i+1].px-t[i].px,y:t[i+1].py-t[i].py};let l={x:0,y:0},_=Math.sqrt(h.x*h.x+h.y*h.y);if(0===_)return void this.line(t[s].px,t[s].py);h.x/=_,h.y/=_;let c=t[i+1].px-t[i].px,d=t[i].px,u=t[i].py;for(++i;i!=s;i++){a.x=-h.x,a.y=-h.y,h.x=t[i+1].px-t[i].px,h.y=t[i+1].py-t[i].py,_=Math.sqrt(h.x*h.x+h.y*h.y),h.x/=_,h.y/=_,h.x<a.x?(l.x=a.x-h.x,l.y=a.y-h.y):(l.x=h.x-a.x,l.y=h.y-a.y);const e=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=e,l.y/=e,a.y*h.y>=0&&(l={x:1,y:0}),n.x=-l.x*c*r,n.y=-l.y*c*r;const s=d+o.x,p=u+o.y,g=t[i].px+n.x,m=t[i].py+n.y;this.curve(s,p,g,m,t[i].px,t[i].py),c=t[i+1].px-t[i].px,o.x=l.x*c*r,o.y=l.y*c*r,d=t[i].px,u=t[i].py}this.curve(d+o.x,u+o.y,t[i].px,t[i].py,t[i].px,t[i].py)}closedSpline(t,e){const s=t.length;if(s<3)return void this.line(t[1].px,t[1].py);const i=.17,r=e?e=>t[(e+s)%s]:e=>e<0?t[0]:e>=s?t[s-1]:t[e];for(let t=0,n=s-(e?0:1);t<n;t++){const e=r(t-1),s=r(t),n=r(t+1),o=r(t+2),a=s.px+(n.px-e.px)*i,h=s.py+(n.py-e.py)*i,l=n.px-(o.px-s.px)*i,_=n.py-(o.py-s.py)*i;this.curve(a,h,l,_,n.px,n.py)}}}const Kt={position:"relative",width:"100%",height:"100%",boxSizing:"border-box","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"};class Qt extends lt{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._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{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._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(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=It.code||window.realChartLic,!e)throw new Error(s)}catch(t){throw new Error(s)}const i=Gt.decrypt(e);if("RealChart"!==i.name||"RealChart"!==It.name)throw new Error(s);try{const e=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(It.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(It.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&&$t.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,s||Qt.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),$t.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}win(){return this._dom.ownerDocument.defaultView}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}canvasCtx(){return this._canvas.getContext("2d")}setData(t,e,s){z(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))}addClip(t){return this._defs.appendChild(t.dom),t}clearDefs(){$t.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)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(t,"clipPath")).forEach((t=>t.remove()))}clearTemporaryDefs(){this.$_clearDefs(Jt.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}appendSvg(t){return t&&this._htmlRoot.append(t.dom),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)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}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){return this.addClip(new re(this.doc(),t,e,s,i,r,r))}clipCircle(){return this.addClip(new ae(this.doc()))}clipDonut(){return this.addClip(new he(this.doc()))}clipPath(){return this.addClip(new oe(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if($t.isElement(e)&&e.id===t){t=e;break}$t.isElement(t)&&t.parentNode===this._defs&&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}}getIEColor(t){return!t||t.startsWith("#")||t.startsWith("rgb")||(this._tester.style.color=t,t=getComputedStyle(this._tester).color),t}getRootDistance(){const t=this._svg.getBoundingClientRect(),e=this._root.getBounds();return{x:e.x-t.x,y:e.y-t.y}}_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(e,s,i){if(this._inited)return;const r=e.defaultView;s instanceof r.HTMLDivElement?this._container=s:this._container=e.getElementById(s),this._container instanceof r.HTMLDivElement||J(k.invalidOuterDiv,s),e=this._container.ownerDocument;const n=this._dom=e.createElement("div");l(n.style,Kt),n.className=i,this._container.appendChild(n);const o=this._svg=e.createElementNS(t,"svg");o.classList.add("rct-svg"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=e.createElement("desc");a.textContent="Created by RealChart v"+It.version,o.appendChild(a);const h=this._defs=e.createElementNS(t,"defs");this._initDefs(e,h),o.appendChild(h),n.appendChild(o),this._root=new se(this),o.appendChild(this._root._dom),this._htmlRoot=e.createElement("div"),n.appendChild(this._htmlRoot),l(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=e.createElement("div"),n.appendChild(this._tester),ot&&(this._canvas=e.createElement("canvas"))}_initDefs(e,s){let i=e.createElementNS(t,"filter");i.setAttribute("id",Qt.SHADOW_FILTER);const r=e.createElementNS(t,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=e.createElementNS(t,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=e.createElementNS(t,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=e.createElementNS(t,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=e.createElementNS(t,"feMerge"),l=e.createElementNS(t,"feMergeNode"),_=e.createElementNS(t,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}_canOverflowRender(){return!1}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{at.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,r=this._canvas;!r||r.width===s&&r.height==i||(r.width=s,r.height=i,r.style.width=F(s),r.style.height=F(i)),l(this._htmlRoot.style,{left:F(e.left-t.left),top:F(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),l(n.style,Kt),this._doRenderBackground(n,this._root,s,i);const o=this._padding=$t.getPadding(this._root.dom);this._doRender({x:o.left,y:o.top,width:s-o.left-o.right,height:i-o.top-o.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),at.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const i=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{i&&this.invalidateLayout(),this._resizeTimer=null}),s):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)}}Qt.CLASS_NAME="rct-control",Qt.SHADOW_FILTER="rr-chart-shadow-filter",Qt._animatable=!0;class Jt extends lt{constructor(e,s,i=N){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get win(){return this._dom.ownerDocument.defaultView}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,isNaN(t)?this.removeAttr("width"):this.setAttr("width",t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,isNaN(t)?this.removeAttr("height"):this.setAttr("height",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(e,s){const i=e.createElementNS(t,s);return this._dom.appendChild(i),i}insertElement(e,s,i){const r=e.createElementNS(t,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}removeAttr(t){return this._dom.removeAttribute(t),this}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return z(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(){let t=this._dom.getBBox();return ot&&(t={x:t.x,y:t.y,width:t.width,height:t.height}),t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){let s=this._dom.getBBox();return ot&&(s={x:s.x,y:s.y,width:s.width,height:s.height}),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._ani instanceof Wt||!!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,e=NaN){return e=isNaN(e)?t:e,this._scaleX===t&&this._scaleY===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=at.isValidNum(t)?t:this._tx,e=at.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)}$_cleanMove(t,e){var s;this._updateTransform(),e&&(null===(s=this.control)||void 0===s||s.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,s=0,i=!0){if(t=at.isValidNum(t)?t:this._tx,e=at.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._moveAni=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",(()=>{this.$_cleanMove(r,i)})),r.addEventListener("cancel",(()=>{this.$_cleanMove(r,i)}))):this.$_cleanMove(r,i)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,s=0,i=!0){if(t=at.isValidNum(t)?t:this._tx,e=at.isValidNum(e)?e:this._ty,this._moveAni&&(this._moveAni.cancel(),this._moveAni=null),t!==this._tx||e!==this._ty)if(s>0){const r=this._rotation||0,n=`translate(${this._tx||0}px, ${this._ty||0}px)`+(r?` rotate(${r}deg)`:""),o=`translate(${t}px, ${e}px)`+(r?` rotate(${r}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const a=this._moveAni=this._dom.animate([{transform:n},{transform:o}],{duration:s,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)})),a.addEventListener("cancel",(()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,i)}))):(this._dom.style.transformOrigin="",this.$_cleanMove(a,i))}else this._tx=t,this._ty=e,this._updateTransform();return this}transX(t){return t!==this._tx&&at.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&at.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")||"",this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",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(K(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(K(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(K(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let s in t)e.setProperty(K(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){n(t)?t&&this.addClass(t):s(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,b(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}stopAni(){return this._ani&&(this._ani.cancel(),this._ani=null),this}removeLater(t,e){return this._parent&&(t>0?this._ani=Ut({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=m(0,t.from*(1-e)),!0),endHandler:(t,s)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!s&&this.remove(),null==e||e(this)},from:y(getComputedStyle(this._dom).opacity,1)}):this.remove()),this}hide(t){return this._parent&&(t>0?this._ani=Ut({dom:this._dom,delay:t,update:(t,e)=>(t.dom.style.opacity=m(0,t.from*(1-e)),!0),endHandler:(t,e)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!e&&this.setVis(!1)},from:y(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}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=[];(at.isValidNum(e)||at.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+at.pick(this._originX,t.getAttribute("x"),0)+" "+at.pick(this._originY,t.getAttribute("y")||0)+")"),at.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=at.getNumber(this._scaleX,1),n=at.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.CLIP_KEY="_clip_",Jt.TEMP_KEY="_temp_";class te extends lt{constructor(e,s,i=!1){super(),this._control=s,this._dom=e.createElement("div"),i&&(this._svg=e.createElementNS(t,"svg"),$t.setStyles(this._svg,{width:"100%",height:"100%",boxSizing:"border-box",overflow:"visible"}),this._dom.appendChild(this._svg)),this._doInitDom(this._dom)}_doInitDom(t){t.style.position="absolute"}_doDestroy(){this._control=null,this._dom.remove()}get control(){return this._control}get dom(){return this._dom}addSvg(t){return t&&this._svg.appendChild(t.dom),t}setBounds(t,e,s,i){return $t.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${s}px`,height:`${i}px`}),this}setVis(t){return this._dom.style.display=t?this._getDisplay():"none",this}isVisible(){return"none"!==this._dom.style.display}setVisibility(t){return this._dom.style.visibility=t?"visible":"hidden",this}hasVisibility(){return"hidden"!==this._dom.style.visibility}_getDisplay(){return""}}class ee extends Jt{constructor(t,e){super(t,e,"g")}}class se extends Jt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class ie extends Jt{constructor(t){super(t,N,"clipPath");const e=this._id=at.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class re extends ie{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 ne extends Jt{constructor(t,e){super(t,e,"path")}get path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class oe extends ie{constructor(t){super(t),this._path=new ne(t),this.add(this._path)}getPath(){return this._path.path}setPath(t){this._path.setPath(t)}}class ae extends ie{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 he extends ie{constructor(t){super(t),this.add(this._donut=new ne(t))}setDonut(t,e,s,i){this._donut.setPath((new qt).donut(t,e,s,i).end())}}class le{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 _e,ce,de;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(_e||(_e={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(ce||(ce={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(de||(de={}));class ue extends Jt{constructor(t,e=void 0){super(t,e,"text"),this._layout=ce.TOP,this._overflow=de.WRAP,this._dirty=!0,this._text="",this.anchor=_e.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(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case ce.MIDDLE:i=Math.floor(s/2);break;case ce.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=m(0,t),(e=g(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}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 pe="$_TH",ge="$_TW";class me{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]?xt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=s[r+2]||"";else if(at.isDate(n)){const t=s[3]?Dt.getFormatter(s[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}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),N),0===this._literals[2].length&&(this._literals[2]=N)}else this._literals.push(r,n,N,N);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class fe extends me{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 ye extends fe{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 xe={t:class extends fe{tag(){return"</t>"}},b:class extends fe{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends fe{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:ye};class be{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 me).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 xe){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 xe[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 we=/<br.*?>|\r\n|\n/;class ve{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,i,r,n,o){if(this._isVertical)return void this.buildVertical(e,i,r,n,o);const a=e.doc,h=y(this.lineHeight,1),l=this._lines,_=l.length,c=[],d=[];e.clearDom(),n=n||e;const u=e.getStyle("writing-mode"),p=this._vertical=u===it||u===rt;for(let i=0;i<_;i++){const r=l[i];let u=0,g=0,f=null;for(let[h,l]of r.words.entries()){const c=0===i&&0===h,d=i===_-1&&h===r.words.length-1,y=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(s(n.options)){const t=n.options,e=c&&t.prefix||"",s=d&&t.suffix||"";y.textContent=e+(y.textContent||"")+s}const x=y.getBBox();if(y[ge]=x.width,y[pe]=x.height,p?(u=m(u,y[ge]),g+=y[pe]):(u+=y[ge],g=m(g,y[pe])),f||(f=y),l instanceof ye){const s=a.createElementNS(t,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(y),e.appendDom(s)}}d.push(f),r[pe]=g*h,r[ge]=u*h,c.push(0==i?r[ge]/2:r[ge])}if(_>0){let t=l[0];for(let s=1;s<d.length;s++)if(d[s]){let i=0,r=0;if(p?null!=d[s-1]&&(i=Math.floor(t[ge]-e.getAscent(t[ge]))+e.getAscent(l[s][ge])):r=t[pe]-e.getAscent(t[pe])+e.getAscent(l[s][pe]),null==d[0]&&d[s]==d.find((t=>null!=t))){const r=e.insertElement(a,"tspan",d[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[ge]=n.width,r[pe]=t[pe]=n.height,d[0]=r}switch(u){case it:d[s].setAttribute("dx",String(i)),d[s].setAttribute("y","0");break;case rt:d[s].setAttribute("dx",String(-i)),d[s].setAttribute("y","0");break;default:d[s].setAttribute("x","0"),d[s].setAttribute("dy",String(r))}t=l[s]}if(p){const t=e.parent.dom.classList.contains("rct-annotation"),s=e.getBBox().width,[i]=d,r=i[ge];if(t)i.setAttribute("dx",String(u===rt?s-r/2:r/2));else switch(u){case it:i.setAttribute("x",String((s-r)/-2));break;case rt:i.setAttribute("x",String((s-r)/2))}}else e.layoutText(l[0][pe])}}buildVertical(e,i,r,n,o){const a=e.doc,h=y(this.lineHeight,1),l=this._lines,_=l.length,c=[];let d=0;const u=[];e.clearDom(),n=n||e;for(let i=0;i<_;i++){const r=l[i];let p=0,g=0,f=null,y=!1;for(let[h,l]of r.words.entries()){const c=0===i&&0===h,d=i===_-1&&h===r.words.length-1,u=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(s(n.options)){const t=n.options,e=c&&t.prefix||"",s=d&&t.suffix||"";u.textContent=e+(u.textContent||"")+s}" "===u.textContent&&(y=!0,u.textContent=".");const x=u.getBBox();if(u[ge]=x.width,u[pe]=x.height,y&&(u.textContent=" ",u[pe]*=.6,y=!1),p+=u[ge],g=m(g,u[pe]),f||(f=u),l instanceof ye){const s=a.createElementNS(t,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(u),e.appendDom(s)}}u.push(f),r[pe]=g*h,r[ge]=p*h,d=m(p,d),c.push(0==i?r[ge]/2:r[ge])}if(_>0){let t=l[0];u[0].setAttribute("x",String((d-u[0].getBBox().width)/2));for(let s=1;s<u.length;s++)u[s]&&(u[s].setAttribute("x",String((d-u[s].getBBox().width)/2)),u[s].setAttribute("dy",String(t[pe]-e.getAscent(t[pe])+e.getAscent(l[s][pe]))),t=l[s]);e.layoutText(l[0][pe])}}layout(t,e,s,i,r){const n=t.getBBox();let o=0,a=0;if(this._vertical)switch(o=r.left+(s-r.left-r.right-n.width),e){case"center":t.anchor=_e.MIDDLE,a=r.top+(i-r.top-r.bottom)/2;break;case"right":t.anchor=_e.END,a=n.height-r.bottom;break;default:t.anchor=_e.START,a=r.top}else switch(a=r.top+(i-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=_e.MIDDLE,o=r.left+(s-r.left-r.right)/2;break;case"right":t.anchor=_e.END,o=s-r.right;break;default:t.anchor=_e.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const s=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(we);for(let t of s)e.push((new be).parse(t))}}}class Ve{constructor(t){this.source=t}hasDef(){return!0}}class Se extends Ve{_setStops(e,s){s.setAttribute("id",this.source.id);const r=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=i(r)?[...r]:[r,"white"],a=i(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(e,s,i,r,n){const o=e.createElementNS(t,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(e,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class Ae extends Se{getEelement(e,s){const i=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,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}}Ae.TYPE="lineargradient";class Pe extends Se{getEelement(e,s){const i=e.createElementNS(t,"radialGradient");return z(s.cx)||i.setAttribute("cx",s.cx),z(s.cy)||i.setAttribute("cy",s.cy),z(s.r)||i.setAttribute("r",s.r),this._setStops(e,i),i}}Pe.TYPE="radialgradient";class ke extends Ve{prepare(){}getEelement(e,i){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,h,_,c,d=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rct-pattern"),+i.pattern>=0){const t=ke.STOCK[+i.pattern%ke.STOCK.length];a=t.path,h=t.style,d=!t.fill,_=t.width||20,c=t.height||20}else n(i.pattern)&&(a=i.pattern,_=i.width||i.height||20,c=i.height||i.width||20);r.setAttribute("width",String(_)),r.setAttribute("height",String(c)),o.setAttribute("d",a),h&&l(o.style,h),i.style&&l(o.style,i.style),d&&(o.style.fill="none");let u=i.backgroundStyle;if(n(u)||s(u)){const s=e.createElementNS(t,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(_)),s.setAttribute("height",String(c))}return r.append(o),r}}ke.TYPE="pattern",ke.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 Ce extends Ve{prepare(){const t=this.source;this._colors=i(t.colors)?t.colors.slice():[],"random"===t.mode?this._index=-1:("shuffle"===t.mode&&at.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=i(e.colors)?e.colors:[]}}Ce.TYPE="colors";class Ne extends Ve{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(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 n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||Ne.SIZE,height:e.height||e.width||Ne.SIZE})}}Ne.TYPE="images",Ne.SIZE=20;class Le{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(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(s(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(s(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ke.TYPE:i(t.colors)?e=Ce.TYPE:i(t.images)&&(e=Ne.TYPE)),e)switch(e.toLowerCase()){case Ae.TYPE:return new Ae(t);case Pe.TYPE:return new Pe(t);case ke.TYPE:return new ke(t);case Ce.TYPE:return new Ce(t);case Ne.TYPE:return new Ne(t)}}}}let Me=0;const Ee=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},Be=["__proto__","constructor","prototype"],Te=function(t,r){const n=s(t)?t:{};for(const t in r)if(e.call(r,t)&&!Be.includes(t)){const e=r[t];i(e)?n[t]=e.slice(0):s(e)?e._obj instanceof dt?n[t]=e:at.isDate(e)?n[t]=new Date(e):n[t]=Te(n[t],e):n[t]=e}return n};class Oe extends lt{constructor(t){super(),this.chart=t,Me++}init(){const t=this._op=Te({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(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}$_updateChildren(t){if(this._children)this._children.forEach((e=>t.hasOwnProperty(e)&&this[e].updateOptions(t[e])));else{this._children=[];for(const e in this){const s=this[e];s instanceof Oe&&(this._children.push(e),t.hasOwnProperty(e)&&s.updateOptions(t[e]))}}}$_mergeOptions(t,e){const r=s(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];i(n)?r[t]=n.slice(0):s(n)?n instanceof dt?r[t]=n:n._obj instanceof dt?r[t]=n._obj:this[t]instanceof Oe?at.isDate(n)&&(r[t]=new Date(n)):r[t]=this.$_mergeOptions(r[t],n):r[t]=n}}updateOptions(t,e=!0){const i=this._op;return void 0===t||this._doSetSimple(t)||this.$_mergeOptions(i,t),this.$_applyOptions(i),s(t)&&this.$_updateChildren(t),e&&this._changed(),this}updateOption(t,e,s=!0,i=!1){if(this[t]instanceof Oe)this[t].updateOptions(e);else{const r=this._op;(i||e!==r[t])&&(r[t]=e,this.$_applyOptions(r),s&&this._changed())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s.hasOwnProperty(t)&&(this[t]instanceof Oe?this[t]._doSetSimple(!h(i)||!i):(s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,s=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Oe)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;e.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),s&&this._changed()}return this}clearOptions(t=!0){const e=function(t){var s;if(t){const i=t._op=Te({},t.constructor.defaults);return t.$_applyOptions(i),null===(s=t._children)||void 0===s||s.forEach((s=>{i[s]=e(t[s])})),i}};return e(this),t&&this._changed(),this}setStyle(t,s,i=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==s&&""!==s||(s=void 0),void 0===s?r&&e.call(r,t)&&(delete r[t],n=!0):r&&r[t]==s||(r||(r=this._style=this._op.style={}),r[t]=String(s),n=!0),n&&(this.$_applyOptions(this._op),i&&this._changed()),this}setStyles(t,e=!1,i=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),s(t)){n||(n=this._style=this._op.style={});for(const e in t){let s=t[e];n[e]!=s&&(null!==s&&""!==s||(s=void 0),void 0===s?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),i&&this._changed()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof Oe?t[r]=this[r]._load(n):i(n)?t[r]=n.slice(0):s(n)?n._obj instanceof dt?t[r]=n._obj:at.isDate(n)?t[r]=new Date(n):t[r]=l({},n):t[r]=n)}}_doSave(t,e,s){const r=this._op;for(const n in r)if(r.hasOwnProperty(n))if(s&&this[n]instanceof Oe)t[n]=this[n].saveOptions(!0);else{const s=r[n];i(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=X(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}Oe.REFRESHED="refreshed",Oe.defaults={visible:!0};class De{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 Re extends Oe{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=y(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?xt.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 ve),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}_getNumberText(t,e,s){if(at.isValidNum(t)){const i=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(i&&(t=i.toNum(t)),n=at.scaleNumber(t,r,s)),i?n?i.toStr(n.value)+n.symbol:i.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this._getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}Re.defaults=Ee(Oe.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class $e extends Re{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 Ne&&(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 Ne?s.getImage(r):i}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}$e.defaults=Ee(Re.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Fe extends Oe{}const Ie={};class ze extends Oe{static register(...t){t.forEach((t=>{Ie[t.type]=t}))}constructor(t,e){super(t),this.body=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}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.body){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.getAxisOf(this,!0);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.getAxisOf(this,!1);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=W(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=W(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(Oe.REFRESHED)}clicked(){return!1}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,this._row=isNaN(t.row)?NaN:t.row|0,this._col=isNaN(t.col)?NaN:t.col|0,(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){}}ze.defaults=Ee(Oe.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class He extends De{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getPaneVisibles(t,e){return this._visibles.filter((s=>{const i=s.options.row,r=s.options.col;return t===i&&e===r}))}getAnnotation(t){const e=this._map[t];if(e instanceof ze)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.owner.chart,n=this._items=[],o=this._map={};i(t)?t.forEach(((t,s)=>{n.push(this.$_loadItem(r,t,s,e?this.owner:void 0))})):s(t)&&n.push(this.$_loadItem(r,t,0,e?this.owner:void 0)),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):N}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,i);return a.init(),a.index=s,a._load(e),a}}class Ge extends Yt{constructor(t,e,s,i){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=s,this.start(i)}getPos(t,e){const s=this._axis,i=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=s._vlen;if(i<=0)return t;if(i>=r)o=i<=0?a:a+a*(i-r)/i*(1-n),t=t*o/a;else{o=a+a*(r-i)/r*(1-n),t=t*a/o}return t+this._offset*(o/i)*(1-n)*(e?-1:1)}_doUpdate(t){return this.$_calcRange(t),this._axis._changed(),!0}_doStop(){this._axis.setAniRange(NaN,NaN),this._axis._ani=null,this._axis=null}$_calcRange(t){const e=this._prevMin;this._prevMax;const s=this._axis.axisMin(),i=this._axis.axisMax();this._axisLen=i-s,this._offset=s-e}}class je extends Oe{}je.defaults=Ee(Oe.defaults,{minWidth:50});class Xe extends Oe{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this.flag=new je(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 this.chart.win.Date?Dt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek):xt.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 r(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}Xe.defaults=Ee(Oe.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm",markerHovering:!1});const Ye={};class We extends Oe{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Ue extends We{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Ue.defaults=Ee(We.defaults,{visible:void 0});class Ze extends We{getRotation(){const t=this._op;if(this.axis._isHorz)return 0;if(isNaN(this._rotation)){const e=t.writingMode;return ot?"vertical"===e?0:"opposite"===this.axis.options.position?90:270:"vertical"===e||"vertical-lr"===e||"vertical-rl"===e?0:"opposite"===this.axis.options.position?90:270}return this._rotation}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation)}}Ze.defaults=Ee(We.defaults,{align:"middle",offset:0,gap:5});class qe extends We{_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}qe.defaults=Ee(We.defaults,{position:"end",gap:2});class Ke extends We{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 n(t)?(this._op.colors=[t,null],!0):i(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Qe extends We{_doInit(t){t.rows=(this._rows=new Ke(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}}Qe.defaults=Ee(We.defaults,{visible:void 0,depthVisible:void 0});class Je extends $e{getDefaultIconPos(){return"left"}}Je.defaults=Ee($e.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class ts extends We{_doInit(t){t.label=(this._label=new Je(this.axis.chart)).init()}get label(){return this._label}canConstainedTo(t,e){const s=this._op;if(i(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(i(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}ts.defaults=Ee(We.defaults,{front:!1,zindex:0});class es extends ts{}class ss extends ts{}class is extends We{canUseNumSymbols(){return!0}_getLength(){return this._length}_getGap(){return this._gap}_doSetSimple(t){return at.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),isFinite(this._op.length)?this._length=this._op.length:this._length=this.axis.label._inside?0:is.DEF_LENGTH,this._gap=this._op.gap||0}}is.DEF_LENGTH=7,is.defaults=Ee(We.defaults,{visible:!1,gap:3});class rs extends $e{constructor(t){super(t&&t.chart),this.axis=t,this._domain={callback:(t,e)=>this._getParamValue(this._paramTick,e)}}_getParamValue(t,e){return e.startsWith("axis.")?this.axis[e.substring(5)]:t[e]}getLabelText(t,e){var s;const i=this._op,r=t.index;if(i.textCallback){const e=i.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?b(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?b(i.firstText,i.text):r==e-1?b(i.lastText,i.text):i.text}getLabelStyle(t,e){const i=this._op,r=t.index;if(i.styleCallback){const e=i.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(s(e))return e}return 1==e?i.lastStyle||i.firstStyle:0==r?i.firstStyle:r==e-1?i.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===t.location}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}_getText(t,e,s,i){return n(t)?t:this._getNumberText(e,s,i)||e}}rs.defaults=Ee($e.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class ns extends We{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)}}ns.defaults=Ee(We.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class os{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}clamp(t,e=!0){return e?at.clamp(t,this.min,this.max):at.clamp(t,Math.floor(this.min),Math.ceil(this.max))}resize(t,e,s){if(t>e){const s=t;t=e,e=s}const i=t!==this.start||e!==this.end,r=this.total(),n=this.axis.continuous();t=isNaN(t)?this.start:this.clamp(t,n);const o=(e=isNaN(e)?this.end:this.clamp(e,n))-t;if(i&&e>=t&&(isNaN(s)||o/r>=s)&&r/o>1)return this.axis._range={min:n?t:Math.floor(t),max:n?e:Math.ceil(e-1)},this.start=t,this.end=e,!0}}class as extends Ue{}class hs extends Oe{static register(...t){t.forEach((t=>{Ye[t.type]=t,t.subtype&&(Ye[t.subtype]=t)}))}setAniRange(t,e){this._aniMin=t,this._aniMax=e}constructor(t,e){super(t),this._series=[],this._values=[],this._labelArgs={},this.guides=[],this._seriesChanged=!1,this._isX=e}_doInit(t){t.title=(this._title=new Ze(this)).init(),t.unitLabel=(this._unitLabel=new qe(this)).init(),t.line=(this._line=new Ue(this)).init(),t.sectorLine=(this._sectorLine=new as(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 Xe(this)).init(),t.scrollBar=(this._scrollBar=new ns(this)).init()}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}get title(){return this._title}get unitLabel(){return this._unitLabel}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}checkVisible(){return!0===this._op.visible||!1!==this._op.visible&&!this._isEmpty}getBaseValue(){return NaN}length(){return this._max-this._min}axisMin(){return this._min}axisMax(){return this._max}valueMin(){return this._min}valueMax(){return this._max}axisValueAt(t,e){return this.valueAt(t,e)}getStartAngle(){return E+B*this._op.startAngle}getTotalAngle(){return B*this._op.totalAngle}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}getXStart(){return 0}dataToAxis(t){return t}axisToData(t){return t}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(){const t=this._values=[];this._isX?this._series.forEach((e=>{e.collectValues(this,e.needAxes()?t:null)})):this._series.forEach((e=>{const s=e.needAxes()?[]:null;e.collectValues(this,s),s&&(e._yMin=g(...s),e._yMax=m(...s),t.push(...s))}))}collectRanges(){this._series.forEach((t=>{t.needAxes()&&t.collectRanges(this,this._values)}))}collectReferentValues(){this._series.forEach((t=>{t.prepareReferents(this)})),this.$_checkEmpty()}$_checkEmpty(){this._isEmpty=this._checkEmpty()}_prepare(){this._series=this._series.filter((t=>t._valid)),this.$_checkEmpty()}_checkValues(t){return t}_prepareRender(){const t=this.chart,e=this._op.position;this._isPolar=t.isPolar(),this._isHorz=t.isInverted()?!this._isX:this._isX,this._isBetween=t.isSplitted()&&"between"===e&&this._isX,this._isOpposite="opposite"===e,this._runPos=e,this._crosshair._setAxis(this._labelArgs.axis=this),this._doPrepareRender(),this._label._prepareRender(),this._tick._prepareRender();const s=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&s.length>0)if(t.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+=y(s.groupWidth(),1))})),s.forEach((s=>{if(s.row==t&&s.isClusterable()){const t=y(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=y(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=y(s.groupWidth(),1)/t;s.setCluster(i,e),e+=i}}))}}afterRender(){this._seriesChanged=!1,this._prevSeries=this._series,this._zooming=!1}_buildTicks(t,e){this._ticks=this._doBuildTicks(this._range.min,this._range.max,this._vlen=t,e),this._labelArgs.count=this._ticks.length}_calcPoints(t,e){this._ticks.forEach((e=>e.pos=this.getPos(t,e.value)))}getLabelLength(t,e){return this.getUnitLen(t,e)}getValue(t){return null==t?NaN:parseFloat(t)}incStep(t,e){return t+at.getNumber(e)}contains(t){return t>=this._min&&t<=this._max}trimRange(t,e){return[m(t,this._min),g(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new os(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.chart=this.chart.wrapper,this._labelArgs.index=t,this._labelArgs.value=e,this._labelArgs}getXLabel(t){return t}setPrevRate(t,e){this._prevSize=t,this._prevRate=e}prev(t){return isNaN(this._prevRate)?t:(this._op.reversed,t*this._prevRate)}checkExtents(t,e){var s;null===(s=this._ani)||void 0===s||s.cancel(),this._min===t&&this._max===e||(this._ani=new Ge(this,t,e,(()=>{this._changed()})))}isAnimating(){return!isNaN(this._aniMin)}_posValue(){const t=this._op.position;return"opposite"===t?-1:"between"===t?0:1}_load(t){return this.chart?super._load(this.chart.loadBase(t,this._isX?"xAxis":"yAxis",this._type())):super._load(t)}_doApply(t){const s=this,r=this.guides,n=function(t){var e;t!==s._guides&&(s._guides=t,e=i(t)?t:[t],r.length=0,e.forEach((t=>{let e;e="range"===t.type?new ss(s):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new es(s):new ss(s),e.init(),e._load(t),r.push(e)})))};super._doApply(t),t.startAngle=y(this._op.startAngle,0),t.totalAngle=m(0,g(360,y(this._op.totalAngle,360))),this._name=t.name||`-axis-${this._index+1}`,this._row=y(Math.max(0,t.row|0),0),this._col=y(Math.max(0,t.col|0),0),e.call(t,"guide")?n(t.guide):e.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&this._series.indexOf(t)<0&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?D(g(...t)||0):NaN,max:t.length>0?D(m(...t)||0):NaN}}}hs.defaults=Ee(Oe.defaults,{visible:void 0,row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,marginNear:0,marginFar:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"],animatable:!0,fixedSize:!1});class ls extends De{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;i(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),this._items.forEach((t=>{t.name&&this._map.set(t.name,t)}))}visibles(){return this._items.filter((t=>t.checkVisible()))}contains(t){return this._items.indexOf(t)>=0}get(t){return n(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t,e){this._items.sort(((t,e)=>t.isBased()?1:e.isBased()?-1:0)).forEach((s=>{(e<=2||s._isHorz)&&s._buildTicks(t,e)}))}connect(t){const e=this.isX,s=this._items,i=t.options,r=e?i.xAxis:i.yAxis;let o;if(a(r)&&r>=0&&r<s.length?o=s.find((t=>t._index===r)):n(r)&&(o=s.find((t=>t.options.name===r))),o||(o=s[0]),o&&this.chart.isValidAxis(o))return o._connect(t),this.isX?t.setCol(o.col):t.setRow(o.row),o}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,s){var r;let n=t._getAxisType(e.type);if(!n){let o;if(i(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(z(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(r=t._getSeries().first)||void 0===r?void 0:r.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._index=s,o.init(),o._load(e),o}}class _s extends Oe{_doPrepareRender(t){}}const cs={},ds={};class us extends _s{constructor(){super(...arguments),this.index=-1}_type(){return this.constructor.type}get name(){return this._name}get row(){return this._row}get col(){return this._col}getSize(t,e){return{width:W(this._widthDim||this._sizeDim,t,t),height:W(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return W(this._leftDim,t)}getRight(t){return W(this._rightDim,t)}getTop(t){return W(this._topDim,t)}getBottom(t){return W(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._row=y(t.row|0,0),this._col=y(t.col|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}us.defaults=Ee(_s.defaults,{size:"100%"});class ps extends Oe{constructor(t){super(t.chart)}}class gs extends us{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach((t=>{cs[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}}gs.defaults=Ee(us.defaults,{duration:500});class ms extends us{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach((t=>{ds[t.type]=t,ds[t.gaugeType]=t}))}get gauges(){return this._gauges.slice(0)}count(){return this._gauges.length}isEmpty(){return this._gauges.length<1}visibles(){return this._visibles.slice(0)}get(t){return this._gauges[t]}getVisible(t){return this._visibles[t]}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}_doApply(t){super._doApply(t),e.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const r=this._gaugesType();i(e)?e.forEach(((e,s)=>this.$_add(gs._loadGauge(t,e,r)))):s(e)&&this.$_add(gs._loadGauge(t,e,r))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}ms.defaults=Ee(us.defaults,{minValue:0});class fs extends De{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.row||0,r=s.col||0;return t===i&&e===r}))}getGauge(t){const e=this._map[t];if(e instanceof gs)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,r=this._items=[],n=this._map={};i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof ms)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._op.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(cs).length&&0===Object.keys(ds).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 r=i(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(r||(r=t._getGaugeType(e.type||t.gaugeType)),!r)throw new Error("Invalid gauge type: "+e.type);const n=new r(t);return n.init(),n._load(e),n.index=s,n}}class ys extends gs{constructor(){super(...arguments),this._prevValue=0}_doInit(t){super._doInit(t),t.label=(this._label=this._createLabel()).init()}get label(){return this._label}getValue(){return m(this._op.minValue,g(this._op.maxValue,y(this._runValue,this._op.value)))}_setValueRate(t){this._runValue=this._prevValue+(this._op.value-this._prevValue)*t}updateValue(t){t!==this._op.value&&(this._op.value=t,this._changed())}getLabel(t,e){return t.options.text||(t.options.prefix||"")+"${value}"+(t.options.suffix||"")}getParam(t){switch(t){case"value":return this.label.options.animatable?y(this._runValue,this._op.value):this._op.value;case"min":return this._op.minValue;case"max":return this._op.maxValue}}calcedMinMax(){return{min:this._op.minValue,max:this._op.maxValue}}}ys.defaults=Ee(gs.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class xs extends Oe{constructor(t){super(t.chart),this.scale=t}}xs.defaults=Ee(Oe.defaults,{reversed:!1,length:7});class bs extends $e{getText(t){return at.isValidNum(t)?this._getText(null,t,f(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class ws extends Oe{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new Oe(e)).init(),t.tick=(this._tick=new xs(this)).init(),t.label=(this._label=new bs(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=y(s,e);const{min:i,max:r}=this._adjustMinMax(g(e,s),m(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(m(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=y(s.options.minValue,t),e=y(s.options.maxValue,e),this._min=g(t,e),this._max=m(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=g(...t)),isNaN(i)&&(i=m(...t)),this._min=g(s,i),this._max=m(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(D(e));for(let e=1;e<t;e++)n.push(D(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(D(l=s));;){if(l+=o,l>=i){r.push(D(i));break}r.push(D(l))}return r}}ws.defaults=Ee(Oe.defaults,{position:"default",stepPixels:48,gap:8});class vs extends Oe{}vs.defaults=Ee(Oe.defaults,{visible:!1});class Vs extends Oe{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new vs(e)).init(),t.tickLabel=(this._tickLabel=new Oe(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?W(this._thicknessDim,t,0):"inside"===this._op.position?t:Vs.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=tt(this._ranges,t.min,t.max,!1,!0)||[]}return this._runRanges}}Vs.defaults=Ee(Oe.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Ss extends Re{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Ss.defaults=Ee(Re.defaults,{animatable:!0});class As extends Ss{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}As.defaults=Ee(Ss.defaults,{offsetX:0,offsetY:0});class Ps{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ks.DEF_CENTER),this.setCenterY(ks.DEF_CENTER),this.setRadius(ks.DEF_RADIUS),this.setInnerRadius(ks.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=X(b(t,ks.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=X(b(t,ks.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=X(b(t,ks.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=X(b(t,ks.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=X(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),s=g(e,this._innerDim?W(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?W(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=y(t%360,0),i=m(0,g(360,y(e,360)));this._startRad=E+B*s,this._handRad=B*s,this._sweepRad=B*i}}class ks extends ys{_doInit(t){super._doInit(t),this._props=new Ps}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}_createLabel(){return new As(this.chart)}_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 Ps)}_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)}}ks.DEF_CENTER="50%",ks.DEF_RADIUS="40%",ks.DEF_INNER="80%",ks.defaults=Ee(ys.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Cs extends ms{_doInit(t){this.props=new Ps,t.label=(this._label=new As(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)}}Cs.defaults=Ee(ms.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Ns=class extends Oe{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};Ns.defaults=Ee(Oe.defaults,{visible:void 0});class Ls extends Re{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||Ls.DEF_TEXT}}Ls.DEF_TEXT="표시할 데이터가 없습니다.",Ls.defaults=Ee(Oe.defaults,{visible:void 0});class Ms extends Oe{}Ms.defaults=Ee(Oe.defaults,{visible:!1});class Es extends Oe{_doInit(t){t.line=(this._line=new Ms(this.chart)).init(),t.endLine=(this._endLine=new Ms(this.chart)).init(),t.gridLine=(this._gridLine=new Ms(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}Es.defaults=Ee(Oe.defaults,{});class Bs extends Oe{_doInit(t){t.xSide=(this._xSide=new Es(this.chart)).init(),t.ySide=(this._ySide=new Es(this.chart)).init(),t.orgLine=(this._orgLine=new Ms(this.chart)).init()}get xSide(){return this._xSide}get ySide(){return this._ySide}get orgLine(){return this._orgLine}_isVisible(){return this._op.visible&&this._op.length>=0}_doSetSimple(t){return a(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.angle=g(60,m(30,y(t.angle,45)))}}Bs.defaults=Ee(Oe.defaults,{visible:!1,length:32,angle:32});class Ts extends Oe{constructor(t){super(t),this._annotations=new He(this)}_doInit(t){t.depth=(this._depth=new Bs(this.chart)).init(),t.image=(this._image=new Fe(null)).init(),t.emptyView=(this._emptyView=new Ls(this.chart)).init(),t.zoomButton=(this._zoomButton=new Ns(this)).init()}anchorByName(t){var e;const s=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return s instanceof us&&this.contains(s)?s:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get zoomButton(){return this._zoomButton}canZoom(){return!this.chart.isEmpty(!0)&&("x"===this._op.zoomType||"y"===this._op.zoomType||"both"===this._op.zoomType)}_getDepth(t,e){if(this._depth.visible&&this.chart._getSeries().canDepth()){const s=this._depth.options,i=s.length,r=s.angle,n=c(d(r*B)*i),o=c(u(r*B)*i);return{depth:i,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return W(this._radiusDim,g(t,e))}setPolar(t,e){return this._cx=W(this._centerXDim,t),this._cy=W(this._centerYDim,e),this._rd=W(this._radiusDim,g(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,cyclic:t&&t.options.totalAngle>=360}:void 0}isZoomed(){return this.chart._getXAxes().isZoomed()||this.chart._getYAxes().isZoomed()}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}contains(t){return!0}_doApply(t){const s=this,i=function(t){t!==s._anns&&(s._anns=t,s._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),e.call(t,"annotation")?i(t.annotation):e.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}Ts.defaults=Ee(Oe.defaults,{circular:!0,zoomType:"none",radius:"45%",centerX:"50%",centerY:"50%"});class Os extends Oe{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)}}Os.defaults=Ee(Oe.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Ds extends Oe{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class Rs extends _s{constructor(){super(...arguments),this._items=[],this._visItems=[],this._itemMap={}}items(){return this._visItems.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 W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(this._maxHeightDim,t,t)}getMarkerSize(){return y(this._op.markerSize,10)}getSources(t){const e=this._itemMap[t.source.legendKey()];return e?e.map((t=>t.source)):t.source}_isVisible(){return!0===this._op.visible&&this._visItems.length>0||!1!==this._op.visible&&this._visItems.length>1}_doApply(t){super._doApply(t),this._setDims(t,"maxWidth","maxHeight")}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=b(e.location,"bottom"),this._items=this._getLegendSources().map((t=>new Ds(this,t))),e.reversed&&(this._items=this._items.reverse());const s=this._itemMap={},i=this._visItems=[];this._items.forEach((t=>{const e=t.source.legendKey();if(at.isNotEmpty(e)&&""!==e){const r=s[e];r?r.push(t):(s[e]=[t],i.push(t))}else i.push(t)}))}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var $s;Rs.defaults=Ee(_s.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 Fs=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Is=.001;class zs{static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>this[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}static line(t,e,s,i){return["M",t,e,"L",s,i]}static polygon(...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=g(f(i)/2,s/2,r),n=g(f(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=g(f(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=g(f(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=g(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 isCircled(t){return M-t<Is}static arc(t,e,s,i,r,n,o,a=!1){const h=g(M,f(n-r)),l=this.isCircled(h),_=h>L?1:0,c=o?1:0,p=d(r),m=u(r),y=d(n-=l?c?Is:-.001:0),x=u(n),b=[];return b.push("M",t+s*p,e+i*m,"A",s,i,0,_,c,t+s*y,e+i*x),l&&b.push("M",t,e),a&&b.push("Z"),b}static sector(t,e,s,i,r,n,o,a){const h=g(M,f(o-n)),l=this.isCircled(h),_=h>L?1:0,c=a?1:0,p=d(n),m=u(n),y=d(o-=l?c?Is:-.001:0),x=u(o),b=s*r,w=i*r,v=[];return v.push("M",t+s*p,e+i*m,"A",s,i,0,_,c,t+s*y,e+i*x),l?v.push("M",t+b*y,e+w*x):v.push("L",t+b*y,e+w*x),r>0&&v.push("A",b,w,0,_,1-c,t+b*p,e+w*m),v.push("Z"),v}static donut(t,e,s,i){return["M",t-s,e,"a",s,s,0,1,1,2*s,0,"a",s,s,0,1,1,2*-s,0,"Z","M",t-i,e,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0,"Z"]}static arc3d(t,e,s,i,r,n,o,a,h){function l(t,e,n,o){b.push("M",t,e,"A",s,i,0,c,_,n,o),b.push("L",n,o+r),b.push("A",s,i,0,c,1-_,t,e+r),b.push("Z")}const _=a?1:0;let c,p=g(M,f(o-n));const m=this.isCircled(p);let y=(n%M+M)%M,x=(o%M+M)%M;const b=[];let w,v,V,S;if(!m&&(_&&y<=L&&x>=0&&x<y||!_&&x<=L&&y>=0&&y<x))c=0,_?(w=t+s*d(n),v=e+i*u(n),V=t+s*d(L),S=e+i*u(L),l(w,v,V,S),h&&(h.x1=w,h.y1=v),w=t+s*d(0),v=e+i*u(0),V=t+s*d(o),S=e+i*u(o),l(w,v,V,S),h&&(h.x2=V,h.y2=S)):(w=t+s*d(n),v=e+i*u(n),V=t+s*d(0),S=e+i*u(0),l(w,v,V,S),h&&(h.x1=w,h.y1=v),w=t+s*d(L),v=e+i*u(L),V=t+s*d(o),S=e+i*u(o),l(w,v,V,S),h&&(h.x2=V,h.y2=S));else{w=t+s*d(n),v=e+i*u(n),V=t+s*d(o-=m?_?Is:-.001:0),S=e+i*u(o),_?(y=m||y<=M&&!(x>=y&&x<M)?0:y,x=m||x>L&&!(y<=x&&y>L)?L:x):(y=m||y>L&&!(x<=y&&x>L)?L:y,x=m||x<M&&!(y>=x&&y<M)?0:x);const r=t+s*d(y),a=e+i*u(y),p=t+s*d(x-=m?_?Is:-.001:0),g=e+i*u(x);c=f(x-y)>L?1:0,l(r,a,p,g),h&&(h.x1=w,h.y1=v,h.x2=V,h.y2=S)}return b}static arc3dInner(t,e,s,i,r,n,o,a,h){const l=g(M,f(o-n)),_=this.isCircled(l),c=a?1:0,p=t+s*d(n),m=e+i*u(n),y=t+s*d(o-=_?c?Is:-.001:0),x=e+i*u(o),b=l>L?1:0,w=[];return w.push("M",p,m,"A",s,i,0,b,c,y,x),w.push(_?"M":"L",y,x+r),w.push("A",s,i,0,b,1-c,p,m+r),h&&(h.x1=p,h.y1=m,h.x2=y,h.y2=x),w.push("Z"),w}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*u(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,p=c/2,g=[];g.push("M",n+a*d(r),o+h*u(r));for(let t=0;t<5;t++)g.push("L",n+a*d(r),o+h*u(r),"L",n+l*d(r+p),o+_*u(r+p)),r+=c;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=$s[e](0,0,m(2*s,0),m(2*i,0));break;default:r=$s.circle(s,i,m(g(s,i),0))}t.setPath(r)}}$s=zs,zs._drawers=Object.assign({circle:t=>$s.circle(0,0,t),none:t=>[]},$s._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Hs extends Jt{static create(t,e,s,i,r,n,o=0){return new Hs(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=N,s=N){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 Gs extends ne{constructor(t,e){super(t,e)}setBox(t,e,s,i){return this.setPath(zs.box(t,e,s,i)),this}}const js="head",Xs="far",Ys="inside",Ws="none",Us="near",Zs="displayAll",qs="largestFirst",Ks="hidden",Qs="line",Js="area",ti="circlebar",ei="treemap",si="heatmap",ii="vector",ri="wordcloud",ni="pictogram",oi="pictorialbar",ai="pictorial",hi="racebar",li="raceline";let _i=0;const ci="_deleted",di="_drop",ui="_save";class pi{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=_i++,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:i(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?(this._readObject(t,e),(i(e.drillDown)||s(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}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]];if(null!=i&&"object"==typeof i)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[ci]=!0}_isDeleted(){return this[ci]}_setDrop(t){this[di]=t}_getDrop(){return this[di]}_setSave(t){this[ui]=t}_getSave(){return this[ui]}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):i(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=N}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return l(t,{index:this.index,vindex:this.vindex,x:this.x,y:this.y,xValue:this.xValue,yValue:this.yValue,color:this.color,yLabel:this.yLabel,source:this.source})}_readArray(t,e){const s=t.options,i=+s.colorField,r=+s.iconField;e.length>1?(this.x=e[y(s.xField,0)],this.y=e[y(s.yField,1)]):this.y=e[0],isNaN(i)||(this.color=e[i]),isNaN(r)||(this.icon=e[r])}_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=w(t._yFielder(e),e.y,e.value),this.color=b(t._colorFielder(e),e.color),this.icon=b(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 gi{constructor(t){this._points=[],this._owner=t}get owner(){return this._owner}get count(){return this._points.length}isEmpty(){return this._points.length<1}_internalPoints(){return this._points}get(t){return this._points[t]}pointAt(t,e){function i(t,e,i){return s(t)?t.pid===e:t===i}return this._points.find((s=>i(t,s.pid,s.xValue)&&(void 0===e||i(e,s.pid,s.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){i(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach((t=>{const s=this._points.indexOf(t);s>=0&&(t._setDeleted(),e.push(t),this._points.splice(s,1))})),e}clean(){this._points=this._points.filter((t=>!t[ci]))}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){const e=this._points,s=t._zoom;if(this._owner.needAxes()&&s){const s=t._range;let i=t.axisToData(s.min),r=t.axisToData(s.max);return t.continuous()?e.filter((t=>t.xValue>=i&&r>=t.xValue)).slice(0):e.filter((t=>t.xValue>i-.5&&r+.5>t.xValue)).slice(0)}return e}}class mi extends pi{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return l(super._assignTo(t),{z:this.z,zValue:this.zValue})}_valuesChangd(t){return this.z!==t.z||super._valuesChangd(t)}_readArray(t,e){if(e.length<=1)this.isNull=!0;else{const s=t.options,i=e.length>2?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.y=e[y(s.yField,0+i)],this.z=e[y(s.zField,1+i)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=b(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.zValue=this.zValue||0}applyValueRate(t,e){this.zValue=V(t.zValue,this.zValue,e)}}class fi extends pi{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return l(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[y(s.lowField,0+i)],this.y=e[x(s.highField,s.yField,1+i)],i>0&&(this.x=e[y(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=b(e[t.options.lowField],e.low),this.y=w(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||0}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class yi extends is{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}yi.defaults=Ee(is.defaults,{step:1});class xi extends rs{getTick(t,e){if(null!=e){const t=this._getText(e,e,!1,!1),s=t.lastIndexOf(this.sep);return i(this.axis.options.categoryField)&&s>0?t.substring(s+this.sep.length):t}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}xi.defaults=Ee(rs.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class bi extends Qe{getPositions(t){const e=t._ani,s=t._pts,i=t.options.reversed,r=t._ticks.length,n=[];if(r>0){const o=Math.max(1,t.tick.options.step||1);if(o>1)for(let t=0,a=1,h=s.length;t<=r&&a<h;t++,a+=o)n.push(e?e.getPos(s[a],i):s[a]);else for(let t=0;t<=r;t++)n.push(e?e.getPos(s[t+1],i):s[t+1])}return n}}class wi extends hs{constructor(){super(...arguments),this._minPad=0,this._maxPad=0,this._catStart=0,this._catStep=1,this._map={},this._catPad=0,this._tstep=1}get tick(){return this._tick}get label(){return this._label}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}getCategorySeparator(){return this._op.categorySeparator||"+"}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new os(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new bi(this)}_createTickModel(){return new yi(this)}_createLabel(){return new xi(this)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this._isEmpty,this._isEmpty?this._values=at.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){var t;let e=super.getStartAngle(),s=+this._op.startOffset;return s>0&&(e-=g(s,1)*((null===(t=this._categories[0])||void 0===t?void 0:t.w)||1)*M/this._catLen),e}_doPrepareRender(){const t=this._op;this._weights=[],this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=x(t.minPadding,t.padding,0),this._maxPad=x(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,y(t.categoryPadding,0))))}_adjustMinMax(t,e){const s=this._op;return s.minValue<t&&(t=s.minValue),s.maxValue>e&&(e=s.maxValue),{min:t,max:e}}_doBuildTicks(t,e,s,i){const r=this._label;let n=this._weights=this._categories.map((t=>{var e;return null!==(e=t.w)&&void 0!==e?e:1}));const o=this._tick.options.step||1,a=[];if(!this._zoom){const{min:s,max:i}=this._adjustMinMax(t,e);t=Math.floor(s),e=Math.ceil(i)}this._catMin=t,this._catMax=e;let h=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(h,this._tick.options.step||1));for(let e=-1;e>=t;e--)n.unshift(1);const l=Math.max(h,e+1);for(;n.length<l;)n.push(1);n=n.slice(Math.max(0,t),e-Math.min(0,t)+1),h=this._len=this._minPad+this._maxPad+n.reduce(((t,e)=>t+e),0);const _=this._pts=[];if(h>0){let s=this._minPad;_.push(0);for(let i=t;i<=e;i++)_.push(s/h),s+=n[i-t]||1;_.push(s/h),_.push((s+this._maxPad)/h)}const c=this._catStart,d=this._catStep;for(let e=1;e<_.length-2;e+=o){const s=t+e-1,i=this._categories[s/d-c];a.push({index:e-1,pos:NaN,value:s,label:r.getTick(e-1,i?i.t:s)})}return this._setMinMax(t,e),a}_calcPoints(t,e){const s=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<s.length;t++)s[t]=0;else for(let t=0;t<s.length;t++)s[t]/=this._vlen;for(let e=0;e<s.length;e++)s[e]*=t;if(super._calcPoints(t,e),this._isPolar){if(e>100){const e=this._op.totalAngle*B;if(0===t)for(let t=0;t<s.length;t++)s[t]=0;else for(let i=0;i<s.length;i++)s[i]=s[i]/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];let n=r+(s[i+2]-r)*(e-Math.floor(e+.5)+.5);return this._op.reversed&&(n=t-n),this._ani?this._ani.getPos(n,this._op.reversed):n}valueAt(t,e){const s=this._pts;this._op.reversed&&(e=t-e);for(let t=1;t<s.length-1;t++){const i=s[t],r=s[t+1];if(e>=i&&r>=e){return this._catMin+t-(1-(e-i)/(r-i))}}}getUnitLen(t,e){const s=Math.floor(e-this._catMin+.5);let i;return i=this._ani?this._ani.getPos(this._pts[s+2],this._op.reversed)-this._ani.getPos(this._pts[s+2-1],this._op.reversed):this._pts[s+2]-this._pts[s+2-1],f(i)}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 a(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=g(0,e.min),e.max=m(0,e.max)),e}$_collectCategories(t){const e=this._op,r=e.categories,n=this._categories=[];if(i(r)&&r.length>0)this._len=0,r.forEach((t=>{const e=null==t?1:y(t.weight,1),i=t&&t.icon;let r,o;null==t?o=r=null:s(t)?(r=b(t.name,t.label),o=b(t.label,t.name)):o=r=String(t),this._len+=e,n.push({c:r,t:o,w:e,i:i})}));else{const s=this.chart.seriesByName(e.categorySeries),r=this.chart.seriesByName(e.weightSeries)||s,o=e.weightField,a=null==r?void 0:r.data;let h=[];!e.weightByFrequency&&o&&i(a)&&a.length>0&&a.forEach((t=>{const e=t[o];at.isNumber(e)&&e>=0?h.push(e):h.push(1)})),s&&(t=[s]);const l=e.weightByFrequency;let _,c=0;if(i(t)&&t.length>0)for(const e of t){const t=e.collectCategories(this);t.length>0&&t.forEach(((t,e)=>{l&&(t!==_?(c>0&&(n[n.length-1].w=c),_=t,c=1):c++),n.find((e=>e.c===t))||n.push({c:t,w:h[e]||1,t:t})}))}c>0&&(n[n.length-1].w=c)}this._map={},n.forEach(((t,e)=>{const s=t.v=e;null!=t.c&&(this._map[t.c]=s)}))}}wi.type="category",wi.defaults=Ee(hs.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});class vi extends Oe{}vi.defaults=Ee(Oe.defaults,{visible:!1});class Vi extends $e{getAlign(t,e,s,i){let r=this._op.align;return"auto"===r&&(r=t?s?"left":"right":i<=0?e?"left":"right":i>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,s){let i=this._op.verticalAlign;return"auto"===i&&(i=t?"middle":s?"bottom":"top"),i}getAlignPolar(t){let e=this._op.align;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100||s>=260&&s<=280?"center":s>100&&s<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._op.verticalAlign;if("auto"===e){const s=(t%(2*Math.PI)*180/Math.PI+360)%360;e=s>=80&&s<=100?"bottom":s>=260&&s<=280?"top":"middle"}return e}getOffsetX(t){const e=this._op.offsetX;return isNaN(e)?"center"===t?0:Vi.OFFSET:e}getOffsetY(t){const e=this._op.offsetY;return isNaN(e)?"middle"===t?0:Vi.OFFSET:e}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),t.position=g(1,m(0,y(t.position,1))),t.align="left"===t.align||"center"===t.align||"right"===t.align?t.align:"auto",t.verticalAlign="top"===t.verticalAlign||"middle"===t.verticalAlign||"bottom"===t.verticalAlign?t.verticalAlign:"auto"}}Vi.OFFSET=4,Vi.defaults=Ee(Oe.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class Si extends Oe{getRadius(){return m(0,y(this._op.radius,4))}}Si.defaults=Ee(Oe.defaults,{visible:!1,radius:4});class Ai extends Oe{constructor(t){super(t.chart),this.owner=t,this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),t.variableArea=(this._variableArea=new vi(this.chart)).init(),t.fixedArea=(this._fixedArea=new vi(this.chart)).init(),t.label=(this._label=new Vi(this.chart)).init(),t.marker=(this._marker=new Si(this.chart)).init()}get variableArea(){return this._variableArea}get fixedArea(){return this._fixedArea}get expression(){return this._expr}get label(){return this._label}get marker(){return this._marker}getLabelDomain(){return this._labelDomain}setRange(t,e,s,i){return this._minX=t,this._maxX=e,this._minY=s,this._maxY=i,this}_doPrepareRender(t){const e=this._op,s=e.type,i=this.owner,r=this._res=Math.max(1,(i._visPoints.length-1)*Math.max(1,+e.resolution||5)),n=this._minX>0?0:(this._maxX-this._minX)/r-this._minX,o=this._minY>0?0:(this._maxY-this._minY)/r-this._minY,a=i._visPoints.filter((t=>!t.isNull)).map((t=>({x:t.xValue+n,y:t.yValue+o}))).sort(((t,e)=>t.x-e.x)),h=(this["_"+s]||this._linear).call(this,this._formatter,a);if(this._points=[],h&&"function"==typeof h.evaluator){if(a.length>0){const t=a[0].x,i=a[a.length-1].x,r=e.forward>0?e.forward:0;let n=t-(e.backward>0?e.backward:0),o=i+r;if("logarithmic"===s||"power"===s){const t=Number.EPSILON||1e-12;n<=0&&(n=t)}const l=i-t,_=o-n,c=l>0?Math.ceil(this._res*_/l):this._res;for(let t=0;t<=c;t++){const e=n+(o-n)*t/c,s=h.evaluator(e);Number.isFinite(s)&&this._points.push({x:e,y:s})}}}else if(h&&Array.isArray(h.points))if("movingAverage"===s&&"flat"===e.maExtrapolation||"linear"===e.maExtrapolation){const t=e.forward>0?e.forward:0,s=e.backward>0?e.backward:0,i=h.points;if(i.length>0){const r=i[0],n=i[i.length-1],o=n.x-r.x,a="flat"===e.maExtrapolation;if(s>0){const t=Math.max(2,Math.ceil(this._res*s/o)),e=s/t;if(a){const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}else if(i.length>=2){const s=i[0],n=i[1],o=(n.y-s.y)/(n.x-s.x);for(let i=t;i>0;i--){const t=r.x-e*i,n=s.y+o*(t-s.x);this._points.push({x:t,y:n})}}else{const s=r.y;for(let i=t;i>0;i--)this._points.push({x:r.x-e*i,y:s})}}if(this._points.push(...i),t>0){const e=Math.max(2,Math.ceil(this._res*t/o)),s=t/e;if(a){const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}else if(i.length>=2){const t=i[i.length-1],r=i[i.length-2],o=(t.y-r.y)/(t.x-r.x);for(let i=1;i<=e;i++){const e=n.x+s*i,r=t.y+o*(e-t.x);this._points.push({x:e,y:r})}}else{const t=n.y;for(let i=1;i<=e;i++)this._points.push({x:n.x+s*i,y:t})}}}}else this._points.push(...h.points);this._expr=h&&h.expr,this._points.forEach((t=>{t.x-=n,t.y-=o}))}getLabel(){return""}_doApply(t){super._doApply(t),t.forward=m(0,y(t.forward,0)),t.backward=m(0,y(t.backward,0)),this._formatter=xt.getFormatter(t.numberFormat||"0.####")}_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){if(e.length>1){const{m:s,a:i}=this._calcLine(e),r=t=>s*t+i;return{expr:`y = ${t.toStr(s)}x + ${t.toStr(i)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:y(t.y,0)}))),{m:i,a:r}=this._calcLine(s),n=t=>t<=0?NaN:r+Math.log(t)*i;return{expr:`y = ${t.toStr(i)}log(x) ${r>0?"+":"-"} ${t.toStr(f(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const s=e.map((t=>({x:Math.log(t.x),y:Math.log(t.y)}))),{m:i,a:r}=this._calcLine(s),n=Math.exp(r),o=t=>t<=0?NaN:n*t**i;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(i)})}`,evaluator:o}}return{}}_calcLine2(t){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){if(e.length>1){const s=e.map((t=>({x:t.x,y:t.y}))),{m:i,a:r}=this._calcLine2(s),n=r,o=t=>n*Math.exp(i*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(i)}x))`,evaluator:o}}return{}}_polynomial(t,e){const s=e.length;if(s>1){const i=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let i=0;i<s;i++)n+=e[i].x**t*e[i].y;i.push(n),n=0;const h=[];for(let i=0;i<a;i++){for(let r=0;r<s;r++)o+=e[r].x**(t+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++)f(s[t][r])>f(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=>h.reduce(((e,s,i)=>e+s*t**i),0);return{expr:"y = "+(h.map(((e,s)=>{const i=+e;if(!isFinite(i)||0===i)return"";const r=t.toStr(i);if("0"===r)return"";if(0===s)return i<0?`-${r}`:`${r}`;return`${i<0?"- ":"+ "}${r}${1===s?"x":`x^${s}`}`})).filter((t=>t)).join(" ").replace(/^\+ /,"")||"0"),evaluator:l}}}_movingAverage(t,e){const s=e.length,i=m(1,g(s-1,this._op.movingInterval)),r=[];let n=i;for(;n<=s;){const t=e.slice(n-i,n).reduce(((t,e)=>t+y(e.y,0)),0);r.push({x:e[n-1].x,y:t/i}),n++}return{expr:`y = movingAverage(${t.toStr(i)})`,points:r}}}var Pi;Ai.defaults=Ee(Oe.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const ki={},Ci={},Ni=/\$\{detail\}/g;class Li extends Oe{}Li.defaults=Ee(Oe.defaults,{visible:!1});class Mi extends $e{_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 at.isValidNum(t)?this._getText(null,t,f(t)>1e3,!0):t}getOffset(){return y(this._op.offset,0)}getDefaultIconPos(){return"top"}getRotation(){return m(-90,g(90,y(this._op.rotation,0)))}_isVisible(){return this._op.visible||r(this._op.visibleCallback)}_doSetSimple(t){return r(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doApply(t){"auto"===t.position&&(t.position="default"),super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=y(t.verticalAdjust,0)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}Pi=Mi,Mi.OFFSET=4,Mi.defaults=Ee($e.defaults,{visible:void 0,position:"default",offset:Pi.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});const Ei={x:"xValue",y:"yValue",z:"zValue"};class Bi extends Yt{constructor(t,e,s){super(),this.series=t,this.point=e,this.delay=s?200:0,this.duration=500,this.endHandler=()=>{delete this.point._vr,this.series._changed(),this.series=this.point=null}}_doUpdate(t){return!this.point._isDeleted()&&(this.point._vr=t,this.series._changed(),!0)}}class Ti extends Yt{constructor(t,e,s){super(),this.series=t,this.points=e,s&&(s.cancel(),this._prevAnis=s._prevAnis?[...s._prevAnis,s]:[s],this._prevVrs=new Map,this._prevAnis.forEach((t=>{t.points.forEach((t=>{isNaN(t._vr)||this._prevVrs.set(t,t._vr)}))}))),e.forEach((t=>{t._setDeleted()})),this.duration=t._decayDuration,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),e||(this.series.getPoints().clean(),this.series.$_clearDecay())},this.series.$_setDecay(this)}_doUpdate(t){return this._prevAnis&&this._prevAnis.forEach((e=>{e.points.forEach((e=>{const s=this._prevVrs.get(e);void 0!==s&&(e._vr=s*(1-t))}))})),this.points.forEach((e=>{e._vr=1-t})),this.series._changed(),!0}}class Oi extends Yt{constructor(t,e,s){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach((t=>{this.addPoint(t)})),this._interval=s,this.duration=Number.POSITIVE_INFINITY,this.endHandler=(t,e)=>{this.series._dataPointsChanged(),this.series.$_clearDrop()}}addPoint(t){if(t&&!this._points.includes(t)){const e=this.series._getLabeledPoints().slice();e.sort(((t,e)=>t.xValue-e.xValue)),t.xValue<=e[0].xValue?t._setDrop(-1):t.xValue>=e[e.length-1].xValue&&t._setDrop(1),this._points.push(t),t._vr=0}return this}_doUpdate(t,e){const s=this._points;for(let t=s.length-1;t>=0;t--)s[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(s[t]._vr)||s[t]._vr>=1)&&s.splice(t,1);return 0!==s.length&&(this.series._changed(),!0)}}class Di extends pi{}const Ri=12;class $i extends Oe{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach((t=>{ki[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._setIndex(e,t._seriesIndex++),n.init(),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 gi(this),this._pointArgs={},this._paletteColors=Array(Ri).fill(0).map(((t,e)=>e));this.chart.chartOptions.options.paletteMode==et&&at.shuffle(this._paletteColors),t.pointLabel=(this._pointLabel=this._createLabel(this.chart)).init()}onDataValueChanged(t,e,s,i,r){at.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){at.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){at.log("onDataRowDeleted",e);const s=this._runPoints[e];s&&this.removePoint(s)}onDataChanged(t){at.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){const e=this._op;let s;return e.tooltipDetailCallback&&(this._getPointCallbackArgs(this._pointArgs,t),s=e.tooltipDetailCallback(this._pointArgs)),void 0===s&&(s=e.tooltipDetail||""),s}getTooltipText(t,e){const s=this._op;let i;return s.tooltipCallback&&(this._getPointCallbackArgs(this._pointArgs,e),i=s.tooltipCallback(this._pointArgs)),void 0===i&&(i=s.tooltipText,i&&(i=i.replace(Ni,this.getTooltipDetail(e)))),i}getTooltipParam(t,e,s){return $i.getPointTooltipParam(t,e,s)}_type(){return this.constructor.type}_viewType(){return this._type()}get index(){return this._index}get name(){return this._name}get row(){return this._row}setRow(t){this._row=t}get col(){return this._col}setCol(t){this._col=t}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}get isWidget(){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)}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}isXY(){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}legendStroke(){return this._calcedStroke}legendLabel(){return this._op.label||this.name}legendKey(){return this[this._op.legendKey]}styleLegendMarker(t){}canMixWith(t){return!0}getBaseValue(t){return NaN}isBased(t){return!1}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}hasShape(){return!1}setShape(t){}seriesChanged(){return this._pointsChanged}getMinPointWidth(){return NaN}isRace(){return!1}get xMax(){return this._maxX}get xMin(){return this._minX}get yMax(){return this._maxY}get yMin(){return this._minY}get zMax(){return this._maxZ}get zMin(){return this._minZ}canDepth(){return!1}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}initPoints(t){return this._containsNull=!1,t.map(((t,e)=>this.$_addPoint(t,e)))}$_getXStart(t){const e=t.getValue(this._op.xStart),s=isNaN(e)?t.getValue(this.chart.chartOptions.getXStart(t)):e;return y(s,t.getXStart())}$_getXStep(t){return w(this._op.xStep,this.chart.chartOptions.options.xStep,1)}_buildVisPoints(t){return t.filter((t=>!1!==t.visible))}_prepareRunPoints(t,e){this._runPoints=this._points.getRunPoints(t),this.visible&&!this._referents?this._visPoints=this._buildVisPoints(this._runPoints):this._visPoints=null}_dataSourceChanged(){const t=this._doLoadData(this._data);this._loadPoints(t)}_connect(t){this._xAxisObj=this._group?this._group._xAxisObj:t._connectSeries(this,!0),this._yAxisObj=this._group?this._group._yAxisObj:t._connectSeries(this,!1)}_prepareRender(){this._legended=null,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 wi)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.options.categoryField;if(null!=e){if(i(e)){const s=e.length-1,i=t.getCategorySeparator();return this._points._internalPoints().filter((t=>n(t.getProp(e[s])))).map((t=>e.map((e=>t.getProp(e))).join(i)))}return this._points.getProps(e).filter((t=>n(t)))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>n(t)))}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);n(i)&&(i=i.trim()),this._points.forEach(((e,r)=>{let n=t.getValue(e.x);isFinite(n)||(n=s,s=t.incStep(s,i)),e.xValue=n})),e&&this._runPoints.forEach((t=>{!1!==t.visible&&e.push(t.xValue)}))}else{const s=this.hasZ();this._points.forEach(((e,i)=>{if(e.isNull)e.y=e.yGroup=e.yValue=NaN;else{let i=null==e.y?NaN:t?t.getValue(e.y):+e.y;isNaN(i)&&t&&(i=t.getValue(e.y)),e.initValues(),!isNaN(e._vr)&&e._prev&&(s?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(isNaN(e._prev.yValue)&&e.initPrev(t,e._prev),i=e._prev.yValue+(i-e._prev.yValue)*e._vr),e.applyValueRate(e._prev,e._vr)),e.yValue=e.yGroup=i,e.isNull=!isFinite(i)}})),this._runPoints.forEach((t=>{e&&!1!==t.visible&&isFinite(t.yValue)&&e.push(t.yValue)}))}}collectRanges(t,e){if(t&&t._isX)return void(e&&!isNaN(this._minX)&&e.push(this._minX,this._maxX));const s=this._visPoints,i=s.length;if(i>0){const t=this._trendline,e=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(null==t?void 0:t.visible){t.setRange(o,a,h,l)._prepareRender();const e=t._points||[],s=e.map((t=>t.y)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e)),i=e.map((t=>t.x)).filter((t=>Number.isFinite(t))).sort(((t,e)=>t-e));s.length>0&&(h=Math.min(h,s[0]),l=Math.max(l,s[s.length-1])),i.length>0&&(o=Math.min(o,i[0]),a=Math.max(a,i[i.length-1]))}e.yMin=this._minY=h,e.yMax=this._maxY=l,e.xMin=this._minX=o,e.xMax=this._maxX=a,r&&(e.zMin=this._minZ=_,e.zMax=this._maxZ=c)}this.$_prepareViewRanges(s),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return y(this._op.paddingRate,1)}_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=tt(this._op.viewRanges,s,i,!1,!1,!0,this._runColor))?t.forEach(((t,s)=>{this._setViewRange(t,e)})):t.forEach(((t,e)=>{t.range=N}))}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._getLabelDefaultPos(t,t.options.position)}_getLabelDefaultPos(t,e){return e}getLabelPos2(t,e){return this._labelPosCallback?this._getLabelDefaultPos(t,this._labelPosCallback(this._getPointCallbackArgs(this._pointArgs,e))):this._labelPos}getLabelOff(t){return t}getLabelOff2(t){return this._labelOffCallback?y(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Mi.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._preparePointArgs(t),(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,e){return n(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const s=this.getPointAt(t);return s?s[e]:N}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,s=!0){if(t instanceof pi||(t=this.getPointAt(t)),t){let i=t._prev;return i&&i.ani&&i.ani.cancel(),i=t.updateValues(this,e),i&&s&&this.chart.animatable()&&(i.ani=new Bi(this,t,!1),i.ani.start()),this._dataPointsChanged(),!!i}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const s=this._doAddPoint(t);if(s){if(this._points.add(s),e&&this.chart.animatable()&&this._needAddAnimation()){const t=s._prev=s.copy();t.ani=new Bi(this,s,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return s}addPoints(t,e=!0){const s=[];return i(t)&&t.forEach((t=>{const e=this._doAddPoint(t);e&&s.push(e)&&this._points.add(e)})),s.length>0&&(e&&this.chart.animatable()&&s.forEach((t=>{const e=t._prev=t.copy();e.ani=new Bi(this,t,this._points.count>1),e.ani.start()})),this._dataPointsChanged()),s}_needDecayEffect(){return!1}removePointAt(t,e=!0){const s=this._points.get(t);return this.removePoint(s,e)}removePoint(t,e=!0){if(t instanceof pi||(this.hasZ()?i(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof pi&&this._points.contains(t)){let s=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ti(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new Oi(this,[t],this._decayDuration)).start(),s=!0)}else this._points.remove(t)&&(s=!0);if(s)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(i(t)){const s=t.map((t=>this._points.get(t))).filter((t=>null!=t));return this.removePoints(s,e)}return 0}removePoints(t,e=!0){if(i(t)){let s=[];if(t.forEach((t=>{t instanceof pi||(this.hasZ()?i(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof pi&&this._points.contains(t)&&s.indexOf(t)<0&&s.push(t)})),s.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ti(this,s,this._decayAni).start(),this._changed(),s.length;s=this._points.removeAll(s),s.length>0&&(this._dropAni?s.forEach((t=>this._dropAni.addPoint(t))):(this._dropAni=new Oi(this,s,this._decayDuration)).start())}else s=this._points.removeAll(s);if(s.length>0)return this._doPointsRemoved(s),this._dataPointsChanged(),s.length}}return 0}getDropPoints(){var t;return null===(t=this._dropAni)||void 0===t?void 0:t._points}followPointer(){return!1}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._setData(t.data),this._createFielders(),this._decayDuration=m(0,y(t.decayDuration,300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new Mi(t)}_createPoint(t){return new Di(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 Hs.create(t,$i.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 r(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(i(t))return t;if(t){let e;if(t._obj instanceof dt)e=t._obj;else if(t instanceof dt)e=t;else if(Number.isFinite(t)||s(t)||h(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;return this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=t.pointColors,s=this._runColor=a(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%Ri+1)})`:t.color;let r,o;i(e)?r=e:n(e)?e.endsWith("@pal")||e.endsWith("@palette")?r=this.chart.getPaletteColors(e.split("@")[0]):o=this.chart._assets.get(e):this._colorByPoint()&&(r=this.chart.chartOptions.options.colors),o instanceof Ce?this._runPoints.forEach(((t,e)=>{t.color=t.color||o.getNext()||s})):i(r)?this._runPoints.forEach(((t,e)=>{t.color=t.color||r[e%r.length]||s})):this._runPoints.forEach(((t,e)=>{t.color=t.color||s})),this._preparePointArgs(this._pointArgs),this._labelPosCallback=S(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=S(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const s=t[Ei[e]];for(const e of this._runRanges)if(s>=e.fromValue&&s<=e.toValue)return void(t.range=e);t.range=N}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}$i.LEGEND_MARKER="rct-legend-item-marker",$i.defaults=Ee(Oe.defaults,{zOrder:0,visibleInLegend:!0,visibleInNavigator:!1,tooltipText:"<b>${name}</b><br>${series}: ${detail}",tooltipDetail:"<b>${yValue}</b>",loadAnimation:"default",decayDuration:300,hoverEffect:"default",interactive:!0,paddingRate:1});class Fi extends De{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}canDepth(){return this._visibleSeries.every((t=>t.canDepth()))}_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 Ji&&e.series[0]._type()===t)return e.series[0]}}seriesByPoint(t){for(const e of this._series)if(e.contains(t))return e}getLegendSources(t=-1,e=-1){const s=[];return this._items.forEach((i=>{i._valid&&!i._legended&&(t<0||t===i.row)&&(e<0||e===i.col)&&(i.getLegendSources(s),i._legended=t>=0&&e>=0)})),s}canPolar(){return this._series.length>0&&this._series.every((t=>t&&t.canPolar))}load(t){const e=this.chart,r=this._items=[],n=this._series=[];i(t)?t.forEach(((t,s)=>{r.push(this.$_loadItem(e,t,s))})):s(t)&&r.push(this.$_loadItem(e,t,0)),r.forEach((t=>{t instanceof Ji?n.push(...t.series):t instanceof $i&&n.push(t)})),this._map={},this._widget=!0,n.forEach((t=>this.$_add(t))),e._op.series=this._items.map((t=>t.options))}add(t,e){const s=this.$_loadItem(this.chart,t,this._series.length);if(s)return s._needAnimate=e,this._items.push(s),this._series.push(s),this.$_add(s),s}remove(t){let e;if(t instanceof $i?e=t:n(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>{t._setIndex(e)})),e;if(e._group.remove(e))return e}}updateData(t){}connect(t){const e=this._items.filter((t=>t.visible)).sort(((t,e)=>(+t.options.zOrder||0)-(+e.options.zOrder||0)));e.forEach((e=>{e._connect(t),e._valid=Boolean(e._xAxisObj&&e._yAxisObj)})),this._visibles=e.filter((t=>t._valid))}prepareRender(){const t=[];let e=0;this._series.forEach((s=>{if(s.visible){const i=s._group;(i?i.visible&&i._valid:s._valid)&&(t.push(s),s.hasShape()&&s.setShape(Fs[e++%Fs.length]),i||(s._valid=!0))}})),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 Ui&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){const r=i(e.children||e.series)&&t._getGroupType(e.type||t.type);if(r){const i=new r(t);return i._setIndex(s),i.init(),i._load(e),i}return $i._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Yi||(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 Ii extends $i{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new Ai(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}Ii.defaults=Ee($i.defaults,{});class zi extends Oe{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)}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}zi.defaults=Ee(Oe.defaults,{radius:3});class Hi extends pi{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return b(this.x,this.y)}legendKey(){return this._legendKey}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:"percent"===t?this._percent:e}}class Gi extends Oe{_doSetSimple(t){return n(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}Gi.defaults=Ee(Oe.defaults,{curved:!0});class ji extends Mi{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new Gi(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")}}ji.defaults=Ee(Mi.defaults,{visible:!0,convergent:!0,align:Ws,dedupeMode:Zs});class Xi extends Oe{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,s=this._save;let i,r=e.maxCount;return i=this._minDim?W(this._minDim,pi.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=Xi.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=X(t.minValue,!0)}}Xi.DEF_COUNT=10,Xi.defaults=Ee(Oe.defaults,{visible:!1,x:"기타"});class Yi extends $i{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new Xi(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:W(this._centerXDim,t),y:W(this._centerYDim,e)}}_getLabelDefaultPos(t,e){return"default"===e?t.isSub&&"inside"===super.getLabelPos(this._pointLabel)?"outside":"inside":e}needAxes(){return!1}_needDecayEffect(){return!0}_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=X(w(s,e._op.center,Yi.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=X(w(i,e._op.center,Yi.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach((t=>this._sum+=t.yValue));const s=this.getSum();this._runPoints.forEach((t=>t._percent=100*t.yValue/s))}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._op.legendKey,s=this.othersGroup;if(s.visible){if(!this._groupedPoints&&(this._groupedPoints=s.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).map(((t,s)=>(t.vindex=s,t._legendKey=t[e],t)))}}Yi.DEF_CENTER="50%",Yi.defaults=Ee($i.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Yi.DEF_CENTER,centerY:Yi.DEF_CENTER});class Wi extends Yi{getRadius(t,e){return W(this._radiusDim,g(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=X(b(t._radius=e,Wi.defaults.radius),!0))}(this,t.radius)}}Wi.defaults=Ee(Yi.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class Ui extends Ii{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,e){const s=this._group;let i=t;return s?(i*=s._clusterWidth,i*=1-2*s.options.groupPadding,i*=this._childWidth):i*=this._clusterWidth,i*=1-2*this._pointPad,m(e,i)}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=y(this.getMinPointWidth(),0)}}Ui.defaults=Ee($i.defaults,{pointWidth:1,minPointWidth:0});class Zi extends Mi{get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new Li(this.chart)).init()}}Zi.defaults=Ee(Mi.defaults,{});class qi extends Ui{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new Zi(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=m(0,x(e.depth,t.getDepth(),qi.DEPTH)),this._distance=t.getDistance()+y(e.distance,0)):(this._depth=m(0,y(e.depth,qi.DEPTH)),this._distance=y(e.distance,qi.DISTANCE)),e.nullAsBase&&null!=e.baseValue&&this._runPoints.forEach((t=>{t.isNull&&(t.y=e.baseValue,t.isNull=!1)})),this._base=w(this._getGroupBase(),this._yAxisObj.getBaseValue(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_getGroupBase(){return this._op.baseValue}}qi.DEPTH=10,qi.DISTANCE=5,qi.defaults=Ee(Ui.defaults,{nullAsBase:!1});class Ki extends Ui{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach((t=>{if(e){const s=this._getBottomValue(t);!isNaN(s)&&e.push(s)}}))}}class Qi extends Ki{}class Ji extends Oe{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{Ci[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{Ci[t.seriesType]=t}))}static collectTooltipText(t,e,s,r,n){function o(t,e,s,i){let r=e.replace(Ni,t.getTooltipDetail(s));return r=r.replace("yValue","yValue."+s.index).replace(/\$\{/g,"${"+i+"."),r}const a=e.length>1&&i(t.tooltipListRow)&&t.tooltipListRow.length>1&&n,h=a?t.tooltipListRow:t.tooltipRow;let l;return a?n.header=t.tooltipHeader||"":l=t.tooltipHeader||"",h&&e.forEach(((t,e)=>{let i=r;t!==s&&t.needAxes()&&(i=t.getPointAt(r.xValue)),i&&(a?(n.items.push(t),n.rows.push([o(t,h[0],i,e),o(t,h[1],i,e)])):(l&&(l+="<br>"),l+=o(t,h,r,e)))})),a?n.footer=t.tooltipFooter||"":l+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",l}static inflateTooltipParam(t,e,s,i){let r=i.indexOf("."),n=parseInt(i.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(s.xValue);o&&(e=t[n],s=o,i=i.substring(r+1))}return i.startsWith("series.")&&(e=t[+i.substring(7)]||e,i="series"),$i.getPointTooltipParam(e,s,i)}isGroupTooltip(){return!0}getTooltipText(t,e,s){return Ji.collectTooltipText(this._op,this._visibles,t,e,s)}getTooltipParam(t,e,s){return Ji.inflateTooltipParam(this._visibles,t,e,s)}isXY(){return!1}isMarker(){return!1}get col(){return this._col}setCol(t){t!==this._col&&(this._col=t,this._series.forEach((e=>e.setCol(t))))}get row(){return this._row}setRow(t){t!==this._row&&(this._row=t,this._series.forEach((e=>e.setRow(t))))}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}isRace(){return!1}getDepth(){}getDistance(){return 0}get index(){return this._index}get visCount(){return this._visibles.length}_type(){return this.constructor.type}_seriesType(){return this.constructor.seriesType}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,e){this._visibles.forEach((s=>{s.collectRanges(t,e)}))}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,r=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==s.layout&&"stack"!==s.layout)i.forEach((t=>t.getLegendSources(r)));else for(let t=i.length-1;t>=0;t--)i[t].getLegendSources(r);s.reversedInLegend&&r.reverse(),t.push(...r)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e<i&&(isNaN(s)||i<=s)}return!0}canMaxPadding(t,e,s){if(this.isBased(t)){const i=this.getBaseValue(t);return isNaN(i)||!this.isBased(t)||e>i&&(isNaN(s)||i>=s)}return!0}seriesChanged(){return this._seriesChanged}remove(t){const e=this._series.indexOf(t);if(e>=0)return this._series.splice(e,1),this._series.forEach(((t,e)=>{t._setIndex(e)})),!0}_getVisiblePoints(){const t=[];return this._visibles.forEach((e=>t.push(...e._getVisiblePoints()))),t}getLayoutMax(){const t=y(this._op.layoutMax,Ji.LAYOUT_MAX);return t>0?t:Ji.LAYOUT_MAX}_doApply(t){super._doApply(t),e.call(t,"children")&&(this._series=[],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._legended=null,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=!at.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()}_connect(t){this._xAxisObj=t._connectSeries(this,!0),this._yAxisObj=t._connectSeries(this,!1)}_doPrepareRender(t){this._visibles.length>0&&(this._visibles.forEach((e=>e._connect(t))),this._visibles.forEach((t=>t._prepareRender())),this._doPrepareSeries(this._visibles))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}_setIndex(t){this._index=t}_doPrepareSeries(t){}$_loadSeries(t,e){const r=this._seriesType();i(e)?e.forEach(((e,s)=>this.$_add($i._loadSeries(t,this._series.length,e,r)))):s(e)&&this.$_add($i._loadSeries(t,this._series.length,e,r))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t);if(isNaN(s))for(const t of i.values()){t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)t[e].yGroup=t[e-1].yGroup+(t[e].yValue||0);e.push(t[t.length-1].yGroup)}else for(const t of i.values()){let i=t[0].yValue||0,r=i>=s?0:-1,n=i<s?0:-1;t[0].yGroup=t[0].yValue||0;for(let e=1;e<t.length;e++)i=t[e].yValue||0,i>=s?(r>=0&&(t[e].yGroup=t[r].yGroup+i*(i<0?-1:1)),r=e):(n>=0&&(t[e].yGroup=t[n].yGroup+i*(i>=0?-1:1)),n=e);r>=0&&e.push(t[r].yGroup),n>=0&&e.push(t[n].yGroup)}}$_collectFill(t,e){const s=this.getBaseValue(t),i=this.getLayoutMax(),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)e.yValue=(e.yValue||0)/s*i,r=e.yGroup=e.yValue+r;e.push(i)}}else for(const t of r.values()){const r=t.reduce(((t,e)=>t+(f(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)}}}}Ji.LAYOUT_MAX=100,Ji.defaults=Ee(Oe.defaults,{layout:"default",layoutMax:Ji.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class tr extends Ji{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class er extends Ji{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}}er.defaults=Ee(Ji.defaults,{groupWidth:1,groupPadding:.1});class sr extends Ii{isMarker(){return!0}isXY(){return!0}}sr.defaults=Ee($i.defaults,{colorByPoint:!1});class ir extends Oe{}class rr extends Oe{}const nr={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},or={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},ar={minPadding:0,maxPadding:0};class hr extends Oe{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){const e=this.chart;t.handle=(this._handle=new ir(e)).init(),t.mask=(this._mask=new rr(e)).init(),t.borderLine=(this._borderLine=new Oe(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return y(this._op.thickness,hr.defaults.thickness)}getGap(){return y(this._op.gap,hr.defaults.gap)}getGapFar(){return y(this._op.gapFar,hr.defaults.gapFar)}getSize(){return this.getThickness()+this.getGap()+this.getGapFar()}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const i={};if(s(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),i.series=l({},e.series,nr[t]())}else i.series=nr.area();s(e.xAxis)?i.xAxis=l({},e.xAxis,(or[e.xAxis.type]||or.linear)(),ar):i.xAxis=l({},ar),s(e.yAxis)?i.yAxis=l({},e.yAxis,(or[e.yAxis.type]||or.linear)(),ar):i.yAxis=l(or.linear(),ar),this._chartConfig=i,this._axisType=i.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}hr.defaults=Ee(Oe.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class lr extends Oe{_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}lr.defaults=Ee(Oe.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class _r extends lr{}_r.defaults=Ee(lr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class cr extends Oe{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=!!r.axis;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]}}return e.match(/yValue\.(\d+)/)&&(h=a.getPointAt(i.xValue),e="yValue"),r.getTooltipParam(a,h,e)}}}setTarget(t,e,s){let i=b(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isHtmlLayer(){return!1}getNoClip(){const t=this._op.noClip;return!!h(t)&&t}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followPointer())}getHeaderHeight(){const t=this._op;return t.simpleMode?0:m(y(t.headerHeight,0),0)}getTailSize(){return this._op.simpleMode?0:m(y(this._op.tailSize,0),0)}getBorderRadius(){return this._op.simpleMode?0:m(y(this._op.borderRadius,0),0)}getMarkerSize(){return this._op.listMarkerSize||10}getMarkerGap(){return y(this._op.listMarkerGap,5)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?xt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Dt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}cr.defaults=Ee(Oe.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",headerHeight:7,tailSize:10,borderRadius:5,simpleMode:!1,noClip:!1,listGap:12,listRowGap:3,listMarkerSize:7,listMarkerGap:5});const dr="vline",ur="hline",pr="line";class gr extends ze{_isVisible(){return this._op.visible&&!z(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}gr.type="image";class mr extends ze{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||mr.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}mr.type="shape",mr.defaults=Ee(ze.defaults,{width:64,height:64,shape:"square"});class fr extends ze{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}getTextOrientation(){return this._op.textOrientation||"upright"}_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?xt.getFormatter(s):N),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Dt.getFormatter(t):N)}(t.timeFormat)}}fr.type="text",fr.defaults=Ee(ze.defaults,{text:"Text"});class yr extends Qe{getPositions(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 xr extends is{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,s,i,n){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:n});isNaN(r)||(e=r)}return e>0?e:void 0}buildSteps(t,e,s,n,o,a=!1){const h=this._op,l={chart:this.chart.wrapper,length:e,minValue:t._calcedMin,maxValue:t._calcedMax,min:n,max:o},_=this.$_getStepPixels(e,l);let c,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,c=a?this._getStepsByPixels(e,y(.85*_,60),s,n,o,l):i(h.steps)||r(h.steps)||r(h.stepCallback)?this._getStepsBySteps(n,o,l):this._baseAxis instanceof Sr&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,s,n,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,s,n,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,n,o))?this._getStepsByInterval(d,s,n,o):_>0?this._getStepsByPixels(e,_,s,n,o,l):n!==o?[n,o]:[n],c}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?m(8,c(t/(.9*e))+1):y(this._op.maxCount,1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){let s;if(super._doApply(t),this._stepPixels=!r(t.stepPixels)&&at.parseTuples(t.stepPixels),e.call(t,"stepMultiples"))if(r(t.stepMultiples))s=t.stepMultiples;else{let e;if(i(t.stepMultiples)){let s=Number.MIN_SAFE_INTEGER;e=[],t.stepMultiples.forEach((t=>{!isNaN(+t)&&t>s&&e.push(+t)}))}s=e&&e.length>0?e:void 0,s&&(s=s.filter((t=>t>=1)),s.length>0?s.sort(((t,e)=>t-e)):s=void 0)}this._userMultiples=s}$_getStepPixels(t,e){let s=this._stepPixels;if(r(s)&&(s=s.call(void 0,e)),!s){const t=this.axis;s=t._isPolar?xr.STEP_PIXELS_P:t._isX?xr.STEP_PIXELS_X:xr.STEP_PIXELS_Y}for(let e=0;e<s.length;e++)if(t<=s[e][0])return m(1,s[e][1])}_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 Sr&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>_(t/e)*e?t=_(t/e)*e:t<c(t/e)*e&&(t=c(t/e)*e),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&&_(t*o/a)==t*o/a?this._step=a:a=this._step=c(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this._normalizeMin(s,h);else{for(!function(t,e){if(!t)throw new Q(e)}(s<e&&i>e,"base error"),t=m(3,t);;){if(!(c((e-s)/a)+c((i-e)/a)+1>t))break;a+=h}s=e-c((e-s)/a)*a}else s=n._fixedMin;l.push(D(s));for(let e=1;e<t;e++)l.push(D(l[e-1]+a));return l}_getStepsByInterval(t,e,s,i){const r=[];let n;if(s=D(this._normalizeMin(s,t)),isNaN(e))for(r.push(n=s);n<i;)r.push(n=D(n+t));else{for(r.push(n=e);n>s;)r.unshift(n=D(n-t));for(n=e;n<i;)r.push(n=D(n+t))}return this._step=t,r}_getStepMultiples(t,e){var s;return(null!==(s=r(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==s?s:this._op.fineStep)?xr.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?xr.STEP_MULTIPLES[0]:xr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,s){const n=this._op,o=r(n.steps)?n.steps:n.stepCallback;let a;return o?(a=o.call(void 0,s),i(a)&&!a.every((t=>!isNaN(+t)))||(a=t!==e?[t,e]:[t])):a=n.steps.filter((t=>isFinite(+t))).map((t=>+t)),a=a.filter(n.clipSteps?s=>s>=t&&s<=e:t=>isFinite(t)),a.sort(((t,e)=>t-e)),a.length>0&&!isFinite(+a[0])&&(a[0]=t),a.length>1&&!isFinite(+a[a.length-1])&&(a[a.length-1]=e),this._userTicks=this._strictEnds=!0,a}_getStepsByPixels(t,e,s,i,r,n){i>=s?i=s:r<=s&&(r=s);const o=r-i;if(0===o||t<=0)return isNaN(i)?[]:[i];const a=this.getMaxCount(t,e);let h=m(1,_(t/e))+1,l=o/(h-1);const d=function(t){return Math.pow(10,t)}(_(p(l))),u=this._getStepMultiples(d,n),g=[];let f,y=0;if(l/=d,u)if(l>u[y]){for(;y<u.length-1;y++)if(l>u[y]&&l<u[y+1]){l=l<=u[y]+(u[y+1]-u[y])/2?u[y]:u[y+1];break}}else l=u[y];for(;;){for(l*=d,(l<=0||!isFinite(l))&&(l=o/h),i=isNaN(s)?this._normalizeMin(i,l):s-c((s-i)/l)*l,this._step=l,g.push(D(f=i));f<r;)g.push(D(f+=l));if(!u||y>u.length-2||g.length<=a)break;l=u[++y],g.length=0}return g}}xr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],xr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],xr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],xr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],xr.defaults=Ee(is.defaults,{baseRange:!1,enableDecimals:!0});class br extends rs{}br.defaults=Ee(rs.defaults,{numberFormat:"0.##"});class wr extends br{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}wr.defaults=Ee(br.defaults,{useSymbols:!0});class vr extends We{getSize(t){return Math.min(.9*t,W(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=y(this._op.space,0),this._sizeDim=X(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}vr.defaults=Ee(We.defaults,{size:"30%",space:16,gridVisible:!0});class Vr extends Ue{_isVisible(){return this._op.visible}}Vr.defaults=Ee(Ue.defaults,{visible:!1});class Sr extends hs{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new Vr(this)).init()}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get grid(){return this._grid}getBaseValue(){return this._baseVal}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)}}$_getPadding(t,e,s){if(!t){if(this._isX&&this._isPolar)return 0;t=Sr.PADDINGS}for(let i=0;i<t.length;i++)if(e<=t[i][0])return t[i][1]*s;return 0}_doApply(t){var s,i;super._doApply(t);const r=null!==(s=t.minPadding)&&void 0!==s?s:t.padding,o=null!==(i=t.maxPadding)&&void 0!==i?i:t.padding;let a;this._minPadPixels=NaN,n(r)&&r.endsWith("px")&&(a=parseFloat(r),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,n(o)&&o.endsWith("px")&&(a=parseFloat(o),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=at.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=at.parseTuples(o)),this._baseVal=+this._op.baseValue,this._strictMin=X(t.strictMin,!0),this._strictMax=X(t.strictMax,!0),e.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new yr(this)}_createTickModel(){return new xr(this)}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=y(this._runBase,this._min);isNaN(this._fixedMax)&&isNaN(this._maxPadPixels)&&this._calcedMax>e&&t[t.length-2]>this._calcedMax&&t[t.length-2]-this._calcedMax>.5*(t[t.length-2]-t[t.length-3])&&(t.pop(),this._setMinMax(this._min,t[t.length-1])),e=y(this._runBase,this._max),isNaN(this._fixedMin)&&isNaN(this._minPadPixels)&&this._calcedMin>e&&t[1]<this._calcedMin&&t[1]-this._calcedMin<.5*(t[1]-t[2])&&(t.shift(),this._setMinMax(t[0],this._max))}$_trimSteps(t,e,s){this._runBreaks?(this._lastSect=this._sects[this._sects.length-1],t.length>3&&t[t.length-3]>this._lastSect.from&&(this.$_trim(t),this._lastSect.to=t[t.length-1])):!this.tick._userTicks&&t.length>2&&this.$_trim(t)}_doBuildTicks(t,e,s,i){if(isNaN(t)||isNaN(e))return[];if(i>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,s,i),this.$_createTicks(t,s,this._min,this._max,i)}const r=this._tick,n=r._baseAxis instanceof Sr&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let{min:a,max:h}=this._adjustMinMax(s,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(a=r._baseAxis.axisMin(),h=r._baseAxis.axisMax()),this._mergedBreaks){this._runBreaks=this._mergedBreaks.slice(0);for(let t=this._runBreaks.length-1;t>=0;t--){const e=this._runBreaks[t];(isNaN(e.options.from)||isNaN(e.options.to)||e.options.from<=a||e.options.to>=h)&&this._runBreaks.splice(t,1)}this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;let l,_,c=!1,d=a,u=h;if(this._isX)if(a===h)this._unitLen=s/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():s,a,h);if(e){if(this._unitLen=e.len,c=!0,!this._zoom||t)if(e.min=e.min*(2*y(o.unitPadding,.5)),t){let t=o.polarMargin;isNaN(t)?t=M*e.min/(h-a+e.min):t*=B,isNaN(this._fixedMax)&&this.getTotalAngle()+t>M&&(h=this._max=Math.max(this._calcedMax+e.min,h))}else isNaN(this._fixedMin)&&(a=this._min=Math.min(this._calcedMin-e.min/2,a)),isNaN(this._fixedMax)&&(h=this._max=Math.max(this._calcedMax+e.min/2,h))}else this._unitLen=1}if(a===h)l=[a];else if(this._runBreaks)l=this.$_calcBrokenSteps(this._runBreaks,s,a,h),a=Math.min(a,l[0]),h=Math.max(h,l[l.length-1]);else if(l=r.buildSteps(this,s,this._runBase,a,h,!1),_=l.slice(0),l.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;l.length>1&&l[0]<d;)l.shift();l.length<2&&this._fixedMin<l[0]&&l.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;l.length>2&&l[1]<=d;)l.shift();if(!isNaN(r._step))for(;l[0]>d;)l.unshift(r.getNextStep(l[0],-1))}if(a=Math.min(a,l[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;l.length>1&&l[l.length-1]>u;)l.pop();l.length<2&&this._fixedMax>l[l.length-1]&&l.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;l.length>2&&l[l.length-2]>=u;)l.pop();if(!isNaN(r._step))for(;l[l.length-1]<u;)l.push(r.getNextStep(l[l.length-1],1))}h=Math.max(h,l[l.length-1])}else l.push(a+(h-a)/2);this._prevSteps=l,this._setMinMax(a,h);const p=this.$_createTicks(l,s,a,h,i);if(c&&p.length>1){const t=this._isPolar;let e=!1;const s=_;let i,r;if(s[0]<=a){for(r=-1;r<l.length-1&&s[r+1]<l[0];)r++;for(;r>=0&&(i=s[r])>=a;){const t=this.dataToAxis(p[0].value),s=this.dataToAxis(p[1].value);if(i<t&&t-i>=s-t&&("tick"===this.$_getStartFit()||i>a)){const t=this._createTick(0,i);p.unshift(t),l.unshift(i),e=!0}r--}}if(s[s.length-1]>=h){for(r=s.length;r>0&&s[r-1]>l[l.length-1];)r--;for(;r<s.length&&(i=s[r])<=h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(i>=t&&i-t>=t-s&&("tick"===this.$_getEndFit()||i<h)){const t=this._createTick(0,i);p.push(t),l.push(i),e=!0}r++}}else if(t&&h>s[s.length-1])for(;(i=l[l.length-1])<h;){const t=this.dataToAxis(p[p.length-1].value),s=this.dataToAxis(p[p.length-2].value);if(!(D(h-t)>D(t-s)))break;{const r=this._createTick(0,i+D(t-s));p.push(r),l.push(r.value),e=!0}}e&&p.forEach(((t,e)=>t.index=e))}return p}$_createTicks(t,e,s,i,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const s=this._createTick(e,t[e]);s.value!==o&&(n.push(s),o=s.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}_calcPoints(t,e){super._calcPoints(t,e),this._markPoints=this._ticks.map((t=>t.pos))}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,s,i){let r=0,n=s;const o=[n],a=this._sects=[],h=e-t.reduce(((t,e)=>t+e.options.space),0);t.forEach((t=>{const e=t.options,s=t.getSize(h),i=Math.max(0,e.space||0),l={from:n,to:t.options.from,pos:r,len:s};r+=s,a.push(l,t._sect={from:e.from,to:e.to,pos:r,len:i}),r+=i;this.$_buildBrokenSteps(l).forEach((t=>{t>l.from&&t<=l.to&&o.push(t)})),i>0&&o.push(e.to)}));const l=t[t.length-1];if(i>l.options.to){const t={from:l.options.to,to:i,pos:r,len:e-r};a.push(t);this.$_buildBrokenSteps(t).forEach((e=>{e>t.from&&o.push(e)}))}return this._lastSect=a[a.length-1],this._lastSect.to=o[o.length-1],o}getPos(t,e){let s;if(this._runBreaks){const i=this._sects.find((t=>e<t.to))||this._lastSect,r=i.len*(e-i.from)/(i.to-i.from);s=this._op.reversed?R(t-r-i.pos):R(r+i.pos)}else{let i=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this._op.reversed&&(i=t-i,isNaN(this._prevRate)||(i+=this._prevSize-t)),s=R(i)}return this._ani?this._ani.getPos(s,this._op.reversed):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)}_isLog(){return!1}$_getStartFit(){return"default"===this._op.startFit?this._isX&&!this._isPolar?"value":"tick":this._op.startFit}$_getEndFit(){return"default"===this._op.endFit?this._isX&&!this._isPolar?"value":"tick":this._op.endFit}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-W(t,s):e+W(t,s)}_adjustMinMax(t,e,s){const i=this._isLog();let r,n=this.isZoomed(),o=this.isZoomed(),a=!0,h=!0,l=NaN,c=NaN,d=1;if(this._series.length>0){let t,_=0;this._series.forEach((t=>{isNaN(t._sBase=t.getBaseValue(this))||_++,d=m(d,t.getAxisPadRate())})),!this._isX&&_>0&&_<this._series.length&&(r={},this._series.forEach((t=>{const e=t._type();r[e]?r[e]=[g(t._yMin,r[e][0]),m(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]}))),this._series.forEach((r=>{let _=r._sBase;isNaN(_)||(_=D(_),i?_>=0&&_<=e&&_<=s&&(e=t=_):_<=e?r.isBased(this)?e=t=_:l=y(g(l,_),_):_>=s&&(r.isBased(this)?s=t=_:c=y(m(c,_),_))),a&&!n&&(i||r.canMinPadding(this,e,t))&&(a=!1),h&&!o&&(i||r.canMaxPadding(this,s,t))&&(h=!1)}))}else a=n,h=o;n||(n=a),o||(o=h),this._fixedMin=this._fixedMax=NaN;const u=m(0,s-e),p=this.$_calcStrict(this._strictMin,e,-u),f=this.$_calcStrict(this._strictMax,s,u);let x=NaN,b=NaN,w=0,v=0;isNaN(p)?n?this._fixedMin=e:isNaN(this._minPadPixels)?w=this.$_getPadding(this._minPaddings,t,d):x=this._minPadPixels:this._fixedMin=e=p,isNaN(f)?o?this._fixedMax=s:isNaN(this._maxPadPixels)?v=this.$_getPadding(this._maxPaddings,t,d):b=this._maxPadPixels:this._fixedMax=s=f;let V=e,S=s;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*w;e<V&&(V=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*v;e>S&&(S=e)}}else V-=u*w,S+=u*v;if(!isNaN(x)||!isNaN(b)){isNaN(x)&&(x=0),isNaN(b)&&(b=0);const e=Math.min(x+b,.9*t),s=u-_(u*(t-e)/t),i=Math.round(s*x/e);V-=i,S+=s-i}return!isNaN(l)&&l<=e&&V<l&&(V=this._fixedMin=l),!isNaN(c)&&c>=s&&S>c&&(S=this._fixedMax=c),S=m(S,V),{min:V,max:S}}$_calcXUnitLength(t,e,s){const i=[];let r=0;if(this._series.forEach((t=>{t.visible&&t.isClusterable()&&(i.push(...t._getVisiblePoints()),r++)})),0===r&&this._series.forEach((t=>{t.visible&&!t.isXY()&&i.push(...t._getVisiblePoints())})),i.length>0){const r=i.map((t=>t.xValue)).sort(((t,e)=>t-e));for(let t=r.length-1;t>0;t--)r[t]===r[t-1]&&r.splice(t,1);return this._calcUnitLen(r,t,e,s)}}_calcUnitLen(t,e,s,i){if(t.length<2){if(this._ticks.length>0){const t=(i-s)/Math.max(8,this._ticks.length);return{len:y(e*=t/(i-s+t),4),min:t}}return{len:e,min:0}}{let r=e,n=t[1]-t[0];for(let e=2;e<t.length;e++)n=g(n,t[e]-t[e-1]);return r*=n/(i-s+n),isFinite(r)||(r=e/2),{len:y(r,1),min:n}}}$_loadBreak(t){if(s(t)&&"from"in t&&"to"in t){const e=new vr(this);return e.init(),e._load(t),t.from>0?e:null}}$_loadBreaks(t){if(i(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._breaksChanged=!0,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.visible&&t.options.to>t.options.from));if(this._mergedBreaks=null,e.length>0){const i=this._mergedBreaks=[];i.push(l(new vr(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(l(new vr(this)._initObject(),o))}}var s}}Sr.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],Sr.defaults=Ee(hs.defaults,{baseValue:0,nullable:!0,startFit:"default",endFit:"default",unitPadding:.5});class Ar extends Sr{get label(){return this._label}_createLabel(){return new wr(this)}_adjustMinMax(t,e,s){const i=super._adjustMinMax(t,e,s),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof Ji&&"fill"===r[0].options.layout&&(i.max=r[0].getLayoutMax()),i}}Ar.type="linear";const Pr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],kr=[[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]],Cr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Nr extends xr{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}_getValidInterval(t,e,s,i,o){if(r(e)){const r=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:o});null!=r&&(e=r)}if(!isNaN(e))return+e>0?+e:NaN;if(n(e)&&Cr.hasOwnProperty(e.charAt(e.length-1))){const t=parseFloat(e);return t<=-1||t>=1?e:NaN}}_getStepMultiples(t){for(let e=0;e<7;e++)if(t>=Pr[e]/2&&t<Pr[e+1]/2)return this._scale=e,kr[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/e)+1,_=m(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),d=Pr[this._scale];if(_/=d,c)if(_>c[0]){let t=0;for(;t<c.length-1;t++)if(_>c[t]&&_<c[t+1]){_=c[t+1];break}}else _=c[0];const u=a.date(i),p=a.date(r);let g,f=u;if(7===this._scale){const t=h.getFullYear();let e=f.getFullYear();this._step=_=Math.ceil(_),f=new Date(e,0),e<t&&e+_>t&&(e=t,f=new Date(e,0));do{n.push(+f),e+=_,f=new Date(e,0)}while(f<=p)}else if(6===this._scale){let t=f.getFullYear(),e=f.getMonth();this._step=_=Math.ceil(_),f=new Date(t,e),f<h&&new Date(t,e+_)>h&&(e=h.getMonth(),f=new Date(h.getFullYear(),e));do{n.push(+f),f.setMonth(f.getMonth()+_)}while(f<=p)}else if(4===this._scale||5===this._scale){let t=f.getFullYear(),e=f.getMonth(),s=f.getDate();const i=5===this._scale?7:1;this._step=_=Math.ceil(_),f=new Date(t,e,s),f<h&&new Date(t,e,s+i*_)>h&&(s=h.getDate(),f=new Date(h.getFullYear(),h.getMonth(),s));do{n.push(+f),f.setDate(f.getDate()+_*i)}while(f<=p)}else{switch(this._step=_,_*=d,this._scale){case 3:f.setMinutes(0);case 2:f.setSeconds(0);case 1:f.setMilliseconds(0)}g=f.getTime();const t=h.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,s,i){if(n(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=Cr[a],t=Pr[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 Lr=[{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 Mr extends br{_doApply(t){super._doApply(t);const e=n(t.timeFormat)?t.timeFormat:void 0,r=n(t.beginningFormat)?t.beginningFormat:void 0,a=t.timeFormats,h=t.useBeginningFormat;if(this._formats=Lr.map((t=>l(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&r&&this._formats.forEach((t=>{t.beginningFormat=r})),i(a))for(let t=0;t<a.length;t++){const e=this._formats[t],i=a[t];o(i)?e.format=i:s(i)&&(o(i.format)&&(e.format=i.format),h&&o(i.beginningFormat)&&(e.beginningFormat=i.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);if(this._formatter)return this._formatter.toStr(r,s.startOfWeek);const n=this._formats,o=i.tick._scale,a=Dt.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)}}}Mr.defaults=Ee(br.defaults,{useBeginningFormat:!0});class Er extends Sr{get label(){return this._label}_createTickModel(){return new Nr(this)}_createLabel(){return new Mr(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}collectValues(){this._offset=60*y(this.chart.timeOffset,0)*1e3,super.collectValues()}getValue(t){return a(t)?t:t instanceof this._dateClass?t.getTime():n(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(n(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}}Er.type="time",Er.subtype="date",Er.defaults=Ee(Sr.defaults,{baseValue:NaN});class Br extends fi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Tr extends Qi{pointLabelCount(){return 2}_createLegendMarker(t,e){return Hs.create(t,$i.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Br(t)}_getBottomValue(t){return t.lowValue}}Tr.type="barrange",Tr.defaults=Ee(Qi.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Or extends pi{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Dr extends qi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Or(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Dr.defaults=Ee(qi.defaults,{colorByPoint:!1,pointOffset:0});class Rr extends Dr{canDepth(){return!0}_createLegendMarker(t,e){return Hs.create(t,$i.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Rr.type="bar";class $r extends er{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}getDepth(){return this._op.depth}getDistance(){return this._op.distance}_doApply(t){super._doApply(t),this._op.distance=y(t.distance,0)}_doPrepareSeries(t){const e=this._op.layout;if("default"===e){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}))}if("overlap"===e){let e=this.getDistance();t.forEach((t=>{t._groupDistance=e+=y(t.options.distance,0),e+=t.depth}))}else t.forEach((t=>{t._groupDistance=t.distance}))}}$r.defaults=Ee(er.defaults,{depth:10,distance:5});class Fr extends $r{_canContain(t){return t instanceof Rr}}Fr.type="bargroup",Fr.seriesType="bar";class Ir extends Jt{constructor(t){super(t,$i.LEGEND_MARKER),this.add(this._back=new Hs(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new ne(t))}render(t,e){const s=Math.max(8,2*e),i=2.1*s;t===this._shape&&e===this._rd&&s===this._size||(this._shape=t,this._rd=e,this._size=s,this._back.resize(1,s),this._renderShape(e,i,s),this._marker.trans(i/2-e,s/2-e))}_renderShape(t,e,s){zs.setShape(this._marker,this._shape,t,t)}}class zr extends Ir{constructor(t){super(t),this.insertFirst(this._line=new ne(t)),this.insertFirst(this._area=new ne(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,s/2,"L",e,0],r=["M",0,s/2,"L",e,0,"L",e,s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,s)}}class Hr extends Ir{constructor(t){super(t),this.insertFirst(this._line=new ne(t)),this._line.setFill("none"),this.insertFirst(this._line2=new ne(t)),this._line2.setFill("none"),this.insertFirst(this._area=new ne(t)),this._area.setBoolData("fill",!0)}_renderShape(t,e,s){const i=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s],r=["M",0,s,"L",e/2,.7*s,"L",e,s],n=["M",0,.3*s,"L",e/2*.7,0,"L",e,.4*s,"L",e,s,"L",e/2,.7*s,"L",0,s,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(i.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,s)}}class Gr extends ne{constructor(t,e=N,s=N){super(t,e),s&&this.setLine(s)}setLine(t,e,s,i){at.isNumber(t)?this.setPath(zs.line(t,e,s,i)):t&&this.setPath(zs.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(zs.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(zs.line(t,e,t,s))}setHLine(t,e,s){this.setPath(zs.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(zs.line(e,t,s,t))}}class jr extends Ir{constructor(t){super(t),this.insertFirst(this._line=new Gr(t))}_renderShape(t,e,s){this._line&&(this._line.setHLine(s/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,s)}}class Xr extends pi{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Yr extends zi{}Yr.defaults=Ee(zi.defaults,{radius:4,hoverScale:1.75});class Wr extends Mi{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Wr.ALIGN_GAP:0:t}getPosition(){return b(this._op.position,"default")}}Wr.ALIGN_GAP=4,Wr.defaults=Ee(Mi.defaults,{align:"center"});class Ur extends Ii{_doInit(t){super._doInit(t),t.marker=(this._marker=new Yr(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return y(t.radius,this.marker.options.radius)}buildLines(t){return this._lines||(this._lines=this._doBuildLines(t,this.getDropPoints())),this._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new Wr(t)}_createPoint(t){return new Xr(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new jr(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),g(e/2,this.marker.options.radius)),s}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const s=t.length,i=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();i.push(e)}else{let e=0;for(;e<s;){const r=[];for(;e<s&&t[e].isNull;)e++;for(;e<s&&!t[e].isNull;)r.push(t[e++]);r.length>0&&i.push(r)}}if(e){const t=[],s=[];e.forEach((e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&s.push(e)})),t.length>0&&(t.sort(((t,e)=>t.xValue-e.xValue)),i[0].unshift(...t)),s.length>0&&(s.sort(((t,e)=>e.xValue-t.xValue)),i[i.length-1].push(...s))}return i}}Ur.defaults=Ee($i.defaults,{nullAsBase:!1});class Zr extends $e{constructor(t){super(t.chart),this.series=t}label(){return this._op.text||this.series.displayName()}getDefaultIconPos(){return"left"}}Zr.defaults=Ee($e.defaults,{visible:!1,offset:8});class qr extends Ur{_doInit(t){super._doInit(t),t.flag=(this._flag=new Zr(this)).init()}get flag(){return this._flag}backDir(){return"backward"===this._op.stepDir?"forward":"backward"}isConnectEnds(t,e){if(e){const e=this._op.connectEnds;if(h(e))return e;if(!t||"spline"===this._op.lineType)return!0}return!1}isMarker(){return!0}get canPolar(){return!0}getLineType(){return this._group instanceof rn||this._group instanceof nn?this._group.options.lineType:this._op.lineType}_connectNulls(){return this._op.connectNullPoints}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}_doPrepareRender(){const t=this._op;super._doPrepareRender(),this._base=w(this._getGroupBase(),this._yAxisObj.getBaseValue(),0),t.nullAsBase&&!isNaN(t.baseValue)&&this._runPoints.forEach((e=>{e.isNull&&(e.y=t.baseValue,e.isNull=!1)})),this.flag._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}qr.type=Qs,qr.defaults=Ee(Ur.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Kr extends qr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Kr.type="spline";class Qr extends Xr{}class Jr extends qr{_doInit(t){super._doInit(t);const e=this.chart;this.marker.visible=e&&e.isPolar()}prepareAreas(){function t(t){const e=[];if(t.length>1){let s=t[t.length-1].toPoint();s.py=t[t.length-1].yLow,e.push(s),s=t[0].toPoint(),s.py=y(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))}))}_createLegendMarker(t,e){return new zr(t)}_createPoint(t){return new Qr(t)}isBased(t){return t===this._yAxisObj}_doBuildLines(t,e){if(!this.chart.isPolar()&&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._doBuildLines(t,e)}}Jr.type=Js,Jr.defaults=Ee(Ur.defaults,{});class tn extends Qr{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 l(super._assignTo(t),{low:this.low,high:this.high,lowValue:this.lowValue,highValue:this.yValue})}_valuesChangd(t){return this.low!==t.low||super._valuesChangd(t)}_readArray(t,e){const s=t.options,i=e.length>2?1:0;this.low=e[y(s.lowField,0+i)],this.y=e[y(s.yField,1+i)],i>0&&(this.x=e[y(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=b(e[t.options.lowField],e.low),this.y=w(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 en extends Wr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class sn extends Ur{pointLabelCount(){return 2}_createLabel(t){return new en(t)}_createLegendMarker(t,e){return new Hr(t)}_createPoint(t){return new tn(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)))}_doBuildLines(t,e){const s=super._doBuildLines(t,e),i=[];return s.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)}i.push(t,e)})),i}}sn.type="arearange",sn.defaults=Ee(Ur.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class rn extends Ji{_canContain(t){return t instanceof qr}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}}rn.type="linegroup",rn.seriesType=Qs,rn.defaults=Ee(Ji.defaults,{lineType:"default"});class nn extends Ji{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 Jr}getBaseValue(t){return t===this._yAxisObj?w(this._op.baseValue,t.getBaseValue(),0):NaN}}nn.type="areagroup",nn.seriesType=Js,nn.defaults=Ee(Ji.defaults,{lineType:"default"});class on extends Qr{}class an extends Jr{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new on(t)}_doLoadData(t){const e=super._doLoadData(t);if(i(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return(this._refer=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 _}}an.type="bellcurve",an.defaults=Ee(Jr.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class hn extends pi{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return l(super._assignTo(t),{min:this.min,low:this.low,mid:this.mid,high:this.high,max:this.max,minValue:this.minValue,lowValue:this.lowValue,midValue:this.midValue,highValue:this.highValue,maxValue:this.maxValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.min!==t.min||this.low!==t.low||this.mid!==t.mid||this.high!==t.high)}_readArray(t,e){if(e.length<=4)this.isNull=!0;else{const s=t.options,i=e.length>5?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.min=e[y(s.minField,0+i)],this.low=e[y(s.lowField,1+i)],this.mid=e[y(s.midField,2+i)],this.high=e[y(s.highField,3+i)],this.y=e[x(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=b(e[s.minField],e.min),this.low=b(e[s.lowField],e.low),this.mid=b(e[s.midField],e.mid),this.high=b(e[s.highField],e.high),this.y=b(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 ln extends Qi{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new hn(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Hs.create(t,$i.LEGEND_MARKER,0,0,e,e,2)}}ln.type="boxplot",ln.defaults=Ee(Qi.defaults,{tooltipText:"<b>${name}</b><br>${detail}",tooltipDetail:"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 _n extends mi{}class cn extends sr{getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(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 _n(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(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=g(t,s.zValue),e=m(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)}getPointAt(t,e){n(t)&&(t=this._xAxisObj.getValue(t)),n(e)&&(e=this._yAxisObj.getValue(e));for(let s=0;s<this._points.count;s++){const i=this._points.get(s);if(i.xValue===t&&i.yValue===e)return i}}}cn.type="bubble",cn.defaults=Ee(sr.defaults,{sizeMode:"area",minSize:10,maxSize:"20%",tooltipText:"${detail}",tooltipDetail:"x: <b>${x}</b><br>y: <b>${y}</b><br>volume: <b>${z}</b>",paddingRate:2});class dn extends tr{_canContain(t){return t instanceof qr}_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=b(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return at.makeIntArray(0,t.length)}}dn.type="bump",dn.seriesType=Qs;class un extends pi{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return l(super._assignTo(t),{low:this.low,close:this.close,open:this.open,high:this.high,lowValue:this.lowValue,closeValue:this.closeValue,openValue:this.openValue,highValue:this.highValue})}_valuesChangd(t){return!!super._valuesChangd(t)||(this.low!==t.low||this.close!==t.close||this.open!==t.open)}_readArray(t,e){if(e.length<=3)this.isNull=!0;else{const s=t.options,i=e.length>4?1:0;i>0&&(this.x=e[y(s.xField,0)]),this.low=e[y(s.lowField,0+i)],this.close=e[y(s.closeField,1+i)],this.open=e[y(s.openField,2+i)],this.y=e[x(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=b(e[s.lowField],e.low),this.open=b(e[s.openField],e.open),this.close=b(e[s.closeField],e.close),this.y=w(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 pn extends Qi{canCategorized(){return!0}_createPoint(t){return new un(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const s=new qt;return s.rect(0,.2*e,e,.6*e),s.vline(e/2,0,e),new ne(t,$i.LEGEND_MARKER).setPath(s.end())}}pn.type="candlestick",pn.defaults=Ee(Qi.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class gn extends Zi{}gn.defaults=Ee(Mi.defaults,{position:"inside"});class mn extends Dr{get pointLabel(){return this._pointLabel}_createLabel(t){return new gn(t)}}mn.type=ti;class fn extends $r{_canContain(t){return t instanceof mn}}fn.type="circlebargroup",fn.seriesType=ti;class yn extends fi{}class xn extends zi{}xn.defaults=Ee(zi.defaults,{radius:4,shape:"circle"});class bn extends Qi{_doInit(t){super._doInit(t),t.marker=(this._marker=new xn(this)).init(),t.lowMarker=(this._lowMarker=new xn(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)+m(0,this.marker.options.radius)}_createPoint(t){return new yn(t)}prepareAfter(){const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=y(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()}}bn.type="dumbbell";class wn extends pi{}class vn extends qi{getSegmentSize(t){return W(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new wn(t)}_createLegendMarker(t,e){const s=new qt;return s.rect(0,0,e,.4*e),s.rect(0,.6*e,e,.4*e),new ne(t,$i.LEGEND_MARKER).setPath(s.end())}}vn.type="equalizer",vn.defaults=Ee(qi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class Vn extends Qi{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new fi(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const s=(new qt).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),i=new ne(t,$i.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}Vn.type="errorbar",Vn.defaults=Ee(Qi.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Sn extends Hi{}class An extends Sn{constructor(t,e){super(t),this.points=e}}class Pn extends ji{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?Pn.ENDED_DIST:Pn.OUTSIDE_DIST:this._op.distance||0}}Pn.OUTSIDE_DIST=25,Pn.ENDED_DIST=10;class kn extends Yi{getSize(t,e){return{width:m(.1*t,W(this._widthDim,t)),height:m(.1*e,W(this._heightDim,e))}}getNeckSize(t,e){return{width:at.clamp(W(this._neckWidthDim,t),this._minNeckWidth,t),height:at.clamp(W(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new Pn(t)}_createPoint(t){return new Sn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new An(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=Y(e._width,kn.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=Y(e._height,kn.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=Y(e._neckWidth,kn.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=Y(e._neckHeight,kn.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}kn.type="funnel",kn.defaults=Ee(Yi.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class Cn extends pi{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return l(super._assignTo(t),{min:this.min,max:this.max})}}const Nn={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 Ln extends Ii{getBinCount(t){const e=y(this._op.binWidth,0);if(e>0)return t/e;return y(this._op.binsNumber,0)<1?Nn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new Cn(t)}_doLoadPoints(t){function e(t){let e;return e=i(t)?t[y(this.yField,0)]:s(t)?w(t[this.yField],t.y,t.value):t,parseFloat(e)}const r=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)),r.minValue<o[0]&&o.unshift(r.minValue),r.maxValue>o[o.length-1]&&o.push(r.maxValue);const t=o.length,e=o[0],s=o[t-1],i=this.getBinCount(t),a=this._binInterval=(s-e)/i;let h=0,l=e,_=l+a;for(let e=0;e<i;e++){let r=0;if(e==i-1)r=t-h;else for(;h<t&&o[h]<_;)r++,h++;n.push({x:l,y:r,min:l,max:e===i-1?s:_}),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(),0)}getBaseValue(t){return t===this._yAxisObj?this._base:NaN}isBased(t){return t===this._yAxisObj}_createLegendMarker(t,e){return Hs.create(t,$i.LEGEND_MARKER,0,0,e,e,2)}}Ln.type="histogram",Ln.defaults=Ee($i.defaults,{baseValue:0,binsNumber:"squreRoot"});class Mn extends zi{}Mn.defaults=Ee(zi.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class En extends pi{_assignTo(t){return l(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const s=+t.options.colorField,i=+t.options.iconField,r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[y(r.xField,0)]),this.y=e[y(r.yField,0+n)],this.radius=e[y(r.radiusField,1+n)],isNaN(s)||(this.color=e[s]),isNaN(i)||(this.icon=e[i])}_readObject(t,e){super._readObject(t,e),this.radius=b(e[t.options.radiusField],e.radius)}}class Bn extends qi{_doInit(t){super._doInit(t),t.marker=(this._marker=new Mn(this)).init()}get marker(){return this._marker}_getFielderProps(){return["xField","yField","zField","colorField","iconField","radiusField"]}canCategorized(){return!0}getLabelOff(t){return super.getLabelOff(t)+this.marker.options.radius}_createPoint(t){return new En(t)}prepareAfter(){const t=this.marker.options,e=t.radius,s=t.shape,i=this.options.radiusField,r=m(t.minRadius,0),n=m(t.maxRadius,r);if(i){const t=this._runPoints.map((t=>t.radius)).filter((t=>"number"==typeof t&&!Number.isNaN(t))),e=Math.min(...t),i=Math.max(...t)-e||1;this._runPoints.forEach((t=>{const o=(t.radius-e)/i;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=s}))}else this._runPoints.forEach((t=>{var i;t.radius=null!==(i=t.radius)&&void 0!==i?i:e,t.shape=s}));super.prepareAfter()}}Bn.type="lollipop";class Tn extends un{}class On extends pn{_createPoint(t){return new Tn(t)}_createLegendMarker(t,e){const s=new qt;s.vline(e/2,0,e),s.hline(.4*e,e/2,e),s.hline(.7*e,0,e/2);const i=new ne(t,$i.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}On.type="ohlc";class Dn extends Xr{}class Rn extends Ur{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Dn(t)}_referOtherSeries(t){if(t.options.name===this._op.source||t.index===this._op.source)return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=this;(function(t){const s=[],i=t.reduce(((t,e)=>t+y(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)}}}Rn.type="pareto",Rn.defaults=Ee(Ur.defaults,{curved:!1});class $n extends Hi{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 l(super._assignTo(t),{sliced:this.sliced})}}class Fn extends $n{constructor(t,e){super(t),this.points=e}}class In extends $e{getDefaultIconPos(){return"left"}}class zn extends ji{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?W(this._distanceDim,e,0):t?W(s?zn.INNER_DIST:zn.INSIDE_DIST,e):"far"===this._op.align?zn.ENDED_DIST:zn.OUTSIDE_DIST}}zn.INSIDE_DIST=X("30%",!1),zn.INNER_DIST=X("50%",!1),zn.OUTSIDE_DIST=25,zn.ENDED_DIST=10,zn.defaults=Ee(ji.defaults,{radius:.7,rotationMode:"arc"});class Hn extends Oe{getLength(){return this.visible?this._op.length:0}_isVisible(){return this._op.visible&&this._op.length>0}_doSetSimple(t){return a(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.length=m(0,y(t.length,0)),t.ratio=m(.3,g(.8,y(t.ratio,Hn.DEPTH_RATIO)))}}Hn.DEPTH_RATIO=.6,Hn.defaults=Ee(Oe.defaults,{visible:!1,length:25,ratio:Hn.DEPTH_RATIO});class Gn extends Wi{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new In(this.chart)).init(),t.depth=(this._depth=new Hn(this.chart)).init()}get innerText(){return this._innerText}get depth(){return this._depth}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?W(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new zn(t)}_createPoint(t){return new $n(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Fn(t,e)}_doApply(t){super._doApply(t),this._setDims(t,"innerRadius","sliceOffset"),t.totalAngle<=0&&(t.totalAngle=360)}_doPrepareRender(){super._doPrepareRender(),this._innerText._prepareRender(),this._startRad=E+B*y(this._op.startAngle%360,0),this._totalRad=B*m(0,g(360,y(this._op.totalAngle,360))),this._groupPos=NaN}}Gn.type="pie",Gn.defaults=Ee(Wi.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class jn extends Ji{getPolarSize(t,e){return W(this._polarDim,g(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=X(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=X(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof Gn}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+y(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=y(t.options.groupSize,1)/e}))}}jn.type="piegroup",jn.seriesType="pie",jn.defaults=Ee(Ji.defaults,{polarSize:"80%",innerSize:0});class Xn extends pi{}class Yn extends sr{_createPoint(t){return new Xn(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}_createLegendMarker(t,e){return new Ir(t)}_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.render(this.getShape(null),g(e/2,this._op.radius)),s}}Yn.type="scatter",Yn.defaults=Ee(sr.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Wn extends pi{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 Un extends Mi{}Un.defaults=Ee(Mi.defaults,{offset:0});class Zn extends Ki{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Un(t)}_createPoint(t){return new Wn(t)}_createLegendMarker(t,e){return Hs.create(t,$i.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}}Zn.type="waterfall",Zn.defaults=Ee(Ki.defaults,{tooltipDetail:"<b>${y}</b>"});class qn extends xr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,s,i,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,s,i,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,s,i,r){const n=this._log,o=this._pow,a=this._snap;i>=s?i=s:r<=s&&(r=s);const h=r-i;if(0===h||t<=0)return isNaN(i)?[]:[i];let l=[],d=m(1,_(t/e))+1;if(r-i>=.5){if(0===h)return isNaN(i)?[]:[i];let t=h/(d-1);const e=o(Math.floor(n(t))),_=this._getStepMultiples(e);if(t/=e,_&&_.length>0)if(t>_[0]){for(let e=0;e<_.length-1;e++)if(t>_[e]&&t<_[e+1]){t=t<=_[e]+(_[e+1]-_[e])/2?_[e]:_[e+1];break}}else t=_[0];t*=e,(t<=0||!isFinite(t))&&(t=h/d),i=isNaN(s)?this._normalizeMin(i,t):s-c((s-i)/t)*t;const u=this.axis,p=Math.pow(u._logBase,r-i)>u._roundThreshold,g=.5;let m=i,f=a(m);for(l.push(f);f<r;)m+=t,f=a(p?Math.round(m):m),f>l[l.length-1]&&(f<r&&(1==l.length&&f-l[l.length-1]<t||l.length>1&&f-l[l.length-1]<(l[l.length-1]-l[l.length-2])*g)&&l.pop(),l.push(f))}else{i=o(i);const t=(r=o(r))-i;let e=t/(d-1);const s=o(_(n(e))),a=this._getStepMultiples(s);if(e/=s,a&&a.length>0){let t=a[0];for(let s=0;s<a.length-1;s++)if(e>a[s]&&e<a[s+1]){t=e<=a[s]+(a[s+1]-a[s])/2?a[s]:a[s+1];break}e=t}e*=s,(e<=0||!isFinite(e))&&(e=t/d);const h=1e-10*e;let c=_(i/e)*e;for(c<i&&(c+=e),l.push(n(c));c<=r+h;)c+=e,c>0&&l.push(n(c))}return l}}qn.defaults=Ee(xr.defaults,{arrangeDecimals:!0});class Kn extends Sr{_isLog(){return!0}_createLabel(){return new wr(this)}_createTickModel(){return new qn(this)}_doApply(t){super._doApply(t);const e=this._logBase=m(2,y(t.logBase,10));this._roundThreshold=y(t.roundThrrehold,500),this._log=this.$_createLog(e),this._pow=this.$_createPow(e),this._snap=this.$_createSnap(e,this._log)}$_createLog(t){return 10===t?Math.log10:e=>Math.log10(e)/Math.log10(t)}$_createPow(t){return e=>Math.pow(t,e)}$_createSnap(t,e){return s=>{const i=_(s);return s===i?s:i+e((s-i)*t)}}dataToAxis(t){return this._log(t)}axisToData(t){return this._pow(t)}getXStart(){return 1}valueMin(){return this._pow(this._min)}valueMax(){return this._pow(this._max)}getPos(t,e){return e=e>0?this._log(e):-1,super.getPos(t,e)}_checkValues(t){return t.filter((t=>t>0))}_doCalculateRange(t){const e=super._doCalculateRange(this._values);return e.min=this._log(e.min),e.max=this._log(e.max),e}_createTick(t,e){return super._createTick(t,D(this._pow(e)))}_calcUnitLen(t,e,s,i){if(t.length<2)return super._calcUnitLen(t,e,s,i);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=g(n,r(t[e])-r(t[e-1]));const o=i-s,a=n/o;return{len:y(e*=a,1),min:o*a}}}Kn.type="log",Kn.defaults=Ee(Sr.defaults,{logBase:10,roundThrrehold:500});class Qn extends Oe{isChartScope(){return"chart"===this.options.scope}getHoverEffect(){const t=this.options;return"auto"===t.hoverEffect?t.hoverImageUrl?"image":"background":t.hoverEffect}click(){if(this._op.onClick){const t={chart:this.chart.wrapper,button:this};this._op.onClick(t)}}}Qn.defaults=Ee(Oe.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class Jn extends De{load(t){const e=this.chart,s=this._items=[];i(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t))})):t&&s.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map((t=>t.options))}$_loadItem(t,e){const s=new Qn(t);return s.init(),s._load(e),s}}const to="$ctrl";class eo extends Oe{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}eo.defaults=Ee(Oe.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class so extends Oe{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==b(this._op.scope,"auto")?this._op.scope:this.chart.chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}so.defaults=Ee(Oe.defaults,{scope:"auto"});class io extends Oe{_doInit(t){t.pointHovering=(this._pointHovering=new so(this.chart)).init()}get pointHovering(){return this._pointHovering}getXStart(t){var e;return null!==(e=this._op.xStart)&&void 0!==e?e:t.getXStart()}}var ro;io.defaults=Ee(Oe.defaults,{paletteMode:"normal",animatable:!0,xStep:1,axisGap:8,seriesHovering:!1,timeOffset:(new Date).getTimezoneOffset(),startOfWeek:0,resizeDelay:50}),function(t){t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t.RIGHT="right"}(ro||(ro={}));class no extends _t{static registerSplitClass(t){this.split_class=t}constructor(t,e){super(),this._data=new ut,this._palColors={},this._params={},this._seriesIndex=0,this._dataDirty=!1,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Le,(this._chartOptions=new io(this)).init(),(this._title=new lr(this)).init(),(this._subtitle=new _r(this)).init(),(this._legend=new Rs(this)).init(),(this._credits=new eo(this)).init(),(this._tooltip=new cr(this)).init(),this._buttons=new Jn(this),no.split_class&&(this._split=new no.split_class(this)).init(),(this._body=new Ts(this)).init(),(this._navigator=new hr(this)).init(),(this._exporter=new Os(this)).init(),this._series=new Fi(this),this._xAxes=new ls(this,!0),this._yAxes=new ls(this,!1),this._gauges=new fs(this),this._annotations=new He(this),s(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},no.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[to]).win()}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new no(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}getAxisOf(t,e){return this._splitted?this._split.getAxisOf(t,e):e?this.xAxis:this.yAxis}isValidAxis(t){return t&&(!this._splitted||this._split.isValidAxis(t))}getTooltipContext(t,e,s){class i{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter((t=>t.needAxes()))}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,s){return Ji.collectTooltipText(this.axis.options,this.series,t,e,s)}getTooltipParam(t,e,s){return Ji.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?e._group:e;default:return e}}get chart(){return this}anchorByName(t){const e=this.gaugeByName(t);return e instanceof us?e:this._annotations.get(t)}get wrapper(){return this._wrapper}get type(){return this._op.type}get gaugeType(){return this._op.gaugeType}get polar(){return this._op.polar}get inverted(){return this._op.inverted}get timeOffset(){return this._op.chart.timeOffset}get startOfWeek(){return this._op.chart.startOfWeek}get seriesCount(){return this._series.count}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}canOverflowRender(){return!1}_needAxes(){return this._series.needAxes()}_getSeries(){return this._series}_getGauges(){return this._gauges}_getAnnotations(){return this._annotations}_getXAxes(){return this._xAxes}_getYAxes(){return this._yAxes}getAnnotations(){return this._splitted?this._annotations.getVisibles().filter((t=>isNaN(t.row)||isNaN(t.col))):this._annotations.getVisibles()}_getButtons(){return this._buttons}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))}_getXAxesAt(t,e){return this._splitted?this._xAxes._internalItems().filter((s=>s.col===t&&(!e||s.checkVisible()))):this._xAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter((s=>s.row===t&&(!e||s.checkVisible()))):this._yAxes._internalItems().filter((t=>!e||t.checkVisible()))}_getXAxesAtPane(t,e,s){return this._splitted?this._xAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._xAxes._internalItems().filter((t=>!s||t.checkVisible()))}_getYAxesAtPane(t,e,s){return this._splitted?this._yAxes._internalItems().filter((i=>i.col===t&&i.row===e&&(!s||i.checkVisible()))):this._yAxes._internalItems().filter((t=>!s||t.checkVisible()))}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.getBodyAnnotation(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 ro.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case ro.RIGHT:r=s.filter((t=>t._isOpposite));break;case ro.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case ro.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case ro.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case ro.RIGHT:r=i.filter((t=>t._isOpposite));break;case ro.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case ro.TOP:r=s.filter((t=>t._isOpposite))}return r?e?r.filter((t=>t.checkVisible())):r:[]}_setProperties(t,e=!0){const s=this._op;for(const e in no.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,i){const r=this._bases[e];let n;return s(r.base)&&Te(n={},r.base),s(r[i])&&(n||(n={}),Te(n,r[i])),n?Te(n,t):t}_load(t){var e,i;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(b(t.asset,t.assets)),r.options=r.chart=this._chartOptions._load(b(t.chart,t.options)),s(t.chart)?this._credits._load(t.chart.credits):s(t.options)&&this._credits._load(t.options.credits),r.title=this._title._load(t.title),r.subtitle=this._subtitle._load(t.subtitle),r.legend=this._legend._load(t.legend),r.credits=this._credits._load(t.credits),this._buttons.load(b(t.button,t.buttons)),r.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series),null===(e=this._gauges)||void 0===e||e.load(b(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(w(t.xAxis,t.xAxes,{})),this._yAxes.load(w(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(i=this._split)||void 0===i||i._load(t.split),this._annotations.load(b(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(t.exporting),this}update(t,e){if(s(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof Oe||s instanceof De||s instanceof Le)&&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;return[e,s].forEach((t=>{t.count<1&&!this._gaugeOnly&&t.load({})})),this._inverted=!this._polar&&this.inverted,this._splitted=i&&i.visible,this._assets.prepareRender(),e.disconnect(),s.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),s.prepare(),e.collectValues(),s.collectValues(),e.collectReferentValues(),s.collectReferentValues(),s.collectRanges(),e.collectRanges(),e.prepareRender(),s.prepareRender(),this._splitted&&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(),this}afterRender(){this._dataDirty=!1,this._xAxes.afterRender(),this._yAxes.afterRender()}layoutAxes(t,e,s,i){this._xAxes._buildTicks(s?e:t,i),this._yAxes._buildTicks(s?t:e,i),this.$_calcAxesPoints(t,e,s,i)}$_calcAxesPoints(t,e,s,i){let r=s?e:t;this._xAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&t._calcPoints(r,i)})),r=s?t:e,this._yAxes.forEach((t=>{(i<2||i>100||t._isHorz||!t.continuous())&&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,e);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")}getPaletteColors(t){let e=this._palColors[t];if(!e){const s=document.querySelector(".rct-root");if(s){const i="data-palette",r=s.getAttribute(i);s.setAttribute(i,t);const n=getComputedStyle(s);this._palColors[t]=e=[];for(let t=1;t<=Ri;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());s.setAttribute(i,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(s(t)){const r=this._templates={};for(const e in t){const i=t[e];s(i)&&(r[e]=l({},i))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach((i=>{t.hasOwnProperty(i)&&s(t[i])&&(e[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return Te(Te({},s),t)}else i(e)&&e.forEach((e=>{let s=this._templates[e];return s?Te(Te({},s),t):s}));return t}}else this.assignTemplates=void 0}_getGroupType(t){return n(t)&&Ci[t.toLowerCase()]}_getSeriesType(t){return n(t)&&ki[t.toLowerCase()]}_getAxisType(t){return n(t)&&Ye[t.toLowerCase()]}_getGaugeType(t){return n(t)&&cs[t.toLowerCase()]}_getGaugeGroupType(t){return n(t)&&ds[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Ie[t.toLowerCase()]}getAxesGap(){return y(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)}}no.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},hs.register(wi,Ar,Kn,Er),$i.register(Jr,sn,Tr,Rr,an,ln,cn,pn,mn,bn,vn,Vn,kn,Ln,qr,Kr,Bn,On,Rn,Gn,Yn,Zn),Ji.register(nn,Fr,dn,fn,rn,jn),Ji.registerSeries(nn,Fr,fn,rn,jn),ze.register(gr,mr,fr);class oo{constructor(t,e){this._modelCallback=e,this._obj=new no(t,this),this._loaded=s(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[to]=null===(t=this[to])||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 credits(){return this._obj._credits}get tooltip(){return this._obj._tooltip}get xAxis(){return this._obj.xAxis}get yAxis(){return this._obj.yAxis}get body(){return this._obj._body}get split(){return this._obj._split}get seriesNavigator(){return this._obj._navigator}get exporter(){return this._obj._exporter}getXAxis(t){return this._obj.getXAxis(t)}getYAxis(t){return this._obj.getYAxis(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}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,i){var r;if(s(t)){const s="load chart";at.LOGGING&&console.time(s);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new no(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,at.log("chart-items:",Me),at.LOGGING&&console.timeEnd(s),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[to].refresh()}}class ao{constructor(t,e){this._obj=new dt(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 ho extends lt{constructor(t,e,s){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=s}_doDestroy(){var t;null===(t=this._orphans)||void 0===t||t.clear(),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.contains(t))return e}find(t){return this._views.find(t)}$_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){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}getOrphans(){return this._orphans?Array.from(this._orphans.values()):null}addOrphan(t,e){this._prepareOrphans().set(t,e),this._views.splice(this._views.indexOf(e),1)}freeOrphan(t){var e;const s=null===(e=this._orphans)||void 0===e?void 0:e.get(t);s&&(this.free(s),this._orphans.delete(t))}clearOrphans(){var t,e;for(let e of(null===(t=this._orphans)||void 0===t?void 0:t.values())||[])this.free(e);null===(e=this._orphans)||void 0===e||e.clear()}_prepareOrphans(){return this._orphans||(this._orphans=new Map),this._orphans}}const lo=Object.freeze({x:0,y:0,width:0,height:0}),_o=function(t,e,s,i){return{x:t,y:e,width:s,height:i}};function co(t){return{width:t.width,height:t.height}}function uo(t){return t.width<=0||t.height<=0}const po=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))]))},go=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},mo=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},fo=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},yo=function(t,e){const s=po(t),i=po(e),r=go(s),n=go(i);for(const t of[...r,...n]){const e=mo(s,t),r=mo(i,t);if(!fo(e,r))return!1}return!0},xo=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 bo{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new bo(t,t,t,t):new bo(t,t,e,e):new bo(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 bo(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=y(t.paddingLeft,0),this.right=y(t.paddingRight,0),this.top=y(t.paddingTop,0),this.bottom=y(t.paddingBottom,0),this}applyMargin(t){return this.left=y(t.marginLeft,0),this.right=y(t.marginRight,0),this.top=y(t.marginTop,0),this.bottom=y(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}}}bo.Empty=Object.freeze(new bo),bo.Temp=new bo;class wo extends Jt{constructor(t,e=N){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return wo.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}wo.IGNORE_ATTRS={width:"",height:""};class vo extends Jt{constructor(t,e=N){super(t,e,"g"),Jt.DEBUGGING&&(this.add(this._debugRect=new Hs(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_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 Hs(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 Vo extends vo{constructor(t,e,s){super(t,e),this._margins=new bo,this._paddings=new bo,this.add(this._background=new Hs(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}_inflaePaddings(t){const e=this._paddings;return t.width+=e.left+e.right,t.height+=e.top+e.bottom,t}}class So extends wo{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 Ao extends vo{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 Po extends Jt{constructor(t,e,s){super(t,s,"image"),this._bounds=lo,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this.invalidate()},this.dom.onerror=()=>{this.invalidate()},window.SVGGraphicsElement&&!ot||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout((()=>{this.onloadProxy()}),0)})}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(t?this.setAttr("href",t):this.unsetAttr("href"),this._proxy&&(this._proxy.src=t))}setImage(t,e,s){this.url=t,this.resize(e,s)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,s=this._bounds.height;e>0&&!s?s=e/t.width*t.height:0==s||e||(e=s/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:s}}return this._bounds}resize(t,e,s){const i=this._proxy;return i&&(z(t)||z(e))&&(t>0&&z(e)?e=t/i.width*i.height:e>0&&z(t)?t=e/i.height*i.width:(t=i.width,e=i.height)),super.resize(t,e,s)}}class ko extends wo{constructor(t,e=N){super(t),this.add(this._text=new ue(t,e)),this._text.anchor=_e.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.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),i&&this._text.internalSetStyleOrClass(i),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Hs(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 ue(t),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?(this._icon||this.add(this._icon=new Po(t,!1)),this._icon.setImage(s,+e.options.iconWidth,+e.options.iconHeight)):this._icon&&(this._icon.remove(),this._icon=null),this._box=void 0,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.internalSetStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(t){const e=this._text,s=this._outline,i=this._icon;let r=0;const n=e.getBBox(),o=n.width,a=n.height;let h=o,l=a,_=0,c=0,d=0,u=0;if(this._box=void 0,i){const t=i.getBBox();switch(r=y(this._model.options.iconGap,0),_=t.width,c=t.height,this._model.getIconPos()){case"left":case"right":h+=r+_,l=Math.max(c,a);break;default:l+=r+c,h=Math.max(_,o)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);d=parseFloat(t.paddingLeft)||0,u=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,h+d+(parseFloat(t.paddingRight)||0),l+u+(parseFloat(t.paddingBottom)||0),t.rx)}if(i)switch(this._model.getIconPos()){case"left":i.trans(d,(l-c)/2),d+=_+r,h-=_+r;break;case"right":i.trans(d+h-_,(l-c)/2),h-=_+r;break;case"top":i.trans((h-_)/2,u),u+=c+r;break;case"bottom":i.trans((h-_)/2,u+a+r)}switch(t){case"center":d+=h/2,e.anchor=_e.MIDDLE;break;case"right":d+=h,e.anchor=_e.END;break;default:e.anchor=_e.START}return e.trans(d,u),s&&(s.anchor=e.anchor,s.setAttr("y",e.getAttr("y")),s.trans(e.tx,e.ty)),this}setOutline(t){this._back&&this._back.remove(),this._outline||(this._outline=new ue(this.doc),this._outline.anchor=this._text.anchor),this.insertFirst(this._outline),this._outline.setStyleOrClass(t._style)}getBBox(){return this._box?this._box:this._box=super.getBBox()}}class Co extends Vo{constructor(t){super(t,"rct-axis-title","rct-axis-title-background"),this.add(this._textView=new ue(t)),this._richText=new ve}rotatedWidth(){const t=this.model.getRotation()*B,e=this.getBBox();return f(u(t)*e.height)+f(d(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*B,e=this.getBBox();return f(d(t)*e.height)+f(u(t)*e.width)}_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,o=n.writingMode;o&&this._textView.setStyle("writingMode",o),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._richText._isVertical="vertical"===o,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(this._textView,s,i,null,null);const a=co(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(t){const e=this._textView,s=e.getStyle("writing-mode"),i=s===it||s===rt;t?this.rotation=0:this.setRotation(0,(i?this.width:this.height)/2,this._angle);let r=this._margins.top+this._paddings.top,n=0;switch(this.textAlign()){case"left":e.anchor=_e.START,i||(n-=this.width/2);break;case"right":e.anchor=_e.END,i?r+=this.height:n+=this.width/2;break;default:e.anchor=_e.MIDDLE,i&&(r+=this.height/2)}e.trans(n,r)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}class No extends Vo{constructor(t){super(t,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new ue(t)),this._textView.anchor=_e.START,this._richText=new ve}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,s,i,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null),co(this._textView.getBBox())}_doLayout(t){const e=this._textView;let s=this._margins.top+this._paddings.top,i=0;switch(this.textAlign()){case"left":e.anchor=_e.START,i-=this.width/2;break;case"right":e.anchor=_e.END,i+=this.width/2}e.trans(i,s)}}class Lo extends vo{constructor(t){super(t,Oo.TICK_CLASS),this.add(this._lineView=new Gr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class Mo extends ko{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1}setLabel(t,e,s,i,r,n){if(i){const o=t.getIcon(s);t.prepareRich(i),this.setModel(this.doc,t,o&&t.getUrl(o),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)}else t.prepareRich(""),this._text.text=""}applyBackgroundCallback(t,e){const s=t.options.backgroundStyleCallback;if("background"===t.options.effect&&s){const i=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(s(i))}}rotatedWidth(){const t=(this.rotation||0)*B,e=this.getBBox();return f(u(t)*e.height)+f(d(t)*e.width)}rotatedHeight(){const t=this.rotation*B,e=this.getBBox();return f(d(t)*e.height)+f(u(t)*e.width)}resizeBackByWeight(t,e,s,i,r,n,o,a,h,l=0){const _=this._back;if(_&&!t._isHorz){const t=this.getBBox(),c=r/a,d=e?n-o+l:s?n:l-o;_.transX(d-this.tx),_.shiftY((c-t.height)/-2-h),e?_.resize(i-l-2*(n+o),c-1):_.resize(i-n-l+o,c-1)}}}class Eo extends Jt{constructor(t){super(t,void 0),this.add(this._back=new ne(t,"rct-crosshair-flag")),this.add(this._text=new ue(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 qt,n=m(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 Bo extends vo{static isThumb(t){return t.classList.contains(Bo.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Hs(t,Bo.TRACK_CLASS)),this.add(this._thumbView=new Hs(t,Bo.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,s=t.end-t.start;this._len=m(0,e),this._page=g(s,e),this._pos=g(t.min+e-s,m(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=m(0,g(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=y(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)}}}Bo.CLASS_NAME="rct-axis-scrollbar",Bo.TRACK_CLASS="rct-axis-scrollbar-track",Bo.THUMB_CLASS="rct-axis-scrollbar-thumb";const To=/\${label}.*?/g;class Oo extends vo{constructor(t){super(t,Oo.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new Gr(t,Oo.LINE_CLASS)),this.add(this._titleView=new Co(t)),this.add(this._markContainer=new Jt(t,"rct-axis-ticks")),this.add(this._labelContainer=new Jt(t,"rct-axis-labels")),this.add(this._unitView=new No(t)),this._labelViews=new ho(this._labelContainer,Mo,"rct-axis-label")}$_checkScrollView(t,e,s,i,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new Bo(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,i,r,1)[s];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=m(0,i.tick._getLength())+m(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsHorz(i,e,!0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).height,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"height",e,s),o}checkWidth(t,e,s){const i=this.model,r=i.title,n=i.unitLabel;let o=m(0,i.tick._getLength())+m(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsVert(i,s,!0,0);i.label._inside||(o+=t)}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,s,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,s,1).width,o+=r.options.gap),o+=this.$_checkScrollView(t,i.scrollBar,"width",e,s),o}prepareGuides(t,e,s,i,r){[i,r].forEach(((i,r)=>{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 Eo(this.doc)),r.setVis(!0),r.setText(s.crosshair,e);const n=r.getBBox();s._isHorz?r.trans(t-n.width/2,s.tick._getLength()):(i="opposite"===s._runPos?g(0,this.width-n.width):m(0,this.width-s.tick._getLength()-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){}hideCrosshiar(){this._crosshairView&&this._crosshairView.setVis(!1)}scroll(t){}prepare(t){this._model=t,this._chartEmpty=t.chart.isEmpty(!0)}checkExtents(t){const e=this._prevModel,s=this.model;if((!e||e===s)&&t){const t=this._prevMin,e=this._prevMax,i=this._prevMin=s.axisMin(),r=this._prevMax=s.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&i!==t){if(s._isX&&s._zooming)return{axis:s,from:this._prevMin,to:r};s.chart.animatable()&&s.options.animatable&&s.checkExtents(t,e)}}this._prevModel=s}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,c=this._unitView;let d=0,u=0;return this._reversed=e.options.reversed,(this._lineView.visible=o.visible)?(this._lineView.setStyleOrClass(o._style),l&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new Gr(t,Oo.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a._getLength(),this._tickGap=a._getGap(),e.label._inside||(d+=this._markLen,d+=this._tickGap,l&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach((n=>n.measure(t,e.tick,s,i,r))),this.$_prepareLabels(e,h?s:i)&&(u=h?this.$_measureLabelsHorz(e,s):this.$_measureLabelsVert(e,i,!1,r),e.label._inside&&(u=0)),this._labelSize=u,c.setVis(e.unitLabel.visible)&&(u=h?Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,i,i,r).width)),d+=u,this._simpleMode?(_.setVis(!1),c.setVis(!1)):(_.visible&&(d+=h?_.mh:_.mw,d+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=h?this._scrollView.mh:this._scrollView.mw)),{width:h?s:d,height:h?d:i}}_doLayout(){const t=this.model,e=t._isHorz,s=t._isOpposite,i=t._isBetween,r=t.label._inside,n=t._ticks,o=t._markPoints,a=this._labelViews,h=this._unitView,l=this._markLen,_=this._tickGap,c=this.width,d=this.height;this._lineView.visible&&(e?this._lineView.setHLine(s?d:0,0,c):this._lineView.setVLine(s?0:c,0,d),this._lineView2&&(e?this._lineView2.setHLine(d,0,c):this._lineView2.setVLine(0,0,d))),this._markContainer.visible&&(e?this._markViews.forEach(((e,i)=>{e.resize(1,l),e.layout().trans(t.prev(o[i]),s?r?d:d-l:r?-l:0)})):this._markViews.forEach(((e,i)=>{e.resize(l,1),e.layout().trans(s?-l:r?c:c-l,d-t.prev(o[i]))})));const u=l+_;if(this._labelContainer.visible&&a.count>0&&(a.count>n.length?a.prepare(n.length):a.count<n.length&&at.warn("labelViews.count < ticks.length",a.count,n.length),e?this.$_layoutLabelsHorz(a,n,r,i,s,c,d,u):this.$_layoutLabelsVert(a,n,r,i,s,c,d,u)),h.visible&&(e?this.$_layoutUnitHorz(h,a,s,c,d,u):this.$_layoutUnitVert(h,a,s,c,d,u)),!this._simpleMode){const i=t.title.options,n=this._titleView,o=this._scrollView,a=this._labelSize;let h=0,l=0;if(n.visible){const o=+i.offset||0,_=+i.gap||0;if(n.resizeByMeasured().layout(e),e){if(l+=s?0:(r?0:u+a)+_,t.options.reversed)switch(i.align){case"start":h=c-n.width/2-o;break;case"end":h=n.width/2+o;break;default:h=c/2-o}else switch(i.align){case"start":h=n.width/2+o;break;case"end":h=c-n.width/2-o;break;default:h=c/2+o}n.trans(h,l),l+=n.height}else{const t=0===n._angle?n.width:n.height;if(h=s?r?_+t/2:u+a+_+t/2:r?t/2:c-u-a-_-t/2,this._reversed)if(0===n._angle)switch(i.align){case"start":l=0+o;break;case"end":l=d-n.height-o;break;default:l=(d-n.height)/2+o}else switch(i.align){case"start":l=n.width/2-n.height/2+o;break;case"end":l=d-n.width/2-n.height/2-o;break;default:l=(d-n.height)/2+o}else if(0===n._angle)switch(i.align){case"start":l=d-n.height-o;break;case"end":l=0+o;break;default:l=(d-n.height)/2-o}else switch(i.align){case"start":l=d-n.width/2-n.height/2-o;break;case"end":l=n.width/2-n.height/2+o;break;default:l=(d-n.height)/2-o}n.trans(h,l)}}else l+=s?0:u+a;(null==o?void 0:o.visible)&&(e?(o.trans(0,l).resize(this.width,o.mh),o.setScroll(t._zoom,this._reversed)):(o.trans(0,0).resize(o.mw,this.height),o.setScroll(t._zoom,this._reversed)),o.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 Lo(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,a=s.getLabelStyle(e,i);if(t.value=e.value,null!=n){o&&n.match(To)?t.setLabel(s,a,e,n.replace(To,o),1e3,1e3):(s.prepareRich(n),s._paramTick=e,t.setModel(this.doc,s,null,a),s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,a,e,o,1e3,1e3);t.applyBackgroundCallback(s,e),t.layout("center")}$_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=m(0,g(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,u=(i=m(1,i))*(r=g(m(1,r),_.length)),p=n||0,y=f(p)*B,x=y<35*B;let b,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){b=e.pull(v++),b.rotation=p,b.row=n,b.index=r,this._prepareLabel(b,_[r],h,c,a),b.setVis(!0);const t=i;if(0===p&&b.getBBox().width>=t){w=!0;break}if(x&&b.getBBox().width*d(y)>=t){w=!0;break}if(0!==p&&b.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-u;0<=t&&t<c&&(b=e.pull(v++),b.row=n,b.rotation=p,b.index=t,this._prepareLabel(b,_[t],h,c,a),b.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,s){const i=t.label,r=m(0,g(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.options.reversed,r=t.label,n=r.options;let o,a=+n.step|0,h=+n.rows|0,l=+n.rotation%360,_=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s),c=this._labelViews._internalItems();if(this._labelRowPts=[0],_)if("none"===n.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=l,e.row=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),c=this.$_applyStep(t,c,a||1);else{switch(a=h=0,r.options.autoArrange){case"rows":h=this.$_getRows(c);break;case"step":a=this.$_getStep(c)}if(a>1)for(;this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,s);)a++;else if(h>1){for(;t._ticks.length>h&&(c.forEach(((t,e)=>{t.row=e%h,t.index=e})),this.$_checkOverlappedHorz2(t,this._labelViews,e,1,h,0,!1,s));)h++;this._labelRowPts=[]}else if((isNaN(l)||Math.abs(Math.tan(l*B))<1)&&(l=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s))for(a=2;;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,l,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,h,0,!0,s)&&c.forEach(((t,e)=>{t.rotation=l}));break}a++}}else;if(c.length>0){if(h>1){const t=!isNaN(l)&&0!=l,e=this._labelRowPts;for(let t=0;t<h;t++)e.push(0);c.forEach((s=>{e[s.row]=m(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(l)||0==l){o=c[0].getBBox().height;for(let t=1;t<c.length;t++)o=m(o,c[t].getBBox().height);if(c.length>1){const e=t._ticks;let s=i?n.lastOverflow:n.firstOverflow;if("hidden"===s){const t=c[0],s=t.rotatedWidth();let i=e[t.index].pos-s/2,r=0;for(let t=1;t<c.length;t++)r=m(r,c[t].getBBox().height);(i+s>c[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(o=r,t.hidden=!0):t.hidden=!1}if(s=i?n.firstOverflow:n.lastOverflow,"hidden"===s){const t=c[c.length-1],s=t.rotatedWidth(),i=c[c.length-2],r=e[t.index-1].pos+i.getBBox().width/2;let n=e[t.index].pos-s/2,a=0;for(let t=0;t<c.length-1;t++)a=m(a,c[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>a?(o=a,t.hidden=!0):t.hidden=!1}}}else{o=c[0].rotatedHeight();for(let t=1;t<c.length;t++)o=m(o,c[t].rotatedHeight())}return o}return 0}$_checkOverlappedVert2(t,e,s,i,r){const n=t.label,o=t._ticks,a=o.length,h=m(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._text.getBBox().height>=i))return!0}const d=_-h;0<=d&&d<a&&(l=e.pull(c++),l.rotation=0,l.index=d,this._prepareLabel(l,o[d],n,a,r),l.setVis(!0)),e.freeFrom(c)}$_measureLabelsVert(t,e,s=!1,i=0){if(i>1&&t instanceof Sr)return this._prevWidth;const r=t.label;let n=m(1,+r.options.step|0);const o=this.$_checkOverlappedVert2(t,this._labelViews,e,n,s);let a=this._labelViews._internalItems();if(o)if("none"===r.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),a=this.$_applyStep(t,a,n||1);else for(;this.$_checkOverlappedVert2(t,this._labelViews,e,++n,s););else;if(this._labelViews.freeHiddens(),a=this._labelViews._internalItems(),a.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",s=this._labelContainer.textAlign()||e;let i;a[0].setContrast(null).layout(s),i=a[0].getBBox().width;for(let t=1;t<a.length;t++)a[t].setContrast(null).layout(s),i=m(i,a[t].getBBox().width);return this._prevWidth=i}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o,a){const h=this.model,l=h.label,_=this._reversed,c=this._labelContainer.textAlign()||"center",d=this._labelRowPts,p=t.get(0).rotation,g=p*B,m=+h.label.options.rows|0,f=p<-15&&p>=-90||p>15&&p<=90,x=t.count,b=y(h._prevRate,1);let w,v,V;if(t.freeHiddens(),t.forEach(((t,i)=>{const l=e[t.index];t.setVis(!!l)&&(t.setContrast(null).layout(c),w=t.getBBox(),v=h.prev(l.pos)+(_?n*(1-b):0),V=s?r?o+a+d[t.row]:-a-w.height-d[t.row]:r?o-a-w.height-d[t.row]:a+d[t.row],p<-15&&p>=-90?s?r?(V+=u(g)*w.height/2,t.setRotation(0,w.height/2,-p)):(V-=u(g)*w.height/2,t.setRotation(0,w.height/2,p)):r?(v-=w.width,V-=u(g)*w.height/2,t.setRotation(w.width,w.height/2,-p)):(v-=w.width,V+=u(g)*w.height/2,t.setRotation(w.width,w.height/2,p)):p>15&&p<=90?s?r?(v+=w.width,V-=u(g)*w.height/2,t.setRotation(w.width,w.height/2,-p)):(v-=w.width,V+=u(g)*w.height/2,t.setRotation(w.width,w.height/2,p)):r?(V+=u(g)*w.height/2,t.setRotation(0,w.height/2,-p)):(V-=u(g)*w.height/2,t.setRotation(0,w.height/2,p)):(v-=w.width/2,t.setRotation(w.width/2,0,r?-p:p)),t.trans(v,V))})),!f&&m<2&&x>1){let e=t.get(_?x-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2;let n=!0;const o=e.rotatedWidth(),a=_?i.lastOverflow:i.firstOverflow;let h,c=e.tx;c+o>=s.tx?"pull"===a?c=s?s.tx-o-r:0:n="hidden"!==a:(h=e.elementToSvg(0,0).x)<0&&("pull"===a?c=Math.min(s.tx-r,h+4):n="hidden"!==a),n?e.transX(c):e.setVis(!1)}(0,e,t.get(_?x-2:1)),e=t.get(_?0:x-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=l.options,r=+i.overflowGap||2,o=s.tx+s.rotatedWidth();let a=!0,h=e.tx;const c=e.rotatedWidth(),d=_?i.firstOverflow:i.lastOverflow;let u,p;h<=o?"pull"===d?h=Math.max(o+r,n-c):a="hidden"!==d:(u=e.elementToSvg(e.getBBox().width,0).x)>(p=t.control.getBounds().width)&&("pull"===d?h=Math.max(o+r,h-(u-p+4)):a="hidden"!==d),a?e.transX(h):e.setVis(!1)}(this,e,t.get(_?1:x-2))}}$_layoutLabelsVert(t,e,s,i,r,n,o,a){var h;const l=this.model,_=l instanceof wi&&l.label.options.fillToCategory,c=r?s?"right":"left":i?"center":s?"left":"right",d=_?l.label.options.verticalAlign:"middle",u=_?l.label.options.align:c,p=this._titleView,g=p.visible?p.rotatedWidth()+(null===(h=p.model)||void 0===h?void 0:h.options.gap):0,m=this._labelSize,f=l.tick._getGap();const x=this._reversed,b=x?y(l._prevRate,1):1;let w=x?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;t.forEach(((t,h)=>{const c=e[t.index];if(t.setVis(!!c)){const e=t.getBBox(),h=function(t,e){if(s)if(r)switch(t){case"center":return(m-e)/2-m-f-a;case"left":return-m-f-a;default:return-e-f-a}else switch(t){case"right":return n+a+f+m-e;case"center":return!p.visible&&i?(n-e)/2:n+a+f+(m-e)/2;default:return n+a+f}else if(r)switch(t){case"center":return a+(n-g-e-a+f)/2;case"right":return n-e-g+f;default:return a}else switch(t){case"left":return g-f;case"center":return!p.visible&&i?(n-e)/2:g+(n-g-e-a-f)/2;default:return n-a-e}}(u,e.width),y=o*b-l.prev(c.pos)-e.height/2;if(t.trans(h,y),_){const s=l._weights.reduce(((t,e)=>t+e))/l._weights[t.index],h=o/s,_="top"===d?(h-e.height)/-2:"bottom"===d?(h-e.height)/2:0;t.shiftY(_),t.resizeBackByWeight(l,i,r,n,o,a,f,s,_,g)}else!x&&t.ty+e.height>w+1||x&&t.ty<w-1?t.setVis(!1):w=x?t.ty+e.height:t.ty}}))}$_layoutUnitHorz(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="end"===o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p;a?h?(u=c.getBBox(),p=Math.min(c.tx-l.width-d,0)):(u=_.getBBox(),p=Math.max(_.tx+u.width+d,i-l.width)):h?(u=c.getBBox(),p=Math.max(c.tx+u.width+d,i-l.width)):(u=_.getBBox(),p=Math.min(_.tx-l.width-d,0)),t.layout().trans(p,n)}$_layoutUnitVert(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="end"===o.unitLabel.options.position,l=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p=s?n:i-l.width-n;a?h?(c.getBBox(),u=Math.max(c.ty+l.height+d,r)):u=Math.min(_.ty-l.height-d,0):h?u=Math.min(c.ty-l.height-d,0):(_.getBBox(),u=Math.max(_.ty+l.height+d,r)),t.layout().trans(p,u)}}Oo.AXIS_CLASS="rct-axis",Oo.LINE_CLASS="rct-axis-line",Oo.TICK_CLASS="rct-axis-tick";class Do extends Jt{constructor(t,e,s){super(t,Do.STYLE),this.add(this._back=new Hs(t,Do.BACK_STYLE)),this.add(this._textView=new ue(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 bo).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,rx:y(parseFloat(e.rx),0),ry:y(parseFloat(e.ry),0)},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}}Do.STYLE="rct-button",Do.BACK_STYLE="rct-button-background";class Ro extends Jt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class $o extends ne{setArc(t,e,s,i,r,n){this.setPath(zs.arc(t,e,s,s,i,close?i+r:i-r,n))}}class Fo extends $o{setPolyline(t){this.setPath(zs.polygon(...t))}}class Io extends ne{constructor(t,e,s){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 zs.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 zs.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 zo={};class Ho extends Vo{static register(...t){t.forEach((t=>{zo[t[0].type]=t[1]}))}constructor(t,e){super(t,Ho.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.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,s)}clicked(){this.model.clicked()}pointerEnter(){}pointerLeave(){}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)}}Ho.CLASS_NAME="rct-annotation";const Go={};class jo extends Ao{static register(...t){t.forEach((t=>{Go[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Hs(t,jo.PANE_CLASS)),this.add(this._contentContainer=new ee(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return jo.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=l($t.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 Zo)return t;t=t.parent}}}jo.GAUGE_CLASS="rct-gauge",jo.PANE_CLASS="rct-gauge-pane";class Xo extends Yt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class Yo extends jo{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return a(i)?xt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._valueRate=NaN}_setValueRate(t){isNaN(t)&&isNaN(this._valueRate)||t===this._valueRate||(this._valueRate=t,isNaN(t)?this.invalidate():this._doValueRateChanged(t))}_prepareStyleOrClass(t){super._prepareStyleOrClass(t),this._backgroundView().setStyleOrClass(t._style)}_doLayout(){this.stopAni(),super._doLayout(),this.$_checkValueAnimation()}$_checkValueAnimation(){const t=this.model;this._animatable&&t.options.animatable&&t.options.value!==t._prevValue&&(this._ani=new Xo(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}}class Wo extends ko{}class Uo extends vo{constructor(t){super(t,"rct-gauge-scale"),this.add(this._line=this._createLine(t,"rct-gauge-scale-line")),this.add(this._tickContainer=new ee(t,"rct-gauge-scale-ticks")),this._ticks=new ho(this._tickContainer,Gr),this.add(this._labelContainer=new ee(t,"rct-gauge-scale-tick-labels")),this._labels=new ho(this._labelContainer,Wo)}}class Zo extends jo{_defaultCalss(){return Zo.GAUGE_GROUP_CLASS}_doInitContents(t,e){e.add(this._gaugeContainer=new ee(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))}))}}Zo.GAUGE_GROUP_CLASS="rct-gauge-group";class qo{static reveal(t,e){new Jo(t,e)}static grow(t,e){new ea(t,e)}static spread(t,e){new sa(t,e)}static fadeIn(t){new Ko(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);at.isAnimation(s)&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Ko extends qo{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:Yt.DURATION,fill:"none"})}}class Qo extends qo{static clipRect(t,e){const s=e.view||t;let i;if(t.model.needClip(!1))i=s.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)i=s.clipRect(0,0,t.width,t.height);else{const e=t.control;i=t.model.chart.isInverted()?s.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):s.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return i}constructor(t,e){super(t,e)}_createAnimation(t,e){const s=Qo.clipRect(t,e);let i;switch(e&&e.from){case"top":i=this.$_top(s,e);break;case"bottom":i=this.$_bottom(s,e);break;case"right":i=this.$_right(s,e);break;default:i=this.$_left(s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:Yt.DURATION,fill:"none"}}$_left(t,e){return t.dom.firstElementChild.animate([{width:0},{width:""}],this.$_aniOptions(e))}$_right(t,e){return t.dom.firstElementChild.animate([{x:t.width},{x:""}],this.$_aniOptions(e))}$_top(t,e){return t.dom.firstElementChild.animate([{height:0},{height:""}],this.$_aniOptions(e))}$_bottom(t,e){return t.dom.firstElementChild.animate([{y:t.height},{y:""}],this.$_aniOptions(e))}}class Jo extends Yt{constructor(t,e){super(),this._series=t,this._cr=Qo.clipRect(t,e),this._from=e.from,this.endHandler=()=>{t._animationFinished(this),this._cr.dom.remove()},this.start(),t._animationStarted(this)}_canUpdate(){return this._series.parent instanceof Jt}_stop(t){super._stop(t),this._series=null}_doUpdate(t){const e=this._cr.dom.firstElementChild;switch(this._from){case"top":e.setAttribute("height",this._cr.height*t);break;case"bottom":e.setAttribute("y",this._cr.height*(1-t));break;case"right":e.setAttribute("x",this._cr.width*(1-t));break;default:e.setAttribute("width",this._cr.width*t)}return!0}}class ta extends Yt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Jt}_stop(t){super._stop(t),this._series=null}}class ea extends ta{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class sa extends ta{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class ia extends ko{constructor(t){super(t,"rct-series-trendline-label")}}class ra extends ee{constructor(t){super(t,"rct-series-trendline"),this.add(this._fixedArea=new ne(t,"rct-series-trendline-fixed")),this.add(this._variableArea=new ne(t,"rct-series-trendline-variable")),this.add(this._line=new ne(t)),this.add(this._label=new ia(t))}layout(t,e,s,i,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.options.reversed,a=e.owner._yAxisObj.options.reversed,h=this.$_getPoints(e,s);this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(s,h)),e.marker.visible?(this._startMarker||(this.add(this._startMarker=new ne(t,"rct-series-trendline-marker")),this.add(this._endMarker=new ne(t,"rct-series-trendline-marker"))),this.$_layoutMarkers(e,h)):this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)),this._fixedArea.setVis(e.fixedArea.visible)&&(this._fixedArea.setStyleOrClass(e.fixedArea._style),this._fixedArea.setPath(this.$_getFixed(n,o,a,s,h,i,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,s,h,i,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,null,e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(s,e,n,o,a,h,i,r))}$_getPoints(t,e){const s=t.owner,i=s.chart.isInverted(),r=s._xAxisObj,n=s._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let h;return h=e?t._points.map((t=>{const s=e.start+r.getPos(a,t.x),i=n.getPos(e.rd,t.y);return{x:e.cx+i*d(s),y:e.cy+i*u(s),a:s}})):t._points.map((t=>{let e,s;return i?(s=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),s=o-n.getPos(o,t.y)),{x:e,y:s}})),h}$_getLine(t,e){const s=new qt;return s.move(e[0].x,e[0].y),s.lines(...e),s.end()}$_getVariable(t,e,s,i,r,n,o){const a=new qt,h=r[0],l=r[r.length-1];if(i);else if(t)if(s){a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(h.x,l.y)}else{a.move(h.x,h.y),a.line(h.x,l.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else if(s){a.move(h.x,h.y),a.line(l.x,h.y);for(let t=r.length-1;t>=0;t--)a.line(r[t].x,r[t].y)}else{a.move(h.x,h.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(l.x,h.y)}return a.end()}$_getFixed(t,e,s,i,r,n,o){const a=new qt,h=r[0],l=r[r.length-1];return i||(t?s?a.polygon(h.x,h.y,n,h.y,n,l.y,h.x,l.y):a.polygon(0,h.y,h.x,h.y,h.x,l.y,0,l.y):s?a.polygon(h.x,0,l.x,0,l.x,h.y,h.x,h.y):a.polygon(h.x,h.y,l.x,h.y,l.x,o,h.x,o)),a.end()}$_layoutMarkers(t,e){const s=t.marker.getRadius();if(this._startMarker.setVis(s>0)&&this._endMarker.setVis(s>0)){const i=zs.getDrawer(t.marker.options.shape);this._startMarker.setPath(i(s)),this._endMarker.setPath(i(s)),this._startMarker.setStyleOrClass(t.marker._style),this._endMarker.setStyleOrClass(t.marker._style),this._startMarker.trans(e[0].x,e[0].y),this._endMarker.trans(e[e.length-1].x,e[e.length-1].y)}}$_layoutLabel(t,e,s,i,r,n,o,a){const h=e.label,l=e.marker.visible?e.marker.getRadius():0,_=this._label;if(!String(h.options.text))return void _.setVis(!1);h.prepareRich(h.options.text),h.buildSvg(_._text,_._outline,NaN,NaN,h,e.getLabelDomain());const c=h.options.position,d=t?function(t){const e=Math.floor((n.length-1)*t),s=(n.length-1)*t-e;let i;if(e>=n.length-1)i=n[n.length-1].a;else{const t=n[e],r=n[e+1];i=t.a+(r.a-t.a)*s}return i}(c):0,u=t?h.getAlignPolar(d):h.getAlign(s,i,r,c),p=t?h.getVerticalAlignPolar(d):h.getVerticalAlign(s,i,r),g=h.getOffsetX(u)+("middle"===p?l:0),m=h.getOffsetY(p)+("center"===u?l:0),f=Math.floor((n.length-1)*c),y=(n.length-1)*c-f;let x,b;if(f>=n.length-1)x=n[n.length-1].x,b=n[n.length-1].y;else{const t=n[f],e=n[f+1];x=t.x+(e.x-t.x)*y,b=t.y+(e.y-t.y)*y}const w=_.getBBox();switch(u){case"left":x-=w.width+g;break;case"center":x-=w.width/2+g;break;case"right":x+=g}switch(p){case"top":b-=w.height+m;break;case"middle":b-=w.height/2+m;break;case"bottom":b+=m}t||(x<0&&(x=0),b<0&&(b=0),x+w.width>o&&(x=o-w.width),b+w.height>a&&(b=a-w.height)),_.trans(x,b)}}class na extends Yt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(pa.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(pa.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class oa extends ko{constructor(t){super(t,"rct-point-label")}}class aa extends ee{constructor(t){super(t,"rct-point-labels"),this._labels=[new ho(this,oa),new ho(this,oa)],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=m(e,t.getBBox().width))),e}prepareLabel(t,e,s,i,r,n){const o=r.getPointText(i,s,n.options.text);e.point=i,e.setModel(t,n,i.icon?n.getUrl(i.icon):null,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.stopAni().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]}$_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(xo(s,i))return t}}dedupe(t,e,s){let i=0,r=t[i];if(s===qs)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(yo(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});yo(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(yo(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});yo(s,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(i,1))}}}arrangeVertical(t,e,s,i,r,n,o){const a=e.length;if(a<2)return 0;e.sort(((t,e)=>t.ty-e.ty));const h=t.getBBox(),l=h.y+h.height/2;let _=Number.MAX_SAFE_INTEGER,c=0;for(let t=0;t<a;t++){const s=e[t].inflateBBox(0,-1),i=Math.abs(l-(s.y+s.height/2));i<_&&(_=i,c=t)}const d=(t,s)=>{0!==s&&e[t].shiftY(s)},u=(t,s)=>{const i=e[t].inflateBBox(0,-1),r=e[s].inflateBBox(0,-1);return i.y+i.height-r.y};for(let t=0;t<c;t++){const e=u(t,t+1);if(e>0){d(t,-e);for(let e=t;e>0;e--){const t=u(e-1,e);t>0&&d(e-1,-t)}}}for(let t=a-1;t>=c&&t>0;t--){const e=u(t-1,t);if(e>0){d(t,e);for(let e=t;e<a-1;e++){const t=u(e,e+1);t>0&&d(e+1,t)}}}const p=this.control.chartView().bodyView().height;if(r){const t=(t,s)=>{for(let i=t;i<s;i++){const t=e[i].tbottom-e[i+1].ty;t>0&&d(i+1,t)}},s=(t,s)=>{for(let i=t;i>s;i--){const t=e[i].ty-e[i-1].tbottom;t<0&&d(i-1,t)}},i=e[0],r=e[a-1],n=e[c];let o=i.ty,h=p-r.tbottom;for(let t=0;t<a-1;t++){const s=e[t+1].ty-e[t].tbottom;t<c?o+=s:h+=s}if(i.ty<0)if(o>=0){i.transY(0),t(0,c-1),n.ty<e[c-1].tbottom&&s(c,0),o=0;for(let t=0;t<c;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+h>=0)i.transY(0),t(0,a-1),o=0;else{for(let t=c;t>0;t--){const s=e[t].ty-e[t-1].tbottom;d(t-1,s)}o=i.ty}if(r.tbottom>p){const l=r.getBBox().height;if(h>0){r.transY(p-l),s(a-1,c+1),n.tbottom<e[c+1].ty&&t(c,a-1),h=0;for(let t=c;t<a-1;t++)h+=e[t+1].ty-e[t].tbottom}else if(o+h>0)r.transY(p-l),s(a-1,0),h=0;else{if(o>=0){i.transY(0);for(let t=1;t<a;t++)e[t].transY(e[t-1].tbottom)}else for(let t=c;t<a-1;t++)e[t+1].transY(e[t].tbottom);h=p-r.tbottom}}if(i.ty<0&&h>0){const t=Math.min(i.ty+h,0);i.transY(t);for(let t=1;t<a;t++)e[t-1].tbottom>e[t].ty&&e[t].transY(e[t-1].tbottom)}}return o===Ks&&e.forEach(((t,e)=>{const i=t.ty+t.getBBox().height;(t.ty<0||i>p)&&(s.get(t.point).setVis(!1),t.setVis(!1))})),1}}class ha extends wo{constructor(t){super(t),this.add(this._line=new ne(t))}setLine(t){this._line.setPath(t)}}class la extends wo{constructor(t){super(t,"rct-point-label-lines"),this._lines=new ho(this,ha)}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 _a extends ee{constructor(){super(...arguments),this.inverted=!1}invert(t,e){return t===this.inverted&&e===this._hSave||((this.inverted=t)?this.setAttr("transform",`translate(0,${e}) rotate(90) scale(-1,1)`):this.setAttr("transform",""),this._hSave=e),this.inverted}}const ca={},da="rct-point-hover",ua="rct-point-unhover";class pa extends Ao{static register(...t){t.forEach((t=>{ca[t[0].type]=t[1]}))}static isPointDom(t){for(;$t.isSVGElement(t);){if(t.classList.contains(this.POINT_CLASS))return!0;t=t.parentElement}}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 _a(t,"rct-series-points")),this._labelContainer=new aa(t)}depthEnabled(){return!1}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"}_setDepth(t){this._depthExt=t}setCircular(t){}prepareSeries(t,e,s,i){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.chartOptions.options.paletteMode===st,this.setData("index",e._seriesIndex%Ri),this.setData("pointcolors",this._colorByPoint?this._getPointColors():N),this.internalClearStyleAndClass(),this.internalSetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),e._calcedColor=r[this._legendColorProp()],e._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:"",this._visPoints=this._collectVisPoints(e),this._yReversed=e._yAxisObj.options.reversed,this._prepareSeries(t,e,s,i)}_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(da).addClass(ua)}))):this._getPointPool().forEach((t=>{t.containsClass(ua)&&t.removeClass(ua).addClass(da)}))}_clearHoverClasses(t){t instanceof Jt&&t.removeClass(da).removeClass(ua)}focusPointView(t,e){}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.cancel(),e.setBoolData(pa.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof Aa&&r.push(new na(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.cancel(),t instanceof Jt&&(t.setBoolData(pa.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof Aa?r.push(new na(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof Ca&&this.needFronting()&&this._getPointPool().front(t),n.push(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&&Xt(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 Ii&&e.trendline.visible?(this._trendView||this.add(this._trendView=new ra(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:s,height:i}}_doLayout(){const t=this.width,e=this.height,s=this.model,i=s.pointLabel,r=this._trendView;this._labelOverlap={model:i,inverted:this._inverted,width:t,height:e,fit:i._overflowFit,outline:i.options.overlapOutline,contrast:i.options.overlapContrast},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||s._needAnimate),s._needAnimate=!1,r&&r.setVis(r.visible&&(!s.trendline.options.autoHide||!this.$_labelAnimating()))&&this.$_renderTrendline(r,this._inverted,t,e),this._labelContainer.visible&&this._depthExt&&this._labelContainer.trans(this._depthExt.base,0)}_doAfterLayout(){}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const s=this._randomPalette?Math.floor(Math.random()*Ri):e.index%Ri;t.setData("index",this._model._paletteColors[s].toString())}else t.unsetData("index")}_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.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return y(this._growRate,1)}_getPosRate(){return y(this._posRate,1)}$_labelAnimating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||this._animations.length>0}_animating(){return this.$_labelAnimating()||!isNaN(this._prevRate)}_lazyPrepareLabels(){return!1}_getShowAnimation(){}_runShowEffect(t){}$_renderTrendline(t,e,s,i){const r=this.model;r instanceof Ii&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),s,i)}_layoutLabel(t,e,s,i){let{inverted:r,x:n,y:o,hPoint:a,labelView:h,labelOff:l}=e;if(!h.setVis(n>=0&&n<=s&&o>=0&&o<=i))return;h.layout(e.textAlign);const _=e.below=e.reversed?a<=0:a<0,c=h.getBBox();let d=!0;r?(n-=e.distY,o+=e.distX,o-=c.height/2-c.height*t._vertAdjust):(n-=e.distX,o+=e.distY,n-=c.width/2);const u=n,p=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+c.width)/2+(e.reversed?l:-l)):(n-=e.base,o+=e.side,o+=(a-c.height)/2+(e.reversed?l:-l));break;case"head":r?(n-=e.side,o+=e.base,_?n+=l:n-=c.width+l):(n-=e.base,o+=e.side,_?o-=c.height+l:o+=l);break;case"foot":r?(n-=e.side,o+=e.base,n-=_?a+c.width+l:a-l):(n-=e.base,o+=e.side,o+=_?a+l:a-c.height-l);break;case"far":r?n=_?l:s-c.width-l:_?(n-=e.base,o=i-c.height-l):o=l,d=!1;break;default:r?_?n-=c.width+l:n+=l:_?(n-=e.base,o+=e.side,o+=l):o-=c.height+l,d=!1}this._checkLabelOverlap(h,c,u,p,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,c,n,o)}_checkLabelOverlap(t,e,s,i,r,n,o,a,h,l){const _=this._labelOverlap;let c=!1;if(!h){const h=_.fit;if(isFinite(h)&&(_.inverted?o+e.width>=_.width?c=(o=_.width+h-e.width)<s+r:o<=0&&(c=(o=-h)+e.width>s-r):a+e.height>=_.height?c=(a=_.height+h-e.height)<i+n:a<=0&&(c=(a=-h)+e.height>i-n)),c){if(!isFinite(h))return t.setVis(!1),!1;_.outline&&t.setOutline(_.model)}}return t.setContrast((h||c&&_.contrast)&&l),t.trans(o,a),!0}_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,m(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,g(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,f(_-l),e):r.setBounds(l,-e,f(_-l),e):r.setBounds(0,-m(l,_),t,f(_-l)):o?h?r.setBounds(_,0,f(_-l),e):r.setBounds(l,0,f(_-l),e):r.setBounds(0,e-m(l,_),t,f(_-l))}_setFill(t,e){s(e)&&e[U]?t.internalSetStyle(U,e[U]):n(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,s,i){if(this.model.chart.isInverted())return;const r=this._labelOverlap,n=this.model.pointLabel.getRotation();e||(e=t.getBBox());const o=e.width/2,a=e.height/2;this._adjustRotatedLabelPosition(t,r,e,s,i),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=e.height,h=y(e.fit,0),l=this.model._yAxisObj.options.reversed,_=this.model.chart.isInverted(),c=n.options.position;let d=this._getRotatedLabelDisplacement(o,s);if(!_&&c!==Ys)if(l?c!==Xs&&c!==js||(d*=-1):c===js&&(d*=-1),r-=d,l){const t=r+(-2*d+s.height)/2+s.height/2;if(t>a){r-=t-a-h}}else{r-(2*d+s.height)/2<0&&(r=d-h)}t.trans(i,r)}_getRotatedLabelDisplacement(t,e){const s=t*Math.PI/180,i=Math.abs(Math.sin(s)),r=Math.abs(Math.cos(s)),n=e.width,o=e.height;return n/2*i+o/2*r-o/2}}pa.POINT_CLASS="rct-point",pa.DATA_FOCUS="focus",pa.DATA_UNFOCUS="unfocus",pa.DATA_UNHOVER="unhover",pa.LEGEND_MARKER="rct-legend-item-marker";class ga extends ne{constructor(t){super(t,pa.POINT_CLASS)}savePrevs(){}}class ma extends ga{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class fa extends Jt{constructor(t){super(t,pa.POINT_CLASS)}savePrevs(){}}class ya extends fa{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let xa=class extends ma{layout(t,e,s,i,r,n,o){this.x=t,this.y=e,this.setPath(zs.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,s,i))}shrink(t,e,s,i){const r=this.point;if(!r.isNull){const n=r._vr,o=r._getDrop()*(t?-1:1);if(isNaN(o))this.hPoint*=1-n||1,this.layout(this.x,this.y,s,i,0,0,!1);else{let t=r._getSave();isNaN(t)&&r._setSave(t=this.x);const a=o<0?t*(1-n)-this.wPoint/2*n:e-(e-t)*(1-n)+this.wPoint/2*n;this.layout(a,this.y,s,i,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class ba extends ya{constructor(t){super(t),this.add(this._topView=new ne(t)),this.add(this._frontView=new ne(t)),this.add(this._sideView=new ne(t))}layout(t,e,s,i,r,n,o){const a=this.wPoint,h=this.hPoint;let l=getComputedStyle(this._frontView.dom).fill;const _=h<0?e:e-h;if(ot&&(l=this.control.getIEColor(l)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(zs.rectangle(t-r,e+n,a,-h)),this._topView.setPath(zs.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",Rt.interpolate(o?Rt.BLACK:Rt.WHITE,l,.2)),this._sideView.setPath(zs.polygon(t+a-r,e-h+n,t+a,e-h,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",Rt.interpolate(o?Rt.WHITE:Rt.BLACK,l,.2))}}class wa extends wo{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class va extends pa{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,s,i){this._preparePoints(t,e,this._visPoints,!!i)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&qo.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class Va extends va{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new la(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.options.angle*B,this._base=d(this._depthAngle)*e.depth,this._side=u(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,s,i),this._pointOff=e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_prepareLayoutPoints(t,e){}_layoutPoints(t,e){var s;const i=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=i.pointLabel,h=this._labelViews(),_=this._labelLineContainer,c=i._xAxisObj,p=i._yAxisObj,g=this._yReversed,f=this._depthExt,x=i._group?i._groupDistance:i.distance,b=f?x*(r?u(this._depthAngle):d(this._depthAngle)):0,w=f?x*(r?d(this._depthAngle):u(this._depthAngle)):0,v=2*c.unitPad(),V=y(i.options.minPointWidth,0),S=this._yLen=r?t:e,A=r?e:t,P=t=>p.getPos(S,t),k=t=>c.getPos(A,t),C=r?0:e,N=p.valueMin(),L=P(N),M=this._baseVal=i.getBaseValue(p),E=!isNaN(M),B=this._yBase=y(P(m(N,y(M,L))),L),T=this._pointOff,O=h&&l(this._labelInfo,{inverted:r,reversed:g,labelPos:i.getLabelPos(a),labelOff:i.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:b,distY:w,side:this._side,base:this._base});h&&_.setVis(i.pointLabel.line.visible)&&(_.internalClearStyleAndClass(),_.internalSetStyleOrClass(i.pointLabel.line._style),_.prepare(i),O.pb=new qt),this._prepareLayoutPoints(t,e),null===(s=this._getPointPool().getOrphans())||void 0===s||s.forEach((t=>{this._shrinkPoint(t)})),this._getPointPool().forEach(((s,l)=>{const _=s.point;if(s.setVis(!_.isNull)){const d=c.getUnitLen(A,_.xValue)*(1-v);let u=i.getPointWidth(d,V),p=P(_.yGroup),g=B;if(_.yGroup!=_.yValue){const t=M>_.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);g=P(r)}const m=(p-g)*n;let f=k(_.xValue)-d/2,y=C-p;isNaN(o+s.wSave)||(u=s.wSave+(u-s.wSave)*o),f+=i.getPointPos(d)+u/2,isNaN(o+s.xSave)||(f=s.xSave+(f-s.xSave)*o),_.xPos=f+=u*T,_.yPos=y,this._layoutPoint(s,l,f-b,C-B*(1-n)-g*n+w,u,m),r&&(y=A-k(_.xValue)+d/2,f=C,_.yPos=y-=i.getPointPos(d)+u/2+u*T,_.xPos=f+=E?P(_.yGroup)*n:P(_.yGroup*n)),O&&(O.labelView=h.get(_,0))&&(O.pointView=s,O.x=f,O.y=y,O.wPoint=u,O.hPoint=m,this._layoutLabel(a,O,t,e))}}))}_layoutLabel(t,e,s,i){if(super._layoutLabel(t,e,s,i),e.pb){const t=this._labelLineContainer.get(e.pointView.point),s=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?s.tx+s.getBBox().width:s.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?s.ty:s.ty+s.getBBox().height),t.setLine(e.pb.end())}}}class Sa extends va{_getHighValue(t){return t.yValue}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),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,_=s._yAxisObj,c=2*h.unitPad(),d=y(s.options.minPointWidth,0),u=i?t:e,p=i?e:t,g=i?0:e,m=this._pointOff,f=a&&l(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(o),labelOff:s.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach(((l,y)=>{const x=l.point;if(l.setVis(!x.isNull)){const b=h.getUnitLen(p,x.xValue)*(1-c);let w=s.getPointWidth(b,d);const v=(_.getPos(u,this._getHighValue(x))-_.getPos(u,this._getLowValue(x)))*r;let V=h.getPos(p,x.xValue)-b/2,S=g-_.getPos(u,this._getHighValue(x))*r;isNaN(n+l.wSave)||(w=l.wSave+(w-l.wSave)*n),V+=s.getPointPos(b)+w/2,isNaN(n+l.xSave)||(V=l.xSave+(V-l.xSave)*n),x.xPos=V+=w*m,x.yPos=S,this._layoutPoint(l,y,V,S,w,v),i&&(S=p-h.getPos(p,x.xValue)+b/2,V=g,x.yPos=S-=s.getPointPos(b)+w/2+w*m,x.xPos=V+=_.getPos(u,this._getHighValue(x))*r),a&&(f.pointView=l,f.hPoint=v,f.x=V,f.y=S,(f.labelView=a.get(x,0))&&(f.hPoint=v,this._layoutLabel(o,f,t,e)),(f.labelView=a.get(x,1))&&(i?f.x-=v:f.y+=v,f.hPoint=-v,this._layoutLabel(o,f,t,e)))}}))}}class Aa extends ga{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 Pa extends pa{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[]}_adjustRotatedLabelPosition(t,e,s,i,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(i)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),h=n.options.position;let l=this._getRotatedLabelDisplacement(o,s);if(!a&&h!==Ys){(r-=l)-(2*l+s.height)/2<0&&(r=l),t.trans(i,r)}}_layoutLabelView(t,e,s,i,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*i*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-i-o.height-s),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class ka extends Yt{constructor(t,e){super(),this.series=t,this.duration=e}_doUpdate(t){const e=this.series;return!!e&&(e._zombieRate=e._zombie.visible?t:1-t,e._refreshZombie(),!0)}_doStop(){const t=this.series;t&&(t._zombie=null,t._zombieAni=null,t.invalidate(),this.series=null)}}class Ca extends pa{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}clipInvertable(){return!1}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.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new ka(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,s){return Hs.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);const r=getComputedStyle(i.dom);s._calcedColor=r.fill,s._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class Na extends Ho{constructor(t){super(t,Na.CLASS_NAME),this.addToTransform(this._imageView=new Po(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,s,i,r){const n=this._size=e.getSize(s,i);this._deflatePaddings(n),this.$_setImage(this.model.options.imageUrl);const o=this._imageView.getBBox();return this._inflaePaddings(o),co(o)}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_setImage(t){this._imageView.setImage(t,this._size.width,this._size.height)}}Na.CLASS_NAME="rct-image-annotation";class La extends Ho{constructor(t){super(t,La.CLASS_NAME),this.addToTransform(this._shapeView=new ne(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),d=null===(a=e.chart.yAxis)||void 0===a?void 0:a.getPos(i,e.options.y1),u=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 ur:!Number.isNaN(c)&&Number.isNaN(_)&&(g=c),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:l.height/2),this._shapeView.setPath(zs.line(g,p,g+l.width,p));break;case dr:Number.isNaN(c)||(g=Number.isNaN(_)?c:l.width/2),!Number.isNaN(u)&&Number.isNaN(d)&&(p=i-u),this._shapeView.setPath(zs.line(g,p,g,p+l.height));break;case pr:Number.isNaN(c)||(g=Number.isNaN(_)?c:_>c?l.width:0),Number.isNaN(u)||(p=Number.isNaN(d)?i-u:d<u?l.height:0);const t=_>c?g-l.width:g+l.width,s=d<u?p-l.height:p+l.height;this._shapeView.setPath(zs.line(g,p,t,s));break;default:zs.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)}}La.CLASS_NAME="rct-shape-annotation";class Ma extends Ho{constructor(t){super(t,Ma.CLASS_NAME),this.addToTransform(this._textView=new ue(t)),this._textView.anchor=_e.START,this._richText=new ve}_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),this._textView.setStyle("textOrientation",e.getTextOrientation()),this._deflatePaddings(o),this._richText._isVertical="vertical"===n.writingMode,this._richText.setFormat(n.text),!isNaN(n.lineHeight)&&this._richText&&(this._richText.lineHeight=n.lineHeight),this._richText.build(a,s,i,null,e._domain);const h=co(this._textView.getBBox());return{width:y(o.width,h.width),height:y(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)}}Ma.CLASS_NAME="rct-text-annotation";class Ea extends ho{freeOrphans(){const t=this.getOrphans();return t&&t.forEach((t=>{t.point._vr>=1&&this.freeOrphan(t.point)})),this}addOrphanedPoints(t,e=!0){if(e&&this.freeOrphans(),Array.isArray(t)){const e=this._prepareOrphans();t.forEach((t=>{let s=e.get(t);s||(s=this.find((e=>e.point===t)),s&&this.addOrphan(t,s))}))}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class Ba extends Aa{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;zs.setShape(this,this._shape,this._radius*t,this._radius*t),this.setStyle("opacity",String(.8*t))}}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)),zs.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 Ta extends _a{}class Oa extends pa{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new Ta(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new ne(t,"rct-line-series-line")),this._markers=new Ea(this._pointContainer,Ba),this.add(this._tester=new ne(t)),this._tester.setFill("#ff000010")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),s=t._marker;if(s._line.setStyle("strokeWidth",e.strokeWidth),s._shape){const t=getComputedStyle(this.dom);s._marker.setStyles({fill:t.fill,stroke:t.stroke}),s._marker.internalSetStyles(this.model.marker._style),s._line.setStyle("strokeDasharray","")}else s._line.setStyle("strokeDasharray",e.strokeDasharray)}_prepareSeries(t,e,s){e instanceof qr&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._based&&e.options.belowStyle,this._prepareBelow(e.chart.isPolar())),!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.buildLines(this._visPoints)}_doAfterLayout(){this._layoutLines(this._polar)}_runShowEffect(t){this._polar?t&&qo.grow(this):t&&qo.reveal(this,{from:function(t){const e=t.model._xAxisObj.options.reversed;return t._inverted?e?"top":"bottom":e?"right":"left"}(this)})}_doViewRateChanged(t){this._prepareBelow(!!this._polar),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){var e,s;const i=this.control;let r=this._lowLine;if(this._needBelow||t)return r||(r=this._lowLine=new ne(this.doc,"rct-line-series-line rct-line-series-line-below"),t?this._lineContainer.add(r):this._lineContainer.insertChild(r,this._line),t?this.isClip(this._innerClip)||(this._outerClip=i.clipPath(),this._innerClip=i.clipPath(),this._outerLineClip=i.clipPath(),this._innerLineClip=i.clipPath()):this.isClip(this._upperClip)||(this._upperClip=i.clipBounds(),this._lowerClip=i.clipBounds())),t?this._yReversed?(this._line.setClip(this._needBelow?this._innerLineClip:null),this._lowLine.setClip(this._outerLineClip)):(this._line.setClip(this._needBelow?this._outerLineClip:null),this._lowLine.setClip(this._innerLineClip)):(this._line.setClip(this._upperClip),r.setClip(this._lowerClip)),!0;null==r||r.setClip(),this._line.setClip(),null===(e=this._upperClip)||void 0===e||e.remove(),null===(s=this._lowerClip)||void 0===s||s.remove()}_prepareRanges(t,e){const s=this._rangeClips;let i=this._rangeLines;if(e){for(i||(i=this._rangeLines=new ho(this._lineContainer,ne)),i.prepare(e.length);s.length<e.length;){const t=new re(this.doc);this.control.addClip(t),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._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:i,rd:r,min:o,max:a,cyclic:h}=this._polar,l=D(m(0,g((M-f(o-a))/2,.2))),_=n?1:this._getGrowRate();this._model.isConnectEnds(n,h)?(n?(this._outerClip.setPath(zs.donut(t,i,r*_,s*_)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(zs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(zs.circle(t,i,s*_)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(zs.sector(t,i,r*_,r*_,s/e,o,a,!0)),this._outerLineClip.setPath(h?this._outerClip.getPath():zs.sector(t,i,r*_,r*_,s/e,o-l,a+l,!0))):(this._outerClip.setPath(zs.circle(t,i,r*_)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(zs.sector(t,i,s*_,s*_,0,o,a,!0)),this._innerLineClip.setPath(h?this._innerClip.getPath():zs.sector(t,i,s*_,s*_,0,o-l,a+l,!0)))}else(o=this._upperClip)&&(i?r?o.setBounds(0,-s,e,t):o.setBounds(0,-t,e,t-s):r?o.setBounds(0,0+s,t,e-s):o.setBounds(0,0,t,s)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-s):o.setBounds(0,-s,e,s):r?o.setBounds(0,0,t,s):o.setBounds(0,0+s,t,e-s))}$_prepareMarkers(t,e){var s;const i=t instanceof qr&&this._needBelow,r=i?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(s=this._markers)||void 0===s||s.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const s=this._markersPerPoint(),o=i&&t.options.belowStyle,a=e.length;this._markers.prepare(a*s,((s,h)=>{const l=e[h%a];l.isNull||(s.point=l,n[1]=i&&l.yValue<r?o:null,this._setPointStyle(s,t,l,n)),s.point=l,s.index=h<a?0:1}))}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,s=t.point;t._shape=e.getShape(s),t._radius=e.getRadius(s)}_layoutMarker(t,e,s,i){const r=t._radius;e&&t.internalSetStyleOrClass(e),zs.setShape(t,t._shape,r,r),t.setPos(s,i),t.trans(s-=r,i-=r)}_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,p=r.options.maxVisible,g=r.options.minVisible,m=i.pointLabel,f=m.options.align,y=m.getAlignOffset(),x=m.getOffset(),b=m.getPosition(),w=this._labelContainer._textAlign,v=this._labelViews(),V=i._xAxisObj,S=i._yAxisObj,A=this._polar=i.chart._body.getPolar(V),P=!!A,{cx:k,cy:C,rd:N,start:L,total:M}=A||{},E=o?e:s,B=A?M:o?s:e,T=o?0:s,O=t.length,D=S.axisMax(),R=this._yReversed,$=S instanceof Ar?i.getBaseValue(S):NaN,F=$>S.axisMin(),I=S.getPos(N,$);this._pointContainer.visible&&this._shrinkPoints(i),t.forEach(((t,r)=>{let m,z,H,G;A?(H=L+V.getPos(B,t.xValue),G=R?isNaN(t.yGroup)?F?I:N:F?I+(S.getPos(N,t.yGroup)-I)*h:N-S.getPos(N,D-t.yGroup)*h:isNaN(t.yGroup)?F?I:0:F?I+(S.getPos(N,t.yGroup)-I)*h:S.getPos(N,t.yGroup)*h,m=t.px=k+G*d(H),z=t.py=C+G*u(H),t.angle=H):(m=t.px=V.getPos(B,t.xValue),z=t.py=T-S.getPos(E,t.yGroup),o&&(m=S.getPos(E,t.yGroup),z=s-V.getPos(B,t.xValue))),t.xPos=m,t.yPos=z;const j=m,X=z,Y=this._markers.get(r),W=v&&v.get(t,0);if(Y&&Y.setVis(!t.isNull&&(P||!a||m>=0&&m<=e&&z>=0&&z<=s))){this._prepareMakrer(Y),this._layoutMarker(Y,n,m,z),i._maxY,t.yGroup,i._minY,t.yGroup;const e=0==r&&null!=_?_:r==O-1&&null!=c?c:i._maxY==t.yGroup&&null!=p?p:i._minY==t.yGroup&&null!=g?g:l;if(Y.setStyle("opacity",e?"1":"0"),W){W.setContrast(null).layout(w);const e=W.getBBox(),s=Y._radius;if(W.visible=!0,A){switch(b){case"inside":R?t.yValue<$?G-=x:G+=x:t.yValue<$?G+=x:G-=x;break;case"foot":R?t.yValue<$?G-=e.height/2+x:G+=e.height/2+x:t.yValue<$?G+=e.height/2+x:G-=e.height/2+x;break;default:R?t.yValue<$?G+=e.height/2+x:G-=e.height/2+x:t.yValue<$?G-=e.height/2+x:G+=e.height/2+x}m=k+G*d(H),z=C+G*u(H)-e.height/2,this.applyAutoRotation(W,H,M,V.options.totalAngle)}else switch(b){case"inside":z-=e.height/2+x;break;case"foot":z+=x+(l?s:0);break;default:z-=e.height+x+(l?s:0)}switch(f){case"left":m-=e.width+(l?s:0)+y;break;case"right":m+=(l?s:0)+y;break;default:m-=e.width/2+y}this._checkLabelOverlap(W,e,j,X,s,s,m,z,!1,null),this._layoutLabelRotation(W,e,m,z)}}else W&&W.setVis(!1)}))}_shrinkPoints(t){var e;null===(e=this._getPointPool().getOrphans())||void 0===e||e.forEach((t=>{t.visible&&t.shrink()}))}_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 qr&&this._needBelow;let o=this._buildLines(t,e._lines);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),$t.setImportantStyle(t.dom.style,U,"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),$t.setImportantStyle(t.dom.style,U,"none")}if(n||t){const a=this._lowLine,h=e._yAxisObj,l=e.getBaseValue(h);t?this.$_resetClips(s,i/2,h.getPos(i/2,l),!0):r?this.$_resetClips(s,i,h.getPos(s,l),!0):this.$_resetClips(s,i,i-h.getPos(i,l),!1),a.setVis(n)&&(a.setPath(o),a.internalClearStyleAndClass(),a.internalSetStyle("stroke",e._runColor),a.internalSetStyleOrClass(e._style),a.internalSetStyleOrClass(e.options.belowStyle),$t.setImportantStyle(a.dom.style,U,"none"))}}_buildLine(t,e,s,i){const r=this.model;"spline"===e?this._drawCurve(t,s,i):r instanceof qr&&"step"===e?this._drawStep(t,s,i,s?r.backDir():r.options.stepDir):this.$_drawLine(t,s,i)}_buildLines(t,e){const s=this.model,i=s.getLineType(),r=new qt;return"spline"===i?this._drawCurves(t,e,r):s instanceof qr&&"step"===i?this._drawSteps(e,r,s.options.stepDir):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,s){if(t.length>1){const i=this._model instanceof qr&&this._model.options.connectNullPoints;s.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&i||s.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach((t=>this.$_drawLine(t,!1,e)))}_drawStep(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._drawStep(t,!1,e,s)))}_drawCurve(t,e,s){t.length>1&&(s.moveOrLine(e,t[0].px,t[0].py),s.spline(t,0,t.length-1))}_drawCurves(t,e,s){if(t){const{cx:i,cy:r,rd:n,cyclic:o}=t,a=this.model,h=a._yAxisObj,l=h instanceof Ar?a.getBaseValue(h):NaN,_=l>h.axisMin()?h.getPos(n,l):0,c=e[0],p=c.length;let g,m;o?(s.move(c[0].px,c[0].py),s.closedSpline(c,!0)):(g=i+_*d(c[0].angle),m=r+_*u(c[0].angle),s.move(g,m),s.line(c[0].xPos,c[0].yPos),s.closedSpline(c,!1),g=i+_*d(c[p-1].angle),m=r+_*u(c[p-1].angle),s.line(g,m))}else e.forEach((t=>this._drawCurve(t,!1,s)))}_buildAreas(t,e,s){const i=new qt;s=s||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,i),this._buildLine(o,s,!0,i)}return i.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}}class Da extends Oa{constructor(t){super(t,Da.CLASS),this._flagView=new ko(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:d,height:u}=a,p=d/2,g=u/2,{width:m,height:f}=r,y=m/2,x=f/2,b=l>u+o,w=f>l+u+o,v=h>d+o,V=m>h+d+o,S={top:b,right:V,bottom:w,left:v};_=null!==(t=c.find((t=>S[t])))&&void 0!==t?t:_;const A=h>p&&m-h>p?h-p:h>y?m-d:0,P=l>g&&f>l+g?l-g:l>x?f-u:0;switch(_){case"top":h=A,l=b?l-u-o:0;break;case"bottom":h=A,l=w?l+o:f-u;break;case"left":h=v?h-d-o:0,l=P;break;case"right":h=V?h+o:m-d,l=P}i.trans(h,l)}}}Da.CLASS="rct-line-series";class Ra extends Oa{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Ta(t,"rct-arearange-series-areas")),this._areaContainer.add(this._area=new ne(t,"rct-arearange-series-area")),this._lineContainer.add(this._lowerLine=new ne(t,"rct-areanrange-series-line")),$t.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,p=this._labelViews(),g=this._labelContainer._textAlign,m=this._polar=i.chart._body.getPolar(h),f=i.pointLabel,y=f.options.position,x=f.options.align,b=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 i=0,c=t.length;i<c;i++){const f=t[i],V=v.get(c+i),S=p&&p.get(f,1);let A,P,k;this._prepareMakrer(V),a?(A=f.px2=l.getPos(_,f.lowValue),P=f.py2=v.get(i).ty+V._radius):(A=f.px2=f.xPos,P=f.py2=f.yLow);const C=A,N=P;if(V&&V.setVis(!f.isNull&&A>=0&&A<=e&&P>=0&&P<=s)){if(this._layoutMarker(V,n,A,P),V.setStyle("opacity",o||0==i&&!0===r.options.firstVisible||i===c-1&&!0===r.options.lastVisible?"1":"0"),S){S.setContrast(null).layout(g).setVis(!0);const t=S.getBBox(),e=V._radius;if(m){switch(y){case"inside":P-=w;break;case"foot":P-=t.height/2+w;break;default:P+=t.height+w}A=m.cx+P*d(k),P=m.cy+P*u(k)-t.height/2,this.applyAutoRotation(S,k,m.total,h.options.totalAngle)}else switch(y){case"inside":P-=t.height/2+w;break;case"foot":P+=w+(o?e:0);break;default:P-=t.height+w+(o?e:0)}switch(x){case"left":A-=t.width+(o?e:0)+b;break;case"right":A+=(o?e:0)+b;break;default:A-=t.width/2+b}this._checkLabelOverlap(S,t,C,N,e,e,A,P,!1,null),this._layoutLabelRotation(S,t)}}else S&&S.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)}}class $a extends Oa{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new Ta(t,"rct-area-series-areas")),this._areaContainer.insertFirst(this._area=new ne(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){const e=this._area;let s=this._lowArea;if(super._prepareBelow(t))return s||this._areaContainer.add(s=this._lowArea=new ne(this.doc,"rct-area-series-area")),t?this._yReversed?(e.setClip(this._innerClip),s.setClip(this._outerClip)):(e.setClip(this._outerClip),s.setClip(this._innerClip)):(e.setClip(this._upperClip),s.setClip(this._lowerClip)),!0;null==s||s.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const s=this.doc,i=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new ho(this._areaContainer,ne,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<g(e.length,i.length);t++)this.isClip(i[t])||(i[t]=this.control.addClip(new re(s)));for(;i.length<e.length;)i.push(this.control.addClip(new re(s)));for(;i.length>e.length;)i.pop().remove()}else r&&(r.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.isNull?s.yLow=NaN:s.yLow=o-r.getPos(n,s.yGroup-s.yValue)}this._polar&&this.$_layoutPolar(this._area,this._lowArea,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(U,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(U,e._runColor),s.areaStyle&&o.internalSetStyleOrClass(s.areaStyle),this._setFill(o,e.options.belowStyle),s.belowAreaStyle&&o.internalSetStyleOrClass(s.belowAreaStyle))}setCircular(t){this._circular=t}$_layoutPolar(t,e,s){const i=this.model,r=i._group,n=i._xAxisObj,o=i._yAxisObj,a=this._yReversed,h=o instanceof Ar?i.getBaseValue(o):NaN,l=this._polar,{cx:_,cy:c,rd:p,cyclic:f}=l,x=new qt,b=s.length;if(!r||"stack"!==r.options.layout&&"fill"!==r.options.layout){const r=h>o.axisMin(),l=r?o.getPos(p,h):0,y=i.chart._body.options.circular;let w,v,V,S,A=!1,P=!1;if("spline"===i.options.lineType)this._drawCurves(this._polar,i.buildLines(s),x);else{f?x.move(s[0].xPos,s[0].yPos):(w=_+l*d(s[0].angle),v=c+l*u(s[0].angle),x.move(w,v),x.line(s[0].xPos,s[0].yPos));for(let t=1;t<b;t++)x.line(s[t].xPos,s[t].yPos);f||(w=_+l*d(s[b-1].angle),v=c+l*u(s[b-1].angle),x.line(w,v))}const k=s.map((t=>t.angle)),C=this._polar.min=g(...k),N=this._polar.max=m(...k),L=(new qt).push(x.end());if(r)f?x.circle(_,c,l):a&&x.push(...zs.arc(_,c,l,l,C,N,!0)),V=x.end(),A=!0,f?L.circle(_,c,l):L.push(...zs.arc(_,c,l,l,C,N,!0)),S=L.end(),P=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),s=n._ticks;x.push("Z"),f?y?x.circle(_,c,p):x.polygon(...s.map((s=>(console.log(s.value,s.pos),{x:_+d(t+s.pos/p*e/M)*p,y:c+u(t+s.pos/p*e/M)*p})))):y?x.push(...zs.sector(_,c,p,p,0,C,N,!0)):x.polygon({x:_,y:c},...s.map((s=>({x:_+d(t+s.pos/p*e/M)*p,y:c+u(t+s.pos/p*e/M)*p})),{x:_,y:c})),V=x.end(!0),A=!0}else V=x.end();t.setPath(V),t.setAttr("fill-rule",A?"evenodd":""),e&&(e.setPath(S||""),e.setAttr("fill-rule",P?"evenodd":""))}else{x.move(y(s[0].xPos,_),y(s[0].yLow,c)),x.line(y(s[0].xPos,_),y(s[0].yPos,c));for(let t=1;t<s.length;t++)x.line(y(s[t].xPos,_),y(s[t].yPos,c));x.line(y(s[s.length-1].xPos,_),y(s[s.length-1].yLow,c));for(let t=s.length-1;t>=0;t--)x.line(y(s[t].xPos,_),y(s[t].yLow,c));t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(i._runColor),t.addStyleOrClass(i._style),$t.setImportantStyle(t.dom.style,Z,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(i._runColor),e.addStyleOrClass(i._style),e.internalSetStyleOrClass(i.options.belowStyle),$t.setImportantStyle(e.dom.style,Z,"none")),i._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new oe(this.doc)));const t=zs.arc(_,c,p,p,l.start,l.start+l.total,!0);t.push("L",_,c),this._arcClip.setPath(t),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Fa extends Sa{constructor(t){super(t,"rct-barrange-series"),this._bars=new Ea(this._pointContainer,xa)}_getPointPool(){return this._bars}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i),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*y(t.point.width,1),t.hPoint=n,t.layout(s,i+n,this._rd,this._rd,0,0,this._inverted)}}class Ia extends Io{constructor(t){super(t,pa.POINT_CLASS)}savePrevs(){}}class za extends Va{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,s,i){this._polar=s,super._prepareSeries(t,e,s,i)}_preparePoints(t,e,s,i){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,i)}_setPointStyle(t,e,s){super._setPointStyle(t,e,s),s.yValue<e.getBaseValue(e._yAxisObj)&&e.options.belowStyle&&t.addStyleOrClass(e.options.belowStyle)}_layoutPoints(t,e){this._polar?this.$_layoutSectors():super._layoutPoints(t,e)}$_parepareBars(t,e,s,i){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(i!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=i))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),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 Ea(this._pointContainer,Ia)),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=o.options.reversed,h=2*n.unitPad(),l=r.getPolar(n),{cx:_,cy:c,rd:p}=l,m=o instanceof Ar?t.getBaseValue(o):NaN,f=m>o.axisMin(),y=o.getPos(p,m),x=this._pointOff,b=n.getTotalAngle();let w,v,V,S,A;i&&(w=this._labelInfo,v=t.getLabelPos(s),V=t.getLabelOff(s.getOffset()),S=this._labelContainer._textAlign),this._sectors.forEach(((s,r)=>{const P=s.point;if(s.setVis(!P.isNull)){const r=o.getPos(p,P.yGroup)*e,k=n.getUnitLen(b,P.xValue)*(1-h),C=t.getPointWidth(k,0);let N,L,M=l.start+n.getPos(b,P.xValue)-k/2;if(M+=C*x,M+=t.getPointPos(k)+C/2,a?f?(N=y+(o.getPos(p,P.yGroup)-y)*e,L=y):(N=p,L=o.getPos(p,P.yGroup*e)):f?(N=y+(o.getPos(p,P.yGroup)-y)*e,L=y):(N=r,L=0),s.setSector({cx:_,cy:c,rx:N,ry:N,innerRadius:L/N,start:M-C/2,angle:C,clockwise:!0}),M=s.start+s.angle/2,P.xPos=_+s.rx*d(M),P.yPos=c+s.ry*u(M),i&&(A=w.labelView=i.get(P,0))){A.layout(S);const{width:t,height:e}=A.getBBox(),i=s.ry,r=s.innerRadius*p;let o,h;o=a?f?P.yValue<m?"outside"===v?i+e/2+V:"head"===v?i-e/2-V:"foot"===v?y+e/2+V:i-(i-y)/2+V:"outside"===v?i-e/2-V:"head"===v?g(y,i+e/2+V):"foot"===v?y-e/2-V:y-(y-i)/2-V:"outside"===v?r-e/2-V:"head"===v?g(p,r+e/2+V):"foot"===v?p-e/2-V:p-(p-r)/2-V:f?P.yValue<m?"outside"===v?i-e/2-V:"head"===v?i+e/2+V:"foot"===v?y-e/2-V:y-(y-i)/2-V:"outside"===v?i+e/2+V:"head"===v?i-e/2-V:"foot"===v?y+e/2+V:i-(i-y)/2+V:"outside"===v?i+e/2+V:"head"===v?i-e/2-V:.7*i+V,h=c+o*u(M),o=_+o*d(M),"outside"!==v&&A.setContrast(s.dom),this.applyAutoRotation(A,M,l.total,n.options.totalAngle),A.trans(o-t/2,h-e/2)}}}))}}class Ha extends za{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new Ea(t,ba):new Ea(t,xa)}_prepareSeries(t,e,s,i){super._prepareSeries(t,e,s,i);const r=e.options;this._rdTop=+r.topRadius||0,this._rdBottom=+r.bottomRadius||0}_layoutPoint(t,e,s,i,r,n){t.wPoint=r*y(t.point.width,1),t.hPoint=n,t.layout(s,i,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof xa){const e=this.model._xAxisObj;t.shrink(e.options.reversed,e._vlen,this._rdTop,this._rdBottom)}}}class Ga extends $a{constructor(t){super(t,"rct-bellcurve-series")}}class ja extends wa{constructor(t){super(t,pa.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 Gr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Gr(t,"rct-boxplot-point-stem")),this.add(this._box=new Hs(t,"rct-boxplot-point-box")),this.add(this._mid=new Gr(t,"rct-boxplot-point-mid")),this.add(this._min=new Gr(t,"rct-boxplot-point-min")),this.add(this._max=new Gr(t,"rct-boxplot-point-max"))}}class Xa extends Sa{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Ea(this._pointContainer,ja)}_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)}}class Ya extends Aa{}class Wa extends Pa{constructor(t){super(t,"rct-bubble-series")}_createMarkers(t){return new Ea(t,Ya)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&qo.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_prepareMarkers(t,e){this._markers.addOrphanedPoints(t.getDropPoints()),this._markers.prepare(e.length,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){var s;const i=this.model,r=i.options,n=this._inverted,o=i.needClip(!1),a=this._getGrowRate(),h=+r.rotation||0,l=i.pointLabel,_=l.options.position,c=l.getOffset(),p=this._labelContainer._textAlign,g=this._labelViews(),m=i._xAxisObj,f=i._yAxisObj,x=this._polar=i.chart._body.getPolar(m),b=n?t:e,w=n?e:t,v=(i._xAxisObj._vlen<i._yAxisObj._vlen?i._xAxisObj:i._yAxisObj)._vlen,{min:V,max:S}=i.getPixelMinMax(v),A=n?0:e,P=zs.getDrawer(r.shape);let k;null===(s=this._markers.getOrphans())||void 0===s||s.forEach((t=>{t.setPath(P(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))})),this._markers.forEach(((s,r)=>{const l=s.point,v=g&&(k=g.get(l,0));if(s.setVis(!l.isNull&&!isNaN(l.zValue))){const r=s._radius=i.getRadius(l.zValue,V,S),g=r*a*y(l._vr,1);let C,N;if(x){const t=x.start+m.getPos(w,l.xValue),e=f.getPos(x.rd,l.yValue);C=x.cx+e*d(t),N=x.cy+e*u(t)}else C=m.getPos(w,l.xValue),N=A-f.getPos(b,l.yValue),n&&(C=f.getPos(b,l.yValue),N=e-m.getPos(w,l.xValue));l.xPos=C,l.yPos=N,s.setVis(!o||C>=0&&C<=t&&N>=0&&N<=e)?(s.setPath(P(g)).trans(C,N).rotate(h),v&&(k.setContrast(s.dom).layout(p),this._layoutLabelView(k,_,c,r,C,N))):v&&v.setVis(!1)}else v&&v.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}}let Ua=class extends wa{constructor(t){super(t,pa.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(g(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),o=g(n,r),a=m(1,f(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 Gr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Gr(t,"rct-candlestick-point-wick")),this.add(this._body=new Hs(t))}};class Za extends Sa{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Ea(this._pointContainer,Ua)}_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)}}class qa extends ga{layout(t,e,s){const i=new qt;i.circle(t,e,s),this.setPath(i.end())}}class Ka extends za{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Ea(t,qa)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}let Qa=class extends wa{constructor(t){super(t,pa.POINT_CLASS),this.add(this._line=new Gr(t,"rct-dumbbell-point-bar")),this.add(this._hmarker=new ne(t,"rct-dumbbell-point-marker")),this.add(this._lmarker=new ne(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(_),r.setStyle("opacity",t.visible?"1":"0"),n.setStyle("opacity",e.visible?"1":"0"),this.x=this.tx+l,this._line.setVLine(l,0,i),zs.setShape(r,o.shape,a,a),zs.setShape(n,o.lowShape,h,h),r.trans(l-a,0-a),n.trans(l-h,i-a)}};class Ja extends Sa{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Ea(this._pointContainer,Qa)}_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)}}let th=class extends wo{constructor(t){super(t,pa.POINT_CLASS),this._segments=new ho(this,ne),this._decimal=0,this.add(this._back=new ne(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.setPath(zs.rectangle(e,s,i,-r)),this._segments.forEach(((o,a,h)=>{a===h-1&&this._decimal>0?o.setPath(zs.rectangle(e,s-t[2*a],i,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(zs.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}};class eh extends Va{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Ea(this._pointContainer,th)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(e,s)}_shrinkPoint(t){}_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(),d=t.getBaseValue(_)||0,u=_.getPos(_.options.reversed?0:e,d);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>=d?(e-u)/e*(n.yValue-d)/(i-d):u/e*(d-n.yValue)/(d-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)}}))}}let sh=class extends wa{constructor(t){super(t,pa.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Gr(t)),this.add(this._whiskerUp=new Gr(t)),this.add(this._whiskerDown=new Gr(t)),this.add(this._back=new Hs(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 ih extends Sa{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Ea(this._pointContainer,sh)}_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)}}class rh extends ga{}class nh extends Ca{constructor(t){super(t,"rct-funnel-series"),this._segments=new Ea(this._pointContainer,rh),this.add(this._lineContainer=new la(t))}_getPointPool(){return this._segments}getClipContainer(){return null}_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&&qo.reveal(this,{from:this.model.options.reversed?"bottom":"top"})}_refreshZombie(){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=this._zombie,s=this._zombieRate,i=t.length;let r=0,n=0;if(t.forEach((t=>{r+=t.yValue*(t===e?s:t._isDeleted()?t._vr:1)})),i>1||i>0&&!e)if(1==i&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===i&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<i-1;o++){const i=t[o],a=D(i.yValue*(i===e?s:i._isDeleted()?i._vr:1)/r)||0;i.yRate=100*a,i.yPos=n,i.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==i){const e=t[0],i=D(s);n=1-i,e.yRate=100*i,e.yPos=n,e.height=i,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const s=function(t){return d?x+(S-x)*(w-t)/(w-A):x+(S-x)*(t-b)/(A-b)},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,d=i.options.reversed,u=n.options.opposite,p=i.getSize(t,e),g=i.getNeckSize(p.width,p.height),m=new qt,y=i.getCenter(t,e),x=y.x-p.width/2,b=y.y-p.height/2,w=b+p.height,v=x+p.width/2,V=p.height-g.height,S=x+(p.width-g.width)/2,A=d?w-V:b+V,P=[],k=new qt,C=(null==r?void 0:r.getWidth(0))||0;let N,L;this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach((i=>{const n=i.point;if(i.setVis(!n.isNull)){const y=n.yPos*p.height,x=(n.yPos+n.height)*p.height,M=d?w-y:b+y,E=d?w-x:b+x,B=x<V;let T,O,D,R;if(L=null==c?void 0:c.get(n),y>=V?(T=S,O=T+g.width,m.move(T,M).lines(O,M,O,E,T,E),i.ny=i.nx1=NaN):B?(T=s(M),O=T+2*(v-T),D=s(E),R=D+2*(v-D),m.move(T,M).lines(O,M,R,E,D,E),i.ny=NaN,i.nx1=D-T,i.nx2=R-T):(T=s(M),O=T+2*(v-T),D=S,R=D+g.width,m.move(T,M).lines(O,M,R,A,R,E,D,E,D,A),i.nx1=D-T,i.nx2=R-T,i.ny=f(A-M),i.nx3=D,i.nx4=R),i.setPath(m.close(!0)),n.xPos=v,n.yPos=M+(E-M)/2,r&&(N=r.get(n,0))&&N.visible){if(o){null==L||L.setVis(!1);const t=N.isDomAnimating(),e=N.getBBox(),s=B?(O-T+(R-D))/2:g.width;switch(!t&&N.layout(_||"center"),l){case-1:N.trans(n.xPos-s/2+a,n.yPos-e.height/2);break;case 1:N.trans(n.xPos+s/2-e.width-a,n.yPos-e.height/2);break;default:N.trans(n.xPos-e.width/2,n.yPos-e.height/2)}}else-1===l?this.$_layoutLabelAligned(!1,n,i,N,_,u,L,k,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,i,N,_,u,L,k,v,a,h,C,t,e):this.$_layoutLabelOutside(!1,n,i,N,_,u,L,k,v,a,h);N.setContrast(o&&i.dom),P.push(N),N.setPosY(N.ty),this._layoutLabelRotation(N)}else L&&L.setVis(!1)}}));const M=n.options.convergent,E=n.options.dedupeMode,B=n.options.overflow;r&&(o||0===l?"preserveOrder"!==E&&"largestFirst"!==E||r.dedupe(P,c,E):(null==r?void 0:r.arrangeVertical(this,P,c,e,M,E,B))&&this._segments.forEach((s=>{const i=s.point;i.isNull||(N=r.get(i,0),L=null==c?void 0:c.get(i),(null==N?void 0:N.visible)&&(-1===l?this.$_layoutLabelAligned(!0,i,s,N,_,u,L,k,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,N,_,u,L,k,v,a,h,C,t,e):this.$_layoutLabelOutside(!0,i,s,N,_,u,L,k,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 d=i.isDomAnimating(),u=t?i.getBBoxEx():i.getBBox(),p=e.yPos;!t&&!d&&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?u.y+u.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+u.width:m+=c+_,i.trans(m,p-u.height/2))}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d,u){const p=i.isDomAnimating(),g=t?i.getBBoxEx():i.getBBox(),m=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left"));const f=e.xPos=this.$_calcX(e,s,h,n);let y;if(y=n?_+l+c:d-_-c-l,o){const e=t?g.y+g.height/2-m:0;n?o.setLine(a.reset(0,0).line(y-f-_,e).end()):o.setLine(a.reset(0,0).line(y+_-f,e).end()),o.trans(f,m)}t||(n?y-=l+_+g.width:y+=_+l,i.trans(y,m-g.height/2))}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l,_){const c=i.isDomAnimating(),d=t?i.getBBoxEx():i.getBBox(),u=e.yPos;!t&&!c&&i.layout(r||(n?"right":"left"));let p=this.$_calcX(e,s,h,n);if(o){const e=t?d.y+d.height/2-u:0;n?o.setLine(a.reset(0,0).line(-_,e).end()):o.setLine(a.reset(0,0).line(_,e).end()),o.trans(p,u)}t||(n?p-=_+l+d.width:p+=_+l,i.trans(p,u-d.height/2))}}let oh=class extends ma{layout(t,e){this.setPath(zs.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class ah extends va{constructor(t){super(t,"rct-histogram-series"),this._bars=new Ea(this._pointContainer,oh)}_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,_=i?t:e,c=i?e:t,d=h.getPos(_,s.getBaseValue(h)),u=i?0:e,p=o&&l(this._labelInfo,{inverted:i,labelPos:s.getLabelPos(n),labelOff:s.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach(((s,l)=>{const g=s.point,m=a.getPos(c,g.min),f=a.getPos(c,g.max),y=h.getPos(_,g.yValue),x=f-m+(f>m?-1:1),b=y-d;let w=m+(f-m)/2,v=u;g.xPos=w,g.yPos=v-=y,this._layoutPoint(s,l,w,v+b,x,b*r),p&&(p.labelView=o.get(g,0))&&(i&&(v=c-w,w=u,g.yPos=v,g.xPos=w+=h.getPos(_,g.yGroup)),p.pointView=s,p.x=w,p.y=v,p.wPoint=x,p.hPoint=b,this._layoutLabel(n,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,d=i.getPos(e,o.point.yValue)*n,u=m(1,_-l-1);h.xPos=c,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(c,r)}))}}class hh extends wo{constructor(t){super(t,pa.POINT_CLASS),this.add(this._line=new Gr(t,"rct-lollipop-point-bar")),this.add(this._marker=new ne(t,"rct-lollipop-point-marker"))}layout(t){var e;const s=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),zs.setShape(this._marker,this.point.shape,s,s),this._marker.trans(-s,-s)}savePrevs(){this.xSave=this.tx}}class lh extends Va{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_shrinkPoint(t){}_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 Ea(this._pointContainer,hh)),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)}))}}class _h extends wa{constructor(t){super(t,pa.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(g(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(m(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 Gr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Gr(t,"rct-ohlc-point-tick")),this.add(this._bar=new Gr(t)),this.add(this._back=new Hs(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class ch extends Sa{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Ea(this._pointContainer,_h)}_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)}))}}class dh extends Oa{constructor(t){super(t,"rct-pareto-series")}}class uh extends ne{setOff(t){return this.off=f(t),this}}class ph extends Io{constructor(t){super(t,pa.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class gh extends Jt{constructor(t){super(t,pa.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new Io(t))}setSides(t,e,s,i,r){const n=this.point,o=D(L),a=D(((t?n.startAngle:n.startAngle+n.angle)+L/2+M)%M),h=D(a+(t?n.angle:-n.angle)-1e-4+M)%M,l=o-(a+f(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=L/2&&!(h>=a&&h<L/2)||h>=3*L/2&&!(a<h&&a>3*L/2)?(this._outArcView=i.setOff(g(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*L/2&&h<=L/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=L/2&&h<=3*L/2?(this._outArcView=i.setOff(g(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=i.setOff(l),a>=0&&a<=L&&this._outArcView.setOff(g(this._outArcView.off,this._side1View.off)),h>=L&&h<M&&this._outArcView.setOff(g(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(l))}render(t,e,s){const i=zs.isCircled(s.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=s.innerRadius>0,o=s.depth,a=this._outPath,h=this._inPath,l=s.clockwise?s.angle:-s.angle;ot&&(r=this.control.getIEColor(r)),this._outArcView.setPath(zs.arc3d(s.cx,s.cy,s.rx,s.ry,o,s.start,s.start+l,s.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(zs.arc3dInner(s.cx,s.cy,s.rx*s.innerRadius,s.ry*s.innerRadius,o,s.start,s.start+l,s.clockwise,h)),this._side1View.setVis(!i),this._side2View.setVis(!i),this._side1View.visible&&(n?(this._side1View.setPath(zs.polygon(h.x1,h.y1,a.x1,a.y1,a.x1,a.y1+o,h.x1,h.y1+o)),this._side2View.setPath(zs.polygon(a.x2,a.y2,h.x2,h.y2,h.x2,h.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(zs.polygon(s.cx,s.cy,a.x1,a.y1,a.x1,a.y1+o,s.cx,s.cy+o)),this._side2View.setPath(zs.polygon(s.cx,s.cy,a.x2,a.y2,a.x2,a.y2+o,s.cx,s.cy+o)))),this._sectorView._assignShape(s,!1),this._side1View.setStyle("fill",Rt.interpolate("#000",r,.2)),this._side2View.setStyle("fill",Rt.interpolate("#000",r,.2)),this._inArcView.visible&&this._inArcView.setStyle("fill",Rt.interpolate("#000",r,.2)),this._outArcView.setStyle("fill",Rt.interpolate("#000",r,.1))}focusView(t){this._side1View.setBoolData(pa.DATA_FOCUS,t),this._side2View.setBoolData(pa.DATA_FOCUS,t),this._inArcView.setBoolData(pa.DATA_FOCUS,t),this._outArcView.setBoolData(pa.DATA_FOCUS,t)}contains(t){return super.contains(t)||this._side1View.contains(t)||this._side2View.contains(t)||this._inArcView.contains(t)||this._outArcView.contains(t)}setVis(t){return this._side1View.setVis(t),this._side2View.setVis(t),this._inArcView.setVis(t),this._outArcView.setVis(t),super.setVis(t)}addClass(t){return this._side1View&&(this._side1View.addClass(t),this._side2View.addClass(t),this._inArcView.addClass(t),this._outArcView.addClass(t)),super.addClass(t)}removeClass(t){return this._side1View&&(this._side1View.removeClass(t),this._side2View.removeClass(t),this._inArcView.removeClass(t),this._outArcView.removeClass(t)),super.removeClass(t)}trans(t,e){return this._side1View.trans(t,e),this._side2View.trans(t,e),this._inArcView.trans(t,e),this._outArcView.trans(t,e),super.trans(t,e)}transEx(t,e,s,i){return this._side1View.transEx(t,e,s,i),this._side2View.transEx(t,e,s,i),this._inArcView.transEx(t,e,s,i),this._outArcView.transEx(t,e,s,i),super.transEx(t,e,s,i)}}class mh extends Ca{constructor(t){super(t,"rct-pie-series"),this._deep=!1,this._pb=new qt,this._cx=0,this._cy=0,this._depth=0,this._ratio=1,this._rx=0,this._ry=0,this._rxInner=0,this._ryInner=0,this._slicedOff=0,this.add(this._circle=new Ro(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new ko(t,"rct-pie-series-inner")),this._textView._text.anchor=_e.MIDDLE,this._pointContainer.add(this._sideContainer=new ee(t,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new la(t))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const s=e.innerText,i=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.options.ratio:1,this.setBoolData("deep",i),this.$_prepareSectors(t,e,this._visPoints,i),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._deep?(this._ry=this._rx*this._ratio,this._ryInner=this._rxInner*this._ratio):(this._ry=this._rx,this._ryInner=this._rxInner),this.$_layoutSectors(this._visPoints,t,e)}$_calcNormal(t,e){this._rx=this.model.getRadius(t,e),this._rxInner=this.model.getInnerRadius(this._rx)}$_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._rx=n+(s._groupPos+s._groupSize)*o,this._rxInner=(n+s._groupPos*o)/this._rx}_runShowEffect(t){t&&qo.grow(this,(t=>{const e=this._sectors.count>1&&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 ph||t instanceof gh)&&this.model.options.autoSlice){const e=this._sectors.count>1&&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)}_refreshZombie(){this._renderSeries(this.width,this.height)}focusPointView(t,e){t instanceof gh&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,s,i){const r=s.length;let n=this._sides;i!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(i?(this._sectors=new Ea(this._pointContainer,gh,null),n=this._sides=new ho(this._sideContainer,uh,"rct-pie-series-side")):this._sectors=new Ea(this._pointContainer,ph,null)),this._deep=i,n&&n.prepare(4*r,((t,e)=>t.index=e)),this._sectors.prepare(r,((i,r)=>{const n=i.point=s[r];this._preparePoint(t,e,n,i)}))}$_calcAngles(t){const e=this._zombie,s=this._zombieRate,i=t.length,r=this._model.options.clockwise?1:-1,n=t.filter((t=>(t.visible||t===e)&&!t.isNull)).map((t=>t.yValue*(t===e?s:t._isDeleted()?t._vr:1))).reduce(((t,e)=>t+e),0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%M;if(i>1||i>0&&!e)t.forEach((t=>{1===i&&t._isDeleted()||1===i&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=D(t.yValue*(t===e?s:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)}));else if(1==i){const e=t[0];e.startAngle=a,e.angle=r*s*o,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._rx,_=this._rxInner,c=this._depth,p=this._ratio,g=this._sides,m=i.pointLabel,x=m.connector.options.curved,b=this._labelViews(),w="inside"===i.getLabelPos(m),v=y(m.options.radius,.7),V=this._pb,S=m.getDistance(w,l,_),A=m.getAlign();let P=null==b?void 0:b.textAlign();const k=this._lineContainer.setVis(m.connector.visible)?this._lineContainer:null,C=this._slicedOff=i.getSliceOffset(l)*n,N=[],L=[],M=[],E=(null==b?void 0:b.getWidth(0))||0,B=this._sectors.count;let T,O;if(this._lineContainer.setStyleOrClass(m.connector.options.style),!b||P||A||(P="center"),this._textView.visible){const t=this._textView._icon,e=this._textView._text.getBBox();let s=a,i=h;if(t){const r=y(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._rx),this.$_calcAngles(t),this._sectors.forEach(((t,o)=>{const m=t.point;if(g){const e=4*o;t.setSides(r,g.get(e),g.get(e+1),g.get(e+2),g.get(e+3))}if(O=null==k?void 0:k.get(m),m.isNull)t.setVis(!1),b&&(T=b.get(m,0))&&T.setVis(!1),null==O||O.setVis(!1);else{const o=B>1&&m.sliced,g=m.startAngle,y=g+m.angle/2;let k=0,D=0;if(o&&n>=1&&!t.isDomAnimating()&&(k+=d(y)*C,D+=u(y)*C),t.trans(k,D).setVis(!0),m.xPos=a+d(y)*(C+l*v),m.yPos=h+u(y)*(C+l*v),t.render(b,null,{cx:a,cy:h,rx:l,ry:l*p,innerRadius:_,start:g,angle:f(m.angle),clockwise:r,depth:c}),b&&(T=b.get(m,0))){const r=i.getLabelOff2(m);let n;w?(null==O||O.setVis(!1),this.$_layoutLabelInside(m,T,P,r,S,o?C:0)):(n=-1===A?this.$_layoutLabelAligned(!1,m,T,P,O,V,x,r,S,o?C:0):1==A?this.$_layoutLabelEnded(!1,m,T,P,O,V,x,r,S,o?C:0,E,e,s):this.$_layoutLabelOutside(!1,m,T,P,O,V,x,r,S,o?C:0),n?N.push(T):L.push(T)),T.setContrast(w&&t.dom).setVis(!0),M.push(T),this._layoutLabelRotation(T)}else null==O||O.setVis(!1)}})),g&&g.sortDom(((t,e)=>{let s=e.off-t.off;return 0===s&&(s=t.index-e.index),s}));const D=m.options.convergent,R=m.options.dedupeMode,$=m.options.overflow;b&&(w||0===A?"preserveOrder"!==R&&"largestFirst"!==R||b.dedupe(M,k,R):b.arrangeVertical(this,N,k,s,D,R,$)+b.arrangeVertical(this,L,k,s,D,R,$)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=B>1&&r.sliced,n=i.getLabelOff2(r);T=b.get(r,0),O=null==k?void 0:k.get(r),(null==T?void 0:T.visible)&&(-1===A?this.$_layoutLabelAligned(!0,r,T,P,O,V,x,n,S,t?C:0):1==A?this.$_layoutLabelEnded(!0,r,T,P,O,V,x,n,S,t?C:0,E,e,s):this.$_layoutLabelOutside(!0,r,T,P,O,V,x,n,S,t?C:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,p=this._cx,g=this._cy,m=this._rx,f=this._ry,y=m+l,x=f+l,b=p+d(c)*y,w=g+u(c)*x,v=b<p;!t&&!_&&s.layout(i||(v?"right":"left"));const V=s.getBBox(),S=w-V.height/2;let A,P,k,C=g+u(c)*f;if(v?(A=p+d(Math.PI)*m-h,P=A-V.width-a,k=p+d(Math.PI)*y-h,V.width):(A=p+d(0)*m+h,P=A+a,k=p+d(0)*y+h),r&&r.setVis(y>0)){const e=t?s.ty-S:0;o?r.setLine(n.reset(0,e).quad(.7*(b-A),e,b-A,0).end()):r.setLine(n.reset(0,e).line(b-A,0).end()),r.setPos(A,C),!_&&r.trans(A,w)}return t||(s.setPos(P,C-V.height/2),!_&&s.trans(P,C-V.height/2)),v}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,p){const g=s.isDomAnimating(),m=e.startAngle+e.angle/2,f=this._cx,y=this._cy,x=this._rx,b=this._ry,w=x+l,v=b+l;let V=f+d(m)*w,S=y+u(m)*v;const A=V<f;!t&&!g&&s.layout(i||(A?"right":"left"));const P=s.getBBox(),k=S-P.height/2;let C,N,L,M=y+u(m)*b;if(A?(C=h+_+a,L=h+_-P.width,N=C):(C=c-h-_-a,L=c-h-_,N=C),r&&r.setVis(w>0)){const e=t?s.ty-k:0;o?r.setLine(n.reset(0,e).quad(0,e,V-N,0).end()):r.setLine(n.reset(0,e).line(V-N,0).end()),r.setPos(C,M),!g&&r.trans(N,S)}return t||(s.setPos(L,M-P.height/2),!g&&s.trans(L,M-P.height/2)),A}$_layoutLabelOutside(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating();!t&&!_&&s.layout(i);const c=s.getBBox(),p=e.startAngle+e.angle/2,g=this._cx,m=this._cy,f=this._rx+.5*h,y=this._ry+.5*h,x=d(p)*l,b=u(p)*l,w=g+d(p)*this._rx,v=m+u(p)*this._ry,V=g+d(p)*f;let S=m+u(p)*y;const A=V<g;let P,k;return A?(P=V-.2*h,k=P):(P=V+.2*h,k=P),r&&r.setVis(f>0)&&(o?r.setLine(n.reset(0,0).quad(V-w,S-v,P-w,S-v).end()):r.setLine(n.reset(0,0).lines(V-w,S-v,P-w,S-v).end()),r.setPos(w,v),!_&&r.trans(w+x,v+b)),t||(A?k-=c.width+a:k+=a,S-=c.height/2,s.setPos(k,S),!_&&s.trans(k+x,S+b)),A}$_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 d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(l){const t=a._totalRad,s=g(a.options.totalAngle||360,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(d.width/2,d.height/2,i)}else this.applyAutoRotation(e,p,t,s)}const m=h.options.align===Us?.3:h.options.align===Ws?.5:.7,f=u>0?u+(this._rx-u)/2:l?"angle"===_?this._rx*m+i:.8*this._rx+i:.7*this._rx+i,y=this._deep?f*this._ratio:f,x=Math.cos(p),b=Math.sin(p);let w=this._cx+x*f,v=this._cy+b*y;e.move(w-d.width/2,v-d.height/2),w=this._cx+x*(n+f),v=this._cy+b*(n+y),e.trans(w-d.width/2,v-d.height/2)}$_slice(t,e,s){if(e&&this._sectors.count<2)return;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,u(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,p=_.connector.options.curved,g="inside"===i.getLabelPos(_),m=r.get(h,0),f=i.pointLabel.getDistance(g,this._rx,this._rxInner);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,p,_.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))}}}class fh extends Aa{setHoverRate(t,e,s){const i=this.point,r=zs.getDrawer(t.model.getShape(i)),n=(+t.model.options.hoverScale||1.8)-1;let o=t._radius;e?this._hoverRadius=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._hoverRadius}}class yh extends Pa{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new Ea(t,fh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&qo.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)}))}_getDefaultPos(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,p=+i.jitterX||0,g=+i.jitterY||0,m=s.pointLabel,f=m.options.position,y=m.getOffset(),x=this._labelViews(),b=r?t:e,w=h?h.total:r?e:t,v=r?0:e;let V;this._markers.forEach(((i,m)=>{const S=i.point,A=x&&(V=x.get(S,0));if(i.setVis(!S.isNull)){const m=zs.getDrawer(s.getShape(S)),x=at.jitter(S.xValue,p),P=at.jitter(S.yGroup,g);let k,C;if(h){const t=h.start+o.getPos(w,x),e=a.getPos(h.rd,P)*l;k=h.cx+e*d(t),C=h.cy+e*u(t)}else k=o.getPos(w,x),C=v-a.getPos(b,P),r&&(k=a.getPos(b,P),C=e-o.getPos(w,x));if(S.xPos=k,S.yPos=C,i.setVis(!!h||!n||k>=0&&k<=t&&C>=0&&C<=e)){const t=i._hoverRadius||_;i.setPath(m(t)),i.trans(k,C).rotate(c),A&&this._layoutLabelView(V,f,y,t,k,C)}else A&&A.setVis(!1)}else A&&A.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}}class xh extends Sa{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Ea(this._pointContainer,xa),this.add(this._lineContainer=new ee(t,"rct-waterfall-series-lines")),this._lines=new ho(this._lineContainer,Gr)}_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,s,i){super._prepareSeries(t,e,s,i),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,0,0,this._inverted),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}))}}function bh(t,e){return new(zo[e._type()])(t)}function wh(t,e){return new(ca[e._viewType()])(t)}pa.register([Jr,$a],[sn,Ra],[Rr,Ha],[Tr,Fa],[an,Ga],[ln,Xa],[cn,Wa],[pn,Za],[mn,Ka],[bn,Ja],[vn,eh],[Vn,ih],[kn,nh],[Ln,ah],[qr,Da],[Bn,lh],[On,ch],[Rn,dh],[Gn,mh],[Yn,yh],[Zn,xh]),Ho.register([fr,Ma],[gr,Na],[mr,La]);class vh extends vo{constructor(t){super(t,"rct-axis-grid"),this._lines=new ho(this,Gr)}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(){const t=this._model,e=t.options,s=t.axis,i=s.options.reversed,r=this.width,n=this.height,o=s.isEmpty()?[]:t.getPositions(s,s._isHorz?r:n),a=this._lines.prepare(o.length,(e=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t._style),e.setClass("rct-axis-grid-line")})),h=a.count-1;let l;a.forEach(((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",o[e]===(s._isHorz?r:n))}));const _=null==e.firstVisible?t.visible:e.firstVisible,c=null==e.lastVisible?t.visible:e.lastVisible;if(s._isHorz){const e=y(s._prevRate,1);a.forEach(((a,d)=>{l=0===d?_:d===h?c:t.visible,a.setVis(l)&&a.setVLine(s.prev(o[d])+(i?r*(1-e):0),0,n)}))}else{const e=i?y(s._prevRate,1):1;a.forEach(((i,a)=>{o[a],l=0===a?_:a===h?c:t.visible,i.setVis(l)&&i.setHLine(n*e-s.prev(o[a]),0,r)}))}}}class Vh extends Jt{constructor(t){super(t,"rct-axis-break"),this.add(this._mask=new ne(t)),this._mask.setStroke("none"),this.add(this._upLine=new ne(t)),this._upLine.setFill("none"),this.add(this._downLine=new ne(t)),this._downLine.setFill("none")}setModel(t){this._model=t}layout(t,e,s){this.isClip(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 qt;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 Sh extends Jt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new ko(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)}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 Ah extends Sh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Fo:Gr)(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=y(n.offsetX,0),_=y(n.offsetY,0);let c,d;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":d="inside"===n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="inside"===n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i);if(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":d=r+_;break;case"middle":d=r-h.height/2-_;break;default:d=r-h.height-_}}}a.visible&&a.trans(c,d)}_doLayoutPolar(t,e,s){const i=this.model,r=this._line,n=this._labelView.setVis(i.axis.contains(i.options.value)&&i.label.visible)&&this._labelView,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(U,"none"),n&&n.trans(s.cx+a*d(s.start),s.cy+a*u(s.start))}}class Ph extends Sh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?Io:Gs)(t,"rct-axis-guide-range"))}prepare(t,e){super.prepare(t,e);const s=e.options,i=g(s.startValue,s.endValue),r=m(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(),_=y(r.offsetX,0),c=y(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,o),d=s.axis.getPos(t,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(d!==i))){let s,o;switch(r.align){case"center":s=i+(d-i-l.width)/2+_;break;case"right":s=d-l.width-_;break;default:s=i+_}switch(r.verticalAlign){case"bottom":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,d,e),h&&h.trans(m(0,g(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),d=e-s.axis.getPos(e,a);if(!isNaN(i)&&!isNaN(d)&&h.setVis(n.setVis(i!==d))){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="inside"===r.position?t-l.width-_:t+_;break;default:e="inside"===r.position?_:-1*(l.width+_)}switch(r.verticalAlign){case"bottom":s=i-l.height-c;break;case"middle":s=d+(i-d-l.height)/2-c;break;default:s=d+c}h&&h.trans(e,s),n.setBox(0,d,t,i)}}}_doLayoutPolar(t,e,s){const i=this.model,r=this._box,n=this._labelView.setVis(i.label.visible)&&this._labelView,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:M,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*d(s.start),s.cy+t*u(s.start))}}}class kh extends ee{constructor(){super(...arguments),this._views=new ho(this,ne)}prepare(){this._rows=[]}addAll(t,e){const s=this._rows;e.forEach((t=>{s.push(...t.grid.rows.getRows())}))}layout(t,e){const s=this._rows;this._views.prepare(s.length),this._views.forEach(((i,r)=>{const n=s[r],o=n.axis,a=Math.max(o.axisMin(),n.from),h=Math.max(o.axisMax(),n.to);if(n.axis._isHorz){const s=m(0,g(t,o.getPos(t,a))),r=m(0,g(t,o.getPos(t,h)));i.setPath(zs.rectangle(s,0,r-s,e))}else{const s=m(0,g(e,o.getPos(e,a))),r=m(0,g(e,o.getPos(e,h)));i.setPath(zs.rectangle(0,e-s,t,s-r))}i.setFill(n.color)}))}}class Ch extends ee{constructor(){super(...arguments),this._linePool=[],this._rangePool=[],this._views=[]}clean(){const t=this._views;for(;t.length;){const e=t.pop().remove();e instanceof Ph?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,s){e.forEach((e=>{let i;e instanceof ss?i=this._rangePool.pop()||new Ph(t,s):e instanceof es&&(i=this._linePool.pop()||new Ah(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Nh extends ne{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 qt;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 wi&&(l=_(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 Lh extends Do{constructor(t){super(t,"Reset Zoom",Lh.CLASS_NAME),this.setVis(!1)}}Lh.CLASS_NAME="rct-reset-zoom";class Mh extends ee{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Hs(t,"rct-empty-view-back")),this.add(this._labelView=new ko(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 Eh extends ee{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new ho(this,Gr)}layout(t,e,s,i,r,n){const o=e.model,a=o.axis,{side:h,base:l}=i,_=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-l:n-h);this._lines.prepare(_.length,((e,i)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),s?e.setLine(0,n-_[i],r,n-h-_[i]):e.setLine(_[i]+l,0,_[i],n)}))}}class Bh extends ee{constructor(t,e){super(t,"rct-body-depth-side"),this.isX=e,this._gridViews=new Map,this.add(this._backView=new ne(t)),this.add(this._gridContainer=new ee(t,"rct-body-depth-grids")),this.add(this._lineView=new Gr(t,"rct-body-depth-side-line")),this.add(this._endView=new Gr(t,"rct-body-depth-side-line"))}layout(t,e,s,i,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,s,i,n,o),this.$_renderGrids(t,e,r,s,i,n,o)}$_renderBack(t,e,s,i,r,n){const{side:o,base:a}=i,h=this._lineView,l=this._endView;t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e._style),h.setVis(e.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(e.line._style)),l.setVis(e.endLine.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(e.endLine._style)),s?(t.setPath(zs.polygon(0,o,a,0,a,n-o,0,n)),h.visible&&h.setVLineC(0,o,n),l.visible&&l.setLine(0,o,r,0)):(t.setPath(zs.polygon(a,0,r,0,r-a,o,0,o)),h.visible&&h.setHLineC(n,0,r-a),l.visible&&l.setLine(r,0,r-a,n))}$_renderGrids(t,e,s,i,r,n,o){const a=this._gridContainer,h=this._gridViews;for(const[t,e]of this._gridViews.entries())s.has(t)||(h.delete(t),e.remove());for(const[l,_]of s.entries())if(l._isX===this.isX){let s=h.get(l);s||(s=new Eh(t),h.set(l,s),a.add(s)),s.layout(e,_,i,r,n,o)}}}class Th extends ee{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new Bh(t,!0)),this.add(this._ySideView=new Bh(t,!1)),this.add(this._orgLineView=new Gr(t,"rct-body-depth-org-line"))}render(t,e,s,i,r,n,o){if(this.setVis(!!r)){const{base:a,side:h}=r,l=this._xSideView,_=this._ySideView;l.setVis(s.xSide.visible)&&(e?l.setBounds(0,0,a,o):l.setBounds(0,o-h,n,h),l.layout(t,s.xSide,e,r,i)),_.setVis(s.ySide.visible)&&(e?_.setBounds(0,o-h,n,h):_.setBounds(0,0,a,o),_.layout(t,s.ySide,!e,r,i)),this._orgLineView.setVis(s.orgLine.visible)&&this._orgLineView.setLine(a,o-h,0,o)}}}class Oh extends vo{constructor(t,e){super(t,Oh.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._hoverPointSeries=[],this._owner=e,this.add(this._hitTester=new Hs(t)),this._hitTester.setFill("transparent"),this.add(this._background=new ne(t,"rct-body-background")),this.add(this._depthLayer=new Th(t)),this.add(this._image=new Po(t,!0,"rct-body-image")),this.add(this._emptyView=new Mh(t)),this.add(this._gridRowContainer=new kh(t,"rct-axis-grid-rows")),this.add(this._gridContainer=new ee(t,"rct-axis-grids")),this.add(this._baseContainer=new ee(t,"rct-axis-bases")),this.add(this._guideContainer=new Ch(t,"rct-axis-guides")),this.add(this._annotationContainer=new ee(t,"rct-annotations")),this.add(this._seriesContainer=new ee(t,"rct-series-container")),this.add(this._axisBreakContainer=new ee(t,"rct-axis-breaks")),this.add(this._labelContainer=new ee(t,"rct-label-container")),this.add(this._frontGuideContainer=new Ch(t,"rct-front-axis-guides")),this.add(this._frontAnnotationContainer=new ee(t,"rct-front-annotations")),this.add(this._feedbackContainer=new ee(t,"rct-feedbacks")),this.add(this._zoomButton=new Lh(t)),this._crosshairViews=new ho(this._feedbackContainer,Nh)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,s){const i=e.chart,r=e.depth.visible;this._animatable=Qt._animatable&&i.animatable(),this._polar=s,this._prepareSeries(t,e,i._getSeries().getVisibleSeries(),r),i._getGauges()&&this._prepareGauges(t,i,i._getGauges().getVisibles()),this._prepareAnnotations(t,i._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,s){return this._depthExt=t._body._getDepth(e,s)}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(pa.isPointDom(e))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,d=(null==c?void 0:c.value)&&(c.contains("rct-contextmenu-item")||c.contains("rct-contextmenu-list")),u=h&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach((e=>{e.setVis(u)&&e.layout(_,t.x,t.y,s,i)})),_)this.$_setFocused(l,_,t);else if(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 Ur)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=y(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)=>{if(!e.pv||!s.pv)return e||s;const i=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=i*i+r*r,o=s.pv.pv.point.xPos-t.x,a=s.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:s}));l=a.sv,i=a.pv,s=a.hint}else l=o[0],s=y(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.forEach((r=>{if(r.getHintDistance&&(s=y(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._owner,r=this.chart(),n=null==t?void 0:t.model,o=this.chart().chartOptions.pointHovering,a=this._focused,h=this._siblings,l=this._siblingSeries;let _,c,d;if(n&&n.options.interactive&&e&&o.visible)switch(o.getScope(n,e.point)){case"axis":d=n._xAxisObj.getSeries();case"group":d||(d=n._group.getVisibleSeries());const r=d.map((t=>{if(t instanceof sr){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 cn){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)}));_=d.map((t=>i.getSeriesView(t))),c=[],r.forEach(((t,e)=>{c.push(_[e].getPointView(t))}));break;default:_=[t],c=[e]}let u=[];if(_&&_.forEach(((t,e)=>{u.push(...t.getSiblings(c[e]))})),u=u.length>1?u.sort(((t,e)=>t.hash-e.hash)):u.length>0?u:null,at.equalArrays(h,u)||(_&&_.forEach(((t,e)=>{t.focusPoints(t.getSiblings(c[e]))})),l&&l.forEach((t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)})),this._siblingSeries=_,this._siblings=u),e!==a){let s=this._focusedSeries;this._focused=e,t!==s&&(s&&this.$_focusSeries(s,!1),this._focusedSeries=t,n&&n.options.interactive&&this.$_focusSeries(t,!0),n&&r.chartOptions.options.seriesHovering&&n.options.interactive&&this.$_hoverSeries(t))}this._focused&&n&&n.options.interactive&&(this._focused!==a||!i.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?s.x>0&&s.x<this.width&&s.y>0&&s.y<this.height?i.showTooltip(n,e,[],this,s):i.hideTooltip():!this._focused&&i.tooltipVisible()&&i.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(pa.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(pa.DATA_UNHOVER,t&&e!==t)}))}hoverPoint(t){const e=this.chart().seriesByPoint(t),s=this.getSeries(e);s?(s.hoverPoint(t),this._hoverPointSeries.push(s)):this._hoverPointSeries&&(this._hoverPointSeries.forEach((t=>t.hoverPoint(null))),this._hoverPointSeries.length=0)}clearHover(){this.hoverPoint(null),this.hoverSeries(null),this._seriesViews.forEach((t=>t.focusPoints(null))),this.removeFocus()}seriesByDom(t){return this._seriesViews.find((e=>e.dom.contains(t)))}annotationByDom(t){return this._annotationViews.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)}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 Aa&&e.endHover(t,!1),e.setBoolData(pa.DATA_FOCUS,!1)})),t._hoverPts=[],t._hoverAnis.forEach((t=>{t.cancel()})),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=this.control,o=e.chart,a=this._depthExt,h=a?a.wBody:s,l=a?a.hBody:i;if(this._zoomRequested=!1,this.isClip(this._seriesClip)||(this._seriesClip=n.clipBounds(),this._seriesClip2=n.clipBounds(),this._bodyClip=n.clipBounds()),this._background.internalSetStyleOrClass(e._style),this._background.setBoolData("polar",this._polar||o.isWidget()),this._seriesViews.forEach(((e,s)=>{e.measure(t,this._series[s],h,l,r)})),!this._polar){this.$_prepareGrids(t,o);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,h,l,r);this.$_prepareAxisBreaks(t,o)}return this._gaugeViews.forEach(((e,s)=>{e.measure(t,this._gauges[s],h,l,r)})),this._annotationViews.forEach(((e,s)=>{e.measure(t,this._annotations[s],h,l,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)}_renderBackground(t,e,s){t.setPath(zs.rectangle(0,0,e,s))}_setImage(t,e,s,i){if(e.setVis(t.visible&&!!t.options.url))return e.setImage(t.options.url,s,i),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const s=this._depthExt,i=this.width,r=this.height;let n=s?s.wBody:i,o=s?s.hBody:r,a=s?s.base:0;if(this._inverted){const t=s?s.side:0;this._seriesClip.setBounds(-t,-n,r,i),this._seriesClip2.setBounds(-t,0,i,r)}else this._seriesClip.setBounds(-a,0,i,r),this._seriesClip2.setBounds(-a,0,i,r);if(this._bodyClip.setBounds(0,0,n,o),this._hitTester.trans(a,0).resize(n,o),this._background.trans(a,0).resize(n,o),this._seriesContainer.trans(a,0),this._renderBackground(this._background,n,o),this._setImage(e.image,this._image,n,o),this._depthLayer.setVis(!this._polar&&s&&s.depth>0),this._seriesViews.forEach((t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(s),t.resize(n,o),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),!this._polar){this._depthLayer.render(t.doc(),this._inverted,e.depth,this._gridViews,s,this.width,this.height);for(const t of this._gridViews.values())t.resize(n,o),t.trans(a,0),t.layout();for(const t of this._baseViews.values()){const e=t.tag;t.setStyleOrClass(e.baseLine._style),e._isHorz?t.setVLine(e.getPos(n,e.getBaseValue()),0,o):t.setHLine(o-e.getPos(o,e.getBaseValue()),0,n)}if(this._breakViews.forEach((t=>{const e=t._model,s=e.axis;s._isHorz?s.options.reversed?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):s.options.reversed?t.trans(0,e._sect.pos):t.trans(0,o-e._sect.pos-e._sect.len),t.layout(n,o,e.axis._isHorz)})),this.isClip(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.setVis(t._views.length>0)&&(t._views.forEach((t=>t.visible&&t.layout(n,o))),t.setClip(this._guideClip))})),this._gridRowContainer.layout(n,o),this._gridRowContainer.trans(a,0)}this.$_prepareCrosshairs(e.chart),this._gaugeViews.forEach((t=>{t.resizeByMeasured(),t.layout().transp(t.getPosition(n,o))})),this._layoutAnnotations(this._inverted,this,n,o),this._zoomButton.visible&&this._zoomButton.trans(n-this._zoomButton.getBBox().width-10,10),this._emptyView.setVis(this.$_isEmptyVisible(e))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(e.emptyView,n,o))}$_isEmptyVisible(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&&!1!==t.emptyView.visible}$_createGaugeView(t,e){return new(Go[e._type()])(t)}$_prepareGrids(t,e){const s=e._needAxes(),i=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),h=this.getRow();for(const t of r.keys())s&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())s&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof Sr)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));s&&[e._getXAxesAtPane(a,h,!0),e._getYAxesAtPane(a,h,!0)].forEach((e=>e.forEach((e=>{const s=e.grid;if(!r.has(e)&&(s.visible||s.options.firstVisible||s.options.lastVisible)){const s=new vh(t);r.set(e,s),i.add(s)}if(e instanceof Sr&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new Gr(t,"rct-axis-baseline");o.set(e,s),n.add(s),s.tag=e}}))))}_prepareSeries(t,e,s,i){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,h=i?e.depth:null;for(const t of o.keys())s.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=s,a.forEach((t=>{s.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove())})),a.length=0,s.forEach((e=>{const s=o.get(e)||wh(t,e);s._setChartOptions(n,this._animatable,r.loadAnimatable()),s.parent||(this._seriesContainer.add(s),this._labelContainer.add(s._labelContainer)),o.set(e,s),a.push(s),s.prepareSeries(t,e,this._polar,h)})),this._seriesContainer.sort(a),a.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)||bh(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=this.getCol(),n=this.getRow(),o=[];for([e._getXAxesAtPane(r,n,!1),e._getYAxesAtPane(r,n,!1)].forEach((t=>t.forEach((t=>{t instanceof Ar&&o.push(...t._getBreaks())}))));i.length<o.length;){const e=new Vh(t);s.add(e),i.push(e)}for(;i.length>o.length;)i.pop().remove();i.forEach(((t,e)=>t.setModel(o[e])))}$_prepareCrosshairs(t){const e=this._crosshairViews,s=this.getCol(),i=this.getRow(),r=[];t._needAxes()&&[t._getXAxesAtPane(s,i,!0),t._getYAxesAtPane(s,i,!0)].forEach((t=>t.forEach((t=>{t.crosshair.visible&&r.push(t.crosshair)})))),e.prepare(r.length,((t,e)=>{t.setModel(r[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)}))}}Oh.BODY_CLASS="rct-body";class Dh extends Jt{constructor(t){super(t,Rh.HANDLE_STYLE),this.add(this._back=new Hs(t)),this.add(this._shape=new ne(t)),this._shape.setFill("white")}layout(t,e,s){if(t!==this._w||e!==this._h||s!==this._vertical){let i=1.3*g(t,e);const r=new qt;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 Rh extends vo{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(Rh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Rh.MASK_STYLE)}constructor(t){super(t,Rh.CLASS_NAME),this.add(this._back=new Hs(t,Rh.BACK_STYLE)),this.add(this._container=new ee(t,null)),this.add(this._mask=new Hs(t,Rh.MASK_STYLE)),this.add(this._trackView=new Hs(t,Rh.TRACK_CLASS)),this.add(this._thumbView=new Hs(t,Rh.THUMB_CLASS)),this.add(this._startHandle=new Dh(t)),this.add(this._endHandle=new Dh(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=wh(t,s)),i._simpleMode=!0),i&&i.prepareSeries(t,s,!1,null)}$_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 Oo(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 Oo(t)),i._simpleMode=!0)}}Rh.CLASS_NAME="rct-navigator",Rh.BACK_STYLE="rct-navigator-back",Rh.MASK_STYLE="rct-navigator-mask",Rh.HANDLE_STYLE="rct-navigator-handle",Rh.HANDLE_BACK_STYLE="rct-navigator-handle-back",Rh.TRACK_CLASS="rct-navigator-track",Rh.THUMB_CLASS="rct-navigator-thumb";class $h extends le{constructor(t){super(),this.chart=t}}class Fh extends $h{constructor(t,e,s){super(t),this._body=e,this._vertical=s}_doStart(t,e,s,i,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=m(0,e-(o.x-n.x)),this._yStart=m(0,s-(o.y-n.y)),this._body.addFeedback(this._feedback=new Hs(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=m(0,g(i.height,e-(i.y-s.y))),this._body.setZoom(0,g(m(0,this._yStart),e),this._body.width,m(g(this._yStart,i.height),e))):(t=m(0,g(i.width,t-(i.x-s.x))),this._body.setZoom(m(0,g(this._xStart,t)),0,m(g(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=m(0,g(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,g(this._yStart,r),this._body.width,f(this._yStart-r))):(i=m(0,g(o.width,i-(o.x-n.x))),this._feedback.setBounds(g(this._xStart,i),0,f(this._xStart-i),this._body.height)),!0}}class Ih extends $h{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=Math.floor(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)):(o=n.svgToElement(i,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class zh extends $h{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,c=a*h/n.width+l;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(c,NaN,_):o.zoom(l,NaN,_):a>0&&a<n.width?o.zoom(NaN,c,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class Hh extends $h{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=m(0,g(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class Gh{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&&(f(this._clickX-i)>3||f(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)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;const s=this._chart.model,i=this._chart.chartView(),r=this._clickElement,n=i.getButton(r);let o,a,h,l,_;const c=this._chart.chart.exporter;if(c.isContextMenuVisible()&&c.toggleContextMenu(),n)!0!==n.click()&&i.buttonClicked(n);else if(a=i.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:s.wrapper,source:a.legend.getSources(a)})){at.makeArray(a.legend.getSources(a),!0).forEach((t=>{if(t instanceof pi){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof Ca&&t.togglePointVisible(e)}}else a.source.visible=!a.source.visible,i.bodyView().hoverSeries(a.source.visible?a.source:null)}))}}else(h=i.seriesByDom(r))?h.clicked(r):(_=i.htmlButtonByDom(r))?_.click():(l=i.annotationByDom(r))?l.clicked():(o=i.creditByDom(r))&&o.clicked(r)}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 Bo.isThumb(t)?new Ih(this._chart,i.getScrollView(t)):Rh.isHandle(t)?new zh(this._chart,i._navigatorView,t):Rh.isMask(t)&&r&&r.model.isZoomed()?new Hh(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Fh(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 jh extends ee{constructor(t){super(t,jh.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(t,e){if(this.setVis(e&&e.length>0)){const s=this._itemViews,i=this._separators;for(;s.length<e.length;){const e=new ue(t,"rct-history-item");e.anchor=_e.START,s.push(e)}for(;s.length>e.length;)s.pop().remove();for(;i.length<e.length-1;){const e=new ue(t);e.anchor=_e.START,e.text=">",i.push(e)}for(;i.length>e.length-1;)i.pop().remove();this.$_layout(e)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let 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)}}jh.TITLE_CLASS="rct-history";class Xh extends vo{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new Hs(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new ue(t,"rct-legend-item-label")),this._label.anchor=_e.START}setMarker(t){return t===this._marker&&t.parent===this||this.insertFirst(this._marker=t),this._marker}_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():lo,l=co(this._label.getBBox());return this._gap=y(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:m(h.height,l.height)}}_doLayout(t){const e=this._rMarker,s=y(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 Yh extends Vo{constructor(t){super(t,Yh.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new ho(this,Xh)}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=y(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?y(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 d,u=_,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor(),r=e.legendStroke();t._marker.setColor(i),r&&t._marker.setStroke(r),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(d=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=_,"center"!==r&&"end"!==r||(d=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-d)/2:this.width-d),t.forEach((t=>{t.trans(u,p),u+=t.width+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(),d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,f,y,x;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,c)),e.measure(t,a[s],r,n,1)}));let b=0,w=0;if(s){for(;b<d;)x=h.get(b),w%i==0?(u.push(y=[x]),f=x.mh,w++,b++):(f+=l+x.mh,f<=n?(y.push(x),w++,b++):w=0);this._wMarkers=[],g=f=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=m(s,t.mw),r=m(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),f=m(f,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;b<d;)x=h.get(b),w%i==0?(u.push(y=[x]),g=x.mw,w++,b++):(g+=l+x.mw,g<=r?(y.push(x),w++,b++):w=0);g=f=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=m(s,t.mh)})),e+=l*(t.length-1),g=m(g,e),f+=s,p.push(s)})),f+=_*(u.length-1)}return{width:g,height:f}}}Yh.LEGEND_CLASS="rct-legend";class Wh extends Jt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new Ro(t))}layout(){}}class Uh extends Jt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new ee(t,"rct-polar-axis-markers")),this._markViews=new ho(this._markContainer,Wh),this.add(this._gridContainer=new Jt(t,"rct-polar-axis-grids")),this._labelViews=new ho(this._labelContainer=s,Mo,i?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,s,i){this._model=e,this._circular=s,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,o=s.getLabelStyle(e,i);if(t.value=e.value,null!=r){n&&r.match(To)?t.setLabel(s,o,e,r.replace(To,n),1e3,1e3):(s.prepareRich(r),s._paramTick=e,s.buildSvg(t._text,t._outline,NaN,NaN,s,s._domain))}else t.setLabel(s,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const s=e.label;if(s.visible&&e.checkVisible()){const t=e._ticks,{start:i,total:r}=s.chart._body.getPolar(e),n="auto"===s.options.rotation,o=t.length;this._labelContainer.setStyleOrClass(s._style),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:d}=a.getBBox();a.setRotation(c/2,d/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 Zh extends Uh{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new ho(this._gridContainer,Gr,Zh.GRID_CLASS),e.insertFirst(this._startView=new Gr(t,Zh.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Gr(t,Zh.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Fo(t,Zh.LINE_CLASS))}_doPrepare(t,e,s){const i=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(i.visible)&&(n.setStyleOrClass(i._style),n.setFill("none")),this._startView.setVis(s&&t.isArced()&&r.visible)?(this._startView.setStyleOrClass(r._style),this._endView.setVis(!0),this._endView.setStyleOrClass(r._style)):this._endView.setVis(!1)}_doLayout(t,e,s,i,r,n){const o=t.getStartAngle(),a=t.getTotalAngle();if(r.forEach((t=>t.pos=t.pos/i*a/M)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+d(o+h)*i,_=s+u(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;if(n>0){const a=Math.ceil(9/(360/n)),h=i+t.tick._getLength(),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(),c=t.angle=o+n.pos,p=e+d(c)*(h+a.width/2)-a.width/2,g=s+u(c)*(h+a.height/2)-a.height/2;t.trans(p,g),_.push(t)}}));const c=_.length;c>2&&(f(_[c-1].angle-_[c-2].angle)<M/24||at.diffAngle(_[c-1].angle,_[0].angle)<M/24)&&_[c-1].setVis(!1)}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,s,i,o,a,!0);else{const n=t.isArced(),h=[];n&&r[0].pos>0&&h.push(e+d(o)*i,s+u(o)*i),r.map((t=>{const r=t.pos;h.push(e+d(o+r)*i,s+u(o+r)*i)})),n&&r[r.length-1].pos<a&&h.push(e+d(o+a)*i,s+u(o+a)*i),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e,s,e+d(o)*i,s+u(o)*i),this._endView.setLine(e,s,e+d(o+a)*i,s+u(o+a)*i))}}Zh.LINE_CLASS="rct-polar-xaxis-line",Zh.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",Zh.GRID_CLASS="rct-polar-xaxis-grid-line";class qh extends Uh{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new ho(this._gridContainer,Fo,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new Gr(t,"rct-polar-yaxis-line")),e.add(this._baseView=new Fo(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,s,i){const r=t.line,n=t instanceof Sr&&t.baseLine;this._gridContainer.setVis(!1!==t.grid.visible)&&this._gridViews.prepare(e.length,null),this._lineView.setVis(r.visible)&&this._lineView.setStyleOrClass(r._style),this._baseView.setVis(n.visible&&t.isBaseVisible())&&this._baseView.setStyleOrClass(n._style)}_doLayout(t,e,s,i,r,n){function o(t,i){if(t.setFill("none"),a)t.setArc(e,s,i,_,c,!0);else{const r=[];l&&h[0].pos>0&&r.push(e+d(_)*i,s+u(_)*i),h.forEach((t=>{const n=t.pos;r.push(e+d(_+n)*i,s+u(_+n)*i)})),l&&h[h.length-1].pos<c&&r.push(e+d(_+c)*i,s+u(_+c)*i),t.setPolyline(r)}}const a=this._circular,h=n._ticks,l=n.isArced(),_=n.getStartAngle(),c=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach(((e,s)=>{o(e,r[s].pos),e.setStyleOrClass(t.grid.options.style)})),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",i="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(l){const t=n.getStartAngle();this._labelViews.forEach(((n,a)=>{const h=n.getBBox();n.setContrast(null).trans(e+d(t)*r[a].pos-h.width*i+o,s+u(t)*r[a].pos-h.height/2)}))}else this._labelViews.forEach(((t,n)=>{const a=t.getBBox();t.setContrast(null).trans(e-a.width*i+o,s-r[n].pos-a.height/2)}))}this._lineView.visible&&(l?this._lineView.setLine(e,s,e+i*d(_),s+i*u(_)):this._lineView.setVLine(e,s,s-i)),this._baseView.visible&&o(this._baseView,t.getPos(i,t.getBaseValue()))}}class Kh extends Oh{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._circular=this.model.options.circular,this._prepareAxes(t,n.xAxis,n._getYAxes().visibles(),this._circular,n.xAxis.isArced()),o}_renderBackground(t,e,s){const{cx:i,cy:r,rd:n}=this.model.getPolar(null);t.setPath(zs.circle(i,r,n))}_setImage(t,e,s,i){const{cx:r,cy:n,rd:o}=this.model.getPolar(null);if(super._setImage(t,e,2*o,2*o))return e.trans(r-o,n-o),this.isClip(this._polarBodyClip)||(this._polarBodyClip=this.control.clipCircle()),this._polarBodyClip.setCircle(o,o,o),e.setClip(this._polarBodyClip),!0}_doLayout(){const t=this.width,e=this.height,s=this.model.setPolar(t,e),{cx:i,cy:r,rd:n}=s.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(s.image,this._image,t,e),this._seriesViews.forEach((t=>{var e;t.setCircular(this._circular),t.model.needClip(!0)&&(this.isClip(this._polarClip)||(this._polarClip=this.control.clipCircle()),this._polarClip.setCircle(i,r,n),t.getClipContainer().setClip(this._polarClip),null===(e=t.getClipContainer2())||void 0===e||e.setClip(this._polarClip)),t.resize(2*n,2*n),t.layout()})),this._seriesViews.forEach((t=>{t.afterLayout()})),this._xAxisContainer.visible&&this._xAxisView.layout(s.chart.yAxis,i,r,n),this._yAxisViews.forEach((t=>{t.layout(s.chart.xAxis,i,r,n)})),[this._guideContainer,this._frontGuideContainer].forEach((t=>{t._views.forEach((t=>t.visible&&t.layout(this.width,this.height,s.getPolar(t.model.axis))))})),this._layoutAnnotations(!1,this,t,e)}_prepareAxes(t,e,s,i,r){if(!this._xAxisContainer){const e=this._image;this.insertAfter(this._xAxisLabelContainer=new ee(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),e),this.insertAfter(this._yAxisLabelContainer=new ee(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),e),this.insertAfter(this._lineContainer=new ee(t,"rct_axis-lines"),e),this.insertAfter(this._xAxisContainer=new ee(t,"rct-polar-axes"),e),this.insertAfter(this._yAxisContainer=new ee(t,"rct-polar-axes"),e)}const n=this._yAxisViews;for(;n.length<s.length;){const e=new qh(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>s.length;)n.pop().remove();n.forEach(((e,n)=>{e.setVis(!0),e.prepare(t,s[n],i,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)})),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new Zh(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class Qh extends Vo{constructor(t,e){super(t,e?Qh.SUBTITLE_CLASS:Qh.TITLE_CLASS,e?"rct-subtitle-background":"rct-title-background"),this.isSub=e,this.add(this._textView=new ue(t)),this._richText=new ve}_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),co(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}Qh.TITLE_CLASS="rct-title",Qh.SUBTITLE_CLASS="rct-subtitle";class Jh extends Jt{constructor(t){super(t,"rct-tooltip-row"),this.add(this._marker=new ne(t,"rct-tooltip-row-marker")),this.add(this._textView=new ue(t,"rct-tooltip-row-text")),this._textView.anchor=_e.START,this.add(this._detailView=new ue(t,"rct-tooltip-row-detail")),this._detailView.anchor=_e.START}layout(t,e,s,i,r){var n;const o=e.options,a=e.getMarkerSize(),h=e.getMarkerGap(),l=zs.getDrawer(o.listMarkerShape);this._marker.setPath(l(a/2)),this._marker.setFill((null===(n=i.legendColor)||void 0===n?void 0:n.call(i))||""),r[0]?(s.setFormat(r[0]),s.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a+h)):this._textView.text="",r[1]?(s.setFormat(r[1]),s.build(this._detailView,NaN,NaN,null,e.getTextDomain()),this._detailView.transX(a+h+this._textView.getBBox().width+y(e.options.listGap,4))):this._detailView.text=""}alignDetail(t){const e=this._marker.getBBox();this._detailView.transX(t-this._detailView.getBBox().width),this._marker.trans(e.width/2,this.r.height/2)}}class tl extends Jt{constructor(t){super(t,"rct-tooltip-list"),this.add(this._headerView=new ue(t)),this._headerView.anchor=_e.START,this.add(this._rowLayer=new ee(t,"")),this.add(this._footerView=new ue(t)),this._footerView.anchor=_e.START,this._rows=new ho(this._rowLayer,Jh)}layout(t,e,s,i){const r=this._headerView,n=this._footerView,o=y(e.options.listRowGap,4),a=e.getMarkerSize()+e.getMarkerGap();let h=0,l=0;r.setVis(!!i.header)&&(s.setFormat(i.header),s.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,h),h+=r.getBBox().height+o),this._rows.prepare(i.items.length).forEach(((r,n)=>{r.trans(0,h),r.layout(t,e,s,i.items[n],i.rows[n]),h+=r.getBBox().height+o,l=r._width=m(l,(r.r=r.getBBox()).width)})),n.setVis(!!i.footer)&&(s.setFormat(i.footer),s.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,h)),this._rows.forEach((t=>{t.alignDetail(l)}))}}class el extends Jt{constructor(t){super(t,el.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new ne(t,"rct-tooltip-back")),this.add(this._top=new ne(t,"rct-tooltip-top")),this.add(this._textView=new ue(t,"rct-tooltip-text")),this.add(this._listView=new tl(t)),this._back.setAttr("filter","url(#"+Qt.SHADOW_FILTER+")"),this._textView.anchor=_e.START,this._richText=new ve,this.close(!0,!1)}show(t,e,s,r,n,o,a){const h=s.point,l=this._model=t.chart._tooltip,_=l.setTarget(t,h,r&&r.map((t=>t.point)));if(!_)return;const c=l.options,d=_.isGroupTooltip();let u,p=this._list;if(d){p.header=p.footer="",p.items=[],p.rows=[];const e=_.getTooltipText(t,h,p);if(0===p.rows.length){if(u=i(e)?e.join(" "):e,!u||!u.trim())return;p.rows=p.items.map((()=>[u,""]))}}else{const e=c.text||_.getTooltipText(t,h,null);if(u=i(e)?e.join(" "):e,!u||!u.trim())return}this.setStyleOrClass(l._style);const f=e.contentWidth(),y=e.contentHeight(),x=this._listView,b=this._textView,w=l.getHeaderHeight(),v=l.getTailSize(),V=t.chart.isInverted(),S=t._yAxisObj;let A,P,k,C=S.options.reversed;t instanceof qi&&t.getBaseValue(S)>s.point.yValue&&(C=!C),d?(x.setVis(!0),b.setVis(!1),x.layout(e.doc(),l,this._richText,this._list),A=x.getBBox()):(x.setVis(!1),b.setVis(!0),this._richText.setFormat(u),this._richText.build(b,NaN,NaN,null,l.getTextDomain()),A=b.getBBox()),P=m(c.minWidth||0,A.width+16),k=m(c.minHeight||0,A.height+12)+w;let N=t._calcedColor;t instanceof Yi?(t.options.legendByPoint||t._colorByPoint())&&(N=h._calcedColor):t._colorByPoint()&&(N=getComputedStyle(s.dom).fill),this._top.setFill(N);const L=this.isVisible()?300:0,M=c.offset+v,E=a.getFocusPointView().getBounds(),B=e.getBounds();let T,O,D=!1;const R=l.isFollowPointer(t);if(V&&!t.isWidget)T=o-k/2-m(0,g(o-k/2,y-k)),D=R?C?P+M>n:n+P+M>f:C?P+M>E.x-B.x+E.width:E.x-B.x-M>f-P,D&&(C=!C),O=C?"left":"right",this.$_drawTooltip(0,0,P,k,O,T),C?n-=P+M:n+=M,o-=k/2;else{T=n-P/2-m(0,g(n-P/2,f-P));const t=R?o-e.getRootDistance().y:E.y-B.y-e._padding.top,s=R?y-o:B.bottom-E.bottom;if(t>=k+M||s>=k+M){(C?s>=k+M:t>=k+M)?O=C?"bottom":"top":(O=C?"top":"bottom",C=!C),this.$_drawTooltip(0,0,P,k,O,T),n-=P/2,C?o+=M:o-=k+M}else{T=o-k/2-m(0,g(o-k/2,y-k));const t=E.x-B.x;O=f-t>=P+M||t<P+M?"right":"left",this.$_drawTooltip(0,0,P,k,O,T),"right"===O?n+=M:n-=P+M,o-=k/2}}return n=m(0,g(n,f-P)),o=m(0,g(o,y-k)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(m(0,n-20),m(0,o-20)),this.transEx(n,o,L/2,!1)):this.transEx(n,o,L,!1),0===L&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:n,y:o,w:P,h:k}}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:cr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Xt(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}$_drawTooltip(t,e,s,i,r,n){const o=this._model,a=o.getTailSize(),h=o.getBorderRadius(),l=o.getHeaderHeight();let _=["M",t+h,e,"L",t+s-h,e,"Q",t+s,e,t+s,e+h,"L",t+s,e+i-h,"Q",t+s,e+i,t+s-h,e+i,"L",t+h,e+i,"Q",t,e+i,t,e+i-h,"L",t,e+h,"Q",t,e,t+h,e];if(a>0)switch(r){case"top":_=_.concat(["M",t+s/2-a/2+n,e+i,"L",t+s/2+n,e+i+a,"L",t+s/2+a/2+n,e+i]);break;case"bottom":_=_.concat(["M",t+s/2-a/2+n,e,"L",t+s/2+n,e-a,"L",t+s/2+a/2+n,e]);break;case"left":_=_.concat(["M",t+s,e+i/2-a/2+n,"L",t+s+a,e+i/2+n,"L",t+s,e+i/2+a/2+n]);break;case"right":_=_.concat(["M",t,e+i/2-a/2+n,"L",t-a,e+i/2+n,"L",t,e+i/2+a/2+n])}const c="bottom"===r,d=c?["M",t,e+i-l,"l",s,0,"l",0,l-h,"q",0,h,-h,h,"l",2*h-s,0,"q",-h,0,-h,-h]:["M",t+h,e,"l",s-2*h,0,"q",h,0,h,h,"l",0,l-h,"l",-s,0,"l",0,h-l,"q",0,-h,h,-h],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(s-p.width)/2,e+=(i-p.height+(c?-l:l))/2,u.trans(t,e),this._top.setPath(l>0?d:""),this._back.setPath(_)}}el.CLASS_NAME="rct-tooltip";class sl extends te{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new el(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,s,i,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,s,i,r,n),a=this.control.getRootDistance();this.setBounds(a.x,a.y,o.w,o.h)}close(t,e){this.setVisibility(!1),this._tooltipView.close(t,e)}}class il extends lt{static isButton(t){return t.classList.contains("rct-html-button")}constructor(t){super(),this._dom=this.$_initDom(t)}_doDestroy(){this._dom.remove(),this._dom=null,super._doDestroy()}get dom(){return this._dom}setVisible(t){return this._dom.style.display=t?"":"none",t}setModel(t){const e=this._dom,s=$t.isHoverAt(e),i=(this._model=t).options;return $t.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(i.width)?i.autoWidth?e.style.width="max-content":e.style.width="":e.style.width=I(i.width),isNaN(i.height)?e.style.height="":e.style.height=I(i.height),"custom"===i.hintMode?(i.hint?e.dataset.hint=i.hint:delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=i.hint||""),i.imageUrl?$t.setStyles(this._img,{display:"",width:F(i.imageWidth),height:F(i.imageHeight)}):$t.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(ot?this._hovered:s),this._span.textContent=i.text||"",this}layout(t){const e=this._dom,s=e.style,i=this._model.options,r=i.align,n=i.verticalAlign;s.left=F("left"===r?t.x+(i.offsetX||0):"right"===r?t.x+t.width-e.offsetWidth-(i.offsetX||0):t.x+(t.width-e.offsetWidth)/2+(i.offsetX||0)),s.top=F("top"===n?t.y+(i.offsetY||0):"bottom"===n?t.y+t.height-e.offsetHeight-(i.offsetY||0):t.y+(t.height-e.offsetHeight)/2+(i.offsetY||0))}pointerEnter(){this._hovered=!0,this.$_setImage(!0)}pointerLeave(){this._hovered=!1,this.$_setImage(!1)}click(){this._model.click()}$_initDom(t){const e=t.createElement("button"),s=t.createElement("div");return e.className="rct-html-button",$t.setStyles(e,{position:"absolute",textAlign:"center"}),$t.setStyles(s,{display:ot?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(s),this._img=t.createElement("span"),this._img.className="rct-html-button-image",$t.setStyles(this._img,{backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center",pointerEvents:"none"}),s.appendChild(this._img),this._span=t.createElement("span"),$t.setStyles(this._span,{whiteSpace:"pre-line",pointerEvents:"none",textAlign:"center",padding:"2px"}),ot&&$t.setStyles(this._span,{wordWrap:"break-word",overflowWrap:"break-word",maxWidth:"100%"}),s.appendChild(this._span),e}$_setImage(t){const e=this._model.options;e.imageUrl?t&&"image"===this._model.getHoverEffect()?this._img.style.backgroundImage=`url(${e.hoverImageUrl||e.imageUrl})`:this._img.style.backgroundImage=`url(${e.imageUrl})`:this._img.style.backgroundImage=""}}class rl extends So{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Qh(t,!1)),this.add(this.subtitleView=new Qh(t,!0))}_doMeasure(t,e,s,i,r){const n=e._title,o=e._subtitle;let a,h=0,l=0,_=0,c=0,d=this.titleView,u=s,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,s,i,r),l=this._hTitle=a.height,h=this._wTitle=a.width):d.setModel(n),(d=this.subtitleView).setVis(o.visible)?(a=d.measure(t,o,s,i,r),c=this._hSub=a.height,_=this._wSub=a.width,g=+o.options.titleGap||0):d.setModel(o),o.options.position){case"leftSide":case"left":case"rightSide":case"right":p=m(l,c),u=h+g+_;break;default:p=l+g+c,u=m(u,h+_)}return p>0&&(p+=this.titleView.visible?y(n.options.gap,0):y(o.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,n=i&&i.options,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=m(this._hTitle,this._hSub);g=m(g,g+t(i,e,this._hTitle)),x=m(x,x+t(r,e,this._hSub))},d=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(f=m(f,f+d(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":b=f;break;case"right":b=f+this._wTitle-this._wSub;break;default:b=f+(this._wTitle-this._wSub)/2}else b=m(b,b+d(r,h,this._wSub))},p=y(o.titleGap,0);let g=0,f=l,x=0,b=_;switch(n.align){case"left":switch(o.position){case"leftSide":case"left":f=b+this._wSub+p,c();break;case"rightSide":b=f+this._wTitle+p,c();break;case"right":switch(b=f+this._wTitle+p,o.align){case"center":b=m(b,b+(h-this._wTitle-this._wSub)/2);break;case"right":b=m(b,_+h-this._wSub)}c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}break;case"right":switch(o.position){case"leftSide":f+=a-this._wTitle,b=f-p-this._wSub,c();break;case"left":switch(f+=a-this._wTitle,o.align){case"center":b+=(a-this._wTitle-this._wSub)/2;break;case"right":b=f-p-this._wSub}c();break;case"rightSide":case"right":b+=h-this._wSub,f=b-p-this._wTitle,c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}break;default:switch(o.position){case"leftSide":f+=(a-this._wTitle)/2,b=f-this._wSub-p,c();break;case"left":switch(f+=(a-this._wTitle)/2,o.align){case"left":break;case"center":b+=(f-b-this._wSub)/2;break;case"right":b=f-this._wSub-p}c();break;case"rightSide":f+=(a-this._wTitle)/2,b=f+this._wTitle+p,c();break;case"right":switch(f+=(a-this._wTitle)/2,o.align){case"left":b=f+this._wTitle+p;break;case"center":b+=f+this._wTitle+p,b+=(h-b-this._wSub)/2;break;case"right":b+=h-p-this._wSub}c();break;case"top":u(),g=x+this._hSub+p;break;default:u(),x=g+this._hTitle+p}}const w=y(n.offset,0),v=y(o.offset,0);0!==w&&(f+="right"===n.align?-w:w,"leftSide"!==o.position&&"rightSide"!==o.position||(b+="right"===n.align?-w:w)),0!==v&&"leftSide"!==o.position&&"rightSide"!==o.position&&(b+="right"===o.align?-v:v),e.resizeByMeasured().layout().trans(f,g),s.resizeByMeasured().layout().trans(b,x)}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 d=a?l:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=o-c;break;default:d+=(o-c)/2}n.trans(d,0)}}}class nl extends So{_doInitChildren(t){this.add(this._legendView=new Yh(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 ol extends So{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,s,i,r,n){const o=this.views;let a;for(o.length;o.length<i.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>i.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach(((t,e)=>{t.prepare(i[e])})),this.setVis(o.length>0)){const t=o[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()))}_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=m(n,l),o=m(o,_)}})),{width:n,height:o}}_doLayout(t){const e=this.control,s=e.loaded,i=[];let r=this.width,n=this.height,o=0,a=0;t=+t||0,[this.views].forEach((e=>{if(e){let h=0;e.forEach((t=>{if(t.visible){const e=t.checkExtents(s);e&&i.push(e),this.isHorz?(t.resize(r,t.mh),t.model._calcPoints(this.width,999)):(t.model._calcPoints(this.height,999),t.resize(t.mw,n)),t.layout(),this.isHorz?(t.trans(o,this.dir===ro.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===ro.RIGHT?h:r-h-t.mw,a),h+=t.mw+this._gap)}})),this.isHorz?o+=r+t:a+=n+t}}));const h=i.length>0&&e.chart.body.options.zoomCallback;h&&Promise.resolve().then((()=>{i.forEach((({axis:t,from:e,to:s})=>{h({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof wi?Math.floor(e):e,to:t instanceof wi?Math.floor(s):s})}))}))}}class al extends vo{constructor(t){super(t,"rct-credits"),this.add(this._textView=new ue(t)),this._textView.anchor=_e.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 hl extends ee{}class ll extends ee{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._htmlButtons=[],this.add(this._annotationContainer=new ee(t,"rct-annotations")),this.add(this._plotContainer=new ee(t,"rct-plot-container")),this._plotContainer.add(this._currBody=this._bodyView=new Oh(t,this));for(const e in ro){const s=new ol(t,ro[e]);this._plotContainer.add(s),this._axisSectionMap[ro[e]]=s}ll.pane_class&&this.add(this._paneContainer=new ll.pane_class(t,this)),this.add(this._titleSectionView=new rl(t)),this.add(this._legendSectionView=new nl(t)),this.add(this._frontAnnotationContainer=new ee(t,"rct-front-annotations")),this.add(this._creditView=new al(t)),this.add(this._navigatorView=new Rh(t)),this.add(this._historyView=new jh(t))}_doDestroy(){var t;this._htmlTooltipView=null===(t=this._htmlTooltipView)||void 0===t?void 0:t.destroy(),super._doDestroy()}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._credits,c=h._legend,d=h._navigator;let u,p=s,g=i;if(e._width=s,e._height=i,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)&&(u=this._creditView.measure(t,_,p,g,r),_.isFloating()||("middle"!==_.options.verticalAlign?g-=u.height+(+_.options.offsetY||0)+(+_.options.gap||0):"center"!==_.options.align&&(p-=u.width+(+_.options.offsetX||0)+(+_.options.gap||0)))),u=this._titleSectionView.measure(t,h,p,g,r),g-=u.height,this._legendSectionView.setVis(c.visible))switch(u=this._legendSectionView.measure(t,h,p,g,r),c._location){case"top":case"bottom":g-=u.height;break;case"right":case"left":p-=u.width}if(this._navigatorView.setVis(d.visible),null===(a=this._paneContainer)||void 0===a?void 0:a.visible)this._paneContainer.measure(t,h._split,p,g,1);else{if(this._navigatorView.visible){const t=h._navigator;t._vertical?p-=t.getSize():g-=t.getSize()}l?this.$_measurePolar(t,h,p,g,1):this.$_measurePlot(t,h,p,g,1)}if(this._navigatorView.visible){const e=l?this._polarView:this._bodyView;h._navigator._vertical?g=e.mh:p=e.mw,this._navigatorView.measure(t,d,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._credits,_=l.options,c=+_.gap||0,d=this._bodyView._depthExt;let u=0,p=0,g=0,m=0,f=0,y=0,x=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=g=h.height+u+c:r-=m=h.height+u+c):(p=+_.offsetX||0,"left"===_.align?i-=f=h.width+p+c:i-=y=h.width+p+c)));const w=this._titleSectionView;let v=0;const V=b+g;w.visible&&(w.resizeByMeasured(),r-=v=w.height),x=f,b=s-m;const S=this._navigatorView;let A=0;S.visible&&(S.model._vertical||(S.resize(S.mw,S.mh-S.model.getGap()-S.model.getGapFar()),r-=A=S.mh));const P=this._legendSectionView;let k,C,N=0,L=0;if(P.visible)switch(P.resizeByMeasured().layout(),N=P.height,L=P.width,a._location){case"top":k=v+g,r-=N;break;case"bottom":r-=N,k=b-N,b-=N;break;case"right":i-=L,C=e-L;break;case"left":i-=L,x+=L,C=0}S.visible&&(b-=A,S.layout().transY(b+S.model.getGap()));let M,E=0,B=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(x,V+v).resize(i,r),this._paneContainer.layout(),E=r,B=i,M=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([ro.LEFT,ro.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[ro.TOP,ro.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[ro.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),x+=e.mw),(e=t[ro.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[ro.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0),b-=e.mh),(e=t[ro.TOP])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0))),S.visible&&S.layout().transX(x);const s={x:x,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[ro.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[ro.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[ro.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[ro.TOP])&&e.visible&&e.trans(s.x,s.y-r-e.height));const n=this._currBody;E=this._plotHeight-0,B=this._plotWidth-0,x=s.x,b=s.y-this._plotHeight,n.resize(B,E),n.trans(x,b),n.layout(),M=n.getRect(),n._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=m>0?s-m+c:s-h.height-u}switch(_.align){case"left":t=p;break;case"center":t=(e-h.width)/2+p;break;default:t=y>0?e-y+c:e-h.width-p}h.trans(t,i)}if(B+=0,w.visible&&w.layout({xPlot:x,wPlot:B,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":x+=B-L-e;break;case"center":x+=(B-L)/2+e;break;default:x+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=E-N-e;break;case"middle":b+=(E-N)/2+e;break;default:b+=e}}else if(isNaN(k)){const e=+t.offsetY||0;if(x=C,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=s-N-e;break;default:b=(s-N)/2+e}b+N>s&&(b=(s-N)/2)}else switch(o){case"top":b+=e;break;case"bottom":b=b+r-N-e;break;default:b=b+(r-N)/2+e}b+N>s&&(b=(s-N)/2),b<0&&(b=0)}else{const s=+t.offsetX||0;if(b=k,"chart"===t.alignBase)switch(n){case"left":x=s;break;case"right":x=e-L-s;break;default:x=(e-L)/2+s}else switch(n){case"left":x+=s;break;case"right":x=x+i-L-s;break;default:x+=(i-L)/2+s}x+L>e&&(x=(e-L)/2),x<0&&(x=0)}P.trans(x,b)}this.$_layoutHtmlButtons(e,s),this.$_layoutAnnotations(this._inverted,e,s,M),this.hideTooltip()}showTooltip(t,e,s,i,r){var n;const o=this.control,a=this._model.chart._tooltip,h=a.isFollowPointer(t),{x:l,y:_}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},c=i.getTooltipPos(),d=h?r.x+c.x:l+c.x,u=h?r.y+c.y:_+c.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new sl(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,s,d,u,i)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new el(this.doc)),this._tooltipView.show(t,o,e,s,d,u,i))}tooltipVisible(){var t,e;return this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t?void 0:t.hasVisibility():null===(e=this._tooltipView)||void 0===e?void 0:e.isVisible()}hideTooltip(t=!0){var e,s;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(s=this._tooltipView)||void 0===s||s.close(!1,t)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new Oo(t)}legendByDom(t){let e=this._legendSectionView._legendView.legendByDom(t);return!e&&this._model.isSplitted()&&(e=this._paneContainer.legendByDom(t)),e}seriesByDom(t){var e;return(null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.seriesByDom(t):this._currBody.seriesByDom(t)}annotationByDom(t){var e;let s=this._annotationViews.find((e=>e.dom.contains(t)));return s||((null===(e=this._paneContainer)||void 0===e?void 0:e.visible)?this._paneContainer.annotationByDom(t):this._currBody.annotationByDom(t))}htmlButtonByDom(t){return this._htmlButtons.find((e=>e.dom.contains(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,r;const n=s,o=this._model&&this.bodyOf(s),a=null==n?void 0:n.classList,h=(null==a?void 0:a.value)&&(a.contains("rct-contextmenu-item")||a.contains("rct-contextmenu-list"));let l=this._hoverItem;if(this._hoverItem=null,(null===(i=this._model)||void 0===i?void 0:i.isSplitted())&&this._paneContainer.bodies.forEach((t=>{t!==o&&t.clearHover()})),o){const i=o.controlToElement(t,e),r=o.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(n)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(n);if(t){const e=t.legend;at.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof $i?o.hoverSeries(t):e.options.pointHovering&&t instanceof pi&&o.hoverPoint(t)}))}}if(l instanceof Ds&&!(this._hoverItem instanceof Ds)&&(o.hoverPoint(null),o.hoverSeries(null)),this.$_handleAnnotationHover(s),!r)return void o.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,n=e._isHorz?o.width:o.height,a=e._isHorz?i.x:i.y,l=r&&s.visible&&!h&&s.flag.visible&&!s.isBar()&&s.getFlag(n,a);if(l){t.showCrosshair(a,l);const r=[];o._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 tn&&!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(a,l,r)}else t.hideCrosshiar()}))}else(null===(r=this._model)||void 0===r?void 0:r.isSplitted())?this._paneContainer.bodies.forEach((t=>{t.removeFocus()})):this._currBody.removeFocus(),this.$_handleAnnotationHover(s)}pointerLeaved(t,e,s){this.$_clearAnnotationHover()}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 ro){const s=this._axisSectionMap[ro[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))}_doAttached(t){}$_preparePanes(t,e){this._paneContainer.prepare(t,e)}$_prepareBody(t,e){var s,i;e?(this._polarView||(this._polarView=new Kh(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._body,e)}$_prepareHtmlButtons(t){const e=this._model._getButtons(),s=[];e._internalItems().forEach(((e,i)=>{let r=this._htmlButtons[i];r||(r=new il(t),this.control.appendDom(r.dom),this._htmlButtons[i]=r),s.push(r)}));for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].destroy();this._htmlButtons=s}$_layoutHtmlButtons(t,e){const s=this.control._padding,i=this._htmlButtons;if(i.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:s.left,y:s.top,width:t,height:e},o=this._model._getButtons()._internalItems();i.forEach(((t,e)=>{const s=o[e];t.setVisible(s.visible)&&t.setModel(s).layout(s.isChartScope()?n:r)}))}}$_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,this,e,e.getAxes(s,!0),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,o=s,a=i;let h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(l,_,this._inverted,r),s-=n[ro.LEFT].checkWidths(t,s,i),s-=n[ro.RIGHT].checkWidths(t,s,i),i-=n[ro.BOTTOM].checkHeights(t,s,i),i-=n[ro.TOP].checkHeights(t,s,i),h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r);for(const s in n){const i=n[s];i.visible&&i.measure(t,e,l,_,r)}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===ro.LEFT||t===ro.RIGHT?s-=e.mw:t!==ro.BOTTOM&&t!==ro.TOP||(i-=e.mh))}r++,h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.layoutAxes(l,_,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const s in n){const i=n[s];i.visible&&(i.measure(t,e,l,_,r),i.prepareGridRows(t,this._bodyView._gridRowContainer))}s=o,i=a;for(const t in n){const e=n[t];e.visible&&(t===ro.LEFT||t===ro.RIGHT?s-=e.mw:t!==ro.BOTTOM&&t!==ro.TOP||(i-=e.mh))}h=this._bodyView.checkDepth(e,s,i),l=s-(h?h.base:0),_=i-(h?h.side:0),e.axesLayouted(l,_,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.get(t).remove(),r.delete(t));n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||bh(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)}))}$_handleAnnotationHover(t){var e,s;if(!t)return;const i=this.htmlButtonByDom(t);if(i!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=i,void(null===(s=this._hoverButton)||void 0===s||s.pointerEnter());const r=this.annotationByDom(t),n=this._hoverAnnotation;r!==n&&(null==n||n.pointerLeave(),null==r||r.pointerEnter())}$_clearAnnotationHover(){this._hoverButton&&(this._hoverButton.pointerLeave(),this._hoverButton=null),this._hoverAnnotation&&(this._hoverAnnotation.pointerLeave(),this._hoverAnnotation=null)}}var _l;!function(t){t.EXPORT="$$realchart_export"}(_l||(_l={}));class cl extends Qt{constructor(t,e){super(t,e),this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new oo(null,((t,e)=>{this.$_changeModel(t,e)}))}_createChartView(t){return new ll(t)}_createPointerHandler(){return new Gh(this)}_doDestroy(){this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,s){e instanceof ze&&s===Oe.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 instanceof oo&&t!==this._chart&&(this.$_changeModel(t._obj,this.model),this._chart=t)}get model(){return this._chart._obj}$_changeModel(t,e){t!==e&&(this.clearAssetDefs(),this.clearClipDefs(),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===_l.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}_canOverflowRender(){return!1}_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.setResizeDelay(i.resizeDelay),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,i,r){if(this.model){const i=this.model._chartOptions._style;if(s(i))for(const s in i)s.startsWith("padding")?e.setStyle(s,i[s]):t.style[s]=i[s]}}_loadModules(){if(!this.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._exporter.options)}}}class dl{static getVersion(){return It.version}static setLicenseKey(t){It.code=t}static setLocale(t,e){e&&C(t,e),(t=>{t&&(k=A[P=t.substring(0,2)]),k||(k=A[P="ko"])})(t)}static registerLocale(t,e){C(t,e)}static setDebugging(t){Jt.DEBUGGING=t}static setLogging(t){at.LOGGING=t}static setAnimatable(t){Qt._animatable=t}static configure(t){return t}static createChart(t,e,i,r=!0,n){const o=new cl(t,e);return o.chart.load(s(i)?i:{},r,n),o.chart[to]=o,o.chart}static createData(t,e){return new ao(t||{},e)}}class ul{static empty(){return new ul}static create(t=0,e=0){return new ul(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}const pl="bullet",gl="bulletgroup",ml="circle",fl="circlegroup",yl="clock",xl="linear",bl="lineargroup";class wl{static empty(){return new wl}static create(t=0,e=0){return new wl(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const vl=dl.getVersion,Vl=dl.setDebugging,Sl=dl.setLogging,Al=dl.setAnimatable,Pl=dl.configure,kl=dl.createChart,Cl=dl.createData,Nl=dl.setLicenseKey;export{ze as Annotation,Ho as AnnotationView,$o as ArcElement,sn as AreaRangeSeries,Ra as AreaRangeSeriesView,Jr as AreaSeries,nn as AreaSeriesGroup,$a as AreaSeriesView,Le as AssetCollection,hs as Axis,Vr as AxisBaseLine,ls as AxisCollection,Qe as AxisGrid,We as AxisItem,rs as AxisLabel,Ue as AxisLine,ns as AxisScrollBar,Bo as AxisScrollView,as as AxisSectorLine,is as AxisTick,Ze as AxisTitle,Oo as AxisView,Tr as BarRangeSeries,Fa as BarRangeSeriesView,Rr as BarSeries,Dr as BarSeriesBase,Fr as BarSeriesGroup,$r as BarSeriesGroupBase,Or as BarSeriesPoint,Ha as BarSeriesView,za as BarSeriesViewBase,qi as BasedSeries,Va as BasedSeriesView,an as BellCurveSeries,Ga as BellCurveSeriesView,Ts as Body,Bs as BodyDepth,Oh as BodyView,ln as BoxPlotSeries,Xa as BoxPlotSeriesView,ya as BoxPointElementEx,cn as BubbleSeries,Wa as BubbleSeriesView,gl as BulletGaugeGroupType,pl as BulletGaugeType,dn as BumpSeriesGroup,pn as CandlestickSeries,Za as CandlestickSeriesView,wi as CategoryAxis,bi as CategoryAxisGrid,xi as CategoryAxisLabel,yi as CategoryAxisTick,oo as Chart,cl as ChartControl,ao as ChartData,ut as ChartDataCollection,vo as ChartElement,Oe as ChartItem,no as ChartObject,io as ChartOptions,Gh as ChartPointerHandler,Re as ChartText,ll as ChartView,gn as CircelBarPointLabel,mn as CircleBarSeries,fn as CircleBarSeriesGroup,Ka as CircleBarSeriesView,Ro as CircleElement,fl as CircleGaugeGroupType,ml as CircleGaugeType,ks as CircularGauge,Cs as CircularGaugeGroup,As as CircularGaugeLabel,yl as ClockGaugeType,Ui as ClusterableSeries,er as ClusterableSeriesGroup,Rt as Color,Ii as ConnectableSeries,tr as ConstraintSeriesGroup,Ao as ContentView,Sr as ContinuousAxis,eo as Credits,Xe as Crosshair,pi as DataPoint,gi as DataPointCollection,Mi as DataPointLabel,$t as Dom,bn as DumbbellSeries,Ja as DumbbellSeriesView,ho as ElementPool,vn as EqualizerSeries,eh as EqualizerSeriesView,Vn as ErrorBarSeries,ih as ErrorBarSeriesView,Os as Exporter,kn as FunnelSeries,nh as FunnelSeriesView,gs as Gauge,us as GaugeBase,ms as GaugeGroup,Zo as GaugeGroupView,ps as GaugeItem,Ss as GaugeLabel,Vs as GaugeRangeBand,vs as GaugeRangeLabel,ws as GaugeScale,jo as GaugeView,si as HeatmapSeriesType,Ln as HistogramSeries,ah as HistogramSeriesView,$e as IconedText,gr as ImageAnnotation,Na as ImageAnnotationView,Po as ImageElement,ee as LayerElement,Rs as Legend,Ds as LegendItem,Xh as LegendItemView,Yh as LegendView,Gr as LineElement,Wr as LinePointLabel,qr as LineSeries,Ur as LineSeriesBase,Oa as LineSeriesBaseView,rn as LineSeriesGroup,Xr as LineSeriesPoint,Da as LineSeriesView,Ar as LinearAxis,bl as LinearGaugeGroupType,xl as LinearGaugeType,Kn as LogAxis,Bn as LollipopSeries,lh as LollipopSeriesView,Qi as LowRangedSeries,sr as MarkerSeries,Aa as MarkerSeriesPointView,Pa as MarkerSeriesView,rr as NavigatorMask,ir as NavigiatorHandle,E as ORG_ANGLE,On as OhlcSeries,ch as OhlcSeriesView,Xi as OthersGroup,M as PI_2,hl as PaneContainer,Rn as ParetoSeries,dh as ParetoSeriesView,qt as PathBuilder,ne as PathElement,ni as PictogramSeriesType,oi as PictorialBarSeriesType,ai as PictorialSeriesType,Gn as PieSeries,jn as PieSeriesGroup,zn as PieSeriesLabel,In as PieSeriesText,mh as PieSeriesView,ul as Point,ga as PointElement,so as PointHovering,la as PointLabelLineContainer,ha as PointLabelLineView,oa as PointLabelView,Ea as PointViewPool,T as RAD_DEG,hi as RaceBarSeriesType,li as RaceLineSeriesType,Wi as RadialSeries,Ki as RangedSeries,Yt as RcAnimation,Qt as RcControl,Jt as RcElement,lt as RcObject,Hs as RectElement,t as SVGNS,Uo as ScaleView,Yn as ScatterSeries,yh as ScatterSeriesView,So as SectionView,Io as SectorElement,$i as Series,qo as SeriesAnimation,Ji as SeriesGroup,zi as SeriesMarker,hr as SeriesNavigator,pa as SeriesView,mr as ShapeAnnotation,La as ShapeAnnotationView,wl as Size,Kr as SplineSeries,_r as Subtitle,zs as SvgShapes,_e as TextAnchor,fr as TextAnnotation,Ma as TextAnnotationView,ue as TextElement,ce as TextLayout,Er as TimeAxis,lr as Title,cr as Tooltip,ei as TreemapSeriesType,vi as TrendLineArea,Vi as TrendLineLabel,Ai as Trendline,at as Utils,ys as ValueGauge,Yo as ValueGaugeView,ii as VectorSeriesType,Zn as WaterfallSeries,xh as WaterfallSeriesView,_s as Widget,Yi as WidgetSeries,Gi as WidgetSeriesConnector,ji as WidgetSeriesLabel,Hi as WidgetSeriesPoint,Ca as WidgetSeriesView,ri as WordCloudSeriesType,mi as ZValuePoint,f as absv,l as assignObj,tt as buildValueRanges,W as calcPercent,Pl as configure,v as copyObj,d as cos,kl as createChart,Cl as createData,_o as createRect,Ee as extend,D as fixnum,vl as getVersion,V as incv,i as isArray,uo as isEmptyRect,ot as isIE,a as isNumber,s as isObject,n as isString,m as maxv,g as minv,X as parsePercentSize,y as pickNum,b as pickProp,w as pickProp3,F as pixel,co as rectToSize,Al as setAnimatable,Vl as setDebugging,Nl as setLicenseKey,Sl as setLogging,u as sin,$ as toStr};
|