UNPKG

realmap

Version:

Wooritech map chart component library

8 lines 507 kB
/** 
 * Realmap v1.1.20
 * Copyright (C) 2023-2026 WooriTech Inc.
 * All Rights Reserved. 
 */
const t=Object.prototype.hasOwnProperty,e=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i=Array.isArray,s=function(t){return"function"==typeof t},r=function(t){return"string"==typeof t},n=function(t){return"number"==typeof t},o=function(t){return"boolean"==typeof t},a=Object.assign,h=Math.floor,l=Math.ceil,c=Math.cos,d=Math.sin,_=Math.min,u=Math.max,p=Math.abs,g=function(t){if(t&&"object"==typeof t&&!i(t))return a({},t)},m=Math.PI,f=2*m,b=-m/2,y=m/180,w=180/m;"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});const x="undefined"!=typeof navigator?navigator.userAgent:"",v=x?navigator.appVersion:"",S=!!x.match(/Trident.*rv\:11\./),C=-1!==v?.indexOf("MSIE 10"),P=-1!==v?.indexOf("MSIE 9"),M=S||C||P,L="undefined"!=typeof window&&window.devicePixelRatio||1,A=function(t,e){const i="number"==typeof t?t:parseFloat(t);return isNaN(i)?"number"==typeof e?e:parseFloat(e):i},k=function(t,e,i){const s="number"==typeof t?t:parseFloat(t);if(!isNaN(s))return s;const r="number"==typeof e?e:parseFloat(e);return isNaN(r)?"number"==typeof i?i:parseFloat(i):r},I=function(t,e){return void 0!==t?t:e},E=function(t,e,i){return void 0!==t?t:void 0!==e?e:i},T=(t,e,i)=>t+(e-t)*i;function N(t){return t>f?t%f:t}function $(t){return t*Math.PI/180}function V(t){return 180*t/Math.PI}function R(t){return t+"px"}function D(t){return t+"%"}function O(t){return null==t||Number.isNaN(t)||""===t}function B(t){return null==t||Number.isNaN(t)||""===t}function F(t){return t<10?"0"+t:String(t)}function z(t){return t<10?"00"+t:t<100?"0"+t:String(t)}function j(t,e){const i={};return i[t]=e,i}const G=(t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))},H="%".charCodeAt(0),W=class{static setDebugging(t=!0){this._debugging=t}static on(){this._debugging}};W._debugging=!1;let Y=W;function Z(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)===H&&(s=1===i.length?NaN:parseFloat(i)),isNaN(s)){if(e)return null;throw new Error(`Invalid size value: ${t}`)}}return{size:s,fixed:i}}function U(t,e,i=NaN){return t?t.fixed?t.size:t.size*e/100:i}const X="vertical-lr",K="vertical-rl";function q(t){const e=String(t).split(/\s+/g),i=A(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 J={BOTTOM:"bottom",TOP:"top",RIGHT:"right",LEFT:"left",BODY:"body"},Q=(new Date).getTime(),tt=class t{static setLogging(t){this.LOGGING=t}static log(...t){this.LOGGING&&console.log(...t)}static logIf(t,...e){this.LOGGING&&t&&console.log(...e)}static warn(...t){this.LOGGING&&console.warn(...t)}static warnIf(t,...e){this.LOGGING&&t&&console.warn(...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(e){var i=e.getMonth(),s=e.getDate(),r=[0,31,59,90,120,151,181,212,243,273,304,334][i]+s;return i>1&&t.isLeapYear(e.getFullYear())&&r++,r}static incMonth(e,i){const s=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+i),e.setDate(_(s,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}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&&!i(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static checkArray(t){return i(t)?t:void 0}static makeArray(t,e=!1){return null!=t?i(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return i(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const i=[];for(let s=e,r=e+t;s<r;s++)i.push(s);return i}static isValueArray(t){if(i(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return i(t)?t:null!=t?[t]:null}static copyArray(t){return i(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let 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 getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static getEnumNames(t){return Object.keys(t)}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-Q}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,i){return e=u(e||2,1),i=i||"0",new Array(e-String(t).length+1).join(i)+t}static pad16(t,e,i){return e=u(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(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const s=i(e)?[]:{};for(let i of Object.keys(e))s[i]=t.deepClone(e[i]);return s}}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(e,i){const s=performance.now();i(),t.log(e,performance.now()-s+"ms")}static clamp(t,e,i){return u(e,_(i,t))}static clampEx(t,e,i){return isNaN(e)||(t=u(e,t)),isNaN(i)||(t=_(i,t)),t}static makeIntArray(t,e){const i=new Array(u(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=p(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 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=_(e,t[s]),i=u(i,t[s]);return{min:e,max:i}}static valueAt(t,e){return e&&(this.isObject(t)||i(t))?e.split(".").reduce(((t,e)=>t?t[e]:void 0),t):t}static capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let i=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const s=t.charAt(e);s>="A"&&s<="Z"&&(i+=" "),i+=s}return i}static irandom(t,e){if(void 0!==e){const i=Math.floor(t),s=Math.floor(e);return Math.floor(Math.random()*(s-i)+i)}{const e=Math.floor(t);return Math.floor(Math.random()*e)}}static brandom(){return Math.random()>.5}static srandom(t,e){let i="";const s=this.irandom(t,e);for(let t=0;t<s;t++)i+=String.fromCharCode(this.irandom(97,123));return i}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[this.irandom(t.length)]}static iarandom(e,i,s){const r=[];for(let n=0;n<s;n++)r.push(t.irandom(e,i));return r}static saveAsFile(t,e){const i=t instanceof Blob?t:new Blob([t],{type:"text/plain"}),s=URL.createObjectURL(i),r=document.createElement("a");r.href=s,r.download=e,r.click(),URL.revokeObjectURL(s)}static escapeCsv(t){return t.includes(",")||t.includes('"')||t.includes("\n")||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}};tt.LOGGING=!1,tt.week_days=["일","월","화","수","목","금","토"],tt.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],tt.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]];let et=tt;const it=["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"],st=["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"],rt=class t{constructor(e){if(this.r=0,this.g=0,this.b=0,this.a=1,e=e&&e.trim())if(et.startsWith(e,"rgb(")&&et.endsWith(e,")"))this.$_parseRgb(e.substring(4,e.length-1));else if(et.startsWith(e,"rgba(")&&et.endsWith(e,")"))this.$_parseRgb(e.substring(5,e.length-1));else if(et.startsWith(e,"#"))this.$_parseNumber(e.substring(1));else{t.COLORS[e]&&this.$_parseNumber(t.COLORS[e])}}static create(e){return r(e)?new t(e):void 0}static isBright(e){return new t(e).isBright()}static getContrast(e,i,s){return new t(e).getContrast(i,s)}static interpolate(e,i,s){const r=new t(null);return r.r=Math.ceil(e.r+(i.r-e.r)*s),r.g=Math.ceil(e.g+(i.g-e.g)*s),r.b=Math.ceil(e.b+(i.b-e.b)*s),r.a=(i.a+e.a)/2,r}static interpolate3(e,i,s,r,n=.5){const o=new t(null);return r<n?(o.r=Math.ceil(e.r+(i.r-e.r)*(r/n)),o.g=Math.ceil(e.g+(i.g-e.g)*(r/n)),o.b=Math.ceil(e.b+(i.b-e.b)*(r/n)),o.a=(i.a+e.a)/2):(o.r=Math.ceil(i.r+(s.r-i.r)*((r-n)/(1-n))),o.g=Math.ceil(i.g+(s.g-i.g)*((r-n)/(1-n))),o.b=Math.ceil(i.b+(s.b-i.b)*((r-n)/(1-n))),o.a=(s.a+i.a)/2),o}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(e,i=null){return(i=i||new t(null)).r=Math.ceil(this.r+(255-this.r)*e),i.g=Math.ceil(this.g+(255-this.g)*e),i.b=Math.ceil(this.b+(255-this.b)*e),i.a=this.a,i}setAlpha(t){return this.a=t,this}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let i;e>6?(i=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),i=parseInt(t,16)),this.r=(16711680&i)>>16,this.g=(65280&i)>>8,this.b=255&i}};rt.TRANSPARENT=new rt("rgba(0,0,0,0)"),rt.WHITE=new rt("rgb(255,255,255)"),rt.BLACK=new rt("rgb(0,0,0)"),rt.COLORS=function(){const t={};for(let e=0;e<it.length;e++)t[it[e]]=st[e];return t}();let nt=rt;const ot=class t{constructor(t=0,e=0){this.width=t,this.height=e}static empty(){return new t}static create(e=0,i=0){return new t(e,i)}get isEmpty(){return 0===this.width||0===this.height}clone(){return new t(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}};ot.EMPTY=new ot;let at=ot;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}const _t=class t{constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}static create(e,i,s,r){const n=arguments.length;return et.isObject(e)?new t(e.x,e.y,e.width,e.height):n<2?new t(e,e,e,e):n<3?new t(e,i,e,i):new t(e,i,s,r)}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}};_t.Empty=new _t,_t.Temp=new _t;let ut=_t,pt=0;class gt{constructor(){this._hash=++pt,this._disposed=!1,this._disposing=!1}dispose(){return this._disposed||this._disposing||(this._disposing=!0,this._doDispose(),this._disposed=!0),null}_doDispose(){}get hash(){return this._hash}get shash(){return this._hash.toString()}get disposing(){return this._disposing}get orphaned(){return this._disposed}_throwError(t){throw new Error(t)}}let mt=651212;class ft{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=R(e.x),i.top=R(e.y),i.width=R(e.width),i.height=R(e.height)}static setBounds(t,e,i,s,r){const n=t.style;n.left=R(e),n.top=R(i),n.width=R(s),n.height=R(r)}static setBoundsEx(t,e,i,s,r){const n=t.style;isNaN(e)||(n.left=R(e)),isNaN(i)||(n.top=R(i)),isNaN(s)||(n.width=R(s)),isNaN(r)||(n.height=R(r))}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 clear(t){let e;for(;e=t.lastChild;)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 createElement(t,e,i,s){const n=t.createElement(e);return s&&(n.id=s),r(i)?n.className=i:i&&Object.assign(n.style,i),n}static fillSelect(t,e,i){t.options.length=0,e.forEach((e=>{const s=null!=e.value?e.value:e,r=null!=e.label?e.label:String(e),n=new Option(r,s);s===i&&(n.selected=!0),t.add(n)}))}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 removeData(t,...e){e.forEach((e=>delete t.dataset[e]))}static clearData(t){for(const e in t.dataset)delete t.dataset[e]}static toggleData(t,e,i){i?t.dataset[e]="1":delete t.dataset[e]}static setBoolData(t,e,i){return i?e in t.dataset||(t.dataset[e]=""):e in t.dataset&&delete t.dataset[e],i}static getBoolData(t,e){return null!=t.dataset[e]}static getData(t,e){return t.dataset[e]}static getNumData(t,e){return parseFloat(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-"+mt++}static createDiv(t,e,i){return this.createElement(t,"div",e,i)}static createSpan(t,e,i){return this.createElement(t,"span",e,i)}static createCheckBox(t,e,i){const s=this.createElement(t,"input",e,i);return s.type="checkbox",s}static createRadio(t,e,i){const s=this.createElement(t,"input",e,i);return s.type="radio",s}static createBR(t,e){return this.createElement(t,"br",e)}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){Y.on(),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 setStyles(t,e){return e&&Object.assign(t.style,e),t}static setImportantStyle(t,e,i){t.setProperty(e,i,"important")}static setNoScale(t){!M&&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}static createSvg(t,e){const i=t.createElementNS("http://www.w3.org/2000/svg","svg");return e&&(i.innerHTML=e),i}static getTableCell(t){if(t instanceof Element){let e=t;do{if(e instanceof HTMLTableCellElement)return e;e=e.parentElement}while(e)}return null}static selectAll(t){const e=t.ownerDocument,i=e.defaultView,s=i?.getSelection();if(s){const i=e.createRange();i.selectNodeContents(t),s.removeAllRanges(),s.addRange(i)}}static clearSelection(t=document){const e=t.defaultView;e?.getSelection()?.removeAllRanges()}}const bt=/(.*)/,yt=new RegExp(';(?=(?:[^"]*"[^"]*")*(?![^"]*"))'),wt=class t{constructor(t){this._pattern=bt,this._replace="$1",this.$_parse(this._format=t)}static getFormatter(e){let i=t.Formatters[e];return i||(t.Formatters[e]=i=new t(e)),i}get format(){return this._format}toStr(t){return t&&t.replace(this._pattern,this._replace)}$_parse(t){if(t){const e=t.trim().split(yt);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)))}}}};wt.Formatters={};let xt=wt;class vt extends Error{}const St=function(s,r){if(s===r)return!0;if(null==s||null==r)return!1;if(s instanceof Date&&r instanceof Date)return s.getTime()===r.getTime();if(i(s)&&i(r)){if(s.length!==r.length)return!1;for(let t=0;t<s.length;t++)if(!St(s[t],r[t]))return!1;return!0}if(e(s)&&e(r)){const e=Object.keys(s),i=Object.keys(r);if(e.length!==i.length)return!1;for(const i of e){if(!t.call(r,i))return!1;if(!St(s[i],r[i]))return!1}return!0}return!1},Ct=function(s,r){const n=e(s)?s:{};for(const s in r)if(t.call(r,s)){let t=r[s];i(t)?n[s]=t.slice(0):t instanceof Date?n[s]=new Date(t):e(t)?n[s]=Ct(n[s],t):n[s]=t}return n},Pt=class s extends gt{_init(){const t=this._op={};return this._doInit(t),this._doApply(t),t}_doInit(t){}preset(t,e=!0){return this._preset=t._op,e&&this._children&&this._children.forEach(((e,i)=>{const s=t._children?.get(i);s&&e.preset(s,!0)})),this}_doDispose(){this._externals=void 0,this._preset=void 0,this._children&&(this._children.forEach((t=>t.dispose())),this._children=void 0)}prop(t){const e=this._op[t];if(void 0!==e)return e;if(this._preset){const e=this._preset[t];if(void 0!==e)return e}return this.constructor.defaults[t]}str(t){const e=this._op[t];if(void 0!==e)return String(e);if(this._preset){const e=this._preset[t];if(void 0!==e)return String(e)}return String(this.constructor.defaults[t])}num(t){let e=parseFloat(this._op[t]);return isNaN(e)?this._preset&&(e=parseFloat(this._preset[t]),!isNaN(e))?e:parseFloat(this.constructor.defaults[t]):e}bool(t){let e=this._op[t];if(void 0!==e)return Boolean(e);if(this._preset){const e=this._preset[t];if(void 0!==e)return Boolean(e)}return e=this.constructor.defaults[t],Boolean(e)}propAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.prop(t):e.rest?e.child.propAt(e.rest):void 0}strAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.str(t):e.rest?e.child.strAt(e.rest):void 0}numAt(t){const e=this._resolvePath(t);return-1===e?NaN:0===e?this.num(t):e.rest?e.child.numAt(e.rest):NaN}boolAt(t){const e=this._resolvePath(t);return-1!==e&&(0===e?this.bool(t):!!e.rest&&e.child.boolAt(e.rest))}props(...t){const e=this._op,i=this.constructor.defaults,s={};for(const r of t){let t=e[r];void 0===t&&this._preset&&(t=this._preset[r]),s[r]=void 0!==t?t:i[r]}return s}propIs(t,e){return e===this.prop(t)}propIsNot(t,e){return e!==this.prop(t)}init(){return this._op||this._init(),this}initAndLoad(t){return this.init().$_load(t)}$_load(t){const e=this._op;return void 0===t||this._doSetSimple(e,t)||this._doLoad(e,t),this._doApply(e),this}getOption(t){const e=this._findChild(t);if(e)return e.saveOptions();if(this._externals?.has(t)){const e={};return this._doSaveProp(e,t,this._externals.get(t)),e[t]}return this._op[t]}getOptionAt(t){const e=this._resolvePath(t);if(-1!==e)return 0===e?this.getOption(t):e.rest?e.child.getOptionAt(e.rest):e.child.saveOptions()}loadOptions(t,e=!0){return e&&this.clearOptions(!0,!1),this.$_load(t),this._optionChanged(),this}saveOption(t){if(this._children&&this._children.has(t))return this._findChild(t).saveOptions();if(this._externals?.has(t)){const e={};return this._doSaveProp(e,t,this._externals.get(t)),e[t]}return this._op[t]}saveOptions(t,s=!1,r=!1,n=!1){const o={};let a,h,l;return i(t)?a=t:e(t)&&([a,h,l]=this.$_splitProps(t)),this._doSave(o,a,this.constructor.defaults,s,r,h,n,l),o}saveTo(t,s,r=!1,n=!1,o=!1){let a,h,l;return i(s)?a=s:e(s)&&([a,h,l]=this.$_splitProps(s)),this._doSave(t,a,this.constructor.defaults,r,n,h,o,l),t}updateOptions(t,e=!0){const i=this._op,r=this._externals??s.EMPTY_MAP;let n,o;if(void 0!==t&&!this._doSetSimple(i,t)){const e={};let s;for(const i in t)r.has(i)?(this._doUpdateProp(i,t[i]),(o??=[]).push(i)):(s=this._findChild(i))?(s=this.$_recreateChild(i,s,t[i]),(n??=[]).push(i)):t[i]!==this.prop(i)&&(this.$_validateOptions(i,t[i]),e[i]=t[i],(o??=[]).push(i));Ct(i,e)}return this._doApply(i),n?.forEach((e=>this._findChild(e).updateOptions(t[e]))),e&&this._optionChanged(o),this}invertOptions(i){if(!e(i))return{};const s={},r={};let n=!1;for(const e in i){if(!t.call(i,e))continue;const o=this._findChild(e);o?s[e]=o.invertOptions(i[e]):(r[e]=i[e],n=!0)}return n&&this.saveTo(s,r,!0,!1,!0),s}updateOption(t,s,r=!0,n=!1){if(this._doUpdateProp(t,s))return this._doApply(this._op),r&&this._optionChanged(t),this;let o=this._findChild(t);if(o)o=this.$_recreateChild(t,o,s),o.updateOptions(s);else{const o=this._op;(n||s!==this.prop(t))&&(this.$_validateOptions(t,s),i(s)?s=s.slice(0):s instanceof Date?s=new Date(s):e(s)&&(s=Ct({},s)),o[t]=s,this._doApply(o),r&&this._optionChanged(t))}return this}toggleOption(t,e=!0){if(this._findChild(t))return this;const i=this._op,s=this.prop(t),r=!o(s)||!s;return this.$_validateOptions(t,r),i[t]=r,this._doApply(i),e&&this._optionChanged(t),this}removeOption(e,i=!0){const s=this._op,r=this._findChild(e);return r?r.clearOptions(!0):this._externals?.has(e)?(this._doUpdateProp(e,void 0),this._externals.delete(e),this._doApply(s),i&&this._optionChanged(e)):t.call(s,e)&&(delete s[e],this._doApply(s),i&&this._optionChanged(e)),this}updateAt(t,e,i=!0,s=!1){const r=this._resolvePath(t);if(-1===r)return this;if(0===r)return this.updateOption(t,e,i,s);if(r.rest)return r.child.updateAt(r.rest,e,i,s);return this.$_recreateChild(t,r.child,e).updateOptions(e,i),this}toggleAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.toggleOption(t,e):i.rest?i.child.toggleAt(i.rest,e):this}deleteAt(t,e=!0){const i=this._resolvePath(t);return-1===i?this:0===i?this.removeOption(t,e):i.rest?i.child.deleteAt(i.rest,e):(i.child.clearOptions(!0,e),this)}_clearExternalOptions(){this._externals=void 0}clearOptions(t=!1,e=!0){return function e(i){i._op={},t&&i._children&&i._children.forEach((t=>t&&e(t))),i._clearExternalOptions(),i._doApply(i._op)}(this),e&&this._optionChanged(),this}_cleanExternalOptions(){}clean(t=!0){return function e(i){const s=i._op,r=i.constructor.defaults;for(const t of Object.keys(s))St(s[t],i._propBaseline(t,r))&&delete s[t];t&&i._children&&i._children.forEach((t=>e(t))),i._cleanExternalOptions()}(this),this}_addChild(t,e){return(this._children??=new Map).set(t,e),e&&e._init(),e}_attachRef(t,e){(this._children??=new Map).set(t,e)}_findChild(t){return this._children?.get(t)}_resolveChild(t){return this._findChild(t)}_resolvePath(t){const e=t.indexOf("."),i=e<0?t:t.substring(0,e),s=e<0?"":t.substring(e+1),r=this._resolveChild(i);return r?{child:r,rest:s}:e<0?0:-1}_optionChanged(t){throw new Error("Not implemented")}_includeTags(t,...e){return!t||(i(t)?e.some((e=>t.includes(String(e)))):e.includes(t))}$_recreateChild(t,e,i){const s=this._doRecreateChild(t,e,i);return s?((this._children??=new Map).set(t,s),s._init(),s):e}_doRecreateChild(t,e,i){}_doLoad(s,r){for(const n in r)if(t.call(r,n)){let t,o=r[n];this._doLoadProp(n,o)?(this._externals??=new Map).set(n,o):void 0!==(t=this._findChild(n))?(t=this.$_recreateChild(n,t,o),t.$_load(o)):i(o)?s[n]=o.slice(0):o instanceof Date?s[n]=new Date(o):e(o)?s[n]=Object.assign({},o):s[n]=o}}_doSetSimple(t,e){return!1}_doLoadProp(t,e){return!1}_doUpdateProp(t,e){return this._doLoadProp(t,e)}_doSaveProp(t,e,i){return!1}_doApply(t){}_propBaseline(t,e){return e[t]}_doSave(e,r,n,o,a,h,l=!1,c){const d=this._op,_=this._children??s.EMPTY_MAP,u=this._externals??s.EMPTY_MAP,p=r&&r.length>0,g=l&&p,m=p?r:Object.keys(d);for(const s of m)if(!_.has(s)&&!u.has(s)){const r=t.call(d,s);if(!r&&!a&&!g)continue;const o=this._propBaseline(s,n),h=r?d[s]:o;(a||g||!St(h,o))&&(i(h)?e[s]=h.slice():void 0!==h?e[s]=h:g&&(e[s]=void 0))}if(u.size>0)if(p){if(c)for(const t in c)u.has(t)&&this._doSaveProp(e,t,c[t])}else u.forEach(((t,i)=>this._doSaveProp(e,i,u.get(i))));_.forEach(((i,s)=>{const n=null!=h&&t.call(h,s),c=p&&r.indexOf(s)>=0;if(p&&!n&&!c)return;const d=n||c;if(o||d){const t=n?h[s]:void 0,r=l&&d,o=i.saveOptions(t,!0,a,r);(r||a||Object.keys(o).length>0)&&(e[s]=o)}}))}$_validateOptions(t,e){try{this._doValidateOptions(t,e)}catch(e){throw e instanceof vt?e:new vt(`Invalid value for option "${t}": ${e.message}`)}}$_splitProps(t){const e=[];let i,s;for(const r of Object.keys(t))this._children?.has(r)?((i??={})[r]=t[r],e.push(r)):this._externals?.has(r)?(s??={})[r]=t[r]:e.push(r);return[e,i,s]}_doValidateOptions(t,e){}};Pt.defaults={},Pt.EMPTY_MAP=new Map;let Mt=Pt;(class t extends Mt{constructor(t=!1){super(),this._items=[],t&&this.keyProp&&(this._map=new Map)}get keyProp(){}get addMissingOnUpdate(){return t.UPDATE_MODE.addMissing}get removeMissingOnUpdate(){return t.UPDATE_MODE.removeMissing}get reorderOnUpdate(){return t.UPDATE_MODE.reorder}get count(){return this._items.length}get isEmpty(){return 0===this._items.length}get isSingle(){return 1===this._items.length}get items(){return this._items.slice()}get first(){return this._items[0]}get last(){const t=this._items;return t.length?t[t.length-1]:void 0}_internalItems(){return this._items}get(t){return this._items[t]}getOf(t){return this._map?this._map.get(t):this.keyProp?this.findProp(this.keyProp,t):void 0}itemAt(t){return this._items[t]}indexOf(t){return this._items.indexOf(t)}indexOfProp(t,e){for(let i=0;i<this._items.length;i++)if(this._items[i].prop(t)===e)return i;return-1}findIndex(t){return this._items.findIndex(((e,i)=>t(e,i,this)))}contains(t){return-1!==this._items.indexOf(t)}forEach(t){this._items.forEach(((e,i)=>t(e,i,this)))}some(t){return this._items.some(((e,i)=>t(e,i,this)))}someProp(t,e){return this._items.some((i=>i.prop(t)===e))}find(t){return this._items.find(((e,i)=>t(e,i,this)))}findProp(t,e){return this._items.find((i=>i.prop(t)===e))}filter(t){return this._items.filter(((e,i)=>t(e,i,this)))}filterProp(t,e){return this._items.filter((i=>i.prop(t)===e))}map(t){return this._items.map(((e,i)=>t(e,i,this)))}addSource(t,e=!0){return this.insertSource(t,this._items.length,e)}insertSource(t,e,i=!0){const s=this.$_newItem(t);if(s){const t=Math.max(0,Math.min(e,this._items.length));this.$_insertItem(s,t,i)}return s}add(t,e=!0){return this.insert(t,this._items.length,e),!0}insert(t,e,i=!0){const s=Math.max(0,Math.min(e,this._items.length));return this.$_insertItem(t,s,i),!0}addAll(t,e=!0){return this.insertAll(t,this._items.length,e)}insertAll(t,e,i=!0){const s=Math.max(0,Math.min(e,this._items.length));return this._items.splice(s,0,...t),t.forEach(((t,e)=>this.$_inserted(t,s+e))),this._doItemsChanged(this._items),i&&this._optionChanged(),t.length}remove(t,e=!0){if(r(t)){const e=this.keyProp;if(!e)return;t=this.findProp(e,t)}const i=this._items.indexOf(t);if(-1!==i)return this.removeAt(i,e)}removeAll(t,e=!0){const i=this.keyProp;let s=0;for(const e of t){let t;t=r(e)?this.indexOfProp(i,e):this._items.indexOf(e),-1!==t&&(this.removeAt(t,!1),s++)}return s>0&&(this._doItemsChanged(this._items),e&&this._optionChanged()),s}removeAt(t,e=!0){const i=this._items;if(t<0||t>=i.length)return;const s=i.splice(t,1)[0];return this.$_removed(s,t),this._doItemsChanged(this._items),e&&this._optionChanged(),s}clear(t=!0){return!!this.$_clearItems()&&(t&&this._optionChanged(),!0)}moveTo(t,e,i=!0){const s=this._items,r=s.indexOf(t);if(-1===r)return!1;const n=Math.max(0,Math.min(e,s.length-1));return n!==r&&(s.splice(r,1),s.splice(n,0,t),this._doItemMoved(t,r,n),this._doItemsChanged(this._items),i&&this._optionChanged(),!0)}replace(t,e,i=!1,s=!0){const r=this._items.indexOf(t);if(r>=0)this._items[r]=e,this.$_removed(t,r),this.$_inserted(e,r);else{if(!i)return!1;this._items.push(e),this.$_inserted(e,this._items.length-1)}return this._doItemsChanged(this._items),s&&this._optionChanged(),!0}_doItemInserted(t,e){}_doItemRemoved(t,e){}_doCleared(){}_doItemMoved(t,e,i){}_doItemsChanged(t){}$_insertItem(t,e,i){this._items.splice(e,0,t),this.$_inserted(t,e),this._doItemsChanged(this._items),i&&this._optionChanged()}saveOptions(t,s=!0,r=!1,n=!1){const o=this.keyProp;if(e(t)&&i(t.items)&&(t=t.items),i(t)){if(o){const i=[];for(const a of t){const t=this.$_findByKey(o,e(a)?a[o]:void 0);t&&i.push(this.$_saveItem(t,a,s,r,n,o))}return i}return this._items.map(((e,i)=>e.saveOptions(t[i],s,r,n)))}const a=e(t)?t:void 0;return this._items.map((t=>this.$_saveItem(t,a,s,r,n,o)))}$_saveItem(t,i,s,r,n,o){const a=t.saveOptions(i,s,r,n);return o&&e(a)&&void 0===a[o]&&(a[o]=t.getOption(o)),a}saveTo(t,e,i=!0,s=!1,r=!1){return this.saveOptions(e,i,s,r)}updateOptions(t,e=!0){const{items:s,updateMode:r}=this.$_split(t);"*"===r?.remove&&this.$_clearItems(),s&&this.$_reconcile(this._normalizeOptions(s),{addMissing:r?.addMissing??this.addMissingOnUpdate,removeMissing:r?.removeMissing??this.removeMissingOnUpdate,reorder:r?.reorder??this.reorderOnUpdate});const n=r?.remove;return i(n)&&n.length&&this.$_removeKeys(n),this._doItemsChanged(this._items),e&&this._optionChanged(),this}invertOptions(t){const{items:s,updateMode:r}=this.$_split(t),n=this.keyProp,o=r?.addMissing??this.addMissingOnUpdate,a=r?.removeMissing??this.removeMissingOnUpdate,h=r?.reorder??this.reorderOnUpdate,l=i(r?.remove)?r.remove:[],c=a||h||"*"===r?.remove||l.length>0;if(!n||c)return{items:this.saveOptions(),updateMode:{addMissing:!0,removeMissing:!0,reorder:!0,remove:"*"}};const d=[],_=[];for(const t of s??[]){const i=e(t)?t[n]:void 0;if(void 0===i)continue;const s=this.$_findByKey(n,i);s?d.push(this.$_saveItem(s,t,!0,!1,!0,n)):o&&_.push(i)}const u={};return _.length&&(u.remove=_),{items:d,updateMode:u}}_normalizeOptions(t){return t}_doLoad(t,e){this.$_replaceItems(this._normalizeOptions(e))}clearOptions(t=!1,e=!0){return this.$_clearItems(),super.clearOptions(t,e)}_resolveChild(t){const e=this._items,i=+t;return Number.isInteger(i)&&i>=0&&i<e.length?e[i]:super._resolveChild(t)}_doDispose(){this.$_clearItems(),super._doDispose()}$_newItem(t){const e=this._createItem(t);return e&&e.initAndLoad(t),e}$_inserted(t,e){if(this._map){const e=t.prop(this.keyProp);O(e)||this._map.set(e,t)}this._doItemInserted(t,e)}$_removed(t,e){if(this._map){const e=t.prop(this.keyProp);O(e)||this._map.delete(e)}this._doItemRemoved(t,e)}$_split(t){if(i(t))return{items:t,updateMode:void 0};if(e(t)){const s=t;return{items:i(s.items)?s.items:void 0,updateMode:e(s.updateMode)?s.updateMode:void 0}}return{items:void 0,updateMode:void 0}}$_replaceItems(t){if(this.$_clearItems(),t){const e=this._items;for(const i of t){const t=this.$_newItem(i);t&&(e.push(t),this.$_inserted(t,e.length-1))}this._doItemsChanged(e)}}$_reconcile(t,i){const{addMissing:s,removeMissing:r,reorder:n}=i,o=this._items,a=this.keyProp;if(a){if(r){const i=new Set;for(const s of t){const t=e(s)?s[a]:void 0;void 0!==t&&i.add(t)}for(let t=o.length-1;t>=0;t--)if(!i.has(o[t].getOption(a))){const e=o.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}for(const i of t){const t=this.$_findByKey(a,e(i)?i[a]:void 0);if(t)t.updateOptions(i,!1);else if(s){const t=this.$_newItem(i);t&&(o.push(t),this.$_inserted(t,o.length-1))}}n&&this.$_reorderByKey(t,a)}else{const e=t.length;if(r)for(;o.length>e;)o.splice(o.length-1,1)[0].dispose();for(let i=0;i<e;i++)if(i<o.length)o[i].updateOptions(t[i],!1);else if(s){const e=this.$_newItem(t[i]);e&&o.push(e)}}}$_reorderByKey(t,i){const s=new Set,r=[];for(const n of t){const t=this.$_findByKey(i,e(n)?n[i]:void 0);t&&!s.has(t)&&(s.add(t),r.push(t))}for(const t of this._items)s.has(t)||r.push(t);this._items=r,this._doItemsChanged(this._items)}$_findByKey(t,e){if(void 0!==e)for(const i of this._items)if(i.getOption(t)===e)return i}$_removeKeys(t){const e=this.keyProp,i=this._items;if(e){const s=new Set(t);for(let t=i.length-1;t>=0;t--)if(s.has(i[t].getOption(e))){const e=i.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}else{const e=Array.from(new Set(t.filter((t=>Number.isInteger(t)&&t>=0&&t<i.length)))).sort(((t,e)=>e-t));for(const t of e){const e=i.splice(t,1)[0];e.dispose(),this.$_removed(e,t)}}}$_clearItems(){const t=this._items;if(t.length){for(let e=t.length-1;e>=0;e--){const i=t.pop();i.dispose(),this.$_removed(i,e)}return this._doCleared(),this._doItemsChanged(t),!0}return!1}}).UPDATE_MODE={addMissing:!0,removeMissing:!1,reorder:!1};const Lt=class t extends gt{constructor(t){super(),this._cssWidth=0,this._cssHeight=0,this._dpr=1,this._canvas=t.createElement("canvas");const e=this._canvas.getContext("2d");if(!e)throw new Error("CanvasRenderer: 2d context not available.");this._ctx=e}static registerShape(e,i){t.SHAPES.set(e,i)}static unregisterShape(e){return t.SHAPES.delete(e)}static shapeNames(){return Array.from(t.SHAPES.keys())}static _builtinShapes(){const t=new Map;return t.set("circle",((t,e,i,s)=>{t.arc(e,i,s/2,0,2*Math.PI)})),t.set("square",((t,e,i,s)=>{const r=s/2;t.rect(e-r,i-r,s,s)})),t.set("diamond",((t,e,i,s)=>{const r=s/2;t.moveTo(e,i-r),t.lineTo(e+r,i),t.lineTo(e,i+r),t.lineTo(e-r,i),t.closePath()})),t.set("triangle",((t,e,i,s)=>{const r=s/2;t.moveTo(e,i-r),t.lineTo(e+r,i+r),t.lineTo(e-r,i+r),t.closePath()})),t.set("triangle-down",((t,e,i,s)=>{const r=s/2;t.moveTo(e,i+r),t.lineTo(e+r,i-r),t.lineTo(e-r,i-r),t.closePath()})),t.set("star",((t,e,i,s)=>{const r=s/2,n=.4*r,o=Math.PI/5;let a=-Math.PI/2;t.moveTo(e+r*Math.cos(a),i+r*Math.sin(a));for(let s=1;s<10;s++){a+=o;const h=1&s?n:r;t.lineTo(e+h*Math.cos(a),i+h*Math.sin(a))}t.closePath()})),t.set("plus",((t,e,i,s)=>{const r=s/2,n=s/6;t.moveTo(e-n,i-r),t.lineTo(e+n,i-r),t.lineTo(e+n,i-n),t.lineTo(e+r,i-n),t.lineTo(e+r,i+n),t.lineTo(e+n,i+n),t.lineTo(e+n,i+r),t.lineTo(e-n,i+r),t.lineTo(e-n,i+n),t.lineTo(e-r,i+n),t.lineTo(e-r,i-n),t.lineTo(e-n,i-n),t.closePath()})),t.set("cross",((t,e,i,s)=>{const r=s/2,n=s/6,o=Math.SQRT1_2,a=[[-n,-r],[n,-r],[n,-n],[r,-n],[r,n],[n,n],[n,r],[-n,r],[-n,n],[-r,n],[-r,-n],[-n,-n]];for(let s=0;s<a.length;s++){const r=a[s][0]*o-a[s][1]*o,n=a[s][0]*o+a[s][1]*o;0===s?t.moveTo(e+r,i+n):t.lineTo(e+r,i+n)}t.closePath()})),t.set("wye",((t,e,i,s)=>{const r=s/2,n=s/6/2,o=[];for(let t=0;t<3;t++){const e=-Math.PI/2+t*Math.PI*2/3,i=Math.cos(e),s=Math.sin(e),a=[i*r,s*r],h=[i*n-s*n,s*n+i*n],l=[i*n+s*n,s*n-i*n];o.push(h,a,l)}t.moveTo(e+o[0][0],i+o[0][1]);for(let s=1;s<o.length;s++)t.lineTo(e+o[s][0],i+o[s][1]);t.closePath()})),t}static _applyLine(t,e){t.strokeStyle=e?.color??"#000",t.lineWidth=e?.width??1,t.lineCap=e?.cap??"butt",t.lineJoin=e?.join??"miter",t.globalAlpha=e?.alpha??1,e?.dash?t.setLineDash(e.dash):t.setLineDash([])}static _applyFill(t,e){t.fillStyle=e?.color??"#000",t.globalAlpha=e?.alpha??1}static _applyText(t,e){t.fillStyle=e?.color??"#000",t.font=e?.font??"12px sans-serif",t.textAlign=e?.align??"start",t.textBaseline=e?.baseline??"alphabetic",t.globalAlpha=e?.alpha??1}static _roundRectPath(t,e,i,s,r,n){const o=Math.min(s,r)/2;let a,h,l,c;Array.isArray(n)?(a=Math.min(o,Math.max(0,n[0]??0)),h=Math.min(o,Math.max(0,n[1]??a)),l=Math.min(o,Math.max(0,n[2]??a)),c=Math.min(o,Math.max(0,n[3]??h))):a=h=l=c=Math.min(o,Math.max(0,n));const d=t;a!==h||h!==l||l!==c||"function"!=typeof d.roundRect?(t.moveTo(e+a,i),t.lineTo(e+s-h,i),h>0&&t.arcTo(e+s,i,e+s,i+h,h),t.lineTo(e+s,i+r-l),l>0&&t.arcTo(e+s,i+r,e+s-l,i+r,l),t.lineTo(e+c,i+r),c>0&&t.arcTo(e,i+r,e,i+r-c,c),t.lineTo(e,i+a),a>0&&t.arcTo(e,i,e+a,i,a),t.closePath()):d.roundRect(e,i,s,r,a)}static _splinePath(t,e,i,s=!1){const r=e.length;if(r<2)return;if(s||t.moveTo(e[0][0],e[0][1]),2===r)return void t.lineTo(e[1][0],e[1][1]);const n=i/6;for(let i=0;i<r-1;i++){const s=e[i-1]??e[i],r=e[i],o=e[i+1],a=e[i+2]??o,h=r[0]+(o[0]-s[0])*n,l=r[1]+(o[1]-s[1])*n,c=o[0]-(a[0]-r[0])*n,d=o[1]-(a[1]-r[1])*n;t.bezierCurveTo(h,l,c,d,o[0],o[1])}}_doDispose(){}get canvas(){return this._canvas}get context(){return this._ctx}get width(){return this._cssWidth}get height(){return this._cssHeight}get pixelRatio(){return this._dpr}attatch(t){return t.appendChild(this._canvas),this}detach(){const t=this._canvas.parentElement;return t&&t.removeChild(this._canvas),this}prepare(t,e,i=!0){const s=this._canvas.parentElement,r=Math.max(0,Math.floor(A(t,s&&s.clientWidth))),n=Math.max(0,Math.floor(A(e,s&&s.clientHeight)));return this._cssWidth===r&&this._cssHeight===n&&this._dpr===L||(this._canvas.width=Math.round(r*L),this._canvas.height=Math.round(n*L),this._canvas.style.width=r+"px",this._canvas.style.height=n+"px",this._cssWidth=r,this._cssHeight=n,this._dpr=L),this._ctx.setTransform(L,0,0,L,0,0),i&&this._ctx.clearRect(0,0,r,n),this}clear(){return this._ctx.clearRect(0,0,this._cssWidth,this._cssHeight),this}save(){return this._ctx.save(),this}restore(){return this._ctx.restore(),this}translate(t,e){return this._ctx.translate(t,e),this}rotate(t){return this._ctx.rotate(t),this}scale(t,e=t){return this._ctx.scale(t,e),this}clip(t,e,i,s){const r=this._ctx;return r.beginPath(),r.rect(t,e,i,s),r.clip(),this}resolveStroke(t,e,i,s,r){if(null==t)return;if("string"==typeof t)return{color:t};if(!Array.isArray(t))return t;if(0===t.length)return;if(1===t.length)return{color:t[0]};const n=t.length-1,o=t.map(((t,e)=>({offset:e/n,color:t})));return{color:this.createLinearGradient(e,i,s,r,o)}}resolveFill(t,e,i,s,r){if(null==t)return;if("string"==typeof t)return{color:t};if(!Array.isArray(t))return t;if(0===t.length)return;if(1===t.length)return{color:t[0]};const n=t.length-1,o=t.map(((t,e)=>({offset:e/n,color:t})));return{color:this.createLinearGradient(e,i,s,r,o)}}line(e,i,s,r,n){const o=this._ctx;return o.save(),t._applyLine(o,n),o.beginPath(),o.moveTo(e,i),o.lineTo(s,r),o.stroke(),o.restore(),this}hline(e,i,s,r){const n=this._ctx,o=1===(r?.width??1)?Math.floor(i)+.5:i;return n.save(),t._applyLine(n,r),n.beginPath(),n.moveTo(e,o),n.lineTo(e+s,o),n.stroke(),n.restore(),this}vline(e,i,s,r){const n=this._ctx,o=1===(r?.width??1)?Math.floor(e)+.5:e;return n.save(),t._applyLine(n,r),n.beginPath(),n.moveTo(o,i),n.lineTo(o,i+s),n.stroke(),n.restore(),this}polyline(e,i){if(e&&e.length>1){const s=this._ctx;s.save(),t._applyLine(s,i),s.beginPath(),s.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)s.lineTo(e[t][0],e[t][1]);s.stroke(),s.restore()}return this}spline(e,i,s=1){if(e&&e.length>1){const r=this._ctx;r.save(),t._applyLine(r,i),r.beginPath(),t._splinePath(r,e,s),r.stroke(),r.restore()}return this}polygon(e,i,s){if(e&&e.length>2){const r=this._ctx;r.save(),r.beginPath(),r.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)r.lineTo(e[t][0],e[t][1]);r.closePath(),i&&(t._applyFill(r,i),r.fill()),s&&(t._applyLine(r,s),r.stroke()),r.restore()}return this}rect(e,i,s,r,n,o){const a=this._ctx;if(a.save(),n&&(t._applyFill(a,n),a.fillRect(e,i,s,r)),o){const n=1===(o.width??1)?.5:0;t._applyLine(a,o),a.strokeRect(Math.floor(e)+n,Math.floor(i)+n,s,r)}return a.restore(),this}roundRect(e,i,s,r,n,o,a){if(s>0&&r>0){const h=this._ctx;h.save(),h.beginPath(),t._roundRectPath(h,e,i,s,r,n),o&&(t._applyFill(h,o),h.fill()),a&&(t._applyLine(h,a),h.stroke()),h.restore()}return this}circle(e,i,s,r,n){if(s>0){const o=this._ctx;o.save(),o.beginPath(),o.arc(e,i,s,0,2*Math.PI),r&&(t._applyFill(o,r),o.fill()),n&&(t._applyLine(o,n),o.stroke()),o.restore()}return this}arc(e,i,s,r,n,o,a=!1){if(s>0){const h=this._ctx;h.save(),t._applyLine(h,o),h.beginPath(),h.arc(e,i,s,r,n,a),h.stroke(),h.restore()}return this}pie(e,i,s,r,n,o,a,h=!1){if(s>0){const l=this._ctx;l.save(),l.beginPath(),l.moveTo(e,i),l.arc(e,i,s,r,n,h),l.closePath(),o&&(t._applyFill(l,o),l.fill()),a&&(t._applyLine(l,a),l.stroke()),l.restore()}return this}ring(e,i,s,r,n,o,a,h){if(r>0&&s>=0&&s<r){const l=this._ctx;l.save(),l.beginPath(),l.arc(e,i,r,n,o,!1),l.arc(e,i,s,o,n,!0),l.closePath(),a&&(t._applyFill(l,a),l.fill()),h&&(t._applyLine(l,h),l.stroke()),l.restore()}return this}shape(e,i,s,r,n,o){if(r>0){const a=t.SHAPES.get(e);if(!a){const e=this._ctx;e.save(),e.beginPath(),a(e,i,s,r),n&&(t._applyFill(e,n),e.fill()),o&&(t._applyLine(e,o),e.stroke()),e.restore()}}return this}bar(e,i,s,r,n,o){const a=this._ctx,h=Math.round(e),l=Math.round(i),c=Math.max(1,Math.round(s)),d=Math.max(1,Math.round(r));if(a.save(),n&&(t._applyFill(a,n),a.fillRect(h,l,c,d)),o){const e=o.width??1,i=1===e?.5:0,s=1===e?1:0;t._applyLine(a,o),a.strokeRect(h+i,l+i,c-s,d-s)}return a.restore(),this}area(e,i,s,r){if(e&&e.length>1){const n=this._ctx;n.save(),n.beginPath(),n.moveTo(e[0][0],i);for(let t=0;t<e.length;t++)n.lineTo(e[t][0],e[t][1]);if(n.lineTo(e[e.length-1][0],i),n.closePath(),s&&(t._applyFill(n,s),n.fill()),r){n.beginPath(),n.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)n.lineTo(e[t][0],e[t][1]);t._applyLine(n,r),n.stroke()}n.restore()}return this}splineArea(e,i,s,r,n=1){if(e&&e.length>1){const o=this._ctx;o.save(),o.beginPath(),o.moveTo(e[0][0],i),o.lineTo(e[0][0],e[0][1]),t._splinePath(o,e,n,!0),o.lineTo(e[e.length-1][0],i),o.closePath(),s&&(t._applyFill(o,s),o.fill()),r&&(o.beginPath(),t._splinePath(o,e,n),t._applyLine(o,r),o.stroke()),o.restore()}return this}text(e,i,s,r){if(null!=e&&""!==e){const n=this._ctx;n.save(),t._applyText(n,r),n.fillText(e,i,s),n.restore()}return this}measureText(t,e){const i=this._ctx;i.save(),e&&(i.font=e);const s=i.measureText(t);return i.restore(),s}drawImage(t,e,i,s,r,n,o,a,h){const l=this._ctx;return void 0!==n&&void 0!==o&&void 0!==a&&void 0!==h&&void 0!==s&&void 0!==r?l.drawImage(t,n,o,a,h,e,i,s,r):void 0!==s&&void 0!==r?l.drawImage(t,e,i,s,r):l.drawImage(t,e,i),this}createLinearGradient(t,e,i,s,r){const n=this._ctx.createLinearGradient(t,e,i,s);for(const t of r)n.addColorStop(t.offset,t.color);return n}createRadialGradient(t,e,i,s,r,n,o){const a=this._ctx.createRadialGradient(t,e,i,s,r,n);for(const t of o)a.addColorStop(t.offset,t.color);return a}verticalGradient(t,e,i){return this.createLinearGradient(0,t,0,e,i)}horizontalGradient(t,e,i){return this.createLinearGradient(t,0,e,0,i)}blit(t,e,i,s,r){return this._cssWidth>0&&this._cssHeight>0&&t.drawImage(this._canvas,0,0,this._canvas.width,this._canvas.height,e,i,s??this._cssWidth,r??this._cssHeight),this}};Lt.SHAPES=Lt._builtinShapes();const At="http://www.w3.org/2000/svg";class kt{static async loadConfigAsync(t,n=!1){if(t&&!t.map&&console.warn("지도 설정이 비어 있습니다. map 옵션을 지정하세요."),t&&t.map){if(r(t.map))t.map={url:t.map};else if(i(t.map))for(let e=0;e<t.map.length;e++)r(t.map[e])&&(t.map[e]={url:t.map[e]});const s=i(t.map)?t.map:[t.map];for(const t of s){if(i(t.areas))for(let e=0;e<t.areas.length;e++)if(r(t.areas[e])){if(n){console.warn("원격 areas 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.areas[e]);continue}t.areas[e]=await this.fetchJson(t.areas[e])}const s=e(t.source),o=t.url&&r(t.url);s||o?s||(o&&n?console.warn("원격 맵 소스를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.url):t.source=await this.fetchJson(t.url)):console.warn("지도 소스가 지정되지 않았습니다. source 옵션을 사용하거나 url옵션을 지정하세요. 만약 url 옵션을 사용한다면, 반드시 RealMap.createChartAsync()로 생성해야 합니다.")}}if(t&&t.series){const o=i(t.series)?t.series:[t.series];for(const t of o)if(!e(t.data)&&!i(t.data)&&t.dataUrl&&r(t.dataUrl))if(n)console.warn("원격 시리즈 데이터를 사용하기 위해서는 RealMap.createChartAsync()로 생성해야 합니다: "+t.dataUrl);else{const e=await this.fetchJson(t.dataUrl);delete t.dataUrl,i(e)&&s(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 It=void 0;function Et(t){return parseFloat(t.toPrecision(12))}const Tt={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},Nt=function(t){const e=Tt[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Tt[t]=e,e}return e};var $t;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}($t||($t={}));const Vt={inOutSine:t=>-(c(m*t)-1)/2};class Rt{constructor(){this.delay=0,this.duration=Rt.DURATION,this.easing="inOutSine",this._handler=()=>{const t=+new Date-this._started-this.delay;let e=_(1,u(0,Et(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=A(t,Rt.DURATION),this.delay=e||0,this._easing=Vt[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}}Rt.DURATION=700,Rt.SHORT_DURATION=300;const Dt={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",nameKeys:["name"],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",nameKeys:["en-name","name-en","name"],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 Ot="ko",Bt=Dt[Ot];const Ft=t=>r(t)?t.substring(0,2):t,zt=t=>{var e;return null!==(e=Dt[Ft(t)])&&void 0!==e?e:Dt.ko},jt=t=>"en"===Ft(t);class Gt extends gt{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 Ht{static create(t,e,i,s){return isNaN(i)?isNaN(e)?new Ht(t,t,t,t):new Ht(t,t,e,e):new Ht(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 Ht(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=A(t.paddingLeft,0),this.right=A(t.paddingRight,0),this.top=A(t.paddingTop,0),this.bottom=A(t.paddingBottom,0),this}applyMargin(t){return this.left=A(t.marginLeft,0),this.right=A(t.marginRight,0),this.top=A(t.marginTop,0),this.bottom=A(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 Wt;Ht.Empty=Object.freeze(new Ht),Ht.Temp=new Ht,function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(Wt||(Wt={}));const Yt={name:"RealMap",version:"1.1.20",license:"enterprise",code:""},Zt={name:"RealMap",version:"1.1.20",license:"enterprise",code:null};class Ut{static decode(t){const e=Ut.CHARS,i=Ut.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}}Ut.PAD="=",Ut.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=Ut.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 Kt{static eqaulsUpperDomain(t,e){return t==e||0===t.indexOf("*")&&(t=t.substring(1),e.substring(e.indexOf(t))==t)}static _getLDKey(t){let e="";for(let 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}}const qt=new Map;function Jt(t){return"string"==typeof t?t:t&&"string"==typeof t.id?t.id:""}const Qt=function(t){const e=location.hostname;let i;const s="RealMap을 사용하려면 도움말을 참조하세요.\nhttps://realmap.co.kr/";try{if(i=Zt.code||realMapLic,!i)throw new Error(s)}catch(t){throw new Error(s)}const r=Kt.decrypt(i);if(!function(t,e){if("RealMap"===t)return!0;const i=Jt(e),s=qt.get(t);return!!s&&s.has(i)}(r.name,t)||"RealMap"!==Yt.name)throw new Error(s);try{const t=r.server.toLowerCase(),i=location.pathname.toLowerCase();if(Yt.license!=Wt.Developer&&!Kt.includedDomains(t,e.toLowerCase(),i))throw new Error(s);const n=r.lic.toLowerCase();if(!Object.values(Wt).includes(n))throw new Error(s);if(Yt.code=r.code,Yt.license=r.lic,n==Wt.Evaluation||n==Wt.Limited){const t=r.expire.split(".").map((function(t){return parseInt(t)})),e=new Date(t[0],t[1],t[2],23,59,59,999);if(new Date>e)throw new Error(s)}}catch(t){throw new Error(s)}return!0},te={background:"fill",border:"stroke",borderWidth:"strokeWidth",borderRadius:"borderRadius"};class ee extends gt{constructor(t,e,i){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._scrolling=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{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.$_updateBlockDrag(t),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._touchCancelHandler=t=>{var e;null===(e=this._tool)||void 0===e||e.touchCancel(t),this._blockDrag=!0},this._pointerDownHandler=t=>{var e;this.$_updateBlockDrag(t),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._blockDrag=!0},this._pointerCancelHandler=t=>{var e;this._doPointerCancel(t),null===(e=this._tool)||void 0===e||e.pointerCancel(t),this._blockDrag=!0},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))},Qt(e),!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,i||ee.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._registerEventHandlers(this._dom),this._inited=!0,this._blockDrag=!0,this.invalidate(!0)}_doDispose(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),ft.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}setData(t,e,i){const s="data-"+t;B(e)?(this._root.dom.hasAttribute(s)&&this._root.dom.removeAttribute(s),i&&this._dom.hasAttribute(s)&&this._dom.removeAttribute(s)):(this._root.dom.getAttribute(s)!==e&&this._root.dom.setAttribute(s,e),i&&this._dom.getAttribute(s)!==e&&this._dom.setAttribute(s,e))}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)}isLoading(){return!1}isDraggable(){return!this._blockDrag}clearDefs(){const t=Array.from(this._defs.children).filter((t=>"true"===t.dataset.essential));for(const e of t)this._defs.removeChild(e);ft.clear(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)}}setResizeDelay(t){this._resizeDelay=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(r(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 ce(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,ie.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,"touchcancel",this._touchCancelHandler),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler),this.$_addListener(this.doc(),"pointermove",this._pointerMoveHandler),this.$_addListener(this.doc(),"pointerup",this._pointerUpHandler)}_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("touchcancel",this._touchCancelHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler),this.doc().removeEventListener("pointermove",this._pointerMoveHandler),this.doc().removeEventListener("pointerup",this._pointerUpHandler)}_prepareRenderers(t){}_initControl(t,e,i){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||G(Bt.invalidOuterDiv,e);const s=this._container.ownerDocument,r=this._dom=s.createElement("div");Object.assign(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)",touchAction:"manipulation"}),r.className=i,this._container.appendChild(r);const n=this._svg=s.createElementNS(At,"svg");n.classList.add("rm-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const o=s.createElement("desc");o.textContent="Created with RealMap 1.0.0",n.appendChild(o);const a=this._defs=s.createElementNS(At,"defs");this._initDefs(s,a),n.appendChild(a),r.appendChild(n),this._root=new re(this),n.appendChild(this._root._dom),this._htmlRoot=s.createElement("div"),r.appendChild(this._htmlRoot),Object.assign(this._htmlRoot.style,{position:"absolute"}),this._debugger=s.createElement("div"),r.appendChild(this._debugger),Object.assign(this._debugger.style,{position:"absolute",left:"0px",top:"0px",fontSize:"20px",background:"black",color:"white"}),this._defaultTool=this._tool=this._creatDefaultTool()}_initDefs(t,e){let i=t.createElementNS(At,"filter");i.dataset.essential="true";const s=t.createElementNS(At,"feDropShadow");i.setAttribute("id",ee.SHADOW_FILTER),s.setAttribute("dx","0"),s.setAttribute("dy","4"),s.setAttribute("flood-color","#000"),s.setAttribute("flood-opacity","0.4"),s.setAttribute("stdDeviation","2"),i.appendChild(s),e.appendChild(i)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(this.orphaned)return;const t=+new Date;if(t<=this._toAnimation)this.$_requestRender();else{try{this._doBeforeRender(this._root);const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),i=this._padding=ft.getPadding(this._root.dom),s=i.left,r=i.top,n=this._svg.clientWidth-s-i.right,o=this._svg.clientHeight-r-i.bottom;if(n>0&&o>0){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 i=this._debugger;if(i.textContent){i.style.display="";const t=i.getBoundingClientRect();i.style.left=s+(n-t.width)/2+"px",i.style.top=r+(o-t.height)/2+"px"}else i.style.display="none"}}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),this._updateTouchAction()}et.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(){}_updateTouchAction(){}_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){return!0}_domResized(){const t=this.width(),e=this.height(),i=this._resizeDelay;t===this._wSave&&e===this._hSave||(this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),i>0?this._resizeTimer=setTimeout((()=>{this.invalidateLayout(),this._resizeTimer=null}),i):this.invalidateLayout())}$_updateBlockDrag(t){const e=t.target&&!0===this.dom().contains(t.target);this._blockDrag=!e}}ee.CLASS_NAME="rm-control",ee.SHADOW_FILTER="rm-shadow-filter",ee._animatable=!0;class ie extends gt{static createElement(t,e){return t.createElementNS(At,e)}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(t,e,i=It){super(),this._visible=!0,this._zIndex=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(At,i||"g"),(this._styleName=e)&&this.setAttr("class",e),this._doInitStyles()}_doInitStyles(){}_doDispose(){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(t,e){const i=t.createElementNS(At,e);return this._dom.appendChild(i),i}insertElement(t,e,i){const s=t.createElementNS(At,e);return this._dom.insertBefore(s,i),s}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 ut.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=et.isValidNum(t)?t:this._tx,e=et.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=et.isValidNum(t)?t:this._tx,e=et.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&&et.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&et.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(){let t=this._dom.getAttribute("style"),e=this._dom.getAttribute("class");t||(t=""),e||(e=""),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(Nt(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let i in this._styles)t.removeProperty(Nt(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(r(t))t&&this._dom.classList.add(t);else if(e(t)){const e=this.dom.style;for(let i in t)e.setProperty(Nt(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){r(t)?(this._resetClass(),this._dom.classList.add(t)):this.resetStyles(t)}internalSetStyleOrClass(t){r(t)?this._dom.classList.add(t):this.internalSetStyles(t)}internalResetStyleOrClass(t){this._resetClass(),this.internalClearStyles(),r(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 te&&this._styles[s]!==t[s]){if("borderRadius"===s)this._setBackgroundBorderRadius(A(parseFloat(t[s]),0)),this._styles[s]=t[s];else if(s in te){const i=te[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 te&&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]=I(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 de(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(){}onRotationStart(){}onRotationEnd(){}_testing(){return ie.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){const t=this._dom;let e=this._tx,i=this._ty,s=[];(et.isValidNum(e)||et.isValidNum(i))&&(e=e||0,i=i||0,s=["translate("+e+","+i+")"]),et.isNotEmpty(this._matrix)&&s.push("matrix("+this._matrix.join(",")+")"),this._rotation&&s.push("rotate("+this._rotation+" "+et.pick(this._originX,t.getAttribute("x"),0)+" "+et.pick(this._originY,t.getAttribute("y")||0)+")");const r=et.getNum(this._scaleX,1),n=et.getNum(this._scaleY,1);1===r&&1===n||s.push("scale("+r+" "+n+")"),s.length&&this._dom.setAttribute("transform",s.join(" "))}}ie.TESTING=!1,ie.DEBUGGING=!1,ie.ASSET_KEY="_asset_",ie.TEMP_KEY="_temp_";class se extends ie{constructor(t,e=void 0){super(t,e,"g")}}class re extends ie{constructor(t){super(t.doc(),"rm-root"),this._control=t}get control(){return this._control}}class ne extends ie{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 oe extends ie{constructor(t,e=void 0,i=void 0){super(t,e,"path"),i&&this.setPath(i)}path(){return this._path}setPath(t){const e=r(t)?t:null==t?void 0:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class ae extends ie{constructor(t,e,i=!1){super(t,e,i?"g":"path"),this.group=i}path(){return this._path}setPath(t){const e=r(t)?t:t.join(" ");return e!==this._path&&this.setAttr("d",this._path=e),this}}class he extends ie{constructor(t){super(t,It,"mask");const e=this._id=et.uniqueKey();this.setAttr("id",e)}get id(){return this._id}}class le extends ie{constructor(t){super(t,It,"clipPath");const e=this._id=et.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class ce extends le{constructor(t,e=NaN,i=NaN,s=NaN,r=NaN,n=0,o=0){super(t);const a=this._rect=new ie(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 de extends le{constructor(t,e){super(t),this._path=new oe(t),this.add(this._path),e&&this.setPath(e)}get path(){return this._path}setPath(t){return this._path.setPath(t),this}}var _e;!function(t){t.SIDO="sido"}(_e||(_e={}));const ue="shuffle",pe="random";var ge;class me{constructor(t){this.source=t}hasDef(){return!0}}class fe extends me{getElement(t,e){throw new Error("Method not implemented.")}}fe.TYPE="shape";class be extends me{getElement(t,e){throw new Error("Method not implemented.")}}be.TYPE="image";class ye extends me{_setStops(t,e){const s=t.createElementNS(At,"stop"),r=t.createElementNS(At,"stop"),n=this.source.color,o=O(this.source.opacity)?1:this.source.opacity,a=i(n)?n[0]:n,h=i(n)&&n.length>1?n[1]:"white",l=i(o)?o[0]:o,c=i(o)&&o.length>1?o[1]:o;e.setAttribute("id",this.source.id),s.setAttribute("offset","0"),s.setAttribute("stop-color",a),s.setAttribute("stop-opacity",l),r.setAttribute("offset","1"),r.setAttribute("stop-color",h),r.setAttribute("stop-opacity",c),e.appendChild(s),e.appendChild(r)}}class we extends ye{getElement(t,e){const i=t.createElementNS(At,"linearGradient");let{x1:s,x2:r,y1:n,y2:o}={x1:0,x2:0,y1:0,y2:0};switch(this._setStops(t,i),e.dir){case"up":n=1;break;case"right":r=1;break;case"left":s=1;break;default:o=1}return i.setAttribute("x1",s),i.setAttribute("y1",n),i.setAttribute("x2",r),i.setAttribute("y2",o),i}}we.TYPE="lineargradient";class xe extends ye{getElement(t,e){const i=t.createElementNS(At,"radialGradient");return O(e.cx)||i.setAttribute("cx",e.cx),O(e.cy)||i.setAttribute("cy",e.cy),O(e.r)||i.setAttribute("r",e.r),this._setStops(t,i),i}}xe.TYPE="radialgradient";class ve extends me{getElement(t,i){const s=t.createElementNS(At,"pattern"),n=t.createElementNS(At,"path");let o,h,l,c,d=!1;if(s.setAttribute("id",i.id),s.setAttribute("patternUnits","userSpaceOnUse"),n.classList.add("rm-pattern"),+i.pattern>=0){const t=ge.STOCK[+i.pattern%ge.STOCK.length];o=t.path,h=t.style,d=!t.fill,l=t.width||20,c=t.height||20}else r(i.pattern)&&(o=i.pattern,l=i.width||i.height||20,c=i.height||i.width||20);s.setAttribute("width",String(l)),s.setAttribute("height",String(c)),n.setAttribute("d",o),h&&a(n.style,h),i.style&&a(n.style,i.style),d&&(n.style.fill="none");let _=i.backgroundStyle;if(r(_)||e(_)){const e=t.createElementNS(At,"rect");s.append(e),e.style.fill=r(_)?_:_.fill,e.setAttribute("width",String(l)),e.setAttribute("height",String(c))}return i.transform&&s.setAttribute("patternTransform",i.transform),s.append(n),s}}ge=ve,ve.TYPE="pattern",ve.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}],ve.SELECT=Object.assign(ge.STOCK[4],{id:"rm-selected-area-fill",pattern:ge.STOCK[4].path,transform:"scale(0.5)"});class Se extends me{prepare(){const t=this.source;return this._colors=i(t.colors)?t.colors.slice():[],t.mode===pe?this._index=-1:(t.mode===ue&&et.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=i(e.colors)?e.colors:[]}}Se.TYPE="colors";class Ce extends me{prepare(){const t=this.source.rootUrl||"";this._images=[],this._map={},this.source.images.forEach((e=>{if(r(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 r(t)?this._map[t]:this._images[t]}hasDef(){return!1}getElement(t,e){this.size=Object.freeze({width:e.width||e.height||Ce.SIZE,height:e.height||e.width||Ce.SIZE})}}Ce.TYPE="images",Ce.SIZE=20;class Pe{constructor(){this._items=[],this._map={}}load(t){if(this._items=[],i(t))return t.forEach((t=>{const e=this.$_loadItem(t);e&&(e.hasDef()?this._items.push(e):this._map[t.id]=e)})),this._items.map((t=>t.source));if(e(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 ve(ve.SELECT);const i=this._selectedFill.getElement(t,this._selectedFill.source);i.setAttribute(ie.ASSET_KEY,"1"),e.addDef(i),this._items.forEach((i=>{const s=i.getElement(t,i.source);s.setAttribute(ie.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(et.isObject(t)&&t.id){let e=t.type;if(e||(null!=t.pattern?e=ve.TYPE:i(t.colors)?e=Se.TYPE:i(t.images)?e=Ce.TYPE:null!=t.url?e=be.TYPE:null!=t.path&&(e=fe.TYPE)),e)switch(e.toLowerCase()){case fe.TYPE:return new fe(t);case be.TYPE:return new be(t);case we.TYPE:return new we(t);case xe.TYPE:return new xe(t);case ve.TYPE:return new ve(t);case Se.TYPE:return new Se(t);case Ce.TYPE:return new Ce(t)}}}}const Me="0".charCodeAt(0),Le="#".charCodeAt(0),Ae=",".charCodeAt(0),ke="s".charCodeAt(0),Ie="a".charCodeAt(0),Ee=".".charCodeAt(0);class Te{static getFormatter(t){let e=Te.Formatters[t];return e||(Te.Formatters[t]=e=new Te(t)),e}static get Default(){return Te.getFormatter(Te.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){for(let i=0;i<e;i++){const e=t.charCodeAt(i);e!==Me&&e!==Le&&e!==Ee&&e!==Ae&&e!==ke&&e!==Ie&&G(`Invalid number format: ${t}`,t)}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)===Me;)i.minimumFractionDigits++,r++;for(i.maximumFractionDigits=i.minimumFractionDigits;r<e&&t.charCodeAt(r)===Le;)i.maximumFractionDigits++,r++;s-=1}else s=e-1;let r=s;for(;r>=0&&t.charCodeAt(r)===Me;)i.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===Ae){i.useGrouping=!0;break}}for(r=s;r>=0;){if(t.charCodeAt(r--)===ke){i.signDisplay="always";break}}if(!i.signDisplay)for(r=s;r>=0;){if(t.charCodeAt(r--)===Ie){i.signDisplay="never";break}}return i.minimumIntegerDigits=Math.max(1,i.minimumIntegerDigits),i}}}Te.DEFAULT_FORMAT="",Te.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"],$e=[".","/","-",":"],Ve="Z".charCodeAt(0),Re="z".charCodeAt(0),De="A".charCodeAt(0),Oe="a".charCodeAt(0),Be="y".charCodeAt(0),Fe="M".charCodeAt(0),ze="m".charCodeAt(0),je="W".charCodeAt(0),Ge="w".charCodeAt(0),He="d".charCodeAt(0),We="H".charCodeAt(0),Ye="h".charCodeAt(0),Ze="S".charCodeAt(0),Ue="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(Bt.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||Bt.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 Be:s+=a>2?t.getFullYear():F(t.getFullYear()%100);break;case Fe:s+=a>1?F(t.getMonth()+1):t.getMonth()+1;break;case He:s+=a>1?F(t.getDate()):t.getDate();break;case je:s+=a>1?F(et.weekOfYear(t,e)+1):et.weekOfMonth(t,e,!0)+1;break;case Ge:s+=a>1?et.long_week_days[t.getDay()]:et.week_days[t.getDay()];break;case We:s+=a>1?F(t.getHours()):t.getHours();break;case Ye: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 ze:s+=a>1?F(t.getMinutes()):t.getMinutes();break;case Ue:s+=a>1?F(t.getSeconds()):t.getSeconds();break;case Oe:case De:t.getHours()<12?s+=Bt.am:s+=Bt.pm;break;case Ze:let i=t.getMilliseconds();s+=3==a?z(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($e.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>=De&&e<=Ve||e>=Oe&&e<=Re)&&G(Bt.invalidDateFormat,t)}e.push(n)}if(r<s&&et.isWhiteSpace(n=i.charAt(r)))for(e.push(n);r<s&&et.isWhiteSpace(i.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||Bt.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}var Ke,qe,Je;Xe.Formatters={},function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(Ke||(Ke={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(qe||(qe={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(Je||(Je={}));class Qe extends ie{constructor(t,e=It){super(t,e,"text"),this._layout=qe.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 qe.MIDDLE:s=Math.floor(i/2);break;case qe.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(nt.isBright(getComputedStyle(t).fill)?e:i),this}setStyle(t,e){let i=!1;return t in te||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 ti="$_TH",ei="$_TW";class ii{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)try{const t=i[r+3]?Te.getFormatter(i[r+3]):e.numberFormatter;t&&(n=t.toStr(n))}catch(t){console.warn(`Failed to apply number format "${i[r+3]}" to ${n}:`,t)}else if(n instanceof Date)try{const t=i[r+3]?Xe.getFormatter(i[r+3]):e.timeFormatter;t&&(n=t.toStr(n,e.startOfWeek||0))}catch(t){console.warn(`Failed to apply date format "${i[r+3]}" to ${n}:`,t)}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),It);const e=this._literals.length-2;0===this._literals[e].length&&(this._literals[e]=It)}else this._literals.push(r,n,It,It);e=s+1}return 0==this._literals.length&&(this._literals=null),this}}class si extends ii{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 ri extends si{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 ni={t:class extends si{tag(){return"</t>"}},b:class extends si{tag(){return"</b>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-bold")}},i:class extends si{tag(){return"</i>"}_doPrepare(t,e,i,s){super._doPrepare(t,e,i,s),t.setAttribute("class","rm-text-italic")}},a:ri};class oi{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 ii).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 ni){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 ni[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 ai=/<br.*?>|\r\n|\n/;class hi{constructor(t){this.setFormat(t)}setFormat(t){t!==this._format&&this.$_parse(this._format=null!=t?String(t):t)}lines(){return this._lines.slice()}build(t,e,i,s,r,n=!0){const o=t.doc,a=A(this.lineHeight,1),h=this._lines,l=h.length,c=[],d=[];t.clearDom(),s=s||t;const _=t.getStyle("writing-mode"),p=_===X||_===K;for(let e=0;e<l;e++){const i=h[e];let _=0,g=0,m=null;for(let[a,h]of i.words.entries()){const c=0===e&&0===a,d=e===l-1&&a===i.words.length-1,f=h.prepareSpan(t.appendElement(o,"tspan"),s,r);if(s instanceof Mt){const t=c&&n&&s.prop("prefix")||"",e=d&&n&&s.prop("suffix")||"";f.textContent=t+(f.textContent||"")+e}const b=f.getBBox();if(f[ei]=b.width,f[ti]=b.height,p?(_=u(_,f[ei]),g+=f[ti]):(_+=f[ei],g=u(g,f[ti])),m||(m=f),h instanceof ri){const e=o.createElementNS(At,"a");e.setAttribute("href",h.url),e.setAttribute("target",h.target),e.appendChild(f),t.appendDom(e)}}d.push(m),i[ti]=g*a,i[ei]=_*a,c.push(0==e?i[ei]/2:i[ei])}if(l>0){let e=h[0];for(let i=1;i<d.length;i++)if(d[i]){let s=0,r=0;if(p?null!=d[i-1]&&(s=Math.floor(e[ei]-t.getAscent(e[ei]))+t.getAscent(h[i][ei])):r=e[ti]-t.getAscent(e[ti])+t.getAscent(h[i][ti]),null==d[0]&&d[i]==d.find((t=>null!=t))){const r=t.insertElement(o,"tspan",d[i]);r.textContent=".",r.style.fill="transparent";const n=r.getBBox();s+=n.width,r[ei]=n.width,r[ti]=e[ti]=n.height,d[0]=r}switch(_){case X:d[i].setAttribute("dx",String(s)),d[i].setAttribute("y","0");break;case K:d[i].setAttribute("dx",String(-s)),d[i].setAttribute("y","0");break;default:d[i].setAttribute("x","0"),d[i].setAttribute("dy",String(r))}e=h[i]}if(p){const e=t.parent.dom.classList.contains("rm-annotation"),i=t.bbox().width,[s]=d,r=s[ei];if(e)s.setAttribute("dx",String(_===K?i-r/2:r/2));else switch(_){case X:s.setAttribute("x",String((i-r)/-2));break;case K:s.setAttribute("x",String((i-r)/2))}}else t.layoutText(h[0][ti])}}layout(t,e,i,s,r){const n=t.bbox();let o=0,a=0;const h=t.getStyle("writing-mode");if(h===X||h===K)switch(o=r.left+(i-r.left-r.right-n.width),e){case"center":t.anchor=Ke.MIDDLE,a=r.top+(s-r.top-r.bottom)/2;break;case"right":t.anchor=Ke.END,a=n.height-r.bottom;break;default:t.anchor=Ke.START,a=r.top}else switch(a=r.top+(s-r.top-r.bottom-n.height)/2,e){case"center":t.anchor=Ke.MIDDLE,o=r.left+(i-r.left-r.right)/2;break;case"right":t.anchor=Ke.END,o=i-r.right;break;default:t.anchor=Ke.START,o=r.left}t.trans(o,a)}$_parse(t){const e=this._lines=[];if(t){const i=t.split(ai);for(let t of i)e.push((new oi).parse(t))}}}let li=0;const ci=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},di=["__proto__","constructor","prototype"],_i=function(s,r){const n=e(s)?s:{};for(const s in r)if(t.call(r,s)&&!di.includes(s)){let t=r[s];i(t)?n[s]=t.slice(0):t instanceof Date?n[s]=new Date(t):e(t)?n[s]=_i(n[s],t):n[s]=t}return n};class ui extends Mt{constructor(t){super(),this.chart=t,li++}get visible(){return this._isVisible()}set visible(t){this.updateOption("visible",t)}_isVisible(){return this.prop("visible")}_doSetSimple(t,e){return o(e)?(t.visible=e,!0):super._doSetSimple(t,e)}_addChild(t,e){return super._addChild(t,e)}_doLoad(t,e){var i;if(null!=(null==e?void 0:e.template)){const t=null===(i=this.chart)||void 0===i?void 0:i.assignTemplates;t&&(e=t(e))}super._doLoad(t,e)}clearStyle(t=!1){return this._op.style&&(delete this._op.style,this.$_applyOptions(this._op),t&&this._optionChanged()),this}setStyle(e,i,s=!0){if(!e)return this;let r=this._op.style,n=!1;return null!==i&&""!==i||(i=void 0),void 0===i?r&&t.call(r,e)&&(delete r[e],n=!0):r&&r[e]==i||(r||(r=this._style=this._op.style={}),r[e]=String(i),n=!0),n&&(this.$_applyOptions(this._op),s&&this._optionChanged()),this}setStyles(t,i=!1,s=!0){let r=!1,n=this._op.style;if(i&&n&&(delete this._op.style,r=!0,n=this._style=void 0),e(t)){n||(n=this._style=this._op.style={});for(const e in t){let i=t[e];n[e]!=i&&(null!==i&&""!==i||(i=void 0),void 0===i?delete n[e]:n[e]=t[e],r=!0)}r=!0}return r&&(this.$_applyOptions(this._op),s&&this._optionChanged()),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)}_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}`,s=this.prop(e);s!==this[i]&&(this[`${i}Dim`]=Z(this[i]=s,!0))}_setDims(t,...e){e.forEach((e=>this._setDim(t,e)))}_doApply(t){this._style=t.style}_doPrepareRender(t,e){}_doAfterRender(){}}ui.REFRESHED="refreshed",ui.defaults=ci(Mt.defaults,{visible:!0});class pi{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 gi extends ui{constructor(){super(...arguments),this._outlineThickness=2,this._outlineWidth="2px"}_setOutlineThickness(t){t!==this._outlineThickness&&(this._outlineThickness=t,this._outlineWidth=A(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?Te.getFormatter(t):null)}_setText(t){t!==this._text&&this.prepareRich(this._text=t);const e=this.prop("lineHeight");return!isNaN(e)&&this._richTextImpl&&(this._richTextImpl.lineHeight=e),this}isVisible(){return this.visible&&!!this._text}setText(t){this._setText(t)}buildSvg(t,e,i,s,r,n,o=!0){this._richTextImpl&&(this._richTextImpl.build(t,i,s,r,n,o),e&&this._richTextImpl.build(e,i,s,r,n,o))}prepareRich(t){t?(this._richTextImpl||(this._richTextImpl=new hi),this._richTextImpl.setFormat(t)):this._richTextImpl=null}_doSetSimple(t,e){return r(e)?(t.text=e,!0):super._doSetSimple(t,e)}_doApply(t){super._doApply(t),this._setOutlineThickness(this.prop("outlineThickness")),this._setNumberSymbols(this.prop("numberSymbols")),this._setNumberFormat(this.prop("numberFormat")),this._setText(t.text)}$_getNumberText(t,e,i){if(et.isValidNum(t)){const s=this._numSymbols&&e&&et.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 n=r(t)?t:this.$_getNumberText(e,i,s)||e;const o=this.prop("prefix"),a=this.prop("suffix");return o&&(n=o+n),a&&(n+=a),n}getNumberText(t,e,i,s){let r="";if(et.isValidNum(t)){const n=this._numSymbols&&e&&et.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)}const n=this.prop("prefix"),o=this.prop("suffix");return n&&(r=n+r),o&&(r+=o),r}}gi.defaults=ci(ui.defaults,{effect:"none",autoContrast:!1,outlineThickness:2,numberSymbols:"k,M,G,T,P,E",numberFormat:"#,##0.#"});class mi extends gi{getIconPos(){const t=this.prop("iconPosition");return"default"===t?this.getDefaultIconPos():t}_doPrepareRender(t,e){if(this._images=null,e.imageList){const i=t._assets.get(e.imageList);i instanceof Ce&&(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 Ce?i.getImage(s):s}return this._root+t}}}mi.defaults=ci(gi.defaults,{iconPosition:"default",iconGap:2});class fi extends ui{}fi.defaults=ci(gi.defaults,{});class bi extends mi{getDisplay(t){const e=this.prop("display");return"inline"===e||"stack"===e?e:t.getDefaultDisplay(this)}getGap(t){return A(this.prop("gap"),t?10:5)}_isVisible(){return this.prop("visible")&&!!this.prop("text")}_doSetSimple(t,e){return r(e)?(t.text=e,!0):super._doSetSimple(t,e)}getDefaultIconPos(){return"left"}}bi.defaults=ci(mi.defaults,{display:"auto"});class yi extends ui{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(){const t=this.prop("order");return isNaN(t)?1/0:t}_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){this._addChild("background",this._background=new fi(this.chart)),this._addChild("title",this._title=new bi(this.chart)),this._addChild("footer",this._footer=new bi(this.chart))}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._location=I(e.location,"bottom")}}yi.defaults=ci(ui.defaults,{offsetX:0,offsetY:0});class wi extends yi{}class xi extends yi{_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.prop("direction")}}xi.defaults=ci(yi.defaults,{direction:"vertical"});class vi extends pi{constructor(){super(...arguments),this._dic={},this._visibles=[]}getVisibles(t){return this._visibles.filter((e=>e.getLocation()===t))}get(t,e){const i=r(t)?this._dic[t]:this._items[t];return!i||e&&i.getLocation()!==e?void 0:i}find(t,e){const i=r(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 s=this.chart,r=this._items=[],n=this._dic={};if(i(t))t.forEach(((t,e)=>{r.push(this.$_loadItem(s,t,e))}));else if(e(t))r.push(this.$_loadItem(s,t,0));else if(!this._canEmpty()){const e={};o(t)&&(e.visible=t),r.push(this.$_loadItem(s,e,0))}r.forEach((t=>{t.prop("name")&&(n[t.prop("name")]=t)}))}_canEmpty(){return!0}$_loadItem(t,e,i){const s=this._createWidget(t);return s.init(),s._setIndex(i),s.loadOptions(e),s}_collectVisibles(){this._visibles=this._items.filter((t=>t.isVisible()))}}class Si extends vi{_collectionProp(){return"widgetGroup"}_createWidget(t){return new xi(t)}beforeRender(){this._collectVisibles()}}class Ci extends ui{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=U(this._widthDim,t)),isNaN(s)&&(s=U(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.prop("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.prop("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(r(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"}}Ci.defaults=ci(ui.defaults,{verticalAlign:"top",offsetX:0,offsetY:0,scope:"chart"});class Pi extends pi{constructor(){super(...arguments),this._map={},this._visibles=[]}getVisibles(){return this._visibles.slice(0)}get(t){return r(t)?this._map[t]:this._items[t]}load(t,s){const r=this.chart,n=this._items=[],o=this._map={};i(t)?t.forEach(((t,e)=>{n.push(this._loadItem(r,t,e,s))})):e(t)&&n.push(this._loadItem(r,t,0,s)),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 Mi extends wi{get series(){return this._series}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._series=t.getSeries(e.series)||this._getScaledSeries(t)}}Mi.defaults=ci(yi.defaults,{});class Li extends ui{_doSetSimple(t,e){return r(e)?(t.text=e,!0):super._doSetSimple(t,e)}}Li.defaults=ci(ui.defaults,{text:"RealMap v1.1.20",url:"http://realmap.co.kr",location:"bottom",offsetX:2,offsetY:1,gap:4});const Ai="_model_",ki="_tag_",Ii="disabled",Ei="rm-legend-item-marker",Ti=Object.freeze([0,0]),Ni=/s\+/;function $i(t){if(i(t))return[+t[0],+t[1]];if(r(t)){const e=t.split(Ni);return[+e[0],+e[1]]}if(e(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 Vi(t){return isFinite(t[0]+t[1])}function Ri(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=_(e,...t),i=_(i,...o),s=u(s,...t),r=u(r,...o)}return{h1:e,v1:i,h2:s,v2:r}}const Oi=Object.values({CIRCLE:"circle",DIAMOND:"diamond",SQUARE:"square",TRIANGLE:"triangle",STAR:"star",ITRIANGLE:"itriangle",RECTANGLE:"rectangle"}),Bi=.001,Fi=Math.PI;class zi{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=_(-s/2,i/2,r),["M",t,e-(n=_(-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=_(-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=_(-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=_(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(p(n-r)),l=2*Fi-h<.01,_=h-Fi<.01?0:1,u=o?1:0,g=c(r),m=d(r),f=c(n-=l?u?Bi:-.001:0),b=d(n),y=[];return y.push("M",t+i*g,e+s*m,"A",i,s,0,_,u,t+i*f,e+s*b),l&&y.push("M",t,e),a&&y.push("Z"),y}static sector(t,e,i,s,r,n,o,a){const h=N(p(o-n)),l=2*Fi-h<Bi;let _=h-Fi<Bi?0:1;const u=a?1:0,g=c(n),m=d(n),f=c(o-=l?u?Bi:-.001:0),b=d(o),y=i*r,w=s*r,x=[];return x.push("M",t+i*g,e+s*m,"A",i,s,0,_,u,t+i*f,e+s*b),l?x.push("M",t+y*f,e+w*b):x.push("L",t+y*f,e+w*b),isNaN(y)||x.push("A",y,w,0,_,1-u,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*d(r+6*Math.PI/5))/2,a=i/2,h=s/2,l=i/4,_=s/4,u=2*Math.PI/5,p=u/2,g=[];g.push("M",n+a*c(r),o+h*d(r));for(let t=0;t<5;t++)g.push("L",n+a*c(r),o+h*d(r),"L",n+l*c(r+p),o+_*d(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=zi[e](0,0,2*i,2*s);break;default:r=zi.circle(i,s,_(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 ji={minimumZoom:200,maximumZoom:1600},Gi={};class Hi extends Ci{static register(...t){t.forEach((t=>{Gi[t.type]=t}))}constructor(t,e){super(t),this.inBody=e}_type(){return this.constructor.type}refresh(){}_getNamePrefix(){return"annotation"}_doLoad(t,e){this.chart&&(e=this.chart.loadBase(e,"annotation",this._type())),super._doLoad(t,e)}_doPrepareRender(t,e){}_getDefaultAlign(){return this._anchorObj?"center":super._getDefaultAlign()}}Hi.defaults=ci(Ci.defaults,{front:!1});class Wi extends Pi{constructor(t){super(t.chart),this.owner=t}getAnnotation(t){const e=this._map[t];if(e instanceof Hi)return e}load(t,e){super.load(t,e)}prepareRender(){super.prepareRender(),this._visibles.forEach((t=>{t._anchorObj=t.prop("anchor")?this.owner.anchorByName(t.prop("anchor")):void 0}))}_loadItem(t,e,i,s){let n=e.type;n||(n=r(e.imageUrl)?"image":r(e.shape)?"shape":"text");const o=t._getAnnotationType(n);if(!o)throw new Error("Invalid annotation type: "+e.type);const a=new o(t,s);return a.init(),a.index=i,a.loadOptions(e),a}}const Yi="geo",Zi="chart",Ui="route",Xi="map",Ki="feature",qi="vector",Ji="heatmap",Qi="region",ts="tiledweb",es="track",is="band",ss="table",rs="sankey",ns="glpoint";class os{static getDistance(t,e){const i=(e[0]-t[0])*y,s=(e[1]-t[1])*y,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t[0]*y)*Math.cos(e[0]*y)*Math.sin(s/2)*Math.sin(s/2);return 6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)))}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(Et(h+t*a));return l}static valueAt(t,e){if(null!=e&&""!==e&&(et.isObject(t)||i(t))){const i=String(e).split(".");let s=t;for(let t of i)s=s[t];return s}return t}}class as extends ie{static create(t,e,i,s,r,n,o=0){return new as(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 hs{constructor(t,e){}}const ls="@_rm_state_",cs="@_rm_add_",ds="@_rm_update_",_s="@_rm_delete_";let us=0;const ps=[0,0];class gs{constructor(t){this.source=t,this.inset=ps,this.pid=us++,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 s=this.source;null==s?this.isNull=!0:i(s)?0===s.length?this.isNull=!0:this._readArray(t,s):e(s)?this._readObject(t,s):this._readSingle(s),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,s){if(this._prev=this.copy(),e(s)?this.source=Object.assign(e(this.source)?this.source:{},s):i(s)?this.source=s.slice(0):this.source=s,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[ls]=t:delete this[ls]}_isAdding(){return this[ls]===cs}_isUpdating(){return this[ls]===ds}_isDeleting(){return this[ls]===_s}_isStatic(){const t=this[ls];return t!==cs&&t!==_s}_assignTo(t){return a(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 s,r,n,o,a,h;const l=t.prop("fields");if(i(l))for(let t=0;t<l.length;t++)this[l[t]]=e[t];else this.id=null===(s=t._idFielder)||void 0===s?void 0:s.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)}$_localeName(t,e){var i;const s=zt(null===(i=t.chart)||void 0===i?void 0:i.general.prop("locale")).nameKeys;for(const t of s)if(void 0!==e[t])return e[t]}_relocalizeName(t){const i=this.source;e(i)&&(this.name=I(t._nameFielder(i),this.$_localeName(t,i)))}_readObject(t,e){var s;if(this.id=I(t._idFielder(e),e.id),this._relocalizeName(t),this.color=I(t._colorFielder(e),e.color),this.className=e.className,i(e.coord))this.coord=[+e.coord[0],+e.coord[1]];else if(r(e.coord)){const t=e.coord.split(Ni);this.coord=[+t[0],+t[1]]}else if(isNaN(e.lon)||isNaN(e.lat))if(isNaN(e.x)||isNaN(e.y)){if(t._lonFielder&&t._latFielder){const i=t._lonFielder(e),r=null===(s=t._latFielder)||void 0===s?void 0:s.call(t,e);isNaN(i)||isNaN(r)||(this.coord=[i,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=i(e.callout)&&this.$_parseCallout(e.callout),i(this.callout)||(this.offset=i(e.offset)&&this.$_parseCallout(e.offset))}$_parseCallout(t){let e;return r(t)&&(t=t.split(",")),i(t)&&(e=[],n(t[0])?e.push(t):t.forEach((t=>{if(i(t))e.push(t.slice(0,2));else if(r(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){r(t)&&(this.id=t)}}class ms{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){i(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 fs={};class bs extends mi{constructor(){super(...arguments),this._domain={callback:(t,e)=>this._point.getParam(e)}}get getPosition(){return this._getPosition}getValue(t,e){const i=this.prop("textField");if(r(i)){const e=t.getProp(i);if(null!=e)return e}return t.getLabel(e)}getTextDomain(t){return this._point=t,this._domain}getText(t){return et.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}isVisible(){return this.visible}getDefaultIconPos(){return"top"}_doSetSimple(t,e){return s(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),s(t.positionCallback)?this._getPosition=t=>{const e=this.prop("positionCallback"),i=this.prop("position");return e({point:t,chart:this.chart.wrapper})||i||bs.DEFAULT_POSITION}:this._getPosition=()=>this.prop("position")||bs.DEFAULT_POSITION}}bs.DEFAULT_POSITION="auto",bs.defaults=ci(mi.defaults,{visible:!0,position:bs.DEFAULT_POSITION});class ys extends ui{}ys.defaults=ci(ui.defaults,{shape:"circle",radius:2.5});class ws extends ui{constructor(t){super(t.chart),this.series=t}_doInit(t){super._doInit(t),this._addChild("anchorPoint",this._anchorPoint=new ys(this.chart))}get anchorPoint(){return this._anchorPoint}}ws.defaults=ci(ui.defaults,{visible:!1,usePointColor:!0,layoutOnly:!1});class xs{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 vs extends Rt{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 Ss extends Rt{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 Cs extends vs{_init(t){super._init(t),t._setState(cs)}}class Ps extends vs{_init(t){super._init(t),t._setState(_s),t._setVrate(1)}_update(t,e){this.point._setVrate(1-e)}}class Ms extends vs{_init(t){super._init(t),t._setState(ds)}}class Ls extends Ss{_init(t){t.forEach((t=>{t._setState(cs),t._setVrate(0)}))}}class As extends Ss{_init(t){t.forEach((t=>{t._setState(_s),t._setVrate(1)}))}_update(t,e){t.forEach((t=>t._setVrate(1-e)))}}class ks extends Ss{_init(t){t.forEach((t=>{t._setState(ds),t._setVrate(0)}))}}class Is extends ui{static register(...t){t.forEach((t=>{fs[t.type]=t}))}static getPointTooltipParam(t,e,i){return"series"===i?t.displayName():e.getParam(i)}getProp(t){return this.prop(t)}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 ms(this)}_doInit(t){this._pointArgs=this.$_createPointArgs(),this._pointListArgs=new xs(this.$_createPointArgs(),this.chart.wrapper),this._addChild("pointLabel",this._pointLabel=this._createLabel(this.chart)),this._addChild("callout",this._callout=new ws(this))}_createLabel(t){return new bs(t)}getTooltipText(t,e){var i;const s=this.prop("tooltipText"),n=this.prop("tooltipCallback");return"function"==typeof n?(this._getPointArgs(this._pointArgs,e),null!==(i=n(this._pointArgs))&&void 0!==i?i:r(s)?s:Is.defaultTooltipText):"boolean"==typeof s?s?Is.defaultTooltipText:null:s}getTooltipParam(t,e,i){return Is.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.prop("label")||this.name}_type(){return this.constructor.type}_inspect(){var t,e;const s={name:this.name,type:this._type(),points:this.pointCount,rendered:null!==(e=null===(t=this._visPoints)||void 0===t?void 0:t.length)&&void 0!==e?e:0,hasData:!!(this._op.dataUrl||i(this._op.data)&&this._op.data.length>0)};if(s.hasData&&this._positionsByCoord()){let t=0;this._points.forEach((e=>{i(e.coord)&&0===e.coord[0]&&0===e.coord[1]&&++t})),s.unpositioned=t}return s}_positionsByCoord(){return!0}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.prop("label")||this.name||`Series${this.index}`}get data(){return this._data}$_setData(t,e){if(t!==this._data||e!==this._dataPath)return this._data=os.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()}get needAnimate(){return this._needAnimate}set needAnimate(t){this._needAnimate=t}get dataLoaded(){return this._dataLoaded}set dataLoaded(t){this._dataLoaded=t}isDataSeries(){return!0}isMapSeries(){return!1}getDetailed(){return this}getValueRange(){}isInteractive(){return this.bool("interactive")&&!this.bool("disabled")}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)?{isCallbackExecuted:!0,label:s}:{label:i,isCallbackExecuted:!1}}getPointArgs(t){return this._getPointArgs(this._pointArgs,t)}_relocalize(){this._points.getPoints().forEach((t=>t._relocalizeName(this)))}getPointStyle(t){const e=this.prop("styleCallback");if("function"==typeof e)return e(this._getPointArgs(this._pointArgs,t))}getPointLabelStyle(t){if("function"==typeof this.pointLabel.prop("styleCallback"))return this.pointLabel.prop("styleCallback")(this._getPointArgs(this._pointArgs,t))}getRangedColor(t){}isPointLabelsVisible(){const t=this.pointLabel.prop("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.prop("layoutOnly")}getLegendSources(t,e){this._legend===t&&e.push(this)}getLabelOff(){return A(this._pointLabel.prop("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.prop("dataPath"))&&(this._dataLoaded=e,this.$_dataPointsChanged()),this}addPoint(t,e=-1,i=500){var s;const r=this.$_addPoint(t,-1);return this._points.insert(e,r),this.$_dataPointsChanged(),this.chart.animatable()&&i>0&&this.canAddAnimation()?(r._prev={},r._prev.ani=new Cs(this,r,(t=>{var e;null===(e=this.prop("onPointAdded"))||void 0===e||e(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(i).start()):null===(s=this.prop("onPointAdded"))||void 0===s||s(this._getPointArgs(this._pointArgs,r)),r}addPointList(t,e=-1,s=500){var r;if(!i(t)||t.length<1)return;const n=t.map(((t,e)=>this.$_addPoint(t,-1)));return this._points.insertAll(e,n),this.$_dataPointsChanged(),this.chart.animatable()&&s>0&&this.canAddAnimation()?new Ls(this,n,(t=>{var e;null===(e=this.prop("onPointListAdded"))||void 0===e||e(this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(s).start():null===(r=this.prop("onPointListAdded"))||void 0===r||r(this._getPointListArgs(n)),n}removePoint(t,e=300){var i,s,o;n(t)?t=this._points.get(t):r(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 Ps(this,t,(t=>{var e;this._points.remove(t),null===(e=this.prop("onPointRemoved"))||void 0===e||e(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()})).setDuration(e).start()):(this._points.remove(t),null===(o=this.prop("onPointRemoved"))||void 0===o||o(this._getPointArgs(this._pointArgs,t)),this.$_dataPointsChanged()))}$_points(t){for(let e=t.length-1;e>=0;e--){const i=t[e];n(i)?t[e]=this._points.get(+i):r(i)&&(t[e]=this._points.pointById(i))}return t.filter((t=>this._points.contains(t)))}$_remove(t,e){var i;this.chart.animatable()&&e>0&&this.canRemoveAnimation()?new As(this,t,(t=>{var e;this._points.removeAll(t),null===(e=this.prop("onPointListRemoved"))||void 0===e||e(this._getPointListArgs(t)),this.$_dataPointsChanged()})).setDuration(e).start():(this._points.removeAll(t),null===(i=this.prop("onPointListRemoved"))||void 0===i||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;if(r(t)?t=this._points.pointById(t):n(t)&&(t=this._points.get(t)),t instanceof gs&&this._points.contains(t)){let r=t._prev;return r&&r.ani&&r.ani.stop(),r=t.updateValues(this,e),r&&(this.$_dataPointsChanged(),this.chart.animatable()&&i>0?r.ani=new Ms(this,t,(t=>{var e;null===(e=this.prop("onPointUpdated"))||void 0===e||e(this._getPointArgs(this._pointArgs,t))})).setDuration(i).start():null===(s=this.prop("onPointUpdated"))||void 0===s||s(this._getPointArgs(this._pointArgs,t))),!!r}return!1}updatePointList(t,e,i=300){var s;const r=this.$_points(t).filter((t=>this._points.contains(t)));r.length>0&&(r.forEach((t=>t.updateValues(this,e[0]))),this.$_dataPointsChanged(),this.chart.animatable()&&i>0?new ks(this,r,(t=>{var e;null===(e=this.prop("onPointListUpdated"))||void 0===e||e(this._getPointListArgs(t))})).setDuration(i).start():null===(s=this.prop("onPointListUpdated"))||void 0===s||s(this._getPointListArgs(r)))}getPointLabels(){return[this.pointLabel]}getColorScale(){return null}setOptionsDirty(t){return this._optionsDirty=t,this}pointClicked(t){const e=this.prop("onPointClick");if(e)return this._getPointArgs(this._pointArgs,t),e(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.prop("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 gs&&(isNaN(t._zindex)||t._zindex<this._maxZindex)&&(t._zindex=++this._maxZindex,this._zindexDirty=!0)}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 o=e.pointColors;let a,h,l;this._runColor=n(e.color)?`var(--color-${(Math.floor(e.color)-1)%12+1})`:e.color,s(o)?a=o:i(o)?h=o:r(o)&&(l=this.chart._assets.get(o)),a?this._runPoints.forEach(((t,e)=>{t._runColor=t.color||a(this._getPointArgs(this._pointArgs,t))})):l instanceof Se?(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 s(t)?e=>t(e):r(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),this._lonFielder=this._createFielder(t.lonField||"lon"),this._latFielder=this._createFielder(t.latField||"lat")}_createLegendMarker(t,e){return as.create(t,Ei,0,0,e,e,e/2)}_defaultLoadAnimation(){return"grow"}_doLoad(t,e){this.chart&&(e=this.chart.loadBase(e,"series",this._type())),super._doLoad(t,e)}_doLoadData(t){if(t instanceof hs);else if(i(t))return t}$_loadPoints(t){var e;this._doLoadPoints(t),null===(e=this.prop("onPointsLoaded"))||void 0===e||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){var e,i;const r=this._pointLabel.prop("textCallback"),n=this._pointLabel.prop("visibleCallback");this._pointLabelCallback=s(r)?r:null,this._pointLabelVisCallback=s(n)?n:null,this._argsPoint=null,t.chart=this.chart.wrapper,t.series=this,t.count=this._points.count,t.locale=null===(i=null===(e=this.chart)||void 0===e?void 0:e.general)||void 0===i?void 0:i.prop("locale")}_calcMinMax(t){let e,i;return t.forEach((t=>{const s=t.getValue();isNaN(s)||(e=isNaN(e)?s:_(s,e),i=isNaN(i)?s:u(s,i))})),{min:e,max:i}}}Is.defaultTooltipText="<b>${name}</b><br>${series}:<b> ${value}</b>",Is.defaults=ci(ui.defaults,{idField:"id",lonField:"lon",latField:"lat",colorField:"color",tooltipText:Is.defaultTooltipText,loadAnimation:"default",legend:0,interactive:!0});class Es extends pi{constructor(){super(...arguments),this._map={},this._visibles=[]}get visibles(){return this._visibles}get firstVisible(){return this._visibles[0]}load(t,s){const r=this.chart;this._items=[],this._map={},i(t)?t.forEach(((t,e)=>{this.$_loadItem(r,t,e)})):e(t)&&this.$_loadItem(r,t,0)}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.prop("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,e){const i=this.$_loadItem(this.chart,t,this._items.length);return i&&(i.needAnimate=e),i}remove(t){let e;if(t instanceof Is?e=t:r(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.loadOptions(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 Ts extends gs{_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:T(this._prev.value,this.value,this._vr)}getBaseValue(){return this.value}_valuesChanged(t){const e=super._valuesChanged(t),i=this.coord[0]!==t.coord[0]||this.coord[1]!==t.coord[1],s=this.value!==t.value;return e||s||i}}class Ns extends Is{_createFielders(t){super._createFielders(t),this._valueFielder=this._createValueFielder(t)}_createValueFielder(t){return this._createFielder(t.valueField||"value")}}Ns.defaults=ci(Is.defaults,{valueField:"value"});class $s extends Ns{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(e){if(super._doApply(e),t.call(e,"excludeBounds")){const t=e.excludeBounds,r=[];if(s=t,Array.isArray(s)&&s.length>0)for(let e=0;e<t.length;e+=2){const s=t[e],n=t[e+1];if(i(s)&&i(n)){const t=+s[0],e=+s[1],i=+n[0],o=+n[1];isNaN(t)||isNaN(e)||isNaN(i)||isNaN(o)||r.push([[_(t,i),u(e,o)],[u(t,i),_(e,o)]])}}this._excludes=r.length>0?r:void 0}var s}}$s.defaults=ci(Ns.defaults,{});class Vs extends Ts{}class Rs extends $s{}Rs.defaults=ci($s.defaults,{});class Ds extends Ts{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=i(this.values)?this.values.reduce(((t,e)=>t+A(e,0)),0):0:this._sum}_readArray(t,e){super._readArray(t,e),this.$_initValues(t)}_readObject(t,e){super._readObject(t,e),this.$_initValues(t)}$_initValues(t){var e;const s=this.value;if(i(s)){const i=t.getProp("nullAsBase"),r=null!==(e=t.getProp("baseValue"))&&void 0!==e?e:0,n=i?r:NaN;this.values=s.map((t=>null==t?n:t))}else this.values=isNaN(s)?[]:[s]}getParam(t){return"sum"===t?this.getSum():super.getParam(t)}}class Os{constructor(t,e){this.name=t,this.color=e,this.visible=!0}canHide(){return!0}legendMarker(t,e){return as.create(t,Ei,0,0,e,e)}legendColor(){return this.color}legendLabel(){return this.name}}class Bs extends $s{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);const e=this.prop("categories");this._categories=this.$_parseCategories(e)}_relocalize(){super._relocalize(),this._categories=this.$_parseCategories(this.prop("categories"))}_createValueFielder(t){const e=this.prop("valueFields");return i(e)&&e.length>0?t=>e.map((e=>t[e])):super._createValueFielder(t)}getLegendSources(t,e){this._legend===t&&(this.prop("legendByCategory")&&this._categories?e.push(...this._categories):e.push(this))}$_parseCategories(t){var e,s;if(i(t)){const i=jt(null===(s=null===(e=this.chart)||void 0===e?void 0:e.general)||void 0===s?void 0:s.prop("locale"));return t.map((t=>{var e;return new Os(i&&null!==(e=t.nameEn)&&void 0!==e?e:t.name,t.color)}))}}_splitColors(){let t=0;if(this._visPoints.forEach((e=>{const i=e;t=Math.max(t,i.values?i.values.length:0)})),t<2)return[this._calcedColor];{const e=nt.create("white"),i=nt.create(this._calcedColor),s=new Array(t);for(let r=t;r<2*t;r++)s[r-t]=nt.interpolate(e,i,r/(2*t)).toString();return s}}}Bs.defaults=ci($s.defaults,{position:"top"});class Fs extends Ds{}class zs extends Bs{_doInit(t){super._doInit(t),this._addChild("baseLine",this._baseLine=new ui(this.chart))}get baseLine(){return this._baseLine}getPointExtents(t,e){const i=et.getMinMax(t),s=i.base=this.prop("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=A(this._minValue,i.min),e=A(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 A(U(this._paddingDim,t),0)}_doApply(t){super._doApply(t);const e=this.prop("width"),i=this.prop("height"),s=this.prop("minValue"),r=this.prop("maxValue"),n=this.prop("valueDomain");this._width=A(+e,zs.DEF_WIDTH),this._height=A(+i,zs.DEF_HEIGHT),this._setDims(t,"padding"),this._minValue=+s,this._maxValue=+r,this._pointDomain="point"===n}}zs.DEF_WIDTH=80,zs.DEF_HEIGHT=50,zs.defaults=ci(Bs.defaults,{width:zs.DEF_WIDTH,height:zs.DEF_HEIGHT,baseValue:0,valueDomain:"series"});class js extends Ts{}class Gs extends $s{_doApply(t){super._doApply(t),this._width=A(+t.width||+t.size||+t.height,Gs.DEF_SIZE),this._height=A(+t.height||+t.size||+t.width,Gs.DEF_SIZE)}}Gs.DEF_SIZE=60,Gs.defaults=ci($s.defaults,{size:Gs.DEF_SIZE});class Hs extends Gs{getValueRate(t){return(A(t,this._min)-this._min)/(this._max-this._min)}_doApply(t){super._doApply(t),this._minValue=this.num("minValue"),this._maxValue=this.num("maxValue")}_doPrepareRender(t){let e=A(this._minValue,1/0),i=A(this._maxValue,-1/0);this._runPoints.forEach((t=>{const s=t,r=s.getValue();s.isNull||isNaN(r)||(e=_(e,r),i=u(i,r))})),this._min=e,this._max=i}}Hs.defaults=ci(Gs.defaults,{minValue:10});class Ws extends Vs{labelCount(){return 2}_readObject(t,e){super._readObject(t,e)}}class Ys extends bs{}Ys.defaults=ci(bs.defaults,{visible:!1});class Zs extends Rs{_doInit(t){super._doInit(t),this._subLabel=this._addChild("subLabel",new Ys(this.chart))}get subLabel(){return this._subLabel}get color(){return this._colorObj}get alignToSurface(){return this._alignToSurface}set alignToSurface(t){this._alignToSurface=t}getShape(){return"circle"}getPixelMinMax(t){return{min:U(this._minSizeDim,t),max:U(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.prop("sizeMode")&&(s=Math.sqrt(s)),s=Math.ceil(e+s*(i-e))/2,s}getSubLabelOff(){return A(this._subLabel.prop("offset"),0)}_doApply(t){super._doApply(t);const e=this.prop("minValue"),i=this.prop("maxValue"),s=this.prop("alignToSurface");this._setDims(t,"minSize","maxSize"),this._extMin=+e,this._extMax=+i,this._alignToSurface=s}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new Ws(t)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new nt(this._calcedColor)}getColorScale(){var t;return null!==(t=this.prop("colorScale"))&&void 0!==t?t:null}getValueRange(){return{min:this._colorMin,max:this._colorMax}}getRangedColor(t){if(this._colorRanger)return this._colorRanger.getColor(this._colorMin,this._colorMax,t.getValue(),this._colorObj)}_doPrepareRender(t,e){var i;super._doPrepareRender(t,e);const s=this._extMin,r=this._extMax;if(!isNaN(s)&&!isNaN(r)&&this._runPoints.length>0)this._noSize=s>r||(this._vMin=s)===(this._vMax=r);else{let t=Number.MAX_VALUE,e=Number.MIN_VALUE;this._runPoints.forEach((i=>{const n=i.getValue();i.isNull||isNaN(n)||(isNaN(s)&&(t=_(t,n)),isNaN(r)&&(e=u(e,n)))})),this._noSize=t>e||(this._vMin=t)===(this._vMax=e)}const{min:n,max:o}=this._calcMinMax(this._visPoints),a=this.prop("colorScale");this._colorMin=n,this._colorMax=o,this._colorRanger=null!=a?null===(i=t.getColorScale(a))||void 0===i?void 0:i.getRanger():void 0}}Zs.type="bubble",Zs.defaults=ci(Rs.defaults,{sizeMode:"area",minSize:10,maxSize:"12%",position:"center",tooltipText:"name: <b>${name}</b><br>value: <b>${value}</b>",alignToSurface:!1});class Us extends ui{}Us.defaults=ci(Mi.defaults,{length:10});class Xs extends mi{getText(t){return et.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}Xs.defaults=ci(Mi.defaults,{offset:4});class Ks extends ui{_doInit(t){this._line=this._addChild("line",new Us(this.chart)),this._label=this._addChild("label",new Xs(this.chart))}get line(){return this._line}get label(){return this._label}}Ks.defaults=ci(Mi.defaults,{});class qs extends Mi{_doInit(t){super._doInit(t),this._tick=this._addChild("tick",new Ks(this.chart))}get tick(){return this._tick}getSteps(t,e){const i=this._series,s=this._steps;if(i instanceof Zs){let{min:r,max:n}=i.getPixelMinMax(_(t,e));isNaN(this.prop("minRadius"))||(r=this.prop("minRadius")),isNaN(this.prop("maxRadius"))||(n=this.prop("maxRadius")),s.forEach((t=>{t.rd=i.getRadius(t.value,r,n)}))}else if(s.length>0){const t=A(this.prop("minRadius"),10),e=A(this.prop("maxRadius"),50)-t,i=s[0].value,r=s[s.length-1].value-i;s.forEach((s=>{s.rd=t+e*(s.value-i)/r}))}return s}_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(){this._op;const t=this.prop("steps"),s=[];if(i(t)&&t.length>0){const i=this.tick.label;t.forEach((t=>{e(t)?s.push({value:+t.value,label:t.label||i.getText(+t.value),rd:0}):isNaN(t)||s.push({value:+t,label:i.getText(+t),rd:0})}))}return s}}qs.defaults=ci(Mi.defaults,{});class Js extends vi{_collectionProp(){return"bubbleScale"}_createWidget(t){return new qs(t)}beforeRender(){this._collectVisibles()}}class Qs extends ui{constructor(t,e){super(t.chart),this.legend=t,this.source=e}text(){return this.source.legendLabel()}}Qs.MARKER_SIZE=10;class tr extends wi{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.prop("layout")||"body"===t)return this.prop("layout");switch(t){case"bottom":case"top":return"horizontal";default:return"vertical"}}getMaxWidth(t){return U(this._maxWidthDim,t,t)}getMaxHeight(t){return U(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=this.prop("maxWidth"))!==e._maxWidth&&(e._maxWidth=i,e._maxWidthDim=Z(i,!0)),function(t){t!==e._maxHeight&&(e._maxHeight=t,e._maxHeightDim=Z(t,!0))}(this.prop("maxHeight"))}_doPrepareRender(t,e){super._doPrepareRender(t,e),this._items=t._getLegendSources(this).map((t=>new Qs(this,t))),this.prop("reversed")&&(this._items=this._items.reverse())}}tr.defaults=ci(yi.defaults,{visible:void 0,location:"bottom",layout:"auto",alignBase:"map",itemGap:8,markerVisible:!0,markerSize:Qs.MARKER_SIZE,markerGap:4,lineGap:4,itemsAlign:"center",seriesHovering:!0});class er extends vi{_collectionProp(){return"legend"}_canEmpty(){return!1}_createWidget(t){return new tr(t)}prepareRender(){super.prepareRender(),this._collectVisibles()}}class ir{constructor(t){this._color1=nt.create(t.minColor),this._color2=nt.create(t.maxColor),this._logger=et.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 nt.interpolate(this._color1,this._color2,(i-t)/(e-t)).toString();return E(this._color2,s,this._color1).brighten(1-(i-t)/(e-t)).toString()}}class sr extends ui{_doInit(t){this._label=this._addChild("label",new gi(this.chart))}get label(){return this._label}getMarkerSize(){return A(this.prop("size"),7)}}sr.defaults=ci(ui.defaults,{size:7});class rr extends ui{}rr.defaults=ci(ui.defaults,{length:6});class nr extends mi{getDefaultIconPos(){}}nr.defaults=ci(mi.defaults,{});class or extends ui{_doInit(t){this._line=this._addChild("line",new rr(this.chart)),this._label=this._addChild("label",new nr(this.chart))}get line(){return this._line}get label(){return this._label}}or.defaults=ci(ui.defaults,{});class ar{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||Qs.MARKER_SIZE;return as.create(t,Ei,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 nt.interpolate(i,s,(t-r)/(n-r)).toString();return E(s,e,i).brighten(1-(t-r)/(n-r)).toString()}}class hr extends ui{}hr.defaults=ci(ui.defaults,{});class lr extends ui{getLabel(){var t;return null!==(t=this.prop("label"))&&void 0!==t?t:"No Data"}getGap(){return A(+this.prop("gap"),0)}}lr.defaults=ci(ui.defaults,{visible:!1,color:"white",label:"No Data",gap:2});const cr=nt.create("#000");class dr extends Mi{_doInit(t){super._doInit(t);const e=this.chart;this._marker=this._addChild("marker",new sr(e)),this._stepLine=this._addChild("stepLine",new hr(e)),this._tick=this._addChild("tick",new or(e)),this._nullStep=this._addChild("nullStep",new lr(e))}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 nt.interpolate(this._minColor,this._endColor,(i-this._min)/(this._max-this._min)).toString()}if(this.nullStep.prop("visible"))return this.nullStep.prop("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.prop("layout")){case"horizontal":case"vertical":return this.prop("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?U(this._barLengthDim,e):e,s=A(this.prop("barWidth"),12)):(s=this._barLengthDim?U(this._barLengthDim,t):t,r=A(this.prop("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=A(e[0].from,s)});for(let t=1;t<n;t++)o.push({pos:e[t].from=A(e[t].from,e[t-1].to)});o.forEach(((t,i)=>t.label=e[i].label)),o.push({pos:e[n-1].to=A(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.prop("display")&&"both"!==this.prop("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)||cr,this._steps=this.$_buildSteps()}_type(){return"colorScale"}isVertical(){return"horizontal"!==this.getLayout()}getDefaultDisplay(t){return"stack"}_doApply(t){super._doApply(t);const e=this.prop("colors"),i=this.prop("minColor"),s=this.prop("maxColor");this._setDim(t,"barLength"),this._minColor=nt.create(i),this._maxColor=t.maxColor&&nt.create(s),this._colors=this.$_parseColorStops(e)}_getScaledSeries(t){return t.findSeries((t=>{const e=t.getColorScale();return e===this.index||e&&e===this.prop("name")}))||t.firstMapSeries}$_parseColorStops(t){const e=[];if(i(t)){const i=t.length;if(i>1)for(let s=0;s<i;s++)e.push({stop:t[s].stop,color:nt.create(t[s].color)});else 1===i&&e.push({stop:t[0].stop,color:nt.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=+this.prop("minValue"),this._max=+this.prop("maxValue"),this._logger=et.getLogger(this._logBase=this.prop("logBase")),s&&(isNaN(this._min)&&(this._min=s.min),isNaN(this._max)&&(this._max=s.max))}$_parseValue(t,e,i){return r(t)?t.endsWith("%")?e+(i-e)*parseFloat(t)/100:void 0:t}$_parseColor(t){return t&&t.endsWith("%")?nt.interpolate(this._minColor,this._endColor,parseFloat(t)/100):nt.create(t)}$_buildSteps(){var t;const e=this.prop("solidFill"),s=this.prop("steps"),r=[],n=jt(null===(t=this.chart)||void 0===t?void 0:t.general.prop("locale")),o=this._min,a=this._max;let h=o,l=a;if(this._valueSteps=null,i(s)&&s.length>0){let t="0%";s.forEach(((i,o)=>{var a,c;let d,_,u=this.$_parseValue(i.from,h,l),p=this.$_parseValue(i.to,h,l);if(0===o&&isNaN(u)&&(u=h),o===s.length-1&&isNaN(p)&&(p=l),i.fromColor&&i.toColor)d=this.$_parseColor(i.fromColor),_=this.$_parseColor(t=i.toColor);else if(e){let t=i.toColor||i.fromColor||i.color;t=0===o?t||"0%":t||"100%",_=d=this.$_parseColor(t)}else d=this.$_parseColor(i.fromColor||t),_=this.$_parseColor(t=(null!==(a=i.toColor)&&void 0!==a?a:i.color)||"100%");r.push(new ar(u,p,d,_,n&&null!==(c=i.labelEn)&&void 0!==c?c:i.label))}))}else if(h>=l)r.push(new ar(h,l,e?this._endColor:this._minColor,this._endColor,void 0));else if(!isNaN(h)&&!isNaN(l)){const t=this.prop("logBase"),i=this._logger&&h>=0&&l-h>=t?this._logger:null,s=this._valueSteps=[],n=Math.max(1,A(this.prop("stepCount"),1));if(i&&(h=i(h),l=i(l)),this.prop("integralSteps"))s.push(...os.normalizeToSteps([h,l],n+1));else{const t=(l-h)/n;s.push(h);for(let e=1;e<n;e++)s.push(Et(s[e-1]+t));s.push(Et(l))}if(this._min=s[0],this._max=s[n],e){const t=this._minColor,e=this._endColor,i=s.length-1;for(let n=1;n<=i;n++){const o=nt.interpolate(t,e,n/i);r.push(new ar(s[n-1],s[n],o,o,void 0))}}}return r.length>1?r:void 0}}dr.defaults=ci(ui.defaults,{display:"scale",minColor:"#fff",layout:"auto",barWidth:12,barLength:"40%"});class _r extends vi{getVisibles(t){return super.getVisibles(t).filter((t=>"legend"!==t.prop("display")))}getLegendSources(){const t=[];return this._visibles.forEach((e=>e.getLegendSources(t))),t}_collectionProp(){return"colorScale"}_createWidget(t){return new dr(t)}beforeRender(){this._collectVisibles()}}class ur extends ui{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){this._module&&this._module.exportToImage(t,e)}dispose(){return this._module&&this._module.dispose(),this._module=null,this._isCompose=!1,super.dispose()}}ur.defaults=ci(ui.defaults,{useLibrary:!1,menus:["png","jpeg"],fileName:"realmap",scale:1});class pr extends ui{_doSetSimple(t,e){return et.isValidNum(e)?(t.step=e,!0):super._doSetSimple(t,e)}}pr.defaults=ci(ui.defaults,{});class gr extends ui{_doInit(t){this._addChild("line",this._line=new pr(this.chart)),this._addChild("lonLine",this._lonLine=new pr(this.chart)),this._addChild("latLine",this._latLine=new pr(this.chart))}get line(){return this._line}get lonLine(){return this._lonLine}get latLine(){return this._latLine}get fitTo(){return this.prop("fitTo")}getLonStep(){return Math.max(0,k(this._lonLine.prop("step"),this._line.prop("step"),this.$_defaultStep()))}getLatStep(){return Math.max(0,k(this._latLine.prop("step"),this._line.prop("step"),this.$_defaultStep()))}_doApply(t){super._doApply(t)}$_defaultStep(){return 10}}gr.defaults=ci(ui.defaults,{visible:!1,fitTo:"map"});class mr extends ui{}mr.defaults=ci(ui.defaults,{visible:!1});class fr extends ui{}fr.defaults=ci(ui.defaults,{visible:!1});class br extends gi{getText(t,e){let i=this.prop("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.prop("prefix")&&(i=this.prop("prefix")+i),i}_doApply(t){super._doApply(t),this._symbolPos=t.suffix?t.suffix.indexOf("°°"):-1,this._symbols=this.prop("dirSymbols")}}br.defaults=ci(gi.defaults,{dirSymbols:"NSEW",suffix:"°°"});class yr extends ui{_doInit(t){this._addChild("line",this._line=new fr(this.chart)),this._addChild("label",this._label=new br(this.chart))}get line(){return this._line}get label(){return this._label}visibleAt(t){return this._positions.includes(t)}getLonInterval(){return Math.max(1,k(this.prop("lonInterval"),this.prop("interval"),1))|0}getLatInterval(){return Math.max(1,k(this.prop("latInterval"),this.prop("interval"),1))|0}_doApply(t){super._doApply(t);const e=this.prop("positions");this._positions=i(e)?e:[]}}yr.defaults=ci(ui.defaults,{visible:!1,positions:["top","right"],interval:1});class wr extends mi{getDefaultIconPos(){return"left"}}wr.defaults=ci(mi.defaults,{position:"inside",align:"left",verticalAlign:"top",offsetX:3,offsetY:3});class xr extends ui{_doInit(t){this._addChild("label",this._label=new wr(this.chart))}get label(){return this._label}}xr.defaults=ci(ui.defaults,{front:!0,zindex:0});class vr extends xr{}vr.defaults=ci(xr.defaults,{});class Sr extends xr{}Sr.defaults=ci(xr.defaults,{});class Cr extends xr{}Cr.defaults=ci(xr.defaults,{});class Pr extends ui{}Pr.defaults=ci(ui.defaults,{suffix:"˚",numberFormat:"#0.000",minWidth:50});class Mr extends ui{constructor(t){super(t.chart),this.axis=t}_doInit(t){this._addChild("flag",this._flag=new Pr(this.chart)),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;let i=Te.getFormatter(e.prop("numberFormat")).toStr(t);const s=e.prop("prefix"),r=e.prop("suffix");return s&&(i=s+i),r&&(i+=r),i}moved(t,e,i){}_doSetSimple(t,e){return s(e)?(t.visible=!0,t.onChange=e,!0):super._doSetSimple(t,e)}}Mr.defaults=ci(ui.defaults,{visible:!1});class Lr extends ui{constructor(){super(...arguments),this._guides=[]}_doInit(t){this._addChild("line",this._line=new mr(this.chart)),this._addChild("leftLine",this._leftLine=new mr(this.chart)),this._addChild("rightLine",this._rightLine=new mr(this.chart)),this._addChild("topLine",this._topLine=new mr(this.chart)),this._addChild("bottomLine",this._bottomLine=new mr(this.chart)),this._addChild("equatorLine",this._equatorLine=new mr(this.chart)),this._addChild("meridianLine",this._meridianLine=new mr(this.chart)),this._addChild("grid",this._grid=new gr(this.chart)),this._addChild("tick",this._tick=new yr(this.chart)),this._addChild("crosshair",this._crosshair=new Mr(this))}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(e){if(super._doApply(e),t.call(e,"guide")){const t=e.guide;t!==this._saveGuide&&(this._saveGuide=t,this.$_loadGuides(i(t)?t:[t]))}const s=this.prop("lonInterval"),r=this.prop("latInterval"),n=this.prop("interval");this._lonInterval=Math.max(1,k(s,n,10)),this._latInterval=Math.max(1,k(r,n,10))}$_loadGuides(t){const e=this._guides=[];t.forEach((t=>{let i;i="range"===t.type?new Cr(this.chart):"line"===t.type?new vr(this.chart):"band"===t.type?new Sr(this.chart):new vr(this.chart),i.init(),i.loadOptions(t),e.push(i)}))}}function Ar(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 kr(t,e){let i=!1;Ar(t,e[0])&&(i=!i);for(let s=1;s<e.length;s++)Ar(t,e[s])&&(i=!i);return i}Lr.defaults=ci(ui.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 Er{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 kr(t,e.coordinates);if("MultiPolygon"===e.type){for(const i of e.coordinates)if(kr(t,i))return!0;return!1}return!1}(t,e.originalFeature.geometry)));return e?e.featureId:null}}class Tr{constructor(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}}function Nr(t,e){return t>e?1:t<e?-1:0}function $r(t,e,i){const s=new Tr(null,null);let r=s,n=s;for(;;){const s=i(t,e.key);if(s<0){if(null===e.left)break;if(i(t,e.left.key)<0){const t=e.left;if(e.left=t.right,t.right=e,null===(e=t).left)break}n.left=e,n=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){const t=e.right;if(e.right=t.left,t.left=e,null===(e=t).right)break}r.right=e,r=e,e=e.right}}return r.right=e.left,n.left=e.right,e.left=s.right,e.right=s.left,e}class Vr{constructor(t=Nr){this._root=null,this._size=0,this._comparator=t}insert(t,e){return this._size++,this._root=function(t,e,i,s){const r=new Tr(t,e);if(null===i)return r.left=r.right=null,r;const n=s(t,(i=$r(t,i,s)).key);return n<0?(r.left=i.left,r.right=i,i.left=null):n>=0&&(r.right=i.right,r.left=i,i.right=null),r}(t,e,this._root,this._comparator)}add(t,e){const i=new Tr(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);const s=this._comparator,r=$r(t,this._root,s),n=s(t,r.key);return 0===n?this._root=r:(n<0?(i.left=r.left,i.right=r,r.left=null):n>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root}remove(t){this._root=this._remove(t,this._root,this._comparator)}_remove(t,e,i){let s;if(null===e)return null;return 0===i(t,(e=$r(t,e,i)).key)?(null===e.left?s=e.right:(s=$r(t,e.left,i),s.right=e.right),this._size--,s):e}pop(){let t=this._root;if(t){for(;t.left;)t=t.left;return this._root=$r(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null}find(t){return this._root&&(this._root=$r(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root}next(t){let e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}const s=this._comparator;for(;e;){const r=s(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i}prev(t){let e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}const s=this._comparator;for(;e;){const r=s(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i}get size(){return this._size}}const Rr=(t,e)=>t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y,Dr=(t,e)=>{if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;const i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,s=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:s,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}};let Or=Number.EPSILON;void 0===Or&&(Or=Math.pow(2,-52));const Br=Or*Or,Fr=(t,e)=>{if(-Or<t&&t<Or&&-Or<e&&e<Or)return 0;const i=t-e;return i*i<Br*t*e?0:t<e?-1:1};class zr{constructor(){this.tree=new Vr,this.round(0)}round(t){const e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===Fr(e.key,i.key))return this.tree.remove(t),i.key;const s=this.tree.next(e);return null!==s&&0===Fr(e.key,s.key)?(this.tree.remove(t),s.key):t}}const jr=new class{constructor(){this.reset()}reset(){this.xRounder=new zr,this.yRounder=new zr}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}},Gr=11102230246251565e-32,Hr=134217729,Wr=(3+8*Gr)*Gr;function Yr(t,e,i,s,r){let n,o,a,h,l=e[0],c=s[0],d=0,_=0;c>l==c>-l?(n=l,l=e[++d]):(n=c,c=s[++_]);let u=0;if(d<t&&_<i)for(c>l==c>-l?(o=l+n,a=n-(o-l),l=e[++d]):(o=c+n,a=n-(o-c),c=s[++_]),n=o,0!==a&&(r[u++]=a);d<t&&_<i;)c>l==c>-l?(o=n+l,h=o-n,a=n-(o-h)+(l-h),l=e[++d]):(o=n+c,h=o-n,a=n-(o-h)+(c-h),c=s[++_]),n=o,0!==a&&(r[u++]=a);for(;d<t;)o=n+l,h=o-n,a=n-(o-h)+(l-h),l=e[++d],n=o,0!==a&&(r[u++]=a);for(;_<i;)o=n+c,h=o-n,a=n-(o-h)+(c-h),c=s[++_],n=o,0!==a&&(r[u++]=a);return 0===n&&0!==u||(r[u++]=n),u}function Zr(t){return new Float64Array(t)}const Ur=Zr(4),Xr=Zr(8),Kr=Zr(12),qr=Zr(16),Jr=Zr(4);function Qr(t,e,i,s,r,n){const o=(e-n)*(i-r),a=(t-r)*(s-n),h=o-a,l=Math.abs(o+a);return Math.abs(h)>=33306690738754716e-32*l?h:-function(t,e,i,s,r,n,o){let a,h,l,c,d,_,u,p,g,m,f,b,y,w,x,v,S,C;const P=t-r,M=i-r,L=e-n,A=s-n;w=P*A,_=Hr*P,u=_-(_-P),p=P-u,_=Hr*A,g=_-(_-A),m=A-g,x=p*m-(w-u*g-p*g-u*m),v=L*M,_=Hr*L,u=_-(_-L),p=L-u,_=Hr*M,g=_-(_-M),m=M-g,S=p*m-(v-u*g-p*g-u*m),f=x-S,d=x-f,Ur[0]=x-(f+d)+(d-S),b=w+f,d=b-w,y=w-(b-d)+(f-d),f=y-v,d=y-f,Ur[1]=y-(f+d)+(d-v),C=b+f,d=C-b,Ur[2]=b-(C-d)+(f-d),Ur[3]=C;let k=function(t,e){let i=e[0];for(let s=1;s<t;s++)i+=e[s];return i}(4,Ur),I=22204460492503146e-32*o;if(k>=I||-k>=I)return k;if(d=t-P,a=t-(P+d)+(d-r),d=i-M,l=i-(M+d)+(d-r),d=e-L,h=e-(L+d)+(d-n),d=s-A,c=s-(A+d)+(d-n),0===a&&0===h&&0===l&&0===c)return k;if(I=11093356479670487e-47*o+Wr*Math.abs(k),k+=P*c+A*a-(L*l+M*h),k>=I||-k>=I)return k;w=a*A,_=Hr*a,u=_-(_-a),p=a-u,_=Hr*A,g=_-(_-A),m=A-g,x=p*m-(w-u*g-p*g-u*m),v=h*M,_=Hr*h,u=_-(_-h),p=h-u,_=Hr*M,g=_-(_-M),m=M-g,S=p*m-(v-u*g-p*g-u*m),f=x-S,d=x-f,Jr[0]=x-(f+d)+(d-S),b=w+f,d=b-w,y=w-(b-d)+(f-d),f=y-v,d=y-f,Jr[1]=y-(f+d)+(d-v),C=b+f,d=C-b,Jr[2]=b-(C-d)+(f-d),Jr[3]=C;const E=Yr(4,Ur,4,Jr,Xr);w=P*c,_=Hr*P,u=_-(_-P),p=P-u,_=Hr*c,g=_-(_-c),m=c-g,x=p*m-(w-u*g-p*g-u*m),v=L*l,_=Hr*L,u=_-(_-L),p=L-u,_=Hr*l,g=_-(_-l),m=l-g,S=p*m-(v-u*g-p*g-u*m),f=x-S,d=x-f,Jr[0]=x-(f+d)+(d-S),b=w+f,d=b-w,y=w-(b-d)+(f-d),f=y-v,d=y-f,Jr[1]=y-(f+d)+(d-v),C=b+f,d=C-b,Jr[2]=b-(C-d)+(f-d),Jr[3]=C;const T=Yr(E,Xr,4,Jr,Kr);w=a*c,_=Hr*a,u=_-(_-a),p=a-u,_=Hr*c,g=_-(_-c),m=c-g,x=p*m-(w-u*g-p*g-u*m),v=h*l,_=Hr*h,u=_-(_-h),p=h-u,_=Hr*l,g=_-(_-l),m=l-g,S=p*m-(v-u*g-p*g-u*m),f=x-S,d=x-f,Jr[0]=x-(f+d)+(d-S),b=w+f,d=b-w,y=w-(b-d)+(f-d),f=y-v,d=y-f,Jr[1]=y-(f+d)+(d-v),C=b+f,d=C-b,Jr[2]=b-(C-d)+(f-d),Jr[3]=C;const N=Yr(T,Kr,4,Jr,qr);return qr[N-1]}(t,e,i,s,r,n,l)}const tn=(t,e)=>t.x*e.y-t.y*e.x,en=(t,e)=>t.x*e.x+t.y*e.y,sn=(t,e,i)=>{const s=Qr(t.x,t.y,e.x,e.y,i.x,i.y);return s>0?-1:s<0?1:0},rn=t=>Math.sqrt(en(t,t)),nn=(t,e,i)=>{const s={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return tn(r,s)/rn(r)/rn(s)},on=(t,e,i)=>{const s={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return en(r,s)/rn(r)/rn(s)},an=(t,e,i)=>0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i},hn=(t,e,i)=>0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)};class ln{static compare(t,e){const i=ln.comparePoints(t.point,e.point);return 0!==i?i:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:dn.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let t=0,i=e.length;t<i;t++){const i=e[t];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const i=this.point.events[e];if(void 0===i.segment.consumedBy)for(let s=e+1;s<t;s++){const t=this.point.events[s];void 0===t.consumedBy&&(i.otherSE.point.events===t.otherSE.point.events&&i.segment.consume(t.segment))}}}getAvailableLinkedEvents(){const t=[];for(let e=0,i=this.point.events.length;e<i;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,i=i=>{const s=i.otherSE;e.set(i,{sine:nn(this.point,t.point,s.point),cosine:on(this.point,t.point,s.point)})};return(t,s)=>{e.has(t)||i(t),e.has(s)||i(s);const{sine:r,cosine:n}=e.get(t),{sine:o,cosine:a}=e.get(s);return r>=0&&o>=0?n<a?1:n>a?-1:0:r<0&&o<0?n<a?-1:n>a?1:0:o<r?-1:o>r?1:0}}}let cn=0;class dn{static compare(t,e){const i=t.leftSE.point.x,s=e.leftSE.point.x,r=t.rightSE.point.x,n=e.rightSE.point.x;if(n<i)return 1;if(r<s)return-1;const o=t.leftSE.point.y,a=e.leftSE.point.y,h=t.rightSE.point.y,l=e.rightSE.point.y;if(i<s){if(a<o&&a<h)return 1;if(a>o&&a>h)return-1;const i=t.comparePoint(e.leftSE.point);if(i<0)return 1;if(i>0)return-1;const s=e.comparePoint(t.rightSE.point);return 0!==s?s:-1}if(i>s){if(o<a&&o<l)return-1;if(o>a&&o>l)return 1;const i=e.comparePoint(t.leftSE.point);if(0!==i)return i;const s=t.comparePoint(e.rightSE.point);return s<0?1:s>0?-1:1}if(o<a)return-1;if(o>a)return 1;if(r<n){const i=e.comparePoint(t.rightSE.point);if(0!==i)return i}if(r>n){const i=t.comparePoint(e.rightSE.point);if(i<0)return 1;if(i>0)return-1}if(r!==n){const t=h-o,e=r-i,c=l-a,d=n-s;if(t>e&&c<d)return 1;if(t<e&&c>d)return-1}return r>n?1:r<n||h<l?-1:h>l?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,i,s){this.id=++cn,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=i,this.windings=s}static fromRing(t,e,i){let s,r,n;const o=ln.comparePoints(t,e);if(o<0)s=t,r=e,n=1;else{if(!(o>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);s=e,r=t,n=-1}const a=new ln(s,!0),h=new ln(r,!1);return new dn(a,h,[i],[n])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,i=this.rightSE.point,s=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;const r=(t.y-e.y)/s.y,n=e.x+r*s.x;if(t.x===n)return 0;const o=(t.x-e.x)/s.x,a=e.y+o*s.y;return t.y===a?0:t.y<a?-1:1}getIntersection(t){const e=this.bbox(),i=t.bbox(),s=Dr(e,i);if(null===s)return null;const r=this.leftSE.point,n=this.rightSE.point,o=t.leftSE.point,a=t.rightSE.point,h=Rr(e,o)&&0===this.comparePoint(o),l=Rr(i,r)&&0===t.comparePoint(r),c=Rr(e,a)&&0===this.comparePoint(a),d=Rr(i,n)&&0===t.comparePoint(n);if(l&&h)return d&&!c?n:!d&&c?a:null;if(l)return c&&r.x===a.x&&r.y===a.y?null:r;if(h)return d&&n.x===o.x&&n.y===o.y?null:o;if(d&&c)return null;if(d)return n;if(c)return a;const _=((t,e,i,s)=>{if(0===e.x)return hn(i,s,t.x);if(0===s.x)return hn(t,e,i.x);if(0===e.y)return an(i,s,t.y);if(0===s.y)return an(t,e,i.y);const r=tn(e,s);if(0==r)return null;const n={x:i.x-t.x,y:i.y-t.y},o=tn(n,e)/r,a=tn(n,s)/r;return{x:(t.x+a*e.x+(i.x+o*s.x))/2,y:(t.y+a*e.y+(i.y+o*s.y))/2}})(r,this.vector(),o,t.vector());return null===_?null:Rr(s,_)?jr.round(_.x,_.y):null}split(t){const e=[],i=void 0!==t.events,s=new ln(t,!0),r=new ln(t,!1),n=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(s);const o=new dn(s,n,this.rings.slice(),this.windings.slice());return ln.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),ln.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(s.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t<e;t++)this.windings[t]*=-1}consume(t){let e=this,i=t;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const s=dn.compare(e,i);if(0!==s){if(s>0){const t=e;e=i,i=t}if(e.prev===i){const t=e;e=i,i=t}for(let t=0,s=i.rings.length;t<s;t++){const s=i.rings[t],r=i.windings[t],n=e.rings.indexOf(s);-1===n?(e.rings.push(s),e.windings.push(r)):e.windings[n]+=r}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.rightSE.consumedBy=e.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,s=this._afterState.multiPolys;for(let t=0,s=this.rings.length;t<s;t++){const s=this.rings[t],r=this.windings[t],n=e.indexOf(s);-1===n?(e.push(s),i.push(r)):i[n]+=r}const r=[],n=[];for(let t=0,s=e.length;t<s;t++){if(0===i[t])continue;const s=e[t],o=s.poly;if(-1===n.indexOf(o))if(s.isExterior)r.push(o);else{-1===n.indexOf(o)&&n.push(o);const t=r.indexOf(s.poly);-1!==t&&r.splice(t,1)}}for(let t=0,e=r.length;t<e;t++){const e=r[t].multiPoly;-1===s.indexOf(e)&&s.push(e)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Sn.type){case"union":{const i=0===t.length,s=0===e.length;this._isInResult=i!==s;break}case"intersection":{let i,s;t.length<e.length?(i=t.length,s=e.length):(i=e.length,s=t.length),this._isInResult=s===Sn.numMultiPolys&&i<s;break}case"xor":{const i=Math.abs(t.length-e.length);this._isInResult=i%2==1;break}case"difference":{const i=t=>1===t.length&&t[0].isSubject;this._isInResult=i(t)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${Sn.type}`)}return this._isInResult}}class _n{constructor(t,e,i){if(!Array.isArray(t)||0===t.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const s=jr.round(t[0][0],t[0][1]);this.bbox={ll:{x:s.x,y:s.y},ur:{x:s.x,y:s.y}};let r=s;for(let e=1,i=t.length;e<i;e++){if("number"!=typeof t[e][0]||"number"!=typeof t[e][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let i=jr.round(t[e][0],t[e][1]);i.x===r.x&&i.y===r.y||(this.segments.push(dn.fromRing(r,i,this)),i.x<this.bbox.ll.x&&(this.bbox.ll.x=i.x),i.y<this.bbox.ll.y&&(this.bbox.ll.y=i.y),i.x>this.bbox.ur.x&&(this.bbox.ur.x=i.x),i.y>this.bbox.ur.y&&(this.bbox.ur.y=i.y),r=i)}s.x===r.x&&s.y===r.y||this.segments.push(dn.fromRing(r,s,this))}getSweepEvents(){const t=[];for(let e=0,i=this.segments.length;e<i;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class un{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new _n(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let e=1,i=t.length;e<i;e++){const i=new _n(t[e],this,!1);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const i=this.interiorRings[e].getSweepEvents();for(let e=0,s=i.length;e<s;e++)t.push(i[e])}return t}}class pn{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof t[0][0][0]&&(t=[t])}catch(t){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let e=0,i=t.length;e<i;e++){const i=new un(t[e],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,i=this.polys.length;e<i;e++){const i=this.polys[e].getSweepEvents();for(let e=0,s=i.length;e<s;e++)t.push(i[e])}return t}}class gn{static factory(t){const e=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];if(!s.isInResult()||s.ringOut)continue;let r=null,n=s.leftSE,o=s.rightSE;const a=[n],h=n.point,l=[];for(;r=n,n=o,a.push(n),n.point!==h;)for(;;){const t=n.getAvailableLinkedEvents();if(0===t.length){const t=a[0].point,e=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${t.x}, ${t.y}]. Last matching segment found ends at [${e.x}, ${e.y}].`)}if(1===t.length){o=t[0].otherSE;break}let i=null;for(let t=0,e=l.length;t<e;t++)if(l[t].point===n.point){i=t;break}if(null!==i){const t=l.splice(i)[0],s=a.splice(t.index);s.unshift(s[0].otherSE),e.push(new gn(s.reverse()));continue}l.push({index:a.length,point:n.point});const s=n.getLeftmostComparator(r);o=t.sort(s)[0].otherSE;break}e.push(new gn(a))}return e}constructor(t){this.events=t;for(let e=0,i=t.length;e<i;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let i=1,s=this.events.length-1;i<s;i++){const s=this.events[i].point,r=this.events[i+1].point;0!==sn(s,t,r)&&(e.push(s),t=s)}if(1===e.length)return null;const i=e[0],s=e[1];0===sn(i,t,s)&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,n=this.isExteriorRing()?0:e.length-1,o=this.isExteriorRing()?e.length:-1,a=[];for(let t=n;t!=o;t+=r)a.push([e[t].x,e[t].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){const t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let e=1,i=this.events.length;e<i;e++){const i=this.events[e];ln.compare(t,i)>0&&(t=i)}let e=t.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class mn{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const i=this.interiorRings[e].getGeom();null!==i&&t.push(i)}return t}}class fn{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,i=this.polys.length;e<i;e++){const i=this.polys[e].getGeom();null!==i&&t.push(i)}return t}_composePolys(t){const e=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];if(!s.poly)if(s.isExteriorRing())e.push(new mn(s));else{const t=s.enclosingRing();t.poly||e.push(new mn(t)),t.poly.addInterior(s)}}return e}}class bn{constructor(t,e=dn.compare){this.queue=t,this.tree=new Vr(e),this.segments=[]}process(t){const e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;const s=t.isLeft?this.tree.add(e):this.tree.find(e);if(!s)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r,n,o=s,a=s;for(;void 0===r;)o=this.tree.prev(o),null===o?r=null:void 0===o.key.consumedBy&&(r=o.key);for(;void 0===n;)a=this.tree.next(a),null===a?n=null:void 0===a.key.consumedBy&&(n=a.key);if(t.isLeft){let s=null;if(r){const t=r.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(s=t),!r.isAnEndpoint(t))){const e=this._splitSafely(r,t);for(let t=0,s=e.length;t<s;t++)i.push(e[t])}}let o=null;if(n){const t=n.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(o=t),!n.isAnEndpoint(t))){const e=this._splitSafely(n,t);for(let t=0,s=e.length;t<s;t++)i.push(e[t])}}if(null!==s||null!==o){let t=null;if(null===s)t=o;else if(null===o)t=s;else{t=ln.comparePoints(s,o)<=0?s:o}this.queue.remove(e.rightSE),i.push(e.rightSE);const r=e.split(t);for(let t=0,e=r.length;t<e;t++)i.push(r[t])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=r)}else{if(r&&n){const t=r.getIntersection(n);if(null!==t){if(!r.isAnEndpoint(t)){const e=this._splitSafely(r,t);for(let t=0,s=e.length;t<s;t++)i.push(e[t])}if(!n.isAnEndpoint(t)){const e=this._splitSafely(n,t);for(let t=0,s=e.length;t<s;t++)i.push(e[t])}}}this.tree.remove(e)}return i}_splitSafely(t,e){this.tree.remove(t);const i=t.rightSE;this.queue.remove(i);const s=t.split(e);return s.push(i),void 0===t.consumedBy&&this.tree.add(t),s}}const yn="undefined"!=typeof process&&void 0!==process.env?process.env:{},wn=yn.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,xn=yn.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;const vn=new class{run(t,e,i){vn.type=t,jr.reset();const s=[new pn(e,!0)];for(let t=0,e=i.length;t<e;t++)s.push(new pn(i[t],!1));if(vn.numMultiPolys=s.length,"difference"===vn.type){const t=s[0];let e=1;for(;e<s.length;)null!==Dr(s[e].bbox,t.bbox)?e++:s.splice(e,1)}if("intersection"===vn.type)for(let t=0,e=s.length;t<e;t++){const e=s[t];for(let i=t+1,r=s.length;i<r;i++)if(null===Dr(e.bbox,s[i].bbox))return[]}const r=new Vr(ln.compare);for(let t=0,e=s.length;t<e;t++){const e=s[t].getSweepEvents();for(let t=0,i=e.length;t<i;t++)if(r.insert(e[t]),r.size>wn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const n=new bn(r);let o=r.size,a=r.pop();for(;a;){const t=a.key;if(r.size===o){const e=t.segment;throw new Error(`Unable to pop() ${t.isLeft?"left":"right"} SweepEvent [${t.point.x}, ${t.point.y}] from segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] from queue.`)}if(r.size>wn)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(n.segments.length>xn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const e=n.process(t);for(let t=0,i=e.length;t<i;t++){const i=e[t];void 0===i.consumedBy&&r.insert(i)}o=r.size,a=r.pop()}jr.reset();const h=gn.factory(n.segments);return new fn(h).getGeom()}};var Sn=vn;const Cn=(t,...e)=>Sn.run("difference",t,e);class Pn{static ringArea(t){let e=0;for(let i=0;i<t.length;i++){const s=t[i],r=t[(i+1)%t.length];e+=s[0]*r[1]-r[0]*s[1]}return Math.abs(e/2)}static polygonArea(t){let e=this.ringArea(t[0]);for(let i=1;i<t.length;i++)e-=this.ringArea(t[i]);return e}static boundsIntersect(t,e){return t.h1<=e.h2&&t.h2>=e.h1&&t.v1<=e.v2&&t.v2>=e.v1}static subtract(t,e){if(0===t.length||0===e.length)return t;const i=e.map((t=>Di(t))).reduce(((t,e)=>({h1:Math.min(t.h1,e.h1),h2:Math.max(t.h2,e.h2),v1:Math.min(t.v1,e.v1),v2:Math.max(t.v2,e.v2)}))),s=[],r=[];for(const n of t){if(!this.boundsIntersect(Di(n),i)){s.push(n);continue}const t=Cn([n],e),o=Math.min(2e-4,.005*this.polygonArea(n)),a=t.filter((t=>this.polygonArea(t)>o));0!==a.length?(a.sort(((t,e)=>this.polygonArea(e)-this.polygonArea(t))),s.push(a[0]),r.push(...a.slice(1))):s.push(n)}return s.concat(r)}static union(t){return 0===t.length?[]:((t,...e)=>Sn.run("union",t,e))(t[0],...t.slice(1))}}const Mn="37630",Ln={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"},An={area:Mn,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"},kn={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"},In={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"},En={area:Mn,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"},Tn={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"},Nn={area:"AK",name:"Alaska",coord:[-119,6.4],frame:"0.5 0.5"},$n={area:"HI",name:"Hawaii",coord:[-126,21],frame:"0.5 0.5"},Vn={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 Rn{constructor(t){this.id=t}}class Dn extends Rn{constructor(t,e){super(t),this.props=e}}function On(t){const e=i(null==t?void 0:t.features)?t.features:"Feature"===(null==t?void 0:t.type)?[t]:[],s=[];return e.forEach((t=>{if("Feature"===t.type&&t.geometry){const e=new Dn(t.id,t.properties);switch(t.geometry.type){case"Polygon":e.polygon=t.geometry.coordinates,s.push(e);break;case"MultiPolygon":e.polygons=t.geometry.coordinates,s.push(e)}}})),s}class Bn extends Dn{constructor(t,e,i,s){super(t.id,t.props);const r=this.polygons=t.polygons.slice();if(this.holes=t.holes,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 Fn{constructor(t,e,s){this.name=t,this.closed=s,i(e)&&e.length>=2&&(this.border=[et.makeArray(e[0]),et.makeArray(e[1])])}}class zn extends Rn{constructor(t,e){super(t),this.polygon=e}}class jn extends gt{static createStockInset(t,i){let s,r=!1;switch(t){case"제주":case"제주도":s=Ln;break;case"제주_B":case"제주도_B":s=Ln,r=!0;break;case"울릉":case"울릉도":s=An;break;case"울릉_B":case"울릉도_B":s=An,r=!0;break;case"백령":case"백령도":s=kn;break;case"백령_B":case"백령도_B":s=kn,r=!0;break;case"읍면동_제주":case"읍면동_제주도":s=In;break;case"읍면동_제주_B":case"읍면동_제주도_B":s=In,r=!0;break;case"읍면동_울릉":case"읍면동_울릉도":s=En;break;case"읍면동_울릉_B":case"읍면동_울릉도_B":s=En,r=!0;break;case"읍면동_백령":case"읍면동_백령도":s=Tn;break;case"읍면동_백령_B":case"읍면동_백령도_B":s=Tn,r=!0;break;default:if(!t)return void console.warn("등록된 Inset 프리셋이 존재하지 않습니다.");switch(t.toLowerCase()){case"alaska":s=Nn;break;case"hawaii":s=$n;break;case"okinawa":s=Vn;break;case"okinawa_b":s=Vn,r=!0}}return s&&(o(i)?s=Object.assign({visible:i},s):e(i)&&(s=Object.assign({},s,i)),r&&s.border&&delete s.frame),s}constructor(t,s){var o,a,h;super(),this._excludes={};const l=null!==(o=t.source)&&void 0!==o?o:t.map,c=t.insets,d=i(c)?c:e(c)||r(c)?[c]:void 0;this.name=t.name,this.enabled=I(t.enabled,!0),this.idKey=t.idKey||"rm-id",this.nameKey=t.nameKey,this.parentKey=t.parentKey||"rm-parent",this.meta=e(null==l?void 0:l.meta)?et.deepClone(l.meta):{},this.dokdo=+t.dokdo,this.dummies=null===(a=this.meta.dummies)||void 0===a?void 0:a.slice(),this.paddings=q(String(null!==(h=t.padding)&&void 0!==h?h:"0")),this.useOffset=0===s?t.useOffset:void 0,this.alignArctic=!1!==t.alignArctic,this.bounds=i(t.bounds)&&4===t.bounds.length&&t.bounds.every(n)?t.bounds:void 0,this._excludes={},i(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={},d&&d.length>0&&d.forEach((t=>{var e,s;if(r(t)){const e=t.startsWith("-")?jn.createStockInset(t.substring(1),!1):jn.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:i(t.polygons)?t.polygons.slice():i(t.polygons)?[t.polygons]:void 0,scale:t.scale,coord:null===(e=t.coord)||void 0===e?void 0:e.slice(0,2),offset:null===(s=t.offset)||void 0===s?void 0:s.slice(0,2),border:i(t.border)?t.border.map((t=>t.slice(0,2))):t.border,frame:t.frame,visible:t.visible})})),this.borders=[],t.borders&&et.makeArray(t.borders).forEach((t=>{t.name&&this.borders.push(new Fn(t.name,t.border,!0===t.closed))})),l&&(this.internals=t.needInternal,this.externals=t.needExternal,this.items=this.$_load(l,t),this.$_processAreas(t))}included(t){return!this._excludes[t]}$_load(t,e){return this._doLoad(t,e)}$_itemId(t){var e;const i=I(null===(e=t.props)||void 0===e?void 0:e[this.idKey],t.id);return null==i?void 0:String(i)}$_processAreas(t){const s=i(t.areas)?t.areas:void 0,n=i(t.unions)?t.unions:void 0;if(!s&&!n)return;const o=this.items.filter((t=>t instanceof Dn)),a=t=>o.find((e=>this.$_itemId(e)===t)),h=[];if(null==s||s.forEach((t=>{r(t)||e(t)&&On(t).forEach((t=>{h.push(t),this.items.push(t)}))})),h.forEach((t=>{var e,i,s;const r=null===(e=t.props)||void 0===e?void 0:e[this.parentKey];if(null==r)return;if(!this.included(this.$_itemId(t)))return;const n=a(String(r));if(!n||n===t)return;const o=null!==(i=t.polygons)&&void 0!==i?i:t.polygon?[t.polygon]:[];0!==o.length&&(n.polygons=Pn.subtract(null!==(s=n.polygons)&&void 0!==s?s:[n.polygon],o),n.polygon=void 0,n.holes=!0,n.internal=n.internals=void 0,n.external=n.externals=void 0)})),n){const t=this.$_reservedAreas();n.forEach((e=>this.$_mergeAreas(e,t)))}}$_reservedAreas(){var t,e;const i=new Set;(null===(t=this.meta.dokdo)||void 0===t?void 0:t.group)&&i.add(this.meta.dokdo.group);for(const t in this.insets){const s=this.insets[t];s.area&&i.add(s.area),s.parent&&String(s.parent).split(",").forEach((t=>i.add(t.trim()))),null===(e=s.children)||void 0===e||e.forEach((t=>i.add(t)))}return i}$_mergeAreas(t,s){if(!e(t)||!i(t.members)||t.members.length<2)return void console.warn("unions의 각 항목은 2개 이상의 영역 id를 갖는 members가 지정된 객체여야 합니다.");const r=Array.from(new Set(t.members.map((t=>String(t))))),n=r.find((t=>s.has(t)));if(n)return void console.warn(`'${n}' 영역은 dokdo 또는 inset 설정에서 참조되고 있어 병합할 수 없습니다.`);const o=[];if(r.forEach((t=>{if(!this.included(t))return;const e=this.items.find((e=>e instanceof Dn&&this.$_itemId(e)===t));e?o.push(e):console.warn(`병합할 영역을 찾을 수 없습니다: ${t}`)})),o.length<2)return;const a=this.$_unionAreaId(t,o,s),h=new Dn(a,this.$_unionProps(t,a));h.polygons=Pn.union(o.map((t=>{var e;return null!==(e=t.polygons)&&void 0!==e?e:[t.polygon]}))),h.holes=!0,this.items[this.items.indexOf(o[0])]=h,o.slice(1).forEach((t=>{const e=this.items.indexOf(t);e>=0&&this.items.splice(e,1)}))}$_unionAreaId(t,e,i){const s=this.$_itemId(e[0]);if(null==t.id)return s;const r=String(t.id);return""===r.trim()||/\s/.test(r)?(console.warn(`병합 영역의 id는 비어있거나 공백을 포함할 수 없습니다: '${r}'`),s):i.has(r)?(console.warn(`'${r}'는 dokdo 또는 inset 설정에서 참조되고 있어 병합 영역의 id로 사용할 수 없습니다.`),s):this.items.some((t=>t instanceof Dn&&e.indexOf(t)<0&&this.$_itemId(t)===r))?(console.warn(`'${r}'는 이미 다른 영역이 사용하고 있어 병합 영역의 id로 사용할 수 없습니다.`),s):r}$_unionProps(t,e){const i=Object.assign({},t.properties);if(delete i["rm-main-area"],null!=t.center){const e=$i(t.center);Vi(e)?(i["ctr-lon"]=e[0],i["ctr-lat"]=e[1]):console.warn(`병합 영역의 center가 올바른 좌표가 아닙니다: ${t.center}`)}return i[this.idKey]=e,i}}class Gn{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 Hn=90,Wn=function(t,e){return t<-180?t=180-Math.abs(t)%180:t>180&&(t=t%180-180),t};class Yn extends Gn{constructor(){super(),this._rotation=[0,0],this._r=Hn,this.bounds={x1:-90,x2:Hn,y1:-90,y2:Hn},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=Wn(t))!==this._rotation[0]?(this._rotation[0]=t,!0):void 0)}get rotationY(){return this._rotation[1]}_setRotationY(t){return void 0!==t&&((t=Math.max(-90,Math.min(90,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;Wn(-90-t),Wn(90-t),Wn(90+e),Wn(-90+e),this._prevCoord=null}project(t){const[e,i]=this._rotate(t),s=i*y,r=[Math.cos(s)*Math.sin(e*y)*this._r,Math.sin(s)*this._r];return(e<-this._r||e>this._r)&&(r.outside=!0),r}backward(t){const e=t[0]/Hn,i=t[1]/Hn,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)/y,Math.asin(s&&i*n/s)/y];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]*y,i=(this._rotation[1]||0)*y,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]*y+e,h=t[1]*y,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)/y,Math.asin(u*n+d*o)/y]}_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 Zn extends jn{static loadMap(t,s){if(e(t)){const r=t.source;if(e(r)&&"Topology"===r.type&&e(r.objects)&&i(r.arcs))return new Zn(t,s);const n=t.map;if(e(n)&&"Topology"===n.type&&e(n.objects)&&i(n.arcs))return new Zn(t,s)}}_doLoad(t,s){const n=t=>t.map((t=>t.map((t=>t<0?p[~t].slice().reverse():p[t])).flat())),o=t=>t.map((t=>n(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=s.needInternal?Array(_.length):null,f=s.needExternal?Array(_.length):null;if(e(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 e=d[t].geometries;if(i(e)&&e.forEach((t=>{const e=new Dn(t.id,t.properties);switch(e.arcs=t.arcs,t.type){case"Polygon":e.polygon=n(t.arcs),g.push(e);break;case"MultiPolygon":e.polygons=o(t.arcs),g.push(e)}})),m){const t={},e={};i(s.excludeInternal)?s.excludeInternal.forEach((s=>{i(s)&&s.length>1?(e[s[0]+"-"+s[1]]="",e[s[1]+"-"+s[0]]=""):i(s)&&1===s.length?t[s[0]]="":r(s)&&(t[s]="")})):s.excludeInternal&&(t[String(s.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)}))}))}})),et.isNotEmpty(e)&&m.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in e&&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={},e={};i(s.excludeExternal)?s.excludeExternal.forEach((s=>{i(s)&&s.length>1?(e[s[0]+"-"+s[1]]="",e[s[1]+"-"+s[0]]=""):i(s)&&1===s.length?t[s[0]]="":r(s)&&(t[s]="")})):s.excludeExternal&&(t[String(s.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)}))}))}})),et.isNotEmpty(e)&&f.forEach((t=>{t.length>1&&t[0]+"-"+t[1]in e&&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 Dn&&(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 zn(r.name,e))}}e.push(...s)}}function Un(t,e){const{atan2:i,cos:s,sin:r,sqrt:n}=Math,o=t[1]*y,a=t[0]*y,h=e[1]*y,l=e[0]*y,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/y,p/y])}}return m}function Xn(t,e){const s=t._base,n=t.off;let o,a,h=[0,0],l=e;if(s){if(0===s.length)return void console.warn("적용할 수 없는 inset입니다: "+t.area+", "+t.children);s[0]instanceof Jn?o=s:s[0]>=0&&(l=e.readBounds(s),h=n||h)}if(r(t.frame)&&t.frame.length>0){const e=q(t.frame);let{h1:i,v1:s,h2:r,v2:a}=o?o[0]:l;if(o)for(let t=1;t<o.length;t++)i=_(i,o[t].h1),s=_(s,o[t].v1),r=u(r,o[t].h2),a=u(a,o[t].v2);const c=i+h[0]-e.l,d=r+h[0]+e.r,p=a+h[1]+e.t,g=s+h[1]-e.b;t.box=[[c,p],[d,p],[d,g],[c,g]],t.bounds=n?{h1:c-n[0],h2:d-n[0],v1:g-n[1],v2:p-n[1]}:{h1:c,h2:d,v1:g,v2:p}}else if(a=t.border){let e,c;if(r(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=_(t,o[e].h1),i=_(i,o[e].v1),s=u(s,o[e].h2),r=u(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 i(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}s&&s[0]>=0?t.bounds={h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}:t.bounds=n?{h1:l.h1-n[0],h2:l.h2-n[0],v1:l.v1-n[1],v2:l.v2-n[1]}:{h1:l.h1,h2:l.h2,v1:l.v1,v2:l.v2}}}const Kn=Math.min,qn=Math.max;class Jn extends gt{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=Kn(i,t[0]+e[0]),s=qn(s,t[0]+e[0]),r=Kn(r,t[1]+e[1]),n=qn(n,t[1]+e[1])})),this.h1=i,this.h2=s,this.v1=r,this.v2=n}$_readInset(t,e){const s=t.coord,r=t.offset;let n=[0,0];return i(s)&&s.length>0&&(n[0]=isNaN(s[0])?0:+s[0]-e.h1,n[1]=isNaN(s[1])?0:+s[1]-e.v1),i(r)&&r.length>0&&(n[0]+=A(r[0],0),n[1]+=A(r[1],0)),t.off=n}$_toPath(t,e,i,s){var r;if(null===(r=this.source)||void 0===r?void 0:r.holes){let r="";for(const n of e)r+=this.$_ringToPath(t,n,i,s);return r}return this.$_ringToPath(t,e[0],i,s)}$_ringToPath(t,e,i,s){const r=t.isGlobe,n=e.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=Kn(o,i[0]),a=qn(a,i[0]),h=Kn(h,i[1]),l=qn(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=Un(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){Un(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=Kn(e,t[0]),i=qn(i,t[0]),s=Kn(s,t[1]),r=qn(r,t[1])}));else(this.source.polygons||[this.source.polygon]).forEach((t=>{t[0].forEach((t=>{e=Kn(e,t[0]),i=qn(i,t[0]),s=Kn(s,t[1]),r=qn(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=Kn(e,t[0]),i=qn(i,t[0]),s=Kn(s,t[1]),r=qn(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=Kn(t,e[0]),i=Kn(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,Ti)}))}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Ti))):this.$_readBound(this.source.polygon,Ti),s=this.$_readInset(e,this)}else this.source.polygons?this.source.polygons.forEach((t=>this.$_readBound(t,Ti))):this.$_readBound(this.source.polygon,Ti);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,Ti)}))):(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?Ti:s),e.externals&&this.$_readExternal(t,this._insetChilds?Ti: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 Jn;return t.source=this.source,t.id=this.id,t.name=this.name,t.center=this.center,t}}class Qn extends gt{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 to extends gt{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 to)?this.$_copy(e):this.$_load(e),this._mapAreaFinder=new Er({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,i(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 Zn&&this.source.internals}get hasExternals(){return this.source instanceof Zn&&this.source.externals}get hasBorders(){return this.source instanceof Zn&&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&&Ri(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 Yn)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=Hn,this.y2=Hn;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=Kn(i,c.h1),s=qn(s,c.h2),r=Kn(r,c.v1),n=Kn(90,qn(n,c.v2)),o=Kn(o,c.x1),a=qn(a,c.x2),h=Kn(h,c.y1),l=qn(l,c.y2),this.$_updateMainAreaBounds(c))})),this.source instanceof jn){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=qn(-180,i),this.v1=qn(-90,r),this.h2=Kn(180,s),this.v2=Kn(90,n),this.x1=o,this.y1=h,this.x2=a,this.y2=l;const c=this.source instanceof jn?this.source.bounds:void 0;c&&4===c.length?this.$_setBoundsByOption(c,t):this.$_hasArea()?this._world=this.h1<=-180&&this.h2>=180:this.$_setBoundaryByWorld(t),this.cx=this.x1+(this.x2-this.x1)/2,this.cy=this.y1+(this.y2-this.y1)/2}for(const e in this._borders)this._borders[e].readPath(t)}$_hasArea(){return 0!==this._areas.length}$_setBoundaryByWorld(t){this.h1=-180,this.v1=-90,this.h2=180,this.v2=90;const e=t.project([this.h1,this.v2]),i=t.project([this.h2,this.v1]),s=t.project([this.h1,this.v1]),r=t.project([this.h2,this.v2]);this.x1=Math.min(e[0],i[0],s[0],r[0]),this.x2=Math.max(e[0],i[0],s[0],r[0]),this.y1=Math.min(e[1],i[1],s[1],r[1]),this.y2=Math.max(e[1],i[1],s[1],r[1]),this._world=!0}$_setBoundsByOption(t,e){let i=t[0],s=t[1],r=t[2],n=t[3],o=e.project([i,n]),a=e.project([r,s]),h=e.project([i,s]),l=e.project([r,n]);if([o,a,h,l].every((t=>function(t){if(!t)return!1;const e=isFinite(t[0]+t[1]),i=-180<=t[0]&&t[0]<=180,s=-90<=t[1]&&t[1]<=90;return e&&i&&s}(t))))this.h1=i,this.v1=s,this.h2=r,this.v2=n;else{if(this.$_hasArea())return;this.$_setBoundaryByWorld(e)}this.x1=Math.min(o[0],a[0],h[0],l[0]),this.x2=Math.max(o[0],a[0],h[0],l[0]),this.y1=Math.min(o[1],a[1],h[1],l[1]),this.y2=Math.max(o[1],a[1],h[1],l[1]),this._world=t[0]<=-180&&t[2]>=180}$_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=Kn(t.mainLandBounds.x1,o.x1),t.mainLandBounds.x2=qn(t.mainLandBounds.x2,o.x2),t.mainLandBounds.y1=Kn(t.mainLandBounds.y1,o.y1),t.mainLandBounds.y2=qn(t.mainLandBounds.y2,o.y2)}t.mainLandBounds||(t.mainLandBounds=n)}$_resolveAreaName(t,e){const i=t.source;if(i)for(const s of e)if(t.name=I(i.props[s],i[s]),void 0!==t.name)break}_relocalizeAreas(){var t;let e=this.source;for(;e instanceof to;)e=e.source;if(!e.nameKey){const t=zt(this.owner.general.prop("locale")).nameKeys;this._areas.forEach((e=>this.$_resolveAreaName(e,t)))}null===(t=this.sibling)||void 0===t||t._relocalizeAreas()}$_load(t){const e=t.insets,s=t.idKey,r=t.nameKey?[t.nameKey]:zt(this.owner.general.prop("locale")).nameKeys,o=t.meta.dokdo,a=t.dummies,h=this._areas=[],l=this._areaMap={},c=this._borders={},d=this._insets=[];this._useOffset=t.useOffset,Object.values(e).forEach((t=>{delete t._base,delete t._parent,delete t._area})),t.items.forEach((i=>{if(i instanceof Dn){const n=I(i.props[s],i.id);if(n&&t.included(n)){const t=e[n],s=new Jn(i,t);t&&(delete e[n],t._area=s,d.push(t)),a&&a.indexOf(n)>=0?(h.unshift(s),s.dummy=!0):h.push(s),l[s.id=n]=s,this.$_resolveAreaName(s,r)}}else if(i instanceof zn){const t=new Qn(i);c[t.source.id]=t}}));for(const t in e){const s=e[t];if(s._parent=s.parent,s.parent&&(n(s.polygons)||i(s.polygons)))if(s.parent.indexOf(",")>=0){const t=s.parent.split(/[\s,]+/g);for(let e=0;e<t.length;e++){const r=l[t[e]];if(r){const n=s.polygons[e];r.inset=s,r._insetChilds=i(n)?n:[n],s._parent=t[e],s._base=r._insetChilds,s._area=r,d.push(s);break}}}else{const t=l[s.parent];t&&(t.inset=s,t._insetChilds=i(s.polygons)?s.polygons:[s.polygons],s._base=t._insetChilds,s._area=t,d.push(s))}else if(i(s.children)){const t=s._base=[],e=s.off?s.off.slice():[0,0],r=s._children=[];if(i(s.coord)){let t=1/0,i=1/0;for(const e of s.children){const s=l[e];if(!s)continue;const r=s.readBounds();t=Kn(t,r.h1),i=Kn(i,r.v1)}isNaN(s.coord[0])||(e[0]=s.coord[0]-t),isNaN(s.coord[1])||(e[1]=s.coord[1]-i)}for(const i of s.children){const s=l[i];if(s){const n=s.inset={area:i,offset:e};t.push(s),n._area=s,r.push(n)}}d.push(s)}}if(o&&!isNaN(+t.dokdo)){const e=l[o.group];if(e){const s=+t.dokdo;if(e.source=new Bn(e.source,s,+o.index,+o.parent),0===s){const t=+o.index;for(const e of d)if(e._parent===o.group&&i(e._base)){const i=e._base;i.indexOf(t)>=0&&(e._base=i.filter((e=>e!==t)))}}}}this.reset(),d.forEach((t=>Xn(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 to(this.owner,this,this._index)),this}_internalAreas(){return this._areas}}class eo extends mi{getText(t){return et.isValidNum(t)?this._getText(null,t,p(t)>1e3,!0):t}getDefaultIconPos(){return"left"}}eo.defaults=ci(Mi.defaults,{offset:4});class io extends Mi{_doInit(t){super._doInit(t),this._label=this._addChild("label",new eo(this.chart))}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}}io.defaults=ci(Mi.defaults,{visible:!1});class so extends ui{getItemGap(){var t;return null!==(t=this.prop("itemGap"))&&void 0!==t?t:so.ITEM_GAP}}so.ITEM_GAP=4,so.defaults=ci(ui.defaults,{offsetX:8,offsetY:8,itemGap:3});class ro extends so{get vertical(){return"vertical"===this.prop("direction")}getButtonSize(){var t,e,i,s;return{width:null!==(e=null!==(t=this.prop("buttonWidth"))&&void 0!==t?t:this.prop("buttonHeight"))&&void 0!==e?e:ro.BUTTON_SIZE,height:null!==(s=null!==(i=this.prop("buttonHeight"))&&void 0!==i?i:this.prop("buttonWidth"))&&void 0!==s?s:ro.BUTTON_SIZE}}getZoomFactor(){var t;return null!==(t=this.prop("zoomFactor"))&&void 0!==t?t:5}_isVisible(){return super._isVisible()&&this.chart.zoomable(!1)&&(this.chart.body.isZoomed||this.prop("showAlways"))}}ro.BUTTON_SIZE=24,ro.defaults=ci(so.defaults,{direction:"vertical",align:"left",verticalAlign:"bottom",zoomFactor:20,buttonWidth:28,buttonHeight:28,showReset:!0,showAlways:!0});class no extends so{_isVisible(){return super._isVisible()&&this.chart.isDrilldowned}}no.defaults=ci(so.defaults,{type:"text",align:"left",verticalAlign:"top"});class oo extends gt{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 ao extends ui{isVisible(){return this.visible&&!O(this.prop("text"))}_doSetSimple(t,e){return r(e)?(t.text=e,!0):super._doSetSimple(t,e)}}ao.defaults=ci(ui.defaults,{text:"Title",alignBase:"map",align:"center",verticalAlign:"middle",gap:10});class ho extends ao{}ho.defaults=ci(ao.defaults,{position:"bottom",text:"",titleGap:2,verticalAlign:"bottom"});class lo extends ui{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=I(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 r(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?Te.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)}}lo.defaults=ci(ui.defaults,{scope:"hover",offset:8,hideDelay:700,minWidth:100,minHeight:25,nanText:"",numberFormat:",#.##",timeFormat:"yyyy-MM-dd",mode:"line"});const co="chart";class _o extends Hi{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=xt.getFormatter(e[2]).toStr(String(i));break;case"d":if(r(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=Te.getFormatter(e[2]).toStr(t))}else if(e.length>2){const t=+i;isNaN(t)?i&&(i=xt.getFormatter(e[2]).toStr(String(i))):i=Te.getFormatter(e[2]).toStr(t)}return i||""}_isVisible(){return this.prop("visible")&&!B(this._op.html)}_doSetSimple(t,e){return r(e)?(t.html=e,!0):super._doSetSimple(t,e)}_doPrepareRender(t,e){super._doPrepareRender(t,e);const i=e.params;this._params=Object.assign({},et.isObject(i)?i:null,this._userParams),this._paramCallback=s(i)?i:null}}_o.type="html",_o.defaults=ci(Hi.defaults,{});class uo extends Hi{_isVisible(){return this.prop("visible")&&!B(this._op.imageUrl)}_doSetSimple(t,e){return r(e)?(t.imageUrl=e,!0):super._doSetSimple(t,e)}}uo.type="image",uo.defaults=ci(Hi.defaults,{});class po extends Hi{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||po.defaults.shape}_doSetSimple(t,e){return r(e)?(t.shape=e,!0):super._doSetSimple(t,e)}}po.type="shape",po.defaults=ci(Hi.defaults,{width:64,height:64,shape:"square"});class go extends Hi{constructor(){super(...arguments),this._domain={callback:(t,e)=>this.chart.getParam(t,e)}}_isVisible(){return this.prop("visible")&&!B(this._op.text)}_doSetSimple(t,e){return r(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?Te.getFormatter(i):void 0),function(t){t!==e._timeFormat&&(e._timeFormat=t,e._domain.timeFormatter=t?Xe.getFormatter(t):void 0)}(t.timeFormat)}}go.type="text",go.defaults=ci(Hi.defaults,{text:"Text"});class mo extends Gn{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 fo=1.340264,bo=-.081106,yo=893e-6,wo=.003796,xo=Math.sqrt(3)/2,vo=74.03120656864502;class So extends Gn{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=y,i=Math.asin(xo*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)*vo/(xo*(fo+3*bo*s+r*(7*yo+9*wo*s))),i*vo*(fo+bo*s+r*(yo+wo*s))]}backward(t){const e=t[0]/vo,i=t[1]/vo,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*(fo+bo*r+n*(yo+wo*r))-i,a=fo+3*bo*r+n*(7*yo+9*wo*r),l-=h=o/a,!(Math.abs(h)<1e-9));++t);r=l*l,n=r*r*r;const c=s*xo*e*(fo+3*bo*r+n*(7*yo+9*wo*r))/Math.cos(l),d=s*Math.asin(Math.sin(l)/xo);return Math.abs(c)>180?[NaN,NaN]:[c-this.offset[0],d-this.offset[1]]}}const Co=63.78137,Po=Math.PI/180;class Mo extends Gn{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*Po);return[Co*(t[0]+this.offset[0]-this.scroll)*Po,Co*Math.log((1+i)/(1-i))/2]}backward(t){return[(t[0]-this.offset[0])/(Co*Po),(2*Math.atan(Math.exp((t[1]-this.offset[1])/Co))-Math.PI/2)/Po]}}const Lo=Math.PI/4,Ao=Math.PI/180,ko=63.78137;class Io extends Gn{project(t){return[(t[0]+this.offset[0]-this.scroll)*Ao*ko,79.7267125*Math.log(Math.tan(Lo+.4*(t[1]+this.offset[1])*Ao))]}backward(t){return[(t[0]-this.offset[0])/ko/Ao,2.5*(Math.atan(Math.exp((t[1]-this.offset[1])/ko*.8))-Lo)/Ao]}}class Eo extends Fs{labelCount(){return 2}}class To extends bs{}To.defaults=ci(bs.defaults,{visible:!1});class No extends zs{_doInit(t){super._doInit(t),this._subLabel=this._addChild("subLabel",new To(this.chart))}get subLabel(){return this._subLabel}get reversed(){return"reverse"===this.prop("barOrder")}getFieldColors(){return this._fieldColors}getSubLabelOff(){return A(this._subLabel.prop("offset"),0)}pointLabelCount(){return this._subLabel.visible?2:1}getPointLabels(){return[this.pointLabel,this.subLabel]}_createPoint(t){return new Eo(t)}_defLabelOff(){return this.$_isLabelCenter()?No.LABEL_OFFSET_CENTER:No.LABEL_OFFSET_AUTO}_createLegendMarker(t,e){return as.create(t,Ei,0,0,e,e,2)}setCalcedColor(t,e){if(super.setCalcedColor(t,e),this._fieldColors=void 0,this.prop("colorByField")&&!this._categories){const t=this.prop("fieldColors");i(t)?this._fieldColors=t:this._fieldColors=this._splitColors()}}$_isLabelCenter(){return"center"===this.pointLabel.prop("position")}}No.LABEL_OFFSET_CENTER=0,No.LABEL_OFFSET_AUTO=2,No.type="bar",No.defaults=ci(zs.defaults,{barWidth:.7,overflow:!1,barOrder:"normal",colorByField:!0});class $o extends ui{constructor(t){super(t.chart),this.gauge=t}}class Vo extends $o{}Vo.defaults=ci(ui.defaults,{visible:!1});class Ro extends $o{_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Ro.defaults=ci(ui.defaults,{});class Do extends $o{getThickness(t){return U(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Do.defaults=ci(ui.defaults,{thickness:"100%",stroked:!1});class Oo extends $o{getExtents(t){return{radius:U(this._radiusDim,t,0),length:U(this._lengthDim,t,0),offset:U(this._offsetDim,t,0)}}_doApply(t){super._doApply(t),this._setDims(t,"radius","length","offset")}}Oo.defaults=ci(ui.defaults,{visible:!1,radius:3,length:"100%",offset:0});class Bo extends $o{getRadius(t){return U(this._radiusDim,t,0)}_doApply(t){super._doApply(t),this._setDim(t,"radius")}}Bo.defaults=ci(ui.defaults,{visible:!1,radius:5});class Fo extends gi{constructor(){super(...arguments),this._domain={callback:(t,e)=>"target.getParam(param)"}}getOffset(t,e){return{x:U(this._offsetXDim,t,0),y:U(this._offsetYDim,e,0)}}_doApply(t){super._doApply(t),this._setDims(t,"offsetX","offsetY")}}Fo.defaults=ci(gi.defaults,{offsetX:0,offsetY:0,numberFormat:"#0.0"});class zo{constructor(){this.setCenterX(Go.DEF_CENTER),this.setCenterY(Go.DEF_CENTER),this.setRadius(Go.DEF_RADIUS),this.setInnerRadius(Go.DEF_INNER)}centerX(){return this._centerX}setCenterX(t){t!==this._centerX&&(this._centerX=t,this._centerXDim=Z(I(t,Go.DEF_CENTER),!0))}centerY(){return this._centerY}setCenterY(t){t!==this._centerY&&(this._centerY=t,this._centerYDim=Z(I(t,Go.DEF_CENTER),!0))}radius(){return this._radius}setRadius(t){t!==this._radius&&(this._radius=t,this._radiusDim=Z(I(t,Go.DEF_RADIUS),!0))}innerRadius(){return this._innerRadius}setInnerRadius(t){t!==this._innerRadius&&(this._innerRadius=t,this._innerDim=Z(I(t,Go.DEF_INNER),!0))}valueRadius(){return this._valueRadius}setValueRadius(t){t!==this._valueRadius&&(this._valueRadius=t,this._valueDim=Z(t,!0))}getCenter(t,e){return{x:U(this._centerXDim,t,t/2),y:U(this._centerYDim,e,e/2)}}getExtents(t){const e=U(this._radiusDim,t,t/2),i=_(e,this._innerDim?U(this._innerDim,e):0),s=i+(e-i)/2;return{radius:e,inner:i,value:this._valueDim?U(this._valueDim,s):s,radiusThick:e-i}}prepareAngles(t,e){const i=A(t%360,0),s=u(0,_(360,A(e,360)));this._startRad=b+y*i,this._handRad=y*i,this._sweepRad=y*s}}class jo extends js{_readObject(t,e){super._readObject(t,e)}}class Go extends Hs{_doInit(t){super._doInit(t),this._face=this._addChild("face",new Vo(this)),this._rim=this._addChild("rim",new Ro(this)),this._valueRim=this._addChild("valueRim",new Do(this)),this._hand=this._addChild("hand",new Oo(this)),this._pin=this._addChild("pin",new Bo(this)),this._gaugeLabel=this._addChild("gaugeLabel",new Fo(this.chart)),this._props=new zo}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 jo(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.prop("startAngle"),this.prop("sweepAngle"))}}Go.DEF_CENTER="50%",Go.DEF_RADIUS="50%",Go.DEF_INNER="80%",Go.type="gauge",Go.defaults=ci(Hs.defaults,{startAngle:0,sweepAngle:360,clockwise:!0});class Ho extends ui{constructor(t){super(t.chart),this.gauge=t}}class Wo extends Ho{getThickness(t){return U(this._thicknessDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"thickness")}}Wo.defaults=ci(ui.defaults,{thickness:3});class Yo extends Ho{getLength(t){return U(this._lengthDim,t,t)}_doApply(t){super._doApply(t),this._setDim(t,"length")}}Yo.defaults=ci(ui.defaults,{thickness:1.5,length:"55%"});class Zo extends Yo{}Zo.defaults=ci(Yo.defaults,{thickness:1,length:"80%"});class Uo extends Yo{}Uo.defaults=ci(Yo.defaults,{thickness:1,length:"90%",animatable:!1,duration:200});class Xo extends Ho{}Xo.defaults=ci(ui.defaults,{length:5});class Ko extends Ho{}Ko.defaults=ci(ui.defaults,{step:1,offset:0});class qo extends Ho{}qo.defaults=ci(ui.defaults,{radius:4});class Jo extends gi{}Jo.defaults=ci(gi.defaults,{text:"RealMap",position:"top"});class Qo extends js{getTime(){const t=this.time;return t instanceof Date?t:r(t)?new Date(t):isNaN(t)?void 0:new Date(t)}_readObject(t,e){super._readObject(t,e),this.time=A(e.time,NaN),this.timezone=A(e.timezone,NaN)}}class ta extends Gs{_doInit(t){super._doInit(t),this._face=this._addChild("face",new ui(this.chart)),this._rim=this._addChild("rim",new Wo(this)),this._hourHand=this._addChild("hourHand",new Yo(this)),this._minuteHand=this._addChild("minuteHand",new Zo(this)),this._secondHand=this._addChild("secondHand",new Uo(this)),this._tick=this._addChild("tick",new Xo(this)),this._tickLabel=this._addChild("tickLabel",new Ko(this)),this._pin=this._addChild("pin",new qo(this)),this._gaugeLabel=this._addChild("gaugeLabel",new Jo(this.chart))}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=_(t,e)*i;return{cx:U(this._centerXDim,t,t/2),cy:U(this._centerYDim,e,e/3),rd:U(this._radiusDim,s,s/2)}}_createPoint(t){return new Qo(t)}_doApply(t){const e=this;super._doApply(t),function(t,i,s){(e._centerXDim||t!==e._centerX)&&(e._centerXDim=Z(I(e._centerX=t,ta.DEF_CENTER),!0)),e._centerYDim&&i===e._centerY||(e._centerYDim=Z(I(e._centerY=i,ta.DEF_CENTER),!0)),e._radiusDim&&s===e._radius||(e._radiusDim=Z(I(e._radius=s,ta.DEF_RADIUS),!0))}(t.centerX,t.centerY,t.radius)}}ta.DEF_CENTER="50%",ta.DEF_RADIUS="50%",ta.type="clock",ta.defaults=ci(Gs.defaults,{centerX:ta.DEF_CENTER,centerY:ta.DEF_CENTER,radius:ta.DEF_RADIUS,active:!0,size:70});class ea extends Vs{_readObject(t,e){super._readObject(t,e),this.figure=e.figure}}class ia extends ui{getSize(){return{width:this.prop("width"),height:this.prop("height")}}}ia.defaults=ci(ui.defaults,{});class sa extends $s{_doInit(t){super._doInit(t),this._innerLabel=this._addChild("innerLabel",new bs(this.chart)),this._innerImage=this._addChild("innerImage",new ia(this.chart))}get innerLabel(){return this._innerLabel}get innerImage(){return this._innerImage}get path(){return this.prop("figure")}get figureBox(){return this._figureBox}getFigureSize(){const t=this._figureBox;let e=this.prop("width"),i=this.prop("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(this.prop("figureBox"))}_createPoint(t){return new ea(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(i(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]}}sa.type="figure",sa.defaults=ci($s.defaults,{position:"top"});class ra extends Ts{_readObject(t,e){super._readObject(t,e)}}class na extends bs{}na.defaults=ci(Is.defaults,{visible:!1});class oa extends Ns{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 na(t)}_createPoint(t){return new ra(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({},et.isObject(i)?i:null,this._userParams),this._paramCallback=s(i)?i:null}$_apply(t,e){const i=e.split(";");let s=I(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=xt.getFormatter(i[2]).toStr(String(s));break;case"d":if(r(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=Te.getFormatter(i[2]).toStr(t))}else if(i.length>2){const t=+s;isNaN(t)?s&&(s=xt.getFormatter(i[2]).toStr(String(s))):s=Te.getFormatter(i[2]).toStr(t)}return s||""}}oa.DEF_SIZE=100,oa.type="html",oa.defaults=ci(Is.defaults,{position:"center"});class aa extends bs{}aa.defaults=ci(bs.defaults,{visible:!1});class ha extends gs{_readObject(t,e){super._readObject(t,e),this.imageUrl=e.imageUrl||t._imageFielder(e)}}class la extends Is{getUrl(t){return this._root+t.imageUrl}_createLabel(t){return new aa(t)}_createPoint(t){return new ha(t)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._root=this.prop("rootUrl")||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}}la.type="image",la.defaults=ci(Is.defaults,{imageWidth:24,imageHeight:24,position:"top"});class ca extends ie{constructor(t,e){super(t,Ei),this.add(this._area=new oe(t)),this._area.internalSetStyle("opacity","0.2"),this.add(this._line=new oe(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 da extends Fs{}class _a extends ui{}_a.defaults=ci(zs.defaults,{visible:!1});class ua extends zs{_doInit(t){super._doInit(t),this._addChild("area",this._area=new _a(this.chart))}get area(){return this._area}_createPoint(t){return new da(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new ca(t,e)}}ua.type="line",ua.defaults=ci(zs.defaults,{});class pa extends Ts{_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){if(this.area){const e="name"===t?this.area.name:this.area.source.props[t];return I(super.getParam(t),e)}return super.getParam(t)}setSelected(t){super.setSelected(t),this.area&&this.area.setSelected(t)}}class ga extends ui{}ga.defaults=ci(ui.defaults,{enabled:!0,autoMapChange:!0});class ma extends ui{constructor(t,e){super(e.chart),this.name=t,this.series=e}getPath(){return this.border.path}_doSetSimple(t,e){return r(e)?(t.name=e,!0):super._doSetSimple(t,e)}}ma.defaults=ci(ui.defaults,{});class fa extends ui{constructor(t,e){super(e.chart),this.name=t,this.series=e}}fa.defaults=ci(ui.defaults,{visible:!1});class ba extends mi{constructor(t){super(t),this._args={chart:t,inset:null}}getInsetText(t){var e;const i=this._op;let r=null!==(e=this._op.text)&&void 0!==e?e:t.name;if(s(i.textCallback)){this._args.inset=t;const e=i.textCallback(this._args);null!=e&&(r=e)}return r}getInsetLabelStyle(t){if("function"==typeof this._op.styleCallback)return this._args.inset=t,this._op.styleCallback(this._args)}hideInsetLabel(t){if(s(this._op.visibleCallback))return this._args.inset=t,!1===this._op.visibleCallback(this._args)}isVisible(){return this.visible}getDefaultIconPos(){return"top"}}ba.defaults=ci(mi.defaults,{visible:void 0});class ya extends bs{}ya.defaults=ci(bs.defaults,{visible:!1,hoverColor:"white"});class wa extends Ns{constructor(){super(...arguments),this._areaPts=new Map}_doInit(t){super._doInit(t),this._drilldown=this._addChild("drilldown",new ga(this.chart)),this._insetLabel=this._addChild("insetLabel",new ba(this.chart)),this._internalBorder=this._addChild("internalBorder",new fa(null,this)),this._externalBorder=this._addChild("externalBorder",new fa(null,this))}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)}_positionsByCoord(){return!1}_inspect(){const t=super._inspect(),e=[];let i=0;return this._points.forEach((t=>{var s,r;t.area?++i:e.length<20&&e.push(String(null!==(r=null!==(s=t.id)&&void 0!==s?s:t.name)&&void 0!==r?r:""))})),t.bound=i,t.rendered=i,t.hasData&&(t.unbound=e),t}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 pa||(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 ya(t)}$_createDetail(){return this._detail||(this._detail=new wa(this.chart),this._addChild("detail",this._detail),this._detail._parent=this),this._detail}_doLoad(t,i){super._doLoad(t,i),e(i.detail)&&this.$_createDetail().loadOptions(i.detail)}_doApply(s){if(this.getDetailed()||(e(s.detail)?this.$_createDetail()._doApply(s.detail):s.hasOwnProperty("detail")&&(this._detail=null)),super._doApply(s),t.call(s,"mapBorders")){const t=s.mapBorders;t!==this._saveBorders&&(this._saveBorders=t,this.$_loadBorders(i(t)?t:[t]))}}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 pa(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,s){var n;super._doPrepareRender(t,s);const o=this._map,a=this._visPoints,{min:h,max:l}=this._calcMinMax(a),c=this._areaMap,d=r(s.hiddenAreas)?[s.hiddenAreas]:i(s.hiddenAreas)?s.hiddenAreas:null,_=this._mapBorders;if(this._hiddenAreas={},d&&c)for(const t of s.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,e(s.colorRange)){const t=g(s.colorRange);isNaN(t.minValue)&&(t.minValue=h),isNaN(t.maxValue)&&(t.maxValue=l),this._colorRanger=new ir(t)}else this._colorRanger=null===(n=t.getColorScale(this.getColorScale()))||void 0===n?void 0:n.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,s=(i(t)?t[0]:t)||"id",r=(i(t)?t.length>1?t[1]:t[0]:t)||"id",n="id"===r,o=this._areaMap=e.getAreaMap(s),a=this._areaPts;a.clear(),this._points.forEach((t=>{const e=t;e.area=n?o[e[r]]:o[e.source[r]],e.area&&a.set(e.area.id,e)}))}}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new nt(this._calcedColor)}getColorScale(){return this._op.colorScale}canSelect(){return this._op.selectable}select(t,e=!0){t&&this.chart.selection.add(this,[t],e)}selectList(t){const e=t.filter(Boolean);for(const t of e)t.setSelected(!0);this.chart._selectionChanged(this,e)}isEmpty(t){return 0===this.map.areaCount}$_loadBorders(t){const e=this._mapBorders=[];t.forEach((t=>{const i=new ma(t.name,this);i.init(),i.loadOptions(t),e.push(i)}))}}wa.type="map",wa.defaults=ci(Ns.defaults,{allAreas:!0,selectable:!1,nullHovering:!1,detailZoom:250,legend:-1});class xa extends bs{}xa.defaults=ci(bs.defaults,{visible:!1});class va extends Ts{}class Sa extends ui{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 hi),this._richTextImpl.setFormat(t)):this._richTextImpl=null}buildSvg(t,e,i,s){this._richTextImpl&&this._richTextImpl.build(t,e,i,void 0,s)}}Sa.defaults=ci(ui.defaults,{});class Ca extends Sa{getMinSize(t){return U(this._minSizeDim,t)}_doApply(t){super._doApply(t),this._setDim(t,"minSize")}}Ca.defaults=ci(Sa.defaults,{text:"${name}"});class Pa extends Sa{}Pa.defaults=ci(Sa.defaults,{text:"${value}"});class Ma extends $s{_doInit(t){super._doInit(t),this._header=this._addChild("header",new Ca(this)),this._divider=this._addChild("divider",new ui(this.chart)),this._body=this._addChild("body",new Pa(this))}get header(){return this._header}get divider(){return this._divider}get body(){return this._body}getExtents(t,e){return{width:A(this._width,et.clampEx(t,this._minWidth,this._maxWidth)),height:A(this._height,et.clampEx(e,this._minHeight,this._maxHeight))}}_createLabel(t){return new xa(t)}_createPoint(t){return new va(t)}pointLabelCount(){return 0}legendMarker(t,e){return super.legendMarker(t,e)}_doApply(t){super._doApply(t);const e=this.prop("orientation"),i=this.prop("minWidth"),s=this.prop("minHeight");this._vertical="horizontal"!==e,this._minWidth=+i,this._minHeight=+s}}Ma.DEF_MIN_WIDTH=80,Ma.DEF_MIN_HEIGHT=50,Ma.type="panel",Ma.defaults=ci($s.defaults,{orientation:"vertical",minWidth:Ma.DEF_MIN_WIDTH,minHeight:Ma.DEF_MIN_HEIGHT,position:"top"});class La extends Ds{}class Aa{constructor(t,e,i){this.value=t,this.radius=e,this.style=i}}class ka extends Bs{getRadius(t){return A(U(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 La(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=A(this.prop("startAngle")%360,0),s=u(0,_(360,A(this.prop("totalAngle"),360)));this._startRad=b+y*i,this._totalRad=y*s}setCalcedColor(t,e){this._op,super.setCalcedColor(t,e),this._fieldColors=void 0,this.prop("colorByField")&&!this._categories&&(i(this.prop("fieldColors"))?this._fieldColors=this.prop("fieldColors"):this._fieldColors=this._splitColors())}$_parseThresholds(t){return i(t)?t.filter((t=>t&&!isNaN(t.value))).map((t=>new Aa(t.value,t.radius,t.style))).sort(((t,e)=>t.value-e.value)):t&&!isNaN(t.value)?[new Aa(t.value,t.radius,t.style)]:void 0}}ka.type="pie",ka.defaults=ci(Bs.defaults,{centerX:0,centerY:0,radius:30,startAngle:0,totalAngle:360,clockwise:!0,colorByField:!0});class Ia extends oe{constructor(t,e){super(t,Ei),this._rd=e,this.setPath(zi.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 Ea extends Vs{_readObject(t,e){super._readObject(t,e),this.radius=+e.radius}}class Ta extends Rs{getExt(t,e){const i=A(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);const e=this.prop("radius"),i=this.prop("innerRadius");this._rd=A(e,Ta.DEF_RADIUS),this._innerRd=A(i,0)}_createPoint(t){return new Ea(t)}_defLabelOff(){return 2}_createLegendMarker(t,e){return new Ia(t,e/2)}setCalcedColor(t,e){super.setCalcedColor(t,e),this._colorObj=new nt(this._calcedColor)}getColorScale(){return this.prop("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(this.prop("colorScale")))||void 0===i?void 0:i.getRanger()}}Ta.DEF_RADIUS=9,Ta.type="pin",Ta.defaults=ci(Rs.defaults,{radius:Ta.DEF_RADIUS,innerRadius:0,position:"top"});class Na extends ie{constructor(t,e){super(t,Ei),this._size=e,this.add(this._marker=new oe(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);zi.setShape(this._marker,this._shape,e,e)}}class $a extends ui{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 Ra:new Va,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=A(t.distance,40),t.minDensity=A(t.minDensity,2),t.maxIteration=A(t.maxIteration,100),t.stepDuration=A(t.stepDuration,50),t.radius=A(t.radius,15),this._ranges=this.$_parseRanges(t.ranges)}$_parseRanges(t){const s=[];if(i(t)&&t.length){const i=this._op.radius;let r=-1/0;t.forEach(((t,n)=>{if(e(t)){const e={from:A(r,t.from),to:A(t.to,1/0),radius:A(t.radius,i),color:t.color};s.push(e),r=e.to}s.length>1&&s.sort(((t,e)=>t.from-e.from))}))}return s.length>0?s:null}}$a.defaults=ci(ui.defaults,{visible:!1,distance:40,minDensity:2,maxIteration:100,stepDuration:50,zoomLimit:300,radius:15});class Va{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.prop("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/Va.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.prop("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.prop("minDensity")&&e.points.forEach((t=>{t.cluster!==e&&(t.cluster=e,t.moves=0)})))}this._completed=!0;for(const t of i)if(!et.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/Va.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.prop("maxIteration")&&!this._completed;s++)this.$_assignPoints(t,e,i,t.prop("distance")),this.$_updateCentroids(i),yield{step:s,clusters:i}}}Va.MOVE_STEPS=10;class Ra{get active(){return!1}get clusters(){return null}prepare(t,e,i){return this}run(t,e,i,s,r){}stop(){}updateClusers(){}clear(){}}class Da extends Vs{_readObject(t,e){super._readObject(t,e)}}class Oa extends Rs{constructor(t){super(t),this._shape=t.getNextPointShape()}_doInit(t){super._doInit(t),this._cluster=this._addChild("cluster",new $a(this.chart))}getShape(){return this.prop("shape")||this._shape}getRadius(){return this.prop("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 Da(t)}_defLabelOff(){return 2}setCalcedColor(t,e){super.setCalcedColor(t,e),this._stroke=t.stroke,this._strokeWidth=t.strokeWidth}_createLegendMarker(t,e){return new Na(t,e)}legendMarker(t,e){const i=super.legendMarker(t,e);return i.setShape(this.getShape(),_(e,2*this.prop("radius"))),i}}Oa.type="point",Oa.defaults=ci(Rs.defaults,{radius:5,position:"center"});class Ba extends ie{constructor(t,e){super(t,Ei),this.add(this._line=new oe(t)),this.add(this._arrow=new oe(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 Fa extends gs{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 a(super._assignTo(t),{coords:this.coords})}_readObject(t,e){var s,n;const o=function(t){let e=[];return i(t)?t.forEach((t=>{i(t)?e=e.concat(o(t)):e.push(t)})):r(t)&&e.push(t),e};super._readObject(t,e),this.coords=null!==(n=null!==(s=e.coords)&&void 0!==s?s:e.coord)&&void 0!==n?n:[],this.path=null!=e.path?o(e.path):void 0,this.imageUrl=e.imageUrl||t.imageFielder(e)}}class za extends Is{get imageFielder(){return this._imageFielder}getImageUrl(t,e=!0){const i=e?this._root:"";return t.imageUrl?i+t.imageUrl:this._imageUrl?i+this._imageUrl:null}getRouteMode(){return this.chart.isGlobe?Yi:this.prop("routeMode")}getLineWidth(){return A(this._op.lineWidth,0)}getCurvePoint(t,e,i){const s=this.chart.getProjection(),r=A(t.getProp("curveFactor"),this.num("curveFactor")),n=s.scroll;let o;return s.scroll=0,o=0===r?[e,i].map((t=>s.project(t))):this.$_getCurvePointBycurveFactor(e,i,r),s.scroll=n,o}needMapScale(){return!0}_createPoint(t){return new Fa(t)}_positionsByCoord(){return!1}pointLabelCount(){return 0}_defLabelOff(){return 2}_doLoadPoints(t){if(i(t)){const s=this.chart.body._points;e(s)&&(t=t.map((t=>{const e=a({},t);if(i(e.coords)){const t=e.coords.slice();r(t[0])&&(t[0]=s[t[0]]),r(t[1])&&(t[1]=s[t[1]]),e.coords=t}return e})))}super._doLoadPoints(t)}_createLegendMarker(t,e){return new Ba(t,e)}_createFielders(t){super._createFielders(t),this._imageFielder=this._createFielder(t.imageField||"imageUrl")}_doApply(t){super._doApply(t),this._root=this._op.imageRootUrl||"",this._imageUrl=this._op.imageUrl||"",this._root&&!this._root.endsWith("/")&&(this._root+="/")}$_getCurvePointBycurveFactor(t,e,i){const s=this.chart.getProjection(),r=e[0]-t[0]>0?1:-1,n=s.project(t),o=s.project(e),a=o[0]-n[0],h=o[1]-n[1],l=(n[0]+o[0])/2,c=(n[1]+o[1])/2,d=Math.sqrt(a*a+h*h),_=l+-h/d*i*r,u=c+a/d*i*r,p=a/d,g=h/d,m=d/8;return[[_-p*m,u-g*m],[_+p*m,u+g*m]]}}za.type=Ui,za.defaults=ci(Is.defaults,{routeMode:"geo",lineType:"air",arrowDisplay:"always",arrowWidth:5,arrowLength:13,curveFactor:0,imageWidth:42,imageHeight:42});class ja extends Ds{}class Ga extends Bs{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 ja(t)}_defLabelOff(){return 2}_doApply(t){super._doApply(t),this._rowCount=t.rowCount||Ga.ROW_COUNT,this._colCount=t.colCount||Ga.COL_COUNT,this._threshold=Math.max(1,t.fillThreshold||Ga.THRESHOLD),this._rounder=Math[t.roundingMethod]||Math.round,this._cellSize=t.cellSize||Ga.CELL_SIZE,this._gap=A(t.gap,Ga.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=i(t.values)?t.values.reduce(((t,e)=>t+A(e,0)),0):0)}))}$_caculate(t,e,i){const s=(Math.max(e.min,t._sum*A(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}}Ga.ROW_COUNT=10,Ga.COL_COUNT=10,Ga.THRESHOLD=1,Ga.CELL_SIZE=5,Ga.GAP=2,Ga.type="waffle",Ga.defaults=ci(Bs.defaults,{rowCount:Ga.ROW_COUNT,colCount:Ga.COL_COUNT,minCount:1,roundingMethod:"round",fillDirection:"col",fillThreshold:Ga.THRESHOLD,cellSize:Ga.CELL_SIZE,gap:Ga.GAP});class Ha extends jn{static loadMap(t,s){return e(t)&&e(t.source)&&i(t.source.features)||e(t)&&e(t.map)&&i(t.map.features)?new Ha(t,s):e(t)&&i(t.bounds)&&4===t.bounds.length&&t.bounds.every(n)?new Ha({...t,map:{features:[]}},s):void 0}_doLoad(t){return On(t)}}class Wa extends ui{}class Ya extends ui{}class Za extends Ci{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=ut.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 Wa(this.chart)).init(),t.connector=(this._connector=new Ya(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,_=A(this._panX*d,0),u=A(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,g=e/2+(n+h/2)*d-this._panY*d,m=l/d*a,f=l/d*h,b=s+a/2-m/2+this._panX,y=n+h/2-f/2-this._panY;return this._vRect=ut.create(b,y,m,f),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}}Za.defaults=ci(ui.defaults,{width:200});class Ua extends Pi{getRegion(t){const e=this._map[t];if(e instanceof Za)return e}_loadItem(t,e,i,s){const r=new Za(t,s);return r.init(),r.index=i,r.loadOptions(e),r}}class Xa extends Rt{constructor(t,e,i,s){super(),this.view=t,this.zoom=e,this.duration=A(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 Ka extends Rt{constructor(t,e,i,s,r){super(),this.view=t,this.zoom=e,this.coords=i,this.duration=A(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 qa extends ui{isVisible(){return"boolean"==typeof this.visible||!!this.chart.isGlobe}}qa.defaults=ci(Is.defaults,{visible:void 0,globeFill:"lightblue"});const Ja={zoom:1,panX:1,panY:1};class Qa extends ui{constructor(t){super(t),this._prj=(new mo).prepareSecond(),this._zoom=100,this._panX=0,this._panY=0,this._scale=1,this._vRect=ut.create(0),this._wMap=null,this._hMap=null,this._wLayout=0,this._hLayout=0,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 Wi(this)}_doInit(t){super._doInit(t),this._addChild("mapBackground",this._mapBackground=new qa(this.chart))}anchorByName(t){return this._annotations.get(t)}get projection(){return this._prj}get mapBackground(){return this._mapBackground}get isFlatWorld(){var t;return(null===(t=this._map)||void 0===t?void 0:t.isWorld)&&!this._prj.isGlobe}get rotationX(){return this._prj instanceof Yn?this._prj.rotationX:NaN}set rotationX(t){t!==this.rotationX&&this.updateOption("rotationX",t)}get rotationY(){return this._prj instanceof Yn?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.prop("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._zoom}set zoom(t){this.updateOption("zoom",this.$_clampZoom(t))}get isZoomed(){return this.zoom>100}get scale(){return this._scale}get center(){const t=this.chart.globalMapBound,e=[t.x1+(t.x2-t.x1)/2,t.y1+(t.y2-t.y1)/2];return this._prj?this._prj.backward(e):e}get map(){return this._map}get calcedMapWidth(){return this._wMap}isDrilldowned(){return!1}clampPanX(t){const e=this._scale;return e>0?this.$_calcPan(this._wLayout,this._wMap*e,t*e)/e:t}clampPanY(t){const e=this._scale;return e>0?this.$_calcPan(this._hLayout,this._hMap*e,t*e)/e:t}canPanX(){return this.isScrollable()||this._wMap*this._scale>this._wLayout+1}canPanY(){return this._hMap*this._scale>this._hLayout+1}$_clampZoom(t){const e=this.prop("maxZoom"),i=Math.max(100,t);return e>0?Math.min(e,i):i}prepare(t){this._map=t}prepareLayout(t,e){return this._wLayout=t,this._hLayout=e,this.isFlatWorld?this.$_prepareLayout_world(t,e):this.$_prepareLayout(t,e)}$_prepareLayout_world(t,e){const i=this._prj,s=this.chart.globalMapBound,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],c=this._hMap=l[1]-h[1],d=this.$_calculateRate(t,e,a,c),_=this._scale=this._zoom/100*d,u=A(this.prop("panX")*_,0),p=A(this.prop("panY")*_,0);if(this.isScrollable())this._panX=0;else{const e=this.$_calcPan(t,a*_,u)/_;this._panX=e}this._panY=this.$_calcPan(e,c*_,p)/_;const g=i.scroll*a/360,m=t/2-(n[0]+a/2)*_-(this._panX+g)*_,f=e/2+(h[1]+c/2)*_-this._panY*_,b=d/_*a,y=d/_*c,w=s.x1+a/2-b/2+this._panX,x=s.y1+c/2-y/2-this._panY;return this._vRect=ut.create(w,x,b,y),{scale:_,wMap:a,hMap:c,tx:m,ty:f}}$_prepareLayout(t,e){const i=this.chart.globalMapBound,{x1:s,x2:r,y1:n,y2:o}=i,a=this._wMap=r-s,h=this._hMap=o-n,l=this.$_calculateRate(t,e,a,h),c=this._zoom/100,d=this._scale=c*l,_=A(this.prop("panX")*d,0),u=A(this.prop("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,g=e/2+(n+h/2)*d-this._panY*d,m=l/d*a,f=l/d*h,b=s+a/2-m/2+this._panX,y=n+h/2-f/2-this._panY;return this._vRect=ut.create(b,y,m,f),{scale:d,wMap:a,hMap:h,tx:p,ty:g}}$_calculateRate(t,e,i,s){const r=Math.min(t/i,e/s);return 0!==r?r:1}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(){var t;return this.prop("scrollable")&&(null===(t=this.map)||void 0===t?void 0:t.isWorld)}setZoom(t,i=300){let r,o;n(i)?o=i:s(i)?(r=i,o=300):e(i)&&(r=i.end,o=i.duration=300),this._zoomAni&&(this._zoomAni.stop(),this._zoomAni=null),o>0?new Xa(this,t,o,r).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}}zoomAt(t,e,i){const s=this.zoom,r=this._scale;if((t=this.$_clampZoom(t))===s)return;if(!(r>0))return void(this.zoom=t);const n=(1-s/t)/r,o=(e-this._wLayout/2)*n,a=(i-this._hLayout/2)*n,h=this.panX,l=this.panY;this.zoom=t,this.isScrollable()?this.scroll+=360*o/this._wMap:this.panX=h+o,this.panY=l+a}_canSetZoom(t){return t>100}zoomTo(t,e,i=300){new Ka(this,t,e,i,null).start()}zoomToArea(t,e=.8,i=300,s){var r;const n={...ji,...s},o=null===(r=this.map)||void 0===r?void 0:r.areaOf(t);if(!o)return;const a=o.getCenter(),{x1:h,x2:l,y1:c,y2:d}=o.mainLandBounds,{zoom:_}=this.calcZoomInfo([h,c],[l,d],e),u=Math.min(n.maximumZoom,Math.max(n.minimumZoom,_));new Ka(this,u,a,i,null).start()}zoomToBounds(t,e,i=300,s=.7){const{center:r,zoom:n}=this.calcZoomInfo(t,e,s);try{new Ka(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.chart.globalMapBound,i=e.x1+(e.x2-e.x1)/2,s=e.y1+(e.y2-e.y1)/2,[r,n]=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=r-i,this.panY=-n+s)}}getAnnotations(){return this._annotations.getVisibles()}getAnnotation(t){return this._annotations.getAnnotation(t)}updateOption(t,e,i){const s=t in Ja;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 Ja)){i=!1;break}i&&this.chart.lockOptionsDirty();try{super.updateOptions(t,e)}finally{i&&this.chart.freeOptionsDirty()}return this}_doApply(s){var n,o;const a=this;var h;super._doApply(s),t.call(s,"annotations")&&(h=s.annotations)!==a._anns&&(a._anns=h,a._annotations.load(h,!0));const l=this._zoom;let c=function(t){if(void 0!==t&&t!==a._projection){switch(a._projection=t,a._projection.toLowerCase()){case"orthographic":a.scroll=0,a.panX=0,a.panY=0,a._prj=new Yn;break;case"equalearth":a._prj=(new So).prepareSecond();break;case"miller":a._prj=(new Io).prepareSecond();break;case"mercator":a._prj=(new Mo).prepareSecond();break;default:a._prj=(new mo).prepareSecond()}return!0}}(s.projection);const d=this._prj;if(d&&(c||void 0!==s.scroll&&s.scroll!==this._rawScroll)){d.scroll=s.scroll,this._rawScroll=s.scroll,c=!0;const t=null===(n=this.chart)||void 0===n?void 0:n.firstMapSeries;t&&t.setOptionsDirty(!0)}d instanceof Yn&&(c=d.setRotation(s.rotationX,s.rotationY)||c),function(t){void 0!==t&&(a._zoom=a.$_clampZoom(A(t,100)))}(s.zoom);const _=this._points={};i(s.points)&&s.points.forEach((t=>{i(t)&&t.length>=3&&r(t[0])?_[t[0]]=[t[1],t[2]]:e(t)&&r(t.id)&&(_[t.id]=i(t.coord)?t.coord.slice():[t.lon,t.lat])})),this.chart._loading||(c&&this.chart.projectionChanged(),this._zoom!==l&&(this.chart.zoomChanged(this._zoom,l),null===(o=this.prop("onZoomChanged"))||void 0===o||o({chart:this.chart.wrapper,zoom:this._zoom,oldZoom:l})))}_doPrepareRender(t){this._annotations.prepareRender()}_getZoom(){return this._zoom/100}}Qa.defaults=ci(ui.defaults,{zoom:100,wheelZoomFactor:5});class th extends wa{}class eh extends ui{constructor(){super(...arguments),this._widgetGaps=new Ht}getWidgetSectionGap(t){return this._widgetGaps[t]||0}_doApply(t){super._doApply(t);const e=this.prop("widgetSectionGap");var i;r(e)?this._widgetGaps.set(...e.split(/\s+/g).map((t=>parseFloat(t)))):isNaN(e)||this._widgetGaps.set(e),i=this.prop("locale"),Bt=Dt[Ot=Ft(i)],Bt||(Bt=Dt[Ot="ko"])}}eh.defaults=ci(ui.defaults,{locale:"ko",alwaysMap:!0,clickAction:"none",dblClickAction:"zoom",dragAction:"default",widgetSectionGap:8,widgetGap:8,resizeDelay:50,interactive:!0,wheelDisabled:!1,animatable:!0,clickable:!0,hoverable:!0,draggable:!0});class ih extends Gt{lockOptionsDirty(){this._optionsLock=!0}freeOptionsDirty(){this._optionsLock=!1}constructor(t,i){super(),this._maps=[],this._loading=!0,this._widgetGroupDirty=!0,this._point_shaes=Oi.slice(0),this._params={},this._seriesIndex=0,this._optionsLock=!1,this._optionsDirty=!0,this._loadAnimatable=!0,this._wrapper=i,this._assets=new Pe,this._series=new Es(this),this._annotations=new Wi(this),this._mapRegions=new Ua(this),this._widgetGroups=new Si(this),this._legends=new er(this),this._colorScales=new _r(this),this._bubbleScales=new Js(this),(this._general=new eh(this)).init(),(this._axis=new Lr(this)).init(),(this._body=new Qa(this)).init(),(this._exporter=new ur(this)).init(),(this._title=new ao(this)).init(),(this._subtitle=new ho(this)).init(),(this._zoomPanel=new ro(this)).init(),(this._drilldownPanel=new no(this)).init(),(this._mapScale=new io(this)).init(),(this._credits=new Li(this)).init(),(this._tooltip=new lo(this)).init(),this._op=Object.assign({},ih.defaults),this._bases={axis:{},series:{},gauge:{},annotation:{}},e(t)?this._load(t):this._initOptions(),this._selection=new oo(this)}_initOptions(){return this._op=Object.assign({},ih.defaults)}get wrapper(){return this._wrapper}get exporter(){return this._exporter}get options(){return this._op}get general(){return this._general}get global(){return this._general}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 r(t)&&fs[t.toLowerCase()]}_getAnnotationType(t){return r(t)&&Gi[t.toLowerCase()]}_modelChanged(){this._fireEvent("onModelChanged")}_optionChanged(t,e){this._optionsLock||(this._optionsDirty=!0),this._fireEvent("onModelChanged",t,e)}interactive(){return this._general.bool("interactive")}animatable(t=!0){return(!t||this.interactive())&&this._general.bool("animatable")}hoverable(t=!0){return(!t||this.interactive())&&this._general.bool("hoverable")}clickable(t=!0){return(!t||this.interactive())&&this._general.bool("clickable")}draggable(t=!0){return(!t||this.interactive())&&this._general.bool("draggable")}dragAxes(){const t=this._body;if(!t||!this.draggable())return{x:!1,y:!1};const e=this._general.prop("dragAction");return"zoom"===e||"select"===e||this.isGlobe?{x:!0,y:!0}:t.isScrollable()||t.movable?{x:t.canPanX(),y:t.canPanY()}:{x:!1,y:!1}}zoomable(t=!0){return(!t||this.interactive())&&this._body.bool("zoomable")}wheelable(t=!0){return(!t||this.interactive())&&!this._general.bool("wheelDisabled")}loadAnimatable(){return this._loadAnimatable}requestShowSeries(t,e){this._fireEvent("onRequestShowSeries",t,e)}_selectionChanged(t,e){var i;this._fireEvent("onModelChanged",t,"selection");new xs({series:t},this._wrapper)._points=e,null===(i=this._general.prop("onSelectionChanged"))||void 0===i||i({chart:this._wrapper})}getNextPointShape(){let t;return this._point_shaes.push(t=this._point_shaes.shift()),t}getProjection(){return this._body._prj||(new mo).prepareSecond()}projectionChanged(){var t;null===(t=this._baseMap)||void 0===t||t.reset(),this.$_resetGlobalMapBound(),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(){var t;this._fireEvent("onModelChanged",this,"selection"),null===(t=this._general.prop("onSelectionChanged"))||void 0===t||t({chart:this._wrapper})}get type(){return this._op.type}get legend(){return this._legends.first}get credits(){return this._credits}get globalMapBound(){return this._globalMapBound}get map(){return this._baseMap}setBaseMap(t){const e=this._baseMap,i=(t instanceof to?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 wa))}get colorScale(){return this._colorScales.first}get bubbleScale(){return this._bubbleScales.first}get mapScale(){return this._mapScale}get widgetGroup(){return this._widgetGroups.first}get zoomPanel(){return this._zoomPanel}get drilldownPanel(){return this._drilldownPanel}get isDirty(){return this._dataDirty||this._optionsDirty}get isDrilldowned(){const t=this.firstVisible;return t instanceof wa&&!!t.parent}getAnnotations(){return this._annotations.getVisibles()}getMapRegions(){return this._mapRegions.getVisibles()}isEmpty(){return!this.map}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())||Ti}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 r(t)?this.mapByName(t):this.mapAt(+t)}getSeries(t){return n(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(J))t[e]=[];return[this._legends,this._colorScales,this._bubbleScales,this._widgetGroups].forEach((e=>{for(const i of Object.values(J)){const s=e.getVisibles(i).filter((t=>!t.getGroup()));t[i].push(...s.sort(((t,e)=>t.getOrder()-e.getOrder())))}})),t}loadBase(t,i,s){const r=this._bases[i];let n;return e(r.base)&&_i(n={},r.base),e(r[s])&&(n||(n={}),_i(n,r[s])),n?_i(n,t):t}_setProperties(t,e=!0){const i=this._op;for(const e in ih.defaults)t.hasOwnProperty(e)&&(i[e]=t[e])}_load(t){const s=this._op;this.$_loadTemplates(t.templates),this._setProperties(t),s.asset=this._assets.load(I(t.asset,t.assets)),this._general.loadOptions(I(t.general,t.chart)),this._body.loadOptions(t.body);const r=i(t.map)&&4===t.map.length&&t.map.every(n)?{bounds:t.map}:t.map,o=i(r)?r:e(r)?[r]:null;if(i(o)&&o.forEach(((t,e)=>{if(!1!==t.enabled){const i=Zn.loadMap(t,e)||Ha.loadMap(t,e);if(!i)return;const s=i&&new to(this,i,e);s.isWorld&&s._prepareSecond(),this._maps.push(s)}})),0===this._maps.length){const t=new to(this,new Ha({map:{features:[]}},0),0);this._maps.push(t)}return this.setBaseMap(void 0),this.$_resetGlobalMapBound(),this.$_resolveGrid(t),this._axis.loadOptions(t.axis),this._title.loadOptions(t.title),this._subtitle.loadOptions(t.subtitle),this._zoomPanel.loadOptions(t.zoomPanel),this._drilldownPanel.loadOptions(t.drilldownPanel),this._credits.loadOptions(t.credits),this._tooltip.loadOptions(t.tooltip),this._seriesIndex=0,this._series.load(t.series,th),!1===this._general.prop("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.loadOptions(t.mapScale),this._exporter.loadOptions(t.exporting),this._loading=!1,this}$_resolveGrid(t){if(!(1===this._maps.length&&0===this._maps[0].areaCount&&this.globalMapBound))return;const e=this.globalMapBound;t.axis||(t.axis={}),"boolean"==typeof t.axis.grid?t.axis.grid={visible:!!t.axis.grid}:t.axis.grid||(t.axis.grid={});const i=t.axis.grid;i.visible=!0;let s=ih.DEFAULT_GRID_STEP;if("orthographic"!==this._body.prop("projection")){const t=Math.min(Math.abs(e.h2-e.h1),Math.abs(e.v2-e.v1));for(const e of ih.ZOOM_STEP_MAP)if(t<=e.diff){s=e.step;break}}void 0!==s&&(i.line||(i.line={}),"number"!=typeof i.line&&void 0===i.line.step&&(i.line.step=s))}$_loadTemplates(t){const s=this._bases;if(e(t)){const n=this._templates={};for(const i in t){const s=t[i];e(s)&&(n[i]=a({},s))}["@series","@annotation"].forEach((i=>{t.hasOwnProperty(i)&&e(t[i])&&(s[i.substring(1)]=t[i])})),this.assignTemplates=t=>{const e=t.template;if(r(e)){let i=this._templates[e];if(i)return _i(_i({},i),t)}else i(e)&&e.forEach((e=>{let i=this._templates[e];return i?_i(_i({},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,i){if(e(t)){const e=this._general.prop("locale");this._setProperties(t,!1);for(const e in t){if("chart"===e){this._general.updateOptions(t[e],!1);continue}const i=this[e];(i instanceof ui||i instanceof pi||i instanceof Pe)&&i.updateOptions(t[e],!1)}this._general.prop("locale")!==e&&this.$_relocalize(),i&&this._optionChanged(null)}}$_relocalize(){this._maps.forEach((t=>null==t?void 0:t._relocalizeAreas())),this._series._internalItems().forEach((t=>t._relocalize()))}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,e);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 wa&&t.detail))return;const i=t.drilldown,s=t.detail;if(!i.prop("enabled"))return;s.prop("dataUrl")&&(s.updateOption("data",await fetch(s.prop("dataUrl")).then((t=>t.json()))),s.removeOption("dataUrl"));const r=t.map,n=this.getMap(s.prop("map"))||r;i.prop("autoMapChange")&&n!==r&&this.setBaseMap(n),t.showDetail(),e&&this._body.zoomToArea(e)}async drillup(t){if(!((t=t||this.firstVisible)instanceof wa&&t.parent))return;const e=t.drilldown;if(!e.prop("enabled"))return;const i=t.parent,s=this.map;e.prop("autoMapChange")&&i.map!==s&&this.setBaseMap(i.map),t.showParent(),this._body.zoom=100}canClick(){return s(this._general.prop("onClick"))}click(t){var e;null===(e=this._general.prop("onClick"))||void 0===e||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 wi){const i=t.get(e.prop("group"),e.getLocation());e._setGroup(i),i&&i._add(e)}}))}));for(const e of t._internalItems())e._sort();this._widgetGroupDirty=!1}$_resetGlobalMapBound(){const t={x1:0,x2:0,y1:0,y2:0,h1:0,h2:0,v1:0,v2:0};let e=1/0,i=-1/0,s=1/0,r=-1/0,n=1/0,o=-1/0,a=1/0,h=-1/0;if(this._maps.forEach((t=>{isFinite(t.x1)&&(e=Math.min(e,t.x1)),isFinite(t.x2)&&(i=Math.max(i,t.x2)),isFinite(t.y1)&&(s=Math.min(s,t.y1)),isFinite(t.y2)&&(r=Math.max(r,t.y2)),isFinite(t.h1)&&(n=Math.min(n,t.h1)),isFinite(t.h2)&&(o=Math.max(o,t.h2)),isFinite(t.v1)&&(a=Math.min(a,t.v1)),isFinite(t.v2)&&(h=Math.max(h,t.v2))})),isFinite(e))this._globalMapBound={x1:e,x2:i,y1:s,y2:r,h1:n,h2:o,v1:a,v2:h};else{const e=this._baseMap;this._globalMapBound=e?{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,h1:e.h1,h2:e.h2,v1:e.v1,v2:e.v2}:t}}_visibleChanged(t){}_hoverAreaChanged(t,e,i){var s;null===(s=this._body.prop("onHoverArea"))||void 0===s||s({chart:this._wrapper,area:null==e?void 0:e.getInfo(),oldArea:null==i?void 0:i.getInfo()})}_areaClicked(t,e){var i;null===(i=this._body.prop("onClickArea"))||void 0===i||i({chart:this._wrapper,area:null==e?void 0:e.getInfo()})}}ih.ZOOM_STEP_MAP=[{diff:1,step:.2},{diff:10,step:1},{diff:50,step:5}],ih.DEFAULT_GRID_STEP=10,ih.defaults={type:"map",startOfWeek:0},Is.register(wa,Oa,Ta,No,ka,sa,Zs,za,la,ua,Ma,Ga,oa,Go,ta),Hi.register(uo,po,go,_o);class sh extends ie{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 rh extends ie{constructor(t,e){super(t,rh.STYLE),this._spinnerWrapper=new ie(t,"rm-spinner-wrapper"),this._spinnerWrapper.add(this._spinner=new sh(t,"rm-loading-spinner",!0)),this.add(this._spinnerWrapper),e&&this.dom.classList.add(e),this._spinner.url=rh.LOADING_SPINNER,this._spinner.width=rh.SPINNER_LENGTH,this._spinner.height=rh.SPINNER_LENGTH}layout(t,e){this.internalSetStyleOrClass(e),this._spinnerWrapper.trans(t.width/2-rh.SPINNER_LENGTH/2,t.height/2-rh.SPINNER_LENGTH/2)}}rh.STYLE="rm-loading-indicator",rh.BACK_STYLE="rm-loading-background",rh.SPINNER_LENGTH=64,rh.LOADING_SPINNER="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgYXJpYS1sYWJlbD0iTG9hZGluZy4uLiIKICAgY2xhc3M9IiAgQnk0bkEiCiAgIHZpZXdCb3g9IjAgMCAxMDAgMTAwIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczODE3IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2FkaW5nX3NwaW5uZXIuc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkyLjQgKDVkYTY4OWMzMTMsIDIwMTktMDEtMTQpIj4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGEzODIzIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICAgIDxkYzp0aXRsZT48L2RjOnRpdGxlPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzMzgyMSIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjY0MCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI0ODAiCiAgICAgaWQ9Im5hbWVkdmlldzM4MTkiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIuMzYiCiAgICAgaW5rc2NhcGU6Y3g9IjUwIgogICAgIGlua3NjYXBlOmN5PSI1MCIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iMTYxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNjIiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJzdmczODE3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM3OTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjA4MzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKC02MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0Mzc5NSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuMTY2NjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk3IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4yNSIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzNzk5IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC4zMzMzMzMzMzMzMzMzMzMzIgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDMwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAxIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC40MTY2NjY2NjY2NjY2NjY3IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDYwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODAzIiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODA1IiAvPgogIDxyZWN0CiAgICAgZmlsbD0iIzU1NTU1NSIKICAgICBoZWlnaHQ9IjYiCiAgICAgb3BhY2l0eT0iMC41ODMzMzMzMzMzMzMzMzM0IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDEyMCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgwNyIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuNjY2NjY2NjY2NjY2NjY2NiIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MDkiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjc1IgogICAgIHJ4PSIzIgogICAgIHJ5PSIzIgogICAgIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA1MCkiCiAgICAgd2lkdGg9IjI1IgogICAgIHg9IjcyIgogICAgIHk9IjQ3IgogICAgIGlkPSJyZWN0MzgxMSIgLz4KICA8cmVjdAogICAgIGZpbGw9IiM1NTU1NTUiCiAgICAgaGVpZ2h0PSI2IgogICAgIG9wYWNpdHk9IjAuODMzMzMzMzMzMzMzMzMzNCIKICAgICByeD0iMyIKICAgICByeT0iMyIKICAgICB0cmFuc2Zvcm09InJvdGF0ZSgyMTAgNTAgNTApIgogICAgIHdpZHRoPSIyNSIKICAgICB4PSI3MiIKICAgICB5PSI0NyIKICAgICBpZD0icmVjdDM4MTMiIC8+CiAgPHJlY3QKICAgICBmaWxsPSIjNTU1NTU1IgogICAgIGhlaWdodD0iNiIKICAgICBvcGFjaXR5PSIwLjkxNjY2NjY2NjY2NjY2NjYiCiAgICAgcng9IjMiCiAgICAgcnk9IjMiCiAgICAgdHJhbnNmb3JtPSJyb3RhdGUoMjQwIDUwIDUwKSIKICAgICB3aWR0aD0iMjUiCiAgICAgeD0iNzIiCiAgICAgeT0iNDciCiAgICAgaWQ9InJlY3QzODE1IiAvPgo8L3N2Zz4K";class nh{constructor(t,e){this._visible=!1,this._doc=t,this._container="string"==typeof e?t.getElementById(e):e,this._svg=t.createElementNS("http://www.w3.org/2000/svg","svg"),this._svg.style.position="absolute",this._svg.style.top="0",this._svg.style.left="0",this._svg.style.width="100%",this._svg.style.height="100%",this._svg.style.pointerEvents="none",this._svg.style.zIndex="9999",this._loadingElement=new rh(t),this._svg.appendChild(this._loadingElement.dom),this._setVisible(!1)}show(){this._visible||(this._container.appendChild(this._svg),this._setVisible(!0),this._layout())}hide(){this._visible&&(this._setVisible(!1),this._svg.parentNode===this._container&&this._container.removeChild(this._svg))}dispose(){var t;this.hide(),null===(t=this._loadingElement)||void 0===t||t.dispose(),this._loadingElement=null,this._svg=null}_setVisible(t){this._visible=t,this._loadingElement.visible=t}_layout(){const t=this._container.clientWidth,e=this._container.clientHeight,i=nh.LOADING_VIEW_LENGTH;this._loadingElement.layout({width:i,height:i});const s=t/2-i/2,r=e/2-i/2;this._loadingElement.trans(s,r)}}nh.LOADING_VIEW_LENGTH=128;class oh{static handleChartInitError(t,e){throw null==e||e.showErrorView(null==t?void 0:t.message),t}}const ah="$ctrl";class hh{constructor(t,i){this._loaded=!1,this._modelCallback=i,this._obj=new ih(t,this),this._loaded=e(t),null==i||i(this._obj,null)}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}get general(){return this._obj.general}setBaseMap(t){this._obj.setBaseMap(t)}getMap(t){return r(t)?this._obj.mapByName(t):this._obj.mapAt(t)}getSeries(t){return r(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,i=!1,s){var r;if(e(t)){const e="load chart ";et.LOGGING&&console.time(e);let n=this._obj,o=n;this._loaded?(n.dispose(),o=this._obj=new ih(null,this)):(this._loaded=!0,n=null),o._load(t),o._loadAnimatable=i,this._loadCallback=s,et.log("chart-items:",li),et.LOGGING&&console.timeEnd(e),null===(r=this._modelCallback)||void 0===r||r.call(this,o,n)}return this}async loadAsync(t,i=!1,s){var r;const n=this[ah];if(!e(t))return this;const o=n.doc(),a=n.dom().parentElement,h=new nh(o,a);h.show();try{n.setLoading(!0),n.hideErrorView();const e="load chart ";et.LOGGING&&console.time(e),await kt.loadConfigAsync(t);let o=this._obj,a=o;return this._loaded?(o.dispose(),a=this._obj=new ih(null,this)):(this._loaded=!0,o=null),a._load(t),a._loadAnimatable=i,this._loadCallback=s,et.log("chart-items:",li),et.LOGGING&&console.timeEnd(e),null===(r=this._modelCallback)||void 0===r||r.call(this,a,o),this}catch(t){oh.handleChartInitError(t,n)}finally{n.setLoading(!1),h.hide(),h.dispose()}}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)}inspect(){return{series:this._obj.visibleSeries.map((t=>t._inspect()))}}pointToMap(t,e){return this._obj.pointToMap(t,e)}async drilldown(t,e){const i=t instanceof wa?t:(n(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;i instanceof wa&&this._obj.drilldown(i,e)}async drillup(t){const e=t instanceof wa?t:(n(t)?this._obj.seriesAt(t):this._obj.seriesByName(t))||this._obj.firstMapSeries;e instanceof wa&&this._obj.drillup(e)}destroy(){var t,e,i;this.$_disposed||this.$_disposing||(this.$_disposing=!0,null===(e=null===(t=this._obj)||void 0===t?void 0:t._exporter)||void 0===e||e.dispose(),this[ah]=null===(i=this[ah])||void 0===i?void 0:i.dispose(),this._obj=null,this.$_disposed=!0)}isDestroying(){return this.$_disposing||this.$_disposed}}class lh{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}get _isTouch(){return"touch"===this._pointerType}pointerDown(t){let e;return this._pointerType=t.pointerType,e=this._pointerToPoint(t),this._clickX=this._prevX=e.x,this._clickY=this._prevY=e.y,this._touches=[{x:e.x,y:e.y,t:t.timeStamp}],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.control.isDraggable()?this._stopEvent(t):this.$_doDrag(t,e,i,s))}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);if(t.buttons>=1||0===t.buttons&&0===t.button&&t.pointerId===this._primaryId){const n=this._isTouch?8:3;i&&this.control.isDraggable()?this.$_doDrag(t,e,s,r):(!this._dragTracker&&(Math.abs(this._clickX-s)>n||Math.abs(this._clickY-r)>n)||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})}else i&&this.$_stopDragTracker(e,s,r,!0);this.dragging&&this._stopEvent(t),this._doPointerMove(s,r,t)}pointerUp(t){if(this._pointerType=t.pointerType||this._pointerType,this._doPointerUp(t),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]),this._pinchRect=this._control.dom().getBoundingClientRect(),t.cancelable&&t.preventDefault())}else this._doTouchStart(t,t.target)}touchMove(t){if((this._pinching||this.dragging)&&t.cancelable&&t.preventDefault(),t.touches.length>=2&&this._pinching){if(this._pinching){const e=this.$_getDistance(t.touches[0],t.touches[1]);if(this._distance>0){const i=this.$_getCenter(t.touches[0],t.touches[1]);this._doPinch(e/this._distance,i.x,i.y)}this._distance=e}return!0}return t.target instanceof HTMLTextAreaElement||this._doTouchMove(t,t.target)}_isPinchTarget(t){}_doPinch(t,e,i){}touchEnd(t){this._pinching?this._distance=0:this._doTouchEnd(t,t.target)}touchCancel(t){this._pinching=!1,this._distance=0,this._pinchRect=null,this._clearTouchEffects(),this.dragging&&this.$_stopDragTracker(t.target,this._prevX,this._prevY,!0)}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?$t.DOWN:n>135&&n<=225?$t.LEFT:n>225&&n<=315?$t.UP:$t.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)}$_getCenter(t,e){const i=this._pinchRect||this._control.dom().getBoundingClientRect();return{x:(t.clientX+e.clientX)/2-i.left,y:(t.clientY+e.clientY)/2-i.top}}}class ch extends gt{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 dh extends ch{_doStart(t,e,i,s,r){return this.control.chartView().onRotationStart(),!0}_doDrag(t,e,i,s,r){const n=this.control.model.body,o=n.scale;if(!(o>0))return!0;const a=2/(Math.PI*o);return n.rotationX+=(s-e)*a,n.rotationY-=(r-i)*a,!0}}class _h extends ch{constructor(t){super(t);const e=t.model.body;this._oldX=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=n.clampPanY(this._oldY-(r-this._yStart)/n.scale);if(n.isScrollable()){const t=360;n.scroll+=t/(n.calcedMapWidth*n.scale)*(e-s)}else{const t=n.clampPanX(this._oldX-(s-this._xStart)/n.scale);n.panX=t}return n.panY=o,!0}$_mapView(){return this.control.model.body}}class uh extends ie{constructor(t,e=It){super(t,e,"g"),this._doInitChildren(t)}_movable(){return!1}setAttr(t,e){return uh.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}uh.IGNORE_ATTRS={width:"",height:""};class ph extends uh{constructor(t,e){super(t,e),this.add(this._text=new Qe(t,void 0)),this._text.anchor=Ke.START}setText(t){return this._outline&&(this._outline.text=t),this._text.text=t,this}setModel(t,e,i,s){const r=e.prop("effect");return this._model=e,this._text.setStyleOrClass(e._style),"background"===r?(this._outline&&this._outline.remove(),this._back||(this._back=new as(t,"rm-label-background")),this.insertFirst(this._back),this._back.internalSetStyleOrClass(e.prop("backgroundStyle"))):"outline"===r?(this._back&&this._back.remove(),this._outline||(this._outline=new Qe(t)),this.insertFirst(this._outline),this._outline.anchor=this._text.anchor,this._outline.setStyleOrClass(e._style)):(this._back&&this._back.remove(),this._outline&&this._outline.remove()),i?this._icon||(this.add(this._icon=new sh(t)),this._icon.url=i,this._icon.width=e.prop("width"),this._icon.height=e.prop("height")||16):this._icon&&(this._icon.remove(),this._icon=null),this}setContrast(t){if(t&&this._model.prop("autoContrast")&&this._text.setContrast(t,this._model.prop("darkStyle")||"rm-label-dark",this._model.prop("lightStyle")||"rm-label-light"),this._outline&&this._outline.parent){const t=nt.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=A(this._model.prop("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=Ke.MIDDLE;break;case"right":_+=h,t.anchor=Ke.END;break;default:t.anchor=Ke.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 gh extends ch{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=u(0,e-o.x+n.x),this._yStart=u(0,i-o.y+n.y),this._body.addFeedback(this._feedback=new as(this.control.doc(),"rm-bounds-tracker")),this._body.addFeedback(this._fromTag=new ph(this.control.doc(),"rm-bounds-tracker-tag")),this._body.addFeedback(this._toTag=new ph(this.control.doc(),"rm-bounds-tracker-tag"));const a=new ui(this._body.chart());return a.init(),a.loadOptions({effect:"background",backgroundStyle:{fill:"#000020aa",padding:"3px 4px"}}),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=Te.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=u(0,_(r,t-s.x+i.x)),e=u(0,_(n,e-s.y+i.y)),{x:_(this._xStart,t),y:_(this._yStart,e),width:p(this._xStart-t),height:p(this._yStart-e)}}}class mh extends lh{_doPointerDown(t){if(!t.isPrimary)return;this._clickElement=t.target}_doPointerMove(t,e,i){const s=this.$_chart();s.map&&s.hoverable()&&(this.dragging?this.dragTracker instanceof _h&&(this._clickElement=null):0===i.buttons&&this.$_chartView().pointerMoved(t,e,i.target))}_doPointerUp(t){if(this._isTouch&&!this.control.dom().contains(t.target)){const{x:e,y:i}=this._pointerToPoint(t);this.$_chartView().pointerMoved(e,i,t.target)}return!0}_doClick(t){const e=this.$_chart(),i=t.target;e.clickable(!1)&&this.$_clickPanelButton(i)||e.clickable()&&(this.$_clickLegend(i)||i===this._clickElement&&this.$_clickBody(t,i))}$_clickPanelButton(t){const e=this.$_chartView().getButton(t);return!!e&&(e.click(),!0)}$_clickLegend(t){const e=this.$_chartView().legendByDom(t);return!!e&&(e.source instanceof gs||!e.source.canHide()||(e.source.visible=!e.source.visible),!0)}$_clickBody(t,e){const i=this.$_chart(),s=this.$_chartView(),r=t.shiftKey,n=M?t.ctrlKey:t.metaKey,o=i.general.prop("clickAction"),a=this._pointerToPoint(t),{x:h,y:l}=a;let c,d;if(a.x-=s.tx,a.y-=s.ty,c=s.seriesByDom(e))c.click(e,a);else if(d=s.creditByDom(e))d.click(e);else if(s.drilldownPanelView().click(e))return;switch(this._isTouch&&i.hoverable()&&"none"===o&&s.pointerMoved(h,l,e),o){case"select":(null==c?void 0:c.model.canSelect())&&c.pointByDom(e,a)?r&&!n?c.select(e,a,!1):c.toggleSelect(e,a,!n&&!r):d||i.selection.clear();break;case"drilldown":this.$_drildown(i,t,s)}s.click(t,e,c)}_doDblClick(t){const e=this.$_chart(),i=this.$_chartView();if(!e.interactive())return;"drilldown"===e.general.prop("dblClickAction")&&this.$_drildown(e,t,i)}_doWheel(t){const e=this.$_chart(),i=e.body;if(e.zoomable()){const e=Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX,s=A(Math.max(1,i.prop("wheelZoomFactor")),5);return i.zoomByFactor(-e/s,!1),t.preventDefault(),!0}}_isPinchTarget(t){const e=this.$_chartView();return this.$_chart().interactive()&&e.bodyView().dom.contains(t)}_doPinch(t,e,i){const s=this.$_chart().body,r=this.$_chartView().bodyView().transformInfo;r&&s.zoomAt(s.zoom*t,e-r.vx,i-r.vy)}_getDragTracker(t,e,i,s){const r=this.$_chart(),n=r.general.prop("dragAction"),o=r.dragAxes();if(o.x||o.y)return"zoom"===n||"select"===n?new gh(this.control,this.$_chartView().bodyView(),n,s):r.isGlobe?new dh(this.control):new _h(this.control)}$_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 pa&&t.drilldown(t.firstMapSeries,o.point.area.id)}}}class fh extends ie{constructor(t,e=It){super(t,e,"g"),ie.DEBUGGING&&(this.add(this._debugRect=new as(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),ie.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new as(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 bh extends fh{constructor(t,e,i){super(t,e),this._margins=new Ht,this._paddings=new Ht,this.add(this._background=new as(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 yh extends uh{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 wh extends ph{constructor(t){super(t,"rm-map-widget-title")}}class xh extends ph{constructor(t){super(t,"rm-map-widget-footer")}}class vh extends bh{constructor(t,e,i){super(t,e,i),this.add(this._titleView=new wh(t)),this.add(this._footerView=new xh(t))}_setBackgroundStyle(t){t.setVisible(this.model.background.visible)&&t.internalSetStyleOrClass(this.model.background._style)}$_layoutCaption(t,e,i){i.internalResetStyleOrClass(e._style),i.setModel(t,e,null,null),e.prepareRich(e.prop("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 Sh extends gt{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}_doDispose(){this._owner=null,this._creator=null,super._doDispose()}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 Ch extends fh{constructor(t){super(t,"rm-legend-item"),this.add(this._back=new as(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new Qe(t,"rm-legend-item-label")),this._label.anchor=Ke.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.prop("markerVisible"))?this._marker.bbox():ht,n=ct(this._label.bbox());return this._gap=A(e.legend.prop("markerGap"),0),{width:r.width+this._gap+n.width,height:u(r.height,n.height)}}_doLayout(t){const e=this._rMarker,i=A(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 Ph extends vh{constructor(t){super(t,Ph.LEGEND_CLASS,"rm-legend-background"),this._itemViews=new Sh(this,Ch)}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.items(),n=this._vertical="vertical"===e.getLayout();this._ipr=A(e.prop("itemsPerLine"),Number.MAX_SAFE_INTEGER),n?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,r);const o=this.$_measure(t,e,n,this._ipr,i,s);return this._titleView.visible&&(this._inTitle?o.height=Math.max(o.height,this._rTitle.height):o.width=Math.max(o.width,this._rTitle.width)),this._footerView.visible&&(this._inFooter?o.height=Math.max(o.height,this._rFooter.height):o.width=Math.max(o.width,this._rFooter.width)),o}_doLayout(){const t=this.model,e=this._rowViews,i=t.prop("sameTextColor"),s=this._sizes,r=t.prop("itemsAlign"),n=t.prop("lineGap")||0,o=t.prop("itemGap")||0,a=this._margins,h=this._paddings,l=this._vertical,c=this._titleView,d=this._footerView,_=this._rTitle,u=c.visible?_.height:0,p=c.visible?_.width:0,g=this._rFooter,m=d.visible?g.height:0,f=d.visible?g.width:0,b=d.visible?this._gapFooter:0;let y,w,x,v=a.left+h.left,S=a.top+h.top,C=this.width-v-a.right-h.right,P=this.height-S-a.bottom-h.bottom;if(c.visible)if(this._inTitle){switch(w=S,t.title.prop("verticalAlign")){case"top":break;case"bottom":w+=P-u;break;default:w+=(P-u)/2}c.trans(v,w),v+=p,C-=p}else{switch(t.title.prop("align")){case"center":y=Math.max(v,v+(C-_.width)/2);break;case"right":y=Math.max(v,v+C-_.width);break;default:y=v}c.trans(y,S),S+=u,P-=u}const M=v,L=S;if(d.visible){if(this._inFooter){switch(y=M+C-f,w=S,t.footer.prop("verticalAlign")){case"top":break;case"bottom":w+=P-m;break;default:w+=(P-m)/2}C-=f+b}else{switch(w=S+P-m,t.footer.prop("align")){case"center":y=Math.max(v,v+(C-g.width)/2);break;case"right":y=Math.max(v,v+C-g.width);break;default:y=v}P-=m+b}d.trans(y,w)}this._itemViews.forEach((t=>{var e;const s=t.model.source,r=s.legendColor();t._marker.setColor(r),null===(e=s.setLegendMarkerStyle)||void 0===e||e.call(s,t._marker),i&&s.visible?t._label.setFill(r):t._label.setFill("")})),e.forEach(((t,e)=>{if(l){const i=this._wMarkers;t.forEach((t=>{t.mw=s[e],t.resizeByMeasured().layout(i[e])})),S=L,"center"!==r&&"end"!==r||(x=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1),S+="center"===r?(P-x)/2:P-x),t.forEach((t=>{t.trans(v,S),S+=t.height+o})),v+=s[e]+n}else t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),v=M,"center"!==r&&"end"!==r||(x=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1),v+="center"===r?(C-x)/2:C-x),t.forEach((t=>{t.trans(v,S),v+=t.width+o})),S+=s[e]+n}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,i,s,r,n){const o=e.items(),a=this._itemViews,h=e.prop("itemGap")||0,l=e.prop("lineGap")||0,c=a.count,d=this._rowViews=[],_=this._sizes=[];let p,g,m,f;a.forEach(((i,s)=>{i.setMarker(o[s].source.legendMarker(t,+e.prop("markerSize")||Qs.MARKER_SIZE)),i.measure(t,o[s],r,n)}));let b=0,y=0;if(i){for(;b<c;)f=a.get(b),y%s===0?(d.push(m=[f]),g=f.mh,y++,b++):(g+=h+f.mh,g<=n?(m.push(f),y++,b++):y=0);this._wMarkers=[],p=g=0,d.forEach(((t,e)=>{let i=0,s=0,r=0;t.forEach((t=>{s+=t.mh,i=u(i,t.mw),r=u(r,t._rMarker.width),t._col=e})),s+=h*(t.length-1),g=u(g,s),p+=i,_.push(i),this._wMarkers.push(r)})),p+=l*(d.length-1)}else{for(;b<c;)f=a.get(b),y%s===0?(d.push(m=[f]),p=f.mw,y++,b++):(p+=h+f.mw,p<=r?(m.push(f),y++,b++):y=0);p=g=0,d.forEach((t=>{let e=0,i=0;t.forEach((t=>{e+=t.mw,i=u(i,t.mh)})),e+=h*(t.length-1),p=u(p,e),g+=i,_.push(i)})),g+=l*(d.length-1)}return this._titleView.visible&&(this._inTitle?p+=this._rTitle.width:g+=this._rTitle.height),this._footerView.visible&&(this._inFooter?p+=this._rFooter.width+this._gapFooter:g+=this._rFooter.height+this._gapFooter),{width:p,height:g}}}Ph.LEGEND_CLASS="rm-legend";const Mh={};class Lh extends bh{static register(...t){t.forEach((t=>{Mh[t[0].type]=t[1]}))}constructor(t,e){super(t,Lh.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.prop("backgroundStyle"))}_doLayout(t){const e=this.model.prop("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)}}Lh.CLASS_NAME="rm-annotation";class Ah{static interpolate(t,e){if(e instanceof Yn==!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=Un(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 kh{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(kh.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(kh.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 Yn?Ah.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 Ih extends oe{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+=Vi(l)?`M${l[0]},${l[1]}`:"",o.latElliptic){const r=t=>{l=o.project(t),Vi(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)},n=Math.max(.01,Math.min(s,Math.abs(i-e)/20,1));let h=e+n;for(;h<=i-n+1e-9;)r([h,t]),h+=n;e<i&&r([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),this.setVisible(!0)}else this.setVisible(!1)}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+=Vi(l)?`M${l[0]},${l[1]}`:"",o.lonElliptic){const r=t=>{l=o.project(t),Vi(l)&&(a+=a?` L${l[0]},${l[1]}`:`M${l[0]},${l[1]}`)},n=Math.max(.01,Math.min(s,Math.abs(i-e)/20,1));let h=e+n;for(;h<=i-n+1e-9;)r([t,h]),h+=n;e<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),this.setVisible(!0)}else this.setVisible(!1)}}class Eh extends fh{constructor(t,e){super(t,"rm-axis-grid"),this.second=e,this._latPool=new Sh(this,Ih),this._lonPool=new Sh(this,Ih)}_doInitStyles(){this.ignorePointer()}prepare(t,e){this._latPool.prepare((e.y2-e.y1)/e.latStep+1,null,(t=>{ft.setNoScale(t.dom)})),this._lonPool.prepare((e.x2-e.x1)/e.lonStep+1,null,(t=>{ft.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 at.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;ft.setImportantStyle(this.dom.style,"pointer-events","none"),ft.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 Th extends se{constructor(t){super(t,"rm-axis-tick"),this.add(this._labelLayer=new se(t,"rm-axis-tick-labels")),this._labelPool=new Sh(this._labelLayer,Qe)}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 Nh extends fh{constructor(t,e){super(t,"rm-map-axis"),this.second=e,this.add(this._gridView=new Eh(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)),at.create(i,s)}_doLayout(t){this._gridView.visible&&(this._gridView.resize(this.width,this.height),this._gridView.layout())}$_calcSteps(t){const e=t.chart.globalMapBound,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 $h extends ph{}class Vh extends fh{constructor(t,e){super(t),this.add(this._pathView=new oe(t)),e.add(this._labelView=new $h(t,"rm-axis-guide-label"))}remove(){return this._labelView.remove(),super.remove()}_doMeasure(t,e,i,s){return this.setClass(e instanceof Cr?"rm-axis-range-guide":"rm-axis-line-guide"),{width:i,height:s}}_doLayout(t){const e=this.model,i=e.prop("type"),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(e.label.prop("text")),"range"===i){const i=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderRange(e,t,r),s.internalSetStyle("strokeWidth",`${i}px`)}else if("band"===i){o||(this.add(o=this._fromView=new oe(this.doc)),this.add(a=this._toView=new oe(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 i=(parseFloat(getComputedStyle(o.dom).strokeWidth)||1)/t.tf.scale;o.internalSetStyle("strokeWidth",`${i}px`),a.internalSetStyle("strokeWidth",`${i}px`),n=this.$_renderBand(e,t,r),s.internalSetStyle("stroke","none")}else{const i=(parseFloat(getComputedStyle(s.dom).strokeWidth)||1)/t.tf.scale;o&&(o.remove(),a.remove(),this._fromView=this._toView=null),n=this.$_renderLine(e,t,r),s.internalSetStyle("fill","none"),s.internalSetStyle("strokeWidth",`${i}px`)}s.setPath(n).internalSetStyle("transform",t.trans)}$_renderLine(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e;let a,h;if("lat"===t.prop("axis")){const r=t.prop("position"),o=s.h1,a=s.h2;h=kh.horizontalLineToRight(r,o,a,n),this.$_renderLatLabel(o,r,e,i)}else{const n=t.prop("position"),a=s.v1,l=s.v2;h=kh.verticalLineToUp(n,a,l,o),this.$_renderLonLabel(n,l,r,e.tf,i)}const l=r.second;return a=kh.coordsToPath(h.map((t=>r.project(t)))),l&&(a=[...a,...kh.coordsToPath(h.map((t=>l.project(t))))]),a}$_renderBand(t,e,i){const{prj:s}=e,r=s.second;let n=[];n="lat"===t.prop("axis")?this.$_renderBandLat(t,e,i):this.$_renderBandLon(t,e,i);let o=kh.coordsToPath(kh.toPixelCoord(s,n));return r&&(o=[...o,...kh.coordsToPath(kh.toPixelCoord(r,n))]),o}$_renderBandLon(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e,a=r.second;let h=[];const l=Math.min(t.prop("from"),t.prop("to")),c=Math.max(t.prop("from"),t.prop("to")),d=s.v1,_=s.v2;h.push(...kh.verticalLineToUp(l,d,_,n));const u=[...h],p=kh.verticalLineToDown(c,d,_,n);h.push(...p);let g=kh.coordsToPath(u.map((t=>r.project(t)))),m=kh.coordsToPath(p.map((t=>r.project(t))));return a&&(g=[...g,...kh.coordsToPath(u.map((t=>a.project(t))))],m=[...m,...kh.coordsToPath(p.map((t=>a.project(t))))]),this._fromView.setPath(g),this._toView.setPath(m),this.$_renderLonLabel(l,_,r,e.tf,i),h}$_renderBandLat(t,e,i){const{map:s,prj:r,latInterval:n,lonInterval:o}=e,a=r.second;let h=[];const l=Math.min(t.prop("from"),t.prop("to")),c=Math.max(t.prop("from"),t.prop("to")),d=s.h1,_=s.h2;h.push(...kh.horizontalLineToRight(l,d,_,n));const u=[...h];h.push(...kh.verticalLineToUp(_,l,c,o));const p=kh.horizontalLineToLeft(c,d,_,n);return h.push(...p),h.push(...kh.verticalLineToDown(d,l,c,o)),this.$_renderBandLatFromView(u,r,a),this.$_renderBandLatToView(p,r,a),this.$_renderLatLabel(d,c,e,i),h}$_renderBandLatToView(t,e,i){let s=kh.coordsToPath(t.map((t=>e.project(t))));i&&(s=[...s,...kh.coordsToPath(t.map((t=>i.project(t))))]),this._toView.setPath(s)}$_renderBandLatFromView(t,e,i){let s=kh.coordsToPath(t.map((t=>e.project(t))));i&&(s=[...s,...kh.coordsToPath(t.map((t=>i.project(t))))]),this._fromView.setPath(s)}$_renderRange(t,e,i){const{prj:s}=e,r=s.second;let n;const[o,a]=t.prop("from"),[h,l]=t.prop("to");if(t.prop("elliptic")){const t=[Math.min(o,h),Math.min(a,l)],e=Math.abs(h-o),i=Math.abs(l-a);n=kh.ellipse(t[0],t[1],e,i,s),r&&(n=[...n,...kh.ellipse(t[0],t[1],e,i,r)])}else n=kh.box(o,a,h,l,s),r&&(n=[...n,...kh.box(o,a,h,l,r)]);if(i.visible){const t=Math.min(o,h),r=Math.max(a,l),n=s.project([t,r]);n.outside?i.visible=!1:i.visible||(i.visible=!0),i.trans(n[0]*e.tf.scale+e.tf.tx,n[1]*-e.tf.scale+e.tf.ty-i.bbox().height)}return n}$_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.prop("type")?n+=t>=0?-a.width-6:6:n+=6,r.trans(n,o)}}class Rh extends uh{constructor(t){super(t,"rm-crosshair-flag"),this.add(this._back=new as(t,"rm-crosshair-flag-back")),this.add(this._text=new Qe(t))}prepare(t){this.internalResetStyleOrClass(t._style),this._back.internalResetStyleOrClass(t.prop("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 Dh extends fh{constructor(t){super(t,"rm-crosshair"),this._bounds={x1:0,x2:0,y1:0,y2:0},this.add(this._latLine=new Ih(t,"rm-crosshair-line")),this.add(this._lonLine=new Ih(t,"rm-crosshair-line")),ft.setImportantStyle(this._latLine.dom.style,"pointer-events","none"),ft.setImportantStyle(this._latLine.dom.style,"fill","none"),ft.setImportantStyle(this._lonLine.dom.style,"pointer-events","none"),ft.setImportantStyle(this._lonLine.dom.style,"fill","none"),this.add(this._latFlag=new Rh(t)),this.add(this._lonFlag=new Rh(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),this._lonFlag.prepare(this.model.flag),this}render(t,e){const i=this.model,s=i.chart,r=i.chart.globalMapBound,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 Yn?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.globalMapBound,o=this._bounds.y1,a=this._bounds.y2,h=t[0],l=this._lonLine,c=this._lonFlag,d=this.parent,_=s instanceof Yn;_?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.globalMapBound,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 Yn;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 Oh="rm_map_globe_fill";class Bh extends oe{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=zi.rectangle(i,s,r,n);if(this.setPath(c),(h.lonElliptic||h.latElliptic)&&!(h instanceof Yn)){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.prop("globeFill"),h=Math.max(s,r)/2;let l=!this.control.hasDef(Oh);return i=zi.circle(n+h,o+h,h),a!==this._globeFill&&(this.control.removeDef(Oh),l=!0),l&&a&&this.$_applyGlobeBgDef(t,a),a&&this.setFill(`url(#${Oh})`),this.internalSetStyleOrClass(e._style),i}$_applyGlobeBgDef(t,e){const i={id:Oh,cx:"0.4",cy:"0.4",r:"1",color:["white",e]};this.control.addDef(new xe(i).getElement(t,i)),this._globeFill=e}}class Fh extends oe{constructor(t,e,i){super(t,e),this.setLine(i)}setLine(t,e,i,s){et.isNum(t)?this.setPath(zi.line(t,e,i,s)):t&&this.setPath(zi.line(t.x1,t.y1,t.x2,t.y2))}setVLine(t,e,i){this.setPath(zi.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(zi.line(t,e,t,i))}setHLine(t,e,i){this.setPath(zi.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(zi.line(e,t,i,t))}}class zh extends oe{constructor(t,e,i,s){super(t,e),i&&this.setLines(i,s)}setLines(t,e){et.isNum(t[0])?this.setPath(zi.lines(...t)):i(t[0])?this.setPath(zi.lines3(...t)):this.setPath(zi.lines2(...t))}}var jh;class Gh extends Sh{constructor(t,e,i){super(t,e,i,0)}_getElementId(t){return t.point.pid}}class Hh extends ph{constructor(t){super(t,"rm-point-label")}}class Wh extends se{constructor(t,e){super(t,"rm-point-labels "+e),this._labels=[new Sh(this,Hh),new Sh(this,Hh)],this._maps=[],this.ignorePointer()}isEmpty(){return this._labels[0].isEmpty&&this._labels[1].isEmpty}$_prepareLabel(t,e,i,s,r,n){var o,a;const h=jt(null===(o=r.chart)||void 0===o?void 0:o.general.prop("locale"))&&null!==(a=n.prop("textEn"))&&void 0!==a?a:n.prop("text"),{label:l,isCallbackExecuted:c}=r.getPointText(s,i,h);e.point=s,e.setModel(t,n,null,null),e._text.internalResetStyleOrClass(n._style),e._text.internalSetStyleOrClass(r.getPointLabelStyle(s)),l?(n.prepareRich(l),n.buildSvg(e._text,e._outline,NaN,NaN,n,n.getTextDomain(s),!c)):(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){if(!t)return;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 Yh extends uh{constructor(t){super(t),this.add(this._line=new zh(t,"rm-callout-line")),this._line.internalSetImportantStyle("fill","none"),this.add(this._dummy=new oe(t)),this._dummy.internalSetStyle("visibility","hidden"),this.add(this._anchor=new oe(t,"rm-callout-anchor"))}render(t,e,i,s){const r=t.series,n=this._anchor,o=this._line;if(this._dummy.setPath(zi.circle(0,0,1e4)),this._dummy.trans(i[0],i[1]),n.setVisible(t.anchorPoint.visible)){const s=Jh.getDrawer(t.series.getCalloutShape(e)),o=t.anchorPoint.prop("radius");n.internalClearStyleAndClass(),t.prop("useSeriesColor")&&n.internalSetStyleOrClass(r._style),n.internalSetStyleOrClass(t.anchorPoint._style),n.setPath(s(o,o)),n.trans(i[0],i[1])}return o.internalClearStyleAndClass(),t.prop("useSeriesColor")&&this._line.internalSetStyleOrClass(r._style),o.internalSetStyleOrClass(t._style),o.setLines(i,!1),s&&t.prop("usePointColor")&&(n.visible&&n.setFill(s),o.setStroke(s)),this}setColor(t){return t&&(this._line.setStroke(t),this._anchor.setFill(t)),this}}class Zh extends he{constructor(t){super(t),this.add(this._back=new as(t)),this._back.setAttr("fill","#fff"),this.add(this._mask=new oe(t)),this._mask.setAttr("fill","#000")}setBackground(t){return this._back.setRect(t),this}setCircle(t,e,i){return this._mask.setPath(zi.circle(t,e,i)),this}setRects(t,e){return t&&e?this._mask.setPath(zi.rect(t).concat(zi.rect(e))):this._mask.setPath(zi.rect(t)),this}}class Uh extends se{constructor(t,e){super(t,e),this._callouts=new Sh(this,Yh),this._map={},this.add(this._maskLayer=new se(t)),this._masks=new Sh(this._maskLayer,Zh),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){if(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 Xh extends ae{constructor(t,e=!1){super(t,Jh.POINT_CLASS,e),this._static=!0}tooltipColor(){return this.getFill()}setVisible(t){const e=super.setVisible(t);if(!e&&this.point){Jh.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 Kh extends se{}const qh={};class Jh extends fh{static register(...t){t.forEach((t=>{qh[t[0].type]=t[1]}))}static seriesOf(t){let e=t.parent;for(;e;){if(e instanceof jh)return e;e=e.parent}}static _createDrawers(...t){const e={};return t.forEach((t=>{e[t]=e=>zi[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=ie.createElement(t,"defs")),this.add(this._pointLayer=new se(t)),this._pointLayer.add(this._pointContainer=new Kh(t,"rm-series-points")),this.add(this._calloutContainer=new Uh(t,"rm-series-callouts")),i&&(this._labelContainer=this._createLabelContainer(t,e))}$_setInRegion(){return this._inRegion=!0,this}needClip(){return!1}resolveBoundsClip(t,e,i,s,r){return t}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.isInteractive()?"":"none"),e instanceof wa?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;if(this._wBody=t,this._hBody=e,this._transInfo=i,this._doRender(this.width,this.height),!(s instanceof wa)&&!s.isEmpty(!0)&&this.chart().animatable()){const t=s&&s.prop("loadAnimation"),e=!this.control.loaded&&this.chart().loadAnimatable();this._runShowEffect(t&&(e||s.dataLoaded||s.needAnimate)&&!s.isEmpty(!0))}s.dataLoaded=!1,s.needAnimate=!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(Qh.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=_(s,i.lon),r=u(r,i.lon),n=_(n,i.lat),o=u(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,i=!1){const s=this.pointByDom(t,e);if(s){const t=this.chart().selection;i&&!t.contains(s.point)?t.add(this.model,[s.point],!0):t.toggle(this.model,s.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 Wh(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 A(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&&et.log("CLICKED: ",t.point.name,t.point.getValue())}}jh=Jh,Jh.POINT_CLASS="rm-point",Jh.DATA_HOVER="hover",Jh.DATA_UNHOVER="unhover",Jh.LEGEND_MARKER="rm-legend-item-marker",Jh._drawers=Object.assign({circle:t=>zi.circle(0,0,t)},jh._createDrawers("square","diamond","triangle","itriangle","star","rectangle"));class Qh extends ie{static isClusterView(t){return ft.isChildOf(t,this.CLASS_NAME)}constructor(t){super(t,"rm-point-cluster"),this.add(this._shape=new oe(t)),this.add(this._label=new Qe(t,"rm-point-cluster-label"))}setCluster(t){this._cluster=t}render(t,e){const i=[],s=f-.001;let r=0;this._cluster.points.forEach((t=>{t.moves>=1&&r++})),t--,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(s)),t++,i.push("L",t*c(s),t*d(s)),i.push("A",t,t,0,1,0,t*c(0),t*d(0),"Z"),t-=3,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(s)),t++,i.push("L",t*c(s),t*d(s)),i.push("A",t,t,0,1,0,t*c(0),t*d(0),"Z"),t-=2,i.push("M",t*c(0),t*d(0)),i.push("A",t,t,0,1,1,t*c(s),t*d(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)}}Qh.CLASS_NAME="rm-point-cluster";class tl extends Xh{beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}prepare(){this._checkStatic()}}class el extends Jh{constructor(t,e,i,s){super(t,e,i,s),this._markers=this._createMarkers(this._pointContainer)}getHintDistance(){return this.model.prop("hintDistance")}_getPointPool(){return this._markers}}class il extends Xh{prepare(t,e){return this.point=t,this._ext=et.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 sl extends Jh{_getSeriesExt(t,e){return{...t.getMinMax(e),minSize:+t.prop("minSize")}}}class rl extends il{constructor(t){super(t,!0),this.add(this._contentLayer=new se(t)),this.add(this._baseLine=new Fh(t,"rm-spark-series-base-line"))}_renderBaseLine(t,e,i,s){this._baseLine.internalResetStyleOrClass(t._style),this._baseLine.setHLine(s,0,i)}}class nl extends sl{_getSeriesExt(t,e){const i=super._getSeriesExt(t,e);return t._pointDomain||(i.min=Math.min(i.min,A(t._minValue,i.min)),i.max=Math.max(i.max,A(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.prop("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 ol extends Xh{constructor(t){super(t,!0)}beginHover(t,e){}setHoverRate(t,e,i){}endHover(t,e){}distance(t,e,i){return 0}}class al extends Jh{constructor(t,e,i,s){super(t,e,i,s),this._gauges=this._createGauges(this._pointContainer)}_getPointPool(){return this._gauges}}class hl extends Lh{constructor(t){super(t,hl.CLASS_NAME),this.add(this._imageView=new sh(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.prop("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)}}hl.CLASS_NAME="rm-image-annotation";class ll extends Lh{constructor(t){super(t,ll.CLASS_NAME),this.add(this._shapeView=new oe(t))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return this._deflatePaddings(r),zi.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)}}ll.CLASS_NAME="rm-shape-annotation";class cl extends Lh{constructor(t){super(t,cl.CLASS_NAME),this.add(this._textView=new Qe(t)),this._textView.anchor=Ke.START,this._richText=new hi}_doMeasure(t,e,i,s){const r=e.getSize(i,s),n=this._textView;e.prop("writingMode")&&this._textView.setStyle("writingMode",e.prop("writingMode")),e.prop("textOrientation")&&this._textView.setStyle("textOrientation",e.prop("textOrientation")),this._deflatePaddings(r),this._richText.setFormat(e.prop("text")),this._richText.build(n,i,s,null,e._domain);const o=ct(this._textView.bbox());return{width:A(r.width,o.width),height:A(r.height,o.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)}}cl.CLASS_NAME="rm-text-annotation";class dl{static reveal(t,e){new ul(t,e)}static grow(t,e){new gl(t,e)}static spread(t,e){new ml(t,e)}static fadeIn(t){new _l(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 _l extends dl{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:Rt.DURATION,fill:"none"})}}class ul extends dl{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:Rt.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:R(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:R(t.height)}],this.$_aniOptions(i))}$_bottom(t,e,i){return e.dom.firstElementChild.animate([{transform:`translateY(${t.height}px)`},{transform:""}],this.$_aniOptions(i))}}class pl extends Rt{constructor(t,e){super(),this._series=t,this.endHandler=e,this.start()}_canUpdate(){return this._series.parent instanceof ie}_stop(){super._stop(),this._series=null}}class gl extends pl{_doUpdate(t){return this._series.setGrowRate(t),!0}_doStop(){this._series.setGrowRate(NaN)}}class ml extends pl{_doUpdate(t){return this._series.setPosRate(t),!0}_doStop(){this._series.setPosRate(NaN)}}class fl extends oe{constructor(){super(...arguments),this.labelViews=[]}layout(t,e,i,s,r,n){this.x=t,this.setPath(zi.bar(t-i/2,e,i,-s,r,n))}}class bl extends rl{constructor(t){super(t),this._groupCenter=null,this._bars=new Sh(this._contentLayer,fl)}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}getGroupCenter(){return this._groupCenter}render(t,e,i,s,r,n,o){const a=t._categories||[],h=t.getFieldColors(),{min:l,max:c,base:d}=t.getPointExtents(i,e),_=i.length,u=r/_,p=u*s.barWidth,g=s.barWidth>1&&!s.overflow,m=s.pad,f=c===l||isNaN(d)?0:(d-l)/(c-l)*n,b=n-f;let y=1/0,w=-1/0,x=1/0,v=-1/0,S=!1;this._bars.forEach(((e,s)=>{const d=i[s];if(e.setVisible(!isNaN(d))){const i=((c!==l?(d-l)/(c-l)*n:0)-f)*o;let _=m+u*s+(u-p)/2;g&&(_+p>m+r&&(_=m+r-p),_=Math.max(_,m)),e.setPath(zi.bar(_,b,p,-i,0,0));const C=_+p/2,P=b-i/2,M=p/2,L=Math.abs(i)/2;C-M<y&&(y=C-M),C+M>w&&(w=C+M),P-L<x&&(x=P-L),P+L>v&&(v=P+L),S=!0,e.internalClearStyleAndClass(),a[s]&&a[s].color?e.setFill(a[s].color):h&&e.setFill(h[s%h.length]);const A=t._style;A&&"string"!=typeof A&&A.stroke&&e.setStroke(A.stroke)}})),this._groupCenter=S?{cx:(y+w)/2,cy:(x+v)/2,halfW:(w-y)/2,halfH:(v-x)/2}:null,this._renderBaseLine(t.baseLine,!1,this.width,b)}}class yl extends nl{constructor(t){super(t,"rm-bar-series",!0,!1),this._labelInfo={},this._hoverBar=null,this._bars=new Gh(this._pointContainer,bl)}_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,A(this.growRate,1))}_doReset(){this._hoverBar=null}_doPointerMoved(t,e,i){var s,r,n,o;const a=this._bars.elementOf(i)||null;if(a!==this._hoverBar&&((null===(s=this._hoverBar)||void 0===s?void 0:s.point)&&(null===(n=null===(r=this._labelContainer)||void 0===r?void 0:r.get(this._hoverBar.point,0))||void 0===n||n._text.restoreStyles()),this._hoverBar=a,null==a?void 0:a.point)){const t=this.model.pointLabel.prop("hoverStyle"),e=null===(o=this._labelContainer)||void 0===o?void 0:o.get(a.point,0);e&&t&&(e._text.saveStyles(),e._text.internalSetStyleOrClass(t))}return!0}_runShowEffect(t){t&&dl.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.prop("position"),_=r.getPosition,u=this._labelViews(),p=u&&s.subLabel.visible?s.subLabel:void 0,g=s.getCallout(),m=this._calloutViews(),f={pad:this._ext.pad,barWidth:s.prop("barWidth"),overflow:s.prop("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,P,M,L,A,k;if(g&&(C=r.getCallout(w))&&(P=C.map((t=>l.project(t))),b=P[P.length-1]),r.xPos=M=b[0],r.yPos=L=b[1],M*=c[0],L*=c[1],y=e(M,L,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),u&&(A=u.get(r,0))&&A.setVisible(t._static)){const e=_(r);A.setContrast(t.dom).layout(),A.transp(this.$_resolveLabelPosition(t,e,y,n,o,A,s.getLabelOff()))}if(p&&(A=u.get(r,1))&&A.setVisible(t._static)){const e=p.getPosition(r);A.setContrast(t.dom).layout(),A.transp(this.$_resolveLabelPosition(t,e,y,n,o,A,s.getSubLabelOff()))}if(m&&P&&(k=m.get(r))&&k.setVisible(t._static)){const e=P.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())}}}))}$_resolveLabelPosition(t,e,i,s,r,n,o){const a=this._getLabelPositioner(e,"bottom");let h=i.x+s/2,l=i.y+r/2,c=s/2,d=r/2;if("center"===e||"top"===e||"bottom"===e){const e=t.getGroupCenter();e&&(h=i.x+e.cx,c=e.halfW,l=i.y+e.cy,d=e.halfH)}return a(h,l,n.bbox(),c,d,o)}}class wl extends tl{tooltipColor(){return getComputedStyle(this.dom).fill}}class xl extends el{constructor(t){super(t,"rm-bubble-series",!0,!1)}_createMarkers(t){return new Gh(t,wl)}_doPrepeare(t,e,i){this.$_prepareMarkers(e,e._visPoints)}_doRender(t,e){this.$_layoutMarkers(t,e,A(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&dl.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 Yn){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=Hn*this._scale;const c=kh.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.prop("rotation")||0,c=[this._scale,-this._scale],d=n.prop("position"),u=this._getLabelPositioner(n.subLabel.prop("position"),"right"),p=Jh.getDrawer(n.getShape()),g=this._labelViews(),m=n.getLabelOff(),f=n.getSubLabelOff(),b=n.getCallout(),y=this._calloutViews(),{min:w,max:x}=n.getPixelMinMax(_(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||d,"center");let l,_,p,P,M,L,A=(t._radius=n.getRadius(o.getValue(),w,x))*o.vrate()*i;if(b&&(l=o.getCallout(a))&&(_=l.map((t=>h.project(t))),v=_[_.length-1]),o.xPos=p=v[0],o.xPos=P=v[1],p*=c[0],P*=c[1],S=e(p,P,2*A,2*A),S.x+=A,S.y+=A,this.model.alignToSurface?r(t,A,a):s(t,A,S),g){if(M=g.get(o,0)){let e=this._getLabelPositioner(C(o),"center");this._layoutLabel(M,t.dom).transp(e(S.x,S.y,M.bbox(),A,A,m))}(M=g.get(o,1))&&this._layoutLabel(M,t.dom).transp(u(S.x,S.y,M.bbox(),A,A,f))}if(y&&_&&(L=y.get(o))&&L.setVisible(t._static)){const e=_.flat().map(((t,e)=>t*c[e%2]));y.setMask(L,e).setCircle(e[e.length-2],e[e.length-1],A),L.render(b,o,e,t.getFill())}}}))}}class vl extends oe{static create(t,e,i,s,r,n,o,a,h=!0){return new vl(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 vl(t,e,{cx:i,cy:s,rx:r,ry:n,innerRadius:o,start:a,angle:h,clockwise:l})}constructor(t,e=It,i=It){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 zi.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 zi.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 Sl=function(t){return isNaN(t)?0:t};class Cl{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 n(t)?this._path.push("M",Sl(t),Sl(e)):this._path.push("M",Sl(t.x),Sl(t.y)),this}moveBy(t,e){return n(t)?this._path.push("m",Sl(t),Sl(e)):this._path.push("m",Sl(t.x),Sl(t.y)),this}movep(t,e){return n(t)?this._path.push("M",D(t),D(e)):this._path.push("M",D(t.x),D(t.y)),this}line(t,e){return n(t)?this._path.push("L",Sl(t),Sl(e)):this._path.push("L",Sl(t.x),Sl(t.y)),this}linep(t,e){return n(t)?this._path.push("L",D(t),D(e)):this._path.push("L",D(t.x),D(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(n(t[0]))for(let e=0;e<t.length;e+=2)this._path.push("L",Sl(t[e]),Sl(t[e+1]));else for(let e=0;e<t.length;e++)this._path.push("L",Sl(t[e].x),Sl(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 Pl extends oe{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 Cl;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 Ml=class extends oe{render(t,e){const i=t.getRadius(e);return i!==this._radius&&(this._radius=i,this.setPath((new Cl).circle(0,0,i).end())),this.internalResetStyleOrClass(t._style),this}};class Ll extends ol{constructor(t){super(t),this.add(this._faceView=new vl(t,"rm-circle-gauge-face")),this.add(this._rimView=new vl(t,"rm-circle-gauge-rim")),this.add(this._valueView=new vl(t,"rm-circle-gauge-value")),this.add(this._textView=new Qe(t,"rm-circle-gauge-text")),this.add(this._handContainer=new se(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 Pl(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 Ml(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=_(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.prop("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._props,o=s.getValue(),a=t.getValueRate(o)*r,h=t.valueRim.getThickness(i.radiusThick),l=this._textView;if(this._valueView.visible){const s=t.valueRim,r=i.value+(s.prop("stroked")?0:h/2),o=this._valueView;o.internalResetStyleOrClass(s._style),s.prop("stroked")&&(o.setFill("none"),o.internalSetStyle("strokeWidth",R(h))),o.setBoolData("stroked",s.prop("stroked")),o.setSectorEx({cx:e.x,cy:e.y,rx:r,ry:r,innerRadius:(r-h)/r,start:n._startRad,angle:n._sweepRad*a,clockwise:t.prop("clockwise")},s.prop("stroked"))}if(l.visible){const i=t.gaugeLabel;l.text=i.getNumberText(o,!1,!1,void 0),i.buildSvg(l,null,NaN,NaN,t,i._domain);const s=l.bbox(),r=i.getOffset(this.width,this.height);l.trans(e.x+r.x,e.y-s.height/2+r.y)}}}class Al extends al{constructor(t){super(t,"rm-circle-gauge",!0,!1)}_createGauges(t){return new Gh(t,Ll)}_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&&dl.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.prop("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)}}))}}class kl extends ie{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 Il extends Rt{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 El extends ol{constructor(t){super(t),this._rimThick=0,this._secRate=1,this.add(this._faceView=new kl(t,"rm-clock-gauge-face")),this.add(this._rimView=new vl(t,"rm-clock-gauge-rim")),this.add(this._labelView=new Qe(t,"rm-clock-gauge-label")),this._labelView.layout=qe.MIDDLE,this.add(this._tickContainer=new se(t,"rm-clock-gauge-ticks")),this.add(this._tickLabelContainer=new se(t,"rm-clock-gauge-tick-labels")),this.add(this._hourView=new oe(t,"rm-clock-gauge-hour")),this.add(this._minuteView=new oe(t,"rm-clock-gauge-minute")),this.add(this._secondView=new oe(t,"rm-clock-gauge-second")),this.add(this._pinView=new kl(t,"rm-clock-gauge-pin")),this._tickViews=new Sh(this._tickContainer,Fh,"rm-clock-gauge-tick"),this._tickLabelViews=new Sh(this._tickLabelContainer,Qe,"rm-clock-gauge-tick-label")}prepare(t,e){const i=Math.round(12/u(1,Math.floor(e.tickLabel.prop("step"))||1));this._tickViews.prepare(e.tick.visible?12:0),this._tickLabelViews.prepare(e.tickLabel.visible?i:0,(t=>{t.layout=qe.MIDDLE})),this._zoneCallback=e.prop("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.prop("active")&&isNaN(+s.time)?this._runner||(this._runner=setInterval((()=>{const e=this._prevSec;this.$_renderHands(t,this._exts),p(e-this._prevSec)>=1&&this._secondView.visible&&t.chart.animatable()&&t.secondHand.prop("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:l}=e,_=this._rimThick=r.visible?t.rim.getThickness(l):0,u=t.tick.prop("length")||0;s.setVisible(t.face.visible)&&(s.internalResetStyleOrClass(t.face._style),s.setCircle(a,h,l)),r.setVisible(t.rim.visible)&&(r.internalResetStyleOrClass(t.rim._style),r.setSector({cx:a,cy:h,rx:l,ry:l,innerRadius:1-_/l,start:0,angle:2*Math.PI,clockwise:!0}));const p=l-_;let g=p-u,m=b,y=f/12;if(this._tickViews.forEach(((e,i)=>{e.setLine(a+c(m)*p,h+d(m)*p,a+c(m)*g,h+d(m)*g),e.internalResetStyleOrClass(t.tick._style),m+=y})),!n.isEmpty){const e=12/n.count,i=f/12*e;m=b,n.get(0).text="12",g=p-(u+t.tickLabel.prop("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+c(m)*g,h+d(m)*g),s.internalResetStyleOrClass(t.tickLabel._style),m+=i}))}o.setVisible(t.pin.visible)&&(o.setCircle(a,h,t.pin.prop("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.prop("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=k(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 Cl;let d,_,u,p;d=t.hourHand,_=this._hourView,_.setVisible(d.visible)&&(p=f*(s/12+r/60/12+n/60/60/12),u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),o&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*w)),d=t.minuteHand,_=this._minuteView,_.setVisible(d.visible)&&(p=f*(r/60+n/60/60),u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),o&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*w)),d=t.secondHand,_=this._secondView,_.setVisible(d.visible)&&(p=this._secRate<1?f*(this._aniSec+this._secRate)/60:f*n/60,u=d.getLength(l-this._rimThick),c.rect(-d.prop("thickness")/2,-u,d.prop("thickness"),u),_.internalResetStyleOrClass(d._style),o&&d.prop("pmStyle")&&_.internalSetStyleOrClass(d.prop("pmStyle")),_.setPath(c.close()).trans(a,h).rotate(p*w),this._prevSec=n)}$_moveSecond(t,e){if(!isNaN(e)){this._aniSec=e;const i=new Il(this,t);i.duration=t.secondHand.prop("duration")||200,i.start()}}}class Tl extends al{constructor(t){super(t,"rm-clock-gauge",!0,!1)}_createGauges(t){return new Gh(t,El)}_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.prop("position"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=this._calloutViews(),d=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=_(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(d(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)}}))}}class Nl extends Xh{constructor(t){super(t,!0),this.add(this._back=new se(t)),this._back.add(this._figure=new ne(t)),this._back.add(this._textView=new ph(t,"rm-figure-series-inner-label"))}prepare(t,e,i,s){const r=this._textView,n=s.prop("text");this._clearScale(this._back),this._figure.setId(e.id).resize(e.width,e.height),i?(this._image||this._back.insertDom(this._image=ie.createElement(t,"use"),this._textView.dom),ft.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,ft.setAttrs(this._figure.dom,{x:e,y:s}),ft.setAttrs(i,{x:n,y:o})}if(s.visible){const t=s.bbox(),e=ft.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 $l extends Jh{constructor(t){super(t,"rm-figure-series",!0,!0),this._figure=this.$_createFigure(t),this._image=this.$_createImage(t),this._figures=new Gh(this._pointContainer,Nl)}$_createFigure(t){const e=ie.createElement(t,"symbol");return e.append(ie.createElement(t,"path")),this._addDef(e,"figure")}$_createImage(t){const e=ie.createElement(t,"image");return this._addDef(e,"image")}_getPointPool(){return this._figures}_doPrepeare(t,e,s){const r=e.figureBox,n=e.innerImage;ft.setAttr(this._figure,"viewBox",r?`0 0 ${r[0]} ${r[1]}`:null),ft.setAttr(this._figure.firstElementChild,"d",i(e.path)?e.path.join(" "):e.path),ft.setAttrs(this._image,{href:n.prop("url"),width:n.prop("width"),height:n.prop("height")}),this.$_prepareFigures(e,e._visPoints)}_doRender(t,e){this.$_layoutFigures(this._getGrowRate()),this._getGrowRate}_doReset(){}_runShowEffect(t){t&&dl.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.prop("rotation")||0,o=i.prop("position"),a=this._labelViews(),h=i.getLabelOff(),l=i.getCallout(),c=l&&"label"===l.prop("mode"),d=this._calloutViews(),_=s.getPosition,u=i.innerImage.prop("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,P,M;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 L=isNaN(u)?1:(f.value-p.min)/(p.max-p.min);if(i.render(L,t),P=i._rBox,m=s(x,v,P.width,P.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),M=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],M,0,0,h))}else{const t=this._getLabelPositioner(_(f),"bottom");S.transp(t(m.x+P.width/2,m.y+P.height/2,M,P.width/2,P.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]));P.x=i.tx,P.y=i.ty,M&&(M.x=t[t.length-2],M.y=t[t.length-1]),d.setMask(C,t).setRects(P,M),C.render(l,f,t,i.getFill())}}}))}}class Vl extends Xh{constructor(t){super(t,!0),this.add(this._imageView=new sh(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 Rl extends Jh{constructor(t){super(t,"rm-image-series",!0,!0),this._images=new Gh(this._pointContainer,Vl)}_getPointPool(){return this._images}_doPrepeare(t,e,i){this.$_prepareImages(e)}_doRender(t,e){this._layoutPoints(this._getGrowRate())}_doReset(){}_runShowEffect(t){t&&dl.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareImages(t){const e=this._visPoints,i=t.prop("imageWidth"),s=t.prop("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.prop("rotation")||0,n=[this._scale,-this._scale],o=e.prop("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())}}}))}}class Dl{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:Rt.DURATION,fill:"none"}}$_left(t,e){return e.dom.firstElementChild.animate([{width:"0"},{width:R(t.width)}],this.$_aniOptions())}}let Ol=class extends rl{constructor(t){super(t),this._contentLayer.addAll(this._back=new as(t),this._area=new oe(t,"rm-line-series-area"),this._line=new oe(t,"rm-line-series-line"),this._lowLine=new oe(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.prop("curved"),_=new Cl;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}};class Bl extends nl{constructor(t){super(t,"rm-line-series",!0,!1),this._lines=new Gh(this._pointContainer,Ol)}_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,A(this.growRate,1))}_doReset(){}_legendColorProp(){return"stroke"}_runShowEffect(t){t&&this._lines.forEach((t=>new Dl(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.prop("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,P,M,L,A;if(g&&(S=r.getCallout(y))&&(C=S.map((t=>l.project(t))),f=C[C.length-1]),r.xPos=P=f[0],r.yPos=M=f[1],P*=c[0],M*=c[1],b=e(P,M,x,v),t.render(s,a&&h,r.values,x,v,i*r.vrate()),t.trans(b.x,b.y).rotate(this.rotation),p&&(L=p.get(r,0))&&L.setVisible(t._static)){const t=this._getLabelPositioner(_(r),"bottom");L.layout().transp(t(b.x+x/2,b.y+v/2,L.bbox(),x/2,v/2,u))}if(m&&C&&(A=m.get(r))&&A.setVisible(t._static)){const e=C.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())}}}))}}class Fl{static interpolate(t,e){const i=Math.max(1,Math.ceil(Math.abs(e-t))),s=[];for(let r=0;r<=i;r++)s.push(t+(e-t)*r/i);return s}}const zl="rm-map-series-id-";class jl extends Xh{static idClass(t){return zl+t.id}static getId(t){for(const e of Array.from(t.classList))if(e.startsWith(zl))return e.substring(17)}constructor(t){super(t)}setModel(t){var e;t!==this.model&&(this.setPath((this.model=t).path),this.setAttrEx("fill-rule",(null===(e=t.source)||void 0===e?void 0:e.holes)?"evenodd":null))}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(jl.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 Gl(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 Gl extends oe{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 Hl extends oe{constructor(t){super(t)}setModel(t,e){t!==this.model&&(this.model=t,this.setPath(t[e]))}reset(){this.model=null}}class Wl extends oe{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 Yl extends oe{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=_(e,t[n][0]),s=u(s,t[n][0]),i=_(i,t[n][1]),r=u(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 Zl extends ph{constructor(t){super(t,"rm-point-label rm-point-inset")}}class Ul extends se{constructor(t){super(t,"rm-point-labels rm-map-inset"),this._labels=[new Sh(this,Zl),new Sh(this,Zl)],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 Xl extends Jh{constructor(t){super(t,"rm-map-series",!0,!1),this._boundsClip=null,this._areas={},this._insetLabelContainer=new Ul(t),this._areaPool=new Gh(this._pointContainer,jl),this._insetPool=new Sh(this._pointContainer,Yl),this._hoverStrokeView=new Gl(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.prop("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.prop("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=this.dom.contains(e)&&jl.getId(e);if(t)return this._areas[t];break}e=e.parentElement}}getIntersectedAreas(t){const e=[];return this._areaPool.forEach((i=>{ft.isIntersectRectPath(t,i.dom,.4)&&e.push(i)})),e}needClip(){return!0}resolveBoundsClip(t,e,i,s,r){var n,o,a;const h=this.model.map,l=null==h?void 0:h.source;if(!(l instanceof jn&&l.bounds)||h.isWorld)return null===(n=this._boundsClip)||void 0===n||n.remove(),this._boundsClip=null,t;if(r.isGlobe)return null===(o=this._boundsClip)||void 0===o||o.remove(),this._boundsClip=null,t;const c=h.h1,d=h.v1,_=h.h2,u=h.v2,p=(t,n)=>{const[o,a]=r.project([t,n]);return[o*e+i,-a*e+s]},g=[];Fl.interpolate(c,_).forEach((t=>g.push(p(t,u)))),Fl.interpolate(u,d).slice(1).forEach((t=>g.push(p(_,t)))),Fl.interpolate(_,c).slice(1).forEach((t=>g.push(p(t,d)))),Fl.interpolate(d,u).slice(1).forEach((t=>g.push(p(c,t))));const m=`M${g[0][0]},${g[0][1]} `+g.slice(1).map((t=>`L${t[0]},${t[1]}`)).join(" ")+" Z";return this._boundsClip&&this._boundsClip.dom.parentElement?this._boundsClip.setPath(m):(null===(a=this._boundsClip)||void 0===a||a.remove(),this._boundsClip=this.control.clip(new de(this.doc).setPath(m))),this._boundsClip}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.prop("bringToFront")?[]:null;this._insets=s._insets,s.hasInternals&&e.internalBorder.visible?(this._internalContainer||(this._pointLayer.add(this._internalContainer=new se(t,"rm-map-series-internals")),this._internalPool=new Sh(this._internalContainer,Hl)),this._internalContainer.setVisible(!0)):this._internalContainer&&this._internalContainer.setVisible(!1),s.hasExternals&&e.externalBorder.visible?(this._externalContainer||(this._pointLayer.add(this._externalContainer=new se(t,"rm-map-series-externals")),this._externalPool=new Sh(this._externalContainer,Hl)),this._externalContainer.setVisible(!0)):this._externalContainer&&this._externalContainer.setVisible(!1),s.hasBorders&&o.length>0&&(this._borderContainer||(this._pointLayer.add(this._borderContainer=new se(t,"rm-map-series-borders")),this._borderPool=new Sh(this._borderContainer,Wl))),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(),ft.setNoScale(t.dom)})),this._internalContainer&&this._internalContainer.visible&&this._internalPool.prepare(e.areaCount,((t,i)=>{const s=e.get(i);t.setModel(s,"internal"),ft.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"),ft.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),ft.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)=>{ft.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){return this.hoverArea=this.areaOfDom(i),!0}_doPointClicked(t){this.model.chart._areaClicked(this.model,t.model)}_runShowEffect(t){t&&dl.grow(this)}_doViewRateChanged(t){this.$_layoutAreas(this.width,this.height)}onScrollStart(){super.onScrollStart(),this.hoverArea=null}onScrollEnd(){super.onScrollEnd();const t=Object.values(this._areas);this._hoverStrokeView.refresh(),t.forEach((t=>{var e;return t.model.selected&&(null===(e=t.strokeView)||void 0===e?void 0:e.refresh())}))}onRotationStart(){super.onRotationStart(),this.hoverArea=null}onRotationEnd(){super.onRotationEnd();const t=Object.values(this._areas);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=i.getProjection(),h=this._areas={},l=this._insets,c=n.prop("allAreas"),d=this._labelViews(),_=this._insetLabelContainer.visible?this._insetLabelContainer:null,u=n.insetLabel,p=n.prop("nullStyle"),g=n.prop("dummyStyle"),m=n.prop("selectStyle")||n.prop("selectedStyle"),f=this._scale,b=this._areaPool;b.forEach(((t,e)=>{const i=t.model;if(i){const e=t.point,o=d&&e&&d.get(e,0);if(h[i.id]=t,t.setVisible(i.visible&&(c||!!e)&&!n.isHiddenArea(i.id))){const a=this.hoverArea===t;if(i.selected&&a&&(this.hoverArea=null),t.render(p,g,m,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*=f,a*=-f,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(b.get(e).visible)})),this._externalContainer&&this._externalContainer.visible&&this._externalPool.forEach(((t,e)=>{t.setVisible(b.get(e).visible)})),this._insetPool.forEach(((t,e)=>{const i=l[e];if(t.setVisible(!1!==i.visible)){const e=h[i.area],l=_&&!u.hideInsetLabel(i)&&_.get(i,0);let c;if(e){if(t.setVisible(e.visible)){if(d&&(c=d.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 o=r.toVisible(t);s&&this._layoutLabel(c,e.dom);const a=c.bbox();if(c.setVisible(!!o)){let[t,e]=o;t*=f,e*=-f,t-=a.width/2,e-=a.height/2,c.trans(t,e)}}t.render(i,a)}}else{const e=i._base;if(e)if(e[0]instanceof Jn){for(const t of e){if(!t.visible||n.isHiddenArea(t.id))return;if(d){const e=h[t.id];if(c=e&&d.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 o=r.toVisible(t);s&&this._layoutLabel(c,e.dom);const a=c.bbox();if(c.setVisible(!!o)){let[t,e]=o;t*=f,e*=-f,t-=a.width/2,e-=a.height/2,c.trans(t,e)}}}}t.render(i,a)}else if(e[0]>=0){const e=o.areaOf(i._parent);e&&e.visible&&!n.isHiddenArea(e.id)&&t.render(i,a)}}if(l&&l.setVisible(!c)){s&&l.layout();const e=t.center,i=l.bbox();let[r,n]=e;r*=f,n*=-f,r-=i.width/2,n-=i.height/2,l.trans(r,n)}}}))}getPointLabel(t){return t&&t.point?this._labelContainer.get(t.point,0):null}setHoverStyle(t,e){const i=this.model.prop("hoverColor"),s=this.model.prop("hoverStyle");t.internalSetStyles({filter:Xl.DefaultHoverFilter,strokeWidth:Xl.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.prop("hoverStyle");r&&(null==e||e._text.internalSetStyleOrClass(r))}}Xl.DefaultHoverFilter="var(--rm-map-series-hover-filter)",Xl.DefaultHoverStrokeWidth="var(--rm-map-series-hover-stroke-width)";class Kl extends fh{constructor(t,e,i){super(t,e),this._paddings=new Ht,this.add(this._background=new oe(t,i)),this.add(this._textView=new Qe(t))}setPoint(t){return this._point=t,this}measure(t,e,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=e.prop("text");n?(e.prepareRich(n),e.buildSvg(this._textView,i,r,e.getTextDomain(this._point))):this._textView.text="";const o=this._textView.bbox();let a=this.model.prop("backgroundStyle");s(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,r);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=Ke.MIDDLE;break;case"right":s+=i,e.anchor=Ke.END;break;default:e.anchor=Ke.START}e.trans(s,this._paddings.top)}}class ql extends Kl{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(zi.bar(0,i,e,-i,s,0))}}class Jl extends Kl{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(zi.bar(0,i,e,-i,0,s))}}class Ql extends Xh{constructor(t){super(t,!0),this.add(this._back=new se(t)),this._back.addAll(this._borderView=new as(t),this._headerView=new ql(t),this._bodyView=new Jl(t),this._divider=new Fh(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 tc extends Jh{constructor(t){super(t,"rm-panel-series",!0,!1),this._panels=new Gh(this._pointContainer,Ql)}_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&&dl.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.prop("position"),h=this._getLabelPositioner(r.pointLabel.prop("position"),"bottom"),l=this._labelViews(),c=r.getLabelOff(),d=r.getCallout(),_=this._calloutViews(),u=getComputedStyle(this._pointContainer.dom),p=A(u.rx,0);let g,m,f;this._panels.forEach(((u,b)=>{const y=u.point,w=[y.lon,y.lat];if(u.setVisible(!y.isNull&&null!=(g=n.getVisible(w)))){const b=this._getPointPositioner(y.position||a,"top");let x,v,S,C,P,M;if(d&&(x=y.getCallout(w))&&(v=x.map((t=>n.project(t))),g=v[v.length-1]),y.xPos=S=g[0],y.yPos=C=g[1],S*=o[0],C*=o[1],u.render(t,r,e,i,p,s),m=u._rBox,f=b(S,C,m.width,m.height),u.trans(f.x,f.y),l&&(P=l.get(y,0))&&P.setVisible(u._static)&&this._layoutLabel(P,u.dom).transp(h(f.x+m.width/2,f.y+m.height/2,P.bbox(),m.width/2,m.height/2,c)),_&&v&&(M=_.get(y))&&M.setVisible(u._static)){const t=v.flat().map(((t,e)=>t*o[e%2]));m.x=u.tx,m.y=u.ty,_.setMask(M,t).setRects(m),M.render(d,y,t,u.getFill())}}}))}}class ec extends vl{constructor(t){super(t,"rm-pie-series-sector")}setPieSector(t){this._assignShape(t,!1)}}class ic extends il{constructor(t){super(t,!0),this._sectors=new Sh(this,ec,null,.5),this._rdRate=1,this.add(this._circle=new kl(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.prop("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=e.length,r=t.prop("clockwise")?1:-1,n=e.reduce(((t,e)=>t+e),0),o=t._totalRad*i;let a=t._startRad;if(this._sectors.prepare(e.length,((t,i)=>{t.value=e[i]})),s>1)this._sectors.forEach((t=>{if(!isNaN(t.value)){const e=t.value/n||0;t.start=a,a+=t.angle=r*e*o}}));else if(1==s){const t=this._sectors.get(0);t.start=a,t.angle=o}}$_layoutSectors(t,e,i,s,r){const n=t._categories||[],o=t.getFieldColors(),a=t.prop("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:p(t.angle),clockwise:a}),t.internalClearStyleAndClass(),n[r]&&n[r].color?t.setFill(n[r].color):o&&t.setFill(o[r%o.length])}}))}}class sc extends sl{constructor(t){super(t,"rm-pie-series",!0,!1),this._pies=new Gh(this._pointContainer,ic)}_getPointPool(){return this._pies}_doPrepeare(t,e,i){this.$_preparePies(e,e._visPoints)}_doRender(t,e){this.$_layoutPies(t,e,A(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&dl.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.prop("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())}}}))}}class rc extends tl{constructor(t){super(t,!0),this.add(this._pin=new oe(t))}render(t){this._pin.setPath(zi.pin(t)),t.innerRd>0?(this._circle||this.add(this._circle=new kl(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 nc extends el{constructor(t){super(t,"rm-pin-series",!0,!0)}_createMarkers(t){return new Gh(t,rc)}_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.prop("rotation")||0,a=s.prop("position"),h=r.getPosition;s.pointLabel.prop("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,P,M;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&&(P=l.get(m,0))&&P.setVisible(r._static)){t&&this._layoutLabel(P,r.dom);const e=this._getLabelPositioner(h(m),"bottom");P.transp(e(p.x+y/2,p.y+w/2,P.bbox(),y/2,w/2,c))}_&&v&&(M=_.get(m))&&M.setVisible(r._static)&&M.render(d,m,v.flat().map(((t,e)=>t*n[e%2])),null)}}))}}class oc extends tl{}class ac extends el{constructor(t){super(t,"rm-point-series",!0,!0),this._pointLayer.add(this._clusterContainer=new se(t,"rm-point-clusters"))}_createMarkers(t){return new Gh(t,oc)}_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)||dl.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.prop("zoomLimit"))||t.chart.body.zoom<e.prop("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.prop("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.prop("rotation")||0,a=e.prop("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=Jh.getDrawer(e.getShape());let S,C,P,M,L,A;if(c&&(S=b.getCallout(y))&&(C=S.map((t=>s.project(t))),u=C[C.length-1]),b.xPos=P=u[0],b.yPos=M=u[1],P*=n[0],M*=n[1],p=m(P,M,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&&(L=h.get(b,0))&&L.setVisible(i._static)){this._layoutLabel(L,i.dom);let t=this._getLabelPositioner(g(b),"bottom");L.transp(t(p.x,p.y,L.bbox(),w,w,l))}if(d&&C&&(A=d.get(b))&&A.setVisible(i._static)){const t=C.flat().map(((t,e)=>t*n[e%2]));d.setMask(A,t).setCircle(t[t.length-2],t[t.length-1],w),A.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 Sh(this._clusterContainer,Qh)),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)}})))}}class hc extends Xh{constructor(t){super(t,!0),this._arrowClipPath=null,this.add(this._line=new oe(t)),this.add(this._arrow=new oe(t)),this.add(this._secondArrow=new oe(t)),this.add(this._image=this.$_createImage(t)),this.add(this._secondImage=this.$_createImage(t)),this._arrow.setStyleOrClass("rm-route-series-line"),this._arrow.setStyleOrClass("rm-route-series-arrow"),this._secondArrow.setStyleOrClass("rm-route-series-line"),this._secondArrow.setStyleOrClass("rm-route-series-arrow"),this._image.setStyleOrClass("rm-route-series-image"),this._secondImage.setStyleOrClass("rm-route-series-image")}get line(){return this._line}get arrow(){return this._arrow}get secondArrow(){return this._secondArrow}get image(){return this._image}get secondImage(){return this._secondImage}prepare(t){this._checkStatic();const e=t.getImageUrl(this.point,!1);e?this.point.imageUrl||(this.point.imageUrl=e):this.point.imageUrl=null}isEmpty(t,e,i){return t.length<=1||0===e.length||0===i.length}clear(){this._line.setPath(""),this._arrow.setPath(""),this._secondArrow.setPath(""),this._image.setVisible(!1),this._secondImage.setVisible(!1)}render(t,e,i,s,r,n,o){if(i.length<=1||0===s.length||0===r.length)return this._line.setPath(""),this._arrow.setPath(""),this._secondArrow.setPath(""),this._image.setVisible(!1),void this._secondImage.setVisible(!1);const a=t,h=i[i.length-2],l=i[i.length-1],c=V(Math.atan2(l[1]-h[1],l[0]-h[0]))-90,d=this.$_buildLinePath(s,r,n);if(this._line.setPath(d),this._arrow.setVisible(o)){this.$_drawArrow(this._arrow,l,a,e,c),this.$_drawImage(t,this.point,this._image,a,l,e);const s=this.$_createClipBoundary(t,l,a,e);let r=null,o=c;if(-1!==n){this._secondArrow.setVisible(!0);const s=i[n],h=n>0?i[n-1]:i[0];o=V(Math.atan2(s[1]-h[1],s[0]-h[0]))-90,this.$_drawArrow(this._secondArrow,s,a,e,o),this.$_drawImage(t,this.point,this._secondImage,a,s,e),r=this.$_createClipBoundary(t,s,a,e)}else this._secondArrow.setVisible(!1),this._secondImage.setVisible(!1);this.$_applyArrowClipping(i,n,s,c,l,r,o)}else this._arrowClipPath&&this._line.setClip(null)}setPath(t){return this._line.setPath(t),this._arrow.setVisible(!1),this._secondArrow.setVisible(!1),this}$_createInnerRect(t,e,i){const{minX:s,maxX:r,minY:n,maxY:o}=t,a=i[0],h=i[1],l=$(e),c=Math.cos(l),d=Math.sin(l),_=(t,e)=>{const i=t-a,s=e-h;return[a+i*c-s*d,h+i*d+s*c]},u=_(s,n),p=_(r,n),g=_(r,o),m=_(s,o);return`M ${u[0]} ${u[1]} L ${p[0]} ${p[1]} L ${g[0]} ${g[1]} L ${m[0]} ${m[1]} Z`}$_drawArrow(t,e,i,s,r){const n=i.prop("arrowWidth"),o=i.prop("arrowLength"),a=[`M ${e[0]} ${e[1]}`,`L ${e[0]-n*s} ${e[1]-o*s}`,`L ${e[0]+n*s} ${e[1]-o*s} Z`].join(" ");t.setPath(a),t.setRotation(e[0],e[1],r)}$_drawImage(t,e,i,s,r,n){const o=s.prop("imageWidth")*n,a=s.prop("imageHeight")*n;if(!e.imageUrl)return;const h=r[0]-o/2,l=r[1]-a/2;i.setVisible(!0),i.internalSetStyles({width:`${o}px`,height:`${a}px`,transformOrigin:`${o/2}px ${a/2}px`,transform:`translate(${h}px, ${l}px) scaleY(-1)`})}$_createClipBoundary(t,e,i,s){const r=i.prop("arrowWidth"),n=i.prop("arrowLength"),o=Math.max(r*s,t.getLineWidth()/2);return{minX:e[0]-o,maxX:e[0]+o,minY:e[1]-n*s,maxY:e[1]+5}}$_applyArrowClipping(t,e,i,s,r,n,o){let a="M -10000 -10000 L 10000 -10000 L 10000 10000 L -10000 10000 Z "+this.$_createInnerRect(i,s,r);if(n){const i=t[e];a+=" "+this.$_createInnerRect(n,o,i)}this._arrowClipPath?this._arrowClipPath.setPath(a):(this._arrowClipPath=this._line.clipPath(a),this._arrowClipPath.setAttr("clip-rule","evenodd"))}$_buildLinePath(t,e,i){const s=[];let r=0;for(let n=0;n<t.length;n++){const o=`${t[n][0]},${t[n][1]}`;if(-1!==i&&n===i+1){for(let t=n-1;t>=r;t--)s.push(`L ${e[t][0]},${e[t][1]}`);s.push("Z"),r=n,s.push(`M ${o}`)}else s.push(n===r?`M ${o}`:`L ${o}`)}for(let i=t.length-1;i>=r;i--)s.push(`L ${e[i][0]},${e[i][1]}`);return s.push("Z"),s.join(" ")}$_createImage(t){const e=new sh(t);return e.setVisible(!1),e}}class lc extends Jh{constructor(t){super(t,"rm-route-series",!1,!1),this._lines=new Gh(this._pointContainer,hc,"rm-route-series-line")}needClip(){return!0}_getPointPool(){return this._lines}_setPointColor(t,e){t.line.setFill(e),t.arrow.setFill(e)}_doPrepeare(t,e,i){i&&this.$_prepareLines(e,e._visPoints)}_doRender(t,e){this.$_layoutLines(A(this._getGrowRate(),NaN))}_doReset(){}_runShowEffect(t){t&&dl.grow(this)}_doViewRateChanged(t){this.$_layoutLines(t)}runPointAddAnimation(t){}_legendColorProp(){return"fill"}$_prepareLines(t,e){const i=e.length;this._pointContainer.setFill(t._runColor),this._pointContainer.setStroke("none"),this._lines.prepare(i,((i,s)=>{const r=i.point=e[s];this._setPointStyle(i,t,r),i.prepare(t),i.line.setStroke("none"),ft.setNoScale(i.line.dom),i.arrow.setStroke("none"),ft.setNoScale(i.arrow.dom),i.image.setAttr("href",t.getImageUrl(r)||""),i.secondImage.setAttr("href",t.getImageUrl(r)||"")}))}$_layoutLines(t){const e=this.model,i=e.chart;if(i.isDirty||!isNaN(t)){const s=i.getProjection(),r=e.prop("arrowDisplay");t=A(t,1),this._lines.forEach(((i,n)=>{this.$_layoutLine(i,e,s,r,t*i.point.vrate())}))}}$_layoutLine(t,e,s,n,o){const a=t.point,h=e.getRouteMode();let l=[];const c=this.chart().isGlobe,d=[a.lon1,a.lat1],_=[a.lon2,a.lat2];if(t.setVisible(!a.isNull)&&t.setVisible(!0))if(i(a.path)){const e=a.path,i=[];let n=0;for(;n<e.length;)r(e[n])?(i.push(e[n]),n++):(i.push(...s.project([e[n],e[n+1]])),n+=2);t.line.setPath(i.join(" "))}else{if(h===Zi)l=this.$_genCubicBezierPath(a,d,_,lc.INTERPOLATION);else l=this.$_genGcnPath(d,_,lc.INTERPOLATION);const i="none"!==n&&(o<1||"moving"!==n);let r=e.getLineWidth();r/=this._scale;!c&&this.$_checkBoundaryCrossing(l)?this.$_renderDuplicatedPaths(t,e,s,l,r,o,i):this.$_renderSinglePath(t,e,s,l,r,o,i)}}$_renderSinglePath(t,e,i,s,r,n,o){const a=s.map((t=>i.project(t))).filter((t=>!t.outside));n<1&&(a.length=a.length*n|0);const{topPath:h,bottomPath:l}=this.$_generateOffsetPaths(a,0,r/2);t.render(e,1/this._scale,a,h,l,-1,o)}$_renderDuplicatedPaths(t,e,i,s,r,n,o){const a=this.model.chart.body.scroll,h=s.map((t=>t[0])),l=Math.min(...h);let c;Math.max(...h)>180+a?c=-360:l<-180+a&&(c=360);const d=s.map((t=>[t[0]+c,t[1]])),_=s.map((t=>i.project(t))).filter((t=>!t.outside)),u=d.map((t=>i.project(t))).filter((t=>!t.outside));if(n<1&&(_.length=_.length*n|0,u.length=u.length*n|0),0===_.length||0===u.length)return void t.clear();const p=[..._,...u],{topPath:g,bottomPath:m}=this.$_genSplitedOffsetPath(_,u,r/2);t.render(e,1/this._scale,p,g,m,_.length-1,o)}$_checkBoundaryCrossing(t){if(t.length<2)return!1;const e=this.chart().body.scroll,i=-180+e,s=180+e,r=t.map((t=>t[0])),n=Math.min(...r),o=Math.max(...r);return n<i||o>s}$_genSplitedOffsetPath(t,e,i){const{topPath:s,bottomPath:r}=this.$_generateOffsetPaths(t,0,i),{topPath:n,bottomPath:o}=this.$_generateOffsetPaths(e,0,i);return{topPath:[...s,...n],bottomPath:[...r,...o]}}$_genGcnPath(t,e,i){const s=[];let r=t[0];for(let n=0;n<=i;n++){const o=n/i,a=this.interpolate(t,e,o,r);s.push(a),r=a[0]}return s}$_genCubicBezierPath(t,e,i,s){const r=[],n=this.model.chart.getProjection(),o=this.model.chart.body.scroll,[a,h]=this.model.getCurvePoint(t,e,i);n.scroll=0;const l=n.project(e),c=n.project(i),d=a,_=h;let u=e[0];for(let t=0;t<=s;t++){const e=t/s,i=this.$_cubicBezier(l,d,_,c,e),o=n.backward(i);let a=o[0];const h=a-u;h>180?a-=360:h<-180&&(a+=360);const p=[a,o[1]];r.push(p),u=a}return n.scroll=o,r}$_cubicBezier(t,e,i,s,r){const n=r*r,o=n*r,a=1-r,h=a*a,l=h*a;return[l*t[0]+3*h*r*e[0]+3*a*n*i[0]+o*s[0],l*t[1]+3*h*r*e[1]+3*a*n*i[1]+o*s[1]]}interpolate(t,e,i,s){const r=$(t[1]),n=$(t[0]),o=$(e[1]),a=$(e[0]),h=Math.acos(Math.sin(r)*Math.sin(o)+Math.cos(r)*Math.cos(o)*Math.cos(a-n)),l=Math.sin((1-i)*h)/Math.sin(h),c=Math.sin(i*h)/Math.sin(h),d=l*Math.cos(r)*Math.cos(n)+c*Math.cos(o)*Math.cos(a),_=l*Math.cos(r)*Math.sin(n)+c*Math.cos(o)*Math.sin(a),u=l*Math.sin(r)+c*Math.sin(o),p=Math.sqrt(d*d+_*_+u*u),g=Math.asin(u/p);let m=V(Math.atan2(_,d));if(void 0!==s){const t=m-s;t>180?m-=360:t<-180&&(m+=360)}return[m,V(g)]}$_getNormalVector(t,e){let i;if(0===e){i=[t[1][0]-t[0][0],t[1][1]-t[0][1]]}else if(e===t.length-1){i=[t[e][0]-t[e-1][0],t[e][1]-t[e-1][1]]}else{i=[t[e+1][0]-t[e-1][0],t[e+1][1]-t[e-1][1]]}const s=Math.sqrt(i[0]*i[0]+i[1]*i[1]);return 0===s?[0,1]:[-i[1]/s,i[0]/s]}$_generateOffsetPaths(t,e,i){if(t.length<2)return{topPath:[],bottomPath:[]};const s=[],r=[];for(let n=0;n<t.length;n++){const o=t[n];let a=e+(i-e)*(n/(t.length-1));const h=1/this._scale;a=Math.max(a,h);const l=this.$_getNormalVector(t,n),c=[o[0]+l[0]*a,o[1]+l[1]*a],d=[o[0]-l[0]*a,o[1]-l[1]*a];s.push(c),r.push(d)}return{topPath:s,bottomPath:r}}}lc.INTERPOLATION=80;class cc extends il{constructor(t){super(t,!0),this._cells=new Sh(this,oe)}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(zi.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 dc extends sl{constructor(t){super(t,"rm-waffle-series",!0,!1),this._waffles=new Gh(this._pointContainer,cc)}_getPointPool(){return this._waffles}_doPrepeare(t,e,i){this.$_prepareWaffles(e,e._visPoints)}_doRender(t,e){this.$_layoutWaffles(t,e,A(this.growRate,1))}_doReset(){}_runShowEffect(t){t&&dl.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.prop("rotation")||0,h=[this._scale,-this._scale],l=s.prop("position"),c=r.getPosition,d=s.getLabelOff(),_=this._labelViews(),u={...this._getSeriesExt(s,s._visPoints),gap:s.prop("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,P;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&&(P=g.get(r))&&P.setVisible(t._static)&&P.render(p,r,x.flat().map(((t,e)=>t*h[e%2])),null)}}))}}class _c extends Lh{constructor(t){super(t,_c.CLASS_NAME),this.add(this._foreignObj=new ie(t,"","foreignObject")),this._foreignObj.addDom(this._htmlView=t.createElementNS("http://www.w3.org/1999/xhtml","div")),this._htmlView.className=_c.HTML_VIEW_CLASS,this._observer=new MutationObserver((t=>{this.$_refresh()}))}_doMeasure(t,e,i,s){const r=e.getSize(i,s),n=this._htmlView;let o=e.prop("html")||"";const a=(o.startsWith("#")||o.startsWith("."))&&t.querySelector(o);return this._htmlView.style.width=isNaN(r.width)?"max-content":"",this._foreignObj.resize(A(r.width,1e4),r.height),o=e.applyParams(a?a.innerHTML:o)||"<div></div>",o!==n.innerHTML&&(n.innerHTML=o),isNaN(r.width)&&(this._foreignObj.width=n.firstElementChild.offsetWidth),isNaN(r.height)&&(this._foreignObj.height=n.firstElementChild.offsetHeight),a&&this._templateDom!==a&&(this._templateDom=a,this._observer.observe(this._templateDom,{childList:!0,subtree:!0,characterData:!0,attributes:!0})),at.create(n.firstElementChild.offsetWidth,n.firstElementChild.offsetHeight)}_doLayout(t){super._doLayout(t)}_doDispose(){this._observer.disconnect()}$_refresh(){this.chart()._optionChanged(this.model)}}_c.CLASS_NAME="rm-html-annotation",_c.HTML_VIEW_CLASS="rm-html-annotation-view";class uc extends Xh{constructor(t){super(t,!0),this.add(this._foreignObj=new ie(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=A(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=ut.create(0,0,this._htmlView.firstElementChild.offsetWidth,this._htmlView.firstElementChild.offsetHeight)}}class pc extends Jh{constructor(t){super(t,"rm-html-series",!0,!1),this._htmlViews=new Gh(this._pointContainer,uc),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&&dl.grow(this)}_doViewRateChanged(t){this._layoutPoints(t)}$_prepareHtmls(t,e,i){const s=e.getSize(),r=e.prop("html")||"",n=(r.startsWith("#")||r.startsWith("."))&&t.querySelector(r);this._htmlViews.prepare(i.length,((t,o)=>{const a=t.point=i[o],h=e.applyParams(a,n?n.innerHTML:r)||"<div></div>";t.setHtml(h,s.width,s.height),this._setPointStyle(t,e,a)})),n&&this._templateDom!==n&&(this._templateDom=n,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.prop("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.prop("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())}}}))}}function gc(t,e){return new(qh[e._type()])(t)}function mc(t,e){return new(Mh[e._type()])(t)}Jh.register([wa,Xl],[Oa,ac],[Ta,nc],[No,yl],[ua,Bl],[ka,sc],[sa,$l],[Ga,dc],[za,lc],[Zs,xl],[la,Rl],[Ma,tc],[oa,pc],[Go,Al],[ta,Tl]),Lh.register([go,cl],[uo,hl],[po,ll],[_o,_c]);class fc extends Rt{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 bc extends Rt{constructor(t){super(),this.series=t,this.endHandler=()=>{t.model.visible=!1}}_doUpdate(t){return this.series.internalSetStyle("opacity",String(1-t)),!0}}class yc extends se{constructor(t,e,i){super(t,"rm-series-container"),this.labelsContainer=e,this.second=i,this.seriesViews=[],this.seriesMap={},this.add(this._axisLayer=new se(t)),this._axisLayer.add(this.axisView=new Nh(t,i)),this._axisLayer.add(this.tickLayer=new Th(t))}get firstMap(){for(const t of this.seriesViews)if(t instanceof Xl&&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]||gc(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&&et.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()))}onRotationStart(){this.seriesViews.forEach((t=>t.visible&&t.onRotationStart()))}onRotationEnd(){this.seriesViews.forEach((t=>t.visible&&t.onRotationEnd()))}setVisible(t){return this.labelsContainer.setVisible(super.setVisible(t))}}class wc extends se{constructor(t,e){super(t,e?"rm-front-axis-guides":"rm-axis-guides"),this.front=e,this._guideViews=[],this.add(this._guideLayer=new se(t)),this.add(this._labelLayer=new se(t))}render(t,e,i,s,r){const n=e.guides.filter((t=>t.prop("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 Vh(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 xc extends fh{constructor(t,e){super(t,"rm-body"),this._annotationViews=[],this._annotationMap=new Map,this._zoom=100,this._owner=e,this.add(this._back=new as(t,"rm-body-background")),this._back.setAttr("fill","transparent"),this.add(this._mapBack=new Bh(t)),this.add(this._contentLayer=new se(t,"rm-body-content")),this.add(this._feedbackContainer=new se(t,"rm-feedbacks")),this.add(this._crosshairView=new Dh(t)),this._contentLayer.add(this._annotationContainer=new se(t,"rm-annotations")),this._contentLayer.add(this._axisGuideContainer=new wc(t,!1)),this._contentLayer.add(this._seriesContainer=new yc(t,new se(t),!1)),this._contentLayer.add(this._seriesContainer.labelsContainer),this._contentLayer.add(this._frontAxisGuideContainer=new wc(t,!0)),this._contentLayer.add(this._frontAnnotationContainer=new se(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(),this.model.projection.isGlobe&&this.onRotationEnd())}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 bc(i)).start())}getBackBounds(){return this._back.getBounds()}addFeedback(t){t&&this._feedbackContainer.add(t)}zoomChanged(t,e){this._seriesContainer.zoomChanged(t,e)}onScrollStart(){var t;(null===(t=this.model)||void 0===t?void 0:t.isScrollable)&&this._seriesContainer.onScrollStart()}onScrollEnd(){this.model.isScrollable&&this._seriesContainer.onScrollEnd()}onRotationStart(){this.model.projection.isGlobe&&this._seriesContainer.onRotationStart()}onRotationEnd(){this.model.projection.isGlobe&&this._seriesContainer.onRotationEnd()}_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),at.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),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((o=>{const h=o.axisView,d=o.tickLayer;h.setScale(u),h.measure(i,a,c,l),h.resize(c,l),h.trans(p,g),d.setVisible(a.tick.visible)&&(d.prepare(i,a.tick,h.steps),d.resize(c,l),d.setScale(u),d.layout(s.projection),d.trans(p,g)),o.seriesViews.forEach((i=>{var s,o;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===(o=i.secondLabelContainer())||void 0===o||o.trans(p,g);const a=i.resolveBoundsClip(w,u,p,g,n);i.setClip(i.needClip()?a:null),r!==this._zoom&&i.zoomChanged(this._zoom,r)})),h.layout(),o.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 fc(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){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)||mc(t,e);(e.prop("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 de(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 vc extends bh{constructor(t,e){super(t,e?vc.SUBTITLE_CLASS:vc.TITLE_CLASS,e?"rm-subtitle-background":"rm-title-background"),this.isSub=e,this.add(this._textView=new Qe(t)),this._richText=new hi}_marginable(){return!1}_setBackgroundStyle(t){t.internalSetStyleOrClass(this.model.prop("backgroundStyle"))}_doMeasure(t,e,i,s){return this.chart().isDirty&&(this._richText.setFormat(e.prop("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)}}vc.TITLE_CLASS="rm-title",vc.SUBTITLE_CLASS="rm-subtitle";const Sc="circle",Cc="header";var Pc;!function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(Pc||(Pc={}));class Mc extends ie{constructor(t){super(t,Mc.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 oe(t,"rm-tooltip-back")),this.add(this._top=new oe(t,"rm-tooltip-top")),this.add(this._border=new oe(t,"rm-tooltip-border")),this.add(this._textView=new Qe(t,"rm-tooltip-text")),this._back.setAttr("filter","url(#"+ee.SHADOW_FILTER+")"),this._textView.anchor=Ke.START,this._richText=new hi,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.setTarget(t,a),c=(null===(o=e.tooltipColor)||void 0===o?void 0:o.call(e))||t._calcedColor,d=h.prop("mode");if(!l)return;const p=h.prop("text")||l.getTooltipText(t,a);if(!p)return;const g=this.control,m=g.contentWidth(),f=g.contentHeight(),b=this._textView;this._richText.setFormat(p),this._richText.build(b,NaN,NaN,null,h.getTextDomain());const{w:y,h:w}=this.calcBounds(d,h);this._top.setFill(c);const x="visible"===this.getStyle("visibility")?300:0,v=h.prop("offset")+this._tailSize,S=e.getBounds(),C=g.getBounds();let P;P=i-y/2-u(0,_(i-y/2,m-y)),this._tailVisible=Math.abs(y/2-this._radius-this._tailSize/2)>Math.abs(P),h.isFollowPointer(t)||(C.bottom,S.bottom);const M=Pc.TOP;d===Sc?(this.drawCircleTooltip(0,0,y,w,M,P),this._back.setFill("var(--rm-tooltip-bg)"),b.setFill("var(--rm-tooltip-color)")):d===Cc?(this.drawHeaderTooltip(0,0,y,w,M,P),this._back.setFill("var(--rm-tooltip-headermode-bg)"),b.setFill("var(--rm-tooltip-headermode-color)")):(this.drawLineTooltip(0,0,y,w,M,P),this._back.setFill("var(--rm-tooltip-bg)"),b.setFill("var(--rm-tooltip-color)")),s-=w+v,i=u(0,_(i-=y/2,m-y)),s=u(0,_(s,f-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.prop("hideDelay"):lo.defaults.hideDelay))}isVisible(){return"visible"===this.getStyle("visibility")}$_hide(){!function(t,e,i,s,r,n){const o=null!=i?j(e,i):{},a=j(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===Pc.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=u(e.prop("minWidth")||0,i.width+16),r=u(e.prop("minHeight")||0,i.height+12)):"circle"===t?(s=u(e.prop("minWidth")||0,i.width+2*this._circlePaddingX+this._gap+2*this._circleRadius),r=u(e.prop("minHeight")||0,i.height+2*this._circlePaddingY)):(s=u(e.prop("minWidth")||0,i.width+2*this._linePaddingX2),r=u(e.prop("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===Pc.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===Pc.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===Pc.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===Pc.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}}Mc.CLASS_NAME="rm-tooltip";class Lc extends vh{constructor(t){super(t,Lc.SCALE_CLASS,"rm-color-scale-background");const e=this._scaleLayer=new se(t);this.add(e),e.add(this._boxLayer=new se(t)),this._boxes=new Sh(this._boxLayer,as,"rm-color-scale-box"),e.add(this._splitLayer=new se(t)),this._splits=new Sh(this._splitLayer,Fh,"rm-color-scale-split"),e.add(this._markerLabel=new ph(t,void 0)),e.add(this._marker=new oe(t,"rm-color-scale-marker")),e.add(this._tickLineLayer=new se(t,"rm-color-scale-tick-line")),e.add(this._tickLabelLayer=new se(t,"rm-color-scale-tick-label")),e.add(this._nullLayer=new se(t,"rm-color-scale-null")),this._tickLines=new Sh(this._tickLineLayer,Fh),this._tickLabels=new Sh(this._tickLabelLayer,ph),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.prop("length")||0,h=o.line,l=o.label,c=this._vertical="vertical"===e.getLayout(),d=this._reversed=e.prop("reversed"),_=this._inverted=e.prop("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.prop("minVisible")),e>1){t.last.setVisible(!1!==o.prop("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.prop("minVisible")),i>1){e.last.setVisible(!1!==o.prop("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.prop("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.prop("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.prop("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.prop("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`${Lc.SCALE_FILL}+${t}`}$_getFillUrl(t){return`url(#${this.$_getFillId(t)})`}$_createGradient(t,e){const i=t.createElementNS(At,"linearGradient"),s=this.$_getFillId(e);return i.setAttribute("id",s),i.appendChild(t.createElementNS(At,"stop")),i.appendChild(t.createElementNS(At,"stop")),this.control.addDef(i),i}$_setDir(t,e,i){e?ft.setAttrs(t,i?Lc.VERT_FILL_I:Lc.VERT_FILL):ft.setAttrs(t,i?Lc.HORZ_FILL_I:Lc.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.prop("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",nt.interpolate(i,s,(r+1)/t).toString())}))}else if(n)n.forEach(((e,i)=>{r.push(this.$_createGradient(t,i)),r[r.length-1][Ai]=e})),r.forEach((t=>{const e=t[Ai];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 as(t,"rm-color-scale-box")),e.add(this._nullLabel=new ph(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.prop("color")&&this._nullBar.setFill(t.prop("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)}}Lc.SCALE_CLASS="rm-color-scale",Lc.SCALE_FILL="rm-color-scale-fill",Lc.HORZ_FILL={x1:"0%",y1:"0%",x2:"100%",y2:"0%"},Lc.HORZ_FILL_I={x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Lc.VERT_FILL={x1:"0%",y1:"100%",x2:"0%",y2:"0%"},Lc.VERT_FILL_I={x1:"0%",y1:"0%",x2:"0%",y2:"100%"};class Ac extends ie{constructor(t,e,i){super(t,Ac.STYLE),this._hitLimitW=0,this._hitLimitH=0,this.add(this._hit=new as(t,Ac.HIT_STYLE)),this.add(this._back=new as(t,Ac.BACK_STYLE)),this.add(this._textView=new Qe(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}setHitLimit(t,e){this._hitLimitW=t,this._hitLimitH=e}layout(t,e){this.internalSetStyleOrClass(e),this._textView.layout=qe.MIDDLE,this._textView.layoutText();const i=this._textView.bbox(),s=getComputedStyle(this._back.dom),r=(new Ht).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}),this.$_layoutHit()}click(){return!1}$_layoutHit(){const t=this._back.rect,e=this.$_hitSize(t.width,this._hitLimitW),i=this.$_hitSize(t.height,this._hitLimitH);this._hit.rect={x:t.x+(t.width-e)/2,y:t.y+(t.height-i)/2,width:e,height:i}}$_hitSize(t,e){return Math.max(t,Math.min(Ac.HIT_SIZE,e))}setVisible(t){if(super.setVisible(t))return t&&this._textView.stain(),!0}}Ac.STYLE="rm-button",Ac.BACK_STYLE="rm-button-background",Ac.HIT_STYLE="rm-button-hit",Ac.HIT_SIZE=44;class kc extends Ac{constructor(t,e,i){super(t,e),this.callback=i}click(){return this.callback(),!0}}class Ic extends fh{}class Ec extends Ic{constructor(t){super(t,"rm-zoom-panel"),this.add(this._btnHome=new kc(t,"「 」",(()=>this.chart().body.setZoom(100)))),this.add(this._btnInc=new kc(t,"+",(()=>this.chart().body.zoomByFactor(this.model.getZoomFactor())))),this.add(this._btnDec=new kc(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.prop("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,i=this._vertical?e.height+this._gap:e.width+this._gap,s=Ac.HIT_SIZE;for(const t of[this._btnHome,this._btnInc,this._btnDec])t.setHitLimit(this._vertical?s:i,this._vertical?i:s);this._btnHome.visible&&this._btnHome.layout(e),this._btnInc.layout(e),this._btnDec.layout(e);let r=this._btnHome.visible?i:0;this._btnHome.trans(0,0),this._vertical?(this._btnInc.trans(0,r),this._btnDec.trans(0,r+i)):(this._btnInc.trans(r,0),this._btnDec.trans(r+i,0))}}class Tc extends Ic{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)[ki]),!0}_doMeasure(t,e,i,s){let r=this._btnBack,n=0,o=0;if("text"===e.prop("type")){null==r||r.remove(),this._textViews||(this._textViews=new Sh(this,Qe,"rm-drilldown-text"),this._seperators=new Sh(this,Qe,"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=Ke.START,t[ki]=i[e]})),this._seperators.prepare(i.length-1,(t=>{t.text=">",t.anchor=Ke.START}))}else{this._textViews&&(this._textViews.clear(),this._seperators.clear()),r||this.add(r=this._btnBack=new kc(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.prop("type")){const t=this.model.prop("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 Nc extends vh{constructor(t){super(t,Nc.SCALE_CLASS,"rm-bubble-scale-background"),this._bubbles=[],this._lines=[],this._labels=[];const e=this._scaleLayer=new se(t);this.add(e),e.add(this._bubbleLayer=new se(t)),e.add(this._lineLayer=new se(t)),e.add(this._labelLayer=new se(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.prop("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.prop("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.prop("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.prop("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;ie.fit(t,this._bubbleLayer,this._bubbles,r,kl,"rm-bubble-scale-bubble"),this._lineLayer.setVisible(s.visible&&s.line.visible)&&ie.fit(t,this._lineLayer,this._lines,r,Fh,"rm-bubble-scale-line"),this._labelLayer.setVisible(s.visible&&s.label.visible)&&ie.fit(t,this._labelLayer,this._labels,r,ph,"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.prop("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.prop("length")+(i.tick.label.prop("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)}))}}}Nc.SCALE_CLASS="rm-bubble-scale";class $c extends vh{constructor(t){super(t,$c.SCALE_CLASS,"rm-map-scale-background")}_doMeasure(t,e,i,s){return this.chart(),{width:100,height:100}}_doLayout(){this._model,this.height}}$c.SCALE_CLASS="rm-map-scale";class Vc extends se{constructor(t){super(t,"rm-mapregion-body"),this._seriesViews=[],this._seriesMap={},this.add(this._seriesContainer=new se(t,"rm-mapregion-body-series")),this.add(this._labelsContainer=new se(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]||gc(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 Rc extends bh{constructor(t){super(t,Rc.CLASS_NAME,"rm-mapregion-background"),this.add(this._bodyView=new Vc(t)),this.add(this._targetView=new as(t,"rm-mapregion-target")),this.add(this._connectorView=new oe(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.prop("backgroundStyle"))}_doMeasure(t,e,i,s){const r=e.getSize(i,s);return isNaN(r.width)&&(isNaN(r.height)?r.width=Za.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]}`}}Rc.CLASS_NAME="rm-mapregion";class Dc extends yh{constructor(){super(...arguments),this._hTitle=0,this._wTitle=0,this._hSub=0,this._wSub=0}_doInitChildren(t){this.add(this.titleView=new vc(t,!1)),this.add(this.subtitleView=new vc(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,_=i,p=0,g=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,g=+n.prop("titleGap")||0):d.setModel(n),n.prop("position")){case"left":case"right":p=u(h,c),_=a+g+l;break;default:p=h+g+c,_=u(_,a+l)}return p>0&&(p+=this.titleView.visible?A(r.prop("gap"),0):A(n.prop("gap"),0)),{width:_,height:p}}_doLayout(t){const e=this.titleView,i=this.subtitleView,s=e.model,r=i.model,n=s&&s.visible?this._wTitle>t.wMap||"chart"===s.prop("alignBase")?t.wChart:t.wMap:0,o=r&&r.visible?this._wSub>t.wMap||"chart"===r.prop("alignBase")?t.wChart:t.wMap:0;let a=this._wTitle>t.wMap||s&&"chart"===s.prop("alignBase")?0:t.xMap,h=this._wSub>t.wMap||r&&"chart"===r.prop("alignBase")?0:t.xMap;if(n>0&&o>0){const t=(t,e,i)=>{switch(t.prop("verticalAlign")){case"top":return 0;case"bottom":return e-i;default:return(e-i)/2}},l=()=>{const e=u(this._hTitle,this._hSub);p=u(p,p+t(s,e,this._hTitle)),m=u(m,m+t(r,e,this._hSub))},c=(t,e,i)=>{switch(t.prop("align")){case"left":return 0;case"right":return e-i;default:return(e-i)/2}},d=()=>{if(g=u(g,g+c(s,n,this._wTitle)),"parent"===r.prop("alignBase"))switch(r.prop("align")){case"left":f=g;break;case"right":f=g+this._wTitle-this._wSub;break;default:f=g+(this._wTitle-this._wSub)/2}else f=u(f,f+c(r,o,this._wSub))},_=A(r.prop("titleGap"),0);let p=0,g=a,m=0,f=h;switch(s.prop("align")){case"left":switch(r.prop("position")){case"left":g=f+this._wSub+_,l();break;case"right":switch(f=g+this._wTitle+_,r.prop("align")){case"center":f=u(f,f+(o-this._wTitle-this._wSub)/2);break;case"right":f=u(f,h+o-this._wSub)}l();break;case"top":d(),p=m+this._hSub+_;break;default:d(),m=p+this._hTitle+_}break;case"right":switch(r.prop("position")){case"left":switch(g+=n-this._wTitle,r.prop("align")){case"center":f+=(n-this._wTitle-this._wSub)/2;break;case"right":f=g-_-this._wSub}l();break;case"right":f+=o-this._wSub,g=f-_-this._wTitle,l();break;case"top":d(),p=m+this._hSub+_;break;default:d(),m=p+this._hTitle+_}break;default:switch(r.prop("position")){case"left":switch(g+=(n-this._wTitle)/2,r.prop("align")){case"left":break;case"center":f+=(g-f-this._wSub)/2;break;case"right":f=g-_-this._wSub}l();break;case"right":switch(g+=(n-this._wTitle)/2,r.prop("align")){case"left":f=g+this._wTitle+_;break;case"center":f=g+this._wTitle+_,f+=(o-f-this._wSub)/2;break;case"right":f+=o-_-this._wSub}l();break;case"top":d(),p=m+this._hSub+_;break;default:d(),m=p+this._hTitle+_}}e.resizeByMeasured().layout().trans(g,p),i.resizeByMeasured().layout().trans(f,m)}else if(n>0||o>0){const t=n?s:r,l=n?e:i,c=n||o,d=n?this._wTitle:this._wSub;let _=n?a:h;switch(l.resizeByMeasured().layout(),t.prop("align")){case"left":break;case"right":_+=c-d;break;default:_+=(c-d)/2}l.trans(_,0)}}_doLocateInner(t,e,i){}}class Oc extends vh{constructor(t){super(t,Oc.GROUP_CLASS,"rm-map-widget-group-background"),this._dic=new Map,this.add(this._widgetLayer=new se(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 at;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.prop("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.prop("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.prop("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.prop("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.prop("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.prop("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(Bc[e._type()])(t),i.add(n),r.push(n))})),null==s||s.forEach((t=>t.remove())),r}}Oc.GROUP_CLASS="rm-map-widget-group";const Bc={legend:Ph,colorScale:Lc,bubbleScale:Nc,group:Oc};class Fc extends yh{constructor(t,e){super(t),this._loc=e,this._horz=e==J.TOP||e==J.BOTTOM,this._vert=e==J.LEFT||e==J.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 Oc&&(e=i.getView(t),e))break;return e}_setWidgets(t,e,s){return i(t)?this._models=t:this._models=[],this._wChart=e,this._hChart=s,this}legendByDom(t){for(const e of this._views.values()){const i=e instanceof Ph&&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=A(+e.general.prop("widgetGap"),0),o=new at;return this._horz?(r.forEach((t=>{o.width+=t.mw,o.height=u(o.height,t.mh)})),o.width+=r.size>0?(r.size-1)*n:0):this._vert?(r.forEach((t=>{o.width=u(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=i.mw,n=i.mh;let o=+s.prop("offsetX")||0,a=0,h=0;switch(s.prop("align")){case"right":a+=t-r-o;break;case"center":a+=(t-r)/2+o;break;default:a+=o}switch(o=+s.prop("offsetY")||0,s.prop("verticalAlign")){case"bottom":h+=e-n-o;break;case"middle":h+=(e-n)/2+o;break;default:h+=o}i.trans(a,h).resize(r,n),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(Bc[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.prop("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.prop("verticalAlign")){case"top":this._starts.push(s);break;case"bottom":this._ends.push(s);break;default:this._centers.push(s)}})),this._views=r}}class zc extends fh{constructor(t){super(t,"rm-credits"),this.add(this._textView=new Qe(t)),this._textView.anchor=Ke.START}click(t){this.model.prop("url")&&window.open(this.model.prop("url"),"new")}locateInner(t,e){const i=this.width,s=this.height,r=+t.prop("offsetX")||0,n=+t.prop("offsetY")||0;let o=0,a=0;switch(t.prop("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.prop("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.prop("location"),r=this.width,n=this.height,o=+t.prop("offsetX")||0,a=+t.prop("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.prop("verticalAlign")){case"top":l=a;break;case"bottom":l=i-n;break;default:l=(i-n)/2+a}else switch(t.prop("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.prop("text"),this.setCursor(e.prop("url")?"pointer":""),this._textView.bbox()}}class jc extends se{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 se(t,"rm-annotations")),this.add(this._bodyView=new xc(t,this)),this.add(this._mapRegionContainer=new se(t,"rm-mapregions")),this.add(this._titleSectionView=new Dc(t)),this.add(this._widgetLayer=new se(t,"rm-widgets")),this.add(this._frontAnnotationContainer=new se(t,"rm-front-annotations")),this.add(this._zoomPanelView=new Ec(t)),this.add(this._drilldownPanelView=new Tc(t)),this.add(this._mapScaleView=new $c(t)),this.add(this._creditView=new zc(t)),this.add(this._tooltipView=new Mc(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))switch(o=this._creditView.measure(t,r,a,h),r.prop("location")){case"body":break;case"right":case"left":a-=o.width+(+r.prop("offsetX")||0)+(+r.prop("gap")||0);break;default:h-=o.height+(+r.prop("offsetY")||0)+(+r.prop("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(J)){const n=l[r];let o=this._widgetMap[r];if(n.length>0){o?o.setVisible(!0):(o=new Fc(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.general.getWidgetSectionGap(r);r===J.BOTTOM||r===J.TOP?h-=l.height+t:r!==J.RIGHT&&r!==J.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){h.resizeByMeasured();const t=h.width+(+a.prop("offsetX")||0)+(+a.prop("gap")||0),e=h.height+(+a.prop("offsetY")||0)+(+a.prop("gap")||0);switch(a.prop("location")){case"body":break;case"right":s-=t;break;case"left":s-=t,c+=t;break;case"top":r-=e,d+=e;break;default:r-=l=e}}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===J.RIGHT||n===J.LEFT?(o.resize(o.mw,i),o.layout()):n===J.TOP||n===J.BOTTOM?(o.resize(e,o.mh),o.layout()):o.resize(o.mw,o.mh);const a=t.general.getWidgetSectionGap(n);switch(n){case J.BOTTOM:r-=o.height+a;break;case J.TOP:r-=o.height+a,d+=o.height+a;break;case J.RIGHT:s-=o.width+a;break;case J.LEFT:s-=o.width+a,c+=o.width+a}}}const p=ut.create(c,d,s,r);if(h.visible){const t="body"===a.prop("location")?h.locateInner(a,p):h.locateOuter(a,e,i);h.transp(t)}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 J.BOTTOM:default:d=i-l-0-s.height,c=(e-s.width)/2;break;case J.TOP:d=o+0,c=(e-s.width)/2;break;case J.RIGHT:d=(i-s.height)/2,c=e-0-s.width;break;case J.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&&this._model.canClick()){const r=Object.assign({},this.control.pointerToPoint(t)),n=this._bodyView.mouseToMap(r,!1);let o;i instanceof Xl&&(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()}onRotationStart(){this.bodyView().onRotationStart()}$_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)||mc(t,e);(!1===e.prop("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.prop("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 Rc(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=s.boundsByCoord(i.model.prop("bounds")[0],i.model.prop("bounds")[1]);if("container"===i.model.prop("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;d.x+=r,d.y+=n,i._layoutView(a,h,l,c,d)}))}$_layoutPanel(t,e){const i=t.model,s=i.prop("offsetX")||0,r=i.prop("offsetY")||0,n=t.width,o=t.height;let a=e.x,h=e.y;switch(i.prop("verticalAlign")){case"bottom":h+=e.height-r-o;break;case"middle":h+=(e.height-o)/2+r;break;default:h+=r}switch(i.prop("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 Gc;!function(t){t.EXPORT="$$realmap_export"}(Gc||(Gc={}));class Hc extends ee{static $_conf(t,e){!function(t,e){const i=Jt(e);if(!t||!i)return;let s=qt.get(t);s||qt.set(t,s=new Set),s.add(i)}(t,e)}constructor(t,e){super(t,e),this._isLoading=!1,this.addElement(this._chartView=this._createChartView(t)),this.addElement(this._errorView=new Qe(t,"rm-error-view")),this._chart=new hh(null,((t,e)=>{this.changeModel(t,e)})),this._errorView.visible=!1}_createChartView(t){return new jc(t)}_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===Gc.EXPORT){const e=t.createExporter(this.doc(),this.dom(),this.model);this.chart.exporter.compose(e)}}setLoading(t){this._isLoading=t}showErrorView(t="맵차트 렌더링 중 오류가 발생했습니다."){this._errorView.visible=!0,this._errorView.layout=qe.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 mh(this)}_doBeforeRender(t){this._chart&&t.internalResetStyleOrClass(this._chart.general.prop("style"))}_doRender(t){const e=this.model,i=this._chartView,s=t.width,r=t.height;this._setBackgroundStyle(e.general.prop("backgroundStyle")),e&&(this.setData("theme",e.general.prop("theme"),!0),this.setResizeDelay(e.general.prop("resizeDelay")),e.prepareRender(),this.$_loadModules()),this.loaded||i.clean(),s>0&&r>0&&(i.measure(this.doc(),e,s,r),i.setRect(t),i.layout()),e&&e.afterRender()}_doAfterRender(){var t;if(this._chartView.bodyView().afterRender(),null===(t=this._chart)||void 0===t?void 0:t._loadCallback){const t=this._chart._loadCallback;setTimeout((()=>{t({chart:this.chart})}),0),this._chart._loadCallback=void 0}}_updateTouchAction(){this.dom().style.touchAction=this.$_calcTouchAction()}isLoading(){return this._isLoading}_doWheel(t){return!(this.model&&!this.model.wheelable())}$_calcTouchAction(){const t=this.model;if(!(null==t?void 0:t.body))return"manipulation";const{x:e,y:i}=t.dragAxes();return e&&i?"none":e?"pan-y":i?"pan-x":t.interactive()?"pan-x pan-y":"manipulation"}$_loadModules(){if(!this.chart.exporter.isCompose()){const t=null===window||void 0===window?void 0:window.$$_RealMapExporter;t&&t.RealMapExport(this.chart)}}$_export(t){if(!this.model||!this.chart.exporter.isCompose())return;const e=this.dom();switch(t.type){case"png":case"jpeg":case"svg":this.chart.exporter.exportToImage(e,t)}}}const Wc={chartControl:Hc};class Yc{static getVersion(){return"1.1.20"}static setLicenseKey(t){Zt.code=t}static setDebugging(t){ie.DEBUGGING=t}static setLogging(t){et.LOGGING=t}static getDistance(t,e){return os.getDistance(t,e)}static setGlobals(t){Object.assign(Wc,t)}static createChart(t,e,i,s=!0,r){kt.loadConfigAsync(i,!0);const n=new Wc.chartControl(t,e);return Yc.loadChart(n,i,s,r),n.chart[ah]=n,n.chart}static async createChartAsync(t,e,i,s=!0,r){const n=new nh(t,e);n.show();let o=null;try{await kt.loadConfigAsync(i),o=new Wc.chartControl(t,e),o.setLoading(!0),o.chart[ah]=o,Yc.loadChart(o,i,s,r)}catch(t){oh.handleChartInitError(t,o)}finally{null==o||o.setLoading(!1),n.hide(),n.dispose()}return o.chart}static preset(t,e){return jn.createStockInset(t,e)}static loadChart(t,i,s,r){t.chart.load(e(i)?i:{},s,r)}}class Zc{constructor(){this._moduleMap=new Map}static getInstance(){return Zc.instance||(Zc.instance=new Zc),Zc.instance}registerModule(t,e){this._moduleMap.set(t,e)}findModule(t){return this._moduleMap.get(t)||null}}Zc.instance=null,Zc.ModuleNames={realchart:"realchart"};const Uc=Yc.getVersion,Xc=Yc.setDebugging,Kc=Yc.setLogging,qc=Yc.setGlobals,Jc=Yc.getDistance,Qc=Yc.createChart,td=Yc.createChartAsync,ed=Yc.preset,id=Yc.setLicenseKey;export{Hi as Annotation,Lh as AnnotationView,is as BandSeriesType,No as BarSeries,yl as BarSeriesView,Qa as Body,xc as BodyView,Zs as BubbleSeries,xl as BubbleSeriesView,co as ChartAnnotationType,Hc as ChartControl,fh as ChartElement,ui as ChartItem,ih as ChartObject,jc as ChartView,kl as CircleElement,Go as CircleGauge,Al as CircleGaugeView,ta as ClockGauge,Tl as ClockGaugeView,nt as Color,ir as ColorRanger,$s as CoordBaseSeries,Li as Credits,y as DEG_RAD,gs as DataPoint,bs as DataPointLabel,ft as Dom,ch as DragTracker,Sh as ElementPool,ur as Exporter,Zc as ExternalModuleManager,Ki as FeatureSeriesType,sa as FigureSeries,$l as FigureSeriesView,ns as GLPointSeriesType,Ji as HeatmapSeriesType,_o as HtmlAnnotation,_c as HtmlAnnotationView,oa as HtmlSeries,pc as HtmlSeriesView,uo as ImageAnnotation,hl as ImageAnnotationView,sh as ImageElement,la as ImageSeries,Rl as ImageSeriesView,se as LayerElement,tr as Legend,Fh as LineElement,ua as LineSeries,Bl as LineSeriesView,Jn as MapArea,Lr as MapAxis,Sr as MapAxisBandGuide,xr as MapAxisGuide,vr as MapAxisLineGuide,Cr as MapAxisRangeGuide,hh as MapChart,Mr as MapCrosshair,wa as MapSeries,Xi as MapSeriesType,Xl as MapSeriesView,mh as MapTool,Rs as MarkerSeries,Vs as MarkerSeriesPoint,tl as MarkerSeriesPointView,el as MarkerSeriesView,b as ORG_ANGLE,zs as OrthogonalSparkSeries,m as PI,f as PI_2,Ma as PanelSeries,tc as PanelSeriesView,oe as PathElement,ka as PieSeries,sc as PieSeriesView,Ta as PinSeries,nc as PinSeriesView,Xh as PointElement,Hh as PointLabelView,Oa as PointSeries,ac as PointSeriesView,Gh as PointViewPool,zh as PolyLineElement,w as RAD_DEG,as as RectElement,Qi as RegionSeriesType,ie as RmElement,za as RouteSeries,Ui as RouteSeriesType,lc as RouteSeriesView,At as SVGNS,rs as SankeySeriesType,yh as SectionView,vl as SectorElement,Is as Series,dl as SeriesAnimation,Jh as SeriesView,po as ShapeAnnotation,ll as ShapeAnnotationView,at as Size,Bs as SparkSeries,ho as Subtitle,ss as TableSeriesType,Ke as TextAnchor,go as TextAnnotation,cl as TextAnnotationView,Qe as TextElement,qe as TextLayout,ts as TiledWebSeriesType,ao as Title,es as TrackSeriesType,et as Utils,Ts as ValuePoint,Ns as ValueSeries,qi as VectorSeriesType,Ga as WaffleSeries,dc as WaffleSeriesView,M as _isIE,p as absv,a as assignObj,U as calcPercent,l as ceil,g as copyObj,c as cos,Qc as createChart,td as createChartAsync,lt as createRect,ci as extend,Et as fixnum,h as floor,Jc as getDistance,Uc as getVersion,T as incv,i as isArray,dt as isEmptyRect,e as isObject,r as isString,u as maxv,_ as minv,$i as parseCoord,Z as parsePercentSize,A as pickNum,I as pickProp,E as pickProp3,R as pixel,ed as preset,ct as rectToSize,Xc as setDebugging,qc as setGlobals,id as setLicenseKey,Kc as setLogging,d as sin};