realchart 1.4.26 → 1.4.28

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart v1.4.26
3
+ * RealChart v1.4.28
4
4
  * Copyright (C) 2023-2026 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,(function(t){"use strict";const e="http://www.w3.org/2000/svg",s=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,n=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return"string"==typeof t&&t.length>0},h=function(t){return"number"==typeof t},l=function(t){return"boolean"==typeof t},_=function(t){return null==t||isNaN(t)},c=Object.assign,d=Math.floor,u=Math.ceil,p=Math.cos,g=Math.sin,f=Math.log10,m=Math.min,x=Math.max,y=Math.abs,b=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},w=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):i):i},v=function(t,e){return void 0!==t?t:e},S=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},V=(t,e,s)=>t+(e-t)*s,A=function(t){return"function"==typeof t?t:null},P={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let k="ko",C=P[k]||P[k="ko"];const L=(t,e)=>{t&&i(e)&&(C=P[t.substring(0,2)]=Object.assign(P.ko,P.en,e))},N=void 0,M=Math.PI,E=2*M,T=-M/2,B=2*M/360,O=360/M/2,R="%".charCodeAt(0);function D(t){return parseFloat(t.toPrecision(12))}function $(t){return Math.floor(1e6*t)/1e6}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 W(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)===R?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 X(t,e){return W(t,!0)||W(e,!1)}function Y(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,s,n=!0,a=!0,h=!1,l){let _,d;if(n&&(e=-Number.MAX_VALUE,s=Number.MAX_VALUE),r(t))_=[],t.forEach((t=>{if(i(t)&&o(t.color)){const i={fromValue:b(t.fromValue,d?d.toValue:e),toValue:b(t.toValue,s),color:t.color,style:t.style?c({},t.style):N};i.fromValue<i.toValue&&(_.push(i),d=i)}})),_=_.sort(((t,e)=>t.fromValue-e.fromValue)).filter((t=>t.toValue>=e&&t.fromValue<s)),a&&_.forEach((t=>{t.fromValue=x(t.fromValue,e),t.toValue=m(t.toValue,s)}));else if(i(t)&&r(t.colors)&&t.colors.length>0){const i=t.colors,n=r(t.styles)?t.styles:null;if(_=[],r(t.steps)&&t.steps.length>0){const o=r(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),s>o[o.length-1]&&o.push(s);for(let t=0;t<o.length-1;t++)_.push({fromValue:o[t],toValue:o[t+1],color:i[m(t,i.length-1)],style:n?n[m(t,n.length-1)]:N})}else{let r=b(t.fromValue,e);const o=b(t.toValue,s),a=(o-r)/i.length;let h=0;for(;r<o;)_.push({fromValue:r,toValue:r+=a,color:i[m(h,i.length-1)],style:n?n[m(h,n.length-1)]:N}),h++}}if(h&&_&&_.length>0){let t=0,i=e;for(;t<_.length;)_[t].fromValue>i&&_.splice(t,0,{fromValue:i,toValue:_[t].fromValue,color:l}),i=_[t].toValue,t++;_[t-1].toValue<s&&_.push({fromValue:_[t-1].toValue,toValue:s,color:l})}return _},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(m(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&&!r(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!r(t))return c({},t)}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(r(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return r(t)?t:null!=t?[t]:null}static copyArray(t){return r(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-nt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=x(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=x(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(r(t)){const e=[];let s=-1/0;return t.forEach(((i,n)=>{r(i)?!isNaN(i[0])&&!isNaN(i[1])&&i[0]>s&&(e.push([+i[0],+i[1]]),s=i[0]):isNaN(i)||n!==t.length-1||e.push([1/0,+i])})),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=r(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 x(e,m(s,t))}static makeIntArray(t,e){const s=new Array(x(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=y(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=y(t-e);return m(s,E-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||{}),r(e)&&e.forEach((t=>this._rows.push(this.$_readRow(t))))}$_buildOptions(t){const e=t.fields;let s;s=r(e)?e.slice():o(e)?[e]:["x","y","z"],this._fields=s,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<s.length;t++)this._fieldMap[s[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(r(t))for(let s=0;s<this._fields.length;s++)e[this._fields[s]]=t[s];else 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 i;r(s)?i=new dt({},s):ct(s)&&r(s.values)&&(i=new dt(s.options,s.values)),this._map[e]=i}}}const pt="0".charCodeAt(0),gt="#".charCodeAt(0),ft=",".charCodeAt(0),mt="s".charCodeAt(0),xt="a".charCodeAt(0);class yt{static getFormatter(t){let e=yt.Formatters[t];return e||(yt.Formatters[t]=e=new yt(t)),e}static get Default(){return yt.getFormatter(yt.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1},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--)===ft){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===mt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===xt){s.signDisplay="never";break}}return s.minimumIntegerDigits=x(1,s.minimumIntegerDigits),s}}}yt.DEFAULT_FORMAT="",yt.Formatters={};const bt=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],wt=[".","/","-",":"],vt="Z".charCodeAt(0),St="z".charCodeAt(0),Vt="A".charCodeAt(0),At="a".charCodeAt(0),Pt="y".charCodeAt(0),kt="M".charCodeAt(0),Ct="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 kt: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 Ct: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(t,s){const i=t.createElementNS(e,"clipPath");return i.id=s,i.append(t.createElementNS(e,"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(t){return $t.isElement(t)&&t.namespaceURI===e}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.26",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=>-(p(M*t)-1)/2},Wt=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 Xt{constructor(){this.delay=0,this.duration=Xt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,s=t-this._started-this.delay;let i=m(1,x(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=b(t,Xt.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}}Xt.DURATION=700,Xt.SHORT_DURATION=300;class Yt extends Xt{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 Yt(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=>{h(t)||o(t)?this._path.push(t):this._path.push(t.x,t.y)})),this}move(t,e){return h(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return h(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return h(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,s){return t?this._path.push("L",e,s):this._path.push("M",e,s),this}vline(t,e,s){return this._path.push("M",t,e,"L",t,s),this}hline(t,e,s){return this._path.push("M",e,t,"L",s,t),this}curve(t,e,s,i,r,n){return this._path.push("C",t,e,s,i,r,n),this}quad(t,e,s,i){return h(t)?this._path.push("Q",t,e,s,i):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0,"Z"),this}lines(...t){if(h(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 h(t[0])?this.move(t[0],t[1]).lines(...t.slice(2)):this.move(t[0]).lines(...t.slice(1)),this._path.push("Z"),this}circle(t,e,s){return this._path.push(`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${2*-s} 0`),this}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,f=t[i].py+n.y;this.curve(s,p,g,f,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(e,"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(o(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(t,s,i){if(this._inited)return;const r=t.defaultView;s instanceof r.HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof r.HTMLDivElement||J(C.invalidOuterDiv,s),t=this._container.ownerDocument;const n=this._dom=t.createElement("div");c(n.style,Kt),n.className=i,this._container.appendChild(n);const o=this._svg=t.createElementNS(e,"svg");o.classList.add("rct-svg"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=t.createElement("desc");a.textContent="Created by RealChart v"+It.version,o.appendChild(a);const h=this._defs=t.createElementNS(e,"defs");this._initDefs(t,h),o.appendChild(h),n.appendChild(o),this._root=new se(this),o.appendChild(this._root._dom),this._htmlRoot=t.createElement("div"),n.appendChild(this._htmlRoot),c(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=t.createElement("div"),n.appendChild(this._tester),ot&&(this._canvas=t.createElement("canvas"))}_initDefs(t,s){let i=t.createElementNS(e,"filter");i.setAttribute("id",Qt.SHADOW_FILTER);const r=t.createElementNS(e,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),i.appendChild(r);const n=t.createElementNS(e,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),i.appendChild(n);const o=t.createElementNS(e,"feFlood");o.setAttribute("flood-color","#000"),i.appendChild(o);const a=t.createElementNS(e,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),i.appendChild(a);const h=t.createElementNS(e,"feMerge"),l=t.createElementNS(e,"feMergeNode"),_=t.createElementNS(e,"feMergeNode");_.setAttribute("in","SourceGraphic"),h.appendChild(l),h.appendChild(_),i.appendChild(h),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}_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)),c(this._htmlRoot.style,{left:F(e.left-t.left),top:F(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),c(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(t,s,i=N){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(e,i||"g"),(this._styleName=s||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get 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(t,s){const i=t.createElementNS(e,s);return this._dom.appendChild(i),i}insertElement(t,s,i){const r=t.createElementNS(e,s);return this._dom.insertBefore(r,i),r}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}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 Yt||!!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(o(t))t&&this._dom.classList.add(t);else if(i(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){o(t)?(this._resetClass(),t&&this.addClass(t)):i(t)&&this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?t&&this.addClass(t):i(t)&&this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this.addClass(t):i(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,v(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}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=x(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:b(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=x(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:b(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(t,s,i=!1){super(),this._control=s,this._dom=t.createElement("div"),i&&(this._svg=t.createElementNS(e,"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=o(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;t.TextAnchor=void 0,(_e=t.TextAnchor||(t.TextAnchor={})).START="start",_e.MIDDLE="middle",_e.END="end",t.TextLayout=void 0,(ce=t.TextLayout||(t.TextLayout={})).TOP="top",ce.MIDDLE="middle",ce.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(de||(de={}));class ue extends Jt{constructor(e,s=void 0){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._overflow=de.WRAP,this._dirty=!0,this._text="",this.anchor=t.TextAnchor.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(e){const s=this.getBBox(),i=this.getAscent(isNaN(e)?s.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(i/2);break;case t.TextLayout.BOTTOM:r=0;break;default:r=Math.ceil(i)}this.y=r}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=x(0,t),(e=m(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,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 fe{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let n=e.callback(t,s[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=s[3]?yt.getFormatter(s[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(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),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 me extends fe{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 xe extends me{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 ye={t:class extends me{tag(){return"</t>"}},b:class extends me{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-bold")}},i:class extends me{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rct-text-italic")}},a:xe};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 fe).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 ye){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 ye[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(t,s,i,r,n){if(this._isVertical)return void this.buildVertical(t,s,i,r,n);const o=t.doc,a=b(this.lineHeight,1),h=this._lines,l=h.length,_=[],c=[];t.clearDom(),r=r||t;const d=t.getStyle("writing-mode"),u=this._vertical=d===it||d===rt;for(let s=0;s<l;s++){const i=h[s];let l=0,d=0,p=null;for(let s of i.words){const i=s.prepareSpan(t.appendElement(o,"tspan"),r,n),a=i.getBBox();if(i[ge]=a.width,i[pe]=a.height,u?(l=x(l,i[ge]),d+=i[pe]):(l+=i[ge],d=x(d,i[pe])),p||(p=i),s instanceof xe){const r=o.createElementNS(e,"a");r.setAttribute("href",s.url),r.setAttribute("target",s.target),r.appendChild(i),t.appendDom(r)}}c.push(p),i[pe]=d*a,i[ge]=l*a,_.push(0==s?i[ge]/2:i[ge])}if(l>0){let e=h[0];for(let s=1;s<c.length;s++)if(c[s]){let i=0,r=0;if(u?null!=c[s-1]&&(i=Math.floor(e[ge]-t.getAscent(e[ge]))+t.getAscent(h[s][ge])):r=e[pe]-t.getAscent(e[pe])+t.getAscent(h[s][pe]),null==c[0]&&c[s]==c.find((t=>null!=t))){const r=t.insertElement(o,"tspan",c[s]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();i+=n.width,r[ge]=n.width,r[pe]=e[pe]=n.height,c[0]=r}switch(d){case it:c[s].setAttribute("dx",String(i)),c[s].setAttribute("y","0");break;case rt:c[s].setAttribute("dx",String(-i)),c[s].setAttribute("y","0");break;default:c[s].setAttribute("x","0"),c[s].setAttribute("dy",String(r))}e=h[s]}if(u){const e=t.parent.dom.classList.contains("rct-annotation"),s=t.getBBox().width,[i]=c,r=i[ge];if(e)i.setAttribute("dx",String(d===rt?s-r/2:r/2));else switch(d){case it:i.setAttribute("x",String((s-r)/-2));break;case rt:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(h[0][pe])}}buildVertical(t,s,i,r,n){const o=t.doc,a=b(this.lineHeight,1),h=this._lines,l=h.length,_=[];let c=0;const d=[];t.clearDom(),r=r||t;for(let s=0;s<l;s++){const i=h[s];let l=0,u=0,p=null,g=!1;for(let s of i.words){const i=s.prepareSpan(t.appendElement(o,"tspan"),r,n);" "===i.textContent&&(g=!0,i.textContent=".");const a=i.getBBox();if(i[ge]=a.width,i[pe]=a.height,g&&(i.textContent=" ",i[pe]*=.6,g=!1),l+=i[ge],u=x(u,i[pe]),p||(p=i),s instanceof xe){const r=o.createElementNS(e,"a");r.setAttribute("href",s.url),r.setAttribute("target",s.target),r.appendChild(i),t.appendDom(r)}}d.push(p),i[pe]=u*a,i[ge]=l*a,c=x(l,c),_.push(0==s?i[ge]/2:i[ge])}if(l>0){let e=h[0];d[0].setAttribute("x",String((c-d[0].getBBox().width)/2));for(let s=1;s<d.length;s++)d[s]&&(d[s].setAttribute("x",String((c-d[s].getBBox().width)/2)),d[s].setAttribute("dy",String(e[pe]-t.getAscent(e[pe])+t.getAscent(h[s][pe]))),e=h[s]);t.layoutText(h[0][pe])}}layout(e,s,i,r,n){const o=e.getBBox();let a=0,h=0;if(this._vertical)switch(a=n.left+(i-n.left-n.right-o.width),s){case"center":e.anchor=t.TextAnchor.MIDDLE,h=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,h=n.top}else switch(h=n.top+(r-n.top-n.bottom-o.height)/2,s){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(i-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=i-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=(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(t,s){s.setAttribute("id",this.source.id);const i=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=r(i)?[...i]:[i,"white"],a=r(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach(((i,r)=>{!function(t,s,i,r,n){const o=t.createElementNS(e,"stop");o.setAttribute("offset",String(i)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),s.appendChild(o)}(t,s,r/(o.length-1),i,null==a[r]?1:a[r])}))}prepare(){}}class Ae extends Ve{getEelement(t,s){const i=t.createElementNS(e,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),s.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",o),i.setAttribute("x2",n),i.setAttribute("y2",a),i}}Ae.TYPE="lineargradient";class Pe extends Ve{getEelement(t,s){const i=t.createElementNS(e,"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(t,i),i}}Pe.TYPE="radialgradient";class ke extends Se{prepare(){}getEelement(t,s){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,h,l,_,d=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rct-pattern"),+s.pattern>=0){const t=ke.STOCK[+s.pattern%ke.STOCK.length];a=t.path,h=t.style,d=!t.fill,l=t.width||20,_=t.height||20}else o(s.pattern)&&(a=s.pattern,l=s.width||s.height||20,_=s.height||s.width||20);r.setAttribute("width",String(l)),r.setAttribute("height",String(_)),n.setAttribute("d",a),h&&c(n.style,h),s.style&&c(n.style,s.style),d&&(n.style.fill="none");let u=s.backgroundStyle;if(o(u)||i(u)){const s=t.createElementNS(e,"rect");r.append(s),s.style.fill=o(u)?u:u.fill,s.setAttribute("width",String(l)),s.setAttribute("height",String(_))}return r.append(n),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 Se{prepare(){const t=this.source;this._colors=r(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=r(e.colors)?e.colors:[]}}Ce.TYPE="colors";class Le extends Se{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(o(e))this._images.push(t+e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||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=[],r(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}updateOptions(t,e){}register(t,e){this._items.forEach((s=>{const i=s.getEelement(t,s.source);i.setAttribute(Jt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}prepareRender(){this._items.forEach((t=>{t.prepare()}));for(const t in this._map)this.get(t).prepare()}get options(){return this._items.map((t=>t.source))}$_loadItem(t){if(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ke.TYPE:r(t.colors)?e=Ce.TYPE:r(t.images)&&(e=Le.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 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,e){const n=i(t)?t:{};for(const t in e)if(s.call(e,t)&&!Te.includes(t)){const s=e[t];r(s)?n[t]=s.slice(0):i(s)?s._obj instanceof dt?n[t]=s:at.isDate(s)?n[t]=new Date(s):n[t]=Be(n[t],s):n[t]=s}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 s=i(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];r(n)?s[t]=n.slice(0):i(n)?n instanceof dt?s[t]=n:n._obj instanceof dt?s[t]=n._obj:this[t]instanceof Oe?at.isDate(n)&&(s[t]=new Date(n)):s[t]=this.$_mergeOptions(s[t],n):s[t]=n}}updateOptions(t,e=!0){const s=this._op;return void 0===t||this._doSetSimple(t)||this.$_mergeOptions(s,t),this.$_applyOptions(s),i(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(!l(i)||!i):(s[t]=!l(i)||!i,this.$_applyOptions(s),e&&this._changed())),this}removeOption(t,e=!0){const i=this._op;if(i.hasOwnProperty(t))if(this[t]instanceof Oe)this[t].clearOptions();else{delete i[t];const r=self.constructor.defaults;s.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),e&&this._changed()}return this}clearOptions(t=!0){const e=function(t){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,e,i=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==e&&""!==e||(e=void 0),void 0===e?r&&s.call(r,t)&&(delete r[t],n=!0):r&&r[t]==e||(r||(r=this._style=this._op.style={}),r[t]=String(e),n=!0),n&&(this.$_applyOptions(this._op),i&&this._changed()),this}setStyles(t,e=!1,s=!0){let r=!1,n=this._op.style;if(e&&n&&(delete this._op.style,r=!0,n=this._style=void 0),i(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),s&&this._changed()),this}_prepareRender(){this._doPrepareRender(this.chart)}_changed(t){var e;null===(e=this.chart)||void 0===e||e._modelChanged(this,t)}_doLoad(t,e){for(const s in e)if(e.hasOwnProperty(s)){let n=e[s];this._doLoadProp(s,n)||(this[s]instanceof Oe?t[s]=this[s]._load(n):r(n)?t[s]=n.slice(0):i(n)?n._obj instanceof dt?t[s]=n._obj:at.isDate(n)?t[s]=new Date(n):t[s]=c({},n):t[s]=n)}}_doSave(t,e,s){const i=this._op;for(const n in i)if(i.hasOwnProperty(n))if(s&&this[n]instanceof Oe)t[n]=this[n].saveOptions(!0);else{const s=i[n];r(s)?t[n]=this._doSaveArray(n,s)||s.slice():s!==e[n]&&(t[n]=s)}}_doSaveArray(t,e){}_doSetSimple(t){if(l(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=W(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=b(t,2)+"px")}_setNumberSymbols(t){t!==this._numberSymbols&&(this._numberSymbols=t,this._numSymbols=t&&t.split(","))}_setNumberFormat(t){t!==this._numberFormat&&(this._numberFormat=t,this._numberFormatter=t?yt.getFormatter(t):null)}_setText(t){return t!==this._text&&this.prepareRich(this._text=t),!isNaN(this._op.lineHeight)&&this._richTextImpl&&(this._richTextImpl.lineHeight=this._op.lineHeight),this}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,n){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,n),e&&this._richTextImpl.build(e,s,i,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new ve),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}_getNumberText(t,e,s){if(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=o(t)?t:this._getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}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(){const t="default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition;switch(t){case"left":case"right":case"top":case"bottom":return t;default:return this.getDefaultIconPos()}}_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||""}getIconUrl(t){const e=this._op.icon||t;return o(e)?this.getUrl(e):null}getUrl(t){if(t){o(t)||(t=String(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=Y(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=Y(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(o(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,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 o(t)?this._map[t]:this._items[t]}load(t,e){const s=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach(((t,i)=>{n.push(this.$_loadItem(s,t,i,e?this.owner:void 0))})):i(t)&&n.push(this.$_loadItem(s,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=o(e.imageUrl)?"image":o(e.shape)?"shape":"text");const n=t._getAnnotationType(r);if(!n)throw new Error("Invalid annotation type: "+e.type);const a=new n(t,i);return a.init(),a.index=s,a._load(e),a}}class Ge extends Xt{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 We 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);if(s instanceof this.chart.win.Date)try{return Rt.getFormatter(this._op.timeFormat).toStr(new Date(s),this.chart.startOfWeek)}catch{return Rt.getFormatter(We.defaults.timeFormat).toStr(new Date(s),this.chart.startOfWeek)}else try{return yt.getFormatter(this._op.numberFormat).toStr(s)}catch{return yt.getFormatter(We.defaults.numberFormat).toStr(s)}}moved(t,e,s){this._op.onChange&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=s.slice(0),this._op.onChange(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}We.defaults=Ee(Oe.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm"});const Xe={};class Ye extends Oe{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Ue extends Ye{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return o(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Ue.defaults=Ee(Ye.defaults,{visible:void 0});class Ze extends Ye{getGap(){return this._gap}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 o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let s=+t;Number.isNaN(s)||90===s||270===s||-90===s||-270===s||(s=0),e._rotation=s}(t.rotation),this._gap=b(t.gap,Ze.defaults.gap)}}Ze.defaults=Ee(Ye.defaults,{align:"middle",offset:0,gap:5});class qe extends Ye{_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}qe.defaults=Ee(Ye.defaults,{position:"end",gap:2});class Ke extends Ye{getRows(){if(!1===this._op.visible)return[];const t=this.axis,e=this._op.colors,s=e?e.length:0,i=[],r=this._style;if(this._op.belowColor&&t.isBaseVisible()&&i.push({axis:t,from:t.valueMin(),to:t.getBaseValue(),color:this._op.belowColor,style:r}),s>0){const n=t._ticks;let o=0;n[0].value>t.valueMin()&&(e[o%s]&&i.push({axis:t,from:t.valueMin(),to:n[0].value,color:e[o%s],style:r}),o++);for(let a=1;a<n.length;a++,o++)e[o%s]&&i.push({axis:t,from:n[a-1].value,to:n[a].value,color:e[o%s],style:r});n[n.length-1].value<t.valueMax()&&e[o%s]&&i.push({axis:t,from:n[n.length-1].value,to:t.valueMax(),color:e[o%s],style:r})}return i}_doSetSimple(t){return o(t)?(this._op.colors=[t,null],!0):r(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Qe extends Ye{_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(Ye.defaults,{visible:void 0,depthVisible:void 0});class Je extends $e{getText(){const t=this._op.text;return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}}Je.defaults=Ee($e.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class ts extends Ye{_doInit(t){t.label=(this._label=new Je(this.axis.chart)).init()}get label(){return this._label}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}canConstainedTo(t,e){const s=this._op;if(r(s.col)){for(const t of s.col)if(e==t)return!0;return!1}if(!isNaN(s.col)&&e!=s.col)return!1;if(r(s.row)){for(const e of s.row)if(t==e)return!0;return!1}return!(!isNaN(s.row)&&t!=s.row)}}ts.defaults=Ee(Ye.defaults,{front:!1,zindex:0});class es extends ts{}class ss extends ts{}class is 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:is.DEF_LENGTH,this._gap=b(this._op.gap,is.defaults.gap)}}is.DEF_LENGTH=7,is.defaults=Ee(Ye.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?v(null!==(s=i.lastText)&&void 0!==s?s:i.firstText,i.text):0==r?v(i.firstText,i.text):r==e-1?v(i.lastText,i.text):this.options.text}getLabelStyle(t,e){const s=this._op,r=t.index;if(s.styleCallback){const e=s.styleCallback(this.axis.getTickLabelArgs(r,t.value));if(i(e))return e}return 1==e?s.lastStyle||s.firstStyle:0==r?s.firstStyle:r==e-1?s.lastStyle:void 0}getIcon(t){}getDefaultIconPos(){return this.axis._isHorz?"top":"right"}_doApply(t){super._doApply(t),this._inside="inside"===t.location}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}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 Ye{getThickness(){return Math.max(0,b(this._op.thickness,ns.defaults.thickness))}getMinThumbSize(){return Math.max(0,b(this._op.minThumbSize,ns.defaults.minThumbSize))}getGap(){return Math.max(0,b(this._op.gap,ns.defaults.gap))}getGapFar(){return Math.max(0,b(this._op.gapFar,ns.defaults.gapFar))}}ns.defaults=Ee(Ye.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=>{Xe[t.type]=t,t.subtype&&(Xe[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 We(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 T+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=m(...s),e._yMax=x(...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(),this.guides.forEach((t=>t._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+=b(s.groupWidth(),1))})),s.forEach((s=>{if(s.row==t&&s.isClusterable()){const t=b(s.groupWidth(),1)/e;s.setCluster(t,i),i+=t}}))}))}else{let t=0,e=0;s.forEach((e=>{e.isClusterable()&&(t+=b(e.groupWidth(),1))})),s.forEach((s=>{if(s.isClusterable()){const i=b(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[x(t,this._min),m(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new 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 e=this,i=this.guides,n=function(t){var s;t!==e._guides&&(e._guides=t,s=r(t)?t:[t],i.length=0,s.forEach((t=>{let s;s="range"===t.type?new ss(e):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new es(e):new ss(e),s.init(),s._load(t),i.push(s)})))};super._doApply(t),t.startAngle=b(this._op.startAngle,0),t.totalAngle=x(0,m(360,b(this._op.totalAngle,360))),this._name=t.name||`-axis-${this._index+1}`,this._row=b(Math.max(0,t.row|0),0),this._col=b(Math.max(0,t.col|0),0),s.call(t,"guide")?n(t.guide):s.call(t,"guides")&&n(t.guides)}_setMinMax(t,e){this._min=t,this._max=e,this._single=t===e}_connect(t){t&&this._series.indexOf(t)<0&&this._series.push(t)}_doCalculateRange(t){return{min:t.length>0?D(m(...t)||0):NaN,max:t.length>0?D(x(...t)||0):NaN}}}hs.defaults=Ee(Oe.defaults,{visible:void 0,row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"],animatable:!0,fixedSize:!1});class ls extends Re{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;r(t)?t.forEach(((t,s)=>this._items.push(this.$_loadAxis(e,t,s)))):this._items.push(this.$_loadAxis(e,t,0)),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 o(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach((t=>t.disconnect()))}prepare(){this._items.forEach((t=>t._prepare()))}collectValues(){this._items.forEach((t=>t.collectValues()))}collectRanges(){this._items.forEach((t=>t.collectRanges()))}collectReferentValues(){this._items.forEach((t=>{t.collectReferentValues()}))}prepareRender(){this._items.forEach((t=>t._prepareRender()))}afterRender(){this._items.forEach((t=>t.afterRender()))}_buildTicks(t,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 n;if(h(r)&&r>=0&&r<s.length?n=s.find((t=>t._index===r)):o(r)&&(n=s.find((t=>t.options.name===r))),n||(n=s[0]),n&&this.chart.isValidAxis(n))return n._connect(t),this.isX?t.setCol(n.col):t.setRow(n.row),n}forEach(t){for(let e=0,s=this._items.length;e<s&&!0!==t(this._items[e],e);e++);}isZoomed(){for(const t of this._items)if(t.isZoomed())return!0}resetZoom(){this._items.forEach((t=>t.resetZoom()))}$_loadAxis(t,e,s){var i;let n=t._getAxisType(e.type);if(!n){let o;if(r(e.categories))o="category";else if(this.isX){const i=t._getSeries()._internalItems();if(i.length>0){o="category";for(const t of i)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){o=void 0;break}if(t.options.xAxis===s){o=void 0;break}if(z(t.options.xAxis)&&0===s){o=void 0;break}}}}else o=null===(i=t._getSeries().first)||void 0===i?void 0:i.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._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:Y(this._widthDim||this._sizeDim,t,t),height:Y(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return Y(this._leftDim,t)}getRight(t){return Y(this._rightDim,t)}getTop(t){return Y(this._topDim,t)}getBottom(t){return Y(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=b(t.row|0,0),this._col=b(t.col|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}us.defaults=Ee(_s.defaults,{size:"100%"});class ps 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}}ps.defaults=Ee(us.defaults,{duration:500});class gs 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),s.call(t,"children")&&this.$_loadGauges(this.chart,t.children)}_doSaveArray(t,e){if("children"===t)return this._gauges.map((t=>t.saveOptions()))}_prepareRender(){this._visibles=this._gauges.filter((t=>t.visible)),super._prepareRender(),this._visibles.forEach(((t,e)=>{this._setGroup(t,e),t._prepareRender()}))}$_loadGauges(t,e){const s=this._gaugesType();r(e)?e.forEach(((e,i)=>this.$_add(ps._loadGauge(t,e,s)))):i(e)&&this.$_add(ps._loadGauge(t,e,s))}$_add(t){if(t._type()!==this._gaugesType())throw new Error("이 그룹에 포함될 수 없는 게이지입니다: "+t);this._gauges.push(t),t.index=this._gauges.length-1}_setGroup(t,e){t.setGroup(this,e)}}gs.defaults=Ee(us.defaults,{minValue:0});class fs 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 o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,s=this._items=[],n=this._map={};r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{if(t.name&&(n[t.name]=t),t instanceof 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(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 i=r(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(i||(i=t._getGaugeType(e.type||t.gaugeType)),!i)throw new Error("Invalid gauge type: "+e.type);const n=new i(t);return n.init(),n._load(e),n.index=s,n}}class ms 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 x(this._op.minValue,m(this._op.maxValue,b(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?b(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}}}ms.defaults=Ee(ps.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 ys extends $e{getText(t){return at.isValidNum(t)?this._getText(null,t,y(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 xs(this)).init(),t.label=(this._label=new ys(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=b(s,e);const{min:i,max:r}=this._adjustMinMax(m(e,s),x(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(x(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const s=this.gauge;return t=b(s.options.minValue,t),e=b(s.options.maxValue,e),this._min=m(t,e),this._max=x(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let s=e.options.minValue,i=e.options.maxValue;return isNaN(s)&&(s=m(...t)),isNaN(i)&&(i=x(...t)),this._min=m(s,i),this._max=x(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}}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?Y(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:Y(this._offsetXDim,t,0),y:Y(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=W(v(t,Ps.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=W(v(t,Ps.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=W(v(t,Ps.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=W(v(t,Ps.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=W(t,!0))}getCenter(t,e){return{x:Y(this._centerXDim,t,t/2),y:Y(this._centerYDim,e,e/2)}}getExtents(t){const e=Y(this._radiusDim,t,t/2),s=m(e,this._innerDim?Y(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?Y(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=b(t%360,0),i=x(0,m(360,b(e,360)));this._startRad=T+B*s,this._handRad=B*s,this._sweepRad=B*i}}class Ps extends ms{_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(ms.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class ks 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)}}ks.defaults=Ee(gs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Cs=class extends Oe{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};Cs.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 h(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.angle=m(60,x(30,b(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 Cs(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=u(p(r*B)*i),o=u(g(r*B)*i);return{depth:i,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return Y(this._radiusDim,m(t,e))}setPolar(t,e){return this._cx=Y(this._centerXDim,t),this._cy=Y(this._centerYDim,e),this._rd=Y(this._radiusDim,m(t,e)),this}getPolar(t){return this.chart.isPolar()?{start:t?t.getStartAngle():0,total:t?t.getTotalAngle():0,cx:this._cx,cy:this._cy,rd:this._rd,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 e=this,i=function(t){t!==e._anns&&(e._anns=t,e._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","centerX","centerY"),s.call(t,"annotation")?i(t.annotation):s.call(t,"annotations")&&i(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender()}}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 _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 Y(this._maxWidthDim,t,t)}getMaxHeight(t){return Y(this._maxHeightDim,t,t)}getMarkerSize(){return b(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=v(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(_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 $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=m(y(i)/2,s/2,r),n=m(y(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=m(y(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=m(y(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=m(s,i);return["M",t+=(s-r)/2,e+=(i-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,s){return["M",t,e,"m",s,0,"a",s,s,0,1,1,2*-s,0,"a",s,s,0,1,1,2*s,0]}static isCircled(t){return E-t<Fs}static arc(t,e,s,i,r,n,o,a=!1){const h=m(E,y(n-r)),l=this.isCircled(h),_=h>M?1:0,c=o?1:0,d=p(r),u=g(r),f=p(n-=l?c?Fs:-.001:0),x=g(n),b=[];return b.push("M",t+s*d,e+i*u,"A",s,i,0,_,c,t+s*f,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=m(E,y(o-n)),l=this.isCircled(h),_=h>M?1:0,c=a?1:0,d=p(n),u=g(n),f=p(o-=l?c?Fs:-.001:0),x=g(o),b=s*r,w=i*r,v=[];return v.push("M",t+s*d,e+i*u,"A",s,i,0,_,c,t+s*f,e+i*x),l?v.push("M",t+b*f,e+w*x):v.push("L",t+b*f,e+w*x),r>0&&v.push("A",b,w,0,_,1-c,t+b*d,e+w*u),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,d=m(E,y(o-n));const u=this.isCircled(d);let f=(n%E+E)%E,x=(o%E+E)%E;const b=[];let w,v,S,V;if(!u&&(_&&f<=M&&x>=0&&x<f||!_&&x<=M&&f>=0&&f<x))c=0,_?(w=t+s*p(n),v=e+i*g(n),S=t+s*p(M),V=e+i*g(M),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*p(0),v=e+i*g(0),S=t+s*p(o),V=e+i*g(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V)):(w=t+s*p(n),v=e+i*g(n),S=t+s*p(0),V=e+i*g(0),l(w,v,S,V),h&&(h.x1=w,h.y1=v),w=t+s*p(M),v=e+i*g(M),S=t+s*p(o),V=e+i*g(o),l(w,v,S,V),h&&(h.x2=S,h.y2=V));else{w=t+s*p(n),v=e+i*g(n),S=t+s*p(o-=u?_?Fs:-.001:0),V=e+i*g(o),_?(f=u||f<=E&&!(x>=f&&x<E)?0:f,x=u||x>M&&!(f<=x&&f>M)?M:x):(f=u||f>M&&!(x<=f&&x>M)?M:f,x=u||x<E&&!(f>=x&&f<E)?0:x);const r=t+s*p(f),a=e+i*g(f),d=t+s*p(x-=u?_?Fs:-.001:0),m=e+i*g(x);c=y(x-f)>M?1:0,l(r,a,d,m),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=m(E,y(o-n)),_=this.isCircled(l),c=a?1:0,d=t+s*p(n),u=e+i*g(n),f=t+s*p(o-=_?c?Fs:-.001:0),x=e+i*g(o),b=l>M?1:0,w=[];return w.push("M",d,u,"A",s,i,0,b,c,f,x),w.push(_?"M":"L",f,x+r),w.push("A",s,i,0,b,1-c,d,u+r),h&&(h.x1=d,h.y1=u,h.x2=f,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*g(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,_=i/4,c=2*Math.PI/5,d=c/2,u=[];u.push("M",n+a*p(r),o+h*g(r));for(let t=0;t<5;t++)u.push("L",n+a*p(r),o+h*g(r),"L",n+l*p(r+d),o+_*g(r+d)),r+=c;return u.push("Z"),u}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,x(2*s,0),x(2*i,0));break;default:r=Ds.circle(s,i,x(m(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=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 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",Ws="inside",Xs="none",Ys="near",Us="displayAll",Zs="largestFirst",qs="hidden",Ks="line",Qs="area",Js="circlebar";let ti=0;const ei="_deleted",si="_drop",ii="_save";class ri{static getSum(t){let e=0;for(const s of t)isNaN(s.y)||(e+=s.y);return e}constructor(t){this.pid=ti++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}isEmpty(){return!1}copy(){return{...this}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?(this._readObject(t,e),(r(e.drillDown)||i(e.drillDown))&&(this.drillDown=e.drillDown)):this._readSingle(e),this.initValues()}getPointLabel(t){return this.yValue}getPointText(t){return this.yLabel}getPointIcon(t){return this.icon}swap(){const t=this.xPos;this.xPos=this.yPos,this.yPos=t}getParam(t){var e,s,i;const r=this.source||{};if("value"===t)return null!==(e=r[t])&&void 0!==e?e:this.getValue();if(t.indexOf(".")>0){const e=t.split(/\./g);let i=null!==(s=this[e[0]])&&void 0!==s?s:r[e[0]];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[ei]=!0}_isDeleted(){return this[ei]}_setDrop(t){this[si]=t}_getDrop(){return this[si]}_setSave(t){this[ii]=t}_getSave(){return this[ii]}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):r(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=N}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return c(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[b(s.xField,0)],this.y=e[b(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=S(t._yFielder(e),e.y,e.value),this.color=v(t._colorFielder(e),e.color),this.icon=v(t._iconFielder(e),e.icon),this.yLabel=e.yLabel,this.labelOptions=e.labelOptions}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class ni{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 s(t,e,s){return i(t)?t.pid===e:t===s}return this._points.find((i=>s(t,i.pid,i.xValue)&&(void 0===e||s(e,i.pid,i.yValue))))}contains(t){return this._points.indexOf(t)>=0}load(t){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return 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[ei]))}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 oi extends ri{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return c(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[b(s.xField,0)]),this.y=e[b(s.yField,0+i)],this.z=e[b(s.zField,1+i)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=v(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.zValue=this.zValue||0}applyValueRate(t,e){this.zValue=V(t.zValue,this.zValue,e)}}class ai extends ri{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 c(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[b(s.lowField,0+i)],this.y=e[w(s.highField,s.yField,1+i)],i>0&&(this.x=e[b(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=v(e[t.options.lowField],e.low),this.y=S(e[t.options.highField],e.high,this.y),this.lowLabel=e.lowLabel)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue||0}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class hi extends is{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}hi.defaults=Ee(is.defaults,{step:1});class li extends rs{getTick(t,e){if(null!=e){const t=this._getText(e,e,!1,!1),s=t.lastIndexOf(this.sep);return r(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}}li.defaults=Ee(rs.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class _i 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 ci extends hs{constructor(){super(...arguments),this._weights=new Map,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||"+"}getWeight(t){var e;return null!==(e=this._weights.get(t))&&void 0!==e?e:1}_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 _i(this)}_createTickModel(){return new hi(this)}_createLabel(){return new li(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(){let t=super.getStartAngle(),e=+this._op.startOffset;return e>0&&(t-=m(e,1)*this.getWeight(0)*E/this._catLen),t}_doPrepareRender(){const t=this._op;this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=w(t.minPadding,t.padding,0),this._maxPad=w(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,b(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;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));let l=0;for(const t of n.values())l+=t;h=this._len=this._minPad+this._maxPad+h-n.size+l;const _=this._pts=[];if(h>0){let s=this._minPad;_.push(0);for(let i=t;i<=e;i++)_.push(s/h),s+=this.getWeight(i);_.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];this.getWeight(s)<=0||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],y(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 h(t)?t:this._map[t]}getXLabel(t){var e;return(null===(e=this._categories[t])||void 0===e?void 0:e.c)||t}_doCalculateRange(t){const e=super._doCalculateRange(t);return this._isX||(e.min=m(0,e.min),e.max=x(0,e.max)),e}$_collectCategories(t){const e=this._op,s=e.categories,n=this._categories=[];let a=this._weights;if(a.clear(),r(s)&&s.length>0)this._len=0,s.forEach((t=>{const e=null==t?1:x(b(t.weight,1),0),s=t&&t.icon;let r,o;null==t?o=r=null:i(t)?(r=v(t.name,t.label),o=v(t.label,t.name)):o=r=String(t),this._len+=e,n.push({c:r,t:o,i:s}),a.set(a.size,e)}));else{const s=this.chart.seriesByName(e.categorySeries),i=this.chart.seriesByName(e.weightSeries)||s,h=e.weightField,l=null==i?void 0:i.data,_=e.weightByFrequency;s&&(t=[s]);const c=[];for(const e of t)e.collectCategories(this).forEach((t=>{c.includes(t)||(c.push(t),n.push({c:t,t:t}))}));if(h&&r(l)&&l.length>0){const t=i.getPoints();let e=null;l.forEach(((s,i)=>{var r,n;const l=t.get(i);if(!l)return;const d=l.x,u=x(null!==(r=s[h])&&void 0!==r?r:1,0);if(o(d)){const t=c.indexOf(d);if(-1===t)return void(e=null);if(!a.has(t))return a.set(t,u),e=d,void(this._len+=u);_&&e===d&&(a.set(t,x((null!==(n=a.get(t))&&void 0!==n?n:0)+u,0)),this._len+=u)}else Number.isInteger(d)?(a.has(d)||(a.set(d,u),this._len+=u),e=null):e=null}))}else if(r(t)&&t.length>0){const e=new Set;for(const s of t){const t=s.collectCategories(this),i=t.length;if(0===i)continue;let r=t[0],n=1;for(let s=1;s<i;s++){const i=t[s],o=c.indexOf(r);i!==r?(-1===o||e.has(r)||(e.add(r),a.set(o,_?n:1)),r=i,n=1):n++}e.has(r)||(e.add(r),a.set(c.indexOf(r),_?n:1))}}}this._map={},n.forEach(((t,e)=>{const s=t.v=e;null!=t.c&&(this._map[t.c]=s)}))}}ci.type="category",ci.defaults=Ee(hs.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+"});class di extends Oe{}di.defaults=Ee(Oe.defaults,{visible:!1});class ui 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:ui.OFFSET:e}getOffsetY(t){const e=this._op.offsetY;return isNaN(e)?"middle"===t?0:ui.OFFSET:e}getText(){const t=this._op.text;return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),t.position=m(1,x(0,b(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"}}ui.OFFSET=4,ui.defaults=Ee($e.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class pi extends Oe{getRadius(){return x(0,b(this._op.radius,4))}}pi.defaults=Ee(Oe.defaults,{visible:!1,radius:4});class gi extends Oe{constructor(t){super(t.chart),this.owner=t,this._points=[],this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),t.variableArea=(this._variableArea=new di(this.chart)).init(),t.fixedArea=(this._fixedArea=new di(this.chart)).init(),t.label=(this._label=new ui(this.chart)).init(),t.marker=(this._marker=new pi(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){this._label._prepareRender();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=x(0,b(t.forward,0)),t.backward=x(0,b(t.backward,0)),this._formatter=yt.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:b(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(y(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++)y(s[t][r])>y(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=x(1,m(s-1,this._op.movingInterval)),r=[];let n=i;for(;n<=s;){const t=e.slice(n-i,n).reduce(((t,e)=>t+b(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 fi;gi.defaults=Ee(Oe.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const mi={},xi={},yi=/\$\{detail\}/g;class bi extends Oe{}bi.defaults=Ee(Oe.defaults,{visible:!1});class wi 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,y(t)>1e3,!0):this._getText(t,null,!1,!1)}getOffset(){return b(this._op.offset,0)}getAlign(){return"center"}getAlignOffset(){return 0}getDefaultIconPos(){return"top"}getRotation(){return x(-90,m(90,b(this._op.rotation,0)))}_isVisible(){return this._op.visible||n(this._op.visibleCallback)}_doSetSimple(t){return n(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=b(t.verticalAdjust,0)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}fi=wi,wi.OFFSET=4,wi.defaults=Ee($e.defaults,{visible:void 0,position:"default",offset:fi.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class vi extends $e{_doInit(t){super._doInit(t),this._args={}}getText(t){return at.isValidNum(t)?this._getText(null,t,y(t)>1e3,!0):this._getText(String(t),null,!1,!1)}getOffset(){return b(this._op.offset,0)}getGap(){return b(this._op.gap,vi.OFFSET)}getDefaultIconPos(){return"left"}getCallbackArgs(t,e,s,i){const r=this._args;return r.chart=t.wrapper,r.x=e,r.positiveTotal=s,r.negativeTotal=i,r.total=s+i,r}isStackLabelVisible(t){return this._op.visibleCallback?this._op.visibleCallback(t):this.visible}getStackLabelText(t,e){if(n(this._op.textCallback)){const e=this._op.textCallback(t);if(o(e))return e}return this.getText(e)}getRotation(){return x(-90,m(90,b(this._op.rotation,0)))}getStackLabelStyle(t){if(n(this._op.styleCallback))return this._op.styleCallback(t)}_isVisible(){return this._op.visible||n(this._op.visibleCallback)}_doApply(t){super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=b(t.verticalAdjust,0)}}vi.OFFSET=4,vi.defaults=Ee($e.defaults,{visible:!1,align:"center",gap:vi.OFFSET,offset:0,overflowFit:0,verticalAdjust:.05,rotation:0});const Si={x:"xValue",y:"yValue",z:"zValue"};class Vi extends Xt{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 Ai extends Xt{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 Pi extends Xt{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 ki extends ri{}const Ci=12;class Li extends Oe{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach((t=>{mi[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 ni(this),this._pointArgs={},this._paletteColors=Array(Ci).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;if(e.tooltipDetailCallback){this._getPointCallbackArgs(this._pointArgs,t);const i=e.tooltipDetailCallback(this._pointArgs);s=o(i)?i:""}if(void 0===s){const t=e.tooltipDetail;s=o(t)?t:""}return s}getTooltipText(t,e){var s;const i=this._op;let r;if(i.tooltipCallback){this._getPointCallbackArgs(this._pointArgs,e);const t=i.tooltipCallback(this._pointArgs);o(t)&&(r=t)}if(void 0===r){const t=i.tooltipText;r=o(t)?t:null!==(s=Li.defaults.tooltipText)&&void 0!==s?s:"",r&&(r=r.replace(yi,this.getTooltipDetail(e)))}return r}getTooltipParam(t,e,s){return Li.getPointTooltipParam(t,e,s)}getTooltipHeaderColor(t){return null}_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 b(s,t.getXStart())}$_getXStep(t){return S(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 ci)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.options.categoryField;if(null!=e){if(r(e)){const s=e.length-1,i=t.getCategorySeparator();return this._points._internalPoints().filter((t=>o(t.getProp(e[s])))).map((t=>e.map((e=>t.getProp(e))).join(i)))}return this._points.getProps(e).filter((t=>o(t)))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter((t=>o(t)))}collectValues(t,e){if(t===this._xAxisObj){let s=this.$_getXStart(t),i=this.$_getXStep(t);o(i)&&(i=i.trim());const r=o(i)?NaN:at.getNumber(i);this._points.forEach(((e,n)=>{let a=t.getValue(e.x);isFinite(a)||(a=s,isFinite(r)?s+=r:o(i)&&(s=t.incStep(s,i))),e.xValue=a})),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 b(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?b(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),wi.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=A(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 n(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),o(i))?i:(i=t.getPointText(e),null!=i?i:s)}getPointStyle(t){if(n(this._op.pointStyleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._op.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(n(this._pointLabel.options.styleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.options.styleCallback(this._pointArgs)}pointClicked(t){if(n(this._op.onPointClick))return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}pointHovered(t){n(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 o(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 ri||(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 Vi(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 Vi(this,s,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return s}addPoints(t,e=!0){const s=[];return r(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 Vi(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 ri||(this.hasZ()?r(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof ri&&this._points.contains(t)){let s=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ai(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new Pi(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(r(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(r(t)){let s=[];if(t.forEach((t=>{t instanceof ri||(this.hasZ()?r(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof ri&&this._points.contains(t)&&s.indexOf(t)<0&&s.push(t)})),s.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ai(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 Pi(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=x(0,b(t.decayDuration,300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new wi(t)}_createPoint(t){return new ki(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,Li.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField","iconField"]}_createFielder(t){return n(t)?e=>t(e):null!=t?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach((e=>{const s=`_${e}er`;(!this[s]||e in t&&this[`_${e}`]!==t[e])&&(this[s]=this._createFielder(t[e]),this[`_${e}`]=t[e])}))}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(r(t))return t;if(t){let e;if(t._obj instanceof dt)e=t._obj;else if(t instanceof dt)e=t;else if(Number.isFinite(t)||i(t)||l(t))return[t];if(e)return e!==this._cdata&&(this._cdata&&this._cdata._removeListener(this),this._cdata=e,this._cdata&&this._cdata._addListener(this)),e._internalValues()}}_loadPoints(t){return this._doLoadPoints(t),n(this._op.onPointsLoaded)&&this._op.onPointsLoaded(this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=t.pointColors,s=this._runColor=h(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%Ci+1)})`:t.color;let i,n;r(e)?i=e:o(e)?e.endsWith("@pal")||e.endsWith("@palette")?i=this.chart.getPaletteColors(e.split("@")[0]):n=this.chart._assets.get(e):this._colorByPoint()&&(i=this.chart.chartOptions.options.colors),n instanceof Ce?this._runPoints.forEach(((t,e)=>{t.color=t.color||n.getNext()||s})):r(i)?this._runPoints.forEach(((t,e)=>{t.color=t.color||i[e%i.length]||s})):this._runPoints.forEach(((t,e)=>{t.color=t.color||s})),this._preparePointArgs(this._pointArgs),this._labelPosCallback=A(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=A(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const s=t[Si[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}}Li.LEGEND_MARKER="rct-legend-item-marker",Li.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 Ni 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 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,s=this._items=[],n=this._series=[];r(t)?t.forEach(((t,i)=>{s.push(this.$_loadItem(e,t,i))})):i(t)&&s.push(this.$_loadItem(e,t,0)),s.forEach((t=>{t instanceof ji?n.push(...t.series):t instanceof Li&&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 Li?e=t:o(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),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.options.zOrder:t.options.zOrder)||0,i=+(e._group?e._group.options.zOrder:e.options.zOrder)||0;return s===i&&t._group&&t._group===e._group?(+t.options.zOrder||0)-(+e.options.zOrder||0):s-i}));const s=1===this._visibleSeries.filter((t=>t.isClusterable())).length;this._visibleSeries.forEach(((t,e)=>{t instanceof Fi&&(t._single=s)})),this._visibles.forEach((t=>t._prepareRender()))}prepareAfter(){this._visibles.forEach((t=>t.prepareAfter()))}$_loadItem(t,e,s){const i=r(e.children||e.series)&&t._getGroupType(e.type||t.type);if(i){const r=new i(t);return r._setIndex(s),r.init(),r._load(e),r}return Li._loadSeries(t,s,e)}$_add(t){!this._widget||t instanceof Di||(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 Mi extends Li{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new gi(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}Mi.defaults=Ee(Li.defaults,{});class Ei 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 o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Ei.defaults=Ee(Oe.defaults,{radius:3});class Ti extends ri{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return v(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 Bi extends Oe{_doSetSimple(t){return o(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}Bi.defaults=Ee(Oe.defaults,{curved:!0});class Oi extends wi{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new Bi(this.chart)).init()}get connector(){return this._connector}getWidgetAlign(){return"near"===this._op.align?-1:"far"===this._op.align?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}Oi.defaults=Ee(wi.defaults,{visible:!0,convergent:!0,align:Xs,dedupeMode:Us});class Ri 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?Y(this._minDim,ri.getSum(t)):+e.minValue,isNaN(r)&&isNaN(i)&&(r=Ri.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=W(t.minValue,!0)}}Ri.DEF_COUNT=10,Ri.defaults=Ee(Oe.defaults,{visible:!1,x:"기타"});class Di extends Li{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new Ri(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:Y(this._centerXDim,t),y:Y(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=W(S(s,e._op.center,Di.DEF_CENTER),!0)),i!==e._centerY&&(e._centerY=i,e._centerYDim=W(S(i,e._op.center,Di.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)))}}Di.DEF_CENTER="50%",Di.defaults=Ee(Li.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Di.DEF_CENTER,centerY:Di.DEF_CENTER});class $i extends Di{getRadius(t,e){return Y(this._radiusDim,m(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=W(v(t._radius=e,$i.defaults.radius),!0))}(this,t.radius)}}$i.defaults=Ee(Di.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class Fi extends Mi{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,x(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=b(this.getMinPointWidth(),0)}}Fi.defaults=Ee(Li.defaults,{pointWidth:1,minPointWidth:0});class Ii extends wi{getAlign(){return this._op.align||"center"}getAlignOffset(){return b(this._op.alignOffset,0)}get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new bi(this.chart)).init()}}Ii.defaults=Ee(wi.defaults,{align:"center",alignOffset:0});class zi extends Fi{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new Ii(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=x(0,w(e.depth,t.getDepth(),zi.DEPTH)),this._distance=t.getDistance()+b(e.distance,0)):(this._depth=x(0,b(e.depth,zi.DEPTH)),this._distance=b(e.distance,zi.DISTANCE)),e.nullAsBase&&null!=e.baseValue&&this._runPoints.forEach((t=>{t.isNull&&(t.y=e.baseValue,t.isNull=!1)})),this._base=S(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}_getLabelDefaultPos(t,e){const s=this._group;return"default"===e&&s&&s._stacked&&s.stackLabel&&s.stackLabel.visible?"inside":e}}zi.DEPTH=10,zi.DISTANCE=5,zi.defaults=Ee(Fi.defaults,{nullAsBase:!1});class Hi extends Fi{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 Gi extends Hi{}class ji extends Oe{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach((t=>{xi[t.type]=t}))}static registerSeries(...t){t.forEach((t=>{xi[t.seriesType]=t}))}static collectTooltipText(t,e,s,i,n){function o(t,e,s,i){let r=e.replace(yi,t.getTooltipDetail(s));return r=r.replace("yValue","yValue."+s.index).replace(/\$\{/g,"${"+i+"."),r}const a=e.length>1&&r(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 r=i;t!==s&&t.needAxes()&&(r=t.getPointAt(i.xValue)),r&&(a?(n.items.push(t),n.rows.push([o(t,h[0],r,e),o(t,h[1],r,e)])):(l&&(l+="<br>"),l+=o(t,h,i,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"),Li.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}get stackLabel(){return this._stackLabel}_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=b(this._op.layoutMax,ji.LAYOUT_MAX);return t>0?t:ji.LAYOUT_MAX}_doInit(t){super._doInit(t),t.stackLabel=(this._stackLabel=new vi(this.chart)).init()}_doApply(t){super._doApply(t),s.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}this._stackLabel._prepareRender(),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 s=this._seriesType();r(e)?e.forEach(((e,i)=>this.$_add(Li._loadSeries(t,this._series.length,e,s)))):i(e)&&this.$_add(Li._loadSeries(t,this._series.length,e,s))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach((s=>{s.collectValues(t,e)}))}$_collectPoints(t){const e=this._visibles,s=this._stackPoints=new Map;e.forEach((e=>{e.collectValues(t,null)})),e[0]._runPoints.forEach((t=>{s.set(t.xValue,[t])}));for(let t=1;t<e.length;t++)e[t]._runPoints.forEach((t=>{const e=s.get(t.xValue);e?e.push(t):s.set(t.xValue,[t])}));return s}$_collectStack(t,e){const s=this.getBaseValue(t),i=this.$_collectPoints(t),r=this._stackTotals=new Map;if(isNaN(s))for(const[t,s]of i.entries()){s[0].yGroup=s[0].yValue||0;for(let t=1;t<s.length;t++)s[t].yGroup=s[t-1].yGroup+(s[t].yValue||0);const i=s[s.length-1].yGroup;r.set(t,{x:s[0].xValue,positiveTotal:i>=0?i:0,negativeTotal:i<0?i:0}),e.push(i)}else for(const[t,n]of i.entries()){let i=n[0].yValue||0,o=i>=s?0:-1,a=i<s?0:-1;n[0].yGroup=n[0].yValue||0;for(let t=1;t<n.length;t++)i=n[t].yValue||0,i>=s?(o>=0&&(n[t].yGroup=n[o].yGroup+i*(i<0?-1:1)),o=t):(a>=0&&(n[t].yGroup=n[a].yGroup+i*(i>=0?-1:1)),a=t);const h=o>=0?n[o].yGroup:0,l=a>=0?n[a].yGroup:0;r.set(t,{x:n[0].xValue,positiveTotal:h,negativeTotal:l}),o>=0&&e.push(n[o].yGroup),a>=0&&e.push(n[a].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+(y(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 Wi 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 Xi 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}}Xi.defaults=Ee(ji.defaults,{groupWidth:1,groupPadding:.1});class Yi extends Mi{isMarker(){return!0}isXY(){return!0}}Yi.defaults=Ee(Li.defaults,{colorByPoint:!1});class Ui extends Oe{}class Zi extends Oe{}const qi={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},Ki={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},Qi={minPadding:0,maxPadding:0};class Ji extends Oe{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){super._doInit(t);const e=this.chart;t.handle=(this._handle=new Ui(e)).init(),t.mask=(this._mask=new Zi(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 Math.max(0,b(this._op.thickness,Ji.defaults.thickness))}getGap(){return Math.max(0,b(this._op.gap,Ji.defaults.gap))}getGapFar(){return Math.max(0,b(this._op.gapFar,Ji.defaults.gapFar))}getHandleOverflow(){return Ji.HANDLE_TRACK_OFFSET+Ji.HANDLE_RADIUS}getSize(){const t=x(this.getGapFar(),this.getHandleOverflow());return this.getGap()+this.getThickness()+t}axisLen(){return this._naviChart.xAxis.length()}axis(){return this._source._xAxisObj}_doLoad(t,e){super._doLoad(t,e);const s={};if(i(e.series)){let t=e.series.type;"area"!==t&&"line"!==t&&"bar"!==t&&(t="area"),s.series=c({},e.series,qi[t]())}else s.series=qi.area();i(e.xAxis)?s.xAxis=c({},e.xAxis,(Ki[e.xAxis.type]||Ki.linear)(),Qi):s.xAxis=c({},Qi),i(e.yAxis)?s.yAxis=c({},e.yAxis,(Ki[e.yAxis.type]||Ki.linear)(),Qi):s.yAxis=c(Ki.linear(),Qi),this._chartConfig=s,this._axisType=s.xAxis.type}_doPrepareRender(t){const e=t._getSeries().getSeries(this._op.source)||t.firstSeries;e!==this._source&&(this._source=e,this._axisType||(this._chartConfig.xAxis.type=this._source._xAxisObj._type()),this._naviChart=this.chart._createChart(this._chartConfig),this._op.usePointSource?this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points.map((t=>t.source))):this._naviChart.firstSeries._loadPoints(this._source.getPoints()._points)),this._vertical=!1,this._naviChart._prepareRender()}}Ji.HANDLE_RADIUS=9.75,Ji.HANDLE_TRACK_HEIGHT=6,Ji.HANDLE_TRACK_OFFSET=Ji.HANDLE_TRACK_HEIGHT/2,Ji.defaults=Ee(Oe.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class tr extends Oe{_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}tr.defaults=Ee(Oe.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class er extends tr{}er.defaults=Ee(tr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class sr 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=v(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!!l(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:x(b(t.headerHeight,0),0)}getTailSize(){return this._op.simpleMode?0:x(b(this._op.tailSize,0),0)}getBorderRadius(){return this._op.simpleMode?0:x(b(this._op.borderRadius,0),0)}getMarkerSize(){return this._op.listMarkerSize||10}getMarkerGap(){return b(this._op.listMarkerGap,5)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?yt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Rt.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}sr.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 ir="vline",rr="hline",nr="line";class or extends ze{getImageUrl(){const t=this._op.imageUrl;if(!o(t))return t;const e=t.indexOf("::");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}return t}_isVisible(){return this._op.visible&&!z(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}or.type="image";class ar 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||ar.defaults.shape}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}ar.type="shape",ar.defaults=Ee(ze.defaults,{width:64,height:64,shape:"square"});class hr 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 o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?yt.getFormatter(s):N),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Rt.getFormatter(t):N)}(t.timeFormat)}}hr.type="text",hr.defaults=Ee(ze.defaults,{text:"Text"});class lr 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 _r extends is{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,s,i,r){if(n(e)){const n=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:r});isNaN(n)||(e=n)}return e>0?e:void 0}buildSteps(t,e,s,i,o,a=!1){const h=this._op,l={chart:this.chart.wrapper,length:e,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:o},_=this.$_getStepPixels(e,l);let c,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,c=a?this._getStepsByPixels(e,b(.85*_,60),s,i,o,l):r(h.steps)||n(h.steps)||n(h.stepCallback)?this._getStepsBySteps(i,o,l):this._baseAxis instanceof gr&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,s,i,o,!0):h.stepCount>1?this._getStepsByCount(h.stepCount,s,i,o,!1):null!=(d=this._getValidInterval(t,h.stepInterval,e,i,o))?this._getStepsByInterval(d,s,i,o):_>0?this._getStepsByPixels(e,_,s,i,o,l):i!==o?[i,o]:[i],c}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?x(8,u(t/(.9*e))+1):b(this._op.maxCount,1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){super._doApply(t);const e=!n(t.stepPixels)&&at.parseTuples(t.stepPixels);let i;if(this._stepPixels=e&&e.every((([,t])=>t>0))?e:void 0,s.call(t,"stepMultiples"))if(n(t.stepMultiples))i=t.stepMultiples;else{let e;if(r(t.stepMultiples)){let s=Number.MIN_SAFE_INTEGER;e=[],t.stepMultiples.forEach((t=>{!isNaN(+t)&&t>s&&e.push(+t)}))}i=e&&e.length>0?e:void 0,i&&(i=i.filter((t=>t>=1)),i.length>0?i.sort(((t,e)=>t-e)):i=void 0)}this._userMultiples=i}$_getStepPixels(t,e){let s=this._stepPixels;if(n(s)&&(s=s.call(void 0,e)),!s){const t=this.axis;s=t._isPolar?_r.STEP_PIXELS_P:t._isX?_r.STEP_PIXELS_X:_r.STEP_PIXELS_Y}for(let e=0;e<s.length;e++)if(t<=s[e][0])return x(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 gr&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>d(t/e)*e?t=d(t/e)*e:t<u(t/e)*e&&(t=u(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&&d(t*o/a)==t*o/a?this._step=a:a=this._step=u(a/h)*h:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))s=this._normalizeMin(s,h);else{for(!function(t,e){if(!t)throw new Q(e)}(s<e&&i>e,"base error"),t=x(3,t);;){if(!(u((e-s)/a)+u((i-e)/a)+1>t))break;a+=h}s=e-u((e-s)/a)*a}else s=n._fixedMin;l.push(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=n(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==s?s:this._op.fineStep)?_r.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?_r.STEP_MULTIPLES[0]:_r.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,s){const i=this._op,o=n(i.steps)?i.steps:i.stepCallback;let a;return o?(a=o.call(void 0,s),r(a)&&!a.every((t=>!isNaN(+t)))||(a=t!==e?[t,e]:[t])):a=i.steps.filter((t=>isFinite(+t))).map((t=>+t)),a=a.filter(i.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=x(1,d(t/e))+1,l=o/(h-1);const _=function(t){return Math.pow(10,t)}(d(f(l))),c=this._getStepMultiples(_,n),p=[];let g,m=0;if(l/=_,c)if(l>c[m]){for(;m<c.length-1;m++)if(l>c[m]&&l<c[m+1]){l=l<=c[m]+(c[m+1]-c[m])/2?c[m]:c[m+1];break}}else l=c[m];for(;;){for(l*=_,(l<=0||!isFinite(l))&&(l=o/h),i=isNaN(s)?this._normalizeMin(i,l):s-u((s-i)/l)*l,this._step=l,p.push(D(g=i));g<r;)p.push(D(g+=l));if(!c||m>c.length-2||p.length<=a)break;l=c[++m],p.length=0}return p}}_r.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],_r.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],_r.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],_r.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],_r.defaults=Ee(is.defaults,{baseRange:!1,enableDecimals:!0});class cr extends rs{}cr.defaults=Ee(rs.defaults,{numberFormat:"0.##"});class dr extends cr{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}dr.defaults=Ee(cr.defaults,{useSymbols:!0});class ur extends Ye{getSize(t){return Math.min(.9*t,Y(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=b(this._op.space,0),this._sizeDim=W(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}ur.defaults=Ee(Ye.defaults,{size:"30%",space:16,gridVisible:!0});class pr extends Ue{_isVisible(){return this._op.visible}}pr.defaults=Ee(Ue.defaults,{visible:!1});class gr extends hs{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new pr(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=gr.PADDINGS}for(let i=0;i<t.length;i++)if(e<=t[i][0])return t[i][1]*s;return 0}_doApply(t){var e,i;super._doApply(t);const r=null!==(e=t.minPadding)&&void 0!==e?e:t.padding,n=null!==(i=t.maxPadding)&&void 0!==i?i:t.padding;let a;this._minPadPixels=NaN,o(r)&&r.endsWith("px")&&(a=parseFloat(r),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,o(n)&&n.endsWith("px")&&(a=parseFloat(n),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=at.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=at.parseTuples(n)),this._baseVal=+this._op.baseValue,this._strictMin=W(t.strictMin,!0),this._strictMax=W(t.strictMax,!0),s.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new lr(this)}_createTickModel(){return new _r(this)}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=b(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=b(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 gr&&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.length=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*b(o.unitPadding,.5)),t){let t=o.polarMargin;isNaN(t)?t=E*e.min/(h-a+e.min):t*=B,isNaN(this._fixedMax)&&this.getTotalAngle()+t>E&&(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),_=l.slice(0),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?$(t-r-i.pos):$(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=$(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}$_resolveFit(t){return"tick"===t||"value"===t?t:this._isX&&!this._isPolar?"value":"tick"}$_getStartFit(){return this.$_resolveFit(this._op.startFit)}$_getEndFit(){return this.$_resolveFit(this._op.endFit)}$_calcStrict(t,e,s){if(t)return t.fixed?t.size:s<0?e-Y(t,s):e+Y(t,s)}_adjustMinMax(t,e,s){const i=this._isLog();let r,n=this.isZoomed(),o=this.isZoomed(),a=!0,l=!0,_=NaN,c=NaN,u=1;if(this._series.length>0){let t,d=0;this._series.forEach((t=>{isNaN(t._sBase=t.getBaseValue(this))||d++,u=x(u,t.getAxisPadRate())})),!this._isX&&d>0&&d<this._series.length&&(r={},this._series.forEach((t=>{const e=t._type();r[e]?r[e]=[m(t._yMin,r[e][0]),x(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]}))),this._series.forEach((r=>{let d=r._sBase;h(d)&&!isNaN(d)&&(d=D(d),i?d>=0&&d<=e&&d<=s&&(e=t=d):d<=e?r.isBased(this)?e=t=d:_=b(m(_,d),d):d>=s&&(r.isBased(this)?s=t=d:c=b(x(c,d),d))),a&&!n&&(i||r.canMinPadding(this,e,t))&&(a=!1),l&&!o&&(i||r.canMaxPadding(this,s,t))&&(l=!1)}))}else a=n,l=o;n||(n=a),o||(o=l),this._fixedMin=this._fixedMax=NaN;const p=x(0,s-e),g=this.$_calcStrict(this._strictMin,e,-p),f=this.$_calcStrict(this._strictMax,s,p);let y=NaN,w=NaN,v=0,S=0;isNaN(g)?n?this._fixedMin=e:isNaN(this._minPadPixels)?v=this.$_getPadding(this._minPaddings,t,u):y=this._minPadPixels:this._fixedMin=e=g,isNaN(f)?o?this._fixedMax=s:isNaN(this._maxPadPixels)?S=this.$_getPadding(this._maxPaddings,t,u):w=this._maxPadPixels:this._fixedMax=s=f;let V=e,A=s;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*v;e<V&&(V=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*S;e>A&&(A=e)}}else V-=p*v,A+=p*S;if(!isNaN(y)||!isNaN(w)){isNaN(y)&&(y=0),isNaN(w)&&(w=0);const e=Math.min(y+w,.9*t),s=p-d(p*(t-e)/t),i=Math.round(s*y/e);V-=i,A+=s-i}return!isNaN(_)&&_<=e&&V<_&&(V=this._fixedMin=_),!isNaN(c)&&c>=s&&A>c&&(A=this._fixedMax=c),A=x(A,V),{min:V,max:A}}$_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:b(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=m(n,t[e]-t[e-1]);return r*=n/(i-s+n),isFinite(r)||(r=e/2),{len:b(r,1),min:n}}}$_loadBreak(t){if(i(t)&&"from"in t&&"to"in t){const e=new ur(this),s={...t};return s.from=this.getValue(s.from),s.to=this.getValue(s.to),!isNaN(s.from)&&!isNaN(s.to)&&s.from>s.to&&([s.from,s.to]=[s.to,s.from]),this._doApplyBreak(s),e.init(),e._load(s),isNaN(s.from)||isNaN(s.to)?null:e}}_doApplyBreak(t){}$_loadBreaks(t){if(r(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._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(c(new ur(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(c(new ur(this)._initObject(),o))}}var s}}gr.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],gr.defaults=Ee(hs.defaults,{baseValue:0,startFit:"default",endFit:"default",unitPadding:.5});class fr extends gr{get label(){return this._label}_createLabel(){return new dr(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}}fr.type="linear";const mr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],xr=[[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]],yr={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class br extends _r{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,r){if(n(e)){const n=e.call(void 0,{chart:this.chart.wrapper,length:s,minValue:t._calcedMin,maxValue:t._calcedMax,min:i,max:r});null!=n&&(e=n)}if(!isNaN(e))return+e>0?+e:NaN;if(o(e)&&yr.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>=mr[e]/2&&t<mr[e+1]/2)return this._scale=e,xr[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,_=x(1,Math.floor(o/(l-1)));const c=this._getStepMultiples(_),d=mr[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(o(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),h=parseFloat(t);let l,_;this._scale=yr[a],t=mr[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)}_getStepsBySteps(t,e,s){const i=super._getStepsBySteps(t,e,s);if(i.length>=2){const t=(i[i.length-1]-i[0])/(i.length-1);this._getStepMultiples(t)}else this._getStepMultiples(mr[4]);return i}buildSteps(t,e,s,i,r,n=!1){const o=super.buildSteps(t,e,s,i,r,n);if(void 0===this._scale&&o.length>=2){const t=(o[o.length-1]-o[0])/(o.length-1);this._getStepMultiples(t)}return o}}const wr=[{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 vr extends cr{_doApply(t){super._doApply(t);const e=o(t.timeFormat)?t.timeFormat:void 0,s=o(t.beginningFormat)?t.beginningFormat:void 0,n=t.timeFormats,h=t.useBeginningFormat;if(this._formats=wr.map((t=>c(t))),e&&this._formats.forEach((t=>{t.format=t.beginningFormat=e})),h&&s&&this._formats.forEach((t=>{t.beginningFormat=s})),r(n))for(let t=0;t<n.length;t++){const e=this._formats[t],s=n[t];a(s)?e.format=s:i(s)&&(a(s.format)&&(e.format=s.format),h&&a(s.beginningFormat)&&(e.beginningFormat=s.beginningFormat))}}getTick(t,e){const s=this.chart,i=this.axis,r=i.date(e);let n;if(this._formatter)n=this._formatter.toStr(r,s.startOfWeek);else{const e=this._formats,o=i.tick._scale,a=Rt.getFormatter;switch(o){case 7:n=a(e[o].format).toStr(r,s.startOfWeek);break;case 6:n=0===t||0===r.getMonth()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 5:case 4:n=0===t||1===r.getDate()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 3:n=0===t||0===r.getHours()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 2:n=0===t||0===r.getMinutes()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 1:n=0===t||0===r.getSeconds()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek);break;case 0:n=0===t||0===r.getMilliseconds()?a(e[o].beginningFormat).toStr(r,s.startOfWeek):a(e[o].format).toStr(r,s.startOfWeek)}}return this._getText(n,null,!1,!1)}}vr.defaults=Ee(cr.defaults,{useBeginningFormat:!0});class Sr extends gr{get label(){return this._label}_createTickModel(){return new br(this)}_createLabel(){return new vr(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}_doBuildTicks(t,e,s,i){return isNaN(t)||t!==e||(this._tick._scale=this.$_inferScale(t)),super._doBuildTicks(t,e,s,i)}collectValues(){this._offset=60*b(this.chart.timeOffset,0)*1e3,super.collectValues()}getBaseValue(){const t=this._op.baseValue;return h(t)?t:o(t)?new Date(t).getTime()+b(this._offset,0):NaN}getValue(t){return h(t)?t:t instanceof this._dateClass?t.getTime():o(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(o(e)){const s=parseFloat(e);if(0!=s){let i=new Date(t);switch(e.charAt(e.length-1)){case"y":i.setFullYear(i.getFullYear()+s);break;case"m":i.setMonth(i.getMonth()+s);break;case"d":i.setDate(i.getDate()+s);break;case"w":i.setDate(i.getDate()+7*s);break;case"h":i.setHours(i.getHours()+s);break;case"n":i.setMinutes(i.getMinutes()+s);break;case"s":i.setSeconds(i.getSeconds()+s)}return+i}return t}return t+e}date(t){return new Date(t)}axisValueAt(t,e){return new Date(this.valueAt(t,e))}value2Tooltip(t){return isNaN(t)?this.chart._tooltip.options.nanText:new Date(t)}getXLabel(t){return isNaN(t)?NaN:new Date(t)}$_inferScale(t){const e=this.date(t);return 0!==e.getMilliseconds()?0:0!==e.getSeconds()?1:0!==e.getMinutes()?2:0!==e.getHours()?3:4}}Sr.type="time",Sr.subtype="date",Sr.defaults=Ee(gr.defaults,{baseValue:NaN});class Vr extends ai{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Ar extends Gi{pointLabelCount(){return 2}_createLegendMarker(t,e){return zs.create(t,Li.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Vr(t)}_getBottomValue(t){return t.lowValue}}Ar.type="barrange",Ar.defaults=Ee(Gi.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Pr extends ri{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class kr extends zi{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Pr(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}kr.defaults=Ee(zi.defaults,{colorByPoint:!1,pointOffset:0});class Cr extends kr{canDepth(){return!0}_createLegendMarker(t,e){return zs.create(t,Li.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Cr.type="bar";class Lr extends Xi{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?S(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=b(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+=b(t.options.distance,0),e+=t.depth}))}else t.forEach((t=>{t._groupDistance=t.distance}))}}Lr.defaults=Ee(Xi.defaults,{depth:10,distance:5});class Nr extends Lr{_canContain(t){return t instanceof Cr}}Nr.type="bargroup",Nr.seriesType="bar";class Mr extends Jt{constructor(t){super(t,Li.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 Er extends Mr{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 Tr extends Mr{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 Br 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(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 Or extends Mr{constructor(t){super(t),this.insertFirst(this._line=new Br(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 Rr extends ri{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class Dr extends Ei{}Dr.defaults=Ee(Ei.defaults,{radius:4,hoverScale:1.75});class $r extends wi{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?$r.ALIGN_GAP:0:t}getPosition(){return v(this._op.position,"default")}}$r.ALIGN_GAP=4,$r.defaults=Ee(wi.defaults,{align:"center"});class Fr extends Mi{_doInit(t){super._doInit(t),t.marker=(this._marker=new Dr(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return w(t.radius,this.marker.options.radius,Dr.defaults.radius)}buildLines(t){return this._lines||(this._lines=this._doBuildLines(t,this.getDropPoints())),this._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new $r(t)}_createPoint(t){return new Rr(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Or(t)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.render(this.getShape(null),m(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}}Fr.defaults=Ee(Li.defaults,{nullAsBase:!1});class Ir extends $e{constructor(t){super(t.chart),this.series=t}label(){const t=this._op.text||this.series.displayName();return this._getText(t,null,!1,!1)}getDefaultIconPos(){return"left"}}Ir.defaults=Ee($e.defaults,{visible:!1,offset:8});class zr extends Fr{_doInit(t){super._doInit(t),t.flag=(this._flag=new Ir(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(l(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 Ur||this._group instanceof Zr?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=S(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}}zr.type=Ks,zr.defaults=Ee(Fr.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class Hr extends zr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}Hr.type="spline";class Gr extends Rr{}class jr extends zr{_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=b(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 Er(t)}_createPoint(t){return new Gr(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=Qs,jr.defaults=Ee(Fr.defaults,{});class Wr extends Gr{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 c(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[b(s.lowField,0+i)],this.y=e[b(s.yField,1+i)],i>0&&(this.x=e[b(s.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=v(e[t.options.lowField],e.low),this.y=S(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class Xr extends $r{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class Yr extends Fr{pointLabelCount(){return 2}_createLabel(t){return new Xr(t)}_createLegendMarker(t,e){return new Tr(t)}_createPoint(t){return new Wr(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}}Yr.type="arearange",Yr.defaults=Ee(Fr.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Ur extends ji{_canContain(t){return t instanceof zr}getBaseValue(t){return t===this._yAxisObj?S(this._op.baseValue,t.getBaseValue(),0):NaN}}Ur.type="linegroup",Ur.seriesType=Ks,Ur.defaults=Ee(ji.defaults,{lineType:"default"});class Zr 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?S(this._op.baseValue,t.getBaseValue(),0):NaN}}Zr.type="areagroup",Zr.seriesType=Qs,Zr.defaults=Ee(ji.defaults,{lineType:"default"});class qr extends Gr{}class Kr 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 qr(t)}_doLoadData(t){const e=super._doLoadData(t);if(r(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return(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 _}}Kr.type="bellcurve",Kr.defaults=Ee(jr.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class Qr extends ri{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 c(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[b(s.xField,0)]),this.min=e[b(s.minField,0+i)],this.low=e[b(s.lowField,1+i)],this.mid=e[b(s.midField,2+i)],this.high=e[b(s.highField,3+i)],this.y=e[w(s.maxField,t.options.yField,4+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.min=v(e[s.minField],e.min),this.low=v(e[s.lowField],e.low),this.mid=v(e[s.midField],e.mid),this.high=v(e[s.highField],e.high),this.y=v(e[s.maxField],this.y),this.minLabel=e.minLabel}_readSingle(t){super._readSingle(t),this.min=this.low=this.mid=this.high=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.minValue)||isNaN(this.lowValue)||isNaN(this.midValue))}initValues(){this.minValue=parseFloat(this.min),this.lowValue=parseFloat(this.low),this.midValue=parseFloat(this.mid),this.highValue=parseFloat(this.high)}initPrev(t,e){e.yValue=e.highValue=e.midValue=e.lowValue=e.minValue=this.minValue}applyValueRate(t,e){this.minValue=V(t.minValue,this.minValue,e),this.lowValue=V(t.lowValue,this.lowValue,e),this.midValue=V(t.midValue,this.midValue,e),this.highValue=V(t.highValue,this.highValue,e)}}class Jr extends Gi{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new Qr(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return zs.create(t,Li.LEGEND_MARKER,0,0,e,e,2)}}Jr.type="boxplot",Jr.defaults=Ee(Gi.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 tn 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 en=2*Math.PI,sn=-Math.PI/2;class rn extends Jt{constructor(t){super(t,Li.LEGEND_MARKER),this._sectors=[],this.add(this._back=new zs(t)),this._back.setStyle("visibility","hidden")}setColorResolver(t){this._colorResolver=t}setColor(t){this._colorResolver&&this._applyColors(this._colorResolver())}render(t,e,s){if(this._size===t&&this._sectors.length===e)return void this._applyColors(s);this._size=t;const i=t/2,r=i,n=i;this._back.setBounds(0,0,t,t),this._sectors.forEach((t=>t.remove())),this._sectors=[];const o=en/e;let a=sn;for(let t=0;t<e;t++){const t={cx:r,cy:n,rx:i,ry:i,start:a,angle:o,clockwise:!0},e=new tn(this.doc,null,t);e.setStroke("none"),this.add(e),this._sectors.push(e),a+=o}this._applyColors(s)}_applyColors(t){for(let e=0;e<this._sectors.length;e++){const s=t&&t[e]||"#ccc";this._sectors[e].setFill(s)}}}class nn{get color(){return this.legendColor()}get series(){var t;return null===(t=this._pie)||void 0===t?void 0:t.parentSeries}get pie(){return this._pie}get sliceCount(){return this._sliceCount}get visible(){return this._visible}set visible(t){var e;this._visible!==t&&(this._visible=t,null===(e=this._pie.chart)||void 0===e||e._visibleChanged(this._pie))}legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){if(this._explicitColor)return this._explicitColor;return`var(--color-${(this._pie._paletteOffset+this.index)%Ci+1})`}legendStroke(){return null}legendLabel(){return this.label}legendKey(){const t=this._pie.parentSeries.options.legendKey;return(t||this._pie.hash)+":"+this.field}isEmpty(){return!1}getParam(t){return"name"===t?this.label:this[t]}}class on{get field(){return this.source.field}get label(){return this.source.label}get index(){return this.source.index}getParam(t){var e;return null!==(e=this[t])&&void 0!==e?e:this.source.getParam(t)}}class an extends oi{}class hn extends Oe{get fields(){return this._fields}get categories(){return this._categories}get colors(){return this._sliceColors}get hasExplicitColors(){return this._sliceColors.length>0}get startRad(){return this._startRad}get totalRad(){return this._totalRad}get clockwise(){return this._clockwise}get innerRadiusDim(){return this._innerRadiusDim}get visibleInLegend(){return!0===this._op.visibleInLegend}get parentSeries(){return this._parentSeries}_setParentSeries(t){this._parentSeries=t}get _paletteOffset(){const t=this._parentSeries;if(!t)return 0;const e=t.chart._getSeries()._internalSeries();let s=0;for(const i of e){if(i===t)break;i instanceof ln&&i.pie&&i.pie.fields.length>0&&(s+=i.pie.fields.length)}return s}getLegendSources(){return this._legendSources}isFieldVisible(t){const e=this._legendSources;return!e||!e[t]||!1!==e[t].visible}calcSlices(t){const e=this._fields;if(!e||0===e.length||!t)return null;const s=[];for(let i=0;i<e.length;i++){if(!this.isFieldVisible(i))continue;const r=this._getFieldValue(t,e[i]),n=h(r)&&r>0?r:0;n>0&&s.push({index:i,value:n})}if(0===s.length)return null;const i=s.reduce(((t,e)=>t+e.value),0);if(i<=0)return null;const r=this._sliceColors,n=this._clockwise?1:-1,o=this._totalRad;let a=this._startRad;const l=[];for(let t=0;t<s.length;t++){const e=s[t],h=n*(e.value/i)*o,_=this._legendSources[e.index];if(_){const t=new on;t.source=_,t.value=e.value,t.percent=Math.round(e.value/i*1e4)/100,t.startAngle=a,t.angle=h,t.color=r.length>0?r[e.index%r.length]:null,l.push(t)}a+=h}return l}resolveSliceColors(t){if(!t||this._sliceColors.length>0)return;const e=this._paletteOffset;for(let s=0;s<t.length;s++)t[s].color=`var(--color-${(e+t[s].index)%Ci+1})`}getLegendSliceColors(){const t=this._fields.length,e=this._sliceColors,s=[],i=this._paletteOffset;for(let r=0;r<t;r++)s.push(e.length>0?e[r%e.length]:`var(--color-${(i+r)%Ci+1})`);return s}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}_doSetSimple(t){return l(t)?(this._op.visible=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._fields=(t.fields||[]).map((t=>String(t))),this._categories=r(t.categories)&&t.categories.length>0?t.categories:this._fields;const e=t.colors;r(e)?this._sliceColors=e:o(e)?e.endsWith("@pal")||e.endsWith("@palette")?this._sliceColors=this.chart.getPaletteColors(e.split("@")[0])||[]:this._sliceColors=this.chart.getPaletteColors(e)||[]:this._sliceColors=[],this._startRad=T+B*b(t.startAngle%360,0);const s=b(t.totalAngle,360);this._totalRad=B*x(0,m(360,s<=0?360:s)),this._clockwise=!1!==t.clockwise,t.innerRadius?this._innerRadiusDim=W(t.innerRadius,!0):this._innerRadiusDim=null,this._buildLegendSources()}_buildLegendSources(){const t=this._legendSources,e=this._fields,s=this._sliceColors,i=this._categories,r=e.length;this._legendSources=e.map(((e,n)=>{const o=s.length>0?s[n%s.length]:null,a=null==t?void 0:t.find((t=>t.legendKey()===this.hash+":"+e)),h=new nn;return h._pie=this,h.field=e,h.label=i[n]||e,h.index=n,h._sliceCount=r,h._explicitColor=o,h._visible=!a||a.visible,h}))}_getFieldValue(t,e){if(t)return t[r(t)?+e:e]}}hn.defaults=Ee(Oe.defaults,{startAngle:0,totalAngle:360,clockwise:!0,visibleInLegend:!1,tooltipText:"${label}: ${value} (${percent}%)"});class ln extends Yi{_doInit(t){super._doInit(t),t.pie=(this._pie=new hn(this.chart)).init(),this._pie._setParentSeries(this)}get pie(){return this._pie}get pieLegendMarker(){return this._pieLegendMarker}getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:Y(this._minSizeDim,t),max:Y(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}getTooltipText(t,e){const s=this._hoveredSlice;if(s&&this._pie){const t=this._pie.options;let i;return t.tooltipCallback&&(this._getPointCallbackArgs(this._pointArgs,e),this._pointArgs.slice=s,i=t.tooltipCallback(this._pointArgs)),void 0===i&&(i=t.tooltipText||"${label}: ${value} (${percent}%)"),i}return super.getTooltipText(t,e)}getTooltipParam(t,e,s){var i;const r=this._hoveredSlice;return r&&null!==(i=r.getParam(s))&&void 0!==i?i:super.getTooltipParam(t,e,s)}getTooltipHeaderColor(t){var e,s;return null!==(s=null===(e=this._hoveredSlice)||void 0===e?void 0:e.color)&&void 0!==s?s:null}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new an(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_createLegendMarker(t,e){const s=this._pie;if(s&&s.visible&&s.fields.length>0){const i=new rn(t);return i.render(e,s.fields.length,[]),i.setColorResolver((()=>s.getLegendSliceColors())),i}return super._createLegendMarker(t,e)}getLegendSources(t){const e=this._pie,s=e&&e.visible&&e.visibleInLegend&&e.fields.length>0,i=s?this._op.legendMode||"both":null;"slice"!==i&&super.getLegendSources(t),s&&"series"!==i&&e.getLegendSources().forEach((e=>t.push(e)))}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach((s=>{s.isNull||isNaN(s.zValue)||(t=m(t,s.zValue),e=x(e,s.zValue))})),this._noSize=(this._zMin=t)===(this._zMax=e),this._pie&&this._pie.visible&&this._pie.fields.length>0&&this._visPoints.forEach((t=>{t.isNull||(t.pieSlices=this._pie.calcSlices(t.source))}))}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}getPointAt(t,e){o(t)&&(t=this._xAxisObj.getValue(t)),o(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}}}ln.type="bubble",ln.defaults=Ee(Yi.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 _n extends Wi{_canContain(t){return t instanceof zr}_doConstraintYValues(t){const e={};t.forEach((t=>{t._visPoints.forEach((t=>{if(!1!==t.visible){const s=t.xValue,i=e[s];i?i.push(t):e[s]=[t]}}))}));for(const t in e)e[t].sort(((t,e)=>t.yValue-e.yValue)).forEach(((t,e)=>{t.yLabel=v(t.yLabel,t.yValue),t.yValue=t.yGroup=e}));return at.makeIntArray(0,t.length)}}_n.type="bump",_n.seriesType=Ks;class cn extends ri{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return c(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[b(s.xField,0)]),this.low=e[b(s.lowField,0+i)],this.close=e[b(s.closeField,1+i)],this.open=e[b(s.openField,2+i)],this.y=e[w(s.highField,t.options.yField,3+i)]}}_readObject(t,e){super._readObject(t,e);const s=t.options;this.low=v(e[s.lowField],e.low),this.open=v(e[s.openField],e.open),this.close=v(e[s.closeField],e.close),this.y=S(e[s.highField],e.high,this.y)}_readSingle(t){super._readSingle(t),this.low=this.close=this.open=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue)||isNaN(this.openValue)||isNaN(this.closeValue))}initValues(){this.lowValue=parseFloat(this.low),this.openValue=parseFloat(this.open),this.closeValue=parseFloat(this.close)}initPrev(t,e){e.yValue=e.lowValue=e.openValue=e.closeValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e),this.openValue=V(t.openValue,this.openValue,e),this.closeValue=V(t.closeValue,this.closeValue,e)}}class dn extends Gi{canCategorized(){return!0}_createPoint(t){return new cn(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,Li.LEGEND_MARKER).setPath(s.end())}}dn.type="candlestick",dn.defaults=Ee(Gi.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class un extends Ii{}un.defaults=Ee(wi.defaults,{position:"inside"});class pn extends kr{get pointLabel(){return this._pointLabel}_createLabel(t){return new un(t)}}pn.type=Js;class gn extends Lr{_canContain(t){return t instanceof pn}}gn.type="circlebargroup",gn.seriesType=Js;class fn extends ai{}class mn extends Ei{}mn.defaults=Ee(Ei.defaults,{radius:4,shape:"circle"});class xn extends Gi{_doInit(t){super._doInit(t),t.marker=(this._marker=new mn(this)).init(),t.lowMarker=(this._lowMarker=new mn(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)+x(0,this.marker.options.radius)}_createPoint(t){return new fn(t)}prepareAfter(){const t=this.marker.options,e=this.lowMarker.options,s=t.radius,i=t.shape,r=b(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()}}xn.type="dumbbell";class yn extends ri{}class bn extends zi{getSegmentSize(t){return Y(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new yn(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,Li.LEGEND_MARKER).setPath(s.end())}}bn.type="equalizer",bn.defaults=Ee(zi.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class wn extends Gi{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new ai(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,Li.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}_getBottomValue(t){return t.lowValue}}wn.type="errorbar",wn.defaults=Ee(Gi.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class vn extends Ti{}class Sn extends vn{constructor(t,e){super(t),this.points=e}}class Vn extends Oi{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?Vn.ENDED_DIST:Vn.OUTSIDE_DIST:this._op.distance||0}}Vn.OUTSIDE_DIST=25,Vn.ENDED_DIST=10;class An extends Di{getSize(t,e){return{width:x(.1*t,Y(this._widthDim,t)),height:x(.1*e,Y(this._heightDim,e))}}getNeckSize(t,e){return{width:at.clamp(Y(this._neckWidthDim,t),this._minNeckWidth,t),height:at.clamp(Y(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new Vn(t)}_createPoint(t){return new vn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Sn(t,e)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.width)!==e._width&&(e._width=s,e._widthDim=X(e._width,An.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=X(e._height,An.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=X(e._neckWidth,An.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=X(e._neckHeight,An.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}An.type="funnel",An.defaults=Ee(Di.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class Pn extends ri{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return c(super._assignTo(t),{min:this.min,max:this.max})}}const kn={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 Cn extends Mi{getBinCount(t){const e=b(this._op.binWidth,0);if(e>0)return t/e;return b(this._op.binsNumber,0)<1?kn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new Pn(t)}_doLoadPoints(t){function e(t){let e;return e=r(t)?t[b(this.yField,0)]:i(t)?S(t[this.yField],t.y,t.value):t,parseFloat(e)}const s=this._op,n=[];let o=[];for(let s=0;s<t.length;s++){const i=e(t[s]);isNaN(i)||o.push(i)}if(o.length>0){o=o.sort(((t,e)=>t-e)),s.minValue<o[0]&&o.unshift(s.minValue),s.maxValue>o[o.length-1]&&o.push(s.maxValue);const t=o.length,e=o[0],i=o[t-1],r=this.getBinCount(t),a=this._binInterval=(i-e)/r;let h=0,l=e,_=l+a;for(let e=0;e<r;e++){let s=0;if(e==r-1)s=t-h;else for(;h<t&&o[h]<_;)s++,h++;n.push({x:l,y:s,min:l,max:e===r-1?i:_}),l=_,_=l+a}}super._doLoadPoints(n)}collectValues(t,e){super.collectValues(t,e),e&&(t===this._xAxisObj?e.push(this._visPoints[this._visPoints.length-1].max):t===this._yAxisObj&&e.push(this._base))}_doPrepareRender(){super._doPrepareRender(),this._base=w(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,Li.LEGEND_MARKER,0,0,e,e,2)}}Cn.type="histogram",Cn.defaults=Ee(Li.defaults,{baseValue:0,binsNumber:"squreRoot"});class Ln extends Ei{}Ln.defaults=Ee(Ei.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class Nn extends ri{_assignTo(t){return c(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[b(r.xField,0)]),this.y=e[b(r.yField,0+n)],this.radius=e[b(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=v(e[t.options.radiusField],e.radius)}}class Mn extends zi{_doInit(t){super._doInit(t),t.marker=(this._marker=new Ln(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 Nn(t)}prepareAfter(){const t=this.marker.options,e=t.radius,s=t.shape,i=this.options.radiusField,r=x(t.minRadius,0),n=x(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()}}Mn.type="lollipop";class En extends cn{}class Tn extends dn{_createPoint(t){return new En(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,Li.LEGEND_MARKER).setPath(s.end());return i.setStyle("strokeWidth","2px"),i}}Tn.type="ohlc";class Bn extends Rr{}class On extends Fr{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Bn(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+b(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)}}}On.type="pareto",On.defaults=Ee(Fr.defaults,{curved:!1});class Rn extends Ti{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 c(super._assignTo(t),{sliced:this.sliced})}}class Dn extends Rn{constructor(t,e){super(t),this.points=e}}class $n extends $e{getDefaultIconPos(){return"left"}}class Fn extends Oi{getDistance(t,e,s){return s>0&&(e-=e*s),this._distanceDim?Y(this._distanceDim,e,0):t?Y(s?Fn.INNER_DIST:Fn.INSIDE_DIST,e):"far"===this._op.align?Fn.ENDED_DIST:Fn.OUTSIDE_DIST}}Fn.INSIDE_DIST=W("30%",!1),Fn.INNER_DIST=W("50%",!1),Fn.OUTSIDE_DIST=25,Fn.ENDED_DIST=10,Fn.defaults=Ee(Oi.defaults,{radius:.7,rotationMode:"arc"});class In extends Oe{getLength(){return this.visible?this._op.length:0}_isVisible(){return this._op.visible&&this._op.length>0}_doSetSimple(t){return h(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.length=x(0,b(t.length,0)),t.ratio=x(.3,m(.8,b(t.ratio,In.DEPTH_RATIO)))}}In.DEPTH_RATIO=.6,In.defaults=Ee(Oe.defaults,{visible:!1,length:25,ratio:In.DEPTH_RATIO});class zn extends $i{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new $n(this.chart)).init(),t.depth=(this._depth=new In(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?Y(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new Fn(t)}_createPoint(t){return new Rn(t)}_createOthersPoint(t,e){return t.y=e.map((t=>t.y)).reduce(((t,e)=>t+e)),new Dn(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=T+B*b(this._op.startAngle%360,0),this._totalRad=B*x(0,m(360,b(this._op.totalAngle,360))),this._groupPos=NaN}}zn.type="pie",zn.defaults=Ee($i.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class Hn extends ji{getPolarSize(t,e){return Y(this._polarDim,m(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=W(s,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=W(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof zn}_doPrepareSeries(t){const e=t.map((t=>t.options.groupSize)).reduce(((t,e)=>t+b(e,1)),0);let s=0;t.forEach((t=>{t._groupPos=s,s+=t._groupSize=b(t.options.groupSize,1)/e}))}}Hn.type="piegroup",Hn.seriesType="pie",Hn.defaults=Ee(ji.defaults,{polarSize:"80%",innerSize:0});class Gn extends ri{}class jn extends Yi{_createPoint(t){return new Gn(t)}_getNoClip(t){const e=super._getNoClip(t);return!l(e)||e}_createLegendMarker(t,e){return new Mr(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),m(e/2,this._op.radius)),s}}jn.type="scatter",jn.defaults=Ee(Yi.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Wn extends ri{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 Xn extends wi{}Xn.defaults=Ee(wi.defaults,{offset:0});class Yn extends Hi{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new Xn(t)}_createPoint(t){return new Wn(t)}_createLegendMarker(t,e){return zs.create(t,Li.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}}Yn.type="waterfall",Yn.defaults=Ee(Hi.defaults,{tooltipDetail:"<b>${y}</b>"});class Un extends _r{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=[],_=x(1,d(t/e))+1;if(r-i>=.5){if(0===h)return isNaN(i)?[]:[i];let t=h/(_-1);const e=o(Math.floor(n(t))),c=this._getStepMultiples(e);if(t/=e,c&&c.length>0)if(t>c[0]){for(let e=0;e<c.length-1;e++)if(t>c[e]&&t<c[e+1]){t=t<=c[e]+(c[e+1]-c[e])/2?c[e]:c[e+1];break}}else t=c[0];t*=e,(t<=0||!isFinite(t))&&(t=h/_),i=isNaN(s)?this._normalizeMin(i,t):s-u((s-i)/t)*t;const d=this.axis,p=Math.pow(d._logBase,r-i)>d._roundThreshold,g=.5;let f=i,m=a(f);for(l.push(m);m<r;)f+=t,m=a(p?Math.round(f):f),m>l[l.length-1]&&(m<r&&(1==l.length&&m-l[l.length-1]<t||l.length>1&&m-l[l.length-1]<(l[l.length-1]-l[l.length-2])*g)&&l.pop(),l.push(m))}else{i=o(i);const t=(r=o(r))-i;let e=t/(_-1);const s=o(d(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/_);const h=1e-10*e;let c=d(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}}Un.defaults=Ee(_r.defaults,{arrangeDecimals:!0});class Zn extends gr{_isLog(){return!0}_createLabel(){return new dr(this)}_createTickModel(){return new Un(this)}_doApply(t){super._doApply(t);const e=this._logBase=x(2,b(t.logBase,10));this._roundThreshold=b(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=d(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)}contains(t){return t>0&&super.contains(this._log(t))}trimRange(t,e){const s=t>0?this._log(t):NaN,i=e>0?this._log(e):NaN,[r,n]=super.trimRange(s,i);return[this._pow(r),this._pow(n)]}_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=m(n,r(t[e])-r(t[e-1]));const o=i-s,a=n/o;return{len:b(e*=a,1),min:o*a}}_doApplyBreak(t){t&&t.from>0&&t.to>0&&(t.from=this._log(t.from),t.to=this._log(t.to)),super._doApplyBreak(t)}}Zn.type="log",Zn.defaults=Ee(gr.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 Kn extends Re{load(t){const e=this.chart,s=this._items=[];r(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 Qn="$ctrl";class Jn extends Oe{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Jn.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 to 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"!==v(this._op.scope,"auto")?this._op.scope:this.chart.chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}to.defaults=Ee(Oe.defaults,{scope:"auto"});class eo extends Oe{_doInit(t){t.pointHovering=(this._pointHovering=new to(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 so;eo.defaults=Ee(Oe.defaults,{paletteMode:"normal",animatable:!0,hoverable:!0,clickable:!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"}(so||(so={}));class io 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 eo(this)).init(),(this._title=new tr(this)).init(),(this._subtitle=new er(this)).init(),(this._legend=new Rs(this)).init(),(this._credits=new Jn(this)).init(),(this._tooltip=new sr(this)).init(),this._buttons=new Kn(this),io.split_class&&(this._split=new io.split_class(this)).init(),(this._body=new Ts(this)).init(),(this._navigator=new Ji(this)).init(),(this._exporter=new Bs(this)).init(),this._series=new Ni(this),this._xAxes=new ls(this,!0),this._yAxes=new ls(this,!1),this._gauges=new fs(this),this._annotations=new He(this),i(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},io.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[Qn]).win()}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new io(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}hoverable(){return!1!==this._chartOptions.options.hoverable}clickable(){return!1!==this._chartOptions.options.clickable}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 so.LEFT:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case so.RIGHT:r=s.filter((t=>t._isOpposite));break;case so.BOTTOM:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case so.TOP:r=i.filter((t=>t._isOpposite))}else switch(t){case so.LEFT:r=i.filter((t=>!t._isOpposite&&!t._isBetween));break;case so.RIGHT:r=i.filter((t=>t._isOpposite));break;case so.BOTTOM:r=s.filter((t=>!t._isOpposite&&!t._isBetween));break;case so.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 io.defaults)t.hasOwnProperty(e)&&(s[e]=t[e]);s.type=s.type||"bar",s.gaugeType=s.gaugeType||"circle",this._polar=!0===this.polar}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&Be(n={},r.base),i(r[s])&&(n||(n={}),Be(n,r[s])),n?Be(n,t):t}_load(t){var e,s;const r=this._initOptions();return this.$_loadTemplates(t.templates),this._setProperties(t),r.asset=this._assets.load(v(t.asset,t.assets)),r.options=r.chart=this._chartOptions._load(v(t.chart,t.options)),i(t.chart)?this._credits._load(t.chart.credits):i(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(v(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(v(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(S(t.xAxis,t.xAxes,{})),this._yAxes.load(S(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(s=this._split)||void 0===s||s._load(t.split),this._annotations.load(v(t.annotation,t.annotations),!1),r.seriesNavigator=this._navigator._load(t.seriesNavigator),r.exporting=this._exporter._load(t.exporting),this}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof 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<=Ci;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(i(t)){const s=this._templates={};for(const e in t){const r=t[e];i(r)&&(s[e]=c({},r))}["@xAxis","@yAxis","@series","@gauge","@annotation","@button"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(o(e)){let s=this._templates[e];if(s)return Be(Be({},s),t)}else r(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 o(t)&&xi[t.toLowerCase()]}_getSeriesType(t){return o(t)&&mi[t.toLowerCase()]}_getAxisType(t){return o(t)&&Xe[t.toLowerCase()]}_getGaugeType(t){return o(t)&&cs[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&ds[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&Ie[t.toLowerCase()]}getAxesGap(){return b(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)}}io.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},hs.register(ci,fr,Zn,Sr),Li.register(jr,Yr,Ar,Cr,Kr,Jr,ln,dn,pn,xn,bn,wn,An,Cn,zr,Hr,Mn,Tn,On,zn,jn,Yn),ji.register(Zr,Nr,_n,gn,Ur,Hn),ji.registerSeries(Zr,Nr,gn,Ur,Hn),ze.register(or,ar,hr);class ro{constructor(t,e){this._modelCallback=e,this._obj=new io(t,this),this._loaded=i(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[Qn]=null===(t=this[Qn])||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 o(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart";at.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new io(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,at.log("chart-items:",Me),at.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(){this._obj.render()}setParam(t,e,s){this._obj.setParam(t,e,s)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[Qn].refresh()}}class no{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 oo 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 ao=Object.freeze({x:0,y:0,width:0,height:0});function ho(t){return{width:t.width,height:t.height}}const lo=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))]))},_o=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},co=function(t,e){const s=t.map((([t,s])=>t*e[0]+s*e[1]));return[Math.min(...s),Math.max(...s)]},uo=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},po=function(t,e){const s=lo(t),i=lo(e),r=_o(s),n=_o(i);for(const t of[...r,...n]){const e=co(s,t),r=co(i,t);if(!uo(e,r))return!1}return!0},go=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 fo{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new fo(t,t,t,t):new fo(t,t,e,e):new fo(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 fo(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=b(t.paddingLeft,0),this.right=b(t.paddingRight,0),this.top=b(t.paddingTop,0),this.bottom=b(t.paddingBottom,0),this}applyMargin(t){return this.left=b(t.marginLeft,0),this.right=b(t.marginRight,0),this.top=b(t.marginTop,0),this.bottom=b(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}}}fo.Empty=Object.freeze(new fo),fo.Temp=new fo;class mo extends Jt{constructor(t,e=N){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 xo extends Jt{constructor(t,e=N){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 xo{constructor(t,e,s){super(t,e),this._margins=new fo,this._paddings=new fo,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 bo 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 wo extends xo{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 vo extends Jt{constructor(t,e,s){super(t,s,"image"),this._bounds=ao,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},this.onerrorProxy=()=>{},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this.invalidate()},this.dom.onerror=()=>{this.onerrorProxy(),this.invalidate()},window.SVGGraphicsElement&&!ot||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout((()=>{this.onloadProxy()}),0)},this._proxy.onerror=()=>{this.onerrorProxy(),this.invalidate()})}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 t||(t=NaN),e||(e=NaN),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 So extends mo{constructor(e,s=N){super(e),this.add(this._text=new ue(e,s)),this._text.anchor=t.TextAnchor.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options.effect;return this._model=e,this._text.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&&s!==this._failedIconUrl?(this._icon||this.add(this._icon=new vo(t,!1)),this._icon.setImage(s,+this._model.options.iconWidth,+this._model.options.iconHeight),this._icon.onerrorProxy=()=>{var t,e;this._failedIconUrl=null===(t=this._icon)||void 0===t?void 0:t.url,null===(e=this._icon)||void 0===e||e.remove(),this._icon=null,this._box=void 0,this.invalidate()}):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(null==s?void 0:s.autoContrast){const e=this._back&&this._back.parent?this._back.dom:t;e&&this._text.setContrast(e,s.darkStyle||"rct-label-dark",s.lightStyle||"rct-label-light")}if(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(e){const s=this._text,i=this._outline,r=this._icon;let n=0;const o=s.getBBox(),a=o.width,h=o.height;let l=a,_=h,c=0,d=0,u=0,p=0;if(this._box=void 0,r){const t=r.getBBox();n=b(this._model.options.iconGap,0);const e=b(+this._model.options.iconWidth,0),s=b(+this._model.options.iconHeight,0);switch(c=t.width||e||s,d=t.height||s||e,this._model.getIconPos()){case"left":case"right":l+=n+c,_=Math.max(d,h);break;default:_+=n+d,l=Math.max(c,a)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);u=parseFloat(t.paddingLeft)||0,p=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,l+u+(parseFloat(t.paddingRight)||0),_+p+(parseFloat(t.paddingBottom)||0),t.rx)}if(r)switch(this._model.getIconPos()){case"left":r.trans(u,(_-d)/2),u+=c+n,l-=c+n;break;case"right":r.trans(u+l-c,(_-d)/2),l-=c+n;break;case"top":r.trans((l-c)/2,p),p+=d+n;break;case"bottom":r.trans((l-c)/2,p+h+n)}switch(e){case"center":u+=l/2,s.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=l,s.anchor=t.TextAnchor.END;break;default:s.anchor=t.TextAnchor.START}return s.trans(u,p),i&&(i.anchor=s.anchor,i.setAttr("y",s.getAttr("y")),i.trans(s.tx,s.ty)),this._iconBox=r?{x:r.tx,y:r.ty,width:c,height:d}:null,this}getLayoutBox(){const t=this.getBBox(),e=this._iconBox;if(!e)return t;const s=Math.min(t.x,e.x),i=Math.min(t.y,e.y);return{x:s,y:i,width:Math.max(t.x+t.width,e.x+e.width)-s,height:Math.max(t.y+t.height,e.y+e.height)-i}}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 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()*B,e=this.getBBox();return y(g(t)*e.height)+y(p(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*B,e=this.getBBox();return y(p(t)*e.height)+y(g(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=ho(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(e){const s=this._textView,i=s.getStyle("writing-mode"),r=i===it||i===rt;e?this.rotation=0:this.setRotation(0,(r?this.width:this.height)/2,this._angle);let n=this._margins.top+this._paddings.top,o=0;switch(this.textAlign()){case"left":s.anchor=t.TextAnchor.START,r||(o-=this.width/2);break;case"right":s.anchor=t.TextAnchor.END,r?n+=this.height:o+=this.width/2;break;default:s.anchor=t.TextAnchor.MIDDLE,r&&(n+=this.height/2)}s.trans(o,n)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}class Ao extends yo{constructor(e){super(e,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new ue(e)),this._textView.anchor=t.TextAnchor.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),ho(this._textView.getBBox())}_doLayout(e){const s=this._textView;let i=this._margins.top+this._paddings.top,r=0;switch(this.textAlign()){case"left":s.anchor=t.TextAnchor.START,r-=this.width/2;break;case"right":s.anchor=t.TextAnchor.END,r+=this.width/2;break;default:s.anchor=t.TextAnchor.MIDDLE}s.trans(r,i)}}class Po extends xo{constructor(t){super(t,Mo.TICK_CLASS),this.add(this._lineView=new Br(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class ko extends So{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){i?(t.prepareRich(i),this.setModel(this.doc,t,t.getIconUrl(t.getIcon(s)),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)):(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 y(g(t)*e.height)+y(p(t)*e.width)}rotatedHeight(){const t=this.rotation*B,e=this.getBBox();return y(p(t)*e.height)+y(g(t)*e.width)}resizeBackByWeight(t,e,s,i,r,n,o,a,h,l=0){const _=this._back;if(_)if(t._isHorz){const t=this.getBBox(),e=i/a;_.transY(-this.ty),_.transX((e-t.width)/-2-h),_.resize(e-1,r)}else{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 Co 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=x(b(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)}this._back.setStyleOrClass(t.flag._style),this._text.setStyleOrClass(t.flag.options.textStyles)}}class Lo extends xo{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=x(0,e),this._page=m(s,e),this._pos=m(t.min+e-s,x(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=x(0,m(t,s)))*(e.max-e.min-(e.end-e.start))/s+e.min}_doMeasure(t,e,s,i,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:i}:{width:s,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,s=e.axis._zoom,i=this._szThumb=b(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 xo{constructor(t){super(t,Mo.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this.add(this._lineView=new Br(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 oo(this._labelContainer,ko,"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=x(0,i.tick._getLength())+x(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsHorz(i,e,!0);i.label._inside?a=t: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.getGap()),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=x(0,i.tick._getLength())+x(0,i.tick._getGap()),a=0;if(this.$_prepareLabels(i,e)){const t=this.$_measureLabelsVert(i,s,!0,0);i.label._inside?a=t: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.getGap()),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 Co(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?m(0,this.width-n.width):x(0,this.width-s.tick._getLength()-n.width),r.trans(i,t-n.height/2))}setMargins(t,e,s,i){}hideCrosshair(){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 Br(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,s.getIconUrl(s.getIcon(e)),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=x(0,m(i-1,h.options.startStep||0)),_=t._ticks,c=_.length,d=(i=x(1,i))*(r=m(x(1,r),_.length)),u=n||0,g=y(u)*B,f=g<35*B;let b,w=!1,v=0;for(let n=0;n<r;n++){let r=n*i+l;for(;r<c;r+=d){let i=0;for(let e=r;e<r+d&&e<c;e++)i+=t.getLabelLength(s,_[e].value);if(r+d<c){b=e.pull(v++),b.rotation=u,b.row=n,b.index=r,this._prepareLabel(b,_[r],h,c,a),b.setVis(!0);const t=i;if(0===u&&b.getBBox().width>=t){w=!0;break}if(f&&b.getBBox().width*p(g)>=t){w=!0;break}if(0!==u&&b.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-d;0<=t&&t<c&&(b=e.pull(v++),b.row=n,b.rotation=u,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=x(0,m(s-1,i.options.startStep||0));e.forEach((t=>t.index=-1));for(let t=r;t<e.length;t+=s)e[t].index=t;return e.forEach((t=>t.setVis(t.index>=0))),e.filter((t=>t.visible))}$_measureLabelsHorz(t,e,s=!1){const i=t.options.reversed,r=t.label,n=r.options;let o=+n.step|0,a=+n.rows|0;const h=a;let l,_=+n.rotation%360,c=this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,_,!1,s),d=this._labelViews._internalItems();if(this._labelRowPts=[0],c)if("none"===n.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,n)=>{e.rotation=_,e.row=0,e.index=i,this._prepareLabel(e,t._ticks[i],r,n,s),e.setVis(!0)})),d=this.$_applyStep(t,d,o||1);else{switch(o=a=0,r.options.autoArrange){case"rows":a=this.$_getRows(d);break;case"step":o=this.$_getStep(d)}if(o>1){const i=t._ticks.length;for(;o<=i&&this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,s);)o++}else if(a>1){const i=h>1?h:x(1,+n.maxRows|0);a=m(h>1?h:a,i);let r=!1;for(;t._ticks.length>a;){if(d.forEach(((t,e)=>{t.row=e%a,t.index=e})),!this.$_checkOverlappedHorz2(t,this._labelViews,e,1,a,0,!1,s)){r=!0;break}if(a>=i)break;a++}if(r)this._labelRowPts=[];else{a=1,o=2;const i=t._ticks.length;for(;o<=i&&this.$_checkOverlappedHorz2(t,this._labelViews,e,o,1,0,!1,s);)o++}}else if((isNaN(_)||Math.abs(Math.tan(_*B))<1)&&(_=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,_,!1,s)){o=2;const i=t._ticks.length;for(;o<=i;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,_,!1,s)){this.$_checkOverlappedHorz2(t,this._labelViews,e,o,a,0,!0,s)&&d.forEach(((t,e)=>{t.rotation=_}));break}o++}}}else;if(d.length>0){if(a>1){const t=!isNaN(_)&&0!=_,e=this._labelRowPts;for(let t=0;t<a;t++)e.push(0);d.forEach((s=>{e[s.row]=x(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(_)||0==_){l=d[0].getBBox().height;for(let t=1;t<d.length;t++)l=x(l,d[t].getBBox().height);if(d.length>1){const e=t._ticks;let s=i?n.lastOverflow:n.firstOverflow;if("hidden"===s){const t=d[0],s=t.rotatedWidth();let i=e[t.index].pos-s/2,r=0;for(let t=1;t<d.length;t++)r=x(r,d[t].getBBox().height);(i+s>d[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(l=r,t.hidden=!0):t.hidden=!1}if(s=i?n.firstOverflow:n.lastOverflow,"hidden"===s){const t=d[d.length-1],s=t.rotatedWidth(),i=d[d.length-2],r=e[t.index-1].pos+i.getBBox().width/2;let n=e[t.index].pos-s/2,o=0;for(let t=0;t<d.length-1;t++)o=x(o,d[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>o?(l=o,t.hidden=!0):t.hidden=!1}}}else{l=d[0].rotatedHeight();for(let t=1;t<d.length;t++)l=x(l,d[t].rotatedHeight())}return l}return 0}$_checkOverlappedVert2(t,e,s,i,r,n){const o=t.label,a=t._ticks,h=a.length,l=x(1,i);let _,c=o.options.startStep||0,d=0;for(;c<h;c+=l){let i=0;for(let e=c;e<c+l&&e<h;e++)i+=t.getLabelLength(s,a[e].value);if(c+l<h&&(_=e.pull(d++),_.rotation=r,_.index=c,this._prepareLabel(_,a[c],o,h,n),_.setVis(!0),_._text.getBBox().height>=i))return!0}const u=c-l;0<=u&&u<h&&(_=e.pull(d++),_.rotation=r,_.index=u,this._prepareLabel(_,a[u],o,h,n),_.setVis(!0)),e.freeFrom(d)}$_measureLabelsVert(t,e,s=!1,i=0){if(i>1&&t instanceof gr)return this._prevWidth;const r=t.label,n=+r.options.rotation%360;let o=x(1,+r.options.step|0);const a=this.$_checkOverlappedVert2(t,this._labelViews,e,o,n,s);let h=this._labelViews._internalItems();if(a)if("none"===r.options.autoArrange)this._labelViews.prepare(t._ticks.length,((e,i,o)=>{e.rotation=n,e.index=i,this._prepareLabel(e,t._ticks[i],r,o,s),e.setVis(!0)})),h=this.$_applyStep(t,h,o||1);else{const i=t._ticks.length;for(;o<=i&&this.$_checkOverlappedVert2(t,this._labelViews,e,++o,n,s););}else;if(this._labelViews.freeHiddens(),h=this._labelViews._internalItems(),h.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",s=this._labelContainer.textAlign()||e;let i;if(isNaN(n)||0===n){h[0].setContrast(null).layout(s),i=h[0].getBBox().width;for(let t=1;t<h.length;t++)h[t].setContrast(null).layout(s),i=x(i,h[t].getBBox().width)}else{h[0].setContrast(null).layout(s),i=h[0].rotatedWidth();for(let t=1;t<h.length;t++)h[t].setContrast(null).layout(s),i=x(i,h[t].rotatedWidth())}return this._prevWidth=i}return 0}$_layoutLabelsHorz(t,e,s,i,r,n,o,a){const h=this.model,l=h instanceof ci&&h.label.options.fillToCategory,_=h.label,c=this._reversed,d=this._labelContainer.textAlign()||"center",u=this._labelRowPts,p=t.get(0).rotation,f=p*B,m=+h.label.options.rows|0,x=p<-15&&p>=-90||p>15&&p<=90,y=t.count,w=b(h._prevRate,1);let v,S,V;if(t.freeHiddens(),t.forEach(((t,_)=>{var m;const x=e[t.index];if(t.setVis(!!x)&&(t.setContrast(null).layout(d),v=t.getBBox(),S=h.prev(x.pos)+(c?n*(1-w):0),V=s?r?o+a+u[t.row]:-a-v.height-u[t.row]:r?o-a-v.height-u[t.row]:a+u[t.row],p<-15&&p>=-90?s?r?(V+=g(f)*v.height/2,t.setRotation(0,v.height/2,-p)):(V-=g(f)*v.height/2,t.setRotation(0,v.height/2,p)):r?(S-=v.width,V-=g(f)*v.height/2,t.setRotation(v.width,v.height/2,-p)):(S-=v.width,V+=g(f)*v.height/2,t.setRotation(v.width,v.height/2,p)):p>15&&p<=90?s?r?(S+=v.width,V-=g(f)*v.height/2,t.setRotation(v.width,v.height/2,-p)):(S-=v.width,V+=g(f)*v.height/2,t.setRotation(v.width,v.height/2,p)):r?(V+=g(f)*v.height/2,t.setRotation(0,v.height/2,-p)):(V-=g(f)*v.height/2,t.setRotation(0,v.height/2,p)):(S-=v.width/2,t.setRotation(v.width/2,0,r?-p:p)),t.trans(S,V),l)){const e=h,s=(e._len-e._minPad-e._maxPad)/(null!==(m=e._weights.get(x.value))&&void 0!==m?m:1),l=n/s,_=e.label.options.align||"center",c="left"===_?(l-v.width)/-2:"right"===_?(l-v.width)/2:0;t.transX(t.tx+c),t.resizeBackByWeight(e,i,r,n,o,a,0,s,c)}})),!l&&!x&&m<2&&y>1){let e=t.get(c?y-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=_.options,r=+i.overflowGap||2;let n=!0;const o=e.rotatedWidth(),a=c?i.lastOverflow:i.firstOverflow;let h,l=e.tx;l+o>=s.tx?"pull"===a?l=s?s.tx-o-r:0:n="hidden"!==a:(h=e.elementToSvg(0,0).x)<0&&("pull"===a?l=Math.min(s.tx-r,h+4):n="hidden"!==a),n?e.transX(l):e.setVis(!1)}(0,e,t.get(c?y-2:1)),e=t.get(c?0:y-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,s){const i=_.options,r=+i.overflowGap||2,o=s.tx+s.rotatedWidth();let a=!0,h=e.tx;const l=e.rotatedWidth(),d=c?i.firstOverflow:i.lastOverflow;let u,p;h<=o?"pull"===d?h=Math.max(o+r,n-l):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(c?1:y-2))}}$_layoutLabelsVert(t,e,s,i,r,n,o,a){var h;const l=this.model,_=l instanceof ci&&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,f=this._labelSize,m=l.tick._getGap();const x=this._reversed,y=x?b(l._prevRate,1):1;let w=x?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;const v=t.get(0).rotation,S=v<-15&&v>=-90||v>15&&v<=90;t.forEach(((t,h)=>{var c;const b=e[t.index];if(t.setVis(!!b)){t.setContrast(null).layout(u);const e=t.getBBox(),h=S?t.rotatedHeight():e.height,V=S?t.rotatedWidth():e.width,A=function(t,e){if(s)if(r)switch(t){case"center":return(f-e)/2-f-m-a;case"left":return-f-m-a;default:return-e-m-a}else switch(t){case"right":return n+a+m+f-e;case"center":return!p.visible&&i?(n-e)/2:n+a+m+(f-e)/2;default:return n+a+m}else if(r)switch(t){case"center":return a+(n-g-e-a+m)/2;case"right":return n-e-g+m;default:return a}else switch(t){case"left":return g-m;case"center":return!p.visible&&i?(n-e)/2:g+(n-g-e-a-m)/2;default:return n-a-e}}(u,V)+(V-e.width)/2,P=o*y-l.prev(b.pos)-e.height/2;if(0===v||isNaN(v)||t.setRotation(e.width/2,e.height/2,v),t.trans(A,P),_){const s=(l._len-l._minPad-l._maxPad)/(null!==(c=l._weights.get(b.value))&&void 0!==c?c:1),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,m,s,_,g)}else!x&&t.ty+h>w+1||x&&t.ty<w-1?t.setVis(!1):w=x?t.ty+h:t.ty}}))}$_layoutUnitHorz(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="start"!==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.resizeByMeasured().layout().trans(p,n)}$_layoutUnitVert(t,e,s,i,r,n){const o=this.model,a=o.options.reversed,h="start"!==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.resizeByMeasured().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 fo).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:b(parseFloat(e.rx),0),ry:b(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))}}const Ro={};class Do extends yo{static register(...t){t.forEach((t=>{Ro[t[0].type]=t[1]}))}constructor(t,e){super(t,Do.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)}}Do.CLASS_NAME="rct-annotation";const $o={};class Fo extends wo{static register(...t){t.forEach((t=>{$o[t[0].type]=t[1]}))}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new zs(t,Fo.PANE_CLASS)),this.add(this._contentContainer=new ee(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Fo.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=c($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 Ho)return t;t=t.parent}}}Fo.GAUGE_CLASS="rct-gauge",Fo.PANE_CLASS="rct-gauge-pane";class Io extends Xt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class zo extends So{}class Ho extends Fo{_defaultCalss(){return Ho.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))}))}}Ho.GAUGE_GROUP_CLASS="rct-gauge-group";class Go{static reveal(t,e){new Xo(t,e)}static grow(t,e){new Uo(t,e)}static spread(t,e){new Zo(t,e)}static fadeIn(t){new jo(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 jo extends Go{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:Xt.DURATION,fill:"none"})}}class Wo extends Go{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=Wo.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:Xt.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 Xo extends Xt{constructor(t,e){super(),this._series=t,this._cr=Wo.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 Yo extends Xt{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 Uo extends Yo{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Zo extends Yo{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class qo extends So{constructor(t){super(t,"rct-series-trendline-label")}}class Ko 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 qo(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);if(h.length<2)return this._line.setVis(!1),this._fixedArea.setVis(!1),this._variableArea.setVis(!1),this._label.setVis(!1),void(this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)));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,e.label.getIconUrl(),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*p(s),y:e.cy+i*g(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,c=h.getText();if(!c)return void _.setVis(!1);h.prepareRich(c),h.buildSvg(_._text,_._outline,NaN,NaN,h,e.getLabelDomain());const d=h.options.position,u=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}(d):0,p=t?h.getAlignPolar(u):h.getAlign(s,i,r,d),g=t?h.getVerticalAlignPolar(u):h.getVerticalAlign(s,i,r),f=h.getOffsetX(p)+("middle"===g?l:0),m=h.getOffsetY(g)+("center"===p?l:0);_.setContrast(null).layout(p);const x=Math.floor((n.length-1)*d),y=(n.length-1)*d-x;let b,w;if(x>=n.length-1)b=n[n.length-1].x,w=n[n.length-1].y;else{const t=n[x],e=n[x+1];b=t.x+(e.x-t.x)*y,w=t.y+(e.y-t.y)*y}const v=_.getBBox();switch(p){case"left":b-=v.width+f;break;case"center":b-=v.width/2+f;break;case"right":b+=f}switch(g){case"top":w-=v.height+m;break;case"middle":w-=v.height/2+m;break;case"bottom":w+=m}t||(b<0&&(b=0),w<0&&(w=0),b+v.width>o&&(b=o-v.width),w+v.height>a&&(w=a-v.height)),_.trans(b,w)}}class Qo extends Xt{constructor(t,e,s,i){super(),this.duration=s?200:100,this._sv=t,this._focused=s,this._marker=e,s||(this._marker.setBoolData(la.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(la.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class Jo extends So{constructor(t){super(t,"rct-point-label")}}class ta extends ee{constructor(t){super(t,"rct-point-labels"),this._labels=[new oo(this,Jo),new oo(this,Jo)],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=x(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,n.getIconUrl(i.icon),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(go(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(po(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});po(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(po(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});po(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 ea extends mo{constructor(t){super(t),this.add(this._line=new ne(t))}setLine(t){this._line.setPath(t)}}class sa extends mo{constructor(t){super(t,"rct-point-label-lines"),this._lines=new oo(this,ea)}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 ia 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}}class ra extends So{constructor(t){super(t,"rct-stack-label")}}class na extends ee{constructor(t){super(t,"rct-stack-labels"),this._labels=new oo(this,ra),this.ignorePointer()}prepare(t){return this._labels.prepare(t),this._labels}get(t){return this._labels.get(t)}forEach(t){this._labels.forEach(t)}}const oa={},aa="rct-point-hover",ha="rct-point-unhover";class la extends wo{static register(...t){t.forEach((t=>{oa[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 ia(t,"rct-series-points")),this._labelContainer=new ta(t),this._stackLabelContainer=new na(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),this._stackLabelContainer&&this._stackLabelContainer.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%Ci),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(aa).addClass(ha)}))):this._getPointPool().forEach((t=>{t.containsClass(ha)&&t.removeClass(ha).addClass(aa)}))}_clearHoverClasses(t){t instanceof Jt&&t.removeClass(aa).removeClass(ha)}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(la.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof ba&&r.push(new Qo(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(la.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof ba?r.push(new Qo(this,t,!0,(()=>{t.endHover(this,!0)}))):this instanceof Sa&&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&&Wt(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 Mi&&e.trendline.visible?(this._trendView||this.add(this._trendView=new Ko(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(){this._layoutStackLabel()}_layoutStackLabel(){const t=this.model,e=t._group;if(!e||!e._stacked)return void this._hideStackLabel();if(!e.isLastVisible(t))return void this._hideStackLabel();const s=e.stackLabel;if(!s||!s.visible)return void this._hideStackLabel();if(this._animating())return void this._hideStackLabel();const i=e._stackTotals,r=e._stackPoints;i&&0!==i.size&&r&&0!==r.size?this._doLayoutStackLabel(s,i,r):this._hideStackLabel()}_hideStackLabel(){this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_doLayoutStackLabel(t,e,s){var i;const r=this.control.doc(),n=this.model,o=n.chart,a=n._yAxisObj,h=n._xAxisObj,l=t.getGap(),_=t.getOffset(),c=t.options.align,d=this._labelContainer,u=d&&d.visible,f=o._body.getPolar(h),m=this._inverted,x=this.width,w=this.height,v=a.options.reversed;this._stackLabelContainer.setVis(!0),this._stackLabelContainer.setStyleOrClass(t._style);let S=0;for(const t of e.values())0!==t.positiveTotal&&S++,0!==t.negativeTotal&&S++;const V=this._stackLabelContainer.prepare(S);let A=0;const P=f?h.getTotalAngle():0,k=m?x:w,C=m?w:x,L=m?0:w;for(const[n,x]of e.entries()){const e=[];0!==x.positiveTotal&&e.push([x.positiveTotal,!1]),0!==x.negativeTotal&&e.push([x.negativeTotal,!0]);for(const[w,S]of e){const e=V.get(A++),N=t.getCallbackArgs(o,x.x,x.positiveTotal,x.negativeTotal);if(e.setVis(t.isStackLabelVisible(N))){const o=t.getStackLabelText(N,w),x=t.getStackLabelStyle(N);e.xValue=n,e.setModel(r,t,null,x),e.setText(o),e.layout(c);const V=m?0:t.getRotation(),{width:A,height:M}=e.getBBox(),E=V*B,T=0!==V?M*y(p(E))+A*y(g(E)):M,O=0!==V?A*y(p(E))+M*y(g(E)):A;let R,D;const $=s.get(n),F=$&&null!==(i=$.find((t=>t.yGroup===w)))&&void 0!==i?i:null;if(f){const t=b(null==F?void 0:F.xPos,f.cx+f.rd*p(f.start+h.getPos(P,n))),s=b(null==F?void 0:F.yPos,f.cy+f.rd*g(f.start+h.getPos(P,n))),i=Math.atan2(s-f.cy,t-f.cx),r=a.getPos(f.rd,w)+(S!==v?-1:1)*(M/2+l);let o=0;"left"===c?o=-(A/2+_):"right"===c&&(o=A/2+_),R=f.cx+r*p(i)+-g(i)*o,D=f.cy+r*g(i)+p(i)*o,e.trans(R-A/2,D-M/2),0!==V&&e.setRotation(A/2,M/2,V)}else{const s=a.getPos(k,w),i=u&&F?d.get(F,0):null,r=i&&i.visible?i.getBBoxEx():null,o=$?$[$.length-1]:null,p=o?this.getPointView(o):null,g=(null==p?void 0:p.wPoint)||0;if(m){const i=S!==v?-1:1;if(R=L+s+i*(l+O/2)-A/2,r)if(i>0){const t=R+A/2-O/2,e=r.x+r.width-t;e>0&&(R+=e)}else{const t=R+A/2+O/2-r.x;t>0&&(R-=t)}const o=b(null==F?void 0:F.yPos,C-h.getPos(C,n)),a=v?"left"===c?"right":"right"===c?"left":c:c;D="left"===a?o-g/2-T/2-M/2-_:"right"===a?o+g/2+T/2-M/2+_:o-M/2+_,D+=M*t._vertAdjust;const d=this._applyOverflowFit(t._overflowFit,R,A,k);if(null===d){e.setVis(!1);continue}R=d}else{const i=S!==v?1:-1;if(D=L-s+i*(l+T/2)-M/2,r)if(i<0){const t=D+M/2+T/2-r.y;t>0&&(D-=t)}else{const t=D+M/2-T/2,e=r.y+r.height-t;e>0&&(D+=e)}const o=b(null==F?void 0:F.xPos,h.getPos(C,n));R="left"===c?o-g/2-O/2-A/2-_:"right"===c?o+g/2+O/2-A/2+_:o-A/2+_;const a=this._applyOverflowFit(t._overflowFit,D,M,k);if(null===a){e.setVis(!1);continue}D=a}e.trans(R,D),0!==V&&e.setRotation(A/2,M/2,V)}}}}}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const s=this._randomPalette?Math.floor(Math.random()*Ci):e.index%Ci;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 b(this._growRate,1)}_getPosRate(){return b(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 Mi&&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;const u=t.getAlign(),p=t.getAlignOffset();if(r){n-=e.distY,o+=e.distX;const s=e.reversed?"left"===u?"right":"right"===u?"left":u:u;"left"===s?o-=e.wPoint/2+c.height-c.height*t._vertAdjust+p:"right"===s?o+=e.wPoint/2+c.height*t._vertAdjust+p:o-=c.height/2-c.height*t._vertAdjust}else n-=e.distX,o+=e.distY,"left"===u?n-=e.wPoint/2+c.width+p:"right"===u?n+=e.wPoint/2+p:n-=c.width/2;const g=n,f=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,g,f,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(h,c,n,o)}_applyOverflowFit(t,e,s,i){if(isFinite(t)||t===1/0){if(e+s>=i)return t===1/0?null:i+t-s;if(e<=0)return t===1/0?null:-t}return e}_checkLabelOverlap(t,e,s,i,r,n,o,a,h,l){const _=this._labelOverlap;let c=!1;if(!h){const i=_.fit;if(isFinite(i)||i===1/0){const h=_.inverted?o:a,l=_.inverted?e.width:e.height,d=_.inverted?_.width:_.height,u=_.inverted?r:n,p=h+l>=d,g=this._applyOverflowFit(i,h,l,d);if(null===g)return t.setVis(!1),!1;g!==h&&(c=p?g<s+u:g+l>s-u,_.inverted?o=g:a=g),c&&_.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,x(a.axisMin(),i.fromValue)),_=a.getPos(o?t:e,m(a.axisMax(),i.toValue));n?o?h?r.setBounds(_,-e,y(_-l),e):r.setBounds(l,-e,y(_-l),e):r.setBounds(0,-x(l,_),t,y(_-l)):o?h?r.setBounds(_,0,y(_-l),e):r.setBounds(l,0,y(_-l),e):r.setBounds(0,e-x(l,_),t,y(_-l))}_setFill(t,e){i(e)&&e[U]?t.internalSetStyle(U,e[U]):o(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=b(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!==Ws)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}}la.POINT_CLASS="rct-point",la.DATA_FOCUS="focus",la.DATA_UNFOCUS="unfocus",la.DATA_UNHOVER="unhover",la.LEGEND_MARKER="rct-legend-item-marker";class _a extends ne{constructor(t){super(t,la.POINT_CLASS)}savePrevs(){}}class ca extends _a{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class da extends Jt{constructor(t){super(t,la.POINT_CLASS)}savePrevs(){}}class ua extends da{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let pa=class extends ca{layout(t,e,s,i,r,n,o){this.x=t,this.y=e,this.setPath(Is.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 ga extends ua{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 fa extends mo{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class ma extends la{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&&Go.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach((t=>t.savePrevs()))}getPointsAt(t,e){return[]}}class xa extends ma{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new sa(t))}depthEnabled(){return!0}_prepareSeries(t,e,s,i){i?(this._depthAngle=i.options.angle*B,this._base=p(this._depthAngle)*e.depth,this._side=g(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(),l=this._labelLineContainer,_=i._xAxisObj,d=i._yAxisObj,u=this._yReversed,f=this._depthExt,m=i._group?i._groupDistance:i.distance,y=f?m*(r?g(this._depthAngle):p(this._depthAngle)):0,w=f?m*(r?p(this._depthAngle):g(this._depthAngle)):0,v=2*_.unitPad(),S=b(i.options.minPointWidth,0),V=this._yLen=r?t:e,A=r?e:t,P=t=>d.getPos(V,t),k=t=>_.getPos(A,t),C=r?0:e,L=d.valueMin(),N=P(L),M=this._baseVal=i.getBaseValue(d),E=!isNaN(M),T=this._yBase=b(P(x(L,b(M,N))),N),B=this._pointOff,O=h&&c(this._labelInfo,{inverted:r,reversed:u,labelPos:i.getLabelPos(a),labelOff:i.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:y,distY:w,side:this._side,base:this._base});h&&l.setVis(i.pointLabel.line.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(i.pointLabel.line._style),l.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 c=s.point;if(s.setVis(!c.isNull)){const d=_.getUnitLen(A,c.xValue)*(1-v);let u=i.getPointWidth(d,S),p=P(c.yGroup),g=T;if(c.yGroup!=c.yValue){const t=M>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=P(r)}const f=(p-g)*n;let m=k(c.xValue)-d/2,x=C-p;isNaN(o+s.wSave)||(u=s.wSave+(u-s.wSave)*o),m+=i.getPointPos(d)+u/2,isNaN(o+s.xSave)||(m=s.xSave+(m-s.xSave)*o),c.xPos=m+=u*B,c.yPos=x,this._layoutPoint(s,l,m-y,C-T*(1-n)-g*n+w,u,f),r&&(x=A-k(c.xValue)+d/2,m=C,c.yPos=x-=i.getPointPos(d)+u/2+u*B,c.xPos=m+=E?P(c.yGroup)*n:P(c.yGroup*n)),O&&(O.labelView=h.get(c,0))&&(O.pointView=s,O.x=m,O.y=x,O.wPoint=u,O.hPoint=f,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 ya extends ma{_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,l=s._yAxisObj,_=2*h.unitPad(),d=b(s.options.minPointWidth,0),u=i?t:e,p=i?e:t,g=i?0:e,f=this._pointOff,m=a&&c(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(((c,x)=>{const y=c.point;if(c.setVis(!y.isNull)){const b=h.getUnitLen(p,y.xValue)*(1-_);let w=s.getPointWidth(b,d);const v=(l.getPos(u,this._getHighValue(y))-l.getPos(u,this._getLowValue(y)))*r;let S=h.getPos(p,y.xValue)-b/2,V=g-l.getPos(u,this._getHighValue(y))*r;isNaN(n+c.wSave)||(w=c.wSave+(w-c.wSave)*n),S+=s.getPointPos(b)+w/2,isNaN(n+c.xSave)||(S=c.xSave+(S-c.xSave)*n),y.xPos=S+=w*f,y.yPos=V,this._layoutPoint(c,x,S,V,w,v),i&&(V=p-h.getPos(p,y.xValue)+b/2,S=g,y.yPos=V-=s.getPointPos(b)+w/2+w*f,y.xPos=S+=l.getPos(u,this._getHighValue(y))*r),a&&(m.pointView=c,m.hPoint=v,m.x=S,m.y=V,(m.labelView=a.get(y,0))&&(m.hPoint=v,this._layoutLabel(o,m,t,e)),(m.labelView=a.get(y,1))&&(i?m.x-=v:m.y+=v,m.hPoint=-v,this._layoutLabel(o,m,t,e)))}}))}}class ba extends _a{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-s)**2)-t}}class wa extends la{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!==Ws){(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 Xt{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 Sa extends la{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 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 Va extends Do{constructor(t){super(t,Va.CLASS_NAME),this.addToTransform(this._imageView=new vo(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.getImageUrl());const o=this._imageView.getBBox();return this._inflaePaddings(o),ho(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)}}Va.CLASS_NAME="rct-image-annotation";class Aa extends Do{constructor(t){super(t,Aa.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 rr:!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 ir: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 nr: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)}}Aa.CLASS_NAME="rct-shape-annotation";class Pa extends Do{constructor(e){super(e,Pa.CLASS_NAME),this._hasExplicitWidth=!1,this.addToTransform(this._textView=new ue(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new ve}_doMeasure(t,e,s,i,r){const n=e.options,o=e.getSize(s,i);this._hasExplicitWidth=!isNaN(o.width);const 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=ho(this._textView.getBBox());return{width:b(o.width,h.width),height:b(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);const e=this._paddings,s=this.width-e.left-e.right,i=this.height-e.top-e.bottom,r=this._textView.getBBox();this._hasExplicitWidth&&r.width>s+.5?(this.isClip(this._textClip)||(this._textClip=this.control.clipBounds(),this._textView.setClip(this._textClip)),this._textClip.setBounds(e.left,e.top,s,i)):this._textView.setClip(null),super._doLayout(t)}remove(){var t;return this._textClip&&(null===(t=this.control)||void 0===t||t.removeDef(this._textClip.dom)),super.remove()}}Pa.CLASS_NAME="rct-text-annotation";class ka extends oo{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 Ca extends ba{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;Is.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)),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||!this.visible?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||!this.visible?Number.MAX_VALUE:i?Math.abs(n-s):Math.abs(r-e)}}class La extends ia{}class Na extends la{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new La(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new ne(t,"rct-line-series-line")),this._markers=new ka(this._pointContainer,Ca),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)}_computeNeedBelow(t){return this._based&&!!t.options.belowStyle}_prepareSeries(t,e,s){e instanceof zr&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._computeNeedBelow(e),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),super._doAfterLayout()}_runShowEffect(t){this._polar?t&&Go.grow(this):t&&Go.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 oo(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;if(null==o||null==a)return;const l=D(x(0,m((E-y(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){var s;const i=t instanceof zr&&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),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,d=r.options.maxVisible,u=r.options.minVisible,f=i.pointLabel,y=f.options.align,b=f.getAlignOffset(),w=f.getOffset(),v=f.getPosition(),S=this._labelContainer._textAlign,V=this._labelViews(),A=i._xAxisObj,P=i._yAxisObj,k=this._polar=i.chart._body.getPolar(A),C=!!k,{cx:L,cy:N,rd:M,start:E,total:T}=k||{},B=o?e:s,O=k?T:o?s:e,R=o?0:s,D=t.length,$=P.axisMax(),F=this._yReversed,I=P instanceof fr?i.getBaseValue(P):NaN,z=I>P.axisMin(),H=z?P.getPos(M,I):0;this._pointContainer.visible&&this._shrinkPoints(i),t.forEach(((t,f)=>{let G,j,W,X;k?(W=E+A.getPos(O,t.xValue),k.min=null==k.min?W:m(k.min,W),k.max=null==k.max?W:x(k.max,W),X=F?isNaN(t.yGroup)?z?H:M:z?H+(P.getPos(M,t.yGroup)-H)*h:M-P.getPos(M,$-t.yGroup)*h:isNaN(t.yGroup)?z?H:0:z?H+(P.getPos(M,t.yGroup)-H)*h:P.getPos(M,t.yGroup)*h,G=t.px=L+X*p(W),j=t.py=N+X*g(W),t.angle=W):(G=t.px=A.getPos(O,t.xValue),j=t.py=R-P.getPos(B,t.yGroup),o&&(G=P.getPos(B,t.yGroup),j=s-A.getPos(O,t.xValue))),t.xPos=G,t.yPos=j;const Y=G,U=j,Z=this._markers.get(f),q=V&&V.get(t,0);if(Z&&Z.setVis(!t.isNull&&(C||!a||G>=0&&G<=e&&j>=0&&j<=s))){this._prepareMakrer(Z),this._layoutMarker(Z,n,G,j);const e=r.getMarkerStyle(t);e&&Z.internalSetStyleOrClass(e),i._maxY,t.yGroup,i._minY,t.yGroup;const s=0==f&&null!=_?_:f==D-1&&null!=c?c:i._maxY==t.yGroup&&null!=d?d:i._minY==t.yGroup&&null!=u?u:l;if(Z.setStyle("opacity",s?"1":"0"),q){q.setContrast(null).layout(S);const e=q.getBBox(),s=Z._radius;if(q.visible=!0,k){switch(v){case"inside":F?t.yValue<I?X-=w:X+=w:t.yValue<I?X+=w:X-=w;break;case"foot":F?t.yValue<I?X-=e.height/2+w:X+=e.height/2+w:t.yValue<I?X+=e.height/2+w:X-=e.height/2+w;break;default:F?t.yValue<I?X+=e.height/2+w:X-=e.height/2+w:t.yValue<I?X-=e.height/2+w:X+=e.height/2+w}G=L+X*p(W),j=N+X*g(W)-e.height/2,this.applyAutoRotation(q,W,T,A.options.totalAngle)}else switch(v){case"inside":j-=e.height/2+w;break;case"foot":j+=w+(l?s:0);break;default:j-=e.height+w+(l?s:0)}switch(y){case"left":G-=e.width+(l?s:0)+b;break;case"right":G+=(l?s:0)+b;break;default:G-=e.width/2+b}this._checkLabelOverlap(q,e,Y,U,s,s,G,j,!1,null),this._layoutLabelRotation(q,e,G,j)}}else q&&q.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&&e._lines.some((t=>t.length>0))))return;const s=this.width,i=this.height,r=this._inverted,n=e instanceof zr&&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,isNaN(l)?0:h.getPos(i/2,l),!0):r?this.$_resetClips(s,i,isNaN(l)?0:h.getPos(s,l),!0):this.$_resetClips(s,i,isNaN(l)?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 zr&&"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 zr&&"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 zr&&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 fr?a.getBaseValue(h):NaN,_=l>h.axisMin()?h.getPos(n,l):0,c=e[0],d=c.length;let u,f;o?(s.move(c[0].px,c[0].py),s.closedSpline(c,!0)):(u=i+_*p(c[0].angle),f=r+_*g(c[0].angle),s.move(u,f),s.line(c[0].xPos,c[0].yPos),s.closedSpline(c,!1),u=i+_*p(c[d-1].angle),f=r+_*g(c[d-1].angle),s.line(u,f))}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 Ma extends Na{constructor(t){super(t,Ma.CLASS),this._flagView=new So(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.getIconUrl(),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:f,height:m}=r,x=f/2,y=m/2,b=l>u+o,w=m>l+u+o,v=h>d+o,S=f>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&&f-h>p?h-p:h>x?f-d:0,P=l>g&&m>l+g?l-g:l>y?m-u:0;switch(_){case"top":h=A,l=b?l-u-o:0;break;case"bottom":h=A,l=w?l+o:m-u;break;case"left":h=v?h-d-o:0,l=P;break;case"right":h=S?h+o:f-d,l=P}i.trans(h,l)}}}Ma.CLASS="rct-line-series";class Ea extends Na{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new La(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,d=this._labelViews(),u=this._labelContainer._textAlign,f=this._polar=i.chart._body.getPolar(h),m=i.pointLabel,x=m.options.position,y=m.options.align,b=m.getAlignOffset(),w=m.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 m=t[i],S=v.get(c+i),V=d&&d.get(m,1);let A,P,k;this._prepareMakrer(S),a?(A=m.px2=l.getPos(_,m.lowValue),P=m.py2=v.get(i).ty+S._radius):(A=m.px2=m.xPos,P=m.py2=m.yLow);const C=A,L=P;if(S&&S.setVis(!m.isNull&&A>=0&&A<=e&&P>=0&&P<=s)){this._layoutMarker(S,n,A,P);const t=r.getMarkerStyle(m);if(t&&S.internalSetStyleOrClass(t),S.setStyle("opacity",o||0==i&&!0===r.options.firstVisible||i===c-1&&!0===r.options.lastVisible?"1":"0"),V){V.setContrast(null).layout(u).setVis(!0);const t=V.getBBox(),e=S._radius;if(f){switch(x){case"inside":P-=w;break;case"foot":P-=t.height/2+w;break;default:P+=t.height+w}A=f.cx+P*p(k),P=f.cy+P*g(k)-t.height/2,this.applyAutoRotation(V,k,f.total,h.options.totalAngle)}else switch(x){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(y){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,C,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 Ta extends Na{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new La(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}_computeNeedBelow(t){return this._based&&!(!t.options.belowStyle&&!t.options.belowAreaStyle)}_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 oo(this._areaContainer,ne,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<m(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 fr?i.getBaseValue(o):NaN,l=this._polar,{cx:_,cy:c,rd:d,cyclic:u}=l,f=new qt,y=s.length;if(!r||"stack"!==r.options.layout&&"fill"!==r.options.layout){const r=h>o.axisMin(),l=r?o.getPos(d,h):0,b=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),f);else{u?f.move(s[0].xPos,s[0].yPos):(w=_+l*p(s[0].angle),v=c+l*g(s[0].angle),f.move(w,v),f.line(s[0].xPos,s[0].yPos));for(let t=1;t<y;t++)f.line(s[t].xPos,s[t].yPos);u||(w=_+l*p(s[y-1].angle),v=c+l*g(s[y-1].angle),f.line(w,v))}const k=s.map((t=>t.angle)),C=this._polar.min=m(...k),L=this._polar.max=x(...k),N=(new qt).push(f.end());if(r)u?f.circle(_,c,l):a&&f.push(...Is.arc(_,c,l,l,C,L,!0)),S=f.end(),A=!0,u?N.circle(_,c,l):N.push(...Is.arc(_,c,l,l,C,L,!0)),V=N.end(),P=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),s=n._ticks;f.push("Z"),u?b?f.circle(_,c,d):f.polygon(...s.map((s=>(console.log(s.value,s.pos),{x:_+p(t+s.pos/d*e/E)*d,y:c+g(t+s.pos/d*e/E)*d})))):b?f.push(...Is.sector(_,c,d,d,0,C,L,!0)):f.polygon({x:_,y:c},...s.map((s=>({x:_+p(t+s.pos/d*e/E)*d,y:c+g(t+s.pos/d*e/E)*d})),{x:_,y:c})),S=f.end(!0),A=!0}else S=f.end();t.setPath(S),t.setAttr("fill-rule",A?"evenodd":""),e&&(e.setPath(V||""),e.setAttr("fill-rule",P?"evenodd":""))}else{f.move(b(s[0].xPos,_),b(s[0].yLow,c)),f.line(b(s[0].xPos,_),b(s[0].yPos,c));for(let t=1;t<s.length;t++)f.line(b(s[t].xPos,_),b(s[t].yPos,c));f.line(b(s[s.length-1].xPos,_),b(s[s.length-1].yLow,c));for(let t=s.length-1;t>=0;t--)f.line(b(s[t].xPos,_),b(s[t].yLow,c));t.setPath(f.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),i.options.belowAreaStyle&&e.internalSetStyleOrClass(i.options.belowAreaStyle),$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,d,d,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 Ba extends ya{constructor(t){super(t,"rct-barrange-series"),this._bars=new ka(this._pointContainer,pa)}_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*b(t.point.width,1),t.hPoint=n,t.layout(s,i+n,this._rd,this._rd,0,0,this._inverted)}}class Oa extends tn{constructor(t){super(t,la.POINT_CLASS)}savePrevs(){}}class Ra extends xa{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 ka(this._pointContainer,Oa)),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:d}=l,u=o instanceof fr?t.getBaseValue(o):NaN,f=u>o.axisMin(),x=o.getPos(d,u),y=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(d,P.yGroup)*e,k=n.getUnitLen(b,P.xValue)*(1-h),C=t.getPointWidth(k,0);let L,N,M=l.start+n.getPos(b,P.xValue)-k/2;if(M+=C*y,M+=t.getPointPos(k)+C/2,a?f?(L=x+(o.getPos(d,P.yGroup)-x)*e,N=x):(L=d,N=o.getPos(d,P.yGroup*e)):f?(L=x+(o.getPos(d,P.yGroup)-x)*e,N=x):(L=r,N=0),s.setSector({cx:_,cy:c,rx:L,ry:L,innerRadius:N/L,start:M-C/2,angle:C,clockwise:!0}),M=s.start+s.angle/2,P.xPos=_+s.rx*p(M),P.yPos=c+s.ry*g(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*d;let o,h;o=a?f?P.yValue<u?"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?x+e/2+S:i-(i-x)/2+S:"outside"===v?i-e/2-S:"head"===v?m(x,i+e/2+S):"foot"===v?x-e/2-S:x-(x-i)/2-S:"outside"===v?r-e/2-S:"head"===v?m(d,r+e/2+S):"foot"===v?d-e/2-S:d-(d-r)/2-S:f?P.yValue<u?"outside"===v?i-e/2-S:"head"===v?i+e/2+S:"foot"===v?x-e/2-S:x-(x-i)/2-S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:"foot"===v?x+e/2+S:i-(i-x)/2+S:"outside"===v?i+e/2+S:"head"===v?i-e/2-S:.7*i+S,h=c+o*g(M),o=_+o*p(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 Da extends Ra{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new ka(t,ga):new ka(t,pa)}_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*b(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 pa){const e=this.model._xAxisObj;t.shrink(e.options.reversed,e._vlen,this._rdTop,this._rdBottom)}}}class $a extends Ta{constructor(t){super(t,"rct-bellcurve-series")}}class Fa extends fa{constructor(t){super(t,la.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 Br(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new Br(t,"rct-boxplot-point-stem")),this.add(this._box=new zs(t,"rct-boxplot-point-box")),this.add(this._mid=new Br(t,"rct-boxplot-point-mid")),this.add(this._min=new Br(t,"rct-boxplot-point-min")),this.add(this._max=new Br(t,"rct-boxplot-point-max"))}}class Ia extends ya{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new ka(this._pointContainer,Fa)}_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 za extends ba{}class Ha extends wa{constructor(t){super(t,"rct-bubble-series"),this._pointContainer.add(this._pieContainer=new ee(t,"rct-bubble-pie"))}_createMarkers(t){return new ka(t,za)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints),this.$_preparePie(t,e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Go.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}pointByDom(t){const e=super.pointByDom(t);if(e)return this.model._hoveredSlice=null,e;if(this._sectorMap){let e=t;for(;e;){const t=this._sectorMap.get(e);if(t)return this.model._hoveredSlice=t.slice,t.pv;e=e.parentElement}}return this.model._hoveredSlice=null,null}$_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)}))}$_preparePie(t,e,s){const i=e.pie,r=i&&i.visible&&i.fields.length>0;if(this._pieContainer.setVis(r)){let e=0;s.forEach((t=>{!t.isNull&&t.pieSlices&&(e+=t.pieSlices.length)})),this._pieSectors||(this._pieSectors=new oo(this._pieContainer,tn,la.POINT_CLASS+" rct-bubble-pie-sector")),this._pieSectors.prepare(e),this._sectorMap=new Map;const r=this.chart()._legend.getMarkerSize();i.getLegendSources().forEach((e=>{e.legendMarker()||e.setLegendMarker(zs.create(t,la.LEGEND_MARKER,0,0,r,r,r/2))}))}else this._pieSectors&&this._pieSectors.prepare(0),this._sectorMap=null}_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(),d=this._labelContainer._textAlign,u=this._labelViews(),f=i._xAxisObj,m=i._yAxisObj,x=this._polar=i.chart._body.getPolar(f),y=n?t:e,w=n?e:t,v=(i._xAxisObj._vlen<i._yAxisObj._vlen?i._xAxisObj:i._yAxisObj)._vlen,{min:S,max:V}=i.getPixelMinMax(v),A=n?0:e,P=Is.getDrawer(r.shape),k=i.pie,C=k&&k.visible&&k.fields.length>0;let L,N=0;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)=>{var l,v;const M=s.point,E=u&&(L=u.get(M,0));if(s.setVis(!M.isNull&&!isNaN(M.zValue))){const r=s._radius=i.getRadius(M.zValue,S,V),u=r*a*b(M._vr,1);let v,T;if(x){const t=x.start+f.getPos(w,M.xValue),e=m.getPos(x.rd,M.yValue);v=x.cx+e*p(t),T=x.cy+e*g(t)}else v=f.getPos(w,M.xValue),T=A-m.getPos(y,M.yValue),n&&(v=m.getPos(y,M.yValue),T=e-f.getPos(w,M.xValue));M.xPos=v,M.yPos=T;const B=!o||v>=0&&v<=t&&T>=0&&T<=e;if(C&&M.pieSlices)if(s.setVis(!1),B)k.resolveSliceColors(M.pieSlices),N=this.$_renderPieSectors(M,M.pieSlices,N,v,T,u,k.getInnerRadius(u),k.clockwise);else for(let t=0;t<M.pieSlices.length;t++)null===(l=this._pieSectors.get(N++))||void 0===l||l.setVis(!1);else s.setVis(B)&&s.setPath(P(u)).trans(v,T).rotate(h);B&&E?(L.setContrast(C&&M.pieSlices?null:s.dom),L.layout(d),this._layoutLabelView(L,_,c,r,v,T)):E&&E.setVis(!1)}else{if(C&&M.pieSlices)for(let t=0;t<M.pieSlices.length;t++)null===(v=this._pieSectors.get(N++))||void 0===v||v.setVis(!1);E&&E.setVis(!1)}}))}$_renderPieSectors(t,e,s,i,r,n,o,a){let h=s;for(const s of e){const e=this._pieSectors.get(h++);if(e){const h={cx:i,cy:r,rx:n,ry:n,innerRadius:o,start:s.startAngle,angle:y(s.angle),clockwise:a};if(e.setSector(h),e.setFill(s.color),e.setVis(!0),this._sectorMap){const a=s.startAngle+s.angle/2,h=(n+o)/2,l=i+h*p(a),_=r+h*g(a),c={point:t,dom:e.dom,getTooltipPos:()=>({x:l,y:_}),getBounds:()=>e.dom.getBoundingClientRect(),saveStyles(){},restoreStyles(){}};this._sectorMap.set(e.dom,{point:t,slice:s,pv:c})}}}return h}getNearest(t,e){this.model._hoveredSlice=null;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 Ga=class extends fa{constructor(t){super(t,la.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue;const r=0+e-e*(0===i?1:(m(s.openValue,s.closeValue)-s.lowValue)/i),n=0+e-e*(0===i?1:(x(s.openValue,s.closeValue)-s.lowValue)/i),o=m(n,r),a=x(1,y(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 Br(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new Br(t,"rct-candlestick-point-wick")),this.add(this._body=new zs(t))}};class ja extends ya{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new ka(this._pointContainer,Ga)}_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 Wa extends _a{layout(t,e,s){const i=new qt;i.circle(t,e,s),this.setPath(i.end())}}class Xa extends Ra{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new ka(t,Wa)}_layoutPoint(t,e,s,i,r,n){t.layout(s,i-n/2,n/2-1)}}let Ya=class extends fa{constructor(t){super(t,la.POINT_CLASS),this.add(this._line=new Br(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 Ua extends ya{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new ka(this._pointContainer,Ya)}_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 Za=class extends mo{constructor(t){super(t,la.POINT_CLASS),this._segments=new oo(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 qa extends xa{constructor(t){super(t,"rct-equalizer-series"),this._bars=new ka(this._pointContainer,Za)}_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 Ka=class extends fa{constructor(t){super(t,la.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new Br(t)),this.add(this._whiskerUp=new Br(t)),this.add(this._whiskerDown=new Br(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 Qa extends ya{constructor(t){super(t,"rct-errorbar-series"),this._bars=new ka(this._pointContainer,Ka)}_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 Ja extends _a{}class th extends Sa{constructor(t){super(t,"rct-funnel-series"),this._segments=new ka(this._pointContainer,Ja),this.add(this._lineContainer=new sa(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&&Go.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+(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.getWidgetAlign(),_=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),f=new qt,m=i.getCenter(t,e),x=m.x-p.width/2,b=m.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=[],k=new qt,C=(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 m=n.yPos*p.height,x=(n.yPos+n.height)*p.height,M=d?w-m:b+m,E=d?w-x:b+x,T=x<S;let B,O,R,D;if(N=null==c?void 0:c.get(n),m>=S?(B=V,O=B+g.width,f.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),f.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,f.move(B,M).lines(O,M,D,A,D,E,R,E,R,A),i.nx1=R-B,i.nx2=D-B,i.ny=y(A-M),i.nx3=R,i.nx4=D),i.setPath(f.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,k,p,v,a,h):1==l?this.$_layoutLabelEnded(!1,n,i,L,_,u,N,k,v,a,h,C,t,e):this.$_layoutLabelOutside(!1,n,i,L,_,u,N,k,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,k,p,v,a,h):1==l?this.$_layoutLabelEnded(!0,i,s,L,_,u,N,k,v,a,h,C,t,e):this.$_layoutLabelOutside(!0,i,s,L,_,u,N,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 f=l;if(n?f-=h.width/2:f+=h.width/2,o){const e=t?u.y+u.height/2-p:0;n?o.setLine(a.reset(0,0).line(f-g-c,e).end()):o.setLine(a.reset(0,0).line(f+c-g,e).end()),o.trans(g,p)}t||(n?f-=_+c+u.width:f+=c+_,i.trans(f,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(),f=e.yPos;!t&&!p&&i.layout(r||(n?"right":"left"));const m=e.xPos=this.$_calcX(e,s,h,n);let x;if(x=n?_+l+c:d-_-c-l,o){const e=t?g.y+g.height/2-f:0;n?o.setLine(a.reset(0,0).line(x-m-_,e).end()):o.setLine(a.reset(0,0).line(x+_-m,e).end()),o.trans(m,f)}t||(n?x-=l+_+g.width:x+=_+l,i.trans(x,f-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 eh=class extends ca{layout(t,e){this.setPath(Is.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class sh extends ma{constructor(t){super(t,"rct-histogram-series"),this._bars=new ka(this._pointContainer,eh)}_getPointPool(){return this._bars}_preparePoints(t,e,s){this.$_parepareBars(t,e,s)}_layoutPoint(t,e,s,i,r,n){t.wPoint=r,t.hPoint=n,t.layout(s,i)}_layoutPoints(t,e){const s=this.model,i=this._inverted,r=this._getGrowRate(),n=s.pointLabel,o=this._labelViews(),a=s._xAxisObj,h=s._yAxisObj,l=i?t:e,_=i?e:t,d=h.getPos(l,s.getBaseValue(h)),u=i?0:e,p=o&&c(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,c)=>{const g=s.point,f=a.getPos(_,g.min),m=a.getPos(_,g.max),x=h.getPos(l,g.yValue),y=m-f+(m>f?-1:1),b=x-d;let w=f+(m-f)/2,v=u;g.xPos=w,g.yPos=v-=x,this._layoutPoint(s,c,w,v+b,y,b*r),p&&(p.labelView=o.get(g,0))&&(i&&(v=_-w,w=u,g.yPos=v,g.xPos=w+=h.getPos(l,g.yGroup)),p.pointView=s,p.x=w,p.y=v,p.wPoint=y,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=x(1,_-l-1);h.xPos=c,h.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(c,r)}))}}class ih extends mo{constructor(t){super(t,la.POINT_CLASS),this.add(this._line=new Br(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 rh extends xa{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 ka(this._pointContainer,ih)),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 nh extends fa{constructor(t){super(t,la.POINT_CLASS)}layout(t,e){const s=this.point,i=s.yValue-s.lowValue,r=-t/2;const n=0+e-e*(m(s.openValue,s.closeValue)-s.lowValue)/i,o=0+e-e*(x(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 Br(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new Br(t,"rct-ohlc-point-tick")),this.add(this._bar=new Br(t)),this.add(this._back=new zs(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class oh extends ya{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new ka(this._pointContainer,nh)}_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 ah extends Na{constructor(t){super(t,"rct-pareto-series")}}class hh extends ne{setOff(t){return this.off=y(t),this}}class lh extends tn{constructor(t){super(t,la.POINT_CLASS)}render(t,e,s){this._assignShape(s,!1)}}class _h extends Jt{constructor(t){super(t,la.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new tn(t))}setSides(t,e,s,i,r){const n=this.point,o=D(M),a=D(((t?n.startAngle:n.startAngle+n.angle)+M/2+E)%E),h=D(a+(t?n.angle:-n.angle)-1e-4+E)%E,l=o-(a+y(a-h)/2);this._side1View=e.setOff(o-a),this._side2View=s.setOff(o-h),a<=M/2&&!(h>=a&&h<M/2)||h>=3*M/2&&!(a<h&&a>3*M/2)?(this._outArcView=i.setOff(m(e.off,s.off)),this._inArcView=r.setOff(1/0)):a>=3*M/2&&h<=M/2?(this._outArcView=i.setOff(1/0),this._inArcView=r.setOff(l)):a>=M/2&&h<=3*M/2?(this._outArcView=i.setOff(m(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=i.setOff(l),a>=0&&a<=M&&this._outArcView.setOff(m(this._outArcView.off,this._side1View.off)),h>=M&&h<E&&this._outArcView.setOff(m(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(la.DATA_FOCUS,t),this._side2View.setBoolData(la.DATA_FOCUS,t),this._inArcView.setBoolData(la.DATA_FOCUS,t),this._outArcView.setBoolData(la.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 ch extends Sa{constructor(e){super(e,"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(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new So(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._pointContainer.add(this._sideContainer=new ee(e,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new sa(e))}_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.getIconUrl(),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&&Go.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 lh||t instanceof _h)&&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 _h&&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 ka(this._pointContainer,_h,null),n=this._sides=new oo(this._sideContainer,hh,"rct-pie-series-side")):this._sectors=new ka(this._pointContainer,lh,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%E;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,d=this._ratio,u=this._sides,f=i.pointLabel,m=f.options,x=f.connector.options.curved,w=this._labelViews(),v="inside"===i.getLabelPos(f),S=b(m.radius,.7),V=this._pb,A=f.getDistance(v,l,_),P=f.getWidgetAlign();let k=null==w?void 0:w.textAlign();const C=this._lineContainer.setVis(f.connector.visible)?this._lineContainer:null,L=this._slicedOff=i.getSliceOffset(l)*n,N=[],M=[],E=[],T=(null==w?void 0:w.getWidth(0))||0,B=this._sectors.count;let O,R;if(this._lineContainer.setStyleOrClass(f.connector.options.style),!w||k||P||(k="center"),this._textView.visible){this._textView.layout("center"),this._textView.setContrast(null);const t=this._textView.getLayoutBox();this._textView.trans(a-t.x-t.width/2,h-t.y-t.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 f=t.point;if(u){const e=4*o;t.setSides(r,u.get(e),u.get(e+1),u.get(e+2),u.get(e+3))}if(R=null==C?void 0:C.get(f),f.isNull)t.setVis(!1),w&&(O=w.get(f,0))&&O.setVis(!1),null==R||R.setVis(!1);else{const o=B>1&&f.sliced,u=f.startAngle,m=u+f.angle/2;let b=0,C=0;if(o&&n>=1&&!t.isDomAnimating()&&(b+=p(m)*L,C+=g(m)*L),t.trans(b,C).setVis(!0),f.xPos=a+p(m)*(L+l*S),f.yPos=h+g(m)*(L+l*S),t.render(w,null,{cx:a,cy:h,rx:l,ry:l*d,innerRadius:_,start:u,angle:y(f.angle),clockwise:r,depth:c}),w&&(O=w.get(f,0))){const r=i.getLabelOff2(f);let n;v?(null==R||R.setVis(!1),this.$_layoutLabelInside(f,O,k,r,A,o?L:0)):(n=-1===P?this.$_layoutLabelAligned(!1,f,O,k,R,V,x,r,A,o?L:0):1==P?this.$_layoutLabelEnded(!1,f,O,k,R,V,x,r,A,o?L:0,T,e,s):this.$_layoutLabelOutside(!1,f,O,k,R,V,x,r,A,o?L:0),n?N.push(O):M.push(O),this._layoutLabelRotation(O)),O.setContrast(v&&t.dom).setVis(!0),E.push(O)}else null==R||R.setVis(!1)}})),u&&u.sortDom(((t,e)=>{let s=e.off-t.off;return 0===s&&(s=t.index-e.index),s}));const D=m.convergent,$=m.dedupeMode,F=m.overflow;w&&(v||0===P?"preserveOrder"!==$&&"largestFirst"!==$||w.dedupe(E,C,$):w.arrangeVertical(this,N,C,s,D,$,F)+w.arrangeVertical(this,M,C,s,D,$,F)>0&&this._sectors.forEach((t=>{const r=t.point;if(!r.isNull){const t=B>1&&r.sliced,n=i.getLabelOff2(r);O=w.get(r,0),R=null==C?void 0:C.get(r),(null==O?void 0:O.visible)&&(-1===P?this.$_layoutLabelAligned(!0,r,O,k,R,V,x,n,A,t?L:0):1==P?this.$_layoutLabelEnded(!0,r,O,k,R,V,x,n,A,t?L:0,T,e,s):this.$_layoutLabelOutside(!0,r,O,k,R,V,x,n,A,t?L:0))}})))}$_layoutLabelAligned(t,e,s,i,r,n,o,a,h,l){const _=s.isDomAnimating(),c=e.startAngle+e.angle/2,d=this._cx,u=this._cy,f=this._rx,m=this._ry,x=f+l,y=m+l,b=d+p(c)*x,w=u+g(c)*y,v=b<d;!t&&!_&&s.layout(i||(v?"right":"left"));const S=s.getBBox(),V=w-S.height/2;let A,P,k,C=u+g(c)*m;if(v?(A=d+p(Math.PI)*f-h,P=A-S.width-a,k=d+p(Math.PI)*x-h,S.width):(A=d+p(0)*f+h,P=A+a,k=d+p(0)*x+h),r&&r.setVis(x>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,C),!_&&r.trans(A,w)}return t||(s.setPos(P,C-S.height/2),!_&&s.trans(P,C-S.height/2)),v}$_layoutLabelEnded(t,e,s,i,r,n,o,a,h,l,_,c,d){const u=s.isDomAnimating(),f=e.startAngle+e.angle/2,m=this._cx,x=this._cy,y=this._rx,b=this._ry,w=y+l,v=b+l;let S=m+p(f)*w,V=x+g(f)*v;const A=S<m;!t&&!u&&s.layout(i||(A?"right":"left"));const P=s.getBBox(),k=V-P.height/2;let C,L,N,M=x+g(f)*b;if(A?(C=h+_+a,N=h+_-P.width,L=C):(C=c-h-_-a,N=c-h-_,L=C),r&&r.setVis(w>0)){const e=t?s.ty-k: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(C,M),!u&&r.trans(L,V)}return t||(s.setPos(N,M-P.height/2),!u&&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(),d=e.startAngle+e.angle/2,u=this._cx,f=this._cy,m=this._rx+.5*h,x=this._ry+.5*h,y=p(d)*l,b=g(d)*l,w=u+p(d)*this._rx,v=f+g(d)*this._ry,S=u+p(d)*m;let V=f+g(d)*x;const A=S<u;let P,k;return A?(P=S-.2*h,k=P):(P=S+.2*h,k=P),r&&r.setVis(m>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+y,v+b)),t||(A?k-=c.width+a:k+=a,V-=c.height/2,s.setPos(k,V),!_&&s.trans(k+y,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=m(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)}else this._layoutLabelRotation(e);const g=h.options.align===Ys?.3:h.options.align===Xs?.5:.7,f=u>0?u+(this._rx-u)/2:l?"angle"===_?this._rx*g+i:.8*this._rx+i:.7*this._rx+i,x=this._deep?f*this._ratio:f,y=Math.cos(p),b=Math.sin(p);let w=this._cx+y*f,v=this._cy+b*x;e.move(w-d.width/2,v-d.height/2),w=this._cx+y*(n+f),v=this._cy+b*(n+x),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.getWidgetAlign(),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(p(l)*o,g(l)*o,a):t.transEx(0,0,a),!r)return;const _=i.pointLabel,c=this._lineContainer,d=_.connector.options.curved,u="inside"===i.getLabelPos(_),f=r.get(h,0),m=i.pointLabel.getDistance(u,this._rx,this._rxInner);if(f){const t=!u&&c.get(h);if(s){let e=r.textAlign();!r||e||n||(e="center"),u?this.$_layoutLabelInside(h,f,e,_.getOffset(),m,o):0===n&&this.$_layoutLabelOutside(!1,h,f,e,t,this._pb,d,_.getOffset(),m,o)}if(e){let e=f.tx,s=f.ty,i=t.tx,r=t.ty;(u||0===n)&&(f.trans(f.x,f.y).transEx2(e,s,a),t&&t.trans(t.x,t.y).transEx(i,r,a))}else(u||0===n)&&(f.trans(f.tx,f.ty).transEx2(f.x,f.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}class dh extends ba{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 uh extends wa{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new ka(t,dh)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Go.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,d=+i.jitterX||0,u=+i.jitterY||0,f=s.pointLabel,m=f.options.position,x=f.getOffset(),y=this._labelViews(),b=r?t:e,w=h?h.total:r?e:t,v=r?0:e;let S;this._markers.forEach(((i,f)=>{const V=i.point,A=y&&(S=y.get(V,0));if(i.setVis(!V.isNull)){const f=Is.getDrawer(s.getShape(V)),y=at.jitter(V.xValue,d),P=at.jitter(V.yGroup,u);let k,C;if(h){const t=h.start+o.getPos(w,y),e=a.getPos(h.rd,P)*l;k=h.cx+e*p(t),C=h.cy+e*g(t)}else k=o.getPos(w,y),C=v-a.getPos(b,P),r&&(k=a.getPos(b,P),C=e-o.getPos(w,y));if(V.xPos=k,V.yPos=C,i.setVis(!!h||!n||k>=0&&k<=t&&C>=0&&C<=e)){const t=i._hoverRadius||_;i.setPath(f(t)),i.trans(k,C).rotate(c),A&&this._layoutLabelView(S,m,x,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 ph extends ya{constructor(t){super(t,"rct-waterfall-series"),this._bars=new ka(this._pointContainer,pa),this.add(this._lineContainer=new ee(t,"rct-waterfall-series-lines")),this._lines=new oo(this._lineContainer,Br)}_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 gh(t,e){return new(Ro[e._type()])(t)}function fh(t,e){return new(oa[e._viewType()])(t)}la.register([jr,Ta],[Yr,Ea],[Cr,Da],[Ar,Ba],[Kr,$a],[Jr,Ia],[ln,Ha],[dn,ja],[pn,Xa],[xn,Ua],[bn,qa],[wn,Qa],[An,th],[Cn,sh],[zr,Ma],[Mn,rh],[Tn,oh],[On,ah],[zn,ch],[jn,uh],[Yn,ph]),Do.register([hr,Pa],[or,Va],[ar,Aa]);class mh extends xo{constructor(t){super(t,"rct-axis-grid"),this._lines=new oo(this,Br)}_prepareStyleOrClass(t){}_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.setClass("rct-axis-grid-line"),e.internalSetStyleOrClass(t._style)})),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=b(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?b(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 yh extends Jt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new So(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){if(this.model=e,this._labelView.setVis(!!e.label.options.text)){this._labelView.setModel(t,e.label,e.label.getIconUrl(),null);const s=e.label.getText();e.label.prepareRich(s)}}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.setContrast(this._getContrastTarget()).layout(this.textAlign()||"center")),s?this._doLayoutPolar(t,e,s):this._doLayout(t,e)}_getContrastTarget(){return null}}class bh extends yh{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Oo:Br)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.options.value))&&i(e._style)&&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:null,h=this._labelView.getBBox(),l=b(n.offsetX,0),_=b(n.offsetY,0);let c,d;if(this.vertical()){const r=s.axis.getPos(t,i),u=o.setVis(!isNaN(r));if(null==a||a.setVis(u),u&&(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="outside"!==n.position?e-h.height-_:e+_;break;case"middle":d=(e-h.height)/2-_;break;default:d="outside"!==n.position?_:-1*(h.height+_)}}}else{const r=e-s.axis.getPos(e,i),u=o.setVis(!isNaN(r));if(null==a||a.setVis(u),u&&(o.setHLine(r,0,t),a)){switch(n.align){case"center":c=(t-h.width)/2-l;break;case"right":c="outside"!==n.position?t-h.width-l:t+l;break;default:c="outside"!==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-_}}}(null==a?void 0: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*p(s.start),s.cy+a*g(s.start))}}class wh extends yh{constructor(t,e){super(t),this.insertFirst(this._box=new(e?tn:Hs)(t,"rct-axis-guide-range"))}_getContrastTarget(){var t;return"outside"!==(null===(t=this.model)||void 0===t?void 0:t.label.options.position)?this._box.dom:null}prepare(t,e){super.prepare(t,e);const{startValue:s,endValue:i}=e.options,r=!_(s)&&!_(i);this._range=r?e.axis.trimRange(m(s,i),x(s,i)):[NaN,NaN],this.setVis(e.visible&&!isNaN(this._range[0])&&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:null,l=this._labelView.getBBox(),_=b(r.offsetX,0),c=b(r.offsetY,0);if(this.vertical()){const i=s.axis.getPos(t,o),d=s.axis.getPos(t,a),u=!isNaN(i)&&!isNaN(d)&&n.setVis(d!==i);if(null==h||h.setVis(u),u){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="outside"!==r.position?e-l.height-c:e+c;break;case"middle":o=(e-l.height)/2-c;break;default:o="outside"!==r.position?c:-1*(l.height+c)}n.setBox(i,0,d,e),h&&h.trans(x(0,m(t,s)),o)}}else{const i=e-s.axis.getPos(e,o),d=e-s.axis.getPos(e,a),u=!isNaN(i)&&!isNaN(d)&&n.setVis(i!==d);if(null==h||h.setVis(u),u){let e,s;switch(r.align){case"center":e=(t-l.width)/2-_;break;case"right":e="outside"!==r.position?t-l.width-_:t+_;break;default:e="outside"!==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,this._range[0]),h=i.axis.getPos(s.rd,this._range[1]);if(r.setSector({cx:s.cx,cy:s.cy,rx:h,ry:h,innerRadius:a/h,start:o,angle:E,clockwise:!0}),n){const t=a+(h-a)/2;n.trans(s.cx+t*p(s.start),s.cy+t*g(s.start))}}}class vh extends ee{constructor(){super(...arguments),this._views=new oo(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.valueMin(),n.from),h=Math.min(o.valueMax(),n.to);if(n.axis._isHorz){const s=x(0,m(t,o.getPos(t,a))),r=x(0,m(t,o.getPos(t,h)));i.setPath(Is.rectangle(s,0,r-s,e))}else{const s=x(0,m(e,o.getPos(e,a))),r=x(0,m(e,o.getPos(e,h)));i.setPath(Is.rectangle(0,e-s,t,s-r))}i.internalClearStyleAndClass(),i.setFill("none"),i.setFill(n.color),n.style&&i.internalSetStyleOrClass(n.style)}))}}class Sh 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 wh?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 wh(t,s):e instanceof es&&(i=this._linePool.pop()||new bh(t,s)),this.add(i),i.prepare(t,e)}))}add(t){return this._views.push(t),super.add(t)}}class Vh 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")),this.setStyleOrClass(t._style)}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 ci&&(l=d(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 Ah extends Eo{constructor(t){super(t,"Reset Zoom",Ah.CLASS_NAME),this.setVis(!1)}}Ah.CLASS_NAME="rct-reset-zoom";class Ph 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 So(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 oo(this,Br)}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 Ch 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 Br(t,"rct-body-depth-side-line")),this.add(this._endView=new Br(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 Lh extends ee{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new Ch(t,!0)),this.add(this._ySideView=new Ch(t,!1)),this.add(this._orgLineView=new Br(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 Nh extends xo{constructor(t,e){super(t,Nh.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 Lh(t)),this.add(this._image=new vo(t,!0,"rct-body-image")),this.add(this._emptyView=new Ph(t)),this.add(this._gridRowContainer=new vh(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 Sh(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._stackLabelContainer=new ee(t,"rct-stack-label-container")),this.add(this._frontGuideContainer=new Sh(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 Ah(t)),this._crosshairViews=new oo(this._feedbackContainer,Vh)}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(la.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 Fr)){_=!1;break}if(l=null,_)if(a>1){const n=[];o.forEach((o=>{s=b(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=b(l.getHintDistance(),e),i=l.getNearest2(t.x,t.y,r);else o.forEach((r=>{if(r.getHintDistance&&(s=b(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 Yi){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 ln){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(la.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(la.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 ba&&e.endHover(t,!1),e.setBoolData(la.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(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;t.setStyleOrClass(e._style),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._layoutEmptyView(e,n,o)}_layoutEmptyView(t,e,s){this._emptyView.setVis(this.$_isEmptyVisible(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(t.emptyView,e,s))}$_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($o[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 gr)||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 mh(t);r.set(e,s),i.add(s)}if(e instanceof gr&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const s=new Br(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(),t._stackLabelContainer.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)})),a.forEach((t=>t._stackLabelContainer.remove()));const l=new Map;for(const t of a){const e=t.model._group;e&&e._stacked&&e.isLastVisible(t.model)&&l.set(e,t)}l.forEach((t=>this._stackLabelContainer.add(t._stackLabelContainer)))}_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)||gh(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 gr&&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)}))}}Nh.BODY_CLASS="rct-body";class Mh extends Jt{constructor(t){super(t,Eh.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){const i=2*Ji.HANDLE_RADIUS,r=new qt;this._back.rect={x:-i/2,y:-i/2,width:i,height:i,rx:i/2};const n=i/3;r.polygon(-n-1,0,-1,-n,-1,n),r.polygon(n+1,0,1,-n,1,n),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=s}}}class Eh extends xo{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(Eh.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Eh.MASK_STYLE)}constructor(t){super(t,Eh.CLASS_NAME),this.add(this._back=new zs(t,Eh.BACK_STYLE)),this.add(this._container=new ee(t,null)),this.add(this._mask=new zs(t,Eh.MASK_STYLE)),this.add(this._trackView=new zs(t,Eh.TRACK_CLASS)),this.add(this._thumbView=new zs(t,Eh.THUMB_CLASS)),this.add(this._startHandle=new Mh(t)),this.add(this._endHandle=new Mh(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;let o,a,h=s,l=i;return e._vertical?(h=e.getSize(),o=e.getThickness(),a=i):(l=e.getSize(),o=s,a=e.getThickness()),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:h,height:l}}_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));const o=Ji.HANDLE_TRACK_HEIGHT,a=Ji.HANDLE_TRACK_OFFSET;if(this._trackView.setBounds(-2,n,r+4,o),this._trackView.setRadius(4),this._thumbView.setBounds(t,n,e-t,o),this._startHandle.setVis(i.handle.visible),this._endHandle.setVis(i.handle.visible),this._startHandle.visible&&this._endHandle){const s=2*Ji.HANDLE_RADIUS;this._startHandle.layout(s,s,!1),this._startHandle.trans(t,n+a),this._endHandle.layout(s,s,!1),this._endHandle.trans(e,n+a),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)}}Eh.CLASS_NAME="rct-navigator",Eh.BACK_STYLE="rct-navigator-back",Eh.MASK_STYLE="rct-navigator-mask",Eh.HANDLE_STYLE="rct-navigator-handle",Eh.HANDLE_BACK_STYLE="rct-navigator-handle-back",Eh.TRACK_CLASS="rct-navigator-track",Eh.THUMB_CLASS="rct-navigator-thumb";class Th extends le{constructor(t){super(),this.chart=t}}class Bh extends Th{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=x(0,e-(o.x-n.x)),this._yStart=x(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=x(0,m(i.height,e-(i.y-s.y))),this._body.setZoom(0,m(x(0,this._yStart),e),this._body.width,x(m(this._yStart,i.height),e))):(t=x(0,m(i.width,t-(i.x-s.x))),this._body.setZoom(x(0,m(this._xStart,t)),0,x(m(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=x(0,m(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,m(this._yStart,r),this._body.width,y(this._yStart-r))):(i=x(0,m(o.width,i-(o.x-n.x))),this._feedback.setBounds(m(this._xStart,i),0,y(this._xStart-i),this._body.height)),!0}}class Oh extends Th{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 Rh extends Th{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 Dh extends Th{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=x(0,m(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class $h{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&&(y(this._clickX-i)>3||y(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),e.forceHideTooltip(),this._stopEvent(t)):t.buttons>=1?(e.pointerMoved(-1,-1,null),e.forceHideTooltip()):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;if(!this._chart.model.clickable())return;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)})){const t=at.makeArray(a.legend.getSources(a),!0),e=!a.source.visible;t.forEach((t=>{if(t instanceof ri){const e=t,r=s.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=i.findSeriesView(r);t instanceof Sa&&t.togglePointVisible(e)}}else t.visible=e})),i.bodyView().hoverSeries(e?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 Oh(this._chart,i.getScrollView(t)):Eh.isHandle(t)?new Rh(this._chart,i._navigatorView,t):Eh.isMask(t)&&r&&r.model.isZoomed()?new Dh(this._chart,i._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Bh(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 Fh extends ee{constructor(t){super(t,Fh.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(e,s){if(this.setVis(s&&s.length>0)){const i=this._itemViews,r=this._separators;for(;i.length<s.length;){const s=new ue(e,"rct-history-item");s.anchor=t.TextAnchor.START,i.push(s)}for(;i.length>s.length;)i.pop().remove();for(;r.length<s.length-1;){const s=new ue(e);s.anchor=t.TextAnchor.START,s.text=">",r.push(s)}for(;r.length>s.length-1;)r.pop().remove();this.$_layout(s)}}$_layout(t){const e=this._itemViews,s=this._separators,i=this.itemGap,r=t.length;let n=0;for(let o=0;o<r;o++)e[o].text=t[o].name,e[o].transX(n),o<r-1&&(n+=e[o].width+i,s[o].transX(n),n+=s[o].width+i)}}Fh.TITLE_CLASS="rct-history";class Ih extends xo{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new zs(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new ue(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){return t===this._marker&&t.parent===this||(this._marker&&this._marker!==t&&this._marker.remove(),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():ao,l=ho(this._label.getBBox());return this._gap=b(e.legend.options.markerGap,0),{width:h.width+this._gap+l.width,height:x(h.height,l.height)}}_doLayout(t){const e=this._rMarker,s=b(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 zh extends yo{constructor(t){super(t,zh.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new oo(this,Ih)}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=b(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?b(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,m,y;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;)y=h.get(b),w%i==0?(u.push(m=[y]),f=y.mh,w++,b++):(f+=l+y.mh,f<=n?(m.push(y),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=x(s,t.mw),r=x(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),f=x(f,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=_*(u.length-1)}else{for(;b<d;)y=h.get(b),w%i==0?(u.push(m=[y]),g=y.mw,w++,b++):(g+=l+y.mw,g<=r?(m.push(y),w++,b++):w=0);g=f=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=x(s,t.mh)})),e+=l*(t.length-1),g=x(g,e),f+=s,p.push(s)})),f+=_*(u.length-1)}return{width:g,height:f}}}zh.LEGEND_CLASS="rct-legend";class Hh extends Jt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new To(t))}layout(){}}class Gh extends Jt{constructor(t,e,s,i){super(t,e),this.add(this._markContainer=new ee(t,"rct-polar-axis-markers")),this._markViews=new oo(this._markContainer,Hh),this.add(this._gridContainer=new Jt(t,"rct-polar-axis-grids")),this._labelViews=new oo(this._labelContainer=s,ko,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;s.chart._body.getPolar(e),s.options.rotation;const i=t.length;this._labelContainer.setStyleOrClass(s._style),this._labelViews.prepare(i,((e,i,r)=>{e.setVis(!0),this._prepareLabel(e,t[i],s,r)}))}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 jh extends Gh{constructor(t,e,s){super(t,"rct-polar-xaxis",s,!0),this._gridLines=new oo(this._gridContainer,Br,jh.GRID_CLASS),e.insertFirst(this._startView=new Br(t,jh.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new Br(t,jh.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Oo(t,jh.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/E)),this._gridContainer.visible&&this._gridLines.forEach(((n,a)=>{const h=r[a].pos,l=e+p(o+h)*i,_=s+g(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",_=[],c=t.label.options.rotation||0,d="auto"===c;this._labelViews.forEach(((t,i)=>{if(t.setVis(i%a==0)){t.layout(l);const n=r[i],a=t.getBBox(),u=t.angle=o+n.pos,f=(u*O%360+360)%360,m=f>90&&f<270;if(d){const i=e-a.width/2+p(u)*(h+a.width/2),r=s-a.height/2+g(u)*(h+a.width/2);t.trans(i,r),t.setRotation(a.width/2,a.height/2,m?u*O+180:u*O)}else{const i=e+p(u)*(h+a.width/2)-a.width/2,r=s+g(u)*(h+a.height/2)-a.height/2;t.trans(i,r),t.setRotation(a.width/2,a.height/2,c)}_.push(t)}}));let u=0,f=_[u];for(let t=1;t<_.length;t++){const e=_[t],s=f.inflateBBox(-1,-1),i=e.inflateBBox(-1,-1),r=Object.assign(s,{rotation:f.rotation}),n=Object.assign(i,{rotation:e.rotation});if(po(r,n)?(e.setVis(!1),_.splice(t,1),--t):(f=e,u=t),t===_.length-1&&_.length>1){if(at.diffAngle(f.angle,_[0].angle)<E/6){const t=Object.assign(_[0].inflateBBox(-1,-1),{rotation:_[0].rotation}),e=Object.assign(f.inflateBBox(-1,-1),{rotation:f.rotation});po(t,e)&&(f.setVis(!1),_.splice(u,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+p(o)*i,s+g(o)*i),r.map((t=>{const r=t.pos;h.push(e+p(o+r)*i,s+g(o+r)*i)})),n&&r[r.length-1].pos<a&&h.push(e+p(o+a)*i,s+g(o+a)*i),this._lineView.setPolyline(h)}this._startView.visible&&(this._startView.setLine(e,s,e+p(o)*i,s+g(o)*i),this._endView.setLine(e,s,e+p(o+a)*i,s+g(o+a)*i))}}jh.LINE_CLASS="rct-polar-xaxis-line",jh.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",jh.GRID_CLASS="rct-polar-xaxis-grid-line";class Wh extends Gh{constructor(t,e,s){super(t,"rct-polar-yaxis",s,!1),this._gridViews=new oo(this._gridContainer,Oo,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new Br(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 gr&&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+p(_)*i,s+g(_)*i),h.forEach((t=>{const n=t.pos;r.push(e+p(_+n)*i,s+g(_+n)*i)})),l&&h[h.length-1].pos<c&&r.push(e+p(_+c)*i,s+g(_+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+p(t)*r[a].pos-h.width*i+o,s+g(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*p(_),s+i*g(_)):this._lineView.setVLine(e,s,s-i)),this._baseView.visible&&o(this._baseView,t.getPos(i,t.getBaseValue()))}}class Xh extends Nh{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),this._layoutEmptyView(s,t,e)}_prepareAxes(t,e,s,i,r){if(!this._xAxisContainer){const e=this._image,s=this._axisBreakContainer;this.insertAfter(this._xAxisLabelContainer=new ee(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),s),this.insertAfter(this._yAxisLabelContainer=new ee(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),s),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 Wh(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 jh(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,i,r))}}class Yh extends yo{constructor(t,e){super(t,e?Yh.SUBTITLE_CLASS:Yh.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),ho(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}Yh.TITLE_CLASS="rct-title",Yh.SUBTITLE_CLASS="rct-subtitle";class Uh extends Jt{constructor(e){super(e,"rct-tooltip-row"),this.add(this._marker=new ne(e,"rct-tooltip-row-marker")),this.add(this._textView=new ue(e,"rct-tooltip-row-text")),this._textView.anchor=t.TextAnchor.START,this.add(this._detailView=new ue(e,"rct-tooltip-row-detail")),this._detailView.anchor=t.TextAnchor.START}layout(t,e,s,i,r){var n;const o=e.options,a=e.getMarkerSize(),h=e.getMarkerGap(),l=Is.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+b(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 Zh extends Jt{constructor(e){super(e,"rct-tooltip-list"),this.add(this._headerView=new ue(e)),this._headerView.anchor=t.TextAnchor.START,this.add(this._rowLayer=new ee(e,"")),this.add(this._footerView=new ue(e)),this._footerView.anchor=t.TextAnchor.START,this._rows=new oo(this._rowLayer,Uh)}layout(t,e,s,i){const r=this._headerView,n=this._footerView,o=b(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=x(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 qh extends Jt{constructor(e){super(e,qh.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new ne(e,"rct-tooltip-back")),this.add(this._top=new ne(e,"rct-tooltip-top")),this.add(this._textView=new ue(e,"rct-tooltip-text")),this.add(this._listView=new Zh(e)),this._back.setAttr("filter","url(#"+Qt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new ve,this.close(!0,!1)}show(t,e,s,i,n,o,a){const h=s.point,l=this._model=t.chart._tooltip,_=l.setTarget(t,h,i&&i.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=r(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=r(e)?e.join(" "):e,!u||!u.trim())return}this.setStyleOrClass(l._style);const g=e.contentWidth(),f=e.contentHeight(),y=this._listView,b=this._textView,w=l.getHeaderHeight(),v=l.getTailSize(),S=t.chart.isInverted(),V=t._yAxisObj;let A,P,k,C=V.options.reversed;t instanceof zi&&t.getBaseValue(V)>s.point.yValue&&(C=!C),d?(y.setVis(!0),b.setVis(!1),y.layout(e.doc(),l,this._richText,this._list),A=y.getBBox()):(y.setVis(!1),b.setVis(!0),this._richText.setFormat(u),this._richText.build(b,NaN,NaN,null,l.getTextDomain()),A=b.getBBox()),P=x(c.minWidth||0,A.width+16),k=x(c.minHeight||0,A.height+12)+w;let L=t.getTooltipHeaderColor(h);null===L&&(L=t._calcedColor,t instanceof Di?(t.options.legendByPoint||t._colorByPoint())&&(L=h._calcedColor):t._colorByPoint()&&(L=getComputedStyle(s.dom).fill)),this._top.setFill(L);const N=this.isVisible()?300:0,M=c.offset+v,E=a.getFocusPointView().getBounds(),T=e.getBounds();let B,O,R=!1;const D=l.isFollowPointer(t);if(S&&!t.isWidget)B=o-k/2-x(0,m(o-k/2,f-k)),R=D?C?P+M>n:n+P+M>g:C?P+M>E.x-T.x+E.width:E.x-T.x-M>g-P,R&&(C=!C),O=C?"left":"right",this.$_drawTooltip(0,0,P,k,O,B),C?n-=P+M:n+=M,o-=k/2;else{B=n-P/2-x(0,m(n-P/2,g-P));const t=D?o-e.getRootDistance().y:E.y-T.y-e._padding.top,s=D?f-o:T.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,B),n-=P/2,C?o+=M:o-=k+M}else{B=o-k/2-x(0,m(o-k/2,f-k));const t=E.x-T.x;O=g-t>=P+M||t<P+M?"right":"left",this.$_drawTooltip(0,0,P,k,O,B),"right"===O?n+=M:n-=P+M,o-=k/2}}return n=x(0,m(n,g-P)),o=x(0,m(o,f-k)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(x(0,n-20),x(0,o-20)),this.transEx(n,o,N/2,!1)):this.transEx(n,o,N,!1),0===N&&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:sr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Wt(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(_)}}qh.CLASS_NAME="rct-tooltip";class Kh extends te{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new qh(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 Qh 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 Jh extends bo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Yh(t,!1)),this.add(this.subtitleView=new Yh(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=x(l,c),u=h+g+_;break;default:p=l+g+c,u=x(u,h+_)}return p>0&&(p+=this.titleView.visible?b(n.options.gap,0):b(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=x(this._hTitle,this._hSub);g=x(g,g+t(i,e,this._hTitle)),m=x(m,m+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=x(f,f+d(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":y=f;break;case"right":y=f+this._wTitle-this._wSub;break;default:y=f+(this._wTitle-this._wSub)/2}else y=x(y,y+d(r,h,this._wSub))},p=b(o.titleGap,0);let g=0,f=l,m=0,y=_;switch(n.align){case"left":switch(o.position){case"leftSide":case"left":f=y+this._wSub+p,c();break;case"rightSide":y=f+this._wTitle+p,c();break;case"right":switch(y=f+this._wTitle+p,o.align){case"center":y=x(y,y+(h-this._wTitle-this._wSub)/2);break;case"right":y=x(y,_+h-this._wSub)}c();break;case"top":u(),g=m+this._hSub+p;break;default:u(),m=g+this._hTitle+p}break;case"right":switch(o.position){case"leftSide":f+=a-this._wTitle,y=f-p-this._wSub,c();break;case"left":switch(f+=a-this._wTitle,o.align){case"center":y+=(a-this._wTitle-this._wSub)/2;break;case"right":y=f-p-this._wSub}c();break;case"rightSide":case"right":y+=h-this._wSub,f=y-p-this._wTitle,c();break;case"top":u(),g=m+this._hSub+p;break;default:u(),m=g+this._hTitle+p}break;default:switch(o.position){case"leftSide":f+=(a-this._wTitle)/2,y=f-this._wSub-p,c();break;case"left":switch(f+=(a-this._wTitle)/2,o.align){case"left":break;case"center":y+=(f-y-this._wSub)/2;break;case"right":y=f-this._wSub-p}c();break;case"rightSide":f+=(a-this._wTitle)/2,y=f+this._wTitle+p,c();break;case"right":switch(f+=(a-this._wTitle)/2,o.align){case"left":y=f+this._wTitle+p;break;case"center":y+=f+this._wTitle+p,y+=(h-y-this._wSub)/2;break;case"right":y+=h-p-this._wSub}c();break;case"top":u(),g=m+this._hSub+p;break;default:u(),m=g+this._hTitle+p}}const w=b(n.offset,0),v=b(o.offset,0);0!==w&&(f+="right"===n.align?-w:w,"leftSide"!==o.position&&"rightSide"!==o.position||(y+="right"===n.align?-w:w)),0!==v&&"leftSide"!==o.position&&"rightSide"!==o.position&&(y+="right"===o.align?-v:v),e.resizeByMeasured().layout().trans(f,g),s.resizeByMeasured().layout().trans(y,m)}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}const u=b(t.options.offset,0);0!==u&&(d+="right"===t.options.align?-u:u),n.trans(d,0)}}}class tl extends bo{_doInitChildren(t){this.add(this._legendView=new zh(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 el extends bo{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=x(n,l),o=x(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===so.TOP?n-h-t.mh:h),h+=t.mh+this._gap):(t.trans(this.dir===so.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 ci?Math.floor(e):e,to:t instanceof ci?Math.floor(s):s})}))}))}}class sl extends xo{constructor(e){super(e,"rct-credits"),this.add(this._textView=new ue(e)),this._textView.anchor=t.TextAnchor.START}clicked(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,s,i,r){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.getBBox()}}class il 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 Nh(t,this));for(const e in so){const s=new el(t,so[e]);this._plotContainer.add(s),this._axisSectionMap[so[e]]=s}il.pane_class&&this.add(this._paneContainer=new il.pane_class(t,this)),this.add(this._titleSectionView=new Jh(t)),this.add(this._legendSectionView=new tl(t)),this.add(this._frontAnnotationContainer=new ee(t,"rct-front-annotations")),this.add(this._creditView=new sl(t)),this.add(this._navigatorView=new Eh(t)),this.add(this._historyView=new Fh(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,f=0,m=0,x=0,y=0,b=0;h.visible&&(h.resizeByMeasured(),l.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=g=h.height+u+c:r-=f=h.height+u+c):(p=+_.offsetX||0,"left"===_.align?i-=m=h.width+p+c:i-=x=h.width+p+c)));const w=this._titleSectionView;let v=0;const S=b+g;w.visible&&(w.resizeByMeasured(),r-=v=w.height),y=m,b=s-f;const V=this._navigatorView;let A=0;V.visible&&(V.model._vertical||(V.resize(V.mw,V.model.getThickness()),r-=A=V.mh));const P=this._legendSectionView;let k,C,L=0,N=0;if(P.visible)switch(P.resizeByMeasured().layout(),L=P.height,N=P.width,a._location){case"top":k=v+g,r-=L;break;case"bottom":r-=L,k=b-L,b-=L;break;case"right":i-=N,C=e-N;break;case"left":i-=N,y+=N,C=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(y,S+v).resize(i,r),this._paneContainer.layout(),E=r,T=i,M=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([so.LEFT,so.RIGHT].forEach((s=>{(e=t[s])&&e.visible&&(i-=e.mw)})),[so.TOP,so.BOTTOM].forEach((s=>{(e=t[s])&&e.visible&&(r-=e.mh)})),(e=t[so.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),y+=e.mw),(e=t[so.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[so.BOTTOM])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(y),e.layout(0),b-=e.mh),(e=t[so.TOP])&&e.visible&&(e.resize(i-(d?d.base:0),e.mh),o||e.transX(y),e.layout(0))),V.visible&&V.layout().transX(y);const s={x:y,y:b};this._plotWidth=i,this._plotHeight=r,o||((e=t[so.LEFT])&&e.visible&&e.trans(s.x-e.mw,s.y-e.height),(e=t[so.RIGHT])&&e.visible&&e.trans(s.x+i,s.y-e.height),(e=t[so.BOTTOM])&&e.visible&&e.trans(s.x,s.y),(e=t[so.TOP])&&e.visible&&e.trans(s.x,s.y-r-e.height));const n=this._currBody;E=this._plotHeight-0,T=this._plotWidth-0,y=s.x,b=s.y-this._plotHeight,n.resize(T,E),n.trans(y,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(T+=0,w.visible&&w.layout({xPlot:y,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":y+=T-N-e;break;case"center":y+=(T-N)/2+e;break;default:y+=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(k)){const e=+t.offsetY||0;if(y=C,"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=k,"chart"===t.alignBase)switch(n){case"left":y=s;break;case"right":y=e-N-s;break;default:y=(e-N)/2+s}else switch(n){case"left":y+=s;break;case"right":y=y+i-N-s;break;default:y+=(i-N)/2+s}y+N>e&&(y=(e-N)/2),y<0&&(y=0)}P.trans(y,b)}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:if(f>0){if(i=s-f+c,P.visible){const t=P.y+L+c;t>i&&(i=t)}}else i=s-h.height-u}switch(_.align){case"left":if(t=p,m>0&&P.visible&&"left"===a._location){const e=P.x+N+c;e>t&&(t=e)}break;case"center":t=(e-h.width)/2+p;break;default:if(x>0){if(t=e-x+c,P.visible&&"right"===a._location){const e=P.x-c-h.width;e<t&&(t=e)}}else t=e-h.width-p}h.trans(t,i)}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 Kh(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 qh(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)}forceHideTooltip(){var t,e;this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t||t.close(!0,!1):null===(e=this._tooltipView)||void 0===e||e.close(!0,!1)}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,n;if(!(null===(i=this._model)||void 0===i?void 0:i.hoverable()))return;const o=s,a=this._model&&this.bodyOf(s),h=null==o?void 0:o.classList,l=(null==h?void 0:h.value)&&(h.contains("rct-contextmenu-item")||h.contains("rct-contextmenu-list"));let _=this._hoverItem;if(this._hoverItem=null,(null===(r=this._model)||void 0===r?void 0:r.isSplitted())&&this._paneContainer.bodies.forEach((t=>{t!==a&&t.clearHover()})),a){const i=a.controlToElement(t,e),r=a.pointerMoved(i,s);if(!this._hoverItem&&this._legendSectionView._legendView.contains(o)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(o);if(t){const e=t.legend;at.makeArray(e.getSources(t),!0).forEach((t=>{e.options.seriesHovering&&t instanceof Li?a.hoverSeries(t):e.options.pointHovering&&t instanceof ri&&a.hoverPoint(t)}))}}if(_ instanceof Os&&!(this._hoverItem instanceof Os)&&(a.hoverPoint(null),a.hoverSeries(null)),this.$_handleAnnotationHover(s),!r)return void a.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach((t=>{const e=t.model,s=e.crosshair,n=e._isHorz?a.width:a.height,o=e._isHorz?i.x:i.y,h=r&&s.visible&&!l&&s.flag.visible&&!s.isBar()&&s.getFlag(n,o);if(h){t.showCrosshair(o,h);const r=[];a._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 Wr&&!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(o,h,r)}else t.hideCrosshair()}))}else(null===(n=this._model)||void 0===n?void 0:n.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 so){const s=this._axisSectionMap[so[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 Xh(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 Qh(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[so.LEFT].checkWidths(t,s,i),s-=n[so.RIGHT].checkWidths(t,s,i),i-=n[so.BOTTOM].checkHeights(t,s,i),i-=n[so.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===so.LEFT||t===so.RIGHT?s-=e.mw:t!==so.BOTTOM&&t!==so.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===so.LEFT||t===so.RIGHT?s-=e.mw:t!==so.BOTTOM&&t!==so.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)||gh(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 rl;!function(t){t.EXPORT="$$realchart_export"}(rl||(rl={}));class nl extends Qt{constructor(t,e){super(t,e),this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new ro(null,((t,e)=>{this.$_changeModel(t,e)}))}_createChartView(t){return new il(t)}_createPointerHandler(){return new $h(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 ro&&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===rl.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,s,r){if(this.model){const s=this.model._chartOptions._style;if(i(s))for(const i in s)i.startsWith("padding")?e.setStyle(i,s[i]):t.style[i]=s[i]}}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealChartExporter;t&&t.RealchartExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e._exporter.options)}}}class ol{static getVersion(){return It.version}static setLicenseKey(t){It.code=t}static setLocale(t,e){e&&L(t,e),(t=>{t&&(C=P[k=t.substring(0,2)]),C||(C=P[k="ko"])})(t)}static registerLocale(t,e){L(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,s,r=!0,n){const o=new nl(t,e);return o.chart.load(i(s)?s:{},r,n),o.chart[Qn]=o,o.chart}static createData(t,e){return new no(t||{},e)}}class al{static empty(){return new al}static create(t=0,e=0){return new al(t,e)}constructor(t=0,e=0){this.x=t,this.y=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.width=t,this.height=e}}const ll=ol.getVersion,_l=ol.setDebugging,cl=ol.setLogging,dl=ol.setAnimatable,ul=ol.configure,pl=ol.createChart,gl=ol.createData,fl=ol.setLicenseKey;t.Annotation=ze,t.AnnotationView=Do,t.ArcElement=Bo,t.AreaRangeSeries=Yr,t.AreaRangeSeriesView=Ea,t.AreaSeries=jr,t.AreaSeriesGroup=Zr,t.AreaSeriesView=Ta,t.AssetCollection=Ne,t.Axis=hs,t.AxisBaseLine=pr,t.AxisCollection=ls,t.AxisGrid=Qe,t.AxisItem=Ye,t.AxisLabel=rs,t.AxisLine=Ue,t.AxisScrollBar=ns,t.AxisScrollView=Lo,t.AxisSectorLine=as,t.AxisTick=is,t.AxisTitle=Ze,t.AxisView=Mo,t.BarRangeSeries=Ar,t.BarRangeSeriesView=Ba,t.BarSeries=Cr,t.BarSeriesBase=kr,t.BarSeriesGroup=Nr,t.BarSeriesGroupBase=Lr,t.BarSeriesPoint=Pr,t.BarSeriesView=Da,t.BarSeriesViewBase=Ra,t.BasedSeries=zi,t.BasedSeriesView=xa,t.BellCurveSeries=Kr,t.BellCurveSeriesView=$a,t.Body=Ts,t.BodyDepth=Es,t.BodyView=Nh,t.BoxPlotSeries=Jr,t.BoxPlotSeriesView=Ia,t.BoxPointElementEx=ua,t.BubblePie=hn,t.BubbleSeries=ln,t.BubbleSeriesView=Ha,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=_n,t.CandlestickSeries=dn,t.CandlestickSeriesView=ja,t.CategoryAxis=ci,t.CategoryAxisGrid=_i,t.CategoryAxisLabel=li,t.CategoryAxisTick=hi,t.Chart=ro,t.ChartControl=nl,t.ChartData=no,t.ChartDataCollection=ut,t.ChartElement=xo,t.ChartItem=Oe,t.ChartObject=io,t.ChartOptions=eo,t.ChartPointerHandler=$h,t.ChartText=De,t.ChartView=il,t.CircelBarPointLabel=un,t.CircleBarSeries=pn,t.CircleBarSeriesGroup=gn,t.CircleBarSeriesView=Xa,t.CircleElement=To,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=Ps,t.CircularGaugeGroup=ks,t.CircularGaugeLabel=Vs,t.ClockGaugeType="clock",t.ClusterableSeries=Fi,t.ClusterableSeriesGroup=Xi,t.Color=Dt,t.ConnectableSeries=Mi,t.ConstraintSeriesGroup=Wi,t.ContentView=wo,t.ContinuousAxis=gr,t.Credits=Jn,t.Crosshair=We,t.DataPoint=ri,t.DataPointCollection=ni,t.DataPointLabel=wi,t.Dom=$t,t.DumbbellSeries=xn,t.DumbbellSeriesView=Ua,t.ElementPool=oo,t.EqualizerSeries=bn,t.EqualizerSeriesView=qa,t.ErrorBarSeries=wn,t.ErrorBarSeriesView=Qa,t.Exporter=Bs,t.FunnelSeries=An,t.FunnelSeriesView=th,t.Gauge=ps,t.GaugeBase=us,t.GaugeGroup=gs,t.GaugeGroupView=Ho,t.GaugeItem=class extends Oe{constructor(t){super(t.chart)}},t.GaugeLabel=Ss,t.GaugeRangeBand=vs,t.GaugeRangeLabel=ws,t.GaugeScale=bs,t.GaugeView=Fo,t.HeatmapSeriesType="heatmap",t.HistogramSeries=Cn,t.HistogramSeriesView=sh,t.IconedText=$e,t.ImageAnnotation=or,t.ImageAnnotationView=Va,t.ImageElement=vo,t.LayerElement=ee,t.Legend=Rs,t.LegendItem=Os,t.LegendItemView=Ih,t.LegendView=zh,t.LineElement=Br,t.LinePointLabel=$r,t.LineSeries=zr,t.LineSeriesBase=Fr,t.LineSeriesBaseView=Na,t.LineSeriesGroup=Ur,t.LineSeriesPoint=Rr,t.LineSeriesView=Ma,t.LinearAxis=fr,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=Zn,t.LollipopSeries=Mn,t.LollipopSeriesView=rh,t.LowRangedSeries=Gi,t.MarkerSeries=Yi,t.MarkerSeriesPointView=ba,t.MarkerSeriesView=wa,t.NavigatorMask=Zi,t.NavigiatorHandle=Ui,t.ORG_ANGLE=T,t.OhlcSeries=Tn,t.OhlcSeriesView=oh,t.OthersGroup=Ri,t.PI_2=E,t.PaneContainer=class extends ee{},t.ParetoSeries=On,t.ParetoSeriesView=ah,t.PathBuilder=qt,t.PathElement=ne,t.PictogramSeriesType="pictogram",t.PictorialBarSeriesType="pictorialbar",t.PictorialSeriesType="pictorial",t.PieSeries=zn,t.PieSeriesGroup=Hn,t.PieSeriesLabel=Fn,t.PieSeriesText=$n,t.PieSeriesView=ch,t.Point=al,t.PointElement=_a,t.PointHovering=to,t.PointLabelLineContainer=sa,t.PointLabelLineView=ea,t.PointLabelView=Jo,t.PointViewPool=ka,t.RAD_DEG=O,t.RaceBarSeriesType="racebar",t.RaceLineSeriesType="raceline",t.RadialSeries=$i,t.RangedSeries=Hi,t.RcAnimation=Xt,t.RcControl=Qt,t.RcElement=Jt,t.RcObject=lt,t.RectElement=zs,t.SVGNS=e,t.ScaleView=class extends xo{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 oo(this._tickContainer,Br),this.add(this._labelContainer=new ee(t,"rct-gauge-scale-tick-labels")),this._labels=new oo(this._labelContainer,zo)}},t.ScatterSeries=jn,t.ScatterSeriesView=uh,t.SectionView=bo,t.SectorElement=tn,t.Series=Li,t.SeriesAnimation=Go,t.SeriesGroup=ji,t.SeriesMarker=Ei,t.SeriesNavigator=Ji,t.SeriesView=la,t.ShapeAnnotation=ar,t.ShapeAnnotationView=Aa,t.Size=hl,t.SplineSeries=Hr,t.StackLabel=vi,t.Subtitle=er,t.SvgShapes=Is,t.TextAnnotation=hr,t.TextAnnotationView=Pa,t.TextElement=ue,t.TimeAxis=Sr,t.Title=tr,t.Tooltip=sr,t.TreemapSeriesType="treemap",t.TrendLineArea=di,t.TrendLineLabel=ui,t.Trendline=gi,t.Utils=at,t.ValueGauge=ms,t.ValueGaugeView=class extends Fo{constructor(){super(...arguments),this.valueOf=(t,e,s)=>{const i=t.getParam(e);return h(i)?yt.getFormatter(s||t.label.numberFormat).toStr(i):i},this._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 Io(this).start((()=>{t._runValue=NaN,t._prevValue=t.options.value})))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}},t.VectorSeriesType="vector",t.WaterfallSeries=Yn,t.WaterfallSeriesView=ph,t.Widget=_s,t.WidgetSeries=Di,t.WidgetSeriesConnector=Bi,t.WidgetSeriesLabel=Oi,t.WidgetSeriesPoint=Ti,t.WidgetSeriesView=Sa,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=oi,t.absv=y,t.assignObj=c,t.buildValueRanges=tt,t.calcPercent=Y,t.configure=ul,t.copyObj=t=>t&&c({},t),t.cos=p,t.createChart=pl,t.createData=gl,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=Ee,t.fixnum=D,t.getVersion=ll,t.incv=V,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isIE=ot,t.isNumber=h,t.isObject=i,t.isString=o,t.maxv=x,t.minv=m,t.parsePercentSize=W,t.pickNum=b,t.pickProp=v,t.pickProp3=S,t.pixel=F,t.rectToSize=ho,t.setAnimatable=dl,t.setDebugging=_l,t.setLicenseKey=fl,t.setLogging=cl,t.sin=g,t.toStr=function(t){return null==t?null:String(t)}}));
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChart={})}(this,function(t){"use strict";const e="http://www.w3.org/2000/svg",i=Object.prototype.hasOwnProperty,s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,n=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},a=function(t){return"string"==typeof t&&t.length>0},l=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},_=function(t){return null==t||isNaN(t)},c=Object.assign,d=Math.floor,u=Math.ceil,p=Math.cos,g=Math.sin,f=Math.log10,m=Math.min,y=Math.max,x=Math.abs,b=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},w=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):s):s},v=function(t,e){return void 0!==t?t:e},S=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},V=(t,e,i)=>t+(e-t)*i,C=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 L=(t,e)=>{t&&s(e)&&(k=A[t.substring(0,2)]=Object.assign(A.ko,A.en,e))},T=void 0,N=Math.PI,M=2*N,E=-N/2,B=2*N/360,D=360/N/2,O="%".charCodeAt(0);function R(t){return parseFloat(t.toPrecision(12))}function $(t){return Math.floor(1e6*t)/1e6}function I(t){return t+"px"}function F(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 i={};return i[t]=e,i}function W(t,e,i){let s,r=!1;if(null==t){if(e)return null;s=i||0,r=!0}else if("string"==typeof t){const i=t.trim();if(0===i.length?s=NaN:i.charCodeAt(i.length-1)===O?s=1===i.length?NaN:parseFloat(i):(s=parseFloat(i),r=!0),isNaN(s)){if(e)return null;J(k.invalidSizeValue,t)}}else if(s=+t,isNaN(s)){if(e)return null;s=i||0,r=!0}else r=!0;return{size:s,fixed:r}}function Y(t,e){return W(t,!0)||W(e,!1)}function X(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}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,i,n=!0,a=!0,l=!1,h){let _,d;if(n&&(e=-Number.MAX_VALUE,i=Number.MAX_VALUE),r(t))_=[],t.forEach(t=>{if(s(t)&&o(t.color)){const s={fromValue:b(t.fromValue,d?d.toValue:e),toValue:b(t.toValue,i),color:t.color,style:t.style?c({},t.style):T};s.fromValue<s.toValue&&(_.push(s),d=s)}}),_=_.sort((t,e)=>t.fromValue-e.fromValue).filter(t=>t.toValue>=e&&t.fromValue<i),a&&_.forEach(t=>{t.fromValue=y(t.fromValue,e),t.toValue=m(t.toValue,i)});else if(s(t)&&r(t.colors)&&t.colors.length>0){const s=t.colors,n=r(t.styles)?t.styles:null;if(_=[],r(t.steps)&&t.steps.length>0){const o=r(t.steps)?t.steps:null;e<o[0]&&o.unshift(e),i>o[o.length-1]&&o.push(i);for(let t=0;t<o.length-1;t++)_.push({fromValue:o[t],toValue:o[t+1],color:s[m(t,s.length-1)],style:n?n[m(t,n.length-1)]:T})}else{let r=b(t.fromValue,e);const o=b(t.toValue,i),a=(o-r)/s.length;let l=0;for(;r<o;)_.push({fromValue:r,toValue:r+=a,color:s[m(l,s.length-1)],style:n?n[m(l,n.length-1)]:T}),l++}}if(l&&_&&_.length>0){let t=0,s=e;for(;t<_.length;)_[t].fromValue>s&&_.splice(t,0,{fromValue:s,toValue:_[t].fromValue,color:h}),s=_[t].toValue,t++;_[t-1].toValue<i&&_.push({fromValue:_[t-1].toValue,toValue:i,color:h})}return _},et="shuffle",it="random",st="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 i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),i=t.getDate(),s=[0,31,59,90,120,151,181,212,243,273,304,334][e]+i;return e>1&&at.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(m(i,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,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,l=e+Math.ceil((o+n-7)/7),h=e+Math.floor(a/7);return i||h<2+e?h:h===l?e+5:h}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!r(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!r(t))return c({},t)}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(t)?t.map(t=>+t):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(r(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return r(t)?t:null!=t?[t]:null}static copyArray(t){return r(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}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 i=parseFloat(t);return isFinite(i)?i:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(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,i){return e=y(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=y(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}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 i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static parseTuples(t){if(r(t)){const e=[];let i=-1/0;return t.forEach((s,n)=>{r(s)?!isNaN(s[0])&&!isNaN(s[1])&&s[0]>i&&(e.push([+s[0],+s[1]]),i=s[0]):isNaN(s)||n!==t.length-1||e.push([1/0,+s])}),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=r(t)?[]:{};for(let i of Object.keys(t))e[i]=this.deepClone(t[i]);return e}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort((t,e)=>t-e)}static logElapsed(t,e){const i=+new Date;e(),at.log(t,+new Date-i+"ms")}static clamp(t,e,i){return y(e,m(i,t))}static makeIntArray(t,e){const i=new Array(y(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length;e;){const i=Math.floor(Math.random()*e),s=t[--e];t[e]=t[i],t[i]=s}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,i){const s=x(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%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 i=x(t-e);return m(i,M-i)}}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 lt=0;class ht{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(lt++))}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 ht{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 i=Array.prototype.slice.call(arguments,0);i[0]=this;for(const e of this._listeners){const s=e[t];if(s){const t=s.apply(e,i);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||{}),r(e)&&e.forEach(t=>this._rows.push(this.$_readRow(t)))}$_buildOptions(t){const e=t.fields;let i;i=r(e)?e.slice():o(e)?[e]:["x","y","z"],this._fields=i,this._field=t.field||"y",this._fieldMap={};for(let t=0;t<i.length;t++)this._fieldMap[i[t]]=t}get rowCount(){return this._rows.length}_internalValues(){return this._rows}$_readRow(t){let e={};if(r(t))for(let i=0;i<this._fields.length;i++)e[this._fields[i]]=t[i];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,i){this._checkRow(t);const s=this._rows[t],r=s[e];i!==r&&(s[e]=i,this._rows[t]=s,this._fireEvent("onDataValueChanged",t,e,i,r),this._changed())}getValues(t,e=0,i=-1){const s=this._rows,r=[];(isNaN(e)||e<0)&&(e=0),(isNaN(i)||i<0||i>s.length)&&(i=s.length);for(let n=e;n<i;n++)r.push(s[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 i=t[e];let s;r(i)?s=new dt({},i):ct(i)&&r(i.values)&&(s=new dt(i.options,i.values)),this._map[e]=s}}}const pt="0".charCodeAt(0),gt="#".charCodeAt(0),ft=",".charCodeAt(0),mt="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 i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===pt;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===gt;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===pt;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===ft){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===mt){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===yt){i.signDisplay="never";break}}return i.minimumIntegerDigits=y(1,i.minimumIntegerDigits),i}}}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),Ct="a".charCodeAt(0),At="y".charCodeAt(0),Pt="M".charCodeAt(0),kt="m".charCodeAt(0),Lt="W".charCodeAt(0),Tt="w".charCodeAt(0),Nt="d".charCodeAt(0),Mt="H".charCodeAt(0),Et="h".charCodeAt(0),Bt="S".charCodeAt(0),Dt="s".charCodeAt(0);class Ot{static getFormatter(t){let e=Ot.Formatters[t];return e||(Ot.Formatters[t]=e=new Ot(t)),e}static get Default(){return Ot.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 i=this._tokens;let s="";for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o.length;switch(o.charCodeAt(0)){case At:s+=a>2?t.getFullYear():H(t.getFullYear()%100);break;case Pt:s+=a>1?H(t.getMonth()+1):t.getMonth()+1;break;case Nt:s+=a>1?H(t.getDate()):t.getDate();break;case Lt:s+=a>1?H(at.weekOfYear(t,e)+1):at.weekOfMonth(t,e,!0)+1;break;case Tt:s+=a>1?at.long_week_days[t.getDay()]:at.week_days[t.getDay()];break;case Mt:s+=a>1?H(t.getHours()):t.getHours();break;case Et:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?H(e):e}else s+=a>1?H(t.getHours()):t.getHours();break;case kt:s+=a>1?H(t.getMinutes()):t.getMinutes();break;case Dt:s+=a>1?H(t.getSeconds()):t.getSeconds();break;case Ct:case Vt:t.getHours()<12?s+=k.am:s+=k.pm;break;case Bt:let i=t.getMilliseconds();s+=3==a?G(i):2==a?H(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(wt.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<s&&i.charAt(r)==n;)r++;if(n=i.substring(o,r),bt.indexOf(n)<0){let e=n.charCodeAt(0);(e>=Vt&&e<=vt||e>=Ct&&e<=St)&&J(k.invalidDateFormat,t)}e.push(n)}if(r<s&&at.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&at.isWhiteSpace(i.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)}}Ot.Formatters={};class Rt{static isBright(t){return new Rt(t).isBright()}static getContrast(t,e,i){return new Rt(t).getContrast(e,i)}static interpolate(t,e,i){const s=new Rt(t),r=new Rt(e),n=1-i,o=Math.round(s.r*i+r.r*n),a=Math.round(s.g*i+r.g*n),l=Math.round(s.b*i+r.b*n),h=s.a*i+r.a*(1-i);return h<1?`rgba(${o},${a},${l},${h})`:`rgb(${o},${a},${l})`}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 i;e>6?(i=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)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}}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 i in e)t.setAttribute(i,e[i])}static setStyles(t,e){return e&&Object.assign(t.style,e),t}static setImportantStyle(t,e,i){t.setProperty(e,i,"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,i=""){return t.style.display=e?i:"none",e}static isHidden(t){return"none"===t.style.display}static setClipPath(t,e){let i=null;"string"==typeof e?i=e:$t.isSVGClipPathElement(e)&&(i=e.id||null),i?t.setAttribute("clip-path",`url(#${i})`):t.removeAttribute("clip-path")}static createClipRect(t,i){const s=t.createElementNS(e,"clipPath");return s.id=i,s.append(t.createElementNS(e,"rect")),s}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,i,s,r){return t.setAttribute("x",e),t.setAttribute("y",i),t.setAttribute("width",s),t.setAttribute("height",r),t}static isSVGElement(t){return $t.isElement(t)&&t.namespaceURI===e}static isSVGClipPathElement(t){return $t.isSVGElement(t)&&"clipPath"===t.tagName}static setBoolData(t,e,i){i?t.dataset[e]="1":delete t.dataset[e]}static isHoverAt(t){return t.matches(":hover")}}var It;$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"}(It||(It={}));const Ft={name:"RealChart",version:"1.4.28",license:"enterprise",code:null};class zt{static decode(t){const e=zt.CHARS,i=zt.PAD;let s=t.split(""),r=[],n=s.length;for(;s[--n]==i;);for(let t=0;t<n;){let i=e.indexOf(s[t++])<<18;t<=n&&(i|=e.indexOf(s[t++])<<12),t<=n&&(i|=e.indexOf(s[t++])<<6),t<=n&&(i|=e.indexOf(s[t++])),r.push(i>>>16&255),r.push(i>>>8&255),r.push(255&i)}for(;0==r[r.length-1];)r.pop();return r}}zt.PAD="=",zt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Ht{static union(t,e){const i=e.s3[255&t];t>>=8;const s=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^s>>16)<<16|65535&(65535&o^65535&s),(o>>16)+(i>>16)+((65535&o)+(65535&i)>>16)<<16|(65535&o)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=Ht.xor,s=Ht.union;let r=t.left,n=t.right;r=i(r,e.p[0]),n=i(n,i(s(r,e),e.p[1])),r=i(r,i(s(n,e),e.p[2])),n=i(n,i(s(r,e),e.p[3])),r=i(r,i(s(n,e),e.p[4])),n=i(n,i(s(r,e),e.p[5])),r=i(r,i(s(n,e),e.p[6])),n=i(n,i(s(r,e),e.p[7])),r=i(r,i(s(n,e),e.p[8])),n=i(n,i(s(r,e),e.p[9])),r=i(r,i(s(n,e),e.p[10])),n=i(n,i(s(r,e),e.p[11])),r=i(r,i(s(n,e),e.p[12])),n=i(n,i(s(r,e),e.p[13])),r=i(r,i(s(n,e),e.p[14])),n=i(n,i(s(r,e),e.p[15])),r=i(r,i(s(n,e),e.p[16])),t.right=r,t.left=i(n,e.p[17])}static _decryptBlock(t,e){const i=Ht.xor,s=Ht.union;let r=t.left,n=t.right;r=i(r,e.p[17]),n=i(n,i(s(r,e),e.p[16])),r=i(r,i(s(n,e),e.p[15])),n=i(n,i(s(r,e),e.p[14])),r=i(r,i(s(n,e),e.p[13])),n=i(n,i(s(r,e),e.p[12])),r=i(r,i(s(n,e),e.p[11])),n=i(n,i(s(r,e),e.p[10])),r=i(r,i(s(n,e),e.p[9])),n=i(n,i(s(r,e),e.p[8])),r=i(r,i(s(n,e),e.p[7])),n=i(n,i(s(r,e),e.p[6])),r=i(r,i(s(n,e),e.p[5])),n=i(n,i(s(r,e),e.p[4])),r=i(r,i(s(n,e),e.p[3])),n=i(n,i(s(r,e),e.p[2])),r=i(r,i(s(n,e),e.p[1])),t.right=r,t.left=i(n,e.p[0])}static _init(t){let e=t.split("").map(function(t){return 255&t.charCodeAt(0)});const i=Ht.kb,s=Ht._encryptBlock;let r,n,o,a=0,l=0,h={left:0,right:0};const _={p:i.p.slice(0).map(function(t){let i,s=e.length;for(i=0;i<4;i++)l=l*Ht.POW8|e[a++%s];return(t>>16^l>>16)<<16|65535&(65535&t^65535&l)}),s0:i.s0.slice(0),s1:i.s1.slice(0),s2:i.s2.slice(0),s3:i.s3.slice(0)};for(r=0,o=_.p.length;r<o;)s(h,_),_.p[r++]=h.left,_.p[r++]=h.right;for(r=0;r<4;r++)for(n=0,o=_["s"+r].length;n<o;)s(h,_),_["s"+r][n++]=h.left,_["s"+r][n++]=h.right;return _}static decrypt(t,e){const i=Ht._decryptBlock;let s=Ht._init(e),r=[],n=zt.decode(t),o=n.length>>3,a=0,l={left:null,right:null};for(let t=0;t<o;t++){l.left=n[a]*Ht.POW24|n[a+1]*Ht.POW16|n[a+2]*Ht.POW8|n[a+3],l.right=n[a+4]*Ht.POW24|n[a+5]*Ht.POW16|n[a+6]*Ht.POW8|n[a+7],i(l,s);const t=l.left,e=l.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 i=0,s=t.length;i<s;i++)e+=String.fromCharCode(t[i]>>1);return e}static includedDomains(t,e,i){let s=t.split(",");for(let t=0,r=s.length;t<r;t++){const r=s[t];if(this.eqaulsUpperDomain(r,e))return!0;if(i&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(i))return!0}}return!1}static decrypt(t){const e={},i=Ht.decrypt(t,"dkdl"+this._getLDKey(Ht.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],n=s[1];n&&n.length>0&&(e[r]=n)}return e}}const jt={linear:t=>t,inOutSine:t=>-(p(N*t)-1)/2},Wt=function(t,e,i,s,r,n){const o=j(e,null!=i?i:"initial"),a=j(e,s),l=t.animate([o,a],{duration:r,fill:"none"});return n&&(l?l.addEventListener("finish",n):setTimeout(n,0)),l};class Yt{constructor(){this.delay=0,this.duration=Yt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date,e=t-this._prev,i=t-this._started-this.delay;let s=m(1,y(0,R(i/this.duration)));this._easing&&(s=this._easing(s)),this._rate=s,this._prev=t;try{(!this._canUpdate()||!1===this._doUpdate(s,e)||isFinite(this.duration)&&!this._timer)&&this._stop(!0)}finally{i>=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,i=null){this._started&&this._stop(!0),this.duration=b(t,Yt.DURATION),this.delay=e||0,this._easing=jt[i],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 Xt extends Yt{constructor(t){super(),this.props=t,t.duration>0&&(this.duration=t.duration),this.endHandler=(t,e)=>{var i,s;null===(s=(i=this.props).endHandler)||void 0===s||s.call(i,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 Xt(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=>{l(t)||o(t)?this._path.push(t):this._path.push(t.x,t.y)}),this}move(t,e){return l(t)?this._path.push("M",t,e):this._path.push("M",t.x,t.y),this}moveBy(t,e){return l(t)?this._path.push("m",t,e):this._path.push("m",t.x,t.y),this}line(t,e){return l(t)?this._path.push("L",t,e):this._path.push("L",t.x,t.y),this}moveOrLine(t,e,i){return t?this._path.push("L",e,i):this._path.push("M",e,i),this}vline(t,e,i){return this._path.push("M",t,e,"L",t,i),this}hline(t,e,i){return this._path.push("M",e,t,"L",i,t),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}quad(t,e,i,s){return l(t)?this._path.push("Q",t,e,i,s):this._path.push("Q",t.x1,t.y1,t.x2,t.y2),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0,"Z"),this}lines(...t){if(l(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 l(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,i){return 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`),this}donut(t,e,i,s){return this._path.push(`M ${t-i} ${e} a ${i} ${i} 0 1 1 ${2*i} 0 a ${i} ${i} 0 1 1 ${2*-i} 0 Z`),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 Z`),this}getMove(t=0,e=!0){if(t<this._path.length&&"M"===this._path[t]){const i={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),i}}getLine(t=0,e=!0){if(t<this._path.length&&"L"===this._path[t]){const i={x:this._path[t+1],y:this._path[t+2]};return e&&this._path.splice(t,3),i}}getQuad(t=0,e=!0){if(t<this._path.length&&"Q"===this._path[t]){const i={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),i}}getPoints(t,e,i=!0){const s=[];for(;t<this._path.length&&s.length<e&&t<this._path.length&&("M"===this._path[t]||"L"===this._path[t]);)s.push({x:this._path[t+1],y:this._path[t+2]}),i&&this._path.splice(t,3);return s}spline(t,e,i){let s=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void this.line(t[s+1].px,t[s+1].py);const r=.35,n={x:0,y:0},o={x:0,y:0},a={x:0,y:0},l={x:t[s+1].px-t[s].px,y:t[s+1].py-t[s].py};let h={x:0,y:0},_=Math.sqrt(l.x*l.x+l.y*l.y);if(0===_)return void this.line(t[i].px,t[i].py);l.x/=_,l.y/=_;let c=t[s+1].px-t[s].px,d=t[s].px,u=t[s].py;for(++s;s!=i;s++){a.x=-l.x,a.y=-l.y,l.x=t[s+1].px-t[s].px,l.y=t[s+1].py-t[s].py,_=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=_,l.y/=_,l.x<a.x?(h.x=a.x-l.x,h.y=a.y-l.y):(h.x=l.x-a.x,h.y=l.y-a.y);const e=Math.sqrt(h.x*h.x+h.y*h.y);h.x/=e,h.y/=e,a.y*l.y>=0&&(h={x:1,y:0}),n.x=-h.x*c*r,n.y=-h.y*c*r;const i=d+o.x,p=u+o.y,g=t[s].px+n.x,f=t[s].py+n.y;this.curve(i,p,g,f,t[s].px,t[s].py),c=t[s+1].px-t[s].px,o.x=h.x*c*r,o.y=h.y*c*r,d=t[s].px,u=t[s].py}this.curve(d+o.x,u+o.y,t[s].px,t[s].py,t[s].px,t[s].py)}closedSpline(t,e){const i=t.length;if(i<3)return void this.line(t[1].px,t[1].py);const s=.17,r=e?e=>t[(e+i)%i]:e=>e<0?t[0]:e>=i?t[i-1]:t[e];for(let t=0,n=i-(e?0:1);t<n;t++){const e=r(t-1),i=r(t),n=r(t+1),o=r(t+2),a=i.px+(n.px-e.px)*s,l=i.py+(n.py-e.py)*s,h=n.px-(o.px-i.px)*s,_=n.py-(o.py-i.py)*s;this.curve(a,l,h,_,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 ht{constructor(t,e,i){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 i="RealChart를 사용하려면 도움말을 참조하세요.\nhttps://www.realchart.co.kr/";try{if(e=Ft.code||window.realChartLic,!e)throw new Error(i)}catch(t){throw new Error(i)}const s=Gt.decrypt(e);if("RealChart"!==s.name||"RealChart"!==Ft.name)throw new Error(i);try{const e=s.server.toLowerCase(),r=location.pathname.toLowerCase();if(Ft.license!=It.Developer&&!Gt.includedDomains(e,t.toLowerCase(),r))throw new Error(i);const n=s.lic.toLowerCase();if(!Object.values(It).includes(n))throw new Error(i);if(Ft.license=s.lic,n==It.Evaluation||n==It.Limited){const t=s.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(i)}}(),!t&&$t.instanceOf(e,"div")&&(t=e.ownerDocument),this._initControl(t||document,e,i||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,i){z(e)?(this._root.dom.removeAttribute("data-"+t),i&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),i&&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 i=e.length-1;i>=0;i--)e[i].hasAttribute(t)&&e[i].remove()}clearAssetDefs(){this.$_clearDefs(Jt.ASSET_KEY)}clearClipDefs(){Array.from(this._defs.getElementsByTagNameNS(e,"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,i=NaN,s=NaN,r=0){return this.addClip(new re(this.doc(),t,e,i,s,r,r))}clipCircle(){return this.addClip(new ae(this.doc()))}clipDonut(){return this.addClip(new le(this.doc()))}clipPath(){return this.addClip(new oe(this.doc()))}addDef(t){this._defs.appendChild(t)}removeDef(t){if(o(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,i){const s=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+s.x,y:i-r.y+s.y}}svgToElement(t,e,i){const s=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+s.left,y:i-r.top+s.top}}elementToSvg(t,e,i){const s=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-s.left,y:i+r.top-s.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,i,s){s?t.addEventListener(e,i,{passive:!0}):t.addEventListener(e,i)}_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,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,i,s){if(this._inited)return;const r=t.defaultView;i instanceof r.HTMLDivElement?this._container=i:this._container=t.getElementById(i),this._container instanceof r.HTMLDivElement||J(k.invalidOuterDiv,i),t=this._container.ownerDocument;const n=this._dom=t.createElement("div");c(n.style,Kt),n.className=s,this._container.appendChild(n);const o=this._svg=t.createElementNS(e,"svg");o.classList.add("rct-svg"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=t.createElement("desc");a.textContent="Created by RealChart v"+Ft.version,o.appendChild(a);const l=this._defs=t.createElementNS(e,"defs");this._initDefs(t,l),o.appendChild(l),n.appendChild(o),this._root=new ie(this),o.appendChild(this._root._dom),this._htmlRoot=t.createElement("div"),n.appendChild(this._htmlRoot),c(this._htmlRoot.style,{position:"absolute",overflow:"visible"}),this._tester=t.createElement("div"),n.appendChild(this._tester),ot&&(this._canvas=t.createElement("canvas"))}_initDefs(t,i){let s=t.createElementNS(e,"filter");s.setAttribute("id",Qt.SHADOW_FILTER);const r=t.createElementNS(e,"feGaussianBlur");r.setAttribute("stdDeviation","1.5"),r.setAttribute("in","SourceAlpha"),s.appendChild(r);const n=t.createElementNS(e,"feOffset");n.setAttribute("dx","1"),n.setAttribute("dy","1"),n.setAttribute("result","offsetblur"),s.appendChild(n);const o=t.createElementNS(e,"feFlood");o.setAttribute("flood-color","#000"),s.appendChild(o);const a=t.createElementNS(e,"feComposite");a.setAttribute("in2","offsetblur"),a.setAttribute("operator","in"),s.appendChild(a);const l=t.createElementNS(e,"feMerge"),h=t.createElementNS(e,"feMergeNode"),_=t.createElementNS(e,"feMergeNode");_.setAttribute("in","SourceGraphic"),l.appendChild(h),l.appendChild(_),s.appendChild(l),i.appendChild(s)}_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(),i=this._svg.clientWidth,s=this._svg.clientHeight,r=this._canvas;!r||r.width===i&&r.height==s||(r.width=i,r.height=s,r.style.width=I(i),r.style.height=I(s)),c(this._htmlRoot.style,{left:I(e.left-t.left),top:I(e.top-t.top)});const n=this._container.firstElementChild;n.removeAttribute("style"),c(n.style,Kt),this._doRenderBackground(n,this._root,i,s);const o=this._padding=$t.getPadding(this._root.dom);this._doRender({x:o.left,y:o.top,width:i-o.left-o.right,height:s-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,i,s){}_domResized(){const t=this.width(),e=this.height(),i=this._resizeDelay;if(t!==this._wSave||e!==this._hSave){const s=!isNaN(this._wSave)&&!isNaN(this._hSave);this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),i>0?this._resizeTimer=setTimeout(()=>{s&&this.invalidateLayout(),this._resizeTimer=null},i):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 ht{constructor(t,i,s=T){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(e,s||"g"),(this._styleName=i||"")&&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,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(t,i){const s=t.createElementNS(e,i);return this._dom.appendChild(s),s}insertElement(t,i,s){const r=t.createElementNS(e,i);return this._dom.insertBefore(r,s),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,i,s){return this.trans(t,e),this.resize(i,s),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 i=this._dom.getBBox();return ot&&(i={x:i.x,y:i.y,width:i.width,height:i.height}),i.x+=this._tx,i.y+=this._ty,i.x-=t,i.width+=2*t,i.y-=e,i.height+=2*e,i}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 Xt||!!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 i;this._updateTransform(),e&&(null===(i=this.control)||void 0===i||i.invalidateLayout()),t===this._moveAni&&(this._moveAni=null)}transEx(t,e,i=0,s=!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(i>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:i,fill:"none"});this._tx=t,this._ty=e,r?(r.addEventListener("finish",()=>{this.$_cleanMove(r,s)}),r.addEventListener("cancel",()=>{this.$_cleanMove(r,s)})):this.$_cleanMove(r,s)}else this._tx=t,this._ty=e,this._updateTransform();return this}transEx2(t,e,i=0,s=!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(i>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:i,fill:"none"});this._tx=t,this._ty=e,a?(a.addEventListener("finish",()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,s)}),a.addEventListener("cancel",()=>{this._dom.style.transformOrigin="",this.$_cleanMove(a,s)})):(this._dom.style.transformOrigin="",this.$_cleanMove(a,s))}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,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}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 i in this._styles)t.removeProperty(K(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const i=this.dom.style;for(let s of t)s in this._styles&&(i.removeProperty(K(s)),delete this._styles[s],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(o(t))t&&this._dom.classList.add(t);else if(s(t)){const e=this.dom.style;for(let i in t)e.setProperty(K(i),this._styles[i]=t[i],"important")}}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this._dom.setAttribute(s,r),i[s]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){o(t)?(this._resetClass(),t&&this.addClass(t)):s(t)&&this.resetStyles(t)}internalSetStyleOrClass(t){o(t)?t&&this.addClass(t):s(t)&&this.internalSetStyles(t)}addStyleOrClass(t){o(t)?t&&this.addClass(t):s(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let i=!1;return e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,v(e,""))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}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=y(0,t.from*(1-e)),!0),endHandler:(t,i)=>{t.props.dom.style.opacity=t.props.from>=1?"":t.props.from,this._ani=null,!i&&this.remove(),null==e||e(this)},from:b(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=y(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:b(getComputedStyle(this._dom).opacity,1)}):this.setVis(!1)),this}isClip(t){return t&&t._dom.parentElement}clipRect(t,e,i,s,r=0){const n=this.control.clipBounds(t,e,i,s,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 i=this.parent._dom,s=this._dom,r=t.length;if(e){const n=e.sort((e,i)=>t.indexOf(e)-t.indexOf(i))[e.length-1];this!==n&&(s.remove(),n===t[r-1]?i.appendChild(s):i.insertBefore(s,t[t.indexOf(n)+1].dom))}else r>1&&s!==i.lastElementChild&&(s.remove(),i.appendChild(s))}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,i=this._ty,s=[];(at.isValidNum(e)||at.isValidNum(i))&&(e=e||0,i=i||0,s.push("translate("+e+","+i+")")),this._rotation&&s.push("rotate("+this._rotation+" "+at.pick(this._originX,t.getAttribute("x"),0)+" "+at.pick(this._originY,t.getAttribute("y")||0)+")"),at.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")");const r=at.getNumber(this._scaleX,1),n=at.getNumber(this._scaleY,1);return 1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length?s.join(" "):""}}Jt.DEBUGGING=!1,Jt.TESTING=!1,Jt.ASSET_KEY="_asset_",Jt.CLIP_KEY="_clip_",Jt.TEMP_KEY="_temp_";class te extends ht{constructor(t,i,s=!1){super(),this._control=i,this._dom=t.createElement("div"),s&&(this._svg=t.createElementNS(e,"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,i,s){return $t.setStyles(this._dom,{left:`${t}px`,top:`${e}px`,width:`${i}px`,height:`${s}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 ie extends Jt{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class se extends Jt{constructor(t){super(t,T,"clipPath");const e=this._id=at.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class re extends se{constructor(t,e=NaN,i=NaN,s=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,i,s,r),this.add(a)}setBounds(t,e,i,s){return this._rect.x=t,this._rect.y=e,this._rect.resize(i,s),this}resize(t,e,i){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=o(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class oe extends se{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 se{constructor(t){super(t),this.add(this._circle=new Jt(t,null,"circle"))}setCircle(t,e,i){this._circle.setAttrs({cx:t,cy:e,r:i})}}class le extends se{constructor(t){super(t),this.add(this._donut=new ne(t))}setDonut(t,e,i,s){this._donut.setPath((new qt).donut(t,e,i,s).end())}}class he{constructor(){this.dragging=!1}start(t,e,i,s,r){return this.cancel(),!!this._doStart(t,e,i,s,r)&&(this.dragging=!0,this._showFeedback(s,r),!0)}drag(t,e,i,s,r){return!(!this.dragging||!this._doDrag(t,e,i,s,r))&&(this._moveFeedback(s,r),!0)}cancel(){if(this.dragging)try{this.dragging=!1,this._hideFeedback()}finally{this._doCanceled()}}drop(t,e,i){if(this.dragging)try{this.dragging=!1,this._canAccept(t,e,i)?this._doCompleted(t,e,i):this._doCanceled()}finally{this.end(e,i)}}end(t,e){try{this.dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_canAccept(t,e,i){return!0}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,i,s,r){return!0}_doCanceled(){}_doCompleted(t,e,i){}_doEnded(t,e){}}var _e,ce,de;t.TextAnchor=void 0,(_e=t.TextAnchor||(t.TextAnchor={})).START="start",_e.MIDDLE="middle",_e.END="end",t.TextLayout=void 0,(ce=t.TextLayout||(t.TextLayout={})).TOP="top",ce.MIDDLE="middle",ce.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(de||(de={}));class ue extends Jt{constructor(e,i=void 0){super(e,i,"text"),this._layout=t.TextLayout.TOP,this._overflow=de.WRAP,this._dirty=!0,this._text="",this.anchor=t.TextAnchor.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(e){const i=this.getBBox(),s=this.getAscent(isNaN(e)?i.height:e);let r;switch(this._layout){case t.TextLayout.MIDDLE:r=Math.floor(s/2);break;case t.TextLayout.BOTTOM:r=0;break;default:r=Math.ceil(s)}this.y=r}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=y(0,t),(e=m(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let i=this._text;if(!i)return;const s=this.dom;let r,n=0,o=i.length;do{r=Math.ceil((n+o)/2);s.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=i.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=i.substring(0,--n)+"…"}setContrast(t,e,i){return this.setStyleOrClass(Rt.isBright(getComputedStyle(t).fill)?e:i),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let i=super.setStyle(t,e);return i&&this.layoutText(),i}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 fe{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const i=this._literals;let s=this.text;if(i&&e.callback)for(let r=0;r<i.length;r+=4){let n=e.callback(t,i[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=i[3]?xt.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(null==n)n=i[r+2]||"";else if(at.isDate(n)){const t=i[3]?Ot.getFormatter(i[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}s=s.replace(i[r],n)}return s}prepareSpan(t,e,i){const s=this.getText(e,i);return t.textContent=s,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let i=t.indexOf("${",e);if(i<0&&(i=t.indexOf("%{",e)),i<0)break;const s=t.indexOf("}",i+2);if(s<0)break;const r=t.substring(i,s+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),T),0===this._literals[2].length&&(this._literals[2]=T)}else this._literals.push(r,n,T,T);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class me extends fe{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,n=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,n),t}_doPrepare(t,e,i,s){t.textContent=e.substring(i,s);const r=e.indexOf("style=");if(r>0&&r<i){const s=e[r+6],n=e.indexOf(s,r+7);n>0&&n<i&&t.setAttribute("style",e.substring(r+7,n))}}}class ye extends me{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,i,s){e.substring(2,i-1).trim().split(/\s+/g).forEach(t=>{const e=t.indexOf("=");if(e>0){const i=t.substring(0,e),s=t.substring(e+1,t.length),r=s.substring(1,s.length-1);switch(i){case"href":this.url=r;break;case"target":this.target=r}}}),super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-link")}}const xe={t:class extends me{tag(){return"</t>"}},b:class extends me{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-bold")}},i:class extends me{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rct-text-italic")}},a:ye};class be{get words(){return this._words.slice()}parse(t){function e(t){const e=i.length;e>0&&""===i[e-1].type?i[e-1].text+=t:i.push((new fe).parse(t))}const i=this._words=[];let s=0;for(;s<t.length;){if("<"==t[s]){const i=t[s+1];let r;if(i in xe){const e=t.indexOf(">",s+2);if(e>=0){const n="</"+i+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(s,o+n.length);r=(new xe[i]).parse(e),s+=e.length}}}if(!r){e(t.substring(s));break}this._words.push(r)}else{const i=t.indexOf("<",s+1);if(!(i>=0)){e(t.substring(s));break}e(t.substring(s,i)),s=i}}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(t,i,s,r,n){if(this._isVertical)return void this.buildVertical(t,i,s,r,n);const o=t.doc,a=b(this.lineHeight,1),l=this._lines,h=l.length,_=[],c=[];t.clearDom(),r=r||t;const d=t.getStyle("writing-mode"),u=this._vertical=d===st||d===rt;for(let i=0;i<h;i++){const s=l[i];let h=0,d=0,p=null;for(let i of s.words){const s=i.prepareSpan(t.appendElement(o,"tspan"),r,n),a=s.getBBox();if(s[ge]=a.width,s[pe]=a.height,u?(h=y(h,s[ge]),d+=s[pe]):(h+=s[ge],d=y(d,s[pe])),p||(p=s),i instanceof ye){const r=o.createElementNS(e,"a");r.setAttribute("href",i.url),r.setAttribute("target",i.target),r.appendChild(s),t.appendDom(r)}}c.push(p),s[pe]=d*a,s[ge]=h*a,_.push(0==i?s[ge]/2:s[ge])}if(h>0){let e=l[0];for(let i=1;i<c.length;i++)if(c[i]){let s=0,r=0;if(u?null!=c[i-1]&&(s=Math.floor(e[ge]-t.getAscent(e[ge]))+t.getAscent(l[i][ge])):r=e[pe]-t.getAscent(e[pe])+t.getAscent(l[i][pe]),null==c[0]&&c[i]==c.find(t=>null!=t)){const r=t.insertElement(o,"tspan",c[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[ge]=n.width,r[pe]=e[pe]=n.height,c[0]=r}switch(d){case st:c[i].setAttribute("dx",String(s)),c[i].setAttribute("y","0");break;case rt:c[i].setAttribute("dx",String(-s)),c[i].setAttribute("y","0");break;default:c[i].setAttribute("x","0"),c[i].setAttribute("dy",String(r))}e=l[i]}if(u){const e=t.parent.dom.classList.contains("rct-annotation"),i=t.getBBox().width,[s]=c,r=s[ge];if(e)s.setAttribute("dx",String(d===rt?i-r/2:r/2));else switch(d){case st:s.setAttribute("x",String((i-r)/-2));break;case rt:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(l[0][pe])}}buildVertical(t,i,s,r,n){const o=t.doc,a=b(this.lineHeight,1),l=this._lines,h=l.length,_=[];let c=0;const d=[];t.clearDom(),r=r||t;for(let i=0;i<h;i++){const s=l[i];let h=0,u=0,p=null,g=!1;for(let i of s.words){const s=i.prepareSpan(t.appendElement(o,"tspan"),r,n);" "===s.textContent&&(g=!0,s.textContent=".");const a=s.getBBox();if(s[ge]=a.width,s[pe]=a.height,g&&(s.textContent=" ",s[pe]*=.6,g=!1),h+=s[ge],u=y(u,s[pe]),p||(p=s),i instanceof ye){const r=o.createElementNS(e,"a");r.setAttribute("href",i.url),r.setAttribute("target",i.target),r.appendChild(s),t.appendDom(r)}}d.push(p),s[pe]=u*a,s[ge]=h*a,c=y(h,c),_.push(0==i?s[ge]/2:s[ge])}if(h>0){let e=l[0];d[0].setAttribute("x",String((c-d[0].getBBox().width)/2));for(let i=1;i<d.length;i++)d[i]&&(d[i].setAttribute("x",String((c-d[i].getBBox().width)/2)),d[i].setAttribute("dy",String(e[pe]-t.getAscent(e[pe])+t.getAscent(l[i][pe]))),e=l[i]);t.layoutText(l[0][pe])}}layout(e,i,s,r,n){const o=e.getBBox();let a=0,l=0;if(this._vertical)switch(a=n.left+(s-n.left-n.right-o.width),i){case"center":e.anchor=t.TextAnchor.MIDDLE,l=n.top+(r-n.top-n.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,l=o.height-n.bottom;break;default:e.anchor=t.TextAnchor.START,l=n.top}else switch(l=n.top+(r-n.top-n.bottom-o.height)/2,i){case"center":e.anchor=t.TextAnchor.MIDDLE,a=n.left+(s-n.left-n.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=s-n.right;break;default:e.anchor=t.TextAnchor.START,a=n.left}e.trans(a,l)}$_parse(t){const e=this._lines=[];if(t){const i=(this._isVertical?t.replace(/\s+/g," ").split("").join("<br>"):t).split(we);for(let t of i)e.push((new be).parse(t))}}}class Se{constructor(t){this.source=t}hasDef(){return!0}}class Ve extends Se{_setStops(t,i){i.setAttribute("id",this.source.id);const s=this.source.color,n=null==this.source.opacity?1:this.source.opacity,o=r(s)?[...s]:[s,"white"],a=r(n)?[...n]:Array(o.length).fill(n);1===o.length&&o.push("white"),o.forEach((s,r)=>{!function(t,i,s,r,n){const o=t.createElementNS(e,"stop");o.setAttribute("offset",String(s)),o.setAttribute("stop-color",r),o.setAttribute("stop-opacity",String(n)),i.appendChild(o)}(t,i,r/(o.length-1),s,null==a[r]?1:a[r])})}prepare(){}}class Ce extends Ve{getEelement(t,i){const s=t.createElementNS(e,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,s),i.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return s.setAttribute("x1",r),s.setAttribute("y1",o),s.setAttribute("x2",n),s.setAttribute("y2",a),s}}Ce.TYPE="lineargradient";class Ae extends Ve{getEelement(t,i){const s=t.createElementNS(e,"radialGradient");return z(i.cx)||s.setAttribute("cx",i.cx),z(i.cy)||s.setAttribute("cy",i.cy),z(i.r)||s.setAttribute("r",i.r),this._setStops(t,s),s}}Ae.TYPE="radialgradient";class Pe extends Se{prepare(){}getEelement(t,i){const r=t.createElementNS(e,"pattern"),n=t.createElementNS(e,"path");let a,l,h,_,d=!1;if(r.setAttribute("id",i.id),r.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rct-pattern"),+i.pattern>=0){const t=Pe.STOCK[+i.pattern%Pe.STOCK.length];a=t.path,l=t.style,d=!t.fill,h=t.width||20,_=t.height||20}else o(i.pattern)&&(a=i.pattern,h=i.width||i.height||20,_=i.height||i.width||20);r.setAttribute("width",String(h)),r.setAttribute("height",String(_)),n.setAttribute("d",a),l&&c(n.style,l),i.style&&c(n.style,i.style),d&&(n.style.fill="none");let u=i.backgroundStyle;if(o(u)||s(u)){const i=t.createElementNS(e,"rect");r.append(i),i.style.fill=o(u)?u:u.fill,i.setAttribute("width",String(h)),i.setAttribute("height",String(_))}return r.append(n),r}}Pe.TYPE="pattern",Pe.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=r(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=r(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(o(e))this._images.push(t+e);else{const i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}})}getImage(t){return o(t)?this._map[t]:this._images[t]}hasDef(){return!1}getEelement(t,e){this.size=Object.freeze({width:e.width||e.height||Le.SIZE,height:e.height||e.width||Le.SIZE})}}Le.TYPE="images",Le.SIZE=20;class Te{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],r(t))return t.forEach(t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)}),this._items.map(t=>t.source);if(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(i=>{const s=i.getEelement(t,i.source);s.setAttribute(Jt.ASSET_KEY,"1"),e.addDef(s)})}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=Pe.TYPE:r(t.colors)?e=ke.TYPE:r(t.images)&&(e=Le.TYPE)),e)switch(e.toLowerCase()){case Ce.TYPE:return new Ce(t);case Ae.TYPE:return new Ae(t);case Pe.TYPE:return new Pe(t);case ke.TYPE:return new ke(t);case Le.TYPE:return new Le(t)}}}}let Ne=0;const Me=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},Ee=["__proto__","constructor","prototype"],Be=function(t,e){const n=s(t)?t:{};for(const t in e)if(i.call(e,t)&&!Ee.includes(t)){const i=e[t];r(i)?n[t]=i.slice(0):s(i)?i._obj instanceof dt?n[t]=i:at.isDate(i)?n[t]=new Date(i):n[t]=Be(n[t],i):n[t]=i}return n};class De extends ht{constructor(t){super(),this.chart=t,Ne++}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 i=this[e];i instanceof De&&(this._children.push(e),t.hasOwnProperty(e)&&i.updateOptions(t[e]))}}}$_mergeOptions(t,e){const i=s(t)?t:{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];r(n)?i[t]=n.slice(0):s(n)?n instanceof dt?i[t]=n:n._obj instanceof dt?i[t]=n._obj:this[t]instanceof De?at.isDate(n)&&(i[t]=new Date(n)):i[t]=this.$_mergeOptions(i[t],n):i[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,i=!0,s=!1){if(this[t]instanceof De)this[t].updateOptions(e);else{const r=this._op;(s||e!==r[t])&&(r[t]=e,this.$_applyOptions(r),i&&this._changed())}return this}toggleOption(t,e=!0){const i=this._op,s=i[t];return i.hasOwnProperty(t)&&(this[t]instanceof De?this[t]._doSetSimple(!h(s)||!s):(i[t]=!h(s)||!s,this.$_applyOptions(i),e&&this._changed())),this}removeOption(t,e=!0){const s=this._op;if(s.hasOwnProperty(t))if(this[t]instanceof De)this[t].clearOptions();else{delete s[t];const r=self.constructor.defaults;i.call(r,t)&&(s[t]=r[t]),this.$_applyOptions(s),e&&this._changed()}return this}clearOptions(t=!0){const e=function(t){var i;if(t){const s=t._op=Be({},t.constructor.defaults);return t.$_applyOptions(s),null===(i=t._children)||void 0===i||i.forEach(i=>{s[i]=e(t[i])}),s}};return e(this),t&&this._changed(),this}setStyle(t,e,s=!0){if(!t)return this;let r=this._op.style,n=!1;return null!==e&&""!==e||(e=void 0),void 0===e?r&&i.call(r,t)&&(delete r[t],n=!0):r&&r[t]==e||(r||(r=this._style=this._op.style={}),r[t]=String(e),n=!0),n&&(this.$_applyOptions(this._op),s&&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 i=t[e];n[e]!=i&&(null!==i&&""!==i||(i=void 0),void 0===i?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 i in e)if(e.hasOwnProperty(i)){let n=e[i];this._doLoadProp(i,n)||(this[i]instanceof De?t[i]=this[i]._load(n):r(n)?t[i]=n.slice(0):s(n)?n._obj instanceof dt?t[i]=n._obj:at.isDate(n)?t[i]=new Date(n):t[i]=c({},n):t[i]=n)}}_doSave(t,e,i){const s=this._op;for(const n in s)if(s.hasOwnProperty(n))if(i&&this[n]instanceof De)t[n]=this[n].saveOptions(!0);else{const i=s[n];r(i)?t[n]=this._doSaveArray(n,i)||i.slice():i!==e[n]&&(t[n]=i)}}_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 i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`;t[e]!==this[i]&&(this[`${i}Dim`]=W(this[i]=t[e],!0))}_setDims(t,...e){e.forEach(e=>this._setDim(t,e))}_doApply(t){this._style=t.style}_doPrepareRender(t){}}De.REFRESHED="refreshed",De.defaults={visible:!0};class Oe{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 De{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=b(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,i,s,r,n){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,n),e&&this._richTextImpl.build(e,i,s,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new ve),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}_getNumberText(t,e,i){if(at.isValidNum(t)){const s=this._numberFormatter,r=e&&this._numSymbols;let n;return r&&(s&&(t=s.toNum(t)),n=at.scaleNumber(t,r,i)),s?n?s.toStr(n.value)+n.symbol:s.toStr(t):n?n.value+n.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=o(t)?t:this._getNumberText(e,i,s)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}Re.defaults=Me(De.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class $e extends Re{getIconPos(){const t="default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition;switch(t){case"left":case"right":case"top":case"bottom":return t;default:return this.getDefaultIconPos()}}_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||""}getIconUrl(t){const e=this._op.icon||t;return o(e)?this.getUrl(e):null}getUrl(t){if(t){o(t)||(t=String(t));const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2),r=Number.isFinite(+s)?+s:s;return i instanceof Le?i.getImage(r):s}{const e=t.substring(0,t.indexOf("://"));return"http"==e||"https"==e?t:this._root+t}}}}$e.defaults=Me(Re.defaults,{iconPosition:"default",iconGap:2,iconHeight:16});class Ie extends De{}const Fe={};class ze extends De{static register(...t){t.forEach(t=>{Fe[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 i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const i=this.chart.isInverted(),s=this._op;let r,n;if(this.body){const o=+s.x1,a=+s.x2,l=+s.y1,h=+s.y2;if(this._x=this._y=this._w=this._h=NaN,!isNaN(o)){const s=this.chart.getAxisOf(this,!0);i?this._y=e-s.getPos(e,o):this._x=s.getPos(t,o),isNaN(a)||(i?n=this._h=e-s.getPos(e,a)-this._y:r=this._w=s.getPos(t,a)-this._x)}if(!isNaN(l)){const s=this.chart.getAxisOf(this,!1);i?this._x=s.getPos(t,l):this._y=e-s.getPos(e,l),isNaN(h)||(i?r=this._w=s.getPos(t,h)-this._x:n=this._h=e-s.getPos(e,h)-this._y)}}return isNaN(r)?r=X(this._widthDim,t):r<0&&(this._x+=r,r=-r),isNaN(n)?n=X(this._heightDim,e):n<0&&(this._y+=n,n=-n),{width:r,height:n}}getPosition(t,e,i,s,r,n,o){let a,l,h;if(isNaN(l=this._x))switch(a=this.getOffset(n,o),l=e,this._op.align){case"center":l+=(s-n)/2+a.x;break;case"right":l+=s-a.x-n;break;default:this._anchorObj?l+=(s-n)/2+a.x:l+=a.x}else a=a||this.getOffset(n,o),l=this._x+a.x;if(isNaN(h=this._y))switch(a=a||this.getOffset(n,o),h=i,this._op.verticalAlign){case"middle":h+=(r-o)/2-a.y;break;case"bottom":h+=r-a.y-o;break;default:h+=a.y}else a=a||this.getOffset(n,o),h=this._y+a.y;return{x:l,y:h}}refresh(){this._changed(De.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,i=function(t){if(o(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;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,(s=t.offsetX)!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}ze.defaults=Me(De.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class He extends Oe{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(i=>{const s=i.options.row,r=i.options.col;return t===s&&e===r})}getAnnotation(t){const e=this._map[t];if(e instanceof ze)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t,e){const i=this.owner.chart,n=this._items=[],o=this._map={};r(t)?t.forEach((t,s)=>{n.push(this.$_loadItem(i,t,s,e?this.owner:void 0))}):s(t)&&n.push(this.$_loadItem(i,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):T})}$_loadItem(t,e,i,s){let r=e.type;r||(r=o(e.imageUrl)?"image":o(e.shape)?"shape":"text");const n=t._getAnnotationType(r);if(!n)throw new Error("Invalid annotation type: "+e.type);const a=new n(t,s);return a.init(),a.index=i,a._load(e),a}}class Ge extends Yt{constructor(t,e,i,s){super(),this.duration=300,this.easing="linear",this._axis=t,this._prevMin=e,this._prevMax=i,this.start(s)}getPos(t,e){const i=this._axis,s=this._axisLen,r=this._prevMax-this._prevMin,n=this.rate();let o,a=i._vlen;if(s<=0)return t;if(s>=r)o=s<=0?a:a+a*(s-r)/s*(1-n),t=t*o/a;else{o=a+a*(r-s)/r*(1-n),t=t*a/o}return t+this._offset*(o/s)*(1-n)*(e?-1:1)}_doUpdate(t,e){return this.$_calcRange(t),this._axis._changed(),!0}_stop(t){t||this._doUpdate(1,0),super._stop(t)}_doStop(){this._axis.setAniRange(NaN,NaN),this._axis._ani=null,this._axis=null}$_calcRange(t){const e=this._prevMin;this._prevMax;const i=this._axis.axisMin(),s=this._axis.axisMax();this._axisLen=s-i,this._offset=i-e}}class je extends De{}je.defaults=Me(De.defaults,{minWidth:50});class We extends De{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 i=this.axis.axisValueAt(t,e);if(i instanceof this.chart.win.Date)try{return Ot.getFormatter(this._op.timeFormat).toStr(new Date(i),this.chart.startOfWeek)}catch{return Ot.getFormatter(We.defaults.timeFormat).toStr(new Date(i),this.chart.startOfWeek)}else try{return xt.getFormatter(this._op.numberFormat).toStr(i)}catch{return xt.getFormatter(We.defaults.numberFormat).toStr(i)}}moved(t,e,i){this._op.onChange&&(this._args.chart=this.chart.wrapper,this._args.pos=t,this._args.flag=e,this._args.points=i.slice(0),this._op.onChange(this._args))}_setAxis(t){this._args.axis=t}_doSetSimple(t){return n(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}We.defaults=Me(De.defaults,{visible:!1,type:"auto",showAlways:!0,followPointer:!0,numberFormat:"#,##0.#",timeFormat:"yyyy-MM-dd HH:mm"});const Ye={};class Xe extends De{constructor(t){super(null==t?void 0:t.chart),this.axis=t}}class Ue extends Xe{_isVisible(){return null==this._op.visible?this.axis._isX:this._op.visible}_doSetSimple(t){return o(t)?(this._op.visible=!0,this._op.style={stroke:t},!0):super._doSetSimple(t)}}Ue.defaults=Me(Xe.defaults,{visible:void 0});class Ze extends Xe{getGap(){return this._gap}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 o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;super._doApply(t),function(t){let i=+t;Number.isNaN(i)||90===i||270===i||-90===i||-270===i||(i=0),e._rotation=i}(t.rotation),this._gap=b(t.gap,Ze.defaults.gap)}}Ze.defaults=Me(Xe.defaults,{align:"middle",offset:0,gap:5});class qe extends Xe{_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}qe.defaults=Me(Xe.defaults,{position:"end",gap:2});class Ke extends Xe{getRows(){if(!1===this._op.visible)return[];const t=this.axis,e=this._op.colors,i=e?e.length:0,s=[],r=this._style;if(this._op.belowColor&&t.isBaseVisible()&&s.push({axis:t,from:t.valueMin(),to:t.getBaseValue(),color:this._op.belowColor,style:r}),i>0){const n=t._ticks;let o=0;n[0].value>t.valueMin()&&(e[o%i]&&s.push({axis:t,from:t.valueMin(),to:n[0].value,color:e[o%i],style:r}),o++);for(let a=1;a<n.length;a++,o++)e[o%i]&&s.push({axis:t,from:n[a-1].value,to:n[a].value,color:e[o%i],style:r});n[n.length-1].value<t.valueMax()&&e[o%i]&&s.push({axis:t,from:n[n.length-1].value,to:t.valueMax(),color:e[o%i],style:r})}return s}_doSetSimple(t){return o(t)?(this._op.colors=[t,null],!0):r(t)?(this._op.colors=t,!0):super._doSetSimple(t)}}class Qe extends Xe{_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=Me(Xe.defaults,{visible:void 0,depthVisible:void 0});class Je extends $e{getText(){const t=this._op.text;return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}}Je.defaults=Me($e.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class ti extends Xe{_doInit(t){t.label=(this._label=new Je(this.axis.chart)).init()}get label(){return this._label}_doPrepareRender(t){super._doPrepareRender(t),this._label._prepareRender()}canConstainedTo(t,e){const i=this._op;if(r(i.col)){for(const t of i.col)if(e==t)return!0;return!1}if(!isNaN(i.col)&&e!=i.col)return!1;if(r(i.row)){for(const e of i.row)if(t==e)return!0;return!1}return!(!isNaN(i.row)&&t!=i.row)}}ti.defaults=Me(Xe.defaults,{front:!1,zindex:0});class ei extends ti{}class ii extends ti{}class si extends Xe{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),this._inside="inside"===this._op.location,this._length=isFinite(this._op.length)?+this._op.length:si.DEF_LENGTH,this._gap=b(this._op.gap,si.defaults.gap)}}si.DEF_LENGTH=7,si.defaults=Me(Xe.defaults,{visible:!1,gap:3});class ri extends Xe{_getLength(){return this._length}_getCount(){return this._count}_doSetSimple(t){return at.canNumber(t)?(this._op.length=+t,!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._length=b(this._op.length,ri.defaults.length),this._count=y(1,d(b(this._op.count,ri.defaults.count)))}}ri.defaults=Me(Xe.defaults,{visible:!1,count:4,length:4});class ni extends Xe{}ni.defaults=Me(Xe.defaults,{visible:!1});class oi 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 i;const s=this._op,r=t.index;if(s.textCallback){const e=s.textCallback(this.axis.getTickLabelArgs(r,t.value));if(null!=e)return e}return 1==e?v(null!==(i=s.lastText)&&void 0!==i?i:s.firstText,s.text):0==r?v(s.firstText,s.text):r==e-1?v(s.lastText,s.text):this.options.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}}oi.defaults=Me($e.defaults,{step:0,startStep:0,rows:0,maxRows:3,autoArrange:"rotate",overflow:"clip",firstOverflow:"pull",lastOverflow:"pull",overflowGap:12});class ai extends Xe{getThickness(){return Math.max(0,b(this._op.thickness,ai.defaults.thickness))}getMinThumbSize(){return Math.max(0,b(this._op.minThumbSize,ai.defaults.minThumbSize))}getGap(){return Math.max(0,b(this._op.gap,ai.defaults.gap))}getGapFar(){return Math.max(0,b(this._op.gapFar,ai.defaults.gapFar))}}ai.defaults=Me(Xe.defaults,{visible:!1,thickness:10,minThumbSize:32,gap:3,gapFar:3});class li{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,i){if(t>e){const i=t;t=e,e=i}const s=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(s&&e>=t&&(isNaN(i)||o/r>=i)&&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 hi extends Ue{}class _i extends De{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._minorValues=[],this._minorMarkPoints=[],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 hi(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 We(this)).init(),t.scrollBar=(this._scrollBar=new ai(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 i=e.needAxes()?[]:null;e.collectValues(this,i),i&&(e._yMin=m(...i),e._yMax=y(...i),t.push(...i))})}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(),this.guides.forEach(t=>t._prepareRender());const i=this._series;if(this._values=this._checkValues(this._values),this._zoom||(this._range=this._doCalculateRange(this._values)),this._isX&&i.length>0)if(t.isSplitted()){const t=[i[0].row];for(let e=1;e<i.length;e++)t.indexOf(i[e].row)<0&&t.push(i[e].row);t.forEach(t=>{let e=0,s=0;i.forEach(i=>{i.row==t&&i.isClusterable()&&(e+=b(i.groupWidth(),1))}),i.forEach(i=>{if(i.row==t&&i.isClusterable()){const t=b(i.groupWidth(),1)/e;i.setCluster(t,s),s+=t}})})}else{let t=0,e=0;i.forEach(e=>{e.isClusterable()&&(t+=b(e.groupWidth(),1))}),i.forEach(i=>{if(i.isClusterable()){const s=b(i.groupWidth(),1)/t;i.setCluster(s,e),e+=s}})}}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[y(t,this._min),m(e,this._max)]}resetZoom(){this._zoom&&(this._zoom=null,this._zooming=!0,this._changed())}_prepareZoom(){return this._zoom||(this._zoom=new li(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max),this._zoom}zoom(t,e,i=NaN){const s=this._prepareZoom(),r=s.resize(t,e,i);return r&&(s.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 i;null===(i=this._ani)||void 0===i||i.cancel(),this._min===t&&this._max===e||(this._ani=new Ge(this,t,e,()=>{this._changed()}))}isAnimating(){return null!=this._ani}_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 e=this,s=this.guides,n=function(t){var i;t!==e._guides&&(e._guides=t,i=r(t)?t:[t],s.length=0,i.forEach(t=>{let i;i="range"===t.type?new ii(e):"line"===t.type||isNaN(t.startValue)||isNaN(t.endValue)?new ei(e):new ii(e),i.init(),i._load(t),s.push(i)}))};super._doApply(t),t.startAngle=b(this._op.startAngle,0),t.totalAngle=y(0,m(360,b(this._op.totalAngle,360))),this._name=t.name||`-axis-${this._index+1}`,this._row=b(Math.max(0,t.row|0),0),this._col=b(Math.max(0,t.col|0),0),i.call(t,"guide")?n(t.guide):i.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(m(...t)||0):NaN,max:t.length>0?R(y(...t)||0):NaN}}}_i.defaults=Me(De.defaults,{visible:void 0,row:0,col:0,startAngle:0,totalAngle:360,position:"normal",reversed:!1,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"],animatable:!0,fixedSize:!1});class ci extends Oe{constructor(t,e){super(t),this._map=new Map,this.isX=e}_clear(){}load(t){const e=this.chart;r(t)?t.forEach((t,i)=>this._items.push(this.$_loadAxis(e,t,i))):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 o(t)?this._map.get(t):this._items[t]}disconnect(){this._items.forEach(t=>t.disconnect())}prepare(){this._items.forEach(t=>t._prepare())}collectValues(){this._items.forEach(t=>t.collectValues())}collectRanges(){this._items.forEach(t=>t.collectRanges())}collectReferentValues(){this._items.forEach(t=>{t.collectReferentValues()})}prepareRender(){this._items.forEach(t=>t._prepareRender())}afterRender(){this._items.forEach(t=>t.afterRender())}_buildTicks(t,e){this._items.sort((t,e)=>t.isBased()?1:e.isBased()?-1:0).forEach(i=>{(e<=2||i._isHorz)&&i._buildTicks(t,e)})}connect(t){const e=this.isX,i=this._items,s=t.options,r=e?s.xAxis:s.yAxis;let n;if(l(r)&&r>=0&&r<i.length?n=i.find(t=>t._index===r):o(r)&&(n=i.find(t=>t.options.name===r)),n||(n=i[0]),n&&this.chart.isValidAxis(n))return n._connect(t),this.isX?t.setCol(n.col):t.setRow(n.row),n}forEach(t){for(let e=0,i=this._items.length;e<i&&!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,i){var s;let n=t._getAxisType(e.type);if(!n){let o;if(r(e.categories))o="category";else if(this.isX){const s=t._getSeries()._internalItems();if(s.length>0){o="category";for(const t of s)if(!t.canCategorized()){if(e.name&&t.options.xAxis===e.name){o=void 0;break}if(t.options.xAxis===i){o=void 0;break}if(z(t.options.xAxis)&&0===i){o=void 0;break}}}}else o=null===(s=t._getSeries().first)||void 0===s?void 0:s.defYAxisType();o&&(n=t._getAxisType(o))}n||(n=t._getAxisType("linear"));const o=new n(t,this.isX);return o._index=i,o.init(),o._load(e),o}}class di extends De{_doPrepareRender(t){}}const ui={},pi={};class gi extends di{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:X(this._widthDim||this._sizeDim,t,t),height:X(this._heightDim||this._sizeDim,e,e)}}getLeft(t){return X(this._leftDim,t)}getRight(t){return X(this._rightDim,t)}getTop(t){return X(this._topDim,t)}getBottom(t){return X(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=b(t.row|0,0),this._col=b(t.col|0,0),this._setDims(t,"left","right","top","bottom","width","height","siz")}}gi.defaults=Me(di.defaults,{size:"100%"});class fi extends gi{constructor(){super(...arguments),this._gindex=-1}static register(...t){t.forEach(t=>{ui[t.type]=t})}static _loadGauge(t,e,i){let s=t._getGaugeType(e.type);s||(s=t._getGaugeType(i||t.gaugeType));const r=new s(t);return r.init(),r._load(e),r}setGroup(t,e){this._group=t,this._gindex=e}}fi.defaults=Me(gi.defaults,{duration:500});class mi extends gi{constructor(){super(...arguments),this._gauges=[],this._visibles=[]}static register(...t){t.forEach(t=>{pi[t.type]=t,pi[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),i.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 i=this._gaugesType();r(e)?e.forEach((e,s)=>this.$_add(fi._loadGauge(t,e,i))):s(e)&&this.$_add(fi._loadGauge(t,e,i))}$_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)}}mi.defaults=Me(gi.defaults,{minValue:0});class yi extends Oe{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(i=>{const s=i.row||0,r=i.col||0;return t===s&&e===r})}getGauge(t){const e=this._map[t];if(e instanceof fi)return e}get(t){return o(t)?this._map[t]:this._items[t]}load(t){const e=this.chart,i=this._items=[],n=this._map={};r(t)?t.forEach((t,s)=>{i.push(this.$_loadItem(e,t,s))}):s(t)&&i.push(this.$_loadItem(e,t,0)),i.forEach(t=>{if(t.name&&(n[t.name]=t),t instanceof mi)for(let e=0;e<t.count();e++){const i=t.get(e);i.name&&(n[i.name]=i),this._gauges.push(i)}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,i){if(0===Object.keys(ui).length&&0===Object.keys(pi).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 s=r(e.children)&&t._getGaugeGroupType(e.type||t.gaugeType);if(s||(s=t._getGaugeType(e.type||t.gaugeType)),!s)throw new Error("Invalid gauge type: "+e.type);const n=new s(t);return n.init(),n._load(e),n.index=i,n}}class xi extends fi{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 y(this._op.minValue,m(this._op.maxValue,b(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?b(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}}}xi.defaults=Me(fi.defaults,{minValue:0,maxValue:100,value:0,animatable:!0});class bi extends De{constructor(t){super(t.chart),this.scale=t}}bi.defaults=Me(De.defaults,{reversed:!1,length:7});class wi extends $e{getText(t){return at.isValidNum(t)?this._getText(null,t,x(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}class vi extends De{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.line=(this._line=new De(e)).init(),t.tick=(this._tick=new bi(this)).init(),t.label=(this._label=new wi(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,i=NaN){i=b(i,e);const{min:s,max:r}=this._adjustMinMax(m(e,i),y(e,i));return this._steps=this._buildSteps(t,s,r)}buildGroupSteps(t,e){const{min:i,max:s}=this._adjustGroupMinMax(e);return this._steps=this._buildSteps(t,i,s)}getRate(t){return(y(this._min,t)-this._min)/(this._max-this._min)}_adjustMinMax(t,e){const i=this.gauge;return t=b(i.options.minValue,t),e=b(i.options.maxValue,e),this._min=m(t,e),this._max=y(e,t),{min:this._min,max:this._max}}_adjustGroupMinMax(t){const e=this.gauge;let i=e.options.minValue,s=e.options.maxValue;return isNaN(i)&&(i=m(...t)),isNaN(s)&&(s=y(...t)),this._min=m(i,s),this._max=y(s,i),{min:this._min,max:this._max}}_buildSteps(t,e,i){const s=this._op;let r;return r=Array.isArray(s.steps)?s.steps.slice(0):s.stepCount>0?this._getStepsByCount(s.stepCount,e,i):s.stepInterval>0?this._getStepsByInterval(s.stepInterval,e,i):s.stepPixels>0?this._getStepsByPixels(t,s.stepPixels,e,i):[e,i],this._min=r[0],this._max=r[r.length-1],r}_getStepsByCount(t,e,i){let s=(i-e)/(t-1);const r=Math.pow(10,Math.floor(Math.log10(s))),n=[];s=this._step=Math.ceil(s/r)*r,n.push(R(e));for(let e=1;e<t;e++)n.push(R(n[e-1]+s));return n}_getStepsByInterval(t,e,i){const s=[];let r;for(s.push(r=e);r<i;)s.push(r+=t);return this._step=t,s}_getStepMultiples(t){return[1,2,2.5,5,10]}_getStepsByPixels(t,e,i,s){const r=[],n=s-i;if(0===n)return r;let o=n/(Math.floor(t/e)+1-1);const a=Math.pow(10,Math.floor(Math.log10(o))),l=this._getStepMultiples(a);let h,_=0;if(o/=a,l)if(o>l[_]){for(;_<l.length-1;_++)if(o>l[_]&&o<l[_+1]){o=l[++_];break}}else o=l[_];for(o*=a,this._step=o,r.push(R(h=i));;){if(h+=o,h>=s){r.push(R(s));break}r.push(R(h))}return r}}vi.defaults=Me(De.defaults,{position:"default",stepPixels:48,gap:8});class Si extends De{}Si.defaults=Me(De.defaults,{visible:!1});class Vi extends De{constructor(t){super(t.chart),this.gauge=t}_doInit(t){const e=this.chart;t.rangeLabel=(this._rangeLabel=new Si(e)).init(),t.tickLabel=(this._tickLabel=new De(e)).init()}get rangeLabel(){return this._rangeLabel}get tickLabel(){return this._tickLabel}getThickness(t){return this._thicknessDim?X(this._thicknessDim,t,0):"inside"===this._op.position?t:Vi.defaults.thickness}getRanges(){return this.$_internalRanges().slice(0)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.ranges)!==e._ranges&&(e._ranges=i,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}}Vi.defaults=Me(De.defaults,{visible:!1,position:"default",thickness:7,gap:5,itemGap:0});class Ci extends Re{constructor(){super(...arguments),this._domain={callback:(t,e)=>t.getParam(e)}}_doPrepareRender(t){this._domain.numberFormatter=this._numberFormatter}}Ci.defaults=Me(Re.defaults,{animatable:!0});class Ai extends Ci{constructor(){super(...arguments),this._offsetX=0,this._offsetY=0}getOffset(t,e){return{x:X(this._offsetXDim,t,0),y:X(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Ai.defaults=Me(Ci.defaults,{offsetX:0,offsetY:0});class Pi{constructor(t=!1){t?(this.setCenterX("50%"),this.setCenterY("50%"),this.setValueRadius("100%")):(this.setCenterX(ki.DEF_CENTER),this.setCenterY(ki.DEF_CENTER),this.setRadius(ki.DEF_RADIUS),this.setInnerRadius(ki.DEF_INNER))}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=W(v(t,ki.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=W(v(t,ki.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=W(v(t,ki.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=W(v(t,ki.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=W(t,!0))}getCenter(t,e){return{x:X(this._centerXDim,t,t/2),y:X(this._centerYDim,e,e/2)}}getExtents(t){const e=X(this._radiusDim,t,t/2),i=m(e,this._innerDim?X(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?X(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=b(t%360,0),s=y(0,m(360,b(e,360)));this._startRad=E+B*i,this._handRad=B*i,this._sweepRad=B*s}}class ki extends xi{_doInit(t){super._doInit(t),this._props=new Pi}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 Ai(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 Pi)}_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)}}ki.DEF_CENTER="50%",ki.DEF_RADIUS="40%",ki.DEF_INNER="80%",ki.defaults=Me(xi.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Li extends mi{_doInit(t){this.props=new Pi,t.label=(this._label=new Ai(this.chart)).init()}get label(){return this._label}setChildExtents(t){const e=this._visibles.length;if(e>0){const i=+this._op.itemGap||0;let s=t.radius;const r=(s-t.inner-i*(e-1))/e;this._visibles.forEach((t,e)=>{const n=t._childProps;n.setRadius(s),n.setInnerRadius(s-r),s-=r+i})}}_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)}}Li.defaults=Me(mi.defaults,{startAngle:0,sweepAngle:360,clockwise:!0,itemGap:4,labelGap:10});let Ti=class extends De{constructor(t){super(t.chart),this.body=t}_isVisible(){return!1!==this._op.visible&&this.body.isZoomed()&&this.body.canZoom()}};Ti.defaults=Me(De.defaults,{visible:void 0});class Ni extends Re{_doPrepareRender(t){this.setText(this._getMessage())}_getMessage(){return this._op.text||this.chart._body.emptyView._op.text||Ni.DEF_TEXT}}function Mi(t,e){return e._vlen>0?e._vlen:y(0,b(t.rd,0)-b(t.rdInner,0))}function Ei(t,e,i){const s=b(t.rdInner,0),r=Mi(t,e);return r<=0?s:s+e.getPos(r,i)}function Bi(t,e,i,s){const r=b(t.rdInner,0),n=Mi(t,e);return n<=0?r:r+e.getPos(n,i)*s}Ni.DEF_TEXT="표시할 데이터가 없습니다.",Ni.defaults=Me(De.defaults,{visible:void 0});class Di extends $e{getDefaultIconPos(){return"left"}}class Oi extends De{}Oi.defaults=Me(De.defaults,{visible:!1});class Ri extends De{_doInit(t){t.line=(this._line=new Oi(this.chart)).init(),t.endLine=(this._endLine=new Oi(this.chart)).init(),t.gridLine=(this._gridLine=new Oi(this.chart)).init()}get line(){return this._line}get endLine(){return this._endLine}get gridLine(){return this._gridLine}}Ri.defaults=Me(De.defaults,{});class $i extends De{_doInit(t){t.xSide=(this._xSide=new Ri(this.chart)).init(),t.ySide=(this._ySide=new Ri(this.chart)).init(),t.orgLine=(this._orgLine=new Oi(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 l(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.angle=m(60,y(30,b(t.angle,45)))}}$i.defaults=Me(De.defaults,{visible:!1,length:32,angle:32});class Ii extends De{constructor(t){super(t),this._annotations=new He(this)}_doInit(t){t.depth=(this._depth=new $i(this.chart)).init(),t.image=(this._image=new Ie(null)).init(),t.emptyView=(this._emptyView=new Ni(this.chart)).init(),t.innerText=(this._innerText=new Di(this.chart)).init(),t.zoomButton=(this._zoomButton=new Ti(this)).init()}anchorByName(t){var e;const i=null===(e=this.chart._getGauges())||void 0===e?void 0:e.get(t);return i instanceof gi&&this.contains(i)?i:this._annotations.get(t)}get depth(){return this._depth}get image(){return this._image}get emptyView(){return this._emptyView}get innerText(){return this._innerText}hasInner(){return!!(this._innerRadiusDim&&this._innerRadiusDim.size>0)}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 i=this._depth.options,s=i.length,r=i.angle,n=u(p(r*B)*s),o=u(g(r*B)*s);return{depth:s,angle:r,base:n,side:o,wBody:t-n,hBody:e-o}}}getRadius(t,e){return X(this._radiusDim,m(t,e))}getInnerRadius(t){const e=this._innerRadiusDim;return e&&e.size>0?e.size/(e.fixed?t:100):0}getInnerRadiusPx(t){const e=this.getInnerRadius(t);return e>0?m(e*t,t):0}setPolar(t,e){return this._cx=X(this._centerXDim,t),this._cy=X(this._centerYDim,e),this._rd=X(this._radiusDim,m(t,e)),this._rdInner=this.getInnerRadiusPx(this._rd),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,rdInner:this._rdInner,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 e=this,s=function(t){t!==e._anns&&(e._anns=t,e._annotations.load(t,!0))};super._doApply(t),this._setDims(t,"radius","innerRadius","centerX","centerY"),i.call(t,"annotation")?s(t.annotation):i.call(t,"annotations")&&s(t.annotations)}_doPrepareRender(t){this._annotations.prepareRender(),this._innerText._prepareRender()}}Ii.defaults=Me(De.defaults,{circular:!0,zoomType:"none",radius:"45%",innerRadius:0,centerX:"50%",centerY:"50%"});class Fi extends De{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,i){this._module&&this._module.exportToImage(t,e,i)}}Fi.defaults=Me(De.defaults,{useLibrary:!1,menus:["png","jpeg","svg"],fileName:"realchart",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class zi extends De{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}class Hi extends di{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 X(this._maxWidthDim,t,t)}getMaxHeight(t){return X(this._maxHeightDim,t,t)}getMarkerSize(){return b(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=v(e.location,"bottom"),this._items=this._getLegendSources().map(t=>new zi(this,t)),e.reversed&&(this._items=this._items.reverse());const i=this._itemMap={},s=this._visItems=[];this._items.forEach(t=>{const e=t.source.legendKey();if(at.isNotEmpty(e)&&""!==e){const r=i[e];r?r.push(t):(i[e]=[t],s.push(t))}else s.push(t)})}_getLegendSources(){return this.chart._getSeries().getLegendSources()}}var Gi;Hi.defaults=Me(di.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 ji=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Wi=.001;class Yi{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,i,s){return["M",t,e,"L",i,s]}static arrowParts(t,e,i,s,r){const n=i-t,o=s-e,a=Math.sqrt(n*n+o*o);if(a<.001)return{body:this.line(t,e,i,s),head:[]};const l=null!=r?y(1,m(r,.9*a)):m(.15*a,12),h=Math.atan2(o,n),_=N/6,c=i+l*p(h+Math.PI-_),d=s+l*g(h+Math.PI-_),u=i+l*p(h+Math.PI+_),f=s+l*g(h+Math.PI+_);return{body:["M",t,e,"L",(c+u)/2,(d+f)/2],head:["M",c,d,"L",i,s,"L",u,f,"Z"]}}static polygon(...t){let e=0;const i=["M",t[e],t[e+1]];for(;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i.push("Z"),i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){const o=s>0,a=o?0:1;return r>0?n>0?(r=m(x(s)/2,i/2,r),n=m(x(s)/2,i/2,n),["M",t,e+(o?n:-n),"v",s+(o?-n-r:n+r),"a",r,r,0,0,a,r,o?r:-r,"h",i-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-s+(o?r+n:-r-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-i,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):(r=m(x(s)/2,i/2,r),["M",t,e,"v",s+(o?-r:r),"a",r,r,0,0,a,r,o?r:-r,"h",i-2*r,"a",r,r,0,0,a,r,o?-r:r,"v",-s-r,"Z"]):n>0?(n=m(x(s)/2,i/2,n),["M",t,e+(o?n:-n),"v",s+(o?-n:+n),"h",i,"v",-s+(o?n:-n),"a",n,n,0,0,a,-n,o?-n:n,"h",2*n-i,"a",n,n,0,0,a,-n,o?n:-n,"Z"]):["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=m(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static isCircled(t){return M-t<Wi}static arc(t,e,i,s,r,n,o,a=!1){const l=m(M,x(n-r)),h=this.isCircled(l),_=l>N?1:0,c=o?1:0,d=p(r),u=g(r),f=p(n-=h?c?Wi:-.001:0),y=g(n),b=[];return b.push("M",t+i*d,e+s*u,"A",i,s,0,_,c,t+i*f,e+s*y),h&&b.push("M",t,e),a&&b.push("Z"),b}static sector(t,e,i,s,r,n,o,a){const l=m(M,x(o-n)),h=this.isCircled(l),_=l>N?1:0,c=a?1:0,d=p(n),u=g(n),f=p(o-=h?c?Wi:-.001:0),y=g(o),b=i*r,w=s*r,v=[];return v.push("M",t+i*d,e+s*u,"A",i,s,0,_,c,t+i*f,e+s*y),h?v.push("M",t+b*f,e+w*y):v.push("L",t+b*f,e+w*y),r>0&&v.push("A",b,w,0,_,1-c,t+b*d,e+w*u),v.push("Z"),v}static donut(t,e,i,s){return["M",t-i,e,"a",i,i,0,1,1,2*i,0,"a",i,i,0,1,1,2*-i,0,"Z","M",t-s,e,"a",s,s,0,1,0,2*s,0,"a",s,s,0,1,0,2*-s,0,"Z"]}static arc3d(t,e,i,s,r,n,o,a,l){function h(t,e,n,o){b.push("M",t,e,"A",i,s,0,c,_,n,o),b.push("L",n,o+r),b.push("A",i,s,0,c,1-_,t,e+r),b.push("Z")}const _=a?1:0;let c,d=m(M,x(o-n));const u=this.isCircled(d);let f=(n%M+M)%M,y=(o%M+M)%M;const b=[];let w,v,S,V;if(!u&&(_&&f<=N&&y>=0&&y<f||!_&&y<=N&&f>=0&&f<y))c=0,_?(w=t+i*p(n),v=e+s*g(n),S=t+i*p(N),V=e+s*g(N),h(w,v,S,V),l&&(l.x1=w,l.y1=v),w=t+i*p(0),v=e+s*g(0),S=t+i*p(o),V=e+s*g(o),h(w,v,S,V),l&&(l.x2=S,l.y2=V)):(w=t+i*p(n),v=e+s*g(n),S=t+i*p(0),V=e+s*g(0),h(w,v,S,V),l&&(l.x1=w,l.y1=v),w=t+i*p(N),v=e+s*g(N),S=t+i*p(o),V=e+s*g(o),h(w,v,S,V),l&&(l.x2=S,l.y2=V));else{w=t+i*p(n),v=e+s*g(n),S=t+i*p(o-=u?_?Wi:-.001:0),V=e+s*g(o),_?(f=u||f<=M&&!(y>=f&&y<M)?0:f,y=u||y>N&&!(f<=y&&f>N)?N:y):(f=u||f>N&&!(y<=f&&y>N)?N:f,y=u||y<M&&!(f>=y&&f<M)?0:y);const r=t+i*p(f),a=e+s*g(f),d=t+i*p(y-=u?_?Wi:-.001:0),m=e+s*g(y);c=x(y-f)>N?1:0,h(r,a,d,m),l&&(l.x1=w,l.y1=v,l.x2=S,l.y2=V)}return b}static arc3dInner(t,e,i,s,r,n,o,a,l){const h=m(M,x(o-n)),_=this.isCircled(h),c=a?1:0,d=t+i*p(n),u=e+s*g(n),f=t+i*p(o-=_?c?Wi:-.001:0),y=e+s*g(o),b=h>N?1:0,w=[];return w.push("M",d,u,"A",i,s,0,b,c,f,y),w.push(_?"M":"L",f,y+r),w.push("A",i,s,0,b,1-c,d,u+r),l&&(l.x1=d,l.y1=u,l.x2=f,l.y2=y),w.push("Z"),w}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*g(r+6*Math.PI/5))/2,a=i/2,l=s/2,h=i/4,_=s/4,c=2*Math.PI/5,d=c/2,u=[];u.push("M",n+a*p(r),o+l*g(r));for(let t=0;t<5;t++)u.push("L",n+a*p(r),o+l*g(r),"L",n+h*p(r+d),o+_*g(r+d)),r+=c;return u.push("Z"),u}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Gi[e](0,0,y(2*i,0),y(2*s,0));break;default:r=Gi.circle(i,s,y(m(i,s),0))}t.setPath(r)}}Gi=Yi,Yi._drawers=Object.assign({circle:t=>Gi.circle(0,0,t),none:t=>[]},Gi._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Xi extends Jt{static create(t,e,i,s,r,n,o=0){return new Xi(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=T,i=T){super(t,e,"rect"),this.rect=i}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,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}resizeRect(t,e){const i=this.getStyle("border-radius");return this.resize(t,e),i&&this.dom.setAttribute("rx",i),this}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,r:r},this}setBox(t,e,i,s){this.rect=s<0?{x:t,y:e+s,width:i,height:-s}:{x:t,y:e,width:i,height:s}}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 Ui extends ne{constructor(t,e){super(t,e)}setBox(t,e,i,s){return this.setPath(Yi.box(t,e,i,s)),this}}const Zi="head",qi="far",Ki="inside",Qi="none",Ji="near",ts="displayAll",es="largestFirst",is="hidden",ss="line",rs="area",ns="circlebar";let os=0;const as="_deleted",ls="_drop",hs="_save";class _s{static getSum(t){let e=0;for(const i of t)isNaN(i.y)||(e+=i.y);return e}constructor(t){this.pid=os++,this.visible=!0,this.source=t}ariaHint(){return(this.x||this.xValue)+", "+this.yValue}labelCount(){return 1}getValue(){return this.yValue}isEmpty(){return!1}copy(){return{...this}}assignTo(t){return t||(t={}),this._assignTo(t),t}getProp(t){return null!==this.source&&this.source[t]}parse(t){const e=this.source;null==e?this.isNull=!0:r(e)?0===e.length?this.isNull=!0:this._readArray(t,e):s(e)?(this._readObject(t,e),(r(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,i,s;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 s=null!==(i=this[e[0]])&&void 0!==i?i:r[e[0]];if(null!=s&&"object"==typeof s)for(let t=1;t<e.length;t++)s=s[e[t]];return s}return null!==(s=this[t])&&void 0!==s?s:r[t]}_setDeleted(){this._prev=this.copy(),this[as]=!0}_isDeleted(){return this[as]}_setDrop(t){this[ls]=t}_getDrop(){return this[ls]}_setSave(t){this[hs]=t}_getSave(){return this[hs]}updateValues(t,e){if(this._prev=this.copy(),s(e)?this.source=Object.assign(s(this.source)?this.source:{},e):r(e)?this.source=e.slice(0):this.source=e,this.parse(t),this._valuesChangd(this._prev))return this._prev;this._prev=T}initValues(){}initPrev(t,e){e.yValue=t?t.axisMin():0}applyValueRate(t,e){}_assignTo(t){return c(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 i=t.options,s=+i.colorField,r=+i.iconField;e.length>1?(this.x=e[b(i.xField,0)],this.y=e[b(i.yField,1)]):this.y=e[0],isNaN(s)||(this.color=e[s]),isNaN(r)||(this.icon=e[r])}_readObject(t,e){var i,s,r,n;this.x=(i=t._xFielder(e),s=e.x,r=e.name,n=e.label,void 0!==i?i:void 0!==s?s:null!=r?r:n),this.y=S(t._yFielder(e),e.y,e.value),this.color=v(t._colorFielder(e),e.color),this.icon=v(t._iconFielder(e),e.icon),this.yLabel=e.yLabel,this.labelOptions=e.labelOptions}_readSingle(t){this.y=t}_valuesChangd(t){return this.x!==t.x||this.y!==t.y}}class cs{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){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}add(t){this._points.push(t)}remove(t){const e=this._points.indexOf(t);if(e>=0)return t._setDeleted(),this._points.splice(e,1),!0}removeAll(t){const e=[];return t.forEach(t=>{const i=this._points.indexOf(t);i>=0&&(t._setDeleted(),e.push(t),this._points.splice(i,1))}),e}clean(){this._points=this._points.filter(t=>!t[as])}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,i=this._points.length;e<i&&!0!==t(this._points[e],e);e++);}getRunPoints(t){const e=this._points,i=t._zoom;if(this._owner.needAxes()&&i){const i=t._range;let s=t.axisToData(i.min),r=t.axisToData(i.max);return t.continuous()?e.filter(t=>t.xValue>=s&&r>=t.xValue).slice(0):e.filter(t=>t.xValue>s-.5&&r+.5>t.xValue).slice(0)}return e}}class ds extends _s{getPointLabel(t){return this.zValue}getPointText(t){return this.zLabel}getValue(){return this.zValue}getZValue(){return this.zValue}_assignTo(t){return c(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 i=t.options,s=e.length>2?1:0;s>0&&(this.x=e[b(i.xField,0)]),this.y=e[b(i.yField,0+s)],this.z=e[b(i.zField,1+s)]}}_readObject(t,e){super._readObject(t,e),this.isNull||(this.z=v(t._zFielder(e),e.z),this.zLabel=e.zLabel)}_readSingle(t){super._readSingle(t),this.z=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.zValue))}initValues(){this.zValue=parseFloat(this.z)}initPrev(t,e){e.zValue=this.zValue||0}applyValueRate(t,e){this.zValue=V(t.zValue,this.zValue,e)}}class us extends _s{get high(){return this.y}get highValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 1===t?this.lowValue:super.getPointLabel(0)}getPointText(t){return 1===t?this.lowLabel:super.getPointText(0)}_assignTo(t){return c(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 i=t.options,s=e.length>2?1:0;this.low=e[b(i.lowField,0+s)],this.y=e[w(i.highField,i.yField,1+s)],s>0&&(this.x=e[b(i.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=v(e[t.options.lowField],e.low),this.y=S(e[t.options.highField],e.high,this.y),this.lowLabel=e.lowLabel)}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue||0}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class ps extends si{getPosition(){const t=this._op.position;return"point"===t||"edge"===t?t:this.axis._isX?"point":"edge"}}ps.defaults=Me(si.defaults,{step:1});class gs extends oi{getTick(t,e){if(null!=e){const t=this.axis,i=e.levels;if((null==i?void 0:i.length)&&t.hasCategoryTree())return i[0];const s=this._getText(e,e,!1,!1),n=s.lastIndexOf(this.sep);return r(t.options.categoryField)&&n>0?s.substring(n+this.sep.length):s}return""}getIcon(t){var e;return null===(e=this.axis._categories[t.index])||void 0===e?void 0:e.i}}gs.defaults=Me(oi.defaults,{align:"center",verticalAlign:"middle",fillToCategory:!1});class fs extends Qe{getPositions(t){const e=t._ani,i=t._pts,s=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,l=i.length;t<=r&&a<l;t++,a+=o)n.push(e?e.getPos(i[a],s):i[a]);else for(let t=0;t<=r;t++)n.push(e?e.getPos(i[t+1],s):i[t+1])}return n}}class ms extends _i{constructor(){super(...arguments),this._categoryTreeDepth=0,this._categoryTreeGroups=[],this._categoryTreeDividerEnds=[],this._categoryTreeDividerLevel=-1,this._categoryTreeOp=null,this._categoryTreeLevelGroups=[],this._categoryTreeLevelEnds=[],this._weights=new Map,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||"+"}isCategoryTreeEnabled(){return null!=this._categoryTreeOp}hasCategoryTree(){return!this._isPolar&&this._categoryTreeDepth>1&&this._categoryTreeGroups.length>0&&this.isCategoryTreeEnabled()}$_resolveCategoryTreeOp(t){if(!1===t||null==t)return null;if(!0===t)return ms.categoryTreeDefaults;if(!1===t.visible)return null;const e={...ms.categoryTreeDefaults,...t};return s(t.divider)&&s(ms.categoryTreeDefaults.divider)&&(e.divider={...ms.categoryTreeDefaults.divider,...t.divider}),s(t.band)&&(e.band={visible:!0,...t.band}),e}$_normalizeDivider(t){const e=ms.categoryTreeDividerDefaults;return!1===t?{...e,visible:!1}:!0===t||null==t?{...e}:{...e,...t}}$_isDividerOn(t){var e;const i=this._categoryTreeOp,r=null===(e=null==i?void 0:i.levels)||void 0===e?void 0:e[t],n=null==r?void 0:r.divider;if(void 0!==n){if(!1===n)return!1;if(!0===n)return!0;if(s(n)&&void 0!==n.visible)return!1!==n.visible}return!1!==this.$_normalizeDivider(null==i?void 0:i.divider).visible}$_dividerProp(t,e){var i;const r=this._categoryTreeOp,n=null===(i=null==r?void 0:r.levels)||void 0===i?void 0:i[t];return s(null==n?void 0:n.divider)&&void 0!==n.divider[e]?!1!==n.divider[e]:!1===(null==r?void 0:r.divider)?this.$_isDividerOn(t):s(null==r?void 0:r.divider)&&void 0!==r.divider[e]?!1!==r.divider[e]:this.$_isDividerOn(t)}isLevelVisible(t){var e,i;const s=this._categoryTreeOp;return null==s||!1!==(null===(i=null===(e=s.levels)||void 0===e?void 0:e[t])||void 0===i?void 0:i.visible)}getLevelRotation(t){var e,i,s;const r=this._categoryTreeOp,n=null===(s=null===(i=null===(e=null==r?void 0:r.levels)||void 0===e?void 0:e[t])||void 0===i?void 0:i.label)||void 0===s?void 0:s.rotation,o=this.$_resolveLevelRotation(n);if(void 0!==o)return o;const a=this.$_resolveLevelRotation(this.label.options.rotation);return void 0!==a?a:"auto"}$_resolveLevelRotation(t){return"auto"===t?"auto":l(t)?+t%360:void 0}getLevelStyle(t){var e,i,s,r;return null===(r=null===(s=null===(i=null===(e=this._categoryTreeOp)||void 0===e?void 0:e.levels)||void 0===i?void 0:i[t])||void 0===s?void 0:s.label)||void 0===r?void 0:r.style}getLevelAlign(t){var e,i,s,r;const n=null===(r=null===(s=null===(i=null===(e=this._categoryTreeOp)||void 0===e?void 0:e.levels)||void 0===i?void 0:i[t])||void 0===s?void 0:s.label)||void 0===r?void 0:r.align;if(null!=n)return n;const o=this.label;return o.options.fillToCategory&&o.options.align||"center"}getCategoryTreeDepth(){return this._categoryTreeDepth}getCategoryTreeGroups(){return this._categoryTreeGroups}getDividerLevel(){return this._categoryTreeDividerLevel}getDividerEnds(t){return null==t?this._categoryTreeDividerEnds:this._categoryTreeLevelEnds[t]||[]}$_groupsAtLevel(t){return this._categoryTreeLevelGroups[t]||[]}isDividerBetween(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"between")}isDividerEdge(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"edge")}isDividerBelow(t){return this.hasCategoryTree()&&this.$_dividerProp(t,"below")}isDividerTopCap(){const t=this._categoryTreeOp;if(!t||!this.hasCategoryTree())return!1;const e=t.divider;return!1!==e&&(!0===e||null==e||(!s(e)||!1!==e.visible&&!1!==e.edge))}isDividerVisible(){if(!this.hasCategoryTree())return!1;if(this.isDividerTopCap())return!0;for(let t=0;t<this._categoryTreeDepth;t++)if(this.$_dividerProp(t,"between")||this.$_dividerProp(t,"edge")||this.$_dividerProp(t,"below"))return!0;return!1}getBandLevel(){return this.getDividerLevel()}$_resolveDividerStyle(t){if(!1===t)return;if(!0===t)return"rct-axis-tree-divider";if(o(t))return t;if(s(t)&&Object.keys(t).length>0)return t;const e=this.line._style;return o(e)||s(e)&&Object.keys(e).length>0?e:"rct-axis-tree-divider"}$_dividerStyleOf(t){if(s(t))return t.style}getDividerStyle(t){var e,i;if(null!=t){if(!this.isDividerBetween(t)&&!this.isDividerEdge(t)&&!this.isDividerBelow(t))return;const i=this._categoryTreeOp,s=null===(e=null==i?void 0:i.levels)||void 0===e?void 0:e[t],r=this.$_dividerStyleOf(null==s?void 0:s.divider),n=this.$_dividerStyleOf(null==i?void 0:i.divider),o=void 0!==r?r:n;return this.$_resolveDividerStyle(o)}return this.$_resolveDividerStyle(this.$_dividerStyleOf(null===(i=this._categoryTreeOp)||void 0===i?void 0:i.divider))}$_isBandEnabled(){const t=this._categoryTreeOp;return null!=t&&(!1!==t.band&&(!0===t.band||!!s(t.band)&&!1!==t.band.visible))}isBandVisible(){return this.$_isBandEnabled()&&this.hasCategoryTree()&&this.getBandGroups().length>0}getBandGroups(){const t=this.getBandLevel();return t<0?[]:this.$_groupsAtLevel(t)}getBandColor(t){const e=this._bandColors;return e[(t%e.length+e.length)%e.length]}$_resolveBandColors(t){const e=s(null==t?void 0:t.band)?t.band.colors:null;return r(e)&&e.length>0?e:["var(--rct-axis-tree-band-0-fill)","var(--rct-axis-tree-band-1-fill)"]}getCategoryTreeSpan(t,e,i){return this.$_getSpanFromPts(t,e,i)}getDividerPos(t,e){return this.$_getDividerPosFromPts(t,e)}getDividerLinePositions(t){const e=this._categories.length;if(0===e)return[];const i=[this.$_getCategoryEdgePos(0,t,"left")];for(const e of this._categoryTreeDividerEnds)i.push(this.getDividerPos(e,t));return i.push(this.$_getCategoryEdgePos(e-1,t,"right")),i}getWeight(t){var e;return null!==(e=this._weights.get(t))&&void 0!==e?e:1}getLabelY(t,e){return t*(this._op.reversed?b(this._prevRate,1):1)-this.prev(e)}getLabelX(t,e){const i=b(this._prevRate,1);return this.prev(e)+(this._op.reversed?t*(1-i):0)}_type(){return"category"}unitPad(){return this._catPad}continuous(){return!1}_prepareZoom(){return this._zoom||(this._zoom=new li(this),this._zoom.start=this._zoom.min=this._min,this._zoom.end=this._zoom.max=this._max+1),this._zoom}_createGrid(){return new fs(this)}_createTickModel(){return new ps(this)}_createLabel(){return new gs(this)}_doApply(t){super._doApply(t),this._categoryTreeOp=this.$_resolveCategoryTreeOp(t.categoryTree),this._bandColors=this.$_resolveBandColors(this._categoryTreeOp)}collectValues(){this.label.sep=this.getCategorySeparator(),this.$_collectCategories(this._series),this.$_buildCategoryTree(),this._isEmpty?this._values=at.makeIntArray(0,this._categories.length):super.collectValues()}getStartAngle(){let t=super.getStartAngle(),e=+this._op.startOffset;return e>0&&(t-=m(e,1)*this.getWeight(0)*M/this._catLen),t}_doPrepareRender(){const t=this._op;this._isPolar||this._zoom?this._minPad=this._maxPad=this._catPad=0:(this._minPad=w(t.minPadding,t.padding,0),this._maxPad=w(t.maxPadding,t.padding,0),this._catPad=Math.max(0,Math.min(.5,b(t.categoryPadding,0))))}_adjustMinMax(t,e){const i=this._op;return i.minValue<t&&(t=i.minValue),i.maxValue>e&&(e=i.maxValue),{min:t,max:e}}_doBuildTicks(t,e,i,s){const r=this._label;let n=this._weights;const o=this._tick.options.step||1,a=[];if(!this._zoom){const{min:i,max:s}=this._adjustMinMax(t,e);t=Math.floor(i),e=Math.ceil(s)}this._catMin=t,this._catMax=e;let l=this._catLen=e-t+1;this._tstep=Math.max(1,Math.min(l,this._tick.options.step||1));let h=0;for(const t of n.values())h+=t;l=this._len=this._minPad+this._maxPad+l-n.size+h;const _=this._pts=[];if(l>0){let i=this._minPad;_.push(0);for(let s=t;s<=e;s++)_.push(i/l),i+=this.getWeight(s);_.push(i/l),_.push((i+this._maxPad)/l)}const c=this._catStart,d=this._catStep;for(let e=1;e<_.length-2;e+=o){const i=t+e-1,s=this._categories[i/d-c];this.getWeight(i)<=0||a.push({index:e-1,pos:NaN,value:i,label:r.getTick(e-1,s?s.t:i)})}return this._setMinMax(t,e),a}_calcPoints(t,e){const i=this._pts;if(e>100)if(0===this._vlen)for(let t=0;t<i.length;t++)i[t]=0;else for(let t=0;t<i.length;t++)i[t]/=this._vlen;for(let e=0;e<i.length;e++)i[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<i.length;t++)i[t]=0;else for(let s=0;s<i.length;s++)i[s]=i[s]/t*e}}else{let t;t="edge"===this._tick.getPosition()?i.slice(1,i.length-1):this._ticks.map(t=>t.pos),this._markPoints=t}}getPos(t,e){const i=this._pts,s=Math.floor(e-this._catMin+.5),r=i[s+1];let n=r+(i[s+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 i=this._pts;this._op.reversed&&(e=t-e);for(let t=1;t<i.length-1;t++){const s=i[t],r=i[t+1];if(e>=s&&r>=e){return this._catMin+t-(1-(e-s)/(r-s))}}}getUnitLen(t,e){const i=Math.floor(e-this._catMin+.5);let s;return s=this._ani?this._ani.getPos(this._pts[i+2],this._op.reversed)-this._ani.getPos(this._pts[i+2-1],this._op.reversed):this._pts[i+2]-this._pts[i+2-1],x(s)}getLabelLength(t,e){const i=Math.floor(e-this._catMin+.5);return i>this._tstep?this._pts[i+2]-this._pts[i+2-this._tstep]:this._pts[i+2+this._tstep-1]-this._pts[i+2-1]}getValue(t){return l(t)?t:this._map[t]}getXLabel(t){var e,i;const s=this._categories[t];if(!s)return t;const n=s.levels,o=this._op.categoryField;return(null==n?void 0:n.length)&&r(o)&&o.length>1?this.hasCategoryTree()?n[0]:n[n.length-1]:null!==(i=null!==(e=s.t)&&void 0!==e?e:s.c)&&void 0!==i?i:t}_doCalculateRange(t){const e=super._doCalculateRange(t);return this._isX||(e.min=m(0,e.min),e.max=y(0,e.max)),e}$_getSpanFromPts(t,e,i){const s=this._pts,r=this._catMin,n=this._catMax,o=b(i,this._vlen),a=y(t,r),l=m(e,n);if(a>l||!s.length)return{center:NaN,size:0};let h=s[a-r+1],_=s[l-r+2];if(null==h||null==_)return{center:NaN,size:0};if(this._op.reversed){const t=o-_;_=o-h,h=t}return this._ani&&(h=this._ani.getPos(h,this._op.reversed),_=this._ani.getPos(_,this._op.reversed)),{center:(h+_)/2,size:Math.abs(_-h)}}$_getDividerPosFromPts(t,e){return this.$_getCategoryEdgePos(t,e,"right")}$_getCategoryEdgePos(t,e,i){const s=this._pts,r=this._catMin,n=this._catMax,o=b(e,this._vlen),a="left"===i?1:2;let l=s[y(m(t,n),r)-r+a];return null==l?NaN:(this._op.reversed&&(l=o-l),this._ani?this._ani.getPos(l,this._op.reversed):l)}$_parseCategoryLevels(t){const e=this._op.categoryField;if(!r(e)||e.length<2||null==t)return;const i=this.getCategorySeparator(),s=t.split(i);return s.length===e.length?s:void 0}$_pushCategory(t,e,i){const s=this.$_parseCategoryLevels(t),r=this._categories;(null==s?void 0:s.length)&&(e=s[s.length-1]),r.push({c:t,t:e,i:i,levels:s})}$_buildCategoryTree(){var t,e,i,s;const r=this._categories;if(this._categoryTreeDepth=0,this._categoryTreeGroups=[],this._categoryTreeDividerEnds=[],this._categoryTreeDividerLevel=-1,this._categoryTreeLevelGroups=[],this._categoryTreeLevelEnds=[],!this.isCategoryTreeEnabled()||!r.length||this._isPolar)return;const n=null!==(e=null===(t=r[0].levels)||void 0===t?void 0:t.length)&&void 0!==e?e:0;if(n<2)return;if(!r.every(t=>{var e;return(null===(e=t.levels)||void 0===e?void 0:e.length)===n&&t.levels.every(t=>null!=t&&""!==t)}))return;this._categoryTreeDepth=n;for(let t=0;t<n;t++){const e=this._categoryTreeLevelGroups[t]=[];let n=0;for(;n<r.length;){const o=null===(i=r[n].levels)||void 0===i?void 0:i[t];let a=n+1;for(;a<r.length&&(null===(s=r[a].levels)||void 0===s?void 0:s[t])===o;)a++;const l={level:t,start:n,end:a-1,label:o};this._categoryTreeGroups.push(l),e.push(l),n=a}this._categoryTreeLevelEnds[t]=e.slice(0,-1).map(t=>t.end)}let o=-1,a=1/0;for(let t=0;t<n;t++){const e=this.$_groupsAtLevel(t);e.length>1&&e.some(t=>t.end>t.start)&&e.length<a&&(a=e.length,o=t)}o>=0&&(this._categoryTreeDividerLevel=o,this._categoryTreeDividerEnds=this.getDividerEnds(o))}$_collectCategories(t){const e=this._op,i=e.categories,n=this._categories=[];let a=this._weights;if(a.clear(),r(i)&&i.length>0)this._len=0,i.forEach(t=>{const e=null==t?1:y(b(t.weight,1),0),i=t&&t.icon;let r,n;null==t?n=r=null:s(t)?(r=v(t.name,t.label),n=v(t.label,t.name)):n=r=String(t),this._len+=e,this.$_pushCategory(r,n,i),a.set(a.size,e)});else{const i=this.chart.seriesByName(e.categorySeries),s=this.chart.seriesByName(e.weightSeries)||i,n=e.weightField,l=null==s?void 0:s.data,h=e.weightByFrequency;i&&(t=[i]);const _=[];for(const e of t)e.collectCategories(this).forEach(t=>{_.includes(t)||(_.push(t),this.$_pushCategory(t,t))});if(n&&r(l)&&l.length>0){const t=s.getPoints();let e=null;l.forEach((i,s)=>{var r,l;const c=t.get(s);if(!c)return;const d=c.x,u=y(null!==(r=i[n])&&void 0!==r?r:1,0);if(o(d)){const t=_.indexOf(d);if(-1===t)return void(e=null);if(!a.has(t))return a.set(t,u),e=d,void(this._len+=u);h&&e===d&&(a.set(t,y((null!==(l=a.get(t))&&void 0!==l?l:0)+u,0)),this._len+=u)}else Number.isInteger(d)?(a.has(d)||(a.set(d,u),this._len+=u),e=null):e=null})}else if(r(t)&&t.length>0){const e=new Set;for(const i of t){const t=i.collectCategories(this),s=t.length;if(0===s)continue;let r=t[0],n=1;for(let i=1;i<s;i++){const s=t[i],o=_.indexOf(r);s!==r?(-1===o||e.has(r)||(e.add(r),a.set(o,h?n:1)),r=s,n=1):n++}e.has(r)||(e.add(r),a.set(_.indexOf(r),h?n:1))}}}this._map={},n.forEach((t,e)=>{const i=t.v=e;null!=t.c&&(this._map[t.c]=i)})}}ms.type="category",ms.categoryTreeDividerDefaults={visible:!0,edge:!0,between:!0,below:!0},ms.categoryTreeDefaults={visible:!0,divider:{...ms.categoryTreeDividerDefaults},band:!1},ms.defaults=Me(_i.defaults,{padding:0,categoryPadding:.1,startOffset:0,categorySeparator:"+",categoryTree:!1});class ys extends De{}ys.defaults=Me(De.defaults,{visible:!1});class xs extends $e{getAlign(t,e,i,s){let r=this._op.align;return"auto"===r&&(r=t?i?"left":"right":s<=0?e?"left":"right":s>=1?e?"right":"left":"center"),r}getVerticalAlign(t,e,i){let s=this._op.verticalAlign;return"auto"===s&&(s=t?"middle":i?"bottom":"top"),s}getAlignPolar(t){let e=this._op.align;if("auto"===e){const i=(t%(2*Math.PI)*180/Math.PI+360)%360;e=i>=80&&i<=100||i>=260&&i<=280?"center":i>100&&i<260?"left":"right"}return e}getVerticalAlignPolar(t){let e=this._op.verticalAlign;if("auto"===e){const i=(t%(2*Math.PI)*180/Math.PI+360)%360;e=i>=80&&i<=100?"bottom":i>=260&&i<=280?"top":"middle"}return e}getOffsetX(t){const e=this._op.offsetX;return isNaN(e)?"center"===t?0:xs.OFFSET:e}getOffsetY(t){const e=this._op.offsetY;return isNaN(e)?"middle"===t?0:xs.OFFSET:e}getText(){const t=this._op.text;return t?this._getText(t,null,!1,!1):""}getDefaultIconPos(){return"left"}_doApply(t){super._doApply(t),t.position=m(1,y(0,b(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"}}xs.OFFSET=4,xs.defaults=Me($e.defaults,{visible:!1,text:"${expr}",position:1,align:"auto",verticalAlign:"auto"});class bs extends De{getRadius(){return y(0,b(this._op.radius,4))}}bs.defaults=Me(De.defaults,{visible:!1,radius:4});class ws extends De{constructor(t){super(t.chart),this.owner=t,this._points=[],this._labelDomain={callback:(t,e)=>"expr"===e?this._expr:""}}_doInit(t){super._doInit(t),t.variableArea=(this._variableArea=new ys(this.chart)).init(),t.fixedArea=(this._fixedArea=new ys(this.chart)).init(),t.label=(this._label=new xs(this.chart)).init(),t.marker=(this._marker=new bs(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,i,s){return this._minX=t,this._maxX=e,this._minY=i,this._maxY=s,this}_doPrepareRender(t){this._label._prepareRender();const e=this._op,i=e.type,s=this.owner,r=this._res=Math.max(1,(s._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=s._visPoints.filter(t=>!t.isNull).map(t=>({x:t.xValue+n,y:t.yValue+o})).sort((t,e)=>t.x-e.x),l=(this["_"+i]||this._linear).call(this,this._formatter,a);if(this._points=[],l&&"function"==typeof l.evaluator){if(a.length>0){const t=a[0].x,s=a[a.length-1].x,r=e.forward>0?e.forward:0;let n=t-(e.backward>0?e.backward:0),o=s+r;if("logarithmic"===i||"power"===i){const t=Number.EPSILON||1e-12;n<=0&&(n=t)}const h=s-t,_=o-n,c=h>0?Math.ceil(this._res*_/h):this._res;for(let t=0;t<=c;t++){const e=n+(o-n)*t/c,i=l.evaluator(e);Number.isFinite(i)&&this._points.push({x:e,y:i})}}}else if(l&&Array.isArray(l.points))if("movingAverage"===i&&"flat"===e.maExtrapolation||"linear"===e.maExtrapolation){const t=e.forward>0?e.forward:0,i=e.backward>0?e.backward:0,s=l.points;if(s.length>0){const r=s[0],n=s[s.length-1],o=n.x-r.x,a="flat"===e.maExtrapolation;if(i>0){const t=Math.max(2,Math.ceil(this._res*i/o)),e=i/t;if(a){const i=r.y;for(let s=t;s>0;s--)this._points.push({x:r.x-e*s,y:i})}else if(s.length>=2){const i=s[0],n=s[1],o=(n.y-i.y)/(n.x-i.x);for(let s=t;s>0;s--){const t=r.x-e*s,n=i.y+o*(t-i.x);this._points.push({x:t,y:n})}}else{const i=r.y;for(let s=t;s>0;s--)this._points.push({x:r.x-e*s,y:i})}}if(this._points.push(...s),t>0){const e=Math.max(2,Math.ceil(this._res*t/o)),i=t/e;if(a){const t=n.y;for(let s=1;s<=e;s++)this._points.push({x:n.x+i*s,y:t})}else if(s.length>=2){const t=s[s.length-1],r=s[s.length-2],o=(t.y-r.y)/(t.x-r.x);for(let s=1;s<=e;s++){const e=n.x+i*s,r=t.y+o*(e-t.x);this._points.push({x:e,y:r})}}else{const t=n.y;for(let s=1;s<=e;s++)this._points.push({x:n.x+i*s,y:t})}}}}else this._points.push(...l.points);this._expr=l&&l.expr,this._points.forEach(t=>{t.x-=n,t.y-=o})}getLabel(){return""}_doApply(t){super._doApply(t),t.forward=y(0,b(t.forward,0)),t.backward=y(0,b(t.backward,0)),this._formatter=xt.getFormatter(t.numberFormat||"0.####")}_calcLine(t){const e=t.length;let i=0,s=0,r=0,n=0;t.forEach(t=>{i+=t.x,s+=t.y,r+=t.x*t.y,n+=t.x*t.x});const o=e*n-i*i,a=0===o?0:(e*r-i*s)/o;return{m:a,a:(s-a*i)/e}}_linear(t,e){if(e.length>1){const{m:i,a:s}=this._calcLine(e),r=t=>i*t+s;return{expr:`y = ${t.toStr(i)}x + ${t.toStr(s)}`,evaluator:r}}return{}}_logarithmic(t,e){if(e.length>1){const i=e.map(t=>({x:Math.log(t.x),y:b(t.y,0)})),{m:s,a:r}=this._calcLine(i),n=t=>t<=0?NaN:r+Math.log(t)*s;return{expr:`y = ${t.toStr(s)}log(x) ${r>0?"+":"-"} ${t.toStr(x(r))}`,evaluator:n}}return{}}_power(t,e){if(e.length>1){const i=e.map(t=>({x:Math.log(t.x),y:Math.log(t.y)})),{m:s,a:r}=this._calcLine(i),n=Math.exp(r),o=t=>t<=0?NaN:n*t**s;return{expr:`y = ${t.toStr(n)}(x^${t.toStr(s)})}`,evaluator:o}}return{}}_calcLine2(t){let e=0,i=0,s=0,r=0,n=0,o=0;t.forEach(t=>{e+=t.x,i+=t.y,s+=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=i*s-o*o,l=Math.exp((s*r-o*n)/a);return{m:(i*n-o*r)/a,a:l}}_exponential(t,e){if(e.length>1){const i=e.map(t=>({x:t.x,y:t.y})),{m:s,a:r}=this._calcLine2(i),n=r,o=t=>n*Math.exp(s*t);return{expr:`y = ${t.toStr(n)}(e^(${t.toStr(s)}x))`,evaluator:o}}return{}}_polynomial(t,e){const i=e.length;if(i>1){const s=[],r=[];let n=0,o=0;const a=2+1;for(let t=0;t<a;t++){for(let s=0;s<i;s++)n+=e[s].x**t*e[s].y;s.push(n),n=0;const l=[];for(let s=0;s<a;s++){for(let r=0;r<i;r++)o+=e[r].x**(t+s);l.push(o),o=0}r.push(l)}r.push(s);const l=function(t,e){const i=t,s=t.length-1,r=[e];for(let t=0;t<s;t++){let e=t;for(let r=t+1;r<s;r++)x(i[t][r])>x(i[t][e])&&(e=r);for(let r=t;r<s+1;r++){const s=i[r][t];i[r][t]=i[r][e],i[r][e]=s}for(let e=t+1;e<s;e++)for(let r=s;r>=t;r--)i[r][e]-=i[r][t]*i[t][e]/i[t][t]}for(let t=s-1;t>=0;t--){let e=0;for(let n=t+1;n<s;n++)e+=i[n][t]*r[n];r[t]=(i[s][t]-e)/i[t][t]}return r}(r,a),h=t=>l.reduce((e,i,s)=>e+i*t**s,0);return{expr:"y = "+(l.map((e,i)=>{const s=+e;if(!isFinite(s)||0===s)return"";const r=t.toStr(s);if("0"===r)return"";if(0===i)return s<0?`-${r}`:`${r}`;return`${s<0?"- ":"+ "}${r}${1===i?"x":`x^${i}`}`}).filter(t=>t).join(" ").replace(/^\+ /,"")||"0"),evaluator:h}}}_movingAverage(t,e){const i=e.length,s=y(1,m(i-1,this._op.movingInterval)),r=[];let n=s;for(;n<=i;){const t=e.slice(n-s,n).reduce((t,e)=>t+b(e.y,0),0);r.push({x:e[n-1].x,y:t/s}),n++}return{expr:`y = movingAverage(${t.toStr(s)})`,points:r}}}var vs;ws.defaults=Me(De.defaults,{visible:!1,type:"linear",resolution:5,movingInterval:2,maExtrapolation:"none"});const Ss={},Vs={},Cs=/\$\{detail\}/g;class As extends De{}As.defaults=Me(De.defaults,{visible:!1});class Ps 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,x(t)>1e3,!0):this._getText(t,null,!1,!1)}getOffset(){return b(this._op.offset,0)}getAlign(){return"center"}getAlignOffset(){return 0}getDefaultIconPos(){return"top"}getRotation(){return y(-90,m(90,b(this._op.rotation,0)))}_isVisible(){return this._op.visible||n(this._op.visibleCallback)}_doSetSimple(t){return n(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=b(t.verticalAdjust,0)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}vs=Ps,Ps.OFFSET=4,Ps.defaults=Me($e.defaults,{visible:void 0,position:"default",offset:vs.OFFSET,overflowFit:0,overlapOutline:!0,verticalAdjust:.05,rotation:0});class ks extends $e{_doInit(t){super._doInit(t),this._args={}}getText(t){return at.isValidNum(t)?this._getText(null,t,x(t)>1e3,!0):this._getText(String(t),null,!1,!1)}getOffset(){return b(this._op.offset,0)}getGap(){return b(this._op.gap,ks.OFFSET)}getDefaultIconPos(){return"left"}getCallbackArgs(t,e,i,s){const r=this._args;return r.chart=t.wrapper,r.x=e,r.positiveTotal=i,r.negativeTotal=s,r.total=i+s,r}isStackLabelVisible(t){return this._op.visibleCallback?this._op.visibleCallback(t):this.visible}getStackLabelText(t,e){if(n(this._op.textCallback)){const e=this._op.textCallback(t);if(o(e))return e}return this.getText(e)}getRotation(){return y(-90,m(90,b(this._op.rotation,0)))}getStackLabelStyle(t){if(n(this._op.styleCallback))return this._op.styleCallback(t)}_isVisible(){return this._op.visible||n(this._op.visibleCallback)}_doApply(t){super._doApply(t),this._overflowFit="hidden"===t.overflowFit?1/0:"none"===t.overflowFit?NaN:+t.overflowFit,this._vertAdjust=b(t.verticalAdjust,0)}}ks.OFFSET=4,ks.defaults=Me($e.defaults,{visible:!1,align:"center",gap:ks.OFFSET,offset:0,overflowFit:0,verticalAdjust:.05,rotation:0});const Ls={x:"xValue",y:"yValue",z:"zValue"};class Ts extends Yt{constructor(t,e,i){super(),this.series=t,this.point=e,this.delay=i?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 Ns extends Yt{constructor(t,e,i){super(),this.series=t,this.points=e,i&&(i.cancel(),this._prevAnis=i._prevAnis?[...i._prevAnis,i]:[i],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 i=this._prevVrs.get(e);void 0!==i&&(e._vr=i*(1-t))})}),this.points.forEach(e=>{e._vr=1-t}),this.series._changed(),!0}}class Ms extends Yt{constructor(t,e,i){super(),this.series=t,this._points=[],Array.isArray(e)&&e.forEach(t=>{this.addPoint(t)}),this._interval=i,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 i=this._points;for(let t=i.length-1;t>=0;t--)i[t]._vr+=this._interval<=0?1:e/this._interval,(isNaN(i[t]._vr)||i[t]._vr>=1)&&i.splice(t,1);return 0!==i.length&&(this.series._changed(),!0)}}class Es extends _s{}const Bs=12;class Ds extends De{constructor(){super(...arguments),this._index=-1,this._seriesIndex=0}static register(...t){t.forEach(t=>{Ss[t.type]=t})}static _loadSeries(t,e,i,s){let r=t._getSeriesType(i.type);if(!r&&i.type&&console.error(`Unknown series type: '${i.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+i.type+", "+t.type);const n=new r(t);return n._setIndex(e,t._seriesIndex++),n.init(),n._load(i),n}static getPointTooltipParam(t,e,i){switch(i){case"series":return t.displayName();case"name":return e.getParam(i)||t._xAxisObj.getXLabel(e.xValue);case"xValue":return t._xAxisObj.value2Tooltip(e.xValue);case"yValue":return t._yAxisObj.value2Tooltip(e[i]);default:return e.getParam(i)}}_doInit(t){this._points=new cs(this),this._pointArgs={},this._paletteColors=Array(Bs).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,i,s,r){at.log("onDataValueChanged",e,i,s,r);const n=this._runPoints[e];if(n){const t={};t[i]=s,this.updatePoint(n,t)}}onDataRowUpdated(t,e,i){}onDataRowAdded(t,e){at.log("onDataRowAdded",e),this.addPoint(t.getRow(e))}onDataRowDeleted(t,e){at.log("onDataRowDeleted",e);const i=this._runPoints[e];i&&this.removePoint(i)}onDataChanged(t){at.log("onDataChanged")}isGroupTooltip(){return!1}getTooltipDetail(t){const e=this._op;let i;if(e.tooltipDetailCallback){this._getPointCallbackArgs(this._pointArgs,t);const s=e.tooltipDetailCallback(this._pointArgs);i=o(s)?s:""}if(void 0===i){const t=e.tooltipDetail;i=o(t)?t:""}return i}getTooltipText(t,e){var i;const s=this._op;let r;if(s.tooltipCallback){this._getPointCallbackArgs(this._pointArgs,e);const t=s.tooltipCallback(this._pointArgs);o(t)&&(r=t)}if(void 0===r){const t=s.tooltipText;r=o(t)?t:null!==(i=Ds.defaults.tooltipText)&&void 0!==i?i:"",r&&(r=r.replace(Cs,this.getTooltipDetail(e)))}return r}getTooltipParam(t,e,i){return Ds.getPointTooltipParam(t,e,i)}getTooltipHeaderColor(t){return null}_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 i=[];return this._points.forEach(s=>{e>=s.xValue&&s.xValue>=t&&i.push(s)}),i}_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,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s&&(isNaN(i)||s<=i)}return!0}canMaxPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s&&(isNaN(i)||s>=i)}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),i=isNaN(e)?t.getValue(this.chart.chartOptions.getXStart(t)):e;return b(i,t.getXStart())}$_getXStep(t){return S(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 ms)return this._doCollectCategories(t)}_doCollectCategories(t){const e=t.options.categoryField;if(null!=e){if(r(e)){const i=e.length-1,s=t.getCategorySeparator();return this._points._internalPoints().filter(t=>o(t.getProp(e[i]))).map(t=>e.map(e=>t.getProp(e)).join(s))}return this._points.getProps(e).filter(t=>o(t))}return this._points.getCategories(t===this._xAxisObj?"x":"y").filter(t=>o(t))}collectValues(t,e){if(t===this._xAxisObj){let i=this.$_getXStart(t),s=this.$_getXStep(t);o(s)&&(s=s.trim());const r=o(s)?NaN:at.getNumber(s);this._points.forEach((e,n)=>{let a=t.getValue(e.x);isFinite(a)||(a=i,isFinite(r)?i+=r:o(s)&&(i=t.incStep(i,s))),e.xValue=a}),e&&this._runPoints.forEach(t=>{!1!==t.visible&&e.push(t.xValue)})}else{const i=this.hasZ();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)&&e._prev&&(i?isNaN(e._prev.zValue)&&e.initPrev(t,e._prev):(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 i=this._visPoints,s=i.length;if(s>0){const t=this._trendline,e=this._pointArgs,r=this.hasZ();let n=i[0],o=n.xValue,a=o,l=n.yValue,h=l,_=r?n.zValue:null,c=_;n.vindex=0;for(let t=1;t<s;t++)n=i[t],n.vindex=t,isNaN(h)&&!isNaN(n.yValue)?l=h=n.yValue:n.yValue>h?h=n.yValue:n.yValue<l&&(l=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<s;t++){const e=i[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,l,h)._prepareRender();const e=t._points||[],i=e.map(t=>t.y).filter(t=>Number.isFinite(t)).sort((t,e)=>t-e),s=e.map(t=>t.x).filter(t=>Number.isFinite(t)).sort((t,e)=>t-e);i.length>0&&(l=Math.min(l,i[0]),h=Math.max(h,i[i.length-1])),s.length>0&&(o=Math.min(o,s[0]),a=Math.max(a,s[s.length-1]))}e.yMin=this._minY=l,e.yMax=this._maxY=h,e.xMin=this._minX=o,e.xMax=this._maxX=a,r&&(e.zMin=this._minZ=_,e.zMax=this._maxZ=c)}this.$_prepareViewRanges(i),e&&!isNaN(this._minY)&&e.push(this._minY,this._maxY)}getAxisPadRate(){return b(this._op.paddingRate,1)}_getRangeMinMax(t){let e,i;return"x"===t?(e=this._minX,i=this._maxX):"z"===t?(e=this._minZ,i=this._maxZ):(e=this._minY,i=this._maxY),{min:e,max:i}}$_prepareViewRanges(t){const e=this._runRangeValue=this.getViewRangeAxis(),{min:i,max:s}=this._getRangeMinMax(e);(this._runRanges=tt(this._op.viewRanges,i,s,!1,!1,!0,this._runColor))?t.forEach((t,i)=>{this._setViewRange(t,e)}):t.forEach((t,e)=>{t.range=T})}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?b(this._labelOffCallback(this._getPointCallbackArgs(this._pointArgs,t)),Ps.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=C(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,i){let s;return n(this._pointLabelCallback)&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),o(s))?s:(s=t.getPointText(e),null!=s?s:i)}getPointStyle(t){if(n(this._op.pointStyleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._op.pointStyleCallback(this._pointArgs)}getPointLabelStyle(t){if(n(this._pointLabel.options.styleCallback))return this._getPointCallbackArgs(this._pointArgs,t),this._pointLabel.options.styleCallback(this._pointArgs)}pointClicked(t){if(n(this._op.onPointClick))return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}pointHovered(t){n(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 o(t)&&(t=this._xAxisObj.getValue(t)),this._points.pointAt(t)}getValueAt(t,e="yValue"){const i=this.getPointAt(t);return i?i[e]:T}_dataPointsChanged(){this._pointsChanged=!0,this.chart._dataChanged(),this._changed()}updatePoint(t,e,i=!0){if(t instanceof _s||(t=this.getPointAt(t)),t){let s=t._prev;return s&&s.ani&&s.ani.cancel(),s=t.updateValues(this,e),s&&i&&this.chart.animatable()&&(s.ani=new Ts(this,t,!1),s.ani.start()),this._dataPointsChanged(),!!s}return!1}updateData(t){this._setData(t),this._dataPointsChanged()}_needAddAnimation(){return!0}addPoint(t,e=!0){const i=this._doAddPoint(t);if(i){if(this._points.add(i),e&&this.chart.animatable()&&this._needAddAnimation()){const t=i._prev=i.copy();t.ani=new Ts(this,i,this._points.count>1),t.ani.start()}this._dataPointsChanged()}return i}addPoints(t,e=!0){const i=[];return r(t)&&t.forEach(t=>{const e=this._doAddPoint(t);e&&i.push(e)&&this._points.add(e)}),i.length>0&&(e&&this.chart.animatable()&&i.forEach(t=>{const e=t._prev=t.copy();e.ani=new Ts(this,t,this._points.count>1),e.ani.start()}),this._dataPointsChanged()),i}_needDecayEffect(){return!1}removePointAt(t,e=!0){const i=this._points.get(t);return this.removePoint(i,e)}removePoint(t,e=!0){if(t instanceof _s||(this.hasZ()?r(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof _s&&this._points.contains(t)){let i=!1;if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ns(this,[t],this._decayAni).start(),this._changed(),!0;this._points.remove(t)&&(this._dropAni?this._dropAni.addPoint(t):(this._dropAni=new Ms(this,[t],this._decayDuration)).start(),i=!0)}else this._points.remove(t)&&(i=!0);if(i)return this._doPointRemoved(t),this._dataPointsChanged(),!0}}removePointsAt(t,e=!0){if(r(t)){const i=t.map(t=>this._points.get(t)).filter(t=>null!=t);return this.removePoints(i,e)}return 0}removePoints(t,e=!0){if(r(t)){let i=[];if(t.forEach(t=>{t instanceof _s||(this.hasZ()?r(t)&&(t=this.getPointAt(t[0],t[1])):t=this.getPointAt(t)),t instanceof _s&&this._points.contains(t)&&i.indexOf(t)<0&&i.push(t)}),i.length>0){if(e&&this.chart.animatable()){if(this._needDecayEffect())return new Ns(this,i,this._decayAni).start(),this._changed(),i.length;i=this._points.removeAll(i),i.length>0&&(this._dropAni?i.forEach(t=>this._dropAni.addPoint(t)):(this._dropAni=new Ms(this,i,this._decayDuration)).start())}else i=this._points.removeAll(i);if(i.length>0)return this._doPointsRemoved(i),this._dataPointsChanged(),i.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=y(0,b(t.decayDuration,300))}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e)}_createLabel(t){return new Ps(t)}_createPoint(t){return new Es(t)}$_addPoint(t,e){const i=this._createPoint(t);return i.index=e,i.parse(this),(i.isNull||(i.isNull=null==t||null==i.y))&&(this._containsNull=!0),i}_doAddPoint(t){return this.$_addPoint(t,this._points.count)}_doPointRemoved(t){}_doPointsRemoved(t){}_createLegendMarker(t,e){return Xi.create(t,Ds.LEGEND_MARKER,0,0,e,e,e/2)}_referOtherSeries(t){return!0}_colorByPoint(){return!1}_getFielderProps(){return["xField","yField","zField","colorField","iconField"]}_createFielder(t){return n(t)?e=>t(e):null!=t?e=>e[t]:t=>{}}_createFielders(){const t=this._op;this._getFielderProps().forEach(e=>{const i=`_${e}er`;(!this[i]||e in t&&this[`_${e}`]!==t[e])&&(this[i]=this._createFielder(t[e]),this[`_${e}`]=t[e])})}_defaultLoadAnimation(){return"reveal"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(r(t))return t;if(t){let e;if(t._obj instanceof 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){return this._doLoadPoints(t),n(this._op.onPointsLoaded)&&this._op.onPointsLoaded(this,!this._loaded),this._loaded=!0,this}_doLoadPoints(t){this._points.load(t)}_doPrepareRender(){const t=this._op,e=t.pointColors,i=this._runColor=l(t.color)?`var(--color-${Math.max(1,(Math.floor(t.color)-1)%Bs+1)})`:t.color;let s,n;r(e)?s=e:o(e)?e.endsWith("@pal")||e.endsWith("@palette")?s=this.chart.getPaletteColors(e.split("@")[0]):n=this.chart._assets.get(e):this._colorByPoint()&&(s=this.chart.chartOptions.options.colors),n instanceof ke?this._runPoints.forEach((t,e)=>{t.color=t.color||n.getNext()||i}):r(s)?this._runPoints.forEach((t,e)=>{t.color=t.color||s[e%s.length]||i}):this._runPoints.forEach((t,e)=>{t.color=t.color||i}),this._preparePointArgs(this._pointArgs),this._labelPosCallback=C(t.pointLabel.position),this._labelPos=this.getLabelPos(this._pointLabel),this._labelOffCallback=C(t.pointLabel.offset),this._labelOff=this.getLabelOff(this._pointLabel.getOffset())}_setViewRange(t,e){const i=t[Ls[e]];for(const e of this._runRanges)if(i>=e.fromValue&&i<=e.toValue)return void(t.range=e);t.range=T}_defViewRangeValue(){return"y"}_canSort(){return!0}$_setDecay(t){this._decayAni=t}$_clearDecay(){this._decayAni=null}$_clearDrop(){this._dropAni=null}}Ds.LEGEND_MARKER="rct-legend-item-marker",Ds.defaults=Me(De.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 Os extends Oe{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(i=>t===i.row&&e===i.col)}seriesByType(t){for(const e of this._items){if(e._type()===t)return e;if(e instanceof qs&&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 i=[];return this._items.forEach(s=>{s._valid&&!s._legended&&(t<0||t===s.row)&&(e<0||e===s.col)&&(s.getLegendSources(i),s._legended=t>=0&&e>=0)}),i}canPolar(){return this._series.length>0&&this._series.every(t=>t&&t.canPolar)}load(t){const e=this.chart,i=this._items=[],n=this._series=[];r(t)?t.forEach((t,s)=>{i.push(this.$_loadItem(e,t,s))}):s(t)&&i.push(this.$_loadItem(e,t,0)),i.forEach(t=>{t instanceof qs?n.push(...t.series):t instanceof Ds&&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 i=this.$_loadItem(this.chart,t,this._series.length);if(i)return i._needAnimate=e,this._items.push(i),this._series.push(i),this.$_add(i),i}remove(t){let e;if(t instanceof Ds?e=t:o(t)&&(e=this._map[t]),e){if(!e._group)return this._items.splice(this._items.indexOf(e),1),this._series.splice(this._series.indexOf(e),1),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(i=>{if(i.visible){const s=i._group;(s?s.visible&&s._valid:i._valid)&&(t.push(i),i.hasShape()&&i.setShape(ji[e++%ji.length]),s||(i._valid=!0))}}),this._visibleSeries=t.sort((t,e)=>{let i=+(t._group?t._group.options.zOrder:t.options.zOrder)||0,s=+(e._group?e._group.options.zOrder:e.options.zOrder)||0;return i===s&&t._group&&t._group===e._group?(+t.options.zOrder||0)-(+e.options.zOrder||0):i-s});const i=1===this._visibleSeries.filter(t=>t.isClusterable()).length;this._visibleSeries.forEach((t,e)=>{t instanceof Ws&&(t._single=i)}),this._visibles.forEach(t=>t._prepareRender())}prepareAfter(){this._visibles.forEach(t=>t.prepareAfter())}$_loadItem(t,e,i){const s=r(e.children||e.series)&&t._getGroupType(e.type||t.type);if(s){const r=new s(t);return r._setIndex(i),r.init(),r._load(e),r}return Ds._loadSeries(t,i,e)}$_add(t){!this._widget||t instanceof Gs||(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 Rs extends Ds{_doInit(t){super._doInit(t),t.trendline=(this._trendline=new ws(this)).init()}get trendline(){return this._trendline}connectable(t){return!0}}Rs.defaults=Me(Ds.defaults,{});class $s extends De{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 o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}$s.defaults=Me(De.defaults,{radius:3});class Is extends _s{legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){return this._calcedColor}legendStroke(){return this._calcedStroke}legendLabel(){return v(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 Fs extends De{_doSetSimple(t){return o(t)?(this.setStyle("stroke",t,!1),!0):super._doSetSimple(t)}}Fs.defaults=Me(De.defaults,{curved:!0});class zs extends Ps{constructor(t,e=!1){super(t),this.isSub=e}_doInit(t){super._doInit(t),t.connector=(this._connector=new Fs(this.chart)).init()}get connector(){return this._connector}getWidgetAlign(){return"near"===this._op.align?-1:"far"===this._op.align?1:0}_doApply(t){super._doApply(t),this._setDims(t,"distance")}}zs.defaults=Me(Ps.defaults,{visible:!0,convergent:!0,align:Qi,dedupeMode:ts});class Hs extends De{constructor(){super(...arguments),this._dirty=!1}calculate(t){const e=this.options,i=this._save;let s,r=e.maxCount;return s=this._minDim?X(this._minDim,_s.getSum(t)):+e.minValue,isNaN(r)&&isNaN(s)&&(r=Hs.DEF_COUNT),(this._dirty=!i||i.value!==s||i.count!==r)&&(isNaN(s)||(t=t.filter(t=>t.y>=s)),r>0&&t.length>r&&(r>1&&r--,t=t.slice(0,r)),this._save={count:r,value:s}),t}isDirty(){return this._dirty}_doApply(t){super._doApply(t),this._minDim=W(t.minValue,!0)}}Hs.DEF_COUNT=10,Hs.defaults=Me(De.defaults,{visible:!1,x:"기타"});class Gs extends Ds{constructor(){super(...arguments),this._sum=0}_doInit(t){super._doInit(t),t.othersGroup=(this._othersGroup=new Hs(this.chart)).init()}get othersGroup(){return this._othersGroup}get isWidget(){return!0}getSum(){return this._sum}getCenter(t,e){return{x:X(this._centerXDim,t),y:X(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 i,s;super._doApply(t),i=t.centerX,s=t.centerY,i!==e._centerX&&(e._centerX=i,e._centerXDim=W(S(i,e._op.center,Gs.DEF_CENTER),!0)),s!==e._centerY&&(e._centerY=s,e._centerYDim=W(S(s,e._op.center,Gs.DEF_CENTER),!0))}collectValues(t,e){super.collectValues(t,e),this._sum=0,this._runPoints.forEach(t=>this._sum+=t.yValue);const i=this.getSum();this._runPoints.forEach(t=>t._percent=100*t.yValue/i)}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,i=this.othersGroup;if(i.visible){if(!this._groupedPoints&&(this._groupedPoints=i.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,i)=>(t.vindex=i,t._legendKey=t[e],t))}}Gs.DEF_CENTER="50%",Gs.defaults=Me(Ds.defaults,{legendByPoint:!1,zeroInLegend:!0,centerX:Gs.DEF_CENTER,centerY:Gs.DEF_CENTER});class js extends Gs{getRadius(t,e){return X(this._radiusDim,m(t,e))}_doApply(t){super._doApply(t),function(t,e){e!==t._radius&&(t._radiusDim=W(v(t._radius=e,js.defaults.radius),!0))}(this,t.radius)}}js.defaults=Me(Gs.defaults,{radius:"40%",startAngle:0,totalAngle:360,clockwise:!0});class Ws extends Rs{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 i=this._group;let s=t;return i?(s*=i._clusterWidth,s*=1-2*i.options.groupPadding,s*=this._childWidth):s*=this._clusterWidth,s*=1-2*this._pointPad,y(e,s)}getPointPos(t){const e=this._group;let i=t,s=0;return e?(s=i*e._clusterPos,i*=e._clusterWidth,s+=i*e.options.groupPadding,i-=i*e.options.groupPadding*2,s+=i*this._childPos,i*=this._childWidth):(s=i*this._clusterPos,i*=this._clusterWidth),s+=i*this._pointPad,s}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=b(this.getMinPointWidth(),0)}}Ws.defaults=Me(Ds.defaults,{pointWidth:1,minPointWidth:0});class Ys extends Ps{getAlign(){return this._op.align||"center"}getAlignOffset(){return b(this._op.alignOffset,0)}get line(){return this._line}_doInit(t){super._doInit(t),t.line=(this._line=new As(this.chart)).init()}}Ys.defaults=Me(Ps.defaults,{align:"center",alignOffset:0});class Xs extends Ws{get depth(){return this._depth}get distance(){return this._distance}_createLabel(t){return new Ys(t)}_doPrepareRender(){const t=this._group,e=this._op;super._doPrepareRender(),t?(this._depth=y(0,w(e.depth,t.getDepth(),Xs.DEPTH)),this._distance=t.getDistance()+b(e.distance,0)):(this._depth=y(0,b(e.depth,Xs.DEPTH)),this._distance=b(e.distance,Xs.DISTANCE)),e.nullAsBase&&null!=e.baseValue&&this._runPoints.forEach(t=>{t.isNull&&(t.y=e.baseValue,t.isNull=!1)}),this._base=S(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}_getLabelDefaultPos(t,e){const i=this._group;return"default"===e&&i&&i._stacked&&i.stackLabel&&i.stackLabel.visible?"inside":e}}Xs.DEPTH=10,Xs.DISTANCE=5,Xs.defaults=Me(Ws.defaults,{nullAsBase:!1});class Us extends Ws{collectValues(t,e){super.collectValues(t,e),t===this._yAxisObj&&this._visPoints.forEach(t=>{if(e){const i=this._getBottomValue(t);!isNaN(i)&&e.push(i)}})}}class Zs extends Us{}class qs extends De{constructor(){super(...arguments),this._index=-1,this._series=[],this._visibles=[],this._seriesChanged=!1}static register(...t){t.forEach(t=>{Vs[t.type]=t})}static registerSeries(...t){t.forEach(t=>{Vs[t.seriesType]=t})}static collectTooltipText(t,e,i,s,n){function o(t,e,i,s){let r=e.replace(Cs,t.getTooltipDetail(i));return r=r.replace("yValue","yValue."+i.index).replace(/\$\{/g,"${"+s+"."),r}const a=e.length>1&&r(t.tooltipListRow)&&t.tooltipListRow.length>1&&n,l=a?t.tooltipListRow:t.tooltipRow;let h;return a?n.header=t.tooltipHeader||"":h=t.tooltipHeader||"",l&&e.forEach((t,e)=>{let r=s;t!==i&&t.needAxes()&&(r=t.getPointAt(s.xValue)),r&&(a?(n.items.push(t),n.rows.push([o(t,l[0],r,e),o(t,l[1],r,e)])):(h&&(h+="<br>"),h+=o(t,l,s,e)))}),a?n.footer=t.tooltipFooter||"":h+=t.tooltipFooter?"<br>"+t.tooltipFooter:"",h}static inflateTooltipParam(t,e,i,s){let r=s.indexOf("."),n=parseInt(s.substring(0,r));if(!isNaN(n)){const o=t[n].getPointAt(i.xValue);o&&(e=t[n],i=o,s=s.substring(r+1))}return s.startsWith("series.")&&(e=t[+s.substring(7)]||e,s="series"),Ds.getPointTooltipParam(e,i,s)}isGroupTooltip(){return!0}getTooltipText(t,e,i){return qs.collectTooltipText(this._op,this._visibles,t,e,i)}getTooltipParam(t,e,i){return qs.inflateTooltipParam(this._visibles,t,e,i)}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}get stackLabel(){return this._stackLabel}_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(i=>{i.collectRanges(t,e)})}prepareReferents(t){this._series.forEach(e=>e.prepareReferents(t))}collectCategories(t){let e=[];return this._visibles.forEach(i=>e=e.concat(i.collectCategories(t))),e}getLegendSources(t){var e;const i=this._op;if(!1!==i.visibleInLegend&&this.visible){const s=this._series,r=[];if((null===(e=this._yAxisObj)||void 0===e?void 0:e.options.reversed)||"fill"!==i.layout&&"stack"!==i.layout)s.forEach(t=>t.getLegendSources(r));else for(let t=s.length-1;t>=0;t--)s[t].getLegendSources(r);i.reversedInLegend&&r.reverse(),t.push(...r)}}getAxisPadRate(){return 1}isBased(t){return this._visibles[0]&&this._visibles[0].isBased(t)}canMinPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e<s&&(isNaN(i)||s<=i)}return!0}canMaxPadding(t,e,i){if(this.isBased(t)){const s=this.getBaseValue(t);return isNaN(s)||!this.isBased(t)||e>s&&(isNaN(i)||s>=i)}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=b(this._op.layoutMax,qs.LAYOUT_MAX);return t>0?t:qs.LAYOUT_MAX}_doInit(t){super._doInit(t),t.stackLabel=(this._stackLabel=new ks(this.chart)).init()}_doApply(t){super._doApply(t),i.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}this._stackLabel._prepareRender(),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 i=this._seriesType();r(e)?e.forEach((e,s)=>this.$_add(Ds._loadSeries(t,this._series.length,e,i))):s(e)&&this.$_add(Ds._loadSeries(t,this._series.length,e,i))}$_add(t){if(!this._canContain(t))throw new Error("이 그룹에 포함될 수 없는 시리즈입니다: "+t);this._series.push(t),t._group=this}$_collectValues(t,e){this._visibles.forEach(i=>{i.collectValues(t,e)})}$_collectPoints(t){const e=this._visibles,i=this._stackPoints=new Map;e.forEach(e=>{e.collectValues(t,null)}),e[0]._runPoints.forEach(t=>{i.set(t.xValue,[t])});for(let t=1;t<e.length;t++)e[t]._runPoints.forEach(t=>{const e=i.get(t.xValue);e?e.push(t):i.set(t.xValue,[t])});return i}$_collectStack(t,e){const i=this.getBaseValue(t),s=this.$_collectPoints(t),r=this._stackTotals=new Map;if(isNaN(i))for(const[t,i]of s.entries()){i[0].yGroup=i[0].yValue||0;for(let t=1;t<i.length;t++)i[t].yGroup=i[t-1].yGroup+(i[t].yValue||0);const s=i[i.length-1].yGroup;r.set(t,{x:i[0].xValue,positiveTotal:s>=0?s:0,negativeTotal:s<0?s:0}),e.push(s)}else for(const[t,n]of s.entries()){let s=n[0].yValue||0,o=s>=i?0:-1,a=s<i?0:-1;n[0].yGroup=n[0].yValue||0;for(let t=1;t<n.length;t++)s=n[t].yValue||0,s>=i?(o>=0&&(n[t].yGroup=n[o].yGroup+s*(s<0?-1:1)),o=t):(a>=0&&(n[t].yGroup=n[a].yGroup+s*(s>=0?-1:1)),a=t);const l=o>=0?n[o].yGroup:0,h=a>=0?n[a].yGroup:0;r.set(t,{x:n[0].xValue,positiveTotal:l,negativeTotal:h}),o>=0&&e.push(n[o].yGroup),a>=0&&e.push(n[a].yGroup)}}$_collectFill(t,e){const i=this.getBaseValue(t),s=this.getLayoutMax(),r=this.$_collectPoints(t);if(isNaN(i))for(const t of r.values()){const i=t.reduce((t,e)=>t+(e.yValue||0),0);if(0===i){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)/i*s,r=e.yGroup=e.yValue+r;e.push(s)}}else for(const t of r.values()){const r=t.reduce((t,e)=>t+(x(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*s,e.yValue<i?o=e.yGroup=(e.yValue||0)+o:n=e.yGroup=(e.yValue||0)+n;e.push(o,n)}}}}qs.LAYOUT_MAX=100,qs.defaults=Me(De.defaults,{layout:"default",layoutMax:qs.LAYOUT_MAX,visibleInLegend:!0,zOrder:0,tooltipHeader:"<b>${name}</b>",tooltipRow:"${series}: ${detail}",tooltipListRow:["${series}","${detail}"]});class Ks extends qs{collectValues(t,e){if(super.collectValues(t,e),t===this._yAxisObj){const t=this._doConstraintYValues(this._visibles);e.length=0,e.push(...t)}}}class Qs extends qs{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}}Qs.defaults=Me(qs.defaults,{groupWidth:1,groupPadding:.1});class Js extends Rs{isMarker(){return!0}isXY(){return!0}}Js.defaults=Me(Ds.defaults,{colorByPoint:!1});class tr extends De{}class er extends De{}const ir={area:()=>({type:"area"}),line:()=>({type:"line"}),bar:()=>({type:"bar"})},sr={category:()=>({type:"category"}),linear:()=>({type:"linear"}),time:()=>({type:"time"}),log:()=>({type:"log"})},rr={minPadding:0,maxPadding:0};class nr extends De{constructor(){super(...arguments),this._dataChanged=!0}_doInit(t){super._doInit(t);const e=this.chart;t.handle=(this._handle=new tr(e)).init(),t.mask=(this._mask=new er(e)).init(),t.borderLine=(this._borderLine=new De(e)).init()}get handle(){return this._handle}get mask(){return this._mask}get borderLine(){return this._borderLine}getThickness(){return Math.max(0,b(this._op.thickness,nr.defaults.thickness))}getGap(){return Math.max(0,b(this._op.gap,nr.defaults.gap))}getGapFar(){return Math.max(0,b(this._op.gapFar,nr.defaults.gapFar))}getHandleOverflow(){return nr.HANDLE_TRACK_OFFSET+nr.HANDLE_RADIUS}getSize(){const t=y(this.getGapFar(),this.getHandleOverflow());return this.getGap()+this.getThickness()+t}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=c({},e.series,ir[t]())}else i.series=ir.area();s(e.xAxis)?i.xAxis=c({},e.xAxis,(sr[e.xAxis.type]||sr.linear)(),rr):i.xAxis=c({},rr),s(e.yAxis)?i.yAxis=c({},e.yAxis,(sr[e.yAxis.type]||sr.linear)(),rr):i.yAxis=c(sr.linear(),rr),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()}}nr.HANDLE_RADIUS=9.75,nr.HANDLE_TRACK_HEIGHT=6,nr.HANDLE_TRACK_OFFSET=nr.HANDLE_TRACK_HEIGHT/2,nr.defaults=Me(De.defaults,{visible:!1,usePointSource:!1,liveScroll:!0,minSize:.05,thickness:45,gap:8,gapFar:3});class or extends De{_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}or.defaults=Me(De.defaults,{text:"Title",alignBase:"body",align:"center",verticalAlign:"middle",gap:10,offset:0});class ar extends or{}ar.defaults=Me(or.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class lr extends De{constructor(t){super(t.chart),this.owner=t}_doInit(t){super._doInit(t),this._domain={callback:(t,e)=>{const{_series:i,_point:s,_ctx:r}=this,n=i._group,o=!!r.axis;let a=i,l=s;if(o||n){const t=e.match(/(\d+)\.(series|yValue)/);if(t){const i=Number(t[1])||0;e=e.replace(i+".",""),a=o?r.series[i]:n.getVisibleSeries()[i]}}return e.match(/yValue\.(\d+)/)&&(l=a.getPointAt(s.xValue),e="yValue"),r.getTooltipParam(a,l,e)}}}setTarget(t,e,i){let s=v(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(s,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:y(b(t.headerHeight,0),0)}getTailSize(){return this._op.simpleMode?0:y(b(this._op.tailSize,0),0)}getBorderRadius(){return this._op.simpleMode?0:y(b(this._op.borderRadius,0),0)}getMarkerSize(){return this._op.listMarkerSize||10}getMarkerGap(){return b(this._op.listMarkerGap,5)}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?xt.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Ot.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}lr.defaults=Me(De.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 hr="vline",_r="hline",cr="line",dr="arrow";class ur extends ze{getImageUrl(){const t=this._op.imageUrl;if(!o(t))return t;const e=t.indexOf("::");if(e>0){const i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2),r=Number.isFinite(+s)?+s:s;return i instanceof Le?i.getImage(r):s}return t}_isVisible(){return this._op.visible&&!z(this._op.imageUrl)}_doSetSimple(t){return o(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}ur.type="image";class pr extends ze{getShape(){return this._op.shape||pr.defaults.shape}hasCustomPath(){return o(this._op.path)&&this._op.path.length>0}getHeadSize(){return this.getShape()!==dr?pr.defaults.headSize:this._headSize}_doApply(t){if(super._doApply(t),this.getShape()!==dr)return;const e=pr.defaults;this._headSize=y(1,b(t.headSize,e.headSize)),this._style=this.$_resolveArrowStyle(t)}_doSetSimple(t){return o(t)?(this._op.shape=t,!0):super._doSetSimple(t)}$_resolveArrowStyle(t){const e=this._style;if(o(e))return e;const i=s(e)?{...e}:{};return null!=t.lineWidth?i.strokeWidth=`${y(1,b(t.lineWidth,1))}px`:i.strokeWidth||i["stroke-width"]||(i.strokeWidth="1px"),i.stroke||(i.stroke="#555"),i.fill||(i.fill=i.stroke),i}}pr.type="shape",pr.defaults=Me(ze.defaults,{width:64,height:64,shape:"square",headSize:12});class gr 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 o(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?xt.getFormatter(i):T),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Ot.getFormatter(t):T)}(t.timeFormat)}}gr.type="text",gr.defaults=Me(ze.defaults,{text:"Text"});class fr extends Qe{_doInit(t){super._doInit(t),t.minorGrid=(this._minorGrid=new ni(this.axis)).init()}get minorGrid(){return this._minorGrid}getPositions(t,e){return t.hasBreak()?t._ticks.filter(e=>!t.isBreak(e.value)).map(i=>t.getPos(e,i.value)):t._ticks.map(i=>t.getPos(e,i.value))}getMinorPositions(t,e){if(!this._minorGrid.visible||t.isEmpty()||t._minorValues.length<1)return[];if(t._vlen===e&&t._minorMarkPoints.length===t._minorValues.length)return t._minorMarkPoints;const i=[];return t._minorValues.forEach(s=>{const r=t.getPos(e,s);isFinite(r)&&i.push(r)}),i}}class mr extends si{constructor(){super(...arguments),this._strictEnds=!1,this._userTicks=!1}_getValidInterval(t,e,i,s,r){if(n(e)){const n=e.call(void 0,{chart:this.chart.wrapper,length:i,minValue:t._calcedMin,maxValue:t._calcedMax,min:s,max:r});isNaN(n)||(e=n)}return e>0?e:void 0}buildSteps(t,e,i,s,o,a=!1){const l=this._op,h={chart:this.chart.wrapper,length:e,minValue:t._calcedMin,maxValue:t._calcedMax,min:s,max:o},_=this.$_getStepPixels(e,h);let c,d;return this._userTicks=this._strictEnds=!1,this._step=NaN,c=a?this._getStepsByPixels(e,b(.85*_,60),i,s,o,h):r(l.steps)||n(l.steps)||n(l.stepCallback)?this._getStepsBySteps(s,o,h):this._baseAxis instanceof vr&&this._baseAxis._ticks.length>0?this._getStepsByCount(this._baseAxis._ticks.length,i,s,o,!0):l.stepCount>1?this._getStepsByCount(l.stepCount,i,s,o,!1):null!=(d=this._getValidInterval(t,l.stepInterval,e,s,o))?this._getStepsByInterval(d,i,s,o):_>0?this._getStepsByPixels(e,_,i,s,o,h):s!==o?[s,o]:[s],c}getNextStep(t,e){return t+e*this._step}getMaxCount(t,e){return void 0===this._op.maxCount?y(8,u(t/(.9*e))+1):b(this._op.maxCount,1/0)}canUseNumSymbols(){return isNaN(this._step)||this._step>=500}_doApply(t){super._doApply(t);const e=!n(t.stepPixels)&&at.parseTuples(t.stepPixels);let s;if(this._stepPixels=e&&e.every(([,t])=>t>0)?e:void 0,i.call(t,"stepMultiples"))if(n(t.stepMultiples))s=t.stepMultiples;else{let e;if(r(t.stepMultiples)){let i=Number.MIN_SAFE_INTEGER;e=[],t.stepMultiples.forEach(t=>{!isNaN(+t)&&t>i&&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 i=this._stepPixels;if(n(i)&&(i=i.call(void 0,e)),!i){const t=this.axis;i=t._isPolar?mr.STEP_PIXELS_P:t._isX?mr.STEP_PIXELS_X:mr.STEP_PIXELS_Y}for(let e=0;e<i.length;e++)if(t<=i[e][0])return y(1,i[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 vr&&(this._baseAxis=e,e.tick._baseAxis=null)}}_normalizeMin(t,e){return t>d(t/e)*e?t=d(t/e)*e:t<u(t/e)*e&&(t=u(t/e)*e),t}_getStepsByCount(t,e,i,s,r){i>e?(i=e,e=NaN):s<e&&(s=e,e=NaN),this._strictEnds=!0;const n=this.axis,o=s-i;let a=o/(t-1);const l=Math.pow(10,Math.floor(Math.log10(a))),h=[];if(isNaN(n._fixedMin)||isNaN(n._fixedMax)?r&&a/l===2.5&&d(t*o/a)==t*o/a?this._step=a:a=this._step=u(a/l)*l:a=o/(t-1),isNaN(n._fixedMin))if(isNaN(e))i=this._normalizeMin(i,l);else{for(!function(t,e){if(!t)throw new Q(e)}(i<e&&s>e,"base error"),t=y(3,t);;){if(!(u((e-i)/a)+u((s-e)/a)+1>t))break;a+=l}i=e-u((e-i)/a)*a}else i=n._fixedMin;h.push(R(i));for(let e=1;e<t;e++)h.push(R(h[e-1]+a));return h}_getStepsByInterval(t,e,i,s){const r=[];let n;if(i=R(this._normalizeMin(i,t)),isNaN(e))for(r.push(n=i);n<s;)r.push(n=R(n+t));else{for(r.push(n=e);n>i;)r.unshift(n=R(n-t));for(n=e;n<s;)r.push(n=R(n+t))}return this._step=t,r}_getStepMultiples(t,e){var i;return(null!==(i=n(this._userMultiples)?this._userMultiples.call(void 0,e):this._userMultiples)&&void 0!==i?i:this._op.fineStep)?mr.STEP_MULTIPLES[2]:this._op.enableDecimals&&1===t?mr.STEP_MULTIPLES[0]:mr.STEP_MULTIPLES[1]}_getStepsBySteps(t,e,i){const s=this._op,o=n(s.steps)?s.steps:s.stepCallback;let a;return o?(a=o.call(void 0,i),r(a)&&!a.every(t=>!isNaN(+t))||(a=t!==e?[t,e]:[t])):a=s.steps.filter(t=>isFinite(+t)).map(t=>+t),a=a.filter(s.clipSteps?i=>i>=t&&i<=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,i,s,r,n){s>=i?s=i:r<=i&&(r=i);const o=r-s;if(0===o||t<=0)return isNaN(s)?[]:[s];const a=this.getMaxCount(t,e);let l=y(1,d(t/e))+1,h=o/(l-1);const _=function(t){return Math.pow(10,t)}(d(f(h))),c=this._getStepMultiples(_,n),p=[];let g,m=0;if(h/=_,c)if(h>c[m]){for(;m<c.length-1;m++)if(h>c[m]&&h<c[m+1]){h=h<=c[m]+(c[m+1]-c[m])/2?c[m]:c[m+1];break}}else h=c[m];for(;;){for(h*=_,(h<=0||!isFinite(h))&&(h=o/l),s=isNaN(i)?this._normalizeMin(s,h):i-u((i-s)/h)*h,this._step=h,p.push(R(g=s));g<r;)p.push(R(g+=h));if(!c||m>c.length-2||p.length<=a)break;h=c[++m],p.length=0}return p}}mr.STEP_PIXELS_P=[[300,48],[700,72],[900,96],[1/0,120]],mr.STEP_PIXELS_Y=[[130,36],[300,48],[700,72],[1/0,96]],mr.STEP_PIXELS_X=[[400,48],[900,72],[1/0,96]],mr.STEP_MULTIPLES=[[1,2,2.5,5,10],[1,2,5,10],[1,2,2.5,3,4,5,10]],mr.defaults=Me(si.defaults,{baseRange:!1,enableDecimals:!0});class yr extends oi{}yr.defaults=Me(oi.defaults,{numberFormat:"0.##"});class xr extends yr{getTick(t,e){return this._getText(null,e,"*"===this._op.useSymbols||this._op.useSymbols&&this.axis.tick.canUseNumSymbols(),!1)}}xr.defaults=Me(yr.defaults,{useSymbols:!0});class br extends Xe{getSize(t){return Math.min(.9*t,X(this._sizeDim,t))}_doApply(t){var e;super._doApply(t),this._op.space=b(this._op.space,0),this._sizeDim=W(null!==(e=this._op.size)&&void 0!==e?e:"30%",!1),this.axis._breaksChanged=!0}}br.defaults=Me(Xe.defaults,{size:"30%",space:16,gridVisible:!0});class wr extends Ue{_isVisible(){return this._op.visible}}wr.defaults=Me(Ue.defaults,{visible:!1});class vr extends _i{constructor(){super(...arguments),this._breaks=[],this._breaksChanged=!1}_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new wr(this)).init(),t.minorTick=(this._minorTick=new ri(this)).init()}get baseLine(){return this._baseLine}get break(){return this._breaks?this._breaks[0]:null}get tick(){return this._tick}get minorTick(){return this._minorTick}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,i){if(!t){if(this._isX&&this._isPolar)return 0;t=vr.PADDINGS}for(let s=0;s<t.length;s++)if(e<=t[s][0])return t[s][1]*i;return 0}_doApply(t){var e,s;super._doApply(t);const r=null!==(e=t.minPadding)&&void 0!==e?e:t.padding,n=null!==(s=t.maxPadding)&&void 0!==s?s:t.padding;let a;this._minPadPixels=NaN,o(r)&&r.endsWith("px")&&(a=parseFloat(r),isFinite(a)&&(this._minPadPixels=a)),this._maxPadPixels=NaN,o(n)&&n.endsWith("px")&&(a=parseFloat(n),isFinite(a)&&(this._maxPadPixels=a)),isNaN(this._minPadPixels)&&(this._minPaddings=at.parseTuples(r)),isNaN(this._maxPadPixels)&&(this._maxPaddings=at.parseTuples(n)),this._baseVal=+this._op.baseValue,this._strictMin=W(t.strictMin,!0),this._strictMax=W(t.strictMax,!0),i.call(t,"break")&&this.$_loadBreaks(t.break)}continuous(){return!0}isBased(){return!!this._tick._baseAxis}_createGrid(){return new fr(this)}_createTickModel(){return new mr(this)}_prepareRender(){super._prepareRender(),this._minorTick._prepareRender()}_doPrepareRender(){this._breaksChanged&&(this.$_mergeBreaks(),this._breaksChanged=!1),this._tick._findBaseAxis()}$_trim(t){let e=b(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=b(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,i){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,i,s){if(isNaN(t)||isNaN(e))return[];if(s>1&&!this._isHorz){const t=this._prevSteps;return this.$_trimSteps(t,i,s),this.$_createTicks(t,i,this._min,this._max,s)}const r=this._tick,n=r._baseAxis instanceof vr&&r._baseAxis._ticks.length>0,o=this._op;o.minValue<t&&(t=o.minValue),o.maxValue>e&&(e=o.maxValue);let{min:a,max:l}=this._adjustMinMax(i,this._calcedMin=t,this._calcedMax=e);if(n&&r.options.baseRange&&(a=r._baseAxis.axisMin(),l=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>=l)&&this._runBreaks.splice(t,1)}this._runBreaks.length>1&&(this._runBreaks.length=1),this._runBreaks.length<1&&(this._runBreaks=null)}else this._runBreaks=null;let h,_,c=!1,d=a,u=l;if(this._isX)if(a===l)this._unitLen=i/4;else{const t=this._isPolar,e=this.$_calcXUnitLength(this._isPolar?this.getTotalAngle():i,a,l);if(e){if(this._unitLen=e.len,c=!0,!this._zoom||t)if(e.min=e.min*(2*b(o.unitPadding,.5)),t){let t=o.polarMargin;isNaN(t)?t=M*e.min/(l-a+e.min):t*=B,isNaN(this._fixedMax)&&this.getTotalAngle()+t>M&&(l=this._max=Math.max(this._calcedMax+e.min,l))}else isNaN(this._fixedMin)&&(a=this._min=Math.min(this._calcedMin-e.min/2,a)),isNaN(this._fixedMax)&&(l=this._max=Math.max(this._calcedMax+e.min/2,l))}else this._unitLen=1}if(a===l)h=[a];else if(this._runBreaks)h=this.$_calcBrokenSteps(this._runBreaks,i,a,l),_=h.slice(0),a=Math.min(a,h[0]),l=Math.max(l,h[h.length-1]);else if(h=r.buildSteps(this,i,this._runBase,a,l,!1),_=h.slice(0),h.length>0){if(!isNaN(this._fixedMin)||!r._strictEnds&&"tick"!==this.$_getStartFit()){for(;h.length>1&&h[0]<d;)h.shift();h.length<2&&this._fixedMin<h[0]&&h.unshift(this._fixedMin)}else if(!r._strictEnds&&!n&&isNaN(this._minPadPixels)){for(;h.length>2&&h[1]<=d;)h.shift();if(!isNaN(r._step))for(;h[0]>d;)h.unshift(r.getNextStep(h[0],-1))}if(a=Math.min(a,h[0]),!isNaN(this._fixedMax)||!r._strictEnds&&"tick"!==this.$_getEndFit()){for(;h.length>1&&h[h.length-1]>u;)h.pop();h.length<2&&this._fixedMax>h[h.length-1]&&h.push(this._fixedMax)}else if(!r._strictEnds&&!n&&isNaN(this._maxPadPixels)){for(;h.length>2&&h[h.length-2]>=u;)h.pop();if(!isNaN(r._step))for(;h[h.length-1]<u;)h.push(r.getNextStep(h[h.length-1],1))}l=Math.max(l,h[h.length-1])}else h.push(a+(l-a)/2);this._prevSteps=h,this._setMinMax(a,l);const p=this.$_createTicks(h,i,a,l,s);if(c&&p.length>1){const t=this._isPolar;let e=!1;const i=_;let s,r;if(i[0]<=a){for(r=-1;r<h.length-1&&i[r+1]<h[0];)r++;for(;r>=0&&(s=i[r])>=a;){const t=this.dataToAxis(p[0].value),i=this.dataToAxis(p[1].value);if(s<t&&t-s>=i-t&&("tick"===this.$_getStartFit()||s>a)){const t=this._createTick(0,s);p.unshift(t),h.unshift(s),e=!0}r--}}if(i[i.length-1]>=l){for(r=i.length;r>0&&i[r-1]>h[h.length-1];)r--;for(;r<i.length&&(s=i[r])<=l;){const t=this.dataToAxis(p[p.length-1].value),i=this.dataToAxis(p[p.length-2].value);if(s>=t&&s-t>=t-i&&("tick"===this.$_getEndFit()||s<l)){const t=this._createTick(0,s);p.push(t),h.push(s),e=!0}r++}}else if(t&&l>i[i.length-1])for(;(s=h[h.length-1])<l;){const t=this.dataToAxis(p[p.length-1].value),i=this.dataToAxis(p[p.length-2].value);if(!(R(l-t)>R(t-i)))break;{const r=this._createTick(0,s+R(t-i));p.push(r),h.push(r.value),e=!0}}e&&p.forEach((t,e)=>t.index=e)}return p}$_createTicks(t,e,i,s,r){const n=[];let o=NaN;for(let e=0;e<t.length;e++){const i=this._createTick(e,t[e]);i.value!==o&&(n.push(i),o=i.value)}return n}_createTick(t,e){return{index:t,pos:NaN,value:e,label:this.label.getTick(t,e)||String(e)}}$_buildMinorValues(t){if(!isFinite(t)||t<1||this._ticks.length<2)return[];const e=this._ticks,i=[];for(let s=0;s<e.length-1;s++){const r=e[s].value,n=e[s+1].value;if(this._canInterpolateMinorSegment(r,n)&&(!this.hasBreak()||!this.isBreak(r)&&!this.isBreak(n)))for(let e=1;e<=t;e++){const s=this._interpolateMinorValue(r,n,e,t);isFinite(s)&&i.push(s)}}return i}_canInterpolateMinorSegment(t,e){return t!==e&&isFinite(t)&&isFinite(e)}_interpolateMinorValue(t,e,i,s){return R(t+(e-t)*i/(s+1))}_calcPoints(t,e){super._calcPoints(t,e),this._minorTick.visible||this.grid.minorGrid.visible?this.$_calcMinorPoints(t):(this._minorValues=[],this._minorMarkPoints=[]),this._markPoints=this._ticks.map(t=>t.pos)}$_calcMinorPoints(t){const e=this.$_buildMinorValues(this._minorTick._getCount()),i=[],s=[];e.forEach(e=>{const r=this.getPos(t,e);isFinite(r)&&(i.push(e),s.push(r))}),this._minorValues=i,this._minorMarkPoints=s}$_buildBrokenSteps(t){return this._tick.buildSteps(this,t.len,void 0,t.from,t.to,!0)}$_calcBrokenSteps(t,e,i,s){let r=0,n=i;const o=[n],a=this._sects=[],l=e-t.reduce((t,e)=>t+e.options.space,0);t.forEach(t=>{const e=t.options,i=t.getSize(l),s=Math.max(0,e.space||0),h={from:n,to:t.options.from,pos:r,len:i};r+=i,a.push(h,t._sect={from:e.from,to:e.to,pos:r,len:s}),r+=s;this.$_buildBrokenSteps(h).forEach(t=>{t>h.from&&t<=h.to&&o.push(t)}),s>0&&o.push(e.to)});const h=t[t.length-1];if(s>h.options.to){const t={from:h.options.to,to:s,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 i;if(this._runBreaks){const s=this._sects.find(t=>e<t.to)||this._lastSect,r=s.len*(e-s.from)/(s.to-s.from);i=this._op.reversed?$(t-r-s.pos):$(r+s.pos)}else{let s=this._single?.5*t:t*(e-this._min)/(this._max-this._min);this._op.reversed&&(s=t-s,isNaN(this._prevRate)||(s+=this._prevSize-t)),i=$(s)}return this._ani?this._ani.getPos(i,this._op.reversed):i}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 i of this._sects){if(e>=t&&e<t+i.len)return(i.to-i.from)*(e-t)/i.len+i.from;t+=i.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}$_resolveFit(t){return"tick"===t||"value"===t?t:this._isX&&!this._isPolar?"value":"tick"}$_getStartFit(){return this.$_resolveFit(this._op.startFit)}$_getEndFit(){return this.$_resolveFit(this._op.endFit)}$_calcStrict(t,e,i){if(t)return t.fixed?t.size:i<0?e-X(t,i):e+X(t,i)}_adjustMinMax(t,e,i){const s=this._isLog();let r,n=this.isZoomed(),o=this.isZoomed(),a=!0,h=!0,_=NaN,c=NaN,u=1;if(this._series.length>0){let t,d=0;this._series.forEach(t=>{isNaN(t._sBase=t.getBaseValue(this))||d++,u=y(u,t.getAxisPadRate())}),!this._isX&&d>0&&d<this._series.length&&(r={},this._series.forEach(t=>{const e=t._type();r[e]?r[e]=[m(t._yMin,r[e][0]),y(t._yMax,r[e][1])]:r[e]=[t._yMin,t._yMax]})),this._series.forEach(r=>{let d=r._sBase;l(d)&&!isNaN(d)&&(d=R(d),s?d>=0&&d<=e&&d<=i&&(e=t=d):d<=e?r.isBased(this)?e=t=d:_=b(m(_,d),d):d>=i&&(r.isBased(this)?i=t=d:c=b(y(c,d),d))),a&&!n&&(s||r.canMinPadding(this,e,t))&&(a=!1),h&&!o&&(s||r.canMaxPadding(this,i,t))&&(h=!1)})}else a=n,h=o;n||(n=a),o||(o=h),this._fixedMin=this._fixedMax=NaN;const p=y(0,i-e),g=this.$_calcStrict(this._strictMin,e,-p),f=this.$_calcStrict(this._strictMax,i,p);let x=NaN,w=NaN,v=0,S=0;isNaN(g)?n?this._fixedMin=e:isNaN(this._minPadPixels)?v=this.$_getPadding(this._minPaddings,t,u):x=this._minPadPixels:this._fixedMin=e=g,isNaN(f)?o?this._fixedMax=i:isNaN(this._maxPadPixels)?S=this.$_getPadding(this._maxPaddings,t,u):w=this._maxPadPixels:this._fixedMax=i=f;let V=e,C=i;if(r){for(const t in r){const e=r[t][0]-(r[t][1]-r[t][0])*v;e<V&&(V=e)}for(const t in r){const e=r[t][1]+(r[t][1]-r[t][0])*S;e>C&&(C=e)}}else V-=p*v,C+=p*S;if(!isNaN(x)||!isNaN(w)){isNaN(x)&&(x=0),isNaN(w)&&(w=0);const e=Math.min(x+w,.9*t),i=p-d(p*(t-e)/t),s=Math.round(i*x/e);V-=s,C+=i-s}return!isNaN(_)&&_<=e&&V<_&&(V=this._fixedMin=_),!isNaN(c)&&c>=i&&C>c&&(C=this._fixedMax=c),C=y(C,V),{min:V,max:C}}$_calcXUnitLength(t,e,i){const s=[];let r=0;if(this._series.forEach(t=>{t.visible&&t.isClusterable()&&(s.push(...t._getVisiblePoints()),r++)}),0===r&&this._series.forEach(t=>{t.visible&&!t.isXY()&&s.push(...t._getVisiblePoints())}),s.length>0){const r=s.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,i)}}_calcUnitLen(t,e,i,s){if(t.length<2){if(this._ticks.length>0){const t=(s-i)/Math.max(8,this._ticks.length);return{len:b(e*=t/(s-i+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=m(n,t[e]-t[e-1]);return r*=n/(s-i+n),isFinite(r)||(r=e/2),{len:b(r,1),min:n}}}$_loadBreak(t){if(s(t)&&"from"in t&&"to"in t){const e=new br(this),i={...t};return i.from=this.getValue(i.from),i.to=this.getValue(i.to),!isNaN(i.from)&&!isNaN(i.to)&&i.from>i.to&&([i.from,i.to]=[i.to,i.from]),this._doApplyBreak(i),e.init(),e._load(i),isNaN(i.from)||isNaN(i.to)?null:e}}_doApplyBreak(t){}$_loadBreaks(t){if(r(t))for(let e of t){const t=this.$_loadBreak(e);t&&this._breaks.push(t)}else if(t){const e=this.$_loadBreak(t);e&&this._breaks.push(e)}this._breaksChanged=!0,this.$_mergeBreaks()}$_mergeBreaks(){function t(t,e){return e.options.from<t.options.to}function e(t,e){t.options.to=e.options.to}const i=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,i.length>0){const s=this._mergedBreaks=[];s.push(c(new br(this)._initObject(),i[0]));for(let r=1;r<i.length;r++){const n=s[s.length-1],o=i[r];t(n,o)?e(n,o):s.push(c(new br(this)._initObject(),o))}}}}vr.PADDINGS=[[170,.2],[300,.1],[700,.05],[1/0,.03]],vr.defaults=Me(_i.defaults,{baseValue:0,startFit:"default",endFit:"default",unitPadding:.5});class Sr extends vr{get label(){return this._label}_createLabel(){return new xr(this)}_adjustMinMax(t,e,i){const s=super._adjustMinMax(t,e,i),r=this._series;return!this._isX&&1===r.length&&r[0]instanceof qs&&"fill"===r[0].options.layout&&(s.max=r[0].getLayoutMax()),s}}Sr.type="linear";const Vr=[1,1e3,6e4,36e5,864e5,6048e5,24192e5,314496e5],Cr=[[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]],Ar={s:1,n:2,h:3,d:4,w:5,m:6,y:7};class Pr extends mr{getNextStep(t,e){const i=new Date(t);switch(e*=this._step,this._scale){case 7:i.setFullYear(i.getFullYear()+e);break;case 6:i.setMonth(i.getMonth()+e);break;case 5:i.setDate(i.getDate()+7*e);break;case 4:i.setDate(i.getDate()+e);break;case 3:i.setHours(i.getHours()+e);break;case 2:i.setMinutes(i.getMinutes()+e);break;case 1:i.setSeconds(i.getSeconds()+e);break;case 0:i.setMilliseconds(i.getMilliseconds()+e)}return+i}_getValidInterval(t,e,i,s,r){if(n(e)){const n=e.call(void 0,{chart:this.chart.wrapper,length:i,minValue:t._calcedMin,maxValue:t._calcedMax,min:s,max:r});null!=n&&(e=n)}if(!isNaN(e))return+e>0?+e:NaN;if(o(e)&&Ar.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>=Vr[e]/2&&t<Vr[e+1]/2)return this._scale=e,Cr[e];this._scale=7}_getStepsByPixels(t,e,i,s,r){const n=[],o=r-s;if(0===o)return n;const a=this.axis,l=new Date(a._calcedMin);let h=Math.floor(t/e)+1,_=y(1,Math.floor(o/(h-1)));const c=this._getStepMultiples(_),d=Vr[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(s),p=a.date(r);let g,f=u;if(7===this._scale){const t=l.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<l&&new Date(t,e+_)>l&&(e=l.getMonth(),f=new Date(l.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(),i=f.getDate();const s=5===this._scale?7:1;this._step=_=Math.ceil(_),f=new Date(t,e,i),f<l&&new Date(t,e,i+s*_)>l&&(i=l.getDate(),f=new Date(l.getFullYear(),l.getMonth(),i));do{n.push(+f),f.setDate(f.getDate()+_*s)}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=l.getTime();g<t&&g+_>t&&(g=t);do{n.push(g),g+=_}while(g<=r)}return n}_getStepsByInterval(t,e,i,s){if(o(t)){const r=this.axis,n=new Date(r._calcedMin),o=[],a=t.charAt(t.length-1),l=parseFloat(t);let h,_;this._scale=Ar[a],t=Vr[this._scale];let c=new Date(i);switch(this._scale){case 7:const t=n.getFullYear();let e=c.getFullYear();c.setMonth(0,1),e<t&&t<e+l&&(c=new Date(t,0));break;case 6:c.setDate(1),c.setHours(0,0,0,0),_=new Date(c),_.setMonth(_.getMonth()+l),c<n&&n<_&&(c=new Date(n),c.setDate(1),c.setHours(0,0,0,0));break;case 5:case 4:let i=5===this._scale?7:1;c.setHours(0,0,0,0),_=new Date(c),_.setDate(_.getDate()+l*i),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=l,i=+c,isNaN(e))for(o.push(h=i);h<s;)o.push(h=this.getNextStep(h,1));else{for(o.push(h=e);h>i;)o.unshift(h=this.getNextStep(h,-1));for(h=e;h<s;)o.push(h=this.getNextStep(h,1))}return this._step=t,o}return super._getStepsByInterval(t,e,i,s)}_getStepsBySteps(t,e,i){const s=super._getStepsBySteps(t,e,i);if(s.length>=2){const t=(s[s.length-1]-s[0])/(s.length-1);this._getStepMultiples(t)}else this._getStepMultiples(Vr[4]);return s}buildSteps(t,e,i,s,r,n=!1){const o=super.buildSteps(t,e,i,s,r,n);if(void 0===this._scale&&o.length>=2){const t=(o[o.length-1]-o[0])/(o.length-1);this._getStepMultiples(t)}return o}}const kr=[{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 Lr extends yr{_doApply(t){super._doApply(t);const e=o(t.timeFormat)?t.timeFormat:void 0,i=o(t.beginningFormat)?t.beginningFormat:void 0,n=t.timeFormats,l=t.useBeginningFormat;if(this._formats=kr.map(t=>c(t)),e&&this._formats.forEach(t=>{t.format=t.beginningFormat=e}),l&&i&&this._formats.forEach(t=>{t.beginningFormat=i}),r(n))for(let t=0;t<n.length;t++){const e=this._formats[t],i=n[t];a(i)?e.format=i:s(i)&&(a(i.format)&&(e.format=i.format),l&&a(i.beginningFormat)&&(e.beginningFormat=i.beginningFormat))}}getTick(t,e){const i=this.chart,s=this.axis,r=s.date(e);let n;if(this._formatter)n=this._formatter.toStr(r,i.startOfWeek);else{const e=this._formats,o=s.tick._scale,a=Ot.getFormatter;switch(o){case 7:n=a(e[o].format).toStr(r,i.startOfWeek);break;case 6:n=0===t||0===r.getMonth()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 5:case 4:n=0===t||1===r.getDate()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 3:n=0===t||0===r.getHours()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 2:n=0===t||0===r.getMinutes()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 1:n=0===t||0===r.getSeconds()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek);break;case 0:n=0===t||0===r.getMilliseconds()?a(e[o].beginningFormat).toStr(r,i.startOfWeek):a(e[o].format).toStr(r,i.startOfWeek)}}return this._getText(n,null,!1,!1)}}Lr.defaults=Me(yr.defaults,{useBeginningFormat:!0});class Tr extends vr{get label(){return this._label}_createTickModel(){return new Pr(this)}_createLabel(){return new Lr(this)}_prepare(){this._dateClass=this.chart.win.Date,super._prepare()}_doBuildTicks(t,e,i,s){return isNaN(t)||t!==e||(this._tick._scale=this.$_inferScale(t)),super._doBuildTicks(t,e,i,s)}collectValues(){this._offset=60*b(this.chart.timeOffset,0)*1e3,super.collectValues()}getBaseValue(){const t=this._op.baseValue;return l(t)?t:o(t)?new Date(t).getTime()+b(this._offset,0):NaN}getValue(t){return l(t)?t:t instanceof this._dateClass?t.getTime():o(t)?new Date(t).getTime()+this._offset:void 0}incStep(t,e){if(o(e)){const i=parseFloat(e);if(0!=i){let s=new Date(t);switch(e.charAt(e.length-1)){case"y":s.setFullYear(s.getFullYear()+i);break;case"m":s.setMonth(s.getMonth()+i);break;case"d":s.setDate(s.getDate()+i);break;case"w":s.setDate(s.getDate()+7*i);break;case"h":s.setHours(s.getHours()+i);break;case"n":s.setMinutes(s.getMinutes()+i);break;case"s":s.setSeconds(s.getSeconds()+i)}return+s}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)}$_inferScale(t){const e=this.date(t);return 0!==e.getMilliseconds()?0:0!==e.getSeconds()?1:0!==e.getMinutes()?2:0!==e.getHours()?3:4}}Tr.type="time",Tr.subtype="date",Tr.defaults=Me(vr.defaults,{baseValue:NaN});class Nr extends us{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Mr extends Zs{pointLabelCount(){return 2}_createLegendMarker(t,e){return Xi.create(t,Ds.LEGEND_MARKER,0,0,e,e,2)}_getFielderProps(){return["lowField"].concat(super._getFielderProps())}_createPoint(t){return new Nr(t)}_getBottomValue(t){return t.lowValue}}Mr.type="barrange",Mr.defaults=Me(Zs.defaults,{tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Er extends _s{_readObject(t,e){super._readObject(t,e),this.width=e.width}}class Br extends Xs{canCategorized(){return!0}_colorByPoint(){return this._op.colorByPoint}_createPoint(t){return new Er(t)}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Br.defaults=Me(Xs.defaults,{colorByPoint:!1,pointOffset:0});class Dr extends Br{canDepth(){return!0}_createLegendMarker(t,e){return Xi.create(t,Ds.LEGEND_MARKER,0,0,e,e,2)}get canPolar(){return!0}}Dr.type="bar";class Or extends Qs{canCategorized(){return!0}getBaseValue(t){return t===this._yAxisObj?S(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=b(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 i=0;t.forEach(t=>{t._childWidth=t.options.pointWidth/e,t._childPos=i,i+=t._childWidth})}if("overlap"===e){let e=this.getDistance();t.forEach(t=>{t._groupDistance=e+=b(t.options.distance,0),e+=t.depth})}else t.forEach(t=>{t._groupDistance=t.distance})}}Or.defaults=Me(Qs.defaults,{depth:10,distance:5});class Rr extends Or{_canContain(t){return t instanceof Dr}}Rr.type="bargroup",Rr.seriesType="bar";class $r extends Jt{constructor(t){super(t,Ds.LEGEND_MARKER),this.add(this._back=new Xi(t)),this._back.setStyle("visibility","hidden"),this.add(this._marker=new ne(t))}render(t,e){const i=Math.max(8,2*e),s=2.1*i;t===this._shape&&e===this._rd&&i===this._size||(this._shape=t,this._rd=e,this._size=i,this._back.resize(1,i),this._renderShape(e,s,i),this._marker.trans(s/2-e,i/2-e))}_renderShape(t,e,i){Yi.setShape(this._marker,this._shape,t,t)}}class Ir extends $r{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,i){const s=["M",0,i/2,"L",e,0],r=["M",0,i/2,"L",e,0,"L",e,i,"L",0,i,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(s.join(" ")),this._area.setPath(r.join(" "))),super._renderShape(t,e,i)}}class Fr extends $r{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,i){const s=["M",0,.3*i,"L",e/2*.7,0,"L",e,.4*i],r=["M",0,i,"L",e/2,.7*i,"L",e,i],n=["M",0,.3*i,"L",e/2*.7,0,"L",e,.4*i,"L",e,i,"L",e/2,.7*i,"L",0,i,"Z"];this._marker.setStyle("visibility",this._shape?"visible":"hidden"),this._line&&(this._line.setPath(s.join(" ")),this._line2.setPath(r.join(" ")),this._area.setPath(n.join(" "))),super._renderShape(t,e,i)}}class zr extends ne{constructor(t,e=T,i=T){super(t,e),i&&this.setLine(i)}setLine(t,e,i,s){at.isNumber(t)?this.setPath(Yi.line(t,e,i,s)):t&&this.setPath(Yi.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(Yi.line(t,e,t,i))}setVLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(Yi.line(t,e,t,i))}setHLine(t,e,i){this.setPath(Yi.line(e,t,i,t))}setHLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(Yi.line(e,t,i,t))}}class Hr extends $r{constructor(t){super(t),this.insertFirst(this._line=new zr(t))}_renderShape(t,e,i){this._line&&(this._line.setHLine(i/2,0,e),this._shape&&this._line.setStyle("strokeDasharray","")),this._marker.setStyle("visibility",this._shape?"visible":"hidden"),super._renderShape(t,e,i)}}class Gr extends _s{toPoint(){return{px:this.px,py:this.py,isNull:this.isNull,range:this.range}}}class jr extends $s{}jr.defaults=Me($s.defaults,{radius:4,hoverScale:1.75});class Wr extends $s{constructor(t){super(t),this.series=t}getPosition(){return v(this._op.position,Wr.defaults.position)}getShape(){return v(this._op.shape,Wr.defaults.shape)}getRadius(){return w(NaN,this._op.radius,Wr.defaults.radius)}getRotation(){return v(this._op.rotation,Wr.defaults.rotation)}getArrowStyleOverrides(t){const e=Wr.STYLE_ISOLATION,i={};return o(t)?(i.stroke=e.stroke,i.strokeWidth=e.strokeWidth,i):(s(t)&&null==t.strokeDasharray&&(i.strokeDasharray=e.strokeDasharray),i)}getArrowStyle(t){const e=t&&this.getMarkerStyle(t);return e?s(e)?this.$_applyStyleIsolation(c({},e)):e:this._runStyle||this.$_buildRunStyle()}buildArrowSlots(t){if(!this.visible||t.length<2)return[];let e=-1,i=-1;for(let s=0;s<t.length;s++)t[s].isNull||(e<0&&(e=s),i=s);if(e<0||i<0||e===i)return[];switch(this.getPosition()){case"start":return[{index:e,at:"start"}];case"both":return[{index:e,at:"start"},{index:i,at:"end"}];default:return[{index:i,at:"end"}]}}calcAutoAngle(t,e,i){const s=this.series.getLineType(),r=v(this.series.options.stepDir,"forward"),n=this.$_neighborIndex(t,e,-1),o=this.$_neighborIndex(t,e,1);return"end"===i?n<0?0:this.calcSegmentAngle(t[n],t[e],s,r,"end"):o<0?0:this.calcSegmentAngle(t[e],t[o],s,r,"start")}calcSegmentAngle(t,e,i,s,r){let n=0,o=0;if("step"===i)switch(s){case"backward":"start"===r?(n=0,o=e.py-t.py):(n=e.px-t.px,o=0);break;case"center":"start"===r?(n=(t.px+e.px)/2-t.px,o=0):(n=e.px-(t.px+e.px)/2,o=0);break;default:"start"===r?(n=e.px-t.px,o=0):(n=0,o=e.py-t.py)}else n=e.px-t.px,o=e.py-t.py;return 0===n&&0===o?0:Math.atan2(o,n)*D+90}calcArrowAngle(t,e,i){const s=this.getRotation();if("auto"===s||"auto-reverse"===s){let r=this.calcAutoAngle(t,e,i);return"auto-reverse"===s&&(r+=180),r}return b(+s,0)}_doPrepareRender(t){this._runStyle=this.$_buildRunStyle()}$_buildRunStyle(){const t=this._op.style;if(o(t))return t;const e=c({},s(t)?t:{});return e.fill||(e.fill=this.series._runColor),this.$_applyStyleIsolation(e)}$_applyStyleIsolation(t){return null==t.stroke&&(t.stroke=Wr.STYLE_ISOLATION.stroke),t.stroke===Wr.STYLE_ISOLATION.stroke&&null==t.strokeWidth&&(t.strokeWidth=Wr.STYLE_ISOLATION.strokeWidth),t}$_neighborIndex(t,e,i){for(let s=e+i;s>=0&&s<t.length;s+=i)if(!t[s].isNull)return s;return-1}}Wr.defaults=Me($s.defaults,{visible:!1,shape:"triangle",radius:6,rotation:"auto",position:"end"}),Wr.STYLE_ISOLATION={stroke:"none",strokeDasharray:"",strokeWidth:""};class Yr extends Ps{getAlignOffset(){const t=+this._op.alignOffset;return isNaN(t)?"left"===this._op.align||"right"===this._op.align?Yr.ALIGN_GAP:0:t}getPosition(){return v(this._op.position,"default")}}Yr.ALIGN_GAP=4,Yr.defaults=Me(Ps.defaults,{align:"center"});class Xr extends Rs{_doInit(t){super._doInit(t),t.marker=(this._marker=new jr(this)).init()}get marker(){return this._marker}getShape(t){return this.marker.visible?t&&t.shape||this._shape:null}getRadius(t){return w(t.radius,this.marker.options.radius,jr.defaults.radius)}buildLines(t){return this._lines||(this._lines=this._doBuildLines(t,this.getDropPoints())),this._lines}get pointLabel(){return this._pointLabel}_createLabel(t){return new Yr(t)}_createPoint(t){return new Gr(t)}hasShape(){return!0}setShape(t){this._shape=this.marker.options.shape||t}_defViewRangeValue(){return"x"}_createLegendMarker(t,e){return new Hr(t)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.render(this.getShape(null),m(e/2,this.marker.options.radius)),i}_doPrepareRender(){super._doPrepareRender(),this._lines=null}_needAddAnimation(){return!1}_connectNulls(){return!1}_doBuildLines(t,e){const i=t.length,s=[];if(this.chart.isPolar()||!this._containsNull||this._connectNulls()){const e=t.slice();s.push(e)}else{let e=0;for(;e<i;){const r=[];for(;e<i&&t[e].isNull;)e++;for(;e<i&&!t[e].isNull;)r.push(t[e++]);r.length>0&&s.push(r)}}if(e){const t=[],i=[];e.forEach(e=>{e._getDrop()<0?t.push(e):e._getDrop()>0&&i.push(e)}),t.length>0&&(t.sort((t,e)=>t.xValue-e.xValue),s[0].unshift(...t)),i.length>0&&(i.sort((t,e)=>e.xValue-t.xValue),s[s.length-1].push(...i))}return s}}Xr.defaults=Me(Ds.defaults,{nullAsBase:!1});class Ur extends $e{constructor(t){super(t.chart),this.series=t}label(){const t=this._op.text||this.series.displayName();return this._getText(t,null,!1,!1)}getDefaultIconPos(){return"left"}}Ur.defaults=Me($e.defaults,{visible:!1,offset:8});class Zr extends Xr{_doInit(t){super._doInit(t),t.flag=(this._flag=new Ur(this)).init(),t.arrow=(this._arrow=new Wr(this)).init()}get flag(){return this._flag}get arrow(){return this._arrow}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 sn||this._group instanceof rn?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=S(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(),this.arrow._prepareRender()}_getGroupBase(){return this._group?this._group.getBaseValue(this._yAxisObj):this._op.baseValue}}Zr.type=ss,Zr.defaults=Me(Xr.defaults,{lineType:"default",stepDir:"forward",connectNullPoints:!1,baseValue:void 0});class qr extends Zr{get canPolar(){return!0}_viewType(){return"line"}getLineType(){return"spline"}}qr.type="spline";class Kr extends Gr{}class Qr extends Zr{_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 i=t[t.length-1].toPoint();i.py=t[t.length-1].yLow,e.push(i),i=t[0].toPoint(),i.py=b(t[0].yLow,t[0].py),e.push(i)}return e}const e=this._group,i=this._lines,s=this._areas=[];if(e&&e._stacked){const e=[].concat(...i);s.push(e),s.push(t(e))}else i.forEach(e=>{const i=e.slice(0);s.push(i),s.push(t(i))})}_createLegendMarker(t,e){return new Ir(t)}_createPoint(t){return new Kr(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,i=[];let s=0;for(;s<e;){const r=t[s].isNull,n=[];do{n.push(t[s++])}while(s<e&&t[s].isNull==r);i.push(n)}return i}return super._doBuildLines(t,e)}}Qr.type=rs,Qr.defaults=Me(Xr.defaults,{});class Jr extends Kr{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 c(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 i=t.options,s=e.length>2?1:0;this.low=e[b(i.lowField,0+s)],this.y=e[b(i.yField,1+s)],s>0&&(this.x=e[b(i.xField,0)])}_readObject(t,e){super._readObject(t,e),this.isNull||(this.low=v(e[t.options.lowField],e.low),this.y=S(t._yFielder(e),e.y,e.value))}_readSingle(t){super._readSingle(t),this.low=this.y}parse(t){super.parse(t),this.isNull||(this.isNull=isNaN(this.lowValue))}initValues(){this.lowValue=parseFloat(this.low)}initPrev(t,e){e.yValue=e.lowValue=this.lowValue}applyValueRate(t,e){this.lowValue=V(t.lowValue,this.lowValue,e)}}class tn extends Yr{getPosition(){return"default"===this._op.position||null==this._op.position?"foot":this._op.position}}class en extends Xr{pointLabelCount(){return 2}_createLabel(t){return new tn(t)}_createLegendMarker(t,e){return new Fr(t)}_createPoint(t){return new Jr(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 i=super._doBuildLines(t,e),s=[];return i.forEach(t=>{const e=[];for(let i=t.length-1;i>=0;i--){const s=t[i],r=s.toPoint();r.py=s.yLow,e.push(r)}s.push(t,e)}),s}}en.type="arearange",en.defaults=Me(Xr.defaults,{curved:!1,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class sn extends qs{_canContain(t){return t instanceof Zr}getBaseValue(t){return t===this._yAxisObj?S(this._op.baseValue,t.getBaseValue(),0):NaN}}sn.type="linegroup",sn.seriesType=ss,sn.defaults=Me(qs.defaults,{lineType:"default"});class rn extends qs{prepareLines(t){if(this._stacked){const e=this._visibles.indexOf(t);if(e>0){const i=this._visibles[e-1],s=t._areas,r=i._areas;for(let t=0;t<s.length;t+=2)s[t+1]=r[t].reverse();this._op.layout}}}_canContain(t){return t instanceof Qr}getBaseValue(t){return t===this._yAxisObj?S(this._op.baseValue,t.getBaseValue(),0):NaN}}rn.type="areagroup",rn.seriesType=rs,rn.defaults=Me(qs.defaults,{lineType:"default"});class nn extends Kr{}class on extends Qr{get canPolar(){return!1}isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new nn(t)}_doLoadData(t){const e=super._doLoadData(t);if(r(e))return this._loadTable(e)}_referOtherSeries(t){if(this._points.isEmpty()&&(t.options.name===this._op.source||t.index===this._op.source))return(this._refer=t).referBy(this),!0}refer(t,e){if(!e._isX){const e=t._visPoints.map(t=>t.yValue).filter(t=>!isNaN(t)),i=this._loadTable(e);this._doLoadPoints(i),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,i){const s=i-t;return{x:i,y:Math.exp(-s*s/(2*e*e))/(e*Math.sqrt(2*Math.PI))}},i=t.length;if(i<1)return;const s=this._op,r=t.reduce((t,e)=>t+e,0)/i,n=Math.sqrt(t.reduce((t,e)=>t+Math.pow(e-r,2))/(i-1)),o=n/s.pointsInSigma,a=r-s.sigmas*n,l=r+s.sigmas*n;let h=r;const _=[];for(_.push(e(r,n,h));h>a;)h-=o,_.unshift(e(r,n,h));for(h=r;h<l;)h+=o,_.push(e(r,n,h));return _}}on.type="bellcurve",on.defaults=Me(Qr.defaults,{sigmas:3,pointsInSigma:5,curved:!0});class an extends _s{get max(){return this.y}get maxValue(){return this.yValue}labelCount(){return 2}getPointLabel(t){return 0===t?super.getPointLabel(t):this.minValue}getPointText(t){return 0===t?super.getPointText(t):this.minLabel}_assignTo(t){return c(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 i=t.options,s=e.length>5?1:0;s>0&&(this.x=e[b(i.xField,0)]),this.min=e[b(i.minField,0+s)],this.low=e[b(i.lowField,1+s)],this.mid=e[b(i.midField,2+s)],this.high=e[b(i.highField,3+s)],this.y=e[w(i.maxField,t.options.yField,4+s)]}}_readObject(t,e){super._readObject(t,e);const i=t.options;this.min=v(e[i.minField],e.min),this.low=v(e[i.lowField],e.low),this.mid=v(e[i.midField],e.mid),this.high=v(e[i.highField],e.high),this.y=v(e[i.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 Zs{pointLabelCount(){return 2}canCategorized(){return!0}_getFielderProps(){return["minField","lowField","midField","highField"].concat(super._getFielderProps())}_createPoint(t){return new an(t)}_getBottomValue(t){return t.minValue}_createLegendMarker(t,e){return Xi.create(t,Ds.LEGEND_MARKER,0,0,e,e,2)}}ln.type="boxplot",ln.defaults=Me(Zs.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 hn extends ne{constructor(t,e,i){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,i&&this._assignShape(i,!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 Yi.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 Yi.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 _n=2*Math.PI,cn=-Math.PI/2;class dn extends Jt{constructor(t){super(t,Ds.LEGEND_MARKER),this._sectors=[],this.add(this._back=new Xi(t)),this._back.setStyle("visibility","hidden")}setColorResolver(t){this._colorResolver=t}setColor(t){this._colorResolver&&this._applyColors(this._colorResolver())}render(t,e,i){if(this._size===t&&this._sectors.length===e)return void this._applyColors(i);this._size=t;const s=t/2,r=s,n=s;this._back.setBounds(0,0,t,t),this._sectors.forEach(t=>t.remove()),this._sectors=[];const o=_n/e;let a=cn;for(let t=0;t<e;t++){const t={cx:r,cy:n,rx:s,ry:s,start:a,angle:o,clockwise:!0},e=new hn(this.doc,null,t);e.setStroke("none"),this.add(e),this._sectors.push(e),a+=o}this._applyColors(i)}_applyColors(t){for(let e=0;e<this._sectors.length;e++){const i=t&&t[e]||"#ccc";this._sectors[e].setFill(i)}}}class un{get color(){return this.legendColor()}get series(){var t;return null===(t=this._pie)||void 0===t?void 0:t.parentSeries}get pie(){return this._pie}get sliceCount(){return this._sliceCount}get visible(){return this._visible}set visible(t){var e;this._visible!==t&&(this._visible=t,null===(e=this._pie.chart)||void 0===e||e._visibleChanged(this._pie))}legendMarker(){return this._legendMarker}setLegendMarker(t){this._legendMarker=t}legendColor(){if(this._explicitColor)return this._explicitColor;return`var(--color-${(this._pie._paletteOffset+this.index)%Bs+1})`}legendStroke(){return null}legendLabel(){return this.label}legendKey(){const t=this._pie.parentSeries.options.legendKey;return(t||this._pie.hash)+":"+this.field}isEmpty(){return!1}getParam(t){return"name"===t?this.label:this[t]}}class pn{get field(){return this.source.field}get label(){return this.source.label}get index(){return this.source.index}getParam(t){var e;return null!==(e=this[t])&&void 0!==e?e:this.source.getParam(t)}}class gn extends ds{}class fn extends De{get fields(){return this._fields}get categories(){return this._categories}get colors(){return this._sliceColors}get hasExplicitColors(){return this._sliceColors.length>0}get startRad(){return this._startRad}get totalRad(){return this._totalRad}get clockwise(){return this._clockwise}get innerRadiusDim(){return this._innerRadiusDim}get visibleInLegend(){return!0===this._op.visibleInLegend}get parentSeries(){return this._parentSeries}_setParentSeries(t){this._parentSeries=t}get _paletteOffset(){const t=this._parentSeries;if(!t)return 0;const e=t.chart._getSeries()._internalSeries();let i=0;for(const s of e){if(s===t)break;s instanceof mn&&s.pie&&s.pie.fields.length>0&&(i+=s.pie.fields.length)}return i}getLegendSources(){return this._legendSources}isFieldVisible(t){const e=this._legendSources;return!e||!e[t]||!1!==e[t].visible}calcSlices(t){const e=this._fields;if(!e||0===e.length||!t)return null;const i=[];for(let s=0;s<e.length;s++){if(!this.isFieldVisible(s))continue;const r=this._getFieldValue(t,e[s]),n=l(r)&&r>0?r:0;n>0&&i.push({index:s,value:n})}if(0===i.length)return null;const s=i.reduce((t,e)=>t+e.value,0);if(s<=0)return null;const r=this._sliceColors,n=this._clockwise?1:-1,o=this._totalRad;let a=this._startRad;const h=[];for(let t=0;t<i.length;t++){const e=i[t],l=n*(e.value/s)*o,_=this._legendSources[e.index];if(_){const t=new pn;t.source=_,t.value=e.value,t.percent=Math.round(e.value/s*1e4)/100,t.startAngle=a,t.angle=l,t.color=r.length>0?r[e.index%r.length]:null,h.push(t)}a+=l}return h}resolveSliceColors(t){if(!t||this._sliceColors.length>0)return;const e=this._paletteOffset;for(let i=0;i<t.length;i++)t[i].color=`var(--color-${(e+t[i].index)%Bs+1})`}getLegendSliceColors(){const t=this._fields.length,e=this._sliceColors,i=[],s=this._paletteOffset;for(let r=0;r<t;r++)i.push(e.length>0?e[r%e.length]:`var(--color-${(s+r)%Bs+1})`);return i}getInnerRadius(t){const e=this._innerRadiusDim;return e?e.size/(e.fixed?t:100):0}_doSetSimple(t){return h(t)?(this._op.visible=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._fields=(t.fields||[]).map(t=>String(t)),this._categories=r(t.categories)&&t.categories.length>0?t.categories:this._fields;const e=t.colors;r(e)?this._sliceColors=e:o(e)?e.endsWith("@pal")||e.endsWith("@palette")?this._sliceColors=this.chart.getPaletteColors(e.split("@")[0])||[]:this._sliceColors=this.chart.getPaletteColors(e)||[]:this._sliceColors=[],this._startRad=E+B*b(t.startAngle%360,0);const i=b(t.totalAngle,360);this._totalRad=B*y(0,m(360,i<=0?360:i)),this._clockwise=!1!==t.clockwise,t.innerRadius?this._innerRadiusDim=W(t.innerRadius,!0):this._innerRadiusDim=null,this._buildLegendSources()}_buildLegendSources(){const t=this._legendSources,e=this._fields,i=this._sliceColors,s=this._categories,r=e.length;this._legendSources=e.map((e,n)=>{const o=i.length>0?i[n%i.length]:null,a=null==t?void 0:t.find(t=>t.legendKey()===this.hash+":"+e),l=new un;return l._pie=this,l.field=e,l.label=s[n]||e,l.index=n,l._sliceCount=r,l._explicitColor=o,l._visible=!a||a.visible,l})}_getFieldValue(t,e){if(t)return t[r(t)?+e:e]}}fn.defaults=Me(De.defaults,{startAngle:0,totalAngle:360,clockwise:!0,visibleInLegend:!1,tooltipText:"${label}: ${value} (${percent}%)"});class mn extends Js{_doInit(t){super._doInit(t),t.pie=(this._pie=new fn(this.chart)).init(),this._pie._setParentSeries(this)}get pie(){return this._pie}get pieLegendMarker(){return this._pieLegendMarker}getShape(){return this._op.shape||"circle"}getPixelMinMax(t){return{min:X(this._minSizeDim,t),max:X(this._maxSizeDim,t)}}getRadius(t,e,i){let s=this._noSize?1:(t-this._zMin)/(this._zMax-this._zMin);return"area"==this._op.sizeMode&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getTooltipText(t,e){const i=this._hoveredSlice;if(i&&this._pie){const t=this._pie.options;let s;return t.tooltipCallback&&(this._getPointCallbackArgs(this._pointArgs,e),this._pointArgs.slice=i,s=t.tooltipCallback(this._pointArgs)),void 0===s&&(s=t.tooltipText||"${label}: ${value} (${percent}%)"),s}return super.getTooltipText(t,e)}getTooltipParam(t,e,i){var s;const r=this._hoveredSlice;return r&&null!==(s=r.getParam(i))&&void 0!==s?s:super.getTooltipParam(t,e,i)}getTooltipHeaderColor(t){var e,i;return null!==(i=null===(e=this._hoveredSlice)||void 0===e?void 0:e.color)&&void 0!==i?i:null}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize")}_createPoint(t){return new gn(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}get canPolar(){return!0}hasZ(){return!0}_colorByPoint(){return this._op.colorByPoint}_createLegendMarker(t,e){const i=this._pie;if(i&&i.visible&&i.fields.length>0){const s=new dn(t);return s.render(e,i.fields.length,[]),s.setColorResolver(()=>i.getLegendSliceColors()),s}return super._createLegendMarker(t,e)}getLegendSources(t){const e=this._pie,i=e&&e.visible&&e.visibleInLegend&&e.fields.length>0,s=i?this._op.legendMode||"both":null;"slice"!==s&&super.getLegendSources(t),i&&"series"!==s&&e.getLegendSources().forEach(e=>t.push(e))}_doPrepareRender(){super._doPrepareRender();let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._visPoints.forEach(i=>{i.isNull||isNaN(i.zValue)||(t=m(t,i.zValue),e=y(e,i.zValue))}),this._noSize=(this._zMin=t)===(this._zMax=e),this._pie&&this._pie.visible&&this._pie.fields.length>0&&this._visPoints.forEach(t=>{t.isNull||(t.pieSlices=this._pie.calcSlices(t.source))})}_getRangeMinMax(t){return"z"===t?{min:this._zMin,max:this._zMax}:super._getRangeMinMax(t)}getPointAt(t,e){o(t)&&(t=this._xAxisObj.getValue(t)),o(e)&&(e=this._yAxisObj.getValue(e));for(let i=0;i<this._points.count;i++){const s=this._points.get(i);if(s.xValue===t&&s.yValue===e)return s}}}mn.type="bubble",mn.defaults=Me(Js.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 yn extends Ks{_canContain(t){return t instanceof Zr}_doConstraintYValues(t){const e={};t.forEach(t=>{t._visPoints.forEach(t=>{if(!1!==t.visible){const i=t.xValue,s=e[i];s?s.push(t):e[i]=[t]}})});for(const t in e)e[t].sort((t,e)=>t.yValue-e.yValue).forEach((t,e)=>{t.yLabel=v(t.yLabel,t.yValue),t.yValue=t.yGroup=e});return at.makeIntArray(0,t.length)}}yn.type="bump",yn.seriesType=ss;class xn extends _s{get high(){return this.y}get highValue(){return this.yValue}_assignTo(t){return c(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 i=t.options,s=e.length>4?1:0;s>0&&(this.x=e[b(i.xField,0)]),this.low=e[b(i.lowField,0+s)],this.close=e[b(i.closeField,1+s)],this.open=e[b(i.openField,2+s)],this.y=e[w(i.highField,t.options.yField,3+s)]}}_readObject(t,e){super._readObject(t,e);const i=t.options;this.low=v(e[i.lowField],e.low),this.open=v(e[i.openField],e.open),this.close=v(e[i.closeField],e.close),this.y=S(e[i.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 bn extends Zs{canCategorized(){return!0}_createPoint(t){return new xn(t)}_getBottomValue(t){return t.lowValue}_createLegendMarker(t,e){const i=new qt;return i.rect(0,.2*e,e,.6*e),i.vline(e/2,0,e),new ne(t,Ds.LEGEND_MARKER).setPath(i.end())}}bn.type="candlestick",bn.defaults=Me(Zs.defaults,{tooltipDetail:"<b>${name}</b><br>최저: <b>${lowValue}</b><br>시가: <b>${openValue}</b><br>종가: <b>${closeValue}</b><br>고가: <b>${highValue}</b>"});class wn extends Ys{}wn.defaults=Me(Ps.defaults,{position:"inside"});class vn extends Br{get pointLabel(){return this._pointLabel}_createLabel(t){return new wn(t)}}vn.type=ns;class Sn extends Or{_canContain(t){return t instanceof vn}}Sn.type="circlebargroup",Sn.seriesType=ns;class Vn extends us{}class Cn extends $s{}Cn.defaults=Me($s.defaults,{radius:4,shape:"circle"});class An extends Zs{_doInit(t){super._doInit(t),t.marker=(this._marker=new Cn(this)).init(),t.lowMarker=(this._lowMarker=new Cn(this)).init()}get marker(){return this._marker}get lowMarker(){return this._lowMarker}canCategorized(){return!0}_getBottomValue(t){return t.lowValue}pointLabelCount(){return 2}getLabelOff(t){return super.getLabelOff(t)+y(0,this.marker.options.radius)}_createPoint(t){return new Vn(t)}prepareAfter(){const t=this.marker.options,e=this.lowMarker.options,i=t.radius,s=t.shape,r=b(e.radius,i),n=e.shape||s;this._visPoints.forEach(t=>{t.radius=i,t.shape=s,t.lowRadius=r,t.lowShape=n}),super.prepareAfter()}}An.type="dumbbell";class Pn extends _s{}class kn extends Xs{getSegmentSize(t){return X(this._segmentSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"segmentSize")}canCategorized(){return!0}_createPoint(t){return new Pn(t)}_createLegendMarker(t,e){const i=new qt;return i.rect(0,0,e,.4*e),i.rect(0,.6*e,e,.4*e),new ne(t,Ds.LEGEND_MARKER).setPath(i.end())}}kn.type="equalizer",kn.defaults=Me(Xs.defaults,{segmentSize:10,segmentGap:4,segmented:!1});class Ln extends Zs{isClusterable(){return!1}pointLabelCount(){return 2}_createPoint(t){return new us(t)}getBaseValue(t){return t===this._yAxisObj?0:NaN}_createLegendMarker(t,e){const i=(new qt).vline(e/2,.1,.8*e).hline(.1,0,e).hline(.9*e,0,e),s=new ne(t,Ds.LEGEND_MARKER).setPath(i.end());return s.setStyle("strokeWidth","2px"),s}_getBottomValue(t){return t.lowValue}}Ln.type="errorbar",Ln.defaults=Me(Zs.defaults,{pointPadding:.3,tooltipDetail:"<b>${lowValue}</b> ~ <b>${highValue}</b>"});class Tn extends Is{}class Nn extends Tn{constructor(t,e){super(t),this.points=e}}class Mn extends zs{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?Mn.ENDED_DIST:Mn.OUTSIDE_DIST:this._op.distance||0}}Mn.OUTSIDE_DIST=25,Mn.ENDED_DIST=10;class En extends Gs{getSize(t,e){return{width:y(.1*t,X(this._widthDim,t)),height:y(.1*e,X(this._heightDim,e))}}getNeckSize(t,e){return{width:at.clamp(X(this._neckWidthDim,t),this._minNeckWidth,t),height:at.clamp(X(this._neckHeightDim,e),0,e)}}get pointLabel(){return this._pointLabel}_createLabel(t){return new Mn(t)}_createPoint(t){return new Tn(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new Nn(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.width)!==e._width&&(e._width=i,e._widthDim=Y(e._width,En.defaults.width)),function(t){t!==e._height&&(e._height=t,e._heightDim=Y(e._height,En.defaults.height))}(t.height),function(t){t!==e._neckWidth&&(e._neckWidth=t,e._neckWidthDim=Y(e._neckWidth,En.defaults.neckWidth))}(t.neckWidth),function(t){t!==e._neckHeight&&(e._neckHeight=t,e._neckHeightDim=Y(e._neckHeight,En.defaults.neckHeight))}(t.neckHeight),this._minNeckWidth=Math.max(0,+t.minNeckWidth)}}En.type="funnel",En.defaults=Me(Gs.defaults,{width:"85%",height:"90%",neckWidth:"30%",neckHeight:"30%",minNeckWidth:2,legendByPoint:!1});class Bn extends _s{parse(t){super.parse(t);const e=this.source;this.min=e.min,this.max=e.max}_assignTo(t){return c(super._assignTo(t),{min:this.min,max:this.max})}}const Dn={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 On extends Rs{getBinCount(t){const e=b(this._op.binWidth,0);if(e>0)return t/e;return b(this._op.binsNumber,0)<1?Dn[this._op.binsNumber||"squreRoot"](t):void 0}_createPoint(t){return new Bn(t)}_doLoadPoints(t){function e(t){let e;return e=r(t)?t[b(this.yField,0)]:s(t)?S(t[this.yField],t.y,t.value):t,parseFloat(e)}const i=this._op,n=[];let o=[];for(let i=0;i<t.length;i++){const s=e(t[i]);isNaN(s)||o.push(s)}if(o.length>0){o=o.sort((t,e)=>t-e),i.minValue<o[0]&&o.unshift(i.minValue),i.maxValue>o[o.length-1]&&o.push(i.maxValue);const t=o.length,e=o[0],s=o[t-1],r=this.getBinCount(t),a=this._binInterval=(s-e)/r;let l=0,h=e,_=h+a;for(let e=0;e<r;e++){let i=0;if(e==r-1)i=t-l;else for(;l<t&&o[l]<_;)i++,l++;n.push({x:h,y:i,min:h,max:e===r-1?s:_}),h=_,_=h+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=w(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 Xi.create(t,Ds.LEGEND_MARKER,0,0,e,e,2)}}On.type="histogram",On.defaults=Me(Ds.defaults,{baseValue:0,binsNumber:"squreRoot"});class Rn extends $s{}Rn.defaults=Me($s.defaults,{radius:4,minRadius:2,maxRadius:8,shape:"circle"});class $n extends _s{_assignTo(t){return c(super._assignTo(t),{radius:this.radius})}_valuesChangd(t){return this.radius!==t.radius||super._valuesChangd(t)}_readArray(t,e){const i=+t.options.colorField,s=+t.options.iconField,r=t.options,n=e.length>1?1:0;n>0&&(this.x=e[b(r.xField,0)]),this.y=e[b(r.yField,0+n)],this.radius=e[b(r.radiusField,1+n)],isNaN(i)||(this.color=e[i]),isNaN(s)||(this.icon=e[s])}_readObject(t,e){super._readObject(t,e),this.radius=v(e[t.options.radiusField],e.radius)}}class In extends Xs{_doInit(t){super._doInit(t),t.marker=(this._marker=new Rn(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 $n(t)}prepareAfter(){const t=this.marker.options,e=t.radius,i=t.shape,s=this.options.radiusField,r=y(t.minRadius,0),n=y(t.maxRadius,r);if(s){const t=this._runPoints.map(t=>t.radius).filter(t=>"number"==typeof t&&!Number.isNaN(t)),e=Math.min(...t),s=Math.max(...t)-e||1;this._runPoints.forEach(t=>{const o=(t.radius-e)/s;null!=t.radius&&(t.radius=r+o*(n-r)),t.shape=i})}else this._runPoints.forEach(t=>{var s;t.radius=null!==(s=t.radius)&&void 0!==s?s:e,t.shape=i});super.prepareAfter()}}In.type="lollipop";class Fn extends xn{}class zn extends bn{_createPoint(t){return new Fn(t)}_createLegendMarker(t,e){const i=new qt;i.vline(e/2,0,e),i.hline(.4*e,e/2,e),i.hline(.7*e,0,e/2);const s=new ne(t,Ds.LEGEND_MARKER).setPath(i.end());return s.setStyle("strokeWidth","2px"),s}}zn.type="ohlc";class Hn extends Gr{}class Gn extends Xr{isEmpty(){return!!super.isEmpty()&&(!this._refer||this._refer.isEmpty())}getLineType(){return this._op.curved?"spline":"default"}_createPoint(t){return new Hn(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 i=[],s=t.reduce((t,e)=>t+b(e.yValue,0),0);let r=0;t.forEach(t=>{t.isNull||i.push({x:t.xValue,y:r+=100*t.yValue/s})}),e._doLoadPoints(i),e._prepareRunPoints(e._xAxisObj,e._yAxisObj)})(t._visPoints),this.collectValues(this._xAxisObj,this._xAxisObj._values),this.collectValues(this._yAxisObj,this._yAxisObj._values)}}}Gn.type="pareto",Gn.defaults=Me(Xr.defaults,{curved:!1});class jn extends Is{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 c(super._assignTo(t),{sliced:this.sliced})}}class Wn extends jn{constructor(t,e){super(t),this.points=e}}class Yn extends $e{getDefaultIconPos(){return"left"}}class Xn extends zs{getDistance(t,e,i){return i>0&&(e-=e*i),this._distanceDim?X(this._distanceDim,e,0):t?X(i?Xn.INNER_DIST:Xn.INSIDE_DIST,e):"far"===this._op.align?Xn.ENDED_DIST:Xn.OUTSIDE_DIST}}Xn.INSIDE_DIST=W("30%",!1),Xn.INNER_DIST=W("50%",!1),Xn.OUTSIDE_DIST=25,Xn.ENDED_DIST=10,Xn.defaults=Me(zs.defaults,{radius:.7,rotationMode:"arc"});class Un extends De{getLength(){return this.visible?this._op.length:0}_isVisible(){return this._op.visible&&this._op.length>0}_doSetSimple(t){return l(t)&&t>0?(this._op.length=t,this._op.visible=!0,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),t.length=y(0,b(t.length,0)),t.ratio=y(.3,m(.8,b(t.ratio,Un.DEPTH_RATIO)))}}Un.DEPTH_RATIO=.6,Un.defaults=Me(De.defaults,{visible:!1,length:25,ratio:Un.DEPTH_RATIO});class Zn extends js{_doInit(t){super._doInit(t),t.innerText=(this._innerText=new Yn(this.chart)).init(),t.depth=(this._depth=new Un(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?X(this._sliceOffsetDim,t):0}get pointLabel(){return this._pointLabel}_createLabel(t){return new Xn(t)}_createPoint(t){return new jn(t)}_createOthersPoint(t,e){return t.y=e.map(t=>t.y).reduce((t,e)=>t+e),new Wn(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*b(this._op.startAngle%360,0),this._totalRad=B*y(0,m(360,b(this._op.totalAngle,360))),this._groupPos=NaN}}Zn.type="pie",Zn.defaults=Me(js.defaults,{groupSize:1,sliceOffset:"7%",autoSlice:!0,sliceDuration:300});class qn extends qs{getPolarSize(t,e){return X(this._polarDim,m(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 i;super._doApply(t),(i=t.polarSize)!==e._polarSize&&(e._polarSize=i,e._polarDim=W(i,!0)||{size:80,fixed:!1}),function(t){t!==e._innerSize&&(e._innerSize=t,e._innerDim=W(t,!0))}(t.innerSize)}needAxes(){return!1}_canContain(t){return t instanceof Zn}_doPrepareSeries(t){const e=t.map(t=>t.options.groupSize).reduce((t,e)=>t+b(e,1),0);let i=0;t.forEach(t=>{t._groupPos=i,i+=t._groupSize=b(t.options.groupSize,1)/e})}}qn.type="piegroup",qn.seriesType="pie",qn.defaults=Me(qs.defaults,{polarSize:"80%",innerSize:0});class Kn extends _s{}class Qn extends Js{_createPoint(t){return new Kn(t)}_getNoClip(t){const e=super._getNoClip(t);return!h(e)||e}_createLegendMarker(t,e){return new $r(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 i=super.legendMarker(t,e);return i.render(this.getShape(null),m(e/2,this._op.radius)),i}}Qn.type="scatter",Qn.defaults=Me(Js.defaults,{jitterX:0,jitterY:0,radius:5,hoverScale:1.8});class Jn extends _s{constructor(){super(...arguments),this.from=0}parse(t){super.parse(t),this._isSum=!0===this.source.isSum,this._isMid=this.source.isMid,(this._isSum||this._isMid)&&(this.y=0)}getPointLabel(t){return this.y}}class to extends Ps{}to.defaults=Me(Ps.defaults,{offset:0});class eo extends Us{canCategorized(){return!0}getBaseValue(t){return t._isX?NaN:0}_createLabel(t){return new to(t)}_createPoint(t){return new Jn(t)}_createLegendMarker(t,e){return Xi.create(t,Ds.LEGEND_MARKER,0,0,e,e,2)}_doPrepareRender(){super._doPrepareRender();const t=this._visPoints;if(t.length<1)return;let e,i=t[0],s=i.y=i.save=i._isSum?0:i.y,r=s,n=s,o=i.from=0,a=0,l=i.to=s,h=0;for(let _=1,c=t.length;_<c;_++){i=t[_];if(!0===i._isMid&&_<c)e=n,o=h,l=o+e,h=l,s=e,n=0;else if(i._isSum)e=r,o=0,l=e,s=e;else{if(null==i.y)continue;e=i.y,o=a+s,l=o+e,n+=e,r+=e,s=e}i.yGroup=i.yValue=e,i.from=o,i.to=l,i.y=Math.max(o,l),i.save=e,a=o}}_getBottomValue(t){const e=Math.min(t.from,t.to);return t.y=t.save,delete t.save,e}}eo.type="waterfall",eo.defaults=Me(Us.defaults,{tooltipDetail:"<b>${y}</b>"});class io extends mr{canUseNumSymbols(){return this.axis.axisMax()>this._log(500)}buildSteps(t,e,i,s,r,n){return this._log=t._log,this._pow=t._pow,this._snap=t._snap,super.buildSteps(t,e,i,s,r,n)}_getStepMultiples(t){return[1,2,5,10]}_getStepsByPixels(t,e,i,s,r){const n=this._log,o=this._pow,a=this._snap;s>=i?s=i:r<=i&&(r=i);const l=r-s;if(0===l||t<=0)return isNaN(s)?[]:[s];let h=[],_=y(1,d(t/e))+1;if(r-s>=.5){if(0===l)return isNaN(s)?[]:[s];let t=l/(_-1);const e=o(Math.floor(n(t))),c=this._getStepMultiples(e);if(t/=e,c&&c.length>0)if(t>c[0]){for(let e=0;e<c.length-1;e++)if(t>c[e]&&t<c[e+1]){t=t<=c[e]+(c[e+1]-c[e])/2?c[e]:c[e+1];break}}else t=c[0];t*=e,(t<=0||!isFinite(t))&&(t=l/_),s=isNaN(i)?this._normalizeMin(s,t):i-u((i-s)/t)*t;const d=this.axis,p=Math.pow(d._logBase,r-s)>d._roundThreshold,g=.5;let f=s,m=a(f);for(h.push(m);m<r;)f+=t,m=a(p?Math.round(f):f),m>h[h.length-1]&&(m<r&&(1==h.length&&m-h[h.length-1]<t||h.length>1&&m-h[h.length-1]<(h[h.length-1]-h[h.length-2])*g)&&h.pop(),h.push(m))}else{s=o(s);const t=(r=o(r))-s;let e=t/(_-1);const i=o(d(n(e))),a=this._getStepMultiples(i);if(e/=i,a&&a.length>0){let t=a[0];for(let i=0;i<a.length-1;i++)if(e>a[i]&&e<a[i+1]){t=e<=a[i]+(a[i+1]-a[i])/2?a[i]:a[i+1];break}e=t}e*=i,(e<=0||!isFinite(e))&&(e=t/_);const l=1e-10*e;let c=d(s/e)*e;for(c<s&&(c+=e),h.push(n(c));c<=r+l;)c+=e,c>0&&h.push(n(c))}return h}}io.defaults=Me(mr.defaults,{arrangeDecimals:!0});class so extends vr{_isLog(){return!0}_createLabel(){return new xr(this)}_createTickModel(){return new io(this)}_doApply(t){super._doApply(t);const e=this._logBase=y(2,b(t.logBase,10));this._roundThreshold=b(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 i=>{const s=d(i);return i===s?i:s+e((i-s)*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)}contains(t){return t>0&&super.contains(this._log(t))}trimRange(t,e){const i=t>0?this._log(t):NaN,s=e>0?this._log(e):NaN,[r,n]=super.trimRange(i,s);return[this._pow(r),this._pow(n)]}_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)))}_interpolateMinorValue(t,e,i,s){if(t<=0||e<=0)return NaN;const r=this._log(t),n=this._log(e);return isFinite(r)&&isFinite(n)?R(this._pow(r+(n-r)*i/(s+1))):NaN}_canInterpolateMinorSegment(t,e){return super._canInterpolateMinorSegment(t,e)&&t>0&&e>0}_calcUnitLen(t,e,i,s){if(t.length<2)return super._calcUnitLen(t,e,i,s);const r=this._log;let n=r(t[1])-r(t[0]);for(let e=2;e<t.length;e++)n=m(n,r(t[e])-r(t[e-1]));const o=s-i,a=n/o;return{len:b(e*=a,1),min:o*a}}_doApplyBreak(t){t&&t.from>0&&t.to>0&&(t.from=this._log(t.from),t.to=this._log(t.to)),super._doApplyBreak(t)}}so.type="log",so.defaults=Me(vr.defaults,{logBase:10,roundThrrehold:500});class ro extends De{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)}}}ro.defaults=Me(De.defaults,{scope:"chart",align:"center",verticalAlign:"middle",imageWidth:24,imageHeight:24,hoverEffect:"auto",hintMode:"custom"});class no extends Oe{load(t){const e=this.chart,i=this._items=[];r(t)?t.forEach((t,s)=>{i.push(this.$_loadItem(e,t))}):t&&i.push(this.$_loadItem(e,t)),this.chart._op.button=this._items.map(t=>t.options)}$_loadItem(t,e){const i=new ro(t);return i.init(),i._load(e),i}}const oo="$ctrl";class ao extends De{isFloating(){return this._op.floating||"middle"===this._op.verticalAlign&&"center"===this._op.align}_doSetSimple(t){return o(t)?(this._op.text=t,!0):super._doSetSimple(t)}}ao.defaults=Me(De.defaults,{text:"RealChart v1.4",url:"https://realchart.co.kr",floating:!1,align:"right",verticalAlign:"bottom",offsetX:2,offsetY:1,gap:4});class lo extends De{getHintDistance(t){return isNaN(this._op.hintDistance)?this.chart._tooltip.visible&&this.chart._tooltip.isFollowPointer(t)?Number.MAX_SAFE_INTEGER:30:this._op.hintDistance}getScope(t,e){return"auto"!==v(this._op.scope,"auto")?this._op.scope:this.chart.chartOptions.options.seriesHovering?"point":t._xAxisObj.crosshair.visible&&t.needAxes()?"axis":t.isMarker()&&t._group?"group":"point"}}lo.defaults=Me(De.defaults,{scope:"auto"});class ho extends De{_doInit(t){t.pointHovering=(this._pointHovering=new lo(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 _o;ho.defaults=Me(De.defaults,{paletteMode:"normal",animatable:!0,hoverable:!0,clickable:!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"}(_o||(_o={}));class co 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 Te,(this._chartOptions=new ho(this)).init(),(this._title=new or(this)).init(),(this._subtitle=new ar(this)).init(),(this._legend=new Hi(this)).init(),(this._credits=new ao(this)).init(),(this._tooltip=new lr(this)).init(),this._buttons=new no(this),co.split_class&&(this._split=new co.split_class(this)).init(),(this._body=new Ii(this)).init(),(this._navigator=new nr(this)).init(),(this._exporter=new Fi(this)).init(),this._series=new Os(this),this._xAxes=new ci(this,!0),this._yAxes=new ci(this,!1),this._gauges=new yi(this),this._annotations=new He(this),s(t)?this._load(t):this._initOptions()}_initOptions(){return this._op=Object.assign({},co.defaults)}get win(){var t;return(null===(t=this._wrapper)||void 0===t?void 0:t[oo]).win()}get options(){return this._op}get chartOptions(){return this._chartOptions}get credits(){return this._credits}_createChart(t){return new co(t)}animatable(){return!1!==this._chartOptions.options.animatable}loadAnimatable(){return this._loadAnimatable}hoverable(){return!1!==this._chartOptions.options.hoverable}clickable(){return!1!==this._chartOptions.options.clickable}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,i){class s{constructor(t){this.axis=t,this.series=t.getVisibleSeries().filter(t=>t.needAxes())}isGroupTooltip(){return this.series.length>1}getTooltipText(t,e,i){return qs.collectTooltipText(this.axis.options,this.series,t,e,i)}getTooltipParam(t,e,i){return qs.inflateTooltipParam(this.series,t,e,i)}}switch("point"!==t&&"axis"!==t&&"group"!==t&&(t=this._chartOptions.pointHovering.getScope(e,i)),t){case"axis":return new s(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 gi?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(i=>i.col===t&&(!e||i.checkVisible())):this._xAxes._internalItems().filter(t=>!e||t.checkVisible())}_getYAxesAt(t,e){return this._splitted?this._yAxes._internalItems().filter(i=>i.row===t&&(!e||i.checkVisible())):this._yAxes._internalItems().filter(t=>!e||t.checkVisible())}_getXAxesAtPane(t,e,i){return this._splitted?this._xAxes._internalItems().filter(s=>s.col===t&&s.row===e&&(!i||s.checkVisible())):this._xAxes._internalItems().filter(t=>!i||t.checkVisible())}_getYAxesAtPane(t,e,i){return this._splitted?this._yAxes._internalItems().filter(s=>s.col===t&&s.row===e&&(!i||s.checkVisible())):this._yAxes._internalItems().filter(t=>!i||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 i=this._xAxes.items(),s=this._yAxes.items();let r;if(this.isInverted())switch(t){case _o.LEFT:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case _o.RIGHT:r=i.filter(t=>t._isOpposite);break;case _o.BOTTOM:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case _o.TOP:r=s.filter(t=>t._isOpposite)}else switch(t){case _o.LEFT:r=s.filter(t=>!t._isOpposite&&!t._isBetween);break;case _o.RIGHT:r=s.filter(t=>t._isOpposite);break;case _o.BOTTOM:r=i.filter(t=>!t._isOpposite&&!t._isBetween);break;case _o.TOP:r=i.filter(t=>t._isOpposite)}return r?e?r.filter(t=>t.checkVisible()):r:[]}_setProperties(t,e=!0){const i=this._op;for(const e in co.defaults)t.hasOwnProperty(e)&&(i[e]=t[e]);i.type=i.type||"bar",i.gaugeType=i.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(v(t.asset,t.assets)),r.options=r.chart=this._chartOptions._load(v(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(v(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(v(t.gauge,t.gauges)),this._gaugeOnly=0===this._series.count&&null!=this._gauges&&!this._gauges.isEmpty(!1),this._gaugeOnly||(this._xAxes.load(S(t.xAxis,t.xAxes,{})),this._yAxes.load(S(t.yAxis,t.yAxes,{}))),r.body=this._body._load(t.body||t.plot),null===(i=this._split)||void 0===i||i._load(t.split),this._annotations.load(v(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 i=this[e];(i instanceof De||i instanceof Oe||i instanceof Te)&&i.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,i=this._yAxes,s=this._split;return[e,i].forEach(t=>{t.count<1&&!this._gaugeOnly&&t.load({})}),this._inverted=!this._polar&&this.inverted,this._splitted=s&&s.visible,this._assets.prepareRender(),e.disconnect(),i.disconnect(),this._series.connect(this),this._series.prepareRender(),e.prepare(),i.prepare(),e.collectValues(),i.collectValues(),e.collectReferentValues(),i.collectReferentValues(),i.collectRanges(),e.collectRanges(),e.prepareRender(),i.prepareRender(),this._splitted&&this._split.prepareRender(e,i),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,i,s){this._xAxes._buildTicks(i?e:t,s),this._yAxes._buildTicks(i?t:e,s),this.$_calcAxesPoints(t,e,i,s)}$_calcAxesPoints(t,e,i,s){let r=i?e:t;this._xAxes.forEach(t=>{(s<2||s>100||t._isHorz||!t.continuous())&&t._calcPoints(r,s)}),r=i?t:e,this._yAxes.forEach(t=>{(s<2||s>100||t._isHorz||!t.continuous())&&t._calcPoints(r,s)})}axesLayouted(t,e,i){this.$_calcAxesPoints(t,e,i,101)}getParam(t,e){return this._params[e]}setParam(t,e,i){return i&&e!==this._params[t]?(this._params[t]=e,this._modelChanged(null)):this._params[t]=e,this}addSeries(t,e){const i=this._series.add(t,e);return i&&(this._dataChanged(),this._modelChanged(i)),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._dataChanged(),this._modelChanged(null),i}render(){this._fireEvent("onRefreshRequest")}getPaletteColors(t){let e=this._palColors[t];if(!e){const i=document.querySelector(".rct-root");if(i){const s="data-palette",r=i.getAttribute(s);i.setAttribute(s,t);const n=getComputedStyle(i);this._palColors[t]=e=[];for(let t=1;t<=Bs;t++)e.push(n.getPropertyValue(`--color-${t}`).trim());i.setAttribute(s,r)}}return e}$_loadTemplates(t){const e=this._bases={xAxis:{},yAxis:{},series:{},gauge:{},annotation:{},button:{}};if(s(t)){const i=this._templates={};for(const e in t){const r=t[e];s(r)&&(i[e]=c({},r))}["@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(o(e)){let i=this._templates[e];if(i)return Be(Be({},i),t)}else r(e)&&e.forEach(e=>{let i=this._templates[e];return i?Be(Be({},i),t):i});return t}}else this.assignTemplates=void 0}_getGroupType(t){return o(t)&&Vs[t.toLowerCase()]}_getSeriesType(t){return o(t)&&Ss[t.toLowerCase()]}_getAxisType(t){return o(t)&&Ye[t.toLowerCase()]}_getGaugeType(t){return o(t)&&ui[t.toLowerCase()]}_getGaugeGroupType(t){return o(t)&&pi[t.toLowerCase()]}_getAnnotationType(t){return o(t)&&Fe[t.toLowerCase()]}getAxesGap(){return b(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)}}co.defaults={type:"bar",gaugeType:"circle",polar:!1,inverted:!1},_i.register(ms,Sr,so,Tr),Ds.register(Qr,en,Mr,Dr,on,ln,mn,bn,vn,An,kn,Ln,En,On,Zr,qr,In,zn,Gn,Zn,Qn,eo),qs.register(rn,Rr,yn,Sn,sn,qn),qs.registerSeries(rn,Rr,Sn,sn,qn),ze.register(ur,pr,gr);class uo{constructor(t,e){this._modelCallback=e,this._obj=new co(t,this),this._loaded=s(t),null==e||e(this._obj,null)}destroy(){var t;this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this[oo]=null===(t=this[oo])||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 o(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getGauge(t){return this._obj.gaugeAt(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,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 co(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=i,at.log("chart-items:",Ne),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,i){this._obj.setParam(t,e,i)}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}draw(){this[oo].refresh()}}class po{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,i){this._obj.setValue(t,e,i)}getValues(t,e=0,i=-1){return this._obj.getValues(t,e,i)}getRow(t){return this._obj.getRow(t)}addRow(t,e=-1){this._obj.addRow(t,e)}deleteRow(t=-1){this._obj.deleteRow(t)}}class go extends ht{constructor(t,e,i){super(),this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i}_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,i=0){let s=this._pool.pop();return s||(s=new this._creator(t,this._styleName)),s}prepare(t,e,i){const s=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(s);o.push(e),null==i||i(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 i=this._views.indexOf(t);i>=0&&this._views.splice(i,1)}}freeAll(t,e=0){for(let i=(t=t||this._views).length-1;i>=0;i--)this.free(t[i],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 i=e.length-1;i>=t;i--)this.free(e[i],0)}forEach(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)t(e[i],i,s)}visit(t){const e=this._views.length;let i=0;for(;i<e&&!1!==t(this._views[i],i,e);i++);return i===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 i=null===(e=this._orphans)||void 0===e?void 0:e.get(t);i&&(this.free(i),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 fo=Object.freeze({x:0,y:0,width:0,height:0});function mo(t){return{width:t.width,height:t.height}}const yo=function(t){const e=t.x+t.width/2,i=t.y+t.height/2,s=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(s)-r*Math.sin(s)),i+(t*Math.sin(s)+r*Math.cos(s))])},xo=function(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i],r=t[(i+1)%t.length],n=[r[0]-s[0],r[1]-s[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},bo=function(t,e){const i=t.map(([t,i])=>t*e[0]+i*e[1]);return[Math.min(...i),Math.max(...i)]},wo=function(t,e){return t[1]>=e[0]&&e[1]>=t[0]},vo=function(t,e){const i=yo(t),s=yo(e),r=xo(i),n=xo(s);for(const t of[...r,...n]){const e=bo(i,t),r=bo(s,t);if(!wo(e,r))return!1}return!0},So=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 Vo{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new Vo(t,t,t,t):new Vo(t,t,e,e):new Vo(t,e,i,s)}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,i=0,s=0){this.top=t,this.bottom=e,this.left=i,this.right=s}clone(){return new Vo(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=b(t.paddingLeft,0),this.right=b(t.paddingRight,0),this.top=b(t.paddingTop,0),this.bottom=b(t.paddingBottom,0),this}applyMargin(t){return this.left=b(t.marginLeft,0),this.right=b(t.marginRight,0),this.top=b(t.marginTop,0),this.bottom=b(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}}}Vo.Empty=Object.freeze(new Vo),Vo.Temp=new Vo;class Co extends Jt{constructor(t,e=T){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Co.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Co.IGNORE_ATTRS={width:"",height:""};class Ao extends Jt{constructor(t,e=T){super(t,e,"g"),Jt.DEBUGGING&&(this.add(this._debugRect=new Xi(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,i,s,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,i,s,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 Xi(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,i,s,r){return{width:i,height:s}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class Po extends Ao{constructor(t,e,i){super(t,e),this._margins=new Vo,this._paddings=new Vo,this.add(this._background=new Xi(t,i))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,i,s,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,i,s,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 ko extends Co{measure(t,e,i,s,r){this._setInverted(e.isInverted());const n=this._doMeasure(t,e,i,s,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 Lo extends Ao{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,i){this._inverted=t,this._animatable=e,this._loadAnimatable=i}}class To extends Jt{constructor(t,e,i){super(t,i,"image"),this._bounds=fo,this.onloadProxy=()=>{const t=this.getBBox();this.resize(t.width,t.height)},this.onerrorProxy=()=>{},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this.invalidate()},this.dom.onerror=()=>{this.onerrorProxy(),this.invalidate()},window.SVGGraphicsElement&&!ot||(this.setAttr("href",""),this._proxy=new Image,this._proxy.onload=()=>{this.invalidate(),setTimeout(()=>{this.onloadProxy()},0)},this._proxy.onerror=()=>{this.onerrorProxy(),this.invalidate()})}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,i){this.url=t,this.resize(e,i)}getBBox(){if(this._bounds=this.dom.getBBox(),this._proxy){const t=this._proxy;let e=this._bounds.width,i=this._bounds.height;e>0&&!i?i=e/t.width*t.height:0==i||e||(e=i/t.height*t.width),this._bounds={x:this._bounds.x,y:this._bounds.y,width:e,height:i}}return this._bounds}resize(t,e,i){const s=this._proxy;return t||(t=NaN),e||(e=NaN),s&&(z(t)||z(e))&&(t>0&&z(e)?e=t/s.width*s.height:e>0&&z(t)?t=e/s.height*s.width:(t=s.width,e=s.height)),super.resize(t,e,i)}}class No extends Co{constructor(e,i=T){super(e),this.add(this._text=new ue(e,i)),this._text.anchor=t.TextAnchor.START}get text(){return this._text.text}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.options.effect;return this._model=e,this._text.internalClearStyleAndClass(),this._text.internalSetStyleOrClass(e._style),s&&this._text.internalSetStyleOrClass(s),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new Xi(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()),i&&i!==this._failedIconUrl?(this._icon||this.add(this._icon=new To(t,!1)),this._icon.setImage(i,+this._model.options.iconWidth,+this._model.options.iconHeight),this._icon.onerrorProxy=()=>{var t,e;this._failedIconUrl=null===(t=this._icon)||void 0===t?void 0:t.url,null===(e=this._icon)||void 0===e||e.remove(),this._icon=null,this._box=void 0,this.invalidate()}):this._icon&&(this._icon.remove(),this._icon=null),this._box=void 0,this}setContrast(t){var e;const i=null===(e=this._model)||void 0===e?void 0:e.options;if(null==i?void 0:i.autoContrast){const e=this._back&&this._back.parent?this._back.dom:t;e&&this._text.setContrast(e,i.darkStyle||"rct-label-dark",i.lightStyle||"rct-label-light")}if(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(e){const i=this._text,s=this._outline,r=this._icon;let n=0;const o=i.getBBox(),a=o.width,l=o.height;let h=a,_=l,c=0,d=0,u=0,p=0;if(this._box=void 0,r){const t=r.getBBox();n=b(this._model.options.iconGap,0);const e=b(+this._model.options.iconWidth,0),i=b(+this._model.options.iconHeight,0);switch(c=t.width||e||i,d=t.height||i||e,this._model.getIconPos()){case"left":case"right":h+=n+c,_=Math.max(d,l);break;default:_+=n+d,h=Math.max(c,a)}}if(this._back&&this._back.parent){const t=getComputedStyle(this._back.dom);u=parseFloat(t.paddingLeft)||0,p=parseFloat(t.paddingTop)||0,this._back.setBounds(0,0,h+u+(parseFloat(t.paddingRight)||0),_+p+(parseFloat(t.paddingBottom)||0),t.rx)}if(r)switch(this._model.getIconPos()){case"left":r.trans(u,(_-d)/2),u+=c+n,h-=c+n;break;case"right":r.trans(u+h-c,(_-d)/2),h-=c+n;break;case"top":r.trans((h-c)/2,p),p+=d+n;break;case"bottom":r.trans((h-c)/2,p+l+n)}switch(e){case"center":u+=h/2,i.anchor=t.TextAnchor.MIDDLE;break;case"right":u+=h,i.anchor=t.TextAnchor.END;break;default:i.anchor=t.TextAnchor.START}return i.trans(u,p),s&&(s.anchor=i.anchor,s.setAttr("y",i.getAttr("y")),s.trans(i.tx,i.ty)),this._iconBox=r?{x:r.tx,y:r.ty,width:c,height:d}:null,this}getLayoutBox(){const t=this.getBBox(),e=this._iconBox;if(!e)return t;const i=Math.min(t.x,e.x),s=Math.min(t.y,e.y);return{x:i,y:s,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-s}}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 Mo extends Po{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 x(g(t)*e.height)+x(p(t)*e.width)}rotatedHeight(){const t=this.model.getRotation()*B,e=this.getBBox();return x(p(t)*e.height)+x(g(t)*e.width)}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,i,s,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,i,s,null,null);const a=mo(this._textView.getBBox());if(!e.axis._isHorz&&0!==this._angle){const t=a.width;a.width=a.height,a.height=t}return a}_doLayout(e){const i=this._textView,s=i.getStyle("writing-mode"),r=s===st||s===rt;e?this.rotation=0:this.setRotation(0,(r?this.width:this.height)/2,this._angle);let n=this._margins.top+this._paddings.top,o=0;switch(this.textAlign()){case"left":i.anchor=t.TextAnchor.START,r||(o-=this.width/2);break;case"right":i.anchor=t.TextAnchor.END,r?n+=this.height:o+=this.width/2;break;default:i.anchor=t.TextAnchor.MIDDLE,r&&(n+=this.height/2)}i.trans(o,n)}resizeByMeasured(){return 0===this._angle?this.resize(this.mw,this.mh):this.resize(this.mh,this.mw),this}layout(t){return super.layout(t),this._debugRect&&this._debugRect.setBounds(-this.width/2,0,this.width,this.height),this}}class Eo extends Po{constructor(e){super(e,"rct-axis-unit-label","rct-axis-unit-label-background"),this.add(this._textView=new ue(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new ve}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_getBackOffset(){return-this.width/2}_doMeasure(t,e,i,s,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,i,s,null,null),mo(this._textView.getBBox())}_doLayout(e){const i=this._textView;let s=this._margins.top+this._paddings.top,r=0;switch(this.textAlign()){case"left":i.anchor=t.TextAnchor.START,r-=this.width/2;break;case"right":i.anchor=t.TextAnchor.END,r+=this.width/2;break;default:i.anchor=t.TextAnchor.MIDDLE}i.trans(r,s)}}class Bo extends Ao{constructor(t,e=Io.TICK_CLASS){super(t,e),this.add(this._lineView=new zr(t))}_doLayout(t){this.model.axis._isHorz?this._lineView.setVLine(0,0,this.height):this._lineView.setHLine(0,0,this.width)}}class Do extends No{constructor(){super(...arguments),this.index=-1,this.col=0,this.row=0,this.tickWidth=0,this.hidden=!1,this.groupLevel=-1,this._backPad=null,this._backPadDom=null}setLabel(t,e,i,s,r,n){s?(t.prepareRich(s),this.setModel(this.doc,t,t.getIconUrl(t.getIcon(i)),e),t.buildSvg(this._text,this._outline,r,n,t,t._domain)):(t.prepareRich(""),this._text.text="")}applyBackgroundCallback(t,e){const i=t.options.backgroundStyleCallback;if("background"===t.options.effect&&i){const s=t.axis.getTickLabelArgs(e.index,e.value);this._back.setStyleOrClass(i(s))}}rotatedWidth(){const t=(this.rotation||0)*B,e=this.getBBox();return x(g(t)*e.height)+x(p(t)*e.width)}rotatedHeight(){const t=this.rotation*B,e=this.getBBox();return x(p(t)*e.height)+x(g(t)*e.width)}invalidateBackPad(){this._backPad=null,this._backPadDom=null}resizeBackBySpan(t,e,i=!0){const s=this._back;if(!s)return;const r=this.getBBox();let n=this._backPad;if(!n||this._backPadDom!==s.dom){const t=getComputedStyle(s.dom);n=this._backPad={l:parseFloat(t.paddingLeft)||0,t:parseFloat(t.paddingTop)||0,r:parseFloat(t.paddingRight)||0,b:parseFloat(t.paddingBottom)||0},this._backPadDom=s.dom}const{l:o,t:a,r:l,b:h}=n;s.transX(0),s.transY(0),i?s.setBounds((t-r.width)/-2-e-o,-a,t-1+o+l,r.height+a+h):s.setBounds(-o,(t-r.height)/-2-e-a,r.width+o+l,t-1+a+h)}resizeBackByWeight(t,e,i,s,r,n,o,a,l,h=0){const _=this._back;if(_)if(t._isHorz){const t=this.getBBox(),e=a;_.transY(-this.ty),_.transX((e-t.width)/-2-l),_.resize(e-1,r)}else{const t=this.getBBox(),r=a,c=e?n-o+h:i?n:h-o;_.transX(c-this.tx),_.transY((r-t.height)/-2-l),e?_.resize(s-h-2*(n+o),r-1):_.resize(s-n-h+o,r-1)}}}class Oo 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 i=t.options.flag;this._text.text=(i.prefix||"")+e+(i.suffix||"");const s=this._text.getBBox(),r=new qt,n=y(b(i.minWidth,0),s.width+8);r.rect(0,0,n,s.height+4),this._back.setPath(r.end()),this._text.trans(n/2,2)}this._back.setStyleOrClass(t.flag._style),this._text.setStyleOrClass(t.flag.options.textStyles)}}class Ro extends Ao{static isThumb(t){return t.classList.contains(Ro.THUMB_CLASS)}constructor(t){super(t,"rct-axis-scrollbar"),this._len=0,this._page=0,this._pos=0,this.add(this._trackView=new Xi(t,Ro.TRACK_CLASS)),this.add(this._thumbView=new Xi(t,Ro.THUMB_CLASS))}setScroll(t,e){if(this._reversed=e,t){const e=t.max-t.min,i=t.end-t.start;this._len=y(0,e),this._page=m(i,e),this._pos=m(t.min+e-i,y(0,t.start))}else this._len=0}getZoomPos(t){const e=this.model.axis._zoom,i=(this._vertical?this.height:this.width)-(this._vertical?this._thumbView.height:this._thumbView.width);return this.model.axis.options.reversed,(t=y(0,m(t,i)))*(e.max-e.min-(e.end-e.start))/i+e.min}_doMeasure(t,e,i,s,r){return this.setStyleOrClass(e._style),(this._vertical=!e.axis._isHorz)?{width:e.getThickness()+e.getGap()+e.getGapFar(),height:s}:{width:i,height:e.getThickness()+e.getGap()+e.getGapFar()}}_doLayout(t){const e=this.model,i=e.axis._zoom,s=this._szThumb=b(e.getMinThumbSize(),32),r=this._len,n=0===this._len,o=this._page,a=n?0:this._pos-i.min,l=e.getGap(),h=l+e.getGapFar();let _=this.width,c=this.height;if(this._vertical){_-=h,this._trackView.setBounds(l,0,_,c),c-=s;const t=(n||o===r?c:c*o/r)+s;this._reversed,this._thumbView.setBounds(l+1,n?0:this.height-c*a/r-t,_-2,t)}else{c-=l+e.getGapFar(),this._trackView.setBounds(0,l,_,c),_-=s;const t=(n||o===r?_:_*o/r)+s;this._reversed,this._thumbView.setBounds(n?0:_*a/r,l+1,t,c-2)}}}Ro.CLASS_NAME="rct-axis-scrollbar",Ro.TRACK_CLASS="rct-axis-scrollbar-track",Ro.THUMB_CLASS="rct-axis-scrollbar-thumb";const $o=/\${label}.*?/g;class Io extends Ao{constructor(t){super(t,Io.AXIS_CLASS),this._simpleMode=!1,this._markViews=[],this._minorMarkViews=[],this._categoryTreeLevelSizes=[],this._categoryTreeLevelOffsets=[],this._categoryTreeExtraSize=0,this.add(this._lineView=new zr(t,Io.LINE_CLASS)),this.add(this._titleView=new Mo(t)),this.add(this._markContainer=new Jt(t,"rct-axis-ticks")),this.add(this._minorMarkContainer=new Jt(t,"rct-axis-minor-ticks")),this.add(this._labelContainer=new Jt(t,"rct-axis-labels")),this.add(this._unitView=new Eo(t)),this._labelViews=new go(this._labelContainer,Do,"rct-axis-label")}$_checkScrollView(t,e,i,s,r){if(this.model._isX){if(e.visible&&!this.model._isBetween)return this._scrollView||this.add(this._scrollView=new Ro(t)),this._scrollView.setVis(!0),this._scrollView.measure(t,e,s,r,1)[i];this._scrollView&&this._scrollView.setVis(!1)}return 0}checkHeight(t,e,i){const s=this.model,r=s.title,n=s.unitLabel;let o=s.tick._inside?y(0,s.tick._getGap()):y(0,s.tick._getLength())+y(0,s.tick._getGap()),a=0;if(this.$_prepareLabels(s,e)){const t=this.$_measureLabelsHorz(s,e,!0);s.label._inside?a=t:o+=t}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,i,1).height)),o+=a,this._titleView.setVis(r.visible)&&(o+=this._titleView.measure(t,r,e,i,1).height,o+=r.getGap()),o+=this.$_checkScrollView(t,s.scrollBar,"height",e,i),o}checkWidth(t,e,i){const s=this.model,r=s.title,n=s.unitLabel;let o=s.tick._inside?y(0,s.tick._getGap()):y(0,s.tick._getLength())+y(0,s.tick._getGap()),a=0;if(this.$_prepareLabels(s,e)){const t=this.$_measureLabelsVert(s,i,!0,0);s.label._inside?a=t:o+=t}return this._unitView.setVis(n.visible)&&(a=Math.max(a,this._unitView.measure(t,n,e,i,1).width)),o+=a,(this._titleView.visible=r.visible)&&(o+=this._titleView.measure(t,r,e,i,1).width,o+=r.getGap()),o+=this.$_checkScrollView(t,s.scrollBar,"width",e,i),o}prepareGuides(t,e,i,s,r){[s,r].forEach((s,r)=>{const n=this.model.guides.filter(t=>t.options.front==(1===r)&&t.canConstainedTo(e,i));s.setAll(t,n,!1)})}showCrosshair(t,e){const i=this.model;let s,r=this._crosshairView;r||this.add(r=this._crosshairView=new Oo(this.doc)),r.setVis(!0),r.setText(i.crosshair,e);const n=r.getBBox();i._isHorz?r.trans(t-n.width/2,i.tick._getLength()):(s="opposite"===i._runPos?m(0,this.width-n.width):y(0,this.width-i.tick._getLength()-n.width),r.trans(s,t-n.height/2))}setMargins(t,e,i,s){}hideCrosshair(){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,i=this.model;if((!e||e===i)&&t){const t=this._prevMin,e=this._prevMax,s=this._prevMin=i.axisMin(),r=this._prevMax=i.axisMax();if(!isNaN(e)&&r!==e||!isNaN(t)&&s!==t){if(i._isX&&i._zooming)return{axis:i,from:this._prevMin,to:r};i.chart.animatable()&&i.options.animatable&&i.checkExtents(t,e)}}this._prevModel=i}clean(){this._prevMax=this._prevMin=NaN,this._prevModel=null}_doMeasure(t,e,i,s,r){var n;const o=e.line,a=e.tick,l=e._isHorz,h=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),h&&(this._lineView2?this._lineView2.setVis(!0):this.insertChild(this._lineView2=new zr(t,Io.LINE_CLASS),this._lineView),this._lineView.setStyleOrClass(o._style))):this._lineView2&&this._lineView2.setVis(!1),this._markLen=a._getLength(),this._tickGap=a._getGap(),e.tick._inside||(d+=this._markLen,d+=this._tickGap,h&&(d*=2)),this.$_prepareTickMarks(t,e)&&this._markViews.forEach(n=>n.measure(t,e.tick,i,s,r)),e instanceof vr?(this._minorMarkLen=e.minorTick._getLength(),this.$_prepareMinorTickMarks(t,e)&&this._minorMarkViews.forEach(n=>n.measure(t,e.minorTick,i,s,r))):this._minorMarkContainer.setVis(!1),this.$_prepareLabels(e,l?i:s)&&(u=l?this.$_measureLabelsHorz(e,i):this.$_measureLabelsVert(e,s,!1,r),e.label._inside&&(u=0)),this._labelSize=u,c.setVis(e.unitLabel.visible)&&(u=l?Math.max(u,this._unitView.measure(t,e.unitLabel,s,s,r).height):Math.max(u,this._unitView.measure(t,e.unitLabel,s,s,r).width)),d+=u,this._simpleMode?(_.setVis(!1),c.setVis(!1)):(_.visible&&(d+=l?_.mh:_.mw,d+=+e.title.options.gap||0),(null===(n=this._scrollView)||void 0===n?void 0:n.visible)&&(d+=l?this._scrollView.mh:this._scrollView.mw)),{width:l?i:d,height:l?d:s}}_doLayout(){const t=this.model,e=t._isHorz,i=t._isOpposite,s=t._isBetween,r=t.label._inside,n=t.tick._inside,o=t._ticks,a=t._markPoints,l=this._labelViews,h=this._unitView,_=this._markLen,c=this._tickGap,d=this.width,u=this.height;this._lineView.visible&&(e?this._lineView.setHLine(i?u:0,0,d):this._lineView.setVLine(i?0:d,0,u),this._lineView2&&(e?this._lineView2.setHLine(u,0,d):this._lineView2.setVLine(0,0,u))),this._markContainer.visible&&this.$_layoutTickMarkViews(this._markViews,a,_,t,e,i,n,d,u),t instanceof vr&&this._minorMarkContainer.visible&&this.$_layoutTickMarkViews(this._minorMarkViews,t._minorMarkPoints,this._minorMarkLen,t,e,i,n,d,u);const p=(r===n?_:0)+c,g=t instanceof ms?t:null;if(t._ani&&(this._labelContainer.visible?this._labelSize=e?this.$_measureLabelsHorz(t,d):this.$_measureLabelsVert(t,u,!1,0):(null==g?void 0:g.hasCategoryTree())&&(this._labelSize=this.$_measureCategoryTree(g,e,!1,e?d:u))),this._labelContainer.visible&&l.count>0?(l.count>o.length?l.prepare(o.length):l.count<o.length&&at.warn("labelViews.count < ticks.length",l.count,o.length),e?(this.$_layoutLabelsHorz(l,o,r,s,i,d,u,p),this.$_layoutCategoryTreeHorz(t,r,i,d,u,p)):(this.$_layoutLabelsVert(l,o,r,s,i,d,u,p),this.$_layoutCategoryTreeVert(t,r,i,d,u,p))):e?this.$_layoutCategoryTreeHorz(t,r,i,d,u,p):this.$_layoutCategoryTreeVert(t,r,i,d,u,p),h.visible&&(e?this.$_layoutUnitHorz(h,l,i,d,u,p):this.$_layoutUnitVert(h,l,i,d,u,p)),!this._simpleMode){const s=t.title.options,o=this._titleView,a=this._scrollView,l=this._labelSize,h=r?n?0:_+c:p+l;let g=0,f=0;if(o.visible){const r=+s.offset||0,n=+s.gap||0;if(o.resizeByMeasured().layout(e),e){if(f+=i?0:h+n,t.options.reversed)switch(s.align){case"start":g=d-o.width/2-r;break;case"end":g=o.width/2+r;break;default:g=d/2-r}else switch(s.align){case"start":g=o.width/2+r;break;case"end":g=d-o.width/2-r;break;default:g=d/2+r}o.trans(g,f),f+=o.height}else{const t=0===o._angle?o.width:o.height;if(g=i?h+n+t/2:d-h-n-t/2,this._reversed)if(0===o._angle)switch(s.align){case"start":f=0+r;break;case"end":f=u-o.height-r;break;default:f=(u-o.height)/2+r}else switch(s.align){case"start":f=o.width/2-o.height/2+r;break;case"end":f=u-o.width/2-o.height/2-r;break;default:f=(u-o.height)/2+r}else if(0===o._angle)switch(s.align){case"start":f=u-o.height-r;break;case"end":f=0+r;break;default:f=(u-o.height)/2-r}else switch(s.align){case"start":f=u-o.width/2-o.height/2-r;break;case"end":f=o.width/2-o.height/2+r;break;default:f=(u-o.height)/2-r}o.trans(g,f)}}else f+=i?0:h;(null==a?void 0:a.visible)&&(e?(a.trans(0,f).resize(this.width,a.mh),a.setScroll(t._zoom,this._reversed)):(a.trans(0,0).resize(a.mw,this.height),a.setScroll(t._zoom,this._reversed)),a.layout())}}$_syncTickMarkViews(t,e,i,s,r=Io.TICK_CLASS){for(;i.length<s;){const s=new Bo(t,r);e.add(s),i.push(s)}for(;i.length>s;)i.pop().remove()}$_prepareTickMarkViews(t,e,i,s,r,n=Io.TICK_CLASS){return!!(e.visible=s)&&(this.$_syncTickMarkViews(t,e,i,r,n),!0)}$_layoutTickMarkViews(t,e,i,s,r,n,o,a,l){r?t.forEach((t,r)=>{t.resize(1,i),t.layout().trans(s.prev(e[r]),n?o?l:l-i:o?-i:0)}):t.forEach((t,r)=>{t.resize(i,1),t.layout().trans(n?o?-i:0:o?a:a-i,l-s.prev(e[r]))})}$_prepareTickMarks(t,e){return this.$_prepareTickMarkViews(t,this._markContainer,this._markViews,e.tick.visible,e._markPoints.length)}$_prepareMinorTickMarks(t,e){return this.$_prepareTickMarkViews(t,this._minorMarkContainer,this._minorMarkViews,e.minorTick.visible,e._minorMarkPoints.length,Io.MINOR_TICK_CLASS)}_prepareLabel(t,e,i,s,r){if(!r&&t.value===e.value)return;const n=i.getLabelText(e,s),o=e.label,a=i.getLabelStyle(e,s);if(t.value=e.value,null!=n){o&&n.match($o)?t.setLabel(i,a,e,n.replace($o,o),1e3,1e3):(i.prepareRich(n),i._paramTick=e,t.setModel(this.doc,i,i.getIconUrl(i.getIcon(e)),a),i.buildSvg(t._text,t._outline,NaN,NaN,i,i._domain))}else t.setLabel(i,a,e,o,1e3,1e3);t.applyBackgroundCallback(i,e),t.layout("center")}$_resolveCategoryTreeRotation(t,e,i,s,r){const n=t.getLevelRotation(e.level);if("auto"!==n)return n;if(!i)return 0;const o=t.getCategoryTreeSpan(e.start,e.end,s);return isNaN(o.size)||o.size<=0?0:r._text.getBBox().width>o.size?-90:0}$_prepareCategoryTreeLabel(t,e,i,s,r,n,o,a){const l=s.getLevelStyle(i.level);if(!(!n&&t.index===r&&t.groupLevel===i.level&&t.value===i.start&&t.col===i.end&&t.categoryTreeLabel===i.label&&this.$_equalSVGStyleOrClass(t.categoryTreeStyle,l))){t.index=r,t.groupLevel=i.level,t.value=i.start,t.col=i.end,t.categoryTreeLabel=i.label,t.categoryTreeStyle=l,t.invalidateBackPad(),e.prepareRich(i.label),t.setModel(this.doc,e,null,l),e.buildSvg(t._text,t._outline,NaN,NaN,e,e._domain);const n=s._ticks[i.start];n&&t.applyBackgroundCallback(e,n),t.setContrast(null).layout(s.getLevelAlign(i.level))}t.rotation=this.$_resolveCategoryTreeRotation(s,i,o,a,t)}$_isCategoryTreeSpanVisible(t){return!isNaN(t.center)&&!isNaN(t.size)}$_equalSVGStyleOrClass(t,e){if(t===e)return!0;if(null==t||null==e)return t==e;if(o(t)||o(e))return t===e;if(!s(t)||!s(e))return!1;const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!1;for(const s of i)if(t[s]!==e[s])return!1;return!0}$_applyLabelRotationVert(t,e,i,s,r){const n=e.x+e.width/2,o=e.y+e.height/2;return t.setRotation(n,o,i),{x:r-n,y:s-o}}$_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,i,s,r,n,o,a){const l=t.label,h=y(0,m(s-1,l.options.startStep||0)),_=t._ticks,c=_.length,d=(s=y(1,s))*(r=m(y(1,r),_.length)),u=n||0,g=x(u)*B,f=g<35*B;let b,w=!1,v=0;for(let n=0;n<r;n++){let r=n*s+h;for(;r<c;r+=d){let s=0;for(let e=r;e<r+d&&e<c;e++)s+=t.getLabelLength(i,_[e].value);if(r+d<c){b=e.pull(v++),b.rotation=u,b.row=n,b.index=r,this._prepareLabel(b,_[r],l,c,a),b.setVis(!0);const t=s;if(0===u&&b.getBBox().width>=t){w=!0;break}if(f&&b.getBBox().width*p(g)>=t){w=!0;break}if(0!==u&&b.getBBox().height>=t){w=!0;break}}}if(w)return!0;{const t=r-d;0<=t&&t<c&&(b=e.pull(v++),b.row=n,b.rotation=u,b.index=t,this._prepareLabel(b,_[t],l,c,a),b.setVis(!0))}}!o&&e.freeFrom(v)}$_applyStep(t,e,i){const s=t.label,r=y(0,m(i-1,s.options.startStep||0));e.forEach(t=>t.index=-1);for(let t=r;t<e.length;t+=i)e[t].index=t;return e.forEach(t=>t.setVis(t.index>=0)),e.filter(t=>t.visible)}$_measureLabelsHorz(t,e,i=!1){const s=t.options.reversed,r=t.label,n=r.options,o=t instanceof ms?t:null;if(null==o?void 0:o.hasCategoryTree())return this._labelContainer.setVis(!1),this.$_measureCategoryTree(o,!0,i,e);let a=+n.step|0,l=+n.rows|0;const h=l;let _,c=+n.rotation%360,d=this.$_checkOverlappedHorz2(t,this._labelViews,e,a,l,c,!1,i),u=this._labelViews._internalItems();if(this._labelRowPts=[0],d)if("none"===n.autoArrange)this._labelViews.prepare(t._ticks.length,(e,s,n)=>{e.rotation=c,e.row=0,e.index=s,this._prepareLabel(e,t._ticks[s],r,n,i),e.setVis(!0)}),u=this.$_applyStep(t,u,a||1);else{switch(a=l=0,r.options.autoArrange){case"rows":l=this.$_getRows(u);break;case"step":a=this.$_getStep(u)}if(a>1){const s=t._ticks.length;for(;a<=s&&this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,i);)a++}else if(l>1){const s=h>1?h:y(1,+n.maxRows|0);l=m(h>1?h:l,s);let r=!1;for(;t._ticks.length>l;){if(u.forEach((t,e)=>{t.row=e%l,t.index=e}),!this.$_checkOverlappedHorz2(t,this._labelViews,e,1,l,0,!1,i)){r=!0;break}if(l>=s)break;l++}if(r)this._labelRowPts=[];else{l=1,a=2;const s=t._ticks.length;for(;a<=s&&this.$_checkOverlappedHorz2(t,this._labelViews,e,a,1,0,!1,i);)a++}}else if((isNaN(c)||Math.abs(Math.tan(c*B))<1)&&(c=-45),this.$_checkOverlappedHorz2(t,this._labelViews,e,a,l,c,!1,i)){a=2;const s=t._ticks.length;for(;a<=s;){if(!this.$_checkOverlappedHorz2(t,this._labelViews,e,a,l,c,!1,i)){this.$_checkOverlappedHorz2(t,this._labelViews,e,a,l,0,!0,i)&&u.forEach((t,e)=>{t.rotation=c});break}a++}}}else;if(u.length>0){if(l>1){const t=!isNaN(c)&&0!=c,e=this._labelRowPts;for(let t=0;t<l;t++)e.push(0);u.forEach(i=>{e[i.row]=y(e[i.row],t?i.rotatedHeight():i.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(c)||0==c){_=u[0].getBBox().height;for(let t=1;t<u.length;t++)_=y(_,u[t].getBBox().height);if(u.length>1){const e=t._ticks;let i=s?n.lastOverflow:n.firstOverflow;if("hidden"===i){const t=u[0],i=t.rotatedWidth();let s=e[t.index].pos-i/2,r=0;for(let t=1;t<u.length;t++)r=y(r,u[t].getBBox().height);(s+i>u[1].tx||t.elementToSvg(0,0).x<0)&&t.getBBox().height>r?(_=r,t.hidden=!0):t.hidden=!1}if(i=s?n.firstOverflow:n.lastOverflow,"hidden"===i){const t=u[u.length-1],i=t.rotatedWidth(),s=u[u.length-2],r=e[t.index-1].pos+s.getBBox().width/2;let n=e[t.index].pos-i/2,o=0;for(let t=0;t<u.length-1;t++)o=y(o,u[t].getBBox().height);(n<=r||t.elementToSvg(t.getBBox().width,0).x>this.control.getBounds().width)&&t.getBBox().height>o?(_=o,t.hidden=!0):t.hidden=!1}}}else{_=u[0].rotatedHeight();for(let t=1;t<u.length;t++)_=y(_,u[t].rotatedHeight())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),_}return 0}$_checkOverlappedVert2(t,e,i,s,r,n){const o=t.label,a=t._ticks,l=a.length,h=y(1,s);let _,c=o.options.startStep||0,d=0;for(;c<l;c+=h){let s=0;for(let e=c;e<c+h&&e<l;e++)s+=t.getLabelLength(i,a[e].value);if(c+h<l&&(_=e.pull(d++),_.rotation=r,_.index=c,this._prepareLabel(_,a[c],o,l,n),_.setVis(!0),_._text.getBBox().height>=s))return!0}const u=c-h;0<=u&&u<l&&(_=e.pull(d++),_.rotation=r,_.index=u,this._prepareLabel(_,a[u],o,l,n),_.setVis(!0)),e.freeFrom(d)}$_measureLabelsVert(t,e,i=!1,s=0){if(s>1&&t instanceof vr)return this._prevWidth;const r=t instanceof ms?t:null;if(null==r?void 0:r.hasCategoryTree())return this._labelContainer.setVis(!1),this.$_measureCategoryTree(r,!1,i,e);const n=t.label,o=+n.options.rotation%360;let a=y(1,+n.options.step|0);const l=this.$_checkOverlappedVert2(t,this._labelViews,e,a,o,i);let h=this._labelViews._internalItems();if(l)if("none"===n.options.autoArrange)this._labelViews.prepare(t._ticks.length,(e,s,r)=>{e.rotation=o,e.index=s,this._prepareLabel(e,t._ticks[s],n,r,i),e.setVis(!0)}),h=this.$_applyStep(t,h,a||1);else{const s=t._ticks.length;for(;a<=s&&this.$_checkOverlappedVert2(t,this._labelViews,e,++a,o,i););}else;if(this._labelViews.freeHiddens(),h=this._labelViews._internalItems(),h.length>0){const e=t._isOpposite?"left":t._isBetween?"center":"right",i=this._labelContainer.textAlign()||e;let s;if(isNaN(o)||0===o){h[0].setContrast(null).layout(i),s=h[0].getBBox().width;for(let t=1;t<h.length;t++)h[t].setContrast(null).layout(i),s=y(s,h[t].getBBox().width)}else{h[0].setContrast(null).layout(i),s=h[0].rotatedWidth();for(let t=1;t<h.length;t++)h[t].setContrast(null).layout(i),s=y(s,h[t].rotatedWidth())}return this._categoryTreeExtraSize=0,this.$_hideCategoryTreeViews(),this._prevWidth=s}return 0}$_ensureCategoryTreeViews(){this._categoryTreeBandContainer||(this.add(this._categoryTreeBandContainer=new Jt(this.doc,"rct-axis-tree-bands")),this._categoryTreeBandViews=new go(this._categoryTreeBandContainer,Xi,"rct-axis-tree-band")),this._categoryTreeLabelContainer||(this.add(this._categoryTreeLabelContainer=new Jt(this.doc,"rct-axis-tree-labels")),this._categoryTreeLabelViews=new go(this._categoryTreeLabelContainer,Do,"rct-axis-tree-label")),this._categoryTreeDividerContainer||(this.add(this._categoryTreeDividerContainer=new Jt(this.doc,"rct-axis-tree-dividers")),this._categoryTreeDividerViews=new go(this._categoryTreeDividerContainer,zr,"rct-axis-tree-divider"))}$_hideCategoryTreeViews(){var t,e,i;null===(t=this._categoryTreeLabelContainer)||void 0===t||t.setVis(!1),null===(e=this._categoryTreeBandContainer)||void 0===e||e.setVis(!1),null===(i=this._categoryTreeDividerContainer)||void 0===i||i.setVis(!1)}$_measureCategoryTree(t,e,i,s){this.$_ensureCategoryTreeViews();const r=t.getCategoryTreeGroups(),n=t.getCategoryTreeDepth(),o=t.label,a=t._ani?this._categoryTreeLevelSizes:null,l=this._categoryTreeLevelSizes=[],h=this._categoryTreeLevelOffsets=[],_=Io.HIERARCHY_ROW_GAP;let c=0;this._categoryTreeLabelContainer.setStyleOrClass(o._style),this._categoryTreeLabelContainer.setVis(r.length>0),this._categoryTreeLabelViews.prepare(r.length,(n,h)=>{const _=r[h],c=t.isLevelVisible(_.level);if(this.$_prepareCategoryTreeLabel(n,o,_,t,h,i,e,s),n.setVis(c),c){const t=e?n.rotatedHeight():n.rotatedWidth();let i=y(l[_.level]||0,t);null!=(null==a?void 0:a[_.level])&&(i=y(i,a[_.level])),l[_.level]=i}});for(let e=0;e<n;e++)h[e]=c,t.isLevelVisible(e)&&(c+=(l[e]||0)+_);return this._categoryTreeExtraSize=c,c}$_syncCategoryTreeMeasure(t,e,i){t._ani&&this.$_measureCategoryTree(t,e,!1,i)}$_layoutCategoryTreeHorz(t,e,i,s,r,n){const o=t instanceof ms?t:null;if(!(null==o?void 0:o.hasCategoryTree()))return void this.$_hideCategoryTreeViews();const a=o._isHorz?s:r;this.$_ensureCategoryTreeViews(),this.$_syncCategoryTreeMeasure(o,!0,a);const l=o.getCategoryTreeGroups(),h=o.label,_=this._categoryTreeLabelViews,c=this._categoryTreeLevelOffsets,d=n,u=this._categoryTreeExtraSize;this.$_layoutCategoryTreeBandsHorz(o,a,e,i,r,d,u);const p=h.options.fillToCategory,g="background"===h.options.effect;_.forEach((t,s)=>{const n=l[s];if(!o.isLevelVisible(n.level))return void t.setVis(!1);const h=o.getCategoryTreeSpan(n.start,n.end,a);if(!this.$_isCategoryTreeSpanVisible(h))return void t.setVis(!1);const _=o.getLevelAlign(n.level);t.setContrast(null).layout(_);const u=t.rotation,f=t.getBBox(),m=Math.abs(u)>15;let y,x,b=0;p&&!m&&(b="left"===_?(h.size-f.width)/-2:"right"===_?(h.size-f.width)/2:0);const w=this._categoryTreeLevelSizes[n.level]||(m?t.rotatedHeight():f.height);let v;v=e?i?r+d+c[n.level]+w/2:-d-c[n.level]-w/2:i?r-d-c[n.level]-w/2:d+c[n.level]+w/2;const S=o.getLabelX(a,h.center),V=f.x+f.width/2,C=f.y+f.height/2;t.setRotation(V,C,u),x=S-V+b,y=v-C,t.trans(x,y),t.setVis(!0),g&&t.resizeBackBySpan(h.size,b,!0)}),this.$_layoutCategoryTreeDividers(o,a,!0,e,i,s,r,n,0,u,0)}$_getBandY(t,e,i,s,r){const n=s+r,o=t?e?i:-n:e?i-n:0,a=t?e?i+n:0:e?i:n;return{yMin:m(o,a),yMax:y(o,a)}}$_getLevelBoundaryY(t,e,i,s,r,n){const o=this._categoryTreeLevelOffsets,a=t>=o.length?i:o[t];return s?r?n+e+a:-e-a:r?n-e-a:e+a}$_getLevelBoundaryX(t,e,i,s,r,n,o,a){const l=this._categoryTreeLevelOffsets,h=t>=l.length?i:l[t];return s?r?-e-h:n+e+h:r?o+a+h:n-e-h}$_getLevelColumnCenterX(t,e,i,s,r,n,o,a,l){const{x0:h,x1:_}=this.$_getLevelRowXRange(t,e,i,s,r,n,o,a,l);return(h+_)/2}$_getLevelRowYRange(t,e,i,s,r,n,o){const{yMin:a,yMax:l}=this.$_getBandY(i,s,r,n,o),h=0===t?a:this.$_getLevelBoundaryY(t,n,o,i,s,r),_=t===e-1?l:this.$_getLevelBoundaryY(t+1,n,o,i,s,r);return{y0:m(h,_),y1:y(h,_)}}$_getLevelRowXRange(t,e,i,s,r,n,o,a,l){const h=this.$_getLevelBoundaryX(t,n,o,i,s,r,a,l),_=this.$_getLevelBoundaryX(t+1,n,o,i,s,r,a,l);return{x0:m(h,_),x1:y(h,_)}}$_countCategoryTreeDividerLines(t,e=!0){const i=t.getCategoryTreeDepth();let s=0;e&&t.isDividerTopCap()&&(s+=1);for(let e=0;e<i;e++)t.isDividerEdge(e)&&(s+=2),t.isDividerBetween(e)&&(s+=t.getDividerEnds(e).length),t.isDividerBelow(e)&&(s+=1);return s}$_prepareCategoryTreeBands(t){var e,i;if(!t.isBandVisible())return null===(e=this._categoryTreeBandContainer)||void 0===e||e.setVis(!1),null;const s=t.getBandGroups();return s.length?(this._categoryTreeBandContainer.setVis(!0),s):(null===(i=this._categoryTreeBandContainer)||void 0===i||i.setVis(!1),null)}$_getCategoryTreeLabelXBounds(t,e,i,s,r,n,o){const a=s+r,l=t?e?-n-a:i:e?0:o-r,h=t?e?0:i+a+n:e?o+a+n:i;return{xMin:m(l,h),xMax:y(l,h)}}$_getCategoryTreeEdgeYBounds(t,e){const i=t.getDividerLinePositions(e),s=t.getLabelY(e,i[0]),r=t.getLabelY(e,i[i.length-1]);return{yMin:m(s,r),yMax:y(s,r)}}$_applyCategoryTreeDividerLine(t,e,i){const s=e.getDividerStyle(i);null!=s?(t.setStyleOrClass(s),t.setVis(!0)):t.setVis(!1)}$_layoutCategoryTreeBandsHorz(t,e,i,s,r,n,o){const a=this.$_prepareCategoryTreeBands(t);if(!a)return;const{yMin:l,yMax:h}=this.$_getBandY(i,s,r,n,o),_=x(h-l);this._categoryTreeBandViews.prepare(a.length,(i,s)=>{const r=a[s],n=t.getCategoryTreeSpan(r.start,r.end,e);if(!this.$_isCategoryTreeSpanVisible(n))return void i.setVis(!1);const o=t.getLabelX(e,n.center)-n.size/2;i.setStyleOrClass("rct-axis-tree-band-"+s%2),i.setFill(t.getBandColor(s)),i.rect={x:o,y:m(l,h),width:n.size,height:_},i.setVis(!0)})}$_layoutCategoryTreeBandsVert(t,e,i,s,r,n,o,a,l){const h=this.$_prepareCategoryTreeBands(t);if(!h)return;const{xMin:_,xMax:c}=this.$_getCategoryTreeLabelXBounds(i,s,r,n,o,a,l),d=x(c-_);this._categoryTreeBandViews.prepare(h.length,(i,s)=>{const r=h[s],n=t.getCategoryTreeSpan(r.start,r.end,e);if(!this.$_isCategoryTreeSpanVisible(n))return void i.setVis(!1);const o=t.getLabelY(e,n.center)-n.size/2;i.setStyleOrClass("rct-axis-tree-band-"+s%2),i.setFill(t.getBandColor(s)),i.rect={x:_,y:o,width:d,height:n.size},i.setVis(!0)})}$_layoutCategoryTreeDividers(t,e,i,s,r,n,o,a,l,h,_){var c,d,u;if(!t.isDividerVisible())return void(null===(c=this._categoryTreeDividerContainer)||void 0===c||c.setVis(!1));const p=t.getDividerLinePositions(e);if(p.length<2)return void(null===(d=this._categoryTreeDividerContainer)||void 0===d||d.setVis(!1));const g=this.$_countCategoryTreeDividerLines(t,i);if(g<=0)return void(null===(u=this._categoryTreeDividerContainer)||void 0===u||u.setVis(!1));this._categoryTreeDividerContainer.setVis(!0),this._categoryTreeDividerViews.prepare(g);const f=t.getCategoryTreeDepth();let x=0;if(i){const i=a,{yMin:n}=this.$_getBandY(s,r,o,i,h),l=t.getLabelX(e,p[0]),_=t.getLabelX(e,p[p.length-1]),c=m(l,_),d=y(l,_);if(t.isDividerTopCap()){const e=this._categoryTreeDividerViews.get(x++);this.$_applyCategoryTreeDividerLine(e,t),e.setHLine(n,c,d)}for(let n=0;n<f;n++){const{y0:a,y1:l}=this.$_getLevelRowYRange(n,f,s,r,o,i,h);if(t.isDividerEdge(n)&&[p[0],p[p.length-1]].forEach(i=>{const s=this._categoryTreeDividerViews.get(x++),r=t.getLabelX(e,i);this.$_applyCategoryTreeDividerLine(s,t,n),s.setVLine(r,a,l)}),t.isDividerBetween(n)&&t.getDividerEnds(n).forEach(i=>{const s=this._categoryTreeDividerViews.get(x++),r=t.getLabelX(e,t.getDividerPos(i,e));this.$_applyCategoryTreeDividerLine(s,t,n),s.setVLine(r,a,l)}),t.isDividerBelow(n)){const e=this._categoryTreeDividerViews.get(x++);this.$_applyCategoryTreeDividerLine(e,t,n),e.setHLine(l,c,d)}}}else{const{yMin:i,yMax:o}=this.$_getCategoryTreeEdgeYBounds(t,e);for(let c=0;c<f;c++){const{x0:d,x1:u}=this.$_getLevelRowXRange(c,f,s,r,n,a,h,_,l);if(t.isDividerEdge(c)&&[p[0],p[p.length-1]].forEach(i=>{const s=this._categoryTreeDividerViews.get(x++),r=t.getLabelY(e,i);this.$_applyCategoryTreeDividerLine(s,t,c),s.setHLine(r,d,u)}),t.isDividerBetween(c)&&t.getDividerEnds(c).forEach(i=>{const s=this._categoryTreeDividerViews.get(x++),r=t.getLabelY(e,t.getDividerPos(i,e));this.$_applyCategoryTreeDividerLine(s,t,c),s.setHLine(r,d,u)}),t.isDividerBelow(c)){const e=this._categoryTreeDividerViews.get(x++);this.$_applyCategoryTreeDividerLine(e,t,c),e.setVLine(u,i,o)}}}}$_layoutCategoryTreeVert(t,e,i,s,r,n){var o;const a=t instanceof ms?t:null;if(!(null==a?void 0:a.hasCategoryTree()))return void this.$_hideCategoryTreeViews();const l=r;this.$_ensureCategoryTreeViews(),this.$_syncCategoryTreeMeasure(a,!1,l);const h=a.getCategoryTreeGroups(),_=a.label,c=this._categoryTreeLabelViews,d=this._categoryTreeExtraSize,u=this._titleView,p=u.visible?u.rotatedWidth()+(null===(o=u.model)||void 0===o?void 0:o.options.gap):0,g=t.tick._getGap();this.$_layoutCategoryTreeBandsVert(a,l,e,i,s,n,g,d,p);const f=_.options.fillToCategory,m=f?_.options.verticalAlign:"middle",y="background"===_.options.effect;c.forEach((t,r)=>{const o=h[r];if(!a.isLevelVisible(o.level))return void t.setVis(!1);const _=a.getCategoryTreeSpan(o.start,o.end,l);if(!this.$_isCategoryTreeSpanVisible(_))return void t.setVis(!1);const c=t.rotation,u=a.getLevelAlign(o.level);t.setContrast(null).layout(u);const x=t.getBBox(),b=Math.abs(c)>15,w=b?t.rotatedWidth():x.width,v=b?t.rotatedHeight():x.height;let S,V,C=0;f&&(C="top"===m?(_.size-v)/-2:"bottom"===m?(_.size-v)/2:0);const A=a.getLabelY(l,_.center)+C,P=this.$_getLevelColumnCenterX(o.level,a.getCategoryTreeDepth(),e,i,s,n,d,p,g);b?({x:S,y:V}=this.$_applyLabelRotationVert(t,x,c,A,P)):(S=P-w/2,V=A-v/2,isNaN(c)||t.setRotation(x.width/2,x.height/2,c)),t.trans(S,V),t.setVis(!0),y&&t.resizeBackBySpan(_.size,C,!1)}),this.$_layoutCategoryTreeDividers(a,l,!1,e,i,s,r,n,g,d,p)}$_layoutLabelsHorz(t,e,i,s,r,n,o,a){const l=this.model,h=l instanceof ms,_=h&&l.label.options.fillToCategory,c=l.label,d=this._reversed,u=this._labelContainer.textAlign()||"center",p=this._labelRowPts,f=t.get(0).rotation,m=f*B,y=+l.label.options.rows|0,x=f<-15&&f>=-90||f>15&&f<=90,b=t.count,w=h?l:null;let v,S,V;if(t.freeHiddens(),t.forEach((t,h)=>{const c=e[t.index];if(t.setVis(!!c)&&(t.setContrast(null).layout(u),v=t.getBBox(),S=w?w.getLabelX(n,c.pos):l.prev(c.pos),V=i?r?o+a+p[t.row]:-a-v.height-p[t.row]:r?o-a-v.height-p[t.row]:a+p[t.row],f<-15&&f>=-90?i?r?(V+=g(m)*v.height/2,t.setRotation(0,v.height/2,-f)):(V-=g(m)*v.height/2,t.setRotation(0,v.height/2,f)):r?(S-=v.width,V-=g(m)*v.height/2,t.setRotation(v.width,v.height/2,-f)):(S-=v.width,V+=g(m)*v.height/2,t.setRotation(v.width,v.height/2,f)):f>15&&f<=90?i?r?(S+=v.width,V-=g(m)*v.height/2,t.setRotation(v.width,v.height/2,-f)):(S-=v.width,V+=g(m)*v.height/2,t.setRotation(v.width,v.height/2,f)):r?(V+=g(m)*v.height/2,t.setRotation(0,v.height/2,-f)):(V-=g(m)*v.height/2,t.setRotation(0,v.height/2,f)):(S-=v.width/2,t.setRotation(v.width/2,0,r?-f:f)),t.trans(S,V),_&&w)){const e=w.getUnitLen(n,c.value),i=w.label.options.align||"center",l="left"===i?(e-v.width)/-2:"right"===i?(e-v.width)/2:0;t.transX(t.tx+l),t.resizeBackByWeight(w,s,r,n,o,a,0,e,l)}}),!_&&!x&&y<2&&b>1){let e=t.get(d?b-1:0);e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,i){const s=c.options,r=+s.overflowGap||2;let n=!0;const o=e.rotatedWidth(),a=d?s.lastOverflow:s.firstOverflow;let l,h=e.tx;h+o>=i.tx?"pull"===a?h=i?i.tx-o-r:0:n="hidden"!==a:(l=e.elementToSvg(0,0).x)<0&&("pull"===a?h=Math.min(i.tx-r,l+4):n="hidden"!==a),n?e.transX(h):e.setVis(!1)}(0,e,t.get(d?b-2:1)),e=t.get(d?0:b-1),e&&e.visible&&e.setVis(!e.hidden)&&function(t,e,i){const s=c.options,r=+s.overflowGap||2,o=i.tx+i.rotatedWidth();let a=!0,l=e.tx;const h=e.rotatedWidth(),_=d?s.firstOverflow:s.lastOverflow;let u,p;l<=o?"pull"===_?l=Math.max(o+r,n-h):a="hidden"!==_:(u=e.elementToSvg(e.getBBox().width,0).x)>(p=t.control.getBounds().width)&&("pull"===_?l=Math.max(o+r,l-(u-p+4)):a="hidden"!==_),a?e.transX(l):e.setVis(!1)}(this,e,t.get(d?1:b-2))}}$_layoutLabelsVert(t,e,i,s,r,n,o,a){var l;const h=this.model,_=h instanceof ms,c=_&&h.label.options.fillToCategory,d=r?i?"right":"left":s?"center":i?"left":"right",u=c?h.label.options.verticalAlign:"middle",p=c?h.label.options.align:d,g=this._titleView,f=g.visible?g.rotatedWidth()+(null===(l=g.model)||void 0===l?void 0:l.options.gap):0,m=this._labelSize,y=h.tick._getGap();const x=this._reversed,b=_?h:null;let w=x?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;const v=t.get(0).rotation,S=v<-15&&v>=-90||v>15&&v<=90;t.forEach((t,l)=>{const _=e[t.index];if(t.setVis(!!_)){t.setContrast(null).layout(p);const e=t.getBBox(),l=S?t.rotatedHeight():e.height,d=S?t.rotatedWidth():e.width,V=function(t,e){if(i)if(r)switch(t){case"center":return(m-e)/2-m-y-a;case"left":return-m-y-a;default:return-e-y-a}else switch(t){case"right":return n+a+y+m-e;case"center":return!g.visible&&s?(n-e)/2:n+a+y+(m-e)/2;default:return n+a+y}else if(r)switch(t){case"center":return a+(n-f-e-a+y)/2;case"right":return n-e-f+y;default:return a}else switch(t){case"left":return f-y;case"center":return!g.visible&&s?(n-e)/2:f+(n-f-e-a-y)/2;default:return n-a-e}}(p,d)+(d-e.width)/2,C=(b?b.getLabelY(o,_.pos):o-h.prev(_.pos))-e.height/2;if(0===v||isNaN(v)||t.setRotation(e.width/2,e.height/2,v),t.trans(V,C),c&&b){const i=b.getUnitLen(o,_.value),l="top"===u?(i-e.height)/-2:"bottom"===u?(i-e.height)/2:0;t.shiftY(l),t.resizeBackByWeight(b,s,r,n,o,a,y,i,l,f)}else!x&&t.ty+l>w+1||x&&t.ty<w-1?t.setVis(!1):w=x?t.ty+l:t.ty}})}$_layoutUnitHorz(t,e,i,s,r,n){const o=this.model,a=o.options.reversed,l="start"!==o.unitLabel.options.position,h=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p;a?l?(u=c.getBBox(),p=Math.min(c.tx-h.width-d,0)):(u=_.getBBox(),p=Math.max(_.tx+u.width+d,s-h.width)):l?(u=c.getBBox(),p=Math.max(c.tx+u.width+d,s-h.width)):(u=_.getBBox(),p=Math.min(_.tx-h.width-d,0)),t.resizeByMeasured().layout().trans(p,n)}$_layoutUnitVert(t,e,i,s,r,n){const o=this.model,a=o.options.reversed,l="start"!==o.unitLabel.options.position,h=t.getBBox(),_=e.first,c=e.last,d=o.unitLabel.options.gap||0;let u,p=i?n:s-h.width-n;a?l?(c.getBBox(),u=Math.max(c.ty+h.height+d,r)):u=Math.min(_.ty-h.height-d,0):l?u=Math.min(c.ty-h.height-d,0):(_.getBBox(),u=Math.max(_.ty+h.height+d,r)),t.resizeByMeasured().layout().trans(p,u)}}Io.AXIS_CLASS="rct-axis",Io.LINE_CLASS="rct-axis-line",Io.TICK_CLASS="rct-axis-tick",Io.HIERARCHY_ROW_GAP=2,Io.MINOR_TICK_CLASS="rct-axis-minor-tick";class Fo extends Jt{constructor(t,e,i){super(t,Fo.STYLE),this.add(this._back=new Xi(t,Fo.BACK_STYLE)),this.add(this._textView=new ue(t)),i&&this.dom.classList.add(i),e&&this.setText(e)}setText(t){this._textView.text=t}layout(t){this.setStyleOrClass(t),this._textView.layoutText();const e=getComputedStyle(this._back.dom),i=(new Vo).applyPadding(e),s=this._textView.getBBox();this._back.rect={x:0,y:0,width:s.width+i.left+i.right,height:s.height+i.top+i.bottom,rx:b(parseFloat(e.rx),0),ry:b(parseFloat(e.ry),0)},this._textView.trans(s.width/2+i.left,i.top)}click(){return!1}setVis(t){if(super.setVis(t))return t&&this._textView.stain(),!0}}Fo.STYLE="rct-button",Fo.BACK_STYLE="rct-button-background";class zo extends Jt{constructor(t,e){super(t,e,"circle")}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class Ho extends ne{setArc(t,e,i,s,r,n){this.setPath(Yi.arc(t,e,i,i,s,close?s+r:s-r,n))}}class Go extends Ho{setPolyline(t){this.setPath(Yi.polygon(...t))}}const jo={};class Wo extends Po{static register(...t){t.forEach(t=>{jo[t[0].type]=t[1]})}constructor(t,e){super(t,Wo.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,i){this.measure(this.doc,this.model,e,i,0),this._layoutView(this.chart().isInverted(),t,0,0,e,i)}addToTransform(t){this._transform.add(t)}_layoutView(t,e,i,s,r,n){this.resizeByMeasured(),this.layout(this._posByAnchor(e)||this.model.getPosition(this.chart().isInverted(),i,s,r,n,this.width,this.height))}_posByAnchor(t){const e=this.model,i=e._anchorObj;if(i){const s=t.getAnnotationAnchor(i);if(s){const t=e.getOffset(this.width,this.height),i=s.width,r=s.height;let n=s.tx,o=s.ty;switch(this.options.align){case"left":n-=this.width+t.x;break;case"right":n+=i+t.x;break;default:n+=(i-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,i){this.isClip(this._clip)||this.setClip(this._clip=t.clipBounds()),this._clip.setBounds(0,0,e,i)}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)}}Wo.CLASS_NAME="rct-annotation";const Yo={};class Xo extends Lo{static register(...t){t.forEach(t=>{Yo[t[0].type]=t[1]})}constructor(t,e){super(t,e),this.dom.classList.add(this._defaultCalss()),this.add(this._paneElement=new Xi(t,Xo.PANE_CLASS)),this.add(this._contentContainer=new ee(t,null)),this._doInitContents(t,this._contentContainer)}_defaultCalss(){return Xo.GAUGE_CLASS}clicked(t){}prepareGauge(t,e){this._prepareGauge(t,e)}getPosition(t,e){const i=this.model;let s=i.getLeft(t),r=i.getTop(e);return isNaN(s)&&(s=i.getRight(t)-this.width,isNaN(s)&&(s=(t-this.width)/2)),isNaN(r)&&(r=i.getBottom(e)-this.height,isNaN(r)&&(r=(e-this.height)/2)),{x:s,y:r}}isEmptyView(){return!1}_prepareStyleOrClass(t){this._paneElement.setStyleOrClass(t.options.backgroundStyle)}_doMeasure(t,e,i,s,r){return e.getSize(i,s)}_doLayout(){let t=this.width,e=this.height;this._paneElement.resizeRect(t,e);const i=c($t.getPadding(this.dom));t-=i.left+i.right,e-=i.top+i.bottom,this._renderGauge(t,e),this._contentContainer.trans(i.left,i.top)}_getGroupView(){let t=this.parent;for(;t;){if(t instanceof qo)return t;t=t.parent}}}Xo.GAUGE_CLASS="rct-gauge",Xo.PANE_CLASS="rct-gauge-pane";class Uo extends Yt{constructor(t){super(),this.view=t}_doUpdate(t){return this.view._setValueRate(t),!0}}class Zo extends No{}class qo extends Xo{_defaultCalss(){return qo.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,i){super._setChartOptions(t,e,i),this._gaugeViews.forEach(s=>s._setChartOptions(t,e,i))}_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,i){i.forEach((i,s)=>{i.prepareGauge(t,e.getVisible(s))})}}qo.GAUGE_GROUP_CLASS="rct-gauge-group";class Ko{static reveal(t,e){new ta(t,e)}static grow(t,e){new ia(t,e)}static spread(t,e){new sa(t,e)}static fadeIn(t){new Qo(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);at.isAnimation(i)&&(i.addEventListener("finish",()=>{t._animationFinished(i)}),t._animationStarted(i))}}class Qo extends Ko{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:Yt.DURATION,fill:"none"})}}class Jo extends Ko{static clipRect(t,e){const i=e.view||t;let s;if(t.model.needClip(!1))s=i.clipRect(.1*-t.width,.1*-t.height,1.2*t.width,1.2*t.height);else if(e.view)s=i.clipRect(0,0,t.width,t.height);else{const e=t.control;s=t.model.chart.isInverted()?i.clipRect(-e.width(),.1*-t.height,2*e.width(),1.2*t.height):i.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}return s}constructor(t,e){super(t,e)}_createAnimation(t,e){const i=Jo.clipRect(t,e);let s;switch(e&&e.from){case"top":s=this.$_top(i,e);break;case"bottom":s=this.$_bottom(i,e);break;case"right":s=this.$_right(i,e);break;default:s=this.$_left(i,e)}return null==s||s.addEventListener("finish",()=>{i.dom.remove()}),s}$_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 ta extends Yt{constructor(t,e){super(),this._series=t,this._cr=Jo.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 ea 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 ia extends ea{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class sa extends ea{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class ra extends No{constructor(t){super(t,"rct-series-trendline-label")}}class na 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 ra(t))}layout(t,e,i,s,r){const n=e.chart.isInverted(),o=e.owner._xAxisObj.options.reversed,a=e.owner._yAxisObj.options.reversed,l=this.$_getPoints(e,i);if(l.length<2)return this._line.setVis(!1),this._fixedArea.setVis(!1),this._variableArea.setVis(!1),this._label.setVis(!1),void(this._startMarker&&(this._startMarker.setVis(!1),this._endMarker.setVis(!1)));this._line.setStyleOrClass(e._style),this._line.setPath(this.$_getLine(i,l)),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,l)):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,i,l,s,r))),this._variableArea.setVis(e.variableArea.visible)&&(this._variableArea.setStyleOrClass(e.variableArea._style),this._variableArea.setPath(this.$_getVariable(n,o,a,i,l,s,r))),this._label.setVis(e.label.visible)&&(this._label.setModel(t,e.label,e.label.getIconUrl(),e.label._style),this._label.setText(e.getLabel()),this.$_layoutLabel(i,e,n,o,a,l,s,r))}$_getPoints(t,e){const i=t.owner,s=i.chart.isInverted(),r=i._xAxisObj,n=i._yAxisObj,o=n._vlen,a=e?e.total:r._vlen;let l;return l=e?t._points.map(t=>{const i=e.start+r.getPos(a,t.x),s=Ei(e,n,t.y);return{x:e.cx+s*p(i),y:e.cy+s*g(i),a:i}}):t._points.map(t=>{let e,i;return s?(i=a-r.getPos(a,t.x),e=n.getPos(o,t.y)):(e=r.getPos(a,t.x),i=o-n.getPos(o,t.y)),{x:e,y:i}}),l}$_getLine(t,e){const i=new qt;return i.move(e[0].x,e[0].y),i.lines(...e),i.end()}$_getVariable(t,e,i,s,r,n,o){const a=new qt,l=r[0],h=r[r.length-1];if(s);else if(t)if(i){a.move(l.x,l.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(l.x,h.y)}else{a.move(l.x,l.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 if(i){a.move(l.x,l.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{a.move(l.x,l.y);for(let t=0;t<r.length;t++)a.line(r[t].x,r[t].y);a.line(h.x,l.y)}return a.end()}$_getFixed(t,e,i,s,r,n,o){const a=new qt,l=r[0],h=r[r.length-1];return s||(t?i?a.polygon(l.x,l.y,n,l.y,n,h.y,l.x,h.y):a.polygon(0,l.y,l.x,l.y,l.x,h.y,0,h.y):i?a.polygon(l.x,0,h.x,0,h.x,l.y,l.x,l.y):a.polygon(l.x,l.y,h.x,l.y,h.x,o,l.x,o)),a.end()}$_layoutMarkers(t,e){const i=t.marker.getRadius();if(this._startMarker.setVis(i>0)&&this._endMarker.setVis(i>0)){const s=Yi.getDrawer(t.marker.options.shape);this._startMarker.setPath(s(i)),this._endMarker.setPath(s(i)),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,i,s,r,n,o,a){const l=e.label,h=e.marker.visible?e.marker.getRadius():0,_=this._label,c=l.getText();if(!c)return void _.setVis(!1);l.prepareRich(c),l.buildSvg(_._text,_._outline,NaN,NaN,l,e.getLabelDomain());const d=l.options.position,u=t?function(t){const e=Math.floor((n.length-1)*t),i=(n.length-1)*t-e;let s;if(e>=n.length-1)s=n[n.length-1].a;else{const t=n[e],r=n[e+1];s=t.a+(r.a-t.a)*i}return s}(d):0,p=t?l.getAlignPolar(u):l.getAlign(i,s,r,d),g=t?l.getVerticalAlignPolar(u):l.getVerticalAlign(i,s,r),f=l.getOffsetX(p)+("middle"===g?h:0),m=l.getOffsetY(g)+("center"===p?h:0);_.setContrast(null).layout(p);const y=Math.floor((n.length-1)*d),x=(n.length-1)*d-y;let b,w;if(y>=n.length-1)b=n[n.length-1].x,w=n[n.length-1].y;else{const t=n[y],e=n[y+1];b=t.x+(e.x-t.x)*x,w=t.y+(e.y-t.y)*x}const v=_.getBBox();switch(p){case"left":b-=v.width+f;break;case"center":b-=v.width/2+f;break;case"right":b+=f}switch(g){case"top":w-=v.height+m;break;case"middle":w-=v.height/2+m;break;case"bottom":w+=m}t||(b<0&&(b=0),w<0&&(w=0),b+v.width>o&&(b=o-v.width),w+v.height>a&&(w=a-v.height)),_.trans(b,w)}}class oa extends Yt{constructor(t,e,i,s){super(),this.duration=i?200:100,this._sv=t,this._focused=i,this._marker=e,i||(this._marker.setBoolData(ma.DATA_UNFOCUS,!0),this._marker.saveStyles(),t.setHoverStyle(this._marker)),this.start(s)}_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(ma.DATA_UNFOCUS,!1),!this._focused&&this._marker.restoreStyles(),this._marker.setHoverRate(this._sv,this._focused,NaN),this._marker=null}}class aa extends No{constructor(t){super(t,"rct-point-label")}}class la extends ee{constructor(t){super(t,"rct-point-labels"),this._labels=[new go(this,aa),new go(this,aa)],this._maps=[],this.ignorePointer()}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}getWidth(t){let e=0;return this._labels[t].forEach(t=>e=y(e,t.getBBox().width)),e}prepareLabel(t,e,i,s,r,n){const o=r.getPointText(s,i,n.options.text);e.point=s,e.setModel(t,n,n.getIconUrl(s.icon),r.getPointLabelStyle(s)),null!=o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s))):e.setText(n.getText(n.getValue(s,i)))}prepare(t,e){const i=e.model,s=i.pointLabel;if(i.isLabelsVisible()){this.setVis(!0);const r=i.pointLabelCount(),n=this._labels,o=i._getLabeledPoints(),a=this._maps,l=s._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach((r,o)=>{for(let l=0;l<r.labelCount();l++){const h=n[l].get(o);h.stopAni().setVis(e.isPointLabelVisible(r))&&(this.prepareLabel(t,h,l,r,i,s),a[l][r.pid]=h)}}),this.setStyleOrClass(l),this._textAlign=this.textAlign()||"center"}else this.clear(),this.setVis(!1)}get(t,e){const i=this._maps[e];return i&&i[t.pid]}$_checkIntersects(t){if(t.length>1)for(let e=t.length-1;e>0;e--){const i=t[e].inflateBBox(-1,-1),s=t[e-1].inflateBBox(-1,-1);if(So(i,s))return t}}dedupe(t,e,i){let s=0,r=t[s];if(i===es)for(let i=1;i<t.length;i++){const n=t[i],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),l=Object.assign(o,{rotation:r.rotation}),h=Object.assign(a,{rotation:n.rotation});if(vo(l,h)?(r.point.yValue<t[i].point.yValue?(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,1),r=n,s=i):(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(i,1)),--i):(r=n,s=i),i===t.length-1){const i=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});vo(i,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,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(s,1)))}}else for(let i=1;i<t.length;i++){const n=t[i],o=r.inflateBBox(-1,-1),a=n.inflateBBox(-1,-1),l=Object.assign(o,{rotation:r.rotation}),h=Object.assign(a,{rotation:n.rotation});if(vo(l,h)?(e.get(n.point).setVis(!1),n.setVis(!1),t.splice(i,1),--i):(r=n,s=i),i===t.length-1){const i=Object.assign(t[0].inflateBBox(-1,-1),{rotation:t[0].rotation}),n=Object.assign(r.inflateBBox(-1,-1),{rotation:r.rotation});vo(i,n)&&(e.get(r.point).setVis(!1),r.setVis(!1),t.splice(s,1))}}}arrangeVertical(t,e,i,s,r,n,o){const a=e.length;if(a<2)return 0;e.sort((t,e)=>t.ty-e.ty);const l=t.getBBox(),h=l.y+l.height/2;let _=Number.MAX_SAFE_INTEGER,c=0;for(let t=0;t<a;t++){const i=e[t].inflateBBox(0,-1),s=Math.abs(h-(i.y+i.height/2));s<_&&(_=s,c=t)}const d=(t,i)=>{0!==i&&e[t].shiftY(i)},u=(t,i)=>{const s=e[t].inflateBBox(0,-1),r=e[i].inflateBBox(0,-1);return s.y+s.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,i)=>{for(let s=t;s<i;s++){const t=e[s].tbottom-e[s+1].ty;t>0&&d(s+1,t)}},i=(t,i)=>{for(let s=t;s>i;s--){const t=e[s].ty-e[s-1].tbottom;t<0&&d(s-1,t)}},s=e[0],r=e[a-1],n=e[c];let o=s.ty,l=p-r.tbottom;for(let t=0;t<a-1;t++){const i=e[t+1].ty-e[t].tbottom;t<c?o+=i:l+=i}if(s.ty<0)if(o>=0){s.transY(0),t(0,c-1),n.ty<e[c-1].tbottom&&i(c,0),o=0;for(let t=0;t<c;t++)o+=e[t+1].ty-e[t].tbottom}else if(o+l>=0)s.transY(0),t(0,a-1),o=0;else{for(let t=c;t>0;t--){const i=e[t].ty-e[t-1].tbottom;d(t-1,i)}o=s.ty}if(r.tbottom>p){const h=r.getBBox().height;if(l>0){r.transY(p-h),i(a-1,c+1),n.tbottom<e[c+1].ty&&t(c,a-1),l=0;for(let t=c;t<a-1;t++)l+=e[t+1].ty-e[t].tbottom}else if(o+l>0)r.transY(p-h),i(a-1,0),l=0;else{if(o>=0){s.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);l=p-r.tbottom}}if(s.ty<0&&l>0){const t=Math.min(s.ty+l,0);s.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===is&&e.forEach((t,e)=>{const s=t.ty+t.getBBox().height;(t.ty<0||s>p)&&(i.get(t.point).setVis(!1),t.setVis(!1))}),1}}class ha extends Co{constructor(t){super(t),this.add(this._line=new ne(t))}setLine(t){this._line.setPath(t)}}class _a extends Co{constructor(t){super(t,"rct-point-label-lines"),this._lines=new go(this,ha)}prepare(t){const e=this._lines,i=t._visPoints,s=t.pointLabel,r=this._map={};s.visible?e.prepare(i.length).forEach((t,e)=>{const s=i[e];t.visible=s.visible,r[s.pid]=t}):e.prepare(0)}get(t){return this._map[t.pid]}}class ca 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}}class da extends No{constructor(t){super(t,"rct-stack-label")}}class ua extends ee{constructor(t){super(t,"rct-stack-labels"),this._labels=new go(this,da),this.ignorePointer()}prepare(t){return this._labels.prepare(t),this._labels}get(t){return this._labels.get(t)}forEach(t){this._labels.forEach(t)}}const pa={},ga="rct-point-hover",fa="rct-point-unhover";class ma extends Lo{static register(...t){t.forEach(t=>{pa[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 ca(t,"rct-series-points")),this._labelContainer=new la(t),this._stackLabelContainer=new ua(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),this._stackLabelContainer&&this._stackLabelContainer.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,i,s){const r=getComputedStyle(this.dom);this.setModel(e),this._colorByPoint=e._colorByPoint(),this._randomPalette=e.chart.chartOptions.options.paletteMode===it,this.setData("index",e._seriesIndex%Bs),this.setData("pointcolors",this._colorByPoint?this._getPointColors():T),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,i,s)}_setModelColor(t){this.setColor(t)}_legendColorProp(){return"fill"}needDecoreateLegend(){return!1}decoreateLegend(t){}afterLayout(){this._doAfterLayout()}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}hoverPoint(t){const e=t&&this.getPointView(t);e&&e.visible?(this._clearHoverClasses(e),this._getPointPool().forEach(t=>{t!==e&&t.removeClass(ga).addClass(fa)})):this._getPointPool().forEach(t=>{t.containsClass(fa)&&t.removeClass(fa).addClass(ga)})}_clearHoverClasses(t){t instanceof Jt&&t.removeClass(ga).removeClass(fa)}focusPointView(t,e){}focusPoints(t){const e="none"!==this.model.options.hoverEffect,i=this._hoverAnis,s=this._hoverPts,r=[],n=[];this.model.options.interactive&&e&&(s.forEach(e=>{if(e instanceof Jt&&(!t||t.indexOf(e)<0)){const t=i.find(t=>t._marker===e);t&&t.cancel(),e.setBoolData(ma.DATA_FOCUS,!1),this.focusPointView(e,!1),e.restoreStyles(),e instanceof ka&&r.push(new oa(this,e,!1,()=>{e.endHover(this,!1)}))}}),t&&t.forEach(t=>{if(t&&!t.point.isNull){const e=i.find(e=>e._marker===t);e&&e.cancel(),t instanceof Jt&&(t.setBoolData(ma.DATA_FOCUS,!0),this.focusPointView(t,!0),t.restoreStyles(),t.saveStyles(),this.setHoverStyle(t),t instanceof ka?r.push(new oa(this,t,!0,()=>{t.endHover(this,!0)})):this instanceof Na&&this.needFronting()&&this._getPointPool().front(t),n.push(t))}})),i&&i.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,i,s){if(!this.model.pointLabel.options.autoRotation)return;const{width:r,height:n}=t.getBBox(),o=e/i*(s||360)+90;0!==o&&t.setRotation(r/2,n/2,o)}isEmptyView(){return!1}_doAttached(t){this.control.loaded&&Wt(this.dom,"opacity",0,1,500,null)}_prepareStyleOrClass(t){}_prepareViewRanges(t){}_doMeasure(t,e,i,s,r){return this._animating()||this.setClip(),this.model._xAxisObj._seriesChanged&&this._savePrevs(),this._prepareViewRanges(e),!this._lazyPrepareLabels()&&this._labelContainer.prepare(t,this),e instanceof Rs&&e.trendline.visible?(this._trendView||this.add(this._trendView=new na(t)),this._trendView.setVis(!this._animating())):this._trendView&&this._trendView.setVis(!1),{width:i,height:s}}_doLayout(){const t=this.width,e=this.height,i=this.model,s=i.pointLabel,r=this._trendView;this._labelOverlap={model:s,inverted:this._inverted,width:t,height:e,fit:s._overflowFit,outline:s.options.overlapOutline,contrast:s.options.overlapContrast},this._labelViews(),this._renderSeries(t,e),this._animatable&&!this._simpleMode&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable()||i._needAnimate),i._needAnimate=!1,r&&r.setVis(r.visible&&(!i.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(){this._layoutStackLabel()}_layoutStackLabel(){const t=this.model,e=t._group;if(!e||!e._stacked)return void this._hideStackLabel();if(!e.isLastVisible(t))return void this._hideStackLabel();const i=e.stackLabel;if(!i||!i.visible)return void this._hideStackLabel();if(this._animating())return void this._hideStackLabel();const s=e._stackTotals,r=e._stackPoints;s&&0!==s.size&&r&&0!==r.size?this._doLayoutStackLabel(i,s,r):this._hideStackLabel()}_hideStackLabel(){this._stackLabelContainer&&this._stackLabelContainer.setVis(!1)}_doLayoutStackLabel(t,e,i){var s;const r=this.control.doc(),n=this.model,o=n.chart,a=n._yAxisObj,l=n._xAxisObj,h=t.getGap(),_=t.getOffset(),c=t.options.align,d=this._labelContainer,u=d&&d.visible,f=o._body.getPolar(l),m=this._inverted,y=this.width,w=this.height,v=a.options.reversed;this._stackLabelContainer.setVis(!0),this._stackLabelContainer.setStyleOrClass(t._style);let S=0;for(const t of e.values())0!==t.positiveTotal&&S++,0!==t.negativeTotal&&S++;const V=this._stackLabelContainer.prepare(S);let C=0;const A=f?l.getTotalAngle():0,P=m?y:w,k=m?w:y,L=m?0:w;for(const[n,y]of e.entries()){const e=[];0!==y.positiveTotal&&e.push([y.positiveTotal,!1]),0!==y.negativeTotal&&e.push([y.negativeTotal,!0]);for(const[w,S]of e){const e=V.get(C++),T=t.getCallbackArgs(o,y.x,y.positiveTotal,y.negativeTotal);if(e.setVis(t.isStackLabelVisible(T))){const o=t.getStackLabelText(T,w),y=t.getStackLabelStyle(T);e.xValue=n,e.setModel(r,t,null,y),e.setText(o),e.layout(c);const V=m?0:t.getRotation(),{width:C,height:N}=e.getBBox(),M=V*B,E=0!==V?N*x(p(M))+C*x(g(M)):N,D=0!==V?C*x(p(M))+N*x(g(M)):C;let O,R;const $=i.get(n),I=$&&null!==(s=$.find(t=>t.yGroup===w))&&void 0!==s?s:null;if(f){const t=b(null==I?void 0:I.xPos,f.cx+f.rd*p(f.start+l.getPos(A,n))),i=b(null==I?void 0:I.yPos,f.cy+f.rd*g(f.start+l.getPos(A,n))),s=Math.atan2(i-f.cy,t-f.cx),r=Ei(f,a,w)+(S!==v?-1:1)*(N/2+h);let o=0;"left"===c?o=-(C/2+_):"right"===c&&(o=C/2+_),O=f.cx+r*p(s)+-g(s)*o,R=f.cy+r*g(s)+p(s)*o,e.trans(O-C/2,R-N/2),0!==V&&e.setRotation(C/2,N/2,V)}else{const i=a.getPos(P,w),s=u&&I?d.get(I,0):null,r=s&&s.visible?s.getBBoxEx():null,o=$?$[$.length-1]:null,p=o?this.getPointView(o):null,g=(null==p?void 0:p.wPoint)||0;if(m){const s=S!==v?-1:1;if(O=L+i+s*(h+D/2)-C/2,r)if(s>0){const t=O+C/2-D/2,e=r.x+r.width-t;e>0&&(O+=e)}else{const t=O+C/2+D/2-r.x;t>0&&(O-=t)}const o=b(null==I?void 0:I.yPos,k-l.getPos(k,n)),a=v?"left"===c?"right":"right"===c?"left":c:c;R="left"===a?o-g/2-E/2-N/2-_:"right"===a?o+g/2+E/2-N/2+_:o-N/2+_,R+=N*t._vertAdjust;const d=this._applyOverflowFit(t._overflowFit,O,C,P);if(null===d){e.setVis(!1);continue}O=d}else{const s=S!==v?1:-1;if(R=L-i+s*(h+E/2)-N/2,r)if(s<0){const t=R+N/2+E/2-r.y;t>0&&(R-=t)}else{const t=R+N/2-E/2,e=r.y+r.height-t;e>0&&(R+=e)}const o=b(null==I?void 0:I.xPos,l.getPos(k,n));O="left"===c?o-g/2-D/2-C/2-_:"right"===c?o+g/2+D/2-C/2+_:o-C/2+_;const a=this._applyOverflowFit(t._overflowFit,R,N,P);if(null===a){e.setVis(!1);continue}R=a}e.trans(O,R),0!==V&&e.setRotation(C/2,N/2,V)}}}}}_collectVisPoints(t){return t._visPoints}_setColorIndex(t,e){if(this._colorByPoint){const i=this._randomPalette?Math.floor(Math.random()*Bs):e.index%Bs;t.setData("index",this._model._paletteColors[i].toString())}else t.unsetData("index")}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,i,s){t.setAttrEx("aria-label",i.ariaHint()),this._setColorIndex(t,i),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),s&&s.forEach(e=>e&&t.internalSetStyleOrClass(e)),i.color&&this._setPointColor(t,i.color),i.range&&(i.range.color&&this._setPointColor(t,i.range.color),i.range.style&&t.internalSetStyleOrClass(i.range.style));const r=e.getPointStyle(i);r&&t.internalSetStyleOrClass(r)}_labelViews(){return this._labelContainer.setVis(this.model.pointLabel.visible&&!this.$_labelAnimating()),this._labelContainer.visible?this._labelContainer:void 0}_getGrowRate(){return b(this._growRate,1)}_getPosRate(){return b(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,i,s){const r=this.model;r instanceof Rs&&t.layout(this.doc,r.trendline,r.chart._body.getPolar(r._xAxisObj),i,s)}_layoutLabel(t,e,i,s){let{inverted:r,x:n,y:o,hPoint:a,labelView:l,labelOff:h}=e;if(!l.setVis(n>=0&&n<=i&&o>=0&&o<=s))return;l.layout(e.textAlign);const _=e.below=e.reversed?a<=0:a<0,c=l.getBBox();let d=!0;const u=t.getAlign(),p=t.getAlignOffset();if(r){n-=e.distY,o+=e.distX;const i=e.reversed?"left"===u?"right":"right"===u?"left":u:u;"left"===i?o-=e.wPoint/2+c.height-c.height*t._vertAdjust+p:"right"===i?o+=e.wPoint/2+c.height*t._vertAdjust+p:o-=c.height/2-c.height*t._vertAdjust}else n-=e.distX,o+=e.distY,"left"===u?n-=e.wPoint/2+c.width+p:"right"===u?n+=e.wPoint/2+p:n-=c.width/2;const g=n,f=o;switch(e.labelPos){case"inside":r?(n-=e.side,o+=e.base,n-=(a+c.width)/2+(e.reversed?h:-h)):(n-=e.base,o+=e.side,o+=(a-c.height)/2+(e.reversed?h:-h));break;case"head":r?(n-=e.side,o+=e.base,_?n+=h:n-=c.width+h):(n-=e.base,o+=e.side,_?o-=c.height+h:o+=h);break;case"foot":r?(n-=e.side,o+=e.base,n-=_?a+c.width+h:a-h):(n-=e.base,o+=e.side,o+=_?a+h:a-c.height-h);break;case"far":r?n=_?h:i-c.width-h:_?(n-=e.base,o=s-c.height-h):o=h,d=!1;break;default:r?_?n-=c.width+h:n+=h:_?(n-=e.base,o+=e.side,o+=h):o-=c.height+h,d=!1}this._checkLabelOverlap(l,c,g,f,0,0,n,o,d,e.pointView.dom),this._layoutLabelRotation(l,c,n,o)}_applyOverflowFit(t,e,i,s){if(isFinite(t)||t===1/0){if(e+i>=s)return t===1/0?null:s+t-i;if(e<=0)return t===1/0?null:-t}return e}_checkLabelOverlap(t,e,i,s,r,n,o,a,l,h){const _=this._labelOverlap;let c=!1;if(!l){const s=_.fit;if(isFinite(s)||s===1/0){const l=_.inverted?o:a,h=_.inverted?e.width:e.height,d=_.inverted?_.width:_.height,u=_.inverted?r:n,p=l+h>=d,g=this._applyOverflowFit(s,l,h,d);if(null===g)return t.setVis(!1),!1;g!==l&&(c=p?g<i+u:g+h>i-u,_.inverted?o=g:a=g),c&&_.outline&&t.setOutline(_.model)}}return t.setContrast((l||c&&_.contrast)&&h),t.trans(o,a),!0}_clipRange(t,e,i,s,r,n){if(n){const i=t;t=e,e=i}const o="x"===i,a=o?this.model._xAxisObj:this.model._yAxisObj,l=a.options.reversed,h=a.getPos(o?t:e,y(a.axisMin(),s.fromValue)),_=a.getPos(o?t:e,m(a.axisMax(),s.toValue));n?o?l?r.setBounds(_,-e,x(_-h),e):r.setBounds(h,-e,x(_-h),e):r.setBounds(0,-y(h,_),t,x(_-h)):o?l?r.setBounds(_,0,x(_-h),e):r.setBounds(h,0,x(_-h),e):r.setBounds(0,e-y(h,_),t,x(_-h))}_setFill(t,e){s(e)&&e[U]?t.internalSetStyle(U,e[U]):o(e)&&t.dom.classList.add(e)}_savePrevs(){}_layoutLabelRotation(t,e,i,s){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,i,s),t.setRotation(o,a,n)}_adjustRotatedLabelPosition(t,e,i,s,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(s)||!isFinite(r)||0===o)return;const a=e.height,l=b(e.fit,0),h=this.model._yAxisObj.options.reversed,_=this.model.chart.isInverted(),c=n.options.position;let d=this._getRotatedLabelDisplacement(o,i);if(!_&&c!==Ki)if(h?c!==qi&&c!==Zi||(d*=-1):c===Zi&&(d*=-1),r-=d,h){const t=r+(-2*d+i.height)/2+i.height/2;if(t>a){r-=t-a-l}}else{r-(2*d+i.height)/2<0&&(r=d-l)}t.trans(s,r)}_getRotatedLabelDisplacement(t,e){const i=t*Math.PI/180,s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i)),n=e.width,o=e.height;return n/2*s+o/2*r-o/2}}ma.POINT_CLASS="rct-point",ma.DATA_FOCUS="focus",ma.DATA_UNFOCUS="unfocus",ma.DATA_UNHOVER="unhover",ma.LEGEND_MARKER="rct-legend-item-marker";class ya extends ne{constructor(t){super(t,ma.POINT_CLASS)}savePrevs(){}}class xa extends ya{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}class ba extends Jt{constructor(t){super(t,ma.POINT_CLASS)}savePrevs(){}}class wa extends ba{savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}}let va=class extends xa{layout(t,e,i,s,r,n,o){this.x=t,this.y=e,this.setPath(Yi.bar(t-this.wPoint/2,e,this.wPoint,-this.hPoint,i,s))}shrink(t,e,i,s){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,i,s,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,i,s,0,0,!1)}this.setStyle("opacity",String(1-.8*this.point._vr))}}};class Sa extends wa{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,i,s,r,n,o){const a=this.wPoint,l=this.hPoint;let h=getComputedStyle(this._frontView.dom).fill;const _=l<0?e:e-l;if(ot&&(h=this.control.getIEColor(h)),this.x=t,t-=this.wPoint/2,o){const t=r;r=n,n=t}this._frontView.setPath(Yi.rectangle(t-r,e+n,a,-l)),this._topView.setPath(Yi.polygon(t,_,t+a,_,t+a-r,_+n,t-r,_+n)),this._topView.setStyle("fill",Rt.interpolate(o?Rt.BLACK:Rt.WHITE,h,.2)),this._sideView.setPath(Yi.polygon(t+a-r,e-l+n,t+a,e-l,t+a,e,t+a-r,e+n)),this._sideView.setStyle("fill",Rt.interpolate(o?Rt.WHITE:Rt.BLACK,h,.2))}}class Va extends Co{savePrevs(){this.wSave=this.width,this.xSave=this.x}}class Ca extends ma{constructor(){super(...arguments),this._labelInfo={}}_prepareSeries(t,e,i,s){this._preparePoints(t,e,this._visPoints,!!s)}_renderSeries(t,e){this._pointContainer.invert(this._inverted,e),this._layoutPoints(t,e)}_runShowEffect(t){t&&Ko.grow(this)}_doViewRateChanged(t){this._layoutPoints(this.width,this.height)}_savePrevs(){this._getPointPool().forEach(t=>t.savePrevs())}getPointsAt(t,e){return[]}}class Aa extends Ca{constructor(t,e){super(t,e),this._labelContainer.add(this._labelLineContainer=new _a(t))}depthEnabled(){return!0}_prepareSeries(t,e,i,s){s?(this._depthAngle=s.options.angle*B,this._base=p(this._depthAngle)*e.depth,this._side=g(this._depthAngle)*e.depth):this._depthAngle=this._base=this._side=0,super._prepareSeries(t,e,i,s),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 i;const s=this.model,r=this._inverted,n=this._getGrowRate(),o=this._prevRate,a=s.pointLabel,l=this._labelViews(),h=this._labelLineContainer,_=s._xAxisObj,d=s._yAxisObj,u=this._yReversed,f=this._depthExt,m=s._group?s._groupDistance:s.distance,x=f?m*(r?g(this._depthAngle):p(this._depthAngle)):0,w=f?m*(r?p(this._depthAngle):g(this._depthAngle)):0,v=2*_.unitPad(),S=b(s.options.minPointWidth,0),V=this._yLen=r?t:e,C=r?e:t,A=t=>d.getPos(V,t),P=t=>_.getPos(C,t),k=r?0:e,L=d.valueMin(),T=A(L),N=this._baseVal=s.getBaseValue(d),M=!isNaN(N),E=this._yBase=b(A(y(L,b(N,T))),T),B=this._pointOff,D=l&&c(this._labelInfo,{inverted:r,reversed:u,labelPos:s.getLabelPos(a),labelOff:s.getLabelOff(a.getOffset()),textAlign:this._labelContainer._textAlign,distX:x,distY:w,side:this._side,base:this._base});l&&h.setVis(s.pointLabel.line.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(s.pointLabel.line._style),h.prepare(s),D.pb=new qt),this._prepareLayoutPoints(t,e),null===(i=this._getPointPool().getOrphans())||void 0===i||i.forEach(t=>{this._shrinkPoint(t)}),this._getPointPool().forEach((i,h)=>{const c=i.point;if(i.setVis(!c.isNull)){const d=_.getUnitLen(C,c.xValue)*(1-v);let u=s.getPointWidth(d,S),p=A(c.yGroup),g=E;if(c.yGroup!=c.yValue){const t=N>c.yGroup,e=c.yGroup<0,i=c.yValue<0,s=t&&e&&!i||t&&!e&&!i||!t&&e&&i||!t&&!e&&i,r=c.yGroup-c.yValue*(s?-1:1);g=A(r)}const f=(p-g)*n;let m=P(c.xValue)-d/2,y=k-p;isNaN(o+i.wSave)||(u=i.wSave+(u-i.wSave)*o),m+=s.getPointPos(d)+u/2,isNaN(o+i.xSave)||(m=i.xSave+(m-i.xSave)*o),c.xPos=m+=u*B,c.yPos=y,this._layoutPoint(i,h,m-x,k-E*(1-n)-g*n+w,u,f),r&&(y=C-P(c.xValue)+d/2,m=k,c.yPos=y-=s.getPointPos(d)+u/2+u*B,c.xPos=m+=M?A(c.yGroup)*n:A(c.yGroup*n)),D&&(D.labelView=l.get(c,0))&&(D.pointView=i,D.x=m,D.y=y,D.wPoint=u,D.hPoint=f,this._layoutLabel(a,D,t,e))}})}_layoutLabel(t,e,i,s){if(super._layoutLabel(t,e,i,s),e.pb){const t=this._labelLineContainer.get(e.pointView.point),i=e.labelView;e.pb.clear(),e.inverted?e.pb.hline(e.y-e.distX,e.x+e.distY,e.below?i.tx+i.getBBox().width:i.tx):e.pb.vline(e.x-e.distX,e.y+e.distY,e.below?i.ty:i.ty+i.getBBox().height),t.setLine(e.pb.end())}}}class Pa extends Ca{_getHighValue(t){return t.yValue}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s),this._pointOff=+e.options.pointOffset||0}_doPrevRateChanged(t){0==t&&this._layoutPoints(this.width,this.height),this.invalidate()}_layoutPoints(t,e){const i=this.model,s=i.chart.isInverted(),r=this._getGrowRate(),n=this._prevRate,o=i.pointLabel,a=this._labelViews(),l=i._xAxisObj,h=i._yAxisObj,_=2*l.unitPad(),d=b(i.options.minPointWidth,0),u=s?t:e,p=s?e:t,g=s?0:e,f=this._pointOff,m=a&&c(this._labelInfo,{inverted:s,labelPos:i.getLabelPos(o),labelOff:i.getLabelOff(o.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,base:0,side:0});this._getPointPool().forEach((c,y)=>{const x=c.point;if(c.setVis(!x.isNull)){const b=l.getUnitLen(p,x.xValue)*(1-_);let w=i.getPointWidth(b,d);const v=(h.getPos(u,this._getHighValue(x))-h.getPos(u,this._getLowValue(x)))*r;let S=l.getPos(p,x.xValue)-b/2,V=g-h.getPos(u,this._getHighValue(x))*r;isNaN(n+c.wSave)||(w=c.wSave+(w-c.wSave)*n),S+=i.getPointPos(b)+w/2,isNaN(n+c.xSave)||(S=c.xSave+(S-c.xSave)*n),x.xPos=S+=w*f,x.yPos=V,this._layoutPoint(c,y,S,V,w,v),s&&(V=p-l.getPos(p,x.xValue)+b/2,S=g,x.yPos=V-=i.getPointPos(b)+w/2+w*f,x.xPos=S+=h.getPos(u,this._getHighValue(x))*r),a&&(m.pointView=c,m.hPoint=v,m.x=S,m.y=V,(m.labelView=a.get(x,0))&&(m.hPoint=v,this._layoutLabel(o,m,t,e)),(m.labelView=a.get(x,1))&&(s?m.x-=v:m.y+=v,m.hPoint=-v,this._layoutLabel(o,m,t,e)))}})}}class ka extends ya{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((this.point.xPos-e)**2+(this.point.yPos-i)**2)-t}}class La extends ma{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,i,s,r){const n=this.model.pointLabel,o=n.getRotation();if(!isFinite(s)||!isFinite(r)||0===o)return;const a=this.model.chart.isInverted(),l=n.options.position;let h=this._getRotatedLabelDisplacement(o,i);if(!a&&l!==Ki){(r-=h)-(2*h+i.height)/2<0&&(r=h),t.trans(s,r)}}_layoutLabelView(t,e,i,s,r,n){let o=t.getBBox();if("default"===e&&(e=this._getDefaultPos(o.width>=2*s*.9)),t.setVis(null!=e)){r-=o.width/2;let a=n;"inside"===e?a=n-o.height/2:e&&(a=n-s-o.height-i),t.trans(r,a),this._layoutLabelRotation(t,o,r,a)}}}class Ta 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 Na extends ma{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 i;this._zombie&&(this._zombie=null,null===(i=this._zombieAni)||void 0===i||i.cancel(),this._zombieAni=null),this._willZombie&&(this._zombie=this._willZombie,this._willZombie=null,this._zombieAni=new Ta(this,300),this._zombieAni.start())}_getPointColors(){return"f"}_createPointLegendMarker(t,e,i){return Xi.create(t,"rct-legend-item-marker",0,0,i,i,i/2)}_preparePoint(t,e,i,s){this._clearHoverClasses(s),i.legendMarker()||i.setLegendMarker(this._createPointLegendMarker(t,i,this.chart()._legend.getMarkerSize())),this._setPointStyle(s,e,i);const r=getComputedStyle(s.dom);i._calcedColor=r.fill,i._calcedStroke=parseFloat(r.strokeWidth)>0?r.stroke:""}}class Ma extends Wo{constructor(t){super(t,Ma.CLASS_NAME),this.addToTransform(this._imageView=new To(t,!1)),this._imageView.onloadProxy=()=>{this._imageView.resize(this._size.width,this._size.height)}}_doMeasure(t,e,i,s,r){const n=this._size=e.getSize(i,s);this._deflatePaddings(n),this.$_setImage(this.model.getImageUrl());const o=this._imageView.getBBox();return this._inflaePaddings(o),mo(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)}}Ma.CLASS_NAME="rct-image-annotation";class Ea extends Wo{constructor(t){super(t,Ea.CLASS_NAME),this.addToTransform(this._shapeView=new ne(t))}_doMeasure(t,e,i,s,r){const n=e.getSize(i,s),o=e.chart.getAxisOf(e,!0),a=e.chart.getAxisOf(e,!1),l=null==o?void 0:o.getPos(i,e.options.x1),h=null==o?void 0:o.getPos(i,e.options.x2),_=null==a?void 0:a.getPos(s,e.options.y1),c=null==a?void 0:a.getPos(s,e.options.y2),d=e.getShape();if(this.$_resetHeadView(),e.hasCustomPath())this._shapeView.setPath(e.options.path);else{let i=0,r=0;switch(d){case _r:!Number.isNaN(h)&&Number.isNaN(l)&&(i=h),Number.isNaN(c)||(r=Number.isNaN(_)?s-c:n.height/2),this._shapeView.setPath(Yi.line(i,r,i+n.width,r));break;case hr:Number.isNaN(h)||(i=Number.isNaN(l)?h:n.width/2),!Number.isNaN(c)&&Number.isNaN(_)&&(r=s-c),this._shapeView.setPath(Yi.line(i,r,i,r+n.height));break;case cr:{const t=this.$_lineEndpoints(l,h,_,c,s,n);this._shapeView.setPath(Yi.line(t.xStart,t.yStart,t.xEnd,t.yEnd));break}case dr:{const i=this.$_lineEndpoints(l,h,_,c,s,n),r=Yi.arrowParts(i.xStart,i.yStart,i.xEnd,i.yEnd,e.getHeadSize()),o=this.$_headView(t);this._shapeView.setPath(r.body),o.setPath(r.head),o.setVis(r.head.length>0);break}default:Yi.setShape(this._shapeView,e.getShape(),n.width/2,n.height/2)}}return this._deflatePaddings(n),n}_doLayout(t){var e;this._shapeView.trans(this._paddings.left,this._paddings.top),null===(e=this._headView)||void 0===e||e.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}$_headView(t){return this._headView||this.addToTransform(this._headView=new ne(t)),this._headView}$_resetHeadView(){this._headView&&(this._headView.setVis(!1),this._headView.setPath([]))}$_lineEndpoints(t,e,i,s,r,n){let o=0,a=0;return Number.isNaN(e)||(o=Number.isNaN(t)?e:t>e?n.width:0),Number.isNaN(s)||(a=Number.isNaN(i)?r-s:i<s?n.height:0),{xStart:o,yStart:a,xEnd:t>e?o-n.width:o+n.width,yEnd:i<s?a-n.height:a+n.height}}}Ea.CLASS_NAME="rct-shape-annotation";class Ba extends Wo{constructor(e){super(e,Ba.CLASS_NAME),this._hasExplicitWidth=!1,this.addToTransform(this._textView=new ue(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new ve}_doMeasure(t,e,i,s,r){const n=e.options,o=e.getSize(i,s);this._hasExplicitWidth=!isNaN(o.width);const 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,i,s,null,e._domain);const l=mo(this._textView.getBBox());return{width:b(o.width,l.width),height:b(o.height,l.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);const e=this._paddings,i=this.width-e.left-e.right,s=this.height-e.top-e.bottom,r=this._textView.getBBox();this._hasExplicitWidth&&r.width>i+.5?(this.isClip(this._textClip)||(this._textClip=this.control.clipBounds(),this._textView.setClip(this._textClip)),this._textClip.setBounds(e.left,e.top,i,s)):this._textView.setClip(null),super._doLayout(t)}remove(){var t;return this._textClip&&(null===(t=this.control)||void 0===t||t.removeDef(this._textClip.dom)),super.remove()}}Ba.CLASS_NAME="rct-text-annotation";class Da extends go{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 i=e.get(t);i||(i=this.find(e=>e.point===t),i&&this.addOrphan(t,i))})}return this}free(t,e){t.x=t.y=NaN,super.free(t,e)}}class Oa extends ka{getTooltipPos(){return{x:this.point.xPos,y:this.point.yPos}}shrink(){if(+this.getStyle("opacity")>0){const t=1-this.point._vr;Yi.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,i){const s=this.point,r=(+t.model.marker.options.hoverScale||1.8)-1;let n=this._radius;e?isNaN(i)||(n=this._radius=this._saveRadius*(1+i*r)):n=this._radius=this._saveRadius*(1+r-(isNaN(i)?r:r*i)),Yi.setShape(this,t.model.getShape(s),n,n),this.index>0?this.trans(s.px2-n,s.py2-n):this.trans(s.xPos-n,s.yPos-n)}endHover(t,e){this._radius=this._saveRadius}distance(t,e,i){const s=0===this.index?this.point.xPos:this.point.px2,r=0===this.index?this.point.yPos:this.point.py2;return this.point.isNull||!this.visible?Number.MAX_VALUE:Math.sqrt((s-e)**2+(r-i)**2)-t}distance2(t,e,i,s){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||!this.visible?Number.MAX_VALUE:s?Math.abs(n-i):Math.abs(r-e)}}class Ra extends ca{}class $a extends ma{constructor(t,e){super(t,e),this._based=!1,this._needBelow=!1,this._rangeClips=[],this.insertFirst(this._lineContainer=new Ra(t,"rct-line-series-lines")),this._lineContainer.add(this._line=new ne(t,"rct-line-series-line")),this._markers=new Da(this._pointContainer,Oa),this.add(this._tester=new ne(t)),this._tester.setFill("#ff000010"),this._arrowViews=new go(this._pointContainer,ne,"rct-line-series-arrow rct-series-point")}getClipContainer(){return this._lineContainer}_getPointPool(){return this._markers}needDecoreateLegend(){return!0}decoreateLegend(t){const e=getComputedStyle(this._line.dom),i=t._marker;if(i._line.setStyle("strokeWidth",e.strokeWidth),i._shape){const t=getComputedStyle(this.dom);i._marker.setStyles({fill:t.fill,stroke:t.stroke}),i._marker.internalSetStyles(this.model.marker._style),i._line.setStyle("strokeDasharray","")}else i._line.setStyle("strokeDasharray",e.strokeDasharray)}_computeNeedBelow(t){return this._based&&!!t.options.belowStyle}_prepareSeries(t,e,i){e instanceof Zr&&(this._based=e._minY<e.getBaseValue(e._yAxisObj),this._needBelow=this._computeNeedBelow(e),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),super._doAfterLayout()}_runShowEffect(t){this._polar?t&&Ko.grow(this):t&&Ko.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),this.$_layoutArrows()}getPointsAt(t,e){return[]}getNearest(t,e){const i=this.model.marker.options.radius,s=this._markers._internalItems();if(s&&s.length>0){const 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)}}}getNearest2(t,e,i){const s=this.model.marker.options.radius,r=this._markers._internalItems();if(r&&r.length>0){const n=r.reduce((r,n)=>r.distance2(s,t,e,i)<n.distance2(s,t,e,i)?r:n);return{pv:n,dist:n.distance2(s,t,e,i)}}}getHintDistance(){return this.model.marker.options.hintDistance}canHover(t,e,i){return t<=this.model.marker.options.radius+i}_markersPerPoint(){return 1}_prepareBelow(t){var e,i;const s=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=s.clipPath(),this._innerClip=s.clipPath(),this._outerLineClip=s.clipPath(),this._innerLineClip=s.clipPath()):this.isClip(this._upperClip)||(this._upperClip=s.clipBounds(),this._lowerClip=s.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===(i=this._lowerClip)||void 0===i||i.remove()}_prepareRanges(t,e){const i=this._rangeClips;let s=this._rangeLines;if(e){for(s||(s=this._rangeLines=new go(this._lineContainer,ne)),s.prepare(e.length);i.length<e.length;){const t=new re(this.doc);this.control.addClip(t),i.push(t)}for(;i.length>e.length;)i.pop().remove()}else s&&(s.freeAll(),i.forEach(t=>t.remove()),i.length=0)}$_resetClips(t,e,i,s){const r=this._yReversed,n=this._needBelow;let o;if(this._polar){const{cx:t,cy:e,rd:s,rdInner:r,min:o,max:a,cyclic:l}=this._polar;if(null==o||null==a)return;const h=R(y(0,m((M-x(o-a))/2,.2))),_=n?1:this._getGrowRate(),c=s-r,d=r+(y(i,r)-r)*_,u=r+c*_,p=u>0?d/u:0;this._model.isConnectEnds(n,l)?(n?(this._outerClip.setPath(Yi.donut(t,e,u,d)),this._outerLineClip.setPath(this._outerClip.getPath())):r>0?(this._outerClip.setPath(Yi.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(Yi.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Yi.circle(t,e,d)),this._innerLineClip.setPath(this._innerClip.getPath())):(n?(this._outerClip.setPath(Yi.sector(t,e,u,u,p,o,a,!0)),this._outerLineClip.setPath(l?this._outerClip.getPath():Yi.sector(t,e,u,u,p,o-h,a+h,!0))):r>0?(this._outerClip.setPath(Yi.donut(t,e,u,r)),this._outerLineClip.setPath(this._outerClip.getPath())):(this._outerClip.setPath(Yi.circle(t,e,u)),this._outerLineClip.setPath(this._outerClip.getPath())),this._innerClip.setPath(Yi.sector(t,e,d,d,0,o,a,!0)),this._innerLineClip.setPath(l?this._innerClip.getPath():Yi.sector(t,e,d,d,0,o-h,a+h,!0)))}else(o=this._upperClip)&&(s?r?o.setBounds(0,-i,e,t):o.setBounds(0,-t,e,t-i):r?o.setBounds(0,0+i,t,e-i):o.setBounds(0,0,t,i)),(o=this._lowerClip)&&(this._inverted?r?o.setBounds(0,-t,e,t-i):o.setBounds(0,-i,e,i):r?o.setBounds(0,0,t,i):o.setBounds(0,0+i,t,e-i))}$_prepareMarkers(t,e){var i;const s=t instanceof Zr&&this._needBelow,r=s?t.getBaseValue(t._yAxisObj):NaN,n=[t.marker._style,null];if(null===(i=this._markers)||void 0===i||i.addOrphanedPoints(t.getDropPoints()),this._pointContainer.setVis(!this._simpleMode)){const i=this._markersPerPoint(),o=s&&t.options.belowStyle,a=e.length;this._markers.prepare(a*i,(i,l)=>{const h=e[l%a];h.isNull||(i.point=h,n[1]=s&&h.yValue<r?o:null,this._setPointStyle(i,t,h,n)),i.point=h,i.index=l<a?0:1})}else this._markers.prepare(0),this._markers.clearOrphans()}_prepareMakrer(t){const e=this.model,i=t.point;t._shape=e.getShape(i),t._radius=e.getRadius(i)}_layoutMarker(t,e,i,s){const r=t._radius;e&&t.internalSetStyleOrClass(e),Yi.setShape(t,t._shape,r,r),t.setPos(i,s),t.trans(i-=r,s-=r)}_layoutMarkers(t,e,i){const s=this.model,r=s.marker,n=r._style,o=this._inverted,a=s.needClip(!1),l=this._getGrowRate(),h=r.visible,_=r.options.firstVisible,c=r.options.lastVisible,d=r.options.maxVisible,u=r.options.minVisible,f=s.pointLabel,x=f.options.align,b=f.getAlignOffset(),w=f.getOffset(),v=f.getPosition(),S=this._labelContainer._textAlign,V=this._labelViews(),C=s._xAxisObj,A=s._yAxisObj,P=this._polar=s.chart._body.getPolar(C),k=!!P,{cx:L,cy:T,rd:N,rdInner:M,start:E,total:B}=P||{},D=o?e:i,O=P?B:o?i:e,R=o?0:i,$=t.length,I=this._yReversed,F=A instanceof Sr?s.getBaseValue(A):NaN,z=F>A.axisMin(),H=k?z?Ei(P,A,F):M:z?A.getPos(D,F):0;this._pointContainer.visible&&this._shrinkPoints(s),t.forEach((t,f)=>{let G,j,W,Y;P?(W=E+C.getPos(O,t.xValue),P.min=null==P.min?W:m(P.min,W),P.max=null==P.max?W:y(P.max,W),Y=I?isNaN(t.yGroup)?z?H:N:z?H+(Ei(P,A,t.yGroup)-H)*l:Bi(P,A,t.yGroup,l):isNaN(t.yGroup)?z?H:M:z?H+(Ei(P,A,t.yGroup)-H)*l:Bi(P,A,t.yGroup,l),G=t.px=L+Y*p(W),j=t.py=T+Y*g(W),t.angle=W):(G=t.px=C.getPos(O,t.xValue),j=t.py=R-A.getPos(D,t.yGroup),o&&(G=A.getPos(D,t.yGroup),j=i-C.getPos(O,t.xValue))),t.xPos=G,t.yPos=j;const X=G,U=j,Z=this._markers.get(f),q=V&&V.get(t,0);if(Z&&Z.setVis(!t.isNull&&(k||!a||G>=0&&G<=e&&j>=0&&j<=i))){this._prepareMakrer(Z),this._layoutMarker(Z,n,G,j);const e=r.getMarkerStyle(t);e&&Z.internalSetStyleOrClass(e),s._maxY,t.yGroup,s._minY,t.yGroup;const i=0==f&&null!=_?_:f==$-1&&null!=c?c:s._maxY==t.yGroup&&null!=d?d:s._minY==t.yGroup&&null!=u?u:h;if(Z.setStyle("opacity",i?"1":"0"),q){q.setContrast(null).layout(S);const e=q.getBBox(),i=Z._radius;if(q.visible=!0,P){switch(v){case"inside":I?t.yValue<F?Y-=w:Y+=w:t.yValue<F?Y+=w:Y-=w;break;case"foot":I?t.yValue<F?Y-=e.height/2+w:Y+=e.height/2+w:t.yValue<F?Y+=e.height/2+w:Y-=e.height/2+w;break;default:I?t.yValue<F?Y+=e.height/2+w:Y-=e.height/2+w:t.yValue<F?Y-=e.height/2+w:Y+=e.height/2+w}G=L+Y*p(W),j=T+Y*g(W)-e.height/2,this.applyAutoRotation(q,W,B,C.options.totalAngle)}else switch(v){case"inside":j-=e.height/2+w;break;case"foot":j+=w+(h?i:0);break;default:j-=e.height+w+(h?i:0)}switch(x){case"left":G-=e.width+(h?i:0)+b;break;case"right":G+=(h?i:0)+b;break;default:G-=e.width/2+b}this._checkLabelOverlap(q,e,X,U,i,i,G,j,!1,null),this._layoutLabelRotation(q,e,G,j)}}else q&&q.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&&e._lines.some(t=>t.length>0)))return;const i=this.width,s=this.height,r=this._inverted,n=e instanceof Zr&&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(i,s,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,l=e._yAxisObj,h=e.getBaseValue(l);if(t){const e=!isNaN(h)&&h>l.axisMin()?Ei(t,l,h):t.rdInner;this.$_resetClips(i,s/2,e,!0)}else r?this.$_resetClips(i,s,isNaN(h)?0:l.getPos(i,h),!0):this.$_resetClips(i,s,isNaN(h)?s:s-l.getPos(s,h),!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,i,s){const r=this.model;"spline"===e?this._drawCurve(t,i,s):r instanceof Zr&&"step"===e?this._drawStep(t,i,s,i?r.backDir():r.options.stepDir):this.$_drawLine(t,i,s)}_buildLines(t,e){const i=this.model,s=i.getLineType(),r=new qt;return"spline"===s?this._drawCurves(t,e,r):i instanceof Zr&&"step"===s?this._drawSteps(e,r,i.options.stepDir):this._drawLines(e,r),r.end(t&&t.cyclic)}$_drawLine(t,e,i){if(t.length>1){const s=this._model instanceof Zr&&this._model.options.connectNullPoints;i.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)t[e].isNull&&s||i.line(t[e].px,t[e].py)}}_drawLines(t,e){t.forEach(t=>this.$_drawLine(t,!1,e))}_drawStep(t,e,i,s){if(t.length>1){i.moveOrLine(e,t[0].px,t[0].py);for(let e=1;e<t.length;e++)switch(s){case"backward":i.line(t[e-1].px,t[e].py),i.line(t[e].px,t[e].py);break;case"center":i.line((t[e].px+t[e-1].px)/2,t[e-1].py),i.line((t[e].px+t[e-1].px)/2,t[e].py),e+1===t.length&&i.line(t[e].px,t[e].py);break;default:i.line(t[e].px,t[e-1].py),i.line(t[e].px,t[e].py)}}}_drawSteps(t,e,i){t.forEach(t=>this._drawStep(t,!1,e,i))}_drawCurve(t,e,i){t.length>1&&(i.moveOrLine(e,t[0].px,t[0].py),i.spline(t,0,t.length-1))}_drawCurves(t,e,i){if(t){const{cx:s,cy:r,rdInner:n,cyclic:o}=t,a=this.model,l=a._yAxisObj,h=l instanceof Sr?a.getBaseValue(l):NaN,_=h>l.axisMin()?Ei(t,l,h):this._yReversed?0:n,c=e[0],d=c.length;let u,f;o?(i.move(c[0].px,c[0].py),i.closedSpline(c,!0)):(u=s+_*p(c[0].angle),f=r+_*g(c[0].angle),i.move(u,f),i.line(c[0].xPos,c[0].yPos),i.closedSpline(c,!1),u=s+_*p(c[d-1].angle),f=r+_*g(c[d-1].angle),i.line(u,f))}else e.forEach(t=>this._drawCurve(t,!1,i))}_buildAreas(t,e,i){const s=new qt;i=i||e;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];this._buildLine(n,e,!1,s),this._buildLine(o,i,!0,s)}return s.end(!0)}setHoverStyle(t){super.setHoverStyle(t),t.internalImportantStylesOrClass(this.model.marker.options.hoverStyle)}_doLayout(){super._doLayout(),this.$_layoutArrows()}$_layoutArrows(){const t=this.model;if(!(t instanceof Zr))return void this._arrowViews.prepare(0);const e=t.arrow,i=this._visPoints,s=e.buildArrowSlots(i);if(0===s.length)return void this._arrowViews.prepare(0);const r=this._getGrowRate(),n=e.getShape(),o=e.getRadius()*r,a=t.needClip(!1),l=this.width,h=this.height,_=!!this._polar;this._arrowViews.prepare(s.length,(t,r)=>{const c=s[r],d=i[c.index],u=d.px,p=d.py,g=e.calcArrowAngle(i,c.index,c.at),f=!d.isNull&&(_||!a||u>=0&&u<=l&&p>=0&&p<=h);if(t.setVis(f)){Yi.setShape(t,n,o,o);const i=e.getArrowStyle(d);this.$_applyArrowStyle(t,e,i),t.trans(u-o,p-o),t.setRotation(o,o,g)}})}$_applyArrowStyle(t,e,i){t.internalClearStyleAndClass(),i&&t.internalSetStyleOrClass(i);const s=e.getArrowStyleOverrides(i);s&&t.internalSetStyles(s),o(i)&&this.$_isolateClassArrowStrokeDasharray(t,Wr.STYLE_ISOLATION.strokeDasharray)}$_isolateClassArrowStrokeDasharray(t,e){const i=getComputedStyle(t.dom).strokeDasharray,s=getComputedStyle(this.dom).strokeDasharray;i&&"none"!==i?s&&"none"!==s&&i===s&&t.internalSetStyle("strokeDasharray",e):t.internalSetStyle("strokeDasharray",e)}}class Ia extends $a{constructor(t){super(t,Ia.CLASS),this._flagView=new No(t,"rct-line-series-flag"),this._pointContainer.add(this._flagView)}_legendColorProp(){return"stroke"}_doLayout(){var t;super._doLayout();const e=this.model,i=e.flag,s=this._flagView,r=this.parent.parent;let n;if(s.setVis(i.visible&&!!(n=i.label()))){s.setText(n),s.setModel(this.doc,i,i.getIconUrl(),null),s.setContrast(null).layout("left");const o=i.options.offset,a=s.getBBox();let l,h;l=this._markers.last.x,h=this._markers.last.y;let _;_=("step"==e.options.lineType&&"forward"==e.options.stepDir)!=this._inverted?h>this._markers.get(this._markers.count-2).y?"bottom":"top":l>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:f,height:m}=r,y=f/2,x=m/2,b=h>u+o,w=m>h+u+o,v=l>d+o,S=f>l+d+o,V={top:b,right:S,bottom:w,left:v};_=null!==(t=c.find(t=>V[t]))&&void 0!==t?t:_;const C=l>p&&f-l>p?l-p:l>y?f-d:0,A=h>g&&m>h+g?h-g:h>x?m-u:0;switch(_){case"top":l=C,h=b?h-u-o:0;break;case"bottom":l=C,h=w?h+o:m-u;break;case"left":l=v?l-d-o:0,h=A;break;case"right":l=S?l+o:f-d,h=A}s.trans(l,h)}}}Ia.CLASS="rct-line-series";class Fa extends $a{constructor(t){super(t,"rct-arearange-series"),this.insertFirst(this._areaContainer=new Ra(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,i){super._layoutMarkers(t,e,i);const s=this.model,r=s.marker,n=r._style,o=r.visible,a=this._inverted,l=s._xAxisObj,h=s._yAxisObj,_=a?e:i,c=a?0:i,d=this._labelViews(),u=this._labelContainer._textAlign,f=this._polar=s.chart._body.getPolar(l),m=s.pointLabel,y=m.options.position,x=m.options.align,w=m.getAlignOffset(),v=m.getOffset(),S=this._getGrowRate();for(let e=0,i=t.length;e<i;e++){const i=t[e];i.yLow=c-h.getPos(_,i.lowValue)}const V=this._markers;for(let s=0,c=t.length;s<c;s++){const m=t[s],C=V.get(c+s),A=d&&d.get(m,1);let P,k,L,T;this._prepareMakrer(C),f?(L=b(m.angle,0),T=Bi(f,h,m.lowValue,S),P=m.px2=f.cx+T*p(L),k=m.py2=f.cy+T*g(L)):a?(P=m.px2=h.getPos(_,m.lowValue),k=m.py2=V.get(s).ty+C._radius):(P=m.px2=m.xPos,k=m.py2=m.yLow);const N=P,M=k;if(C&&C.setVis(!m.isNull&&P>=0&&P<=e&&k>=0&&k<=i)){this._layoutMarker(C,n,P,k);const t=r.getMarkerStyle(m);if(t&&C.internalSetStyleOrClass(t),C.setStyle("opacity",o||0==s&&!0===r.options.firstVisible||s===c-1&&!0===r.options.lastVisible?"1":"0"),A){A.setContrast(null).layout(u).setVis(!0);const t=A.getBBox(),e=C._radius;if(f){let e=T;switch(y){case"inside":e-=v;break;case"foot":e-=t.height/2+v;break;default:e+=t.height+v}P=f.cx+e*p(L),k=f.cy+e*g(L)-t.height/2,this.applyAutoRotation(A,L,f.total,l.options.totalAngle)}else switch(y){case"inside":k-=t.height/2+v;break;case"foot":k+=v+(o?e:0);break;default:k-=t.height+v+(o?e:0)}switch(x){case"left":P-=t.width+(o?e:0)+w;break;case"right":P+=(o?e:0)+w;break;default:P-=t.width/2+w}this._checkLabelOverlap(A,t,N,M,e,e,P,k,!1,null),this._layoutLabelRotation(A,t)}}else A&&A.setVis(!1)}}_layoutLines(t){super._layoutLines(t);const e=this._area,i=this.model;if(!this._areaContainer.setVis(i._lines.length>0))return;const s=this._buildAreas(i._lines,i.getLineType());e.setPath(s),e.unsetData("polar"),e.setBoolData("simple",this._simpleMode),e.internalClearStyleAndClass(),i._runColor&&e.setFill(i._runColor),this._setFill(e,i._style),i.options.areaStyle&&e.internalSetStyleOrClass(i.options.areaStyle)}}class za extends $a{constructor(t,e){super(t,e||"rct-area-series"),this._rangeAreaClips=[],this.insertFirst(this._areaContainer=new Ra(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}_computeNeedBelow(t){return this._based&&!(!t.options.belowStyle&&!t.options.belowAreaStyle)}_prepareBelow(t){const e=this._area;let i=this._lowArea;if(super._prepareBelow(t))return i||this._areaContainer.add(i=this._lowArea=new ne(this.doc,"rct-area-series-area")),t?this._yReversed&&this._needBelow?(e.setClip(this._innerClip),i.setClip(this._outerClip)):(e.setClip(this._outerClip),i.setClip(this._innerClip)):(e.setClip(this._upperClip),i.setClip(this._lowerClip)),!0;null==i||i.setClip(),e.setClip()}_prepareRanges(t,e){super._prepareRanges(t,e);const i=this.doc,s=this._rangeAreaClips;let r=this._rangeAreas;if(e){r||(r=this._rangeAreas=new go(this._areaContainer,ne,"rct-area-series-area")),r.prepare(e.length);for(let t=0;t<m(e.length,s.length);t++)this.isClip(s[t])||(s[t]=this.control.addClip(new re(i)));for(;s.length<e.length;)s.push(this.control.addClip(new re(i)));for(;s.length>e.length;)s.pop().remove()}else r&&(r.freeAll(),s.forEach(t=>t.remove()),s.length=0)}_renderSeries(t,e){super._renderSeries(t,e),this.model.prepareAreas(),this._areaContainer.invert(this._inverted,e)}_layoutMarkers(t,e,i){super._layoutMarkers(t,e,i);const s=this._inverted,r=this.model._yAxisObj,n=s?e:i,o=s?0:i,a=this._polar;for(let e=0,i=t.length;e<i;e++){const i=t[e];if(i.isNull)i.yLow=NaN;else if(a&&!isNaN(i.angle)){const t=Ei(a,r,i.yGroup-i.yValue),e=i.angle;i.yLow=a.cy+t*g(e)}else i.yLow=o-r.getPos(n,i.yGroup-i.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,i=e.options;if(!this._areaContainer.setVis(e._areas.length>0))return;const s=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,i)=>{const o=e._runRanges[i];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[i]),this._clipRange(s,r,e._runRangeValue,o,this._rangeAreaClips[i],n)}):(t.setPath(a),t.unsetData("polar"),t.setBoolData("simple",this._simpleMode),t.internalClearStyleAndClass(),e._runColor&&t.internalSetStyle(U,e._runColor),this._setFill(t,i.style),e.options.areaStyle&&t.internalSetStyleOrClass(i.areaStyle)),o&&(o.setBoolData("simple",this._simpleMode),o.setPath(a),o.internalClearStyleAndClass(),e._runColor&&o.internalSetStyle(U,e._runColor),i.areaStyle&&o.internalSetStyleOrClass(i.areaStyle),this._setFill(o,e.options.belowStyle),i.belowAreaStyle&&o.internalSetStyleOrClass(i.belowAreaStyle))}setCircular(t){this._circular=t}$_layoutPolar(t,e,i){const s=this.model,r=s._group,n=s._xAxisObj,o=s._yAxisObj,a=this._yReversed,l=o instanceof Sr?s.getBaseValue(o):NaN,h=this._polar,{cx:_,cy:c,rd:d,rdInner:u,cyclic:f}=h,x=new qt,w=i.length;if(!r||"stack"!==r.options.layout&&"fill"!==r.options.layout){const r=l>o.axisMin(),b=r?Ei(h,o,l):a?0:u,v=s.chart._body.options.circular;let S,V,C,A,P=!1,k=!1;if("spline"===s.options.lineType)this._drawCurves(this._polar,s.buildLines(i),x);else{f?x.move(i[0].xPos,i[0].yPos):(S=_+b*p(i[0].angle),V=c+b*g(i[0].angle),x.move(S,V),x.line(i[0].xPos,i[0].yPos));for(let t=1;t<w;t++)x.line(i[t].xPos,i[t].yPos);f||(S=_+b*p(i[w-1].angle),V=c+b*g(i[w-1].angle),x.line(S,V))}const L=i.map(t=>t.angle),T=this._polar.min=m(...L),N=this._polar.max=y(...L),E=(new qt).push(x.end());if(r)f?x.circle(_,c,b):a&&x.push(...Yi.arc(_,c,b,b,T,N,!0)),C=x.end(),P=!0,f?E.circle(_,c,b):E.push(...Yi.arc(_,c,b,b,T,N,!0)),A=E.end(),k=!0;else if(a){const t=n.getStartAngle(),e=n.getTotalAngle(),i=n._ticks;x.push("Z"),f?v?x.circle(_,c,d):x.polygon(...i.map(i=>({x:_+p(t+i.pos/d*e/M)*d,y:c+g(t+i.pos/d*e/M)*d}))):v?x.push(...Yi.sector(_,c,d,d,0,T,N,!0)):x.polygon({x:_,y:c},...i.map(i=>({x:_+p(t+i.pos/d*e/M)*d,y:c+g(t+i.pos/d*e/M)*d}),{x:_,y:c})),u>0&&x.circle(_,c,u),C=x.end(!0),P=!0}else C=x.end();t.setPath(C),t.setAttr("fill-rule",P?"evenodd":""),e&&(e.setPath(A||""),e.setAttr("fill-rule",k?"evenodd":""))}else{const e=t=>{if(isNaN(t.angle))return{x:t.xPos,y:t.yLow};const e=Ei(h,o,t.yGroup-t.yValue);return{x:_+e*p(t.angle),y:c+e*g(t.angle)}},s=e(i[0]);x.move(b(s.x,_),b(s.y,c)),x.line(b(i[0].xPos,_),b(i[0].yPos,c));for(let t=1;t<i.length;t++)x.line(b(i[t].xPos,_),b(i[t].yPos,c));const r=e(i[i.length-1]);x.line(b(r.x,_),b(r.y,c));for(let t=i.length-1;t>=0;t--){const s=e(i[t]);x.line(b(s.x,_),b(s.y,c))}t.setPath(x.end())}if(t.setBoolData("polar",!0),t.clearStyleAndClass(),t.setFill(s._runColor),t.addStyleOrClass(s._style),$t.setImportantStyle(t.dom.style,Z,"none"),e&&(e.setBoolData("polar",!0),e.clearStyleAndClass(),e.setFill(s._runColor),e.addStyleOrClass(s._style),e.internalSetStyleOrClass(s.options.belowStyle),s.options.belowAreaStyle&&e.internalSetStyleOrClass(s.options.belowAreaStyle),$t.setImportantStyle(e.dom.style,Z,"none")),s._xAxisObj.isArced()){this.isClip(this._arcClip)||(this._arcClip=this.control.addClip(new oe(this.doc)));const t=u>0?u/d:0,e=Yi.sector(_,c,d,d,t,h.start,h.start+h.total,!0);this._arcClip.setPath(e),this._areaContainer.setClip(this._arcClip)}else this._areaContainer.setClip()}}class Ha extends Pa{constructor(t){super(t,"rct-barrange-series"),this._bars=new Da(this._pointContainer,va)}_getPointPool(){return this._bars}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_getLowValue(t){return t.lowValue}_layoutPoint(t,e,i,s,r,n){t.wPoint=r*b(t.point.width,1),t.hPoint=n,t.layout(i,s+n,this._rd,this._rd,0,0,this._inverted)}}class Ga extends hn{constructor(t){super(t,ma.POINT_CLASS)}savePrevs(){}}class ja extends Aa{constructor(){super(...arguments),this._labelInfo={}}_getPointPool(){return this.chart().isPolar()?this._sectors:this._bars}_prepareSeries(t,e,i,s){this._polar=i,super._prepareSeries(t,e,i,s)}_preparePoints(t,e,i,s){this._polar?this.$_parepareSectors(t,e,this._visPoints):this.$_parepareBars(t,e,this._visPoints,s)}_setPointStyle(t,e,i){super._setPointStyle(t,e,i),i.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,i,s){var r;this._polar?this._bars||(this._bars=this._createBarPool(this._pointContainer,!1)):(s!=this._deep&&this._bars&&(this._bars.prepare(0),this._bars.clearOrphans(),this._bars=null),this._bars||(this._bars=this._createBarPool(this._pointContainer,this._deep=s))),null===(r=this._bars)||void 0===r||r.addOrphanedPoints(e.getDropPoints()),this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_parepareSectors(t,e,i){this._sectors||(this._sectors=new Da(this._pointContainer,Ga)),this._sectors.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_layoutSectors(){const t=this.model,e=this._getGrowRate(),i=t.pointLabel,s=this._labelViews(),r=t.chart._body,n=t._xAxisObj,o=t._yAxisObj,a=o.options.reversed,l=2*n.unitPad(),h=r.getPolar(n),{cx:_,cy:c,rd:d,rdInner:u}=h,f=o instanceof Sr?t.getBaseValue(o):NaN,y=f>o.axisMin(),x=Ei(h,o,f),b=this._pointOff,w=n.getTotalAngle();let v,S,V,C,A;s&&(v=this._labelInfo,S=t.getLabelPos(i),V=t.getLabelOff(i.getOffset()),C=this._labelContainer._textAlign),this._sectors.forEach((i,r)=>{const P=i.point;if(i.setVis(!P.isNull)){const r=Bi(h,o,P.yGroup,e),k=n.getUnitLen(w,P.xValue)*(1-l),L=t.getPointWidth(k,0);let T,N,M=h.start+n.getPos(w,P.xValue)-k/2;M+=L*b,M+=t.getPointPos(k)+L/2;const E=Ei(h,o,P.yGroup);if(a?y?(T=x+(E-x)*e,N=x):(T=d,N=r):y?(T=x+(E-x)*e,N=x):(T=r,N=u),i.setSector({cx:_,cy:c,rx:T,ry:T,innerRadius:T>0?N/T:0,start:M-L/2,angle:L,clockwise:!0}),M=i.start+i.angle/2,P.xPos=_+i.rx*p(M),P.yPos=c+i.ry*g(M),s&&(A=v.labelView=s.get(P,0))){A.layout(C);const{width:t,height:e}=A.getBBox(),s=i.ry,r=N;let o,l;o=a?y?P.yValue<f?"outside"===S?s+e/2+V:"head"===S?s-e/2-V:"foot"===S?x+e/2+V:s-(s-x)/2+V:"outside"===S?s-e/2-V:"head"===S?m(x,s+e/2+V):"foot"===S?x-e/2-V:x-(x-s)/2-V:"outside"===S?r-e/2-V:"head"===S?m(s,r+e/2+V):"foot"===S?s-e/2-V:s-(s-r)/2-V:y?P.yValue<f?"outside"===S?s-e/2-V:"head"===S?s+e/2+V:"foot"===S?x-e/2-V:x-(x-s)/2-V:"outside"===S?s+e/2+V:"head"===S?s-e/2-V:"foot"===S?x+e/2+V:s-(s-x)/2+V:"outside"===S?s+e/2+V:"head"===S?s-e/2-V:.7*s+V,l=c+o*g(M),o=_+o*p(M),"outside"!==S&&A.setContrast(i.dom),this.applyAutoRotation(A,M,h.total,n.options.totalAngle),A.trans(o-t/2,l-e/2)}}})}}class Wa extends ja{constructor(t,e){super(t,null!=e?e:"rct-bar-series")}_createBarPool(t,e){return e&&this._side>0?new Da(t,Sa):new Da(t,va)}_prepareSeries(t,e,i,s){super._prepareSeries(t,e,i,s);const r=e.options;this._rdTop=+r.topRadius||0,this._rdBottom=+r.bottomRadius||0}_layoutPoint(t,e,i,s,r,n){t.wPoint=r*b(t.point.width,1),t.hPoint=n,t.layout(i,s,this._rdTop,this._rdBottom,this._base,this._side,this._inverted)}_shrinkPoint(t){if(t instanceof va){const e=this.model._xAxisObj;t.shrink(e.options.reversed,e._vlen,this._rdTop,this._rdBottom)}}}class Ya extends za{constructor(t){super(t,"rct-bellcurve-series")}}class Xa extends Va{constructor(t){super(t,ma.POINT_CLASS+" rct-boxplot-point")}layout(t,e){const i=this.point,s=i.yValue-i.minValue,r=t/2;const n=0+e-e*(i.lowValue-i.minValue)/s,o=0+e-e*(i.highValue-i.minValue)/s,a=e*(i.highValue-i.lowValue)/s;i.color&&this._box.setFill(i.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*(i.midValue-i.minValue)/s,0,t)}_doInitChildren(t){this.add(this._stemUp=new zr(t,"rct-boxplot-point-stem")),this.add(this._stemDown=new zr(t,"rct-boxplot-point-stem")),this.add(this._box=new Xi(t,"rct-boxplot-point-box")),this.add(this._mid=new zr(t,"rct-boxplot-point-mid")),this.add(this._min=new zr(t,"rct-boxplot-point-min")),this.add(this._max=new zr(t,"rct-boxplot-point-max"))}}class Ua extends Pa{constructor(t){super(t,"rct-boxplot-series"),this._boxes=new Da(this._pointContainer,Xa)}_getPointPool(){return this._boxes}_getLowValue(t){return t.minValue}_preparePoints(t,e,i){this._boxes.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),t.layout(r,n)}}class Za extends ka{}class qa extends La{constructor(t){super(t,"rct-bubble-series"),this._pointContainer.add(this._pieContainer=new ee(t,"rct-bubble-pie"))}_createMarkers(t){return new Da(t,Za)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints),this.$_preparePie(t,e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Ko.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}pointByDom(t){const e=super.pointByDom(t);if(e)return this.model._hoveredSlice=null,e;if(this._sectorMap){let e=t;for(;e;){const t=this._sectorMap.get(e);if(t)return this.model._hoveredSlice=t.slice,t.pv;e=e.parentElement}}return this.model._hoveredSlice=null,null}$_prepareMarkers(t,e){this._markers.addOrphanedPoints(t.getDropPoints()),this._markers.prepare(e.length,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}$_preparePie(t,e,i){const s=e.pie,r=s&&s.visible&&s.fields.length>0;if(this._pieContainer.setVis(r)){let e=0;i.forEach(t=>{!t.isNull&&t.pieSlices&&(e+=t.pieSlices.length)}),this._pieSectors||(this._pieSectors=new go(this._pieContainer,hn,ma.POINT_CLASS+" rct-bubble-pie-sector")),this._pieSectors.prepare(e),this._sectorMap=new Map;const r=this.chart()._legend.getMarkerSize();s.getLegendSources().forEach(e=>{e.legendMarker()||e.setLegendMarker(Xi.create(t,ma.LEGEND_MARKER,0,0,r,r,r/2))})}else this._pieSectors&&this._pieSectors.prepare(0),this._sectorMap=null}_getDefaultPos(t){return t?"outside":"inside"}$_layoutMarkers(t,e){var i;const s=this.model,r=s.options,n=this._inverted,o=s.needClip(!1),a=this._getGrowRate(),l=+r.rotation||0,h=s.pointLabel,_=h.options.position,c=h.getOffset(),d=this._labelContainer._textAlign,u=this._labelViews(),f=s._xAxisObj,m=s._yAxisObj,y=this._polar=s.chart._body.getPolar(f),x=n?t:e,w=n?e:t,v=(s._xAxisObj._vlen<s._yAxisObj._vlen?s._xAxisObj:s._yAxisObj)._vlen,{min:S,max:V}=s.getPixelMinMax(v),C=n?0:e,A=Yi.getDrawer(r.shape),P=s.pie,k=P&&P.visible&&P.fields.length>0;let L,T=0;null===(i=this._markers.getOrphans())||void 0===i||i.forEach(t=>{t.setPath(A(t._radius*(1-t.point._vr))),t.setStyle("opacity",String(1-t.point._vr))}),this._markers.forEach((i,r)=>{var h,v;const N=i.point,M=u&&(L=u.get(N,0));if(i.setVis(!N.isNull&&!isNaN(N.zValue))){const r=i._radius=s.getRadius(N.zValue,S,V),u=r*a*b(N._vr,1);let v,E;if(y){const t=y.start+f.getPos(w,N.xValue),e=Ei(y,m,N.yValue);v=y.cx+e*p(t),E=y.cy+e*g(t)}else v=f.getPos(w,N.xValue),E=C-m.getPos(x,N.yValue),n&&(v=m.getPos(x,N.yValue),E=e-f.getPos(w,N.xValue));N.xPos=v,N.yPos=E;const B=!o||v>=0&&v<=t&&E>=0&&E<=e;if(k&&N.pieSlices)if(i.setVis(!1),B)P.resolveSliceColors(N.pieSlices),T=this.$_renderPieSectors(N,N.pieSlices,T,v,E,u,P.getInnerRadius(u),P.clockwise);else for(let t=0;t<N.pieSlices.length;t++)null===(h=this._pieSectors.get(T++))||void 0===h||h.setVis(!1);else i.setVis(B)&&i.setPath(A(u)).trans(v,E).rotate(l);B&&M?(L.setContrast(k&&N.pieSlices?null:i.dom),L.layout(d),this._layoutLabelView(L,_,c,r,v,E)):M&&M.setVis(!1)}else{if(k&&N.pieSlices)for(let t=0;t<N.pieSlices.length;t++)null===(v=this._pieSectors.get(T++))||void 0===v||v.setVis(!1);M&&M.setVis(!1)}})}$_renderPieSectors(t,e,i,s,r,n,o,a){let l=i;for(const i of e){const e=this._pieSectors.get(l++);if(e){const l={cx:s,cy:r,rx:n,ry:n,innerRadius:o,start:i.startAngle,angle:x(i.angle),clockwise:a};if(e.setSector(l),e.setFill(i.color),e.setVis(!0),this._sectorMap){const a=i.startAngle+i.angle/2,l=(n+o)/2,h=s+l*p(a),_=r+l*g(a),c={point:t,dom:e.dom,getTooltipPos:()=>({x:h,y:_}),getBounds:()=>e.dom.getBoundingClientRect(),saveStyles(){},restoreStyles(){}};this._sectorMap.set(e.dom,{point:t,slice:i,pv:c})}}}return l}getNearest(t,e){this.model._hoveredSlice=null;const i=this._markers._internalItems();if(i&&i.length>0){const s=i.reduce((i,s)=>i.distance(i._radius,t,e)<s.distance(s._radius,t,e)?i:s);return{pv:s,dist:s.distance(s._radius,t,e)}}}canHover(t,e,i){return t<=e._radius+i}}let Ka=class extends Va{constructor(t){super(t,ma.POINT_CLASS)}layout(t,e){const i=this.point,s=i.yValue-i.lowValue;const r=0+e-e*(0===s?1:(m(i.openValue,i.closeValue)-i.lowValue)/s),n=0+e-e*(0===s?1:(y(i.openValue,i.closeValue)-i.lowValue)/s),o=m(n,r),a=y(1,x(r-n)),l=i.close<i.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",l)}_doInitChildren(t){this.add(this._wickUpper=new zr(t,"rct-candlestick-point-wick")),this.add(this._wickLower=new zr(t,"rct-candlestick-point-wick")),this.add(this._body=new Xi(t))}};class Qa extends Pa{constructor(t){super(t,"rct-candlestick-series"),this._sticks=new Da(this._pointContainer,Ka)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._sticks.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_setPointColor(t,e){t._body.setColor(e)}_setPointStyle(t,e,i,s){super._setPointStyle(t,e,i,s),i.closeValue<i.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}_layoutPoint(t,e,i,s,r,n){t.trans(i,s),t.layout(r,n)}}class Ja extends ya{layout(t,e,i){const s=new qt;s.circle(t,e,i),this.setPath(s.end())}}class tl extends ja{constructor(t){super(t,"rct-circlebar-series")}_createBarPool(t){return new Da(t,Ja)}_layoutPoint(t,e,i,s,r,n){t.layout(i,s-n/2,n/2-1)}}let el=class extends Va{constructor(t){super(t,ma.POINT_CLASS),this.add(this._line=new zr(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,i,s){const r=this._hmarker,n=this._lmarker,o=this.point,a=o.radius,l=o.lowRadius,h=i/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+h,this._line.setVLine(h,0,s),Yi.setShape(r,o.shape,a,a),Yi.setShape(n,o.lowShape,l,l),r.trans(h-a,0-a),n.trans(h-l,s-a)}};class il extends Pa{constructor(t){super(t,"rct-dumbbell-series"),this._bars=new Da(this._pointContainer,el)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),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 sl=class extends Co{constructor(t){super(t,ma.POINT_CLASS),this._segments=new go(this,ne),this._decimal=0,this.add(this._back=new ne(t)),this._back.setTransparent(!0)}prepareSegments(t,e,i,s){this._decimal=i,this._segments.prepare(Math.round(e)).forEach((t,e)=>{})}layout(t,e,i){const s=this.wPoint,r=this.hPoint,n=r<0?Math.max:Math.min;e-=s/2,r<0&&(t=t.map(t=>-t)),this._back.setPath(Yi.rectangle(e,i,s,-r)),this._segments.forEach((o,a,l)=>{a===l-1&&this._decimal>0?o.setPath(Yi.rectangle(e,i-t[2*a],s,r<0?n(1,this._decimal):n(-1,-this._decimal))):o.setPath(Yi.rectangle(e,i-t[2*a],s,n(-1,t[2*a]-t[2*a+1])))})}savePrevs(){this.wSave=this.wPoint,this.xSave=this.x}};class rl extends Aa{constructor(t){super(t,"rct-equalizer-series"),this._bars=new Da(this._pointContainer,sl)}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(e,i)}_shrinkPoint(t){}_layoutPoints(t,e){const i=this.model._yAxisObj.prev(this._inverted?t:e)*this._getGrowRate();this.$_buildSegments(this.model,i),super._layoutPoints(t,e)}_layoutPoint(t,e,i,s,r,n){const o=this._prevRate;isNaN(o+t.wSave)||(r=t.wSave+(r-t.wSave)*o),isNaN(o+t.xSave)||(i=t.xSave+(i-t.xSave)*o),t.wPoint=r,t.hPoint=n,t.layout(this._pts,i,s)}$_parepareBars(t,e){this._bars.prepare(e.length,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}$_buildSegments(t,e){const i=t.options,s=t._yAxisObj.axisMax(),r=i.segmented,n=i.segmentGap||0,o=this._pts=[];let a,l,h=0;const _=t._yAxisObj,c=_.axisMin(),d=t.getBaseValue(_)||0,u=_.getPos(_.options.reversed?0:e,d);for(l=i.maxCount>0?i.maxCount:Math.round(e/(t.getSegmentSize(e)+n/2)),a=(e-n*(l-1))/l;o.length<2*l;)o.push(h,h+a),h+=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 l=n.yValue>=d?(e-u)/e*(n.yValue-d)/(s-d):u/e*(d-n.yValue)/(d-c);let h=-1,_=0;for(let t=0;t<p-1;t++)if(l>=o[2*t]/e&&l<o[2*(t+1)]/e){h=t+1,_=!r&&l<o[2*t+1]/e?l*e-o[2*t]:a;break}h<0&&(h=p,_=a),0===l&&(h=0),t.prepareSegments(p,h,_,i.backStyle)}})}}let nl=class extends Va{constructor(t){super(t,ma.POINT_CLASS)}_doInitChildren(t){this.add(this._stem=new zr(t)),this.add(this._whiskerUp=new zr(t)),this.add(this._whiskerDown=new zr(t)),this.add(this._back=new Xi(t,"rct-errorbar-point-back")),this._back.setTransparent(!1)}layout(t,e){const i=t/2;this.x=this.tx+i,this._stem.setVLine(i,0,e),this._whiskerUp.setHLine(0,0,t),this._whiskerDown.setHLine(e,0,t),this._back.setBox(0,0,t,e)}};class ol extends Pa{constructor(t){super(t,"rct-errorbar-series"),this._bars=new Da(this._pointContainer,nl)}_getPointPool(){return this._bars}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}_layoutPoint(t,e,i,s,r,n){t.trans(i-r/2,s),t.layout(r,n)}}class al extends ya{}class ll extends Na{constructor(t){super(t,"rct-funnel-series"),this._segments=new Da(this._pointContainer,al),this.add(this._lineContainer=new _a(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&&Ko.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,i){this._segments.prepare(i.length,(s,r)=>{const n=s.point=i[r];this._preparePoint(t,e,n,s)})}$_calcRates(t){const e=this._zombie,i=this._zombieRate,s=t.length;let r=0,n=0;if(t.forEach(t=>{r+=t.yValue*(t===e?i:t._isDeleted()?t._vr:1)}),s>1||s>0&&!e)if(1==s&&t[0]._isDeleted()){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else if(1===s&&t[0]._vr<1){const e=t[0];e.yRate=100,e.yPos=0,e.height=e._vr}else{let o=0;for(;o<s-1;o++){const s=t[o],a=R(s.yValue*(s===e?i:s._isDeleted()?s._vr:1)/r)||0;s.yRate=100*a,s.yPos=n,s.height=a,n+=a}t[o].yPos=n,t[o].height=1-n}else if(1==s){const e=t[0],s=R(i);n=1-s,e.yRate=100*s,e.yPos=n,e.height=s,e.yPos=n,e.height=1-n}}$_layoutSegments(t,e){const i=function(t){return d?y+(V-y)*(w-t)/(w-C):y+(V-y)*(t-b)/(C-b)},s=this.model,r=this._labelViews(),n=s.pointLabel,o="inside"===s.getLabelPos(n),a=n.getOffset(),l=n.getDistance(),h=n.getWidgetAlign(),_=null==r?void 0:r.textAlign(),c=this._lineContainer.setVis(n.connector.visible)?this._lineContainer:null,d=s.options.reversed,u=n.options.opposite,p=s.getSize(t,e),g=s.getNeckSize(p.width,p.height),f=new qt,m=s.getCenter(t,e),y=m.x-p.width/2,b=m.y-p.height/2,w=b+p.height,v=y+p.width/2,S=p.height-g.height,V=y+(p.width-g.width)/2,C=d?w-S:b+S,A=[],P=new qt,k=(null==r?void 0:r.getWidth(0))||0;let L,T;this._lineContainer.setStyleOrClass(n.connector.options.style),this._segments.forEach(s=>{const n=s.point;if(s.setVis(!n.isNull)){const m=n.yPos*p.height,y=(n.yPos+n.height)*p.height,N=d?w-m:b+m,M=d?w-y:b+y,E=y<S;let B,D,O,R;if(T=null==c?void 0:c.get(n),m>=S?(B=V,D=B+g.width,f.move(B,N).lines(D,N,D,M,B,M),s.ny=s.nx1=NaN):E?(B=i(N),D=B+2*(v-B),O=i(M),R=O+2*(v-O),f.move(B,N).lines(D,N,R,M,O,M),s.ny=NaN,s.nx1=O-B,s.nx2=R-B):(B=i(N),D=B+2*(v-B),O=V,R=O+g.width,f.move(B,N).lines(D,N,R,C,R,M,O,M,O,C),s.nx1=O-B,s.nx2=R-B,s.ny=x(C-N),s.nx3=O,s.nx4=R),s.setPath(f.close(!0)),n.xPos=v,n.yPos=N+(M-N)/2,r&&(L=r.get(n,0))&&L.visible){if(o){null==T||T.setVis(!1);const t=L.isDomAnimating(),e=L.getBBox(),i=E?(D-B+(R-O))/2:g.width;switch(!t&&L.layout(_||"center"),h){case-1:L.trans(n.xPos-i/2+a,n.yPos-e.height/2);break;case 1:L.trans(n.xPos+i/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===h?this.$_layoutLabelAligned(!1,n,s,L,_,u,T,P,p,v,a,l):1==h?this.$_layoutLabelEnded(!1,n,s,L,_,u,T,P,v,a,l,k,t,e):this.$_layoutLabelOutside(!1,n,s,L,_,u,T,P,v,a,l);L.setContrast(o&&s.dom),A.push(L),L.setPosY(L.ty),this._layoutLabelRotation(L)}else T&&T.setVis(!1)}});const N=n.options.convergent,M=n.options.dedupeMode,E=n.options.overflow;r&&(o||0===h?"preserveOrder"!==M&&"largestFirst"!==M||r.dedupe(A,c,M):(null==r?void 0:r.arrangeVertical(this,A,c,e,N,M,E))&&this._segments.forEach(i=>{const s=i.point;s.isNull||(L=r.get(s,0),T=null==c?void 0:c.get(s),(null==L?void 0:L.visible)&&(-1===h?this.$_layoutLabelAligned(!0,s,i,L,_,u,T,P,p,v,a,l):1==h?this.$_layoutLabelEnded(!0,s,i,L,_,u,T,P,v,a,l,k,t,e):this.$_layoutLabelOutside(!0,s,i,L,_,u,T,P,v,a,l)))}))}$_calcX(t,e,i,s){const r=e.getBBox(),n=s?-1:1,o=r.height;let a=i+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=s?e.nx3:e.nx4,a}$_layoutLabelAligned(t,e,i,s,r,n,o,a,l,h,_,c){const d=s.isDomAnimating(),u=t?s.getBBoxEx():s.getBBox(),p=e.yPos;!t&&!d&&s.layout(r||(n?"right":"left"));const g=e.xPos=this.$_calcX(e,i,h,n);let f=h;if(n?f-=l.width/2:f+=l.width/2,o){const e=t?u.y+u.height/2-p:0;n?o.setLine(a.reset(0,0).line(f-g-c,e).end()):o.setLine(a.reset(0,0).line(f+c-g,e).end()),o.trans(g,p)}t||(n?f-=_+c+u.width:f+=c+_,s.trans(f,p-u.height/2))}$_layoutLabelEnded(t,e,i,s,r,n,o,a,l,h,_,c,d,u){const p=s.isDomAnimating(),g=t?s.getBBoxEx():s.getBBox(),f=e.yPos;!t&&!p&&s.layout(r||(n?"right":"left"));const m=e.xPos=this.$_calcX(e,i,l,n);let y;if(y=n?_+h+c:d-_-c-h,o){const e=t?g.y+g.height/2-f:0;n?o.setLine(a.reset(0,0).line(y-m-_,e).end()):o.setLine(a.reset(0,0).line(y+_-m,e).end()),o.trans(m,f)}t||(n?y-=h+_+g.width:y+=_+h,s.trans(y,f-g.height/2))}$_layoutLabelOutside(t,e,i,s,r,n,o,a,l,h,_){const c=s.isDomAnimating(),d=t?s.getBBoxEx():s.getBBox(),u=e.yPos;!t&&!c&&s.layout(r||(n?"right":"left"));let p=this.$_calcX(e,i,l,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-=_+h+d.width:p+=_+h,s.trans(p,u-d.height/2))}}let hl=class extends xa{layout(t,e){this.setPath(Yi.rect({x:t-this.wPoint/2,y:e,width:this.wPoint,height:-this.hPoint}))}};class _l extends Ca{constructor(t){super(t,"rct-histogram-series"),this._bars=new Da(this._pointContainer,hl)}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_layoutPoint(t,e,i,s,r,n){t.wPoint=r,t.hPoint=n,t.layout(i,s)}_layoutPoints(t,e){const i=this.model,s=this._inverted,r=this._getGrowRate(),n=i.pointLabel,o=this._labelViews(),a=i._xAxisObj,l=i._yAxisObj,h=s?t:e,_=s?e:t,d=l.getPos(h,i.getBaseValue(l)),u=s?0:e,p=o&&c(this._labelInfo,{inverted:s,labelPos:i.getLabelPos(n),labelOff:i.getLabelOff(n.getOffset()),textAlign:this._labelContainer._textAlign,distX:0,distY:0,side:0,base:0});this._getPointPool().forEach((i,c)=>{const g=i.point,f=a.getPos(_,g.min),m=a.getPos(_,g.max),y=l.getPos(h,g.yValue),x=m-f+(m>f?-1:1),b=y-d;let w=f+(m-f)/2,v=u;g.xPos=w,g.yPos=v-=y,this._layoutPoint(i,c,w,v+b,x,b*r),p&&(p.labelView=o.get(g,0))&&(s&&(v=_-w,w=u,g.yPos=v,g.xPos=w+=l.getPos(h,g.yGroup)),p.pointView=i,p.x=w,p.y=v,p.wPoint=x,p.hPoint=b,this._layoutLabel(n,p,t,e))})}$_parepareBars(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];this._setPointStyle(t,e,r)})}$_layoutBars(t,e){const i=this.model._xAxisObj,s=this.model._yAxisObj,r=this.height,n=this._getGrowRate();this._bars.forEach((o,a)=>{const l=o.point,h=i.getPos(t,l.min),_=i.getPos(t,l.max),c=h+(_-h)/2,d=s.getPos(e,o.point.yValue)*n,u=y(1,_-h-1);l.xPos=c,l.yPos=r-d,o.wPoint=u,o.hPoint=d,o.layout(c,r)})}}class cl extends Co{constructor(t){super(t,ma.POINT_CLASS),this.add(this._line=new zr(t,"rct-lollipop-point-bar")),this.add(this._marker=new ne(t,"rct-lollipop-point-marker"))}layout(t){var e;const i=null!==(e=this.point.radius)&&void 0!==e?e:0;this._line.setVLine(0,0,t),Yi.setShape(this._marker,this.point.shape,i,i),this._marker.trans(-i,-i)}savePrevs(){this.xSave=this.tx}}class dl extends Aa{constructor(t){super(t,"rct-lollipop-series")}_getPointPool(){return this._bars}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_shrinkPoint(t){}_layoutPoint(t,e,i,s,r,n){t.trans(i,s-n),t.layout(n)}_setPointColor(t,e){t._line.setStyle("stroke",e),t._marker.setFill(e)}$_parepareBars(t,e,i){const s=e.marker,r=s._style;s.options.styleCallback,this._bars||(this._bars=new Da(this._pointContainer,cl)),this._bars.prepare(i.length,(t,n)=>{const o=t.point=i[n];this._setPointStyle(t,e,o),r&&t._marker.setStyleOrClass(r);const a=s.getMarkerStyle(o);a&&t.internalSetStyleOrClass(a)})}}class ul extends Va{constructor(t){super(t,ma.POINT_CLASS)}layout(t,e){const i=this.point,s=i.yValue-i.lowValue,r=-t/2;const n=0+e-e*(m(i.openValue,i.closeValue)-i.lowValue)/s,o=0+e-e*(y(i.openValue,i.closeValue)-i.lowValue)/s,a=i.close<i.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 zr(t,"rct-ohlc-point-tick")),this.add(this._tickClose=new zr(t,"rct-ohlc-point-tick")),this.add(this._bar=new zr(t)),this.add(this._back=new Xi(t,"rct-ohlc-point-back")),this._back.setTransparent(!1)}}class pl extends Pa{constructor(t){super(t,"rct-ohlc-series"),this._sticks=new Da(this._pointContainer,ul)}_getPointPool(){return this._sticks}_getLowValue(t){return t.lowValue}_preparePoints(t,e,i){this.$_prepareSticks(e,i)}_layoutPoint(t,e,i,s,r,n){t.trans(i,s),t.layout(r,n)}_setPointStyle(t,e,i,s){super._setPointStyle(t,e,i,s),i.closeValue<i.openValue&&e.options.declineStyle&&t.addStyleOrClass(e.options.declineStyle)}$_prepareSticks(t,e){this._sticks.prepare(e.length,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}}class gl extends $a{constructor(t){super(t,"rct-pareto-series")}}class fl extends ne{setOff(t){return this.off=x(t),this}}class ml extends hn{constructor(t){super(t,ma.POINT_CLASS)}render(t,e,i){this._assignShape(i,!1)}}class yl extends Jt{constructor(t){super(t,ma.POINT_CLASS),this._outPath={},this._inPath={},this.add(this._sectorView=new hn(t))}setSides(t,e,i,s,r){const n=this.point,o=R(N),a=R(((t?n.startAngle:n.startAngle+n.angle)+N/2+M)%M),l=R(a+(t?n.angle:-n.angle)-1e-4+M)%M,h=o-(a+x(a-l)/2);this._side1View=e.setOff(o-a),this._side2View=i.setOff(o-l),a<=N/2&&!(l>=a&&l<N/2)||l>=3*N/2&&!(a<l&&a>3*N/2)?(this._outArcView=s.setOff(m(e.off,i.off)),this._inArcView=r.setOff(1/0)):a>=3*N/2&&l<=N/2?(this._outArcView=s.setOff(1/0),this._inArcView=r.setOff(h)):a>=N/2&&l<=3*N/2?(this._outArcView=s.setOff(m(this._side2View.off,this._side1View.off)),this._inArcView=r.setOff(1/0)):(this._outArcView=s.setOff(h),a>=0&&a<=N&&this._outArcView.setOff(m(this._outArcView.off,this._side1View.off)),l>=N&&l<M&&this._outArcView.setOff(m(this._outArcView.off,this._side2View.off)),this._inArcView=r.setOff(h))}render(t,e,i){const s=Yi.isCircled(i.angle);let r=getComputedStyle(this._sectorView.dom).fill;const n=i.innerRadius>0,o=i.depth,a=this._outPath,l=this._inPath,h=i.clockwise?i.angle:-i.angle;ot&&(r=this.control.getIEColor(r)),this._outArcView.setPath(Yi.arc3d(i.cx,i.cy,i.rx,i.ry,o,i.start,i.start+h,i.clockwise,a)),this._inArcView.setVis(n)&&this._inArcView.setPath(Yi.arc3dInner(i.cx,i.cy,i.rx*i.innerRadius,i.ry*i.innerRadius,o,i.start,i.start+h,i.clockwise,l)),this._side1View.setVis(!s),this._side2View.setVis(!s),this._side1View.visible&&(n?(this._side1View.setPath(Yi.polygon(l.x1,l.y1,a.x1,a.y1,a.x1,a.y1+o,l.x1,l.y1+o)),this._side2View.setPath(Yi.polygon(a.x2,a.y2,l.x2,l.y2,l.x2,l.y2+o,a.x2,a.y2+o))):(this._side1View.setPath(Yi.polygon(i.cx,i.cy,a.x1,a.y1,a.x1,a.y1+o,i.cx,i.cy+o)),this._side2View.setPath(Yi.polygon(i.cx,i.cy,a.x2,a.y2,a.x2,a.y2+o,i.cx,i.cy+o)))),this._sectorView._assignShape(i,!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(ma.DATA_FOCUS,t),this._side2View.setBoolData(ma.DATA_FOCUS,t),this._inArcView.setBoolData(ma.DATA_FOCUS,t),this._outArcView.setBoolData(ma.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,i,s){return this._side1View.transEx(t,e,i,s),this._side2View.transEx(t,e,i,s),this._inArcView.transEx(t,e,i,s),this._outArcView.transEx(t,e,i,s),super.transEx(t,e,i,s)}}class xl extends Na{constructor(e){super(e,"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 zo(e)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"}),this.add(this._textView=new No(e,"rct-pie-series-inner")),this._textView._text.anchor=t.TextAnchor.MIDDLE,this._pointContainer.add(this._sideContainer=new ee(e,"rct-pie-series-sides")),this._labelContainer.add(this._lineContainer=new _a(e))}_getPointPool(){return this._sectors}_setPointColor(t,e){t.setFill(e)}_prepareSeries(t,e){super._prepareSeries(t,e);const i=e.innerText,s=e.depth.getLength()>0;this._depth=e.depth.getLength(),this._ratio=this._depth>0?e.depth.options.ratio:1,this.setBoolData("deep",s),this.$_prepareSectors(t,e,this._visPoints,s),this._lineContainer.prepare(e),this._textView.setVis(e.hasInner()&&i.visible)&&(this._textView.setModel(t,i,i.getIconUrl(),null),i.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 i=this.model,s=i._group,r=Math.floor(s.getPolarSize(t,e)/2),n=s.getInnerRadius(r)*r,o=r-n;this._rx=n+(i._groupPos+i._groupSize)*o,this._rxInner=(n+i._groupPos*o)/this._rx}_runShowEffect(t){t&&Ko.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 ml||t instanceof yl)&&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 yl&&t.focusView(e)}getClipContainer(){return null}$_prepareSectors(t,e,i,s){const r=i.length;let n=this._sides;s!=this._deep&&this._sectors&&(this._sectors.prepare(0),this._sectors=null,n&&(n.prepare(0),n=this._sides=null)),this._sectors||(s?(this._sectors=new Da(this._pointContainer,yl,null),n=this._sides=new go(this._sideContainer,fl,"rct-pie-series-side")):this._sectors=new Da(this._pointContainer,ml,null)),this._deep=s,n&&n.prepare(4*r,(t,e)=>t.index=e),this._sectors.prepare(r,(s,r)=>{const n=s.point=i[r];this._preparePoint(t,e,n,s)})}$_calcAngles(t){const e=this._zombie,i=this._zombieRate,s=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?i:t._isDeleted()?t._vr:1)).reduce((t,e)=>t+e,0),o=this.model._totalRad*this._getGrowRate();let a=this.model._startRad%M;if(s>1||s>0&&!e)t.forEach(t=>{1===s&&t._isDeleted()||1===s&&t._vr<1?(t.startAngle=a,t.angle=o*r*t._vr,t.yRate=100):t.isNull||(t.yRate=R(t.yValue*(t===e?i:t._isDeleted()?t._vr:1)/n)||0,t.startAngle=a,a+=t.angle=r*t.yRate*o,t.yRate*=100)});else if(1==s){const e=t[0];e.startAngle=a,e.angle=r*i*o,e.yRate=100}}$_layoutSectors(t,e,i){const s=this.model,r=s.options.clockwise,n=this._getGrowRate(),o=s.getCenter(e,i),a=this._cx=o.x,l=this._cy=o.y,h=this._rx,_=this._rxInner,c=this._depth,d=this._ratio,u=this._sides,f=s.pointLabel,m=f.options,y=f.connector.options.curved,w=this._labelViews(),v="inside"===s.getLabelPos(f),S=b(m.radius,.7),V=this._pb,C=f.getDistance(v,h,_),A=f.getWidgetAlign();let P=null==w?void 0:w.textAlign();const k=this._lineContainer.setVis(f.connector.visible)?this._lineContainer:null,L=this._slicedOff=s.getSliceOffset(h)*n,T=[],N=[],M=[],E=(null==w?void 0:w.getWidth(0))||0,B=this._sectors.count;let D,O;if(this._lineContainer.setStyleOrClass(f.connector.options.style),!w||P||A||(P="center"),this._textView.visible){this._textView.layout("center"),this._textView.setContrast(null);const t=this._textView.getLayoutBox();this._textView.trans(a-t.x-t.width/2,l-t.y-t.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 f=t.point;if(u){const e=4*o;t.setSides(r,u.get(e),u.get(e+1),u.get(e+2),u.get(e+3))}if(O=null==k?void 0:k.get(f),f.isNull)t.setVis(!1),w&&(D=w.get(f,0))&&D.setVis(!1),null==O||O.setVis(!1);else{const o=B>1&&f.sliced,u=f.startAngle,m=u+f.angle/2;let b=0,k=0;if(o&&n>=1&&!t.isDomAnimating()&&(b+=p(m)*L,k+=g(m)*L),t.trans(b,k).setVis(!0),f.xPos=a+p(m)*(L+h*S),f.yPos=l+g(m)*(L+h*S),t.render(w,null,{cx:a,cy:l,rx:h,ry:h*d,innerRadius:_,start:u,angle:x(f.angle),clockwise:r,depth:c}),w&&(D=w.get(f,0))){const r=s.getLabelOff2(f);let n;v?(null==O||O.setVis(!1),this.$_layoutLabelInside(f,D,P,r,C,o?L:0)):(n=-1===A?this.$_layoutLabelAligned(!1,f,D,P,O,V,y,r,C,o?L:0):1==A?this.$_layoutLabelEnded(!1,f,D,P,O,V,y,r,C,o?L:0,E,e,i):this.$_layoutLabelOutside(!1,f,D,P,O,V,y,r,C,o?L:0),n?T.push(D):N.push(D),this._layoutLabelRotation(D)),D.setContrast(v&&t.dom).setVis(!0),M.push(D)}else null==O||O.setVis(!1)}}),u&&u.sortDom((t,e)=>{let i=e.off-t.off;return 0===i&&(i=t.index-e.index),i});const R=m.convergent,$=m.dedupeMode,I=m.overflow;w&&(v||0===A?"preserveOrder"!==$&&"largestFirst"!==$||w.dedupe(M,k,$):w.arrangeVertical(this,T,k,i,R,$,I)+w.arrangeVertical(this,N,k,i,R,$,I)>0&&this._sectors.forEach(t=>{const r=t.point;if(!r.isNull){const t=B>1&&r.sliced,n=s.getLabelOff2(r);D=w.get(r,0),O=null==k?void 0:k.get(r),(null==D?void 0:D.visible)&&(-1===A?this.$_layoutLabelAligned(!0,r,D,P,O,V,y,n,C,t?L:0):1==A?this.$_layoutLabelEnded(!0,r,D,P,O,V,y,n,C,t?L:0,E,e,i):this.$_layoutLabelOutside(!0,r,D,P,O,V,y,n,C,t?L:0))}}))}$_layoutLabelAligned(t,e,i,s,r,n,o,a,l,h){const _=i.isDomAnimating(),c=e.startAngle+e.angle/2,d=this._cx,u=this._cy,f=this._rx,m=this._ry,y=f+h,x=m+h,b=d+p(c)*y,w=u+g(c)*x,v=b<d;!t&&!_&&i.layout(s||(v?"right":"left"));const S=i.getBBox(),V=w-S.height/2;let C,A,P,k=u+g(c)*m;if(v?(C=d+p(Math.PI)*f-l,A=C-S.width-a,P=d+p(Math.PI)*y-l,S.width):(C=d+p(0)*f+l,A=C+a,P=d+p(0)*y+l),r&&r.setVis(y>0)){const e=t?i.ty-V:0;o?r.setLine(n.reset(0,e).quad(.7*(b-C),e,b-C,0).end()):r.setLine(n.reset(0,e).line(b-C,0).end()),r.setPos(C,k),!_&&r.trans(C,w)}return t||(i.setPos(A,k-S.height/2),!_&&i.trans(A,k-S.height/2)),v}$_layoutLabelEnded(t,e,i,s,r,n,o,a,l,h,_,c,d){const u=i.isDomAnimating(),f=e.startAngle+e.angle/2,m=this._cx,y=this._cy,x=this._rx,b=this._ry,w=x+h,v=b+h;let S=m+p(f)*w,V=y+g(f)*v;const C=S<m;!t&&!u&&i.layout(s||(C?"right":"left"));const A=i.getBBox(),P=V-A.height/2;let k,L,T,N=y+g(f)*b;if(C?(k=l+_+a,T=l+_-A.width,L=k):(k=c-l-_-a,T=c-l-_,L=k),r&&r.setVis(w>0)){const e=t?i.ty-P: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,N),!u&&r.trans(L,V)}return t||(i.setPos(T,N-A.height/2),!u&&i.trans(T,N-A.height/2)),C}$_layoutLabelOutside(t,e,i,s,r,n,o,a,l,h){const _=i.isDomAnimating();!t&&!_&&i.layout(s);const c=i.getBBox(),d=e.startAngle+e.angle/2,u=this._cx,f=this._cy,m=this._rx+.5*l,y=this._ry+.5*l,x=p(d)*h,b=g(d)*h,w=u+p(d)*this._rx,v=f+g(d)*this._ry,S=u+p(d)*m;let V=f+g(d)*y;const C=S<u;let A,P;return C?(A=S-.2*l,P=A):(A=S+.2*l,P=A),r&&r.setVis(m>0)&&(o?r.setLine(n.reset(0,0).quad(S-w,V-v,A-w,V-v).end()):r.setLine(n.reset(0,0).lines(S-w,V-v,A-w,V-v).end()),r.setPos(w,v),!_&&r.trans(w+x,v+b)),t||(C?P-=c.width+a:P+=a,V-=c.height/2,i.setPos(P,V),!_&&i.trans(P+x,V+b)),C}$_layoutLabelInside(t,e,i,s,r,n){const o=e.isDomAnimating(),a=this.model,l=a.pointLabel,h=l.options.autoRotation,_=l.options.rotationMode,c=a.options.clockwise;!o&&e.layout(i||"center");const d=e.getBBox(),u=this._rx*this._rxInner,p=t.startAngle+t.angle/2;if(h){const t=a._totalRad,i=m(a.options.totalAngle||360,360);if("angle"===_){let s=p/t*i+90,r=(s+a.options.startAngle)%360;r+=c?0:360,s+=r>180?90:-90,e.setRotation(d.width/2,d.height/2,s)}else this.applyAutoRotation(e,p,t,i)}else this._layoutLabelRotation(e);const g=l.options.align===Ji?.3:l.options.align===Qi?.5:.7,f=u>0?u+(this._rx-u)/2:h?"angle"===_?this._rx*g+s:.8*this._rx+s:.7*this._rx+s,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,i){if(e&&this._sectors.count<2)return;const s=this.model,r=this._labelViews(),n=s.pointLabel.getWidgetAlign(),o=this._slicedOff,a=s.options.autoSlice?s.options.sliceDuration:0,l=t.point,h=l.startAngle+l.angle/2;if((l.sliced=e)?t.transEx(p(h)*o,g(h)*o,a):t.transEx(0,0,a),!r)return;const _=s.pointLabel,c=this._lineContainer,d=_.connector.options.curved,u="inside"===s.getLabelPos(_),f=r.get(l,0),m=s.pointLabel.getDistance(u,this._rx,this._rxInner);if(f){const t=!u&&c.get(l);if(i){let e=r.textAlign();!r||e||n||(e="center"),u?this.$_layoutLabelInside(l,f,e,_.getOffset(),m,o):0===n&&this.$_layoutLabelOutside(!1,l,f,e,t,this._pb,d,_.getOffset(),m,o)}if(e){let e=f.tx,i=f.ty,s=t.tx,r=t.ty;(u||0===n)&&(f.trans(f.x,f.y).transEx2(e,i,a),t&&t.trans(t.x,t.y).transEx(s,r,a))}else(u||0===n)&&(f.trans(f.tx,f.ty).transEx2(f.x,f.y,a),t&&t.trans(t.tx,t.ty).transEx(t.x,t.y,a))}}}class bl extends ka{setHoverRate(t,e,i){const s=this.point,r=Yi.getDrawer(t.model.getShape(s)),n=(+t.model.options.hoverScale||1.8)-1;let o=t._radius;e?this._hoverRadius=o=t._radius*(1+(isNaN(i)?1:i)*n):o=t._radius*(1+n-(isNaN(i)?n:n*i)),this.setPath(r(o)),this.trans(s.xPos,s.yPos)}endHover(t,e){delete this._hoverRadius}}class wl extends La{constructor(t){super(t,"rct-scatter-series")}_createMarkers(t){return new Da(t,bl)}_prepareSeries(t,e){this.$_prepareMarkers(e,this._visPoints)}_renderSeries(t,e){this.$_layoutMarkers(t,e)}_runShowEffect(t){t&&Ko.grow(this)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,(i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r)})}_getDefaultPos(t){return"outside"}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height)}$_layoutMarkers(t,e){const i=this.model,s=i.options,r=this._inverted,n=i.needClip(!1),o=i._xAxisObj,a=i._yAxisObj,l=this._polar=i.chart._body.getPolar(o),h=this._getGrowRate(),_=this._radius=Math.max(0,+i.options.radius||0)*h,c=+s.rotation||0,d=+s.jitterX||0,u=+s.jitterY||0,f=i.pointLabel,m=f.options.position,y=f.getOffset(),x=this._labelViews(),b=r?t:e,w=l?l.total:r?e:t,v=r?0:e;let S;this._markers.forEach((s,f)=>{const V=s.point,C=x&&(S=x.get(V,0));if(s.setVis(!V.isNull)){const f=Yi.getDrawer(i.getShape(V)),x=at.jitter(V.xValue,d),A=at.jitter(V.yGroup,u);let P,k;if(l){const t=l.start+o.getPos(w,x),e=Bi(l,a,A,h);P=l.cx+e*p(t),k=l.cy+e*g(t)}else P=o.getPos(w,x),k=v-a.getPos(b,A),r&&(P=a.getPos(b,A),k=e-o.getPos(w,x));if(V.xPos=P,V.yPos=k,s.setVis(!!l||!n||P>=0&&P<=t&&k>=0&&k<=e)){const t=s._hoverRadius||_;s.setPath(f(t)),s.trans(P,k).rotate(c),C&&this._layoutLabelView(S,m,y,t,P,k)}else C&&C.setVis(!1)}else C&&C.setVis(!1)})}getNearest(t,e){const i=this._markers._internalItems();if(i&&i.length>0){const s=this.model.options.radius,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)}}}canHover(t,e,i){return t<=this.model.options.radius+i}}class vl extends Pa{constructor(t){super(t,"rct-waterfall-series"),this._bars=new Da(this._pointContainer,va),this.add(this._lineContainer=new ee(t,"rct-waterfall-series-lines")),this._lines=new go(this._lineContainer,zr)}_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,i,s){super._prepareSeries(t,e,i,s),this._rd=+e.options.cornerRadius||0}_preparePoints(t,e,i){this.$_parepareBars(t,e,i)}_layoutPoint(t,e,i,s,r,n){const o=t.point;if(t.wPoint=r,t.hPoint=n,s+=n,t.layout(i,s,this._rd,this._rd,0,0,this._inverted),e>0){const t=this._lines.get(e-1),a=o.y;let l;l=o._isSum||o._isMid?a<0?s:s-n:a<0?s-n:s,t.setHLine(l,this._xPrev+this._wPrev/2,i-r/2)}this._xPrev=i,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,i,s){t.setAttrEx("aria-label",i.ariaHint()),this._setColorIndex(t,i),t.internalClearStyleAndClass(),e.options.pointStyle&&t.internalSetStyleOrClass(e.options.pointStyle),s&&s.forEach(e=>e&&t.internalSetStyleOrClass(e)),i._isSum&&e.options.sumColor?this._setPointColor(t,e.options.sumColor):i.y<0&&e.options.negativeColor?this._setPointColor(t,e.options.negativeColor):i.color&&this._setPointColor(t,i.color),i.range&&(i.range.color&&this._setPointColor(t,i.range.color),i.range.style&&t.internalSetStyleOrClass(i.range.style));const r=e.getPointStyle(i);r&&t.internalSetStyleOrClass(r)}$_parepareBars(t,e,i){this._bars.prepare(i.length,(t,s)=>{const r=t.point=i[s];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(i.length-1,(t,e)=>{t.visible=!i[e].isNull&&!i[e+1].isNull})}}function Sl(t,e){return new(jo[e._type()])(t)}function Vl(t,e){return new(pa[e._viewType()])(t)}ma.register([Qr,za],[en,Fa],[Dr,Wa],[Mr,Ha],[on,Ya],[ln,Ua],[mn,qa],[bn,Qa],[vn,tl],[An,il],[kn,rl],[Ln,ol],[En,ll],[On,_l],[Zr,Ia],[In,dl],[zn,pl],[Gn,gl],[Zn,xl],[Qn,wl],[eo,vl]),Wo.register([gr,Ba],[ur,Ma],[pr,Ea]);class Cl extends Ao{constructor(t){super(t,"rct-axis-grid"),this._lines=new go(this,zr),this.add(this._minorLineContainer=new Jt(t,"rct-axis-minor-grid")),this._minorLines=new go(this._minorLineContainer,zr)}_prepareStyleOrClass(t){}_doMeasure(t,e,i,s,r){return{width:i,height:s}}_doLayout(){const t=this._model,e=t.options,i=t.axis,s=i.options.reversed,r=this.width,n=this.height,o=i._isHorz?r:n;if(t instanceof fr&&i instanceof vr){const e=t.minorGrid,a=t.visible&&!i.isEmpty()?t.getMinorPositions(i,o):[],l=this._minorLines.prepare(a.length,t=>{t.internalClearStyleAndClass(),t.setClass("rct-axis-minor-grid-line"),t.internalSetStyleOrClass(e._style)});this._minorLineContainer.setVis(a.length>0),this.$_layoutGridLines(l,a,i,s,r,n,()=>!!a.length)}else this._minorLines.prepare(0),this._minorLineContainer.setVis(!1);const a=i.isEmpty()?[]:t.getPositions(i,o),l=this._lines.prepare(a.length,e=>{e.internalClearStyleAndClass(),e.setClass("rct-axis-grid-line"),e.internalSetStyleOrClass(t._style)}),h=l.count-1;l.forEach((t,e)=>{t.setBoolData("first",0===e),t.setBoolData("last",a[e]===(i._isHorz?r:n))});const _=null==e.firstVisible?t.visible:e.firstVisible,c=null==e.lastVisible?t.visible:e.lastVisible;this.$_layoutGridLines(l,a,i,s,r,n,e=>0===e?_:e===h?c:t.visible)}$_layoutGridLines(t,e,i,s,r,n,o){const a=t.count-1;if(i._isHorz){const l=b(i._prevRate,1);t.forEach((t,h)=>{t.setVis(o(h,a))&&t.setVLine(i.prev(e[h])+(s?r*(1-l):0),0,n)})}else{const l=s?b(i._prevRate,1):1;t.forEach((t,s)=>{t.setVis(o(s,a))&&t.setHLine(n*l-i.prev(e[s]),0,r)})}}}class Al 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,i){this.isClip(this._clip)?this._clip.resize(t,e):this._clip=this.control.clipBounds(0,0,t,e),this.setClip(this._clip);const s=this._model._sect.len,r=new qt;if(i){let t=0,i=0,n=s/2,o=s;for(r.move(i,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(i,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(i,t);t<e;)t+=20,r.line(n,t),t+=20,r.line(i,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,i=0,n=s/2,o=s;for(r.move(e,n);e<t;)e+=20,r.line(e,i),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,i),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 Pl extends Jt{constructor(t){super(t,"rct-axis-guide"),this.add(this._labelView=new No(t,"rct-axis-guide-label"))}vertical(){return this.model.axis._isHorz}prepare(t,e){if(this.model=e,this._labelView.setVis(!!e.label.options.text)){this._labelView.setModel(t,e.label,e.label.getIconUrl(),null);const i=e.label.getText();e.label.prepareRich(i)}}layout(t,e,i){this._labelView.visible&&(this.model.label.buildSvg(this._labelView._text,this._labelView._outline,t,e,this.model.label,null),this._labelView.setContrast(this._getContrastTarget()).layout(this.textAlign()||"center")),i?this._doLayoutPolar(t,e,i):this._doLayout(t,e)}_getContrastTarget(){return null}}class kl extends Pl{constructor(t,e){super(t),this.insertFirst(this._line=new(e?Go:zr)(t,"rct-axis-guide-line"))}prepare(t,e){super.prepare(t,e),this.setVis(e.visible&&e.axis.contains(e.options.value))&&s(e._style)&&this._line.setStyles(e._style)}_doLayout(t,e){const i=this.model,s=i.options.value,r=i.label,n=r.options,o=this._line,a=this._labelView.setVis(r.visible)?this._labelView:null,l=this._labelView.getBBox(),h=b(n.offsetX,0),_=b(n.offsetY,0);let c,d;if(this.vertical()){const r=i.axis.getPos(t,s),u=o.setVis(!isNaN(r));if(null==a||a.setVis(u),u&&(o.setVLine(r,0,e),a)){switch(n.align){case"center":c=r-l.width/2+h;break;case"right":c=r+h;break;default:c=r-l.width-h}switch(n.verticalAlign){case"bottom":d="outside"!==n.position?e-l.height-_:e+_;break;case"middle":d=(e-l.height)/2-_;break;default:d="outside"!==n.position?_:-1*(l.height+_)}}}else{const r=e-i.axis.getPos(e,s),u=o.setVis(!isNaN(r));if(null==a||a.setVis(u),u&&(o.setHLine(r,0,t),a)){switch(n.align){case"center":c=(t-l.width)/2-h;break;case"right":c="outside"!==n.position?t-l.width-h:t+h;break;default:c="outside"!==n.position?h:-1*(l.width+h)}switch(n.verticalAlign){case"bottom":d=r+_;break;case"middle":d=r-l.height/2-_;break;default:d=r-l.height-_}}}(null==a?void 0:a.visible)&&a.trans(c,d)}_doLayoutPolar(t,e,i){const s=this.model,r=this._line,n=this._labelView.setVis(s.axis.contains(s.options.value)&&s.label.visible)&&this._labelView,o=s.axis.getStartAngle(),a=Mi(i,s.axis),l=i.rdInner+s.axis.getPos(a,s.options.value);r.setArc(i.cx,i.cy,l,o,s.axis.getTotalAngle(),!1),r.setStyle(U,"none"),n&&n.trans(i.cx+l*p(i.start),i.cy+l*g(i.start))}}class Ll extends Pl{constructor(t,e){super(t),this.insertFirst(this._box=new(e?hn:Ui)(t,"rct-axis-guide-range"))}_getContrastTarget(){var t;return"outside"!==(null===(t=this.model)||void 0===t?void 0:t.label.options.position)?this._box.dom:null}prepare(t,e){super.prepare(t,e);const{startValue:i,endValue:s}=e.options,r=!_(i)&&!_(s);this._range=r?e.axis.trimRange(m(i,s),y(i,s)):[NaN,NaN],this.setVis(e.visible&&!isNaN(this._range[0])&&this._range[1]>this._range[0])&&this._box.setStyleOrClass(e._style)}_doLayout(t,e){const i=this.model;i.options;const s=i.label,r=s.options,n=this._box,[o,a]=this._range,l=this._labelView.setVis(s.visible)?this._labelView:null,h=this._labelView.getBBox(),_=b(r.offsetX,0),c=b(r.offsetY,0);if(this.vertical()){const s=i.axis.getPos(t,o),d=i.axis.getPos(t,a),u=!isNaN(s)&&!isNaN(d)&&n.setVis(d!==s);if(null==l||l.setVis(u),u){let i,o;switch(r.align){case"center":i=s+(d-s-h.width)/2+_;break;case"right":i=d-h.width-_;break;default:i=s+_}switch(r.verticalAlign){case"bottom":o="outside"!==r.position?e-h.height-c:e+c;break;case"middle":o=(e-h.height)/2-c;break;default:o="outside"!==r.position?c:-1*(h.height+c)}n.setBox(s,0,d,e),l&&l.trans(y(0,m(t,i)),o)}}else{const s=e-i.axis.getPos(e,o),d=e-i.axis.getPos(e,a),u=!isNaN(s)&&!isNaN(d)&&n.setVis(s!==d);if(null==l||l.setVis(u),u){let e,i;switch(r.align){case"center":e=(t-h.width)/2-_;break;case"right":e="outside"!==r.position?t-h.width-_:t+_;break;default:e="outside"!==r.position?_:-1*(h.width+_)}switch(r.verticalAlign){case"bottom":i=s-h.height-c;break;case"middle":i=d+(s-d-h.height)/2-c;break;default:i=d+c}l&&l.trans(e,i),n.setBox(0,d,t,s)}}}_doLayoutPolar(t,e,i){const s=this.model,r=this._box,n=this._labelView.setVis(s.label.visible)&&this._labelView,o=s.axis.getStartAngle(),a=Mi(i,s.axis),l=i.rdInner+s.axis.getPos(a,this._range[0]),h=i.rdInner+s.axis.getPos(a,this._range[1]);if(r.setSector({cx:i.cx,cy:i.cy,rx:h,ry:h,innerRadius:l/h,start:o,angle:M,clockwise:!0}),n){const t=l+(h-l)/2;n.trans(i.cx+t*p(i.start),i.cy+t*g(i.start))}}}class Tl extends ee{constructor(){super(...arguments),this._views=new go(this,ne)}prepare(){this._rows=[]}addAll(t,e){const i=this._rows;e.forEach(t=>{i.push(...t.grid.rows.getRows())})}layout(t,e){const i=this._rows;this._views.prepare(i.length),this._views.forEach((s,r)=>{const n=i[r],o=n.axis,a=Math.max(o.valueMin(),n.from),l=Math.min(o.valueMax(),n.to);if(n.axis._isHorz){const i=y(0,m(t,o.getPos(t,a))),r=y(0,m(t,o.getPos(t,l)));s.setPath(Yi.rectangle(i,0,r-i,e))}else{const i=y(0,m(e,o.getPos(e,a))),r=y(0,m(e,o.getPos(e,l)));s.setPath(Yi.rectangle(0,e-i,t,i-r))}s.internalClearStyleAndClass(),s.setFill("none"),s.setFill(n.color),n.style&&s.internalSetStyleOrClass(n.style)})}}class Nl 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 Ll?this._rangePool.push(e):this._linePool.push(e)}}setAll(t,e,i){e.forEach(e=>{let s;e instanceof ii?s=this._rangePool.pop()||new Ll(t,i):e instanceof ei&&(s=this._linePool.pop()||new kl(t,i)),this.add(s),s.prepare(t,e)})}add(t){return this._views.push(t),super.add(t)}}class Ml 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")),this.setStyleOrClass(t._style)}layout(t,e,i,s,r){const n=this.model.axis,o=n._isHorz,a=new qt;if(this._bar){const l=n._isHorz?s:r;let h;if(t?h=t.point.xValue:this.model.options.showAlways&&(h=n.options.reversed?n.xValueAt(o?s-e:i):n.xValueAt(o?e:r-i)),n instanceof ms&&(h=d(h)),!isNaN(h)){const t=n.getPos(l,h);let e=n.getUnitLen(l,h);o?a.rect(t-e/2,0,e,r):a.rect(0,r-t-e/2,s,e)}}else(t||this.model.options.showAlways)&&(o?a.vline(e,0,r):a.hline(i,0,s));this.setPath(a.end())}}class El extends Fo{constructor(t){super(t,"Reset Zoom",El.CLASS_NAME),this.setVis(!1)}}El.CLASS_NAME="rct-reset-zoom";class Bl extends ee{constructor(t){super(t,"rct-empty-view"),this.add(this._backView=new Xi(t,"rct-empty-view-back")),this.add(this._labelView=new No(t,"rct-empty-view-label"))}layout(t,e,i){this.setStyleOrClass(t._style),"background"===t.options.effect&&this._backView.setStyleOrClass(t.options.backgroundStyle),this._backView.resize(e,i);const s=this._labelView;t.buildSvg(s._text,s._outline,e,i,null,null),s.layout("center");const r=s.getBBox();s.trans((e-r.width)/2,(i-r.height)/2)}}class Dl extends ee{constructor(t){super(t,"rct-body-depth-grid"),this._lines=new go(this,zr)}layout(t,e,i,s,r,n){const o=e.model,a=o.axis,{side:l,base:h}=s,_=a.isEmpty()?[]:o.getPositions(a,a._isHorz?r-h:n-l);this._lines.prepare(_.length,(e,s)=>{e.internalClearStyleAndClass(),e.internalSetStyleOrClass(t.gridLine._style),e.setClass("rct-body-depth-grid-line"),i?e.setLine(0,n-_[s],r,n-l-_[s]):e.setLine(_[s]+h,0,_[s],n)})}}class Ol 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 zr(t,"rct-body-depth-side-line")),this.add(this._endView=new zr(t,"rct-body-depth-side-line"))}layout(t,e,i,s,r){const n=this.width,o=this.height;this.$_renderBack(this._backView,e,i,s,n,o),this.$_renderGrids(t,e,r,i,s,n,o)}$_renderBack(t,e,i,s,r,n){const{side:o,base:a}=s,l=this._lineView,h=this._endView;t.internalClearStyleAndClass(),t.internalSetStyleOrClass(e._style),l.setVis(e.line.visible)&&(l.internalClearStyleAndClass(),l.internalSetStyleOrClass(e.line._style)),h.setVis(e.endLine.visible)&&(h.internalClearStyleAndClass(),h.internalSetStyleOrClass(e.endLine._style)),i?(t.setPath(Yi.polygon(0,o,a,0,a,n-o,0,n)),l.visible&&l.setVLineC(0,o,n),h.visible&&h.setLine(0,o,r,0)):(t.setPath(Yi.polygon(a,0,r,0,r-a,o,0,o)),l.visible&&l.setHLineC(n,0,r-a),h.visible&&h.setLine(r,0,r-a,n))}$_renderGrids(t,e,i,s,r,n,o){const a=this._gridContainer,l=this._gridViews;for(const[t,e]of this._gridViews.entries())i.has(t)||(l.delete(t),e.remove());for(const[h,_]of i.entries())if(h._isX===this.isX){let i=l.get(h);i||(i=new Dl(t),l.set(h,i),a.add(i)),i.layout(e,_,s,r,n,o)}}}class Rl extends ee{constructor(t){super(t,"rct-body-depth"),this.add(this._xSideView=new Ol(t,!0)),this.add(this._ySideView=new Ol(t,!1)),this.add(this._orgLineView=new zr(t,"rct-body-depth-org-line"))}render(t,e,i,s,r,n,o){if(this.setVis(!!r)){const{base:a,side:l}=r,h=this._xSideView,_=this._ySideView;h.setVis(i.xSide.visible)&&(e?h.setBounds(0,0,a,o):h.setBounds(0,o-l,n,l),h.layout(t,i.xSide,e,r,s)),_.setVis(i.ySide.visible)&&(e?_.setBounds(0,o-l,n,l):_.setBounds(0,0,a,o),_.layout(t,i.ySide,!e,r,s)),this._orgLineView.setVis(i.orgLine.visible)&&this._orgLineView.setLine(a,o-l,0,o)}}}class $l extends Ao{constructor(t,e){super(t,$l.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 Xi(t)),this._hitTester.setFill("transparent"),this.add(this._background=new ne(t,"rct-body-background")),this.add(this._depthLayer=new Rl(t)),this.add(this._image=new To(t,!0,"rct-body-image")),this.add(this._emptyView=new Bl(t)),this.add(this._gridRowContainer=new Tl(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 Nl(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._stackLabelContainer=new ee(t,"rct-stack-label-container")),this.add(this._frontGuideContainer=new Nl(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 El(t)),this._crosshairViews=new go(this._feedbackContainer,Ml)}getAnnotationAnchor(t){return this._gaugeMap.get(t)||this._annotationMap.get(t)}getCol(){return 0}getRow(){return 0}prepareRender(t,e,i){const s=e.chart,r=e.depth.visible;this._animatable=Qt._animatable&&s.animatable(),this._polar=i,this._prepareSeries(t,e,s._getSeries().getVisibleSeries(),r),s._getGauges()&&this._prepareGauges(t,s,s._getGauges().getVisibles()),this._prepareAnnotations(t,s._body.getAnnotations())}prepareGuideContainers(){this._guideContainer.clean(),this._frontGuideContainer.clean()}checkDepth(t,e,i){return this._depthExt=t._body._getDepth(e,i)}pointerMoved(t,e){const i=this.width,s=this.height,r=this._inverted,n=this._polar,o=this._seriesViews,a=o.length,l=t.x>=0&&t.x<i&&t.y>=0&&t.y<s;let h,_;if(ma.isPointDom(e))for(let t=a-1;t>=0;t--)if(_=o[t].pointByDom(e),_){h=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=l&&!this._zoomRequested&&!this.chart().isEmpty(!0)&&!d;if(this._crosshairViews.forEach(e=>{e.setVis(u)&&e.layout(_,t.x,t.y,i,s)}),_)this.$_setFocused(h,_,t);else if(a>0){const e=this.chart().chartOptions.pointHovering.getHintDistance(null==h?void 0:h.model);let i,s,_=!n;for(const t of o)if(!(t.model instanceof Xr)){_=!1;break}if(h=null,_)if(a>1){const n=[];o.forEach(o=>{i=b(o.getHintDistance(),e),s=o.getNearest2(t.x,t.y,r),n.push({hint:i,sv:o,pv:s})});const a=n.reduce((e,i)=>{if(!e.pv||!i.pv)return e||i;const s=e.pv.pv.point.xPos-t.x,r=e.pv.pv.point.yPos-t.y,n=s*s+r*r,o=i.pv.pv.point.xPos-t.x,a=i.pv.pv.point.yPos-t.y;return n<o*o+a*a?e:i});h=a.sv,s=a.pv,i=a.hint}else h=o[0],i=b(h.getHintDistance(),e),s=h.getNearest2(t.x,t.y,r);else o.forEach(r=>{if(r.getHintDistance&&(i=b(r.getHintDistance(),e),i>0)){const e=r.getNearest(t.x,t.y);(!s||e.dist<s.dist)&&(h=r,s=e)}});l&&s&&h.canHover(s.dist,s.pv,i)?this.$_setFocused(h,s.pv,t):this.$_setFocused(null,null,t)}return l}hoverSeries(t){this.$_hoverSeries(this._seriesMap.get(t))}$_setFocused(t,e,i){const s=this._owner,r=this.chart(),n=null==t?void 0:t.model,o=this.chart().chartOptions.pointHovering,a=this._focused,l=this._siblings,h=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 Js){let e,s=Number.MAX_SAFE_INTEGER;for(let r=0;r<t.getPoints().count;r++){const n=t.getPoints().get(r);let o;if(t instanceof mn){const e=(t._xAxisObj._vlen<t._yAxisObj._vlen?t._xAxisObj:t._yAxisObj)._vlen,{min:s,max:r}=t.getPixelMinMax(e),a=t.getRadius(n.zValue,s,r);o=Math.sqrt((n.xPos-i.x)**2+(n.yPos-i.y)**2)-a}else o=Math.sqrt((n.xPos-i.x)**2+(n.yPos-i.y)**2);o<s&&(s=o,e=n)}return e}return t.getPoints().pointAt(e.point.xValue)});_=d.map(t=>s.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(l,u)||(_&&_.forEach((t,e)=>{t.focusPoints(t.getSiblings(c[e]))}),h&&h.forEach(t=>{(!_||_.indexOf(t)<0)&&t.focusPoints(null)}),this._siblingSeries=_,this._siblings=u),e!==a){let i=this._focusedSeries;this._focused=e,t!==i&&(i&&this.$_focusSeries(i,!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||!s.tooltipVisible()||r._tooltip.isFollowPointer(t.model))?i.x>0&&i.x<this.width&&i.y>0&&i.y<this.height?s.showTooltip(n,e,[],this,i):s.hideTooltip():!this._focused&&s.tooltipVisible()&&s.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(ma.DATA_UNHOVER,t&&e!==t),e._labelContainer.setBoolData(ma.DATA_UNHOVER,t&&e!==t)})}hoverPoint(t){const e=this.chart().seriesByPoint(t),i=this.getSeries(e);i?(i.hoverPoint(t),this._hoverPointSeries.push(i)):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,i,s){const r=this.chart(),n=r.isInverted(),o=r.xAxis,a=n?this.height:this.width,l=o.valueAt(a,n?a-s:t),h=o.valueAt(a,n?a-e:i);o.zoom(l,h)&&(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 ka&&e.endHover(t,!1),e.setBoolData(ma.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,i,s,r){const n=this.control,o=e.chart,a=this._depthExt,l=a?a.wBody:i,h=a?a.hBody:s;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,i)=>{e.measure(t,this._series[i],l,h,r)}),!this._polar){this.$_prepareGrids(t,o);for(const e of this._gridViews.keys())this._gridViews.get(e).measure(t,e.grid,l,h,r);this.$_prepareAxisBreaks(t,o)}return this._gaugeViews.forEach((e,i)=>{e.measure(t,this._gauges[i],l,h,r)}),this._annotationViews.forEach((e,i)=>{e.measure(t,this._annotations[i],l,h,r)}),this._zoomButton.setVis(e.zoomButton.visible)&&this._zoomButton.layout(),{width:i,height:s}}_clipSeries(t,e,i){const s=i?this._seriesClip:this._seriesClip2;t&&t.setClip(s),e&&e.setClip(s)}_renderBackground(t,e,i){t.setPath(Yi.rectangle(0,0,e,i))}_setImage(t,e,i,s){if(e.setVis(t.visible&&!!t.options.url))return e.setImage(t.options.url,i,s),e.setStyleOrClass(t._style),!0}_doLayout(){const t=this.control,e=this.model;e.image;const i=this._depthExt,s=this.width,r=this.height;let n=i?i.wBody:s,o=i?i.hBody:r,a=i?i.base:0;if(this._inverted){const t=i?i.side:0;this._seriesClip.setBounds(-t,-n,r,s),this._seriesClip2.setBounds(-t,0,s,r)}else this._seriesClip.setBounds(-a,0,s,r),this._seriesClip2.setBounds(-a,0,s,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&&i&&i.depth>0),this._seriesViews.forEach(t=>{t.model.needClip(!1)&&this._clipSeries(t.getClipContainer(),t.getClipContainer2(),t.clipInvertable()),t.depthEnabled&&t._setDepth(i),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,i,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,i=e.axis;t.setStyleOrClass(e._style),i._isHorz?i.options.reversed?t.trans(n-e._sect.pos,0):t.trans(e._sect.pos,0):i.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._layoutEmptyView(e,n,o)}_layoutEmptyView(t,e,i){this._emptyView.setVis(this.$_isEmptyVisible(t))&&(this.model.emptyView._prepareRender(),this._emptyView.layout(t.emptyView,e,i))}$_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(Yo[e._type()])(t)}$_prepareGrids(t,e){const i=e._needAxes(),s=this._gridContainer,r=this._gridViews,n=this._baseContainer,o=this._baseViews,a=this.getCol(),l=this.getRow();for(const t of r.keys())i&&e.containsAxis(t)&&t.checkVisible()&&t.grid.visible||(r.get(t).remove(),r.delete(t));for(const t of o.keys())i&&e.containsAxis(t)&&t.checkVisible()&&(!(t instanceof vr)||t.baseLine.visible)&&t.isBaseVisible()||(o.get(t).remove(),o.delete(t));i&&[e._getXAxesAtPane(a,l,!0),e._getYAxesAtPane(a,l,!0)].forEach(e=>e.forEach(e=>{const i=e.grid;if(!r.has(e)&&(i.visible||i.options.firstVisible||i.options.lastVisible)){const i=new Cl(t);r.set(e,i),s.add(i)}if(e instanceof vr&&e.baseLine.visible&&e.isBaseVisible()&&!o.has(e)){const i=new zr(t,"rct-axis-baseline");o.set(e,i),n.add(i),i.tag=e}}))}_prepareSeries(t,e,i,s){const r=e.chart,n=this._inverted=r.isInverted(),o=this._seriesMap,a=this._seriesViews,l=s?e.depth:null;for(const t of o.keys())i.indexOf(t)<0&&(o.get(t).remove(),o.delete(t));this._series=i,a.forEach(t=>{i.indexOf(t.model)<0&&(this.control.loaded?t.removeLater(200):t.remove(),t._labelContainer.remove(),t._stackLabelContainer.remove())}),a.length=0,i.forEach(e=>{const i=o.get(e)||Vl(t,e);i._setChartOptions(n,this._animatable,r.loadAnimatable()),i.parent||(this._seriesContainer.add(i),this._labelContainer.add(i._labelContainer)),o.set(e,i),a.push(i),i.prepareSeries(t,e,this._polar,l)}),this._seriesContainer.sort(a),a.forEach(t=>{this._labelContainer.dom.appendChild(t._labelContainer.dom)}),a.forEach(t=>t._stackLabelContainer.remove());const h=new Map;for(const t of a){const e=t.model._group;e&&e._stacked&&e.isLastVisible(t.model)&&h.set(e,t)}h.forEach(t=>this._stackLabelContainer.add(t._stackLabelContainer))}_prepareGauges(t,e,i){const s=this._seriesContainer,r=e.isInverted(),n=this._gaugeMap,o=this._gaugeViews;for(const t of n.keys())i.indexOf(t)<0&&(n.get(t).remove(),n.delete(t));this._gauges=i,o.forEach(t=>t.remove()),o.length=0,i.forEach(i=>{const a=n.get(i)||this.$_createGaugeView(t,i);s.add(a),n.set(i,a),o.push(a),a.prepareGauge(t,i),a._setChartOptions(r,this._animatable,e.loadAnimatable())})}_prepareAnnotations(t,e){const i=this._annotationContainer,s=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)||Sl(t,e);(e.options.front?s:i).add(o),r.set(e,o),n.push(o)})}$_prepareAxisBreaks(t,e){const i=this._axisBreakContainer,s=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 vr&&o.push(...t._getBreaks())}));s.length<o.length;){const e=new Al(t);i.add(e),s.push(e)}for(;s.length>o.length;)s.pop().remove();s.forEach((t,e)=>t.setModel(o[e]))}$_prepareCrosshairs(t){const e=this._crosshairViews,i=this.getCol(),s=this.getRow(),r=[];t._needAxes()&&[t._getXAxesAtPane(i,s,!0),t._getYAxesAtPane(i,s,!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,i,s){this._annotationViews.length>0&&this._annotationViews.forEach(r=>{r._layoutView(t,e,0,0,i,s),!this._polar&&r.model.needClip()&&r.resetClip(this.control,i,s)})}}$l.BODY_CLASS="rct-body";class Il extends Jt{constructor(t){super(t,Fl.HANDLE_STYLE),this.add(this._back=new Xi(t)),this.add(this._shape=new ne(t)),this._shape.setFill("white")}layout(t,e,i){if(t!==this._w||e!==this._h||i!==this._vertical){const s=2*nr.HANDLE_RADIUS,r=new qt;this._back.rect={x:-s/2,y:-s/2,width:s,height:s,rx:s/2};const n=s/3;r.polygon(-n-1,0,-1,-n,-1,n),r.polygon(n+1,0,1,-n,1,n),this._shape.setPath(r.end()),this._w=this.width=t,this._h=this.height=e,this._vertical=i}}}class Fl extends Ao{static isHandle(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.classList.contains(Fl.HANDLE_STYLE)}static isMask(t){return t.classList.contains(Fl.MASK_STYLE)}constructor(t){super(t,Fl.CLASS_NAME),this.add(this._back=new Xi(t,Fl.BACK_STYLE)),this.add(this._container=new ee(t,null)),this.add(this._mask=new Xi(t,Fl.MASK_STYLE)),this.add(this._trackView=new Xi(t,Fl.TRACK_CLASS)),this.add(this._thumbView=new Xi(t,Fl.THUMB_CLASS)),this.add(this._startHandle=new Il(t)),this.add(this._endHandle=new Il(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,i,s,r){const n=e._naviChart;let o,a,l=i,h=s;return e._vertical?(l=e.getSize(),o=e.getThickness(),a=s):(h=e.getSize(),o=i,a=e.getThickness()),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:l,height:h}}_doLayout(t){const e=this.model,i=e.axis()._zoom,s=e.options,r=this.width,n=this.height;if(this._back.resize(r,n),e._vertical);else{const t=i?(i.start-i.min)*r/i.total():0,e=i?(i.end-i.min)*r/i.total():r;this._mask.setVis(s.mask.visible)&&(this._mask.setBounds(t,0,e-t,n),this._mask.setStyleOrClass(s.mask.style));const o=nr.HANDLE_TRACK_HEIGHT,a=nr.HANDLE_TRACK_OFFSET;if(this._trackView.setBounds(-2,n,r+4,o),this._trackView.setRadius(4),this._thumbView.setBounds(t,n,e-t,o),this._startHandle.setVis(s.handle.visible),this._endHandle.setVis(s.handle.visible),this._startHandle.visible&&this._endHandle){const i=2*nr.HANDLE_RADIUS;this._startHandle.layout(i,i,!1),this._startHandle.trans(t,n+a),this._endHandle.layout(i,i,!1),this._endHandle.trans(e,n+a),this._startHandle.setStyleOrClass(s.handle.style),this._endHandle.setStyleOrClass(s.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 i=e.firstSeries;let s=this._seriesView;s&&s.model!==i&&(s.remove(),s=this._seriesView=null),s||(this._container.add(s=this._seriesView=Vl(t,i)),s._simpleMode=!0),s&&s.prepareSeries(t,i,!1,null)}$_prepareXAxisView(t,e){const i=e.xAxis;let s=this._xAxisView;s&&s.model!==i&&(s.remove(),s=this._xAxisView=null),s||(this._container.add(s=this._xAxisView=new Io(t)),s._simpleMode=!0)}$_prepareYAxisView(t,e){const i=e.yAxis;let s=this._yAxisView;s&&s.model!==i&&(s.remove(),s=this._yAxisView=null),s||(this._container.add(s=this._yAxisView=new Io(t)),s._simpleMode=!0)}}Fl.CLASS_NAME="rct-navigator",Fl.BACK_STYLE="rct-navigator-back",Fl.MASK_STYLE="rct-navigator-mask",Fl.HANDLE_STYLE="rct-navigator-handle",Fl.HANDLE_BACK_STYLE="rct-navigator-handle-back",Fl.TRACK_CLASS="rct-navigator-track",Fl.THUMB_CLASS="rct-navigator-thumb";class zl extends he{constructor(t){super(),this.chart=t}}class Hl extends zl{constructor(t,e,i){super(t),this._body=e,this._vertical=i}_doStart(t,e,i,s,r){if(this._body.chart().isPolar())return!1;const n=this.chart.getBounds(),o=this._body.getBounds();return this._xStart=y(0,e-(o.x-n.x)),this._yStart=y(0,i-(o.y-n.y)),this._body.addFeedback(this._feedback=new Xi(this.chart.doc(),"rct-zoom-tracker")),!0}_hideFeedback(){this._feedback.remove()}_doEnded(t,e){const i=this.chart.getBounds(),s=this._body.getBounds();this._vertical?(e=y(0,m(s.height,e-(s.y-i.y))),this._body.setZoom(0,m(y(0,this._yStart),e),this._body.width,y(m(this._yStart,s.height),e))):(t=y(0,m(s.width,t-(s.x-i.x))),this._body.setZoom(y(0,m(this._xStart,t)),0,y(m(this._xStart,s.width),t),this._body.height)),this._feedback.remove()}_doDrag(t,e,i,s,r){const n=this.chart.getBounds(),o=this._body.getBounds();return this._vertical?(r=y(0,m(o.height,r-(o.y-n.y))),this._feedback.setBounds(0,m(this._yStart,r),this._body.width,x(this._yStart-r))):(s=y(0,m(o.width,s-(o.x-n.x))),this._feedback.setBounds(m(this._xStart,s),0,x(this._xStart-s),this._body.height)),!0}}class Gl extends zl{constructor(t,e){super(t),this._view=e}_doStart(t,e,i,s,r){const n=this._view,o=n.model.axis._zoom;if(o){const t=n._thumbView.elementToSvg(0,0);return this._startOff=n._vertical?i-t.y:e-t.x,this._zoomLen=Math.floor(o.length()),!0}return!1}_doDrag(t,e,i,s,r){const n=this._view;let o;return n._vertical?(o=n.svgToElement(s,r).y-this._startOff,o=n.getZoomPos(n.height-o-n._thumbView.height)):(o=n.svgToElement(s,r).x-this._startOff,o=n.getZoomPos(o)),n.model.axis.zoom(o,o+this._zoomLen),!0}}class jl extends zl{constructor(t,e,i){super(t),this._view=e,(this._isStart=e._startHandle.contains(i))?this._handleView=e._startHandle:this._handleView=e._endHandle}cancel(){super.cancel(),this._handleView.setBoolData("select",!1)}_doStart(t,e,i,s,r){const n=this._handleView,o=n.elementToSvg(0,0);return this._startOff=n._vertical?i-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,i,s,r){const n=this._view,o=n.model.axis();o._prepareZoom();let a=n.svgToElement(s,r).x-this._startOff;const l=o._zoom.total(),h=o._zoom.min,_=n.model.options.minSize,c=a*l/n.width+h;return this._handleView._vertical?this._isStart:this._isStart?a>0?o.zoom(c,NaN,_):o.zoom(h,NaN,_):a>0&&a<n.width?o.zoom(NaN,c,_):a>=n.width&&o.zoom(NaN,o._zoom.max,_),!0}}class Wl extends zl{constructor(t,e,i){super(t),this._view=e,this._maskView=e._mask}_doStart(t,e,i,s,r){const n=this._view.model.axis(),o=this._maskView.elementToSvg(0,0);return this._startOff=this._view.model._vertical?i-o.y:e-o.x,this._totalLen=n._zoom.total(),this._zoomLen=n._zoom.length(),!0}_doEnded(t,e){}_doDrag(t,e,i,s,r){const n=this._view,o=n.svgToElement(s,r).x-this._startOff;return n.model._vertical?this.$_moveZoom(o*this._totalLen/n.height):this.$_moveZoom(o*this._totalLen/n.width),!0}$_moveZoom(t){const e=this._view.model;t=y(0,m(t,this._totalLen-this._zoomLen))+e.axis()._zoom.min,e.axis().zoom(t,t+this._zoomLen)}}class Yl{constructor(t){this._chart=t}handleDown(t){if(!t.isPrimary)return;const e=this._clickElement=t.target;if(!e)return;const i=this.$_pointerToPoint(t);this._dragTracker&&this.$_stopDragTracker(t,e,i.x,i.y),this._prevX=this._clickX=i.x,this._prevY=this._clickY=i.y}handleUp(t){this.isDragging()&&this.$_stopDragTracker(t,t.target,this._prevX,this._prevY)}handleMove(t){const e=this._chart.chartView(),i=t.target,{x:s,y:r}=this.$_pointerToPoint(t);if(t.buttons>=1||0===t.buttons&&0===t.button){const i=this.isDragging(),n=this._clickElement;s<0||s>=e.control.dom().offsetWidth||r<0||r>=e.control.dom().offsetHeight||(i?this.$_doDrag(t,n,s,r):(!this._dragTracker&&(x(this._clickX-s)>3||x(this._clickY-r)>3)||this._dragTracker&&!i)&&this.$_startMove(t,n,s,r))}else this.$_stopDragTracker(t,i,s,r,!0);this._prevX=s,this._prevY=r,this.isDragging()?(e.pointerMoved(-1,-1,null),e.forceHideTooltip(),this._stopEvent(t)):t.buttons>=1?(e.pointerMoved(-1,-1,null),e.forceHideTooltip()):e.getButton(i)||e.pointerMoved(t.pointX,t.pointY,t.target)}handleLeave(t){this._chart.chartView().pointerLeaved(t.pointX,t.pointY,t.target)}handleClick(t){var e;if(!this._chart.model.clickable())return;const i=this._chart.model,s=this._chart.chartView(),r=this._clickElement,n=s.getButton(r);let o,a,l,h,_;const c=this._chart.chart.exporter;if(c.isContextMenuVisible()&&c.toggleContextMenu(),n)!0!==n.click()&&s.buttonClicked(n);else if(a=s.legendByDom(r)){const t=null===(e=a.legend.options)||void 0===e?void 0:e.onLegendItemClick;if("function"!=typeof t||!1!==t({chart:i.wrapper,source:a.legend.getSources(a)})){const t=at.makeArray(a.legend.getSources(a),!0),e=!a.source.visible;t.forEach(t=>{if(t instanceof _s){const e=t,r=i.seriesByPoint(e);if(r){r.setPointVisible(e,!e.visible);const t=s.findSeriesView(r);t instanceof Na&&t.togglePointVisible(e)}}else t.visible=e}),s.bodyView().hoverSeries(e?a.source:null)}}else(l=s.seriesByDom(r))?l.clicked(r):(_=s.htmlButtonByDom(r))?_.click():(h=s.annotationByDom(r))?h.clicked():(o=s.creditByDom(r))&&o.clicked(r)}handleDblClick(t){const e=this._chart.chartView()._navigatorView,i=this._clickElement;!e.visible||e.dblClick(i)}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,i){const s=this._chart.chartView(),r=s.bodyOf(t);return Ro.isThumb(t)?new Gl(this._chart,s.getScrollView(t)):Fl.isHandle(t)?new jl(this._chart,s._navigatorView,t):Fl.isMask(t)&&r&&r.model.isZoomed()?new Wl(this._chart,s._navigatorView,t):r&&r.model.canZoom()&&r.contains(t)?new Hl(this._chart,r,s._inverted):void 0}$_doDrag(t,e,i,s){if(!this.$_drag(e,this._prevX,this._prevY,i,s))return this.$_stopDragTracker(t,e,i,s,!0),this._stopEvent(t),!0}$_startMove(t,e,i,s){this.$_startDrag(e,this._prevX,this._prevY,i,s)&&(i!==this._prevX||s!==this._prevY?this.$_doDrag(t,e,i,s):this._stopEvent(t),this._chart.setPointerCapture(t))}$_startDrag(t,e,i,s,r){if(this._dragTracker||this.setDragTracker(this._getDragTracker(t,s-e,r-i)),this._dragTracker){if(this._dragTracker.start(t,e,i,s,r))return!0;this._dragTracker=null}return!1}$_drag(t,e,i,s,r){return this._dragTracker.drag(t,e,i,s,r)}$_stopDragTracker(t,e,i,s,r=!1){this.isDragging()&&(this._chart.releasePointerCapture(t),r?this._dragTracker.cancel():this._dragTracker.drop(null,i,s),this._dragTracker=null)}}class Xl extends ee{constructor(t){super(t,Xl.TITLE_CLASS),this._itemViews=[],this._separators=[],this.itemGap=8,this.setVis(!1)}setHistory(e,i){if(this.setVis(i&&i.length>0)){const s=this._itemViews,r=this._separators;for(;s.length<i.length;){const i=new ue(e,"rct-history-item");i.anchor=t.TextAnchor.START,s.push(i)}for(;s.length>i.length;)s.pop().remove();for(;r.length<i.length-1;){const i=new ue(e);i.anchor=t.TextAnchor.START,i.text=">",r.push(i)}for(;r.length>i.length-1;)r.pop().remove();this.$_layout(i)}}$_layout(t){const e=this._itemViews,i=this._separators,s=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+s,i[o].transX(n),n+=i[o].width+s)}}Xl.TITLE_CLASS="rct-history";class Ul extends Ao{constructor(e){super(e,"rct-legend-item"),this.add(this._back=new Xi(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new ue(e,"rct-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){return t===this._marker&&t.parent===this||(this._marker&&this._marker!==t&&this._marker.remove(),this.insertFirst(this._marker=t)),this._marker}_doMeasure(t,e,i,s,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 l=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():fo,h=mo(this._label.getBBox());return this._gap=b(e.legend.options.markerGap,0),{width:l.width+this._gap+h.width,height:y(l.height,h.height)}}_doLayout(t){const e=this._rMarker,i=b(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((i-e.width)/2,(this.height-e.height)/2),this._label.trans(i+this._gap,(this.height-this._label.getBBox().height)/2)}}class Zl extends Po{constructor(t){super(t,Zl.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new go(this,Ul)}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,i,s,r){const n=e.options,o=e.items(),a=this._vertical="vertical"===e.getLayout();return this._ipr=b(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?b(n.gap,0):0,a?s=e.getMaxHeight(s):i=e.getMaxWidth(i),this.$_prepareItems(t,o),this.$_measure(t,e,a,this._ipr,i,s)}_doLayout(){const t=this.model.options,e=this._rowViews,i=t.useTextColor,s=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,a=this._margins,l=this._paddings,h=this._vertical,_=a.left+l.left,c=a.top+l.top;let d,u=_,p=c;this._itemViews.forEach(t=>{const e=t.model.source,s=e.legendColor(),r=e.legendStroke();t._marker.setColor(s),r&&t._marker.setStroke(r),i&&e.visible?t._label.setFill(s):t._label.setFill("")}),e.forEach((t,e)=>{h?(t.forEach(t=>{t.mw=s[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+l.top+l.bottom,p+="center"===r?(this.height-d)/2:this.height-d),t.forEach(t=>{t.trans(u,p),p+=t.height+o}),u+=s[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+l.left+l.right,u+="center"===r?(this.width-d)/2:this.width-d),t.forEach(t=>{t.trans(u,p),u+=t.width+o}),p+=s[e]+n)})}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,r,n){const o=e.options,a=e.items(),l=this._itemViews,h=o.itemGap||0,_=o.lineGap||0,c=e.getMarkerSize(),d=l.count,u=this._rowViews=[],p=this._sizes=[];let g,f,m,x;l.forEach((e,i)=>{e.setMarker(a[i].source.legendMarker(t,c)),e.measure(t,a[i],r,n,1)});let b=0,w=0;if(i){for(;b<d;)x=l.get(b),w%s===0?(u.push(m=[x]),f=x.mh,w++,b++):(f+=h+x.mh,f<=n?(m.push(x),w++,b++):w=0);this._wMarkers=[],g=f=0,u.forEach((t,e)=>{let i=0,s=0,r=0;t.forEach(t=>{s+=t.mh,i=y(i,t.mw),r=y(r,t._rMarker.width),t._col=e}),s+=h*(t.length-1),f=y(f,s),g+=i,p.push(i),this._wMarkers.push(r)}),g+=_*(u.length-1)}else{for(;b<d;)x=l.get(b),w%s===0?(u.push(m=[x]),g=x.mw,w++,b++):(g+=h+x.mw,g<=r?(m.push(x),w++,b++):w=0);g=f=0,u.forEach(t=>{let e=0,i=0;t.forEach(t=>{e+=t.mw,i=y(i,t.mh)}),e+=h*(t.length-1),g=y(g,e),f+=i,p.push(i)}),f+=_*(u.length-1)}return{width:g,height:f}}}Zl.LEGEND_CLASS="rct-legend";class ql extends Jt{constructor(t){super(t,"rct-polar-axis-tick-mark"),this.add(this._lineView=new zo(t))}layout(){}}class Kl extends Jt{constructor(t,e,i,s){super(t,e),this.add(this._markContainer=new ee(t,"rct-polar-axis-markers")),this._markViews=new go(this._markContainer,ql),this.add(this._gridContainer=new Jt(t,"rct-polar-axis-grids")),this._labelViews=new go(this._labelContainer=i,Do,s?"rct-polar-xaxis-label":"rct-polar-yaxis-label")}prepare(t,e,i,s){this._model=e,this._circular=i,this.$_prepareTickMarks(t,e),this.$_prepareLabels(t,e),this._doPrepare(e,e._ticks,i,s)}layout(t,e,i,s){const r=this._model._ticks;return this._doLayout(this._model,e,i,s,r,t),this}$_prepareTickMarks(t,e){this._markViews.prepare(e._ticks.length)}_prepareLabel(t,e,i,s){const r=i.getLabelText(e,s),n=e.label,o=i.getLabelStyle(e,s);if(t.value=e.value,null!=r){n&&r.match($o)?t.setLabel(i,o,e,r.replace($o,n),1e3,1e3):(i.prepareRich(r),i._paramTick=e,i.buildSvg(t._text,t._outline,NaN,NaN,i,i._domain))}else t.setLabel(i,o,e,n,1e3,1e3)}$_prepareLabels(t,e){const i=e.label;if(i.visible&&e.checkVisible()){const t=e._ticks;i.chart._body.getPolar(e),i.options.rotation;const s=t.length;this._labelContainer.setStyleOrClass(i._style),this._labelViews.prepare(s,(e,s,r)=>{e.setVis(!0),this._prepareLabel(e,t[s],i,r)})}else this._labelViews.forEach(t=>t.setVis(!1))}prepareGuides(t,e,i){let s=this._model.guides.filter(t=>!t.options.front);e.setAll(t,s,!0),s=this._model.guides.filter(t=>t.options.front),i.setAll(t,s,!0)}}class Ql extends Kl{constructor(t,e,i){super(t,"rct-polar-xaxis",i,!0),this._gridLines=new go(this._gridContainer,zr,Ql.GRID_CLASS),e.insertFirst(this._startView=new zr(t,Ql.SECTOR_LINE_CLASS)),e.insertFirst(this._endView=new zr(t,Ql.SECTOR_LINE_CLASS)),e.insertFirst(this._lineView=new Go(t,Ql.LINE_CLASS))}_doPrepare(t,e,i){const s=t.line,r=t.sectorLine;let n=this._lineView;this._gridContainer.setVis(t.grid.visible)&&this._gridLines.prepare(e.length),n.setVis(s.visible)&&(n.setStyleOrClass(s._style),n.setFill("none")),this._startView.setVis(i&&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,i,s,r,n){const o=t.getStartAngle(),a=t.getTotalAngle(),l=t.chart._body.getPolar(t).rdInner;if(r.forEach(t=>t.pos=t.pos/s*a/M),this._gridContainer.visible&&this._gridLines.forEach((n,a)=>{const h=r[a].pos,_=e+p(o+h)*s,c=i+g(o+h)*s,d=e+p(o+h)*l,u=i+g(o+h)*l;n.setFill("none"),n.setLine(d,u,_,c),n.setStyleOrClass(t.grid.options.style)}),this._labelContainer.visible){const n=this._labelViews.count;if(n>0){const a=Math.ceil(9/(360/n)),l=s+t.tick._getLength(),h=this._labelContainer.textAlign()||"center",_=[],c=t.label.options.rotation||0,d="auto"===c;this._labelViews.forEach((t,s)=>{if(t.setVis(s%a===0)){t.layout(h);const n=r[s],a=t.getBBox(),u=t.angle=o+n.pos,f=(u*D%360+360)%360,m=f>90&&f<270;if(d){const s=e-a.width/2+p(u)*(l+a.width/2),r=i-a.height/2+g(u)*(l+a.width/2);t.trans(s,r),t.setRotation(a.width/2,a.height/2,m?u*D+180:u*D)}else{const s=e+p(u)*(l+a.width/2)-a.width/2,r=i+g(u)*(l+a.height/2)-a.height/2;t.trans(s,r),t.setRotation(a.width/2,a.height/2,c)}_.push(t)}});let u=0,f=_[u];for(let t=1;t<_.length;t++){const e=_[t],i=f.inflateBBox(-1,-1),s=e.inflateBBox(-1,-1),r=Object.assign(i,{rotation:f.rotation}),n=Object.assign(s,{rotation:e.rotation});if(vo(r,n)?(e.setVis(!1),_.splice(t,1),--t):(f=e,u=t),t===_.length-1&&_.length>1){if(at.diffAngle(f.angle,_[0].angle)<M/6){const t=Object.assign(_[0].inflateBBox(-1,-1),{rotation:_[0].rotation}),e=Object.assign(f.inflateBBox(-1,-1),{rotation:f.rotation});vo(t,e)&&(f.setVis(!1),_.splice(u,1))}}}}}if(this._lineView.visible)if(this._circular)this._lineView.setArc(e,i,s,o,a,!0);else{const n=t.isArced(),l=[];n&&r[0].pos>0&&l.push(e+p(o)*s,i+g(o)*s),r.map(t=>{const r=t.pos;l.push(e+p(o+r)*s,i+g(o+r)*s)}),n&&r[r.length-1].pos<a&&l.push(e+p(o+a)*s,i+g(o+a)*s),this._lineView.setPolyline(l)}this._startView.visible&&(this._startView.setLine(e+p(o)*l,i+g(o)*l,e+p(o)*s,i+g(o)*s),this._endView.setLine(e+p(o+a)*l,i+g(o+a)*l,e+p(o+a)*s,i+g(o+a)*s))}}Ql.LINE_CLASS="rct-polar-xaxis-line",Ql.SECTOR_LINE_CLASS="rct-polar-xaxis-sector-line",Ql.GRID_CLASS="rct-polar-xaxis-grid-line";class Jl extends Kl{constructor(t,e,i){super(t,"rct-polar-yaxis",i,!1),this._gridViews=new go(this._gridContainer,Go,"rct-polar-yaxis-grid-line"),e.add(this._lineView=new zr(t,"rct-polar-yaxis-line")),e.add(this._baseView=new Go(t,"rct-polar-yaxis-baseline"))}_doPrepare(t,e,i,s){const r=t.line,n=t instanceof vr&&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,i,s,r,n){const o=t.chart._body.getPolar(t),a=o.rdInner,l=Mi(o,t);function h(t,s){if(t.setFill("none"),_)t.setArc(e,i,s,u,f,!0);else{const r=[];d&&c[0].pos>0&&r.push(e+p(u)*s,i+g(u)*s),c.forEach(t=>{const n=t.pos;r.push(e+p(u+n)*s,i+g(u+n)*s)}),d&&c[c.length-1].pos<f&&r.push(e+p(u+f)*s,i+g(u+f)*s),t.setPolyline(r)}}const _=this._circular,c=n._ticks,d=n.isArced(),u=n.getStartAngle(),f=n.getTotalAngle();if(this._gridContainer.visible&&this._gridViews.forEach((e,i)=>{h(e,a+r[i].pos),e.setStyleOrClass(t.grid.options.style)}),this._labelContainer.visible){const t=this._labelContainer.textAlign()||"right",s="left"===t?0:"center"===t?.5:1,o="left"===t?3:"center"===t?0:-3;if(d){const t=n.getStartAngle();this._labelViews.forEach((n,l)=>{const h=n.getBBox(),_=a+r[l].pos;n.setContrast(null).trans(e+p(t)*_-h.width*s+o,i+g(t)*_-h.height/2)})}else this._labelViews.forEach((t,n)=>{const l=t.getBBox();t.setContrast(null).trans(e-l.width*s+o,i-(a+r[n].pos)-l.height/2)})}this._lineView.visible&&(d?this._lineView.setLine(e+a*p(u),i+a*g(u),e+s*p(u),i+s*g(u)):this._lineView.setVLine(e,i-a,i-s)),this._baseView.visible&&h(this._baseView,a+t.getPos(l,t.getBaseValue()))}}class th extends $l{constructor(t,e){super(t,e),this._yAxisViews=[]}_doMeasure(t,e,i,s,r){const n=e.chart,o=super._doMeasure(t,e,i,s,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,i){const{cx:s,cy:r,rd:n,rdInner:o}=this.model.getPolar(null);t.setPath(o>0?Yi.donut(s,r,n,o):Yi.circle(s,r,n))}_setImage(t,e,i,s){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,i=this.model.setPolar(t,e),{cx:s,cy:r,rd:n,rdInner:o}=i.getPolar(null);this._renderBackground(this._background,t,e),this._setImage(i.image,this._image,t,e),this._layoutInnerText(i,s,r,o),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(s,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(i.chart.yAxis,s,r,n),this._yAxisViews.forEach(t=>{t.layout(i.chart.xAxis,s,r,n)}),[this._guideContainer,this._frontGuideContainer].forEach(t=>{t._views.forEach(t=>t.visible&&t.layout(this.width,this.height,i.getPolar(t.model.axis)))}),this._layoutAnnotations(!1,this,t,e),this._layoutEmptyView(i,t,e)}_prepareInnerText(e){this._innerTextView||(this.add(this._innerTextView=new No(e,"rct-polar-body-inner")),this._innerTextView._text.anchor=t.TextAnchor.MIDDLE)}_layoutInnerText(t,e,i,s){var r;const n=t.innerText;if(!(null===(r=this._innerTextView)||void 0===r?void 0:r.setVis(t.hasInner()&&n.visible)))return;this._innerTextView.setModel(this.doc,n,n.getIconUrl(),null),n.buildSvg(this._innerTextView._text,this._innerTextView._outline,2*s,2*s,t,null),this._innerTextView.layout("center"),this._innerTextView.setContrast(null);const o=this._innerTextView.getBBox();this._innerTextView.trans(e-o.x-o.width/2,i-o.y-o.height/2)}_prepareAxes(t,e,i,s,r){if(this._prepareInnerText(t),!this._xAxisContainer){const e=this._image,i=this._axisBreakContainer;this.insertAfter(this._xAxisLabelContainer=new ee(t,"rct-axis-labels rct-polar-axis-labels rct-polar-x-axis-labels"),i),this.insertAfter(this._yAxisLabelContainer=new ee(t,"rct-axis-labels rct-polar-axis-labels rct-polar-y-axis-labels"),i),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<i.length;){const e=new Jl(t,this._lineContainer,this._xAxisLabelContainer);this._yAxisContainer.add(e),n.push(e)}for(;n.length>i.length;)n.pop().remove();n.forEach((e,n)=>{e.setVis(!0),e.prepare(t,i[n],s,r),e.prepareGuides(t,this._guideContainer,this._frontGuideContainer)}),this._xAxisContainer.setVis(e.checkVisible())&&(this._xAxisView||(this._xAxisView=new Ql(t,this._lineContainer,this._yAxisLabelContainer)),this._xAxisContainer.add(this._xAxisView),this._xAxisView.prepare(t,e,s,r))}}class eh extends Po{constructor(t,e){super(t,e?eh.SUBTITLE_CLASS:eh.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,i,s,r){return this._richText.setFormat(e.options.text),this._richText.build(this._textView,i,s,null,null),mo(this._textView.getBBox())}_doLayout(){this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}eh.TITLE_CLASS="rct-title",eh.SUBTITLE_CLASS="rct-subtitle";class ih extends Jt{constructor(e){super(e,"rct-tooltip-row"),this.add(this._marker=new ne(e,"rct-tooltip-row-marker")),this.add(this._textView=new ue(e,"rct-tooltip-row-text")),this._textView.anchor=t.TextAnchor.START,this.add(this._detailView=new ue(e,"rct-tooltip-row-detail")),this._detailView.anchor=t.TextAnchor.START}layout(t,e,i,s,r){var n;const o=e.options,a=e.getMarkerSize(),l=e.getMarkerGap(),h=Yi.getDrawer(o.listMarkerShape);this._marker.setPath(h(a/2)),this._marker.setFill((null===(n=s.legendColor)||void 0===n?void 0:n.call(s))||""),r[0]?(i.setFormat(r[0]),i.build(this._textView,NaN,NaN,null,e.getTextDomain()),this._textView.transX(a+l)):this._textView.text="",r[1]?(i.setFormat(r[1]),i.build(this._detailView,NaN,NaN,null,e.getTextDomain()),this._detailView.transX(a+l+this._textView.getBBox().width+b(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 sh extends Jt{constructor(e){super(e,"rct-tooltip-list"),this.add(this._headerView=new ue(e)),this._headerView.anchor=t.TextAnchor.START,this.add(this._rowLayer=new ee(e,"")),this.add(this._footerView=new ue(e)),this._footerView.anchor=t.TextAnchor.START,this._rows=new go(this._rowLayer,ih)}layout(t,e,i,s){const r=this._headerView,n=this._footerView,o=b(e.options.listRowGap,4),a=e.getMarkerSize()+e.getMarkerGap();let l=0,h=0;r.setVis(!!s.header)&&(i.setFormat(s.header),i.build(r,NaN,NaN,null,e.getTextDomain()),r.trans(a,l),l+=r.getBBox().height+o),this._rows.prepare(s.items.length).forEach((r,n)=>{r.trans(0,l),r.layout(t,e,i,s.items[n],s.rows[n]),l+=r.getBBox().height+o,h=r._width=y(h,(r.r=r.getBBox()).width)}),n.setVis(!!s.footer)&&(i.setFormat(s.footer),i.build(n,NaN,NaN,null,e.getTextDomain()),n.trans(a,l)),this._rows.forEach(t=>{t.alignDetail(h)})}}class rh extends Jt{constructor(e){super(e,rh.CLASS_NAME),this._list={items:null,header:"",rows:null,footer:""},this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new ne(e,"rct-tooltip-back")),this.add(this._top=new ne(e,"rct-tooltip-top")),this.add(this._textView=new ue(e,"rct-tooltip-text")),this.add(this._listView=new sh(e)),this._back.setAttr("filter","url(#"+Qt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new ve,this.close(!0,!1)}show(t,e,i,s,n,o,a){const l=i.point,h=this._model=t.chart._tooltip,_=h.setTarget(t,l,s&&s.map(t=>t.point));if(!_)return;const c=h.options,d=_.isGroupTooltip();let u,p=this._list;if(d){p.header=p.footer="",p.items=[],p.rows=[];const e=_.getTooltipText(t,l,p);if(0===p.rows.length){if(u=r(e)?e.join(" "):e,!u||!u.trim())return;p.rows=p.items.map(()=>[u,""])}}else{const e=c.text||_.getTooltipText(t,l,null);if(u=r(e)?e.join(" "):e,!u||!u.trim())return}this.setStyleOrClass(h._style);const g=e.contentWidth(),f=e.contentHeight(),x=this._listView,b=this._textView,w=h.getHeaderHeight(),v=h.getTailSize(),S=t.chart.isInverted(),V=t._yAxisObj;let C,A,P,k=V.options.reversed;t instanceof Xs&&t.getBaseValue(V)>i.point.yValue&&(k=!k),d?(x.setVis(!0),b.setVis(!1),x.layout(e.doc(),h,this._richText,this._list),C=x.getBBox()):(x.setVis(!1),b.setVis(!0),this._richText.setFormat(u),this._richText.build(b,NaN,NaN,null,h.getTextDomain()),C=b.getBBox()),A=y(c.minWidth||0,C.width+16),P=y(c.minHeight||0,C.height+12)+w;let L=t.getTooltipHeaderColor(l);null===L&&(L=t._calcedColor,t instanceof Gs?(t.options.legendByPoint||t._colorByPoint())&&(L=l._calcedColor):t._colorByPoint()&&(L=getComputedStyle(i.dom).fill)),this._top.setFill(L);const T=this.isVisible()?300:0,N=c.offset+v,M=a.getFocusPointView().getBounds(),E=e.getBounds();let B,D,O=!1;const R=h.isFollowPointer(t);if(S&&!t.isWidget)B=o-P/2-y(0,m(o-P/2,f-P)),O=R?k?A+N>n:n+A+N>g:k?A+N>M.x-E.x+M.width:M.x-E.x-N>g-A,O&&(k=!k),D=k?"left":"right",this.$_drawTooltip(0,0,A,P,D,B),k?n-=A+N:n+=N,o-=P/2;else{B=n-A/2-y(0,m(n-A/2,g-A));const t=R?o-e.getRootDistance().y:M.y-E.y-e._padding.top,i=R?f-o:E.bottom-M.bottom;if(t>=P+N||i>=P+N){(k?i>=P+N:t>=P+N)?D=k?"bottom":"top":(D=k?"top":"bottom",k=!k),this.$_drawTooltip(0,0,A,P,D,B),n-=A/2,k?o+=N:o-=P+N}else{B=o-P/2-y(0,m(o-P/2,f-P));const t=M.x-E.x;D=g-t>=A+N||t<A+N?"right":"left",this.$_drawTooltip(0,0,A,P,D,B),"right"===D?n+=N:n-=A+N,o-=P/2}}return n=y(0,m(n,g-A)),o=y(0,m(o,f-P)),isNaN(this.tx)||isNaN(this.tx)?(this.trans(y(0,n-20),y(0,o-20)),this.transEx(n,o,T/2,!1)):this.transEx(n,o,T,!1),0===T&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),{x:n,y:o,w:A,h:P}}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:lr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){Wt(this.dom,"opacity",void 0,0,200,()=>{this.setStyle("visibility","hidden")})}$_drawTooltip(t,e,i,s,r,n){const o=this._model,a=o.getTailSize(),l=o.getBorderRadius(),h=o.getHeaderHeight();let _=["M",t+l,e,"L",t+i-l,e,"Q",t+i,e,t+i,e+l,"L",t+i,e+s-l,"Q",t+i,e+s,t+i-l,e+s,"L",t+l,e+s,"Q",t,e+s,t,e+s-l,"L",t,e+l,"Q",t,e,t+l,e];if(a>0)switch(r){case"top":_=_.concat(["M",t+i/2-a/2+n,e+s,"L",t+i/2+n,e+s+a,"L",t+i/2+a/2+n,e+s]);break;case"bottom":_=_.concat(["M",t+i/2-a/2+n,e,"L",t+i/2+n,e-a,"L",t+i/2+a/2+n,e]);break;case"left":_=_.concat(["M",t+i,e+s/2-a/2+n,"L",t+i+a,e+s/2+n,"L",t+i,e+s/2+a/2+n]);break;case"right":_=_.concat(["M",t,e+s/2-a/2+n,"L",t-a,e+s/2+n,"L",t,e+s/2+a/2+n])}const c="bottom"===r,d=c?["M",t,e+s-h,"l",i,0,"l",0,h-l,"q",0,l,-l,l,"l",2*l-i,0,"q",-l,0,-l,-l]:["M",t+l,e,"l",i-2*l,0,"q",l,0,l,l,"l",0,h-l,"l",-i,0,"l",0,l-h,"q",0,-l,l,-l],u=this._listView.visible?this._listView:this._textView,p=u.getBBox();t+=(i-p.width)/2,e+=(s-p.height+(c?-h:h))/2,u.trans(t,e),this._top.setPath(h>0?d:""),this._back.setPath(_)}}rh.CLASS_NAME="rct-tooltip";class nh extends te{constructor(t,e){super(t,e,!0),this.addSvg(this._tooltipView=new rh(t))}_doInitDom(t){super._doInitDom(t),t.style.pointerEvents="none",t.style.overflow="visible"}show(t,e,i,s,r,n){this.setVisibility(!0);const o=this._tooltipView.show(t,this.control,e,i,s,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 oh extends ht{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,i=$t.isHoverAt(e),s=(this._model=t).options;return $t.setBoolData(e,"hoverBack","background"===t.getHoverEffect()),isNaN(s.width)?s.autoWidth?e.style.width="max-content":e.style.width="":e.style.width=F(s.width),isNaN(s.height)?e.style.height="":e.style.height=F(s.height),"custom"===s.hintMode?(s.hint?e.dataset.hint=s.hint:delete e.dataset.hint,delete e.title):(delete e.dataset.hint,e.title=s.hint||""),s.imageUrl?$t.setStyles(this._img,{display:"",width:I(s.imageWidth),height:I(s.imageHeight)}):$t.setStyles(this._img,{display:"none",width:"",height:""}),this.$_setImage(ot?this._hovered:i),this._span.textContent=s.text||"",this}layout(t){const e=this._dom,i=e.style,s=this._model.options,r=s.align,n=s.verticalAlign;i.left=I("left"===r?t.x+(s.offsetX||0):"right"===r?t.x+t.width-e.offsetWidth-(s.offsetX||0):t.x+(t.width-e.offsetWidth)/2+(s.offsetX||0)),i.top=I("top"===n?t.y+(s.offsetY||0):"bottom"===n?t.y+t.height-e.offsetHeight-(s.offsetY||0):t.y+(t.height-e.offsetHeight)/2+(s.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"),i=t.createElement("div");return e.className="rct-html-button",$t.setStyles(e,{position:"absolute",textAlign:"center"}),$t.setStyles(i,{display:ot?"flex":"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),e.appendChild(i),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"}),i.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%"}),i.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 ah extends ko{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new eh(t,!1)),this.add(this.subtitleView=new eh(t,!0))}_doMeasure(t,e,i,s,r){const n=e._title,o=e._subtitle;let a,l=0,h=0,_=0,c=0,d=this.titleView,u=i,p=0,g=0;switch(d.setVis(n.visible)?(a=d.measure(t,n,i,s,r),h=this._hTitle=a.height,l=this._wTitle=a.width):d.setModel(n),(d=this.subtitleView).setVis(o.visible)?(a=d.measure(t,o,i,s,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=y(h,c),u=l+g+_;break;default:p=h+g+c,u=y(u,l+_)}return p>0&&(p+=this.titleView.visible?b(n.options.gap,0):b(o.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.options,o=r&&r.options,a=s&&s.visible?this._wTitle>t.wPlot||"chart"===n.alignBase?t.wChart:t.wPlot:0,l=r&&r.visible?this._wSub>t.wPlot||"chart"===o.alignBase?t.wChart:t.wPlot:0;let h=this._wTitle>t.wPlot||s&&"chart"===n.alignBase?0:t.xPlot,_=this._wSub>t.wPlot||r&&"chart"===o.alignBase?0:t.xPlot;if(a>0&&l>0){const t=(t,e,i)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},c=()=>{const e=y(this._hTitle,this._hSub);g=y(g,g+t(s,e,this._hTitle)),m=y(m,m+t(r,e,this._hSub))},d=(t,e,i)=>{switch(t.options.align){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},u=()=>{if(f=y(f,f+d(s,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":x=f;break;case"right":x=f+this._wTitle-this._wSub;break;default:x=f+(this._wTitle-this._wSub)/2}else x=y(x,x+d(r,l,this._wSub))},p=b(o.titleGap,0);let g=0,f=h,m=0,x=_;switch(n.align){case"left":switch(o.position){case"leftSide":case"left":f=x+this._wSub+p,c();break;case"rightSide":x=f+this._wTitle+p,c();break;case"right":switch(x=f+this._wTitle+p,o.align){case"center":x=y(x,x+(l-this._wTitle-this._wSub)/2);break;case"right":x=y(x,_+l-this._wSub)}c();break;case"top":u(),g=m+this._hSub+p;break;default:u(),m=g+this._hTitle+p}break;case"right":switch(o.position){case"leftSide":f+=a-this._wTitle,x=f-p-this._wSub,c();break;case"left":switch(f+=a-this._wTitle,o.align){case"center":x+=(a-this._wTitle-this._wSub)/2;break;case"right":x=f-p-this._wSub}c();break;case"rightSide":case"right":x+=l-this._wSub,f=x-p-this._wTitle,c();break;case"top":u(),g=m+this._hSub+p;break;default:u(),m=g+this._hTitle+p}break;default:switch(o.position){case"leftSide":f+=(a-this._wTitle)/2,x=f-this._wSub-p,c();break;case"left":switch(f+=(a-this._wTitle)/2,o.align){case"left":break;case"center":x+=(f-x-this._wSub)/2;break;case"right":x=f-this._wSub-p}c();break;case"rightSide":f+=(a-this._wTitle)/2,x=f+this._wTitle+p,c();break;case"right":switch(f+=(a-this._wTitle)/2,o.align){case"left":x=f+this._wTitle+p;break;case"center":x+=f+this._wTitle+p,x+=(l-x-this._wSub)/2;break;case"right":x+=l-p-this._wSub}c();break;case"top":u(),g=m+this._hSub+p;break;default:u(),m=g+this._hTitle+p}}const w=b(n.offset,0),v=b(o.offset,0);0!==w&&(f+="right"===n.align?-w:w,"leftSide"!==o.position&&"rightSide"!==o.position||(x+="right"===n.align?-w:w)),0!==v&&"leftSide"!==o.position&&"rightSide"!==o.position&&(x+="right"===o.align?-v:v),e.resizeByMeasured().layout().trans(f,g),i.resizeByMeasured().layout().trans(x,m)}else if(a>0||l>0){const t=a?s:r,n=a?e:i,o=a||l,c=a?this._wTitle:this._wSub;let d=a?h:_;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":d+=o-c;break;default:d+=(o-c)/2}const u=b(t.options.offset,0);0!==u&&(d+="right"===t.options.align?-u:u),n.trans(d,0)}}}class lh extends ko{_doInitChildren(t){this.add(this._legendView=new Zl(t))}_doMeasure(t,e,i,s,r){const n=e._legend,o=this._legendView.measure(t,n,i,s,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 i=this.width,s=this.height,r=0,n=0;switch(this._pos){case"left":i-=e;break;case"right":i-=e,r+=e;break;case"top":s-=e;break;default:n+=e,s-=e}t.trans(r,n).resize(i,s),t.layout()}}class hh extends ko{constructor(t,e){super(t),this.dir=e,this.views=[],this._gap=0}prepare(t,e,i,s,r,n){const o=this.views;let a;for(o.length;o.length<s.length;)a=e.createAxisView(t),this.add(a),o.push(a);for(;o.length>s.length;)a=o.pop(),a.parent&&a.remove();if(o.forEach((t,e)=>{t.prepare(s[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,i){this.views.forEach((s,r)=>{s.prepareGuides(t,NaN,NaN,e,i)})}checkHeights(t,e,i){return this.views.length>0?this.$_checkHeights(this.views,t,e,i):0}$_checkHeights(t,e,i,s){let r=0;return t&&(t.forEach(t=>{r+=t.checkHeight(e,i,s)}),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,i){return this.views.length>0?this.$_checkWidths(this.views,t,e,i):0}$_checkWidths(t,e,i,s){let r=0;return t&&(t.forEach(t=>{r+=t.checkWidth(e,i,s)}),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const i of this.views)if(null===(e=i._scrollView)||void 0===e?void 0:e.contains(t))return i._scrollView}prepareGridRows(t,e){e.addAll(t,this.views.map(t=>t.model))}clean(){this.views.forEach(t=>t.clean())}_doMeasure(t,e,i,s,r){this._inverted;let n=0,o=0;return[this.views].forEach(e=>{if(e){const a=(this.isX,i),l=(this.isX,s);let h=0,_=0;e.forEach(e=>{if(e.visible){const i=e.measure(t,e.model,a,l,r);e.setAttr("xy",e.model._isX?"x":"y"),h+=i.width,_+=i.height}}),this.isHorz?_+=(e.length-1)*this._gap:h+=(e.length-1)*this._gap,n=y(n,h),o=y(o,_)}}),{width:n,height:o}}_doLayout(t){const e=this.control,i=e.loaded,s=[];let r=this.width,n=this.height,o=0,a=0;t=+t||0,[this.views].forEach(e=>{if(e){let l=0;e.forEach(t=>{if(t.visible){const e=t.checkExtents(i);e&&s.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===_o.TOP?n-l-t.mh:l),l+=t.mh+this._gap):(t.trans(this.dir===_o.RIGHT?l:r-l-t.mw,a),l+=t.mw+this._gap)}}),this.isHorz?o+=r+t:a+=n+t}});const l=s.length>0&&e.chart.body.options.zoomCallback;l&&Promise.resolve().then(()=>{s.forEach(({axis:t,from:e,to:i})=>{l({chart:t.chart.wrapper,series:t.getConnectableSeries().slice(0),from:t instanceof ms?Math.floor(e):e,to:t instanceof ms?Math.floor(i):i})})})}}class _h extends Ao{constructor(e){super(e,"rct-credits"),this.add(this._textView=new ue(e)),this._textView.anchor=t.TextAnchor.START}clicked(t){this.model.options.url&&window.open(this.model.options.url,"new")}_doMeasure(t,e,i,s,r){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.getBBox()}}class ch 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 $l(t,this));for(const e in _o){const i=new hh(t,_o[e]);this._plotContainer.add(i),this._axisSectionMap[_o[e]]=i}ch.pane_class&&this.add(this._paneContainer=new ch.pane_class(t,this)),this.add(this._titleSectionView=new ah(t)),this.add(this._legendSectionView=new lh(t)),this.add(this._frontAnnotationContainer=new ee(t,"rct-front-annotations")),this.add(this._creditView=new _h(t)),this.add(this._navigatorView=new Fl(t)),this.add(this._historyView=new Xl(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,i,s,r){var n,o,a;const l=this._model=e,h=l.isPolar(),_=l._credits,c=l._legend,d=l._navigator;let u,p=i,g=s;if(e._width=i,e._height=s,this._inverted=l.isInverted(),l.isSplitted()?(this._plotContainer.setVis(!1),null===(n=this._paneContainer)||void 0===n||n.setVis(!0),this.$_preparePanes(t,l._split)):(this._plotContainer.setVis(!0),null===(o=this._paneContainer)||void 0===o||o.setVis(!1),this.$_prepareBody(t,h)),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,l,p,g,r),g-=u.height,this._legendSectionView.setVis(c.visible))switch(u=this._legendSectionView.measure(t,l,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,l._split,p,g,1);else{if(this._navigatorView.visible){const t=l._navigator;t._vertical?p-=t.getSize():g-=t.getSize()}h?this.$_measurePolar(t,l,p,g,1):this.$_measurePlot(t,l,p,g,1)}if(this._navigatorView.visible){const e=h?this._polarView:this._bodyView;l._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],i,s,r)})}layout(){var t;const e=this.width,i=this.height;let s=e,r=i;const n=this._model,o=n.isPolar(),a=n._legend,l=this._creditView,h=n._credits,_=h.options,c=+_.gap||0,d=this._bodyView._depthExt;let u=0,p=0,g=0,f=0,m=0,y=0,x=0,b=0;l.visible&&(l.resizeByMeasured(),h.isFloating()||("middle"!==_.verticalAlign?(u=+_.offsetY||0,"top"===_.verticalAlign?r-=g=l.height+u+c:r-=f=l.height+u+c):(p=+_.offsetX||0,"left"===_.align?s-=m=l.width+p+c:s-=y=l.width+p+c)));const w=this._titleSectionView;let v=0;const S=b+g;w.visible&&(w.resizeByMeasured(),r-=v=w.height),x=m,b=i-f;const V=this._navigatorView;let C=0;V.visible&&(V.model._vertical||(V.resize(V.mw,V.model.getThickness()),r-=C=V.mh));const A=this._legendSectionView;let P,k,L=0,T=0;if(A.visible)switch(A.resizeByMeasured().layout(),L=A.height,T=A.width,a._location){case"top":P=v+g,r-=L;break;case"bottom":r-=L,P=b-L,b-=L;break;case"right":s-=T,k=e-T;break;case"left":s-=T,x+=T,k=0}V.visible&&(b-=C,V.layout().transY(b+V.model.getGap()));let N,M=0,E=0;if(null===(t=this._paneContainer)||void 0===t?void 0:t.visible)this._paneContainer.trans(x,S+v).resize(s,r),this._paneContainer.layout(),M=r,E=s,N=this._paneContainer.getRect();else{const t=this._axisSectionMap;let e;o||([_o.LEFT,_o.RIGHT].forEach(i=>{(e=t[i])&&e.visible&&(s-=e.mw)}),[_o.TOP,_o.BOTTOM].forEach(i=>{(e=t[i])&&e.visible&&(r-=e.mh)}),(e=t[_o.LEFT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0),x+=e.mw),(e=t[_o.RIGHT])&&e.visible&&(e.resize(e.mw,r-(d?d.side:0)),e.layout(0)),(e=t[_o.BOTTOM])&&e.visible&&(e.resize(s-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0),b-=e.mh),(e=t[_o.TOP])&&e.visible&&(e.resize(s-(d?d.base:0),e.mh),o||e.transX(x),e.layout(0))),V.visible&&V.layout().transX(x);const i={x:x,y:b};this._plotWidth=s,this._plotHeight=r,o||((e=t[_o.LEFT])&&e.visible&&e.trans(i.x-e.mw,i.y-e.height),(e=t[_o.RIGHT])&&e.visible&&e.trans(i.x+s,i.y-e.height),(e=t[_o.BOTTOM])&&e.visible&&e.trans(i.x,i.y),(e=t[_o.TOP])&&e.visible&&e.trans(i.x,i.y-r-e.height));const n=this._currBody;M=this._plotHeight-0,E=this._plotWidth-0,x=i.x,b=i.y-this._plotHeight,n.resize(E,M),n.trans(x,b),n.layout(),N=n.getRect(),n._seriesViews.forEach(t=>{if(t.needDecoreateLegend()){const e=this._legendSectionView._legendView.legendOfSeries(t.model);e&&t.decoreateLegend(e)}})}if(E+=0,w.visible&&w.layout({xPlot:x,wPlot:E,wChart:e}).trans(0,S),A.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+=E-T-e;break;case"center":x+=(E-T)/2+e;break;default:x+=e}switch(e=+t.offsetY||0,o){case"bottom":b+=M-L-e;break;case"middle":b+=(M-L)/2+e;break;default:b+=e}}else if(isNaN(P)){const e=+t.offsetY||0;if(x=k,"chart"===t.alignBase){switch(o){case"top":b=e;break;case"bottom":b=i-L-e;break;default:b=(i-L)/2+e}b+L>i&&(b=(i-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>i&&(b=(i-L)/2),b<0&&(b=0)}else{const i=+t.offsetX||0;if(b=P,"chart"===t.alignBase)switch(n){case"left":x=i;break;case"right":x=e-T-i;break;default:x=(e-T)/2+i}else switch(n){case"left":x+=i;break;case"right":x=x+s-T-i;break;default:x+=(s-T)/2+i}x+T>e&&(x=(e-T)/2),x<0&&(x=0)}A.trans(x,b)}if(l.visible){let t,s;switch(l.layout(),_.verticalAlign){case"top":s=u;break;case"middle":s=(i-l.height)/2+u;break;default:if(f>0){if(s=i-f+c,A.visible){const t=A.y+L+c;t>s&&(s=t)}}else s=i-l.height-u}switch(_.align){case"left":if(t=p,m>0&&A.visible&&"left"===a._location){const e=A.x+T+c;e>t&&(t=e)}break;case"center":t=(e-l.width)/2+p;break;default:if(y>0){if(t=e-y+c,A.visible&&"right"===a._location){const e=A.x-c-l.width;e<t&&(t=e)}}else t=e-l.width-p}l.trans(t,s)}this.$_layoutHtmlButtons(e,i),this.$_layoutAnnotations(this._inverted,e,i,N),this.hideTooltip()}showTooltip(t,e,i,s,r){var n;const o=this.control,a=this._model.chart._tooltip,l=a.isFollowPointer(t),{x:h,y:_}=e.getTooltipPos?e.getTooltipPos():{x:e.point.xPos,y:e.point.yPos},c=s.getTooltipPos(),d=l?r.x+c.x:h+c.x,u=l?r.y+c.y:_+c.y;a.getNoClip()?(this._htmlTooltipView||(this.control.appendSvg(this._htmlTooltipView=new nh(this.doc,o)),this._htmlTooltip=!0),this._htmlTooltipView.show(t,e,i,d,u,s)):(null===(n=this._htmlTooltipView)||void 0===n||n.setVisibility(!1),this._htmlTooltip=!1,this._tooltipView||this.add(this._tooltipView=new rh(this.doc)),this._tooltipView.show(t,o,e,i,d,u,s))}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,i;this._htmlTooltip?null===(e=this._htmlTooltipView)||void 0===e||e.close(!1,t):null===(i=this._tooltipView)||void 0===i||i.close(!1,t)}forceHideTooltip(){var t,e;this._htmlTooltip?null===(t=this._htmlTooltipView)||void 0===t||t.close(!0,!1):null===(e=this._tooltipView)||void 0===e||e.close(!0,!1)}getSeriesView(t){return this._model.isSplitted()?this._paneContainer.getSeries(t):this._currBody.getSeries(t)}createAxisView(t){return new Io(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 i=this._annotationViews.find(e=>e.dom.contains(t));return i||((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,i){var s,r,n;if(!(null===(s=this._model)||void 0===s?void 0:s.hoverable()))return;const o=i,a=this._model&&this.bodyOf(i),l=null==o?void 0:o.classList,h=(null==l?void 0:l.value)&&(l.contains("rct-contextmenu-item")||l.contains("rct-contextmenu-list"));let _=this._hoverItem;if(this._hoverItem=null,(null===(r=this._model)||void 0===r?void 0:r.isSplitted())&&this._paneContainer.bodies.forEach(t=>{t!==a&&t.clearHover()}),a){const s=a.controlToElement(t,e),r=a.pointerMoved(s,i);if(!this._hoverItem&&this._legendSectionView._legendView.contains(o)){const t=this._hoverItem=this._legendSectionView._legendView.legendByDom(o);if(t){const e=t.legend;at.makeArray(e.getSources(t),!0).forEach(t=>{e.options.seriesHovering&&t instanceof Ds?a.hoverSeries(t):e.options.pointHovering&&t instanceof _s&&a.hoverPoint(t)})}}if(_ instanceof zi&&!(this._hoverItem instanceof zi)&&(a.hoverPoint(null),a.hoverSeries(null)),this.$_handleAnnotationHover(i),!r)return void a.removeFocus();for(const t in this._axisSectionMap)this._axisSectionMap[t].views.forEach(t=>{const e=t.model,i=e.crosshair,n=e._isHorz?a.width:a.height,o=e._isHorz?s.x:s.y,l=r&&i.visible&&!h&&i.flag.visible&&!i.isBar()&&i.getFlag(n,o);if(l){t.showCrosshair(o,l);const r=[];a._seriesViews.forEach(t=>{let i,n=Number.MAX_SAFE_INTEGER;const o=this._model.inverted;t.model._visPoints.forEach(t=>{const r=t.xPos,a=t instanceof Jr&&!o?t.yPos-(t.yPos-t.yLow)/2:t.yPos,l=e._isX?Math.abs(s.x-r):Math.abs(s.y-a);l<n&&(n=l,i=t)}),r.push(i)}),i.moved(o,l,r)}else t.hideCrosshair()})}else(null===(n=this._model)||void 0===n?void 0:n.isSplitted())?this._paneContainer.bodies.forEach(t=>{t.removeFocus()}):this._currBody.removeFocus(),this.$_handleAnnotationHover(i)}pointerLeaved(t,e,i){this.$_clearAnnotationHover()}getAxis(t){for(const e in this._axisSectionMap){const i=this._axisSectionMap[e].views.find(e=>e.model===t);if(i)return i}}getButton(t){return this._currBody.getButton(t)}buttonClicked(t){this._currBody.buttonClicked(t)}getScrollView(t){for(const e in _o){const i=this._axisSectionMap[_o[e]].getScrollView(t);if(i)return i}}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 i,s;e?(this._polarView||(this._polarView=new th(t,this),this._plotContainer.insertChild(this._polarView,this._bodyView)),this._currBody=this._polarView,null===(i=this._bodyView)||void 0===i||i.setVis(!1),this._polarView.setVis(!0)):(null===(s=this._polarView)||void 0===s||s.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(),i=[];e._internalItems().forEach((e,s)=>{let r=this._htmlButtons[s];r||(r=new oh(t),this.control.appendDom(r.dom),this._htmlButtons[s]=r),i.push(r)});for(let t=e.count;t<this._htmlButtons.length;t++)this._htmlButtons[t].destroy();this._htmlButtons=i}$_layoutHtmlButtons(t,e){const i=this.control._padding,s=this._htmlButtons;if(s.length>0){const r={x:0,y:0,width:this.control.width(),height:this.control.height()},n={x:i.left,y:i.top,width:t,height:e},o=this._model._getButtons()._internalItems();s.forEach((t,e)=>{const i=o[e];t.setVisible(i.visible)&&t.setModel(i).layout(i.isChartScope()?n:r)})}}$_prepareAxes(t,e){const i=this._currBody._gridRowContainer,s=this._currBody._guideContainer,r=this._currBody._frontGuideContainer,n=!e.isPolar()&&e._needAxes(),o=this._axisSectionMap;for(const i in o){const a=o[i];n?a.prepare(t,this,e,e.getAxes(i,!0),s,r):a.visible=!1}i.prepare()}$_prepareAxisGuides(t,e){const i=this._currBody._guideContainer,s=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,i,s)}}$_measurePlot(t,e,i,s,r){const n=this._axisSectionMap,o=i,a=s;let l=this._bodyView.checkDepth(e,i,s),h=i-(l?l.base:0),_=s-(l?l.side:0);this._bodyView.prepareGuideContainers(),this.$_prepareHtmlButtons(t),this.$_prepareAxes(t,e),e.layoutAxes(h,_,this._inverted,r),i-=n[_o.LEFT].checkWidths(t,i,s),i-=n[_o.RIGHT].checkWidths(t,i,s),s-=n[_o.BOTTOM].checkHeights(t,i,s),s-=n[_o.TOP].checkHeights(t,i,s),l=this._bodyView.checkDepth(e,i,s),h=i-(l?l.base:0),_=s-(l?l.side:0),e.layoutAxes(h,_,this._inverted,r);for(const i in n){const s=n[i];s.visible&&s.measure(t,e,h,_,r)}i=o,s=a;for(const t in n){const e=n[t];e.visible&&(t===_o.LEFT||t===_o.RIGHT?i-=e.mw:t!==_o.BOTTOM&&t!==_o.TOP||(s-=e.mh))}r++,l=this._bodyView.checkDepth(e,i,s),h=i-(l?l.base:0),_=s-(l?l.side:0),e.layoutAxes(h,_,this._inverted,r),this.$_prepareAxisGuides(t,e);for(const i in n){const s=n[i];s.visible&&(s.measure(t,e,h,_,r),s.prepareGridRows(t,this._bodyView._gridRowContainer))}i=o,s=a;for(const t in n){const e=n[t];e.visible&&(t===_o.LEFT||t===_o.RIGHT?i-=e.mw:t!==_o.BOTTOM&&t!==_o.TOP||(s-=e.mh))}l=this._bodyView.checkDepth(e,i,s),h=i-(l?l.base:0),_=s-(l?l.side:0),e.axesLayouted(h,_,this._inverted),this._bodyView.measure(t,e._body,i,s,r)}$_measurePolar(t,e,i,s,r){const n=e._body,o=n.getRadius(i,s),a=n.getInnerRadiusPx(o),l=2*Math.PI*o,h=o-a;this._polarView.prepareGuideContainers(),this.$_prepareAxes(t,e),e.layoutAxes(l,h,!1,r),this.$_prepareAxisGuides(t,e),e.axesLayouted(l,h,!1),this._polarView.measure(t,e._body,i,s,r)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=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)||Sl(t,e);(e.options.front?s:i).add(o),r.set(e,o),n.push(o)})}$_layoutAnnotations(t,e,i,s){const r=this.control._padding;let n,o,a,l;this._annotationViews.forEach(s=>{if("container"===s.model.options.scope)n=-r.left,o=-r.top,a=e+r.left+r.right,l=i+r.top+r.bottom;else n=o=0,a=e,l=i;s._layoutView(t,this,n,o,a,l)})}$_handleAnnotationHover(t){var e,i;if(!t)return;const s=this.htmlButtonByDom(t);if(s!==this._hoverButton)return null===(e=this._hoverButton)||void 0===e||e.pointerLeave(),this._hoverButton=s,void(null===(i=this._hoverButton)||void 0===i||i.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 dh;!function(t){t.EXPORT="$$realchart_export"}(dh||(dh={}));class uh extends Qt{constructor(t,e){super(t,e),this._contextMenuDismissHandler=null,this.addElement(this._chartView=this._createChartView(t)),this.setPointerHandler(this._createPointerHandler()),this._chart=new uo(null,(t,e)=>{this.$_changeModel(t,e)})}_createChartView(t){return new ch(t)}_createPointerHandler(){return new Yl(this)}_doDestroy(){this.$_unbindContextMenuDismiss(),this.setPointerHandler(null),this._chart=null,super._doDestroy()}onModelChanged(t,e,i){e instanceof ze&&i===De.REFRESHED?this._chartView.updateAnnotation(e):this.invalidateLayout()}onVisibleChanged(t,e){this.invalidateLayout()}onPointVisibleChanged(t,e,i){this.invalidateLayout()}onExportRequest(t,e){this._export(e)}onRefreshRequest(t){this.refresh()}get chart(){return this._chart}set chart(t){t instanceof uo&&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 i;null===(i=this._chartView.getAxis(t))||void 0===i||i.scroll(e)}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===dh.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e),this.$_bindContextMenuDismiss()}}_canOverflowRender(){return!1}_doRender(t){var e;const i=this.model,s=i._chartOptions.options,r=this._chartView;if(this.clearTemporaryDefs(),i&&(this.setData("theme",s.theme,!0),this.setData("palette",s.palette),this.setResizeDelay(s.resizeDelay),i._prepareRender(),this._loadModules()),this.loaded||r.clean(),r.setVis(!1!==s.visible)&&(r.measure(this.doc(),i,t.width,t.height,1),r.setRect(t),r.layout(),i&&i.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)}}$_bindContextMenuDismiss(){if(this._contextMenuDismissHandler)return;const t=this.doc();this._contextMenuDismissHandler=t=>{var e,i;const s=null===(e=this.chart)||void 0===e?void 0:e.exporter;if(!(null==s?void 0:s.isCompose())||!s.isContextMenuVisible())return;const r=t.target;(null===(i=null==r?void 0:r.closest)||void 0===i?void 0:i.call(r,".rct-contextmenu-button"))||s.toggleContextMenu()},t.addEventListener("pointerdown",this._contextMenuDismissHandler,!0)}$_unbindContextMenuDismiss(){this._contextMenuDismissHandler&&(this.doc().removeEventListener("pointerdown",this._contextMenuDismissHandler,!0),this._contextMenuDismissHandler=null)}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const i=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(i,t,e._exporter.options)}}}class ph{static getVersion(){return Ft.version}static setLicenseKey(t){Ft.code=t}static setLocale(t,e){e&&L(t,e),(t=>{t&&(k=A[P=t.substring(0,2)]),k||(k=A[P="ko"])})(t)}static registerLocale(t,e){L(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 uh(t,e);return o.chart.load(s(i)?i:{},r,n),o.chart[oo]=o,o.chart}static createData(t,e){return new po(t||{},e)}}class gh{static empty(){return new gh}static create(t=0,e=0){return new gh(t,e)}constructor(t=0,e=0){this.x=t,this.y=e}}class fh{static empty(){return new fh}static create(t=0,e=0){return new fh(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}}const mh=ph.getVersion,yh=ph.setDebugging,xh=ph.setLogging,bh=ph.setAnimatable,wh=ph.configure,vh=ph.createChart,Sh=ph.createData,Vh=ph.setLicenseKey;t.Annotation=ze,t.AnnotationView=Wo,t.ArcElement=Ho,t.AreaRangeSeries=en,t.AreaRangeSeriesView=Fa,t.AreaSeries=Qr,t.AreaSeriesGroup=rn,t.AreaSeriesView=za,t.AssetCollection=Te,t.Axis=_i,t.AxisBaseLine=wr,t.AxisCollection=ci,t.AxisGrid=Qe,t.AxisItem=Xe,t.AxisLabel=oi,t.AxisLine=Ue,t.AxisScrollBar=ai,t.AxisScrollView=Ro,t.AxisSectorLine=hi,t.AxisTick=si,t.AxisTitle=Ze,t.AxisView=Io,t.BarRangeSeries=Mr,t.BarRangeSeriesView=Ha,t.BarSeries=Dr,t.BarSeriesBase=Br,t.BarSeriesGroup=Rr,t.BarSeriesGroupBase=Or,t.BarSeriesPoint=Er,t.BarSeriesView=Wa,t.BarSeriesViewBase=ja,t.BasedSeries=Xs,t.BasedSeriesView=Aa,t.BellCurveSeries=on,t.BellCurveSeriesView=Ya,t.Body=Ii,t.BodyDepth=$i,t.BodyView=$l,t.BoxPlotSeries=ln,t.BoxPlotSeriesView=Ua,t.BoxPointElementEx=wa,t.BubblePie=fn,t.BubbleSeries=mn,t.BubbleSeriesView=qa,t.BulletGaugeGroupType="bulletgroup",t.BulletGaugeType="bullet",t.BumpSeriesGroup=yn,t.CandlestickSeries=bn,t.CandlestickSeriesView=Qa,t.CategoryAxis=ms,t.CategoryAxisGrid=fs,t.CategoryAxisLabel=gs,t.CategoryAxisTick=ps,t.Chart=uo,t.ChartControl=uh,t.ChartData=po,t.ChartDataCollection=ut,t.ChartElement=Ao,t.ChartItem=De,t.ChartObject=co,t.ChartOptions=ho,t.ChartPointerHandler=Yl,t.ChartText=Re,t.ChartView=ch,t.CircelBarPointLabel=wn,t.CircleBarSeries=vn,t.CircleBarSeriesGroup=Sn,t.CircleBarSeriesView=tl,t.CircleElement=zo,t.CircleGaugeGroupType="circlegroup",t.CircleGaugeType="circle",t.CircularGauge=ki,t.CircularGaugeGroup=Li,t.CircularGaugeLabel=Ai,t.ClockGaugeType="clock",t.ClusterableSeries=Ws,t.ClusterableSeriesGroup=Qs,t.Color=Rt,t.ConnectableSeries=Rs,t.ConstraintSeriesGroup=Ks,t.ContentView=Lo,t.ContinuousAxis=vr,t.Credits=ao,t.Crosshair=We,t.DataPoint=_s,t.DataPointCollection=cs,t.DataPointLabel=Ps,t.Dom=$t,t.DumbbellSeries=An,t.DumbbellSeriesView=il,t.ElementPool=go,t.EqualizerSeries=kn,t.EqualizerSeriesView=rl,t.ErrorBarSeries=Ln,t.ErrorBarSeriesView=ol,t.Exporter=Fi,t.FunnelSeries=En,t.FunnelSeriesView=ll,t.Gauge=fi,t.GaugeBase=gi,t.GaugeGroup=mi,t.GaugeGroupView=qo,t.GaugeItem=class extends De{constructor(t){super(t.chart)}},t.GaugeLabel=Ci,t.GaugeRangeBand=Vi,t.GaugeRangeLabel=Si,t.GaugeScale=vi,t.GaugeView=Xo,t.HeatmapSeriesType="heatmap",t.HistogramSeries=On,t.HistogramSeriesView=_l,t.IconedText=$e,t.ImageAnnotation=ur,t.ImageAnnotationView=Ma,t.ImageElement=To,t.LayerElement=ee,t.Legend=Hi,t.LegendItem=zi,t.LegendItemView=Ul,t.LegendView=Zl,t.LineElement=zr,t.LinePointLabel=Yr,t.LineSeries=Zr,t.LineSeriesBase=Xr,t.LineSeriesBaseView=$a,t.LineSeriesGroup=sn,t.LineSeriesPoint=Gr,t.LineSeriesView=Ia,t.LinearAxis=Sr,t.LinearGaugeGroupType="lineargroup",t.LinearGaugeType="linear",t.LogAxis=so,t.LollipopSeries=In,t.LollipopSeriesView=dl,t.LowRangedSeries=Zs,t.MarkerSeries=Js,t.MarkerSeriesPointView=ka,t.MarkerSeriesView=La,t.NavigatorMask=er,t.NavigiatorHandle=tr,t.ORG_ANGLE=E,t.OhlcSeries=zn,t.OhlcSeriesView=pl,t.OthersGroup=Hs,t.PI_2=M,t.PaneContainer=class extends ee{},t.ParetoSeries=Gn,t.ParetoSeriesView=gl,t.PathBuilder=qt,t.PathElement=ne,t.PictogramSeriesType="pictogram",t.PictorialBarSeriesType="pictorialbar",t.PictorialSeriesType="pictorial",t.PieSeries=Zn,t.PieSeriesGroup=qn,t.PieSeriesLabel=Xn,t.PieSeriesText=Yn,t.PieSeriesView=xl,t.Point=gh,t.PointElement=ya,t.PointHovering=lo,t.PointLabelLineContainer=_a,t.PointLabelLineView=ha,t.PointLabelView=aa,t.PointViewPool=Da,t.RAD_DEG=D,t.RaceBarSeriesType="racebar",t.RaceLineSeriesType="raceline",t.RadialSeries=js,t.RangedSeries=Us,t.RcAnimation=Yt,t.RcControl=Qt,t.RcElement=Jt,t.RcObject=ht,t.RectElement=Xi,t.SVGNS=e,t.ScaleView=class extends Ao{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 go(this._tickContainer,zr),this.add(this._labelContainer=new ee(t,"rct-gauge-scale-tick-labels")),this._labels=new go(this._labelContainer,Zo)}},t.ScatterSeries=Qn,t.ScatterSeriesView=wl,t.SectionView=ko,t.SectorElement=hn,t.Series=Ds,t.SeriesAnimation=Ko,t.SeriesGroup=qs,t.SeriesMarker=$s,t.SeriesNavigator=nr,t.SeriesView=ma,t.ShapeAnnotation=pr,t.ShapeAnnotationView=Ea,t.Size=fh,t.SplineSeries=qr,t.StackLabel=ks,t.Subtitle=ar,t.SvgShapes=Yi,t.TextAnnotation=gr,t.TextAnnotationView=Ba,t.TextElement=ue,t.TimeAxis=Tr,t.Title=or,t.Tooltip=lr,t.TreemapSeriesType="treemap",t.TrendLineArea=ys,t.TrendLineLabel=xs,t.Trendline=ws,t.Utils=at,t.ValueGauge=xi,t.ValueGaugeView=class extends Xo{constructor(){super(...arguments),this.valueOf=(t,e,i)=>{const s=t.getParam(e);return l(s)?xt.getFormatter(i||t.label.numberFormat).toStr(s):s},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 Uo(this).start(()=>{t._runValue=NaN,t._prevValue=t.options.value}))}_doValueRateChanged(t){this.model._setValueRate(t),this._renderValue()}},t.VectorSeriesType="vector",t.WaterfallSeries=eo,t.WaterfallSeriesView=vl,t.Widget=di,t.WidgetSeries=Gs,t.WidgetSeriesConnector=Fs,t.WidgetSeriesLabel=zs,t.WidgetSeriesPoint=Is,t.WidgetSeriesView=Na,t.WordCloudSeriesType="wordcloud",t.ZValuePoint=ds,t.absv=x,t.assignObj=c,t.buildValueRanges=tt,t.calcPercent=X,t.configure=wh,t.copyObj=t=>t&&c({},t),t.cos=p,t.createChart=vh,t.createData=Sh,t.createRect=function(t,e,i,s){return{x:t,y:e,width:i,height:s}},t.extend=Me,t.fixnum=R,t.getVersion=mh,t.incv=V,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isIE=ot,t.isNumber=l,t.isObject=s,t.isString=o,t.maxv=y,t.minv=m,t.parsePercentSize=W,t.pickNum=b,t.pickProp=v,t.pickProp3=S,t.pixel=I,t.rectToSize=mo,t.setAnimatable=bh,t.setDebugging=yh,t.setLicenseKey=Vh,t.setLogging=xh,t.sin=g,t.toStr=function(t){return null==t?null:String(t)}});