realmap 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * Realmap v1.1.0
3
+ * Realmap v1.1.1
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t},a=function(t){return"boolean"==typeof t},h=Object.assign,l=Math.cos,c=Math.sin,d=Math.min,_=Math.max,u=Math.abs,p=function(t){if(t&&"object"==typeof t&&!s(t))return h({},t)},g=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},m=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t},f=function(t,e){return void 0!==t?t:e},b=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},y=(t,e,i)=>t+(e-t)*i;class w{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}w._debugging=!1;class x{static async loadConfigAsync(t,e=!1){if(t&&t.map){if(n(t.map))t.map={url:t.map};else if(s(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const r=s(t.map)?t.map:[t.map];for(const t of r)!i(t.source)&&n(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url))}if(t&&t.series){const r=s(t.series)?t.series:[t.series];for(const t of r)!i(t.data)&&!s(t.data)&&n(t.dataUrl)&&t.dataUrl&&(e?console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl):(t.data=await this.fetchJson(t.dataUrl),delete t.dataUrl))}}static async fetchJson(t){try{const e=await fetch(t);if(!e.ok){const i=new Error(`HTTP error! status: ${e.status}`);throw i.name="NetworkError",i.message=`데이터 요청에 실패했습니다. URL을 확인하세요: ${t}`,i}return await e.json()}catch(t){if("NetworkError"===t.name)throw t;throw t.name="ParsingError",t.message="JSON 데이터를 파싱하는 중 오류가 발생했습니다.",t}}}const v={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 S=v.ko;const C=void 0,L="%".charCodeAt(0),k=Math.PI,M=2*k,A=-k/2,P=k/180,I=180/k;function N(t){return t>M?t%M:t}function E(t){return parseFloat(t.toPrecision(12))}function T(t){return t*Math.PI/180}function V(t){return 180*t/Math.PI}function D(t){return t+"px"}function R(t){return t+"%"}function $(t){return null==t||Number.isNaN(t)||""===t}function O(t){return null==t||Number.isNaN(t)||""===t}function F(t){return t<10?"0"+t:String(t)}function B(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function z(t,e){const i={};return i[t]=e,i}function j(t,e){let i,s;if(null==t||Number.isNaN(t)){if(e)return null;s=0,i=!0}else if(!(i=!isNaN(s=+t))){const i=t.trim();if(i.charCodeAt(i.length-1)===L&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;Z(S.invalidSizeValue,t)}}return{size:s,fixed:i}}function G(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}const H={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"},W=function(t){const e=H[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return H[t]=e,e}return e};var Y;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(Y||(Y={}));const Z=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},U="vertical-lr",X="vertical-rl";function K(t){const e=String(t).split(/\s+/g),i=g(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(s)?i:s:n,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const q={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},J=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const Q="undefined"!=typeof navigator?navigator.userAgent:"",tt=Q?navigator.appVersion:"",et=!!Q.match(/Trident.*rv\:11\./),it=-1!==tt.indexOf("MSIE 10"),st=-1!==tt.indexOf("MSIE 9"),rt=et||it||st;class nt{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 i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),i=t.getDate(),s=[0,31,59,90,120,151,181,212,243,273,304,334][e]+i;return e>1&&nt.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(d(i,nt.month_days[nt.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(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 s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static 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 i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-J}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=_(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=_(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];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 i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static 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=s(t)?[]:{};for(let i of Object.keys(t))e[i]=nt.deepClone(t[i]);return e}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const i=+new Date;e(),nt.log(t,+new Date-i+"ms")}static clamp(t,e,i){return _(e,d(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=_(e,t)),isNaN(i)||(t=d(i,t)),t}static makeIntArray(t,e){const i=new Array(_(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],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,i){const s=u(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const i=(e[0]-t[0])*P,s=(e[1]-t[1])*P,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*P)*Math.cos(e[0]*P)*Math.sin(s/2)*Math.sin(s/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],i=t[0];for(let s=1;s<t.length;s++)e=d(e,t[s]),i=_(i,t[s]);return{min:e,max:i}}static valueAt(t,e){if(e&&(this.isObject(t)||s(t))){const i=e.split(".");let s=t;for(let t of i)s=s[t];return s}return t}static normalizeToSteps(t,e){if(t.length<2)return t;const i=Math.min(...t),s=Math.max(...t);if(i===s)return[i];const r=(s-i)/(e-1),n=10**Math.floor(Math.log10(r)),o=r/n;let a;a=o<=1?1:o<=2?2:o<=5?5:10,a*=n;const h=Math.floor(i/a)*a,l=[];a=(Math.ceil(s/a)*a-h)/(e-1);for(let t=0;t<e;t++)l.push(E(h+t*a));return l}}nt.LOGGING=!1,nt.week_days=["일","월","화","수","목","금","토"],nt.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],nt.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 ot=Object.freeze({x:0,y:0,width:0,height:0}),at=function(t,e,i,s){return{x:t,y:e,width:i,height:s}};function ht(t){return{width:t.width,height:t.height}}function lt(t){return t.width<=0||t.height<=0}class ct{static create(t,e,i,s){const r=arguments.length;return nt.isObject(t)?new ct(t.x,t.y,t.width,t.height):r<2?new ct(t,t,t,t):r<3?new ct(t,e,t,e):new ct(t,e,i,s)}constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}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 ct(this.x,this.y,this.width,this.height)}getInner(){return new ct(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,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,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,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),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+"}"}}ct.Empty=new ct,ct.Temp=new ct;const dt={inOutSine:t=>-(l(k*t)-1)/2};class _t{constructor(){this.delay=0,this.duration=_t.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=d(1,_(0,E(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 isNaN(t)||(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,i=null){this._started&&this._stop(),this.duration=g(t,_t.DURATION),this.delay=e||0,this._easing=dt[i],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}}_t.DURATION=700,_t.SHORT_DURATION=300;let ut=0;class pt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(ut++))}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 gt extends pt{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const i=Array.prototype.slice.call(arguments,0);i[0]=this;for(const e of this._listeners){const s=e[t];if(s){const t=s.apply(e,i);if(void 0!==t)return t}}}}class mt{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new mt(t,t,t,t):new mt(t,t,e,e):new mt(t,e,i,s)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,i=0,s=0){this.top=t,this.bottom=e,this.left=i,this.right=s}clone(){return new mt(this.top,this.bottom,this.left,this.right)}set(...t){for(const e of t)if(isNaN(e))return;const e=t.length;1===e?this.top=this.bottom=this.left=this.right=t[0]:2===e?(this.top=this.bottom=t[0],this.left=this.right=t[1]):3===e?(this.top=t[0],this.bottom=t[1],this.left=this.right=t[2]):e>3&&(this.top=t[0],this.right=t[1],this.bottom=t[2],this.left=t[3])}applyPadding(t){return this.left=g(t.paddingLeft,0),this.right=g(t.paddingRight,0),this.top=g(t.paddingTop,0),this.bottom=g(t.paddingBottom,0),this}applyMargin(t){return this.left=g(t.marginLeft,0),this.right=g(t.marginRight,0),this.top=g(t.marginTop,0),this.bottom=g(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+"}"}}var ft;mt.Empty=Object.freeze(new mt),mt.Temp=new mt,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(ft||(ft={}));const bt={name:"RealMap",version:"1.1.0",license:"enterprise",code:""},yt={name:"RealMap",version:"1.1.0",license:"enterprise",code:null};class wt{static decode(t){const e=wt.CHARS,i=wt.PAD;let s=t.split(""),r=[],n=s.length;for(;s[--n]==i;);for(let t=0;t<n;){let i=e.indexOf(s[t++])<<18;t<=n&&(i|=e.indexOf(s[t++])<<12),t<=n&&(i|=e.indexOf(s[t++])<<6),t<=n&&(i|=e.indexOf(s[t++])),r.push(i>>>16&255),r.push(i>>>8&255),r.push(255&i)}for(;0==r[r.length-1];)r.pop();return r}}wt.PAD="=",wt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class xt{static union(t,e){const i=e.s3[255&t];t>>=8;const s=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^s>>16)<<16|65535&(65535&o^65535&s),(o>>16)+(i>>16)+((65535&o)+(65535&i)>>16)<<16|(65535&o)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=xt.xor,s=xt.union;let r=t.left,n=t.right;r=i(r,e.p[0]),n=i(n,i(s(r,e),e.p[1])),r=i(r,i(s(n,e),e.p[2])),n=i(n,i(s(r,e),e.p[3])),r=i(r,i(s(n,e),e.p[4])),n=i(n,i(s(r,e),e.p[5])),r=i(r,i(s(n,e),e.p[6])),n=i(n,i(s(r,e),e.p[7])),r=i(r,i(s(n,e),e.p[8])),n=i(n,i(s(r,e),e.p[9])),r=i(r,i(s(n,e),e.p[10])),n=i(n,i(s(r,e),e.p[11])),r=i(r,i(s(n,e),e.p[12])),n=i(n,i(s(r,e),e.p[13])),r=i(r,i(s(n,e),e.p[14])),n=i(n,i(s(r,e),e.p[15])),r=i(r,i(s(n,e),e.p[16])),t.right=r,t.left=i(n,e.p[17])}static _decryptBlock(t,e){const i=xt.xor,s=xt.union;let r=t.left,n=t.right;r=i(r,e.p[17]),n=i(n,i(s(r,e),e.p[16])),r=i(r,i(s(n,e),e.p[15])),n=i(n,i(s(r,e),e.p[14])),r=i(r,i(s(n,e),e.p[13])),n=i(n,i(s(r,e),e.p[12])),r=i(r,i(s(n,e),e.p[11])),n=i(n,i(s(r,e),e.p[10])),r=i(r,i(s(n,e),e.p[9])),n=i(n,i(s(r,e),e.p[8])),r=i(r,i(s(n,e),e.p[7])),n=i(n,i(s(r,e),e.p[6])),r=i(r,i(s(n,e),e.p[5])),n=i(n,i(s(r,e),e.p[4])),r=i(r,i(s(n,e),e.p[3])),n=i(n,i(s(r,e),e.p[2])),r=i(r,i(s(n,e),e.p[1])),t.right=r,t.left=i(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const i=xt.kb,s=xt._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:i.p.slice(0).map((function(t){let i,s=e.length;for(i=0;i<4;i++)h=h*xt.POW8|e[a++%s];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:i.s0.slice(0),s1:i.s1.slice(0),s2:i.s2.slice(0),s3:i.s3.slice(0)};for(r=0,o=c.p.length;r<o;)s(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=c["s"+r].length;n<o;)s(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const i=xt._decryptBlock;let s=xt._init(e),r=[],n=wt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*xt.POW24|n[a+1]*xt.POW16|n[a+2]*xt.POW8|n[a+3],h.right=n[a+4]*xt.POW24|n[a+5]*xt.POW16|n[a+6]*xt.POW8|n[a+7],i(h,s);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)}}xt.POW2=Math.pow(2,2),xt.POW3=Math.pow(2,3),xt.POW4=Math.pow(2,4),xt.POW8=Math.pow(2,8),xt.POW16=Math.pow(2,16),xt.POW24=Math.pow(2,24),xt.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 vt{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 i=0,s=t.length;i<s;i++)e+=String.fromCharCode(t[i]>>1);return e}static includedDomains(t,e,i){let s=t.split(",");for(let t=0,r=s.length;t<r;t++){const r=s[t];if(this.eqaulsUpperDomain(r,e))return!0;if(i&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(i))return!0}const n=r.split(".").length,o=r.indexOf("*");if(n>=2&&n<=4&&o>=2){const t=r.substring(0,o);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},i=xt.decrypt(t,"dkdl"+this._getLDKey(xt.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],n=s[1];n&&n.length>0&&(e[r]=n)}return e}}let St=651212;class Ct{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,i=""){return t.style.display=e?i||"":"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 i=e;for(;i;){if(i==t)return!0;i=i.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,i=e.defaultView,s=t.getBoundingClientRect(),r=e.body,n=e.documentElement,o=i.pageYOffset||n.scrollTop||r.scrollTop,a=i.pageXOffset||n.scrollLeft||r.scrollLeft,h=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=s.left+a-l,d=s.top+o-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,i){t.style.left=e+"px",t.style.top=i+"px"}static moveI(t,e,i){t.style.left=(e>>>0)+"px",t.style.top=(i>>>0)+"px"}static resize(t,e,i){t.style.width=e+"px",t.style.height=i+"px"}static resizeSVG(t,e,i){t.setAttribute("viewBox",`0 0 ${e} ${i}`)}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,i=e.defaultView;return{width:i.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:i.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const i=t.style;i.left=e.x+"px",i.top=e.y+"px",i.width=e.width+"px",i.height=e.height+"px"}static setBounds(t,e,i,s,r){const n=t.style;n.left=e+"px",n.top=i+"px",n.width=s+"px",n.height=r+"px"}static setBoundsEx(t,e,i,s,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(i)&&(n.top=i+"px"),!isNaN(e)&&(n.width=s+"px"),!isNaN(e)&&(n.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 i=e.children;for(let e=i.length;e--;)if(i[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;)Ct.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 i in e)t[i]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,i){if(e!=i){if(i)for(const e in i)t[e]="";return e&&Object.assign(t,e),e}return i}static createElement(t,e,i){const s=t.createElement(e);return i&&Object.assign(s.style,i),s}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,i){null==i||""===i?delete t.dataset[e]:t.dataset[e]=i}static toggleData(t,e,i){i?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,i){t.style.setProperty(e,i)}static animate(t,e,i,s,r=150,n="none"){const o={},a={};return o[e]=i,a[e]=s,t.animate([o,a],{duration:r,fill:n})}static setAttr(t,e,i){null!=i&&""!==i?t.setAttribute(e,i):t.removeAttribute(e)}static setAttrs(t,e){for(const i in e){const s=e[i];null!=s&&""!==s?t.setAttribute(i,s):t.removeAttribute(i)}}static getDomId(){return"-rtc-"+St++}static createBR(t,e){const i=t.createElement("br");return i.className=e,i}static createSpan(t,e){const i=t.createElement("span");return e&&Object.assign(i.style,e),i}static createCheckBox(t,e){const i=t.createElement("input");return i.type="checkbox",e&&Object.assign(i.style,e),i}static createRadio(t,e){const i=t.createElement("input");return i.type="radio",e&&Object.assign(i.style,e),i}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){w.debugging(),console.error(t)}return null}static childByPath(t,e){let i=t;if(e){let t=0;for(;t<e.length;)i=i.childNodes[e[t++]]}return i}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,i){t.setProperty(e,i,"important")}static setNoScale(t){!rt&&t.setAttribute("vector-effect","non-scaling-stroke")}}const Lt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class kt extends pt{constructor(t,e,i){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._domResize=!1,this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&this._domResized()},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=yt.code||realMapLic,!e)return!1}catch(t){return!1}const i=vt.decrypt(e);if("RealMap"!=i.name||"RealMap"!==bt.name)return!1;const s=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(bt.license!=ft.Developer&&!vt.includedDomains(s,t.toLowerCase(),r))return!1;const n=i.lic.toLowerCase();if(!Object.values(ft).includes(n))return!1;if(bt.code=i.code,bt.license=i.lic,n==ft.Evaluation||n==ft.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)return!1}return!0}()?(!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,i||kt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._registerEventHandlers(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),Ct.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(){Ct.clearChildren(this._defs)}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)}}setDomResize(t){t!=this._domResize&&(this._domResize=t)}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}hasDef(t){return!!this._defs.querySelector("#"+t)}clipBounds(t=NaN,e=NaN,i=NaN,s=NaN,r=0){return this.clip(new Dt(this.doc(),t,e,i,s,r,r))}clip(t){return this._defs.appendChild(t.dom),t}pointerToPoint(t){const e=this._dom.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_setTesting(){this._testing=!0,Mt.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,i,s){s?t.addEventListener(e,i,{passive:!0}):t.addEventListener(e,i)}_registerEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"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){var e,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("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(e,i,s){if(this._inited)return;i instanceof HTMLDivElement?this._container=i:this._container=e.getElementById(i),this._container instanceof HTMLDivElement||Z(S.invalidOuterDiv,i);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");Object.assign(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=s,this._container.appendChild(n);const o=this._svg=r.createElementNS(t,"svg");o.classList.add("rm-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",o.appendChild(a);const h=this._defs=r.createElementNS(t,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Pt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),n.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(e,i){let s=e.createElementNS(t,"filter");const r=e.createElementNS(t,"feDropShadow");s.setAttribute("id",kt.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"),s.appendChild(r),i.appendChild(s)}_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(),i=this._padding=Ct.getPadding(this._root.dom),s=i.left,r=i.top,n=this._svg.clientWidth-s-i.right,o=this._svg.clientHeight-r-i.bottom;this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:s,y:r,width:n,height:o});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=s+(n-t.width)/2+"px",a.style.top=r+(o-t.height)/2+"px"}else a.style.display="none"}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender()}nt.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){}_domResized(){this.invalidateLayout()}}kt.CLASS_NAME="rm-control",kt.SHADOW_FILTER="rm-shadow-filter",kt._animatable=!0;class Mt extends pt{static createElement(e,i){return e.createElementNS(t,i)}static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,i,s){for(;e.length<i;){const i=s();t.add(i),e.push(i)}}static fit(t,e,i,s,r,n){for(;i.length>s;)i.pop().remove();for(;i.length<s;){const s=new r(t,n);e.add(s),i.push(s)}}constructor(e,i,s=C){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,s||"g"),(this._styleName=i)&&this.setAttr("class",i),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.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,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}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}append(t){if(t){const e=t._parent;t._parent=this,this._dom.appendChild(t._dom),e!=this&&t._doAttached(this)}return 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._dom.remove(),this}appendElement(e,i){const s=e.createElementNS(t,i);return this._dom.appendChild(s),s}insertElement(e,i,s){const r=e.createElementNS(t,i);return this._dom.insertBefore(r,s),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 O(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,i,s){return this.trans(t,e).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return ct.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=nt.isValidNum(t)?t:this._tx,e=nt.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)}transc(t){return this.trans(t[0],t[1])}transEx(t,e,i=0,s=!0){if(t=nt.isValidNum(t)?t:this._tx,e=nt.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(i>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:i,fill:"none"});s&&(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&&nt.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&nt.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}transform(t){this.dom.setAttribute("transform",t)}resize(t,e,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}hasSavedStyles(){return void 0!==this._saveStyle||void 0!==this._saveClass}saveStyles(){this._saveStyle=this._dom.getAttribute("style"),this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),delete this._saveStyle),void 0!==this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){this._dom.removeAttribute("style"),this._styles={},this._visible||(this._dom.style.display="none")}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(W(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let i in t)e.setProperty(W(i),this._styles[i]=t[i],"important")}}resetStyles(t){this.clearStyles(),this.internalSetStyles(t)}_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 i=!1;if(t){for(let s in t)if(s in Lt&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(g(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in Lt){const i=Lt[s];e[i]=this._styles[i]=t[s]}i=!0}i&&(this._styleDirty=!0)}return i}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 i=!1;return t in Lt&&e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}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]=f(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 i=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});i&&i.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}hasClip(){return this.hasAttr("clip-path")}setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}clipRect(t,e,i,s,r=0){const n=this.control.clipBounds(t,e,i,s,r);return this.setClip(n),n}clipPath(t){const e=this.control.clip(new Rt(this.doc).setPath(t));return this.setClip(e),e}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}}onScrollStart(){}onScrollEnd(){}_testing(){return Mt.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(nt.isValidNum(e)||nt.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),nt.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+nt.pick(this._originX,t.getAttribute("x"),0)+" "+nt.pick(this._originY,t.getAttribute("y")||0)+")");const r=nt.getNum(this._scaleX,1),n=nt.getNum(this._scaleY,1);1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}Mt.TESTING=!1,Mt.DEBUGGING=!1,Mt.ASSET_KEY="_asset_",Mt.TEMP_KEY="_temp_";class At extends Mt{constructor(t,e=void 0){super(t,e,"g")}}class Pt extends Mt{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class It extends Mt{constructor(t,e=void 0){super(t,e,"use")}get id(){return this._id}setId(t){return t!==this._id&&this.dom.setAttribute("href",this._id=t),this}}class Nt extends Mt{constructor(t,e=void 0,i=void 0){super(t,e,"path"),i&&this.setPath(i)}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 Et extends Mt{constructor(t,e,i=!1){super(t,e,i?"g":"path"),this.group=i}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 Tt extends Mt{constructor(t){super(t,C,"mask");const e=this._id=nt.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Vt extends Mt{constructor(t){super(t,C,"clipPath");const e=this._id=nt.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class Dt extends Vt{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new Mt(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,i,s,r),this.add(a)}setBounds(t,e,i,s){return this._rect.move(t,e),this._rect.resize(i,s),this}resize(t,e,i){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class Rt extends Vt{constructor(t,e){super(t),this._path=new Nt(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var $t;!function(t){t.SIDO="sido"}($t||($t={}));const Ot="shuffle",Ft="random";var Bt;class zt{constructor(t){this.source=t}hasDef(){return!0}}class jt extends zt{getElement(t,e){throw new Error("Method not implemented.")}}jt.TYPE="shape";class Gt extends zt{getElement(t,e){throw new Error("Method not implemented.")}}Gt.TYPE="image";class Ht extends zt{_setStops(e,i){const r=e.createElementNS(t,"stop"),n=e.createElementNS(t,"stop"),o=this.source.color,a=$(this.source.opacity)?1:this.source.opacity,h=s(o)?o[0]:o,l=s(o)&&o.length>1?o[1]:"white",c=s(a)?a[0]:a,d=s(a)&&a.length>1?a[1]:a;i.setAttribute("id",this.source.id),r.setAttribute("offset","0"),r.setAttribute("stop-color",h),r.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",l),n.setAttribute("stop-opacity",d),i.appendChild(r),i.appendChild(n)}}class Wt extends Ht{getElement(e,i){const s=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,s),i.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return s.setAttribute("x1",r),s.setAttribute("y1",o),s.setAttribute("x2",n),s.setAttribute("y2",a),s}}Wt.TYPE="lineargradient";class Yt extends Ht{getElement(e,i){const s=e.createElementNS(t,"radialGradient");return $(i.cx)||s.setAttribute("cx",i.cx),$(i.cy)||s.setAttribute("cy",i.cy),$(i.r)||s.setAttribute("r",i.r),this._setStops(e,s),s}}Yt.TYPE="radialgradient";class Zt extends zt{getElement(e,s){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,l,c,d,_=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+s.pattern>=0){const t=Bt.STOCK[+s.pattern%Bt.STOCK.length];a=t.path,l=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),l&&h(o.style,l),s.style&&h(o.style,s.style),_&&(o.style.fill="none");let u=s.backgroundStyle;if(n(u)||i(u)){const i=e.createElementNS(t,"rect");r.append(i),i.style.fill=n(u)?u:u.fill,i.setAttribute("width",String(c)),i.setAttribute("height",String(d))}return s.transform&&r.setAttribute("patternTransform",s.transform),r.append(o),r}}Bt=Zt,Zt.TYPE="pattern",Zt.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}],Zt.SELECT=Object.assign(Bt.STOCK[4],{id:"rm-selected-area-fill",pattern:Bt.STOCK[4].path,transform:"scale(0.5)"});class Ut extends zt{prepare(){const t=this.source;return this._colors=s(t.colors)?t.colors.slice():[],t.mode===Ft?this._index=-1:(t.mode===Ot&&nt.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=s(e.colors)?e.colors:[]}}Ut.TYPE="colors";class Xt 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 i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}}))}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||Xt.SIZE,height:e.height||e.width||Xt.SIZE})}}Xt.TYPE="images",Xt.SIZE=20;class Kt{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(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 Zt(Zt.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(Mt.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(Mt.ASSET_KEY,"1"),e.addDef(s)}))}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=Zt.TYPE:s(t.colors)?e=Ut.TYPE:s(t.images)?e=Xt.TYPE:null!=t.url?e=Gt.TYPE:null!=t.path&&(e=jt.TYPE)),e)switch(e.toLowerCase()){case jt.TYPE:return new jt(t);case Gt.TYPE:return new Gt(t);case Wt.TYPE:return new Wt(t);case Yt.TYPE:return new Yt(t);case Zt.TYPE:return new Zt(t);case Ut.TYPE:return new Ut(t);case Xt.TYPE:return new Xt(t)}}}}const qt="0".charCodeAt(0),Jt="#".charCodeAt(0),Qt=",".charCodeAt(0),te="s".charCodeAt(0),ee="a".charCodeAt(0);class ie{static getFormatter(t){let e=ie.Formatters[t];return e||(ie.Formatters[t]=e=new ie(t)),e}static get Default(){return ie.getFormatter(ie.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 i=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,i}$_parse(t){const e=t.length;if(e>0){const i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===qt;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===Jt;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===qt;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===Qt){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===te){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===ee){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}ie.DEFAULT_FORMAT="",ie.Formatters={};const se=["yy","yyyy","M","MM","d","dd","WW","W","w","ww","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],re=[".","/","-",":"],ne="Z".charCodeAt(0),oe="z".charCodeAt(0),ae="A".charCodeAt(0),he="a".charCodeAt(0),le="y".charCodeAt(0),ce="M".charCodeAt(0),de="m".charCodeAt(0),_e="W".charCodeAt(0),ue="w".charCodeAt(0),pe="d".charCodeAt(0),ge="H".charCodeAt(0),me="h".charCodeAt(0),fe="S".charCodeAt(0),be="s".charCodeAt(0);class ye{static getFormatter(t){let e=ye.Formatters[t];return e||(ye.Formatters[t]=e=new ye(t)),e}static get Default(){return ye.getFormatter(S.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||S.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const i=this._tokens;let s="";for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o.length;switch(o.charCodeAt(0)){case le:s+=a>2?t.getFullYear():F(t.getFullYear()%100);break;case ce:s+=a>1?F(t.getMonth()+1):t.getMonth()+1;break;case pe:s+=a>1?F(t.getDate()):t.getDate();break;case _e:s+=a>1?F(nt.weekOfYear(t,e)+1):nt.weekOfMonth(t,e,!0)+1;break;case ue:s+=a>1?nt.long_week_days[t.getDay()]:nt.week_days[t.getDay()];break;case ge:s+=a>1?F(t.getHours()):t.getHours();break;case me:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?F(e):e}else s+=a>1?F(t.getHours()):t.getHours();break;case de:s+=a>1?F(t.getMinutes()):t.getMinutes();break;case be:s+=a>1?F(t.getSeconds()):t.getSeconds();break;case he:case ae:t.getHours()<12?s+=S.am:s+=S.pm;break;case fe:let i=t.getMilliseconds();s+=3==a?B(i):2==a?F(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(re.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<s&&i.charAt(r)==n;)r++;if(n=i.substring(o,r),se.indexOf(n)<0){let e=n.charCodeAt(0);(e>=ae&&e<=ne||e>=he&&e<=oe)&&Z(S.invalidDateFormat,t)}e.push(n)}if(r<s&&nt.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&nt.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||S.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}ye.Formatters={};const we=["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"],xe=["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 ve{static create(t){return n(t)?new ve(t):void 0}static isBright(t){return new ve(t).isBright()}static getContrast(t,e,i){return new ve(t).getContrast(e,i)}static interpolate(t,e,i){const s=new ve(null);return s.r=Math.ceil(t.r+(e.r-t.r)*i),s.g=Math.ceil(t.g+(e.g-t.g)*i),s.b=Math.ceil(t.b+(e.b-t.b)*i),s.a=(e.a+t.a)/2,s}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(nt.startsWith(t,"rgb(")&&nt.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(nt.startsWith(t,"rgba(")&&nt.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(nt.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{ve.COLORS[t]&&this.$_parseNumber(ve.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 ve(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}}var Se,Ce,Le;ve.COLORS=function(){const t={};for(let e=0;e<we.length;e++)t[we[e]]=xe[e];return t}(),function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Se||(Se={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Ce||(Ce={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Le||(Le={}));class ke extends Mt{constructor(t,e=C){super(t,e,"text"),this._layout=Ce.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(t){const e=this.bbox(),i=this.getAscent(isNaN(t)?e.height:t);let s;switch(this._layout){case Ce.MIDDLE:s=Math.floor(i/2);break;case Ce.BOTTOM:s=i-e.height;break;default:s=Math.ceil(i)}this.setAttr("y",s)}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 i=this._text;if(!i)return;const s=this.dom;let r,n=0,o=i.length;do{r=Math.ceil((n+o)/2);s.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=i.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=i.substring(0,--n)+"…"}setContrast(t,e,i){return this.internalSetStyleOrClass(ve.isBright(getComputedStyle(t).fill)?e:i),this}setStyle(t,e){let i=!1;return t in Lt||e===this._styles[t]||(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i&&this.layoutText(),i}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this.dom.setAttribute(s,r),i[s]=r,e=!0)}e&&(this._styleDirty=!0)}return e&&this.layoutText(),e}clearDom(){super.clearDom(),this._dirty=!0}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 Me="$_TH",Ae="$_TW";class Pe{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const i=this._literals;let s=this.text;if(i&&e.callback)for(let r=0;r<i.length;r+=4){let n=e.callback(t,i[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=i[3]?ie.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=i[3]?ye.getFormatter(i[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=i[r+2]||"");s=s.replace(i[r],n)}return s}prepareSpan(t,e,i){const s=this.getText(e,i);return t.textContent=s,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let i=t.indexOf("${",e);if(i<0&&(i=t.indexOf("%{",e)),i<0)break;const s=t.indexOf("}",i+2);if(s<0)break;const r=t.substring(i,s+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),C),0===this._literals[2].length&&(this._literals[2]=C)}else this._literals.push(r,n,C,C);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Ie extends Pe{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,n=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,n),t}_doPrepare(t,e,i,s){t.textContent=e.substring(i,s);const r=e.indexOf("style=");if(r>0&&r<i){const s=e[r+6],n=e.indexOf(s,r+7);n>0&&n<i&&t.setAttribute("style",e.substring(r+7,n))}}}class Ne extends Ie{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,i,s){e.substring(2,i-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const i=t.substring(0,e),s=t.substring(e+1,t.length),r=s.substring(1,s.length-1);switch(i){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-link")}}const Ee={t:class extends Ie{tag(){return"</t>"}},b:class extends Ie{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends Ie{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:Ne};class Te{get words(){return this._words.slice()}parse(t){function e(t){const e=i.length;e>0&&""===i[e-1].type?i[e-1].text+=t:i.push((new Pe).parse(t))}const i=this._words=[];let s=0;for(;s<t.length;){if("<"==t[s]){const i=t[s+1];let r;if(i in Ee){const e=t.indexOf(">",s+2);if(e>=0){const n="</"+i+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(s,o+n.length);r=(new Ee[i]).parse(e),s+=e.length}}}if(!r){e(t.substring(s));break}this._words.push(r)}else{const i=t.indexOf("<",s+1);if(!(i>=0)){e(t.substring(s));break}e(t.substring(s,i)),s=i}}return this}}const Ve=/<br.*?>|\r\n|\n/;class De{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,s,r,n,o){const a=e.doc,h=g(this.lineHeight,1),l=this._lines,c=l.length,d=[],u=[];e.clearDom(),n=n||e;const p=e.getStyle("writing-mode"),m=p===U||p===X;for(let s=0;s<c;s++){const r=l[s];let p=0,g=0,f=null;for(let[h,l]of r.words.entries()){const d=0===s&&0===h,u=s===c-1&&h===r.words.length-1,b=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=d&&t.prefix||"",i=u&&t.suffix||"";b.textContent=e+(b.textContent||"")+i}const y=b.getBBox();if(b[Ae]=y.width,b[Me]=y.height,m?(p=_(p,b[Ae]),g+=b[Me]):(p+=b[Ae],g=_(g,b[Me])),f||(f=b),l instanceof Ne){const i=a.createElementNS(t,"a");i.setAttribute("href",l.url),i.setAttribute("target",l.target),i.appendChild(b),e.appendDom(i)}}u.push(f),r[Me]=g*h,r[Ae]=p*h,d.push(0==s?r[Ae]/2:r[Ae])}if(c>0){let t=l[0];for(let i=1;i<u.length;i++)if(u[i]){let s=0,r=0;if(m?null!=u[i-1]&&(s=Math.floor(t[Ae]-e.getAscent(t[Ae]))+e.getAscent(l[i][Ae])):r=t[Me]-e.getAscent(t[Me])+e.getAscent(l[i][Me]),null==u[0]&&u[i]==u.find((t=>null!=t))){const r=e.insertElement(a,"tspan",u[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[Ae]=n.width,r[Me]=t[Me]=n.height,u[0]=r}switch(p){case U:u[i].setAttribute("dx",String(s)),u[i].setAttribute("y","0");break;case X:u[i].setAttribute("dx",String(-s)),u[i].setAttribute("y","0");break;default:u[i].setAttribute("x","0"),u[i].setAttribute("dy",String(r))}t=l[i]}if(m){const t=e.parent.dom.classList.contains("rm-annotation"),i=e.bbox().width,[s]=u,r=s[Ae];if(t)s.setAttribute("dx",String(p===X?i-r/2:r/2));else switch(p){case U:s.setAttribute("x",String((i-r)/-2));break;case X:s.setAttribute("x",String((i-r)/2))}}else e.layoutText(l[0][Me])}}layout(t,e,i,s,r){const n=t.bbox();let o=0,a=0;const h=t.getStyle("writing-mode");if(h===U||h===X)switch(o=r.left+(i-r.left-r.right-n.width),e){case"center":t.anchor=Se.MIDDLE,a=r.top+(s-r.top-r.bottom)/2;break;case"right":t.anchor=Se.END,a=n.height-r.bottom;break;default:t.anchor=Se.START,a=r.top}else switch(a=r.top+(s-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=Se.MIDDLE,o=r.left+(i-r.left-r.right)/2;break;case"right":t.anchor=Se.END,o=i-r.right;break;default:t.anchor=Se.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(Ve);for(let t of i)e.push((new Te).parse(t))}}}let Re=0;const $e=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},Oe=function(t,e){const r=i(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];s(n)?r[t]=n.slice(0):n instanceof Date?r[t]=new Date(n):i(n)?r[t]=Oe(r[t],n):r[t]=n}return r};class Fe extends pt{constructor(t){super(),this.chart=t,Re++}_init(){const t=this._op=Oe({},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(e,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(r,t)||Oe(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 Fe&&(s._children.push(e),t.hasOwnProperty(e)&&i.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,i=!0){if(this[t]instanceof Fe)this[t]._doSetSimple(e);else{const s=this._op;e!==s[t]&&(s[t]=e,this.$_applyOptions(s),i&&this._optionChanged())}return this}toggleOption(t,e=!0){const i=this._op,s=i[t];return i[t]=!a(s)||!s,this.$_applyOptions(i),e&&this._optionChanged(),this}removeOption(t,i=!0){const s=this._op;if(s.hasOwnProperty(t)){delete s[t];const r=self.constructor.defaults;e.call(r,t)&&(s[t]=r[t]),this.$_applyOptions(s),i&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=Oe({},e.constructor.defaults),e.$_applyOptions(e._op),e._children)e._children.forEach((i=>e._op[i]=t(e[i])));else{e._children=[];for(const i in e){const s=e[i];s instanceof Fe&&(e._op[i]=t(s))}}return e._op}(this),t&&this._optionChanged(),this}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,e,i=!0){let s=this._op.style;return t&&(s||(s=this._op.style={}),null!=e&&""!==e||(e=void 0),s[t]!==e&&(void 0===e?delete s[t]:s[t]=e),this.$_applyOptions(this._op),i&&this._optionChanged()),this}setStyles(t,e=!0){let s=this._op.style;if(i(t)){let i=!1;s||(s=this._op.style={});for(const e in t){let r=t[e];null!=r&&""!==r||(r=void 0),s[e]!==r&&(void 0===r?delete s[e]:s[e]=r,i=!0)}i&&(this.$_applyOptions(this._op),e&&this._optionChanged())}return this}_prepareRender(){this._doPrepareRender(this.chart,this._op)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof Fe?t[r]=this[r]._load(n):s(n)?t[r]=n.slice(0):n instanceof Date?t[r]=new Date(n):i(n)?t[r]=Object.assign({},n):t[r]=n)}}_doSetSimple(t,e){if(a(e))return t.visible=e,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`;t[e]!==this[i]&&(this[`${i}Dim`]=j(this[i]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){e.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 r=t[e];this._doLoadProp(e,r)||(this[e]instanceof Fe?this[e].updateOptions(r):s(r)?this[e]=r.slice(0):r instanceof Date?this[e]=new Date(r):i(r)?this[e]=h({},r):this[e]=r)}}_doPrepareRender(t,e){}_doAfterRender(){}}Fe.REFRESHED="refreshed",Fe.defaults={visible:!0};class Be{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 ze extends Fe{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=g(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?ie.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,i,s,r,n){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,n),e&&this._richTextImpl.build(e,i,s,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new De),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,i){if(nt.isValidNum(t)){const s=this._numSymbols&&e&&nt.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this.$_getNumberText(e,i,s)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}getNumberText(t,e,i,s){let r="";if(nt.isValidNum(t)){const n=this._numSymbols&&e&&nt.scaleNumber(t,this._numSymbols,i);r=this._numberFormatter?n?this._numberFormatter.toStrEx(n.value,s)+n.symbol:this._numberFormatter.toStrEx(t,s):n?n.value+n.symbol:String(t)}return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}ze.defaults=$e(Fe.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class je extends ze{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t,e){if(this._images=null,e.imageList){const i=t._assets.get(e.imageList);i instanceof Xt&&(this._images=i)}this._root=this._images?"":e.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 i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2);return i instanceof Xt?i.getImage(s):s}return this._root+t}}}je.defaults=$e(ze.defaults,{iconPosition:"default",iconGap:2});class Ge extends Fe{}Ge.defaults=$e(ze.defaults,{});class He extends je{getDisplay(t){const e=this._op.display;return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return g(this._op.gap,t?10:5)}_isVisible(){return this._op.visible&&!!this._op.text}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}He.defaults=$e(je.defaults,{display:"auto"});class We extends Fe{constructor(){super(...arguments),this._index=0}get index(){return this._index}get background(){return this._background}get title(){return this._title}get footer(){return this._footer}isVisible(){return this.visible}getOrder(){return isNaN(this.options.order)?1/0:this.options.order}_setGroup(t){this._group=t}getGroup(){return this._group}getLocation(){return this._group?this._group.getLocation():this._location}_setIndex(t){this._index=t}getDefaultDisplay(t){return this.isVertical()?"stack":"inline"}_doInit(t){t.background=(this._background=new Ge(this.chart))._init(),t.title=(this._title=new He(this.chart))._init(),t.footer=(this._footer=new He(this.chart))._init()}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=f(e.location,"bottom")}}We.defaults=$e(Fe.defaults,{offsetX:0,offsetY:0});class Ye extends We{}class Ze extends We{_clean(){this._widgets=[]}_add(t){this._widgets.push(t)}_sort(){this._widgets.sort(((t,e)=>t.getOrder()-e.getOrder()))}getWidget(t){return this._widgets[t]}_internalWidgets(){return this._widgets}_type(){return"group"}isVertical(){return"horizontal"!==this._op.direction}}Ze.defaults=$e(We.defaults,{direction:"vertical"});class Ue extends Be{constructor(){super(...arguments),this._dic={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=n(t)?this._dic[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=n(t)?this._dic[t]:this._items[t];return i&&i.visible?i:e?this._visibles[0]:void 0}beforeRender(){}prepareRender(){this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,r=this._items=[],n=this._dic={};if(s(t))t.forEach(((t,i)=>{r.push(this.$_loadItem(e,t,i))}));else if(i(t))r.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const i={};a(t)&&(i.visible=t),r.push(this.$_loadItem(e,i,0))}r.forEach((t=>{t.options.name&&(n[t.options.name]=t)})),this.chart.options[this._collectionProp()]=this._items.map((t=>t.options))}_canEmpty(){return!0}$_loadItem(t,e,i){const s=this._createWidget(t);return s._init(),s._setIndex(i),s._load(e),s}_collectVisibles(){this._visibles=this._items.filter((t=>t.isVisible()))}}class Xe extends Ue{_collectionProp(){return"widgetGroup"}_createWidget(t){return new Ze(t)}beforeRender(){this._collectVisibles()}}class Ke extends Fe{constructor(){super(...arguments),this.index=-1,this._offsetX=0,this._offsetY=0}get name(){return this._name}getOffset(t,e){const i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:(this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX)||0,y:(this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY)||0}}getSize(t,e){let i,s;return isNaN(i)&&(i=G(this._widthDim,t)),isNaN(s)&&(s=G(this._heightDim,e)),{width:i,height:s}}getPosition(t,e,i,s,r,n){let o,a,h;switch(o=this.getOffset(r,n),a=t,this._op.align||this._getDefaultAlign()){case"center":a+=(i-r)/2+o.x;break;case"right":a+=i-o.x-r;break;default:a+=o.x}switch(o=o||this.getOffset(r,n),h=e,this._op.verticalAlign){case"middle":h+=(s-n)/2-o.y;break;case"bottom":h+=s-o.y-n;break;default:h+=o.y}return{x:a,y:h}}_doApply(t){const e=this,i=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`${this._getNamePrefix()} ${this.index+1}`,(s=t.offsetX)!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_getDefaultAlign(){return"left"}}Ke.defaults=$e(Fe.defaults,{verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class qe extends Be{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.chart,n=this._items=[],o=this._map={};s(t)?t.forEach(((t,i)=>{n.push(this._loadItem(r,t,i,e))})):i(t)&&n.push(this._loadItem(r,t,0,e)),n.forEach((t=>{t.name&&(o[t.name]=t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender()}))}}class Je extends Ye{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}Je.defaults=$e(We.defaults,{});class Qe extends Fe{_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Qe.defaults=$e(Fe.defaults,{text:"RealMap v1.1.0",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const ti="_model_",ei="_tag_",ii="disabled",si="rm-legend-item-marker",ri=Object.freeze([0,0]);function ni(t){return isFinite(t[0]+t[1])}function oi(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function ai(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const n of t){const t=n.map((t=>t[0])),o=n.map((t=>t[1]));e=d(e,...t),i=d(i,...o),s=_(s,...t),r=_(r,...o)}return{h1:e,v1:i,h2:s,v2:r}}const hi=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),li=.001,ci=Math.PI;class di{static line(t,e,i,s){return["M",t,e,"L",i,s]}static lines(...t){let e=0;const i=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i}static lines2(...t){let e=0;const i=["M",t[e].x,t[e].y];for(e++;e<t.length;e++)i.push("L",t[e].x,t[e].y);return i}static lines3(...t){let e=0;const i=["M",t[e][0],t[e][1]];for(e++;e<t.length;e++)i.push("L",t[e][0],t[e][1]);return i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){return r>0?n>0?(r=d(-s/2,i/2,r),["M",t,e-(n=d(-s/2,i/2,n)),"v",s+n+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",s+(r=d(-s/2,i/2,r)),"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r,"Z"]:n>0?["M",t,e-(n=d(-s/2,i/2,n)),"v",s+n,"h",i,"v",-s-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=d(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static ellipse(t,e,i,s){return this.arc(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,!0)}static arc(t,e,i,s,r,n,o,a=!1){const h=N(u(n-r)),d=2*ci-h<.01,_=h-ci<.01?0:1,p=o?1:0,g=l(r),m=c(r),f=l(n-=d?p?li:-.001:0),b=c(n),y=[];return y.push("M",t+i*g,e+s*m,"A",i,s,0,_,p,t+i*f,e+s*b),d&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,i,s,r,n,o,a){const h=N(u(o-n)),d=2*ci-h<li;let _=h-ci<li?0:1;const p=a?1:0,g=l(n),m=c(n),f=l(o-=d?p?li:-.001:0),b=c(o),y=i*r,w=s*r,x=[];return x.push("M",t+i*g,e+s*m,"A",i,s,0,_,p,t+i*f,e+s*b),d?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,_,1-p,t+y*g,e+w*m),x.push("Z"),x}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*c(r+6*Math.PI/5))/2,a=i/2,h=s/2,d=i/4,_=s/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",n+a*l(r),o+h*c(r));for(let t=0;t<5;t++)g.push("L",n+a*l(r),o+h*c(r),"L",n+d*l(r+p),o+_*c(r+p)),r+=u;return g.push("Z"),g}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=di[e](0,0,2*i,2*s);break;default:r=di.circle(i,s,d(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,n=["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&&n.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}const _i={minimumZoom:200,maximumZoom:1600},ui={};class pi extends Ke{static register(...t){t.forEach((t=>{ui[t.type]=t}))}constructor(t,e){super(t),this.inBody=e}_type(){return this.constructor.type}refresh(){}_getNamePrefix(){return"annotation"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doPrepareRender(t,e){}_getDefaultAlign(){return this._anchorObj?"center":super._getDefaultAlign()}}pi.defaults=$e(Ke.defaults,{front:!1});class gi extends qe{constructor(t){super(t.chart),this.owner=t}getAnnotation(t){const e=this._map[t];if(e instanceof pi)return e}load(t,e){super.load(t,e),this.owner.options.annotations=this._items.map((t=>t.options))}prepareRender(){super.prepareRender(),this._visibles.forEach((t=>{t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):void 0}))}_loadItem(t,e,i,s){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,s);return a._init(),a.index=i,a._load(e),a}}const mi="route",fi="map",bi="feature",yi="vector",wi="heatmap",xi="region",vi="tiledweb",Si="track",Ci="band",Li="table",ki="sankey",Mi="glpoint";class Ai extends Mt{static create(t,e,i,s,r,n,o=0){return new Ai(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=void 0,i=void 0){super(t,e,"rect"),this.rect=i}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,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)}}class Pi{constructor(t,e){}}const Ii="@_rm_state_",Ni="@_rm_add_",Ei="@_rm_update_",Ti="@_rm_delete_";let Vi=0;const Di=[0,0];class Ri{constructor(t){this.source=t,this.inset=Di,this.pid=Vi++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[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:s(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.chart.coordOfArea(this.id)),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):s(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,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[Ii]=t:delete this[Ii]}_isAdding(){return this[Ii]===Ni}_isUpdating(){return this[Ii]===Ei}_isDeleting(){return this[Ii]===Ti}_isStatic(){const t=this[Ii];return t!==Ni&&t!==Ti}_assignTo(t){return h(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){var i,r,n,o,a,h;const l=t.options.fields;if(s(l))for(let t=0;t<l.length;t++)this[l[t]]=e[t];else this.id=null===(i=t._idFielder)||void 0===i?void 0:i.call(t,e),this.name=null===(r=t._nameFielder)||void 0===r?void 0:r.call(t,e),this.color=null===(n=t._colorFielder)||void 0===n?void 0:n.call(t,e),this.coord=[null===(o=t._lonFielder)||void 0===o?void 0:o.call(t,e),null===(a=t._latFielder)||void 0===a?void 0:a.call(t,e)],this.value=null===(h=t._valueFielder)||void 0===h?void 0:h.call(t,e)}_readObject(t,e){var i;if(this.id=f(t._idFielder(e),e.id),this.name=f(t._nameFielder(e),e.name),this.color=f(t._colorFielder(e),e.color),this.className=e.className,s(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 s=t._lonFielder(e);if(isNaN(s))return;const r=null===(i=t._latFielder)||void 0===i?void 0:i.call(t,e);if(isNaN(r))return;this.coord=[s,r]}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];this.coord||(this.coord=this.id&&t.chart.coordOfArea(this.id)),isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=s(e.callout)&&this.$_parseCallout(e.callout),s(this.callout)||(this.offset=s(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),s(t)&&(e=[],o(t[0])?e.push(t):t.forEach((t=>{if(s(t))e.push(t.slice(0,2));else if(n(t)){const i=t.split(/s\+/);e.push([i[0],i[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){n(t)&&(this.id=t)}}class $i{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){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const Oi={};class Fi extends je{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}get getPosition(){return this._getPosition}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 nt.isValidNum(t)?this._getText(null,t,u(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return r(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}_doApply(t){super._doApply(t),t.positionCallback?this._getPosition=e=>t.positionCallback({point:e,chart:this.chart.wrapper})||t.position||Fi.DEFAULT_POSITION:this._getPosition=()=>t.position||Fi.DEFAULT_POSITION}}Fi.DEFAULT_POSITION="auto",Fi.defaults=$e(je.defaults,{visible:!0,position:Fi.DEFAULT_POSITION,distance:25});class Bi extends Fe{}Bi.defaults=$e(Fe.defaults,{shape:"circle",radius:2.5});class zi extends Fe{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new Bi(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}zi.defaults=$e(Fe.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class ji{constructor(t,e){this._args=t,this._chart=e}get chart(){return this._chart}get count(){return this._points.length}get(t){if(t>=0&&t<this._points.length)return this._points[t].assignTo(this._args),this._args}}class Gi extends _t{constructor(t,e,i){super(),this.series=t,this.point=e,this.callback=i,this._init(e),this.endHandler=()=>{var t;this.point._setVrate(void 0),this.point._setState(null),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._update(this.point,Math.max(t,1e-7)),this.series._optionChanged(),!0}_init(t){this.duration=500,this.point._setVrate(0)}_update(t,e){this.point._setVrate(e)}}class Hi extends _t{constructor(t,e,i){super(),this.series=t,this.points=e,this.callback=i,this._init(e),e.forEach((t=>{var e;t&&t._prev&&(null===(e=t._prev.ani)||void 0===e||e.stop(),delete t._prev)})),this.duration=500,this.endHandler=()=>{var t;this.points.forEach((t=>{t&&(t._setVrate(void 0),t._setState(null))})),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.points),this.series=this.points=this.callback=null}}_doUpdate(t){return this._update(this.points,Math.max(t,1e-7)),this.series._optionChanged(),!0}_update(t,e){t.forEach((t=>t._setVrate(e)))}}class Wi extends Gi{_init(t){super._init(t),t._setState(Ni)}}class Yi extends Gi{_init(t){super._init(t),t._setState(Ti),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class Zi extends Gi{_init(t){super._init(t),t._setState(Ei)}}class Ui extends Hi{_init(t){t.forEach((t=>{t._setState(Ni),t._setVrate(0)}))}}class Xi extends Hi{_init(t){t.forEach((t=>{t._setState(Ti),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class Ki extends Hi{_init(t){t.forEach((t=>{t._setState(Ei),t._setVrate(0)}))}}class qi extends Fe{static register(...t){t.forEach((t=>{Oi[t.type]=t}))}static getPointTooltipParam(t,e,i){return"series"===i?t.displayName():e.getParam(i)}constructor(t){super(t),this._index=-1,this._seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._dataDirty=!1,this._maxZindex=0,this._points=new $i(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new ji(this.$_createPointArgs(),this.chart.wrapper),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new zi(this))._init()}_createLabel(t){return new Fi(t)}getTooltipText(t,e){var i;const s=this._op.tooltipText;return this._op.tooltipCallback?(this._getPointArgs(this._pointArgs,e),null!==(i=this._op.tooltipCallback(this._pointArgs))&&void 0!==i?i:n(s)?s:qi.defaultTooltipText):"boolean"==typeof s?s?qi.defaultTooltipText:null:s}getTooltipParam(t,e,i){return qi.getPointTooltipParam(t,e,i)}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 index(){return this._index}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,e){if(t!==this._data||e!==this._dataPath)return this._data=nt.valueAt(t,this._dataPath=e),this._dataSourceDirty=!0,!0}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isEmpty(t){return t?this._visPoints.length<1:this._points.isEmpty()}isDataSeries(){return!0}isMapSeries(){return!1}getDetailed(){return this}getValueRange(){}needMapScale(){return!1}needTranslate(){return!0}contains(t){return this._points.contains(t)}isExcluded(t){return!1}initPoints(t){const e=this.chart.map,i=t.map(((t,e)=>this.$_addPoint(t,e)));return e&&e._insets.length>0&&i.forEach((t=>{const i=e.insetAt(t.coord);i&&(t.inset=i.off)})),this._zindexDirty=this._maxZindex>0,i}getPoint(t){return this._points.get(t)}find(t){return this._points.find(t)}findAll(t){return this._points.findAll(t)}getPointText(t,e,i){let s;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),null!=s)?s:i}getPointArgs(t){return this._getPointArgs(this._pointArgs,t)}getPointStyle(t){if(this._op.styleCallback)return this._op.styleCallback(this._getPointArgs(this._pointArgs,t))}getPointLabelStyle(t){if(this.pointLabel.options.styleCallback)return this.pointLabel.options.styleCallback(this._getPointArgs(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&&(this._pointLabelVisCallback?(this._getPointArgs(this._pointArgs,t),this._pointLabelVisCallback(this._pointArgs)):!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,e){this._legend===t&&e.push(this)}getLabelOff(){return g(this._pointLabel.options.offset,this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}pointById(t){return this._points.pointById(t)}canAddAnimation(){return!0}canRemoveAnimation(){return!0}$_dataPointsChanged(){this._dataDirty=!0,this.chart._dataChanged(this)}loadData(t,e=!0){return this.$_setData(t,this._op.dataPath)&&(this._dataLoaded=e,this.$_dataPointsChanged()),this}addPoint(t,e=-1,i=500){var s,r;const n=this.$_addPoint(t,-1);return this._points.insert(e,n),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?(n._prev={},n._prev.ani=new Wi(this,n,(t=>{var e,i;null===(i=(e=this._op).onPointAdded)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(i).start()):null===(r=(s=this._op).onPointAdded)||void 0===r||r.call(s,this._getPointArgs(this._pointArgs,n)),n}addPointList(t,e=-1,i=500){var r,n;if(!s(t)||t.length<1)return;const o=t.map(((t,e)=>this.$_addPoint(t,-1)));return this._points.insertAll(e,o),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?new Ui(this,o,(t=>{var e,i;null===(i=(e=this._op).onPointListAdded)||void 0===i||i.call(e,this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(i).start():null===(n=(r=this._op).onPointListAdded)||void 0===n||n.call(r,this._getPointListArgs(o)),o}removePoint(t,e=300){var i,s,r,a;o(t)?t=this._points.get(t):n(t)&&(t=this._points.pointById(t)),this._points.contains(t)&&(this.chart.animatable()&&e>0&&this.canRemoveAnimation()?(null===(s=null===(i=t._prev)||void 0===i?void 0:i.ani)||void 0===s||s.stop(),t._prev={},t._prev.ani=new Yi(this,t,(t=>{var e,i;this._points.remove(t),null===(i=(e=this._op).onPointRemoved)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(e).start()):(this._points.remove(t),null===(a=(r=this._op).onPointRemoved)||void 0===a||a.call(r,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];o(i)?t[e]=this._points.get(+i):n(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i,s;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new Xi(this,t,(t=>{var e,i;this._points.removeAll(t),null===(i=(e=this._op).onPointListRemoved)||void 0===i||i.call(e,this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(e).start():(this._points.removeAll(t),null===(s=(i=this._op).onPointListRemoved)||void 0===s||s.call(i,this._getPointListArgs(t)),this.$_dataPointsChanged())}removePointList(t,e=300){const i=this.$_points(t).filter((t=>this._points.contains(t)));return i.length>0&&this.$_remove(i,e),i}clearPoints(t=300){this.$_remove(this._points.getPoints(),t)}removeFirst(t=300){this.removePoint(this._points.first,t)}removeLast(t=300){this.removePoint(this._points.last,t)}updatePoint(t,e,i=300){var s,r;if(n(t)?t=this._points.pointById(t):o(t)&&(t=this._points.get(t)),t instanceof Ri&&this._points.contains(t)){let n=t._prev;return n&&n.ani&&n.ani.stop(),n=t.updateValues(this,e),n&&(this.$_dataPointsChanged(),this.chart.animatable()&&i>0?n.ani=new Zi(this,t,(t=>{var e,i;null===(i=(e=this._op).onPointUpdated)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t))})).setDuration(i).start():null===(r=(s=this._op).onPointUpdated)||void 0===r||r.call(s,this._getPointArgs(this._pointArgs,t))),!!n}return!1}updatePointList(t,e,i=300){var s,r;const n=this.$_points(t).filter((t=>this._points.contains(t)));n.length>0&&(n.forEach((t=>t.updateValues(this,e[0]))),this.$_dataPointsChanged(),this.chart.animatable()&&i>0?new Ki(this,n,(t=>{var e,i;null===(i=(e=this._op).onPointListUpdated)||void 0===i||i.call(e,this._getPointListArgs(t))})).setDuration(i).start():null===(r=(s=this._op).onPointListUpdated)||void 0===r||r.call(s,this._getPointListArgs(n)))}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){if(this._op.onPointClick)return this._getPointArgs(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 Ri&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0,this._optionChanged(t))}lock(){}unlock(){}_setLegend(t){this._legend=t}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.$_setData(t.data,t.dataPath);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._dataDirty?(this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))):this._runPoints||(this._visPoints=[],this._runPoints=[]);this._visPoints.forEach((t=>t._excluded=this.isExcluded(t))),super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._dataDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t,e){const i=e.pointColors;let a,h,l;this._runColor=o(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color,r(i)?a=i:s(i)?h=i:n(i)&&(l=this.chart._assets.get(i)),a?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||a(this._getPointArgs(this._pointArgs,t))})):l instanceof Ut?(l.prepare(),this._runPoints.forEach(((t,e)=>{t._runColor=t.color||l.getNext()}))):h?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||h[e%h.length]})):this._runPoints.forEach(((t,e)=>{t._runColor=t.color})),this._preparePointArgs(this._pointArgs)}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e++)}$_addPoint(t,e){const i=this._createPoint(t);return e>=0&&(i.index=e),i.parse(this),isNaN(i._zindex)||(this._maxZindex=Math.max(this._maxZindex,i._zindex)),i}_createFielder(t){return r(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 Ai.create(t,si,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 Pi);else if(s(t))return t}$_loadPoints(t){var e,i;this._doLoadPoints(t),null===(i=(e=this._op).onPointsLoaded)||void 0===i||i.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}$_createPointArgs(){return{series:this}}_getPointArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_getPointListArgs(t){return this._pointListArgs._points=t||[],this._pointListArgs}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._pointLabelVisCallback=this._pointLabel.options.visibleCallback,this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_calcMinMax(t){let e,i;return t.forEach((t=>{const s=t.getValue();isNaN(s)||(e=isNaN(e)?s:d(s,e),i=isNaN(i)?s:_(s,i))})),{min:e,max:i}}}qi.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",qi.defaults=$e(Fe.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:qi.defaultTooltipText,loadAnimation:"default",legend:0});class Ji extends Be{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const r=this.chart;this._items=[],this._map={},s(t)?t.forEach(((t,e)=>{this.$_loadItem(r,t,e)})):i(t)&&this.$_loadItem(r,t,0),r.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(t){const e=[];return this._items.forEach((i=>i.getLegendSources(t,e))),e}_prepareRender(t,e){this._items.forEach((t=>t._setLegend(e.get(t.options.legend,null)))),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 qi?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>t._setIndex(e))),e}$_loadItem(t,e,i,s){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const n=new r(t);return n._init(),n.isDataSeries()&&n._setIndex(i,t._seriesIndex++),n._load(e),this.$_addSeries(n,i)}$_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 Qi extends Ri{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e),null==this.value&&(this.value=NaN)}_readArray(t,e){super._readArray(t,e),null==this.value&&(this.value=NaN)}_assignTo(t){const e=super._assignTo(t);return e.value=this.value,e}getValue(){return isNaN(this._vr)||!this._prev||isNaN(this._prev.value)?this.value:y(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}}class ts extends qi{_createFielders(t){super._createFielders(t),this._valueFielder=this._createValueFielder(t),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}_createValueFielder(t){return this._createFielder(t.valueField||"value")}}ts.defaults=$e(qi.defaults,{valueField:"value"});class es extends ts{isExcludedCoord(t){if(this._excludes)for(let e=0;e<this._excludes.length;e++){const i=this._excludes[e];if(t[0]>=i[0][0]&&t[0]<=i[1][0]&&t[1]>=i[1][1]&&t[1]<=i[0][1])return!0}}isExcluded(t){return this.isExcludedCoord(t.coord)}_doApply(t){if(super._doApply(t),e.call(t,"excludeBounds")){const e=t.excludeBounds,r=[];if(i=e,Array.isArray(i)&&i.length>0)for(let t=0;t<e.length;t+=2){const i=e[t],n=e[t+1];if(s(i)&&s(n)){const t=+i[0],e=+i[1],s=+n[0],o=+n[1];isNaN(t)||isNaN(e)||isNaN(s)||isNaN(o)||r.push([[d(t,s),_(e,o)],[_(t,s),d(e,o)]])}}this._excludes=r.length>0?r:void 0}var i}}es.defaults=$e(ts.defaults,{});class is extends Qi{}class ss extends es{}ss.defaults=$e(es.defaults,{});class rs extends Qi{getPoints(t,e,i){const s=t.length,r=[];const n=i-e;for(let i=0;i<s;i++){const o=t[i],a=5+i/(s-1)*90,h=10+(isNaN(o)||0==n?80:80*(1-(o-e)/n));r.push(a,h)}return r}getBasePoint(t,e,i){const s=e-t;return 0+(isNaN(i)||0==s?100:100*(1-(i-t)/s))}getSum(){return isNaN(this._sum)?this._sum=s(this.values)?this.values.reduce(((t,e)=>t+g(e,0)),0):0:this._sum}_readObject(t,e){super._readObject(t,e);const i=this.value;this.values=s(i)?i.slice():isNaN(i)?[]:[i]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class ns{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return Ai.create(t,si,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class os extends es{getMinMax(t){let e=NaN,i=NaN;for(const s of t)for(const t of s.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),i=isNaN(i)?t:Math.max(i,t));return{min:e,max:i}}_doApply(t){super._doApply(t),this._categories=this.$_parseCategories(t.categories)}_createValueFielder(t){const e=t.valueFields;return s(e)&&e.length>0?t=>e.map((e=>t[e])):super._createValueFielder(t)}getLegendSources(t,e){this._legend===t&&(this._op.legendByCategory&&this._categories?e.push(...this._categories):e.push(this))}$_parseCategories(t){if(s(t))return t.map((t=>new ns(t.name,t.color)))}_splitColors(){let t=0;if(this._visPoints.forEach((e=>{t=Math.max(t,e.values?e.values.length:0)})),t<2)return[this._calcedColor];{const e=ve.create("white"),i=ve.create(this._calcedColor),s=new Array(t);for(let r=t;r<2*t;r++)s[r-t]=ve.interpolate(e,i,r/(2*t)).toString();return s}}}os.defaults=$e(es.defaults,{position:"top"});class as extends rs{}class hs extends os{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new Fe(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=nt.getMinMax(t),s=i.base=this._op.baseValue;if(e)i.min=isNaN(s)?e.min:Math.min(e.min,s),i.max=isNaN(s)?e.max:Math.max(e.max,s);else{const t=g(this._minValue,i.min),e=g(this._maxValue,i.max);i.min=isNaN(s)?Math.min(t,i.min):Math.min(t,i.min,s),i.max=isNaN(s)?Math.max(e,i.max):Math.max(e,i.max,s)}return i}getPadding(t){return g(G(this._paddingDim,t),0)}_doApply(t){super._doApply(t),this._width=g(+t.width,hs.DEF_WIDTH),this._height=g(+t.height,hs.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}hs.DEF_WIDTH=80,hs.DEF_HEIGHT=50,hs.defaults=$e(os.defaults,{width:hs.DEF_WIDTH,height:hs.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class ls extends Qi{}class cs extends es{_doApply(t){super._doApply(t),this._width=g(+t.width||+t.size||+t.height,cs.DEF_SIZE),this._height=g(+t.height||+t.size||+t.width,cs.DEF_SIZE)}}cs.DEF_SIZE=60,cs.defaults=$e(es.defaults,{size:cs.DEF_SIZE});class ds extends cs{getValueRate(t){return(g(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=g(this._minValue,1/0),i=g(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t.getValue();t.isNull||isNaN(s)||(e=d(e,s),i=_(i,s))})),this._min=e,this._max=i}}ds.defaults=$e(cs.defaults,{minValue:10});class _s extends is{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class us extends Fi{}us.defaults=$e(Fi.defaults,{visible:!1});class ps extends ss{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new us(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:G(this._minSizeDim,t),max:G(this._maxSizeDim,t)}}getRadius(t,e,i){if(isNaN(t))return 0;let s=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"==this._op.sizeMode&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getSubLabelOff(){return g(this._subLabel.options.offset,0)}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize"),this._extMin=+t.minValue,this._extMax=+t.maxValue,this._alignToSurface=t.alignToSurface}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new _s(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=this._extMin,s=this._extMax;if(!isNaN(i)&&!isNaN(s)&&this._runPoints.length>0)this._noSize=i>s||(this._vMin=i)===(this._vMax=s);else{let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((r=>{const n=r.getValue();r.isNull||isNaN(n)||(isNaN(i)&&(t=d(t,n)),isNaN(s)&&(e=_(e,n)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}}}ps.type="bubble",ps.defaults=$e(ss.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class gs extends Fe{}gs.defaults=$e(Je.defaults,{length:10});class ms extends je{getText(t){return nt.isValidNum(t)?this._getText(null,t,u(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}ms.defaults=$e(Je.defaults,{offset:4});class fs extends Fe{_doInit(t){t.line=(this._line=new gs(this.chart))._init(),t.label=(this._label=new ms(this.chart))._init()}get line(){return this._line}get label(){return this._label}}fs.defaults=$e(Je.defaults,{});class bs extends Je{_doInit(t){super._doInit(t),t.tick=(this._tick=new fs(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const i=this._op,s=this._series,r=this._steps;if(s instanceof ps){let{min:n,max:o}=s.getPixelMinMax(d(t,e));isNaN(i.minRadius)||(n=i.minRadius),isNaN(i.maxRadius)||(o=i.maxRadius),r.forEach((t=>{t.rd=s.getRadius(t.value,n,o)}))}else if(r.length>0){const t=g(i.minRadius,10),e=g(i.maxRadius,50)-t,s=r[0].value,n=r[r.length-1].value-s;r.forEach((i=>{i.rd=t+e*(i.value-s)/n}))}return r}_type(){return"bubbleScale"}isVertical(){return!0}_getScaledSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._steps=this.$_buildSteps()}$_buildSteps(){const t=this._op.steps,e=[];if(s(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}}bs.defaults=$e(Je.defaults,{});class ys extends Ue{_collectionProp(){return"bubbleScale"}_createWidget(t){return new bs(t)}beforeRender(){this._collectVisibles()}}class ws extends Fe{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}ws.MARKER_SIZE=10;class xs extends Ye{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isInner(){return"body"===this.getLocation()}getLayout(){const t=this.getLocation();if("auto"!==this._op.layout||"body"===t)return this._op.layout;switch(t){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return G(this._maxWidthDim,t,t)}getMaxHeight(t){return G(this._maxHeightDim,t,t)}_type(){return"legend"}isVertical(){return"horizontal"!==this.getLayout()}isVisible(){if(this._items)return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}_doInit(t){super._doInit(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.maxWidth)!==e._maxWidth&&(e._maxWidth=i,e._maxWidthDim=j(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=j(t,!0))}(t.maxHeight)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new ws(this,t))),e.reversed&&(this._items=this._items.reverse())}}xs.defaults=$e(We.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:ws.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class vs extends Ue{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new xs(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class Ss{constructor(t){this._color1=ve.create(t.minColor),this._color2=ve.create(t.maxColor),this._logger=nt.getLogger(t.logBase)}getColor(t,e,i,s){if(isNaN(i))return;const r=this._logger;if(r){const s=1-t;t=r(t+s),e=r(e+s),i=r(i+s)}if(this._color1&&this._color2)return ve.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return b(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class Cs extends Fe{_doInit(t){t.label=(this._label=new ze(this.chart))._init()}get label(){return this._label}getMarkerSize(){return g(this._op.size,7)}}Cs.defaults=$e(Fe.defaults,{size:7});class Ls extends Fe{}Ls.defaults=$e(Fe.defaults,{length:6});class ks extends je{getDefaultIconPos(){}}ks.defaults=$e(je.defaults,{});class Ms extends Fe{_doInit(t){t.line=(this._line=new Ls(this.chart))._init(),t.label=(this._label=new ks(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Ms.defaults=$e(Fe.defaults,{});class As{constructor(t,e,i,s,r){this.from=t,this.to=e,this._color1=i,this._color2=s,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 i=+e||ws.MARKER_SIZE;return Ai.create(t,si,0,0,i,i,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 i=this._color1,s=this._color2;if(!i)return(s||e).toString();const r=this.from,n=this.to;if(i&&s)return ve.interpolate(i,s,(t-r)/(n-r)).toString();return b(s,e,i).brighten(1-(t-r)/(n-r)).toString()}}class Ps extends Fe{}Ps.defaults=$e(Fe.defaults,{});class Is extends Fe{getLabel(){var t;return null!==(t=this._op.label)&&void 0!==t?t:"No Data"}getGap(){return g(+this._op.gap,0)}}Is.defaults=$e(Fe.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const Ns="#fff",Es=ve.create("#000");class Ts extends Je{_doInit(t){super._doInit(t);const e=this.chart;t.marker=(this._marker=new Cs(e))._init(),t.stepLine=(this._stepLine=new Ps(e))._init(),t.tick=(this._tick=new Ms(e))._init(),t.nullStep=(this._nullStep=new Is(e))._init()}getColor(t,e,i,s){const r=this._steps;if(!isNaN(i)){if(this._logger&&(i=this._logger(i)),r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(i,t===e-1))return r[t].getColor(i,s);return i<=this._min?r[0]._color1.toString():s.toString()}return ve.interpolate(this._minColor,this._endColor,(i-this._min)/(this._max-this._min)).toString()}if(this._op.nullStep.visible)return this._op.nullStep.color}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get nullStep(){return this._nullStep}get minColor(){return this._minColor}get endColor(){return this._endColor}getRanger(){return this}getLayout(){switch(this._op.layout){case"horizontal":case"vertical":return this._op.layout;default:{const t=this.getLocation();return"left"===t||"right"===t?"vertical":"horizontal"}}}getBarSize(t,e,i){let s,r;return i?(r=this._barLengthDim?G(this._barLengthDim,e):e,s=g(this._op.barWidth,12)):(s=this._barLengthDim?G(this._barLengthDim,t):t,r=g(this._op.barWidth,12)),{width:s,height:r}}getSplitPoints(t,e,i){const s=this._steps,r=this._valueSteps,n=s?s.length:r?r.length-1:0,o=e?n+1:n,a=[];if(e&&(t-=i),n>0)for(let e=0;e<n;e++)a.push((e+1)/o*t);return a}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 i=0,s=e.length;i<s;i++){const r=e[i].getPosition(t,i===s-1);if(!isNaN(r))return(i+r)/s}}getTicks(){const t=this._tick.label,e=this._steps,i=this._valueSteps,s=this._min,r=this._max;let n,o=[];if(e){n=e.length,o.push({pos:e[0].from=g(e[0].from,s)});for(let t=1;t<n;t++)o.push({pos:e[t].from=g(e[t].from,e[t-1].to)});o.forEach(((t,i)=>t.label=e[i].label)),o.push({pos:e[n-1].to=g(e[n-1].to,r)})}else if(i){n=i.length,o.push({pos:i[0]});for(let t=1;t<n-1;t++)o.push({pos:i[t]});o.push({pos:i[n-1]})}else o=[{pos:s},{pos:r}];const a=this._logBase;return n=o.length-1,o.forEach(((e,i)=>{if(null==e.label){const s=this._logger?Math.pow(a,e.pos):e.pos;e.label=t.getNumberText(s,!1,!1,0===i?"trunc":i===n?"ceil":void 0)}})),o}getSteps(){return this._steps}getLegendSources(t){"legend"!==this._op.display&&"both"!==this._op.display||(this._buildSteps(),this._steps&&this._steps.forEach((e=>t.push(e))))}_buildSteps(){var t;this._endColor=this._maxColor||(null===(t=this._series)||void 0===t?void 0:t.color)||Es,this._steps=this.$_buildSteps()}_type(){return"colorScale"}isVertical(){return"horizontal"!==this.getLayout()}getDefaultDisplay(t){return"stack"}_doApply(t){super._doApply(t),this._setDim(t,"barLength"),this._minColor=ve.create(t.minColor||Ns),this._maxColor=t.maxColor&&ve.create(t.maxColor),this._colors=this.$_parseColorStops(t.colors)}_getScaledSeries(t){return t.findSeries((t=>{const e=t.getColorScale();return e===this.index||e&&e===this._op.name}))||t.firstMapSeries}$_parseColorStops(t){const e=[];if(s(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:ve.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:ve.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._endColor});return(e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._endColor}),e}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=null===(i=this._series)||void 0===i?void 0:i.getValueRange();this._min=+e.minValue,this._max=+e.maxValue,this._logger=nt.getLogger(this._logBase=e.logBase),s&&(isNaN(this._min)&&(this._min=s.min),isNaN(this._max)&&(this._max=s.max))}$_parseValue(t,e,i){return n(t)?t.endsWith("%")?e+(i-e)*parseFloat(t)/100:void 0:t}$_parseColor(t){return t&&t.endsWith("%")?ve.interpolate(this._minColor,this._endColor,parseFloat(t)/100):ve.create(t)}$_buildSteps(){const t=this._op,e=t.solidFill,i=t.steps,r=[],n=this._min,o=this._max;let a=n,h=o;if(this._valueSteps=null,s(i)&&i.length>0){let t="0%";i.forEach(((s,n)=>{var o;let l,c,d=this.$_parseValue(s.from,a,h),_=this.$_parseValue(s.to,a,h);if(0===n&&isNaN(d)&&(d=a),n===i.length-1&&isNaN(_)&&(_=h),s.fromColor&&s.toColor)l=this.$_parseColor(s.fromColor),c=this.$_parseColor(t=s.toColor);else if(e){let t=s.toColor||s.fromColor||s.color;t=0===n?t||"0%":t||"100%",c=l=this.$_parseColor(t)}else l=this.$_parseColor(s.fromColor||t),c=this.$_parseColor(t=(null!==(o=s.toColor)&&void 0!==o?o:s.color)||"100%");r.push(new As(d,_,l,c,s.label))}))}else if(a>=h)r.push(new As(a,h,e?this._endColor:this._minColor,this._endColor,void 0));else if(!isNaN(a)&&!isNaN(h)){const i=t.logBase,s=this._logger&&a>=0&&h-a>=i?this._logger:null,n=this._valueSteps=[],o=Math.max(1,g(t.stepCount,1));if(s&&(a=s(a),h=s(h)),t.integralSteps)n.push(...nt.normalizeToSteps([a,h],o+1));else{const t=(h-a)/o;n.push(a);for(let e=1;e<o;e++)n.push(E(n[e-1]+t));n.push(E(h))}if(this._min=n[0],this._max=n[o],e){const t=this._minColor,e=this._endColor,i=n.length-1;for(let s=1;s<=i;s++){const o=ve.interpolate(t,e,s/i);r.push(new As(n[s-1],n[s],o,o,void 0))}}}return r.length>1?r:void 0}}Ts.defaults=$e(Fe.defaults,{display:"scale",minColor:Ns,layout:"auto",barWidth:12,barLength:"40%"});class Vs 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}_collectionProp(){return"colorScale"}_createWidget(t){return new Ts(t)}beforeRender(){this._collectVisibles()}}class Ds extends Fe{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()}contains(t){return this._module&&this._module.contains(t)}hideContextMenu(){this._module&&this._module.hideContextMenu()}exportToImage(t,e,i){this._module&&this._module.exportToImage(t,e,i)}}Ds.defaults=$e(Fe.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Rs extends Fe{_doSetSimple(t,e){return nt.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}Rs.defaults=$e(Fe.defaults,{});class $s extends Fe{_doInit(t){t.line=(this._line=new Rs(this.chart))._init(),t.lonLine=(this._lonLine=new Rs(this.chart))._init(),t.latLine=(this._latLine=new Rs(this.chart))._init()}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this._fitTo}getLonStep(){return Math.max(0,m(this._lonLine.options.step,this._line.options.step,this.$_defaultStep()))}getLatStep(){return Math.max(0,m(this._latLine.options.step,this._line.options.step,this.$_defaultStep()))}_doApply(t){super._doApply(t),this._fitTo=t.fitTo}_doPrepareRender(t,e){super._doPrepareRender(t,e)}$_defaultStep(){return 10}}$s.defaults=$e(Fe.defaults,{visible:!1,fitTo:"map"});class Os extends Fe{}Os.defaults=$e(Fe.defaults,{visible:!1});class Fs extends Fe{}Fs.defaults=$e(Fe.defaults,{visible:!1});class Bs extends ze{getText(t,e){let i=this._op.suffix;if(this._symbolPos>=0){let s=100;t?e<0?s=1:e>0&&(s=0):0===e||180===e||(e<0?s=3:e>0&&(s=2)),i=i.replace("°°","°"+this._symbols.charAt(s))}return i=e+i,this._op.prefix&&(i=this._op.prefix+i),i}_doApply(t){super._doApply(t),this._symbolPos=t.suffix?t.suffix.indexOf("°°"):-1,this._symbols=t.dirSymbols||Bs.defaults.dirSymbols}}Bs.defaults=$e(ze.defaults,{dirSymbols:"NSEW",suffix:"°°"});class zs extends Fe{_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}visibleAt(t){return this._positions.includes(t)}getLonInterval(){return Math.max(1,m(this._op.lonInterval,this._op.interval,1))|0}getLatInterval(){return Math.max(1,m(this._op.latInterval,this._op.interval,1))|0}_doApply(t){super._doApply(t),this._positions=s(t.positions)?t.positions:[]}}zs.defaults=$e(Fe.defaults,{visible:!1,positions:["top","right"],interval:1});class js extends je{getDefaultIconPos(){return"left"}}js.defaults=$e(je.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Gs extends Fe{_doInit(t){t.label=(this._label=new js(this.chart))._init()}get label(){return this._label}}Gs.defaults=$e(Fe.defaults,{front:!0,zindex:0});class Hs extends Gs{}Hs.defaults=$e(Gs.defaults,{});class Ws extends Gs{}Ws.defaults=$e(Gs.defaults,{});class Ys extends Gs{}Ys.defaults=$e(Gs.defaults,{});class Zs extends Fe{}Zs.defaults=$e(Fe.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class Us extends Fe{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new Zs(this.chart))._init(),this._args={chart:this.chart.wrapper,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 i=ie.getFormatter(e.numberFormat).toStr(t);return e.prefix&&(i=e.prefix+i),e.suffix&&(i+=e.suffix),i}moved(t,e,i){}_doSetSimple(t,e){return r(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}Us.defaults=$e(Fe.defaults,{visible:!1});class Xs extends Fe{constructor(){super(...arguments),this._guides=[]}_doInit(t){this.options.line=(this._line=new Os(this.chart))._init(),this.options.leftLine=(this._leftLine=new Os(this.chart))._init(),this.options.rightLine=(this._rightLine=new Os(this.chart))._init(),this.options.topLine=(this._topLine=new Os(this.chart))._init(),this.options.bottomLine=(this._bottomLine=new Os(this.chart))._init(),this.options.equatorLine=(this._equatorLine=new Os(this.chart))._init(),this.options.meridianLine=(this._meridianLine=new Os(this.chart))._init(),this.options.grid=(this._grid=new $s(this.chart))._init(),this.options.tick=(this._tick=new zs(this.chart))._init(),this.options.crosshair=(this._crosshair=new Us(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()}get lonInterval(){return this.chart.body.projection.lonElliptic?this._lonInterval:NaN}get latInterval(){return this.chart.body.projection.latElliptic?this._latInterval:NaN}_doApply(t){if(super._doApply(t),e.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(s(e)?e:[e]))}this._lonInterval=Math.max(1,m(t.lonInterval,t.interval,10)),this._latInterval=Math.max(1,m(t.latInterval,t.interval,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new Ys(this.chart):"line"===t.type?new Hs(this.chart):"band"===t.type?new Ws(this.chart):new Hs(this.chart),i._init(),i._load(t),e.push(i)}))}}function Ks(t,e){const[i,s]=t;let r=!1;for(let t=0,n=e.length-1;t<e.length;n=t++){const[o,a]=e[t],[h,l]=e[n];a>s!=l>s&&i<(h-o)*(s-a)/(l-a)+o&&(r=!r)}return r}function qs(t,e){let i=!1;Ks(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)Ks(t,e[s])&&(i=!i);return i}Xs.defaults=$e(Fe.defaults,{interval:5});class Js{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:i,maxLat:s}=this.bbox,r=(t+i)/2,n=(e+s)/2,o={minLon:t,minLat:n,maxLon:r,maxLat:s},a={minLon:r,minLat:n,maxLon:i,maxLat:s},h={minLon:t,minLat:e,maxLon:r,maxLat:n},l={minLon:r,minLat:e,maxLon:i,maxLat:n};this.children=[new Js(o,this.capacity),new Js(a,this.capacity),new Js(h,this.capacity),new Js(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 i of this.children)if(this.isContained(t.bbox,i.bbox)&&(e=i.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,i){return t>=i.minLon&&t<=i.maxLon&&e>=i.minLat&&e<=i.maxLat}queryPoint(t,e,i=[]){if(!this.containsPoint(t,e,this.bbox))return i;for(const s of this.entries)this.containsPoint(t,e,s.bbox)&&i.push(s);if(this.divided&&this.children)for(const s of this.children)s.queryPoint(t,e,i);return i}}class Qs{constructor(t,e){var i;this.worldBBox=t,this.root=new Js(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!==(i=t.source.polygon)&&void 0!==i?i: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 qs(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(qs(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const tr="37630",er={area:"39",name:"제주특별자치도",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"},ir={area:tr,name:"울릉도",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"},sr={area:"",name:"백령도",parent:"23,23520",polygons:[[8,9],[14,15,16]],coord:[125.7,37.5],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},rr={area:"39",name:"제주특별자치도",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"},nr={area:tr,name:"울릉도",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"},or={area:"23520",name:"백령도",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"},ar={area:"AK",name:"Alaska",coord:[-119,6.4],frame:"0.5 0.5"},hr={area:"HI",name:"Hawaii",coord:[-126,21],frame:"0.5 0.5"},lr={area:"JPN-3502",name:"Okinawa",offset:[20,6],frame:"0.4 0.2",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"};class cr{constructor(t){this.id=t}}class dr extends cr{constructor(t,e){super(t),this.props=e}}class _r extends dr{constructor(t,e,i,s){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(e<=0)r.splice(i,1);else if(1!==e){const t=r[i],n=[];for(let e=0;e<t.length;e++){const i=[];for(let s=0;s<t[e].length;s++)i.push(t[e][s].slice());n.push(i)}r[i]=n,this.$_moveToRate(i,s,1-e)}}$_moveToRate(t,e,i){const s=ai(this.polygons[t]),r=ai(this.polygons[e]);let n,o,a=0,h=0;if((n=s.h1-r.h2)>0&&(o=r.v1-s.v2,n>o&&(a=-n*i,h=o*i)),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 ur{constructor(t,e,i){this.name=t,this.closed=i,s(e)&&e.length>=2&&(this.border=[nt.makeArray(e[0]),nt.makeArray(e[1])])}}class pr extends cr{constructor(t,e){super(t),this.polygon=e}}class gr extends pt{static createStockInset(t,e){let s,r=!1;switch(t){case"제주":case"제주도":s=er;break;case"제주_B":case"제주도_B":s=er,r=!0;break;case"울릉":case"울릉도":s=ir;break;case"울릉_B":case"울릉도_B":s=ir,r=!0;break;case"백령":case"백령도":s=sr;break;case"백령_B":case"백령도_B":s=sr,r=!0;break;case"읍면동_제주":case"읍면동_제주도":s=rr;break;case"읍면동_제주_B":case"읍면동_제주도_B":s=rr,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":s=nr;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":s=nr,r=!0;break;case"읍면동_백령":case"읍면동_백령도":s=or;break;case"읍면동_백령_B":case"읍면동_백령도_B":s=or,r=!0;break;default:switch(t.toLowerCase()){case"alaska":s=ar;break;case"hawaii":s=hr;break;case"okinawa":s=lr;break;case"okinawa_b":s=lr,r=!0}}return s&&(a(e)?s=Object.assign({visible:e},s):i(e)&&(s=Object.assign({},s,e)),r&&s.border&&delete s.frame),s}constructor(t,e){var r,o,a;super(),this._excludes={};const h=null!==(r=t.source)&&void 0!==r?r:t.map,l=t.insets,c=s(l)?l:i(l)||n(l)?[l]:void 0;this.name=t.name,this.enabled=f(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=i(null==h?void 0:h.meta)?nt.deepClone(h.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(o=this.meta.dummies)||void 0===o?void 0:o.slice(),this.paddings=K(null!==(a=t.padding)&&void 0!==a?a:"0"),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,this._excludes={},s(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={},c&&c.length>0&&c.forEach((t=>{var e,i;if(n(t)){const e=t.startsWith("-")?gr.createStockInset(t.substring(1),!1):gr.createStockInset(t);e&&(this.insets[e.area]=e)}else t&&null!=t.area&&(this.insets[t.area]={area:t.area,name:t.name,children:t.children,parent:t.parent,polygons:s(t.polygons)?t.polygons.slice():s(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===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:s(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&nt.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new ur(t.name,t.border,!0===t.closed))})),h&&(this.internals=t.needInternal,this.externals=t.needExternal,this.items=this.$_load(h,t))}included(t){return!this._excludes[t]}$_load(t,e){return this._doLoad(t,e)}}class mr{constructor(){this._scroll=0,this._offset=[0,0]}get isGlobe(){return!1}get lonElliptic(){return!1}get latElliptic(){return!1}get h1(){return((-180+this._scroll)%360+540)%360-180}get scroll(){return this._scroll}set scroll(t){this._scroll=((t||0)%360+540)%360-180,this._sec&&(this._sec._scroll=this._scroll>0?(this._scroll-360)%360:(this.scroll+360)%360),this.second=0===this._scroll?void 0:this._sec}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this._sec&&(this._sec._offset=this._offset)}prepareSecond(){return this._sec=new this.constructor,this}getYRange(t,e){return[t,e]}getClipBounds(t,e){const i=[],s=this.scroll;this.scroll=0,isNaN(t)&&(t=180);for(let e=-90;e<=90;e+=t)i.push(this.project([-180,e]));for(let e=90;e>=-90;e-=t)i.push(this.project([180,e]));return this.scroll=s,i}backward(t){return t}clip(t){return t}isVisible(t){return!0}getVisible(t){if(this.isVisible(t)){if(this.second){const e=this._scroll,i=t[0];return i>=-180+e&&i<=180+e?this.project(t):this.second.project(t)}return this.project(t)}}inSecond(t){return this.second&&(t<-180+this._scroll||t>180+this._scroll)}isClipping(){return!0}getScrolledLon(t){return((t+this._scroll)%360+540)%360-180}}const fr=90,br=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class yr extends mr{constructor(){super(),this._rotation=[0,0],this._r=fr,this.bounds={x1:-90,x2:fr,y1:-90,y2:fr},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get lonElliptic(){return!0}get latElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=br(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=br(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;br(-90-t),br(90-t),br(90+e),br(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*P,r=[Math.cos(s)*Math.sin(e*P)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/fr,i=t[1]/fr,s=Math.sqrt(e*e+i*i),r=Math.asin(s),n=Math.sin(r),o=Math.cos(r),a=[Math.atan2(e*n,s*o)/P,Math.asin(s&&i*n/s)/P];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}inSecond(t){return!1}_rotate(t){const e=this._rotation[0]*P,i=(this._rotation[1]||0)*P,s=Math.cos(i),r=Math.sin(i),n=Math.cos(0),o=Math.sin(0);if(0===e&&0===i)return t.slice(0);const a=t[0]*P+e,h=t[1]*P,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*s+c*r;return[Math.atan2(d*n-u*o,c*s-_*r)/P,Math.asin(u*n+d*o)/P]}_unrotate(t){const e=Math.PI/180,i=180/Math.PI,s=t[0]*e,r=t[1]*e*-1,n=Math.cos(r);let o=Math.cos(s)*n,a=Math.sin(s)*n,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*o+_*a-p*d*h,y:-u*_*o+d*a+p*_*h,z:p*o+u*h};return[Math.atan2(g.y,g.x)*i,-Math.asin(g.z)*i]}}class wr extends gr{static loadMap(t,e){if(i(t)){const r=t.source;if(i(r)&&"Topology"===r.type&&i(r.objects)&&s(r.arcs))return new wr(t,e);const n=t.map;if(i(n)&&"Topology"===n.type&&i(n.objects)&&s(n.arcs))return new wr(t,e)}}_doLoad(t,e){const r=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),o=t=>t.map((t=>r(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(i(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let n=0,o=0;const a=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+i,r[1]=(o+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const i=d[t].geometries;if(s(i)&&i.forEach((t=>{const e=new dr(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=r(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=o(t.arcs),g.push(e)}})),m){const t={},i={};s(e.excludeInternal)?e.excludeInternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeInternal&&(t[String(e.excludeInternal)]="");for(let t=m.length-1;t>=0;t--)m[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}})),nt.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};s(e.excludeExternal)?e.excludeExternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeExternal&&(t[String(e.excludeExternal)]="");for(let t=f.length-1;t>=0;t--)f[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}})),nt.isNotEmpty(i)&&f.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.externals=c(e):t.polygon&&(t.external=l(e))}))}}return this.$_loadBorders(_,g,this.borders),g.forEach((t=>{delete t.arcs})),g}$_loadBorders(t,e,i){const s=[];for(const r of i){const i=r.border,n=[],o=[];e.forEach((t=>{t instanceof dr&&(i[0].indexOf(t.id)>=0&&(t.polygons?n.push(...t.arcs):t.polygon&&n.push(t.arcs)),i[1].indexOf(t.id)>=0&&(t.polygons?o.push(...t.arcs):t.polygon&&o.push(t.arcs)))}));const a=n.flat(1/0),h=o.flat(1/0),l=[];if(a.forEach((t=>{h.forEach((e=>{(t===e||t<0&&~t===e||e<0&&t===~e)&&l.push(t)}))})),l.length>0){const e=l.map((e=>e<0?t[~e].slice().reverse():t[e]));s.push(new pr(r.name,e))}}e.push(...s)}}function xr(t,e){const{atan2:i,cos:s,sin:r,sqrt:n}=Math,o=t[1]*P,a=t[0]*P,h=e[1]*P,l=e[0]*P,c=h-o,d=l-a,_=r(c/2)*r(c/2)+s(o)*s(h)*r(d/2)*r(d/2),u=2*i(n(_),n(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*s(o)*s(a)+c*s(h)*s(l),_=t*s(o)*r(a)+c*s(h)*r(l),p=i(t*r(o)+c*r(h),n(d*d+_*_)),g=i(_,d);m.push([g/P,p/P])}}return m}function vr(t,e){const i=t._base,r=t.off;let o,a,h=[0,0],l=e;if(i){if(0===i.length)return void console.warn("적용할 수 없는 inset입니다: "+t.area+", "+t.children);i[0]instanceof Lr?o=i:i[0]>=0&&(l=e.readBounds(i),h=r||h)}if(n(t.frame)&&t.frame.length>0){const e=K(t.frame);let{h1:i,v1:s,h2:n,v2:a}=o?o[0]:l;if(o)for(let t=1;t<o.length;t++)i=d(i,o[t].h1),s=d(s,o[t].v1),n=_(n,o[t].h2),a=_(a,o[t].v2);const c=i+h[0]-e.l,u=n+h[0]+e.r,p=a+h[1]+e.t,g=s+h[1]-e.b;t.box=[[c,p],[u,p],[u,g],[c,g]],t.bounds=r?{h1:c-r[0],h2:u-r[0],v1:g-r[1],v2:p-r[1]}:{h1:c,h2:u,v1:g,v2:p}}else if(a=t.border){let e,c;if(n(a)){let{h1:t,v1:i,h2:s,v2:r}=o?o[0]:l;if(o)for(let e=1;e<o.length;e++)t=d(t,o[e].h1),i=d(i,o[e].v1),s=_(s,o[e].h2),r=_(r,o[e].v2);l={h1:t,v1:i,h2:s,v2:r},e=function(t,e){const i=t.split(/[\s,]+/g),s=[],r="z"===i[i.length-1]||"Z"===i[i.length-1];r&&i.pop();for(let r=0;r<i.length/2;r++)for(let n=0;n<2;n++){const o=i[2*r+n],a=+o;if(isNaN(a)){const i=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<i.length;){const s=i[h++];if("-"===s)r=-1;else if("+"===s)r=1;else if("w"===s)a+=r*(e.h2-e.h1);else if("h"===s)a+=r*(e.v2-e.v1);else if(s.length>0){const i=parseFloat(s);if(isNaN(i))throw new Error("Invalid border expression: "+t);s.endsWith("h")?a+=r*i*(e.v2-e.v1):s.endsWith("w")?a+=r*i*(e.h2-e.h1):a+=r*i}}s.push(a+(0===n?e.h1:e.v1))}else s.push(a+(0===n?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else s(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=r?{h1:l.h1-r[0],h2:l.h2-r[0],v1:l.v1-r[1],v2:l.v2-r[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const Sr=Math.min,Cr=Math.max;class Lr extends pt{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"],i=t.props["ctr-lat"];isNaN(e)||isNaN(i)||(this.center=[+e,+i])}}setSelected(t){this._selected=t}get path(){return this._path}get internal(){return this._internal}get external(){return this._external}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=this._internal=this._external=null}$_readBound(t,e){let i=this.h1,s=this.h2,r=this.v1,n=this.v2;t[0].forEach((t=>{i=Sr(i,t[0]+e[0]),s=Cr(s,t[0]+e[0]),r=Sr(r,t[1]+e[1]),n=Cr(n,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=n}$_readInset(t,e){const i=t.coord,r=t.offset;let n=[0,0];return s(i)&&i.length>0&&(n[0]=isNaN(i[0])?0:+i[0]-e.h1,n[1]=isNaN(i[1])?0:+i[1]-e.v1),s(r)&&r.length>0&&(n[0]+=g(r[0],0),n[1]+=g(r[1],0)),t.off=n}$_toPath(t,e,i,s){const r=t.isGlobe,n=e[0].slice();if(i){for(let t=0;t<n.length;t++)n[t]=n[t].slice(0);n.forEach((t=>{t[0]+=i[0],t[1]+=i[1]}))}let o=this.x1,a=this.x2,h=this.y1,l=this.y2;const c=n.map((e=>{const i=t.project(e);return i.outside||(o=Sr(o,i[0]),a=Cr(a,i[0]),h=Sr(h,i[1]),l=Cr(l,i[1])),i}));let d;if(this.x1=o,this.x2=a,this.y1=h,this.y2=l,r){let e,i,s=!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 i=xr(t[e],t[e+1]);i.length&&t.splice(e+1,0,...i)}}(n),d=[];for(let r=0;r<c.length;r++){const o=n[r],a=c[r];if(a.outside)s=!0;else{if(e||(e=o,n.push(o),c.push(a)),s&&i){xr(i,o).forEach((e=>d.push(t.project(e))))}d.push(a),i=o,s=!1}}}else d=c;if(d.length>0){const t=`M ${d[0][0]} ${d[0][1]} L`+d.slice(1).map((t=>t.join(" "))).join(" ");return s?t+" Z":t}return""}readBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;if(t)for(const n of t)this.source.polygons[n][0].forEach((t=>{e=Sr(e,t[0]),i=Cr(i,t[0]),s=Sr(s,t[1]),r=Cr(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=Sr(e,t[0]),i=Cr(i,t[0]),s=Sr(s,t[1]),r=Cr(r,t[1])}))}));return{h1:e,v1:s,h2:i,v2:r}}readPolygonBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of t)for(const t of n)e=Sr(e,t[0]),i=Cr(i,t[0]),s=Sr(s,t[1]),r=Cr(r,t[1]);return{x1:e,x2:i,y1:s,y2:r}}readPath(t,e){const i=t.second;let s;if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset,r=!e||!1!==e.visible;if(e){if(r)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=Sr(t,e[0]),i=Sr(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,ri)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,ri))):this.$_readBound(this.source.polygon,ri),s=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,ri))):this.$_readBound(this.source.polygon,ri);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,ri)}))):(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;const n=t.inSecond(this.h1),o=n?i:t,a=n?t:i,h=n!==t.inSecond(this.h2);let l="",c="";this.source.polygons?this._insetChilds?this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?r&&(l+=this.$_toPath(o,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))):(l+=this.$_toPath(o,t,null,!0),h&&(c+=this.$_toPath(a,t,null,!0)))})):r&&this.source.polygons.forEach(((t,e)=>{l+=this.$_toPath(o,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))})):r&&(l=this.$_toPath(o,this.source.polygon,s,!0),h&&(c=this.$_toPath(a,this.source.polygon,s,!0))),this._path=l+c}return e.internals&&this.$_readInternal(t,this._insetChilds?ri:s),e.externals&&this.$_readExternal(t,this._insetChilds?ri:s),this._path}$_readInternal(t,e){if(!this._internal){let i;this.source.internals?(i="",this.source.internals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.internal&&(i="",this.source.internal.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._internal=i}}$_readExternal(t,e){if(!this._external){let i;this.source.externals?(i="",this.source.externals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.external&&(i="",this.source.external.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._external=i}}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Lr;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class kr extends pt{constructor(t){super(),this.source=t}get path(){return this._path}reset(){this._path=null}readPath(t){if(!this._path){let e="";this.source.polygon.forEach((i=>{const s=i.map((e=>t.project(e)));e+=`M ${s[0][0]} ${s[0][1]} L`+s.slice(1).join(" ")})),this._path=e}}}class Mr extends pt{constructor(t,e,i){if(super(),this.owner=t,this.source=e,this._hiddens={},this._world=!1,!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=i,this._name=e.name,(this._second=e instanceof Mr)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new Qs({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,s(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof wr&&this.source.internals}get hasExternals(){return this.source instanceof wr&&this.source.externals}get hasBorders(){return this.source instanceof wr&&this.source.borders}get isWorld(){return this._world}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const i in this._areaMap){const s=this._areaMap[i];t in s.source.props&&(e[s.source.props[t]]=s)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach((t=>{t.reset()}));for(const t in this._borders)this._borders[t].reset();this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}insetAt(t){for(const e of this._insets)if(e.bounds&&oi(t,e.bounds))return e}getBorder(t){return this._borders[t]}$_preflight(){let t=1/0,e=-1/0,i=1/0,s=-1/0;for(let r=0;r<this._areas.length;r++){const n=this._areas[r],o=n.inset;let{h1:a,h2:h,v1:l,v2:c}=n.readBounds();if(null==o?void 0:o.coord){const[t,e]=o.coord;h=t+h-a,c=e+c-l,a=t,l=e}if(a<t&&(t=a),h>e&&(e=h),l<i&&(i=l),c>s&&(s=c),t<=-180&&e>=180&&i<=-90&&s>=90)return}return{minLat:i,maxLat:s,minLon:t,maxLon:e}}$_resetAreas(){const t=this.owner.getProjection(this._second),e={internals:this.hasInternals,externals:this.hasExternals};if(t instanceof yr)this._areas.forEach((i=>{i.visible=this.isVisible(i.id),i.readPath(t,e),this.$_updateMainAreaBounds(i)})),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=fr,this.y2=fr;else{let i=1/0,s=-1/0,r=1/0,n=-1/0,o=1/0,a=-1/0,h=1/0,l=-1/0;if(!this._second&&this._useOffset){const e=this.$_preflight();t.offset=e?!0===this._useOffset?[-(e.minLon+(e.maxLon-e.minLon)/2),-(e.minLat+(e.maxLat-e.minLat)/2)]:this._useOffset:[0,0]}if(this._areas.forEach((c=>{c.visible=this.isVisible(c.id),c.readPath(t,e)&&(i=Sr(i,c.h1),s=Cr(s,c.h2),r=Sr(r,c.v1),n=Sr(90,Cr(n,c.v2)),o=Sr(o,c.x1),a=Cr(a,c.x2),h=Sr(h,c.y1),l=Cr(l,c.y2),this.$_updateMainAreaBounds(c))})),this.source instanceof gr){const e=this.source.paddings;r-=e.b,n+=e.t,i-=e.l,s+=e.r;const c=t.project([i,n]),d=t.project([s,r]);h=Math.min(d[1],h-e.b),l=Math.max(c[1],l+e.t),o=Math.min(c[0],o-e.l),a=Math.max(d[0],a+e.r)}n>83.63&&this.source.alignArctic&&(n=90,r<=-90?(h=Math.min(h,-l),l=Math.max(-h,l)):l=t.project([0,n])[1]),(this._world=i<=-180&&s>=180)&&(o=Math.min(o,-a),a=Math.max(-o,a)),this.h1=Cr(-180,i),this.v1=Cr(-90,r),this.h2=Sr(180,s),this.v2=Sr(90,n),this.x1=o,this.y1=h,this.x2=a,this.y2=l,this.cx=o+(a-o)/2,this.cy=h+(l-h)/2}for(const e in this._borders)this._borders[e].readPath(t)}$_updateMainAreaBounds(t){var e,i;t.mainLandBounds={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2};const s=t.source.props["rm-main-area"],r=null==s?void 0:s.split(",").filter((t=>"string"==typeof t)).map((t=>t.trim())).map((t=>Number(t)));if(!r||0===r.length)return;const n=t.mainLandBounds;t.mainLandBounds=null;for(const s of r){const r=null===(e=t.source)||void 0===e?void 0:e.polygons,n=r&&r[s];if(!n)continue;const o=t.readPolygonBounds(n);null!==(i=t.mainLandBounds)&&void 0!==i||(t.mainLandBounds=o),t.mainLandBounds.x1=Sr(t.mainLandBounds.x1,o.x1),t.mainLandBounds.x2=Cr(t.mainLandBounds.x2,o.x2),t.mainLandBounds.y1=Sr(t.mainLandBounds.y1,o.y1),t.mainLandBounds.y2=Cr(t.mainLandBounds.y2,o.y2)}t.mainLandBounds||(t.mainLandBounds=n)}$_load(t){var e;const i=t.insets,r=t.idKey,n=null!==(e=t.nameKey)&&void 0!==e?e:"name",a=t.meta.dokdo,h=t.dummies,l=this._areas=[],c=this._areaMap={},d=this._borders={},_=this._insets=[];this._useOffset=t.useOffset,Object.values(i).forEach((t=>{delete t._base,delete t._parent,delete t._area})),t.items.forEach((e=>{if(e instanceof dr){const s=f(e.props[r],e.id);if(s&&t.included(s)){const t=i[s],r=new Lr(e,t);t&&(delete i[s],t._area=r,_.push(t)),h&&h.indexOf(s)>=0?(l.unshift(r),r.dummy=!0):l.push(r),c[r.id=s]=r,r.name=f(e.props[n],e[n])}}else if(e instanceof pr){const t=new kr(e);d[t.source.id]=t}}));for(const t in i){const e=i[t];if(e._parent=e.parent,e.parent&&(o(e.polygons)||s(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let i=0;i<t.length;i++){const r=c[t[i]];if(r){const n=e.polygons[i];r.inset=e,r._insetChilds=s(n)?n:[n],e._parent=t[i],e._base=r._insetChilds,e._area=r,_.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=s(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,e._area=t,_.push(e))}else if(s(e.children)){const t=e._base=[],i=e.off?e.off.slice():[0,0],r=e._children=[];if(s(e.coord)){let t=1/0,s=1/0;for(const i of e.children){const e=c[i];if(!e)continue;const r=e.readBounds();t=Sr(t,r.h1),s=Sr(s,r.v1)}isNaN(e.coord[0])||(i[0]=e.coord[0]-t),isNaN(e.coord[1])||(i[1]=e.coord[1]-s)}for(const s of e.children){const e=c[s];if(e){const n=e.inset={area:s,offset:i};t.push(e),n._area=e,r.push(n)}}_.push(e)}}if(a&&!isNaN(+t.dokdo)){const e=c[a.group];e&&(e.source=new _r(e.source,+t.dokdo,+a.index,+a.parent))}this.reset(),_.forEach((t=>vr(t,t._area)))}$_copy(t){const e=this._areas=[],i=this._areaMap={};this._useOffset=t._useOffset,t._areas.forEach((t=>{const s=t._clone();e.push(s),i[s.id]=s})),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new Mr(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class Ar extends je{getText(t){return nt.isValidNum(t)?this._getText(null,t,u(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Ar.defaults=$e(Je.defaults,{offset:4});class Pr extends Je{_doInit(t){super._doInit(t),t.label=(this._label=new Ar(this.chart))._init()}get label(){return this._label}isVertical(){return!0}_type(){return"mapScale"}_getScaledSeries(t){return t.firstMapSeries}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._scale=this.$_calcScale()}$_calcScale(){return 10}}Pr.defaults=$e(Je.defaults,{visible:!1});class Ir extends Fe{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:Ir.ITEM_GAP}}Ir.ITEM_GAP=4,Ir.defaults=$e(Fe.defaults,{offsetX:8,offsetY:8,itemGap:3});class Nr extends Ir{get vertical(){return"vertical"===this._op.direction}getButtonSize(){var t,e,i,s;return{width:null!==(e=null!==(t=this._op.buttonWidth)&&void 0!==t?t:this._op.buttonHeight)&&void 0!==e?e:Nr.BUTTON_SIZE,height:null!==(s=null!==(i=this._op.buttonHeight)&&void 0!==i?i:this._op.buttonWidth)&&void 0!==s?s:Nr.BUTTON_SIZE}}getZoomFactor(){var t;return null!==(t=this._op.zoomFactor)&&void 0!==t?t:5}_isVisible(){return super._isVisible()&&this.chart.body.options.zoomable&&(this.chart.body.isZoomed||this._op.showAlways)}}Nr.BUTTON_SIZE=24,Nr.defaults=$e(Ir.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomFactor:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Er extends Ir{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Er.defaults=$e(Ir.defaults,{type:"text",align:"left",verticalAlign:"top"});class Tr extends pt{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 i=this._items.indexOf(e);if(i>=0)return this._items.splice(i,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 Vr extends Fe{isVisible(){return this.visible&&!$(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Vr.defaults=$e(Fe.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Dr extends Vr{}Dr.defaults=$e(Vr.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Rr extends Fe{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 i=f(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?ie.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?ye.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Rr.defaults=$e(Fe.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:40,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd"});const $r="chart",Or=/(.*)/,Fr=new RegExp(';(?=(?:[^"]*"[^"]*")*(?![^"]*"))');class Br{static getFormatter(t){let e=Br.Formatters[t];return e||(Br.Formatters[t]=e=new Br(t)),e}constructor(t){this._pattern=Or,this._replace="$1",this.$_parse(this._format=t)}get format(){return this._format}toStr(t){return t&&t.replace(this._pattern,this._replace)}$_parse(t){if(t){const e=t.trim().split(Fr);if(e.length>1){let t=e[0].trim(),i=e[1].trim();t&&i&&('"'==t.charAt(0)&&(t=t.substr(1,t.length-2)),t&&('"'==i.charAt(0)&&(i=t.substr(1,i.length-2)),i&&(this._pattern=new RegExp(t,e[2]||""),this._replace=i)))}}}}Br.Formatters={};class zr extends pi{constructor(){super(...arguments),this._params={}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t){return t.replace(/\$\{(.*?)\}/g,((t,e)=>this.$_apply(e)))}$_apply(t){const e=t.split(";");let i=this._paramCallback?this._paramCallback(e[0]):this._params[e[0]];if(void 0===i&&(i=e[1]),e.length>3)switch(e[3]){case"t":i=Br.getFormatter(e[2]).toStr(String(i));break;case"d":if(n(i))i=new Date(i);else{const t=parseFloat(i);isNaN(t)||(i=new Date(t))}i instanceof Date&&(i=ye.getFormatter(e[2]).toStr(i,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(i);isNaN(t)||(i=ie.getFormatter(e[2]).toStr(t))}else if(e.length>2){const t=+i;isNaN(t)?i&&(i=Br.getFormatter(e[2]).toStr(String(i))):i=ie.getFormatter(e[2]).toStr(t)}return i||""}_isVisible(){return this._op.visible&&!O(this._op.html)}_doSetSimple(t,e){return n(e)?(t.html=e,!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},nt.isObject(i)?i:null,this._userParams),this._paramCallback=r(i)?i:null}}zr.DEF_SIZE=100,zr.type="html",zr.defaults=$e(pi.defaults,{width:zr.DEF_SIZE});class jr extends pi{_isVisible(){return this._op.visible&&!O(this._op.imageUrl)}_doSetSimple(t,e){return n(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}jr.type="image",jr.defaults=$e(pi.defaults,{});class Gr extends pi{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||Gr.defaults.shape}_doSetSimple(t,e){return n(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}Gr.type="shape",Gr.defaults=$e(pi.defaults,{width:64,height:64,shape:"square"});class Hr extends pi{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!O(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?ie.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?ye.getFormatter(t):void 0)}(t.timeFormat)}}Hr.type="text",Hr.defaults=$e(pi.defaults,{text:"Text"});class Wr extends mr{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 Yr=1.340264,Zr=-.081106,Ur=893e-6,Xr=.003796,Kr=Math.sqrt(3)/2,qr=74.03120656864502;class Jr extends mr{get lonElliptic(){return!0}get latElliptic(){return!1}getYRange(t,e){return t<=0&&e>=0?[0,0]:e<0?[t,e]:[e,t]}project(t){const e=P,i=Math.asin(Kr*Math.sin((t[1]+this.offset[1])*e)),s=i*i,r=s*s*s;return[(t[0]+this.offset[0]-this.scroll)*e*Math.cos(i)*qr/(Kr*(Yr+3*Zr*s+r*(7*Ur+9*Xr*s))),i*qr*(Yr+Zr*s+r*(Ur+Xr*s))]}backward(t){const e=t[0]/qr,i=t[1]/qr,s=180/Math.PI;let r,n,o,a,h,l=i;for(let t=0;t<12&&(r=l*l,n=r*r*r,o=l*(Yr+Zr*r+n*(Ur+Xr*r))-i,a=Yr+3*Zr*r+n*(7*Ur+9*Xr*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=s*Kr*e*(Yr+3*Zr*r+n*(7*Ur+9*Xr*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/Kr);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const Qr=63.78137,tn=Math.PI/180;class en extends mr{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 i=Math.sin(e*tn);return[Qr*(t[0]+this.offset[0]-this.scroll)*tn,Qr*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(Qr*tn),(2*Math.atan(Math.exp((t[1]-this.offset[1])/Qr))-Math.PI/2)/tn]}}const sn=Math.PI/4,rn=Math.PI/180,nn=63.78137;class on extends mr{project(t){return[(t[0]+this.offset[0]-this.scroll)*rn*nn,79.7267125*Math.log(Math.tan(sn+.4*(t[1]+this.offset[1])*rn))]}backward(t){return[(t[0]-this.offset[0])/nn/rn,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/nn*.8))-sn)/rn]}}class an extends as{}class hn extends hs{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=this._createLabel(this.chart))._init()}get subLabel(){return this._subLabel}get reversed(){return"reverse"===this._op.barOrder}getFieldColors(){return this._fieldColors}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new an(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return Ai.create(t,si,0,0,e,e,2)}setCalcedColor(t,e){const i=this._op;super.setCalcedColor(t,e),this._fieldColors=void 0,i.colorByField&&!this._categories&&(s(i.fieldColors)?this._fieldColors=i.fieldColors:this._fieldColors=this._splitColors())}}hn.type="bar",hn.defaults=$e(hs.defaults,{barWidth:.7,overflow:!1,barOrder:"normal",colorByField:!0});class ln extends Fe{constructor(t){super(t.chart),this.gauge=t}}class cn extends ln{}cn.defaults=$e(Fe.defaults,{visible:!1});class dn extends ln{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}dn.defaults=$e(Fe.defaults,{});class _n extends ln{getThickness(t){return G(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}_n.defaults=$e(Fe.defaults,{thickness:"100%",stroked:!1});class un extends ln{getExtents(t){return{radius:G(this._radiusDim,t,0),length:G(this._lengthDim,t,0),offset:G(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}un.defaults=$e(Fe.defaults,{visible:!1,radius:3,length:"100%",offset:0});class pn extends ln{getRadius(t){return G(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}pn.defaults=$e(Fe.defaults,{visible:!1,radius:5});class gn extends ze{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:G(this._offsetXDim,t,0),y:G(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}gn.defaults=$e(ze.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class mn{constructor(){this.setCenterX(bn.DEF_CENTER),this.setCenterY(bn.DEF_CENTER),this.setRadius(bn.DEF_RADIUS),this.setInnerRadius(bn.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=j(f(t,bn.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=j(f(t,bn.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=j(f(t,bn.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=j(f(t,bn.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=j(t,!0))}getCenter(t,e){return{x:G(this._centerXDim,t,t/2),y:G(this._centerYDim,e,e/2)}}getExtents(t){const e=G(this._radiusDim,t,t/2),i=d(e,this._innerDim?G(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?G(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=g(t%360,0),s=_(0,d(360,g(e,360)));this._startRad=A+P*i,this._handRad=P*i,this._sweepRad=P*s}}class fn extends ls{_readObject(t,e){super._readObject(t,e)}}class bn extends ds{_doInit(t){super._doInit(t),t.face=(this._face=new cn(this))._init(),t.rim=(this._rim=new dn(this))._init(),t.valueRim=(this._valueRim=new _n(this))._init(),t.hand=(this._hand=new un(this))._init(),t.pin=(this._pin=new pn(this))._init(),t.gaugeLabel=(this._gaugeLabel=new gn(this.chart))._init(),this._props=new mn}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 fn(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)}}bn.DEF_CENTER="50%",bn.DEF_RADIUS="50%",bn.DEF_INNER="80%",bn.type="gauge",bn.defaults=$e(ds.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class yn extends Fe{constructor(t){super(t.chart),this.gauge=t}}class wn extends yn{getThickness(t){return G(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}wn.defaults=$e(Fe.defaults,{thickness:3});class xn extends yn{getLength(t){return G(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}xn.defaults=$e(Fe.defaults,{thickness:1.5,length:"55%"});class vn extends xn{}vn.defaults=$e(xn.defaults,{thickness:1,length:"80%"});class Sn extends xn{}Sn.defaults=$e(xn.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class Cn extends yn{}Cn.defaults=$e(Fe.defaults,{length:5});class Ln extends yn{}Ln.defaults=$e(Fe.defaults,{step:1,offset:0});class kn extends yn{}kn.defaults=$e(Fe.defaults,{radius:4});class Mn extends ze{}Mn.defaults=$e(ze.defaults,{text:"RealMap",position:"top"});class An 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=g(e.time,NaN),this.timezone=g(e.timezone,NaN)}}class Pn extends cs{_doInit(t){super._doInit(t),t.face=(this._face=new Fe(this.chart))._init(),t.rim=(this._rim=new wn(this))._init(),t.hourHand=(this._hourHand=new xn(this))._init(),t.minuteHand=(this._minuteHand=new vn(this))._init(),t.secondHand=(this._secondHand=new Sn(this))._init(),t.tick=(this._tick=new Cn(this))._init(),t.tickLabel=(this._tickLabel=new Ln(this))._init(),t.pin=(this._pin=new kn(this))._init(),t.gaugeLabel=(this._gaugeLabel=new Mn(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,i){const s=d(t,e)*i;return{cx:G(this._centerXDim,t,t/2),cy:G(this._centerYDim,e,e/3),rd:G(this._radiusDim,s,s/2)}}_createPoint(t){return new An(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=j(f(e._centerX=t,Pn.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=j(f(e._centerY=i,Pn.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=j(f(e._radius=s,Pn.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}Pn.DEF_CENTER="50%",Pn.DEF_RADIUS="50%",Pn.type="clock",Pn.defaults=$e(cs.defaults,{centerX:Pn.DEF_CENTER,centerY:Pn.DEF_CENTER,radius:Pn.DEF_RADIUS,active:!0,size:70});class In extends is{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class Nn extends Fe{getSize(){return{width:this._op.width,height:this._op.height}}}Nn.defaults=$e(Fe.defaults,{});class En extends es{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new Fi(this.chart))._init(),t.innerImage=(this._innerImage=new Nn(this.chart))._init()}get innerLabel(){return this._innerLabel}get innerImage(){return this._innerImage}get path(){return this._op.figure}get figureBox(){return this._figureBox}getFigureSize(){const t=this._figureBox;let e=this._op.width,i=this._op.height;return isNaN(e)?isNaN(i)?this._figureBox&&(e=this._figureBox[0],i=this._figureBox[1]):isNaN(e)&&(e=t?i*t[0]/t[1]:i):isNaN(i)&&(i=t?e*t[1]/t[0]:e),{width:e,height:i}}getImageSize(){return this._innerImage.getSize()}_doApply(t){super._doApply(t),this._figureBox=this.$_calcBox(t.figureBox)}_createPoint(t){return new In(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}$_calcBox(t){if(s(t)){if(t.length<2){if(t[0]>=0)return[t[0],t[0]]}else if(t[0]>=0&&t[1]>=0)return[t[0],t[1]]}else if(t>=0)return[t,t]}}En.type="figure",En.defaults=$e(es.defaults,{position:"top"});class Tn extends Fi{}Tn.defaults=$e(Fi.defaults,{visible:!1});class Vn extends Ri{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class Dn extends qi{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Tn(t)}_createPoint(t){return new Vn(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+="/")}}Dn.type="image",Dn.defaults=$e(qi.defaults,{imageWidth:24,imageHeight:24,position:"top"});class Rn extends Mt{constructor(t,e){super(t,si),this.add(this._area=new Nt(t)),this._area.internalSetStyle("opacity","0.2"),this.add(this._line=new Nt(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],i=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(i.join(" "))}}class $n extends as{}class On extends Fe{}On.defaults=$e(hs.defaults,{visible:!1});class Fn extends hs{_doInit(t){super._doInit(t),t.area=(this._area=new On(this.chart))._init()}get area(){return this._area}_createPoint(t){return new $n(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new Rn(t,e)}}Fn.type="line",Fn.defaults=$e(hs.defaults,{});class Bn extends Qi{_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?f(super.getParam(t),this.area.source.props[t]):super.getParam(t)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}setSelected(t){super.setSelected(t),this.area&&this.area.setSelected(t)}}class zn extends Fe{}zn.defaults=$e(Fe.defaults,{enabled:!0,autoMapChange:!0});class jn extends Fe{constructor(t,e){super(e.chart),this.name=t,this.series=e}getPath(){return this.border.path}_doSetSimple(t,e){return n(e)?(t.name=e,!0):super._doSetSimple(t,e)}}jn.defaults=$e(Fe.defaults,{});class Gn extends Fe{constructor(t,e){super(e.chart),this.name=t,this.series=e}}Gn.defaults=$e(Fe.defaults,{visible:!1});class Hn extends je{constructor(t){super(t),this._args={chart:t,inset:null}}getInsetText(t){var e;const i=this._op;let s=null!==(e=this._op.text)&&void 0!==e?e:t.name;if(i.textCallback){this._args.inset=t;const e=i.textCallback(this._args);null!=e&&(s=e)}return s}getInsetLabelStyle(t){if(this._op.styleCallback)return this._args.inset=t,this._op.styleCallback(this._args)}hideInsetLabel(t){if(this._op.visibleCallback)return this._args.inset=t,!1===this._op.visibleCallback(this._args)}isVisible(){return this.visible}getDefaultIconPos(){return"top"}}Hn.defaults=$e(je.defaults,{visible:void 0});class Wn extends Fi{}Wn.defaults=$e(Fi.defaults,{visible:!1,hoverColor:"white"});class Yn extends ts{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new zn(this.chart))._init(),t.insetLabel=(this._insetLabel=new Hn(this.chart))._init(),t.internalBorder=(this._internalBorder=new Gn(null,this))._init(),t.externalBorder=(this._externalBorder=new Gn(null,this))._init()}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get insetLabel(){return this._insetLabel}get internalBorder(){return this._internalBorder}get externalBorder(){return this._externalBorder}get color(){return this._colorObj}getMapBorders(){return this._mapBorders?this._mapBorders.filter((t=>t.visible&&t.border)):[]}isHiddenArea(t){return this._hiddenAreas&&this._hiddenAreas[t]}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t){return this._map.get(t)}pointOf(t){return this._areaPts.get(t.id)}pointByProp(t,e){var i;const s=this._points.getPoints();for(const r of s)if((null===(i=r.area)||void 0===i?void 0:i.source.props[t])===e)return r}getBounds(t){}getCenter(t){return t instanceof Bn||(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))}isMapSeries(){return!0}_createLabel(t){return new Wn(t)}$_createDetail(){return this._detail||(this._detail=new Yn(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){if(this.getDetailed()||(i(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),e.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(s(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new Bn(t)}_getPointArgs(t,e){return super._getPointArgs(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,e){var r;super._doPrepareRender(t,e);const o=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=n(e.hiddenAreas)?[e.hiddenAreas]:s(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=o.getBorder(t.name))})),this._minValue=h,this._maxValue=l,i(e.colorRange)){const t=p(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new Ss(t)}else this._colorRanger=null===(r=t.getColorScale(this._op.colorScale))||void 0===r?void 0:r.getRanger()}_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,i=(s(t)?t[0]:t)||"id",r=(s(t)?t.length>1?t[1]:t[0]:t)||"id",n="id"===r,o=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{t.area=n?o[t[r]]:o[t.source[r]],t.area&&a.set(t.area.id,t)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new ve(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}select(t){t&&(t.setSelected(!0),this.chart._selectionChanged(this,t))}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new jn(t.name,this);i._init(),i._load(t),e.push(i)}))}}Yn.type="map",Yn.defaults=$e(ts.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class Zn extends Fi{}Zn.defaults=$e(Fi.defaults,{visible:!1});class Un extends Qi{}class Xn extends Fe{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 De),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}Xn.defaults=$e(Fe.defaults,{});class Kn extends Xn{getMinSize(t){return G(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}Kn.defaults=$e(Xn.defaults,{text:"${name}"});class qn extends Xn{}qn.defaults=$e(Xn.defaults,{text:"${value}"});class Jn extends es{_doInit(t){super._doInit(t),t.header=(this._header=new Kn(this))._init(),t.divider=(this._divider=new Fe(this.chart))._init(),t.body=(this._body=new qn(this))._init()}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:g(this._width,nt.clampEx(t,this._minWidth,this._maxWidth)),height:g(this._height,nt.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new Zn(t)}_createPoint(t){return new Un(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}}Jn.DEF_MIN_WIDTH=80,Jn.DEF_MIN_HEIGHT=50,Jn.type="panel",Jn.defaults=$e(es.defaults,{orientation:"vertical",minWidth:Jn.DEF_MIN_WIDTH,minHeight:Jn.DEF_MIN_HEIGHT,position:"top"});class Qn extends rs{}class to{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class eo extends os{getRadius(t){return g(G(this._radiusDim,t),30)}hasThreshold(){return this._thresholds}getThreshold(t){if(this._thresholds)for(const e of this._thresholds)if(t<e.value)return e}getFieldColors(){return this._fieldColors}_createPoint(t){return new Qn(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius"),this._thresholds=this.$_parseThresholds(t.threshold)}_doPrepareRender(t,e){super._doPrepareRender(t,e);let i=g(e.startAngle%360,0),s=_(0,d(360,g(e.totalAngle,360)));this._startRad=A+P*i,this._totalRad=P*s}setCalcedColor(t,e){const i=this._op;super.setCalcedColor(t,e),this._fieldColors=void 0,i.colorByField&&!this._categories&&(s(i.fieldColors)?this._fieldColors=i.fieldColors:this._fieldColors=this._splitColors())}$_parseThresholds(t){return s(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new to(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new to(t.value,t.radius,t.style)]:void 0}}eo.type="pie",eo.defaults=$e(os.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByField:!0});class io extends Nt{constructor(t,e){super(t,si),this._rd=e,this.setPath(di.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 so extends is{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class ro extends ss{getExt(t,e){const i=g(t.radius,this._rd)*e;return{cx:0,cy:2*-i,rd:i,innerRd:i*this._innerRd}}get color(){return this._colorObj}_doApply(t){super._doApply(t),this._rd=g(t.radius,ro.DEF_RADIUS),this._innerRd=g(t.innerRadius,0)}_createPoint(t){return new so(t)}_defLabelOff(){return 2}_doLoadPoints(t){super._doLoadPoints(t)}_createLegendMarker(t,e){return new io(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new ve(this._calcedColor)}getColorScale(){return this._op.colorScale}getValueRange(){return{min:this._minValue,max:this._maxValue}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._visPoints,{min:r,max:n}=this._calcMinMax(s);this._minValue=r,this._maxValue=n,this._colorRanger=null===(i=t.getColorScale(e.colorScale))||void 0===i?void 0:i.getRanger()}}ro.DEF_RADIUS=9,ro.type="pin",ro.defaults=$e(ss.defaults,{radius:ro.DEF_RADIUS,innerRadius:0,position:"top"});class no extends Mt{constructor(t,e){super(t,si),this._size=e,this.add(this._marker=new Nt(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);di.setShape(this._marker,this._shape,e,e)}}class oo extends is{_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){const e=this.coord[0]!==t.coord[0]||this.coord[1]!==t.coord[1],i=this.value!==t.value;return e||i||super._valuesChanged(t)}}class ao extends ss{constructor(t){super(t),this._shape=t.getNextPointShape()}getShape(){return this._op.shape||this._shape}getRadius(){return g(this._op.radius,ao.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.internalSetStyle("stroke",this._stroke),t.internalSetStyle("stroke-width",this._strokeWidth))}_createPoint(t){return new oo(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 i=super.legendMarker(t,e);return i.setShape(this.getShape(),d(e,2*this._op.radius)),i}}ao.type="point",ao.defaults=$e(ss.defaults,{radius:5,position:"center"});class ho extends Mt{constructor(t,e){super(t,si),this.add(this._line=new Nt(t)),this.add(this._arrow=new Nt(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],i=e[e.length-2],s=e[e.length-1],r=V(Math.atan2(s[1]-i[1],s[0]-i[0]))-90,n="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setPath(`M ${s[0]} ${s[1]} L ${s[0]-4} ${s[1]-6} L ${s[0]+4} ${s[1]-6} Z`),this._arrow.setRotation(s[0],s[1],r)}}class lo extends Ri{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 h(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var i,r;const o=function(t){let e=[];return s(t)?t.forEach((t=>{s(t)?e=e.concat(o(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(r=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==r?r:[],this.path=null!=e.path?o(e.path):void 0}}class co extends qi{needMapScale(){return!0}_createPoint(t){return new lo(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(s(t)){const e=this.chart.body._points;i(e)&&(t=t.map((t=>{const i=h({},t);if(s(i.coords)){const t=i.coords.slice();n(t[0])&&(t[0]=e[t[0]]),n(t[1])&&(t[1]=e[t[1]]),i.coords=t}return i})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new ho(t,e)}}co.type=mi,co.defaults=$e(qi.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class _o extends rs{}class uo extends os{getPointGrid(t,e,i){const s=this._runGrid=[],r=this.$_caculate(t,e,i),n={rowCount:this._rowCount,colCount:this._colCount,grid:s,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(n);else this.$_fillColFirst(n);return{grid:s,count:r,rows:n.rows,cols:n.cols}}_createPoint(t){return new _o(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||uo.ROW_COUNT,this._colCount=t.colCount||uo.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||uo.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||uo.CELL_SIZE,this._gap=g(t.gap,uo.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=s(t.values)?t.values.reduce(((t,e)=>t+g(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*g(i,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(s);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,i=e.length;for(let s=0;s<i;s++)if(isNaN(e[s][t]))return s;return i}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._colCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),a==i-1?(h++,a=this.$_rows(h)):h===s-1||this.$_cols(a)>this.$_cols(a+1)+r?(a++,h=this.$_cols(a)):(h++,a=this.$_rows(h)),l++}t.rows=n,t.cols=o}$_fillColFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._rowCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),h==s-1?(a++,h=this.$_cols(a)):a===i-1||this.$_rows(h)>this.$_rows(h+1)+r?(h++,a=this.$_rows(h)):(a++,h=this.$_cols(a)),l++}t.rows=n,t.cols=o}}uo.ROW_COUNT=10,uo.COL_COUNT=10,uo.THRESHOLD=1,uo.CELL_SIZE=5,uo.GAP=2,uo.type="waffle",uo.defaults=$e(os.defaults,{rowCount:uo.ROW_COUNT,colCount:uo.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:uo.THRESHOLD,cellSize:uo.CELL_SIZE,gap:uo.GAP});class po extends gr{static loadMap(t,e){return i(t)&&i(t.source)&&s(t.source.features)||i(t)&&i(t.map)&&s(t.map.features)?new po(t,e):void 0}_doLoad(t){const e=t.features,i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new dr(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,i.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,i.push(e)}}})),i}}class go extends Fe{}class mo extends Fe{}class fo extends Ke{constructor(t,e){super(t),this.inBody=e,this._zoom=100,this._panX=0,this._panY=0,this.scroll=0,this._scale=1,this._vRect=ct.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))}}_doInit(t){t.target=(this._target=new go(this.chart))._init(),t.connector=(this._connector=new mo(this.chart))._init()}get target(){return this._target}get connector(){return this._connector}prepareLayout(t,e){return this.$_prepareLayout(t,e)}refresh(){}_getNamePrefix(){return"mapregion"}_doPrepareRender(t,e){const i=this._map=t.map,s=t.getProjection(),r=e.bounds,n=Math.abs(r[0][0]-r[1][0]),o=Math.abs(r[0][1]-r[1][1]),a=Math.abs(i.x2-i.x1)/n,h=Math.abs(i.y2-i.y1)/o,l=[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2],[c,d]=s.project(l);this._zoom=100*Math.min(a,h),s.isGlobe||(t.body.isScrollable()?this.scroll=l[0]:this._panX=c-i.cx,this._panY=-d+i.cy)}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=o-n,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=g(this._panX*d,0),u=g(this._panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,m=e/2+(n+h/2)*d-this._panY*d,f=l/d*a,b=l/d*h,y=s+a/2-f/2+this._panX,w=n+h/2-b/2-this._panY;return this._vRect=ct.create(y,w,f,b),{scale:d,wMap:a,hMap:h,tx:p,ty:m}}}fo.defaults=$e(Fe.defaults,{width:200});class bo extends qe{getRegion(t){const e=this._map[t];if(e instanceof fo)return e}_loadItem(t,e,i,s){const r=new fo(t,s);return r._init(),r.index=i,r._load(e),r}}class yo extends _t{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=g(i,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==s||s()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class wo extends _t{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=g(s,300),this._old=t.zoom,this.view.$_moveTo(i),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 Fe{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}xo.defaults=$e(qi.defaults,{visible:void 0,globeFill:"lightblue"});const vo={zoom:1,panX:1,panY:1};class So extends Fe{constructor(t){super(t),this._prj=(new Wr).prepareSecond(),this._zoom=100,this._panX=0,this._panY=0,this._scale=1,this._vRect=ct.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new gi(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 isFlatWorld(){return this._map.isWorld&&!this._prj.isGlobe}get rotationX(){return this._prj instanceof yr?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof yr?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){return this._prj.scroll}set scroll(t){this.updateOption("scroll",t)}get movable(){return!1!==this._op.movable}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}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}prepare(t){this._map=t}prepareLayout(t,e){return this.isFlatWorld?this.$_prepareLayout_world(t,e):this.$_prepareLayout(t,e)}$_prepareLayout_world(t,e){const i=this._prj,s=this._map,r=i.getYRange(s.v1,s.v2),n=i.project([s.h1,r[0]]),o=i.project([s.h2,r[1]]),a=this._wMap=o[0]-n[0],h=[s.x1,s.y1],l=[s.x2,s.y2][1]-h[1],c=Math.min(t/a,e/l),d=this._scale=this._zoom/100*c,_=g(this._op.panX*d,0),u=g(this._op.panY*d,0);if(this.isScrollable())this._panX=0;else{const e=this.$_calcPan(t,a*d,_)/d;this._panX=e}this._panY=this.$_calcPan(e,l*d,u)/d;const p=i.scroll*a/360,m=t/2-(n[0]+a/2)*d-(this._panX+p)*d,f=e/2+(h[1]+l/2)*d-this._panY*d,b=c/d*a,y=c/d*l,w=s.x1+a/2-b/2+this._panX,x=s.y1+l/2-y/2-this._panY;return this._vRect=ct.create(w,x,b,y),{scale:d,wMap:a,hMap:l,tx:m,ty:f}}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=o-n,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=g(this._op.panX*d,0),u=g(this._op.panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,m=e/2+(n+h/2)*d-this._panY*d,f=l/d*a,b=l/d*h,y=s+a/2-f/2+this._panX,w=n+h/2-b/2-this._panY;return this._vRect=ct.create(y,w,f,b),{scale:d,wMap:a,hMap:h,tx:p,ty:m}}getPoint(t){return this._points[t]}toVisible(t){if(this.isFlatWorld)return this._prj.getVisible(t);{const e=this._prj.getVisible(t);if(e&&this._vRect.contains(e[0],e[1]))return e}}isScrollable(){return this.options.scrollable&&this.map.isWorld}setZoom(t,e=300){let s,n;o(e)?n=e:r(e)?(s=e,n=300):i(e)&&(s=e.end,n=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),n>0?new yo(this,t,n,s).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}zoomByFactor(t,e=!0){if(!isNaN(t)){const i=this.zoom;e?this.setZoom(i+i*t/100):this.zoom=i+i*t/100}}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new wo(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){const r={..._i,...s},n=this.map.areaOf(t),o=n.getCenter(),{x1:a,x2:h,y1:l,y2:c}=n.mainLandBounds,{zoom:d}=this.calcZoomInfo([a,l],[h,c],e),_=Math.min(r.maximumZoom,Math.max(r.minimumZoom,d));new wo(this,_,o,i,null).start()}zoomToBounds(t,e,i=300,s=.7){const{center:r,zoom:n}=this.calcZoomInfo(t,e,s);try{new wo(this,n,r,i,null).start()}catch(t){console.error(t)}}calcZoomInfo(t,e,i){const s=this.map,r=Math.abs(e[0]-t[0]),n=Math.abs(e[1]-t[1]),o=[(t[0]+e[0])/2,(t[1]+e[1])/2],a=Math.abs(s.x2-s.x1)/r*i,h=Math.abs(s.y2-s.y1)/n*i;return{center:o,zoom:100*Math.min(a,h)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this._map,[i,s]=this._prj.project(t);this._prj.isGlobe?(this.rotationX=-t[0],this.rotationY=-t[1]):(0!==this.scroll||this.isScrollable()?this.scroll=t[0]:this.panX=i-e.cx,this.panY=-s+e.cy)}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,i){const s=t in vo;s&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,i)}finally{s&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let i=!0;for(const e in t)if(!(e in vo)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var r,o,a;const h=this;var l;super._doApply(t),e.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 yr;break;case"equalearth":h._prj=(new Jr).prepareSecond();break;case"miller":h._prj=(new on).prepareSecond();break;case"mercator":h._prj=(new en).prepareSecond();break;default:h._prj=(new Wr).prepareSecond()}return!0}}(t.projection);const _=this._prj;if(_&&(d||void 0!==t.scroll&&t.scroll!==this._rawScroll)){_.scroll=t.scroll,this._rawScroll=t.scroll,d=!0;const e=null===(r=this.chart)||void 0===r?void 0:r.firstMapSeries;e&&e.setOptionsDirty(!0)}_ instanceof yr&&(d=_.setRotation(t.rotationX,t.rotationY)||d),function(t){void 0!==t&&(h._zoom=Math.max(100,g(t,100)))}(t.zoom);const u=this._points={};s(t.points)&&t.points.forEach((t=>{s(t)&&t.length>=3&&n(t[0])?u[t[0]]=[t[1],t[2]]:i(t)&&n(t.id)&&(u[t.id]=s(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,{chart:this.chart.wrapper,zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}So.defaults=$e(Fe.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:5});class Co extends Yn{}class Lo extends Fe{constructor(){super(...arguments),this._widgetGaps=new mt}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=t.widgetSectionGap;n(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e)}}Lo.defaults=$e(Fe.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,domResize:!1});class ko extends gt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=hi.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Kt,this._series=new Ji(this),this._annotations=new gi(this),this._mapRegions=new bo(this),this._widgetGroups=new Xe(this),this._legends=new vs(this),this._colorScales=new Vs(this),this._bubbleScales=new ys(this),(this._chartOptions=new Lo(this))._init(),(this._axis=new Xs(this))._init(),(this._body=new So(this))._init(),(this._exporter=new Ds(this))._init(),(this._title=new Vr(this))._init(),(this._subtitle=new Dr(this))._init(),(this._zoomPanel=new Nr(this))._init(),(this._drilldownPanel=new Er(this))._init(),(this._mapScale=new Pr(this))._init(),(this._credits=new Qe(this))._init(),(this._tooltip=new Rr(this))._init(),this.options=Object.assign({},ko.defaults),this._bases={axis:{},series:{},gauge:{},annotation:{}},i(t)?this._load(t):this._initOptions(),this._selection=new Tr(this)}_initOptions(){}get wrapper(){return this._wrapper}get isGlobe(){return this.getProjection().isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}findSeries(t){return this._series._internalItems().find(t)}_getSeriesType(t){return n(t)&&Oi[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&ui[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}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var i,s;this._fireEvent("onModelChanged",t,"selection"),null===(s=(i=this._chartOptions.options).onSelectionChanged)||void 0===s||s.call(i,{chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(){return this._body._prj||(new Wr).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,i){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._legends.first}get credits(){return this._credits}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,i=(t instanceof Mr?t:this.getMap(t))||this._maps[0];i!==e&&(this._baseMap=i,this._loading||(this._baseMap.reset(),this.mapChanged(i)))}get axis(){return this._axis}get title(){return this._title}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 Yn))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get widgetGroup(){return this._widgetGroups.first}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof Yn&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}getMapRegions(){return this._mapRegions.getVisibles()}coordOfArea(t){var e,i;return(null===(i=null===(e=this._baseMap)||void 0===e?void 0:e.areaOf(t))||void 0===i?void 0:i.getCenter())||ri}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)}getSeries(t){return o(t)?this._series.get(t):this._series.getSeries(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)}mapRegionByName(t){return this._mapRegions.getRegion(t)}_collectWidgets(){const t={};for(const e of Object.values(q))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(q)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&Oe(n={},r.base),i(r[s])&&(n||(n={}),Oe(n,r[s])),n?Oe(n,t):t}_setProperties(t,e=!0){const i=this.options;for(const e in ko.defaults)t.hasOwnProperty(e)&&(i[e]=t[e])}_load(t){const e=this.options;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(f(t.asset,t.assets)),e.chart=this._chartOptions._load(t.chart),e.body=this._body._load(t.body);const r=s(t.map)?t.map:i(t.map)?[t.map]:null;return s(r)&&(r.forEach(((t,e)=>{if(!1!==t.enabled){const i=wr.loadMap(t,e)||po.loadMap(t,e),s=i&&new Mr(this,i,e);s.isWorld&&s._prepareSecond(),this._maps.push(s)}})),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.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,Co),!1===e.chart.alwaysMap||0!==this._series.count&&this._series.get(0).isMapSeries()||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._mapRegions.load(t.mapRegions||t.mapRegion,!1),this._widgetGroups.load(t.widgetGroup),this._legends.load(t.legend),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;if(i(t)){const r=this._templates={};for(const e in t){const s=t[e];i(s)&&(r[e]=h({},s))}["@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 i=this._templates[e];if(i)return Oe(Oe({},i),t)}else s(e)&&e.forEach((e=>{let i=this._templates[e];return i?Oe(Oe({},i),t):i}));return t}}else this.assignTemplates=void 0}prepareRender(){this._colorScales.beforeRender(),this._bubbleScales.beforeRender(),this._legends.beforeRender(),this._widgetGroups.beforeRender(),this._series._prepareRender(this._optionsDirty,this._legends),this._widgetGroupDirty&&this.$_buildWidgetGroups(),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legends.prepareRender(),this._widgetGroups.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._mapRegions.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 i=this[e];(i instanceof Fe||i instanceof Be||i instanceof Kt)&&i.updateOptions(t[e],!1)}e&&this._optionChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(t){return this._series.getLegendSources(t).concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,i){return i&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const i=this._series.add(t);return i&&this._optionChanged(i),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._optionChanged(null),i}_dataChanged(t){this._dataDirty||(this._dataDirty=!0,this._fireEvent("onDataChanged",t))}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.find(t,!0)}getBubbleScale(t){return null===t?null:this._bubbleScales.find(t,!0)}async drilldown(t,e){if(!(t instanceof Yn&&t.detail))return;const i=t.drilldown,s=t.detail;if(!i.options.enabled)return;s.options.dataUrl&&(s.updateOption("data",await fetch(s.options.dataUrl).then((t=>t.json()))),delete s.options.dataUrl);const r=t.map,n=this.getMap(s.options.map)||r;i.options.autoMapChange&&n!==r&&this.setBaseMap(n),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof Yn&&t.parent))return;const e=t.drilldown;if(!e.options.enabled)return;const i=t.parent,s=this.map;e.options.autoMapChange&&i.map!==s&&this.setBaseMap(i.map),t.showParent(),this._body.zoom=100}canClick(){return r(this._chartOptions.options.onClick)}click(t){var e,i;null===(i=(e=this._chartOptions.options).onClick)||void 0===i||i.call(e,t)}pointToMap(t,e){return this._fireEvent("onPointToMap",t,e)}$_buildWidgetGroups(){const t=this._widgetGroups;for(const e of t._internalItems())e._clean();[this._legends,this._colorScales,this._bubbleScales].forEach((e=>{e._internalItems().forEach((e=>{if(e instanceof Ye){const i=t.get(e.options.group,e.getLocation());e._setGroup(i),i&&i._add(e)}}))}));for(const e of t._internalItems())e._sort();this._widgetGroupDirty=!1}_visibleChanged(t){}_hoverAreaChanged(t,e,i){var s,r;null===(r=(s=this._body.options).onHoverArea)||void 0===r||r.call(s,{chart:this._wrapper,area:null==e?void 0:e.getInfo(),oldArea:null==i?void 0:i.getInfo()})}_areaClicked(t,e){var i,s;null===(s=(i=this._body.options).onClickArea)||void 0===s||s.call(i,{chart:this._wrapper,area:null==e?void 0:e.getInfo()})}}ko.defaults={type:"map",startOfWeek:0},qi.register(Yn,ao,ro,hn,eo,En,ps,co,Dn,Fn,Jn,uo,bn,Pn),pi.register(jr,Gr,Hr,zr);const Mo="$ctrl";class Ao{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new ko(t,this),this._loaded=i(t),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 widgetGroup(){return this._obj.widgetGroup}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 ";nt.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new ko(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,nt.log("chart-items:",Re),nt.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}async loadAsync(t,e=!1,s){var r;if(!i(t))return this;const n=this[Mo];try{null==n||n.showLoadingView(),null==n||n.hideErrorView();const i="load chart ";nt.LOGGING&&console.time(i),await x.loadConfigAsync(t);let o=this._obj,a=o;return this._loaded?(o.destroy(),a=this._obj=new ko(null,this)):(this._loaded=!0,o=null),a._load(t),a._loadAnimatable=e,this._loadCallback=s,nt.log("chart-items:",Re),nt.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,a,o),this}catch(t){console.error(t),null==n||n.showErrorView(null==t?void 0:t.message)}finally{null==n||n.hideLoadingView()}}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,i){}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)}pointToMap(t,e){return this._obj.pointToMap(t,e)}async drilldown(t,e){const i=t instanceof Yn?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof Yn&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof Yn?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof Yn&&this._obj.drillup(e)}}class Po extends Mt{constructor(t,e,i=!1){super(t,e,"image"),this._dirty=!0,this._bounds=ot,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},i&&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,i){return!!t&&(this.url=t,this.resize(e,i)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class Io extends Mt{constructor(t,e){super(t,Io.STYLE),this._spinnerWrapper=new Mt(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new Po(t,"rm-loading-spinner",!0)),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}pointerDown(t){let e;return e=this._pointerToPoint(t),this._clickX=this._prevX=e.x,this._clickY=this._prevY=e.y,this._doPointerDown(t)}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_doDrag(t,e,i,s){if(!this.$_drag(e,this._prevX,this._prevY,i,s))return this.$_stopDragTracker(e,i,s,!0),this._stopEvent(t),!0}$_startMove(t,e,i,s){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._clickX,this._clickY,i,s)&&(this._clearTouchEffects(),i!==this._prevX||s!==this._prevY?this.$_doDrag(t,e,i,s):this._stopEvent(t))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,i=this.dragging,{x:s,y:r}=this._pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(s<0||s>=this._control.dom().offsetWidth||r<0||r>=this._control.dom().offsetHeight?i&&this.$_stopDragTracker(e,s,r,!0):i?this.$_doDrag(t,e,s,r):(!this._dragTracker&&Math.abs(this._prevX-s)>3||Math.abs(this._prevY-r)>3||this._dragTracker&&!i)&&this.$_startMove(t,e,s,r),this._prevX=s,this._prevY=r,this._touches.push({x:s,y:r,t:t.timeStamp})):i&&this.$_stopDragTracker(e,s,r,!0),this.dragging&&this._stopEvent(t),this._doPointerMove(s,r,t)}pointerUp(t){if(this._pinching)return;const e=t.target,{x:i,y:s}=this._pointerToPoint(t);this.$_stopDragTracker(e,i,s)}pointerCancel(t){const e=t.target,{x:i,y:s}=this._pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,i,s,!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,i){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,i){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,i,s,r){return!1}_getDragTracker(t,e,i){return null}$_startDrag(t,e,i,s,r){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,s-e,r-i)),!!this._dragTracker&&this._dragTracker.start(t,e,i,s,r)}$_drag(t,e,i,s,r){return this._dragTracker.drag(t,e,i,s,r)}$_stopDragTracker(t,e,i,s=!1){this.dragging&&(s?this._dragTracker.cancel():this._dragTracker.drop(null,e,i),this._dragTracker=null)}_pointerToPoint(t){return this._control.pointerToPoint(t)}$_checkSwipe(t,e){const i=this._touches,s=i.length;if(s<2)return;const r=i[s-1];let n=i[s-2];if(r.t-n.t<=100)for(let t=s-3;t>=0&&(n=i[t],!(r.t-n.t>100));t--);const o=n.x,a=n.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(o-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-n.t),d=.998;if(c>.1){const e=this._dragTracker,i=Math.log(.1/c)/Math.log(d),s=c*(1-Math.pow(d,i+1))/(1-d);let r,n=Math.round(180*Math.atan2(l-a,h-o)/Math.PI);if(n<0&&(n=360+n),r=n>45&&n<=135?Y.DOWN:n>135&&n<=225?Y.LEFT:n>225&&n<=315?Y.UP:Y.RIGHT,this.dragging){if(e.swipe(r,1.6*i,1.3*s))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*i,1.3*s)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}}class Eo extends pt{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,i,s,r){return this.cancel(),!!this._doStart(t,e,i,s,r)&&(this._dragging=!0,this._showFeedback(s,r),!0)}drag(t,e,i,s,r){return!(!this._dragging||!this._doDrag(t,e,i,s,r))&&(this._moveFeedback(s,r),!0)}cancel(){if(this._dragging)try{this._dragging=!1,this._doCanceled()}finally{this.end()}}drop(t,e,i){if(this._dragging)try{this._dragging=!1,this._canAccept(t,e,i)?this._doCompleted(t,e,i):this._doCanceled()}finally{this.end(e,i)}}swipe(t,e,i){if(this._doSwipe(t,e,i))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,i){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,i,s,r){return!0}_doCanceled(){}_canAccept(t,e,i){return!0}_doCompleted(t,e,i){}_doEnded(t=-1,e=-1){}}class To extends Eo{_doDrag(t,e,i,s,r){const n=this.control.model.body;n.rotationX+=(s-e)/2,n.rotationY-=(r-i)/2}}class Vo extends Eo{constructor(t){super(t);const e=t.model.body;this._oldX=e.scroll+e.panX,this._oldY=e.panY}_doStart(t,e,i,s,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=i,this.control.chartView().onScrollStart(),super._doStart(t,e,i,s,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,i,s,r){const n=this.control.model.body,o=this._oldX-(s-this._xStart)/n.scale,a=this._oldY-(r-this._yStart)/n.scale;if(n.isScrollable()){const t=360;n.scroll+=t/(n.calcedMapWidth*n.scale)*(e-s)}else n.panX=o;return n.panY=a,!0}$_mapView(){return this.control.model.body}}class Do extends Mt{constructor(t,e=C){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Do.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Do.IGNORE_ATTRS={width:"",height:""};class Ro extends Do{constructor(t,e){super(t,e),this.add(this._text=new ke(t,void 0)),this._text.anchor=Se.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.options,n=r.effect;return this._model=e,this._text.setStyleOrClass(r.style),"background"===n?(this._outline&&this._outline.remove(),this._back||(this._back=new Ai(t,"rm-label-background")),this.insertFirst(this._back),this._back.internalSetStyleOrClass(r.backgroundStyle)):"outline"===n?(this._back&&this._back.remove(),this._outline||(this._outline=new ke(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()),i?this._icon||(this.add(this._icon=new Po(t)),this._icon.url=i,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=ve.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const t=this._text,e=this._outline,i=this._icon;let s=0;const r=t.bbox(),n=r.width,o=r.height;let a,h=n,l=o,c=0,d=0,_=0,u=0;if(this._box=void 0,i){const t=i.bbox();switch(s=g(this._model.options.iconGap,0),c=t.width,d=t.height,this._model.getIconPos()){case"left":case"right":h+=s+c,l=Math.max(d,o);break;default:l+=s+d,h=Math.max(c,n)}}if(this._back&&this._back.parent&&(a=getComputedStyle(this._back.dom),_=parseFloat(a.paddingLeft)||0,u=parseFloat(a.paddingTop)||0,this._back.setBounds(0,0,h+_+(parseFloat(a.paddingRight)||0),l+u+(parseFloat(a.paddingBottom)||0),a.rx)),i)switch(this._model.getIconPos()){case"left":i.trans(_,(l-d)/2),_+=c+s,h-=c+s;break;case"right":i.trans(_+h-c,(l-d)/2),h-=c+s;break;case"top":i.transX((h-c)/2),u+=d+s;break;case"bottom":i.trans((h-c)/2,u+o+s)}switch(a||(a=getComputedStyle(t.dom)),a.textAlign){case"center":_+=h/2,t.anchor=Se.MIDDLE;break;case"right":_+=h,t.anchor=Se.END;break;default:t.anchor=Se.START}return t.trans(_,u),e&&(e.anchor=t.anchor,e.setAttr("y",t.getAttr("y")),e.trans(_,u)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class $o extends Eo{constructor(t,e,i){super(t),this.mode=i,this._body=e}_doStart(t,e,i,s,r){const n=this.control.getBounds(),o=this._body.getBackBounds();this._xStart=_(0,e-o.x+n.x),this._yStart=_(0,i-o.y+n.y),this._body.addFeedback(this._feedback=new Ai(this.control.doc(),"rm-bounds-tracker")),this._body.addFeedback(this._fromTag=new Ro(this.control.doc(),"rm-bounds-tracker-tag")),this._body.addFeedback(this._toTag=new Ro(this.control.doc(),"rm-bounds-tracker-tag"));const a={options:{effect:"background",backgroundStyle:{fill:"#000020aa",padding:"3px 4px"}}};return this._fromTag.setModel(document,a,null,null),this._toTag.setModel(document,a,null,null),!0}_hideFeedback(){this._feedback.remove(),this._fromTag.remove(),this._toTag.remove()}_doEnded(t,e){const i=this.$_calcBound(t,e),{from:s,to:r}=this._body.boundsToMap(i,!1,!0);"zoom"===this.mode&&this._body.model.zoomToBounds(s,r)}_doDrag(t,e,i,s,r){const n=this.$_calcBound(s,r),{from:o,to:a}=this._body.boundsToMap(n,!1,!0),h=ie.getFormatter(",0.000");return this._feedback.setRect(n),this._fromTag.setText(`(${h.toStr(o[0])}°, ${h.toStr(o[1])}°)`).layout(),this._fromTag.trans(n.x-this._fromTag.bbox().width/2,n.y-this._fromTag.bbox().height-4),this._toTag.setText(`(${h.toStr(a[0])}°, ${h.toStr(a[1])}°)`).layout(),this._toTag.trans(n.x+n.width-this._toTag.bbox().width/2,n.y+n.height+4),!0}$_calcBound(t,e){const i=this.control.getBounds(),s=this._body.getBackBounds(),r=this.control.width(),n=this.control.height();return t=_(0,d(r,t-s.x+i.x)),e=_(0,d(n,e-s.y+i.y)),{x:d(this._xStart,t),y:d(this._yStart,e),width:u(this._xStart-t),height:u(this._yStart-e)}}}class Oo extends No{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){this.dragging?this.dragTracker instanceof Vo&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target)}_doClick(t){const e=t.target,i=rt?t.ctrlKey:t.metaKey,s=this.$_chart(),r=this.$_chartView(),n=s.chartOptions.options.clickAction,o=r.getButton(e);let a,h,l;if(o)o.click();else if(a=r.legendByDom(e))if(a.source instanceof Ri){const t=a.source;s.seriesByPoint(t)}else a.source.canHide()&&(a.source.visible=!a.source.visible);else if(e===this._clickElement){const o=this._pointerToPoint(t);if(o.x-=r.tx,o.y-=r.ty,h=r.seriesByDom(e))h.click(e,o);else if(l=r.creditByDom(e))l.click(e);else if(r.drilldownPanelView().click(e))return;switch(n){case"select":h&&h.model.canSelect()&&(i?h.toggleSelect(e,o):h.select(e,o,!0));break;case"drilldown":this.$_drildown(s,t,r)}r.click(t,e,h)}}_doDblClick(t){const e=this.$_chart(),i=this.$_chartView(),s=e.chartOptions.options.dblClickAction;"drilldown"===s&&this.$_drildown(e,t,i)}_doWheel(t){const e=this.$_chart().body;if(e.options.zoomable){const i=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX,s=g(Math.max(1,e.options.wheelZoomFactor),5);return e.zoom,e.zoomByFactor(-i/s,!1),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,i){const s=this.$_chart(),r=s.options.chart.dragAction;return"zoom"===r||"select"===r?new $o(this.control,this.$_chartView().bodyView(),r):s.isGlobe?new To(this.control):s.body.isScrollable()||s.body.movable?new Vo(this.control):void 0}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}$_drildown(t,e,i){const s=t.firstMapSeries;if(s){const r=this._pointerToPoint(e),n=e.target,o=i.bodyView().getSeries(s).pointByDom(n,r);o&&o.point instanceof Bn&&t.drilldown(t.firstMapSeries,o.point.area.id)}}}class Fo{static empty(){return new Fo}static create(t=0,e=0){return new Fo(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 Fo(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+"}"}}Fo.EMPTY=new Fo;class Bo extends Mt{constructor(t,e=C){super(t,e,"g"),Mt.DEBUGGING&&(this.add(this._debugRect=new Ai(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.internalSetStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this._op=t._op)}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,i,s);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),Mt.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Ai(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,i,s){return{width:i,height:s}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class zo extends Bo{constructor(t,e,i){super(t,e),this._margins=new mt,this._paddings=new mt,this.add(this._background=new Ai(t,i))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let r=getComputedStyle(this._background.dom);const n=this._paddings;n.applyPadding(r);const o=this._doMeasure(t,e,i,s);if(o.width+=n.left+n.right,o.height+=n.top+n.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=o.width+=t.left+t.right,this.mh=o.height+=t.top+t.bottom}return this.mw=o.width,this.mh=o.height,o}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class jo extends Do{measure(t,e,i,s){const r=this._doMeasure(t,e,i,s);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,i){return this._doLocateInner(t,e,i),this}}class Go extends Ro{constructor(t){super(t,"rm-map-widget-title")}}class Ho extends Ro{constructor(t){super(t,"rm-map-widget-footer")}}class Wo extends zo{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new Go(t)),this.add(this._footerView=new Ho(t))}_setBackgroundStyle(t){t.setVisible(this.model.options.background.visible)&&t.internalSetStyleOrClass(this.model.options.background.style)}$_layoutCaption(t,e,i){i.internalResetStyleOrClass(e._style),i.setModel(t,e,null,null),e.prepareRich(e.options.text),e.buildSvg(i._text,i._outline,NaN,NaN,e,null),i.layout()}_checkTitle(t){const e=this._titleView,i=this.model.title;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rTitle=e.bbox(),(this._inTitle="inline"===i.getDisplay(this.model))?this._rTitle.width+=i.getGap(this._inTitle):this._rTitle.height+=i.getGap(this._inTitle),!0}_checkFooter(t){const e=this._footerView,i=this.model.footer;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rFooter=e.bbox(),this._inFooter="inline"===i.getDisplay(this.model),this._gapFooter=i.getGap(this._inFooter),!0}}class Yo extends pt{constructor(t,e,i,s=0){super(),this._reversed=!1,this.removeDelay=0,this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i,this.removeDelay=s}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}get reversed(){return this._reversed}set reversed(t){if(t!=this._reversed){const e=this._owner,i=this._views;if(this._reversed=t,i.forEach((t=>t.remove())),t)for(let t=i.length-1;t>=0;t--)e.add(i[t]);else i.forEach((t=>e.add(t)))}}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()}getRange(t,e){return this._views.slice(t,e)}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e=null,i=null){const s=this._owner.doc,r=this._pool,n=this._views;for(let t of n)t.parent;for(t=Math.max(0,t);n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(s);n.push(e),i&&i(e,n.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._reversed?this._owner.insertFirst(t):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 i of t)this.free(i,e)}clear(){this.freeAll(this._views)}forEach(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)t(e[i],i,s)}visit(t){const e=this._views.length;let i=0;for(;i<e&&!1!==t(this._views[i],i,e);i++);return i===e}find(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)if(t(e[i]))return e[i]}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 i=this._views.indexOf(t);i>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(i,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._reversed?this._owner.insertFirst(e):this._owner.add(e),e}_getElementId(t){}}class Zo extends Bo{constructor(t){super(t,"rm-legend-item"),this.add(this._back=new Ai(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new ke(t,"rm-legend-item-label")),this._label.anchor=Se.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,i,s){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():ot,n=ht(this._label.bbox());return this._gap=g(e.legend.options.markerGap,0),{width:r.width+this._gap+n.width,height:_(r.height,n.height)}}_doLayout(t){const e=this._rMarker,i=g(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((i-e.width)/2,(this.height-e.height)/2),this._label.trans(i+this._gap,(this.height-this._label.bbox().height)/2)}}class Uo extends Wo{constructor(t){super(t,Uo.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new Yo(this,Zo)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_doMeasure(t,e,i,s){const r=e.options,n=e.items(),o=this._vertical="vertical"===e.getLayout();this._ipr=g(r.itemsPerLine,Number.MAX_SAFE_INTEGER),o?s=e.getMaxHeight(s):i=e.getMaxWidth(i),this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),this.$_prepareItems(t,n);const a=this.$_measure(t,e,o,this._ipr,i,s);return this._titleView.visible&&(this._inTitle?a.height=Math.max(a.height,this._rTitle.height):a.width=Math.max(a.width,this._rTitle.width)),this._footerView.visible&&(this._inFooter?a.height=Math.max(a.height,this._rFooter.height):a.width=Math.max(a.width,this._rFooter.width)),a}_doLayout(){const t=this.model,e=t.options,i=this._rowViews,s=e.sameTextColor,r=this._sizes,n=e.itemsAlign,o=e.lineGap||0,a=e.itemGap||0,h=this._margins,l=this._paddings,c=this._vertical,d=this._titleView,_=this._footerView,u=this._rTitle,p=d.visible?u.height:0,g=d.visible?u.width:0,m=this._rFooter,f=_.visible?m.height:0,b=_.visible?m.width:0,y=_.visible?this._gapFooter:0;let w,x,v,S=h.left+l.left,C=h.top+l.top,L=this.width-S-h.right-l.right,k=this.height-C-h.bottom-l.bottom;if(d.visible)if(this._inTitle){switch(x=C,t.title.options.verticalAlign){case"top":break;case"bottom":x+=k-p;break;default:x+=(k-p)/2}d.trans(S,x),S+=g,L-=g}else{switch(t.title.options.align){case"center":w=Math.max(S,S+(L-u.width)/2);break;case"right":w=Math.max(S,S+L-u.width);break;default:w=S}d.trans(w,C),C+=p,k-=p}const M=S,A=C;if(_.visible){if(this._inFooter){switch(w=M+L-b,x=C,t.footer.options.verticalAlign){case"top":break;case"bottom":x+=k-f;break;default:x+=(k-f)/2}L-=b+y}else{switch(x=C+k-f,t.footer.options.align){case"center":w=Math.max(S,S+(L-m.width)/2);break;case"right":w=Math.max(S,S+L-m.width);break;default:w=S}k-=f+y}_.trans(w,x)}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("")})),i.forEach(((t,e)=>{if(c){const i=this._wMarkers;t.forEach((t=>{t.mw=r[e],t.resizeByMeasured().layout(i[e])})),C=A,"center"!==n&&"end"!==n||(v=t.map((t=>t.height)).reduce(((t,e)=>t+e))+a*(t.length-1),C+="center"===n?(k-v)/2:k-v),t.forEach((t=>{t.trans(S,C),C+=t.height+a})),S+=r[e]+o}else t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),S=M,"center"!==n&&"end"!==n||(v=t.map((t=>t.width)).reduce(((t,e)=>t+e))+a*(t.length-1),S+="center"===n?(L-v)/2:L-v),t.forEach((t=>{t.trans(S,C),S+=t.width+a})),C+=r[e]+o}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,r,n){const o=e.options,a=e.items(),h=this._itemViews,l=o.itemGap||0,c=o.lineGap||0,d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,m,f,b;h.forEach(((e,i)=>{e.setMarker(a[i].source.legendMarker(t,+o.markerSize||ws.MARKER_SIZE)),e.measure(t,a[i],r,n)}));let y=0,w=0;if(i){for(;y<d;)b=h.get(y),w%s===0?(u.push(f=[b]),m=b.mh,w++,y++):(m+=l+b.mh,m<=n?(f.push(b),w++,y++):w=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=_(i,t.mw),r=_(r,t._rMarker.width),t._col=e})),s+=l*(t.length-1),m=_(m,s),g+=i,p.push(i),this._wMarkers.push(r)})),g+=c*(u.length-1)}else{for(;y<d;)b=h.get(y),w%s===0?(u.push(f=[b]),g=b.mw,w++,y++):(g+=l+b.mw,g<=r?(f.push(b),w++,y++):w=0);g=m=0,u.forEach((t=>{let e=0,i=0;t.forEach((t=>{e+=t.mw,i=_(i,t.mh)})),e+=l*(t.length-1),g=_(g,e),m+=i,p.push(i)})),m+=c*(u.length-1)}return this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),{width:g,height:m}}}Uo.LEGEND_CLASS="rm-legend";const Xo={};class Ko extends zo{static register(...t){t.forEach((t=>{Xo[t[0].type]=t[1]}))}constructor(t,e){super(t,Ko.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,i){this.measure(this.doc,this.model,e,i),this._layoutView(t,0,0,e,i)}_layoutView(t,e,i,s,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,i,s,r,this.width,this.height))}_posByAnchor(t){const e=this.model,i=e._anchorObj;if(i){const s=t.getAnnotationAnchor(i);if(s){const t=e.getOffset(this.width,this.height),i=s.width,r=s.height;let n=s.tx,o=s.ty;switch(this._op.align){case"left":n-=this.width+t.x;break;case"right":n+=i+t.x;break;default:n+=(i-this.width)/2+t.x}switch(this._op.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(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)}}Ko.CLASS_NAME="rm-annotation";class qo{static interpolate(t,e){if(e instanceof yr==!1)return t;const i=[];let s=null,r=null,n=!1;for(let o=0;o<t.length;o++){const a=t[o],h=e.project(a);if(h.outside)n=!0;else{if(s||(s=a,t.push(a)),n&&r){const t=xr(r,a);for(const s of t){const t=e.project(s);t.outside||i.push(t)}}i.push(h),r=a,n=!1}}return i}}class Jo{static box(t,e,i,s,r){const n=Math.floor(Math.abs(i-t)/20),o=this.boxPoints(t,e,i,s,n);return this.coordsToPath(Jo.toPixelCoord(r,o))}static ellipse(t,e,i,s,r,n=40){const o=this.arcCoords(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,n);return this.coordsToPath(Jo.toPixelCoord(r,o))}static geoCircle(t,e,i,s,r,n=!1,o=40){const a=this.arcCoords(t,e,i,s,0,2*Math.PI,!0,o);let h=this.toPixelCoord(r,a);return n&&(h=h.map((t=>[t[0],-t[1]]))),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof yr?qo.interpolate(e,t):e.map((e=>t.project(e)))}static coordsToPath(t){const e=[];let i=!1;for(const s of t){if(!!s.outside){i=!1;continue}const[t,r]=s;i?e.push("L",t,r):(e.push("M",t,r),i=!0)}return e}static horizontalLineToRight(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([n,t]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][0]===i||r.push([i,t]),r}static horizontalLineToLeft(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([n,t]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][0]===e||r.push([e,t]),r}static verticalLineToUp(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([t,n]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][1]===i||r.push([t,i]),r}static verticalLineToDown(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([t,n]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,i,s,r){const n=[],[o,a]=t<=i?[t,i]:[i,t],[h,l]=e<=s?[e,s]:[s,e];return r=Math.max(1,r),n.push(...this.horizontalLineToRight(h,o,a,r)),n.push(...this.verticalLineToUp(a,h,l,r)),n.push(...this.horizontalLineToLeft(l,o,a,r)),n.push(...this.verticalLineToDown(o,h,l,r)),n}static arcCoords(t,e,i,s,r,n,o,a=64){const h=2*Math.PI,l=n-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?o?-h:h:l;c||(o&&d>0&&(d-=h),!o&&d<0&&(d+=h));const _=d/a,u=[];for(let n=0;n<=a;n++){const o=r+_*n;u.push([t+Math.cos(o)*Math.abs(i),e+Math.sin(o)*Math.abs(s)])}return u}}class Qo extends Nt{renderLat(t,e,i,s,r){const n=r.second,o=n?2:1;let a="";for(let h=0;h<o;h++){const o=0===h?r:n;let l=o.project([e,t]);if(a+=ni(l)?`M${l[0]},${l[1]}`:"",o.latElliptic){let r=e+s;const n=t=>{l=o.project(t),ni(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)};for(;r<=i-s;)n([r,t]),r+=s;r<=i&&n([i,t])}else l=o.project([i,t]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLatGlobe(t,e,i,s,r){let n,o=e,a=r.project([o,t]);for(;a.outside&&o<=i;)o+=s,a=r.project([o,t]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([o,t]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e)}}renderLon(t,e,i,s,r){const n=r.second,o=n?2:1;let a="";for(let h=0;h<o;h++){const o=0===h?r:n;let l=o.project([t,e]);if(a+=ni(l)?`M${l[0]},${l[1]}`:"",o.lonElliptic){const r=t=>{l=o.project(t),ni(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)};let n=e+s;for(;n<=i-s;)r([t,n]),n+=s;n<=i&&r([t,i])}else l=o.project([t,i]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLonGlobe(t,e,i,s,r){let n,o=e,a=r.project([t,o]);for(;a.outside&&o<=i;)o+=s,a=r.project([t,o]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([t,o]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e)}}}class ta extends Bo{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new Yo(this,Qo),this._lonPool=new Yo(this,Qo)}_doInitStyles(){this.ignorePointer()}prepare(t,e){this._latPool.prepare((e.y2-e.y1)/e.latStep+1,null,(t=>{Ct.setNoScale(t.dom)})),this._lonPool.prepare((e.x2-e.x1)/e.lonStep+1,null,(t=>{Ct.setNoScale(t.dom)})),this._bounds={x1:Math.max(-180,e.x1),y1:Math.max(-90,e.y1),x2:Math.min(180,e.x2),y2:Math.min(90,e.y2),latStep:e.latStep,lonStep:e.lonStep}}_doMeasure(t,e,i,s){return Fo.create(i,s)}_doLayout(t){const e=this.model,i=e.chart,s=e.line,r=e.lonLine,n=e.latLine,o=i.getProjection();o.second;const a=o.isGlobe,h=this._bounds;let l;Ct.setImportantStyle(this.dom.style,"pointer-events","none"),Ct.setImportantStyle(this.dom.style,"fill","none");const c=h.x1,d=h.x2;let _=h.latStep;if(l=i.axis.latInterval,a)this._latPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(n._style),t.renderLatGlobe(h.y1+e*_,c,d,l,o)}));else{const t=Math.ceil(h.y1/_)*_;this._latPool.forEach(((e,i)=>{const r=t+i*_;(e.visible=r<=h.y2&&r>=h.y1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(n._style),e.renderLat(r,c,d,l,o))}))}const u=h.y1,p=h.y2;if(_=h.lonStep,l=i.axis.lonInterval,a)this._lonPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLonGlobe(h.x1+e*_,u,p,l,o)}));else{const t=Math.ceil(h.x1/_)*_;this._lonPool.forEach(((e,i)=>{const n=t+i*_;(e.visible=n<=h.x2&&n>=h.x1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(r._style),e.renderLon(n,u,p,l,o))}))}}}class ea extends At{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new At(t,"rm-axis-tick-labels")),this._labelPool=new Yo(this._labelLayer,ke)}setScale(t){this._scale=t}prepare(t,e,i){const s=e.label._style,r=e.getLonInterval(),n=e.getLatInterval(),o=this._lonStep=i.lonStep*r,a=this._latStep=i.latStep*n,h=1+((i.x2-i.x1)/o|0),l=1+((i.y2-i.y1)/a|0);let c=0;this._model=e,this._bounds=Object.assign({},i),this._topCount=this._bottomCount=this._rightCount=this._leftCount=0,e.visibleAt("top")&&(c+=this._topCount=h),e.visibleAt("bottom")&&(c+=this._bottomCount=h),e.visibleAt("right")&&(c+=this._rightCount=l),e.visibleAt("left")&&(c+=this._leftCount=l),this._labelLayer.setVisible(e.label.visible)&&this._labelPool.prepare(c,null,(t=>{t.internalResetStyleOrClass(s)}))}layout(t){if(this._model,this._labelLayer.visible){const e=0!=t.scroll?t.second:null,i=this._scale,s=this._bounds;let r,n,o,a,h,l=0,c=s.x1,d=s.y1;(n=this._labelPool.getRange(l,this._topCount)).length>0&&(r=this._lonStep,h=this._bounds.y2,n.forEach(((s,n)=>{o=e&&c>-180&&c<-180+t.scroll?e.project([c,h]):t.project([c,h]),s.text=c+"°",s.trans(o[0]*i,o[1]*-i),c+=r})),l+=this._topCount),(n=this._labelPool.getRange(l,l+this._bottomCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._bottomCount),(n=this._labelPool.getRange(l,l+this._rightCount)).length>0&&(r=this._latStep,a=this._bounds.x2,h=Math.ceil(d/r)*r,e&&(a=-180+t.scroll,t=e),n.forEach(((e,s)=>{o=t.project([a,h]),e.text=h+"°",e.trans(o[0]*i-e.bbox().width/2,o[1]*-i-e.bbox().height/2),h+=r})),l+=this._rightCount),(n=this._labelPool.getRange(l,l+this._leftCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._leftCount)}}}class ia extends Bo{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new ta(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,i,s){const r=e.grid,n=this.steps=this.$_calcSteps(r);return this._gridView.setVisible(r.visible)&&(this._gridView.prepare(r,n),this._gridView.measure(t,r,i,s)),Fo.create(i,s)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}$_calcSteps(t){const e=t.chart.map,i=t.getLonStep(),s=t.getLatStep(),{x1:r,x2:n,y1:o,y2:a}="map"===t.fitTo?this.$_calcBoundary(e,i,s):this.$_calcFullBoundary();return{x1:r,y1:o,x2:n,y2:a,latStep:s,lonStep:i}}$_calcBoundary(t,e,i){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class sa extends Ro{}class ra extends Bo{constructor(t,e){super(t),this.add(this._pathView=new Nt(t)),e.add(this._labelView=new sa(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof Ys?"rm-axis-range-guide":"rm-axis-line-guide"),{width:i,height:s}}_doLayout(t){const e=this.model,i=e.options,s=this._pathView,r=this._labelView;let n,o=this._fromView,a=this._toView;if(s.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(i.label.text),"range"===i.type){const e=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderRange(i,t,r),s.internalSetStyle("strokeWidth",`${e}px`)}else if("band"===i.type){o||(this.add(o=this._fromView=new Nt(this.doc)),this.add(a=this._toView=new Nt(this.doc))),o.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),o.internalSetStyle("fill","none"),o.internalSetStyle("transform",t.trans),a.internalSetStyle("fill","none"),a.internalSetStyle("transform",t.trans);const h=(parseFloat(getComputedStyle(o.dom).strokeWidth)||1)/t.tf.scale;o.internalSetStyle("strokeWidth",`${h}px`),a.internalSetStyle("strokeWidth",`${h}px`),n=this.$_renderBand(i,t,r),s.internalSetStyle("stroke","none")}else{const e=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderLine(i,t,r),s.internalSetStyle("fill","none"),s.internalSetStyle("strokeWidth",`${e}px`)}s.setPath(n).internalSetStyle("transform",t.trans)}$_renderLine(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a;if("lat"===t.axis){const r=t.position,o=s.h1,h=s.h2;a=Jo.horizontalLineToRight(r,o,h,n),this.$_renderLatLabel(o,r,e,i)}else{const n=t.position,h=s.v1,l=s.v2;a=Jo.verticalLineToUp(n,h,l,o),this.$_renderLonLabel(n,l,r,e.tf,i)}const h=a.map((t=>r.project(t)));return Jo.coordsToPath(h)}$_renderBand(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a=[];if("lat"===t.axis){const h=Math.min(t.from,t.to),l=Math.max(t.from,t.to),c=s.h1,d=s.h2;a.push(...Jo.horizontalLineToRight(h,c,d,n));const _=[...a];this._fromView.setPath(Jo.coordsToPath(_.map((t=>r.project(t))))),a.push(...Jo.verticalLineToUp(d,h,l,o));const u=Jo.horizontalLineToLeft(l,c,d,n);a.push(...u),this._toView.setPath(Jo.coordsToPath(u.map((t=>r.project(t))))),a.push(...Jo.verticalLineToDown(c,h,l,o)),this.$_renderLatLabel(c,l,e,i)}else{const o=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=s.v1,c=s.v2;a.push(...Jo.verticalLineToUp(o,l,c,n));const d=[...a],_=Jo.verticalLineToDown(h,l,c,n);a.push(..._),this._fromView.setPath(Jo.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(Jo.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(o,c,r,e.tf,i)}return Jo.coordsToPath(Jo.toPixelCoord(r,a))}$_renderRange(t,e,i){const{prj:s}=e;let r;const[n,o]=t.from,[a,h]=t.to;if(t.elliptic){const t=[Math.min(n,a),Math.min(o,h)],e=Math.abs(a-n),i=Math.abs(h-o);r=Jo.ellipse(t[0],t[1],e,i,s)}else r=Jo.box(n,o,a,h,s);if(i.visible){const t=Math.min(n,a),r=Math.max(o,h),l=s.project([t,r]);l.outside?i.visible=!1:i.visible||(i.visible=!0),i.trans(l[0]*e.tf.scale+e.tf.tx,l[1]*-e.tf.scale+e.tf.ty-i.bbox().height)}return r}$_renderLatLabel(t,e,i,s){if(!s.visible)return;const{prj:r,map:n,tf:o}=i;let a=0,h=0;const l=s.bbox(),c=r.project([n.h1,e]),d=r.project([t,e]);c.outside||d.outside?s.visible=!1:s.visible||(s.visible=!0),a=c[0]*o.scale+o.tx+16,h=d[1]*-o.scale+o.ty,h+=e>=0?0:-l.height,s.trans(a,h)}$_renderLonLabel(t,e,i,s,r){if(!r.visible)return;let n=0,o=0;const a=r.bbox(),h=i.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,n=l*s.scale+s.tx,o=c*-s.scale+s.ty+a.height/2,"line"===this.model.options.type?n+=t>=0?-a.width-6:6:n+=6,r.trans(n,o)}$_renderHorizontalLineToRight(t,e,i,s,r){let n="",o=e;const a=t=>{const e=s.project(t);ni(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<i-r;)a([o,t]),o+=r;return o<=i&&a([i,t]),n}$_renderHorizontalLineToLeft(t,e,i,s,r){let n="",o=i;const a=t=>{const e=s.project(t);ni(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>e+r;)a([o,t]),o-=r;return o>=e&&a([e,t]),n}$_renderVerticalLineToTop(t,e,i,s,r){let n="",o=e;const a=t=>{const e=s.project(t);ni(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<=i-r;)a([t,o]),o+=r;return o<i&&a([t,i]),n}$_renderVerticalLineToBottom(t,e,i,s,r){let n="",o=i;const a=t=>{const e=s.project(t);ni(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>=e+r;)a([t,o]),o-=r;return o>e&&a([t,e]),n}}class na extends Do{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new Ai(t,"rm-crosshair-flag-back")),this.add(this._text=new ke(t))}prepare(t){this.internalResetStyleOrClass(t.style),this._back.internalResetStyleOrClass(t.backgroundStyle)}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),i=parseFloat(e.paddingLeft)||0,s=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+i+(parseFloat(e.paddingRight)||0),r.height+s+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(i+r.width/2,s)}renderLonFlag(t,e,i,s,r,n,o){const a=e.project([s,i]),h=e.project([s,r]),l=this.prepareLabel(t);this.trans(Math.min(n-l.width,Math.max(0,o.tx+h[0]*o.scale-l.width/2)),Math.max(0,o.ty-a[1]*o.scale-l.height))}renderLatFlag(t,e,i,s,r,n){const o=e.project([i,s]),a=this.prepareLabel(t);this.trans(Math.max(0,n.tx+o[0]*n.scale-a.width),Math.max(0,Math.min(r-a.height,n.ty-o[1]*n.scale-a.height/2)))}renderGlobeLonFlag(t,e,i,s){const r=this.prepareLabel(t),n=e.rotationY<=0,o=e.project([0,n?90:-90]);this.trans(s.tx+o[0]*s.scale,Math.min(i-r.height,Math.max(0,s.ty-o[1]*s.scale-r.height/2)))}renderGlobeLatFlag(t,e,i,s,r,n,o,a){const h=e.project([i,s]),l=e.project([o,s]),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(n-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class oa extends Bo{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")),Ct.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Ct.setImportantStyle(this._latLine.dom.style,"fill","none"),Ct.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Ct.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new na(t)),this.add(this._lonFlag=new na(t)),this.ignorePointer()}prepare(t,e){this._latLine.internalClearStyles();const i=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.internalSetStyle("transform",e),this._lonLine.internalSetStyle("transform",e),this._latLine.internalSetStyle("strokeWidth",`${i}px`),this._lonLine.internalSetStyle("strokeWidth",`${i}px`),this._latFlag.prepare(this.model.flag.options),this._lonFlag.prepare(this.model.flag.options),this}render(t,e){const i=this.model,s=i.chart,r=i.chart.map,n=t[0],o=t[1],a=this._lonLine,h=this._latLine,l=this._lonFlag,c=this._latFlag,d="map"===i.axis.grid.fitTo,_=d?r.h1:-180,u=d?r.h2:180,p=d?r.v1:-90,g=d?r.v2:90;this._bounds={x1:_,x2:u,y1:p,y2:g};const m=[a,l,h,c],f=m.reduce(((t,e)=>t&&e.visible),!0);if(!(_<=n&&n<=u&&p<=o&&o<=g))return void m.forEach((t=>t.setVisible(!1)));f||m.forEach((t=>t.setVisible(!0)));const b=s.getProjection(),y=b instanceof yr?b:new b.constructor;y.offset=b.offset,this.$_renderLon(t,s.axis.lonInterval,e,y),this.$_renderLat(t,s.axis.latInterval,e,y)}$_renderLon(t,e,i,s){const r=this.model,n=r.chart.map,o=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=s instanceof yr;_?l.renderLonGlobe(h,o,a,e,s):l.renderLon(h,o,a,e,s);const u=this.calcTopY(i,n,s,o),p=r.chart.getProjection().getScrolledLon(h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,s,d.height,i):c.renderLonFlag(g,s,a,h,u,d.width,i)}$_renderLat(t,e,i,s){const r=this.model,n=r.chart.map,o=this._bounds.x1,a=this._bounds.x2,h=t[1],l=this._latLine,c=this._latFlag,d=r.getFlag(h),_=this.parent,u=s instanceof yr;u?l.renderLatGlobe(h,o,a,e,s):l.renderLat(h,o,a,e,s);const p=u?90-s.rotationX:o,g=s.project(t),m=this.calcRightX(i,s,_,n,g[1]);u?c.renderGlobeLatFlag(d,s,p,h,_.width,_.height,m,i):c.renderLatFlag(d,s,p,h,_.height,i)}calcTopY(t,e,i,s){const r=[(t.vx-t.tx)/t.scale,(t.vy-t.ty)/-t.scale];let n=[NaN,NaN];const o=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=i.backward(r);if(!Number.isNaN(t[1])){n=t;break}r[0]+=o}return Number.isNaN(n[1])?s:n[1]}calcRightX(t,e,i,s,r){const n=[(i.width-t.vx-t.tx)/t.scale,r];let o=e.backward(n);return Number.isNaN(o[0])?s.x2:o[0]}}const aa="rm_map_globe_fill";class ha extends Nt{constructor(t){super(t,"rm-map-background")}render(t,e,i,s,r,n){const o=e.map,a=this.parent,h=e.body.projection;o||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,n,i,s);else if(h.lonElliptic||h.latElliptic){const t=e.body.projection.getClipBounds(e.axis.lonInterval,e.axis.latInterval);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=di.rectangle(i,s,r,n);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof yr)){const{tx:t,ty:e,scale:i}=a.transformInfo;this.transEx(t,e).scale(i)}}$_renderGlobeBg(t,e,i,s,r,n,o){const a=e.options.globeFill,h=Math.max(s,r)/2;let l=!this.control.hasDef(aa);return i=di.circle(n+h,o+h,h),a!==this._globeFill&&(this.control.removeDef(aa),l=!0),l&&a&&this.$_applyGlobeBgDef(t,a),a&&this.setFill(`url(#${aa})`),this.internalSetStyleOrClass(e._style),i}$_applyGlobeBgDef(t,e){const i={id:aa,cx:"0.4",cy:"0.4",r:"1",color:["white",e]};this.control.addDef(new Yt(i).getElement(t,i)),this._globeFill=e}}class la extends Nt{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){nt.isNum(t)?this.setPath(di.line(t,e,i,s)):t&&this.setPath(di.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(di.line(t,e,t,i))}setVLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(di.line(t,e,t,i))}setHLine(t,e,i){this.setPath(di.line(e,t,i,t))}setHLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(di.line(e,t,i,t))}}class ca extends Nt{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){nt.isNum(t[0])?this.setPath(di.lines(...t)):s(t[0])?this.setPath(di.lines3(...t)):this.setPath(di.lines2(...t))}}var da;class _a extends Yo{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class ua extends Ro{constructor(t){super(t,"rm-point-label")}}class pa extends At{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new Yo(this,ua),new Yo(this,ua)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}$_prepareLabel(t,e,i,s,r,n){const o=r.getPointText(s,i,n.options.text);e.point=s,e.setModel(t,n,null,null),e._text.internalResetStyleOrClass(n._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(s)),o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s))):(e.setText(n.getText(n.getValue(s,i))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const i=e.model,s=i.getPointLabels(),r=i.pointLabelCount(),n=this._labels,o=i.getLabeledPoints(),a=this._maps,h=s[0]._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,i,s[h]),a[h][r.pid]=l)}})),this.internalSetStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){const i=this._maps[e];return i&&i[t.pid]}removePoint(t,e){for(let i=0;i<2;i++){const s=this.get(t,i);if(s)return void this._labels[i].removeLater(s,e)}}}class ga extends Do{constructor(t){super(t),this.add(this._line=new ca(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Nt(t)),this._dummy.internalSetStyle("visibility","hidden"),this.add(this._anchor=new Nt(t,"rm-callout-anchor"))}render(t,e,i,s){const r=t.options,n=t.series,o=this._anchor,a=this._line;if(this._dummy.setPath(di.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),o.setVisible(t.anchorPoint.visible)){const s=xa.getDrawer(t.series.getCalloutShape(e)),a=t.anchorPoint.options.radius;o.internalClearStyleAndClass(),r.useSeriesColor&&o.internalSetStyleOrClass(n._style),o.internalSetStyleOrClass(t.anchorPoint._style),o.setPath(s(a,a)),o.trans(i[0],i[1])}return a.internalClearStyleAndClass(),r.useSeriesColor&&this._line.internalSetStyleOrClass(n._style),a.internalSetStyleOrClass(t._style),a.setLines(i,!1),s&&r.usePointColor&&(o.visible&&o.setFill(s),a.setStroke(s)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class ma extends Tt{constructor(t){super(t),this.add(this._back=new Ai(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Nt(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(di.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(di.rect(t).concat(di.rect(e))):this._mask.setPath(di.rect(t)),this}}class fa extends At{constructor(t,e){super(t,e),this._callouts=new Yo(this,ga),this._map={},this.add(this._maskLayer=new At(t)),this._masks=new Yo(this._maskLayer,ma),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,i=t.callout,s=this._callouts,r=this._masks,n=t.getLabeledPoints(),o=i._style,a=this._map={};r.prepare(n.length,(t=>{})),s.prepare(n.length),n.forEach(((t,i)=>{const n=s.get(i);n.setVisible(e.isPointCalloutVisible(t))&&(n.setAttr("mask",`url(#${r.get(i).id}`),n.index=i,a[t.pid]=n)})),this.internalSetStyleOrClass(o)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){return this._map[t.pid]}setMask(t,e){const i={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},s=this._masks.get(t.index);return s.setBackground(i),s}}class ba extends Et{constructor(t,e=!1){super(t,xa.POINT_CLASS,e),this._static=!0}tooltipColor(){return this.getFill()}setVisible(t){const e=super.setVisible(t);if(!e&&this.point){xa.seriesOf(this).setPointLabelVisible(this.point,!1)}return e}_drawSpline(t,e,i,s){let r=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void s.line(t[r+1].x,t[r+1].y);const n=.35,o={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!=i;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}),o.x=-c.x*_*n,o.y=-c.y*_*n;const i=u+a.x,g=p+a.y,m=t[r].x+o.x,f=t[r].y+o.y;s.curve(i,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*n,a.y=c.y*_*n,u=t[r].x,p=t[r].y}s.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}_checkStatic(){return this._static=this.point._isStatic()}_clearScale(t){t.internalSetStyles({transformOrigin:"",transformBox:"",transform:""})}_aniScale(t,e){this._checkStatic()&&1===e?this._clearScale(t):t.internalSetStyles({transformOrigin:"center",transformBox:"fill-box",transform:`scale(${this._static?e:this.point._vr})`})}}class ya extends At{}const wa={};class xa extends Bo{static register(...t){t.forEach((t=>{wa[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof da)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>di[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,i,s){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,i,s)=>({x:t-i/2,y:e-s}),bottom:(t,e,i,s)=>({x:t-i/2,y:e}),center:(t,e,i,s)=>({x:t-i/2,y:e-s/2}),left:(t,e,i,s)=>({x:t-i,y:e-s/2}),right:(t,e,i,s)=>({x:t,y:e-s/2})},this._labelPositioner={bottom:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e+=r+n}),top:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=r+n+i.height}),right:(t,e,i,s,r,n)=>({x:t+=s+n,y:e-=i.height/2}),left:(t,e,i,s,r,n)=>({x:t-=s+n+i.width,y:e-=i.height/2}),center:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=i.height/2+n})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverPts=[],this._inRegion=!1,s&&this.addDom(this._defs=Mt.createElement(t,"defs")),this.add(this._pointLayer=new At(t)),this._pointLayer.add(this._pointContainer=new ya(t,"rm-series-points")),this.add(this._calloutContainer=new fa(t,"rm-series-callouts")),i&&(this._labelContainer=this._createLabelContainer(t,e))}$_setInRegion(){return this._inRegion=!0,this}needClip(){return!1}secondLabelContainer(){}_setCalcedColor(t,e){const i=getComputedStyle(e);t.setCalcedColor(i,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepareModel(t,e,i){const s=this._dirty=e._optionsDirty||e._dataSourceDirty||e._dataDirty||e._zindexDirty,r=this._labelContainer,n=this._calloutContainer;this._scroll=i,this.setModel(e),this.internalSetStyle("pointerEvents",e.options.disabled?"none":""),e instanceof Yn?this.setData("index",e._seriesIndex%10):this.setData("index",e._seriesIndex%12),null==r||r.setVisible(e.isPointLabelsVisible()),n.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._dataDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),r&&r.visible&&r.prepare(t,this),n.visible&&n.prepare(t,this)):(r&&r.visible&&(null==r?void 0:r.isEmpty())&&r.prepare(t,this),n.visible&&n.isEmpty()&&n.prepare(t,this)),isNaN(this._aniOpacity)||this.internalSetStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,i=e._optionsDirty||e._dataSourceDirty||e._dataDirty;i&&this._doPrepeare(t,e,i)}render(t,e,i){const s=this.model;this._wBody=t,this._hBody=e,this._transInfo=i,this._doRender(this.width,this.height),s instanceof Yn||s.isEmpty(!0)||!this.chart().animatable()||this._runShowEffect(s&&(!this.control.loaded&&this.chart().loadAnimatable()||s._dataLoaded)&&!s.isEmpty(!0)),s._dataLoaded=!1}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,e,i,s){var r;return null===(r=this._getPointPool())||void 0===r?void 0:r.elementOf(t)}pointerMoved(t,e,i){return this._doPointerMoved(t,e,i)}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,e){return this._getPointPool().elementOf(t)}click(t,e){const i=this.pointByDom(t,e);i&&(i.point?!0!==this.model.pointClicked(i.point)&&this._doPointClicked(i):this._doPointClicked(i))}select(t,e,i){const s=this.pointByDom(t,e);s&&this.chart().selection.add(this.model,s.point,i)}toggleSelect(t,e){const i=this.pointByDom(t,e);i&&this.chart().selection.toggle(this.model,i.point)}runPointAddAnimation(t){}setPointLabelVisible(t,e){const i=this._labelViews();if(!i)return;const s=i.get(t,0);s&&s.setVisible(e)}get growRate(){return this._growRate}_createLabelContainer(t,e){return new pa(t,e)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_addDef(t,e){const i=this.hash+e;return t.id=i,this._defs.append(t),t}_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,i){if(t.setAttrEx("aria-label",i.ariaHint()),t.internalClearStyleAndClass(),i._runColor)this._setPointColor(t,i._runColor);else{const s=e.getRangedColor(i);s&&this._setPointColor(t,s)}const s=e.getPointStyle(i);s&&t.internalSetStyleOrClass(s)}_doPointerMoved(t,e,i){return!1}_getGrowRate(){return g(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&&nt.log("CLICKED: ",t.point.name,t.point.getValue())}}da=xa,xa.POINT_CLASS="rm-point",xa.DATA_HOVER="hover",xa.DATA_UNHOVER="unhover",xa.LEGEND_MARKER="rm-legend-item-marker",xa._drawers=Object.assign({circle:t=>di.circle(0,0,t)},da._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class va extends ba{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class Sa extends xa{constructor(t,e,i,s){super(t,e,i,s),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}}class Ca extends ba{prepare(t,e){return this.point=t,this._ext=nt.getMinMax(t.values),this._checkStatic(),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class La extends xa{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.options.minSize}}}class ka extends Ca{constructor(t){super(t,!0),this.add(this._contentLayer=new At(t)),this.add(this._baseLine=new la(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class Ma extends La{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,g(t._minValue,i.min)),i.max=Math.max(i.max,g(t._maxValue,i.max))),i}_doPrepeare(t,e,i){!this._ext||i?this._ext={inverted:!1,...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height,pad:0}:(this._ext.width=e._width,this._ext.height=e._height);const s=e.options.inverted;let r=s?e._height:e._width;const n=e.getPadding(r);this._ext.inverted=s,this._ext.pad=n,this._ext[s?"height":"width"]=r-2*n}}class Aa extends ba{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class Pa extends xa{constructor(t,e,i,s){super(t,e,i,s),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class Ia extends Ko{constructor(t){super(t,Ia.CLASS_NAME),this.add(this._imageView=new Po(t)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(r.width,r.height),ht(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}Ia.CLASS_NAME="rm-image-annotation";class Na extends Ko{constructor(t){super(t,Na.CLASS_NAME),this.add(this._shapeView=new Nt(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),di.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)}}Na.CLASS_NAME="rm-shape-annotation";class Ea extends Ko{constructor(t){super(t,Ea.CLASS_NAME),this.add(this._textView=new ke(t)),this._textView.anchor=Se.START,this._richText=new De}_doMeasure(t,e,i,s){const r=e.options,n=e.getSize(i,s),o=this._textView;r.writingMode&&this._textView.setStyle("writingMode",r.writingMode),r.textOrientation&&this._textView.setStyle("textOrientation",r.textOrientation),this._deflatePaddings(n),this._richText.setFormat(r.text),this._richText.build(o,i,s,null,e._domain);const a=ht(this._textView.bbox());return{width:g(n.width,a.width),height:g(n.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)}}Ea.CLASS_NAME="rm-text-annotation";class Ta{static reveal(t,e){new Da(t,e)}static grow(t,e){new $a(t,e)}static spread(t,e){new Oa(t,e)}static fadeIn(t){new Va(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);window.Animation&&i instanceof Animation&&(i.addEventListener("finish",(()=>{t._animationFinished(i)})),t._animationStarted(i))}}class Va extends Ta{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:_t.DURATION,fill:"none"})}}class Da extends Ta{constructor(t,e){super(t,e)}_createAnimation(t,e){const i=this.$_clipRect(t);let s;switch(e&&e.from){case"top":s=this.$_top(t,i,e);break;case"bottom":s=this.$_bottom(t,i,e);break;case"right":s=this.$_right(t,i,e);break;default:s=this.$_left(t,i,e)}return null==s||s.addEventListener("finish",(()=>{i.dom.remove()})),s}$_aniOptions(t){return{duration:_t.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,i){return e.dom.firstElementChild.animate([{width:"0"},{width:D(t.width)}],this.$_aniOptions(i))}$_right(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(i))}$_top(t,e,i){return e.dom.firstElementChild.animate([{height:"0"},{height:D(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class Ra extends _t{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof Mt}_stop(){super._stop(),this._series=null}}class $a extends Ra{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Oa extends Ra{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Fa extends Nt{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,n){this.x=t,this.setPath(di.bar(t-i/2,e,i,-s,r,n))}}class Ba extends ka{constructor(t){super(t),this._bars=new Yo(this._contentLayer,Fa)}setReversed(t){return this._bars.reversed=t,this}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}render(t,e,i,s,r,n,o){const a=t._categories||[],h=t.getFieldColors(),{min:l,max:c}=t.getPointExtents(i,e),d=i.length,_=r/d,u=_*s.barWidth,p=s.barWidth>1&&!s.overflow,g=s.pad;this._bars.forEach(((t,e)=>{const s=i[e];if(t.setVisible(!isNaN(s))){const i=(s-l)/(c-l)*n*o;let d=g+_*e+(_-u)/2;p&&(d+u>g+r&&(d=g+r-u),d=Math.max(d,g)),t.setPath(di.bar(d,n,u,-i,0,0)),t.internalClearStyleAndClass(),a[e]&&a[e].color?t.setFill(a[e].color):h&&t.setFill(h[e%h.length])}})),this._renderBaseLine(t.baseLine,!1,this.width,this.height)}}class za extends va{tooltipColor(){return getComputedStyle(this.dom).fill}}class ja extends Nt{static create(t,e,i,s,r,n,o,a,h=!0){return new ja(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",i,s,r,n,o,a,h,l=!0){return new ja(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=C,i=C){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,i&&this._assignShape(i,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return di.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 di.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 Ga=function(t){return isNaN(t)?0:t};class Ha{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 o(t)?this._path.push("M",Ga(t),Ga(e)):this._path.push("M",Ga(t.x),Ga(t.y)),this}moveBy(t,e){return o(t)?this._path.push("m",Ga(t),Ga(e)):this._path.push("m",Ga(t.x),Ga(t.y)),this}movep(t,e){return o(t)?this._path.push("M",R(t),R(e)):this._path.push("M",R(t.x),R(t.y)),this}line(t,e){return o(t)?this._path.push("L",Ga(t),Ga(e)):this._path.push("L",Ga(t.x),Ga(t.y)),this}linep(t,e){return o(t)?this._path.push("L",R(t),R(e)):this._path.push("L",R(t.x),R(t.y)),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Ga(t[e]),Ga(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Ga(t[e].x),Ga(t[e].y));return this}polygon(...t){return this.lines(...t),this._path.push("Z"),this}circle(t,e,i){return this._path.push(`M ${t-i}, ${e} a ${i},${i} 0 1,0 ${2*i},0 a ${i},${i} 0 1,0 ${2*-i},0`),this}}class Wa extends Nt{render(t,e){const i=t.getExtents(e);if(i.radius!==this._radius||i.length!==this._length||i.offset!==this._offset){const t=this._radius=i.radius,e=this._offset=i.offset;if(this._length=i.length,this._radius>0&&this._length>0){const i=new Ha;i.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(i.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let Ya=class extends Nt{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new Ha).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class Za extends Aa{constructor(t){super(t),this.add(this._faceView=new ja(t,"rm-circle-gauge-face")),this.add(this._rimView=new ja(t,"rm-circle-gauge-rim")),this.add(this._valueView=new ja(t,"rm-circle-gauge-value")),this.add(this._textView=new ke(t,"rm-circle-gauge-text")),this.add(this._handContainer=new At(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 Wa(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 Ya(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible&&this.point._isStatic())&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,i,s){const r=t._props.getCenter(e,i),n=this._size=d(e,i),o=t._props.getExtents(n*this.point._aniRate());this.$_renderBackground(t,r,o),this.$_renderValue(t,r,o,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,n=t._props,o=n._startRad;s.visible&&(s.internalResetStyleOrClass(t.face._style),s.setSector({cx:e.x,cy:e.y,rx:i.radius-i.radiusThick,ry:i.radius-i.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:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:o,angle:n._sweepRad,clockwise:t.options.clockwise}));let a=i.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,i,s,r){const n=t.options,o=t._props,a=s.getValue(),h=t.getValueRate(a)*r,l=t.valueRim.getThickness(i.radiusThick),c=this._textView;if(this._valueView.visible){const s=t.valueRim,r=s.options,a=i.value+(r.stroked?0:l/2),c=this._valueView;c.internalResetStyleOrClass(s._style),r.stroked&&(c.setFill("none"),c.internalSetStyle("strokeWidth",D(l))),c.setBoolData("stroked",r.stroked),c.setSectorEx({cx:e.x,cy:e.y,rx:a,ry:a,innerRadius:(a-l)/a,start:o._startRad,angle:o._sweepRad*h,clockwise:n.clockwise},r.stroked)}if(c.visible){const i=t.gaugeLabel;c.text=i.getNumberText(a,!1,!1,void 0),i.buildSvg(c,null,NaN,NaN,t,i._domain);const s=c.bbox(),r=i.getOffset(this.width,this.height);c.trans(e.x+r.x,e.y-s.height/2+r.y)}}}class Ua extends Mt{constructor(t,e,i,s,r){super(t,e,"circle"),"number"==typeof i&&this.setCircle(i,s,r)}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class Xa extends _t{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 Ka extends Aa{constructor(t){super(t),this._rimThick=0,this._secRate=1,this.add(this._faceView=new Ua(t,"rm-clock-gauge-face")),this.add(this._rimView=new ja(t,"rm-clock-gauge-rim")),this.add(this._labelView=new ke(t,"rm-clock-gauge-label")),this._labelView.layout=Ce.MIDDLE,this.add(this._tickContainer=new At(t,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new At(t,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Nt(t,"rm-clock-gauge-hour")),this.add(this._minuteView=new Nt(t,"rm-clock-gauge-minute")),this.add(this._secondView=new Nt(t,"rm-clock-gauge-second")),this.add(this._pinView=new Ua(t,"rm-clock-gauge-pin")),this._tickViews=new Yo(this._tickContainer,la,"rm-clock-gauge-tick"),this._tickLabelViews=new Yo(this._tickLabelContainer,ke,"rm-clock-gauge-tick-label")}prepare(t,e){const i=Math.round(12/_(1,Math.floor(e.tickLabel.options.step)||1));this._tickViews.prepare(e.tick.visible?12:0),this._tickLabelViews.prepare(e.tickLabel.visible?i:0,(t=>{t.layout=Ce.MIDDLE})),this._zoneCallback=e.options.timezoneCallback}render(t,e,i){const s=this.point,r=this._exts=t.getExtents(e,i,s._aniRate());this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.options.active&&isNaN(+s.time)?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),u(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 i=this._labelView,s=this._faceView,r=this._rimView,n=this._tickLabelViews,o=this._pinView,{cx:a,cy:h,rd:d}=e,_=this._rimThick=r.visible?t.rim.getThickness(d):0,u=t.tick.options.length||0;s.setVisible(t.face.visible)&&(s.internalResetStyleOrClass(t.face._style),s.setCircle(a,h,d)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:d,ry:d,innerRadius:1-_/d,start:0,angle:2*Math.PI,clockwise:!0}));const p=d-_;let g=p-u,m=A,f=M/12;if(this._tickViews.forEach(((e,i)=>{e.setLine(a+l(m)*p,h+c(m)*p,a+l(m)*g,h+c(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!n.isEmpty){const e=12/n.count,i=M/12*e;m=A,n.get(0).text="12",g=p-(u+t.tickLabel.options.offset||0),g-=.5*n.get(0).bbox().height,n.forEach(((s,r,n)=>{s.text=String(0===r?12:r*e),s.trans(a+l(m)*g,h+c(m)*g),s.internalResetStyleOrClass(t.tickLabel._style),m+=i}))}o.setVisible(t.pin.visible)&&(o.setCircle(a,h,t.pin.options.radius||2),o.internalResetStyleOrClass(t.pin._style)),i.setVisible(t.gaugeLabel.visible)&&(i.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(i,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.options.position?i.trans(a,h+g/2):i.trans(a,h-g/2))}$_getNow(t){var e;let i=t.getTime();if(!i){i=new Date;const s=m(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=i.getMinutes()+i.getTimezoneOffset()+s;i.setMinutes(r)}return i}$_renderHands(t,e){const i=this.$_getNow(this.point),s=i.getHours(),r=i.getMinutes(),n=i.getSeconds(),o=s>=12,{cx:a,cy:h,rd:l}=e,c=new Ha;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=M*(s/12+r/60/12+n/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*I)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=M*(r/60+n/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*I)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?M*(this._aniSec+this._secRate)/60:M*n/60,u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*I),this._prevSec=n)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const i=new Xa(this,t);i.duration=t.secondHand.options.duration||200,i.start()}}}class qa extends ba{constructor(t){super(t,!0),this.add(this._back=new At(t)),this._back.add(this._figure=new It(t)),this._back.add(this._textView=new Ro(t,"rm-figure-series-inner-label"))}prepare(t,e,i,s){const r=this._textView,n=s.options.text;this._clearScale(this._back),this._figure.setId(e.id).resize(e.width,e.height),i?(this._image||this._back.insertDom(this._image=Mt.createElement(t,"use"),this._textView.dom),Ct.setAttr(this._image,"href",i.id)):this._image&&(this._image.remove(),this._image=null),r.setVisible(!!n)&&(r.internalResetStyleOrClass(s._style),r.setModel(t,s,null,null),s.prepareRich(n),s.buildSvg(r._text,r._outline,NaN,NaN,s,s.getTextDomain(this.point)),r.layout())}render(t){const e=this._image,i=this._textView,s=this._rBox=this._figure.bbox();if(this._aniScale(this._back,t),e){const t=e.getBBox();let i,r,n,o;t.width>s.width?(i=(t.width-s.width)/2,s.width=t.width):n=(s.width-t.width)/2,t.height>s.height?(r=(t.height-s.height)/2,s.height=t.height):o=(s.height-t.height)/2,Ct.setAttrs(this._figure.dom,{x:i,y:r}),Ct.setAttrs(e,{x:n,y:o})}if(i.visible){const t=i.bbox(),e=Ct.getPadding(i._text.dom),r=s.width-e.left-e.right,n=s.height-e.top-e.bottom;i.trans(e.left+(r-t.width)/2,(n-t.height)/2+e.top)}}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class Ja extends ba{constructor(t){super(t,!0),this.add(this._imageView=new Po(t))}setImage(t,e,i){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(i)||(this._imageView.height=i)}render(t){this._aniScale(this._imageView,t),this._rBox=this._imageView.bbox()}}class Qa{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),i=this.$_left(t,e);return null==i||i.addEventListener("finish",(()=>{e.dom.remove()})),i}$_aniOptions(){return{duration:_t.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:D(t.width)}],this.$_aniOptions())}}let th=class extends ka{constructor(t){super(t),this._contentLayer.addAll(this._back=new Ai(t),this._area=new Nt(t,"rm-line-series-area"),this._line=new Nt(t,"rm-line-series-line"),this._lowLine=new Nt(t))}render(t,e,i,s,r,n){const{min:o,max:a,base:h}=t.getPointExtents(i,e),l=this.$_getPts(i,o,a,s,r,n),c=i.length,d=c>2&&t.options.curved,_=new Ha;if(this.resize(s,r),this._back.setVisible(!1)&&(this._back.resize(s,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,s,r)}$_getPts(t,e,i,s,r,n){const o=t.length,a=[];let h=.05*s,l=.1*r;const c=i-e;s-=.1*s,r-=.2*r;for(let i=0;i<o;i++){const d=t[i],_=h+i/(o-1)*s,u=l+(isNaN(d)||0==c?r:(1-(d*n-e)/c)*r);a.push({x:_,y:u})}return a}};const eh="rm-map-series-id-";class ih extends ba{static idClass(t){return eh+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(eh))return e.substring(17)}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,i,s,r,n){var o;const a=this.point;if(r){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.internalSetStyleOrClass(e);else{const e=!this.point||a.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(ih.idClass(this.model))}a&&(a.isSelected()&&!this.hasSavedStyles()?(this.saveStyles(),this.internalSetStyles({strokeWidth:"var(--map-series-selected-stroke-width)",filter:"var(--map-series-selected-filter)"}),this.internalSetStyleOrClass(i),this.strokeView||(this.strokeView=new sh(this.doc,s)),this.strokeView.render(this,i),this.strokeView.attachToOwner()):a.isSelected()||!this.hasSavedStyles()||n||(this.internalClearStyleAndClass(),this.restoreStyles(),null===(o=this.strokeView)||void 0===o||o.detachFromOwner()))}reset(){this.model=null}}class sh extends Nt{constructor(t,e){super(t,"rm-map-series-hover"),this._owner=e}render(t,e){this._area=t;const i=t.dom,s=e&&"string"==typeof e;this.copyPath(),s?this.internalSetStyleOrClass(e):this.internalSetStyles({stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,filter:i.style.filter}),t.internalSetStyles({stroke:"none",strokeWidth:"0"})}refresh(){this._area&&this.copyPath()}attachToOwner(){this._owner.add(this)}detachFromOwner(){this._owner.removeChild(this)}_doInitStyles(){super._doInitStyles(),this.setClass("rm-point"),this.setAttr("vector-effect","non-scaling-stroke"),this.setBoolData("virtual",!0),this.ignorePointer()}copyPath(){this.setPath(this._area.path())}}class rh extends Nt{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class nh extends Nt{constructor(t){super(t,"rm-map-series-border")}setModel(t){t!==this.model&&(this.model=t,this.setPath(t.getPath()))}reset(){this.model=null}}class oh extends Nt{constructor(t){super(t,"rm-map-series-inset")}get center(){if(!this._center){const t=this._pts;let e=t[0][0],i=t[0][1],s=e,r=i;for(let n=1;n<t.length;n++)e=d(e,t[n][0]),s=_(s,t[n][0]),i=d(i,t[n][1]),r=_(r,t[n][1]);this._center=[e+(s-e)/2,i+(r-i)/2]}return this._center}render(t,e){const i=this.model;if((this.model=t)!==i){let i;if(t.box){const s=this._pts=t.box.map((t=>e.project(t)));i=`M${s[0][0]} ${s[0][1]} L${s[1][0]} ${s[1][1]} ${s[2][0]} ${s[2][1]} ${s[3][0]} ${s[3][1]} Z`}else if(t.pts){const s=t.pts,r=s.length;let n=e.project([s[0],s[1]]);this._pts=[n],i=`M${n[0]} ${n[1]}`;for(let t=2;t<r;t+=2)n=e.project([s[t],s[t+1]]),i+=` L${n[0]} ${n[1]}`,this._pts.push(n);"z"===s[r-1]&&(i+=" z")}i&&this.setPath(i),this._center=void 0}}}class ah extends Ro{constructor(t){super(t,"rm-point-label rm-point-inset")}}class hh extends At{constructor(t){super(t,"rm-point-labels rm-map-inset"),this._labels=[new Yo(this,ah),new Yo(this,ah)],this._maps=[new Map,new Map],this.ignorePointer()}get(t,e){const i=this._maps[e];return i&&i.get(t)}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}prepare(t,e){const i=e.model,s=i.insetLabel,r=i.map._insets;if(this.visible&&r&&r.length>0){const e=i.getPointLabels(),n=i.pointLabelCount(),o=this._labels,a=this._maps;o[0].prepare(r.length),a[0].clear(),o[1].prepare(n>1?r.length:0),a[1].clear(),r.forEach(((i,r)=>{for(let h=0;h<n;h++){const n=o[h].get(r);n.setVisible(!0)&&(this.$_prepareInsetLabel(t,n,e[h],s,i),a[h].set(i,n))}}))}else this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareInsetLabel(t,e,i,s,r){const n=s.getInsetText(r);e.setModel(t,s,null,null),e._text.internalResetStyleOrClass(i._style),e._text.internalResetStyleOrClass(s._style),e._text.internalSetStyleOrClass(s.getInsetLabelStyle(r)),n?(i.prepareRich(n),i.buildSvg(e._text,e._outline,NaN,NaN,i,null)):(e.setText(r.name),delete e._text._lineCount)}}class lh extends xa{constructor(t){super(t,"rm-map-series",!0,!1),this._areas={},this._insetLabelContainer=new hh(t),this._areaPool=new _a(this._pointContainer,ih),this._insetPool=new Yo(this._pointContainer,oh),this._hoverStrokeView=new sh(t,this._pointContainer)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e;let i=t;const s=this._hoverArea;if(i&&(null===(e=i.model)||void 0===e?void 0:e.selected)&&(i=null),i!==s){const t=this.model;if(s){s.internalClearStyleAndClass(),s.restoreStyles();const t=this.getPointLabel(s);t&&t._text.restoreStyles(),this._hoverStrokeView.detachFromOwner()}if(!i||i.point||t.options.nullHovering||(i=void 0),this._hoverArea=i,i){const t=this.getPointLabel(i);i.saveStyles(),null==t||t._text.saveStyles(),this.setHoverStyle(i,t),this._hoverStrokeView.render(i,this.model.options.hoverStyle),this._hoverStrokeView.attachToOwner()}i!=s&&t.chart._hoverAreaChanged(t,null==i?void 0:i.model,null==s?void 0:s.model)}}get insets(){return this._insets}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=ih.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}needClip(){return!0}secondLabelContainer(){return this._insetLabelContainer}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}prepareModel(t,e,i){super.prepareModel(t,e,i);const s=this._insetLabelContainer;s.setVisible(!0===e.insetLabel.visible||null==e.insetLabel.visible&&e.isPointLabelsVisible()),this._dirty?s.visible&&s.prepare(t,this):s.visible&&!s.isEmpty&&s.prepare(t,this)}_doPrepeare(t,e,i){const s=e.map,r=e.internalBorder._style,n=e.externalBorder._style,o=e.getMapBorders(),a=e.options.bringToFront?[]:null;this._insets=s._insets,s.hasInternals&&e.internalBorder.visible?(this._internalContainer||(this._pointLayer.add(this._internalContainer=new At(t,"rm-map-series-internals")),this._internalPool=new Yo(this._internalContainer,rh)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),s.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new At(t,"rm-map-series-externals")),this._externalPool=new Yo(this._externalContainer,rh)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),s.hasBorders&&o.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new At(t,"rm-map-series-borders")),this._borderPool=new Yo(this._borderContainer,nh))),this._areaPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i),r=t.point=e.pointOf(s);t.setModel(s),r?(s.dummy||this._setPointStyle(t,e,r),a&&a.push(t)):t.internalClearStyleAndClass(),Ct.setNoScale(t.dom)})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"internal"),Ct.setNoScale(t.dom),t.internalSetStyleOrClass(r)}),(t=>{t.setClass("rm-map-series-internal")})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"external"),Ct.setNoScale(t.dom),t.internalSetStyleOrClass(n)}),(t=>{t.setClass("rm-map-series-external")})),this._borderContainer&&this._borderContainer.visible&&this._borderPool.prepare(o.length,((t,e)=>{const i=o[e];t.setModel(i),Ct.setNoScale(t.dom),t.internalSetStyleOrClass(i._style)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let i,s;return(i=t.point)?(s=e.point)?isNaN(i._zindex)?isNaN(s._zindex)?0:-1:isNaN(s._zindex)?1:i._zindex-s._zindex:1:e.point?-1:0})),a&&a.length!==e.areaCount&&a.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(this._insets.length,((t,e)=>{Ct.setNoScale(t.dom)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()})),this._internalPool&&this._internalPool.forEach((t=>{t.visible&&t.reset()})),this._externalPool&&this._externalPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,i){const s=this.areaOfDom(i);return this.hoverArea=s,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}onScrollStart(){super.onScrollStart(),this.hoverArea=null}onScrollEnd(){super.onScrollEnd(),this._hoverStrokeView.refresh()}$_layoutAreas(t,e){const i=this.chart(),s=i.isDirty,r=i.body,n=this.model,o=n.map,a=n.options,h=i.getProjection(),l=this._areas={},c=this._insets,d=a.allAreas,_=this._labelViews(),u=this._insetLabelContainer.visible?this._insetLabelContainer:null,p=n.insetLabel,g=a.nullStyle,m=a.dummyStyle,f=a.selectedStyle,b=this._scale,y=this._areaPool;y.forEach(((t,e)=>{const i=t.model;if(i){const e=t.point,o=_&&e&&_.get(e,0);if(l[i.id]=t,t.setVisible(i.visible&&(d||!!e)&&!n.isHiddenArea(i.id))){const a=this.hoverArea===t;if(i.selected&&a&&(this.hoverArea=null),t.render(g,m,f,this._pointContainer,s,a),o){const i=r.toVisible(n.getCenter(e));if(o.setVisible(!!i)){s&&this._layoutLabel(o,t.dom);const r=o.bbox();let[n,a]=i;e.xPos=n,e.yPos=a,n*=b,a*=-b,n-=r.width/2,a-=r.height/2,o.trans(n,a)}}}else o&&o.setVisible(!1)}})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.forEach(((t,e)=>{t.setVisible(y.get(e).visible)})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.forEach(((t,e)=>{t.setVisible(y.get(e).visible)})),this._insetPool.forEach(((t,e)=>{const i=c[e];if(t.setVisible(!1!==i.visible)){const e=l[i.area],a=u&&!p.hideInsetLabel(i)&&u.get(i,0);let c;if(e){if(t.setVisible(e.visible)){if(_&&(c=_.get(e.point,0),c&&n.isPointLabelVisible(e.point))){const t=n.getCenter(e.point).slice();t[0]+=i.off[0],t[1]+=i.off[1];const s=r.toVisible(t),o=c.bbox();if(c.setVisible(!!s)){let[t,e]=s;t*=b,e*=-b,t-=o.width/2,e-=o.height/2,c.trans(t,e)}}t.render(i,h)}}else{const e=i._base;if(e)if(e[0]instanceof Lr){for(const t of e){if(!t.visible||n.isHiddenArea(t.id))return;if(_){const e=l[t.id];if(c=e&&_.get(e.point,0),c&&c.visible){const t=n.getCenter(e.point).slice(),i=e.model.inset.off;t[0]+=i[0],t[1]+=i[1];const s=r.toVisible(t),o=c.bbox();if(c.setVisible(!!s)){let[t,e]=s;t*=b,e*=-b,t-=o.width/2,e-=o.height/2,c.trans(t,e)}}}}t.render(i,h)}else if(e[0]>=0){const e=o.areaOf(i._parent);e&&e.visible&&!n.isHiddenArea(e.id)&&t.render(i,h)}}if(a&&a.setVisible(!c)){s&&a.layout();const e=t.center,i=a.bbox();let[r,n]=e;r*=b,n*=-b,r-=i.width/2,n-=i.height/2,a.trans(r,n)}}}))}getPointLabel(t){return t&&t.point?this._labelContainer.get(t.point,0):null}setHoverStyle(t,e){const{hoverColor:i}=this.model.options,s=this.model.options.hoverStyle;t.internalSetStyles({filter:lh.DefaultHoverFilter,strokeWidth:lh.DefaultHoverStrokeWidth}),t.internalSetStyleOrClass(s),i&&t.internalSetStyle("fill",i);const r=this.model.pointLabel.options.hoverStyle;null==e||e._text.internalSetStyle("fill",lh.DefaultLabelHoverFill),r&&(null==e||e._text.internalSetStyleOrClass(r))}}lh.DefaultHoverFilter="var(--map-series-hover-filter)",lh.DefaultHoverStrokeWidth="var(--map-series-hover-stroke-width)",lh.DefaultLabelHoverFill="var(--map-series-hover-label-fill)";class ch extends Bo{constructor(t,e,i){super(t,e),this._paddings=new mt,this.add(this._background=new Nt(t,i)),this.add(this._textView=new ke(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const n=e.options.text;n?(e.prepareRich(n),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.options.backgroundStyle;r(a)&&(a=a(e.series.getPointArgs(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,i,s);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(t){const e=this._textView,i=this.width;let s=0;this._renderBackgrouond(this._background,i,this.height,t);switch(getComputedStyle(e.dom).textAlign){case"center":s+=i/2,e.anchor=Se.MIDDLE;break;case"right":s+=i,e.anchor=Se.END;break;default:e.anchor=Se.START}e.trans(s,this._paddings.top)}}class dh extends ch{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(di.bar(0,i,e,-i,s,0))}}class _h extends ch{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(di.bar(0,i,e,-i,0,s))}}class uh extends ba{constructor(t){super(t,!0),this.add(this._back=new At(t)),this._back.addAll(this._borderView=new Ai(t),this._headerView=new dh(t),this._bodyView=new _h(t),this._divider=new la(t))}prepare(){this._clearScale(this._back)}render(t,e,i,s,r,n){const o=this.point,a=e.header,h=e.body,l=this._headerView,c=this._bodyView,d=this._divider;let _,u;l.setVisible(a.visible)&&(l.internalResetStyleOrClass(a._style),_=l.setPoint(o).measure(t,a,i,s)),this._divider.setVisible(l.visible),c.internalResetStyleOrClass(h._style),u=c.setPoint(o).measure(t,h,i,s);let p=u.width,g=u.height;l.visible&&(p=Math.max(p,_.width),g+=_.height);const m=e.getExtents(p,g);l.visible&&(l.resize(m.width,_.height),l.layout(r),d.setVisible(e.divider.visible)&&(d.trans(0,_.height),d.setHLine(0,0,m.width))),c.resize(m.width,m.height-_.height),c.transY(_.height),c.layout(r),this._borderView.setBounds(0,0,m.width,m.height,r),this._rBox={x:0,y:0,width:m.width,height:m.height},this._aniScale(this._back,n)}}class ph extends ja{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class gh extends Ca{constructor(t){super(t,!0),this._sectors=new Yo(this,ph,null,.5),this._rdRate=1,this.add(this._circle=new Ua(t)),this._circle.internalSetStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,i,s){const r=0,n=0;if(e){this.$_calcAngles(t,[0],s);const o=t._categories||[],a=this._sectors.prepare(1).get(0),h=0,l=t.options.clockwise;let c=0,d=0;isNaN(e.radius)||(i=e.radius),a.setPieSector({cx:r,cy:n,rx:i,ry:i,innerRadius:h,start:a.start,angle:a.angle,clockwise:l}),a.trans(c,d).setVisible(!0),a.internalClearStyleAndClass(),o[0]&&o[0].color&&a.setFill(o[0].color),a.internalSetStyleOrClass(e.style)}else{const e=this.point.values;this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),this.$_layoutSectors(t,r,n,i,s)}}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e,i){const s=t.options,r=e.length,n=s.clockwise?1:-1,o=e.reduce(((t,e)=>t+e),0),a=t._totalRad*i;let h=t._startRad;if(this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),r>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/o||0;t.start=h,h+=t.angle=n*e*a}}));else if(1==r){const t=this._sectors.get(0);t.start=h,t.angle=a}}$_layoutSectors(t,e,i,s,r){const n=t._categories||[],o=t.getFieldColors(),a=t.options.clockwise;this.$_calcAngles(t,this.point.values,r),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(e,i,s),this._sectors.forEach(((t,r)=>{const h=t.value;if(isNaN(h))t.setVisible(!1);else{const h=t.start;let l=0,c=0;t.trans(l,c).setVisible(!0),t.setPieSector({cx:e,cy:i,rx:s,ry:s,innerRadius:0,start:h,angle:u(t.angle),clockwise:a}),t.internalClearStyleAndClass(),n[r]&&n[r].color?t.setFill(n[r].color):o&&t.setFill(o[r%o.length])}}))}}class mh extends va{constructor(t){super(t,!0),this.add(this._pin=new Nt(t))}render(t){this._pin.setPath(di.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new Ua(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 fh extends va{}class bh extends ba{constructor(t){super(t,!0),this.add(this._line=new Nt(t)),this.add(this._arrow=new Nt(t))}prepare(){this._checkStatic()}render(t,e,i,s){if(i.length>1){const t=i[i.length-2],r=i[i.length-1],n=V(Math.atan2(r[1]-t[1],r[0]-t[0]))-90,o="M"+i.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),this._arrow.setVisible(s)&&(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],n))}else this._line.setPath(""),this._arrow.setPath("")}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this}}class yh extends Ca{constructor(t){super(t,!0),this._cells=new Yo(this,Nt)}render(t,e,i,s){const r=t.getPointGrid(this.point,e,s);this.$_prepareCells(Math.round(r.count),i.wCell,i.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,i)}$_prepareCells(t,e,i){this._cells.prepare(t,(t=>{t.setPath(di.square(0,0,e,i))}))}$_layoutCells(t,e,i,s,r){const n=i*r.hCell+(i-1)*r.gap;let o=0,a=0;this._cells.forEach(((t,i,s)=>{isNaN(e[o][a])&&(o++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),n-o*r.hCell-(o>0?o*r.gap:0)),a++}))}}class wh extends La{constructor(t){super(t,"rm-waffle-series",!0,!1),this._waffles=new _a(this._pointContainer,yh)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,g(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._waffles.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutWaffles(t,e,i){const s=this.model,r=s.pointLabel,n=s.getWaffleInfo(),o=s.chart.getProjection(),a=+s.options.rotation||0,h=[this._scale,-this._scale],l=s.options.position,c=r.getPosition,d=s.getLabelOff(),_=this._labelViews(),u={...this._getSeriesExt(s,s._visPoints),gap:s.options.gap},p=s.getCallout(),g=this._calloutViews();let m,f,b;this._waffles.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(m=o.getVisible(y)))){const e=this._getPointPositioner(r.position||l,"top");let w,x,v,S,C,L;if(p&&(w=r.getCallout(y))&&(x=w.map((t=>o.project(t))),m=x[x.length-1]),r.xPos=v=m[0],r.yPos=S=m[1],v*=h[0],S*=h[1],t.render(s,u,n,i*r.vrate()),f=t.bbox(),b=e(v,S,f.width,f.height),t.trans(b.x,b.y).rotate(a),_&&(C=_.get(r,0))&&C.setVisible(t._static)){const e=this._getLabelPositioner(c(r),"bottom");this._layoutLabel(C,t.dom).transp(e(b.x+f.width/2,b.y+f.height/2,C.bbox(),f.width/2,f.height/2,d))}g&&x&&(L=g.get(r))&&L.setVisible(t._static)&&L.render(p,r,x.flat().map(((t,e)=>t*h[e%2])),null)}}))}}class xh extends Ko{constructor(t){super(t,xh.CLASS_NAME),this.add(this._foreignObj=new Mt(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=xh.HTML_VIEW_CLASS,this._observer=new MutationObserver((t=>{this.$_refresh()}))}_doMeasure(t,e,i,s){const r=e.options,n=e.getSize(i,s),o=this._htmlView;let a=r.html||"";const h=(a.startsWith("#")||a.startsWith("."))&&t.querySelector(a);return this._foreignObj.resize(g(n.width,zr.DEF_SIZE),n.height),a=e.applyParams(h?h.innerHTML:a),a!==o.innerHTML&&(o.innerHTML=a),h&&this._templateDom!==h&&(this._templateDom=h,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0})),isNaN(this._foreignObj.height)&&(this._foreignObj.height=o.firstElementChild.offsetHeight),ht(this._foreignObj.bbox())}_doLayout(t){super._doLayout(t)}_doDestory(){this._observer.disconnect()}$_refresh(){this.chart()._optionChanged(this.model)}}function vh(t,e){return new(wa[e._type()])(t)}function Sh(t,e){return new(Xo[e._type()])(t)}xh.CLASS_NAME="rm-html-annotation",xh.HTML_VIEW_CLASS="rm-html-annotation-view",xa.register([Yn,lh],[ao,class extends Sa{constructor(t){super(t,"rm-point-series",!0,!0)}_createMarkers(t){return new _a(t,fh)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=Math.max(0,e.getRadius()),n=[this._scale,-this._scale],o=+e.options.rotation||0,a=e.options.position,h=this._labelViews(),l=e.getLabelOff(),c=e.getCallout(),d=this._calloutViews();let _,u;const p=i.getPosition;this._markers.forEach(((i,g)=>{var m;const f=i.point,b=[f.lon,f.lat];if(i.setVisible(!f.isNull&&null!=(_=s.getVisible(b)))){const g=this._getPointPositioner(f.position||a,"center"),y=(null!==(m=i._radius)&&void 0!==m?m:r)*f.vrate(),w=y*t,x=xa.getDrawer(e.getShape());let v,S,C,L,k,M;if(c&&(v=f.getCallout(b))&&(S=v.map((t=>s.project(t))),_=S[S.length-1]),f.xPos=C=_[0],f.xPos=L=_[1],C*=n[0],L*=n[1],u=g(C,L,2*y,2*y),u.x+=y,u.y+=y,i.setPath(x(w,w)),i.trans(u.x,u.y).rotate(o),h&&(k=h.get(f,0))&&k.setVisible(i._static)){this._layoutLabel(k,i.dom);let t=this._getLabelPositioner(p(f),"bottom");k.transp(t(u.x,u.y,k.bbox(),y,y,l))}if(d&&S&&(M=d.get(f))&&M.setVisible(i._static)){const t=S.flat().map(((t,e)=>t*n[e%2]));d.setMask(M,t).setCircle(t[t.length-2],t[t.length-1],y),M.render(c,f,t,null)}}}))}}],[ro,class extends Sa{constructor(t){super(t,"rm-pin-series",!0,!0)}_createMarkers(t){return new _a(t,mh)}_doPrepeare(t,e,i){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(),i=this._getGrowRate(),s=this.model,r=s.pointLabel,n=[this._scale,-this._scale],o=+s.options.rotation||0,a=s.options.position,h=r.getPosition;s.pointLabel.options.position;const l=this._labelViews(),c=s.getLabelOff(),d=s.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach(((r,g)=>{const m=r.point,f=[m.lon,m.lat];if(r.setVisible(!m.isNull&&null!=(u=e.getVisible(f)))){const g=this._getPointPositioner(m.position||a,"top"),b=s.getExt(m,i*m.vrate()),y=2*b.rd,w=3*b.rd;let x,v,S,C,L,k;if(d&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),u=v[v.length-1]),m.xPos=S=u[0],m.yPos=C=u[1],S*=n[0],C*=n[1],p=g(S,C,y,w),t&&r.render(b),r.trans(p.x+y/2,p.y+w).rotate(o),l&&(L=l.get(m,0))&&L.setVisible(r._static)){t&&this._layoutLabel(L,r.dom);const e=this._getLabelPositioner(h(m),"bottom");L.transp(e(p.x+y/2,p.y+w/2,L.bbox(),y/2,w/2,c))}_&&v&&(k=_.get(m))&&k.setVisible(r._static)&&k.render(d,m,v.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[hn,class extends Ma{constructor(t){super(t,"rm-bar-series",!0,!1),this._labelInfo={},this._bars=new _a(this._pointContainer,Ba)}_getPointPool(){return this._bars}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,g(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){const i=t.reversed;this._bars.prepare(e.length,((s,r)=>{const n=s.setReversed(i).prepare(e[r],null);this._setPointStyle(s,t,n)}))}$_layoutBars(t,e,i){const s=this.model,r=s.pointLabel,n=s._width,o=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.options.position,_=r.getPosition,u=s.getLabelOff(),p=this._labelViews(),g=s.getCallout(),m=this._calloutViews(),f={pad:this._ext.pad,barWidth:s.options.barWidth,overflow:s.options.overflow};let b,y;this._bars.forEach(((t,e)=>{const r=t.point,w=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(b=l.getVisible(w)))){const e=this._getPointPositioner(r.position||d,"center"),x=t.getSizeRate(t._ext.max,h),v=this._ext.width*x,S=this._ext.height*x;let C,L,k,M,A,P;if(g&&(C=r.getCallout(w))&&(L=C.map((t=>l.project(t))),b=L[L.length-1]),r.xPos=k=b[0],r.yPos=M=b[1],k*=c[0],M*=c[1],y=e(k,M,n,o),t.resize(n,o),t.render(s,a&&h,r.values,f,v,S,i*r.vrate()),t.trans(y.x,y.y).rotate(this.rotation),p&&(A=p.get(r,0))&&A.setVisible(t._static)){let t=this._getLabelPositioner(_(r),"bottom");A.layout().transp(t(y.x+n/2,y.y+o/2,A.bbox(),n/2,o/2,u))}m&&L&&(P=m.get(r))&&P.setVisible(t._static)&&P.render(g,r,L.flat().map(((t,e)=>t*c[e%2])),null)}}))}}],[Fn,class extends Ma{constructor(t){super(t,"rm-line-series",!0,!1),this._lines=new _a(this._pointContainer,th)}_getPointPool(){return this._lines}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,g(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Qa(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((i,s)=>{const r=i.prepare(e[s],null);this._setPointStyle(i,t,r)}))}$_layoutLines(t,e,i){const s=this.model,r=s.pointLabel,n=!s._pointDomain,o=this._getSeriesExt(s,this._visPoints),a=s.chart.getProjection(),h=[this._scale,-this._scale],l=s.options.position,c=r.getPosition,d=s.getLabelOff(),_=this._labelViews(),u=s.getCallout(),p=this._calloutViews();let g,m;this._lines.forEach(((t,e)=>{const r=t.point,f=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(g=a.getVisible(f)))){const e=this._getPointPositioner(r.position||l,"top"),b=t.getSizeRate(t._ext.max,o),y=this._ext.width*b,w=this._ext.height*b;let x,v,S,C,L,k;if(u&&(x=r.getCallout(f))&&(v=x.map((t=>a.project(t))),g=v[v.length-1]),r.xPos=S=g[0],r.yPos=C=g[1],S*=h[0],C*=h[1],m=e(S,C,y,w),t.render(s,n&&o,r.values,y,w,i*r.vrate()),t.trans(m.x,m.y).rotate(this.rotation),_&&(L=_.get(r,0))&&L.setVisible(t._static)){const t=this._getLabelPositioner(c(r),"bottom");L.layout().transp(t(m.x+y/2,m.y+w/2,L.bbox(),y/2,w/2,d))}p&&v&&(k=p.get(r))&&k.setVisible(t._static)&&k.render(u,r,v.flat().map(((t,e)=>t*h[e%2])),null)}}))}}],[eo,class extends La{constructor(t){super(t,"rm-pie-series",!0,!1),this._pies=new _a(this._pointContainer,gh)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,g(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._pies.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutPies(t,e,i){const s=this.model,r=s.pointLabel,n=s.chart.getProjection(),o=[this._scale,-this._scale],a=s.options.position,h=r.getPosition,l=s.getLabelOff(),c=this._labelViews(),d=s.getCallout(),_=this._calloutViews(),u=s.getRadius(Math.min(t,e)),p=s.hasThreshold(),g=this._inRegion;let m,f;this._pies.forEach(((t,e)=>{const r=t.point,b=[r.lon,r.lat];if(t.setVisible(!r.isNull&&(g&&r._excluded||!g&&!r._excluded)&&null!=(m=n.getVisible(b)))){const e=this._getPointPositioner(r.position||a,"top"),g=u*t._rdRate;let y,w,x,v,S,C;if(d&&(y=r.getCallout(b))&&(w=y.map((t=>n.project(t))),m=w[w.length-1]),r.xPos=x=m[0],r.yPos=v=m[1],x*=o[0],v*=o[1],f=e(x,v,2*g,2*g),f.x+=g,f.y+=g,t.render(s,p&&s.getThreshold(r.getSum()),g,i*r.vrate()),t.trans(f.x,f.y),c&&(S=c.get(r,0))){const e=this._getLabelPositioner(h(r),"bottom");this._layoutLabel(S,t.dom).transp(e(f.x,f.y,S.bbox(),g,g,l))}if(_&&w&&(C=_.get(r))&&C.setVisible(t._static)){const e=w.flat().map(((t,e)=>t*o[e%2]));_.setMask(C,e).setCircle(e[e.length-2],e[e.length-1],g),C.render(d,r,e,t.getFill())}}}))}}],[En,class extends xa{constructor(t){super(t,"rm-figure-series",!0,!0),this._figure=this.$_createFigure(t),this._image=this.$_createImage(t),this._figures=new _a(this._pointContainer,qa)}$_createFigure(t){const e=Mt.createElement(t,"symbol");return e.append(Mt.createElement(t,"path")),this._addDef(e,"figure")}$_createImage(t){const e=Mt.createElement(t,"image");return this._addDef(e,"image")}_getPointPool(){return this._figures}_doPrepeare(t,e,i){const s=e.figureBox,r=e.innerImage.options;Ct.setAttr(this._figure,"viewBox",s?`0 0 ${s[0]} ${s[1]}`:null),Ct.setAttr(this._figure.firstElementChild,"d",e.path),Ct.setAttrs(this._image,{href:r.url,width:r.width,height:r.height}),this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutFigures(t)}$_prepareFigures(t,e){const i=t.chart.isDirty,s=e.length,r={id:`#${this._figure.id}`,...t.getFigureSize()},n=this._image.getAttribute("href")?{id:`#${this._image.id}`,...t.getImageSize()}:void 0,o=t.innerLabel;this._pointContainer.setFill(t._runColor),this._figures.prepare(s,((s,a)=>{const h=s.point=e[a];this._setPointStyle(s,t,h),i&&s.prepare(this.doc,r,n,o)}))}$_layoutFigures(t){const e=this.model.chart.getProjection(),i=this.model,s=i.pointLabel,r=[this._scale,-this._scale],n=+i.options.rotation||0,o=i.options.position,a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews(),d=s.getPosition;let _,u;this._figures.forEach(((i,s)=>{const p=i.point,g=[p.lon,p.lat];if(i.setVisible(!p.isNull&&null!=(_=e.getVisible(g)))){const s=this._getPointPositioner(p.position||o,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>e.project(t))),_=f[f.length-1]),p.xPos=b=_[0],p.yPos=y=_[1],b*=r[0],y*=r[1],i.render(t),v=i._rBox,u=s(b,y,v.width,v.height),i.trans(u.x,u.y).rotate(n),a&&(w=a.get(p,0))&&w.setVisible(i._static)){const t=this._getLabelPositioner(d(p),"bottom");this._layoutLabel(w,i.dom).transp(t(u.x+v.width/2,u.y+v.height/2,w.bbox(),v.width/2,v.height/2,h))}if(c&&f&&(x=c.get(p))&&x.setVisible(i._static)){const t=f.flat().map(((t,e)=>t*r[e%2]));v.x=i.tx,v.y=i.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,i.getFill())}}}))}}],[uo,wh],[co,class extends xa{constructor(t){super(t,"rm-route-series",!1,!1),this._lines=new _a(this._pointContainer,bh,"rm-route-series-line")}needClip(){return!0}_getPointPool(){return this._lines}_setPointColor(t,e){t._line.setStroke(e),t._arrow.setFill(e)}_doPrepeare(t,e,i){i&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(g(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){}_legendColorProp(){return"stroke"}$_prepareLines(t,e){const i=e.length;this._pointContainer.setStroke(t._runColor),this._lines.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(),i._line.setFill("none"),Ct.setNoScale(i._line.dom),i._arrow.setStroke("none"),Ct.setNoScale(i._arrow.dom)}))}$_layoutLines(t){const e=this.model,i=e.chart;if(i.isDirty||!isNaN(t)){const s=i.getProjection(),r=e.options.lineWidth,n=e.options.arrowDisplay;if(rt){const t=g(r,2)/this._scale;this._pointContainer.internalSetStyle("strokeWidth",`${t}px`)}else isNaN(r)||this._pointContainer.internalSetStyle("strokeWidth",`${r}px`);t=g(t,1),this._lines.forEach(((i,r)=>{this.$_layoutLine(i,e,s,n,t*i.point.vrate())}))}}$_layoutLine(t,e,i,r,o){const a=t.point;if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(s(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)n(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t._line.setPath(s.join(" "))}else{const s=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>i.project(t))).filter((t=>!t.outside));o<1&&(s.length=s.length*o|0),t.render(e,1/this._scale,s,"none"!==r&&(o<1||"moving"!==r))}}$_genPath3(t,e,i){const s=[],r=Math.min(.1,Math.max(0,this.model.options.bendFactor)),n=Math.log(1+(o=t[0],a=t[1],h=e[0],l=e[1],Math.sqrt((o-h)**2+(a-l)**2)))*r;var o,a,h,l;const c=this._calculateControlPoint(t,e,n);for(let r=0;r<=i;r++){const n=r/i,o=this.interpolate3(t,c,n),a=this.interpolate3(c,e,n),h=this.interpolate3(o,a,n);s.push(h)}return s}interpolate3(t,e,i){const s=T(t[1]),r=T(t[0]),n=T(e[1]),o=T(e[0]),a=Math.acos(Math.sin(s)*Math.sin(n)+Math.cos(s)*Math.cos(n)*Math.cos(o-r)),h=Math.sin((1-i)*a)/Math.sin(a),l=Math.sin(i*a)/Math.sin(a),c=h*Math.cos(s)*Math.cos(r)+l*Math.cos(n)*Math.cos(o),d=h*Math.cos(s)*Math.sin(r)+l*Math.cos(n)*Math.sin(o),_=h*Math.sin(s)+l*Math.sin(n),u=Math.sqrt(c*c+d*d+_*_),p=Math.asin(_/u);return[V(Math.atan2(d,c)),V(p)]}_calculateControlPoint(t,e,i){const s=i,r=this.interpolate3(t,e,.5),n=T(r[1]),o=T(r[0]),a=n+s*Math.sin(Math.PI/2);return[V(o+s*Math.cos(Math.PI/2)),V(a)]}}],[ps,class extends Sa{constructor(t){super(t,"rm-bubble-series",!0,!1)}_createMarkers(t){return new _a(t,za)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,g(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t,e,i){const s=(t,e,i)=>{t.setPath(p(e,e)),t.trans(i.x,i.y).rotate(l)},r=(t,e,i)=>{if(h instanceof yr){const s=h.r,r=this.chart().width,n=i[1]*Math.PI/180,o=e/2*(360/r),a=o/Math.cos(n),l=o;h.r=fr*this._scale;const c=Jo.geoCircle(i[0],i[1],a,l,h,!0);h.r=s,t.setPath(c),t.trans(0,0).rotate(0)}else s(t,e,S)},n=this.model,o=n.pointLabel,a=n.chart,h=a.getProjection(),l=+n.options.rotation||0,c=[this._scale,-this._scale],_=n.options.position,u=this._getLabelPositioner(n.subLabel.options.position,"right"),p=xa.getDrawer(n.getShape()),g=this._labelViews(),m=n.getLabelOff(),f=n.getSubLabelOff(),b=n.getCallout(),y=this._calloutViews(),{min:w,max:x}=n.getPixelMinMax(d(a.width,a.height));let v,S;const C=o.getPosition;this._markers.forEach(((t,e)=>{const o=t.point,a=[o.lon,o.lat];if(t.setVisible(!o.isNull&&null!=(v=h.getVisible(a)))){const e=this._getPointPositioner(o.position||_,"center");let l,d,p,L,k,M,A=(t._radius=n.getRadius(o.getValue(),w,x))*o.vrate()*i;if(b&&(l=o.getCallout(a))&&(d=l.map((t=>h.project(t))),v=d[d.length-1]),o.xPos=p=v[0],o.xPos=L=v[1],p*=c[0],L*=c[1],S=e(p,L,2*A,2*A),S.x+=A,S.y+=A,this.model.alignToSurface?r(t,A,a):s(t,A,S),g){if(k=g.get(o,0)){let e=this._getLabelPositioner(C(o),"center");this._layoutLabel(k,t.dom).transp(e(S.x,S.y,k.bbox(),A,A,m))}(k=g.get(o,1))&&this._layoutLabel(k,t.dom).transp(u(S.x,S.y,k.bbox(),A,A,f))}if(y&&d&&(M=y.get(o))&&M.setVisible(t._static)){const e=d.flat().map(((t,e)=>t*c[e%2]));y.setMask(M,e).setCircle(e[e.length-2],e[e.length-1],A),M.render(b,o,e,t.getFill())}}}))}}],[Dn,class extends xa{constructor(t){super(t,"rm-image-series",!0,!0),this._images=new _a(this._pointContainer,Ja)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,i=t.options.imageWidth,s=t.options.imageHeight;this._images.prepare(e.length,((r,n)=>{const o=r.point=e[n];r.setImage(t.getUrl(o),i,s),this._setPointStyle(r,t,o)}))}_layoutPoints(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=+e.options.rotation||0,n=[this._scale,-this._scale],o=e.options.position,a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews(),d=i.getPosition;let _,u;this._images.forEach(((e,i)=>{const p=e.point,g=[p.lon,p.lat];if(e.setVisible(!p.isNull&&null!=(_=s.getVisible(g)))){const i=this._getPointPositioner(p.position||o,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>s.project(t))),_=f[f.length-1]),p.xPos=b=_[0],p.yPos=y=_[1],b*=n[0],y*=n[1],e.render(t),v=e._rBox,u=i(b,y,v.width,v.height),e.trans(u.x,u.y).rotate(r),h&&(w=h.get(p,0))&&w.setVisible(e._static)){const t=this._getLabelPositioner(d(p),"bottom");w.layout().transp(t(u.x+v.width/2,u.y+v.height/2,w.bbox(),v.width/2,v.height/2,a))}if(c&&f&&(x=c.get(p))&&x.setVisible(e._static)){const t=f.flat().map(((t,e)=>t*n[e%2]));v.x=e.tx,v.y=e.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,e.getFill())}}}))}}],[Jn,class extends xa{constructor(t){super(t,"rm-panel-series",!0,!1),this._panels=new _a(this._pointContainer,uh)}_doPrepeare(t,e,i){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,this._getGrowRate())}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){this.$_layoutPanels(this.doc,this.width,this.height,t)}_getPointPool(){return this._panels}$_preparePanels(t,e){const i=e.length;this._panels.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPanels(t,e,i,s){const r=this.model,n=r.chart.getProjection(),o=[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=g(u.rx,0);let m,f,b;this._panels.forEach(((u,g)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(m=n.getVisible(w)))){const g=this._getPointPositioner(y.position||a,"top");let x,v,S,C,L,k;if(d&&(x=y.getCallout(w))&&(v=x.map((t=>n.project(t))),m=v[v.length-1]),y.xPos=S=m[0],y.yPos=C=m[1],S*=o[0],C*=o[1],u.render(t,r,e,i,p,s),f=u._rBox,b=g(S,C,f.width,f.height),u.trans(b.x,b.y),l&&(L=l.get(y,0))&&L.setVisible(u._static)&&this._layoutLabel(L,u.dom).transp(h(b.x+f.width/2,b.y+f.height/2,L.bbox(),f.width/2,f.height/2,c)),_&&v&&(k=_.get(y))&&k.setVisible(u._static)){const t=v.flat().map(((t,e)=>t*o[e%2]));f.x=u.tx,f.y=u.ty,_.setMask(k,t).setRects(f),k.render(d,y,t,u.getFill())}}}))}}],[uo,wh],[bn,class extends Pa{constructor(t){super(t,"rm-circle-gauge",!0,!1)}_createGauges(t){return new _a(t,Za)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height,1)}_doReset(){}_runShowEffect(t){t&&Ta.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e,i){const s=this.model,r=s.pointLabel,n=s.chart.getProjection(),o=[this._scale,-this._scale],a=s.options.position,h=this._labelViews(),l=s.getLabelOff(),c=s.getCallout(),d=this._calloutViews(),_=r.getPosition;let u,p,g;this._gauges.forEach(((r,m)=>{const f=r.point,b=[f.lon,f.lat];if(r.setVisible(!f.isNull&&null!=(u=n.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"top");let y,w,x,v,S,C;if(c&&(y=f.getCallout(b))&&(w=y.map((t=>n.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=o[0],v*=o[1],r.render(s,t,e,i*f.vrate()),p=r._size,g=m(x,v,p,p),r.trans(g.x,g.y),h&&(S=h.get(f,0))&&S.setVisible(f._isStatic())){const t=this._getLabelPositioner(_(f),"bottom");this._layoutLabel(S,r.dom).transp(t(g.x+p/2,g.y+p/2,S.bbox(),p/2,p/2,l))}d&&w&&(C=d.get(f))&&C.setVisible(f._isStatic())&&C.render(c,f,w.flat().map(((t,e)=>t*o[e%2])),null)}}))}}],[Pn,class extends Pa{constructor(t){super(t,"rm-clock-gauge",!0,!1)}_createGauges(t){return new _a(t,Ka)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height)}_doReset(){}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e){const i=this.model,s=i.pointLabel,r=this.model.chart.getProjection(),n=[this._scale,-this._scale],o=i.options.position,a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews(),_=s.getPosition;let u,p,g;this._gauges.forEach(((s,m)=>{const f=s.point,b=[f.lon,f.lat];if(s.setVisible(!f.isNull&&null!=(u=r.getVisible(b)))){const m=this._getPointPositioner(f.position||o,"top");let y,w,x,v,S,C;if(l&&(y=f.getCallout(b))&&(w=y.map((t=>r.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=n[0],v*=n[1],s.render(i,t,e),p=d(t,e),g=m(x,v,p,p),s.trans(g.x,g.y),a&&(S=a.get(f,0))&&S.setVisible(f._isStatic())){const t=this._getLabelPositioner(_(f),"bottom");this._layoutLabel(S,s.dom).transp(t(g.x+p/2,g.y+p/2,S.bbox(),p/2,p/2,h))}c&&w&&(C=c.get(f))&&C.setVisible(f._isStatic())&&C.render(l,f,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}]),Ko.register([Hr,Ea],[jr,Ia],[Gr,Na],[zr,xh]);class Ch extends _t{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class Lh extends _t{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(1-t)),!0}}class kh extends At{constructor(t,e,i){super(t,"rm-series-container"),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this._axisLayer=new At(t)),this._axisLayer.add(this.axisView=new ia(t,i)),this._axisLayer.add(this.tickLayer=new ea(t))}prepare(t,e,i){const s=e.visibleSeries,r=this.seriesMap,n=this.seriesViews,o=this._h1,a=this._h2;n.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),n.length=0,s.forEach((e=>{const s=r[e.hash]||vh(t,e);s.parent||(this.add(s),this.labelsContainer.add(s._labelContainer),this.labelsContainer.add(s.secondLabelContainer())),r[e.hash]=s,n.push(s),s._h1=o,s._h2=a,s.prepareModel(t,e,i)})),this.prevViews&&nt.equalArrays(this.prevViews,n)||(this.sort(n),this.labelsContainer.sort(n.map((t=>t._labelContainer)))),this.prevViews=n.slice(0)}prepareLayout(t){this.seriesViews.forEach((e=>{e.prepareLayout(t)}))}resetClip(t){this._axisLayer.setClip(t)}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}onScrollStart(){this.seriesViews.forEach((t=>t.onScrollStart()))}onScrollEnd(){this.seriesViews.forEach((t=>t.onScrollEnd()))}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class Mh extends At{constructor(t,e){super(t,e?"rm-front-axis-guides":"rm-axis-guides"),this.front=e,this._guideViews=[],this.add(this._guideLayer=new At(t)),this.add(this._labelLayer=new At(t))}render(t,e,i,s,r){const n=e.guides.filter((t=>t.options.front==this.front));this.$_prepareGuides(t,n),this.$_layoutGuides(t,n,i,s,r)}$_prepareGuides(t,e){const i=this._guideViews,s=e.length;for(;i.length>s;)i.pop().remove();for(;i.length<s;){const e=new ra(t,this._labelLayer);i.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,i,s,r){this._guideViews.forEach(((n,o)=>{n.measure(t,e[o],s,r),n.layout(i)}))}}class Ah extends Bo{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._owner=e,this.add(this._back=new Ai(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new ha(t)),this.add(this._contentLayer=new At(t,"rm-body-content")),this.add(this._feedbackContainer=new At(t,"rm-feedbacks")),this.add(this._crosshairView=new oa(t)),this._contentLayer.add(this._annotationContainer=new At(t,"rm-annotations")),this._contentLayer.add(this._axisGuideContainer=new Mh(t,!1)),this._contentLayer.add(this._seriesContainer=new kh(t,new At(t),!1)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new Mh(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new At(t,"rm-front-annotations"))}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]}prepare(t,e){const i=e.chart.map;if(i){const{h1:t,h2:s}=i,r=e.scroll%360;e.prepare(i),this._seriesContainer._h1=t+r,this._seriesContainer._h2=s}this.$_prepareSeries(t,e.chart,0),this.$_prepareAnnotations(t,e.getAnnotations())}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.mouseToMap(this._mousePos),this._transformInfo),this.model&&this.model.isScrollable()&&this.onScrollEnd()}clean(){}reset(){this._seriesContainer.seriesViews.forEach((t=>t.reset()))}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,i){if(!this.model)return;const s=this.model.chart,r=this._owner.tx,n=this._owner.ty,{sv:o,pv:a}=function(s){let o,a;for(const h of s)h.pointerMoved(t,e,i)&&(o=h,a=h.getPointView(i,t-r,e-n,!0));if(!a)for(const h of s)if(a=h.getPointView(i,t-r,e-n,!0),a){o=h;break}return{sv:o,pv:a}}(this._seriesContainer.seriesViews),h=null==o?void 0:o.model,l=h&&this._owner.getScaleView(s.getColorScale(h.getColorScale()));return(null==a?void 0:a.point)?(this._owner.showTooltip(h,a,this,{x:t,y:e}),null==l||l.setValue(a.point.getValue())):(this._owner.hideTooltip(),null==l||l.setValue(NaN)),this._crosshairView.visible&&s&&this._crosshairView.render(this.mouseToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!o}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 i=this.getSeries(t);i&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new Lh(i)).start())}getBackBounds(){return this._back.getBounds()}addFeedback(t){t&&this._feedbackContainer.add(t)}onScrollStart(){this._seriesContainer.onScrollStart()}onScrollEnd(){this._seriesContainer.onScrollEnd()}_doMeasure(t,e,i,s){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,i,s),Fo.create(i,s)}_doLayout(t){var e;const i=this.doc,s=this.model,r=s._prj,n=s.chart,o=n.axis,a=n.map,h=this.height,l=this.width,{wMap:c,hMap:d,scale:_,tx:u,ty:p}=s.prepareLayout(l,h);let g=this._clip;if(this._back.resize(l,h),this._back.internalResetStyleOrClass(s._style),a){this.$_prepareLayoutSeries(i,n),this._transformInfo={tx:u,ty:p,scale:_,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const t=`translate(${u}px, ${p}px) scale(${_}, ${-_})`,e=c*_,g=d*_,m=[this._seriesContainer],f=(l-e)/2-s.panX*_,b=(h-g)/2-s.panY*_,y=this.$_layoutClip(s,r,l,h,_);this._mapBack.setVisible(n.body.mapBackground.isVisible())&&this._mapBack.render(this.doc,n,f,b,e,g),m.forEach((r=>{const n=r.axisView,a=r.tickLayer;n.setScale(_),n.measure(i,o,l,h),n.resize(l,h),n.trans(u,p),a.setVisible(o.tick.visible)&&(a.prepare(i,o.tick,n.steps),a.resize(l,h),a.setScale(_),a.layout(s.projection),a.trans(u,p)),r.seriesViews.forEach((i=>{var s,r;i._scale=_,i.model.needMapScale()?(i._pointLayer.internalSetStyle("transform",t),i._calloutContainer.visible&&i._calloutContainer.internalSetStyles({transform:t})):i.model.needTranslate()?i.trans(u,p):(i.resize(l,h),i.trans(f,b)),i.move(u,p),i.resize(e,g),i.render(l,h,this._transformInfo),null===(s=i._labelContainer)||void 0===s||s.trans(u,p),null===(r=i.secondLabelContainer())||void 0===r||r.trans(u,p),i.setClip(i.needClip()?y:null)})),n.layout(),r.resetClip(y)})),this._crosshairView.visible&&this._crosshairView.prepare(_,t);const w={map:a,prj:r,tf:this._transformInfo,trans:t,latInterval:o.latInterval,lonInterval:o.lonInterval};this.$_layoutAxisGuides(i,o,w,l,h)}if(this.$_layoutAnnotations(l,h),g&&g.parent&&g.width===l&&g.height===h||(g&&g.dom.remove(),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 Ch(t)).start(),this._requestShow=null)}this._prevPrj=s._prj}mouseToMap(t,e=!0,i=!1){if(!this._transformInfo)return[NaN,NaN];const{tx:s,ty:r,scale:n,vx:o,vy:a}=this._transformInfo;let h=t.x-s,l=t.y-r;i||(h-=o,l-=a);const c=h/n,d=l/-n;return this.pointToMap(c,d,e)}boundsToMap(t,e=!0,i=!1){return{from:this.mouseToMap({x:t.x,y:t.y},e,i),to:this.mouseToMap({x:t.x+t.width,y:t.y+t.height},e,i)}}pointToMap(t,e,i){if(!this.model)return[NaN,NaN];const{projection:s,scroll:r}=this.model,n=s.backward([t,e]);return i||0===r||(n[0]=s.getScrolledLon(n[0])),n}mapToPoint(t){t=this.model.chart.getProjection().project(t);const{tx:e,ty:i,scale:s,vx:r,vy:n}=this._transformInfo;return{x:t[0]*s-(r-e),y:t[1]*-s-(n-i)}}boundsByCoord(t,e){const i=this.mapToPoint(t),s=this.mapToPoint(e);return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}$_prepareSeries(t,e,i){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e,i)}$_prepareLayoutSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Sh(t,e);(e.options.front?s:i).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((i=>{i._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,i,s,r){this._axisGuideContainer.render(t,e,i,s,r),this._frontAxisGuideContainer.render(t,e,i,s,r),this._axisGuideContainer.setClip(this._clipMap),this._frontAxisGuideContainer.setClip(this._clipMap)}$_layoutClip(t,e,i,s,r){const n=()=>{const i=e.getClipBounds(t.chart.axis.lonInterval,t.chart.axis.latInterval);return`M${i[0][0]},${i[0][1]} L`+i.slice(1).map((t=>`${t[0]},${t[1]}`))},o=t=>{const{tx:e,ty:i}=this._transformInfo;t.path.transEx(e,i).scale(r)};if(e.isClipping()){const t=this._clipMap;if(t&&t.dom.parentElement&&t.width===i&&t.height===s){if(t){if(this._prevPrj!==e){const e=n();t.setPath(e)}o(t),this._contentLayer.hasClip()}}else{const e=n();t&&t.remove(),this._clipMap=this.control.clip(new Rt(this.doc).setPath(e)),o(this._clipMap),this._clipMap.resize(i,s)}}else this._clipMap&&(this._clipMap.remove(),this._clipMap=null);return this._clipMap}}class Ph extends zo{constructor(t,e){super(t,e?Ph.SUBTITLE_CLASS:Ph.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new ke(t)),this._richText=new De}_marginable(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,i,s){return this.chart().isDirty&&(this._richText.setFormat(e.options.text),this._richText.build(this._textView,i,s,null,null)),ht(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}var Ih;Ph.TITLE_CLASS="rm-title",Ph.SUBTITLE_CLASS="rm-subtitle",function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Ih||(Ih={}));class Nh extends Mt{constructor(t){super(t,Nh.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 Nt(t,"rm-tooltip-back")),this.add(this._top=new Nt(t,"rm-tooltip-top")),this.add(this._textView=new ke(t,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+kt.SHADOW_FILTER+")"),this._textView.anchor=Se.START,this._richText=new De,this.close(!0,!1)}show(t,e,i,s,r,n){var o;const a=e.point,h=this._model=t.chart._tooltip,l=h.options,c=h.setTarget(t,a);if(!c)return;const u=l.text||c.getTooltipText(t,a);if(!u)return;const p=this.control,g=p.contentWidth(),m=p.contentHeight(),f=this._textView;this._richText.setFormat(u),this._richText.build(f,NaN,NaN,null,h.getTextDomain());const b=f.bbox();let y=_(l.minWidth||0,b.width+16),w=_(l.minHeight||0,b.height+12);this._top.setFill((null===(o=e.tooltipColor)||void 0===o?void 0:o.call(e))||t._calcedColor);const x="visible"===this.getStyle("visibility")?300:0,v=l.offset+this._tailSize,S=e.getBounds(),C=p.getBounds();let L;L=i-y/2-_(0,d(i-y/2,g-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(L),h.isFollowPointer(t)||(C.bottom,S.bottom);const k=Ih.TOP;this.drawTooltip(0,0,y,w,k,L),s-=w+v,i=_(0,d(i-=y/2,g-y)),s=_(0,d(s,m-w)),this.transEx(i,s,x,!1),0===x&&this.internalSetStyle("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:Rr.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,n){const o=null!=i?z(e,i):{},a=z(e,s),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.internalSetStyle("visibility","hidden")}))}drawTooltip(t,e,i,s,r,n){const o=this._tailSize,a=this._radius,h=this._topHeight;let l=["M",t+a,e,"L",t+i-a,e,"Q",t+i,e,t+i,e+a,"L",t+i,e+s-a,"Q",t+i,e+s,t+i-a,e+s,"L",t+a,e+s,"Q",t,e+s,t,e+s-a,"L",t,e+a,"Q",t,e,t+a,e];if(this._tailVisible)switch(r){case Ih.TOP:l=l.concat(["M",t+i/2-o/2+n,e+s,"L",t+i/2+n,e+s+o,"L",t+i/2+o/2+n,e+s]);break;case Ih.BOTTOM:l=l.concat(["M",t+i/2-o/2+n,e,"L",t+i/2+n,e-o,"L",t+i/2+o/2+n,e]);break;case Ih.LEFT:l=l.concat(["M",t+i,e+s/2-o/2+n,"L",t+i+o,e+s/2+n,"L",t+i,e+s/2+o/2+n]);break;case Ih.RIGHT:l=l.concat(["M",t,e+s/2-o/2+n,"L",t-o,e+s/2+n,"L",t,e+s/2+o/2+n])}const c=r===Ih.BOTTOM,d=c?["M",t,e+s-h,"l",i,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-i,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",i-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-i,0,"l",0,a-h,"q",0,-a,a,-a],_=this._textView,u=_.bbox();t+=(i-u.width)/2,e+=(s-u.height+(c?-h:h))/2,_.trans(t,e),this._top.setPath(d),this._back.setPath(l)}}Nh.CLASS_NAME="rm-tooltip";class Eh extends Wo{constructor(t){super(t,Eh.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new At(t);this.add(e),e.add(this._boxLayer=new At(t)),this._boxes=new Yo(this._boxLayer,Ai,"rm-color-scale-box"),e.add(this._splitLayer=new At(t)),this._splits=new Yo(this._splitLayer,la,"rm-color-scale-split"),e.add(this._markerLabel=new Ro(t,void 0)),e.add(this._marker=new Nt(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new At(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new At(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new At(t,"rm-color-scale-null")),this._tickLines=new Yo(this._tickLineLayer,la),this._tickLabels=new Yo(this._tickLabelLayer,Ro),this._fills=[]}setValue(t){var e,i;e=t,i=this._value,(isNaN(e)?isNaN(i):e===i)||(this._value=t,this.$_resetMarker(this._wBar,this._hBar,this._vertical,this._reversed,this._inverted))}_doMeasure(t,e,i,s){let r=this.chart().isDirty;const n=e.marker,o=e.tick,a=this._tickLen=+o.line.options.length||0,h=o.line,l=o.label,c=this._vertical="vertical"===e.getLayout(),d=this._reversed=e.options.reversed,_=this._inverted=e.options.inverted,u=e.nullStep.visible?e.nullStep:void 0,p=u?u.getGap():0;let g=0,m=0;this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter);let{width:f,height:b}=e.getBarSize(i,s,c);r||(r=f!==this._wSave||b!==this._hSave),this._wSave=f,this._hSave=b,e._buildSteps();const y=e.getTicks();if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(h.visible&&y.length>0&&a>0),this._tickLabelLayer.setVisible(l.visible&&y.length>0),this._nullLayer.setVisible(!!u),r){const i=c?b:f,s=e.getSplitPoints(i,!!u,p);this._stepCount=s.length,this.$_prepareBars(t,e,c,_),this._splitLayer.visible&&this.$_prepareSplits(s),this._tickLineLayer.visible&&this.$_prepareTickLines(s,i),this._tickLabelLayer.visible&&this.$_prepareTickLabels(y),this._nullLayer.visible&&this.$_prepareNull(t,this._nullLayer,u)}if(this._markerSize=0,this._markerLabel.setVisible(n.visible)&&(this._markerSize=n.getMarkerSize(),c?f+=this._markerSize:b+=this._markerSize,r&&this.$_prepareMarker(n,c,d,this._markerSize),this._markerLabel.setVisible(n.label.visible)),this._tickLineLayer.visible){const t=this._tickLines,e=t.count;if(t.first.setVisible(!1!==o.options.minVisible),e>1){t.last.setVisible(!1!==o.options.maxVisible);for(let i=1;i<e-1;i++)t.get(i).setVisible(!0)}t.forEach(((t,e)=>{t.visible&&(t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(h._style))}))}if(this._tickLabelLayer.visible){const e=this._tickLabels,i=e.count,s=c?"width":"height";if(this._tickLabelSize=0,e.first.setVisible(!1!==o.options.minVisible),i>1){e.last.setVisible(!1!==o.options.maxVisible);for(let t=1;t<i-1;t++)e.get(t).setVisible(!0)}if(e.forEach(((e,i)=>{e.visible&&(e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(y[i].label),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1))})),u){const e=this._nullLabel;e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(u.getLabel()),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1)}c?f+=this._tickLabelSize+a:b+=this._tickLabelSize+a}return this.$_layoutBar(u,this._wBar=f,this._hBar=b),this._rScale=this._scaleLayer.bbox(),g+=this._rScale.width,m+=this._rScale.height,this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),this._rTitle&&(c?g=Math.max(g,this._rTitle.width):m=Math.max(m,this._rTitle.height)),this._rFooter&&(c?g=Math.max(g,this._rFooter.width):m=Math.max(m,this._rFooter.height)),{width:g,height:m}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible){if(this._inTitle){switch(d=g,t.title.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.options.align){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.options.align){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}this._scaleLayer.trans(p-n.x,g-n.y)}$_getFillId(t){return`${Eh.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(e,i){const s=e.createElementNS(t,"linearGradient"),r=this.$_getFillId(i);return s.setAttribute("id",r),s.appendChild(e.createElementNS(t,"stop")),s.appendChild(e.createElementNS(t,"stop")),this.control.addDef(s),s}$_setDir(t,e,i){e?Ct.setAttrs(t,i?Eh.VERT_FILL_I:Eh.VERT_FILL):Ct.setAttrs(t,i?Eh.HORZ_FILL_I:Eh.HORZ_FILL)}$_fillStops(t,e,i){const s=t.childNodes[0],r=t.childNodes[1];s.setAttribute("offset","0"),s.setAttribute("stop-color",e.toString()),s.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",i.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,i,s){this._fills.forEach((t=>this.control.removeDef(t)));const r=this._fills=[],n=e.getSteps();if(e.options.solidFill)if(n)this._boxes.prepare(n.length,((t,e)=>{t.internalSetStyle("fill",n[e]._color1)}));else{const t=this._stepCount,i=e.minColor,s=e.endColor;this._boxes.prepare(t,((e,r)=>{e.internalSetStyle("fill",ve.interpolate(i,s,(r+1)/t).toString())}))}else if(n)n.forEach(((e,i)=>{r.push(this.$_createGradient(t,i)),r[r.length-1][ti]=e})),r.forEach((t=>{const e=t[ti];this.$_setDir(t,i,s),this.$_fillStops(t,e._color1,e._color2)})),this._boxes.prepare(r.length,((t,e)=>{t.internalSetStyle("fill",this.$_getFillUrl(e))}));else{this._boxes.prepare(1);const n=this.$_createGradient(t,0);r.push(n),this.$_setDir(n,i,s),this.$_fillStops(n,e.minColor,e.endColor),this._boxes.first.internalSetStyle("fill",this.$_getFillUrl(0))}}$_prepareSplits(t){this._splits.prepare(t.length-1,((e,i)=>{e._userData=t[i]}))}$_prepareTickLines(t,e){this._tickLines.prepare(t.length+1,((i,s)=>{i._userData=0===s?0:s===t.length+1?e-1:t[s-1]}))}$_prepareTickLabels(t){this._tickLabels.prepare(t.length)}$_prepareMarker(t,e,i,s){e?i?this._marker.setPath(`M 0 0 L ${.8*s} -${.7*s} L ${.8*s} ${.7*s} Z`):this._marker.setPath(`M 0 0 L -${.8*s} -${.7*s} L -${.8*s} ${.7*s} Z`):i?this._marker.setPath(`M 0 0 L -${.7*s} ${s} L ${.7*s} ${s} Z`):this._marker.setPath(`M 0 0 L -${.7*s} -${s} L ${.7*s} -${s} Z`)}$_prepareNull(t,e,i){this._nullBar||(e.add(this._nullBar=new Ai(t,"rm-color-scale-box")),e.add(this._nullLabel=new Ro(t,"rm-color-scale-tick-label")))}$_layoutSplits(t,e){this._splits.forEach((i=>{this._vertical?i.setHLine(i._userData,0,t):i.setVLine(i._userData,0,e)}))}$_layoutTickLines(t){this._tickLines.forEach((e=>{this._vertical?e.setHLine(e._userData,0,t):e.setVLine(e._userData,0,t)}))}$_resetMarker(t,e,i,s,r){const n=this._markerSize,o=isNaN(this._value),a=this.model.getPosition(this._value);let h,l;a>1&&console.log(this.model.getPosition(this._value)),this._marker.setBoolData("null",o),i?(h=s?t-n+1:n-1,l=(o?r?0:1:r?a:1-a)*(e-this._nullSize)+(r?this._nullSize:0)):(h=(o?r?1:0:r?1-a:a)*(t-this._nullSize)+(r?0:this._nullSize),l=s?e-n+1:n),this._marker.trans(h,l)}$_layoutBar(t,e,i){const s=this._vertical,r=this._reversed,n=this._inverted,o=this._tickLabelLayer,a=this._tickLabelSize,h=this._markerSize,l=this._tickLen,c=this._stepCount,d=t?t.getGap():0,_=((s?i:e)-d)/(c+(t?1:0)),u=this._nullSize=t?_+d:0;let p=e,g=i,m=0,f=0,b=0,y=0;if(s?(m+=r?a:h,p-=h,y=n?f+u:f,a>0&&(r?o.trans(0,y):o.trans(e-a+1,y),this._tickLabels.forEach(((t,e,i)=>{t.trans(r?a-t.bbox().width-1:0,(n?e:i-1-e)*_-t.bbox().height/2)})),p-=a),p-=l,r&&(m+=l),b=m):(f+=r?a:h,g-=h,b=n?m:m+u,a>0&&(r?o.trans(b,0):o.trans(b,i-a),this._tickLabels.forEach(((t,e,i)=>{t.trans((n?i-1-e:e)*_-t.bbox().width/2,0)})),g-=a),g-=l,r&&(f+=l),y=f),this._boxLayer.setBounds(b,y,p,g),1===this._boxes.count?s?this._boxes.get(0).setBounds(0,0,p,g-u):this._boxes.get(0).setBounds(0,0,p-u,g):this._boxes.forEach(((t,e,i)=>{s?t.setBounds(0,(n?e:i-1-e)*_,p,_):t.setBounds((n?i-1-e:e)*_,0,_,g)})),this._splitLayer.visible&&(this._splitLayer.trans(b,y),this.$_layoutSplits(p,g)),this._tickLineLayer.visible&&(s?(r?m-=l:m+=p,this._tickLineLayer.trans(m,y)):(r?f-=l:f+=g,this._tickLineLayer.trans(b,f)),this.$_layoutTickLines(l)),t){let e=_,i=_,r=m,a=f;s?(m=this._boxLayer.tx,r=o.tx,e=p,f=n?0:g-_,a=f+Math.max(0,(i-this._nullLabel.bbox().height)/2)):(f=this._boxLayer.ty,a=o.ty,i=g,n&&(m=p-u),r=Math.max(m,m+(_-this._nullLabel.bbox().width)/2)),t.options.color&&this._nullBar.setFill(t.options.color),this._nullBar.setBounds(m+.5,f+.5,e-1,i-1),this._nullLabel.trans(r,a)}else this._nullSize=0;this.$_resetMarker(e,i,s,r,n)}}Eh.SCALE_CLASS="rm-color-scale",Eh.SCALE_FILL="rm-color-scale-fill",Eh.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},Eh.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Eh.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},Eh.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class Th extends Mt{constructor(t,e,i){super(t,Th.STYLE),this.add(this._back=new Ai(t,Th.BACK_STYLE)),this.add(this._textView=new ke(t)),i&&this.dom.classList.add(i),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(t,e){this.internalSetStyleOrClass(e),this._textView.layout=Ce.MIDDLE,this._textView.layoutText();const i=this._textView.bbox(),s=getComputedStyle(this._back.dom),r=(new mt).applyPadding(s);t?(this._back.rect={x:0,y:0,width:t.width,height:t.height},this._textView.trans(t.width/2,t.height/2-1)):(this._textView.trans(r.left+i.width/2,r.top+i.height/2-1),this._back.rect={x:0,y:0,width:i.width+r.left+r.right,height:i.height+r.top+r.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}Th.STYLE="rm-button",Th.BACK_STYLE="rm-button-background";class Vh extends Th{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class Dh extends Bo{}class Rh extends Dh{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new Vh(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new Vh(t,"+",(()=>this.chart().body.zoomByFactor(this.model.getZoomFactor())))),this.add(this._btnDec=new Vh(t,"-",(()=>this.chart().body.zoomByFactor(-this.model.getZoomFactor()))))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,i,s){const r=this.chart().body.zoom,n=this._szBtn=e.getButtonSize(),o=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.options.showReset)?3:2;let h=0,l=0;return this._btnHome.setBoolData(ii,r<=100),this._btnDec.setBoolData(ii,r<=100),(this._vertical=e.vertical)?(h=n.width,l+=a*n.height+(a-1)*o):(l=n.height,h+=a*n.width+(a-1)*o),{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 $h extends Dh{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 i=0;i<e.count-1;i++)if(e.get(i).containsDom(t))return this.model.chart.drillup(e.get(i+1)[ei]),!0}_doMeasure(t,e,i,s){let r=this._btnBack,n=0,o=0;if("text"===e.options.type){null==r||r.remove(),this._textViews||(this._textViews=new Yo(this,ke,"rm-drilldown-text"),this._seperators=new Yo(this,ke,"rm-drilldown-separator"));const t=e.chart.firstVisible,i=this._history=t.getHistory();this._textViews.prepare(i.length,((t,e)=>{t.text=i[e].displayName(),t.anchor=Se.START,t[ei]=i[e]})),this._seperators.prepare(i.length-1,(t=>{t.text=">",t.anchor=Se.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),r||this.add(r=this._btnBack=new Vh(t,"<",(()=>{e.chart.drillup()}))),r.layout();const i=r.bbox();n=i.width,o=i.height}return{width:n,height:o}}_doLayout(t){if("text"===this.model.options.type){const t=this.model.options.itemGap,e=this._history;let i=0;for(let s=0;s<e.length;s++){const r=this._textViews.get(s);r.setBoolData("history",s<e.length-1),r.transX(i),s<e.length-1&&(i+=r.bbox().width+t,this._seperators.get(s).transX(i),i+=this._seperators.get(s).bbox().width+t)}}}}class Oh extends Wo{constructor(t){super(t,Oh.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new At(t);this.add(e),e.add(this._bubbleLayer=new At(t)),e.add(this._lineLayer=new At(t)),e.add(this._labelLayer=new At(t))}_doMeasure(t,e,i,s){const r=e.chart,n=this._steps=e.getSteps(r.width,r.height),o=n.map((t=>t.rd)).reduce(((t,e)=>Math.max(t,e)));let a=0,h=0;return this._checkTitle(t)&&(this._inTitle?a+=this._rTitle.width:h+=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?a+=this._rFooter.width+this._gapFooter:h+=this._rFooter.height+this._gapFooter),this.$_prepareBubbles(t,e,n),this.$_layoutBubbles(2*o,n),this._rScale=this._scaleLayer.bbox(),a+=this._rScale.width,h+=this._rScale.height,{width:a,height:h}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible)if(this._inTitle){switch(d=g,t.title.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.options.align){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(this._scaleLayer.trans(p-n.x,g-n.y),i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.options.align){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}$_prepareBubbles(t,e,i){const s=e.tick,r=i.length;Mt.fit(t,this._bubbleLayer,this._bubbles,r,Ua,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&Mt.fit(t,this._lineLayer,this._lines,r,la,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&Mt.fit(t,this._labelLayer,this._labels,r,Ro,"rm-bubble-scale-label")}$_layoutBubbles(t,e){const i=this.model,s=t/2;if(this._bubbles.forEach(((i,r)=>{const n=e[r];i.internalResetStyleOrClass(null),i.setCircle(s,t-n.rd,n.rd)})),this._lineLayer.visible){const r=2*s+(i.tick.line.options.length||0);this._lines.forEach(((i,n)=>{const o=e[n];i.setHLine(t-2*o.rd,s,r)}))}if(this._labelLayer.visible){const r=2*s+i.tick.line.options.length+(i.tick.label.options.offset||0);this._labels.forEach(((s,n)=>{const o=e[n];s.setText(i.tick.label.getText(o.label)),s.trans(r,t-2*o.rd-s.bbox().height/2)}))}}}Oh.SCALE_CLASS="rm-bubble-scale";class Fh extends Wo{constructor(t){super(t,Fh.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}Fh.SCALE_CLASS="rm-map-scale";class Bh extends At{constructor(t){super(t,"rm-mapregion-body"),this._seriesViews=[],this._seriesMap={},this.add(this._seriesContainer=new At(t,"rm-mapregion-body-series")),this.add(this._labelsContainer=new At(t,"rm-mapregion-body-labels"))}prepare(t,e,i){const s=e.chart,r=s.map;if(r){const{h1:i,h2:n}=r,o=e.scroll%360;this._h1=i+o,this._h2=n,this.$_prepareSeries(t,s,o),this._seriesViews.forEach((e=>{e.prepareLayout(t)}))}}layout(t,e){const i=t.chart,s=i.map,r=this.width,n=this.height;if(s){const{wMap:e,hMap:s,scale:o,tx:a,ty:h}=t.prepareLayout(this.width,this.height);this._transformInfo={tx:a,ty:h,scale:o,vx:0,vy:0};const l=`translate(${a}px, ${h}px) scale(${o}, ${-o})`,c=e*o,d=s*o;this._seriesViews.forEach((t=>{var e,i;t._scale=o,t.model.needMapScale()?(t._pointLayer.internalSetStyle("transform",l),t._calloutContainer.visible&&t._calloutContainer.internalSetStyles({transform:l})):t.trans(a,h),t.move(a,h),t.resize(c,d),t.render(r,n,this._transformInfo),null===(e=t._labelContainer)||void 0===e||e.trans(a,h),null===(i=t.secondLabelContainer())||void 0===i||i.trans(a,h)})),i.getProjection()}const o=this._clip;o&&o.parent&&o.width===r&&o.height===n||(o&&o.dom.remove(),this._clip=this.clipRect(0,0,r,n))}$_prepareSeries(t,e,i){const s=e.visibleSeries,r=this._seriesMap,n=this._seriesViews,o=this._h1,a=this._h2;n.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),n.length=0,s.forEach((e=>{const s=!r[e.hash],h=r[e.hash]||vh(t,e);h.parent||(h.$_setInRegion(),this._seriesContainer.add(h),this._labelsContainer.add(h._labelContainer),this._labelsContainer.add(h.secondLabelContainer())),r[e.hash]=h,n.push(h),h._h1=o,h._h2=a,s&&(e._optionsDirty=!0),h.prepareModel(t,e,i)}))}}class zh extends zo{constructor(t){super(t,zh.CLASS_NAME,"rm-mapregion-background"),this.add(this._bodyView=new Bh(t)),this.add(this._targetView=new Ai(t,"rm-mapregion-target")),this.add(this._connectorView=new Nt(t,"rm-mapregion-connector"))}update(t,e){this.measure(this.doc,this.model,t,e),this._layoutView(0,0,t,e,this._rTarget)}_layoutView(t,e,i,s,r){this._rTarget=r,this.resizeByMeasured(),this.layout(this.model.getPosition(t,e,i,s,this.width,this.height))}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return isNaN(r.width)&&(isNaN(r.height)?r.width=fo.defaults.width:r.width=r.height),isNaN(r.height)&&(r.height=r.width),this._deflatePaddings(r),r}_doLayout(t){const e=this._rTarget,i=t.x||0,s=t.y||0;this.trans(i,s),this._background.resize(this.width,this.height),e.x-=i,e.y-=s,this._targetView.setRect(e),this._connectorView.setPath(this.$_getConnector(e)),this._bodyView.resize(this.width-1,this.height-1),this._bodyView.prepare(this.doc,this.model,this.chart().body),this._bodyView.layout(this.model,this.chart().body)}$_getConnector(t){const e=0+this.width,i=0+this.height;let s;return s=0>t.x?i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[0,0,t.x+t.width,t.y,0,i,t.x+t.width,t.y+t.height]:i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[e,0,t.x,t.y,e,i,t.x,t.y+t.height],`M ${s[0]} ${s[1]} L ${s[2]} ${s[3]} M ${s[4]} ${s[5]} L ${s[6]} ${s[7]}`}}zh.CLASS_NAME="rm-mapregion";class jh extends jo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new Ph(t,!1)),this.add(this.subtitleView=new Ph(t,!0))}_doMeasure(t,e,i,s){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,u=i,p=0,m=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,i,s),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,i,s),c=this._hSub=o.height,l=this._wSub=o.width,m=+n.options.titleGap||0):d.setModel(n),n.options.position){case"left":case"right":p=_(h,c),u=a+m+l;break;default:p=h+m+c,u=_(u,a+l)}return p>0&&(p+=this.titleView.visible?g(r.options.gap,0):g(n.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.options,o=r&&r.options,a=s&&s.visible?this._wTitle>t.wMap||"chart"===n.alignBase?t.wChart:t.wMap:0,h=r&&r.visible?this._wSub>t.wMap||"chart"===o.alignBase?t.wChart:t.wMap:0;let l=this._wTitle>t.wMap||s&&"chart"===n.alignBase?0:t.xMap,c=this._wSub>t.wMap||r&&"chart"===o.alignBase?0:t.xMap;if(a>0&&h>0){const t=(t,e,i)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},d=()=>{const e=_(this._hTitle,this._hSub);f=_(f,f+t(s,e,this._hTitle)),y=_(y,y+t(r,e,this._hSub))},u=(t,e,i)=>{switch(t.options.align){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},p=()=>{if(b=_(b,b+u(s,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":w=b;break;case"right":w=b+this._wTitle-this._wSub;break;default:w=b+(this._wTitle-this._wSub)/2}else w=_(w,w+u(r,h,this._wSub))},m=g(o.titleGap,0);let f=0,b=l,y=0,w=c;switch(n.align){case"left":switch(o.position){case"left":b=w+this._wSub+m,d();break;case"right":switch(w=b+this._wTitle+m,o.align){case"center":w=_(w,w+(h-this._wTitle-this._wSub)/2);break;case"right":w=_(w,c+h-this._wSub)}d();break;case"top":p(),f=y+this._hSub+m;break;default:p(),y=f+this._hTitle+m}break;case"right":switch(o.position){case"left":switch(b+=a-this._wTitle,o.align){case"center":w+=(a-this._wTitle-this._wSub)/2;break;case"right":w=b-m-this._wSub}d();break;case"right":w+=h-this._wSub,b=w-m-this._wTitle,d();break;case"top":p(),f=y+this._hSub+m;break;default:p(),y=f+this._hTitle+m}break;default:switch(o.position){case"left":switch(b+=(a-this._wTitle)/2,o.align){case"left":break;case"center":w+=(b-w-this._wSub)/2;break;case"right":w=b-m-this._wSub}d();break;case"right":switch(b+=(a-this._wTitle)/2,o.align){case"left":w=b+this._wTitle+m;break;case"center":w=b+this._wTitle+m,w+=(h-w-this._wSub)/2;break;case"right":w+=h-m-this._wSub}d();break;case"top":p(),f=y+this._hSub+m;break;default:p(),y=f+this._hTitle+m}}e.resizeByMeasured().layout().trans(b,f),i.resizeByMeasured().layout().trans(w,y)}else if(a>0||h>0){const t=a?s:r,n=a?e:i,o=a||h,d=a?this._wTitle:this._wSub;let _=a?l:c;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":_+=o-d;break;default:_+=(o-d)/2}n.trans(_,0)}}_doLocateInner(t,e,i){}}class Gh extends Wo{constructor(t){super(t,Gh.GROUP_CLASS,"rm-map-widget-group-background"),this._dic=new Map,this.add(this._widgetLayer=new At(t,"rm-map-widget-group-widget-layer"))}getView(t){return this._dic.get(t)}_doMeasure(t,e,i,s){const r=this._vertical=e.isVertical(),n=this._gap=8,o=this._views=this.$_preapreViews(t,e._internalWidgets()),a=new Fo;return this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),o.forEach(((r,n)=>{r.measure(t,e.getWidget(n),i,s),this._dic.set(r.model,r)})),r?(o.forEach((t=>{a.width=Math.max(a.width,t.mw),a.height+=t.mh})),o.length>1&&(a.height+=(o.length-1)*n)):(o.forEach((t=>{a.height=Math.max(a.height,t.mh),a.width+=t.mw})),o.length>1&&(a.width+=(o.length-1)*n)),this._titleView.visible&&(this._inTitle?a.width+=this._rTitle.width:a.height+=this._rTitle.height),this._footerView.visible&&(this._inFooter?a.width+=this._rFooter.width+this._gapFooter:a.height+=this._rFooter.height+this._gapFooter),a}_doLayout(t){const e=this.model,i=this._titleView,s=this._footerView,r=this._margins,n=this._paddings,o=this._gap,a=this._views,h=this._rTitle,l=this._rFooter,c=r.left+n.left,d=r.top+n.top;let _,u,p=this.width-c-r.right-n.right,g=this.height-d-r.bottom-n.bottom,m=c,f=d;if(i.visible){if(this._inTitle){switch(u=f,e.title.options.verticalAlign){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}i.trans(m,u),m+=this._rTitle.width}else{switch(e.title.options.align){case"center":_=Math.max(m,m+(p-h.width)/2);break;case"right":_=Math.max(m,m+p-h.width);break;default:_=m}i.trans(_,f),f+=this._rTitle.height}if(s.visible){if(this._inFooter)switch(_=c+p-this._rFooter.width,u=f,e.footer.options.verticalAlign){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}else switch(u=d+g-l.height,e.footer.options.align){case"center":_=Math.max(m,m+(p-l.width)/2);break;case"right":_=Math.max(m,m+p-l.width);break;default:_=m}s.trans(_,u)}}this._widgetLayer.trans(m,f),m=f=0,a.forEach((e=>{e.resizeByMeasured(),e.layout(t)})),h&&(this._inTitle?p-=h.width:g-=h.height),l&&(this._inFooter?p-=l.width:g-=l.height),this._vertical?a.forEach((t=>{switch(t.model.options.align){case"left":break;case"right":m=Math.max(0,p-t.mw);break;default:m=Math.max(0,(p-t.mw)/2|0)}t.trans(m,f),f+=t.mh+o})):a.forEach((t=>{switch(t.model.options.verticalAlign){case"top":break;case"bottom":f=Math.max(0,g-t.mh);break;default:f=Math.max(0,(g-t.mh)/2|0)}t.trans(m,f),m+=t.mw+o}))}$_preapreViews(t,e){const i=this._widgetLayer,s=this._views,r=[];return this._dic.clear(),e.forEach((e=>{let n=null==s?void 0:s.find((t=>t.model===e));n?(r.push(n),s.splice(s.indexOf(n),1)):(n=new(Hh[e._type()])(t),i.add(n),r.push(n))})),null==s||s.forEach((t=>t.remove())),r}}Gh.GROUP_CLASS="rm-map-widget-group";const Hh={legend:Uo,colorScale:Eh,bubbleScale:Oh,group:Gh};class Wh extends jo{constructor(t,e){super(t),this._loc=e,this._horz=e==q.TOP||e==q.BOTTOM,this._vert=e==q.LEFT||e==q.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){let e=this._views.get(t);if(!e)for(const i of this._views.values())if(i instanceof Gh&&(e=i.getView(t),e))break;return e}_setWidgets(t,e,i){return s(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof Uo&&e.legendByDom(t);if(i)return i}}_doMeasure(t,e,i,s){const r=this._prepareViews(t,i,s);if(!this.setVisible(r.size>0))return;const n=this._gap=g(+e.chartOptions.options.widgetGap,0),o=new Fo;return this._horz?(r.forEach((t=>{o.width+=t.mw,o.height=_(o.height,t.mh)})),o.width+=r.size>0?(r.size-1)*n:0):this._vert?(r.forEach((t=>{o.width=_(o.width,t.mw),o.height+=t.mh})),o.height+=r.size>0?(r.size-1)*n:0):r.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(t){function e(t){return t.length>1?s*(t.length-1):0}const i=this._views,s=this._gap;let r=this.width,n=this.height,o=0,a=0;if(i.forEach((t=>{t.resizeByMeasured(),t.layout()})),this._vert){let t=0,i=0,r=0;for(const e of this._starts)t+=e.height;t+=e(this._starts);for(const t of this._ends)i+=t.height;i+=e(this._ends);for(const t of this._centers)r+=t.height;r+=e(this._centers);for(const t of this._starts)t.trans(o,a),a+=t.height+s;n-=t,a=n;for(const t of this._ends)a-=t.height,t.trans(o,a),a-=s;n-=i,a=t+Math.max(0,Math.ceil((n-r)/2));for(const t of this._centers)t.trans(o,a),a+=t.height+s}else if(this._horz){let t=0,i=0,n=0;for(const e of this._starts)t+=e.width;t+=e(this._starts);for(const t of this._ends)i+=t.width;i+=e(this._ends);for(const t of this._centers)n+=t.width;n+=e(this._centers);for(const t of this._starts)t.trans(o,a),o+=t.width+s;r-=t,o=r;for(const t of this._ends)o-=t.width,t.trans(o,a),o-=s;r-=i,o=t+Math.max(0,Math.ceil((r-n)/2));for(const t of this._centers)t.trans(o,a),o+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=s.options,n=i.mw,o=i.mh;let a=+r.offsetX||0,h=0,l=0;switch(r.align){case"right":h+=t-n-a;break;case"center":h+=(t-n)/2+a;break;default:h+=a}switch(a=+r.offsetY||0,r.verticalAlign){case"bottom":l+=e-o-a;break;case"middle":l+=(e-o)/2+a;break;default:l+=a}i.trans(h,l).resize(n,o),i.layout()}))}_prepareViews(t,e,i){const s=this._views,r=new Map;this._starts=[],this._ends=[],this._centers=[],this._models.forEach((e=>{let i=s.get(e);i?(r.set(e,i),s.delete(e)):(i=new(Hh[e._type()])(t),r.set(e,this.add(i)))}));for(const t of s.values())t.remove();return r.forEach(((s,r)=>{if(s.measure(t,r,e,i),this._horz)switch(r.options.align){case"left":this._starts.push(s);break;case"right":this._ends.push(s);break;default:this._centers.push(s)}else if(this._vert)switch(r.options.verticalAlign){case"top":this._starts.push(s);break;case"bottom":this._ends.push(s);break;default:this._centers.push(s)}})),this._views=r}}class Yh extends Bo{constructor(t){super(t,"rm-credits"),this.add(this._textView=new ke(t)),this._textView.anchor=Se.START}click(t){this.model.options.url&&window.open(this.model.options.url,"new")}locateInner(t,e){const i=this.width,s=this.height,r=+t.offsetX||0,n=+t.offsetY||0;let o=0,a=0;switch(t.verticalAlign){case"bottom":a=e.bottom-s;break;case"middle":a=e.y+(e.height-s)/2+n;break;default:a=e.y+n}switch(t.align){case"right":o=e.right-i-r;break;case"center":o=e.x+(e.width-i)/2+r;break;default:o=e.x+r}return{x:o,y:a}}locateOuter(t,e,i){const s=t.location,r=this.width,n=this.height,o=+t.offsetX||0,a=+t.offsetY||0;let h=0,l=0;switch(s){case"left":h=o;break;case"right":h=e-r-o;break;case"top":l=a;break;default:l=i-n-a}if("left"===s||"right"===s)switch(t.verticalAlign){case"top":l=a;break;case"bottom":l=i-n;break;default:l=(i-n)/2+a}else switch(t.align){case"left":h=o;break;case"center":h=(e-r)/2+o;break;default:h=e-r-o}return{x:h,y:l}}_doMeasure(t,e,i,s){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.bbox()}}class Zh extends At{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this._mapRegionViews=[],this._mapRegionMap=new Map,this.add(this._annotationContainer=new At(t,"rm-annotations")),this.add(this._bodyView=new Ah(t,this)),this.add(this._mapRegionContainer=new At(t,"rm-mapregions")),this.add(this._titleSectionView=new jh(t)),this.add(this._widgetLayer=new At(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new At(t,"rm-front-annotations")),this.add(this._zoomPanelView=new Rh(t)),this.add(this._drilldownPanelView=new $h(t)),this.add(this._mapScaleView=new Fh(t)),this.add(this._creditView=new Yh(t)),this.add(this._tooltipView=new Nh(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}getWidgetViews(t,e){return this._widgetMap[t],[]}measure(t,e,i,s){const r=(this._model=e)._credits,n=this._bodyView;let o,a=e.width=i,h=e.height=s;if(this._creditView.setVisible(r.visible)){const e=r.options;switch(o=this._creditView.measure(t,r,a,h),e.location){case"body":break;case"right":case"left":a-=o.width+(+e.offsetX||0)+(+e.gap||0);break;default:h-=o.height+(+e.offsetY||0)+(+e.gap||0)}}o=this._titleSectionView.measure(t,e,a,h),h-=o.height,n.prepare(t,e.body);const l=e._collectWidgets();for(const r of Object.values(q)){const n=l[r];let o=this._widgetMap[r];if(n.length>0){o?o.setVisible(!0):(o=new Wh(t,r),this._widgetLayer.add(o),this._widgetMap[r]=o);const l=o._setWidgets(n,i,s).measure(t,e,a,h);if(l){const t=e.chartOptions.getWidgetSectionGap(r);r===q.BOTTOM||r===q.TOP?h-=l.height+t:r!==q.RIGHT&&r!==q.LEFT||(a-=l.width+t)}}else o&&o.setVisible(!1)}n.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this.$_prepareMapRegions(t,e.getMapRegions()),this._mapRegionViews.forEach(((e,r)=>{e.measure(t,this._mapRegions[r],i,s)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,a,h),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,a,h)}layout(){const t=this._model,e=this.width,i=this.height;let s=e,r=i;const n=this._bodyView;let o=0;t.legend;const a=t._credits,h=this._creditView;let l=0,c=0,d=0;if(h.visible){const t=a.options;h.resizeByMeasured();const e=h.width+(+t.offsetX||0)+(+t.gap||0),i=h.height+(+t.offsetY||0)+(+t.gap||0);switch(a.options.location){case"body":break;case"right":s-=e;break;case"left":s-=e,c+=e;break;case"top":r-=i,d+=i;break;default:r-=l=i}}const _=this._titleSectionView;_.visible&&(_.resizeByMeasured(),_.layout({xMap:c,wMap:s,wChart:e}).trans(0,d),d+=_.height,r-=o=_.height);const u=this._widgetMap;for(const n in u){const o=u[n];if(o.visible){n===q.RIGHT||n===q.LEFT?(o.resize(o.mw,i),o.layout()):n===q.TOP||n===q.BOTTOM?(o.resize(e,o.mh),o.layout()):o.resize(o.mw,o.mh);const a=t.chartOptions.getWidgetSectionGap(n);switch(n){case q.BOTTOM:r-=o.height+a;break;case q.TOP:r-=o.height+a,d+=o.height+a;break;case q.RIGHT:s-=o.width+a;break;case q.LEFT:s-=o.width+a,c+=o.width+a}}}const p=ct.create(c,d,s,r);if(h.visible){const t=a.options,s="body"===t.location?h.locateInner(t,p):h.locateOuter(t,e,i);h.transp(s)}n.trans(p.x,p.y),n.resize(p.width,p.height),n.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,p)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,p));for(const t in u){const s=u[t];if(s.visible)if("body"===t)s.locateInner(p.width,p.height).trans(p.x,p.y);else{switch(t){case q.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case q.TOP:d=o+0,c=(e-s.width)/2;break;case q.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case q.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this.$_layoutMapRegions(e,i,p),this._tooltipView.close(!0,!1)}showTooltip(t,e,i,s){const{x:r,y:n}=e.tooltipPos?e.tooltipPos():{x:s.x,y:s.y},o=this._model.chart._tooltip.isFollowPointer(t),a=(o?s.x:r)-this.tx,h=(o?s.y:n)-this.ty;this._tooltipView.show(t,e,a,h,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){for(const e in this._widgetMap){const i=this._widgetMap[e].legendByDom(t);if(i)return i}}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getWidgetView(t){for(const e in this._widgetMap){const i=this._widgetMap[e].getView(t);if(i)return i}}getScaleView(t){return this.getWidgetView(t)}pointerMoved(t,e,i){this._bodyView.pointerMoved(t,e,i)}click(t,e,i){var s;if(this._model.canClick()){const r=Object.assign({},this.control.pointerToPoint(t)),n=this._bodyView.mouseToMap(r,!1);let o;i instanceof lh&&(o=null===(s=i.areaOfDom(e))||void 0===s?void 0:s.model),o||(o=this._model.map.findByCoord(n)),r.coord=n,r.area=null==o?void 0:o.id,r.chart=this._model.wrapper,this._model.click(r)}}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(){}onScrollStart(){this.bodyView().onScrollStart()}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>{r.get(t.model)||t.remove()})),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Sh(t,e);(!1===e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,i){const s=this.control._padding;let r,n,o,a;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)r=-s.left,n=-s.top,o=t+s.left+s.right,a=e+s.top+s.bottom;else r=n=0,o=t,a=e;i._layoutView(this,r,n,o,a)}))}$_prepareMapRegions(t,e){const i=this._mapRegionContainer,s=this._mapRegionMap,r=this._mapRegionViews;for(const t of s.keys())e.indexOf(t)<0&&s.delete(t);r.forEach((t=>{s.get(t.model)||t.remove()})),r.length=0,(this._mapRegions=e).forEach((e=>{const n=s.get(e)||new zh(t);i.add(n),s.set(e,n),r.push(n)}))}$_layoutMapRegions(t,e,i){const s=this._bodyView,r=this.tx+s.tx,n=this.ty+s.ty,o=this.control._padding;let a,h,l,c;this._mapRegionViews.forEach((i=>{const d=i.model.options,_=s.boundsByCoord(d.bounds[0],d.bounds[1]);if("container"===d.scope)a=-o.left,h=-o.top,l=t+o.left+o.right,c=e+o.top+o.bottom;else a=h=0,l=t,c=e;_.x+=r,_.y+=n,i._layoutView(a,h,l,c,_)}))}$_layoutPanel(t,e){const i=t.model.options,s=i.offsetX||0,r=i.offsetY||0,n=t.width,o=t.height;let a=e.x,h=e.y;switch(i.verticalAlign){case"bottom":h+=e.height-r-o;break;case"middle":h+=(e.height-o)/2+r;break;default:h+=r}switch(i.align){case"right":a+=e.width-s-n;break;case"center":a+=(e.width-n)/2+s;break;default:a+=s}t.trans(a,h)}}var Uh;!function(t){t.EXPORT="$$realmap_export"}(Uh||(Uh={}));class Xh extends kt{constructor(t,e){super(t,e),this.addElement(this._chartView=new Zh(t)),this.addElement(this._loadingView=new Io(t)),this.addElement(this._errorView=new ke(t,"rm-error-view")),this._loadingView.visible=!1,this._errorView.visible=!1}_initControl(t,e,i){super._initControl(t,e,i),this._chart=new Ao(null,((t,e)=>{this.changeModel(t,e)}))}_doPointerDown(t){return this.chart.exporter.contains(t.target)||this.chart.exporter.hideContextMenu(),super._doPointerDown(t)}onModelChanged(t,e,i){this.invalidateLayout()}onDataChanged(t,e){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,i,s){s&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(i)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,i){const s=this._chartView.bodyView();i?s.showSeries(e):s.hideSeries(e)}onExportRequest(t,e){this._export(e)}onPointToMap(t,e,i){return this._chartView.bodyView().mouseToMap({x:e,y:i},!1)}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.clearDefs(),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===Uh.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}showErrorView(t="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=Ce.MIDDLE,this._errorView.text=t,this._errorView.stain();const{width:e,height:i}=this._errorView.bbox(),s=16+e/2,r=16+i/2;this._errorView.trans(s,r)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new Oo(this)}_doBeforeRender(t){var e,i;(null===(i=null===(e=this._chart)||void 0===e?void 0:e.options)||void 0===i?void 0:i.chart)&&t.internalResetStyleOrClass(this._chart.options.chart.style)}_doRender(t){var e;const i=this.model,s=this._chartView,r=t.width,n=t.height;if(this.$_renderLoadingView(r,n),i.options.chart&&(this._setBackgroundStyle(i.options.chart.backgroundStyle),i&&(this.setDomResize(i.chartOptions.options.domResize),i.prepareRender(),this._loadModules()),this.loaded||s.clean(),s.measure(this.doc(),i,r,n),s.setRect(t),s.layout(),i&&i.afterRender(),null===(e=this._chart)||void 0===e?void 0:e._loadCallback)){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_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 i=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(i,t,e.options.exporting)}}$_renderLoadingView(t,e){const i=Xh.LOADING_VIEW_LENGTH;this._loadingView.layout({width:i,height:i});const s=t/2+20-i/2,r=e/2+20-i/2;this._loadingView.trans(s,r)}}Xh.LOADING_VIEW_LENGTH=128;const Kh={chartControl:Xh};class qh{static getVersion(){return"1.1.0"}static setLicenseKey(t){yt.code=t}static setDebugging(t){Mt.DEBUGGING=t}static setLogging(t){nt.LOGGING=t}static getDistance(t,e){return nt.getDistance(t,e)}static setGlobals(t){Object.assign(Kh,t)}static createChart(t,e,s,r=!0,n){x.loadConfigAsync(s,!0);const o=new Kh.chartControl(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[Mo]=o,o.chart}static async createChartAsync(t,e,s,r=!0,n){const o=new Kh.chartControl(t,e);o.chart[Mo]=o;try{o.showLoadingView(),await x.loadConfigAsync(s),i(s)&&o.chart.load(s,r,n)}catch(t){console.error(t),o.showErrorView(null==t?void 0:t.message)}finally{o.hideLoadingView()}return o.chart}static preset(t,e){return gr.createStockInset(t,e)}}class Jh{constructor(){this._moduleMap=new Map}static getInstance(){return Jh.instance||(Jh.instance=new Jh),Jh.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}Jh.instance=null,Jh.ModuleNames={realchart:"realchart"};const Qh=qh.getVersion,tl=qh.setDebugging,el=qh.setLogging,il=qh.setGlobals,sl=qh.getDistance,rl=qh.createChart,nl=qh.createChartAsync,ol=qh.preset,al=qh.setLicenseKey;export{pi as Annotation,Ko as AnnotationView,Ci as BandSeriesType,hn as BarSeries,So as Body,Ah as BodyView,ps as BubbleSeries,$r as ChartAnnotationType,Xh as ChartControl,Bo as ChartElement,Fe as ChartItem,ko as ChartObject,Zh as ChartView,Ua as CircleElement,bn as CircleGauge,Pn as ClockGauge,ve as Color,Ss as ColorRanger,es as CoordBaseSeries,Qe as Credits,P as DEG_RAD,Ri as DataPoint,Fi as DataPointLabel,Ct as Dom,Eo as DragTracker,Yo as ElementPool,Ds as Exporter,Jh as ExternalModuleManager,bi as FeatureSeriesType,En as FigureSeries,Mi as GLPointSeriesType,wi as HeatmapSeriesType,zr as HtmlAnnotation,jr as ImageAnnotation,Po as ImageElement,Dn as ImageSeries,At as LayerElement,xs as Legend,la as LineElement,Fn as LineSeries,Lr as MapArea,Xs as MapAxis,Ws as MapAxisBandGuide,Gs as MapAxisGuide,Hs as MapAxisLineGuide,Ys as MapAxisRangeGuide,Ao as MapChart,Us as MapCrosshair,Yn as MapSeries,fi as MapSeriesType,Oo as MapTool,ss as MarkerSeries,is as MarkerSeriesPoint,va as MarkerSeriesPointView,Sa as MarkerSeriesView,A as ORG_ANGLE,hs as OrthogonalSparkSeries,k as PI,M as PI_2,Jn as PanelSeries,Nt as PathElement,eo as PieSeries,ro as PinSeries,ba as PointElement,ua as PointLabelView,ao as PointSeries,_a as PointViewPool,ca as PolyLineElement,I as RAD_DEG,Ai as RectElement,xi as RegionSeriesType,Mt as RmElement,co as RouteSeries,mi as RouteSeriesType,ki as SankeySeriesType,jo as SectionView,ja as SectorElement,qi as Series,Ta as SeriesAnimation,xa as SeriesView,Gr as ShapeAnnotation,Fo as Size,os as SparkSeries,Dr as Subtitle,Li as TableSeriesType,Se as TextAnchor,Hr as TextAnnotation,ke as TextElement,Ce as TextLayout,vi as TiledWebSeriesType,Vr as Title,Si as TrackSeriesType,nt as Utils,Qi as ValuePoint,ts as ValueSeries,yi as VectorSeriesType,uo as WaffleSeries,rt as _isIE,u as absv,h as assignObj,G as calcPercent,p as copyObj,l as cos,rl as createChart,nl as createChartAsync,at as createRect,$e as extend,E as fixnum,sl as getDistance,Qh as getVersion,y as incv,s as isArray,lt as isEmptyRect,i as isObject,n as isString,_ as maxv,d as minv,j as parsePercentSize,g as pickNum,f as pickProp,b as pickProp3,D as pixel,ol as preset,ht as rectToSize,tl as setDebugging,il as setGlobals,al as setLicenseKey,el as setLogging,c as sin};
7
+ const t="http://www.w3.org/2000/svg",e=Object.prototype.hasOwnProperty,i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},s=Array.isArray,r=function(t){return"function"==typeof t},n=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t},a=function(t){return"boolean"==typeof t},h=Object.assign,l=Math.cos,c=Math.sin,d=Math.min,_=Math.max,u=Math.abs,p=function(t){if(t&&"object"==typeof t&&!s(t))return h({},t)},g=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},m=function(t,e,i){let s=parseFloat(t);return isNaN(s)?(s=parseFloat(e),isNaN(s)?parseFloat(i):e):t},f=function(t,e){return void 0!==t?t:e},b=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},y=(t,e,i)=>t+(e-t)*i;class w{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}w._debugging=!1;class x{static async loadConfigAsync(t,e=!1){if(t&&t.map){if(n(t.map))t.map={url:t.map};else if(s(t.map))for(let e=0;e<t.map.length;e++)n(t.map[e])&&(t.map[e]={url:t.map[e]});const r=s(t.map)?t.map:[t.map];for(const t of r)!i(t.source)&&n(t.url)&&t.url&&(e?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url))}if(t&&t.series){const o=s(t.series)?t.series:[t.series];for(const t of o)if(!i(t.data)&&!s(t.data)&&n(t.dataUrl)&&t.dataUrl)if(e)console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl);else{const e=await this.fetchJson(t.dataUrl);delete t.dataUrl,s(e)&&r(t.dataFilter)?t.data=e.filter(t.dataFilter):t.data=e}}}static async fetchJson(t){try{const e=await fetch(t);if(!e.ok){const i=new Error(`HTTP error! status: ${e.status}`);throw i.name="NetworkError",i.message=`데이터 요청에 실패했습니다. URL을 확인하세요: ${t}`,i}return await e.json()}catch(t){if("NetworkError"===t.name)throw t;throw t.name="ParsingError",t.message="JSON 데이터를 파싱하는 중 오류가 발생했습니다.",t}}}const v={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 S=v.ko;const C=void 0,L="%".charCodeAt(0),P=Math.PI,M=2*P,k=-P/2,A=P/180,I=180/P;function N(t){return t>M?t%M:t}const V=Math.floor,E=Math.ceil;function T(t){return parseFloat(t.toPrecision(12))}function D(t){return t*Math.PI/180}function R(t){return 180*t/Math.PI}function $(t){return t+"px"}function O(t){return t+"%"}function F(t){return null==t||Number.isNaN(t)||""===t}function B(t){return null==t||Number.isNaN(t)||""===t}function z(t){return t<10?"0"+t:String(t)}function j(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function H(t,e){const i={};return i[t]=e,i}function G(t,e){let i,s;if(null==t||Number.isNaN(t)){if(e)return null;s=0,i=!0}else if(!(i=!isNaN(s=+t))){const i=t.trim();if(i.charCodeAt(i.length-1)===L&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;X(S.invalidSizeValue,t)}}return{size:s,fixed:i}}function W(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}const Y={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"},Z=function(t){const e=Y[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Y[t]=e,e}return e};var U;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(U||(U={}));const X=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},K="vertical-lr",q="vertical-rl";function J(t){const e=String(t).split(/\s+/g),i=g(parseFloat(e[0]),0),s=parseFloat(e[1]),r=parseFloat(e[2]),n=parseFloat(e[3]);return{l:isNaN(n)?isNaN(s)?i:s:n,r:isNaN(s)?i:s,t:i,b:isNaN(r)?i:r}}const Q={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},tt=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const et="undefined"!=typeof navigator?navigator.userAgent:"",it=et?navigator.appVersion:"",st=!!et.match(/Trident.*rv\:11\./),rt=-1!==(null==it?void 0:it.indexOf("MSIE 10")),nt=-1!==(null==it?void 0:it.indexOf("MSIE 9")),ot=st||rt||nt;class at{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 i=new Date(t);return isNaN(i.getTime())?e||new Date:i}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),i=t.getDate(),s=[0,31,59,90,120,151,181,212,243,273,304,334][e]+i;return e>1&&at.isLeapYear(t.getFullYear())&&s++,s}static incMonth(t,e){const i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(d(i,at.month_days[at.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,i){const s=t.getMonth(),r=t.getFullYear(),n=new Date(r,s,1).getDay(),o=new Date(r,s+1,0).getDate(),a=t.getDate()+n-1,h=e+Math.ceil((o+n-7)/7),l=e+Math.floor(a/7);return i||l<2+e?l:l===h?e+5:l}static weekOfYear(t,e){const i=t.getFullYear(),s=new Date(i,0,1).getDay(),r=this.dateOfYear(t)+s-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!s(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return s(t)?t:void 0}static makeArray(t,e=!1){return null!=t?s(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return s(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(s(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 s(t)?t:null!=t?[t]:null}static copyArray(t){return s(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let i=0,s=e.length;i<s;i++)t.push(e[i])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static 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 i=parseFloat(t);return isFinite(i)?i:e}static toNum(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,i=!1){return t=t||"",e=e||"",i&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-tt}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=_(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=_(e||2,1),i=i||"0",new Array(e-t.toString(16).length+1).join(i)+t.toString(16)}static pick(...t){const e=t.length;let i;for(let s=0;s<e;s++)if(i=t[s],null!=i)return i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let i in e)t[i]=e[i];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 i=t.length;if(i!=e.length)return!1;for(let s=0;s<i;++s)if(t[s]!==e[s])return!1;return!0}static 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=s(t)?[]:{};for(let i of Object.keys(t))e[i]=at.deepClone(t[i]);return e}}static getArray(t,e){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static getNumArray(t,e=0){const i=[];for(let s=0;s<t;s++)i.push(e);return i}static dedupe(t,e){for(let i=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;i>0;i--)t[i]===t[i-1]&&t.splice(i,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const i=+new Date;e(),at.log(t,+new Date-i+"ms")}static clamp(t,e,i){return _(e,d(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=_(e,t)),isNaN(i)||(t=d(i,t)),t}static makeIntArray(t,e){const i=new Array(_(0,e-t));for(let s=t;s<e;s++)i[s-t]=s;return i}static shuffle(t){for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],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,i){const s=u(t);if(s>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(s)*Math.LOG10E)&&(i||10*s%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static getDistance(t,e){const i=(e[0]-t[0])*A,s=(e[1]-t[1])*A,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*A)*Math.cos(e[0]*A)*Math.sin(s/2)*Math.sin(s/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],i=t[0];for(let s=1;s<t.length;s++)e=d(e,t[s]),i=_(i,t[s]);return{min:e,max:i}}static valueAt(t,e){if(e&&(this.isObject(t)||s(t))){const i=e.split(".");let s=t;for(let t of i)s=s[t];return s}return t}static normalizeToSteps(t,e){if(t.length<2)return t;const i=Math.min(...t),s=Math.max(...t);if(i===s)return[i];const r=(s-i)/(e-1),n=10**Math.floor(Math.log10(r)),o=r/n;let a;a=o<=1?1:o<=2?2:o<=5?5:10,a*=n;const h=Math.floor(i/a)*a,l=[];a=(Math.ceil(s/a)*a-h)/(e-1);for(let t=0;t<e;t++)l.push(T(h+t*a));return l}}at.LOGGING=!1,at.week_days=["일","월","화","수","목","금","토"],at.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],at.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]];const ht=Object.freeze({x:0,y:0,width:0,height:0}),lt=function(t,e,i,s){return{x:t,y:e,width:i,height:s}};function ct(t){return{width:t.width,height:t.height}}function dt(t){return t.width<=0||t.height<=0}class _t{static create(t,e,i,s){const r=arguments.length;return at.isObject(t)?new _t(t.x,t.y,t.width,t.height):r<2?new _t(t,t,t,t):r<3?new _t(t,e,t,e):new _t(t,e,i,s)}constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}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 _t(this.x,this.y,this.width,this.height)}getInner(){return new _t(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,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,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,i,s){return e=void 0!==e?e:t,i=void 0!==i?i:t,s=void 0!==s?s:e,t&&(this.left=this.x-t),e&&(this.top=this.y-e),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),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+"}"}}_t.Empty=new _t,_t.Temp=new _t;const ut={inOutSine:t=>-(l(P*t)-1)/2};class pt{constructor(){this.delay=0,this.duration=pt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=d(1,_(0,T(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 isNaN(t)||(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,i=null){this._started&&this._stop(),this.duration=g(t,pt.DURATION),this.delay=e||0,this._easing=ut[i],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}}pt.DURATION=700,pt.SHORT_DURATION=300;let gt=0;class mt{constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(gt++))}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 ft extends mt{constructor(){super(...arguments),this._listeners=[]}_addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}_removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const i=Array.prototype.slice.call(arguments,0);i[0]=this;for(const e of this._listeners){const s=e[t];if(s){const t=s.apply(e,i);if(void 0!==t)return t}}}}class bt{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new bt(t,t,t,t):new bt(t,t,e,e):new bt(t,e,i,s)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,i=0,s=0){this.top=t,this.bottom=e,this.left=i,this.right=s}clone(){return new bt(this.top,this.bottom,this.left,this.right)}set(...t){for(const e of t)if(isNaN(e))return;const e=t.length;1===e?this.top=this.bottom=this.left=this.right=t[0]:2===e?(this.top=this.bottom=t[0],this.left=this.right=t[1]):3===e?(this.top=t[0],this.bottom=t[1],this.left=this.right=t[2]):e>3&&(this.top=t[0],this.right=t[1],this.bottom=t[2],this.left=t[3])}applyPadding(t){return this.left=g(t.paddingLeft,0),this.right=g(t.paddingRight,0),this.top=g(t.paddingTop,0),this.bottom=g(t.paddingBottom,0),this}applyMargin(t){return this.left=g(t.marginLeft,0),this.right=g(t.marginRight,0),this.top=g(t.marginTop,0),this.bottom=g(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+"}"}}var yt;bt.Empty=Object.freeze(new bt),bt.Temp=new bt,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(yt||(yt={}));const wt={name:"RealMap",version:"1.1.1",license:"enterprise",code:""},xt={name:"RealMap",version:"1.1.1",license:"enterprise",code:null};class vt{static decode(t){const e=vt.CHARS,i=vt.PAD;let s=t.split(""),r=[],n=s.length;for(;s[--n]==i;);for(let t=0;t<n;){let i=e.indexOf(s[t++])<<18;t<=n&&(i|=e.indexOf(s[t++])<<12),t<=n&&(i|=e.indexOf(s[t++])<<6),t<=n&&(i|=e.indexOf(s[t++])),r.push(i>>>16&255),r.push(i>>>8&255),r.push(255&i)}for(;0==r[r.length-1];)r.pop();return r}}vt.PAD="=",vt.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";class St{static union(t,e){const i=e.s3[255&t];t>>=8;const s=e.s2[255&t];t>>=8;const r=e.s1[255&t];t>>=8;const n=e.s0[255&t];let o=(n>>16)+(r>>16)+((65535&n)+(65535&r)>>16)<<16|(65535&n)+(65535&r)&65535;return o=(o>>16^s>>16)<<16|65535&(65535&o^65535&s),(o>>16)+(i>>16)+((65535&o)+(65535&i)>>16)<<16|(65535&o)+(65535&i)&65535}static xor(t,e){return(t>>16^e>>16)<<16|65535&(65535&t^65535&e)}static _encryptBlock(t,e){const i=St.xor,s=St.union;let r=t.left,n=t.right;r=i(r,e.p[0]),n=i(n,i(s(r,e),e.p[1])),r=i(r,i(s(n,e),e.p[2])),n=i(n,i(s(r,e),e.p[3])),r=i(r,i(s(n,e),e.p[4])),n=i(n,i(s(r,e),e.p[5])),r=i(r,i(s(n,e),e.p[6])),n=i(n,i(s(r,e),e.p[7])),r=i(r,i(s(n,e),e.p[8])),n=i(n,i(s(r,e),e.p[9])),r=i(r,i(s(n,e),e.p[10])),n=i(n,i(s(r,e),e.p[11])),r=i(r,i(s(n,e),e.p[12])),n=i(n,i(s(r,e),e.p[13])),r=i(r,i(s(n,e),e.p[14])),n=i(n,i(s(r,e),e.p[15])),r=i(r,i(s(n,e),e.p[16])),t.right=r,t.left=i(n,e.p[17])}static _decryptBlock(t,e){const i=St.xor,s=St.union;let r=t.left,n=t.right;r=i(r,e.p[17]),n=i(n,i(s(r,e),e.p[16])),r=i(r,i(s(n,e),e.p[15])),n=i(n,i(s(r,e),e.p[14])),r=i(r,i(s(n,e),e.p[13])),n=i(n,i(s(r,e),e.p[12])),r=i(r,i(s(n,e),e.p[11])),n=i(n,i(s(r,e),e.p[10])),r=i(r,i(s(n,e),e.p[9])),n=i(n,i(s(r,e),e.p[8])),r=i(r,i(s(n,e),e.p[7])),n=i(n,i(s(r,e),e.p[6])),r=i(r,i(s(n,e),e.p[5])),n=i(n,i(s(r,e),e.p[4])),r=i(r,i(s(n,e),e.p[3])),n=i(n,i(s(r,e),e.p[2])),r=i(r,i(s(n,e),e.p[1])),t.right=r,t.left=i(n,e.p[0])}static _init(t){let e=t.split("").map((function(t){return 255&t.charCodeAt(0)}));const i=St.kb,s=St._encryptBlock;let r,n,o,a=0,h=0,l={left:0,right:0};const c={p:i.p.slice(0).map((function(t){let i,s=e.length;for(i=0;i<4;i++)h=h*St.POW8|e[a++%s];return(t>>16^h>>16)<<16|65535&(65535&t^65535&h)})),s0:i.s0.slice(0),s1:i.s1.slice(0),s2:i.s2.slice(0),s3:i.s3.slice(0)};for(r=0,o=c.p.length;r<o;)s(l,c),c.p[r++]=l.left,c.p[r++]=l.right;for(r=0;r<4;r++)for(n=0,o=c["s"+r].length;n<o;)s(l,c),c["s"+r][n++]=l.left,c["s"+r][n++]=l.right;return c}static decrypt(t,e){const i=St._decryptBlock;let s=St._init(e),r=[],n=vt.decode(t),o=n.length>>3,a=0,h={left:null,right:null};for(let t=0;t<o;t++){h.left=n[a]*St.POW24|n[a+1]*St.POW16|n[a+2]*St.POW8|n[a+3],h.right=n[a+4]*St.POW24|n[a+5]*St.POW16|n[a+6]*St.POW8|n[a+7],i(h,s);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)}}St.POW2=Math.pow(2,2),St.POW3=Math.pow(2,3),St.POW4=Math.pow(2,4),St.POW8=Math.pow(2,8),St.POW16=Math.pow(2,16),St.POW24=Math.pow(2,24),St.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 Ct{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 i=0,s=t.length;i<s;i++)e+=String.fromCharCode(t[i]>>1);return e}static includedDomains(t,e,i){let s=t.split(",");for(let t=0,r=s.length;t<r;t++){const r=s[t];if(this.eqaulsUpperDomain(r,e))return!0;if(i&&r&&"*"===r[0]&&"*."!==r.substring(0,2)){if(new RegExp("^/"+r.substring(1)+"/").exec(i))return!0}const n=r.split(".").length,o=r.indexOf("*");if(n>=2&&n<=4&&o>=2){const t=r.substring(0,o);return 0===e.indexOf(t)}}return!1}static decrypt(t){const e={},i=St.decrypt(t,"dkdl"+this._getLDKey(St.kb.k)).split(";");for(let t=0,s=i.length;t<s;t++){const s=i[t].split("="),r=s[0],n=s[1];n&&n.length>0&&(e[r]=n)}return e}}let Lt=651212;class Pt{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,i=""){return t.style.display=e?i||"":"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 isChildOf(t,e){let i=t;for(;i;){if(i.classList.contains(e))return i;i=i.parentElement}}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 i=e;for(;i;){if(i==t)return!0;i=i.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,i=e.defaultView,s=t.getBoundingClientRect(),r=e.body,n=e.documentElement,o=i.pageYOffset||n.scrollTop||r.scrollTop,a=i.pageXOffset||n.scrollLeft||r.scrollLeft,h=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,c=s.left+a-l,d=s.top+o-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,i){t.style.left=e+"px",t.style.top=i+"px"}static moveI(t,e,i){t.style.left=(e>>>0)+"px",t.style.top=(i>>>0)+"px"}static resize(t,e,i){t.style.width=e+"px",t.style.height=i+"px"}static resizeSVG(t,e,i){t.setAttribute("viewBox",`0 0 ${e} ${i}`)}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,i=e.defaultView;return{width:i.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:i.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const i=t.style;i.left=e.x+"px",i.top=e.y+"px",i.width=e.width+"px",i.height=e.height+"px"}static setBounds(t,e,i,s,r){const n=t.style;n.left=e+"px",n.top=i+"px",n.width=s+"px",n.height=r+"px"}static setBoundsEx(t,e,i,s,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(i)&&(n.top=i+"px"),!isNaN(e)&&(n.width=s+"px"),!isNaN(e)&&(n.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 i=e.children;for(let e=i.length;e--;)if(i[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;)Pt.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 i in e)t[i]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,i){if(e!=i){if(i)for(const e in i)t[e]="";return e&&Object.assign(t,e),e}return i}static createElement(t,e,i){const s=t.createElement(e);return i&&Object.assign(s.style,i),s}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,i){null==i||""===i?delete t.dataset[e]:t.dataset[e]=i}static toggleData(t,e,i){i?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,i){t.style.setProperty(e,i)}static animate(t,e,i,s,r=150,n="none"){const o={},a={};return o[e]=i,a[e]=s,t.animate([o,a],{duration:r,fill:n})}static setAttr(t,e,i){null!=i&&""!==i?t.setAttribute(e,i):t.removeAttribute(e)}static setAttrs(t,e){for(const i in e){const s=e[i];null!=s&&""!==s?t.setAttribute(i,s):t.removeAttribute(i)}}static getDomId(){return"-rtc-"+Lt++}static createBR(t,e){const i=t.createElement("br");return i.className=e,i}static createSpan(t,e){const i=t.createElement("span");return e&&Object.assign(i.style,e),i}static createCheckBox(t,e){const i=t.createElement("input");return i.type="checkbox",e&&Object.assign(i.style,e),i}static createRadio(t,e){const i=t.createElement("input");return i.type="radio",e&&Object.assign(i.style,e),i}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){w.debugging(),console.error(t)}return null}static childByPath(t,e){let i=t;if(e){let t=0;for(;t<e.length;)i=i.childNodes[e[t++]]}return i}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,i){t.setProperty(e,i,"important")}static setNoScale(t){!ot&&t.setAttribute("vector-effect","non-scaling-stroke")}static isIntersectRectPath(t,e,i=1){const s=t.getBBox(),r=e.getBBox(),n=t.getCTM(),o=e.getCTM();if(!n||!o)return console.warn("CTM is null — element may not be in DOM or in an <svg> tree"),!1;const a=[new DOMPoint(s.x,s.y).matrixTransform(n),new DOMPoint(s.x+s.width,s.y).matrixTransform(n),new DOMPoint(s.x,s.y+s.height).matrixTransform(n),new DOMPoint(s.x+s.width,s.y+s.height).matrixTransform(n)],h=[new DOMPoint(r.x,r.y).matrixTransform(o),new DOMPoint(r.x+r.width,r.y).matrixTransform(o),new DOMPoint(r.x,r.y+r.height).matrixTransform(o),new DOMPoint(r.x+r.width,r.y+r.height).matrixTransform(o)],l=Math.min(...a.map((t=>t.x))),c=Math.max(...a.map((t=>t.x))),d=Math.min(...a.map((t=>t.y))),_=Math.max(...a.map((t=>t.y))),u=Math.min(...h.map((t=>t.x))),p=Math.max(...h.map((t=>t.x))),g=Math.min(...h.map((t=>t.y))),m=Math.max(...h.map((t=>t.y)));if(c<u||p<l||_<g||m<d)return!1;const f=e.getTotalLength(),b=t.ownerSVGElement.createSVGPoint();for(let t=0;t<=f;t+=i){const{x:i,y:s}=e.getPointAtLength(t);b.x=i,b.y=s;const r=b.matrixTransform(o);if(r.x>=l&&r.x<=c&&r.y>=d&&r.y<=_)return!0}const y=o.inverse();for(const t of a){const i=t.matrixTransform(y);if(e.isPointInFill(i))return!0}return!1}}const Mt={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class kt extends mt{constructor(t,e,i){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._domResize=!1,this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&this._domResized()},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=xt.code||realMapLic,!e)return!1}catch(t){return!1}const i=Ct.decrypt(e);if("RealMap"!=i.name||"RealMap"!==wt.name)return!1;const s=i.server.toLowerCase(),r=location.pathname.toLowerCase();if(wt.license!=yt.Developer&&!Ct.includedDomains(s,t.toLowerCase(),r))return!1;const n=i.lic.toLowerCase();if(!Object.values(yt).includes(n))return!1;if(wt.code=i.code,wt.license=i.lic,n==yt.Evaluation||n==yt.Limited){const t=i.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)return!1}return!0}()?(!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,i||kt.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._registerEventHandlers(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),Pt.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(){const t=Array.from(this._defs.children).filter((t=>"true"===t.dataset.essential));for(const e of t)this._defs.removeChild(e);Pt.clearChildren(this._defs);for(const e of t)this._defs.appendChild(e)}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)}}setDomResize(t){t!=this._domResize&&(this._domResize=t)}getBounds(){return this._dom.getBoundingClientRect()}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}addDef(t){this._defs.appendChild(t)}removeDef(t){if(n(t))for(const e of Array.from(this._defs.children))if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}hasDef(t){return!!this._defs.querySelector("#"+t)}clipBounds(t=NaN,e=NaN,i=NaN,s=NaN,r=0){return this.clip(new $t(this.doc(),t,e,i,s,r,r))}clip(t){return this._defs.appendChild(t.dom),t}pointerToPoint(t){const e=this._dom.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}_setTesting(){this._testing=!0,At.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,i,s){s?t.addEventListener(e,i,{passive:!0}):t.addEventListener(e,i)}_registerEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"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){var e,i;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(i=this._resizeObserver)||void 0===i||i.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("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(e,i,s){if(this._inited)return;i instanceof HTMLDivElement?this._container=i:this._container=e.getElementById(i),this._container instanceof HTMLDivElement||X(S.invalidOuterDiv,i);const r=this._container.ownerDocument,n=this._dom=r.createElement("div");Object.assign(n.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),n.className=s,this._container.appendChild(n);const o=this._svg=r.createElementNS(t,"svg");o.classList.add("rm-svg"),o.style.setProperty("overflow","visible","important"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const a=r.createElement("desc");a.textContent="Created with RealMap 1.0.0",o.appendChild(a);const h=this._defs=r.createElementNS(t,"defs");this._initDefs(r,h),o.appendChild(h),n.appendChild(o),this._root=new Nt(this),o.appendChild(this._root._dom),this._htmlRoot=r.createElement("div"),n.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=r.createElement("div"),n.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(e,i){let s=e.createElementNS(t,"filter");s.dataset.essential="true";const r=e.createElementNS(t,"feDropShadow");s.setAttribute("id",kt.SHADOW_FILTER),r.setAttribute("dx","0"),r.setAttribute("dy","4"),r.setAttribute("flood-color","#000"),r.setAttribute("flood-opacity","0.4"),r.setAttribute("stdDeviation","2"),s.appendChild(r),i.appendChild(s)}_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(),i=this._padding=Pt.getPadding(this._root.dom),s=i.left,r=i.top,n=this._svg.clientWidth-s-i.right,o=this._svg.clientHeight-r-i.bottom;this._htmlRoot.style.left=e.left-t.left+"px",this._htmlRoot.style.top=e.top-t.top+"px",this._doRender({x:s,y:r,width:n,height:o});const a=this._debugger;if(a.textContent){a.style.display="";const t=a.getBoundingClientRect();a.style.left=s+(n-t.width)/2+"px",a.style.top=r+(o-t.height)/2+"px"}else a.style.display="none"}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender()}at.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){}_domResized(){this.invalidateLayout()}}kt.CLASS_NAME="rm-control",kt.SHADOW_FILTER="rm-shadow-filter",kt._animatable=!0;class At extends mt{static createElement(e,i){return e.createElementNS(t,i)}static shrink(t,e){for(;t.length>e;)t.pop().remove()}static expand(t,e,i,s){for(;e.length<i;){const i=s();t.add(i),e.push(i)}}static fit(t,e,i,s,r,n){for(;i.length>s;)i.pop().remove();for(;i.length<s;){const s=new r(t,n);e.add(s),i.push(s)}}constructor(e,i,s=C){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=e.createElementNS(t,s||"g"),(this._styleName=i)&&this.setAttr("class",i),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.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,i){return t===this._originX&&e===this._originY&&i===this._rotation||(this._originX=t,this._originY=e,this._rotation=i,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}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}append(t){if(t){const e=t._parent;t._parent=this,this._dom.appendChild(t._dom),e!=this&&t._doAttached(this)}return 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._dom.remove(),this}appendElement(e,i){const s=e.createElementNS(t,i);return this._dom.appendChild(s),s}insertElement(e,i,s){const r=e.createElementNS(t,i);return this._dom.insertBefore(r,s),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 B(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this.dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this.dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,i,s){return this.trans(t,e).resize(i,s),this}setRect(t){return this.trans(t.x,t.y).resize(t.width,t.height),this}getRect(){return _t.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=at.isValidNum(t)?t:this._tx,e=at.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transc(t){return this.trans(t[0],t[1])}transEx(t,e,i=0,s=!0){if(t=at.isValidNum(t)?t:this._tx,e=at.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(i>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:i,fill:"none"});s&&(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&&at.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&at.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}transform(t){this.dom.setAttribute("transform",t)}resize(t,e,i=!0){let s=!1;return t!==this._width&&(this._width=Math.max(0,t),i&&this.setAttrEx("width",this._width),s=!0),e!==this._height&&(this._height=Math.max(0,e),i&&this.setAttrEx("height",this._height),s=!0),s}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}hasSavedStyles(){return void 0!==this._saveStyle||void 0!==this._saveClass}saveStyles(){const t=this._dom.getAttribute("style"),e=this._dom.getAttribute("class");this._saveStyle=t,this._saveClass=e}restoreStyles(){null!=this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",""===this._saveStyle&&(this._styles={}),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(Z(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(Z(i)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}internalSetStyles(t){if(t){const e=this.dom.style;for(let i in t)e[i]=this._styles[i]=t[i]}}internalImportantStylesOrClass(t){if(n(t))t&&this._dom.classList.add(t);else if(i(t)){const e=this.dom.style;for(let i in t)e.setProperty(Z(i),this._styles[i]=t[i],"important")}}resetStyles(t){this.clearStyles(),this.internalSetStyles(t)}_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 i=!1;if(t){for(let s in t)if(s in Mt&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(g(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in Mt){const i=Mt[s];e[i]=this._styles[i]=t[s]}i=!0}i&&(this._styleDirty=!0)}return i}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 i=!1;return t in Mt&&e!==this._styles[t]&&(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i}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]=f(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 i=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});i&&i.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}hasClip(){return this.hasAttr("clip-path")}setClip(t){t?this.setAttr("clip-path",this.createClipId(t)):this.unsetAttr("clip-path")}clipRect(t,e,i,s,r=0){const n=this.control.clipBounds(t,e,i,s,r);return this.setClip(n),n}clipPath(t){const e=this.control.clip(new Ot(this.doc).setPath(t));return this.setClip(e),e}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}}onScrollStart(){}onScrollEnd(){}_testing(){return At.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(at.isValidNum(e)||at.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),at.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+at.pick(this._originX,t.getAttribute("x"),0)+" "+at.pick(this._originY,t.getAttribute("y")||0)+")");const r=at.getNum(this._scaleX,1),n=at.getNum(this._scaleY,1);1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}At.TESTING=!1,At.DEBUGGING=!1,At.ASSET_KEY="_asset_",At.TEMP_KEY="_temp_";class It extends At{constructor(t,e=void 0){super(t,e,"g")}}class Nt extends At{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class Vt extends At{constructor(t,e=void 0){super(t,e,"use")}get id(){return this._id}setId(t){return t!==this._id&&this.dom.setAttribute("href",this._id=t),this}}class Et extends At{constructor(t,e=void 0,i=void 0){super(t,e,"path"),i&&this.setPath(i)}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 Tt extends At{constructor(t,e,i=!1){super(t,e,i?"g":"path"),this.group=i}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 Dt extends At{constructor(t){super(t,C,"mask");const e=this._id=at.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class Rt extends At{constructor(t){super(t,C,"clipPath");const e=this._id=at.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class $t extends Rt{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new At(t,null,"rect");a.setAttr("fill","none"),n>0&&a.setAttr("rx",String(n)),o>0&&a.setAttr("ry",String(o)),isNaN(e)||a.setBounds(e,i,s,r),this.add(a)}setBounds(t,e,i,s){return this._rect.move(t,e),this._rect.resize(i,s),this}resize(t,e,i){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class Ot extends Rt{constructor(t,e){super(t),this._path=new Et(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var Ft;!function(t){t.SIDO="sido"}(Ft||(Ft={}));const Bt="shuffle",zt="random";var jt;class Ht{constructor(t){this.source=t}hasDef(){return!0}}class Gt extends Ht{getElement(t,e){throw new Error("Method not implemented.")}}Gt.TYPE="shape";class Wt extends Ht{getElement(t,e){throw new Error("Method not implemented.")}}Wt.TYPE="image";class Yt extends Ht{_setStops(e,i){const r=e.createElementNS(t,"stop"),n=e.createElementNS(t,"stop"),o=this.source.color,a=F(this.source.opacity)?1:this.source.opacity,h=s(o)?o[0]:o,l=s(o)&&o.length>1?o[1]:"white",c=s(a)?a[0]:a,d=s(a)&&a.length>1?a[1]:a;i.setAttribute("id",this.source.id),r.setAttribute("offset","0"),r.setAttribute("stop-color",h),r.setAttribute("stop-opacity",c),n.setAttribute("offset","1"),n.setAttribute("stop-color",l),n.setAttribute("stop-opacity",d),i.appendChild(r),i.appendChild(n)}}class Zt extends Yt{getElement(e,i){const s=e.createElementNS(t,"linearGradient");let{x1:r,x2:n,y1:o,y2:a}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(e,s),i.dir){case"up":o=1;break;case"right":n=1;break;case"left":r=1;break;default:a=1}return s.setAttribute("x1",r),s.setAttribute("y1",o),s.setAttribute("x2",n),s.setAttribute("y2",a),s}}Zt.TYPE="lineargradient";class Ut extends Yt{getElement(e,i){const s=e.createElementNS(t,"radialGradient");return F(i.cx)||s.setAttribute("cx",i.cx),F(i.cy)||s.setAttribute("cy",i.cy),F(i.r)||s.setAttribute("r",i.r),this._setStops(e,s),s}}Ut.TYPE="radialgradient";class Xt extends Ht{getElement(e,s){const r=e.createElementNS(t,"pattern"),o=e.createElementNS(t,"path");let a,l,c,d,_=!1;if(r.setAttribute("id",s.id),r.setAttribute("patternUnits","userSpaceOnUse"),o.classList.add("rm-pattern"),+s.pattern>=0){const t=jt.STOCK[+s.pattern%jt.STOCK.length];a=t.path,l=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),l&&h(o.style,l),s.style&&h(o.style,s.style),_&&(o.style.fill="none");let u=s.backgroundStyle;if(n(u)||i(u)){const i=e.createElementNS(t,"rect");r.append(i),i.style.fill=n(u)?u:u.fill,i.setAttribute("width",String(c)),i.setAttribute("height",String(d))}return s.transform&&r.setAttribute("patternTransform",s.transform),r.append(o),r}}jt=Xt,Xt.TYPE="pattern",Xt.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}],Xt.SELECT=Object.assign(jt.STOCK[4],{id:"rm-selected-area-fill",pattern:jt.STOCK[4].path,transform:"scale(0.5)"});class Kt extends Ht{prepare(){const t=this.source;return this._colors=s(t.colors)?t.colors.slice():[],t.mode===zt?this._index=-1:(t.mode===Bt&&at.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=s(e.colors)?e.colors:[]}}Kt.TYPE="colors";class qt extends Ht{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(n(e))this._images.push(e);else{const i=t+e.url;e.name&&(this._map[e.name]=i),this._images.push(i)}}))}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 Jt{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],s(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 Xt(Xt.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(At.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(At.ASSET_KEY,"1"),e.addDef(s)}))}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=Xt.TYPE:s(t.colors)?e=Kt.TYPE:s(t.images)?e=qt.TYPE:null!=t.url?e=Wt.TYPE:null!=t.path&&(e=Gt.TYPE)),e)switch(e.toLowerCase()){case Gt.TYPE:return new Gt(t);case Wt.TYPE:return new Wt(t);case Zt.TYPE:return new Zt(t);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)}}}}const Qt="0".charCodeAt(0),te="#".charCodeAt(0),ee=",".charCodeAt(0),ie="s".charCodeAt(0),se="a".charCodeAt(0);class re{static getFormatter(t){let e=re.Formatters[t];return e||(re.Formatters[t]=e=new re(t)),e}static get Default(){return re.getFormatter(re.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 i=t.toLocaleString(void 0,this._options);return delete this._options.roundingMode,i}$_parse(t){const e=t.length;if(e>0){const i={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let s=t.indexOf(".");if(s>=0){let r=s+1;for(;r<e&&t.charCodeAt(r)===Qt;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===te;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===Qt;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===ee){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===ie){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===se){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}re.DEFAULT_FORMAT="",re.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"],oe=[".","/","-",":"],ae="Z".charCodeAt(0),he="z".charCodeAt(0),le="A".charCodeAt(0),ce="a".charCodeAt(0),de="y".charCodeAt(0),_e="M".charCodeAt(0),ue="m".charCodeAt(0),pe="W".charCodeAt(0),ge="w".charCodeAt(0),me="d".charCodeAt(0),fe="H".charCodeAt(0),be="h".charCodeAt(0),ye="S".charCodeAt(0),we="s".charCodeAt(0);class xe{static getFormatter(t){let e=xe.Formatters[t];return e||(xe.Formatters[t]=e=new xe(t)),e}static get Default(){return xe.getFormatter(S.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||S.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t,e){if(!this._tokens)return"";const i=this._tokens;let s="";for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o.length;switch(o.charCodeAt(0)){case de:s+=a>2?t.getFullYear():z(t.getFullYear()%100);break;case _e:s+=a>1?z(t.getMonth()+1):t.getMonth()+1;break;case me:s+=a>1?z(t.getDate()):t.getDate();break;case pe:s+=a>1?z(at.weekOfYear(t,e)+1):at.weekOfMonth(t,e,!0)+1;break;case ge:s+=a>1?at.long_week_days[t.getDay()]:at.week_days[t.getDay()];break;case fe:s+=a>1?z(t.getHours()):t.getHours();break;case be:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=a>1?z(e):e}else s+=a>1?z(t.getHours()):t.getHours();break;case ue:s+=a>1?z(t.getMinutes()):t.getMinutes();break;case we:s+=a>1?z(t.getSeconds()):t.getSeconds();break;case ce:case le:t.getHours()<12?s+=S.am:s+=S.pm;break;case ye:let i=t.getMilliseconds();s+=3==a?j(i):2==a?z(i):i.toString().substring(0,a);break;default:s+=o}}return s}parseDateFormatTokens(t){var e=[];if(t){const i=t.trim(),s=i.length;let r=0;for(;r<s;){let n=i.charAt(r);if(oe.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<s&&i.charAt(r)==n;)r++;if(n=i.substring(o,r),ne.indexOf(n)<0){let e=n.charCodeAt(0);(e>=le&&e<=ae||e>=ce&&e<=he)&&X(S.invalidDateFormat,t)}e.push(n)}if(r<s&&at.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&at.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||S.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}xe.Formatters={};const ve=["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 Ce{static create(t){return n(t)?new Ce(t):void 0}static isBright(t){return new Ce(t).isBright()}static getContrast(t,e,i){return new Ce(t).getContrast(e,i)}static interpolate(t,e,i){const s=new Ce(null);return s.r=Math.ceil(t.r+(e.r-t.r)*i),s.g=Math.ceil(t.g+(e.g-t.g)*i),s.b=Math.ceil(t.b+(e.b-t.b)*i),s.a=(e.a+t.a)/2,s}constructor(t){if(this.r=0,this.g=0,this.b=0,this.a=1,t=t&&t.trim())if(at.startsWith(t,"rgb(")&&at.endsWith(t,")"))this.$_parseRgb(t.substring(4,t.length-1));else if(at.startsWith(t,"rgba(")&&at.endsWith(t,")"))this.$_parseRgb(t.substring(5,t.length-1));else if(at.startsWith(t,"#"))this.$_parseNumber(t.substring(1));else{Ce.COLORS[t]&&this.$_parseNumber(Ce.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 Ce(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}}var Le,Pe,Me;Ce.COLORS=function(){const t={};for(let e=0;e<ve.length;e++)t[ve[e]]=Se[e];return t}(),function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Le||(Le={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(Pe||(Pe={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Me||(Me={}));class ke extends At{constructor(t,e=C){super(t,e,"text"),this._layout=Pe.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(t){const e=this.bbox(),i=this.getAscent(isNaN(t)?e.height:t);let s;switch(this._layout){case Pe.MIDDLE:s=Math.floor(i/2);break;case Pe.BOTTOM:s=i-e.height;break;default:s=Math.ceil(i)}this.setAttr("y",s)}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 i=this._text;if(!i)return;const s=this.dom;let r,n=0,o=i.length;do{r=Math.ceil((n+o)/2);s.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=i.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=i.substring(0,--n)+"…"}setContrast(t,e,i){return this.internalSetStyleOrClass(Ce.isBright(getComputedStyle(t).fill)?e:i),this}setStyle(t,e){let i=!1;return t in Mt||e===this._styles[t]||(i=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),i&&this.layoutText(),i}setStyles(t){let e=!1;if(t){const i=this.dom.style;for(let s in t){const r=t[s];this._styles[s]!==r&&(this._styles[s]=r,"rx"==s&&this.dom.setAttribute(s,r),i[s]=r,e=!0)}e&&(this._styleDirty=!0)}return e&&this.layoutText(),e}clearDom(){super.clearDom(),this._dirty=!0}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 Ae="$_TH",Ie="$_TW";class Ne{tag(){return""}parse(t){return this.text=t,this._doParse(t),this}getText(t,e){const i=this._literals;let s=this.text;if(i&&e.callback)for(let r=0;r<i.length;r+=4){let n=e.callback(t,i[r+1]);if("number"==typeof n&&!isNaN(n)||"bigint"==typeof n){const t=i[3]?re.getFormatter(i[3]):e.numberFormatter;t&&(n=t.toStr(n))}else if(n instanceof Date){const t=i[3]?xe.getFormatter(i[3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}else null==n&&(n=i[r+2]||"");s=s.replace(i[r],n)}return s}prepareSpan(t,e,i){const s=this.getText(e,i);return t.textContent=s,t}_doParse(t){this._literals=[];let e=0;for(;e<t.length;){let i=t.indexOf("${",e);if(i<0&&(i=t.indexOf("%{",e)),i<0)break;const s=t.indexOf("}",i+2);if(s<0)break;const r=t.substring(i,s+1),n=r.substring(2,r.length-1),o=n.indexOf(";");if(o>0){const t=n.indexOf(";",o+1);t>=o?this._literals.push(r,n.substring(0,o),n.substring(o+1,t),n.substring(t+1)):this._literals.push(r,n.substring(0,o),n.substring(o+1),C),0===this._literals[2].length&&(this._literals[2]=C)}else this._literals.push(r,n,C,C);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class Ve extends Ne{prepareSpan(t,e,i){const s=this.getText(e,i),r=s.indexOf(">")+1,n=s.indexOf(this.tag(),r);return this._doPrepare(t,s,r,n),t}_doPrepare(t,e,i,s){t.textContent=e.substring(i,s);const r=e.indexOf("style=");if(r>0&&r<i){const s=e[r+6],n=e.indexOf(s,r+7);n>0&&n<i&&t.setAttribute("style",e.substring(r+7,n))}}}class Ee extends Ve{constructor(){super(...arguments),this.target="_blank"}tag(){return"</a>"}_doPrepare(t,e,i,s){e.substring(2,i-1).trim().split(/\s+/g).forEach((t=>{const e=t.indexOf("=");if(e>0){const i=t.substring(0,e),s=t.substring(e+1,t.length),r=s.substring(1,s.length-1);switch(i){case"href":this.url=r;break;case"target":this.target=r}}})),super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-link")}}const Te={t:class extends Ve{tag(){return"</t>"}},b:class extends Ve{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends Ve{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:Ee};class De{get words(){return this._words.slice()}parse(t){function e(t){const e=i.length;e>0&&""===i[e-1].type?i[e-1].text+=t:i.push((new Ne).parse(t))}const i=this._words=[];let s=0;for(;s<t.length;){if("<"==t[s]){const i=t[s+1];let r;if(i in Te){const e=t.indexOf(">",s+2);if(e>=0){const n="</"+i+">",o=t.indexOf(n,e+1);if(o>=0){const e=t.substring(s,o+n.length);r=(new Te[i]).parse(e),s+=e.length}}}if(!r){e(t.substring(s));break}this._words.push(r)}else{const i=t.indexOf("<",s+1);if(!(i>=0)){e(t.substring(s));break}e(t.substring(s,i)),s=i}}return this}}const Re=/<br.*?>|\r\n|\n/;class $e{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(e,s,r,n,o){const a=e.doc,h=g(this.lineHeight,1),l=this._lines,c=l.length,d=[],u=[];e.clearDom(),n=n||e;const p=e.getStyle("writing-mode"),m=p===K||p===q;for(let s=0;s<c;s++){const r=l[s];let p=0,g=0,f=null;for(let[h,l]of r.words.entries()){const d=0===s&&0===h,u=s===c-1&&h===r.words.length-1,b=l.prepareSpan(e.appendElement(a,"tspan"),n,o);if(i(n.options)){const t=n.options,e=d&&t.prefix||"",i=u&&t.suffix||"";b.textContent=e+(b.textContent||"")+i}const y=b.getBBox();if(b[Ie]=y.width,b[Ae]=y.height,m?(p=_(p,b[Ie]),g+=b[Ae]):(p+=b[Ie],g=_(g,b[Ae])),f||(f=b),l instanceof Ee){const i=a.createElementNS(t,"a");i.setAttribute("href",l.url),i.setAttribute("target",l.target),i.appendChild(b),e.appendDom(i)}}u.push(f),r[Ae]=g*h,r[Ie]=p*h,d.push(0==s?r[Ie]/2:r[Ie])}if(c>0){let t=l[0];for(let i=1;i<u.length;i++)if(u[i]){let s=0,r=0;if(m?null!=u[i-1]&&(s=Math.floor(t[Ie]-e.getAscent(t[Ie]))+e.getAscent(l[i][Ie])):r=t[Ae]-e.getAscent(t[Ae])+e.getAscent(l[i][Ae]),null==u[0]&&u[i]==u.find((t=>null!=t))){const r=e.insertElement(a,"tspan",u[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[Ie]=n.width,r[Ae]=t[Ae]=n.height,u[0]=r}switch(p){case K:u[i].setAttribute("dx",String(s)),u[i].setAttribute("y","0");break;case q:u[i].setAttribute("dx",String(-s)),u[i].setAttribute("y","0");break;default:u[i].setAttribute("x","0"),u[i].setAttribute("dy",String(r))}t=l[i]}if(m){const t=e.parent.dom.classList.contains("rm-annotation"),i=e.bbox().width,[s]=u,r=s[Ie];if(t)s.setAttribute("dx",String(p===q?i-r/2:r/2));else switch(p){case K:s.setAttribute("x",String((i-r)/-2));break;case q:s.setAttribute("x",String((i-r)/2))}}else e.layoutText(l[0][Ae])}}layout(t,e,i,s,r){const n=t.bbox();let o=0,a=0;const h=t.getStyle("writing-mode");if(h===K||h===q)switch(o=r.left+(i-r.left-r.right-n.width),e){case"center":t.anchor=Le.MIDDLE,a=r.top+(s-r.top-r.bottom)/2;break;case"right":t.anchor=Le.END,a=n.height-r.bottom;break;default:t.anchor=Le.START,a=r.top}else switch(a=r.top+(s-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=Le.MIDDLE,o=r.left+(i-r.left-r.right)/2;break;case"right":t.anchor=Le.END,o=i-r.right;break;default:t.anchor=Le.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(Re);for(let t of i)e.push((new De).parse(t))}}}let Oe=0;const Fe=function(t,e){const i={};for(const e in t)i[e]=t[e];for(const t in e)i[t]=e[t];return i},Be=function(t,e){const r=i(t)?t:{};for(const t in e)if(e.hasOwnProperty(t)){let n=e[t];s(n)?r[t]=n.slice(0):n instanceof Date?r[t]=new Date(n):i(n)?r[t]=Be(r[t],n):r[t]=n}return r};class ze extends mt{constructor(t){super(),this.chart=t,Oe++}_init(){const t=this._op=Be({},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(e,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(r,t)||Be(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 ze&&(s._children.push(e),t.hasOwnProperty(e)&&i.updateOptions(t[e]))}}}(t),e&&this._optionChanged(),this}updateOption(t,e,i=!0,s=!1){if(this[t]instanceof ze)this[t].updateOptions(e);else{const r=this._op;(s||e!==r[t])&&(r[t]=e,this.$_applyOptions(r),i&&this._optionChanged())}return this}toggleOption(t,e=!0){const i=this._op,s=i[t];return i[t]=!a(s)||!s,this.$_applyOptions(i),e&&this._optionChanged(),this}removeOption(t,i=!0){const s=this._op;if(s.hasOwnProperty(t)){delete s[t];const r=self.constructor.defaults;e.call(r,t)&&(s[t]=r[t]),this.$_applyOptions(s),i&&this._optionChanged()}return this}clearOptions(t=!0){return function t(e){if(e._op=Be({},e.constructor.defaults),e.$_applyOptions(e._op),e._children)e._children.forEach((i=>e._op[i]=t(e[i])));else{e._children=[];for(const i in e){const s=e[i];s instanceof ze&&(e._op[i]=t(s))}}return e._op}(this),t&&this._optionChanged(),this}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(t,e,i=!0){let s=this._op.style;return t&&(s||(s=this._op.style={}),null!=e&&""!==e||(e=void 0),s[t]!==e&&(void 0===e?delete s[t]:s[t]=e),this.$_applyOptions(this._op),i&&this._optionChanged()),this}setStyles(t,e=!0){let s=this._op.style;if(i(t)){let i=!1;s||(s=this._op.style={});for(const e in t){let r=t[e];null!=r&&""!==r||(r=void 0),s[e]!==r&&(void 0===r?delete s[e]:s[e]=r,i=!0)}i&&(this.$_applyOptions(this._op),e&&this._optionChanged())}return this}_prepareRender(){this._doPrepareRender(this.chart,this._op)}_afterRender(){this._doAfterRender()}_optionChanged(t){var e;null===(e=this.chart)||void 0===e||e._optionChanged(this,t)}_doLoad(t,e){for(const r in e)if(e.hasOwnProperty(r)){let n=e[r];this._doLoadProp(r,n)||(this[r]instanceof ze?t[r]=this[r]._load(n):s(n)?t[r]=n.slice(0):n instanceof Date?t[r]=new Date(n):i(n)?t[r]=Object.assign({},n):t[r]=n)}}_doSetSimple(t,e){if(a(e))return t.visible=e,!0}_doLoadProp(t,e){if("visible"===t)return this._op.visible=e,!0}$_applyOptions(t){var e;const i=this.visible;this._doApply(t),this.visible!==i&&(null===(e=this.chart)||void 0===e||e._visibleChanged(this))}_setDim(t,e){const i=`_${e}`;t[e]!==this[i]&&(this[`${i}Dim`]=G(this[i]=t[e],!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doSave(t){}_doPrepareRender(t,e){}_doAfterRender(){}}ze.REFRESHED="refreshed",ze.defaults={visible:!0};class je{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 He extends ze{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=g(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?re.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,i,s,r,n){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,n),e&&this._richTextImpl.build(e,i,s,r,n))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new $e),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(t.outlineThickness),this._setNumberSymbols(t.numberSymbols),this._setNumberFormat(t.numberFormat),this._setText(t.text)}$_getNumberText(t,e,i){if(at.isValidNum(t)){const s=this._numSymbols&&e&&at.scaleNumber(t,this._numSymbols,i);return this._numberFormatter?s?this._numberFormatter.toStr(s.value)+s.symbol:this._numberFormatter.toStr(t):s?s.value+s.symbol:String(t)}return"NaN"}_getText(t,e,i,s){let r=n(t)?t:this.$_getNumberText(e,i,s)||e;return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}getNumberText(t,e,i,s){let r="";if(at.isValidNum(t)){const n=this._numSymbols&&e&&at.scaleNumber(t,this._numSymbols,i);r=this._numberFormatter?n?this._numberFormatter.toStrEx(n.value,s)+n.symbol:this._numberFormatter.toStrEx(t,s):n?n.value+n.symbol:String(t)}return this._op.prefix&&(r=this._op.prefix+r),this._op.suffix&&(r+=this._op.suffix),r}}He.defaults=Fe(ze.defaults,{effect:"none",autoContrast:!0,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class Ge extends He{getIconPos(){return"default"===this._op.iconPosition?this.getDefaultIconPos():this._op.iconPosition}_doPrepareRender(t,e){if(this._images=null,e.imageList){const i=t._assets.get(e.imageList);i instanceof qt&&(this._images=i)}this._root=this._images?"":e.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 i=this.chart._assets.get(t.substring(0,e)),s=t.substring(e+2);return i instanceof qt?i.getImage(s):s}return this._root+t}}}Ge.defaults=Fe(He.defaults,{iconPosition:"default",iconGap:2});class We extends ze{}We.defaults=Fe(He.defaults,{});class Ye extends Ge{getDisplay(t){const e=this._op.display;return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return g(this._op.gap,t?10:5)}_isVisible(){return this._op.visible&&!!this._op.text}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}Ye.defaults=Fe(Ge.defaults,{display:"auto"});class Ze extends ze{constructor(){super(...arguments),this._index=0}get index(){return this._index}get background(){return this._background}get title(){return this._title}get footer(){return this._footer}isVisible(){return this.visible}getOrder(){return isNaN(this.options.order)?1/0:this.options.order}_setGroup(t){this._group=t}getGroup(){return this._group}getLocation(){return this._group?this._group.getLocation():this._location}_setIndex(t){this._index=t}getDefaultDisplay(t){return this.isVertical()?"stack":"inline"}_doInit(t){t.background=(this._background=new We(this.chart))._init(),t.title=(this._title=new Ye(this.chart))._init(),t.footer=(this._footer=new Ye(this.chart))._init()}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=f(e.location,"bottom")}}Ze.defaults=Fe(ze.defaults,{offsetX:0,offsetY:0});class Ue extends Ze{}class Xe extends Ze{_clean(){this._widgets=[]}_add(t){this._widgets.push(t)}_sort(){this._widgets.sort(((t,e)=>t.getOrder()-e.getOrder()))}getWidget(t){return this._widgets[t]}_internalWidgets(){return this._widgets}_type(){return"group"}isVertical(){return"horizontal"!==this._op.direction}}Xe.defaults=Fe(Ze.defaults,{direction:"vertical"});class Ke extends je{constructor(){super(...arguments),this._dic={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=n(t)?this._dic[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=n(t)?this._dic[t]:this._items[t];return i&&i.visible?i:e?this._visibles[0]:void 0}beforeRender(){}prepareRender(){this._items.forEach((t=>{t._prepareRender()}))}load(t){const e=this.chart,r=this._items=[],n=this._dic={};if(s(t))t.forEach(((t,i)=>{r.push(this.$_loadItem(e,t,i))}));else if(i(t))r.push(this.$_loadItem(e,t,0));else if(!this._canEmpty()){const i={};a(t)&&(i.visible=t),r.push(this.$_loadItem(e,i,0))}r.forEach((t=>{t.options.name&&(n[t.options.name]=t)})),this.chart.options[this._collectionProp()]=this._items.map((t=>t.options))}_canEmpty(){return!0}$_loadItem(t,e,i){const s=this._createWidget(t);return s._init(),s._setIndex(i),s._load(e),s}_collectVisibles(){this._visibles=this._items.filter((t=>t.isVisible()))}}class qe extends Ke{_collectionProp(){return"widgetGroup"}_createWidget(t){return new Xe(t)}beforeRender(){this._collectVisibles()}}class Je extends ze{constructor(){super(...arguments),this.index=-1,this._offsetX=0,this._offsetY=0}get name(){return this._name}getOffset(t,e){const i=function(t,e,i){return i.size*("h"===i.suffix?e:t)};return{x:(this._offsetXDim?i(t,e,this._offsetXDim):+this._offsetX)||0,y:(this._offsetYDim?i(t,e,this._offsetYDim):+this._offsetY)||0}}getSize(t,e){let i,s;return isNaN(i)&&(i=W(this._widthDim,t)),isNaN(s)&&(s=W(this._heightDim,e)),{width:i,height:s}}getPosition(t,e,i,s,r,n){let o,a,h;switch(o=this.getOffset(r,n),a=t,this._op.align||this._getDefaultAlign()){case"center":a+=(i-r)/2+o.x;break;case"right":a+=i-o.x-r;break;default:a+=o.x}switch(o=o||this.getOffset(r,n),h=e,this._op.verticalAlign){case"middle":h+=(s-n)/2-o.y;break;case"bottom":h+=s-o.y-n;break;default:h+=o.y}return{x:a,y:h}}_doApply(t){const e=this,i=function(t){if(n(t)){const e=t[t.length-1];if("h"===e||"w"===e){const i=parseFloat(t);if(i===parseFloat(t.substring(0,t.length-1)))return{size:i,suffix:e}}}};var s;super._doApply(t),this._name=t.name||`${this._getNamePrefix()} ${this.index+1}`,(s=t.offsetX)!=e._offsetX&&(e._offsetXDim=i(e._offsetX=s)),function(t){t!=e._offsetY&&(e._offsetYDim=i(e._offsetY=t))}(t.offsetY),this._setDims(t,"width","height")}_getDefaultAlign(){return"left"}}Je.defaults=Fe(ze.defaults,{verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Qe extends je{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}get(t){return n(t)?this._map[t]:this._items[t]}load(t,e){const r=this.chart,n=this._items=[],o=this._map={};s(t)?t.forEach(((t,i)=>{n.push(this._loadItem(r,t,i,e))})):i(t)&&n.push(this._loadItem(r,t,0,e)),n.forEach((t=>{t.name&&(o[t.name]=t)}))}prepareRender(){this._visibles=this._items.filter((t=>t.visible)),this._visibles.forEach((t=>{t._prepareRender()}))}}class ti extends Ue{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}ti.defaults=Fe(Ze.defaults,{});class ei extends ze{_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}ei.defaults=Fe(ze.defaults,{text:"RealMap v1.1.1",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const ii="_model_",si="_tag_",ri="disabled",ni="rm-legend-item-marker",oi=Object.freeze([0,0]),ai=/s\+/;function hi(t){if(s(t))return[+t[0],+t[1]];if(n(t)){const e=t.split(ai);return[+e[0],+e[1]]}if(i(t)){if(t&&!isNaN(t.lon)&&!isNaN(t.lat))return[t.lon,t.lat];if(!isNaN(t.x)&&!isNaN(t.y))return[t.x,t.y]}return[0,0]}function li(t){return isFinite(t[0]+t[1])}function ci(t,e){return t[0]>=e.h1&&t[0]<=e.h2&&t[1]>=e.v1&&t[1]<=e.v2}function di(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const n of t){const t=n.map((t=>t[0])),o=n.map((t=>t[1]));e=d(e,...t),i=d(i,...o),s=_(s,...t),r=_(r,...o)}return{h1:e,v1:i,h2:s,v2:r}}const _i=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),ui=.001,pi=Math.PI;class gi{static line(t,e,i,s){return["M",t,e,"L",i,s]}static lines(...t){let e=0;const i=["M",t[e],t[e+1]];for(e+=2;e<t.length;e+=2)i.push("L",t[e],t[e+1]);return i}static lines2(...t){let e=0;const i=["M",t[e].x,t[e].y];for(e++;e<t.length;e++)i.push("L",t[e].x,t[e].y);return i}static lines3(...t){let e=0;const i=["M",t[e][0],t[e][1]];for(e++;e<t.length;e++)i.push("L",t[e][0],t[e][1]);return i}static box(t,e,i,s){return["M",t,e,"L",i,e,"L",i,s,"L",t,s,"Z"]}static rect(t){return this.rectangle(t.x,t.y,t.width,t.height)}static rectangle(t,e,i,s){return["M",t,e,"h",i,"v",s,"h",-i,"Z"]}static bar(t,e,i,s,r,n){return r>0?n>0?(r=d(-s/2,i/2,r),["M",t,e-(n=d(-s/2,i/2,n)),"v",s+n+r,"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]):["M",t,e,"v",s+(r=d(-s/2,i/2,r)),"a",r,r,0,0,1,r,-r,"h",i-2*r,"a",r,r,0,0,1,r,r,"v",-s-r,"Z"]:n>0?["M",t,e-(n=d(-s/2,i/2,n)),"v",s+n,"h",i,"v",-s-n,"a",n,n,0,0,1,-n,n,"h",2*n-i,"a",n,n,0,0,1,-n,-n,"Z"]:["M",t,e,"h",i,"v",s,"h",-i,"v",-s,"Z"]}static square(t,e,i,s){const r=d(i,s);return["M",t+=(i-r)/2,e+=(s-r)/2,"h",r,"v",r,"h",-r,"Z"]}static circle(t,e,i){return["M",t,e,"m",i,0,"a",i,i,0,1,1,2*-i,0,"a",i,i,0,1,1,2*i,0]}static ellipse(t,e,i,s){return this.arc(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,!0)}static arc(t,e,i,s,r,n,o,a=!1){const h=N(u(n-r)),d=2*pi-h<.01,_=h-pi<.01?0:1,p=o?1:0,g=l(r),m=c(r),f=l(n-=d?p?ui:-.001:0),b=c(n),y=[];return y.push("M",t+i*g,e+s*m,"A",i,s,0,_,p,t+i*f,e+s*b),d&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,i,s,r,n,o,a){const h=N(u(o-n)),d=2*pi-h<ui;let _=h-pi<ui?0:1;const p=a?1:0,g=l(n),m=c(n),f=l(o-=d?p?ui:-.001:0),b=c(o),y=i*r,w=s*r,x=[];return x.push("M",t+i*g,e+s*m,"A",i,s,0,_,p,t+i*f,e+s*b),d?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,_,1-p,t+y*g,e+w*m),x.push("Z"),x}static diamond(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s/2,"L",t+i/2,e+s,"L",t,e+s/2,"Z"]}static triangle(t,e,i,s){return["M",t+i/2,e,"L",t+i,e+s,"L",t,e+s,"Z"]}static itriangle(t,e,i,s){return["M",t,e,"L",t+i,e,"L",t+i/2,e+s,"Z"]}static star(t,e,i,s){let r=-Math.PI/2;const n=t+i/2,o=e+s/2+(s/2-s/2*c(r+6*Math.PI/5))/2,a=i/2,h=s/2,d=i/4,_=s/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",n+a*l(r),o+h*c(r));for(let t=0;t<5;t++)g.push("L",n+a*l(r),o+h*c(r),"L",n+d*l(r+p),o+_*c(r+p)),r+=u;return g.push("Z"),g}static setShape(t,e,i,s){let r;switch(e){case"square":case"diamond":case"triangle":case"itriangle":case"star":case"rectangle":r=gi[e](0,0,2*i,2*s);break;default:r=gi.circle(i,s,d(i,s))}t.setPath(r)}static pin(t){const{rd:e,cx:i,cy:s,innerRd:r}=t,n=["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&&n.push("M",i-r,s,"a",r,r,0,1,0,2*r,0,"a",r,r,0,1,0,2*-r,0),n}}const mi={minimumZoom:200,maximumZoom:1600},fi={};class bi extends Je{static register(...t){t.forEach((t=>{fi[t.type]=t}))}constructor(t,e){super(t),this.inBody=e}_type(){return this.constructor.type}refresh(){}_getNamePrefix(){return"annotation"}_load(t){return this.chart?super._load(this.chart.loadBase(t,"annotation",this._type())):super._load(t)}_doPrepareRender(t,e){}_getDefaultAlign(){return this._anchorObj?"center":super._getDefaultAlign()}}bi.defaults=Fe(Je.defaults,{front:!1});class yi extends Qe{constructor(t){super(t.chart),this.owner=t}getAnnotation(t){const e=this._map[t];if(e instanceof bi)return e}load(t,e){super.load(t,e),this.owner.options.annotations=this._items.map((t=>t.options))}prepareRender(){super.prepareRender(),this._visibles.forEach((t=>{t._anchorObj=t.options.anchor?this.owner.anchorByName(t.options.anchor):void 0}))}_loadItem(t,e,i,s){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,s);return a._init(),a.index=i,a._load(e),a}}const wi="route",xi="map",vi="feature",Si="vector",Ci="heatmap",Li="region",Pi="tiledweb",Mi="track",ki="band",Ai="table",Ii="sankey",Ni="glpoint";class Vi extends At{static create(t,e,i,s,r,n,o=0){return new Vi(t,e,{x:i,y:s,width:r,height:n,r:o})}constructor(t,e=void 0,i=void 0){super(t,e,"rect"),this.rect=i}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,i=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),i>0&&this.dom.setAttribute("rx",String(i))}}setBounds(t,e,i,s,r=0){return this.rect={x:t,y:e,width:i,height:s,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)}}class Ei{constructor(t,e){}}const Ti="@_rm_state_",Di="@_rm_add_",Ri="@_rm_update_",$i="@_rm_delete_";let Oi=0;const Fi=[0,0];class Bi{constructor(t){this.source=t,this.inset=Fi,this.pid=Oi++,this.visible=!0}setSelected(t){this._selected=t}isSelected(){return this._selected}get lon(){return this.coord[0]+this.inset[0]}get lat(){return this.coord[1]+this.inset[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:s(e)?0===e.length?this.isNull=!0:this._readArray(t,e):i(e)?this._readObject(t,e):this._readSingle(e),this.coord||(this.coord=t.chart.coordOfArea(this.id)),this._doInitValues()}_doInitValues(){}getValue(){return NaN}getLabel(t){var e;return this.name||(null===(e=this.source)||void 0===e?void 0:e.name)}vrate(){return this._prev&&!isNaN(this._prev.value)||isNaN(this._vr)?1:this._vr}_setVrate(t){this._vr=t}_aniRate(){return this._isStatic()?1:this._vr}updateValues(t,e){if(this._prev=this.copy(),i(e)?this.source=Object.assign(i(this.source)?this.source:{},e):s(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,i;if("value"===t)return this.getValue();if(t.indexOf(".")>0){const i=t.split(/\./g);let s=null!==(e=this[i[0]])&&void 0!==e?e:this.source[i[0]];for(let t=1;t<i.length;t++)s=s[i[t]];return s}return"baseValue"===t?this.getBaseValue():null!==(i=this[t])&&void 0!==i?i:this.source[t]}getCallout(t){const e=this.callout;if(e){const i=[t];for(let t=0;t<e.length;t++)i.push([isNaN(e[t][0])?i[t][0]:e[t][0],isNaN(e[t][1])?i[t][1]:e[t][1]]);return i}const i=this.offset;if(i){const e=[t];for(let t=0;t<i.length;t++)e.push([e[t][0]+(i[t][0]||0),e[t][1]+(i[t][1]||0)]);return e}}_setState(t){t?this[Ti]=t:delete this[Ti]}_isAdding(){return this[Ti]===Di}_isUpdating(){return this[Ti]===Ri}_isDeleting(){return this[Ti]===$i}_isStatic(){const t=this[Ti];return t!==Di&&t!==$i}_assignTo(t){return h(t,{id:this.id,index:this.index,name:this.name,color:this.color,className:this.className,coord:this.coord.slice(),source:this.source})}_readArray(t,e){var i,r,n,o,a,h;const l=t.options.fields;if(s(l))for(let t=0;t<l.length;t++)this[l[t]]=e[t];else this.id=null===(i=t._idFielder)||void 0===i?void 0:i.call(t,e),this.name=null===(r=t._nameFielder)||void 0===r?void 0:r.call(t,e),this.color=null===(n=t._colorFielder)||void 0===n?void 0:n.call(t,e),this.coord=[null===(o=t._lonFielder)||void 0===o?void 0:o.call(t,e),null===(a=t._latFielder)||void 0===a?void 0:a.call(t,e)],this.value=null===(h=t._valueFielder)||void 0===h?void 0:h.call(t,e)}_readObject(t,e){var i;if(this.id=f(t._idFielder(e),e.id),this.name=f(t._nameFielder(e),e.name),this.color=f(t._colorFielder(e),e.color),this.className=e.className,s(e.coord))this.coord=[+e.coord[0],+e.coord[1]];else if(n(e.coord)){const t=e.coord.split(ai);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 s=t._lonFielder(e),r=null===(i=t._latFielder)||void 0===i?void 0:i.call(t,e);isNaN(s)||isNaN(r)||(this.coord=[s,r])}}else this.coord=[e.x,e.y];else this.coord=[e.lon,e.lat];this.coord||(this.coord=this.id&&t.chart.coordOfArea(this.id)),isNaN(e.zindex)||(this._zindex=e.zindex),this.callout=s(e.callout)&&this.$_parseCallout(e.callout),s(this.callout)||(this.offset=s(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return n(t)&&(t=t.split(",")),s(t)&&(e=[],o(t[0])?e.push(t):t.forEach((t=>{if(s(t))e.push(t.slice(0,2));else if(n(t)){const i=t.split(/s\+/);e.push([i[0],i[1]])}}))),e.forEach((t=>{t[0]=parseFloat(t[0]),t[1]=parseFloat(t[1])})),e}_readSingle(t){n(t)&&(this.id=t)}}class zi{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){s(t)?this._points=this._owner.initPoints(t):this._points=[]}clear(){this._points=[]}insert(t,e){if(t<0)this.add(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,e);for(let s=t,r=i.length;s<r;s++)e.index=s}}insertAll(t,e){if(t<0)this.addAll(e);else{const i=this._points;t=Math.min(t,i.length),i.splice(t,0,...e);for(let e=t,s=i.length;e<s;e++)i[e].index=e}}add(t){this._points.push(t),t.index=this._points.length-1}addAll(t){const e=this._points.length;this._points.push(...t),t.forEach(((t,i)=>t.index=e+i))}remove(t){const e=this._points,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(let t=e.length-1;t>=i;t--)e[t].index=t;return!0}}removeAll(t){const e=this._points;let i=0;return t.forEach((t=>{const s=e.indexOf(t);s>=0&&(e.splice(s,1),i++)})),i>0&&e.forEach(((t,e)=>t.index=e)),i}sort(t){this._points.sort(t)}forEach(t){const e=this._points;for(let i=0,s=e.length;i<s&&!0!==t(e[i],i);i++);}find(t){return this._points.find((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}findAll(t){return this._points.filter((e=>{for(const i in t)if(e[i]!==t[i])return!1;return!0}))}}const ji={};class Hi extends Ge{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}get getPosition(){return this._getPosition}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 at.isValidNum(t)?this._getText(null,t,u(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return r(e)?(t.visibleCallback=e,t.visible=!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._domain.numberFormatter=this._numberFormatter}_doApply(t){super._doApply(t),t.positionCallback?this._getPosition=e=>t.positionCallback({point:e,chart:this.chart.wrapper})||t.position||Hi.DEFAULT_POSITION:this._getPosition=()=>t.position||Hi.DEFAULT_POSITION}}Hi.DEFAULT_POSITION="auto",Hi.defaults=Fe(Ge.defaults,{visible:!0,position:Hi.DEFAULT_POSITION,distance:25});class Gi extends ze{}Gi.defaults=Fe(ze.defaults,{shape:"circle",radius:2.5});class Wi extends ze{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),t.anchorPoint=(this._anchorPoint=new Gi(this.chart))._init()}get anchorPoint(){return this._anchorPoint}}Wi.defaults=Fe(ze.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class Yi{constructor(t,e){this._args=t,this._chart=e}get chart(){return this._chart}get count(){return this._points.length}get(t){if(t>=0&&t<this._points.length)return this._points[t].assignTo(this._args),this._args}}class Zi extends pt{constructor(t,e,i){super(),this.series=t,this.point=e,this.callback=i,this._init(e),this.endHandler=()=>{var t;this.point._setVrate(void 0),this.point._setState(null),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._update(this.point,Math.max(t,1e-7)),this.series._optionChanged(),!0}_init(t){this.duration=500,this.point._setVrate(0)}_update(t,e){this.point._setVrate(e)}}class Ui extends pt{constructor(t,e,i){super(),this.series=t,this.points=e,this.callback=i,this._init(e),e.forEach((t=>{var e;t&&t._prev&&(null===(e=t._prev.ani)||void 0===e||e.stop(),delete t._prev)})),this.duration=500,this.endHandler=()=>{var t;this.points.forEach((t=>{t&&(t._setVrate(void 0),t._setState(null))})),this.series._optionChanged(),null===(t=this.callback)||void 0===t||t.call(this,this.points),this.series=this.points=this.callback=null}}_doUpdate(t){return this._update(this.points,Math.max(t,1e-7)),this.series._optionChanged(),!0}_update(t,e){t.forEach((t=>t._setVrate(e)))}}class Xi extends Zi{_init(t){super._init(t),t._setState(Di)}}class Ki extends Zi{_init(t){super._init(t),t._setState($i),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class qi extends Zi{_init(t){super._init(t),t._setState(Ri)}}class Ji extends Ui{_init(t){t.forEach((t=>{t._setState(Di),t._setVrate(0)}))}}class Qi extends Ui{_init(t){t.forEach((t=>{t._setState($i),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class ts extends Ui{_init(t){t.forEach((t=>{t._setState(Ri),t._setVrate(0)}))}}class es extends ze{static register(...t){t.forEach((t=>{ji[t.type]=t}))}static getPointTooltipParam(t,e,i){return"series"===i?t.displayName():e.getParam(i)}constructor(t){super(t),this._index=-1,this._seriesIndex=-1,this._mapChanged=!0,this._dataSourceDirty=!0,this._dataDirty=!1,this._maxZindex=0,this._points=new zi(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new Yi(this.$_createPointArgs(),this.chart.wrapper),t.pointLabel=(this._pointLabel=this._createLabel(this.chart))._init(),t.callout=(this._callout=new Wi(this))._init()}_createLabel(t){return new Hi(t)}getTooltipText(t,e){var i;const s=this._op.tooltipText;return this._op.tooltipCallback?(this._getPointArgs(this._pointArgs,e),null!==(i=this._op.tooltipCallback(this._pointArgs))&&void 0!==i?i:n(s)?s:es.defaultTooltipText):"boolean"==typeof s?s?es.defaultTooltipText:null:s}getTooltipParam(t,e,i){return es.getPointTooltipParam(t,e,i)}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 index(){return this._index}get name(){return this._name}get pointLabel(){return this._pointLabel}get map(){return this._map}get callout(){return this._callout}get cluster(){return null}displayName(){return this._op.label||this.name||`Series${this.index}`}get data(){return this._data}$_setData(t,e){if(t!==this._data||e!==this._dataPath)return this._data=at.valueAt(t,this._dataPath=e),this._dataSourceDirty=!0,!0}get pointCount(){return this._points.count}followTooltipPointer(){return!1}isEmpty(t){return t?this._visPoints.length<1:this._points.isEmpty()}isDataSeries(){return!0}isMapSeries(){return!1}getDetailed(){return this}getValueRange(){}needMapScale(){return!1}needTranslate(){return!0}contains(t){return this._points.contains(t)}isExcluded(t){return!1}initPoints(t){const e=this.chart.map,i=t.map(((t,e)=>this.$_addPoint(t,e)));return e&&e._insets.length>0&&i.forEach((t=>{const i=e.insetAt(t.coord);i&&(t.inset=i.off)})),this._zindexDirty=this._maxZindex>0,i}getPoint(t){return this._points.get(t)}find(t){return this._points.find(t)}findAll(t){return this._points.findAll(t)}getPointText(t,e,i){let s;return this._pointLabelCallback&&(this._pointArgs.labelIndex=e,this._getPointArgs(this._pointArgs,t),s=this._pointLabelCallback(this._pointArgs),null!=s)?s:i}getPointArgs(t){return this._getPointArgs(this._pointArgs,t)}getPointStyle(t){if(this._op.styleCallback)return this._op.styleCallback(this._getPointArgs(this._pointArgs,t))}getPointLabelStyle(t){if(this.pointLabel.options.styleCallback)return this.pointLabel.options.styleCallback(this._getPointArgs(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&&(this._pointLabelVisCallback?(this._getPointArgs(this._pointArgs,t),this._pointLabelVisCallback(this._pointArgs)):!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,e){this._legend===t&&e.push(this)}getLabelOff(){return g(this._pointLabel.options.offset,this._defLabelOff())}_defLabelOff(){return 0}setCalcedColor(t,e){this._calcedColor=t[e]}pointById(t){return this._points.pointById(t)}canAddAnimation(){return!0}canRemoveAnimation(){return!0}$_dataPointsChanged(){this._dataDirty=!0,this.chart._dataChanged(this)}loadData(t,e=!0){return this.$_setData(t,this._op.dataPath)&&(this._dataLoaded=e,this.$_dataPointsChanged()),this}addPoint(t,e=-1,i=500){var s,r;const n=this.$_addPoint(t,-1);return this._points.insert(e,n),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?(n._prev={},n._prev.ani=new Xi(this,n,(t=>{var e,i;null===(i=(e=this._op).onPointAdded)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(i).start()):null===(r=(s=this._op).onPointAdded)||void 0===r||r.call(s,this._getPointArgs(this._pointArgs,n)),n}addPointList(t,e=-1,i=500){var r,n;if(!s(t)||t.length<1)return;const o=t.map(((t,e)=>this.$_addPoint(t,-1)));return this._points.insertAll(e,o),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?new Ji(this,o,(t=>{var e,i;null===(i=(e=this._op).onPointListAdded)||void 0===i||i.call(e,this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(i).start():null===(n=(r=this._op).onPointListAdded)||void 0===n||n.call(r,this._getPointListArgs(o)),o}removePoint(t,e=300){var i,s,r,a;o(t)?t=this._points.get(t):n(t)&&(t=this._points.pointById(t)),this._points.contains(t)&&(this.chart.animatable()&&e>0&&this.canRemoveAnimation()?(null===(s=null===(i=t._prev)||void 0===i?void 0:i.ani)||void 0===s||s.stop(),t._prev={},t._prev.ani=new Ki(this,t,(t=>{var e,i;this._points.remove(t),null===(i=(e=this._op).onPointRemoved)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(e).start()):(this._points.remove(t),null===(a=(r=this._op).onPointRemoved)||void 0===a||a.call(r,this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];o(i)?t[e]=this._points.get(+i):n(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i,s;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new Qi(this,t,(t=>{var e,i;this._points.removeAll(t),null===(i=(e=this._op).onPointListRemoved)||void 0===i||i.call(e,this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(e).start():(this._points.removeAll(t),null===(s=(i=this._op).onPointListRemoved)||void 0===s||s.call(i,this._getPointListArgs(t)),this.$_dataPointsChanged())}removePointList(t,e=300){const i=this.$_points(t).filter((t=>this._points.contains(t)));return i.length>0&&this.$_remove(i,e),i}clearPoints(t=300){this.$_remove(this._points.getPoints(),t)}removeFirst(t=300){this.removePoint(this._points.first,t)}removeLast(t=300){this.removePoint(this._points.last,t)}updatePoint(t,e,i=300){var s,r;if(n(t)?t=this._points.pointById(t):o(t)&&(t=this._points.get(t)),t instanceof Bi&&this._points.contains(t)){let n=t._prev;return n&&n.ani&&n.ani.stop(),n=t.updateValues(this,e),n&&(this.$_dataPointsChanged(),this.chart.animatable()&&i>0?n.ani=new qi(this,t,(t=>{var e,i;null===(i=(e=this._op).onPointUpdated)||void 0===i||i.call(e,this._getPointArgs(this._pointArgs,t))})).setDuration(i).start():null===(r=(s=this._op).onPointUpdated)||void 0===r||r.call(s,this._getPointArgs(this._pointArgs,t))),!!n}return!1}updatePointList(t,e,i=300){var s,r;const n=this.$_points(t).filter((t=>this._points.contains(t)));n.length>0&&(n.forEach((t=>t.updateValues(this,e[0]))),this.$_dataPointsChanged(),this.chart.animatable()&&i>0?new ts(this,n,(t=>{var e,i;null===(i=(e=this._op).onPointListUpdated)||void 0===i||i.call(e,this._getPointListArgs(t))})).setDuration(i).start():null===(r=(s=this._op).onPointListUpdated)||void 0===r||r.call(s,this._getPointListArgs(n)))}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){if(this._op.onPointClick)return this._getPointArgs(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])}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0),this.$_bringToFront(t);this.chart._selectionChanged(this,e)}unselectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!1);this.chart._selectionChanged(this,e)}$_bringToFront(t){t instanceof Bi&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0,this._optionChanged(t))}lock(){}unlock(){}_setLegend(t){this._legend=t}_doApply(t){super._doApply(t),this._name=t.name||`Series ${this.index+1}`,this._createFielders(t),this.$_setData(t.data,t.dataPath);const e=this.chart.getMap(t.map)||this.chart.map;e!==this._map&&(this._map=e,this._mapChanged=!0)}_isPointsDirty(){return this._dataSourceDirty}_prepareRender(){if(this._mapChanged&&this._doMapChanged(),this._isPointsDirty()){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._dataDirty?(this._runPoints=this._points.getPoints(),this._visPoints=this._runPoints.filter((t=>t.visible))):this._runPoints||(this._visPoints=[],this._runPoints=[]);this._visPoints.forEach((t=>t._excluded=this.isExcluded(t))),super._prepareRender()}_doAfterRender(){this._optionsDirty=this._dataSourceDirty=this._dataDirty=this._zindexDirty=this._mapChanged=!1}_doMapChanged(){}_doPrepareRender(t,e){const i=e.pointColors;let a,h,l;this._runColor=o(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color,r(i)?a=i:s(i)?h=i:n(i)&&(l=this.chart._assets.get(i)),a?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||a(this._getPointArgs(this._pointArgs,t))})):l instanceof Kt?(l.prepare(),this._runPoints.forEach(((t,e)=>{t._runColor=t.color||l.getNext()}))):h?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||h[e%h.length]})):this._runPoints.forEach(((t,e)=>{t._runColor=t.color})),this._preparePointArgs(this._pointArgs)}_setIndex(t,e){this._index=t,isNaN(e)||(this._seriesIndex=e++)}$_addPoint(t,e){const i=this._createPoint(t);return e>=0&&(i.index=e),i.parse(this),isNaN(i._zindex)||(this._maxZindex=Math.max(this._maxZindex,i._zindex)),i}_createFielder(t){return r(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 Vi.create(t,ni,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 Ei);else if(s(t))return t}$_loadPoints(t){var e,i;this._doLoadPoints(t),null===(i=(e=this._op).onPointsLoaded)||void 0===i||i.call(e,this,!this._loaded),this._loaded=!0}_doLoadPoints(t){this._points.load(t)}$_createPointArgs(){return{series:this}}_getPointArgs(t,e){return e!==this._argsPoint&&(this._argsPoint=e).assignTo(t),t}_getPointListArgs(t){return this._pointListArgs._points=t||[],this._pointListArgs}_preparePointArgs(t){this._pointLabelCallback=this._pointLabel.options.textCallback,this._pointLabelVisCallback=this._pointLabel.options.visibleCallback,this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count}_calcMinMax(t){let e,i;return t.forEach((t=>{const s=t.getValue();isNaN(s)||(e=isNaN(e)?s:d(s,e),i=isNaN(i)?s:_(s,i))})),{min:e,max:i}}}es.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",es.defaults=Fe(ze.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:es.defaultTooltipText,loadAnimation:"default",legend:0});class is extends je{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,e){const r=this.chart;this._items=[],this._map={},s(t)?t.forEach(((t,e)=>{this.$_loadItem(r,t,e)})):i(t)&&this.$_loadItem(r,t,0),r.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(t){const e=[];return this._items.forEach((i=>i.getLegendSources(t,e))),e}_prepareRender(t,e){this._items.forEach((t=>t._setLegend(e.get(t.options.legend,null)))),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 es?e=t:n(t)&&(e=this._map[t]),e)return this._items.splice(this._items.indexOf(e),1),delete this._map[e.name],this._items.forEach(((t,e)=>t._setIndex(e))),e}$_loadItem(t,e,i,s){let r=t._getSeriesType(e.type||"map");if(!r&&e.type&&console.error(`Unknown series type: '${e.type}'`),!r&&(r=t._getSeriesType(s||t.type),!r))throw new Error("Invalid series type: "+e.type+", "+t.type);const n=new r(t);return n._init(),n.isDataSeries()&&n._setIndex(i,t._seriesIndex++),n._load(e),this.$_addSeries(n,i)}$_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 ss extends Bi{_readObject(t,e){super._readObject(t,e),this.value=t._valueFielder(e),null==this.value&&(this.value=NaN)}_readArray(t,e){super._readArray(t,e),null==this.value&&(this.value=NaN)}_assignTo(t){const e=super._assignTo(t);return e.value=this.value,e}getValue(){return isNaN(this._vr)||!this._prev||isNaN(this._prev.value)?this.value:y(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}}class rs extends es{_createFielders(t){super._createFielders(t),this._valueFielder=this._createValueFielder(t),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}_createValueFielder(t){return this._createFielder(t.valueField||"value")}}rs.defaults=Fe(es.defaults,{valueField:"value"});class ns extends rs{isExcludedCoord(t){if(this._excludes)for(let e=0;e<this._excludes.length;e++){const i=this._excludes[e];if(t[0]>=i[0][0]&&t[0]<=i[1][0]&&t[1]>=i[1][1]&&t[1]<=i[0][1])return!0}}isExcluded(t){return this.isExcludedCoord(t.coord)}_doApply(t){if(super._doApply(t),e.call(t,"excludeBounds")){const e=t.excludeBounds,r=[];if(i=e,Array.isArray(i)&&i.length>0)for(let t=0;t<e.length;t+=2){const i=e[t],n=e[t+1];if(s(i)&&s(n)){const t=+i[0],e=+i[1],s=+n[0],o=+n[1];isNaN(t)||isNaN(e)||isNaN(s)||isNaN(o)||r.push([[d(t,s),_(e,o)],[_(t,s),d(e,o)]])}}this._excludes=r.length>0?r:void 0}var i}}ns.defaults=Fe(rs.defaults,{});class os extends ss{}class as extends ns{}as.defaults=Fe(ns.defaults,{});class hs extends ss{getPoints(t,e,i){const s=t.length,r=[];const n=i-e;for(let i=0;i<s;i++){const o=t[i],a=5+i/(s-1)*90,h=10+(isNaN(o)||0==n?80:80*(1-(o-e)/n));r.push(a,h)}return r}getBasePoint(t,e,i){const s=e-t;return 0+(isNaN(i)||0==s?100:100*(1-(i-t)/s))}getSum(){return isNaN(this._sum)?this._sum=s(this.values)?this.values.reduce(((t,e)=>t+g(e,0)),0):0:this._sum}_readObject(t,e){super._readObject(t,e);const i=this.value;this.values=s(i)?i.slice():isNaN(i)?[]:[i]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class ls{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return Vi.create(t,ni,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class cs extends ns{getMinMax(t){let e=NaN,i=NaN;for(const s of t)for(const t of s.values)isNaN(t)||(e=isNaN(e)?t:Math.min(e,t),i=isNaN(i)?t:Math.max(i,t));return{min:e,max:i}}_doApply(t){super._doApply(t),this._categories=this.$_parseCategories(t.categories)}_createValueFielder(t){const e=t.valueFields;return s(e)&&e.length>0?t=>e.map((e=>t[e])):super._createValueFielder(t)}getLegendSources(t,e){this._legend===t&&(this._op.legendByCategory&&this._categories?e.push(...this._categories):e.push(this))}$_parseCategories(t){if(s(t))return t.map((t=>new ls(t.name,t.color)))}_splitColors(){let t=0;if(this._visPoints.forEach((e=>{t=Math.max(t,e.values?e.values.length:0)})),t<2)return[this._calcedColor];{const e=Ce.create("white"),i=Ce.create(this._calcedColor),s=new Array(t);for(let r=t;r<2*t;r++)s[r-t]=Ce.interpolate(e,i,r/(2*t)).toString();return s}}}cs.defaults=Fe(ns.defaults,{position:"top"});class ds extends hs{}class _s extends cs{_doInit(t){super._doInit(t),t.baseLine=(this._baseLine=new ze(this.chart))._init()}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=at.getMinMax(t),s=i.base=this._op.baseValue;if(e)i.min=isNaN(s)?e.min:Math.min(e.min,s),i.max=isNaN(s)?e.max:Math.max(e.max,s);else{const t=g(this._minValue,i.min),e=g(this._maxValue,i.max);i.min=isNaN(s)?Math.min(t,i.min):Math.min(t,i.min,s),i.max=isNaN(s)?Math.max(e,i.max):Math.max(e,i.max,s)}return i}getPadding(t){return g(W(this._paddingDim,t),0)}_doApply(t){super._doApply(t),this._width=g(+t.width,_s.DEF_WIDTH),this._height=g(+t.height,_s.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+t.minValue,this._maxValue=+t.maxValue,this._pointDomain="point"===t.valueDomain}}_s.DEF_WIDTH=80,_s.DEF_HEIGHT=50,_s.defaults=Fe(cs.defaults,{width:_s.DEF_WIDTH,height:_s.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class us extends ss{}class ps extends ns{_doApply(t){super._doApply(t),this._width=g(+t.width||+t.size||+t.height,ps.DEF_SIZE),this._height=g(+t.height||+t.size||+t.width,ps.DEF_SIZE)}}ps.DEF_SIZE=60,ps.defaults=Fe(ns.defaults,{size:ps.DEF_SIZE});class gs extends ps{getValueRate(t){return(g(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=g(this._minValue,1/0),i=g(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t.getValue();t.isNull||isNaN(s)||(e=d(e,s),i=_(i,s))})),this._min=e,this._max=i}}gs.defaults=Fe(ps.defaults,{minValue:10});class ms extends os{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}}class fs extends Hi{}fs.defaults=Fe(Hi.defaults,{visible:!1});class bs extends as{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=new fs(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,i){if(isNaN(t))return 0;let s=this._noSize?1:(Math.max(this._vMin,Math.min(t,this._vMax))-this._vMin)/(this._vMax-this._vMin);return"area"==this._op.sizeMode&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getSubLabelOff(){return g(this._subLabel.options.offset,0)}_doApply(t){super._doApply(t),this._setDims(t,"minSize","maxSize"),this._extMin=+t.minValue,this._extMax=+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,e){super._doPrepareRender(t,e);const i=this._extMin,s=this._extMax;if(!isNaN(i)&&!isNaN(s)&&this._runPoints.length>0)this._noSize=i>s||(this._vMin=i)===(this._vMax=s);else{let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((r=>{const n=r.getValue();r.isNull||isNaN(n)||(isNaN(i)&&(t=d(t,n)),isNaN(s)&&(e=_(e,n)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}}}bs.type="bubble",bs.defaults=Fe(as.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class ys extends ze{}ys.defaults=Fe(ti.defaults,{length:10});class ws extends Ge{getText(t){return at.isValidNum(t)?this._getText(null,t,u(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}ws.defaults=Fe(ti.defaults,{offset:4});class xs extends ze{_doInit(t){t.line=(this._line=new ys(this.chart))._init(),t.label=(this._label=new ws(this.chart))._init()}get line(){return this._line}get label(){return this._label}}xs.defaults=Fe(ti.defaults,{});class vs extends ti{_doInit(t){super._doInit(t),t.tick=(this._tick=new xs(this.chart))._init()}get tick(){return this._tick}getSteps(t,e){const i=this._op,s=this._series,r=this._steps;if(s instanceof bs){let{min:n,max:o}=s.getPixelMinMax(d(t,e));isNaN(i.minRadius)||(n=i.minRadius),isNaN(i.maxRadius)||(o=i.maxRadius),r.forEach((t=>{t.rd=s.getRadius(t.value,n,o)}))}else if(r.length>0){const t=g(i.minRadius,10),e=g(i.maxRadius,50)-t,s=r[0].value,n=r[r.length-1].value-s;r.forEach((i=>{i.rd=t+e*(i.value-s)/n}))}return r}_type(){return"bubbleScale"}isVertical(){return!0}_getScaledSeries(t){return t.getFirstSeries("bubble")}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._steps=this.$_buildSteps()}$_buildSteps(){const t=this._op.steps,e=[];if(s(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=Fe(ti.defaults,{});class Ss extends Ke{_collectionProp(){return"bubbleScale"}_createWidget(t){return new vs(t)}beforeRender(){this._collectVisibles()}}class Cs extends ze{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}Cs.MARKER_SIZE=10;class Ls extends Ue{items(){return this._items.slice(0)}isEmpty(){return!this._items||this._items.length<1}isInner(){return"body"===this.getLocation()}getLayout(){const t=this.getLocation();if("auto"!==this._op.layout||"body"===t)return this._op.layout;switch(t){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)}_type(){return"legend"}isVertical(){return"horizontal"!==this.getLayout()}isVisible(){if(this._items)return!0===this.visible&&this._items.length>0||!1!==this.visible&&this._items.length>1}_doInit(t){super._doInit(t)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.maxWidth)!==e._maxWidth&&(e._maxWidth=i,e._maxWidthDim=G(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=G(t,!0))}(t.maxHeight)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new Cs(this,t))),e.reversed&&(this._items=this._items.reverse())}}Ls.defaults=Fe(Ze.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:Cs.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class Ps extends Ke{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new Ls(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class Ms{constructor(t){this._color1=Ce.create(t.minColor),this._color2=Ce.create(t.maxColor),this._logger=at.getLogger(t.logBase)}getColor(t,e,i,s){if(isNaN(i))return;const r=this._logger;if(r){const s=1-t;t=r(t+s),e=r(e+s),i=r(i+s)}if(this._color1&&this._color2)return Ce.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return b(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class ks extends ze{_doInit(t){t.label=(this._label=new He(this.chart))._init()}get label(){return this._label}getMarkerSize(){return g(this._op.size,7)}}ks.defaults=Fe(ze.defaults,{size:7});class As extends ze{}As.defaults=Fe(ze.defaults,{length:6});class Is extends Ge{getDefaultIconPos(){}}Is.defaults=Fe(Ge.defaults,{});class Ns extends ze{_doInit(t){t.line=(this._line=new As(this.chart))._init(),t.label=(this._label=new Is(this.chart))._init()}get line(){return this._line}get label(){return this._label}}Ns.defaults=Fe(ze.defaults,{});class Vs{constructor(t,e,i,s,r){this.from=t,this.to=e,this._color1=i,this._color2=s,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 i=+e||Cs.MARKER_SIZE;return Vi.create(t,ni,0,0,i,i,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 i=this._color1,s=this._color2;if(!i)return(s||e).toString();const r=this.from,n=this.to;if(i&&s)return Ce.interpolate(i,s,(t-r)/(n-r)).toString();return b(s,e,i).brighten(1-(t-r)/(n-r)).toString()}}class Es extends ze{}Es.defaults=Fe(ze.defaults,{});class Ts extends ze{getLabel(){var t;return null!==(t=this._op.label)&&void 0!==t?t:"No Data"}getGap(){return g(+this._op.gap,0)}}Ts.defaults=Fe(ze.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const Ds="#fff",Rs=Ce.create("#000");class $s extends ti{_doInit(t){super._doInit(t);const e=this.chart;t.marker=(this._marker=new ks(e))._init(),t.stepLine=(this._stepLine=new Es(e))._init(),t.tick=(this._tick=new Ns(e))._init(),t.nullStep=(this._nullStep=new Ts(e))._init()}getColor(t,e,i,s){const r=this._steps;if(!isNaN(i)){if(this._logger&&(i=this._logger(i)),r){for(let t=0,e=r.length;t<e;t++)if(r[t].constains(i,t===e-1))return r[t].getColor(i,s);return i<=this._min?r[0]._color1.toString():s.toString()}return Ce.interpolate(this._minColor,this._endColor,(i-this._min)/(this._max-this._min)).toString()}if(this._op.nullStep.visible)return this._op.nullStep.color}get marker(){return this._marker}get stepLine(){return this._stepLine}get tick(){return this._tick}get nullStep(){return this._nullStep}get minColor(){return this._minColor}get endColor(){return this._endColor}getRanger(){return this}getLayout(){switch(this._op.layout){case"horizontal":case"vertical":return this._op.layout;default:{const t=this.getLocation();return"left"===t||"right"===t?"vertical":"horizontal"}}}getBarSize(t,e,i){let s,r;return i?(r=this._barLengthDim?W(this._barLengthDim,e):e,s=g(this._op.barWidth,12)):(s=this._barLengthDim?W(this._barLengthDim,t):t,r=g(this._op.barWidth,12)),{width:s,height:r}}getSplitPoints(t,e,i){const s=this._steps,r=this._valueSteps,n=s?s.length:r?r.length-1:0,o=e?n+1:n,a=[];if(e&&(t-=i),n>0)for(let e=0;e<n;e++)a.push((e+1)/o*t);return a}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 i=0,s=e.length;i<s;i++){const r=e[i].getPosition(t,i===s-1);if(!isNaN(r))return(i+r)/s}}getTicks(){const t=this._tick.label,e=this._steps,i=this._valueSteps,s=this._min,r=this._max;let n,o=[];if(e){n=e.length,o.push({pos:e[0].from=g(e[0].from,s)});for(let t=1;t<n;t++)o.push({pos:e[t].from=g(e[t].from,e[t-1].to)});o.forEach(((t,i)=>t.label=e[i].label)),o.push({pos:e[n-1].to=g(e[n-1].to,r)})}else if(i){n=i.length,o.push({pos:i[0]});for(let t=1;t<n-1;t++)o.push({pos:i[t]});o.push({pos:i[n-1]})}else o=[{pos:s},{pos:r}];const a=this._logBase;return n=o.length-1,o.forEach(((e,i)=>{if(null==e.label){const s=this._logger?Math.pow(a,e.pos):e.pos;e.label=t.getNumberText(s,!1,!1,0===i?"trunc":i===n?"ceil":void 0)}})),o}getSteps(){return this._steps}getLegendSources(t){"legend"!==this._op.display&&"both"!==this._op.display||(this._buildSteps(),this._steps&&this._steps.forEach((e=>t.push(e))))}_buildSteps(){var t;this._endColor=this._maxColor||(null===(t=this._series)||void 0===t?void 0:t.color)||Rs,this._steps=this.$_buildSteps()}_type(){return"colorScale"}isVertical(){return"horizontal"!==this.getLayout()}getDefaultDisplay(t){return"stack"}_doApply(t){super._doApply(t),this._setDim(t,"barLength"),this._minColor=Ce.create(t.minColor||Ds),this._maxColor=t.maxColor&&Ce.create(t.maxColor),this._colors=this.$_parseColorStops(t.colors)}_getScaledSeries(t){return t.findSeries((t=>{const e=t.getColorScale();return e===this.index||e&&e===this._op.name}))||t.firstMapSeries}$_parseColorStops(t){const e=[];if(s(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:Ce.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:Ce.create(t[0].color)})}else e.push({stop:0,color:this._minColor},{stop:1,color:this._endColor});return(e.length<1||isNaN(e[0].stop))&&e.unshift({stop:0,color:this._minColor}),(e.length<2||isNaN(e[e.length-1].stop))&&e.push({stop:1,color:this._endColor}),e}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=null===(i=this._series)||void 0===i?void 0:i.getValueRange();this._min=+e.minValue,this._max=+e.maxValue,this._logger=at.getLogger(this._logBase=e.logBase),s&&(isNaN(this._min)&&(this._min=s.min),isNaN(this._max)&&(this._max=s.max))}$_parseValue(t,e,i){return n(t)?t.endsWith("%")?e+(i-e)*parseFloat(t)/100:void 0:t}$_parseColor(t){return t&&t.endsWith("%")?Ce.interpolate(this._minColor,this._endColor,parseFloat(t)/100):Ce.create(t)}$_buildSteps(){const t=this._op,e=t.solidFill,i=t.steps,r=[],n=this._min,o=this._max;let a=n,h=o;if(this._valueSteps=null,s(i)&&i.length>0){let t="0%";i.forEach(((s,n)=>{var o;let l,c,d=this.$_parseValue(s.from,a,h),_=this.$_parseValue(s.to,a,h);if(0===n&&isNaN(d)&&(d=a),n===i.length-1&&isNaN(_)&&(_=h),s.fromColor&&s.toColor)l=this.$_parseColor(s.fromColor),c=this.$_parseColor(t=s.toColor);else if(e){let t=s.toColor||s.fromColor||s.color;t=0===n?t||"0%":t||"100%",c=l=this.$_parseColor(t)}else l=this.$_parseColor(s.fromColor||t),c=this.$_parseColor(t=(null!==(o=s.toColor)&&void 0!==o?o:s.color)||"100%");r.push(new Vs(d,_,l,c,s.label))}))}else if(a>=h)r.push(new Vs(a,h,e?this._endColor:this._minColor,this._endColor,void 0));else if(!isNaN(a)&&!isNaN(h)){const i=t.logBase,s=this._logger&&a>=0&&h-a>=i?this._logger:null,n=this._valueSteps=[],o=Math.max(1,g(t.stepCount,1));if(s&&(a=s(a),h=s(h)),t.integralSteps)n.push(...at.normalizeToSteps([a,h],o+1));else{const t=(h-a)/o;n.push(a);for(let e=1;e<o;e++)n.push(T(n[e-1]+t));n.push(T(h))}if(this._min=n[0],this._max=n[o],e){const t=this._minColor,e=this._endColor,i=n.length-1;for(let s=1;s<=i;s++){const o=Ce.interpolate(t,e,s/i);r.push(new Vs(n[s-1],n[s],o,o,void 0))}}}return r.length>1?r:void 0}}$s.defaults=Fe(ze.defaults,{display:"scale",minColor:Ds,layout:"auto",barWidth:12,barLength:"40%"});class Os extends Ke{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.options.display))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_collectionProp(){return"colorScale"}_createWidget(t){return new $s(t)}beforeRender(){this._collectVisibles()}}class Fs extends ze{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()}contains(t){return this._module&&this._module.contains(t)}hideContextMenu(){this._module&&this._module.hideContextMenu()}exportToImage(t,e,i){this._module&&this._module.exportToImage(t,e,i)}}Fs.defaults=Fe(ze.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1,hideNavigator:!1,hideScrollbar:!1,hideZoomButton:!1});class Bs extends ze{_doSetSimple(t,e){return at.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}Bs.defaults=Fe(ze.defaults,{});class zs extends ze{_doInit(t){t.line=(this._line=new Bs(this.chart))._init(),t.lonLine=(this._lonLine=new Bs(this.chart))._init(),t.latLine=(this._latLine=new Bs(this.chart))._init()}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this._fitTo}getLonStep(){return Math.max(0,m(this._lonLine.options.step,this._line.options.step,this.$_defaultStep()))}getLatStep(){return Math.max(0,m(this._latLine.options.step,this._line.options.step,this.$_defaultStep()))}_doApply(t){super._doApply(t),this._fitTo=t.fitTo}$_defaultStep(){return 10}}zs.defaults=Fe(ze.defaults,{visible:!1,fitTo:"map"});class js extends ze{}js.defaults=Fe(ze.defaults,{visible:!1});class Hs extends ze{}Hs.defaults=Fe(ze.defaults,{visible:!1});class Gs extends He{getText(t,e){let i=this._op.suffix;if(this._symbolPos>=0){let s=100;t?e<0?s=1:e>0&&(s=0):0===e||180===e||(e<0?s=3:e>0&&(s=2)),i=i.replace("°°","°"+this._symbols.charAt(s))}return i=e+i,this._op.prefix&&(i=this._op.prefix+i),i}_doApply(t){super._doApply(t),this._symbolPos=t.suffix?t.suffix.indexOf("°°"):-1,this._symbols=t.dirSymbols||Gs.defaults.dirSymbols}}Gs.defaults=Fe(He.defaults,{dirSymbols:"NSEW",suffix:"°°"});class Ws extends ze{_doInit(t){t.line=(this._line=new Hs(this.chart))._init(),t.label=(this._label=new Gs(this.chart))._init()}get line(){return this._line}get label(){return this._label}visibleAt(t){return this._positions.includes(t)}getLonInterval(){return Math.max(1,m(this._op.lonInterval,this._op.interval,1))|0}getLatInterval(){return Math.max(1,m(this._op.latInterval,this._op.interval,1))|0}_doApply(t){super._doApply(t),this._positions=s(t.positions)?t.positions:[]}}Ws.defaults=Fe(ze.defaults,{visible:!1,positions:["top","right"],interval:1});class Ys extends Ge{getDefaultIconPos(){return"left"}}Ys.defaults=Fe(Ge.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class Zs extends ze{_doInit(t){t.label=(this._label=new Ys(this.chart))._init()}get label(){return this._label}}Zs.defaults=Fe(ze.defaults,{front:!0,zindex:0});class Us extends Zs{}Us.defaults=Fe(Zs.defaults,{});class Xs extends Zs{}Xs.defaults=Fe(Zs.defaults,{});class Ks extends Zs{}Ks.defaults=Fe(Zs.defaults,{});class qs extends ze{}qs.defaults=Fe(ze.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class Js extends ze{constructor(t){super(t.chart),this.axis=t}_doInit(t){this.options.flag=(this._flag=new qs(this.chart))._init(),this._args={chart:this.chart.wrapper,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 i=re.getFormatter(e.numberFormat).toStr(t);return e.prefix&&(i=e.prefix+i),e.suffix&&(i+=e.suffix),i}moved(t,e,i){}_doSetSimple(t,e){return r(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}Js.defaults=Fe(ze.defaults,{visible:!1});class Qs extends ze{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 zs(this.chart))._init(),this.options.tick=(this._tick=new Ws(this.chart))._init(),this.options.crosshair=(this._crosshair=new Js(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()}get lonInterval(){return this.chart.body.projection.lonElliptic?this._lonInterval:NaN}get latInterval(){return this.chart.body.projection.latElliptic?this._latInterval:NaN}_doApply(t){if(super._doApply(t),e.call(t,"guide")){const e=t.guide;e!==this._saveGuide&&(this._saveGuide=e,this.$_loadGuides(s(e)?e:[e]))}this._lonInterval=Math.max(1,m(t.lonInterval,t.interval,10)),this._latInterval=Math.max(1,m(t.latInterval,t.interval,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new Ks(this.chart):"line"===t.type?new Us(this.chart):"band"===t.type?new Xs(this.chart):new Us(this.chart),i._init(),i._load(t),e.push(i)}))}}function tr(t,e){const[i,s]=t;let r=!1;for(let t=0,n=e.length-1;t<e.length;n=t++){const[o,a]=e[t],[h,l]=e[n];a>s!=l>s&&i<(h-o)*(s-a)/(l-a)+o&&(r=!r)}return r}function er(t,e){let i=!1;tr(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)tr(t,e[s])&&(i=!i);return i}Qs.defaults=Fe(ze.defaults,{interval:5});class ir{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:i,maxLat:s}=this.bbox,r=(t+i)/2,n=(e+s)/2,o={minLon:t,minLat:n,maxLon:r,maxLat:s},a={minLon:r,minLat:n,maxLon:i,maxLat:s},h={minLon:t,minLat:e,maxLon:r,maxLat:n},l={minLon:r,minLat:e,maxLon:i,maxLat:n};this.children=[new ir(o,this.capacity),new ir(a,this.capacity),new ir(h,this.capacity),new ir(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 i of this.children)if(this.isContained(t.bbox,i.bbox)&&(e=i.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,i){return t>=i.minLon&&t<=i.maxLon&&e>=i.minLat&&e<=i.maxLat}queryPoint(t,e,i=[]){if(!this.containsPoint(t,e,this.bbox))return i;for(const s of this.entries)this.containsPoint(t,e,s.bbox)&&i.push(s);if(this.divided&&this.children)for(const s of this.children)s.queryPoint(t,e,i);return i}}class sr{constructor(t,e){var i;this.worldBBox=t,this.root=new ir(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!==(i=t.source.polygon)&&void 0!==i?i: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 er(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(er(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}const rr="37630",nr={area:"39",name:"제주특별자치도",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"},or={area:rr,name:"울릉도",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"},ar={area:"",name:"백령도",parent:"23,23520",polygons:[[8,9],[14,15,16]],coord:[125.7,37.5],frame:"0.05 0.1",border:"w -0.1 w+0.1 0.5h w h+0.1"},hr={area:"39",name:"제주특별자치도",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"},lr={area:rr,name:"울릉도",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"},cr={area:"23520",name:"백령도",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"},dr={area:"AK",name:"Alaska",coord:[-119,6.4],frame:"0.5 0.5"},_r={area:"HI",name:"Hawaii",coord:[-126,21],frame:"0.5 0.5"},ur={area:"JPN-3502",name:"Okinawa",offset:[20,6],frame:"0.4 0.2",border:"0.02 -0.2 -0.1 0.6h 0 h+0.2"};class pr{constructor(t){this.id=t}}class gr extends pr{constructor(t,e){super(t),this.props=e}}class mr extends gr{constructor(t,e,i,s){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(e<=0)r.splice(i,1);else if(1!==e){const t=r[i],n=[];for(let e=0;e<t.length;e++){const i=[];for(let s=0;s<t[e].length;s++)i.push(t[e][s].slice());n.push(i)}r[i]=n,this.$_moveToRate(i,s,1-e)}}$_moveToRate(t,e,i){const s=di(this.polygons[t]),r=di(this.polygons[e]);let n,o,a=0,h=0;if((n=s.h1-r.h2)>0&&(o=r.v1-s.v2,n>o&&(a=-n*i,h=o*i)),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 fr{constructor(t,e,i){this.name=t,this.closed=i,s(e)&&e.length>=2&&(this.border=[at.makeArray(e[0]),at.makeArray(e[1])])}}class br extends pr{constructor(t,e){super(t),this.polygon=e}}class yr extends mt{static createStockInset(t,e){let s,r=!1;switch(t){case"제주":case"제주도":s=nr;break;case"제주_B":case"제주도_B":s=nr,r=!0;break;case"울릉":case"울릉도":s=or;break;case"울릉_B":case"울릉도_B":s=or,r=!0;break;case"백령":case"백령도":s=ar;break;case"백령_B":case"백령도_B":s=ar,r=!0;break;case"읍면동_제주":case"읍면동_제주도":s=hr;break;case"읍면동_제주_B":case"읍면동_제주도_B":s=hr,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":s=lr;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":s=lr,r=!0;break;case"읍면동_백령":case"읍면동_백령도":s=cr;break;case"읍면동_백령_B":case"읍면동_백령도_B":s=cr,r=!0;break;default:switch(t.toLowerCase()){case"alaska":s=dr;break;case"hawaii":s=_r;break;case"okinawa":s=ur;break;case"okinawa_b":s=ur,r=!0}}return s&&(a(e)?s=Object.assign({visible:e},s):i(e)&&(s=Object.assign({},s,e)),r&&s.border&&delete s.frame),s}constructor(t,e){var r,o,a;super(),this._excludes={};const h=null!==(r=t.source)&&void 0!==r?r:t.map,l=t.insets,c=s(l)?l:i(l)||n(l)?[l]:void 0;this.name=t.name,this.enabled=f(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey||"name",this.meta=i(null==h?void 0:h.meta)?at.deepClone(h.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(o=this.meta.dummies)||void 0===o?void 0:o.slice(),this.paddings=J(null!==(a=t.padding)&&void 0!==a?a:"0"),this.useOffset=0===e?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,this._excludes={},s(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={},c&&c.length>0&&c.forEach((t=>{var e,i;if(n(t)){const e=t.startsWith("-")?yr.createStockInset(t.substring(1),!1):yr.createStockInset(t);e&&(this.insets[e.area]=e)}else t&&null!=t.area&&(this.insets[t.area]={area:t.area,name:t.name,children:t.children,parent:t.parent,polygons:s(t.polygons)?t.polygons.slice():s(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===(i=t.offset)||void 0===i?void 0:i.slice(0,2),border:s(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&at.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new fr(t.name,t.border,!0===t.closed))})),h&&(this.internals=t.needInternal,this.externals=t.needExternal,this.items=this.$_load(h,t))}included(t){return!this._excludes[t]}$_load(t,e){return this._doLoad(t,e)}}class wr{constructor(){this._scroll=0,this._offset=[0,0]}get isGlobe(){return!1}get lonElliptic(){return!1}get latElliptic(){return!1}get h1(){return((-180+this._scroll)%360+540)%360-180}get scroll(){return this._scroll}set scroll(t){this._scroll=((t||0)%360+540)%360-180,this._sec&&(this._sec._scroll=this._scroll>0?(this._scroll-360)%360:(this.scroll+360)%360),this.second=0===this._scroll?void 0:this._sec}get offset(){return this._offset}set offset(t){this._offset=t.slice(),this._sec&&(this._sec._offset=this._offset)}prepareSecond(){return this._sec=new this.constructor,this}getYRange(t,e){return[t,e]}getClipBounds(t,e){const i=[],s=this.scroll;this.scroll=0,isNaN(t)&&(t=180);for(let e=-90;e<=90;e+=t)i.push(this.project([-180,e]));for(let e=90;e>=-90;e-=t)i.push(this.project([180,e]));return this.scroll=s,i}backward(t){return t}clip(t){return t}isVisible(t){return!0}projectCoord(t){if(this.second){const e=this._scroll,i=t[0];return i>=-180+e&&i<=180+e?this.project(t):this.second.project(t)}return this.project(t)}getVisible(t){if(this.isVisible(t))return this.projectCoord(t)}inSecond(t){return this.second&&(t<-180+this._scroll||t>180+this._scroll)}isClipping(){return!0}getScrolledLon(t){return((t+this._scroll)%360+540)%360-180}}const xr=90,vr=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Sr extends wr{constructor(){super(),this._rotation=[0,0],this._r=xr,this.bounds={x1:-90,x2:xr,y1:-90,y2:xr},this._calcBounds()}get isGlobe(){return!0}get r(){return this._r}set r(t){this._r=t}get lonElliptic(){return!0}get latElliptic(){return!0}get rotationX(){return this._rotation[0]}_setRotationX(t){return void 0!==t&&((t=vr(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=vr(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;vr(-90-t),vr(90-t),vr(90+e),vr(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*A,r=[Math.cos(s)*Math.sin(e*A)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/xr,i=t[1]/xr,s=Math.sqrt(e*e+i*i),r=Math.asin(s),n=Math.sin(r),o=Math.cos(r),a=[Math.atan2(e*n,s*o)/A,Math.asin(s&&i*n/s)/A];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}inSecond(t){return!1}_rotate(t){const e=this._rotation[0]*A,i=(this._rotation[1]||0)*A,s=Math.cos(i),r=Math.sin(i),n=Math.cos(0),o=Math.sin(0);if(0===e&&0===i)return t.slice(0);const a=t[0]*A+e,h=t[1]*A,l=Math.cos(h),c=Math.cos(a)*l,d=Math.sin(a)*l,_=Math.sin(h),u=_*s+c*r;return[Math.atan2(d*n-u*o,c*s-_*r)/A,Math.asin(u*n+d*o)/A]}_unrotate(t){const e=Math.PI/180,i=180/Math.PI,s=t[0]*e,r=t[1]*e*-1,n=Math.cos(r);let o=Math.cos(s)*n,a=Math.sin(s)*n,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*o+_*a-p*d*h,y:-u*_*o+d*a+p*_*h,z:p*o+u*h};return[Math.atan2(g.y,g.x)*i,-Math.asin(g.z)*i]}}class Cr extends yr{static loadMap(t,e){if(i(t)){const r=t.source;if(i(r)&&"Topology"===r.type&&i(r.objects)&&s(r.arcs))return new Cr(t,e);const n=t.map;if(i(n)&&"Topology"===n.type&&i(n.objects)&&s(n.arcs))return new Cr(t,e)}}_doLoad(t,e){const r=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),o=t=>t.map((t=>r(t))),a=t=>t.map((t=>t.filter((t=>2===m[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),h=t=>{const e=t.map((t=>a(t)));return e.length>0?e:null},l=t=>t.map((t=>t.filter((t=>1===f[t<0?~t:t].length)).map((t=>t<0?p[~t].slice().reverse():p[t])))),c=t=>{const e=t.map((t=>l(t)));return e.length>0?e:null},d=t.objects,_=t.arcs,u=t.transform,p=[],g=[],m=e.needInternal?Array(_.length):null,f=e.needExternal?Array(_.length):null;if(i(u)){const t=u.scale[0],e=u.scale[1],i=u.translate[0],s=u.translate[1];_.forEach((r=>{let n=0,o=0;const a=r.map((r=>((r=r.slice())[0]=(n+=r[0])*t+i,r[1]=(o+=r[1])*e+s,r)));p.push(a)}))}else _.forEach((t=>{p.push(t.slice())}));for(const t in d)if("GeometryCollection"===d[t].type){const i=d[t].geometries;if(s(i)&&i.forEach((t=>{const e=new gr(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=r(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=o(t.arcs),g.push(e)}})),m){const t={},i={};s(e.excludeInternal)?e.excludeInternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeInternal&&(t[String(e.excludeInternal)]="");for(let t=m.length-1;t>=0;t--)m[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{m[t<0?~t:t].push(i)}))}))}})),at.isNotEmpty(i)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.internals=h(e):t.polygon&&(t.internal=a(e))}))}if(f){const t={},i={};s(e.excludeExternal)?e.excludeExternal.forEach((e=>{s(e)&&e.length>1?(i[e[0]+"-"+e[1]]="",i[e[1]+"-"+e[0]]=""):s(e)&&1===e.length?t[e[0]]="":n(e)&&(t[e]="")})):e.excludeExternal&&(t[String(e.excludeExternal)]="");for(let t=f.length-1;t>=0;t--)f[t]=[];g.forEach((e=>{const i=e.id;if(!(i in t))if(e.polygons){e.arcs.forEach((t=>{t.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}))}else{e.arcs.forEach((t=>{t.forEach((t=>{f[t<0?~t:t].push(i)}))}))}})),at.isNotEmpty(i)&&f.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in i&&t.push("-")})),g.forEach((t=>{const e=t.arcs;t.polygons?t.externals=c(e):t.polygon&&(t.external=l(e))}))}}return this.$_loadBorders(_,g,this.borders),g.forEach((t=>{delete t.arcs})),g}$_loadBorders(t,e,i){const s=[];for(const r of i){const i=r.border,n=[],o=[];e.forEach((t=>{t instanceof gr&&(i[0].indexOf(t.id)>=0&&(t.polygons?n.push(...t.arcs):t.polygon&&n.push(t.arcs)),i[1].indexOf(t.id)>=0&&(t.polygons?o.push(...t.arcs):t.polygon&&o.push(t.arcs)))}));const a=n.flat(1/0),h=o.flat(1/0),l=[];if(a.forEach((t=>{h.forEach((e=>{(t===e||t<0&&~t===e||e<0&&t===~e)&&l.push(t)}))})),l.length>0){const e=l.map((e=>e<0?t[~e].slice().reverse():t[e]));s.push(new br(r.name,e))}}e.push(...s)}}function Lr(t,e){const{atan2:i,cos:s,sin:r,sqrt:n}=Math,o=t[1]*A,a=t[0]*A,h=e[1]*A,l=e[0]*A,c=h-o,d=l-a,_=r(c/2)*r(c/2)+s(o)*s(h)*r(d/2)*r(d/2),u=2*i(n(_),n(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*s(o)*s(a)+c*s(h)*s(l),_=t*s(o)*r(a)+c*s(h)*r(l),p=i(t*r(o)+c*r(h),n(d*d+_*_)),g=i(_,d);m.push([g/A,p/A])}}return m}function Pr(t,e){const i=t._base,r=t.off;let o,a,h=[0,0],l=e;if(i){if(0===i.length)return void console.warn("적용할 수 없는 inset입니다: "+t.area+", "+t.children);i[0]instanceof Ar?o=i:i[0]>=0&&(l=e.readBounds(i),h=r||h)}if(n(t.frame)&&t.frame.length>0){const e=J(t.frame);let{h1:i,v1:s,h2:n,v2:a}=o?o[0]:l;if(o)for(let t=1;t<o.length;t++)i=d(i,o[t].h1),s=d(s,o[t].v1),n=_(n,o[t].h2),a=_(a,o[t].v2);const c=i+h[0]-e.l,u=n+h[0]+e.r,p=a+h[1]+e.t,g=s+h[1]-e.b;t.box=[[c,p],[u,p],[u,g],[c,g]],t.bounds=r?{h1:c-r[0],h2:u-r[0],v1:g-r[1],v2:p-r[1]}:{h1:c,h2:u,v1:g,v2:p}}else if(a=t.border){let e,c;if(n(a)){let{h1:t,v1:i,h2:s,v2:r}=o?o[0]:l;if(o)for(let e=1;e<o.length;e++)t=d(t,o[e].h1),i=d(i,o[e].v1),s=_(s,o[e].h2),r=_(r,o[e].v2);l={h1:t,v1:i,h2:s,v2:r},e=function(t,e){const i=t.split(/[\s,]+/g),s=[],r="z"===i[i.length-1]||"Z"===i[i.length-1];r&&i.pop();for(let r=0;r<i.length/2;r++)for(let n=0;n<2;n++){const o=i[2*r+n],a=+o;if(isNaN(a)){const i=o.split(/(\+|\-)/g);let r=1,a=0,h=0;for(;h<i.length;){const s=i[h++];if("-"===s)r=-1;else if("+"===s)r=1;else if("w"===s)a+=r*(e.h2-e.h1);else if("h"===s)a+=r*(e.v2-e.v1);else if(s.length>0){const i=parseFloat(s);if(isNaN(i))throw new Error("Invalid border expression: "+t);s.endsWith("h")?a+=r*i*(e.v2-e.v1):s.endsWith("w")?a+=r*i*(e.h2-e.h1):a+=r*i}}s.push(a+(0===n?e.h1:e.v1))}else s.push(a+(0===n?e.h1:e.v1))}return r&&s.push("z"),s}(a,{h1:t,h2:s,v1:i,v2:r})}else s(a)&&(e=a);if(e&&(c=e.length)>=4){for(let t=0;t<c;t+=2)e[t]+=h[0],e[t+1]+=h[1];t.pts=e}i&&i[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=r?{h1:l.h1-r[0],h2:l.h2-r[0],v1:l.v1-r[1],v2:l.v2-r[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const Mr=Math.min,kr=Math.max;class Ar extends mt{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"],i=t.props["ctr-lat"];isNaN(e)||isNaN(i)||(this.center=[+e,+i])}}setSelected(t){this._selected=t}get path(){return this._path}get internal(){return this._internal}get external(){return this._external}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=this._internal=this._external=null}$_readBound(t,e){let i=this.h1,s=this.h2,r=this.v1,n=this.v2;t[0].forEach((t=>{i=Mr(i,t[0]+e[0]),s=kr(s,t[0]+e[0]),r=Mr(r,t[1]+e[1]),n=kr(n,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=n}$_readInset(t,e){const i=t.coord,r=t.offset;let n=[0,0];return s(i)&&i.length>0&&(n[0]=isNaN(i[0])?0:+i[0]-e.h1,n[1]=isNaN(i[1])?0:+i[1]-e.v1),s(r)&&r.length>0&&(n[0]+=g(r[0],0),n[1]+=g(r[1],0)),t.off=n}$_toPath(t,e,i,s){const r=t.isGlobe,n=e[0].slice();if(i){for(let t=0;t<n.length;t++)n[t]=n[t].slice(0);n.forEach((t=>{t[0]+=i[0],t[1]+=i[1]}))}let o=this.x1,a=this.x2,h=this.y1,l=this.y2;const c=n.map((e=>{const i=t.project(e);return i.outside||(o=Mr(o,i[0]),a=kr(a,i[0]),h=Mr(h,i[1]),l=kr(l,i[1])),i}));let d;if(this.x1=o,this.x2=a,this.y1=h,this.y2=l,r){let e,i,s=!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 i=Lr(t[e],t[e+1]);i.length&&t.splice(e+1,0,...i)}}(n),d=[];for(let r=0;r<c.length;r++){const o=n[r],a=c[r];if(a.outside)s=!0;else{if(e||(e=o,n.push(o),c.push(a)),s&&i){Lr(i,o).forEach((e=>d.push(t.project(e))))}d.push(a),i=o,s=!1}}}else d=c;if(d.length>0){const t=`M ${d[0][0]} ${d[0][1]} L`+d.slice(1).map((t=>t.join(" "))).join(" ");return s?t+" Z":t}return""}readBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;if(t)for(const n of t)this.source.polygons[n][0].forEach((t=>{e=Mr(e,t[0]),i=kr(i,t[0]),s=Mr(s,t[1]),r=kr(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=Mr(e,t[0]),i=kr(i,t[0]),s=Mr(s,t[1]),r=kr(r,t[1])}))}));return{h1:e,v1:s,h2:i,v2:r}}readPolygonBounds(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of t)for(const t of n)e=Mr(e,t[0]),i=kr(i,t[0]),s=Mr(s,t[1]),r=kr(r,t[1]);return{x1:e,x2:i,y1:s,y2:r}}readPath(t,e){const i=t.second;let s;if(this.h1=this.v1=1/0,this.h2=this.v2=-1/0,!this._path){const e=this.inset,r=!e||!1!==e.visible;if(e){if(r)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=Mr(t,e[0]),i=Mr(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,oi)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,oi))):this.$_readBound(this.source.polygon,oi),s=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,oi))):this.$_readBound(this.source.polygon,oi);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,oi)}))):(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;const n=t.inSecond(this.h1),o=n?i:t,a=n?t:i,h=n!==t.inSecond(this.h2);let l="",c="";this.source.polygons?this._insetChilds?this.source.polygons.forEach(((t,e)=>{this._insetChilds.indexOf(e)>=0?r&&(l+=this.$_toPath(o,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))):(l+=this.$_toPath(o,t,null,!0),h&&(c+=this.$_toPath(a,t,null,!0)))})):r&&this.source.polygons.forEach(((t,e)=>{l+=this.$_toPath(o,t,s,!0),h&&(c+=this.$_toPath(a,t,s,!0))})):r&&(l=this.$_toPath(o,this.source.polygon,s,!0),h&&(c=this.$_toPath(a,this.source.polygon,s,!0))),this._path=l+c}return e.internals&&this.$_readInternal(t,this._insetChilds?oi:s),e.externals&&this.$_readExternal(t,this._insetChilds?oi:s),this._path}$_readInternal(t,e){if(!this._internal){let i;this.source.internals?(i="",this.source.internals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.internal&&(i="",this.source.internal.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._internal=i}}$_readExternal(t,e){if(!this._external){let i;this.source.externals?(i="",this.source.externals.forEach((s=>{s.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))}))):this.source.external&&(i="",this.source.external.forEach((s=>{s.forEach((s=>{i+=this.$_toPath(t,[s],e,!1)}))}))),this._external=i}}getCenter(){return this.center||[this.h1+(this.h2-this.h1)/2,this.v2+(this.v1-this.v2)/2]}_clone(){const t=new Ar;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class Ir extends mt{constructor(t){super(),this.source=t}get path(){return this._path}reset(){this._path=null}readPath(t){if(!this._path){let e="";this.source.polygon.forEach((i=>{const s=i.map((e=>t.project(e)));e+=`M ${s[0][0]} ${s[0][1]} L`+s.slice(1).join(" ")})),this._path=e}}}class Nr extends mt{constructor(t,e,i){if(super(),this.owner=t,this.source=e,this._hiddens={},this._world=!1,!t)throw new Error("map owner가 반드시 지정돼야 합니다.");if(!e)throw new Error("map source가 반드시 지정돼야 합니다.");this._index=i,this._name=e.name,(this._second=e instanceof Nr)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new sr({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,s(t)&&t.forEach((t=>e[t]=1)),this.$_resetAreas(),this.owner.mapChanged(this),this.sibling&&(this.sibling.hiddenAreas=t)}}get alignArctic(){return this.source.alignArctic}get hasInternals(){return this.source instanceof Cr&&this.source.internals}get hasExternals(){return this.source instanceof Cr&&this.source.externals}get hasBorders(){return this.source instanceof Cr&&this.source.borders}get isWorld(){return this._world}get(t){return this._areas[t]}areaOf(t){return this._areaMap[t]}getAreaMap(t){if(t&&"id"!==t){const e={};for(const i in this._areaMap){const s=this._areaMap[i];t in s.source.props&&(e[s.source.props[t]]=s)}return e}return this._areaMap}findByCoord(t){const e=this._mapAreaFinder.find(t);return this.areaOf(e)}reset(){this._areas.forEach((t=>{t.reset()}));for(const t in this._borders)this._borders[t].reset();this.$_resetAreas(),this.sibling&&this.sibling.reset()}isVisible(t){return!this._hiddens[t]}insetAt(t){for(const e of this._insets)if(e.bounds&&ci(t,e.bounds))return e}getBorder(t){return this._borders[t]}$_preflight(){let t=1/0,e=-1/0,i=1/0,s=-1/0;for(let r=0;r<this._areas.length;r++){const n=this._areas[r],o=n.inset;let{h1:a,h2:h,v1:l,v2:c}=n.readBounds();if(null==o?void 0:o.coord){const[t,e]=o.coord;h=t+h-a,c=e+c-l,a=t,l=e}if(a<t&&(t=a),h>e&&(e=h),l<i&&(i=l),c>s&&(s=c),t<=-180&&e>=180&&i<=-90&&s>=90)return}return{minLat:i,maxLat:s,minLon:t,maxLon:e}}$_resetAreas(){const t=this.owner.getProjection(this._second),e={internals:this.hasInternals,externals:this.hasExternals};if(t instanceof Sr)this._areas.forEach((i=>{i.visible=this.isVisible(i.id),i.readPath(t,e),this.$_updateMainAreaBounds(i)})),this.h1=-180,this.v1=-90,this.h2=180,this.v2=90,this.x1=-90,this.y1=-90,this.x2=xr,this.y2=xr;else{let i=1/0,s=-1/0,r=1/0,n=-1/0,o=1/0,a=-1/0,h=1/0,l=-1/0;if(!this._second&&this._useOffset){const e=this.$_preflight();t.offset=e?!0===this._useOffset?[-(e.minLon+(e.maxLon-e.minLon)/2),-(e.minLat+(e.maxLat-e.minLat)/2)]:this._useOffset:[0,0]}if(this._areas.forEach((c=>{c.visible=this.isVisible(c.id),c.readPath(t,e)&&(i=Mr(i,c.h1),s=kr(s,c.h2),r=Mr(r,c.v1),n=Mr(90,kr(n,c.v2)),o=Mr(o,c.x1),a=kr(a,c.x2),h=Mr(h,c.y1),l=kr(l,c.y2),this.$_updateMainAreaBounds(c))})),this.source instanceof yr){const e=this.source.paddings;r-=e.b,n+=e.t,i-=e.l,s+=e.r;const c=t.project([i,n]),d=t.project([s,r]);h=Math.min(d[1],h-e.b),l=Math.max(c[1],l+e.t),o=Math.min(c[0],o-e.l),a=Math.max(d[0],a+e.r)}n>83.63&&this.source.alignArctic&&(n=90,r<=-90?(h=Math.min(h,-l),l=Math.max(-h,l)):l=t.project([0,n])[1]),(this._world=i<=-180&&s>=180)&&(o=Math.min(o,-a),a=Math.max(-o,a)),this.h1=kr(-180,i),this.v1=kr(-90,r),this.h2=Mr(180,s),this.v2=Mr(90,n),this.x1=o,this.y1=h,this.x2=a,this.y2=l,this.cx=o+(a-o)/2,this.cy=h+(l-h)/2}for(const e in this._borders)this._borders[e].readPath(t)}$_updateMainAreaBounds(t){var e,i;t.mainLandBounds={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2};const s=t.source.props["rm-main-area"],r=null==s?void 0:s.split(",").filter((t=>"string"==typeof t)).map((t=>t.trim())).map((t=>Number(t)));if(!r||0===r.length)return;const n=t.mainLandBounds;t.mainLandBounds=null;for(const s of r){const r=null===(e=t.source)||void 0===e?void 0:e.polygons,n=r&&r[s];if(!n)continue;const o=t.readPolygonBounds(n);null!==(i=t.mainLandBounds)&&void 0!==i||(t.mainLandBounds=o),t.mainLandBounds.x1=Mr(t.mainLandBounds.x1,o.x1),t.mainLandBounds.x2=kr(t.mainLandBounds.x2,o.x2),t.mainLandBounds.y1=Mr(t.mainLandBounds.y1,o.y1),t.mainLandBounds.y2=kr(t.mainLandBounds.y2,o.y2)}t.mainLandBounds||(t.mainLandBounds=n)}$_load(t){var e;const i=t.insets,r=t.idKey,n=null!==(e=t.nameKey)&&void 0!==e?e:"name",a=t.meta.dokdo,h=t.dummies,l=this._areas=[],c=this._areaMap={},d=this._borders={},_=this._insets=[];this._useOffset=t.useOffset,Object.values(i).forEach((t=>{delete t._base,delete t._parent,delete t._area})),t.items.forEach((e=>{if(e instanceof gr){const s=f(e.props[r],e.id);if(s&&t.included(s)){const t=i[s],r=new Ar(e,t);t&&(delete i[s],t._area=r,_.push(t)),h&&h.indexOf(s)>=0?(l.unshift(r),r.dummy=!0):l.push(r),c[r.id=s]=r,r.name=f(e.props[n],e[n])}}else if(e instanceof br){const t=new Ir(e);d[t.source.id]=t}}));for(const t in i){const e=i[t];if(e._parent=e.parent,e.parent&&(o(e.polygons)||s(e.polygons)))if(e.parent.indexOf(",")>=0){const t=e.parent.split(/[\s,]+/g);for(let i=0;i<t.length;i++){const r=c[t[i]];if(r){const n=e.polygons[i];r.inset=e,r._insetChilds=s(n)?n:[n],e._parent=t[i],e._base=r._insetChilds,e._area=r,_.push(e);break}}}else{const t=c[e.parent];t&&(t.inset=e,t._insetChilds=s(e.polygons)?e.polygons:[e.polygons],e._base=t._insetChilds,e._area=t,_.push(e))}else if(s(e.children)){const t=e._base=[],i=e.off?e.off.slice():[0,0],r=e._children=[];if(s(e.coord)){let t=1/0,s=1/0;for(const i of e.children){const e=c[i];if(!e)continue;const r=e.readBounds();t=Mr(t,r.h1),s=Mr(s,r.v1)}isNaN(e.coord[0])||(i[0]=e.coord[0]-t),isNaN(e.coord[1])||(i[1]=e.coord[1]-s)}for(const s of e.children){const e=c[s];if(e){const n=e.inset={area:s,offset:i};t.push(e),n._area=e,r.push(n)}}_.push(e)}}if(a&&!isNaN(+t.dokdo)){const e=c[a.group];e&&(e.source=new mr(e.source,+t.dokdo,+a.index,+a.parent))}this.reset(),_.forEach((t=>Pr(t,t._area)))}$_copy(t){const e=this._areas=[],i=this._areaMap={};this._useOffset=t._useOffset,t._areas.forEach((t=>{const s=t._clone();e.push(s),i[s.id]=s})),this.reset()}_prepareSecond(){return this.sibling||(this.sibling=new Nr(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class Vr extends Ge{getText(t){return at.isValidNum(t)?this._getText(null,t,u(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Vr.defaults=Fe(ti.defaults,{offset:4});class Er extends ti{_doInit(t){super._doInit(t),t.label=(this._label=new Vr(this.chart))._init()}get label(){return this._label}isVertical(){return!0}_type(){return"mapScale"}_getScaledSeries(t){return t.firstMapSeries}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._scale=this.$_calcScale()}$_calcScale(){return 10}}Er.defaults=Fe(ti.defaults,{visible:!1});class Tr extends ze{getItemGap(){var t;return null!==(t=this._op.itemGap)&&void 0!==t?t:Tr.ITEM_GAP}}Tr.ITEM_GAP=4,Tr.defaults=Fe(ze.defaults,{offsetX:8,offsetY:8,itemGap:3});class Dr extends Tr{get vertical(){return"vertical"===this._op.direction}getButtonSize(){var t,e,i,s;return{width:null!==(e=null!==(t=this._op.buttonWidth)&&void 0!==t?t:this._op.buttonHeight)&&void 0!==e?e:Dr.BUTTON_SIZE,height:null!==(s=null!==(i=this._op.buttonHeight)&&void 0!==i?i:this._op.buttonWidth)&&void 0!==s?s:Dr.BUTTON_SIZE}}getZoomFactor(){var t;return null!==(t=this._op.zoomFactor)&&void 0!==t?t:5}_isVisible(){return super._isVisible()&&this.chart.body.options.zoomable&&(this.chart.body.isZoomed||this._op.showAlways)}}Dr.BUTTON_SIZE=24,Dr.defaults=Fe(Tr.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomFactor:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class Rr extends Tr{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}Rr.defaults=Fe(Tr.defaults,{type:"text",align:"left",verticalAlign:"top"});class $r extends mt{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,i=!1){const s=e.filter(Boolean);let r;return i&&(r=this.clear()),this._items.push(...s),t.selectList(s),this._owner.selectionItemAdded(s),this._changed(),r}remove(t,e){const i=this._items.indexOf(e);if(i>=0)return this._items.splice(i,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 Or extends ze{isVisible(){return this.visible&&!F(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Or.defaults=Fe(ze.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class Fr extends Or{}Fr.defaults=Fe(Or.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class Br extends ze{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 i=f(this._op.scope,"hover");return this._ctx=this.visible&&this.owner.getTooltipContext(i,this._series=t,this._point=e)}getTextDomain(){return this._domain}isFollowPointer(t){return this._op.followPointer||!1!==this._op.followPointer&&(null==t?void 0:t.followTooltipPointer())}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!=e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=e._numberFormat?re.getFormatter(e._numberFormat):void 0),function(t){t!=e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=e._timeFormat?xe.getFormatter(e._timeFormat):void 0)}(t.timeFormat)}}Br.defaults=Fe(ze.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:25,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",mode:"line"});const zr="chart",jr=/(.*)/,Hr=new RegExp(';(?=(?:[^"]*"[^"]*")*(?![^"]*"))');class Gr{static getFormatter(t){let e=Gr.Formatters[t];return e||(Gr.Formatters[t]=e=new Gr(t)),e}constructor(t){this._pattern=jr,this._replace="$1",this.$_parse(this._format=t)}get format(){return this._format}toStr(t){return t&&t.replace(this._pattern,this._replace)}$_parse(t){if(t){const e=t.trim().split(Hr);if(e.length>1){let t=e[0].trim(),i=e[1].trim();t&&i&&('"'==t.charAt(0)&&(t=t.substr(1,t.length-2)),t&&('"'==i.charAt(0)&&(i=t.substr(1,i.length-2)),i&&(this._pattern=new RegExp(t,e[2]||""),this._replace=i)))}}}}Gr.Formatters={};class Wr extends bi{constructor(){super(...arguments),this._paramRegx=/\$\{(.*?)\}/g,this._params={}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t){return t.replace(this._paramRegx,((t,e)=>this.$_apply(e)))}$_apply(t){const e=t.split(";");let i=this._paramCallback?this._paramCallback(e[0]):this._params[e[0]];if(void 0===i&&(i=e[1]),e.length>3)switch(e[3]){case"t":i=Gr.getFormatter(e[2]).toStr(String(i));break;case"d":if(n(i))i=new Date(i);else{const t=parseFloat(i);isNaN(t)||(i=new Date(t))}i instanceof Date&&(i=xe.getFormatter(e[2]).toStr(i,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(i);isNaN(t)||(i=re.getFormatter(e[2]).toStr(t))}else if(e.length>2){const t=+i;isNaN(t)?i&&(i=Gr.getFormatter(e[2]).toStr(String(i))):i=re.getFormatter(e[2]).toStr(t)}return i||""}_isVisible(){return this._op.visible&&!B(this._op.html)}_doSetSimple(t,e){return n(e)?(t.html=e,!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},at.isObject(i)?i:null,this._userParams),this._paramCallback=r(i)?i:null}}Wr.type="html",Wr.defaults=Fe(bi.defaults,{});class Yr extends bi{_isVisible(){return this._op.visible&&!B(this._op.imageUrl)}_doSetSimple(t,e){return n(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}Yr.type="image",Yr.defaults=Fe(bi.defaults,{});class Zr extends bi{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||Zr.defaults.shape}_doSetSimple(t,e){return n(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}Zr.type="shape",Zr.defaults=Fe(bi.defaults,{width:64,height:64,shape:"square"});class Ur extends bi{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this._op.visible&&!B(this._op.text)}_doSetSimple(t,e){return n(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){const e=this;var i;super._doApply(t),(i=t.numberFormat)!==e._numberFormat&&(e._numberFormat=i,e._domain.numberFormatter=i?re.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?xe.getFormatter(t):void 0)}(t.timeFormat)}}Ur.type="text",Ur.defaults=Fe(bi.defaults,{text:"Text"});class Xr extends wr{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 Kr=1.340264,qr=-.081106,Jr=893e-6,Qr=.003796,tn=Math.sqrt(3)/2,en=74.03120656864502;class sn extends wr{get lonElliptic(){return!0}get latElliptic(){return!1}getYRange(t,e){return t<=0&&e>=0?[0,0]:e<0?[t,e]:[e,t]}project(t){const e=A,i=Math.asin(tn*Math.sin((t[1]+this.offset[1])*e)),s=i*i,r=s*s*s;return[(t[0]+this.offset[0]-this.scroll)*e*Math.cos(i)*en/(tn*(Kr+3*qr*s+r*(7*Jr+9*Qr*s))),i*en*(Kr+qr*s+r*(Jr+Qr*s))]}backward(t){const e=t[0]/en,i=t[1]/en,s=180/Math.PI;let r,n,o,a,h,l=i;for(let t=0;t<12&&(r=l*l,n=r*r*r,o=l*(Kr+qr*r+n*(Jr+Qr*r))-i,a=Kr+3*qr*r+n*(7*Jr+9*Qr*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=s*tn*e*(Kr+3*qr*r+n*(7*Jr+9*Qr*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/tn);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const rn=63.78137,nn=Math.PI/180;class on extends wr{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 i=Math.sin(e*nn);return[rn*(t[0]+this.offset[0]-this.scroll)*nn,rn*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(rn*nn),(2*Math.atan(Math.exp((t[1]-this.offset[1])/rn))-Math.PI/2)/nn]}}const an=Math.PI/4,hn=Math.PI/180,ln=63.78137;class cn extends wr{project(t){return[(t[0]+this.offset[0]-this.scroll)*hn*ln,79.7267125*Math.log(Math.tan(an+.4*(t[1]+this.offset[1])*hn))]}backward(t){return[(t[0]-this.offset[0])/ln/hn,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/ln*.8))-an)/hn]}}class dn extends ds{}class _n extends _s{_doInit(t){super._doInit(t),t.subLabel=(this._subLabel=this._createLabel(this.chart))._init()}get subLabel(){return this._subLabel}get reversed(){return"reverse"===this._op.barOrder}getFieldColors(){return this._fieldColors}pointLabelCount(){return this._subLabel.visible?2:1}_createPoint(t){return new dn(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return Vi.create(t,ni,0,0,e,e,2)}setCalcedColor(t,e){const i=this._op;super.setCalcedColor(t,e),this._fieldColors=void 0,i.colorByField&&!this._categories&&(s(i.fieldColors)?this._fieldColors=i.fieldColors:this._fieldColors=this._splitColors())}}_n.type="bar",_n.defaults=Fe(_s.defaults,{barWidth:.7,overflow:!1,barOrder:"normal",colorByField:!0});class un extends ze{constructor(t){super(t.chart),this.gauge=t}}class pn extends un{}pn.defaults=Fe(ze.defaults,{visible:!1});class gn extends un{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}gn.defaults=Fe(ze.defaults,{});class mn extends un{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}mn.defaults=Fe(ze.defaults,{thickness:"100%",stroked:!1});class fn extends un{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")}}fn.defaults=Fe(ze.defaults,{visible:!1,radius:3,length:"100%",offset:0});class bn extends un{getRadius(t){return W(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}bn.defaults=Fe(ze.defaults,{visible:!1,radius:5});class yn extends He{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")}}yn.defaults=Fe(He.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class wn{constructor(){this.setCenterX(vn.DEF_CENTER),this.setCenterY(vn.DEF_CENTER),this.setRadius(vn.DEF_RADIUS),this.setInnerRadius(vn.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=G(f(t,vn.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=G(f(t,vn.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=G(f(t,vn.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=G(f(t,vn.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=G(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),i=d(e,this._innerDim?W(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?W(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=g(t%360,0),s=_(0,d(360,g(e,360)));this._startRad=k+A*i,this._handRad=A*i,this._sweepRad=A*s}}class xn extends us{_readObject(t,e){super._readObject(t,e)}}class vn extends gs{_doInit(t){super._doInit(t),t.face=(this._face=new pn(this))._init(),t.rim=(this._rim=new gn(this))._init(),t.valueRim=(this._valueRim=new mn(this))._init(),t.hand=(this._hand=new fn(this))._init(),t.pin=(this._pin=new bn(this))._init(),t.gaugeLabel=(this._gaugeLabel=new yn(this.chart))._init(),this._props=new wn}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 xn(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)}}vn.DEF_CENTER="50%",vn.DEF_RADIUS="50%",vn.DEF_INNER="80%",vn.type="gauge",vn.defaults=Fe(gs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Sn extends ze{constructor(t){super(t.chart),this.gauge=t}}class Cn extends Sn{getThickness(t){return W(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Cn.defaults=Fe(ze.defaults,{thickness:3});class Ln extends Sn{getLength(t){return W(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}Ln.defaults=Fe(ze.defaults,{thickness:1.5,length:"55%"});class Pn extends Ln{}Pn.defaults=Fe(Ln.defaults,{thickness:1,length:"80%"});class Mn extends Ln{}Mn.defaults=Fe(Ln.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class kn extends Sn{}kn.defaults=Fe(ze.defaults,{length:5});class An extends Sn{}An.defaults=Fe(ze.defaults,{step:1,offset:0});class In extends Sn{}In.defaults=Fe(ze.defaults,{radius:4});class Nn extends He{}Nn.defaults=Fe(He.defaults,{text:"RealMap",position:"top"});class Vn extends us{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=g(e.time,NaN),this.timezone=g(e.timezone,NaN)}}class En extends ps{_doInit(t){super._doInit(t),t.face=(this._face=new ze(this.chart))._init(),t.rim=(this._rim=new Cn(this))._init(),t.hourHand=(this._hourHand=new Ln(this))._init(),t.minuteHand=(this._minuteHand=new Pn(this))._init(),t.secondHand=(this._secondHand=new Mn(this))._init(),t.tick=(this._tick=new kn(this))._init(),t.tickLabel=(this._tickLabel=new An(this))._init(),t.pin=(this._pin=new In(this))._init(),t.gaugeLabel=(this._gaugeLabel=new Nn(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,i){const s=d(t,e)*i;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 Vn(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=G(f(e._centerX=t,En.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=G(f(e._centerY=i,En.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=G(f(e._radius=s,En.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}En.DEF_CENTER="50%",En.DEF_RADIUS="50%",En.type="clock",En.defaults=Fe(ps.defaults,{centerX:En.DEF_CENTER,centerY:En.DEF_CENTER,radius:En.DEF_RADIUS,active:!0,size:70});class Tn extends os{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class Dn extends ze{getSize(){return{width:this._op.width,height:this._op.height}}}Dn.defaults=Fe(ze.defaults,{});class Rn extends ns{_doInit(t){super._doInit(t),t.innerLabel=(this._innerLabel=new Hi(this.chart))._init(),t.innerImage=(this._innerImage=new Dn(this.chart))._init()}get innerLabel(){return this._innerLabel}get innerImage(){return this._innerImage}get path(){return this._op.figure}get figureBox(){return this._figureBox}getFigureSize(){const t=this._figureBox;let e=this._op.width,i=this._op.height;return isNaN(e)?isNaN(i)?this._figureBox&&(e=this._figureBox[0],i=this._figureBox[1]):isNaN(e)&&(e=t?i*t[0]/t[1]:i):isNaN(i)&&(i=t?e*t[1]/t[0]:e),{width:e,height:i}}getImageSize(){return this._innerImage.getSize()}_doApply(t){super._doApply(t),this._figureBox=this.$_calcBox(t.figureBox)}_createPoint(t){return new Tn(t)}_defLabelOff(){return 2}getValueRange(){return{min:this._minValue,max:this._maxValue}}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=this._visPoints,{min:s,max:r}=this._calcMinMax(i);this._minValue=s,this._maxValue=r}$_calcBox(t){if(s(t)){if(t.length<2){if(t[0]>=0)return[t[0],t[0]]}else if(t[0]>=0&&t[1]>=0)return[t[0],t[1]]}else if(t>=0)return[t,t]}}Rn.type="figure",Rn.defaults=Fe(ns.defaults,{position:"top"});class $n extends ss{_readObject(t,e){super._readObject(t,e)}}class On extends Hi{}On.defaults=Fe(es.defaults,{visible:!1});class Fn extends rs{constructor(){super(...arguments),this._paramRegx=/\$\{(.*?)\}/g,this._params={}}getSize(){return{width:+this._op.htmlWidth,height:+this._op.htmlHeight}}setParams(t){t!==this._userParams&&(this._userParams=t,this._optionChanged())}applyParams(t,e){return e.replace(this._paramRegx,((e,i)=>this.$_apply(t,i)))}_createLabel(t){return new On(t)}_createPoint(t){return new $n(t)}_createFielders(t){super._createFielders(t),this._htmlFielder=this._createFielder(t.htmlField||"html")}_defLabelOff(){return 2}_doApply(t){super._doApply(t)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},at.isObject(i)?i:null,this._userParams),this._paramCallback=r(i)?i:null}$_apply(t,e){const i=e.split(";");let s=f(this._paramCallback?this._paramCallback(i[0]):this._params[i[0]],t.getParam(i[0]));if(void 0===s&&(s=i[1]),i.length>3)switch(i[3]){case"t":s=Gr.getFormatter(i[2]).toStr(String(s));break;case"d":if(n(s))s=new Date(s);else{const t=parseFloat(s);isNaN(t)||(s=new Date(t))}s instanceof Date&&(s=xe.getFormatter(i[2]).toStr(s,this.chart.options.startOfWeek||0));break;case"n":const t=parseFloat(s);isNaN(t)||(s=re.getFormatter(i[2]).toStr(t))}else if(i.length>2){const t=+s;isNaN(t)?s&&(s=Gr.getFormatter(i[2]).toStr(String(s))):s=re.getFormatter(i[2]).toStr(t)}return s||""}}Fn.DEF_SIZE=100,Fn.type="html",Fn.defaults=Fe(es.defaults,{position:"center"});class Bn extends Hi{}Bn.defaults=Fe(Hi.defaults,{visible:!1});class zn extends Bi{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class jn extends es{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new Bn(t)}_createPoint(t){return new zn(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+="/")}}jn.type="image",jn.defaults=Fe(es.defaults,{imageWidth:24,imageHeight:24,position:"top"});class Hn extends At{constructor(t,e){super(t,ni),this.add(this._area=new Et(t)),this._area.internalSetStyle("opacity","0.2"),this.add(this._line=new Et(t)),this.$_draw(e)}$_draw(t){const e=["M",0,.5*t,"L",2*t,0],i=["M",0,.5*t,"L",2*t,0,"L",2*t,t,"L",0,t,"Z"];this._line.setPath(e.join(" ")),this._area.setPath(i.join(" "))}}class Gn extends ds{}class Wn extends ze{}Wn.defaults=Fe(_s.defaults,{visible:!1});class Yn extends _s{_doInit(t){super._doInit(t),t.area=(this._area=new Wn(this.chart))._init()}get area(){return this._area}_createPoint(t){return new Gn(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new Hn(t,e)}}Yn.type="line",Yn.defaults=Fe(_s.defaults,{});class Zn extends ss{_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?f(super.getParam(t),this.area.source.props[t]):super.getParam(t)}_valuesChanged(t){return t.value!==this.value||super._valuesChanged(t)}setSelected(t){super.setSelected(t),this.area&&this.area.setSelected(t)}}class Un extends ze{}Un.defaults=Fe(ze.defaults,{enabled:!0,autoMapChange:!0});class Xn extends ze{constructor(t,e){super(e.chart),this.name=t,this.series=e}getPath(){return this.border.path}_doSetSimple(t,e){return n(e)?(t.name=e,!0):super._doSetSimple(t,e)}}Xn.defaults=Fe(ze.defaults,{});class Kn extends ze{constructor(t,e){super(e.chart),this.name=t,this.series=e}}Kn.defaults=Fe(ze.defaults,{visible:!1});class qn extends Ge{constructor(t){super(t),this._args={chart:t,inset:null}}getInsetText(t){var e;const i=this._op;let s=null!==(e=this._op.text)&&void 0!==e?e:t.name;if(i.textCallback){this._args.inset=t;const e=i.textCallback(this._args);null!=e&&(s=e)}return s}getInsetLabelStyle(t){if(this._op.styleCallback)return this._args.inset=t,this._op.styleCallback(this._args)}hideInsetLabel(t){if(this._op.visibleCallback)return this._args.inset=t,!1===this._op.visibleCallback(this._args)}isVisible(){return this.visible}getDefaultIconPos(){return"top"}}qn.defaults=Fe(Ge.defaults,{visible:void 0});class Jn extends Hi{}Jn.defaults=Fe(Hi.defaults,{visible:!1,hoverColor:"white"});class Qn extends rs{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),t.drilldown=(this._drilldown=new Un(this.chart))._init(),t.insetLabel=(this._insetLabel=new qn(this.chart))._init(),t.internalBorder=(this._internalBorder=new Kn(null,this))._init(),t.externalBorder=(this._externalBorder=new Kn(null,this))._init()}get areaCount(){return this._map.areaCount}get parent(){return this._parent}get detail(){return this._detail}get drilldown(){return this._drilldown}get insetLabel(){return this._insetLabel}get internalBorder(){return this._internalBorder}get externalBorder(){return this._externalBorder}get color(){return this._colorObj}getMapBorders(){return this._mapBorders?this._mapBorders.filter((t=>t.visible&&t.border)):[]}isHiddenArea(t){return this._hiddenAreas&&this._hiddenAreas[t]}getHistory(){return this._parent?[...this._parent.getHistory(),this]:[this]}get(t){return this._map.get(t)}pointOf(t){return this._areaPts.get(t.id)}pointByProp(t,e){var i;const s=this._points.getPoints();for(const r of s)if((null===(i=r.area)||void 0===i?void 0:i.source.props[t])===e)return r}getBounds(t){}getCenter(t){return t instanceof Zn||(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))}isMapSeries(){return!0}_createLabel(t){return new Jn(t)}$_createDetail(){return this._detail||(this._detail=new Qn(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){if(this.getDetailed()||(i(t.detail)?this.$_createDetail()._doApply(t.detail):t.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(t),e.call(t,"mapBorders")){const e=t.mapBorders;e!==this._saveBorders&&(this._saveBorders=e,this.$_loadBorders(s(e)?e:[e]))}}needMapScale(){return!0}canAddAnimation(){return!1}canRemoveAnimation(){return!1}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}followTooltipPointer(){return!0}getLegendSources(t,e){return this._points.count>0&&super.getLegendSources(t,e)}_createPoint(t){return new Zn(t)}_getPointArgs(t,e){return super._getPointArgs(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,e){var r;super._doPrepareRender(t,e);const o=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=n(e.hiddenAreas)?[e.hiddenAreas]:s(e.hiddenAreas)?e.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of e.hiddenAreas){const e=c[t];e&&(this._hiddenAreas[e.id]=e)}if(_&&_.forEach((t=>{t.visible&&(t.border=o.getBorder(t.name))})),this._minValue=h,this._maxValue=l,i(e.colorRange)){const t=p(e.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new Ms(t)}else this._colorRanger=null===(r=t.getColorScale(this.getColorScale()))||void 0===r?void 0:r.getRanger()}_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,i=(s(t)?t[0]:t)||"id",r=(s(t)?t.length>1?t[1]:t[0]:t)||"id",n="id"===r,o=this._areaMap=e.getAreaMap(i),a=this._areaPts;a.clear(),this._points.forEach((t=>{t.area=n?o[t[r]]:o[t.source[r]],t.area&&a.set(t.area.id,t)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ce(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}select(t){t&&(t.setSelected(!0),this.chart._selectionChanged(this,[t]))}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0);this.chart._selectionChanged(this,e)}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new Xn(t.name,this);i._init(),i._load(t),e.push(i)}))}}Qn.type="map",Qn.defaults=Fe(rs.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class to extends Hi{}to.defaults=Fe(Hi.defaults,{visible:!1});class eo extends ss{}class io extends ze{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 $e),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}io.defaults=Fe(ze.defaults,{});class so extends io{getMinSize(t){return W(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}so.defaults=Fe(io.defaults,{text:"${name}"});class ro extends io{}ro.defaults=Fe(io.defaults,{text:"${value}"});class no extends ns{_doInit(t){super._doInit(t),t.header=(this._header=new so(this))._init(),t.divider=(this._divider=new ze(this.chart))._init(),t.body=(this._body=new ro(this))._init()}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:g(this._width,at.clampEx(t,this._minWidth,this._maxWidth)),height:g(this._height,at.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new to(t)}_createPoint(t){return new eo(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}}no.DEF_MIN_WIDTH=80,no.DEF_MIN_HEIGHT=50,no.type="panel",no.defaults=Fe(ns.defaults,{orientation:"vertical",minWidth:no.DEF_MIN_WIDTH,minHeight:no.DEF_MIN_HEIGHT,position:"top"});class oo extends hs{}class ao{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class ho extends cs{getRadius(t){return g(W(this._radiusDim,t),30)}hasThreshold(){return this._thresholds}getThreshold(t){if(this._thresholds)for(const e of this._thresholds)if(t<e.value)return e}getFieldColors(){return this._fieldColors}_createPoint(t){return new oo(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._setDims(t,"radius"),this._thresholds=this.$_parseThresholds(t.threshold)}_doPrepareRender(t,e){super._doPrepareRender(t,e);let i=g(e.startAngle%360,0),s=_(0,d(360,g(e.totalAngle,360)));this._startRad=k+A*i,this._totalRad=A*s}setCalcedColor(t,e){const i=this._op;super.setCalcedColor(t,e),this._fieldColors=void 0,i.colorByField&&!this._categories&&(s(i.fieldColors)?this._fieldColors=i.fieldColors:this._fieldColors=this._splitColors())}$_parseThresholds(t){return s(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new ao(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new ao(t.value,t.radius,t.style)]:void 0}}ho.type="pie",ho.defaults=Fe(cs.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByField:!0});class lo extends Et{constructor(t,e){super(t,ni),this._rd=e,this.setPath(gi.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 co extends os{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class _o extends as{getExt(t,e){const i=g(t.radius,this._rd)*e;return{cx:0,cy:2*-i,rd:i,innerRd:i*this._innerRd}}get color(){return this._colorObj}_doApply(t){super._doApply(t),this._rd=g(t.radius,_o.DEF_RADIUS),this._innerRd=g(t.innerRadius,0)}_createPoint(t){return new co(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new lo(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new Ce(this._calcedColor)}getColorScale(){return this._op.colorScale}getValueRange(){return{min:this._minValue,max:this._maxValue}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._minValue,this._maxValue,t.value,this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._visPoints,{min:r,max:n}=this._calcMinMax(s);this._minValue=r,this._maxValue=n,this._colorRanger=null===(i=t.getColorScale(e.colorScale))||void 0===i?void 0:i.getRanger()}}_o.DEF_RADIUS=9,_o.type="pin",_o.defaults=Fe(as.defaults,{radius:_o.DEF_RADIUS,innerRadius:0,position:"top"});class uo extends At{constructor(t,e){super(t,ni),this._size=e,this.add(this._marker=new Et(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);gi.setShape(this._marker,this._shape,e,e)}}class po extends ze{get acitve(){return this.visible&&this._runner&&this._runner.active}get clusters(){return this.visible&&this._runner?this._runner.clusters:null}run(t,e,i,s,r,n){t.forEach((t=>t.cluster=null)),this._runner="grid"===this._op.algorithm?new mo:new go,this._runner.prepare(this,e,i).run(this,t,s,r,n)}stop(){}updateClusters(){this._runner.updateClusers()}clear(){var t;null===(t=this._runner)||void 0===t||t.clear()}isVisible(t){return this.acitve&&t.points.length>1||!this.acitve&&t.points.length>=this._op.minDensity}getRange(t){const e=this._ranges;if(e){const i=t.points.length;for(const t of e)if(i>=t.from&&i<t.to)return t}return{radius:this._op.radius}}isExpandable(){return!1!==this._op.expandable}_doApply(t){super._doApply(t),t.distance=g(t.distance,40),t.minDensity=g(t.minDensity,2),t.maxIteration=g(t.maxIteration,100),t.stepDuration=g(t.stepDuration,50),t.radius=g(t.radius,15),this._ranges=this.$_parseRanges(t.ranges)}$_parseRanges(t){const e=[];if(s(t)&&t.length){const s=this._op.radius;let r=-1/0;t.forEach(((t,n)=>{if(i(t)){const i={from:g(r,t.from),to:g(t.to,1/0),radius:g(t.radius,s),color:t.color};e.push(i),r=i.to}e.length>1&&e.sort(((t,e)=>t.from-e.from))}))}return e.length>0?e:null}}po.defaults=Fe(ze.defaults,{visible:!1,distance:40,minDensity:2,maxIteration:100,stepDuration:50,zoomLimit:300,radius:15});class go{constructor(){this._ani=null}get active(){return this._clusters&&this._clusters.length>0&&!this._completed}get clusters(){return this._clusters}prepare(t,e,i){return this}run(t,e,i,s,r){const n=this._clusters=this.$_buildDensitySeeds(t,e);if(n.length>0&&!this._completed){const o=this.$_iterate(t,e,n),a=e=>{if(e-this._last>=t.options.stepDuration){const t=o.next();t.done?r(n):(s(t.value.step,t.value.clusters),this._ani=requestAnimationFrame(a)),this._last=e}else n.forEach((t=>{t.points.forEach((t=>t.moves+=1/go.MOVE_STEPS))})),s(-1,null),this._ani=requestAnimationFrame(a)};this._completed=!1,i(n),a(this._last=performance.now())}else this._completed=!0}stop(){null!==this._ani&&(cancelAnimationFrame(this._ani),this._ani=null),this._completed=!0}updateClusers(){this._clusters&&this.$_updateCentroids(this._clusters)}clear(){this._clusters&&(this._clusters.forEach((t=>{t.points.forEach((t=>t.cluster=void 0))})),this._clusters=null)}$_buildDensitySeeds(t,e){const i=2*t.options.distance,s=new Map;for(const t of e){const e=`${Math.floor(t.px/i)},${Math.floor(t.py/i)}`;s.has(e)||s.set(e,[]),s.get(e).push(t),t.cluster=null,t.moves=1}const r=[];for(const t of s.values()){const e=t.reduce(((t,e)=>t+e.px),0)/t.length,i=t.reduce(((t,e)=>t+e.py),0)/t.length;r.push({cx:e,cy:i,points:[],prevs:[]})}return r}$_assignPoints(t,e,i,s){s*=s,i.forEach((t=>{t.prevs=t.points,t.points=[]}));for(const r of e){let e=i[0],n=1/0;for(const t of i){const i=(r.px-t.cx)**2+(r.py-t.cy)**2;i<n&&(n=i,e=t)}(r.px-e.cx)**2+(r.py-e.cy)**2<=s&&(e.points.push(r),e.points.length>=t.options.minDensity&&e.points.forEach((t=>{t.cluster!==e&&(t.cluster=e,t.moves=0)})))}this._completed=!0;for(const t of i)if(!at.equalArrays(t.points,t.prevs)){this._completed=!1;break}for(const t of i)for(const e of t.points)this._completed?e.moves=1:e.moves+=1/go.MOVE_STEPS}$_updateCentroids(t){for(const e of t){const t=e.points.length;t>0&&(e.cx=e.points.reduce(((t,e)=>t+e.px),0)/t,e.cy=e.points.reduce(((t,e)=>t+e.py),0)/t)}}*$_iterate(t,e,i){for(let s=0;s<t.options.maxIteration&&!this._completed;s++)this.$_assignPoints(t,e,i,t.options.distance),this.$_updateCentroids(i),yield{step:s,clusters:i}}}go.MOVE_STEPS=10;class mo{get active(){return!1}get clusters(){return null}prepare(t,e,i){return this}run(t,e,i,s,r){}stop(){}updateClusers(){}clear(){}}class fo extends os{_readObject(t,e){super._readObject(t,e)}_valuesChanged(t){const e=this.coord[0]!==t.coord[0]||this.coord[1]!==t.coord[1],i=this.value!==t.value;return e||i||super._valuesChanged(t)}}class bo extends as{constructor(t){super(t),this._shape=t.getNextPointShape()}_doInit(t){super._doInit(t),t.cluster=(this._cluster=new po(this.chart))._init()}getShape(){return this._op.shape||this._shape}getRadius(){return g(this._op.radius,bo.defaults.radius)}setLegendMarkerStyle(t){this._stroke&&(t.internalSetStyle("stroke",this._stroke),t.internalSetStyle("stroke-width",this._strokeWidth))}get cluster(){return this._cluster}_createPoint(t){return new fo(t)}_defLabelOff(){return 2}setCalcedColor(t,e){super.setCalcedColor(t,e),this._stroke=t.stroke,this._strokeWidth=t.strokeWidth}_createLegendMarker(t,e){return new uo(t,e)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.setShape(this.getShape(),d(e,2*this._op.radius)),i}}bo.type="point",bo.defaults=Fe(as.defaults,{radius:5,position:"center"});class yo extends At{constructor(t,e){super(t,ni),this.add(this._line=new Et(t)),this.add(this._arrow=new Et(t)),this.$_draw(e)}$_draw(t){const e=[[0,4],[t=Math.max(15,t),4]],i=e[e.length-2],s=e[e.length-1],r=R(Math.atan2(s[1]-i[1],s[0]-i[0]))-90,n="M "+e.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(n),this._arrow.setPath(`M ${s[0]} ${s[1]} L ${s[0]-4} ${s[1]-6} L ${s[0]+4} ${s[1]-6} Z`),this._arrow.setRotation(s[0],s[1],r)}}class wo extends Bi{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 h(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var i,r;const o=function(t){let e=[];return s(t)?t.forEach((t=>{s(t)?e=e.concat(o(t)):e.push(t)})):n(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(r=null!==(i=e.coords)&&void 0!==i?i:e.coord)&&void 0!==r?r:[],this.path=null!=e.path?o(e.path):void 0}}class xo extends es{needMapScale(){return!0}_createPoint(t){return new wo(t)}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(s(t)){const e=this.chart.body._points;i(e)&&(t=t.map((t=>{const i=h({},t);if(s(i.coords)){const t=i.coords.slice();n(t[0])&&(t[0]=e[t[0]]),n(t[1])&&(t[1]=e[t[1]]),i.coords=t}return i})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new yo(t,e)}}xo.type=wi,xo.defaults=Fe(es.defaults,{lineType:"air",arrowDisplay:"always",bendFactor:.01});class vo extends hs{}class So extends cs{getPointGrid(t,e,i){const s=this._runGrid=[],r=this.$_caculate(t,e,i),n={rowCount:this._rowCount,colCount:this._colCount,grid:s,count:r,threshold:this._op.fillThreshold,rows:0,cols:0};if("row"===this._op.fillDirection)this.$_fillRowFirst(n);else this.$_fillColFirst(n);return{grid:s,count:r,rows:n.rows,cols:n.cols}}_createPoint(t){return new vo(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||So.ROW_COUNT,this._colCount=t.colCount||So.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||So.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||So.CELL_SIZE,this._gap=g(t.gap,So.GAP)}getWaffleInfo(){return{rowCount:this._rowCount,colCount:this._colCount,wCell:this._cellSize,hCell:this._cellSize,gap:this._gap}}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._visPoints.forEach((t=>{isNaN(t._sum)&&(t._sum=s(t.values)?t.values.reduce(((t,e)=>t+g(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*g(i,1))-e.min)*(this._rowCount*this._colCount)/(e.max-e.min);let r=this._rounder(s);return 0===r&&(r=+this._op.minCount||0),r}$_rows(t){const e=this._runGrid,i=e.length;for(let s=0;s<i;s++)if(isNaN(e[s][t]))return s;return i}$_cols(t){const e=this._runGrid[t];return e?e.length:0}$_fillRowFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._colCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),a==i-1?(h++,a=this.$_rows(h)):h===s-1||this.$_cols(a)>this.$_cols(a+1)+r?(a++,h=this.$_cols(a)):(h++,a=this.$_rows(h)),l++}t.rows=n,t.cols=o}$_fillColFirst(t){const{grid:e,rowCount:i,colCount:s}=t,r=Math.min(this._threshold,this._rowCount-1);let n=0,o=0,a=0,h=0,l=0;for(;l<t.count;){(e[a]||(e[a]=[]))[h]=l,n=Math.max(n,a),o=Math.max(o,h),h==s-1?(a++,h=this.$_cols(a)):a===i-1||this.$_rows(h)>this.$_rows(h+1)+r?(h++,a=this.$_rows(h)):(a++,h=this.$_cols(a)),l++}t.rows=n,t.cols=o}}So.ROW_COUNT=10,So.COL_COUNT=10,So.THRESHOLD=1,So.CELL_SIZE=5,So.GAP=2,So.type="waffle",So.defaults=Fe(cs.defaults,{rowCount:So.ROW_COUNT,colCount:So.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:So.THRESHOLD,cellSize:So.CELL_SIZE,gap:So.GAP});class Co extends yr{static loadMap(t,e){return i(t)&&i(t.source)&&s(t.source.features)||i(t)&&i(t.map)&&s(t.map.features)?new Co(t,e):void 0}_doLoad(t){const e=t.features,i=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new gr(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,i.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,i.push(e)}}})),i}}class Lo extends ze{}class Po extends ze{}class Mo extends Je{constructor(t,e){super(t),this.inBody=e,this._zoom=100,this._panX=0,this._panY=0,this.scroll=0,this._scale=1,this._vRect=_t.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))}}_doInit(t){t.target=(this._target=new Lo(this.chart))._init(),t.connector=(this._connector=new Po(this.chart))._init()}get target(){return this._target}get connector(){return this._connector}prepareLayout(t,e){return this.$_prepareLayout(t,e)}refresh(){}_getNamePrefix(){return"mapregion"}_doPrepareRender(t,e){const i=this._map=t.map,s=t.getProjection(),r=e.bounds,n=Math.abs(r[0][0]-r[1][0]),o=Math.abs(r[0][1]-r[1][1]),a=Math.abs(i.x2-i.x1)/n,h=Math.abs(i.y2-i.y1)/o,l=[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2],[c,d]=s.project(l);this._zoom=100*Math.min(a,h),s.isGlobe||(t.body.isScrollable()?this.scroll=l[0]:this._panX=c-i.cx,this._panY=-d+i.cy)}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=o-n,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=g(this._panX*d,0),u=g(this._panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,m=e/2+(n+h/2)*d-this._panY*d,f=l/d*a,b=l/d*h,y=s+a/2-f/2+this._panX,w=n+h/2-b/2-this._panY;return this._vRect=_t.create(y,w,f,b),{scale:d,wMap:a,hMap:h,tx:p,ty:m}}}Mo.defaults=Fe(ze.defaults,{width:200});class ko extends Qe{getRegion(t){const e=this._map[t];if(e instanceof Mo)return e}_loadItem(t,e,i,s){const r=new Mo(t,s);return r._init(),r.index=i,r._load(e),r}}class Ao extends pt{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=g(i,300),this._old=t.zoom,this.endHandler=()=>{this.view.zoom=e,this.view=null,null==s||s()}}_doUpdate(t){const e=this._old+(this.zoom-this._old)*t;return this.view.zoom=e,!0}}class Io extends pt{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=g(s,300),this._old=t.zoom,this.view.$_moveTo(i),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 No extends ze{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}No.defaults=Fe(es.defaults,{visible:void 0,globeFill:"lightblue"});const Vo={zoom:1,panX:1,panY:1};class Eo extends ze{constructor(t){super(t),this._prj=(new Xr).prepareSecond(),this._zoom=100,this._panX=0,this._panY=0,this._scale=1,this._vRect=_t.create(0),this._wMap=null,this.$_calcPan=function(t,e,i){const s=Math.max(0,(e-t)/2);return Math.max(-s,Math.min(i,s))},this._annotations=new yi(this)}_doInit(t){super._doInit(t),t.mapBackground=(this._mapBackground=new No(this.chart))._init()}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get isFlatWorld(){return this._map.isWorld&&!this._prj.isGlobe}get rotationX(){return this._prj instanceof Sr?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Sr?this._prj.rotationY:NaN}set rotationY(t){this.updateOption("rotationY",t)}get scroll(){return this._prj.scroll}set scroll(t){this.updateOption("scroll",t)}get movable(){return!1!==this._op.movable}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}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}prepare(t){this._map=t}prepareLayout(t,e){return this.isFlatWorld?this.$_prepareLayout_world(t,e):this.$_prepareLayout(t,e)}$_prepareLayout_world(t,e){const i=this._prj,s=this._map,r=i.getYRange(s.v1,s.v2),n=i.project([s.h1,r[0]]),o=i.project([s.h2,r[1]]),a=this._wMap=o[0]-n[0],h=[s.x1,s.y1],l=[s.x2,s.y2][1]-h[1],c=Math.min(t/a,e/l),d=this._scale=this._zoom/100*c,_=g(this._op.panX*d,0),u=g(this._op.panY*d,0);if(this.isScrollable())this._panX=0;else{const e=this.$_calcPan(t,a*d,_)/d;this._panX=e}this._panY=this.$_calcPan(e,l*d,u)/d;const p=i.scroll*a/360,m=t/2-(n[0]+a/2)*d-(this._panX+p)*d,f=e/2+(h[1]+l/2)*d-this._panY*d,b=c/d*a,y=c/d*l,w=s.x1+a/2-b/2+this._panX,x=s.y1+l/2-y/2-this._panY;return this._vRect=_t.create(w,x,b,y),{scale:d,wMap:a,hMap:l,tx:m,ty:f}}$_prepareLayout(t,e){const i=this._map,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=o-n,l=Math.min(t/a,e/h),c=this._zoom/100,d=this._scale=c*l,_=g(this._op.panX*d,0),u=g(this._op.panY*d,0);this._panX=this.$_calcPan(t,a*d,_)/d,this._panY=this.$_calcPan(e,h*d,u)/d;const p=t/2-(s+a/2)*d-this._panX*d,m=e/2+(n+h/2)*d-this._panY*d,f=l/d*a,b=l/d*h,y=s+a/2-f/2+this._panX,w=n+h/2-b/2-this._panY;return this._vRect=_t.create(y,w,f,b),{scale:d,wMap:a,hMap:h,tx:p,ty:m}}getPoint(t){return this._points[t]}toVisible(t){if(this.isFlatWorld)return this._prj.getVisible(t);{const e=this._prj.getVisible(t);if(e&&this._vRect.contains(e[0],e[1]))return e}}isScrollable(){return this.options.scrollable&&this.map.isWorld}setZoom(t,e=300){let s,n;o(e)?n=e:r(e)?(s=e,n=300):i(e)&&(s=e.end,n=e.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),n>0?new Ao(this,t,n,s).start():this.zoom=t}incZoom(t){isNaN(t)||this.setZoom(this.zoom+t)}zoomByFactor(t,e=!0){if(!isNaN(t)){const i=this.zoom;e?this.setZoom(i+i*t/100):this.zoom=i+i*t/100}}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new Io(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){const r={...mi,...s},n=this.map.areaOf(t),o=n.getCenter(),{x1:a,x2:h,y1:l,y2:c}=n.mainLandBounds,{zoom:d}=this.calcZoomInfo([a,l],[h,c],e),_=Math.min(r.maximumZoom,Math.max(r.minimumZoom,d));new Io(this,_,o,i,null).start()}zoomToBounds(t,e,i=300,s=.7){const{center:r,zoom:n}=this.calcZoomInfo(t,e,s);try{new Io(this,n,r,i,null).start()}catch(t){console.error(t)}}calcZoomInfo(t,e,i){const s=this.map,r=Math.abs(e[0]-t[0]),n=Math.abs(e[1]-t[1]),o=[(t[0]+e[0])/2,(t[1]+e[1])/2],a=Math.abs(s.x2-s.x1)/r*i,h=Math.abs(s.y2-s.y1)/n*i;return{center:o,zoom:100*Math.min(a,h)}}focusTo(t,e=500){this.$_moveTo(t)}$_moveTo(t){if(!isNaN(t[0]*t[1])){const e=this._map,[i,s]=this._prj.project(t);this._prj.isGlobe?(this.rotationX=-t[0],this.rotationY=-t[1]):(0!==this.scroll||this.isScrollable()?this.scroll=t[0]:this.panX=i-e.cx,this.panY=-s+e.cy)}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,i){const s=t in Vo;s&&this.chart.lockOptionsDirty();try{super.updateOption(t,e,i)}finally{s&&this.chart.freeOptionsDirty()}return this}updateOptions(t,e){let i=!0;for(const e in t)if(!(e in Vo)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(t){var r,o,a;const h=this;var l;super._doApply(t),e.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 Sr;break;case"equalearth":h._prj=(new sn).prepareSecond();break;case"miller":h._prj=(new cn).prepareSecond();break;case"mercator":h._prj=(new on).prepareSecond();break;default:h._prj=(new Xr).prepareSecond()}return!0}}(t.projection);const _=this._prj;if(_&&(d||void 0!==t.scroll&&t.scroll!==this._rawScroll)){_.scroll=t.scroll,this._rawScroll=t.scroll,d=!0;const e=null===(r=this.chart)||void 0===r?void 0:r.firstMapSeries;e&&e.setOptionsDirty(!0)}_ instanceof Sr&&(d=_.setRotation(t.rotationX,t.rotationY)||d),function(t){void 0!==t&&(h._zoom=Math.max(100,g(t,100)))}(t.zoom);const u=this._points={};s(t.points)&&t.points.forEach((t=>{s(t)&&t.length>=3&&n(t[0])?u[t[0]]=[t[1],t[2]]:i(t)&&n(t.id)&&(u[t.id]=s(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(d&&this.chart.projectionChanged(),this._zoom!==c&&(this.chart.zoomChanged(this._zoom,c),null===(a=(o=this._op).onZoomChanged)||void 0===a||a.call(o,{chart:this.chart.wrapper,zoom:this._zoom,oldZoom:c})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}Eo.defaults=Fe(ze.defaults,{zoom:100,maxZoom:1e3,wheelZoomFactor:5});class To extends Qn{}class Do extends ze{constructor(){super(...arguments),this._widgetGaps=new bt}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=t.widgetSectionGap;n(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e)}}Do.defaults=Fe(ze.defaults,{alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,domResize:!1});class Ro extends ft{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,e){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=_i.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=e,this._assets=new Jt,this._series=new is(this),this._annotations=new yi(this),this._mapRegions=new ko(this),this._widgetGroups=new qe(this),this._legends=new Ps(this),this._colorScales=new Os(this),this._bubbleScales=new Ss(this),(this._global=new Do(this))._init(),(this._axis=new Qs(this))._init(),(this._body=new Eo(this))._init(),(this._exporter=new Fs(this))._init(),(this._title=new Or(this))._init(),(this._subtitle=new Fr(this))._init(),(this._zoomPanel=new Dr(this))._init(),(this._drilldownPanel=new Rr(this))._init(),(this._mapScale=new Er(this))._init(),(this._credits=new ei(this))._init(),(this._tooltip=new Br(this))._init(),this._op=Object.assign({},Ro.defaults),this._bases={axis:{},series:{},gauge:{},annotation:{}},i(t)?this._load(t):this._initOptions(),this._selection=new $r(this)}_initOptions(){}get wrapper(){return this._wrapper}get options(){return this._op}get global(){return this._global}get isGlobe(){return this.getProjection().isGlobe}get selection(){return this._selection}getFirstSeries(t){return this._series.visibles.find((e=>e._type()===t))}findSeries(t){return this._series._internalItems().find(t)}_getSeriesType(t){return n(t)&&ji[t.toLowerCase()]}_getAnnotationType(t){return n(t)&&fi[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}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var i,s;this._fireEvent("onModelChanged",t,"selection");new Yi({series:t},this._wrapper)._points=e,null===(s=(i=this._global.options).onSelectionChanged)||void 0===s||s.call(i,{chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(){return this._body._prj||(new Xr).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this._fireEvent("onProjectionChanged",this.body._prj)}zoomChanged(t,e){this._fireEvent("onZoomChanged",t,e)}mapChanged(t){this._fireEvent("onMapChanged",t)}anchorByName(t){throw new Error("Method not implemented.")}get chart(){return this}getTooltipContext(t,e,i){return e}selectionChanged(t){this._modelChanged()}selectionItemAdded(t){}selectionItemRemoved(t){}selectionCleared(){}get type(){return this._op.type}get legend(){return this._legends.first}get credits(){return this._credits}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,i=(t instanceof Nr?t:this.getMap(t))||this._maps[0];i!==e&&(this._baseMap=i,this._loading||(this._baseMap.reset(),this.mapChanged(i)))}get axis(){return this._axis}get title(){return this._title}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 Qn))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get widgetGroup(){return this._widgetGroups.first}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof Qn&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}getMapRegions(){return this._mapRegions.getVisibles()}coordOfArea(t){var e,i;return(null===(i=null===(e=this._baseMap)||void 0===e?void 0:e.areaOf(t))||void 0===i?void 0:i.getCenter())||oi}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)}getSeries(t){return o(t)?this._series.get(t):this._series.getSeries(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)}mapRegionByName(t){return this._mapRegions.getRegion(t)}_collectWidgets(){const t={};for(const e of Object.values(Q))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(Q)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,e,s){const r=this._bases[e];let n;return i(r.base)&&Be(n={},r.base),i(r[s])&&(n||(n={}),Be(n,r[s])),n?Be(n,t):t}_setProperties(t,e=!0){const i=this._op;for(const e in Ro.defaults)t.hasOwnProperty(e)&&(i[e]=t[e])}_load(t){const e=this._op;this.$_loadTemplates(t.templates),this._setProperties(t),e.asset=this._assets.load(f(t.asset,t.assets)),e.chart=this._global._load(t.chart),e.body=this._body._load(t.body);const r=s(t.map)?t.map:i(t.map)?[t.map]:null;return s(r)&&(r.forEach(((t,e)=>{if(!1!==t.enabled){const i=Cr.loadMap(t,e)||Co.loadMap(t,e),s=i&&new Nr(this,i,e);s.isWorld&&s._prepareSecond(),this._maps.push(s)}})),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.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,To),!1===e.chart.alwaysMap||0!==this._series.count&&this._series.get(0).isMapSeries()||this._series.insert({type:"map",allAreas:!0},0),this._annotations.load(t.annotations||t.annotation,!1),this._mapRegions.load(t.mapRegions||t.mapRegion,!1),this._widgetGroups.load(t.widgetGroup),this._legends.load(t.legend),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;if(i(t)){const r=this._templates={};for(const e in t){const s=t[e];i(s)&&(r[e]=h({},s))}["@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 i=this._templates[e];if(i)return Be(Be({},i),t)}else s(e)&&e.forEach((e=>{let i=this._templates[e];return i?Be(Be({},i),t):i}));return t}}else this.assignTemplates=void 0}prepareRender(){this._colorScales.beforeRender(),this._bubbleScales.beforeRender(),this._legends.beforeRender(),this._widgetGroups.beforeRender(),this._series._prepareRender(this._optionsDirty,this._legends),this._widgetGroupDirty&&this.$_buildWidgetGroups(),this._colorScales.prepareRender(),this._bubbleScales.prepareRender(),this._legends.prepareRender(),this._widgetGroups.prepareRender(),this._body._prepareRender(),this._annotations.prepareRender(),this._mapRegions.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 i=this[e];(i instanceof ze||i instanceof je||i instanceof Jt)&&i.updateOptions(t[e],!1)}e&&this._optionChanged(null)}}export(t){this._fireEvent("onExportRequest",t)}_getLegendSources(t){return this._series.getLegendSources(t).concat(this._colorScales.getLegendSources())}getParam(t,e){return this._params[e]}setParam(t,e,i){return i&&e!==this._params[t]?(this._params[t]=e,this._optionChanged(null)):this._params[t]=e,this}addSeries(t,e){const i=this._series.add(t);return i&&this._optionChanged(i),i}removeSeries(t,e){const i=this._series.remove(t);if(i)return this._optionChanged(null),i}_dataChanged(t){this._dataDirty||(this._dataDirty=!0,this._fireEvent("onDataChanged",t))}_isDataChanged(){return this._dataDirty}getColorScale(t){return null===t?null:this._colorScales.find(t,!0)}getBubbleScale(t){return null===t?null:this._bubbleScales.find(t,!0)}async drilldown(t,e){if(!(t instanceof Qn&&t.detail))return;const i=t.drilldown,s=t.detail;if(!i.options.enabled)return;s.options.dataUrl&&(s.updateOption("data",await fetch(s.options.dataUrl).then((t=>t.json()))),delete s.options.dataUrl);const r=t.map,n=this.getMap(s.options.map)||r;i.options.autoMapChange&&n!==r&&this.setBaseMap(n),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof Qn&&t.parent))return;const e=t.drilldown;if(!e.options.enabled)return;const i=t.parent,s=this.map;e.options.autoMapChange&&i.map!==s&&this.setBaseMap(i.map),t.showParent(),this._body.zoom=100}canClick(){return r(this._global.options.onClick)}click(t){var e,i;null===(i=(e=this._global.options).onClick)||void 0===i||i.call(e,t)}pointToMap(t,e){return this._fireEvent("onPointToMap",t,e)}$_buildWidgetGroups(){const t=this._widgetGroups;for(const e of t._internalItems())e._clean();[this._legends,this._colorScales,this._bubbleScales].forEach((e=>{e._internalItems().forEach((e=>{if(e instanceof Ue){const i=t.get(e.options.group,e.getLocation());e._setGroup(i),i&&i._add(e)}}))}));for(const e of t._internalItems())e._sort();this._widgetGroupDirty=!1}_visibleChanged(t){}_hoverAreaChanged(t,e,i){var s,r;null===(r=(s=this._body.options).onHoverArea)||void 0===r||r.call(s,{chart:this._wrapper,area:null==e?void 0:e.getInfo(),oldArea:null==i?void 0:i.getInfo()})}_areaClicked(t,e){var i,s;null===(s=(i=this._body.options).onClickArea)||void 0===s||s.call(i,{chart:this._wrapper,area:null==e?void 0:e.getInfo()})}}Ro.defaults={type:"map",startOfWeek:0},es.register(Qn,bo,_o,_n,ho,Rn,bs,xo,jn,Yn,no,So,Fn,vn,En),bi.register(Yr,Zr,Ur,Wr);const $o="$ctrl";class Oo{constructor(t,e){this._loaded=!1,this._modelCallback=e,this._obj=new Ro(t,this),this._loaded=i(t),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 widgetGroup(){return this._obj.widgetGroup}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}get global(){return this._obj.global}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 ";at.LOGGING&&console.time(i);let n=this._obj,o=n;this._loaded?(n.destroy(),o=this._obj=new Ro(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=e,this._loadCallback=s,at.log("chart-items:",Oe),at.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}async loadAsync(t,e=!1,s){var r;if(!i(t))return this;const n=this[$o];try{null==n||n.showLoadingView(),null==n||n.hideErrorView();const i="load chart ";at.LOGGING&&console.time(i),await x.loadConfigAsync(t);let o=this._obj,a=o;return this._loaded?(o.destroy(),a=this._obj=new Ro(null,this)):(this._loaded=!0,o=null),a._load(t),a._loadAnimatable=e,this._loadCallback=s,at.log("chart-items:",Oe),at.LOGGING&&console.timeEnd(i),null===(r=this._modelCallback)||void 0===r||r.call(this,a,o),this}catch(t){console.error(t),null==n||n.showErrorView(null==t?void 0:t.message)}finally{null==n||n.hideLoadingView()}}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,i){}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)}pointToMap(t,e){return this._obj.pointToMap(t,e)}async drilldown(t,e){const i=t instanceof Qn?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof Qn&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof Qn?t:(o(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof Qn&&this._obj.drillup(e)}}class Fo extends At{constructor(t,e,i=!1){super(t,e,"image"),this._dirty=!0,this._bounds=ht,this.onloadProxy=()=>{const t=this.bbox();this.resize(t.width,t.height)},i&&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,i){return!!t&&(this.url=t,this.resize(e,i)&&(this._dirty=!0),!0)}bbox(){return this._dirty&&(this._bounds=this.dom.getBBox(),this._dirty=!1),this._bounds}}class Bo extends At{constructor(t,e){super(t,Bo.STYLE),this._spinnerWrapper=new At(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new Fo(t,"rm-loading-spinner",!0)),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=Bo.LOADING_SPINNER,this._spinner.width=Bo.SPINNER_LENGTH,this._spinner.height=Bo.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-Bo.SPINNER_LENGTH/2,t.height/2-Bo.SPINNER_LENGTH/2)}}Bo.STYLE="rm-loading-indicator",Bo.BACK_STYLE="rm-loading-background",Bo.SPINNER_LENGTH=64,Bo.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class zo{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}pointerDown(t){let e;return e=this._pointerToPoint(t),this._clickX=this._prevX=e.x,this._clickY=this._prevY=e.y,this._doPointerDown(t)}_stopEvent(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation()}$_doDrag(t,e,i,s){if(!this.$_drag(e,this._prevX,this._prevY,i,s))return this.$_stopDragTracker(e,i,s,!0),this._stopEvent(t),!0}$_startMove(t,e,i,s){clearTimeout(this._longTimer),this._tapped=0,this.$_startDrag(e,this._clickX,this._clickY,i,s,t.shiftKey)&&(this._clearTouchEffects(),i!==this._prevX||s!==this._prevY?this.$_doDrag(t,e,i,s):this._stopEvent(t))}pointerMove(t){if(t.target instanceof HTMLTextAreaElement)return;if(this._pinching)return;const e=t.target,i=this.dragging,{x:s,y:r}=this._pointerToPoint(t);t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId?(s<0||s>=this._control.dom().offsetWidth||r<0||r>=this._control.dom().offsetHeight?i&&this.$_stopDragTracker(e,s,r,!0):i?this.$_doDrag(t,e,s,r):(!this._dragTracker&&Math.abs(this._prevX-s)>3||Math.abs(this._prevY-r)>3||this._dragTracker&&!i)&&this.$_startMove(t,e,s,r),this._prevX=s,this._prevY=r,this._touches.push({x:s,y:r,t:t.timeStamp})):i&&this.$_stopDragTracker(e,s,r,!0),this.dragging&&this._stopEvent(t),this._doPointerMove(s,r,t)}pointerUp(t){if(this._pinching)return;const e=t.target,{x:i,y:s}=this._pointerToPoint(t);this.$_stopDragTracker(e,i,s)}pointerCancel(t){const e=t.target,{x:i,y:s}=this._pointerToPoint(t);this.dragging&&this.$_stopDragTracker(e,i,s,!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,i){}_doPointerUp(t){return!0}_doPointerCancel(t){}_doPointerLeave(t){}_doTouchStart(t,e){}_doTouchMove(t,e){return!0}_doTouchEnd(t,e){}_doLongPressed(t,e,i){}_doKeyPress(t){}_doWheel(t){return!0}_doSwipe(t,e,i,s,r){return!1}_getDragTracker(t,e,i,s){return null}$_startDrag(t,e,i,s,r,n){return!this._dragTracker&&this._draggable&&this.setDragTracker(this._getDragTracker(t,s-e,r-i,n)),!!this._dragTracker&&this._dragTracker.start(t,e,i,s,r)}$_drag(t,e,i,s,r){return this._dragTracker.drag(t,e,i,s,r)}$_stopDragTracker(t,e,i,s=!1){this.dragging&&(s?this._dragTracker.cancel():this._dragTracker.drop(null,e,i),this._dragTracker=null)}_pointerToPoint(t){return this._control.pointerToPoint(t)}$_checkSwipe(t,e){const i=this._touches,s=i.length;if(s<2)return;const r=i[s-1];let n=i[s-2];if(r.t-n.t<=100)for(let t=s-3;t>=0&&(n=i[t],!(r.t-n.t>100));t--);const o=n.x,a=n.y,h=r.x,l=r.y,c=Math.sqrt(Math.pow(o-h,2)+Math.pow(a-l,2))/Math.max(16,r.t-n.t),d=.998;if(c>.1){const e=this._dragTracker,i=Math.log(.1/c)/Math.log(d),s=c*(1-Math.pow(d,i+1))/(1-d);let r,n=Math.round(180*Math.atan2(l-a,h-o)/Math.PI);if(n<0&&(n=360+n),r=n>45&&n<=135?U.DOWN:n>135&&n<=225?U.LEFT:n>225&&n<=315?U.UP:U.RIGHT,this.dragging){if(e.swipe(r,1.6*i,1.3*s))return!0;this.$_stopDragTracker(t,this._prevX,this._prevY)}return this._doSwipe(t,e,r,1.6*i,1.3*s)}return!1}_clearTouchEffects(){}$_getDistance(t,e){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}}class jo extends mt{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,i,s,r){return this.cancel(),!!this._doStart(t,e,i,s,r)&&(this._dragging=!0,this._showFeedback(s,r),!0)}drag(t,e,i,s,r){return!(!this._dragging||!this._doDrag(t,e,i,s,r))&&(this._moveFeedback(s,r),!0)}cancel(){if(this._dragging)try{this._dragging=!1,this._doCanceled()}finally{this.end()}}drop(t,e,i){if(this._dragging)try{this._dragging=!1,this._canAccept(t,e,i)?this._doCompleted(t,e,i):this._doCanceled()}finally{this.end(e,i)}}swipe(t,e,i){if(this._doSwipe(t,e,i))return this.end(),!0}end(t=-1,e=-1){try{this._dragging=!1,this._hideFeedback()}finally{this._doEnded(t,e)}}_doSwipe(t,e,i){return!1}_showFeedback(t,e){}_moveFeedback(t,e){}_hideFeedback(){}_doStart(t,e,i,s,r){return!0}_doCanceled(){}_canAccept(t,e,i){return!0}_doCompleted(t,e,i){}_doEnded(t=-1,e=-1){}}class Ho extends jo{_doDrag(t,e,i,s,r){const n=this.control.model.body;n.rotationX+=(s-e)/2,n.rotationY-=(r-i)/2}}class Go extends jo{constructor(t){super(t);const e=t.model.body;this._oldX=e.scroll+e.panX,this._oldY=e.panY}_doStart(t,e,i,s,r){return this.control._scrolling=!0,this._xStart=e,this._yStart=i,this.control.chartView().onScrollStart(),super._doStart(t,e,i,s,r)}_doEnded(t,e){return this.control._scrolling=!1,super._doEnded(t,e)}_doDrag(t,e,i,s,r){const n=this.control.model.body,o=this._oldX-(s-this._xStart)/n.scale,a=this._oldY-(r-this._yStart)/n.scale;if(n.isScrollable()){const t=360;n.scroll+=t/(n.calcedMapWidth*n.scale)*(e-s)}else n.panX=o;return n.panY=a,!0}$_mapView(){return this.control.model.body}}class Wo extends At{constructor(t,e=C){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return Wo.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Wo.IGNORE_ATTRS={width:"",height:""};class Yo extends Wo{constructor(t,e){super(t,e),this.add(this._text=new ke(t,void 0)),this._text.anchor=Le.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.options,n=r.effect;return this._model=e,this._text.setStyleOrClass(r.style),"background"===n?(this._outline&&this._outline.remove(),this._back||(this._back=new Vi(t,"rm-label-background")),this.insertFirst(this._back),this._back.internalSetStyleOrClass(r.backgroundStyle)):"outline"===n?(this._back&&this._back.remove(),this._outline||(this._outline=new ke(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()),i?this._icon||(this.add(this._icon=new Fo(t)),this._icon.url=i,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=Ce.getContrast(getComputedStyle(this._text.dom).fill);this._outline.setStyles({fill:t,stroke:t,strokeWidth:this._model._outlineWidth})}return this}layout(){const t=this._text,e=this._outline,i=this._icon;let s=0;const r=t.bbox(),n=r.width,o=r.height;let a,h=n,l=o,c=0,d=0,_=0,u=0;if(this._box=void 0,i){const t=i.bbox();switch(s=g(this._model.options.iconGap,0),c=t.width,d=t.height,this._model.getIconPos()){case"left":case"right":h+=s+c,l=Math.max(d,o);break;default:l+=s+d,h=Math.max(c,n)}}if(this._back&&this._back.parent&&(a=getComputedStyle(this._back.dom),_=parseFloat(a.paddingLeft)||0,u=parseFloat(a.paddingTop)||0,this._back.setBounds(0,0,h+_+(parseFloat(a.paddingRight)||0),l+u+(parseFloat(a.paddingBottom)||0),a.rx)),i)switch(this._model.getIconPos()){case"left":i.trans(_,(l-d)/2),_+=c+s,h-=c+s;break;case"right":i.trans(_+h-c,(l-d)/2),h-=c+s;break;case"top":i.transX((h-c)/2),u+=d+s;break;case"bottom":i.trans((h-c)/2,u+o+s)}switch(a||(a=getComputedStyle(t.dom)),a.textAlign){case"center":_+=h/2,t.anchor=Le.MIDDLE;break;case"right":_+=h,t.anchor=Le.END;break;default:t.anchor=Le.START}return t.trans(_,u),e&&(e.anchor=t.anchor,e.setAttr("y",t.getAttr("y")),e.trans(_,u)),this}bbox(){return this._box?this._box:this._box=super.bbox()}}class Zo extends jo{constructor(t,e,i,s){super(t),this.mode=i,this.shift=s,this._body=e}_doStart(t,e,i,s,r){const n=this.control.getBounds(),o=this._body.getBackBounds();this._xStart=_(0,e-o.x+n.x),this._yStart=_(0,i-o.y+n.y),this._body.addFeedback(this._feedback=new Vi(this.control.doc(),"rm-bounds-tracker")),this._body.addFeedback(this._fromTag=new Yo(this.control.doc(),"rm-bounds-tracker-tag")),this._body.addFeedback(this._toTag=new Yo(this.control.doc(),"rm-bounds-tracker-tag"));const a={options:{effect:"background",backgroundStyle:{fill:"#000020aa",padding:"3px 4px"}}};return this._fromTag.setModel(document,a,null,null),this._toTag.setModel(document,a,null,null),!0}_hideFeedback(){this._feedback.remove(),this._fromTag.remove(),this._toTag.remove()}_doCompleted(t,e,i){const s=this.$_calcBound(e,i),{from:r,to:n}=this._body.boundsToMap(s,!1,!0);if("zoom"===this.mode)this._body.model.zoomToBounds(r,n);else{const t=this._body.firstMap;if(t){const e=t.chart(),i=t.getIntersectedAreas(this._feedback.dom);this.shift||e.selection.clear(),e.selection.add(t.model,i.map((t=>t.point)),!1)}}}_doDrag(t,e,i,s,r){const n=this.$_calcBound(s,r),{from:o,to:a}=this._body.boundsToMap(n,!1,!0),h=re.getFormatter(",0.000");return this._feedback.setRect(n),this._fromTag.setText(`(${h.toStr(o[0])}°, ${h.toStr(o[1])}°)`).layout(),this._fromTag.trans(n.x-this._fromTag.bbox().width/2,n.y-this._fromTag.bbox().height-4),this._toTag.setText(`(${h.toStr(a[0])}°, ${h.toStr(a[1])}°)`).layout(),this._toTag.trans(n.x+n.width-this._toTag.bbox().width/2,n.y+n.height+4),!0}$_calcBound(t,e){const i=this.control.getBounds(),s=this._body.getBackBounds(),r=this.control.width(),n=this.control.height();return t=_(0,d(r,t-s.x+i.x)),e=_(0,d(n,e-s.y+i.y)),{x:d(this._xStart,t),y:d(this._yStart,e),width:u(this._xStart-t),height:u(this._yStart-e)}}}class Uo extends zo{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){this.dragging?this.dragTracker instanceof Go&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target)}_doClick(t){const e=t.target,i=t.shiftKey,s=ot?t.ctrlKey:t.metaKey,r=this.$_chart(),n=this.$_chartView(),o=r.global.options.clickAction,a=n.getButton(e);let h,l,c;if(a)a.click();else if(h=n.legendByDom(e))if(h.source instanceof Bi){const t=h.source;r.seriesByPoint(t)}else h.source.canHide()&&(h.source.visible=!h.source.visible);else if(e===this._clickElement){const a=this._pointerToPoint(t);if(a.x-=n.tx,a.y-=n.ty,l=n.seriesByDom(e))l.click(e,a);else if(c=n.creditByDom(e))c.click(e);else if(n.drilldownPanelView().click(e))return;switch(o){case"select":l&&l.model.canSelect()&&(s?l.toggleSelect(e,a):l.select(e,a,!i));break;case"drilldown":this.$_drildown(r,t,n)}n.click(t,e,l)}}_doDblClick(t){const e=this.$_chart(),i=this.$_chartView(),s=e.global.options.dblClickAction;"drilldown"===s&&this.$_drildown(e,t,i)}_doWheel(t){const e=this.$_chart().body;if(e.options.zoomable){const i=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX,s=g(Math.max(1,e.options.wheelZoomFactor),5);return e.zoom,e.zoomByFactor(-i/s,!1),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,i,s){const r=this.$_chart(),n=r.global.options.dragAction;return"zoom"===n||"select"===n?new Zo(this.control,this.$_chartView().bodyView(),n,s):r.isGlobe?new Ho(this.control):r.body.isScrollable()||r.body.movable?new Go(this.control):void 0}$_chart(){return this.control.model}$_chartView(){return this.control.chartView()}$_drildown(t,e,i){const s=t.firstMapSeries;if(s){const r=this._pointerToPoint(e),n=e.target,o=i.bodyView().getSeries(s).pointByDom(n,r);o&&o.point instanceof Zn&&t.drilldown(t.firstMapSeries,o.point.area.id)}}}class Xo{static empty(){return new Xo}static create(t=0,e=0){return new Xo(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 Xo(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+"}"}}Xo.EMPTY=new Xo;class Ko extends At{constructor(t,e=C){super(t,e,"g"),At.DEBUGGING&&(this.add(this._debugRect=new Vi(t,"rm-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}_prepareStyleOrClass(t){this.internalSetStyleOrClass(t._style)}setModel(t){t!==this.model&&(this.model=t,this._op=t._op)}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const r=this._doMeasure(t,this.model,i,s);return this.mw=r.width,this.mh=r.height,r}layout(t){return this._doLayout(t),At.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new Vi(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,i,s){return{width:i,height:s}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class qo extends Ko{constructor(t,e,i){super(t,e),this._margins=new bt,this._paddings=new bt,this.add(this._background=new Vi(t,i))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let r=getComputedStyle(this._background.dom);const n=this._paddings;n.applyPadding(r);const o=this._doMeasure(t,e,i,s);if(o.width+=n.left+n.right,o.height+=n.top+n.bottom,this._marginable()){const t=this._margins;r=getComputedStyle(this.dom),t.applyMargin(r),this.mw=o.width+=t.left+t.right,this.mh=o.height+=t.top+t.bottom}return this.mw=o.width,this.mh=o.height,o}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class Jo extends Wo{measure(t,e,i,s){const r=this._doMeasure(t,e,i,s);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,i){return this._doLocateInner(t,e,i),this}}class Qo extends Yo{constructor(t){super(t,"rm-map-widget-title")}}class ta extends Yo{constructor(t){super(t,"rm-map-widget-footer")}}class ea extends qo{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new Qo(t)),this.add(this._footerView=new ta(t))}_setBackgroundStyle(t){t.setVisible(this.model.options.background.visible)&&t.internalSetStyleOrClass(this.model.options.background.style)}$_layoutCaption(t,e,i){i.internalResetStyleOrClass(e._style),i.setModel(t,e,null,null),e.prepareRich(e.options.text),e.buildSvg(i._text,i._outline,NaN,NaN,e,null),i.layout()}_checkTitle(t){const e=this._titleView,i=this.model.title;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rTitle=e.bbox(),(this._inTitle="inline"===i.getDisplay(this.model))?this._rTitle.width+=i.getGap(this._inTitle):this._rTitle.height+=i.getGap(this._inTitle),!0}_checkFooter(t){const e=this._footerView,i=this.model.footer;if(e.setVisible(i.visible))return this.$_layoutCaption(t,i,e),this._rFooter=e.bbox(),this._inFooter="inline"===i.getDisplay(this.model),this._gapFooter=i.getGap(this._inFooter),!0}}class ia extends mt{constructor(t,e,i,s=0){super(),this._reversed=!1,this.removeDelay=0,this._pool=[],this._views=[],this._owner=t,this._creator=e,this._styleName=i,this.removeDelay=s}_doDestory(){this._owner=null,this._creator=null,super._doDestory()}get owner(){return this._owner}get reversed(){return this._reversed}set reversed(t){if(t!=this._reversed){const e=this._owner,i=this._views;if(this._reversed=t,i.forEach((t=>t.remove())),t)for(let t=i.length-1;t>=0;t--)e.add(i[t]);else i.forEach((t=>e.add(t)))}}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()}getRange(t,e){return this._views.slice(t,e)}elementOf(t){for(let e of this._views)if(e.containsDom(t))return e}prepare(t,e=null,i=null){const s=this._owner.doc,r=this._pool,n=this._views;for(let t of n)t.parent;for(t=Math.max(0,t);n.length>t;)r.push(n.pop().remove());for(;n.length<t;){const e=this.$_create(s);n.push(e),i&&i(e,n.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._reversed?this._owner.insertFirst(t):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 i of t)this.free(i,e)}clear(){this.freeAll(this._views)}forEach(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)t(e[i],i,s)}visit(t){const e=this._views.length;let i=0;for(;i<e&&!1!==t(this._views[i],i,e);i++);return i===e}find(t){const e=this._views;for(let i=0,s=e.length;i<s;i++)if(t(e[i]))return e[i]}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 i=this._views.indexOf(t);i>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(i,1))}$_create(t){let e=this._pool.pop();return e||(e=new this._creator(t,this._styleName)),this._reversed?this._owner.insertFirst(e):this._owner.add(e),e}_getElementId(t){}}class sa extends Ko{constructor(t){super(t,"rm-legend-item"),this.add(this._back=new Vi(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new ke(t,"rm-legend-item-label")),this._label.anchor=Le.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,i,s){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():ht,n=ct(this._label.bbox());return this._gap=g(e.legend.options.markerGap,0),{width:r.width+this._gap+n.width,height:_(r.height,n.height)}}_doLayout(t){const e=this._rMarker,i=g(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((i-e.width)/2,(this.height-e.height)/2),this._label.trans(i+this._gap,(this.height-this._label.bbox().height)/2)}}class ra extends ea{constructor(t){super(t,ra.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new ia(this,sa)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_doMeasure(t,e,i,s){const r=e.options,n=e.items(),o=this._vertical="vertical"===e.getLayout();this._ipr=g(r.itemsPerLine,Number.MAX_SAFE_INTEGER),o?s=e.getMaxHeight(s):i=e.getMaxWidth(i),this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),this.$_prepareItems(t,n);const a=this.$_measure(t,e,o,this._ipr,i,s);return this._titleView.visible&&(this._inTitle?a.height=Math.max(a.height,this._rTitle.height):a.width=Math.max(a.width,this._rTitle.width)),this._footerView.visible&&(this._inFooter?a.height=Math.max(a.height,this._rFooter.height):a.width=Math.max(a.width,this._rFooter.width)),a}_doLayout(){const t=this.model,e=t.options,i=this._rowViews,s=e.sameTextColor,r=this._sizes,n=e.itemsAlign,o=e.lineGap||0,a=e.itemGap||0,h=this._margins,l=this._paddings,c=this._vertical,d=this._titleView,_=this._footerView,u=this._rTitle,p=d.visible?u.height:0,g=d.visible?u.width:0,m=this._rFooter,f=_.visible?m.height:0,b=_.visible?m.width:0,y=_.visible?this._gapFooter:0;let w,x,v,S=h.left+l.left,C=h.top+l.top,L=this.width-S-h.right-l.right,P=this.height-C-h.bottom-l.bottom;if(d.visible)if(this._inTitle){switch(x=C,t.title.options.verticalAlign){case"top":break;case"bottom":x+=P-p;break;default:x+=(P-p)/2}d.trans(S,x),S+=g,L-=g}else{switch(t.title.options.align){case"center":w=Math.max(S,S+(L-u.width)/2);break;case"right":w=Math.max(S,S+L-u.width);break;default:w=S}d.trans(w,C),C+=p,P-=p}const M=S,k=C;if(_.visible){if(this._inFooter){switch(w=M+L-b,x=C,t.footer.options.verticalAlign){case"top":break;case"bottom":x+=P-f;break;default:x+=(P-f)/2}L-=b+y}else{switch(x=C+P-f,t.footer.options.align){case"center":w=Math.max(S,S+(L-m.width)/2);break;case"right":w=Math.max(S,S+L-m.width);break;default:w=S}P-=f+y}_.trans(w,x)}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("")})),i.forEach(((t,e)=>{if(c){const i=this._wMarkers;t.forEach((t=>{t.mw=r[e],t.resizeByMeasured().layout(i[e])})),C=k,"center"!==n&&"end"!==n||(v=t.map((t=>t.height)).reduce(((t,e)=>t+e))+a*(t.length-1),C+="center"===n?(P-v)/2:P-v),t.forEach((t=>{t.trans(S,C),C+=t.height+a})),S+=r[e]+o}else t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),S=M,"center"!==n&&"end"!==n||(v=t.map((t=>t.width)).reduce(((t,e)=>t+e))+a*(t.length-1),S+="center"===n?(L-v)/2:L-v),t.forEach((t=>{t.trans(S,C),S+=t.width+a})),C+=r[e]+o}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,r,n){const o=e.options,a=e.items(),h=this._itemViews,l=o.itemGap||0,c=o.lineGap||0,d=h.count,u=this._rowViews=[],p=this._sizes=[];let g,m,f,b;h.forEach(((e,i)=>{e.setMarker(a[i].source.legendMarker(t,+o.markerSize||Cs.MARKER_SIZE)),e.measure(t,a[i],r,n)}));let y=0,w=0;if(i){for(;y<d;)b=h.get(y),w%s===0?(u.push(f=[b]),m=b.mh,w++,y++):(m+=l+b.mh,m<=n?(f.push(b),w++,y++):w=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=_(i,t.mw),r=_(r,t._rMarker.width),t._col=e})),s+=l*(t.length-1),m=_(m,s),g+=i,p.push(i),this._wMarkers.push(r)})),g+=c*(u.length-1)}else{for(;y<d;)b=h.get(y),w%s===0?(u.push(f=[b]),g=b.mw,w++,y++):(g+=l+b.mw,g<=r?(f.push(b),w++,y++):w=0);g=m=0,u.forEach((t=>{let e=0,i=0;t.forEach((t=>{e+=t.mw,i=_(i,t.mh)})),e+=l*(t.length-1),g=_(g,e),m+=i,p.push(i)})),m+=c*(u.length-1)}return this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),{width:g,height:m}}}ra.LEGEND_CLASS="rm-legend";const na={};class oa extends qo{static register(...t){t.forEach((t=>{na[t[0].type]=t[1]}))}constructor(t,e){super(t,oa.CLASS_NAME+" "+e,"rm-annotation-background")}update(t,e,i){this.measure(this.doc,this.model,e,i),this._layoutView(t,0,0,e,i)}_layoutView(t,e,i,s,r){this.resizeByMeasured(),this.layout(this._posByAnchor(t)||this.model.getPosition(e,i,s,r,this.width,this.height))}_posByAnchor(t){const e=this.model,i=e._anchorObj;if(i){const s=t.getAnnotationAnchor(i);if(s){const t=e.getOffset(this.width,this.height),i=s.width,r=s.height;let n=s.tx,o=s.ty;switch(this._op.align){case"left":n-=this.width+t.x;break;case"right":n+=i+t.x;break;default:n+=(i-this.width)/2+t.x}switch(this._op.verticalAlign){case"middle":o+=(r-this.height)/2+t.y;break;case"bottom":o+=r+t.y;break;default:o-=this.height+t.y}return{x:n,y:o}}}}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(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)}}oa.CLASS_NAME="rm-annotation";class aa{static interpolate(t,e){if(e instanceof Sr==!1)return t;const i=[];let s=null,r=null,n=!1;for(let o=0;o<t.length;o++){const a=t[o],h=e.project(a);if(h.outside)n=!0;else{if(s||(s=a,t.push(a)),n&&r){const t=Lr(r,a);for(const s of t){const t=e.project(s);t.outside||i.push(t)}}i.push(h),r=a,n=!1}}return i}}class ha{static box(t,e,i,s,r){const n=Math.floor(Math.abs(i-t)/20),o=this.boxPoints(t,e,i,s,n);return this.coordsToPath(ha.toPixelCoord(r,o))}static ellipse(t,e,i,s,r,n=40){const o=this.arcCoords(t+i/2,e+s/2,i/2,s/2,0,2*Math.PI,!0,n);return this.coordsToPath(ha.toPixelCoord(r,o))}static geoCircle(t,e,i,s,r,n=!1,o=40){const a=this.arcCoords(t,e,i,s,0,2*Math.PI,!0,o);let h=this.toPixelCoord(r,a);return n&&(h=h.map((t=>[t[0],-t[1]]))),this.coordsToPath(h)}static toPixelCoord(t,e){return t instanceof Sr?aa.interpolate(e,t):e.map((e=>t.project(e)))}static coordsToPath(t){const e=[];let i=!1;for(const s of t){if(!!s.outside){i=!1;continue}const[t,r]=s;i?e.push("L",t,r):(e.push("M",t,r),i=!0)}return e}static horizontalLineToRight(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([n,t]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][0]===i||r.push([i,t]),r}static horizontalLineToLeft(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([n,t]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][0]===e||r.push([e,t]),r}static verticalLineToUp(t,e,i,s){const r=[];let n=e;for(;n<=i&&(r.push([t,n]),n+s<=i);)n+=s;return 0!==r.length&&r[r.length-1][1]===i||r.push([t,i]),r}static verticalLineToDown(t,e,i,s){const r=[];let n=i;for(;n>=e&&(r.push([t,n]),n-s>=e);)n-=s;return 0!==r.length&&r[r.length-1][1]===e||r.push([t,e]),r}static boxPoints(t,e,i,s,r){const n=[],[o,a]=t<=i?[t,i]:[i,t],[h,l]=e<=s?[e,s]:[s,e];return r=Math.max(1,r),n.push(...this.horizontalLineToRight(h,o,a,r)),n.push(...this.verticalLineToUp(a,h,l,r)),n.push(...this.horizontalLineToLeft(l,o,a,r)),n.push(...this.verticalLineToDown(o,h,l,r)),n}static arcCoords(t,e,i,s,r,n,o,a=64){const h=2*Math.PI,l=n-r,c=Math.abs(Math.abs(l)-h)<1e-6;let d=c?o?-h:h:l;c||(o&&d>0&&(d-=h),!o&&d<0&&(d+=h));const _=d/a,u=[];for(let n=0;n<=a;n++){const o=r+_*n;u.push([t+Math.cos(o)*Math.abs(i),e+Math.sin(o)*Math.abs(s)])}return u}}class la extends Et{renderLat(t,e,i,s,r){const n=r.second,o=n?2:1;let a="";for(let h=0;h<o;h++){const o=0===h?r:n;let l=o.project([e,t]);if(a+=li(l)?`M${l[0]},${l[1]}`:"",o.latElliptic){let r=e+s;const n=t=>{l=o.project(t),li(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)};for(;r<=i-s;)n([r,t]),r+=s;r<=i&&n([i,t])}else l=o.project([i,t]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLatGlobe(t,e,i,s,r){let n,o=e,a=r.project([o,t]);for(;a.outside&&o<=i;)o+=s,a=r.project([o,t]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([o,t]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e)}}renderLon(t,e,i,s,r){const n=r.second,o=n?2:1;let a="";for(let h=0;h<o;h++){const o=0===h?r:n;let l=o.project([t,e]);if(a+=li(l)?`M${l[0]},${l[1]}`:"",o.lonElliptic){const r=t=>{l=o.project(t),li(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)};let n=e+s;for(;n<=i-s;)r([t,n]),n+=s;n<=i&&r([t,i])}else l=o.project([t,i]),a+=` L${l[0]},${l[1]}`}this.setPath(a)}renderLonGlobe(t,e,i,s,r){let n,o=e,a=r.project([t,o]);for(;a.outside&&o<=i;)o+=s,a=r.project([t,o]);if(o<i){let e=`M${a[0]},${a[1]}`;for(o+=s;o<=i;)a=r.project([t,o]),a.outside?n=a:(n&&(e+=` M${n[0]},${n[1]}`,n=null),e+=` L${a[0]},${a[1]}`),o+=s;this.setPath(e)}}}class ca extends Ko{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new ia(this,la),this._lonPool=new ia(this,la)}_doInitStyles(){this.ignorePointer()}prepare(t,e){this._latPool.prepare((e.y2-e.y1)/e.latStep+1,null,(t=>{Pt.setNoScale(t.dom)})),this._lonPool.prepare((e.x2-e.x1)/e.lonStep+1,null,(t=>{Pt.setNoScale(t.dom)})),this._bounds={x1:Math.max(-180,e.x1),y1:Math.max(-90,e.y1),x2:Math.min(180,e.x2),y2:Math.min(90,e.y2),latStep:e.latStep,lonStep:e.lonStep}}_doMeasure(t,e,i,s){return Xo.create(i,s)}_doLayout(t){const e=this.model,i=e.chart,s=e.line,r=e.lonLine,n=e.latLine,o=i.getProjection();o.second;const a=o.isGlobe,h=this._bounds;let l;Pt.setImportantStyle(this.dom.style,"pointer-events","none"),Pt.setImportantStyle(this.dom.style,"fill","none");const c=h.x1,d=h.x2;let _=h.latStep;if(l=i.axis.latInterval,a)this._latPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(n._style),t.renderLatGlobe(h.y1+e*_,c,d,l,o)}));else{const t=Math.ceil(h.y1/_)*_;this._latPool.forEach(((e,i)=>{const r=t+i*_;(e.visible=r<=h.y2&&r>=h.y1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(n._style),e.renderLat(r,c,d,l,o))}))}const u=h.y1,p=h.y2;if(_=h.lonStep,l=i.axis.lonInterval,a)this._lonPool.forEach(((t,e)=>{t.internalResetStyleOrClass(s._style),t.internalSetStyleOrClass(r._style),t.renderLonGlobe(h.x1+e*_,u,p,l,o)}));else{const t=Math.ceil(h.x1/_)*_;this._lonPool.forEach(((e,i)=>{const n=t+i*_;(e.visible=n<=h.x2&&n>=h.x1)&&(e.internalResetStyleOrClass(s._style),e.internalSetStyleOrClass(r._style),e.renderLon(n,u,p,l,o))}))}}}class da extends It{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new It(t,"rm-axis-tick-labels")),this._labelPool=new ia(this._labelLayer,ke)}setScale(t){this._scale=t}prepare(t,e,i){const s=e.label._style,r=e.getLonInterval(),n=e.getLatInterval(),o=this._lonStep=i.lonStep*r,a=this._latStep=i.latStep*n,h=1+((i.x2-i.x1)/o|0),l=1+((i.y2-i.y1)/a|0);let c=0;this._model=e,this._bounds=Object.assign({},i),this._topCount=this._bottomCount=this._rightCount=this._leftCount=0,e.visibleAt("top")&&(c+=this._topCount=h),e.visibleAt("bottom")&&(c+=this._bottomCount=h),e.visibleAt("right")&&(c+=this._rightCount=l),e.visibleAt("left")&&(c+=this._leftCount=l),this._labelLayer.setVisible(e.label.visible)&&this._labelPool.prepare(c,null,(t=>{t.internalResetStyleOrClass(s)}))}layout(t){if(this._model,this._labelLayer.visible){const e=0!=t.scroll?t.second:null,i=this._scale,s=this._bounds;let r,n,o,a,h,l=0,c=s.x1,d=s.y1;(n=this._labelPool.getRange(l,this._topCount)).length>0&&(r=this._lonStep,h=this._bounds.y2,n.forEach(((s,n)=>{o=e&&c>-180&&c<-180+t.scroll?e.project([c,h]):t.project([c,h]),s.text=c+"°",s.trans(o[0]*i,o[1]*-i),c+=r})),l+=this._topCount),(n=this._labelPool.getRange(l,l+this._bottomCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._bottomCount),(n=this._labelPool.getRange(l,l+this._rightCount)).length>0&&(r=this._latStep,a=this._bounds.x2,h=Math.ceil(d/r)*r,e&&(a=-180+t.scroll,t=e),n.forEach(((e,s)=>{o=t.project([a,h]),e.text=h+"°",e.trans(o[0]*i-e.bbox().width/2,o[1]*-i-e.bbox().height/2),h+=r})),l+=this._rightCount),(n=this._labelPool.getRange(l,l+this._leftCount)).length>0&&(n.forEach(((t,e)=>{})),l+=this._leftCount)}}}class _a extends Ko{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new ca(t,e))}setScale(t){this._gridView._scale=t,this.scale(t,-t)}_doMeasure(t,e,i,s){const r=e.grid,n=this.steps=this.$_calcSteps(r);return this._gridView.setVisible(r.visible)&&(this._gridView.prepare(r,n),this._gridView.measure(t,r,i,s)),Xo.create(i,s)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}$_calcSteps(t){const e=t.chart.map,i=t.getLonStep(),s=t.getLatStep(),{x1:r,x2:n,y1:o,y2:a}="map"===t.fitTo?this.$_calcBoundary(e,i,s):this.$_calcFullBoundary();return{x1:r,y1:o,x2:n,y2:a,latStep:s,lonStep:i}}$_calcBoundary(t,e,i){return{x1:t.h1,x2:t.h2,y1:t.v1,y2:t.v2}}$_calcFullBoundary(){return{x1:-180,x2:180,y1:-90,y2:90}}}class ua extends Yo{}class pa extends Ko{constructor(t,e){super(t),this.add(this._pathView=new Et(t)),e.add(this._labelView=new ua(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof Ks?"rm-axis-range-guide":"rm-axis-line-guide"),{width:i,height:s}}_doLayout(t){const e=this.model,i=e.options,s=this._pathView,r=this._labelView;let n,o=this._fromView,a=this._toView;if(s.internalResetStyleOrClass(e._style),r.setVisible(e.label.visible)&&r.setText(i.label.text),"range"===i.type){const e=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderRange(i,t,r),s.internalSetStyle("strokeWidth",`${e}px`)}else if("band"===i.type){o||(this.add(o=this._fromView=new Et(this.doc)),this.add(a=this._toView=new Et(this.doc))),o.internalResetStyleOrClass(e._style),a.internalResetStyleOrClass(e._style),o.internalSetStyle("fill","none"),o.internalSetStyle("transform",t.trans),a.internalSetStyle("fill","none"),a.internalSetStyle("transform",t.trans);const h=(parseFloat(getComputedStyle(o.dom).strokeWidth)||1)/t.tf.scale;o.internalSetStyle("strokeWidth",`${h}px`),a.internalSetStyle("strokeWidth",`${h}px`),n=this.$_renderBand(i,t,r),s.internalSetStyle("stroke","none")}else{const e=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderLine(i,t,r),s.internalSetStyle("fill","none"),s.internalSetStyle("strokeWidth",`${e}px`)}s.setPath(n).internalSetStyle("transform",t.trans)}$_renderLine(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a;if("lat"===t.axis){const r=t.position,o=s.h1,h=s.h2;a=ha.horizontalLineToRight(r,o,h,n),this.$_renderLatLabel(o,r,e,i)}else{const n=t.position,h=s.v1,l=s.v2;a=ha.verticalLineToUp(n,h,l,o),this.$_renderLonLabel(n,l,r,e.tf,i)}const h=a.map((t=>r.project(t)));return ha.coordsToPath(h)}$_renderBand(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a=[];if("lat"===t.axis){const h=Math.min(t.from,t.to),l=Math.max(t.from,t.to),c=s.h1,d=s.h2;a.push(...ha.horizontalLineToRight(h,c,d,n));const _=[...a];this._fromView.setPath(ha.coordsToPath(_.map((t=>r.project(t))))),a.push(...ha.verticalLineToUp(d,h,l,o));const u=ha.horizontalLineToLeft(l,c,d,n);a.push(...u),this._toView.setPath(ha.coordsToPath(u.map((t=>r.project(t))))),a.push(...ha.verticalLineToDown(c,h,l,o)),this.$_renderLatLabel(c,l,e,i)}else{const o=Math.min(t.from,t.to),h=Math.max(t.from,t.to),l=s.v1,c=s.v2;a.push(...ha.verticalLineToUp(o,l,c,n));const d=[...a],_=ha.verticalLineToDown(h,l,c,n);a.push(..._),this._fromView.setPath(ha.coordsToPath(d.map((t=>r.project(t))))),this._toView.setPath(ha.coordsToPath(_.map((t=>r.project(t))))),this.$_renderLonLabel(o,c,r,e.tf,i)}return ha.coordsToPath(ha.toPixelCoord(r,a))}$_renderRange(t,e,i){const{prj:s}=e;let r;const[n,o]=t.from,[a,h]=t.to;if(t.elliptic){const t=[Math.min(n,a),Math.min(o,h)],e=Math.abs(a-n),i=Math.abs(h-o);r=ha.ellipse(t[0],t[1],e,i,s)}else r=ha.box(n,o,a,h,s);if(i.visible){const t=Math.min(n,a),r=Math.max(o,h),l=s.project([t,r]);l.outside?i.visible=!1:i.visible||(i.visible=!0),i.trans(l[0]*e.tf.scale+e.tf.tx,l[1]*-e.tf.scale+e.tf.ty-i.bbox().height)}return r}$_renderLatLabel(t,e,i,s){if(!s.visible)return;const{prj:r,map:n,tf:o}=i;let a=0,h=0;const l=s.bbox(),c=r.project([n.h1,e]),d=r.project([t,e]);c.outside||d.outside?s.visible=!1:s.visible||(s.visible=!0),a=c[0]*o.scale+o.tx+16,h=d[1]*-o.scale+o.ty,h+=e>=0?0:-l.height,s.trans(a,h)}$_renderLonLabel(t,e,i,s,r){if(!r.visible)return;let n=0,o=0;const a=r.bbox(),h=i.project([t,e]),[l,c]=h;h.outside?r.visible=!1:r.visible=!0,n=l*s.scale+s.tx,o=c*-s.scale+s.ty+a.height/2,"line"===this.model.options.type?n+=t>=0?-a.width-6:6:n+=6,r.trans(n,o)}$_renderHorizontalLineToRight(t,e,i,s,r){let n="",o=e;const a=t=>{const e=s.project(t);li(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<i-r;)a([o,t]),o+=r;return o<=i&&a([i,t]),n}$_renderHorizontalLineToLeft(t,e,i,s,r){let n="",o=i;const a=t=>{const e=s.project(t);li(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>e+r;)a([o,t]),o-=r;return o>=e&&a([e,t]),n}$_renderVerticalLineToTop(t,e,i,s,r){let n="",o=e;const a=t=>{const e=s.project(t);li(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o<=i-r;)a([t,o]),o+=r;return o<i&&a([t,i]),n}$_renderVerticalLineToBottom(t,e,i,s,r){let n="",o=i;const a=t=>{const e=s.project(t);li(e)&&(n+=` L${e[0]},${e[1]}`)};for(;o>=e+r;)a([t,o]),o-=r;return o>e&&a([t,e]),n}}class ga extends Wo{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new Vi(t,"rm-crosshair-flag-back")),this.add(this._text=new ke(t))}prepare(t){this.internalResetStyleOrClass(t.style),this._back.internalResetStyleOrClass(t.backgroundStyle)}setText(t){this._text.text=t;const e=getComputedStyle(this._back.dom),i=parseFloat(e.paddingLeft)||0,s=parseFloat(e.paddingTop)||0,r=this._text.bbox();this._back.setBounds(0,0,r.width+i+(parseFloat(e.paddingRight)||0),r.height+s+(parseFloat(e.paddingBottom)||0),e.rx),this._text.trans(i+r.width/2,s)}renderLonFlag(t,e,i,s,r,n,o){const a=e.project([s,i]),h=e.project([s,r]),l=this.prepareLabel(t);this.trans(Math.min(n-l.width,Math.max(0,o.tx+h[0]*o.scale-l.width/2)),Math.max(0,o.ty-a[1]*o.scale-l.height))}renderLatFlag(t,e,i,s,r,n){const o=e.project([i,s]),a=this.prepareLabel(t);this.trans(Math.max(0,n.tx+o[0]*n.scale-a.width),Math.max(0,Math.min(r-a.height,n.ty-o[1]*n.scale-a.height/2)))}renderGlobeLonFlag(t,e,i,s){const r=this.prepareLabel(t),n=e.rotationY<=0,o=e.project([0,n?90:-90]);this.trans(s.tx+o[0]*s.scale,Math.min(i-r.height,Math.max(0,s.ty-o[1]*s.scale-r.height/2)))}renderGlobeLatFlag(t,e,i,s,r,n,o,a){const h=e.project([i,s]),l=e.project([o,s]),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(n-c.height,a.ty-l[1]*a.scale-c.height/2)))}prepareLabel(t){return this.setText(t),this.bbox()}}class ma extends Ko{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new la(t,"rm-crosshair-line")),this.add(this._lonLine=new la(t,"rm-crosshair-line")),Pt.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),Pt.setImportantStyle(this._latLine.dom.style,"fill","none"),Pt.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),Pt.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new ga(t)),this.add(this._lonFlag=new ga(t)),this.ignorePointer()}prepare(t,e){this._latLine.internalClearStyles();const i=(parseFloat(getComputedStyle(this._latLine.dom).strokeWidth)||1)/t;return this._latLine.internalSetStyle("transform",e),this._lonLine.internalSetStyle("transform",e),this._latLine.internalSetStyle("strokeWidth",`${i}px`),this._lonLine.internalSetStyle("strokeWidth",`${i}px`),this._latFlag.prepare(this.model.flag.options),this._lonFlag.prepare(this.model.flag.options),this}render(t,e){const i=this.model,s=i.chart,r=i.chart.map,n=t[0],o=t[1],a=this._lonLine,h=this._latLine,l=this._lonFlag,c=this._latFlag,d="map"===i.axis.grid.fitTo,_=d?r.h1:-180,u=d?r.h2:180,p=d?r.v1:-90,g=d?r.v2:90;this._bounds={x1:_,x2:u,y1:p,y2:g};const m=[a,l,h,c],f=m.reduce(((t,e)=>t&&e.visible),!0);if(!(_<=n&&n<=u&&p<=o&&o<=g))return void m.forEach((t=>t.setVisible(!1)));f||m.forEach((t=>t.setVisible(!0)));const b=s.getProjection(),y=b instanceof Sr?b:new b.constructor;y.offset=b.offset,this.$_renderLon(t,s.axis.lonInterval,e,y),this.$_renderLat(t,s.axis.latInterval,e,y)}$_renderLon(t,e,i,s){const r=this.model,n=r.chart.map,o=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=s instanceof Sr;_?l.renderLonGlobe(h,o,a,e,s):l.renderLon(h,o,a,e,s);const u=this.calcTopY(i,n,s,o),p=r.chart.getProjection().getScrolledLon(h),g=r.getFlag(p);_?c.renderGlobeLonFlag(g,s,d.height,i):c.renderLonFlag(g,s,a,h,u,d.width,i)}$_renderLat(t,e,i,s){const r=this.model,n=r.chart.map,o=this._bounds.x1,a=this._bounds.x2,h=t[1],l=this._latLine,c=this._latFlag,d=r.getFlag(h),_=this.parent,u=s instanceof Sr;u?l.renderLatGlobe(h,o,a,e,s):l.renderLat(h,o,a,e,s);const p=u?90-s.rotationX:o,g=s.project(t),m=this.calcRightX(i,s,_,n,g[1]);u?c.renderGlobeLatFlag(d,s,p,h,_.width,_.height,m,i):c.renderLatFlag(d,s,p,h,_.height,i)}calcTopY(t,e,i,s){const r=[(t.vx-t.tx)/t.scale,(t.vy-t.ty)/-t.scale];let n=[NaN,NaN];const o=(e.x2-e.x1)/3;for(let t=0;t<3;t++){const t=i.backward(r);if(!Number.isNaN(t[1])){n=t;break}r[0]+=o}return Number.isNaN(n[1])?s:n[1]}calcRightX(t,e,i,s,r){const n=[(i.width-t.vx-t.tx)/t.scale,r];let o=e.backward(n);return Number.isNaN(o[0])?s.x2:o[0]}}const fa="rm_map_globe_fill";class ba extends Et{constructor(t){super(t,"rm-map-background")}render(t,e,i,s,r,n){const o=e.map,a=this.parent,h=e.body.projection;o||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,n,i,s);else if(h.lonElliptic||h.latElliptic){const t=e.body.projection.getClipBounds(e.axis.lonInterval,e.axis.latInterval);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=gi.rectangle(i,s,r,n);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof Sr)){const{tx:t,ty:e,scale:i}=a.transformInfo;this.transEx(t,e).scale(i)}}$_renderGlobeBg(t,e,i,s,r,n,o){const a=e.options.globeFill,h=Math.max(s,r)/2;let l=!this.control.hasDef(fa);return i=gi.circle(n+h,o+h,h),a!==this._globeFill&&(this.control.removeDef(fa),l=!0),l&&a&&this.$_applyGlobeBgDef(t,a),a&&this.setFill(`url(#${fa})`),this.internalSetStyleOrClass(e._style),i}$_applyGlobeBgDef(t,e){const i={id:fa,cx:"0.4",cy:"0.4",r:"1",color:["white",e]};this.control.addDef(new Ut(i).getElement(t,i)),this._globeFill=e}}class ya extends Et{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){at.isNum(t)?this.setPath(gi.line(t,e,i,s)):t&&this.setPath(gi.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(gi.line(t,e,t,i))}setVLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(gi.line(t,e,t,i))}setHLine(t,e,i){this.setPath(gi.line(e,t,i,t))}setHLineC(t,e,i){const s=parseFloat(this.getStyle("stroke-width"));isNaN(s)||(t=Math.round(t)-s%2/2),this.setPath(gi.line(e,t,i,t))}}class wa extends Et{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){at.isNum(t[0])?this.setPath(gi.lines(...t)):s(t[0])?this.setPath(gi.lines3(...t)):this.setPath(gi.lines2(...t))}}var xa;class va extends ia{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class Sa extends Yo{constructor(t){super(t,"rm-point-label")}}class Ca extends It{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new ia(this,Sa),new ia(this,Sa)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}$_prepareLabel(t,e,i,s,r,n){const o=r.getPointText(s,i,n.options.text);e.point=s,e.setModel(t,n,null,null),e._text.internalResetStyleOrClass(n._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(s)),o?(n.prepareRich(o),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s))):(e.setText(n.getText(n.getValue(s,i))),delete e._text._lineCount)}prepare(t,e){if(this.visible){const i=e.model,s=i.getPointLabels(),r=i.pointLabelCount(),n=this._labels,o=i.getLabeledPoints(),a=this._maps,h=s[0]._style;n[0].prepare(o.length),a[0]={},n[1].prepare(r>1?o.length:0),a[1]={},o.forEach(((r,o)=>{for(let h=0;h<r.labelCount();h++){const l=n[h].get(o);(null==l?void 0:l.setVisible(e.isPointLabelVisible(r)))&&(this.$_prepareLabel(t,l,h,r,i,s[h]),a[h][r.pid]=l)}})),this.internalSetStyleOrClass(h)}else this._labels[0].prepare(0),this._labels[1].prepare(0)}get(t,e){const i=this._maps[e];return i&&i[t.pid]}removePoint(t,e){for(let i=0;i<2;i++){const s=this.get(t,i);if(s)return void this._labels[i].removeLater(s,e)}}}class La extends Wo{constructor(t){super(t),this.add(this._line=new wa(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new Et(t)),this._dummy.internalSetStyle("visibility","hidden"),this.add(this._anchor=new Et(t,"rm-callout-anchor"))}render(t,e,i,s){const r=t.options,n=t.series,o=this._anchor,a=this._line;if(this._dummy.setPath(gi.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),o.setVisible(t.anchorPoint.visible)){const s=Na.getDrawer(t.series.getCalloutShape(e)),a=t.anchorPoint.options.radius;o.internalClearStyleAndClass(),r.useSeriesColor&&o.internalSetStyleOrClass(n._style),o.internalSetStyleOrClass(t.anchorPoint._style),o.setPath(s(a,a)),o.trans(i[0],i[1])}return a.internalClearStyleAndClass(),r.useSeriesColor&&this._line.internalSetStyleOrClass(n._style),a.internalSetStyleOrClass(t._style),a.setLines(i,!1),s&&r.usePointColor&&(o.visible&&o.setFill(s),a.setStroke(s)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class Pa extends Dt{constructor(t){super(t),this.add(this._back=new Vi(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new Et(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(gi.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(gi.rect(t).concat(gi.rect(e))):this._mask.setPath(gi.rect(t)),this}}class Ma extends It{constructor(t,e){super(t,e),this._callouts=new ia(this,La),this._map={},this.add(this._maskLayer=new It(t)),this._masks=new ia(this._maskLayer,Pa),this.ignorePointer()}isEmpty(){return this._callouts.isEmpty}clear(){this._callouts.prepare(0)}prepare(t,e){if(this.visible){const t=e.model,i=t.callout,s=this._callouts,r=this._masks,n=t.getLabeledPoints(),o=i._style,a=this._map={};r.prepare(n.length,(t=>{})),s.prepare(n.length),n.forEach(((t,i)=>{const n=s.get(i);n.setVisible(e.isPointCalloutVisible(t))&&(n.setAttr("mask",`url(#${r.get(i).id}`),n.index=i,a[t.pid]=n)})),this.internalSetStyleOrClass(o)}else this._callouts.prepare(0),this._masks.prepare(0)}get(t){return this._map[t.pid]}setMask(t,e){const i={x:e[0]-1e4,y:e[1]-1e4,width:2e4,height:2e4},s=this._masks.get(t.index);return s.setBackground(i),s}}class ka extends Tt{constructor(t,e=!1){super(t,Na.POINT_CLASS,e),this._static=!0}tooltipColor(){return this.getFill()}setVisible(t){const e=super.setVisible(t);if(!e&&this.point){Na.seriesOf(this).setPointLabelVisible(this.point,!1)}return e}_drawSpline(t,e,i,s){let r=e;if(i<0&&(i=t.length-1),1===Math.abs(i-e))return void s.line(t[r+1].x,t[r+1].y);const n=.35,o={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!=i;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}),o.x=-c.x*_*n,o.y=-c.y*_*n;const i=u+a.x,g=p+a.y,m=t[r].x+o.x,f=t[r].y+o.y;s.curve(i,g,m,f,t[r].x,t[r].y),_=t[r+1].x-t[r].x,a.x=c.x*_*n,a.y=c.y*_*n,u=t[r].x,p=t[r].y}s.curve(u+a.x,p+a.y,t[r].x,t[r].y,t[r].x,t[r].y)}_checkStatic(){return this._static=this.point._isStatic()}_clearScale(t){t.internalSetStyles({transformOrigin:"",transformBox:"",transform:""})}_aniScale(t,e){this._checkStatic()&&1===e?this._clearScale(t):t.internalSetStyles({transformOrigin:"center",transformBox:"fill-box",transform:`scale(${this._static?e:this.point._vr})`})}}class Aa extends It{}const Ia={};class Na extends Ko{static register(...t){t.forEach((t=>{Ia[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof xa)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>gi[t](0-e,0-e,2*e,2*e)})),e}static getDrawer(t){return this._drawers[t]||this._drawers.circle}constructor(t,e,i,s){super(t,"rm-series "+e),this._pointPositioner={top:(t,e,i,s)=>({x:t-i/2,y:e-s}),bottom:(t,e,i,s)=>({x:t-i/2,y:e}),center:(t,e,i,s)=>({x:t-i/2,y:e-s/2}),left:(t,e,i,s)=>({x:t-i,y:e-s/2}),right:(t,e,i,s)=>({x:t,y:e-s/2})},this._labelPositioner={bottom:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e+=r+n}),top:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=r+n+i.height}),right:(t,e,i,s,r,n)=>({x:t+=s+n,y:e-=i.height/2}),left:(t,e,i,s,r,n)=>({x:t-=s+n+i.width,y:e-=i.height/2}),center:(t,e,i,s,r,n)=>({x:t-=i.width/2,y:e-=i.height/2+n})},this._growRate=NaN,this._posRate=NaN,this._prevRate=NaN,this._animations=[],this._hoverPts=[],this._inRegion=!1,s&&this.addDom(this._defs=At.createElement(t,"defs")),this.add(this._pointLayer=new It(t)),this._pointLayer.add(this._pointContainer=new Aa(t,"rm-series-points")),this.add(this._calloutContainer=new Ma(t,"rm-series-callouts")),i&&(this._labelContainer=this._createLabelContainer(t,e))}$_setInRegion(){return this._inRegion=!0,this}needClip(){return!1}secondLabelContainer(){}_setCalcedColor(t,e){const i=getComputedStyle(e);t.setCalcedColor(i,this._legendColorProp())}_setModelColor(t){this._pointContainer.setFill(t),this._pointContainer.setStroke(t)}prepareModel(t,e,i){const s=this._dirty=e._optionsDirty||e._dataSourceDirty||e._dataDirty||e._zindexDirty,r=this._labelContainer,n=this._calloutContainer;this._scroll=i,this.setModel(e),this.internalSetStyle("pointerEvents",e.options.disabled?"none":""),e instanceof Qn?this.setData("index",e._seriesIndex%10):this.setData("index",e._seriesIndex%12),null==r||r.setVisible(e.isPointLabelsVisible()),n.setVisible(e.isPointCalloutVisible()),s?(this._pointContainer.internalResetStyleOrClass(e._style),e._runColor&&this._setModelColor(e._runColor),this._setCalcedColor(e,this._pointContainer.dom),(e._dataSourceDirty||e._dataDirty||e._zindexDirty)&&(this._visPoints=this._collectVisPoints(e)),r&&r.visible&&r.prepare(t,this),n.visible&&n.prepare(t,this)):(r&&r.visible&&(null==r?void 0:r.isEmpty())&&r.prepare(t,this),n.visible&&n.isEmpty()&&n.prepare(t,this)),isNaN(this._aniOpacity)||this.internalSetStyle("opacity",String(this._aniOpacity))}prepareLayout(t){const e=this.model,i=e._optionsDirty||e._dataSourceDirty||e._dataDirty;i&&this._doPrepeare(t,e,i)}render(t,e,i){const s=this.model;this._wBody=t,this._hBody=e,this._transInfo=i,this._doRender(this.width,this.height),s instanceof Qn||s.isEmpty(!0)||!this.chart().animatable()||this._runShowEffect(s&&s.options.loadAnimation&&(!this.control.loaded&&this.chart().loadAnimatable()||s._dataLoaded)&&!s.isEmpty(!0)),s._dataLoaded=!1}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,e,i,s){var r;return null===(r=this._getPointPool())||void 0===r?void 0:r.elementOf(t)}pointerMoved(t,e,i){return this._doPointerMoved(t,e,i)}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,e){return this._getPointPool().elementOf(t)}click(t,e){const i=this.pointByDom(t,e);if(i)i.point?!0!==this.model.pointClicked(i.point)&&this._doPointClicked(i):this._doPointClicked(i);else{const e=this.model.cluster;if(e&&e.isExpandable()){const e=this._clusterOfDom(Va.isClusterView(t));if(e){const t=e._cluster.points;let i=t[0],s=i.lon,r=i.lon,n=i.lat,o=i.lat;for(let e=1;e<t.length;e++)i=t[e],s=d(s,i.lon),r=_(r,i.lon),n=d(n,i.lat),o=_(o,i.lat);const a=.1*(r-s),h=.1*(o-n);this.chart().body.zoomToBounds([s-a,n-a],[r+a,o+h])}}}}_clusterOfDom(t){}select(t,e,i){const s=this.pointByDom(t,e);s&&this.chart().selection.add(this.model,[s.point],i)}toggleSelect(t,e){const i=this.pointByDom(t,e);i&&this.chart().selection.toggle(this.model,i.point)}runPointAddAnimation(t){}setPointLabelVisible(t,e){const i=this._labelViews();if(!i)return;const s=i.get(t,0);s&&s.setVisible(e)}zoomChanged(t,e){}get growRate(){return this._growRate}_createLabelContainer(t,e){return new Ca(t,e)}_animating(){return!isNaN(this._growRate)||!isNaN(this._posRate)||!isNaN(this._prevRate)||this._animations.length>0}_addDef(t,e){const i=this.hash+e;return t.id=i,this._defs.append(t),t}_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,i){if(t.setAttrEx("aria-label",i.ariaHint()),t.internalClearStyleAndClass(),i._runColor)this._setPointColor(t,i._runColor);else{const s=e.getRangedColor(i);s&&this._setPointColor(t,s)}const s=e.getPointStyle(i);s&&t.internalSetStyleOrClass(s)}_doPointerMoved(t,e,i){return!1}_getGrowRate(){return g(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&&at.log("CLICKED: ",t.point.name,t.point.getValue())}}xa=Na,Na.POINT_CLASS="rm-point",Na.DATA_HOVER="hover",Na.DATA_UNHOVER="unhover",Na.LEGEND_MARKER="rm-legend-item-marker",Na._drawers=Object.assign({circle:t=>gi.circle(0,0,t)},xa._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Va extends At{static isClusterView(t){return Pt.isChildOf(t,this.CLASS_NAME)}constructor(t){super(t,"rm-point-cluster"),this.add(this._shape=new Et(t)),this.add(this._label=new ke(t,"rm-point-cluster-label"))}setCluster(t){this._cluster=t}render(t,e){const i=[],s=M-.001;let r=0;this._cluster.points.forEach((t=>{t.moves>=1&&r++})),t--,i.push("M",t*l(0),t*c(0)),i.push("A",t,t,0,1,1,t*l(s),t*c(s)),t++,i.push("L",t*l(s),t*c(s)),i.push("A",t,t,0,1,0,t*l(0),t*c(0),"Z"),t-=3,i.push("M",t*l(0),t*c(0)),i.push("A",t,t,0,1,1,t*l(s),t*c(s)),t++,i.push("L",t*l(s),t*c(s)),i.push("A",t,t,0,1,0,t*l(0),t*c(0),"Z"),t-=2,i.push("M",t*l(0),t*c(0)),i.push("A",t,t,0,1,1,t*l(s),t*c(s),"Z"),this._shape.setPath(i.join(" ")),this._label.text=String(r),this._label.transY(-this._label.bbox().height/2),e&&this.internalSetStyle("fill",e)}}Va.CLASS_NAME="rm-point-cluster";class Ea extends ka{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class Ta extends Na{constructor(t,e,i,s){super(t,e,i,s),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.options.hintDistance}_getPointPool(){return this._markers}}class Da extends ka{prepare(t,e){return this.point=t,this._ext=at.getMinMax(t.values),this._checkStatic(),t}getSizeRate(t,e){return isNaN(e.minSize)?1:(t-e.min)/(e.max-e.min)*(1-e.minSize)+e.minSize}}class Ra extends Na{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.options.minSize}}}class $a extends Da{constructor(t){super(t,!0),this.add(this._contentLayer=new It(t)),this.add(this._baseLine=new ya(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class Oa extends Ra{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,g(t._minValue,i.min)),i.max=Math.max(i.max,g(t._maxValue,i.max))),i}_doPrepeare(t,e,i){!this._ext||i?this._ext={inverted:!1,...this._getSeriesExt(e,this._visPoints),width:e._width,height:e._height,pad:0}:(this._ext.width=e._width,this._ext.height=e._height);const s=e.options.inverted;let r=s?e._height:e._width;const n=e.getPadding(r);this._ext.inverted=s,this._ext.pad=n,this._ext[s?"height":"width"]=r-2*n}}class Fa extends ka{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class Ba extends Na{constructor(t,e,i,s){super(t,e,i,s),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class za extends oa{constructor(t){super(t,za.CLASS_NAME),this.add(this._imageView=new Fo(t)),this._imageView.onloadProxy=()=>{const t=this._imageView.bbox();this._deflatePaddings(t),this._imageView.resize(t.width,t.height)}}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),this._imageView.url=this.model.options.imageUrl,this._imageView.resize(r.width,r.height),ct(this._imageView.bbox())}_doLayout(t){this._imageView.trans(this._paddings.left,this._paddings.top),super._doLayout(t)}}za.CLASS_NAME="rm-image-annotation";class ja extends oa{constructor(t){super(t,ja.CLASS_NAME),this.add(this._shapeView=new Et(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),gi.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)}}ja.CLASS_NAME="rm-shape-annotation";class Ha extends oa{constructor(t){super(t,Ha.CLASS_NAME),this.add(this._textView=new ke(t)),this._textView.anchor=Le.START,this._richText=new $e}_doMeasure(t,e,i,s){const r=e.options,n=e.getSize(i,s),o=this._textView;r.writingMode&&this._textView.setStyle("writingMode",r.writingMode),r.textOrientation&&this._textView.setStyle("textOrientation",r.textOrientation),this._deflatePaddings(n),this._richText.setFormat(r.text),this._richText.build(o,i,s,null,e._domain);const a=ct(this._textView.bbox());return{width:g(n.width,a.width),height:g(n.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)}}Ha.CLASS_NAME="rm-text-annotation";class Ga{static reveal(t,e){new Ya(t,e)}static grow(t,e){new Ua(t,e)}static spread(t,e){new Xa(t,e)}static fadeIn(t){new Wa(t,{prop:"opacity",start:"0",end:"1"})}constructor(t,e){const i=this._createAnimation(t,e);window.Animation&&i instanceof Animation&&(i.addEventListener("finish",(()=>{t._animationFinished(i)})),t._animationStarted(i))}}class Wa extends Ga{constructor(t,e){super(t,e)}_createAnimation(t,e){const i={},s={};return i[e.prop]=e.start,s[e.prop]=e.end,t.dom.animate([i,s],{duration:pt.DURATION,fill:"none"})}}class Ya extends Ga{constructor(t,e){super(t,e)}_createAnimation(t,e){const i=this.$_clipRect(t);let s;switch(e&&e.from){case"top":s=this.$_top(t,i,e);break;case"bottom":s=this.$_bottom(t,i,e);break;case"right":s=this.$_right(t,i,e);break;default:s=this.$_left(t,i,e)}return null==s||s.addEventListener("finish",(()=>{i.dom.remove()})),s}$_aniOptions(t){return{duration:pt.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,i){return e.dom.firstElementChild.animate([{width:"0"},{width:$(t.width)}],this.$_aniOptions(i))}$_right(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateX(${t.width}px)`},{transform:""}],this.$_aniOptions(i))}$_top(t,e,i){return e.dom.firstElementChild.animate([{height:"0"},{height:$(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class Za extends pt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof At}_stop(){super._stop(),this._series=null}}class Ua extends Za{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class Xa extends Za{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class Ka extends Et{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,n){this.x=t,this.setPath(gi.bar(t-i/2,e,i,-s,r,n))}}class qa extends $a{constructor(t){super(t),this._bars=new ia(this._contentLayer,Ka)}setReversed(t){return this._bars.reversed=t,this}prepare(t,e){return super.prepare(t,e),this._bars.prepare(t.values.length,((t,e)=>{})),t}render(t,e,i,s,r,n,o){const a=t._categories||[],h=t.getFieldColors(),{min:l,max:c}=t.getPointExtents(i,e),d=i.length,_=r/d,u=_*s.barWidth,p=s.barWidth>1&&!s.overflow,g=s.pad;this._bars.forEach(((t,e)=>{const s=i[e];if(t.setVisible(!isNaN(s))){const i=(s-l)/(c-l)*n*o;let d=g+_*e+(_-u)/2;p&&(d+u>g+r&&(d=g+r-u),d=Math.max(d,g)),t.setPath(gi.bar(d,n,u,-i,0,0)),t.internalClearStyleAndClass(),a[e]&&a[e].color?t.setFill(a[e].color):h&&t.setFill(h[e%h.length])}})),this._renderBaseLine(t.baseLine,!1,this.width,this.height)}}class Ja extends Ea{tooltipColor(){return getComputedStyle(this.dom).fill}}class Qa extends Et{static create(t,e,i,s,r,n,o,a,h=!0){return new Qa(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:0,start:o,angle:a,clockwise:h})}static createInner(t,e="",i,s,r,n,o,a,h,l=!0){return new Qa(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=C,i=C){super(t,e),this.cx=0,this.cy=0,this.rx=0,this.ry=0,this.innerRadius=0,this.start=0,this.angle=0,this.clockwise=!0,this.rate=1,i&&this._assignShape(i,!1),this.setAttr("role","img")}equals(t){return t.cx===this.cx&&t.cy===this.cy&&t.rx===this.rx&&t.ry===this.ry&&t.innerRadius===this.innerRadius&&t.start===this.start&&t.angle===this.angle&&t.clockwise===this.clockwise}setSector(t){this._assignShape(t,!1)}setSectorEx(t,e){this._assignShape(t,e)}_getShape(){return{cx:this.cx,cy:this.cy,rx:this.rx,ry:this.ry,innerRadius:this.innerRadius,start:this.start,angle:this.angle,clockwise:this.clockwise}}_assignShape(t,e){this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.innerRadius=t.innerRadius,this.start=t.start,this.angle=t.angle,this.clockwise=t.clockwise,this.setPath(e?this.$_renderArc():this.$_renderSector())}$_renderSector(){return gi.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 gi.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 th=function(t){return isNaN(t)?0:t};class eh{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 o(t)?this._path.push("M",th(t),th(e)):this._path.push("M",th(t.x),th(t.y)),this}moveBy(t,e){return o(t)?this._path.push("m",th(t),th(e)):this._path.push("m",th(t.x),th(t.y)),this}movep(t,e){return o(t)?this._path.push("M",O(t),O(e)):this._path.push("M",O(t.x),O(t.y)),this}line(t,e){return o(t)?this._path.push("L",th(t),th(e)):this._path.push("L",th(t.x),th(t.y)),this}linep(t,e){return o(t)?this._path.push("L",O(t),O(e)):this._path.push("L",O(t.x),O(t.y)),this}curve(t,e,i,s,r,n){return this._path.push("C",t,e,i,s,r,n),this}q(t,e,i,s){return this._path.push("Q",t,e,i,s),this}rect(t,e,i,s){return this._path.push("M",t,e,"l",i,0,"l",0,s,"l",-i,0),this}lines(...t){if(o(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",th(t[e]),th(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",th(t[e].x),th(t[e].y));return this}polygon(...t){return this.lines(...t),this._path.push("Z"),this}circle(t,e,i){return this._path.push(`M ${t-i}, ${e} a ${i},${i} 0 1,0 ${2*i},0 a ${i},${i} 0 1,0 ${2*-i},0`),this}}class ih extends Et{render(t,e){const i=t.getExtents(e);if(i.radius!==this._radius||i.length!==this._length||i.offset!==this._offset){const t=this._radius=i.radius,e=this._offset=i.offset;if(this._length=i.length,this._radius>0&&this._length>0){const i=new eh;i.move(-t,e).line(0,-this._length+e).line(t,e),this.setPath(i.end())}else this.setPath("")}return this.internalResetStyleOrClass(t._style),this}}let sh=class extends Et{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new eh).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class rh extends Fa{constructor(t){super(t),this.add(this._faceView=new Qa(t,"rm-circle-gauge-face")),this.add(this._rimView=new Qa(t,"rm-circle-gauge-rim")),this.add(this._valueView=new Qa(t,"rm-circle-gauge-value")),this.add(this._textView=new ke(t,"rm-circle-gauge-text")),this.add(this._handContainer=new It(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 ih(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 sh(t,"rm-circle-gauge-pin")),this._pinView.visible=!0):this._pinView&&(this._pinView.visible=!1),this._textView.setVisible(e.gaugeLabel.visible&&this.point._isStatic())&&this._textView.setStyleOrClass(e.gaugeLabel._style)}render(t,e,i,s){const r=t._props.getCenter(e,i),n=this._size=d(e,i),o=t._props.getExtents(n*this.point._aniRate());this.$_renderBackground(t,r,o),this.$_renderValue(t,r,o,this.point,s)}$_renderBackground(t,e,i){const s=this._faceView,r=this._rimView,n=t._props,o=n._startRad;s.visible&&(s.internalResetStyleOrClass(t.face._style),s.setSector({cx:e.x,cy:e.y,rx:i.radius-i.radiusThick,ry:i.radius-i.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:i.radius,ry:i.radius,innerRadius:1-i.radiusThick/i.radius,start:o,angle:n._sweepRad,clockwise:t.options.clockwise}));let a=i.inner;this._pinView&&this._pinView.render(t.pin,a).trans(e.x,e.y)}$_renderValue(t,e,i,s,r){const n=t.options,o=t._props,a=s.getValue(),h=t.getValueRate(a)*r,l=t.valueRim.getThickness(i.radiusThick),c=this._textView;if(this._valueView.visible){const s=t.valueRim,r=s.options,a=i.value+(r.stroked?0:l/2),c=this._valueView;c.internalResetStyleOrClass(s._style),r.stroked&&(c.setFill("none"),c.internalSetStyle("strokeWidth",$(l))),c.setBoolData("stroked",r.stroked),c.setSectorEx({cx:e.x,cy:e.y,rx:a,ry:a,innerRadius:(a-l)/a,start:o._startRad,angle:o._sweepRad*h,clockwise:n.clockwise},r.stroked)}if(c.visible){const i=t.gaugeLabel;c.text=i.getNumberText(a,!1,!1,void 0),i.buildSvg(c,null,NaN,NaN,t,i._domain);const s=c.bbox(),r=i.getOffset(this.width,this.height);c.trans(e.x+r.x,e.y-s.height/2+r.y)}}}class nh extends At{constructor(t,e,i,s,r){super(t,e,"circle"),"number"==typeof i&&this.setCircle(i,s,r)}setCircle(t,e,i){this.setAttrs({cx:t,cy:e,r:i})}}class oh extends pt{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 ah extends Fa{constructor(t){super(t),this._rimThick=0,this._secRate=1,this.add(this._faceView=new nh(t,"rm-clock-gauge-face")),this.add(this._rimView=new Qa(t,"rm-clock-gauge-rim")),this.add(this._labelView=new ke(t,"rm-clock-gauge-label")),this._labelView.layout=Pe.MIDDLE,this.add(this._tickContainer=new It(t,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new It(t,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new Et(t,"rm-clock-gauge-hour")),this.add(this._minuteView=new Et(t,"rm-clock-gauge-minute")),this.add(this._secondView=new Et(t,"rm-clock-gauge-second")),this.add(this._pinView=new nh(t,"rm-clock-gauge-pin")),this._tickViews=new ia(this._tickContainer,ya,"rm-clock-gauge-tick"),this._tickLabelViews=new ia(this._tickLabelContainer,ke,"rm-clock-gauge-tick-label")}prepare(t,e){const i=Math.round(12/_(1,Math.floor(e.tickLabel.options.step)||1));this._tickViews.prepare(e.tick.visible?12:0),this._tickLabelViews.prepare(e.tickLabel.visible?i:0,(t=>{t.layout=Pe.MIDDLE})),this._zoneCallback=e.options.timezoneCallback}render(t,e,i){const s=this.point,r=this._exts=t.getExtents(e,i,s._aniRate());this._secRate=1,this.$_renderFace(t,r),this.$_renderHands(t,r),t.options.active&&isNaN(+s.time)?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),u(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 i=this._labelView,s=this._faceView,r=this._rimView,n=this._tickLabelViews,o=this._pinView,{cx:a,cy:h,rd:d}=e,_=this._rimThick=r.visible?t.rim.getThickness(d):0,u=t.tick.options.length||0;s.setVisible(t.face.visible)&&(s.internalResetStyleOrClass(t.face._style),s.setCircle(a,h,d)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:d,ry:d,innerRadius:1-_/d,start:0,angle:2*Math.PI,clockwise:!0}));const p=d-_;let g=p-u,m=k,f=M/12;if(this._tickViews.forEach(((e,i)=>{e.setLine(a+l(m)*p,h+c(m)*p,a+l(m)*g,h+c(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=f})),!n.isEmpty){const e=12/n.count,i=M/12*e;m=k,n.get(0).text="12",g=p-(u+t.tickLabel.options.offset||0),g-=.5*n.get(0).bbox().height,n.forEach(((s,r,n)=>{s.text=String(0===r?12:r*e),s.trans(a+l(m)*g,h+c(m)*g),s.internalResetStyleOrClass(t.tickLabel._style),m+=i}))}o.setVisible(t.pin.visible)&&(o.setCircle(a,h,t.pin.options.radius||2),o.internalResetStyleOrClass(t.pin._style)),i.setVisible(t.gaugeLabel.visible)&&(i.internalResetStyleOrClass(t.gaugeLabel._style),t.gaugeLabel.buildSvg(i,null,NaN,NaN,null,null),"bottom"===t.gaugeLabel.options.position?i.trans(a,h+g/2):i.trans(a,h-g/2))}$_getNow(t){var e;let i=t.getTime();if(!i){i=new Date;const s=m(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=i.getMinutes()+i.getTimezoneOffset()+s;i.setMinutes(r)}return i}$_renderHands(t,e){const i=this.$_getNow(this.point),s=i.getHours(),r=i.getMinutes(),n=i.getSeconds(),o=s>=12,{cx:a,cy:h,rd:l}=e,c=new eh;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=M*(s/12+r/60/12+n/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*I)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=M*(r/60+n/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*I)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?M*(this._aniSec+this._secRate)/60:M*n/60,u=d.getLength(l-this._rimThick),c.rect(-d.options.thickness/2,-u,d.options.thickness,u),_.internalResetStyleOrClass(d._style),o&&d.options.pmStyle&&_.internalSetStyleOrClass(d.options.pmStyle),_.setPath(c.close()).trans(a,h).rotate(p*I),this._prevSec=n)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const i=new oh(this,t);i.duration=t.secondHand.options.duration||200,i.start()}}}class hh extends ka{constructor(t){super(t,!0),this.add(this._back=new It(t)),this._back.add(this._figure=new Vt(t)),this._back.add(this._textView=new Yo(t,"rm-figure-series-inner-label"))}prepare(t,e,i,s){const r=this._textView,n=s.options.text;this._clearScale(this._back),this._figure.setId(e.id).resize(e.width,e.height),i?(this._image||this._back.insertDom(this._image=At.createElement(t,"use"),this._textView.dom),Pt.setAttr(this._image,"href",i.id)):this._image&&(this._image.remove(),this._image=null),r.setVisible(!!n)&&(r.internalResetStyleOrClass(s._style),r.setModel(t,s,null,null),s.prepareRich(n),s.buildSvg(r._text,r._outline,NaN,NaN,s,s.getTextDomain(this.point)),r.layout())}render(t,e){const i=this._image,s=this._textView,r=this._rBox=this._figure.bbox();if(this._aniScale(this._back,e),i){const t=i.getBBox();let e,s,n,o;t.width>r.width?(e=(t.width-r.width)/2,r.width=t.width):n=(r.width-t.width)/2,t.height>r.height?(s=(t.height-r.height)/2,r.height=t.height):o=(r.height-t.height)/2,Pt.setAttrs(this._figure.dom,{x:e,y:s}),Pt.setAttrs(i,{x:n,y:o})}if(s.visible){const t=s.bbox(),e=Pt.getPadding(s._text.dom),i=r.width-e.left-e.right,n=r.height-e.top-e.bottom;s.trans(e.left+(i-t.width)/2,(n-t.height)/2+e.top)}}tooltipColor(){return getComputedStyle(this._figure.dom).fill}}class lh extends ka{constructor(t){super(t,!0),this.add(this._imageView=new Fo(t))}setImage(t,e,i){this._imageView.url=t,isNaN(e)||(this._imageView.width=e),isNaN(i)||(this._imageView.height=i)}render(t){this._aniScale(this._imageView,t),this._rBox=this._imageView.bbox()}}class ch{constructor(t){this.$_createAnimation(t)}$_createAnimation(t){const e=t.clipRect(0,0,t.width,t.height),i=this.$_left(t,e);return null==i||i.addEventListener("finish",(()=>{e.dom.remove()})),i}$_aniOptions(){return{duration:pt.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:$(t.width)}],this.$_aniOptions())}}let dh=class extends $a{constructor(t){super(t),this._contentLayer.addAll(this._back=new Vi(t),this._area=new Et(t,"rm-line-series-area"),this._line=new Et(t,"rm-line-series-line"),this._lowLine=new Et(t))}render(t,e,i,s,r,n){const{min:o,max:a,base:h}=t.getPointExtents(i,e),l=this.$_getPts(i,o,a,s,r,n),c=i.length,d=c>2&&t.options.curved,_=new eh;if(this.resize(s,r),this._back.setVisible(!1)&&(this._back.resize(s,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,s,r)}$_getPts(t,e,i,s,r,n){const o=t.length,a=[];let h=.05*s,l=.1*r;const c=i-e;s-=.1*s,r-=.2*r;for(let i=0;i<o;i++){const d=t[i],_=h+i/(o-1)*s,u=l+(isNaN(d)||0==c?r:(1-(d*n-e)/c)*r);a.push({x:_,y:u})}return a}};const _h="rm-map-series-id-";class uh extends ka{static idClass(t){return _h+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(_h))return e.substring(17)}constructor(t){super(t),this.dom.style=""}setModel(t){t!==this.model&&this.setPath((this.model=t).path)}render(t,e,i,s,r,n){var o;const a=this.point;if(r){if(this.model.dummy)this.setBoolData("null",!1),this.setBoolData("dummy",!0),this.internalSetStyleOrClass(e);else{const e=!this.point||a.isNull;this.setBoolData("dummy",!1),this.setBoolData("null",e),e&&t&&this.internalSetStyleOrClass(t)}this.dom.classList.add(uh.idClass(this.model))}a&&(a.isSelected()&&!this.hasSavedStyles()?(this.saveStyles(),this.internalSetStyles({strokeWidth:"var(--rm-map-series-selected-stroke-width)",filter:"var(--rm-map-series-selected-filter)"}),this.internalSetStyleOrClass(i),this.strokeView||(this.strokeView=new ph(this.doc,s)),this.strokeView.render(this,i),this.strokeView.attachToOwner()):a.isSelected()||!this.hasSavedStyles()||n||(this.restoreStyles(),null===(o=this.strokeView)||void 0===o||o.detachFromOwner()))}reset(){this.model=null}}class ph extends Et{constructor(t,e){super(t,"rm-map-series-hover"),this._owner=e}render(t,e){this._area=t;const i=t.dom,s=e&&"string"==typeof e;this.copyPath(),s?this.internalSetStyleOrClass(e):this.internalSetStyles({stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,filter:i.style.filter}),t.internalSetStyles({stroke:"none",strokeWidth:"0"})}refresh(){this._area&&this.copyPath()}attachToOwner(){this._owner.add(this)}detachFromOwner(){this._owner.removeChild(this)}_doInitStyles(){super._doInitStyles(),this.setClass("rm-point"),this.setAttr("vector-effect","non-scaling-stroke"),this.setBoolData("virtual",!0),this.ignorePointer()}copyPath(){this.setPath(this._area.path())}}class gh extends Et{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class mh extends Et{constructor(t){super(t,"rm-map-series-border")}setModel(t){t!==this.model&&(this.model=t,this.setPath(t.getPath()))}reset(){this.model=null}}class fh extends Et{constructor(t){super(t,"rm-map-series-inset")}get center(){if(!this._center){const t=this._pts;let e=t[0][0],i=t[0][1],s=e,r=i;for(let n=1;n<t.length;n++)e=d(e,t[n][0]),s=_(s,t[n][0]),i=d(i,t[n][1]),r=_(r,t[n][1]);this._center=[e+(s-e)/2,i+(r-i)/2]}return this._center}render(t,e){const i=this.model;if((this.model=t)!==i){let i;if(t.box){const s=this._pts=t.box.map((t=>e.project(t)));i=`M${s[0][0]} ${s[0][1]} L${s[1][0]} ${s[1][1]} ${s[2][0]} ${s[2][1]} ${s[3][0]} ${s[3][1]} Z`}else if(t.pts){const s=t.pts,r=s.length;let n=e.project([s[0],s[1]]);this._pts=[n],i=`M${n[0]} ${n[1]}`;for(let t=2;t<r;t+=2)n=e.project([s[t],s[t+1]]),i+=` L${n[0]} ${n[1]}`,this._pts.push(n);"z"===s[r-1]&&(i+=" z")}i&&this.setPath(i),this._center=void 0}}}class bh extends Yo{constructor(t){super(t,"rm-point-label rm-point-inset")}}class yh extends It{constructor(t){super(t,"rm-point-labels rm-map-inset"),this._labels=[new ia(this,bh),new ia(this,bh)],this._maps=[new Map,new Map],this.ignorePointer()}get(t,e){const i=this._maps[e];return i&&i.get(t)}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}prepare(t,e){const i=e.model,s=i.insetLabel,r=i.map._insets;if(this.visible&&r&&r.length>0){const e=i.getPointLabels(),n=i.pointLabelCount(),o=this._labels,a=this._maps;o[0].prepare(r.length),a[0].clear(),o[1].prepare(n>1?r.length:0),a[1].clear(),r.forEach(((i,r)=>{for(let h=0;h<n;h++){const n=o[h].get(r);n.setVisible(!0)&&(this.$_prepareInsetLabel(t,n,e[h],s,i),a[h].set(i,n))}}))}else this._labels[0].prepare(0),this._labels[1].prepare(0)}$_prepareInsetLabel(t,e,i,s,r){const n=s.getInsetText(r);e.setModel(t,s,null,null),e._text.internalResetStyleOrClass(i._style),e._text.internalResetStyleOrClass(s._style),e._text.internalSetStyleOrClass(s.getInsetLabelStyle(r)),n?(i.prepareRich(n),i.buildSvg(e._text,e._outline,NaN,NaN,i,null)):(e.setText(r.name),delete e._text._lineCount)}}class wh extends Na{constructor(t){super(t,"rm-map-series",!0,!1),this._areas={},this._insetLabelContainer=new yh(t),this._areaPool=new va(this._pointContainer,uh),this._insetPool=new ia(this._pointContainer,fh),this._hoverStrokeView=new ph(t,this._pointContainer)}get hoverArea(){return this._hoverArea}set hoverArea(t){var e;let i=t;const s=this._hoverArea;if(i&&(null===(e=i.model)||void 0===e?void 0:e.selected)&&(i=null),i!==s){const t=this.model;if(s){const t=this.getPointLabel(s);s.restoreStyles(),null==t||t._text.restoreStyles(),this._hoverStrokeView.detachFromOwner()}if(!i||i.point||t.options.nullHovering||(i=void 0),this._hoverArea=i,i){const t=this.getPointLabel(i);i.saveStyles(),null==t||t._text.saveStyles(),this.setHoverStyle(i,t),this._hoverStrokeView.render(i,this.model.options.hoverStyle),this._hoverStrokeView.attachToOwner()}i!=s&&t.chart._hoverAreaChanged(t,null==i?void 0:i.model,null==s?void 0:s.model)}}get insets(){return this._insets}areaOfDom(t){let e=t;for(;e;){if(e.classList.contains("rm-point")){const t=uh.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}getIntersectedAreas(t){const e=[];return this._areaPool.forEach((i=>{Pt.isIntersectRectPath(t,i.dom,.4)&&e.push(i)})),e}needClip(){return!0}secondLabelContainer(){return this._insetLabelContainer}_getPointPool(){return this._areaPool}_setModelColor(t){this._pointContainer.setFill(t)}_setPointColor(t,e){t.setFill(e)}prepareModel(t,e,i){super.prepareModel(t,e,i);const s=this._insetLabelContainer;s.setVisible(!0===e.insetLabel.visible||null==e.insetLabel.visible&&e.isPointLabelsVisible()),this._dirty?s.visible&&s.prepare(t,this):s.visible&&!s.isEmpty&&s.prepare(t,this)}_doPrepeare(t,e,i){const s=e.map,r=e.internalBorder._style,n=e.externalBorder._style,o=e.getMapBorders(),a=e.options.bringToFront?[]:null;this._insets=s._insets,s.hasInternals&&e.internalBorder.visible?(this._internalContainer||(this._pointLayer.add(this._internalContainer=new It(t,"rm-map-series-internals")),this._internalPool=new ia(this._internalContainer,gh)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),s.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new It(t,"rm-map-series-externals")),this._externalPool=new ia(this._externalContainer,gh)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),s.hasBorders&&o.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new It(t,"rm-map-series-borders")),this._borderPool=new ia(this._borderContainer,mh))),this._areaPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i),r=t.point=e.pointOf(s);t.setModel(s),r?(s.dummy||this._setPointStyle(t,e,r),a&&a.push(t)):t.internalClearStyleAndClass(),Pt.setNoScale(t.dom)})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"internal"),Pt.setNoScale(t.dom),t.internalSetStyleOrClass(r)}),(t=>{t.setClass("rm-map-series-internal")})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"external"),Pt.setNoScale(t.dom),t.internalSetStyleOrClass(n)}),(t=>{t.setClass("rm-map-series-external")})),this._borderContainer&&this._borderContainer.visible&&this._borderPool.prepare(o.length,((t,e)=>{const i=o[e];t.setModel(i),Pt.setNoScale(t.dom),t.internalSetStyleOrClass(i._style)})),e._maxZindex>0&&this._areaPool.sort(((t,e)=>{let i,s;return(i=t.point)?(s=e.point)?isNaN(i._zindex)?isNaN(s._zindex)?0:-1:isNaN(s._zindex)?1:i._zindex-s._zindex:1:e.point?-1:0})),a&&a.length!==e.areaCount&&a.forEach((t=>{t.parent.moveToLast(t)})),this._insetPool.prepare(this._insets.length,((t,e)=>{Pt.setNoScale(t.dom)}))}_doRender(t,e){this.$_layoutAreas(t,e)}_doReset(){this._areaPool.forEach((t=>{t.visible&&t.reset()})),this._internalPool&&this._internalPool.forEach((t=>{t.visible&&t.reset()})),this._externalPool&&this._externalPool.forEach((t=>{t.visible&&t.reset()}))}_doPointerMoved(t,e,i){const s=this.areaOfDom(i);return this.hoverArea=s,!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}onScrollStart(){super.onScrollStart(),this.hoverArea=null}onScrollEnd(){const t=Object.values(this._areas);super.onScrollEnd(),this._hoverStrokeView.refresh(),t.forEach((t=>{var e;return t.model.selected&&(null===(e=t.strokeView)||void 0===e?void 0:e.refresh())}))}$_layoutAreas(t,e){const i=this.chart(),s=i.isDirty,r=i.body,n=this.model,o=n.map,a=n.options,h=i.getProjection(),l=this._areas={},c=this._insets,d=a.allAreas,_=this._labelViews(),u=this._insetLabelContainer.visible?this._insetLabelContainer:null,p=n.insetLabel,g=a.nullStyle,m=a.dummyStyle,f=a.selectStyle||a.selectedStyle,b=this._scale,y=this._areaPool;y.forEach(((t,e)=>{const i=t.model;if(i){const e=t.point,o=_&&e&&_.get(e,0);if(l[i.id]=t,t.setVisible(i.visible&&(d||!!e)&&!n.isHiddenArea(i.id))){const a=this.hoverArea===t;if(i.selected&&a&&(this.hoverArea=null),t.render(g,m,f,this._pointContainer,s,a),o){const i=r.toVisible(n.getCenter(e));if(o.setVisible(!!i)){s&&this._layoutLabel(o,t.dom);const r=o.bbox();let[n,a]=i;e.xPos=n,e.yPos=a,n*=b,a*=-b,n-=r.width/2,a-=r.height/2,o.trans(n,a)}}}else o&&o.setVisible(!1)}})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.forEach(((t,e)=>{t.setVisible(y.get(e).visible)})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.forEach(((t,e)=>{t.setVisible(y.get(e).visible)})),this._insetPool.forEach(((t,e)=>{const i=c[e];if(t.setVisible(!1!==i.visible)){const e=l[i.area],a=u&&!p.hideInsetLabel(i)&&u.get(i,0);let c;if(e){if(t.setVisible(e.visible)){if(_&&(c=_.get(e.point,0),c&&n.isPointLabelVisible(e.point))){const t=n.getCenter(e.point).slice();t[0]+=i.off[0],t[1]+=i.off[1];const s=r.toVisible(t),o=c.bbox();if(c.setVisible(!!s)){let[t,e]=s;t*=b,e*=-b,t-=o.width/2,e-=o.height/2,c.trans(t,e)}}t.render(i,h)}}else{const e=i._base;if(e)if(e[0]instanceof Ar){for(const t of e){if(!t.visible||n.isHiddenArea(t.id))return;if(_){const e=l[t.id];if(c=e&&_.get(e.point,0),c&&c.visible){const t=n.getCenter(e.point).slice(),i=e.model.inset.off;t[0]+=i[0],t[1]+=i[1];const s=r.toVisible(t),o=c.bbox();if(c.setVisible(!!s)){let[t,e]=s;t*=b,e*=-b,t-=o.width/2,e-=o.height/2,c.trans(t,e)}}}}t.render(i,h)}else if(e[0]>=0){const e=o.areaOf(i._parent);e&&e.visible&&!n.isHiddenArea(e.id)&&t.render(i,h)}}if(a&&a.setVisible(!c)){s&&a.layout();const e=t.center,i=a.bbox();let[r,n]=e;r*=b,n*=-b,r-=i.width/2,n-=i.height/2,a.trans(r,n)}}}))}getPointLabel(t){return t&&t.point?this._labelContainer.get(t.point,0):null}setHoverStyle(t,e){const{hoverColor:i}=this.model.options,s=this.model.options.hoverStyle;t.internalSetStyles({filter:wh.DefaultHoverFilter,strokeWidth:wh.DefaultHoverStrokeWidth}),t.internalSetStyleOrClass(s),i&&t.internalSetStyle("fill",i),t.point||t.internalSetStyles({fill:"var(--rm-null-area-fill)",stroke:"var(--rm-null-area-stroke)"});const r=this.model.pointLabel.options.hoverStyle;null==e||e._text.internalSetStyle("fill",wh.DefaultLabelHoverFill),r&&(null==e||e._text.internalSetStyleOrClass(r))}}wh.DefaultHoverFilter="var(--rm-map-series-hover-filter)",wh.DefaultHoverStrokeWidth="var(--rm-map-series-hover-stroke-width)",wh.DefaultLabelHoverFill="var(--rm-map-series-hover-label-fill)";class xh extends Ko{constructor(t,e,i){super(t,e),this._paddings=new bt,this.add(this._background=new Et(t,i)),this.add(this._textView=new ke(t))}setPoint(t){return this._point=t,this}measure(t,e,i,s){this._prepareStyleOrClass(e),this.setModel(e);const n=e.options.text;n?(e.prepareRich(n),e.buildSvg(this._textView,i,s,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.options.backgroundStyle;r(a)&&(a=a(e.series.getPointArgs(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,i,s);return this.mw=c.width=l.left+l.right+o.width,this.mw=c.height=l.top+l.bottom+o.height,c}_doLayout(t){const e=this._textView,i=this.width;let s=0;this._renderBackgrouond(this._background,i,this.height,t);switch(getComputedStyle(e.dom).textAlign){case"center":s+=i/2,e.anchor=Le.MIDDLE;break;case"right":s+=i,e.anchor=Le.END;break;default:e.anchor=Le.START}e.trans(s,this._paddings.top)}}class vh extends xh{constructor(t){super(t,"rm-panel-series-header","rm-panel-series-header-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(gi.bar(0,i,e,-i,s,0))}}class Sh extends xh{constructor(t){super(t,"rm-panel-series-body","rm-panel-series-body-back")}_setBackgroundStyle(t,e){t.internalSetStyleOrClass(e)}_renderBackgrouond(t,e,i,s){t.setPath(gi.bar(0,i,e,-i,0,s))}}class Ch extends ka{constructor(t){super(t,!0),this.add(this._back=new It(t)),this._back.addAll(this._borderView=new Vi(t),this._headerView=new vh(t),this._bodyView=new Sh(t),this._divider=new ya(t))}prepare(){this._clearScale(this._back)}render(t,e,i,s,r,n){const o=this.point,a=e.header,h=e.body,l=this._headerView,c=this._bodyView,d=this._divider;let _,u;l.setVisible(a.visible)&&(l.internalResetStyleOrClass(a._style),_=l.setPoint(o).measure(t,a,i,s)),this._divider.setVisible(l.visible),c.internalResetStyleOrClass(h._style),u=c.setPoint(o).measure(t,h,i,s);let p=u.width,g=u.height;l.visible&&(p=Math.max(p,_.width),g+=_.height);const m=e.getExtents(p,g);l.visible&&(l.resize(m.width,_.height),l.layout(r),d.setVisible(e.divider.visible)&&(d.trans(0,_.height),d.setHLine(0,0,m.width))),c.resize(m.width,m.height-_.height),c.transY(_.height),c.layout(r),this._borderView.setBounds(0,0,m.width,m.height,r),this._rBox={x:0,y:0,width:m.width,height:m.height},this._aniScale(this._back,n)}}class Lh extends Qa{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class Ph extends Da{constructor(t){super(t,!0),this._sectors=new ia(this,Lh,null,.5),this._rdRate=1,this.add(this._circle=new nh(t)),this._circle.internalSetStyles({stroke:"#aaa",fill:"none",strokeDasharray:"2"})}render(t,e,i,s){const r=0,n=0;if(e){this.$_calcAngles(t,[0],s);const o=t._categories||[],a=this._sectors.prepare(1).get(0),h=0,l=t.options.clockwise;let c=0,d=0;isNaN(e.radius)||(i=e.radius),a.setPieSector({cx:r,cy:n,rx:i,ry:i,innerRadius:h,start:a.start,angle:a.angle,clockwise:l}),a.trans(c,d).setVisible(!0),a.internalClearStyleAndClass(),o[0]&&o[0].color&&a.setFill(o[0].color),a.internalSetStyleOrClass(e.style)}else{const e=this.point.values;this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),this.$_layoutSectors(t,r,n,i,s)}}prepare(t,e){return super.prepare(t,e),this._rdRate=this.getSizeRate(this._ext.max,e),t}$_calcAngles(t,e,i){const s=t.options,r=e.length,n=s.clockwise?1:-1,o=e.reduce(((t,e)=>t+e),0),a=t._totalRad*i;let h=t._startRad;if(this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),r>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/o||0;t.start=h,h+=t.angle=n*e*a}}));else if(1==r){const t=this._sectors.get(0);t.start=h,t.angle=a}}$_layoutSectors(t,e,i,s,r){const n=t._categories||[],o=t.getFieldColors(),a=t.options.clockwise;this.$_calcAngles(t,this.point.values,r),this._circle.setVisible(this._sectors.isEmpty)&&this._circle.setCircle(e,i,s),this._sectors.forEach(((t,r)=>{const h=t.value;if(isNaN(h))t.setVisible(!1);else{const h=t.start;let l=0,c=0;t.trans(l,c).setVisible(!0),t.setPieSector({cx:e,cy:i,rx:s,ry:s,innerRadius:0,start:h,angle:u(t.angle),clockwise:a}),t.internalClearStyleAndClass(),n[r]&&n[r].color?t.setFill(n[r].color):o&&t.setFill(o[r%o.length])}}))}}class Mh extends Ea{constructor(t){super(t,!0),this.add(this._pin=new Et(t))}render(t){this._pin.setPath(gi.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new nh(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 kh extends Ea{}class Ah extends ka{constructor(t){super(t,!0),this.add(this._line=new Et(t)),this.add(this._arrow=new Et(t))}prepare(){this._checkStatic()}render(t,e,i,s){if(i.length>1){const t=i[i.length-2],r=i[i.length-1],n=R(Math.atan2(r[1]-t[1],r[0]-t[0]))-90,o="M"+i.map((t=>`${t[0]},${t[1]}`)).join(" L");this._line.setPath(o),this._arrow.setVisible(s)&&(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],n))}else this._line.setPath(""),this._arrow.setPath("")}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this}}class Ih extends Da{constructor(t){super(t,!0),this._cells=new ia(this,Et)}render(t,e,i,s){const r=t.getPointGrid(this.point,e,s);this.$_prepareCells(Math.round(r.count),i.wCell,i.hCell),this.$_layoutCells(t,r.grid,r.rows,r.cols,i)}$_prepareCells(t,e,i){this._cells.prepare(t,(t=>{t.setPath(gi.square(0,0,e,i))}))}$_layoutCells(t,e,i,s,r){const n=i*r.hCell+(i-1)*r.gap;let o=0,a=0;this._cells.forEach(((t,i,s)=>{isNaN(e[o][a])&&(o++,a=0),t.trans(a*r.wCell+(a>0?a*r.gap:0),n-o*r.hCell-(o>0?o*r.gap:0)),a++}))}}class Nh extends Ra{constructor(t){super(t,"rm-waffle-series",!0,!1),this._waffles=new va(this._pointContainer,Ih)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,g(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this.$_layoutWaffles(this.width,this.height,t)}$_prepareWaffles(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._waffles.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutWaffles(t,e,i){const s=this.model,r=s.pointLabel,n=s.getWaffleInfo(),o=s.chart.getProjection(),a=+s.options.rotation||0,h=[this._scale,-this._scale],l=s.options.position,c=r.getPosition,d=s.getLabelOff(),_=this._labelViews(),u={...this._getSeriesExt(s,s._visPoints),gap:s.options.gap},p=s.getCallout(),g=this._calloutViews();let m,f,b;this._waffles.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(m=o.getVisible(y)))){const e=this._getPointPositioner(r.position||l,"top");let w,x,v,S,C,L;if(p&&(w=r.getCallout(y))&&(x=w.map((t=>o.project(t))),m=x[x.length-1]),r.xPos=v=m[0],r.yPos=S=m[1],v*=h[0],S*=h[1],t.render(s,u,n,i*r.vrate()),f=t.bbox(),b=e(v,S,f.width,f.height),t.trans(b.x,b.y).rotate(a),_&&(C=_.get(r,0))&&C.setVisible(t._static)){const e=this._getLabelPositioner(c(r),"bottom");this._layoutLabel(C,t.dom).transp(e(b.x+f.width/2,b.y+f.height/2,C.bbox(),f.width/2,f.height/2,d))}g&&x&&(L=g.get(r))&&L.setVisible(t._static)&&L.render(p,r,x.flat().map(((t,e)=>t*h[e%2])),null)}}))}}class Vh extends oa{constructor(t){super(t,Vh.CLASS_NAME),this.add(this._foreignObj=new At(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=Vh.HTML_VIEW_CLASS,this._observer=new MutationObserver((t=>{this.$_refresh()}))}_doMeasure(t,e,i,s){const r=e.options,n=e.getSize(i,s),o=this._htmlView;let a=r.html||"";const h=(a.startsWith("#")||a.startsWith("."))&&t.querySelector(a);return this._htmlView.style.width=isNaN(n.width)?"max-content":"",this._foreignObj.resize(g(n.width,1e4),n.height),a=e.applyParams(h?h.innerHTML:a)||"<div></div>",a!==o.innerHTML&&(o.innerHTML=a),isNaN(n.width)&&(this._foreignObj.width=o.firstElementChild.offsetWidth),isNaN(n.height)&&(this._foreignObj.height=o.firstElementChild.offsetHeight),h&&this._templateDom!==h&&(this._templateDom=h,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0})),Xo.create(o.firstElementChild.offsetWidth,o.firstElementChild.offsetHeight)}_doLayout(t){super._doLayout(t)}_doDestory(){this._observer.disconnect()}$_refresh(){this.chart()._optionChanged(this.model)}}Vh.CLASS_NAME="rm-html-annotation",Vh.HTML_VIEW_CLASS="rm-html-annotation-view";class Eh extends ka{constructor(t){super(t,!0),this.add(this._foreignObj=new At(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className="rm-html-series-view"}setHtml(t,e,i){const s=this._htmlView,r=g(e,1e4);this._htmlView.style.width=isNaN(e)?"max-content":"",this._foreignObj.resize(r,i),t!==s.innerHTML&&(s.innerHTML=t),isNaN(e)&&(this._foreignObj.width=s.firstElementChild.offsetWidth),isNaN(i)&&(this._foreignObj.height=s.firstElementChild.offsetHeight)}render(t){this._rbox=_t.create(0,0,this._htmlView.firstElementChild.offsetWidth,this._htmlView.firstElementChild.offsetHeight)}}function Th(t,e){return new(Ia[e._type()])(t)}function Dh(t,e){return new(na[e._type()])(t)}Na.register([Qn,wh],[bo,class extends Ta{constructor(t){super(t,"rm-point-series",!0,!0),this._pointLayer.add(this._clusterContainer=new It(t,"rm-point-clusters"))}_createMarkers(t){return new va(t,kh)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(this._getGrowRate())}_doReset(){}_runShowEffect(t){const e=this.model;t&&(this._runClustering(e)||Ga.grow(this))}_doViewRateChanged(t){this.$_layoutMarkers(t)}zoomChanged(t,e){this._runClustering(this.model)}_runClustering(t){const e=t.cluster;if(e.stop(),t._visPoints.forEach((t=>t.cluster=null)),e.visible&&(isNaN(e.options.zoomLimit)||t.chart.body.zoom<e.options.zoomLimit))return e.run(t._visPoints,this.width,this.height,(e=>{this.$_prepareClusters(t,e)}),((t,e)=>{this.$_layoutMarkers(this._getGrowRate())}),(t=>{this.$_layoutMarkers(this._getGrowRate())})),!0;t.chart.body.zoom>=e.options.zoomLimit&&e.clear()}_clusterOfDom(t){if(t)return this._clusterPool.find((e=>e.containsDom(t)))}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()})),t.cluster.clusters&&this.$_prepareClusters(t,t.cluster.clusters)}$_layoutMarkers(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=Math.max(0,e.getRadius()),n=[this._scale,-this._scale],o=+e.options.rotation||0,a=e.options.position,h=this._labelViews(),l=e.getLabelOff(),c=e.getCallout(),d=this._calloutViews(),_=e.cluster.acitve;let u,p;const g=i.getPosition;this._markers.forEach(((i,m)=>{var f;const b=i.point,y=[b.lon,b.lat];if(i.setVisible(!b.isNull&&(!_&&!b.cluster||_||b.moves<1)&&null!=(u=s.getVisible(y)))){const m=this._getPointPositioner(b.position||a,"center"),w=(null!==(f=i._radius)&&void 0!==f?f:r)*b.vrate(),x=w*t,v=Na.getDrawer(e.getShape());let S,C,L,P,M,k;if(c&&(S=b.getCallout(y))&&(C=S.map((t=>s.project(t))),u=C[C.length-1]),b.xPos=L=u[0],b.yPos=P=u[1],L*=n[0],P*=n[1],p=m(L,P,2*w,2*w),p.x+=w,p.y+=w,b.px=p.x,b.py=p.y,b.cluster&&_&&b.moves>0&&(p.x=p.x+(b.cluster.cx-p.x)*Math.min(1,b.moves),p.y=p.y+(b.cluster.cy-p.y)*Math.min(1,b.moves)),i.setPath(v(x,x)),i.trans(p.x,p.y).rotate(o),h&&(M=h.get(b,0))&&M.setVisible(i._static)){this._layoutLabel(M,i.dom);let t=this._getLabelPositioner(g(b),"bottom");M.transp(t(p.x,p.y,M.bbox(),w,w,l))}if(d&&C&&(k=d.get(b))&&k.setVisible(i._static)){const t=C.flat().map(((t,e)=>t*n[e%2]));d.setMask(k,t).setCircle(t[t.length-2],t[t.length-1],w),k.render(c,b,t,null)}}})),this.$_layoutClusters()}$_prepareClusters(t,e){const i=t.cluster,s=i._style;this._clusterContainer.setBoolData("disabled",!i.isExpandable()),i.acitve&&!this._clusterPool&&(this._clusterPool=new ia(this._clusterContainer,Va)),this._clusterPool&&this._clusterPool.prepare(e.length,((t,i)=>{t.setCluster(e[i]),t.internalClearStyleAndClass(),t.internalSetStyles(s)}))}$_layoutClusters(){const t=this.model.cluster;this._clusterPool&&(t.updateClusters(),this._clusterPool.forEach((e=>{const i=e._cluster;if(e.setVisible(t.isVisible(i))){const s=t.getRange(i);e.render(s.radius,s.color),e.trans(i.cx,i.cy)}})))}}],[_o,class extends Ta{constructor(t){super(t,"rm-pin-series",!0,!0)}_createMarkers(t){return new va(t,Mh)}_doPrepeare(t,e,i){this.$_preparePins(e,e._visPoints)}_doRender(t,e){this.$_layoutPins()}_doReset(){}$_preparePins(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPins(){const t=this.chart().isDirty,e=this.model.chart.getProjection(),i=this._getGrowRate(),s=this.model,r=s.pointLabel,n=[this._scale,-this._scale],o=+s.options.rotation||0,a=s.options.position,h=r.getPosition;s.pointLabel.options.position;const l=this._labelViews(),c=s.getLabelOff(),d=s.getCallout(),_=this._calloutViews();let u,p;this._markers.forEach(((r,g)=>{const m=r.point,f=[m.lon,m.lat];if(r.setVisible(!m.isNull&&null!=(u=e.getVisible(f)))){const g=this._getPointPositioner(m.position||a,"top"),b=s.getExt(m,i*m.vrate()),y=2*b.rd,w=3*b.rd;let x,v,S,C,L,P;if(d&&(x=m.getCallout(f))&&(v=x.map((t=>e.project(t))),u=v[v.length-1]),m.xPos=S=u[0],m.yPos=C=u[1],S*=n[0],C*=n[1],p=g(S,C,y,w),t&&r.render(b),r.trans(p.x+y/2,p.y+w).rotate(o),l&&(L=l.get(m,0))&&L.setVisible(r._static)){t&&this._layoutLabel(L,r.dom);const e=this._getLabelPositioner(h(m),"bottom");L.transp(e(p.x+y/2,p.y+w/2,L.bbox(),y/2,w/2,c))}_&&v&&(P=_.get(m))&&P.setVisible(r._static)&&P.render(d,m,v.flat().map(((t,e)=>t*n[e%2])),null)}}))}}],[_n,class extends Oa{constructor(t){super(t,"rm-bar-series",!0,!1),this._labelInfo={},this._bars=new va(this._pointContainer,qa)}_getPointPool(){return this._bars}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareBars(e,this._visPoints)}_doRender(t,e){this.$_layoutBars(t,e,g(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this.$_layoutBars(this.width,this.height,t)}$_prepareBars(t,e){const i=t.reversed;this._bars.prepare(e.length,((s,r)=>{const n=s.setReversed(i).prepare(e[r],null);this._setPointStyle(s,t,n)}))}$_layoutBars(t,e,i){const s=this.model,r=s.pointLabel,n=s._width,o=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.options.position,_=r.getPosition,u=s.getLabelOff(),p=this._labelViews(),g=s.getCallout(),m=this._calloutViews(),f={pad:this._ext.pad,barWidth:s.options.barWidth,overflow:s.options.overflow};let b,y;this._bars.forEach(((t,e)=>{const r=t.point,w=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(b=l.getVisible(w)))){const e=this._getPointPositioner(r.position||d,"center"),x=t.getSizeRate(t._ext.max,h),v=this._ext.width*x,S=this._ext.height*x;let C,L,P,M,k,A;if(g&&(C=r.getCallout(w))&&(L=C.map((t=>l.project(t))),b=L[L.length-1]),r.xPos=P=b[0],r.yPos=M=b[1],P*=c[0],M*=c[1],y=e(P,M,n,o),t.resize(n,o),t.render(s,a&&h,r.values,f,v,S,i*r.vrate()),t.trans(y.x,y.y).rotate(this.rotation),p&&(k=p.get(r,0))&&k.setVisible(t._static)){let t=this._getLabelPositioner(_(r),"bottom");k.layout().transp(t(y.x+n/2,y.y+o/2,k.bbox(),n/2,o/2,u))}if(m&&L&&(A=m.get(r))&&A.setVisible(t._static)){const e=L.flat().map(((t,e)=>t*c[e%2]));m.setMask(A,e).setBounds(t.tx,t.ty,n,o),A.render(g,r,e,t.getFill())}}}))}}],[Yn,class extends Oa{constructor(t){super(t,"rm-line-series",!0,!1),this._lines=new va(this._pointContainer,dh)}_getPointPool(){return this._lines}_doPrepeare(t,e,i){super._doPrepeare(t,e,i),this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(t,e,g(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new ch(t)))}$_prepareLines(t,e){this._lines.prepare(e.length,((i,s)=>{const r=i.prepare(e[s],null);this._setPointStyle(i,t,r)}))}$_layoutLines(t,e,i){const s=this.model,r=s.pointLabel,n=s._width,o=s._height,a=!s._pointDomain,h=this._getSeriesExt(s,this._visPoints),l=s.chart.getProjection(),c=[this._scale,-this._scale],d=s.options.position,_=r.getPosition,u=s.getLabelOff(),p=this._labelViews(),g=s.getCallout(),m=this._calloutViews();let f,b;this._lines.forEach(((t,e)=>{const r=t.point,y=[r.lon,r.lat];if(t.setVisible(!r.isNull&&null!=(f=l.getVisible(y)))){const e=this._getPointPositioner(r.position||d,"top"),w=t.getSizeRate(t._ext.max,h),x=this._ext.width*w,v=this._ext.height*w;let S,C,L,P,M,k;if(g&&(S=r.getCallout(y))&&(C=S.map((t=>l.project(t))),f=C[C.length-1]),r.xPos=L=f[0],r.yPos=P=f[1],L*=c[0],P*=c[1],b=e(L,P,x,v),t.render(s,a&&h,r.values,x,v,i*r.vrate()),t.trans(b.x,b.y).rotate(this.rotation),p&&(M=p.get(r,0))&&M.setVisible(t._static)){const t=this._getLabelPositioner(_(r),"bottom");M.layout().transp(t(b.x+x/2,b.y+v/2,M.bbox(),x/2,v/2,u))}if(m&&C&&(k=m.get(r))&&k.setVisible(t._static)){const e=C.flat().map(((t,e)=>t*c[e%2]));m.setMask(k,e).setBounds(t.tx,t.ty,n,o),k.render(g,r,e,t.getFill())}}}))}}],[ho,class extends Ra{constructor(t){super(t,"rm-pie-series",!0,!1),this._pies=new va(this._pointContainer,Ph)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,g(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this.$_layoutPies(this.width,this.height,t)}$_preparePies(t,e){const i=e.length,s=this._getSeriesExt(t,e);this._pies.prepare(i,((i,r)=>{const n=i.prepare(e[r],s);this._setPointStyle(i,t,n)}))}$_layoutPies(t,e,i){const s=this.model,r=s.pointLabel,n=s.chart.getProjection(),o=[this._scale,-this._scale],a=s.options.position,h=r.getPosition,l=s.getLabelOff(),c=this._labelViews(),d=s.getCallout(),_=this._calloutViews(),u=s.getRadius(Math.min(t,e)),p=s.hasThreshold(),g=this._inRegion;let m,f;this._pies.forEach(((t,e)=>{const r=t.point,b=[r.lon,r.lat];if(t.setVisible(!r.isNull&&(g&&r._excluded||!g&&!r._excluded)&&null!=(m=n.getVisible(b)))){const e=this._getPointPositioner(r.position||a,"top"),g=u*t._rdRate;let y,w,x,v,S,C;if(d&&(y=r.getCallout(b))&&(w=y.map((t=>n.project(t))),m=w[w.length-1]),r.xPos=x=m[0],r.yPos=v=m[1],x*=o[0],v*=o[1],f=e(x,v,2*g,2*g),f.x+=g,f.y+=g,t.render(s,p&&s.getThreshold(r.getSum()),g,i*r.vrate()),t.trans(f.x,f.y),c&&(S=c.get(r,0))){const e=this._getLabelPositioner(h(r),"bottom");this._layoutLabel(S,t.dom).transp(e(f.x,f.y,S.bbox(),g,g,l))}if(_&&w&&(C=_.get(r))&&C.setVisible(t._static)){const e=w.flat().map(((t,e)=>t*o[e%2]));_.setMask(C,e).setCircle(e[e.length-2],e[e.length-1],g),C.render(d,r,e,t.getFill())}}}))}}],[Rn,class extends Na{constructor(t){super(t,"rm-figure-series",!0,!0),this._figure=this.$_createFigure(t),this._image=this.$_createImage(t),this._figures=new va(this._pointContainer,hh)}$_createFigure(t){const e=At.createElement(t,"symbol");return e.append(At.createElement(t,"path")),this._addDef(e,"figure")}$_createImage(t){const e=At.createElement(t,"image");return this._addDef(e,"image")}_getPointPool(){return this._figures}_doPrepeare(t,e,i){const r=e.figureBox,n=e.innerImage.options;Pt.setAttr(this._figure,"viewBox",r?`0 0 ${r[0]} ${r[1]}`:null),Pt.setAttr(this._figure.firstElementChild,"d",s(e.path)?e.path.join(" "):e.path),Pt.setAttrs(this._image,{href:n.url,width:n.width,height:n.height}),this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this.$_layoutFigures(t)}$_prepareFigures(t,e){const i=t.chart.isDirty,s=e.length,r={id:`#${this._figure.id}`,...t.getFigureSize()},n=this._image.getAttribute("href")?{id:`#${this._image.id}`,...t.getImageSize()}:void 0,o=t.innerLabel;this._pointContainer.setFill(t._runColor),this._figures.prepare(s,((s,a)=>{const h=s.point=e[a];this._setPointStyle(s,t,h),i&&s.prepare(this.doc,r,n,o)}))}$_layoutFigures(t){const e=this.model.chart.getProjection(),i=this.model,s=i.pointLabel,r=[this._scale,-this._scale],n=+i.options.rotation||0,o=i.options.position,a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=l&&"label"===l.options.mode,d=this._calloutViews(),_=s.getPosition,u=i.innerImage.options.minSize,p=i.getValueRange();let g,m;this._figures.forEach(((i,s)=>{const f=i.point,b=[f.lon,f.lat];if(i.setVisible(!f.isNull&&null!=(g=e.getVisible(b)))){const s=this._getPointPositioner(f.position||o,"top");let y,w,x,v,S,C,L,P;l&&(y=f.getCallout(b))&&(w=y.map((t=>e.project(t))),c||(g=w[w.length-1])),f.xPos=x=g[0],f.yPos=v=g[1],x*=r[0],v*=r[1];const M=isNaN(u)?1:(f.value-p.min)/(p.max-p.min);if(i.render(M,t),L=i._rBox,m=s(x,v,L.width,L.height),i.trans(m.x,m.y).rotate(n),a&&(S=a.get(f,0))&&S.setVisible(i._static))if(this._layoutLabel(S,i.dom),P=S.bbox(),c&&w){const t=w.flat().map(((t,e)=>t*r[e%2])),e=this._getLabelPositioner("center","center");S.transp(e(t[t.length-2],t[t.length-1],P,0,0,h))}else{const t=this._getLabelPositioner(_(f),"bottom");S.transp(t(m.x+L.width/2,m.y+L.height/2,P,L.width/2,L.height/2,h))}if(d&&w&&(C=d.get(f))&&C.setVisible(i._static)){const t=w.flat().map(((t,e)=>t*r[e%2]));L.x=i.tx,L.y=i.ty,P&&(P.x=t[t.length-2],P.y=t[t.length-1]),d.setMask(C,t).setRects(L,P),C.render(l,f,t,i.getFill())}}}))}}],[So,Nh],[xo,class extends Na{constructor(t){super(t,"rm-route-series",!1,!1),this._lines=new va(this._pointContainer,Ah,"rm-route-series-line")}needClip(){return!0}_getPointPool(){return this._lines}_setPointColor(t,e){t._line.setStroke(e),t._arrow.setFill(e)}_doPrepeare(t,e,i){i&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(g(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){}_legendColorProp(){return"stroke"}$_prepareLines(t,e){const i=e.length;this._pointContainer.setStroke(t._runColor),this._lines.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(),i._line.setFill("none"),Pt.setNoScale(i._line.dom),i._arrow.setStroke("none"),Pt.setNoScale(i._arrow.dom)}))}$_layoutLines(t){const e=this.model,i=e.chart;if(i.isDirty||!isNaN(t)){const s=i.getProjection(),r=e.options.lineWidth,n=e.options.arrowDisplay;if(ot){const t=g(r,2)/this._scale;this._pointContainer.internalSetStyle("strokeWidth",`${t}px`)}else isNaN(r)||this._pointContainer.internalSetStyle("strokeWidth",`${r}px`);t=g(t,1),this._lines.forEach(((i,r)=>{this.$_layoutLine(i,e,s,n,t*i.point.vrate())}))}}$_layoutLine(t,e,i,r,o){const a=t.point;if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(s(a.path)){const e=a.path,s=[];let r=0;for(;r<e.length;)n(e[r])?(s.push(e[r]),r++):(s.push(...i.project([e[r],e[r+1]])),r+=2);t._line.setPath(s.join(" "))}else{const s=this.$_genPath3([a.lon1,a.lat1],[a.lon2,a.lat2],16).map((t=>i.project(t))).filter((t=>!t.outside));o<1&&(s.length=s.length*o|0),t.render(e,1/this._scale,s,"none"!==r&&(o<1||"moving"!==r))}}$_genPath3(t,e,i){const s=[],r=Math.min(.1,Math.max(0,this.model.options.bendFactor)),n=Math.log(1+(o=t[0],a=t[1],h=e[0],l=e[1],Math.sqrt((o-h)**2+(a-l)**2)))*r;var o,a,h,l;const c=this._calculateControlPoint(t,e,n);for(let r=0;r<=i;r++){const n=r/i,o=this.interpolate3(t,c,n),a=this.interpolate3(c,e,n),h=this.interpolate3(o,a,n);s.push(h)}return s}interpolate3(t,e,i){const s=D(t[1]),r=D(t[0]),n=D(e[1]),o=D(e[0]),a=Math.acos(Math.sin(s)*Math.sin(n)+Math.cos(s)*Math.cos(n)*Math.cos(o-r)),h=Math.sin((1-i)*a)/Math.sin(a),l=Math.sin(i*a)/Math.sin(a),c=h*Math.cos(s)*Math.cos(r)+l*Math.cos(n)*Math.cos(o),d=h*Math.cos(s)*Math.sin(r)+l*Math.cos(n)*Math.sin(o),_=h*Math.sin(s)+l*Math.sin(n),u=Math.sqrt(c*c+d*d+_*_),p=Math.asin(_/u);return[R(Math.atan2(d,c)),R(p)]}_calculateControlPoint(t,e,i){const s=i,r=this.interpolate3(t,e,.5),n=D(r[1]),o=D(r[0]),a=n+s*Math.sin(Math.PI/2);return[R(o+s*Math.cos(Math.PI/2)),R(a)]}}],[bs,class extends Ta{constructor(t){super(t,"rm-bubble-series",!0,!1)}_createMarkers(t){return new va(t,Ja)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,g(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this.$_layoutMarkers(this.width,this.height,t)}$_prepareMarkers(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._markers.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutMarkers(t,e,i){const s=(t,e,i)=>{t.setPath(p(e,e)),t.trans(i.x,i.y).rotate(l)},r=(t,e,i)=>{if(h instanceof Sr){const s=h.r,r=this.chart().width,n=i[1]*Math.PI/180,o=e/2*(360/r),a=o/Math.cos(n),l=o;h.r=xr*this._scale;const c=ha.geoCircle(i[0],i[1],a,l,h,!0);h.r=s,t.setPath(c),t.trans(0,0).rotate(0)}else s(t,e,S)},n=this.model,o=n.pointLabel,a=n.chart,h=a.getProjection(),l=+n.options.rotation||0,c=[this._scale,-this._scale],_=n.options.position,u=this._getLabelPositioner(n.subLabel.options.position,"right"),p=Na.getDrawer(n.getShape()),g=this._labelViews(),m=n.getLabelOff(),f=n.getSubLabelOff(),b=n.getCallout(),y=this._calloutViews(),{min:w,max:x}=n.getPixelMinMax(d(a.width,a.height));let v,S;const C=o.getPosition;this._markers.forEach(((t,e)=>{const o=t.point,a=[o.lon,o.lat];if(t.setVisible(!o.isNull&&null!=(v=h.getVisible(a)))){const e=this._getPointPositioner(o.position||_,"center");let l,d,p,L,P,M,k=(t._radius=n.getRadius(o.getValue(),w,x))*o.vrate()*i;if(b&&(l=o.getCallout(a))&&(d=l.map((t=>h.project(t))),v=d[d.length-1]),o.xPos=p=v[0],o.xPos=L=v[1],p*=c[0],L*=c[1],S=e(p,L,2*k,2*k),S.x+=k,S.y+=k,this.model.alignToSurface?r(t,k,a):s(t,k,S),g){if(P=g.get(o,0)){let e=this._getLabelPositioner(C(o),"center");this._layoutLabel(P,t.dom).transp(e(S.x,S.y,P.bbox(),k,k,m))}(P=g.get(o,1))&&this._layoutLabel(P,t.dom).transp(u(S.x,S.y,P.bbox(),k,k,f))}if(y&&d&&(M=y.get(o))&&M.setVisible(t._static)){const e=d.flat().map(((t,e)=>t*c[e%2]));y.setMask(M,e).setCircle(e[e.length-2],e[e.length-1],k),M.render(b,o,e,t.getFill())}}}))}}],[jn,class extends Na{constructor(t){super(t,"rm-image-series",!0,!0),this._images=new va(this._pointContainer,lh)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,i=t.options.imageWidth,s=t.options.imageHeight;this._images.prepare(e.length,((r,n)=>{const o=r.point=e[n];r.setImage(t.getUrl(o),i,s),this._setPointStyle(r,t,o)}))}_layoutPoints(t){const e=this.model,i=e.pointLabel,s=e.chart.getProjection(),r=+e.options.rotation||0,n=[this._scale,-this._scale],o=e.options.position,a=e.getLabelOff(),h=this._labelViews(),l=e.getCallout(),c=this._calloutViews(),d=i.getPosition;let _,u;this._images.forEach(((e,i)=>{const p=e.point,g=[p.lon,p.lat];if(e.setVisible(!p.isNull&&null!=(_=s.getVisible(g)))){const i=this._getPointPositioner(p.position||o,"top");let m,f,b,y,w,x,v;if(l&&(m=p.getCallout(g))&&(f=m.map((t=>s.project(t))),_=f[f.length-1]),p.xPos=b=_[0],p.yPos=y=_[1],b*=n[0],y*=n[1],e.render(t),v=e._rBox,u=i(b,y,v.width,v.height),e.trans(u.x,u.y).rotate(r),h&&(w=h.get(p,0))&&w.setVisible(e._static)){const t=this._getLabelPositioner(d(p),"bottom");w.layout().transp(t(u.x+v.width/2,u.y+v.height/2,w.bbox(),v.width/2,v.height/2,a))}if(c&&f&&(x=c.get(p))&&x.setVisible(e._static)){const t=f.flat().map(((t,e)=>t*n[e%2]));v.x=e.tx,v.y=e.ty,c.setMask(x,t).setRects(v),x.render(l,p,t,e.getFill())}}}))}}],[no,class extends Na{constructor(t){super(t,"rm-panel-series",!0,!1),this._panels=new va(this._pointContainer,Ch)}_doPrepeare(t,e,i){this.$_preparePanels(e,e._visPoints)}_doRender(t,e){this.$_layoutPanels(this.doc,t,e,this._getGrowRate())}_doReset(){}_setModelColor(t){this._pointContainer.setStroke(t)}_setPointColor(t,e){t.setStroke(e)}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this.$_layoutPanels(this.doc,this.width,this.height,t)}_getPointPool(){return this._panels}$_preparePanels(t,e){const i=e.length;this._panels.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare()}))}$_layoutPanels(t,e,i,s){const r=this.model,n=r.chart.getProjection(),o=[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=g(u.rx,0);let m,f,b;this._panels.forEach(((u,g)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(m=n.getVisible(w)))){const g=this._getPointPositioner(y.position||a,"top");let x,v,S,C,L,P;if(d&&(x=y.getCallout(w))&&(v=x.map((t=>n.project(t))),m=v[v.length-1]),y.xPos=S=m[0],y.yPos=C=m[1],S*=o[0],C*=o[1],u.render(t,r,e,i,p,s),f=u._rBox,b=g(S,C,f.width,f.height),u.trans(b.x,b.y),l&&(L=l.get(y,0))&&L.setVisible(u._static)&&this._layoutLabel(L,u.dom).transp(h(b.x+f.width/2,b.y+f.height/2,L.bbox(),f.width/2,f.height/2,c)),_&&v&&(P=_.get(y))&&P.setVisible(u._static)){const t=v.flat().map(((t,e)=>t*o[e%2]));f.x=u.tx,f.y=u.ty,_.setMask(P,t).setRects(f),P.render(d,y,t,u.getFill())}}}))}}],[So,Nh],[Fn,class extends Na{constructor(t){super(t,"rm-html-series",!0,!1),this._htmlViews=new va(this._pointContainer,Eh),this._observer=new MutationObserver((t=>{this.chart()._optionChanged(this.model)}))}_getPointPool(){return this._htmlViews}_doPrepeare(t,e,i){this.$_prepareHtmls(t,e,this._visPoints)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareHtmls(t,e,i){const s=e.options,r=e.getSize(),n=s.html||"",o=(n.startsWith("#")||n.startsWith("."))&&t.querySelector(n);this._htmlViews.prepare(i.length,((t,s)=>{const a=t.point=i[s],h=e.applyParams(a,o?o.innerHTML:n)||"<div></div>";t.setHtml(h,r.width,r.height),this._setPointStyle(t,e,a)})),o&&this._templateDom!==o&&(this._templateDom=o,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0}))}_layoutPoints(t){const e=this.model,i=e.chart.getProjection(),s=[this._scale,-this._scale],r=this._getLabelPositioner(e.pointLabel.options.position,"bottom"),n=e.getLabelOff(),o=this._labelViews(),a=e.getCallout(),h=this._calloutViews();let l,c;this._htmlViews.forEach(((d,_)=>{const u=d.point,p=[u.lon,u.lat];if(d.setVisible(!u.isNull&&null!=(l=i.getVisible(p)))){const _=this._getPointPositioner(e.options.position,"center");let g,m,f,b,y,w,x;if(a&&(g=u.getCallout(p))&&(m=g.map((t=>i.project(t))),l=m[m.length-1]),u.xPos=f=l[0],u.yPos=b=l[1],f*=s[0],b*=s[1],d.render(t),x=d._rbox,c=_(f,b,x.width,x.height),d.trans(c.x,c.y),o&&(y=o.get(u,0))&&y.setVisible(d._static)&&y.layout().transp(r(c.x+x.width/2,c.y+x.height/2,y.bbox(),x.width/2,x.height/2,n)),h&&m&&(w=h.get(u))&&w.setVisible(d._static)){const t=m.flat().map(((t,e)=>t*s[e%2]));x.x=d.tx,x.y=d.ty,h.setMask(w,t).setRects(x),w.render(a,u,t,d.getFill())}}}))}}],[vn,class extends Ba{constructor(t){super(t,"rm-circle-gauge",!0,!1)}_createGauges(t){return new va(t,rh)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height,1)}_doReset(){}_runShowEffect(t){t&&Ga.grow(this)}_doViewRateChanged(t){const e=this.model;this.$_layoutGauges(e._width,e._height,t)}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e,i){const s=this.model,r=s.pointLabel,n=s.chart.getProjection(),o=[this._scale,-this._scale],a=s.options.position,h=this._labelViews(),l=s.getLabelOff(),c=s.getCallout(),d=this._calloutViews(),_=r.getPosition;let u,p,g;this._gauges.forEach(((r,m)=>{const f=r.point,b=[f.lon,f.lat];if(r.setVisible(!f.isNull&&null!=(u=n.getVisible(b)))){const m=this._getPointPositioner(f.position||a,"top");let y,w,x,v,S,C;if(c&&(y=f.getCallout(b))&&(w=y.map((t=>n.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=o[0],v*=o[1],r.render(s,t,e,i*f.vrate()),p=r._size,g=m(x,v,p,p),r.trans(g.x,g.y),h&&(S=h.get(f,0))&&S.setVisible(f._isStatic())){const t=this._getLabelPositioner(_(f),"bottom");this._layoutLabel(S,r.dom).transp(t(g.x+p/2,g.y+p/2,S.bbox(),p/2,p/2,l))}d&&w&&(C=d.get(f))&&C.setVisible(f._isStatic())&&C.render(c,f,w.flat().map(((t,e)=>t*o[e%2])),null)}}))}}],[En,class extends Ba{constructor(t){super(t,"rm-clock-gauge",!0,!1)}_createGauges(t){return new va(t,ah)}_doPrepeare(t,e,i){this.$_prepareGauges(e,e._visPoints)}_doRender(t,e){const i=this.model;this.$_layoutGauges(i._width,i._height)}_doReset(){}$_prepareGauges(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._gauges.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(this.doc,t)}))}$_layoutGauges(t,e){const i=this.model,s=i.pointLabel,r=this.model.chart.getProjection(),n=[this._scale,-this._scale],o=i.options.position,a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews(),_=s.getPosition;let u,p,g;this._gauges.forEach(((s,m)=>{const f=s.point,b=[f.lon,f.lat];if(s.setVisible(!f.isNull&&null!=(u=r.getVisible(b)))){const m=this._getPointPositioner(f.position||o,"top");let y,w,x,v,S,C;if(l&&(y=f.getCallout(b))&&(w=y.map((t=>r.project(t))),u=w[w.length-1]),f.xPos=x=u[0],f.yPos=v=u[1],x*=n[0],v*=n[1],s.render(i,t,e),p=d(t,e),g=m(x,v,p,p),s.trans(g.x,g.y),a&&(S=a.get(f,0))&&S.setVisible(f._isStatic())){const t=this._getLabelPositioner(_(f),"bottom");this._layoutLabel(S,s.dom).transp(t(g.x+p/2,g.y+p/2,S.bbox(),p/2,p/2,h))}c&&w&&(C=c.get(f))&&C.setVisible(f._isStatic())&&C.render(l,f,w.flat().map(((t,e)=>t*n[e%2])),null)}}))}}]),oa.register([Ur,Ha],[Yr,za],[Zr,ja],[Wr,Vh]);class Rh extends pt{constructor(t){super(),this.series=t,this.duration=1e3,t.model.visible=!0,this.endHandler=()=>{this.series._aniOpacity=NaN}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(.2+.8*t)),this.series._aniOpacity=t,!0}}class $h extends pt{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(1-t)),!0}}class Oh extends It{constructor(t,e,i){super(t,"rm-series-container"),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this._axisLayer=new It(t)),this._axisLayer.add(this.axisView=new _a(t,i)),this._axisLayer.add(this.tickLayer=new da(t))}get firstMap(){for(const t of this.seriesViews)if(t instanceof wh&&t.visible)return t}prepare(t,e,i){const s=e.visibleSeries,r=this.seriesMap,n=this.seriesViews,o=this._h1,a=this._h2;n.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),n.length=0,s.forEach((e=>{const s=r[e.hash]||Th(t,e);s.parent||(this.add(s),this.labelsContainer.add(s._labelContainer),this.labelsContainer.add(s.secondLabelContainer())),r[e.hash]=s,n.push(s),s._h1=o,s._h2=a,s.prepareModel(t,e,i)})),this.prevViews&&at.equalArrays(this.prevViews,n)||(this.sort(n),this.labelsContainer.sort(n.map((t=>t._labelContainer)))),this.prevViews=n.slice(0)}prepareLayout(t){this.seriesViews.forEach((e=>{e.prepareLayout(t)}))}resetClip(t){this._axisLayer.setClip(t)}scrollTo(t){this.transX(t),this.labelsContainer.transX(t)}zoomChanged(t,e){}onScrollStart(){this.seriesViews.forEach((t=>t.visible&&t.onScrollStart()))}onScrollEnd(){this.seriesViews.forEach((t=>t.visible&&t.onScrollEnd()))}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class Fh extends It{constructor(t,e){super(t,e?"rm-front-axis-guides":"rm-axis-guides"),this.front=e,this._guideViews=[],this.add(this._guideLayer=new It(t)),this.add(this._labelLayer=new It(t))}render(t,e,i,s,r){const n=e.guides.filter((t=>t.options.front==this.front));this.$_prepareGuides(t,n),this.$_layoutGuides(t,n,i,s,r)}$_prepareGuides(t,e){const i=this._guideViews,s=e.length;for(;i.length>s;)i.pop().remove();for(;i.length<s;){const e=new pa(t,this._labelLayer);i.push(this._guideLayer.add(e))}}$_layoutGuides(t,e,i,s,r){this._guideViews.forEach(((n,o)=>{n.measure(t,e[o],s,r),n.layout(i)}))}}class Bh extends Ko{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._zoom=100,this._owner=e,this.add(this._back=new Vi(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new ba(t)),this.add(this._contentLayer=new It(t,"rm-body-content")),this.add(this._feedbackContainer=new It(t,"rm-feedbacks")),this.add(this._crosshairView=new ma(t)),this._contentLayer.add(this._annotationContainer=new It(t,"rm-annotations")),this._contentLayer.add(this._axisGuideContainer=new Fh(t,!1)),this._contentLayer.add(this._seriesContainer=new Oh(t,new It(t),!1)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new Fh(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new It(t,"rm-front-annotations"))}getAnnotationAnchor(t){return this._annotationMap.get(t)}get firstMap(){return this._seriesContainer.firstMap}get transformInfo(){return this._transformInfo}get isProjectionChanged(){return this.model.projection!==this._prevPrj}getSeries(t){return this._seriesContainer.seriesMap[t.hash]}prepare(t,e){const i=e.chart.map;if(i){const{h1:t,h2:s}=i,r=e.scroll%360;e.prepare(i),this._seriesContainer._h1=t+r,this._seriesContainer._h2=s}this.$_prepareSeries(t,e.chart,0),this.$_prepareAnnotations(t,e.getAnnotations())}afterRender(){this._mousePos&&this._crosshairView.visible&&this._crosshairView.render(this.mouseToMap(this._mousePos),this._transformInfo),this.model&&this.model.isScrollable()&&this.onScrollEnd()}clean(){}reset(){this._seriesContainer.seriesViews.forEach((t=>t.reset()))}getTooltipPos(){return{x:this.tx,y:this.ty}}pointerMoved(t,e,i){if(!this.model)return;const s=this.model.chart,r=this._owner.tx,n=this._owner.ty,{sv:o,pv:a}=function(s){let o,a;for(const h of s)h.pointerMoved(t,e,i)&&(o=h,a=h.getPointView(i,t-r,e-n,!0));if(!a)for(const h of s)if(a=h.getPointView(i,t-r,e-n,!0),a){o=h;break}return{sv:o,pv:a}}(this._seriesContainer.seriesViews),h=null==o?void 0:o.model,l=h&&this._owner.getScaleView(s.getColorScale(h.getColorScale()));return(null==a?void 0:a.point)?(this._owner.showTooltip(h,a,this,{x:t,y:e}),null==l||l.setValue(a.point.getValue())):(this._owner.hideTooltip(),null==l||l.setValue(NaN)),this._crosshairView.visible&&s&&this._crosshairView.render(this.mouseToMap(this._mousePos={x:t,y:e}),this._transformInfo),!!o}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 i=this.getSeries(t);i&&(null===(e=t.ani)||void 0===e||e.stop(),(t.ani=new $h(i)).start())}getBackBounds(){return this._back.getBounds()}addFeedback(t){t&&this._feedbackContainer.add(t)}zoomChanged(t,e){this._seriesContainer.zoomChanged(t,e)}onScrollStart(){this._seriesContainer.onScrollStart()}onScrollEnd(){this._seriesContainer.onScrollEnd()}_doMeasure(t,e,i,s){return this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this._crosshairView.setVisible(e.chart.axis.crosshair.visible)&&this._crosshairView.measure(t,e.chart.axis.crosshair,i,s),Xo.create(i,s)}_doLayout(t){var e;const i=this.doc,s=this.model,r=this._zoom,n=s._prj,o=s.chart,a=o.axis,h=o.map,l=this.height,c=this.width,{wMap:d,hMap:_,scale:u,tx:p,ty:g}=s.prepareLayout(c,l);let m=this._clip;if(this._back.resize(c,l),this._back.internalResetStyleOrClass(s._style),s.zoom!==r&&(this._zoom=s.zoom),h){this.$_prepareLayoutSeries(i,o),this._transformInfo={tx:p,ty:g,scale:u,vx:this.tx+this.parent.tx,vy:this.ty+this.parent.ty};const t=`translate(${p}px, ${g}px) scale(${u}, ${-u})`,e=d*u,m=_*u,f=[this._seriesContainer],b=(c-e)/2-s.panX*u,y=(l-m)/2-s.panY*u,w=this.$_layoutClip(s,n,c,l,u);this._mapBack.setVisible(o.body.mapBackground.isVisible())&&this._mapBack.render(this.doc,o,b,y,e,m),f.forEach((n=>{const o=n.axisView,h=n.tickLayer;o.setScale(u),o.measure(i,a,c,l),o.resize(c,l),o.trans(p,g),h.setVisible(a.tick.visible)&&(h.prepare(i,a.tick,o.steps),h.resize(c,l),h.setScale(u),h.layout(s.projection),h.trans(p,g)),n.seriesViews.forEach((i=>{var s,n;i._scale=u,i.model.needMapScale()?(i._pointLayer.internalSetStyle("transform",t),i._calloutContainer.visible&&i._calloutContainer.internalSetStyles({transform:t})):i.model.needTranslate()?i.trans(p,g):(i.resize(c,l),i.trans(b,y)),i.move(p,g),i.resize(e,m),i.render(c,l,this._transformInfo),null===(s=i._labelContainer)||void 0===s||s.trans(p,g),null===(n=i.secondLabelContainer())||void 0===n||n.trans(p,g),i.setClip(i.needClip()?w:null),r!==this._zoom&&i.zoomChanged(this._zoom,r)})),o.layout(),n.resetClip(w)})),this._crosshairView.visible&&this._crosshairView.prepare(u,t);const x={map:h,prj:n,tf:this._transformInfo,trans:t,latInterval:a.latInterval,lonInterval:a.lonInterval};this.$_layoutAxisGuides(i,a,x,c,l)}if(this.$_layoutAnnotations(c,l),m&&m.parent&&m.width===c&&m.height===l||(m&&m.dom.remove(),this._clip=this.clipRect(0,0,c,l)),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 Rh(t)).start(),this._requestShow=null)}this._prevPrj=s._prj}mouseToMap(t,e=!0,i=!1){if(!this._transformInfo)return[NaN,NaN];const{tx:s,ty:r,scale:n,vx:o,vy:a}=this._transformInfo;let h=t.x-s,l=t.y-r;i||(h-=o,l-=a);const c=h/n,d=l/-n;return this.pointToMap(c,d,e)}boundsToMap(t,e=!0,i=!1){return{from:this.mouseToMap({x:t.x,y:t.y},e,i),to:this.mouseToMap({x:t.x+t.width,y:t.y+t.height},e,i)}}pointToMap(t,e,i){if(!this.model)return[NaN,NaN];const{projection:s,scroll:r}=this.model,n=s.backward([t,e]);return i||0===r||(n[0]=s.getScrolledLon(n[0])),n}mapToPoint(t){t=this.model.chart.getProjection().project(t);const{tx:e,ty:i,scale:s,vx:r,vy:n}=this._transformInfo;return{x:t[0]*s-(r-e),y:t[1]*-s-(n-i)}}boundsByCoord(t,e){const i=this.mapToPoint(t),s=this.mapToPoint(e);return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}$_prepareSeries(t,e,i){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepare(t,e,i)}$_prepareLayoutSeries(t,e){this._seriesContainer.setVisible(!0)&&this._seriesContainer.prepareLayout(t)}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&(r.get(t).remove(),r.delete(t));n.forEach((t=>t.remove())),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Dh(t,e);(e.options.front?s:i).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e){this._annotationViews.length>0&&this._annotationViews.forEach((i=>{i._layoutView(this,0,0,t,e)}))}$_layoutAxisGuides(t,e,i,s,r){this._axisGuideContainer.render(t,e,i,s,r),this._frontAxisGuideContainer.render(t,e,i,s,r),this._axisGuideContainer.setClip(this._clipMap),this._frontAxisGuideContainer.setClip(this._clipMap)}$_layoutClip(t,e,i,s,r){const n=()=>{const i=e.getClipBounds(t.chart.axis.lonInterval,t.chart.axis.latInterval);return`M${i[0][0]},${i[0][1]} L`+i.slice(1).map((t=>`${t[0]},${t[1]}`))},o=t=>{const{tx:e,ty:i}=this._transformInfo;t.path.transEx(e,i).scale(r)};if(e.isClipping()){const t=this._clipMap;if(t&&t.dom.parentElement&&t.width===i&&t.height===s){if(t){if(this._prevPrj!==e){const e=n();t.setPath(e)}o(t),this._contentLayer.hasClip()}}else{const e=n();t&&t.remove(),this._clipMap=this.control.clip(new Ot(this.doc).setPath(e)),o(this._clipMap),this._clipMap.resize(i,s)}}else this._clipMap&&(this._clipMap.remove(),this._clipMap=null);return this._clipMap}}class zh extends qo{constructor(t,e){super(t,e?zh.SUBTITLE_CLASS:zh.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new ke(t)),this._richText=new $e}_marginable(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,i,s){return this.chart().isDirty&&(this._richText.setFormat(e.options.text),this._richText.build(this._textView,i,s,null,null)),ct(this._textView.bbox())}_doLayout(){this.chart().isDirty&&this._richText.layout(this._textView,this.textAlign(),this.width,this.height,this._paddings)}}zh.TITLE_CLASS="rm-title",zh.SUBTITLE_CLASS="rm-subtitle";const jh="circle",Hh="header";var Gh;!function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Gh||(Gh={}));class Wh extends At{constructor(t){super(t,Wh.CLASS_NAME),this._topHeight=7,this._tailSize=10,this._radius=5,this._gap=8,this._tailVisible=!0,this._circleRadius=6,this._circlePaddingX=12,this._circlePaddingY=5,this._linePaddingX1=5,this._linePaddingX2=6,this._linePaddingY=4,this._lineWidth=2,this._lineGap=4,this._hideHandler=()=>{this.$_hide(),this._hideTimer=void 0},this.add(this._back=new Et(t,"rm-tooltip-back")),this.add(this._top=new Et(t,"rm-tooltip-top")),this.add(this._border=new Et(t,"rm-tooltip-border")),this.add(this._textView=new ke(t,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+kt.SHADOW_FILTER+")"),this._textView.anchor=Le.START,this._richText=new $e,this.close(!0,!1)}show(t,e,i,s,r,n){var o;const a=e.point,h=this._model=t.chart._tooltip,l=h.options,c=h.setTarget(t,a),u=(null===(o=e.tooltipColor)||void 0===o?void 0:o.call(e))||t._calcedColor,p=l.mode;if(!c)return;const g=l.text||c.getTooltipText(t,a);if(!g)return;const m=this.control,f=m.contentWidth(),b=m.contentHeight(),y=this._textView;this._richText.setFormat(g),this._richText.build(y,NaN,NaN,null,h.getTextDomain());const{w:w,h:x}=this.calcBounds(p,l);this._top.setFill(u);const v="visible"===this.getStyle("visibility")?300:0,S=l.offset+this._tailSize,C=e.getBounds(),L=m.getBounds();let P;P=i-w/2-_(0,d(i-w/2,f-w)),this._tailVisible=Math.abs(w/2-this._radius-this._tailSize/2)>Math.abs(P),h.isFollowPointer(t)||(L.bottom,C.bottom);const M=Gh.TOP;p===jh?(this.drawCircleTooltip(0,0,w,x,M,P),this._back.setFill("var(--rm-tooltip-bg)"),y.setFill("var(--rm-tooltip-color)")):p===Hh?(this.drawHeaderTooltip(0,0,w,x,M,P),this._back.setFill("var(--rm-tooltip-headermode-bg)"),y.setFill("var(--rm-tooltip-headermode-color)")):(this.drawLineTooltip(0,0,w,x,M,P),this._back.setFill("var(--rm-tooltip-bg)"),y.setFill("var(--rm-tooltip-color)")),s-=x+S,i=_(0,d(i-=w/2,f-w)),s=_(0,d(s,b-x)),this.transEx(i,s,v,!1),0===v&&this.internalSetStyle("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:Br.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,n){const o=null!=i?H(e,i):{},a=H(e,s),h=t.animate([o,a],{duration:r,fill:"none"});h&&n&&h.addEventListener("finish",n)}(this.dom,"opacity",void 0,0,200,(()=>{this.internalSetStyle("visibility","hidden")}))}drawHeaderTooltip(t,e,i,s,r,n){const o=this._textView,a=this._radius,h=this._topHeight,l=r===Gh.BOTTOM,c=this.drawPanelPath(t,e,i,s,r,n),d=l?["M",t,e+s-h,"l",i,0,"l",0,h-a,"q",0,a,-a,a,"l",2*a-i,0,"q",-a,0,-a,-a]:["M",t+a,e,"l",i-2*a,0,"q",a,0,a,a,"l",0,h-a,"l",-i,0,"l",0,a-h,"q",0,-a,a,-a],_=o.bbox();t+=(i-_.width)/2,e+=(s-_.height+(l?-h:h))/2,o.trans(t,e),this._top.setPath(d),this._border.setPath(c),this._back.setPath(c)}drawCircleTooltip(t,e,i,s,r,n){const o=this._textView,a=o.bbox(),h=this.drawPanelPath(t,e,i,s,r,n),l=this._circleRadius,c=t+this._circlePaddingX+l,d=e+this._circlePaddingY+a.height/2-l+l,_=["M",c+l,d,"A",l,l,0,0,1,c,d+l,"A",l,l,0,0,1,c-l,d,"A",l,l,0,0,1,c,d-l,"A",l,l,0,0,1,c+l,d,"Z"];t+=this._circlePaddingX+this._gap+2*l,e+=this._circlePaddingY,o.trans(t,e),this._top.setPath(_),this._border.setPath(h),this._back.setPath(h)}drawLineTooltip(t,e,i,s,r,n){const o=this._textView;o.bbox();const a=this.drawPanelPath(t,e,i,s,r,n),h=i-2*this._linePaddingX1,l=this._lineWidth,c=t+this._linePaddingX1,d=e+this._linePaddingY,_=this._lineWidth/2,u=["M",c+_,d,"L",c+h-_,d,"Q",c+h,d,c+h,d+_,"L",c+h,d+l-_,"Q",c+h,d+l,c+h-_,d+l,"L",c+_,d+l,"Q",c,d+l,c,d+l-_,"L",c,d+_,"Q",c,d,c+_,d,"Z"];t+=this._linePaddingX2,e+=this._linePaddingY+this._lineGap+this._lineWidth,o.trans(t,e),this._top.setPath(u),this._border.setPath(a),this._back.setPath(a)}calcBounds(t,e){const i=this._textView.bbox();let s=0,r=0;return"header"===t?(s=_(e.minWidth||0,i.width+16),r=_(e.minHeight||0,i.height+12)):"circle"===t?(s=_(e.minWidth||0,i.width+2*this._circlePaddingX+this._gap+2*this._circleRadius),r=_(e.minHeight||0,i.height+2*this._circlePaddingY)):(s=_(e.minWidth||0,i.width+2*this._linePaddingX2),r=_(e.minHeight||0,i.height+2*this._linePaddingY+this._lineWidth+this._lineGap)),{w:s,h:r}}drawPanelPath(t,e,i,s,r,n){const o=this._tailSize,a=this._radius,h=[];return h.push("M",t+a,e),this._tailVisible&&r===Gh.BOTTOM&&(h.push("L",t+i/2-o/2+n,e),h.push("L",t+i/2+n,e-o),h.push("L",t+i/2+o/2+n,e)),h.push("L",t+i-a,e),h.push("Q",t+i,e,t+i,e+a),this._tailVisible&&r===Gh.LEFT&&(h.push("L",t+i,e+s/2-o/2+n),h.push("L",t+i+o,e+s/2+n),h.push("L",t+i,e+s/2+o/2+n)),h.push("L",t+i,e+s-a),h.push("Q",t+i,e+s,t+i-a,e+s),this._tailVisible&&r===Gh.TOP&&(h.push("L",t+i/2+o/2+n,e+s),h.push("L",t+i/2+n,e+s+o),h.push("L",t+i/2-o/2+n,e+s)),h.push("L",t+a,e+s),h.push("Q",t,e+s,t,e+s-a),this._tailVisible&&r===Gh.RIGHT&&(h.push("L",t,e+s/2+o/2+n),h.push("L",t-o,e+s/2+n),h.push("L",t,e+s/2-o/2+n)),h.push("L",t,e+a),h.push("Q",t,e,t+a,e),h}}Wh.CLASS_NAME="rm-tooltip";class Yh extends ea{constructor(t){super(t,Yh.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new It(t);this.add(e),e.add(this._boxLayer=new It(t)),this._boxes=new ia(this._boxLayer,Vi,"rm-color-scale-box"),e.add(this._splitLayer=new It(t)),this._splits=new ia(this._splitLayer,ya,"rm-color-scale-split"),e.add(this._markerLabel=new Yo(t,void 0)),e.add(this._marker=new Et(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new It(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new It(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new It(t,"rm-color-scale-null")),this._tickLines=new ia(this._tickLineLayer,ya),this._tickLabels=new ia(this._tickLabelLayer,Yo),this._fills=[]}setValue(t){var e,i;e=t,i=this._value,(isNaN(e)?isNaN(i):e===i)||(this._value=t,this.$_resetMarker(this._wBar,this._hBar,this._vertical,this._reversed,this._inverted))}_doMeasure(t,e,i,s){let r=this.chart().isDirty;const n=e.marker,o=e.tick,a=this._tickLen=+o.line.options.length||0,h=o.line,l=o.label,c=this._vertical="vertical"===e.getLayout(),d=this._reversed=e.options.reversed,_=this._inverted=e.options.inverted,u=e.nullStep.visible?e.nullStep:void 0,p=u?u.getGap():0;let g=0,m=0;this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter);let{width:f,height:b}=e.getBarSize(i,s,c);r||(r=f!==this._wSave||b!==this._hSave),this._wSave=f,this._hSave=b,e._buildSteps();const y=e.getTicks();if(this._splitLayer.setVisible(e.stepLine.visible),this._tickLineLayer.setVisible(h.visible&&y.length>0&&a>0),this._tickLabelLayer.setVisible(l.visible&&y.length>0),this._nullLayer.setVisible(!!u),r){const i=c?b:f,s=e.getSplitPoints(i,!!u,p);this._stepCount=s.length,this.$_prepareBars(t,e,c,_),this._splitLayer.visible&&this.$_prepareSplits(s),this._tickLineLayer.visible&&this.$_prepareTickLines(s,i),this._tickLabelLayer.visible&&this.$_prepareTickLabels(y),this._nullLayer.visible&&this.$_prepareNull(t,this._nullLayer,u)}if(this._markerSize=0,this._markerLabel.setVisible(n.visible)&&(this._markerSize=n.getMarkerSize(),c?f+=this._markerSize:b+=this._markerSize,r&&this.$_prepareMarker(n,c,d,this._markerSize),this._markerLabel.setVisible(n.label.visible)),this._tickLineLayer.visible){const t=this._tickLines,e=t.count;if(t.first.setVisible(!1!==o.options.minVisible),e>1){t.last.setVisible(!1!==o.options.maxVisible);for(let i=1;i<e-1;i++)t.get(i).setVisible(!0)}t.forEach(((t,e)=>{t.visible&&(t.internalClearStyleAndClass(),t.internalImportantStylesOrClass(h._style))}))}if(this._tickLabelLayer.visible){const e=this._tickLabels,i=e.count,s=c?"width":"height";if(this._tickLabelSize=0,e.first.setVisible(!1!==o.options.minVisible),i>1){e.last.setVisible(!1!==o.options.maxVisible);for(let t=1;t<i-1;t++)e.get(t).setVisible(!0)}if(e.forEach(((e,i)=>{e.visible&&(e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(y[i].label),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1))})),u){const e=this._nullLabel;e.setModel(t,l,null,null),e._text.internalResetStyleOrClass(l._style),e.setText(u.getLabel()),e.layout(),this._tickLabelSize=Math.max(this._tickLabelSize,e.bbox()[s]),c&&(this._tickLabelSize+=1)}c?f+=this._tickLabelSize+a:b+=this._tickLabelSize+a}return this.$_layoutBar(u,this._wBar=f,this._hBar=b),this._rScale=this._scaleLayer.bbox(),g+=this._rScale.width,m+=this._rScale.height,this._titleView.visible&&(this._inTitle?g+=this._rTitle.width:m+=this._rTitle.height),this._footerView.visible&&(this._inFooter?g+=this._rFooter.width+this._gapFooter:m+=this._rFooter.height+this._gapFooter),this._rTitle&&(c?g=Math.max(g,this._rTitle.width):m=Math.max(m,this._rTitle.height)),this._rFooter&&(c?g=Math.max(g,this._rFooter.width):m=Math.max(m,this._rFooter.height)),{width:g,height:m}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible){if(this._inTitle){switch(d=g,t.title.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.options.align){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.options.align){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}this._scaleLayer.trans(p-n.x,g-n.y)}$_getFillId(t){return`${Yh.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(e,i){const s=e.createElementNS(t,"linearGradient"),r=this.$_getFillId(i);return s.setAttribute("id",r),s.appendChild(e.createElementNS(t,"stop")),s.appendChild(e.createElementNS(t,"stop")),this.control.addDef(s),s}$_setDir(t,e,i){e?Pt.setAttrs(t,i?Yh.VERT_FILL_I:Yh.VERT_FILL):Pt.setAttrs(t,i?Yh.HORZ_FILL_I:Yh.HORZ_FILL)}$_fillStops(t,e,i){const s=t.childNodes[0],r=t.childNodes[1];s.setAttribute("offset","0"),s.setAttribute("stop-color",e.toString()),s.setAttribute("stop-opacity","1"),r.setAttribute("offset","1"),r.setAttribute("stop-color",i.toString()),r.setAttribute("stop-opacity","1")}$_prepareBars(t,e,i,s){this._fills.forEach((t=>this.control.removeDef(t)));const r=this._fills=[],n=e.getSteps();if(e.options.solidFill)if(n)this._boxes.prepare(n.length,((t,e)=>{t.internalSetStyle("fill",n[e]._color1)}));else{const t=this._stepCount,i=e.minColor,s=e.endColor;this._boxes.prepare(t,((e,r)=>{e.internalSetStyle("fill",Ce.interpolate(i,s,(r+1)/t).toString())}))}else if(n)n.forEach(((e,i)=>{r.push(this.$_createGradient(t,i)),r[r.length-1][ii]=e})),r.forEach((t=>{const e=t[ii];this.$_setDir(t,i,s),this.$_fillStops(t,e._color1,e._color2)})),this._boxes.prepare(r.length,((t,e)=>{t.internalSetStyle("fill",this.$_getFillUrl(e))}));else{this._boxes.prepare(1);const n=this.$_createGradient(t,0);r.push(n),this.$_setDir(n,i,s),this.$_fillStops(n,e.minColor,e.endColor),this._boxes.first.internalSetStyle("fill",this.$_getFillUrl(0))}}$_prepareSplits(t){this._splits.prepare(t.length-1,((e,i)=>{e._userData=t[i]}))}$_prepareTickLines(t,e){this._tickLines.prepare(t.length+1,((i,s)=>{i._userData=0===s?0:s===t.length+1?e-1:t[s-1]}))}$_prepareTickLabels(t){this._tickLabels.prepare(t.length)}$_prepareMarker(t,e,i,s){e?i?this._marker.setPath(`M 0 0 L ${.8*s} -${.7*s} L ${.8*s} ${.7*s} Z`):this._marker.setPath(`M 0 0 L -${.8*s} -${.7*s} L -${.8*s} ${.7*s} Z`):i?this._marker.setPath(`M 0 0 L -${.7*s} ${s} L ${.7*s} ${s} Z`):this._marker.setPath(`M 0 0 L -${.7*s} -${s} L ${.7*s} -${s} Z`)}$_prepareNull(t,e,i){this._nullBar||(e.add(this._nullBar=new Vi(t,"rm-color-scale-box")),e.add(this._nullLabel=new Yo(t,"rm-color-scale-tick-label")))}$_layoutSplits(t,e){this._splits.forEach((i=>{this._vertical?i.setHLine(i._userData,0,t):i.setVLine(i._userData,0,e)}))}$_layoutTickLines(t){this._tickLines.forEach((e=>{this._vertical?e.setHLine(e._userData,0,t):e.setVLine(e._userData,0,t)}))}$_resetMarker(t,e,i,s,r){const n=this._markerSize,o=isNaN(this._value),a=this.model.getPosition(this._value);let h,l;a>1&&console.log(this.model.getPosition(this._value)),this._marker.setBoolData("null",o),i?(h=s?t-n+1:n-1,l=(o?r?0:1:r?a:1-a)*(e-this._nullSize)+(r?this._nullSize:0)):(h=(o?r?1:0:r?1-a:a)*(t-this._nullSize)+(r?0:this._nullSize),l=s?e-n+1:n),this._marker.trans(h,l)}$_layoutBar(t,e,i){const s=this._vertical,r=this._reversed,n=this._inverted,o=this._tickLabelLayer,a=this._tickLabelSize,h=this._markerSize,l=this._tickLen,c=this._stepCount,d=t?t.getGap():0,_=((s?i:e)-d)/(c+(t?1:0)),u=this._nullSize=t?_+d:0;let p=e,g=i,m=0,f=0,b=0,y=0;if(s?(m+=r?a:h,p-=h,y=n?f+u:f,a>0&&(r?o.trans(0,y):o.trans(e-a+1,y),this._tickLabels.forEach(((t,e,i)=>{t.trans(r?a-t.bbox().width-1:0,(n?e:i-1-e)*_-t.bbox().height/2)})),p-=a),p-=l,r&&(m+=l),b=m):(f+=r?a:h,g-=h,b=n?m:m+u,a>0&&(r?o.trans(b,0):o.trans(b,i-a),this._tickLabels.forEach(((t,e,i)=>{t.trans((n?i-1-e:e)*_-t.bbox().width/2,0)})),g-=a),g-=l,r&&(f+=l),y=f),this._boxLayer.setBounds(b,y,p,g),1===this._boxes.count?s?this._boxes.get(0).setBounds(0,0,p,g-u):this._boxes.get(0).setBounds(0,0,p-u,g):this._boxes.forEach(((t,e,i)=>{s?t.setBounds(0,(n?e:i-1-e)*_,p,_):t.setBounds((n?i-1-e:e)*_,0,_,g)})),this._splitLayer.visible&&(this._splitLayer.trans(b,y),this.$_layoutSplits(p,g)),this._tickLineLayer.visible&&(s?(r?m-=l:m+=p,this._tickLineLayer.trans(m,y)):(r?f-=l:f+=g,this._tickLineLayer.trans(b,f)),this.$_layoutTickLines(l)),t){let e=_,i=_,r=m,a=f;s?(m=this._boxLayer.tx,r=o.tx,e=p,f=n?0:g-_,a=f+Math.max(0,(i-this._nullLabel.bbox().height)/2)):(f=this._boxLayer.ty,a=o.ty,i=g,n&&(m=p-u),r=Math.max(m,m+(_-this._nullLabel.bbox().width)/2)),t.options.color&&this._nullBar.setFill(t.options.color),this._nullBar.setBounds(m+.5,f+.5,e-1,i-1),this._nullLabel.trans(r,a)}else this._nullSize=0;this.$_resetMarker(e,i,s,r,n)}}Yh.SCALE_CLASS="rm-color-scale",Yh.SCALE_FILL="rm-color-scale-fill",Yh.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},Yh.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Yh.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},Yh.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class Zh extends At{constructor(t,e,i){super(t,Zh.STYLE),this.add(this._back=new Vi(t,Zh.BACK_STYLE)),this.add(this._textView=new ke(t)),i&&this.dom.classList.add(i),e&&this.setText(e),this._textView.stain()}get text(){return this._textView.text}setText(t){this._textView.text=t}layout(t,e){this.internalSetStyleOrClass(e),this._textView.layout=Pe.MIDDLE,this._textView.layoutText();const i=this._textView.bbox(),s=getComputedStyle(this._back.dom),r=(new bt).applyPadding(s);t?(this._back.rect={x:0,y:0,width:t.width,height:t.height},this._textView.trans(t.width/2,t.height/2-1)):(this._textView.trans(r.left+i.width/2,r.top+i.height/2-1),this._back.rect={x:0,y:0,width:i.width+r.left+r.right,height:i.height+r.top+r.bottom})}click(){return!1}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}Zh.STYLE="rm-button",Zh.BACK_STYLE="rm-button-background";class Uh extends Zh{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class Xh extends Ko{}class Kh extends Xh{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new Uh(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new Uh(t,"+",(()=>this.chart().body.zoomByFactor(this.model.getZoomFactor())))),this.add(this._btnDec=new Uh(t,"-",(()=>this.chart().body.zoomByFactor(-this.model.getZoomFactor()))))}getButton(t){for(const e of[this._btnHome,this._btnInc,this._btnDec])if(e.containsDom(t))return e}_doMeasure(t,e,i,s){const r=this.chart().body.zoom,n=this._szBtn=e.getButtonSize(),o=this._gap=e.getItemGap(),a=(this._btnHome.visible=e.options.showReset)?3:2;let h=0,l=0;return this._btnHome.setBoolData(ri,r<=100),this._btnDec.setBoolData(ri,r<=100),(this._vertical=e.vertical)?(h=n.width,l+=a*n.height+(a-1)*o):(l=n.height,h+=a*n.width+(a-1)*o),{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 qh extends Xh{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 i=0;i<e.count-1;i++)if(e.get(i).containsDom(t))return this.model.chart.drillup(e.get(i+1)[si]),!0}_doMeasure(t,e,i,s){let r=this._btnBack,n=0,o=0;if("text"===e.options.type){null==r||r.remove(),this._textViews||(this._textViews=new ia(this,ke,"rm-drilldown-text"),this._seperators=new ia(this,ke,"rm-drilldown-separator"));const t=e.chart.firstVisible,i=this._history=t.getHistory();this._textViews.prepare(i.length,((t,e)=>{t.text=i[e].displayName(),t.anchor=Le.START,t[si]=i[e]})),this._seperators.prepare(i.length-1,(t=>{t.text=">",t.anchor=Le.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),r||this.add(r=this._btnBack=new Uh(t,"<",(()=>{e.chart.drillup()}))),r.layout();const i=r.bbox();n=i.width,o=i.height}return{width:n,height:o}}_doLayout(t){if("text"===this.model.options.type){const t=this.model.options.itemGap,e=this._history;let i=0;for(let s=0;s<e.length;s++){const r=this._textViews.get(s);r.setBoolData("history",s<e.length-1),r.transX(i),s<e.length-1&&(i+=r.bbox().width+t,this._seperators.get(s).transX(i),i+=this._seperators.get(s).bbox().width+t)}}}}class Jh extends ea{constructor(t){super(t,Jh.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new It(t);this.add(e),e.add(this._bubbleLayer=new It(t)),e.add(this._lineLayer=new It(t)),e.add(this._labelLayer=new It(t))}_doMeasure(t,e,i,s){const r=e.chart,n=this._steps=e.getSteps(r.width,r.height),o=n.map((t=>t.rd)).reduce(((t,e)=>Math.max(t,e)));let a=0,h=0;return this._checkTitle(t)&&(this._inTitle?a+=this._rTitle.width:h+=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?a+=this._rFooter.width+this._gapFooter:h+=this._rFooter.height+this._gapFooter),this.$_prepareBubbles(t,e,n),this.$_layoutBubbles(2*o,n),this._rScale=this._scaleLayer.bbox(),a+=this._rScale.width,h+=this._rScale.height,{width:a,height:h}}_doLayout(){const t=this.model,e=this._titleView,i=this._footerView,s=this._margins,r=this._paddings,n=this._rScale,o=this._rTitle,a=this._rFooter,h=s.left+r.left,l=s.top+r.top;let c,d,_=this.width-h-s.right-r.right,u=this.height-l-s.bottom-r.bottom,p=h,g=l;if(e.visible)if(this._inTitle){switch(d=g,t.title.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}e.trans(p,d),p+=this._rTitle.width}else{switch(t.title.options.align){case"center":c=Math.max(p,p+(_-o.width)/2);break;case"right":c=Math.max(p,p+_-o.width);break;default:c=p}e.trans(c,g),g+=this._rTitle.height}if(this._scaleLayer.trans(p-n.x,g-n.y),i.visible){if(this._inFooter)switch(c=h+_-this._rFooter.width,d=g,t.footer.options.verticalAlign){case"top":break;case"bottom":d+=u-o.height;break;default:d+=(u-o.height)/2}else switch(d=l+u-a.height,t.footer.options.align){case"center":c=Math.max(p,p+(_-a.width)/2);break;case"right":c=Math.max(p,p+_-a.width);break;default:c=p}i.trans(c,d)}}$_prepareBubbles(t,e,i){const s=e.tick,r=i.length;At.fit(t,this._bubbleLayer,this._bubbles,r,nh,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&At.fit(t,this._lineLayer,this._lines,r,ya,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&At.fit(t,this._labelLayer,this._labels,r,Yo,"rm-bubble-scale-label")}$_layoutBubbles(t,e){const i=this.model,s=t/2;if(this._bubbles.forEach(((i,r)=>{const n=e[r];i.internalResetStyleOrClass(null),i.setCircle(s,t-n.rd,n.rd)})),this._lineLayer.visible){const r=2*s+(i.tick.line.options.length||0);this._lines.forEach(((i,n)=>{const o=e[n];i.setHLine(t-2*o.rd,s,r)}))}if(this._labelLayer.visible){const r=2*s+i.tick.line.options.length+(i.tick.label.options.offset||0);this._labels.forEach(((s,n)=>{const o=e[n];s.setText(i.tick.label.getText(o.label)),s.trans(r,t-2*o.rd-s.bbox().height/2)}))}}}Jh.SCALE_CLASS="rm-bubble-scale";class Qh extends ea{constructor(t){super(t,Qh.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}Qh.SCALE_CLASS="rm-map-scale";class tl extends It{constructor(t){super(t,"rm-mapregion-body"),this._seriesViews=[],this._seriesMap={},this.add(this._seriesContainer=new It(t,"rm-mapregion-body-series")),this.add(this._labelsContainer=new It(t,"rm-mapregion-body-labels"))}prepare(t,e,i){const s=e.chart,r=s.map;if(r){const{h1:i,h2:n}=r,o=e.scroll%360;this._h1=i+o,this._h2=n,this.$_prepareSeries(t,s,o),this._seriesViews.forEach((e=>{e.prepareLayout(t)}))}}layout(t,e){const i=t.chart,s=i.map,r=this.width,n=this.height;if(s){const{wMap:e,hMap:s,scale:o,tx:a,ty:h}=t.prepareLayout(this.width,this.height);this._transformInfo={tx:a,ty:h,scale:o,vx:0,vy:0};const l=`translate(${a}px, ${h}px) scale(${o}, ${-o})`,c=e*o,d=s*o;this._seriesViews.forEach((t=>{var e,i;t._scale=o,t.model.needMapScale()?(t._pointLayer.internalSetStyle("transform",l),t._calloutContainer.visible&&t._calloutContainer.internalSetStyles({transform:l})):t.trans(a,h),t.move(a,h),t.resize(c,d),t.render(r,n,this._transformInfo),null===(e=t._labelContainer)||void 0===e||e.trans(a,h),null===(i=t.secondLabelContainer())||void 0===i||i.trans(a,h)})),i.getProjection()}const o=this._clip;o&&o.parent&&o.width===r&&o.height===n||(o&&o.dom.remove(),this._clip=this.clipRect(0,0,r,n))}$_prepareSeries(t,e,i){const s=e.visibleSeries,r=this._seriesMap,n=this._seriesViews,o=this._h1,a=this._h2;n.forEach((t=>{var e,i;s.indexOf(t.model)<0&&(null===(e=t._labelContainer)||void 0===e||e.remove(),null===(i=t.secondLabelContainer())||void 0===i||i.remove(),this.control.loaded?t.removeLater(200):t.remove())})),n.length=0,s.forEach((e=>{const s=!r[e.hash],h=r[e.hash]||Th(t,e);h.parent||(h.$_setInRegion(),this._seriesContainer.add(h),this._labelsContainer.add(h._labelContainer),this._labelsContainer.add(h.secondLabelContainer())),r[e.hash]=h,n.push(h),h._h1=o,h._h2=a,s&&(e._optionsDirty=!0),h.prepareModel(t,e,i)}))}}class el extends qo{constructor(t){super(t,el.CLASS_NAME,"rm-mapregion-background"),this.add(this._bodyView=new tl(t)),this.add(this._targetView=new Vi(t,"rm-mapregion-target")),this.add(this._connectorView=new Et(t,"rm-mapregion-connector"))}update(t,e){this.measure(this.doc,this.model,t,e),this._layoutView(0,0,t,e,this._rTarget)}_layoutView(t,e,i,s,r){this._rTarget=r,this.resizeByMeasured(),this.layout(this.model.getPosition(t,e,i,s,this.width,this.height))}_marginable(){return!1}_resetBackBounds(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return isNaN(r.width)&&(isNaN(r.height)?r.width=Mo.defaults.width:r.width=r.height),isNaN(r.height)&&(r.height=r.width),this._deflatePaddings(r),r}_doLayout(t){const e=this._rTarget,i=t.x||0,s=t.y||0;this.trans(i,s),this._background.resize(this.width,this.height),e.x-=i,e.y-=s,this._targetView.setRect(e),this._connectorView.setPath(this.$_getConnector(e)),this._bodyView.resize(this.width-1,this.height-1),this._bodyView.prepare(this.doc,this.model,this.chart().body),this._bodyView.layout(this.model,this.chart().body)}$_getConnector(t){const e=0+this.width,i=0+this.height;let s;return s=0>t.x?i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y+t.height?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[0,0,t.x+t.width,t.y,0,i,t.x+t.width,t.y+t.height]:i<t.y?[0,i,t.x,t.y,e,i,t.x+t.width,t.y]:0>t.y+t.height?[0,0,t.x,t.y+t.height,e,0,t.x+t.width,t.y+t.height]:[e,0,t.x,t.y,e,i,t.x,t.y+t.height],`M ${s[0]} ${s[1]} L ${s[2]} ${s[3]} M ${s[4]} ${s[5]} L ${s[6]} ${s[7]}`}}el.CLASS_NAME="rm-mapregion";class il extends Jo{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new zh(t,!1)),this.add(this.subtitleView=new zh(t,!0))}_doMeasure(t,e,i,s){const r=e._title,n=e._subtitle;let o,a=0,h=0,l=0,c=0,d=this.titleView,u=i,p=0,m=0;switch(d.setVisible(r.isVisible())?(o=d.measure(t,r,i,s),h=this._hTitle=o.height,a=this._wTitle=o.width):d.setModel(r),(d=this.subtitleView).setVisible(n.isVisible())?(o=d.measure(t,n,i,s),c=this._hSub=o.height,l=this._wSub=o.width,m=+n.options.titleGap||0):d.setModel(n),n.options.position){case"left":case"right":p=_(h,c),u=a+m+l;break;default:p=h+m+c,u=_(u,a+l)}return p>0&&(p+=this.titleView.visible?g(r.options.gap,0):g(n.options.gap,0)),{width:u,height:p}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.options,o=r&&r.options,a=s&&s.visible?this._wTitle>t.wMap||"chart"===n.alignBase?t.wChart:t.wMap:0,h=r&&r.visible?this._wSub>t.wMap||"chart"===o.alignBase?t.wChart:t.wMap:0;let l=this._wTitle>t.wMap||s&&"chart"===n.alignBase?0:t.xMap,c=this._wSub>t.wMap||r&&"chart"===o.alignBase?0:t.xMap;if(a>0&&h>0){const t=(t,e,i)=>{switch(t.options.verticalAlign){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},d=()=>{const e=_(this._hTitle,this._hSub);f=_(f,f+t(s,e,this._hTitle)),y=_(y,y+t(r,e,this._hSub))},u=(t,e,i)=>{switch(t.options.align){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},p=()=>{if(b=_(b,b+u(s,a,this._wTitle)),"parent"===r.options.alignBase)switch(r.options.align){case"left":w=b;break;case"right":w=b+this._wTitle-this._wSub;break;default:w=b+(this._wTitle-this._wSub)/2}else w=_(w,w+u(r,h,this._wSub))},m=g(o.titleGap,0);let f=0,b=l,y=0,w=c;switch(n.align){case"left":switch(o.position){case"left":b=w+this._wSub+m,d();break;case"right":switch(w=b+this._wTitle+m,o.align){case"center":w=_(w,w+(h-this._wTitle-this._wSub)/2);break;case"right":w=_(w,c+h-this._wSub)}d();break;case"top":p(),f=y+this._hSub+m;break;default:p(),y=f+this._hTitle+m}break;case"right":switch(o.position){case"left":switch(b+=a-this._wTitle,o.align){case"center":w+=(a-this._wTitle-this._wSub)/2;break;case"right":w=b-m-this._wSub}d();break;case"right":w+=h-this._wSub,b=w-m-this._wTitle,d();break;case"top":p(),f=y+this._hSub+m;break;default:p(),y=f+this._hTitle+m}break;default:switch(o.position){case"left":switch(b+=(a-this._wTitle)/2,o.align){case"left":break;case"center":w+=(b-w-this._wSub)/2;break;case"right":w=b-m-this._wSub}d();break;case"right":switch(b+=(a-this._wTitle)/2,o.align){case"left":w=b+this._wTitle+m;break;case"center":w=b+this._wTitle+m,w+=(h-w-this._wSub)/2;break;case"right":w+=h-m-this._wSub}d();break;case"top":p(),f=y+this._hSub+m;break;default:p(),y=f+this._hTitle+m}}e.resizeByMeasured().layout().trans(b,f),i.resizeByMeasured().layout().trans(w,y)}else if(a>0||h>0){const t=a?s:r,n=a?e:i,o=a||h,d=a?this._wTitle:this._wSub;let _=a?l:c;switch(n.resizeByMeasured().layout(),t.options.align){case"left":break;case"right":_+=o-d;break;default:_+=(o-d)/2}n.trans(_,0)}}_doLocateInner(t,e,i){}}class sl extends ea{constructor(t){super(t,sl.GROUP_CLASS,"rm-map-widget-group-background"),this._dic=new Map,this.add(this._widgetLayer=new It(t,"rm-map-widget-group-widget-layer"))}getView(t){return this._dic.get(t)}_doMeasure(t,e,i,s){const r=this._vertical=e.isVertical(),n=this._gap=8,o=this._views=this.$_preapreViews(t,e._internalWidgets()),a=new Xo;return this._checkTitle(t)&&(this._inTitle?i-=this._rTitle.width:s-=this._rTitle.height),this._checkFooter(t)&&(this._inFooter?i-=this._rFooter.width+this._gapFooter:s-=this._rFooter.height+this._gapFooter),o.forEach(((r,n)=>{r.measure(t,e.getWidget(n),i,s),this._dic.set(r.model,r)})),r?(o.forEach((t=>{a.width=Math.max(a.width,t.mw),a.height+=t.mh})),o.length>1&&(a.height+=(o.length-1)*n)):(o.forEach((t=>{a.height=Math.max(a.height,t.mh),a.width+=t.mw})),o.length>1&&(a.width+=(o.length-1)*n)),this._titleView.visible&&(this._inTitle?a.width+=this._rTitle.width:a.height+=this._rTitle.height),this._footerView.visible&&(this._inFooter?a.width+=this._rFooter.width+this._gapFooter:a.height+=this._rFooter.height+this._gapFooter),a}_doLayout(t){const e=this.model,i=this._titleView,s=this._footerView,r=this._margins,n=this._paddings,o=this._gap,a=this._views,h=this._rTitle,l=this._rFooter,c=r.left+n.left,d=r.top+n.top;let _,u,p=this.width-c-r.right-n.right,g=this.height-d-r.bottom-n.bottom,m=c,f=d;if(i.visible){if(this._inTitle){switch(u=f,e.title.options.verticalAlign){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}i.trans(m,u),m+=this._rTitle.width}else{switch(e.title.options.align){case"center":_=Math.max(m,m+(p-h.width)/2);break;case"right":_=Math.max(m,m+p-h.width);break;default:_=m}i.trans(_,f),f+=this._rTitle.height}if(s.visible){if(this._inFooter)switch(_=c+p-this._rFooter.width,u=f,e.footer.options.verticalAlign){case"top":break;case"bottom":u+=g-h.height;break;default:u+=(g-h.height)/2}else switch(u=d+g-l.height,e.footer.options.align){case"center":_=Math.max(m,m+(p-l.width)/2);break;case"right":_=Math.max(m,m+p-l.width);break;default:_=m}s.trans(_,u)}}this._widgetLayer.trans(m,f),m=f=0,a.forEach((e=>{e.resizeByMeasured(),e.layout(t)})),h&&(this._inTitle?p-=h.width:g-=h.height),l&&(this._inFooter?p-=l.width:g-=l.height),this._vertical?a.forEach((t=>{switch(t.model.options.align){case"left":break;case"right":m=Math.max(0,p-t.mw);break;default:m=Math.max(0,(p-t.mw)/2|0)}t.trans(m,f),f+=t.mh+o})):a.forEach((t=>{switch(t.model.options.verticalAlign){case"top":break;case"bottom":f=Math.max(0,g-t.mh);break;default:f=Math.max(0,(g-t.mh)/2|0)}t.trans(m,f),m+=t.mw+o}))}$_preapreViews(t,e){const i=this._widgetLayer,s=this._views,r=[];return this._dic.clear(),e.forEach((e=>{let n=null==s?void 0:s.find((t=>t.model===e));n?(r.push(n),s.splice(s.indexOf(n),1)):(n=new(rl[e._type()])(t),i.add(n),r.push(n))})),null==s||s.forEach((t=>t.remove())),r}}sl.GROUP_CLASS="rm-map-widget-group";const rl={legend:ra,colorScale:Yh,bubbleScale:Jh,group:sl};class nl extends Jo{constructor(t,e){super(t),this._loc=e,this._horz=e==Q.TOP||e==Q.BOTTOM,this._vert=e==Q.LEFT||e==Q.RIGHT,this._views=new Map}get loc(){return this._loc}getView(t){let e=this._views.get(t);if(!e)for(const i of this._views.values())if(i instanceof sl&&(e=i.getView(t),e))break;return e}_setWidgets(t,e,i){return s(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=i,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof ra&&e.legendByDom(t);if(i)return i}}_doMeasure(t,e,i,s){const r=this._prepareViews(t,i,s);if(!this.setVisible(r.size>0))return;const n=this._gap=g(+e.global.options.widgetGap,0),o=new Xo;return this._horz?(r.forEach((t=>{o.width+=t.mw,o.height=_(o.height,t.mh)})),o.width+=r.size>0?(r.size-1)*n:0):this._vert?(r.forEach((t=>{o.width=_(o.width,t.mw),o.height+=t.mh})),o.height+=r.size>0?(r.size-1)*n:0):r.forEach((t=>{o.width+=t.mw,o.height+=t.mh})),o}_doLayout(t){function e(t){return t.length>1?s*(t.length-1):0}const i=this._views,s=this._gap;let r=this.width,n=this.height,o=0,a=0;if(i.forEach((t=>{t.resizeByMeasured(),t.layout()})),this._vert){let t=0,i=0,r=0;for(const e of this._starts)t+=e.height;t+=e(this._starts);for(const t of this._ends)i+=t.height;i+=e(this._ends);for(const t of this._centers)r+=t.height;r+=e(this._centers);for(const t of this._starts)t.trans(o,a),a+=t.height+s;n-=t,a=n;for(const t of this._ends)a-=t.height,t.trans(o,a),a-=s;n-=i,a=t+Math.max(0,Math.ceil((n-r)/2));for(const t of this._centers)t.trans(o,a),a+=t.height+s}else if(this._horz){let t=0,i=0,n=0;for(const e of this._starts)t+=e.width;t+=e(this._starts);for(const t of this._ends)i+=t.width;i+=e(this._ends);for(const t of this._centers)n+=t.width;n+=e(this._centers);for(const t of this._starts)t.trans(o,a),o+=t.width+s;r-=t,o=r;for(const t of this._ends)o-=t.width,t.trans(o,a),o-=s;r-=i,o=t+Math.max(0,Math.ceil((r-n)/2));for(const t of this._centers)t.trans(o,a),o+=t.width+s}}_doLocateInner(t,e,i){this._views.forEach(((i,s)=>{const r=s.options,n=i.mw,o=i.mh;let a=+r.offsetX||0,h=0,l=0;switch(r.align){case"right":h+=t-n-a;break;case"center":h+=(t-n)/2+a;break;default:h+=a}switch(a=+r.offsetY||0,r.verticalAlign){case"bottom":l+=e-o-a;break;case"middle":l+=(e-o)/2+a;break;default:l+=a}i.trans(h,l).resize(n,o),i.layout()}))}_prepareViews(t,e,i){const s=this._views,r=new Map;this._starts=[],this._ends=[],this._centers=[],this._models.forEach((e=>{let i=s.get(e);i?(r.set(e,i),s.delete(e)):(i=new(rl[e._type()])(t),r.set(e,this.add(i)))}));for(const t of s.values())t.remove();return r.forEach(((s,r)=>{if(s.measure(t,r,e,i),this._horz)switch(r.options.align){case"left":this._starts.push(s);break;case"right":this._ends.push(s);break;default:this._centers.push(s)}else if(this._vert)switch(r.options.verticalAlign){case"top":this._starts.push(s);break;case"bottom":this._ends.push(s);break;default:this._centers.push(s)}})),this._views=r}}class ol extends Ko{constructor(t){super(t,"rm-credits"),this.add(this._textView=new ke(t)),this._textView.anchor=Le.START}click(t){this.model.options.url&&window.open(this.model.options.url,"new")}locateInner(t,e){const i=this.width,s=this.height,r=+t.offsetX||0,n=+t.offsetY||0;let o=0,a=0;switch(t.verticalAlign){case"bottom":a=e.bottom-s;break;case"middle":a=e.y+(e.height-s)/2+n;break;default:a=e.y+n}switch(t.align){case"right":o=e.right-i-r;break;case"center":o=e.x+(e.width-i)/2+r;break;default:o=e.x+r}return{x:o,y:a}}locateOuter(t,e,i){const s=t.location,r=this.width,n=this.height,o=+t.offsetX||0,a=+t.offsetY||0;let h=0,l=0;switch(s){case"left":h=o;break;case"right":h=e-r-o;break;case"top":l=a;break;default:l=i-n-a}if("left"===s||"right"===s)switch(t.verticalAlign){case"top":l=a;break;case"bottom":l=i-n;break;default:l=(i-n)/2+a}else switch(t.align){case"left":h=o;break;case"center":h=(e-r)/2+o;break;default:h=e-r-o}return{x:h,y:l}}_doMeasure(t,e,i,s){return this._textView.text=e.options.text,this.setCursor(e.options.url?"pointer":""),this._textView.bbox()}}class al extends It{constructor(t){super(t,"rm-chart"),this._widgetMap={},this._annotationViews=[],this._annotationMap=new Map,this._mapRegionViews=[],this._mapRegionMap=new Map,this.add(this._annotationContainer=new It(t,"rm-annotations")),this.add(this._bodyView=new Bh(t,this)),this.add(this._mapRegionContainer=new It(t,"rm-mapregions")),this.add(this._titleSectionView=new il(t)),this.add(this._widgetLayer=new It(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new It(t,"rm-front-annotations")),this.add(this._zoomPanelView=new Kh(t)),this.add(this._drilldownPanelView=new qh(t)),this.add(this._mapScaleView=new Qh(t)),this.add(this._creditView=new ol(t)),this.add(this._tooltipView=new Wh(t))}getAnnotationAnchor(t){return this._annotationMap.get(t)}titleView(){return this._titleSectionView.titleView}subtitleView(){return this._titleSectionView.subtitleView}bodyView(){return this._bodyView}drilldownPanelView(){return this._drilldownPanelView}getWidgetViews(t,e){return this._widgetMap[t],[]}measure(t,e,i,s){const r=(this._model=e)._credits,n=this._bodyView;let o,a=e.width=i,h=e.height=s;if(this._creditView.setVisible(r.visible)){const e=r.options;switch(o=this._creditView.measure(t,r,a,h),e.location){case"body":break;case"right":case"left":a-=o.width+(+e.offsetX||0)+(+e.gap||0);break;default:h-=o.height+(+e.offsetY||0)+(+e.gap||0)}}o=this._titleSectionView.measure(t,e,a,h),h-=o.height,n.prepare(t,e.body);const l=e._collectWidgets();for(const r of Object.values(Q)){const n=l[r];let o=this._widgetMap[r];if(n.length>0){o?o.setVisible(!0):(o=new nl(t,r),this._widgetLayer.add(o),this._widgetMap[r]=o);const l=o._setWidgets(n,i,s).measure(t,e,a,h);if(l){const t=e.global.getWidgetSectionGap(r);r===Q.BOTTOM||r===Q.TOP?h-=l.height+t:r!==Q.RIGHT&&r!==Q.LEFT||(a-=l.width+t)}}else o&&o.setVisible(!1)}n.measure(t,e.body,a,h),this.$_prepareAnnotations(t,e.getAnnotations()),this._annotationViews.forEach(((e,r)=>{e.measure(t,this._annotations[r],i,s)})),this.$_prepareMapRegions(t,e.getMapRegions()),this._mapRegionViews.forEach(((e,r)=>{e.measure(t,this._mapRegions[r],i,s)})),this._zoomPanelView.setVisible(e._zoomPanel.visible)&&this._zoomPanelView.measure(t,e._zoomPanel,a,h),this._drilldownPanelView.setVisible(e._drilldownPanel.visible)&&this._drilldownPanelView.measure(t,e._drilldownPanel,a,h)}layout(){const t=this._model,e=this.width,i=this.height;let s=e,r=i;const n=this._bodyView;let o=0;t.legend;const a=t._credits,h=this._creditView;let l=0,c=0,d=0;if(h.visible){const t=a.options;h.resizeByMeasured();const e=h.width+(+t.offsetX||0)+(+t.gap||0),i=h.height+(+t.offsetY||0)+(+t.gap||0);switch(a.options.location){case"body":break;case"right":s-=e;break;case"left":s-=e,c+=e;break;case"top":r-=i,d+=i;break;default:r-=l=i}}const _=this._titleSectionView;_.visible&&(_.resizeByMeasured(),_.layout({xMap:c,wMap:s,wChart:e}).trans(0,d),d+=_.height,r-=o=_.height);const u=this._widgetMap;for(const n in u){const o=u[n];if(o.visible){n===Q.RIGHT||n===Q.LEFT?(o.resize(o.mw,i),o.layout()):n===Q.TOP||n===Q.BOTTOM?(o.resize(e,o.mh),o.layout()):o.resize(o.mw,o.mh);const a=t.global.getWidgetSectionGap(n);switch(n){case Q.BOTTOM:r-=o.height+a;break;case Q.TOP:r-=o.height+a,d+=o.height+a;break;case Q.RIGHT:s-=o.width+a;break;case Q.LEFT:s-=o.width+a,c+=o.width+a}}}const p=_t.create(c,d,s,r);if(h.visible){const t=a.options,s="body"===t.location?h.locateInner(t,p):h.locateOuter(t,e,i);h.transp(s)}n.trans(p.x,p.y),n.resize(p.width,p.height),n.layout(),this._zoomPanelView.visible&&(this._zoomPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._zoomPanelView,p)),this._drilldownPanelView.visible&&(this._drilldownPanelView.resizeByMeasured().layout(),this.$_layoutPanel(this._drilldownPanelView,p));for(const t in u){const s=u[t];if(s.visible)if("body"===t)s.locateInner(p.width,p.height).trans(p.x,p.y);else{switch(t){case Q.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case Q.TOP:d=o+0,c=(e-s.width)/2;break;case Q.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case Q.LEFT:d=(i-s.height)/2,c=0}s.trans(c,d)}}this.$_layoutAnnotations(e,i,p),this.$_layoutMapRegions(e,i,p),this._tooltipView.close(!0,!1)}showTooltip(t,e,i,s){const{x:r,y:n}=e.tooltipPos?e.tooltipPos():{x:s.x,y:s.y},o=this._model.chart._tooltip.isFollowPointer(t),a=(o?s.x:r)-this.tx,h=(o?s.y:n)-this.ty;this._tooltipView.show(t,e,a,h,i,!0)}tooltipVisible(){return this._tooltipView.isVisible()}hideTooltip(){this._tooltipView.close(!1,!0)}clean(){this._bodyView.clean()}reset(){this._bodyView.reset()}legendByDom(t){for(const e in this._widgetMap){const i=this._widgetMap[e].legendByDom(t);if(i)return i}}seriesByDom(t){return this._bodyView.seriesByDom(t)}creditByDom(t){return this._creditView.dom.contains(t)?this._creditView:null}getWidgetView(t){for(const e in this._widgetMap){const i=this._widgetMap[e].getView(t);if(i)return i}}getScaleView(t){return this.getWidgetView(t)}pointerMoved(t,e,i){this._bodyView.pointerMoved(t,e,i)}click(t,e,i){var s;if(this._model.canClick()){const r=Object.assign({},this.control.pointerToPoint(t)),n=this._bodyView.mouseToMap(r,!1);let o;i instanceof wh&&(o=null===(s=i.areaOfDom(e))||void 0===s?void 0:s.model),o||(o=this._model.map.findByCoord(n)),r.coord=n,r.area=null==o?void 0:o.id,r.chart=this._model.wrapper,this._model.click(r)}}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)}zoomChanged(t,e){this._bodyView.zoomChanged(t,e)}isAnimating(){}onScrollStart(){this.bodyView().onScrollStart()}$_prepareAnnotations(t,e){const i=this._annotationContainer,s=this._frontAnnotationContainer,r=this._annotationMap,n=this._annotationViews;for(const t of r.keys())e.indexOf(t)<0&&r.delete(t);n.forEach((t=>{r.get(t.model)||t.remove()})),n.length=0,(this._annotations=e).forEach((e=>{const o=r.get(e)||Dh(t,e);(!1===e.options.front?i:s).add(o),r.set(e,o),n.push(o)}))}$_layoutAnnotations(t,e,i){const s=this.control._padding;let r,n,o,a;this._annotationViews.forEach((i=>{if("container"===i.model.options.scope)r=-s.left,n=-s.top,o=t+s.left+s.right,a=e+s.top+s.bottom;else r=n=0,o=t,a=e;i._layoutView(this,r,n,o,a)}))}$_prepareMapRegions(t,e){const i=this._mapRegionContainer,s=this._mapRegionMap,r=this._mapRegionViews;for(const t of s.keys())e.indexOf(t)<0&&s.delete(t);r.forEach((t=>{s.get(t.model)||t.remove()})),r.length=0,(this._mapRegions=e).forEach((e=>{const n=s.get(e)||new el(t);i.add(n),s.set(e,n),r.push(n)}))}$_layoutMapRegions(t,e,i){const s=this._bodyView,r=this.tx+s.tx,n=this.ty+s.ty,o=this.control._padding;let a,h,l,c;this._mapRegionViews.forEach((i=>{const d=i.model.options,_=s.boundsByCoord(d.bounds[0],d.bounds[1]);if("container"===d.scope)a=-o.left,h=-o.top,l=t+o.left+o.right,c=e+o.top+o.bottom;else a=h=0,l=t,c=e;_.x+=r,_.y+=n,i._layoutView(a,h,l,c,_)}))}$_layoutPanel(t,e){const i=t.model.options,s=i.offsetX||0,r=i.offsetY||0,n=t.width,o=t.height;let a=e.x,h=e.y;switch(i.verticalAlign){case"bottom":h+=e.height-r-o;break;case"middle":h+=(e.height-o)/2+r;break;default:h+=r}switch(i.align){case"right":a+=e.width-s-n;break;case"center":a+=(e.width-n)/2+s;break;default:a+=s}t.trans(a,h)}}var hl;!function(t){t.EXPORT="$$realmap_export"}(hl||(hl={}));class ll extends kt{constructor(t,e){super(t,e),this.addElement(this._chartView=new al(t)),this.addElement(this._loadingView=new Bo(t)),this.addElement(this._errorView=new ke(t,"rm-error-view")),this._loadingView.visible=!1,this._errorView.visible=!1}_initControl(t,e,i){super._initControl(t,e,i),this._chart=new Oo(null,((t,e)=>{this.changeModel(t,e)}))}_doPointerDown(t){return this.chart.exporter.contains(t.target)||this.chart.exporter.hideContextMenu(),super._doPointerDown(t)}onModelChanged(t,e,i){this.invalidateLayout()}onDataChanged(t,e){this.invalidateLayout()}onProjectionChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onMapChanged(t,e){this._chartView.reset(),this.invalidateLayout()}onZoomChanged(t,e,i){this._chartView.zoomChanged(e,i),this.invalidateLayout()}onPointAdded(t,e,i,s){s&&this._chartView.bodyView().getSeries(e).runPointAddAnimation(i)}onRequestRender(t,e){t._optionChanged(null),e?this.updateNow():this.invalidateLayout()}onRequestShowSeries(t,e,i){const s=this._chartView.bodyView();i?s.showSeries(e):s.hideSeries(e)}onExportRequest(t,e){this._export(e)}onPointToMap(t,e,i){return this._chartView.bodyView().mouseToMap({x:e,y:i},!1)}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.clearDefs(),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===hl.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}showErrorView(t="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=Pe.MIDDLE,this._errorView.text=t,this._errorView.stain();const{width:e,height:i}=this._errorView.bbox(),s=16+e/2,r=16+i/2;this._errorView.trans(s,r)}hideErrorView(){this._errorView.visible=!1}_creatDefaultTool(){return new Uo(this)}_doBeforeRender(t){var e,i;(null===(i=null===(e=this._chart)||void 0===e?void 0:e.options)||void 0===i?void 0:i.chart)&&t.internalResetStyleOrClass(this._chart.options.chart.style)}_doRender(t){var e;const i=this.model,s=this._chartView,r=t.width,n=t.height;if(this.$_renderLoadingView(r,n),i.options.chart&&(this._setBackgroundStyle(i.global.options.backgroundStyle),i&&(this.setDomResize(i.global.options.domResize),i.prepareRender(),this._loadModules()),this.loaded||s.clean(),s.measure(this.doc(),i,r,n),s.setRect(t),s.layout(),i&&i.afterRender(),null===(e=this._chart)||void 0===e?void 0:e._loadCallback)){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_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 i=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(i,t,e.options.exporting)}}$_renderLoadingView(t,e){const i=ll.LOADING_VIEW_LENGTH;this._loadingView.layout({width:i,height:i});const s=t/2+20-i/2,r=e/2+20-i/2;this._loadingView.trans(s,r)}}ll.LOADING_VIEW_LENGTH=128;const cl={chartControl:ll};class dl{static getVersion(){return"1.1.1"}static setLicenseKey(t){xt.code=t}static setDebugging(t){At.DEBUGGING=t}static setLogging(t){at.LOGGING=t}static getDistance(t,e){return at.getDistance(t,e)}static setGlobals(t){Object.assign(cl,t)}static createChart(t,e,s,r=!0,n){x.loadConfigAsync(s,!0);const o=new cl.chartControl(t,e);return i(s)&&o.chart.load(s,r,n),o.chart[$o]=o,o.chart}static async createChartAsync(t,e,s,r=!0,n){const o=new cl.chartControl(t,e);o.chart[$o]=o;try{o.showLoadingView(),await x.loadConfigAsync(s),i(s)&&o.chart.load(s,r,n)}catch(t){console.error(t),o.showErrorView(null==t?void 0:t.message)}finally{o.hideLoadingView()}return o.chart}static preset(t,e){return yr.createStockInset(t,e)}}class _l{constructor(){this._moduleMap=new Map}static getInstance(){return _l.instance||(_l.instance=new _l),_l.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}_l.instance=null,_l.ModuleNames={realchart:"realchart"};const ul=dl.getVersion,pl=dl.setDebugging,gl=dl.setLogging,ml=dl.setGlobals,fl=dl.getDistance,bl=dl.createChart,yl=dl.createChartAsync,wl=dl.preset,xl=dl.setLicenseKey;export{bi as Annotation,oa as AnnotationView,ki as BandSeriesType,_n as BarSeries,Eo as Body,Bh as BodyView,bs as BubbleSeries,zr as ChartAnnotationType,ll as ChartControl,Ko as ChartElement,ze as ChartItem,Ro as ChartObject,al as ChartView,nh as CircleElement,vn as CircleGauge,En as ClockGauge,Ce as Color,Ms as ColorRanger,ns as CoordBaseSeries,ei as Credits,A as DEG_RAD,Bi as DataPoint,Hi as DataPointLabel,Pt as Dom,jo as DragTracker,ia as ElementPool,Fs as Exporter,_l as ExternalModuleManager,vi as FeatureSeriesType,Rn as FigureSeries,Ni as GLPointSeriesType,Ci as HeatmapSeriesType,Wr as HtmlAnnotation,Yr as ImageAnnotation,Fo as ImageElement,jn as ImageSeries,It as LayerElement,Ls as Legend,ya as LineElement,Yn as LineSeries,Ar as MapArea,Qs as MapAxis,Xs as MapAxisBandGuide,Zs as MapAxisGuide,Us as MapAxisLineGuide,Ks as MapAxisRangeGuide,Oo as MapChart,Js as MapCrosshair,Qn as MapSeries,xi as MapSeriesType,Uo as MapTool,as as MarkerSeries,os as MarkerSeriesPoint,Ea as MarkerSeriesPointView,Ta as MarkerSeriesView,k as ORG_ANGLE,_s as OrthogonalSparkSeries,P as PI,M as PI_2,no as PanelSeries,Et as PathElement,ho as PieSeries,_o as PinSeries,ka as PointElement,Sa as PointLabelView,bo as PointSeries,va as PointViewPool,wa as PolyLineElement,I as RAD_DEG,Vi as RectElement,Li as RegionSeriesType,At as RmElement,xo as RouteSeries,wi as RouteSeriesType,t as SVGNS,Ii as SankeySeriesType,Jo as SectionView,Qa as SectorElement,es as Series,Ga as SeriesAnimation,Na as SeriesView,Zr as ShapeAnnotation,Xo as Size,cs as SparkSeries,Fr as Subtitle,Ai as TableSeriesType,Le as TextAnchor,Ur as TextAnnotation,ke as TextElement,Pe as TextLayout,Pi as TiledWebSeriesType,Or as Title,Mi as TrackSeriesType,at as Utils,ss as ValuePoint,rs as ValueSeries,Si as VectorSeriesType,So as WaffleSeries,ot as _isIE,u as absv,h as assignObj,W as calcPercent,E as ceil,p as copyObj,l as cos,bl as createChart,yl as createChartAsync,lt as createRect,Fe as extend,T as fixnum,V as floor,fl as getDistance,ul as getVersion,y as incv,s as isArray,dt as isEmptyRect,i as isObject,n as isString,_ as maxv,d as minv,hi as parseCoord,G as parsePercentSize,g as pickNum,f as pickProp,b as pickProp3,$ as pixel,wl as preset,ct as rectToSize,pl as setDebugging,ml as setGlobals,xl as setLicenseKey,gl as setLogging,c as sin};