realmap 1.0.4 → 1.0.5
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/heatmap.js +2 -2
- package/heatmap.mjs +1 -1
- package/index.d.ts +28 -1
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/realmap-export-style.css +2 -0
- package/realmap-export.js +2 -2
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Realmap v1.0.
|
|
3
|
+
* Realmap v1.0.5
|
|
4
4
|
* Copyright (C) 2023-2025 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealMap={})}(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,o=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,c=Math.floor,d=Math.ceil,_=Math.cos,u=Math.sin,p=Math.min,g=Math.max,m=Math.abs,f=function(t){if(t&&"object"==typeof t&&!r(t))return l({},t)},b=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},y=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):e):t},w=function(t,e){return void 0!==t?t:e},x=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},v=(t,e,s)=>t+(e-t)*s;class C{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}C._debugging=!1;class S{static async loadConfigAsync(t,e=!1){if(t&&t.map){if(n(t.map))t.map={url:t.map};else if(r(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const s=r(t.map)?t.map:[t.map];for(const t of s)!i(t.source)&&n(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await fetch(t.url).then((t=>t.json())))}if(t&&t.series){const s=r(t.series)?t.series:[t.series];for(const t of s)!i(t.data)&&!r(t.data)&&n(t.dataUrl)&&t.dataUrl&&(e?console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl):(t.data=await fetch(t.dataUrl).then((t=>t.json())),delete t.dataUrl))}}}const L={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},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",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let A=L.ko;const M=void 0,k="%".charCodeAt(0),P=Math.PI,I=2*P,N=-P/2,T=P/180,V=180/P;function E(t){return t>I?t%I:t}function D(t){return parseFloat(t.toPrecision(12))}function R(t){return t*Math.PI/180}function $(t){return 180*t/Math.PI}function O(t){return t+"px"}function F(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function z(t){return null==t||Number.isNaN(t)||""===t}function j(t){return t<10?"0"+t:String(t)}function H(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const s={};return s[t]=e,s}function Y(t,e){let s,i;if(null==t||Number.isNaN(t)){if(e)return null;i=0,s=!0}else if(!(s=!isNaN(i=+t))){const s=t.trim();if(s.charCodeAt(s.length-1)===k&&(i=1===s.length?NaN:parseFloat(s)),isNaN(i)){if(e)return null;K(A.invalidSizeValue,t)}}return{size:i,fixed:s}}function W(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Z={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"},U=function(t){const e=Z[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Z[t]=e,e}return e};var X;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(X||(X={}));const K=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},q="vertical-lr",J="vertical-rl";function Q(t){const e=String(t).split(/\s+/g),s=b(parseFloat(e[0]),0),i=parseFloat(e[1]),r=parseFloat(e[2]),o=parseFloat(e[3]);return{l:isNaN(o)?isNaN(i)?s:i:o,r:isNaN(i)?s:i,t:s,b:isNaN(r)?s:r}}const tt={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},et=Object.freeze([0,0]);function st(t){return isFinite(t[0]+t[1])}function it(t){let e=1/0,s=1/0,i=-1/0,r=-1/0;for(const o of t){const t=o.map((t=>t[0])),n=o.map((t=>t[1]));e=p(e,...t),s=p(s,...n),i=g(i,...t),r=g(r,...n)}return{h1:e,v1:s,h2:i,v2:r}}const rt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const ot="undefined"!=typeof navigator?navigator.userAgent:"",nt=ot?navigator.appVersion:"",at=!!ot.match(/Trident.*rv\:11\./),ht=-1!==nt.indexOf("MSIE 10"),lt=-1!==nt.indexOf("MSIE 9"),ct=at||ht||lt;class dt{static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}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&&dt.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(p(s,dt.month_days[dt.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(),o=new Date(r,i,1).getDay(),n=new Date(r,i+1,0).getDate(),a=t.getDate()+o-1,h=e+Math.ceil((n+o-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 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 isNum(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 getNum(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNum(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()-rt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=r(t)?[]:{};for(let s of Object.keys(t))e[s]=dt.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(),dt.log(t,+new Date-s+"ms")}static clamp(t,e,s){return g(e,p(s,t))}static clampEx(t,e,s){return isNaN(e)||(t=g(e,t)),isNaN(s)||(t=p(s,t)),t}static makeIntArray(t,e){const s=new Array(g(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}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=m(t);if(i>=1e3){let r=e.length;for(;r>0;){const o=Math.pow(1e3,r--);if(o<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%o==0))return{value:t/o,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const s=(e[0]-t[0])*T,i=(e[1]-t[1])*T,r=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t[0]*T)*Math.cos(e[0]*T)*Math.sin(i/2)*Math.sin(i/2);return 6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)))}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],s=t[0];for(let i=1;i<t.length;i++)e=p(e,t[i]),s=g(s,t[i]);return{min:e,max:s}}}dt.LOGGING=!1,dt.week_days=["일","월","화","수","목","금","토"],dt.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],dt.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]];const _t=Object.freeze({x:0,y:0,width:0,height:0});function ut(t){return{width:t.width,height:t.height}}class pt{static create(t,e,s,i){const r=arguments.length;return dt.isObject(t)?new pt(t.x,t.y,t.width,t.height):r<2?new pt(t,t,t,t):r<3?new pt(t,e,t,e):new pt(t,e,s,i)}constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return function(t){return!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))}(this)}clone(){return new pt(this.x,this.y,this.width,this.height)}getInner(){return new pt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,s,i){return e=void 0!==e?e:t,s=void 0!==s?s:t,i=void 0!==i?i:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),s&&(this.right=this.right+s),i&&(this.bottom=this.bottom+i),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}pt.Empty=new pt,pt.Temp=new pt;const gt={inOutSine:t=>-(_(P*t)-1)/2};class mt{constructor(){this.delay=0,this.duration=mt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=p(1,g(0,D(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}setDuration(t){return this.duration=t,this}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,s=null){this._started&&this._stop(),this.duration=b(t,mt.DURATION),this.delay=e||0,this._easing=gt[s],this._doStart(),this._started=+new Date,this._timer=setTimeout((()=>this._stop()),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}mt.DURATION=700,mt.SHORT_DURATION=300;let ft=0;class bt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(ft++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestory(),this.$_destroyed=!0),null}_doDestory(){}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 yt extends bt{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 wt=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),xt=.001,vt=Math.PI;class Ct{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(...t){let e=0;const s=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s}static lines2(...t){let e=0;const s=["M",t[e].x,t[e].y];for(;e<t.length;e++)s.push("L",t[e].x,t[e].y);return 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,o){return r>0?o>0?(r=p(-i/2,s/2,r),["M",t,e-(o=p(-i/2,s/2,o)),"v",i+o+r,"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r-o,"a",o,o,0,0,1,-o,o,"h",2*o-s,"a",o,o,0,0,1,-o,-o,"Z"]):["M",t,e,"v",i+(r=p(-i/2,s/2,r)),"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r,"Z"]:o>0?["M",t,e-(o=p(-i/2,s/2,o)),"v",i+o,"h",s,"v",-i-o,"a",o,o,0,0,1,-o,o,"h",2*o-s,"a",o,o,0,0,1,-o,-o,"Z"]:["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=p(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 ellipse(t,e,s,i){return this.arc(t+s/2,e+i/2,s/2,i/2,0,2*Math.PI,!0,!0)}static arc(t,e,s,i,r,o,n,a=!1){const h=E(m(o-r)),l=2*vt-h<.01,c=h-vt<.01?0:1,d=n?1:0,p=_(r),g=u(r),f=_(o-=l?d?xt:-.001:0),b=u(o),y=[];return y.push("M",t+s*p,e+i*g,"A",s,i,0,c,d,t+s*f,e+i*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,s,i,r,o,n,a){const h=E(m(n-o)),l=2*vt-h<xt;let c=h-vt<xt?0:1;const d=a?1:0,p=_(o),g=u(o),f=_(n-=l?d?xt:-.001:0),b=u(n),y=s*r,w=i*r,x=[];return x.push("M",t+s*p,e+i*g,"A",s,i,0,c,d,t+s*f,e+i*b),l?x.push("M",t+y*f,e+w*b):x.push("L",t+y*f,e+w*b),isNaN(y)||x.push("A",y,w,0,c,1-d,t+y*p,e+w*g),x.push("Z"),x}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 o=t+s/2,n=e+i/2+(i/2-i/2*u(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,c=i/4,d=2*Math.PI/5,p=d/2,g=[];g.push("M",o+a*_(r),n+h*u(r));for(let t=0;t<5;t++)g.push("L",o+a*_(r),n+h*u(r),"L",o+l*_(r+p),n+c*u(r+p)),r+=d;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Ct[e](0,0,2*s,2*i);break;default:r=Ct.circle(s,i,p(s,i))}t.setPath(r)}static pin(t){const{rd:e,cx:s,cy:i,innerRd:r}=t,o=["M",0,0,"C",0,0,.8*-e,-e,-e,2*-e,"A",e,e,1,1,1,e,2*-e,"C",e,2*-e,.8*e,-e,0,0,"Z"];return r>0&&o.push("M",s-r,i,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),o}}var St;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(St||(St={}));const Lt={name:"RealMap",version:"1.0.4",license:"enterprise",code:""};class At{static decode(t){const e=At.CHARS,s=At.PAD;let i=t.split(""),r=[],o=i.length;for(;i[--o]==s;);for(let t=0;t<o;){let s=e.indexOf(i[t++])<<18;t<=o&&(s|=e.indexOf(i[t++])<<12),t<=o&&(s|=e.indexOf(i[t++])<<6),t<=o&&(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}}At.PAD="=",At.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class Mt{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 o=e.s0[255&t];let n=(o>>16)+(r>>16)+((65535&o)+(65535&r)>>16)<<16|(65535&o)+(65535&r)&65535;return n=(n>>16^i>>16)<<16|65535&(65535&n^65535&i),(n>>16)+(s>>16)+((65535&n)+(65535&s)>>16)<<16|(65535&n)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=Mt.xor,i=Mt.union;let r=t.left,o=t.right;r=s(r,e.p[0]),o=s(o,s(i(r,e),e.p[1])),r=s(r,s(i(o,e),e.p[2])),o=s(o,s(i(r,e),e.p[3])),r=s(r,s(i(o,e),e.p[4])),o=s(o,s(i(r,e),e.p[5])),r=s(r,s(i(o,e),e.p[6])),o=s(o,s(i(r,e),e.p[7])),r=s(r,s(i(o,e),e.p[8])),o=s(o,s(i(r,e),e.p[9])),r=s(r,s(i(o,e),e.p[10])),o=s(o,s(i(r,e),e.p[11])),r=s(r,s(i(o,e),e.p[12])),o=s(o,s(i(r,e),e.p[13])),r=s(r,s(i(o,e),e.p[14])),o=s(o,s(i(r,e),e.p[15])),r=s(r,s(i(o,e),e.p[16])),t.right=r,t.left=s(o,e.p[17])}static _decryptBlock(t,e){const s=Mt.xor,i=Mt.union;let r=t.left,o=t.right;r=s(r,e.p[17]),o=s(o,s(i(r,e),e.p[16])),r=s(r,s(i(o,e),e.p[15])),o=s(o,s(i(r,e),e.p[14])),r=s(r,s(i(o,e),e.p[13])),o=s(o,s(i(r,e),e.p[12])),r=s(r,s(i(o,e),e.p[11])),o=s(o,s(i(r,e),e.p[10])),r=s(r,s(i(o,e),e.p[9])),o=s(o,s(i(r,e),e.p[8])),r=s(r,s(i(o,e),e.p[7])),o=s(o,s(i(r,e),e.p[6])),r=s(r,s(i(o,e),e.p[5])),o=s(o,s(i(r,e),e.p[4])),r=s(r,s(i(o,e),e.p[3])),o=s(o,s(i(r,e),e.p[2])),r=s(r,s(i(o,e),e.p[1])),t.right=r,t.left=s(o,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const s=Mt.kb,i=Mt._encryptBlock;let r,o,n,a=0,h=0,l={left:0,right:0};const c={p:s.p.slice(0).map((function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*Mt.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,n=c.p.length;r<n;)i(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(o=0,n=c["s"+r].length;o<n;)i(l,c),c["s"+r][o++]=l.left,c["s"+r][o++]=l.right;return c}static decrypt(t,e){const s=Mt._decryptBlock;let i=Mt._init(e),r=[],o=At.decode(t),n=o.length>>3,a=0,h={left:null,right:null};for(let t=0;t<n;t++){h.left=o[a]*Mt.POW24|o[a+1]*Mt.POW16|o[a+2]*Mt.POW8|o[a+3],h.right=o[a+4]*Mt.POW24|o[a+5]*Mt.POW16|o[a+6]*Mt.POW8|o[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)}}Mt.POW2=Math.pow(2,2),Mt.POW3=Math.pow(2,3),Mt.POW4=Math.pow(2,4),Mt.POW8=Math.pow(2,8),Mt.POW16=Math.pow(2,16),Mt.POW24=Math.pow(2,24),Mt.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 kt{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substring(1),e.substring(e.indexOf(t))==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}const o=r.split(".").length,n=r.indexOf("*");if(o>=2&&o<=4&&n>=2){const t=r.substring(0,n);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},s=Mt.decrypt(t,"dkdl"+this._getLDKey(Mt.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],o=i[1];o&&o.length>0&&(e[r]=o)}return e}}let Pt=651212;class It{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,o=e.documentElement,n=s.pageYOffset||o.scrollTop||r.scrollTop,a=s.pageXOffset||o.scrollLeft||r.scrollLeft,h=o.clientTop||r.clientTop||0,l=o.clientLeft||r.clientLeft||0,c=i.left+a-l,d=i.top+n-h;return{x:Math.round(c),y:Math.round(d)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const o=t.style;o.left=e+"px",o.top=s+"px",o.width=i+"px",o.height=r+"px"}static setBoundsEx(t,e,s,i,r){const o=t.style;!isNaN(e)&&(o.left=e+"px"),!isNaN(s)&&(o.top=s+"px"),!isNaN(e)&&(o.width=i+"px"),!isNaN(e)&&(o.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)It.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static removeStyles(t,e){if(e)for(const s in e)t[s]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,s){if(e!=s){if(s)for(const e in s)t[e]="";return e&&Object.assign(t,e),e}return s}static createElement(t,e,s){const i=t.createElement(e);return s&&Object.assign(i.style,s),i}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,o="none"){const n={},a={};return n[e]=s,a[e]=i,t.animate([n,a],{duration:r,fill:o})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+Pt++}static createBR(t,e){const s=t.createElement("br");return s.className=e,s}static createSpan(t,e){const s=t.createElement("span");return e&&Object.assign(s.style,e),s}static createCheckBox(t,e){const s=t.createElement("input");return s.type="checkbox",e&&Object.assign(s.style,e),s}static createRadio(t,e){const s=t.createElement("input");return s.type="radio",e&&Object.assign(s.style,e),s}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 getPaddingEx(t){const e=this.getPadding(t);return e.horz=e.left+e.right,e.vert=e.top+e.bottom,e}static stopAnimation(t){if(t)try{t.finish()}catch(t){C.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}}const Nt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Tt extends bt{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._invalidElements=[],this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._windowResized()},this._clickHandler=t=>{var e;this._doClick(t),null===(e=this._tool)||void 0===e||e.click(t)},this._dblClickHandler=t=>{var e;this._doDblClick(t),null===(e=this._tool)||void 0===e||e.dblClick(t)},this._touchStartHandler=t=>{var e;this._doTouchStart(t),null===(e=this._tool)||void 0===e||e.touchStart(t)},this._touchMoveHandler=t=>{var e;t.touches.length<2&&this._scrolling?t.preventDefault():(this._doTouchMove(t),null===(e=this._tool)||void 0===e||e.touchMove(t))},this._touchEndHandler=t=>{var e;this._doTouchEnd(t),null===(e=this._tool)||void 0===e||e.touchEnd(t)},this._pointerDownHandler=t=>{var e;this._doPointerDown(t)||null===(e=this._tool)||void 0===e||e.pointerDown(t)},this._pointerMoveHandler=t=>{var e;this._doPointerMove(t),null===(e=this._tool)||void 0===e||e.pointerMove(t)},this._pointerUpHandler=t=>{var e;this._doPointerUp(t),null===(e=this._tool)||void 0===e||e.pointerUp(t)},this._pointerCancelHandler=t=>{var e;this._doPointerCancel(t),null===(e=this._tool)||void 0===e||e.pointerCancel(t)},this._pointerLeaveHandler=t=>{var e;this._doPointerLeave(t),null===(e=this._tool)||void 0===e||e.pointerLeave(t)},this._keyPressHandler=t=>{var e;this._doKeyPress(t),null===(e=this._tool)||void 0===e||e.keyPress(t)},this._wheelHandler=t=>{var e;this._doWheel(t),null===(e=this._tool)||void 0===e||e.wheel(t)},function(){const t=location.hostname;let e;try{if(e=realMapLic,!e)return!1}catch(t){return!1}const s=kt.decrypt(e);if("RealMap"!=s.name||"RealMap"!==Lt.name)return!1;const i=s.server.toLowerCase(),r=location.pathname.toLowerCase();if(Lt.license!=St.Developer&&!kt.includedDomains(i,t.toLowerCase(),r))return!1;const o=s.lic.toLowerCase();if(!Object.values(St).includes(o))return!1;if(Lt.code=s.code,Lt.license=s.lic,o==St.Evaluation||o==St.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)return!1}return!0}()?(!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||Tt.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)):console.error("need license!")}_doDestory(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),It.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}activeTool(){return this._activeTool||this._tool}setSctiveTool(t){t!==this._activeTool&&(this._activeTool=t,this._tool=t||this._defaultTool)}clearDefs(){It.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(Vt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(Vt.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}removeElement(t){this._root.removeChild(t)}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){return this.clip(new Bt(this.doc(),t,e,s,i,r,r))}clip(t){return this._defs.appendChild(t.dom),t}_setTesting(){this._testing=!0,Vt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchstart",this._touchStartHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"touchend",this._touchEndHandler),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)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof HTMLDivElement||K(A.invalidOuterDiv,s);const r=this._container.ownerDocument,o=this._dom=r.createElement("div");Object.assign(o.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),o.className=i,this._container.appendChild(o);const n=this._svg=r.createElementNS(e,"svg");n.classList.add("rm-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",n.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),n.appendChild(h),o.appendChild(n),this._root=new Dt(this),n.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),o.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),o.appendChild(this._debugger),Object.assign(this._debugger.style,{position:"absolute",left:"0px",top:"0px",fontSize:"20px",background:"black",color:"white"}),this._defaultTool=this._tool=this._creatDefaultTool()}_initDefs(t,s){let i=t.createElementNS(e,"filter");const r=t.createElementNS(e,"feDropShadow");i.setAttribute("id",Tt.SHADOW_FILTER),r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("flood-color","#000"),r.setAttribute("flood-opacity","0.75"),r.setAttribute("stdDeviation","1.5"),i.appendChild(r),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(this.orphaned)return;const t=+new Date;if(t<=this._toAnimation)this.$_requestRender();else{try{this._doBeforeRender(this._root);const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._padding=It.getPadding(this._root.dom),i=s.left,r=s.top,o=this._svg.clientWidth-i-s.right,n=this._svg.clientHeight-r-s.bottom;this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:i,y:r,width:o,height:n});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=i+(o-t.width)/2+"px",a.style.top=r+(n-t.height)/2+"px"}else a.style.display="none"}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._invalidElements=[],this._doAfterRender()}dt.log("render in "+(+new Date-t)+"ms.")}}_setBackgroundStyle(t){Object.assign(this._dom.style,t)}setDebug(t){this._debugger.textContent=t,this.invalidateLayout()}_doBeforeRender(t){}_doAfterRender(){}_doClick(t){}_doDblClick(t){}_doTouchStart(t){}_doTouchMove(t){return!0}_doTouchEnd(t){}_doPointerDown(t){return!1}_doPointerMove(t){}_doPointerUp(t){}_doPointerCancel(t){}_doPointerLeave(t){}_doKeyPress(t){}_doWheel(t){}_windowResized(){this.invalidateLayout()}}Tt.CLASS_NAME="rm-control",Tt.SHADOW_FILTER="rm-shadow-filter";class Vt extends bt{static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,s,i){for(;e.length<s;){const s=i();t.add(s),e.push(s)}}static fit(t,e,s,i,r,o){for(;s.length>i;)s.pop().remove();for(;s.length<i;){const i=new r(t,o);e.add(i),s.push(i)}}constructor(t,s,i=M){super(),this._visible=!0,this._zIndex=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",s),this._doInitStyles()}_doInitStyles(){}_doDestory(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVisible(t)}setVisible(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}containsDom(t){return this._dom.contains(t)}addDom(t){return this._dom.appendChild(t),t}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}addAll(...t){t.forEach((t=>this.add(t)))}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._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}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent&&this._parent.removeChild(this),this}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}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}isValidPathData(t){return"string"==typeof t&&/^[Mm]/.test(t.trim())}getAttr(t){return this.dom.getAttribute(t)}setAttr(t,e){return this.dom.setAttribute(t,e),this}hasAttr(t){return this.dom.hasAttribute(t)}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).resize(s,i),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return pt.create(this._tx,this._ty,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}bbox(){return this._dom.getBBox()}move(t,e){return this.x=t,this.y=e,this}scale(t,e){return isNaN(e)&&(e=t),t===this._scaleX&&t===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=dt.isValidNum(t)?t:this._tx,e=dt.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=dt.isValidNum(t)?t:this._tx,e=dt.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&dt.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&dt.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==M&&(this._dom.setAttribute("style",this._saveStyle),delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(U(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(U(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(U(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let s in t)e.setProperty(U(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")}setClass(t){this._styleName=t,this._resetClass()}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}_setBackgroundBorderRadius(t){}setBackStyles(t){const e=this.dom.style;let s=!1;if(t){for(let i in t)if(i in Nt&&this._styles[i]!==t[i]){if("borderRadius"===i)this._setBackgroundBorderRadius(b(parseFloat(t[i]),0)),this._styles[i]=t[i];else if(i in Nt){const s=Nt[i];e[s]=this._styles[s]=t[i]}s=!0}s&&(this._styleDirty=!0)}return s}setStyle(t,e){let s=!1;return t in Nt||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)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let s=!1;return t in Nt&&e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}putStyles(t,e){if(e=e||{},t)for(let s in t)e[s]=t[s];return e}putStyle(t,e,s){return(s=s||{})[t]=e,s}setColor(t){return this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t,this}getFill(){return this._styles.fill}getStroke(){return this._styles.stroke}setFill(t){return this.dom.style.fill=this._styles.fill=t,this}setStroke(t){return this.dom.style.stroke=this._styles.stroke=t,this}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){this.dom.dataset[t]=w(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}hasData(t){return null!=this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});s&&s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",(()=>{this.setVisible(!1)}))}else this.setVisible(!1);return this}ignorePointer(){this._dom.style.pointerEvents="none"}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}setCursor(t){this._dom.style.cursor=t}clipRect(t,e,s,i,r=0){const o=this.control.clipBounds(t,e,s,i,r);return this.$_setClip(o),o}clipPath(t){const e=this.control.clip(new zt(this.doc).setPath(t));return this.$_setClip(e),e}attachClipPath(t){this.setAttr("clip-path",this.createClipId(t))}detachClipPath(){this.unsetAttr("clip-path")}$_setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}createClipId(t){return"url(#"+(t.id||t)+")"}sort(t){t.forEach((t=>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 Vt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(dt.isValidNum(e)||dt.isValidNum(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),dt.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+dt.pick(this._originX,t.getAttribute("x"),0)+" "+dt.pick(this._originY,t.getAttribute("y")||0)+")");const r=dt.getNum(this._scaleX,1),o=dt.getNum(this._scaleY,1);1===r&&1===o||i.push("scale("+r+" "+o+")"),i.length&&this._dom.setAttribute("transform",i.join(" "))}}Vt.TESTING=!1,Vt.DEBUGGING=!1,Vt.ASSET_KEY="_asset_",Vt.TEMP_KEY="_temp_";class Et extends Vt{constructor(t,e=void 0){super(t,e,"g")}}class Dt extends Vt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class Rt extends Vt{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=n(t)?t:null==t?void 0:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class $t extends Vt{constructor(t,e,s=!1){super(t,e,s?"g":"path"),this.group=s}path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Ot extends Vt{constructor(t){super(t,M,"mask");const e=this._id=dt.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Ft extends Vt{constructor(t){super(t,M,"clipPath");const e=this._id=dt.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Bt extends Ft{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,o=0,n=0){super(t);const a=this._rect=new Vt(t,null,"rect");a.setAttr("fill","none"),o>0&&a.setAttr("rx",String(o)),n>0&&a.setAttr("ry",String(n)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class zt extends Ft{constructor(t,e){super(t),this._path=new Rt(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var jt;!function(t){t.SIDO="sido"}(jt||(jt={}));const Ht="shuffle",Gt="random";var Yt;class Wt{constructor(t){this.source=t}hasDef(){return!0}}class Zt extends Wt{_setStops(t,s){const i=t.createElementNS(e,"stop"),o=t.createElementNS(e,"stop"),n=this.source.color,a=B(this.source.opacity)?1:this.source.opacity,h=r(n)?n[0]:n,l=r(n)&&n.length>1?n[1]:"white",c=r(a)?a[0]:a,d=r(a)&&a.length>1?a[1]:a;s.setAttribute("id",this.source.id),i.setAttribute("offset","0"),i.setAttribute("stop-color",h),i.setAttribute("stop-opacity",c),o.setAttribute("offset","1"),o.setAttribute("stop-color",l),o.setAttribute("stop-opacity",d),s.appendChild(i),s.appendChild(o)}}class Ut extends Zt{getElement(t,s){const i=t.createElementNS(e,"linearGradient");let{x1:r,x2:o,y1:n,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),s.dir){case"up":n=1;break;case"right":o=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",n),i.setAttribute("x2",o),i.setAttribute("y2",a),i}}Ut.TYPE="lineargradient";class Xt extends Zt{getElement(t,s){const i=t.createElementNS(e,"radialGradient");return B(s.cx)||i.setAttribute("cx",s.cx),B(s.cy)||i.setAttribute("cy",s.cy),B(s.r)||i.setAttribute("r",s.r),this._setStops(t,i),i}}Xt.TYPE="radialgradient";class Kt extends Wt{getElement(t,s){const r=t.createElementNS(e,"pattern"),o=t.createElementNS(e,"path");let a,h,c,d,_=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+s.pattern>=0){const t=Kt.STOCK[+s.pattern%Kt.STOCK.length];a=t.path,h=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else n(s.pattern)&&(a=s.pattern,c=s.width||s.height||20,d=s.height||s.width||20);r.setAttribute("width",String(c)),r.setAttribute("height",String(d)),o.setAttribute("d",a),h&&l(o.style,h),s.style&&l(o.style,s.style),_&&(o.style.fill="none");let u=s.backgroundStyle;if(n(u)||i(u)){const s=t.createElementNS(e,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(c)),s.setAttribute("height",String(d))}return s.transform&&r.setAttribute("patternTransform",s.transform),r.append(o),r}}Yt=Kt,Kt.TYPE="pattern",Kt.STOCK=[{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",width:10,height:10,style:{strokeWidth:"0.3px",stroke:"#333"}},{path:"M3 2a1 1 0 101 1A1 1 0 003 2M8 6a1 1 0 101 1A1 1 0 008 6",width:10,height:10,fill:!0,style:{fill:"#333"}},{path:"m8 6-.86.86-.86-.86-.48.48.86.86-.86.86.48.48.86-.86.86.86.48-.48-.86-.86.86-.86L8 6zM4 2l-.86.85-.86-.85-.48.48.85.86-.85.86.48.48.86-.86.86.86.48-.48-.86-.86.86-.86L4 2z",width:10,height:10,fill:!0},{path:"M0 5 1 6H0ZM0 0 6 6V5L1 0Z",width:6,height:6,fill:!0},{path:"M4.54 3h.92L5 2.54 4.54 3ZM7.58 3h.85L5.42 0H4.58L1.57 3h.85L5 .42 7.58 3Zm.01-3L10 2.41V1.6L8.4 0H7.59ZM0 1.6v.81L2.41 0H1.6L0 1.6Z",width:10,height:3,fill:!0},{path:"m5.8 11.27-.82-.51-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95Zm0-9.99L4.98.77l-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95ZM.81 6.27 0 5.76l-.8.51.25-.96-.76-.62.98-.04.37-.92.34.89.96.08-.75.63.22.95Zm9.99 0-.82-.51-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95ZM7.51 7.02l-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm-4.99 0-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm4.99-4.99-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm-4.99 0-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm7.49 7.49-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm-9.99 0-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm9.99-9.99-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm-9.99 0-.14.34-.37.02.28.23-.09.36.3-.19.31.19L.23.12l.28-.23-.36-.03-.13-.33Zm4.99 4.99-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33ZM1.5 8.75c0 .14-.11.25-.25.25S1 8.89 1 8.75s.11-.25.25-.25.25.11.25.25m7.49 0c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25M1.5 1.25c0 .14-.11.25-.25.25S1 1.39 1 1.25 1.11 1 1.25 1s.25.11.25.25m7.49 0c0 .14-.11.25-.25.25s-.25-.11-.25-.25S8.6 1 8.74 1s.25.11.25.25M4 3.75c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25m0 2.5c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25m2.5-2.5c0 .14-.11.25-.25.25S6 3.89 6 3.75s.11-.25.25-.25.25.11.25.25m0 2.5c0 .14-.11.25-.25.25S6 6.39 6 6.25 6.11 6 6.25 6s.25.11.25.25",width:10,height:10,fill:!0},{path:"M8.81 0H10V1.21L9.52 1 9.04.72c-.14-.1-.23-.2-.26-.3-.04-.1-.03-.24.02-.4L8.82 0H8.81ZM10 8.8V10H8.81c.03-.1.1-.26.21-.49l.27-.48c.1-.14.2-.22.3-.25l.39.02H10ZM1.22 10H0V8.8c.1.03.27.1.51.22.24.13.41.22.49.27.14.1.22.2.25.3.04.1.03.23-.02.39V10M0 1.21V0H1.23L1.01.5.73.99c-.1.14-.2.22-.3.25L.04 1.22H.01L0 1.21ZM10 6.1259V3.896l-.02.02H9.86l-.55.09c-.16.04-.28.11-.34.19-.07.09-.11.21-.12.38-.01.1 0 .29.03.56.04.27.06.45.09.55.05.16.12.28.2.34.08.07.21.11.38.12l.45-.02ZM0 3.896v2.23l.01-.01.12-.02.55-.09c.16-.04.27-.1.34-.19s.11-.21.12-.38l-.03-.56-.09-.55c-.04-.16-.11-.28-.19-.34-.09-.07-.21-.11-.38-.11L0 3.896Zm5.7855.1243-.5414-.15.02-.01-.5515-.09c-.1705-.01-.3008.02-.391.08-.1003.05-.1705.16-.2306.32l-.1604.54-.0902.55c0 .17.0201.3.0802.39.0797.1088.1921.1893.3209.23l.5415.15.5515.09c.1705 0 .3008-.02.381-.08.0902-.06.1704-.16.2306-.32l.1504-.54.0902-.55c.01-.16-.0201-.29-.0802-.38-.0501-.09-.1604-.17-.3209-.23ZM6.16 0H3.9l.06.27.16.54c.0702.15.1498.26.24.31.0902.05.2195.07.39.05l.55-.1.54-.17c.1504-.07.2599-.15.31-.24.0501-.09.0701-.22.05-.39ZM3.89 10H6.15l-.06-.27-.17-.54c-.0702-.15-.1498-.25-.24-.3-.0903-.06-.2195-.08-.39-.06l-.55.11-.54.16c-.1504.07-.2499.15-.3.24-.0602.09-.0801.22-.06.39l.05.27Z",width:10,height:10,fill:!0}],Kt.SELECT=Object.assign(Yt.STOCK[4],{id:"rm-selected-area-fill",pattern:Yt.STOCK[4].path,transform:"scale(0.5)"});class qt extends Wt{prepare(){const t=this.source;return this._colors=r(t.colors)?t.colors.slice():[],t.mode===Gt?this._index=-1:(t.mode===Ht&&dt.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getElement(t,e){this._colors=r(e.colors)?e.colors:[]}}qt.TYPE="colors";class Jt extends Wt{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}}))}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||Jt.SIZE,height:e.height||e.width||Jt.SIZE})}}Jt.TYPE="images",Jt.SIZE=20;class Qt{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}}register(t,e){this._selectedFill=new Kt(Kt.SELECT);const s=this._selectedFill.getElement(t,this._selectedFill.source);s.setAttribute(Vt.ASSET_KEY,"1"),e.addDef(s),this._items.forEach((s=>{const i=s.getElement(t,s.source);i.setAttribute(Vt.ASSET_KEY,"1"),e.addDef(i)}))}unregister(t){this._items.forEach((e=>{t.removeDef(e.source.id)}))}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=Kt.TYPE:r(t.colors)?e=qt.TYPE:r(t.images)&&(e=Jt.TYPE)),e)switch(e.toLowerCase()){case Ut.TYPE:return new Ut(t);case Xt.TYPE:return new Xt(t);case Kt.TYPE:return new Kt(t);case qt.TYPE:return new qt(t);case Jt.TYPE:return new Jt(t)}}}}const te="0".charCodeAt(0),ee="#".charCodeAt(0),se=",".charCodeAt(0),ie="s".charCodeAt(0),re="a".charCodeAt(0);class oe{static getFormatter(t){let e=oe.Formatters[t];return e||(oe.Formatters[t]=e=new oe(t)),e}static get Default(){return oe.getFormatter(oe.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toStrEx(t,e){this._options.roundingMode=e;const s=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,s}$_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)===te;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===ee;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===te;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===se){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===ie){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===re){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s}}}oe.DEFAULT_FORMAT="",oe.Formatters={};const ne=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],ae=[".","/","-",":"],he="Z".charCodeAt(0),le="z".charCodeAt(0),ce="A".charCodeAt(0),de="a".charCodeAt(0),_e="y".charCodeAt(0),ue="M".charCodeAt(0),pe="m".charCodeAt(0),ge="W".charCodeAt(0),me="w".charCodeAt(0),fe="d".charCodeAt(0),be="H".charCodeAt(0),ye="h".charCodeAt(0),we="S".charCodeAt(0),xe="s".charCodeAt(0);class ve{static getFormatter(t){let e=ve.Formatters[t];return e||(ve.Formatters[t]=e=new ve(t)),e}static get Default(){return ve.getFormatter(A.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||A.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,o=s.length;r<o;r++){var n=s[r],a=n.length;switch(n.charCodeAt(0)){case _e:i+=a>2?t.getFullYear():j(t.getFullYear()%100);break;case ue:i+=a>1?j(t.getMonth()+1):t.getMonth()+1;break;case fe:i+=a>1?j(t.getDate()):t.getDate();break;case ge:i+=a>1?j(dt.weekOfYear(t,e)+1):dt.weekOfMonth(t,e,!0)+1;break;case me:i+=a>1?dt.long_week_days[t.getDay()]:dt.week_days[t.getDay()];break;case be:i+=a>1?j(t.getHours()):t.getHours();break;case ye:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?j(e):e}else i+=a>1?j(t.getHours()):t.getHours();break;case pe:i+=a>1?j(t.getMinutes()):t.getMinutes();break;case xe:i+=a>1?j(t.getSeconds()):t.getSeconds();break;case de:case ce:t.getHours()<12?i+=A.am:i+=A.pm;break;case we:let s=t.getMilliseconds();i+=3==a?H(s):2==a?j(s):s.toString().substring(0,a);break;default:i+=n}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let o=s.charAt(r);if(ae.indexOf(o)>=0)e.push(o),r++;else{let n=r++;for(;r<i&&s.charAt(r)==o;)r++;if(o=s.substring(n,r),ne.indexOf(o)<0){let e=o.charCodeAt(0);(e>=ce&&e<=he||e>=de&&e<=le)&&K(A.invalidDateFormat,t)}e.push(o)}if(r<i&&dt.isWhiteSpace(o=s.charAt(r)))for(e.push(o);r<i&&dt.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||A.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}ve.Formatters={};const Ce=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],Se=["f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","000000","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"];class Le{static create(t){return n(t)?new Le(t):void 0}static isBright(t){return new Le(t).isBright()}static getContrast(t,e,s){return new Le(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Le(null);return i.r=Math.ceil(t.r+(e.r-t.r)*s),i.g=Math.ceil(t.g+(e.g-t.g)*s),i.b=Math.ceil(t.b+(e.b-t.b)*s),i.a=t.a+(e.a-t.a)*s,i}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(dt.startsWith(t,"rgb(")&&dt.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(dt.startsWith(t,"rgba(")&&dt.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(dt.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Le.COLORS[t]&&this.$_parseNumber(Le.COLORS[t])}}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 Le(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}}var Ae,Me,ke;Le.COLORS=function(){const t={};for(let e=0;e<Ce.length;e++)t[Ce[e]]=Se[e];return t}(),t.TextAnchor=void 0,(Ae=t.TextAnchor||(t.TextAnchor={})).START="start",Ae.MIDDLE="middle",Ae.END="end",t.TextLayout=void 0,(Me=t.TextLayout||(t.TextLayout={})).TOP="top",Me.MIDDLE="middle",Me.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(ke||(ke={}));class Pe extends Vt{constructor(e,s=M){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","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 svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}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.bbox(),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=i-s.height;break;default:r=Math.ceil(i)}this.setAttr("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=Math.max(0,t),(e=Math.min(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,o=0,n=s.length;do{r=Math.ceil((o+n)/2);i.getSubStringLength(0,r)>t?n=r-1:o=r}while(o<n);for(this.text=s.substring(0,o)+"…";o>0&&this.calcWidth()>t;)this.text=s.substring(0,--o)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Le.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}bbox(){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 Ie="$_TH",Ne="$_TW";class Te{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 o=e.callback(t,s[r+1]);if("number"==typeof o&&!isNaN(o)||"bigint"==typeof o){const t=s[3]?oe.getFormatter(s[3]):e.numberFormatter;t&&(o=t.toStr(o))}else if(o instanceof Date){const t=s[3]?ve.getFormatter(s[3]):e.timeFormatter;t&&(o=t.toStr(o,e.startOfWeek||0))}else null==o&&(o=s[r+2]||"");i=i.replace(s[r],o)}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),o=r.substring(2,r.length-1),n=o.indexOf(";");if(n>0){const t=o.indexOf(";",n+1);t>=n?this._literals.push(r,o.substring(0,n),o.substring(n+1,t),o.substring(t+1)):this._literals.push(r,o.substring(0,n),o.substring(n+1),M),0===this._literals[2].length&&(this._literals[2]=M)}else this._literals.push(r,o,M,M);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class Ve extends Te{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,o=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,o),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],o=e.indexOf(i,r+7);o>0&&o<s&&t.setAttribute("style",e.substring(r+7,o))}}}class Ee extends Ve{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","rm-text-link")}}const De={t:class extends Ve{tag(){return"</t>"}},b:class extends Ve{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-bold")}},i:class extends Ve{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-italic")}},a:Ee};class Re{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 Te).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 De){const e=t.indexOf(">",i+2);if(e>=0){const o="</"+s+">",n=t.indexOf(o,e+1);if(n>=0){const e=t.substring(i,n+o.length);r=(new De[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 $e=/<br.*?>|\r\n|\n/;class Oe{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,s,r,o,n){const a=t.doc,h=b(this.lineHeight,1),l=this._lines,c=l.length,d=[],_=[];t.clearDom(),o=o||t;const u=t.getStyle("writing-mode"),p=u===q||u===J;for(let s=0;s<c;s++){const r=l[s];let u=0,m=0,f=null;for(let[h,l]of r.words.entries()){const d=0===s&&0===h,_=s===c-1&&h===r.words.length-1,b=l.prepareSpan(t.appendElement(a,"tspan"),o,n);if(i(o.options)){const t=o.options,e=d&&t.prefix||"",s=_&&t.suffix||"";b.textContent=e+(b.textContent||"")+s}const y=b.getBBox();if(b[Ne]=y.width,b[Ie]=y.height,p?(u=g(u,b[Ne]),m+=b[Ie]):(u+=b[Ne],m=g(m,b[Ie])),f||(f=b),l instanceof Ee){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(b),t.appendDom(s)}}_.push(f),r[Ie]=m*h,r[Ne]=u*h,d.push(0==s?r[Ne]/2:r[Ne])}if(c>0){let e=l[0];for(let s=1;s<_.length;s++)if(_[s]){let i=0,r=0;if(p?null!=_[s-1]&&(i=Math.floor(e[Ne]-t.getAscent(e[Ne]))+t.getAscent(l[s][Ne])):r=e[Ie]-t.getAscent(e[Ie])+t.getAscent(l[s][Ie]),null==_[0]&&_[s]==_.find((t=>null!=t))){const r=t.insertElement(a,"tspan",_[s]);r.textContent=".",r.style.fill="transparent";const o=r.getBBox();i+=o.width,r[Ne]=o.width,r[Ie]=e[Ie]=o.height,_[0]=r}switch(u){case q:_[s].setAttribute("dx",String(i)),_[s].setAttribute("y","0");break;case J:_[s].setAttribute("dx",String(-i)),_[s].setAttribute("y","0");break;default:_[s].setAttribute("x","0"),_[s].setAttribute("dy",String(r))}e=l[s]}if(p){const e=t.parent.dom.classList.contains("rm-annotation"),s=t.bbox().width,[i]=_,r=i[Ne];if(e)i.setAttribute("dx",String(u===J?s-r/2:r/2));else switch(u){case q:i.setAttribute("x",String((s-r)/-2));break;case J:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][Ie])}}layout(e,s,i,r,o){const n=e.bbox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===q||l===J)switch(a=o.left+(i-o.left-o.right-n.width),s){case"center":e.anchor=t.TextAnchor.MIDDLE,h=o.top+(r-o.top-o.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=n.height-o.bottom;break;default:e.anchor=t.TextAnchor.START,h=o.top}else switch(h=o.top+(r-o.top-o.bottom-n.height)/2,s){case"center":e.anchor=t.TextAnchor.MIDDLE,a=o.left+(i-o.left-o.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=i-o.right;break;default:e.anchor=t.TextAnchor.START,a=o.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=t.split($e);for(let t of s)e.push((new Re).parse(t))}}}let Fe=0;const Be=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},ze=function(t,e){const s=i(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let o=e[t];r(o)?s[t]=o.slice(0):o instanceof Date?s[t]=new Date(o):i(o)?s[t]=ze(s[t],o):s[t]=o}return s};class je extends bt{constructor(t){super(),this.chart=t,Fe++}_init(){const t=this._op=ze({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(t){}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(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)}saveOptions(){const t={visible:this.visible};return this._doSave(t),t}updateOptions(t,e=!0){const s=this,r=this._op;return void 0===t||this._doSetSimple(t)||ze(r,t),this.$_applyOptions(r),i(t)&&function(t){if(s._children)s._children.forEach((e=>t.hasOwnProperty(e)&&s[e].updateOptions(t[e])));else{s._children=[];for(const e in s){const i=s[e];i instanceof je&&(s._children.push(e),t.hasOwnProperty(e)&&i.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,s=!0){if(this[t]instanceof je)this[t]._doSetSimple(e);else{const i=this._op;e!==i[t]&&(i[t]=e,this.$_applyOptions(i),s&&this._optionChanged())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._optionChanged(),this}removeOption(t,e=!0){const i=this._op;if(i.hasOwnProperty(t)){delete i[t];const r=self.constructor.defaults;s.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),e&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=ze({},e.constructor.defaults),e.$_applyOptions(e._op),e._children)e._children.forEach((s=>e._op[s]=t(e[s])));else{e._children=[];for(const s in e){const i=e[s];i instanceof je&&(e._op[s]=t(i))}}return e._op}(this),t&&this._optionChanged(),this}_prepareRender(){this._doPrepareRender(this.chart)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoad(t,e){for(const s in e)if(e.hasOwnProperty(s)){let o=e[s];this._doLoadProp(s,o)||(this[s]instanceof je?t[s]=this[s]._load(o):r(o)?t[s]=o.slice(0):o instanceof Date?t[s]=new Date(o):i(o)?t[s]=Object.assign({},o):t[s]=o)}}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=Y(this[s]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){s.call(t,"visible")&&(this.visible=t.visible),this._style=t.style}_doSave(t){}_doUpdate(t){for(const e in t)if(t.hasOwnProperty(e)){let s=t[e];this._doLoadProp(e,s)||(this[e]instanceof je?this[e].updateOptions(s):r(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):i(s)?this[e]=l({},s):this[e]=s)}}_doPrepareRender(t){}_doAfterRender(){}}je.REFRESHED="refreshed",je.defaults={visible:!0};class He{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 Ge extends je{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?oe.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}isVisible(){return this.visible&&!!this._text}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,o){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,o),e&&this._richTextImpl.build(e,s,i,r,o))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Oe),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,s){if(dt.isValidNum(t)){const i=this._numSymbols&&e&&dt.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this.$_getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}getNumberText(t,e,s,i){let r="";if(dt.isValidNum(t)){const o=this._numSymbols&&e&&dt.scaleNumber(t,this._numSymbols,s);r=this._numberFormatter?o?this._numberFormatter.toStrEx(o.value,i)+o.symbol:this._numberFormatter.toStrEx(t,i):o?o.value+o.symbol:String(t)}return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}Ge.defaults=Be(je.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Ye extends Ge{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof Jt&&(this._images=e)}this._root=this._images?"":this._op.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2);return s instanceof Jt?s.getImage(i):i}return this._root+t}}}Ye.defaults=Be(Ge.defaults,{iconPosition:"default",iconGap:2});class We extends je{constructor(){super(...arguments),this.index=-1}get series(){return this._series}getLocation(){return this._location}isReversed(){return"left"===this._location||"top"===this._location}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=e.location||"bottom",this._series=t.seriesByName(e.series)||this._getFirstSeries(t)}_getFirstSeries(t){return t.firstMapSeries}}We.defaults=Be(je.defaults,{offsetX:0,offsetY:0});class Ze extends He{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t){return n(t)?this._map[t]:this._items[t]}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,s=this._items=[],o=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=>{t.options.name&&(o[t.options.name]=t)})),this.chart.options.colorScale=this._items.map((t=>t.options))}$_loadItem(t,e,s){const i=this._createScale(t);return i._init(),i.index=s,i._load(e),i}}const Ue={};class Xe extends je{static register(...t){t.forEach((t=>{Ue[t.type]=t}))}constructor(t,e){super(t),this.inBody=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this._op;let i,r;return this.inBody&&(s.x1,s.x2,s.y1,s.y2,this._x=this._y=this._w=this._h=NaN),isNaN(i)?i=W(this._widthDim,t):i<0&&(this._x+=i,i=-i),isNaN(r)?r=W(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:i,height:r}}getPosition(t,e,s,i,r,o){let n,a,h;if(isNaN(a=this._x))switch(n=this.getOffset(r,o),a=t,this._op.align){case"center":a+=(s-r)/2+n.x;break;case"right":a+=s-n.x-r;break;default:this._anchorObj?a+=(s-r)/2+n.x:a+=n.x}else n=n||this.getOffset(r,o),a=this._x+n.x;if(isNaN(h=this._y))switch(n=n||this.getOffset(r,o),h=e,this._op.verticalAlign){case"middle":h+=(i-o)/2-n.y;break;case"bottom":h+=i-n.y-o;break;default:h+=n.y}else n=n||this.getOffset(r,o),h=this._y+n.y;return{x:a,y:h}}refresh(){}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}Xe.defaults=Be(je.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Ke extends He{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getAnnotation(t){const e=this._map[t];if(e instanceof Xe)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const s=this.owner.chart,o=this._items=[],n=this._map={};r(t)?t.forEach(((t,i)=>{o.push(this.$_loadItem(s,t,i,e))})):i(t)&&o.push(this.$_loadItem(s,t,0,e)),o.forEach((t=>{t.name&&(n[t.name]=t)})),this.owner.options.annotations=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):void 0}))}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,i);return a._init(),a.index=s,a._load(e),a}}const qe="route";class Je extends Vt{static create(t,e,s,i,r,o,n=0){return new Je(t,e,{x:s,y:i,width:r,height:o,r:n})}constructor(t,e=void 0,s=void 0){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))}}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}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)))}_setBackgroundBorderRadius(t){this.setRadius(t)}}const Qe={FO:[-6.926,61.935],UM:[-161.881,5.874],US:[-100.054,38.95],JP:[137.363,36.254],SC:[55.336,-4.582],IN:[77.712,23.832],FR:[3.636,46.78],FM:[158.082,6.859],CN:[98.592,35.308],SW:[-78.538,15.86],SH:[117.621,15.128],BR:[-52.768,-8.476],EC:[-79.861,-.951],AU:[135.555,-24.588],KI:[-157.184,1.814],PH:[121.006,16.567],MX:[-102.12,23.983],ES:[-1.595,39.591],BU:[-79.893,15.769],MV:[73.421,5.526],SP:[115.707,10.82],GB:[-1.839,52.506],GR:[22.599,36.681],AS:[-170.525,-14.3],DK:[9.427,56.37],GL:[-39.018,75.593],GU:[144.57,13.448],MP:[145.575,15.13],PR:[-66.143,18.122],VI:[-64.657,17.73],CA:[-115.256,59.415],ST:[6.617,.24],TZ:[35.004,-6.367],CV:[-23.58,15.095],DM:[-61.289,15.406],NL:[6.492,53.515],JM:[-77.2,18.063],WS:[-172.316,-13.651],OM:[58.793,22.119],VC:[-61.127,13.19],TR:[32.129,39.009],BD:[91.905,22.233],SB:[159.895,-9.419],LC:[-60.92,13.905],NR:[166.755,-.527],NO:[8.419,60.753],KN:[-62.633,17.288],BH:[50.478,25.994],TO:[-174.925,-21.171],FI:[25.914,62.545],ID:[112.847,-1.004],MU:[57.54,-20.281],SE:[16.306,62.823],TT:[-61.263,10.416],MY:[116.988,5.343],BS:[-77.04,26.457],PA:[-81.679,8.405],PW:[134.398,7.472],TV:[179.008,-8.486],MH:[170.969,7.089],CL:[-71.933,-53.598],TH:[99.453,13.237],GD:[-61.602,12.116],EE:[24.023,58.725],AG:[-61.72,17.057],TW:[120.561,23.799],BB:[-59.506,13.174],IT:[12.07,42.271],MT:[14.39,35.877],PG:[144.268,-6.42],DE:[10.769,52.338],VU:[166.879,-14.948],SG:[103.716,1.336],CY:[32.94,34.876],KM:[43.265,-11.648],FJ:[177.763,-17.844],RU:[116.768,62.184],VA:[12.445,41.859],SM:[12.426,43.899],KZ:[69.685,48.81],AZ:[48.953,40.077],AM:[43.71,40.972],TJ:[70.97,38.844],LS:[28.196,-29.619],UZ:[63.788,41.154],PT:[-7.96,39.503],MA:[-7.418,32.961],CO:[-72.763,3.458],TL:[125.957,-8.667],KH:[106.595,12.595],AR:[-64.544,-31.651],SA:[43.575,24.38],PK:[65.477,27.35],YE:[46.702,14.193],AE:[54.339,23.834],KE:[40.821,-1.765],PE:[-72.624,-12.919],DO:[-70.177,18.918],HT:[-72.184,19.768],AO:[17.848,-13.567],VN:[105.093,9.209],MZ:[38.994,-15.14],CR:[-85.488,10.921],IR:[55.16,32.532],SV:[-88.819,13.763],SL:[-11.852,8.517],GW:[-15.062,11.83],HR:[15.471,44.023],BZ:[-88.588,17.17],ZA:[22.378,-31.062],CD:[23.249,-2.545],KW:[47.417,29.211],IE:[-8.492,53.326],KP:[126.253,39.576],KR:[127.616,36.448],GY:[-60.029,8.028],HN:[-84.851,15.721],MM:[93.663,19.758],GA:[10.77,-1.748],GQ:[10.388,1.604],NI:[-85.521,11.48],UG:[30.384,1.098],MW:[33.379,-11.797],SX:[47.38,9.636],TM:[57.736,39.678],ZM:[24.768,-14.824],NC:[33.685,35.192],MR:[-9.464,19.464],DZ:[4.338,28.318],LT:[22.486,56.241],ET:[39.713,8.248],SD:[30.178,15.394],ER:[37.061,16.638],GH:[-2.632,6.208],SI:[14.998,46.019],GT:[-91.228,14.582],BA:[19.032,43.715],JO:[35.197,30.08],SY:[37.367,34.605],MC:[7.398,43.693],AL:[19.948,41.178],UY:[-54.091,-33.141],CNM:[33.1,35.128],MN:[103.413,46.722],RW:[29.783,-1.991],SO:[44.948,1.869],BO:[-63.791,-17.523],CM:[10.632,5.494],CG:[12.218,-3.09],EH:[-13.634,22.764],RS:[20.629,44.144],ME:[19.218,42.7],BJ:[2.516,9.301],NG:[8.668,10.712],TG:[1.183,7.053],LA:[106.65,16.035],AF:[65.88,33.737],UA:[34.689,48.739],SK:[18.01,48.516],JK:[77.109,35.261],BG:[27.047,42.676],QA:[51.077,25.34],LI:[9.547,47.109],AT:[13.385,47.391],SZ:[31.418,-26.531],HU:[17.899,46.861],RO:[26.522,45.94],LU:[6.078,49.679],AD:[1.593,42.518],CI:[-5.559,7.414],LR:[-7.632,5.393],BN:[114.295,4.607],BE:[4.472,50.722],IQ:[43.218,33.744],GE:[41.618,42.404],GM:[-16.166,13.386],CH:[6.631,46.572],TD:[18.378,13.499],KV:[20.845,42.495],LB:[35.653,33.732],DJ:[42.603,11.707],BI:[29.98,-3.31],SR:[-54.231,5.457],IL:[35.309,32.984],ML:[-2.536,19.441],SN:[-16.115,14.461],GN:[-13.134,9.817],ZW:[31.526,-18.524],PL:[19.318,53.256],MK:[21.667,41.636],PY:[-58.484,-23.396],BY:[27.908,53.75],LV:[21.37,57.167],CZ:[15.531,49.557],BF:[-.457,12.785],NA:[16.205,-21.44],NE:[10.273,17.295],LY:[17.187,27.941],TN:[9.187,36.696],BT:[90.355,27.516],MD:[28.401,47.195],SS:[29.891,7.148],CF:[20.505,6.958],NZ:[169.191,-45.031],CU:[-77.556,21.034],VE:[-67.345,9.318],MG:[46.43,-18.577],IS:[-17.355,64.924],EG:[30.753,25.315],LK:[80.796,6.19],BW:[24.546,-23.267],KG:[74.526,41.489],NP:[84.181,28.118]};class ts{constructor(t,e){}}let es=0;class ss{constructor(t){this.source=t,this.pid=es++,this.visible=!0}setSelected(t){this._selected=t}get lon(){return this.coord[0]}get lat(){return this.coord[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}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):this._readSingle(e),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}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._valuesChanged(this._prev))return this._prev;this._prev=void 0}_valuesChanged(t){return t.id!==this.id}getBaseValue(){return this.getValue()}getParam(t){var e,s;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const s=t.split(/\./g);let i=null!==(e=this[s[0]])&&void 0!==e?e:this.source[s[0]];for(let t=1;t<s.length;t++)i=i[s[t]];return i}return"baseValue"===t?this.getBaseValue():null!==(s=this[t])&&void 0!==s?s:this.source[t]}getCallout(t){const e=this.callout;if(e){const s=[t];for(let t=0;t<e.length;t++)s.push([isNaN(e[t][0])?s[t][0]:e[t][0],isNaN(e[t][1])?s[t][1]:e[t][1]]);return s}const s=this.offset;if(s){const e=[t];for(let t=0;t<s.length;t++)e.push([e[t][0]+(s[t][0]||0),e[t][1]+(s[t][1]||0)]);return e}}_assignTo(t){return l(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,source:this.source})}_readArray(t,e){}_readObject(t,e){var s;if(this.id=w(t._idFielder(e),e.id),this.name=w(t._nameFielder(e),e.name),this.color=w(t._colorFielder(e),e.color),this.className=e.className,r(e.coord))this.coord=e.coord.slice(0,2);else if(n(e.coord)){const t=e.coord.split(/s\+/);this.coord=[+t[0],+t[1]]}else if(isNaN(e.lon)||isNaN(e.lat))if(isNaN(e.x)||isNaN(e.y)){if(t._lonFielder&&t._latFielder){const i=t._lonFielder(e);if(isNaN(i))return;const r=null===(s=t._latFielder)||void 0===s?void 0:s.call(t,e);if(isNaN(r))return;this.coord=[i,r]}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=r(e.callout)&&this.$_parseCallout(e.callout),r(this.callout)||(this.offset=r(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),r(t)&&(e=[],a(t[0])?e.push(t):t.forEach((t=>{if(r(t))e.push(t.slice(0,2));else if(n(t)){const s=t.split(/s\+/);e.push([s[0],s[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){n(t)&&(this.id=t)}}class is{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}get first(){return this._points[0]}get last(){return this._points[this._points.length-1]}isEmpty(){return this._points.length<1}getPoints(){return this._points}get(t){return this._points[t]}pointById(t){return this._points.find((e=>e.id===t))}contains(t){return this._points.indexOf(t)>=0}load(t){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){t<0?(this._points.push(e),e.index=this._points.length-1):(this._points.splice(t,0,e),e.index=t)}add(t){this._points.push(t),t.index=this._points.length-1}remove(t){const e=this._points,s=e.indexOf(t);if(s>=0){e.splice(s,1);for(let t=e.length-1;t>=s;t--)e[t].index=t;return!0}}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let s=0,i=e.length;s<i&&!0!==t(e[s],s);s++);}}const rs="_model_",os="_tag_",ns="disabled",as="rm-legend-item-marker",hs={};class ls extends Ye{constructor(){super(...arguments),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.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}isVisible(){return this.visible||o(this._op.visibleCallback)}getDefaultIconPos(){return"top"}_doSetSimple(t){return o(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}ls.defaults=Be(Ye.defaults,{visible:!0,position:"auto",distance:25});class cs extends je{}cs.defaults=Be(je.defaults,{shape:"circle",radius:2.5});class ds extends je{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new cs(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}ds.defaults=Be(je.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class _s extends mt{constructor(t,e,s){super(),this.series=t,this.point=e,this.callback=s,this.duration=500,this.point._vr=0,this.endHandler=()=>{var t;delete this.point._vr,this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.point),this.series=this.point=this.callback=null}}_doUpdate(t){return this.point._vr=t,this.series._optionChanged(),!0}}class us extends je{static register(...t){t.forEach((t=>{hs[t.type]=t}))}static getPointTooltipParam(t,e,s){return"series"===s?t.displayName():e.getParam(s)}constructor(t){super(t),this.index=-1,this.seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._maxZindex=0,this._points=new is(this)}_doInit(t){this._pointArgs=this._createPointArgs(),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new ds(this))._init()}_createLabel(t){return new ls(t)}getTooltipText(t,e){return this._op.tooltipCallback?(this._getPointCallbackArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs)):this._op.tooltipText}getTooltipParam(t,e,s){return us.getPointTooltipParam(t,e,s)}canHide(){return this!==this.chart.firstMapSeries}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e))}legendColor(){return this._calcedColor}legendLabel(){return this._op.label||this.name}_type(){return this.constructor.type}get name(){return this._name}get pointLabel(){return this._pointLabel}get map(){return this._map}get callout(){return this._callout}displayName(){return this._op.label||this.name||`Series${this.index}`}get data(){return this._data}setData(t){t!==this._data&&(this._data=t,this._dataSourceDirty=!0)}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isDataSeries(){return!0}getDetailed(){return this}needMapScale(){return!1}contains(t){return this._points.contains(t)}initPoints(t){const e=t.map(((t,e)=>this.$_addPoint(t,e)));return this._zindexDirty=this._maxZindex>0,e}getPoint(t){return this._points.get(t)}getPointText(t,e,s){let i;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),null!=i)?i:s}getPointCallbackArgs(t){return this._getPointCallbackArgs(this._pointArgs,t)}getPointStyle(t){if(this._op.styleCallback)return this._op.styleCallback(this._getPointCallbackArgs(this._pointArgs,t))}getPointLabelStyle(t){if(this.pointLabel.options.styleCallback)return this.pointLabel.options.styleCallback(this._getPointCallbackArgs(this._pointArgs,t))}getRangedColor(t){}isPointLabelsVisible(){const t=this.pointLabel.options.zoomLevel;return this._pointLabel.isVisible()&&this.pointLabelCount()>0&&(isNaN(t)||this.chart.body.zoom>=t)}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&!0===e.visible}pointLabelCount(){return 1}getLabeledPoints(){return this._points.getPoints()}getCallout(){return this._callout.visible?this._callout:null}isPointCalloutVisible(){return this._callout.visible&&!this._callout.options.layoutOnly}getLegendSources(t){this._op.visibleInLegend&&t.push(this)}getLabelOff(){return b(this._pointLabel.options.offset,this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}coordOfArea(t){var e,s;return Qe[t]||(null===(s=null===(e=this.chart)||void 0===e?void 0:e.map.areaOf(t))||void 0===s?void 0:s.getCenter())}getCoord(t){return t.coord||this.coordOfArea(t.id)||et}pointById(t){return this._points.pointById(t)}needRemoveAnimation(){return!1}addPoint(t,e=-1,s=500){var i,r,o,n;const a=this.$_addPoint(t,e);return this._points.insert(e,a),this._optionChanged(),this.chart._dataChanged(),s>0&&this instanceof ms?(null===(r=null===(i=a._prev)||void 0===i?void 0:i.ani)||void 0===r||r.stop(),delete a._deleting,a._prev={value:NaN},a._prev.ani=new _s(this,a,(t=>{var e,s;null===(s=(e=this._op).onPointAdded)||void 0===s||s.call(e,this._getPointCallbackArgs(this._pointArgs,t))})).setDuration(s),a._prev.ani.start()):null===(n=(o=this._op).onPointAdded)||void 0===n||n.call(o,this._getPointCallbackArgs(this._pointArgs,a)),a}removePoint(t,e=500){var s,i,r,o;a(t)&&(t=this._points.get(t)),this._points.contains(t)&&(e>0&&this.needRemoveAnimation()?(null===(i=null===(s=t._prev)||void 0===s?void 0:s.ani)||void 0===i||i.stop(),t._deleting=!0,t._prev={value:NaN},t._prev.ani=new _s(this,t,(t=>{var e,s;t._deleting=!1,this._points.remove(t),null===(s=(e=this._op).onPointRemoved)||void 0===s||s.call(e,this._getPointCallbackArgs(this._pointArgs,t))})).setDuration(e),t._prev.ani.start()):(this._points.remove(t),null===(o=(r=this._op).onPointRemoved)||void 0===o||o.call(r,this._getPointCallbackArgs(this._pointArgs,t))),this._optionChanged(),this.chart._dataChanged())}removeFirst(t=500){this.removePoint(this._points.first,t)}removeLast(t=500){this.removePoint(this._points.last,t)}updatePoint(t,e){if(n(t)?t=this._points.pointById(t):a(t)&&(t=this._points[t]),t instanceof ss){let s=t._prev;return delete t._deleting,s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&(this.chart._dataChanged(),this.chart.animatable()&&(s.ani=new _s(this,t),s.ani.start())),this._optionChanged(),!!s}return!1}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){if(this._op.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}show(t=!1,e=!0){this.visible&&!t||(e?this.chart.requestShowSeries(this,!0):this.visible=!0)}hide(t=!0){this.visible&&(t?this.chart.requestShowSeries(this,!1):this.visible=!1)}getCalloutShape(t){return this.callout.anchorPoint.options.shape||"circle"}canSelect(){return!1}select(t){t&&(t.setSelected(!0),this.$_bringToFront(t),this.chart._selectionChanged(this,t))}unselect(t){t.setSelected(!1),this.chart._selectionChanged(this,t)}$_bringToFront(t){t instanceof ss&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0,this._optionChanged(t))}lock(){}unlock(){}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.setData(t.data);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_prepareRender(){if(this._mapChanged&&this._doMapChanged(),this._dataSourceDirty){const t=this._doLoadData(this._data);this.$_loadPoints(t),this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))}else this._optionsDirty?(this._runPoints||(this._runPoints=this._points.getPoints()),this._visPoints=this._runPoints.filter((t=>t.visible))):this._runPoints||(this._visPoints=[],this._runPoints=[]);super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t){const e=this._op,s=e.pointColors;let i,h,l,c=this._runColor=a(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color;o(s)?i=s:r(s)?h=s:n(s)&&(l=this.chart._assets.get(s)),i?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||i(this._getPointCallbackArgs(this._pointArgs,t))||c})):l instanceof qt?(l.prepare(),this._runPoints.forEach(((t,e)=>{t._runColor=t.color||l.getNext()||c}))):h?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||h[e%h.length]||c})):this._runPoints.forEach(((t,e)=>{t._runColor=t.color})),this._preparePointArgs(this._pointArgs)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),isNaN(s._zindex)||(this._maxZindex=Math.max(this._maxZindex,s._zindex)),s}_createFielder(t){return o(t)?e=>t(e):n(t)?e=>e[t]:t=>{}}_createFielders(t){this._idFielder=this._createFielder(t.idField),this._nameFielder=this._createFielder(t.nameField),this._colorFielder=this._createFielder(t.colorField)}_createLegendMarker(t,e){return Je.create(t,as,0,0,e,e,e/2)}_defaultLoadAnimation(){return"grow"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(t instanceof ts);else if(r(t))return t}$_loadPoints(t){var e,s;this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}_createPointArgs(){return{series:this}}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._argsPoint=null,t.series=this,t.count=this._points.count}_calcMinMax(t){let e,s;return t.forEach((t=>{const i=t.getValue();isNaN(i)||(e=isNaN(e)?i:p(i,e),s=isNaN(s)?i:g(i,s))})),{min:e,max:s}}}us.defaults=Be(je.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:"<b>${name}</b><br>${series}:<b> ${value}</b>",loadAnimation:"default",hoverEffect:"default",visibleInLegend:!0});class ps extends He{constructor(){super(...arguments),this._map={},this._visibles=[]}get internalItems(){return this._items}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const s=this.chart;this._items=[],this._map={},r(t)?t.forEach(((t,e)=>{this.$_loadItem(s,t,e)})):i(t)&&this.$_loadItem(s,t,0),s.options.series=this._items.map((t=>t.options))}get(t){return this._items[t]}getSeries(t){return this._map[t]}seriesByType(t){for(const e of this._items)if(e._type()===t)return e}seriesByPoint(t){for(const e of this._items)if(e.contains(t))return e}getLegendSources(){const t=[];return this._items.forEach((e=>e.getLegendSources(t))),t}_prepareRender(t){this._visibles=this._items.map((t=>t.getDetailed())).filter((t=>t.visible)),this._visibles.forEach((e=>e.setOptionsDirty(t)._prepareRender()))}_afterRender(){this._visibles.forEach((t=>t._afterRender()))}insert(t,e){return this.$_loadItem(this.chart,t,e)}add(t){return this.$_loadItem(this.chart,t,this._items.length)}remove(t){let e;if(t instanceof us?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),e.name&&delete this._map[e.name],e}$_loadItem(t,e,s,i){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(i||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const o=new r(t);return o._init(),o.isDataSeries()&&(o.index=s,o.seriesIndex=o.chart._seriesIndex++),o._load(e),this.$_addSeries(o,s)}$_addSeries(t,e){return e>=0?this._items.splice(Math.min(e,this._items.length),0,t):this._items.push(t),t.name&&(this._map[t.name]=t),t}}class gs extends ss{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e)}getValue(){return!isNaN(this._vr)&&this._prev?isNaN(this._prev.value)?this._deleting?v(0,this.value,1-this._vr):v(0,this.value,this._vr):v(this._prev.value,this.value,this._vr):this.value}getBaseValue(){return this.value}}class ms extends us{_createFielders(t){super._createFielders(t),this._valueFielder=this._createFielder(t.valueField||"value"),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}}ms.defaults=Be(us.defaults,{valueField:"value"});class fs extends gs{}class bs extends ms{}bs.defaults=Be(ms.defaults,{});class ys extends gs{getPoints(t,e,s){const i=t.length,r=[];const o=s-e;for(let s=0;s<i;s++){const n=t[s],a=5+s/(i-1)*90,h=10+(isNaN(n)||0==o?80:80*(1-(n-e)/o));r.push(a,h)}return r}getBasePoint(t,e,s){const i=e-t;return 0+(isNaN(s)||0==i?100:100*(1-(s-t)/i))}_readObject(t,e){super._readObject(t,e);const s=this.value;this.values=r(s)?s.slice():isNaN(s)?[]:[s]}}class ws{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return Je.create(t,as,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class xs extends ms{getMinMax(t){let e=NaN,s=NaN;for(const i of t)for(const t of i.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),s=isNaN(s)?t:Math.max(s,t));return{min:e,max:s}}_doApply(t){super._doApply(t),this._categories=this.$_parseCategories(t.categories)}getLegendSources(t){const e=this._op;e.visibleInLegend&&(e.legendByCategory&&this._categories?t.push(...this._categories):t.push(this))}$_parseCategories(t){if(r(t))return t.map((t=>new ws(t.name,t.color)))}}xs.defaults=Be(ms.defaults,{position:"top"});class vs extends ys{}class Cs extends xs{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new je(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const s=dt.getMinMax(t),i=s.base=this._op.baseValue;if(e)s.min=isNaN(i)?e.min:Math.min(e.min,i),s.max=isNaN(i)?e.max:Math.max(e.max,i);else{const t=b(this._minValue,s.min),e=b(this._maxValue,s.max);s.min=isNaN(i)?Math.min(t,s.min):Math.min(t,s.min,i),s.max=isNaN(i)?Math.max(e,s.max):Math.max(e,s.max,i)}return s}_doApply(t){super._doApply(t),this._width=b(+t.width,Cs.DEF_WIDTH),this._height=b(+t.height,Cs.DEF_HEIGHT),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}Cs.DEF_WIDTH=80,Cs.DEF_HEIGHT=50,Cs.defaults=Be(xs.defaults,{width:Cs.DEF_WIDTH,height:Cs.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class Ss extends gs{}class Ls extends ms{_doApply(t){super._doApply(t),this._width=b(+t.width||+t.size||+t.height,Ls.DEF_SIZE),this._height=b(+t.height||+t.size||+t.width,Ls.DEF_SIZE)}}Ls.DEF_SIZE=60,Ls.defaults=Be(ms.defaults,{size:Ls.DEF_SIZE});class As extends Ls{getValueRate(t){return(b(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=+t.minValue,this._maxValue=+t.maxValue}_doPrepareRender(t){let e=b(this._minValue,1/0),s=b(this._maxValue,-1/0);this._runPoints.forEach((t=>{const i=t.getValue();t.isNull||isNaN(i)||(e=p(e,i),s=g(s,i))})),this._min=e,this._max=s}}As.defaults=Be(Ls.defaults,{minValue:10});class Ms extends fs{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}_assignTo(t){super._assignTo(t).value=this.value}}class ks extends ls{}ks.defaults=Be(ls.defaults,{visible:!1});class Ps extends bs{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new ks(this.chart))._init()}get subLabel(){return this._subLabel}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}getSubLabelOff(){return b(this._subLabel.options.offset,0)}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._alignToSurface=t.alignToSurface}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new Ms(t)}_doPrepareRender(t){super._doPrepareRender(t);let e=b(this._minValue,Number.MAX_VALUE),s=b(this._maxValue,Number.MIN_VALUE);this._runPoints.forEach((t=>{const i=t.getValue();t.isNull||isNaN(i)||(e=p(e,i),s=g(s,i))})),this._noSize=(this._vMin=e)===(this._vMax=s)}}Ps.type="bubble",Ps.defaults=Be(bs.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class Is extends je{}Is.defaults=Be(We.defaults,{length:10});class Ns extends Ye{getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Ns.defaults=Be(We.defaults,{offset:4});class Ts extends je{_doInit(t){t.line=(this._line=new Is(this.chart))._init(),t.label=(this._label=new Ns(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Ts.defaults=Be(We.defaults,{});class Vs extends We{_doInit(t){super._doInit(t),t.tick=(this._tick=new Ts(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const s=this._series;if(s instanceof Ps){const{min:i,max:r}=s.getPixelMinMax(p(t,e));this._steps.forEach((t=>{t.rd=s.getRadius(t.value,i,r)}))}return this._steps}_getFirstSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t){this._op,super._doPrepareRender(t),this._steps=this.$_buildSteps()}$_buildSteps(){const t=this._op.steps,e=[];if(r(t)&&t.length>0){const s=this.tick.label;t.forEach((t=>{i(t)?e.push({value:+t.value,label:t.label||s.getText(+t.value),rd:0}):isNaN(t)||e.push({value:+t,label:s.getText(+t),rd:0})}))}return e}}Vs.defaults=Be(We.defaults,{});class Es extends Ze{_createScale(t){return new Vs(t)}}class Ds extends je{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}Ds.MARKER_SIZE=10;class Rs extends je{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isVisible(){return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}getLocation(){return this._location}isInner(){return"body"===this._location}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(this._maxHeightDim,t,t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.maxWidth)!==e._maxWidth&&(e._maxWidth=s,e._maxWidthDim=Y(s,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=Y(t,!0))}(t.maxHeight)}_doPrepareRender(t){super._doPrepareRender(t),this._location=w(this._op.location,"bottom"),this._items=this.chart._getLegendSources().map((t=>new Ds(this,t))),this._op.reversed&&(this._items=this._items.reverse())}}Rs.defaults=Be(je.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",gap:6,itemGap:8,markerVisible:!0,markerSize:Ds.MARKER_SIZE,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0});class $s{constructor(t){this._color1=Le.create(t.minColor),this._color2=Le.create(t.maxColor),this._logger=dt.getLogger(t.logBase)}getColor(t,e,s,i){const r=this._logger;if(r){const i=1-t;t=r(t+i),e=r(e+i),s=r(s+i)}if(this._color1&&this._color2)return Le.interpolate(this._color1,this._color2,(s-t)/(e-t)).toString();return x(this._color2,i,this._color1).brighten(1-(s-t)/(e-t)).toString()}}class Os extends je{_doInit(t){t.label=(this._label=new Ge(this.chart))._init()}get label(){return this._label}getMarkerSize(){return b(this._op.size,7)}}Os.defaults=Be(je.defaults,{size:7});class Fs extends je{}Fs.defaults=Be(je.defaults,{length:6});class Bs extends Ye{getDefaultIconPos(){}}Bs.defaults=Be(Ye.defaults,{});class zs extends je{_doInit(t){t.line=(this._line=new Fs(this.chart))._init(),t.label=(this._label=new Bs(this.chart))._init()}get line(){return this._line}get label(){return this._label}}zs.defaults=Be(je.defaults,{});class js{constructor(t,e,s,i,r){this.from=t,this.to=e,this._color1=s,this._color2=i,this.label=r,this.visible=!0}get color(){return this._color2.toString()}canHide(){return!0}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this.$_createLegendMarker(t,e))}$_createLegendMarker(t,e){const s=+e||Ds.MARKER_SIZE;return Je.create(t,as,0,0,s,s,0)}legendColor(){return this._color2.toString()}legendLabel(){return this.label}constains(t,e){return t>=this.from&&(e?t<=this.to:t<this.to)}getPosition(t,e){if(this.constains(t,e))return(t-this.from)/(this.to-this.from)}getColor(t,e){const s=this._color1,i=this._color2;if(!s)return(i||e).toString();const r=this.from,o=this.to;if(s&&i)return Le.interpolate(s,i,(t-r)/(o-r)).toString();return x(i,e,s).brighten(1-(t-r)/(o-r)).toString()}}class Hs extends je{}const Gs="#fff",Ys="#000";class Ws extends We{_doInit(t){const e=this.chart;t.marker=(this._marker=new Os(e))._init(),t.stepLine=(this._stepLine=new Hs(e))._init(),t.tick=(this._tick=new zs(e))._init()}getColor(t,e,s,i){const r=this._steps;if(r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(s,t===e-1))return r[t].getColor(s,i);return s<=t?r[0]._color1.toString():i.toString()}return this._minColor?(this._logger&&(s=this._logger(s)),Le.interpolate(this._minColor,this._maxColor||i,(s-this._min)/(this._max-this._min)).toString()):i.toString()}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get minColor(){return this._minColor}get maxColor(){return this._maxColor}getRanger(){return this}getLayout(){switch(this._op.layout){case"horizontal":case"vertical":return this._op.layout;default:return"left"===this._location||"right"===this._location?"vertical":"horizontal"}}getBarSize(t,e,s){let i,r;return s?(r=this._barLengthDim?W(this._barLengthDim,e):e,i=b(this._op.barWidth,12)):(i=this._barLengthDim?W(this._barLengthDim,t):t,r=b(this._op.barWidth,12)),{width:i,height:r}}getSplitPoints(t){const e=this._steps,s=this._valueSteps;let i=e?e.length:s?s.length-1:0;const r=[];if(i>1)for(let e=1;e<i;e++)r.push(e/i*t);return r}getPosition(t){const e=this._steps;if(!e){const e=this._logger;return e&&(t=e(t)),(t-this._min)/(this._max-this._min)}for(let s=0,i=e.length;s<i;s++){const r=e[s].getPosition(t,s===i-1);if(!isNaN(r))return(s+r)/i}}getTicks(){const t=this._tick.label,e=this._steps,s=this._valueSteps,i=this._min,r=this._max;let o,n=[];if(e){o=e.length,n.push({pos:e[0].from=b(e[0].from,i)});for(let t=1;t<o;t++)n.push({pos:e[t].from=b(e[t].from,e[t-1].to)});n.push({pos:e[o-1].to=b(e[o-1].to,r)})}else if(s){o=s.length,n.push({pos:s[0]});for(let t=1;t<o-1;t++)n.push({pos:s[t]});n.push({pos:s[o-1]})}else n=[{pos:i},{pos:r}];return o=n.length-1,n.forEach(((e,s)=>{e.label=t.getNumberText(e.pos,!1,!1,0===s?"trunc":s===o?"ceil":void 0)})),n}getSteps(){return this._steps}getValueSteps(){return this._valueSteps}getLegendSources(t){!this._steps||"legend"!==this._op.display&&"both"!==this._op.display||this._steps.forEach((e=>t.push(e)))}_doApply(t){super._doApply(t),this._setDim(t,"barLength"),this._minColor=Le.create(t.minColor||Gs),this._maxColor=Le.create(t.maxColor||Ys),this._colors=this.$_parseColorStops(t.colors)}$_parseColorStops(t){const e=[];if(r(t)){const s=t.length;if(s>1)for(let i=0;i<s;i++)e.push({stop:t[i].stop,color:Le.create(t[i].color)});else 1===s&&e.push({stop:t[0].stop,color:Le.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._maxColor});return(this._minColor&&e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(this._maxColor&&e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._maxColor}),e}_doPrepareRender(t){var e,s;super._doPrepareRender(t);const i=this._op,r=null===(s=null===(e=this._series)||void 0===e?void 0:e.getValueRange)||void 0===s?void 0:s.call(e);this._min=+i.minValue,this._max=+i.maxValue,this._logger=dt.getLogger(i.logBase),r&&(isNaN(this._min)&&(this._min=r.min),isNaN(this._max)&&(this._max=r.max)),this._steps=this.$_buildSteps()}$_parseValue(t,e,s){return n(t)?t.endsWith("%")?e+(s-e)*parseFloat(t)/100:void 0:t}$_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<d(t/e)*e&&(t=d(t/e)*e),D(t)}$_parseColor(t){return t&&t.endsWith("%")?Le.interpolate(this._minColor,this._maxColor,parseFloat(t)/100):Le.create(t)}$_buildSteps(){const t=this._op,e=t.steps,s=[],i=this._max;let o=.6,n=i;if(this._valueSteps=null,r(e)&&e.length>0){let t="0%";e.forEach(((i,r)=>{var a,h;let l=this.$_parseValue(i.from,o,n),c=this.$_parseValue(i.to,o,n);0===r&&isNaN(l)&&(l=o),r===e.length-1&&isNaN(c)&&(c=n);let d=this.$_parseColor(i.fromColor||t),_=this.$_parseColor(t=(null!==(a=i.toColor)&&void 0!==a?a:i.color)||"100%");s.push(new js(l,c,d,_,null!==(h=i.label)&&void 0!==h?h:`${l} - ${c}`))})),this._logger=null}else if(o>=n)s.push(new js(o,n,this._minColor,this._maxColor,`${this._min} - ${this._max}`));else{const e=t.logBase,s=this._logger&&o>=0&&n-o>=e?this._logger:null,r=s?Math.max(0,1-o):0,a=this._valueSteps=[],h=Math.max(1,b(t.stepCount,1));let l=s?s(n-o):n-o;const c=Math.pow(10,Math.floor(Math.log10(l/h))),_=d(l/h/c)*c;if(o=this.$_normalizeMin(s?s(o+r):o+r,_),t.integralSteps){a.push(o);for(let t=1;t<=h;t++)a.push(D(a[t-1]+_))}else{const t=l/h;a.push(o);for(let e=1;e<h;e++)a.push(D(a[e-1]+t));a.push(D(s?s(n):n))}if(this._min=a[0],this._max=a[h],s){for(let t=0;t<=h;t++)a[t]=Math.pow(e,a[t]);a[0]-=r,t.integralSteps||(a[0]=.6,a[h]=i)}}return s.length>1?s:void 0}}Ws.defaults=Be(je.defaults,{display:"scale",minColor:Gs,maxColor:Ys,layout:"auto",barWidth:12,barLength:"40%",gap:8});class Zs extends Ze{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.options.display))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_createScale(t){return new Ws(t)}}class Us extends je{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)}}Us.defaults=Be(je.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Xs extends je{_doSetSimple(t){return dt.isValidNum(t)?(this._op.step=t,!0):super._doSetSimple(t)}}Xs.defaults=Be(je.defaults,{step:10});class Ks extends je{_doInit(t){t.line=(this._line=new Xs(this.chart))._init(),t.lonLine=(this._lonLine=new Xs(this.chart))._init(),t.latLine=(this._latLine=new Xs(this.chart))._init()}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this._fitTo}getStep(t){return b(this._line.options.step,this.$_defaultStep(t))}getLonStep(t){return y(this._lonLine.options.step,this._line.options.step,this.$_defaultStep(t))}getLatStep(t){return y(this._latLine.options.step,this._line.options.step,this.$_defaultStep(t))}_doApply(t){super._doApply(t),this._fitTo=t.fitTo}_doPrepareRender(t){super._doPrepareRender(t)}$_defaultStep(t){return 10}}Ks.defaults=Be(je.defaults,{visible:!1,fitTo:"map"});class qs extends je{}qs.defaults=Be(je.defaults,{visible:!1});class Js extends je{}Js.defaults=Be(je.defaults,{visible:!1});class Qs extends je{_doInit(t){t.line=(this._line=new Js(this.chart))._init(),t.label=(this._label=new Ge(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Qs.defaults=Be(je.defaults,{visible:!1});class ti extends Ye{getDefaultIconPos(){return"left"}}ti.defaults=Be(Ye.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class ei extends je{_doInit(t){t.label=(this._label=new ti(this.chart))._init()}get label(){return this._label}}ei.defaults=Be(je.defaults,{front:!0,zindex:0});class si extends ei{}si.defaults=Be(ei.defaults,{});class ii extends ei{}ii.defaults=Be(ei.defaults,{});class ri extends ei{}ri.defaults=Be(ei.defaults,{});class oi extends je{}oi.defaults=Be(je.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class ni extends je{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new oi(this.chart))._init(),this._args={axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag.options;let s=oe.getFormatter(e.numberFormat).toStr(t);return e.prefix&&(s=e.prefix+s),e.suffix&&(s+=e.suffix),s}moved(t,e,s){}_doSetSimple(t){return o(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}ni.defaults=Be(je.defaults,{visible:!1});class ai extends je{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new qs(this.chart))._init(),this.options.leftLine=(this._leftLine=new qs(this.chart))._init(),this.options.rightLine=(this._rightLine=new qs(this.chart))._init(),this.options.topLine=(this._topLine=new qs(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new qs(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new qs(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new qs(this.chart))._init(),this.options.grid=(this._grid=new Ks(this.chart))._init(),this.options.tick=(this._tick=new Qs(this.chart))._init(),this.options.crosshair=(this._crosshair=new ni(this))._init()}get line(){return this._line}get leftLine(){return this._leftLine}get rightLine(){return this._rightLine}get topLine(){return this._topLine}get bottomLine(){return this._bottomLine}get equatorLine(){return this._equatorLine}get meridianLine(){return this._meridianLine}get grid(){return this._grid}get tick(){return this._tick}get crosshair(){return this._crosshair}get guides(){return this._guides.slice()}_doApply(t){if(super._doApply(t),s.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(r(e)?e:[e]))}}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let s;s="range"===t.type?new ri(this.chart):"line"===t.type?new si(this.chart):"band"===t.type?new ii(this.chart):new si(this.chart),s._init(),s._load(t),e.push(s)}))}}function hi(t,e){const[s,i]=t;let r=!1;for(let t=0,o=e.length-1;t<e.length;o=t++){const[n,a]=e[t],[h,l]=e[o];a>i!=l>i&&s<(h-n)*(i-a)/(l-a)+n&&(r=!r)}return r}function li(t,e){let s=!1;hi(t,e[0])&&(s=!s);for(let i=1;i<e.length;i++)hi(t,e[i])&&(s=!s);return s}ai.defaults=Be(je.defaults,{});class ci{constructor(t,e=4){this.bbox=t,this.capacity=e,this.entries=[],this.children=null,this.divided=!1}subdivide(){const{minLon:t,minLat:e,maxLon:s,maxLat:i}=this.bbox,r=(t+s)/2,o=(e+i)/2,n={minLon:t,minLat:o,maxLon:r,maxLat:i},a={minLon:r,minLat:o,maxLon:s,maxLat:i},h={minLon:t,minLat:e,maxLon:r,maxLat:o},l={minLon:r,minLat:e,maxLon:s,maxLat:o};this.children=[new ci(n,this.capacity),new ci(a,this.capacity),new ci(h,this.capacity),new ci(l,this.capacity)],this.divided=!0}intersects(t,e){return!(t.minLon>e.maxLon||t.maxLon<e.minLon||t.minLat>e.maxLat||t.maxLat<e.minLat)}isContained(t,e){return t.minLon>=e.minLon&&t.maxLon<=e.maxLon&&t.minLat>=e.minLat&&t.maxLat<=e.maxLat}insert(t){if(!this.intersects(t.bbox,this.bbox))return!1;if(this.divided&&this.children){let e=!1;for(const s of this.children)if(this.isContained(t.bbox,s.bbox)&&(e=s.insert(t),e))break;return e||(this.entries.push(t),e=!0),e}return this.entries.length<this.capacity?(this.entries.push(t),!0):(this.subdivide(),this.insert(t))}containsPoint(t,e,s){return t>=s.minLon&&t<=s.maxLon&&e>=s.minLat&&e<=s.maxLat}queryPoint(t,e,s=[]){if(!this.containsPoint(t,e,this.bbox))return s;for(const i of this.entries)this.containsPoint(t,e,i.bbox)&&s.push(i);if(this.divided&&this.children)for(const i of this.children)i.queryPoint(t,e,s);return s}}class di{constructor(t,e){var s;this.worldBBox=t,this.root=new ci(t);for(const t of e)this.root.insert({featureId:t.id,originalFeature:{id:t.id,geometry:{type:t.source.polygon?"Polygon":"MultiPolygon",coordinates:null!==(s=t.source.polygon)&&void 0!==s?s:t.source.polygons}},bbox:{minLon:t.h1,minLat:t.v1,maxLon:t.h2,maxLat:t.v2}})}find(t){const e=this.root.queryPoint(t[0],t[1]).find((e=>function(t,e){if("Polygon"===e.type)return li(t,e.coordinates);if("MultiPolygon"===e.type){for(const s of e.coordinates)if(li(t,s))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const _i="37630",ui={area:"39",children:["39010","39020"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},pi={area:_i,parent:"37",polygons:[1,2],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},gi={area:"",parent:"23,23520",polygons:[[8,9],[6,7]],coord:[125.7,37.5],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},mi={area:"39",children:["39010110","39010120","39010130","39010140","39010310","39010620","39010630","39010640","39010330","39010510","39010520","39010530","39010540","39010550","39010560","39010570","39010580","39010590","39010600","39010610","39010650","39010660","39010670","39010680","39010690","39020110","39020120","39020130","39020310","39020320","39020510","39020520","39020530","39020540","39020550","39020560","39020570","39020580","39020590","39020600","39020610","39020620"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},fi={area:_i,children:["37630110","37630310","37630320"],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},bi={area:"23520",children:["23520330","23520340"],coord:[125.4,37.7],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},yi={area:"AK",coord:[-119,6.4],frame:"0.5 0.5"},wi={area:"HI",coord:[-126,21],frame:"0.5 0.5"},xi={area:"JPN-3502",offset:[20,6],frame:"0.4 0.2",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"};function vi(t,e){const s=t.split(/[\s,]+/g),i=[],r="z"===s[s.length-1]||"Z"===s[s.length-1];r&&s.pop();for(let r=0;r<s.length/2;r++)for(let o=0;o<2;o++){const n=s[2*r+o],a=+n;if(isNaN(a)){const s=n.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<s.length;){const i=s[h++];if("-"===i)r=-1;else if("+"===i)r=1;else if("w"===i)a+=r*(e.h2-e.h1);else if("h"===i)a+=r*(e.v2-e.v1);else if(i.length>0){const s=parseFloat(i);if(isNaN(s))throw new Error("Invalid border expression: "+t);i.endsWith("h")?a+=r*s*(e.v2-e.v1):i.endsWith("w")?a+=r*s*(e.h2-e.h1):a+=r*s}}i.push(a+(0===o?e.h1:e.v1))}else i.push(a+(0===o?e.h1:e.v1))}return r&&i.push("z"),i}class Ci{constructor(t,e){this.id=t,this.props=e}}class Si extends Ci{}class Li extends Si{constructor(t,e,s,i){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(e<=0)r.splice(s,1);else if(1!==e){const t=r[s],o=[];for(let e=0;e<t.length;e++){const s=[];for(let i=0;i<t[e].length;i++)s.push(t[e][i].slice());o.push(s)}r[s]=o,this.$_moveToRate(s,i,1-e)}}$_moveToRate(t,e,s){const i=it(this.polygons[t]),r=it(this.polygons[e]);let o,n,a=0,h=0;if((o=i.h1-r.h2)>0&&(n=r.v1-i.v2,o>n&&(a=-o*s,h=n*s)),0!==a)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][0]+=a;if(0!==h)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][1]+=h}}class Ai extends bt{static createStockInset(t,e){let s;switch(t){case"제주":case"제주도":s=ui;break;case"울릉":case"울릉도":s=pi;break;case"백령":case"백령도":s=gi;break;case"읍면동_제주":case"읍면동_제주도":s=mi;break;case"읍면동_울릉":case"읍면동_울릉도":s=fi;break;case"읍면동_백령":case"읍면동_백령도":s=bi;break;default:switch(t.toLowerCase()){case"alaska":s=yi;break;case"hawaii":s=wi;break;case"okinawa":s=xi}}return s&&e&&(s=Object.assign({},s,e)),s}constructor(t){var e,s,o;super(),this._excludes={};const n=null!==(e=t.source)&&void 0!==e?e:t.map,a=r(t.insets)?t.insets:i(t.insets)?[t.insets]:void 0;this.name=t.name,this.enabled=w(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=i(null==n?void 0:n.meta)?dt.deepClone(n.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(s=this.meta.dummies)||void 0===s?void 0:s.slice(),this.paddings=Q(null!==(o=t.padding)&&void 0!==o?o:"0"),this.useOffset=t.useOffset,this._excludes={},r(t.exclude)&&t.exclude.forEach((t=>this._excludes[t]=1)),this.dummies&&!0!==t.showDummies&&(this.dummies.forEach((t=>{this._excludes[t]=1})),this.dummies=void 0),this.insets={},a&&a.length>0&&a.forEach((t=>{var e,s;t&&null!=t.area&&(this.insets[t.area]={area:t.area,children:t.children,parent:t.parent,polygons:r(t.polygons)?t.polygons.slice():r(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(s=t.offset)||void 0===s?void 0:s.slice(0,2),border:r(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame})})),n&&(this.items=this.$_load(n))}included(t){return!this._excludes[t]}$_load(t){return this._doLoad(t)}}class Mi{constructor(){this._scroll=0,this._offset=[0,0]}get scroll(){return this._scroll}set scroll(t){const e=t%360;this._scroll=e<0?360+e:e,this.second&&(this.second._scroll=this._scroll-360),360===this._scroll&&(this._scroll=0,this.second&&(this.second._scroll=-360))}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this.second&&(this.second._offset=this._offset)}prepareSecond(){return this.second=new this.constructor,this}getClipBounds(){const t=[],e=this.scroll;this.scroll=0;for(let e=-90;e<=90;e+=10)t.push(this.project([-180,e]));for(let e=90;e>=-90;e-=10)t.push(this.project([180,e]));return this.scroll=e,t}backward(t){return t}clip(t){return t}isVisible(t){return!0}getVisible(t){return this.isVisible(t)?this.project(t):null}isClipping(){return!0}}const ki=90,Pi=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Ii extends Mi{constructor(){super(),this._rotation=[0,0],this._r=ki,this.bounds={x1:-90,x2:ki,y1:-90,y2:ki},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get isElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=Pi(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=Pi(t))!==this._rotation[1]?(this._rotation[1]=t,!0):void 0)}getRotation(){return this._rotation.slice(0)}setRotation(t,e){if([this._setRotationX(t),this._setRotationY(e)].some(Boolean))return this._calcBounds(),!0}_calcBounds(){const[t,e]=this._rotation;Pi(-90-t),Pi(90-t),Pi(90+e),Pi(-90+e),this._prevCoord=null}project(t){const[e,s]=this._rotate(t),i=s*T,r=[Math.cos(i)*Math.sin(e*T)*this._r,Math.sin(i)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/ki,s=t[1]/ki,i=Math.sqrt(e*e+s*s),r=Math.asin(i),o=Math.sin(r),n=Math.cos(r),a=[Math.atan2(e*o,i*n)/T,Math.asin(i&&s*o/i)/T];return this._unrotate(a)}clip(t){return t}isVisible(t){return!(this._prevCoord=this.project(t)).outside}getVisible(t){return this.isVisible(t)?this._prevCoord:null}isClipping(){return!1}_rotate(t){const e=this._rotation[0]*T,s=(this._rotation[1]||0)*T,i=Math.cos(s),r=Math.sin(s),o=Math.cos(0),n=Math.sin(0);if(0===e&&0===s)return t.slice(0);const a=t[0]*T+e,h=t[1]*T,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*i+c*r;return[Math.atan2(d*o-u*n,c*i-_*r)/T,Math.asin(u*o+d*n)/T]}_unrotate(t){const e=Math.PI/180,s=180/Math.PI,i=t[0]*e,r=t[1]*e*-1,o=Math.cos(r);let n=Math.cos(i)*o,a=Math.sin(i)*o,h=Math.sin(r);const l=this._rotation[0]*e,c=this._rotation[1]*e,d=Math.cos(l),_=Math.sin(l),u=Math.cos(c),p=Math.sin(c),g={x:u*d*n+_*a-p*d*h,y:-u*_*n+d*a+p*_*h,z:p*n+u*h};return[Math.atan2(g.y,g.x)*s,-Math.asin(g.z)*s]}}function Ni(t,e){const{atan2:s,cos:i,sin:r,sqrt:o}=Math,n=t[1]*T,a=t[0]*T,h=e[1]*T,l=e[0]*T,c=h-n,d=l-a,_=r(c/2)*r(c/2)+i(n)*i(h)*r(d/2)*r(d/2),u=2*s(o(_),o(1-_)),p=6371e3*u,g=Math.round(p/5e5),m=[];if(g>1){const t=1/g;for(let e=t;e<.999;e+=t){const t=r((1-e)*u)/r(u),c=r(e*u)/r(u),d=t*i(n)*i(a)+c*i(h)*i(l),_=t*i(n)*r(a)+c*i(h)*r(l),p=s(t*r(n)+c*r(h),o(d*d+_*_)),g=s(_,d);m.push([g/T,p/T])}}return m}const Ti=Math.min,Vi=Math.max;class Ei extends bt{constructor(t,e){if(super(),this.source=t,this.inset=e,this.visible=!0,this._selected=!1,t){const e=t.props["ctr-lon"],s=t.props["ctr-lat"];isNaN(e)||isNaN(s)||(this.center=[+e,+s])}}setSelected(t){this._selected=t}get path(){return this._path}get selected(){return this._selected}displayText(){return this.name||this.id}getInfo(){return this._info||(this._info={id:this.source.id,props:this.source.props,h1:this.h1,v1:this.v1}),this._info}reset(){this._path=null}$_readBound(t,e){let s=this.h1,i=this.h2,r=this.v1,o=this.v2;t[0].forEach((t=>{s=Ti(s,t[0]+e[0]),i=Vi(i,t[0]+e[0]),r=Ti(r,t[1]+e[1]),o=Vi(o,t[1]+e[1])})),this.h1=s,this.h2=i,this.v1=r,this.v2=o}$_readInset(t,e){if(!t._off){const s=t.coord,i=t.offset;let o=[0,0];r(s)&&s.length>0&&(o[0]=isNaN(s[0])?0:+s[0]-e.h1,o[1]=isNaN(s[1])?0:+s[1]-e.v1),r(i)&&i.length>0&&(o[0]+=b(i[0],0),o[1]+=b(i[1],0)),t._off=o}return t.offset=t._off}$_toPath(t,e,s){const i=t.isGlobe,r=e[0].slice();if(s){for(let t=0;t<r.length;t++)r[t]=r[t].slice(0);r.forEach((t=>{t[0]+=s[0],t[1]+=s[1]}))}let o=this.x1,n=this.x2,a=this.y1,h=this.y2;const l=r.map((e=>{const s=t?t.project(e):e;return s.outside||(o=Ti(o,s[0]),n=Vi(n,s[0]),a=Ti(a,s[1]),h=Vi(h,s[1])),s}));let c;if(this.x1=o,this.x2=n,this.y1=a,this.y2=h,i){let e,s,i=!1;!function(t){let e=t.length-1;for(;e--;)if(Math.max(Math.abs(t[e][0]-t[e+1][0]),Math.abs(t[e][1]-t[e+1][1]))>10){const s=Ni(t[e],t[e+1]);s.length&&t.splice(e+1,0,...s)}}(r),c=[];for(let o=0;o<l.length;o++){const n=r[o],a=l[o];if(a.outside)i=!0;else{if(e||(e=n,r.push(n),l.push(a)),i&&s){Ni(s,n).forEach((e=>c.push(t.project(e))))}c.push(a),s=n,i=!1}}}else c=l;if(c.length>0){return`M ${c[0][0]} ${c[0][1]} L`+c.slice(1).map((t=>t.join(" "))).join(" ")+" Z"}return""}readBounds(t){let e=1/0,s=-1/0,i=1/0,r=-1/0;if(t)for(const o of t)this.source.polygons[o][0].forEach((t=>{e=Ti(e,t[0]),s=Vi(s,t[0]),i=Ti(i,t[1]),r=Vi(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=Ti(e,t[0]),s=Vi(s,t[0]),i=Ti(i,t[1]),r=Vi(r,t[1])}))}));return{h1:e,v1:i,h2:s,v2:r}}readPath(t){if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset;let s,i;if(e)if(this._insetChilds){let t=1/0,i=1/0;this.source.polygons.forEach(((e,s)=>{this._insetChilds.indexOf(s)>=0&&e[0].forEach((e=>{t=Ti(t,e[0]),i=Ti(i,e[1])}))})),s=this.$_readInset(e,{h1:t,v1:i}),this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,et)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,et))):this.$_readBound(this.source.polygon,et),s=this.$_readInset(e,this);else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,et))):this.$_readBound(this.source.polygon,et);s&&(this._insetChilds?(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,et)}))):(this.h1+=s[0],this.h2+=s[0],this.v1+=s[1],this.v2+=s[1])),this.x1=1/0,this.x2=-1/0,this.y1=1/0,this.y2=-1/0,this.source.polygons?(i="",this._insetChilds?this.source.polygons.forEach(((e,r)=>{this._insetChilds.indexOf(r)>=0?i+=this.$_toPath(t,e,s):i+=this.$_toPath(t,e,null)})):this.source.polygons.forEach(((e,r)=>{i+=this.$_toPath(t,e,s)}))):i=this.$_toPath(t,this.source.polygon,s),this._path=i}return this._path}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Ei;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class Di extends bt{constructor(t,e,s){if(super(),this.owner=t,this.source=e,this._hiddens={},!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=s,this._name=e.name,(this._second=e instanceof Di)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new di({minLon:-180,minLat:-90,maxLon:180,maxLat:90},this._areas)}get index(){return this._index}get name(){return this._name}get areaCount(){return this._areas.length}get hiddenAreas(){var t;return null===(t=this._hiddenAreas)||void 0===t?void 0:t.slice()}set hiddenAreas(t){if(t!=this._hiddenAreas){const e=this._hiddens={};this._hiddenAreas=t,r(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const s in this._areaMap){const i=this._areaMap[s];t in i.source.props&&(e[i.source.props[t]]=i)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach((t=>{t.reset()})),this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}isWorldMap(){return this.$_isWorldMap()}$_preflight(){var t;let e=1/0,s=-1/0,i=1/0,r=-1/0;for(let o=0;o<this._areas.length;o++){const n=this._areas[o];n.inset;let{h1:a,h2:h,v1:l,v2:c}=n.readBounds();if(null===(t=n.inset)||void 0===t?void 0:t.coord){const[t,e]=n.inset.coord;h=t+h-a,c=e+c-l,a=t,l=e}if(a<e&&(e=a),h>s&&(s=h),l<i&&(i=l),c>r&&(r=c),-180==e&&180==s&&-90==i&&90==r)return}return{minLat:i,maxLat:r,minLon:e,maxLon:s}}$_isWorldMap(t=this.h1,e=this.h2){return e-t===360}$_resetAreas(){const t=this.owner.getProjection(this._second);if(t instanceof Ii)t.getRotation(),this._areas.forEach((e=>{e.visible=this.isVisible(e.id),e.readPath(t)})),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=ki,this.y2=ki;else{let e=1/0,s=-1/0,i=1/0,r=-1/0,o=1/0,n=-1/0,a=1/0,h=-1/0;if(!this._second&&this._useOffset){const{minLat:e,maxLat:s,minLon:i,maxLon:r}=this.$_preflight();t.offset=!0===this._useOffset?[-(i+(r-i)/2),-(e+(s-e)/2)]:this._useOffset}if(this._areas.forEach((l=>{l.visible=this.isVisible(l.id),l.readPath(t)&&(e=Ti(e,l.h1),s=Vi(s,l.h2),i=Ti(i,l.v1),r=Vi(r,l.v2),o=Ti(o,l.x1),n=Vi(n,l.x2),a=Ti(a,l.y1),h=Vi(h,l.y2))})),this.source instanceof Ai){const t=this.source.paddings;i-=t.b,r+=t.t,e-=t.l,s+=t.r,a-=t.b,h+=t.t,o-=t.l,n+=t.r}this.h1=e,this.v1=i,this.h2=s,this.v2=r,this.x1=o,this.y1=a,this.x2=n,this.y2=h,this.cx=this.x1+(this.x2-this.x1)/2,this.cy=this.y1+(this.y2-this.y1)/2}}$_load(t){var e;const s=t.insets,i=t.idKey,o=null!==(e=t.nameKey)&&void 0!==e?e:"name",n=t.meta.dokdo,h=t.dummies,l=this._areas=[],c=this._areaMap={},d=this._insets=[];this._useOffset=t.useOffset,t.items.forEach((e=>{if(e instanceof Si){const r=w(e.props[i],e.id);if(r&&t.included(r)){const t=new Ei(e,s[r]);delete s[r],h&&h.indexOf(r)>=0?(l.unshift(t),t.dummy=!0):l.push(t),c[t.id=r]=t,t.name=w(e.props[o],e[o])}}}));for(const t in s){const e=s[t];if(e.parent&&(a(e.polygons)||r(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let s=0;s<t.length;s++){const i=c[t[s]];if(i){const o=e.polygons[s];i.inset=e,i._insetChilds=r(o)?o:[o],e._base=i._insetChilds,e.parent=t[s],d.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=r(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,d.push(e))}else if(r(e.children)){const t=e._base=[],s=e.offset?e.offset.slice():[0,0];if(r(e.coord)){let t=1/0,i=1/0;for(const s of e.children){const e=c[s];if(!e)continue;const r=e.readBounds();t=Ti(t,r.h1),i=Ti(i,r.v1)}isNaN(e.coord[0])||(s[0]=e.coord[0]-t),isNaN(e.coord[1])||(s[1]=e.coord[1]-i)}for(const i of e.children){const e=c[i];e&&(e.inset={area:i,offset:s},t.push(e))}d.push(e)}}if(n&&!isNaN(+t.dokdo)){const e=c[n.group];e&&(e.source=new Li(e.source,+t.dokdo,+n.index,+n.parent))}this.reset()}$_copy(t){const e=this._areas=[],s=this._areaMap={};this._useOffset=t._useOffset,t._areas.forEach((t=>{const i=t._clone();e.push(i),s[i.id]=i})),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new Di(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class Ri extends Ye{getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Ri.defaults=Be(We.defaults,{offset:4});class $i extends We{_doInit(t){super._doInit(t),t.label=(this._label=new Ri(this.chart))._init()}get label(){return this._label}_getFirstSeries(t){return t.getFirstSeries("map")}_doApply(t){super._doApply(t)}_doPrepareRender(t){this._op,super._doPrepareRender(t),this._scale=this.$_calcScale()}$_calcScale(){return 10}}$i.defaults=Be(We.defaults,{visible:!1});class Oi extends je{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:Oi.ITEM_GAP}}Oi.ITEM_GAP=4,Oi.defaults=Be(je.defaults,{offsetX:8,offsetY:8,itemGap:3});class Fi extends Oi{get vertical(){return"vertical"===this._op.direction}getButtonSize(){var t,e,s,i;return{width:null!==(e=null!==(t=this._op.buttonWidth)&&void 0!==t?t:this._op.buttonHeight)&&void 0!==e?e:Fi.BUTTON_SIZE,height:null!==(i=null!==(s=this._op.buttonHeight)&&void 0!==s?s:this._op.buttonWidth)&&void 0!==i?i:Fi.BUTTON_SIZE}}getZoomStep(){var t;return null!==(t=this._op.zoomStep)&&void 0!==t?t:20}_isVisible(){return super._isVisible()&&this.chart.body.options.zoomable&&(this.chart.body.isZoomed||this._op.showAlways)}}Fi.BUTTON_SIZE=24,Fi.defaults=Be(Oi.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomStep:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Bi extends Oi{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Bi.defaults=Be(Oi.defaults,{type:"text",align:"left",verticalAlign:"top"});class zi extends bt{constructor(t){super(),this._items=[],this._owner=t}get count(){return this._items.length}get first(){return this._items[0]}get last(){return this._items[this._items.length-1]}get(t){return this._items[t]}contains(t){return this._items.indexOf(t)>=0}clear(){if(this._items.length>0)return this._items.forEach((t=>t.setSelected(!1))),this._items=[],this._owner.selectionCleared(),this._changed(),!0}add(t,e,s=!1){let r;return s&&(r=this.clear()),t&&i(e)&&!this.contains(e)&&(this._items.push(e),t.select(e),this._owner.selectionItemAdded(e),this._changed(),r=!0),r}remove(t,e){const s=this._items.indexOf(e);if(s>=0)return this._items.splice(s,1),t.unselect(e),this._owner.selectionItemRemoved(e),this._changed(),!0}toggle(t,e){return!!this.remove(t,e)||this.add(t,e)}_changed(){this._owner.selectionChanged(this)}}class ji extends je{isVisible(){return this.visible&&!B(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}ji.defaults=Be(je.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Hi extends ji{}Hi.defaults=Be(ji.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Gi extends je{constructor(t){super(t.chart),this.owner=t}_doInit(){this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)}}setTarget(t,e){let s=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(s,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?oe.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?ve.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Gi.defaults=Be(je.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class Yi extends Xe{_isVisible(){return this._op.visible&&!z(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}Yi.type="image",Yi.defaults=Be(Xe.defaults,{});class Wi extends Xe{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||Wi.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Wi.type="shape",Wi.defaults=Be(Xe.defaults,{width:64,height:64,shape:"square"});class Zi extends Xe{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?oe.getFormatter(s):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?ve.getFormatter(t):void 0)}(t.timeFormat)}}Zi.type="text",Zi.defaults=Be(Xe.defaults,{text:"Text"});class Ui extends Mi{project(t){return[t[0]+this.offset[0]-this.scroll,t[1]+this.offset[1]]}backward(t){return[t[0]-this.offset[0],t[1]-this.offset[1]]}}const Xi=1.340264,Ki=-.081106,qi=893e-6,Ji=.003796,Qi=Math.sqrt(3)/2,tr=74.03120656864502;class er extends Mi{get isElliptic(){return!0}project(t){const e=T,s=Math.asin(Qi*Math.sin((t[1]+this.offset[1])*e)),i=s*s,r=i*i*i;return[(t[0]+this.offset[0]-this.scroll)*e*Math.cos(s)*tr/(Qi*(Xi+3*Ki*i+r*(7*qi+9*Ji*i))),s*tr*(Xi+Ki*i+r*(qi+Ji*i))]}backward(t){const e=t[0]/tr,s=t[1]/tr,i=180/Math.PI;let r,o,n,a,h,l=s;for(let t=0;t<12&&(r=l*l,o=r*r*r,n=l*(Xi+Ki*r+o*(qi+Ji*r))-s,a=Xi+3*Ki*r+o*(7*qi+9*Ji*r),l-=h=n/a,!(Math.abs(h)<1e-9));++t);r=l*l,o=r*r*r;const c=i*Qi*e*(Xi+3*Ki*r+o*(7*qi+9*Ji*r))/Math.cos(l),d=i*Math.asin(Math.sin(l)/Qi);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const sr=63.78137,ir=Math.PI/180;class rr extends Mi{constructor(){super(...arguments),this.maxLatitude=85.0511287798}project(t){let e=Math.max(-this.maxLatitude,Math.min(this.maxLatitude,t[1]+this.offset[1]));const s=Math.sin(e*ir);return[sr*(t[0]+this.offset[0]-this.scroll)*ir,sr*Math.log((1+s)/(1-s))/2]}backward(t){return[(t[0]-this.offset[0])/(sr*ir),(2*Math.atan(Math.exp((t[1]-this.offset[1])/sr))-Math.PI/2)/ir]}}const or=Math.PI/4,nr=Math.PI/180,ar=63.78137;class hr extends Mi{project(t){return[(t[0]+this.offset[0]-this.scroll)*nr*ar,79.7267125*Math.log(Math.tan(or+.4*(t[1]+this.offset[1])*nr))]}backward(t){return[(t[0]-this.offset[0])/ar/nr,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/ar*.8))-or)/nr]}}class lr extends vs{}class cr extends Cs{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=this._createLabel(this.chart))._init()}get subLabel(){return this._subLabel}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new lr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return Je.create(t,as,0,0,e,e,2)}}cr.type="bar",cr.defaults=Be(Cs.defaults,{barWidth:.7});class dr extends je{constructor(t){super(t.chart),this.gauge=t}}class _r extends dr{}_r.defaults=Be(je.defaults,{visible:!1});class ur extends dr{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}ur.defaults=Be(je.defaults,{});class pr extends dr{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}pr.defaults=Be(je.defaults,{thickness:"100%",stroked:!1});class gr extends dr{getExtents(t){return{radius:W(this._radiusDim,t,0),length:W(this._lengthDim,t,0),offset:W(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}gr.defaults=Be(je.defaults,{visible:!1,radius:3,length:"100%",offset:0});class mr extends dr{getRadius(t){return W(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}mr.defaults=Be(je.defaults,{visible:!1,radius:5});class fr extends Ge{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}fr.defaults=Be(Ge.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class br{constructor(){this.setCenterX(wr.DEF_CENTER),this.setCenterY(wr.DEF_CENTER),this.setRadius(wr.DEF_RADIUS),this.setInnerRadius(wr.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Y(w(t,wr.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Y(w(t,wr.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Y(w(t,wr.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Y(w(t,wr.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Y(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),s=p(e,this._innerDim?W(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?W(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=b(t%360,0),i=g(0,p(360,b(e,360)));this._startRad=N+T*s,this._handRad=T*s,this._sweepRad=T*i}}class yr extends Ss{_readObject(t,e){super._readObject(t,e)}}class wr extends As{_doInit(t){super._doInit(t),t.face=(this._face=new _r(this))._init(),t.rim=(this._rim=new ur(this))._init(),t.valueRim=(this._valueRim=new pr(this))._init(),t.hand=(this._hand=new gr(this))._init(),t.pin=(this._pin=new mr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new fr(this.chart))._init(),this._props=new br}get face(){return this._face}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}_createPoint(t){return new yr(t)}_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)}_doPrepareRender(t){super._doPrepareRender(t),this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}wr.DEF_CENTER="50%",wr.DEF_RADIUS="50%",wr.DEF_INNER="80%",wr.type="gauge",wr.defaults=Be(As.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class xr extends je{constructor(t){super(t.chart),this.gauge=t}}class vr extends xr{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}vr.defaults=Be(je.defaults,{thickness:3});class Cr extends xr{getLength(t){return W(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}Cr.defaults=Be(je.defaults,{thickness:1.5,length:"55%"});class Sr extends Cr{}Sr.defaults=Be(Cr.defaults,{thickness:1,length:"80%"});class Lr extends Cr{}Lr.defaults=Be(Cr.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class Ar extends xr{}Ar.defaults=Be(je.defaults,{length:5});class Mr extends xr{}Mr.defaults=Be(je.defaults,{step:1,offset:0});class kr extends xr{}kr.defaults=Be(je.defaults,{radius:4});class Pr extends Ge{}Pr.defaults=Be(Ge.defaults,{text:"RealMap",position:"top"});class Ir extends Ss{getTime(){const t=this.time;return t instanceof Date?t:n(t)?new Date(t):isNaN(t)?void 0:new Date(t)}_readObject(t,e){super._readObject(t,e),this.time=b(e.time,NaN),this.timezone=b(e.timezone,NaN)}}class Nr extends Ls{_doInit(t){super._doInit(t),t.face=(this._face=new je(this.chart))._init(),t.rim=(this._rim=new vr(this))._init(),t.hourHand=(this._hourHand=new Cr(this))._init(),t.minuteHand=(this._minuteHand=new Sr(this))._init(),t.secondHand=(this._secondHand=new Lr(this))._init(),t.tick=(this._tick=new Ar(this))._init(),t.tickLabel=(this._tickLabel=new Mr(this))._init(),t.pin=(this._pin=new kr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new Pr(this.chart))._init()}get face(){return this._face}get rim(){return this._rim}get hourHand(){return this._hourHand}get minuteHand(){return this._minuteHand}get secondHand(){return this._secondHand}get tick(){return this._tick}get tickLabel(){return this._tickLabel}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}getExtents(t,e){const s=p(t,e);return{cx:W(this._centerXDim,t,t/2),cy:W(this._centerYDim,e,e/3),rd:W(this._radiusDim,s,s/2)}}_createPoint(t){return new Ir(t)}_doApply(t){const e=this;super._doApply(t),function(t,s,i){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=Y(w(e._centerX=t,Nr.DEF_CENTER),!0)),e._centerYDim&&s===e._centerY||(e._centerYDim=Y(w(e._centerY=s,Nr.DEF_CENTER),!0)),e._radiusDim&&i===e._radius||(e._radiusDim=Y(w(e._radius=i,Nr.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}Nr.DEF_CENTER="50%",Nr.DEF_RADIUS="50%",Nr.type="clock",Nr.defaults=Be(Ls.defaults,{centerX:Nr.DEF_CENTER,centerY:Nr.DEF_CENTER,radius:Nr.DEF_RADIUS,active:!0,size:70});class Tr extends gs{_readObject(t,e){super._readObject(t,e),this.center=e.center,this.value=e.value}}class Vr extends ls{}Vr.defaults=Be(ls.defaults,{hoverColor:"white"});class Er extends ms{get areaCount(){return this._map.areaCount}get detail(){return this._detail}get color(){return this._colorObj}getValueRange(){return{min:this._minValue,max:this._maxValue}}_createLabel(t){return new Vr(t)}_doApply(t){i(t.detail)?this._detail||(this._detail=new Er(this.chart)):t.hasOwnProperty("detail")&&(this._detail=null),super._doApply(t)}needMapScale(){return!0}getRangedColor(t){var e;if(!isNaN(t.value)){const s=this._colorRanger||(null===(e=this.chart.getColorScale(this._op.colorScale))||void 0===e?void 0:e.getRanger());return null==s?void 0:s.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}}followTooltipPointer(){return!0}getLegendSources(t){return this._points.count>0&&super.getLegendSources(t)}_createPoint(t){return new Tr(t)}_prepareRender(){super._prepareRender()}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op,s=this._visPoints,{min:r,max:o}=this._calcMinMax(s);if(this._minValue=r,this._maxValue=o,i(e.colorRange)){const t=f(e.colorRange);isNaN(t.minValue)&&(t.minValue=r),isNaN(t.maxValue)&&(t.maxValue=o),this._colorRanger=new $s(t)}else this._colorRanger=null}_doLoadPoints(t){this._useMapData&&(t=this._map._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),this._map}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Le(this._calcedColor),this._color=this._colorObj?this._colorObj.toString():null}getColorScale(){return this._op.colorScale}}Er.type="feature",Er.defaults=Be(ms.defaults,{selectable:!1,detailZoom:250});class Dr extends fs{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class Rr extends ms{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new ls(this.chart))._init()}getFigure(t){return t.figure||this.options.figure}get innerLabel(){return this._innerLabel}_doApply(t){super._doApply(t)}_createPoint(t){return new Dr(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}}Rr.type="figure",Rr.defaults=Be(ms.defaults,{position:"top"});class $r extends ls{}$r.defaults=Be(ls.defaults,{visible:!1});class Or extends ss{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class Fr extends us{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new $r(t)}_createPoint(t){return new Or(t)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._root=this._op.rootUrl||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}}Fr.type="image",Fr.defaults=Be(us.defaults,{imageWidth:24,imageHeight:24,position:"top"});class Br extends Vt{constructor(t,e){super(t,as),this.add(this._area=new Rt(t)),this._area.setStyle("opacity","0.2"),this.add(this._line=new Rt(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],s=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(s.join(" "))}}class zr extends vs{}class jr extends je{}jr.defaults=Be(Cs.defaults,{visible:!1});class Hr extends Cs{_doInit(t){super._doInit(t),t.area=(this._area=new jr(this.chart))._init()}get area(){return this._area}_createPoint(t){return new zr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new Br(t,e)}}Hr.type="line",Hr.defaults=Be(Cs.defaults,{});class Gr extends gs{_readObject(t,e){super._readObject(t,e),this.center=e.center}getLabel(t){var e;return this.name||(null===(e=this.area)||void 0===e?void 0:e.name)}getParam(t){return this.area?w(super.getParam(t),this.area.source.props[t]):super.getParam(t)}}class Yr extends ls{}Yr.defaults=Be(ls.defaults,{visible:!1,hoverColor:"white"});class Wr extends je{}Wr.defaults=Be(je.defaults,{enabled:!0,autoMapChange:!0});class Zr extends ms{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new Wr(this.chart))._init()}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get color(){return this._colorObj}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t,e){return(t?this._map.sibling:this._map).get(e)}pointOf(t){return this._areaPts.get(t.id)}pointByProp(t,e){var s;const i=this._points.getPoints();for(const r of i)if((null===(s=r.area)||void 0===s?void 0:s.source.props[t])===e)return r}getBounds(t){}getCenter(t){return t instanceof Gr||(t=this.pointById(t)),t.center||t.area.getCenter()}getValueRange(){return{min:this._minValue,max:this._maxValue}}getDetailed(){return this._detailed?this._detail:this}showDetail(){this._detail&&!this._detailed&&(this._detailed=!0,this._detail.show(!0,!0),this.hide(!0))}showParent(){this._parent&&this._parent._detail===this&&(this.hide(!0),this._parent._detailed=!1,this._parent.show(!0,!0))}_createLabel(t){return new Yr(t)}$_createDetail(){return this._detail||(this._detail=new Zr(this.chart),this._detail._init(),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),i(e.detail)&&this.$_createDetail()._load(e.detail)}_doApply(t){this.getDetailed()||(i(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t)}needMapScale(){return!0}getRangedColor(t){var e;if(!isNaN(t.value)){const s=this._colorRanger||(null===(e=this.chart.getColorScale(this._op.colorScale))||void 0===e?void 0:e.getRanger());return null==s?void 0:s.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}}followTooltipPointer(){return!0}getLegendSources(t){return this._points.count>0&&super.getLegendSources(t)}_createPoint(t){return new Gr(t)}_getPointCallbackArgs(t,e){return super._getPointCallbackArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op,s=this._visPoints,{min:r,max:o}=this._calcMinMax(s);if(this._minValue=r,this._maxValue=o,i(e.colorRange)){const t=f(e.colorRange);isNaN(t.minValue)&&(t.minValue=r),isNaN(t.maxValue)&&(t.maxValue=o),this._colorRanger=new $s(t)}else this._colorRanger=null}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map((t=>({id:t.id,name:t.name})))),super._doLoadPoints(t),e){const t=this._op.mapKeys,s=(r(t)?t[0]:t)||"id",i=(r(t)?t[1]:t)||"id",o=e.getAreaMap(s),n=this._areaPts;n.clear(),this._points.forEach((t=>{t.area="id"===i?o[t[i]]:o[t.source[i]],t.area&&n.set(t.area.id,t)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Le(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}}Zr.type="map",Zr.defaults=Be(ms.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250});class Ur extends ls{}Ur.defaults=Be(ls.defaults,{visible:!1});class Xr extends gs{}class Kr extends je{constructor(t){super(t.chart),this.series=t,this._domain={callback:(t,e)=>this._point.getParam(e)}}getTextDomain(t){return this._point=t,this._domain}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Oe),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,s,i){this._richTextImpl&&this._richTextImpl.build(t,e,s,void 0,i)}}Kr.defaults=Be(je.defaults,{});class qr extends Kr{getMinSize(t){return W(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}qr.defaults=Be(Kr.defaults,{text:"${name}"});class Jr extends Kr{}Jr.defaults=Be(Kr.defaults,{text:"${value}"});class Qr extends ms{_doInit(t){super._doInit(t),t.header=(this._header=new qr(this))._init(),t.divider=(this._divider=new je(this.chart))._init(),t.body=(this._body=new Jr(this))._init()}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:b(this._width,dt.clampEx(t,this._minWidth,this._maxWidth)),height:b(this._height,dt.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new Ur(t)}_createPoint(t){return new Xr(t)}pointLabelCount(){return 0}legendMarker(t,e){return super.legendMarker(t,e)}_doApply(t){super._doApply(t),this._vertical="horizontal"!==t.orientation,this._minWidth=+t.minWidth,this._minHeight=+t.minHeight}}Qr.DEF_MIN_WIDTH=80,Qr.DEF_MIN_HEIGHT=50,Qr.type="panel",Qr.defaults=Be(ms.defaults,{orientation:"vertical",minWidth:Qr.DEF_MIN_WIDTH,minHeight:Qr.DEF_MIN_HEIGHT,position:"top"});class to extends ys{}class eo extends xs{getRadius(t){return b(W(this._radiusDim,t),30)}_createPoint(t){return new to(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius")}_doPrepareRender(t){super._doPrepareRender(t);let e=b(this._op.startAngle%360,0),s=g(0,p(360,b(this._op.totalAngle,360)));this._startRad=N+T*e,this._totalRad=T*s}}eo.type="pie",eo.defaults=Be(xs.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByValue:!0});class so extends Rt{constructor(t,e){super(t,as),this._rd=e,this.setPath(Ct.pin({cx:0,cy:2*-e,rd:e,innerRd:0})),this.transY(3*-e)}trans(t,e){return e+=3*this._rd,super.trans(t,e)}}class io extends fs{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class ro extends bs{getExt(t,e){const s=b(t.radius,this._rd)*e;return{cx:0,cy:2*-s,rd:s,innerRd:s*this._innerRd}}_doApply(t){super._doApply(t),this._rd=b(t.radius,ro.DEF_RADIUS),this._innerRd=b(t.innerRadius,0)}_createPoint(t){return new io(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new so(t,e/2)}}ro.DEF_RADIUS=9,ro.type="pin",ro.defaults=Be(bs.defaults,{radius:ro.DEF_RADIUS,innerRadius:0,position:"top"});class oo extends Vt{constructor(t,e){super(t,as),this._size=e,this.add(this._marker=new Rt(t)),this.setShape("circle",12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}setColor(t){return this.dom.style.fill=t,this}_renderShape(t){const e=Math.max(4,t/2);Ct.setShape(this._marker,this._shape,e,e)}}class no extends fs{_readObject(t,e){super._readObject(t,e)}}class ao extends bs{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(t){return this._op.shape||this._shape}getRadius(){return b(this._op.radius,ao.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.setStyle("stroke",this._stroke),t.setStyle("stroke-width",this._strokeWidth))}_createPoint(t){return new no(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._stroke=t.stroke,this._strokeWidth=t.strokeWidth}_createLegendMarker(t,e){return new oo(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),p(e,2*this._op.radius)),s}}ao.type="point",ao.defaults=Be(bs.defaults,{radius:5,position:"center"});class ho extends Vt{constructor(t,e){super(t,as),this.add(this._line=new Rt(t)),this.add(this._arrow=new Rt(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],s=e[e.length-2],i=e[e.length-1],r=$(Math.atan2(i[1]-s[1],i[0]-s[0]))-90,o="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),this._arrow.setPath(`M ${i[0]} ${i[1]} L ${i[0]-4} ${i[1]-6} L ${i[0]+4} ${i[1]-6} Z`),this._arrow.setRotation(i[0],i[1],r)}}class lo extends ss{get lon1(){return this.coords[0][0]}get lat1(){return this.coords[0][1]}get lon2(){return this.coords[1][0]}get lat2(){return this.coords[1][1]}_assignTo(t){return l(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var s;const i=function(t){let e=[];return r(t)?t.forEach((t=>{r(t)?e=e.concat(i(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.name=e.name,this.coords=null!==(s=e.coords)&&void 0!==s?s:e.coord,this.path=null!=e.path?i(e.path):void 0}}class co extends us{needMapScale(){return!0}needRemoveAnimation(){return!0}_createPoint(t){return new lo(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(r(t)){const e=this.chart.body._points;i(e)&&(t=t.map((t=>{const s=l({},t);if(r(s.coords)){const t=s.coords.slice();n(t[0])&&(t[0]=e[t[0]]),n(t[1])&&(t[1]=e[t[1]]),s.coords=t}return s})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new ho(t,e)}}co.type=qe,co.defaults=Be(us.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class _o extends fs{_readObject(t,e){super._readObject(t,e),this.length=t._lengthFielder(e),this.angle=t._angleFielder(e)}}class uo extends bs{_createFielders(t){super._createFielders(t),this._lengthFielder=this._createFielder(t.lengthField||"length"),this._angleFielder=this._createFielder(t.angleField||"angle")}_createPoint(t){return new _o(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){}legendMarker(t,e){}}uo.type="vector",uo.defaults=Be(bs.defaults,{headType:"openArrow",lengthField:"length",angleField:"angle",startAngle:0});class po extends ys{}class go extends xs{getPointGrid(t,e,s){const i=this._runGrid=[],r=this.$_caculate(t,e,s),o={rowCount:this._rowCount,colCount:this._colCount,grid:i,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(o);else this.$_fillColFirst(o);return{grid:i,count:r,rows:o.rows,cols:o.cols}}_createPoint(t){return new po(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||go.ROW_COUNT,this._colCount=t.colCount||go.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||go.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||go.CELL_SIZE,this._gap=b(t.gap,go.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t){super._doPrepareRender(t),this._visPoints.forEach((t=>{t._sum=r(t.values)?t.values.reduce(((t,e)=>t+e)):0}))}$_caculate(t,e,s){const i=(Math.max(e.min,t._sum*b(s,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(i);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,s=e.length;for(let i=0;i<s;i++)if(isNaN(e[i][t]))return i;return s}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:s,colCount:i}=t,r=Math.min(this._threshold,this._colCount-1);let o=0,n=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,o=Math.max(o,a),n=Math.max(n,h),a==s-1?(h++,a=this.$_rows(h)):h===i-1||this.$_cols(a)>this.$_cols(a+1)+r?(a++,h=this.$_cols(a)):(h++,a=this.$_rows(h)),l++}t.rows=o,t.cols=n}$_fillColFirst(t){const{grid:e,rowCount:s,colCount:i}=t,r=Math.min(this._threshold,this._rowCount-1);let o=0,n=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,o=Math.max(o,a),n=Math.max(n,h),h==i-1?(a++,h=this.$_cols(a)):a===s-1||this.$_rows(h)>this.$_rows(h+1)+r?(h++,a=this.$_rows(h)):(a++,h=this.$_cols(a)),l++}t.rows=o,t.cols=n}}go.ROW_COUNT=10,go.COL_COUNT=10,go.THRESHOLD=1,go.CELL_SIZE=5,go.GAP=2,go.type="waffle",go.defaults=Be(xs.defaults,{rowCount:go.ROW_COUNT,colCount:go.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:go.THRESHOLD,cellSize:go.CELL_SIZE,gap:go.GAP});class mo extends Ai{static loadMap(t){return i(t)&&i(t.source)&&r(t.source.features)||i(t)&&i(t.map)&&r(t.map.features)?new mo(t):void 0}_doLoad(t){const e=t.features,s=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Si(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,s.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,s.push(e)}}})),s}}class fo extends Ai{static loadMap(t){if(i(t)){const e=t.source;if(i(e)&&"Topology"===e.type&&i(e.objects)&&r(e.arcs))return new fo(t);const s=t.map;if(i(s)&&"Topology"===s.type&&i(s.objects)&&r(s.arcs))return new fo(t)}}_doLoad(t){const e=t=>t.map((t=>t.map((t=>t<0?a[~t].slice().reverse():a[t])).flat())),s=t.objects,o=t.arcs,n=t.transform,a=[],h=[];if(i(n)){const t=n.scale[0],e=n.scale[1],s=n.translate[0],i=n.translate[1];o.forEach((r=>{let o=0,n=0;const h=r.map((r=>((r=r.slice())[0]=(o+=r[0])*t+s,r[1]=(n+=r[1])*e+i,r)));a.push(h)}))}else o.forEach((t=>{a.push(t.slice())}));for(const t in s)if("GeometryCollection"===s[t].type){const i=s[t].geometries;r(i)&&i.forEach((t=>{const s=new Si(t.id,t.properties);switch(t.type){case"Polygon":s.polygon=e(t.arcs),h.push(s);break;case"MultiPolygon":s.polygons=t.arcs.map((t=>e(t))),h.push(s)}}))}return h}}class bo extends mt{constructor(t,e,s,i){super(),this.view=t,this.zoom=e,this.duration=b(s,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==i||i()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class yo extends mt{constructor(t,e,s,i,r){super(),this.view=t,this.zoom=e,this.coords=s,this.duration=b(i,300),this._old=t.zoom,this.view.$_moveTo(s),this.endHandler=()=>{this.view.zoom=e,this.view=null,null==r||r()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class wo extends je{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}wo.defaults=Be(us.defaults,{visible:void 0,globeFill:"lightblue"});const xo={zoom:1,panX:1,panY:1};class vo extends je{constructor(t){super(t),this._prj=(new Ui).prepareSecond(),this._zoom=1,this._panX=0,this._panY=0,this._scale=1,this._vRect=pt.create(0),this._wMap=null,this._reCalculateFlag=!0,this._dragDistance=0,this._annotations=new Ke(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new wo(this.chart))._init()}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get rotationX(){return this._prj instanceof Ii?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Ii?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){var t;return null!==(t=this._op.scroll)&&void 0!==t?t:0}set scroll(t){this.updateOption("scroll",t)}get panX(){return this._panX}set panX(t){this.updateOption("panX",t)}get panY(){return this._panY}set panY(t){this.updateOption("panY",t)}get zoom(){return this._op.zoom}set zoom(t){t=Math.max(100,t),this.updateOption("zoom",t)}get isZoomed(){return this.zoom>100}get scale(){return this._scale}get center(){const t=[this._map.cx,this._map.cy];return this._prj?this._prj.backward(t):t}get map(){return this._map}set dragDistance(t){this._dragDistance=t}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}prepareLayout(t,e){var s;const i=function(t,e,s){const i=Math.max(0,(e-t)/2);return Math.max(-i,Math.min(s,i))},r=this._prj,o=this._map=this.chart.map;let{x1:n,x2:a,y1:h,y2:l}=o;if(this._reCalculateFlag){const{x1:t,x2:e,w:s}=this.$_calcWMap();this._wMap=s,this._reCalculateFlag=!1}const c=this._wMap,d=l-h,_=this._wRate=t/c,u=this._hRate=e/d,p=this._zoom/100,g=this._scale=p*Math.min(_,u),m=b(this._op.panX*g,0),f=b(this._op.panY*g,0),y=i(t,c*g,m)/g;this.isScrollable()||(this._panX=y),this._panY=i(e,d*g,f)/g;const w=(this.scroll%360+360)%360*(c/360),x=t/2-(n+c/2)*g-(this._panX+w)*g,v=e/2+(h+d/2)*g-this._panY*g,C=_/g*c,S=u/g*d,L=n+c/2-C/2+this._panX,A=h+d/2-S/2-this._panY;return r&&(r.scroll=null!==(s=this._op.scroll)&&void 0!==s?s:0),this._vRect=pt.create(L,A,C,S),{scale:g,wMap:c,hMap:d,tx:x,ty:v}}$_calcWMap(){var t;const e=new this._prj.constructor;e.offset=this._prj.offset;const s=this._map;let i=1/0,r=-1/0;if(e instanceof Ii||![er].some((t=>e instanceof t))){const{x1:t,x2:e}=s;return{x1:t,x2:e,w:e-t}}const o=(t,s=[0,0])=>{t[0].forEach((t=>{const o=e.project([t[0]+s[0],t[1]+s[1]]);i=Math.min(i,o[0]),r=Math.max(r,o[0])}))};for(let e=0;e<s.areaCount;e++){const i=s.get(e),{polygon:r,polygons:n}=i.source;n?n.forEach((t=>{var e;return o(t,null===(e=i.inset)||void 0===e?void 0:e.offset)})):o(r,null===(t=i.inset)||void 0===t?void 0:t.offset)}return{x1:i,x2:r,w:r-i}}getPoint(t){return this._points[t]}isVisible(t){return this._vRect.contains(t[0],t[1])&&!this._prj.project(t).outside}isWorldMap(){return this.map.isWorldMap()}isScrollable(){return this.options.scrollable&&this.map.isWorldMap()}setZoom(t,e=300){let s,r;a(e)?r=e:o(e)?(s=e,r=300):i(e)&&(s=e.end,r=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),r>0?new bo(this,t,r,s).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}_canSetZoom(t){return t>100}zoomTo(t,e,s=300){new yo(this,t,e,s,null).start()}zoomToArea(t,e=.7,s=300){const i=this.map.areaOf(t),r=i.getCenter(),o=(this.map.x2-this.map.x1)*e,n=(this.map.y2-this.map.y1)*e,a=o/(i.x2-i.x1)*100,h=n/(i.y2-i.y1)*100,l=Math.min(a,h);new yo(this,l,r,s,null).start()}zoomToBounds(t,e,s=300){const i=Math.abs(e[0]-t[0]),r=Math.abs(e[1]-t[1]),o=[(t[0]+e[0])/2,(t[1]+e[1])/2];try{const t=Math.abs(this.map.x2-this.map.x1)/i*100,e=Math.abs(this.map.y2-this.map.y1)/r*100,n=Math.min(t,e);new yo(this,n,o,s,null).start()}catch(t){console.error(t)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this._map,[s,i]=this._prj.project(t);this.isScrollable()?this.scroll=t[0]:this.panX=s-e.cx,this.panY=e.cy-i}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,s){const i=t in xo;i&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,s)}finally{i&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let s=!0;for(const e in t)if(!(e in xo)){s=!1;break}s&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{s&&this.chart.freeOptionsDirty()}return this}_doApply(t){var e,o,a;const h=this;var l;super._doApply(t),s.call(t,"annotations")&&(l=t.annotations)!==h._anns&&(h._anns=l,h._annotations.load(l,!0));const c=this._zoom;let d=function(t){if(t!==h._projection){switch(h._projection=t,h._projection.toLowerCase()){case"orthographic":h.scroll=0,h.panX=0,h.panY=0,h._prj=new Ii;break;case"equalearth":h._prj=(new er).prepareSecond();break;case"miller":h._prj=(new hr).prepareSecond();break;case"mercator":h._prj=(new rr).prepareSecond();break;default:h._prj=(new Ui).prepareSecond()}return h._reCalculateFlag=!0,!0}}(t.projection);const _=this._prj;if(_&&(this.scroll!==_.scroll||d)){_.scroll=this.scroll,d=!0;const t=null===(e=this.chart)||void 0===e?void 0:e.firstMapSeries;t&&t.setOptionsDirty(!0)}_ instanceof Ii&&(d=_.setRotation(t.rotationX,t.rotationY)||d),function(t){void 0!==t&&(h._zoom=Math.max(100,b(t,100)))}(t.zoom);const u=this._points={};r(t.points)&&t.points.forEach((t=>{r(t)&&t.length>=3&&n(t[0])?u[t[0]]=[t[1],t[2]]:i(t)&&n(t.id)&&(u[t.id]=r(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(d&&this.chart.projectionChanged(),this._zoom!==c&&(this.chart.zoomChanged(c),null===(a=(o=this._op).onZoomChanged)||void 0===a||a.call(o,{zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}vo.defaults=Be(je.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:4});class Co extends je{getAlign(t){this._op.align}}Co.defaults=Be(je.defaults,{text:"RealMap v1.0.4",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});class So extends Zr{}class Lo extends je{}Lo.defaults=Be(je.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default"});class Ao extends yt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._point_shaes=wt.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Qt,this._series=new ps(this),this._annotations=new Ke(this),this._colorScales=new Zs(this),this._bubbleScales=new Es(this),(this._chartOptions=new Lo(this))._init(),(this._axis=new ai(this))._init(),(this._body=new vo(this))._init(),(this._exporter=new Us(this))._init(),(this._title=new ji(this))._init(),(this._subtitle=new Hi(this))._init(),(this._legend=new Rs(this))._init(),(this._zoomPanel=new Fi(this))._init(),(this._drilldownPanel=new Bi(this))._init(),(this._mapScale=new $i(this))._init(),(this._credits=new Co(this))._init(),(this._tooltip=new Gi(this))._init(),this.options=Object.assign({},Ao.defaults),i(t)?this._load(t):this._initOptions(),this._selection=new zi(this)}_initOptions(){}get isGlobe(){return this.getProjection(!1).isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}_getSeriesType(t){return n(t)&&hs[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Ue[t.toLowerCase()]}_modelChanged(){this._fireEvent("onModelChanged")}_optionChanged(t,e){this._optionsLock||(this._optionsDirty=!0),this._fireEvent("onModelChanged",t,e)}animatable(){return!0}loadAnimatable(){return this._loadAnimatable}isVisible(t){return t&&this.getProjection(!1).isVisible(t)}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var s,i;this._fireEvent("onModelChanged",t,"selection"),null===(i=(s=this._chartOptions.options).onSelectionChanged)||void 0===i||i.call(s,{chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(t){const e=this._body._prj;return e?t&&e.second||e:(new Ui).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this._fireEvent("onProjectionChanged",this,this.body._prj)}zoomChanged(t){this._fireEvent("onZoomChanged",this,t)}mapChanged(t){this._fireEvent("onMapChanged",this,t)}anchorByName(t){throw new Error("Method not implemented.")}get chart(){return this}getTooltipContext(t,e,s){return e}selectionChanged(t){this._modelChanged()}selectionItemAdded(t){}selectionItemRemoved(t){}selectionCleared(){}get type(){return this.options.type}get chartOptions(){return this._chartOptions}get legend(){return this._legend}get credits(){return this._credits}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,s=(t instanceof Di?t:this.getMap(t))||this._maps[0];s!==e&&(this._baseMap=s,this._loading||(this._baseMap.reset(),this.mapChanged(s)))}get axis(){return this._axis}get body(){return this._body}get visibleSeries(){return this._series.visibles}get firstVisible(){return this._series.firstVisible}get firstMapSeries(){return this._series.visibles.find((t=>t instanceof Zr))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof Zr&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}requestRender(t){this._fireEvent("onRequestRender",t)}mapByName(t){return this._maps.find((e=>e&&e.name===t))}mapAt(t){return this._maps[t]}getMap(t){return n(t)?this.mapByName(t):this.mapAt(+t)}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}loadBase(t,e,s){const r=this._bases[e];let o;return i(r.base)&&ze(o={},r.base),i(r[s])&&(o||(o={}),ze(o,r[s])),o?ze(o,t):t}_setProperties(t,e=!0){const s=this.options;for(const e in Ao.defaults)t.hasOwnProperty(e)&&(s[e]=t[e])}_load(t){const e=this.options;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(w(t.asset,t.assets)),e.chart=this._chartOptions._load(t.chart),e.body=this._body._load(t.body);const s=r(t.map)?t.map:i(t.map)?[t.map]:null;return r(s)&&(s.forEach(((t,e)=>{if(!1!==t.enabled){const s=fo.loadMap(t)||mo.loadMap(t),i=s&&new Di(this,s,e);i.isWorldMap()&&i._prepareSecond(),this._maps.push(i)}})),this.setBaseMap(void 0)),e.axis=this._axis._load(t.axis),e.title=this._title._load(t.title),e.subtitle=this._subtitle._load(t.subtitle),e.legend=this._legend._load(t.legend),e.zoomPanel=this._zoomPanel._load(t.zoomPanel),e.drilldownPanel=this._drilldownPanel._load(t.drilldownPanel),e.credits=this._credits._load(t.credits),e.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series,So),this._series.get(0)instanceof Zr||!1===e.chart.alwaysMap||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale._load(t.mapScale),e.exporting=this._exporter._load(t.exporting),this._loading=!1,this}$_loadTemplates(t){const e=this._bases={axis:{},series:{},gauge:{},annotation:{}};if(i(t)){const s=this._templates={};for(const e in t){const r=t[e];i(r)&&(s[e]=l({},r))}["@series","@annotation"].forEach((s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])})),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return ze(ze({},s),t)}else r(e)&&e.forEach((e=>{let s=this._templates[e];return s?ze(ze({},s),t):s}));return t}}else this.assignTemplates=void 0}prepareRender(){this._series._prepareRender(this._optionsDirty),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legend._prepareRender(),this._body._prepareRender(),this._annotations.prepareRender()}afterRender(){this._series._afterRender(),this._optionsDirty=this._dataDirty=!1}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof je||s instanceof He||s instanceof Qt)&&s.updateOptions(t[e],!1)}e&&this._optionChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(){return this._series.getLegendSources().concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t);return s&&this._optionChanged(s),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._optionChanged(null),s}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.first}getBubbleScale(t){return null===t?null:this._bubbleScales.first}async drilldown(t,e){if(!(t instanceof Zr&&t.detail))return;const s=t.drilldown,i=t.detail;if(!s.options.enabled)return;i.options.dataUrl&&(i.updateOption("data",await fetch(i.options.dataUrl).then((t=>t.json()))),delete i.options.dataUrl);const r=t.map,o=this.getMap(i.options.map)||r;s.options.autoMapChange&&o!==r&&this.setBaseMap(o),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof Zr&&t.parent))return;const e=t.drilldown;if(!e.options.enabled)return;const s=t.parent,i=this.map;e.options.autoMapChange&&s.map!==i&&this.setBaseMap(s.map),t.showParent(),this._body.zoom=100}_visibleChanged(t){}_hoverAreaChanged(t,e,s){var i,r;null===(r=(i=this._body.options).onHoverArea)||void 0===r||r.call(i,{area:null==e?void 0:e.getInfo(),oldArea:null==s?void 0:s.getInfo()})}_areaClicked(t,e){var s,i;null===(i=(s=this._body.options).onClickArea)||void 0===i||i.call(s,{area:null==e?void 0:e.getInfo()})}}Ao.defaults={type:"map",startOfWeek:0},us.register(Zr,Er,ao,ro,uo,cr,eo,Rr,Ps,co,Fr,Hr,Qr,go,wr,Nr),Xe.register(Yi,Wi,Zi);const Mo="$ctrl";class ko{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Ao(t,this),null==e||e(this._obj,null)}get options(){return this._obj.options}get type(){return this._obj.type}get body(){return this._obj.body}get assets(){return this._obj._assets}get map(){return this._obj.map}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get series(){return this._obj.firstVisible}get firstMapSeries(){return this._obj.firstMapSeries}get legend(){return this._obj._legend}get credits(){return this._obj._credits}get colorScale(){return this._obj.colorScale}get bubbleScale(){return this._obj.bubbleScale}get zoomPanel(){return this._obj._zoomPanel}get drilldownPanel(){return this._obj._drilldownPanel}get tooltip(){return this._obj._tooltip}get selection(){return this._obj.selection}get exporter(){return this._obj._exporter}setBaseMap(t){this._obj.setBaseMap(t)}getMap(t){return n(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart ";dt.LOGGING&&console.time(i);let o=this._obj,n=o;this._loaded?(o.destroy(),n=this._obj=new Ao):(this._loaded=!0,o=null),n._load(t),n._loadAnimatable=e,this._loadCallback=s,dt.log("chart-items:",Fe),dt.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,n,o)}return this}async loadAsync(t,e=!1,s){var r,o,n;if(!i(t))return this;null===(r=this[Mo])||void 0===r||r.showLoadingView();const a="load chart ";dt.LOGGING&&console.time(a),await S.loadConfigAsync(t);let h=this._obj,l=h;return this._loaded?(h.destroy(),l=this._obj=new Ao):(this._loaded=!0,h=null),l._load(t),l._loadAnimatable=e,this._loadCallback=s,dt.log("chart-items:",Fe),dt.LOGGING&&console.timeEnd(a),null===(o=this._modelCallback)||void 0===o||o.call(this,l,h),null===(n=this[Mo])||void 0===n||n.hideLoadingView(),this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(t=!0){this._obj.requestRender(t)}setParam(t,e,s){}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}getPoint(t){return this._obj.body.getPoint(t)}seriesAt(t){return this._obj.seriesAt(t)}seriesByName(t){return this._obj.seriesByName(t)}async drilldown(t,e){const s=t instanceof Zr?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;s instanceof Zr&&this._obj.drilldown(s,e)}async drillup(t){const e=t instanceof Zr?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof Zr&&this._obj.drillup(e)}}class Po extends Vt{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=_t,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate()}}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,s){return!!t&&(this.url=t,this.resize(e,s)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class Io extends Vt{constructor(t,e){super(t,Io.STYLE),this._spinnerWrapper=new Vt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new Po(t,!0,"rm-loading-spinner")),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=Io.LOADING_SPINNER,this._spinner.width=Io.SPINNER_LENGTH,this._spinner.height=Io.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-Io.SPINNER_LENGTH/2,t.height/2-Io.SPINNER_LENGTH/2)}}Io.STYLE="rm-loading-indicator",Io.BACK_STYLE="rm-loading-background",Io.SPINNER_LENGTH=64,Io.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class No{constructor(t){this._draggable=!0,this._touches=[],this._tapped=0,this._firstTime=0,this._secondTime=0,this._distance=0,this._pinching=!1,this._control=t}get control(){return this._control}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}get dragging(){return this._dragTracker&&this._dragTracker.dragging}touchX(){return this._touchX}touchY(){return this._touchY}pointerDown(t){let e;return e=this.$_pointerToPoint(t),this._prevX=e.x,this._prevY=e.y,this._doPointerDown(t)}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(this._clearTouchEffects(),s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,s=this.dragging,{x:i,y:r}=this.$_pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(i<0||i>=this._control.dom().offsetWidth||r<0||r>=this._control.dom().offsetHeight?s&&this.$_stopDragTracker(e,i,r,!0):s?this.$_doDrag(t,e,i,r):(!this._dragTracker&&Math.abs(this._prevX-i)>3||Math.abs(this._prevY-r)>3||this._dragTracker&&!s)&&this.$_startMove(t,e,i,r),this._prevX=i,this._prevY=r,this._touches.push({x:i,y:r,t:t.timeStamp})):s&&this.$_stopDragTracker(e,i,r,!0),this.dragging&&this._stopEvent(t),this._doPointerMove(i,r,t)}pointerUp(t){if(this._pinching)return;const e=t.target,{x:s,y:i}=this.$_pointerToPoint(t);this.$_stopDragTracker(e,s,i)}pointerCancel(t){const e=t.target,{x:s,y:i}=this.$_pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,s,i,!0),clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerCancel(t)}pointerLeave(t){clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerLeave(t)}touchStart(t){if(this._pinching=!1,t.touches.length>=2){const e=t.target;this._isPinchTarget(e)&&(this._pinching=!0,this._distance=this.$_getDistance(t.touches[0],t.touches[1])),t.cancelable&&t.preventDefault()}else this._doTouchStart(t,t.target)}touchMove(t){if(t.preventDefault(),t.touches.length>=2&&this._pinching){if(this._pinching){const e=this.$_getDistance(t.touches[0],t.touches[1]);this._doPinch(e-this._distance),this._distance=e}return!0}return t.target instanceof HTMLTextAreaElement||this._doTouchMove(t,t.target)}_isPinchTarget(t){}_doPinch(t){}touchEnd(t){this._pinching?this._distance=0:this._doTouchEnd(t,t.target)}click(t){this._doClick(t)}dblClick(t){this._doDblClick(t)}keyPress(t){this._doKeyPress(t)}wheel(t){this._doWheel(t)&&this._stopEvent(t)}requestDrag(t){const e=this.getTrackerFromRequest(t);e&&this.setDragTracker(e)}getTrackerFromRequest(t){}_setDraggable(t){this._draggable=t}_doClick(t){}_doDblClick(t){}_doPointerDown(t){return!0}_doPointerMove(t,e,s){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,s){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,s,i,r){return!1}_getDragTracker(t,e,s){return null}$_startDrag(t,e,s,i,r){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,i-e,r-s)),!!this._dragTracker&&this._dragTracker.start(t,e,s,i,r)}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i=!1){this.dragging&&(i?this._dragTracker.cancel():this._dragTracker.drop(null,e,s),this._dragTracker=null)}$_pointerToPoint(t){const e=this._control.dom().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}$_checkSwipe(t,e){const s=this._touches,i=s.length;if(i<2)return;const r=s[i-1];let o=s[i-2];if(r.t-o.t<=100)for(let t=i-3;t>=0&&(o=s[t],!(r.t-o.t>100));t--);const n=o.x,a=o.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(n-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-o.t),d=.998;if(c>.1){const e=this._dragTracker,s=Math.log(.1/c)/Math.log(d),i=c*(1-Math.pow(d,s+1))/(1-d);let r,o=Math.round(180*Math.atan2(l-a,h-n)/Math.PI);if(o<0&&(o=360+o),r=o>45&&o<=135?X.DOWN:o>135&&o<=225?X.LEFT:o>225&&o<=315?X.UP:X.RIGHT,this.dragging){if(e.swipe(r,1.6*s,1.3*i))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*s,1.3*i)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const s=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(s*s+i*i)}}class To extends bt{constructor(t){super(),this._dragging=!1,this._control=t}get control(){return this._control}get dragging(){return this._dragging}get startWhenCreated(){return!1}get cursor(){}canSwipe(){return!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this._dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this._dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this._dragging)try{this._dragging=!1,this._doCanceled()}finally{this.end()}}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)}}swipe(t,e,s){if(this._doSwipe(t,e,s))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,s){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_canAccept(t,e,s){return!0}_doCompleted(t,e,s){}_doEnded(t=-1,e=-1){}}class Vo extends To{_doDrag(t,e,s,i,r){const o=this.control.model.body;o.rotationX+=(i-e)/2,o.rotationY-=(r-s)/2}}class Eo extends To{constructor(t){super(t);const e=this.$_mapView();this._oldX=e.scroll+e.panX,this._oldY=e.panY}_doStart(t,e,s,i,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=s,super._doStart(t,e,s,i,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,s,i,r){const o=this.$_mapView(),n=this._oldX-(i-this._xStart)/o.scale,a=this._oldY-(r-this._yStart)/o.scale;if(o.isScrollable()){const t=360;o.scroll+=t/(o.calcedMapWidth*o.scale)*(e-i)}else o.panX=n;return o.panY=a,!0}$_mapView(){return this.control.model.body}}class Do extends No{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,s){this.dragging?this.dragTracker instanceof Eo&&(this._clickElement=null):0===s.buttons&&this.$_chartView().pointerMoved(t,e,s.target)}_doClick(t){const e=t.target,s=ct?t.ctrlKey:t.metaKey,i=this.$_chart(),r=this.$_chartView(),o=i.chartOptions.options.clickAction,n=r.getButton(e);let a,h,l;if(n)n.click();else if(a=r.legendByDom(e))if(a.source instanceof ss){const t=a.source;i.seriesByPoint(t)}else a.source.canHide()&&(a.source.visible=!a.source.visible);else if(e===this._clickElement){if(h=r.seriesByDom(e))h.click(e);else if(l=r.creditByDom(e))l.click(e);else if(r.drilldownPanelView().click(e))return;if("select"===o)h&&h.model.canSelect()&&(s?h.toggleSelect(e):h.select(e,!0))}}_doDblClick(t){const e=this.$_chart(),s=this.$_chartView(),i=e.chartOptions.options.dblClickAction;if("drilldown"===i){const i=e.firstMapSeries;if(i){const r=t.target,o=s.bodyView().getSeries(i).pointByDom(r);o&&o.point instanceof Gr&&e.drilldown(e.firstMapSeries,o.point.area.id)}}}_doWheel(t){const e=this.$_chart().body,s=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX;return e.options.zoomable&&(e.zoom+=-s/b(Math.max(1,e.options.wheelZoomFactor),4)),t.preventDefault(),!0}_isPinchTarget(t){return this.$_chartView().bodyView().dom.contains(t)}_doPinch(t){const e=this.$_chart().body;e.zoom+=t*(1+Math.log(e.zoom/100)),console.log("PINCH",t*(1+Math.log(e.zoom/100)))}_getDragTracker(t,e,s){return this.$_chart().isGlobe?new Vo(this.control):this.control.chartView().bodyView().canScroll()?new Eo(this.control):void 0}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}}class Ro{static empty(){return new Ro}static create(t=0,e=0){return new Ro(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}get isEmpty(){return 0===this.width||0===this.height}clone(){return new Ro(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}toString(){return"{width: "+this.width+", height: "+this.height+"}"}}Ro.EMPTY=new Ro;class $o{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new $o(t,t,t,t):new $o(t,t,e,e):new $o(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 $o(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}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}$o.Empty=Object.freeze(new $o),$o.Temp=new $o;class Oo extends Vt{constructor(t,e=M){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Oo.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Oo.IGNORE_ATTRS={width:"",height:""};class Fo extends Vt{constructor(t,e=M){super(t,e,"g"),Vt.DEBUGGING&&(this.add(this._debugRect=new Je(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this.options=t._op)}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,s,i);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Vt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Je(this.doc,"rm-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){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class Bo extends Fo{constructor(t,e,s){super(t,e),this._margins=new $o,this._paddings=new $o,this.add(this._background=new Je(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let r=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(r);const n=this._doMeasure(t,e,s,i);if(n.width+=o.left+o.right,n.height+=o.top+o.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=n.width+=t.left+t.right,this.mh=n.height+=t.top+t.bottom}return this.mw=n.width,this.mh=n.height,n}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class zo extends Oo{measure(t,e,s,i){const r=this._doMeasure(t,e,s,i);return this.mw=r?r.width:0,this.mh=r?r.height:0,r}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}locateInner(t,e,s){return this._doLocateInner(t,e,s),this}}class jo extends Fo{constructor(){super(...arguments),this._inverted=!1,this._animatable=!0,this._loadAnimatable=!0}_setChartOptions(t,e,s){this._inverted=t,this._animatable=e,this._loadAnimatable=s}}class Ho extends bt{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}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()}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e,s){const i=this._owner.doc,r=this._pool,o=this._views;for(let t of o)t.parent;for(t=Math.max(0,t);o.length>t;)r.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t)}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){t.remove(),this._pool.push(t);const e=this._views.indexOf(t);e>=0&&this._views.splice(e,1)}}freeAll(t,e=0){for(let s of t)this.free(s,e)}clear(){this.freeAll(this._views)}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}find(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)if(t(e[s]))return e[s]}sort(t){const e=this._views.sort(t);return e.forEach((t=>t.remove())),e.forEach((t=>this._owner.add(t))),this}map(t){return this._views.map(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._owner.add(e),e}_getElementId(t){}}class Go extends Fo{constructor(e){super(e,"rm-legend-item"),this.add(this._back=new Je(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Pe(e,"rm-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const r=this._rMarker=this._marker.setVisible(e.legend.options.markerVisible)?this._marker.bbox():_t,o=ut(this._label.bbox());return this._gap=b(e.legend.options.markerGap,0),{width:r.width+this._gap+o.width,height:g(r.height,o.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.bbox().height)/2)}}class Yo extends Bo{constructor(t){super(t,Yo.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new Ho(this,Go)}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){const r=e.options,o=e.items(),n=this._vertical="vertical"===e.getLayout();return this._ipr=b(r.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==r.location?b(r.gap,0):0,n?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,n,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.sameTextColor,i=this._sizes,r=t.itemsAlign,o=t.lineGap||0,n=t.itemGap||0,a=this._margins,h=this._paddings,l=this._vertical,c=a.left+h.left,d=a.top+h.top;let _,u=c,p=d;this._itemViews.forEach((t=>{var e;const i=t.model.source,r=i.legendColor();t._marker.setColor(r),null===(e=i.setLegendMarkerStyle)||void 0===e||e.call(i,t._marker),s&&i.visible?t._label.setFill(r):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=d,"center"!==r&&"end"!==r||(_=t.map((t=>t.height)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-_)/2:this.height-_),t.forEach((t=>{t.trans(u,p),p+=t.height+n})),u+=i[e]+o):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=c,"center"!==r&&"end"!==r||(_=t.map((t=>t.width)).reduce(((t,e)=>t+e))+n*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-_)/2:this.width-_),t.forEach((t=>{t.trans(u,p),u+=t.width+n})),p+=i[e]+o)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,o){const n=e.options,a=e.items(),h=this._itemViews,l=n.itemGap||0,c=n.lineGap||0,d=h.count,_=this._rowViews=[],u=this._sizes=[];let p,m,f,b;h.forEach(((e,s)=>{e.setMarker(a[s].source.legendMarker(t,+n.markerSize||Ds.MARKER_SIZE)),e.measure(t,a[s],r,o)}));let y=0,w=0;if(s){for(;y<d;)b=h.get(y),w%i===0?(_.push(f=[b]),m=b.mh,w++,y++):(m+=l+b.mh,m<=o?(f.push(b),w++,y++):w=0);this._wMarkers=[],p=m=0,_.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=g(s,t.mw),r=g(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=g(m,i),p+=s,u.push(s),this._wMarkers.push(r)})),p+=c*(_.length-1)}else{for(;y<d;)b=h.get(y),w%i===0?(_.push(f=[b]),p=b.mw,w++,y++):(p+=l+b.mw,p<=r?(f.push(b),w++,y++):w=0);p=m=0,_.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=g(s,t.mh)})),e+=l*(t.length-1),p=g(p,e),m+=s,u.push(s)})),m+=c*(_.length-1)}return{width:p,height:m}}}Yo.LEGEND_CLASS="rm-legend";const Wo={};class Zo extends Bo{static register(...t){t.forEach((t=>{Wo[t[0].type]=t[1]}))}constructor(t,e){super(t,Zo.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,s){this.measure(this.doc,this.model,e,s),this._layoutView(t,0,0,e,s)}_layoutView(t,e,s,i,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,s,i,r,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 o=i.tx,n=i.ty;switch(this.options.align){case"left":o-=this.width+t.x;break;case"right":o+=s+t.x;break;default:o+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":n+=(r-this.height)/2+t.y;break;case"bottom":n+=r+t.y;break;default:n-=this.height+t.y}return{x:o,y:n}}}}_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)}}Zo.CLASS_NAME="rm-annotation";class Uo{static interpolate(t,e){if(e instanceof Ii==!1)return t;const s=[];let i=null,r=null,o=!1;for(let n=0;n<t.length;n++){const a=t[n],h=e.project(a);if(h.outside)o=!0;else{if(i||(i=a,t.push(a)),o&&r){const t=Ni(r,a);for(const i of t){const t=e.project(i);t.outside||s.push(t)}}s.push(h),r=a,o=!1}}return s}}class Xo{static box(t,e,s,i,r){const o=Math.floor(Math.abs(s-t)/20),n=this.boxPoints(t,e,s,i,o);return this.coordsToPath(Xo.toPixelCoord(r,n))}static ellipse(t,e,s,i,r,o=40){const n=this.arcCoords(t+s/2,e+i/2,s/2,i/2,0,2*Math.PI,!0,o);return this.coordsToPath(Xo.toPixelCoord(r,n))}static geoCircle(t,e,s,i,r,o=!1,n=40){const a=this.arcCoords(t,e,s,i,0,2*Math.PI,!0,n);let h=this.toPixelCoord(r,a);return o&&(h=h.map((t=>[t[0],-t[1]]))),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof Ii?Uo.interpolate(e,t):e.map((e=>t.project(e)))}static coordsToPath(t){const e=[];let s=!1;for(const i of t){if(!!i.outside){s=!1;continue}const[t,r]=i;s?e.push("L",t,r):(e.push("M",t,r),s=!0)}return e}static horizontalLineToRight(t,e,s,i){const r=[];let o=e;for(;o<=s&&(r.push([o,t]),o+i<=s);)o+=i;return 0!==r.length&&r[r.length-1][0]===s||r.push([s,t]),r}static horizontalLineToLeft(t,e,s,i){const r=[];let o=s;for(;o>=e&&(r.push([o,t]),o-i>=e);)o-=i;return 0!==r.length&&r[r.length-1][0]===e||r.push([e,t]),r}static verticalLineToUp(t,e,s,i){const r=[];let o=e;for(;o<=s&&(r.push([t,o]),o+i<=s);)o+=i;return 0!==r.length&&r[r.length-1][1]===s||r.push([t,s]),r}static verticalLineToDown(t,e,s,i){const r=[];let o=s;for(;o>=e&&(r.push([t,o]),o-i>=e);)o-=i;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,s,i,r){const o=[],[n,a]=t<=s?[t,s]:[s,t],[h,l]=e<=i?[e,i]:[i,e];return r=Math.max(1,r),o.push(...this.horizontalLineToRight(h,n,a,r)),o.push(...this.verticalLineToUp(a,h,l,r)),o.push(...this.horizontalLineToLeft(l,n,a,r)),o.push(...this.verticalLineToDown(n,h,l,r)),o}static arcCoords(t,e,s,i,r,o,n,a=64){const h=2*Math.PI,l=o-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?n?-h:h:l;c||(n&&d>0&&(d-=h),!n&&d<0&&(d+=h));const _=d/a,u=[];for(let o=0;o<=a;o++){const n=r+_*o;u.push([t+Math.cos(n)*Math.abs(s),e+Math.sin(n)*Math.abs(i)])}return u}}class Ko extends Oo{constructor(e,s){super(e,s),this.add(this._text=new Pe(e,void 0)),this._text.anchor=t.TextAnchor.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options,o=r.effect;return this._model=e,this._text.setStyleOrClass(r.style),"background"===o?(this._outline&&this._outline.remove(),this._back||(this._back=new Je(t,"rm-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(r.backgroundStyle)):"outline"===o?(this._back&&this._back.remove(),this._outline||(this._outline=new Pe(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(r.style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?this._icon||(this.add(this._icon=new Po(t,!1)),this._icon.url=s,this._icon.width=r.width,this._icon.height=r.height||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){const e=this._model.options;if(t&&e.autoContrast&&this._text.setContrast(t,e.darkStyle||"rm-label-dark",e.lightStyle||"rm-label-light"),this._outline&&this._outline.parent){const t=Le.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const e=this._icon;let s=0;const i=this._text.bbox(),r=i.width,o=i.height;let n,a=r,h=o,l=0,c=0,d=0,_=0;if(this._box=void 0,e){const t=e.bbox();switch(s=b(this._model.options.iconGap,0),l=t.width,c=t.height,this._model.getIconPos()){case"left":case"right":a+=s+l,h=Math.max(c,o);break;default:h+=s+c,a=Math.max(l,r)}}if(this._back&&this._back.parent&&(n=getComputedStyle(this._back.dom),d=parseFloat(n.paddingLeft)||0,_=parseFloat(n.paddingTop)||0,this._back.setBounds(0,0,a+d+(parseFloat(n.paddingRight)||0),h+_+(parseFloat(n.paddingBottom)||0),n.rx)),e)switch(this._model.getIconPos()){case"left":e.trans(d,(h-c)/2),d+=l+s,a-=l+s;break;case"right":e.trans(d+a-l,(h-c)/2),a-=l+s;break;case"top":e.transX((a-l)/2),_+=c+s;break;case"bottom":e.trans((a-l)/2,_+o+s)}switch(n||(n=getComputedStyle(this._text.dom)),n.textAlign){case"center":d+=a/2,this._text.anchor=t.TextAnchor.MIDDLE;break;case"right":d+=a,this._text.anchor=t.TextAnchor.END;break;default:this._text.anchor=t.TextAnchor.START}return this._text.trans(d,_),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(d,_)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class qo extends Rt{renderLat(t,e,s,i,r){let o=r.project([e,t]),n=st(o)?`M${o[0]},${o[1]}`:"",a=e+i;const h=t=>{o=r.project(t),st(o)&&(n+=n?` L${o[0]},${o[1]}`:`M${o[0]},${o[1]}`)};for(;a<=s-i;)h([a,t]),a+=i;a<=s&&h([s,t]),this.setPath(n)}renderLatGlobe(t,e,s,i,r){let o,n=e,a=r.project([n,t]);for(;a.outside&&n<=s;)n+=i,a=r.project([n,t]);if(n<s){let e=`M${a[0]},${a[1]}`;for(n+=i;n<=s;)a=r.project([n,t]),a.outside?o=a:(o&&(e+=` M${o[0]},${o[1]}`,o=null),e+=` L${a[0]},${a[1]}`),n+=i;this.setPath(e)}}renderLon(t,e,s,i,r){let o=r.project([t,e]),n=st(o)?`M${o[0]},${o[1]}`:"",a=e+i;const h=t=>{o=r.project(t),st(o)&&(n+=n?` L${o[0]},${o[1]}`:`M${o[0]},${o[1]}`)};for(;a<=s-i;)h([t,a]),a+=i;a<=s&&h([t,s]),this.setPath(n)}renderLonGlobe(t,e,s,i,r){let o,n=e,a=r.project([t,n]);for(;a.outside&&n<=s;)n+=i,a=r.project([t,n]);if(n<s){let e=`M${a[0]},${a[1]}`;for(n+=i;n<=s;)a=r.project([t,n]),a.outside?o=a:(o&&(e+=` M${o[0]},${o[1]}`,o=null),e+=` L${a[0]},${a[1]}`),n+=i;this.setPath(e)}}}class Jo extends Fo{constructor(t,e){super(t,"rm-map-axis-grid"),this.second=e,this._latPool=new Ho(this,qo),this._lonPool=new Ho(this,qo)}_doInitStyles(){this.ignorePointer()}_doMeasure(t,e,s,i){return this.$_prepareLines(e,s,i),Ro.create(s,i)}_doLayout(t){const e=this.model,s=e.line,i=e.lonLine,r=e.latLine,o=e.chart.getProjection(this.second),n=o.isGlobe,a=this._bounds,h=a.step,l=1/this._scale;It.setImportantStyle(this.dom.style,"pointer-events","none"),It.setImportantStyle(this.dom.style,"fill","none"),this.setStyle("strokeWidth",`${l}px`);let c=a.x1,d=a.x2;n?this._latPool.forEach(((t,e,i)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLatGlobe(a.y1+e*h,c,d,h,o)})):this._latPool.forEach(((t,e)=>{const i=a.y1+e*h;i>a.y2||i<a.y1?t.visible=!1:(t.visible||(t.visible=!0),t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLat(i,c,d,h,o))}));let _=a.y1,u=a.y2;n?this._lonPool.forEach(((t,e,r)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(i._style),t.renderLonGlobe(a.x1+e*h,_,u,h,o)})):this._lonPool.forEach(((t,e)=>{const r=a.x1+e*h;r>a.x2||r<a.x1?t.visible=!1:(t.visible||(t.visible=!0),t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(i._style),t.renderLon(r,_,u,h,o))}))}$_prepareLines(t,e,s){const i=t.chart.map,r=t.getStep(i),{x1:o,x2:n,y1:a,y2:h}="map"===this.model.fitTo?this.$_calcBoundary(i,r):this.$_calcFullBoundary();this._latPool.prepare(h-a+1),this._lonPool.prepare(n-o+1),this._bounds={x1:Math.max(-180,o),y1:Math.max(-90,a),x2:Math.min(180,n),y2:Math.min(90,h),step:r}}$_calcBoundary(t,e){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class Qo extends Fo{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new Jo(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,s,i){return this._gridView.setVisible(e.grid.visible)&&this._gridView.measure(t,e.grid,s,i),Ro.create(s,i)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}}class tn extends Ko{}class en extends Fo{constructor(t,e){super(t),this.add(this._pathView=new Rt(t)),e.add(this._labelView=new tn(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,s,i){return this.setClass(e instanceof ri?"rm-axis-range-guid":"rm-axis-line-guide"),{width:s,height:i}}_doLayout(t){const e=this.model,s=e.options,i=this._pathView,r=this._labelView;let o,n=this._fromView,a=this._toView;if(i.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(s.label.text),"range"===s.type){const e=(parseFloat(getComputedStyle(i.dom).strokeWidth)||1)/t.tf.scale;n&&(n.remove(),a.remove(),this._fromView=this._toView=null),o=this.$_renderRange(s,t,r),i.setStyle("strokeWidth",`${e}px`)}else if("band"===s.type){n||(this.add(n=this._fromView=new Rt(this.doc)),this.add(a=this._toView=new Rt(this.doc))),n.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),n.setStyle("fill","none"),n.setStyle("transform",t.trans),a.setStyle("fill","none"),a.setStyle("transform",t.trans);const h=(parseFloat(getComputedStyle(n.dom).strokeWidth)||1)/t.tf.scale;n.setStyle("strokeWidth",`${h}px`),a.setStyle("strokeWidth",`${h}px`),o=this.$_renderBand(s,t,r),i.setStyle("stroke","none")}else{const e=(parseFloat(getComputedStyle(i.dom).strokeWidth)||1)/t.tf.scale;n&&(n.remove(),a.remove(),this._fromView=this._toView=null),o=this.$_renderLine(s,t,r),i.setStyle("fill","none"),i.setStyle("strokeWidth",`${e}px`)}i.setPath(o).setStyle("transform",t.trans)}$_renderLine(t,e,s){const{map:i,prj:r,step:o}=e;let n;if("lat"===t.axis){const r=t.position,a=i.h1,h=i.h2;n=Xo.horizontalLineToRight(r,a,h,o),this.$_renderLatLabel(a,r,e,s)}else{const a=t.position,h=i.v1,l=i.v2;n=Xo.verticalLineToUp(a,h,l,o),this.$_renderLonLabel(a,l,r,e.tf,s)}const a=n.map((t=>r.project(t)));return Xo.coordsToPath(a)}$_renderBand(t,e,s){const{map:i,prj:r,step:o}=e;let n=[];if("lat"===t.axis){const a=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=i.h1,c=i.h2;n.push(...Xo.horizontalLineToRight(a,l,c,o));const d=[...n];this._fromView.setPath(Xo.coordsToPath(d.map((t=>r.project(t))))),n.push(...Xo.verticalLineToUp(c,a,h,o));const _=Xo.horizontalLineToLeft(h,l,c,o);n.push(..._),this._toView.setPath(Xo.coordsToPath(_.map((t=>r.project(t))))),n.push(...Xo.verticalLineToDown(l,a,h,o)),this.$_renderLatLabel(l,h,e,s)}else{const a=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=i.v1,c=i.v2;n.push(...Xo.verticalLineToUp(a,l,c,o));const d=[...n],_=Xo.verticalLineToDown(h,l,c,o);n.push(..._),this._fromView.setPath(Xo.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(Xo.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(a,c,r,e.tf,s)}return Xo.coordsToPath(Xo.toPixelCoord(r,n))}$_renderRange(t,e,s){const{prj:i}=e;let r;const[o,n]=t.from,[a,h]=t.to;if(t.elliptic){const t=[Math.min(o,a),Math.min(n,h)],e=Math.abs(a-o),s=Math.abs(h-n);r=Xo.ellipse(t[0],t[1],e,s,i)}else r=Xo.box(o,n,a,h,i);if(s.visible){const t=Math.min(o,a),r=Math.max(n,h),l=i.project([t,r]);l.outside?s.visible=!1:s.visible||(s.visible=!0),s.trans(l[0]*e.tf.scale+e.tf.tx,l[1]*-e.tf.scale+e.tf.ty-s.bbox().height)}return r}$_renderLatLabel(t,e,s,i){if(!i.visible)return;const{prj:r,map:o,tf:n}=s;let a=0,h=0;const l=i.bbox(),c=r.project([o.h1,e]),d=r.project([t,e]);c.outside||d.outside?i.visible=!1:i.visible||(i.visible=!0),a=c[0]*n.scale+n.tx+16,h=d[1]*-n.scale+n.ty,h+=e>=0?0:-l.height,i.trans(a,h)}$_renderLonLabel(t,e,s,i,r){if(!r.visible)return;let o=0,n=0;const a=r.bbox(),h=s.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,o=l*i.scale+i.tx,n=c*-i.scale+i.ty+a.height/2,"line"===this.model.options.type?o+=t>=0?-a.width-6:6:o+=6,r.trans(o,n)}$_renderHorizontalLineToRight(t,e,s,i,r){let o="",n=e;const a=t=>{const e=i.project(t);st(e)&&(o+=` L${e[0]},${e[1]}`)};for(;n<s-r;)a([n,t]),n+=r;return n<=s&&a([s,t]),o}$_renderHorizontalLineToLeft(t,e,s,i,r){let o="",n=s;const a=t=>{const e=i.project(t);st(e)&&(o+=` L${e[0]},${e[1]}`)};for(;n>e+r;)a([n,t]),n-=r;return n>=e&&a([e,t]),o}$_renderVerticalLineToTop(t,e,s,i,r){let o="",n=e;const a=t=>{const e=i.project(t);st(e)&&(o+=` L${e[0]},${e[1]}`)};for(;n<=s-r;)a([t,n]),n+=r;return n<s&&a([t,s]),o}$_renderVerticalLineToBottom(t,e,s,i,r){let o="",n=s;const a=t=>{const e=i.project(t);st(e)&&(o+=` L${e[0]},${e[1]}`)};for(;n>=e+r;)a([t,n]),n-=r;return n>e&&a([t,e]),o}}class sn extends Oo{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new Je(t,"rm-crosshair-flag-back")),this.add(this._text=new Pe(t))}prepare(t){this.internalResetStyleOrClass(t.style),this._back.internalResetStyleOrClass(t.backgroundStyle)}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),s=parseFloat(e.paddingLeft)||0,i=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+s+(parseFloat(e.paddingRight)||0),r.height+i+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(s+r.width/2,i)}renderLonFlag(t,e,s,i,r,o,n){const a=e.project([i,s]),h=e.project([i,r]),l=this.prepareLabel(t);this.trans(Math.min(o-l.width,Math.max(0,n.tx+h[0]*n.scale-l.width/2)),Math.max(0,n.ty-a[1]*n.scale-l.height))}renderLatFlag(t,e,s,i,r,o){const n=e.project([s,i]),a=this.prepareLabel(t);this.trans(Math.max(0,o.tx+n[0]*o.scale-a.width),Math.max(0,Math.min(r-a.height,o.ty-n[1]*o.scale-a.height/2)))}renderGlobeLonFlag(t,e,s,i){const r=this.prepareLabel(t),o=e.rotationY<=0,n=e.project([0,o?90:-90]);this.trans(i.tx+n[0]*i.scale,Math.min(s-r.height,Math.max(0,i.ty-n[1]*i.scale-r.height/2)))}renderGlobeLatFlag(t,e,s,i,r,o,n,a){const h=e.project([s,i]),l=e.project([n,i]),c=this.prepareLabel(t);this.trans(Math.min(r-c.width,Math.max(0,a.tx+h[0]*a.scale)),Math.max(0,Math.min(o-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class rn extends Fo{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new qo(t,"rm-crosshair-line")),this.add(this._lonLine=new qo(t,"rm-crosshair-line")),It.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),It.setImportantStyle(this._latLine.dom.style,"fill","none"),It.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),It.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new sn(t)),this.add(this._lonFlag=new sn(t))}prepare(t,e){this._latLine.internalClearStyles();const s=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.setStyle("transform",e),this._lonLine.setStyle("transform",e),this._latLine.setStyle("strokeWidth",`${s}px`),this._lonLine.setStyle("strokeWidth",`${s}px`),this._latFlag.prepare(this.model.flag.options),this._lonFlag.prepare(this.model.flag.options),this}render(t,e){var s,i,r;const o=this.model,n=o.chart.map,a=t[0],h=t[1],l=this._lonLine,c=this._latLine,d=this._lonFlag,_=this._latFlag;null!==(r=null===(i=null===(s=o.chart.axis)||void 0===s?void 0:s.grid)||void 0===i?void 0:i.getStep(n))&&void 0!==r||rn.DEFAULT_STEP;const u=rn.LINE_STEP,p="map"===o.axis.grid.fitTo,g=p?n.h1:-180,m=p?n.h2:180,f=p?n.v1:-90,b=p?n.v2:90;this._bounds={x1:g,x2:m,y1:f,y2:b};const y=[l,d,c,_],w=y.reduce(((t,e)=>t&&e.visible),!0);if(!(g<=a&&a<=m&&f<=h&&h<=b))return void y.forEach((t=>t.setVisible(!1)));w||y.forEach((t=>t.setVisible(!0)));const x=this.model.chart.getProjection(!1),v=x instanceof Ii?x:new x.constructor;v.offset=x.offset,this.$_renderLon(t,u,e,v),this.$_renderLat(t,u,e,v)}$_renderLon(t,e,s,i){const r=this.model,o=r.chart.map,n=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=i instanceof Ii;_?l.renderLonGlobe(h,n,a,e,i):l.renderLon(h,n,a,e,i);const u=this.calcTopY(s,o,i,n),p=this.calcScrolledLon(r,h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,i,d.height,s):c.renderLonFlag(g,i,a,h,u,d.width,s)}calcScrolledLon(t,e){let s=e+t.chart.getProjection(!1).scroll;return s=(s%360+360)%360,s>180&&(s-=360),s}$_renderLat(t,e,s,i){const r=this.model,o=r.chart.map,n=this._bounds.x1,a=this._bounds.x2,h=t[1],l=this._latLine,c=this._latFlag,d=r.getFlag(h),_=this.parent,u=i instanceof Ii;u?l.renderLatGlobe(h,n,a,e,i):l.renderLat(h,n,a,e,i);const p=u?90-i.rotationX:n,g=i.project(t),m=this.calcRightX(s,i,_,o,g[1]);u?c.renderGlobeLatFlag(d,i,p,h,_.width,_.height,m,s):c.renderLatFlag(d,i,p,h,_.height,s)}calcTopY(t,e,s,i){const r=[(t.vx-t.tx)/t.scale,(t.vy-t.ty)/-t.scale];let o=[NaN,NaN];const n=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=s.backward(r);if(!Number.isNaN(t[1])){o=t;break}r[0]+=n}return Number.isNaN(o[1])?i:o[1]}calcRightX(t,e,s,i,r){const o=[(s.width-t.vx-t.tx)/t.scale,r];let n=e.backward(o);return Number.isNaN(n[0])?i.x2:n[0]}}rn.LINE_STEP=1,rn.DEFAULT_STEP=1;const on="rm_map_globe_fill";class nn extends Rt{constructor(t){super(t,"rm-map-background")}render(t,e,s,i,r,o){const n=e.map,a=this.parent,h=e.body.projection;n||this.setPath("");const l=e.body.mapBackground;let c;if(this.internalClearStyles(),a.isProjectionChanged&&this.transEx(0,0).scale(1),e.isGlobe)c=this.$_renderGlobeBg(t,l,c,r,o,s,i);else if(e.body.projection.isElliptic){const t=e.body.projection.getClipBounds();c=`M${t[0][0]},${t[0][1]} L`+t.slice(1).map((t=>`${t[0]},${t[1]}`)),this.internalSetStyleOrClass(l._style)}else this.internalSetStyleOrClass(l._style),c=Ct.rectangle(s,i,r,o);if(this.setPath(c),h.isElliptic&&!(h instanceof Ii)){const{tx:t,ty:e,scale:s}=a.transformInfo;this.transEx(t,e).scale(s)}}$_renderGlobeBg(t,e,s,i,r,o,n){const a=e.options.globeFill,h=Math.max(i,r)/2;if(s=Ct.circle(o+h,n+h,h),a!==this._globeFill){if(this.control.removeDef(on),a){const e={id:on,cx:"0.4",cy:"0.4",r:"1",color:["white",a]};this.control.addDef(new Xt(e).getElement(t,e))}this._globeFill=a}return a&&this.setFill(`url(#${on})`),this.internalSetStyleOrClass(e._style),s}}class an extends Rt{constructor(t,e,s){super(t,e),this.setLine(s)}setLine(t,e,s,i){dt.isNum(t)?this.setPath(Ct.line(t,e,s,i)):t&&this.setPath(Ct.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Ct.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(Ct.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Ct.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(Ct.line(e,t,s,t))}}class hn extends Rt{constructor(t,e,s,i){super(t,e),s&&this.setLines(s,i)}setLines(t,e){dt.isNum(t[0])?this.setPath(Ct.lines(...t)):this.setPath(Ct.lines2(...t))}}var ln;class cn extends Ho{constructor(t,e){super(t,e,void 0,0)}_getElementId(t){return t.point.pid}}class dn extends Ko{constructor(t){super(t,"rm-point-label")}}class _n extends Et{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new Ho(this,dn),new Ho(this,dn)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareLabel(t,e,s,i,r,o){const n=r.getPointText(i,s,o.options.text);e.point=i,e.setModel(t,o,null,null),e._text.internalResetStyleOrClass(o._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),n?(o.prepareRich(n),o.buildSvg(e._text,e._outline,NaN,NaN,o,o.getTextDomain(i))):(e.setText(o.getText(o.getValue(i,s))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const s=e.model,i=s.getPointLabels(),r=s.pointLabelCount(),o=this._labels,n=s.getLabeledPoints(),a=this._maps,h=i[0]._style;o[0].prepare(n.length),a[0]={},o[1].prepare(r>1?n.length:0),a[1]={},n.forEach(((r,n)=>{for(let h=0;h<r.labelCount();h++){const l=o[h].get(n);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,s,i[h]),a[h][r.pid]=l)}})),this.setStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class un extends Oo{constructor(t){super(t),this.add(this._line=new hn(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Rt(t)),this._dummy.setStyle("visibility","hidden"),this.add(this._anchor=new Rt(t,"rm-callout-anchor"))}render(t,e,s,i){const r=t.options,o=t.series,n=this._anchor,a=this._line;if(this._dummy.setPath(Ct.circle(0,0,1e4)),this._dummy.trans(s[0],s[1]),n.setVisible(t.anchorPoint.visible)){const i=yn.getDrawer(t.series.getCalloutShape(e)),a=t.anchorPoint.options.radius;n.internalClearStyleAndClass(),r.useSeriesColor&&n.internalSetStyleOrClass(o._style),n.internalSetStyleOrClass(t.anchorPoint._style),n.setPath(i(a,a)),n.trans(s[0],s[1])}return a.internalClearStyleAndClass(),r.useSeriesColor&&this._line.internalSetStyleOrClass(o._style),a.internalSetStyleOrClass(t._style),a.setLines(s,!1),i&&r.usePointColor&&(n.visible&&n.setFill(i),a.setStroke(i)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class pn extends Ot{constructor(t){super(t),this.add(this._back=new Je(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Rt(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,s){return this._mask.setPath(Ct.circle(t,e,s)),this}setRects(t,e){return t&&e?this._mask.setPath(Ct.rect(t).concat(Ct.rect(e))):this._mask.setPath(Ct.rect(t)),this}}class gn extends Et{constructor(t,e){super(t,e),this._callouts=new Ho(this,un),this._map={},this.add(this._maskLayer=new Et(t)),this._masks=new Ho(this._maskLayer,pn),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,s=t.callout,i=this._callouts,r=this._masks,o=t.getLabeledPoints(),n=s._style,a=this._map={};r.prepare(o.length,(t=>{})),i.prepare(o.length),o.forEach(((t,s)=>{const o=i.get(s);o.setVisible(e.isPointCalloutVisible(t))&&(o.setAttr("mask",`url(#${r.get(s).id}`),o.index=s,a[t.pid]=o)})),this.setStyleOrClass(n)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){return this._map[t.pid]}setMask(t,e){const s={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},i=this._masks.get(t.index);return i.setBackground(s),i}}class mn extends $t{constructor(t,e=!1){super(t,yn.POINT_CLASS,e)}tooltipColor(){return this.getFill()}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void i.line(t[r+1].x,t[r+1].y);const o=.35,n={x:0,y:0},a={x:0,y:0},h={x:0,y:0},l={x:t[r+1].x-t[r].x,y:t[r+1].y-t[r].y};let c={x:0,y:0},d=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=d,l.y/=d;let _=t[r+1].x-t[r].x,u=t[r].x,p=t[r].y;for(++r;r!=s;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].x-t[r].x,l.y=t[r+1].y-t[r].y,d=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=d,l.y/=d,l.x<h.x?(c.x=h.x-l.x,c.y=h.y-l.y):(c.x=l.x-h.x,c.y=l.y-h.y);const e=Math.sqrt(c.x*c.x+c.y*c.y);c.x/=e,c.y/=e,h.y*l.y>=0&&(c={x:1,y:0}),n.x=-c.x*_*o,n.y=-c.y*_*o;const s=u+a.x,g=p+a.y,m=t[r].x+n.x,f=t[r].y+n.y;i.curve(s,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*o,a.y=c.y*_*o,u=t[r].x,p=t[r].y}i.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}}class fn extends Et{}const bn={};class yn extends jo{static register(...t){t.forEach((t=>{bn[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof yn)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>Ct[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,s=!0){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,s,i)=>({x:t-s/2,y:e-i}),bottom:(t,e,s,i)=>({x:t-s/2,y:e}),center:(t,e,s,i)=>({x:t-s/2,y:e-i/2}),left:(t,e,s,i)=>({x:t-s,y:e-i/2}),right:(t,e,s,i)=>({x:t,y:e-i/2})},this._labelPositioner={bottom:(t,e,s,i,r,o)=>({x:t-=s.width/2,y:e+=r+o}),top:(t,e,s,i,r,o)=>({x:t-=s.width/2,y:e-=r+o+s.height}),right:(t,e,s,i,r,o)=>({x:t+=i+o,y:e-=s.height/2}),left:(t,e,s,i,r,o)=>({x:t-=i+o+s.width,y:e-=s.height/2}),center:(t,e,s,i,r,o)=>({x:t-=s.width/2,y:e-=s.height/2+o})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointLayer=new Et(t)),this._pointLayer.add(this._pointContainer=new fn(t,"rm-series-points")),this.add(this._calloutContainer=new gn(t,"rm-series-callouts")),s&&(this._labelContainer=new _n(t,e))}_setCalcedColor(t,e){const s=getComputedStyle(e);t.setCalcedColor(s,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepare(t,e){const s=e._optionsDirty||e._dataSourceDirty||e._zindexDirty,i=this._labelContainer,r=this._calloutContainer;this.setModel(e),e instanceof Zr?this.setData("index",e.seriesIndex%10):this.setData("index",e.seriesIndex%12),null==i||i.setVisible(e.isPointLabelsVisible()),r.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),null==i||i.prepare(t,this),r.prepare(t,this)):((null==i?void 0:i.isEmpty())&&i.prepare(t,this),r.isEmpty()&&r.prepare(t,this)),isNaN(this._aniOpacity)||this.setStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,s=e._optionsDirty||e._dataSourceDirty;s&&this._doPrepeare(t,e,s)}render(t,e){this._wBody=t,this._hBody=e,this._doRender(this.width,this.height),this._animatable&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable())}reset(){this._doReset()}isPointLabelVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}isPointCalloutVisible(t){return t.visible&&!t.isNull&&this.model.isPointCalloutVisible()}setScaler(t){this._scaler=t}getPointView(t){var e;return null===(e=this._getPointPool())||void 0===e?void 0:e.elementOf(t)}pointerMoved(t,e,s){return this._doPointerMoved(t,e,s)}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}defaultAnimation(){return"grow"}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))}pointByDom(t){return this._getPointPool().elementOf(t)}click(t){const e=this.pointByDom(t);e&&(e.point?!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e):this._doPointClicked(e))}select(t,e){const s=this.pointByDom(t);s&&this.chart().selection.add(this.model,s.point,e)}toggleSelect(t){const e=this.pointByDom(t);e&&this.chart().selection.toggle(this.model,e.point)}runPointAddAnimation(t){}get growRate(){return this._growRate}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_getPointPositioner(t,e){return this._pointPositioner[t]||this._pointPositioner[e]}_getLabelPositioner(t,e){return this._labelPositioner[t]||this._labelPositioner[e]}_labelViews(){return this._labelContainer.setVisible(this.model.isPointLabelsVisible()),this._labelContainer.visible?this._labelContainer:void 0}_calloutViews(){return this._calloutContainer.setVisible(this.model.isPointCalloutVisible()),this._calloutContainer.visible?this._calloutContainer:void 0}_getPointPool(){}_collectVisPoints(t){return t._visPoints}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s){if(t.setAttrEx("aria-label",s.ariaHint()),t.internalClearStyleAndClass(),s._runColor)this._setPointColor(t,s._runColor);else{const i=e.getRangedColor(s);i&&this._setPointColor(t,i)}const i=e.getPointStyle(s);i&&t.internalSetStyleOrClass(i)}_doPointerMoved(t,e,s){return!1}_getGrowRate(){return b(this._growRate,1)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_getShowAnimation(){}_runShowEffect(t){}_animationStarted(t){this._animations.push(t)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}_layoutLabel(t,e){return t.setContrast(e).layout()}_legendColorProp(){return"fill"}_doPointClicked(t){t&&t.point&&dt.log("CLICKED: ",t.point.name,t.point.getValue())}}ln=yn,yn.POINT_CLASS="rm-point",yn.DATA_HOVER="hover",yn.DATA_UNHOVER="unhover",yn.LEGEND_MARKER="rm-legend-item-marker",yn._drawers=Object.assign({circle:t=>Ct.circle(0,0,t)},ln._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class wn extends mn{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return 0}}class xn extends yn{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}}class vn extends mn{prepare(t,e){return this.point=t,this._ext=dt.getMinMax(t.values),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Cn extends yn{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.options.minSize}}}class Sn extends vn{constructor(t){super(t,!0),this.add(this._contentLayer=new Et(t)),this.add(this._baseLine=new an(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,s,i){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(i,0,s)}}class Ln extends Cn{_getSeriesExt(t,e){const s=super._getSeriesExt(t,e);return t._pointDomain||(s.min=Math.min(s.min,b(t._minValue,s.min)),s.max=Math.max(s.max,b(t._maxValue,s.max))),s}_doPrepeare(t,e,s){!this._ext||s?this._ext={...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height}:(this._ext.width=e._width,this._ext.height=e._height)}}class An extends mn{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return 0}}class Mn extends yn{constructor(t,e){super(t,e),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class kn extends Zo{constructor(t){super(t,kn.CLASS_NAME),this.add(this._imageView=new Po(t,!1)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,s,i){const r=e.getSize(s,i);return this._deflatePaddings(r),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(r.width,r.height),ut(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}kn.CLASS_NAME="rm-image-annotation";class Pn extends Zo{constructor(t){super(t,Pn.CLASS_NAME),this.add(this._shapeView=new Rt(t))}_doMeasure(t,e,s,i){const r=e.getSize(s,i);return this._deflatePaddings(r),Ct.setShape(this._shapeView,e.getShape(),r.width/2,r.height/2),r}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Pn.CLASS_NAME="rm-shape-annotation";class In extends Zo{constructor(e){super(e,In.CLASS_NAME),this.add(this._textView=new Pe(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new Oe}_doMeasure(t,e,s,i){const r=e.options,o=e.getSize(s,i),n=this._textView;r.writingMode&&this._textView.setStyle("writingMode",r.writingMode),r.textOrientation&&this._textView.setStyle("textOrientation",r.textOrientation),this._deflatePaddings(o),this._richText.setFormat(r.text),this._richText.build(n,s,i,null,e._domain);const a=ut(this._textView.bbox());return{width:b(o.width,a.width),height:b(o.height,a.height)}}_doLayout(t){this._richText.layout(this._textView,getComputedStyle(this._textView.dom).textAlign,this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}In.CLASS_NAME="rm-text-annotation";class Nn{static reveal(t,e){new Vn(t,e)}static grow(t,e){new Dn(t,e)}static spread(t,e){new Rn(t,e)}static fadeIn(t){new Tn(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);window.Animation&&s instanceof Animation&&(s.addEventListener("finish",(()=>{t._animationFinished(s)})),t._animationStarted(s))}}class Tn extends Nn{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:mt.DURATION,fill:"none"})}}let Vn=class extends Nn{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return null==i||i.addEventListener("finish",(()=>{s.dom.remove()})),i}$_aniOptions(t){return{duration:mt.DURATION,fill:"none"}}$_clipRect(t){const e=t.control;return t.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:O(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}};class En extends mt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Vt}_stop(){super._stop(),this._series=null}}class Dn extends En{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Rn extends En{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class $n extends Rt{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,s,i,r,o){this.x=t,this.setPath(Ct.bar(t-s/2,e,s,-i,r,o))}}class On extends Sn{constructor(t){super(t),this._bars=new Ho(this._contentLayer,$n)}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}render(t,e,s,i,r,o){const n=t._categories||[],{min:a,max:h,base:l}=t.getPointExtents(s,e),c=i/s.length,d=c*t.options.barWidth;this._bars.forEach(((t,e)=>{const i=s[e];if(t.setVisible(!isNaN(i))){const s=c*e+(c-d)/2,l=(i-a)/(h-a)*r*o;t.setPath(Ct.bar(s,r,d,-l,0,0)),t.internalClearStyleAndClass(),n[e]&&n[e].color&&t.setFill(n[e].color)}})),this._renderBaseLine(t.baseLine,!1,i,r)}}class Fn extends wn{tooltipColor(){return getComputedStyle(this.dom).fill}}class Bn extends Rt{static create(t,e,s,i,r,o,n,a,h=!0){return new Bn(t,e,{cx:s,cy:i,rx:r,ry:o,innerRadius:0,start:n,angle:a,clockwise:h})}static createInner(t,e="",s,i,r,o,n,a,h,l=!0){return new Bn(t,e,{cx:s,cy:i,rx:r,ry:o,innerRadius:n,start:a,angle:h,clockwise:l})}constructor(t,e=M,s=M){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 Ct.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 Ct.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 zn=function(t){return isNaN(t)?0:t};class jn{constructor(){this._path=[]}clear(){return this._path=[],this}end(t=!1){t&&this._path.push("Z");const e=this._path.join(" ");return this._path=[],e}close(){return this.end(!0)}move(t,e){return a(t)?this._path.push("M",zn(t),zn(e)):this._path.push("M",zn(t.x),zn(t.y)),this}moveBy(t,e){return a(t)?this._path.push("m",zn(t),zn(e)):this._path.push("m",zn(t.x),zn(t.y)),this}movep(t,e){return a(t)?this._path.push("M",F(t),F(e)):this._path.push("M",F(t.x),F(t.y)),this}line(t,e){return a(t)?this._path.push("L",zn(t),zn(e)):this._path.push("L",zn(t.x),zn(t.y)),this}linep(t,e){return a(t)?this._path.push("L",F(t),F(e)):this._path.push("L",F(t.x),F(t.y)),this}curve(t,e,s,i,r,o){return this._path.push("C",t,e,s,i,r,o),this}q(t,e,s,i){return this._path.push("Q",t,e,s,i),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",zn(t[e]),zn(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",zn(t[e].x),zn(t[e].y));return this}polygon(...t){return this.lines(...t),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}}class Hn extends Rt{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new jn;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let Gn=class extends Rt{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new jn).circle(0,0,s).end())),this.internalResetStyleOrClass(t._style),this}};class Yn extends An{constructor(t){super(t),this.add(this._faceView=new Bn(t,"rm-circle-gauge-face")),this.add(this._rimView=new Bn(t,"rm-circle-gauge-rim")),this.add(this._valueView=new Bn(t,"rm-circle-gauge-value")),this.add(this._textView=new Pe(t,"rm-circle-gauge-text")),this.add(this._handContainer=new Et(t))}prepare(t,e){this._faceView.setVisible(e.face.visible),this._rimView.setVisible(e.rim.visible),this._valueView.setVisible(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new Hn(t,"rm-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new Gn(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible)&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,s,i){const r=t._props.getCenter(e,s),o=t._props.getExtents(p(e,s));this.$_renderBackground(t,r,o),this.$_renderValue(t,this.point,i)}$_renderBackground(t,e,s){const i=this._faceView,r=this._rimView,o=t._props,n=o._startRad;this._center=e,this._exts=s,i.visible&&(i.internalResetStyleOrClass(t.face._style),i.setSector({cx:e.x,cy:e.y,rx:s.radius-s.radiusThick,ry:s.radius-s.radiusThick,innerRadius:0,start:0,angle:2*Math.PI})),r.visible&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:e.x,cy:e.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:n,angle:o._sweepRad,clockwise:t.options.clockwise}));let a=s.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,s){const i=t.options,r=t._props,o=e.getValue(),n=t.getValueRate(o)*s,a=this._center,h=this._exts,l=t.valueRim.getThickness(h.radiusThick),c=this._textView;if(this._valueView.visible){const e=t.valueRim,s=e.options,o=h.value+(s.stroked?0:l/2),c=this._valueView;c.internalResetStyleOrClass(e._style),s.stroked&&(c.setFill("none"),c.setStyle("strokeWidth",O(l))),c.setBoolData("stroked",s.stroked),c.setSectorEx({cx:a.x,cy:a.y,rx:o,ry:o,innerRadius:(o-l)/o,start:r._startRad,angle:r._sweepRad*n,clockwise:i.clockwise},s.stroked)}if(c.visible){const e=t.gaugeLabel;c.text=e.getNumberText(o,!1,!1,void 0),e.buildSvg(c,null,NaN,NaN,t,e._domain);const s=c.bbox(),i=e.getOffset(this.width,this.height);c.trans(a.x+i.x,a.y-s.height/2+i.y)}}}class Wn extends Vt{constructor(t,e,s,i,r){super(t,e,"circle"),"number"==typeof s&&this.setCircle(s,i,r)}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Zn extends mt{constructor(t,e){super(),this.view=t,this.gauge=e}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.gauge,this.view._exts),!0}}class Un extends An{constructor(e){super(e),this._rimThick=0,this._secRate=1,this.add(this._faceView=new Wn(e,"rm-clock-gauge-face")),this.add(this._rimView=new Bn(e,"rm-clock-gauge-rim")),this.add(this._labelView=new Pe(e,"rm-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,this.add(this._tickContainer=new Et(e,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new Et(e,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Rt(e,"rm-clock-gauge-hour")),this.add(this._minuteView=new Rt(e,"rm-clock-gauge-minute")),this.add(this._secondView=new Rt(e,"rm-clock-gauge-second")),this.add(this._pinView=new Wn(e,"rm-clock-gauge-pin")),this._tickViews=new Ho(this._tickContainer,an,"rm-clock-gauge-tick"),this._tickLabelViews=new Ho(this._tickLabelContainer,Pe,"rm-clock-gauge-tick-label")}prepare(e,s){const i=Math.round(12/g(1,Math.floor(s.tickLabel.options.step)||1));this._tickViews.prepare(s.tick.visible?12:0),this._tickLabelViews.prepare(s.tickLabel.visible?i:0,(e=>{e.layout=t.TextLayout.MIDDLE})),this._zoneCallback=s.options.timezoneCallback}render(t,e,s){const i=this.point,r=this._exts=t.getExtents(e,s);this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.options.active&&isNaN(+i.time)?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),m(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.options.animatable&&this.$_moveSecond(t,e)}),1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,i=this._faceView,r=this._rimView,o=this._tickLabelViews,n=this._pinView,{cx:a,cy:h,rd:l}=e,c=this._rimThick=r.visible?t.rim.getThickness(l):0,d=t.tick.options.length||0;i.setVisible(t.face.visible)&&(i.internalResetStyleOrClass(t.face._style),i.setCircle(a,h,l)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:l,ry:l,innerRadius:1-c/l,start:0,angle:2*Math.PI,clockwise:!0}));const p=l-c;let g=p-d,m=N,f=I/12;if(this._tickViews.forEach(((e,s)=>{e.setLine(a+_(m)*p,h+u(m)*p,a+_(m)*g,h+u(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!o.isEmpty){const e=12/o.count,s=I/12*e;m=N,o.get(0).text="12",g=p-(d+t.tickLabel.options.offset||0),g-=.5*o.get(0).bbox().height,o.forEach(((i,r,o)=>{i.text=String(0===r?12:r*e),i.trans(a+_(m)*g,h+u(m)*g),i.internalResetStyleOrClass(t.tickLabel._style),m+=s}))}n.setVisible(t.pin.visible)&&(n.setCircle(a,h,t.pin.options.radius||2),n.internalResetStyleOrClass(t.pin._style)),s.setVisible(t.gaugeLabel.visible)&&(s.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(s,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.options.position?s.trans(a,h+g/2):s.trans(a,h-g/2))}$_getNow(t){var e;let s=t.getTime();if(!s){s=new Date;const i=y(t.timezone,null===(e=this._zoneCallback)||void 0===e?void 0:e.call(this,t.coord[0],t.coord[1]),60*Math.round(t.coord[0]/15)),r=s.getMinutes()+s.getTimezoneOffset()+i;s.setMinutes(r)}return s}$_renderHands(t,e){const s=this.$_getNow(this.point),i=s.getHours(),r=s.getMinutes(),o=s.getSeconds(),n=i>=12,{cx:a,cy:h,rd:l}=e,c=new jn;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=I*(i/12+r/60/12+o/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),n&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*V)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=I*(r/60+o/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),n&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*V)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?I*(this._aniSec+this._secRate)/60:I*o/60,u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),n&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*V),this._prevSec=o)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const s=new Zn(this,t);s.duration=t.secondHand.options.duration||200,s.start()}}}const Xn="rm-map-series-id-";let Kn=class t extends mn{static idClass(t){return Xn+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(Xn))return e.substring(17)}constructor(t){super(t)}render(e,s,i){const r=this.model,o=!this.point||this.point.isNull;e!==r&&this.setPath((this.model=e).path),i&&(this.setBoolData("null",o),o&&s&&this.internalSetStyleOrClass(s),this.dom.classList.add(t.idClass(e)))}reset(){this.model=null}};class qn extends mn{constructor(t){super(t,!0),this.add(this._figure=new Rt(t)),this.add(this._textView=new Ko(t,"rm-figure-series-inner-label"))}render(t,e,s){const i=this._textView,r=s.options.text;this._figure.setPath(e),i.internalResetStyleOrClass(s._style),i.setModel(t,s,null,null),s.prepareRich(r),s.buildSvg(i._text,i._outline,NaN,NaN,s,s.getTextDomain(this.point)),i.layout();const o=this.bbox(),n=i.bbox(),a=It.getPadding(i._text.dom),h=o.width-a.left-a.right,l=o.height-a.top-a.bottom;i.trans(a.left+(h-n.width)/2,(l-n.height)/2+a.top)}layout(){const t=this._textView,e=this.bbox(),s=t.bbox(),i=It.getPadding(t._text.dom),r=e.width-i.left-i.right,o=e.height-i.top-i.bottom;t.trans(i.left+(r-s.width)/2,(o-s.height)/2+i.top)}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class Jn extends mn{constructor(t){super(t,!0),this.add(this._imageView=new Po(t,!1))}setImage(t,e,s){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(s)||(this._imageView.height=s)}}let Qn=class extends Sn{constructor(t){super(t),this._contentLayer.addAll(this._back=new Je(t),this._area=new Rt(t,"rm-line-series-area"),this._line=new Rt(t,"rm-line-series-line"),this._lowLine=new Rt(t))}render(t,e,s,i,r,o){const{min:n,max:a,base:h}=t.getPointExtents(s,e),l=this.$_getPts(s,n,a,i,r),c=s.length,d=c>2&&t.options.curved,_=new jn;if(this.resize(i,r),this._back.setVisible(!1)&&(this._back.resize(i,r),this._back.setStroke("none")),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}if(this._line.setPath(_.end()),this._area.setVisible(t.area.visible)){if(this._area.internalResetStyleOrClass(t.area._style),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}_.line(l[c-1].x,r),_.line(l[0].x,r),this._area.setPath(_.end(!0))}this._renderBaseLine(t.baseLine,!1,i,r)}$_getPts(t,e,s,i,r){const o=t.length,n=[];let a=.05*i,h=.1*r;const l=s-e;i-=.1*i,r-=.2*r;for(let s=0;s<o;s++){const c=t[s],d=a+s/(o-1)*i,_=h+(isNaN(c)||0==l?r:(1-(c-e)/l)*r);n.push({x:d,y:_})}return n}};class ta{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),s=this.$_left(t,e);return null==s||s.addEventListener("finish",(()=>{e.dom.remove()})),s}$_aniOptions(){return{duration:mt.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions())}}const ea="rm-map-series-id-";class sa extends mn{static idClass(t){return ea+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(ea))return e.substring(17)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,s){const i=this.point;if(s){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.setBoolData("selected",!1),this.internalSetStyleOrClass(e);else{const e=!this.point||i.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(sa.idClass(this.model))}this.setBoolData("selected",i&&i._selected)}reset(){this.model=null}}class ia extends Rt{constructor(t){super(t,"rm-map-series-inset")}render(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=Q(t.frame),o=e.model,n=o.h1-r.l,a=o.h2+r.r,h=o.v2+r.t,l=o.v1-r.b,c=[s.project([n,h]),s.project([a,h]),s.project([a,l]),s.project([n,l])];i=`M${c[0][0]} ${c[0][1]} L${c[1][0]} ${c[1][1]} ${c[2][0]} ${c[2][1]} ${c[3][0]} ${c[3][1]} Z`}else if(t.border){const r=n(t.border)?vi(t.border,e.model):t.border,o=r.length;let a=s.project([r[0],r[1]]);i=`M${a[0]} ${a[1]}`;for(let t=2;t<o;t+=2)a=s.project([r[t],r[t+1]]),i+=` L${a[0]} ${a[1]}`;"z"===r[o-1]&&(i+=" z")}i&&this.setPath(i)}}render2(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=Q(t.frame);let o=1/0,n=1/0,a=-1/0,h=-1/0;for(const t of e){const e=t.model;o=p(o,e.h1),n=p(n,e.v1),a=g(a,e.h2),h=g(h,e.v2)}const l=o-r.l,c=a+r.r,d=h+r.t,_=n-r.b,u=[s.project([l,d]),s.project([c,d]),s.project([c,_]),s.project([l,_])];i=`M${u[0][0]} ${u[0][1]} L${u[1][0]} ${u[1][1]} ${u[2][0]} ${u[2][1]} ${u[3][0]} ${u[3][1]} Z`}else if(t.border){let r=1/0,o=1/0,a=-1/0,h=-1/0;for(const t of e){const e=t.model;r=p(r,e.h1),o=p(o,e.v1),a=g(a,e.h2),h=g(h,e.v2)}const l=n(t.border)?vi(t.border,{h1:r,h2:a,v1:o,v2:h}):t.border,c=l.length;let d=s.project([l[0],l[1]]);i=`M${d[0]} ${d[1]}`;for(let t=2;t<c;t+=2)d=s.project([l[t],l[t+1]]),i+=` L${d[0]} ${d[1]}`;"z"===l[c-1]&&(i+=" z")}i&&this.setPath(i)}}render3(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=t.offset||[0,0],o=Q(t.frame),n=e.h1+(r[0]||0)-o.l,a=e.h2+(r[0]||0)+o.r,h=e.v2+(r[1]||0)+o.t,l=e.v1+(r[1]||0)-o.b,c=[s.project([n,h]),s.project([a,h]),s.project([a,l]),s.project([n,l])];i=`M${c[0][0]} ${c[0][1]} L${c[1][0]} ${c[1][1]} ${c[2][0]} ${c[2][1]} ${c[3][0]} ${c[3][1]} Z`}else if(t.border){const r=t.offset||[0,0],o=n(t.border)?vi(t.border,e):t.border,a=o.length;let h=s.project([o[0]+(r[0]||0),o[1]+(r[1]||0)]);i=`M${h[0]} ${h[1]}`;for(let t=2;t<a;t+=2)h=s.project([o[t]+(r[0]||0),o[t+1]+(r[1]||0)]),i+=` L${h[0]} ${h[1]}`;"z"===o[a-1]&&(i+=" z")}i&&this.setPath(i)}}}class ra extends Fo{constructor(t,e,s){super(t,e),this._paddings=new $o,this.add(this._background=new Rt(t,s)),this.add(this._textView=new Pe(t))}setPoint(t){return this._point=t,this}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e);const r=e.options.text;r?(e.prepareRich(r),e.buildSvg(this._textView,s,i,e.getTextDomain(this._point))):this._textView.text="";const n=this._textView.bbox();let a=this.model.options.backgroundStyle;o(a)&&(a=a(e.series.getPointCallbackArgs(this._point))),this._background.internalClearStyleAndClass(),this._setBackgroundStyle(this._background,a);let h=getComputedStyle(this._background.dom);const l=this._paddings;l.applyPadding(h);const c=this._doMeasure(t,e,s,i);return this.mw=c.width=l.left+l.right+n.width,this.mw=c.height=l.top+l.bottom+n.height,c}_doLayout(e){const s=this._textView,i=this.width;let r=0;this._renderBackgrouond(this._background,i,this.height,e);switch(getComputedStyle(s.dom).textAlign){case"center":r+=i/2,s.anchor=t.TextAnchor.MIDDLE;break;case"right":r+=i,s.anchor=t.TextAnchor.END;break;default:s.anchor=t.TextAnchor.START}s.trans(r,this._paddings.top)}}class oa extends ra{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){this.model.options.backgroundStyle,t.setStyleOrClass(e)}_renderBackgrouond(t,e,s,i){t.setPath(Ct.bar(0,s,e,-s,i,0))}}class na extends ra{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.setStyleOrClass(e)}_renderBackgrouond(t,e,s,i){t.setPath(Ct.bar(0,s,e,-s,0,i))}}class aa extends mn{constructor(t){super(t,!0),this.add(this._backView=new Je(t,"rm-panel-series-back")),this.add(this._headerView=new oa(t)),this.add(this._bodyView=new na(t)),this.add(this._divider=new an(t))}render(t,e,s,i,r){const o=this.point,n=e.header,a=e.body,h=this._headerView,l=this._bodyView,c=this._divider;let d,_;h.setVisible(n.visible)&&(h.internalResetStyleOrClass(n._style),d=h.setPoint(o).measure(t,n,s,i)),this._divider.setVisible(h.visible),l.internalResetStyleOrClass(a._style),_=l.setPoint(o).measure(t,a,s,i);let u=_.width,p=_.height;h.visible&&(u=Math.max(u,d.width),p+=d.height);const g=e.getExtents(u,p);h.visible&&(h.resize(g.width,d.height),h.layout(r),c.setVisible(e.divider.visible)&&(c.trans(0,d.height),c.setHLine(0,0,g.width))),l.resize(g.width,g.height-d.height),l.transY(d.height),l.layout(r),this._backView.setBounds(0,0,g.width,g.height,r)}}class ha extends Bn{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class la extends vn{constructor(t){super(t,!0),this._sectors=new Ho(this,ha,null,.5),this._rdRate=1,this.add(this._circle=new Wn(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,s){const i=this.point.values;this._sectors.prepare(i.length,((t,e)=>{t.value=i[e]})),this._rd=e,this.$_layoutSectors(t,s)}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e){const s=this.point.values,i=t.options,r=s.length,o=i.clockwise?1:-1,n=s.reduce(((t,e)=>t+e),0),a=t._totalRad*e;let h=t._startRad;if(this._sectors.prepare(s.length,((t,e)=>{t.value=s[e]})),r>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/n||0;t.start=h,h+=t.angle=o*e*a}}));else if(1==r){const t=this._sectors.get(0);t.start=h,t.angle=a}}$_layoutSectors(t,e){const s=t._categories||[],i=t.options.clockwise,r=0,o=0,n=this._cx=r,a=this._cy=o,h=this._rd;this.$_calcAngles(t,e),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this._sectors.forEach(((t,e)=>{const r=t.value;if(isNaN(r))t.setVisible(!1);else{const r=t.start;let o=0,l=0;t.trans(o,l).setVisible(!0),t.setPieSector({cx:n,cy:a,rx:h,ry:h,innerRadius:0,start:r,angle:m(t.angle),clockwise:i}),t.internalClearStyleAndClass(),s[e]&&s[e].color&&t.setFill(s[e].color)}}))}}class ca extends wn{constructor(t){super(t,!0),this.add(this._pin=new Rt(t))}render(t){this._pin.setPath(Ct.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new Wn(this.doc,"rm-pin-series-inner")),this._circle.setCircle(t.cx,t.cy,t.innerRd)):this._circle&&(this._circle.remove(),this._circle=null)}tooltipColor(){return getComputedStyle(this._pin.dom).fill}}class da extends wn{}class _a extends mn{constructor(t){super(t,!0),this.add(this._line=new Rt(t)),this.add(this._arrow=new Rt(t))}render(t,e,s,i){if(s.length>1){const t=s[s.length-2],r=s[s.length-1],o=$(Math.atan2(r[1]-t[1],r[0]-t[0]))-90,n="M"+s.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setVisible(i)&&(this._arrow.setPath(`M ${r[0]} ${r[1]} L ${r[0]-5*e} ${r[1]-13*e} L ${r[0]+5*e} ${r[1]-13*e} Z`),this._arrow.setRotation(r[0],r[1],o))}else this._line.setPath(""),this._arrow.setPath("")}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this}}class ua extends wn{}class pa extends vn{constructor(t){super(t,!0),this._cells=new Ho(this,Rt)}render(t,e,s,i){const r=t.getPointGrid(this.point,e,i);this.$_prepareCells(Math.round(r.count),s.wCell,s.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,s)}$_prepareCells(t,e,s){this._cells.prepare(t,(t=>{t.setPath(Ct.square(0,0,e,s))}))}$_layoutCells(t,e,s,i,r){const o=s*r.hCell+(s-1)*r.gap;let n=0,a=0;this._cells.forEach(((t,s,i)=>{isNaN(e[n][a])&&(n++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),o-n*r.hCell-(n>0?n*r.gap:0)),a++}))}}class ga extends Cn{constructor(t){super(t,"rm-waffle-series"),this._waffles=new cn(this._pointContainer,pa)}_getPointPool(){return this._waffles}_doPrepeare(t,e,s){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const s=e.length,i=this._getSeriesExt(t,e);this._waffles.prepare(s,((s,r)=>{const o=s.prepare(e[r],i);this._setPointStyle(s,t,o)}))}$_layoutWaffles(t,e,s){const i=this.model,r=i.getWaffleInfo(),o=i.chart.getProjection(this._second),n=+i.options.rotation||0,a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_={...this._getSeriesExt(i,i._visPoints),gap:i.options.gap},u=i.getCallout(),p=this._calloutViews();let g,m,f;this._waffles.forEach(((t,e)=>{const b=t.point,y=[b.lon,b.lat];if(t.setVisible(!b.isNull&&null!=(g=o.getVisible(y)))){const e=this._getPointPositioner(b.position||h,"top");let w,x,v,C,S,L;u&&(w=b.getCallout(y))&&(x=w.map((t=>o.project(t))),g=x[x.length-1]),b.xPos=v=g[0],b.yPos=C=g[1],v*=a[0],C*=a[1],t.render(i,_,r,s),m=t.bbox(),f=e(v,C,m.width,m.height),t.trans(f.x,f.y).rotate(n),d&&(S=d.get(b,0))&&this._layoutLabel(S,t.dom).transp(l(f.x+m.width/2,f.y+m.height/2,S.bbox(),m.width/2,m.height/2,c)),p&&x&&(L=p.get(b))&&L.render(u,b,x.flat().map(((t,e)=>t*a[e%2])),null)}}))}}function ma(t,e){return new(Wo[e._type()])(t)}yn.register([Zr,class extends yn{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new cn(this._pointContainer,sa),this._insetPool=new Ho(this._pointContainer,ia)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,s;const r=this._hoverArea;if(t!==r){const o=this.model;if(r&&(r.setBoolData(yn.DATA_HOVER,!1),r.point&&(null===(e=this._labelContainer.get(r.point,0))||void 0===e||e._text.setBoolData(yn.DATA_HOVER,!1))),!t||t.point||o.options.nullHovering||(t=void 0),this._hoverArea=t,t){const e=this.model.options,r=document.querySelector(".rm-root");let o=e.hoverColor,n=this.model.pointLabel.options.hoverColor;!o&&i(e.hoverStyle)&&(o=e.hoverStyle.fill),r.style.setProperty("--map-series-hover-fill",o||""),r.style.setProperty("--map-series-hover-label-fill",n||""),t.setBoolData(yn.DATA_HOVER,!0),t.point&&(null===(s=this._labelContainer.get(t.point,0))||void 0===s||s._text.setBoolData(yn.DATA_HOVER,!0))}t!=r&&o.chart._hoverAreaChanged(o,null==t?void 0:t.model,null==r?void 0:r.model)}}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=sa.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}_doPrepeare(t,e,s){const i=!ct,r=this._second,o=this._insets=[],n=e.options.bringToFront?[]:null;this._areaPool.prepare(e.areaCount,((t,s)=>{const a=e.get(r,s),h=t.point=e.pointOf(a);t.setModel(a),h?(a.dummy||this._setPointStyle(t,e,h),n&&n.push(t)):t.internalClearStyleAndClass(),i&&t.setStyle("vectorEffect","non-scaling-stroke"),a.inset&&o.push(a.inset)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let s,i;return(s=t.point)?(i=e.point)?isNaN(s._zindex)?isNaN(i._zindex)?0:-1:isNaN(i._zindex)?1:s._zindex-i._zindex:1:e.point?-1:0})),o.push(...e.chart.map._insets),n&&n.length!==e.areaCount&&n.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(o.length,((t,e)=>{i&&t.setStyle("vectorEffect","non-scaling-stroke")}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,s){const i=this.areaOfDom(s);return this.hoverArea=i,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const s=this.chart(),i=this._second,r=s.isDirty,o=s.body,n=this.model,a=n.options,h=s.getProjection(i),l=this._areas={},c=this._insets,d=a.allAreas;n.pointLabel.options.position;const _=this._labelViews(),u=a.nullStyle,p=a.dummyStyle,g=this._scale;this._areaPool.forEach(((t,e)=>{const s=t.model;if(s){const e=t.point,i=_&&e&&_.get(e,0);if(l[s.id]=t,t.setVisible(s.visible&&(d||!!e))){if(t.render(u,p,r),i){const s=h.project(n.getCenter(e));if(i.setVisible(o.isVisible(s))){i._model,r&&this._layoutLabel(i,t.dom);const o=i.bbox();let[n,a]=s;e.xPos=n,e.yPos=a,n*=g,a*=-g,n-=o.width/2,a-=o.height/2,i.trans(n,a)}}}else i&&i.setVisible(!1)}})),this._insetPool.forEach(((t,e)=>{const s=c[e],i=l[s.area];if(i)t.setVisible(i.visible)&&t.render(s,i,h);else{const e=s._base;if(e[0]instanceof Ei)t.render2(s,e.map((t=>l[t.id])),h);else if(e[0]>=0){const i=o.map.areaOf(s.parent);if(i){const r=i.readBounds(e);t.render3(s,r,h)}}}}))}}],[Er,class extends yn{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new cn(this._pointContainer,Kn)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,s;const r=this._hoverArea;if(t!==r){const o=this.model;if(r&&(r.setBoolData(yn.DATA_HOVER,!1),r.point&&(null===(e=this._labelContainer.get(r.point,0))||void 0===e||e._text.setBoolData(yn.DATA_HOVER,!1))),t&&!t.point&&(t=void 0),this._hoverArea=t,t){const e=this.model.options,r=document.querySelector(".rm-root");let o=e.hoverColor,n=this.model.pointLabel.options.hoverColor;!o&&i(e.hoverStyle)&&(o=e.hoverStyle.fill),r.style.setProperty("--map-series-hover-fill",o||""),r.style.setProperty("--map-series-hover-label-fill",n||""),t.setBoolData(yn.DATA_HOVER,!0),t.point&&(null===(s=this._labelContainer.get(t.point,0))||void 0===s||s._text.setBoolData(yn.DATA_HOVER,!0))}t!=r&&o.chart._hoverAreaChanged(o,null==t?void 0:t.model,null==r?void 0:r.model)}}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=Kn.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}_doPrepeare(t,e,s){this._second;const i=e.options.bringToFront?[]:null;this._areaPool.prepare(e.areaCount,((t,e)=>{})),i&&i.length!==e.areaCount&&i.forEach((t=>{t.parent.moveToLast(t)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,s){const i=this.areaOfDom(s);return this.hoverArea=i,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const s=this.chart(),i=this._second;s.isDirty,s.body;const r=this.model;r.options,s.getProjection(i),this._areas={},r.pointLabel,this._labelViews(),this._scale,this._areaPool.forEach(((t,e)=>{}))}}],[ao,class extends xn{constructor(t){super(t,"rm-point-series")}_createMarkers(t){return new cn(t,da)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers()}_doReset(){}$_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)}))}$_layoutMarkers(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),s=this._getGrowRate(),i=this.model,r=Math.max(0,i.getRadius()),o=[this._scale,-this._scale],n=+i.options.rotation||0,a=i.options.position,h=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),l=this._labelViews(),c=i.getLabelOff(),d=i.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach(((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(u=e.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"center"),y=(g._radius||r)*s,w=yn.getDrawer(i.getShape(f));let x,v,C,S,L,A;if(d&&(x=f.getCallout(b))&&(v=x.map((t=>e.project(t))),u=v[v.length-1]),f.xPos=C=u[0],f.xPos=S=u[1],C*=o[0],S*=o[1],p=m(C,S,2*y,2*y),p.x+=y,p.y+=y,t&&g.setPath(w(y,y)),g.trans(p.x,p.y).rotate(n),l&&(L=l.get(f,0))&&(t&&this._layoutLabel(L,g.dom),L.transp(h(p.x,p.y,L.bbox(),y,y,c))),_&&v&&(A=_.get(f))){const t=v.flat().map(((t,e)=>t*o[e%2]));_.setMask(A,t).setCircle(t[t.length-2],t[t.length-1],y),A.render(d,f,t,null)}}}))}}],[ro,class extends xn{constructor(t){super(t,"rm-pin-series")}_createMarkers(t){return new cn(t,ca)}_doPrepeare(t,e,s){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(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)}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),s=this._getGrowRate(),i=this.model,r=[this._scale,-this._scale],o=+i.options.rotation||0,n=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom");i.pointLabel.options.position;const h=this._labelViews(),l=i.getLabelOff(),c=i.getCallout(),d=this._calloutViews();let _,u;this._markers.forEach(((p,g)=>{const m=p.point,f=[m.lon,m.lat];if(p.setVisible(!m.isNull&&null!=(_=e.getVisible(f)))){const g=this._getPointPositioner(m.position||n,"top"),b=i.getExt(m,s),y=2*b.rd,w=3*b.rd;let x,v,C,S,L,A;c&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),_=v[v.length-1]),m.xPos=C=_[0],m.yPos=S=_[1],C*=r[0],S*=r[1],u=g(C,S,y,w),t&&p.render(b),p.trans(u.x+y/2,u.y+w).rotate(o),h&&(L=h.get(m,0))&&(t&&this._layoutLabel(L,p.dom),L.transp(a(u.x+y/2,u.y+w/2,L.bbox(),y/2,w/2,l))),d&&v&&(A=d.get(m))&&A.render(c,m,v.flat().map(((t,e)=>t*r[e%2])),null)}}))}}],[uo,class extends xn{constructor(t){super(t,"rm-Vector-series")}_createMarkers(t){return new cn(t,ua)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers()}_doReset(){}$_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)}))}$_layoutMarkers(){this.chart().isDirty;const t=this.model.chart.getProjection(this._second);this._getGrowRate();const e=this.model;this._scale,e.options.rotation;e.pointLabel.options.position,this._labelViews(),e.getLabelOff(),e.getCallout(),this._calloutViews(),this._markers.forEach(((e,s)=>{const i=e.point,r=[i.lon,i.lat];e.setVisible(!i.isNull&&null!=t.getVisible(r))}))}}],[cr,class extends Ln{constructor(t){super(t,"rm-bar-series"),this._labelInfo={},this._bars=new cn(this._pointContainer,On)}_getPointPool(){return this._bars}_doPrepeare(t,e,s){super._doPrepeare(t,e,s),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){this._bars.prepare(e.length,((s,i)=>{const r=s.prepare(e[i],null);this._setPointStyle(s,t,r)}))}$_layoutBars(t,e,s){const i=this.model,r=!i._pointDomain,o=this._getSeriesExt(i,this._visPoints),n=i.chart.getProjection(this._second),a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=i.getCallout(),u=this._calloutViews();let p,g;this._bars.forEach(((t,e)=>{const m=t.point,f=i.getCoord(m);if(t.setVisible(!m.isNull&&null!=(p=n.getVisible(f)))){const e=this._getPointPositioner(m.position||h,"center"),b=t.getSizeRate(t._ext.max,o),y=this._ext.width*b,w=this._ext.height*b;let x,v,C,S,L,A;_&&(x=m.getCallout(f))&&(v=x.map((t=>n.project(t))),p=v[v.length-1]),m.xPos=C=p[0],m.yPos=S=p[1],C*=a[0],S*=a[1],g=e(C,S,y,w),t.render(i,r&&o,m.values,y,w,s),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(A=u.get(m))&&A.render(_,m,v.flat().map(((t,e)=>t*a[e%2])),null)}}))}}],[Hr,class extends Ln{constructor(t){super(t,"rm-line-series"),this._lines=new cn(this._pointContainer,Qn)}_getPointPool(){return this._lines}_doPrepeare(t,e,s){super._doPrepeare(t,e,s),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,b(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new ta(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((s,i)=>{const r=s.prepare(e[i],null);this._setPointStyle(s,t,r)}))}$_layoutLines(t,e,s){const i=this.model,r=!i._pointDomain,o=this._getSeriesExt(i,this._visPoints),n=i.chart.getProjection(this._second),a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=i.getCallout(),u=this._calloutViews();let p,g;this._lines.forEach(((t,e)=>{const m=t.point,f=[m.lon,m.lat];if(t.setVisible(!m.isNull&&null!=(p=n.getVisible(f)))){const e=this._getPointPositioner(m.position||h,"top"),b=t.getSizeRate(t._ext.max,o),y=this._ext.width*b,w=this._ext.height*b;let x,v,C,S,L,A;_&&(x=m.getCallout(f))&&(v=x.map((t=>n.project(t))),p=v[v.length-1]),m.xPos=C=p[0],m.yPos=S=p[1],C*=a[0],S*=a[1],g=e(C,S,y,w),t.render(i,r&&o,m.values,y,w,s),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(A=u.get(m))&&A.render(_,m,v.flat().map(((t,e)=>t*a[e%2])),null)}}))}}],[eo,class extends Cn{constructor(t){super(t,"rm-pie-series"),this._pies=new cn(this._pointContainer,la)}_getPointPool(){return this._pies}_doPrepeare(t,e,s){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const s=e.length,i=this._getSeriesExt(t,e);this._pies.prepare(s,((s,r)=>{const o=s.prepare(e[r],i);this._setPointStyle(s,t,o)}))}$_layoutPies(t,e,s){const i=this.model,r=i.chart.getProjection(this._second),o=[this._scale,-this._scale],n=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),h=i.getLabelOff(),l=this._labelViews(),c=i.getCallout(),d=this._calloutViews(),_=i.getRadius(Math.min(t,e));let u,p;this._pies.forEach(((t,e)=>{const g=t.point,m=i.getCoord(g);if(t.setVisible(!g.isNull&&null!=(u=r.getVisible(m)))){const e=this._getPointPositioner(g.position||n,"top"),f=_*t._rdRate;let b,y,w,x,v,C;c&&(b=g.getCallout(m))&&(y=b.map((t=>r.project(t))),u=y[y.length-1]),g.xPos=w=u[0],g.yPos=x=u[1],w*=o[0],x*=o[1],p=e(w,x,2*f,2*f),p.x+=f,p.y+=f,t.render(i,f,s),t.trans(p.x,p.y),l&&(v=l.get(g,0))&&v.layout().transp(a(p.x,p.y,v.bbox(),f,f,h)),d&&y&&(C=d.get(g))&&C.render(c,g,y.flat().map(((t,e)=>t*o[e%2])),null)}}))}}],[Rr,class extends yn{constructor(t){super(t,"rm-lyph-series"),this._figures=new Ho(this._pointContainer,qn)}_doPrepeare(t,e,s){this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures()}_doReset(){}$_prepareFigures(t,e){const s=t.chart.isDirty,i=t.innerLabel,r=e.length;this._pointContainer.setFill(t._runColor),this._figures.prepare(r,((r,o)=>{const n=r.point=e[o];this._setPointStyle(r,t,n),s&&r.render(this.doc,t.getFigure(n),i)}))}$_layoutFigures(){this.chart();const t=this.model.chart.getProjection(this._second),e=this.model,s=[this._scale,-this._scale],i=+e.options.rotation||0,r=e.options.position,o=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),n=this._labelViews(),a=e.getLabelOff(),h=e.getCallout(),l=this._calloutViews();let c,d;this._figures.forEach(((e,_)=>{const u=e.point,p=[u.lon,u.lat];if(e.setVisible(!u.isNull&&null!=(c=t.getVisible(p)))){const _=this._getPointPositioner(u.position||r,"top");let g,m,f,b,y,w,x;if(h&&(g=u.getCallout(p))&&(m=g.map((e=>t.project(e))),c=m[m.length-1]),u.xPos=f=c[0],u.yPos=b=c[1],f*=s[0],b*=s[1],e.layout(),x=e.bbox(),d=_(f,b,x.width,x.height),e.trans(d.x,d.y).rotate(i),n&&(y=n.get(u,0))&&this._layoutLabel(y,e.dom).transp(o(d.x+x.width/2,d.y+x.height/2,y.bbox(),x.width/2,x.height/2,a)),l&&m&&(w=l.get(u))){const t=m.flat().map(((t,e)=>t*s[e%2]));x.x=e.tx,x.y=e.ty,l.setMask(w,t).setRects(x),w.render(h,u,t,e.getFill())}}}))}}],[go,ga],[co,class extends yn{constructor(t){super(t,"rm-route-series",!1),this._lines=new cn(this._pointContainer,_a)}_doInitStyles(){}_getPointPool(){return this._lines}_setPointColor(t,e){t._line.setStroke(e),t._arrow.setFill(e)}_doPrepeare(t,e,s){s&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(b(this.growRate,NaN))}_doReset(){}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){console.log("START POINT ADDING...")}_legendColorProp(){return"stroke"}$_prepareLines(t,e){const s=e.length,i=!ct;this._pointContainer.setStroke(t._runColor),this._lines.prepare(s,((s,r)=>{const o=s.point=e[r];this._setPointStyle(s,t,o),s._line.setFill("none"),s._arrow.setStroke("none"),i&&(s._line.setStyle("vectorEffect","non-scaling-stroke"),s._arrow.setStyle("vectorEffect","non-scaling-stroke"))}))}$_layoutLines(t){const e=this.model,s=e.chart;if(s.isDirty||!isNaN(t)){const i=s.getProjection(this._second),r=e.options.lineWidth,o=e.options.arrowDisplay;if(ct){const t=b(r,2)/this._scale;this._pointContainer.setStyle("strokeWidth",`${t}px`)}else isNaN(r)||this._pointContainer.setStyle("strokeWidth",`${r}px`);t=b(t,1),this._lines.forEach(((s,r)=>{this.$_layoutLine(s,e,i,t,o)}))}}$_layoutLine(t,e,s,i,o){const a=t.point;if(i=b(a._vr,i),a._deleting&&(i=1-i),t.setVisible(!a.isNull)&&t.setVisible(!0))if(r(a.path)){const e=a.path,i=[];let r=0;for(;r<e.length;)n(e[r])?(i.push(e[r]),r++):(i.push(...s.project([e[r],e[r+1]])),r+=2);t._line.setPath(i.join(" "))}else{const r=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>s.project(t))).filter((t=>!t.outside));i<1&&(r.length=r.length*i|0),t.render(e,1/this._scale,r,"none"!==o&&(i<1||"moving"!==o))}}$_genPath3(t,e,s){const i=[],r=Math.min(.1,Math.max(0,this.model.options.bendFactor)),o=Math.log(1+(n=t[0],a=t[1],h=e[0],l=e[1],Math.sqrt((n-h)**2+(a-l)**2)))*r;var n,a,h,l;const c=this._calculateControlPoint(t,e,o);for(let r=0;r<=s;r++){const o=r/s,n=this.interpolate3(t,c,o),a=this.interpolate3(c,e,o),h=this.interpolate3(n,a,o);i.push(h)}return i}interpolate3(t,e,s){const i=R(t[1]),r=R(t[0]),o=R(e[1]),n=R(e[0]),a=Math.acos(Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos(n-r)),h=Math.sin((1-s)*a)/Math.sin(a),l=Math.sin(s*a)/Math.sin(a),c=h*Math.cos(i)*Math.cos(r)+l*Math.cos(o)*Math.cos(n),d=h*Math.cos(i)*Math.sin(r)+l*Math.cos(o)*Math.sin(n),_=h*Math.sin(i)+l*Math.sin(o),u=Math.sqrt(c*c+d*d+_*_),p=Math.asin(_/u);return[$(Math.atan2(d,c)),$(p)]}_calculateControlPoint(t,e,s){const i=s,r=this.interpolate3(t,e,.5),o=R(r[1]),n=R(r[0]),a=o+i*Math.sin(Math.PI/2);return[$(n+i*Math.cos(Math.PI/2)),$(a)]}}],[Ps,class extends xn{constructor(t){super(t,"rm-bubble-series")}_createMarkers(t){return new cn(t,Fn)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_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)}))}$_layoutMarkers(t,e,s){const i=this.model,r=i.chart,o=r.getProjection(this._second),n=+i.options.rotation||0,a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"center"),c=this._getLabelPositioner(i.subLabel.options.position,"right"),d=this._labelViews(),_=i.getLabelOff(),u=i.getSubLabelOff(),g=i.getCallout(),m=this._calloutViews(),{min:f,max:b}=i.getPixelMinMax(p(r.width,r.height));let y,w;this._markers.forEach(((t,e)=>{const r=t.point,p=i.getCoord(r);if(t.setVisible(!r.isNull&&null!=(y=o.getVisible(p)))){const e=this._getPointPositioner(r.position||h,"center"),x=yn.getDrawer(i.getShape());let v,C,S,L,A,M,k=(t._radius=i.getRadius(r.getValue(),f,b))*s;g&&(v=r.getCallout(p))&&(C=v.map((t=>o.project(t))),y=C[C.length-1]),r.xPos=S=y[0],r.xPos=L=y[1],S*=a[0],L*=a[1],w=e(S,L,2*k,2*k),w.x+=k,w.y+=k;const P=()=>{t.setPath(x(k,k)),t.trans(w.x,w.y).rotate(n)},I=()=>{if(o instanceof Ii){const e=o.r,s=this.chart().width,i=p[1]*Math.PI/180,r=k/2*(360/s),n=r/Math.cos(i),a=r;o.r=ki*this._scale;const h=Xo.geoCircle(p[0],p[1],n,a,o,!0);o.r=e,t.setPath(h),t.trans(0,0).rotate(0)}else P()};if(this.model.alignToSurface?I():P(),d&&((A=d.get(r,0))&&this._layoutLabel(A,t.dom).transp(l(w.x,w.y,A.bbox(),k,k,_)),(A=d.get(r,1))&&this._layoutLabel(A,t.dom).transp(c(w.x,w.y,A.bbox(),k,k,u))),m&&C&&(M=m.get(r))){const e=C.flat().map(((t,e)=>t*a[e%2]));m.setMask(M,e).setCircle(e[e.length-2],e[e.length-1],k),M.render(g,r,e,t.getFill())}}}))}}],[Fr,class extends yn{constructor(t){super(t,"rm-image-series"),this._images=new cn(this._pointContainer,Jn)}_getPointPool(){return this._images}_doPrepeare(t,e,s){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(1)}_doReset(){}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,s=t.options.imageWidth,i=t.options.imageHeight;this._images.prepare(e.length,((r,o)=>{const n=r.point=e[o];r.setImage(t.getUrl(n),s,i),this._setPointStyle(r,t,n)}))}_layoutPoints(t){const e=this.model,s=e.chart.getProjection(this._second),i=+e.options.rotation||0,r=[this._scale,-this._scale],o=e.options.position,n=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews();let d,_;this._images.forEach(((t,u)=>{const p=t.point,g=e.getCoord(p);if(t.setVisible(!p.isNull&&null!=(d=s.getVisible(g)))){const e=this._getPointPositioner(p.position||o,"top");let u,m;const f=t.bbox(),b=f.width,y=f.height;let w,x,v,C;if(l&&(u=p.getCallout(g))&&(m=u.map((t=>s.project(t))),d=m[m.length-1]),p.xPos=w=d[0],p.yPos=x=d[1],w*=r[0],x*=r[1],_=e(w,x,b,y),t.trans(_.x,_.y).rotate(i),h&&(v=h.get(p,0))&&v.layout().transp(n(_.x+b/2,_.y+y/2,v.bbox(),b/2,y/2,a)),c&&m&&(C=c.get(p))){const e=m.flat().map(((t,e)=>t*r[e%2]));f.x=t.tx,f.y=t.ty,c.setMask(C,e).setRects(f),C.render(l,p,e,t.getFill())}}}))}}],[Qr,class extends yn{constructor(t){super(t,"rm-panel-series"),this._panels=new cn(this._pointContainer,aa)}_doPrepeare(t,e,s){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,1)}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}$_preparePanels(t,e){const s=e.length;this._panels.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)}))}$_layoutPanels(t,e,s,i){const r=this.model,o=r.chart.getProjection(this._second),n=[this._scale,-this._scale],a=r.options.position,h=this._getLabelPositioner(r.pointLabel.options.position,"bottom"),l=this._labelViews(),c=r.getLabelOff(),d=r.getCallout(),_=this._calloutViews(),u=getComputedStyle(this._pointContainer.dom),p=b(u.rx,0);let g,m,f;this._panels.forEach(((i,u)=>{const b=i.point,y=r.getCoord(b);if(i.setVisible(!b.isNull&&null!=(g=o.getVisible(y)))){const u=this._getPointPositioner(b.position||a,"top");let w,x,v,C,S,L;if(d&&(w=b.getCallout(y))&&(x=w.map((t=>o.project(t))),g=x[x.length-1]),b.xPos=v=g[0],b.yPos=C=g[1],v*=n[0],C*=n[1],i.render(t,r,e,s,p),m=i.bbox(),f=u(v,C,m.width,m.height),i.trans(f.x,f.y),l&&(S=l.get(b,0))&&this._layoutLabel(S,i.dom).transp(h(f.x+m.width/2,f.y+m.height/2,S.bbox(),m.width/2,m.height/2,c)),_&&x&&(L=_.get(b))){const t=x.flat().map(((t,e)=>t*n[e%2]));m.x=i.tx,m.y=i.ty,_.setMask(L,t).setRects(m),L.render(d,b,t,i.getFill())}}}))}}],[go,ga],[wr,class extends Mn{constructor(t){super(t,"rm-circle-gauge")}_createGauges(t){return new cn(t,Yn)}_doPrepeare(t,e,s){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const s=this.model;this.$_layoutGauges(s._width,s._height,1)}_doReset(){}_runShowEffect(t){t&&Nn.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r),s.prepare(this.doc,t)}))}$_layoutGauges(t,e,s){const i=this.model;i.chart.isDirty;const r=this.model.chart.getProjection(this._second),o=[this._scale,-this._scale],n=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),h=this._labelViews(),l=i.getLabelOff(),c=i.getCallout(),d=this._calloutViews();let _,u,p;this._gauges.forEach(((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(_=r.getVisible(b)))){const m=this._getPointPositioner(f.position||n,"top");let y,w,x,v,C,S;c&&(y=f.getCallout(b))&&(w=y.map((t=>r.project(t))),_=w[w.length-1]),f.xPos=x=_[0],f.yPos=v=_[1],x*=o[0],v*=o[1],g.render(i,t,e,s),u=g.bbox(),p=m(x,v,u.width,u.height),g.trans(p.x,p.y),h&&(C=h.get(f,0))&&this._layoutLabel(C,g.dom).transp(a(p.x+u.width/2,p.y+u.height/2,C.bbox(),u.width/2,u.height/2,l)),d&&w&&(S=d.get(f))&&S.render(c,f,w.flat().map(((t,e)=>t*o[e%2])),null)}}))}}],[Nr,class extends Mn{constructor(t){super(t,"rm-clock-gauge")}_createGauges(t){return new cn(t,Un)}_doPrepeare(t,e,s){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const s=this.model;this.$_layoutGauges(s._width,s._height)}_doReset(){}$_prepareGauges(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(s,((s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r),s.prepare(this.doc,t)}))}$_layoutGauges(t,e){const s=this.model;s.chart.isDirty;const i=this.model.chart.getProjection(this._second),r=[this._scale,-this._scale],o=s.options.position,n=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),a=this._labelViews(),h=s.getLabelOff(),l=s.getCallout(),c=this._calloutViews();let d,_,u;this._gauges.forEach(((p,g)=>{const m=p.point,f=[m.lon,m.lat];if(p.setVisible(!m.isNull&&null!=(d=i.getVisible(f)))){const g=this._getPointPositioner(m.position||o,"top");let b,y,w,x,v,C;l&&(b=m.getCallout(f))&&(y=b.map((t=>i.project(t))),d=y[y.length-1]),m.xPos=w=d[0],m.yPos=x=d[1],w*=r[0],x*=r[1],p.render(s,t,e),_=p.bbox(),u=g(w,x,_.width,_.height),p.trans(u.x,u.y),a&&(v=a.get(m,0))&&this._layoutLabel(v,p.dom).transp(n(u.x+_.width/2,u.y+_.height/2,v.bbox(),_.width/2,_.height/2,h)),c&&y&&(C=c.get(m))&&C.render(l,m,y.flat().map(((t,e)=>t*r[e%2])),null)}}))}}]),Zo.register([Zi,In],[Yi,kn],[Wi,Pn]);class fa extends mt{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.setStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class ba extends mt{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.setStyle("opacity",String(1-t)),!0}}class ya extends Et{constructor(t,e,s){super(t,""),this.labelsContainer=e,this.second=s,this.seriesViews=[],this.seriesMap={},this.add(this.axisView=new Qo(t,s))}prepare(t,e){const s=e.visibleSeries,i=this.seriesMap,r=this.seriesViews;r.forEach((t=>{var e;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),this.control.loaded?t.removeLater(200):t.remove())})),r.length=0,s.forEach((e=>{const s=!i[e.hash],o=i[e.hash]||function(t,e){return new(bn[e._type()])(t)}(t,e);o.parent||(this.add(o),this.labelsContainer.add(o._labelContainer)),i[e.hash]=o,r.push(o),o._second=this.second,s&&(e._optionsDirty=!0),o.prepare(t,e)})),this.prevViews&&dt.equalArrays(this.prevViews,r)||(this.sort(r),this.labelsContainer.sort(r.map((t=>t._labelContainer)))),this.prevViews=r.slice(0)}prepareLayout(t,e){this.seriesViews.forEach((e=>{e.prepareLayout(t)}))}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class wa extends Et{constructor(t,e){super(t),this.front=e,this._guideViews=[],this.add(this._guideLayer=new Et(t)),this.add(this._labelLayer=new Et(t))}render(t,e,s,i,r){const o=e.guides.filter((t=>t.options.front==this.front));this.$_prepareGuides(t,o),this.$_layoutGuides(t,o,s,i,r)}$_prepareGuides(t,e){const s=this._guideViews,i=e.length;for(;s.length>i;)s.pop().remove();for(;s.length<i;){const e=new en(t,this._labelLayer);s.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,s,i,r){this._guideViews.forEach(((o,n)=>{o.measure(t,e[n],i,r),o.layout(s)}))}}class xa extends Fo{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new Je(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new nn(t)),this.add(this._contentLayer=new Et(t,"rm-body-content")),this.add(this._crosshairView=new rn(t)),this._contentLayer.add(this._annotationContainer=new Et(t)),this._contentLayer.add(this._axisGuideContainer=new wa(t,!1)),this._contentLayer.add(this._secondAxisGuideContainer=new wa(t,!1)),this._contentLayer.add(this._seriesContainer=new ya(t,new Et(t),!1)),this._contentLayer.add(this._secondContainer=new ya(t,new Et(t),!0)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._secondContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new wa(t,!0)),this._contentLayer.add(this._secondFrontAxisGuideContainer=new wa(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new Et(t)),this._secondContainer.setVisible(!1),this._secondFrontAxisGuideContainer.setVisible(!1),this._secondAxisGuideContainer.setVisible(!1),this._seriesContainer.dom.classList.add("rm-series-container"),this._secondContainer.dom.classList.add("rm-second-container")}getAnnotationAnchor(t){return this._annotationMap.get(t)}get transformInfo(){return this._transformInfo}get isProjectionChanged(){return this.model.projection!==this._prevPrj}getSeries(t){return this._seriesContainer.seriesMap[t.hash]}canScroll(){return!0}prepare(t,e){this.$_prepareMeasureSeries(t,e.chart),this.$_prepareAnnotations(t,e.getAnnotations())}_doMeasure(t,e,s,i){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],s,i)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,s,i),Ro.create(s,i)}_doLayout(t){var e;const s=this.doc,i=this.model,r=i.chart,o=r.axis,n=r.map,a=this._clip,h=this.height,l=this.width;if(this._back.setBounds(0,0,l,h),this._back.internalResetStyleOrClass(i._style),n){const t=l,e=h,{wMap:a,hMap:c,scale:d,tx:_,ty:u}=i.prepareLayout(t,e);this.$_prepareLayoutSeries(s,r),this._transformInfo={tx:_,ty:u,scale:d,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const p=`translate(${_}px, ${u}px) scale(${d}, ${-d})`,g=a*d,m=c*d,f=[this._seriesContainer];if(this._mapBack.setVisible(r.body.mapBackground.isVisible())){const t=(l-g)/2-i.panX*d,e=(h-m)/2-i.panY*d;this._mapBack.render(this.doc,r,t,e,g,m)}this._secondContainer.visible&&f.push(this._secondContainer),f.forEach((t=>{const e=t.axisView;e.setScale(d),e.measure(s,o,l,h),e.resize(l,h),e.trans(_,u),t.seriesViews.forEach((t=>{var e;t._scale=d,t.model.needMapScale()?(t._pointLayer.setStyle("transform",p),t._calloutContainer.visible&&t._calloutContainer.setStyles({transform:p})):t.trans(_,u),t.move(_,u),t.resize(g,m),t.render(l,h),null===(e=t._labelContainer)||void 0===e||e.trans(_,u)})),e.layout()}));const b=i._prj;this.$_doClipPathLayout(i,b,l,h,d),this._crosshairView.visible&&this._crosshairView.prepare(d,p);const y=o.grid.getStep(n)||10;this.$_layoutAxisGuides(s,o,{map:n,prj:b,step:y,tf:this._transformInfo,trans:p},l,h)}if(this.$_layoutAnnotations(l,h),a&&a.width===l&&a.height===h||(this._clip=this.clipRect(0,0,l,h)),this._requestShow&&this._requestShow.visible){const t=this.getSeries(this._requestShow);t&&(null===(e=this._requestShow.ani)||void 0===e||e.stop(),(this._requestShow.ani=new fa(t)).start(),this._requestShow=null)}this._prevPrj=i._prj}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.pointToMap(this._mousePos),this._transformInfo)}clean(){}reset(){this._seriesContainer.seriesViews.forEach((t=>t.reset())),this._secondContainer.visible&&this._secondContainer.seriesViews.forEach((t=>t.reset()))}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,s){let i,r;if(!this.model)return;for(const o of this._seriesContainer.seriesViews)o.pointerMoved(t,e,s)&&(i=o,r=o.getPointView(s));if(!r)for(const t of this._seriesContainer.seriesViews)if(r=t.getPointView(s),r){i=t;break}const o=this.model.chart,n=null==i?void 0:i.model,a=n&&this._owner.getScaleView(o.getColorScale(n.getColorScale()));return(null==r?void 0:r.point)?(this._owner.showTooltip(n,r,this,{x:t,y:e}),null==a||a.setValue(r.point.getValue())):(this._owner.hideTooltip(),null==a||a.setValue(NaN)),this._crosshairView.visible&&o&&this._crosshairView.render(this.pointToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!i}seriesByDom(t){return this._seriesContainer.seriesViews.find((e=>e.dom.contains(t)))}showSeries(t){t.visible=!0,this._requestShow=t}hideSeries(t){var e;const s=this.getSeries(t);s&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new ba(s)).start())}pointToMap(t){const e=this.model.chart.getProjection(!1),{tx:s,ty:i,scale:r,vx:o,vy:n}=this._transformInfo,a=[(t.x-o-s)/r,(t.y-n-i)/-r];return e.backward(a)}$_prepareMeasureSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e),this._secondContainer.setVisible(e.body.scroll%360!=0)&&this._secondContainer.prepare(t,e)}$_prepareLayoutSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t,e),this._secondContainer.setVisible(e.body.scroll%360!=0)&&this._secondContainer.prepareLayout(t,e)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,o=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));o.forEach((t=>t.remove())),o.length=0,(this._annotations=e).forEach((e=>{const n=r.get(e)||ma(t,e);(e.options.front?i:s).add(n),r.set(e,n),o.push(n)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((s=>{s._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,s,i,r){this._axisGuideContainer.render(t,e,s,i,r),this._frontAxisGuideContainer.render(t,e,s,i,r);const o=this.model.chart,n={...s,prj:s.prj.second};this._secondFrontAxisGuideContainer.setVisible(o.body.scroll%360!=0)&&(this._secondFrontAxisGuideContainer.visible=!0,this._secondFrontAxisGuideContainer.render(t,e,n,i,r)),this._secondAxisGuideContainer.setVisible(o.body.scroll%360!=0)&&(this._secondAxisGuideContainer.visible=!0,this._secondAxisGuideContainer.render(t,e,n,i,r))}$_doClipPathLayout(t,e,s,i,r){const o=()=>{const t=e.getClipBounds();return`M${t[0][0]},${t[0][1]} L`+t.slice(1).map((t=>`${t[0]},${t[1]}`))},n=t=>{const{tx:e,ty:s}=this._transformInfo;t.path.transEx(e,s).scale(r)};if(t.isScrollable())if(e.isClipping()){const t=this._clipMap;if(t&&t.width===s&&t.height===i){if(t){if(this._prevPrj!==e){const e=o();t.setPath(e)}n(t),this._contentLayer.hasAttr("clip-path")||this._contentLayer.attachClipPath(this._clipMap.id)}}else{const t=o();this._clipMap=this._contentLayer.clipPath(t),n(this._clipMap),this._clipMap.resize(s,i)}}else this._contentLayer.detachClipPath();else this._seriesContainer.setVisible(!0),this._seriesContainer.scrollTo(0),this._secondContainer.setVisible(!1),e.isClipping()||this._contentLayer.detachClipPath()}}class va extends Bo{constructor(t,e){super(t,e?va.SUBTITLE_CLASS:va.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Pe(t)),this._richText=new Oe}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){return this.chart().isDirty&&(this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null)),ut(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var Ca,Sa;va.TITLE_CLASS="rm-title",va.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Ca||(Ca={}));class La extends Vt{constructor(e){super(e,La.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._tailVisible=!0,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Rt(e,"rm-tooltip-back")),this.add(this._top=new Rt(e,"rm-tooltip-top")),this.add(this._textView=new Pe(e,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Tt.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new Oe,this.close(!0,!1)}show(t,e,s,i,r,o){var n;const a=e.point,h=this._model=t.chart._tooltip,l=h.options,c=h.setTarget(t,a);if(!c)return;const d=l.text||c.getTooltipText(t,a);if(!d)return;const _=this.control,u=_.contentWidth(),m=_.contentHeight(),f=this._textView;this._richText.setFormat(d),this._richText.build(f,NaN,NaN,null,h.getTextDomain());const b=f.bbox();let y=g(l.minWidth||0,b.width+16),w=g(l.minHeight||0,b.height+12);this._top.setFill((null===(n=e.tooltipColor)||void 0===n?void 0:n.call(e))||t._calcedColor);const x="visible"===this.getStyle("visibility")?300:0,v=l.offset+this._tailSize,C=e.getBounds(),S=_.getBounds();let L;L=s-y/2-g(0,p(s-y/2,u-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(S.bottom,C.bottom);const A=Ca.TOP;this.drawTooltip(0,0,y,w,A,L),i-=w+v,s=g(0,p(s-=y/2,u-y)),i=g(0,p(i,m-w)),this.transEx(s,i,x,!1),0===x&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.options.hideDelay:Gi.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,s,i,r,o){const n=null!=s?G(e,s):{},a=G(e,i),h=t.animate([n,a],{duration:r,fill:"none"});h&&o&&h.addEventListener("finish",o)}(this.dom,"opacity",void 0,0,200,(()=>{this.setStyle("visibility","hidden")}))}drawTooltip(t,e,s,i,r,o){const n=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+s-a,e,"Q",t+s,e,t+s,e+a,"L",t+s,e+i-a,"Q",t+s,e+i,t+s-a,e+i,"L",t+a,e+i,"Q",t,e+i,t,e+i-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case Ca.TOP:l=l.concat(["M",t+s/2-n/2+o,e+i,"L",t+s/2+o,e+i+n,"L",t+s/2+n/2+o,e+i]);break;case Ca.BOTTOM:l=l.concat(["M",t+s/2-n/2+o,e,"L",t+s/2+o,e-n,"L",t+s/2+n/2+o,e]);break;case Ca.LEFT:l=l.concat(["M",t+s,e+i/2-n/2+o,"L",t+s+n,e+i/2+o,"L",t+s,e+i/2+n/2+o]);break;case Ca.RIGHT:l=l.concat(["M",t,e+i/2-n/2+o,"L",t-n,e+i/2+o,"L",t,e+i/2+n/2+o])}const c=r===Ca.BOTTOM,d=c?["M",t,e+i-h,"l",s,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-s,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",s-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-s,0,"l",0,a-h,"q",0,-a,a,-a],_=this._textView,u=_.bbox();t+=(s-u.width)/2,e+=(i-u.height+(c?-h:h))/2,_.trans(t,e),this._top.setPath(d),this._back.setPath(l)}}La.CLASS_NAME="rm-tooltip";class Aa extends Fo{constructor(t){super(t,Aa.SCALE_CLASS),this._gap=0,this.add(this._barLayer=new Et(t)),this._bars=new Ho(this._barLayer,Je,"rm-color-scale-bar"),this.add(this._splitLayer=new Et(t)),this._splits=new Ho(this._splitLayer,an,"rm-color-scale-split"),this.add(this._markerLabel=new Ko(t,void 0)),this.add(this._marker=new Rt(t,"rm-color-scale-marker")),this.add(this._tickLineLayer=new Et(t,"rm-color-scale-tick-line")),this.add(this._tickLabelLayer=new Et(t,"rm-color-scale-tick-label")),this._tickLines=new Ho(this._tickLineLayer,an),this._tickLabels=new Ho(this._tickLabelLayer,Ko),this._fills=[]}setValue(t){var e,s;e=t,s=this._value,(isNaN(e)?isNaN(s):e===s)||(this._value=t,this.$_resetMarker(this._vertical,this._reversed))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){const r=this.chart().isDirty,o=e.options,n=e.marker,a=e.getTicks(),h=this._tickLen=+e.tick.line.options.length||0,l=e.tick.line,c=e.tick.label,d=this._vertical="vertical"===e.getLayout(),_=this._reversed=e.isReversed();let{width:u,height:p}=e.getBarSize(s,i,d);if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(l.visible&&h>0),r){const s=this._vertical?p:u,i=e.getSplitPoints(s);this.$_prepareBars(t,e,d,_),this._splitLayer.visible&&this.$_prepareSplits(t,i),this._tickLineLayer.visible&&this.$_prepareTickLines(t,i,s)}if(this._markerSize=this._labelSize=0,this._markerLabel.setVisible(n.visible)&&(this._markerSize=n.getMarkerSize(),d?u+=this._markerSize:p+=this._markerSize,r&&this.$_prepareMarker(n,d,_,this._markerSize),this._markerLabel.setVisible(n.label.visible)),this._tickLineLayer.setVisible(l.visible&&a.length>0)&&this._tickLines.forEach((t=>{t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(l._style)})),this._tickLabelLayer.setVisible(c.visible&&a.length>0)){const s=d?"width":"height";this._tickLabelSize=0,this._tickLabels.prepare(a.length,((i,r)=>{i.setModel(t,e.tick.label,null,null),i._text.internalResetStyleOrClass(c._style),i.setText(a[r].label),i.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,i.bbox()[s]),d&&(this._tickLabelSize+=1)})),d?u+=this._tickLabelSize+h:p+=this._tickLabelSize+h}return this._gap=b(+o.gap,0),this._vertical?u+=this._gap:p+=this._gap,{width:u,height:p}}_doLayout(){const t=this._vertical,e=this._reversed,s=this._tickLabelSize,i=this._markerSize,r=this._tickLen,o=this._gap;let n=this.width,a=this.height,h=0,l=0;t?(h+=e?s:o+i,n-=o+i,s>0&&(e?this._tickLabelLayer.transX(s):this._tickLabelLayer.transX(this.width-s+1),this._tickLabels.forEach(((t,s,i)=>{e&&t.transX(-t.bbox().width),t.transY(s*a/(i-1)-t.bbox().height/2)})),n-=s),n-=r,e&&(h+=r)):(l+=o+i,a-=o+i,s>0&&(e?this._tickLabelLayer.transY(0):this._tickLabelLayer.transY(this.height-s),this._tickLabels.forEach(((t,e,s)=>{t.transX(e*n/(s-1)-t.bbox().width/2)})),a-=s),a-=r,e&&(l+=r)),this._barLayer.setBounds(h,l,n,a),this._bars.forEach(((e,s,i)=>{t?e.setBounds(0,s*a/i,n,a/i):e.setBounds(s*n/i,0,n/i,a)})),this._splitLayer.visible&&this.$_layoutSplits(h,l,n,a),this._tickLineLayer.visible&&(t?e?h-=r:h+=n:e?l-=r:l+=a,this.$_layoutTickLines(h,l,r)),this.$_resetMarker(this._vertical,this._reversed)}$_getFillId(t){return`${Aa.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,s){const i=t.createElementNS(e,"linearGradient");return i.setAttribute("id",this.$_getFillId(s)),i.appendChild(t.createElementNS(e,"stop")),i.appendChild(t.createElementNS(e,"stop")),this.control.addDef(i),i}$_setDir(t,e,s){e?(t.setAttribute("x1","0%"),t.setAttribute("y1","0%"),t.setAttribute("x2","0%"),t.setAttribute("y2","100%")):(t.setAttribute("x1","0%"),t.setAttribute("y1","0%"),t.setAttribute("x2","100%"),t.setAttribute("y2","0%"))}$_fillStops(t,e,s){const i=t.childNodes[0],r=t.childNodes[1];i.setAttribute("offset","0"),i.setAttribute("stop-color",e.toString()),i.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",s.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,s,i){const r=this._fills,o=e.getSteps();if(o){let e=0;o.forEach(((s,i)=>{s._color1&&(r.length<=e&&r.push(this.$_createGradient(t,e)),r[r.length-1][rs]=s,e++)})),r.forEach((t=>{const e=t[rs];this.$_setDir(t,s,i),this.$_fillStops(t,e._color1,e._color2)})),this._bars.prepare(e,((t,e)=>{t.setStyle("fill",this.$_getFillUrl(e))}))}else if(this._bars.prepare(1),e.minColor){let o=r.shift();if(o){for(let t=1;t<r.length;t++)this.control.removeDef(r[t]);this._fills=[o]}else o=this.$_createGradient(t,0),r.push(o);this.$_setDir(o,s,i),this.$_fillStops(o,e.minColor,e.maxColor||e.series.color),this._bars.first.setStyle("fill",this.$_getFillUrl(0))}else r.forEach((t=>this.control.removeDef(t))),this._fills=[]}$_prepareSplits(t,e){this._splits.prepare(e.length,((t,s)=>{t._userData=e[s]}))}$_prepareTickLines(t,e,s){this._tickLines.prepare(e.length+2,((t,i)=>{t._userData=0===i?0:i===e.length+1?s-1:e[i-1]}))}$_prepareMarker(t,e,s,i){e?s?this._marker.setPath(`M 0 0 L ${.8*i} -${.7*i} L ${.8*i} ${.7*i} Z`):this._marker.setPath(`M 0 0 L -${.8*i} -${.7*i} L -${.8*i} ${.7*i} Z`):s?this._marker.setPath(`M 0 0 L -${.7*i} ${i} L ${.7*i} ${i} Z`):this._marker.setPath(`M 0 0 L -${.7*i} -${i} L ${.7*i} -${i} Z`)}$_layoutSplits(t,e,s,i){this._splits.forEach((r=>{this._vertical?r.setHLine(r._userData,t,t+s):r.setVLine(r._userData,e,e+i)}))}$_layoutTickLines(t,e,s){this._tickLines.forEach((i=>{this._vertical?i.setHLine(i._userData,t,t+s):i.setVLine(i._userData,e,e+s)}))}$_resetMarker(t,e){const s=this._markerSize,i=this._gap,r=isNaN(this._value);if(this._marker.setBoolData("null",r),t){const t=e?this.width-i-s+1:s+i-1;this._marker.trans(t,r?0:this.height*this.model.getPosition(this._value))}else{this.model.getPosition(this._value)>1&&console.log(this.model.getPosition(this._value));const t=e?this.height-i-s+1:s+i;this._marker.trans(r?0:this.width*this.model.getPosition(this._value),t)}}}Aa.SCALE_CLASS="rm-color-scale",Aa.SCALE_FILL="rm-color-scale-fill";class Ma extends Vt{constructor(t,e,s){super(t,Ma.STYLE),this.add(this._back=new Je(t,Ma.BACK_STYLE)),this.add(this._textView=new Pe(t)),s&&this.dom.classList.add(s),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(e,s){this.internalSetStyleOrClass(s),this._textView.layout=t.TextLayout.MIDDLE,this._textView.layoutText();const i=this._textView.bbox(),r=getComputedStyle(this._back.dom),o=(new $o).applyPadding(r);e?(this._back.rect={x:0,y:0,width:e.width,height:e.height},this._textView.trans(e.width/2,e.height/2-1)):(this._textView.trans(o.left+i.width/2,o.top+i.height/2-1),this._back.rect={x:0,y:0,width:i.width+o.left+o.right,height:i.height+o.top+o.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}Ma.STYLE="rm-button",Ma.BACK_STYLE="rm-button-background";class ka extends Ma{constructor(t,e,s){super(t,e),this.callback=s}click(){return this.callback(),!0}}class Pa extends Fo{}class Ia extends Pa{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new ka(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new ka(t,"+",(()=>this.chart().body.incZoom(this.model.getZoomStep())))),this.add(this._btnDec=new ka(t,"-",(()=>this.chart().body.incZoom(-this.model.getZoomStep()))))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,s,i){const r=this.chart().body.zoom,o=this._szBtn=e.getButtonSize(),n=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.options.showReset)?3:2;let h=0,l=0;return this._btnHome.setBoolData(ns,r<=100),this._btnDec.setBoolData(ns,r<=100),(this._vertical=e.vertical)?(h=o.width,l+=a*o.height+(a-1)*n):(l=o.height,h+=a*o.width+(a-1)*n),{width:h,height:l}}_doLayout(t){const e=this._szBtn;if(this._btnHome.visible&&this._btnHome.layout(e),this._btnInc.layout(e),this._btnDec.layout(e),this._vertical){let t=0;this._btnHome.visible&&(t+=e.height+this._gap),this._btnInc.transY(t),t+=e.height+this._gap,this._btnDec.transY(t)}}}class Na extends Pa{constructor(t){super(t,"rm-drilldown-panel")}getButton(t){return this._btnBack&&this._btnBack.containsDom(t)&&this._btnBack}click(t){const e=this._textViews;if(e)for(let s=0;s<e.count-1;s++)if(e.get(s).containsDom(t))return this.model.chart.drillup(e.get(s+1)[os]),!0}_doMeasure(e,s,i,r){let o=this._btnBack,n=0,a=0;if("text"===s.options.type){null==o||o.remove(),this._textViews||(this._textViews=new Ho(this,Pe,"rm-drilldown-text"),this._seperators=new Ho(this,Pe,"rm-drilldown-separator"));const e=s.chart.firstVisible,i=this._history=e.getHistory();this._textViews.prepare(i.length,((e,s)=>{e.text=i[s].displayName(),e.anchor=t.TextAnchor.START,e[os]=i[s]})),this._seperators.prepare(i.length-1,(e=>{e.text=">",e.anchor=t.TextAnchor.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),o||this.add(o=this._btnBack=new ka(e,"<",(()=>{s.chart.drillup()}))),o.layout();const t=o.bbox();n=t.width,a=t.height}return{width:n,height:a}}_doLayout(t){if("text"===this.model.options.type){const t=this.model.options.itemGap,e=this._history;let s=0;for(let i=0;i<e.length;i++){const r=this._textViews.get(i);r.setBoolData("history",i<e.length-1),r.transX(s),i<e.length-1&&(s+=r.bbox().width+t,this._seperators.get(i).transX(s),s+=this._seperators.get(i).bbox().width+t)}}}}class Ta extends Fo{constructor(t){super(t,Ta.SCALE_CLASS),this._bubbles=[],this._lines=[],this._labels=[],this.add(this._bubbleLayer=new Et(t)),this.add(this._lineLayer=new Et(t)),this.add(this._labelLayer=new Et(t))}_doMeasure(t,e,s,i){const r=this.chart();r.isDirty,e.options;const o=this._steps=e.getSteps(r.width,r.height);return this._model=e,this.$_prepareBubbles(t,e,o),{width:100,height:100}}_doLayout(){const t=this._model,e=this.height,s=this._steps,i=s[s.length-1].rd;if(this._bubbles.forEach(((t,r)=>{const o=s[r];t.internalResetStyleOrClass(null),t.setCircle(i,e-o.rd,o.rd)})),this._lineLayer.visible){const r=2*i+(t.tick.line.options.length||0);this._lines.forEach(((t,o)=>{const n=s[o];t.setHLine(e-2*n.rd,i,r)}))}if(this._labelLayer.visible){const r=2*i+t.tick.line.options.length+(t.tick.label.options.offset||0);this._labels.forEach(((i,o)=>{const n=s[o];i.setText(t.tick.label.getText(n.label)),i.trans(r,e-2*n.rd-i.bbox().height/2)}))}}$_prepareBubbles(t,e,s){const i=e.tick,r=s.length;Vt.fit(t,this._bubbleLayer,this._bubbles,r,Wn,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(i.visible&&i.line.visible)&&Vt.fit(t,this._lineLayer,this._lines,r,an,"rm-bubble-scale-line"),this._labelLayer.setVisible(i.visible&&i.label.visible)&&Vt.fit(t,this._labelLayer,this._labels,r,Ko,"rm-bubble-scale-label")}}Ta.SCALE_CLASS="rm-bubble-scale";class Va extends Fo{constructor(t){super(t,Va.SCALE_CLASS)}_doMeasure(t,e,s,i){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}Va.SCALE_CLASS="rm-map-scale";class Ea extends zo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new va(t,!1)),this.add(this.subtitleView=new va(t,!0))}_doMeasure(t,e,s,i){const r=e._title,o=e._subtitle;let n,a=0,h=0,l=0,c=0,d=this.titleView,_=s,u=0,p=0;switch(d.setVisible(r.isVisible())?(n=d.measure(t,r,s,i),h=this._hTitle=n.height,a=this._wTitle=n.width):d.setModel(r),(d=this.subtitleView).setVisible(o.isVisible())?(n=d.measure(t,o,s,i),c=this._hSub=n.height,l=this._wSub=n.width,p=+o.options.titleGap||0):d.setModel(o),o.options.position){case"left":case"right":u=g(h,c),_=a+p+l;break;default:u=h+p+c,_=g(_,a+l)}return u>0&&(u+=this.titleView.visible?b(r.options.gap,0):b(o.options.gap,0)),{width:_,height:u}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,o=i&&i.options,n=r&&r.options,a=i&&i.visible?this._wTitle>t.wMap||"chart"===o.alignBase?t.wChart:t.wMap:0,h=r&&r.visible?this._wSub>t.wMap||"chart"===n.alignBase?t.wChart:t.wMap:0;let l=this._wTitle>t.wMap||i&&"chart"===o.alignBase?0:t.xMap,c=this._wSub>t.wMap||r&&"chart"===n.alignBase?0:t.xMap;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}},d=()=>{const e=g(this._hTitle,this._hSub);m=g(m,m+t(i,e,this._hTitle)),y=g(y,y+t(r,e,this._hSub))},_=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(f=g(f,f+_(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":w=f;break;case"right":w=f+this._wTitle-this._wSub;break;default:w=f+(this._wTitle-this._wSub)/2}else w=g(w,w+_(r,h,this._wSub))},p=b(n.titleGap,0);let m=0,f=l,y=0,w=c;switch(o.align){case"left":switch(n.position){case"left":f=w+this._wSub+p,d();break;case"right":switch(w=f+this._wTitle+p,n.align){case"center":w=g(w,w+(h-this._wTitle-this._wSub)/2);break;case"right":w=g(w,c+h-this._wSub)}d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}break;case"right":switch(n.position){case"left":switch(f+=a-this._wTitle,n.align){case"center":w+=(a-this._wTitle-this._wSub)/2;break;case"right":w=f-p-this._wSub}d();break;case"right":w+=h-this._wSub,f=w-p-this._wTitle,d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}break;default:switch(n.position){case"left":switch(f+=(a-this._wTitle)/2,n.align){case"left":break;case"center":w+=(f-w-this._wSub)/2;break;case"right":w=f-p-this._wSub}d();break;case"right":switch(f+=(a-this._wTitle)/2,n.align){case"left":w=f+this._wTitle+p;break;case"center":w=f+this._wTitle+p,w+=(h-w-this._wSub)/2;break;case"right":w+=h-p-this._wSub}d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}}e.resizeByMeasured().layout().trans(f,m),s.resizeByMeasured().layout().trans(w,y)}else if(a>0||h>0){const t=a?i:r,o=a?e:s,n=a||h,d=a?this._wTitle:this._wSub;let _=a?l:c;switch(o.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":_+=n-d;break;default:_+=(n-d)/2}o.trans(_,0)}}_doLocateInner(t,e,s){}}class Da extends zo{_doInitChildren(t){this.add(this._legendView=new Yo(t))}_doMeasure(t,e,s,i){const r=e._legend,o=this._legendView.measure(t,r,s,i),n=this._loc=r.getLocation();return"left"===n||"right"===n?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,o=0;switch(this._loc){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:o+=e,i-=e}t.trans(r,o).resize(s,i),t.layout()}_doLocateInner(t,e,s){const i=this._legendView,r=i.model.options,o=this.width,n=this.height;let a=+r.offsetX||0,h=0,l=0;switch(r.align){case"right":h+=t-o-a;break;case"center":h+=(t-o)/2+a;break;default:h+=a}switch(a=+r.offsetY||0,r.verticalAlign){case"bottom":l+=e-n-a;break;case"middle":l+=(e-n)/2+a;break;default:l+=a}i.trans(h,l)}}class Ra extends zo{constructor(t,e){super(t),this.loc=e}getView(t){var e;return null===(e=this._views)||void 0===e?void 0:e.find((e=>e.model===t))}setScales(t,e,s){return this._scales=t,this._wChart=e,this._hChart=s,this}_doMeasure(t,e,s,i){const r=this.loc,o=this._prepareScales(t,this._wChart,this._hChart);if(!this.setVisible(o&&o.length>0))return;const n=new Ro;return o.forEach(((e,r)=>{e.measure(t,this._scales[r],s,i)})),r===tt.TOP||r==tt.BOTTOM?o.forEach((t=>{n.width+=t.mw,n.height=g(n.height,t.mh)})):r===tt.LEFT||r===tt.RIGHT?o.forEach((t=>{n.width=g(n.width,t.mw),n.height+=t.mh})):o.forEach((t=>{n.width+=t.mw,n.height+=t.mh})),n}_doLayout(){const t=this.loc,e=this._views;let s=this.width,i=this.height,r=0,o=0;e.forEach((t=>{t.resizeByMeasured(),t.layout()})),t===tt.LEFT||t===tt.RIGHT?e.forEach((t=>{const e=t.model.options,s=+e.offsetY||0;switch(e.verticalAlign){case"bottom":o+=i-t.height-s;break;case"top":o+=s;break;default:o+=(i-t.height)/2+s}t.trans(r,o)})):e.forEach((t=>{const e=t.model.options,i=+e.offsetX||0;switch(e.align){case"right":r+=s-t.width-i;break;case"left":r+=i;break;default:r+=(s-t.width)/2+i}t.trans(r,o)}))}_doLocateInner(t,e,s){this._views.forEach((s=>{const i=s.model.options,r=this.width,o=this.height;let n=+i.offsetX||0,a=0,h=0;switch(i.align){case"right":a+=t-r-n;break;case"center":a+=(t-r)/2+n;break;default:a+=n}switch(n=+i.offsetY||0,i.verticalAlign){case"bottom":h+=e-o-n;break;case"middle":h+=(e-o)/2+n;break;default:h+=n}s.trans(a,h).resize(r,o),s.layout()}))}_prepareScales(t,e,s){const i=this._scales.length;if(this.setVisible(i>0)){const e=this._views||(this._views=[]);for(;e.length<i;)e.push(this.add(this._createView(t)));for(;e.length>i;)e.pop().remove();return e}}}class $a extends Ra{_createView(t){return new Aa(t)}}class Oa extends Ra{_createView(t){return new Ta(t)}}class Fa extends Fo{constructor(e){super(e,"rm-credits"),this.add(this._textView=new Pe(e)),this._textView.anchor=t.TextAnchor.START}click(t){this.model.options.url&&window.open(this.model.options.url,"new")}locateInner(t,e){const s=this.width,i=this.height,r=+t.offsetX||0,o=+t.offsetY||0;let n=0,a=0;switch(t.verticalAlign){case"bottom":a=e.bottom-i;break;case"middle":a=e.y+(e.height-i)/2+o;break;default:a=e.y+o}switch(t.align){case"right":n=e.right-s-r;break;case"center":n=e.x+(e.width-s)/2+r;break;default:n=e.x+r}return{x:n,y:a}}locateOuter(t,e,s){const i=t.location,r=this.width,o=this.height,n=+t.offsetX||0,a=+t.offsetY||0;let h=0,l=0;switch(i){case"left":h=n;break;case"right":h=e-r-n;break;case"top":l=a;break;default:l=s-o-a}if("left"===i||"right"===i)switch(t.verticalAlign){case"top":l=a;break;case"bottom":l=s-o;break;default:l=(s-o)/2+a}else switch(t.align){case"left":h=n;break;case"center":h=(e-r)/2+n;break;default:h=e-r-n}return{x:h,y:l}}_doMeasure(t,e,s,i){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.bbox()}}class Ba extends Et{constructor(t){super(t,"rm-chart"),this._colorScaleMap={},this._bubbleScaleMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new Et(t,"rm-annotations")),this.add(this._bodyView=new xa(t,this)),this.add(this._titleSectionView=new Ea(t)),this.add(this._scaleLayer=new Et(t,"rm-scales")),this.add(this._legendSectionView=new Da(t)),this.add(this._frontAnnotationContainer=new Et(t,"rm-front-annotations")),this.add(this._zoomPanelView=new Ia(t)),this.add(this._drilldownPanelView=new Na(t)),this.add(this._mapScaleView=new Va(t)),this.add(this._creditView=new Fa(t)),this.add(this._tooltipView=new La(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}legendView(){return this._legendSectionView._legendView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}measure(t,e,s,i){const r=(this._model=e)._credits,o=e._legend,n=this._bodyView;let a,h=e.width=s,l=e.height=i;if(this._creditView.setVisible(r.visible)){const e=r.options;switch(a=this._creditView.measure(t,r,h,l),e.location){case"body":break;case"right":case"left":h-=a.width+(+e.offsetX||0)+(+e.gap||0);break;default:l-=a.height+(+e.offsetY||0)+(+e.gap||0)}}if(a=this._titleSectionView.measure(t,e,h,l),l-=a.height,this._legendSectionView.setVisible(o.isVisible()))switch(a=this._legendSectionView.measure(t,e,h,l),o.getLocation()){case"top":case"bottom":l-=a.height;break;case"right":case"left":h-=a.width}n.prepare(t,e.body);for(const r of Object.values(tt)){const o=e._colorScales.getVisibles(r);let n=this._colorScaleMap[r];if(o.length>0){n?n.setVisible(!0):(n=new $a(t,r),this._scaleLayer.add(n),this._colorScaleMap[r]=n);const a=this._colorScaleMap[r].setScales(o,s,i).measure(t,e,h,l);a&&(r===tt.BOTTOM||r===tt.TOP?l-=a.height:r!==tt.RIGHT&&r!==tt.LEFT||(h-=a.width))}else n&&n.setVisible(!1)}for(const r of Object.values(tt)){const o=e._bubbleScales.getVisibles(r);let n=this._bubbleScaleMap[r];if(o.length>0){n?n.setVisible(!0):(n=new Oa(t,r),this._scaleLayer.add(n),this._bubbleScaleMap[r]=n);const a=this._bubbleScaleMap[r].setScales(o,s,i).measure(t,e,h,l);a&&(r===tt.BOTTOM||r===tt.TOP?l-=a.height:r!==tt.RIGHT&&r!==tt.LEFT||(h-=a.width))}else n&&n.setVisible(!1)}n.measure(t,e.body,h,l),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],s,i)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,h,l),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,h,l)}layout(){const t=this._model,e=this.width,s=this.height;let i=e,r=s;const o=this._bodyView;let n=0;const a=t._legend,h=t._credits,l=this._creditView;h.options.gap;let c=0,d=0,_=0,u=0,p=0;if(l.visible){const t=h.options;l.resizeByMeasured();const e=l.width+(+t.offsetX||0)+(+t.gap||0),s=l.height+(+t.offsetY||0)+(+t.gap||0);switch(h.options.location){case"body":break;case"right":i-=_=e;break;case"left":i-=c=e,u+=e;break;case"top":r-=s,p+=s;break;default:r-=d=s}}const g=this._titleSectionView;g.visible&&(g.resizeByMeasured(),g.layout({xMap:u,wMap:i,wChart:e}).trans(0,p),p+=g.height,r-=n=g.height);const m=this._legendSectionView;let f,b,y=0,w=0;if(m.visible)switch(m.resizeByMeasured().layout(),y=m.height,w=m.width,m._loc){case"top":f=p,r-=y,p+=y;break;case"bottom":r-=y,f=p+r;break;case"right":i-=w,b=e-_-w;break;case"left":i-=w,u+=w,b=c}const x=this._colorScaleMap;let v=0,C=0;for(const t in x){const o=x[t];if(o.visible)switch(t===tt.RIGHT||t===tt.LEFT?o.resize(o.mw,s):t===tt.TOP||t===tt.BOTTOM?o.resize(e,o.mh):o.resize(o.mw,o.mh),o.layout(),v=o.height,C=o.width,t){case tt.BOTTOM:r-=v;break;case tt.TOP:r-=v,p+=v;break;case tt.RIGHT:i-=C;break;case tt.LEFT:i-=C,u+=C}}const S=this._bubbleScaleMap;let L=0,A=0;for(const t in S){const e=S[t];if(e.visible&&(e.resizeByMeasured(),"body"!==t))switch(e.layout(),L=e.height,A=e.width,t){case tt.BOTTOM:r-=L;break;case tt.TOP:r-=L,p+=L;break;case tt.RIGHT:i-=A;break;case tt.LEFT:i-=A,u+=A}}const M=pt.create(u,p,i,r);if(l.visible){const t=h.options,i="body"===t.location?l.locateInner(t,M):l.locateOuter(t,e,s);l.transp(i)}o.trans(M.x,M.y),o.resize(M.width,M.height),o.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,M)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,M));let k=0,P=0;if(m.visible){const t=a.options,o=+t.offsetY||0,n=+t.offsetX||0;if("body"===t.location)m.locateInner(i,r);else if(isNaN(f)){if(u=b,"chart"===t.alignBase){switch(t.verticalAlign){case"top":p=o;break;case"bottom":p=s-y-o;break;default:p=(s-y)/2+o}p+y>s&&(p=(s-y)/2)}else switch(t.verticalAlign){case"top":p+=o;break;case"bottom":p=p+r-y-o;break;default:p=p+(r-y)/2+o}p+y>s&&(p=(s-y)/2),p<0&&(p=0),k=m.width}else{if(p=f,"chart"===t.alignBase)switch(t.align){case"left":u=n;break;case"right":u=e-w-n;break;default:u=(e-w)/2+n}else switch(t.align){case"left":u+=n;break;case"right":u=u+i-w-n;break;default:u+=(i-w)/2+n}u+w>e&&(u=(e-w)/2),u<0&&(u=0),P=m.height+o}m.trans(u,p)}for(const t in x){const i=x[t];if(i.visible)if("body"===t)i.locateInner(M.width,M.height).trans(M.x,M.y);else{switch(t){case tt.BOTTOM:default:p=s-d-P-v,u=(e-i.width)/2;break;case tt.TOP:p=n+P,u=(e-i.width)/2;break;case tt.RIGHT:p=(s-i.height)/2,u=e-k-i.width;break;case tt.LEFT:p=(s-i.height)/2,u=k}i.trans(u,p)}}for(const t in S){const i=S[t];if(i.visible)if("body"===t)i.locateInner(M.width,M.height).trans(M.x,M.y);else{switch(t){case tt.BOTTOM:default:p=s-d-P-L,u=(e-i.width)/2;break;case tt.TOP:p=n+P,u=(e-i.width)/2;break;case tt.RIGHT:p=(s-i.height)/2,u=e-k-i.width;break;case tt.LEFT:p=(s-i.height)/2,u=k}i.trans(u,p)}}this.$_layoutAnnotations(e,s,M),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i){const{x:r,y:o}=e.tooltipPos?e.tooltipPos():{x:i.x,y:i.y},n=this._model.chart._tooltip.isFollowPointer(t),a=(n?i.x:r)-this.tx,h=(n?i.y:o)-this.ty;this._tooltipView.show(t,e,a,h,s,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getScaleView(t){for(const e in this._colorScaleMap){const s=this._colorScaleMap[e].getView(t);if(s)return s}}pointerMoved(t,e,s){this._bodyView.pointerMoved(t,e,s)}getButton(t){return this._zoomPanelView.getButton(t)||this._drilldownPanelView.getButton(t)}buttonClicked(t){}updateAnnotation(t){let e=this._annotationViews.find((e=>e.model===t));e&&e.update(this,this.width,this.height)}isAnimating(){}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,o=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);o.forEach((t=>t.remove())),o.length=0,(this._annotations=e).forEach((e=>{const n=r.get(e)||ma(t,e);(e.options.front?i:s).add(n),r.set(e,n),o.push(n)}))}$_layoutAnnotations(t,e,s){const i=this.control._padding;let r,o,n,a;this._annotationViews.forEach((s=>{if("container"===s.model.options.scope)r=-i.left,o=-i.top,n=t+i.left+i.right,a=e+i.top+i.bottom;else r=o=0,n=t,a=e;s._layoutView(this,r,o,n,a)}))}$_layoutPanel(t,e){const s=t.model.options,i=s.offsetX||0,r=s.offsetY||0,o=t.width,n=t.height;let a=e.x,h=e.y;switch(s.verticalAlign){case"bottom":h+=e.height-r-n;break;case"middle":h+=(e.height-n)/2+r;break;default:h+=r}switch(s.align){case"right":a+=e.width-i-o;break;case"center":a+=(e.width-o)/2+i;break;default:a+=i}t.trans(a,h)}}!function(t){t.EXPORT="$$realmap_export"}(Sa||(Sa={}));class za extends Tt{constructor(t,e){super(t,e),this.addElement(this._chartView=new Ba(t)),this.addElement(this._loadingView=new Io(t)),this._loadingView.visible=!1}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new ko(null,((t,e)=>{this.changeModel(t,e)}))}onModelChanged(t,e,s){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e){this.invalidateLayout()}onPointAdded(t,e,s,i){i&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(s)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,s){const i=this._chartView.bodyView();s?i.showSeries(e):i.hideSeries(e)}onExportRequest(t,e){this._export(e)}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearAssetDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===Sa.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}showLoadingView(){this._loadingView.visible=!0}hideLoadingView(){this._loadingView.visible=!1}_creatDefaultTool(){return new Do(this)}_doBeforeRender(t){var e,s;(null===(s=null===(e=this._chart)||void 0===e?void 0:e.options)||void 0===s?void 0:s.chart)&&t.internalResetStyleOrClass(this._chart.options.chart.style)}_doRender(t){var e;const s=this.model,i=this._chartView,r=t.width,o=t.height;this.$_renderLoadingView(r,o),s.options.chart&&(this._setBackgroundStyle(s.options.chart.backgroundStyle),s&&(s.prepareRender(),this._loadModules()),this.loaded||i.clean(),i.measure(this.doc(),s,r,o),i.setRect(t),i.layout(),s&&s.afterRender(),(null===(e=this._chart)||void 0===e?void 0:e._loadCallback)&&(setTimeout(this._chart._loadCallback,0),this._chart._loadCallback=void 0))}_doAfterRender(){this._chartView.bodyView().afterRender()}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealMapExporter;t&&t.RealMapExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e.options.exporting)}}$_renderLoadingView(t,e){const s=za.LOADING_VIEW_LENGTH;this._loadingView.layout({width:s,height:s});const i=t/2+20-s/2,r=e/2+20-s/2;this._loadingView.trans(i,r)}}za.LOADING_VIEW_LENGTH=128;class ja{static getVersion(){return"1.0.4"}static setDebugging(t){Vt.DEBUGGING=t}static setLogging(t){dt.LOGGING=t}static getDistance(t,e){return dt.getDistance(t,e)}static createChart(t,e,s,r=!0,o){S.loadConfigAsync(s,!0);const n=new za(t,e);return i(s)&&n.chart.load(s,r,o),n.chart[Mo]=n,n.chart}static async createChartAsync(t,e,s,r=!0,o){const n=new za(t,e);return n.showLoadingView(),await S.loadConfigAsync(s),i(s)&&n.chart.load(s,r,o),n.chart[Mo]=n,n.hideLoadingView(),n.chart}static preset(t,e){return Ai.createStockInset(t,e)}}const Ha=ja.getVersion,Ga=ja.setDebugging,Ya=ja.setLogging,Wa=ja.getDistance,Za=ja.createChart,Ua=ja.createChartAsync,Xa=ja.preset;t.Annotation=Xe,t.BarSeries=cr,t.Body=vo,t.BodyView=xa,t.BubbleSeries=Ps,t.ChartControl=za,t.ChartElement=Fo,t.ChartItem=je,t.ChartObject=Ao,t.ChartView=Ba,t.CircleElement=Wn,t.CircleGauge=wr,t.ClockGauge=Nr,t.Color=Le,t.ContentView=jo,t.DataPointLabel=ls,t.ElementPool=Ho,t.Exporter=Us,t.FigureSeries=Rr,t.HeatmapSeriesType="heatmap",t.ImageAnnotation=Yi,t.ImageSeries=Fr,t.Legend=Rs,t.LineElement=an,t.LineSeries=Hr,t.MapAxis=ai,t.MapAxisBandGuide=ii,t.MapAxisGuide=ei,t.MapAxisLineGuide=si,t.MapAxisRangeGuide=ri,t.MapChart=ko,t.MapCrosshair=ni,t.MapSeries=Zr,t.MapSeriesType="map",t.MarkerSeries=bs,t.MarkerSeriesPoint=fs,t.MarkerSeriesPointView=wn,t.MarkerSeriesView=xn,t.ORG_ANGLE=N,t.OrthogonalSparkSeries=Cs,t.PI_2=I,t.PanelSeries=Qr,t.PieSeries=eo,t.PinSeries=ro,t.PointElement=mn,t.PointLabelView=dn,t.PointSeries=ao,t.PointViewPool=cn,t.RAD_DEG=V,t.RectElement=Je,t.RmElement=Vt,t.RouteSeries=co,t.RouteSeriesType=qe,t.SectionView=zo,t.SectorElement=Bn,t.Series=us,t.SeriesAnimation=Nn,t.SeriesView=yn,t.ShapeAnnotation=Wi,t.Size=Ro,t.SparkSeries=xs,t.Subtitle=Hi,t.TextAnnotation=Zi,t.TextElement=Pe,t.TiledWebSeriesType="tiledweb",t.Title=ji,t.Utils=dt,t.ValueSeries=ms,t.VectorSeries=uo,t.WaffleSeries=go,t._isIE=ct,t.absv=m,t.assignObj=l,t.calcPercent=W,t.copyObj=f,t.cos=_,t.createChart=Za,t.createChartAsync=Ua,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=Be,t.fixnum=D,t.getDistance=Wa,t.getVersion=Ha,t.incv=v,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=i,t.isString=n,t.maxv=g,t.minv=p,t.parsePercentSize=Y,t.pickNum=b,t.pickProp=w,t.pickProp3=x,t.pixel=O,t.preset=Xa,t.rectToSize=ut,t.setDebugging=Ga,t.setLogging=Ya,t.sin=u}));
|
|
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).RealMap={})}(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,o=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},a=function(t){return"number"==typeof t},h=function(t){return"boolean"==typeof t},l=Object.assign,c=Math.floor,d=Math.ceil,_=Math.cos,u=Math.sin,p=Math.min,g=Math.max,m=Math.abs,f=function(t){if(t&&"object"==typeof t&&!r(t))return l({},t)},b=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},y=function(t,e,s){let i=parseFloat(t);return isNaN(i)?(i=parseFloat(e),isNaN(i)?parseFloat(s):e):t},w=function(t,e){return void 0!==t?t:e},x=function(t,e,s){return void 0!==t?t:void 0!==e?e:s},v=(t,e,s)=>t+(e-t)*s;class C{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}C._debugging=!1;class S{static async loadConfigAsync(t,e=!1){if(t&&t.map){if(n(t.map))t.map={url:t.map};else if(r(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const s=r(t.map)?t.map:[t.map];for(const t of s)!i(t.source)&&n(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await fetch(t.url).then(t=>t.json()))}if(t&&t.series){const s=r(t.series)?t.series:[t.series];for(const t of s)!i(t.data)&&!r(t.data)&&n(t.dataUrl)&&t.dataUrl&&(e?console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl):(t.data=await fetch(t.dataUrl).then(t=>t.json()),delete t.dataUrl))}}}const L={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},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",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let A=L.ko;const M=void 0,k="%".charCodeAt(0),P=Math.PI,I=2*P,N=-P/2,T=P/180,E=180/P;function V(t){return t>I?t%I:t}function D(t){return parseFloat(t.toPrecision(12))}function R(t){return t*Math.PI/180}function $(t){return 180*t/Math.PI}function O(t){return t+"px"}function F(t){return t+"%"}function B(t){return null==t||Number.isNaN(t)||""===t}function z(t){return null==t||Number.isNaN(t)||""===t}function j(t){return t<10?"0"+t:String(t)}function H(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function G(t,e){const s={};return s[t]=e,s}function Y(t,e){let s,i;if(null==t||Number.isNaN(t)){if(e)return null;i=0,s=!0}else if(!(s=!isNaN(i=+t))){const s=t.trim();if(s.charCodeAt(s.length-1)===k&&(i=1===s.length?NaN:parseFloat(s)),isNaN(i)){if(e)return null;K(A.invalidSizeValue,t)}}return{size:i,fixed:s}}function W(t,e,s=NaN){return t?t.fixed?t.size:t.size*e/100:s}const Z={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"},U=function(t){const e=Z[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Z[t]=e,e}return e};var X;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(X||(X={}));const K=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},q="vertical-lr",J="vertical-rl";function Q(t){const e=String(t).split(/\s+/g),s=b(parseFloat(e[0]),0),i=parseFloat(e[1]),r=parseFloat(e[2]),o=parseFloat(e[3]);return{l:isNaN(o)?isNaN(i)?s:i:o,r:isNaN(i)?s:i,t:s,b:isNaN(r)?s:r}}const tt={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},et=Object.freeze([0,0]);function st(t){return isFinite(t[0]+t[1])}function it(t){let e=1/0,s=1/0,i=-1/0,r=-1/0;for(const o of t){const t=o.map(t=>t[0]),n=o.map(t=>t[1]);e=p(e,...t),s=p(s,...n),i=g(i,...t),r=g(r,...n)}return{h1:e,v1:s,h2:i,v2:r}}const rt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const ot="undefined"!=typeof navigator?navigator.userAgent:"",nt=ot?navigator.appVersion:"",at=!!ot.match(/Trident.*rv\:11\./),ht=-1!==nt.indexOf("MSIE 10"),lt=-1!==nt.indexOf("MSIE 9"),ct=at||ht||lt;class dt{static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}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&&dt.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(p(s,dt.month_days[dt.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(),o=new Date(r,i,1).getDay(),n=new Date(r,i+1,0).getDate(),a=t.getDate()+o-1,h=e+Math.ceil((n+o-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 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 isNum(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 getNum(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNum(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()-rt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=g(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=r(t)?[]:{};for(let s of Object.keys(t))e[s]=dt.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(),dt.log(t,+new Date-s+"ms")}static clamp(t,e,s){return g(e,p(s,t))}static clampEx(t,e,s){return isNaN(e)||(t=g(e,t)),isNaN(s)||(t=p(s,t)),t}static makeIntArray(t,e){const s=new Array(g(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static uniqueKey(){return Math.random().toString(36).substring(2,10)}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=m(t);if(i>=1e3){let r=e.length;for(;r>0;){const o=Math.pow(1e3,r--);if(o<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%o==0))return{value:t/o,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const s=(e[0]-t[0])*T,i=(e[1]-t[1])*T,r=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t[0]*T)*Math.cos(e[0]*T)*Math.sin(i/2)*Math.sin(i/2);return 6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)))}static getLogger(t){if(t>=2)return function(e){return Math.log(e)/Math.log(t)}}static getMinMax(t){let e=t[0],s=t[0];for(let i=1;i<t.length;i++)e=p(e,t[i]),s=g(s,t[i]);return{min:e,max:s}}}dt.LOGGING=!1,dt.week_days=["일","월","화","수","목","금","토"],dt.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],dt.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]];const _t=Object.freeze({x:0,y:0,width:0,height:0});function ut(t){return{width:t.width,height:t.height}}class pt{static create(t,e,s,i){const r=arguments.length;return dt.isObject(t)?new pt(t.x,t.y,t.width,t.height):r<2?new pt(t,t,t,t):r<3?new pt(t,e,t,e):new pt(t,e,s,i)}constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get left(){return this.x}set left(t){const e=t-this.x;this.x+=e,this.width-=e}get right(){return this.x+this.width}set right(t){const e=t-(this.x+this.width);this.width+=e}get top(){return this.y}set top(t){const e=t-this.y;this.y+=e,this.height-=e}get bottom(){return this.y+this.height}set bottom(t){const e=t-(this.y+this.height);this.height+=e}get isEmpty(){return 0===this.width||0===this.height}get isValid(){return function(t){return!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))}(this)}clone(){return new pt(this.x,this.y,this.width,this.height)}getInner(){return new pt(0,0,this.width,this.height)}equals(t){return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}leftBy(t){return this.x+=t,this.width-=t,this}rightBy(t){return this.width+=t,this}topBy(t){return this.y+=t,this.height-=t,this}bottomBy(t){return this.height+=t,this}shrink(t,e){return this.width-=t,this.height-=e,this}expand(t,e){return this.width+=t,this.height+=e,this}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}setEmpty(){return this.width=this.height=0,this}move(t=0,e=0){return this.x=t,this.y=e,this}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}setWidth(t){return this.width=t,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyHorz(t){return this.x=t.x,this.width=t.width,this}copyVert(t){return this.y=t.y,this.height=t.height,this}inflate(t=0,e,s,i){return e=void 0!==e?e:t,s=void 0!==s?s:t,i=void 0!==i?i:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),s&&(this.right=this.right+s),i&&(this.bottom=this.bottom+i),this}offset(t,e){return this.x+=t,this.y+=e,this}round(){const t=this.clone();return t.x>>>=0,t.y>>>=0,t.width>>>=0,t.height>>>=0,t}union(t){const e=this.clone();return e.left=Math.min(this.x,t.x),e.right=Math.max(this.right,t.right),e.top=Math.min(this.y,t.y),e.bottom=Math.max(this.bottom,t.bottom),e}normalize(){return this.width<0&&(this.x-=this.width,this.width*=-1),this.height<0&&(this.y-=this.height,this.height*=-1),this}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}pt.Empty=new pt,pt.Temp=new pt;const gt={inOutSine:t=>-(_(P*t)-1)/2};class mt{constructor(){this.delay=0,this.duration=mt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=p(1,g(0,D(t/this.duration)));this._easing&&(e=this._easing(e));try{this._timer&&this._canUpdate()&&!1!==this._doUpdate(e)||this._stop()}finally{t>=this.duration?this._stop():this._started&&this._timer&&(this._ani=window.requestAnimationFrame(this._handler))}}}setDuration(t){return this.duration=t,this}start(t){return t&&(this.endHandler=t),this._start(this.duration,this.delay,this.easing),this}stop(){this._stop()}_start(t,e=0,s=null){this._started&&this._stop(),this.duration=b(t,mt.DURATION),this.delay=e||0,this._easing=gt[s],this._doStart(),this._started=+new Date,this._timer=setTimeout(()=>this._stop(),1.2*this.duration),this._handler()}_stop(){var t;this._started&&(cancelAnimationFrame(this._ani),clearTimeout(this._timer),this._timer=null,this._started=null,this._doStop(),null===(t=this.endHandler)||void 0===t||t.call(this,this))}_doStart(){}_doStop(){}_canUpdate(){return!0}}mt.DURATION=700,mt.SHORT_DURATION=300;let ft=0;class bt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(ft++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestory(),this.$_destroyed=!0),null}_doDestory(){}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 yt extends bt{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 wt=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),xt=.001,vt=Math.PI;class Ct{static line(t,e,s,i){return["M",t,e,"L",s,i]}static lines(...t){let e=0;const s=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)s.push("L",t[e],t[e+1]);return s}static lines2(...t){let e=0;const s=["M",t[e].x,t[e].y];for(;e<t.length;e++)s.push("L",t[e].x,t[e].y);return 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,o){return r>0?o>0?(r=p(-i/2,s/2,r),["M",t,e-(o=p(-i/2,s/2,o)),"v",i+o+r,"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r-o,"a",o,o,0,0,1,-o,o,"h",2*o-s,"a",o,o,0,0,1,-o,-o,"Z"]):["M",t,e,"v",i+(r=p(-i/2,s/2,r)),"a",r,r,0,0,1,r,-r,"h",s-2*r,"a",r,r,0,0,1,r,r,"v",-i-r,"Z"]:o>0?["M",t,e-(o=p(-i/2,s/2,o)),"v",i+o,"h",s,"v",-i-o,"a",o,o,0,0,1,-o,o,"h",2*o-s,"a",o,o,0,0,1,-o,-o,"Z"]:["M",t,e,"h",s,"v",i,"h",-s,"v",-i,"Z"]}static square(t,e,s,i){const r=p(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 ellipse(t,e,s,i){return this.arc(t+s/2,e+i/2,s/2,i/2,0,2*Math.PI,!0,!0)}static arc(t,e,s,i,r,o,n,a=!1){const h=V(m(o-r)),l=2*vt-h<.01,c=h-vt<.01?0:1,d=n?1:0,p=_(r),g=u(r),f=_(o-=l?d?xt:-.001:0),b=u(o),y=[];return y.push("M",t+s*p,e+i*g,"A",s,i,0,c,d,t+s*f,e+i*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,s,i,r,o,n,a){const h=V(m(n-o)),l=2*vt-h<xt;let c=h-vt<xt?0:1;const d=a?1:0,p=_(o),g=u(o),f=_(n-=l?d?xt:-.001:0),b=u(n),y=s*r,w=i*r,x=[];return x.push("M",t+s*p,e+i*g,"A",s,i,0,c,d,t+s*f,e+i*b),l?x.push("M",t+y*f,e+w*b):x.push("L",t+y*f,e+w*b),isNaN(y)||x.push("A",y,w,0,c,1-d,t+y*p,e+w*g),x.push("Z"),x}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 o=t+s/2,n=e+i/2+(i/2-i/2*u(r+6*Math.PI/5))/2,a=s/2,h=i/2,l=s/4,c=i/4,d=2*Math.PI/5,p=d/2,g=[];g.push("M",o+a*_(r),n+h*u(r));for(let t=0;t<5;t++)g.push("L",o+a*_(r),n+h*u(r),"L",o+l*_(r+p),n+c*u(r+p)),r+=d;return g.push("Z"),g}static setShape(t,e,s,i){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=Ct[e](0,0,2*s,2*i);break;default:r=Ct.circle(s,i,p(s,i))}t.setPath(r)}static pin(t){const{rd:e,cx:s,cy:i,innerRd:r}=t,o=["M",0,0,"C",0,0,.8*-e,-e,-e,2*-e,"A",e,e,1,1,1,e,2*-e,"C",e,2*-e,.8*e,-e,0,0,"Z"];return r>0&&o.push("M",s-r,i,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),o}}const St={minimumZoom:200,maximumZoom:1600};var Lt;!function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Lt||(Lt={}));const At={name:"RealMap",version:"1.0.5",license:"enterprise",code:""};class Mt{static decode(t){const e=Mt.CHARS,s=Mt.PAD;let i=t.split(""),r=[],o=i.length;for(;i[--o]==s;);for(let t=0;t<o;){let s=e.indexOf(i[t++])<<18;t<=o&&(s|=e.indexOf(i[t++])<<12),t<=o&&(s|=e.indexOf(i[t++])<<6),t<=o&&(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}}Mt.PAD="=",Mt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class kt{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 o=e.s0[255&t];let n=(o>>16)+(r>>16)+((65535&o)+(65535&r)>>16)<<16|(65535&o)+(65535&r)&65535;return n=(n>>16^i>>16)<<16|65535&(65535&n^65535&i),(n>>16)+(s>>16)+((65535&n)+(65535&s)>>16)<<16|(65535&n)+(65535&s)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const s=kt.xor,i=kt.union;let r=t.left,o=t.right;r=s(r,e.p[0]),o=s(o,s(i(r,e),e.p[1])),r=s(r,s(i(o,e),e.p[2])),o=s(o,s(i(r,e),e.p[3])),r=s(r,s(i(o,e),e.p[4])),o=s(o,s(i(r,e),e.p[5])),r=s(r,s(i(o,e),e.p[6])),o=s(o,s(i(r,e),e.p[7])),r=s(r,s(i(o,e),e.p[8])),o=s(o,s(i(r,e),e.p[9])),r=s(r,s(i(o,e),e.p[10])),o=s(o,s(i(r,e),e.p[11])),r=s(r,s(i(o,e),e.p[12])),o=s(o,s(i(r,e),e.p[13])),r=s(r,s(i(o,e),e.p[14])),o=s(o,s(i(r,e),e.p[15])),r=s(r,s(i(o,e),e.p[16])),t.right=r,t.left=s(o,e.p[17])}static _decryptBlock(t,e){const s=kt.xor,i=kt.union;let r=t.left,o=t.right;r=s(r,e.p[17]),o=s(o,s(i(r,e),e.p[16])),r=s(r,s(i(o,e),e.p[15])),o=s(o,s(i(r,e),e.p[14])),r=s(r,s(i(o,e),e.p[13])),o=s(o,s(i(r,e),e.p[12])),r=s(r,s(i(o,e),e.p[11])),o=s(o,s(i(r,e),e.p[10])),r=s(r,s(i(o,e),e.p[9])),o=s(o,s(i(r,e),e.p[8])),r=s(r,s(i(o,e),e.p[7])),o=s(o,s(i(r,e),e.p[6])),r=s(r,s(i(o,e),e.p[5])),o=s(o,s(i(r,e),e.p[4])),r=s(r,s(i(o,e),e.p[3])),o=s(o,s(i(r,e),e.p[2])),r=s(r,s(i(o,e),e.p[1])),t.right=r,t.left=s(o,e.p[0])}static _init(t){let e=t.split("").map(function(t){return 255&t.charCodeAt(0)});const s=kt.kb,i=kt._encryptBlock;let r,o,n,a=0,h=0,l={left:0,right:0};const c={p:s.p.slice(0).map(function(t){let s,i=e.length;for(s=0;s<4;s++)h=h*kt.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,n=c.p.length;r<n;)i(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(o=0,n=c["s"+r].length;o<n;)i(l,c),c["s"+r][o++]=l.left,c["s"+r][o++]=l.right;return c}static decrypt(t,e){const s=kt._decryptBlock;let i=kt._init(e),r=[],o=Mt.decode(t),n=o.length>>3,a=0,h={left:null,right:null};for(let t=0;t<n;t++){h.left=o[a]*kt.POW24|o[a+1]*kt.POW16|o[a+2]*kt.POW8|o[a+3],h.right=o[a+4]*kt.POW24|o[a+5]*kt.POW16|o[a+6]*kt.POW8|o[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)}}kt.POW2=Math.pow(2,2),kt.POW3=Math.pow(2,3),kt.POW4=Math.pow(2,4),kt.POW8=Math.pow(2,8),kt.POW16=Math.pow(2,16),kt.POW24=Math.pow(2,24),kt.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 Pt{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substring(1),e.substring(e.indexOf(t))==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}const o=r.split(".").length,n=r.indexOf("*");if(o>=2&&o<=4&&n>=2){const t=r.substring(0,n);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},s=kt.decrypt(t,"dkdl"+this._getLDKey(kt.kb.k)).split(";");for(let t=0,i=s.length;t<i;t++){const i=s[t].split("="),r=i[0],o=i[1];o&&o.length>0&&(e[r]=o)}return e}}let It=651212;class Nt{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach(e=>t.classList.add(e))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach(e=>t.classList.remove(e))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,o=e.documentElement,n=s.pageYOffset||o.scrollTop||r.scrollTop,a=s.pageXOffset||o.scrollLeft||r.scrollLeft,h=o.clientTop||r.clientTop||0,l=o.clientLeft||r.clientLeft||0,c=i.left+a-l,d=i.top+n-h;return{x:Math.round(c),y:Math.round(d)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const o=t.style;o.left=e+"px",o.top=s+"px",o.width=i+"px",o.height=r+"px"}static setBoundsEx(t,e,s,i,r){const o=t.style;!isNaN(e)&&(o.left=e+"px"),!isNaN(s)&&(o.top=s+"px"),!isNaN(e)&&(o.width=i+"px"),!isNaN(e)&&(o.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)Nt.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach(e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())})}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static removeStyles(t,e){if(e)for(const s in e)t[s]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,s){if(e!=s){if(s)for(const e in s)t[e]="";return e&&Object.assign(t,e),e}return s}static createElement(t,e,s){const i=t.createElement(e);return s&&Object.assign(i.style,s),i}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,o="none"){const n={},a={};return n[e]=s,a[e]=i,t.animate([n,a],{duration:r,fill:o})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+It++}static createBR(t,e){const s=t.createElement("br");return s.className=e,s}static createSpan(t,e){const s=t.createElement("span");return e&&Object.assign(s.style,e),s}static createCheckBox(t,e){const s=t.createElement("input");return s.type="checkbox",e&&Object.assign(s.style,e),s}static createRadio(t,e){const s=t.createElement("input");return s.type="radio",e&&Object.assign(s.style,e),s}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 getPaddingEx(t){const e=this.getPadding(t);return e.horz=e.left+e.right,e.vert=e.top+e.bottom,e}static stopAnimation(t){if(t)try{t.finish()}catch(t){C.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}}const Tt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class Et extends bt{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._invalidElements=[],this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._windowResized()},this._clickHandler=t=>{var e;this._doClick(t),null===(e=this._tool)||void 0===e||e.click(t)},this._dblClickHandler=t=>{var e;this._doDblClick(t),null===(e=this._tool)||void 0===e||e.dblClick(t)},this._touchStartHandler=t=>{var e;this._doTouchStart(t),null===(e=this._tool)||void 0===e||e.touchStart(t)},this._touchMoveHandler=t=>{var e;t.touches.length<2&&this._scrolling?t.preventDefault():(this._doTouchMove(t),null===(e=this._tool)||void 0===e||e.touchMove(t))},this._touchEndHandler=t=>{var e;this._doTouchEnd(t),null===(e=this._tool)||void 0===e||e.touchEnd(t)},this._pointerDownHandler=t=>{var e;this._doPointerDown(t)||null===(e=this._tool)||void 0===e||e.pointerDown(t)},this._pointerMoveHandler=t=>{var e;this._doPointerMove(t),null===(e=this._tool)||void 0===e||e.pointerMove(t)},this._pointerUpHandler=t=>{var e;this._doPointerUp(t),null===(e=this._tool)||void 0===e||e.pointerUp(t)},this._pointerCancelHandler=t=>{var e;this._doPointerCancel(t),null===(e=this._tool)||void 0===e||e.pointerCancel(t)},this._pointerLeaveHandler=t=>{var e;this._doPointerLeave(t),null===(e=this._tool)||void 0===e||e.pointerLeave(t)},this._keyPressHandler=t=>{var e;this._doKeyPress(t),null===(e=this._tool)||void 0===e||e.keyPress(t)},this._wheelHandler=t=>{var e;this._doWheel(t),null===(e=this._tool)||void 0===e||e.wheel(t)},function(){const t=location.hostname;let e;try{if(e=realMapLic,!e)return!1}catch(t){return!1}const s=Pt.decrypt(e);if("RealMap"!=s.name||"RealMap"!==At.name)return!1;const i=s.server.toLowerCase(),r=location.pathname.toLowerCase();if(At.license!=Lt.Developer&&!Pt.includedDomains(i,t.toLowerCase(),r))return!1;const o=s.lic.toLowerCase();if(!Object.values(Lt).includes(o))return!1;if(At.code=s.code,At.license=s.lic,o==Lt.Evaluation||o==Lt.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)return!1}return!0}()?(!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||Et.CLASS_NAME),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)):console.error("need license!")}_doDestory(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),Nt.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}activeTool(){return this._activeTool||this._tool}setSctiveTool(t){t!==this._activeTool&&(this._activeTool=t,this._tool=t||this._defaultTool)}clearDefs(){Nt.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(Vt.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(Vt.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}removeElement(t){this._root.removeChild(t)}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){return this.clip(new zt(this.doc(),t,e,s,i,r,r))}clip(t){return this._defs.appendChild(t.dom),t}_setTesting(){this._testing=!0,Vt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchstart",this._touchStartHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"touchend",this._touchEndHandler),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)}_unresigterEventHandlers(t){window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("touchend",this._touchEndHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,s,i){if(this._inited)return;s instanceof HTMLDivElement?this._container=s:this._container=t.getElementById(s),this._container instanceof HTMLDivElement||K(A.invalidOuterDiv,s);const r=this._container.ownerDocument,o=this._dom=r.createElement("div");Object.assign(o.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),o.className=i,this._container.appendChild(o);const n=this._svg=r.createElementNS(e,"svg");n.classList.add("rm-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",n.appendChild(a);const h=this._defs=r.createElementNS(e,"defs");this._initDefs(r,h),n.appendChild(h),o.appendChild(n),this._root=new Rt(this),n.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),o.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),o.appendChild(this._debugger),Object.assign(this._debugger.style,{position:"absolute",left:"0px",top:"0px",fontSize:"20px",background:"black",color:"white"}),this._defaultTool=this._tool=this._creatDefaultTool()}_initDefs(t,s){let i=t.createElementNS(e,"filter");const r=t.createElementNS(e,"feDropShadow");i.setAttribute("id",Et.SHADOW_FILTER),r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("flood-color","#000"),r.setAttribute("flood-opacity","0.75"),r.setAttribute("stdDeviation","1.5"),i.appendChild(r),s.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=requestAnimationFrame(()=>this.$_render()):this._requestTimer=setTimeout(()=>{this.$_render()},0))}updateNow(){this.$_render()}$_render(){if(this.orphaned)return;const t=+new Date;if(t<=this._toAnimation)this.$_requestRender();else{try{this._doBeforeRender(this._root);const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._padding=Nt.getPadding(this._root.dom),i=s.left,r=s.top,o=this._svg.clientWidth-i-s.right,n=this._svg.clientHeight-r-s.bottom;this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:i,y:r,width:o,height:n});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=i+(o-t.width)/2+"px",a.style.top=r+(n-t.height)/2+"px"}else a.style.display="none"}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._invalidElements=[],this._doAfterRender()}dt.log("render in "+(+new Date-t)+"ms.")}}_setBackgroundStyle(t){Object.assign(this._dom.style,t)}setDebug(t){this._debugger.textContent=t,this.invalidateLayout()}_doBeforeRender(t){}_doAfterRender(){}_doClick(t){}_doDblClick(t){}_doTouchStart(t){}_doTouchMove(t){return!0}_doTouchEnd(t){}_doPointerDown(t){return!1}_doPointerMove(t){}_doPointerUp(t){}_doPointerCancel(t){}_doPointerLeave(t){}_doKeyPress(t){}_doWheel(t){}_windowResized(){this.invalidateLayout()}}Et.CLASS_NAME="rm-control",Et.SHADOW_FILTER="rm-shadow-filter";class Vt extends bt{static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,s,i){for(;e.length<s;){const s=i();t.add(s),e.push(s)}}static fit(t,e,s,i,r,o){for(;s.length>i;)s.pop().remove();for(;s.length<i;){const i=new r(t,o);e.add(i),s.push(i)}}constructor(t,s,i=M){super(),this._visible=!0,this._zIndex=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",s),this._doInitStyles()}_doInitStyles(){}_doDestory(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get zIndex(){return this._zIndex}set zIndex(t){t!==this._zIndex&&(this._zIndex=t)}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get visible(){return this._visible}set visible(t){this.setVisible(t)}setVisible(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}containsDom(t){return this._dom.contains(t)}addDom(t){return this._dom.appendChild(t),t}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}addAll(...t){t.forEach(t=>this.add(t))}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._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}removeChild(t){t&&t._parent===this&&(this._dom.removeChild(t._dom),t._parent=null,t._doDetached(this))}remove(){return this._parent&&this._parent.removeChild(this),this}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}moveToLast(t){t._parent===this&&this.dom.appendChild(t._dom)}isValidPathData(t){return"string"==typeof t&&/^[Mm]/.test(t.trim())}getAttr(t){return this.dom.getAttribute(t)}setAttr(t,e){return this.dom.setAttribute(t,e),this}hasAttr(t){return this.dom.hasAttribute(t)}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).resize(s,i),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return pt.create(this._tx,this._ty,this.width,this.height)}getSize(){return{width:this.width,height:this.height}}bbox(){return this._dom.getBBox()}move(t,e){return this.x=t,this.y=e,this}scale(t,e){return isNaN(e)&&(e=t),t===this._scaleX&&t===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=dt.isValidNum(t)?t:this._tx,e=dt.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=dt.isValidNum(t)?t:this._tx,e=dt.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()}))}this._tx=t,this._ty=e,this._updateTransform()}return this}transX(t){return t!==this._tx&&dt.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&dt.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){this._saveStyle!==M&&(this._dom.setAttribute("style",this._saveStyle),delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(U(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(U(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(U(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let s in t)e.setProperty(U(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")}setClass(t){this._styleName=t,this._resetClass()}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){n(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),n(t)?this._dom.classList.add(t):this.internalSetStyles(t)}_setBackgroundBorderRadius(t){}setBackStyles(t){const e=this.dom.style;let s=!1;if(t){for(let i in t)if(i in Tt&&this._styles[i]!==t[i]){if("borderRadius"===i)this._setBackgroundBorderRadius(b(parseFloat(t[i]),0)),this._styles[i]=t[i];else if(i in Tt){const s=Tt[i];e[s]=this._styles[s]=t[i]}s=!0}s&&(this._styleDirty=!0)}return s}setStyle(t,e){let s=!1;return t in Tt||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)}internalSetImportantStyle(t,e){this.dom.style.setProperty(t,e,"important")}setBackStyle(t,e){let s=!1;return t in Tt&&e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}putStyles(t,e){if(e=e||{},t)for(let s in t)e[s]=t[s];return e}putStyle(t,e,s){return(s=s||{})[t]=e,s}setColor(t){return this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t,this}getFill(){return this._styles.fill}getStroke(){return this._styles.stroke}setFill(t){return this.dom.style.fill=this._styles.fill=t,this}setStroke(t){return this.dom.style.stroke=this._styles.stroke=t,this}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){this.dom.dataset[t]=w(e,"")}unsetData(t){delete this.dom.dataset[t]}setBoolData(t,e){e?this.dom.dataset[t]="":delete this.dom.dataset[t]}hasData(t){return null!=this.dom.dataset[t]}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});s&&s.addEventListener("finish",()=>{this.remove(),null==e||e(this)})}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});e&&e.addEventListener("finish",()=>{this.setVisible(!1)})}else this.setVisible(!1);return this}ignorePointer(){this._dom.style.pointerEvents="none"}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}setCursor(t){this._dom.style.cursor=t}clipRect(t,e,s,i,r=0){const o=this.control.clipBounds(t,e,s,i,r);return this.$_setClip(o),o}clipPath(t){const e=this.control.clip(new jt(this.doc).setPath(t));return this.$_setClip(e),e}attachClipPath(t){this.setAttr("clip-path",this.createClipId(t))}detachClipPath(){this.unsetAttr("clip-path")}$_setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}createClipId(t){return"url(#"+(t.id||t)+")"}sort(t){t.forEach(t=>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 Vt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(dt.isValidNum(e)||dt.isValidNum(s))&&(e=e||0,s=s||0,i=["translate("+e+","+s+")"]),dt.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")"),this._rotation&&i.push("rotate("+this._rotation+" "+dt.pick(this._originX,t.getAttribute("x"),0)+" "+dt.pick(this._originY,t.getAttribute("y")||0)+")");const r=dt.getNum(this._scaleX,1),o=dt.getNum(this._scaleY,1);1===r&&1===o||i.push("scale("+r+" "+o+")"),i.length&&this._dom.setAttribute("transform",i.join(" "))}}Vt.TESTING=!1,Vt.DEBUGGING=!1,Vt.ASSET_KEY="_asset_",Vt.TEMP_KEY="_temp_";class Dt extends Vt{constructor(t,e=void 0){super(t,e,"g")}}class Rt extends Vt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class $t extends Vt{constructor(t,e=void 0,s=void 0){super(t,e,"path"),s&&this.setPath(s)}path(){return this._path}setPath(t){const e=n(t)?t:null==t?void 0:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Ot extends Vt{constructor(t,e,s=!1){super(t,e,s?"g":"path"),this.group=s}path(){return this._path}setPath(t){const e=n(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class Ft extends Vt{constructor(t){super(t,M,"mask");const e=this._id=dt.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Bt extends Vt{constructor(t){super(t,M,"clipPath");const e=this._id=dt.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class zt extends Bt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,o=0,n=0){super(t);const a=this._rect=new Vt(t,null,"rect");a.setAttr("fill","none"),o>0&&a.setAttr("rx",String(o)),n>0&&a.setAttr("ry",String(n)),isNaN(e)||a.setBounds(e,s,i,r),this.add(a)}setBounds(t,e,s,i){return this._rect.move(t,e),this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class jt extends Bt{constructor(t,e){super(t),this._path=new $t(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var Ht;!function(t){t.SIDO="sido"}(Ht||(Ht={}));const Gt="shuffle",Yt="random";var Wt;class Zt{constructor(t){this.source=t}hasDef(){return!0}}class Ut extends Zt{_setStops(t,s){const i=t.createElementNS(e,"stop"),o=t.createElementNS(e,"stop"),n=this.source.color,a=B(this.source.opacity)?1:this.source.opacity,h=r(n)?n[0]:n,l=r(n)&&n.length>1?n[1]:"white",c=r(a)?a[0]:a,d=r(a)&&a.length>1?a[1]:a;s.setAttribute("id",this.source.id),i.setAttribute("offset","0"),i.setAttribute("stop-color",h),i.setAttribute("stop-opacity",c),o.setAttribute("offset","1"),o.setAttribute("stop-color",l),o.setAttribute("stop-opacity",d),s.appendChild(i),s.appendChild(o)}}class Xt extends Ut{getElement(t,s){const i=t.createElementNS(e,"linearGradient");let{x1:r,x2:o,y1:n,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),s.dir){case"up":n=1;break;case"right":o=1;break;case"left":r=1;break;default:a=1}return i.setAttribute("x1",r),i.setAttribute("y1",n),i.setAttribute("x2",o),i.setAttribute("y2",a),i}}Xt.TYPE="lineargradient";class Kt extends Ut{getElement(t,s){const i=t.createElementNS(e,"radialGradient");return B(s.cx)||i.setAttribute("cx",s.cx),B(s.cy)||i.setAttribute("cy",s.cy),B(s.r)||i.setAttribute("r",s.r),this._setStops(t,i),i}}Kt.TYPE="radialgradient";class qt extends Zt{getElement(t,s){const r=t.createElementNS(e,"pattern"),o=t.createElementNS(e,"path");let a,h,c,d,_=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+s.pattern>=0){const t=qt.STOCK[+s.pattern%qt.STOCK.length];a=t.path,h=t.style,_=!t.fill,c=t.width||20,d=t.height||20}else n(s.pattern)&&(a=s.pattern,c=s.width||s.height||20,d=s.height||s.width||20);r.setAttribute("width",String(c)),r.setAttribute("height",String(d)),o.setAttribute("d",a),h&&l(o.style,h),s.style&&l(o.style,s.style),_&&(o.style.fill="none");let u=s.backgroundStyle;if(n(u)||i(u)){const s=t.createElementNS(e,"rect");r.append(s),s.style.fill=n(u)?u:u.fill,s.setAttribute("width",String(c)),s.setAttribute("height",String(d))}return s.transform&&r.setAttribute("patternTransform",s.transform),r.append(o),r}}Wt=qt,qt.TYPE="pattern",qt.STOCK=[{path:"M10 2.52H0M0 7.48h10M7.48 10V0M2.52 0v10",width:10,height:10,style:{strokeWidth:"0.3px",stroke:"#333"}},{path:"M3 2a1 1 0 101 1A1 1 0 003 2M8 6a1 1 0 101 1A1 1 0 008 6",width:10,height:10,fill:!0,style:{fill:"#333"}},{path:"m8 6-.86.86-.86-.86-.48.48.86.86-.86.86.48.48.86-.86.86.86.48-.48-.86-.86.86-.86L8 6zM4 2l-.86.85-.86-.85-.48.48.85.86-.85.86.48.48.86-.86.86.86.48-.48-.86-.86.86-.86L4 2z",width:10,height:10,fill:!0},{path:"M0 5 1 6H0ZM0 0 6 6V5L1 0Z",width:6,height:6,fill:!0},{path:"M4.54 3h.92L5 2.54 4.54 3ZM7.58 3h.85L5.42 0H4.58L1.57 3h.85L5 .42 7.58 3Zm.01-3L10 2.41V1.6L8.4 0H7.59ZM0 1.6v.81L2.41 0H1.6L0 1.6Z",width:10,height:3,fill:!0},{path:"m5.8 11.27-.82-.51-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95Zm0-9.99L4.98.77l-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95ZM.81 6.27 0 5.76l-.8.51.25-.96-.76-.62.98-.04.37-.92.34.89.96.08-.75.63.22.95Zm9.99 0-.82-.51-.8.51.25-.96-.76-.62.98-.04.38-.92.34.89.96.08-.75.63.22.95ZM7.51 7.02l-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm-4.99 0-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm4.99-4.99-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm-4.99 0-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm7.49 7.49-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm-9.99 0-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.34Zm9.99-9.99-.14.34-.37.02.28.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33Zm-9.99 0-.14.34-.37.02.28.23-.09.36.3-.19.31.19L.23.12l.28-.23-.36-.03-.13-.33Zm4.99 4.99-.14.34-.37.02.29.23-.09.36.3-.19.31.19-.08-.36.28-.23-.36-.03-.13-.33ZM1.5 8.75c0 .14-.11.25-.25.25S1 8.89 1 8.75s.11-.25.25-.25.25.11.25.25m7.49 0c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25M1.5 1.25c0 .14-.11.25-.25.25S1 1.39 1 1.25 1.11 1 1.25 1s.25.11.25.25m7.49 0c0 .14-.11.25-.25.25s-.25-.11-.25-.25S8.6 1 8.74 1s.25.11.25.25M4 3.75c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25m0 2.5c0 .14-.11.25-.25.25s-.25-.11-.25-.25.11-.25.25-.25.25.11.25.25m2.5-2.5c0 .14-.11.25-.25.25S6 3.89 6 3.75s.11-.25.25-.25.25.11.25.25m0 2.5c0 .14-.11.25-.25.25S6 6.39 6 6.25 6.11 6 6.25 6s.25.11.25.25",width:10,height:10,fill:!0},{path:"M8.81 0H10V1.21L9.52 1 9.04.72c-.14-.1-.23-.2-.26-.3-.04-.1-.03-.24.02-.4L8.82 0H8.81ZM10 8.8V10H8.81c.03-.1.1-.26.21-.49l.27-.48c.1-.14.2-.22.3-.25l.39.02H10ZM1.22 10H0V8.8c.1.03.27.1.51.22.24.13.41.22.49.27.14.1.22.2.25.3.04.1.03.23-.02.39V10M0 1.21V0H1.23L1.01.5.73.99c-.1.14-.2.22-.3.25L.04 1.22H.01L0 1.21ZM10 6.1259V3.896l-.02.02H9.86l-.55.09c-.16.04-.28.11-.34.19-.07.09-.11.21-.12.38-.01.1 0 .29.03.56.04.27.06.45.09.55.05.16.12.28.2.34.08.07.21.11.38.12l.45-.02ZM0 3.896v2.23l.01-.01.12-.02.55-.09c.16-.04.27-.1.34-.19s.11-.21.12-.38l-.03-.56-.09-.55c-.04-.16-.11-.28-.19-.34-.09-.07-.21-.11-.38-.11L0 3.896Zm5.7855.1243-.5414-.15.02-.01-.5515-.09c-.1705-.01-.3008.02-.391.08-.1003.05-.1705.16-.2306.32l-.1604.54-.0902.55c0 .17.0201.3.0802.39.0797.1088.1921.1893.3209.23l.5415.15.5515.09c.1705 0 .3008-.02.381-.08.0902-.06.1704-.16.2306-.32l.1504-.54.0902-.55c.01-.16-.0201-.29-.0802-.38-.0501-.09-.1604-.17-.3209-.23ZM6.16 0H3.9l.06.27.16.54c.0702.15.1498.26.24.31.0902.05.2195.07.39.05l.55-.1.54-.17c.1504-.07.2599-.15.31-.24.0501-.09.0701-.22.05-.39ZM3.89 10H6.15l-.06-.27-.17-.54c-.0702-.15-.1498-.25-.24-.3-.0903-.06-.2195-.08-.39-.06l-.55.11-.54.16c-.1504.07-.2499.15-.3.24-.0602.09-.0801.22-.06.39l.05.27Z",width:10,height:10,fill:!0}],qt.SELECT=Object.assign(Wt.STOCK[4],{id:"rm-selected-area-fill",pattern:Wt.STOCK[4].path,transform:"scale(0.5)"});class Jt extends Zt{prepare(){const t=this.source;return this._colors=r(t.colors)?t.colors.slice():[],t.mode===Yt?this._index=-1:(t.mode===Gt&&dt.shuffle(this._colors),this._index=0),this}getNext(){return this._index<0?this._colors[Math.floor(Math.random()*this._colors.length)]:this._colors[this._index++%this._colors.length]}hasDef(){return!1}getElement(t,e){this._colors=r(e.colors)?e.colors:[]}}Jt.TYPE="colors";class Qt extends Zt{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach(e=>{if(n(e))this._images.push(e);else{const s=t+e.url;e.name&&(this._map[e.name]=s),this._images.push(s)}})}getImage(t){return n(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||Qt.SIZE,height:e.height||e.width||Qt.SIZE})}}Qt.TYPE="images",Qt.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(i(t)){const e=this.$_loadItem(t);return e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e),e.source}}register(t,e){this._selectedFill=new qt(qt.SELECT);const s=this._selectedFill.getElement(t,this._selectedFill.source);s.setAttribute(Vt.ASSET_KEY,"1"),e.addDef(s),this._items.forEach(s=>{const i=s.getElement(t,s.source);i.setAttribute(Vt.ASSET_KEY,"1"),e.addDef(i)})}unregister(t){this._items.forEach(e=>{t.removeDef(e.source.id)})}get(t){return this._map[t]}updateOptions(t,e){}$_loadItem(t){if(i(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=qt.TYPE:r(t.colors)?e=Jt.TYPE:r(t.images)&&(e=Qt.TYPE)),e)switch(e.toLowerCase()){case Xt.TYPE:return new Xt(t);case Kt.TYPE:return new Kt(t);case qt.TYPE:return new qt(t);case Jt.TYPE:return new Jt(t);case Qt.TYPE:return new Qt(t)}}}}const ee="0".charCodeAt(0),se="#".charCodeAt(0),ie=",".charCodeAt(0),re="s".charCodeAt(0),oe="a".charCodeAt(0);class ne{static getFormatter(t){let e=ne.Formatters[t];return e||(ne.Formatters[t]=e=new ne(t)),e}static get Default(){return ne.getFormatter(ne.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}toStrEx(t,e){this._options.roundingMode=e;const s=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,s}$_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)===ee;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===se;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===ee;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===ie){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===re){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===oe){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s}}}ne.DEFAULT_FORMAT="",ne.Formatters={};const ae=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],he=[".","/","-",":"],le="Z".charCodeAt(0),ce="z".charCodeAt(0),de="A".charCodeAt(0),_e="a".charCodeAt(0),ue="y".charCodeAt(0),pe="M".charCodeAt(0),ge="m".charCodeAt(0),me="W".charCodeAt(0),fe="w".charCodeAt(0),be="d".charCodeAt(0),ye="H".charCodeAt(0),we="h".charCodeAt(0),xe="S".charCodeAt(0),ve="s".charCodeAt(0);class Ce{static getFormatter(t){let e=Ce.Formatters[t];return e||(Ce.Formatters[t]=e=new Ce(t)),e}static get Default(){return Ce.getFormatter(A.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||A.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const s=this._tokens;let i="";for(var r=0,o=s.length;r<o;r++){var n=s[r],a=n.length;switch(n.charCodeAt(0)){case ue:i+=a>2?t.getFullYear():j(t.getFullYear()%100);break;case pe:i+=a>1?j(t.getMonth()+1):t.getMonth()+1;break;case be:i+=a>1?j(t.getDate()):t.getDate();break;case me:i+=a>1?j(dt.weekOfYear(t,e)+1):dt.weekOfMonth(t,e,!0)+1;break;case fe:i+=a>1?dt.long_week_days[t.getDay()]:dt.week_days[t.getDay()];break;case ye:i+=a>1?j(t.getHours()):t.getHours();break;case we:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),i+=a>1?j(e):e}else i+=a>1?j(t.getHours()):t.getHours();break;case ge:i+=a>1?j(t.getMinutes()):t.getMinutes();break;case ve:i+=a>1?j(t.getSeconds()):t.getSeconds();break;case _e:case de:t.getHours()<12?i+=A.am:i+=A.pm;break;case xe:let s=t.getMilliseconds();i+=3==a?H(s):2==a?j(s):s.toString().substring(0,a);break;default:i+=n}}return i}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let o=s.charAt(r);if(he.indexOf(o)>=0)e.push(o),r++;else{let n=r++;for(;r<i&&s.charAt(r)==o;)r++;if(o=s.substring(n,r),ae.indexOf(o)<0){let e=o.charCodeAt(0);(e>=de&&e<=le||e>=_e&&e<=ce)&&K(A.invalidDateFormat,t)}e.push(o)}if(r<i&&dt.isWhiteSpace(o=s.charAt(r)))for(e.push(o);r<i&&dt.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||A.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}Ce.Formatters={};const Se=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],Le=["f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","000000","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"];class Ae{static create(t){return n(t)?new Ae(t):void 0}static isBright(t){return new Ae(t).isBright()}static getContrast(t,e,s){return new Ae(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Ae(null);return i.r=Math.ceil(t.r+(e.r-t.r)*s),i.g=Math.ceil(t.g+(e.g-t.g)*s),i.b=Math.ceil(t.b+(e.b-t.b)*s),i.a=t.a+(e.a-t.a)*s,i}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(dt.startsWith(t,"rgb(")&&dt.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(dt.startsWith(t,"rgba(")&&dt.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(dt.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Ae.COLORS[t]&&this.$_parseNumber(Ae.COLORS[t])}}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 Ae(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}}var Me,ke,Pe;Ae.COLORS=function(){const t={};for(let e=0;e<Se.length;e++)t[Se[e]]=Le[e];return t}(),t.TextAnchor=void 0,(Me=t.TextAnchor||(t.TextAnchor={})).START="start",Me.MIDDLE="middle",Me.END="end",t.TextLayout=void 0,(ke=t.TextLayout||(t.TextLayout={})).TOP="top",ke.MIDDLE="middle",ke.BOTTOM="bottom",function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Pe||(Pe={}));class Ie extends Vt{constructor(e,s=M){super(e,s,"text"),this._layout=t.TextLayout.TOP,this._dirty=!0,this._text="",this.setAttr("text-anchor","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 svg(){return this.dom.innerHTML}set svg(t){t=t||"",this.dom.innerHTML=t}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.bbox(),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=i-s.height;break;default:r=Math.ceil(i)}this.setAttr("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=Math.max(0,t),(e=Math.min(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,o=0,n=s.length;do{r=Math.ceil((o+n)/2);i.getSubStringLength(0,r)>t?n=r-1:o=r}while(o<n);for(this.text=s.substring(0,o)+"…";o>0&&this.calcWidth()>t;)this.text=s.substring(0,--o)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Ae.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){let e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}bbox(){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 Ne="$_TH",Te="$_TW";class Ee{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const s=this._literals;let i=this.text;if(s&&e.callback)for(let r=0;r<s.length;r+=4){let o=e.callback(t,s[r+1]);if("number"==typeof o&&!isNaN(o)||"bigint"==typeof o){const t=s[3]?ne.getFormatter(s[3]):e.numberFormatter;t&&(o=t.toStr(o))}else if(o instanceof Date){const t=s[3]?Ce.getFormatter(s[3]):e.timeFormatter;t&&(o=t.toStr(o,e.startOfWeek||0))}else null==o&&(o=s[r+2]||"");i=i.replace(s[r],o)}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),o=r.substring(2,r.length-1),n=o.indexOf(";");if(n>0){const t=o.indexOf(";",n+1);t>=n?this._literals.push(r,o.substring(0,n),o.substring(n+1,t),o.substring(t+1)):this._literals.push(r,o.substring(0,n),o.substring(n+1),M),0===this._literals[2].length&&(this._literals[2]=M)}else this._literals.push(r,o,M,M);e=i+1}return 0==this._literals.length&&(this._literals=null),this}}class Ve extends Ee{prepareSpan(t,e,s){const i=this.getText(e,s),r=i.indexOf(">")+1,o=i.indexOf(this.tag(),r);return this._doPrepare(t,i,r,o),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],o=e.indexOf(i,r+7);o>0&&o<s&&t.setAttribute("style",e.substring(r+7,o))}}}class De extends Ve{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","rm-text-link")}}const Re={t:class extends Ve{tag(){return"</t>"}},b:class extends Ve{tag(){return"</b>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-bold")}},i:class extends Ve{tag(){return"</i>"}_doPrepare(t,e,s,i){super._doPrepare(t,e,s,i),t.setAttribute("class","rm-text-italic")}},a:De};class $e{get words(){return this._words.slice()}parse(t){function e(t){const e=s.length;e>0&&""===s[e-1].type?s[e-1].text+=t:s.push((new Ee).parse(t))}const s=this._words=[];let i=0;for(;i<t.length;){if("<"==t[i]){const s=t[i+1];let r;if(s in Re){const e=t.indexOf(">",i+2);if(e>=0){const o="</"+s+">",n=t.indexOf(o,e+1);if(n>=0){const e=t.substring(i,n+o.length);r=(new Re[s]).parse(e),i+=e.length}}}if(!r){e(t.substring(i));break}this._words.push(r)}else{const s=t.indexOf("<",i+1);if(!(s>=0)){e(t.substring(i));break}e(t.substring(i,s)),i=s}}return this}}const Oe=/<br.*?>|\r\n|\n/;class Fe{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,s,r,o,n){const a=t.doc,h=b(this.lineHeight,1),l=this._lines,c=l.length,d=[],_=[];t.clearDom(),o=o||t;const u=t.getStyle("writing-mode"),p=u===q||u===J;for(let s=0;s<c;s++){const r=l[s];let u=0,m=0,f=null;for(let[h,l]of r.words.entries()){const d=0===s&&0===h,_=s===c-1&&h===r.words.length-1,b=l.prepareSpan(t.appendElement(a,"tspan"),o,n);if(i(o.options)){const t=o.options,e=d&&t.prefix||"",s=_&&t.suffix||"";b.textContent=e+(b.textContent||"")+s}const y=b.getBBox();if(b[Te]=y.width,b[Ne]=y.height,p?(u=g(u,b[Te]),m+=b[Ne]):(u+=b[Te],m=g(m,b[Ne])),f||(f=b),l instanceof De){const s=a.createElementNS(e,"a");s.setAttribute("href",l.url),s.setAttribute("target",l.target),s.appendChild(b),t.appendDom(s)}}_.push(f),r[Ne]=m*h,r[Te]=u*h,d.push(0==s?r[Te]/2:r[Te])}if(c>0){let e=l[0];for(let s=1;s<_.length;s++)if(_[s]){let i=0,r=0;if(p?null!=_[s-1]&&(i=Math.floor(e[Te]-t.getAscent(e[Te]))+t.getAscent(l[s][Te])):r=e[Ne]-t.getAscent(e[Ne])+t.getAscent(l[s][Ne]),null==_[0]&&_[s]==_.find(t=>null!=t)){const r=t.insertElement(a,"tspan",_[s]);r.textContent=".",r.style.fill="transparent";const o=r.getBBox();i+=o.width,r[Te]=o.width,r[Ne]=e[Ne]=o.height,_[0]=r}switch(u){case q:_[s].setAttribute("dx",String(i)),_[s].setAttribute("y","0");break;case J:_[s].setAttribute("dx",String(-i)),_[s].setAttribute("y","0");break;default:_[s].setAttribute("x","0"),_[s].setAttribute("dy",String(r))}e=l[s]}if(p){const e=t.parent.dom.classList.contains("rm-annotation"),s=t.bbox().width,[i]=_,r=i[Te];if(e)i.setAttribute("dx",String(u===J?s-r/2:r/2));else switch(u){case q:i.setAttribute("x",String((s-r)/-2));break;case J:i.setAttribute("x",String((s-r)/2))}}else t.layoutText(l[0][Ne])}}layout(e,s,i,r,o){const n=e.bbox();let a=0,h=0;const l=e.getStyle("writing-mode");if(l===q||l===J)switch(a=o.left+(i-o.left-o.right-n.width),s){case"center":e.anchor=t.TextAnchor.MIDDLE,h=o.top+(r-o.top-o.bottom)/2;break;case"right":e.anchor=t.TextAnchor.END,h=n.height-o.bottom;break;default:e.anchor=t.TextAnchor.START,h=o.top}else switch(h=o.top+(r-o.top-o.bottom-n.height)/2,s){case"center":e.anchor=t.TextAnchor.MIDDLE,a=o.left+(i-o.left-o.right)/2;break;case"right":e.anchor=t.TextAnchor.END,a=i-o.right;break;default:e.anchor=t.TextAnchor.START,a=o.left}e.trans(a,h)}$_parse(t){const e=this._lines=[];if(t){const s=t.split(Oe);for(let t of s)e.push((new $e).parse(t))}}}let Be=0;const ze=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},je=function(t,e){const s=i(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let o=e[t];r(o)?s[t]=o.slice(0):o instanceof Date?s[t]=new Date(o):i(o)?s[t]=je(s[t],o):s[t]=o}return s};class He extends bt{constructor(t){super(),this.chart=t,Be++}_init(){const t=this._op=je({},this.constructor.defaults);return this._doInit(t),this._doApply(t),t}_doInit(t){}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(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)}saveOptions(){const t={visible:this.visible};return this._doSave(t),t}updateOptions(t,e=!0){const s=this,r=this._op;return void 0===t||this._doSetSimple(t)||je(r,t),this.$_applyOptions(r),i(t)&&function(t){if(s._children)s._children.forEach(e=>t.hasOwnProperty(e)&&s[e].updateOptions(t[e]));else{s._children=[];for(const e in s){const i=s[e];i instanceof He&&(s._children.push(e),t.hasOwnProperty(e)&&i.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,s=!0){if(this[t]instanceof He)this[t]._doSetSimple(e);else{const i=this._op;e!==i[t]&&(i[t]=e,this.$_applyOptions(i),s&&this._optionChanged())}return this}toggleOption(t,e=!0){const s=this._op,i=s[t];return s[t]=!h(i)||!i,this.$_applyOptions(s),e&&this._optionChanged(),this}removeOption(t,e=!0){const i=this._op;if(i.hasOwnProperty(t)){delete i[t];const r=self.constructor.defaults;s.call(r,t)&&(i[t]=r[t]),this.$_applyOptions(i),e&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=je({},e.constructor.defaults),e.$_applyOptions(e._op),e._children)e._children.forEach(s=>e._op[s]=t(e[s]));else{e._children=[];for(const s in e){const i=e[s];i instanceof He&&(e._op[s]=t(i))}}return e._op}(this),t&&this._optionChanged(),this}_prepareRender(){this._doPrepareRender(this.chart)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoad(t,e){for(const s in e)if(e.hasOwnProperty(s)){let o=e[s];this._doLoadProp(s,o)||(this[s]instanceof He?t[s]=this[s]._load(o):r(o)?t[s]=o.slice(0):o instanceof Date?t[s]=new Date(o):i(o)?t[s]=Object.assign({},o):t[s]=o)}}_doSetSimple(t){if(h(t))return this._op.visible=t,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const s=this.visible;this._doApply(t),this.visible!==s&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const s=`_${e}`;t[e]!==this[s]&&(this[`${s}Dim`]=Y(this[s]=t[e],!0))}_setDims(t,...e){e.forEach(e=>this._setDim(t,e))}_doApply(t){s.call(t,"visible")&&(this.visible=t.visible),this._style=t.style}_doSave(t){}_doUpdate(t){for(const e in t)if(t.hasOwnProperty(e)){let s=t[e];this._doLoadProp(e,s)||(this[e]instanceof He?this[e].updateOptions(s):r(s)?this[e]=s.slice(0):s instanceof Date?this[e]=new Date(s):i(s)?this[e]=l({},s):this[e]=s)}}_doPrepareRender(t){}_doAfterRender(){}}He.REFRESHED="refreshed",He.defaults={visible:!0};class Ge{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 Ye extends He{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?ne.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}isVisible(){return this.visible&&!!this._text}setText(t){this._setText(t)}buildSvg(t,e,s,i,r,o){this._richTextImpl&&(this._richTextImpl.build(t,s,i,r,o),e&&this._richTextImpl.build(e,s,i,r,o))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Fe),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,s){if(dt.isValidNum(t)){const i=this._numSymbols&&e&&dt.scaleNumber(t,this._numSymbols,s);return this._numberFormatter?i?this._numberFormatter.toStr(i.value)+i.symbol:this._numberFormatter.toStr(t):i?i.value+i.symbol:String(t)}return"NaN"}_getText(t,e,s,i){let r=n(t)?t:this.$_getNumberText(e,s,i)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}getNumberText(t,e,s,i){let r="";if(dt.isValidNum(t)){const o=this._numSymbols&&e&&dt.scaleNumber(t,this._numSymbols,s);r=this._numberFormatter?o?this._numberFormatter.toStrEx(o.value,i)+o.symbol:this._numberFormatter.toStrEx(t,i):o?o.value+o.symbol:String(t)}return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}Ye.defaults=ze(He.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class We extends Ye{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t){if(this._images=null,this._op.imageList){const e=t._assets.get(this._op.imageList);e instanceof Qt&&(this._images=e)}this._root=this._images?"":this._op.iconRoot||""}getUrl(t){if(t){const e=t.indexOf("::");if(0===e)return t=t.substring(2),this._images?this._images.getImage(t):t;if(e>0){const s=this.chart._assets.get(t.substring(0,e)),i=t.substring(e+2);return s instanceof Qt?s.getImage(i):i}return this._root+t}}}We.defaults=ze(Ye.defaults,{iconPosition:"default",iconGap:2});class Ze extends He{constructor(){super(...arguments),this.index=-1}get series(){return this._series}getLocation(){return this._location}isReversed(){return"left"===this._location||"top"===this._location}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op;this._location=e.location||"bottom",this._series=t.seriesByName(e.series)||this._getFirstSeries(t)}_getFirstSeries(t){return t.firstMapSeries}}Ze.defaults=ze(He.defaults,{offsetX:0,offsetY:0});class Ue extends Ge{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(t){return this._visibles.filter(e=>e.getLocation()===t)}get(t){return n(t)?this._map[t]:this._items[t]}prepareRender(){this._visibles=this._items.filter(t=>t.visible),this._items.forEach(t=>{t._prepareRender()})}load(t){const e=this.chart,s=this._items=[],o=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=>{t.options.name&&(o[t.options.name]=t)}),this.chart.options.colorScale=this._items.map(t=>t.options)}$_loadItem(t,e,s){const i=this._createScale(t);return i._init(),i.index=s,i._load(e),i}}const Xe={};class Ke extends He{static register(...t){t.forEach(t=>{Xe[t.type]=t})}constructor(t,e){super(t),this.inBody=e,this._offsetX=0,this._offsetY=0,this.index=-1}_type(){return this.constructor.type}get name(){return this._name}getOffset(t,e){const s=function(t,e,s){return s.size*("h"===s.suffix?e:t)};return{x:this._offsetXDim?s(t,e,this._offsetXDim):+this._offsetX,y:this._offsetYDim?s(t,e,this._offsetYDim):+this._offsetY}}getSize(t,e){const s=this._op;let i,r;return this.inBody&&(s.x1,s.x2,s.y1,s.y2,this._x=this._y=this._w=this._h=NaN),isNaN(i)?i=W(this._widthDim,t):i<0&&(this._x+=i,i=-i),isNaN(r)?r=W(this._heightDim,e):r<0&&(this._y+=r,r=-r),{width:i,height:r}}getPosition(t,e,s,i,r,o){let n,a,h;if(isNaN(a=this._x))switch(n=this.getOffset(r,o),a=t,this._op.align){case"center":a+=(s-r)/2+n.x;break;case"right":a+=s-n.x-r;break;default:this._anchorObj?a+=(s-r)/2+n.x:a+=n.x}else n=n||this.getOffset(r,o),a=this._x+n.x;if(isNaN(h=this._y))switch(n=n||this.getOffset(r,o),h=e,this._op.verticalAlign){case"middle":h+=(i-o)/2-n.y;break;case"bottom":h+=i-n.y-o;break;default:h+=n.y}else n=n||this.getOffset(r,o),h=this._y+n.y;return{x:a,y:h}}refresh(){}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doApply(t){const e=this,s=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const s=parseFloat(t);if(s===parseFloat(t.substring(0,t.length-1)))return{size:s,suffix:e}}}};var i;super._doApply(t),this._name=t.name||`annotation ${this.index+1}`,(i=t.offsetX)!=e._offsetX&&(e._offsetXDim=s(e._offsetX=i)),function(t){t!=e._offsetY&&(e._offsetYDim=s(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_doPrepareRender(t){}}Ke.defaults=ze(He.defaults,{front:!1,verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class qe extends Ge{constructor(t){super(t.chart),this.owner=t,this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}getAnnotation(t){const e=this._map[t];if(e instanceof Ke)return e}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const s=this.owner.chart,o=this._items=[],n=this._map={};r(t)?t.forEach((t,i)=>{o.push(this.$_loadItem(s,t,i,e))}):i(t)&&o.push(this.$_loadItem(s,t,0,e)),o.forEach(t=>{t.name&&(n[t.name]=t)}),this.owner.options.annotations=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):void 0})}$_loadItem(t,e,s,i){let r=e.type;r||(r=n(e.imageUrl)?"image":n(e.shape)?"shape":"text");const o=t._getAnnotationType(r);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,i);return a._init(),a.index=s,a._load(e),a}}const Je="route";class Qe extends Vt{static create(t,e,s,i,r,o,n=0){return new Qe(t,e,{x:s,y:i,width:r,height:o,r:n})}constructor(t,e=void 0,s=void 0){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))}}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}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)))}_setBackgroundBorderRadius(t){this.setRadius(t)}}const ts={FO:[-6.926,61.935],UM:[-161.881,5.874],US:[-100.054,38.95],JP:[137.363,36.254],SC:[55.336,-4.582],IN:[77.712,23.832],FR:[3.636,46.78],FM:[158.082,6.859],CN:[98.592,35.308],SW:[-78.538,15.86],SH:[117.621,15.128],BR:[-52.768,-8.476],EC:[-79.861,-.951],AU:[135.555,-24.588],KI:[-157.184,1.814],PH:[121.006,16.567],MX:[-102.12,23.983],ES:[-1.595,39.591],BU:[-79.893,15.769],MV:[73.421,5.526],SP:[115.707,10.82],GB:[-1.839,52.506],GR:[22.599,36.681],AS:[-170.525,-14.3],DK:[9.427,56.37],GL:[-39.018,75.593],GU:[144.57,13.448],MP:[145.575,15.13],PR:[-66.143,18.122],VI:[-64.657,17.73],CA:[-115.256,59.415],ST:[6.617,.24],TZ:[35.004,-6.367],CV:[-23.58,15.095],DM:[-61.289,15.406],NL:[6.492,53.515],JM:[-77.2,18.063],WS:[-172.316,-13.651],OM:[58.793,22.119],VC:[-61.127,13.19],TR:[32.129,39.009],BD:[91.905,22.233],SB:[159.895,-9.419],LC:[-60.92,13.905],NR:[166.755,-.527],NO:[8.419,60.753],KN:[-62.633,17.288],BH:[50.478,25.994],TO:[-174.925,-21.171],FI:[25.914,62.545],ID:[112.847,-1.004],MU:[57.54,-20.281],SE:[16.306,62.823],TT:[-61.263,10.416],MY:[116.988,5.343],BS:[-77.04,26.457],PA:[-81.679,8.405],PW:[134.398,7.472],TV:[179.008,-8.486],MH:[170.969,7.089],CL:[-71.933,-53.598],TH:[99.453,13.237],GD:[-61.602,12.116],EE:[24.023,58.725],AG:[-61.72,17.057],TW:[120.561,23.799],BB:[-59.506,13.174],IT:[12.07,42.271],MT:[14.39,35.877],PG:[144.268,-6.42],DE:[10.769,52.338],VU:[166.879,-14.948],SG:[103.716,1.336],CY:[32.94,34.876],KM:[43.265,-11.648],FJ:[177.763,-17.844],RU:[116.768,62.184],VA:[12.445,41.859],SM:[12.426,43.899],KZ:[69.685,48.81],AZ:[48.953,40.077],AM:[43.71,40.972],TJ:[70.97,38.844],LS:[28.196,-29.619],UZ:[63.788,41.154],PT:[-7.96,39.503],MA:[-7.418,32.961],CO:[-72.763,3.458],TL:[125.957,-8.667],KH:[106.595,12.595],AR:[-64.544,-31.651],SA:[43.575,24.38],PK:[65.477,27.35],YE:[46.702,14.193],AE:[54.339,23.834],KE:[40.821,-1.765],PE:[-72.624,-12.919],DO:[-70.177,18.918],HT:[-72.184,19.768],AO:[17.848,-13.567],VN:[105.093,9.209],MZ:[38.994,-15.14],CR:[-85.488,10.921],IR:[55.16,32.532],SV:[-88.819,13.763],SL:[-11.852,8.517],GW:[-15.062,11.83],HR:[15.471,44.023],BZ:[-88.588,17.17],ZA:[22.378,-31.062],CD:[23.249,-2.545],KW:[47.417,29.211],IE:[-8.492,53.326],KP:[126.253,39.576],KR:[127.616,36.448],GY:[-60.029,8.028],HN:[-84.851,15.721],MM:[93.663,19.758],GA:[10.77,-1.748],GQ:[10.388,1.604],NI:[-85.521,11.48],UG:[30.384,1.098],MW:[33.379,-11.797],SX:[47.38,9.636],TM:[57.736,39.678],ZM:[24.768,-14.824],NC:[33.685,35.192],MR:[-9.464,19.464],DZ:[4.338,28.318],LT:[22.486,56.241],ET:[39.713,8.248],SD:[30.178,15.394],ER:[37.061,16.638],GH:[-2.632,6.208],SI:[14.998,46.019],GT:[-91.228,14.582],BA:[19.032,43.715],JO:[35.197,30.08],SY:[37.367,34.605],MC:[7.398,43.693],AL:[19.948,41.178],UY:[-54.091,-33.141],CNM:[33.1,35.128],MN:[103.413,46.722],RW:[29.783,-1.991],SO:[44.948,1.869],BO:[-63.791,-17.523],CM:[10.632,5.494],CG:[12.218,-3.09],EH:[-13.634,22.764],RS:[20.629,44.144],ME:[19.218,42.7],BJ:[2.516,9.301],NG:[8.668,10.712],TG:[1.183,7.053],LA:[106.65,16.035],AF:[65.88,33.737],UA:[34.689,48.739],SK:[18.01,48.516],JK:[77.109,35.261],BG:[27.047,42.676],QA:[51.077,25.34],LI:[9.547,47.109],AT:[13.385,47.391],SZ:[31.418,-26.531],HU:[17.899,46.861],RO:[26.522,45.94],LU:[6.078,49.679],AD:[1.593,42.518],CI:[-5.559,7.414],LR:[-7.632,5.393],BN:[114.295,4.607],BE:[4.472,50.722],IQ:[43.218,33.744],GE:[41.618,42.404],GM:[-16.166,13.386],CH:[6.631,46.572],TD:[18.378,13.499],KV:[20.845,42.495],LB:[35.653,33.732],DJ:[42.603,11.707],BI:[29.98,-3.31],SR:[-54.231,5.457],IL:[35.309,32.984],ML:[-2.536,19.441],SN:[-16.115,14.461],GN:[-13.134,9.817],ZW:[31.526,-18.524],PL:[19.318,53.256],MK:[21.667,41.636],PY:[-58.484,-23.396],BY:[27.908,53.75],LV:[21.37,57.167],CZ:[15.531,49.557],BF:[-.457,12.785],NA:[16.205,-21.44],NE:[10.273,17.295],LY:[17.187,27.941],TN:[9.187,36.696],BT:[90.355,27.516],MD:[28.401,47.195],SS:[29.891,7.148],CF:[20.505,6.958],NZ:[169.191,-45.031],CU:[-77.556,21.034],VE:[-67.345,9.318],MG:[46.43,-18.577],IS:[-17.355,64.924],EG:[30.753,25.315],LK:[80.796,6.19],BW:[24.546,-23.267],KG:[74.526,41.489],NP:[84.181,28.118]};class es{constructor(t,e){}}let ss=0;class is{constructor(t){this.source=t,this.pid=ss++,this.visible=!0}setSelected(t){this._selected=t}get lon(){return this.coord[0]}get lat(){return this.coord[1]}ariaHint(){return""}labelCount(){return 1}copy(){return{...this}}proxy(){return{pid:this.pid,name:this.name}}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):this._readSingle(e),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}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._valuesChanged(this._prev))return this._prev;this._prev=void 0}_valuesChanged(t){return t.id!==this.id}getBaseValue(){return this.getValue()}getParam(t){var e,s;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const s=t.split(/\./g);let i=null!==(e=this[s[0]])&&void 0!==e?e:this.source[s[0]];for(let t=1;t<s.length;t++)i=i[s[t]];return i}return"baseValue"===t?this.getBaseValue():null!==(s=this[t])&&void 0!==s?s:this.source[t]}getCallout(t){const e=this.callout;if(e){const s=[t];for(let t=0;t<e.length;t++)s.push([isNaN(e[t][0])?s[t][0]:e[t][0],isNaN(e[t][1])?s[t][1]:e[t][1]]);return s}const s=this.offset;if(s){const e=[t];for(let t=0;t<s.length;t++)e.push([e[t][0]+(s[t][0]||0),e[t][1]+(s[t][1]||0)]);return e}}_assignTo(t){return l(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,source:this.source})}_readArray(t,e){}_readObject(t,e){var s;if(this.id=w(t._idFielder(e),e.id),this.name=w(t._nameFielder(e),e.name),this.color=w(t._colorFielder(e),e.color),this.className=e.className,r(e.coord))this.coord=e.coord.slice(0,2);else if(n(e.coord)){const t=e.coord.split(/s\+/);this.coord=[+t[0],+t[1]]}else if(isNaN(e.lon)||isNaN(e.lat))if(isNaN(e.x)||isNaN(e.y)){if(t._lonFielder&&t._latFielder){const i=t._lonFielder(e);if(isNaN(i))return;const r=null===(s=t._latFielder)||void 0===s?void 0:s.call(t,e);if(isNaN(r))return;this.coord=[i,r]}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=r(e.callout)&&this.$_parseCallout(e.callout),r(this.callout)||(this.offset=r(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),r(t)&&(e=[],a(t[0])?e.push(t):t.forEach(t=>{if(r(t))e.push(t.slice(0,2));else if(n(t)){const s=t.split(/s\+/);e.push([s[0],s[1]])}})),e.forEach(t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])}),e}_readSingle(t){n(t)&&(this.id=t)}}class rs{constructor(t){this._points=[],this._owner=t}get count(){return this._points.length}get first(){return this._points[0]}get last(){return this._points[this._points.length-1]}isEmpty(){return this._points.length<1}getPoints(){return this._points}get(t){return this._points[t]}pointById(t){return this._points.find(e=>e.id===t)}contains(t){return this._points.indexOf(t)>=0}load(t){r(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){t<0?(this._points.push(e),e.index=this._points.length-1):(this._points.splice(t,0,e),e.index=t)}add(t){this._points.push(t),t.index=this._points.length-1}remove(t){const e=this._points,s=e.indexOf(t);if(s>=0){e.splice(s,1);for(let t=e.length-1;t>=s;t--)e[t].index=t;return!0}}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let s=0,i=e.length;s<i&&!0!==t(e[s],s);s++);}}const os="_model_",ns="_tag_",as="disabled",hs="rm-legend-item-marker",ls={};class cs extends We{constructor(){super(...arguments),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.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}isVisible(){return this.visible||o(this._op.visibleCallback)}getDefaultIconPos(){return"top"}_doSetSimple(t){return o(t)?(this._op.visibleCallback=t,this._op.visible=!0):super._doSetSimple(t)}_doPrepareRender(t){super._doPrepareRender(t),this._domain.numberFormatter=this._numberFormatter}}cs.defaults=ze(We.defaults,{visible:!0,position:"auto",distance:25});class ds extends He{}ds.defaults=ze(He.defaults,{shape:"circle",radius:2.5});class _s extends He{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new ds(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}_s.defaults=ze(He.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class us extends mt{constructor(t,e,s){super(),this.series=t,this.point=e,this.callback=s,this.duration=500,this.point._vr=0,this.endHandler=()=>{var t;delete this.point._vr,this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.point),this.series=this.point=this.callback=null}}_doUpdate(t){return this.point._vr=t,this.series._optionChanged(),!0}}class ps extends He{static register(...t){t.forEach(t=>{ls[t.type]=t})}static getPointTooltipParam(t,e,s){return"series"===s?t.displayName():e.getParam(s)}constructor(t){super(t),this.index=-1,this.seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._maxZindex=0,this._points=new rs(this)}_doInit(t){this._pointArgs=this._createPointArgs(),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new _s(this))._init()}_createLabel(t){return new cs(t)}getTooltipText(t,e){return this._op.tooltipCallback?(this._getPointCallbackArgs(this._pointArgs,e),this._op.tooltipCallback(this._pointArgs)):this._op.tooltipText}getTooltipParam(t,e,s){return ps.getPointTooltipParam(t,e,s)}canHide(){return this!==this.chart.firstMapSeries}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this._createLegendMarker(t,e))}legendColor(){return this._calcedColor}legendLabel(){return this._op.label||this.name}_type(){return this.constructor.type}get name(){return this._name}get pointLabel(){return this._pointLabel}get map(){return this._map}get callout(){return this._callout}displayName(){return this._op.label||this.name||`Series${this.index}`}get data(){return this._data}setData(t){t!==this._data&&(this._data=t,this._dataSourceDirty=!0)}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isDataSeries(){return!0}getDetailed(){return this}needMapScale(){return!1}contains(t){return this._points.contains(t)}initPoints(t){const e=t.map((t,e)=>this.$_addPoint(t,e));return this._zindexDirty=this._maxZindex>0,e}getPoint(t){return this._points.get(t)}getPointText(t,e,s){let i;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointCallbackArgs(this._pointArgs,t),i=this._pointLabelCallback(this._pointArgs),null!=i)?i:s}getPointCallbackArgs(t){return this._getPointCallbackArgs(this._pointArgs,t)}getPointStyle(t){if(this._op.styleCallback)return this._op.styleCallback(this._getPointCallbackArgs(this._pointArgs,t))}getPointLabelStyle(t){if(this.pointLabel.options.styleCallback)return this.pointLabel.options.styleCallback(this._getPointCallbackArgs(this._pointArgs,t))}getRangedColor(t){}isPointLabelsVisible(){const t=this.pointLabel.options.zoomLevel;return this._pointLabel.isVisible()&&this.pointLabelCount()>0&&(isNaN(t)||this.chart.body.zoom>=t)}isPointLabelVisible(t){const e=this._pointLabel;return!1!==e.visible&&!0===e.visible}pointLabelCount(){return 1}getLabeledPoints(){return this._points.getPoints()}getCallout(){return this._callout.visible?this._callout:null}isPointCalloutVisible(){return this._callout.visible&&!this._callout.options.layoutOnly}getLegendSources(t){this._op.visibleInLegend&&t.push(this)}getLabelOff(){return b(this._pointLabel.options.offset,this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}coordOfArea(t){var e,s;return ts[t]||(null===(s=null===(e=this.chart)||void 0===e?void 0:e.map.areaOf(t))||void 0===s?void 0:s.getCenter())}getCoord(t){return t.coord||this.coordOfArea(t.id)||et}pointById(t){return this._points.pointById(t)}needRemoveAnimation(){return!1}addPoint(t,e=-1,s=500){var i,r,o,n;const a=this.$_addPoint(t,e);return this._points.insert(e,a),this._optionChanged(),this.chart._dataChanged(),s>0&&this instanceof fs?(null===(r=null===(i=a._prev)||void 0===i?void 0:i.ani)||void 0===r||r.stop(),delete a._deleting,a._prev={value:NaN},a._prev.ani=new us(this,a,t=>{var e,s;null===(s=(e=this._op).onPointAdded)||void 0===s||s.call(e,this._getPointCallbackArgs(this._pointArgs,t))}).setDuration(s),a._prev.ani.start()):null===(n=(o=this._op).onPointAdded)||void 0===n||n.call(o,this._getPointCallbackArgs(this._pointArgs,a)),a}removePoint(t,e=500){var s,i,r,o;a(t)&&(t=this._points.get(t)),this._points.contains(t)&&(e>0&&this.needRemoveAnimation()?(null===(i=null===(s=t._prev)||void 0===s?void 0:s.ani)||void 0===i||i.stop(),t._deleting=!0,t._prev={value:NaN},t._prev.ani=new us(this,t,t=>{var e,s;t._deleting=!1,this._points.remove(t),null===(s=(e=this._op).onPointRemoved)||void 0===s||s.call(e,this._getPointCallbackArgs(this._pointArgs,t))}).setDuration(e),t._prev.ani.start()):(this._points.remove(t),null===(o=(r=this._op).onPointRemoved)||void 0===o||o.call(r,this._getPointCallbackArgs(this._pointArgs,t))),this._optionChanged(),this.chart._dataChanged())}removeFirst(t=500){this.removePoint(this._points.first,t)}removeLast(t=500){this.removePoint(this._points.last,t)}updatePoint(t,e){if(n(t)?t=this._points.pointById(t):a(t)&&(t=this._points[t]),t instanceof is){let s=t._prev;return delete t._deleting,s&&s.ani&&s.ani.stop(),s=t.updateValues(this,e),s&&(this.chart._dataChanged(),this.chart.animatable()&&(s.ani=new us(this,t),s.ani.start())),this._optionChanged(),!!s}return!1}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){if(this._op.onPointClick)return this._getPointCallbackArgs(this._pointArgs,t),this._op.onPointClick(this._pointArgs)}show(t=!1,e=!0){this.visible&&!t||(e?this.chart.requestShowSeries(this,!0):this.visible=!0)}hide(t=!0){this.visible&&(t?this.chart.requestShowSeries(this,!1):this.visible=!1)}getCalloutShape(t){return this.callout.anchorPoint.options.shape||"circle"}canSelect(){return!1}select(t){t&&(t.setSelected(!0),this.$_bringToFront(t),this.chart._selectionChanged(this,t))}unselect(t){t.setSelected(!1),this.chart._selectionChanged(this,t)}$_bringToFront(t){t instanceof is&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0,this._optionChanged(t))}lock(){}unlock(){}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.setData(t.data);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_prepareRender(){if(this._mapChanged&&this._doMapChanged(),this._dataSourceDirty){const t=this._doLoadData(this._data);this.$_loadPoints(t),this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter(t=>t.visible)}else this._optionsDirty?(this._runPoints||(this._runPoints=this._points.getPoints()),this._visPoints=this._runPoints.filter(t=>t.visible)):this._runPoints||(this._visPoints=[],this._runPoints=[]);super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t){const e=this._op,s=e.pointColors;let i,h,l,c=this._runColor=a(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color;o(s)?i=s:r(s)?h=s:n(s)&&(l=this.chart._assets.get(s)),i?this._runPoints.forEach((t,e)=>{t._runColor=t.color||i(this._getPointCallbackArgs(this._pointArgs,t))||c}):l instanceof Jt?(l.prepare(),this._runPoints.forEach((t,e)=>{t._runColor=t.color||l.getNext()||c})):h?this._runPoints.forEach((t,e)=>{t._runColor=t.color||h[e%h.length]||c}):this._runPoints.forEach((t,e)=>{t._runColor=t.color}),this._preparePointArgs(this._pointArgs)}$_addPoint(t,e){const s=this._createPoint(t);return s.index=e,s.parse(this),isNaN(s._zindex)||(this._maxZindex=Math.max(this._maxZindex,s._zindex)),s}_createFielder(t){return o(t)?e=>t(e):n(t)?e=>e[t]:t=>{}}_createFielders(t){this._idFielder=this._createFielder(t.idField),this._nameFielder=this._createFielder(t.nameField),this._colorFielder=this._createFielder(t.colorField)}_createLegendMarker(t,e){return Qe.create(t,hs,0,0,e,e,e/2)}_defaultLoadAnimation(){return"grow"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"series",this._type())):super._load(t)}_doLoadData(t){if(t instanceof es);else if(r(t))return t}$_loadPoints(t){var e,s;this._doLoadPoints(t),null===(s=(e=this._op).onPointsLoaded)||void 0===s||s.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}_createPointArgs(){return{series:this}}_getPointCallbackArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._argsPoint=null,t.series=this,t.count=this._points.count}_calcMinMax(t){let e,s;return t.forEach(t=>{const i=t.getValue();isNaN(i)||(e=isNaN(e)?i:p(i,e),s=isNaN(s)?i:g(i,s))}),{min:e,max:s}}}ps.defaults=ze(He.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:"<b>${name}</b><br>${series}:<b> ${value}</b>",loadAnimation:"default",hoverEffect:"default",visibleInLegend:!0});class gs extends Ge{constructor(){super(...arguments),this._map={},this._visibles=[]}get internalItems(){return this._items}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const s=this.chart;this._items=[],this._map={},r(t)?t.forEach((t,e)=>{this.$_loadItem(s,t,e)}):i(t)&&this.$_loadItem(s,t,0),s.options.series=this._items.map(t=>t.options)}get(t){return this._items[t]}getSeries(t){return this._map[t]}seriesByType(t){for(const e of this._items)if(e._type()===t)return e}seriesByPoint(t){for(const e of this._items)if(e.contains(t))return e}getLegendSources(){const t=[];return this._items.forEach(e=>e.getLegendSources(t)),t}_prepareRender(t){this._visibles=this._items.map(t=>t.getDetailed()).filter(t=>t.visible),this._visibles.forEach(e=>e.setOptionsDirty(t)._prepareRender())}_afterRender(){this._visibles.forEach(t=>t._afterRender())}insert(t,e){return this.$_loadItem(this.chart,t,e)}add(t){return this.$_loadItem(this.chart,t,this._items.length)}remove(t){let e;if(t instanceof ps?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),e.name&&delete this._map[e.name],e}$_loadItem(t,e,s,i){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(i||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const o=new r(t);return o._init(),o.isDataSeries()&&(o.index=s,o.seriesIndex=o.chart._seriesIndex++),o._load(e),this.$_addSeries(o,s)}$_addSeries(t,e){return e>=0?this._items.splice(Math.min(e,this._items.length),0,t):this._items.push(t),t.name&&(this._map[t.name]=t),t}}class ms extends is{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e)}getValue(){return!isNaN(this._vr)&&this._prev?isNaN(this._prev.value)?this._deleting?v(0,this.value,1-this._vr):v(0,this.value,this._vr):v(this._prev.value,this.value,this._vr):this.value}getBaseValue(){return this.value}}class fs extends ps{_createFielders(t){super._createFielders(t),this._valueFielder=this._createFielder(t.valueField||"value"),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}}fs.defaults=ze(ps.defaults,{valueField:"value"});class bs extends ms{}class ys extends fs{}ys.defaults=ze(fs.defaults,{});class ws extends ms{getPoints(t,e,s){const i=t.length,r=[];const o=s-e;for(let s=0;s<i;s++){const n=t[s],a=5+s/(i-1)*90,h=10+(isNaN(n)||0==o?80:80*(1-(n-e)/o));r.push(a,h)}return r}getBasePoint(t,e,s){const i=e-t;return 0+(isNaN(s)||0==i?100:100*(1-(s-t)/i))}_readObject(t,e){super._readObject(t,e);const s=this.value;this.values=r(s)?s.slice():isNaN(s)?[]:[s]}}class xs{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return Qe.create(t,hs,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class vs extends fs{getMinMax(t){let e=NaN,s=NaN;for(const i of t)for(const t of i.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),s=isNaN(s)?t:Math.max(s,t));return{min:e,max:s}}_doApply(t){super._doApply(t),this._categories=this.$_parseCategories(t.categories)}getLegendSources(t){const e=this._op;e.visibleInLegend&&(e.legendByCategory&&this._categories?t.push(...this._categories):t.push(this))}$_parseCategories(t){if(r(t))return t.map(t=>new xs(t.name,t.color))}}vs.defaults=ze(fs.defaults,{position:"top"});class Cs extends ws{}class Ss extends vs{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new He(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const s=dt.getMinMax(t),i=s.base=this._op.baseValue;if(e)s.min=isNaN(i)?e.min:Math.min(e.min,i),s.max=isNaN(i)?e.max:Math.max(e.max,i);else{const t=b(this._minValue,s.min),e=b(this._maxValue,s.max);s.min=isNaN(i)?Math.min(t,s.min):Math.min(t,s.min,i),s.max=isNaN(i)?Math.max(e,s.max):Math.max(e,s.max,i)}return s}_doApply(t){super._doApply(t),this._width=b(+t.width,Ss.DEF_WIDTH),this._height=b(+t.height,Ss.DEF_HEIGHT),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}Ss.DEF_WIDTH=80,Ss.DEF_HEIGHT=50,Ss.defaults=ze(vs.defaults,{width:Ss.DEF_WIDTH,height:Ss.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class Ls extends ms{}class As extends fs{_doApply(t){super._doApply(t),this._width=b(+t.width||+t.size||+t.height,As.DEF_SIZE),this._height=b(+t.height||+t.size||+t.width,As.DEF_SIZE)}}As.DEF_SIZE=60,As.defaults=ze(fs.defaults,{size:As.DEF_SIZE});class Ms extends As{getValueRate(t){return(b(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=+t.minValue,this._maxValue=+t.maxValue}_doPrepareRender(t){let e=b(this._minValue,1/0),s=b(this._maxValue,-1/0);this._runPoints.forEach(t=>{const i=t.getValue();t.isNull||isNaN(i)||(e=p(e,i),s=g(s,i))}),this._min=e,this._max=s}}Ms.defaults=ze(As.defaults,{minValue:10});class ks extends bs{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}_assignTo(t){super._assignTo(t).value=this.value}}class Ps extends cs{}Ps.defaults=ze(cs.defaults,{visible:!1});class Is extends ys{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new Ps(this.chart))._init()}get subLabel(){return this._subLabel}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:W(this._minSizeDim,t),max:W(this._maxSizeDim,t)}}getRadius(t,e,s){let i=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"==this._op.sizeMode&&(i=Math.sqrt(i)),i=Math.ceil(e+i*(s-e))/2,i}getSubLabelOff(){return b(this._subLabel.options.offset,0)}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._alignToSurface=t.alignToSurface}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new ks(t)}_doPrepareRender(t){super._doPrepareRender(t);let e=b(this._minValue,Number.MAX_VALUE),s=b(this._maxValue,Number.MIN_VALUE);this._runPoints.forEach(t=>{const i=t.getValue();t.isNull||isNaN(i)||(e=p(e,i),s=g(s,i))}),this._noSize=(this._vMin=e)===(this._vMax=s)}}Is.type="bubble",Is.defaults=ze(ys.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class Ns extends He{}Ns.defaults=ze(Ze.defaults,{length:10});class Ts extends We{getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Ts.defaults=ze(Ze.defaults,{offset:4});class Es extends He{_doInit(t){t.line=(this._line=new Ns(this.chart))._init(),t.label=(this._label=new Ts(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Es.defaults=ze(Ze.defaults,{});class Vs extends Ze{_doInit(t){super._doInit(t),t.tick=(this._tick=new Es(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const s=this._series;if(s instanceof Is){const{min:i,max:r}=s.getPixelMinMax(p(t,e));this._steps.forEach(t=>{t.rd=s.getRadius(t.value,i,r)})}return this._steps}_getFirstSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t){this._op,super._doPrepareRender(t),this._steps=this.$_buildSteps()}$_buildSteps(){const t=this._op.steps,e=[];if(r(t)&&t.length>0){const s=this.tick.label;t.forEach(t=>{i(t)?e.push({value:+t.value,label:t.label||s.getText(+t.value),rd:0}):isNaN(t)||e.push({value:+t,label:s.getText(+t),rd:0})})}return e}}Vs.defaults=ze(Ze.defaults,{});class Ds extends Ue{_createScale(t){return new Vs(t)}}class Rs extends He{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}Rs.MARKER_SIZE=10;class $s extends He{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isVisible(){return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}getLocation(){return this._location}isInner(){return"body"===this._location}getLayout(){if("auto"!==this._op.layout||"body"===this._location)return this._op.layout;switch(this._location){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return W(this._maxWidthDim,t,t)}getMaxHeight(t){return W(this._maxHeightDim,t,t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.maxWidth)!==e._maxWidth&&(e._maxWidth=s,e._maxWidthDim=Y(s,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=Y(t,!0))}(t.maxHeight)}_doPrepareRender(t){super._doPrepareRender(t),this._location=w(this._op.location,"bottom"),this._items=this.chart._getLegendSources().map(t=>new Rs(this,t)),this._op.reversed&&(this._items=this._items.reverse())}}$s.defaults=ze(He.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",gap:6,itemGap:8,markerVisible:!0,markerSize:Rs.MARKER_SIZE,markerGap:4,lineGap:4,offsetX:0,offsetY:0,itemsAlign:"center",seriesHovering:!0});class Os{constructor(t){this._color1=Ae.create(t.minColor),this._color2=Ae.create(t.maxColor),this._logger=dt.getLogger(t.logBase)}getColor(t,e,s,i){const r=this._logger;if(r){const i=1-t;t=r(t+i),e=r(e+i),s=r(s+i)}if(this._color1&&this._color2)return Ae.interpolate(this._color1,this._color2,(s-t)/(e-t)).toString();return x(this._color2,i,this._color1).brighten(1-(s-t)/(e-t)).toString()}}class Fs extends He{_doInit(t){t.label=(this._label=new Ye(this.chart))._init()}get label(){return this._label}getMarkerSize(){return b(this._op.size,7)}}Fs.defaults=ze(He.defaults,{size:7});class Bs extends He{}Bs.defaults=ze(He.defaults,{length:6});class zs extends We{getDefaultIconPos(){}}zs.defaults=ze(We.defaults,{});class js extends He{_doInit(t){t.line=(this._line=new Bs(this.chart))._init(),t.label=(this._label=new zs(this.chart))._init()}get line(){return this._line}get label(){return this._label}}js.defaults=ze(He.defaults,{});class Hs{constructor(t,e,s,i,r){this.from=t,this.to=e,this._color1=s,this._color2=i,this.label=r,this.visible=!0}get color(){return this._color2.toString()}canHide(){return!0}legendMarker(t,e){return this._legendMarker||(this._legendMarker=this.$_createLegendMarker(t,e))}$_createLegendMarker(t,e){const s=+e||Rs.MARKER_SIZE;return Qe.create(t,hs,0,0,s,s,0)}legendColor(){return this._color2.toString()}legendLabel(){return this.label}constains(t,e){return t>=this.from&&(e?t<=this.to:t<this.to)}getPosition(t,e){if(this.constains(t,e))return(t-this.from)/(this.to-this.from)}getColor(t,e){const s=this._color1,i=this._color2;if(!s)return(i||e).toString();const r=this.from,o=this.to;if(s&&i)return Ae.interpolate(s,i,(t-r)/(o-r)).toString();return x(i,e,s).brighten(1-(t-r)/(o-r)).toString()}}class Gs extends He{}const Ys="#fff",Ws="#000";class Zs extends Ze{_doInit(t){const e=this.chart;t.marker=(this._marker=new Fs(e))._init(),t.stepLine=(this._stepLine=new Gs(e))._init(),t.tick=(this._tick=new js(e))._init()}getColor(t,e,s,i){const r=this._steps;if(r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(s,t===e-1))return r[t].getColor(s,i);return s<=t?r[0]._color1.toString():i.toString()}return this._minColor?(this._logger&&(s=this._logger(s)),Ae.interpolate(this._minColor,this._maxColor||i,(s-this._min)/(this._max-this._min)).toString()):i.toString()}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get minColor(){return this._minColor}get maxColor(){return this._maxColor}getRanger(){return this}getLayout(){switch(this._op.layout){case"horizontal":case"vertical":return this._op.layout;default:return"left"===this._location||"right"===this._location?"vertical":"horizontal"}}getBarSize(t,e,s){let i,r;return s?(r=this._barLengthDim?W(this._barLengthDim,e):e,i=b(this._op.barWidth,12)):(i=this._barLengthDim?W(this._barLengthDim,t):t,r=b(this._op.barWidth,12)),{width:i,height:r}}getSplitPoints(t){const e=this._steps,s=this._valueSteps;let i=e?e.length:s?s.length-1:0;const r=[];if(i>1)for(let e=1;e<i;e++)r.push(e/i*t);return r}getPosition(t){const e=this._steps;if(!e){const e=this._logger;return e&&(t=e(t)),(t-this._min)/(this._max-this._min)}for(let s=0,i=e.length;s<i;s++){const r=e[s].getPosition(t,s===i-1);if(!isNaN(r))return(s+r)/i}}getTicks(){const t=this._tick.label,e=this._steps,s=this._valueSteps,i=this._min,r=this._max;let o,n=[];if(e){o=e.length,n.push({pos:e[0].from=b(e[0].from,i)});for(let t=1;t<o;t++)n.push({pos:e[t].from=b(e[t].from,e[t-1].to)});n.push({pos:e[o-1].to=b(e[o-1].to,r)})}else if(s){o=s.length,n.push({pos:s[0]});for(let t=1;t<o-1;t++)n.push({pos:s[t]});n.push({pos:s[o-1]})}else n=[{pos:i},{pos:r}];return o=n.length-1,n.forEach((e,s)=>{e.label=t.getNumberText(e.pos,!1,!1,0===s?"trunc":s===o?"ceil":void 0)}),n}getSteps(){return this._steps}getValueSteps(){return this._valueSteps}getLegendSources(t){!this._steps||"legend"!==this._op.display&&"both"!==this._op.display||this._steps.forEach(e=>t.push(e))}_doApply(t){super._doApply(t),this._setDim(t,"barLength"),this._minColor=Ae.create(t.minColor||Ys),this._maxColor=Ae.create(t.maxColor||Ws),this._colors=this.$_parseColorStops(t.colors)}$_parseColorStops(t){const e=[];if(r(t)){const s=t.length;if(s>1)for(let i=0;i<s;i++)e.push({stop:t[i].stop,color:Ae.create(t[i].color)});else 1===s&&e.push({stop:t[0].stop,color:Ae.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._maxColor});return(this._minColor&&e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(this._maxColor&&e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._maxColor}),e}_doPrepareRender(t){var e,s;super._doPrepareRender(t);const i=this._op,r=null===(s=null===(e=this._series)||void 0===e?void 0:e.getValueRange)||void 0===s?void 0:s.call(e);this._min=+i.minValue,this._max=+i.maxValue,this._logger=dt.getLogger(i.logBase),r&&(isNaN(this._min)&&(this._min=r.min),isNaN(this._max)&&(this._max=r.max)),this._steps=this.$_buildSteps()}$_parseValue(t,e,s){return n(t)?t.endsWith("%")?e+(s-e)*parseFloat(t)/100:void 0:t}$_normalizeMin(t,e){return t>c(t/e)*e?t=c(t/e)*e:t<d(t/e)*e&&(t=d(t/e)*e),D(t)}$_parseColor(t){return t&&t.endsWith("%")?Ae.interpolate(this._minColor,this._maxColor,parseFloat(t)/100):Ae.create(t)}$_buildSteps(){const t=this._op,e=t.steps,s=[],i=this._max;let o=.6,n=i;if(this._valueSteps=null,r(e)&&e.length>0){let t="0%";e.forEach((i,r)=>{var a,h;let l=this.$_parseValue(i.from,o,n),c=this.$_parseValue(i.to,o,n);0===r&&isNaN(l)&&(l=o),r===e.length-1&&isNaN(c)&&(c=n);let d=this.$_parseColor(i.fromColor||t),_=this.$_parseColor(t=(null!==(a=i.toColor)&&void 0!==a?a:i.color)||"100%");s.push(new Hs(l,c,d,_,null!==(h=i.label)&&void 0!==h?h:`${l} - ${c}`))}),this._logger=null}else if(o>=n)s.push(new Hs(o,n,this._minColor,this._maxColor,`${this._min} - ${this._max}`));else{const e=t.logBase,s=this._logger&&o>=0&&n-o>=e?this._logger:null,r=s?Math.max(0,1-o):0,a=this._valueSteps=[],h=Math.max(1,b(t.stepCount,1));let l=s?s(n-o):n-o;const c=Math.pow(10,Math.floor(Math.log10(l/h))),_=d(l/h/c)*c;if(o=this.$_normalizeMin(s?s(o+r):o+r,_),t.integralSteps){a.push(o);for(let t=1;t<=h;t++)a.push(D(a[t-1]+_))}else{const t=l/h;a.push(o);for(let e=1;e<h;e++)a.push(D(a[e-1]+t));a.push(D(s?s(n):n))}if(this._min=a[0],this._max=a[h],s){for(let t=0;t<=h;t++)a[t]=Math.pow(e,a[t]);a[0]-=r,t.integralSteps||(a[0]=.6,a[h]=i)}}return s.length>1?s:void 0}}Zs.defaults=ze(He.defaults,{display:"scale",minColor:Ys,maxColor:Ws,layout:"auto",barWidth:12,barLength:"40%",gap:8});class Us extends Ue{getVisibles(t){return super.getVisibles(t).filter(t=>"legend"!==t.options.display)}getLegendSources(){const t=[];return this._visibles.forEach(e=>e.getLegendSources(t)),t}_createScale(t){return new Zs(t)}}class Xs extends He{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)}}Xs.defaults=ze(He.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Ks extends He{_doSetSimple(t){return dt.isValidNum(t)?(this._op.step=t,!0):super._doSetSimple(t)}}Ks.defaults=ze(He.defaults,{step:10});class qs extends He{_doInit(t){t.line=(this._line=new Ks(this.chart))._init(),t.lonLine=(this._lonLine=new Ks(this.chart))._init(),t.latLine=(this._latLine=new Ks(this.chart))._init()}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this._fitTo}getStep(t){return b(this._line.options.step,this.$_defaultStep(t))}getLonStep(t){return y(this._lonLine.options.step,this._line.options.step,this.$_defaultStep(t))}getLatStep(t){return y(this._latLine.options.step,this._line.options.step,this.$_defaultStep(t))}_doApply(t){super._doApply(t),this._fitTo=t.fitTo}_doPrepareRender(t){super._doPrepareRender(t)}$_defaultStep(t){return 10}}qs.defaults=ze(He.defaults,{visible:!1,fitTo:"map"});class Js extends He{}Js.defaults=ze(He.defaults,{visible:!1});class Qs extends He{}Qs.defaults=ze(He.defaults,{visible:!1});class ti extends He{_doInit(t){t.line=(this._line=new Qs(this.chart))._init(),t.label=(this._label=new Ye(this.chart))._init()}get line(){return this._line}get label(){return this._label}}ti.defaults=ze(He.defaults,{visible:!1});class ei extends We{getDefaultIconPos(){return"left"}}ei.defaults=ze(We.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class si extends He{_doInit(t){t.label=(this._label=new ei(this.chart))._init()}get label(){return this._label}}si.defaults=ze(He.defaults,{front:!0,zindex:0});class ii extends si{}ii.defaults=ze(si.defaults,{});class ri extends si{}ri.defaults=ze(si.defaults,{});class oi extends si{}oi.defaults=ze(si.defaults,{});class ni extends He{}ni.defaults=ze(He.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class ai extends He{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new ni(this.chart))._init(),this._args={axis:void 0,coord:void 0,flag:void 0,points:void 0}}get flag(){return this._flag}getFlag(t){const e=this._flag.options;let s=ne.getFormatter(e.numberFormat).toStr(t);return e.prefix&&(s=e.prefix+s),e.suffix&&(s+=e.suffix),s}moved(t,e,s){}_doSetSimple(t){return o(t)?(this._op.visible=!0,this._op.onChange=t,!0):super._doSetSimple(t)}}ai.defaults=ze(He.defaults,{visible:!1});class hi extends He{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new Js(this.chart))._init(),this.options.leftLine=(this._leftLine=new Js(this.chart))._init(),this.options.rightLine=(this._rightLine=new Js(this.chart))._init(),this.options.topLine=(this._topLine=new Js(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new Js(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new Js(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new Js(this.chart))._init(),this.options.grid=(this._grid=new qs(this.chart))._init(),this.options.tick=(this._tick=new ti(this.chart))._init(),this.options.crosshair=(this._crosshair=new ai(this))._init()}get line(){return this._line}get leftLine(){return this._leftLine}get rightLine(){return this._rightLine}get topLine(){return this._topLine}get bottomLine(){return this._bottomLine}get equatorLine(){return this._equatorLine}get meridianLine(){return this._meridianLine}get grid(){return this._grid}get tick(){return this._tick}get crosshair(){return this._crosshair}get guides(){return this._guides.slice()}_doApply(t){if(super._doApply(t),s.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(r(e)?e:[e]))}}$_loadGuides(t){const e=this._guides=[];t.forEach(t=>{let s;s="range"===t.type?new oi(this.chart):"line"===t.type?new ii(this.chart):"band"===t.type?new ri(this.chart):new ii(this.chart),s._init(),s._load(t),e.push(s)})}}function li(t,e){const[s,i]=t;let r=!1;for(let t=0,o=e.length-1;t<e.length;o=t++){const[n,a]=e[t],[h,l]=e[o];a>i!=l>i&&s<(h-n)*(i-a)/(l-a)+n&&(r=!r)}return r}function ci(t,e){let s=!1;li(t,e[0])&&(s=!s);for(let i=1;i<e.length;i++)li(t,e[i])&&(s=!s);return s}hi.defaults=ze(He.defaults,{});class di{constructor(t,e=4){this.bbox=t,this.capacity=e,this.entries=[],this.children=null,this.divided=!1}subdivide(){const{minLon:t,minLat:e,maxLon:s,maxLat:i}=this.bbox,r=(t+s)/2,o=(e+i)/2,n={minLon:t,minLat:o,maxLon:r,maxLat:i},a={minLon:r,minLat:o,maxLon:s,maxLat:i},h={minLon:t,minLat:e,maxLon:r,maxLat:o},l={minLon:r,minLat:e,maxLon:s,maxLat:o};this.children=[new di(n,this.capacity),new di(a,this.capacity),new di(h,this.capacity),new di(l,this.capacity)],this.divided=!0}intersects(t,e){return!(t.minLon>e.maxLon||t.maxLon<e.minLon||t.minLat>e.maxLat||t.maxLat<e.minLat)}isContained(t,e){return t.minLon>=e.minLon&&t.maxLon<=e.maxLon&&t.minLat>=e.minLat&&t.maxLat<=e.maxLat}insert(t){if(!this.intersects(t.bbox,this.bbox))return!1;if(this.divided&&this.children){let e=!1;for(const s of this.children)if(this.isContained(t.bbox,s.bbox)&&(e=s.insert(t),e))break;return e||(this.entries.push(t),e=!0),e}return this.entries.length<this.capacity?(this.entries.push(t),!0):(this.subdivide(),this.insert(t))}containsPoint(t,e,s){return t>=s.minLon&&t<=s.maxLon&&e>=s.minLat&&e<=s.maxLat}queryPoint(t,e,s=[]){if(!this.containsPoint(t,e,this.bbox))return s;for(const i of this.entries)this.containsPoint(t,e,i.bbox)&&s.push(i);if(this.divided&&this.children)for(const i of this.children)i.queryPoint(t,e,s);return s}}class _i{constructor(t,e){var s;this.worldBBox=t,this.root=new di(t);for(const t of e)this.root.insert({featureId:t.id,originalFeature:{id:t.id,geometry:{type:t.source.polygon?"Polygon":"MultiPolygon",coordinates:null!==(s=t.source.polygon)&&void 0!==s?s:t.source.polygons}},bbox:{minLon:t.h1,minLat:t.v1,maxLon:t.h2,maxLat:t.v2}})}find(t){const e=this.root.queryPoint(t[0],t[1]).find(e=>function(t,e){if("Polygon"===e.type)return ci(t,e.coordinates);if("MultiPolygon"===e.type){for(const s of e.coordinates)if(ci(t,s))return!0;return!1}return!1}(t,e.originalFeature.geometry));return e?e.featureId:null}}const ui="37630",pi={area:"39",children:["39010","39020"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},gi={area:ui,parent:"37",polygons:[1,2],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},mi={area:"",parent:"23,23520",polygons:[[8,9],[6,7]],coord:[125.7,37.5],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},fi={area:"39",children:["39010110","39010120","39010130","39010140","39010310","39010620","39010630","39010640","39010330","39010510","39010520","39010530","39010540","39010550","39010560","39010570","39010580","39010590","39010600","39010610","39010650","39010660","39010670","39010680","39010690","39020110","39020120","39020130","39020310","39020320","39020510","39020520","39020530","39020540","39020550","39020560","39020570","39020580","39020590","39020600","39020610","39020620"],coord:[NaN,33.6],frame:"0.05 0.08",border:"-0.2 h-0.05 w-0.1 h+0.1 w+0.2 h"},bi={area:ui,children:["37630110","37630310","37630320"],offset:[-1.1,NaN],frame:"0.05 0.1",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"},yi={area:"23520",children:["23520330","23520340"],coord:[125.4,37.7],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},wi={area:"AK",coord:[-119,6.4],frame:"0.5 0.5"},xi={area:"HI",coord:[-126,21],frame:"0.5 0.5"},vi={area:"JPN-3502",offset:[20,6],frame:"0.4 0.2",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"};function Ci(t,e){const s=t.split(/[\s,]+/g),i=[],r="z"===s[s.length-1]||"Z"===s[s.length-1];r&&s.pop();for(let r=0;r<s.length/2;r++)for(let o=0;o<2;o++){const n=s[2*r+o],a=+n;if(isNaN(a)){const s=n.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<s.length;){const i=s[h++];if("-"===i)r=-1;else if("+"===i)r=1;else if("w"===i)a+=r*(e.h2-e.h1);else if("h"===i)a+=r*(e.v2-e.v1);else if(i.length>0){const s=parseFloat(i);if(isNaN(s))throw new Error("Invalid border expression: "+t);i.endsWith("h")?a+=r*s*(e.v2-e.v1):i.endsWith("w")?a+=r*s*(e.h2-e.h1):a+=r*s}}i.push(a+(0===o?e.h1:e.v1))}else i.push(a+(0===o?e.h1:e.v1))}return r&&i.push("z"),i}class Si{constructor(t,e){this.id=t,this.props=e}}class Li extends Si{}class Ai extends Li{constructor(t,e,s,i){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(e<=0)r.splice(s,1);else if(1!==e){const t=r[s],o=[];for(let e=0;e<t.length;e++){const s=[];for(let i=0;i<t[e].length;i++)s.push(t[e][i].slice());o.push(s)}r[s]=o,this.$_moveToRate(s,i,1-e)}}$_moveToRate(t,e,s){const i=it(this.polygons[t]),r=it(this.polygons[e]);let o,n,a=0,h=0;if((o=i.h1-r.h2)>0&&(n=r.v1-i.v2,o>n&&(a=-o*s,h=n*s)),0!==a)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][0]+=a;if(0!==h)for(const e of this.polygons[t])for(let t=0;t<e.length;t++)e[t][1]+=h}}class Mi extends bt{static createStockInset(t,e){let s;switch(t){case"제주":case"제주도":s=pi;break;case"울릉":case"울릉도":s=gi;break;case"백령":case"백령도":s=mi;break;case"읍면동_제주":case"읍면동_제주도":s=fi;break;case"읍면동_울릉":case"읍면동_울릉도":s=bi;break;case"읍면동_백령":case"읍면동_백령도":s=yi;break;default:switch(t.toLowerCase()){case"alaska":s=wi;break;case"hawaii":s=xi;break;case"okinawa":s=vi}}return s&&e&&(s=Object.assign({},s,e)),s}constructor(t){var e,s,o;super(),this._excludes={};const n=null!==(e=t.source)&&void 0!==e?e:t.map,a=r(t.insets)?t.insets:i(t.insets)?[t.insets]:void 0;this.name=t.name,this.enabled=w(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=i(null==n?void 0:n.meta)?dt.deepClone(n.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(s=this.meta.dummies)||void 0===s?void 0:s.slice(),this.paddings=Q(null!==(o=t.padding)&&void 0!==o?o:"0"),this.useOffset=t.useOffset,this._excludes={},r(t.exclude)&&t.exclude.forEach(t=>this._excludes[t]=1),this.dummies&&!0!==t.showDummies&&(this.dummies.forEach(t=>{this._excludes[t]=1}),this.dummies=void 0),this.insets={},a&&a.length>0&&a.forEach(t=>{var e,s;t&&null!=t.area&&(this.insets[t.area]={area:t.area,children:t.children,parent:t.parent,polygons:r(t.polygons)?t.polygons.slice():r(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(s=t.offset)||void 0===s?void 0:s.slice(0,2),border:r(t.border)?t.border.map(t=>t.slice(0,2)):t.border,frame:t.frame})}),n&&(this.items=this.$_load(n))}included(t){return!this._excludes[t]}$_load(t){return this._doLoad(t)}}class ki{constructor(){this._scroll=0,this._offset=[0,0]}get scroll(){return this._scroll}set scroll(t){const e=t%360;this._scroll=e<0?360+e:e,this.second&&(this.second._scroll=this._scroll-360),360===this._scroll&&(this._scroll=0,this.second&&(this.second._scroll=-360))}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this.second&&(this.second._offset=this._offset)}prepareSecond(){return this.second=new this.constructor,this}getClipBounds(){const t=[],e=this.scroll;this.scroll=0;for(let e=-90;e<=90;e+=10)t.push(this.project([-180,e]));for(let e=90;e>=-90;e-=10)t.push(this.project([180,e]));return this.scroll=e,t}backward(t){return t}clip(t){return t}isVisible(t){return!0}getVisible(t){return this.isVisible(t)?this.project(t):null}isClipping(){return!0}}const Pi=90,Ii=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Ni extends ki{constructor(){super(),this._rotation=[0,0],this._r=Pi,this.bounds={x1:-90,x2:Pi,y1:-90,y2:Pi},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get isElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=Ii(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=Ii(t))!==this._rotation[1]?(this._rotation[1]=t,!0):void 0)}getRotation(){return this._rotation.slice(0)}setRotation(t,e){if([this._setRotationX(t),this._setRotationY(e)].some(Boolean))return this._calcBounds(),!0}_calcBounds(){const[t,e]=this._rotation;Ii(-90-t),Ii(90-t),Ii(90+e),Ii(-90+e),this._prevCoord=null}project(t){const[e,s]=this._rotate(t),i=s*T,r=[Math.cos(i)*Math.sin(e*T)*this._r,Math.sin(i)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/Pi,s=t[1]/Pi,i=Math.sqrt(e*e+s*s),r=Math.asin(i),o=Math.sin(r),n=Math.cos(r),a=[Math.atan2(e*o,i*n)/T,Math.asin(i&&s*o/i)/T];return this._unrotate(a)}clip(t){return t}isVisible(t){return!(this._prevCoord=this.project(t)).outside}getVisible(t){return this.isVisible(t)?this._prevCoord:null}isClipping(){return!1}_rotate(t){const e=this._rotation[0]*T,s=(this._rotation[1]||0)*T,i=Math.cos(s),r=Math.sin(s),o=Math.cos(0),n=Math.sin(0);if(0===e&&0===s)return t.slice(0);const a=t[0]*T+e,h=t[1]*T,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*i+c*r;return[Math.atan2(d*o-u*n,c*i-_*r)/T,Math.asin(u*o+d*n)/T]}_unrotate(t){const e=Math.PI/180,s=180/Math.PI,i=t[0]*e,r=t[1]*e*-1,o=Math.cos(r);let n=Math.cos(i)*o,a=Math.sin(i)*o,h=Math.sin(r);const l=this._rotation[0]*e,c=this._rotation[1]*e,d=Math.cos(l),_=Math.sin(l),u=Math.cos(c),p=Math.sin(c),g={x:u*d*n+_*a-p*d*h,y:-u*_*n+d*a+p*_*h,z:p*n+u*h};return[Math.atan2(g.y,g.x)*s,-Math.asin(g.z)*s]}}function Ti(t,e){const{atan2:s,cos:i,sin:r,sqrt:o}=Math,n=t[1]*T,a=t[0]*T,h=e[1]*T,l=e[0]*T,c=h-n,d=l-a,_=r(c/2)*r(c/2)+i(n)*i(h)*r(d/2)*r(d/2),u=2*s(o(_),o(1-_)),p=6371e3*u,g=Math.round(p/5e5),m=[];if(g>1){const t=1/g;for(let e=t;e<.999;e+=t){const t=r((1-e)*u)/r(u),c=r(e*u)/r(u),d=t*i(n)*i(a)+c*i(h)*i(l),_=t*i(n)*r(a)+c*i(h)*r(l),p=s(t*r(n)+c*r(h),o(d*d+_*_)),g=s(_,d);m.push([g/T,p/T])}}return m}const Ei=Math.min,Vi=Math.max;class Di extends bt{constructor(t,e){if(super(),this.source=t,this.inset=e,this.mainLandBounds=null,this.visible=!0,this._selected=!1,t){const e=t.props["ctr-lon"],s=t.props["ctr-lat"];isNaN(e)||isNaN(s)||(this.center=[+e,+s])}}setSelected(t){this._selected=t}get path(){return this._path}get selected(){return this._selected}displayText(){return this.name||this.id}getInfo(){return this._info||(this._info={id:this.source.id,props:this.source.props,h1:this.h1,v1:this.v1}),this._info}reset(){this._path=null}$_readBound(t,e){let s=this.h1,i=this.h2,r=this.v1,o=this.v2;t[0].forEach(t=>{s=Ei(s,t[0]+e[0]),i=Vi(i,t[0]+e[0]),r=Ei(r,t[1]+e[1]),o=Vi(o,t[1]+e[1])}),this.h1=s,this.h2=i,this.v1=r,this.v2=o}$_readInset(t,e){if(!t._off){const s=t.coord,i=t.offset;let o=[0,0];r(s)&&s.length>0&&(o[0]=isNaN(s[0])?0:+s[0]-e.h1,o[1]=isNaN(s[1])?0:+s[1]-e.v1),r(i)&&i.length>0&&(o[0]+=b(i[0],0),o[1]+=b(i[1],0)),t._off=o}return t.offset=t._off}$_toPath(t,e,s){const i=t.isGlobe,r=e[0].slice();if(s){for(let t=0;t<r.length;t++)r[t]=r[t].slice(0);r.forEach(t=>{t[0]+=s[0],t[1]+=s[1]})}let o=this.x1,n=this.x2,a=this.y1,h=this.y2;const l=r.map(e=>{const s=t?t.project(e):e;return s.outside||(o=Ei(o,s[0]),n=Vi(n,s[0]),a=Ei(a,s[1]),h=Vi(h,s[1])),s});let c;if(this.x1=o,this.x2=n,this.y1=a,this.y2=h,i){let e,s,i=!1;!function(t){let e=t.length-1;for(;e--;)if(Math.max(Math.abs(t[e][0]-t[e+1][0]),Math.abs(t[e][1]-t[e+1][1]))>10){const s=Ti(t[e],t[e+1]);s.length&&t.splice(e+1,0,...s)}}(r),c=[];for(let o=0;o<l.length;o++){const n=r[o],a=l[o];if(a.outside)i=!0;else{if(e||(e=n,r.push(n),l.push(a)),i&&s){Ti(s,n).forEach(e=>c.push(t.project(e)))}c.push(a),s=n,i=!1}}}else c=l;if(c.length>0){return`M ${c[0][0]} ${c[0][1]} L`+c.slice(1).map(t=>t.join(" ")).join(" ")+" Z"}return""}readBounds(t){let e=1/0,s=-1/0,i=1/0,r=-1/0;if(t)for(const o of t)this.source.polygons[o][0].forEach(t=>{e=Ei(e,t[0]),s=Vi(s,t[0]),i=Ei(i,t[1]),r=Vi(r,t[1])});else(this.source.polygons||[this.source.polygon]).forEach(t=>{t[0].forEach(t=>{e=Ei(e,t[0]),s=Vi(s,t[0]),i=Ei(i,t[1]),r=Vi(r,t[1])})});return{h1:e,v1:i,h2:s,v2:r}}readPolygonBounds(t){let e=1/0,s=-1/0,i=1/0,r=-1/0;for(const o of t)for(const t of o)e=Ei(e,t[0]),s=Vi(s,t[0]),i=Ei(i,t[1]),r=Vi(r,t[1]);return{x1:e,x2:s,y1:i,y2:r}}readPath(t){if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset;let s,i;if(e)if(this._insetChilds){let t=1/0,i=1/0;this.source.polygons.forEach((e,s)=>{this._insetChilds.indexOf(s)>=0&&e[0].forEach(e=>{t=Ei(t,e[0]),i=Ei(i,e[1])})}),s=this.$_readInset(e,{h1:t,v1:i}),this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,et)})}else this.source.polygons?this.source.polygons.forEach(t=>this.$_readBound(t,et)):this.$_readBound(this.source.polygon,et),s=this.$_readInset(e,this);else this.source.polygons?this.source.polygons.forEach(t=>this.$_readBound(t,et)):this.$_readBound(this.source.polygon,et);s&&(this._insetChilds?(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,this.source.polygons.forEach((t,e)=>{this._insetChilds.indexOf(e)>=0?this.$_readBound(t,s):this.$_readBound(t,et)})):(this.h1+=s[0],this.h2+=s[0],this.v1+=s[1],this.v2+=s[1])),this.x1=1/0,this.x2=-1/0,this.y1=1/0,this.y2=-1/0,this.source.polygons?(i="",this._insetChilds?this.source.polygons.forEach((e,r)=>{this._insetChilds.indexOf(r)>=0?i+=this.$_toPath(t,e,s):i+=this.$_toPath(t,e,null)}):this.source.polygons.forEach((e,r)=>{i+=this.$_toPath(t,e,s)})):i=this.$_toPath(t,this.source.polygon,s),this._path=i}return this._path}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Di;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class Ri extends bt{constructor(t,e,s){if(super(),this.owner=t,this.source=e,this._hiddens={},!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=s,this._name=e.name,(this._second=e instanceof Ri)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new _i({minLon:-180,minLat:-90,maxLon:180,maxLat:90},this._areas)}get index(){return this._index}get name(){return this._name}get areaCount(){return this._areas.length}get hiddenAreas(){var t;return null===(t=this._hiddenAreas)||void 0===t?void 0:t.slice()}set hiddenAreas(t){if(t!=this._hiddenAreas){const e=this._hiddens={};this._hiddenAreas=t,r(t)&&t.forEach(t=>e[t]=1),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const s in this._areaMap){const i=this._areaMap[s];t in i.source.props&&(e[i.source.props[t]]=i)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach(t=>{t.reset()}),this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}isWorldMap(){return this.$_isWorldMap()}$_preflight(){var t;let e=1/0,s=-1/0,i=1/0,r=-1/0;for(let o=0;o<this._areas.length;o++){const n=this._areas[o];n.inset;let{h1:a,h2:h,v1:l,v2:c}=n.readBounds();if(null===(t=n.inset)||void 0===t?void 0:t.coord){const[t,e]=n.inset.coord;h=t+h-a,c=e+c-l,a=t,l=e}if(a<e&&(e=a),h>s&&(s=h),l<i&&(i=l),c>r&&(r=c),-180==e&&180==s&&-90==i&&90==r)return}return{minLat:i,maxLat:r,minLon:e,maxLon:s}}$_isWorldMap(t=this.h1,e=this.h2){return e-t===360}$_resetAreas(){const t=this.owner.getProjection(this._second);if(t instanceof Ni)t.getRotation(),this._areas.forEach(e=>{e.visible=this.isVisible(e.id),e.readPath(t)}),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=Pi,this.y2=Pi;else{let e=1/0,s=-1/0,i=1/0,r=-1/0,o=1/0,n=-1/0,a=1/0,h=-1/0;if(!this._second&&this._useOffset){const{minLat:e,maxLat:s,minLon:i,maxLon:r}=this.$_preflight();t.offset=!0===this._useOffset?[-(i+(r-i)/2),-(e+(s-e)/2)]:this._useOffset}if(this._areas.forEach(l=>{l.visible=this.isVisible(l.id),l.readPath(t)&&(e=Ei(e,l.h1),s=Vi(s,l.h2),i=Ei(i,l.v1),r=Vi(r,l.v2),o=Ei(o,l.x1),n=Vi(n,l.x2),a=Ei(a,l.y1),h=Vi(h,l.y2),l.mainLandBounds={x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2},this.$_updateMainAreaBounds(l))}),this.source instanceof Mi){const t=this.source.paddings;i-=t.b,r+=t.t,e-=t.l,s+=t.r,a-=t.b,h+=t.t,o-=t.l,n+=t.r}this.h1=e,this.v1=i,this.h2=s,this.v2=r,this.x1=o,this.y1=a,this.x2=n,this.y2=h,this.cx=this.x1+(this.x2-this.x1)/2,this.cy=this.y1+(this.y2-this.y1)/2}}$_updateMainAreaBounds(t){var e,s;const i=t.source.props["rm-main-area"],r=null==i?void 0:i.split(",").filter(t=>"string"==typeof t).map(t=>t.trim()).map(t=>Number(t));if(!r||0===r.length)return;const o=t.mainLandBounds;t.mainLandBounds=null;for(const i of r){const r=null===(e=t.source)||void 0===e?void 0:e.polygons,o=r&&r[i];if(!o)continue;const n=t.readPolygonBounds(o);null!==(s=t.mainLandBounds)&&void 0!==s||(t.mainLandBounds=n),t.mainLandBounds.x1=Ei(t.mainLandBounds.x1,n.x1),t.mainLandBounds.x2=Vi(t.mainLandBounds.x2,n.x2),t.mainLandBounds.y1=Ei(t.mainLandBounds.y1,n.y1),t.mainLandBounds.y2=Vi(t.mainLandBounds.y2,n.y2)}t.mainLandBounds||(t.mainLandBounds=o)}$_load(t){var e;const s=t.insets,i=t.idKey,o=null!==(e=t.nameKey)&&void 0!==e?e:"name",n=t.meta.dokdo,h=t.dummies,l=this._areas=[],c=this._areaMap={},d=this._insets=[];this._useOffset=t.useOffset,t.items.forEach(e=>{if(e instanceof Li){const r=w(e.props[i],e.id);if(r&&t.included(r)){const t=new Di(e,s[r]);delete s[r],h&&h.indexOf(r)>=0?(l.unshift(t),t.dummy=!0):l.push(t),c[t.id=r]=t,t.name=w(e.props[o],e[o])}}});for(const t in s){const e=s[t];if(e.parent&&(a(e.polygons)||r(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let s=0;s<t.length;s++){const i=c[t[s]];if(i){const o=e.polygons[s];i.inset=e,i._insetChilds=r(o)?o:[o],e._base=i._insetChilds,e.parent=t[s],d.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=r(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,d.push(e))}else if(r(e.children)){const t=e._base=[],s=e.offset?e.offset.slice():[0,0];if(r(e.coord)){let t=1/0,i=1/0;for(const s of e.children){const e=c[s];if(!e)continue;const r=e.readBounds();t=Ei(t,r.h1),i=Ei(i,r.v1)}isNaN(e.coord[0])||(s[0]=e.coord[0]-t),isNaN(e.coord[1])||(s[1]=e.coord[1]-i)}for(const i of e.children){const e=c[i];e&&(e.inset={area:i,offset:s},t.push(e))}d.push(e)}}if(n&&!isNaN(+t.dokdo)){const e=c[n.group];e&&(e.source=new Ai(e.source,+t.dokdo,+n.index,+n.parent))}this.reset()}$_copy(t){const e=this._areas=[],s=this._areaMap={};this._useOffset=t._useOffset,t._areas.forEach(t=>{const i=t._clone();e.push(i),s[i.id]=i}),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new Ri(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class $i extends We{getText(t){return dt.isValidNum(t)?this._getText(null,t,m(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}$i.defaults=ze(Ze.defaults,{offset:4});class Oi extends Ze{_doInit(t){super._doInit(t),t.label=(this._label=new $i(this.chart))._init()}get label(){return this._label}_getFirstSeries(t){return t.getFirstSeries("map")}_doApply(t){super._doApply(t)}_doPrepareRender(t){this._op,super._doPrepareRender(t),this._scale=this.$_calcScale()}$_calcScale(){return 10}}Oi.defaults=ze(Ze.defaults,{visible:!1});class Fi extends He{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:Fi.ITEM_GAP}}Fi.ITEM_GAP=4,Fi.defaults=ze(He.defaults,{offsetX:8,offsetY:8,itemGap:3});class Bi extends Fi{get vertical(){return"vertical"===this._op.direction}getButtonSize(){var t,e,s,i;return{width:null!==(e=null!==(t=this._op.buttonWidth)&&void 0!==t?t:this._op.buttonHeight)&&void 0!==e?e:Bi.BUTTON_SIZE,height:null!==(i=null!==(s=this._op.buttonHeight)&&void 0!==s?s:this._op.buttonWidth)&&void 0!==i?i:Bi.BUTTON_SIZE}}getZoomStep(){var t;return null!==(t=this._op.zoomStep)&&void 0!==t?t:20}_isVisible(){return super._isVisible()&&this.chart.body.options.zoomable&&(this.chart.body.isZoomed||this._op.showAlways)}}Bi.BUTTON_SIZE=24,Bi.defaults=ze(Fi.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomStep:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class zi extends Fi{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}zi.defaults=ze(Fi.defaults,{type:"text",align:"left",verticalAlign:"top"});class ji extends bt{constructor(t){super(),this._items=[],this._owner=t}get count(){return this._items.length}get first(){return this._items[0]}get last(){return this._items[this._items.length-1]}get(t){return this._items[t]}contains(t){return this._items.indexOf(t)>=0}clear(){if(this._items.length>0)return this._items.forEach(t=>t.setSelected(!1)),this._items=[],this._owner.selectionCleared(),this._changed(),!0}add(t,e,s=!1){let r;return s&&(r=this.clear()),t&&i(e)&&!this.contains(e)&&(this._items.push(e),t.select(e),this._owner.selectionItemAdded(e),this._changed(),r=!0),r}remove(t,e){const s=this._items.indexOf(e);if(s>=0)return this._items.splice(s,1),t.unselect(e),this._owner.selectionItemRemoved(e),this._changed(),!0}toggle(t,e){return!!this.remove(t,e)||this.add(t,e)}_changed(){this._owner.selectionChanged(this)}}class Hi extends He{isVisible(){return this.visible&&!B(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}}Hi.defaults=ze(He.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Gi extends Hi{}Gi.defaults=ze(Hi.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Yi extends He{constructor(t){super(t.chart),this.owner=t}_doInit(){this._domain={callback:(t,e)=>this._ctx.getTooltipParam(this._series,this._point,e)}}setTarget(t,e){let s=w(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(s,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!=e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=e._numberFormat?ne.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?Ce.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Yi.defaults=ze(He.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});class Wi extends Ke{_isVisible(){return this._op.visible&&!z(this._op.imageUrl)}_doSetSimple(t){return n(t)?(this._op.imageUrl=t,!0):super._doSetSimple(t)}}Wi.type="image",Wi.defaults=ze(Ke.defaults,{});class Zi extends Ke{getSeries(){if(this._xRange&&this._yRange){const t=this.chart.seriesByName(this._op.series);if(t&&t.visible)return{series:t,xRange:this._xRange,yRange:this._yRange}}}getShape(){return this._op.shape||Zi.defaults.shape}_doSetSimple(t){return n(t)?(this._op.shape=t,!0):super._doSetSimple(t)}}Zi.type="shape",Zi.defaults=ze(Ke.defaults,{width:64,height:64,shape:"square"});class Ui extends Ke{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!z(this._op.text)}_doSetSimple(t){return n(t)?(this._op.text=t,!0):super._doSetSimple(t)}_doApply(t){const e=this;var s;super._doApply(t),(s=t.numberFormat)!==e._numberFormat&&(e._numberFormat=s,e._domain.numberFormatter=s?ne.getFormatter(s):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Ce.getFormatter(t):void 0)}(t.timeFormat)}}Ui.type="text",Ui.defaults=ze(Ke.defaults,{text:"Text"});class Xi extends ki{project(t){return[t[0]+this.offset[0]-this.scroll,t[1]+this.offset[1]]}backward(t){return[t[0]-this.offset[0],t[1]-this.offset[1]]}}const Ki=1.340264,qi=-.081106,Ji=893e-6,Qi=.003796,tr=Math.sqrt(3)/2,er=74.03120656864502;class sr extends ki{get isElliptic(){return!0}project(t){const e=T,s=Math.asin(tr*Math.sin((t[1]+this.offset[1])*e)),i=s*s,r=i*i*i;return[(t[0]+this.offset[0]-this.scroll)*e*Math.cos(s)*er/(tr*(Ki+3*qi*i+r*(7*Ji+9*Qi*i))),s*er*(Ki+qi*i+r*(Ji+Qi*i))]}backward(t){const e=t[0]/er,s=t[1]/er,i=180/Math.PI;let r,o,n,a,h,l=s;for(let t=0;t<12&&(r=l*l,o=r*r*r,n=l*(Ki+qi*r+o*(Ji+Qi*r))-s,a=Ki+3*qi*r+o*(7*Ji+9*Qi*r),l-=h=n/a,!(Math.abs(h)<1e-9));++t);r=l*l,o=r*r*r;const c=i*tr*e*(Ki+3*qi*r+o*(7*Ji+9*Qi*r))/Math.cos(l),d=i*Math.asin(Math.sin(l)/tr);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const ir=63.78137,rr=Math.PI/180;class or extends ki{constructor(){super(...arguments),this.maxLatitude=85.0511287798}project(t){let e=Math.max(-this.maxLatitude,Math.min(this.maxLatitude,t[1]+this.offset[1]));const s=Math.sin(e*rr);return[ir*(t[0]+this.offset[0]-this.scroll)*rr,ir*Math.log((1+s)/(1-s))/2]}backward(t){return[(t[0]-this.offset[0])/(ir*rr),(2*Math.atan(Math.exp((t[1]-this.offset[1])/ir))-Math.PI/2)/rr]}}const nr=Math.PI/4,ar=Math.PI/180,hr=63.78137;class lr extends ki{project(t){return[(t[0]+this.offset[0]-this.scroll)*ar*hr,79.7267125*Math.log(Math.tan(nr+.4*(t[1]+this.offset[1])*ar))]}backward(t){return[(t[0]-this.offset[0])/hr/ar,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/hr*.8))-nr)/ar]}}class cr extends Cs{}class dr extends Ss{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=this._createLabel(this.chart))._init()}get subLabel(){return this._subLabel}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new cr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return Qe.create(t,hs,0,0,e,e,2)}}dr.type="bar",dr.defaults=ze(Ss.defaults,{barWidth:.7});class _r extends He{constructor(t){super(t.chart),this.gauge=t}}class ur extends _r{}ur.defaults=ze(He.defaults,{visible:!1});class pr extends _r{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}pr.defaults=ze(He.defaults,{});class gr extends _r{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}gr.defaults=ze(He.defaults,{thickness:"100%",stroked:!1});class mr extends _r{getExtents(t){return{radius:W(this._radiusDim,t,0),length:W(this._lengthDim,t,0),offset:W(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}mr.defaults=ze(He.defaults,{visible:!1,radius:3,length:"100%",offset:0});class fr extends _r{getRadius(t){return W(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}fr.defaults=ze(He.defaults,{visible:!1,radius:5});class br extends Ye{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:W(this._offsetXDim,t,0),y:W(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}br.defaults=ze(Ye.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class yr{constructor(){this.setCenterX(xr.DEF_CENTER),this.setCenterY(xr.DEF_CENTER),this.setRadius(xr.DEF_RADIUS),this.setInnerRadius(xr.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Y(w(t,xr.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Y(w(t,xr.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Y(w(t,xr.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Y(w(t,xr.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Y(t,!0))}getCenter(t,e){return{x:W(this._centerXDim,t,t/2),y:W(this._centerYDim,e,e/2)}}getExtents(t){const e=W(this._radiusDim,t,t/2),s=p(e,this._innerDim?W(this._innerDim,e):0),i=s+(e-s)/2;return{radius:e,inner:s,value:this._valueDim?W(this._valueDim,i):i,radiusThick:e-s}}prepareAngles(t,e){const s=b(t%360,0),i=g(0,p(360,b(e,360)));this._startRad=N+T*s,this._handRad=T*s,this._sweepRad=T*i}}class wr extends Ls{_readObject(t,e){super._readObject(t,e)}}class xr extends Ms{_doInit(t){super._doInit(t),t.face=(this._face=new ur(this))._init(),t.rim=(this._rim=new pr(this))._init(),t.valueRim=(this._valueRim=new gr(this))._init(),t.hand=(this._hand=new mr(this))._init(),t.pin=(this._pin=new fr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new br(this.chart))._init(),this._props=new yr}get face(){return this._face}get rim(){return this._rim}get valueRim(){return this._valueRim}get hand(){return this._hand}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}_createPoint(t){return new wr(t)}_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)}_doPrepareRender(t){super._doPrepareRender(t),this._props.prepareAngles(this._op.startAngle,this._op.sweepAngle)}}xr.DEF_CENTER="50%",xr.DEF_RADIUS="50%",xr.DEF_INNER="80%",xr.type="gauge",xr.defaults=ze(Ms.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class vr extends He{constructor(t){super(t.chart),this.gauge=t}}class Cr extends vr{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Cr.defaults=ze(He.defaults,{thickness:3});class Sr extends vr{getLength(t){return W(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}Sr.defaults=ze(He.defaults,{thickness:1.5,length:"55%"});class Lr extends Sr{}Lr.defaults=ze(Sr.defaults,{thickness:1,length:"80%"});class Ar extends Sr{}Ar.defaults=ze(Sr.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class Mr extends vr{}Mr.defaults=ze(He.defaults,{length:5});class kr extends vr{}kr.defaults=ze(He.defaults,{step:1,offset:0});class Pr extends vr{}Pr.defaults=ze(He.defaults,{radius:4});class Ir extends Ye{}Ir.defaults=ze(Ye.defaults,{text:"RealMap",position:"top"});class Nr extends Ls{getTime(){const t=this.time;return t instanceof Date?t:n(t)?new Date(t):isNaN(t)?void 0:new Date(t)}_readObject(t,e){super._readObject(t,e),this.time=b(e.time,NaN),this.timezone=b(e.timezone,NaN)}}class Tr extends As{_doInit(t){super._doInit(t),t.face=(this._face=new He(this.chart))._init(),t.rim=(this._rim=new Cr(this))._init(),t.hourHand=(this._hourHand=new Sr(this))._init(),t.minuteHand=(this._minuteHand=new Lr(this))._init(),t.secondHand=(this._secondHand=new Ar(this))._init(),t.tick=(this._tick=new Mr(this))._init(),t.tickLabel=(this._tickLabel=new kr(this))._init(),t.pin=(this._pin=new Pr(this))._init(),t.gaugeLabel=(this._gaugeLabel=new Ir(this.chart))._init()}get face(){return this._face}get rim(){return this._rim}get hourHand(){return this._hourHand}get minuteHand(){return this._minuteHand}get secondHand(){return this._secondHand}get tick(){return this._tick}get tickLabel(){return this._tickLabel}get pin(){return this._pin}get gaugeLabel(){return this._gaugeLabel}getExtents(t,e){const s=p(t,e);return{cx:W(this._centerXDim,t,t/2),cy:W(this._centerYDim,e,e/3),rd:W(this._radiusDim,s,s/2)}}_createPoint(t){return new Nr(t)}_doApply(t){const e=this;super._doApply(t),function(t,s,i){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=Y(w(e._centerX=t,Tr.DEF_CENTER),!0)),e._centerYDim&&s===e._centerY||(e._centerYDim=Y(w(e._centerY=s,Tr.DEF_CENTER),!0)),e._radiusDim&&i===e._radius||(e._radiusDim=Y(w(e._radius=i,Tr.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}Tr.DEF_CENTER="50%",Tr.DEF_RADIUS="50%",Tr.type="clock",Tr.defaults=ze(As.defaults,{centerX:Tr.DEF_CENTER,centerY:Tr.DEF_CENTER,radius:Tr.DEF_RADIUS,active:!0,size:70});class Er extends ms{_readObject(t,e){super._readObject(t,e),this.center=e.center,this.value=e.value}}class Vr extends cs{}Vr.defaults=ze(cs.defaults,{hoverColor:"white"});class Dr extends fs{get areaCount(){return this._map.areaCount}get detail(){return this._detail}get color(){return this._colorObj}getValueRange(){return{min:this._minValue,max:this._maxValue}}_createLabel(t){return new Vr(t)}_doApply(t){i(t.detail)?this._detail||(this._detail=new Dr(this.chart)):t.hasOwnProperty("detail")&&(this._detail=null),super._doApply(t)}needMapScale(){return!0}getRangedColor(t){var e;if(!isNaN(t.value)){const s=this._colorRanger||(null===(e=this.chart.getColorScale(this._op.colorScale))||void 0===e?void 0:e.getRanger());return null==s?void 0:s.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}}followTooltipPointer(){return!0}getLegendSources(t){return this._points.count>0&&super.getLegendSources(t)}_createPoint(t){return new Er(t)}_prepareRender(){super._prepareRender()}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op,s=this._visPoints,{min:r,max:o}=this._calcMinMax(s);if(this._minValue=r,this._maxValue=o,i(e.colorRange)){const t=f(e.colorRange);isNaN(t.minValue)&&(t.minValue=r),isNaN(t.maxValue)&&(t.maxValue=o),this._colorRanger=new Os(t)}else this._colorRanger=null}_doLoadPoints(t){this._useMapData&&(t=this._map._internalAreas().map(t=>({id:t.id,name:t.name}))),super._doLoadPoints(t),this._map}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ae(this._calcedColor),this._color=this._colorObj?this._colorObj.toString():null}getColorScale(){return this._op.colorScale}}Dr.type="feature",Dr.defaults=ze(fs.defaults,{selectable:!1,detailZoom:250});class Rr extends bs{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class $r extends fs{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new cs(this.chart))._init()}getFigure(t){return t.figure||this.options.figure}get innerLabel(){return this._innerLabel}_doApply(t){super._doApply(t)}_createPoint(t){return new Rr(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}}$r.type="figure",$r.defaults=ze(fs.defaults,{position:"top"});class Or extends cs{}Or.defaults=ze(cs.defaults,{visible:!1});class Fr extends is{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class Br extends ps{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Or(t)}_createPoint(t){return new Fr(t)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._root=this._op.rootUrl||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}}Br.type="image",Br.defaults=ze(ps.defaults,{imageWidth:24,imageHeight:24,position:"top"});class zr extends Vt{constructor(t,e){super(t,hs),this.add(this._area=new $t(t)),this._area.setStyle("opacity","0.2"),this.add(this._line=new $t(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],s=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(s.join(" "))}}class jr extends Cs{}class Hr extends He{}Hr.defaults=ze(Ss.defaults,{visible:!1});class Gr extends Ss{_doInit(t){super._doInit(t),t.area=(this._area=new Hr(this.chart))._init()}get area(){return this._area}_createPoint(t){return new jr(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new zr(t,e)}}Gr.type="line",Gr.defaults=ze(Ss.defaults,{});class Yr extends ms{_readObject(t,e){super._readObject(t,e),this.center=e.center}getLabel(t){var e;return this.name||(null===(e=this.area)||void 0===e?void 0:e.name)}getParam(t){return this.area?w(super.getParam(t),this.area.source.props[t]):super.getParam(t)}}class Wr extends cs{}Wr.defaults=ze(cs.defaults,{visible:!1,hoverColor:"white"});class Zr extends He{}Zr.defaults=ze(He.defaults,{enabled:!0,autoMapChange:!0});class Ur extends fs{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new Zr(this.chart))._init()}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get color(){return this._colorObj}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t,e){return(t?this._map.sibling:this._map).get(e)}pointOf(t){return this._areaPts.get(t.id)}pointByProp(t,e){var s;const i=this._points.getPoints();for(const r of i)if((null===(s=r.area)||void 0===s?void 0:s.source.props[t])===e)return r}getBounds(t){}getCenter(t){return t instanceof Yr||(t=this.pointById(t)),t.center||t.area.getCenter()}getValueRange(){return{min:this._minValue,max:this._maxValue}}getDetailed(){return this._detailed?this._detail:this}showDetail(){this._detail&&!this._detailed&&(this._detailed=!0,this._detail.show(!0,!0),this.hide(!0))}showParent(){this._parent&&this._parent._detail===this&&(this.hide(!0),this._parent._detailed=!1,this._parent.show(!0,!0))}_createLabel(t){return new Wr(t)}$_createDetail(){return this._detail||(this._detail=new Ur(this.chart),this._detail._init(),this._detail._parent=this),this._detail}_doLoad(t,e){super._doLoad(t,e),i(e.detail)&&this.$_createDetail()._load(e.detail)}_doApply(t){this.getDetailed()||(i(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t)}needMapScale(){return!0}getRangedColor(t){var e;if(!isNaN(t.value)){const s=this._colorRanger||(null===(e=this.chart.getColorScale(this._op.colorScale))||void 0===e?void 0:e.getRanger());return null==s?void 0:s.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}}followTooltipPointer(){return!0}getLegendSources(t){return this._points.count>0&&super.getLegendSources(t)}_createPoint(t){return new Yr(t)}_getPointCallbackArgs(t,e){return super._getPointCallbackArgs(t,e),t.area=e.area,t}_prepareRender(){this._op.useMapData!=this._useMapData&&(this._useMapData=this._op.useMapData,this._dataSourceDirty=!0),super._prepareRender()}_doPrepareRender(t){super._doPrepareRender(t);const e=this._op,s=this._visPoints,{min:r,max:o}=this._calcMinMax(s);if(this._minValue=r,this._maxValue=o,i(e.colorRange)){const t=f(e.colorRange);isNaN(t.minValue)&&(t.minValue=r),isNaN(t.maxValue)&&(t.maxValue=o),this._colorRanger=new Os(t)}else this._colorRanger=null}_doLoadPoints(t){const e=this._map;if(this._useMapData&&e&&(t=e._internalAreas().map(t=>({id:t.id,name:t.name}))),super._doLoadPoints(t),e){const t=this._op.mapKeys,s=(r(t)?t[0]:t)||"id",i=(r(t)?t[1]:t)||"id",o=e.getAreaMap(s),n=this._areaPts;n.clear(),this._points.forEach(t=>{t.area="id"===i?o[t[i]]:o[t.source[i]],t.area&&n.set(t.area.id,t)})}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ae(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}}Ur.type="map",Ur.defaults=ze(fs.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250});class Xr extends cs{}Xr.defaults=ze(cs.defaults,{visible:!1});class Kr extends ms{}class qr extends He{constructor(t){super(t.chart),this.series=t,this._domain={callback:(t,e)=>this._point.getParam(e)}}getTextDomain(t){return this._point=t,this._domain}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new Fe),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,s,i){this._richTextImpl&&this._richTextImpl.build(t,e,s,void 0,i)}}qr.defaults=ze(He.defaults,{});class Jr extends qr{getMinSize(t){return W(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}Jr.defaults=ze(qr.defaults,{text:"${name}"});class Qr extends qr{}Qr.defaults=ze(qr.defaults,{text:"${value}"});class to extends fs{_doInit(t){super._doInit(t),t.header=(this._header=new Jr(this))._init(),t.divider=(this._divider=new He(this.chart))._init(),t.body=(this._body=new Qr(this))._init()}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:b(this._width,dt.clampEx(t,this._minWidth,this._maxWidth)),height:b(this._height,dt.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new Xr(t)}_createPoint(t){return new Kr(t)}pointLabelCount(){return 0}legendMarker(t,e){return super.legendMarker(t,e)}_doApply(t){super._doApply(t),this._vertical="horizontal"!==t.orientation,this._minWidth=+t.minWidth,this._minHeight=+t.minHeight}}to.DEF_MIN_WIDTH=80,to.DEF_MIN_HEIGHT=50,to.type="panel",to.defaults=ze(fs.defaults,{orientation:"vertical",minWidth:to.DEF_MIN_WIDTH,minHeight:to.DEF_MIN_HEIGHT,position:"top"});class eo extends ws{}class so extends vs{getRadius(t){return b(W(this._radiusDim,t),30)}_createPoint(t){return new eo(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius")}_doPrepareRender(t){super._doPrepareRender(t);let e=b(this._op.startAngle%360,0),s=g(0,p(360,b(this._op.totalAngle,360)));this._startRad=N+T*e,this._totalRad=T*s}}so.type="pie",so.defaults=ze(vs.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByValue:!0});class io extends $t{constructor(t,e){super(t,hs),this._rd=e,this.setPath(Ct.pin({cx:0,cy:2*-e,rd:e,innerRd:0})),this.transY(3*-e)}trans(t,e){return e+=3*this._rd,super.trans(t,e)}}class ro extends bs{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class oo extends ys{getExt(t,e){const s=b(t.radius,this._rd)*e;return{cx:0,cy:2*-s,rd:s,innerRd:s*this._innerRd}}_doApply(t){super._doApply(t),this._rd=b(t.radius,oo.DEF_RADIUS),this._innerRd=b(t.innerRadius,0)}_createPoint(t){return new ro(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new io(t,e/2)}}oo.DEF_RADIUS=9,oo.type="pin",oo.defaults=ze(ys.defaults,{radius:oo.DEF_RADIUS,innerRadius:0,position:"top"});class no extends Vt{constructor(t,e){super(t,hs),this._size=e,this.add(this._marker=new $t(t)),this.setShape("circle",12)}setShape(t,e){t===this._shape&&e===this._size||(this._shape=t,this._size=e,this._renderShape(e))}setColor(t){return this.dom.style.fill=t,this}_renderShape(t){const e=Math.max(4,t/2);Ct.setShape(this._marker,this._shape,e,e)}}class ao extends bs{_readObject(t,e){super._readObject(t,e)}}class ho extends ys{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(t){return this._op.shape||this._shape}getRadius(){return b(this._op.radius,ho.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.setStyle("stroke",this._stroke),t.setStyle("stroke-width",this._strokeWidth))}_createPoint(t){return new ao(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._stroke=t.stroke,this._strokeWidth=t.strokeWidth}_createLegendMarker(t,e){return new no(t,e)}legendMarker(t,e){const s=super.legendMarker(t,e);return s.setShape(this.getShape(null),p(e,2*this._op.radius)),s}}ho.type="point",ho.defaults=ze(ys.defaults,{radius:5,position:"center"});class lo extends Vt{constructor(t,e){super(t,hs),this.add(this._line=new $t(t)),this.add(this._arrow=new $t(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],s=e[e.length-2],i=e[e.length-1],r=$(Math.atan2(i[1]-s[1],i[0]-s[0]))-90,o="M "+e.map(t=>`${t[0]},${t[1]}`).join(" L");this._line.setPath(o),this._arrow.setPath(`M ${i[0]} ${i[1]} L ${i[0]-4} ${i[1]-6} L ${i[0]+4} ${i[1]-6} Z`),this._arrow.setRotation(i[0],i[1],r)}}class co extends is{get lon1(){return this.coords[0][0]}get lat1(){return this.coords[0][1]}get lon2(){return this.coords[1][0]}get lat2(){return this.coords[1][1]}_assignTo(t){return l(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var s;const i=function(t){let e=[];return r(t)?t.forEach(t=>{r(t)?e=e.concat(i(t)):e.push(t)}):n(t)&&e.push(t),e};super._readObject(t,e),this.name=e.name,this.coords=null!==(s=e.coords)&&void 0!==s?s:e.coord,this.path=null!=e.path?i(e.path):void 0}}class _o extends ps{needMapScale(){return!0}needRemoveAnimation(){return!0}_createPoint(t){return new co(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(r(t)){const e=this.chart.body._points;i(e)&&(t=t.map(t=>{const s=l({},t);if(r(s.coords)){const t=s.coords.slice();n(t[0])&&(t[0]=e[t[0]]),n(t[1])&&(t[1]=e[t[1]]),s.coords=t}return s}))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new lo(t,e)}}_o.type=Je,_o.defaults=ze(ps.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class uo extends bs{_readObject(t,e){super._readObject(t,e),this.length=t._lengthFielder(e),this.angle=t._angleFielder(e)}}class po extends ys{_createFielders(t){super._createFielders(t),this._lengthFielder=this._createFielder(t.lengthField||"length"),this._angleFielder=this._createFielder(t.angleField||"angle")}_createPoint(t){return new uo(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){}legendMarker(t,e){}}po.type="vector",po.defaults=ze(ys.defaults,{headType:"openArrow",lengthField:"length",angleField:"angle",startAngle:0});class go extends ws{}class mo extends vs{getPointGrid(t,e,s){const i=this._runGrid=[],r=this.$_caculate(t,e,s),o={rowCount:this._rowCount,colCount:this._colCount,grid:i,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(o);else this.$_fillColFirst(o);return{grid:i,count:r,rows:o.rows,cols:o.cols}}_createPoint(t){return new go(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||mo.ROW_COUNT,this._colCount=t.colCount||mo.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||mo.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||mo.CELL_SIZE,this._gap=b(t.gap,mo.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t){super._doPrepareRender(t),this._visPoints.forEach(t=>{t._sum=r(t.values)?t.values.reduce((t,e)=>t+e):0})}$_caculate(t,e,s){const i=(Math.max(e.min,t._sum*b(s,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(i);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,s=e.length;for(let i=0;i<s;i++)if(isNaN(e[i][t]))return i;return s}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:s,colCount:i}=t,r=Math.min(this._threshold,this._colCount-1);let o=0,n=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,o=Math.max(o,a),n=Math.max(n,h),a==s-1?(h++,a=this.$_rows(h)):h===i-1||this.$_cols(a)>this.$_cols(a+1)+r?(a++,h=this.$_cols(a)):(h++,a=this.$_rows(h)),l++}t.rows=o,t.cols=n}$_fillColFirst(t){const{grid:e,rowCount:s,colCount:i}=t,r=Math.min(this._threshold,this._rowCount-1);let o=0,n=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,o=Math.max(o,a),n=Math.max(n,h),h==i-1?(a++,h=this.$_cols(a)):a===s-1||this.$_rows(h)>this.$_rows(h+1)+r?(h++,a=this.$_rows(h)):(a++,h=this.$_cols(a)),l++}t.rows=o,t.cols=n}}mo.ROW_COUNT=10,mo.COL_COUNT=10,mo.THRESHOLD=1,mo.CELL_SIZE=5,mo.GAP=2,mo.type="waffle",mo.defaults=ze(vs.defaults,{rowCount:mo.ROW_COUNT,colCount:mo.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:mo.THRESHOLD,cellSize:mo.CELL_SIZE,gap:mo.GAP});class fo extends Mi{static loadMap(t){return i(t)&&i(t.source)&&r(t.source.features)||i(t)&&i(t.map)&&r(t.map.features)?new fo(t):void 0}_doLoad(t){const e=t.features,s=[];return e.forEach(t=>{if("Feature"===t.type&&t.geometry){const e=new Li(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,s.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,s.push(e)}}}),s}}class bo extends Mi{static loadMap(t){if(i(t)){const e=t.source;if(i(e)&&"Topology"===e.type&&i(e.objects)&&r(e.arcs))return new bo(t);const s=t.map;if(i(s)&&"Topology"===s.type&&i(s.objects)&&r(s.arcs))return new bo(t)}}_doLoad(t){const e=t=>t.map(t=>t.map(t=>t<0?a[~t].slice().reverse():a[t]).flat()),s=t.objects,o=t.arcs,n=t.transform,a=[],h=[];if(i(n)){const t=n.scale[0],e=n.scale[1],s=n.translate[0],i=n.translate[1];o.forEach(r=>{let o=0,n=0;const h=r.map(r=>((r=r.slice())[0]=(o+=r[0])*t+s,r[1]=(n+=r[1])*e+i,r));a.push(h)})}else o.forEach(t=>{a.push(t.slice())});for(const t in s)if("GeometryCollection"===s[t].type){const i=s[t].geometries;r(i)&&i.forEach(t=>{const s=new Li(t.id,t.properties);switch(t.type){case"Polygon":s.polygon=e(t.arcs),h.push(s);break;case"MultiPolygon":s.polygons=t.arcs.map(t=>e(t)),h.push(s)}})}return h}}class yo extends mt{constructor(t,e,s,i){super(),this.view=t,this.zoom=e,this.duration=b(s,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==i||i()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class wo extends mt{constructor(t,e,s,i,r){super(),this.view=t,this.zoom=e,this.coords=s,this.duration=b(i,300),this._old=t.zoom,this.view.$_moveTo(s),this.endHandler=()=>{this.view.zoom=e,this.view=null,null==r||r()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class xo extends He{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}xo.defaults=ze(ps.defaults,{visible:void 0,globeFill:"lightblue"});const vo={zoom:1,panX:1,panY:1};class Co extends He{constructor(t){super(t),this._prj=(new Xi).prepareSecond(),this._zoom=1,this._panX=0,this._panY=0,this._scale=1,this._vRect=pt.create(0),this._wMap=null,this._reCalculateFlag=!0,this._dragDistance=0,this._annotations=new qe(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new xo(this.chart))._init()}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get rotationX(){return this._prj instanceof Ni?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Ni?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){var t;return null!==(t=this._op.scroll)&&void 0!==t?t:0}set scroll(t){this.updateOption("scroll",t)}get panX(){return this._panX}set panX(t){this.updateOption("panX",t)}get panY(){return this._panY}set panY(t){this.updateOption("panY",t)}get zoom(){return this._op.zoom}set zoom(t){t=Math.max(100,t),this.updateOption("zoom",t)}get isZoomed(){return this.zoom>100}get scale(){return this._scale}get center(){const t=[this._map.cx,this._map.cy];return this._prj?this._prj.backward(t):t}get map(){return this._map}set dragDistance(t){this._dragDistance=t}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}prepareLayout(t,e){var s;const i=function(t,e,s){const i=Math.max(0,(e-t)/2);return Math.max(-i,Math.min(s,i))},r=this._prj,o=this._map=this.chart.map;let{x1:n,x2:a,y1:h,y2:l}=o;if(this._reCalculateFlag){const{x1:t,x2:e,w:s}=this.$_calcWMap();this._wMap=s,this._reCalculateFlag=!1}const c=this._wMap,d=l-h,_=this._wRate=t/c,u=this._hRate=e/d,p=this._zoom/100,g=this._scale=p*Math.min(_,u),m=b(this._op.panX*g,0),f=b(this._op.panY*g,0),y=i(t,c*g,m)/g;this.isScrollable()||(this._panX=y),this._panY=i(e,d*g,f)/g;const w=(this.scroll%360+360)%360*(c/360),x=t/2-(n+c/2)*g-(this._panX+w)*g,v=e/2+(h+d/2)*g-this._panY*g,C=_/g*c,S=u/g*d,L=n+c/2-C/2+this._panX,A=h+d/2-S/2-this._panY;return r&&(r.scroll=null!==(s=this._op.scroll)&&void 0!==s?s:0),this._vRect=pt.create(L,A,C,S),{scale:g,wMap:c,hMap:d,tx:x,ty:v}}$_calcWMap(){var t;const e=new this._prj.constructor;e.offset=this._prj.offset;const s=this._map;let i=1/0,r=-1/0;if(e instanceof Ni||![sr].some(t=>e instanceof t)){const{x1:t,x2:e}=s;return{x1:t,x2:e,w:e-t}}const o=(t,s=[0,0])=>{t[0].forEach(t=>{const o=e.project([t[0]+s[0],t[1]+s[1]]);i=Math.min(i,o[0]),r=Math.max(r,o[0])})};for(let e=0;e<s.areaCount;e++){const i=s.get(e),{polygon:r,polygons:n}=i.source;n?n.forEach(t=>{var e;return o(t,null===(e=i.inset)||void 0===e?void 0:e.offset)}):o(r,null===(t=i.inset)||void 0===t?void 0:t.offset)}return{x1:i,x2:r,w:r-i}}getPoint(t){return this._points[t]}isVisible(t){return this._vRect.contains(t[0],t[1])&&!this._prj.project(t).outside}isWorldMap(){return this.map.isWorldMap()}isScrollable(){return this.options.scrollable&&this.map.isWorldMap()}setZoom(t,e=300){let s,r;a(e)?r=e:o(e)?(s=e,r=300):i(e)&&(s=e.end,r=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),r>0?new yo(this,t,r,s).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}_canSetZoom(t){return t>100}zoomTo(t,e,s=300){new wo(this,t,e,s,null).start()}zoomToArea(t,e=.8,s=300,i){const r={...St,...i},o=this.map.areaOf(t),n=o.getCenter(),{x1:a,x2:h,y1:l,y2:c}=o.mainLandBounds,d=(this.map.x2-this.map.x1)*e/(h-a)*100,_=(this.map.y2-this.map.y1)*e/(c-l)*100,u=Math.min(d,_),p=Math.min(r.maximumZoom,Math.max(r.minimumZoom,u));new wo(this,p,n,s,null).start()}zoomToBounds(t,e,s=300){const i=Math.abs(e[0]-t[0]),r=Math.abs(e[1]-t[1]),o=[(t[0]+e[0])/2,(t[1]+e[1])/2];try{const t=Math.abs(this.map.x2-this.map.x1)/i*100,e=Math.abs(this.map.y2-this.map.y1)/r*100,n=Math.min(t,e);new wo(this,n,o,s,null).start()}catch(t){console.error(t)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this._map,[s,i]=this._prj.project(t);this.isScrollable()?this.scroll=t[0]:this.panX=s-e.cx,this.panY=-i+e.cy}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,s){const i=t in vo;i&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,s)}finally{i&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let s=!0;for(const e in t)if(!(e in vo)){s=!1;break}s&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{s&&this.chart.freeOptionsDirty()}return this}_doApply(t){var e,o,a;const h=this;var l;super._doApply(t),s.call(t,"annotations")&&(l=t.annotations)!==h._anns&&(h._anns=l,h._annotations.load(l,!0));const c=this._zoom;let d=function(t){if(t!==h._projection){switch(h._projection=t,h._projection.toLowerCase()){case"orthographic":h.scroll=0,h.panX=0,h.panY=0,h._prj=new Ni;break;case"equalearth":h._prj=(new sr).prepareSecond();break;case"miller":h._prj=(new lr).prepareSecond();break;case"mercator":h._prj=(new or).prepareSecond();break;default:h._prj=(new Xi).prepareSecond()}return h._reCalculateFlag=!0,!0}}(t.projection);const _=this._prj;if(_&&(this.scroll!==_.scroll||d)){_.scroll=this.scroll,d=!0;const t=null===(e=this.chart)||void 0===e?void 0:e.firstMapSeries;t&&t.setOptionsDirty(!0)}_ instanceof Ni&&(d=_.setRotation(t.rotationX,t.rotationY)||d),function(t){void 0!==t&&(h._zoom=Math.max(100,b(t,100)))}(t.zoom);const u=this._points={};r(t.points)&&t.points.forEach(t=>{r(t)&&t.length>=3&&n(t[0])?u[t[0]]=[t[1],t[2]]:i(t)&&n(t.id)&&(u[t.id]=r(t.coord)?t.coord.slice():[t.lon,t.lat])}),this.chart._loading||(d&&this.chart.projectionChanged(),this._zoom!==c&&(this.chart.zoomChanged(c),null===(a=(o=this._op).onZoomChanged)||void 0===a||a.call(o,{zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}Co.defaults=ze(He.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:4});class So extends He{getAlign(t){this._op.align}}So.defaults=ze(He.defaults,{text:"RealMap v1.0.5",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});class Lo extends Ur{}class Ao extends He{}Ao.defaults=ze(He.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default"});class Mo extends yt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._point_shaes=wt.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new te,this._series=new gs(this),this._annotations=new qe(this),this._colorScales=new Us(this),this._bubbleScales=new Ds(this),(this._chartOptions=new Ao(this))._init(),(this._axis=new hi(this))._init(),(this._body=new Co(this))._init(),(this._exporter=new Xs(this))._init(),(this._title=new Hi(this))._init(),(this._subtitle=new Gi(this))._init(),(this._legend=new $s(this))._init(),(this._zoomPanel=new Bi(this))._init(),(this._drilldownPanel=new zi(this))._init(),(this._mapScale=new Oi(this))._init(),(this._credits=new So(this))._init(),(this._tooltip=new Yi(this))._init(),this.options=Object.assign({},Mo.defaults),i(t)?this._load(t):this._initOptions(),this._selection=new ji(this)}_initOptions(){}get isGlobe(){return this.getProjection(!1).isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find(e=>e._type()===t)}_getSeriesType(t){return n(t)&&ls[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&Xe[t.toLowerCase()]}_modelChanged(){this._fireEvent("onModelChanged")}_optionChanged(t,e){this._optionsLock||(this._optionsDirty=!0),this._fireEvent("onModelChanged",t,e)}animatable(){return!0}loadAnimatable(){return this._loadAnimatable}isVisible(t){return t&&this.getProjection(!1).isVisible(t)}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var s,i;this._fireEvent("onModelChanged",t,"selection"),null===(i=(s=this._chartOptions.options).onSelectionChanged)||void 0===i||i.call(s,{chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(t){const e=this._body._prj;return e?t&&e.second||e:(new Xi).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this._fireEvent("onProjectionChanged",this,this.body._prj)}zoomChanged(t){this._fireEvent("onZoomChanged",this,t)}mapChanged(t){this._fireEvent("onMapChanged",this,t)}anchorByName(t){throw new Error("Method not implemented.")}get chart(){return this}getTooltipContext(t,e,s){return e}selectionChanged(t){this._modelChanged()}selectionItemAdded(t){}selectionItemRemoved(t){}selectionCleared(){}get type(){return this.options.type}get chartOptions(){return this._chartOptions}get legend(){return this._legend}get credits(){return this._credits}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,s=(t instanceof Ri?t:this.getMap(t))||this._maps[0];s!==e&&(this._baseMap=s,this._loading||(this._baseMap.reset(),this.mapChanged(s)))}get axis(){return this._axis}get body(){return this._body}get visibleSeries(){return this._series.visibles}get firstVisible(){return this._series.firstVisible}get firstMapSeries(){return this._series.visibles.find(t=>t instanceof Ur)}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof Ur&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}requestRender(t){this._fireEvent("onRequestRender",t)}mapByName(t){return this._maps.find(e=>e&&e.name===t)}mapAt(t){return this._maps[t]}getMap(t){return n(t)?this.mapByName(t):this.mapAt(+t)}seriesByName(t){return this._series.getSeries(t)}seriesByType(t){return this._series.seriesByType(t)}seriesAt(t){return this._series.get(t)}seriesByPoint(t){return this._series.seriesByPoint(t)}annotationByName(t){return this._annotations.getAnnotation(t)||this._body.getAnnotation(t)}loadBase(t,e,s){const r=this._bases[e];let o;return i(r.base)&&je(o={},r.base),i(r[s])&&(o||(o={}),je(o,r[s])),o?je(o,t):t}_setProperties(t,e=!0){const s=this.options;for(const e in Mo.defaults)t.hasOwnProperty(e)&&(s[e]=t[e])}_load(t){const e=this.options;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(w(t.asset,t.assets)),e.chart=this._chartOptions._load(t.chart),e.body=this._body._load(t.body);const s=r(t.map)?t.map:i(t.map)?[t.map]:null;return r(s)&&(s.forEach((t,e)=>{if(!1!==t.enabled){const s=bo.loadMap(t)||fo.loadMap(t),i=s&&new Ri(this,s,e);i.isWorldMap()&&i._prepareSecond(),this._maps.push(i)}}),this.setBaseMap(void 0)),e.axis=this._axis._load(t.axis),e.title=this._title._load(t.title),e.subtitle=this._subtitle._load(t.subtitle),e.legend=this._legend._load(t.legend),e.zoomPanel=this._zoomPanel._load(t.zoomPanel),e.drilldownPanel=this._drilldownPanel._load(t.drilldownPanel),e.credits=this._credits._load(t.credits),e.tooltip=this._tooltip._load(t.tooltip),this._seriesIndex=0,this._series.load(t.series,Lo),this._series.get(0)instanceof Ur||!1===e.chart.alwaysMap||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._colorScales.load(t.colorScales||t.colorScale),this._bubbleScales.load(t.bubbleScale||t.bubbleScale),this._mapScale._load(t.mapScale),e.exporting=this._exporter._load(t.exporting),this._loading=!1,this}$_loadTemplates(t){const e=this._bases={axis:{},series:{},gauge:{},annotation:{}};if(i(t)){const s=this._templates={};for(const e in t){const r=t[e];i(r)&&(s[e]=l({},r))}["@series","@annotation"].forEach(s=>{t.hasOwnProperty(s)&&i(t[s])&&(e[s.substring(1)]=t[s])}),this.assignTemplates=t=>{const e=t.template;if(n(e)){let s=this._templates[e];if(s)return je(je({},s),t)}else r(e)&&e.forEach(e=>{let s=this._templates[e];return s?je(je({},s),t):s});return t}}else this.assignTemplates=void 0}prepareRender(){this._series._prepareRender(this._optionsDirty),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legend._prepareRender(),this._body._prepareRender(),this._annotations.prepareRender()}afterRender(){this._series._afterRender(),this._optionsDirty=this._dataDirty=!1}update(t,e){if(i(t)){this._setProperties(t,!1);for(const e in t){const s=this[e];(s instanceof He||s instanceof Ge||s instanceof te)&&s.updateOptions(t[e],!1)}e&&this._optionChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(){return this._series.getLegendSources().concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,s){return s&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const s=this._series.add(t);return s&&this._optionChanged(s),s}removeSeries(t,e){const s=this._series.remove(t);if(s)return this._optionChanged(null),s}_dataChanged(){this._dataDirty=!0}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.first}getBubbleScale(t){return null===t?null:this._bubbleScales.first}async drilldown(t,e){if(!(t instanceof Ur&&t.detail))return;const s=t.drilldown,i=t.detail;if(!s.options.enabled)return;i.options.dataUrl&&(i.updateOption("data",await fetch(i.options.dataUrl).then(t=>t.json())),delete i.options.dataUrl);const r=t.map,o=this.getMap(i.options.map)||r;s.options.autoMapChange&&o!==r&&this.setBaseMap(o),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof Ur&&t.parent))return;const e=t.drilldown;if(!e.options.enabled)return;const s=t.parent,i=this.map;e.options.autoMapChange&&s.map!==i&&this.setBaseMap(s.map),t.showParent(),this._body.zoom=100}_visibleChanged(t){}_hoverAreaChanged(t,e,s){var i,r;null===(r=(i=this._body.options).onHoverArea)||void 0===r||r.call(i,{area:null==e?void 0:e.getInfo(),oldArea:null==s?void 0:s.getInfo()})}_areaClicked(t,e){var s,i;null===(i=(s=this._body.options).onClickArea)||void 0===i||i.call(s,{area:null==e?void 0:e.getInfo()})}}Mo.defaults={type:"map",startOfWeek:0},ps.register(Ur,Dr,ho,oo,po,dr,so,$r,Is,_o,Br,Gr,to,mo,xr,Tr),Ke.register(Wi,Zi,Ui);const ko="$ctrl";class Po{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Mo(t,this),null==e||e(this._obj,null)}get options(){return this._obj.options}get type(){return this._obj.type}get body(){return this._obj.body}get assets(){return this._obj._assets}get map(){return this._obj.map}get title(){return this._obj._title}get subtitle(){return this._obj._subtitle}get series(){return this._obj.firstVisible}get firstMapSeries(){return this._obj.firstMapSeries}get legend(){return this._obj._legend}get credits(){return this._obj._credits}get colorScale(){return this._obj.colorScale}get bubbleScale(){return this._obj.bubbleScale}get zoomPanel(){return this._obj._zoomPanel}get drilldownPanel(){return this._obj._drilldownPanel}get tooltip(){return this._obj._tooltip}get selection(){return this._obj.selection}get exporter(){return this._obj._exporter}setBaseMap(t){this._obj.setBaseMap(t)}getMap(t){return n(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return n(t)?this._obj.seriesByName(t):this._obj.seriesAt(t)}seriesByType(t){return this._obj.seriesByType(t)}getAnnotation(t){return this._obj.annotationByName(t)}load(t,e=!1,s){var r;if(i(t)){const i="load chart ";dt.LOGGING&&console.time(i);let o=this._obj,n=o;this._loaded?(o.destroy(),n=this._obj=new Mo):(this._loaded=!0,o=null),n._load(t),n._loadAnimatable=e,this._loadCallback=s,dt.log("chart-items:",Be),dt.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,n,o)}return this}async loadAsync(t,e=!1,s){var r,o,n;if(!i(t))return this;null===(r=this[ko])||void 0===r||r.showLoadingView();const a="load chart ";dt.LOGGING&&console.time(a),await S.loadConfigAsync(t);let h=this._obj,l=h;return this._loaded?(h.destroy(),l=this._obj=new Mo):(this._loaded=!0,h=null),l._load(t),l._loadAnimatable=e,this._loadCallback=s,dt.log("chart-items:",Be),dt.LOGGING&&console.timeEnd(a),null===(o=this._modelCallback)||void 0===o||o.call(this,l,h),null===(n=this[ko])||void 0===n||n.hideLoadingView(),this}updateOptions(t,e=!0){this._obj.update(t,e)}export(t){this._obj.export(t)}render(t=!0){this._obj.requestRender(t)}setParam(t,e,s){}addSeries(t,e=!0){return this._obj.addSeries(t,e)}removeSeries(t,e=!0){this._obj.removeSeries(t,e)}getPoint(t){return this._obj.body.getPoint(t)}seriesAt(t){return this._obj.seriesAt(t)}seriesByName(t){return this._obj.seriesByName(t)}async drilldown(t,e){const s=t instanceof Ur?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;s instanceof Ur&&this._obj.drilldown(s,e)}async drillup(t){const e=t instanceof Ur?t:(a(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof Ur&&this._obj.drillup(e)}}class Io extends Vt{constructor(t,e,s){super(t,s,"image"),this._dirty=!0,this._bounds=_t,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},e&&this.setAttr("preserveAspectRatio","xMidYMid slice"),this.dom.onload=()=>{this._dirty=!0,this.invalidate()}}get url(){return this.getAttr("href")}set url(t){t!==this.url&&(this._dirty=!0,t?this.setAttr("href",t):this.unsetAttr("href"))}setImage(t,e,s){return!!t&&(this.url=t,this.resize(e,s)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class No extends Vt{constructor(t,e){super(t,No.STYLE),this._spinnerWrapper=new Vt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new Io(t,!0,"rm-loading-spinner")),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=No.LOADING_SPINNER,this._spinner.width=No.SPINNER_LENGTH,this._spinner.height=No.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-No.SPINNER_LENGTH/2,t.height/2-No.SPINNER_LENGTH/2)}}No.STYLE="rm-loading-indicator",No.BACK_STYLE="rm-loading-background",No.SPINNER_LENGTH=64,No.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class To{constructor(t){this._draggable=!0,this._touches=[],this._tapped=0,this._firstTime=0,this._secondTime=0,this._distance=0,this._pinching=!1,this._control=t}get control(){return this._control}get dragTracker(){return this._dragTracker}setDragTracker(t){t!=this._dragTracker&&(this._dragTracker&&this._dragTracker.cancel(),this._dragTracker=t)}get dragging(){return this._dragTracker&&this._dragTracker.dragging}touchX(){return this._touchX}touchY(){return this._touchY}pointerDown(t){let e;return e=this.$_pointerToPoint(t),this._prevX=e.x,this._prevY=e.y,this._doPointerDown(t)}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_doDrag(t,e,s,i){if(!this.$_drag(e,this._prevX,this._prevY,s,i))return this.$_stopDragTracker(e,s,i,!0),this._stopEvent(t),!0}$_startMove(t,e,s,i){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._prevX,this._prevY,s,i)&&(this._clearTouchEffects(),s!==this._prevX||i!==this._prevY?this.$_doDrag(t,e,s,i):this._stopEvent(t))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,s=this.dragging,{x:i,y:r}=this.$_pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(i<0||i>=this._control.dom().offsetWidth||r<0||r>=this._control.dom().offsetHeight?s&&this.$_stopDragTracker(e,i,r,!0):s?this.$_doDrag(t,e,i,r):(!this._dragTracker&&Math.abs(this._prevX-i)>3||Math.abs(this._prevY-r)>3||this._dragTracker&&!s)&&this.$_startMove(t,e,i,r),this._prevX=i,this._prevY=r,this._touches.push({x:i,y:r,t:t.timeStamp})):s&&this.$_stopDragTracker(e,i,r,!0),this.dragging&&this._stopEvent(t),this._doPointerMove(i,r,t)}pointerUp(t){if(this._pinching)return;const e=t.target,{x:s,y:i}=this.$_pointerToPoint(t);this.$_stopDragTracker(e,s,i)}pointerCancel(t){const e=t.target,{x:s,y:i}=this.$_pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,s,i,!0),clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerCancel(t)}pointerLeave(t){clearTimeout(this._longTimer),this._clearTouchEffects(),this._doPointerLeave(t)}touchStart(t){if(this._pinching=!1,t.touches.length>=2){const e=t.target;this._isPinchTarget(e)&&(this._pinching=!0,this._distance=this.$_getDistance(t.touches[0],t.touches[1])),t.cancelable&&t.preventDefault()}else this._doTouchStart(t,t.target)}touchMove(t){if(t.preventDefault(),t.touches.length>=2&&this._pinching){if(this._pinching){const e=this.$_getDistance(t.touches[0],t.touches[1]);this._doPinch(e-this._distance),this._distance=e}return!0}return t.target instanceof HTMLTextAreaElement||this._doTouchMove(t,t.target)}_isPinchTarget(t){}_doPinch(t){}touchEnd(t){this._pinching?this._distance=0:this._doTouchEnd(t,t.target)}click(t){this._doClick(t)}dblClick(t){this._doDblClick(t)}keyPress(t){this._doKeyPress(t)}wheel(t){this._doWheel(t)&&this._stopEvent(t)}requestDrag(t){const e=this.getTrackerFromRequest(t);e&&this.setDragTracker(e)}getTrackerFromRequest(t){}_setDraggable(t){this._draggable=t}_doClick(t){}_doDblClick(t){}_doPointerDown(t){return!0}_doPointerMove(t,e,s){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,s){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,s,i,r){return!1}_getDragTracker(t,e,s){return null}$_startDrag(t,e,s,i,r){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,i-e,r-s)),!!this._dragTracker&&this._dragTracker.start(t,e,s,i,r)}$_drag(t,e,s,i,r){return this._dragTracker.drag(t,e,s,i,r)}$_stopDragTracker(t,e,s,i=!1){this.dragging&&(i?this._dragTracker.cancel():this._dragTracker.drop(null,e,s),this._dragTracker=null)}$_pointerToPoint(t){const e=this._control.dom().getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}$_checkSwipe(t,e){const s=this._touches,i=s.length;if(i<2)return;const r=s[i-1];let o=s[i-2];if(r.t-o.t<=100)for(let t=i-3;t>=0&&(o=s[t],!(r.t-o.t>100));t--);const n=o.x,a=o.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(n-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-o.t),d=.998;if(c>.1){const e=this._dragTracker,s=Math.log(.1/c)/Math.log(d),i=c*(1-Math.pow(d,s+1))/(1-d);let r,o=Math.round(180*Math.atan2(l-a,h-n)/Math.PI);if(o<0&&(o=360+o),r=o>45&&o<=135?X.DOWN:o>135&&o<=225?X.LEFT:o>225&&o<=315?X.UP:X.RIGHT,this.dragging){if(e.swipe(r,1.6*s,1.3*i))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*s,1.3*i)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const s=e.clientX-t.clientX,i=e.clientY-t.clientY;return Math.sqrt(s*s+i*i)}}class Eo extends bt{constructor(t){super(),this._dragging=!1,this._control=t}get control(){return this._control}get dragging(){return this._dragging}get startWhenCreated(){return!1}get cursor(){}canSwipe(){return!1}start(t,e,s,i,r){return this.cancel(),!!this._doStart(t,e,s,i,r)&&(this._dragging=!0,this._showFeedback(i,r),!0)}drag(t,e,s,i,r){return!(!this._dragging||!this._doDrag(t,e,s,i,r))&&(this._moveFeedback(i,r),!0)}cancel(){if(this._dragging)try{this._dragging=!1,this._doCanceled()}finally{this.end()}}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)}}swipe(t,e,s){if(this._doSwipe(t,e,s))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,s){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,s,i,r){return!0}_doCanceled(){}_canAccept(t,e,s){return!0}_doCompleted(t,e,s){}_doEnded(t=-1,e=-1){}}class Vo extends Eo{_doDrag(t,e,s,i,r){const o=this.control.model.body;o.rotationX+=(i-e)/2,o.rotationY-=(r-s)/2}}class Do extends Eo{constructor(t){super(t);const e=this.$_mapView();this._oldX=e.scroll+e.panX,this._oldY=e.panY}_doStart(t,e,s,i,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=s,super._doStart(t,e,s,i,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,s,i,r){const o=this.$_mapView(),n=this._oldX-(i-this._xStart)/o.scale,a=this._oldY-(r-this._yStart)/o.scale;if(o.isScrollable()){const t=360;o.scroll+=t/(o.calcedMapWidth*o.scale)*(e-i)}else o.panX=n;return o.panY=a,!0}$_mapView(){return this.control.model.body}}class Ro extends To{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,s){this.dragging?this.dragTracker instanceof Do&&(this._clickElement=null):0===s.buttons&&this.$_chartView().pointerMoved(t,e,s.target)}_doClick(t){const e=t.target,s=ct?t.ctrlKey:t.metaKey,i=this.$_chart(),r=this.$_chartView(),o=i.chartOptions.options.clickAction,n=r.getButton(e);let a,h,l;if(n)n.click();else if(a=r.legendByDom(e))if(a.source instanceof is){const t=a.source;i.seriesByPoint(t)}else a.source.canHide()&&(a.source.visible=!a.source.visible);else if(e===this._clickElement){if(h=r.seriesByDom(e))h.click(e);else if(l=r.creditByDom(e))l.click(e);else if(r.drilldownPanelView().click(e))return;switch(o){case"select":h&&h.model.canSelect()&&(s?h.toggleSelect(e):h.select(e,!0));break;case"drilldown":this.$_drildown(i,t,r)}}}_doDblClick(t){const e=this.$_chart(),s=this.$_chartView(),i=e.chartOptions.options.dblClickAction;"drilldown"===i&&this.$_drildown(e,t,s)}_doWheel(t){const e=this.$_chart().body,s=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX;return e.options.zoomable&&(e.zoom+=-s/b(Math.max(1,e.options.wheelZoomFactor),4)),t.preventDefault(),!0}_isPinchTarget(t){return this.$_chartView().bodyView().dom.contains(t)}_doPinch(t){const e=this.$_chart().body;e.zoom+=t*(1+Math.log(e.zoom/100)),console.log("PINCH",t*(1+Math.log(e.zoom/100)))}_getDragTracker(t,e,s){return this.$_chart().isGlobe?new Vo(this.control):this.control.chartView().bodyView().canScroll()?new Do(this.control):void 0}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}$_drildown(t,e,s){const i=t.firstMapSeries;if(i){const r=e.target,o=s.bodyView().getSeries(i).pointByDom(r);o&&o.point instanceof Yr&&t.drilldown(t.firstMapSeries,o.point.area.id)}}}class $o{static empty(){return new $o}static create(t=0,e=0){return new $o(t,e)}constructor(t=0,e=0){this.width=t,this.height=e}get isEmpty(){return 0===this.width||0===this.height}clone(){return new $o(this.width,this.height)}equals(t){return t===this||t&&this.width===t.width&&this.height===t.height}setEmpty(){return this.width=this.height=0,this}set(t,e){return this.width=t,this.height=e,this}round(){const t=this.clone();return t.width>>>=0,t.height>>>=0,t}toString(){return"{width: "+this.width+", height: "+this.height+"}"}}$o.EMPTY=new $o;class Oo{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new Oo(t,t,t,t):new Oo(t,t,e,e):new Oo(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 Oo(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}}toString(){return"{top: "+this.top+", bottom: "+this.bottom+", left: "+this.left+", right: "+this.right+"}"}}Oo.Empty=Object.freeze(new Oo),Oo.Temp=new Oo;class Fo extends Vt{constructor(t,e=M){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Fo.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Fo.IGNORE_ATTRS={width:"",height:""};class Bo extends Vt{constructor(t,e=M){super(t,e,"g"),Vt.DEBUGGING&&(this.add(this._debugRect=new Qe(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this.options=t._op)}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,s,i);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Vt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Qe(this.doc,"rm-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){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class zo extends Bo{constructor(t,e,s){super(t,e),this._margins=new Oo,this._paddings=new Oo,this.add(this._background=new Qe(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let r=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(r);const n=this._doMeasure(t,e,s,i);if(n.width+=o.left+o.right,n.height+=o.top+o.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=n.width+=t.left+t.right,this.mh=n.height+=t.top+t.bottom}return this.mw=n.width,this.mh=n.height,n}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class jo extends Fo{measure(t,e,s,i){const r=this._doMeasure(t,e,s,i);return this.mw=r?r.width:0,this.mh=r?r.height:0,r}resizeByMeasured(){return this.resize(this.mw,this.mh),this}layout(t){return this._doLayout(t),this}locateInner(t,e,s){return this._doLocateInner(t,e,s),this}}class Ho extends Bo{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 Go extends bt{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}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()}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e,s){const i=this._owner.doc,r=this._pool,o=this._views;for(let t of o)t.parent;for(t=Math.max(0,t);o.length>t;)r.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t)}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){t.remove(),this._pool.push(t);const e=this._views.indexOf(t);e>=0&&this._views.splice(e,1)}}freeAll(t,e=0){for(let s of t)this.free(s,e)}clear(){this.freeAll(this._views)}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}find(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)if(t(e[s]))return e[s]}sort(t){const e=this._views.sort(t);return e.forEach(t=>t.remove()),e.forEach(t=>this._owner.add(t)),this}map(t){return this._views.map(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,t=>{this._pool.push(t)}),this._views.splice(s,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._owner.add(e),e}_getElementId(t){}}class Yo extends Bo{constructor(e){super(e,"rm-legend-item"),this.add(this._back=new Qe(e)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Ie(e,"rm-legend-item-label")),this._label.anchor=t.TextAnchor.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i){this._label.setBoolData("hidden",!e.source.visible),this._marker.setBoolData("hidden",!e.source.visible),this._label.text=e.text();const r=this._rMarker=this._marker.setVisible(e.legend.options.markerVisible)?this._marker.bbox():_t,o=ut(this._label.bbox());return this._gap=b(e.legend.options.markerGap,0),{width:r.width+this._gap+o.width,height:g(r.height,o.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.bbox().height)/2)}}class Wo extends zo{constructor(t){super(t,Wo.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new Go(this,Yo)}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){const r=e.options,o=e.items(),n=this._vertical="vertical"===e.getLayout();return this._ipr=b(r.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==r.location?b(r.gap,0):0,n?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,n,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.sameTextColor,i=this._sizes,r=t.itemsAlign,o=t.lineGap||0,n=t.itemGap||0,a=this._margins,h=this._paddings,l=this._vertical,c=a.left+h.left,d=a.top+h.top;let _,u=c,p=d;this._itemViews.forEach(t=>{var e;const i=t.model.source,r=i.legendColor();t._marker.setColor(r),null===(e=i.setLegendMarkerStyle)||void 0===e||e.call(i,t._marker),s&&i.visible?t._label.setFill(r):t._label.setFill("")}),e.forEach((t,e)=>{l?(t.forEach(t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])}),p=d,"center"!==r&&"end"!==r||(_=t.map(t=>t.height).reduce((t,e)=>t+e)+n*(t.length-1)+a.top+a.bottom+h.top+h.bottom,p+="center"===r?(this.height-_)/2:this.height-_),t.forEach(t=>{t.trans(u,p),p+=t.height+n}),u+=i[e]+o):(t.forEach(t=>{t.resizeByMeasured().layout(NaN)}),u=c,"center"!==r&&"end"!==r||(_=t.map(t=>t.width).reduce((t,e)=>t+e)+n*(t.length-1)+a.left+a.right+h.left+h.right,u+="center"===r?(this.width-_)/2:this.width-_),t.forEach(t=>{t.trans(u,p),u+=t.width+n}),p+=i[e]+o)})}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,o){const n=e.options,a=e.items(),h=this._itemViews,l=n.itemGap||0,c=n.lineGap||0,d=h.count,_=this._rowViews=[],u=this._sizes=[];let p,m,f,b;h.forEach((e,s)=>{e.setMarker(a[s].source.legendMarker(t,+n.markerSize||Rs.MARKER_SIZE)),e.measure(t,a[s],r,o)});let y=0,w=0;if(s){for(;y<d;)b=h.get(y),w%i===0?(_.push(f=[b]),m=b.mh,w++,y++):(m+=l+b.mh,m<=o?(f.push(b),w++,y++):w=0);this._wMarkers=[],p=m=0,_.forEach((t,e)=>{let s=0,i=0,r=0;t.forEach(t=>{i+=t.mh,s=g(s,t.mw),r=g(r,t._rMarker.width),t._col=e}),i+=l*(t.length-1),m=g(m,i),p+=s,u.push(s),this._wMarkers.push(r)}),p+=c*(_.length-1)}else{for(;y<d;)b=h.get(y),w%i===0?(_.push(f=[b]),p=b.mw,w++,y++):(p+=l+b.mw,p<=r?(f.push(b),w++,y++):w=0);p=m=0,_.forEach(t=>{let e=0,s=0;t.forEach(t=>{e+=t.mw,s=g(s,t.mh)}),e+=l*(t.length-1),p=g(p,e),m+=s,u.push(s)}),m+=c*(_.length-1)}return{width:p,height:m}}}Wo.LEGEND_CLASS="rm-legend";const Zo={};class Uo extends zo{static register(...t){t.forEach(t=>{Zo[t[0].type]=t[1]})}constructor(t,e){super(t,Uo.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,s){this.measure(this.doc,this.model,e,s),this._layoutView(t,0,0,e,s)}_layoutView(t,e,s,i,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,s,i,r,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 o=i.tx,n=i.ty;switch(this.options.align){case"left":o-=this.width+t.x;break;case"right":o+=s+t.x;break;default:o+=(s-this.width)/2+t.x}switch(this.options.verticalAlign){case"middle":n+=(r-this.height)/2+t.y;break;case"bottom":n+=r+t.y;break;default:n-=this.height+t.y}return{x:o,y:n}}}}_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)}}Uo.CLASS_NAME="rm-annotation";class Xo{static interpolate(t,e){if(e instanceof Ni==!1)return t;const s=[];let i=null,r=null,o=!1;for(let n=0;n<t.length;n++){const a=t[n],h=e.project(a);if(h.outside)o=!0;else{if(i||(i=a,t.push(a)),o&&r){const t=Ti(r,a);for(const i of t){const t=e.project(i);t.outside||s.push(t)}}s.push(h),r=a,o=!1}}return s}}class Ko{static box(t,e,s,i,r){const o=Math.floor(Math.abs(s-t)/20),n=this.boxPoints(t,e,s,i,o);return this.coordsToPath(Ko.toPixelCoord(r,n))}static ellipse(t,e,s,i,r,o=40){const n=this.arcCoords(t+s/2,e+i/2,s/2,i/2,0,2*Math.PI,!0,o);return this.coordsToPath(Ko.toPixelCoord(r,n))}static geoCircle(t,e,s,i,r,o=!1,n=40){const a=this.arcCoords(t,e,s,i,0,2*Math.PI,!0,n);let h=this.toPixelCoord(r,a);return o&&(h=h.map(t=>[t[0],-t[1]])),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof Ni?Xo.interpolate(e,t):e.map(e=>t.project(e))}static coordsToPath(t){const e=[];let s=!1;for(const i of t){if(!!i.outside){s=!1;continue}const[t,r]=i;s?e.push("L",t,r):(e.push("M",t,r),s=!0)}return e}static horizontalLineToRight(t,e,s,i){const r=[];let o=e;for(;o<=s&&(r.push([o,t]),o+i<=s);)o+=i;return 0!==r.length&&r[r.length-1][0]===s||r.push([s,t]),r}static horizontalLineToLeft(t,e,s,i){const r=[];let o=s;for(;o>=e&&(r.push([o,t]),o-i>=e);)o-=i;return 0!==r.length&&r[r.length-1][0]===e||r.push([e,t]),r}static verticalLineToUp(t,e,s,i){const r=[];let o=e;for(;o<=s&&(r.push([t,o]),o+i<=s);)o+=i;return 0!==r.length&&r[r.length-1][1]===s||r.push([t,s]),r}static verticalLineToDown(t,e,s,i){const r=[];let o=s;for(;o>=e&&(r.push([t,o]),o-i>=e);)o-=i;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,s,i,r){const o=[],[n,a]=t<=s?[t,s]:[s,t],[h,l]=e<=i?[e,i]:[i,e];return r=Math.max(1,r),o.push(...this.horizontalLineToRight(h,n,a,r)),o.push(...this.verticalLineToUp(a,h,l,r)),o.push(...this.horizontalLineToLeft(l,n,a,r)),o.push(...this.verticalLineToDown(n,h,l,r)),o}static arcCoords(t,e,s,i,r,o,n,a=64){const h=2*Math.PI,l=o-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?n?-h:h:l;c||(n&&d>0&&(d-=h),!n&&d<0&&(d+=h));const _=d/a,u=[];for(let o=0;o<=a;o++){const n=r+_*o;u.push([t+Math.cos(n)*Math.abs(s),e+Math.sin(n)*Math.abs(i)])}return u}}class qo extends Fo{constructor(e,s){super(e,s),this.add(this._text=new Ie(e,void 0)),this._text.anchor=t.TextAnchor.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,s,i){const r=e.options,o=r.effect;return this._model=e,this._text.setStyleOrClass(r.style),"background"===o?(this._outline&&this._outline.remove(),this._back||(this._back=new Qe(t,"rm-label-background")),this.insertFirst(this._back),this._back.setStyleOrClass(r.backgroundStyle)):"outline"===o?(this._back&&this._back.remove(),this._outline||(this._outline=new Ie(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(r.style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),s?this._icon||(this.add(this._icon=new Io(t,!1)),this._icon.url=s,this._icon.width=r.width,this._icon.height=r.height||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){const e=this._model.options;if(t&&e.autoContrast&&this._text.setContrast(t,e.darkStyle||"rm-label-dark",e.lightStyle||"rm-label-light"),this._outline&&this._outline.parent){const t=Ae.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const e=this._icon;let s=0;const i=this._text.bbox(),r=i.width,o=i.height;let n,a=r,h=o,l=0,c=0,d=0,_=0;if(this._box=void 0,e){const t=e.bbox();switch(s=b(this._model.options.iconGap,0),l=t.width,c=t.height,this._model.getIconPos()){case"left":case"right":a+=s+l,h=Math.max(c,o);break;default:h+=s+c,a=Math.max(l,r)}}if(this._back&&this._back.parent&&(n=getComputedStyle(this._back.dom),d=parseFloat(n.paddingLeft)||0,_=parseFloat(n.paddingTop)||0,this._back.setBounds(0,0,a+d+(parseFloat(n.paddingRight)||0),h+_+(parseFloat(n.paddingBottom)||0),n.rx)),e)switch(this._model.getIconPos()){case"left":e.trans(d,(h-c)/2),d+=l+s,a-=l+s;break;case"right":e.trans(d+a-l,(h-c)/2),a-=l+s;break;case"top":e.transX((a-l)/2),_+=c+s;break;case"bottom":e.trans((a-l)/2,_+o+s)}switch(n||(n=getComputedStyle(this._text.dom)),n.textAlign){case"center":d+=a/2,this._text.anchor=t.TextAnchor.MIDDLE;break;case"right":d+=a,this._text.anchor=t.TextAnchor.END;break;default:this._text.anchor=t.TextAnchor.START}return this._text.trans(d,_),this._outline&&(this._outline.anchor=this._text.anchor,this._outline.setAttr("y",this._text.getAttr("y")),this._outline.trans(d,_)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class Jo extends $t{renderLat(t,e,s,i,r){let o=r.project([e,t]),n=st(o)?`M${o[0]},${o[1]}`:"",a=e+i;const h=t=>{o=r.project(t),st(o)&&(n+=n?` L${o[0]},${o[1]}`:`M${o[0]},${o[1]}`)};for(;a<=s-i;)h([a,t]),a+=i;a<=s&&h([s,t]),this.setPath(n)}renderLatGlobe(t,e,s,i,r){let o,n=e,a=r.project([n,t]);for(;a.outside&&n<=s;)n+=i,a=r.project([n,t]);if(n<s){let e=`M${a[0]},${a[1]}`;for(n+=i;n<=s;)a=r.project([n,t]),a.outside?o=a:(o&&(e+=` M${o[0]},${o[1]}`,o=null),e+=` L${a[0]},${a[1]}`),n+=i;this.setPath(e)}}renderLon(t,e,s,i,r){let o=r.project([t,e]),n=st(o)?`M${o[0]},${o[1]}`:"",a=e+i;const h=t=>{o=r.project(t),st(o)&&(n+=n?` L${o[0]},${o[1]}`:`M${o[0]},${o[1]}`)};for(;a<=s-i;)h([t,a]),a+=i;a<=s&&h([t,s]),this.setPath(n)}renderLonGlobe(t,e,s,i,r){let o,n=e,a=r.project([t,n]);for(;a.outside&&n<=s;)n+=i,a=r.project([t,n]);if(n<s){let e=`M${a[0]},${a[1]}`;for(n+=i;n<=s;)a=r.project([t,n]),a.outside?o=a:(o&&(e+=` M${o[0]},${o[1]}`,o=null),e+=` L${a[0]},${a[1]}`),n+=i;this.setPath(e)}}}class Qo extends Bo{constructor(t,e){super(t,"rm-map-axis-grid"),this.second=e,this._latPool=new Go(this,Jo),this._lonPool=new Go(this,Jo)}_doInitStyles(){this.ignorePointer()}_doMeasure(t,e,s,i){return this.$_prepareLines(e,s,i),$o.create(s,i)}_doLayout(t){const e=this.model,s=e.line,i=e.lonLine,r=e.latLine,o=e.chart.getProjection(this.second),n=o.isGlobe,a=this._bounds,h=a.step,l=1/this._scale;Nt.setImportantStyle(this.dom.style,"pointer-events","none"),Nt.setImportantStyle(this.dom.style,"fill","none"),this.setStyle("strokeWidth",`${l}px`);let c=a.x1,d=a.x2;n?this._latPool.forEach((t,e,i)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLatGlobe(a.y1+e*h,c,d,h,o)}):this._latPool.forEach((t,e)=>{const i=a.y1+e*h;i>a.y2||i<a.y1?t.visible=!1:(t.visible||(t.visible=!0),t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLat(i,c,d,h,o))});let _=a.y1,u=a.y2;n?this._lonPool.forEach((t,e,r)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(i._style),t.renderLonGlobe(a.x1+e*h,_,u,h,o)}):this._lonPool.forEach((t,e)=>{const r=a.x1+e*h;r>a.x2||r<a.x1?t.visible=!1:(t.visible||(t.visible=!0),t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(i._style),t.renderLon(r,_,u,h,o))})}$_prepareLines(t,e,s){const i=t.chart.map,r=t.getStep(i),{x1:o,x2:n,y1:a,y2:h}="map"===this.model.fitTo?this.$_calcBoundary(i,r):this.$_calcFullBoundary();this._latPool.prepare(h-a+1),this._lonPool.prepare(n-o+1),this._bounds={x1:Math.max(-180,o),y1:Math.max(-90,a),x2:Math.min(180,n),y2:Math.min(90,h),step:r}}$_calcBoundary(t,e){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class tn extends Bo{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new Qo(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,s,i){return this._gridView.setVisible(e.grid.visible)&&this._gridView.measure(t,e.grid,s,i),$o.create(s,i)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}}class en extends qo{}class sn extends Bo{constructor(t,e){super(t),this.add(this._pathView=new $t(t)),e.add(this._labelView=new en(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,s,i){return this.setClass(e instanceof oi?"rm-axis-range-guid":"rm-axis-line-guide"),{width:s,height:i}}_doLayout(t){const e=this.model,s=e.options,i=this._pathView,r=this._labelView;let o,n=this._fromView,a=this._toView;if(i.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(s.label.text),"range"===s.type){const e=(parseFloat(getComputedStyle(i.dom).strokeWidth)||1)/t.tf.scale;n&&(n.remove(),a.remove(),this._fromView=this._toView=null),o=this.$_renderRange(s,t,r),i.setStyle("strokeWidth",`${e}px`)}else if("band"===s.type){n||(this.add(n=this._fromView=new $t(this.doc)),this.add(a=this._toView=new $t(this.doc))),n.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),n.setStyle("fill","none"),n.setStyle("transform",t.trans),a.setStyle("fill","none"),a.setStyle("transform",t.trans);const h=(parseFloat(getComputedStyle(n.dom).strokeWidth)||1)/t.tf.scale;n.setStyle("strokeWidth",`${h}px`),a.setStyle("strokeWidth",`${h}px`),o=this.$_renderBand(s,t,r),i.setStyle("stroke","none")}else{const e=(parseFloat(getComputedStyle(i.dom).strokeWidth)||1)/t.tf.scale;n&&(n.remove(),a.remove(),this._fromView=this._toView=null),o=this.$_renderLine(s,t,r),i.setStyle("fill","none"),i.setStyle("strokeWidth",`${e}px`)}i.setPath(o).setStyle("transform",t.trans)}$_renderLine(t,e,s){const{map:i,prj:r,step:o}=e;let n;if("lat"===t.axis){const r=t.position,a=i.h1,h=i.h2;n=Ko.horizontalLineToRight(r,a,h,o),this.$_renderLatLabel(a,r,e,s)}else{const a=t.position,h=i.v1,l=i.v2;n=Ko.verticalLineToUp(a,h,l,o),this.$_renderLonLabel(a,l,r,e.tf,s)}const a=n.map(t=>r.project(t));return Ko.coordsToPath(a)}$_renderBand(t,e,s){const{map:i,prj:r,step:o}=e;let n=[];if("lat"===t.axis){const a=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=i.h1,c=i.h2;n.push(...Ko.horizontalLineToRight(a,l,c,o));const d=[...n];this._fromView.setPath(Ko.coordsToPath(d.map(t=>r.project(t)))),n.push(...Ko.verticalLineToUp(c,a,h,o));const _=Ko.horizontalLineToLeft(h,l,c,o);n.push(..._),this._toView.setPath(Ko.coordsToPath(_.map(t=>r.project(t)))),n.push(...Ko.verticalLineToDown(l,a,h,o)),this.$_renderLatLabel(l,h,e,s)}else{const a=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=i.v1,c=i.v2;n.push(...Ko.verticalLineToUp(a,l,c,o));const d=[...n],_=Ko.verticalLineToDown(h,l,c,o);n.push(..._),this._fromView.setPath(Ko.coordsToPath(d.map(t=>r.project(t)))),this._toView.setPath(Ko.coordsToPath(_.map(t=>r.project(t)))),this.$_renderLonLabel(a,c,r,e.tf,s)}return Ko.coordsToPath(Ko.toPixelCoord(r,n))}$_renderRange(t,e,s){const{prj:i}=e;let r;const[o,n]=t.from,[a,h]=t.to;if(t.elliptic){const t=[Math.min(o,a),Math.min(n,h)],e=Math.abs(a-o),s=Math.abs(h-n);r=Ko.ellipse(t[0],t[1],e,s,i)}else r=Ko.box(o,n,a,h,i);if(s.visible){const t=Math.min(o,a),r=Math.max(n,h),l=i.project([t,r]);l.outside?s.visible=!1:s.visible||(s.visible=!0),s.trans(l[0]*e.tf.scale+e.tf.tx,l[1]*-e.tf.scale+e.tf.ty-s.bbox().height)}return r}$_renderLatLabel(t,e,s,i){if(!i.visible)return;const{prj:r,map:o,tf:n}=s;let a=0,h=0;const l=i.bbox(),c=r.project([o.h1,e]),d=r.project([t,e]);c.outside||d.outside?i.visible=!1:i.visible||(i.visible=!0),a=c[0]*n.scale+n.tx+16,h=d[1]*-n.scale+n.ty,h+=e>=0?0:-l.height,i.trans(a,h)}$_renderLonLabel(t,e,s,i,r){if(!r.visible)return;let o=0,n=0;const a=r.bbox(),h=s.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,o=l*i.scale+i.tx,n=c*-i.scale+i.ty+a.height/2,"line"===this.model.options.type?o+=t>=0?-a.width-6:6:o+=6,r.trans(o,n)}$_renderHorizontalLineToRight(t,e,s,i,r){let o="",n=e;const a=t=>{const e=i.project(t);st(e)&&(o+=` L${e[0]},${e[1]}`)};for(;n<s-r;)a([n,t]),n+=r;return n<=s&&a([s,t]),o}$_renderHorizontalLineToLeft(t,e,s,i,r){let o="",n=s;const a=t=>{const e=i.project(t);st(e)&&(o+=` L${e[0]},${e[1]}`)};for(;n>e+r;)a([n,t]),n-=r;return n>=e&&a([e,t]),o}$_renderVerticalLineToTop(t,e,s,i,r){let o="",n=e;const a=t=>{const e=i.project(t);st(e)&&(o+=` L${e[0]},${e[1]}`)};for(;n<=s-r;)a([t,n]),n+=r;return n<s&&a([t,s]),o}$_renderVerticalLineToBottom(t,e,s,i,r){let o="",n=s;const a=t=>{const e=i.project(t);st(e)&&(o+=` L${e[0]},${e[1]}`)};for(;n>=e+r;)a([t,n]),n-=r;return n>e&&a([t,e]),o}}class rn extends Fo{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new Qe(t,"rm-crosshair-flag-back")),this.add(this._text=new Ie(t))}prepare(t){this.internalResetStyleOrClass(t.style),this._back.internalResetStyleOrClass(t.backgroundStyle)}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),s=parseFloat(e.paddingLeft)||0,i=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+s+(parseFloat(e.paddingRight)||0),r.height+i+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(s+r.width/2,i)}renderLonFlag(t,e,s,i,r,o,n){const a=e.project([i,s]),h=e.project([i,r]),l=this.prepareLabel(t);this.trans(Math.min(o-l.width,Math.max(0,n.tx+h[0]*n.scale-l.width/2)),Math.max(0,n.ty-a[1]*n.scale-l.height))}renderLatFlag(t,e,s,i,r,o){const n=e.project([s,i]),a=this.prepareLabel(t);this.trans(Math.max(0,o.tx+n[0]*o.scale-a.width),Math.max(0,Math.min(r-a.height,o.ty-n[1]*o.scale-a.height/2)))}renderGlobeLonFlag(t,e,s,i){const r=this.prepareLabel(t),o=e.rotationY<=0,n=e.project([0,o?90:-90]);this.trans(i.tx+n[0]*i.scale,Math.min(s-r.height,Math.max(0,i.ty-n[1]*i.scale-r.height/2)))}renderGlobeLatFlag(t,e,s,i,r,o,n,a){const h=e.project([s,i]),l=e.project([n,i]),c=this.prepareLabel(t);this.trans(Math.min(r-c.width,Math.max(0,a.tx+h[0]*a.scale)),Math.max(0,Math.min(o-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class on extends Bo{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new Jo(t,"rm-crosshair-line")),this.add(this._lonLine=new Jo(t,"rm-crosshair-line")),Nt.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Nt.setImportantStyle(this._latLine.dom.style,"fill","none"),Nt.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Nt.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new rn(t)),this.add(this._lonFlag=new rn(t))}prepare(t,e){this._latLine.internalClearStyles();const s=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.setStyle("transform",e),this._lonLine.setStyle("transform",e),this._latLine.setStyle("strokeWidth",`${s}px`),this._lonLine.setStyle("strokeWidth",`${s}px`),this._latFlag.prepare(this.model.flag.options),this._lonFlag.prepare(this.model.flag.options),this}render(t,e){var s,i,r;const o=this.model,n=o.chart.map,a=t[0],h=t[1],l=this._lonLine,c=this._latLine,d=this._lonFlag,_=this._latFlag;null!==(r=null===(i=null===(s=o.chart.axis)||void 0===s?void 0:s.grid)||void 0===i?void 0:i.getStep(n))&&void 0!==r||on.DEFAULT_STEP;const u=on.LINE_STEP,p="map"===o.axis.grid.fitTo,g=p?n.h1:-180,m=p?n.h2:180,f=p?n.v1:-90,b=p?n.v2:90;this._bounds={x1:g,x2:m,y1:f,y2:b};const y=[l,d,c,_],w=y.reduce((t,e)=>t&&e.visible,!0);if(!(g<=a&&a<=m&&f<=h&&h<=b))return void y.forEach(t=>t.setVisible(!1));w||y.forEach(t=>t.setVisible(!0));const x=this.model.chart.getProjection(!1),v=x instanceof Ni?x:new x.constructor;v.offset=x.offset,this.$_renderLon(t,u,e,v),this.$_renderLat(t,u,e,v)}$_renderLon(t,e,s,i){const r=this.model,o=r.chart.map,n=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=i instanceof Ni;_?l.renderLonGlobe(h,n,a,e,i):l.renderLon(h,n,a,e,i);const u=this.calcTopY(s,o,i,n),p=this.calcScrolledLon(r,h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,i,d.height,s):c.renderLonFlag(g,i,a,h,u,d.width,s)}calcScrolledLon(t,e){let s=e+t.chart.getProjection(!1).scroll;return s=(s%360+360)%360,s>180&&(s-=360),s}$_renderLat(t,e,s,i){const r=this.model,o=r.chart.map,n=this._bounds.x1,a=this._bounds.x2,h=t[1],l=this._latLine,c=this._latFlag,d=r.getFlag(h),_=this.parent,u=i instanceof Ni;u?l.renderLatGlobe(h,n,a,e,i):l.renderLat(h,n,a,e,i);const p=u?90-i.rotationX:n,g=i.project(t),m=this.calcRightX(s,i,_,o,g[1]);u?c.renderGlobeLatFlag(d,i,p,h,_.width,_.height,m,s):c.renderLatFlag(d,i,p,h,_.height,s)}calcTopY(t,e,s,i){const r=[(t.vx-t.tx)/t.scale,(t.vy-t.ty)/-t.scale];let o=[NaN,NaN];const n=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=s.backward(r);if(!Number.isNaN(t[1])){o=t;break}r[0]+=n}return Number.isNaN(o[1])?i:o[1]}calcRightX(t,e,s,i,r){const o=[(s.width-t.vx-t.tx)/t.scale,r];let n=e.backward(o);return Number.isNaN(n[0])?i.x2:n[0]}}on.LINE_STEP=1,on.DEFAULT_STEP=1;const nn="rm_map_globe_fill";class an extends $t{constructor(t){super(t,"rm-map-background")}render(t,e,s,i,r,o){const n=e.map,a=this.parent,h=e.body.projection;n||this.setPath("");const l=e.body.mapBackground;let c;if(this.internalClearStyles(),a.isProjectionChanged&&this.transEx(0,0).scale(1),e.isGlobe)c=this.$_renderGlobeBg(t,l,c,r,o,s,i);else if(e.body.projection.isElliptic){const t=e.body.projection.getClipBounds();c=`M${t[0][0]},${t[0][1]} L`+t.slice(1).map(t=>`${t[0]},${t[1]}`),this.internalSetStyleOrClass(l._style)}else this.internalSetStyleOrClass(l._style),c=Ct.rectangle(s,i,r,o);if(this.setPath(c),h.isElliptic&&!(h instanceof Ni)){const{tx:t,ty:e,scale:s}=a.transformInfo;this.transEx(t,e).scale(s)}}$_renderGlobeBg(t,e,s,i,r,o,n){const a=e.options.globeFill,h=Math.max(i,r)/2;if(s=Ct.circle(o+h,n+h,h),a!==this._globeFill){if(this.control.removeDef(nn),a){const e={id:nn,cx:"0.4",cy:"0.4",r:"1",color:["white",a]};this.control.addDef(new Kt(e).getElement(t,e))}this._globeFill=a}return a&&this.setFill(`url(#${nn})`),this.internalSetStyleOrClass(e._style),s}}class hn extends $t{constructor(t,e,s){super(t,e),this.setLine(s)}setLine(t,e,s,i){dt.isNum(t)?this.setPath(Ct.line(t,e,s,i)):t&&this.setPath(Ct.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,s){this.setPath(Ct.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(Ct.line(t,e,t,s))}setHLine(t,e,s){this.setPath(Ct.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(Ct.line(e,t,s,t))}}class ln extends $t{constructor(t,e,s,i){super(t,e),s&&this.setLines(s,i)}setLines(t,e){dt.isNum(t[0])?this.setPath(Ct.lines(...t)):this.setPath(Ct.lines2(...t))}}var cn;class dn extends Go{constructor(t,e){super(t,e,void 0,0)}_getElementId(t){return t.point.pid}}class _n extends qo{constructor(t){super(t,"rm-point-label")}}class un extends Dt{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new Go(this,_n),new Go(this,_n)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}clear(){this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareLabel(t,e,s,i,r,o){const n=r.getPointText(i,s,o.options.text);e.point=i,e.setModel(t,o,null,null),e._text.internalResetStyleOrClass(o._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(i)),n?(o.prepareRich(n),o.buildSvg(e._text,e._outline,NaN,NaN,o,o.getTextDomain(i))):(e.setText(o.getText(o.getValue(i,s))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const s=e.model,i=s.getPointLabels(),r=s.pointLabelCount(),o=this._labels,n=s.getLabeledPoints(),a=this._maps,h=i[0]._style;o[0].prepare(n.length),a[0]={},o[1].prepare(r>1?n.length:0),a[1]={},n.forEach((r,n)=>{for(let h=0;h<r.labelCount();h++){const l=o[h].get(n);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,s,i[h]),a[h][r.pid]=l)}}),this.setStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){const s=this._maps[e];return s&&s[t.pid]}removePoint(t,e){for(let s=0;s<2;s++){const i=this.get(t,s);if(i)return void this._labels[s].removeLater(i,e)}}}class pn extends Fo{constructor(t){super(t),this.add(this._line=new ln(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new $t(t)),this._dummy.setStyle("visibility","hidden"),this.add(this._anchor=new $t(t,"rm-callout-anchor"))}render(t,e,s,i){const r=t.options,o=t.series,n=this._anchor,a=this._line;if(this._dummy.setPath(Ct.circle(0,0,1e4)),this._dummy.trans(s[0],s[1]),n.setVisible(t.anchorPoint.visible)){const i=wn.getDrawer(t.series.getCalloutShape(e)),a=t.anchorPoint.options.radius;n.internalClearStyleAndClass(),r.useSeriesColor&&n.internalSetStyleOrClass(o._style),n.internalSetStyleOrClass(t.anchorPoint._style),n.setPath(i(a,a)),n.trans(s[0],s[1])}return a.internalClearStyleAndClass(),r.useSeriesColor&&this._line.internalSetStyleOrClass(o._style),a.internalSetStyleOrClass(t._style),a.setLines(s,!1),i&&r.usePointColor&&(n.visible&&n.setFill(i),a.setStroke(i)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class gn extends Ft{constructor(t){super(t),this.add(this._back=new Qe(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new $t(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,s){return this._mask.setPath(Ct.circle(t,e,s)),this}setRects(t,e){return t&&e?this._mask.setPath(Ct.rect(t).concat(Ct.rect(e))):this._mask.setPath(Ct.rect(t)),this}}class mn extends Dt{constructor(t,e){super(t,e),this._callouts=new Go(this,pn),this._map={},this.add(this._maskLayer=new Dt(t)),this._masks=new Go(this._maskLayer,gn),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,s=t.callout,i=this._callouts,r=this._masks,o=t.getLabeledPoints(),n=s._style,a=this._map={};r.prepare(o.length,t=>{}),i.prepare(o.length),o.forEach((t,s)=>{const o=i.get(s);o.setVisible(e.isPointCalloutVisible(t))&&(o.setAttr("mask",`url(#${r.get(s).id}`),o.index=s,a[t.pid]=o)}),this.setStyleOrClass(n)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){return this._map[t.pid]}setMask(t,e){const s={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},i=this._masks.get(t.index);return i.setBackground(s),i}}class fn extends Ot{constructor(t,e=!1){super(t,wn.POINT_CLASS,e)}tooltipColor(){return this.getFill()}_drawSpline(t,e,s,i){let r=e;if(s<0&&(s=t.length-1),1===Math.abs(s-e))return void i.line(t[r+1].x,t[r+1].y);const o=.35,n={x:0,y:0},a={x:0,y:0},h={x:0,y:0},l={x:t[r+1].x-t[r].x,y:t[r+1].y-t[r].y};let c={x:0,y:0},d=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=d,l.y/=d;let _=t[r+1].x-t[r].x,u=t[r].x,p=t[r].y;for(++r;r!=s;r++){h.x=-l.x,h.y=-l.y,l.x=t[r+1].x-t[r].x,l.y=t[r+1].y-t[r].y,d=Math.sqrt(l.x*l.x+l.y*l.y),l.x/=d,l.y/=d,l.x<h.x?(c.x=h.x-l.x,c.y=h.y-l.y):(c.x=l.x-h.x,c.y=l.y-h.y);const e=Math.sqrt(c.x*c.x+c.y*c.y);c.x/=e,c.y/=e,h.y*l.y>=0&&(c={x:1,y:0}),n.x=-c.x*_*o,n.y=-c.y*_*o;const s=u+a.x,g=p+a.y,m=t[r].x+n.x,f=t[r].y+n.y;i.curve(s,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*o,a.y=c.y*_*o,u=t[r].x,p=t[r].y}i.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}}class bn extends Dt{}const yn={};class wn extends Ho{static register(...t){t.forEach(t=>{yn[t[0].type]=t[1]})}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof wn)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach(t=>{e[t]=e=>Ct[t](0-e,0-e,2*e,2*e)}),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,s=!0){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,s,i)=>({x:t-s/2,y:e-i}),bottom:(t,e,s,i)=>({x:t-s/2,y:e}),center:(t,e,s,i)=>({x:t-s/2,y:e-i/2}),left:(t,e,s,i)=>({x:t-s,y:e-i/2}),right:(t,e,s,i)=>({x:t,y:e-i/2})},this._labelPositioner={bottom:(t,e,s,i,r,o)=>({x:t-=s.width/2,y:e+=r+o}),top:(t,e,s,i,r,o)=>({x:t-=s.width/2,y:e-=r+o+s.height}),right:(t,e,s,i,r,o)=>({x:t+=i+o,y:e-=s.height/2}),left:(t,e,s,i,r,o)=>({x:t-=i+o+s.width,y:e-=s.height/2}),center:(t,e,s,i,r,o)=>({x:t-=s.width/2,y:e-=s.height/2+o})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverAnis=[],this._hoverPts=[],this.add(this._pointLayer=new Dt(t)),this._pointLayer.add(this._pointContainer=new bn(t,"rm-series-points")),this.add(this._calloutContainer=new mn(t,"rm-series-callouts")),s&&(this._labelContainer=new un(t,e))}_setCalcedColor(t,e){const s=getComputedStyle(e);t.setCalcedColor(s,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepare(t,e){const s=e._optionsDirty||e._dataSourceDirty||e._zindexDirty,i=this._labelContainer,r=this._calloutContainer;this.setModel(e),e instanceof Ur?this.setData("index",e.seriesIndex%10):this.setData("index",e.seriesIndex%12),null==i||i.setVisible(e.isPointLabelsVisible()),r.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),null==i||i.prepare(t,this),r.prepare(t,this)):((null==i?void 0:i.isEmpty())&&i.prepare(t,this),r.isEmpty()&&r.prepare(t,this)),isNaN(this._aniOpacity)||this.setStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,s=e._optionsDirty||e._dataSourceDirty;s&&this._doPrepeare(t,e,s)}render(t,e){this._wBody=t,this._hBody=e,this._doRender(this.width,this.height),this._animatable&&this._runShowEffect(!this.control.loaded&&this.chart().loadAnimatable())}reset(){this._doReset()}isPointLabelVisible(t){return t.visible&&!t.isNull&&this.model.isPointLabelVisible(t)}isPointCalloutVisible(t){return t.visible&&!t.isNull&&this.model.isPointCalloutVisible()}setScaler(t){this._scaler=t}getPointView(t){var e;return null===(e=this._getPointPool())||void 0===e?void 0:e.elementOf(t)}pointerMoved(t,e,s){return this._doPointerMoved(t,e,s)}setHoverStyle(t){t.internalImportantStylesOrClass(this.model.options.hoverStyle)}defaultAnimation(){return"grow"}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))}pointByDom(t){return this._getPointPool().elementOf(t)}click(t){const e=this.pointByDom(t);e&&(e.point?!0!==this.model.pointClicked(e.point)&&this._doPointClicked(e):this._doPointClicked(e))}select(t,e){const s=this.pointByDom(t);s&&this.chart().selection.add(this.model,s.point,e)}toggleSelect(t){const e=this.pointByDom(t);e&&this.chart().selection.toggle(this.model,e.point)}runPointAddAnimation(t){}get growRate(){return this._growRate}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_getPointPositioner(t,e){return this._pointPositioner[t]||this._pointPositioner[e]}_getLabelPositioner(t,e){return this._labelPositioner[t]||this._labelPositioner[e]}_labelViews(){return this._labelContainer.setVisible(this.model.isPointLabelsVisible()),this._labelContainer.visible?this._labelContainer:void 0}_calloutViews(){return this._calloutContainer.setVisible(this.model.isPointCalloutVisible()),this._calloutContainer.visible?this._calloutContainer:void 0}_getPointPool(){}_collectVisPoints(t){return t._visPoints}_setPointColor(t,e){t.setColor(e)}_setPointStyle(t,e,s){if(t.setAttrEx("aria-label",s.ariaHint()),t.internalClearStyleAndClass(),s._runColor)this._setPointColor(t,s._runColor);else{const i=e.getRangedColor(s);i&&this._setPointColor(t,i)}const i=e.getPointStyle(s);i&&t.internalSetStyleOrClass(i)}_doPointerMoved(t,e,s){return!1}_getGrowRate(){return b(this._growRate,1)}_doViewRateChanged(t){}_doPosRateChanged(t){}_doPrevRateChanged(t){}_getShowAnimation(){}_runShowEffect(t){}_animationStarted(t){this._animations.push(t)}_animationFinished(t){const e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1),this._invalidate()}_layoutLabel(t,e){return t.setContrast(e).layout()}_legendColorProp(){return"fill"}_doPointClicked(t){t&&t.point&&dt.log("CLICKED: ",t.point.name,t.point.getValue())}}cn=wn,wn.POINT_CLASS="rm-point",wn.DATA_HOVER="hover",wn.DATA_UNHOVER="unhover",wn.LEGEND_MARKER="rm-legend-item-marker",wn._drawers=Object.assign({circle:t=>Ct.circle(0,0,t)},cn._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class xn extends fn{beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return 0}}class vn extends wn{constructor(t,e){super(t,e),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}}class Cn extends fn{prepare(t,e){return this.point=t,this._ext=dt.getMinMax(t.values),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Sn extends wn{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.options.minSize}}}class Ln extends Cn{constructor(t){super(t,!0),this.add(this._contentLayer=new Dt(t)),this.add(this._baseLine=new hn(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,s,i){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(i,0,s)}}class An extends Sn{_getSeriesExt(t,e){const s=super._getSeriesExt(t,e);return t._pointDomain||(s.min=Math.min(s.min,b(t._minValue,s.min)),s.max=Math.max(s.max,b(t._maxValue,s.max))),s}_doPrepeare(t,e,s){!this._ext||s?this._ext={...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height}:(this._ext.width=e._width,this._ext.height=e._height)}}class Mn extends fn{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,s){}endHover(t,e){}distance(t,e,s){return 0}}class kn extends wn{constructor(t,e){super(t,e),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class Pn extends Uo{constructor(t){super(t,Pn.CLASS_NAME),this.add(this._imageView=new Io(t,!1)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,s,i){const r=e.getSize(s,i);return this._deflatePaddings(r),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(r.width,r.height),ut(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Pn.CLASS_NAME="rm-image-annotation";class In extends Uo{constructor(t){super(t,In.CLASS_NAME),this.add(this._shapeView=new $t(t))}_doMeasure(t,e,s,i){const r=e.getSize(s,i);return this._deflatePaddings(r),Ct.setShape(this._shapeView,e.getShape(),r.width/2,r.height/2),r}_doLayout(t){this._shapeView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}In.CLASS_NAME="rm-shape-annotation";class Nn extends Uo{constructor(e){super(e,Nn.CLASS_NAME),this.add(this._textView=new Ie(e)),this._textView.anchor=t.TextAnchor.START,this._richText=new Fe}_doMeasure(t,e,s,i){const r=e.options,o=e.getSize(s,i),n=this._textView;r.writingMode&&this._textView.setStyle("writingMode",r.writingMode),r.textOrientation&&this._textView.setStyle("textOrientation",r.textOrientation),this._deflatePaddings(o),this._richText.setFormat(r.text),this._richText.build(n,s,i,null,e._domain);const a=ut(this._textView.bbox());return{width:b(o.width,a.width),height:b(o.height,a.height)}}_doLayout(t){this._richText.layout(this._textView,getComputedStyle(this._textView.dom).textAlign,this.width,this.height,this._paddings),this._textView.trans(this._textView.tx,this._textView.ty),super._doLayout(t)}}Nn.CLASS_NAME="rm-text-annotation";class Tn{static reveal(t,e){new Vn(t,e)}static grow(t,e){new Rn(t,e)}static spread(t,e){new $n(t,e)}static fadeIn(t){new En(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const s=this._createAnimation(t,e);window.Animation&&s instanceof Animation&&(s.addEventListener("finish",()=>{t._animationFinished(s)}),t._animationStarted(s))}}class En extends Tn{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:mt.DURATION,fill:"none"})}}let Vn=class extends Tn{constructor(t,e){super(t,e)}_createAnimation(t,e){const s=this.$_clipRect(t);let i;switch(e&&e.from){case"top":i=this.$_top(t,s,e);break;case"bottom":i=this.$_bottom(t,s,e);break;case"right":i=this.$_right(t,s,e);break;default:i=this.$_left(t,s,e)}return null==i||i.addEventListener("finish",()=>{s.dom.remove()}),i}$_aniOptions(t){return{duration:mt.DURATION,fill:"none"}}$_clipRect(t){const e=t.control;return t.clipRect(.1*-t.width,-e.height(),1.2*t.width,2*e.height())}$_left(t,e,s){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions(s))}$_right(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(s))}$_top(t,e,s){return e.dom.firstElementChild.animate([{height:"0"},{height:O(t.height)}],this.$_aniOptions(s))}$_bottom(t,e,s){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(s))}};class Dn extends mt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Vt}_stop(){super._stop(),this._series=null}}class Rn extends Dn{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class $n extends Dn{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class On extends $t{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,s,i,r,o){this.x=t,this.setPath(Ct.bar(t-s/2,e,s,-i,r,o))}}class Fn extends Ln{constructor(t){super(t),this._bars=new Go(this._contentLayer,On)}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,(t,e)=>{}),t}render(t,e,s,i,r,o){const n=t._categories||[],{min:a,max:h,base:l}=t.getPointExtents(s,e),c=i/s.length,d=c*t.options.barWidth;this._bars.forEach((t,e)=>{const i=s[e];if(t.setVisible(!isNaN(i))){const s=c*e+(c-d)/2,l=(i-a)/(h-a)*r*o;t.setPath(Ct.bar(s,r,d,-l,0,0)),t.internalClearStyleAndClass(),n[e]&&n[e].color&&t.setFill(n[e].color)}}),this._renderBaseLine(t.baseLine,!1,i,r)}}class Bn extends xn{tooltipColor(){return getComputedStyle(this.dom).fill}}class zn extends $t{static create(t,e,s,i,r,o,n,a,h=!0){return new zn(t,e,{cx:s,cy:i,rx:r,ry:o,innerRadius:0,start:n,angle:a,clockwise:h})}static createInner(t,e="",s,i,r,o,n,a,h,l=!0){return new zn(t,e,{cx:s,cy:i,rx:r,ry:o,innerRadius:n,start:a,angle:h,clockwise:l})}constructor(t,e=M,s=M){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 Ct.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 Ct.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 jn=function(t){return isNaN(t)?0:t};class Hn{constructor(){this._path=[]}clear(){return this._path=[],this}end(t=!1){t&&this._path.push("Z");const e=this._path.join(" ");return this._path=[],e}close(){return this.end(!0)}move(t,e){return a(t)?this._path.push("M",jn(t),jn(e)):this._path.push("M",jn(t.x),jn(t.y)),this}moveBy(t,e){return a(t)?this._path.push("m",jn(t),jn(e)):this._path.push("m",jn(t.x),jn(t.y)),this}movep(t,e){return a(t)?this._path.push("M",F(t),F(e)):this._path.push("M",F(t.x),F(t.y)),this}line(t,e){return a(t)?this._path.push("L",jn(t),jn(e)):this._path.push("L",jn(t.x),jn(t.y)),this}linep(t,e){return a(t)?this._path.push("L",F(t),F(e)):this._path.push("L",F(t.x),F(t.y)),this}curve(t,e,s,i,r,o){return this._path.push("C",t,e,s,i,r,o),this}q(t,e,s,i){return this._path.push("Q",t,e,s,i),this}rect(t,e,s,i){return this._path.push("M",t,e,"l",s,0,"l",0,i,"l",-s,0),this}lines(...t){if(a(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",jn(t[e]),jn(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",jn(t[e].x),jn(t[e].y));return this}polygon(...t){return this.lines(...t),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}}class Gn extends $t{render(t,e){const s=t.getExtents(e);if(s.radius!==this._radius||s.length!==this._length||s.offset!==this._offset){const t=this._radius=s.radius,e=this._offset=s.offset;if(this._length=s.length,this._radius>0&&this._length>0){const s=new Hn;s.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(s.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let Yn=class extends $t{render(t,e){const s=t.getRadius(e);return s!==this._radius&&(this._radius=s,this.setPath((new Hn).circle(0,0,s).end())),this.internalResetStyleOrClass(t._style),this}};class Wn extends Mn{constructor(t){super(t),this.add(this._faceView=new zn(t,"rm-circle-gauge-face")),this.add(this._rimView=new zn(t,"rm-circle-gauge-rim")),this.add(this._valueView=new zn(t,"rm-circle-gauge-value")),this.add(this._textView=new Ie(t,"rm-circle-gauge-text")),this.add(this._handContainer=new Dt(t))}prepare(t,e){this._faceView.setVisible(e.face.visible),this._rimView.setVisible(e.rim.visible),this._valueView.setVisible(e.valueRim.visible),e.hand.visible?(this._handView||this._handContainer.add(this._handView=new Gn(t,"rm-circle-gauge-hand")),this._handView.visible=!0):this._handView&&(this._handView.visible=!1),e.pin.visible?(this._pinView||this._handContainer.add(this._pinView=new Yn(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible)&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,s,i){const r=t._props.getCenter(e,s),o=t._props.getExtents(p(e,s));this.$_renderBackground(t,r,o),this.$_renderValue(t,this.point,i)}$_renderBackground(t,e,s){const i=this._faceView,r=this._rimView,o=t._props,n=o._startRad;this._center=e,this._exts=s,i.visible&&(i.internalResetStyleOrClass(t.face._style),i.setSector({cx:e.x,cy:e.y,rx:s.radius-s.radiusThick,ry:s.radius-s.radiusThick,innerRadius:0,start:0,angle:2*Math.PI})),r.visible&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:e.x,cy:e.y,rx:s.radius,ry:s.radius,innerRadius:1-s.radiusThick/s.radius,start:n,angle:o._sweepRad,clockwise:t.options.clockwise}));let a=s.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,s){const i=t.options,r=t._props,o=e.getValue(),n=t.getValueRate(o)*s,a=this._center,h=this._exts,l=t.valueRim.getThickness(h.radiusThick),c=this._textView;if(this._valueView.visible){const e=t.valueRim,s=e.options,o=h.value+(s.stroked?0:l/2),c=this._valueView;c.internalResetStyleOrClass(e._style),s.stroked&&(c.setFill("none"),c.setStyle("strokeWidth",O(l))),c.setBoolData("stroked",s.stroked),c.setSectorEx({cx:a.x,cy:a.y,rx:o,ry:o,innerRadius:(o-l)/o,start:r._startRad,angle:r._sweepRad*n,clockwise:i.clockwise},s.stroked)}if(c.visible){const e=t.gaugeLabel;c.text=e.getNumberText(o,!1,!1,void 0),e.buildSvg(c,null,NaN,NaN,t,e._domain);const s=c.bbox(),i=e.getOffset(this.width,this.height);c.trans(a.x+i.x,a.y-s.height/2+i.y)}}}class Zn extends Vt{constructor(t,e,s,i,r){super(t,e,"circle"),"number"==typeof s&&this.setCircle(s,i,r)}setCircle(t,e,s){this.setAttrs({cx:t,cy:e,r:s})}}class Un extends mt{constructor(t,e){super(),this.view=t,this.gauge=e}_doUpdate(t){return this.view._secRate=t,this.view.$_renderHands(this.gauge,this.view._exts),!0}}class Xn extends Mn{constructor(e){super(e),this._rimThick=0,this._secRate=1,this.add(this._faceView=new Zn(e,"rm-clock-gauge-face")),this.add(this._rimView=new zn(e,"rm-clock-gauge-rim")),this.add(this._labelView=new Ie(e,"rm-clock-gauge-label")),this._labelView.layout=t.TextLayout.MIDDLE,this.add(this._tickContainer=new Dt(e,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new Dt(e,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new $t(e,"rm-clock-gauge-hour")),this.add(this._minuteView=new $t(e,"rm-clock-gauge-minute")),this.add(this._secondView=new $t(e,"rm-clock-gauge-second")),this.add(this._pinView=new Zn(e,"rm-clock-gauge-pin")),this._tickViews=new Go(this._tickContainer,hn,"rm-clock-gauge-tick"),this._tickLabelViews=new Go(this._tickLabelContainer,Ie,"rm-clock-gauge-tick-label")}prepare(e,s){const i=Math.round(12/g(1,Math.floor(s.tickLabel.options.step)||1));this._tickViews.prepare(s.tick.visible?12:0),this._tickLabelViews.prepare(s.tickLabel.visible?i:0,e=>{e.layout=t.TextLayout.MIDDLE}),this._zoneCallback=s.options.timezoneCallback}render(t,e,s){const i=this.point,r=this._exts=t.getExtents(e,s);this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.options.active&&isNaN(+i.time)?this._runner||(this._runner=setInterval(()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),m(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.options.animatable&&this.$_moveSecond(t,e)},1e3)):this._runner&&(clearInterval(this._runner),this._runner=void 0)}$_renderFace(t,e){const s=this._labelView,i=this._faceView,r=this._rimView,o=this._tickLabelViews,n=this._pinView,{cx:a,cy:h,rd:l}=e,c=this._rimThick=r.visible?t.rim.getThickness(l):0,d=t.tick.options.length||0;i.setVisible(t.face.visible)&&(i.internalResetStyleOrClass(t.face._style),i.setCircle(a,h,l)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:l,ry:l,innerRadius:1-c/l,start:0,angle:2*Math.PI,clockwise:!0}));const p=l-c;let g=p-d,m=N,f=I/12;if(this._tickViews.forEach((e,s)=>{e.setLine(a+_(m)*p,h+u(m)*p,a+_(m)*g,h+u(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f}),!o.isEmpty){const e=12/o.count,s=I/12*e;m=N,o.get(0).text="12",g=p-(d+t.tickLabel.options.offset||0),g-=.5*o.get(0).bbox().height,o.forEach((i,r,o)=>{i.text=String(0===r?12:r*e),i.trans(a+_(m)*g,h+u(m)*g),i.internalResetStyleOrClass(t.tickLabel._style),m+=s})}n.setVisible(t.pin.visible)&&(n.setCircle(a,h,t.pin.options.radius||2),n.internalResetStyleOrClass(t.pin._style)),s.setVisible(t.gaugeLabel.visible)&&(s.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(s,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.options.position?s.trans(a,h+g/2):s.trans(a,h-g/2))}$_getNow(t){var e;let s=t.getTime();if(!s){s=new Date;const i=y(t.timezone,null===(e=this._zoneCallback)||void 0===e?void 0:e.call(this,t.coord[0],t.coord[1]),60*Math.round(t.coord[0]/15)),r=s.getMinutes()+s.getTimezoneOffset()+i;s.setMinutes(r)}return s}$_renderHands(t,e){const s=this.$_getNow(this.point),i=s.getHours(),r=s.getMinutes(),o=s.getSeconds(),n=i>=12,{cx:a,cy:h,rd:l}=e,c=new Hn;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=I*(i/12+r/60/12+o/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),n&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*E)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=I*(r/60+o/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),n&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*E)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?I*(this._aniSec+this._secRate)/60:I*o/60,u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),n&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*E),this._prevSec=o)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const s=new Un(this,t);s.duration=t.secondHand.options.duration||200,s.start()}}}const Kn="rm-map-series-id-";let qn=class t extends fn{static idClass(t){return Kn+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(Kn))return e.substring(17)}constructor(t){super(t)}render(e,s,i){const r=this.model,o=!this.point||this.point.isNull;e!==r&&this.setPath((this.model=e).path),i&&(this.setBoolData("null",o),o&&s&&this.internalSetStyleOrClass(s),this.dom.classList.add(t.idClass(e)))}reset(){this.model=null}};class Jn extends fn{constructor(t){super(t,!0),this.add(this._figure=new $t(t)),this.add(this._textView=new qo(t,"rm-figure-series-inner-label"))}render(t,e,s){const i=this._textView,r=s.options.text;this._figure.setPath(e),i.internalResetStyleOrClass(s._style),i.setModel(t,s,null,null),s.prepareRich(r),s.buildSvg(i._text,i._outline,NaN,NaN,s,s.getTextDomain(this.point)),i.layout();const o=this.bbox(),n=i.bbox(),a=Nt.getPadding(i._text.dom),h=o.width-a.left-a.right,l=o.height-a.top-a.bottom;i.trans(a.left+(h-n.width)/2,(l-n.height)/2+a.top)}layout(){const t=this._textView,e=this.bbox(),s=t.bbox(),i=Nt.getPadding(t._text.dom),r=e.width-i.left-i.right,o=e.height-i.top-i.bottom;t.trans(i.left+(r-s.width)/2,(o-s.height)/2+i.top)}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class Qn extends fn{constructor(t){super(t,!0),this.add(this._imageView=new Io(t,!1))}setImage(t,e,s){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(s)||(this._imageView.height=s)}}let ta=class extends Ln{constructor(t){super(t),this._contentLayer.addAll(this._back=new Qe(t),this._area=new $t(t,"rm-line-series-area"),this._line=new $t(t,"rm-line-series-line"),this._lowLine=new $t(t))}render(t,e,s,i,r,o){const{min:n,max:a,base:h}=t.getPointExtents(s,e),l=this.$_getPts(s,n,a,i,r),c=s.length,d=c>2&&t.options.curved,_=new Hn;if(this.resize(i,r),this._back.setVisible(!1)&&(this._back.resize(i,r),this._back.setStroke("none")),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}if(this._line.setPath(_.end()),this._area.setVisible(t.area.visible)){if(this._area.internalResetStyleOrClass(t.area._style),d)_.move(l[0]),this._drawSpline(l,0,l.length-1,_);else if(c>1){_.move(l[0]);for(let t=1;t<c;t++)_.line(l[t])}_.line(l[c-1].x,r),_.line(l[0].x,r),this._area.setPath(_.end(!0))}this._renderBaseLine(t.baseLine,!1,i,r)}$_getPts(t,e,s,i,r){const o=t.length,n=[];let a=.05*i,h=.1*r;const l=s-e;i-=.1*i,r-=.2*r;for(let s=0;s<o;s++){const c=t[s],d=a+s/(o-1)*i,_=h+(isNaN(c)||0==l?r:(1-(c-e)/l)*r);n.push({x:d,y:_})}return n}};class ea{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),s=this.$_left(t,e);return null==s||s.addEventListener("finish",()=>{e.dom.remove()}),s}$_aniOptions(){return{duration:mt.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:O(t.width)}],this.$_aniOptions())}}const sa="rm-map-series-id-";class ia extends fn{static idClass(t){return sa+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(sa))return e.substring(17)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,s){const i=this.point;if(s){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.setBoolData("selected",!1),this.internalSetStyleOrClass(e);else{const e=!this.point||i.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(ia.idClass(this.model))}this.setBoolData("selected",i&&i._selected)}reset(){this.model=null}}class ra extends $t{constructor(t){super(t,"rm-map-series-inset")}render(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=Q(t.frame),o=e.model,n=o.h1-r.l,a=o.h2+r.r,h=o.v2+r.t,l=o.v1-r.b,c=[s.project([n,h]),s.project([a,h]),s.project([a,l]),s.project([n,l])];i=`M${c[0][0]} ${c[0][1]} L${c[1][0]} ${c[1][1]} ${c[2][0]} ${c[2][1]} ${c[3][0]} ${c[3][1]} Z`}else if(t.border){const r=n(t.border)?Ci(t.border,e.model):t.border,o=r.length;let a=s.project([r[0],r[1]]);i=`M${a[0]} ${a[1]}`;for(let t=2;t<o;t+=2)a=s.project([r[t],r[t+1]]),i+=` L${a[0]} ${a[1]}`;"z"===r[o-1]&&(i+=" z")}i&&this.setPath(i)}}render2(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=Q(t.frame);let o=1/0,n=1/0,a=-1/0,h=-1/0;for(const t of e){const e=t.model;o=p(o,e.h1),n=p(n,e.v1),a=g(a,e.h2),h=g(h,e.v2)}const l=o-r.l,c=a+r.r,d=h+r.t,_=n-r.b,u=[s.project([l,d]),s.project([c,d]),s.project([c,_]),s.project([l,_])];i=`M${u[0][0]} ${u[0][1]} L${u[1][0]} ${u[1][1]} ${u[2][0]} ${u[2][1]} ${u[3][0]} ${u[3][1]} Z`}else if(t.border){let r=1/0,o=1/0,a=-1/0,h=-1/0;for(const t of e){const e=t.model;r=p(r,e.h1),o=p(o,e.v1),a=g(a,e.h2),h=g(h,e.v2)}const l=n(t.border)?Ci(t.border,{h1:r,h2:a,v1:o,v2:h}):t.border,c=l.length;let d=s.project([l[0],l[1]]);i=`M${d[0]} ${d[1]}`;for(let t=2;t<c;t+=2)d=s.project([l[t],l[t+1]]),i+=` L${d[0]} ${d[1]}`;"z"===l[c-1]&&(i+=" z")}i&&this.setPath(i)}}render3(t,e,s){if(t!==this.model){let i;if(this.model=t,n(t.frame)&&t.frame.length>0){const r=t.offset||[0,0],o=Q(t.frame),n=e.h1+(r[0]||0)-o.l,a=e.h2+(r[0]||0)+o.r,h=e.v2+(r[1]||0)+o.t,l=e.v1+(r[1]||0)-o.b,c=[s.project([n,h]),s.project([a,h]),s.project([a,l]),s.project([n,l])];i=`M${c[0][0]} ${c[0][1]} L${c[1][0]} ${c[1][1]} ${c[2][0]} ${c[2][1]} ${c[3][0]} ${c[3][1]} Z`}else if(t.border){const r=t.offset||[0,0],o=n(t.border)?Ci(t.border,e):t.border,a=o.length;let h=s.project([o[0]+(r[0]||0),o[1]+(r[1]||0)]);i=`M${h[0]} ${h[1]}`;for(let t=2;t<a;t+=2)h=s.project([o[t]+(r[0]||0),o[t+1]+(r[1]||0)]),i+=` L${h[0]} ${h[1]}`;"z"===o[a-1]&&(i+=" z")}i&&this.setPath(i)}}}class oa extends Bo{constructor(t,e,s){super(t,e),this._paddings=new Oo,this.add(this._background=new $t(t,s)),this.add(this._textView=new Ie(t))}setPoint(t){return this._point=t,this}measure(t,e,s,i){this._prepareStyleOrClass(e),this.setModel(e);const r=e.options.text;r?(e.prepareRich(r),e.buildSvg(this._textView,s,i,e.getTextDomain(this._point))):this._textView.text="";const n=this._textView.bbox();let a=this.model.options.backgroundStyle;o(a)&&(a=a(e.series.getPointCallbackArgs(this._point))),this._background.internalClearStyleAndClass(),this._setBackgroundStyle(this._background,a);let h=getComputedStyle(this._background.dom);const l=this._paddings;l.applyPadding(h);const c=this._doMeasure(t,e,s,i);return this.mw=c.width=l.left+l.right+n.width,this.mw=c.height=l.top+l.bottom+n.height,c}_doLayout(e){const s=this._textView,i=this.width;let r=0;this._renderBackgrouond(this._background,i,this.height,e);switch(getComputedStyle(s.dom).textAlign){case"center":r+=i/2,s.anchor=t.TextAnchor.MIDDLE;break;case"right":r+=i,s.anchor=t.TextAnchor.END;break;default:s.anchor=t.TextAnchor.START}s.trans(r,this._paddings.top)}}class na extends oa{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){this.model.options.backgroundStyle,t.setStyleOrClass(e)}_renderBackgrouond(t,e,s,i){t.setPath(Ct.bar(0,s,e,-s,i,0))}}class aa extends oa{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.setStyleOrClass(e)}_renderBackgrouond(t,e,s,i){t.setPath(Ct.bar(0,s,e,-s,0,i))}}class ha extends fn{constructor(t){super(t,!0),this.add(this._backView=new Qe(t,"rm-panel-series-back")),this.add(this._headerView=new na(t)),this.add(this._bodyView=new aa(t)),this.add(this._divider=new hn(t))}render(t,e,s,i,r){const o=this.point,n=e.header,a=e.body,h=this._headerView,l=this._bodyView,c=this._divider;let d,_;h.setVisible(n.visible)&&(h.internalResetStyleOrClass(n._style),d=h.setPoint(o).measure(t,n,s,i)),this._divider.setVisible(h.visible),l.internalResetStyleOrClass(a._style),_=l.setPoint(o).measure(t,a,s,i);let u=_.width,p=_.height;h.visible&&(u=Math.max(u,d.width),p+=d.height);const g=e.getExtents(u,p);h.visible&&(h.resize(g.width,d.height),h.layout(r),c.setVisible(e.divider.visible)&&(c.trans(0,d.height),c.setHLine(0,0,g.width))),l.resize(g.width,g.height-d.height),l.transY(d.height),l.layout(r),this._backView.setBounds(0,0,g.width,g.height,r)}}class la extends zn{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class ca extends Cn{constructor(t){super(t,!0),this._sectors=new Go(this,la,null,.5),this._rdRate=1,this.add(this._circle=new Zn(t)),this._circle.setStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,s){const i=this.point.values;this._sectors.prepare(i.length,(t,e)=>{t.value=i[e]}),this._rd=e,this.$_layoutSectors(t,s)}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e){const s=this.point.values,i=t.options,r=s.length,o=i.clockwise?1:-1,n=s.reduce((t,e)=>t+e,0),a=t._totalRad*e;let h=t._startRad;if(this._sectors.prepare(s.length,(t,e)=>{t.value=s[e]}),r>1)this._sectors.forEach(t=>{if(!isNaN(t.value)){const e=t.value/n||0;t.start=h,h+=t.angle=o*e*a}});else if(1==r){const t=this._sectors.get(0);t.start=h,t.angle=a}}$_layoutSectors(t,e){const s=t._categories||[],i=t.options.clockwise,r=0,o=0,n=this._cx=r,a=this._cy=o,h=this._rd;this.$_calcAngles(t,e),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(this._cx,this._cy,this._rd),this._sectors.forEach((t,e)=>{const r=t.value;if(isNaN(r))t.setVisible(!1);else{const r=t.start;let o=0,l=0;t.trans(o,l).setVisible(!0),t.setPieSector({cx:n,cy:a,rx:h,ry:h,innerRadius:0,start:r,angle:m(t.angle),clockwise:i}),t.internalClearStyleAndClass(),s[e]&&s[e].color&&t.setFill(s[e].color)}})}}class da extends xn{constructor(t){super(t,!0),this.add(this._pin=new $t(t))}render(t){this._pin.setPath(Ct.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new Zn(this.doc,"rm-pin-series-inner")),this._circle.setCircle(t.cx,t.cy,t.innerRd)):this._circle&&(this._circle.remove(),this._circle=null)}tooltipColor(){return getComputedStyle(this._pin.dom).fill}}class _a extends xn{}class ua extends fn{constructor(t){super(t,!0),this.add(this._line=new $t(t)),this.add(this._arrow=new $t(t))}render(t,e,s,i){if(s.length>1){const t=s[s.length-2],r=s[s.length-1],o=$(Math.atan2(r[1]-t[1],r[0]-t[0]))-90,n="M"+s.map(t=>`${t[0]},${t[1]}`).join(" L");this._line.setPath(n),this._arrow.setVisible(i)&&(this._arrow.setPath(`M ${r[0]} ${r[1]} L ${r[0]-5*e} ${r[1]-13*e} L ${r[0]+5*e} ${r[1]-13*e} Z`),this._arrow.setRotation(r[0],r[1],o))}else this._line.setPath(""),this._arrow.setPath("")}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this}}class pa extends xn{}class ga extends Cn{constructor(t){super(t,!0),this._cells=new Go(this,$t)}render(t,e,s,i){const r=t.getPointGrid(this.point,e,i);this.$_prepareCells(Math.round(r.count),s.wCell,s.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,s)}$_prepareCells(t,e,s){this._cells.prepare(t,t=>{t.setPath(Ct.square(0,0,e,s))})}$_layoutCells(t,e,s,i,r){const o=s*r.hCell+(s-1)*r.gap;let n=0,a=0;this._cells.forEach((t,s,i)=>{isNaN(e[n][a])&&(n++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),o-n*r.hCell-(n>0?n*r.gap:0)),a++})}}class ma extends Sn{constructor(t){super(t,"rm-waffle-series"),this._waffles=new dn(this._pointContainer,ga)}_getPointPool(){return this._waffles}_doPrepeare(t,e,s){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const s=e.length,i=this._getSeriesExt(t,e);this._waffles.prepare(s,(s,r)=>{const o=s.prepare(e[r],i);this._setPointStyle(s,t,o)})}$_layoutWaffles(t,e,s){const i=this.model,r=i.getWaffleInfo(),o=i.chart.getProjection(this._second),n=+i.options.rotation||0,a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_={...this._getSeriesExt(i,i._visPoints),gap:i.options.gap},u=i.getCallout(),p=this._calloutViews();let g,m,f;this._waffles.forEach((t,e)=>{const b=t.point,y=[b.lon,b.lat];if(t.setVisible(!b.isNull&&null!=(g=o.getVisible(y)))){const e=this._getPointPositioner(b.position||h,"top");let w,x,v,C,S,L;u&&(w=b.getCallout(y))&&(x=w.map(t=>o.project(t)),g=x[x.length-1]),b.xPos=v=g[0],b.yPos=C=g[1],v*=a[0],C*=a[1],t.render(i,_,r,s),m=t.bbox(),f=e(v,C,m.width,m.height),t.trans(f.x,f.y).rotate(n),d&&(S=d.get(b,0))&&this._layoutLabel(S,t.dom).transp(l(f.x+m.width/2,f.y+m.height/2,S.bbox(),m.width/2,m.height/2,c)),p&&x&&(L=p.get(b))&&L.render(u,b,x.flat().map((t,e)=>t*a[e%2]),null)}})}}function fa(t,e){return new(Zo[e._type()])(t)}wn.register([Ur,class extends wn{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new dn(this._pointContainer,ia),this._insetPool=new Go(this._pointContainer,ra)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,s;const r=this._hoverArea;if(t!==r){const o=this.model;if(r&&(r.setBoolData(wn.DATA_HOVER,!1),r.point&&(null===(e=this._labelContainer.get(r.point,0))||void 0===e||e._text.setBoolData(wn.DATA_HOVER,!1))),!t||t.point||o.options.nullHovering||(t=void 0),this._hoverArea=t,t){const e=this.model.options,r=document.querySelector(".rm-root");let o=e.hoverColor,n=this.model.pointLabel.options.hoverColor;!o&&i(e.hoverStyle)&&(o=e.hoverStyle.fill),r.style.setProperty("--map-series-hover-fill",o||""),r.style.setProperty("--map-series-hover-label-fill",n||""),t.setBoolData(wn.DATA_HOVER,!0),t.point&&(null===(s=this._labelContainer.get(t.point,0))||void 0===s||s._text.setBoolData(wn.DATA_HOVER,!0))}t!=r&&o.chart._hoverAreaChanged(o,null==t?void 0:t.model,null==r?void 0:r.model)}}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=ia.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}_doPrepeare(t,e,s){const i=!ct,r=this._second,o=this._insets=[],n=e.options.bringToFront?[]:null;this._areaPool.prepare(e.areaCount,(t,s)=>{const a=e.get(r,s),h=t.point=e.pointOf(a);t.setModel(a),h?(a.dummy||this._setPointStyle(t,e,h),n&&n.push(t)):t.internalClearStyleAndClass(),i&&t.setStyle("vectorEffect","non-scaling-stroke"),a.inset&&o.push(a.inset)}),e._maxZindex>0&&this._areaPool.sort((t,e)=>{let s,i;return(s=t.point)?(i=e.point)?isNaN(s._zindex)?isNaN(i._zindex)?0:-1:isNaN(i._zindex)?1:s._zindex-i._zindex:1:e.point?-1:0}),o.push(...e.chart.map._insets),n&&n.length!==e.areaCount&&n.forEach(t=>{t.parent.moveToLast(t)}),this._insetPool.prepare(o.length,(t,e)=>{i&&t.setStyle("vectorEffect","non-scaling-stroke")})}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach(t=>{t.visible&&t.reset()})}_doPointerMoved(t,e,s){const i=this.areaOfDom(s);return this.hoverArea=i,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const s=this.chart(),i=this._second,r=s.isDirty,o=s.body,n=this.model,a=n.options,h=s.getProjection(i),l=this._areas={},c=this._insets,d=a.allAreas;n.pointLabel.options.position;const _=this._labelViews(),u=a.nullStyle,p=a.dummyStyle,g=this._scale;this._areaPool.forEach((t,e)=>{const s=t.model;if(s){const e=t.point,i=_&&e&&_.get(e,0);if(l[s.id]=t,t.setVisible(s.visible&&(d||!!e))){if(t.render(u,p,r),i){const s=h.project(n.getCenter(e));if(i.setVisible(o.isVisible(s))){i._model,r&&this._layoutLabel(i,t.dom);const o=i.bbox();let[n,a]=s;e.xPos=n,e.yPos=a,n*=g,a*=-g,n-=o.width/2,a-=o.height/2,i.trans(n,a)}}}else i&&i.setVisible(!1)}}),this._insetPool.forEach((t,e)=>{const s=c[e],i=l[s.area];if(i)t.setVisible(i.visible)&&t.render(s,i,h);else{const e=s._base;if(e[0]instanceof Di)t.render2(s,e.map(t=>l[t.id]),h);else if(e[0]>=0){const i=o.map.areaOf(s.parent);if(i){const r=i.readBounds(e);t.render3(s,r,h)}}}})}}],[Dr,class extends wn{constructor(t){super(t,"rm-map-series"),this._areas={},this._areaPool=new dn(this._pointContainer,qn)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e,s;const r=this._hoverArea;if(t!==r){const o=this.model;if(r&&(r.setBoolData(wn.DATA_HOVER,!1),r.point&&(null===(e=this._labelContainer.get(r.point,0))||void 0===e||e._text.setBoolData(wn.DATA_HOVER,!1))),t&&!t.point&&(t=void 0),this._hoverArea=t,t){const e=this.model.options,r=document.querySelector(".rm-root");let o=e.hoverColor,n=this.model.pointLabel.options.hoverColor;!o&&i(e.hoverStyle)&&(o=e.hoverStyle.fill),r.style.setProperty("--map-series-hover-fill",o||""),r.style.setProperty("--map-series-hover-label-fill",n||""),t.setBoolData(wn.DATA_HOVER,!0),t.point&&(null===(s=this._labelContainer.get(t.point,0))||void 0===s||s._text.setBoolData(wn.DATA_HOVER,!0))}t!=r&&o.chart._hoverAreaChanged(o,null==t?void 0:t.model,null==r?void 0:r.model)}}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=qn.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}_doPrepeare(t,e,s){this._second;const i=e.options.bringToFront?[]:null;this._areaPool.prepare(e.areaCount,(t,e)=>{}),i&&i.length!==e.areaCount&&i.forEach(t=>{t.parent.moveToLast(t)})}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach(t=>{t.visible&&t.reset()})}_doPointerMoved(t,e,s){const i=this.areaOfDom(s);return this.hoverArea=i,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}$_layoutAreas(t,e){const s=this.chart(),i=this._second;s.isDirty,s.body;const r=this.model;r.options,s.getProjection(i),this._areas={},r.pointLabel,this._labelViews(),this._scale,this._areaPool.forEach((t,e)=>{})}}],[ho,class extends vn{constructor(t){super(t,"rm-point-series")}_createMarkers(t){return new dn(t,_a)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers()}_doReset(){}$_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)})}$_layoutMarkers(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),s=this._getGrowRate(),i=this.model,r=Math.max(0,i.getRadius()),o=[this._scale,-this._scale],n=+i.options.rotation||0,a=i.options.position,h=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),l=this._labelViews(),c=i.getLabelOff(),d=i.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(u=e.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"center"),y=(g._radius||r)*s,w=wn.getDrawer(i.getShape(f));let x,v,C,S,L,A;if(d&&(x=f.getCallout(b))&&(v=x.map(t=>e.project(t)),u=v[v.length-1]),f.xPos=C=u[0],f.xPos=S=u[1],C*=o[0],S*=o[1],p=m(C,S,2*y,2*y),p.x+=y,p.y+=y,t&&g.setPath(w(y,y)),g.trans(p.x,p.y).rotate(n),l&&(L=l.get(f,0))&&(t&&this._layoutLabel(L,g.dom),L.transp(h(p.x,p.y,L.bbox(),y,y,c))),_&&v&&(A=_.get(f))){const t=v.flat().map((t,e)=>t*o[e%2]);_.setMask(A,t).setCircle(t[t.length-2],t[t.length-1],y),A.render(d,f,t,null)}}})}}],[oo,class extends vn{constructor(t){super(t,"rm-pin-series")}_createMarkers(t){return new dn(t,da)}_doPrepeare(t,e,s){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(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)})}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(this._second),s=this._getGrowRate(),i=this.model,r=[this._scale,-this._scale],o=+i.options.rotation||0,n=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom");i.pointLabel.options.position;const h=this._labelViews(),l=i.getLabelOff(),c=i.getCallout(),d=this._calloutViews();let _,u;this._markers.forEach((p,g)=>{const m=p.point,f=[m.lon,m.lat];if(p.setVisible(!m.isNull&&null!=(_=e.getVisible(f)))){const g=this._getPointPositioner(m.position||n,"top"),b=i.getExt(m,s),y=2*b.rd,w=3*b.rd;let x,v,C,S,L,A;c&&(x=m.getCallout(f))&&(v=x.map(t=>e.project(t)),_=v[v.length-1]),m.xPos=C=_[0],m.yPos=S=_[1],C*=r[0],S*=r[1],u=g(C,S,y,w),t&&p.render(b),p.trans(u.x+y/2,u.y+w).rotate(o),h&&(L=h.get(m,0))&&(t&&this._layoutLabel(L,p.dom),L.transp(a(u.x+y/2,u.y+w/2,L.bbox(),y/2,w/2,l))),d&&v&&(A=d.get(m))&&A.render(c,m,v.flat().map((t,e)=>t*r[e%2]),null)}})}}],[po,class extends vn{constructor(t){super(t,"rm-Vector-series")}_createMarkers(t){return new dn(t,pa)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers()}_doReset(){}$_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)})}$_layoutMarkers(){this.chart().isDirty;const t=this.model.chart.getProjection(this._second);this._getGrowRate();const e=this.model;this._scale,e.options.rotation;e.pointLabel.options.position,this._labelViews(),e.getLabelOff(),e.getCallout(),this._calloutViews(),this._markers.forEach((e,s)=>{const i=e.point,r=[i.lon,i.lat];e.setVisible(!i.isNull&&null!=t.getVisible(r))})}}],[dr,class extends An{constructor(t){super(t,"rm-bar-series"),this._labelInfo={},this._bars=new dn(this._pointContainer,Fn)}_getPointPool(){return this._bars}_doPrepeare(t,e,s){super._doPrepeare(t,e,s),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){this._bars.prepare(e.length,(s,i)=>{const r=s.prepare(e[i],null);this._setPointStyle(s,t,r)})}$_layoutBars(t,e,s){const i=this.model,r=!i._pointDomain,o=this._getSeriesExt(i,this._visPoints),n=i.chart.getProjection(this._second),a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=i.getCallout(),u=this._calloutViews();let p,g;this._bars.forEach((t,e)=>{const m=t.point,f=i.getCoord(m);if(t.setVisible(!m.isNull&&null!=(p=n.getVisible(f)))){const e=this._getPointPositioner(m.position||h,"center"),b=t.getSizeRate(t._ext.max,o),y=this._ext.width*b,w=this._ext.height*b;let x,v,C,S,L,A;_&&(x=m.getCallout(f))&&(v=x.map(t=>n.project(t)),p=v[v.length-1]),m.xPos=C=p[0],m.yPos=S=p[1],C*=a[0],S*=a[1],g=e(C,S,y,w),t.render(i,r&&o,m.values,y,w,s),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(A=u.get(m))&&A.render(_,m,v.flat().map((t,e)=>t*a[e%2]),null)}})}}],[Gr,class extends An{constructor(t){super(t,"rm-line-series"),this._lines=new dn(this._pointContainer,ta)}_getPointPool(){return this._lines}_doPrepeare(t,e,s){super._doPrepeare(t,e,s),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,b(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach(t=>new ea(t))}$_prepareLines(t,e){this._lines.prepare(e.length,(s,i)=>{const r=s.prepare(e[i],null);this._setPointStyle(s,t,r)})}$_layoutLines(t,e,s){const i=this.model,r=!i._pointDomain,o=this._getSeriesExt(i,this._visPoints),n=i.chart.getProjection(this._second),a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),c=i.getLabelOff(),d=this._labelViews(),_=i.getCallout(),u=this._calloutViews();let p,g;this._lines.forEach((t,e)=>{const m=t.point,f=[m.lon,m.lat];if(t.setVisible(!m.isNull&&null!=(p=n.getVisible(f)))){const e=this._getPointPositioner(m.position||h,"top"),b=t.getSizeRate(t._ext.max,o),y=this._ext.width*b,w=this._ext.height*b;let x,v,C,S,L,A;_&&(x=m.getCallout(f))&&(v=x.map(t=>n.project(t)),p=v[v.length-1]),m.xPos=C=p[0],m.yPos=S=p[1],C*=a[0],S*=a[1],g=e(C,S,y,w),t.render(i,r&&o,m.values,y,w,s),t.trans(g.x,g.y).rotate(this.rotation),d&&(L=d.get(m,0))&&L.layout().transp(l(g.x+y/2,g.y+w/2,L.bbox(),y/2,w/2,c)),u&&v&&(A=u.get(m))&&A.render(_,m,v.flat().map((t,e)=>t*a[e%2]),null)}})}}],[so,class extends Sn{constructor(t){super(t,"rm-pie-series"),this._pies=new dn(this._pointContainer,ca)}_getPointPool(){return this._pies}_doPrepeare(t,e,s){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const s=e.length,i=this._getSeriesExt(t,e);this._pies.prepare(s,(s,r)=>{const o=s.prepare(e[r],i);this._setPointStyle(s,t,o)})}$_layoutPies(t,e,s){const i=this.model,r=i.chart.getProjection(this._second),o=[this._scale,-this._scale],n=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),h=i.getLabelOff(),l=this._labelViews(),c=i.getCallout(),d=this._calloutViews(),_=i.getRadius(Math.min(t,e));let u,p;this._pies.forEach((t,e)=>{const g=t.point,m=i.getCoord(g);if(t.setVisible(!g.isNull&&null!=(u=r.getVisible(m)))){const e=this._getPointPositioner(g.position||n,"top"),f=_*t._rdRate;let b,y,w,x,v,C;c&&(b=g.getCallout(m))&&(y=b.map(t=>r.project(t)),u=y[y.length-1]),g.xPos=w=u[0],g.yPos=x=u[1],w*=o[0],x*=o[1],p=e(w,x,2*f,2*f),p.x+=f,p.y+=f,t.render(i,f,s),t.trans(p.x,p.y),l&&(v=l.get(g,0))&&v.layout().transp(a(p.x,p.y,v.bbox(),f,f,h)),d&&y&&(C=d.get(g))&&C.render(c,g,y.flat().map((t,e)=>t*o[e%2]),null)}})}}],[$r,class extends wn{constructor(t){super(t,"rm-lyph-series"),this._figures=new Go(this._pointContainer,Jn)}_doPrepeare(t,e,s){this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures()}_doReset(){}$_prepareFigures(t,e){const s=t.chart.isDirty,i=t.innerLabel,r=e.length;this._pointContainer.setFill(t._runColor),this._figures.prepare(r,(r,o)=>{const n=r.point=e[o];this._setPointStyle(r,t,n),s&&r.render(this.doc,t.getFigure(n),i)})}$_layoutFigures(){this.chart();const t=this.model.chart.getProjection(this._second),e=this.model,s=[this._scale,-this._scale],i=+e.options.rotation||0,r=e.options.position,o=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),n=this._labelViews(),a=e.getLabelOff(),h=e.getCallout(),l=this._calloutViews();let c,d;this._figures.forEach((e,_)=>{const u=e.point,p=[u.lon,u.lat];if(e.setVisible(!u.isNull&&null!=(c=t.getVisible(p)))){const _=this._getPointPositioner(u.position||r,"top");let g,m,f,b,y,w,x;if(h&&(g=u.getCallout(p))&&(m=g.map(e=>t.project(e)),c=m[m.length-1]),u.xPos=f=c[0],u.yPos=b=c[1],f*=s[0],b*=s[1],e.layout(),x=e.bbox(),d=_(f,b,x.width,x.height),e.trans(d.x,d.y).rotate(i),n&&(y=n.get(u,0))&&this._layoutLabel(y,e.dom).transp(o(d.x+x.width/2,d.y+x.height/2,y.bbox(),x.width/2,x.height/2,a)),l&&m&&(w=l.get(u))){const t=m.flat().map((t,e)=>t*s[e%2]);x.x=e.tx,x.y=e.ty,l.setMask(w,t).setRects(x),w.render(h,u,t,e.getFill())}}})}}],[mo,ma],[_o,class extends wn{constructor(t){super(t,"rm-route-series",!1),this._lines=new dn(this._pointContainer,ua)}_doInitStyles(){}_getPointPool(){return this._lines}_setPointColor(t,e){t._line.setStroke(e),t._arrow.setFill(e)}_doPrepeare(t,e,s){s&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(b(this.growRate,NaN))}_doReset(){}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){console.log("START POINT ADDING...")}_legendColorProp(){return"stroke"}$_prepareLines(t,e){const s=e.length,i=!ct;this._pointContainer.setStroke(t._runColor),this._lines.prepare(s,(s,r)=>{const o=s.point=e[r];this._setPointStyle(s,t,o),s._line.setFill("none"),s._arrow.setStroke("none"),i&&(s._line.setStyle("vectorEffect","non-scaling-stroke"),s._arrow.setStyle("vectorEffect","non-scaling-stroke"))})}$_layoutLines(t){const e=this.model,s=e.chart;if(s.isDirty||!isNaN(t)){const i=s.getProjection(this._second),r=e.options.lineWidth,o=e.options.arrowDisplay;if(ct){const t=b(r,2)/this._scale;this._pointContainer.setStyle("strokeWidth",`${t}px`)}else isNaN(r)||this._pointContainer.setStyle("strokeWidth",`${r}px`);t=b(t,1),this._lines.forEach((s,r)=>{this.$_layoutLine(s,e,i,t,o)})}}$_layoutLine(t,e,s,i,o){const a=t.point;if(i=b(a._vr,i),a._deleting&&(i=1-i),t.setVisible(!a.isNull)&&t.setVisible(!0))if(r(a.path)){const e=a.path,i=[];let r=0;for(;r<e.length;)n(e[r])?(i.push(e[r]),r++):(i.push(...s.project([e[r],e[r+1]])),r+=2);t._line.setPath(i.join(" "))}else{const r=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map(t=>s.project(t)).filter(t=>!t.outside);i<1&&(r.length=r.length*i|0),t.render(e,1/this._scale,r,"none"!==o&&(i<1||"moving"!==o))}}$_genPath3(t,e,s){const i=[],r=Math.min(.1,Math.max(0,this.model.options.bendFactor)),o=Math.log(1+(n=t[0],a=t[1],h=e[0],l=e[1],Math.sqrt((n-h)**2+(a-l)**2)))*r;var n,a,h,l;const c=this._calculateControlPoint(t,e,o);for(let r=0;r<=s;r++){const o=r/s,n=this.interpolate3(t,c,o),a=this.interpolate3(c,e,o),h=this.interpolate3(n,a,o);i.push(h)}return i}interpolate3(t,e,s){const i=R(t[1]),r=R(t[0]),o=R(e[1]),n=R(e[0]),a=Math.acos(Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos(n-r)),h=Math.sin((1-s)*a)/Math.sin(a),l=Math.sin(s*a)/Math.sin(a),c=h*Math.cos(i)*Math.cos(r)+l*Math.cos(o)*Math.cos(n),d=h*Math.cos(i)*Math.sin(r)+l*Math.cos(o)*Math.sin(n),_=h*Math.sin(i)+l*Math.sin(o),u=Math.sqrt(c*c+d*d+_*_),p=Math.asin(_/u);return[$(Math.atan2(d,c)),$(p)]}_calculateControlPoint(t,e,s){const i=s,r=this.interpolate3(t,e,.5),o=R(r[1]),n=R(r[0]),a=o+i*Math.sin(Math.PI/2);return[$(n+i*Math.cos(Math.PI/2)),$(a)]}}],[Is,class extends vn{constructor(t){super(t,"rm-bubble-series")}_createMarkers(t){return new dn(t,Bn)}_doPrepeare(t,e,s){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,b(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_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)})}$_layoutMarkers(t,e,s){const i=this.model,r=i.chart,o=r.getProjection(this._second),n=+i.options.rotation||0,a=[this._scale,-this._scale],h=i.options.position,l=this._getLabelPositioner(i.pointLabel.options.position,"center"),c=this._getLabelPositioner(i.subLabel.options.position,"right"),d=this._labelViews(),_=i.getLabelOff(),u=i.getSubLabelOff(),g=i.getCallout(),m=this._calloutViews(),{min:f,max:b}=i.getPixelMinMax(p(r.width,r.height));let y,w;this._markers.forEach((t,e)=>{const r=t.point,p=i.getCoord(r);if(t.setVisible(!r.isNull&&null!=(y=o.getVisible(p)))){const e=this._getPointPositioner(r.position||h,"center"),x=wn.getDrawer(i.getShape());let v,C,S,L,A,M,k=(t._radius=i.getRadius(r.getValue(),f,b))*s;g&&(v=r.getCallout(p))&&(C=v.map(t=>o.project(t)),y=C[C.length-1]),r.xPos=S=y[0],r.xPos=L=y[1],S*=a[0],L*=a[1],w=e(S,L,2*k,2*k),w.x+=k,w.y+=k;const P=()=>{t.setPath(x(k,k)),t.trans(w.x,w.y).rotate(n)},I=()=>{if(o instanceof Ni){const e=o.r,s=this.chart().width,i=p[1]*Math.PI/180,r=k/2*(360/s),n=r/Math.cos(i),a=r;o.r=Pi*this._scale;const h=Ko.geoCircle(p[0],p[1],n,a,o,!0);o.r=e,t.setPath(h),t.trans(0,0).rotate(0)}else P()};if(this.model.alignToSurface?I():P(),d&&((A=d.get(r,0))&&this._layoutLabel(A,t.dom).transp(l(w.x,w.y,A.bbox(),k,k,_)),(A=d.get(r,1))&&this._layoutLabel(A,t.dom).transp(c(w.x,w.y,A.bbox(),k,k,u))),m&&C&&(M=m.get(r))){const e=C.flat().map((t,e)=>t*a[e%2]);m.setMask(M,e).setCircle(e[e.length-2],e[e.length-1],k),M.render(g,r,e,t.getFill())}}})}}],[Br,class extends wn{constructor(t){super(t,"rm-image-series"),this._images=new dn(this._pointContainer,Qn)}_getPointPool(){return this._images}_doPrepeare(t,e,s){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(1)}_doReset(){}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,s=t.options.imageWidth,i=t.options.imageHeight;this._images.prepare(e.length,(r,o)=>{const n=r.point=e[o];r.setImage(t.getUrl(n),s,i),this._setPointStyle(r,t,n)})}_layoutPoints(t){const e=this.model,s=e.chart.getProjection(this._second),i=+e.options.rotation||0,r=[this._scale,-this._scale],o=e.options.position,n=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews();let d,_;this._images.forEach((t,u)=>{const p=t.point,g=e.getCoord(p);if(t.setVisible(!p.isNull&&null!=(d=s.getVisible(g)))){const e=this._getPointPositioner(p.position||o,"top");let u,m;const f=t.bbox(),b=f.width,y=f.height;let w,x,v,C;if(l&&(u=p.getCallout(g))&&(m=u.map(t=>s.project(t)),d=m[m.length-1]),p.xPos=w=d[0],p.yPos=x=d[1],w*=r[0],x*=r[1],_=e(w,x,b,y),t.trans(_.x,_.y).rotate(i),h&&(v=h.get(p,0))&&v.layout().transp(n(_.x+b/2,_.y+y/2,v.bbox(),b/2,y/2,a)),c&&m&&(C=c.get(p))){const e=m.flat().map((t,e)=>t*r[e%2]);f.x=t.tx,f.y=t.ty,c.setMask(C,e).setRects(f),C.render(l,p,e,t.getFill())}}})}}],[to,class extends wn{constructor(t){super(t,"rm-panel-series"),this._panels=new dn(this._pointContainer,ha)}_doPrepeare(t,e,s){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,1)}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}$_preparePanels(t,e){const s=e.length;this._panels.prepare(s,(s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r)})}$_layoutPanels(t,e,s,i){const r=this.model,o=r.chart.getProjection(this._second),n=[this._scale,-this._scale],a=r.options.position,h=this._getLabelPositioner(r.pointLabel.options.position,"bottom"),l=this._labelViews(),c=r.getLabelOff(),d=r.getCallout(),_=this._calloutViews(),u=getComputedStyle(this._pointContainer.dom),p=b(u.rx,0);let g,m,f;this._panels.forEach((i,u)=>{const b=i.point,y=r.getCoord(b);if(i.setVisible(!b.isNull&&null!=(g=o.getVisible(y)))){const u=this._getPointPositioner(b.position||a,"top");let w,x,v,C,S,L;if(d&&(w=b.getCallout(y))&&(x=w.map(t=>o.project(t)),g=x[x.length-1]),b.xPos=v=g[0],b.yPos=C=g[1],v*=n[0],C*=n[1],i.render(t,r,e,s,p),m=i.bbox(),f=u(v,C,m.width,m.height),i.trans(f.x,f.y),l&&(S=l.get(b,0))&&this._layoutLabel(S,i.dom).transp(h(f.x+m.width/2,f.y+m.height/2,S.bbox(),m.width/2,m.height/2,c)),_&&x&&(L=_.get(b))){const t=x.flat().map((t,e)=>t*n[e%2]);m.x=i.tx,m.y=i.ty,_.setMask(L,t).setRects(m),L.render(d,b,t,i.getFill())}}})}}],[mo,ma],[xr,class extends kn{constructor(t){super(t,"rm-circle-gauge")}_createGauges(t){return new dn(t,Wn)}_doPrepeare(t,e,s){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const s=this.model;this.$_layoutGauges(s._width,s._height,1)}_doReset(){}_runShowEffect(t){t&&Tn.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(s,(s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r),s.prepare(this.doc,t)})}$_layoutGauges(t,e,s){const i=this.model;i.chart.isDirty;const r=this.model.chart.getProjection(this._second),o=[this._scale,-this._scale],n=i.options.position,a=this._getLabelPositioner(i.pointLabel.options.position,"bottom"),h=this._labelViews(),l=i.getLabelOff(),c=i.getCallout(),d=this._calloutViews();let _,u,p;this._gauges.forEach((g,m)=>{const f=g.point,b=[f.lon,f.lat];if(g.setVisible(!f.isNull&&null!=(_=r.getVisible(b)))){const m=this._getPointPositioner(f.position||n,"top");let y,w,x,v,C,S;c&&(y=f.getCallout(b))&&(w=y.map(t=>r.project(t)),_=w[w.length-1]),f.xPos=x=_[0],f.yPos=v=_[1],x*=o[0],v*=o[1],g.render(i,t,e,s),u=g.bbox(),p=m(x,v,u.width,u.height),g.trans(p.x,p.y),h&&(C=h.get(f,0))&&this._layoutLabel(C,g.dom).transp(a(p.x+u.width/2,p.y+u.height/2,C.bbox(),u.width/2,u.height/2,l)),d&&w&&(S=d.get(f))&&S.render(c,f,w.flat().map((t,e)=>t*o[e%2]),null)}})}}],[Tr,class extends kn{constructor(t){super(t,"rm-clock-gauge")}_createGauges(t){return new dn(t,Xn)}_doPrepeare(t,e,s){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const s=this.model;this.$_layoutGauges(s._width,s._height)}_doReset(){}$_prepareGauges(t,e){const s=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(s,(s,i)=>{const r=s.point=e[i];this._setPointStyle(s,t,r),s.prepare(this.doc,t)})}$_layoutGauges(t,e){const s=this.model;s.chart.isDirty;const i=this.model.chart.getProjection(this._second),r=[this._scale,-this._scale],o=s.options.position,n=this._getLabelPositioner(s.pointLabel.options.position,"bottom"),a=this._labelViews(),h=s.getLabelOff(),l=s.getCallout(),c=this._calloutViews();let d,_,u;this._gauges.forEach((p,g)=>{const m=p.point,f=[m.lon,m.lat];if(p.setVisible(!m.isNull&&null!=(d=i.getVisible(f)))){const g=this._getPointPositioner(m.position||o,"top");let b,y,w,x,v,C;l&&(b=m.getCallout(f))&&(y=b.map(t=>i.project(t)),d=y[y.length-1]),m.xPos=w=d[0],m.yPos=x=d[1],w*=r[0],x*=r[1],p.render(s,t,e),_=p.bbox(),u=g(w,x,_.width,_.height),p.trans(u.x,u.y),a&&(v=a.get(m,0))&&this._layoutLabel(v,p.dom).transp(n(u.x+_.width/2,u.y+_.height/2,v.bbox(),_.width/2,_.height/2,h)),c&&y&&(C=c.get(m))&&C.render(l,m,y.flat().map((t,e)=>t*r[e%2]),null)}})}}]),Uo.register([Ui,Nn],[Wi,Pn],[Zi,In]);class ba extends mt{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.setStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class ya extends mt{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.setStyle("opacity",String(1-t)),!0}}class wa extends Dt{constructor(t,e,s){super(t,""),this.labelsContainer=e,this.second=s,this.seriesViews=[],this.seriesMap={},this.add(this.axisView=new tn(t,s))}prepare(t,e){const s=e.visibleSeries,i=this.seriesMap,r=this.seriesViews;r.forEach(t=>{var e;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),this.control.loaded?t.removeLater(200):t.remove())}),r.length=0,s.forEach(e=>{const s=!i[e.hash],o=i[e.hash]||function(t,e){return new(yn[e._type()])(t)}(t,e);o.parent||(this.add(o),this.labelsContainer.add(o._labelContainer)),i[e.hash]=o,r.push(o),o._second=this.second,s&&(e._optionsDirty=!0),o.prepare(t,e)}),this.prevViews&&dt.equalArrays(this.prevViews,r)||(this.sort(r),this.labelsContainer.sort(r.map(t=>t._labelContainer))),this.prevViews=r.slice(0)}prepareLayout(t,e){this.seriesViews.forEach(e=>{e.prepareLayout(t)})}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class xa extends Dt{constructor(t,e){super(t),this.front=e,this._guideViews=[],this.add(this._guideLayer=new Dt(t)),this.add(this._labelLayer=new Dt(t))}render(t,e,s,i,r){const o=e.guides.filter(t=>t.options.front==this.front);this.$_prepareGuides(t,o),this.$_layoutGuides(t,o,s,i,r)}$_prepareGuides(t,e){const s=this._guideViews,i=e.length;for(;s.length>i;)s.pop().remove();for(;s.length<i;){const e=new sn(t,this._labelLayer);s.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,s,i,r){this._guideViews.forEach((o,n)=>{o.measure(t,e[n],i,r),o.layout(s)})}}class va extends Bo{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new Qe(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new an(t)),this.add(this._contentLayer=new Dt(t,"rm-body-content")),this.add(this._crosshairView=new on(t)),this._contentLayer.add(this._annotationContainer=new Dt(t)),this._contentLayer.add(this._axisGuideContainer=new xa(t,!1)),this._contentLayer.add(this._secondAxisGuideContainer=new xa(t,!1)),this._contentLayer.add(this._seriesContainer=new wa(t,new Dt(t),!1)),this._contentLayer.add(this._secondContainer=new wa(t,new Dt(t),!0)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._secondContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new xa(t,!0)),this._contentLayer.add(this._secondFrontAxisGuideContainer=new xa(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new Dt(t)),this._secondContainer.setVisible(!1),this._secondFrontAxisGuideContainer.setVisible(!1),this._secondAxisGuideContainer.setVisible(!1),this._seriesContainer.dom.classList.add("rm-series-container"),this._secondContainer.dom.classList.add("rm-second-container")}getAnnotationAnchor(t){return this._annotationMap.get(t)}get transformInfo(){return this._transformInfo}get isProjectionChanged(){return this.model.projection!==this._prevPrj}getSeries(t){return this._seriesContainer.seriesMap[t.hash]}canScroll(){return!0}prepare(t,e){this.$_prepareMeasureSeries(t,e.chart),this.$_prepareAnnotations(t,e.getAnnotations())}_doMeasure(t,e,s,i){return this._annotationViews.forEach((e,r)=>{e.measure(t,this._annotations[r],s,i)}),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,s,i),$o.create(s,i)}_doLayout(t){var e;const s=this.doc,i=this.model,r=i.chart,o=r.axis,n=r.map,a=this._clip,h=this.height,l=this.width;if(this._back.setBounds(0,0,l,h),this._back.internalResetStyleOrClass(i._style),n){const t=l,e=h,{wMap:a,hMap:c,scale:d,tx:_,ty:u}=i.prepareLayout(t,e);this.$_prepareLayoutSeries(s,r),this._transformInfo={tx:_,ty:u,scale:d,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const p=`translate(${_}px, ${u}px) scale(${d}, ${-d})`,g=a*d,m=c*d,f=[this._seriesContainer];if(this._mapBack.setVisible(r.body.mapBackground.isVisible())){const t=(l-g)/2-i.panX*d,e=(h-m)/2-i.panY*d;this._mapBack.render(this.doc,r,t,e,g,m)}this._secondContainer.visible&&f.push(this._secondContainer),f.forEach(t=>{const e=t.axisView;e.setScale(d),e.measure(s,o,l,h),e.resize(l,h),e.trans(_,u),t.seriesViews.forEach(t=>{var e;t._scale=d,t.model.needMapScale()?(t._pointLayer.setStyle("transform",p),t._calloutContainer.visible&&t._calloutContainer.setStyles({transform:p})):t.trans(_,u),t.move(_,u),t.resize(g,m),t.render(l,h),null===(e=t._labelContainer)||void 0===e||e.trans(_,u)}),e.layout()});const b=i._prj;this.$_doClipPathLayout(i,b,l,h,d),this._crosshairView.visible&&this._crosshairView.prepare(d,p);const y=o.grid.getStep(n)||10;this.$_layoutAxisGuides(s,o,{map:n,prj:b,step:y,tf:this._transformInfo,trans:p},l,h)}if(this.$_layoutAnnotations(l,h),a&&a.width===l&&a.height===h||(this._clip=this.clipRect(0,0,l,h)),this._requestShow&&this._requestShow.visible){const t=this.getSeries(this._requestShow);t&&(null===(e=this._requestShow.ani)||void 0===e||e.stop(),(this._requestShow.ani=new ba(t)).start(),this._requestShow=null)}this._prevPrj=i._prj}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.pointToMap(this._mousePos),this._transformInfo)}clean(){}reset(){this._seriesContainer.seriesViews.forEach(t=>t.reset()),this._secondContainer.visible&&this._secondContainer.seriesViews.forEach(t=>t.reset())}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,s){let i,r;if(!this.model)return;for(const o of this._seriesContainer.seriesViews)o.pointerMoved(t,e,s)&&(i=o,r=o.getPointView(s));if(!r)for(const t of this._seriesContainer.seriesViews)if(r=t.getPointView(s),r){i=t;break}const o=this.model.chart,n=null==i?void 0:i.model,a=n&&this._owner.getScaleView(o.getColorScale(n.getColorScale()));return(null==r?void 0:r.point)?(this._owner.showTooltip(n,r,this,{x:t,y:e}),null==a||a.setValue(r.point.getValue())):(this._owner.hideTooltip(),null==a||a.setValue(NaN)),this._crosshairView.visible&&o&&this._crosshairView.render(this.pointToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!i}seriesByDom(t){return this._seriesContainer.seriesViews.find(e=>e.dom.contains(t))}showSeries(t){t.visible=!0,this._requestShow=t}hideSeries(t){var e;const s=this.getSeries(t);s&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new ya(s)).start())}pointToMap(t){const e=this.model.chart.getProjection(!1),{tx:s,ty:i,scale:r,vx:o,vy:n}=this._transformInfo,a=[(t.x-o-s)/r,(t.y-n-i)/-r];return e.backward(a)}$_prepareMeasureSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e),this._secondContainer.setVisible(e.body.scroll%360!=0)&&this._secondContainer.prepare(t,e)}$_prepareLayoutSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t,e),this._secondContainer.setVisible(e.body.scroll%360!=0)&&this._secondContainer.prepareLayout(t,e)}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,o=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));o.forEach(t=>t.remove()),o.length=0,(this._annotations=e).forEach(e=>{const n=r.get(e)||fa(t,e);(e.options.front?i:s).add(n),r.set(e,n),o.push(n)})}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach(s=>{s._layoutView(this,0,0,t,e)})}$_layoutAxisGuides(t,e,s,i,r){this._axisGuideContainer.render(t,e,s,i,r),this._frontAxisGuideContainer.render(t,e,s,i,r);const o=this.model.chart,n={...s,prj:s.prj.second};this._secondFrontAxisGuideContainer.setVisible(o.body.scroll%360!=0)&&(this._secondFrontAxisGuideContainer.visible=!0,this._secondFrontAxisGuideContainer.render(t,e,n,i,r)),this._secondAxisGuideContainer.setVisible(o.body.scroll%360!=0)&&(this._secondAxisGuideContainer.visible=!0,this._secondAxisGuideContainer.render(t,e,n,i,r))}$_doClipPathLayout(t,e,s,i,r){const o=()=>{const t=e.getClipBounds();return`M${t[0][0]},${t[0][1]} L`+t.slice(1).map(t=>`${t[0]},${t[1]}`)},n=t=>{const{tx:e,ty:s}=this._transformInfo;t.path.transEx(e,s).scale(r)};if(e.isClipping()){const t=this._clipMap;if(t&&t.width===s&&t.height===i){if(t){if(this._prevPrj!==e){const e=o();t.setPath(e)}n(t),this._contentLayer.hasAttr("clip-path")||this._contentLayer.attachClipPath(this._clipMap.id)}}else{const t=o();this._clipMap=this._contentLayer.clipPath(t),n(this._clipMap),this._clipMap.resize(s,i)}}else this._contentLayer.detachClipPath()}}class Ca extends zo{constructor(t,e){super(t,e?Ca.SUBTITLE_CLASS:Ca.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Ie(t)),this._richText=new Fe}_marginable(){return!1}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){return this.chart().isDirty&&(this._richText.setFormat(e.options.text),this._richText.build(this._textView,s,i,null,null)),ut(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var Sa,La;Ca.TITLE_CLASS="rm-title",Ca.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Sa||(Sa={}));class Aa extends Vt{constructor(e){super(e,Aa.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._tailVisible=!0,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new $t(e,"rm-tooltip-back")),this.add(this._top=new $t(e,"rm-tooltip-top")),this.add(this._textView=new Ie(e,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+Et.SHADOW_FILTER+")"),this._textView.anchor=t.TextAnchor.START,this._richText=new Fe,this.close(!0,!1)}show(t,e,s,i,r,o){var n;const a=e.point,h=this._model=t.chart._tooltip,l=h.options,c=h.setTarget(t,a);if(!c)return;const d=l.text||c.getTooltipText(t,a);if(!d)return;const _=this.control,u=_.contentWidth(),m=_.contentHeight(),f=this._textView;this._richText.setFormat(d),this._richText.build(f,NaN,NaN,null,h.getTextDomain());const b=f.bbox();let y=g(l.minWidth||0,b.width+16),w=g(l.minHeight||0,b.height+12);this._top.setFill((null===(n=e.tooltipColor)||void 0===n?void 0:n.call(e))||t._calcedColor);const x="visible"===this.getStyle("visibility")?300:0,v=l.offset+this._tailSize,C=e.getBounds(),S=_.getBounds();let L;L=s-y/2-g(0,p(s-y/2,u-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(S.bottom,C.bottom);const A=Sa.TOP;this.drawTooltip(0,0,y,w,A,L),i-=w+v,s=g(0,p(s-=y/2,u-y)),i=g(0,p(i,m-w)),this.transEx(s,i,x,!1),0===x&&this.setStyle("visibility","visible"),this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}close(t,e){t?(this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0),this.$_hide()):this._hideTimer||(this._hideTimer=setTimeout(this._hideHandler,this._model?this._model.options.hideDelay:Yi.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,s,i,r,o){const n=null!=s?G(e,s):{},a=G(e,i),h=t.animate([n,a],{duration:r,fill:"none"});h&&o&&h.addEventListener("finish",o)}(this.dom,"opacity",void 0,0,200,()=>{this.setStyle("visibility","hidden")})}drawTooltip(t,e,s,i,r,o){const n=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+s-a,e,"Q",t+s,e,t+s,e+a,"L",t+s,e+i-a,"Q",t+s,e+i,t+s-a,e+i,"L",t+a,e+i,"Q",t,e+i,t,e+i-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case Sa.TOP:l=l.concat(["M",t+s/2-n/2+o,e+i,"L",t+s/2+o,e+i+n,"L",t+s/2+n/2+o,e+i]);break;case Sa.BOTTOM:l=l.concat(["M",t+s/2-n/2+o,e,"L",t+s/2+o,e-n,"L",t+s/2+n/2+o,e]);break;case Sa.LEFT:l=l.concat(["M",t+s,e+i/2-n/2+o,"L",t+s+n,e+i/2+o,"L",t+s,e+i/2+n/2+o]);break;case Sa.RIGHT:l=l.concat(["M",t,e+i/2-n/2+o,"L",t-n,e+i/2+o,"L",t,e+i/2+n/2+o])}const c=r===Sa.BOTTOM,d=c?["M",t,e+i-h,"l",s,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-s,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",s-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-s,0,"l",0,a-h,"q",0,-a,a,-a],_=this._textView,u=_.bbox();t+=(s-u.width)/2,e+=(i-u.height+(c?-h:h))/2,_.trans(t,e),this._top.setPath(d),this._back.setPath(l)}}Aa.CLASS_NAME="rm-tooltip";class Ma extends Bo{constructor(t){super(t,Ma.SCALE_CLASS),this._gap=0,this.add(this._barLayer=new Dt(t)),this._bars=new Go(this._barLayer,Qe,"rm-color-scale-bar"),this.add(this._splitLayer=new Dt(t)),this._splits=new Go(this._splitLayer,hn,"rm-color-scale-split"),this.add(this._markerLabel=new qo(t,void 0)),this.add(this._marker=new $t(t,"rm-color-scale-marker")),this.add(this._tickLineLayer=new Dt(t,"rm-color-scale-tick-line")),this.add(this._tickLabelLayer=new Dt(t,"rm-color-scale-tick-label")),this._tickLines=new Go(this._tickLineLayer,hn),this._tickLabels=new Go(this._tickLabelLayer,qo),this._fills=[]}setValue(t){var e,s;e=t,s=this._value,(isNaN(e)?isNaN(s):e===s)||(this._value=t,this.$_resetMarker(this._vertical,this._reversed))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i){const r=this.chart().isDirty,o=e.options,n=e.marker,a=e.getTicks(),h=this._tickLen=+e.tick.line.options.length||0,l=e.tick.line,c=e.tick.label,d=this._vertical="vertical"===e.getLayout(),_=this._reversed=e.isReversed();let{width:u,height:p}=e.getBarSize(s,i,d);if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(l.visible&&h>0),r){const s=this._vertical?p:u,i=e.getSplitPoints(s);this.$_prepareBars(t,e,d,_),this._splitLayer.visible&&this.$_prepareSplits(t,i),this._tickLineLayer.visible&&this.$_prepareTickLines(t,i,s)}if(this._markerSize=this._labelSize=0,this._markerLabel.setVisible(n.visible)&&(this._markerSize=n.getMarkerSize(),d?u+=this._markerSize:p+=this._markerSize,r&&this.$_prepareMarker(n,d,_,this._markerSize),this._markerLabel.setVisible(n.label.visible)),this._tickLineLayer.setVisible(l.visible&&a.length>0)&&this._tickLines.forEach(t=>{t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(l._style)}),this._tickLabelLayer.setVisible(c.visible&&a.length>0)){const s=d?"width":"height";this._tickLabelSize=0,this._tickLabels.prepare(a.length,(i,r)=>{i.setModel(t,e.tick.label,null,null),i._text.internalResetStyleOrClass(c._style),i.setText(a[r].label),i.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,i.bbox()[s]),d&&(this._tickLabelSize+=1)}),d?u+=this._tickLabelSize+h:p+=this._tickLabelSize+h}return this._gap=b(+o.gap,0),this._vertical?u+=this._gap:p+=this._gap,{width:u,height:p}}_doLayout(){const t=this._vertical,e=this._reversed,s=this._tickLabelSize,i=this._markerSize,r=this._tickLen,o=this._gap;let n=this.width,a=this.height,h=0,l=0;t?(h+=e?s:o+i,n-=o+i,s>0&&(e?this._tickLabelLayer.transX(s):this._tickLabelLayer.transX(this.width-s+1),this._tickLabels.forEach((t,s,i)=>{e&&t.transX(-t.bbox().width),t.transY(s*a/(i-1)-t.bbox().height/2)}),n-=s),n-=r,e&&(h+=r)):(l+=o+i,a-=o+i,s>0&&(e?this._tickLabelLayer.transY(0):this._tickLabelLayer.transY(this.height-s),this._tickLabels.forEach((t,e,s)=>{t.transX(e*n/(s-1)-t.bbox().width/2)}),a-=s),a-=r,e&&(l+=r)),this._barLayer.setBounds(h,l,n,a),this._bars.forEach((e,s,i)=>{t?e.setBounds(0,s*a/i,n,a/i):e.setBounds(s*n/i,0,n/i,a)}),this._splitLayer.visible&&this.$_layoutSplits(h,l,n,a),this._tickLineLayer.visible&&(t?e?h-=r:h+=n:e?l-=r:l+=a,this.$_layoutTickLines(h,l,r)),this.$_resetMarker(this._vertical,this._reversed)}$_getFillId(t){return`${Ma.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,s){const i=t.createElementNS(e,"linearGradient");return i.setAttribute("id",this.$_getFillId(s)),i.appendChild(t.createElementNS(e,"stop")),i.appendChild(t.createElementNS(e,"stop")),this.control.addDef(i),i}$_setDir(t,e,s){e?(t.setAttribute("x1","0%"),t.setAttribute("y1","0%"),t.setAttribute("x2","0%"),t.setAttribute("y2","100%")):(t.setAttribute("x1","0%"),t.setAttribute("y1","0%"),t.setAttribute("x2","100%"),t.setAttribute("y2","0%"))}$_fillStops(t,e,s){const i=t.childNodes[0],r=t.childNodes[1];i.setAttribute("offset","0"),i.setAttribute("stop-color",e.toString()),i.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",s.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,s,i){const r=this._fills,o=e.getSteps();if(o){let e=0;o.forEach((s,i)=>{s._color1&&(r.length<=e&&r.push(this.$_createGradient(t,e)),r[r.length-1][os]=s,e++)}),r.forEach(t=>{const e=t[os];this.$_setDir(t,s,i),this.$_fillStops(t,e._color1,e._color2)}),this._bars.prepare(e,(t,e)=>{t.setStyle("fill",this.$_getFillUrl(e))})}else if(this._bars.prepare(1),e.minColor){let o=r.shift();if(o){for(let t=1;t<r.length;t++)this.control.removeDef(r[t]);this._fills=[o]}else o=this.$_createGradient(t,0),r.push(o);this.$_setDir(o,s,i),this.$_fillStops(o,e.minColor,e.maxColor||e.series.color),this._bars.first.setStyle("fill",this.$_getFillUrl(0))}else r.forEach(t=>this.control.removeDef(t)),this._fills=[]}$_prepareSplits(t,e){this._splits.prepare(e.length,(t,s)=>{t._userData=e[s]})}$_prepareTickLines(t,e,s){this._tickLines.prepare(e.length+2,(t,i)=>{t._userData=0===i?0:i===e.length+1?s-1:e[i-1]})}$_prepareMarker(t,e,s,i){e?s?this._marker.setPath(`M 0 0 L ${.8*i} -${.7*i} L ${.8*i} ${.7*i} Z`):this._marker.setPath(`M 0 0 L -${.8*i} -${.7*i} L -${.8*i} ${.7*i} Z`):s?this._marker.setPath(`M 0 0 L -${.7*i} ${i} L ${.7*i} ${i} Z`):this._marker.setPath(`M 0 0 L -${.7*i} -${i} L ${.7*i} -${i} Z`)}$_layoutSplits(t,e,s,i){this._splits.forEach(r=>{this._vertical?r.setHLine(r._userData,t,t+s):r.setVLine(r._userData,e,e+i)})}$_layoutTickLines(t,e,s){this._tickLines.forEach(i=>{this._vertical?i.setHLine(i._userData,t,t+s):i.setVLine(i._userData,e,e+s)})}$_resetMarker(t,e){const s=this._markerSize,i=this._gap,r=isNaN(this._value);if(this._marker.setBoolData("null",r),t){const t=e?this.width-i-s+1:s+i-1;this._marker.trans(t,r?0:this.height*this.model.getPosition(this._value))}else{this.model.getPosition(this._value)>1&&console.log(this.model.getPosition(this._value));const t=e?this.height-i-s+1:s+i;this._marker.trans(r?0:this.width*this.model.getPosition(this._value),t)}}}Ma.SCALE_CLASS="rm-color-scale",Ma.SCALE_FILL="rm-color-scale-fill";class ka extends Vt{constructor(t,e,s){super(t,ka.STYLE),this.add(this._back=new Qe(t,ka.BACK_STYLE)),this.add(this._textView=new Ie(t)),s&&this.dom.classList.add(s),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(e,s){this.internalSetStyleOrClass(s),this._textView.layout=t.TextLayout.MIDDLE,this._textView.layoutText();const i=this._textView.bbox(),r=getComputedStyle(this._back.dom),o=(new Oo).applyPadding(r);e?(this._back.rect={x:0,y:0,width:e.width,height:e.height},this._textView.trans(e.width/2,e.height/2-1)):(this._textView.trans(o.left+i.width/2,o.top+i.height/2-1),this._back.rect={x:0,y:0,width:i.width+o.left+o.right,height:i.height+o.top+o.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}ka.STYLE="rm-button",ka.BACK_STYLE="rm-button-background";class Pa extends ka{constructor(t,e,s){super(t,e),this.callback=s}click(){return this.callback(),!0}}class Ia extends Bo{}class Na extends Ia{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new Pa(t,"「 」",()=>this.chart().body.setZoom(100))),this.add(this._btnInc=new Pa(t,"+",()=>this.chart().body.incZoom(this.model.getZoomStep()))),this.add(this._btnDec=new Pa(t,"-",()=>this.chart().body.incZoom(-this.model.getZoomStep())))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,s,i){const r=this.chart().body.zoom,o=this._szBtn=e.getButtonSize(),n=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.options.showReset)?3:2;let h=0,l=0;return this._btnHome.setBoolData(as,r<=100),this._btnDec.setBoolData(as,r<=100),(this._vertical=e.vertical)?(h=o.width,l+=a*o.height+(a-1)*n):(l=o.height,h+=a*o.width+(a-1)*n),{width:h,height:l}}_doLayout(t){const e=this._szBtn;if(this._btnHome.visible&&this._btnHome.layout(e),this._btnInc.layout(e),this._btnDec.layout(e),this._vertical){let t=0;this._btnHome.visible&&(t+=e.height+this._gap),this._btnInc.transY(t),t+=e.height+this._gap,this._btnDec.transY(t)}}}class Ta extends Ia{constructor(t){super(t,"rm-drilldown-panel")}getButton(t){return this._btnBack&&this._btnBack.containsDom(t)&&this._btnBack}click(t){const e=this._textViews;if(e)for(let s=0;s<e.count-1;s++)if(e.get(s).containsDom(t))return this.model.chart.drillup(e.get(s+1)[ns]),!0}_doMeasure(e,s,i,r){let o=this._btnBack,n=0,a=0;if("text"===s.options.type){null==o||o.remove(),this._textViews||(this._textViews=new Go(this,Ie,"rm-drilldown-text"),this._seperators=new Go(this,Ie,"rm-drilldown-separator"));const e=s.chart.firstVisible,i=this._history=e.getHistory();this._textViews.prepare(i.length,(e,s)=>{e.text=i[s].displayName(),e.anchor=t.TextAnchor.START,e[ns]=i[s]}),this._seperators.prepare(i.length-1,e=>{e.text=">",e.anchor=t.TextAnchor.START})}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),o||this.add(o=this._btnBack=new Pa(e,"<",()=>{s.chart.drillup()})),o.layout();const t=o.bbox();n=t.width,a=t.height}return{width:n,height:a}}_doLayout(t){if("text"===this.model.options.type){const t=this.model.options.itemGap,e=this._history;let s=0;for(let i=0;i<e.length;i++){const r=this._textViews.get(i);r.setBoolData("history",i<e.length-1),r.transX(s),i<e.length-1&&(s+=r.bbox().width+t,this._seperators.get(i).transX(s),s+=this._seperators.get(i).bbox().width+t)}}}}class Ea extends Bo{constructor(t){super(t,Ea.SCALE_CLASS),this._bubbles=[],this._lines=[],this._labels=[],this.add(this._bubbleLayer=new Dt(t)),this.add(this._lineLayer=new Dt(t)),this.add(this._labelLayer=new Dt(t))}_doMeasure(t,e,s,i){const r=this.chart();r.isDirty,e.options;const o=this._steps=e.getSteps(r.width,r.height);return this._model=e,this.$_prepareBubbles(t,e,o),{width:100,height:100}}_doLayout(){const t=this._model,e=this.height,s=this._steps,i=s[s.length-1].rd;if(this._bubbles.forEach((t,r)=>{const o=s[r];t.internalResetStyleOrClass(null),t.setCircle(i,e-o.rd,o.rd)}),this._lineLayer.visible){const r=2*i+(t.tick.line.options.length||0);this._lines.forEach((t,o)=>{const n=s[o];t.setHLine(e-2*n.rd,i,r)})}if(this._labelLayer.visible){const r=2*i+t.tick.line.options.length+(t.tick.label.options.offset||0);this._labels.forEach((i,o)=>{const n=s[o];i.setText(t.tick.label.getText(n.label)),i.trans(r,e-2*n.rd-i.bbox().height/2)})}}$_prepareBubbles(t,e,s){const i=e.tick,r=s.length;Vt.fit(t,this._bubbleLayer,this._bubbles,r,Zn,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(i.visible&&i.line.visible)&&Vt.fit(t,this._lineLayer,this._lines,r,hn,"rm-bubble-scale-line"),this._labelLayer.setVisible(i.visible&&i.label.visible)&&Vt.fit(t,this._labelLayer,this._labels,r,qo,"rm-bubble-scale-label")}}Ea.SCALE_CLASS="rm-bubble-scale";class Va extends Bo{constructor(t){super(t,Va.SCALE_CLASS)}_doMeasure(t,e,s,i){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}Va.SCALE_CLASS="rm-map-scale";class Da extends jo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Ca(t,!1)),this.add(this.subtitleView=new Ca(t,!0))}_doMeasure(t,e,s,i){const r=e._title,o=e._subtitle;let n,a=0,h=0,l=0,c=0,d=this.titleView,_=s,u=0,p=0;switch(d.setVisible(r.isVisible())?(n=d.measure(t,r,s,i),h=this._hTitle=n.height,a=this._wTitle=n.width):d.setModel(r),(d=this.subtitleView).setVisible(o.isVisible())?(n=d.measure(t,o,s,i),c=this._hSub=n.height,l=this._wSub=n.width,p=+o.options.titleGap||0):d.setModel(o),o.options.position){case"left":case"right":u=g(h,c),_=a+p+l;break;default:u=h+p+c,_=g(_,a+l)}return u>0&&(u+=this.titleView.visible?b(r.options.gap,0):b(o.options.gap,0)),{width:_,height:u}}_doLayout(t){const e=this.titleView,s=this.subtitleView,i=e.model,r=s.model,o=i&&i.options,n=r&&r.options,a=i&&i.visible?this._wTitle>t.wMap||"chart"===o.alignBase?t.wChart:t.wMap:0,h=r&&r.visible?this._wSub>t.wMap||"chart"===n.alignBase?t.wChart:t.wMap:0;let l=this._wTitle>t.wMap||i&&"chart"===o.alignBase?0:t.xMap,c=this._wSub>t.wMap||r&&"chart"===n.alignBase?0:t.xMap;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}},d=()=>{const e=g(this._hTitle,this._hSub);m=g(m,m+t(i,e,this._hTitle)),y=g(y,y+t(r,e,this._hSub))},_=(t,e,s)=>{switch(t.options.align){case"left":return 0;case"right":return e-s;default:return(e-s)/2}},u=()=>{if(f=g(f,f+_(i,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":w=f;break;case"right":w=f+this._wTitle-this._wSub;break;default:w=f+(this._wTitle-this._wSub)/2}else w=g(w,w+_(r,h,this._wSub))},p=b(n.titleGap,0);let m=0,f=l,y=0,w=c;switch(o.align){case"left":switch(n.position){case"left":f=w+this._wSub+p,d();break;case"right":switch(w=f+this._wTitle+p,n.align){case"center":w=g(w,w+(h-this._wTitle-this._wSub)/2);break;case"right":w=g(w,c+h-this._wSub)}d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}break;case"right":switch(n.position){case"left":switch(f+=a-this._wTitle,n.align){case"center":w+=(a-this._wTitle-this._wSub)/2;break;case"right":w=f-p-this._wSub}d();break;case"right":w+=h-this._wSub,f=w-p-this._wTitle,d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}break;default:switch(n.position){case"left":switch(f+=(a-this._wTitle)/2,n.align){case"left":break;case"center":w+=(f-w-this._wSub)/2;break;case"right":w=f-p-this._wSub}d();break;case"right":switch(f+=(a-this._wTitle)/2,n.align){case"left":w=f+this._wTitle+p;break;case"center":w=f+this._wTitle+p,w+=(h-w-this._wSub)/2;break;case"right":w+=h-p-this._wSub}d();break;case"top":u(),m=y+this._hSub+p;break;default:u(),y=m+this._hTitle+p}}e.resizeByMeasured().layout().trans(f,m),s.resizeByMeasured().layout().trans(w,y)}else if(a>0||h>0){const t=a?i:r,o=a?e:s,n=a||h,d=a?this._wTitle:this._wSub;let _=a?l:c;switch(o.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":_+=n-d;break;default:_+=(n-d)/2}o.trans(_,0)}}_doLocateInner(t,e,s){}}class Ra extends jo{_doInitChildren(t){this.add(this._legendView=new Wo(t))}_doMeasure(t,e,s,i){const r=e._legend,o=this._legendView.measure(t,r,s,i),n=this._loc=r.getLocation();return"left"===n||"right"===n?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,o=0;switch(this._loc){case"left":s-=e;break;case"right":s-=e,r+=e;break;case"top":i-=e;break;default:o+=e,i-=e}t.trans(r,o).resize(s,i),t.layout()}_doLocateInner(t,e,s){const i=this._legendView,r=i.model.options,o=this.width,n=this.height;let a=+r.offsetX||0,h=0,l=0;switch(r.align){case"right":h+=t-o-a;break;case"center":h+=(t-o)/2+a;break;default:h+=a}switch(a=+r.offsetY||0,r.verticalAlign){case"bottom":l+=e-n-a;break;case"middle":l+=(e-n)/2+a;break;default:l+=a}i.trans(h,l)}}class $a extends jo{constructor(t,e){super(t),this.loc=e}getView(t){var e;return null===(e=this._views)||void 0===e?void 0:e.find(e=>e.model===t)}setScales(t,e,s){return this._scales=t,this._wChart=e,this._hChart=s,this}_doMeasure(t,e,s,i){const r=this.loc,o=this._prepareScales(t,this._wChart,this._hChart);if(!this.setVisible(o&&o.length>0))return;const n=new $o;return o.forEach((e,r)=>{e.measure(t,this._scales[r],s,i)}),r===tt.TOP||r==tt.BOTTOM?o.forEach(t=>{n.width+=t.mw,n.height=g(n.height,t.mh)}):r===tt.LEFT||r===tt.RIGHT?o.forEach(t=>{n.width=g(n.width,t.mw),n.height+=t.mh}):o.forEach(t=>{n.width+=t.mw,n.height+=t.mh}),n}_doLayout(){const t=this.loc,e=this._views;let s=this.width,i=this.height,r=0,o=0;e.forEach(t=>{t.resizeByMeasured(),t.layout()}),t===tt.LEFT||t===tt.RIGHT?e.forEach(t=>{const e=t.model.options,s=+e.offsetY||0;switch(e.verticalAlign){case"bottom":o+=i-t.height-s;break;case"top":o+=s;break;default:o+=(i-t.height)/2+s}t.trans(r,o)}):e.forEach(t=>{const e=t.model.options,i=+e.offsetX||0;switch(e.align){case"right":r+=s-t.width-i;break;case"left":r+=i;break;default:r+=(s-t.width)/2+i}t.trans(r,o)})}_doLocateInner(t,e,s){this._views.forEach(s=>{const i=s.model.options,r=this.width,o=this.height;let n=+i.offsetX||0,a=0,h=0;switch(i.align){case"right":a+=t-r-n;break;case"center":a+=(t-r)/2+n;break;default:a+=n}switch(n=+i.offsetY||0,i.verticalAlign){case"bottom":h+=e-o-n;break;case"middle":h+=(e-o)/2+n;break;default:h+=n}s.trans(a,h).resize(r,o),s.layout()})}_prepareScales(t,e,s){const i=this._scales.length;if(this.setVisible(i>0)){const e=this._views||(this._views=[]);for(;e.length<i;)e.push(this.add(this._createView(t)));for(;e.length>i;)e.pop().remove();return e}}}class Oa extends $a{_createView(t){return new Ma(t)}}class Fa extends $a{_createView(t){return new Ea(t)}}class Ba extends Bo{constructor(e){super(e,"rm-credits"),this.add(this._textView=new Ie(e)),this._textView.anchor=t.TextAnchor.START}click(t){this.model.options.url&&window.open(this.model.options.url,"new")}locateInner(t,e){const s=this.width,i=this.height,r=+t.offsetX||0,o=+t.offsetY||0;let n=0,a=0;switch(t.verticalAlign){case"bottom":a=e.bottom-i;break;case"middle":a=e.y+(e.height-i)/2+o;break;default:a=e.y+o}switch(t.align){case"right":n=e.right-s-r;break;case"center":n=e.x+(e.width-s)/2+r;break;default:n=e.x+r}return{x:n,y:a}}locateOuter(t,e,s){const i=t.location,r=this.width,o=this.height,n=+t.offsetX||0,a=+t.offsetY||0;let h=0,l=0;switch(i){case"left":h=n;break;case"right":h=e-r-n;break;case"top":l=a;break;default:l=s-o-a}if("left"===i||"right"===i)switch(t.verticalAlign){case"top":l=a;break;case"bottom":l=s-o;break;default:l=(s-o)/2+a}else switch(t.align){case"left":h=n;break;case"center":h=(e-r)/2+n;break;default:h=e-r-n}return{x:h,y:l}}_doMeasure(t,e,s,i){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.bbox()}}class za extends Dt{constructor(t){super(t,"rm-chart"),this._colorScaleMap={},this._bubbleScaleMap={},this._annotationViews=[],this._annotationMap=new Map,this.add(this._annotationContainer=new Dt(t,"rm-annotations")),this.add(this._bodyView=new va(t,this)),this.add(this._titleSectionView=new Da(t)),this.add(this._scaleLayer=new Dt(t,"rm-scales")),this.add(this._legendSectionView=new Ra(t)),this.add(this._frontAnnotationContainer=new Dt(t,"rm-front-annotations")),this.add(this._zoomPanelView=new Na(t)),this.add(this._drilldownPanelView=new Ta(t)),this.add(this._mapScaleView=new Va(t)),this.add(this._creditView=new Ba(t)),this.add(this._tooltipView=new Aa(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}legendView(){return this._legendSectionView._legendView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}measure(t,e,s,i){const r=(this._model=e)._credits,o=e._legend,n=this._bodyView;let a,h=e.width=s,l=e.height=i;if(this._creditView.setVisible(r.visible)){const e=r.options;switch(a=this._creditView.measure(t,r,h,l),e.location){case"body":break;case"right":case"left":h-=a.width+(+e.offsetX||0)+(+e.gap||0);break;default:l-=a.height+(+e.offsetY||0)+(+e.gap||0)}}if(a=this._titleSectionView.measure(t,e,h,l),l-=a.height,this._legendSectionView.setVisible(o.isVisible()))switch(a=this._legendSectionView.measure(t,e,h,l),o.getLocation()){case"top":case"bottom":l-=a.height;break;case"right":case"left":h-=a.width}n.prepare(t,e.body);for(const r of Object.values(tt)){const o=e._colorScales.getVisibles(r);let n=this._colorScaleMap[r];if(o.length>0){n?n.setVisible(!0):(n=new Oa(t,r),this._scaleLayer.add(n),this._colorScaleMap[r]=n);const a=this._colorScaleMap[r].setScales(o,s,i).measure(t,e,h,l);a&&(r===tt.BOTTOM||r===tt.TOP?l-=a.height:r!==tt.RIGHT&&r!==tt.LEFT||(h-=a.width))}else n&&n.setVisible(!1)}for(const r of Object.values(tt)){const o=e._bubbleScales.getVisibles(r);let n=this._bubbleScaleMap[r];if(o.length>0){n?n.setVisible(!0):(n=new Fa(t,r),this._scaleLayer.add(n),this._bubbleScaleMap[r]=n);const a=this._bubbleScaleMap[r].setScales(o,s,i).measure(t,e,h,l);a&&(r===tt.BOTTOM||r===tt.TOP?l-=a.height:r!==tt.RIGHT&&r!==tt.LEFT||(h-=a.width))}else n&&n.setVisible(!1)}n.measure(t,e.body,h,l),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach((e,r)=>{e.measure(t,this._annotations[r],s,i)}),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,h,l),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,h,l)}layout(){const t=this._model,e=this.width,s=this.height;let i=e,r=s;const o=this._bodyView;let n=0;const a=t._legend,h=t._credits,l=this._creditView;h.options.gap;let c=0,d=0,_=0,u=0,p=0;if(l.visible){const t=h.options;l.resizeByMeasured();const e=l.width+(+t.offsetX||0)+(+t.gap||0),s=l.height+(+t.offsetY||0)+(+t.gap||0);switch(h.options.location){case"body":break;case"right":i-=_=e;break;case"left":i-=c=e,u+=e;break;case"top":r-=s,p+=s;break;default:r-=d=s}}const g=this._titleSectionView;g.visible&&(g.resizeByMeasured(),g.layout({xMap:u,wMap:i,wChart:e}).trans(0,p),p+=g.height,r-=n=g.height);const m=this._legendSectionView;let f,b,y=0,w=0;if(m.visible)switch(m.resizeByMeasured().layout(),y=m.height,w=m.width,m._loc){case"top":f=p,r-=y,p+=y;break;case"bottom":r-=y,f=p+r;break;case"right":i-=w,b=e-_-w;break;case"left":i-=w,u+=w,b=c}const x=this._colorScaleMap;let v=0,C=0;for(const t in x){const o=x[t];if(o.visible)switch(t===tt.RIGHT||t===tt.LEFT?o.resize(o.mw,s):t===tt.TOP||t===tt.BOTTOM?o.resize(e,o.mh):o.resize(o.mw,o.mh),o.layout(),v=o.height,C=o.width,t){case tt.BOTTOM:r-=v;break;case tt.TOP:r-=v,p+=v;break;case tt.RIGHT:i-=C;break;case tt.LEFT:i-=C,u+=C}}const S=this._bubbleScaleMap;let L=0,A=0;for(const t in S){const e=S[t];if(e.visible&&(e.resizeByMeasured(),"body"!==t))switch(e.layout(),L=e.height,A=e.width,t){case tt.BOTTOM:r-=L;break;case tt.TOP:r-=L,p+=L;break;case tt.RIGHT:i-=A;break;case tt.LEFT:i-=A,u+=A}}const M=pt.create(u,p,i,r);if(l.visible){const t=h.options,i="body"===t.location?l.locateInner(t,M):l.locateOuter(t,e,s);l.transp(i)}o.trans(M.x,M.y),o.resize(M.width,M.height),o.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,M)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,M));let k=0,P=0;if(m.visible){const t=a.options,o=+t.offsetY||0,n=+t.offsetX||0;if("body"===t.location)m.locateInner(i,r);else if(isNaN(f)){if(u=b,"chart"===t.alignBase){switch(t.verticalAlign){case"top":p=o;break;case"bottom":p=s-y-o;break;default:p=(s-y)/2+o}p+y>s&&(p=(s-y)/2)}else switch(t.verticalAlign){case"top":p+=o;break;case"bottom":p=p+r-y-o;break;default:p=p+(r-y)/2+o}p+y>s&&(p=(s-y)/2),p<0&&(p=0),k=m.width}else{if(p=f,"chart"===t.alignBase)switch(t.align){case"left":u=n;break;case"right":u=e-w-n;break;default:u=(e-w)/2+n}else switch(t.align){case"left":u+=n;break;case"right":u=u+i-w-n;break;default:u+=(i-w)/2+n}u+w>e&&(u=(e-w)/2),u<0&&(u=0),P=m.height+o}m.trans(u,p)}for(const t in x){const i=x[t];if(i.visible)if("body"===t)i.locateInner(M.width,M.height).trans(M.x,M.y);else{switch(t){case tt.BOTTOM:default:p=s-d-P-v,u=(e-i.width)/2;break;case tt.TOP:p=n+P,u=(e-i.width)/2;break;case tt.RIGHT:p=(s-i.height)/2,u=e-k-i.width;break;case tt.LEFT:p=(s-i.height)/2,u=k}i.trans(u,p)}}for(const t in S){const i=S[t];if(i.visible)if("body"===t)i.locateInner(M.width,M.height).trans(M.x,M.y);else{switch(t){case tt.BOTTOM:default:p=s-d-P-L,u=(e-i.width)/2;break;case tt.TOP:p=n+P,u=(e-i.width)/2;break;case tt.RIGHT:p=(s-i.height)/2,u=e-k-i.width;break;case tt.LEFT:p=(s-i.height)/2,u=k}i.trans(u,p)}}this.$_layoutAnnotations(e,s,M),this._tooltipView.close(!0,!1)}showTooltip(t,e,s,i){const{x:r,y:o}=e.tooltipPos?e.tooltipPos():{x:i.x,y:i.y},n=this._model.chart._tooltip.isFollowPointer(t),a=(n?i.x:r)-this.tx,h=(n?i.y:o)-this.ty;this._tooltipView.show(t,e,a,h,s,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){return this._legendSectionView._legendView.legendByDom(t)}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getScaleView(t){for(const e in this._colorScaleMap){const s=this._colorScaleMap[e].getView(t);if(s)return s}}pointerMoved(t,e,s){this._bodyView.pointerMoved(t,e,s)}getButton(t){return this._zoomPanelView.getButton(t)||this._drilldownPanelView.getButton(t)}buttonClicked(t){}updateAnnotation(t){let e=this._annotationViews.find(e=>e.model===t);e&&e.update(this,this.width,this.height)}isAnimating(){}$_prepareAnnotations(t,e){const s=this._annotationContainer,i=this._frontAnnotationContainer,r=this._annotationMap,o=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);o.forEach(t=>t.remove()),o.length=0,(this._annotations=e).forEach(e=>{const n=r.get(e)||fa(t,e);(e.options.front?i:s).add(n),r.set(e,n),o.push(n)})}$_layoutAnnotations(t,e,s){const i=this.control._padding;let r,o,n,a;this._annotationViews.forEach(s=>{if("container"===s.model.options.scope)r=-i.left,o=-i.top,n=t+i.left+i.right,a=e+i.top+i.bottom;else r=o=0,n=t,a=e;s._layoutView(this,r,o,n,a)})}$_layoutPanel(t,e){const s=t.model.options,i=s.offsetX||0,r=s.offsetY||0,o=t.width,n=t.height;let a=e.x,h=e.y;switch(s.verticalAlign){case"bottom":h+=e.height-r-n;break;case"middle":h+=(e.height-n)/2+r;break;default:h+=r}switch(s.align){case"right":a+=e.width-i-o;break;case"center":a+=(e.width-o)/2+i;break;default:a+=i}t.trans(a,h)}}!function(t){t.EXPORT="$$realmap_export"}(La||(La={}));class ja extends Et{constructor(t,e){super(t,e),this.addElement(this._chartView=new za(t)),this.addElement(this._loadingView=new No(t)),this._loadingView.visible=!1}_initControl(t,e,s){super._initControl(t,e,s),this._chart=new Po(null,(t,e)=>{this.changeModel(t,e)})}onModelChanged(t,e,s){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e){this.invalidateLayout()}onPointAdded(t,e,s,i){i&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(s)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,s){const i=this._chartView.bodyView();s?i.showSeries(e):i.hideSeries(e)}onExportRequest(t,e){this._export(e)}get chart(){return this._chart}set chart(t){t!==this._chart&&(this._chart=t,this.changeModel(t._obj,this.model))}get model(){return this._chart._obj}changeModel(t,e){t!==e&&(this.clearAssetDefs(),e&&(e._assets.unregister(this),e._removeListener(this)),t&&(t._addListener(this),t._assets.register(this.doc(),this)),this.loaded=!1,this.invalidateLayout(!0))}chartView(){return this._chartView}refresh(){this._render()}use(t){if(t.MODULE_NAME&&t.MODULE_NAME===La.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}showLoadingView(){this._loadingView.visible=!0}hideLoadingView(){this._loadingView.visible=!1}_creatDefaultTool(){return new Ro(this)}_doBeforeRender(t){var e,s;(null===(s=null===(e=this._chart)||void 0===e?void 0:e.options)||void 0===s?void 0:s.chart)&&t.internalResetStyleOrClass(this._chart.options.chart.style)}_doRender(t){var e;const s=this.model,i=this._chartView,r=t.width,o=t.height;this.$_renderLoadingView(r,o),s.options.chart&&(this._setBackgroundStyle(s.options.chart.backgroundStyle),s&&(s.prepareRender(),this._loadModules()),this.loaded||i.clean(),i.measure(this.doc(),s,r,o),i.setRect(t),i.layout(),s&&s.afterRender(),(null===(e=this._chart)||void 0===e?void 0:e._loadCallback)&&(setTimeout(this._chart._loadCallback,0),this._chart._loadCallback=void 0))}_doAfterRender(){this._chartView.bodyView().afterRender()}_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealMapExporter;t&&t.RealMapExport(this.chart)}}_export(t){const e=this.model;if(!e||!this.chart.exporter.isCompose())return;const s=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(s,t,e.options.exporting)}}$_renderLoadingView(t,e){const s=ja.LOADING_VIEW_LENGTH;this._loadingView.layout({width:s,height:s});const i=t/2+20-s/2,r=e/2+20-s/2;this._loadingView.trans(i,r)}}ja.LOADING_VIEW_LENGTH=128;class Ha{static getVersion(){return"1.0.5"}static setDebugging(t){Vt.DEBUGGING=t}static setLogging(t){dt.LOGGING=t}static getDistance(t,e){return dt.getDistance(t,e)}static createChart(t,e,s,r=!0,o){S.loadConfigAsync(s,!0);const n=new ja(t,e);return i(s)&&n.chart.load(s,r,o),n.chart[ko]=n,n.chart}static async createChartAsync(t,e,s,r=!0,o){const n=new ja(t,e);return n.showLoadingView(),await S.loadConfigAsync(s),i(s)&&n.chart.load(s,r,o),n.chart[ko]=n,n.hideLoadingView(),n.chart}static preset(t,e){return Mi.createStockInset(t,e)}}const Ga=Ha.getVersion,Ya=Ha.setDebugging,Wa=Ha.setLogging,Za=Ha.getDistance,Ua=Ha.createChart,Xa=Ha.createChartAsync,Ka=Ha.preset;t.Annotation=Ke,t.BarSeries=dr,t.Body=Co,t.BodyView=va,t.BubbleSeries=Is,t.ChartControl=ja,t.ChartElement=Bo,t.ChartItem=He,t.ChartObject=Mo,t.ChartView=za,t.CircleElement=Zn,t.CircleGauge=xr,t.ClockGauge=Tr,t.Color=Ae,t.ContentView=Ho,t.DataPointLabel=cs,t.ElementPool=Go,t.Exporter=Xs,t.FigureSeries=$r,t.HeatmapSeriesType="heatmap",t.ImageAnnotation=Wi,t.ImageSeries=Br,t.Legend=$s,t.LineElement=hn,t.LineSeries=Gr,t.MapAxis=hi,t.MapAxisBandGuide=ri,t.MapAxisGuide=si,t.MapAxisLineGuide=ii,t.MapAxisRangeGuide=oi,t.MapChart=Po,t.MapCrosshair=ai,t.MapSeries=Ur,t.MapSeriesType="map",t.MarkerSeries=ys,t.MarkerSeriesPoint=bs,t.MarkerSeriesPointView=xn,t.MarkerSeriesView=vn,t.ORG_ANGLE=N,t.OrthogonalSparkSeries=Ss,t.PI_2=I,t.PanelSeries=to,t.PieSeries=so,t.PinSeries=oo,t.PointElement=fn,t.PointLabelView=_n,t.PointSeries=ho,t.PointViewPool=dn,t.RAD_DEG=E,t.RectElement=Qe,t.RmElement=Vt,t.RouteSeries=_o,t.RouteSeriesType=Je,t.SectionView=jo,t.SectorElement=zn,t.Series=ps,t.SeriesAnimation=Tn,t.SeriesView=wn,t.ShapeAnnotation=Zi,t.Size=$o,t.SparkSeries=vs,t.Subtitle=Gi,t.TextAnnotation=Ui,t.TextElement=Ie,t.TiledWebSeriesType="tiledweb",t.Title=Hi,t.Utils=dt,t.ValueSeries=fs,t.VectorSeries=po,t.WaffleSeries=mo,t._isIE=ct,t.absv=m,t.assignObj=l,t.calcPercent=W,t.copyObj=f,t.cos=_,t.createChart=Ua,t.createChartAsync=Xa,t.createRect=function(t,e,s,i){return{x:t,y:e,width:s,height:i}},t.extend=ze,t.fixnum=D,t.getDistance=Za,t.getVersion=Ga,t.incv=v,t.isArray=r,t.isEmptyRect=function(t){return t.width<=0||t.height<=0},t.isObject=i,t.isString=n,t.maxv=g,t.minv=p,t.parsePercentSize=Y,t.pickNum=b,t.pickProp=w,t.pickProp3=x,t.pixel=O,t.preset=Ka,t.rectToSize=ut,t.setDebugging=Ya,t.setLogging=Wa,t.sin=u});
|